Put in new allwiplib-2018 and packaged the large files

added new allwpilib

added ntcore

Added new wpiutil

Change-Id: I5bbb966a69ac2fbdce056e4c092a13f246dbaa6a
diff --git a/third_party/allwpilib_2018/.clang-format b/third_party/allwpilib_2018/.clang-format
new file mode 100644
index 0000000..92b4049
--- /dev/null
+++ b/third_party/allwpilib_2018/.clang-format
@@ -0,0 +1,107 @@
+---
+Language:        Cpp
+BasedOnStyle:  Google
+AccessModifierOffset: -1
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IncludeCategories:
+  - Regex:           '^<.*\.h>'
+    Priority:        1
+  - Regex:           '^<.*'
+    Priority:        2
+  - Regex:           '.*'
+    Priority:        3
+IncludeIsMainRegex: '([-_](test|unittest))?$'
+IndentCaseLabels: true
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments:  true
+SortIncludes:    false
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 2
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Auto
+TabWidth:        8
+UseTab:          Never
+...
diff --git a/third_party/allwpilib_2018/.gitignore b/third_party/allwpilib_2018/.gitignore
new file mode 100644
index 0000000..a3be372
--- /dev/null
+++ b/third_party/allwpilib_2018/.gitignore
@@ -0,0 +1,219 @@
+# WPIlib Specific
+
+dependency-reduced-pom.xml
+/wpilibj/src/shared/java/edu/wpi/first/wpilibj/util/WPILibVersion.java
+/wpilibc/shared/src/WPILibVersion.cpp
+/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/WPILibVersion.java
+/wpilibc/src/main/native/cpp/WPILibVersion.cpp
+doxygen.log
+
+# Created by the jenkins test script
+test-reports
+
+# IntelliJ
+*.iml
+*.ipr
+*.iws
+.idea/
+
+# Created by http://www.gitignore.io
+
+### Linux ###
+*~
+
+# KDE directory preferences
+.directory
+
+
+### Windows ###
+# Windows image file caches
+Thumbs.db
+ehthumbs.db
+
+# Folder config file
+Desktop.ini
+
+# Recycle Bin used on file shares
+$RECYCLE.BIN/
+
+# Windows Installer files
+*.cab
+*.msi
+*.msm
+*.msp
+
+
+### OSX ###
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Icon must end with two \r
+Icon
+
+
+# Thumbnails
+._*
+
+# Files that might appear on external disk
+.Spotlight-V100
+.Trashes
+
+# Directories potentially created on remote AFP share
+.AppleDB
+.AppleDesktop
+Network Trash Folder
+Temporary Items
+.apdisk
+
+
+### Java ###
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Compiled Dynamic libraries
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
+### Maven ###
+target/
+pom.xml.tag
+pom.xml.releaseBackup
+pom.xml.versionsBackup
+pom.xml.next
+release.properties
+
+
+### CMake ###
+CMakeCache.txt
+CMakeFiles
+cmake_install.cmake
+install_manifest.txt
+
+
+### Gradle ###
+.gradle
+build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+
+### Vagrant ###
+.vagrant/
+
+
+### Eclipse ###
+*.pydevproject
+.metadata
+.gradle
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+
+### Python ###
+*.pyc
+__pycache__
+
+# Gradle wrapper
+!gradle-wrapper.jar
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# TeXlipse plugin
+.texlipse
+
+#catkin stuff
+package.xml
+
+# Doxygen stuff
+NO
+
+# Simulation folder stuff
+!simulation/install_resources/*
+
+# VSCode
+.vscode/
+
+#classpaths and projects
+.project
+.classpath
+
+#Visual Studio
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+*.VC.db-shm
+*.VC.db-wal
+
+*.sln
+*.vcxproj
+*.vcxproj.filters
+
+# Visual Studio 2015 cache/options directory
+.vs/
diff --git a/third_party/allwpilib_2018/.styleguide b/third_party/allwpilib_2018/.styleguide
new file mode 100644
index 0000000..a18f24c
--- /dev/null
+++ b/third_party/allwpilib_2018/.styleguide
@@ -0,0 +1,41 @@
+cppHeaderFileInclude {
+  \.h$
+  \.hpp$
+  \.inc$
+}
+
+cppSrcFileInclude {
+  \.cpp$
+}
+
+generatedFileExclude {
+  gmock/
+  ni-libraries/include/
+  ni-libraries/lib/
+  hal/src/main/native/athena/ctre/
+  hal/src/main/native/athena/frccansae/
+  hal/src/main/native/athena/visa/
+  hal/src/main/native/include/ctre/
+  UsageReporting\.h$
+}
+
+modifiableFileExclude {
+  wpilibj/src/arm-linux-jni/
+  wpilibj/src/main/native/cpp/
+  \.patch$
+  \.png$
+  \.py$
+  \.so$
+}
+
+includeOtherLibs {
+  ^HAL/
+  ^llvm/
+  ^networktables/
+  ^opencv2/
+  ^support/
+}
+
+includeProject {
+  ^ctre/
+}
diff --git a/third_party/allwpilib_2018/.styleguide-license b/third_party/allwpilib_2018/.styleguide-license
new file mode 100644
index 0000000..b802370
--- /dev/null
+++ b/third_party/allwpilib_2018/.styleguide-license
@@ -0,0 +1,6 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) {year} FIRST. All Rights Reserved.{padding}*/
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
diff --git a/third_party/allwpilib_2018/.travis.yml b/third_party/allwpilib_2018/.travis.yml
new file mode 100644
index 0000000..75b4cb4
--- /dev/null
+++ b/third_party/allwpilib_2018/.travis.yml
@@ -0,0 +1,40 @@
+sudo: true
+dist: trusty
+language: java
+
+addons:
+  apt:
+    sources:
+      - deadsnakes
+      - ubuntu-toolchain-r-test
+    packages:
+      - g++-6
+      - python3.5
+
+before_install:
+  - sudo sh -c 'echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /etc/apt/sources.list.d/llvm.list'
+  - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
+  - sudo apt-get update -q || true
+  - sudo apt-get install clang-format-5.0 -y
+
+install:
+  - wget https://bootstrap.pypa.io/get-pip.py
+  - sudo python3.5 get-pip.py
+  - python3.5 -m pip install --user wpiformat
+  - mkdir -p $HOME/latest-gcc-symlinks  # see travis-ci/travis-ci#3668
+  - ln -s /usr/bin/g++-6 $HOME/latest-gcc-symlinks/g++
+  - ln -s /usr/bin/gcc-6 $HOME/latest-gcc-symlinks/gcc
+  - export PATH=$HOME/latest-gcc-symlinks:$PATH
+
+before_cache:
+  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+
+cache:
+  directories:
+    - $HOME/.gradle/caches/
+    - $HOME/.gradle/wrapper/
+
+script:
+  - python3.5 -m wpiformat -y 2018 -clang 5.0
+  - git --no-pager diff --exit-code HEAD  # Ensure formatter made no changes
+  - ./gradlew --no-daemon --console=plain -PskipAthena :hal:halSimSharedLibrary :wpilibc:wpilibcSharedLibrary :wpilibj:wpilibJNISharedSharedLibrary :wpilibj:jar
diff --git a/third_party/allwpilib_2018/CONTRIBUTING.md b/third_party/allwpilib_2018/CONTRIBUTING.md
new file mode 100644
index 0000000..6e186a1
--- /dev/null
+++ b/third_party/allwpilib_2018/CONTRIBUTING.md
@@ -0,0 +1,56 @@
+# Contributing to WPILib
+
+So you want to contribute your changes back to WPILib. Great! We have a few contributing rules that will help you make sure your changes will be accepted into the project. Please remember to follow the rules written here, and behave with Gracious Professionalism.
+
+- [General Contribution Rules](#general-contribution-rules)
+- [What to Contribute](#what-to-contribute)
+- [Coding Guidelines](#coding-guidelines)
+- [Submitting Changes](#submitting-changes)
+    - [Pull Request Format](#pull-request-format)
+    - [Merge Process](#merge-process)
+- [Licensing](#licensing)
+
+## General Contribution Rules
+
+- Everything in the library must work for the 3000+ teams that will be using it.
+- We need to be able to maintain submitted changes, even if you are no longer working on the project.
+- Tool suite changes must be generally useful to a broad range of teams
+- Excluding bug fixes, changes in one language generally need to have corresponding changes in other languages.
+    - Some features, such the addition of C++11 for WPILibC or Functional Interfaces for WPILibJ, are specific to that version of WPILib only.
+    - Substantial changes often need to have corresponding LabVIEW changes. To do this, we will work with NI on these large changes.
+- Changes should have tests.
+- Code should be well documented.
+    - This often involves ScreenSteps. To add content to ScreenSteps, we will work with you to get the appropriate articles written.
+
+## What to Contribute
+
+- Bug reports and fixes
+    - We will generally accept bug fixes without too much question. If they are only implemented for one language, we will implement them for any other necessary languages. Bug reports are also welcome, please submit them to our GitHub issue tracker.
+- While we do welcome improvements to the API, there are a few important rules to consider:
+    - Features must be added to both WPILibC and WPILibJ, with rare exceptions.
+    - During competition season, we will not merge any new feature additions. We want to ensure that the API is stable during the season to help minimize issues for teams.
+    - Ask about large changes before spending a bunch of time on them! You can create a new issue on our GitHub tracker for feature request/discussion and talk about it with us there.
+    - Features that make it easier for teams with less experience to be more successful are more likely to be accepted.
+    - Features in WPILib should be broadly applicable to all teams. Anything that is team specific should not be submitted.
+    - As a rule, we are happy with the general structure of WPILib. We are not interested in major rewrites of all of WPILib. We are open to talking about ideas, but backwards compatibility is very important for WPILib, so be sure to keep this in mind when proposing major changes.
+    - Generally speaking, we do not accept code for specific sensors. We have to be able to test the sensor in hardware on the WPILib test bed. Additionally, hardware availability for teams is important. Therefore, as a general rule, the library only directly supports hardware that is in the Kit of Parts. If you are a company interested in getting a sensor into the Kit of Parts, please contact FIRST directly at frcparts@firstinspires.org.
+
+## Coding Guidelines
+
+WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system.
+
+While the library should be fully formatted according to the styles, additional elements of the style guide were not followed when the library was initially created. All new code should follow the guidelines. If you are looking for some easy ramp-up tasks, finding areas that don't follow the style guide and fixing them is very welcome.
+
+## Submitting Changes
+
+### Pull Request Format
+
+Changes should be submitted as a Pull Request against the master branch of WPILib. For most changes, we ask that you squash your changes down to a single commit. For particularly large changes, multiple commits are ok, but assume one commit unless asked otherwise. No change will be merged unless it is up to date with the current master. We will also not merge any changes with merge commits in them; please rebase off of master before submitting a pull request. We do this to make sure that the git history isn't too cluttered.
+
+### Merge Process
+
+When you first submit changes, Travis-CI will attempt to run `./gradlew check` on your change. If this fails, you will need to fix any issues that it sees. Once Travis passes, we will begin the review process in more earnest. One or more WPILib team members will review your change. This will be a back-and-forth process with the WPILib team and the greater community. Once we are satisfied that your change is ready, we will allow our Jenkins instance to test it. This will run the full gamut of checks, including integration tests on actual hardware. Once all tests have passed and the team is satisfied, we will merge your change into the WPILib repository.
+
+## Licensing
+
+By contributing to WPILib, you agree that your code will be distributed with WPILib, and licensed under the license for the WPILib project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as WPILib is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](license.txt).
diff --git a/third_party/allwpilib_2018/LICENSE.txt b/third_party/allwpilib_2018/LICENSE.txt
new file mode 100644
index 0000000..41179db
--- /dev/null
+++ b/third_party/allwpilib_2018/LICENSE.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2009-2017 FIRST
+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 the FIRST 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 FIRST AND CONTRIBUTORS``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST 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.
diff --git a/third_party/allwpilib_2018/README.md b/third_party/allwpilib_2018/README.md
new file mode 100644
index 0000000..a391175
--- /dev/null
+++ b/third_party/allwpilib_2018/README.md
@@ -0,0 +1,114 @@
+# WPILib Project
+
+[![Build Status](https://travis-ci.org/wpilibsuite/allwpilib.svg?branch=master)](https://travis-ci.org/wpilibsuite/allwpilib)
+
+Welcome to the WPILib project. This repository contains the HAL, WPILibJ, and WPILibC projects. These are the core libraries for creating robot programs for the roboRIO.
+
+- [WPILib Mission](#wpilib-mission)
+- [Building WPILib](#building-wpilib)
+    - [Requirements](#requirements)
+    - [Setup](#setup)
+    - [Building](#building)
+    - [Publishing](#publishing)
+    - [Structure and Organization](#structure-and-organization)
+- [Contributing to WPILib](#contributing-to-wpilib)
+
+## WPILib Mission
+
+The WPILib Mission is to enable FIRST Robotics teams to focus on writing game-specific software rather than focussing on hardware details - "raise the floor, don't lower the ceiling". We work to enable teams with limited programming knowledge and/or mentor experience to be as successful as possible, while not hampering the abilities of teams with more advanced programming capabilities. We support Kit of Parts control system components directly in the library. We also strive to keep parity between major features of each language (Java, C++, and NI's LabVIEW), so that teams aren't at a disadvantage for choosing a specific programming language. WPILib is an open source project, licensed under the BSD 3-clause license. You can find a copy of the license [here](license.txt).
+
+# Building WPILib
+
+Using Gradle makes building WPILib very straightforward. It only has a few dependencies on outside tools, such as the ARM cross compiler for creating roboRIO binaries.
+
+## Requirements
+
+- A C++ compiler
+    - On Linux, gcc works fine
+    - On Windows, you need Visual Studio 2015 (the free community edition works fine).
+      Make sure to select the C++ Programming Language for installation
+- [ARM Compiler Toolchain](http://first.wpi.edu/FRC/roborio/toolchains/)
+  * Note that for 2017-2018 and beyond, you will need version 5 or greater of gcc
+- Doxygen (Only required if you want to build the C++ documentation)
+
+## Setup
+
+Clone the WPILib repository. If the toolchains are not installed, install them, and make sure they are available on the system PATH.
+
+See the [styleguide README](https://github.com/wpilibsuite/styleguide/blob/master/README.md) for wpiformat setup instructions.
+
+## Building
+
+All build steps are executed using the Gradle wrapper, `gradlew`. Each target that Gradle can build is referred to as a task. The most common Gradle task to use is `build`. This will build all the outputs created by WPILib. To run, open a console and cd into the cloned WPILib directory. Then:
+
+```bash
+./gradlew build
+```
+
+To build a specific subproject, such as WPILibC, you must access the subproject and run the build task only on that project. Accessing a subproject in Gradle is quite easy. Simply use `:subproject_name:task_name` with the Gradle wrapper. For example, building just WPILibC:
+
+```bash
+./gradlew :wpilibc:build
+```
+
+If you have installed the FRC Toolchain to a directory other than the default, or if the Toolchain location is not on your System PATH, you can pass the `toolChainPath` property to specify where it is located. Example:
+
+```bash
+./gradlew build -PtoolChainPath=some/path/to/frc/toolchain/bin
+```
+
+If you also want simulation to be built, add -PmakeSim. This requires gazebo_transport. We have tested on 14.04 and 15.05, but any correct install of Gazebo should work, even on Windows if you build Gazebo from source. Correct means CMake needs to be able to find gazebo-config.cmake. See [The Gazebo website](https://gazebosim.org/) for installation instructions.
+
+```bash
+./gradlew build -PmakeSim
+```
+
+If you prefer to use CMake directly, the you can still do so.
+The common CMake tasks are wpilibcSim, frc_gazebo_plugins, and gz_msgs
+
+```bash
+mkdir build #run this in the root of allwpilib
+cd build
+cmake ..
+make
+```
+
+The gradlew wrapper only exists in the root of the main project, so be sure to run all commands from there. All of the subprojects have build tasks that can be run. Gradle automatically determines and rebuilds dependencies, so if you make a change in the HAL and then run `./gradlew :wpilibc:build`, the HAL will be rebuilt, then WPILibC.
+
+There are a few tasks other than `build` available. To see them, run the meta-task `tasks`. This will print a list of all available tasks, with a description of each task.
+
+wpiformat can be executed anywhere in the repository via `py -3 -m wpiformat` on Windows or `python3 -m wpiformat` on other platforms.
+
+## Publishing
+
+If you are building to test with the Eclipse plugins or just want to export the build as a Maven-style dependency, simply run the `publish` task. This task will publish all available packages to ~/releases/maven/development. If you need to publish the project to a different repo, you can specify it with `-Prepo=repo_name`. Valid options are:
+
+- development - The default repo.
+- beta - Publishes to ~/releases/maven/beta.
+- stable - Publishes to ~/releases/maven/stable.
+- release - Publishes to ~/releases/maven/release.
+
+The following maven targets a published by this task:
+
+- edu.wpi.first.wpilib.cmake:cpp-root:1.0.0 - roboRIO C++
+- edu.wpi.first.wpilibc.simulation:WPILibCSim:0.1.0 - Simulation C++
+- edu.wpi.first.wpilibj:wpilibJavaFinal:0.1.0-SNAPSHOT - roboRIO Java
+- edu.wpi.first.wpilibj:wpilibJavaSim:0.1.0-SNAPSHOT - Simulation Java
+- edu.wpi.first.wpilibj.simulation:SimDS:0.1.0-SNAPSHOT - The driverstation for controlling simulation.
+- org.gazebosim:JavaGazebo:0.1.0-SNAPSHOT - Gazebo protocol for Java.
+
+## Structure and Organization
+
+The main WPILib code you're probably looking for is in WPILibJ and WPILibC. Those directories are split into shared, sim, and athena. Athena contains the WPILib code meant to run on your roboRIO. Sim is WPILib code meant to run on your computer with Gazebo, and shared is code shared between the two. Shared code must be platform-independent, since it will be compiled with both the ARM cross-compiler and whatever desktop compiler you are using (g++, msvc, etc...).
+
+The Simulation directory contains extra simulation tools and libraries, such as gz_msgs and JavaGazebo. See sub-directories for more information.
+
+The integration test directories for C++ and Java contain test code that runs on our test-system. When you submit code for review, it is tested by those programs. If you add new functionality you should make sure to write tests for it so we don't break it in the future.
+
+The hal directory contains more C++ code meant to run on the roboRIO. HAL is an acronym for "Hardware Abstraction Layer", and it interfaces with the NI Libraries. The NI Libraries contain the low-level code for controlling devices on your robot. The NI Libraries are found in the ni-libraries folder.
+
+The [styleguide repository](https://github.com/wpilibsuite/styleguide) contains our style guides for C++ and Java code. Anything submitted to the WPILib project needs to follow the code style guides outlined in there. For details about the style, please see the contributors document [here](CONTRIBUTING.md#coding-guidelines).
+
+# Contributing to WPILib
+
+See [CONTRIBUTING.md](CONTRIBUTING.md).
diff --git a/third_party/allwpilib_2018/build.gradle b/third_party/allwpilib_2018/build.gradle
new file mode 100644
index 0000000..676e7bf
--- /dev/null
+++ b/third_party/allwpilib_2018/build.gradle
@@ -0,0 +1,202 @@
+import edu.wpi.first.nativeutils.NativeUtils
+import edu.wpi.first.nativeutils.tasks.JNIHeaders
+
+buildscript {
+    repositories {
+        mavenLocal()
+        maven {
+            url "https://plugins.gradle.org/m2/"
+        }
+    }
+    dependencies {
+        classpath 'gradle.plugin.edu.wpi.first:native-utils:1.5.1'
+    }
+}
+
+plugins {
+    id 'net.ltgt.errorprone' version '0.0.10'
+    id 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin' version '2.0'
+    id 'idea'
+}
+
+ext.licenseFile = file("$rootDir/LICENSE.txt")
+
+ext.getJNIHeadersClass = {
+    return JNIHeaders
+}
+
+ext.getClassifier = { binary->
+    return NativeUtils.getClassifier(binary)
+}
+
+ext.getPlatformPath = { binary->
+    return NativeUtils.getPlatformPath(binary)
+}
+
+ext.createComponentZipTasks = { components, name, base, type, project, func ->
+    def configMap = [:]
+    components.each {
+        if (it in NativeLibrarySpec && it.name == name) {
+            it.binaries.each {
+                def target = getClassifier(it)
+                if (configMap.containsKey(target)) {
+                    configMap.get(target).add(it)
+                } else {
+                    configMap.put(target, [])
+                    configMap.get(target).add(it)
+                }
+            }
+        }
+    }
+    def taskList = []
+    def outputsFolder = file("$project.buildDir/outputs")
+    def baseN = base + name
+    configMap.each { key, value ->
+        def task = project.tasks.create(baseN + "-${key}", type) {
+            description = 'Creates component archive for platform ' + key
+            destinationDir =  outputsFolder
+            classifier = key
+            baseName = baseN + '-classifier'
+            duplicatesStrategy = 'exclude'
+
+            from(licenseFile) {
+                into '/'
+            }
+
+            func(it, value)
+        }
+        taskList.add(task)
+
+        project.build.dependsOn task
+
+        project.artifacts {
+            task
+        }
+    }
+    return taskList
+}
+
+ext.createAllCombined = { list, name, base, type, project ->
+    def outputsFolder = file("$project.buildDir/outputs")
+    def baseN = base + name
+    def task = project.tasks.create(baseN + '-all', type) {
+        description = 'Creates component archive for all classifiers'
+        destinationDir = outputsFolder
+        classifier = 'all'
+        baseName = baseN + '-classifier'
+        duplicatesStrategy = 'exclude'
+
+        list.each {
+            it.outputs.files.each {
+                from project.zipTree(it)
+            }
+            dependsOn it
+        }
+    }
+
+    project.build.dependsOn task
+
+    project.artifacts {
+        task
+    }
+
+    return task
+
+}
+
+ext.includeStandardZipFormat = { task, value ->
+    value.each { binary->
+        if (binary.buildable) {
+            if (binary instanceof SharedLibraryBinarySpec) {
+                task.dependsOn binary.buildTask
+                task.from(new File(binary.sharedLibraryFile.absolutePath + ".debug")) {
+                    into getPlatformPath(binary) + '/shared'
+                }
+                task.from (binary.sharedLibraryFile) {
+                    into getPlatformPath(binary) + '/shared'
+                }
+                task.from (binary.sharedLibraryLinkFile) {
+                    into getPlatformPath(binary) + '/shared'
+                }
+            } else if (binary instanceof StaticLibraryBinarySpec) {
+                task.dependsOn binary.buildTask
+                task.from (binary.staticLibraryFile) {
+                    into getPlatformPath(binary) + '/static'
+                }
+            }
+        }
+    }
+}
+
+// Ensure that the WPILibVersioningPlugin is setup by setting the release type, if releaseType wasn't
+// already specified on the command line
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def outputsFolder = file("$buildDir/outputs")
+
+def versionFile = file("$outputsFolder/version.txt")
+
+task outputVersions() {
+    description = 'Prints the versions of wpilib to a file for use by the downstream packaging project'
+    group = 'Build'
+    outputs.files(versionFile)
+
+    doFirst {
+        buildDir.mkdir()
+        outputsFolder.mkdir()
+    }
+
+    doLast {
+        versionFile.write pubVersion
+    }
+}
+
+task build() {}
+
+build.dependsOn outputVersions
+
+task clean(type: Delete) {
+    delete buildDir
+}
+
+subprojects {
+    apply plugin: 'eclipse'
+    apply plugin: 'idea'
+    apply plugin: 'checkstyle'
+
+    repositories {
+        mavenCentral()
+    }
+
+    checkstyle {
+        toolVersion = "8.1"
+        configFile = new File(rootDir, "styleguide/checkstyle.xml")
+    }
+
+    // Disables doclint in java 8.
+    if (JavaVersion.current().isJava8Compatible()) {
+        tasks.withType(Javadoc) {
+            options.addStringOption('Xdoclint:none', '-quiet')
+        }
+    }
+    ext.setupWpilibRepo = { publishing ->
+        publishing.repositories.maven {
+            url = WPILibVersion.mavenLocalUrl
+        }
+    }
+}
+
+task wrapper(type: Wrapper) {
+    gradleVersion = '4.1'
+}
diff --git a/third_party/allwpilib_2018/config.gradle b/third_party/allwpilib_2018/config.gradle
new file mode 100644
index 0000000..0f6394d
--- /dev/null
+++ b/third_party/allwpilib_2018/config.gradle
@@ -0,0 +1,235 @@
+import edu.wpi.first.nativeutils.*

+import org.gradle.internal.os.OperatingSystem

+

+def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/Zi', '/FS', '/Zc:inline', '/MT']

+def windowsReleaseCompilerArgs = ['/O2']

+def windowsLinkerArgs = [ '/DEBUG:FULL' ]

+def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ]

+

+def linuxCompilerArgs = ['-std=c++11', '-Wformat=2', '-Wall', '-Wextra', '-Werror', '-pedantic', '-Wno-psabi', '-g',

+                         '-Wno-unused-parameter', '-fPIC', '-rdynamic', '-Wno-error=deprecated-declarations', '-pthread']

+def linuxLinkerArgs = ['-rdynamic', '-pthread']

+def linuxReleaseCompilerArgs = ['-Og']

+def linuxDebugCompilerArgs = ['-O0']

+def linux32BitArg = '-m32'

+

+def macCompilerArgs =  ['-std=c++11', '-Wall', '-Wextra', '-Werror', '-pedantic-errors', '-fPIC', '-g',

+                            '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-unused-private-field',

+                            '-Wno-unused-const-variable', '-pthread']

+def macReleaseCompilerArgs = ['-O2']

+def macDebugCompilerArgs = ['-O0']

+def mac32BitArg = '-m32'

+

+def buildAll = project.hasProperty('buildAll')

+

+def windows64PlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isWin = OperatingSystem.current().isWindows()

+    if (buildAll) {

+        return isWin

+    } else {

+        return isWin && arch == 'amd64'

+    }

+}

+

+def windows32PlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isWin = OperatingSystem.current().isWindows()

+    if (buildAll) {

+        return isWin

+    } else {

+        return isWin && arch == 'x86'

+    }

+}

+

+def linux32IntelPlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isLinux = OperatingSystem.current().isLinux()

+    def isIntel = (arch == 'amd64' || arch == 'i386')

+    if (buildAll) {

+        return isLinux && isIntel

+    } else {

+        return isLinux && arch == 'i386'

+    }

+}

+

+def linux64IntelPlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isLinux = OperatingSystem.current().isLinux()

+    def isIntel = (arch == 'amd64' || arch == 'i386')

+    if (buildAll) {

+        return isLinux && isIntel

+    } else {

+        return isLinux && arch == 'amd64'

+    }

+}

+

+def linuxArmPlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isIntel = (arch == 'amd64' || arch == 'i386')

+    return OperatingSystem.current().isLinux() && !isIntel

+}

+

+def mac64PlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isMac = OperatingSystem.current().isMacOsX()

+    if (buildAll) {

+        return isMac

+    } else {

+        return isMac && arch == 'x86_64'

+    }

+}

+

+def mac32PlatformDetect = {

+    def arch = System.getProperty("os.arch")

+    def isMac = OperatingSystem.current().isMacOsX()

+    if (buildAll) {

+        return isMac

+    } else {

+        return isMac && arch == 'x86'

+    }

+}

+

+if (!project.hasProperty('skipAthena')) {

+    model {

+        buildConfigs {

+                roboRio(CrossBuildConfig) {

+                architecture = 'athena'

+                operatingSystem = 'linux'

+                toolChainPrefix = 'arm-frc-linux-gnueabi-'

+                compilerArgs = linuxCompilerArgs

+                linkerArgs = linuxLinkerArgs

+                debugCompilerArgs = linuxDebugCompilerArgs

+                releaseCompilerArgs = linuxReleaseCompilerArgs

+                releaseStripBinaries = true

+                compilerFamily = 'Gcc'

+                exclude << 'halSim'

+                exclude << 'halSimStaticDeps'

+                exclude << 'halSimTestingBase'

+                exclude << 'wpilibcTestingBase'

+            }

+        }

+    }

+}

+

+if (!project.hasProperty('onlyAthena')) {

+    model {

+        buildConfigs {

+            winX86(BuildConfig) {

+                architecture = 'x86'

+                operatingSystem = 'windows'

+                compilerArgs = windowsCompilerArgs

+                linkerArgs = windowsLinkerArgs

+                releaseCompilerArgs = windowsReleaseCompilerArgs

+                releaseLinkerArgs = windowsReleaseLinkerArgs

+                compilerFamily = 'VisualCpp'

+                detectPlatform = windows32PlatformDetect

+                exclude << 'halAthena'

+            }

+            winX64(BuildConfig) {

+                architecture = 'x86-64'

+                operatingSystem = 'windows'

+                compilerArgs = windowsCompilerArgs

+                linkerArgs = windowsLinkerArgs

+                releaseCompilerArgs = windowsReleaseCompilerArgs

+                releaseLinkerArgs = windowsReleaseLinkerArgs

+                compilerFamily = 'VisualCpp'

+                detectPlatform = windows64PlatformDetect

+                exclude << 'halAthena'

+            }

+            /* Disable 32 bit linux until we can figure out jenkins

+            linuxX86(BuildConfig) {

+                architecture = 'x86'

+                operatingSystem = 'linux'

+                compilerArgs = linuxCompilerArgs

+                compilerArgs << linux32BitArg

+                linkerArgs = linuxLinkerArgs

+                linkerArgs << linux32BitArg

+                debugCompilerArgs = linuxDebugCompilerArgs

+                releaseCompilerArgs = linuxReleaseCompilerArgs

+                releaseStripBinaries = true

+                compilerFamily = 'Gcc'

+                detectPlatform = linux32IntelPlatformDetect

+                exclude << 'halAthena'

+            }

+            */

+            linuxX64(BuildConfig) {

+                architecture = 'x86-64'

+                operatingSystem = 'linux'

+                compilerArgs = linuxCompilerArgs

+                linkerArgs = linuxLinkerArgs

+                debugCompilerArgs = linuxDebugCompilerArgs

+                releaseCompilerArgs = linuxReleaseCompilerArgs

+                releaseStripBinaries = true

+                compilerFamily = 'Gcc'

+                detectPlatform = linux64IntelPlatformDetect

+                exclude << 'halAthena'

+            }

+            /* 32 bit Mac OS X not supported by OpenCV.

+             * If support is ever added, will add this back in

+            macX86(BuildConfig) {

+                architecture = 'x86'

+                operatingSystem = 'osx'

+                compilerArgs = macCompilerArgs

+                compilerArgs << mac32BitArg

+                linkerArgs << mac32BitArg

+                debugCompilerArgs = macDebugCompilerArgs

+                releaseCompilerArgs = macReleaseCompilerArgs

+                releaseStripBinaries = true

+                compilerFamily = 'Clang'

+                detectPlatform = mac32PlatformDetect

+                exclude << 'halAthena'

+            }

+            */

+            macX64(BuildConfig) {

+                architecture = 'x86-64'

+                operatingSystem = 'osx'

+                compilerArgs = macCompilerArgs

+                debugCompilerArgs = macDebugCompilerArgs

+                releaseCompilerArgs = macReleaseCompilerArgs

+                releaseStripBinaries = true

+                compilerFamily = 'Clang'

+                detectPlatform = mac64PlatformDetect

+                exclude << 'halAthena'

+            }

+        }

+    }

+}

+

+if (project.hasProperty('linuxCross')) {

+    model {

+        buildConfigs {

+            linuxArm(CrossBuildConfig) {

+                architecture = 'nativearm'

+                operatingSystem = 'linux'

+                toolChainPrefix = 'PLEASE_PROVIDE_A_COMPILER_NAME'

+                compilerArgs = linuxCompilerArgs

+                linkerArgs = linuxLinkerArgs

+                debugCompilerArgs = linuxDebugCompilerArgs

+                releaseCompilerArgs = linuxReleaseCompilerArgs

+                releaseStripBinaries = true

+                skipByDefault = true

+                compilerFamily = 'Gcc'

+                exclude << 'gmock'

+                exclude << 'halAthena'

+            }

+        }

+    }

+} else {

+    model {

+        buildConfigs {

+            linuxArm(BuildConfig) {

+                architecture = 'nativearm'

+                operatingSystem = 'linux'

+                compilerArgs = linuxCompilerArgs

+                linkerArgs = linuxLinkerArgs

+                debugCompilerArgs = linuxDebugCompilerArgs

+                releaseCompilerArgs = linuxReleaseCompilerArgs

+                releaseStripBinaries = true

+                compilerFamily = 'Gcc'

+                detectPlatform = linuxArmPlatformDetect

+                exclude << 'halAthena'

+            }

+        }

+    }

+}

diff --git a/third_party/allwpilib_2018/gen/wpilibj_frcnetcomm.py b/third_party/allwpilib_2018/gen/wpilibj_frcnetcomm.py
new file mode 100755
index 0000000..cb353cb
--- /dev/null
+++ b/third_party/allwpilib_2018/gen/wpilibj_frcnetcomm.py
@@ -0,0 +1,178 @@
+#!/usr/bin/env python3
+
+# This script generates the network communication interface for wpilibj.
+#
+# This script takes no arguments and should be invoked from either the gen
+# directory or the root directory of the project.
+
+from datetime import date
+import os
+import re
+import subprocess
+
+# Check that the current directory is part of a Git repository
+def inGitRepo(directory):
+    ret = subprocess.run(["git", "rev-parse"], stderr = subprocess.DEVNULL)
+    return ret.returncode == 0
+
+def main():
+    if not inGitRepo("."):
+        print("Error: not invoked within a Git repository", file = sys.stderr)
+        sys.exit(1)
+
+    # Handle running in either the root or gen directories
+    configPath = "."
+    if os.getcwd().rpartition(os.sep)[2] == "gen":
+        configPath = ".."
+
+    outputName = configPath + \
+        "/wpilibj/src/athena/java/edu/wpi/first/wpilibj/hal/FRCNetComm.java"
+
+    # Set initial copyright year and get current year
+    year = "2016"
+    currentYear = str(date.today().year)
+
+    # Start writing output file
+    with open(outputName + ".tmp", "w") as temp:
+        # Write first line of comment
+        temp.write("/*")
+        for i in range(0, 76):
+            temp.write("-")
+        temp.write("*/\n")
+
+        # Write second line of comment
+        temp.write("/* Copyright (c) FIRST ")
+        if year != currentYear:
+            temp.write(year)
+            temp.write("-")
+        temp.write(currentYear)
+        temp.write(". All Rights Reserved.")
+        for i in range(0, 24):
+            temp.write(" ")
+        if year == currentYear:
+            for i in range(0, 5):
+                temp.write(" ")
+        temp.write("*/\n")
+
+        # Write rest of lines of comment
+        temp.write("""\
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*""")
+        for i in range(0, 76):
+            temp.write("-")
+        temp.write("*/\n")
+
+        # Write preamble
+        temp.write("""
+package edu.wpi.first.wpilibj.hal;
+
+import edu.wpi.first.wpilibj.hal.JNIWrapper;
+
+/**
+ * JNI wrapper for library <b>FRC_NetworkCommunication</b><br>.
+ */
+@SuppressWarnings(\"MethodName\")
+public class FRCNetComm extends JNIWrapper {
+""")
+
+        # Read enums from C++ source files
+        firstEnum = True
+        for fileName in ["LoadOut.h", "UsageReporting.h"]:
+            with open(configPath + "/hal/include/FRC_NetworkCommunication/" + \
+                      fileName, "r") as cppSource:
+                while True:
+                    # Read until an enum is encountered
+                    line = ""
+                    pos = -1
+                    while line.find("enum") == -1:
+                        line = cppSource.readline()
+                        if line == "":
+                            break
+
+                    if line == "":
+                        break
+
+                    # If "{" is on next line, read next line
+                    if line.find("{") == -1:
+                        line = cppSource.readline()
+
+                    # Write enum to output file as interface
+                    values = []
+                    line = cppSource.readline()
+                    while line.find("}") == -1:
+                        if line == "\n":
+                            values.append("")
+                        else:
+                            if line[0] != "#":
+                                line = line.strip()
+                                if line[len(line) - 1] == ",":
+                                    values.append(line[0:len(line) - 1])
+                                else:
+                                    values.append(line)
+                        line = cppSource.readline()
+
+                    # Extract enum name
+                    nameStart = 0
+                    for i, c in enumerate(line):
+                        if c != " " and c != "}":
+                            nameStart = i
+                            break
+                    enumName = line[nameStart:len(line) - 2]
+
+                    # Write comment for interface name
+                    # Only add newline if not the first enum
+                    if firstEnum == True:
+                        firstEnum = False
+                    else:
+                        temp.write("\n")
+                    temp.write("  /**\n"
+                               "   * ")
+
+                    # Splits camelcase string into words
+                    enumCamel = re.findall(r'[A-Z](?:[a-z]+|[A-Z]*(?=[A-Z]|$))',
+                                           enumName)
+                    temp.write(enumCamel[0] + " ")
+                    for i in range(1, len(enumCamel)):
+                        temp.write(enumCamel[i][0].lower() + \
+                            enumCamel[i][1:len(enumCamel[i])] + " ")
+                    temp.write("from " + fileName + "\n"
+                               "   */\n"
+                               "  @SuppressWarnings(\"TypeName\")\n"
+                               "  public interface " + enumName + " {\n")
+
+                    # Write enum values
+                    count = 0
+                    for value in values:
+                        # Pass through empty lines
+                        if value == "":
+                            temp.write("\n")
+                            continue
+
+                        if value.find("=") == -1:
+                            value = value + " = " + str(count)
+                            count += 1
+
+                        # Add scoping for values from a different enum
+                        if enumName != "tModuleType" and \
+                                value.find("kModuleType") != -1:
+                            value = value.replace("kModuleType",
+                                                  "tModuleType.kModuleType")
+                        temp.write("    int " + value[0:len(value)] + ";\n")
+
+                    # Write end of enum
+                    temp.write("  }\n")
+
+        # Write closing brace for file
+        temp.write("}\n")
+
+    # Replace old output file
+    try:
+        os.remove(outputName)
+    except OSError:
+        pass
+    os.rename(outputName + ".tmp", outputName)
+
+if __name__ == "__main__":
+    main()
diff --git a/third_party/allwpilib_2018/gmock/CMakeLists.txt b/third_party/allwpilib_2018/gmock/CMakeLists.txt
new file mode 100644
index 0000000..f655cd0
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/CMakeLists.txt
@@ -0,0 +1,86 @@
+########################################################################

+# CMake build script for Google Mock.

+#

+# To run the tests for Google Mock itself on Linux, use 'make test' or

+# ctest.  You can select which tests to run using 'ctest -R regex'.

+# For more options, run 'ctest --help'.

+

+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to

+# make it prominent in the GUI.

+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)

+

+# A directory to find Google Test sources.

+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")

+  set(gtest_dir gtest)

+else()

+  set(gtest_dir ../gtest)

+endif()

+

+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().

+include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL)

+

+if (COMMAND pre_project_set_up_hermetic_build)

+  # Google Test also calls hermetic setup functions from add_subdirectory,

+  # although its changes will not affect things at the current scope.

+  pre_project_set_up_hermetic_build()

+endif()

+

+########################################################################

+#

+# Project-wide settings

+

+# Name of the project.

+#

+# CMake files in this project can refer to the root source directory

+# as ${gmock_SOURCE_DIR} and to the root binary directory as

+# ${gmock_BINARY_DIR}.

+# Language "C" is required for find_package(Threads).

+project(gmock CXX C)

+cmake_minimum_required(VERSION 2.6.2)

+

+if (COMMAND set_up_hermetic_build)

+  set_up_hermetic_build()

+endif()

+

+if (NOT MSVC)

+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers -Wno-format-nonliteral")

+endif()

+

+# Instructs CMake to process Google Test's CMakeLists.txt and add its

+# targets to the current scope.  We are placing Google Test's binary

+# directory in a subdirectory of our own as VC compilation may break

+# if they are the same (the default).

+add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest")

+

+# Although Google Test's CMakeLists.txt calls this function, the

+# changes there don't affect the current scope.  Therefore we have to

+# call it again here.

+config_compiler_and_linker()  # from ${gtest_dir}/cmake/internal_utils.cmake

+

+# Adds Google Mock's and Google Test's header directories to the search path.

+include_directories("${gmock_SOURCE_DIR}/include"

+                    "${gmock_SOURCE_DIR}"

+                    "${gtest_SOURCE_DIR}/include"

+                    # This directory is needed to build directly from Google

+                    # Test sources.

+                    "${gtest_SOURCE_DIR}")

+

+########################################################################

+#

+# Defines the gmock & gmock_main libraries.  User tests should link

+# with one of them.

+

+# Google Mock libraries.  We build them using more strict warnings than what

+# are used for other targets, to ensure that Google Mock can be compiled by

+# a user aggressive about warnings.

+cxx_library(gmock

+            "${cxx_strict}"

+            "${gtest_dir}/src/gtest-all.cc"

+            src/gmock-all.cc)

+

+cxx_library(gmock_main

+            "${cxx_strict}"

+            "${gtest_dir}/src/gtest-all.cc"

+            src/gmock-all.cc

+            src/gmock_main.cc)

+

diff --git a/third_party/allwpilib_2018/gmock/LICENSE b/third_party/allwpilib_2018/gmock/LICENSE
new file mode 100644
index 0000000..1c7ec11
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/LICENSE
@@ -0,0 +1,28 @@
+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.

diff --git a/third_party/allwpilib_2018/gmock/build.gradle b/third_party/allwpilib_2018/gmock/build.gradle
new file mode 100644
index 0000000..d7f0d8a
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/build.gradle
@@ -0,0 +1,44 @@
+import org.gradle.internal.os.OperatingSystem

+

+if (!project.hasProperty('onlyAthena')) {

+    apply plugin: 'cpp'

+    apply plugin: 'visual-studio'

+    apply plugin: 'edu.wpi.first.NativeUtils'

+

+    ext.gmockProject = true

+

+    apply from: '../config.gradle'

+

+    ext.addGmockToLinker = { binary->

+        binary.lib project: ':gmock', library: 'gmock', linkage: 'static'

+    }

+

+    model {

+        components {

+            gmock(NativeLibrarySpec) {

+                sources {

+                    cpp {

+                        source {

+                            srcDirs = ['src', 'gtest/src']

+                            includes = ['*-all.cc']

+                        }

+                        exportedHeaders {

+                            srcDirs = ['include', 'gtest/include', '.', 'gtest']

+                            includes = ['**/*.h', '**/*.cc']

+                        }

+                    }

+                }

+                binaries.all {

+                    if (toolChain in VisualCpp) {

+                        cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32',  '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1'

+                    } else {

+                        cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC'

+                    }

+                }

+                binaries.withType(SharedLibraryBinarySpec) {

+                    buildable = false

+                }

+            }

+        }

+    }

+}

diff --git a/third_party/allwpilib_2018/gmock/gtest/CMakeLists.txt b/third_party/allwpilib_2018/gmock/gtest/CMakeLists.txt
new file mode 100644
index 0000000..17b5741
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/CMakeLists.txt
@@ -0,0 +1,69 @@
+########################################################################

+# CMake build script for Google Test.

+#

+# To run the tests for Google Test itself on Linux, use 'make test' or

+# ctest.  You can select which tests to run using 'ctest -R regex'.

+# For more options, run 'ctest --help'.

+

+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to

+# make it prominent in the GUI.

+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)

+

+# When other libraries are using a shared version of runtime libraries,

+# Google Test also has to use one.

+option(

+  gtest_force_shared_crt

+  "Use shared (DLL) run-time lib even when Google Test is built as static lib."

+  OFF)

+

+option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)

+

+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().

+include(cmake/hermetic_build.cmake OPTIONAL)

+

+if (COMMAND pre_project_set_up_hermetic_build)

+  pre_project_set_up_hermetic_build()

+endif()

+

+########################################################################

+#

+# Project-wide settings

+

+# Name of the project.

+#

+# CMake files in this project can refer to the root source directory

+# as ${gtest_SOURCE_DIR} and to the root binary directory as

+# ${gtest_BINARY_DIR}.

+# Language "C" is required for find_package(Threads).

+project(gtest CXX C)

+cmake_minimum_required(VERSION 2.6.2)

+

+if (COMMAND set_up_hermetic_build)

+  set_up_hermetic_build()

+endif()

+

+# Define helper functions and macros used by Google Test.

+include(cmake/internal_utils.cmake)

+

+config_compiler_and_linker()  # Defined in internal_utils.cmake.

+

+# Where Google Test's .h files can be found.

+include_directories(

+  ${gtest_SOURCE_DIR}/include

+  ${gtest_SOURCE_DIR})

+

+# Where Google Test's libraries can be found.

+link_directories(${gtest_BINARY_DIR}/src)

+

+########################################################################

+#

+# Defines the gtest & gtest_main libraries.  User tests should link

+# with one of them.

+

+# Google Test libraries.  We build them using more strict warnings than what

+# are used for other targets, to ensure that gtest can be compiled by a user

+# aggressive about warnings.

+cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)

+cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)

+target_link_libraries(gtest_main gtest)

+

diff --git a/third_party/allwpilib_2018/gmock/gtest/LICENSE b/third_party/allwpilib_2018/gmock/gtest/LICENSE
new file mode 100644
index 0000000..1c7ec11
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/LICENSE
@@ -0,0 +1,28 @@
+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.

diff --git a/third_party/allwpilib_2018/gmock/gtest/cmake/internal_utils.cmake b/third_party/allwpilib_2018/gmock/gtest/cmake/internal_utils.cmake
new file mode 100644
index 0000000..3a7d4d5
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/cmake/internal_utils.cmake
@@ -0,0 +1,206 @@
+# Defines functions and macros useful for building Google Test and

+# Google Mock.

+#

+# Note:

+#

+# - This file will be run twice when building Google Mock (once via

+#   Google Test's CMakeLists.txt, and once via Google Mock's).

+#   Therefore it shouldn't have any side effects other than defining

+#   the functions and macros.

+#

+# - The functions/macros defined in this file may depend on Google

+#   Test and Google Mock's option() definitions, and thus must be

+#   called *after* the options have been defined.

+

+# Tweaks CMake's default compiler/linker settings to suit Google Test's needs.

+#

+# This must be a macro(), as inside a function string() can only

+# update variables in the function scope.

+macro(fix_default_compiler_settings_)

+  if (MSVC)

+    # For MSVC, CMake sets certain flags to defaults we want to override.

+    # This replacement code is taken from sample in the CMake Wiki at

+    # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.

+    foreach (flag_var

+             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE

+             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)

+      if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)

+        # When Google Test is built as a shared library, it should also use

+        # shared runtime libraries.  Otherwise, it may end up with multiple

+        # copies of runtime library data in different modules, resulting in

+        # hard-to-find crashes. When it is built as a static library, it is

+        # preferable to use CRT as static libraries, as we don't have to rely

+        # on CRT DLLs being available. CMake always defaults to using shared

+        # CRT libraries, so we override that default here.

+        string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")

+      endif()

+

+      # We prefer more strict warning checking for building Google Test.

+      # Replaces /W3 with /W4 in defaults.

+      string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}")

+    endforeach()

+  endif()

+endmacro()

+

+# Defines the compiler/linker flags used to build Google Test and

+# Google Mock.  You can tweak these definitions to suit your need.  A

+# variable's value is empty before it's explicitly assigned to.

+macro(config_compiler_and_linker)

+  if (NOT gtest_disable_pthreads)

+    # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.

+    find_package(Threads)

+  endif()

+

+  fix_default_compiler_settings_()

+  if (MSVC)

+    # Newlines inside flags variables break CMake's NMake generator.

+    # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.

+    set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi")

+    if (MSVC_VERSION LESS 1400)

+      # Suppress spurious warnings MSVC 7.1 sometimes issues.

+      # Forcing value to bool.

+      set(cxx_base_flags "${cxx_base_flags} -wd4800")

+      # Copy constructor and assignment operator could not be generated.

+      set(cxx_base_flags "${cxx_base_flags} -wd4511 -wd4512")

+      # Compatibility warnings not applicable to Google Test.

+      # Resolved overload was found by argument-dependent lookup.

+      set(cxx_base_flags "${cxx_base_flags} -wd4675")

+    endif()

+    set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32")

+    set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN")

+    set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")

+    set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")

+    set(cxx_no_rtti_flags "-GR-")

+  elseif (CMAKE_COMPILER_IS_GNUCXX)

+    set(cxx_base_flags "-Wall -Wshadow")

+    set(cxx_exception_flags "-fexceptions")

+    set(cxx_no_exception_flags "-fno-exceptions")

+    # Until version 4.3.2, GCC doesn't define a macro to indicate

+    # whether RTTI is enabled.  Therefore we define GTEST_HAS_RTTI

+    # explicitly.

+    set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")

+    set(cxx_strict_flags

+      "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")

+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")

+    set(cxx_exception_flags "-features=except")

+    # Sun Pro doesn't provide macros to indicate whether exceptions and

+    # RTTI are enabled, so we define GTEST_HAS_* explicitly.

+    set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0")

+    set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0")

+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR

+      CMAKE_CXX_COMPILER_ID STREQUAL "XL")

+    # CMake 2.8 changes Visual Age's compiler ID to "XL".

+    set(cxx_exception_flags "-qeh")

+    set(cxx_no_exception_flags "-qnoeh")

+    # Until version 9.0, Visual Age doesn't define a macro to indicate

+    # whether RTTI is enabled.  Therefore we define GTEST_HAS_RTTI

+    # explicitly.

+    set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")

+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")

+    set(cxx_base_flags "-AA -mt")

+    set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1")

+    set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0")

+    # RTTI can not be disabled in HP aCC compiler.

+    set(cxx_no_rtti_flags "")

+  endif()

+

+  if (CMAKE_USE_PTHREADS_INIT)  # The pthreads library is available and allowed.

+    set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1")

+  else()

+    set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0")

+  endif()

+

+  # For building gtest's own tests and samples.

+  set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}")

+  set(cxx_no_exception

+    "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")

+  set(cxx_default "${cxx_exception}")

+  set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")

+  set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1")

+

+  # For building the gtest libraries.

+  set(cxx_strict "${cxx_default} ${cxx_strict_flags}")

+endmacro()

+

+# Defines the gtest & gtest_main libraries.  User tests should link

+# with one of them.

+function(cxx_library_with_type name type cxx_flags)

+  # type can be either STATIC or SHARED to denote a static or shared library.

+  # ARGN refers to additional arguments after 'cxx_flags'.

+  add_library(${name} ${type} ${ARGN})

+  set_target_properties(${name}

+    PROPERTIES

+    COMPILE_FLAGS "${cxx_flags}")

+  if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")

+    set_target_properties(${name}

+      PROPERTIES

+      COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")

+  endif()

+  if (CMAKE_USE_PTHREADS_INIT)

+    target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})

+  endif()

+endfunction()

+

+########################################################################

+#

+# Helper functions for creating build targets.

+

+function(cxx_shared_library name cxx_flags)

+  cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN})

+endfunction()

+

+function(cxx_library name cxx_flags)

+  cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN})

+endfunction()

+

+# cxx_executable_with_flags(name cxx_flags libs srcs...)

+#

+# creates a named C++ executable that depends on the given libraries and

+# is built from the given source files with the given compiler flags.

+function(cxx_executable_with_flags name cxx_flags libs)

+  add_executable(${name} ${ARGN})

+  if (cxx_flags)

+    set_target_properties(${name}

+      PROPERTIES

+      COMPILE_FLAGS "${cxx_flags}")

+  endif()

+  if (BUILD_SHARED_LIBS)

+    set_target_properties(${name}

+      PROPERTIES

+      COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")

+  endif()

+  # To support mixing linking in static and dynamic libraries, link each

+  # library in with an extra call to target_link_libraries.

+  foreach (lib "${libs}")

+    target_link_libraries(${name} ${lib})

+  endforeach()

+endfunction()

+

+# cxx_executable(name dir lib srcs...)

+#

+# creates a named target that depends on the given libs and is built

+# from the given source files.  dir/name.cc is implicitly included in

+# the source file list.

+function(cxx_executable name dir libs)

+  cxx_executable_with_flags(

+    ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})

+endfunction()

+

+# cxx_test_with_flags(name cxx_flags libs srcs...)

+#

+# creates a named C++ test that depends on the given libs and is built

+# from the given source files with the given compiler flags.

+function(cxx_test_with_flags name cxx_flags libs)

+  cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})

+  add_test(${name} ${name})

+endfunction()

+

+# cxx_test(name libs srcs...)

+#

+# creates a named test target that depends on the given libs and is

+# built from the given source files.  Unlike cxx_test_with_flags,

+# test/name.cc is already implicitly included in the source file list.

+function(cxx_test name libs)

+  cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"

+    "test/${name}.cc" ${ARGN})

+endfunction()

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-death-test.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-death-test.h
new file mode 100644
index 0000000..d221345
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-death-test.h
@@ -0,0 +1,294 @@
+// Copyright 2005, 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)

+//

+// The Google C++ Testing Framework (Google Test)

+//

+// This header file defines the public API for death tests.  It is

+// #included by gtest.h so a user doesn't need to include this

+// directly.

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_

+#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_

+

+#include "gtest/internal/gtest-death-test-internal.h"

+

+namespace testing {

+

+// This flag controls the style of death tests.  Valid values are "threadsafe",

+// meaning that the death test child process will re-execute the test binary

+// from the start, running only a single death test, or "fast",

+// meaning that the child process will execute the test logic immediately

+// after forking.

+GTEST_DECLARE_string_(death_test_style);

+

+#if GTEST_HAS_DEATH_TEST

+

+namespace internal {

+

+// Returns a Boolean value indicating whether the caller is currently

+// executing in the context of the death test child process.  Tools such as

+// Valgrind heap checkers may need this to modify their behavior in death

+// tests.  IMPORTANT: This is an internal utility.  Using it may break the

+// implementation of death tests.  User code MUST NOT use it.

+GTEST_API_ bool InDeathTestChild();

+

+}  // namespace internal

+

+// The following macros are useful for writing death tests.

+

+// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is

+// executed:

+//

+//   1. It generates a warning if there is more than one active

+//   thread.  This is because it's safe to fork() or clone() only

+//   when there is a single thread.

+//

+//   2. The parent process clone()s a sub-process and runs the death

+//   test in it; the sub-process exits with code 0 at the end of the

+//   death test, if it hasn't exited already.

+//

+//   3. The parent process waits for the sub-process to terminate.

+//

+//   4. The parent process checks the exit code and error message of

+//   the sub-process.

+//

+// Examples:

+//

+//   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");

+//   for (int i = 0; i < 5; i++) {

+//     EXPECT_DEATH(server.ProcessRequest(i),

+//                  "Invalid request .* in ProcessRequest()")

+//                  << "Failed to die on request " << i;

+//   }

+//

+//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");

+//

+//   bool KilledBySIGHUP(int exit_code) {

+//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;

+//   }

+//

+//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");

+//

+// On the regular expressions used in death tests:

+//

+//   On POSIX-compliant systems (*nix), we use the <regex.h> library,

+//   which uses the POSIX extended regex syntax.

+//

+//   On other platforms (e.g. Windows), we only support a simple regex

+//   syntax implemented as part of Google Test.  This limited

+//   implementation should be enough most of the time when writing

+//   death tests; though it lacks many features you can find in PCRE

+//   or POSIX extended regex syntax.  For example, we don't support

+//   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and

+//   repetition count ("x{5,7}"), among others.

+//

+//   Below is the syntax that we do support.  We chose it to be a

+//   subset of both PCRE and POSIX extended regex, so it's easy to

+//   learn wherever you come from.  In the following: 'A' denotes a

+//   literal character, period (.), or a single \\ escape sequence;

+//   'x' and 'y' denote regular expressions; 'm' and 'n' are for

+//   natural numbers.

+//

+//     c     matches any literal character c

+//     \\d   matches any decimal digit

+//     \\D   matches any character that's not a decimal digit

+//     \\f   matches \f

+//     \\n   matches \n

+//     \\r   matches \r

+//     \\s   matches any ASCII whitespace, including \n

+//     \\S   matches any character that's not a whitespace

+//     \\t   matches \t

+//     \\v   matches \v

+//     \\w   matches any letter, _, or decimal digit

+//     \\W   matches any character that \\w doesn't match

+//     \\c   matches any literal character c, which must be a punctuation

+//     .     matches any single character except \n

+//     A?    matches 0 or 1 occurrences of A

+//     A*    matches 0 or many occurrences of A

+//     A+    matches 1 or many occurrences of A

+//     ^     matches the beginning of a string (not that of each line)

+//     $     matches the end of a string (not that of each line)

+//     xy    matches x followed by y

+//

+//   If you accidentally use PCRE or POSIX extended regex features

+//   not implemented by us, you will get a run-time failure.  In that

+//   case, please try to rewrite your regular expression within the

+//   above syntax.

+//

+//   This implementation is *not* meant to be as highly tuned or robust

+//   as a compiled regex library, but should perform well enough for a

+//   death test, which already incurs significant overhead by launching

+//   a child process.

+//

+// Known caveats:

+//

+//   A "threadsafe" style death test obtains the path to the test

+//   program from argv[0] and re-executes it in the sub-process.  For

+//   simplicity, the current implementation doesn't search the PATH

+//   when launching the sub-process.  This means that the user must

+//   invoke the test program via a path that contains at least one

+//   path separator (e.g. path/to/foo_test and

+//   /absolute/path/to/bar_test are fine, but foo_test is not).  This

+//   is rarely a problem as people usually don't put the test binary

+//   directory in PATH.

+//

+// TODO(wan@google.com): make thread-safe death tests search the PATH.

+

+// Asserts that a given statement causes the program to exit, with an

+// integer exit status that satisfies predicate, and emitting error output

+// that matches regex.

+# define ASSERT_EXIT(statement, predicate, regex) \

+    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)

+

+// Like ASSERT_EXIT, but continues on to successive tests in the

+// test case, if any:

+# define EXPECT_EXIT(statement, predicate, regex) \

+    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)

+

+// Asserts that a given statement causes the program to exit, either by

+// explicitly exiting with a nonzero exit code or being killed by a

+// signal, and emitting error output that matches regex.

+# define ASSERT_DEATH(statement, regex) \

+    ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)

+

+// Like ASSERT_DEATH, but continues on to successive tests in the

+// test case, if any:

+# define EXPECT_DEATH(statement, regex) \

+    EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)

+

+// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:

+

+// Tests that an exit code describes a normal exit with a given exit code.

+class GTEST_API_ ExitedWithCode {

+ public:

+  explicit ExitedWithCode(int exit_code);

+  bool operator()(int exit_status) const;

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ExitedWithCode& other);

+

+  const int exit_code_;

+};

+

+# if !GTEST_OS_WINDOWS

+// Tests that an exit code describes an exit due to termination by a

+// given signal.

+class GTEST_API_ KilledBySignal {

+ public:

+  explicit KilledBySignal(int signum);

+  bool operator()(int exit_status) const;

+ private:

+  const int signum_;

+};

+# endif  // !GTEST_OS_WINDOWS

+

+// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.

+// The death testing framework causes this to have interesting semantics,

+// since the sideeffects of the call are only visible in opt mode, and not

+// in debug mode.

+//

+// In practice, this can be used to test functions that utilize the

+// LOG(DFATAL) macro using the following style:

+//

+// int DieInDebugOr12(int* sideeffect) {

+//   if (sideeffect) {

+//     *sideeffect = 12;

+//   }

+//   LOG(DFATAL) << "death";

+//   return 12;

+// }

+//

+// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {

+//   int sideeffect = 0;

+//   // Only asserts in dbg.

+//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");

+//

+// #ifdef NDEBUG

+//   // opt-mode has sideeffect visible.

+//   EXPECT_EQ(12, sideeffect);

+// #else

+//   // dbg-mode no visible sideeffect.

+//   EXPECT_EQ(0, sideeffect);

+// #endif

+// }

+//

+// This will assert that DieInDebugReturn12InOpt() crashes in debug

+// mode, usually due to a DCHECK or LOG(DFATAL), but returns the

+// appropriate fallback value (12 in this case) in opt mode. If you

+// need to test that a function has appropriate side-effects in opt

+// mode, include assertions against the side-effects.  A general

+// pattern for this is:

+//

+// EXPECT_DEBUG_DEATH({

+//   // Side-effects here will have an effect after this statement in

+//   // opt mode, but none in debug mode.

+//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));

+// }, "death");

+//

+# ifdef NDEBUG

+

+#  define EXPECT_DEBUG_DEATH(statement, regex) \

+  GTEST_EXECUTE_STATEMENT_(statement, regex)

+

+#  define ASSERT_DEBUG_DEATH(statement, regex) \

+  GTEST_EXECUTE_STATEMENT_(statement, regex)

+

+# else

+

+#  define EXPECT_DEBUG_DEATH(statement, regex) \

+  EXPECT_DEATH(statement, regex)

+

+#  define ASSERT_DEBUG_DEATH(statement, regex) \

+  ASSERT_DEATH(statement, regex)

+

+# endif  // NDEBUG for EXPECT_DEBUG_DEATH

+#endif  // GTEST_HAS_DEATH_TEST

+

+// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and

+// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if

+// death tests are supported; otherwise they just issue a warning.  This is

+// useful when you are combining death test assertions with normal test

+// assertions in one test.

+#if GTEST_HAS_DEATH_TEST

+# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \

+    EXPECT_DEATH(statement, regex)

+# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \

+    ASSERT_DEATH(statement, regex)

+#else

+# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \

+    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )

+# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \

+    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)

+#endif

+

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-message.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-message.h
new file mode 100644
index 0000000..ac899a0
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-message.h
@@ -0,0 +1,250 @@
+// Copyright 2005, 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)

+//

+// The Google C++ Testing Framework (Google Test)

+//

+// This header file defines the Message class.

+//

+// IMPORTANT NOTE: Due to limitation of the C++ language, we have to

+// leave some internal implementation details in this header file.

+// They are clearly marked by comments like this:

+//

+//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+//

+// Such code is NOT meant to be used by a user directly, and is subject

+// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user

+// program!

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_

+#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_

+

+#include <limits>

+

+#include "gtest/internal/gtest-port.h"

+

+// Ensures that there is at least one operator<< in the global namespace.

+// See Message& operator<<(...) below for why.

+void operator<<(const testing::internal::Secret&, int);

+

+namespace testing {

+

+// The Message class works like an ostream repeater.

+//

+// Typical usage:

+//

+//   1. You stream a bunch of values to a Message object.

+//      It will remember the text in a stringstream.

+//   2. Then you stream the Message object to an ostream.

+//      This causes the text in the Message to be streamed

+//      to the ostream.

+//

+// For example;

+//

+//   testing::Message foo;

+//   foo << 1 << " != " << 2;

+//   std::cout << foo;

+//

+// will print "1 != 2".

+//

+// Message is not intended to be inherited from.  In particular, its

+// destructor is not virtual.

+//

+// Note that stringstream behaves differently in gcc and in MSVC.  You

+// can stream a NULL char pointer to it in the former, but not in the

+// latter (it causes an access violation if you do).  The Message

+// class hides this difference by treating a NULL char pointer as

+// "(null)".

+class GTEST_API_ Message {

+ private:

+  // The type of basic IO manipulators (endl, ends, and flush) for

+  // narrow streams.

+  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);

+

+ public:

+  // Constructs an empty Message.

+  Message();

+

+  // Copy constructor.

+  Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT

+    *ss_ << msg.GetString();

+  }

+

+  // Constructs a Message from a C-string.

+  explicit Message(const char* str) : ss_(new ::std::stringstream) {

+    *ss_ << str;

+  }

+

+#if GTEST_OS_SYMBIAN

+  // Streams a value (either a pointer or not) to this object.

+  template <typename T>

+  inline Message& operator <<(const T& value) {

+    StreamHelper(typename internal::is_pointer<T>::type(), value);

+    return *this;

+  }

+#else

+  // Streams a non-pointer value to this object.

+  template <typename T>

+  inline Message& operator <<(const T& val) {

+    // Some libraries overload << for STL containers.  These

+    // overloads are defined in the global namespace instead of ::std.

+    //

+    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these

+    // overloads are visible in either the std namespace or the global

+    // namespace, but not other namespaces, including the testing

+    // namespace which Google Test's Message class is in.

+    //

+    // To allow STL containers (and other types that has a << operator

+    // defined in the global namespace) to be used in Google Test

+    // assertions, testing::Message must access the custom << operator

+    // from the global namespace.  With this using declaration,

+    // overloads of << defined in the global namespace and those

+    // visible via Koenig lookup are both exposed in this function.

+    using ::operator <<;

+    *ss_ << val;

+    return *this;

+  }

+

+  // Streams a pointer value to this object.

+  //

+  // This function is an overload of the previous one.  When you

+  // stream a pointer to a Message, this definition will be used as it

+  // is more specialized.  (The C++ Standard, section

+  // [temp.func.order].)  If you stream a non-pointer, then the

+  // previous definition will be used.

+  //

+  // The reason for this overload is that streaming a NULL pointer to

+  // ostream is undefined behavior.  Depending on the compiler, you

+  // may get "0", "(nil)", "(null)", or an access violation.  To

+  // ensure consistent result across compilers, we always treat NULL

+  // as "(null)".

+  template <typename T>

+  inline Message& operator <<(T* const& pointer) {  // NOLINT

+    if (pointer == NULL) {

+      *ss_ << "(null)";

+    } else {

+      *ss_ << pointer;

+    }

+    return *this;

+  }

+#endif  // GTEST_OS_SYMBIAN

+

+  // Since the basic IO manipulators are overloaded for both narrow

+  // and wide streams, we have to provide this specialized definition

+  // of operator <<, even though its body is the same as the

+  // templatized version above.  Without this definition, streaming

+  // endl or other basic IO manipulators to Message will confuse the

+  // compiler.

+  Message& operator <<(BasicNarrowIoManip val) {

+    *ss_ << val;

+    return *this;

+  }

+

+  // Instead of 1/0, we want to see true/false for bool values.

+  Message& operator <<(bool b) {

+    return *this << (b ? "true" : "false");

+  }

+

+  // These two overloads allow streaming a wide C string to a Message

+  // using the UTF-8 encoding.

+  Message& operator <<(const wchar_t* wide_c_str);

+  Message& operator <<(wchar_t* wide_c_str);

+

+#if GTEST_HAS_STD_WSTRING

+  // Converts the given wide string to a narrow string using the UTF-8

+  // encoding, and streams the result to this Message object.

+  Message& operator <<(const ::std::wstring& wstr);

+#endif  // GTEST_HAS_STD_WSTRING

+

+#if GTEST_HAS_GLOBAL_WSTRING

+  // Converts the given wide string to a narrow string using the UTF-8

+  // encoding, and streams the result to this Message object.

+  Message& operator <<(const ::wstring& wstr);

+#endif  // GTEST_HAS_GLOBAL_WSTRING

+

+  // Gets the text streamed to this object so far as an std::string.

+  // Each '\0' character in the buffer is replaced with "\\0".

+  //

+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+  std::string GetString() const;

+

+ private:

+

+#if GTEST_OS_SYMBIAN

+  // These are needed as the Nokia Symbian Compiler cannot decide between

+  // const T& and const T* in a function template. The Nokia compiler _can_

+  // decide between class template specializations for T and T*, so a

+  // tr1::type_traits-like is_pointer works, and we can overload on that.

+  template <typename T>

+  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {

+    if (pointer == NULL) {

+      *ss_ << "(null)";

+    } else {

+      *ss_ << pointer;

+    }

+  }

+  template <typename T>

+  inline void StreamHelper(internal::false_type /*is_pointer*/,

+                           const T& value) {

+    // See the comments in Message& operator <<(const T&) above for why

+    // we need this using statement.

+    using ::operator <<;

+    *ss_ << value;

+  }

+#endif  // GTEST_OS_SYMBIAN

+

+  // We'll hold the text streamed to this object here.

+  const internal::scoped_ptr< ::std::stringstream> ss_;

+

+  // We declare (but don't implement) this to prevent the compiler

+  // from implementing the assignment operator.

+  void operator=(const Message&);

+};

+

+// Streams a Message to an ostream.

+inline std::ostream& operator <<(std::ostream& os, const Message& sb) {

+  return os << sb.GetString();

+}

+

+namespace internal {

+

+// Converts a streamable value to an std::string.  A NULL pointer is

+// converted to "(null)".  When the input value is a ::string,

+// ::std::string, ::wstring, or ::std::wstring object, each NUL

+// character in it is replaced with "\\0".

+template <typename T>

+std::string StreamableToString(const T& streamable) {

+  return (Message() << streamable).GetString();

+}

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-param-test.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-param-test.h
new file mode 100644
index 0000000..1f65edb
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-param-test.h
@@ -0,0 +1,1421 @@
+// This file was GENERATED by command:

+//     pump.py gtest-param-test.h.pump

+// DO NOT EDIT BY HAND!!!

+

+// 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.

+//

+// Authors: vladl@google.com (Vlad Losev)

+//

+// Macros and functions for implementing parameterized tests

+// in Google C++ Testing Framework (Google Test)

+//

+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!

+//

+#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_

+#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_

+

+

+// Value-parameterized tests allow you to test your code with different

+// parameters without writing multiple copies of the same test.

+//

+// Here is how you use value-parameterized tests:

+

+#if 0

+

+// To write value-parameterized tests, first you should define a fixture

+// class. It is usually derived from testing::TestWithParam<T> (see below for

+// another inheritance scheme that's sometimes useful in more complicated

+// class hierarchies), where the type of your parameter values.

+// TestWithParam<T> is itself derived from testing::Test. T can be any

+// copyable type. If it's a raw pointer, you are responsible for managing the

+// lifespan of the pointed values.

+

+class FooTest : public ::testing::TestWithParam<const char*> {

+  // You can implement all the usual class fixture members here.

+};

+

+// Then, use the TEST_P macro to define as many parameterized tests

+// for this fixture as you want. The _P suffix is for "parameterized"

+// or "pattern", whichever you prefer to think.

+

+TEST_P(FooTest, DoesBlah) {

+  // Inside a test, access the test parameter with the GetParam() method

+  // of the TestWithParam<T> class:

+  EXPECT_TRUE(foo.Blah(GetParam()));

+  ...

+}

+

+TEST_P(FooTest, HasBlahBlah) {

+  ...

+}

+

+// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test

+// case with any set of parameters you want. Google Test defines a number

+// of functions for generating test parameters. They return what we call

+// (surprise!) parameter generators. Here is a  summary of them, which

+// are all in the testing namespace:

+//

+//

+//  Range(begin, end [, step]) - Yields values {begin, begin+step,

+//                               begin+step+step, ...}. The values do not

+//                               include end. step defaults to 1.

+//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.

+//  ValuesIn(container)        - Yields values from a C-style array, an STL

+//  ValuesIn(begin,end)          container, or an iterator range [begin, end).

+//  Bool()                     - Yields sequence {false, true}.

+//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product

+//                               for the math savvy) of the values generated

+//                               by the N generators.

+//

+// For more details, see comments at the definitions of these functions below

+// in this file.

+//

+// The following statement will instantiate tests from the FooTest test case

+// each with parameter values "meeny", "miny", and "moe".

+

+INSTANTIATE_TEST_CASE_P(InstantiationName,

+                        FooTest,

+                        Values("meeny", "miny", "moe"));

+

+// To distinguish different instances of the pattern, (yes, you

+// can instantiate it more then once) the first argument to the

+// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the

+// actual test case name. Remember to pick unique prefixes for different

+// instantiations. The tests from the instantiation above will have

+// these names:

+//

+//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"

+//    * InstantiationName/FooTest.DoesBlah/1 for "miny"

+//    * InstantiationName/FooTest.DoesBlah/2 for "moe"

+//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"

+//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"

+//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"

+//

+// You can use these names in --gtest_filter.

+//

+// This statement will instantiate all tests from FooTest again, each

+// with parameter values "cat" and "dog":

+

+const char* pets[] = {"cat", "dog"};

+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));

+

+// The tests from the instantiation above will have these names:

+//

+//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"

+//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"

+//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"

+//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"

+//

+// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests

+// in the given test case, whether their definitions come before or

+// AFTER the INSTANTIATE_TEST_CASE_P statement.

+//

+// Please also note that generator expressions (including parameters to the

+// generators) are evaluated in InitGoogleTest(), after main() has started.

+// This allows the user on one hand, to adjust generator parameters in order

+// to dynamically determine a set of tests to run and on the other hand,

+// give the user a chance to inspect the generated tests with Google Test

+// reflection API before RUN_ALL_TESTS() is executed.

+//

+// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc

+// for more examples.

+//

+// In the future, we plan to publish the API for defining new parameter

+// generators. But for now this interface remains part of the internal

+// implementation and is subject to change.

+//

+//

+// A parameterized test fixture must be derived from testing::Test and from

+// testing::WithParamInterface<T>, where T is the type of the parameter

+// values. Inheriting from TestWithParam<T> satisfies that requirement because

+// TestWithParam<T> inherits from both Test and WithParamInterface. In more

+// complicated hierarchies, however, it is occasionally useful to inherit

+// separately from Test and WithParamInterface. For example:

+

+class BaseTest : public ::testing::Test {

+  // You can inherit all the usual members for a non-parameterized test

+  // fixture here.

+};

+

+class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {

+  // The usual test fixture members go here too.

+};

+

+TEST_F(BaseTest, HasFoo) {

+  // This is an ordinary non-parameterized test.

+}

+

+TEST_P(DerivedTest, DoesBlah) {

+  // GetParam works just the same here as if you inherit from TestWithParam.

+  EXPECT_TRUE(foo.Blah(GetParam()));

+}

+

+#endif  // 0

+

+#include "gtest/internal/gtest-port.h"

+

+#if !GTEST_OS_SYMBIAN

+# include <utility>

+#endif

+

+// scripts/fuse_gtest.py depends on gtest's own header being #included

+// *unconditionally*.  Therefore these #includes cannot be moved

+// inside #if GTEST_HAS_PARAM_TEST.

+#include "gtest/internal/gtest-internal.h"

+#include "gtest/internal/gtest-param-util.h"

+#include "gtest/internal/gtest-param-util-generated.h"

+

+#if GTEST_HAS_PARAM_TEST

+

+namespace testing {

+

+// Functions producing parameter generators.

+//

+// Google Test uses these generators to produce parameters for value-

+// parameterized tests. When a parameterized test case is instantiated

+// with a particular generator, Google Test creates and runs tests

+// for each element in the sequence produced by the generator.

+//

+// In the following sample, tests from test case FooTest are instantiated

+// each three times with parameter values 3, 5, and 8:

+//

+// class FooTest : public TestWithParam<int> { ... };

+//

+// TEST_P(FooTest, TestThis) {

+// }

+// TEST_P(FooTest, TestThat) {

+// }

+// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));

+//

+

+// Range() returns generators providing sequences of values in a range.

+//

+// Synopsis:

+// Range(start, end)

+//   - returns a generator producing a sequence of values {start, start+1,

+//     start+2, ..., }.

+// Range(start, end, step)

+//   - returns a generator producing a sequence of values {start, start+step,

+//     start+step+step, ..., }.

+// Notes:

+//   * The generated sequences never include end. For example, Range(1, 5)

+//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)

+//     returns a generator producing {1, 3, 5, 7}.

+//   * start and end must have the same type. That type may be any integral or

+//     floating-point type or a user defined type satisfying these conditions:

+//     * It must be assignable (have operator=() defined).

+//     * It must have operator+() (operator+(int-compatible type) for

+//       two-operand version).

+//     * It must have operator<() defined.

+//     Elements in the resulting sequences will also have that type.

+//   * Condition start < end must be satisfied in order for resulting sequences

+//     to contain any elements.

+//

+template <typename T, typename IncrementT>

+internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {

+  return internal::ParamGenerator<T>(

+      new internal::RangeGenerator<T, IncrementT>(start, end, step));

+}

+

+template <typename T>

+internal::ParamGenerator<T> Range(T start, T end) {

+  return Range(start, end, 1);

+}

+

+// ValuesIn() function allows generation of tests with parameters coming from

+// a container.

+//

+// Synopsis:

+// ValuesIn(const T (&array)[N])

+//   - returns a generator producing sequences with elements from

+//     a C-style array.

+// ValuesIn(const Container& container)

+//   - returns a generator producing sequences with elements from

+//     an STL-style container.

+// ValuesIn(Iterator begin, Iterator end)

+//   - returns a generator producing sequences with elements from

+//     a range [begin, end) defined by a pair of STL-style iterators. These

+//     iterators can also be plain C pointers.

+//

+// Please note that ValuesIn copies the values from the containers

+// passed in and keeps them to generate tests in RUN_ALL_TESTS().

+//

+// Examples:

+//

+// This instantiates tests from test case StringTest

+// each with C-string values of "foo", "bar", and "baz":

+//

+// const char* strings[] = {"foo", "bar", "baz"};

+// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));

+//

+// This instantiates tests from test case StlStringTest

+// each with STL strings with values "a" and "b":

+//

+// ::std::vector< ::std::string> GetParameterStrings() {

+//   ::std::vector< ::std::string> v;

+//   v.push_back("a");

+//   v.push_back("b");

+//   return v;

+// }

+//

+// INSTANTIATE_TEST_CASE_P(CharSequence,

+//                         StlStringTest,

+//                         ValuesIn(GetParameterStrings()));

+//

+//

+// This will also instantiate tests from CharTest

+// each with parameter values 'a' and 'b':

+//

+// ::std::list<char> GetParameterChars() {

+//   ::std::list<char> list;

+//   list.push_back('a');

+//   list.push_back('b');

+//   return list;

+// }

+// ::std::list<char> l = GetParameterChars();

+// INSTANTIATE_TEST_CASE_P(CharSequence2,

+//                         CharTest,

+//                         ValuesIn(l.begin(), l.end()));

+//

+template <typename ForwardIterator>

+internal::ParamGenerator<

+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>

+ValuesIn(ForwardIterator begin, ForwardIterator end) {

+  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>

+      ::value_type ParamType;

+  return internal::ParamGenerator<ParamType>(

+      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));

+}

+

+template <typename T, size_t N>

+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {

+  return ValuesIn(array, array + N);

+}

+

+template <class Container>

+internal::ParamGenerator<typename Container::value_type> ValuesIn(

+    const Container& container) {

+  return ValuesIn(container.begin(), container.end());

+}

+

+// Values() allows generating tests from explicitly specified list of

+// parameters.

+//

+// Synopsis:

+// Values(T v1, T v2, ..., T vN)

+//   - returns a generator producing sequences with elements v1, v2, ..., vN.

+//

+// For example, this instantiates tests from test case BarTest each

+// with values "one", "two", and "three":

+//

+// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));

+//

+// This instantiates tests from test case BazTest each with values 1, 2, 3.5.

+// The exact type of values will depend on the type of parameter in BazTest.

+//

+// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));

+//

+// Currently, Values() supports from 1 to 50 parameters.

+//

+template <typename T1>

+internal::ValueArray1<T1> Values(T1 v1) {

+  return internal::ValueArray1<T1>(v1);

+}

+

+template <typename T1, typename T2>

+internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {

+  return internal::ValueArray2<T1, T2>(v1, v2);

+}

+

+template <typename T1, typename T2, typename T3>

+internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {

+  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);

+}

+

+template <typename T1, typename T2, typename T3, typename T4>

+internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {

+  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,

+    T5 v5) {

+  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,

+    T4 v4, T5 v5, T6 v6) {

+  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,

+    T4 v4, T5 v5, T6 v6, T7 v7) {

+  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,

+      v6, v7);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,

+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {

+  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,

+      v5, v6, v7, v8);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,

+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {

+  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,

+      v4, v5, v6, v7, v8, v9);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,

+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {

+  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,

+      v2, v3, v4, v5, v6, v7, v8, v9, v10);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11>

+internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,

+    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11) {

+  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,

+      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12>

+internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12) {

+  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13>

+internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13) {

+  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14>

+internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {

+  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,

+      v14);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15>

+internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,

+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {

+  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,

+      v13, v14, v15);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16>

+internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16) {

+  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,

+      v12, v13, v14, v15, v16);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17>

+internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17) {

+  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,

+      v11, v12, v13, v14, v15, v16, v17);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18>

+internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,

+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18) {

+  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,

+      v10, v11, v12, v13, v14, v15, v16, v17, v18);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19>

+internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,

+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,

+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {

+  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,

+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20>

+internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,

+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,

+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {

+  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,

+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21>

+internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,

+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,

+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {

+  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,

+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22>

+internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,

+    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,

+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,

+    T21 v21, T22 v22) {

+  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,

+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,

+      v20, v21, v22);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23>

+internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,

+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,

+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,

+    T21 v21, T22 v22, T23 v23) {

+  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,

+      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,

+      v20, v21, v22, v23);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24>

+internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,

+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,

+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,

+    T21 v21, T22 v22, T23 v23, T24 v24) {

+  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,

+      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,

+      v19, v20, v21, v22, v23, v24);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25>

+internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,

+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,

+    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,

+    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {

+  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,

+      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,

+      v18, v19, v20, v21, v22, v23, v24, v25);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26>

+internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26) {

+  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,

+      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27>

+internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27) {

+  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,

+      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28>

+internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27, T28 v28) {

+  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,

+      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,

+      v28);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29>

+internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27, T28 v28, T29 v29) {

+  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,

+      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,

+      v27, v28, v29);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30>

+internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,

+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,

+    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,

+    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {

+  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,

+      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,

+      v26, v27, v28, v29, v30);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31>

+internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,

+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {

+  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,

+      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,

+      v25, v26, v27, v28, v29, v30, v31);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32>

+internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,

+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,

+    T32 v32) {

+  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,

+      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,

+      v24, v25, v26, v27, v28, v29, v30, v31, v32);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33>

+internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,

+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,

+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,

+    T32 v32, T33 v33) {

+  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,

+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,

+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34>

+internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,

+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,

+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,

+    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,

+    T31 v31, T32 v32, T33 v33, T34 v34) {

+  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,

+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,

+      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35>

+internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,

+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,

+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,

+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,

+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {

+  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,

+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,

+      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36>

+internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,

+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,

+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,

+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,

+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {

+  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,

+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,

+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,

+      v34, v35, v36);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37>

+internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,

+    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,

+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,

+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,

+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,

+    T37 v37) {

+  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,

+      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,

+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,

+      v34, v35, v36, v37);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38>

+internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,

+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,

+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,

+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,

+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,

+    T37 v37, T38 v38) {

+  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,

+      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,

+      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,

+      v33, v34, v35, v36, v37, v38);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39>

+internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,

+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,

+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,

+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,

+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,

+    T37 v37, T38 v38, T39 v39) {

+  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,

+      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,

+      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,

+      v32, v33, v34, v35, v36, v37, v38, v39);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40>

+internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,

+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,

+    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,

+    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,

+    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,

+    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {

+  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,

+      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,

+      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41>

+internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {

+  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,

+      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,

+      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42>

+internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+    T42 v42) {

+  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,

+      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,

+      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,

+      v42);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43>

+internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+    T42 v42, T43 v43) {

+  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,

+      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,

+      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,

+      v41, v42, v43);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44>

+internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+    T42 v42, T43 v43, T44 v44) {

+  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,

+      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,

+      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,

+      v40, v41, v42, v43, v44);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45>

+internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,

+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,

+    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,

+    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,

+    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,

+    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {

+  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,

+      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,

+      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,

+      v39, v40, v41, v42, v43, v44, v45);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46>

+internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,

+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,

+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,

+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {

+  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,

+      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,

+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,

+      v38, v39, v40, v41, v42, v43, v44, v45, v46);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47>

+internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,

+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,

+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,

+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {

+  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,

+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,

+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,

+      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48>

+internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,

+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,

+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,

+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,

+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,

+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,

+    T48 v48) {

+  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,

+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,

+      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,

+      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49>

+internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,

+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,

+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,

+    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,

+    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,

+    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,

+    T47 v47, T48 v48, T49 v49) {

+  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,

+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,

+      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,

+      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49, typename T50>

+internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,

+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,

+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,

+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,

+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,

+    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,

+    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {

+  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,

+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,

+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,

+      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,

+      v48, v49, v50);

+}

+

+// Bool() allows generating tests with parameters in a set of (false, true).

+//

+// Synopsis:

+// Bool()

+//   - returns a generator producing sequences with elements {false, true}.

+//

+// It is useful when testing code that depends on Boolean flags. Combinations

+// of multiple flags can be tested when several Bool()'s are combined using

+// Combine() function.

+//

+// In the following example all tests in the test case FlagDependentTest

+// will be instantiated twice with parameters false and true.

+//

+// class FlagDependentTest : public testing::TestWithParam<bool> {

+//   virtual void SetUp() {

+//     external_flag = GetParam();

+//   }

+// }

+// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());

+//

+inline internal::ParamGenerator<bool> Bool() {

+  return Values(false, true);

+}

+

+# if GTEST_HAS_COMBINE

+// Combine() allows the user to combine two or more sequences to produce

+// values of a Cartesian product of those sequences' elements.

+//

+// Synopsis:

+// Combine(gen1, gen2, ..., genN)

+//   - returns a generator producing sequences with elements coming from

+//     the Cartesian product of elements from the sequences generated by

+//     gen1, gen2, ..., genN. The sequence elements will have a type of

+//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types

+//     of elements from sequences produces by gen1, gen2, ..., genN.

+//

+// Combine can have up to 10 arguments. This number is currently limited

+// by the maximum number of elements in the tuple implementation used by Google

+// Test.

+//

+// Example:

+//

+// This will instantiate tests in test case AnimalTest each one with

+// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),

+// tuple("dog", BLACK), and tuple("dog", WHITE):

+//

+// enum Color { BLACK, GRAY, WHITE };

+// class AnimalTest

+//     : public testing::TestWithParam<tuple<const char*, Color> > {...};

+//

+// TEST_P(AnimalTest, AnimalLooksNice) {...}

+//

+// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,

+//                         Combine(Values("cat", "dog"),

+//                                 Values(BLACK, WHITE)));

+//

+// This will instantiate tests in FlagDependentTest with all variations of two

+// Boolean flags:

+//

+// class FlagDependentTest

+//     : public testing::TestWithParam<tuple<bool, bool> > {

+//   virtual void SetUp() {

+//     // Assigns external_flag_1 and external_flag_2 values from the tuple.

+//     tie(external_flag_1, external_flag_2) = GetParam();

+//   }

+// };

+//

+// TEST_P(FlagDependentTest, TestFeature1) {

+//   // Test your code using external_flag_1 and external_flag_2 here.

+// }

+// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,

+//                         Combine(Bool(), Bool()));

+//

+template <typename Generator1, typename Generator2>

+internal::CartesianProductHolder2<Generator1, Generator2> Combine(

+    const Generator1& g1, const Generator2& g2) {

+  return internal::CartesianProductHolder2<Generator1, Generator2>(

+      g1, g2);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3>

+internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3) {

+  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(

+      g1, g2, g3);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4>

+internal::CartesianProductHolder4<Generator1, Generator2, Generator3,

+    Generator4> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4) {

+  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,

+      Generator4>(

+      g1, g2, g3, g4);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4, typename Generator5>

+internal::CartesianProductHolder5<Generator1, Generator2, Generator3,

+    Generator4, Generator5> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4, const Generator5& g5) {

+  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,

+      Generator4, Generator5>(

+      g1, g2, g3, g4, g5);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4, typename Generator5, typename Generator6>

+internal::CartesianProductHolder6<Generator1, Generator2, Generator3,

+    Generator4, Generator5, Generator6> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4, const Generator5& g5, const Generator6& g6) {

+  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,

+      Generator4, Generator5, Generator6>(

+      g1, g2, g3, g4, g5, g6);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4, typename Generator5, typename Generator6,

+    typename Generator7>

+internal::CartesianProductHolder7<Generator1, Generator2, Generator3,

+    Generator4, Generator5, Generator6, Generator7> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4, const Generator5& g5, const Generator6& g6,

+        const Generator7& g7) {

+  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,

+      Generator4, Generator5, Generator6, Generator7>(

+      g1, g2, g3, g4, g5, g6, g7);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4, typename Generator5, typename Generator6,

+    typename Generator7, typename Generator8>

+internal::CartesianProductHolder8<Generator1, Generator2, Generator3,

+    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4, const Generator5& g5, const Generator6& g6,

+        const Generator7& g7, const Generator8& g8) {

+  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,

+      Generator4, Generator5, Generator6, Generator7, Generator8>(

+      g1, g2, g3, g4, g5, g6, g7, g8);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4, typename Generator5, typename Generator6,

+    typename Generator7, typename Generator8, typename Generator9>

+internal::CartesianProductHolder9<Generator1, Generator2, Generator3,

+    Generator4, Generator5, Generator6, Generator7, Generator8,

+    Generator9> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4, const Generator5& g5, const Generator6& g6,

+        const Generator7& g7, const Generator8& g8, const Generator9& g9) {

+  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,

+      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(

+      g1, g2, g3, g4, g5, g6, g7, g8, g9);

+}

+

+template <typename Generator1, typename Generator2, typename Generator3,

+    typename Generator4, typename Generator5, typename Generator6,

+    typename Generator7, typename Generator8, typename Generator9,

+    typename Generator10>

+internal::CartesianProductHolder10<Generator1, Generator2, Generator3,

+    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,

+    Generator10> Combine(

+    const Generator1& g1, const Generator2& g2, const Generator3& g3,

+        const Generator4& g4, const Generator5& g5, const Generator6& g6,

+        const Generator7& g7, const Generator8& g8, const Generator9& g9,

+        const Generator10& g10) {

+  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,

+      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,

+      Generator10>(

+      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);

+}

+# endif  // GTEST_HAS_COMBINE

+

+

+

+# define TEST_P(test_case_name, test_name) \

+  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \

+      : public test_case_name { \

+   public: \

+    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \

+    virtual void TestBody(); \

+   private: \

+    static int AddToRegistry() { \

+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \

+          GetTestCasePatternHolder<test_case_name>(\

+              #test_case_name, __FILE__, __LINE__)->AddTestPattern(\

+                  #test_case_name, \

+                  #test_name, \

+                  new ::testing::internal::TestMetaFactory< \

+                      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \

+      return 0; \

+    } \

+    static int gtest_registering_dummy_; \

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(\

+        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \

+  }; \

+  int GTEST_TEST_CLASS_NAME_(test_case_name, \

+                             test_name)::gtest_registering_dummy_ = \

+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \

+  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()

+

+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \

+  ::testing::internal::ParamGenerator<test_case_name::ParamType> \

+      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \

+  int gtest_##prefix##test_case_name##_dummy_ = \

+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \

+          GetTestCasePatternHolder<test_case_name>(\

+              #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\

+                  #prefix, \

+                  &gtest_##prefix##test_case_name##_EvalGenerator_, \

+                  __FILE__, __LINE__)

+

+}  // namespace testing

+

+#endif  // GTEST_HAS_PARAM_TEST

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump
new file mode 100644
index 0000000..dddead7
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump
@@ -0,0 +1,487 @@
+$$ -*- mode: c++; -*-

+$var n = 50  $$ Maximum length of Values arguments we want to support.

+$var maxtuple = 10  $$ Maximum number of Combine arguments we want to support.

+// 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.

+//

+// Authors: vladl@google.com (Vlad Losev)

+//

+// Macros and functions for implementing parameterized tests

+// in Google C++ Testing Framework (Google Test)

+//

+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!

+//

+#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_

+#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_

+

+

+// Value-parameterized tests allow you to test your code with different

+// parameters without writing multiple copies of the same test.

+//

+// Here is how you use value-parameterized tests:

+

+#if 0

+

+// To write value-parameterized tests, first you should define a fixture

+// class. It is usually derived from testing::TestWithParam<T> (see below for

+// another inheritance scheme that's sometimes useful in more complicated

+// class hierarchies), where the type of your parameter values.

+// TestWithParam<T> is itself derived from testing::Test. T can be any

+// copyable type. If it's a raw pointer, you are responsible for managing the

+// lifespan of the pointed values.

+

+class FooTest : public ::testing::TestWithParam<const char*> {

+  // You can implement all the usual class fixture members here.

+};

+

+// Then, use the TEST_P macro to define as many parameterized tests

+// for this fixture as you want. The _P suffix is for "parameterized"

+// or "pattern", whichever you prefer to think.

+

+TEST_P(FooTest, DoesBlah) {

+  // Inside a test, access the test parameter with the GetParam() method

+  // of the TestWithParam<T> class:

+  EXPECT_TRUE(foo.Blah(GetParam()));

+  ...

+}

+

+TEST_P(FooTest, HasBlahBlah) {

+  ...

+}

+

+// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test

+// case with any set of parameters you want. Google Test defines a number

+// of functions for generating test parameters. They return what we call

+// (surprise!) parameter generators. Here is a  summary of them, which

+// are all in the testing namespace:

+//

+//

+//  Range(begin, end [, step]) - Yields values {begin, begin+step,

+//                               begin+step+step, ...}. The values do not

+//                               include end. step defaults to 1.

+//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.

+//  ValuesIn(container)        - Yields values from a C-style array, an STL

+//  ValuesIn(begin,end)          container, or an iterator range [begin, end).

+//  Bool()                     - Yields sequence {false, true}.

+//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product

+//                               for the math savvy) of the values generated

+//                               by the N generators.

+//

+// For more details, see comments at the definitions of these functions below

+// in this file.

+//

+// The following statement will instantiate tests from the FooTest test case

+// each with parameter values "meeny", "miny", and "moe".

+

+INSTANTIATE_TEST_CASE_P(InstantiationName,

+                        FooTest,

+                        Values("meeny", "miny", "moe"));

+

+// To distinguish different instances of the pattern, (yes, you

+// can instantiate it more then once) the first argument to the

+// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the

+// actual test case name. Remember to pick unique prefixes for different

+// instantiations. The tests from the instantiation above will have

+// these names:

+//

+//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"

+//    * InstantiationName/FooTest.DoesBlah/1 for "miny"

+//    * InstantiationName/FooTest.DoesBlah/2 for "moe"

+//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"

+//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"

+//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"

+//

+// You can use these names in --gtest_filter.

+//

+// This statement will instantiate all tests from FooTest again, each

+// with parameter values "cat" and "dog":

+

+const char* pets[] = {"cat", "dog"};

+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));

+

+// The tests from the instantiation above will have these names:

+//

+//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"

+//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"

+//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"

+//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"

+//

+// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests

+// in the given test case, whether their definitions come before or

+// AFTER the INSTANTIATE_TEST_CASE_P statement.

+//

+// Please also note that generator expressions (including parameters to the

+// generators) are evaluated in InitGoogleTest(), after main() has started.

+// This allows the user on one hand, to adjust generator parameters in order

+// to dynamically determine a set of tests to run and on the other hand,

+// give the user a chance to inspect the generated tests with Google Test

+// reflection API before RUN_ALL_TESTS() is executed.

+//

+// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc

+// for more examples.

+//

+// In the future, we plan to publish the API for defining new parameter

+// generators. But for now this interface remains part of the internal

+// implementation and is subject to change.

+//

+//

+// A parameterized test fixture must be derived from testing::Test and from

+// testing::WithParamInterface<T>, where T is the type of the parameter

+// values. Inheriting from TestWithParam<T> satisfies that requirement because

+// TestWithParam<T> inherits from both Test and WithParamInterface. In more

+// complicated hierarchies, however, it is occasionally useful to inherit

+// separately from Test and WithParamInterface. For example:

+

+class BaseTest : public ::testing::Test {

+  // You can inherit all the usual members for a non-parameterized test

+  // fixture here.

+};

+

+class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {

+  // The usual test fixture members go here too.

+};

+

+TEST_F(BaseTest, HasFoo) {

+  // This is an ordinary non-parameterized test.

+}

+

+TEST_P(DerivedTest, DoesBlah) {

+  // GetParam works just the same here as if you inherit from TestWithParam.

+  EXPECT_TRUE(foo.Blah(GetParam()));

+}

+

+#endif  // 0

+

+#include "gtest/internal/gtest-port.h"

+

+#if !GTEST_OS_SYMBIAN

+# include <utility>

+#endif

+

+// scripts/fuse_gtest.py depends on gtest's own header being #included

+// *unconditionally*.  Therefore these #includes cannot be moved

+// inside #if GTEST_HAS_PARAM_TEST.

+#include "gtest/internal/gtest-internal.h"

+#include "gtest/internal/gtest-param-util.h"

+#include "gtest/internal/gtest-param-util-generated.h"

+

+#if GTEST_HAS_PARAM_TEST

+

+namespace testing {

+

+// Functions producing parameter generators.

+//

+// Google Test uses these generators to produce parameters for value-

+// parameterized tests. When a parameterized test case is instantiated

+// with a particular generator, Google Test creates and runs tests

+// for each element in the sequence produced by the generator.

+//

+// In the following sample, tests from test case FooTest are instantiated

+// each three times with parameter values 3, 5, and 8:

+//

+// class FooTest : public TestWithParam<int> { ... };

+//

+// TEST_P(FooTest, TestThis) {

+// }

+// TEST_P(FooTest, TestThat) {

+// }

+// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));

+//

+

+// Range() returns generators providing sequences of values in a range.

+//

+// Synopsis:

+// Range(start, end)

+//   - returns a generator producing a sequence of values {start, start+1,

+//     start+2, ..., }.

+// Range(start, end, step)

+//   - returns a generator producing a sequence of values {start, start+step,

+//     start+step+step, ..., }.

+// Notes:

+//   * The generated sequences never include end. For example, Range(1, 5)

+//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)

+//     returns a generator producing {1, 3, 5, 7}.

+//   * start and end must have the same type. That type may be any integral or

+//     floating-point type or a user defined type satisfying these conditions:

+//     * It must be assignable (have operator=() defined).

+//     * It must have operator+() (operator+(int-compatible type) for

+//       two-operand version).

+//     * It must have operator<() defined.

+//     Elements in the resulting sequences will also have that type.

+//   * Condition start < end must be satisfied in order for resulting sequences

+//     to contain any elements.

+//

+template <typename T, typename IncrementT>

+internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {

+  return internal::ParamGenerator<T>(

+      new internal::RangeGenerator<T, IncrementT>(start, end, step));

+}

+

+template <typename T>

+internal::ParamGenerator<T> Range(T start, T end) {

+  return Range(start, end, 1);

+}

+

+// ValuesIn() function allows generation of tests with parameters coming from

+// a container.

+//

+// Synopsis:

+// ValuesIn(const T (&array)[N])

+//   - returns a generator producing sequences with elements from

+//     a C-style array.

+// ValuesIn(const Container& container)

+//   - returns a generator producing sequences with elements from

+//     an STL-style container.

+// ValuesIn(Iterator begin, Iterator end)

+//   - returns a generator producing sequences with elements from

+//     a range [begin, end) defined by a pair of STL-style iterators. These

+//     iterators can also be plain C pointers.

+//

+// Please note that ValuesIn copies the values from the containers

+// passed in and keeps them to generate tests in RUN_ALL_TESTS().

+//

+// Examples:

+//

+// This instantiates tests from test case StringTest

+// each with C-string values of "foo", "bar", and "baz":

+//

+// const char* strings[] = {"foo", "bar", "baz"};

+// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));

+//

+// This instantiates tests from test case StlStringTest

+// each with STL strings with values "a" and "b":

+//

+// ::std::vector< ::std::string> GetParameterStrings() {

+//   ::std::vector< ::std::string> v;

+//   v.push_back("a");

+//   v.push_back("b");

+//   return v;

+// }

+//

+// INSTANTIATE_TEST_CASE_P(CharSequence,

+//                         StlStringTest,

+//                         ValuesIn(GetParameterStrings()));

+//

+//

+// This will also instantiate tests from CharTest

+// each with parameter values 'a' and 'b':

+//

+// ::std::list<char> GetParameterChars() {

+//   ::std::list<char> list;

+//   list.push_back('a');

+//   list.push_back('b');

+//   return list;

+// }

+// ::std::list<char> l = GetParameterChars();

+// INSTANTIATE_TEST_CASE_P(CharSequence2,

+//                         CharTest,

+//                         ValuesIn(l.begin(), l.end()));

+//

+template <typename ForwardIterator>

+internal::ParamGenerator<

+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>

+ValuesIn(ForwardIterator begin, ForwardIterator end) {

+  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>

+      ::value_type ParamType;

+  return internal::ParamGenerator<ParamType>(

+      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));

+}

+

+template <typename T, size_t N>

+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {

+  return ValuesIn(array, array + N);

+}

+

+template <class Container>

+internal::ParamGenerator<typename Container::value_type> ValuesIn(

+    const Container& container) {

+  return ValuesIn(container.begin(), container.end());

+}

+

+// Values() allows generating tests from explicitly specified list of

+// parameters.

+//

+// Synopsis:

+// Values(T v1, T v2, ..., T vN)

+//   - returns a generator producing sequences with elements v1, v2, ..., vN.

+//

+// For example, this instantiates tests from test case BarTest each

+// with values "one", "two", and "three":

+//

+// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));

+//

+// This instantiates tests from test case BazTest each with values 1, 2, 3.5.

+// The exact type of values will depend on the type of parameter in BazTest.

+//

+// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));

+//

+// Currently, Values() supports from 1 to $n parameters.

+//

+$range i 1..n

+$for i [[

+$range j 1..i

+

+template <$for j, [[typename T$j]]>

+internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) {

+  return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]);

+}

+

+]]

+

+// Bool() allows generating tests with parameters in a set of (false, true).

+//

+// Synopsis:

+// Bool()

+//   - returns a generator producing sequences with elements {false, true}.

+//

+// It is useful when testing code that depends on Boolean flags. Combinations

+// of multiple flags can be tested when several Bool()'s are combined using

+// Combine() function.

+//

+// In the following example all tests in the test case FlagDependentTest

+// will be instantiated twice with parameters false and true.

+//

+// class FlagDependentTest : public testing::TestWithParam<bool> {

+//   virtual void SetUp() {

+//     external_flag = GetParam();

+//   }

+// }

+// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());

+//

+inline internal::ParamGenerator<bool> Bool() {

+  return Values(false, true);

+}

+

+# if GTEST_HAS_COMBINE

+// Combine() allows the user to combine two or more sequences to produce

+// values of a Cartesian product of those sequences' elements.

+//

+// Synopsis:

+// Combine(gen1, gen2, ..., genN)

+//   - returns a generator producing sequences with elements coming from

+//     the Cartesian product of elements from the sequences generated by

+//     gen1, gen2, ..., genN. The sequence elements will have a type of

+//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types

+//     of elements from sequences produces by gen1, gen2, ..., genN.

+//

+// Combine can have up to $maxtuple arguments. This number is currently limited

+// by the maximum number of elements in the tuple implementation used by Google

+// Test.

+//

+// Example:

+//

+// This will instantiate tests in test case AnimalTest each one with

+// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),

+// tuple("dog", BLACK), and tuple("dog", WHITE):

+//

+// enum Color { BLACK, GRAY, WHITE };

+// class AnimalTest

+//     : public testing::TestWithParam<tuple<const char*, Color> > {...};

+//

+// TEST_P(AnimalTest, AnimalLooksNice) {...}

+//

+// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,

+//                         Combine(Values("cat", "dog"),

+//                                 Values(BLACK, WHITE)));

+//

+// This will instantiate tests in FlagDependentTest with all variations of two

+// Boolean flags:

+//

+// class FlagDependentTest

+//     : public testing::TestWithParam<tuple<bool, bool> > {

+//   virtual void SetUp() {

+//     // Assigns external_flag_1 and external_flag_2 values from the tuple.

+//     tie(external_flag_1, external_flag_2) = GetParam();

+//   }

+// };

+//

+// TEST_P(FlagDependentTest, TestFeature1) {

+//   // Test your code using external_flag_1 and external_flag_2 here.

+// }

+// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,

+//                         Combine(Bool(), Bool()));

+//

+$range i 2..maxtuple

+$for i [[

+$range j 1..i

+

+template <$for j, [[typename Generator$j]]>

+internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine(

+    $for j, [[const Generator$j& g$j]]) {

+  return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>(

+      $for j, [[g$j]]);

+}

+

+]]

+# endif  // GTEST_HAS_COMBINE

+

+

+

+# define TEST_P(test_case_name, test_name) \

+  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \

+      : public test_case_name { \

+   public: \

+    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \

+    virtual void TestBody(); \

+   private: \

+    static int AddToRegistry() { \

+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \

+          GetTestCasePatternHolder<test_case_name>(\

+              #test_case_name, __FILE__, __LINE__)->AddTestPattern(\

+                  #test_case_name, \

+                  #test_name, \

+                  new ::testing::internal::TestMetaFactory< \

+                      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \

+      return 0; \

+    } \

+    static int gtest_registering_dummy_; \

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(\

+        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \

+  }; \

+  int GTEST_TEST_CLASS_NAME_(test_case_name, \

+                             test_name)::gtest_registering_dummy_ = \

+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \

+  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()

+

+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \

+  ::testing::internal::ParamGenerator<test_case_name::ParamType> \

+      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \

+  int gtest_##prefix##test_case_name##_dummy_ = \

+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \

+          GetTestCasePatternHolder<test_case_name>(\

+              #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\

+                  #prefix, \

+                  &gtest_##prefix##test_case_name##_EvalGenerator_, \

+                  __FILE__, __LINE__)

+

+}  // namespace testing

+

+#endif  // GTEST_HAS_PARAM_TEST

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-printers.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-printers.h
new file mode 100644
index 0000000..0e9a193
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-printers.h
@@ -0,0 +1,855 @@
+// 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 Test - The Google C++ Testing Framework

+//

+// This file implements a universal value printer that can print a

+// value of any type T:

+//

+//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);

+//

+// A user can teach this function how to print a class type T by

+// defining either operator<<() or PrintTo() in the namespace that

+// defines T.  More specifically, the FIRST defined function in the

+// following list will be used (assuming T is defined in namespace

+// foo):

+//

+//   1. foo::PrintTo(const T&, ostream*)

+//   2. operator<<(ostream&, const T&) defined in either foo or the

+//      global namespace.

+//

+// If none of the above is defined, it will print the debug string of

+// the value if it is a protocol buffer, or print the raw bytes in the

+// value otherwise.

+//

+// To aid debugging: when T is a reference type, the address of the

+// value is also printed; when T is a (const) char pointer, both the

+// pointer value and the NUL-terminated string it points to are

+// printed.

+//

+// We also provide some convenient wrappers:

+//

+//   // Prints a value to a string.  For a (const or not) char

+//   // pointer, the NUL-terminated string (but not the pointer) is

+//   // printed.

+//   std::string ::testing::PrintToString(const T& value);

+//

+//   // Prints a value tersely: for a reference type, the referenced

+//   // value (but not the address) is printed; for a (const or not) char

+//   // pointer, the NUL-terminated string (but not the pointer) is

+//   // printed.

+//   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);

+//

+//   // Prints value using the type inferred by the compiler.  The difference

+//   // from UniversalTersePrint() is that this function prints both the

+//   // pointer and the NUL-terminated string for a (const or not) char pointer.

+//   void ::testing::internal::UniversalPrint(const T& value, ostream*);

+//

+//   // Prints the fields of a tuple tersely to a string vector, one

+//   // element for each field. Tuple support must be enabled in

+//   // gtest-port.h.

+//   std::vector<string> UniversalTersePrintTupleFieldsToStrings(

+//       const Tuple& value);

+//

+// Known limitation:

+//

+// The print primitives print the elements of an STL-style container

+// using the compiler-inferred type of *iter where iter is a

+// const_iterator of the container.  When const_iterator is an input

+// iterator but not a forward iterator, this inferred type may not

+// match value_type, and the print output may be incorrect.  In

+// practice, this is rarely a problem as for most containers

+// const_iterator is a forward iterator.  We'll fix this if there's an

+// actual need for it.  Note that this fix cannot rely on value_type

+// being defined as many user-defined container types don't have

+// value_type.

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_

+#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_

+

+#include <ostream>  // NOLINT

+#include <sstream>

+#include <string>

+#include <utility>

+#include <vector>

+#include "gtest/internal/gtest-port.h"

+#include "gtest/internal/gtest-internal.h"

+

+namespace testing {

+

+// Definitions in the 'internal' and 'internal2' name spaces are

+// subject to change without notice.  DO NOT USE THEM IN USER CODE!

+namespace internal2 {

+

+// Prints the given number of bytes in the given object to the given

+// ostream.

+GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,

+                                     size_t count,

+                                     ::std::ostream* os);

+

+// For selecting which printer to use when a given type has neither <<

+// nor PrintTo().

+enum TypeKind {

+  kProtobuf,              // a protobuf type

+  kConvertibleToInteger,  // a type implicitly convertible to BiggestInt

+                          // (e.g. a named or unnamed enum type)

+  kOtherType              // anything else

+};

+

+// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called

+// by the universal printer to print a value of type T when neither

+// operator<< nor PrintTo() is defined for T, where kTypeKind is the

+// "kind" of T as defined by enum TypeKind.

+template <typename T, TypeKind kTypeKind>

+class TypeWithoutFormatter {

+ public:

+  // This default version is called when kTypeKind is kOtherType.

+  static void PrintValue(const T& value, ::std::ostream* os) {

+    PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),

+                         sizeof(value), os);

+  }

+};

+

+// We print a protobuf using its ShortDebugString() when the string

+// doesn't exceed this many characters; otherwise we print it using

+// DebugString() for better readability.

+const size_t kProtobufOneLinerMaxLength = 50;

+

+template <typename T>

+class TypeWithoutFormatter<T, kProtobuf> {

+ public:

+  static void PrintValue(const T& value, ::std::ostream* os) {

+    const ::testing::internal::string short_str = value.ShortDebugString();

+    const ::testing::internal::string pretty_str =

+        short_str.length() <= kProtobufOneLinerMaxLength ?

+        short_str : ("\n" + value.DebugString());

+    *os << ("<" + pretty_str + ">");

+  }

+};

+

+template <typename T>

+class TypeWithoutFormatter<T, kConvertibleToInteger> {

+ public:

+  // Since T has no << operator or PrintTo() but can be implicitly

+  // converted to BiggestInt, we print it as a BiggestInt.

+  //

+  // Most likely T is an enum type (either named or unnamed), in which

+  // case printing it as an integer is the desired behavior.  In case

+  // T is not an enum, printing it as an integer is the best we can do

+  // given that it has no user-defined printer.

+  static void PrintValue(const T& value, ::std::ostream* os) {

+    const internal::BiggestInt kBigInt = value;

+    *os << kBigInt;

+  }

+};

+

+// Prints the given value to the given ostream.  If the value is a

+// protocol message, its debug string is printed; if it's an enum or

+// of a type implicitly convertible to BiggestInt, it's printed as an

+// integer; otherwise the bytes in the value are printed.  This is

+// what UniversalPrinter<T>::Print() does when it knows nothing about

+// type T and T has neither << operator nor PrintTo().

+//

+// A user can override this behavior for a class type Foo by defining

+// a << operator in the namespace where Foo is defined.

+//

+// We put this operator in namespace 'internal2' instead of 'internal'

+// to simplify the implementation, as much code in 'internal' needs to

+// use << in STL, which would conflict with our own << were it defined

+// in 'internal'.

+//

+// Note that this operator<< takes a generic std::basic_ostream<Char,

+// CharTraits> type instead of the more restricted std::ostream.  If

+// we define it to take an std::ostream instead, we'll get an

+// "ambiguous overloads" compiler error when trying to print a type

+// Foo that supports streaming to std::basic_ostream<Char,

+// CharTraits>, as the compiler cannot tell whether

+// operator<<(std::ostream&, const T&) or

+// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more

+// specific.

+template <typename Char, typename CharTraits, typename T>

+::std::basic_ostream<Char, CharTraits>& operator<<(

+    ::std::basic_ostream<Char, CharTraits>& os, const T& x) {

+  TypeWithoutFormatter<T,

+      (internal::IsAProtocolMessage<T>::value ? kProtobuf :

+       internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?

+       kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);

+  return os;

+}

+

+}  // namespace internal2

+}  // namespace testing

+

+// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up

+// magic needed for implementing UniversalPrinter won't work.

+namespace testing_internal {

+

+// Used to print a value that is not an STL-style container when the

+// user doesn't define PrintTo() for it.

+template <typename T>

+void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {

+  // With the following statement, during unqualified name lookup,

+  // testing::internal2::operator<< appears as if it was declared in

+  // the nearest enclosing namespace that contains both

+  // ::testing_internal and ::testing::internal2, i.e. the global

+  // namespace.  For more details, refer to the C++ Standard section

+  // 7.3.4-1 [namespace.udir].  This allows us to fall back onto

+  // testing::internal2::operator<< in case T doesn't come with a <<

+  // operator.

+  //

+  // We cannot write 'using ::testing::internal2::operator<<;', which

+  // gcc 3.3 fails to compile due to a compiler bug.

+  using namespace ::testing::internal2;  // NOLINT

+

+  // Assuming T is defined in namespace foo, in the next statement,

+  // the compiler will consider all of:

+  //

+  //   1. foo::operator<< (thanks to Koenig look-up),

+  //   2. ::operator<< (as the current namespace is enclosed in ::),

+  //   3. testing::internal2::operator<< (thanks to the using statement above).

+  //

+  // The operator<< whose type matches T best will be picked.

+  //

+  // We deliberately allow #2 to be a candidate, as sometimes it's

+  // impossible to define #1 (e.g. when foo is ::std, defining

+  // anything in it is undefined behavior unless you are a compiler

+  // vendor.).

+  *os << value;

+}

+

+}  // namespace testing_internal

+

+namespace testing {

+namespace internal {

+

+// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given

+// value to the given ostream.  The caller must ensure that

+// 'ostream_ptr' is not NULL, or the behavior is undefined.

+//

+// We define UniversalPrinter as a class template (as opposed to a

+// function template), as we need to partially specialize it for

+// reference types, which cannot be done with function templates.

+template <typename T>

+class UniversalPrinter;

+

+template <typename T>

+void UniversalPrint(const T& value, ::std::ostream* os);

+

+// Used to print an STL-style container when the user doesn't define

+// a PrintTo() for it.

+template <typename C>

+void DefaultPrintTo(IsContainer /* dummy */,

+                    false_type /* is not a pointer */,

+                    const C& container, ::std::ostream* os) {

+  const size_t kMaxCount = 32;  // The maximum number of elements to print.

+  *os << '{';

+  size_t count = 0;

+  for (typename C::const_iterator it = container.begin();

+       it != container.end(); ++it, ++count) {

+    if (count > 0) {

+      *os << ',';

+      if (count == kMaxCount) {  // Enough has been printed.

+        *os << " ...";

+        break;

+      }

+    }

+    *os << ' ';

+    // We cannot call PrintTo(*it, os) here as PrintTo() doesn't

+    // handle *it being a native array.

+    internal::UniversalPrint(*it, os);

+  }

+

+  if (count > 0) {

+    *os << ' ';

+  }

+  *os << '}';

+}

+

+// Used to print a pointer that is neither a char pointer nor a member

+// pointer, when the user doesn't define PrintTo() for it.  (A member

+// variable pointer or member function pointer doesn't really point to

+// a location in the address space.  Their representation is

+// implementation-defined.  Therefore they will be printed as raw

+// bytes.)

+template <typename T>

+void DefaultPrintTo(IsNotContainer /* dummy */,

+                    true_type /* is a pointer */,

+                    T* p, ::std::ostream* os) {

+  if (p == NULL) {

+    *os << "NULL";

+  } else {

+    // C++ doesn't allow casting from a function pointer to any object

+    // pointer.

+    //

+    // IsTrue() silences warnings: "Condition is always true",

+    // "unreachable code".

+    if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {

+      // T is not a function type.  We just call << to print p,

+      // relying on ADL to pick up user-defined << for their pointer

+      // types, if any.

+      *os << p;

+    } else {

+      // T is a function type, so '*os << p' doesn't do what we want

+      // (it just prints p as bool).  We want to print p as a const

+      // void*.  However, we cannot cast it to const void* directly,

+      // even using reinterpret_cast, as earlier versions of gcc

+      // (e.g. 3.4.5) cannot compile the cast when p is a function

+      // pointer.  Casting to UInt64 first solves the problem.

+      *os << reinterpret_cast<const void*>(

+          reinterpret_cast<internal::UInt64>(p));

+    }

+  }

+}

+

+// Used to print a non-container, non-pointer value when the user

+// doesn't define PrintTo() for it.

+template <typename T>

+void DefaultPrintTo(IsNotContainer /* dummy */,

+                    false_type /* is not a pointer */,

+                    const T& value, ::std::ostream* os) {

+  ::testing_internal::DefaultPrintNonContainerTo(value, os);

+}

+

+// Prints the given value using the << operator if it has one;

+// otherwise prints the bytes in it.  This is what

+// UniversalPrinter<T>::Print() does when PrintTo() is not specialized

+// or overloaded for type T.

+//

+// A user can override this behavior for a class type Foo by defining

+// an overload of PrintTo() in the namespace where Foo is defined.  We

+// give the user this option as sometimes defining a << operator for

+// Foo is not desirable (e.g. the coding style may prevent doing it,

+// or there is already a << operator but it doesn't do what the user

+// wants).

+template <typename T>

+void PrintTo(const T& value, ::std::ostream* os) {

+  // DefaultPrintTo() is overloaded.  The type of its first two

+  // arguments determine which version will be picked.  If T is an

+  // STL-style container, the version for container will be called; if

+  // T is a pointer, the pointer version will be called; otherwise the

+  // generic version will be called.

+  //

+  // Note that we check for container types here, prior to we check

+  // for protocol message types in our operator<<.  The rationale is:

+  //

+  // For protocol messages, we want to give people a chance to

+  // override Google Mock's format by defining a PrintTo() or

+  // operator<<.  For STL containers, other formats can be

+  // incompatible with Google Mock's format for the container

+  // elements; therefore we check for container types here to ensure

+  // that our format is used.

+  //

+  // The second argument of DefaultPrintTo() is needed to bypass a bug

+  // in Symbian's C++ compiler that prevents it from picking the right

+  // overload between:

+  //

+  //   PrintTo(const T& x, ...);

+  //   PrintTo(T* x, ...);

+  DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);

+}

+

+// The following list of PrintTo() overloads tells

+// UniversalPrinter<T>::Print() how to print standard types (built-in

+// types, strings, plain arrays, and pointers).

+

+// Overloads for various char types.

+GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);

+GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);

+inline void PrintTo(char c, ::std::ostream* os) {

+  // When printing a plain char, we always treat it as unsigned.  This

+  // way, the output won't be affected by whether the compiler thinks

+  // char is signed or not.

+  PrintTo(static_cast<unsigned char>(c), os);

+}

+

+// Overloads for other simple built-in types.

+inline void PrintTo(bool x, ::std::ostream* os) {

+  *os << (x ? "true" : "false");

+}

+

+// Overload for wchar_t type.

+// Prints a wchar_t as a symbol if it is printable or as its internal

+// code otherwise and also as its decimal code (except for L'\0').

+// The L'\0' char is printed as "L'\\0'". The decimal code is printed

+// as signed integer when wchar_t is implemented by the compiler

+// as a signed type and is printed as an unsigned integer when wchar_t

+// is implemented as an unsigned type.

+GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);

+

+// Overloads for C strings.

+GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);

+inline void PrintTo(char* s, ::std::ostream* os) {

+  PrintTo(ImplicitCast_<const char*>(s), os);

+}

+

+// signed/unsigned char is often used for representing binary data, so

+// we print pointers to it as void* to be safe.

+inline void PrintTo(const signed char* s, ::std::ostream* os) {

+  PrintTo(ImplicitCast_<const void*>(s), os);

+}

+inline void PrintTo(signed char* s, ::std::ostream* os) {

+  PrintTo(ImplicitCast_<const void*>(s), os);

+}

+inline void PrintTo(const unsigned char* s, ::std::ostream* os) {

+  PrintTo(ImplicitCast_<const void*>(s), os);

+}

+inline void PrintTo(unsigned char* s, ::std::ostream* os) {

+  PrintTo(ImplicitCast_<const void*>(s), os);

+}

+

+// MSVC can be configured to define wchar_t as a typedef of unsigned

+// short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native

+// type.  When wchar_t is a typedef, defining an overload for const

+// wchar_t* would cause unsigned short* be printed as a wide string,

+// possibly causing invalid memory accesses.

+#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)

+// Overloads for wide C strings

+GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);

+inline void PrintTo(wchar_t* s, ::std::ostream* os) {

+  PrintTo(ImplicitCast_<const wchar_t*>(s), os);

+}

+#endif

+

+// Overload for C arrays.  Multi-dimensional arrays are printed

+// properly.

+

+// Prints the given number of elements in an array, without printing

+// the curly braces.

+template <typename T>

+void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {

+  UniversalPrint(a[0], os);

+  for (size_t i = 1; i != count; i++) {

+    *os << ", ";

+    UniversalPrint(a[i], os);

+  }

+}

+

+// Overloads for ::string and ::std::string.

+#if GTEST_HAS_GLOBAL_STRING

+GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);

+inline void PrintTo(const ::string& s, ::std::ostream* os) {

+  PrintStringTo(s, os);

+}

+#endif  // GTEST_HAS_GLOBAL_STRING

+

+GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);

+inline void PrintTo(const ::std::string& s, ::std::ostream* os) {

+  PrintStringTo(s, os);

+}

+

+// Overloads for ::wstring and ::std::wstring.

+#if GTEST_HAS_GLOBAL_WSTRING

+GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);

+inline void PrintTo(const ::wstring& s, ::std::ostream* os) {

+  PrintWideStringTo(s, os);

+}

+#endif  // GTEST_HAS_GLOBAL_WSTRING

+

+#if GTEST_HAS_STD_WSTRING

+GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);

+inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {

+  PrintWideStringTo(s, os);

+}

+#endif  // GTEST_HAS_STD_WSTRING

+

+#if GTEST_HAS_TR1_TUPLE

+// Overload for ::std::tr1::tuple.  Needed for printing function arguments,

+// which are packed as tuples.

+

+// Helper function for printing a tuple.  T must be instantiated with

+// a tuple type.

+template <typename T>

+void PrintTupleTo(const T& t, ::std::ostream* os);

+

+// Overloaded PrintTo() for tuples of various arities.  We support

+// tuples of up-to 10 fields.  The following implementation works

+// regardless of whether tr1::tuple is implemented using the

+// non-standard variadic template feature or not.

+

+inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1>

+void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2>

+void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,

+             ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+          typename T6>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,

+             ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+          typename T6, typename T7>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,

+             ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+          typename T6, typename T7, typename T8>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,

+             ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+          typename T6, typename T7, typename T8, typename T9>

+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,

+             ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+          typename T6, typename T7, typename T8, typename T9, typename T10>

+void PrintTo(

+    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,

+    ::std::ostream* os) {

+  PrintTupleTo(t, os);

+}

+#endif  // GTEST_HAS_TR1_TUPLE

+

+// Overload for std::pair.

+template <typename T1, typename T2>

+void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {

+  *os << '(';

+  // We cannot use UniversalPrint(value.first, os) here, as T1 may be

+  // a reference type.  The same for printing value.second.

+  UniversalPrinter<T1>::Print(value.first, os);

+  *os << ", ";

+  UniversalPrinter<T2>::Print(value.second, os);

+  *os << ')';

+}

+

+// Implements printing a non-reference type T by letting the compiler

+// pick the right overload of PrintTo() for T.

+template <typename T>

+class UniversalPrinter {

+ public:

+  // MSVC warns about adding const to a function type, so we want to

+  // disable the warning.

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4180)  // Temporarily disables warning 4180.

+#endif  // _MSC_VER

+

+  // Note: we deliberately don't call this PrintTo(), as that name

+  // conflicts with ::testing::internal::PrintTo in the body of the

+  // function.

+  static void Print(const T& value, ::std::ostream* os) {

+    // By default, ::testing::internal::PrintTo() is used for printing

+    // the value.

+    //

+    // Thanks to Koenig look-up, if T is a class and has its own

+    // PrintTo() function defined in its namespace, that function will

+    // be visible here.  Since it is more specific than the generic ones

+    // in ::testing::internal, it will be picked by the compiler in the

+    // following statement - exactly what we want.

+    PrintTo(value, os);

+  }

+

+#ifdef _MSC_VER

+# pragma warning(pop)           // Restores the warning state.

+#endif  // _MSC_VER

+};

+

+// UniversalPrintArray(begin, len, os) prints an array of 'len'

+// elements, starting at address 'begin'.

+template <typename T>

+void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {

+  if (len == 0) {

+    *os << "{}";

+  } else {

+    *os << "{ ";

+    const size_t kThreshold = 18;

+    const size_t kChunkSize = 8;

+    // If the array has more than kThreshold elements, we'll have to

+    // omit some details by printing only the first and the last

+    // kChunkSize elements.

+    // TODO(wan@google.com): let the user control the threshold using a flag.

+    if (len <= kThreshold) {

+      PrintRawArrayTo(begin, len, os);

+    } else {

+      PrintRawArrayTo(begin, kChunkSize, os);

+      *os << ", ..., ";

+      PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);

+    }

+    *os << " }";

+  }

+}

+// This overload prints a (const) char array compactly.

+GTEST_API_ void UniversalPrintArray(

+    const char* begin, size_t len, ::std::ostream* os);

+

+// This overload prints a (const) wchar_t array compactly.

+GTEST_API_ void UniversalPrintArray(

+    const wchar_t* begin, size_t len, ::std::ostream* os);

+

+// Implements printing an array type T[N].

+template <typename T, size_t N>

+class UniversalPrinter<T[N]> {

+ public:

+  // Prints the given array, omitting some elements when there are too

+  // many.

+  static void Print(const T (&a)[N], ::std::ostream* os) {

+    UniversalPrintArray(a, N, os);

+  }

+};

+

+// Implements printing a reference type T&.

+template <typename T>

+class UniversalPrinter<T&> {

+ public:

+  // MSVC warns about adding const to a function type, so we want to

+  // disable the warning.

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4180)  // Temporarily disables warning 4180.

+#endif  // _MSC_VER

+

+  static void Print(const T& value, ::std::ostream* os) {

+    // Prints the address of the value.  We use reinterpret_cast here

+    // as static_cast doesn't compile when T is a function type.

+    *os << "@" << reinterpret_cast<const void*>(&value) << " ";

+

+    // Then prints the value itself.

+    UniversalPrint(value, os);

+  }

+

+#ifdef _MSC_VER

+# pragma warning(pop)           // Restores the warning state.

+#endif  // _MSC_VER

+};

+

+// Prints a value tersely: for a reference type, the referenced value

+// (but not the address) is printed; for a (const) char pointer, the

+// NUL-terminated string (but not the pointer) is printed.

+

+template <typename T>

+class UniversalTersePrinter {

+ public:

+  static void Print(const T& value, ::std::ostream* os) {

+    UniversalPrint(value, os);

+  }

+};

+template <typename T>

+class UniversalTersePrinter<T&> {

+ public:

+  static void Print(const T& value, ::std::ostream* os) {

+    UniversalPrint(value, os);

+  }

+};

+template <typename T, size_t N>

+class UniversalTersePrinter<T[N]> {

+ public:

+  static void Print(const T (&value)[N], ::std::ostream* os) {

+    UniversalPrinter<T[N]>::Print(value, os);

+  }

+};

+template <>

+class UniversalTersePrinter<const char*> {

+ public:

+  static void Print(const char* str, ::std::ostream* os) {

+    if (str == NULL) {

+      *os << "NULL";

+    } else {

+      UniversalPrint(string(str), os);

+    }

+  }

+};

+template <>

+class UniversalTersePrinter<char*> {

+ public:

+  static void Print(char* str, ::std::ostream* os) {

+    UniversalTersePrinter<const char*>::Print(str, os);

+  }

+};

+

+#if GTEST_HAS_STD_WSTRING

+template <>

+class UniversalTersePrinter<const wchar_t*> {

+ public:

+  static void Print(const wchar_t* str, ::std::ostream* os) {

+    if (str == NULL) {

+      *os << "NULL";

+    } else {

+      UniversalPrint(::std::wstring(str), os);

+    }

+  }

+};

+#endif

+

+template <>

+class UniversalTersePrinter<wchar_t*> {

+ public:

+  static void Print(wchar_t* str, ::std::ostream* os) {

+    UniversalTersePrinter<const wchar_t*>::Print(str, os);

+  }

+};

+

+template <typename T>

+void UniversalTersePrint(const T& value, ::std::ostream* os) {

+  UniversalTersePrinter<T>::Print(value, os);

+}

+

+// Prints a value using the type inferred by the compiler.  The

+// difference between this and UniversalTersePrint() is that for a

+// (const) char pointer, this prints both the pointer and the

+// NUL-terminated string.

+template <typename T>

+void UniversalPrint(const T& value, ::std::ostream* os) {

+  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating

+  // UniversalPrinter with T directly.

+  typedef T T1;

+  UniversalPrinter<T1>::Print(value, os);

+}

+

+#if GTEST_HAS_TR1_TUPLE

+typedef ::std::vector<string> Strings;

+

+// This helper template allows PrintTo() for tuples and

+// UniversalTersePrintTupleFieldsToStrings() to be defined by

+// induction on the number of tuple fields.  The idea is that

+// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N

+// fields in tuple t, and can be defined in terms of

+// TuplePrefixPrinter<N - 1>.

+

+// The inductive case.

+template <size_t N>

+struct TuplePrefixPrinter {

+  // Prints the first N fields of a tuple.

+  template <typename Tuple>

+  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {

+    TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);

+    *os << ", ";

+    UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>

+        ::Print(::std::tr1::get<N - 1>(t), os);

+  }

+

+  // Tersely prints the first N fields of a tuple to a string vector,

+  // one element for each field.

+  template <typename Tuple>

+  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {

+    TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);

+    ::std::stringstream ss;

+    UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);

+    strings->push_back(ss.str());

+  }

+};

+

+// Base cases.

+template <>

+struct TuplePrefixPrinter<0> {

+  template <typename Tuple>

+  static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}

+

+  template <typename Tuple>

+  static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}

+};

+// We have to specialize the entire TuplePrefixPrinter<> class

+// template here, even though the definition of

+// TersePrintPrefixToStrings() is the same as the generic version, as

+// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't

+// support specializing a method template of a class template.

+template <>

+struct TuplePrefixPrinter<1> {

+  template <typename Tuple>

+  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {

+    UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::

+        Print(::std::tr1::get<0>(t), os);

+  }

+

+  template <typename Tuple>

+  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {

+    ::std::stringstream ss;

+    UniversalTersePrint(::std::tr1::get<0>(t), &ss);

+    strings->push_back(ss.str());

+  }

+};

+

+// Helper function for printing a tuple.  T must be instantiated with

+// a tuple type.

+template <typename T>

+void PrintTupleTo(const T& t, ::std::ostream* os) {

+  *os << "(";

+  TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::

+      PrintPrefixTo(t, os);

+  *os << ")";

+}

+

+// Prints the fields of a tuple tersely to a string vector, one

+// element for each field.  See the comment before

+// UniversalTersePrint() for how we define "tersely".

+template <typename Tuple>

+Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {

+  Strings result;

+  TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::

+      TersePrintPrefixToStrings(value, &result);

+  return result;

+}

+#endif  // GTEST_HAS_TR1_TUPLE

+

+}  // namespace internal

+

+template <typename T>

+::std::string PrintToString(const T& value) {

+  ::std::stringstream ss;

+  internal::UniversalTersePrinter<T>::Print(value, &ss);

+  return ss.str();

+}

+

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-spi.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-spi.h
new file mode 100644
index 0000000..8ecfb72
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-spi.h
@@ -0,0 +1,232 @@
+// 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)

+//

+// Utilities for testing Google Test itself and code that uses Google Test

+// (e.g. frameworks built on top of Google Test).

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_

+#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_

+

+#include "gtest/gtest.h"

+

+namespace testing {

+

+// This helper class can be used to mock out Google Test failure reporting

+// so that we can test Google Test or code that builds on Google Test.

+//

+// An object of this class appends a TestPartResult object to the

+// TestPartResultArray object given in the constructor whenever a Google Test

+// failure is reported. It can either intercept only failures that are

+// generated in the same thread that created this object or it can intercept

+// all generated failures. The scope of this mock object can be controlled with

+// the second argument to the two arguments constructor.

+class GTEST_API_ ScopedFakeTestPartResultReporter

+    : public TestPartResultReporterInterface {

+ public:

+  // The two possible mocking modes of this object.

+  enum InterceptMode {

+    INTERCEPT_ONLY_CURRENT_THREAD,  // Intercepts only thread local failures.

+    INTERCEPT_ALL_THREADS           // Intercepts all failures.

+  };

+

+  // The c'tor sets this object as the test part result reporter used

+  // by Google Test.  The 'result' parameter specifies where to report the

+  // results. This reporter will only catch failures generated in the current

+  // thread. DEPRECATED

+  explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);

+

+  // Same as above, but you can choose the interception scope of this object.

+  ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,

+                                   TestPartResultArray* result);

+

+  // The d'tor restores the previous test part result reporter.

+  virtual ~ScopedFakeTestPartResultReporter();

+

+  // Appends the TestPartResult object to the TestPartResultArray

+  // received in the constructor.

+  //

+  // This method is from the TestPartResultReporterInterface

+  // interface.

+  virtual void ReportTestPartResult(const TestPartResult& result);

+ private:

+  void Init();

+

+  const InterceptMode intercept_mode_;

+  TestPartResultReporterInterface* old_reporter_;

+  TestPartResultArray* const result_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);

+};

+

+namespace internal {

+

+// A helper class for implementing EXPECT_FATAL_FAILURE() and

+// EXPECT_NONFATAL_FAILURE().  Its destructor verifies that the given

+// TestPartResultArray contains exactly one failure that has the given

+// type and contains the given substring.  If that's not the case, a

+// non-fatal failure will be generated.

+class GTEST_API_ SingleFailureChecker {

+ public:

+  // The constructor remembers the arguments.

+  SingleFailureChecker(const TestPartResultArray* results,

+                       TestPartResult::Type type,

+                       const string& substr);

+  ~SingleFailureChecker();

+ private:

+  const TestPartResultArray* const results_;

+  const TestPartResult::Type type_;

+  const string substr_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);

+};

+

+}  // namespace internal

+

+}  // namespace testing

+

+// A set of macros for testing Google Test assertions or code that's expected

+// to generate Google Test fatal failures.  It verifies that the given

+// statement will cause exactly one fatal Google Test failure with 'substr'

+// being part of the failure message.

+//

+// There are two different versions of this macro. EXPECT_FATAL_FAILURE only

+// affects and considers failures generated in the current thread and

+// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.

+//

+// The verification of the assertion is done correctly even when the statement

+// throws an exception or aborts the current function.

+//

+// Known restrictions:

+//   - 'statement' cannot reference local non-static variables or

+//     non-static members of the current object.

+//   - 'statement' cannot return a value.

+//   - You cannot stream a failure message to this macro.

+//

+// Note that even though the implementations of the following two

+// macros are much alike, we cannot refactor them to use a common

+// helper macro, due to some peculiarity in how the preprocessor

+// works.  The AcceptsMacroThatExpandsToUnprotectedComma test in

+// gtest_unittest.cc will fail to compile if we do that.

+#define EXPECT_FATAL_FAILURE(statement, substr) \

+  do { \

+    class GTestExpectFatalFailureHelper {\

+     public:\

+      static void Execute() { statement; }\

+    };\

+    ::testing::TestPartResultArray gtest_failures;\

+    ::testing::internal::SingleFailureChecker gtest_checker(\

+        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\

+    {\

+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\

+          ::testing::ScopedFakeTestPartResultReporter:: \

+          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\

+      GTestExpectFatalFailureHelper::Execute();\

+    }\

+  } while (::testing::internal::AlwaysFalse())

+

+#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \

+  do { \

+    class GTestExpectFatalFailureHelper {\

+     public:\

+      static void Execute() { statement; }\

+    };\

+    ::testing::TestPartResultArray gtest_failures;\

+    ::testing::internal::SingleFailureChecker gtest_checker(\

+        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\

+    {\

+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\

+          ::testing::ScopedFakeTestPartResultReporter:: \

+          INTERCEPT_ALL_THREADS, &gtest_failures);\

+      GTestExpectFatalFailureHelper::Execute();\

+    }\

+  } while (::testing::internal::AlwaysFalse())

+

+// A macro for testing Google Test assertions or code that's expected to

+// generate Google Test non-fatal failures.  It asserts that the given

+// statement will cause exactly one non-fatal Google Test failure with 'substr'

+// being part of the failure message.

+//

+// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only

+// affects and considers failures generated in the current thread and

+// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.

+//

+// 'statement' is allowed to reference local variables and members of

+// the current object.

+//

+// The verification of the assertion is done correctly even when the statement

+// throws an exception or aborts the current function.

+//

+// Known restrictions:

+//   - You cannot stream a failure message to this macro.

+//

+// Note that even though the implementations of the following two

+// macros are much alike, we cannot refactor them to use a common

+// helper macro, due to some peculiarity in how the preprocessor

+// works.  If we do that, the code won't compile when the user gives

+// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that

+// expands to code containing an unprotected comma.  The

+// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc

+// catches that.

+//

+// For the same reason, we have to write

+//   if (::testing::internal::AlwaysTrue()) { statement; }

+// instead of

+//   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)

+// to avoid an MSVC warning on unreachable code.

+#define EXPECT_NONFATAL_FAILURE(statement, substr) \

+  do {\

+    ::testing::TestPartResultArray gtest_failures;\

+    ::testing::internal::SingleFailureChecker gtest_checker(\

+        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \

+        (substr));\

+    {\

+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\

+          ::testing::ScopedFakeTestPartResultReporter:: \

+          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\

+      if (::testing::internal::AlwaysTrue()) { statement; }\

+    }\

+  } while (::testing::internal::AlwaysFalse())

+

+#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \

+  do {\

+    ::testing::TestPartResultArray gtest_failures;\

+    ::testing::internal::SingleFailureChecker gtest_checker(\

+        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \

+        (substr));\

+    {\

+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\

+          ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \

+          &gtest_failures);\

+      if (::testing::internal::AlwaysTrue()) { statement; }\

+    }\

+  } while (::testing::internal::AlwaysFalse())

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_SPI_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-test-part.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-test-part.h
new file mode 100644
index 0000000..5a1828d
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-test-part.h
@@ -0,0 +1,179 @@
+// 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: mheule@google.com (Markus Heule)

+//

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_

+#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_

+

+#include <iosfwd>

+#include <vector>

+#include "gtest/internal/gtest-internal.h"

+#include "gtest/internal/gtest-string.h"

+

+namespace testing {

+

+// A copyable object representing the result of a test part (i.e. an

+// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).

+//

+// Don't inherit from TestPartResult as its destructor is not virtual.

+class GTEST_API_ TestPartResult {

+ public:

+  // The possible outcomes of a test part (i.e. an assertion or an

+  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).

+  enum Type {

+    kSuccess,          // Succeeded.

+    kNonFatalFailure,  // Failed but the test can continue.

+    kFatalFailure      // Failed and the test should be terminated.

+  };

+

+  // C'tor.  TestPartResult does NOT have a default constructor.

+  // Always use this constructor (with parameters) to create a

+  // TestPartResult object.

+  TestPartResult(Type a_type,

+                 const char* a_file_name,

+                 int a_line_number,

+                 const char* a_message)

+      : type_(a_type),

+        file_name_(a_file_name == NULL ? "" : a_file_name),

+        line_number_(a_line_number),

+        summary_(ExtractSummary(a_message)),

+        message_(a_message) {

+  }

+

+  // Gets the outcome of the test part.

+  Type type() const { return type_; }

+

+  // Gets the name of the source file where the test part took place, or

+  // NULL if it's unknown.

+  const char* file_name() const {

+    return file_name_.empty() ? NULL : file_name_.c_str();

+  }

+

+  // Gets the line in the source file where the test part took place,

+  // or -1 if it's unknown.

+  int line_number() const { return line_number_; }

+

+  // Gets the summary of the failure message.

+  const char* summary() const { return summary_.c_str(); }

+

+  // Gets the message associated with the test part.

+  const char* message() const { return message_.c_str(); }

+

+  // Returns true iff the test part passed.

+  bool passed() const { return type_ == kSuccess; }

+

+  // Returns true iff the test part failed.

+  bool failed() const { return type_ != kSuccess; }

+

+  // Returns true iff the test part non-fatally failed.

+  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }

+

+  // Returns true iff the test part fatally failed.

+  bool fatally_failed() const { return type_ == kFatalFailure; }

+

+ private:

+  Type type_;

+

+  // Gets the summary of the failure message by omitting the stack

+  // trace in it.

+  static std::string ExtractSummary(const char* message);

+

+  // The name of the source file where the test part took place, or

+  // "" if the source file is unknown.

+  std::string file_name_;

+  // The line in the source file where the test part took place, or -1

+  // if the line number is unknown.

+  int line_number_;

+  std::string summary_;  // The test failure summary.

+  std::string message_;  // The test failure message.

+};

+

+// Prints a TestPartResult object.

+std::ostream& operator<<(std::ostream& os, const TestPartResult& result);

+

+// An array of TestPartResult objects.

+//

+// Don't inherit from TestPartResultArray as its destructor is not

+// virtual.

+class GTEST_API_ TestPartResultArray {

+ public:

+  TestPartResultArray() {}

+

+  // Appends the given TestPartResult to the array.

+  void Append(const TestPartResult& result);

+

+  // Returns the TestPartResult at the given index (0-based).

+  const TestPartResult& GetTestPartResult(int index) const;

+

+  // Returns the number of TestPartResult objects in the array.

+  int size() const;

+

+ private:

+  std::vector<TestPartResult> array_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);

+};

+

+// This interface knows how to report a test part result.

+class TestPartResultReporterInterface {

+ public:

+  virtual ~TestPartResultReporterInterface() {}

+

+  virtual void ReportTestPartResult(const TestPartResult& result) = 0;

+};

+

+namespace internal {

+

+// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a

+// statement generates new fatal failures. To do so it registers itself as the

+// current test part result reporter. Besides checking if fatal failures were

+// reported, it only delegates the reporting to the former result reporter.

+// The original result reporter is restored in the destructor.

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+class GTEST_API_ HasNewFatalFailureHelper

+    : public TestPartResultReporterInterface {

+ public:

+  HasNewFatalFailureHelper();

+  virtual ~HasNewFatalFailureHelper();

+  virtual void ReportTestPartResult(const TestPartResult& result);

+  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }

+ private:

+  bool has_new_fatal_failure_;

+  TestPartResultReporterInterface* original_reporter_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);

+};

+

+}  // namespace internal

+

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-typed-test.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-typed-test.h
new file mode 100644
index 0000000..a5183de
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest-typed-test.h
@@ -0,0 +1,259 @@
+// 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: wan@google.com (Zhanyong Wan)

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_

+#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_

+

+// This header implements typed tests and type-parameterized tests.

+

+// Typed (aka type-driven) tests repeat the same test for types in a

+// list.  You must know which types you want to test with when writing

+// typed tests. Here's how you do it:

+

+#if 0

+

+// First, define a fixture class template.  It should be parameterized

+// by a type.  Remember to derive it from testing::Test.

+template <typename T>

+class FooTest : public testing::Test {

+ public:

+  ...

+  typedef std::list<T> List;

+  static T shared_;

+  T value_;

+};

+

+// Next, associate a list of types with the test case, which will be

+// repeated for each type in the list.  The typedef is necessary for

+// the macro to parse correctly.

+typedef testing::Types<char, int, unsigned int> MyTypes;

+TYPED_TEST_CASE(FooTest, MyTypes);

+

+// If the type list contains only one type, you can write that type

+// directly without Types<...>:

+//   TYPED_TEST_CASE(FooTest, int);

+

+// Then, use TYPED_TEST() instead of TEST_F() to define as many typed

+// tests for this test case as you want.

+TYPED_TEST(FooTest, DoesBlah) {

+  // Inside a test, refer to TypeParam to get the type parameter.

+  // Since we are inside a derived class template, C++ requires use to

+  // visit the members of FooTest via 'this'.

+  TypeParam n = this->value_;

+

+  // To visit static members of the fixture, add the TestFixture::

+  // prefix.

+  n += TestFixture::shared_;

+

+  // To refer to typedefs in the fixture, add the "typename

+  // TestFixture::" prefix.

+  typename TestFixture::List values;

+  values.push_back(n);

+  ...

+}

+

+TYPED_TEST(FooTest, HasPropertyA) { ... }

+

+#endif  // 0

+

+// Type-parameterized tests are abstract test patterns parameterized

+// by a type.  Compared with typed tests, type-parameterized tests

+// allow you to define the test pattern without knowing what the type

+// parameters are.  The defined pattern can be instantiated with

+// different types any number of times, in any number of translation

+// units.

+//

+// If you are designing an interface or concept, you can define a

+// suite of type-parameterized tests to verify properties that any

+// valid implementation of the interface/concept should have.  Then,

+// each implementation can easily instantiate the test suite to verify

+// that it conforms to the requirements, without having to write

+// similar tests repeatedly.  Here's an example:

+

+#if 0

+

+// First, define a fixture class template.  It should be parameterized

+// by a type.  Remember to derive it from testing::Test.

+template <typename T>

+class FooTest : public testing::Test {

+  ...

+};

+

+// Next, declare that you will define a type-parameterized test case

+// (the _P suffix is for "parameterized" or "pattern", whichever you

+// prefer):

+TYPED_TEST_CASE_P(FooTest);

+

+// Then, use TYPED_TEST_P() to define as many type-parameterized tests

+// for this type-parameterized test case as you want.

+TYPED_TEST_P(FooTest, DoesBlah) {

+  // Inside a test, refer to TypeParam to get the type parameter.

+  TypeParam n = 0;

+  ...

+}

+

+TYPED_TEST_P(FooTest, HasPropertyA) { ... }

+

+// Now the tricky part: you need to register all test patterns before

+// you can instantiate them.  The first argument of the macro is the

+// test case name; the rest are the names of the tests in this test

+// case.

+REGISTER_TYPED_TEST_CASE_P(FooTest,

+                           DoesBlah, HasPropertyA);

+

+// Finally, you are free to instantiate the pattern with the types you

+// want.  If you put the above code in a header file, you can #include

+// it in multiple C++ source files and instantiate it multiple times.

+//

+// To distinguish different instances of the pattern, the first

+// argument to the INSTANTIATE_* macro is a prefix that will be added

+// to the actual test case name.  Remember to pick unique prefixes for

+// different instances.

+typedef testing::Types<char, int, unsigned int> MyTypes;

+INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);

+

+// If the type list contains only one type, you can write that type

+// directly without Types<...>:

+//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);

+

+#endif  // 0

+

+#include "gtest/internal/gtest-port.h"

+#include "gtest/internal/gtest-type-util.h"

+

+// Implements typed tests.

+

+#if GTEST_HAS_TYPED_TEST

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Expands to the name of the typedef for the type parameters of the

+// given test case.

+# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_

+

+// The 'Types' template argument below must have spaces around it

+// since some compilers may choke on '>>' when passing a template

+// instance (e.g. Types<int>)

+# define TYPED_TEST_CASE(CaseName, Types) \

+  typedef ::testing::internal::TypeList< Types >::type \

+      GTEST_TYPE_PARAMS_(CaseName)

+

+# define TYPED_TEST(CaseName, TestName) \

+  template <typename gtest_TypeParam_> \

+  class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \

+      : public CaseName<gtest_TypeParam_> { \

+   private: \

+    typedef CaseName<gtest_TypeParam_> TestFixture; \

+    typedef gtest_TypeParam_ TypeParam; \

+    virtual void TestBody(); \

+  }; \

+  bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \

+      ::testing::internal::TypeParameterizedTest< \

+          CaseName, \

+          ::testing::internal::TemplateSel< \

+              GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \

+          GTEST_TYPE_PARAMS_(CaseName)>::Register(\

+              "", #CaseName, #TestName, 0); \

+  template <typename gtest_TypeParam_> \

+  void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()

+

+#endif  // GTEST_HAS_TYPED_TEST

+

+// Implements type-parameterized tests.

+

+#if GTEST_HAS_TYPED_TEST_P

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Expands to the namespace name that the type-parameterized tests for

+// the given type-parameterized test case are defined in.  The exact

+// name of the namespace is subject to change without notice.

+# define GTEST_CASE_NAMESPACE_(TestCaseName) \

+  gtest_case_##TestCaseName##_

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Expands to the name of the variable used to remember the names of

+// the defined tests in the given test case.

+# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \

+  gtest_typed_test_case_p_state_##TestCaseName##_

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.

+//

+// Expands to the name of the variable used to remember the names of

+// the registered tests in the given test case.

+# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \

+  gtest_registered_test_names_##TestCaseName##_

+

+// The variables defined in the type-parameterized test macros are

+// static as typically these macros are used in a .h file that can be

+// #included in multiple translation units linked together.

+# define TYPED_TEST_CASE_P(CaseName) \

+  static ::testing::internal::TypedTestCasePState \

+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)

+

+# define TYPED_TEST_P(CaseName, TestName) \

+  namespace GTEST_CASE_NAMESPACE_(CaseName) { \

+  template <typename gtest_TypeParam_> \

+  class TestName : public CaseName<gtest_TypeParam_> { \

+   private: \

+    typedef CaseName<gtest_TypeParam_> TestFixture; \

+    typedef gtest_TypeParam_ TypeParam; \

+    virtual void TestBody(); \

+  }; \

+  static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \

+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\

+          __FILE__, __LINE__, #CaseName, #TestName); \

+  } \

+  template <typename gtest_TypeParam_> \

+  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()

+

+# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \

+  namespace GTEST_CASE_NAMESPACE_(CaseName) { \

+  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \

+  } \

+  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \

+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\

+          __FILE__, __LINE__, #__VA_ARGS__)

+

+// The 'Types' template argument below must have spaces around it

+// since some compilers may choke on '>>' when passing a template

+// instance (e.g. Types<int>)

+# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \

+  bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \

+      ::testing::internal::TypeParameterizedTestCase<CaseName, \

+          GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \

+          ::testing::internal::TypeList< Types >::type>::Register(\

+              #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))

+

+#endif  // GTEST_HAS_TYPED_TEST_P

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest.h
new file mode 100644
index 0000000..a5ccbae
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest.h
@@ -0,0 +1,2291 @@
+// Copyright 2005, 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)

+//

+// The Google C++ Testing Framework (Google Test)

+//

+// This header file defines the public API for Google Test.  It should be

+// included by any test program that uses Google Test.

+//

+// IMPORTANT NOTE: Due to limitation of the C++ language, we have to

+// leave some internal implementation details in this header file.

+// They are clearly marked by comments like this:

+//

+//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+//

+// Such code is NOT meant to be used by a user directly, and is subject

+// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user

+// program!

+//

+// Acknowledgment: Google Test borrowed the idea of automatic test

+// registration from Barthelemy Dagenais' (barthelemy@prologique.com)

+// easyUnit framework.

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_H_

+#define GTEST_INCLUDE_GTEST_GTEST_H_

+

+#include <limits>

+#include <ostream>

+#include <vector>

+

+#include "gtest/internal/gtest-internal.h"

+#include "gtest/internal/gtest-string.h"

+#include "gtest/gtest-death-test.h"

+#include "gtest/gtest-message.h"

+#include "gtest/gtest-param-test.h"

+#include "gtest/gtest-printers.h"

+#include "gtest/gtest_prod.h"

+#include "gtest/gtest-test-part.h"

+#include "gtest/gtest-typed-test.h"

+

+// Depending on the platform, different string classes are available.

+// On Linux, in addition to ::std::string, Google also makes use of

+// class ::string, which has the same interface as ::std::string, but

+// has a different implementation.

+//

+// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that

+// ::string is available AND is a distinct type to ::std::string, or

+// define it to 0 to indicate otherwise.

+//

+// If the user's ::std::string and ::string are the same class due to

+// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.

+//

+// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined

+// heuristically.

+

+namespace testing {

+

+// Declares the flags.

+

+// This flag temporary enables the disabled tests.

+GTEST_DECLARE_bool_(also_run_disabled_tests);

+

+// This flag brings the debugger on an assertion failure.

+GTEST_DECLARE_bool_(break_on_failure);

+

+// This flag controls whether Google Test catches all test-thrown exceptions

+// and logs them as failures.

+GTEST_DECLARE_bool_(catch_exceptions);

+

+// This flag enables using colors in terminal output. Available values are

+// "yes" to enable colors, "no" (disable colors), or "auto" (the default)

+// to let Google Test decide.

+GTEST_DECLARE_string_(color);

+

+// This flag sets up the filter to select by name using a glob pattern

+// the tests to run. If the filter is not given all tests are executed.

+GTEST_DECLARE_string_(filter);

+

+// This flag causes the Google Test to list tests. None of the tests listed

+// are actually run if the flag is provided.

+GTEST_DECLARE_bool_(list_tests);

+

+// This flag controls whether Google Test emits a detailed XML report to a file

+// in addition to its normal textual output.

+GTEST_DECLARE_string_(output);

+

+// This flags control whether Google Test prints the elapsed time for each

+// test.

+GTEST_DECLARE_bool_(print_time);

+

+// This flag specifies the random number seed.

+GTEST_DECLARE_int32_(random_seed);

+

+// This flag sets how many times the tests are repeated. The default value

+// is 1. If the value is -1 the tests are repeating forever.

+GTEST_DECLARE_int32_(repeat);

+

+// This flag controls whether Google Test includes Google Test internal

+// stack frames in failure stack traces.

+GTEST_DECLARE_bool_(show_internal_stack_frames);

+

+// When this flag is specified, tests' order is randomized on every iteration.

+GTEST_DECLARE_bool_(shuffle);

+

+// This flag specifies the maximum number of stack frames to be

+// printed in a failure message.

+GTEST_DECLARE_int32_(stack_trace_depth);

+

+// When this flag is specified, a failed assertion will throw an

+// exception if exceptions are enabled, or exit the program with a

+// non-zero code otherwise.

+GTEST_DECLARE_bool_(throw_on_failure);

+

+// When this flag is set with a "host:port" string, on supported

+// platforms test results are streamed to the specified port on

+// the specified host machine.

+GTEST_DECLARE_string_(stream_result_to);

+

+// The upper limit for valid stack trace depths.

+const int kMaxStackTraceDepth = 100;

+

+namespace internal {

+

+class AssertHelper;

+class DefaultGlobalTestPartResultReporter;

+class ExecDeathTest;

+class NoExecDeathTest;

+class FinalSuccessChecker;

+class GTestFlagSaver;

+class StreamingListenerTest;

+class TestResultAccessor;

+class TestEventListenersAccessor;

+class TestEventRepeater;

+class UnitTestRecordPropertyTestHelper;

+class WindowsDeathTest;

+class UnitTestImpl* GetUnitTestImpl();

+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,

+                                    const std::string& message);

+

+}  // namespace internal

+

+// The friend relationship of some of these classes is cyclic.

+// If we don't forward declare them the compiler might confuse the classes

+// in friendship clauses with same named classes on the scope.

+class Test;

+class TestCase;

+class TestInfo;

+class UnitTest;

+

+// A class for indicating whether an assertion was successful.  When

+// the assertion wasn't successful, the AssertionResult object

+// remembers a non-empty message that describes how it failed.

+//

+// To create an instance of this class, use one of the factory functions

+// (AssertionSuccess() and AssertionFailure()).

+//

+// This class is useful for two purposes:

+//   1. Defining predicate functions to be used with Boolean test assertions

+//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts

+//   2. Defining predicate-format functions to be

+//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).

+//

+// For example, if you define IsEven predicate:

+//

+//   testing::AssertionResult IsEven(int n) {

+//     if ((n % 2) == 0)

+//       return testing::AssertionSuccess();

+//     else

+//       return testing::AssertionFailure() << n << " is odd";

+//   }

+//

+// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))

+// will print the message

+//

+//   Value of: IsEven(Fib(5))

+//     Actual: false (5 is odd)

+//   Expected: true

+//

+// instead of a more opaque

+//

+//   Value of: IsEven(Fib(5))

+//     Actual: false

+//   Expected: true

+//

+// in case IsEven is a simple Boolean predicate.

+//

+// If you expect your predicate to be reused and want to support informative

+// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up

+// about half as often as positive ones in our tests), supply messages for

+// both success and failure cases:

+//

+//   testing::AssertionResult IsEven(int n) {

+//     if ((n % 2) == 0)

+//       return testing::AssertionSuccess() << n << " is even";

+//     else

+//       return testing::AssertionFailure() << n << " is odd";

+//   }

+//

+// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print

+//

+//   Value of: IsEven(Fib(6))

+//     Actual: true (8 is even)

+//   Expected: false

+//

+// NB: Predicates that support negative Boolean assertions have reduced

+// performance in positive ones so be careful not to use them in tests

+// that have lots (tens of thousands) of positive Boolean assertions.

+//

+// To use this class with EXPECT_PRED_FORMAT assertions such as:

+//

+//   // Verifies that Foo() returns an even number.

+//   EXPECT_PRED_FORMAT1(IsEven, Foo());

+//

+// you need to define:

+//

+//   testing::AssertionResult IsEven(const char* expr, int n) {

+//     if ((n % 2) == 0)

+//       return testing::AssertionSuccess();

+//     else

+//       return testing::AssertionFailure()

+//         << "Expected: " << expr << " is even\n  Actual: it's " << n;

+//   }

+//

+// If Foo() returns 5, you will see the following message:

+//

+//   Expected: Foo() is even

+//     Actual: it's 5

+//

+class GTEST_API_ AssertionResult {

+ public:

+  // Copy constructor.

+  // Used in EXPECT_TRUE/FALSE(assertion_result).

+  AssertionResult(const AssertionResult& other);

+  // Used in the EXPECT_TRUE/FALSE(bool_expression).

+  explicit AssertionResult(bool success) : success_(success) {}

+

+  // Returns true iff the assertion succeeded.

+  operator bool() const { return success_; }  // NOLINT

+

+  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.

+  AssertionResult operator!() const;

+

+  // Returns the text streamed into this AssertionResult. Test assertions

+  // use it when they fail (i.e., the predicate's outcome doesn't match the

+  // assertion's expectation). When nothing has been streamed into the

+  // object, returns an empty string.

+  const char* message() const {

+    return message_.get() != NULL ?  message_->c_str() : "";

+  }

+  // TODO(vladl@google.com): Remove this after making sure no clients use it.

+  // Deprecated; please use message() instead.

+  const char* failure_message() const { return message(); }

+

+  // Streams a custom failure message into this object.

+  template <typename T> AssertionResult& operator<<(const T& value) {

+    AppendMessage(Message() << value);

+    return *this;

+  }

+

+  // Allows streaming basic output manipulators such as endl or flush into

+  // this object.

+  AssertionResult& operator<<(

+      ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {

+    AppendMessage(Message() << basic_manipulator);

+    return *this;

+  }

+

+ private:

+  // Appends the contents of message to message_.

+  void AppendMessage(const Message& a_message) {

+    if (message_.get() == NULL)

+      message_.reset(new ::std::string);

+    message_->append(a_message.GetString().c_str());

+  }

+

+  // Stores result of the assertion predicate.

+  bool success_;

+  // Stores the message describing the condition in case the expectation

+  // construct is not satisfied with the predicate's outcome.

+  // Referenced via a pointer to avoid taking too much stack frame space

+  // with test assertions.

+  internal::scoped_ptr< ::std::string> message_;

+

+  GTEST_DISALLOW_ASSIGN_(AssertionResult);

+};

+

+// Makes a successful assertion result.

+GTEST_API_ AssertionResult AssertionSuccess();

+

+// Makes a failed assertion result.

+GTEST_API_ AssertionResult AssertionFailure();

+

+// Makes a failed assertion result with the given failure message.

+// Deprecated; use AssertionFailure() << msg.

+GTEST_API_ AssertionResult AssertionFailure(const Message& msg);

+

+// The abstract class that all tests inherit from.

+//

+// In Google Test, a unit test program contains one or many TestCases, and

+// each TestCase contains one or many Tests.

+//

+// When you define a test using the TEST macro, you don't need to

+// explicitly derive from Test - the TEST macro automatically does

+// this for you.

+//

+// The only time you derive from Test is when defining a test fixture

+// to be used a TEST_F.  For example:

+//

+//   class FooTest : public testing::Test {

+//    protected:

+//     virtual void SetUp() { ... }

+//     virtual void TearDown() { ... }

+//     ...

+//   };

+//

+//   TEST_F(FooTest, Bar) { ... }

+//   TEST_F(FooTest, Baz) { ... }

+//

+// Test is not copyable.

+class GTEST_API_ Test {

+ public:

+  friend class TestInfo;

+

+  // Defines types for pointers to functions that set up and tear down

+  // a test case.

+  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;

+  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;

+

+  // The d'tor is virtual as we intend to inherit from Test.

+  virtual ~Test();

+

+  // Sets up the stuff shared by all tests in this test case.

+  //

+  // Google Test will call Foo::SetUpTestCase() before running the first

+  // test in test case Foo.  Hence a sub-class can define its own

+  // SetUpTestCase() method to shadow the one defined in the super

+  // class.

+  static void SetUpTestCase() {}

+

+  // Tears down the stuff shared by all tests in this test case.

+  //

+  // Google Test will call Foo::TearDownTestCase() after running the last

+  // test in test case Foo.  Hence a sub-class can define its own

+  // TearDownTestCase() method to shadow the one defined in the super

+  // class.

+  static void TearDownTestCase() {}

+

+  // Returns true iff the current test has a fatal failure.

+  static bool HasFatalFailure();

+

+  // Returns true iff the current test has a non-fatal failure.

+  static bool HasNonfatalFailure();

+

+  // Returns true iff the current test has a (either fatal or

+  // non-fatal) failure.

+  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }

+

+  // Logs a property for the current test, test case, or for the entire

+  // invocation of the test program when used outside of the context of a

+  // test case.  Only the last value for a given key is remembered.  These

+  // are public static so they can be called from utility functions that are

+  // not members of the test fixture.  Calls to RecordProperty made during

+  // lifespan of the test (from the moment its constructor starts to the

+  // moment its destructor finishes) will be output in XML as attributes of

+  // the <testcase> element.  Properties recorded from fixture's

+  // SetUpTestCase or TearDownTestCase are logged as attributes of the

+  // corresponding <testsuite> element.  Calls to RecordProperty made in the

+  // global context (before or after invocation of RUN_ALL_TESTS and from

+  // SetUp/TearDown method of Environment objects registered with Google

+  // Test) will be output as attributes of the <testsuites> element.

+  static void RecordProperty(const std::string& key, const std::string& value);

+  static void RecordProperty(const std::string& key, int value);

+

+ protected:

+  // Creates a Test object.

+  Test();

+

+  // Sets up the test fixture.

+  virtual void SetUp();

+

+  // Tears down the test fixture.

+  virtual void TearDown();

+

+ private:

+  // Returns true iff the current test has the same fixture class as

+  // the first test in the current test case.

+  static bool HasSameFixtureClass();

+

+  // Runs the test after the test fixture has been set up.

+  //

+  // A sub-class must implement this to define the test logic.

+  //

+  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.

+  // Instead, use the TEST or TEST_F macro.

+  virtual void TestBody() = 0;

+

+  // Sets up, executes, and tears down the test.

+  void Run();

+

+  // Deletes self.  We deliberately pick an unusual name for this

+  // internal method to avoid clashing with names used in user TESTs.

+  void DeleteSelf_() { delete this; }

+

+  // Uses a GTestFlagSaver to save and restore all Google Test flags.

+  const internal::GTestFlagSaver* const gtest_flag_saver_;

+

+  // Often a user mis-spells SetUp() as Setup() and spends a long time

+  // wondering why it is never called by Google Test.  The declaration of

+  // the following method is solely for catching such an error at

+  // compile time:

+  //

+  //   - The return type is deliberately chosen to be not void, so it

+  //   will be a conflict if a user declares void Setup() in his test

+  //   fixture.

+  //

+  //   - This method is private, so it will be another compiler error

+  //   if a user calls it from his test fixture.

+  //

+  // DO NOT OVERRIDE THIS FUNCTION.

+  //

+  // If you see an error about overriding the following function or

+  // about it being private, you have mis-spelled SetUp() as Setup().

+  struct Setup_should_be_spelled_SetUp {};

+  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }

+

+  // We disallow copying Tests.

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);

+};

+

+typedef internal::TimeInMillis TimeInMillis;

+

+// A copyable object representing a user specified test property which can be

+// output as a key/value string pair.

+//

+// Don't inherit from TestProperty as its destructor is not virtual.

+class TestProperty {

+ public:

+  // C'tor.  TestProperty does NOT have a default constructor.

+  // Always use this constructor (with parameters) to create a

+  // TestProperty object.

+  TestProperty(const std::string& a_key, const std::string& a_value) :

+    key_(a_key), value_(a_value) {

+  }

+

+  // Gets the user supplied key.

+  const char* key() const {

+    return key_.c_str();

+  }

+

+  // Gets the user supplied value.

+  const char* value() const {

+    return value_.c_str();

+  }

+

+  // Sets a new value, overriding the one supplied in the constructor.

+  void SetValue(const std::string& new_value) {

+    value_ = new_value;

+  }

+

+ private:

+  // The key supplied by the user.

+  std::string key_;

+  // The value supplied by the user.

+  std::string value_;

+};

+

+// The result of a single Test.  This includes a list of

+// TestPartResults, a list of TestProperties, a count of how many

+// death tests there are in the Test, and how much time it took to run

+// the Test.

+//

+// TestResult is not copyable.

+class GTEST_API_ TestResult {

+ public:

+  // Creates an empty TestResult.

+  TestResult();

+

+  // D'tor.  Do not inherit from TestResult.

+  ~TestResult();

+

+  // Gets the number of all test parts.  This is the sum of the number

+  // of successful test parts and the number of failed test parts.

+  int total_part_count() const;

+

+  // Returns the number of the test properties.

+  int test_property_count() const;

+

+  // Returns true iff the test passed (i.e. no test part failed).

+  bool Passed() const { return !Failed(); }

+

+  // Returns true iff the test failed.

+  bool Failed() const;

+

+  // Returns true iff the test fatally failed.

+  bool HasFatalFailure() const;

+

+  // Returns true iff the test has a non-fatal failure.

+  bool HasNonfatalFailure() const;

+

+  // Returns the elapsed time, in milliseconds.

+  TimeInMillis elapsed_time() const { return elapsed_time_; }

+

+  // Returns the i-th test part result among all the results. i can range

+  // from 0 to test_property_count() - 1. If i is not in that range, aborts

+  // the program.

+  const TestPartResult& GetTestPartResult(int i) const;

+

+  // Returns the i-th test property. i can range from 0 to

+  // test_property_count() - 1. If i is not in that range, aborts the

+  // program.

+  const TestProperty& GetTestProperty(int i) const;

+

+ private:

+  friend class TestInfo;

+  friend class TestCase;

+  friend class UnitTest;

+  friend class internal::DefaultGlobalTestPartResultReporter;

+  friend class internal::ExecDeathTest;

+  friend class internal::TestResultAccessor;

+  friend class internal::UnitTestImpl;

+  friend class internal::WindowsDeathTest;

+

+  // Gets the vector of TestPartResults.

+  const std::vector<TestPartResult>& test_part_results() const {

+    return test_part_results_;

+  }

+

+  // Gets the vector of TestProperties.

+  const std::vector<TestProperty>& test_properties() const {

+    return test_properties_;

+  }

+

+  // Sets the elapsed time.

+  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }

+

+  // Adds a test property to the list. The property is validated and may add

+  // a non-fatal failure if invalid (e.g., if it conflicts with reserved

+  // key names). If a property is already recorded for the same key, the

+  // value will be updated, rather than storing multiple values for the same

+  // key.  xml_element specifies the element for which the property is being

+  // recorded and is used for validation.

+  void RecordProperty(const std::string& xml_element,

+                      const TestProperty& test_property);

+

+  // Adds a failure if the key is a reserved attribute of Google Test

+  // testcase tags.  Returns true if the property is valid.

+  // TODO(russr): Validate attribute names are legal and human readable.

+  static bool ValidateTestProperty(const std::string& xml_element,

+                                   const TestProperty& test_property);

+

+  // Adds a test part result to the list.

+  void AddTestPartResult(const TestPartResult& test_part_result);

+

+  // Returns the death test count.

+  int death_test_count() const { return death_test_count_; }

+

+  // Increments the death test count, returning the new count.

+  int increment_death_test_count() { return ++death_test_count_; }

+

+  // Clears the test part results.

+  void ClearTestPartResults();

+

+  // Clears the object.

+  void Clear();

+

+  // Protects mutable state of the property vector and of owned

+  // properties, whose values may be updated.

+  internal::Mutex test_properites_mutex_;

+

+  // The vector of TestPartResults

+  std::vector<TestPartResult> test_part_results_;

+  // The vector of TestProperties

+  std::vector<TestProperty> test_properties_;

+  // Running count of death tests.

+  int death_test_count_;

+  // The elapsed time, in milliseconds.

+  TimeInMillis elapsed_time_;

+

+  // We disallow copying TestResult.

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);

+};  // class TestResult

+

+// A TestInfo object stores the following information about a test:

+//

+//   Test case name

+//   Test name

+//   Whether the test should be run

+//   A function pointer that creates the test object when invoked

+//   Test result

+//

+// The constructor of TestInfo registers itself with the UnitTest

+// singleton such that the RUN_ALL_TESTS() macro knows which tests to

+// run.

+class GTEST_API_ TestInfo {

+ public:

+  // Destructs a TestInfo object.  This function is not virtual, so

+  // don't inherit from TestInfo.

+  ~TestInfo();

+

+  // Returns the test case name.

+  const char* test_case_name() const { return test_case_name_.c_str(); }

+

+  // Returns the test name.

+  const char* name() const { return name_.c_str(); }

+

+  // Returns the name of the parameter type, or NULL if this is not a typed

+  // or a type-parameterized test.

+  const char* type_param() const {

+    if (type_param_.get() != NULL)

+      return type_param_->c_str();

+    return NULL;

+  }

+

+  // Returns the text representation of the value parameter, or NULL if this

+  // is not a value-parameterized test.

+  const char* value_param() const {

+    if (value_param_.get() != NULL)

+      return value_param_->c_str();

+    return NULL;

+  }

+

+  // Returns true if this test should run, that is if the test is not

+  // disabled (or it is disabled but the also_run_disabled_tests flag has

+  // been specified) and its full name matches the user-specified filter.

+  //

+  // Google Test allows the user to filter the tests by their full names.

+  // The full name of a test Bar in test case Foo is defined as

+  // "Foo.Bar".  Only the tests that match the filter will run.

+  //

+  // A filter is a colon-separated list of glob (not regex) patterns,

+  // optionally followed by a '-' and a colon-separated list of

+  // negative patterns (tests to exclude).  A test is run if it

+  // matches one of the positive patterns and does not match any of

+  // the negative patterns.

+  //

+  // For example, *A*:Foo.* is a filter that matches any string that

+  // contains the character 'A' or starts with "Foo.".

+  bool should_run() const { return should_run_; }

+

+  // Returns true iff this test will appear in the XML report.

+  bool is_reportable() const {

+    // For now, the XML report includes all tests matching the filter.

+    // In the future, we may trim tests that are excluded because of

+    // sharding.

+    return matches_filter_;

+  }

+

+  // Returns the result of the test.

+  const TestResult* result() const { return &result_; }

+

+ private:

+#if GTEST_HAS_DEATH_TEST

+  friend class internal::DefaultDeathTestFactory;

+#endif  // GTEST_HAS_DEATH_TEST

+  friend class Test;

+  friend class TestCase;

+  friend class internal::UnitTestImpl;

+  friend class internal::StreamingListenerTest;

+  friend TestInfo* internal::MakeAndRegisterTestInfo(

+      const char* test_case_name,

+      const char* name,

+      const char* type_param,

+      const char* value_param,

+      internal::TypeId fixture_class_id,

+      Test::SetUpTestCaseFunc set_up_tc,

+      Test::TearDownTestCaseFunc tear_down_tc,

+      internal::TestFactoryBase* factory);

+

+  // Constructs a TestInfo object. The newly constructed instance assumes

+  // ownership of the factory object.

+  TestInfo(const std::string& test_case_name,

+           const std::string& name,

+           const char* a_type_param,   // NULL if not a type-parameterized test

+           const char* a_value_param,  // NULL if not a value-parameterized test

+           internal::TypeId fixture_class_id,

+           internal::TestFactoryBase* factory);

+

+  // Increments the number of death tests encountered in this test so

+  // far.

+  int increment_death_test_count() {

+    return result_.increment_death_test_count();

+  }

+

+  // Creates the test object, runs it, records its result, and then

+  // deletes it.

+  void Run();

+

+  static void ClearTestResult(TestInfo* test_info) {

+    test_info->result_.Clear();

+  }

+

+  // These fields are immutable properties of the test.

+  const std::string test_case_name_;     // Test case name

+  const std::string name_;               // Test name

+  // Name of the parameter type, or NULL if this is not a typed or a

+  // type-parameterized test.

+  const internal::scoped_ptr<const ::std::string> type_param_;

+  // Text representation of the value parameter, or NULL if this is not a

+  // value-parameterized test.

+  const internal::scoped_ptr<const ::std::string> value_param_;

+  const internal::TypeId fixture_class_id_;   // ID of the test fixture class

+  bool should_run_;                 // True iff this test should run

+  bool is_disabled_;                // True iff this test is disabled

+  bool matches_filter_;             // True if this test matches the

+                                    // user-specified filter.

+  internal::TestFactoryBase* const factory_;  // The factory that creates

+                                              // the test object

+

+  // This field is mutable and needs to be reset before running the

+  // test for the second time.

+  TestResult result_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);

+};

+

+// A test case, which consists of a vector of TestInfos.

+//

+// TestCase is not copyable.

+class GTEST_API_ TestCase {

+ public:

+  // Creates a TestCase with the given name.

+  //

+  // TestCase does NOT have a default constructor.  Always use this

+  // constructor to create a TestCase object.

+  //

+  // Arguments:

+  //

+  //   name:         name of the test case

+  //   a_type_param: the name of the test's type parameter, or NULL if

+  //                 this is not a type-parameterized test.

+  //   set_up_tc:    pointer to the function that sets up the test case

+  //   tear_down_tc: pointer to the function that tears down the test case

+  TestCase(const char* name, const char* a_type_param,

+           Test::SetUpTestCaseFunc set_up_tc,

+           Test::TearDownTestCaseFunc tear_down_tc);

+

+  // Destructor of TestCase.

+  virtual ~TestCase();

+

+  // Gets the name of the TestCase.

+  const char* name() const { return name_.c_str(); }

+

+  // Returns the name of the parameter type, or NULL if this is not a

+  // type-parameterized test case.

+  const char* type_param() const {

+    if (type_param_.get() != NULL)

+      return type_param_->c_str();

+    return NULL;

+  }

+

+  // Returns true if any test in this test case should run.

+  bool should_run() const { return should_run_; }

+

+  // Gets the number of successful tests in this test case.

+  int successful_test_count() const;

+

+  // Gets the number of failed tests in this test case.

+  int failed_test_count() const;

+

+  // Gets the number of disabled tests that will be reported in the XML report.

+  int reportable_disabled_test_count() const;

+

+  // Gets the number of disabled tests in this test case.

+  int disabled_test_count() const;

+

+  // Gets the number of tests to be printed in the XML report.

+  int reportable_test_count() const;

+

+  // Get the number of tests in this test case that should run.

+  int test_to_run_count() const;

+

+  // Gets the number of all tests in this test case.

+  int total_test_count() const;

+

+  // Returns true iff the test case passed.

+  bool Passed() const { return !Failed(); }

+

+  // Returns true iff the test case failed.

+  bool Failed() const { return failed_test_count() > 0; }

+

+  // Returns the elapsed time, in milliseconds.

+  TimeInMillis elapsed_time() const { return elapsed_time_; }

+

+  // Returns the i-th test among all the tests. i can range from 0 to

+  // total_test_count() - 1. If i is not in that range, returns NULL.

+  const TestInfo* GetTestInfo(int i) const;

+

+  // Returns the TestResult that holds test properties recorded during

+  // execution of SetUpTestCase and TearDownTestCase.

+  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }

+

+ private:

+  friend class Test;

+  friend class internal::UnitTestImpl;

+

+  // Gets the (mutable) vector of TestInfos in this TestCase.

+  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }

+

+  // Gets the (immutable) vector of TestInfos in this TestCase.

+  const std::vector<TestInfo*>& test_info_list() const {

+    return test_info_list_;

+  }

+

+  // Returns the i-th test among all the tests. i can range from 0 to

+  // total_test_count() - 1. If i is not in that range, returns NULL.

+  TestInfo* GetMutableTestInfo(int i);

+

+  // Sets the should_run member.

+  void set_should_run(bool should) { should_run_ = should; }

+

+  // Adds a TestInfo to this test case.  Will delete the TestInfo upon

+  // destruction of the TestCase object.

+  void AddTestInfo(TestInfo * test_info);

+

+  // Clears the results of all tests in this test case.

+  void ClearResult();

+

+  // Clears the results of all tests in the given test case.

+  static void ClearTestCaseResult(TestCase* test_case) {

+    test_case->ClearResult();

+  }

+

+  // Runs every test in this TestCase.

+  void Run();

+

+  // Runs SetUpTestCase() for this TestCase.  This wrapper is needed

+  // for catching exceptions thrown from SetUpTestCase().

+  void RunSetUpTestCase() { (*set_up_tc_)(); }

+

+  // Runs TearDownTestCase() for this TestCase.  This wrapper is

+  // needed for catching exceptions thrown from TearDownTestCase().

+  void RunTearDownTestCase() { (*tear_down_tc_)(); }

+

+  // Returns true iff test passed.

+  static bool TestPassed(const TestInfo* test_info) {

+    return test_info->should_run() && test_info->result()->Passed();

+  }

+

+  // Returns true iff test failed.

+  static bool TestFailed(const TestInfo* test_info) {

+    return test_info->should_run() && test_info->result()->Failed();

+  }

+

+  // Returns true iff the test is disabled and will be reported in the XML

+  // report.

+  static bool TestReportableDisabled(const TestInfo* test_info) {

+    return test_info->is_reportable() && test_info->is_disabled_;

+  }

+

+  // Returns true iff test is disabled.

+  static bool TestDisabled(const TestInfo* test_info) {

+    return test_info->is_disabled_;

+  }

+

+  // Returns true iff this test will appear in the XML report.

+  static bool TestReportable(const TestInfo* test_info) {

+    return test_info->is_reportable();

+  }

+

+  // Returns true if the given test should run.

+  static bool ShouldRunTest(const TestInfo* test_info) {

+    return test_info->should_run();

+  }

+

+  // Shuffles the tests in this test case.

+  void ShuffleTests(internal::Random* random);

+

+  // Restores the test order to before the first shuffle.

+  void UnshuffleTests();

+

+  // Name of the test case.

+  std::string name_;

+  // Name of the parameter type, or NULL if this is not a typed or a

+  // type-parameterized test.

+  const internal::scoped_ptr<const ::std::string> type_param_;

+  // The vector of TestInfos in their original order.  It owns the

+  // elements in the vector.

+  std::vector<TestInfo*> test_info_list_;

+  // Provides a level of indirection for the test list to allow easy

+  // shuffling and restoring the test order.  The i-th element in this

+  // vector is the index of the i-th test in the shuffled test list.

+  std::vector<int> test_indices_;

+  // Pointer to the function that sets up the test case.

+  Test::SetUpTestCaseFunc set_up_tc_;

+  // Pointer to the function that tears down the test case.

+  Test::TearDownTestCaseFunc tear_down_tc_;

+  // True iff any test in this test case should run.

+  bool should_run_;

+  // Elapsed time, in milliseconds.

+  TimeInMillis elapsed_time_;

+  // Holds test properties recorded during execution of SetUpTestCase and

+  // TearDownTestCase.

+  TestResult ad_hoc_test_result_;

+

+  // We disallow copying TestCases.

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);

+};

+

+// An Environment object is capable of setting up and tearing down an

+// environment.  The user should subclass this to define his own

+// environment(s).

+//

+// An Environment object does the set-up and tear-down in virtual

+// methods SetUp() and TearDown() instead of the constructor and the

+// destructor, as:

+//

+//   1. You cannot safely throw from a destructor.  This is a problem

+//      as in some cases Google Test is used where exceptions are enabled, and

+//      we may want to implement ASSERT_* using exceptions where they are

+//      available.

+//   2. You cannot use ASSERT_* directly in a constructor or

+//      destructor.

+class Environment {

+ public:

+  // The d'tor is virtual as we need to subclass Environment.

+  virtual ~Environment() {}

+

+  // Override this to define how to set up the environment.

+  virtual void SetUp() {}

+

+  // Override this to define how to tear down the environment.

+  virtual void TearDown() {}

+ private:

+  // If you see an error about overriding the following function or

+  // about it being private, you have mis-spelled SetUp() as Setup().

+  struct Setup_should_be_spelled_SetUp {};

+  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }

+};

+

+// The interface for tracing execution of tests. The methods are organized in

+// the order the corresponding events are fired.

+class TestEventListener {

+ public:

+  virtual ~TestEventListener() {}

+

+  // Fired before any test activity starts.

+  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;

+

+  // Fired before each iteration of tests starts.  There may be more than

+  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration

+  // index, starting from 0.

+  virtual void OnTestIterationStart(const UnitTest& unit_test,

+                                    int iteration) = 0;

+

+  // Fired before environment set-up for each iteration of tests starts.

+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;

+

+  // Fired after environment set-up for each iteration of tests ends.

+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;

+

+  // Fired before the test case starts.

+  virtual void OnTestCaseStart(const TestCase& test_case) = 0;

+

+  // Fired before the test starts.

+  virtual void OnTestStart(const TestInfo& test_info) = 0;

+

+  // Fired after a failed assertion or a SUCCEED() invocation.

+  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;

+

+  // Fired after the test ends.

+  virtual void OnTestEnd(const TestInfo& test_info) = 0;

+

+  // Fired after the test case ends.

+  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;

+

+  // Fired before environment tear-down for each iteration of tests starts.

+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;

+

+  // Fired after environment tear-down for each iteration of tests ends.

+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;

+

+  // Fired after each iteration of tests finishes.

+  virtual void OnTestIterationEnd(const UnitTest& unit_test,

+                                  int iteration) = 0;

+

+  // Fired after all test activities have ended.

+  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;

+};

+

+// The convenience class for users who need to override just one or two

+// methods and are not concerned that a possible change to a signature of

+// the methods they override will not be caught during the build.  For

+// comments about each method please see the definition of TestEventListener

+// above.

+class EmptyTestEventListener : public TestEventListener {

+ public:

+  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}

+  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,

+                                    int /*iteration*/) {}

+  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}

+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}

+  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}

+  virtual void OnTestStart(const TestInfo& /*test_info*/) {}

+  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}

+  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}

+  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}

+  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}

+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}

+  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,

+                                  int /*iteration*/) {}

+  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}

+};

+

+// TestEventListeners lets users add listeners to track events in Google Test.

+class GTEST_API_ TestEventListeners {

+ public:

+  TestEventListeners();

+  ~TestEventListeners();

+

+  // Appends an event listener to the end of the list. Google Test assumes

+  // the ownership of the listener (i.e. it will delete the listener when

+  // the test program finishes).

+  void Append(TestEventListener* listener);

+

+  // Removes the given event listener from the list and returns it.  It then

+  // becomes the caller's responsibility to delete the listener. Returns

+  // NULL if the listener is not found in the list.

+  TestEventListener* Release(TestEventListener* listener);

+

+  // Returns the standard listener responsible for the default console

+  // output.  Can be removed from the listeners list to shut down default

+  // console output.  Note that removing this object from the listener list

+  // with Release transfers its ownership to the caller and makes this

+  // function return NULL the next time.

+  TestEventListener* default_result_printer() const {

+    return default_result_printer_;

+  }

+

+  // Returns the standard listener responsible for the default XML output

+  // controlled by the --gtest_output=xml flag.  Can be removed from the

+  // listeners list by users who want to shut down the default XML output

+  // controlled by this flag and substitute it with custom one.  Note that

+  // removing this object from the listener list with Release transfers its

+  // ownership to the caller and makes this function return NULL the next

+  // time.

+  TestEventListener* default_xml_generator() const {

+    return default_xml_generator_;

+  }

+

+ private:

+  friend class TestCase;

+  friend class TestInfo;

+  friend class internal::DefaultGlobalTestPartResultReporter;

+  friend class internal::NoExecDeathTest;

+  friend class internal::TestEventListenersAccessor;

+  friend class internal::UnitTestImpl;

+

+  // Returns repeater that broadcasts the TestEventListener events to all

+  // subscribers.

+  TestEventListener* repeater();

+

+  // Sets the default_result_printer attribute to the provided listener.

+  // The listener is also added to the listener list and previous

+  // default_result_printer is removed from it and deleted. The listener can

+  // also be NULL in which case it will not be added to the list. Does

+  // nothing if the previous and the current listener objects are the same.

+  void SetDefaultResultPrinter(TestEventListener* listener);

+

+  // Sets the default_xml_generator attribute to the provided listener.  The

+  // listener is also added to the listener list and previous

+  // default_xml_generator is removed from it and deleted. The listener can

+  // also be NULL in which case it will not be added to the list. Does

+  // nothing if the previous and the current listener objects are the same.

+  void SetDefaultXmlGenerator(TestEventListener* listener);

+

+  // Controls whether events will be forwarded by the repeater to the

+  // listeners in the list.

+  bool EventForwardingEnabled() const;

+  void SuppressEventForwarding();

+

+  // The actual list of listeners.

+  internal::TestEventRepeater* repeater_;

+  // Listener responsible for the standard result output.

+  TestEventListener* default_result_printer_;

+  // Listener responsible for the creation of the XML output file.

+  TestEventListener* default_xml_generator_;

+

+  // We disallow copying TestEventListeners.

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);

+};

+

+// A UnitTest consists of a vector of TestCases.

+//

+// This is a singleton class.  The only instance of UnitTest is

+// created when UnitTest::GetInstance() is first called.  This

+// instance is never deleted.

+//

+// UnitTest is not copyable.

+//

+// This class is thread-safe as long as the methods are called

+// according to their specification.

+class GTEST_API_ UnitTest {

+ public:

+  // Gets the singleton UnitTest object.  The first time this method

+  // is called, a UnitTest object is constructed and returned.

+  // Consecutive calls will return the same object.

+  static UnitTest* GetInstance();

+

+  // Runs all tests in this UnitTest object and prints the result.

+  // Returns 0 if successful, or 1 otherwise.

+  //

+  // This method can only be called from the main thread.

+  //

+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+  int Run() GTEST_MUST_USE_RESULT_;

+

+  // Returns the working directory when the first TEST() or TEST_F()

+  // was executed.  The UnitTest object owns the string.

+  const char* original_working_dir() const;

+

+  // Returns the TestCase object for the test that's currently running,

+  // or NULL if no test is running.

+  const TestCase* current_test_case() const

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  // Returns the TestInfo object for the test that's currently running,

+  // or NULL if no test is running.

+  const TestInfo* current_test_info() const

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  // Returns the random seed used at the start of the current test run.

+  int random_seed() const;

+

+#if GTEST_HAS_PARAM_TEST

+  // Returns the ParameterizedTestCaseRegistry object used to keep track of

+  // value-parameterized tests and instantiate and register them.

+  //

+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+  internal::ParameterizedTestCaseRegistry& parameterized_test_registry()

+      GTEST_LOCK_EXCLUDED_(mutex_);

+#endif  // GTEST_HAS_PARAM_TEST

+

+  // Gets the number of successful test cases.

+  int successful_test_case_count() const;

+

+  // Gets the number of failed test cases.

+  int failed_test_case_count() const;

+

+  // Gets the number of all test cases.

+  int total_test_case_count() const;

+

+  // Gets the number of all test cases that contain at least one test

+  // that should run.

+  int test_case_to_run_count() const;

+

+  // Gets the number of successful tests.

+  int successful_test_count() const;

+

+  // Gets the number of failed tests.

+  int failed_test_count() const;

+

+  // Gets the number of disabled tests that will be reported in the XML report.

+  int reportable_disabled_test_count() const;

+

+  // Gets the number of disabled tests.

+  int disabled_test_count() const;

+

+  // Gets the number of tests to be printed in the XML report.

+  int reportable_test_count() const;

+

+  // Gets the number of all tests.

+  int total_test_count() const;

+

+  // Gets the number of tests that should run.

+  int test_to_run_count() const;

+

+  // Gets the time of the test program start, in ms from the start of the

+  // UNIX epoch.

+  TimeInMillis start_timestamp() const;

+

+  // Gets the elapsed time, in milliseconds.

+  TimeInMillis elapsed_time() const;

+

+  // Returns true iff the unit test passed (i.e. all test cases passed).

+  bool Passed() const;

+

+  // Returns true iff the unit test failed (i.e. some test case failed

+  // or something outside of all tests failed).

+  bool Failed() const;

+

+  // Gets the i-th test case among all the test cases. i can range from 0 to

+  // total_test_case_count() - 1. If i is not in that range, returns NULL.

+  const TestCase* GetTestCase(int i) const;

+

+  // Returns the TestResult containing information on test failures and

+  // properties logged outside of individual test cases.

+  const TestResult& ad_hoc_test_result() const;

+

+  // Returns the list of event listeners that can be used to track events

+  // inside Google Test.

+  TestEventListeners& listeners();

+

+ private:

+  // Registers and returns a global test environment.  When a test

+  // program is run, all global test environments will be set-up in

+  // the order they were registered.  After all tests in the program

+  // have finished, all global test environments will be torn-down in

+  // the *reverse* order they were registered.

+  //

+  // The UnitTest object takes ownership of the given environment.

+  //

+  // This method can only be called from the main thread.

+  Environment* AddEnvironment(Environment* env);

+

+  // Adds a TestPartResult to the current TestResult object.  All

+  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)

+  // eventually call this to report their results.  The user code

+  // should use the assertion macros instead of calling this directly.

+  void AddTestPartResult(TestPartResult::Type result_type,

+                         const char* file_name,

+                         int line_number,

+                         const std::string& message,

+                         const std::string& os_stack_trace)

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  // Adds a TestProperty to the current TestResult object when invoked from

+  // inside a test, to current TestCase's ad_hoc_test_result_ when invoked

+  // from SetUpTestCase or TearDownTestCase, or to the global property set

+  // when invoked elsewhere.  If the result already contains a property with

+  // the same key, the value will be updated.

+  void RecordProperty(const std::string& key, const std::string& value);

+

+  // Gets the i-th test case among all the test cases. i can range from 0 to

+  // total_test_case_count() - 1. If i is not in that range, returns NULL.

+  TestCase* GetMutableTestCase(int i);

+

+  // Accessors for the implementation object.

+  internal::UnitTestImpl* impl() { return impl_; }

+  const internal::UnitTestImpl* impl() const { return impl_; }

+

+  // These classes and funcions are friends as they need to access private

+  // members of UnitTest.

+  friend class Test;

+  friend class internal::AssertHelper;

+  friend class internal::ScopedTrace;

+  friend class internal::StreamingListenerTest;

+  friend class internal::UnitTestRecordPropertyTestHelper;

+  friend Environment* AddGlobalTestEnvironment(Environment* env);

+  friend internal::UnitTestImpl* internal::GetUnitTestImpl();

+  friend void internal::ReportFailureInUnknownLocation(

+      TestPartResult::Type result_type,

+      const std::string& message);

+

+  // Creates an empty UnitTest.

+  UnitTest();

+

+  // D'tor

+  virtual ~UnitTest();

+

+  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread

+  // Google Test trace stack.

+  void PushGTestTrace(const internal::TraceInfo& trace)

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  // Pops a trace from the per-thread Google Test trace stack.

+  void PopGTestTrace()

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  // Protects mutable state in *impl_.  This is mutable as some const

+  // methods need to lock it too.

+  mutable internal::Mutex mutex_;

+

+  // Opaque implementation object.  This field is never changed once

+  // the object is constructed.  We don't mark it as const here, as

+  // doing so will cause a warning in the constructor of UnitTest.

+  // Mutable state in *impl_ is protected by mutex_.

+  internal::UnitTestImpl* impl_;

+

+  // We disallow copying UnitTest.

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);

+};

+

+// A convenient wrapper for adding an environment for the test

+// program.

+//

+// You should call this before RUN_ALL_TESTS() is called, probably in

+// main().  If you use gtest_main, you need to call this before main()

+// starts for it to take effect.  For example, you can define a global

+// variable like this:

+//

+//   testing::Environment* const foo_env =

+//       testing::AddGlobalTestEnvironment(new FooEnvironment);

+//

+// However, we strongly recommend you to write your own main() and

+// call AddGlobalTestEnvironment() there, as relying on initialization

+// of global variables makes the code harder to read and may cause

+// problems when you register multiple environments from different

+// translation units and the environments have dependencies among them

+// (remember that the compiler doesn't guarantee the order in which

+// global variables from different translation units are initialized).

+inline Environment* AddGlobalTestEnvironment(Environment* env) {

+  return UnitTest::GetInstance()->AddEnvironment(env);

+}

+

+// Initializes Google Test.  This must be called before calling

+// RUN_ALL_TESTS().  In particular, it parses a command line for the

+// flags that Google Test recognizes.  Whenever a Google Test flag is

+// seen, it is removed from argv, and *argc is decremented.

+//

+// No value is returned.  Instead, the Google Test flag variables are

+// updated.

+//

+// Calling the function for the second time has no user-visible effect.

+GTEST_API_ void InitGoogleTest(int* argc, char** argv);

+

+// This overloaded version can be used in Windows programs compiled in

+// UNICODE mode.

+GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);

+

+namespace internal {

+

+// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a

+// value of type ToPrint that is an operand of a comparison assertion

+// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in

+// the comparison, and is used to help determine the best way to

+// format the value.  In particular, when the value is a C string

+// (char pointer) and the other operand is an STL string object, we

+// want to format the C string as a string, since we know it is

+// compared by value with the string object.  If the value is a char

+// pointer but the other operand is not an STL string object, we don't

+// know whether the pointer is supposed to point to a NUL-terminated

+// string, and thus want to print it as a pointer to be safe.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+

+// The default case.

+template <typename ToPrint, typename OtherOperand>

+class FormatForComparison {

+ public:

+  static ::std::string Format(const ToPrint& value) {

+    return ::testing::PrintToString(value);

+  }

+};

+

+// Array.

+template <typename ToPrint, size_t N, typename OtherOperand>

+class FormatForComparison<ToPrint[N], OtherOperand> {

+ public:

+  static ::std::string Format(const ToPrint* value) {

+    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);

+  }

+};

+

+// By default, print C string as pointers to be safe, as we don't know

+// whether they actually point to a NUL-terminated string.

+

+#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \

+  template <typename OtherOperand>                                      \

+  class FormatForComparison<CharType*, OtherOperand> {                  \

+   public:                                                              \

+    static ::std::string Format(CharType* value) {                      \

+      return ::testing::PrintToString(static_cast<const void*>(value)); \

+    }                                                                   \

+  }

+

+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);

+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);

+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);

+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);

+

+#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_

+

+// If a C string is compared with an STL string object, we know it's meant

+// to point to a NUL-terminated string, and thus can print it as a string.

+

+#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \

+  template <>                                                           \

+  class FormatForComparison<CharType*, OtherStringType> {               \

+   public:                                                              \

+    static ::std::string Format(CharType* value) {                      \

+      return ::testing::PrintToString(value);                           \

+    }                                                                   \

+  }

+

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);

+

+#if GTEST_HAS_GLOBAL_STRING

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);

+#endif

+

+#if GTEST_HAS_GLOBAL_WSTRING

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);

+#endif

+

+#if GTEST_HAS_STD_WSTRING

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);

+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);

+#endif

+

+#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_

+

+// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)

+// operand to be used in a failure message.  The type (but not value)

+// of the other operand may affect the format.  This allows us to

+// print a char* as a raw pointer when it is compared against another

+// char* or void*, and print it as a C string when it is compared

+// against an std::string object, for example.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+template <typename T1, typename T2>

+std::string FormatForComparisonFailureMessage(

+    const T1& value, const T2& /* other_operand */) {

+  return FormatForComparison<T1, T2>::Format(value);

+}

+

+// The helper function for {ASSERT|EXPECT}_EQ.

+template <typename T1, typename T2>

+AssertionResult CmpHelperEQ(const char* expected_expression,

+                            const char* actual_expression,

+                            const T1& expected,

+                            const T2& actual) {

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4389)  // Temporarily disables warning on

+                                // signed/unsigned mismatch.

+#endif

+

+  if (expected == actual) {

+    return AssertionSuccess();

+  }

+

+#ifdef _MSC_VER

+# pragma warning(pop)          // Restores the warning state.

+#endif

+

+  return EqFailure(expected_expression,

+                   actual_expression,

+                   FormatForComparisonFailureMessage(expected, actual),

+                   FormatForComparisonFailureMessage(actual, expected),

+                   false);

+}

+

+// With this overloaded version, we allow anonymous enums to be used

+// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums

+// can be implicitly cast to BiggestInt.

+GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,

+                                       const char* actual_expression,

+                                       BiggestInt expected,

+                                       BiggestInt actual);

+

+// The helper class for {ASSERT|EXPECT}_EQ.  The template argument

+// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()

+// is a null pointer literal.  The following default implementation is

+// for lhs_is_null_literal being false.

+template <bool lhs_is_null_literal>

+class EqHelper {

+ public:

+  // This templatized version is for the general case.

+  template <typename T1, typename T2>

+  static AssertionResult Compare(const char* expected_expression,

+                                 const char* actual_expression,

+                                 const T1& expected,

+                                 const T2& actual) {

+    return CmpHelperEQ(expected_expression, actual_expression, expected,

+                       actual);

+  }

+

+  // With this overloaded version, we allow anonymous enums to be used

+  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous

+  // enums can be implicitly cast to BiggestInt.

+  //

+  // Even though its body looks the same as the above version, we

+  // cannot merge the two, as it will make anonymous enums unhappy.

+  static AssertionResult Compare(const char* expected_expression,

+                                 const char* actual_expression,

+                                 BiggestInt expected,

+                                 BiggestInt actual) {

+    return CmpHelperEQ(expected_expression, actual_expression, expected,

+                       actual);

+  }

+};

+

+// This specialization is used when the first argument to ASSERT_EQ()

+// is a null pointer literal, like NULL, false, or 0.

+template <>

+class EqHelper<true> {

+ public:

+  // We define two overloaded versions of Compare().  The first

+  // version will be picked when the second argument to ASSERT_EQ() is

+  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or

+  // EXPECT_EQ(false, a_bool).

+  template <typename T1, typename T2>

+  static AssertionResult Compare(

+      const char* expected_expression,

+      const char* actual_expression,

+      const T1& expected,

+      const T2& actual,

+      // The following line prevents this overload from being considered if T2

+      // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)

+      // expands to Compare("", "", NULL, my_ptr), which requires a conversion

+      // to match the Secret* in the other overload, which would otherwise make

+      // this template match better.

+      typename EnableIf<!is_pointer<T2>::value>::type* = 0) {

+    return CmpHelperEQ(expected_expression, actual_expression, expected,

+                       actual);

+  }

+

+  // This version will be picked when the second argument to ASSERT_EQ() is a

+  // pointer, e.g. ASSERT_EQ(NULL, a_pointer).

+  template <typename T>

+  static AssertionResult Compare(

+      const char* expected_expression,

+      const char* actual_expression,

+      // We used to have a second template parameter instead of Secret*.  That

+      // template parameter would deduce to 'long', making this a better match

+      // than the first overload even without the first overload's EnableIf.

+      // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to

+      // non-pointer argument" (even a deduced integral argument), so the old

+      // implementation caused warnings in user code.

+      Secret* /* expected (NULL) */,

+      T* actual) {

+    // We already know that 'expected' is a null pointer.

+    return CmpHelperEQ(expected_expression, actual_expression,

+                       static_cast<T*>(NULL), actual);

+  }

+};

+

+// A macro for implementing the helper functions needed to implement

+// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste

+// of similar code.

+//

+// For each templatized helper function, we also define an overloaded

+// version for BiggestInt in order to reduce code bloat and allow

+// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled

+// with gcc 4.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+#define GTEST_IMPL_CMP_HELPER_(op_name, op)\

+template <typename T1, typename T2>\

+AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \

+                                   const T1& val1, const T2& val2) {\

+  if (val1 op val2) {\

+    return AssertionSuccess();\

+  } else {\

+    return AssertionFailure() \

+        << "Expected: (" << expr1 << ") " #op " (" << expr2\

+        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\

+        << " vs " << FormatForComparisonFailureMessage(val2, val1);\

+  }\

+}\

+GTEST_API_ AssertionResult CmpHelper##op_name(\

+    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+

+// Implements the helper function for {ASSERT|EXPECT}_NE

+GTEST_IMPL_CMP_HELPER_(NE, !=);

+// Implements the helper function for {ASSERT|EXPECT}_LE

+GTEST_IMPL_CMP_HELPER_(LE, <=);

+// Implements the helper function for {ASSERT|EXPECT}_LT

+GTEST_IMPL_CMP_HELPER_(LT, <);

+// Implements the helper function for {ASSERT|EXPECT}_GE

+GTEST_IMPL_CMP_HELPER_(GE, >=);

+// Implements the helper function for {ASSERT|EXPECT}_GT

+GTEST_IMPL_CMP_HELPER_(GT, >);

+

+#undef GTEST_IMPL_CMP_HELPER_

+

+// The helper function for {ASSERT|EXPECT}_STREQ.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,

+                                          const char* actual_expression,

+                                          const char* expected,

+                                          const char* actual);

+

+// The helper function for {ASSERT|EXPECT}_STRCASEEQ.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,

+                                              const char* actual_expression,

+                                              const char* expected,

+                                              const char* actual);

+

+// The helper function for {ASSERT|EXPECT}_STRNE.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,

+                                          const char* s2_expression,

+                                          const char* s1,

+                                          const char* s2);

+

+// The helper function for {ASSERT|EXPECT}_STRCASENE.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,

+                                              const char* s2_expression,

+                                              const char* s1,

+                                              const char* s2);

+

+

+// Helper function for *_STREQ on wide strings.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,

+                                          const char* actual_expression,

+                                          const wchar_t* expected,

+                                          const wchar_t* actual);

+

+// Helper function for *_STRNE on wide strings.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,

+                                          const char* s2_expression,

+                                          const wchar_t* s1,

+                                          const wchar_t* s2);

+

+}  // namespace internal

+

+// IsSubstring() and IsNotSubstring() are intended to be used as the

+// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by

+// themselves.  They check whether needle is a substring of haystack

+// (NULL is considered a substring of itself only), and return an

+// appropriate error message when they fail.

+//

+// The {needle,haystack}_expr arguments are the stringified

+// expressions that generated the two real arguments.

+GTEST_API_ AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const char* needle, const char* haystack);

+GTEST_API_ AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const wchar_t* needle, const wchar_t* haystack);

+GTEST_API_ AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const char* needle, const char* haystack);

+GTEST_API_ AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const wchar_t* needle, const wchar_t* haystack);

+GTEST_API_ AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::string& needle, const ::std::string& haystack);

+GTEST_API_ AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::string& needle, const ::std::string& haystack);

+

+#if GTEST_HAS_STD_WSTRING

+GTEST_API_ AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::wstring& needle, const ::std::wstring& haystack);

+GTEST_API_ AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::wstring& needle, const ::std::wstring& haystack);

+#endif  // GTEST_HAS_STD_WSTRING

+

+namespace internal {

+

+// Helper template function for comparing floating-points.

+//

+// Template parameter:

+//

+//   RawType: the raw floating-point type (either float or double)

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+template <typename RawType>

+AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,

+                                         const char* actual_expression,

+                                         RawType expected,

+                                         RawType actual) {

+  const FloatingPoint<RawType> lhs(expected), rhs(actual);

+

+  if (lhs.AlmostEquals(rhs)) {

+    return AssertionSuccess();

+  }

+

+  ::std::stringstream expected_ss;

+  expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)

+              << expected;

+

+  ::std::stringstream actual_ss;

+  actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)

+            << actual;

+

+  return EqFailure(expected_expression,

+                   actual_expression,

+                   StringStreamToString(&expected_ss),

+                   StringStreamToString(&actual_ss),

+                   false);

+}

+

+// Helper function for implementing ASSERT_NEAR.

+//

+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.

+GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,

+                                                const char* expr2,

+                                                const char* abs_error_expr,

+                                                double val1,

+                                                double val2,

+                                                double abs_error);

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+// A class that enables one to stream messages to assertion macros

+class GTEST_API_ AssertHelper {

+ public:

+  // Constructor.

+  AssertHelper(TestPartResult::Type type,

+               const char* file,

+               int line,

+               const char* message);

+  ~AssertHelper();

+

+  // Message assignment is a semantic trick to enable assertion

+  // streaming; see the GTEST_MESSAGE_ macro below.

+  void operator=(const Message& message) const;

+

+ private:

+  // We put our data in a struct so that the size of the AssertHelper class can

+  // be as small as possible.  This is important because gcc is incapable of

+  // re-using stack space even for temporary variables, so every EXPECT_EQ

+  // reserves stack space for another AssertHelper.

+  struct AssertHelperData {

+    AssertHelperData(TestPartResult::Type t,

+                     const char* srcfile,

+                     int line_num,

+                     const char* msg)

+        : type(t), file(srcfile), line(line_num), message(msg) { }

+

+    TestPartResult::Type const type;

+    const char* const file;

+    int const line;

+    std::string const message;

+

+   private:

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);

+  };

+

+  AssertHelperData* const data_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);

+};

+

+}  // namespace internal

+

+#if GTEST_HAS_PARAM_TEST

+// The pure interface class that all value-parameterized tests inherit from.

+// A value-parameterized class must inherit from both ::testing::Test and

+// ::testing::WithParamInterface. In most cases that just means inheriting

+// from ::testing::TestWithParam, but more complicated test hierarchies

+// may need to inherit from Test and WithParamInterface at different levels.

+//

+// This interface has support for accessing the test parameter value via

+// the GetParam() method.

+//

+// Use it with one of the parameter generator defining functions, like Range(),

+// Values(), ValuesIn(), Bool(), and Combine().

+//

+// class FooTest : public ::testing::TestWithParam<int> {

+//  protected:

+//   FooTest() {

+//     // Can use GetParam() here.

+//   }

+//   virtual ~FooTest() {

+//     // Can use GetParam() here.

+//   }

+//   virtual void SetUp() {

+//     // Can use GetParam() here.

+//   }

+//   virtual void TearDown {

+//     // Can use GetParam() here.

+//   }

+// };

+// TEST_P(FooTest, DoesBar) {

+//   // Can use GetParam() method here.

+//   Foo foo;

+//   ASSERT_TRUE(foo.DoesBar(GetParam()));

+// }

+// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));

+

+template <typename T>

+class WithParamInterface {

+ public:

+  typedef T ParamType;

+  virtual ~WithParamInterface() {}

+

+  // The current parameter value. Is also available in the test fixture's

+  // constructor. This member function is non-static, even though it only

+  // references static data, to reduce the opportunity for incorrect uses

+  // like writing 'WithParamInterface<bool>::GetParam()' for a test that

+  // uses a fixture whose parameter type is int.

+  const ParamType& GetParam() const {

+    GTEST_CHECK_(parameter_ != NULL)

+        << "GetParam() can only be called inside a value-parameterized test "

+        << "-- did you intend to write TEST_P instead of TEST_F?";

+    return *parameter_;

+  }

+

+ private:

+  // Sets parameter value. The caller is responsible for making sure the value

+  // remains alive and unchanged throughout the current test.

+  static void SetParam(const ParamType* parameter) {

+    parameter_ = parameter;

+  }

+

+  // Static value used for accessing parameter during a test lifetime.

+  static const ParamType* parameter_;

+

+  // TestClass must be a subclass of WithParamInterface<T> and Test.

+  template <class TestClass> friend class internal::ParameterizedTestFactory;

+};

+

+template <typename T>

+const T* WithParamInterface<T>::parameter_ = NULL;

+

+// Most value-parameterized classes can ignore the existence of

+// WithParamInterface, and can just inherit from ::testing::TestWithParam.

+

+template <typename T>

+class TestWithParam : public Test, public WithParamInterface<T> {

+};

+

+#endif  // GTEST_HAS_PARAM_TEST

+

+// Macros for indicating success/failure in test code.

+

+// ADD_FAILURE unconditionally adds a failure to the current test.

+// SUCCEED generates a success - it doesn't automatically make the

+// current test successful, as a test is only successful when it has

+// no failure.

+//

+// EXPECT_* verifies that a certain condition is satisfied.  If not,

+// it behaves like ADD_FAILURE.  In particular:

+//

+//   EXPECT_TRUE  verifies that a Boolean condition is true.

+//   EXPECT_FALSE verifies that a Boolean condition is false.

+//

+// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except

+// that they will also abort the current function on failure.  People

+// usually want the fail-fast behavior of FAIL and ASSERT_*, but those

+// writing data-driven tests often find themselves using ADD_FAILURE

+// and EXPECT_* more.

+

+// Generates a nonfatal failure with a generic message.

+#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")

+

+// Generates a nonfatal failure at the given source file location with

+// a generic message.

+#define ADD_FAILURE_AT(file, line) \

+  GTEST_MESSAGE_AT_(file, line, "Failed", \

+                    ::testing::TestPartResult::kNonFatalFailure)

+

+// Generates a fatal failure with a generic message.

+#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")

+

+// Define this macro to 1 to omit the definition of FAIL(), which is a

+// generic name and clashes with some other libraries.

+#if !GTEST_DONT_DEFINE_FAIL

+# define FAIL() GTEST_FAIL()

+#endif

+

+// Generates a success with a generic message.

+#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")

+

+// Define this macro to 1 to omit the definition of SUCCEED(), which

+// is a generic name and clashes with some other libraries.

+#if !GTEST_DONT_DEFINE_SUCCEED

+# define SUCCEED() GTEST_SUCCEED()

+#endif

+

+// Macros for testing exceptions.

+//

+//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):

+//         Tests that the statement throws the expected exception.

+//    * {ASSERT|EXPECT}_NO_THROW(statement):

+//         Tests that the statement doesn't throw any exception.

+//    * {ASSERT|EXPECT}_ANY_THROW(statement):

+//         Tests that the statement throws an exception.

+

+#define EXPECT_THROW(statement, expected_exception) \

+  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_NO_THROW(statement) \

+  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_ANY_THROW(statement) \

+  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)

+#define ASSERT_THROW(statement, expected_exception) \

+  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)

+#define ASSERT_NO_THROW(statement) \

+  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)

+#define ASSERT_ANY_THROW(statement) \

+  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)

+

+// Boolean assertions. Condition can be either a Boolean expression or an

+// AssertionResult. For more information on how to use AssertionResult with

+// these macros see comments on that class.

+#define EXPECT_TRUE(condition) \

+  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \

+                      GTEST_NONFATAL_FAILURE_)

+#define EXPECT_FALSE(condition) \

+  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \

+                      GTEST_NONFATAL_FAILURE_)

+#define ASSERT_TRUE(condition) \

+  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \

+                      GTEST_FATAL_FAILURE_)

+#define ASSERT_FALSE(condition) \

+  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \

+                      GTEST_FATAL_FAILURE_)

+

+// Includes the auto-generated header that implements a family of

+// generic predicate assertion macros.

+#include "gtest/gtest_pred_impl.h"

+

+// Macros for testing equalities and inequalities.

+//

+//    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual

+//    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2

+//    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2

+//    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2

+//    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2

+//    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2

+//

+// When they are not, Google Test prints both the tested expressions and

+// their actual values.  The values must be compatible built-in types,

+// or you will get a compiler error.  By "compatible" we mean that the

+// values can be compared by the respective operator.

+//

+// Note:

+//

+//   1. It is possible to make a user-defined type work with

+//   {ASSERT|EXPECT}_??(), but that requires overloading the

+//   comparison operators and is thus discouraged by the Google C++

+//   Usage Guide.  Therefore, you are advised to use the

+//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are

+//   equal.

+//

+//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on

+//   pointers (in particular, C strings).  Therefore, if you use it

+//   with two C strings, you are testing how their locations in memory

+//   are related, not how their content is related.  To compare two C

+//   strings by content, use {ASSERT|EXPECT}_STR*().

+//

+//   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to

+//   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you

+//   what the actual value is when it fails, and similarly for the

+//   other comparisons.

+//

+//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()

+//   evaluate their arguments, which is undefined.

+//

+//   5. These macros evaluate their arguments exactly once.

+//

+// Examples:

+//

+//   EXPECT_NE(5, Foo());

+//   EXPECT_EQ(NULL, a_pointer);

+//   ASSERT_LT(i, array_size);

+//   ASSERT_GT(records.size(), 0) << "There is no record left.";

+

+#define EXPECT_EQ(expected, actual) \

+  EXPECT_PRED_FORMAT2(::testing::internal:: \

+                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \

+                      expected, actual)

+#define EXPECT_NE(expected, actual) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)

+#define EXPECT_LE(val1, val2) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

+#define EXPECT_LT(val1, val2) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

+#define EXPECT_GE(val1, val2) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

+#define EXPECT_GT(val1, val2) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

+

+#define GTEST_ASSERT_EQ(expected, actual) \

+  ASSERT_PRED_FORMAT2(::testing::internal:: \

+                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \

+                      expected, actual)

+#define GTEST_ASSERT_NE(val1, val2) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

+#define GTEST_ASSERT_LE(val1, val2) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

+#define GTEST_ASSERT_LT(val1, val2) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

+#define GTEST_ASSERT_GE(val1, val2) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

+#define GTEST_ASSERT_GT(val1, val2) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

+

+// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of

+// ASSERT_XY(), which clashes with some users' own code.

+

+#if !GTEST_DONT_DEFINE_ASSERT_EQ

+# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)

+#endif

+

+#if !GTEST_DONT_DEFINE_ASSERT_NE

+# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)

+#endif

+

+#if !GTEST_DONT_DEFINE_ASSERT_LE

+# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)

+#endif

+

+#if !GTEST_DONT_DEFINE_ASSERT_LT

+# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)

+#endif

+

+#if !GTEST_DONT_DEFINE_ASSERT_GE

+# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)

+#endif

+

+#if !GTEST_DONT_DEFINE_ASSERT_GT

+# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)

+#endif

+

+// C-string Comparisons.  All tests treat NULL and any non-NULL string

+// as different.  Two NULLs are equal.

+//

+//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2

+//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2

+//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case

+//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case

+//

+// For wide or narrow string objects, you can use the

+// {ASSERT|EXPECT}_??() macros.

+//

+// Don't depend on the order in which the arguments are evaluated,

+// which is undefined.

+//

+// These macros evaluate their arguments exactly once.

+

+#define EXPECT_STREQ(expected, actual) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)

+#define EXPECT_STRNE(s1, s2) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)

+#define EXPECT_STRCASEEQ(expected, actual) \

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)

+#define EXPECT_STRCASENE(s1, s2)\

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)

+

+#define ASSERT_STREQ(expected, actual) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)

+#define ASSERT_STRNE(s1, s2) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)

+#define ASSERT_STRCASEEQ(expected, actual) \

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)

+#define ASSERT_STRCASENE(s1, s2)\

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)

+

+// Macros for comparing floating-point numbers.

+//

+//    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):

+//         Tests that two float values are almost equal.

+//    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):

+//         Tests that two double values are almost equal.

+//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):

+//         Tests that v1 and v2 are within the given distance to each other.

+//

+// Google Test uses ULP-based comparison to automatically pick a default

+// error bound that is appropriate for the operands.  See the

+// FloatingPoint template class in gtest-internal.h if you are

+// interested in the implementation details.

+

+#define EXPECT_FLOAT_EQ(expected, actual)\

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \

+                      expected, actual)

+

+#define EXPECT_DOUBLE_EQ(expected, actual)\

+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \

+                      expected, actual)

+

+#define ASSERT_FLOAT_EQ(expected, actual)\

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \

+                      expected, actual)

+

+#define ASSERT_DOUBLE_EQ(expected, actual)\

+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \

+                      expected, actual)

+

+#define EXPECT_NEAR(val1, val2, abs_error)\

+  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \

+                      val1, val2, abs_error)

+

+#define ASSERT_NEAR(val1, val2, abs_error)\

+  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \

+                      val1, val2, abs_error)

+

+// These predicate format functions work on floating-point values, and

+// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.

+//

+//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);

+

+// Asserts that val1 is less than, or almost equal to, val2.  Fails

+// otherwise.  In particular, it fails if either val1 or val2 is NaN.

+GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,

+                                   float val1, float val2);

+GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,

+                                    double val1, double val2);

+

+

+#if GTEST_OS_WINDOWS

+

+// Macros that test for HRESULT failure and success, these are only useful

+// on Windows, and rely on Windows SDK macros and APIs to compile.

+//

+//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)

+//

+// When expr unexpectedly fails or succeeds, Google Test prints the

+// expected result and the actual result with both a human-readable

+// string representation of the error, if available, as well as the

+// hex result code.

+# define EXPECT_HRESULT_SUCCEEDED(expr) \

+    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))

+

+# define ASSERT_HRESULT_SUCCEEDED(expr) \

+    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))

+

+# define EXPECT_HRESULT_FAILED(expr) \

+    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))

+

+# define ASSERT_HRESULT_FAILED(expr) \

+    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))

+

+#endif  // GTEST_OS_WINDOWS

+

+// Macros that execute statement and check that it doesn't generate new fatal

+// failures in the current thread.

+//

+//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);

+//

+// Examples:

+//

+//   EXPECT_NO_FATAL_FAILURE(Process());

+//   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";

+//

+#define ASSERT_NO_FATAL_FAILURE(statement) \

+    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)

+#define EXPECT_NO_FATAL_FAILURE(statement) \

+    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)

+

+// Causes a trace (including the source file path, the current line

+// number, and the given message) to be included in every test failure

+// message generated by code in the current scope.  The effect is

+// undone when the control leaves the current scope.

+//

+// The message argument can be anything streamable to std::ostream.

+//

+// In the implementation, we include the current line number as part

+// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s

+// to appear in the same block - as long as they are on different

+// lines.

+#define SCOPED_TRACE(message) \

+  ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\

+    __FILE__, __LINE__, ::testing::Message() << (message))

+

+// Compile-time assertion for type equality.

+// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are

+// the same type.  The value it returns is not interesting.

+//

+// Instead of making StaticAssertTypeEq a class template, we make it a

+// function template that invokes a helper class template.  This

+// prevents a user from misusing StaticAssertTypeEq<T1, T2> by

+// defining objects of that type.

+//

+// CAVEAT:

+//

+// When used inside a method of a class template,

+// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is

+// instantiated.  For example, given:

+//

+//   template <typename T> class Foo {

+//    public:

+//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }

+//   };

+//

+// the code:

+//

+//   void Test1() { Foo<bool> foo; }

+//

+// will NOT generate a compiler error, as Foo<bool>::Bar() is never

+// actually instantiated.  Instead, you need:

+//

+//   void Test2() { Foo<bool> foo; foo.Bar(); }

+//

+// to cause a compiler error.

+template <typename T1, typename T2>

+bool StaticAssertTypeEq() {

+  (void)internal::StaticAssertTypeEqHelper<T1, T2>();

+  return true;

+}

+

+// Defines a test.

+//

+// The first parameter is the name of the test case, and the second

+// parameter is the name of the test within the test case.

+//

+// The convention is to end the test case name with "Test".  For

+// example, a test case for the Foo class can be named FooTest.

+//

+// The user should put his test code between braces after using this

+// macro.  Example:

+//

+//   TEST(FooTest, InitializesCorrectly) {

+//     Foo foo;

+//     EXPECT_TRUE(foo.StatusIsOK());

+//   }

+

+// Note that we call GetTestTypeId() instead of GetTypeId<

+// ::testing::Test>() here to get the type ID of testing::Test.  This

+// is to work around a suspected linker bug when using Google Test as

+// a framework on Mac OS X.  The bug causes GetTypeId<

+// ::testing::Test>() to return different values depending on whether

+// the call is from the Google Test framework itself or from user test

+// code.  GetTestTypeId() is guaranteed to always return the same

+// value, as it always calls GetTypeId<>() from the Google Test

+// framework.

+#define GTEST_TEST(test_case_name, test_name)\

+  GTEST_TEST_(test_case_name, test_name, \

+              ::testing::Test, ::testing::internal::GetTestTypeId())

+

+// Define this macro to 1 to omit the definition of TEST(), which

+// is a generic name and clashes with some other libraries.

+#if !GTEST_DONT_DEFINE_TEST

+# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)

+#endif

+

+// Defines a test that uses a test fixture.

+//

+// The first parameter is the name of the test fixture class, which

+// also doubles as the test case name.  The second parameter is the

+// name of the test within the test case.

+//

+// A test fixture class must be declared earlier.  The user should put

+// his test code between braces after using this macro.  Example:

+//

+//   class FooTest : public testing::Test {

+//    protected:

+//     virtual void SetUp() { b_.AddElement(3); }

+//

+//     Foo a_;

+//     Foo b_;

+//   };

+//

+//   TEST_F(FooTest, InitializesCorrectly) {

+//     EXPECT_TRUE(a_.StatusIsOK());

+//   }

+//

+//   TEST_F(FooTest, ReturnsElementCountCorrectly) {

+//     EXPECT_EQ(0, a_.size());

+//     EXPECT_EQ(1, b_.size());

+//   }

+

+#define TEST_F(test_fixture, test_name)\

+  GTEST_TEST_(test_fixture, test_name, test_fixture, \

+              ::testing::internal::GetTypeId<test_fixture>())

+

+}  // namespace testing

+

+// Use this function in main() to run all tests.  It returns 0 if all

+// tests are successful, or 1 otherwise.

+//

+// RUN_ALL_TESTS() should be invoked after the command line has been

+// parsed by InitGoogleTest().

+//

+// This function was formerly a macro; thus, it is in the global

+// namespace and has an all-caps name.

+int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;

+

+inline int RUN_ALL_TESTS() {

+  return ::testing::UnitTest::GetInstance()->Run();

+}

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest_pred_impl.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest_pred_impl.h
new file mode 100644
index 0000000..87a2be3
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest_pred_impl.h
@@ -0,0 +1,358 @@
+// Copyright 2006, 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.

+

+// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command

+// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!

+//

+// Implements a family of generic predicate assertion macros.

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_

+#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_

+

+// Makes sure this header is not included before gtest.h.

+#ifndef GTEST_INCLUDE_GTEST_GTEST_H_

+# error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.

+#endif  // GTEST_INCLUDE_GTEST_GTEST_H_

+

+// This header implements a family of generic predicate assertion

+// macros:

+//

+//   ASSERT_PRED_FORMAT1(pred_format, v1)

+//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)

+//   ...

+//

+// where pred_format is a function or functor that takes n (in the

+// case of ASSERT_PRED_FORMATn) values and their source expression

+// text, and returns a testing::AssertionResult.  See the definition

+// of ASSERT_EQ in gtest.h for an example.

+//

+// If you don't care about formatting, you can use the more

+// restrictive version:

+//

+//   ASSERT_PRED1(pred, v1)

+//   ASSERT_PRED2(pred, v1, v2)

+//   ...

+//

+// where pred is an n-ary function or functor that returns bool,

+// and the values v1, v2, ..., must support the << operator for

+// streaming to std::ostream.

+//

+// We also define the EXPECT_* variations.

+//

+// For now we only support predicates whose arity is at most 5.

+// Please email googletestframework@googlegroups.com if you need

+// support for higher arities.

+

+// GTEST_ASSERT_ is the basic statement to which all of the assertions

+// in this file reduce.  Don't use this in your code.

+

+#define GTEST_ASSERT_(expression, on_failure) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (const ::testing::AssertionResult gtest_ar = (expression)) \

+    ; \

+  else \

+    on_failure(gtest_ar.failure_message())

+

+

+// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use

+// this in your code.

+template <typename Pred,

+          typename T1>

+AssertionResult AssertPred1Helper(const char* pred_text,

+                                  const char* e1,

+                                  Pred pred,

+                                  const T1& v1) {

+  if (pred(v1)) return AssertionSuccess();

+

+  return AssertionFailure() << pred_text << "("

+                            << e1 << ") evaluates to false, where"

+                            << "\n" << e1 << " evaluates to " << v1;

+}

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.

+// Don't use this in your code.

+#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\

+  GTEST_ASSERT_(pred_format(#v1, v1), \

+                on_failure)

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use

+// this in your code.

+#define GTEST_PRED1_(pred, v1, on_failure)\

+  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \

+                                             #v1, \

+                                             pred, \

+                                             v1), on_failure)

+

+// Unary predicate assertion macros.

+#define EXPECT_PRED_FORMAT1(pred_format, v1) \

+  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_PRED1(pred, v1) \

+  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)

+#define ASSERT_PRED_FORMAT1(pred_format, v1) \

+  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)

+#define ASSERT_PRED1(pred, v1) \

+  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)

+

+

+

+// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use

+// this in your code.

+template <typename Pred,

+          typename T1,

+          typename T2>

+AssertionResult AssertPred2Helper(const char* pred_text,

+                                  const char* e1,

+                                  const char* e2,

+                                  Pred pred,

+                                  const T1& v1,

+                                  const T2& v2) {

+  if (pred(v1, v2)) return AssertionSuccess();

+

+  return AssertionFailure() << pred_text << "("

+                            << e1 << ", "

+                            << e2 << ") evaluates to false, where"

+                            << "\n" << e1 << " evaluates to " << v1

+                            << "\n" << e2 << " evaluates to " << v2;

+}

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.

+// Don't use this in your code.

+#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\

+  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \

+                on_failure)

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use

+// this in your code.

+#define GTEST_PRED2_(pred, v1, v2, on_failure)\

+  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \

+                                             #v1, \

+                                             #v2, \

+                                             pred, \

+                                             v1, \

+                                             v2), on_failure)

+

+// Binary predicate assertion macros.

+#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \

+  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_PRED2(pred, v1, v2) \

+  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)

+#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \

+  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)

+#define ASSERT_PRED2(pred, v1, v2) \

+  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)

+

+

+

+// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use

+// this in your code.

+template <typename Pred,

+          typename T1,

+          typename T2,

+          typename T3>

+AssertionResult AssertPred3Helper(const char* pred_text,

+                                  const char* e1,

+                                  const char* e2,

+                                  const char* e3,

+                                  Pred pred,

+                                  const T1& v1,

+                                  const T2& v2,

+                                  const T3& v3) {

+  if (pred(v1, v2, v3)) return AssertionSuccess();

+

+  return AssertionFailure() << pred_text << "("

+                            << e1 << ", "

+                            << e2 << ", "

+                            << e3 << ") evaluates to false, where"

+                            << "\n" << e1 << " evaluates to " << v1

+                            << "\n" << e2 << " evaluates to " << v2

+                            << "\n" << e3 << " evaluates to " << v3;

+}

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.

+// Don't use this in your code.

+#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\

+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \

+                on_failure)

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use

+// this in your code.

+#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\

+  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \

+                                             #v1, \

+                                             #v2, \

+                                             #v3, \

+                                             pred, \

+                                             v1, \

+                                             v2, \

+                                             v3), on_failure)

+

+// Ternary predicate assertion macros.

+#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \

+  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_PRED3(pred, v1, v2, v3) \

+  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)

+#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \

+  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)

+#define ASSERT_PRED3(pred, v1, v2, v3) \

+  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)

+

+

+

+// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use

+// this in your code.

+template <typename Pred,

+          typename T1,

+          typename T2,

+          typename T3,

+          typename T4>

+AssertionResult AssertPred4Helper(const char* pred_text,

+                                  const char* e1,

+                                  const char* e2,

+                                  const char* e3,

+                                  const char* e4,

+                                  Pred pred,

+                                  const T1& v1,

+                                  const T2& v2,

+                                  const T3& v3,

+                                  const T4& v4) {

+  if (pred(v1, v2, v3, v4)) return AssertionSuccess();

+

+  return AssertionFailure() << pred_text << "("

+                            << e1 << ", "

+                            << e2 << ", "

+                            << e3 << ", "

+                            << e4 << ") evaluates to false, where"

+                            << "\n" << e1 << " evaluates to " << v1

+                            << "\n" << e2 << " evaluates to " << v2

+                            << "\n" << e3 << " evaluates to " << v3

+                            << "\n" << e4 << " evaluates to " << v4;

+}

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.

+// Don't use this in your code.

+#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\

+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \

+                on_failure)

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use

+// this in your code.

+#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\

+  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \

+                                             #v1, \

+                                             #v2, \

+                                             #v3, \

+                                             #v4, \

+                                             pred, \

+                                             v1, \

+                                             v2, \

+                                             v3, \

+                                             v4), on_failure)

+

+// 4-ary predicate assertion macros.

+#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \

+  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_PRED4(pred, v1, v2, v3, v4) \

+  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)

+#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \

+  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)

+#define ASSERT_PRED4(pred, v1, v2, v3, v4) \

+  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)

+

+

+

+// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use

+// this in your code.

+template <typename Pred,

+          typename T1,

+          typename T2,

+          typename T3,

+          typename T4,

+          typename T5>

+AssertionResult AssertPred5Helper(const char* pred_text,

+                                  const char* e1,

+                                  const char* e2,

+                                  const char* e3,

+                                  const char* e4,

+                                  const char* e5,

+                                  Pred pred,

+                                  const T1& v1,

+                                  const T2& v2,

+                                  const T3& v3,

+                                  const T4& v4,

+                                  const T5& v5) {

+  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();

+

+  return AssertionFailure() << pred_text << "("

+                            << e1 << ", "

+                            << e2 << ", "

+                            << e3 << ", "

+                            << e4 << ", "

+                            << e5 << ") evaluates to false, where"

+                            << "\n" << e1 << " evaluates to " << v1

+                            << "\n" << e2 << " evaluates to " << v2

+                            << "\n" << e3 << " evaluates to " << v3

+                            << "\n" << e4 << " evaluates to " << v4

+                            << "\n" << e5 << " evaluates to " << v5;

+}

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.

+// Don't use this in your code.

+#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\

+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \

+                on_failure)

+

+// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use

+// this in your code.

+#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\

+  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \

+                                             #v1, \

+                                             #v2, \

+                                             #v3, \

+                                             #v4, \

+                                             #v5, \

+                                             pred, \

+                                             v1, \

+                                             v2, \

+                                             v3, \

+                                             v4, \

+                                             v5), on_failure)

+

+// 5-ary predicate assertion macros.

+#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \

+  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)

+#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \

+  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)

+#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \

+  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)

+#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \

+  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)

+

+

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest_prod.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest_prod.h
new file mode 100644
index 0000000..08755f0
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/gtest_prod.h
@@ -0,0 +1,58 @@
+// Copyright 2006, 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 C++ Testing Framework definitions useful in production code.

+

+#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_

+#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_

+

+// When you need to test the private or protected members of a class,

+// use the FRIEND_TEST macro to declare your tests as friends of the

+// class.  For example:

+//

+// class MyClass {

+//  private:

+//   void MyMethod();

+//   FRIEND_TEST(MyClassTest, MyMethod);

+// };

+//

+// class MyClassTest : public testing::Test {

+//   // ...

+// };

+//

+// TEST_F(MyClassTest, MyMethod) {

+//   // Can call MyClass::MyMethod() here.

+// }

+

+#define FRIEND_TEST(test_case_name, test_name)\

+friend class test_case_name##_##test_name##_Test

+

+#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h
new file mode 100644
index 0000000..a14b93c
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h
@@ -0,0 +1,319 @@
+// Copyright 2005, 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.

+//

+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)

+//

+// The Google C++ Testing Framework (Google Test)

+//

+// This header file defines internal utilities needed for implementing

+// death tests.  They are subject to change without notice.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_

+

+#include "gtest/internal/gtest-internal.h"

+

+#include <stdio.h>

+

+namespace testing {

+namespace internal {

+

+GTEST_DECLARE_string_(internal_run_death_test);

+

+// Names of the flags (needed for parsing Google Test flags).

+const char kDeathTestStyleFlag[] = "death_test_style";

+const char kDeathTestUseFork[] = "death_test_use_fork";

+const char kInternalRunDeathTestFlag[] = "internal_run_death_test";

+

+#if GTEST_HAS_DEATH_TEST

+

+// DeathTest is a class that hides much of the complexity of the

+// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method

+// returns a concrete class that depends on the prevailing death test

+// style, as defined by the --gtest_death_test_style and/or

+// --gtest_internal_run_death_test flags.

+

+// In describing the results of death tests, these terms are used with

+// the corresponding definitions:

+//

+// exit status:  The integer exit information in the format specified

+//               by wait(2)

+// exit code:    The integer code passed to exit(3), _exit(2), or

+//               returned from main()

+class GTEST_API_ DeathTest {

+ public:

+  // Create returns false if there was an error determining the

+  // appropriate action to take for the current death test; for example,

+  // if the gtest_death_test_style flag is set to an invalid value.

+  // The LastMessage method will return a more detailed message in that

+  // case.  Otherwise, the DeathTest pointer pointed to by the "test"

+  // argument is set.  If the death test should be skipped, the pointer

+  // is set to NULL; otherwise, it is set to the address of a new concrete

+  // DeathTest object that controls the execution of the current test.

+  static bool Create(const char* statement, const RE* regex,

+                     const char* file, int line, DeathTest** test);

+  DeathTest();

+  virtual ~DeathTest() { }

+

+  // A helper class that aborts a death test when it's deleted.

+  class ReturnSentinel {

+   public:

+    explicit ReturnSentinel(DeathTest* test) : test_(test) { }

+    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }

+   private:

+    DeathTest* const test_;

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);

+  } GTEST_ATTRIBUTE_UNUSED_;

+

+  // An enumeration of possible roles that may be taken when a death

+  // test is encountered.  EXECUTE means that the death test logic should

+  // be executed immediately.  OVERSEE means that the program should prepare

+  // the appropriate environment for a child process to execute the death

+  // test, then wait for it to complete.

+  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };

+

+  // An enumeration of the three reasons that a test might be aborted.

+  enum AbortReason {

+    TEST_ENCOUNTERED_RETURN_STATEMENT,

+    TEST_THREW_EXCEPTION,

+    TEST_DID_NOT_DIE

+  };

+

+  // Assumes one of the above roles.

+  virtual TestRole AssumeRole() = 0;

+

+  // Waits for the death test to finish and returns its status.

+  virtual int Wait() = 0;

+

+  // Returns true if the death test passed; that is, the test process

+  // exited during the test, its exit status matches a user-supplied

+  // predicate, and its stderr output matches a user-supplied regular

+  // expression.

+  // The user-supplied predicate may be a macro expression rather

+  // than a function pointer or functor, or else Wait and Passed could

+  // be combined.

+  virtual bool Passed(bool exit_status_ok) = 0;

+

+  // Signals that the death test did not die as expected.

+  virtual void Abort(AbortReason reason) = 0;

+

+  // Returns a human-readable outcome message regarding the outcome of

+  // the last death test.

+  static const char* LastMessage();

+

+  static void set_last_death_test_message(const std::string& message);

+

+ private:

+  // A string containing a description of the outcome of the last death test.

+  static std::string last_death_test_message_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);

+};

+

+// Factory interface for death tests.  May be mocked out for testing.

+class DeathTestFactory {

+ public:

+  virtual ~DeathTestFactory() { }

+  virtual bool Create(const char* statement, const RE* regex,

+                      const char* file, int line, DeathTest** test) = 0;

+};

+

+// A concrete DeathTestFactory implementation for normal use.

+class DefaultDeathTestFactory : public DeathTestFactory {

+ public:

+  virtual bool Create(const char* statement, const RE* regex,

+                      const char* file, int line, DeathTest** test);

+};

+

+// Returns true if exit_status describes a process that was terminated

+// by a signal, or exited normally with a nonzero exit code.

+GTEST_API_ bool ExitedUnsuccessfully(int exit_status);

+

+// Traps C++ exceptions escaping statement and reports them as test

+// failures. Note that trapping SEH exceptions is not implemented here.

+# if GTEST_HAS_EXCEPTIONS

+#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \

+  try { \

+    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+  } catch (const ::std::exception& gtest_exception) { \

+    fprintf(\

+        stderr, \

+        "\n%s: Caught std::exception-derived exception escaping the " \

+        "death test statement. Exception message: %s\n", \

+        ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \

+        gtest_exception.what()); \

+    fflush(stderr); \

+    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \

+  } catch (...) { \

+    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \

+  }

+

+# else

+#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \

+  GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)

+

+# endif

+

+// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,

+// ASSERT_EXIT*, and EXPECT_EXIT*.

+# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (::testing::internal::AlwaysTrue()) { \

+    const ::testing::internal::RE& gtest_regex = (regex); \

+    ::testing::internal::DeathTest* gtest_dt; \

+    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \

+        __FILE__, __LINE__, &gtest_dt)) { \

+      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \

+    } \

+    if (gtest_dt != NULL) { \

+      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \

+          gtest_dt_ptr(gtest_dt); \

+      switch (gtest_dt->AssumeRole()) { \

+        case ::testing::internal::DeathTest::OVERSEE_TEST: \

+          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \

+            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \

+          } \

+          break; \

+        case ::testing::internal::DeathTest::EXECUTE_TEST: { \

+          ::testing::internal::DeathTest::ReturnSentinel \

+              gtest_sentinel(gtest_dt); \

+          GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \

+          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \

+          break; \

+        } \

+        default: \

+          break; \

+      } \

+    } \

+  } else \

+    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \

+      fail(::testing::internal::DeathTest::LastMessage())

+// The symbol "fail" here expands to something into which a message

+// can be streamed.

+

+// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in

+// NDEBUG mode. In this case we need the statements to be executed, the regex is

+// ignored, and the macro must accept a streamed message even though the message

+// is never printed.

+# define GTEST_EXECUTE_STATEMENT_(statement, regex) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (::testing::internal::AlwaysTrue()) { \

+     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+  } else \

+    ::testing::Message()

+

+// A class representing the parsed contents of the

+// --gtest_internal_run_death_test flag, as it existed when

+// RUN_ALL_TESTS was called.

+class InternalRunDeathTestFlag {

+ public:

+  InternalRunDeathTestFlag(const std::string& a_file,

+                           int a_line,

+                           int an_index,

+                           int a_write_fd)

+      : file_(a_file), line_(a_line), index_(an_index),

+        write_fd_(a_write_fd) {}

+

+  ~InternalRunDeathTestFlag() {

+    if (write_fd_ >= 0)

+      posix::Close(write_fd_);

+  }

+

+  const std::string& file() const { return file_; }

+  int line() const { return line_; }

+  int index() const { return index_; }

+  int write_fd() const { return write_fd_; }

+

+ private:

+  std::string file_;

+  int line_;

+  int index_;

+  int write_fd_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);

+};

+

+// Returns a newly created InternalRunDeathTestFlag object with fields

+// initialized from the GTEST_FLAG(internal_run_death_test) flag if

+// the flag is specified; otherwise returns NULL.

+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();

+

+#else  // GTEST_HAS_DEATH_TEST

+

+// This macro is used for implementing macros such as

+// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where

+// death tests are not supported. Those macros must compile on such systems

+// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on

+// systems that support death tests. This allows one to write such a macro

+// on a system that does not support death tests and be sure that it will

+// compile on a death-test supporting system.

+//

+// Parameters:

+//   statement -  A statement that a macro such as EXPECT_DEATH would test

+//                for program termination. This macro has to make sure this

+//                statement is compiled but not executed, to ensure that

+//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain

+//                parameter iff EXPECT_DEATH compiles with it.

+//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test

+//                the output of statement.  This parameter has to be

+//                compiled but not evaluated by this macro, to ensure that

+//                this macro only accepts expressions that a macro such as

+//                EXPECT_DEATH would accept.

+//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED

+//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.

+//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not

+//                compile inside functions where ASSERT_DEATH doesn't

+//                compile.

+//

+//  The branch that has an always false condition is used to ensure that

+//  statement and regex are compiled (and thus syntactically correct) but

+//  never executed. The unreachable code macro protects the terminator

+//  statement from generating an 'unreachable code' warning in case

+//  statement unconditionally returns or throws. The Message constructor at

+//  the end allows the syntax of streaming additional messages into the

+//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.

+# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \

+    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+    if (::testing::internal::AlwaysTrue()) { \

+      GTEST_LOG_(WARNING) \

+          << "Death tests are not supported on this platform.\n" \

+          << "Statement '" #statement "' cannot be verified."; \

+    } else if (::testing::internal::AlwaysFalse()) { \

+      ::testing::internal::RE::PartialMatch(".*", (regex)); \

+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+      terminator; \

+    } else \

+      ::testing::Message()

+

+#endif  // GTEST_HAS_DEATH_TEST

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h
new file mode 100644
index 0000000..7840053
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h
@@ -0,0 +1,206 @@
+// 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: keith.ray@gmail.com (Keith Ray)

+//

+// Google Test filepath utilities

+//

+// This header file declares classes and functions used internally by

+// Google Test.  They are subject to change without notice.

+//

+// This file is #included in <gtest/internal/gtest-internal.h>.

+// Do not include this header file separately!

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_

+

+#include "gtest/internal/gtest-string.h"

+

+namespace testing {

+namespace internal {

+

+// FilePath - a class for file and directory pathname manipulation which

+// handles platform-specific conventions (like the pathname separator).

+// Used for helper functions for naming files in a directory for xml output.

+// Except for Set methods, all methods are const or static, which provides an

+// "immutable value object" -- useful for peace of mind.

+// A FilePath with a value ending in a path separator ("like/this/") represents

+// a directory, otherwise it is assumed to represent a file. In either case,

+// it may or may not represent an actual file or directory in the file system.

+// Names are NOT checked for syntax correctness -- no checking for illegal

+// characters, malformed paths, etc.

+

+class GTEST_API_ FilePath {

+ public:

+  FilePath() : pathname_("") { }

+  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }

+

+  explicit FilePath(const std::string& pathname) : pathname_(pathname) {

+    Normalize();

+  }

+

+  FilePath& operator=(const FilePath& rhs) {

+    Set(rhs);

+    return *this;

+  }

+

+  void Set(const FilePath& rhs) {

+    pathname_ = rhs.pathname_;

+  }

+

+  const std::string& string() const { return pathname_; }

+  const char* c_str() const { return pathname_.c_str(); }

+

+  // Returns the current working directory, or "" if unsuccessful.

+  static FilePath GetCurrentDir();

+

+  // Given directory = "dir", base_name = "test", number = 0,

+  // extension = "xml", returns "dir/test.xml". If number is greater

+  // than zero (e.g., 12), returns "dir/test_12.xml".

+  // On Windows platform, uses \ as the separator rather than /.

+  static FilePath MakeFileName(const FilePath& directory,

+                               const FilePath& base_name,

+                               int number,

+                               const char* extension);

+

+  // Given directory = "dir", relative_path = "test.xml",

+  // returns "dir/test.xml".

+  // On Windows, uses \ as the separator rather than /.

+  static FilePath ConcatPaths(const FilePath& directory,

+                              const FilePath& relative_path);

+

+  // Returns a pathname for a file that does not currently exist. The pathname

+  // will be directory/base_name.extension or

+  // directory/base_name_<number>.extension if directory/base_name.extension

+  // already exists. The number will be incremented until a pathname is found

+  // that does not already exist.

+  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.

+  // There could be a race condition if two or more processes are calling this

+  // function at the same time -- they could both pick the same filename.

+  static FilePath GenerateUniqueFileName(const FilePath& directory,

+                                         const FilePath& base_name,

+                                         const char* extension);

+

+  // Returns true iff the path is "".

+  bool IsEmpty() const { return pathname_.empty(); }

+

+  // If input name has a trailing separator character, removes it and returns

+  // the name, otherwise return the name string unmodified.

+  // On Windows platform, uses \ as the separator, other platforms use /.

+  FilePath RemoveTrailingPathSeparator() const;

+

+  // Returns a copy of the FilePath with the directory part removed.

+  // Example: FilePath("path/to/file").RemoveDirectoryName() returns

+  // FilePath("file"). If there is no directory part ("just_a_file"), it returns

+  // the FilePath unmodified. If there is no file part ("just_a_dir/") it

+  // returns an empty FilePath ("").

+  // On Windows platform, '\' is the path separator, otherwise it is '/'.

+  FilePath RemoveDirectoryName() const;

+

+  // RemoveFileName returns the directory path with the filename removed.

+  // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".

+  // If the FilePath is "a_file" or "/a_file", RemoveFileName returns

+  // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does

+  // not have a file, like "just/a/dir/", it returns the FilePath unmodified.

+  // On Windows platform, '\' is the path separator, otherwise it is '/'.

+  FilePath RemoveFileName() const;

+

+  // Returns a copy of the FilePath with the case-insensitive extension removed.

+  // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns

+  // FilePath("dir/file"). If a case-insensitive extension is not

+  // found, returns a copy of the original FilePath.

+  FilePath RemoveExtension(const char* extension) const;

+

+  // Creates directories so that path exists. Returns true if successful or if

+  // the directories already exist; returns false if unable to create

+  // directories for any reason. Will also return false if the FilePath does

+  // not represent a directory (that is, it doesn't end with a path separator).

+  bool CreateDirectoriesRecursively() const;

+

+  // Create the directory so that path exists. Returns true if successful or

+  // if the directory already exists; returns false if unable to create the

+  // directory for any reason, including if the parent directory does not

+  // exist. Not named "CreateDirectory" because that's a macro on Windows.

+  bool CreateFolder() const;

+

+  // Returns true if FilePath describes something in the file-system,

+  // either a file, directory, or whatever, and that something exists.

+  bool FileOrDirectoryExists() const;

+

+  // Returns true if pathname describes a directory in the file-system

+  // that exists.

+  bool DirectoryExists() const;

+

+  // Returns true if FilePath ends with a path separator, which indicates that

+  // it is intended to represent a directory. Returns false otherwise.

+  // This does NOT check that a directory (or file) actually exists.

+  bool IsDirectory() const;

+

+  // Returns true if pathname describes a root directory. (Windows has one

+  // root directory per disk drive.)

+  bool IsRootDirectory() const;

+

+  // Returns true if pathname describes an absolute path.

+  bool IsAbsolutePath() const;

+

+ private:

+  // Replaces multiple consecutive separators with a single separator.

+  // For example, "bar///foo" becomes "bar/foo". Does not eliminate other

+  // redundancies that might be in a pathname involving "." or "..".

+  //

+  // A pathname with multiple consecutive separators may occur either through

+  // user error or as a result of some scripts or APIs that generate a pathname

+  // with a trailing separator. On other platforms the same API or script

+  // may NOT generate a pathname with a trailing "/". Then elsewhere that

+  // pathname may have another "/" and pathname components added to it,

+  // without checking for the separator already being there.

+  // The script language and operating system may allow paths like "foo//bar"

+  // but some of the functions in FilePath will not handle that correctly. In

+  // particular, RemoveTrailingPathSeparator() only removes one separator, and

+  // it is called in CreateDirectoriesRecursively() assuming that it will change

+  // a pathname from directory syntax (trailing separator) to filename syntax.

+  //

+  // On Windows this method also replaces the alternate path separator '/' with

+  // the primary path separator '\\', so that for example "bar\\/\\foo" becomes

+  // "bar\\foo".

+

+  void Normalize();

+

+  // Returns a pointer to the last occurence of a valid path separator in

+  // the FilePath. On Windows, for example, both '/' and '\' are valid path

+  // separators. Returns NULL if no path separator was found.

+  const char* FindLastPathSeparator() const;

+

+  std::string pathname_;

+};  // class FilePath

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-internal.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-internal.h
new file mode 100644
index 0000000..9090b6f
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-internal.h
@@ -0,0 +1,1158 @@
+// Copyright 2005, 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.

+//

+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)

+//

+// The Google C++ Testing Framework (Google Test)

+//

+// This header file declares functions and macros used internally by

+// Google Test.  They are subject to change without notice.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_

+

+#include "gtest/internal/gtest-port.h"

+

+#if GTEST_OS_LINUX

+# include <stdlib.h>

+# include <sys/types.h>

+# include <sys/wait.h>

+# include <unistd.h>

+#endif  // GTEST_OS_LINUX

+

+#if GTEST_HAS_EXCEPTIONS

+# include <stdexcept>

+#endif

+

+#include <ctype.h>

+#include <float.h>

+#include <string.h>

+#include <iomanip>

+#include <limits>

+#include <set>

+

+#include "gtest/gtest-message.h"

+#include "gtest/internal/gtest-string.h"

+#include "gtest/internal/gtest-filepath.h"

+#include "gtest/internal/gtest-type-util.h"

+

+// Due to C++ preprocessor weirdness, we need double indirection to

+// concatenate two tokens when one of them is __LINE__.  Writing

+//

+//   foo ## __LINE__

+//

+// will result in the token foo__LINE__, instead of foo followed by

+// the current line number.  For more details, see

+// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6

+#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)

+#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar

+

+class ProtocolMessage;

+namespace proto2 { class Message; }

+

+namespace testing {

+

+// Forward declarations.

+

+class AssertionResult;                 // Result of an assertion.

+class Message;                         // Represents a failure message.

+class Test;                            // Represents a test.

+class TestInfo;                        // Information about a test.

+class TestPartResult;                  // Result of a test part.

+class UnitTest;                        // A collection of test cases.

+

+template <typename T>

+::std::string PrintToString(const T& value);

+

+namespace internal {

+

+struct TraceInfo;                      // Information about a trace point.

+class ScopedTrace;                     // Implements scoped trace.

+class TestInfoImpl;                    // Opaque implementation of TestInfo

+class UnitTestImpl;                    // Opaque implementation of UnitTest

+

+// How many times InitGoogleTest() has been called.

+GTEST_API_ extern int g_init_gtest_count;

+

+// The text used in failure messages to indicate the start of the

+// stack trace.

+GTEST_API_ extern const char kStackTraceMarker[];

+

+// Two overloaded helpers for checking at compile time whether an

+// expression is a null pointer literal (i.e. NULL or any 0-valued

+// compile-time integral constant).  Their return values have

+// different sizes, so we can use sizeof() to test which version is

+// picked by the compiler.  These helpers have no implementations, as

+// we only need their signatures.

+//

+// Given IsNullLiteralHelper(x), the compiler will pick the first

+// version if x can be implicitly converted to Secret*, and pick the

+// second version otherwise.  Since Secret is a secret and incomplete

+// type, the only expression a user can write that has type Secret* is

+// a null pointer literal.  Therefore, we know that x is a null

+// pointer literal if and only if the first version is picked by the

+// compiler.

+char IsNullLiteralHelper(Secret* p);

+char (&IsNullLiteralHelper(...))[2];  // NOLINT

+

+// A compile-time bool constant that is true if and only if x is a

+// null pointer literal (i.e. NULL or any 0-valued compile-time

+// integral constant).

+#ifdef GTEST_ELLIPSIS_NEEDS_POD_

+// We lose support for NULL detection where the compiler doesn't like

+// passing non-POD classes through ellipsis (...).

+# define GTEST_IS_NULL_LITERAL_(x) false

+#else

+# define GTEST_IS_NULL_LITERAL_(x) \

+    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)

+#endif  // GTEST_ELLIPSIS_NEEDS_POD_

+

+// Appends the user-supplied message to the Google-Test-generated message.

+GTEST_API_ std::string AppendUserMessage(

+    const std::string& gtest_msg, const Message& user_msg);

+

+#if GTEST_HAS_EXCEPTIONS

+

+// This exception is thrown by (and only by) a failed Google Test

+// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions

+// are enabled).  We derive it from std::runtime_error, which is for

+// errors presumably detectable only at run time.  Since

+// std::runtime_error inherits from std::exception, many testing

+// frameworks know how to extract and print the message inside it.

+class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {

+ public:

+  explicit GoogleTestFailureException(const TestPartResult& failure);

+};

+

+#endif  // GTEST_HAS_EXCEPTIONS

+

+// A helper class for creating scoped traces in user programs.

+class GTEST_API_ ScopedTrace {

+ public:

+  // The c'tor pushes the given source file location and message onto

+  // a trace stack maintained by Google Test.

+  ScopedTrace(const char* file, int line, const Message& message);

+

+  // The d'tor pops the info pushed by the c'tor.

+  //

+  // Note that the d'tor is not virtual in order to be efficient.

+  // Don't inherit from ScopedTrace!

+  ~ScopedTrace();

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);

+} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its

+                            // c'tor and d'tor.  Therefore it doesn't

+                            // need to be used otherwise.

+

+// Constructs and returns the message for an equality assertion

+// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.

+//

+// The first four parameters are the expressions used in the assertion

+// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)

+// where foo is 5 and bar is 6, we have:

+//

+//   expected_expression: "foo"

+//   actual_expression:   "bar"

+//   expected_value:      "5"

+//   actual_value:        "6"

+//

+// The ignoring_case parameter is true iff the assertion is a

+// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will

+// be inserted into the message.

+GTEST_API_ AssertionResult EqFailure(const char* expected_expression,

+                                     const char* actual_expression,

+                                     const std::string& expected_value,

+                                     const std::string& actual_value,

+                                     bool ignoring_case);

+

+// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.

+GTEST_API_ std::string GetBoolAssertionFailureMessage(

+    const AssertionResult& assertion_result,

+    const char* expression_text,

+    const char* actual_predicate_value,

+    const char* expected_predicate_value);

+

+// This template class represents an IEEE floating-point number

+// (either single-precision or double-precision, depending on the

+// template parameters).

+//

+// The purpose of this class is to do more sophisticated number

+// comparison.  (Due to round-off error, etc, it's very unlikely that

+// two floating-points will be equal exactly.  Hence a naive

+// comparison by the == operation often doesn't work.)

+//

+// Format of IEEE floating-point:

+//

+//   The most-significant bit being the leftmost, an IEEE

+//   floating-point looks like

+//

+//     sign_bit exponent_bits fraction_bits

+//

+//   Here, sign_bit is a single bit that designates the sign of the

+//   number.

+//

+//   For float, there are 8 exponent bits and 23 fraction bits.

+//

+//   For double, there are 11 exponent bits and 52 fraction bits.

+//

+//   More details can be found at

+//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.

+//

+// Template parameter:

+//

+//   RawType: the raw floating-point type (either float or double)

+template <typename RawType>

+class FloatingPoint {

+ public:

+  // Defines the unsigned integer type that has the same size as the

+  // floating point number.

+  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;

+

+  // Constants.

+

+  // # of bits in a number.

+  static const size_t kBitCount = 8*sizeof(RawType);

+

+  // # of fraction bits in a number.

+  static const size_t kFractionBitCount =

+    std::numeric_limits<RawType>::digits - 1;

+

+  // # of exponent bits in a number.

+  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;

+

+  // The mask for the sign bit.

+  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);

+

+  // The mask for the fraction bits.

+  static const Bits kFractionBitMask =

+    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);

+

+  // The mask for the exponent bits.

+  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);

+

+  // How many ULP's (Units in the Last Place) we want to tolerate when

+  // comparing two numbers.  The larger the value, the more error we

+  // allow.  A 0 value means that two numbers must be exactly the same

+  // to be considered equal.

+  //

+  // The maximum error of a single floating-point operation is 0.5

+  // units in the last place.  On Intel CPU's, all floating-point

+  // calculations are done with 80-bit precision, while double has 64

+  // bits.  Therefore, 4 should be enough for ordinary use.

+  //

+  // See the following article for more details on ULP:

+  // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

+  static const size_t kMaxUlps = 4;

+

+  // Constructs a FloatingPoint from a raw floating-point number.

+  //

+  // On an Intel CPU, passing a non-normalized NAN (Not a Number)

+  // around may change its bits, although the new value is guaranteed

+  // to be also a NAN.  Therefore, don't expect this constructor to

+  // preserve the bits in x when x is a NAN.

+  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }

+

+  // Static methods

+

+  // Reinterprets a bit pattern as a floating-point number.

+  //

+  // This function is needed to test the AlmostEquals() method.

+  static RawType ReinterpretBits(const Bits bits) {

+    FloatingPoint fp(0);

+    fp.u_.bits_ = bits;

+    return fp.u_.value_;

+  }

+

+  // Returns the floating-point number that represent positive infinity.

+  static RawType Infinity() {

+    return ReinterpretBits(kExponentBitMask);

+  }

+

+  // Returns the maximum representable finite floating-point number.

+  static RawType Max();

+

+  // Non-static methods

+

+  // Returns the bits that represents this number.

+  const Bits &bits() const { return u_.bits_; }

+

+  // Returns the exponent bits of this number.

+  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }

+

+  // Returns the fraction bits of this number.

+  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }

+

+  // Returns the sign bit of this number.

+  Bits sign_bit() const { return kSignBitMask & u_.bits_; }

+

+  // Returns true iff this is NAN (not a number).

+  bool is_nan() const {

+    // It's a NAN if the exponent bits are all ones and the fraction

+    // bits are not entirely zeros.

+    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);

+  }

+

+  // Returns true iff this number is at most kMaxUlps ULP's away from

+  // rhs.  In particular, this function:

+  //

+  //   - returns false if either number is (or both are) NAN.

+  //   - treats really large numbers as almost equal to infinity.

+  //   - thinks +0.0 and -0.0 are 0 DLP's apart.

+  bool AlmostEquals(const FloatingPoint& rhs) const {

+    // The IEEE standard says that any comparison operation involving

+    // a NAN must return false.

+    if (is_nan() || rhs.is_nan()) return false;

+

+    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)

+        <= kMaxUlps;

+  }

+

+ private:

+  // The data type used to store the actual floating-point number.

+  union FloatingPointUnion {

+    RawType value_;  // The raw floating-point number.

+    Bits bits_;      // The bits that represent the number.

+  };

+

+  // Converts an integer from the sign-and-magnitude representation to

+  // the biased representation.  More precisely, let N be 2 to the

+  // power of (kBitCount - 1), an integer x is represented by the

+  // unsigned number x + N.

+  //

+  // For instance,

+  //

+  //   -N + 1 (the most negative number representable using

+  //          sign-and-magnitude) is represented by 1;

+  //   0      is represented by N; and

+  //   N - 1  (the biggest number representable using

+  //          sign-and-magnitude) is represented by 2N - 1.

+  //

+  // Read http://en.wikipedia.org/wiki/Signed_number_representations

+  // for more details on signed number representations.

+  static Bits SignAndMagnitudeToBiased(const Bits &sam) {

+    if (kSignBitMask & sam) {

+      // sam represents a negative number.

+      return ~sam + 1;

+    } else {

+      // sam represents a positive number.

+      return kSignBitMask | sam;

+    }

+  }

+

+  // Given two numbers in the sign-and-magnitude representation,

+  // returns the distance between them as an unsigned number.

+  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,

+                                                     const Bits &sam2) {

+    const Bits biased1 = SignAndMagnitudeToBiased(sam1);

+    const Bits biased2 = SignAndMagnitudeToBiased(sam2);

+    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);

+  }

+

+  FloatingPointUnion u_;

+};

+

+// We cannot use std::numeric_limits<T>::max() as it clashes with the max()

+// macro defined by <windows.h>.

+template <>

+inline float FloatingPoint<float>::Max() { return FLT_MAX; }

+template <>

+inline double FloatingPoint<double>::Max() { return DBL_MAX; }

+

+// Typedefs the instances of the FloatingPoint template class that we

+// care to use.

+typedef FloatingPoint<float> Float;

+typedef FloatingPoint<double> Double;

+

+// In order to catch the mistake of putting tests that use different

+// test fixture classes in the same test case, we need to assign

+// unique IDs to fixture classes and compare them.  The TypeId type is

+// used to hold such IDs.  The user should treat TypeId as an opaque

+// type: the only operation allowed on TypeId values is to compare

+// them for equality using the == operator.

+typedef const void* TypeId;

+

+template <typename T>

+class TypeIdHelper {

+ public:

+  // dummy_ must not have a const type.  Otherwise an overly eager

+  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge

+  // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".

+  static bool dummy_;

+};

+

+template <typename T>

+bool TypeIdHelper<T>::dummy_ = false;

+

+// GetTypeId<T>() returns the ID of type T.  Different values will be

+// returned for different types.  Calling the function twice with the

+// same type argument is guaranteed to return the same ID.

+template <typename T>

+TypeId GetTypeId() {

+  // The compiler is required to allocate a different

+  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate

+  // the template.  Therefore, the address of dummy_ is guaranteed to

+  // be unique.

+  return &(TypeIdHelper<T>::dummy_);

+}

+

+// Returns the type ID of ::testing::Test.  Always call this instead

+// of GetTypeId< ::testing::Test>() to get the type ID of

+// ::testing::Test, as the latter may give the wrong result due to a

+// suspected linker bug when compiling Google Test as a Mac OS X

+// framework.

+GTEST_API_ TypeId GetTestTypeId();

+

+// Defines the abstract factory interface that creates instances

+// of a Test object.

+class TestFactoryBase {

+ public:

+  virtual ~TestFactoryBase() {}

+

+  // Creates a test instance to run. The instance is both created and destroyed

+  // within TestInfoImpl::Run()

+  virtual Test* CreateTest() = 0;

+

+ protected:

+  TestFactoryBase() {}

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);

+};

+

+// This class provides implementation of TeastFactoryBase interface.

+// It is used in TEST and TEST_F macros.

+template <class TestClass>

+class TestFactoryImpl : public TestFactoryBase {

+ public:

+  virtual Test* CreateTest() { return new TestClass; }

+};

+

+#if GTEST_OS_WINDOWS

+

+// Predicate-formatters for implementing the HRESULT checking macros

+// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}

+// We pass a long instead of HRESULT to avoid causing an

+// include dependency for the HRESULT type.

+GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,

+                                            long hr);  // NOLINT

+GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,

+                                            long hr);  // NOLINT

+

+#endif  // GTEST_OS_WINDOWS

+

+// Types of SetUpTestCase() and TearDownTestCase() functions.

+typedef void (*SetUpTestCaseFunc)();

+typedef void (*TearDownTestCaseFunc)();

+

+// Creates a new TestInfo object and registers it with Google Test;

+// returns the created object.

+//

+// Arguments:

+//

+//   test_case_name:   name of the test case

+//   name:             name of the test

+//   type_param        the name of the test's type parameter, or NULL if

+//                     this is not a typed or a type-parameterized test.

+//   value_param       text representation of the test's value parameter,

+//                     or NULL if this is not a type-parameterized test.

+//   fixture_class_id: ID of the test fixture class

+//   set_up_tc:        pointer to the function that sets up the test case

+//   tear_down_tc:     pointer to the function that tears down the test case

+//   factory:          pointer to the factory that creates a test object.

+//                     The newly created TestInfo instance will assume

+//                     ownership of the factory object.

+GTEST_API_ TestInfo* MakeAndRegisterTestInfo(

+    const char* test_case_name,

+    const char* name,

+    const char* type_param,

+    const char* value_param,

+    TypeId fixture_class_id,

+    SetUpTestCaseFunc set_up_tc,

+    TearDownTestCaseFunc tear_down_tc,

+    TestFactoryBase* factory);

+

+// If *pstr starts with the given prefix, modifies *pstr to be right

+// past the prefix and returns true; otherwise leaves *pstr unchanged

+// and returns false.  None of pstr, *pstr, and prefix can be NULL.

+GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);

+

+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P

+

+// State of the definition of a type-parameterized test case.

+class GTEST_API_ TypedTestCasePState {

+ public:

+  TypedTestCasePState() : registered_(false) {}

+

+  // Adds the given test name to defined_test_names_ and return true

+  // if the test case hasn't been registered; otherwise aborts the

+  // program.

+  bool AddTestName(const char* file, int line, const char* case_name,

+                   const char* test_name) {

+    if (registered_) {

+      fprintf(stderr, "%s Test %s must be defined before "

+              "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",

+              FormatFileLocation(file, line).c_str(), test_name, case_name);

+      fflush(stderr);

+      posix::Abort();

+    }

+    defined_test_names_.insert(test_name);

+    return true;

+  }

+

+  // Verifies that registered_tests match the test names in

+  // defined_test_names_; returns registered_tests if successful, or

+  // aborts the program otherwise.

+  const char* VerifyRegisteredTestNames(

+      const char* file, int line, const char* registered_tests);

+

+ private:

+  bool registered_;

+  ::std::set<const char*> defined_test_names_;

+};

+

+// Skips to the first non-space char after the first comma in 'str';

+// returns NULL if no comma is found in 'str'.

+inline const char* SkipComma(const char* str) {

+  const char* comma = strchr(str, ',');

+  if (comma == NULL) {

+    return NULL;

+  }

+  while (IsSpace(*(++comma))) {}

+  return comma;

+}

+

+// Returns the prefix of 'str' before the first comma in it; returns

+// the entire string if it contains no comma.

+inline std::string GetPrefixUntilComma(const char* str) {

+  const char* comma = strchr(str, ',');

+  return comma == NULL ? str : std::string(str, comma);

+}

+

+// TypeParameterizedTest<Fixture, TestSel, Types>::Register()

+// registers a list of type-parameterized tests with Google Test.  The

+// return value is insignificant - we just need to return something

+// such that we can call this function in a namespace scope.

+//

+// Implementation note: The GTEST_TEMPLATE_ macro declares a template

+// template parameter.  It's defined in gtest-type-util.h.

+template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>

+class TypeParameterizedTest {

+ public:

+  // 'index' is the index of the test in the type list 'Types'

+  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,

+  // Types).  Valid values for 'index' are [0, N - 1] where N is the

+  // length of Types.

+  static bool Register(const char* prefix, const char* case_name,

+                       const char* test_names, int index) {

+    typedef typename Types::Head Type;

+    typedef Fixture<Type> FixtureClass;

+    typedef typename GTEST_BIND_(TestSel, Type) TestClass;

+

+    // First, registers the first type-parameterized test in the type

+    // list.

+    MakeAndRegisterTestInfo(

+        (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"

+         + StreamableToString(index)).c_str(),

+        GetPrefixUntilComma(test_names).c_str(),

+        GetTypeName<Type>().c_str(),

+        NULL,  // No value parameter.

+        GetTypeId<FixtureClass>(),

+        TestClass::SetUpTestCase,

+        TestClass::TearDownTestCase,

+        new TestFactoryImpl<TestClass>);

+

+    // Next, recurses (at compile time) with the tail of the type list.

+    return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>

+        ::Register(prefix, case_name, test_names, index + 1);

+  }

+};

+

+// The base case for the compile time recursion.

+template <GTEST_TEMPLATE_ Fixture, class TestSel>

+class TypeParameterizedTest<Fixture, TestSel, Types0> {

+ public:

+  static bool Register(const char* /*prefix*/, const char* /*case_name*/,

+                       const char* /*test_names*/, int /*index*/) {

+    return true;

+  }

+};

+

+// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()

+// registers *all combinations* of 'Tests' and 'Types' with Google

+// Test.  The return value is insignificant - we just need to return

+// something such that we can call this function in a namespace scope.

+template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>

+class TypeParameterizedTestCase {

+ public:

+  static bool Register(const char* prefix, const char* case_name,

+                       const char* test_names) {

+    typedef typename Tests::Head Head;

+

+    // First, register the first test in 'Test' for each type in 'Types'.

+    TypeParameterizedTest<Fixture, Head, Types>::Register(

+        prefix, case_name, test_names, 0);

+

+    // Next, recurses (at compile time) with the tail of the test list.

+    return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>

+        ::Register(prefix, case_name, SkipComma(test_names));

+  }

+};

+

+// The base case for the compile time recursion.

+template <GTEST_TEMPLATE_ Fixture, typename Types>

+class TypeParameterizedTestCase<Fixture, Templates0, Types> {

+ public:

+  static bool Register(const char* /*prefix*/, const char* /*case_name*/,

+                       const char* /*test_names*/) {

+    return true;

+  }

+};

+

+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P

+

+// Returns the current OS stack trace as an std::string.

+//

+// The maximum number of stack frames to be included is specified by

+// the gtest_stack_trace_depth flag.  The skip_count parameter

+// specifies the number of top frames to be skipped, which doesn't

+// count against the number of frames to be included.

+//

+// For example, if Foo() calls Bar(), which in turn calls

+// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in

+// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.

+GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(

+    UnitTest* unit_test, int skip_count);

+

+// Helpers for suppressing warnings on unreachable code or constant

+// condition.

+

+// Always returns true.

+GTEST_API_ bool AlwaysTrue();

+

+// Always returns false.

+inline bool AlwaysFalse() { return !AlwaysTrue(); }

+

+// Helper for suppressing false warning from Clang on a const char*

+// variable declared in a conditional expression always being NULL in

+// the else branch.

+struct GTEST_API_ ConstCharPtr {

+  ConstCharPtr(const char* str) : value(str) {}

+  operator bool() const { return true; }

+  const char* value;

+};

+

+// A simple Linear Congruential Generator for generating random

+// numbers with a uniform distribution.  Unlike rand() and srand(), it

+// doesn't use global state (and therefore can't interfere with user

+// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,

+// but it's good enough for our purposes.

+class GTEST_API_ Random {

+ public:

+  static const UInt32 kMaxRange = 1u << 31;

+

+  explicit Random(UInt32 seed) : state_(seed) {}

+

+  void Reseed(UInt32 seed) { state_ = seed; }

+

+  // Generates a random number from [0, range).  Crashes if 'range' is

+  // 0 or greater than kMaxRange.

+  UInt32 Generate(UInt32 range);

+

+ private:

+  UInt32 state_;

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);

+};

+

+// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a

+// compiler error iff T1 and T2 are different types.

+template <typename T1, typename T2>

+struct CompileAssertTypesEqual;

+

+template <typename T>

+struct CompileAssertTypesEqual<T, T> {

+};

+

+// Removes the reference from a type if it is a reference type,

+// otherwise leaves it unchanged.  This is the same as

+// tr1::remove_reference, which is not widely available yet.

+template <typename T>

+struct RemoveReference { typedef T type; };  // NOLINT

+template <typename T>

+struct RemoveReference<T&> { typedef T type; };  // NOLINT

+

+// A handy wrapper around RemoveReference that works when the argument

+// T depends on template parameters.

+#define GTEST_REMOVE_REFERENCE_(T) \

+    typename ::testing::internal::RemoveReference<T>::type

+

+// Removes const from a type if it is a const type, otherwise leaves

+// it unchanged.  This is the same as tr1::remove_const, which is not

+// widely available yet.

+template <typename T>

+struct RemoveConst { typedef T type; };  // NOLINT

+template <typename T>

+struct RemoveConst<const T> { typedef T type; };  // NOLINT

+

+// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above

+// definition to fail to remove the const in 'const int[3]' and 'const

+// char[3][4]'.  The following specialization works around the bug.

+template <typename T, size_t N>

+struct RemoveConst<const T[N]> {

+  typedef typename RemoveConst<T>::type type[N];

+};

+

+#if defined(_MSC_VER) && _MSC_VER < 1400

+// This is the only specialization that allows VC++ 7.1 to remove const in

+// 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC

+// and thus needs to be conditionally compiled.

+template <typename T, size_t N>

+struct RemoveConst<T[N]> {

+  typedef typename RemoveConst<T>::type type[N];

+};

+#endif

+

+// A handy wrapper around RemoveConst that works when the argument

+// T depends on template parameters.

+#define GTEST_REMOVE_CONST_(T) \

+    typename ::testing::internal::RemoveConst<T>::type

+

+// Turns const U&, U&, const U, and U all into U.

+#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \

+    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))

+

+// Adds reference to a type if it is not a reference type,

+// otherwise leaves it unchanged.  This is the same as

+// tr1::add_reference, which is not widely available yet.

+template <typename T>

+struct AddReference { typedef T& type; };  // NOLINT

+template <typename T>

+struct AddReference<T&> { typedef T& type; };  // NOLINT

+

+// A handy wrapper around AddReference that works when the argument T

+// depends on template parameters.

+#define GTEST_ADD_REFERENCE_(T) \

+    typename ::testing::internal::AddReference<T>::type

+

+// Adds a reference to const on top of T as necessary.  For example,

+// it transforms

+//

+//   char         ==> const char&

+//   const char   ==> const char&

+//   char&        ==> const char&

+//   const char&  ==> const char&

+//

+// The argument T must depend on some template parameters.

+#define GTEST_REFERENCE_TO_CONST_(T) \

+    GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))

+

+// ImplicitlyConvertible<From, To>::value is a compile-time bool

+// constant that's true iff type From can be implicitly converted to

+// type To.

+template <typename From, typename To>

+class ImplicitlyConvertible {

+ private:

+  // We need the following helper functions only for their types.

+  // They have no implementations.

+

+  // MakeFrom() is an expression whose type is From.  We cannot simply

+  // use From(), as the type From may not have a public default

+  // constructor.

+  static From MakeFrom();

+

+  // These two functions are overloaded.  Given an expression

+  // Helper(x), the compiler will pick the first version if x can be

+  // implicitly converted to type To; otherwise it will pick the

+  // second version.

+  //

+  // The first version returns a value of size 1, and the second

+  // version returns a value of size 2.  Therefore, by checking the

+  // size of Helper(x), which can be done at compile time, we can tell

+  // which version of Helper() is used, and hence whether x can be

+  // implicitly converted to type To.

+  static char Helper(To);

+  static char (&Helper(...))[2];  // NOLINT

+

+  // We have to put the 'public' section after the 'private' section,

+  // or MSVC refuses to compile the code.

+ public:

+  // MSVC warns about implicitly converting from double to int for

+  // possible loss of data, so we need to temporarily disable the

+  // warning.

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4244)  // Temporarily disables warning 4244.

+

+  static const bool value =

+      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;

+# pragma warning(pop)           // Restores the warning state.

+#elif defined(__BORLANDC__)

+  // C++Builder cannot use member overload resolution during template

+  // instantiation.  The simplest workaround is to use its C++0x type traits

+  // functions (C++Builder 2009 and above only).

+  static const bool value = __is_convertible(From, To);

+#else

+  static const bool value =

+      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;

+#endif  // _MSV_VER

+};

+template <typename From, typename To>

+const bool ImplicitlyConvertible<From, To>::value;

+

+// IsAProtocolMessage<T>::value is a compile-time bool constant that's

+// true iff T is type ProtocolMessage, proto2::Message, or a subclass

+// of those.

+template <typename T>

+struct IsAProtocolMessage

+    : public bool_constant<

+  ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||

+  ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {

+};

+

+// When the compiler sees expression IsContainerTest<C>(0), if C is an

+// STL-style container class, the first overload of IsContainerTest

+// will be viable (since both C::iterator* and C::const_iterator* are

+// valid types and NULL can be implicitly converted to them).  It will

+// be picked over the second overload as 'int' is a perfect match for

+// the type of argument 0.  If C::iterator or C::const_iterator is not

+// a valid type, the first overload is not viable, and the second

+// overload will be picked.  Therefore, we can determine whether C is

+// a container class by checking the type of IsContainerTest<C>(0).

+// The value of the expression is insignificant.

+//

+// Note that we look for both C::iterator and C::const_iterator.  The

+// reason is that C++ injects the name of a class as a member of the

+// class itself (e.g. you can refer to class iterator as either

+// 'iterator' or 'iterator::iterator').  If we look for C::iterator

+// only, for example, we would mistakenly think that a class named

+// iterator is an STL container.

+//

+// Also note that the simpler approach of overloading

+// IsContainerTest(typename C::const_iterator*) and

+// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.

+typedef int IsContainer;

+template <class C>

+IsContainer IsContainerTest(int /* dummy */,

+                            typename C::iterator* /* it */ = NULL,

+                            typename C::const_iterator* /* const_it */ = NULL) {

+  return 0;

+}

+

+typedef char IsNotContainer;

+template <class C>

+IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }

+

+// EnableIf<condition>::type is void when 'Cond' is true, and

+// undefined when 'Cond' is false.  To use SFINAE to make a function

+// overload only apply when a particular expression is true, add

+// "typename EnableIf<expression>::type* = 0" as the last parameter.

+template<bool> struct EnableIf;

+template<> struct EnableIf<true> { typedef void type; };  // NOLINT

+

+// Utilities for native arrays.

+

+// ArrayEq() compares two k-dimensional native arrays using the

+// elements' operator==, where k can be any integer >= 0.  When k is

+// 0, ArrayEq() degenerates into comparing a single pair of values.

+

+template <typename T, typename U>

+bool ArrayEq(const T* lhs, size_t size, const U* rhs);

+

+// This generic version is used when k is 0.

+template <typename T, typename U>

+inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }

+

+// This overload is used when k >= 1.

+template <typename T, typename U, size_t N>

+inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {

+  return internal::ArrayEq(lhs, N, rhs);

+}

+

+// This helper reduces code bloat.  If we instead put its logic inside

+// the previous ArrayEq() function, arrays with different sizes would

+// lead to different copies of the template code.

+template <typename T, typename U>

+bool ArrayEq(const T* lhs, size_t size, const U* rhs) {

+  for (size_t i = 0; i != size; i++) {

+    if (!internal::ArrayEq(lhs[i], rhs[i]))

+      return false;

+  }

+  return true;

+}

+

+// Finds the first element in the iterator range [begin, end) that

+// equals elem.  Element may be a native array type itself.

+template <typename Iter, typename Element>

+Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {

+  for (Iter it = begin; it != end; ++it) {

+    if (internal::ArrayEq(*it, elem))

+      return it;

+  }

+  return end;

+}

+

+// CopyArray() copies a k-dimensional native array using the elements'

+// operator=, where k can be any integer >= 0.  When k is 0,

+// CopyArray() degenerates into copying a single value.

+

+template <typename T, typename U>

+void CopyArray(const T* from, size_t size, U* to);

+

+// This generic version is used when k is 0.

+template <typename T, typename U>

+inline void CopyArray(const T& from, U* to) { *to = from; }

+

+// This overload is used when k >= 1.

+template <typename T, typename U, size_t N>

+inline void CopyArray(const T(&from)[N], U(*to)[N]) {

+  internal::CopyArray(from, N, *to);

+}

+

+// This helper reduces code bloat.  If we instead put its logic inside

+// the previous CopyArray() function, arrays with different sizes

+// would lead to different copies of the template code.

+template <typename T, typename U>

+void CopyArray(const T* from, size_t size, U* to) {

+  for (size_t i = 0; i != size; i++) {

+    internal::CopyArray(from[i], to + i);

+  }

+}

+

+// The relation between an NativeArray object (see below) and the

+// native array it represents.

+enum RelationToSource {

+  kReference,  // The NativeArray references the native array.

+  kCopy        // The NativeArray makes a copy of the native array and

+               // owns the copy.

+};

+

+// Adapts a native array to a read-only STL-style container.  Instead

+// of the complete STL container concept, this adaptor only implements

+// members useful for Google Mock's container matchers.  New members

+// should be added as needed.  To simplify the implementation, we only

+// support Element being a raw type (i.e. having no top-level const or

+// reference modifier).  It's the client's responsibility to satisfy

+// this requirement.  Element can be an array type itself (hence

+// multi-dimensional arrays are supported).

+template <typename Element>

+class NativeArray {

+ public:

+  // STL-style container typedefs.

+  typedef Element value_type;

+  typedef Element* iterator;

+  typedef const Element* const_iterator;

+

+  // Constructs from a native array.

+  NativeArray(const Element* array, size_t count, RelationToSource relation) {

+    Init(array, count, relation);

+  }

+

+  // Copy constructor.

+  NativeArray(const NativeArray& rhs) {

+    Init(rhs.array_, rhs.size_, rhs.relation_to_source_);

+  }

+

+  ~NativeArray() {

+    // Ensures that the user doesn't instantiate NativeArray with a

+    // const or reference type.

+    static_cast<void>(StaticAssertTypeEqHelper<Element,

+        GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());

+    if (relation_to_source_ == kCopy)

+      delete[] array_;

+  }

+

+  // STL-style container methods.

+  size_t size() const { return size_; }

+  const_iterator begin() const { return array_; }

+  const_iterator end() const { return array_ + size_; }

+  bool operator==(const NativeArray& rhs) const {

+    return size() == rhs.size() &&

+        ArrayEq(begin(), size(), rhs.begin());

+  }

+

+ private:

+  // Initializes this object; makes a copy of the input array if

+  // 'relation' is kCopy.

+  void Init(const Element* array, size_t a_size, RelationToSource relation) {

+    if (relation == kReference) {

+      array_ = array;

+    } else {

+      Element* const copy = new Element[a_size];

+      CopyArray(array, a_size, copy);

+      array_ = copy;

+    }

+    size_ = a_size;

+    relation_to_source_ = relation;

+  }

+

+  const Element* array_;

+  size_t size_;

+  RelationToSource relation_to_source_;

+

+  GTEST_DISALLOW_ASSIGN_(NativeArray);

+};

+

+}  // namespace internal

+}  // namespace testing

+

+#define GTEST_MESSAGE_AT_(file, line, message, result_type) \

+  ::testing::internal::AssertHelper(result_type, file, line, message) \

+    = ::testing::Message()

+

+#define GTEST_MESSAGE_(message, result_type) \

+  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)

+

+#define GTEST_FATAL_FAILURE_(message) \

+  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)

+

+#define GTEST_NONFATAL_FAILURE_(message) \

+  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)

+

+#define GTEST_SUCCESS_(message) \

+  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)

+

+// Suppresses MSVC warnings 4072 (unreachable code) for the code following

+// statement if it returns or throws (or doesn't return or throw in some

+// situations).

+#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \

+  if (::testing::internal::AlwaysTrue()) { statement; }

+

+#define GTEST_TEST_THROW_(statement, expected_exception, fail) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (::testing::internal::ConstCharPtr gtest_msg = "") { \

+    bool gtest_caught_expected = false; \

+    try { \

+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+    } \

+    catch (expected_exception const&) { \

+      gtest_caught_expected = true; \

+    } \

+    catch (...) { \

+      gtest_msg.value = \

+          "Expected: " #statement " throws an exception of type " \

+          #expected_exception ".\n  Actual: it throws a different type."; \

+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \

+    } \

+    if (!gtest_caught_expected) { \

+      gtest_msg.value = \

+          "Expected: " #statement " throws an exception of type " \

+          #expected_exception ".\n  Actual: it throws nothing."; \

+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \

+    } \

+  } else \

+    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \

+      fail(gtest_msg.value)

+

+#define GTEST_TEST_NO_THROW_(statement, fail) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (::testing::internal::AlwaysTrue()) { \

+    try { \

+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+    } \

+    catch (...) { \

+      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \

+    } \

+  } else \

+    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \

+      fail("Expected: " #statement " doesn't throw an exception.\n" \

+           "  Actual: it throws.")

+

+#define GTEST_TEST_ANY_THROW_(statement, fail) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (::testing::internal::AlwaysTrue()) { \

+    bool gtest_caught_any = false; \

+    try { \

+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+    } \

+    catch (...) { \

+      gtest_caught_any = true; \

+    } \

+    if (!gtest_caught_any) { \

+      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \

+    } \

+  } else \

+    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \

+      fail("Expected: " #statement " throws an exception.\n" \

+           "  Actual: it doesn't.")

+

+

+// Implements Boolean test assertions such as EXPECT_TRUE. expression can be

+// either a boolean expression or an AssertionResult. text is a textual

+// represenation of expression as it was passed into the EXPECT_TRUE.

+#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (const ::testing::AssertionResult gtest_ar_ = \

+      ::testing::AssertionResult(expression)) \

+    ; \

+  else \

+    fail(::testing::internal::GetBoolAssertionFailureMessage(\

+        gtest_ar_, text, #actual, #expected).c_str())

+

+#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \

+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+  if (::testing::internal::AlwaysTrue()) { \

+    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \

+    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \

+    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \

+      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \

+    } \

+  } else \

+    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \

+      fail("Expected: " #statement " doesn't generate new fatal " \

+           "failures in the current thread.\n" \

+           "  Actual: it does.")

+

+// Expands to the name of the class that implements the given test.

+#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \

+  test_case_name##_##test_name##_Test

+

+// Helper macro for defining tests.

+#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\

+class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\

+ public:\

+  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\

+ private:\

+  virtual void TestBody();\

+  static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(\

+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\

+};\

+\

+::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\

+  ::test_info_ =\

+    ::testing::internal::MakeAndRegisterTestInfo(\

+        #test_case_name, #test_name, NULL, NULL, \

+        (parent_id), \

+        parent_class::SetUpTestCase, \

+        parent_class::TearDownTestCase, \

+        new ::testing::internal::TestFactoryImpl<\

+            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\

+void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h
new file mode 100644
index 0000000..760e993
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h
@@ -0,0 +1,233 @@
+// Copyright 2003 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.

+//

+// Authors: Dan Egnor (egnor@google.com)

+//

+// A "smart" pointer type with reference tracking.  Every pointer to a

+// particular object is kept on a circular linked list.  When the last pointer

+// to an object is destroyed or reassigned, the object is deleted.

+//

+// Used properly, this deletes the object when the last reference goes away.

+// There are several caveats:

+// - Like all reference counting schemes, cycles lead to leaks.

+// - Each smart pointer is actually two pointers (8 bytes instead of 4).

+// - Every time a pointer is assigned, the entire list of pointers to that

+//   object is traversed.  This class is therefore NOT SUITABLE when there

+//   will often be more than two or three pointers to a particular object.

+// - References are only tracked as long as linked_ptr<> objects are copied.

+//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS

+//   will happen (double deletion).

+//

+// A good use of this class is storing object references in STL containers.

+// You can safely put linked_ptr<> in a vector<>.

+// Other uses may not be as good.

+//

+// Note: If you use an incomplete type with linked_ptr<>, the class

+// *containing* linked_ptr<> must have a constructor and destructor (even

+// if they do nothing!).

+//

+// Bill Gibbons suggested we use something like this.

+//

+// Thread Safety:

+//   Unlike other linked_ptr implementations, in this implementation

+//   a linked_ptr object is thread-safe in the sense that:

+//     - it's safe to copy linked_ptr objects concurrently,

+//     - it's safe to copy *from* a linked_ptr and read its underlying

+//       raw pointer (e.g. via get()) concurrently, and

+//     - it's safe to write to two linked_ptrs that point to the same

+//       shared object concurrently.

+// TODO(wan@google.com): rename this to safe_linked_ptr to avoid

+// confusion with normal linked_ptr.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_

+

+#include <stdlib.h>

+#include <assert.h>

+

+#include "gtest/internal/gtest-port.h"

+

+namespace testing {

+namespace internal {

+

+// Protects copying of all linked_ptr objects.

+GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);

+

+// This is used internally by all instances of linked_ptr<>.  It needs to be

+// a non-template class because different types of linked_ptr<> can refer to

+// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).

+// So, it needs to be possible for different types of linked_ptr to participate

+// in the same circular linked list, so we need a single class type here.

+//

+// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.

+class linked_ptr_internal {

+ public:

+  // Create a new circle that includes only this instance.

+  void join_new() {

+    next_ = this;

+  }

+

+  // Many linked_ptr operations may change p.link_ for some linked_ptr

+  // variable p in the same circle as this object.  Therefore we need

+  // to prevent two such operations from occurring concurrently.

+  //

+  // Note that different types of linked_ptr objects can coexist in a

+  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and

+  // linked_ptr<Derived2>).  Therefore we must use a single mutex to

+  // protect all linked_ptr objects.  This can create serious

+  // contention in production code, but is acceptable in a testing

+  // framework.

+

+  // Join an existing circle.

+  void join(linked_ptr_internal const* ptr)

+      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {

+    MutexLock lock(&g_linked_ptr_mutex);

+

+    linked_ptr_internal const* p = ptr;

+    while (p->next_ != ptr) p = p->next_;

+    p->next_ = this;

+    next_ = ptr;

+  }

+

+  // Leave whatever circle we're part of.  Returns true if we were the

+  // last member of the circle.  Once this is done, you can join() another.

+  bool depart()

+      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {

+    MutexLock lock(&g_linked_ptr_mutex);

+

+    if (next_ == this) return true;

+    linked_ptr_internal const* p = next_;

+    while (p->next_ != this) p = p->next_;

+    p->next_ = next_;

+    return false;

+  }

+

+ private:

+  mutable linked_ptr_internal const* next_;

+};

+

+template <typename T>

+class linked_ptr {

+ public:

+  typedef T element_type;

+

+  // Take over ownership of a raw pointer.  This should happen as soon as

+  // possible after the object is created.

+  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }

+  ~linked_ptr() { depart(); }

+

+  // Copy an existing linked_ptr<>, adding ourselves to the list of references.

+  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }

+  linked_ptr(linked_ptr const& ptr) {  // NOLINT

+    assert(&ptr != this);

+    copy(&ptr);

+  }

+

+  // Assignment releases the old value and acquires the new.

+  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {

+    depart();

+    copy(&ptr);

+    return *this;

+  }

+

+  linked_ptr& operator=(linked_ptr const& ptr) {

+    if (&ptr != this) {

+      depart();

+      copy(&ptr);

+    }

+    return *this;

+  }

+

+  // Smart pointer members.

+  void reset(T* ptr = NULL) {

+    depart();

+    capture(ptr);

+  }

+  T* get() const { return value_; }

+  T* operator->() const { return value_; }

+  T& operator*() const { return *value_; }

+

+  bool operator==(T* p) const { return value_ == p; }

+  bool operator!=(T* p) const { return value_ != p; }

+  template <typename U>

+  bool operator==(linked_ptr<U> const& ptr) const {

+    return value_ == ptr.get();

+  }

+  template <typename U>

+  bool operator!=(linked_ptr<U> const& ptr) const {

+    return value_ != ptr.get();

+  }

+

+ private:

+  template <typename U>

+  friend class linked_ptr;

+

+  T* value_;

+  linked_ptr_internal link_;

+

+  void depart() {

+    if (link_.depart()) delete value_;

+  }

+

+  void capture(T* ptr) {

+    value_ = ptr;

+    link_.join_new();

+  }

+

+  template <typename U> void copy(linked_ptr<U> const* ptr) {

+    value_ = ptr->get();

+    if (value_)

+      link_.join(&ptr->link_);

+    else

+      link_.join_new();

+  }

+};

+

+template<typename T> inline

+bool operator==(T* ptr, const linked_ptr<T>& x) {

+  return ptr == x.get();

+}

+

+template<typename T> inline

+bool operator!=(T* ptr, const linked_ptr<T>& x) {

+  return ptr != x.get();

+}

+

+// A function to convert T* into linked_ptr<T>

+// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation

+// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))

+template <typename T>

+linked_ptr<T> make_linked_ptr(T* ptr) {

+  return linked_ptr<T>(ptr);

+}

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h
new file mode 100644
index 0000000..607ca51
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h
@@ -0,0 +1,5143 @@
+// This file was GENERATED by command:

+//     pump.py gtest-param-util-generated.h.pump

+// DO NOT EDIT BY HAND!!!

+

+// 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: vladl@google.com (Vlad Losev)

+

+// Type and function utilities for implementing parameterized tests.

+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!

+//

+// Currently Google Test supports at most 50 arguments in Values,

+// and at most 10 arguments in Combine. Please contact

+// googletestframework@googlegroups.com if you need more.

+// Please note that the number of arguments to Combine is limited

+// by the maximum arity of the implementation of tr1::tuple which is

+// currently set at 10.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_

+

+// scripts/fuse_gtest.py depends on gtest's own header being #included

+// *unconditionally*.  Therefore these #includes cannot be moved

+// inside #if GTEST_HAS_PARAM_TEST.

+#include "gtest/internal/gtest-param-util.h"

+#include "gtest/internal/gtest-port.h"

+

+#if GTEST_HAS_PARAM_TEST

+

+namespace testing {

+

+// Forward declarations of ValuesIn(), which is implemented in

+// include/gtest/gtest-param-test.h.

+template <typename ForwardIterator>

+internal::ParamGenerator<

+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>

+ValuesIn(ForwardIterator begin, ForwardIterator end);

+

+template <typename T, size_t N>

+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);

+

+template <class Container>

+internal::ParamGenerator<typename Container::value_type> ValuesIn(

+    const Container& container);

+

+namespace internal {

+

+// Used in the Values() function to provide polymorphic capabilities.

+template <typename T1>

+class ValueArray1 {

+ public:

+  explicit ValueArray1(T1 v1) : v1_(v1) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray1& other);

+

+  const T1 v1_;

+};

+

+template <typename T1, typename T2>

+class ValueArray2 {

+ public:

+  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray2& other);

+

+  const T1 v1_;

+  const T2 v2_;

+};

+

+template <typename T1, typename T2, typename T3>

+class ValueArray3 {

+ public:

+  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray3& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4>

+class ValueArray4 {

+ public:

+  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray4& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+class ValueArray5 {

+ public:

+  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4), v5_(v5) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray5& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+class ValueArray6 {

+ public:

+  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),

+      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray6& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+class ValueArray7 {

+ public:

+  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),

+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray7& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+class ValueArray8 {

+ public:

+  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,

+      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray8& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+class ValueArray9 {

+ public:

+  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,

+      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray9& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+class ValueArray10 {

+ public:

+  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray10& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11>

+class ValueArray11 {

+ public:

+  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),

+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray11& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12>

+class ValueArray12 {

+ public:

+  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),

+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray12& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13>

+class ValueArray13 {

+ public:

+  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),

+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),

+      v12_(v12), v13_(v13) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray13& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14>

+class ValueArray14 {

+ public:

+  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray14& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15>

+class ValueArray15 {

+ public:

+  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),

+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray15& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16>

+class ValueArray16 {

+ public:

+  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),

+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),

+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),

+      v16_(v16) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray16& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17>

+class ValueArray17 {

+ public:

+  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,

+      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray17& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18>

+class ValueArray18 {

+ public:

+  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray18& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19>

+class ValueArray19 {

+ public:

+  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),

+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),

+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray19& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20>

+class ValueArray20 {

+ public:

+  ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),

+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),

+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),

+      v19_(v19), v20_(v20) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray20& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21>

+class ValueArray21 {

+ public:

+  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),

+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),

+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),

+      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray21& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22>

+class ValueArray22 {

+ public:

+  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray22& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23>

+class ValueArray23 {

+ public:

+  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),

+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray23& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24>

+class ValueArray24 {

+ public:

+  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),

+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),

+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),

+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),

+      v22_(v22), v23_(v23), v24_(v24) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray24& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25>

+class ValueArray25 {

+ public:

+  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,

+      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray25& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26>

+class ValueArray26 {

+ public:

+  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray26& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27>

+class ValueArray27 {

+ public:

+  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),

+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),

+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),

+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),

+      v26_(v26), v27_(v27) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray27& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28>

+class ValueArray28 {

+ public:

+  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),

+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),

+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),

+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),

+      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray28& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29>

+class ValueArray29 {

+ public:

+  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),

+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),

+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),

+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),

+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray29& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30>

+class ValueArray30 {

+ public:

+  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),

+      v29_(v29), v30_(v30) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray30& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31>

+class ValueArray31 {

+ public:

+  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),

+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),

+      v29_(v29), v30_(v30), v31_(v31) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray31& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32>

+class ValueArray32 {

+ public:

+  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),

+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),

+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),

+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),

+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),

+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray32& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33>

+class ValueArray33 {

+ public:

+  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,

+      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),

+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),

+      v33_(v33) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray33& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34>

+class ValueArray34 {

+ public:

+  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),

+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),

+      v33_(v33), v34_(v34) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray34& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35>

+class ValueArray35 {

+ public:

+  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),

+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),

+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),

+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),

+      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),

+      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray35& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36>

+class ValueArray36 {

+ public:

+  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),

+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),

+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),

+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),

+      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),

+      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray36& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37>

+class ValueArray37 {

+ public:

+  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),

+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),

+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),

+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),

+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),

+      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),

+      v36_(v36), v37_(v37) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray37& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38>

+class ValueArray38 {

+ public:

+  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),

+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),

+      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray38& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39>

+class ValueArray39 {

+ public:

+  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),

+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),

+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),

+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray39& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40>

+class ValueArray40 {

+ public:

+  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),

+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),

+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),

+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),

+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),

+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),

+      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),

+      v40_(v40) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray40& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41>

+class ValueArray41 {

+ public:

+  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,

+      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),

+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),

+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),

+      v39_(v39), v40_(v40), v41_(v41) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray41& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42>

+class ValueArray42 {

+ public:

+  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),

+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),

+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),

+      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray42& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43>

+class ValueArray43 {

+ public:

+  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),

+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),

+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),

+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),

+      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),

+      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),

+      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray43& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44>

+class ValueArray44 {

+ public:

+  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),

+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),

+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),

+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),

+      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),

+      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),

+      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),

+      v43_(v43), v44_(v44) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray44& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45>

+class ValueArray45 {

+ public:

+  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),

+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),

+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),

+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),

+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),

+      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),

+      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),

+      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),

+        static_cast<T>(v45_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray45& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+  const T45 v45_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46>

+class ValueArray46 {

+ public:

+  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),

+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),

+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),

+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),

+      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),

+        static_cast<T>(v45_), static_cast<T>(v46_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray46& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+  const T45 v45_;

+  const T46 v46_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47>

+class ValueArray47 {

+ public:

+  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),

+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),

+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),

+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),

+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),

+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),

+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),

+      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),

+      v47_(v47) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),

+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray47& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+  const T45 v45_;

+  const T46 v46_;

+  const T47 v47_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48>

+class ValueArray48 {

+ public:

+  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),

+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),

+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),

+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),

+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),

+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),

+      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),

+      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),

+      v46_(v46), v47_(v47), v48_(v48) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),

+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),

+        static_cast<T>(v48_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray48& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+  const T45 v45_;

+  const T46 v46_;

+  const T47 v47_;

+  const T48 v48_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49>

+class ValueArray49 {

+ public:

+  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,

+      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),

+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),

+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),

+      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),

+      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),

+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),

+        static_cast<T>(v48_), static_cast<T>(v49_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray49& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+  const T45 v45_;

+  const T46 v46_;

+  const T47 v47_;

+  const T48 v48_;

+  const T49 v49_;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49, typename T50>

+class ValueArray50 {

+ public:

+  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,

+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,

+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,

+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,

+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,

+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,

+      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),

+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),

+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),

+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),

+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),

+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),

+      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),

+      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),

+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),

+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),

+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),

+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),

+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),

+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),

+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),

+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),

+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),

+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),

+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),

+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),

+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),

+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),

+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),

+        static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray50& other);

+

+  const T1 v1_;

+  const T2 v2_;

+  const T3 v3_;

+  const T4 v4_;

+  const T5 v5_;

+  const T6 v6_;

+  const T7 v7_;

+  const T8 v8_;

+  const T9 v9_;

+  const T10 v10_;

+  const T11 v11_;

+  const T12 v12_;

+  const T13 v13_;

+  const T14 v14_;

+  const T15 v15_;

+  const T16 v16_;

+  const T17 v17_;

+  const T18 v18_;

+  const T19 v19_;

+  const T20 v20_;

+  const T21 v21_;

+  const T22 v22_;

+  const T23 v23_;

+  const T24 v24_;

+  const T25 v25_;

+  const T26 v26_;

+  const T27 v27_;

+  const T28 v28_;

+  const T29 v29_;

+  const T30 v30_;

+  const T31 v31_;

+  const T32 v32_;

+  const T33 v33_;

+  const T34 v34_;

+  const T35 v35_;

+  const T36 v36_;

+  const T37 v37_;

+  const T38 v38_;

+  const T39 v39_;

+  const T40 v40_;

+  const T41 v41_;

+  const T42 v42_;

+  const T43 v43_;

+  const T44 v44_;

+  const T45 v45_;

+  const T46 v46_;

+  const T47 v47_;

+  const T48 v48_;

+  const T49 v49_;

+  const T50 v50_;

+};

+

+# if GTEST_HAS_COMBINE

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Generates values from the Cartesian product of values produced

+// by the argument generators.

+//

+template <typename T1, typename T2>

+class CartesianProductGenerator2

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2> ParamType;

+

+  CartesianProductGenerator2(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2)

+      : g1_(g1), g2_(g2) {}

+  virtual ~CartesianProductGenerator2() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current2_;

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator2::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator2& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+};  // class CartesianProductGenerator2

+

+

+template <typename T1, typename T2, typename T3>

+class CartesianProductGenerator3

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3> ParamType;

+

+  CartesianProductGenerator3(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)

+      : g1_(g1), g2_(g2), g3_(g3) {}

+  virtual ~CartesianProductGenerator3() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current3_;

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator3::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator3& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+};  // class CartesianProductGenerator3

+

+

+template <typename T1, typename T2, typename T3, typename T4>

+class CartesianProductGenerator4

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;

+

+  CartesianProductGenerator4(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}

+  virtual ~CartesianProductGenerator4() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current4_;

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator4::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator4& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+};  // class CartesianProductGenerator4

+

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+class CartesianProductGenerator5

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;

+

+  CartesianProductGenerator5(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}

+  virtual ~CartesianProductGenerator5() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end(), g5_, g5_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4,

+      const ParamGenerator<T5>& g5,

+      const typename ParamGenerator<T5>::iterator& current5)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),

+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current5_;

+      if (current5_ == end5_) {

+        current5_ = begin5_;

+        ++current4_;

+      }

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_ &&

+          current5_ == typed_other->current5_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_),

+        begin5_(other.begin5_),

+        end5_(other.end5_),

+        current5_(other.current5_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_, *current5_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_ ||

+          current5_ == end5_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    const typename ParamGenerator<T5>::iterator begin5_;

+    const typename ParamGenerator<T5>::iterator end5_;

+    typename ParamGenerator<T5>::iterator current5_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator5::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator5& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+  const ParamGenerator<T5> g5_;

+};  // class CartesianProductGenerator5

+

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+class CartesianProductGenerator6

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,

+        T6> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;

+

+  CartesianProductGenerator6(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,

+      const ParamGenerator<T6>& g6)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}

+  virtual ~CartesianProductGenerator6() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4,

+      const ParamGenerator<T5>& g5,

+      const typename ParamGenerator<T5>::iterator& current5,

+      const ParamGenerator<T6>& g6,

+      const typename ParamGenerator<T6>::iterator& current6)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),

+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),

+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current6_;

+      if (current6_ == end6_) {

+        current6_ = begin6_;

+        ++current5_;

+      }

+      if (current5_ == end5_) {

+        current5_ = begin5_;

+        ++current4_;

+      }

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_ &&

+          current5_ == typed_other->current5_ &&

+          current6_ == typed_other->current6_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_),

+        begin5_(other.begin5_),

+        end5_(other.end5_),

+        current5_(other.current5_),

+        begin6_(other.begin6_),

+        end6_(other.end6_),

+        current6_(other.current6_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_, *current5_, *current6_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_ ||

+          current5_ == end5_ ||

+          current6_ == end6_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    const typename ParamGenerator<T5>::iterator begin5_;

+    const typename ParamGenerator<T5>::iterator end5_;

+    typename ParamGenerator<T5>::iterator current5_;

+    const typename ParamGenerator<T6>::iterator begin6_;

+    const typename ParamGenerator<T6>::iterator end6_;

+    typename ParamGenerator<T6>::iterator current6_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator6::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator6& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+  const ParamGenerator<T5> g5_;

+  const ParamGenerator<T6> g6_;

+};  // class CartesianProductGenerator6

+

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+class CartesianProductGenerator7

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,

+        T7> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;

+

+  CartesianProductGenerator7(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,

+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}

+  virtual ~CartesianProductGenerator7() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,

+        g7_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4,

+      const ParamGenerator<T5>& g5,

+      const typename ParamGenerator<T5>::iterator& current5,

+      const ParamGenerator<T6>& g6,

+      const typename ParamGenerator<T6>::iterator& current6,

+      const ParamGenerator<T7>& g7,

+      const typename ParamGenerator<T7>::iterator& current7)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),

+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),

+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),

+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current7_;

+      if (current7_ == end7_) {

+        current7_ = begin7_;

+        ++current6_;

+      }

+      if (current6_ == end6_) {

+        current6_ = begin6_;

+        ++current5_;

+      }

+      if (current5_ == end5_) {

+        current5_ = begin5_;

+        ++current4_;

+      }

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_ &&

+          current5_ == typed_other->current5_ &&

+          current6_ == typed_other->current6_ &&

+          current7_ == typed_other->current7_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_),

+        begin5_(other.begin5_),

+        end5_(other.end5_),

+        current5_(other.current5_),

+        begin6_(other.begin6_),

+        end6_(other.end6_),

+        current6_(other.current6_),

+        begin7_(other.begin7_),

+        end7_(other.end7_),

+        current7_(other.current7_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_, *current5_, *current6_, *current7_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_ ||

+          current5_ == end5_ ||

+          current6_ == end6_ ||

+          current7_ == end7_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    const typename ParamGenerator<T5>::iterator begin5_;

+    const typename ParamGenerator<T5>::iterator end5_;

+    typename ParamGenerator<T5>::iterator current5_;

+    const typename ParamGenerator<T6>::iterator begin6_;

+    const typename ParamGenerator<T6>::iterator end6_;

+    typename ParamGenerator<T6>::iterator current6_;

+    const typename ParamGenerator<T7>::iterator begin7_;

+    const typename ParamGenerator<T7>::iterator end7_;

+    typename ParamGenerator<T7>::iterator current7_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator7::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator7& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+  const ParamGenerator<T5> g5_;

+  const ParamGenerator<T6> g6_;

+  const ParamGenerator<T7> g7_;

+};  // class CartesianProductGenerator7

+

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+class CartesianProductGenerator8

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,

+        T7, T8> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;

+

+  CartesianProductGenerator8(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,

+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,

+      const ParamGenerator<T8>& g8)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),

+          g8_(g8) {}

+  virtual ~CartesianProductGenerator8() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,

+        g7_.begin(), g8_, g8_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,

+        g8_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4,

+      const ParamGenerator<T5>& g5,

+      const typename ParamGenerator<T5>::iterator& current5,

+      const ParamGenerator<T6>& g6,

+      const typename ParamGenerator<T6>::iterator& current6,

+      const ParamGenerator<T7>& g7,

+      const typename ParamGenerator<T7>::iterator& current7,

+      const ParamGenerator<T8>& g8,

+      const typename ParamGenerator<T8>::iterator& current8)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),

+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),

+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),

+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),

+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current8_;

+      if (current8_ == end8_) {

+        current8_ = begin8_;

+        ++current7_;

+      }

+      if (current7_ == end7_) {

+        current7_ = begin7_;

+        ++current6_;

+      }

+      if (current6_ == end6_) {

+        current6_ = begin6_;

+        ++current5_;

+      }

+      if (current5_ == end5_) {

+        current5_ = begin5_;

+        ++current4_;

+      }

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_ &&

+          current5_ == typed_other->current5_ &&

+          current6_ == typed_other->current6_ &&

+          current7_ == typed_other->current7_ &&

+          current8_ == typed_other->current8_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_),

+        begin5_(other.begin5_),

+        end5_(other.end5_),

+        current5_(other.current5_),

+        begin6_(other.begin6_),

+        end6_(other.end6_),

+        current6_(other.current6_),

+        begin7_(other.begin7_),

+        end7_(other.end7_),

+        current7_(other.current7_),

+        begin8_(other.begin8_),

+        end8_(other.end8_),

+        current8_(other.current8_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_, *current5_, *current6_, *current7_, *current8_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_ ||

+          current5_ == end5_ ||

+          current6_ == end6_ ||

+          current7_ == end7_ ||

+          current8_ == end8_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    const typename ParamGenerator<T5>::iterator begin5_;

+    const typename ParamGenerator<T5>::iterator end5_;

+    typename ParamGenerator<T5>::iterator current5_;

+    const typename ParamGenerator<T6>::iterator begin6_;

+    const typename ParamGenerator<T6>::iterator end6_;

+    typename ParamGenerator<T6>::iterator current6_;

+    const typename ParamGenerator<T7>::iterator begin7_;

+    const typename ParamGenerator<T7>::iterator end7_;

+    typename ParamGenerator<T7>::iterator current7_;

+    const typename ParamGenerator<T8>::iterator begin8_;

+    const typename ParamGenerator<T8>::iterator end8_;

+    typename ParamGenerator<T8>::iterator current8_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator8::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator8& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+  const ParamGenerator<T5> g5_;

+  const ParamGenerator<T6> g6_;

+  const ParamGenerator<T7> g7_;

+  const ParamGenerator<T8> g8_;

+};  // class CartesianProductGenerator8

+

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+class CartesianProductGenerator9

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,

+        T7, T8, T9> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;

+

+  CartesianProductGenerator9(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,

+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,

+      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),

+          g9_(g9) {}

+  virtual ~CartesianProductGenerator9() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,

+        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,

+        g8_.end(), g9_, g9_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4,

+      const ParamGenerator<T5>& g5,

+      const typename ParamGenerator<T5>::iterator& current5,

+      const ParamGenerator<T6>& g6,

+      const typename ParamGenerator<T6>::iterator& current6,

+      const ParamGenerator<T7>& g7,

+      const typename ParamGenerator<T7>::iterator& current7,

+      const ParamGenerator<T8>& g8,

+      const typename ParamGenerator<T8>::iterator& current8,

+      const ParamGenerator<T9>& g9,

+      const typename ParamGenerator<T9>::iterator& current9)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),

+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),

+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),

+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),

+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),

+          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current9_;

+      if (current9_ == end9_) {

+        current9_ = begin9_;

+        ++current8_;

+      }

+      if (current8_ == end8_) {

+        current8_ = begin8_;

+        ++current7_;

+      }

+      if (current7_ == end7_) {

+        current7_ = begin7_;

+        ++current6_;

+      }

+      if (current6_ == end6_) {

+        current6_ = begin6_;

+        ++current5_;

+      }

+      if (current5_ == end5_) {

+        current5_ = begin5_;

+        ++current4_;

+      }

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_ &&

+          current5_ == typed_other->current5_ &&

+          current6_ == typed_other->current6_ &&

+          current7_ == typed_other->current7_ &&

+          current8_ == typed_other->current8_ &&

+          current9_ == typed_other->current9_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_),

+        begin5_(other.begin5_),

+        end5_(other.end5_),

+        current5_(other.current5_),

+        begin6_(other.begin6_),

+        end6_(other.end6_),

+        current6_(other.current6_),

+        begin7_(other.begin7_),

+        end7_(other.end7_),

+        current7_(other.current7_),

+        begin8_(other.begin8_),

+        end8_(other.end8_),

+        current8_(other.current8_),

+        begin9_(other.begin9_),

+        end9_(other.end9_),

+        current9_(other.current9_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_, *current5_, *current6_, *current7_, *current8_,

+            *current9_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_ ||

+          current5_ == end5_ ||

+          current6_ == end6_ ||

+          current7_ == end7_ ||

+          current8_ == end8_ ||

+          current9_ == end9_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    const typename ParamGenerator<T5>::iterator begin5_;

+    const typename ParamGenerator<T5>::iterator end5_;

+    typename ParamGenerator<T5>::iterator current5_;

+    const typename ParamGenerator<T6>::iterator begin6_;

+    const typename ParamGenerator<T6>::iterator end6_;

+    typename ParamGenerator<T6>::iterator current6_;

+    const typename ParamGenerator<T7>::iterator begin7_;

+    const typename ParamGenerator<T7>::iterator end7_;

+    typename ParamGenerator<T7>::iterator current7_;

+    const typename ParamGenerator<T8>::iterator begin8_;

+    const typename ParamGenerator<T8>::iterator end8_;

+    typename ParamGenerator<T8>::iterator current8_;

+    const typename ParamGenerator<T9>::iterator begin9_;

+    const typename ParamGenerator<T9>::iterator end9_;

+    typename ParamGenerator<T9>::iterator current9_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator9::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator9& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+  const ParamGenerator<T5> g5_;

+  const ParamGenerator<T6> g6_;

+  const ParamGenerator<T7> g7_;

+  const ParamGenerator<T8> g8_;

+  const ParamGenerator<T9> g9_;

+};  // class CartesianProductGenerator9

+

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+class CartesianProductGenerator10

+    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,

+        T7, T8, T9, T10> > {

+ public:

+  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;

+

+  CartesianProductGenerator10(const ParamGenerator<T1>& g1,

+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,

+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,

+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,

+      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,

+      const ParamGenerator<T10>& g10)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),

+          g9_(g9), g10_(g10) {}

+  virtual ~CartesianProductGenerator10() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,

+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,

+        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),

+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,

+        g8_.end(), g9_, g9_.end(), g10_, g10_.end());

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base,

+      const ParamGenerator<T1>& g1,

+      const typename ParamGenerator<T1>::iterator& current1,

+      const ParamGenerator<T2>& g2,

+      const typename ParamGenerator<T2>::iterator& current2,

+      const ParamGenerator<T3>& g3,

+      const typename ParamGenerator<T3>::iterator& current3,

+      const ParamGenerator<T4>& g4,

+      const typename ParamGenerator<T4>::iterator& current4,

+      const ParamGenerator<T5>& g5,

+      const typename ParamGenerator<T5>::iterator& current5,

+      const ParamGenerator<T6>& g6,

+      const typename ParamGenerator<T6>::iterator& current6,

+      const ParamGenerator<T7>& g7,

+      const typename ParamGenerator<T7>::iterator& current7,

+      const ParamGenerator<T8>& g8,

+      const typename ParamGenerator<T8>::iterator& current8,

+      const ParamGenerator<T9>& g9,

+      const typename ParamGenerator<T9>::iterator& current9,

+      const ParamGenerator<T10>& g10,

+      const typename ParamGenerator<T10>::iterator& current10)

+        : base_(base),

+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),

+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),

+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),

+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),

+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),

+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),

+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),

+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),

+          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),

+          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current10_;

+      if (current10_ == end10_) {

+        current10_ = begin10_;

+        ++current9_;

+      }

+      if (current9_ == end9_) {

+        current9_ = begin9_;

+        ++current8_;

+      }

+      if (current8_ == end8_) {

+        current8_ = begin8_;

+        ++current7_;

+      }

+      if (current7_ == end7_) {

+        current7_ = begin7_;

+        ++current6_;

+      }

+      if (current6_ == end6_) {

+        current6_ = begin6_;

+        ++current5_;

+      }

+      if (current5_ == end5_) {

+        current5_ = begin5_;

+        ++current4_;

+      }

+      if (current4_ == end4_) {

+        current4_ = begin4_;

+        ++current3_;

+      }

+      if (current3_ == end3_) {

+        current3_ = begin3_;

+        ++current2_;

+      }

+      if (current2_ == end2_) {

+        current2_ = begin2_;

+        ++current1_;

+      }

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         (

+          current1_ == typed_other->current1_ &&

+          current2_ == typed_other->current2_ &&

+          current3_ == typed_other->current3_ &&

+          current4_ == typed_other->current4_ &&

+          current5_ == typed_other->current5_ &&

+          current6_ == typed_other->current6_ &&

+          current7_ == typed_other->current7_ &&

+          current8_ == typed_other->current8_ &&

+          current9_ == typed_other->current9_ &&

+          current10_ == typed_other->current10_);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_),

+        begin1_(other.begin1_),

+        end1_(other.end1_),

+        current1_(other.current1_),

+        begin2_(other.begin2_),

+        end2_(other.end2_),

+        current2_(other.current2_),

+        begin3_(other.begin3_),

+        end3_(other.end3_),

+        current3_(other.current3_),

+        begin4_(other.begin4_),

+        end4_(other.end4_),

+        current4_(other.current4_),

+        begin5_(other.begin5_),

+        end5_(other.end5_),

+        current5_(other.current5_),

+        begin6_(other.begin6_),

+        end6_(other.end6_),

+        current6_(other.current6_),

+        begin7_(other.begin7_),

+        end7_(other.end7_),

+        current7_(other.current7_),

+        begin8_(other.begin8_),

+        end8_(other.end8_),

+        current8_(other.current8_),

+        begin9_(other.begin9_),

+        end9_(other.end9_),

+        current9_(other.current9_),

+        begin10_(other.begin10_),

+        end10_(other.end10_),

+        current10_(other.current10_) {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType(*current1_, *current2_, *current3_,

+            *current4_, *current5_, *current6_, *current7_, *current8_,

+            *current9_, *current10_);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+          current1_ == end1_ ||

+          current2_ == end2_ ||

+          current3_ == end3_ ||

+          current4_ == end4_ ||

+          current5_ == end5_ ||

+          current6_ == end6_ ||

+          current7_ == end7_ ||

+          current8_ == end8_ ||

+          current9_ == end9_ ||

+          current10_ == end10_;

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+    const typename ParamGenerator<T1>::iterator begin1_;

+    const typename ParamGenerator<T1>::iterator end1_;

+    typename ParamGenerator<T1>::iterator current1_;

+    const typename ParamGenerator<T2>::iterator begin2_;

+    const typename ParamGenerator<T2>::iterator end2_;

+    typename ParamGenerator<T2>::iterator current2_;

+    const typename ParamGenerator<T3>::iterator begin3_;

+    const typename ParamGenerator<T3>::iterator end3_;

+    typename ParamGenerator<T3>::iterator current3_;

+    const typename ParamGenerator<T4>::iterator begin4_;

+    const typename ParamGenerator<T4>::iterator end4_;

+    typename ParamGenerator<T4>::iterator current4_;

+    const typename ParamGenerator<T5>::iterator begin5_;

+    const typename ParamGenerator<T5>::iterator end5_;

+    typename ParamGenerator<T5>::iterator current5_;

+    const typename ParamGenerator<T6>::iterator begin6_;

+    const typename ParamGenerator<T6>::iterator end6_;

+    typename ParamGenerator<T6>::iterator current6_;

+    const typename ParamGenerator<T7>::iterator begin7_;

+    const typename ParamGenerator<T7>::iterator end7_;

+    typename ParamGenerator<T7>::iterator current7_;

+    const typename ParamGenerator<T8>::iterator begin8_;

+    const typename ParamGenerator<T8>::iterator end8_;

+    typename ParamGenerator<T8>::iterator current8_;

+    const typename ParamGenerator<T9>::iterator begin9_;

+    const typename ParamGenerator<T9>::iterator end9_;

+    typename ParamGenerator<T9>::iterator current9_;

+    const typename ParamGenerator<T10>::iterator begin10_;

+    const typename ParamGenerator<T10>::iterator end10_;

+    typename ParamGenerator<T10>::iterator current10_;

+    ParamType current_value_;

+  };  // class CartesianProductGenerator10::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator10& other);

+

+  const ParamGenerator<T1> g1_;

+  const ParamGenerator<T2> g2_;

+  const ParamGenerator<T3> g3_;

+  const ParamGenerator<T4> g4_;

+  const ParamGenerator<T5> g5_;

+  const ParamGenerator<T6> g6_;

+  const ParamGenerator<T7> g7_;

+  const ParamGenerator<T8> g8_;

+  const ParamGenerator<T9> g9_;

+  const ParamGenerator<T10> g10_;

+};  // class CartesianProductGenerator10

+

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Helper classes providing Combine() with polymorphic features. They allow

+// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is

+// convertible to U.

+//

+template <class Generator1, class Generator2>

+class CartesianProductHolder2 {

+ public:

+CartesianProductHolder2(const Generator1& g1, const Generator2& g2)

+      : g1_(g1), g2_(g2) {}

+  template <typename T1, typename T2>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2> >(

+        new CartesianProductGenerator2<T1, T2>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder2& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+};  // class CartesianProductHolder2

+

+template <class Generator1, class Generator2, class Generator3>

+class CartesianProductHolder3 {

+ public:

+CartesianProductHolder3(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3)

+      : g1_(g1), g2_(g2), g3_(g3) {}

+  template <typename T1, typename T2, typename T3>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(

+        new CartesianProductGenerator3<T1, T2, T3>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder3& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+};  // class CartesianProductHolder3

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4>

+class CartesianProductHolder4 {

+ public:

+CartesianProductHolder4(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}

+  template <typename T1, typename T2, typename T3, typename T4>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(

+        new CartesianProductGenerator4<T1, T2, T3, T4>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder4& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+};  // class CartesianProductHolder4

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4, class Generator5>

+class CartesianProductHolder5 {

+ public:

+CartesianProductHolder5(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4, const Generator5& g5)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}

+  template <typename T1, typename T2, typename T3, typename T4, typename T5>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(

+        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_),

+        static_cast<ParamGenerator<T5> >(g5_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder5& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+  const Generator5 g5_;

+};  // class CartesianProductHolder5

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4, class Generator5, class Generator6>

+class CartesianProductHolder6 {

+ public:

+CartesianProductHolder6(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4, const Generator5& g5,

+    const Generator6& g6)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}

+  template <typename T1, typename T2, typename T3, typename T4, typename T5,

+      typename T6>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(

+        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_),

+        static_cast<ParamGenerator<T5> >(g5_),

+        static_cast<ParamGenerator<T6> >(g6_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder6& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+  const Generator5 g5_;

+  const Generator6 g6_;

+};  // class CartesianProductHolder6

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4, class Generator5, class Generator6, class Generator7>

+class CartesianProductHolder7 {

+ public:

+CartesianProductHolder7(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4, const Generator5& g5,

+    const Generator6& g6, const Generator7& g7)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}

+  template <typename T1, typename T2, typename T3, typename T4, typename T5,

+      typename T6, typename T7>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,

+      T7> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(

+        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_),

+        static_cast<ParamGenerator<T5> >(g5_),

+        static_cast<ParamGenerator<T6> >(g6_),

+        static_cast<ParamGenerator<T7> >(g7_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder7& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+  const Generator5 g5_;

+  const Generator6 g6_;

+  const Generator7 g7_;

+};  // class CartesianProductHolder7

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4, class Generator5, class Generator6, class Generator7,

+    class Generator8>

+class CartesianProductHolder8 {

+ public:

+CartesianProductHolder8(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4, const Generator5& g5,

+    const Generator6& g6, const Generator7& g7, const Generator8& g8)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),

+          g8_(g8) {}

+  template <typename T1, typename T2, typename T3, typename T4, typename T5,

+      typename T6, typename T7, typename T8>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,

+      T8> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(

+        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_),

+        static_cast<ParamGenerator<T5> >(g5_),

+        static_cast<ParamGenerator<T6> >(g6_),

+        static_cast<ParamGenerator<T7> >(g7_),

+        static_cast<ParamGenerator<T8> >(g8_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder8& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+  const Generator5 g5_;

+  const Generator6 g6_;

+  const Generator7 g7_;

+  const Generator8 g8_;

+};  // class CartesianProductHolder8

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4, class Generator5, class Generator6, class Generator7,

+    class Generator8, class Generator9>

+class CartesianProductHolder9 {

+ public:

+CartesianProductHolder9(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4, const Generator5& g5,

+    const Generator6& g6, const Generator7& g7, const Generator8& g8,

+    const Generator9& g9)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),

+          g9_(g9) {}

+  template <typename T1, typename T2, typename T3, typename T4, typename T5,

+      typename T6, typename T7, typename T8, typename T9>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,

+      T9> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,

+        T9> >(

+        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_),

+        static_cast<ParamGenerator<T5> >(g5_),

+        static_cast<ParamGenerator<T6> >(g6_),

+        static_cast<ParamGenerator<T7> >(g7_),

+        static_cast<ParamGenerator<T8> >(g8_),

+        static_cast<ParamGenerator<T9> >(g9_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder9& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+  const Generator5 g5_;

+  const Generator6 g6_;

+  const Generator7 g7_;

+  const Generator8 g8_;

+  const Generator9 g9_;

+};  // class CartesianProductHolder9

+

+template <class Generator1, class Generator2, class Generator3,

+    class Generator4, class Generator5, class Generator6, class Generator7,

+    class Generator8, class Generator9, class Generator10>

+class CartesianProductHolder10 {

+ public:

+CartesianProductHolder10(const Generator1& g1, const Generator2& g2,

+    const Generator3& g3, const Generator4& g4, const Generator5& g5,

+    const Generator6& g6, const Generator7& g7, const Generator8& g8,

+    const Generator9& g9, const Generator10& g10)

+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),

+          g9_(g9), g10_(g10) {}

+  template <typename T1, typename T2, typename T3, typename T4, typename T5,

+      typename T6, typename T7, typename T8, typename T9, typename T10>

+  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,

+      T9, T10> >() const {

+    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,

+        T9, T10> >(

+        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,

+            T10>(

+        static_cast<ParamGenerator<T1> >(g1_),

+        static_cast<ParamGenerator<T2> >(g2_),

+        static_cast<ParamGenerator<T3> >(g3_),

+        static_cast<ParamGenerator<T4> >(g4_),

+        static_cast<ParamGenerator<T5> >(g5_),

+        static_cast<ParamGenerator<T6> >(g6_),

+        static_cast<ParamGenerator<T7> >(g7_),

+        static_cast<ParamGenerator<T8> >(g8_),

+        static_cast<ParamGenerator<T9> >(g9_),

+        static_cast<ParamGenerator<T10> >(g10_)));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder10& other);

+

+  const Generator1 g1_;

+  const Generator2 g2_;

+  const Generator3 g3_;

+  const Generator4 g4_;

+  const Generator5 g5_;

+  const Generator6 g6_;

+  const Generator7 g7_;

+  const Generator8 g8_;

+  const Generator9 g9_;

+  const Generator10 g10_;

+};  // class CartesianProductHolder10

+

+# endif  // GTEST_HAS_COMBINE

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  //  GTEST_HAS_PARAM_TEST

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
new file mode 100644
index 0000000..d5a35e4
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
@@ -0,0 +1,301 @@
+$$ -*- mode: c++; -*-

+$var n = 50  $$ Maximum length of Values arguments we want to support.

+$var maxtuple = 10  $$ Maximum number of Combine arguments we want to support.

+// 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: vladl@google.com (Vlad Losev)

+

+// Type and function utilities for implementing parameterized tests.

+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!

+//

+// Currently Google Test supports at most $n arguments in Values,

+// and at most $maxtuple arguments in Combine. Please contact

+// googletestframework@googlegroups.com if you need more.

+// Please note that the number of arguments to Combine is limited

+// by the maximum arity of the implementation of tr1::tuple which is

+// currently set at $maxtuple.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_

+

+// scripts/fuse_gtest.py depends on gtest's own header being #included

+// *unconditionally*.  Therefore these #includes cannot be moved

+// inside #if GTEST_HAS_PARAM_TEST.

+#include "gtest/internal/gtest-param-util.h"

+#include "gtest/internal/gtest-port.h"

+

+#if GTEST_HAS_PARAM_TEST

+

+namespace testing {

+

+// Forward declarations of ValuesIn(), which is implemented in

+// include/gtest/gtest-param-test.h.

+template <typename ForwardIterator>

+internal::ParamGenerator<

+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>

+ValuesIn(ForwardIterator begin, ForwardIterator end);

+

+template <typename T, size_t N>

+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);

+

+template <class Container>

+internal::ParamGenerator<typename Container::value_type> ValuesIn(

+    const Container& container);

+

+namespace internal {

+

+// Used in the Values() function to provide polymorphic capabilities.

+template <typename T1>

+class ValueArray1 {

+ public:

+  explicit ValueArray1(T1 v1) : v1_(v1) {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray1& other);

+

+  const T1 v1_;

+};

+

+$range i 2..n

+$for i [[

+$range j 1..i

+

+template <$for j, [[typename T$j]]>

+class ValueArray$i {

+ public:

+  ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}

+

+  template <typename T>

+  operator ParamGenerator<T>() const {

+    const T array[] = {$for j, [[static_cast<T>(v$(j)_)]]};

+    return ValuesIn(array);

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const ValueArray$i& other);

+

+$for j [[

+

+  const T$j v$(j)_;

+]]

+

+};

+

+]]

+

+# if GTEST_HAS_COMBINE

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Generates values from the Cartesian product of values produced

+// by the argument generators.

+//

+$range i 2..maxtuple

+$for i [[

+$range j 1..i

+$range k 2..i

+

+template <$for j, [[typename T$j]]>

+class CartesianProductGenerator$i

+    : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > {

+ public:

+  typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType;

+

+  CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])

+      : $for j, [[g$(j)_(g$j)]] {}

+  virtual ~CartesianProductGenerator$i() {}

+

+  virtual ParamIteratorInterface<ParamType>* Begin() const {

+    return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]);

+  }

+  virtual ParamIteratorInterface<ParamType>* End() const {

+    return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]);

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<ParamType> {

+   public:

+    Iterator(const ParamGeneratorInterface<ParamType>* base, $for j, [[

+

+      const ParamGenerator<T$j>& g$j,

+      const typename ParamGenerator<T$j>::iterator& current$(j)]])

+        : base_(base),

+$for j, [[

+

+          begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j)

+]]    {

+      ComputeCurrentValue();

+    }

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {

+      return base_;

+    }

+    // Advance should not be called on beyond-of-range iterators

+    // so no component iterators must be beyond end of range, either.

+    virtual void Advance() {

+      assert(!AtEnd());

+      ++current$(i)_;

+

+$for k [[

+      if (current$(i+2-k)_ == end$(i+2-k)_) {

+        current$(i+2-k)_ = begin$(i+2-k)_;

+        ++current$(i+2-k-1)_;

+      }

+

+]]

+      ComputeCurrentValue();

+    }

+    virtual ParamIteratorInterface<ParamType>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const ParamType* Current() const { return &current_value_; }

+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const Iterator* typed_other =

+          CheckedDowncastToActualType<const Iterator>(&other);

+      // We must report iterators equal if they both point beyond their

+      // respective ranges. That can happen in a variety of fashions,

+      // so we have to consult AtEnd().

+      return (AtEnd() && typed_other->AtEnd()) ||

+         ($for j  && [[

+

+          current$(j)_ == typed_other->current$(j)_

+]]);

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : base_(other.base_), $for j, [[

+

+        begin$(j)_(other.begin$(j)_),

+        end$(j)_(other.end$(j)_),

+        current$(j)_(other.current$(j)_)

+]] {

+      ComputeCurrentValue();

+    }

+

+    void ComputeCurrentValue() {

+      if (!AtEnd())

+        current_value_ = ParamType($for j, [[*current$(j)_]]);

+    }

+    bool AtEnd() const {

+      // We must report iterator past the end of the range when either of the

+      // component iterators has reached the end of its range.

+      return

+$for j  || [[

+

+          current$(j)_ == end$(j)_

+]];

+    }

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<ParamType>* const base_;

+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.

+    // current[i]_ is the actual traversing iterator.

+$for j [[

+

+    const typename ParamGenerator<T$j>::iterator begin$(j)_;

+    const typename ParamGenerator<T$j>::iterator end$(j)_;

+    typename ParamGenerator<T$j>::iterator current$(j)_;

+]]

+

+    ParamType current_value_;

+  };  // class CartesianProductGenerator$i::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductGenerator$i& other);

+

+

+$for j [[

+  const ParamGenerator<T$j> g$(j)_;

+

+]]

+};  // class CartesianProductGenerator$i

+

+

+]]

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Helper classes providing Combine() with polymorphic features. They allow

+// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is

+// convertible to U.

+//

+$range i 2..maxtuple

+$for i [[

+$range j 1..i

+

+template <$for j, [[class Generator$j]]>

+class CartesianProductHolder$i {

+ public:

+CartesianProductHolder$i($for j, [[const Generator$j& g$j]])

+      : $for j, [[g$(j)_(g$j)]] {}

+  template <$for j, [[typename T$j]]>

+  operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const {

+    return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >(

+        new CartesianProductGenerator$i<$for j, [[T$j]]>(

+$for j,[[

+

+        static_cast<ParamGenerator<T$j> >(g$(j)_)

+]]));

+  }

+

+ private:

+  // No implementation - assignment is unsupported.

+  void operator=(const CartesianProductHolder$i& other);

+

+

+$for j [[

+  const Generator$j g$(j)_;

+

+]]

+};  // class CartesianProductHolder$i

+

+]]

+

+# endif  // GTEST_HAS_COMBINE

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  //  GTEST_HAS_PARAM_TEST

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h
new file mode 100644
index 0000000..6e1cccc
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h
@@ -0,0 +1,619 @@
+// 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: vladl@google.com (Vlad Losev)

+

+// Type and function utilities for implementing parameterized tests.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

+

+#include <iterator>

+#include <utility>

+#include <vector>

+

+// scripts/fuse_gtest.py depends on gtest's own header being #included

+// *unconditionally*.  Therefore these #includes cannot be moved

+// inside #if GTEST_HAS_PARAM_TEST.

+#include "gtest/internal/gtest-internal.h"

+#include "gtest/internal/gtest-linked_ptr.h"

+#include "gtest/internal/gtest-port.h"

+#include "gtest/gtest-printers.h"

+

+#if GTEST_HAS_PARAM_TEST

+

+namespace testing {

+namespace internal {

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Outputs a message explaining invalid registration of different

+// fixture class for the same test case. This may happen when

+// TEST_P macro is used to define two tests with the same name

+// but in different namespaces.

+GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,

+                                          const char* file, int line);

+

+template <typename> class ParamGeneratorInterface;

+template <typename> class ParamGenerator;

+

+// Interface for iterating over elements provided by an implementation

+// of ParamGeneratorInterface<T>.

+template <typename T>

+class ParamIteratorInterface {

+ public:

+  virtual ~ParamIteratorInterface() {}

+  // A pointer to the base generator instance.

+  // Used only for the purposes of iterator comparison

+  // to make sure that two iterators belong to the same generator.

+  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;

+  // Advances iterator to point to the next element

+  // provided by the generator. The caller is responsible

+  // for not calling Advance() on an iterator equal to

+  // BaseGenerator()->End().

+  virtual void Advance() = 0;

+  // Clones the iterator object. Used for implementing copy semantics

+  // of ParamIterator<T>.

+  virtual ParamIteratorInterface* Clone() const = 0;

+  // Dereferences the current iterator and provides (read-only) access

+  // to the pointed value. It is the caller's responsibility not to call

+  // Current() on an iterator equal to BaseGenerator()->End().

+  // Used for implementing ParamGenerator<T>::operator*().

+  virtual const T* Current() const = 0;

+  // Determines whether the given iterator and other point to the same

+  // element in the sequence generated by the generator.

+  // Used for implementing ParamGenerator<T>::operator==().

+  virtual bool Equals(const ParamIteratorInterface& other) const = 0;

+};

+

+// Class iterating over elements provided by an implementation of

+// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>

+// and implements the const forward iterator concept.

+template <typename T>

+class ParamIterator {

+ public:

+  typedef T value_type;

+  typedef const T& reference;

+  typedef ptrdiff_t difference_type;

+

+  // ParamIterator assumes ownership of the impl_ pointer.

+  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}

+  ParamIterator& operator=(const ParamIterator& other) {

+    if (this != &other)

+      impl_.reset(other.impl_->Clone());

+    return *this;

+  }

+

+  const T& operator*() const { return *impl_->Current(); }

+  const T* operator->() const { return impl_->Current(); }

+  // Prefix version of operator++.

+  ParamIterator& operator++() {

+    impl_->Advance();

+    return *this;

+  }

+  // Postfix version of operator++.

+  ParamIterator operator++(int /*unused*/) {

+    ParamIteratorInterface<T>* clone = impl_->Clone();

+    impl_->Advance();

+    return ParamIterator(clone);

+  }

+  bool operator==(const ParamIterator& other) const {

+    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);

+  }

+  bool operator!=(const ParamIterator& other) const {

+    return !(*this == other);

+  }

+

+ private:

+  friend class ParamGenerator<T>;

+  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}

+  scoped_ptr<ParamIteratorInterface<T> > impl_;

+};

+

+// ParamGeneratorInterface<T> is the binary interface to access generators

+// defined in other translation units.

+template <typename T>

+class ParamGeneratorInterface {

+ public:

+  typedef T ParamType;

+

+  virtual ~ParamGeneratorInterface() {}

+

+  // Generator interface definition

+  virtual ParamIteratorInterface<T>* Begin() const = 0;

+  virtual ParamIteratorInterface<T>* End() const = 0;

+};

+

+// Wraps ParamGeneratorInterface<T> and provides general generator syntax

+// compatible with the STL Container concept.

+// This class implements copy initialization semantics and the contained

+// ParamGeneratorInterface<T> instance is shared among all copies

+// of the original object. This is possible because that instance is immutable.

+template<typename T>

+class ParamGenerator {

+ public:

+  typedef ParamIterator<T> iterator;

+

+  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}

+  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}

+

+  ParamGenerator& operator=(const ParamGenerator& other) {

+    impl_ = other.impl_;

+    return *this;

+  }

+

+  iterator begin() const { return iterator(impl_->Begin()); }

+  iterator end() const { return iterator(impl_->End()); }

+

+ private:

+  linked_ptr<const ParamGeneratorInterface<T> > impl_;

+};

+

+// Generates values from a range of two comparable values. Can be used to

+// generate sequences of user-defined types that implement operator+() and

+// operator<().

+// This class is used in the Range() function.

+template <typename T, typename IncrementT>

+class RangeGenerator : public ParamGeneratorInterface<T> {

+ public:

+  RangeGenerator(T begin, T end, IncrementT step)

+      : begin_(begin), end_(end),

+        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}

+  virtual ~RangeGenerator() {}

+

+  virtual ParamIteratorInterface<T>* Begin() const {

+    return new Iterator(this, begin_, 0, step_);

+  }

+  virtual ParamIteratorInterface<T>* End() const {

+    return new Iterator(this, end_, end_index_, step_);

+  }

+

+ private:

+  class Iterator : public ParamIteratorInterface<T> {

+   public:

+    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,

+             IncrementT step)

+        : base_(base), value_(value), index_(index), step_(step) {}

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {

+      return base_;

+    }

+    virtual void Advance() {

+      value_ = value_ + step_;

+      index_++;

+    }

+    virtual ParamIteratorInterface<T>* Clone() const {

+      return new Iterator(*this);

+    }

+    virtual const T* Current() const { return &value_; }

+    virtual bool Equals(const ParamIteratorInterface<T>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      const int other_index =

+          CheckedDowncastToActualType<const Iterator>(&other)->index_;

+      return index_ == other_index;

+    }

+

+   private:

+    Iterator(const Iterator& other)

+        : ParamIteratorInterface<T>(),

+          base_(other.base_), value_(other.value_), index_(other.index_),

+          step_(other.step_) {}

+

+    // No implementation - assignment is unsupported.

+    void operator=(const Iterator& other);

+

+    const ParamGeneratorInterface<T>* const base_;

+    T value_;

+    int index_;

+    const IncrementT step_;

+  };  // class RangeGenerator::Iterator

+

+  static int CalculateEndIndex(const T& begin,

+                               const T& end,

+                               const IncrementT& step) {

+    int end_index = 0;

+    for (T i = begin; i < end; i = i + step)

+      end_index++;

+    return end_index;

+  }

+

+  // No implementation - assignment is unsupported.

+  void operator=(const RangeGenerator& other);

+

+  const T begin_;

+  const T end_;

+  const IncrementT step_;

+  // The index for the end() iterator. All the elements in the generated

+  // sequence are indexed (0-based) to aid iterator comparison.

+  const int end_index_;

+};  // class RangeGenerator

+

+

+// Generates values from a pair of STL-style iterators. Used in the

+// ValuesIn() function. The elements are copied from the source range

+// since the source can be located on the stack, and the generator

+// is likely to persist beyond that stack frame.

+template <typename T>

+class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {

+ public:

+  template <typename ForwardIterator>

+  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)

+      : container_(begin, end) {}

+  virtual ~ValuesInIteratorRangeGenerator() {}

+

+  virtual ParamIteratorInterface<T>* Begin() const {

+    return new Iterator(this, container_.begin());

+  }

+  virtual ParamIteratorInterface<T>* End() const {

+    return new Iterator(this, container_.end());

+  }

+

+ private:

+  typedef typename ::std::vector<T> ContainerType;

+

+  class Iterator : public ParamIteratorInterface<T> {

+   public:

+    Iterator(const ParamGeneratorInterface<T>* base,

+             typename ContainerType::const_iterator iterator)

+        : base_(base), iterator_(iterator) {}

+    virtual ~Iterator() {}

+

+    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {

+      return base_;

+    }

+    virtual void Advance() {

+      ++iterator_;

+      value_.reset();

+    }

+    virtual ParamIteratorInterface<T>* Clone() const {

+      return new Iterator(*this);

+    }

+    // We need to use cached value referenced by iterator_ because *iterator_

+    // can return a temporary object (and of type other then T), so just

+    // having "return &*iterator_;" doesn't work.

+    // value_ is updated here and not in Advance() because Advance()

+    // can advance iterator_ beyond the end of the range, and we cannot

+    // detect that fact. The client code, on the other hand, is

+    // responsible for not calling Current() on an out-of-range iterator.

+    virtual const T* Current() const {

+      if (value_.get() == NULL)

+        value_.reset(new T(*iterator_));

+      return value_.get();

+    }

+    virtual bool Equals(const ParamIteratorInterface<T>& other) const {

+      // Having the same base generator guarantees that the other

+      // iterator is of the same type and we can downcast.

+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())

+          << "The program attempted to compare iterators "

+          << "from different generators." << std::endl;

+      return iterator_ ==

+          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;

+    }

+

+   private:

+    Iterator(const Iterator& other)

+          // The explicit constructor call suppresses a false warning

+          // emitted by gcc when supplied with the -Wextra option.

+        : ParamIteratorInterface<T>(),

+          base_(other.base_),

+          iterator_(other.iterator_) {}

+

+    const ParamGeneratorInterface<T>* const base_;

+    typename ContainerType::const_iterator iterator_;

+    // A cached value of *iterator_. We keep it here to allow access by

+    // pointer in the wrapping iterator's operator->().

+    // value_ needs to be mutable to be accessed in Current().

+    // Use of scoped_ptr helps manage cached value's lifetime,

+    // which is bound by the lifespan of the iterator itself.

+    mutable scoped_ptr<const T> value_;

+  };  // class ValuesInIteratorRangeGenerator::Iterator

+

+  // No implementation - assignment is unsupported.

+  void operator=(const ValuesInIteratorRangeGenerator& other);

+

+  const ContainerType container_;

+};  // class ValuesInIteratorRangeGenerator

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Stores a parameter value and later creates tests parameterized with that

+// value.

+template <class TestClass>

+class ParameterizedTestFactory : public TestFactoryBase {

+ public:

+  typedef typename TestClass::ParamType ParamType;

+  explicit ParameterizedTestFactory(ParamType parameter) :

+      parameter_(parameter) {}

+  virtual Test* CreateTest() {

+    TestClass::SetParam(&parameter_);

+    return new TestClass();

+  }

+

+ private:

+  const ParamType parameter_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);

+};

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// TestMetaFactoryBase is a base class for meta-factories that create

+// test factories for passing into MakeAndRegisterTestInfo function.

+template <class ParamType>

+class TestMetaFactoryBase {

+ public:

+  virtual ~TestMetaFactoryBase() {}

+

+  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;

+};

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// TestMetaFactory creates test factories for passing into

+// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives

+// ownership of test factory pointer, same factory object cannot be passed

+// into that method twice. But ParameterizedTestCaseInfo is going to call

+// it for each Test/Parameter value combination. Thus it needs meta factory

+// creator class.

+template <class TestCase>

+class TestMetaFactory

+    : public TestMetaFactoryBase<typename TestCase::ParamType> {

+ public:

+  typedef typename TestCase::ParamType ParamType;

+

+  TestMetaFactory() {}

+

+  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {

+    return new ParameterizedTestFactory<TestCase>(parameter);

+  }

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);

+};

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// ParameterizedTestCaseInfoBase is a generic interface

+// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase

+// accumulates test information provided by TEST_P macro invocations

+// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations

+// and uses that information to register all resulting test instances

+// in RegisterTests method. The ParameterizeTestCaseRegistry class holds

+// a collection of pointers to the ParameterizedTestCaseInfo objects

+// and calls RegisterTests() on each of them when asked.

+class ParameterizedTestCaseInfoBase {

+ public:

+  virtual ~ParameterizedTestCaseInfoBase() {}

+

+  // Base part of test case name for display purposes.

+  virtual const string& GetTestCaseName() const = 0;

+  // Test case id to verify identity.

+  virtual TypeId GetTestCaseTypeId() const = 0;

+  // UnitTest class invokes this method to register tests in this

+  // test case right before running them in RUN_ALL_TESTS macro.

+  // This method should not be called more then once on any single

+  // instance of a ParameterizedTestCaseInfoBase derived class.

+  virtual void RegisterTests() = 0;

+

+ protected:

+  ParameterizedTestCaseInfoBase() {}

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);

+};

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P

+// macro invocations for a particular test case and generators

+// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that

+// test case. It registers tests with all values generated by all

+// generators when asked.

+template <class TestCase>

+class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {

+ public:

+  // ParamType and GeneratorCreationFunc are private types but are required

+  // for declarations of public methods AddTestPattern() and

+  // AddTestCaseInstantiation().

+  typedef typename TestCase::ParamType ParamType;

+  // A function that returns an instance of appropriate generator type.

+  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();

+

+  explicit ParameterizedTestCaseInfo(const char* name)

+      : test_case_name_(name) {}

+

+  // Test case base name for display purposes.

+  virtual const string& GetTestCaseName() const { return test_case_name_; }

+  // Test case id to verify identity.

+  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }

+  // TEST_P macro uses AddTestPattern() to record information

+  // about a single test in a LocalTestInfo structure.

+  // test_case_name is the base name of the test case (without invocation

+  // prefix). test_base_name is the name of an individual test without

+  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is

+  // test case base name and DoBar is test base name.

+  void AddTestPattern(const char* test_case_name,

+                      const char* test_base_name,

+                      TestMetaFactoryBase<ParamType>* meta_factory) {

+    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,

+                                                       test_base_name,

+                                                       meta_factory)));

+  }

+  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information

+  // about a generator.

+  int AddTestCaseInstantiation(const string& instantiation_name,

+                               GeneratorCreationFunc* func,

+                               const char* /* file */,

+                               int /* line */) {

+    instantiations_.push_back(::std::make_pair(instantiation_name, func));

+    return 0;  // Return value used only to run this method in namespace scope.

+  }

+  // UnitTest class invokes this method to register tests in this test case

+  // test cases right before running tests in RUN_ALL_TESTS macro.

+  // This method should not be called more then once on any single

+  // instance of a ParameterizedTestCaseInfoBase derived class.

+  // UnitTest has a guard to prevent from calling this method more then once.

+  virtual void RegisterTests() {

+    for (typename TestInfoContainer::iterator test_it = tests_.begin();

+         test_it != tests_.end(); ++test_it) {

+      linked_ptr<TestInfo> test_info = *test_it;

+      for (typename InstantiationContainer::iterator gen_it =

+               instantiations_.begin(); gen_it != instantiations_.end();

+               ++gen_it) {

+        const string& instantiation_name = gen_it->first;

+        ParamGenerator<ParamType> generator((*gen_it->second)());

+

+        string test_case_name;

+        if ( !instantiation_name.empty() )

+          test_case_name = instantiation_name + "/";

+        test_case_name += test_info->test_case_base_name;

+

+        int i = 0;

+        for (typename ParamGenerator<ParamType>::iterator param_it =

+                 generator.begin();

+             param_it != generator.end(); ++param_it, ++i) {

+          Message test_name_stream;

+          test_name_stream << test_info->test_base_name << "/" << i;

+          MakeAndRegisterTestInfo(

+              test_case_name.c_str(),

+              test_name_stream.GetString().c_str(),

+              NULL,  // No type parameter.

+              PrintToString(*param_it).c_str(),

+              GetTestCaseTypeId(),

+              TestCase::SetUpTestCase,

+              TestCase::TearDownTestCase,

+              test_info->test_meta_factory->CreateTestFactory(*param_it));

+        }  // for param_it

+      }  // for gen_it

+    }  // for test_it

+  }  // RegisterTests

+

+ private:

+  // LocalTestInfo structure keeps information about a single test registered

+  // with TEST_P macro.

+  struct TestInfo {

+    TestInfo(const char* a_test_case_base_name,

+             const char* a_test_base_name,

+             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :

+        test_case_base_name(a_test_case_base_name),

+        test_base_name(a_test_base_name),

+        test_meta_factory(a_test_meta_factory) {}

+

+    const string test_case_base_name;

+    const string test_base_name;

+    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;

+  };

+  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;

+  // Keeps pairs of <Instantiation name, Sequence generator creation function>

+  // received from INSTANTIATE_TEST_CASE_P macros.

+  typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >

+      InstantiationContainer;

+

+  const string test_case_name_;

+  TestInfoContainer tests_;

+  InstantiationContainer instantiations_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);

+};  // class ParameterizedTestCaseInfo

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase

+// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P

+// macros use it to locate their corresponding ParameterizedTestCaseInfo

+// descriptors.

+class ParameterizedTestCaseRegistry {

+ public:

+  ParameterizedTestCaseRegistry() {}

+  ~ParameterizedTestCaseRegistry() {

+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();

+         it != test_case_infos_.end(); ++it) {

+      delete *it;

+    }

+  }

+

+  // Looks up or creates and returns a structure containing information about

+  // tests and instantiations of a particular test case.

+  template <class TestCase>

+  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(

+      const char* test_case_name,

+      const char* file,

+      int line) {

+    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;

+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();

+         it != test_case_infos_.end(); ++it) {

+      if ((*it)->GetTestCaseName() == test_case_name) {

+        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {

+          // Complain about incorrect usage of Google Test facilities

+          // and terminate the program since we cannot guaranty correct

+          // test case setup and tear-down in this case.

+          ReportInvalidTestCaseType(test_case_name,  file, line);

+          posix::Abort();

+        } else {

+          // At this point we are sure that the object we found is of the same

+          // type we are looking for, so we downcast it to that type

+          // without further checks.

+          typed_test_info = CheckedDowncastToActualType<

+              ParameterizedTestCaseInfo<TestCase> >(*it);

+        }

+        break;

+      }

+    }

+    if (typed_test_info == NULL) {

+      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);

+      test_case_infos_.push_back(typed_test_info);

+    }

+    return typed_test_info;

+  }

+  void RegisterTests() {

+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();

+         it != test_case_infos_.end(); ++it) {

+      (*it)->RegisterTests();

+    }

+  }

+

+ private:

+  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;

+

+  TestCaseInfoContainer test_case_infos_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);

+};

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  //  GTEST_HAS_PARAM_TEST

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-port.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-port.h
new file mode 100644
index 0000000..191ccc2
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-port.h
@@ -0,0 +1,1947 @@
+// Copyright 2005, 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.

+//

+// Authors: wan@google.com (Zhanyong Wan)

+//

+// Low-level types and utilities for porting Google Test to various

+// platforms.  They are subject to change without notice.  DO NOT USE

+// THEM IN USER CODE.

+//

+// This file is fundamental to Google Test.  All other Google Test source

+// files are expected to #include this.  Therefore, it cannot #include

+// any other Google Test header.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_

+

+// The user can define the following macros in the build script to

+// control Google Test's behavior.  If the user doesn't define a macro

+// in this list, Google Test will define it.

+//

+//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)

+//                              is/isn't available.

+//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions

+//                              are enabled.

+//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string

+//                              is/isn't available (some systems define

+//                              ::string, which is different to std::string).

+//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string

+//                              is/isn't available (some systems define

+//                              ::wstring, which is different to std::wstring).

+//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular

+//                              expressions are/aren't available.

+//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>

+//                              is/isn't available.

+//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't

+//                              enabled.

+//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that

+//                              std::wstring does/doesn't work (Google Test can

+//                              be used where std::wstring is unavailable).

+//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple

+//                              is/isn't available.

+//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the

+//                              compiler supports Microsoft's "Structured

+//                              Exception Handling".

+//   GTEST_HAS_STREAM_REDIRECTION

+//                            - Define it to 1/0 to indicate whether the

+//                              platform supports I/O stream redirection using

+//                              dup() and dup2().

+//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google

+//                              Test's own tr1 tuple implementation should be

+//                              used.  Unused when the user sets

+//                              GTEST_HAS_TR1_TUPLE to 0.

+//   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test

+//                              is building in C++11/C++98 mode.

+//   GTEST_LINKED_AS_SHARED_LIBRARY

+//                            - Define to 1 when compiling tests that use

+//                              Google Test as a shared library (known as

+//                              DLL on Windows).

+//   GTEST_CREATE_SHARED_LIBRARY

+//                            - Define to 1 when compiling Google Test itself

+//                              as a shared library.

+

+// This header defines the following utilities:

+//

+// Macros indicating the current platform (defined to 1 if compiled on

+// the given platform; otherwise undefined):

+//   GTEST_OS_AIX      - IBM AIX

+//   GTEST_OS_CYGWIN   - Cygwin

+//   GTEST_OS_HPUX     - HP-UX

+//   GTEST_OS_LINUX    - Linux

+//     GTEST_OS_LINUX_ANDROID - Google Android

+//   GTEST_OS_MAC      - Mac OS X

+//     GTEST_OS_IOS    - iOS

+//       GTEST_OS_IOS_SIMULATOR - iOS simulator

+//   GTEST_OS_NACL     - Google Native Client (NaCl)

+//   GTEST_OS_OPENBSD  - OpenBSD

+//   GTEST_OS_QNX      - QNX

+//   GTEST_OS_SOLARIS  - Sun Solaris

+//   GTEST_OS_SYMBIAN  - Symbian

+//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)

+//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop

+//     GTEST_OS_WINDOWS_MINGW    - MinGW

+//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile

+//   GTEST_OS_ZOS      - z/OS

+//

+// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the

+// most stable support.  Since core members of the Google Test project

+// don't have access to other platforms, support for them may be less

+// stable.  If you notice any problems on your platform, please notify

+// googletestframework@googlegroups.com (patches for fixing them are

+// even more welcome!).

+//

+// Note that it is possible that none of the GTEST_OS_* macros are defined.

+//

+// Macros indicating available Google Test features (defined to 1 if

+// the corresponding feature is supported; otherwise undefined):

+//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized

+//                            tests)

+//   GTEST_HAS_DEATH_TEST   - death tests

+//   GTEST_HAS_PARAM_TEST   - value-parameterized tests

+//   GTEST_HAS_TYPED_TEST   - typed tests

+//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests

+//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with

+//                            GTEST_HAS_POSIX_RE (see above) which users can

+//                            define themselves.

+//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;

+//                            the above two are mutually exclusive.

+//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().

+//

+// Macros for basic C++ coding:

+//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.

+//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a

+//                              variable don't have to be used.

+//   GTEST_DISALLOW_ASSIGN_   - disables operator=.

+//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.

+//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.

+//

+// Synchronization:

+//   Mutex, MutexLock, ThreadLocal, GetThreadCount()

+//                  - synchronization primitives.

+//   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above

+//                         synchronization primitives have real implementations

+//                         and Google Test is thread-safe; or 0 otherwise.

+//

+// Template meta programming:

+//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.

+//   IteratorTraits - partial implementation of std::iterator_traits, which

+//                    is not available in libCstd when compiled with Sun C++.

+//

+// Smart pointers:

+//   scoped_ptr     - as in TR2.

+//

+// Regular expressions:

+//   RE             - a simple regular expression class using the POSIX

+//                    Extended Regular Expression syntax on UNIX-like

+//                    platforms, or a reduced regular exception syntax on

+//                    other platforms, including Windows.

+//

+// Logging:

+//   GTEST_LOG_()   - logs messages at the specified severity level.

+//   LogToStderr()  - directs all log messages to stderr.

+//   FlushInfoLog() - flushes informational log messages.

+//

+// Stdout and stderr capturing:

+//   CaptureStdout()     - starts capturing stdout.

+//   GetCapturedStdout() - stops capturing stdout and returns the captured

+//                         string.

+//   CaptureStderr()     - starts capturing stderr.

+//   GetCapturedStderr() - stops capturing stderr and returns the captured

+//                         string.

+//

+// Integer types:

+//   TypeWithSize   - maps an integer to a int type.

+//   Int32, UInt32, Int64, UInt64, TimeInMillis

+//                  - integers of known sizes.

+//   BiggestInt     - the biggest signed integer type.

+//

+// Command-line utilities:

+//   GTEST_FLAG()       - references a flag.

+//   GTEST_DECLARE_*()  - declares a flag.

+//   GTEST_DEFINE_*()   - defines a flag.

+//   GetInjectableArgvs() - returns the command line as a vector of strings.

+//

+// Environment variable utilities:

+//   GetEnv()             - gets the value of an environment variable.

+//   BoolFromGTestEnv()   - parses a bool environment variable.

+//   Int32FromGTestEnv()  - parses an Int32 environment variable.

+//   StringFromGTestEnv() - parses a string environment variable.

+

+#include <ctype.h>   // for isspace, etc

+#include <stddef.h>  // for ptrdiff_t

+#include <stdlib.h>

+#include <stdio.h>

+#include <string.h>

+#ifndef _WIN32_WCE

+# include <sys/types.h>

+# include <sys/stat.h>

+#endif  // !_WIN32_WCE

+

+#if defined __APPLE__

+# include <AvailabilityMacros.h>

+# include <TargetConditionals.h>

+#endif

+

+#include <iostream>  // NOLINT

+#include <sstream>  // NOLINT

+#include <string>  // NOLINT

+

+#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"

+#define GTEST_FLAG_PREFIX_ "gtest_"

+#define GTEST_FLAG_PREFIX_DASH_ "gtest-"

+#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"

+#define GTEST_NAME_ "Google Test"

+#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"

+

+// Determines the version of gcc that is used to compile this.

+#ifdef __GNUC__

+// 40302 means version 4.3.2.

+# define GTEST_GCC_VER_ \

+    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)

+#endif  // __GNUC__

+

+// Determines the platform on which Google Test is compiled.

+#ifdef __CYGWIN__

+# define GTEST_OS_CYGWIN 1

+#elif defined __SYMBIAN32__

+# define GTEST_OS_SYMBIAN 1

+#elif defined _WIN32

+# define GTEST_OS_WINDOWS 1

+# ifdef _WIN32_WCE

+#  define GTEST_OS_WINDOWS_MOBILE 1

+# elif defined(__MINGW__) || defined(__MINGW32__)

+#  define GTEST_OS_WINDOWS_MINGW 1

+# else

+#  define GTEST_OS_WINDOWS_DESKTOP 1

+# endif  // _WIN32_WCE

+#elif defined __APPLE__

+# define GTEST_OS_MAC 1

+# if TARGET_OS_IPHONE

+#  define GTEST_OS_IOS 1

+#  if TARGET_IPHONE_SIMULATOR

+#   define GTEST_OS_IOS_SIMULATOR 1

+#  endif

+# endif

+#elif defined __linux__

+# define GTEST_OS_LINUX 1

+# if defined __ANDROID__

+#  define GTEST_OS_LINUX_ANDROID 1

+# endif

+#elif defined __MVS__

+# define GTEST_OS_ZOS 1

+#elif defined(__sun) && defined(__SVR4)

+# define GTEST_OS_SOLARIS 1

+#elif defined(_AIX)

+# define GTEST_OS_AIX 1

+#elif defined(__hpux)

+# define GTEST_OS_HPUX 1

+#elif defined __native_client__

+# define GTEST_OS_NACL 1

+#elif defined __OpenBSD__

+# define GTEST_OS_OPENBSD 1

+#elif defined __QNX__

+# define GTEST_OS_QNX 1

+#endif  // __CYGWIN__

+

+#ifndef GTEST_LANG_CXX11

+// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when

+// -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a

+// value for __cplusplus, and recent versions of clang, gcc, and

+// probably other compilers set that too in C++11 mode.

+# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L

+// Compiling in at least C++11 mode.

+#  define GTEST_LANG_CXX11 1

+# else

+#  define GTEST_LANG_CXX11 0

+# endif

+#endif

+

+// Brings in definitions for functions used in the testing::internal::posix

+// namespace (read, write, close, chdir, isatty, stat). We do not currently

+// use them on Windows Mobile.

+#if !GTEST_OS_WINDOWS

+// This assumes that non-Windows OSes provide unistd.h. For OSes where this

+// is not the case, we need to include headers that provide the functions

+// mentioned above.

+# include <unistd.h>

+# include <strings.h>

+#elif !GTEST_OS_WINDOWS_MOBILE

+# include <direct.h>

+# include <io.h>

+#endif

+

+#if GTEST_OS_LINUX_ANDROID

+// Used to define __ANDROID_API__ matching the target NDK API level.

+#  include <android/api-level.h>  // NOLINT

+#endif

+

+// Defines this to true iff Google Test can use POSIX regular expressions.

+#ifndef GTEST_HAS_POSIX_RE

+# if GTEST_OS_LINUX_ANDROID

+// On Android, <regex.h> is only available starting with Gingerbread.

+#  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)

+# else

+#  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)

+# endif

+#endif

+

+#if GTEST_HAS_POSIX_RE

+

+// On some platforms, <regex.h> needs someone to define size_t, and

+// won't compile otherwise.  We can #include it here as we already

+// included <stdlib.h>, which is guaranteed to define size_t through

+// <stddef.h>.

+# include <regex.h>  // NOLINT

+

+# define GTEST_USES_POSIX_RE 1

+

+#elif GTEST_OS_WINDOWS

+

+// <regex.h> is not available on Windows.  Use our own simple regex

+// implementation instead.

+# define GTEST_USES_SIMPLE_RE 1

+

+#else

+

+// <regex.h> may not be available on this platform.  Use our own

+// simple regex implementation instead.

+# define GTEST_USES_SIMPLE_RE 1

+

+#endif  // GTEST_HAS_POSIX_RE

+

+#ifndef GTEST_HAS_EXCEPTIONS

+// The user didn't tell us whether exceptions are enabled, so we need

+// to figure it out.

+# if defined(_MSC_VER) || defined(__BORLANDC__)

+// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS

+// macro to enable exceptions, so we'll do the same.

+// Assumes that exceptions are enabled by default.

+#  ifndef _HAS_EXCEPTIONS

+#   define _HAS_EXCEPTIONS 1

+#  endif  // _HAS_EXCEPTIONS

+#  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS

+# elif defined(__GNUC__) && __EXCEPTIONS

+// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.

+#  define GTEST_HAS_EXCEPTIONS 1

+# elif defined(__SUNPRO_CC)

+// Sun Pro CC supports exceptions.  However, there is no compile-time way of

+// detecting whether they are enabled or not.  Therefore, we assume that

+// they are enabled unless the user tells us otherwise.

+#  define GTEST_HAS_EXCEPTIONS 1

+# elif defined(__IBMCPP__) && __EXCEPTIONS

+// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.

+#  define GTEST_HAS_EXCEPTIONS 1

+# elif defined(__HP_aCC)

+// Exception handling is in effect by default in HP aCC compiler. It has to

+// be turned of by +noeh compiler option if desired.

+#  define GTEST_HAS_EXCEPTIONS 1

+# else

+// For other compilers, we assume exceptions are disabled to be

+// conservative.

+#  define GTEST_HAS_EXCEPTIONS 0

+# endif  // defined(_MSC_VER) || defined(__BORLANDC__)

+#endif  // GTEST_HAS_EXCEPTIONS

+

+#if !defined(GTEST_HAS_STD_STRING)

+// Even though we don't use this macro any longer, we keep it in case

+// some clients still depend on it.

+# define GTEST_HAS_STD_STRING 1

+#elif !GTEST_HAS_STD_STRING

+// The user told us that ::std::string isn't available.

+# error "Google Test cannot be used where ::std::string isn't available."

+#endif  // !defined(GTEST_HAS_STD_STRING)

+

+#ifndef GTEST_HAS_GLOBAL_STRING

+// The user didn't tell us whether ::string is available, so we need

+// to figure it out.

+

+# define GTEST_HAS_GLOBAL_STRING 0

+

+#endif  // GTEST_HAS_GLOBAL_STRING

+

+#ifndef GTEST_HAS_STD_WSTRING

+// The user didn't tell us whether ::std::wstring is available, so we need

+// to figure it out.

+// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring

+//   is available.

+

+// Cygwin 1.7 and below doesn't support ::std::wstring.

+// Solaris' libc++ doesn't support it either.  Android has

+// no support for it at least as recent as Froyo (2.2).

+# define GTEST_HAS_STD_WSTRING \

+    (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))

+

+#endif  // GTEST_HAS_STD_WSTRING

+

+#ifndef GTEST_HAS_GLOBAL_WSTRING

+// The user didn't tell us whether ::wstring is available, so we need

+// to figure it out.

+# define GTEST_HAS_GLOBAL_WSTRING \

+    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)

+#endif  // GTEST_HAS_GLOBAL_WSTRING

+

+// Determines whether RTTI is available.

+#ifndef GTEST_HAS_RTTI

+// The user didn't tell us whether RTTI is enabled, so we need to

+// figure it out.

+

+# ifdef _MSC_VER

+

+#  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.

+#   define GTEST_HAS_RTTI 1

+#  else

+#   define GTEST_HAS_RTTI 0

+#  endif

+

+// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.

+# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)

+

+#  ifdef __GXX_RTTI

+// When building against STLport with the Android NDK and with

+// -frtti -fno-exceptions, the build fails at link time with undefined

+// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,

+// so disable RTTI when detected.

+#   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \

+       !defined(__EXCEPTIONS)

+#    define GTEST_HAS_RTTI 0

+#   else

+#    define GTEST_HAS_RTTI 1

+#   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS

+#  else

+#   define GTEST_HAS_RTTI 0

+#  endif  // __GXX_RTTI

+

+// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends

+// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the

+// first version with C++ support.

+# elif defined(__clang__)

+

+#  define GTEST_HAS_RTTI __has_feature(cxx_rtti)

+

+// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if

+// both the typeid and dynamic_cast features are present.

+# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)

+

+#  ifdef __RTTI_ALL__

+#   define GTEST_HAS_RTTI 1

+#  else

+#   define GTEST_HAS_RTTI 0

+#  endif

+

+# else

+

+// For all other compilers, we assume RTTI is enabled.

+#  define GTEST_HAS_RTTI 1

+

+# endif  // _MSC_VER

+

+#endif  // GTEST_HAS_RTTI

+

+// It's this header's responsibility to #include <typeinfo> when RTTI

+// is enabled.

+#if GTEST_HAS_RTTI

+# include <typeinfo>

+#endif

+

+// Determines whether Google Test can use the pthreads library.

+#ifndef GTEST_HAS_PTHREAD

+// The user didn't tell us explicitly, so we assume pthreads support is

+// available on Linux and Mac.

+//

+// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0

+// to your compiler flags.

+# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \

+    || GTEST_OS_QNX)

+#endif  // GTEST_HAS_PTHREAD

+

+#if GTEST_HAS_PTHREAD

+// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is

+// true.

+# include <pthread.h>  // NOLINT

+

+// For timespec and nanosleep, used below.

+# include <time.h>  // NOLINT

+#endif

+

+// Determines whether Google Test can use tr1/tuple.  You can define

+// this macro to 0 to prevent Google Test from using tuple (any

+// feature depending on tuple with be disabled in this mode).

+#ifndef GTEST_HAS_TR1_TUPLE

+# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)

+// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.

+#  define GTEST_HAS_TR1_TUPLE 0

+# else

+// The user didn't tell us not to do it, so we assume it's OK.

+#  define GTEST_HAS_TR1_TUPLE 1

+# endif

+#endif  // GTEST_HAS_TR1_TUPLE

+

+// Determines whether Google Test's own tr1 tuple implementation

+// should be used.

+#ifndef GTEST_USE_OWN_TR1_TUPLE

+// The user didn't tell us, so we need to figure it out.

+

+// We use our own TR1 tuple if we aren't sure the user has an

+// implementation of it already.  At this time, libstdc++ 4.0.0+ and

+// MSVC 2010 are the only mainstream standard libraries that come

+// with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler

+// pretends to be GCC by defining __GNUC__ and friends, but cannot

+// compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1

+// tuple in a 323 MB Feature Pack download, which we cannot assume the

+// user has.  QNX's QCC compiler is a modified GCC but it doesn't

+// support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,

+// and it can be used with some compilers that define __GNUC__.

+# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \

+      && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600

+#  define GTEST_ENV_HAS_TR1_TUPLE_ 1

+# endif

+

+// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used

+// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6

+// can build with clang but need to use gcc4.2's libstdc++).

+# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)

+#  define GTEST_ENV_HAS_STD_TUPLE_ 1

+# endif

+

+# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_

+#  define GTEST_USE_OWN_TR1_TUPLE 0

+# else

+#  define GTEST_USE_OWN_TR1_TUPLE 1

+# endif

+

+#endif  // GTEST_USE_OWN_TR1_TUPLE

+

+// To avoid conditional compilation everywhere, we make it

+// gtest-port.h's responsibility to #include the header implementing

+// tr1/tuple.

+#if GTEST_HAS_TR1_TUPLE

+

+# if GTEST_USE_OWN_TR1_TUPLE

+#  include "gtest/internal/gtest-tuple.h"

+# elif GTEST_ENV_HAS_STD_TUPLE_

+#  include <tuple>

+// C++11 puts its tuple into the ::std namespace rather than

+// ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.

+// This causes undefined behavior, but supported compilers react in

+// the way we intend.

+namespace std {

+namespace tr1 {

+using ::std::get;

+using ::std::make_tuple;

+using ::std::tuple;

+using ::std::tuple_element;

+using ::std::tuple_size;

+}

+}

+

+# elif GTEST_OS_SYMBIAN

+

+// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to

+// use STLport's tuple implementation, which unfortunately doesn't

+// work as the copy of STLport distributed with Symbian is incomplete.

+// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to

+// use its own tuple implementation.

+#  ifdef BOOST_HAS_TR1_TUPLE

+#   undef BOOST_HAS_TR1_TUPLE

+#  endif  // BOOST_HAS_TR1_TUPLE

+

+// This prevents <boost/tr1/detail/config.hpp>, which defines

+// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.

+#  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED

+#  include <tuple>

+

+# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)

+// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does

+// not conform to the TR1 spec, which requires the header to be <tuple>.

+

+#  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302

+// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,

+// which is #included by <tr1/tuple>, to not compile when RTTI is

+// disabled.  _TR1_FUNCTIONAL is the header guard for

+// <tr1/functional>.  Hence the following #define is a hack to prevent

+// <tr1/functional> from being included.

+#   define _TR1_FUNCTIONAL 1

+#   include <tr1/tuple>

+#   undef _TR1_FUNCTIONAL  // Allows the user to #include

+                        // <tr1/functional> if he chooses to.

+#  else

+#   include <tr1/tuple>  // NOLINT

+#  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302

+

+# else

+// If the compiler is not GCC 4.0+, we assume the user is using a

+// spec-conforming TR1 implementation.

+#  include <tuple>  // NOLINT

+# endif  // GTEST_USE_OWN_TR1_TUPLE

+

+#endif  // GTEST_HAS_TR1_TUPLE

+

+// Determines whether clone(2) is supported.

+// Usually it will only be available on Linux, excluding

+// Linux on the Itanium architecture.

+// Also see http://linux.die.net/man/2/clone.

+#ifndef GTEST_HAS_CLONE

+// The user didn't tell us, so we need to figure it out.

+

+# if GTEST_OS_LINUX && !defined(__ia64__)

+#  if GTEST_OS_LINUX_ANDROID

+// On Android, clone() is only available on ARM starting with Gingerbread.

+#    if defined(__arm__) && __ANDROID_API__ >= 9

+#     define GTEST_HAS_CLONE 1

+#    else

+#     define GTEST_HAS_CLONE 0

+#    endif

+#  else

+#   define GTEST_HAS_CLONE 1

+#  endif

+# else

+#  define GTEST_HAS_CLONE 0

+# endif  // GTEST_OS_LINUX && !defined(__ia64__)

+

+#endif  // GTEST_HAS_CLONE

+

+// Determines whether to support stream redirection. This is used to test

+// output correctness and to implement death tests.

+#ifndef GTEST_HAS_STREAM_REDIRECTION

+// By default, we assume that stream redirection is supported on all

+// platforms except known mobile ones.

+# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN

+#  define GTEST_HAS_STREAM_REDIRECTION 0

+# else

+#  define GTEST_HAS_STREAM_REDIRECTION 1

+# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN

+#endif  // GTEST_HAS_STREAM_REDIRECTION

+

+// Determines whether to support death tests.

+// Google Test does not support death tests for VC 7.1 and earlier as

+// abort() in a VC 7.1 application compiled as GUI in debug config

+// pops up a dialog window that cannot be suppressed programmatically.

+#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \

+     (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \

+     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \

+     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \

+     GTEST_OS_OPENBSD || GTEST_OS_QNX)

+# define GTEST_HAS_DEATH_TEST 1

+# include <vector>  // NOLINT

+#endif

+

+// We don't support MSVC 7.1 with exceptions disabled now.  Therefore

+// all the compilers we care about are adequate for supporting

+// value-parameterized tests.

+#define GTEST_HAS_PARAM_TEST 1

+

+// Determines whether to support type-driven tests.

+

+// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,

+// Sun Pro CC, IBM Visual Age, and HP aCC support.

+#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \

+    defined(__IBMCPP__) || defined(__HP_aCC)

+# define GTEST_HAS_TYPED_TEST 1

+# define GTEST_HAS_TYPED_TEST_P 1

+#endif

+

+// Determines whether to support Combine(). This only makes sense when

+// value-parameterized tests are enabled.  The implementation doesn't

+// work on Sun Studio since it doesn't understand templated conversion

+// operators.

+#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)

+# define GTEST_HAS_COMBINE 1

+#endif

+

+// Determines whether the system compiler uses UTF-16 for encoding wide strings.

+#define GTEST_WIDE_STRING_USES_UTF16_ \

+    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)

+

+// Determines whether test results can be streamed to a socket.

+#if GTEST_OS_LINUX

+# define GTEST_CAN_STREAM_RESULTS_ 1

+#endif

+

+// Defines some utility macros.

+

+// The GNU compiler emits a warning if nested "if" statements are followed by

+// an "else" statement and braces are not used to explicitly disambiguate the

+// "else" binding.  This leads to problems with code like:

+//

+//   if (gate)

+//     ASSERT_*(condition) << "Some message";

+//

+// The "switch (0) case 0:" idiom is used to suppress this.

+#ifdef __INTEL_COMPILER

+# define GTEST_AMBIGUOUS_ELSE_BLOCKER_

+#else

+# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT

+#endif

+

+// Use this annotation at the end of a struct/class definition to

+// prevent the compiler from optimizing away instances that are never

+// used.  This is useful when all interesting logic happens inside the

+// c'tor and / or d'tor.  Example:

+//

+//   struct Foo {

+//     Foo() { ... }

+//   } GTEST_ATTRIBUTE_UNUSED_;

+//

+// Also use it after a variable or parameter declaration to tell the

+// compiler the variable/parameter does not have to be used.

+#if defined(__GNUC__) && !defined(COMPILER_ICC)

+# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))

+#else

+# define GTEST_ATTRIBUTE_UNUSED_

+#endif

+

+// A macro to disallow operator=

+// This should be used in the private: declarations for a class.

+#define GTEST_DISALLOW_ASSIGN_(type)\

+  void operator=(type const &)

+

+// A macro to disallow copy constructor and operator=

+// This should be used in the private: declarations for a class.

+#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\

+  type(type const &);\

+  GTEST_DISALLOW_ASSIGN_(type)

+

+// Tell the compiler to warn about unused return values for functions declared

+// with this macro.  The macro should be used on function declarations

+// following the argument list:

+//

+//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;

+#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)

+# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))

+#else

+# define GTEST_MUST_USE_RESULT_

+#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC

+

+// Determine whether the compiler supports Microsoft's Structured Exception

+// Handling.  This is supported by several Windows compilers but generally

+// does not exist on any other system.

+#ifndef GTEST_HAS_SEH

+// The user didn't tell us, so we need to figure it out.

+

+# if defined(_MSC_VER) || defined(__BORLANDC__)

+// These two compilers are known to support SEH.

+#  define GTEST_HAS_SEH 1

+# else

+// Assume no SEH.

+#  define GTEST_HAS_SEH 0

+# endif

+

+#endif  // GTEST_HAS_SEH

+

+#ifdef _MSC_VER

+

+# if GTEST_LINKED_AS_SHARED_LIBRARY

+#  define GTEST_API_ __declspec(dllimport)

+# elif GTEST_CREATE_SHARED_LIBRARY

+#  define GTEST_API_ __declspec(dllexport)

+# endif

+

+#endif  // _MSC_VER

+

+#ifndef GTEST_API_

+# define GTEST_API_

+#endif

+

+#ifdef __GNUC__

+// Ask the compiler to never inline a given function.

+# define GTEST_NO_INLINE_ __attribute__((noinline))

+#else

+# define GTEST_NO_INLINE_

+#endif

+

+// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.

+#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)

+# define GTEST_HAS_CXXABI_H_ 1

+#else

+# define GTEST_HAS_CXXABI_H_ 0

+#endif

+

+namespace testing {

+

+class Message;

+

+namespace internal {

+

+// A secret type that Google Test users don't know about.  It has no

+// definition on purpose.  Therefore it's impossible to create a

+// Secret object, which is what we want.

+class Secret;

+

+// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time

+// expression is true. For example, you could use it to verify the

+// size of a static array:

+//

+//   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,

+//                         content_type_names_incorrect_size);

+//

+// or to make sure a struct is smaller than a certain size:

+//

+//   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);

+//

+// The second argument to the macro is the name of the variable. If

+// the expression is false, most compilers will issue a warning/error

+// containing the name of the variable.

+

+template <bool>

+struct CompileAssert {

+};

+

+#define GTEST_COMPILE_ASSERT_(expr, msg) \

+  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \

+      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_

+

+// Implementation details of GTEST_COMPILE_ASSERT_:

+//

+// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1

+//   elements (and thus is invalid) when the expression is false.

+//

+// - The simpler definition

+//

+//    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]

+//

+//   does not work, as gcc supports variable-length arrays whose sizes

+//   are determined at run-time (this is gcc's extension and not part

+//   of the C++ standard).  As a result, gcc fails to reject the

+//   following code with the simple definition:

+//

+//     int foo;

+//     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is

+//                                      // not a compile-time constant.

+//

+// - By using the type CompileAssert<(bool(expr))>, we ensures that

+//   expr is a compile-time constant.  (Template arguments must be

+//   determined at compile-time.)

+//

+// - The outter parentheses in CompileAssert<(bool(expr))> are necessary

+//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written

+//

+//     CompileAssert<bool(expr)>

+//

+//   instead, these compilers will refuse to compile

+//

+//     GTEST_COMPILE_ASSERT_(5 > 0, some_message);

+//

+//   (They seem to think the ">" in "5 > 0" marks the end of the

+//   template argument list.)

+//

+// - The array size is (bool(expr) ? 1 : -1), instead of simply

+//

+//     ((expr) ? 1 : -1).

+//

+//   This is to avoid running into a bug in MS VC 7.1, which

+//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.

+

+// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.

+//

+// This template is declared, but intentionally undefined.

+template <typename T1, typename T2>

+struct StaticAssertTypeEqHelper;

+

+template <typename T>

+struct StaticAssertTypeEqHelper<T, T> {};

+

+#if GTEST_HAS_GLOBAL_STRING

+typedef ::string string;

+#else

+typedef ::std::string string;

+#endif  // GTEST_HAS_GLOBAL_STRING

+

+#if GTEST_HAS_GLOBAL_WSTRING

+typedef ::wstring wstring;

+#elif GTEST_HAS_STD_WSTRING

+typedef ::std::wstring wstring;

+#endif  // GTEST_HAS_GLOBAL_WSTRING

+

+// A helper for suppressing warnings on constant condition.  It just

+// returns 'condition'.

+GTEST_API_ bool IsTrue(bool condition);

+

+// Defines scoped_ptr.

+

+// This implementation of scoped_ptr is PARTIAL - it only contains

+// enough stuff to satisfy Google Test's need.

+template <typename T>

+class scoped_ptr {

+ public:

+  typedef T element_type;

+

+  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}

+  ~scoped_ptr() { reset(); }

+

+  T& operator*() const { return *ptr_; }

+  T* operator->() const { return ptr_; }

+  T* get() const { return ptr_; }

+

+  T* release() {

+    T* const ptr = ptr_;

+    ptr_ = NULL;

+    return ptr;

+  }

+

+  void reset(T* p = NULL) {

+    if (p != ptr_) {

+      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.

+        delete ptr_;

+      }

+      ptr_ = p;

+    }

+  }

+

+ private:

+  T* ptr_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);

+};

+

+// Defines RE.

+

+// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended

+// Regular Expression syntax.

+class GTEST_API_ RE {

+ public:

+  // A copy constructor is required by the Standard to initialize object

+  // references from r-values.

+  RE(const RE& other) { Init(other.pattern()); }

+

+  // Constructs an RE from a string.

+  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT

+

+#if GTEST_HAS_GLOBAL_STRING

+

+  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT

+

+#endif  // GTEST_HAS_GLOBAL_STRING

+

+  RE(const char* regex) { Init(regex); }  // NOLINT

+  ~RE();

+

+  // Returns the string representation of the regex.

+  const char* pattern() const { return pattern_; }

+

+  // FullMatch(str, re) returns true iff regular expression re matches

+  // the entire str.

+  // PartialMatch(str, re) returns true iff regular expression re

+  // matches a substring of str (including str itself).

+  //

+  // TODO(wan@google.com): make FullMatch() and PartialMatch() work

+  // when str contains NUL characters.

+  static bool FullMatch(const ::std::string& str, const RE& re) {

+    return FullMatch(str.c_str(), re);

+  }

+  static bool PartialMatch(const ::std::string& str, const RE& re) {

+    return PartialMatch(str.c_str(), re);

+  }

+

+#if GTEST_HAS_GLOBAL_STRING

+

+  static bool FullMatch(const ::string& str, const RE& re) {

+    return FullMatch(str.c_str(), re);

+  }

+  static bool PartialMatch(const ::string& str, const RE& re) {

+    return PartialMatch(str.c_str(), re);

+  }

+

+#endif  // GTEST_HAS_GLOBAL_STRING

+

+  static bool FullMatch(const char* str, const RE& re);

+  static bool PartialMatch(const char* str, const RE& re);

+

+ private:

+  void Init(const char* regex);

+

+  // We use a const char* instead of an std::string, as Google Test used to be

+  // used where std::string is not available.  TODO(wan@google.com): change to

+  // std::string.

+  const char* pattern_;

+  bool is_valid_;

+

+#if GTEST_USES_POSIX_RE

+

+  regex_t full_regex_;     // For FullMatch().

+  regex_t partial_regex_;  // For PartialMatch().

+

+#else  // GTEST_USES_SIMPLE_RE

+

+  const char* full_pattern_;  // For FullMatch();

+

+#endif

+

+  GTEST_DISALLOW_ASSIGN_(RE);

+};

+

+// Formats a source file path and a line number as they would appear

+// in an error message from the compiler used to compile this code.

+GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);

+

+// Formats a file location for compiler-independent XML output.

+// Although this function is not platform dependent, we put it next to

+// FormatFileLocation in order to contrast the two functions.

+GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,

+                                                               int line);

+

+// Defines logging utilities:

+//   GTEST_LOG_(severity) - logs messages at the specified severity level. The

+//                          message itself is streamed into the macro.

+//   LogToStderr()  - directs all log messages to stderr.

+//   FlushInfoLog() - flushes informational log messages.

+

+enum GTestLogSeverity {

+  GTEST_INFO,

+  GTEST_WARNING,

+  GTEST_ERROR,

+  GTEST_FATAL

+};

+

+// Formats log entry severity, provides a stream object for streaming the

+// log message, and terminates the message with a newline when going out of

+// scope.

+class GTEST_API_ GTestLog {

+ public:

+  GTestLog(GTestLogSeverity severity, const char* file, int line);

+

+  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.

+  ~GTestLog();

+

+  ::std::ostream& GetStream() { return ::std::cerr; }

+

+ private:

+  const GTestLogSeverity severity_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);

+};

+

+#define GTEST_LOG_(severity) \

+    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \

+                                  __FILE__, __LINE__).GetStream()

+

+inline void LogToStderr() {}

+inline void FlushInfoLog() { fflush(NULL); }

+

+// INTERNAL IMPLEMENTATION - DO NOT USE.

+//

+// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition

+// is not satisfied.

+//  Synopsys:

+//    GTEST_CHECK_(boolean_condition);

+//     or

+//    GTEST_CHECK_(boolean_condition) << "Additional message";

+//

+//    This checks the condition and if the condition is not satisfied

+//    it prints message about the condition violation, including the

+//    condition itself, plus additional message streamed into it, if any,

+//    and then it aborts the program. It aborts the program irrespective of

+//    whether it is built in the debug mode or not.

+#define GTEST_CHECK_(condition) \

+    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \

+    if (::testing::internal::IsTrue(condition)) \

+      ; \

+    else \

+      GTEST_LOG_(FATAL) << "Condition " #condition " failed. "

+

+// An all-mode assert to verify that the given POSIX-style function

+// call returns 0 (indicating success).  Known limitation: this

+// doesn't expand to a balanced 'if' statement, so enclose the macro

+// in {} if you need to use it as the only statement in an 'if'

+// branch.

+#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \

+  if (const int gtest_error = (posix_call)) \

+    GTEST_LOG_(FATAL) << #posix_call << "failed with error " \

+                      << gtest_error

+

+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.

+//

+// Use ImplicitCast_ as a safe version of static_cast for upcasting in

+// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a

+// const Foo*).  When you use ImplicitCast_, the compiler checks that

+// the cast is safe.  Such explicit ImplicitCast_s are necessary in

+// surprisingly many situations where C++ demands an exact type match

+// instead of an argument type convertable to a target type.

+//

+// The syntax for using ImplicitCast_ is the same as for static_cast:

+//

+//   ImplicitCast_<ToType>(expr)

+//

+// ImplicitCast_ would have been part of the C++ standard library,

+// but the proposal was submitted too late.  It will probably make

+// its way into the language in the future.

+//

+// This relatively ugly name is intentional. It prevents clashes with

+// similar functions users may have (e.g., implicit_cast). The internal

+// namespace alone is not enough because the function can be found by ADL.

+template<typename To>

+inline To ImplicitCast_(To x) { return x; }

+

+// When you upcast (that is, cast a pointer from type Foo to type

+// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts

+// always succeed.  When you downcast (that is, cast a pointer from

+// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because

+// how do you know the pointer is really of type SubclassOfFoo?  It

+// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,

+// when you downcast, you should use this macro.  In debug mode, we

+// use dynamic_cast<> to double-check the downcast is legal (we die

+// if it's not).  In normal mode, we do the efficient static_cast<>

+// instead.  Thus, it's important to test in debug mode to make sure

+// the cast is legal!

+//    This is the only place in the code we should use dynamic_cast<>.

+// In particular, you SHOULDN'T be using dynamic_cast<> in order to

+// do RTTI (eg code like this:

+//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);

+//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);

+// You should design the code some other way not to need this.

+//

+// This relatively ugly name is intentional. It prevents clashes with

+// similar functions users may have (e.g., down_cast). The internal

+// namespace alone is not enough because the function can be found by ADL.

+template<typename To, typename From>  // use like this: DownCast_<T*>(foo);

+inline To DownCast_(From* f) {  // so we only accept pointers

+  // Ensures that To is a sub-type of From *.  This test is here only

+  // for compile-time type checking, and has no overhead in an

+  // optimized build at run-time, as it will be optimized away

+  // completely.

+  if (false) {

+    const To to = NULL;

+    ::testing::internal::ImplicitCast_<From*>(to);

+  }

+

+#if GTEST_HAS_RTTI

+  // RTTI: debug mode only!

+  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);

+#endif

+  return static_cast<To>(f);

+}

+

+// Downcasts the pointer of type Base to Derived.

+// Derived must be a subclass of Base. The parameter MUST

+// point to a class of type Derived, not any subclass of it.

+// When RTTI is available, the function performs a runtime

+// check to enforce this.

+template <class Derived, class Base>

+Derived* CheckedDowncastToActualType(Base* base) {

+#if GTEST_HAS_RTTI

+  GTEST_CHECK_(typeid(*base) == typeid(Derived));

+  return dynamic_cast<Derived*>(base);  // NOLINT

+#else

+  return static_cast<Derived*>(base);  // Poor man's downcast.

+#endif

+}

+

+#if GTEST_HAS_STREAM_REDIRECTION

+

+// Defines the stderr capturer:

+//   CaptureStdout     - starts capturing stdout.

+//   GetCapturedStdout - stops capturing stdout and returns the captured string.

+//   CaptureStderr     - starts capturing stderr.

+//   GetCapturedStderr - stops capturing stderr and returns the captured string.

+//

+GTEST_API_ void CaptureStdout();

+GTEST_API_ std::string GetCapturedStdout();

+GTEST_API_ void CaptureStderr();

+GTEST_API_ std::string GetCapturedStderr();

+

+#endif  // GTEST_HAS_STREAM_REDIRECTION

+

+

+#if GTEST_HAS_DEATH_TEST

+

+const ::std::vector<testing::internal::string>& GetInjectableArgvs();

+void SetInjectableArgvs(const ::std::vector<testing::internal::string>*

+                             new_argvs);

+

+// A copy of all command line arguments.  Set by InitGoogleTest().

+extern ::std::vector<testing::internal::string> g_argvs;

+

+#endif  // GTEST_HAS_DEATH_TEST

+

+// Defines synchronization primitives.

+

+#if GTEST_HAS_PTHREAD

+

+// Sleeps for (roughly) n milli-seconds.  This function is only for

+// testing Google Test's own constructs.  Don't use it in user tests,

+// either directly or indirectly.

+inline void SleepMilliseconds(int n) {

+  const timespec time = {

+    0,                  // 0 seconds.

+    n * 1000L * 1000L,  // And n ms.

+  };

+  nanosleep(&time, NULL);

+}

+

+// Allows a controller thread to pause execution of newly created

+// threads until notified.  Instances of this class must be created

+// and destroyed in the controller thread.

+//

+// This class is only for testing Google Test's own constructs. Do not

+// use it in user tests, either directly or indirectly.

+class Notification {

+ public:

+  Notification() : notified_(false) {

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));

+  }

+  ~Notification() {

+    pthread_mutex_destroy(&mutex_);

+  }

+

+  // Notifies all threads created with this notification to start. Must

+  // be called from the controller thread.

+  void Notify() {

+    pthread_mutex_lock(&mutex_);

+    notified_ = true;

+    pthread_mutex_unlock(&mutex_);

+  }

+

+  // Blocks until the controller thread notifies. Must be called from a test

+  // thread.

+  void WaitForNotification() {

+    for (;;) {

+      pthread_mutex_lock(&mutex_);

+      const bool notified = notified_;

+      pthread_mutex_unlock(&mutex_);

+      if (notified)

+        break;

+      SleepMilliseconds(10);

+    }

+  }

+

+ private:

+  pthread_mutex_t mutex_;

+  bool notified_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);

+};

+

+// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.

+// Consequently, it cannot select a correct instantiation of ThreadWithParam

+// in order to call its Run(). Introducing ThreadWithParamBase as a

+// non-templated base class for ThreadWithParam allows us to bypass this

+// problem.

+class ThreadWithParamBase {

+ public:

+  virtual ~ThreadWithParamBase() {}

+  virtual void Run() = 0;

+};

+

+// pthread_create() accepts a pointer to a function type with the C linkage.

+// According to the Standard (7.5/1), function types with different linkages

+// are different even if they are otherwise identical.  Some compilers (for

+// example, SunStudio) treat them as different types.  Since class methods

+// cannot be defined with C-linkage we need to define a free C-function to

+// pass into pthread_create().

+extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {

+  static_cast<ThreadWithParamBase*>(thread)->Run();

+  return NULL;

+}

+

+// Helper class for testing Google Test's multi-threading constructs.

+// To use it, write:

+//

+//   void ThreadFunc(int param) { /* Do things with param */ }

+//   Notification thread_can_start;

+//   ...

+//   // The thread_can_start parameter is optional; you can supply NULL.

+//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);

+//   thread_can_start.Notify();

+//

+// These classes are only for testing Google Test's own constructs. Do

+// not use them in user tests, either directly or indirectly.

+template <typename T>

+class ThreadWithParam : public ThreadWithParamBase {

+ public:

+  typedef void (*UserThreadFunc)(T);

+

+  ThreadWithParam(

+      UserThreadFunc func, T param, Notification* thread_can_start)

+      : func_(func),

+        param_(param),

+        thread_can_start_(thread_can_start),

+        finished_(false) {

+    ThreadWithParamBase* const base = this;

+    // The thread can be created only after all fields except thread_

+    // have been initialized.

+    GTEST_CHECK_POSIX_SUCCESS_(

+        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));

+  }

+  ~ThreadWithParam() { Join(); }

+

+  void Join() {

+    if (!finished_) {

+      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));

+      finished_ = true;

+    }

+  }

+

+  virtual void Run() {

+    if (thread_can_start_ != NULL)

+      thread_can_start_->WaitForNotification();

+    func_(param_);

+  }

+

+ private:

+  const UserThreadFunc func_;  // User-supplied thread function.

+  const T param_;  // User-supplied parameter to the thread function.

+  // When non-NULL, used to block execution until the controller thread

+  // notifies.

+  Notification* const thread_can_start_;

+  bool finished_;  // true iff we know that the thread function has finished.

+  pthread_t thread_;  // The native thread object.

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);

+};

+

+// MutexBase and Mutex implement mutex on pthreads-based platforms. They

+// are used in conjunction with class MutexLock:

+//

+//   Mutex mutex;

+//   ...

+//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end

+//                            // of the current scope.

+//

+// MutexBase implements behavior for both statically and dynamically

+// allocated mutexes.  Do not use MutexBase directly.  Instead, write

+// the following to define a static mutex:

+//

+//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);

+//

+// You can forward declare a static mutex like this:

+//

+//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);

+//

+// To create a dynamic mutex, just define an object of type Mutex.

+class MutexBase {

+ public:

+  // Acquires this mutex.

+  void Lock() {

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));

+    owner_ = pthread_self();

+    has_owner_ = true;

+  }

+

+  // Releases this mutex.

+  void Unlock() {

+    // Since the lock is being released the owner_ field should no longer be

+    // considered valid. We don't protect writing to has_owner_ here, as it's

+    // the caller's responsibility to ensure that the current thread holds the

+    // mutex when this is called.

+    has_owner_ = false;

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));

+  }

+

+  // Does nothing if the current thread holds the mutex. Otherwise, crashes

+  // with high probability.

+  void AssertHeld() const {

+    GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))

+        << "The current thread is not holding the mutex @" << this;

+  }

+

+  // A static mutex may be used before main() is entered.  It may even

+  // be used before the dynamic initialization stage.  Therefore we

+  // must be able to initialize a static mutex object at link time.

+  // This means MutexBase has to be a POD and its member variables

+  // have to be public.

+ public:

+  pthread_mutex_t mutex_;  // The underlying pthread mutex.

+  // has_owner_ indicates whether the owner_ field below contains a valid thread

+  // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All

+  // accesses to the owner_ field should be protected by a check of this field.

+  // An alternative might be to memset() owner_ to all zeros, but there's no

+  // guarantee that a zero'd pthread_t is necessarily invalid or even different

+  // from pthread_self().

+  bool has_owner_;

+  pthread_t owner_;  // The thread holding the mutex.

+};

+

+// Forward-declares a static mutex.

+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \

+    extern ::testing::internal::MutexBase mutex

+

+// Defines and statically (i.e. at link time) initializes a static mutex.

+// The initialization list here does not explicitly initialize each field,

+// instead relying on default initialization for the unspecified fields. In

+// particular, the owner_ field (a pthread_t) is not explicitly initialized.

+// This allows initialization to work whether pthread_t is a scalar or struct.

+// The flag -Wmissing-field-initializers must not be specified for this to work.

+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \

+    ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }

+

+// The Mutex class can only be used for mutexes created at runtime. It

+// shares its API with MutexBase otherwise.

+class Mutex : public MutexBase {

+ public:

+  Mutex() {

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));

+    has_owner_ = false;

+  }

+  ~Mutex() {

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));

+  }

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);

+};

+

+// We cannot name this class MutexLock as the ctor declaration would

+// conflict with a macro named MutexLock, which is defined on some

+// platforms.  Hence the typedef trick below.

+class GTestMutexLock {

+ public:

+  explicit GTestMutexLock(MutexBase* mutex)

+      : mutex_(mutex) { mutex_->Lock(); }

+

+  ~GTestMutexLock() { mutex_->Unlock(); }

+

+ private:

+  MutexBase* const mutex_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);

+};

+

+typedef GTestMutexLock MutexLock;

+

+// Helpers for ThreadLocal.

+

+// pthread_key_create() requires DeleteThreadLocalValue() to have

+// C-linkage.  Therefore it cannot be templatized to access

+// ThreadLocal<T>.  Hence the need for class

+// ThreadLocalValueHolderBase.

+class ThreadLocalValueHolderBase {

+ public:

+  virtual ~ThreadLocalValueHolderBase() {}

+};

+

+// Called by pthread to delete thread-local data stored by

+// pthread_setspecific().

+extern "C" inline void DeleteThreadLocalValue(void* value_holder) {

+  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);

+}

+

+// Implements thread-local storage on pthreads-based systems.

+//

+//   // Thread 1

+//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.

+//

+//   // Thread 2

+//   tl.set(150);  // Changes the value for thread 2 only.

+//   EXPECT_EQ(150, tl.get());

+//

+//   // Thread 1

+//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.

+//   tl.set(200);

+//   EXPECT_EQ(200, tl.get());

+//

+// The template type argument T must have a public copy constructor.

+// In addition, the default ThreadLocal constructor requires T to have

+// a public default constructor.

+//

+// An object managed for a thread by a ThreadLocal instance is deleted

+// when the thread exits.  Or, if the ThreadLocal instance dies in

+// that thread, when the ThreadLocal dies.  It's the user's

+// responsibility to ensure that all other threads using a ThreadLocal

+// have exited when it dies, or the per-thread objects for those

+// threads will not be deleted.

+//

+// Google Test only uses global ThreadLocal objects.  That means they

+// will die after main() has returned.  Therefore, no per-thread

+// object managed by Google Test will be leaked as long as all threads

+// using Google Test have exited when main() returns.

+template <typename T>

+class ThreadLocal {

+ public:

+  ThreadLocal() : key_(CreateKey()),

+                  default_() {}

+  explicit ThreadLocal(const T& value) : key_(CreateKey()),

+                                         default_(value) {}

+

+  ~ThreadLocal() {

+    // Destroys the managed object for the current thread, if any.

+    DeleteThreadLocalValue(pthread_getspecific(key_));

+

+    // Releases resources associated with the key.  This will *not*

+    // delete managed objects for other threads.

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));

+  }

+

+  T* pointer() { return GetOrCreateValue(); }

+  const T* pointer() const { return GetOrCreateValue(); }

+  const T& get() const { return *pointer(); }

+  void set(const T& value) { *pointer() = value; }

+

+ private:

+  // Holds a value of type T.

+  class ValueHolder : public ThreadLocalValueHolderBase {

+   public:

+    explicit ValueHolder(const T& value) : value_(value) {}

+

+    T* pointer() { return &value_; }

+

+   private:

+    T value_;

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);

+  };

+

+  static pthread_key_t CreateKey() {

+    pthread_key_t key;

+    // When a thread exits, DeleteThreadLocalValue() will be called on

+    // the object managed for that thread.

+    GTEST_CHECK_POSIX_SUCCESS_(

+        pthread_key_create(&key, &DeleteThreadLocalValue));

+    return key;

+  }

+

+  T* GetOrCreateValue() const {

+    ThreadLocalValueHolderBase* const holder =

+        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));

+    if (holder != NULL) {

+      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();

+    }

+

+    ValueHolder* const new_holder = new ValueHolder(default_);

+    ThreadLocalValueHolderBase* const holder_base = new_holder;

+    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));

+    return new_holder->pointer();

+  }

+

+  // A key pthreads uses for looking up per-thread values.

+  const pthread_key_t key_;

+  const T default_;  // The default value for each thread.

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);

+};

+

+# define GTEST_IS_THREADSAFE 1

+

+#else  // GTEST_HAS_PTHREAD

+

+// A dummy implementation of synchronization primitives (mutex, lock,

+// and thread-local variable).  Necessary for compiling Google Test where

+// mutex is not supported - using Google Test in multiple threads is not

+// supported on such platforms.

+

+class Mutex {

+ public:

+  Mutex() {}

+  void Lock() {}

+  void Unlock() {}

+  void AssertHeld() const {}

+};

+

+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \

+  extern ::testing::internal::Mutex mutex

+

+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex

+

+class GTestMutexLock {

+ public:

+  explicit GTestMutexLock(Mutex*) {}  // NOLINT

+};

+

+typedef GTestMutexLock MutexLock;

+

+template <typename T>

+class ThreadLocal {

+ public:

+  ThreadLocal() : value_() {}

+  explicit ThreadLocal(const T& value) : value_(value) {}

+  T* pointer() { return &value_; }

+  const T* pointer() const { return &value_; }

+  const T& get() const { return value_; }

+  void set(const T& value) { value_ = value; }

+ private:

+  T value_;

+};

+

+// The above synchronization primitives have dummy implementations.

+// Therefore Google Test is not thread-safe.

+# define GTEST_IS_THREADSAFE 0

+

+#endif  // GTEST_HAS_PTHREAD

+

+// Returns the number of threads running in the process, or 0 to indicate that

+// we cannot detect it.

+GTEST_API_ size_t GetThreadCount();

+

+// Passing non-POD classes through ellipsis (...) crashes the ARM

+// compiler and generates a warning in Sun Studio.  The Nokia Symbian

+// and the IBM XL C/C++ compiler try to instantiate a copy constructor

+// for objects passed through ellipsis (...), failing for uncopyable

+// objects.  We define this to ensure that only POD is passed through

+// ellipsis on these systems.

+#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)

+// We lose support for NULL detection where the compiler doesn't like

+// passing non-POD classes through ellipsis (...).

+# define GTEST_ELLIPSIS_NEEDS_POD_ 1

+#else

+# define GTEST_CAN_COMPARE_NULL 1

+#endif

+

+// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between

+// const T& and const T* in a function template.  These compilers

+// _can_ decide between class template specializations for T and T*,

+// so a tr1::type_traits-like is_pointer works.

+#if defined(__SYMBIAN32__) || defined(__IBMCPP__)

+# define GTEST_NEEDS_IS_POINTER_ 1

+#endif

+

+template <bool bool_value>

+struct bool_constant {

+  typedef bool_constant<bool_value> type;

+  static const bool value = bool_value;

+};

+template <bool bool_value> const bool bool_constant<bool_value>::value;

+

+typedef bool_constant<false> false_type;

+typedef bool_constant<true> true_type;

+

+template <typename T>

+struct is_pointer : public false_type {};

+

+template <typename T>

+struct is_pointer<T*> : public true_type {};

+

+template <typename Iterator>

+struct IteratorTraits {

+  typedef typename Iterator::value_type value_type;

+};

+

+template <typename T>

+struct IteratorTraits<T*> {

+  typedef T value_type;

+};

+

+template <typename T>

+struct IteratorTraits<const T*> {

+  typedef T value_type;

+};

+

+#if GTEST_OS_WINDOWS

+# define GTEST_PATH_SEP_ "\\"

+# define GTEST_HAS_ALT_PATH_SEP_ 1

+// The biggest signed integer type the compiler supports.

+typedef __int64 BiggestInt;

+#else

+# define GTEST_PATH_SEP_ "/"

+# define GTEST_HAS_ALT_PATH_SEP_ 0

+typedef long long BiggestInt;  // NOLINT

+#endif  // GTEST_OS_WINDOWS

+

+// Utilities for char.

+

+// isspace(int ch) and friends accept an unsigned char or EOF.  char

+// may be signed, depending on the compiler (or compiler flags).

+// Therefore we need to cast a char to unsigned char before calling

+// isspace(), etc.

+

+inline bool IsAlpha(char ch) {

+  return isalpha(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsAlNum(char ch) {

+  return isalnum(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsDigit(char ch) {

+  return isdigit(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsLower(char ch) {

+  return islower(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsSpace(char ch) {

+  return isspace(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsUpper(char ch) {

+  return isupper(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsXDigit(char ch) {

+  return isxdigit(static_cast<unsigned char>(ch)) != 0;

+}

+inline bool IsXDigit(wchar_t ch) {

+  const unsigned char low_byte = static_cast<unsigned char>(ch);

+  return ch == low_byte && isxdigit(low_byte) != 0;

+}

+

+inline char ToLower(char ch) {

+  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));

+}

+inline char ToUpper(char ch) {

+  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));

+}

+

+// The testing::internal::posix namespace holds wrappers for common

+// POSIX functions.  These wrappers hide the differences between

+// Windows/MSVC and POSIX systems.  Since some compilers define these

+// standard functions as macros, the wrapper cannot have the same name

+// as the wrapped function.

+

+namespace posix {

+

+// Functions with a different name on Windows.

+

+#if GTEST_OS_WINDOWS

+

+typedef struct _stat StatStruct;

+

+# ifdef __BORLANDC__

+inline int IsATTY(int fd) { return isatty(fd); }

+inline int StrCaseCmp(const char* s1, const char* s2) {

+  return stricmp(s1, s2);

+}

+inline char* StrDup(const char* src) { return strdup(src); }

+# else  // !__BORLANDC__

+#  if GTEST_OS_WINDOWS_MOBILE

+inline int IsATTY(int /* fd */) { return 0; }

+#  else

+inline int IsATTY(int fd) { return _isatty(fd); }

+#  endif  // GTEST_OS_WINDOWS_MOBILE

+inline int StrCaseCmp(const char* s1, const char* s2) {

+  return _stricmp(s1, s2);

+}

+inline char* StrDup(const char* src) { return _strdup(src); }

+# endif  // __BORLANDC__

+

+# if GTEST_OS_WINDOWS_MOBILE

+inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }

+// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this

+// time and thus not defined there.

+# else

+inline int FileNo(FILE* file) { return _fileno(file); }

+inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }

+inline int RmDir(const char* dir) { return _rmdir(dir); }

+inline bool IsDir(const StatStruct& st) {

+  return (_S_IFDIR & st.st_mode) != 0;

+}

+# endif  // GTEST_OS_WINDOWS_MOBILE

+

+#else

+

+typedef struct stat StatStruct;

+

+inline int FileNo(FILE* file) { return fileno(file); }

+inline int IsATTY(int fd) { return isatty(fd); }

+inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }

+inline int StrCaseCmp(const char* s1, const char* s2) {

+  return strcasecmp(s1, s2);

+}

+inline char* StrDup(const char* src) { return strdup(src); }

+inline int RmDir(const char* dir) { return rmdir(dir); }

+inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }

+

+#endif  // GTEST_OS_WINDOWS

+

+// Functions deprecated by MSVC 8.0.

+

+#ifdef _MSC_VER

+// Temporarily disable warning 4996 (deprecated function).

+# pragma warning(push)

+# pragma warning(disable:4996)

+#endif

+

+inline const char* StrNCpy(char* dest, const char* src, size_t n) {

+  return strncpy(dest, src, n);

+}

+

+// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and

+// StrError() aren't needed on Windows CE at this time and thus not

+// defined there.

+

+#if !GTEST_OS_WINDOWS_MOBILE

+inline int ChDir(const char* dir) { return chdir(dir); }

+#endif

+inline FILE* FOpen(const char* path, const char* mode) {

+  return fopen(path, mode);

+}

+#if !GTEST_OS_WINDOWS_MOBILE

+inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {

+  return freopen(path, mode, stream);

+}

+inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }

+#endif

+inline int FClose(FILE* fp) { return fclose(fp); }

+#if !GTEST_OS_WINDOWS_MOBILE

+inline int Read(int fd, void* buf, unsigned int count) {

+  return static_cast<int>(read(fd, buf, count));

+}

+inline int Write(int fd, const void* buf, unsigned int count) {

+  return static_cast<int>(write(fd, buf, count));

+}

+inline int Close(int fd) { return close(fd); }

+inline const char* StrError(int errnum) { return strerror(errnum); }

+#endif

+inline const char* GetEnv(const char* name) {

+#if GTEST_OS_WINDOWS_MOBILE

+  // We are on Windows CE, which has no environment variables.

+  return NULL;

+#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)

+  // Environment variables which we programmatically clear will be set to the

+  // empty string rather than unset (NULL).  Handle that case.

+  const char* const env = getenv(name);

+  return (env != NULL && env[0] != '\0') ? env : NULL;

+#else

+  return getenv(name);

+#endif

+}

+

+#ifdef _MSC_VER

+# pragma warning(pop)  // Restores the warning state.

+#endif

+

+#if GTEST_OS_WINDOWS_MOBILE

+// Windows CE has no C library. The abort() function is used in

+// several places in Google Test. This implementation provides a reasonable

+// imitation of standard behaviour.

+void Abort();

+#else

+inline void Abort() { abort(); }

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+}  // namespace posix

+

+// MSVC "deprecates" snprintf and issues warnings wherever it is used.  In

+// order to avoid these warnings, we need to use _snprintf or _snprintf_s on

+// MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate

+// function in order to achieve that.  We use macro definition here because

+// snprintf is a variadic function.

+#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE

+// MSVC 2005 and above support variadic macros.

+# define GTEST_SNPRINTF_(buffer, size, format, ...) \

+     _snprintf_s(buffer, size, size, format, __VA_ARGS__)

+#elif defined(_MSC_VER)

+// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't

+// complain about _snprintf.

+# define GTEST_SNPRINTF_ _snprintf

+#else

+# define GTEST_SNPRINTF_ snprintf

+#endif

+

+// The maximum number a BiggestInt can represent.  This definition

+// works no matter BiggestInt is represented in one's complement or

+// two's complement.

+//

+// We cannot rely on numeric_limits in STL, as __int64 and long long

+// are not part of standard C++ and numeric_limits doesn't need to be

+// defined for them.

+const BiggestInt kMaxBiggestInt =

+    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));

+

+// This template class serves as a compile-time function from size to

+// type.  It maps a size in bytes to a primitive type with that

+// size. e.g.

+//

+//   TypeWithSize<4>::UInt

+//

+// is typedef-ed to be unsigned int (unsigned integer made up of 4

+// bytes).

+//

+// Such functionality should belong to STL, but I cannot find it

+// there.

+//

+// Google Test uses this class in the implementation of floating-point

+// comparison.

+//

+// For now it only handles UInt (unsigned int) as that's all Google Test

+// needs.  Other types can be easily added in the future if need

+// arises.

+template <size_t size>

+class TypeWithSize {

+ public:

+  // This prevents the user from using TypeWithSize<N> with incorrect

+  // values of N.

+  typedef void UInt;

+};

+

+// The specialization for size 4.

+template <>

+class TypeWithSize<4> {

+ public:

+  // unsigned int has size 4 in both gcc and MSVC.

+  //

+  // As base/basictypes.h doesn't compile on Windows, we cannot use

+  // uint32, uint64, and etc here.

+  typedef int Int;

+  typedef unsigned int UInt;

+};

+

+// The specialization for size 8.

+template <>

+class TypeWithSize<8> {

+ public:

+#if GTEST_OS_WINDOWS

+  typedef __int64 Int;

+  typedef unsigned __int64 UInt;

+#else

+  typedef long long Int;  // NOLINT

+  typedef unsigned long long UInt;  // NOLINT

+#endif  // GTEST_OS_WINDOWS

+};

+

+// Integer types of known sizes.

+typedef TypeWithSize<4>::Int Int32;

+typedef TypeWithSize<4>::UInt UInt32;

+typedef TypeWithSize<8>::Int Int64;

+typedef TypeWithSize<8>::UInt UInt64;

+typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.

+

+// Utilities for command line flags and environment variables.

+

+// Macro for referencing flags.

+#define GTEST_FLAG(name) FLAGS_gtest_##name

+

+// Macros for declaring flags.

+#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)

+#define GTEST_DECLARE_int32_(name) \

+    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)

+#define GTEST_DECLARE_string_(name) \

+    GTEST_API_ extern ::std::string GTEST_FLAG(name)

+

+// Macros for defining flags.

+#define GTEST_DEFINE_bool_(name, default_val, doc) \

+    GTEST_API_ bool GTEST_FLAG(name) = (default_val)

+#define GTEST_DEFINE_int32_(name, default_val, doc) \

+    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)

+#define GTEST_DEFINE_string_(name, default_val, doc) \

+    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)

+

+// Thread annotations

+#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)

+#define GTEST_LOCK_EXCLUDED_(locks)

+

+// Parses 'str' for a 32-bit signed integer.  If successful, writes the result

+// to *value and returns true; otherwise leaves *value unchanged and returns

+// false.

+// TODO(chandlerc): Find a better way to refactor flag and environment parsing

+// out of both gtest-port.cc and gtest.cc to avoid exporting this utility

+// function.

+bool ParseInt32(const Message& src_text, const char* str, Int32* value);

+

+// Parses a bool/Int32/string from the environment variable

+// corresponding to the given Google Test flag.

+bool BoolFromGTestEnv(const char* flag, bool default_val);

+GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);

+const char* StringFromGTestEnv(const char* flag, const char* default_val);

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-string.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-string.h
new file mode 100644
index 0000000..2676a00
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-string.h
@@ -0,0 +1,167 @@
+// Copyright 2005, 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.

+//

+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)

+//

+// The Google C++ Testing Framework (Google Test)

+//

+// This header file declares the String class and functions used internally by

+// Google Test.  They are subject to change without notice. They should not used

+// by code external to Google Test.

+//

+// This header file is #included by <gtest/internal/gtest-internal.h>.

+// It should not be #included by other files.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_

+

+#ifdef __BORLANDC__

+// string.h is not guaranteed to provide strcpy on C++ Builder.

+# include <mem.h>

+#endif

+

+#include <string.h>

+#include <string>

+

+#include "gtest/internal/gtest-port.h"

+

+namespace testing {

+namespace internal {

+

+// String - an abstract class holding static string utilities.

+class GTEST_API_ String {

+ public:

+  // Static utility methods

+

+  // Clones a 0-terminated C string, allocating memory using new.  The

+  // caller is responsible for deleting the return value using

+  // delete[].  Returns the cloned string, or NULL if the input is

+  // NULL.

+  //

+  // This is different from strdup() in string.h, which allocates

+  // memory using malloc().

+  static const char* CloneCString(const char* c_str);

+

+#if GTEST_OS_WINDOWS_MOBILE

+  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be

+  // able to pass strings to Win32 APIs on CE we need to convert them

+  // to 'Unicode', UTF-16.

+

+  // Creates a UTF-16 wide string from the given ANSI string, allocating

+  // memory using new. The caller is responsible for deleting the return

+  // value using delete[]. Returns the wide string, or NULL if the

+  // input is NULL.

+  //

+  // The wide string is created using the ANSI codepage (CP_ACP) to

+  // match the behaviour of the ANSI versions of Win32 calls and the

+  // C runtime.

+  static LPCWSTR AnsiToUtf16(const char* c_str);

+

+  // Creates an ANSI string from the given wide string, allocating

+  // memory using new. The caller is responsible for deleting the return

+  // value using delete[]. Returns the ANSI string, or NULL if the

+  // input is NULL.

+  //

+  // The returned string is created using the ANSI codepage (CP_ACP) to

+  // match the behaviour of the ANSI versions of Win32 calls and the

+  // C runtime.

+  static const char* Utf16ToAnsi(LPCWSTR utf16_str);

+#endif

+

+  // Compares two C strings.  Returns true iff they have the same content.

+  //

+  // Unlike strcmp(), this function can handle NULL argument(s).  A

+  // NULL C string is considered different to any non-NULL C string,

+  // including the empty string.

+  static bool CStringEquals(const char* lhs, const char* rhs);

+

+  // Converts a wide C string to a String using the UTF-8 encoding.

+  // NULL will be converted to "(null)".  If an error occurred during

+  // the conversion, "(failed to convert from wide string)" is

+  // returned.

+  static std::string ShowWideCString(const wchar_t* wide_c_str);

+

+  // Compares two wide C strings.  Returns true iff they have the same

+  // content.

+  //

+  // Unlike wcscmp(), this function can handle NULL argument(s).  A

+  // NULL C string is considered different to any non-NULL C string,

+  // including the empty string.

+  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);

+

+  // Compares two C strings, ignoring case.  Returns true iff they

+  // have the same content.

+  //

+  // Unlike strcasecmp(), this function can handle NULL argument(s).

+  // A NULL C string is considered different to any non-NULL C string,

+  // including the empty string.

+  static bool CaseInsensitiveCStringEquals(const char* lhs,

+                                           const char* rhs);

+

+  // Compares two wide C strings, ignoring case.  Returns true iff they

+  // have the same content.

+  //

+  // Unlike wcscasecmp(), this function can handle NULL argument(s).

+  // A NULL C string is considered different to any non-NULL wide C string,

+  // including the empty string.

+  // NB: The implementations on different platforms slightly differ.

+  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE

+  // environment variable. On GNU platform this method uses wcscasecmp

+  // which compares according to LC_CTYPE category of the current locale.

+  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the

+  // current locale.

+  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,

+                                               const wchar_t* rhs);

+

+  // Returns true iff the given string ends with the given suffix, ignoring

+  // case. Any string is considered to end with an empty suffix.

+  static bool EndsWithCaseInsensitive(

+      const std::string& str, const std::string& suffix);

+

+  // Formats an int value as "%02d".

+  static std::string FormatIntWidth2(int value);  // "%02d" for width == 2

+

+  // Formats an int value as "%X".

+  static std::string FormatHexInt(int value);

+

+  // Formats a byte as "%02X".

+  static std::string FormatByte(unsigned char value);

+

+ private:

+  String();  // Not meant to be instantiated.

+};  // class String

+

+// Gets the content of the stringstream's buffer as an std::string.  Each '\0'

+// character in the buffer is replaced with "\\0".

+GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h
new file mode 100644
index 0000000..6b093e5
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h
@@ -0,0 +1,1012 @@
+// This file was GENERATED by command:

+//     pump.py gtest-tuple.h.pump

+// DO NOT EDIT BY HAND!!!

+

+// Copyright 2009 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)

+

+// Implements a subset of TR1 tuple needed by Google Test and Google Mock.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_

+

+#include <utility>  // For ::std::pair.

+

+// The compiler used in Symbian has a bug that prevents us from declaring the

+// tuple template as a friend (it complains that tuple is redefined).  This

+// hack bypasses the bug by declaring the members that should otherwise be

+// private as public.

+// Sun Studio versions < 12 also have the above bug.

+#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)

+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:

+#else

+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \

+    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \

+   private:

+#endif

+

+// GTEST_n_TUPLE_(T) is the type of an n-tuple.

+#define GTEST_0_TUPLE_(T) tuple<>

+#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \

+    void, void, void>

+#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \

+    void, void, void>

+#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \

+    void, void, void>

+#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \

+    void, void, void>

+#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \

+    void, void, void>

+#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \

+    void, void, void>

+#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \

+    void, void, void>

+#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \

+    T##7, void, void>

+#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \

+    T##7, T##8, void>

+#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \

+    T##7, T##8, T##9>

+

+// GTEST_n_TYPENAMES_(T) declares a list of n typenames.

+#define GTEST_0_TYPENAMES_(T)

+#define GTEST_1_TYPENAMES_(T) typename T##0

+#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1

+#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2

+#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3

+#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3, typename T##4

+#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3, typename T##4, typename T##5

+#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3, typename T##4, typename T##5, typename T##6

+#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7

+#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3, typename T##4, typename T##5, typename T##6, \

+    typename T##7, typename T##8

+#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \

+    typename T##3, typename T##4, typename T##5, typename T##6, \

+    typename T##7, typename T##8, typename T##9

+

+// In theory, defining stuff in the ::std namespace is undefined

+// behavior.  We can do this as we are playing the role of a standard

+// library vendor.

+namespace std {

+namespace tr1 {

+

+template <typename T0 = void, typename T1 = void, typename T2 = void,

+    typename T3 = void, typename T4 = void, typename T5 = void,

+    typename T6 = void, typename T7 = void, typename T8 = void,

+    typename T9 = void>

+class tuple;

+

+// Anything in namespace gtest_internal is Google Test's INTERNAL

+// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.

+namespace gtest_internal {

+

+// ByRef<T>::type is T if T is a reference; otherwise it's const T&.

+template <typename T>

+struct ByRef { typedef const T& type; };  // NOLINT

+template <typename T>

+struct ByRef<T&> { typedef T& type; };  // NOLINT

+

+// A handy wrapper for ByRef.

+#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type

+

+// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This

+// is the same as tr1::add_reference<T>::type.

+template <typename T>

+struct AddRef { typedef T& type; };  // NOLINT

+template <typename T>

+struct AddRef<T&> { typedef T& type; };  // NOLINT

+

+// A handy wrapper for AddRef.

+#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type

+

+// A helper for implementing get<k>().

+template <int k> class Get;

+

+// A helper for implementing tuple_element<k, T>.  kIndexValid is true

+// iff k < the number of fields in tuple type T.

+template <bool kIndexValid, int kIndex, class Tuple>

+struct TupleElement;

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {

+  typedef T0 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {

+  typedef T1 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {

+  typedef T2 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {

+  typedef T3 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {

+  typedef T4 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {

+  typedef T5 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {

+  typedef T6 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {

+  typedef T7 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {

+  typedef T8 type;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {

+  typedef T9 type;

+};

+

+}  // namespace gtest_internal

+

+template <>

+class tuple<> {

+ public:

+  tuple() {}

+  tuple(const tuple& /* t */)  {}

+  tuple& operator=(const tuple& /* t */) { return *this; }

+};

+

+template <GTEST_1_TYPENAMES_(T)>

+class GTEST_1_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}

+

+  tuple(const tuple& t) : f0_(t.f0_) {}

+

+  template <GTEST_1_TYPENAMES_(U)>

+  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_1_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_1_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    return *this;

+  }

+

+  T0 f0_;

+};

+

+template <GTEST_2_TYPENAMES_(T)>

+class GTEST_2_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),

+      f1_(f1) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}

+

+  template <GTEST_2_TYPENAMES_(U)>

+  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}

+  template <typename U0, typename U1>

+  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_2_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+  template <typename U0, typename U1>

+  tuple& operator=(const ::std::pair<U0, U1>& p) {

+    f0_ = p.first;

+    f1_ = p.second;

+    return *this;

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_2_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+};

+

+template <GTEST_3_TYPENAMES_(T)>

+class GTEST_3_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}

+

+  template <GTEST_3_TYPENAMES_(U)>

+  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_3_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_3_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+};

+

+template <GTEST_4_TYPENAMES_(T)>

+class GTEST_4_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),

+      f3_(f3) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}

+

+  template <GTEST_4_TYPENAMES_(U)>

+  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_4_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_4_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+};

+

+template <GTEST_5_TYPENAMES_(T)>

+class GTEST_5_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,

+      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),

+      f4_(t.f4_) {}

+

+  template <GTEST_5_TYPENAMES_(U)>

+  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_), f4_(t.f4_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_5_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_5_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    f4_ = t.f4_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+  T4 f4_;

+};

+

+template <GTEST_6_TYPENAMES_(T)>

+class GTEST_6_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,

+      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),

+      f5_(f5) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),

+      f4_(t.f4_), f5_(t.f5_) {}

+

+  template <GTEST_6_TYPENAMES_(U)>

+  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_6_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_6_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    f4_ = t.f4_;

+    f5_ = t.f5_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+  T4 f4_;

+  T5 f5_;

+};

+

+template <GTEST_7_TYPENAMES_(T)>

+class GTEST_7_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,

+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),

+      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),

+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}

+

+  template <GTEST_7_TYPENAMES_(U)>

+  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_7_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_7_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    f4_ = t.f4_;

+    f5_ = t.f5_;

+    f6_ = t.f6_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+  T4 f4_;

+  T5 f5_;

+  T6 f6_;

+};

+

+template <GTEST_8_TYPENAMES_(T)>

+class GTEST_8_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,

+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,

+      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),

+      f5_(f5), f6_(f6), f7_(f7) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),

+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}

+

+  template <GTEST_8_TYPENAMES_(U)>

+  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_8_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_8_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    f4_ = t.f4_;

+    f5_ = t.f5_;

+    f6_ = t.f6_;

+    f7_ = t.f7_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+  T4 f4_;

+  T5 f5_;

+  T6 f6_;

+  T7 f7_;

+};

+

+template <GTEST_9_TYPENAMES_(T)>

+class GTEST_9_TUPLE_(T) {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,

+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,

+      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),

+      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),

+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}

+

+  template <GTEST_9_TYPENAMES_(U)>

+  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_9_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_9_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    f4_ = t.f4_;

+    f5_ = t.f5_;

+    f6_ = t.f6_;

+    f7_ = t.f7_;

+    f8_ = t.f8_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+  T4 f4_;

+  T5 f5_;

+  T6 f6_;

+  T7 f7_;

+  T8 f8_;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+class tuple {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),

+      f9_() {}

+

+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,

+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,

+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,

+      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),

+      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}

+

+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),

+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}

+

+  template <GTEST_10_TYPENAMES_(U)>

+  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),

+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),

+      f9_(t.f9_) {}

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_10_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_10_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {

+    f0_ = t.f0_;

+    f1_ = t.f1_;

+    f2_ = t.f2_;

+    f3_ = t.f3_;

+    f4_ = t.f4_;

+    f5_ = t.f5_;

+    f6_ = t.f6_;

+    f7_ = t.f7_;

+    f8_ = t.f8_;

+    f9_ = t.f9_;

+    return *this;

+  }

+

+  T0 f0_;

+  T1 f1_;

+  T2 f2_;

+  T3 f3_;

+  T4 f4_;

+  T5 f5_;

+  T6 f6_;

+  T7 f7_;

+  T8 f8_;

+  T9 f9_;

+};

+

+// 6.1.3.2 Tuple creation functions.

+

+// Known limitations: we don't support passing an

+// std::tr1::reference_wrapper<T> to make_tuple().  And we don't

+// implement tie().

+

+inline tuple<> make_tuple() { return tuple<>(); }

+

+template <GTEST_1_TYPENAMES_(T)>

+inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {

+  return GTEST_1_TUPLE_(T)(f0);

+}

+

+template <GTEST_2_TYPENAMES_(T)>

+inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {

+  return GTEST_2_TUPLE_(T)(f0, f1);

+}

+

+template <GTEST_3_TYPENAMES_(T)>

+inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {

+  return GTEST_3_TUPLE_(T)(f0, f1, f2);

+}

+

+template <GTEST_4_TYPENAMES_(T)>

+inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3) {

+  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);

+}

+

+template <GTEST_5_TYPENAMES_(T)>

+inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3, const T4& f4) {

+  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);

+}

+

+template <GTEST_6_TYPENAMES_(T)>

+inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3, const T4& f4, const T5& f5) {

+  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);

+}

+

+template <GTEST_7_TYPENAMES_(T)>

+inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {

+  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);

+}

+

+template <GTEST_8_TYPENAMES_(T)>

+inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {

+  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);

+}

+

+template <GTEST_9_TYPENAMES_(T)>

+inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,

+    const T8& f8) {

+  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);

+}

+

+template <GTEST_10_TYPENAMES_(T)>

+inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,

+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,

+    const T8& f8, const T9& f9) {

+  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);

+}

+

+// 6.1.3.3 Tuple helper classes.

+

+template <typename Tuple> struct tuple_size;

+

+template <GTEST_0_TYPENAMES_(T)>

+struct tuple_size<GTEST_0_TUPLE_(T) > {

+  static const int value = 0;

+};

+

+template <GTEST_1_TYPENAMES_(T)>

+struct tuple_size<GTEST_1_TUPLE_(T) > {

+  static const int value = 1;

+};

+

+template <GTEST_2_TYPENAMES_(T)>

+struct tuple_size<GTEST_2_TUPLE_(T) > {

+  static const int value = 2;

+};

+

+template <GTEST_3_TYPENAMES_(T)>

+struct tuple_size<GTEST_3_TUPLE_(T) > {

+  static const int value = 3;

+};

+

+template <GTEST_4_TYPENAMES_(T)>

+struct tuple_size<GTEST_4_TUPLE_(T) > {

+  static const int value = 4;

+};

+

+template <GTEST_5_TYPENAMES_(T)>

+struct tuple_size<GTEST_5_TUPLE_(T) > {

+  static const int value = 5;

+};

+

+template <GTEST_6_TYPENAMES_(T)>

+struct tuple_size<GTEST_6_TUPLE_(T) > {

+  static const int value = 6;

+};

+

+template <GTEST_7_TYPENAMES_(T)>

+struct tuple_size<GTEST_7_TUPLE_(T) > {

+  static const int value = 7;

+};

+

+template <GTEST_8_TYPENAMES_(T)>

+struct tuple_size<GTEST_8_TUPLE_(T) > {

+  static const int value = 8;

+};

+

+template <GTEST_9_TYPENAMES_(T)>

+struct tuple_size<GTEST_9_TUPLE_(T) > {

+  static const int value = 9;

+};

+

+template <GTEST_10_TYPENAMES_(T)>

+struct tuple_size<GTEST_10_TUPLE_(T) > {

+  static const int value = 10;

+};

+

+template <int k, class Tuple>

+struct tuple_element {

+  typedef typename gtest_internal::TupleElement<

+      k < (tuple_size<Tuple>::value), k, Tuple>::type type;

+};

+

+#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type

+

+// 6.1.3.4 Element access.

+

+namespace gtest_internal {

+

+template <>

+class Get<0> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))

+  Field(Tuple& t) { return t.f0_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))

+  ConstField(const Tuple& t) { return t.f0_; }

+};

+

+template <>

+class Get<1> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))

+  Field(Tuple& t) { return t.f1_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))

+  ConstField(const Tuple& t) { return t.f1_; }

+};

+

+template <>

+class Get<2> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))

+  Field(Tuple& t) { return t.f2_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))

+  ConstField(const Tuple& t) { return t.f2_; }

+};

+

+template <>

+class Get<3> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))

+  Field(Tuple& t) { return t.f3_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))

+  ConstField(const Tuple& t) { return t.f3_; }

+};

+

+template <>

+class Get<4> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))

+  Field(Tuple& t) { return t.f4_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))

+  ConstField(const Tuple& t) { return t.f4_; }

+};

+

+template <>

+class Get<5> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))

+  Field(Tuple& t) { return t.f5_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))

+  ConstField(const Tuple& t) { return t.f5_; }

+};

+

+template <>

+class Get<6> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))

+  Field(Tuple& t) { return t.f6_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))

+  ConstField(const Tuple& t) { return t.f6_; }

+};

+

+template <>

+class Get<7> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))

+  Field(Tuple& t) { return t.f7_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))

+  ConstField(const Tuple& t) { return t.f7_; }

+};

+

+template <>

+class Get<8> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))

+  Field(Tuple& t) { return t.f8_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))

+  ConstField(const Tuple& t) { return t.f8_; }

+};

+

+template <>

+class Get<9> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))

+  Field(Tuple& t) { return t.f9_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))

+  ConstField(const Tuple& t) { return t.f9_; }

+};

+

+}  // namespace gtest_internal

+

+template <int k, GTEST_10_TYPENAMES_(T)>

+GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))

+get(GTEST_10_TUPLE_(T)& t) {

+  return gtest_internal::Get<k>::Field(t);

+}

+

+template <int k, GTEST_10_TYPENAMES_(T)>

+GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))

+get(const GTEST_10_TUPLE_(T)& t) {

+  return gtest_internal::Get<k>::ConstField(t);

+}

+

+// 6.1.3.5 Relational operators

+

+// We only implement == and !=, as we don't have a need for the rest yet.

+

+namespace gtest_internal {

+

+// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the

+// first k fields of t1 equals the first k fields of t2.

+// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if

+// k1 != k2.

+template <int kSize1, int kSize2>

+struct SameSizeTuplePrefixComparator;

+

+template <>

+struct SameSizeTuplePrefixComparator<0, 0> {

+  template <class Tuple1, class Tuple2>

+  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {

+    return true;

+  }

+};

+

+template <int k>

+struct SameSizeTuplePrefixComparator<k, k> {

+  template <class Tuple1, class Tuple2>

+  static bool Eq(const Tuple1& t1, const Tuple2& t2) {

+    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&

+        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);

+  }

+};

+

+}  // namespace gtest_internal

+

+template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>

+inline bool operator==(const GTEST_10_TUPLE_(T)& t,

+                       const GTEST_10_TUPLE_(U)& u) {

+  return gtest_internal::SameSizeTuplePrefixComparator<

+      tuple_size<GTEST_10_TUPLE_(T) >::value,

+      tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);

+}

+

+template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>

+inline bool operator!=(const GTEST_10_TUPLE_(T)& t,

+                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }

+

+// 6.1.4 Pairs.

+// Unimplemented.

+

+}  // namespace tr1

+}  // namespace std

+

+#undef GTEST_0_TUPLE_

+#undef GTEST_1_TUPLE_

+#undef GTEST_2_TUPLE_

+#undef GTEST_3_TUPLE_

+#undef GTEST_4_TUPLE_

+#undef GTEST_5_TUPLE_

+#undef GTEST_6_TUPLE_

+#undef GTEST_7_TUPLE_

+#undef GTEST_8_TUPLE_

+#undef GTEST_9_TUPLE_

+#undef GTEST_10_TUPLE_

+

+#undef GTEST_0_TYPENAMES_

+#undef GTEST_1_TYPENAMES_

+#undef GTEST_2_TYPENAMES_

+#undef GTEST_3_TYPENAMES_

+#undef GTEST_4_TYPENAMES_

+#undef GTEST_5_TYPENAMES_

+#undef GTEST_6_TYPENAMES_

+#undef GTEST_7_TYPENAMES_

+#undef GTEST_8_TYPENAMES_

+#undef GTEST_9_TYPENAMES_

+#undef GTEST_10_TYPENAMES_

+

+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_

+#undef GTEST_BY_REF_

+#undef GTEST_ADD_REF_

+#undef GTEST_TUPLE_ELEMENT_

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump
new file mode 100644
index 0000000..4506a74
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump
@@ -0,0 +1,339 @@
+$$ -*- mode: c++; -*-

+$var n = 10  $$ Maximum number of tuple fields we want to support.

+$$ This meta comment fixes auto-indentation in Emacs. }}

+// Copyright 2009 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)

+

+// Implements a subset of TR1 tuple needed by Google Test and Google Mock.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_

+

+#include <utility>  // For ::std::pair.

+

+// The compiler used in Symbian has a bug that prevents us from declaring the

+// tuple template as a friend (it complains that tuple is redefined).  This

+// hack bypasses the bug by declaring the members that should otherwise be

+// private as public.

+// Sun Studio versions < 12 also have the above bug.

+#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)

+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:

+#else

+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \

+    template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple; \

+   private:

+#endif

+

+

+$range i 0..n-1

+$range j 0..n

+$range k 1..n

+// GTEST_n_TUPLE_(T) is the type of an n-tuple.

+#define GTEST_0_TUPLE_(T) tuple<>

+

+$for k [[

+$range m 0..k-1

+$range m2 k..n-1

+#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]>

+

+]]

+

+// GTEST_n_TYPENAMES_(T) declares a list of n typenames.

+

+$for j [[

+$range m 0..j-1

+#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]]

+

+

+]]

+

+// In theory, defining stuff in the ::std namespace is undefined

+// behavior.  We can do this as we are playing the role of a standard

+// library vendor.

+namespace std {

+namespace tr1 {

+

+template <$for i, [[typename T$i = void]]>

+class tuple;

+

+// Anything in namespace gtest_internal is Google Test's INTERNAL

+// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.

+namespace gtest_internal {

+

+// ByRef<T>::type is T if T is a reference; otherwise it's const T&.

+template <typename T>

+struct ByRef { typedef const T& type; };  // NOLINT

+template <typename T>

+struct ByRef<T&> { typedef T& type; };  // NOLINT

+

+// A handy wrapper for ByRef.

+#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type

+

+// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This

+// is the same as tr1::add_reference<T>::type.

+template <typename T>

+struct AddRef { typedef T& type; };  // NOLINT

+template <typename T>

+struct AddRef<T&> { typedef T& type; };  // NOLINT

+

+// A handy wrapper for AddRef.

+#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type

+

+// A helper for implementing get<k>().

+template <int k> class Get;

+

+// A helper for implementing tuple_element<k, T>.  kIndexValid is true

+// iff k < the number of fields in tuple type T.

+template <bool kIndexValid, int kIndex, class Tuple>

+struct TupleElement;

+

+

+$for i [[

+template <GTEST_$(n)_TYPENAMES_(T)>

+struct TupleElement<true, $i, GTEST_$(n)_TUPLE_(T) > {

+  typedef T$i type;

+};

+

+

+]]

+}  // namespace gtest_internal

+

+template <>

+class tuple<> {

+ public:

+  tuple() {}

+  tuple(const tuple& /* t */)  {}

+  tuple& operator=(const tuple& /* t */) { return *this; }

+};

+

+

+$for k [[

+$range m 0..k-1

+template <GTEST_$(k)_TYPENAMES_(T)>

+class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] {

+ public:

+  template <int k> friend class gtest_internal::Get;

+

+  tuple() : $for m, [[f$(m)_()]] {}

+

+  explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]]

+$for m, [[f$(m)_(f$m)]] {}

+

+  tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}

+

+  template <GTEST_$(k)_TYPENAMES_(U)>

+  tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}

+

+$if k == 2 [[

+  template <typename U0, typename U1>

+  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}

+

+]]

+

+  tuple& operator=(const tuple& t) { return CopyFrom(t); }

+

+  template <GTEST_$(k)_TYPENAMES_(U)>

+  tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) {

+    return CopyFrom(t);

+  }

+

+$if k == 2 [[

+  template <typename U0, typename U1>

+  tuple& operator=(const ::std::pair<U0, U1>& p) {

+    f0_ = p.first;

+    f1_ = p.second;

+    return *this;

+  }

+

+]]

+

+  GTEST_DECLARE_TUPLE_AS_FRIEND_

+

+  template <GTEST_$(k)_TYPENAMES_(U)>

+  tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) {

+

+$for m [[

+    f$(m)_ = t.f$(m)_;

+

+]]

+    return *this;

+  }

+

+

+$for m [[

+  T$m f$(m)_;

+

+]]

+};

+

+

+]]

+// 6.1.3.2 Tuple creation functions.

+

+// Known limitations: we don't support passing an

+// std::tr1::reference_wrapper<T> to make_tuple().  And we don't

+// implement tie().

+

+inline tuple<> make_tuple() { return tuple<>(); }

+

+$for k [[

+$range m 0..k-1

+

+template <GTEST_$(k)_TYPENAMES_(T)>

+inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) {

+  return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]);

+}

+

+]]

+

+// 6.1.3.3 Tuple helper classes.

+

+template <typename Tuple> struct tuple_size;

+

+

+$for j [[

+template <GTEST_$(j)_TYPENAMES_(T)>

+struct tuple_size<GTEST_$(j)_TUPLE_(T) > {

+  static const int value = $j;

+};

+

+

+]]

+template <int k, class Tuple>

+struct tuple_element {

+  typedef typename gtest_internal::TupleElement<

+      k < (tuple_size<Tuple>::value), k, Tuple>::type type;

+};

+

+#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type

+

+// 6.1.3.4 Element access.

+

+namespace gtest_internal {

+

+

+$for i [[

+template <>

+class Get<$i> {

+ public:

+  template <class Tuple>

+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))

+  Field(Tuple& t) { return t.f$(i)_; }  // NOLINT

+

+  template <class Tuple>

+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))

+  ConstField(const Tuple& t) { return t.f$(i)_; }

+};

+

+

+]]

+}  // namespace gtest_internal

+

+template <int k, GTEST_$(n)_TYPENAMES_(T)>

+GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T)))

+get(GTEST_$(n)_TUPLE_(T)& t) {

+  return gtest_internal::Get<k>::Field(t);

+}

+

+template <int k, GTEST_$(n)_TYPENAMES_(T)>

+GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_$(n)_TUPLE_(T)))

+get(const GTEST_$(n)_TUPLE_(T)& t) {

+  return gtest_internal::Get<k>::ConstField(t);

+}

+

+// 6.1.3.5 Relational operators

+

+// We only implement == and !=, as we don't have a need for the rest yet.

+

+namespace gtest_internal {

+

+// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the

+// first k fields of t1 equals the first k fields of t2.

+// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if

+// k1 != k2.

+template <int kSize1, int kSize2>

+struct SameSizeTuplePrefixComparator;

+

+template <>

+struct SameSizeTuplePrefixComparator<0, 0> {

+  template <class Tuple1, class Tuple2>

+  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {

+    return true;

+  }

+};

+

+template <int k>

+struct SameSizeTuplePrefixComparator<k, k> {

+  template <class Tuple1, class Tuple2>

+  static bool Eq(const Tuple1& t1, const Tuple2& t2) {

+    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&

+        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);

+  }

+};

+

+}  // namespace gtest_internal

+

+template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>

+inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t,

+                       const GTEST_$(n)_TUPLE_(U)& u) {

+  return gtest_internal::SameSizeTuplePrefixComparator<

+      tuple_size<GTEST_$(n)_TUPLE_(T) >::value,

+      tuple_size<GTEST_$(n)_TUPLE_(U) >::value>::Eq(t, u);

+}

+

+template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>

+inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t,

+                       const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); }

+

+// 6.1.4 Pairs.

+// Unimplemented.

+

+}  // namespace tr1

+}  // namespace std

+

+

+$for j [[

+#undef GTEST_$(j)_TUPLE_

+

+]]

+

+

+$for j [[

+#undef GTEST_$(j)_TYPENAMES_

+

+]]

+

+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_

+#undef GTEST_BY_REF_

+#undef GTEST_ADD_REF_

+#undef GTEST_TUPLE_ELEMENT_

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h
new file mode 100644
index 0000000..649e2dc
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h
@@ -0,0 +1,3331 @@
+// This file was GENERATED by command:

+//     pump.py gtest-type-util.h.pump

+// DO NOT EDIT BY HAND!!!

+

+// 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: wan@google.com (Zhanyong Wan)

+

+// Type utilities needed for implementing typed and type-parameterized

+// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!

+//

+// Currently we support at most 50 types in a list, and at most 50

+// type-parameterized tests in one type-parameterized test case.

+// Please contact googletestframework@googlegroups.com if you need

+// more.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_

+

+#include "gtest/internal/gtest-port.h"

+

+// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using

+// libstdc++ (which is where cxxabi.h comes from).

+# if GTEST_HAS_CXXABI_H_

+#  include <cxxabi.h>

+# elif defined(__HP_aCC)

+#  include <acxx_demangle.h>

+# endif  // GTEST_HASH_CXXABI_H_

+

+namespace testing {

+namespace internal {

+

+// GetTypeName<T>() returns a human-readable name of type T.

+// NB: This function is also used in Google Mock, so don't move it inside of

+// the typed-test-only section below.

+template <typename T>

+std::string GetTypeName() {

+# if GTEST_HAS_RTTI

+

+  const char* const name = typeid(T).name();

+#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)

+  int status = 0;

+  // gcc's implementation of typeid(T).name() mangles the type name,

+  // so we have to demangle it.

+#   if GTEST_HAS_CXXABI_H_

+  using abi::__cxa_demangle;

+#   endif  // GTEST_HAS_CXXABI_H_

+  char* const readable_name = __cxa_demangle(name, 0, 0, &status);

+  const std::string name_str(status == 0 ? readable_name : name);

+  free(readable_name);

+  return name_str;

+#  else

+  return name;

+#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC

+

+# else

+

+  return "<type>";

+

+# endif  // GTEST_HAS_RTTI

+}

+

+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P

+

+// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same

+// type.  This can be used as a compile-time assertion to ensure that

+// two types are equal.

+

+template <typename T1, typename T2>

+struct AssertTypeEq;

+

+template <typename T>

+struct AssertTypeEq<T, T> {

+  typedef bool type;

+};

+

+// A unique type used as the default value for the arguments of class

+// template Types.  This allows us to simulate variadic templates

+// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't

+// support directly.

+struct None {};

+

+// The following family of struct and struct templates are used to

+// represent type lists.  In particular, TypesN<T1, T2, ..., TN>

+// represents a type list with N types (T1, T2, ..., and TN) in it.

+// Except for Types0, every struct in the family has two member types:

+// Head for the first type in the list, and Tail for the rest of the

+// list.

+

+// The empty type list.

+struct Types0 {};

+

+// Type lists of length 1, 2, 3, and so on.

+

+template <typename T1>

+struct Types1 {

+  typedef T1 Head;

+  typedef Types0 Tail;

+};

+template <typename T1, typename T2>

+struct Types2 {

+  typedef T1 Head;

+  typedef Types1<T2> Tail;

+};

+

+template <typename T1, typename T2, typename T3>

+struct Types3 {

+  typedef T1 Head;

+  typedef Types2<T2, T3> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4>

+struct Types4 {

+  typedef T1 Head;

+  typedef Types3<T2, T3, T4> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+struct Types5 {

+  typedef T1 Head;

+  typedef Types4<T2, T3, T4, T5> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+struct Types6 {

+  typedef T1 Head;

+  typedef Types5<T2, T3, T4, T5, T6> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+struct Types7 {

+  typedef T1 Head;

+  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+struct Types8 {

+  typedef T1 Head;

+  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+struct Types9 {

+  typedef T1 Head;

+  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+struct Types10 {

+  typedef T1 Head;

+  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11>

+struct Types11 {

+  typedef T1 Head;

+  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12>

+struct Types12 {

+  typedef T1 Head;

+  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13>

+struct Types13 {

+  typedef T1 Head;

+  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14>

+struct Types14 {

+  typedef T1 Head;

+  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15>

+struct Types15 {

+  typedef T1 Head;

+  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16>

+struct Types16 {

+  typedef T1 Head;

+  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17>

+struct Types17 {

+  typedef T1 Head;

+  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18>

+struct Types18 {

+  typedef T1 Head;

+  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19>

+struct Types19 {

+  typedef T1 Head;

+  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20>

+struct Types20 {

+  typedef T1 Head;

+  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21>

+struct Types21 {

+  typedef T1 Head;

+  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22>

+struct Types22 {

+  typedef T1 Head;

+  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23>

+struct Types23 {

+  typedef T1 Head;

+  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24>

+struct Types24 {

+  typedef T1 Head;

+  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25>

+struct Types25 {

+  typedef T1 Head;

+  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26>

+struct Types26 {

+  typedef T1 Head;

+  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27>

+struct Types27 {

+  typedef T1 Head;

+  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28>

+struct Types28 {

+  typedef T1 Head;

+  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29>

+struct Types29 {

+  typedef T1 Head;

+  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30>

+struct Types30 {

+  typedef T1 Head;

+  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31>

+struct Types31 {

+  typedef T1 Head;

+  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32>

+struct Types32 {

+  typedef T1 Head;

+  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33>

+struct Types33 {

+  typedef T1 Head;

+  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34>

+struct Types34 {

+  typedef T1 Head;

+  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35>

+struct Types35 {

+  typedef T1 Head;

+  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36>

+struct Types36 {

+  typedef T1 Head;

+  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37>

+struct Types37 {

+  typedef T1 Head;

+  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38>

+struct Types38 {

+  typedef T1 Head;

+  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39>

+struct Types39 {

+  typedef T1 Head;

+  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40>

+struct Types40 {

+  typedef T1 Head;

+  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41>

+struct Types41 {

+  typedef T1 Head;

+  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42>

+struct Types42 {

+  typedef T1 Head;

+  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43>

+struct Types43 {

+  typedef T1 Head;

+  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44>

+struct Types44 {

+  typedef T1 Head;

+  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45>

+struct Types45 {

+  typedef T1 Head;

+  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44, T45> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46>

+struct Types46 {

+  typedef T1 Head;

+  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44, T45, T46> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47>

+struct Types47 {

+  typedef T1 Head;

+  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44, T45, T46, T47> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48>

+struct Types48 {

+  typedef T1 Head;

+  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44, T45, T46, T47, T48> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49>

+struct Types49 {

+  typedef T1 Head;

+  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44, T45, T46, T47, T48, T49> Tail;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49, typename T50>

+struct Types50 {

+  typedef T1 Head;

+  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+      T44, T45, T46, T47, T48, T49, T50> Tail;

+};

+

+

+}  // namespace internal

+

+// We don't want to require the users to write TypesN<...> directly,

+// as that would require them to count the length.  Types<...> is much

+// easier to write, but generates horrible messages when there is a

+// compiler error, as gcc insists on printing out each template

+// argument, even if it has the default value (this means Types<int>

+// will appear as Types<int, None, None, ..., None> in the compiler

+// errors).

+//

+// Our solution is to combine the best part of the two approaches: a

+// user would write Types<T1, ..., TN>, and Google Test will translate

+// that to TypesN<T1, ..., TN> internally to make error messages

+// readable.  The translation is done by the 'type' member of the

+// Types template.

+template <typename T1 = internal::None, typename T2 = internal::None,

+    typename T3 = internal::None, typename T4 = internal::None,

+    typename T5 = internal::None, typename T6 = internal::None,

+    typename T7 = internal::None, typename T8 = internal::None,

+    typename T9 = internal::None, typename T10 = internal::None,

+    typename T11 = internal::None, typename T12 = internal::None,

+    typename T13 = internal::None, typename T14 = internal::None,

+    typename T15 = internal::None, typename T16 = internal::None,

+    typename T17 = internal::None, typename T18 = internal::None,

+    typename T19 = internal::None, typename T20 = internal::None,

+    typename T21 = internal::None, typename T22 = internal::None,

+    typename T23 = internal::None, typename T24 = internal::None,

+    typename T25 = internal::None, typename T26 = internal::None,

+    typename T27 = internal::None, typename T28 = internal::None,

+    typename T29 = internal::None, typename T30 = internal::None,

+    typename T31 = internal::None, typename T32 = internal::None,

+    typename T33 = internal::None, typename T34 = internal::None,

+    typename T35 = internal::None, typename T36 = internal::None,

+    typename T37 = internal::None, typename T38 = internal::None,

+    typename T39 = internal::None, typename T40 = internal::None,

+    typename T41 = internal::None, typename T42 = internal::None,

+    typename T43 = internal::None, typename T44 = internal::None,

+    typename T45 = internal::None, typename T46 = internal::None,

+    typename T47 = internal::None, typename T48 = internal::None,

+    typename T49 = internal::None, typename T50 = internal::None>

+struct Types {

+  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;

+};

+

+template <>

+struct Types<internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types0 type;

+};

+template <typename T1>

+struct Types<T1, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types1<T1> type;

+};

+template <typename T1, typename T2>

+struct Types<T1, T2, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types2<T1, T2> type;

+};

+template <typename T1, typename T2, typename T3>

+struct Types<T1, T2, T3, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types3<T1, T2, T3> type;

+};

+template <typename T1, typename T2, typename T3, typename T4>

+struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types4<T1, T2, T3, T4> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types5<T1, T2, T3, T4, T5> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,

+      T12> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,

+      T26> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,

+      T40> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None, internal::None> {

+  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None, internal::None> {

+  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,

+    internal::None, internal::None, internal::None, internal::None,

+    internal::None> {

+  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,

+    T46, internal::None, internal::None, internal::None, internal::None> {

+  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45, T46> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,

+    T46, T47, internal::None, internal::None, internal::None> {

+  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45, T46, T47> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,

+    T46, T47, T48, internal::None, internal::None> {

+  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45, T46, T47, T48> type;

+};

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49>

+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,

+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,

+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,

+    T46, T47, T48, T49, internal::None> {

+  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;

+};

+

+namespace internal {

+

+# define GTEST_TEMPLATE_ template <typename T> class

+

+// The template "selector" struct TemplateSel<Tmpl> is used to

+// represent Tmpl, which must be a class template with one type

+// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined

+// as the type Tmpl<T>.  This allows us to actually instantiate the

+// template "selected" by TemplateSel<Tmpl>.

+//

+// This trick is necessary for simulating typedef for class templates,

+// which C++ doesn't support directly.

+template <GTEST_TEMPLATE_ Tmpl>

+struct TemplateSel {

+  template <typename T>

+  struct Bind {

+    typedef Tmpl<T> type;

+  };

+};

+

+# define GTEST_BIND_(TmplSel, T) \

+  TmplSel::template Bind<T>::type

+

+// A unique struct template used as the default value for the

+// arguments of class template Templates.  This allows us to simulate

+// variadic templates (e.g. Templates<int>, Templates<int, double>,

+// and etc), which C++ doesn't support directly.

+template <typename T>

+struct NoneT {};

+

+// The following family of struct and struct templates are used to

+// represent template lists.  In particular, TemplatesN<T1, T2, ...,

+// TN> represents a list of N templates (T1, T2, ..., and TN).  Except

+// for Templates0, every struct in the family has two member types:

+// Head for the selector of the first template in the list, and Tail

+// for the rest of the list.

+

+// The empty template list.

+struct Templates0 {};

+

+// Template lists of length 1, 2, 3, and so on.

+

+template <GTEST_TEMPLATE_ T1>

+struct Templates1 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates0 Tail;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>

+struct Templates2 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates1<T2> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>

+struct Templates3 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates2<T2, T3> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4>

+struct Templates4 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates3<T2, T3, T4> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>

+struct Templates5 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates4<T2, T3, T4, T5> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>

+struct Templates6 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates5<T2, T3, T4, T5, T6> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7>

+struct Templates7 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>

+struct Templates8 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>

+struct Templates9 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10>

+struct Templates10 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>

+struct Templates11 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>

+struct Templates12 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13>

+struct Templates13 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>

+struct Templates14 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>

+struct Templates15 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16>

+struct Templates16 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>

+struct Templates17 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>

+struct Templates18 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19>

+struct Templates19 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>

+struct Templates20 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>

+struct Templates21 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22>

+struct Templates22 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>

+struct Templates23 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>

+struct Templates24 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25>

+struct Templates25 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>

+struct Templates26 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>

+struct Templates27 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28>

+struct Templates28 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>

+struct Templates29 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>

+struct Templates30 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31>

+struct Templates31 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>

+struct Templates32 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>

+struct Templates33 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34>

+struct Templates34 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>

+struct Templates35 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>

+struct Templates36 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37>

+struct Templates37 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>

+struct Templates38 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>

+struct Templates39 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40>

+struct Templates40 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>

+struct Templates41 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>

+struct Templates42 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43>

+struct Templates43 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>

+struct Templates44 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>

+struct Templates45 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44, T45> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46>

+struct Templates46 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44, T45, T46> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>

+struct Templates47 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44, T45, T46, T47> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>

+struct Templates48 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44, T45, T46, T47, T48> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,

+    GTEST_TEMPLATE_ T49>

+struct Templates49 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44, T45, T46, T47, T48, T49> Tail;

+};

+

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,

+    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>

+struct Templates50 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,

+      T43, T44, T45, T46, T47, T48, T49, T50> Tail;

+};

+

+

+// We don't want to require the users to write TemplatesN<...> directly,

+// as that would require them to count the length.  Templates<...> is much

+// easier to write, but generates horrible messages when there is a

+// compiler error, as gcc insists on printing out each template

+// argument, even if it has the default value (this means Templates<list>

+// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler

+// errors).

+//

+// Our solution is to combine the best part of the two approaches: a

+// user would write Templates<T1, ..., TN>, and Google Test will translate

+// that to TemplatesN<T1, ..., TN> internally to make error messages

+// readable.  The translation is done by the 'type' member of the

+// Templates template.

+template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,

+    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,

+    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,

+    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,

+    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,

+    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,

+    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,

+    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,

+    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,

+    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,

+    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,

+    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,

+    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,

+    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,

+    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,

+    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,

+    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,

+    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,

+    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,

+    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,

+    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,

+    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,

+    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,

+    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,

+    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>

+struct Templates {

+  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;

+};

+

+template <>

+struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT> {

+  typedef Templates0 type;

+};

+template <GTEST_TEMPLATE_ T1>

+struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT> {

+  typedef Templates1<T1> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>

+struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT> {

+  typedef Templates2<T1, T2> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>

+struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates3<T1, T2, T3> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4>

+struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates4<T1, T2, T3, T4> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>

+struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates5<T1, T2, T3, T4, T5> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>

+struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates6<T1, T2, T3, T4, T5, T6> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT> {

+  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT> {

+  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT> {

+  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT> {

+  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT> {

+  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT> {

+  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT> {

+  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT> {

+  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44, T45> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    T45, T46, NoneT, NoneT, NoneT, NoneT> {

+  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44, T45, T46> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    T45, T46, T47, NoneT, NoneT, NoneT> {

+  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44, T45, T46, T47> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    T45, T46, T47, T48, NoneT, NoneT> {

+  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44, T45, T46, T47, T48> type;

+};

+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,

+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,

+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,

+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,

+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,

+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,

+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,

+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,

+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,

+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,

+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,

+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,

+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,

+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,

+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,

+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,

+    GTEST_TEMPLATE_ T49>

+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,

+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,

+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,

+    T45, T46, T47, T48, T49, NoneT> {

+  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,

+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,

+      T42, T43, T44, T45, T46, T47, T48, T49> type;

+};

+

+// The TypeList template makes it possible to use either a single type

+// or a Types<...> list in TYPED_TEST_CASE() and

+// INSTANTIATE_TYPED_TEST_CASE_P().

+

+template <typename T>

+struct TypeList {

+  typedef Types1<T> type;

+};

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10,

+    typename T11, typename T12, typename T13, typename T14, typename T15,

+    typename T16, typename T17, typename T18, typename T19, typename T20,

+    typename T21, typename T22, typename T23, typename T24, typename T25,

+    typename T26, typename T27, typename T28, typename T29, typename T30,

+    typename T31, typename T32, typename T33, typename T34, typename T35,

+    typename T36, typename T37, typename T38, typename T39, typename T40,

+    typename T41, typename T42, typename T43, typename T44, typename T45,

+    typename T46, typename T47, typename T48, typename T49, typename T50>

+struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,

+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,

+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,

+    T44, T45, T46, T47, T48, T49, T50> > {

+  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,

+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,

+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,

+      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;

+};

+

+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump
new file mode 100644
index 0000000..cc2ec7a
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump
@@ -0,0 +1,297 @@
+$$ -*- mode: c++; -*-

+$var n = 50  $$ Maximum length of type lists we want to support.

+// 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: wan@google.com (Zhanyong Wan)

+

+// Type utilities needed for implementing typed and type-parameterized

+// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!

+//

+// Currently we support at most $n types in a list, and at most $n

+// type-parameterized tests in one type-parameterized test case.

+// Please contact googletestframework@googlegroups.com if you need

+// more.

+

+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_

+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_

+

+#include "gtest/internal/gtest-port.h"

+

+// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using

+// libstdc++ (which is where cxxabi.h comes from).

+# if GTEST_HAS_CXXABI_H_

+#  include <cxxabi.h>

+# elif defined(__HP_aCC)

+#  include <acxx_demangle.h>

+# endif  // GTEST_HASH_CXXABI_H_

+

+namespace testing {

+namespace internal {

+

+// GetTypeName<T>() returns a human-readable name of type T.

+// NB: This function is also used in Google Mock, so don't move it inside of

+// the typed-test-only section below.

+template <typename T>

+std::string GetTypeName() {

+# if GTEST_HAS_RTTI

+

+  const char* const name = typeid(T).name();

+#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)

+  int status = 0;

+  // gcc's implementation of typeid(T).name() mangles the type name,

+  // so we have to demangle it.

+#   if GTEST_HAS_CXXABI_H_

+  using abi::__cxa_demangle;

+#   endif  // GTEST_HAS_CXXABI_H_

+  char* const readable_name = __cxa_demangle(name, 0, 0, &status);

+  const std::string name_str(status == 0 ? readable_name : name);

+  free(readable_name);

+  return name_str;

+#  else

+  return name;

+#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC

+

+# else

+

+  return "<type>";

+

+# endif  // GTEST_HAS_RTTI

+}

+

+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P

+

+// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same

+// type.  This can be used as a compile-time assertion to ensure that

+// two types are equal.

+

+template <typename T1, typename T2>

+struct AssertTypeEq;

+

+template <typename T>

+struct AssertTypeEq<T, T> {

+  typedef bool type;

+};

+

+// A unique type used as the default value for the arguments of class

+// template Types.  This allows us to simulate variadic templates

+// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't

+// support directly.

+struct None {};

+

+// The following family of struct and struct templates are used to

+// represent type lists.  In particular, TypesN<T1, T2, ..., TN>

+// represents a type list with N types (T1, T2, ..., and TN) in it.

+// Except for Types0, every struct in the family has two member types:

+// Head for the first type in the list, and Tail for the rest of the

+// list.

+

+// The empty type list.

+struct Types0 {};

+

+// Type lists of length 1, 2, 3, and so on.

+

+template <typename T1>

+struct Types1 {

+  typedef T1 Head;

+  typedef Types0 Tail;

+};

+

+$range i 2..n

+

+$for i [[

+$range j 1..i

+$range k 2..i

+template <$for j, [[typename T$j]]>

+struct Types$i {

+  typedef T1 Head;

+  typedef Types$(i-1)<$for k, [[T$k]]> Tail;

+};

+

+

+]]

+

+}  // namespace internal

+

+// We don't want to require the users to write TypesN<...> directly,

+// as that would require them to count the length.  Types<...> is much

+// easier to write, but generates horrible messages when there is a

+// compiler error, as gcc insists on printing out each template

+// argument, even if it has the default value (this means Types<int>

+// will appear as Types<int, None, None, ..., None> in the compiler

+// errors).

+//

+// Our solution is to combine the best part of the two approaches: a

+// user would write Types<T1, ..., TN>, and Google Test will translate

+// that to TypesN<T1, ..., TN> internally to make error messages

+// readable.  The translation is done by the 'type' member of the

+// Types template.

+

+$range i 1..n

+template <$for i, [[typename T$i = internal::None]]>

+struct Types {

+  typedef internal::Types$n<$for i, [[T$i]]> type;

+};

+

+template <>

+struct Types<$for i, [[internal::None]]> {

+  typedef internal::Types0 type;

+};

+

+$range i 1..n-1

+$for i [[

+$range j 1..i

+$range k i+1..n

+template <$for j, [[typename T$j]]>

+struct Types<$for j, [[T$j]]$for k[[, internal::None]]> {

+  typedef internal::Types$i<$for j, [[T$j]]> type;

+};

+

+]]

+

+namespace internal {

+

+# define GTEST_TEMPLATE_ template <typename T> class

+

+// The template "selector" struct TemplateSel<Tmpl> is used to

+// represent Tmpl, which must be a class template with one type

+// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined

+// as the type Tmpl<T>.  This allows us to actually instantiate the

+// template "selected" by TemplateSel<Tmpl>.

+//

+// This trick is necessary for simulating typedef for class templates,

+// which C++ doesn't support directly.

+template <GTEST_TEMPLATE_ Tmpl>

+struct TemplateSel {

+  template <typename T>

+  struct Bind {

+    typedef Tmpl<T> type;

+  };

+};

+

+# define GTEST_BIND_(TmplSel, T) \

+  TmplSel::template Bind<T>::type

+

+// A unique struct template used as the default value for the

+// arguments of class template Templates.  This allows us to simulate

+// variadic templates (e.g. Templates<int>, Templates<int, double>,

+// and etc), which C++ doesn't support directly.

+template <typename T>

+struct NoneT {};

+

+// The following family of struct and struct templates are used to

+// represent template lists.  In particular, TemplatesN<T1, T2, ...,

+// TN> represents a list of N templates (T1, T2, ..., and TN).  Except

+// for Templates0, every struct in the family has two member types:

+// Head for the selector of the first template in the list, and Tail

+// for the rest of the list.

+

+// The empty template list.

+struct Templates0 {};

+

+// Template lists of length 1, 2, 3, and so on.

+

+template <GTEST_TEMPLATE_ T1>

+struct Templates1 {

+  typedef TemplateSel<T1> Head;

+  typedef Templates0 Tail;

+};

+

+$range i 2..n

+

+$for i [[

+$range j 1..i

+$range k 2..i

+template <$for j, [[GTEST_TEMPLATE_ T$j]]>

+struct Templates$i {

+  typedef TemplateSel<T1> Head;

+  typedef Templates$(i-1)<$for k, [[T$k]]> Tail;

+};

+

+

+]]

+

+// We don't want to require the users to write TemplatesN<...> directly,

+// as that would require them to count the length.  Templates<...> is much

+// easier to write, but generates horrible messages when there is a

+// compiler error, as gcc insists on printing out each template

+// argument, even if it has the default value (this means Templates<list>

+// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler

+// errors).

+//

+// Our solution is to combine the best part of the two approaches: a

+// user would write Templates<T1, ..., TN>, and Google Test will translate

+// that to TemplatesN<T1, ..., TN> internally to make error messages

+// readable.  The translation is done by the 'type' member of the

+// Templates template.

+

+$range i 1..n

+template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]>

+struct Templates {

+  typedef Templates$n<$for i, [[T$i]]> type;

+};

+

+template <>

+struct Templates<$for i, [[NoneT]]> {

+  typedef Templates0 type;

+};

+

+$range i 1..n-1

+$for i [[

+$range j 1..i

+$range k i+1..n

+template <$for j, [[GTEST_TEMPLATE_ T$j]]>

+struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> {

+  typedef Templates$i<$for j, [[T$j]]> type;

+};

+

+]]

+

+// The TypeList template makes it possible to use either a single type

+// or a Types<...> list in TYPED_TEST_CASE() and

+// INSTANTIATE_TYPED_TEST_CASE_P().

+

+template <typename T>

+struct TypeList {

+  typedef Types1<T> type;

+};

+

+

+$range i 1..n

+template <$for i, [[typename T$i]]>

+struct TypeList<Types<$for i, [[T$i]]> > {

+  typedef typename Types<$for i, [[T$i]]>::type type;

+};

+

+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-all.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-all.cc
new file mode 100644
index 0000000..abd8e71
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-all.cc
@@ -0,0 +1,48 @@
+// 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: mheule@google.com (Markus Heule)

+//

+// Google C++ Testing Framework (Google Test)

+//

+// Sometimes it's desirable to build Google Test by compiling a single file.

+// This file serves this purpose.

+

+// This line ensures that gtest.h can be compiled on its own, even

+// when it's fused.

+#include "gtest/gtest.h"

+

+// The following lines pull in the real gtest *.cc files.

+#include "src/gtest.cc"

+#include "src/gtest-death-test.cc"

+#include "src/gtest-filepath.cc"

+#include "src/gtest-port.cc"

+#include "src/gtest-printers.cc"

+#include "src/gtest-test-part.cc"

+#include "src/gtest-typed-test.cc"

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-death-test.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-death-test.cc
new file mode 100644
index 0000000..390506d
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-death-test.cc
@@ -0,0 +1,1344 @@
+// Copyright 2005, 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), vladl@google.com (Vlad Losev)

+//

+// This file implements death tests.

+

+#include "gtest/gtest-death-test.h"

+#include "gtest/internal/gtest-port.h"

+

+#if GTEST_HAS_DEATH_TEST

+

+# if GTEST_OS_MAC

+#  include <crt_externs.h>

+# endif  // GTEST_OS_MAC

+

+# include <errno.h>

+# include <fcntl.h>

+# include <limits.h>

+

+# if GTEST_OS_LINUX

+#  include <signal.h>

+# endif  // GTEST_OS_LINUX

+

+# include <stdarg.h>

+

+# if GTEST_OS_WINDOWS

+#  include <windows.h>

+# else

+#  include <sys/mman.h>

+#  include <sys/wait.h>

+# endif  // GTEST_OS_WINDOWS

+

+# if GTEST_OS_QNX

+#  include <spawn.h>

+# endif  // GTEST_OS_QNX

+

+#endif  // GTEST_HAS_DEATH_TEST

+

+#include "gtest/gtest-message.h"

+#include "gtest/internal/gtest-string.h"

+

+// Indicates that this translation unit is part of Google Test's

+// implementation.  It must come before gtest-internal-inl.h is

+// included, or there will be a compiler error.  This trick is to

+// prevent a user from accidentally including gtest-internal-inl.h in

+// his code.

+#define GTEST_IMPLEMENTATION_ 1

+#include "src/gtest-internal-inl.h"

+#undef GTEST_IMPLEMENTATION_

+

+namespace testing {

+

+// Constants.

+

+// The default death test style.

+static const char kDefaultDeathTestStyle[] = "fast";

+

+GTEST_DEFINE_string_(

+    death_test_style,

+    internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle),

+    "Indicates how to run a death test in a forked child process: "

+    "\"threadsafe\" (child process re-executes the test binary "

+    "from the beginning, running only the specific death test) or "

+    "\"fast\" (child process runs the death test immediately "

+    "after forking).");

+

+GTEST_DEFINE_bool_(

+    death_test_use_fork,

+    internal::BoolFromGTestEnv("death_test_use_fork", false),

+    "Instructs to use fork()/_exit() instead of clone() in death tests. "

+    "Ignored and always uses fork() on POSIX systems where clone() is not "

+    "implemented. Useful when running under valgrind or similar tools if "

+    "those do not support clone(). Valgrind 3.3.1 will just fail if "

+    "it sees an unsupported combination of clone() flags. "

+    "It is not recommended to use this flag w/o valgrind though it will "

+    "work in 99% of the cases. Once valgrind is fixed, this flag will "

+    "most likely be removed.");

+

+namespace internal {

+GTEST_DEFINE_string_(

+    internal_run_death_test, "",

+    "Indicates the file, line number, temporal index of "

+    "the single death test to run, and a file descriptor to "

+    "which a success code may be sent, all separated by "

+    "the '|' characters.  This flag is specified if and only if the current "

+    "process is a sub-process launched for running a thread-safe "

+    "death test.  FOR INTERNAL USE ONLY.");

+}  // namespace internal

+

+#if GTEST_HAS_DEATH_TEST

+

+namespace internal {

+

+// Valid only for fast death tests. Indicates the code is running in the

+// child process of a fast style death test.

+static bool g_in_fast_death_test_child = false;

+

+// Returns a Boolean value indicating whether the caller is currently

+// executing in the context of the death test child process.  Tools such as

+// Valgrind heap checkers may need this to modify their behavior in death

+// tests.  IMPORTANT: This is an internal utility.  Using it may break the

+// implementation of death tests.  User code MUST NOT use it.

+bool InDeathTestChild() {

+# if GTEST_OS_WINDOWS

+

+  // On Windows, death tests are thread-safe regardless of the value of the

+  // death_test_style flag.

+  return !GTEST_FLAG(internal_run_death_test).empty();

+

+# else

+

+  if (GTEST_FLAG(death_test_style) == "threadsafe")

+    return !GTEST_FLAG(internal_run_death_test).empty();

+  else

+    return g_in_fast_death_test_child;

+#endif

+}

+

+}  // namespace internal

+

+// ExitedWithCode constructor.

+ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {

+}

+

+// ExitedWithCode function-call operator.

+bool ExitedWithCode::operator()(int exit_status) const {

+# if GTEST_OS_WINDOWS

+

+  return exit_status == exit_code_;

+

+# else

+

+  return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;

+

+# endif  // GTEST_OS_WINDOWS

+}

+

+# if !GTEST_OS_WINDOWS

+// KilledBySignal constructor.

+KilledBySignal::KilledBySignal(int signum) : signum_(signum) {

+}

+

+// KilledBySignal function-call operator.

+bool KilledBySignal::operator()(int exit_status) const {

+  return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;

+}

+# endif  // !GTEST_OS_WINDOWS

+

+namespace internal {

+

+// Utilities needed for death tests.

+

+// Generates a textual description of a given exit code, in the format

+// specified by wait(2).

+static std::string ExitSummary(int exit_code) {

+  Message m;

+

+# if GTEST_OS_WINDOWS

+

+  m << "Exited with exit status " << exit_code;

+

+# else

+

+  if (WIFEXITED(exit_code)) {

+    m << "Exited with exit status " << WEXITSTATUS(exit_code);

+  } else if (WIFSIGNALED(exit_code)) {

+    m << "Terminated by signal " << WTERMSIG(exit_code);

+  }

+#  ifdef WCOREDUMP

+  if (WCOREDUMP(exit_code)) {

+    m << " (core dumped)";

+  }

+#  endif

+# endif  // GTEST_OS_WINDOWS

+

+  return m.GetString();

+}

+

+// Returns true if exit_status describes a process that was terminated

+// by a signal, or exited normally with a nonzero exit code.

+bool ExitedUnsuccessfully(int exit_status) {

+  return !ExitedWithCode(0)(exit_status);

+}

+

+# if !GTEST_OS_WINDOWS

+// Generates a textual failure message when a death test finds more than

+// one thread running, or cannot determine the number of threads, prior

+// to executing the given statement.  It is the responsibility of the

+// caller not to pass a thread_count of 1.

+static std::string DeathTestThreadWarning(size_t thread_count) {

+  Message msg;

+  msg << "Death tests use fork(), which is unsafe particularly"

+      << " in a threaded context. For this test, " << GTEST_NAME_ << " ";

+  if (thread_count == 0)

+    msg << "couldn't detect the number of threads.";

+  else

+    msg << "detected " << thread_count << " threads.";

+  return msg.GetString();

+}

+# endif  // !GTEST_OS_WINDOWS

+

+// Flag characters for reporting a death test that did not die.

+static const char kDeathTestLived = 'L';

+static const char kDeathTestReturned = 'R';

+static const char kDeathTestThrew = 'T';

+static const char kDeathTestInternalError = 'I';

+

+// An enumeration describing all of the possible ways that a death test can

+// conclude.  DIED means that the process died while executing the test

+// code; LIVED means that process lived beyond the end of the test code;

+// RETURNED means that the test statement attempted to execute a return

+// statement, which is not allowed; THREW means that the test statement

+// returned control by throwing an exception.  IN_PROGRESS means the test

+// has not yet concluded.

+// TODO(vladl@google.com): Unify names and possibly values for

+// AbortReason, DeathTestOutcome, and flag characters above.

+enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };

+

+// Routine for aborting the program which is safe to call from an

+// exec-style death test child process, in which case the error

+// message is propagated back to the parent process.  Otherwise, the

+// message is simply printed to stderr.  In either case, the program

+// then exits with status 1.

+void DeathTestAbort(const std::string& message) {

+  // On a POSIX system, this function may be called from a threadsafe-style

+  // death test child process, which operates on a very small stack.  Use

+  // the heap for any additional non-minuscule memory requirements.

+  const InternalRunDeathTestFlag* const flag =

+      GetUnitTestImpl()->internal_run_death_test_flag();

+  if (flag != NULL) {

+    FILE* parent = posix::FDOpen(flag->write_fd(), "w");

+    fputc(kDeathTestInternalError, parent);

+    fprintf(parent, "%s", message.c_str());

+    fflush(parent);

+    _exit(1);

+  } else {

+    fprintf(stderr, "%s", message.c_str());

+    fflush(stderr);

+    posix::Abort();

+  }

+}

+

+// A replacement for CHECK that calls DeathTestAbort if the assertion

+// fails.

+# define GTEST_DEATH_TEST_CHECK_(expression) \

+  do { \

+    if (!::testing::internal::IsTrue(expression)) { \

+      DeathTestAbort( \

+          ::std::string("CHECK failed: File ") + __FILE__ +  ", line " \

+          + ::testing::internal::StreamableToString(__LINE__) + ": " \

+          + #expression); \

+    } \

+  } while (::testing::internal::AlwaysFalse())

+

+// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for

+// evaluating any system call that fulfills two conditions: it must return

+// -1 on failure, and set errno to EINTR when it is interrupted and

+// should be tried again.  The macro expands to a loop that repeatedly

+// evaluates the expression as long as it evaluates to -1 and sets

+// errno to EINTR.  If the expression evaluates to -1 but errno is

+// something other than EINTR, DeathTestAbort is called.

+# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \

+  do { \

+    int gtest_retval; \

+    do { \

+      gtest_retval = (expression); \

+    } while (gtest_retval == -1 && errno == EINTR); \

+    if (gtest_retval == -1) { \

+      DeathTestAbort( \

+          ::std::string("CHECK failed: File ") + __FILE__ + ", line " \

+          + ::testing::internal::StreamableToString(__LINE__) + ": " \

+          + #expression + " != -1"); \

+    } \

+  } while (::testing::internal::AlwaysFalse())

+

+// Returns the message describing the last system error in errno.

+std::string GetLastErrnoDescription() {

+    return errno == 0 ? "" : posix::StrError(errno);

+}

+

+// This is called from a death test parent process to read a failure

+// message from the death test child process and log it with the FATAL

+// severity. On Windows, the message is read from a pipe handle. On other

+// platforms, it is read from a file descriptor.

+static void FailFromInternalError(int fd) {

+  Message error;

+  char buffer[256];

+  int num_read;

+

+  do {

+    while ((num_read = posix::Read(fd, buffer, 255)) > 0) {

+      buffer[num_read] = '\0';

+      error << buffer;

+    }

+  } while (num_read == -1 && errno == EINTR);

+

+  if (num_read == 0) {

+    GTEST_LOG_(FATAL) << error.GetString();

+  } else {

+    const int last_error = errno;

+    GTEST_LOG_(FATAL) << "Error while reading death test internal: "

+                      << GetLastErrnoDescription() << " [" << last_error << "]";

+  }

+}

+

+// Death test constructor.  Increments the running death test count

+// for the current test.

+DeathTest::DeathTest() {

+  TestInfo* const info = GetUnitTestImpl()->current_test_info();

+  if (info == NULL) {

+    DeathTestAbort("Cannot run a death test outside of a TEST or "

+                   "TEST_F construct");

+  }

+}

+

+// Creates and returns a death test by dispatching to the current

+// death test factory.

+bool DeathTest::Create(const char* statement, const RE* regex,

+                       const char* file, int line, DeathTest** test) {

+  return GetUnitTestImpl()->death_test_factory()->Create(

+      statement, regex, file, line, test);

+}

+

+const char* DeathTest::LastMessage() {

+  return last_death_test_message_.c_str();

+}

+

+void DeathTest::set_last_death_test_message(const std::string& message) {

+  last_death_test_message_ = message;

+}

+

+std::string DeathTest::last_death_test_message_;

+

+// Provides cross platform implementation for some death functionality.

+class DeathTestImpl : public DeathTest {

+ protected:

+  DeathTestImpl(const char* a_statement, const RE* a_regex)

+      : statement_(a_statement),

+        regex_(a_regex),

+        spawned_(false),

+        status_(-1),

+        outcome_(IN_PROGRESS),

+        read_fd_(-1),

+        write_fd_(-1) {}

+

+  // read_fd_ is expected to be closed and cleared by a derived class.

+  ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }

+

+  void Abort(AbortReason reason);

+  virtual bool Passed(bool status_ok);

+

+  const char* statement() const { return statement_; }

+  const RE* regex() const { return regex_; }

+  bool spawned() const { return spawned_; }

+  void set_spawned(bool is_spawned) { spawned_ = is_spawned; }

+  int status() const { return status_; }

+  void set_status(int a_status) { status_ = a_status; }

+  DeathTestOutcome outcome() const { return outcome_; }

+  void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }

+  int read_fd() const { return read_fd_; }

+  void set_read_fd(int fd) { read_fd_ = fd; }

+  int write_fd() const { return write_fd_; }

+  void set_write_fd(int fd) { write_fd_ = fd; }

+

+  // Called in the parent process only. Reads the result code of the death

+  // test child process via a pipe, interprets it to set the outcome_

+  // member, and closes read_fd_.  Outputs diagnostics and terminates in

+  // case of unexpected codes.

+  void ReadAndInterpretStatusByte();

+

+ private:

+  // The textual content of the code this object is testing.  This class

+  // doesn't own this string and should not attempt to delete it.

+  const char* const statement_;

+  // The regular expression which test output must match.  DeathTestImpl

+  // doesn't own this object and should not attempt to delete it.

+  const RE* const regex_;

+  // True if the death test child process has been successfully spawned.

+  bool spawned_;

+  // The exit status of the child process.

+  int status_;

+  // How the death test concluded.

+  DeathTestOutcome outcome_;

+  // Descriptor to the read end of the pipe to the child process.  It is

+  // always -1 in the child process.  The child keeps its write end of the

+  // pipe in write_fd_.

+  int read_fd_;

+  // Descriptor to the child's write end of the pipe to the parent process.

+  // It is always -1 in the parent process.  The parent keeps its end of the

+  // pipe in read_fd_.

+  int write_fd_;

+};

+

+// Called in the parent process only. Reads the result code of the death

+// test child process via a pipe, interprets it to set the outcome_

+// member, and closes read_fd_.  Outputs diagnostics and terminates in

+// case of unexpected codes.

+void DeathTestImpl::ReadAndInterpretStatusByte() {

+  char flag;

+  int bytes_read;

+

+  // The read() here blocks until data is available (signifying the

+  // failure of the death test) or until the pipe is closed (signifying

+  // its success), so it's okay to call this in the parent before

+  // the child process has exited.

+  do {

+    bytes_read = posix::Read(read_fd(), &flag, 1);

+  } while (bytes_read == -1 && errno == EINTR);

+

+  if (bytes_read == 0) {

+    set_outcome(DIED);

+  } else if (bytes_read == 1) {

+    switch (flag) {

+      case kDeathTestReturned:

+        set_outcome(RETURNED);

+        break;

+      case kDeathTestThrew:

+        set_outcome(THREW);

+        break;

+      case kDeathTestLived:

+        set_outcome(LIVED);

+        break;

+      case kDeathTestInternalError:

+        FailFromInternalError(read_fd());  // Does not return.

+        break;

+      default:

+        GTEST_LOG_(FATAL) << "Death test child process reported "

+                          << "unexpected status byte ("

+                          << static_cast<unsigned int>(flag) << ")";

+    }

+  } else {

+    GTEST_LOG_(FATAL) << "Read from death test child process failed: "

+                      << GetLastErrnoDescription();

+  }

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));

+  set_read_fd(-1);

+}

+

+// Signals that the death test code which should have exited, didn't.

+// Should be called only in a death test child process.

+// Writes a status byte to the child's status file descriptor, then

+// calls _exit(1).

+void DeathTestImpl::Abort(AbortReason reason) {

+  // The parent process considers the death test to be a failure if

+  // it finds any data in our pipe.  So, here we write a single flag byte

+  // to the pipe, then exit.

+  const char status_ch =

+      reason == TEST_DID_NOT_DIE ? kDeathTestLived :

+      reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;

+

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));

+  // We are leaking the descriptor here because on some platforms (i.e.,

+  // when built as Windows DLL), destructors of global objects will still

+  // run after calling _exit(). On such systems, write_fd_ will be

+  // indirectly closed from the destructor of UnitTestImpl, causing double

+  // close if it is also closed here. On debug configurations, double close

+  // may assert. As there are no in-process buffers to flush here, we are

+  // relying on the OS to close the descriptor after the process terminates

+  // when the destructors are not run.

+  _exit(1);  // Exits w/o any normal exit hooks (we were supposed to crash)

+}

+

+// Returns an indented copy of stderr output for a death test.

+// This makes distinguishing death test output lines from regular log lines

+// much easier.

+static ::std::string FormatDeathTestOutput(const ::std::string& output) {

+  ::std::string ret;

+  for (size_t at = 0; ; ) {

+    const size_t line_end = output.find('\n', at);

+    ret += "[  DEATH   ] ";

+    if (line_end == ::std::string::npos) {

+      ret += output.substr(at);

+      break;

+    }

+    ret += output.substr(at, line_end + 1 - at);

+    at = line_end + 1;

+  }

+  return ret;

+}

+

+// Assesses the success or failure of a death test, using both private

+// members which have previously been set, and one argument:

+//

+// Private data members:

+//   outcome:  An enumeration describing how the death test

+//             concluded: DIED, LIVED, THREW, or RETURNED.  The death test

+//             fails in the latter three cases.

+//   status:   The exit status of the child process. On *nix, it is in the

+//             in the format specified by wait(2). On Windows, this is the

+//             value supplied to the ExitProcess() API or a numeric code

+//             of the exception that terminated the program.

+//   regex:    A regular expression object to be applied to

+//             the test's captured standard error output; the death test

+//             fails if it does not match.

+//

+// Argument:

+//   status_ok: true if exit_status is acceptable in the context of

+//              this particular death test, which fails if it is false

+//

+// Returns true iff all of the above conditions are met.  Otherwise, the

+// first failing condition, in the order given above, is the one that is

+// reported. Also sets the last death test message string.

+bool DeathTestImpl::Passed(bool status_ok) {

+  if (!spawned())

+    return false;

+

+  const std::string error_message = GetCapturedStderr();

+

+  bool success = false;

+  Message buffer;

+

+  buffer << "Death test: " << statement() << "\n";

+  switch (outcome()) {

+    case LIVED:

+      buffer << "    Result: failed to die.\n"

+             << " Error msg:\n" << FormatDeathTestOutput(error_message);

+      break;

+    case THREW:

+      buffer << "    Result: threw an exception.\n"

+             << " Error msg:\n" << FormatDeathTestOutput(error_message);

+      break;

+    case RETURNED:

+      buffer << "    Result: illegal return in test statement.\n"

+             << " Error msg:\n" << FormatDeathTestOutput(error_message);

+      break;

+    case DIED:

+      if (status_ok) {

+        const bool matched = RE::PartialMatch(error_message.c_str(), *regex());

+        if (matched) {

+          success = true;

+        } else {

+          buffer << "    Result: died but not with expected error.\n"

+                 << "  Expected: " << regex()->pattern() << "\n"

+                 << "Actual msg:\n" << FormatDeathTestOutput(error_message);

+        }

+      } else {

+        buffer << "    Result: died but not with expected exit code:\n"

+               << "            " << ExitSummary(status()) << "\n"

+               << "Actual msg:\n" << FormatDeathTestOutput(error_message);

+      }

+      break;

+    case IN_PROGRESS:

+    default:

+      GTEST_LOG_(FATAL)

+          << "DeathTest::Passed somehow called before conclusion of test";

+  }

+

+  DeathTest::set_last_death_test_message(buffer.GetString());

+  return success;

+}

+

+# if GTEST_OS_WINDOWS

+// WindowsDeathTest implements death tests on Windows. Due to the

+// specifics of starting new processes on Windows, death tests there are

+// always threadsafe, and Google Test considers the

+// --gtest_death_test_style=fast setting to be equivalent to

+// --gtest_death_test_style=threadsafe there.

+//

+// A few implementation notes:  Like the Linux version, the Windows

+// implementation uses pipes for child-to-parent communication. But due to

+// the specifics of pipes on Windows, some extra steps are required:

+//

+// 1. The parent creates a communication pipe and stores handles to both

+//    ends of it.

+// 2. The parent starts the child and provides it with the information

+//    necessary to acquire the handle to the write end of the pipe.

+// 3. The child acquires the write end of the pipe and signals the parent

+//    using a Windows event.

+// 4. Now the parent can release the write end of the pipe on its side. If

+//    this is done before step 3, the object's reference count goes down to

+//    0 and it is destroyed, preventing the child from acquiring it. The

+//    parent now has to release it, or read operations on the read end of

+//    the pipe will not return when the child terminates.

+// 5. The parent reads child's output through the pipe (outcome code and

+//    any possible error messages) from the pipe, and its stderr and then

+//    determines whether to fail the test.

+//

+// Note: to distinguish Win32 API calls from the local method and function

+// calls, the former are explicitly resolved in the global namespace.

+//

+class WindowsDeathTest : public DeathTestImpl {

+ public:

+  WindowsDeathTest(const char* a_statement,

+                   const RE* a_regex,

+                   const char* file,

+                   int line)

+      : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}

+

+  // All of these virtual functions are inherited from DeathTest.

+  virtual int Wait();

+  virtual TestRole AssumeRole();

+

+ private:

+  // The name of the file in which the death test is located.

+  const char* const file_;

+  // The line number on which the death test is located.

+  const int line_;

+  // Handle to the write end of the pipe to the child process.

+  AutoHandle write_handle_;

+  // Child process handle.

+  AutoHandle child_handle_;

+  // Event the child process uses to signal the parent that it has

+  // acquired the handle to the write end of the pipe. After seeing this

+  // event the parent can release its own handles to make sure its

+  // ReadFile() calls return when the child terminates.

+  AutoHandle event_handle_;

+};

+

+// Waits for the child in a death test to exit, returning its exit

+// status, or 0 if no child process exists.  As a side effect, sets the

+// outcome data member.

+int WindowsDeathTest::Wait() {

+  if (!spawned())

+    return 0;

+

+  // Wait until the child either signals that it has acquired the write end

+  // of the pipe or it dies.

+  const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };

+  switch (::WaitForMultipleObjects(2,

+                                   wait_handles,

+                                   FALSE,  // Waits for any of the handles.

+                                   INFINITE)) {

+    case WAIT_OBJECT_0:

+    case WAIT_OBJECT_0 + 1:

+      break;

+    default:

+      GTEST_DEATH_TEST_CHECK_(false);  // Should not get here.

+  }

+

+  // The child has acquired the write end of the pipe or exited.

+  // We release the handle on our side and continue.

+  write_handle_.Reset();

+  event_handle_.Reset();

+

+  ReadAndInterpretStatusByte();

+

+  // Waits for the child process to exit if it haven't already. This

+  // returns immediately if the child has already exited, regardless of

+  // whether previous calls to WaitForMultipleObjects synchronized on this

+  // handle or not.

+  GTEST_DEATH_TEST_CHECK_(

+      WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),

+                                             INFINITE));

+  DWORD status_code;

+  GTEST_DEATH_TEST_CHECK_(

+      ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);

+  child_handle_.Reset();

+  set_status(static_cast<int>(status_code));

+  return status();

+}

+

+// The AssumeRole process for a Windows death test.  It creates a child

+// process with the same executable as the current process to run the

+// death test.  The child process is given the --gtest_filter and

+// --gtest_internal_run_death_test flags such that it knows to run the

+// current death test only.

+DeathTest::TestRole WindowsDeathTest::AssumeRole() {

+  const UnitTestImpl* const impl = GetUnitTestImpl();

+  const InternalRunDeathTestFlag* const flag =

+      impl->internal_run_death_test_flag();

+  const TestInfo* const info = impl->current_test_info();

+  const int death_test_index = info->result()->death_test_count();

+

+  if (flag != NULL) {

+    // ParseInternalRunDeathTestFlag() has performed all the necessary

+    // processing.

+    set_write_fd(flag->write_fd());

+    return EXECUTE_TEST;

+  }

+

+  // WindowsDeathTest uses an anonymous pipe to communicate results of

+  // a death test.

+  SECURITY_ATTRIBUTES handles_are_inheritable = {

+    sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };

+  HANDLE read_handle, write_handle;

+  GTEST_DEATH_TEST_CHECK_(

+      ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,

+                   0)  // Default buffer size.

+      != FALSE);

+  set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),

+                                O_RDONLY));

+  write_handle_.Reset(write_handle);

+  event_handle_.Reset(::CreateEvent(

+      &handles_are_inheritable,

+      TRUE,    // The event will automatically reset to non-signaled state.

+      FALSE,   // The initial state is non-signalled.

+      NULL));  // The even is unnamed.

+  GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);

+  const std::string filter_flag =

+      std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" +

+      info->test_case_name() + "." + info->name();

+  const std::string internal_flag =

+      std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag +

+      "=" + file_ + "|" + StreamableToString(line_) + "|" +

+      StreamableToString(death_test_index) + "|" +

+      StreamableToString(static_cast<unsigned int>(::GetCurrentProcessId())) +

+      // size_t has the same width as pointers on both 32-bit and 64-bit

+      // Windows platforms.

+      // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.

+      "|" + StreamableToString(reinterpret_cast<size_t>(write_handle)) +

+      "|" + StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));

+

+  char executable_path[_MAX_PATH + 1];  // NOLINT

+  GTEST_DEATH_TEST_CHECK_(

+      _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,

+                                            executable_path,

+                                            _MAX_PATH));

+

+  std::string command_line =

+      std::string(::GetCommandLineA()) + " " + filter_flag + " \"" +

+      internal_flag + "\"";

+

+  DeathTest::set_last_death_test_message("");

+

+  CaptureStderr();

+  // Flush the log buffers since the log streams are shared with the child.

+  FlushInfoLog();

+

+  // The child process will share the standard handles with the parent.

+  STARTUPINFOA startup_info;

+  memset(&startup_info, 0, sizeof(STARTUPINFO));

+  startup_info.dwFlags = STARTF_USESTDHANDLES;

+  startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);

+  startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);

+  startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);

+

+  PROCESS_INFORMATION process_info;

+  GTEST_DEATH_TEST_CHECK_(::CreateProcessA(

+      executable_path,

+      const_cast<char*>(command_line.c_str()),

+      NULL,   // Retuned process handle is not inheritable.

+      NULL,   // Retuned thread handle is not inheritable.

+      TRUE,   // Child inherits all inheritable handles (for write_handle_).

+      0x0,    // Default creation flags.

+      NULL,   // Inherit the parent's environment.

+      UnitTest::GetInstance()->original_working_dir(),

+      &startup_info,

+      &process_info) != FALSE);

+  child_handle_.Reset(process_info.hProcess);

+  ::CloseHandle(process_info.hThread);

+  set_spawned(true);

+  return OVERSEE_TEST;

+}

+# else  // We are not on Windows.

+

+// ForkingDeathTest provides implementations for most of the abstract

+// methods of the DeathTest interface.  Only the AssumeRole method is

+// left undefined.

+class ForkingDeathTest : public DeathTestImpl {

+ public:

+  ForkingDeathTest(const char* statement, const RE* regex);

+

+  // All of these virtual functions are inherited from DeathTest.

+  virtual int Wait();

+

+ protected:

+  void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }

+

+ private:

+  // PID of child process during death test; 0 in the child process itself.

+  pid_t child_pid_;

+};

+

+// Constructs a ForkingDeathTest.

+ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)

+    : DeathTestImpl(a_statement, a_regex),

+      child_pid_(-1) {}

+

+// Waits for the child in a death test to exit, returning its exit

+// status, or 0 if no child process exists.  As a side effect, sets the

+// outcome data member.

+int ForkingDeathTest::Wait() {

+  if (!spawned())

+    return 0;

+

+  ReadAndInterpretStatusByte();

+

+  int status_value;

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));

+  set_status(status_value);

+  return status_value;

+}

+

+// A concrete death test class that forks, then immediately runs the test

+// in the child process.

+class NoExecDeathTest : public ForkingDeathTest {

+ public:

+  NoExecDeathTest(const char* a_statement, const RE* a_regex) :

+      ForkingDeathTest(a_statement, a_regex) { }

+  virtual TestRole AssumeRole();

+};

+

+// The AssumeRole process for a fork-and-run death test.  It implements a

+// straightforward fork, with a simple pipe to transmit the status byte.

+DeathTest::TestRole NoExecDeathTest::AssumeRole() {

+  const size_t thread_count = GetThreadCount();

+  if (thread_count != 1) {

+    GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);

+  }

+

+  int pipe_fd[2];

+  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);

+

+  DeathTest::set_last_death_test_message("");

+  CaptureStderr();

+  // When we fork the process below, the log file buffers are copied, but the

+  // file descriptors are shared.  We flush all log files here so that closing

+  // the file descriptors in the child process doesn't throw off the

+  // synchronization between descriptors and buffers in the parent process.

+  // This is as close to the fork as possible to avoid a race condition in case

+  // there are multiple threads running before the death test, and another

+  // thread writes to the log file.

+  FlushInfoLog();

+

+  const pid_t child_pid = fork();

+  GTEST_DEATH_TEST_CHECK_(child_pid != -1);

+  set_child_pid(child_pid);

+  if (child_pid == 0) {

+    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));

+    set_write_fd(pipe_fd[1]);

+    // Redirects all logging to stderr in the child process to prevent

+    // concurrent writes to the log files.  We capture stderr in the parent

+    // process and append the child process' output to a log.

+    LogToStderr();

+    // Event forwarding to the listeners of event listener API mush be shut

+    // down in death test subprocesses.

+    GetUnitTestImpl()->listeners()->SuppressEventForwarding();

+    g_in_fast_death_test_child = true;

+    return EXECUTE_TEST;

+  } else {

+    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));

+    set_read_fd(pipe_fd[0]);

+    set_spawned(true);

+    return OVERSEE_TEST;

+  }

+}

+

+// A concrete death test class that forks and re-executes the main

+// program from the beginning, with command-line flags set that cause

+// only this specific death test to be run.

+class ExecDeathTest : public ForkingDeathTest {

+ public:

+  ExecDeathTest(const char* a_statement, const RE* a_regex,

+                const char* file, int line) :

+      ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }

+  virtual TestRole AssumeRole();

+ private:

+  static ::std::vector<testing::internal::string>

+  GetArgvsForDeathTestChildProcess() {

+    ::std::vector<testing::internal::string> args = GetInjectableArgvs();

+    return args;

+  }

+  // The name of the file in which the death test is located.

+  const char* const file_;

+  // The line number on which the death test is located.

+  const int line_;

+};

+

+// Utility class for accumulating command-line arguments.

+class Arguments {

+ public:

+  Arguments() {

+    args_.push_back(NULL);

+  }

+

+  ~Arguments() {

+    for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();

+         ++i) {

+      free(*i);

+    }

+  }

+  void AddArgument(const char* argument) {

+    args_.insert(args_.end() - 1, posix::StrDup(argument));

+  }

+

+  template <typename Str>

+  void AddArguments(const ::std::vector<Str>& arguments) {

+    for (typename ::std::vector<Str>::const_iterator i = arguments.begin();

+         i != arguments.end();

+         ++i) {

+      args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));

+    }

+  }

+  char* const* Argv() {

+    return &args_[0];

+  }

+

+ private:

+  std::vector<char*> args_;

+};

+

+// A struct that encompasses the arguments to the child process of a

+// threadsafe-style death test process.

+struct ExecDeathTestArgs {

+  char* const* argv;  // Command-line arguments for the child's call to exec

+  int close_fd;       // File descriptor to close; the read end of a pipe

+};

+

+#  if GTEST_OS_MAC

+inline char** GetEnviron() {

+  // When Google Test is built as a framework on MacOS X, the environ variable

+  // is unavailable. Apple's documentation (man environ) recommends using

+  // _NSGetEnviron() instead.

+  return *_NSGetEnviron();

+}

+#  else

+// Some POSIX platforms expect you to declare environ. extern "C" makes

+// it reside in the global namespace.

+extern "C" char** environ;

+inline char** GetEnviron() { return environ; }

+#  endif  // GTEST_OS_MAC

+

+#  if !GTEST_OS_QNX

+// The main function for a threadsafe-style death test child process.

+// This function is called in a clone()-ed process and thus must avoid

+// any potentially unsafe operations like malloc or libc functions.

+static int ExecDeathTestChildMain(void* child_arg) {

+  ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));

+

+  // We need to execute the test program in the same environment where

+  // it was originally invoked.  Therefore we change to the original

+  // working directory first.

+  const char* const original_dir =

+      UnitTest::GetInstance()->original_working_dir();

+  // We can safely call chdir() as it's a direct system call.

+  if (chdir(original_dir) != 0) {

+    DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +

+                   GetLastErrnoDescription());

+    return EXIT_FAILURE;

+  }

+

+  // We can safely call execve() as it's a direct system call.  We

+  // cannot use execvp() as it's a libc function and thus potentially

+  // unsafe.  Since execve() doesn't search the PATH, the user must

+  // invoke the test program via a valid path that contains at least

+  // one path separator.

+  execve(args->argv[0], args->argv, GetEnviron());

+  DeathTestAbort(std::string("execve(") + args->argv[0] + ", ...) in " +

+                 original_dir + " failed: " +

+                 GetLastErrnoDescription());

+  return EXIT_FAILURE;

+}

+#  endif  // !GTEST_OS_QNX

+

+// Two utility routines that together determine the direction the stack

+// grows.

+// This could be accomplished more elegantly by a single recursive

+// function, but we want to guard against the unlikely possibility of

+// a smart compiler optimizing the recursion away.

+//

+// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining

+// StackLowerThanAddress into StackGrowsDown, which then doesn't give

+// correct answer.

+void StackLowerThanAddress(const void* ptr, bool* result) GTEST_NO_INLINE_;

+void StackLowerThanAddress(const void* ptr, bool* result) {

+  int dummy;

+  *result = (&dummy < ptr);

+}

+

+bool StackGrowsDown() {

+  int dummy;

+  bool result;

+  StackLowerThanAddress(&dummy, &result);

+  return result;

+}

+

+// Spawns a child process with the same executable as the current process in

+// a thread-safe manner and instructs it to run the death test.  The

+// implementation uses fork(2) + exec.  On systems where clone(2) is

+// available, it is used instead, being slightly more thread-safe.  On QNX,

+// fork supports only single-threaded environments, so this function uses

+// spawn(2) there instead.  The function dies with an error message if

+// anything goes wrong.

+static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {

+  ExecDeathTestArgs args = { argv, close_fd };

+  pid_t child_pid = -1;

+

+#  if GTEST_OS_QNX

+  // Obtains the current directory and sets it to be closed in the child

+  // process.

+  const int cwd_fd = open(".", O_RDONLY);

+  GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));

+  // We need to execute the test program in the same environment where

+  // it was originally invoked.  Therefore we change to the original

+  // working directory first.

+  const char* const original_dir =

+      UnitTest::GetInstance()->original_working_dir();

+  // We can safely call chdir() as it's a direct system call.

+  if (chdir(original_dir) != 0) {

+    DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +

+                   GetLastErrnoDescription());

+    return EXIT_FAILURE;

+  }

+

+  int fd_flags;

+  // Set close_fd to be closed after spawn.

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,

+                                        fd_flags | FD_CLOEXEC));

+  struct inheritance inherit = {0};

+  // spawn is a system call.

+  child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());

+  // Restores the current working directory.

+  GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));

+

+#  else   // GTEST_OS_QNX

+#   if GTEST_OS_LINUX

+  // When a SIGPROF signal is received while fork() or clone() are executing,

+  // the process may hang. To avoid this, we ignore SIGPROF here and re-enable

+  // it after the call to fork()/clone() is complete.

+  struct sigaction saved_sigprof_action;

+  struct sigaction ignore_sigprof_action;

+  memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));

+  sigemptyset(&ignore_sigprof_action.sa_mask);

+  ignore_sigprof_action.sa_handler = SIG_IGN;

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(

+      SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));

+#   endif  // GTEST_OS_LINUX

+

+#   if GTEST_HAS_CLONE

+  const bool use_fork = GTEST_FLAG(death_test_use_fork);

+

+  if (!use_fork) {

+    static const bool stack_grows_down = StackGrowsDown();

+    const size_t stack_size = getpagesize();

+    // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.

+    void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,

+                             MAP_ANON | MAP_PRIVATE, -1, 0);

+    GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);

+

+    // Maximum stack alignment in bytes:  For a downward-growing stack, this

+    // amount is subtracted from size of the stack space to get an address

+    // that is within the stack space and is aligned on all systems we care

+    // about.  As far as I know there is no ABI with stack alignment greater

+    // than 64.  We assume stack and stack_size already have alignment of

+    // kMaxStackAlignment.

+    const size_t kMaxStackAlignment = 64;

+    void* const stack_top =

+        static_cast<char*>(stack) +

+            (stack_grows_down ? stack_size - kMaxStackAlignment : 0);

+    GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment &&

+        reinterpret_cast<intptr_t>(stack_top) % kMaxStackAlignment == 0);

+

+    child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);

+

+    GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);

+  }

+#   else

+  const bool use_fork = true;

+#   endif  // GTEST_HAS_CLONE

+

+  if (use_fork && (child_pid = fork()) == 0) {

+      ExecDeathTestChildMain(&args);

+      _exit(0);

+  }

+#  endif  // GTEST_OS_QNX

+#  if GTEST_OS_LINUX

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(

+      sigaction(SIGPROF, &saved_sigprof_action, NULL));

+#  endif  // GTEST_OS_LINUX

+

+  GTEST_DEATH_TEST_CHECK_(child_pid != -1);

+  return child_pid;

+}

+

+// The AssumeRole process for a fork-and-exec death test.  It re-executes the

+// main program from the beginning, setting the --gtest_filter

+// and --gtest_internal_run_death_test flags to cause only the current

+// death test to be re-run.

+DeathTest::TestRole ExecDeathTest::AssumeRole() {

+  const UnitTestImpl* const impl = GetUnitTestImpl();

+  const InternalRunDeathTestFlag* const flag =

+      impl->internal_run_death_test_flag();

+  const TestInfo* const info = impl->current_test_info();

+  const int death_test_index = info->result()->death_test_count();

+

+  if (flag != NULL) {

+    set_write_fd(flag->write_fd());

+    return EXECUTE_TEST;

+  }

+

+  int pipe_fd[2];

+  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);

+  // Clear the close-on-exec flag on the write end of the pipe, lest

+  // it be closed when the child process does an exec:

+  GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);

+

+  const std::string filter_flag =

+      std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="

+      + info->test_case_name() + "." + info->name();

+  const std::string internal_flag =

+      std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="

+      + file_ + "|" + StreamableToString(line_) + "|"

+      + StreamableToString(death_test_index) + "|"

+      + StreamableToString(pipe_fd[1]);

+  Arguments args;

+  args.AddArguments(GetArgvsForDeathTestChildProcess());

+  args.AddArgument(filter_flag.c_str());

+  args.AddArgument(internal_flag.c_str());

+

+  DeathTest::set_last_death_test_message("");

+

+  CaptureStderr();

+  // See the comment in NoExecDeathTest::AssumeRole for why the next line

+  // is necessary.

+  FlushInfoLog();

+

+  const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);

+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));

+  set_child_pid(child_pid);

+  set_read_fd(pipe_fd[0]);

+  set_spawned(true);

+  return OVERSEE_TEST;

+}

+

+# endif  // !GTEST_OS_WINDOWS

+

+// Creates a concrete DeathTest-derived class that depends on the

+// --gtest_death_test_style flag, and sets the pointer pointed to

+// by the "test" argument to its address.  If the test should be

+// skipped, sets that pointer to NULL.  Returns true, unless the

+// flag is set to an invalid value.

+bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,

+                                     const char* file, int line,

+                                     DeathTest** test) {

+  UnitTestImpl* const impl = GetUnitTestImpl();

+  const InternalRunDeathTestFlag* const flag =

+      impl->internal_run_death_test_flag();

+  const int death_test_index = impl->current_test_info()

+      ->increment_death_test_count();

+

+  if (flag != NULL) {

+    if (death_test_index > flag->index()) {

+      DeathTest::set_last_death_test_message(

+          "Death test count (" + StreamableToString(death_test_index)

+          + ") somehow exceeded expected maximum ("

+          + StreamableToString(flag->index()) + ")");

+      return false;

+    }

+

+    if (!(flag->file() == file && flag->line() == line &&

+          flag->index() == death_test_index)) {

+      *test = NULL;

+      return true;

+    }

+  }

+

+# if GTEST_OS_WINDOWS

+

+  if (GTEST_FLAG(death_test_style) == "threadsafe" ||

+      GTEST_FLAG(death_test_style) == "fast") {

+    *test = new WindowsDeathTest(statement, regex, file, line);

+  }

+

+# else

+

+  if (GTEST_FLAG(death_test_style) == "threadsafe") {

+    *test = new ExecDeathTest(statement, regex, file, line);

+  } else if (GTEST_FLAG(death_test_style) == "fast") {

+    *test = new NoExecDeathTest(statement, regex);

+  }

+

+# endif  // GTEST_OS_WINDOWS

+

+  else {  // NOLINT - this is more readable than unbalanced brackets inside #if.

+    DeathTest::set_last_death_test_message(

+        "Unknown death test style \"" + GTEST_FLAG(death_test_style)

+        + "\" encountered");

+    return false;

+  }

+

+  return true;

+}

+

+// Splits a given string on a given delimiter, populating a given

+// vector with the fields.  GTEST_HAS_DEATH_TEST implies that we have

+// ::std::string, so we can use it here.

+static void SplitString(const ::std::string& str, char delimiter,

+                        ::std::vector< ::std::string>* dest) {

+  ::std::vector< ::std::string> parsed;

+  ::std::string::size_type pos = 0;

+  while (::testing::internal::AlwaysTrue()) {

+    const ::std::string::size_type colon = str.find(delimiter, pos);

+    if (colon == ::std::string::npos) {

+      parsed.push_back(str.substr(pos));

+      break;

+    } else {

+      parsed.push_back(str.substr(pos, colon - pos));

+      pos = colon + 1;

+    }

+  }

+  dest->swap(parsed);

+}

+

+# if GTEST_OS_WINDOWS

+// Recreates the pipe and event handles from the provided parameters,

+// signals the event, and returns a file descriptor wrapped around the pipe

+// handle. This function is called in the child process only.

+int GetStatusFileDescriptor(unsigned int parent_process_id,

+                            size_t write_handle_as_size_t,

+                            size_t event_handle_as_size_t) {

+  AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,

+                                                   FALSE,  // Non-inheritable.

+                                                   parent_process_id));

+  if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {

+    DeathTestAbort("Unable to open parent process " +

+                   StreamableToString(parent_process_id));

+  }

+

+  // TODO(vladl@google.com): Replace the following check with a

+  // compile-time assertion when available.

+  GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));

+

+  const HANDLE write_handle =

+      reinterpret_cast<HANDLE>(write_handle_as_size_t);

+  HANDLE dup_write_handle;

+

+  // The newly initialized handle is accessible only in in the parent

+  // process. To obtain one accessible within the child, we need to use

+  // DuplicateHandle.

+  if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,

+                         ::GetCurrentProcess(), &dup_write_handle,

+                         0x0,    // Requested privileges ignored since

+                                 // DUPLICATE_SAME_ACCESS is used.

+                         FALSE,  // Request non-inheritable handler.

+                         DUPLICATE_SAME_ACCESS)) {

+    DeathTestAbort("Unable to duplicate the pipe handle " +

+                   StreamableToString(write_handle_as_size_t) +

+                   " from the parent process " +

+                   StreamableToString(parent_process_id));

+  }

+

+  const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);

+  HANDLE dup_event_handle;

+

+  if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,

+                         ::GetCurrentProcess(), &dup_event_handle,

+                         0x0,

+                         FALSE,

+                         DUPLICATE_SAME_ACCESS)) {

+    DeathTestAbort("Unable to duplicate the event handle " +

+                   StreamableToString(event_handle_as_size_t) +

+                   " from the parent process " +

+                   StreamableToString(parent_process_id));

+  }

+

+  const int write_fd =

+      ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);

+  if (write_fd == -1) {

+    DeathTestAbort("Unable to convert pipe handle " +

+                   StreamableToString(write_handle_as_size_t) +

+                   " to a file descriptor");

+  }

+

+  // Signals the parent that the write end of the pipe has been acquired

+  // so the parent can release its own write end.

+  ::SetEvent(dup_event_handle);

+

+  return write_fd;

+}

+# endif  // GTEST_OS_WINDOWS

+

+// Returns a newly created InternalRunDeathTestFlag object with fields

+// initialized from the GTEST_FLAG(internal_run_death_test) flag if

+// the flag is specified; otherwise returns NULL.

+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {

+  if (GTEST_FLAG(internal_run_death_test) == "") return NULL;

+

+  // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we

+  // can use it here.

+  int line = -1;

+  int index = -1;

+  ::std::vector< ::std::string> fields;

+  SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);

+  int write_fd = -1;

+

+# if GTEST_OS_WINDOWS

+

+  unsigned int parent_process_id = 0;

+  size_t write_handle_as_size_t = 0;

+  size_t event_handle_as_size_t = 0;

+

+  if (fields.size() != 6

+      || !ParseNaturalNumber(fields[1], &line)

+      || !ParseNaturalNumber(fields[2], &index)

+      || !ParseNaturalNumber(fields[3], &parent_process_id)

+      || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)

+      || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {

+    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +

+                   GTEST_FLAG(internal_run_death_test));

+  }

+  write_fd = GetStatusFileDescriptor(parent_process_id,

+                                     write_handle_as_size_t,

+                                     event_handle_as_size_t);

+# else

+

+  if (fields.size() != 4

+      || !ParseNaturalNumber(fields[1], &line)

+      || !ParseNaturalNumber(fields[2], &index)

+      || !ParseNaturalNumber(fields[3], &write_fd)) {

+    DeathTestAbort("Bad --gtest_internal_run_death_test flag: "

+        + GTEST_FLAG(internal_run_death_test));

+  }

+

+# endif  // GTEST_OS_WINDOWS

+

+  return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);

+}

+

+}  // namespace internal

+

+#endif  // GTEST_HAS_DEATH_TEST

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-filepath.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-filepath.cc
new file mode 100644
index 0000000..f14ed20
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-filepath.cc
@@ -0,0 +1,382 @@
+// 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.

+//

+// Authors: keith.ray@gmail.com (Keith Ray)

+

+#include "gtest/gtest-message.h"

+#include "gtest/internal/gtest-filepath.h"

+#include "gtest/internal/gtest-port.h"

+

+#include <stdlib.h>

+

+#if GTEST_OS_WINDOWS_MOBILE

+# include <windows.h>

+#elif GTEST_OS_WINDOWS

+# include <direct.h>

+# include <io.h>

+#elif GTEST_OS_SYMBIAN

+// Symbian OpenC has PATH_MAX in sys/syslimits.h

+# include <sys/syslimits.h>

+#else

+# include <limits.h>

+# include <climits>  // Some Linux distributions define PATH_MAX here.

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+#if GTEST_OS_WINDOWS

+# define GTEST_PATH_MAX_ _MAX_PATH

+#elif defined(PATH_MAX)

+# define GTEST_PATH_MAX_ PATH_MAX

+#elif defined(_XOPEN_PATH_MAX)

+# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX

+#else

+# define GTEST_PATH_MAX_ _POSIX_PATH_MAX

+#endif  // GTEST_OS_WINDOWS

+

+#include "gtest/internal/gtest-string.h"

+

+namespace testing {

+namespace internal {

+

+#if GTEST_OS_WINDOWS

+// On Windows, '\\' is the standard path separator, but many tools and the

+// Windows API also accept '/' as an alternate path separator. Unless otherwise

+// noted, a file path can contain either kind of path separators, or a mixture

+// of them.

+const char kPathSeparator = '\\';

+const char kAlternatePathSeparator = '/';

+const char kPathSeparatorString[] = "\\";

+const char kAlternatePathSeparatorString[] = "/";

+# if GTEST_OS_WINDOWS_MOBILE

+// Windows CE doesn't have a current directory. You should not use

+// the current directory in tests on Windows CE, but this at least

+// provides a reasonable fallback.

+const char kCurrentDirectoryString[] = "\\";

+// Windows CE doesn't define INVALID_FILE_ATTRIBUTES

+const DWORD kInvalidFileAttributes = 0xffffffff;

+# else

+const char kCurrentDirectoryString[] = ".\\";

+# endif  // GTEST_OS_WINDOWS_MOBILE

+#else

+const char kPathSeparator = '/';

+const char kPathSeparatorString[] = "/";

+const char kCurrentDirectoryString[] = "./";

+#endif  // GTEST_OS_WINDOWS

+

+// Returns whether the given character is a valid path separator.

+static bool IsPathSeparator(char c) {

+#if GTEST_HAS_ALT_PATH_SEP_

+  return (c == kPathSeparator) || (c == kAlternatePathSeparator);

+#else

+  return c == kPathSeparator;

+#endif

+}

+

+// Returns the current working directory, or "" if unsuccessful.

+FilePath FilePath::GetCurrentDir() {

+#if GTEST_OS_WINDOWS_MOBILE

+  // Windows CE doesn't have a current directory, so we just return

+  // something reasonable.

+  return FilePath(kCurrentDirectoryString);

+#elif GTEST_OS_WINDOWS

+  char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };

+  return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);

+#else

+  char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };

+  return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);

+#endif  // GTEST_OS_WINDOWS_MOBILE

+}

+

+// Returns a copy of the FilePath with the case-insensitive extension removed.

+// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns

+// FilePath("dir/file"). If a case-insensitive extension is not

+// found, returns a copy of the original FilePath.

+FilePath FilePath::RemoveExtension(const char* extension) const {

+  const std::string dot_extension = std::string(".") + extension;

+  if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {

+    return FilePath(pathname_.substr(

+        0, pathname_.length() - dot_extension.length()));

+  }

+  return *this;

+}

+

+// Returns a pointer to the last occurence of a valid path separator in

+// the FilePath. On Windows, for example, both '/' and '\' are valid path

+// separators. Returns NULL if no path separator was found.

+const char* FilePath::FindLastPathSeparator() const {

+  const char* const last_sep = strrchr(c_str(), kPathSeparator);

+#if GTEST_HAS_ALT_PATH_SEP_

+  const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);

+  // Comparing two pointers of which only one is NULL is undefined.

+  if (last_alt_sep != NULL &&

+      (last_sep == NULL || last_alt_sep > last_sep)) {

+    return last_alt_sep;

+  }

+#endif

+  return last_sep;

+}

+

+// Returns a copy of the FilePath with the directory part removed.

+// Example: FilePath("path/to/file").RemoveDirectoryName() returns

+// FilePath("file"). If there is no directory part ("just_a_file"), it returns

+// the FilePath unmodified. If there is no file part ("just_a_dir/") it

+// returns an empty FilePath ("").

+// On Windows platform, '\' is the path separator, otherwise it is '/'.

+FilePath FilePath::RemoveDirectoryName() const {

+  const char* const last_sep = FindLastPathSeparator();

+  return last_sep ? FilePath(last_sep + 1) : *this;

+}

+

+// RemoveFileName returns the directory path with the filename removed.

+// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".

+// If the FilePath is "a_file" or "/a_file", RemoveFileName returns

+// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does

+// not have a file, like "just/a/dir/", it returns the FilePath unmodified.

+// On Windows platform, '\' is the path separator, otherwise it is '/'.

+FilePath FilePath::RemoveFileName() const {

+  const char* const last_sep = FindLastPathSeparator();

+  std::string dir;

+  if (last_sep) {

+    dir = std::string(c_str(), last_sep + 1 - c_str());

+  } else {

+    dir = kCurrentDirectoryString;

+  }

+  return FilePath(dir);

+}

+

+// Helper functions for naming files in a directory for xml output.

+

+// Given directory = "dir", base_name = "test", number = 0,

+// extension = "xml", returns "dir/test.xml". If number is greater

+// than zero (e.g., 12), returns "dir/test_12.xml".

+// On Windows platform, uses \ as the separator rather than /.

+FilePath FilePath::MakeFileName(const FilePath& directory,

+                                const FilePath& base_name,

+                                int number,

+                                const char* extension) {

+  std::string file;

+  if (number == 0) {

+    file = base_name.string() + "." + extension;

+  } else {

+    file = base_name.string() + "_" + StreamableToString(number)

+        + "." + extension;

+  }

+  return ConcatPaths(directory, FilePath(file));

+}

+

+// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".

+// On Windows, uses \ as the separator rather than /.

+FilePath FilePath::ConcatPaths(const FilePath& directory,

+                               const FilePath& relative_path) {

+  if (directory.IsEmpty())

+    return relative_path;

+  const FilePath dir(directory.RemoveTrailingPathSeparator());

+  return FilePath(dir.string() + kPathSeparator + relative_path.string());

+}

+

+// Returns true if pathname describes something findable in the file-system,

+// either a file, directory, or whatever.

+bool FilePath::FileOrDirectoryExists() const {

+#if GTEST_OS_WINDOWS_MOBILE

+  LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());

+  const DWORD attributes = GetFileAttributes(unicode);

+  delete [] unicode;

+  return attributes != kInvalidFileAttributes;

+#else

+  posix::StatStruct file_stat;

+  return posix::Stat(pathname_.c_str(), &file_stat) == 0;

+#endif  // GTEST_OS_WINDOWS_MOBILE

+}

+

+// Returns true if pathname describes a directory in the file-system

+// that exists.

+bool FilePath::DirectoryExists() const {

+  bool result = false;

+#if GTEST_OS_WINDOWS

+  // Don't strip off trailing separator if path is a root directory on

+  // Windows (like "C:\\").

+  const FilePath& path(IsRootDirectory() ? *this :

+                                           RemoveTrailingPathSeparator());

+#else

+  const FilePath& path(*this);

+#endif

+

+#if GTEST_OS_WINDOWS_MOBILE

+  LPCWSTR unicode = String::AnsiToUtf16(path.c_str());

+  const DWORD attributes = GetFileAttributes(unicode);

+  delete [] unicode;

+  if ((attributes != kInvalidFileAttributes) &&

+      (attributes & FILE_ATTRIBUTE_DIRECTORY)) {

+    result = true;

+  }

+#else

+  posix::StatStruct file_stat;

+  result = posix::Stat(path.c_str(), &file_stat) == 0 &&

+      posix::IsDir(file_stat);

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+  return result;

+}

+

+// Returns true if pathname describes a root directory. (Windows has one

+// root directory per disk drive.)

+bool FilePath::IsRootDirectory() const {

+#if GTEST_OS_WINDOWS

+  // TODO(wan@google.com): on Windows a network share like

+  // \\server\share can be a root directory, although it cannot be the

+  // current directory.  Handle this properly.

+  return pathname_.length() == 3 && IsAbsolutePath();

+#else

+  return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);

+#endif

+}

+

+// Returns true if pathname describes an absolute path.

+bool FilePath::IsAbsolutePath() const {

+  const char* const name = pathname_.c_str();

+#if GTEST_OS_WINDOWS

+  return pathname_.length() >= 3 &&

+     ((name[0] >= 'a' && name[0] <= 'z') ||

+      (name[0] >= 'A' && name[0] <= 'Z')) &&

+     name[1] == ':' &&

+     IsPathSeparator(name[2]);

+#else

+  return IsPathSeparator(name[0]);

+#endif

+}

+

+// Returns a pathname for a file that does not currently exist. The pathname

+// will be directory/base_name.extension or

+// directory/base_name_<number>.extension if directory/base_name.extension

+// already exists. The number will be incremented until a pathname is found

+// that does not already exist.

+// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.

+// There could be a race condition if two or more processes are calling this

+// function at the same time -- they could both pick the same filename.

+FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,

+                                          const FilePath& base_name,

+                                          const char* extension) {

+  FilePath full_pathname;

+  int number = 0;

+  do {

+    full_pathname.Set(MakeFileName(directory, base_name, number++, extension));

+  } while (full_pathname.FileOrDirectoryExists());

+  return full_pathname;

+}

+

+// Returns true if FilePath ends with a path separator, which indicates that

+// it is intended to represent a directory. Returns false otherwise.

+// This does NOT check that a directory (or file) actually exists.

+bool FilePath::IsDirectory() const {

+  return !pathname_.empty() &&

+         IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);

+}

+

+// Create directories so that path exists. Returns true if successful or if

+// the directories already exist; returns false if unable to create directories

+// for any reason.

+bool FilePath::CreateDirectoriesRecursively() const {

+  if (!this->IsDirectory()) {

+    return false;

+  }

+

+  if (pathname_.length() == 0 || this->DirectoryExists()) {

+    return true;

+  }

+

+  const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());

+  return parent.CreateDirectoriesRecursively() && this->CreateFolder();

+}

+

+// Create the directory so that path exists. Returns true if successful or

+// if the directory already exists; returns false if unable to create the

+// directory for any reason, including if the parent directory does not

+// exist. Not named "CreateDirectory" because that's a macro on Windows.

+bool FilePath::CreateFolder() const {

+#if GTEST_OS_WINDOWS_MOBILE

+  FilePath removed_sep(this->RemoveTrailingPathSeparator());

+  LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());

+  int result = CreateDirectory(unicode, NULL) ? 0 : -1;

+  delete [] unicode;

+#elif GTEST_OS_WINDOWS

+  int result = _mkdir(pathname_.c_str());

+#else

+  int result = mkdir(pathname_.c_str(), 0777);

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+  if (result == -1) {

+    return this->DirectoryExists();  // An error is OK if the directory exists.

+  }

+  return true;  // No error.

+}

+

+// If input name has a trailing separator character, remove it and return the

+// name, otherwise return the name string unmodified.

+// On Windows platform, uses \ as the separator, other platforms use /.

+FilePath FilePath::RemoveTrailingPathSeparator() const {

+  return IsDirectory()

+      ? FilePath(pathname_.substr(0, pathname_.length() - 1))

+      : *this;

+}

+

+// Removes any redundant separators that might be in the pathname.

+// For example, "bar///foo" becomes "bar/foo". Does not eliminate other

+// redundancies that might be in a pathname involving "." or "..".

+// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).

+void FilePath::Normalize() {

+  if (pathname_.c_str() == NULL) {

+    pathname_ = "";

+    return;

+  }

+  const char* src = pathname_.c_str();

+  char* const dest = new char[pathname_.length() + 1];

+  char* dest_ptr = dest;

+  memset(dest_ptr, 0, pathname_.length() + 1);

+

+  while (*src != '\0') {

+    *dest_ptr = *src;

+    if (!IsPathSeparator(*src)) {

+      src++;

+    } else {

+#if GTEST_HAS_ALT_PATH_SEP_

+      if (*dest_ptr == kAlternatePathSeparator) {

+        *dest_ptr = kPathSeparator;

+      }

+#endif

+      while (IsPathSeparator(*src))

+        src++;

+    }

+    dest_ptr++;

+  }

+  *dest_ptr = '\0';

+  pathname_ = dest;

+  delete[] dest;

+}

+

+}  // namespace internal

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-internal-inl.h b/third_party/allwpilib_2018/gmock/gtest/src/gtest-internal-inl.h
new file mode 100644
index 0000000..fa91403
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-internal-inl.h
@@ -0,0 +1,1218 @@
+// Copyright 2005, 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.

+

+// Utility functions and classes used by the Google C++ testing framework.

+//

+// Author: wan@google.com (Zhanyong Wan)

+//

+// This file contains purely Google Test's internal implementation.  Please

+// DO NOT #INCLUDE IT IN A USER PROGRAM.

+

+#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_

+#define GTEST_SRC_GTEST_INTERNAL_INL_H_

+

+// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is

+// part of Google Test's implementation; otherwise it's undefined.

+#if !GTEST_IMPLEMENTATION_

+// A user is trying to include this from his code - just say no.

+# error "gtest-internal-inl.h is part of Google Test's internal implementation."

+# error "It must not be included except by Google Test itself."

+#endif  // GTEST_IMPLEMENTATION_

+

+#ifndef _WIN32_WCE

+# include <errno.h>

+#endif  // !_WIN32_WCE

+#include <stddef.h>

+#include <stdlib.h>  // For strtoll/_strtoul64/malloc/free.

+#include <string.h>  // For memmove.

+

+#include <algorithm>

+#include <string>

+#include <vector>

+

+#include "gtest/internal/gtest-port.h"

+

+#if GTEST_CAN_STREAM_RESULTS_

+# include <arpa/inet.h>  // NOLINT

+# include <netdb.h>  // NOLINT

+#endif

+

+#if GTEST_OS_WINDOWS

+# include <windows.h>  // NOLINT

+#endif  // GTEST_OS_WINDOWS

+

+#include "gtest/gtest.h"  // NOLINT

+#include "gtest/gtest-spi.h"

+

+namespace testing {

+

+// Declares the flags.

+//

+// We don't want the users to modify this flag in the code, but want

+// Google Test's own unit tests to be able to access it. Therefore we

+// declare it here as opposed to in gtest.h.

+GTEST_DECLARE_bool_(death_test_use_fork);

+

+namespace internal {

+

+// The value of GetTestTypeId() as seen from within the Google Test

+// library.  This is solely for testing GetTestTypeId().

+GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;

+

+// Names of the flags (needed for parsing Google Test flags).

+const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests";

+const char kBreakOnFailureFlag[] = "break_on_failure";

+const char kCatchExceptionsFlag[] = "catch_exceptions";

+const char kColorFlag[] = "color";

+const char kFilterFlag[] = "filter";

+const char kListTestsFlag[] = "list_tests";

+const char kOutputFlag[] = "output";

+const char kPrintTimeFlag[] = "print_time";

+const char kRandomSeedFlag[] = "random_seed";

+const char kRepeatFlag[] = "repeat";

+const char kShuffleFlag[] = "shuffle";

+const char kStackTraceDepthFlag[] = "stack_trace_depth";

+const char kStreamResultToFlag[] = "stream_result_to";

+const char kThrowOnFailureFlag[] = "throw_on_failure";

+

+// A valid random seed must be in [1, kMaxRandomSeed].

+const int kMaxRandomSeed = 99999;

+

+// g_help_flag is true iff the --help flag or an equivalent form is

+// specified on the command line.

+GTEST_API_ extern bool g_help_flag;

+

+// Returns the current time in milliseconds.

+GTEST_API_ TimeInMillis GetTimeInMillis();

+

+// Returns true iff Google Test should use colors in the output.

+GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);

+

+// Formats the given time in milliseconds as seconds.

+GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);

+

+// Converts the given time in milliseconds to a date string in the ISO 8601

+// format, without the timezone information.  N.B.: due to the use the

+// non-reentrant localtime() function, this function is not thread safe.  Do

+// not use it in any code that can be called from multiple threads.

+GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);

+

+// Parses a string for an Int32 flag, in the form of "--flag=value".

+//

+// On success, stores the value of the flag in *value, and returns

+// true.  On failure, returns false without changing *value.

+GTEST_API_ bool ParseInt32Flag(

+    const char* str, const char* flag, Int32* value);

+

+// Returns a random seed in range [1, kMaxRandomSeed] based on the

+// given --gtest_random_seed flag value.

+inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {

+  const unsigned int raw_seed = (random_seed_flag == 0) ?

+      static_cast<unsigned int>(GetTimeInMillis()) :

+      static_cast<unsigned int>(random_seed_flag);

+

+  // Normalizes the actual seed to range [1, kMaxRandomSeed] such that

+  // it's easy to type.

+  const int normalized_seed =

+      static_cast<int>((raw_seed - 1U) %

+                       static_cast<unsigned int>(kMaxRandomSeed)) + 1;

+  return normalized_seed;

+}

+

+// Returns the first valid random seed after 'seed'.  The behavior is

+// undefined if 'seed' is invalid.  The seed after kMaxRandomSeed is

+// considered to be 1.

+inline int GetNextRandomSeed(int seed) {

+  GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)

+      << "Invalid random seed " << seed << " - must be in [1, "

+      << kMaxRandomSeed << "].";

+  const int next_seed = seed + 1;

+  return (next_seed > kMaxRandomSeed) ? 1 : next_seed;

+}

+

+// This class saves the values of all Google Test flags in its c'tor, and

+// restores them in its d'tor.

+class GTestFlagSaver {

+ public:

+  // The c'tor.

+  GTestFlagSaver() {

+    also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);

+    break_on_failure_ = GTEST_FLAG(break_on_failure);

+    catch_exceptions_ = GTEST_FLAG(catch_exceptions);

+    color_ = GTEST_FLAG(color);

+    death_test_style_ = GTEST_FLAG(death_test_style);

+    death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);

+    filter_ = GTEST_FLAG(filter);

+    internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);

+    list_tests_ = GTEST_FLAG(list_tests);

+    output_ = GTEST_FLAG(output);

+    print_time_ = GTEST_FLAG(print_time);

+    random_seed_ = GTEST_FLAG(random_seed);

+    repeat_ = GTEST_FLAG(repeat);

+    shuffle_ = GTEST_FLAG(shuffle);

+    stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);

+    stream_result_to_ = GTEST_FLAG(stream_result_to);

+    throw_on_failure_ = GTEST_FLAG(throw_on_failure);

+  }

+

+  // The d'tor is not virtual.  DO NOT INHERIT FROM THIS CLASS.

+  ~GTestFlagSaver() {

+    GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;

+    GTEST_FLAG(break_on_failure) = break_on_failure_;

+    GTEST_FLAG(catch_exceptions) = catch_exceptions_;

+    GTEST_FLAG(color) = color_;

+    GTEST_FLAG(death_test_style) = death_test_style_;

+    GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;

+    GTEST_FLAG(filter) = filter_;

+    GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;

+    GTEST_FLAG(list_tests) = list_tests_;

+    GTEST_FLAG(output) = output_;

+    GTEST_FLAG(print_time) = print_time_;

+    GTEST_FLAG(random_seed) = random_seed_;

+    GTEST_FLAG(repeat) = repeat_;

+    GTEST_FLAG(shuffle) = shuffle_;

+    GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;

+    GTEST_FLAG(stream_result_to) = stream_result_to_;

+    GTEST_FLAG(throw_on_failure) = throw_on_failure_;

+  }

+

+ private:

+  // Fields for saving the original values of flags.

+  bool also_run_disabled_tests_;

+  bool break_on_failure_;

+  bool catch_exceptions_;

+  std::string color_;

+  std::string death_test_style_;

+  bool death_test_use_fork_;

+  std::string filter_;

+  std::string internal_run_death_test_;

+  bool list_tests_;

+  std::string output_;

+  bool print_time_;

+  internal::Int32 random_seed_;

+  internal::Int32 repeat_;

+  bool shuffle_;

+  internal::Int32 stack_trace_depth_;

+  std::string stream_result_to_;

+  bool throw_on_failure_;

+} GTEST_ATTRIBUTE_UNUSED_;

+

+// Converts a Unicode code point to a narrow string in UTF-8 encoding.

+// code_point parameter is of type UInt32 because wchar_t may not be

+// wide enough to contain a code point.

+// If the code_point is not a valid Unicode code point

+// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted

+// to "(Invalid Unicode 0xXXXXXXXX)".

+GTEST_API_ std::string CodePointToUtf8(UInt32 code_point);

+

+// Converts a wide string to a narrow string in UTF-8 encoding.

+// The wide string is assumed to have the following encoding:

+//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)

+//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)

+// Parameter str points to a null-terminated wide string.

+// Parameter num_chars may additionally limit the number

+// of wchar_t characters processed. -1 is used when the entire string

+// should be processed.

+// If the string contains code points that are not valid Unicode code points

+// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output

+// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding

+// and contains invalid UTF-16 surrogate pairs, values in those pairs

+// will be encoded as individual Unicode characters from Basic Normal Plane.

+GTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars);

+

+// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file

+// if the variable is present. If a file already exists at this location, this

+// function will write over it. If the variable is present, but the file cannot

+// be created, prints an error and exits.

+void WriteToShardStatusFileIfNeeded();

+

+// Checks whether sharding is enabled by examining the relevant

+// environment variable values. If the variables are present,

+// but inconsistent (e.g., shard_index >= total_shards), prints

+// an error and exits. If in_subprocess_for_death_test, sharding is

+// disabled because it must only be applied to the original test

+// process. Otherwise, we could filter out death tests we intended to execute.

+GTEST_API_ bool ShouldShard(const char* total_shards_str,

+                            const char* shard_index_str,

+                            bool in_subprocess_for_death_test);

+

+// Parses the environment variable var as an Int32. If it is unset,

+// returns default_val. If it is not an Int32, prints an error and

+// and aborts.

+GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);

+

+// Given the total number of shards, the shard index, and the test id,

+// returns true iff the test should be run on this shard. The test id is

+// some arbitrary but unique non-negative integer assigned to each test

+// method. Assumes that 0 <= shard_index < total_shards.

+GTEST_API_ bool ShouldRunTestOnShard(

+    int total_shards, int shard_index, int test_id);

+

+// STL container utilities.

+

+// Returns the number of elements in the given container that satisfy

+// the given predicate.

+template <class Container, typename Predicate>

+inline int CountIf(const Container& c, Predicate predicate) {

+  // Implemented as an explicit loop since std::count_if() in libCstd on

+  // Solaris has a non-standard signature.

+  int count = 0;

+  for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {

+    if (predicate(*it))

+      ++count;

+  }

+  return count;

+}

+

+// Applies a function/functor to each element in the container.

+template <class Container, typename Functor>

+void ForEach(const Container& c, Functor functor) {

+  std::for_each(c.begin(), c.end(), functor);

+}

+

+// Returns the i-th element of the vector, or default_value if i is not

+// in range [0, v.size()).

+template <typename E>

+inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {

+  return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];

+}

+

+// Performs an in-place shuffle of a range of the vector's elements.

+// 'begin' and 'end' are element indices as an STL-style range;

+// i.e. [begin, end) are shuffled, where 'end' == size() means to

+// shuffle to the end of the vector.

+template <typename E>

+void ShuffleRange(internal::Random* random, int begin, int end,

+                  std::vector<E>* v) {

+  const int size = static_cast<int>(v->size());

+  GTEST_CHECK_(0 <= begin && begin <= size)

+      << "Invalid shuffle range start " << begin << ": must be in range [0, "

+      << size << "].";

+  GTEST_CHECK_(begin <= end && end <= size)

+      << "Invalid shuffle range finish " << end << ": must be in range ["

+      << begin << ", " << size << "].";

+

+  // Fisher-Yates shuffle, from

+  // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle

+  for (int range_width = end - begin; range_width >= 2; range_width--) {

+    const int last_in_range = begin + range_width - 1;

+    const int selected = begin + random->Generate(range_width);

+    std::swap((*v)[selected], (*v)[last_in_range]);

+  }

+}

+

+// Performs an in-place shuffle of the vector's elements.

+template <typename E>

+inline void Shuffle(internal::Random* random, std::vector<E>* v) {

+  ShuffleRange(random, 0, static_cast<int>(v->size()), v);

+}

+

+// A function for deleting an object.  Handy for being used as a

+// functor.

+template <typename T>

+static void Delete(T* x) {

+  delete x;

+}

+

+// A predicate that checks the key of a TestProperty against a known key.

+//

+// TestPropertyKeyIs is copyable.

+class TestPropertyKeyIs {

+ public:

+  // Constructor.

+  //

+  // TestPropertyKeyIs has NO default constructor.

+  explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}

+

+  // Returns true iff the test name of test property matches on key_.

+  bool operator()(const TestProperty& test_property) const {

+    return test_property.key() == key_;

+  }

+

+ private:

+  std::string key_;

+};

+

+// Class UnitTestOptions.

+//

+// This class contains functions for processing options the user

+// specifies when running the tests.  It has only static members.

+//

+// In most cases, the user can specify an option using either an

+// environment variable or a command line flag.  E.g. you can set the

+// test filter using either GTEST_FILTER or --gtest_filter.  If both

+// the variable and the flag are present, the latter overrides the

+// former.

+class GTEST_API_ UnitTestOptions {

+ public:

+  // Functions for processing the gtest_output flag.

+

+  // Returns the output format, or "" for normal printed output.

+  static std::string GetOutputFormat();

+

+  // Returns the absolute path of the requested output file, or the

+  // default (test_detail.xml in the original working directory) if

+  // none was explicitly specified.

+  static std::string GetAbsolutePathToOutputFile();

+

+  // Functions for processing the gtest_filter flag.

+

+  // Returns true iff the wildcard pattern matches the string.  The

+  // first ':' or '\0' character in pattern marks the end of it.

+  //

+  // This recursive algorithm isn't very efficient, but is clear and

+  // works well enough for matching test names, which are short.

+  static bool PatternMatchesString(const char *pattern, const char *str);

+

+  // Returns true iff the user-specified filter matches the test case

+  // name and the test name.

+  static bool FilterMatchesTest(const std::string &test_case_name,

+                                const std::string &test_name);

+

+#if GTEST_OS_WINDOWS

+  // Function for supporting the gtest_catch_exception flag.

+

+  // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the

+  // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.

+  // This function is useful as an __except condition.

+  static int GTestShouldProcessSEH(DWORD exception_code);

+#endif  // GTEST_OS_WINDOWS

+

+  // Returns true if "name" matches the ':' separated list of glob-style

+  // filters in "filter".

+  static bool MatchesFilter(const std::string& name, const char* filter);

+};

+

+// Returns the current application's name, removing directory path if that

+// is present.  Used by UnitTestOptions::GetOutputFile.

+GTEST_API_ FilePath GetCurrentExecutableName();

+

+// The role interface for getting the OS stack trace as a string.

+class OsStackTraceGetterInterface {

+ public:

+  OsStackTraceGetterInterface() {}

+  virtual ~OsStackTraceGetterInterface() {}

+

+  // Returns the current OS stack trace as an std::string.  Parameters:

+  //

+  //   max_depth  - the maximum number of stack frames to be included

+  //                in the trace.

+  //   skip_count - the number of top frames to be skipped; doesn't count

+  //                against max_depth.

+  virtual string CurrentStackTrace(int max_depth, int skip_count) = 0;

+

+  // UponLeavingGTest() should be called immediately before Google Test calls

+  // user code. It saves some information about the current stack that

+  // CurrentStackTrace() will use to find and hide Google Test stack frames.

+  virtual void UponLeavingGTest() = 0;

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);

+};

+

+// A working implementation of the OsStackTraceGetterInterface interface.

+class OsStackTraceGetter : public OsStackTraceGetterInterface {

+ public:

+  OsStackTraceGetter() : caller_frame_(NULL) {}

+

+  virtual string CurrentStackTrace(int max_depth, int skip_count)

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_);

+

+  // This string is inserted in place of stack frames that are part of

+  // Google Test's implementation.

+  static const char* const kElidedFramesMarker;

+

+ private:

+  Mutex mutex_;  // protects all internal state

+

+  // We save the stack frame below the frame that calls user code.

+  // We do this because the address of the frame immediately below

+  // the user code changes between the call to UponLeavingGTest()

+  // and any calls to CurrentStackTrace() from within the user code.

+  void* caller_frame_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);

+};

+

+// Information about a Google Test trace point.

+struct TraceInfo {

+  const char* file;

+  int line;

+  std::string message;

+};

+

+// This is the default global test part result reporter used in UnitTestImpl.

+// This class should only be used by UnitTestImpl.

+class DefaultGlobalTestPartResultReporter

+  : public TestPartResultReporterInterface {

+ public:

+  explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);

+  // Implements the TestPartResultReporterInterface. Reports the test part

+  // result in the current test.

+  virtual void ReportTestPartResult(const TestPartResult& result);

+

+ private:

+  UnitTestImpl* const unit_test_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);

+};

+

+// This is the default per thread test part result reporter used in

+// UnitTestImpl. This class should only be used by UnitTestImpl.

+class DefaultPerThreadTestPartResultReporter

+    : public TestPartResultReporterInterface {

+ public:

+  explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);

+  // Implements the TestPartResultReporterInterface. The implementation just

+  // delegates to the current global test part result reporter of *unit_test_.

+  virtual void ReportTestPartResult(const TestPartResult& result);

+

+ private:

+  UnitTestImpl* const unit_test_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);

+};

+

+// The private implementation of the UnitTest class.  We don't protect

+// the methods under a mutex, as this class is not accessible by a

+// user and the UnitTest class that delegates work to this class does

+// proper locking.

+class GTEST_API_ UnitTestImpl {

+ public:

+  explicit UnitTestImpl(UnitTest* parent);

+  virtual ~UnitTestImpl();

+

+  // There are two different ways to register your own TestPartResultReporter.

+  // You can register your own repoter to listen either only for test results

+  // from the current thread or for results from all threads.

+  // By default, each per-thread test result repoter just passes a new

+  // TestPartResult to the global test result reporter, which registers the

+  // test part result for the currently running test.

+

+  // Returns the global test part result reporter.

+  TestPartResultReporterInterface* GetGlobalTestPartResultReporter();

+

+  // Sets the global test part result reporter.

+  void SetGlobalTestPartResultReporter(

+      TestPartResultReporterInterface* reporter);

+

+  // Returns the test part result reporter for the current thread.

+  TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();

+

+  // Sets the test part result reporter for the current thread.

+  void SetTestPartResultReporterForCurrentThread(

+      TestPartResultReporterInterface* reporter);

+

+  // Gets the number of successful test cases.

+  int successful_test_case_count() const;

+

+  // Gets the number of failed test cases.

+  int failed_test_case_count() const;

+

+  // Gets the number of all test cases.

+  int total_test_case_count() const;

+

+  // Gets the number of all test cases that contain at least one test

+  // that should run.

+  int test_case_to_run_count() const;

+

+  // Gets the number of successful tests.

+  int successful_test_count() const;

+

+  // Gets the number of failed tests.

+  int failed_test_count() const;

+

+  // Gets the number of disabled tests that will be reported in the XML report.

+  int reportable_disabled_test_count() const;

+

+  // Gets the number of disabled tests.

+  int disabled_test_count() const;

+

+  // Gets the number of tests to be printed in the XML report.

+  int reportable_test_count() const;

+

+  // Gets the number of all tests.

+  int total_test_count() const;

+

+  // Gets the number of tests that should run.

+  int test_to_run_count() const;

+

+  // Gets the time of the test program start, in ms from the start of the

+  // UNIX epoch.

+  TimeInMillis start_timestamp() const { return start_timestamp_; }

+

+  // Gets the elapsed time, in milliseconds.

+  TimeInMillis elapsed_time() const { return elapsed_time_; }

+

+  // Returns true iff the unit test passed (i.e. all test cases passed).

+  bool Passed() const { return !Failed(); }

+

+  // Returns true iff the unit test failed (i.e. some test case failed

+  // or something outside of all tests failed).

+  bool Failed() const {

+    return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();

+  }

+

+  // Gets the i-th test case among all the test cases. i can range from 0 to

+  // total_test_case_count() - 1. If i is not in that range, returns NULL.

+  const TestCase* GetTestCase(int i) const {

+    const int index = GetElementOr(test_case_indices_, i, -1);

+    return index < 0 ? NULL : test_cases_[i];

+  }

+

+  // Gets the i-th test case among all the test cases. i can range from 0 to

+  // total_test_case_count() - 1. If i is not in that range, returns NULL.

+  TestCase* GetMutableTestCase(int i) {

+    const int index = GetElementOr(test_case_indices_, i, -1);

+    return index < 0 ? NULL : test_cases_[index];

+  }

+

+  // Provides access to the event listener list.

+  TestEventListeners* listeners() { return &listeners_; }

+

+  // Returns the TestResult for the test that's currently running, or

+  // the TestResult for the ad hoc test if no test is running.

+  TestResult* current_test_result();

+

+  // Returns the TestResult for the ad hoc test.

+  const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }

+

+  // Sets the OS stack trace getter.

+  //

+  // Does nothing if the input and the current OS stack trace getter

+  // are the same; otherwise, deletes the old getter and makes the

+  // input the current getter.

+  void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);

+

+  // Returns the current OS stack trace getter if it is not NULL;

+  // otherwise, creates an OsStackTraceGetter, makes it the current

+  // getter, and returns it.

+  OsStackTraceGetterInterface* os_stack_trace_getter();

+

+  // Returns the current OS stack trace as an std::string.

+  //

+  // The maximum number of stack frames to be included is specified by

+  // the gtest_stack_trace_depth flag.  The skip_count parameter

+  // specifies the number of top frames to be skipped, which doesn't

+  // count against the number of frames to be included.

+  //

+  // For example, if Foo() calls Bar(), which in turn calls

+  // CurrentOsStackTraceExceptTop(1), Foo() will be included in the

+  // trace but Bar() and CurrentOsStackTraceExceptTop() won't.

+  std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;

+

+  // Finds and returns a TestCase with the given name.  If one doesn't

+  // exist, creates one and returns it.

+  //

+  // Arguments:

+  //

+  //   test_case_name: name of the test case

+  //   type_param:     the name of the test's type parameter, or NULL if

+  //                   this is not a typed or a type-parameterized test.

+  //   set_up_tc:      pointer to the function that sets up the test case

+  //   tear_down_tc:   pointer to the function that tears down the test case

+  TestCase* GetTestCase(const char* test_case_name,

+                        const char* type_param,

+                        Test::SetUpTestCaseFunc set_up_tc,

+                        Test::TearDownTestCaseFunc tear_down_tc);

+

+  // Adds a TestInfo to the unit test.

+  //

+  // Arguments:

+  //

+  //   set_up_tc:    pointer to the function that sets up the test case

+  //   tear_down_tc: pointer to the function that tears down the test case

+  //   test_info:    the TestInfo object

+  void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,

+                   Test::TearDownTestCaseFunc tear_down_tc,

+                   TestInfo* test_info) {

+    // In order to support thread-safe death tests, we need to

+    // remember the original working directory when the test program

+    // was first invoked.  We cannot do this in RUN_ALL_TESTS(), as

+    // the user may have changed the current directory before calling

+    // RUN_ALL_TESTS().  Therefore we capture the current directory in

+    // AddTestInfo(), which is called to register a TEST or TEST_F

+    // before main() is reached.

+    if (original_working_dir_.IsEmpty()) {

+      original_working_dir_.Set(FilePath::GetCurrentDir());

+      GTEST_CHECK_(!original_working_dir_.IsEmpty())

+          << "Failed to get the current working directory.";

+    }

+

+    GetTestCase(test_info->test_case_name(),

+                test_info->type_param(),

+                set_up_tc,

+                tear_down_tc)->AddTestInfo(test_info);

+  }

+

+#if GTEST_HAS_PARAM_TEST

+  // Returns ParameterizedTestCaseRegistry object used to keep track of

+  // value-parameterized tests and instantiate and register them.

+  internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {

+    return parameterized_test_registry_;

+  }

+#endif  // GTEST_HAS_PARAM_TEST

+

+  // Sets the TestCase object for the test that's currently running.

+  void set_current_test_case(TestCase* a_current_test_case) {

+    current_test_case_ = a_current_test_case;

+  }

+

+  // Sets the TestInfo object for the test that's currently running.  If

+  // current_test_info is NULL, the assertion results will be stored in

+  // ad_hoc_test_result_.

+  void set_current_test_info(TestInfo* a_current_test_info) {

+    current_test_info_ = a_current_test_info;

+  }

+

+  // Registers all parameterized tests defined using TEST_P and

+  // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter

+  // combination. This method can be called more then once; it has guards

+  // protecting from registering the tests more then once.  If

+  // value-parameterized tests are disabled, RegisterParameterizedTests is

+  // present but does nothing.

+  void RegisterParameterizedTests();

+

+  // Runs all tests in this UnitTest object, prints the result, and

+  // returns true if all tests are successful.  If any exception is

+  // thrown during a test, this test is considered to be failed, but

+  // the rest of the tests will still be run.

+  bool RunAllTests();

+

+  // Clears the results of all tests, except the ad hoc tests.

+  void ClearNonAdHocTestResult() {

+    ForEach(test_cases_, TestCase::ClearTestCaseResult);

+  }

+

+  // Clears the results of ad-hoc test assertions.

+  void ClearAdHocTestResult() {

+    ad_hoc_test_result_.Clear();

+  }

+

+  // Adds a TestProperty to the current TestResult object when invoked in a

+  // context of a test or a test case, or to the global property set. If the

+  // result already contains a property with the same key, the value will be

+  // updated.

+  void RecordProperty(const TestProperty& test_property);

+

+  enum ReactionToSharding {

+    HONOR_SHARDING_PROTOCOL,

+    IGNORE_SHARDING_PROTOCOL

+  };

+

+  // Matches the full name of each test against the user-specified

+  // filter to decide whether the test should run, then records the

+  // result in each TestCase and TestInfo object.

+  // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests

+  // based on sharding variables in the environment.

+  // Returns the number of tests that should run.

+  int FilterTests(ReactionToSharding shard_tests);

+

+  // Prints the names of the tests matching the user-specified filter flag.

+  void ListTestsMatchingFilter();

+

+  const TestCase* current_test_case() const { return current_test_case_; }

+  TestInfo* current_test_info() { return current_test_info_; }

+  const TestInfo* current_test_info() const { return current_test_info_; }

+

+  // Returns the vector of environments that need to be set-up/torn-down

+  // before/after the tests are run.

+  std::vector<Environment*>& environments() { return environments_; }

+

+  // Getters for the per-thread Google Test trace stack.

+  std::vector<TraceInfo>& gtest_trace_stack() {

+    return *(gtest_trace_stack_.pointer());

+  }

+  const std::vector<TraceInfo>& gtest_trace_stack() const {

+    return gtest_trace_stack_.get();

+  }

+

+#if GTEST_HAS_DEATH_TEST

+  void InitDeathTestSubprocessControlInfo() {

+    internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());

+  }

+  // Returns a pointer to the parsed --gtest_internal_run_death_test

+  // flag, or NULL if that flag was not specified.

+  // This information is useful only in a death test child process.

+  // Must not be called before a call to InitGoogleTest.

+  const InternalRunDeathTestFlag* internal_run_death_test_flag() const {

+    return internal_run_death_test_flag_.get();

+  }

+

+  // Returns a pointer to the current death test factory.

+  internal::DeathTestFactory* death_test_factory() {

+    return death_test_factory_.get();

+  }

+

+  void SuppressTestEventsIfInSubprocess();

+

+  friend class ReplaceDeathTestFactory;

+#endif  // GTEST_HAS_DEATH_TEST

+

+  // Initializes the event listener performing XML output as specified by

+  // UnitTestOptions. Must not be called before InitGoogleTest.

+  void ConfigureXmlOutput();

+

+#if GTEST_CAN_STREAM_RESULTS_

+  // Initializes the event listener for streaming test results to a socket.

+  // Must not be called before InitGoogleTest.

+  void ConfigureStreamingOutput();

+#endif

+

+  // Performs initialization dependent upon flag values obtained in

+  // ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to

+  // ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest

+  // this function is also called from RunAllTests.  Since this function can be

+  // called more than once, it has to be idempotent.

+  void PostFlagParsingInit();

+

+  // Gets the random seed used at the start of the current test iteration.

+  int random_seed() const { return random_seed_; }

+

+  // Gets the random number generator.

+  internal::Random* random() { return &random_; }

+

+  // Shuffles all test cases, and the tests within each test case,

+  // making sure that death tests are still run first.

+  void ShuffleTests();

+

+  // Restores the test cases and tests to their order before the first shuffle.

+  void UnshuffleTests();

+

+  // Returns the value of GTEST_FLAG(catch_exceptions) at the moment

+  // UnitTest::Run() starts.

+  bool catch_exceptions() const { return catch_exceptions_; }

+

+ private:

+  friend class ::testing::UnitTest;

+

+  // Used by UnitTest::Run() to capture the state of

+  // GTEST_FLAG(catch_exceptions) at the moment it starts.

+  void set_catch_exceptions(bool value) { catch_exceptions_ = value; }

+

+  // The UnitTest object that owns this implementation object.

+  UnitTest* const parent_;

+

+  // The working directory when the first TEST() or TEST_F() was

+  // executed.

+  internal::FilePath original_working_dir_;

+

+  // The default test part result reporters.

+  DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;

+  DefaultPerThreadTestPartResultReporter

+      default_per_thread_test_part_result_reporter_;

+

+  // Points to (but doesn't own) the global test part result reporter.

+  TestPartResultReporterInterface* global_test_part_result_repoter_;

+

+  // Protects read and write access to global_test_part_result_reporter_.

+  internal::Mutex global_test_part_result_reporter_mutex_;

+

+  // Points to (but doesn't own) the per-thread test part result reporter.

+  internal::ThreadLocal<TestPartResultReporterInterface*>

+      per_thread_test_part_result_reporter_;

+

+  // The vector of environments that need to be set-up/torn-down

+  // before/after the tests are run.

+  std::vector<Environment*> environments_;

+

+  // The vector of TestCases in their original order.  It owns the

+  // elements in the vector.

+  std::vector<TestCase*> test_cases_;

+

+  // Provides a level of indirection for the test case list to allow

+  // easy shuffling and restoring the test case order.  The i-th

+  // element of this vector is the index of the i-th test case in the

+  // shuffled order.

+  std::vector<int> test_case_indices_;

+

+#if GTEST_HAS_PARAM_TEST

+  // ParameterizedTestRegistry object used to register value-parameterized

+  // tests.

+  internal::ParameterizedTestCaseRegistry parameterized_test_registry_;

+

+  // Indicates whether RegisterParameterizedTests() has been called already.

+  bool parameterized_tests_registered_;

+#endif  // GTEST_HAS_PARAM_TEST

+

+  // Index of the last death test case registered.  Initially -1.

+  int last_death_test_case_;

+

+  // This points to the TestCase for the currently running test.  It

+  // changes as Google Test goes through one test case after another.

+  // When no test is running, this is set to NULL and Google Test

+  // stores assertion results in ad_hoc_test_result_.  Initially NULL.

+  TestCase* current_test_case_;

+

+  // This points to the TestInfo for the currently running test.  It

+  // changes as Google Test goes through one test after another.  When

+  // no test is running, this is set to NULL and Google Test stores

+  // assertion results in ad_hoc_test_result_.  Initially NULL.

+  TestInfo* current_test_info_;

+

+  // Normally, a user only writes assertions inside a TEST or TEST_F,

+  // or inside a function called by a TEST or TEST_F.  Since Google

+  // Test keeps track of which test is current running, it can

+  // associate such an assertion with the test it belongs to.

+  //

+  // If an assertion is encountered when no TEST or TEST_F is running,

+  // Google Test attributes the assertion result to an imaginary "ad hoc"

+  // test, and records the result in ad_hoc_test_result_.

+  TestResult ad_hoc_test_result_;

+

+  // The list of event listeners that can be used to track events inside

+  // Google Test.

+  TestEventListeners listeners_;

+

+  // The OS stack trace getter.  Will be deleted when the UnitTest

+  // object is destructed.  By default, an OsStackTraceGetter is used,

+  // but the user can set this field to use a custom getter if that is

+  // desired.

+  OsStackTraceGetterInterface* os_stack_trace_getter_;

+

+  // True iff PostFlagParsingInit() has been called.

+  bool post_flag_parse_init_performed_;

+

+  // The random number seed used at the beginning of the test run.

+  int random_seed_;

+

+  // Our random number generator.

+  internal::Random random_;

+

+  // The time of the test program start, in ms from the start of the

+  // UNIX epoch.

+  TimeInMillis start_timestamp_;

+

+  // How long the test took to run, in milliseconds.

+  TimeInMillis elapsed_time_;

+

+#if GTEST_HAS_DEATH_TEST

+  // The decomposed components of the gtest_internal_run_death_test flag,

+  // parsed when RUN_ALL_TESTS is called.

+  internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;

+  internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;

+#endif  // GTEST_HAS_DEATH_TEST

+

+  // A per-thread stack of traces created by the SCOPED_TRACE() macro.

+  internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;

+

+  // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()

+  // starts.

+  bool catch_exceptions_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);

+};  // class UnitTestImpl

+

+// Convenience function for accessing the global UnitTest

+// implementation object.

+inline UnitTestImpl* GetUnitTestImpl() {

+  return UnitTest::GetInstance()->impl();

+}

+

+#if GTEST_USES_SIMPLE_RE

+

+// Internal helper functions for implementing the simple regular

+// expression matcher.

+GTEST_API_ bool IsInSet(char ch, const char* str);

+GTEST_API_ bool IsAsciiDigit(char ch);

+GTEST_API_ bool IsAsciiPunct(char ch);

+GTEST_API_ bool IsRepeat(char ch);

+GTEST_API_ bool IsAsciiWhiteSpace(char ch);

+GTEST_API_ bool IsAsciiWordChar(char ch);

+GTEST_API_ bool IsValidEscape(char ch);

+GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);

+GTEST_API_ bool ValidateRegex(const char* regex);

+GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);

+GTEST_API_ bool MatchRepetitionAndRegexAtHead(

+    bool escaped, char ch, char repeat, const char* regex, const char* str);

+GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);

+

+#endif  // GTEST_USES_SIMPLE_RE

+

+// Parses the command line for Google Test flags, without initializing

+// other parts of Google Test.

+GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);

+GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);

+

+#if GTEST_HAS_DEATH_TEST

+

+// Returns the message describing the last system error, regardless of the

+// platform.

+GTEST_API_ std::string GetLastErrnoDescription();

+

+# if GTEST_OS_WINDOWS

+// Provides leak-safe Windows kernel handle ownership.

+class AutoHandle {

+ public:

+  AutoHandle() : handle_(INVALID_HANDLE_VALUE) {}

+  explicit AutoHandle(HANDLE handle) : handle_(handle) {}

+

+  ~AutoHandle() { Reset(); }

+

+  HANDLE Get() const { return handle_; }

+  void Reset() { Reset(INVALID_HANDLE_VALUE); }

+  void Reset(HANDLE handle) {

+    if (handle != handle_) {

+      if (handle_ != INVALID_HANDLE_VALUE)

+        ::CloseHandle(handle_);

+      handle_ = handle;

+    }

+  }

+

+ private:

+  HANDLE handle_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);

+};

+# endif  // GTEST_OS_WINDOWS

+

+// Attempts to parse a string into a positive integer pointed to by the

+// number parameter.  Returns true if that is possible.

+// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use

+// it here.

+template <typename Integer>

+bool ParseNaturalNumber(const ::std::string& str, Integer* number) {

+  // Fail fast if the given string does not begin with a digit;

+  // this bypasses strtoXXX's "optional leading whitespace and plus

+  // or minus sign" semantics, which are undesirable here.

+  if (str.empty() || !IsDigit(str[0])) {

+    return false;

+  }

+  errno = 0;

+

+  char* end;

+  // BiggestConvertible is the largest integer type that system-provided

+  // string-to-number conversion routines can return.

+

+# if GTEST_OS_WINDOWS && !defined(__GNUC__)

+

+  // MSVC and C++ Builder define __int64 instead of the standard long long.

+  typedef unsigned __int64 BiggestConvertible;

+  const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);

+

+# else

+

+  typedef unsigned long long BiggestConvertible;  // NOLINT

+  const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);

+

+# endif  // GTEST_OS_WINDOWS && !defined(__GNUC__)

+

+  const bool parse_success = *end == '\0' && errno == 0;

+

+  // TODO(vladl@google.com): Convert this to compile time assertion when it is

+  // available.

+  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));

+

+  const Integer result = static_cast<Integer>(parsed);

+  if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {

+    *number = result;

+    return true;

+  }

+  return false;

+}

+#endif  // GTEST_HAS_DEATH_TEST

+

+// TestResult contains some private methods that should be hidden from

+// Google Test user but are required for testing. This class allow our tests

+// to access them.

+//

+// This class is supplied only for the purpose of testing Google Test's own

+// constructs. Do not use it in user tests, either directly or indirectly.

+class TestResultAccessor {

+ public:

+  static void RecordProperty(TestResult* test_result,

+                             const std::string& xml_element,

+                             const TestProperty& property) {

+    test_result->RecordProperty(xml_element, property);

+  }

+

+  static void ClearTestPartResults(TestResult* test_result) {

+    test_result->ClearTestPartResults();

+  }

+

+  static const std::vector<testing::TestPartResult>& test_part_results(

+      const TestResult& test_result) {

+    return test_result.test_part_results();

+  }

+};

+

+#if GTEST_CAN_STREAM_RESULTS_

+

+// Streams test results to the given port on the given host machine.

+class StreamingListener : public EmptyTestEventListener {

+ public:

+  // Abstract base class for writing strings to a socket.

+  class AbstractSocketWriter {

+   public:

+    virtual ~AbstractSocketWriter() {}

+

+    // Sends a string to the socket.

+    virtual void Send(const string& message) = 0;

+

+    // Closes the socket.

+    virtual void CloseConnection() {}

+

+    // Sends a string and a newline to the socket.

+    void SendLn(const string& message) {

+      Send(message + "\n");

+    }

+  };

+

+  // Concrete class for actually writing strings to a socket.

+  class SocketWriter : public AbstractSocketWriter {

+   public:

+    SocketWriter(const string& host, const string& port)

+        : sockfd_(-1), host_name_(host), port_num_(port) {

+      MakeConnection();

+    }

+

+    virtual ~SocketWriter() {

+      if (sockfd_ != -1)

+        CloseConnection();

+    }

+

+    // Sends a string to the socket.

+    virtual void Send(const string& message) {

+      GTEST_CHECK_(sockfd_ != -1)

+          << "Send() can be called only when there is a connection.";

+

+      const int len = static_cast<int>(message.length());

+      if (write(sockfd_, message.c_str(), len) != len) {

+        GTEST_LOG_(WARNING)

+            << "stream_result_to: failed to stream to "

+            << host_name_ << ":" << port_num_;

+      }

+    }

+

+   private:

+    // Creates a client socket and connects to the server.

+    void MakeConnection();

+

+    // Closes the socket.

+    void CloseConnection() {

+      GTEST_CHECK_(sockfd_ != -1)

+          << "CloseConnection() can be called only when there is a connection.";

+

+      close(sockfd_);

+      sockfd_ = -1;

+    }

+

+    int sockfd_;  // socket file descriptor

+    const string host_name_;

+    const string port_num_;

+

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);

+  };  // class SocketWriter

+

+  // Escapes '=', '&', '%', and '\n' characters in str as "%xx".

+  static string UrlEncode(const char* str);

+

+  StreamingListener(const string& host, const string& port)

+      : socket_writer_(new SocketWriter(host, port)) { Start(); }

+

+  explicit StreamingListener(AbstractSocketWriter* socket_writer)

+      : socket_writer_(socket_writer) { Start(); }

+

+  void OnTestProgramStart(const UnitTest& /* unit_test */) {

+    SendLn("event=TestProgramStart");

+  }

+

+  void OnTestProgramEnd(const UnitTest& unit_test) {

+    // Note that Google Test current only report elapsed time for each

+    // test iteration, not for the entire test program.

+    SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));

+

+    // Notify the streaming server to stop.

+    socket_writer_->CloseConnection();

+  }

+

+  void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {

+    SendLn("event=TestIterationStart&iteration=" +

+           StreamableToString(iteration));

+  }

+

+  void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {

+    SendLn("event=TestIterationEnd&passed=" +

+           FormatBool(unit_test.Passed()) + "&elapsed_time=" +

+           StreamableToString(unit_test.elapsed_time()) + "ms");

+  }

+

+  void OnTestCaseStart(const TestCase& test_case) {

+    SendLn(std::string("event=TestCaseStart&name=") + test_case.name());

+  }

+

+  void OnTestCaseEnd(const TestCase& test_case) {

+    SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())

+           + "&elapsed_time=" + StreamableToString(test_case.elapsed_time())

+           + "ms");

+  }

+

+  void OnTestStart(const TestInfo& test_info) {

+    SendLn(std::string("event=TestStart&name=") + test_info.name());

+  }

+

+  void OnTestEnd(const TestInfo& test_info) {

+    SendLn("event=TestEnd&passed=" +

+           FormatBool((test_info.result())->Passed()) +

+           "&elapsed_time=" +

+           StreamableToString((test_info.result())->elapsed_time()) + "ms");

+  }

+

+  void OnTestPartResult(const TestPartResult& test_part_result) {

+    const char* file_name = test_part_result.file_name();

+    if (file_name == NULL)

+      file_name = "";

+    SendLn("event=TestPartResult&file=" + UrlEncode(file_name) +

+           "&line=" + StreamableToString(test_part_result.line_number()) +

+           "&message=" + UrlEncode(test_part_result.message()));

+  }

+

+ private:

+  // Sends the given message and a newline to the socket.

+  void SendLn(const string& message) { socket_writer_->SendLn(message); }

+

+  // Called at the start of streaming to notify the receiver what

+  // protocol we are using.

+  void Start() { SendLn("gtest_streaming_protocol_version=1.0"); }

+

+  string FormatBool(bool value) { return value ? "1" : "0"; }

+

+  const scoped_ptr<AbstractSocketWriter> socket_writer_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);

+};  // class StreamingListener

+

+#endif  // GTEST_CAN_STREAM_RESULTS_

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GTEST_SRC_GTEST_INTERNAL_INL_H_

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-port.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-port.cc
new file mode 100644
index 0000000..4befbb1
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-port.cc
@@ -0,0 +1,805 @@
+// 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: wan@google.com (Zhanyong Wan)

+

+#include "gtest/internal/gtest-port.h"

+

+#include <limits.h>

+#include <stdlib.h>

+#include <stdio.h>

+#include <string.h>

+

+#if GTEST_OS_WINDOWS_MOBILE

+# include <windows.h>  // For TerminateProcess()

+#elif GTEST_OS_WINDOWS

+# include <io.h>

+# include <sys/stat.h>

+#else

+# include <unistd.h>

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+#if GTEST_OS_MAC

+# include <mach/mach_init.h>

+# include <mach/task.h>

+# include <mach/vm_map.h>

+#endif  // GTEST_OS_MAC

+

+#if GTEST_OS_QNX

+# include <devctl.h>

+# include <sys/procfs.h>

+#endif  // GTEST_OS_QNX

+

+#include "gtest/gtest-spi.h"

+#include "gtest/gtest-message.h"

+#include "gtest/internal/gtest-internal.h"

+#include "gtest/internal/gtest-string.h"

+

+// Indicates that this translation unit is part of Google Test's

+// implementation.  It must come before gtest-internal-inl.h is

+// included, or there will be a compiler error.  This trick is to

+// prevent a user from accidentally including gtest-internal-inl.h in

+// his code.

+#define GTEST_IMPLEMENTATION_ 1

+#include "src/gtest-internal-inl.h"

+#undef GTEST_IMPLEMENTATION_

+

+namespace testing {

+namespace internal {

+

+#if defined(_MSC_VER) || defined(__BORLANDC__)

+// MSVC and C++Builder do not provide a definition of STDERR_FILENO.

+const int kStdOutFileno = 1;

+const int kStdErrFileno = 2;

+#else

+const int kStdOutFileno = STDOUT_FILENO;

+const int kStdErrFileno = STDERR_FILENO;

+#endif  // _MSC_VER

+

+#if GTEST_OS_MAC

+

+// Returns the number of threads running in the process, or 0 to indicate that

+// we cannot detect it.

+size_t GetThreadCount() {

+  const task_t task = mach_task_self();

+  mach_msg_type_number_t thread_count;

+  thread_act_array_t thread_list;

+  const kern_return_t status = task_threads(task, &thread_list, &thread_count);

+  if (status == KERN_SUCCESS) {

+    // task_threads allocates resources in thread_list and we need to free them

+    // to avoid leaks.

+    vm_deallocate(task,

+                  reinterpret_cast<vm_address_t>(thread_list),

+                  sizeof(thread_t) * thread_count);

+    return static_cast<size_t>(thread_count);

+  } else {

+    return 0;

+  }

+}

+

+#elif GTEST_OS_QNX

+

+// Returns the number of threads running in the process, or 0 to indicate that

+// we cannot detect it.

+size_t GetThreadCount() {

+  const int fd = open("/proc/self/as", O_RDONLY);

+  if (fd < 0) {

+    return 0;

+  }

+  procfs_info process_info;

+  const int status =

+      devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);

+  close(fd);

+  if (status == EOK) {

+    return static_cast<size_t>(process_info.num_threads);

+  } else {

+    return 0;

+  }

+}

+

+#else

+

+size_t GetThreadCount() {

+  // There's no portable way to detect the number of threads, so we just

+  // return 0 to indicate that we cannot detect it.

+  return 0;

+}

+

+#endif  // GTEST_OS_MAC

+

+#if GTEST_USES_POSIX_RE

+

+// Implements RE.  Currently only needed for death tests.

+

+RE::~RE() {

+  if (is_valid_) {

+    // regfree'ing an invalid regex might crash because the content

+    // of the regex is undefined. Since the regex's are essentially

+    // the same, one cannot be valid (or invalid) without the other

+    // being so too.

+    regfree(&partial_regex_);

+    regfree(&full_regex_);

+  }

+  free(const_cast<char*>(pattern_));

+}

+

+// Returns true iff regular expression re matches the entire str.

+bool RE::FullMatch(const char* str, const RE& re) {

+  if (!re.is_valid_) return false;

+

+  regmatch_t match;

+  return regexec(&re.full_regex_, str, 1, &match, 0) == 0;

+}

+

+// Returns true iff regular expression re matches a substring of str

+// (including str itself).

+bool RE::PartialMatch(const char* str, const RE& re) {

+  if (!re.is_valid_) return false;

+

+  regmatch_t match;

+  return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;

+}

+

+// Initializes an RE from its string representation.

+void RE::Init(const char* regex) {

+  pattern_ = posix::StrDup(regex);

+

+  // Reserves enough bytes to hold the regular expression used for a

+  // full match.

+  const size_t full_regex_len = strlen(regex) + 10;

+  char* const full_pattern = new char[full_regex_len];

+

+  snprintf(full_pattern, full_regex_len, "^(%s)$", regex);

+  is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;

+  // We want to call regcomp(&partial_regex_, ...) even if the

+  // previous expression returns false.  Otherwise partial_regex_ may

+  // not be properly initialized can may cause trouble when it's

+  // freed.

+  //

+  // Some implementation of POSIX regex (e.g. on at least some

+  // versions of Cygwin) doesn't accept the empty string as a valid

+  // regex.  We change it to an equivalent form "()" to be safe.

+  if (is_valid_) {

+    const char* const partial_regex = (*regex == '\0') ? "()" : regex;

+    is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;

+  }

+  EXPECT_TRUE(is_valid_)

+      << "Regular expression \"" << regex

+      << "\" is not a valid POSIX Extended regular expression.";

+

+  delete[] full_pattern;

+}

+

+#elif GTEST_USES_SIMPLE_RE

+

+// Returns true iff ch appears anywhere in str (excluding the

+// terminating '\0' character).

+bool IsInSet(char ch, const char* str) {

+  return ch != '\0' && strchr(str, ch) != NULL;

+}

+

+// Returns true iff ch belongs to the given classification.  Unlike

+// similar functions in <ctype.h>, these aren't affected by the

+// current locale.

+bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }

+bool IsAsciiPunct(char ch) {

+  return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");

+}

+bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }

+bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }

+bool IsAsciiWordChar(char ch) {

+  return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||

+      ('0' <= ch && ch <= '9') || ch == '_';

+}

+

+// Returns true iff "\\c" is a supported escape sequence.

+bool IsValidEscape(char c) {

+  return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));

+}

+

+// Returns true iff the given atom (specified by escaped and pattern)

+// matches ch.  The result is undefined if the atom is invalid.

+bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {

+  if (escaped) {  // "\\p" where p is pattern_char.

+    switch (pattern_char) {

+      case 'd': return IsAsciiDigit(ch);

+      case 'D': return !IsAsciiDigit(ch);

+      case 'f': return ch == '\f';

+      case 'n': return ch == '\n';

+      case 'r': return ch == '\r';

+      case 's': return IsAsciiWhiteSpace(ch);

+      case 'S': return !IsAsciiWhiteSpace(ch);

+      case 't': return ch == '\t';

+      case 'v': return ch == '\v';

+      case 'w': return IsAsciiWordChar(ch);

+      case 'W': return !IsAsciiWordChar(ch);

+    }

+    return IsAsciiPunct(pattern_char) && pattern_char == ch;

+  }

+

+  return (pattern_char == '.' && ch != '\n') || pattern_char == ch;

+}

+

+// Helper function used by ValidateRegex() to format error messages.

+std::string FormatRegexSyntaxError(const char* regex, int index) {

+  return (Message() << "Syntax error at index " << index

+          << " in simple regular expression \"" << regex << "\": ").GetString();

+}

+

+// Generates non-fatal failures and returns false if regex is invalid;

+// otherwise returns true.

+bool ValidateRegex(const char* regex) {

+  if (regex == NULL) {

+    // TODO(wan@google.com): fix the source file location in the

+    // assertion failures to match where the regex is used in user

+    // code.

+    ADD_FAILURE() << "NULL is not a valid simple regular expression.";

+    return false;

+  }

+

+  bool is_valid = true;

+

+  // True iff ?, *, or + can follow the previous atom.

+  bool prev_repeatable = false;

+  for (int i = 0; regex[i]; i++) {

+    if (regex[i] == '\\') {  // An escape sequence

+      i++;

+      if (regex[i] == '\0') {

+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)

+                      << "'\\' cannot appear at the end.";

+        return false;

+      }

+

+      if (!IsValidEscape(regex[i])) {

+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)

+                      << "invalid escape sequence \"\\" << regex[i] << "\".";

+        is_valid = false;

+      }

+      prev_repeatable = true;

+    } else {  // Not an escape sequence.

+      const char ch = regex[i];

+

+      if (ch == '^' && i > 0) {

+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)

+                      << "'^' can only appear at the beginning.";

+        is_valid = false;

+      } else if (ch == '$' && regex[i + 1] != '\0') {

+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)

+                      << "'$' can only appear at the end.";

+        is_valid = false;

+      } else if (IsInSet(ch, "()[]{}|")) {

+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)

+                      << "'" << ch << "' is unsupported.";

+        is_valid = false;

+      } else if (IsRepeat(ch) && !prev_repeatable) {

+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)

+                      << "'" << ch << "' can only follow a repeatable token.";

+        is_valid = false;

+      }

+

+      prev_repeatable = !IsInSet(ch, "^$?*+");

+    }

+  }

+

+  return is_valid;

+}

+

+// Matches a repeated regex atom followed by a valid simple regular

+// expression.  The regex atom is defined as c if escaped is false,

+// or \c otherwise.  repeat is the repetition meta character (?, *,

+// or +).  The behavior is undefined if str contains too many

+// characters to be indexable by size_t, in which case the test will

+// probably time out anyway.  We are fine with this limitation as

+// std::string has it too.

+bool MatchRepetitionAndRegexAtHead(

+    bool escaped, char c, char repeat, const char* regex,

+    const char* str) {

+  const size_t min_count = (repeat == '+') ? 1 : 0;

+  const size_t max_count = (repeat == '?') ? 1 :

+      static_cast<size_t>(-1) - 1;

+  // We cannot call numeric_limits::max() as it conflicts with the

+  // max() macro on Windows.

+

+  for (size_t i = 0; i <= max_count; ++i) {

+    // We know that the atom matches each of the first i characters in str.

+    if (i >= min_count && MatchRegexAtHead(regex, str + i)) {

+      // We have enough matches at the head, and the tail matches too.

+      // Since we only care about *whether* the pattern matches str

+      // (as opposed to *how* it matches), there is no need to find a

+      // greedy match.

+      return true;

+    }

+    if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))

+      return false;

+  }

+  return false;

+}

+

+// Returns true iff regex matches a prefix of str.  regex must be a

+// valid simple regular expression and not start with "^", or the

+// result is undefined.

+bool MatchRegexAtHead(const char* regex, const char* str) {

+  if (*regex == '\0')  // An empty regex matches a prefix of anything.

+    return true;

+

+  // "$" only matches the end of a string.  Note that regex being

+  // valid guarantees that there's nothing after "$" in it.

+  if (*regex == '$')

+    return *str == '\0';

+

+  // Is the first thing in regex an escape sequence?

+  const bool escaped = *regex == '\\';

+  if (escaped)

+    ++regex;

+  if (IsRepeat(regex[1])) {

+    // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so

+    // here's an indirect recursion.  It terminates as the regex gets

+    // shorter in each recursion.

+    return MatchRepetitionAndRegexAtHead(

+        escaped, regex[0], regex[1], regex + 2, str);

+  } else {

+    // regex isn't empty, isn't "$", and doesn't start with a

+    // repetition.  We match the first atom of regex with the first

+    // character of str and recurse.

+    return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&

+        MatchRegexAtHead(regex + 1, str + 1);

+  }

+}

+

+// Returns true iff regex matches any substring of str.  regex must be

+// a valid simple regular expression, or the result is undefined.

+//

+// The algorithm is recursive, but the recursion depth doesn't exceed

+// the regex length, so we won't need to worry about running out of

+// stack space normally.  In rare cases the time complexity can be

+// exponential with respect to the regex length + the string length,

+// but usually it's must faster (often close to linear).

+bool MatchRegexAnywhere(const char* regex, const char* str) {

+  if (regex == NULL || str == NULL)

+    return false;

+

+  if (*regex == '^')

+    return MatchRegexAtHead(regex + 1, str);

+

+  // A successful match can be anywhere in str.

+  do {

+    if (MatchRegexAtHead(regex, str))

+      return true;

+  } while (*str++ != '\0');

+  return false;

+}

+

+// Implements the RE class.

+

+RE::~RE() {

+  free(const_cast<char*>(pattern_));

+  free(const_cast<char*>(full_pattern_));

+}

+

+// Returns true iff regular expression re matches the entire str.

+bool RE::FullMatch(const char* str, const RE& re) {

+  return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);

+}

+

+// Returns true iff regular expression re matches a substring of str

+// (including str itself).

+bool RE::PartialMatch(const char* str, const RE& re) {

+  return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);

+}

+

+// Initializes an RE from its string representation.

+void RE::Init(const char* regex) {

+  pattern_ = full_pattern_ = NULL;

+  if (regex != NULL) {

+    pattern_ = posix::StrDup(regex);

+  }

+

+  is_valid_ = ValidateRegex(regex);

+  if (!is_valid_) {

+    // No need to calculate the full pattern when the regex is invalid.

+    return;

+  }

+

+  const size_t len = strlen(regex);

+  // Reserves enough bytes to hold the regular expression used for a

+  // full match: we need space to prepend a '^', append a '$', and

+  // terminate the string with '\0'.

+  char* buffer = static_cast<char*>(malloc(len + 3));

+  full_pattern_ = buffer;

+

+  if (*regex != '^')

+    *buffer++ = '^';  // Makes sure full_pattern_ starts with '^'.

+

+  // We don't use snprintf or strncpy, as they trigger a warning when

+  // compiled with VC++ 8.0.

+  memcpy(buffer, regex, len);

+  buffer += len;

+

+  if (len == 0 || regex[len - 1] != '$')

+    *buffer++ = '$';  // Makes sure full_pattern_ ends with '$'.

+

+  *buffer = '\0';

+}

+

+#endif  // GTEST_USES_POSIX_RE

+

+const char kUnknownFile[] = "unknown file";

+

+// Formats a source file path and a line number as they would appear

+// in an error message from the compiler used to compile this code.

+GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {

+  const std::string file_name(file == NULL ? kUnknownFile : file);

+

+  if (line < 0) {

+    return file_name + ":";

+  }

+#ifdef _MSC_VER

+  return file_name + "(" + StreamableToString(line) + "):";

+#else

+  return file_name + ":" + StreamableToString(line) + ":";

+#endif  // _MSC_VER

+}

+

+// Formats a file location for compiler-independent XML output.

+// Although this function is not platform dependent, we put it next to

+// FormatFileLocation in order to contrast the two functions.

+// Note that FormatCompilerIndependentFileLocation() does NOT append colon

+// to the file location it produces, unlike FormatFileLocation().

+GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(

+    const char* file, int line) {

+  const std::string file_name(file == NULL ? kUnknownFile : file);

+

+  if (line < 0)

+    return file_name;

+  else

+    return file_name + ":" + StreamableToString(line);

+}

+

+

+GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)

+    : severity_(severity) {

+  const char* const marker =

+      severity == GTEST_INFO ?    "[  INFO ]" :

+      severity == GTEST_WARNING ? "[WARNING]" :

+      severity == GTEST_ERROR ?   "[ ERROR ]" : "[ FATAL ]";

+  GetStream() << ::std::endl << marker << " "

+              << FormatFileLocation(file, line).c_str() << ": ";

+}

+

+// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.

+GTestLog::~GTestLog() {

+  GetStream() << ::std::endl;

+  if (severity_ == GTEST_FATAL) {

+    fflush(stderr);

+    posix::Abort();

+  }

+}

+// Disable Microsoft deprecation warnings for POSIX functions called from

+// this class (creat, dup, dup2, and close)

+#ifdef _MSC_VER

+# pragma warning(push)

+# pragma warning(disable: 4996)

+#endif  // _MSC_VER

+

+#if GTEST_HAS_STREAM_REDIRECTION

+

+// Object that captures an output stream (stdout/stderr).

+class CapturedStream {

+ public:

+  // The ctor redirects the stream to a temporary file.

+  explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {

+# if GTEST_OS_WINDOWS

+    char temp_dir_path[MAX_PATH + 1] = { '\0' };  // NOLINT

+    char temp_file_path[MAX_PATH + 1] = { '\0' };  // NOLINT

+

+    ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);

+    const UINT success = ::GetTempFileNameA(temp_dir_path,

+                                            "gtest_redir",

+                                            0,  // Generate unique file name.

+                                            temp_file_path);

+    GTEST_CHECK_(success != 0)

+        << "Unable to create a temporary file in " << temp_dir_path;

+    const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);

+    GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "

+                                    << temp_file_path;

+    filename_ = temp_file_path;

+# else

+    // There's no guarantee that a test has write access to the current

+    // directory, so we create the temporary file in the /tmp directory

+    // instead. We use /tmp on most systems, and /sdcard on Android.

+    // That's because Android doesn't have /tmp.

+#  if GTEST_OS_LINUX_ANDROID

+    // Note: Android applications are expected to call the framework's

+    // Context.getExternalStorageDirectory() method through JNI to get

+    // the location of the world-writable SD Card directory. However,

+    // this requires a Context handle, which cannot be retrieved

+    // globally from native code. Doing so also precludes running the

+    // code as part of a regular standalone executable, which doesn't

+    // run in a Dalvik process (e.g. when running it through 'adb shell').

+    //

+    // The location /sdcard is directly accessible from native code

+    // and is the only location (unofficially) supported by the Android

+    // team. It's generally a symlink to the real SD Card mount point

+    // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or

+    // other OEM-customized locations. Never rely on these, and always

+    // use /sdcard.

+    char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX";

+#  else

+    char name_template[] = "/tmp/captured_stream.XXXXXX";

+#  endif  // GTEST_OS_LINUX_ANDROID

+    const int captured_fd = mkstemp(name_template);

+    filename_ = name_template;

+# endif  // GTEST_OS_WINDOWS

+    fflush(NULL);

+    dup2(captured_fd, fd_);

+    close(captured_fd);

+  }

+

+  ~CapturedStream() {

+    remove(filename_.c_str());

+  }

+

+  std::string GetCapturedString() {

+    if (uncaptured_fd_ != -1) {

+      // Restores the original stream.

+      fflush(NULL);

+      dup2(uncaptured_fd_, fd_);

+      close(uncaptured_fd_);

+      uncaptured_fd_ = -1;

+    }

+

+    FILE* const file = posix::FOpen(filename_.c_str(), "r");

+    const std::string content = ReadEntireFile(file);

+    posix::FClose(file);

+    return content;

+  }

+

+ private:

+  // Reads the entire content of a file as an std::string.

+  static std::string ReadEntireFile(FILE* file);

+

+  // Returns the size (in bytes) of a file.

+  static size_t GetFileSize(FILE* file);

+

+  const int fd_;  // A stream to capture.

+  int uncaptured_fd_;

+  // Name of the temporary file holding the stderr output.

+  ::std::string filename_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);

+};

+

+// Returns the size (in bytes) of a file.

+size_t CapturedStream::GetFileSize(FILE* file) {

+  fseek(file, 0, SEEK_END);

+  return static_cast<size_t>(ftell(file));

+}

+

+// Reads the entire content of a file as a string.

+std::string CapturedStream::ReadEntireFile(FILE* file) {

+  const size_t file_size = GetFileSize(file);

+  char* const buffer = new char[file_size];

+

+  size_t bytes_last_read = 0;  // # of bytes read in the last fread()

+  size_t bytes_read = 0;       // # of bytes read so far

+

+  fseek(file, 0, SEEK_SET);

+

+  // Keeps reading the file until we cannot read further or the

+  // pre-determined file size is reached.

+  do {

+    bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);

+    bytes_read += bytes_last_read;

+  } while (bytes_last_read > 0 && bytes_read < file_size);

+

+  const std::string content(buffer, bytes_read);

+  delete[] buffer;

+

+  return content;

+}

+

+# ifdef _MSC_VER

+#  pragma warning(pop)

+# endif  // _MSC_VER

+

+static CapturedStream* g_captured_stderr = NULL;

+static CapturedStream* g_captured_stdout = NULL;

+

+// Starts capturing an output stream (stdout/stderr).

+void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) {

+  if (*stream != NULL) {

+    GTEST_LOG_(FATAL) << "Only one " << stream_name

+                      << " capturer can exist at a time.";

+  }

+  *stream = new CapturedStream(fd);

+}

+

+// Stops capturing the output stream and returns the captured string.

+std::string GetCapturedStream(CapturedStream** captured_stream) {

+  const std::string content = (*captured_stream)->GetCapturedString();

+

+  delete *captured_stream;

+  *captured_stream = NULL;

+

+  return content;

+}

+

+// Starts capturing stdout.

+void CaptureStdout() {

+  CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);

+}

+

+// Starts capturing stderr.

+void CaptureStderr() {

+  CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);

+}

+

+// Stops capturing stdout and returns the captured string.

+std::string GetCapturedStdout() {

+  return GetCapturedStream(&g_captured_stdout);

+}

+

+// Stops capturing stderr and returns the captured string.

+std::string GetCapturedStderr() {

+  return GetCapturedStream(&g_captured_stderr);

+}

+

+#endif  // GTEST_HAS_STREAM_REDIRECTION

+

+#if GTEST_HAS_DEATH_TEST

+

+// A copy of all command line arguments.  Set by InitGoogleTest().

+::std::vector<testing::internal::string> g_argvs;

+

+static const ::std::vector<testing::internal::string>* g_injected_test_argvs =

+                                        NULL;  // Owned.

+

+void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) {

+  if (g_injected_test_argvs != argvs)

+    delete g_injected_test_argvs;

+  g_injected_test_argvs = argvs;

+}

+

+const ::std::vector<testing::internal::string>& GetInjectableArgvs() {

+  if (g_injected_test_argvs != NULL) {

+    return *g_injected_test_argvs;

+  }

+  return g_argvs;

+}

+#endif  // GTEST_HAS_DEATH_TEST

+

+#if GTEST_OS_WINDOWS_MOBILE

+namespace posix {

+void Abort() {

+  DebugBreak();

+  TerminateProcess(GetCurrentProcess(), 1);

+}

+}  // namespace posix

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+// Returns the name of the environment variable corresponding to the

+// given flag.  For example, FlagToEnvVar("foo") will return

+// "GTEST_FOO" in the open-source version.

+static std::string FlagToEnvVar(const char* flag) {

+  const std::string full_flag =

+      (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();

+

+  Message env_var;

+  for (size_t i = 0; i != full_flag.length(); i++) {

+    env_var << ToUpper(full_flag.c_str()[i]);

+  }

+

+  return env_var.GetString();

+}

+

+// Parses 'str' for a 32-bit signed integer.  If successful, writes

+// the result to *value and returns true; otherwise leaves *value

+// unchanged and returns false.

+bool ParseInt32(const Message& src_text, const char* str, Int32* value) {

+  // Parses the environment variable as a decimal integer.

+  char* end = NULL;

+  const long long_value = strtol(str, &end, 10);  // NOLINT

+

+  // Has strtol() consumed all characters in the string?

+  if (*end != '\0') {

+    // No - an invalid character was encountered.

+    Message msg;

+    msg << "WARNING: " << src_text

+        << " is expected to be a 32-bit integer, but actually"

+        << " has value \"" << str << "\".\n";

+    printf("%s", msg.GetString().c_str());

+    fflush(stdout);

+    return false;

+  }

+

+  // Is the parsed value in the range of an Int32?

+  const Int32 result = static_cast<Int32>(long_value);

+  if (long_value == LONG_MAX || long_value == LONG_MIN ||

+      // The parsed value overflows as a long.  (strtol() returns

+      // LONG_MAX or LONG_MIN when the input overflows.)

+      result != long_value

+      // The parsed value overflows as an Int32.

+      ) {

+    Message msg;

+    msg << "WARNING: " << src_text

+        << " is expected to be a 32-bit integer, but actually"

+        << " has value " << str << ", which overflows.\n";

+    printf("%s", msg.GetString().c_str());

+    fflush(stdout);

+    return false;

+  }

+

+  *value = result;

+  return true;

+}

+

+// Reads and returns the Boolean environment variable corresponding to

+// the given flag; if it's not set, returns default_value.

+//

+// The value is considered true iff it's not "0".

+bool BoolFromGTestEnv(const char* flag, bool default_value) {

+  const std::string env_var = FlagToEnvVar(flag);

+  const char* const string_value = posix::GetEnv(env_var.c_str());

+  return string_value == NULL ?

+      default_value : strcmp(string_value, "0") != 0;

+}

+

+// Reads and returns a 32-bit integer stored in the environment

+// variable corresponding to the given flag; if it isn't set or

+// doesn't represent a valid 32-bit integer, returns default_value.

+Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {

+  const std::string env_var = FlagToEnvVar(flag);

+  const char* const string_value = posix::GetEnv(env_var.c_str());

+  if (string_value == NULL) {

+    // The environment variable is not set.

+    return default_value;

+  }

+

+  Int32 result = default_value;

+  if (!ParseInt32(Message() << "Environment variable " << env_var,

+                  string_value, &result)) {

+    printf("The default value %s is used.\n",

+           (Message() << default_value).GetString().c_str());

+    fflush(stdout);

+    return default_value;

+  }

+

+  return result;

+}

+

+// Reads and returns the string environment variable corresponding to

+// the given flag; if it's not set, returns default_value.

+const char* StringFromGTestEnv(const char* flag, const char* default_value) {

+  const std::string env_var = FlagToEnvVar(flag);

+  const char* const value = posix::GetEnv(env_var.c_str());

+  return value == NULL ? default_value : value;

+}

+

+}  // namespace internal

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-printers.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-printers.cc
new file mode 100644
index 0000000..b79f77b
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-printers.cc
@@ -0,0 +1,363 @@
+// 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 Test - The Google C++ Testing Framework

+//

+// This file implements a universal value printer that can print a

+// value of any type T:

+//

+//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);

+//

+// It uses the << operator when possible, and prints the bytes in the

+// object otherwise.  A user can override its behavior for a class

+// type Foo by defining either operator<<(::std::ostream&, const Foo&)

+// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that

+// defines Foo.

+

+#include "gtest/gtest-printers.h"

+#include <ctype.h>

+#include <stdio.h>

+#include <ostream>  // NOLINT

+#include <string>

+#include "gtest/internal/gtest-port.h"

+

+namespace testing {

+

+namespace {

+

+using ::std::ostream;

+

+// Prints a segment of bytes in the given object.

+void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,

+                                size_t count, ostream* os) {

+  char text[5] = "";

+  for (size_t i = 0; i != count; i++) {

+    const size_t j = start + i;

+    if (i != 0) {

+      // Organizes the bytes into groups of 2 for easy parsing by

+      // human.

+      if ((j % 2) == 0)

+        *os << ' ';

+      else

+        *os << '-';

+    }

+    GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]);

+    *os << text;

+  }

+}

+

+// Prints the bytes in the given value to the given ostream.

+void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,

+                              ostream* os) {

+  // Tells the user how big the object is.

+  *os << count << "-byte object <";

+

+  const size_t kThreshold = 132;

+  const size_t kChunkSize = 64;

+  // If the object size is bigger than kThreshold, we'll have to omit

+  // some details by printing only the first and the last kChunkSize

+  // bytes.

+  // TODO(wan): let the user control the threshold using a flag.

+  if (count < kThreshold) {

+    PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);

+  } else {

+    PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os);

+    *os << " ... ";

+    // Rounds up to 2-byte boundary.

+    const size_t resume_pos = (count - kChunkSize + 1)/2*2;

+    PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os);

+  }

+  *os << ">";

+}

+

+}  // namespace

+

+namespace internal2 {

+

+// Delegates to PrintBytesInObjectToImpl() to print the bytes in the

+// given object.  The delegation simplifies the implementation, which

+// uses the << operator and thus is easier done outside of the

+// ::testing::internal namespace, which contains a << operator that

+// sometimes conflicts with the one in STL.

+void PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count,

+                          ostream* os) {

+  PrintBytesInObjectToImpl(obj_bytes, count, os);

+}

+

+}  // namespace internal2

+

+namespace internal {

+

+// Depending on the value of a char (or wchar_t), we print it in one

+// of three formats:

+//   - as is if it's a printable ASCII (e.g. 'a', '2', ' '),

+//   - as a hexidecimal escape sequence (e.g. '\x7F'), or

+//   - as a special escape sequence (e.g. '\r', '\n').

+enum CharFormat {

+  kAsIs,

+  kHexEscape,

+  kSpecialEscape

+};

+

+// Returns true if c is a printable ASCII character.  We test the

+// value of c directly instead of calling isprint(), which is buggy on

+// Windows Mobile.

+inline bool IsPrintableAscii(wchar_t c) {

+  return 0x20 <= c && c <= 0x7E;

+}

+

+// Prints a wide or narrow char c as a character literal without the

+// quotes, escaping it when necessary; returns how c was formatted.

+// The template argument UnsignedChar is the unsigned version of Char,

+// which is the type of c.

+template <typename UnsignedChar, typename Char>

+static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {

+  switch (static_cast<wchar_t>(c)) {

+    case L'\0':

+      *os << "\\0";

+      break;

+    case L'\'':

+      *os << "\\'";

+      break;

+    case L'\\':

+      *os << "\\\\";

+      break;

+    case L'\a':

+      *os << "\\a";

+      break;

+    case L'\b':

+      *os << "\\b";

+      break;

+    case L'\f':

+      *os << "\\f";

+      break;

+    case L'\n':

+      *os << "\\n";

+      break;

+    case L'\r':

+      *os << "\\r";

+      break;

+    case L'\t':

+      *os << "\\t";

+      break;

+    case L'\v':

+      *os << "\\v";

+      break;

+    default:

+      if (IsPrintableAscii(c)) {

+        *os << static_cast<char>(c);

+        return kAsIs;

+      } else {

+        *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));

+        return kHexEscape;

+      }

+  }

+  return kSpecialEscape;

+}

+

+// Prints a wchar_t c as if it's part of a string literal, escaping it when

+// necessary; returns how c was formatted.

+static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {

+  switch (c) {

+    case L'\'':

+      *os << "'";

+      return kAsIs;

+    case L'"':

+      *os << "\\\"";

+      return kSpecialEscape;

+    default:

+      return PrintAsCharLiteralTo<wchar_t>(c, os);

+  }

+}

+

+// Prints a char c as if it's part of a string literal, escaping it when

+// necessary; returns how c was formatted.

+static CharFormat PrintAsStringLiteralTo(char c, ostream* os) {

+  return PrintAsStringLiteralTo(

+      static_cast<wchar_t>(static_cast<unsigned char>(c)), os);

+}

+

+// Prints a wide or narrow character c and its code.  '\0' is printed

+// as "'\\0'", other unprintable characters are also properly escaped

+// using the standard C++ escape sequence.  The template argument

+// UnsignedChar is the unsigned version of Char, which is the type of c.

+template <typename UnsignedChar, typename Char>

+void PrintCharAndCodeTo(Char c, ostream* os) {

+  // First, print c as a literal in the most readable form we can find.

+  *os << ((sizeof(c) > 1) ? "L'" : "'");

+  const CharFormat format = PrintAsCharLiteralTo<UnsignedChar>(c, os);

+  *os << "'";

+

+  // To aid user debugging, we also print c's code in decimal, unless

+  // it's 0 (in which case c was printed as '\\0', making the code

+  // obvious).

+  if (c == 0)

+    return;

+  *os << " (" << static_cast<int>(c);

+

+  // For more convenience, we print c's code again in hexidecimal,

+  // unless c was already printed in the form '\x##' or the code is in

+  // [1, 9].

+  if (format == kHexEscape || (1 <= c && c <= 9)) {

+    // Do nothing.

+  } else {

+    *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c));

+  }

+  *os << ")";

+}

+

+void PrintTo(unsigned char c, ::std::ostream* os) {

+  PrintCharAndCodeTo<unsigned char>(c, os);

+}

+void PrintTo(signed char c, ::std::ostream* os) {

+  PrintCharAndCodeTo<unsigned char>(c, os);

+}

+

+// Prints a wchar_t as a symbol if it is printable or as its internal

+// code otherwise and also as its code.  L'\0' is printed as "L'\\0'".

+void PrintTo(wchar_t wc, ostream* os) {

+  PrintCharAndCodeTo<wchar_t>(wc, os);

+}

+

+// Prints the given array of characters to the ostream.  CharType must be either

+// char or wchar_t.

+// The array starts at begin, the length is len, it may include '\0' characters

+// and may not be NUL-terminated.

+template <typename CharType>

+static void PrintCharsAsStringTo(

+    const CharType* begin, size_t len, ostream* os) {

+  const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";

+  *os << kQuoteBegin;

+  bool is_previous_hex = false;

+  for (size_t index = 0; index < len; ++index) {

+    const CharType cur = begin[index];

+    if (is_previous_hex && IsXDigit(cur)) {

+      // Previous character is of '\x..' form and this character can be

+      // interpreted as another hexadecimal digit in its number. Break string to

+      // disambiguate.

+      *os << "\" " << kQuoteBegin;

+    }

+    is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;

+  }

+  *os << "\"";

+}

+

+// Prints a (const) char/wchar_t array of 'len' elements, starting at address

+// 'begin'.  CharType must be either char or wchar_t.

+template <typename CharType>

+static void UniversalPrintCharArray(

+    const CharType* begin, size_t len, ostream* os) {

+  // The code

+  //   const char kFoo[] = "foo";

+  // generates an array of 4, not 3, elements, with the last one being '\0'.

+  //

+  // Therefore when printing a char array, we don't print the last element if

+  // it's '\0', such that the output matches the string literal as it's

+  // written in the source code.

+  if (len > 0 && begin[len - 1] == '\0') {

+    PrintCharsAsStringTo(begin, len - 1, os);

+    return;

+  }

+

+  // If, however, the last element in the array is not '\0', e.g.

+  //    const char kFoo[] = { 'f', 'o', 'o' };

+  // we must print the entire array.  We also print a message to indicate

+  // that the array is not NUL-terminated.

+  PrintCharsAsStringTo(begin, len, os);

+  *os << " (no terminating NUL)";

+}

+

+// Prints a (const) char array of 'len' elements, starting at address 'begin'.

+void UniversalPrintArray(const char* begin, size_t len, ostream* os) {

+  UniversalPrintCharArray(begin, len, os);

+}

+

+// Prints a (const) wchar_t array of 'len' elements, starting at address

+// 'begin'.

+void UniversalPrintArray(const wchar_t* begin, size_t len, ostream* os) {

+  UniversalPrintCharArray(begin, len, os);

+}

+

+// Prints the given C string to the ostream.

+void PrintTo(const char* s, ostream* os) {

+  if (s == NULL) {

+    *os << "NULL";

+  } else {

+    *os << ImplicitCast_<const void*>(s) << " pointing to ";

+    PrintCharsAsStringTo(s, strlen(s), os);

+  }

+}

+

+// MSVC compiler can be configured to define whar_t as a typedef

+// of unsigned short. Defining an overload for const wchar_t* in that case

+// would cause pointers to unsigned shorts be printed as wide strings,

+// possibly accessing more memory than intended and causing invalid

+// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when

+// wchar_t is implemented as a native type.

+#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)

+// Prints the given wide C string to the ostream.

+void PrintTo(const wchar_t* s, ostream* os) {

+  if (s == NULL) {

+    *os << "NULL";

+  } else {

+    *os << ImplicitCast_<const void*>(s) << " pointing to ";

+    PrintCharsAsStringTo(s, wcslen(s), os);

+  }

+}

+#endif  // wchar_t is native

+

+// Prints a ::string object.

+#if GTEST_HAS_GLOBAL_STRING

+void PrintStringTo(const ::string& s, ostream* os) {

+  PrintCharsAsStringTo(s.data(), s.size(), os);

+}

+#endif  // GTEST_HAS_GLOBAL_STRING

+

+void PrintStringTo(const ::std::string& s, ostream* os) {

+  PrintCharsAsStringTo(s.data(), s.size(), os);

+}

+

+// Prints a ::wstring object.

+#if GTEST_HAS_GLOBAL_WSTRING

+void PrintWideStringTo(const ::wstring& s, ostream* os) {

+  PrintCharsAsStringTo(s.data(), s.size(), os);

+}

+#endif  // GTEST_HAS_GLOBAL_WSTRING

+

+#if GTEST_HAS_STD_WSTRING

+void PrintWideStringTo(const ::std::wstring& s, ostream* os) {

+  PrintCharsAsStringTo(s.data(), s.size(), os);

+}

+#endif  // GTEST_HAS_STD_WSTRING

+

+}  // namespace internal

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-test-part.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-test-part.cc
new file mode 100644
index 0000000..c9bf59b
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-test-part.cc
@@ -0,0 +1,110 @@
+// 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: mheule@google.com (Markus Heule)

+//

+// The Google C++ Testing Framework (Google Test)

+

+#include "gtest/gtest-test-part.h"

+

+// Indicates that this translation unit is part of Google Test's

+// implementation.  It must come before gtest-internal-inl.h is

+// included, or there will be a compiler error.  This trick is to

+// prevent a user from accidentally including gtest-internal-inl.h in

+// his code.

+#define GTEST_IMPLEMENTATION_ 1

+#include "src/gtest-internal-inl.h"

+#undef GTEST_IMPLEMENTATION_

+

+namespace testing {

+

+using internal::GetUnitTestImpl;

+

+// Gets the summary of the failure message by omitting the stack trace

+// in it.

+std::string TestPartResult::ExtractSummary(const char* message) {

+  const char* const stack_trace = strstr(message, internal::kStackTraceMarker);

+  return stack_trace == NULL ? message :

+      std::string(message, stack_trace);

+}

+

+// Prints a TestPartResult object.

+std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {

+  return os

+      << result.file_name() << ":" << result.line_number() << ": "

+      << (result.type() == TestPartResult::kSuccess ? "Success" :

+          result.type() == TestPartResult::kFatalFailure ? "Fatal failure" :

+          "Non-fatal failure") << ":\n"

+      << result.message() << std::endl;

+}

+

+// Appends a TestPartResult to the array.

+void TestPartResultArray::Append(const TestPartResult& result) {

+  array_.push_back(result);

+}

+

+// Returns the TestPartResult at the given index (0-based).

+const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {

+  if (index < 0 || index >= size()) {

+    printf("\nInvalid index (%d) into TestPartResultArray.\n", index);

+    internal::posix::Abort();

+  }

+

+  return array_[index];

+}

+

+// Returns the number of TestPartResult objects in the array.

+int TestPartResultArray::size() const {

+  return static_cast<int>(array_.size());

+}

+

+namespace internal {

+

+HasNewFatalFailureHelper::HasNewFatalFailureHelper()

+    : has_new_fatal_failure_(false),

+      original_reporter_(GetUnitTestImpl()->

+                         GetTestPartResultReporterForCurrentThread()) {

+  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);

+}

+

+HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {

+  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(

+      original_reporter_);

+}

+

+void HasNewFatalFailureHelper::ReportTestPartResult(

+    const TestPartResult& result) {

+  if (result.fatally_failed())

+    has_new_fatal_failure_ = true;

+  original_reporter_->ReportTestPartResult(result);

+}

+

+}  // namespace internal

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest-typed-test.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest-typed-test.cc
new file mode 100644
index 0000000..b159d25
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest-typed-test.cc
@@ -0,0 +1,110 @@
+// 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: wan@google.com (Zhanyong Wan)

+

+#include "gtest/gtest-typed-test.h"

+#include "gtest/gtest.h"

+

+namespace testing {

+namespace internal {

+

+#if GTEST_HAS_TYPED_TEST_P

+

+// Skips to the first non-space char in str. Returns an empty string if str

+// contains only whitespace characters.

+static const char* SkipSpaces(const char* str) {

+  while (IsSpace(*str))

+    str++;

+  return str;

+}

+

+// Verifies that registered_tests match the test names in

+// defined_test_names_; returns registered_tests if successful, or

+// aborts the program otherwise.

+const char* TypedTestCasePState::VerifyRegisteredTestNames(

+    const char* file, int line, const char* registered_tests) {

+  typedef ::std::set<const char*>::const_iterator DefinedTestIter;

+  registered_ = true;

+

+  // Skip initial whitespace in registered_tests since some

+  // preprocessors prefix stringizied literals with whitespace.

+  registered_tests = SkipSpaces(registered_tests);

+

+  Message errors;

+  ::std::set<std::string> tests;

+  for (const char* names = registered_tests; names != NULL;

+       names = SkipComma(names)) {

+    const std::string name = GetPrefixUntilComma(names);

+    if (tests.count(name) != 0) {

+      errors << "Test " << name << " is listed more than once.\n";

+      continue;

+    }

+

+    bool found = false;

+    for (DefinedTestIter it = defined_test_names_.begin();

+         it != defined_test_names_.end();

+         ++it) {

+      if (name == *it) {

+        found = true;

+        break;

+      }

+    }

+

+    if (found) {

+      tests.insert(name);

+    } else {

+      errors << "No test named " << name

+             << " can be found in this test case.\n";

+    }

+  }

+

+  for (DefinedTestIter it = defined_test_names_.begin();

+       it != defined_test_names_.end();

+       ++it) {

+    if (tests.count(*it) == 0) {

+      errors << "You forgot to list test " << *it << ".\n";

+    }

+  }

+

+  const std::string& errors_str = errors.GetString();

+  if (errors_str != "") {

+    fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),

+            errors_str.c_str());

+    fflush(stderr);

+    posix::Abort();

+  }

+

+  return registered_tests;

+}

+

+#endif  // GTEST_HAS_TYPED_TEST_P

+

+}  // namespace internal

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest.cc
new file mode 100644
index 0000000..de98cd6
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest.cc
@@ -0,0 +1,5015 @@
+// Copyright 2005, 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)

+//

+// The Google C++ Testing Framework (Google Test)

+

+#include "gtest/gtest.h"

+#include "gtest/gtest-spi.h"

+

+#include <ctype.h>

+#include <math.h>

+#include <stdarg.h>

+#include <stdio.h>

+#include <stdlib.h>

+#include <time.h>

+#include <wchar.h>

+#include <wctype.h>

+

+#include <algorithm>

+#include <iomanip>

+#include <limits>

+#include <ostream>  // NOLINT

+#include <sstream>

+#include <vector>

+

+#if GTEST_OS_LINUX

+

+// TODO(kenton@google.com): Use autoconf to detect availability of

+// gettimeofday().

+# define GTEST_HAS_GETTIMEOFDAY_ 1

+

+# include <fcntl.h>  // NOLINT

+# include <limits.h>  // NOLINT

+# include <sched.h>  // NOLINT

+// Declares vsnprintf().  This header is not available on Windows.

+# include <strings.h>  // NOLINT

+# include <sys/mman.h>  // NOLINT

+# include <sys/time.h>  // NOLINT

+# include <unistd.h>  // NOLINT

+# include <string>

+

+#elif GTEST_OS_SYMBIAN

+# define GTEST_HAS_GETTIMEOFDAY_ 1

+# include <sys/time.h>  // NOLINT

+

+#elif GTEST_OS_ZOS

+# define GTEST_HAS_GETTIMEOFDAY_ 1

+# include <sys/time.h>  // NOLINT

+

+// On z/OS we additionally need strings.h for strcasecmp.

+# include <strings.h>  // NOLINT

+

+#elif GTEST_OS_WINDOWS_MOBILE  // We are on Windows CE.

+

+# include <windows.h>  // NOLINT

+

+#elif GTEST_OS_WINDOWS  // We are on Windows proper.

+

+# include <io.h>  // NOLINT

+# include <sys/timeb.h>  // NOLINT

+# include <sys/types.h>  // NOLINT

+# include <sys/stat.h>  // NOLINT

+

+# if GTEST_OS_WINDOWS_MINGW

+// MinGW has gettimeofday() but not _ftime64().

+// TODO(kenton@google.com): Use autoconf to detect availability of

+//   gettimeofday().

+// TODO(kenton@google.com): There are other ways to get the time on

+//   Windows, like GetTickCount() or GetSystemTimeAsFileTime().  MinGW

+//   supports these.  consider using them instead.

+#  define GTEST_HAS_GETTIMEOFDAY_ 1

+#  include <sys/time.h>  // NOLINT

+# endif  // GTEST_OS_WINDOWS_MINGW

+

+// cpplint thinks that the header is already included, so we want to

+// silence it.

+# include <windows.h>  // NOLINT

+

+#else

+

+// Assume other platforms have gettimeofday().

+// TODO(kenton@google.com): Use autoconf to detect availability of

+//   gettimeofday().

+# define GTEST_HAS_GETTIMEOFDAY_ 1

+

+// cpplint thinks that the header is already included, so we want to

+// silence it.

+# include <sys/time.h>  // NOLINT

+# include <unistd.h>  // NOLINT

+

+#endif  // GTEST_OS_LINUX

+

+#if GTEST_HAS_EXCEPTIONS

+# include <stdexcept>

+#endif

+

+#if GTEST_CAN_STREAM_RESULTS_

+# include <arpa/inet.h>  // NOLINT

+# include <netdb.h>  // NOLINT

+#endif

+

+// Indicates that this translation unit is part of Google Test's

+// implementation.  It must come before gtest-internal-inl.h is

+// included, or there will be a compiler error.  This trick is to

+// prevent a user from accidentally including gtest-internal-inl.h in

+// his code.

+#define GTEST_IMPLEMENTATION_ 1

+#include "src/gtest-internal-inl.h"

+#undef GTEST_IMPLEMENTATION_

+

+#if GTEST_OS_WINDOWS

+# define vsnprintf _vsnprintf

+#endif  // GTEST_OS_WINDOWS

+

+namespace testing {

+

+using internal::CountIf;

+using internal::ForEach;

+using internal::GetElementOr;

+using internal::Shuffle;

+

+// Constants.

+

+// A test whose test case name or test name matches this filter is

+// disabled and not run.

+static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";

+

+// A test case whose name matches this filter is considered a death

+// test case and will be run before test cases whose name doesn't

+// match this filter.

+static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";

+

+// A test filter that matches everything.

+static const char kUniversalFilter[] = "*";

+

+// The default output file for XML output.

+static const char kDefaultOutputFile[] = "test_detail.xml";

+

+// The environment variable name for the test shard index.

+static const char kTestShardIndex[] = "GTEST_SHARD_INDEX";

+// The environment variable name for the total number of test shards.

+static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS";

+// The environment variable name for the test shard status file.

+static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE";

+

+namespace internal {

+

+// The text used in failure messages to indicate the start of the

+// stack trace.

+const char kStackTraceMarker[] = "\nStack trace:\n";

+

+// g_help_flag is true iff the --help flag or an equivalent form is

+// specified on the command line.

+bool g_help_flag = false;

+

+}  // namespace internal

+

+static const char* GetDefaultFilter() {

+  return kUniversalFilter;

+}

+

+GTEST_DEFINE_bool_(

+    also_run_disabled_tests,

+    internal::BoolFromGTestEnv("also_run_disabled_tests", false),

+    "Run disabled tests too, in addition to the tests normally being run.");

+

+GTEST_DEFINE_bool_(

+    break_on_failure,

+    internal::BoolFromGTestEnv("break_on_failure", false),

+    "True iff a failed assertion should be a debugger break-point.");

+

+GTEST_DEFINE_bool_(

+    catch_exceptions,

+    internal::BoolFromGTestEnv("catch_exceptions", true),

+    "True iff " GTEST_NAME_

+    " should catch exceptions and treat them as test failures.");

+

+GTEST_DEFINE_string_(

+    color,

+    internal::StringFromGTestEnv("color", "auto"),

+    "Whether to use colors in the output.  Valid values: yes, no, "

+    "and auto.  'auto' means to use colors if the output is "

+    "being sent to a terminal and the TERM environment variable "

+    "is set to a terminal type that supports colors.");

+

+GTEST_DEFINE_string_(

+    filter,

+    internal::StringFromGTestEnv("filter", GetDefaultFilter()),

+    "A colon-separated list of glob (not regex) patterns "

+    "for filtering the tests to run, optionally followed by a "

+    "'-' and a : separated list of negative patterns (tests to "

+    "exclude).  A test is run if it matches one of the positive "

+    "patterns and does not match any of the negative patterns.");

+

+GTEST_DEFINE_bool_(list_tests, false,

+                   "List all tests without running them.");

+

+GTEST_DEFINE_string_(

+    output,

+    internal::StringFromGTestEnv("output", ""),

+    "A format (currently must be \"xml\"), optionally followed "

+    "by a colon and an output file name or directory. A directory "

+    "is indicated by a trailing pathname separator. "

+    "Examples: \"xml:filename.xml\", \"xml::directoryname/\". "

+    "If a directory is specified, output files will be created "

+    "within that directory, with file-names based on the test "

+    "executable's name and, if necessary, made unique by adding "

+    "digits.");

+

+GTEST_DEFINE_bool_(

+    print_time,

+    internal::BoolFromGTestEnv("print_time", true),

+    "True iff " GTEST_NAME_

+    " should display elapsed time in text output.");

+

+GTEST_DEFINE_int32_(

+    random_seed,

+    internal::Int32FromGTestEnv("random_seed", 0),

+    "Random number seed to use when shuffling test orders.  Must be in range "

+    "[1, 99999], or 0 to use a seed based on the current time.");

+

+GTEST_DEFINE_int32_(

+    repeat,

+    internal::Int32FromGTestEnv("repeat", 1),

+    "How many times to repeat each test.  Specify a negative number "

+    "for repeating forever.  Useful for shaking out flaky tests.");

+

+GTEST_DEFINE_bool_(

+    show_internal_stack_frames, false,

+    "True iff " GTEST_NAME_ " should include internal stack frames when "

+    "printing test failure stack traces.");

+

+GTEST_DEFINE_bool_(

+    shuffle,

+    internal::BoolFromGTestEnv("shuffle", false),

+    "True iff " GTEST_NAME_

+    " should randomize tests' order on every run.");

+

+GTEST_DEFINE_int32_(

+    stack_trace_depth,

+    internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth),

+    "The maximum number of stack frames to print when an "

+    "assertion fails.  The valid range is 0 through 100, inclusive.");

+

+GTEST_DEFINE_string_(

+    stream_result_to,

+    internal::StringFromGTestEnv("stream_result_to", ""),

+    "This flag specifies the host name and the port number on which to stream "

+    "test results. Example: \"localhost:555\". The flag is effective only on "

+    "Linux.");

+

+GTEST_DEFINE_bool_(

+    throw_on_failure,

+    internal::BoolFromGTestEnv("throw_on_failure", false),

+    "When this flag is specified, a failed assertion will throw an exception "

+    "if exceptions are enabled or exit the program with a non-zero code "

+    "otherwise.");

+

+namespace internal {

+

+// Generates a random number from [0, range), using a Linear

+// Congruential Generator (LCG).  Crashes if 'range' is 0 or greater

+// than kMaxRange.

+UInt32 Random::Generate(UInt32 range) {

+  // These constants are the same as are used in glibc's rand(3).

+  state_ = (1103515245U*state_ + 12345U) % kMaxRange;

+

+  GTEST_CHECK_(range > 0)

+      << "Cannot generate a number in the range [0, 0).";

+  GTEST_CHECK_(range <= kMaxRange)

+      << "Generation of a number in [0, " << range << ") was requested, "

+      << "but this can only generate numbers in [0, " << kMaxRange << ").";

+

+  // Converting via modulus introduces a bit of downward bias, but

+  // it's simple, and a linear congruential generator isn't too good

+  // to begin with.

+  return state_ % range;

+}

+

+// GTestIsInitialized() returns true iff the user has initialized

+// Google Test.  Useful for catching the user mistake of not initializing

+// Google Test before calling RUN_ALL_TESTS().

+//

+// A user must call testing::InitGoogleTest() to initialize Google

+// Test.  g_init_gtest_count is set to the number of times

+// InitGoogleTest() has been called.  We don't protect this variable

+// under a mutex as it is only accessed in the main thread.

+GTEST_API_ int g_init_gtest_count = 0;

+static bool GTestIsInitialized() { return g_init_gtest_count != 0; }

+

+// Iterates over a vector of TestCases, keeping a running sum of the

+// results of calling a given int-returning method on each.

+// Returns the sum.

+static int SumOverTestCaseList(const std::vector<TestCase*>& case_list,

+                               int (TestCase::*method)() const) {

+  int sum = 0;

+  for (size_t i = 0; i < case_list.size(); i++) {

+    sum += (case_list[i]->*method)();

+  }

+  return sum;

+}

+

+// Returns true iff the test case passed.

+static bool TestCasePassed(const TestCase* test_case) {

+  return test_case->should_run() && test_case->Passed();

+}

+

+// Returns true iff the test case failed.

+static bool TestCaseFailed(const TestCase* test_case) {

+  return test_case->should_run() && test_case->Failed();

+}

+

+// Returns true iff test_case contains at least one test that should

+// run.

+static bool ShouldRunTestCase(const TestCase* test_case) {

+  return test_case->should_run();

+}

+

+// AssertHelper constructor.

+AssertHelper::AssertHelper(TestPartResult::Type type,

+                           const char* file,

+                           int line,

+                           const char* message)

+    : data_(new AssertHelperData(type, file, line, message)) {

+}

+

+AssertHelper::~AssertHelper() {

+  delete data_;

+}

+

+// Message assignment, for assertion streaming support.

+void AssertHelper::operator=(const Message& message) const {

+  UnitTest::GetInstance()->

+    AddTestPartResult(data_->type, data_->file, data_->line,

+                      AppendUserMessage(data_->message, message),

+                      UnitTest::GetInstance()->impl()

+                      ->CurrentOsStackTraceExceptTop(1)

+                      // Skips the stack frame for this function itself.

+                      );  // NOLINT

+}

+

+// Mutex for linked pointers.

+GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);

+

+// Application pathname gotten in InitGoogleTest.

+std::string g_executable_path;

+

+// Returns the current application's name, removing directory path if that

+// is present.

+FilePath GetCurrentExecutableName() {

+  FilePath result;

+

+#if GTEST_OS_WINDOWS

+  result.Set(FilePath(g_executable_path).RemoveExtension("exe"));

+#else

+  result.Set(FilePath(g_executable_path));

+#endif  // GTEST_OS_WINDOWS

+

+  return result.RemoveDirectoryName();

+}

+

+// Functions for processing the gtest_output flag.

+

+// Returns the output format, or "" for normal printed output.

+std::string UnitTestOptions::GetOutputFormat() {

+  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();

+  if (gtest_output_flag == NULL) return std::string("");

+

+  const char* const colon = strchr(gtest_output_flag, ':');

+  return (colon == NULL) ?

+      std::string(gtest_output_flag) :

+      std::string(gtest_output_flag, colon - gtest_output_flag);

+}

+

+// Returns the name of the requested output file, or the default if none

+// was explicitly specified.

+std::string UnitTestOptions::GetAbsolutePathToOutputFile() {

+  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();

+  if (gtest_output_flag == NULL)

+    return "";

+

+  const char* const colon = strchr(gtest_output_flag, ':');

+  if (colon == NULL)

+    return internal::FilePath::ConcatPaths(

+        internal::FilePath(

+            UnitTest::GetInstance()->original_working_dir()),

+        internal::FilePath(kDefaultOutputFile)).string();

+

+  internal::FilePath output_name(colon + 1);

+  if (!output_name.IsAbsolutePath())

+    // TODO(wan@google.com): on Windows \some\path is not an absolute

+    // path (as its meaning depends on the current drive), yet the

+    // following logic for turning it into an absolute path is wrong.

+    // Fix it.

+    output_name = internal::FilePath::ConcatPaths(

+        internal::FilePath(UnitTest::GetInstance()->original_working_dir()),

+        internal::FilePath(colon + 1));

+

+  if (!output_name.IsDirectory())

+    return output_name.string();

+

+  internal::FilePath result(internal::FilePath::GenerateUniqueFileName(

+      output_name, internal::GetCurrentExecutableName(),

+      GetOutputFormat().c_str()));

+  return result.string();

+}

+

+// Returns true iff the wildcard pattern matches the string.  The

+// first ':' or '\0' character in pattern marks the end of it.

+//

+// This recursive algorithm isn't very efficient, but is clear and

+// works well enough for matching test names, which are short.

+bool UnitTestOptions::PatternMatchesString(const char *pattern,

+                                           const char *str) {

+  switch (*pattern) {

+    case '\0':

+    case ':':  // Either ':' or '\0' marks the end of the pattern.

+      return *str == '\0';

+    case '?':  // Matches any single character.

+      return *str != '\0' && PatternMatchesString(pattern + 1, str + 1);

+    case '*':  // Matches any string (possibly empty) of characters.

+      return (*str != '\0' && PatternMatchesString(pattern, str + 1)) ||

+          PatternMatchesString(pattern + 1, str);

+    default:  // Non-special character.  Matches itself.

+      return *pattern == *str &&

+          PatternMatchesString(pattern + 1, str + 1);

+  }

+}

+

+bool UnitTestOptions::MatchesFilter(

+    const std::string& name, const char* filter) {

+  const char *cur_pattern = filter;

+  for (;;) {

+    if (PatternMatchesString(cur_pattern, name.c_str())) {

+      return true;

+    }

+

+    // Finds the next pattern in the filter.

+    cur_pattern = strchr(cur_pattern, ':');

+

+    // Returns if no more pattern can be found.

+    if (cur_pattern == NULL) {

+      return false;

+    }

+

+    // Skips the pattern separater (the ':' character).

+    cur_pattern++;

+  }

+}

+

+// Returns true iff the user-specified filter matches the test case

+// name and the test name.

+bool UnitTestOptions::FilterMatchesTest(const std::string &test_case_name,

+                                        const std::string &test_name) {

+  const std::string& full_name = test_case_name + "." + test_name.c_str();

+

+  // Split --gtest_filter at '-', if there is one, to separate into

+  // positive filter and negative filter portions

+  const char* const p = GTEST_FLAG(filter).c_str();

+  const char* const dash = strchr(p, '-');

+  std::string positive;

+  std::string negative;

+  if (dash == NULL) {

+    positive = GTEST_FLAG(filter).c_str();  // Whole string is a positive filter

+    negative = "";

+  } else {

+    positive = std::string(p, dash);   // Everything up to the dash

+    negative = std::string(dash + 1);  // Everything after the dash

+    if (positive.empty()) {

+      // Treat '-test1' as the same as '*-test1'

+      positive = kUniversalFilter;

+    }

+  }

+

+  // A filter is a colon-separated list of patterns.  It matches a

+  // test if any pattern in it matches the test.

+  return (MatchesFilter(full_name, positive.c_str()) &&

+          !MatchesFilter(full_name, negative.c_str()));

+}

+

+#if GTEST_HAS_SEH

+// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the

+// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.

+// This function is useful as an __except condition.

+int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {

+  // Google Test should handle a SEH exception if:

+  //   1. the user wants it to, AND

+  //   2. this is not a breakpoint exception, AND

+  //   3. this is not a C++ exception (VC++ implements them via SEH,

+  //      apparently).

+  //

+  // SEH exception code for C++ exceptions.

+  // (see http://support.microsoft.com/kb/185294 for more information).

+  const DWORD kCxxExceptionCode = 0xe06d7363;

+

+  bool should_handle = true;

+

+  if (!GTEST_FLAG(catch_exceptions))

+    should_handle = false;

+  else if (exception_code == EXCEPTION_BREAKPOINT)

+    should_handle = false;

+  else if (exception_code == kCxxExceptionCode)

+    should_handle = false;

+

+  return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;

+}

+#endif  // GTEST_HAS_SEH

+

+}  // namespace internal

+

+// The c'tor sets this object as the test part result reporter used by

+// Google Test.  The 'result' parameter specifies where to report the

+// results. Intercepts only failures from the current thread.

+ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(

+    TestPartResultArray* result)

+    : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),

+      result_(result) {

+  Init();

+}

+

+// The c'tor sets this object as the test part result reporter used by

+// Google Test.  The 'result' parameter specifies where to report the

+// results.

+ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(

+    InterceptMode intercept_mode, TestPartResultArray* result)

+    : intercept_mode_(intercept_mode),

+      result_(result) {

+  Init();

+}

+

+void ScopedFakeTestPartResultReporter::Init() {

+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();

+  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {

+    old_reporter_ = impl->GetGlobalTestPartResultReporter();

+    impl->SetGlobalTestPartResultReporter(this);

+  } else {

+    old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();

+    impl->SetTestPartResultReporterForCurrentThread(this);

+  }

+}

+

+// The d'tor restores the test part result reporter used by Google Test

+// before.

+ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {

+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();

+  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {

+    impl->SetGlobalTestPartResultReporter(old_reporter_);

+  } else {

+    impl->SetTestPartResultReporterForCurrentThread(old_reporter_);

+  }

+}

+

+// Increments the test part result count and remembers the result.

+// This method is from the TestPartResultReporterInterface interface.

+void ScopedFakeTestPartResultReporter::ReportTestPartResult(

+    const TestPartResult& result) {

+  result_->Append(result);

+}

+

+namespace internal {

+

+// Returns the type ID of ::testing::Test.  We should always call this

+// instead of GetTypeId< ::testing::Test>() to get the type ID of

+// testing::Test.  This is to work around a suspected linker bug when

+// using Google Test as a framework on Mac OS X.  The bug causes

+// GetTypeId< ::testing::Test>() to return different values depending

+// on whether the call is from the Google Test framework itself or

+// from user test code.  GetTestTypeId() is guaranteed to always

+// return the same value, as it always calls GetTypeId<>() from the

+// gtest.cc, which is within the Google Test framework.

+TypeId GetTestTypeId() {

+  return GetTypeId<Test>();

+}

+

+// The value of GetTestTypeId() as seen from within the Google Test

+// library.  This is solely for testing GetTestTypeId().

+extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();

+

+// This predicate-formatter checks that 'results' contains a test part

+// failure of the given type and that the failure message contains the

+// given substring.

+AssertionResult HasOneFailure(const char* /* results_expr */,

+                              const char* /* type_expr */,

+                              const char* /* substr_expr */,

+                              const TestPartResultArray& results,

+                              TestPartResult::Type type,

+                              const string& substr) {

+  const std::string expected(type == TestPartResult::kFatalFailure ?

+                        "1 fatal failure" :

+                        "1 non-fatal failure");

+  Message msg;

+  if (results.size() != 1) {

+    msg << "Expected: " << expected << "\n"

+        << "  Actual: " << results.size() << " failures";

+    for (int i = 0; i < results.size(); i++) {

+      msg << "\n" << results.GetTestPartResult(i);

+    }

+    return AssertionFailure() << msg;

+  }

+

+  const TestPartResult& r = results.GetTestPartResult(0);

+  if (r.type() != type) {

+    return AssertionFailure() << "Expected: " << expected << "\n"

+                              << "  Actual:\n"

+                              << r;

+  }

+

+  if (strstr(r.message(), substr.c_str()) == NULL) {

+    return AssertionFailure() << "Expected: " << expected << " containing \""

+                              << substr << "\"\n"

+                              << "  Actual:\n"

+                              << r;

+  }

+

+  return AssertionSuccess();

+}

+

+// The constructor of SingleFailureChecker remembers where to look up

+// test part results, what type of failure we expect, and what

+// substring the failure message should contain.

+SingleFailureChecker:: SingleFailureChecker(

+    const TestPartResultArray* results,

+    TestPartResult::Type type,

+    const string& substr)

+    : results_(results),

+      type_(type),

+      substr_(substr) {}

+

+// The destructor of SingleFailureChecker verifies that the given

+// TestPartResultArray contains exactly one failure that has the given

+// type and contains the given substring.  If that's not the case, a

+// non-fatal failure will be generated.

+SingleFailureChecker::~SingleFailureChecker() {

+  EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);

+}

+

+DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(

+    UnitTestImpl* unit_test) : unit_test_(unit_test) {}

+

+void DefaultGlobalTestPartResultReporter::ReportTestPartResult(

+    const TestPartResult& result) {

+  unit_test_->current_test_result()->AddTestPartResult(result);

+  unit_test_->listeners()->repeater()->OnTestPartResult(result);

+}

+

+DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(

+    UnitTestImpl* unit_test) : unit_test_(unit_test) {}

+

+void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(

+    const TestPartResult& result) {

+  unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);

+}

+

+// Returns the global test part result reporter.

+TestPartResultReporterInterface*

+UnitTestImpl::GetGlobalTestPartResultReporter() {

+  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);

+  return global_test_part_result_repoter_;

+}

+

+// Sets the global test part result reporter.

+void UnitTestImpl::SetGlobalTestPartResultReporter(

+    TestPartResultReporterInterface* reporter) {

+  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);

+  global_test_part_result_repoter_ = reporter;

+}

+

+// Returns the test part result reporter for the current thread.

+TestPartResultReporterInterface*

+UnitTestImpl::GetTestPartResultReporterForCurrentThread() {

+  return per_thread_test_part_result_reporter_.get();

+}

+

+// Sets the test part result reporter for the current thread.

+void UnitTestImpl::SetTestPartResultReporterForCurrentThread(

+    TestPartResultReporterInterface* reporter) {

+  per_thread_test_part_result_reporter_.set(reporter);

+}

+

+// Gets the number of successful test cases.

+int UnitTestImpl::successful_test_case_count() const {

+  return CountIf(test_cases_, TestCasePassed);

+}

+

+// Gets the number of failed test cases.

+int UnitTestImpl::failed_test_case_count() const {

+  return CountIf(test_cases_, TestCaseFailed);

+}

+

+// Gets the number of all test cases.

+int UnitTestImpl::total_test_case_count() const {

+  return static_cast<int>(test_cases_.size());

+}

+

+// Gets the number of all test cases that contain at least one test

+// that should run.

+int UnitTestImpl::test_case_to_run_count() const {

+  return CountIf(test_cases_, ShouldRunTestCase);

+}

+

+// Gets the number of successful tests.

+int UnitTestImpl::successful_test_count() const {

+  return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);

+}

+

+// Gets the number of failed tests.

+int UnitTestImpl::failed_test_count() const {

+  return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);

+}

+

+// Gets the number of disabled tests that will be reported in the XML report.

+int UnitTestImpl::reportable_disabled_test_count() const {

+  return SumOverTestCaseList(test_cases_,

+                             &TestCase::reportable_disabled_test_count);

+}

+

+// Gets the number of disabled tests.

+int UnitTestImpl::disabled_test_count() const {

+  return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);

+}

+

+// Gets the number of tests to be printed in the XML report.

+int UnitTestImpl::reportable_test_count() const {

+  return SumOverTestCaseList(test_cases_, &TestCase::reportable_test_count);

+}

+

+// Gets the number of all tests.

+int UnitTestImpl::total_test_count() const {

+  return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);

+}

+

+// Gets the number of tests that should run.

+int UnitTestImpl::test_to_run_count() const {

+  return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);

+}

+

+// Returns the current OS stack trace as an std::string.

+//

+// The maximum number of stack frames to be included is specified by

+// the gtest_stack_trace_depth flag.  The skip_count parameter

+// specifies the number of top frames to be skipped, which doesn't

+// count against the number of frames to be included.

+//

+// For example, if Foo() calls Bar(), which in turn calls

+// CurrentOsStackTraceExceptTop(1), Foo() will be included in the

+// trace but Bar() and CurrentOsStackTraceExceptTop() won't.

+std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {

+  (void)skip_count;

+  return "";

+}

+

+// Returns the current time in milliseconds.

+TimeInMillis GetTimeInMillis() {

+#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)

+  // Difference between 1970-01-01 and 1601-01-01 in milliseconds.

+  // http://analogous.blogspot.com/2005/04/epoch.html

+  const TimeInMillis kJavaEpochToWinFileTimeDelta =

+    static_cast<TimeInMillis>(116444736UL) * 100000UL;

+  const DWORD kTenthMicrosInMilliSecond = 10000;

+

+  SYSTEMTIME now_systime;

+  FILETIME now_filetime;

+  ULARGE_INTEGER now_int64;

+  // TODO(kenton@google.com): Shouldn't this just use

+  //   GetSystemTimeAsFileTime()?

+  GetSystemTime(&now_systime);

+  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {

+    now_int64.LowPart = now_filetime.dwLowDateTime;

+    now_int64.HighPart = now_filetime.dwHighDateTime;

+    now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -

+      kJavaEpochToWinFileTimeDelta;

+    return now_int64.QuadPart;

+  }

+  return 0;

+#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_

+  __timeb64 now;

+

+# ifdef _MSC_VER

+

+  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996

+  // (deprecated function) there.

+  // TODO(kenton@google.com): Use GetTickCount()?  Or use

+  //   SystemTimeToFileTime()

+#  pragma warning(push)          // Saves the current warning state.

+#  pragma warning(disable:4996)  // Temporarily disables warning 4996.

+  _ftime64(&now);

+#  pragma warning(pop)           // Restores the warning state.

+# else

+

+  _ftime64(&now);

+

+# endif  // _MSC_VER

+

+  return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;

+#elif GTEST_HAS_GETTIMEOFDAY_

+  struct timeval now;

+  gettimeofday(&now, NULL);

+  return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;

+#else

+# error "Don't know how to get the current time on your system."

+#endif

+}

+

+// Utilities

+

+// class String.

+

+#if GTEST_OS_WINDOWS_MOBILE

+// Creates a UTF-16 wide string from the given ANSI string, allocating

+// memory using new. The caller is responsible for deleting the return

+// value using delete[]. Returns the wide string, or NULL if the

+// input is NULL.

+LPCWSTR String::AnsiToUtf16(const char* ansi) {

+  if (!ansi) return NULL;

+  const int length = strlen(ansi);

+  const int unicode_length =

+      MultiByteToWideChar(CP_ACP, 0, ansi, length,

+                          NULL, 0);

+  WCHAR* unicode = new WCHAR[unicode_length + 1];

+  MultiByteToWideChar(CP_ACP, 0, ansi, length,

+                      unicode, unicode_length);

+  unicode[unicode_length] = 0;

+  return unicode;

+}

+

+// Creates an ANSI string from the given wide string, allocating

+// memory using new. The caller is responsible for deleting the return

+// value using delete[]. Returns the ANSI string, or NULL if the

+// input is NULL.

+const char* String::Utf16ToAnsi(LPCWSTR utf16_str)  {

+  if (!utf16_str) return NULL;

+  const int ansi_length =

+      WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,

+                          NULL, 0, NULL, NULL);

+  char* ansi = new char[ansi_length + 1];

+  WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,

+                      ansi, ansi_length, NULL, NULL);

+  ansi[ansi_length] = 0;

+  return ansi;

+}

+

+#endif  // GTEST_OS_WINDOWS_MOBILE

+

+// Compares two C strings.  Returns true iff they have the same content.

+//

+// Unlike strcmp(), this function can handle NULL argument(s).  A NULL

+// C string is considered different to any non-NULL C string,

+// including the empty string.

+bool String::CStringEquals(const char * lhs, const char * rhs) {

+  if ( lhs == NULL ) return rhs == NULL;

+

+  if ( rhs == NULL ) return false;

+

+  return strcmp(lhs, rhs) == 0;

+}

+

+#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING

+

+// Converts an array of wide chars to a narrow string using the UTF-8

+// encoding, and streams the result to the given Message object.

+static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,

+                                     Message* msg) {

+  for (size_t i = 0; i != length; ) {  // NOLINT

+    if (wstr[i] != L'\0') {

+      *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));

+      while (i != length && wstr[i] != L'\0')

+        i++;

+    } else {

+      *msg << '\0';

+      i++;

+    }

+  }

+}

+

+#endif  // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING

+

+}  // namespace internal

+

+// Constructs an empty Message.

+// We allocate the stringstream separately because otherwise each use of

+// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's

+// stack frame leading to huge stack frames in some cases; gcc does not reuse

+// the stack space.

+Message::Message() : ss_(new ::std::stringstream) {

+  // By default, we want there to be enough precision when printing

+  // a double to a Message.

+  *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);

+}

+

+// These two overloads allow streaming a wide C string to a Message

+// using the UTF-8 encoding.

+Message& Message::operator <<(const wchar_t* wide_c_str) {

+  return *this << internal::String::ShowWideCString(wide_c_str);

+}

+Message& Message::operator <<(wchar_t* wide_c_str) {

+  return *this << internal::String::ShowWideCString(wide_c_str);

+}

+

+#if GTEST_HAS_STD_WSTRING

+// Converts the given wide string to a narrow string using the UTF-8

+// encoding, and streams the result to this Message object.

+Message& Message::operator <<(const ::std::wstring& wstr) {

+  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);

+  return *this;

+}

+#endif  // GTEST_HAS_STD_WSTRING

+

+#if GTEST_HAS_GLOBAL_WSTRING

+// Converts the given wide string to a narrow string using the UTF-8

+// encoding, and streams the result to this Message object.

+Message& Message::operator <<(const ::wstring& wstr) {

+  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);

+  return *this;

+}

+#endif  // GTEST_HAS_GLOBAL_WSTRING

+

+// Gets the text streamed to this object so far as an std::string.

+// Each '\0' character in the buffer is replaced with "\\0".

+std::string Message::GetString() const {

+  return internal::StringStreamToString(ss_.get());

+}

+

+// AssertionResult constructors.

+// Used in EXPECT_TRUE/FALSE(assertion_result).

+AssertionResult::AssertionResult(const AssertionResult& other)

+    : success_(other.success_),

+      message_(other.message_.get() != NULL ?

+               new ::std::string(*other.message_) :

+               static_cast< ::std::string*>(NULL)) {

+}

+

+// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.

+AssertionResult AssertionResult::operator!() const {

+  AssertionResult negation(!success_);

+  if (message_.get() != NULL)

+    negation << *message_;

+  return negation;

+}

+

+// Makes a successful assertion result.

+AssertionResult AssertionSuccess() {

+  return AssertionResult(true);

+}

+

+// Makes a failed assertion result.

+AssertionResult AssertionFailure() {

+  return AssertionResult(false);

+}

+

+// Makes a failed assertion result with the given failure message.

+// Deprecated; use AssertionFailure() << message.

+AssertionResult AssertionFailure(const Message& message) {

+  return AssertionFailure() << message;

+}

+

+namespace internal {

+

+// Constructs and returns the message for an equality assertion

+// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.

+//

+// The first four parameters are the expressions used in the assertion

+// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)

+// where foo is 5 and bar is 6, we have:

+//

+//   expected_expression: "foo"

+//   actual_expression:   "bar"

+//   expected_value:      "5"

+//   actual_value:        "6"

+//

+// The ignoring_case parameter is true iff the assertion is a

+// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will

+// be inserted into the message.

+AssertionResult EqFailure(const char* expected_expression,

+                          const char* actual_expression,

+                          const std::string& expected_value,

+                          const std::string& actual_value,

+                          bool ignoring_case) {

+  Message msg;

+  msg << "Value of: " << actual_expression;

+  if (actual_value != actual_expression) {

+    msg << "\n  Actual: " << actual_value;

+  }

+

+  msg << "\nExpected: " << expected_expression;

+  if (ignoring_case) {

+    msg << " (ignoring case)";

+  }

+  if (expected_value != expected_expression) {

+    msg << "\nWhich is: " << expected_value;

+  }

+

+  return AssertionFailure() << msg;

+}

+

+// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.

+std::string GetBoolAssertionFailureMessage(

+    const AssertionResult& assertion_result,

+    const char* expression_text,

+    const char* actual_predicate_value,

+    const char* expected_predicate_value) {

+  const char* actual_message = assertion_result.message();

+  Message msg;

+  msg << "Value of: " << expression_text

+      << "\n  Actual: " << actual_predicate_value;

+  if (actual_message[0] != '\0')

+    msg << " (" << actual_message << ")";

+  msg << "\nExpected: " << expected_predicate_value;

+  return msg.GetString();

+}

+

+// Helper function for implementing ASSERT_NEAR.

+AssertionResult DoubleNearPredFormat(const char* expr1,

+                                     const char* expr2,

+                                     const char* abs_error_expr,

+                                     double val1,

+                                     double val2,

+                                     double abs_error) {

+  const double diff = fabs(val1 - val2);

+  if (diff <= abs_error) return AssertionSuccess();

+

+  // TODO(wan): do not print the value of an expression if it's

+  // already a literal.

+  return AssertionFailure()

+      << "The difference between " << expr1 << " and " << expr2

+      << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"

+      << expr1 << " evaluates to " << val1 << ",\n"

+      << expr2 << " evaluates to " << val2 << ", and\n"

+      << abs_error_expr << " evaluates to " << abs_error << ".";

+}

+

+

+// Helper template for implementing FloatLE() and DoubleLE().

+template <typename RawType>

+AssertionResult FloatingPointLE(const char* expr1,

+                                const char* expr2,

+                                RawType val1,

+                                RawType val2) {

+  // Returns success if val1 is less than val2,

+  if (val1 < val2) {

+    return AssertionSuccess();

+  }

+

+  // or if val1 is almost equal to val2.

+  const FloatingPoint<RawType> lhs(val1), rhs(val2);

+  if (lhs.AlmostEquals(rhs)) {

+    return AssertionSuccess();

+  }

+

+  // Note that the above two checks will both fail if either val1 or

+  // val2 is NaN, as the IEEE floating-point standard requires that

+  // any predicate involving a NaN must return false.

+

+  ::std::stringstream val1_ss;

+  val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)

+          << val1;

+

+  ::std::stringstream val2_ss;

+  val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)

+          << val2;

+

+  return AssertionFailure()

+      << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"

+      << "  Actual: " << StringStreamToString(&val1_ss) << " vs "

+      << StringStreamToString(&val2_ss);

+}

+

+}  // namespace internal

+

+// Asserts that val1 is less than, or almost equal to, val2.  Fails

+// otherwise.  In particular, it fails if either val1 or val2 is NaN.

+AssertionResult FloatLE(const char* expr1, const char* expr2,

+                        float val1, float val2) {

+  return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);

+}

+

+// Asserts that val1 is less than, or almost equal to, val2.  Fails

+// otherwise.  In particular, it fails if either val1 or val2 is NaN.

+AssertionResult DoubleLE(const char* expr1, const char* expr2,

+                         double val1, double val2) {

+  return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);

+}

+

+namespace internal {

+

+// The helper function for {ASSERT|EXPECT}_EQ with int or enum

+// arguments.

+AssertionResult CmpHelperEQ(const char* expected_expression,

+                            const char* actual_expression,

+                            BiggestInt expected,

+                            BiggestInt actual) {

+  if (expected == actual) {

+    return AssertionSuccess();

+  }

+

+  return EqFailure(expected_expression,

+                   actual_expression,

+                   FormatForComparisonFailureMessage(expected, actual),

+                   FormatForComparisonFailureMessage(actual, expected),

+                   false);

+}

+

+// A macro for implementing the helper functions needed to implement

+// ASSERT_?? and EXPECT_?? with integer or enum arguments.  It is here

+// just to avoid copy-and-paste of similar code.

+#define GTEST_IMPL_CMP_HELPER_(op_name, op)\

+AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \

+                                   BiggestInt val1, BiggestInt val2) {\

+  if (val1 op val2) {\

+    return AssertionSuccess();\

+  } else {\

+    return AssertionFailure() \

+        << "Expected: (" << expr1 << ") " #op " (" << expr2\

+        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\

+        << " vs " << FormatForComparisonFailureMessage(val2, val1);\

+  }\

+}

+

+// Implements the helper function for {ASSERT|EXPECT}_NE with int or

+// enum arguments.

+GTEST_IMPL_CMP_HELPER_(NE, !=)

+// Implements the helper function for {ASSERT|EXPECT}_LE with int or

+// enum arguments.

+GTEST_IMPL_CMP_HELPER_(LE, <=)

+// Implements the helper function for {ASSERT|EXPECT}_LT with int or

+// enum arguments.

+GTEST_IMPL_CMP_HELPER_(LT, < )

+// Implements the helper function for {ASSERT|EXPECT}_GE with int or

+// enum arguments.

+GTEST_IMPL_CMP_HELPER_(GE, >=)

+// Implements the helper function for {ASSERT|EXPECT}_GT with int or

+// enum arguments.

+GTEST_IMPL_CMP_HELPER_(GT, > )

+

+#undef GTEST_IMPL_CMP_HELPER_

+

+// The helper function for {ASSERT|EXPECT}_STREQ.

+AssertionResult CmpHelperSTREQ(const char* expected_expression,

+                               const char* actual_expression,

+                               const char* expected,

+                               const char* actual) {

+  if (String::CStringEquals(expected, actual)) {

+    return AssertionSuccess();

+  }

+

+  return EqFailure(expected_expression,

+                   actual_expression,

+                   PrintToString(expected),

+                   PrintToString(actual),

+                   false);

+}

+

+// The helper function for {ASSERT|EXPECT}_STRCASEEQ.

+AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,

+                                   const char* actual_expression,

+                                   const char* expected,

+                                   const char* actual) {

+  if (String::CaseInsensitiveCStringEquals(expected, actual)) {

+    return AssertionSuccess();

+  }

+

+  return EqFailure(expected_expression,

+                   actual_expression,

+                   PrintToString(expected),

+                   PrintToString(actual),

+                   true);

+}

+

+// The helper function for {ASSERT|EXPECT}_STRNE.

+AssertionResult CmpHelperSTRNE(const char* s1_expression,

+                               const char* s2_expression,

+                               const char* s1,

+                               const char* s2) {

+  if (!String::CStringEquals(s1, s2)) {

+    return AssertionSuccess();

+  } else {

+    return AssertionFailure() << "Expected: (" << s1_expression << ") != ("

+                              << s2_expression << "), actual: \""

+                              << s1 << "\" vs \"" << s2 << "\"";

+  }

+}

+

+// The helper function for {ASSERT|EXPECT}_STRCASENE.

+AssertionResult CmpHelperSTRCASENE(const char* s1_expression,

+                                   const char* s2_expression,

+                                   const char* s1,

+                                   const char* s2) {

+  if (!String::CaseInsensitiveCStringEquals(s1, s2)) {

+    return AssertionSuccess();

+  } else {

+    return AssertionFailure()

+        << "Expected: (" << s1_expression << ") != ("

+        << s2_expression << ") (ignoring case), actual: \""

+        << s1 << "\" vs \"" << s2 << "\"";

+  }

+}

+

+}  // namespace internal

+

+namespace {

+

+// Helper functions for implementing IsSubString() and IsNotSubstring().

+

+// This group of overloaded functions return true iff needle is a

+// substring of haystack.  NULL is considered a substring of itself

+// only.

+

+bool IsSubstringPred(const char* needle, const char* haystack) {

+  if (needle == NULL || haystack == NULL)

+    return needle == haystack;

+

+  return strstr(haystack, needle) != NULL;

+}

+

+bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {

+  if (needle == NULL || haystack == NULL)

+    return needle == haystack;

+

+  return wcsstr(haystack, needle) != NULL;

+}

+

+// StringType here can be either ::std::string or ::std::wstring.

+template <typename StringType>

+bool IsSubstringPred(const StringType& needle,

+                     const StringType& haystack) {

+  return haystack.find(needle) != StringType::npos;

+}

+

+// This function implements either IsSubstring() or IsNotSubstring(),

+// depending on the value of the expected_to_be_substring parameter.

+// StringType here can be const char*, const wchar_t*, ::std::string,

+// or ::std::wstring.

+template <typename StringType>

+AssertionResult IsSubstringImpl(

+    bool expected_to_be_substring,

+    const char* needle_expr, const char* haystack_expr,

+    const StringType& needle, const StringType& haystack) {

+  if (IsSubstringPred(needle, haystack) == expected_to_be_substring)

+    return AssertionSuccess();

+

+  const bool is_wide_string = sizeof(needle[0]) > 1;

+  const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";

+  return AssertionFailure()

+      << "Value of: " << needle_expr << "\n"

+      << "  Actual: " << begin_string_quote << needle << "\"\n"

+      << "Expected: " << (expected_to_be_substring ? "" : "not ")

+      << "a substring of " << haystack_expr << "\n"

+      << "Which is: " << begin_string_quote << haystack << "\"";

+}

+

+}  // namespace

+

+// IsSubstring() and IsNotSubstring() check whether needle is a

+// substring of haystack (NULL is considered a substring of itself

+// only), and return an appropriate error message when they fail.

+

+AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const char* needle, const char* haystack) {

+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);

+}

+

+AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const wchar_t* needle, const wchar_t* haystack) {

+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);

+}

+

+AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const char* needle, const char* haystack) {

+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);

+}

+

+AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const wchar_t* needle, const wchar_t* haystack) {

+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);

+}

+

+AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::string& needle, const ::std::string& haystack) {

+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);

+}

+

+AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::string& needle, const ::std::string& haystack) {

+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);

+}

+

+#if GTEST_HAS_STD_WSTRING

+AssertionResult IsSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::wstring& needle, const ::std::wstring& haystack) {

+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);

+}

+

+AssertionResult IsNotSubstring(

+    const char* needle_expr, const char* haystack_expr,

+    const ::std::wstring& needle, const ::std::wstring& haystack) {

+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);

+}

+#endif  // GTEST_HAS_STD_WSTRING

+

+namespace internal {

+

+#if GTEST_OS_WINDOWS

+

+namespace {

+

+// Helper function for IsHRESULT{SuccessFailure} predicates

+AssertionResult HRESULTFailureHelper(const char* expr,

+                                     const char* expected,

+                                     long hr) {  // NOLINT

+# if GTEST_OS_WINDOWS_MOBILE

+

+  // Windows CE doesn't support FormatMessage.

+  const char error_text[] = "";

+

+# else

+

+  // Looks up the human-readable system message for the HRESULT code

+  // and since we're not passing any params to FormatMessage, we don't

+  // want inserts expanded.

+  const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |

+                       FORMAT_MESSAGE_IGNORE_INSERTS;

+  const DWORD kBufSize = 4096;

+  // Gets the system's human readable message string for this HRESULT.

+  char error_text[kBufSize] = { '\0' };

+  DWORD message_length = ::FormatMessageA(kFlags,

+                                          0,  // no source, we're asking system

+                                          hr,  // the error

+                                          0,  // no line width restrictions

+                                          error_text,  // output buffer

+                                          kBufSize,  // buf size

+                                          NULL);  // no arguments for inserts

+  // Trims tailing white space (FormatMessage leaves a trailing CR-LF)

+  for (; message_length && IsSpace(error_text[message_length - 1]);

+          --message_length) {

+    error_text[message_length - 1] = '\0';

+  }

+

+# endif  // GTEST_OS_WINDOWS_MOBILE

+

+  const std::string error_hex("0x" + String::FormatHexInt(hr));

+  return ::testing::AssertionFailure()

+      << "Expected: " << expr << " " << expected << ".\n"

+      << "  Actual: " << error_hex << " " << error_text << "\n";

+}

+

+}  // namespace

+

+AssertionResult IsHRESULTSuccess(const char* expr, long hr) {  // NOLINT

+  if (SUCCEEDED(hr)) {

+    return AssertionSuccess();

+  }

+  return HRESULTFailureHelper(expr, "succeeds", hr);

+}

+

+AssertionResult IsHRESULTFailure(const char* expr, long hr) {  // NOLINT

+  if (FAILED(hr)) {

+    return AssertionSuccess();

+  }

+  return HRESULTFailureHelper(expr, "fails", hr);

+}

+

+#endif  // GTEST_OS_WINDOWS

+

+// Utility functions for encoding Unicode text (wide strings) in

+// UTF-8.

+

+// A Unicode code-point can have upto 21 bits, and is encoded in UTF-8

+// like this:

+//

+// Code-point length   Encoding

+//   0 -  7 bits       0xxxxxxx

+//   8 - 11 bits       110xxxxx 10xxxxxx

+//  12 - 16 bits       1110xxxx 10xxxxxx 10xxxxxx

+//  17 - 21 bits       11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

+

+// The maximum code-point a one-byte UTF-8 sequence can represent.

+const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) <<  7) - 1;

+

+// The maximum code-point a two-byte UTF-8 sequence can represent.

+const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1;

+

+// The maximum code-point a three-byte UTF-8 sequence can represent.

+const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1;

+

+// The maximum code-point a four-byte UTF-8 sequence can represent.

+const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1;

+

+// Chops off the n lowest bits from a bit pattern.  Returns the n

+// lowest bits.  As a side effect, the original bit pattern will be

+// shifted to the right by n bits.

+inline UInt32 ChopLowBits(UInt32* bits, int n) {

+  const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);

+  *bits >>= n;

+  return low_bits;

+}

+

+// Converts a Unicode code point to a narrow string in UTF-8 encoding.

+// code_point parameter is of type UInt32 because wchar_t may not be

+// wide enough to contain a code point.

+// If the code_point is not a valid Unicode code point

+// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted

+// to "(Invalid Unicode 0xXXXXXXXX)".

+std::string CodePointToUtf8(UInt32 code_point) {

+  if (code_point > kMaxCodePoint4) {

+    return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";

+  }

+

+  char str[5];  // Big enough for the largest valid code point.

+  if (code_point <= kMaxCodePoint1) {

+    str[1] = '\0';

+    str[0] = static_cast<char>(code_point);                          // 0xxxxxxx

+  } else if (code_point <= kMaxCodePoint2) {

+    str[2] = '\0';

+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx

+    str[0] = static_cast<char>(0xC0 | code_point);                   // 110xxxxx

+  } else if (code_point <= kMaxCodePoint3) {

+    str[3] = '\0';

+    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx

+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx

+    str[0] = static_cast<char>(0xE0 | code_point);                   // 1110xxxx

+  } else {  // code_point <= kMaxCodePoint4

+    str[4] = '\0';

+    str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx

+    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx

+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx

+    str[0] = static_cast<char>(0xF0 | code_point);                   // 11110xxx

+  }

+  return str;

+}

+

+// The following two functions only make sense if the the system

+// uses UTF-16 for wide string encoding. All supported systems

+// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.

+

+// Determines if the arguments constitute UTF-16 surrogate pair

+// and thus should be combined into a single Unicode code point

+// using CreateCodePointFromUtf16SurrogatePair.

+inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {

+  return sizeof(wchar_t) == 2 &&

+      (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;

+}

+

+// Creates a Unicode code point from UTF16 surrogate pair.

+inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,

+                                                    wchar_t second) {

+  const UInt32 mask = (1 << 10) - 1;

+  return (sizeof(wchar_t) == 2) ?

+      (((first & mask) << 10) | (second & mask)) + 0x10000 :

+      // This function should not be called when the condition is

+      // false, but we provide a sensible default in case it is.

+      static_cast<UInt32>(first);

+}

+

+// Converts a wide string to a narrow string in UTF-8 encoding.

+// The wide string is assumed to have the following encoding:

+//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)

+//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)

+// Parameter str points to a null-terminated wide string.

+// Parameter num_chars may additionally limit the number

+// of wchar_t characters processed. -1 is used when the entire string

+// should be processed.

+// If the string contains code points that are not valid Unicode code points

+// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output

+// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding

+// and contains invalid UTF-16 surrogate pairs, values in those pairs

+// will be encoded as individual Unicode characters from Basic Normal Plane.

+std::string WideStringToUtf8(const wchar_t* str, int num_chars) {

+  if (num_chars == -1)

+    num_chars = static_cast<int>(wcslen(str));

+

+  ::std::stringstream stream;

+  for (int i = 0; i < num_chars; ++i) {

+    UInt32 unicode_code_point;

+

+    if (str[i] == L'\0') {

+      break;

+    } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {

+      unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],

+                                                                 str[i + 1]);

+      i++;

+    } else {

+      unicode_code_point = static_cast<UInt32>(str[i]);

+    }

+

+    stream << CodePointToUtf8(unicode_code_point);

+  }

+  return StringStreamToString(&stream);

+}

+

+// Converts a wide C string to an std::string using the UTF-8 encoding.

+// NULL will be converted to "(null)".

+std::string String::ShowWideCString(const wchar_t * wide_c_str) {

+  if (wide_c_str == NULL)  return "(null)";

+

+  return internal::WideStringToUtf8(wide_c_str, -1);

+}

+

+// Compares two wide C strings.  Returns true iff they have the same

+// content.

+//

+// Unlike wcscmp(), this function can handle NULL argument(s).  A NULL

+// C string is considered different to any non-NULL C string,

+// including the empty string.

+bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {

+  if (lhs == NULL) return rhs == NULL;

+

+  if (rhs == NULL) return false;

+

+  return wcscmp(lhs, rhs) == 0;

+}

+

+// Helper function for *_STREQ on wide strings.

+AssertionResult CmpHelperSTREQ(const char* expected_expression,

+                               const char* actual_expression,

+                               const wchar_t* expected,

+                               const wchar_t* actual) {

+  if (String::WideCStringEquals(expected, actual)) {

+    return AssertionSuccess();

+  }

+

+  return EqFailure(expected_expression,

+                   actual_expression,

+                   PrintToString(expected),

+                   PrintToString(actual),

+                   false);

+}

+

+// Helper function for *_STRNE on wide strings.

+AssertionResult CmpHelperSTRNE(const char* s1_expression,

+                               const char* s2_expression,

+                               const wchar_t* s1,

+                               const wchar_t* s2) {

+  if (!String::WideCStringEquals(s1, s2)) {

+    return AssertionSuccess();

+  }

+

+  return AssertionFailure() << "Expected: (" << s1_expression << ") != ("

+                            << s2_expression << "), actual: "

+                            << PrintToString(s1)

+                            << " vs " << PrintToString(s2);

+}

+

+// Compares two C strings, ignoring case.  Returns true iff they have

+// the same content.

+//

+// Unlike strcasecmp(), this function can handle NULL argument(s).  A

+// NULL C string is considered different to any non-NULL C string,

+// including the empty string.

+bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {

+  if (lhs == NULL)

+    return rhs == NULL;

+  if (rhs == NULL)

+    return false;

+  return posix::StrCaseCmp(lhs, rhs) == 0;

+}

+

+  // Compares two wide C strings, ignoring case.  Returns true iff they

+  // have the same content.

+  //

+  // Unlike wcscasecmp(), this function can handle NULL argument(s).

+  // A NULL C string is considered different to any non-NULL wide C string,

+  // including the empty string.

+  // NB: The implementations on different platforms slightly differ.

+  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE

+  // environment variable. On GNU platform this method uses wcscasecmp

+  // which compares according to LC_CTYPE category of the current locale.

+  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the

+  // current locale.

+bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,

+                                              const wchar_t* rhs) {

+  if (lhs == NULL) return rhs == NULL;

+

+  if (rhs == NULL) return false;

+

+#if GTEST_OS_WINDOWS

+  return _wcsicmp(lhs, rhs) == 0;

+#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID

+  return wcscasecmp(lhs, rhs) == 0;

+#else

+  // Android, Mac OS X and Cygwin don't define wcscasecmp.

+  // Other unknown OSes may not define it either.

+  wint_t left, right;

+  do {

+    left = towlower(*lhs++);

+    right = towlower(*rhs++);

+  } while (left && left == right);

+  return left == right;

+#endif  // OS selector

+}

+

+// Returns true iff str ends with the given suffix, ignoring case.

+// Any string is considered to end with an empty suffix.

+bool String::EndsWithCaseInsensitive(

+    const std::string& str, const std::string& suffix) {

+  const size_t str_len = str.length();

+  const size_t suffix_len = suffix.length();

+  return (str_len >= suffix_len) &&

+         CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len,

+                                      suffix.c_str());

+}

+

+// Formats an int value as "%02d".

+std::string String::FormatIntWidth2(int value) {

+  std::stringstream ss;

+  ss << std::setfill('0') << std::setw(2) << value;

+  return ss.str();

+}

+

+// Formats an int value as "%X".

+std::string String::FormatHexInt(int value) {

+  std::stringstream ss;

+  ss << std::hex << std::uppercase << value;

+  return ss.str();

+}

+

+// Formats a byte as "%02X".

+std::string String::FormatByte(unsigned char value) {

+  std::stringstream ss;

+  ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase

+     << static_cast<unsigned int>(value);

+  return ss.str();

+}

+

+// Converts the buffer in a stringstream to an std::string, converting NUL

+// bytes to "\\0" along the way.

+std::string StringStreamToString(::std::stringstream* ss) {

+  const ::std::string& str = ss->str();

+  const char* const start = str.c_str();

+  const char* const end = start + str.length();

+

+  std::string result;

+  result.reserve(2 * (end - start));

+  for (const char* ch = start; ch != end; ++ch) {

+    if (*ch == '\0') {

+      result += "\\0";  // Replaces NUL with "\\0";

+    } else {

+      result += *ch;

+    }

+  }

+

+  return result;

+}

+

+// Appends the user-supplied message to the Google-Test-generated message.

+std::string AppendUserMessage(const std::string& gtest_msg,

+                              const Message& user_msg) {

+  // Appends the user message if it's non-empty.

+  const std::string user_msg_string = user_msg.GetString();

+  if (user_msg_string.empty()) {

+    return gtest_msg;

+  }

+

+  return gtest_msg + "\n" + user_msg_string;

+}

+

+}  // namespace internal

+

+// class TestResult

+

+// Creates an empty TestResult.

+TestResult::TestResult()

+    : death_test_count_(0),

+      elapsed_time_(0) {

+}

+

+// D'tor.

+TestResult::~TestResult() {

+}

+

+// Returns the i-th test part result among all the results. i can

+// range from 0 to total_part_count() - 1. If i is not in that range,

+// aborts the program.

+const TestPartResult& TestResult::GetTestPartResult(int i) const {

+  if (i < 0 || i >= total_part_count())

+    internal::posix::Abort();

+  return test_part_results_.at(i);

+}

+

+// Returns the i-th test property. i can range from 0 to

+// test_property_count() - 1. If i is not in that range, aborts the

+// program.

+const TestProperty& TestResult::GetTestProperty(int i) const {

+  if (i < 0 || i >= test_property_count())

+    internal::posix::Abort();

+  return test_properties_.at(i);

+}

+

+// Clears the test part results.

+void TestResult::ClearTestPartResults() {

+  test_part_results_.clear();

+}

+

+// Adds a test part result to the list.

+void TestResult::AddTestPartResult(const TestPartResult& test_part_result) {

+  test_part_results_.push_back(test_part_result);

+}

+

+// Adds a test property to the list. If a property with the same key as the

+// supplied property is already represented, the value of this test_property

+// replaces the old value for that key.

+void TestResult::RecordProperty(const std::string& xml_element,

+                                const TestProperty& test_property) {

+  if (!ValidateTestProperty(xml_element, test_property)) {

+    return;

+  }

+  internal::MutexLock lock(&test_properites_mutex_);

+  const std::vector<TestProperty>::iterator property_with_matching_key =

+      std::find_if(test_properties_.begin(), test_properties_.end(),

+                   internal::TestPropertyKeyIs(test_property.key()));

+  if (property_with_matching_key == test_properties_.end()) {

+    test_properties_.push_back(test_property);

+    return;

+  }

+  property_with_matching_key->SetValue(test_property.value());

+}

+

+// The list of reserved attributes used in the <testsuites> element of XML

+// output.

+static const char* const kReservedTestSuitesAttributes[] = {

+  "disabled",

+  "errors",

+  "failures",

+  "name",

+  "random_seed",

+  "tests",

+  "time",

+  "timestamp"

+};

+

+// The list of reserved attributes used in the <testsuite> element of XML

+// output.

+static const char* const kReservedTestSuiteAttributes[] = {

+  "disabled",

+  "errors",

+  "failures",

+  "name",

+  "tests",

+  "time"

+};

+

+// The list of reserved attributes used in the <testcase> element of XML output.

+static const char* const kReservedTestCaseAttributes[] = {

+  "classname",

+  "name",

+  "status",

+  "time",

+  "type_param",

+  "value_param"

+};

+

+template <int kSize>

+std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {

+  return std::vector<std::string>(array, array + kSize);

+}

+

+static std::vector<std::string> GetReservedAttributesForElement(

+    const std::string& xml_element) {

+  if (xml_element == "testsuites") {

+    return ArrayAsVector(kReservedTestSuitesAttributes);

+  } else if (xml_element == "testsuite") {

+    return ArrayAsVector(kReservedTestSuiteAttributes);

+  } else if (xml_element == "testcase") {

+    return ArrayAsVector(kReservedTestCaseAttributes);

+  } else {

+    GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;

+  }

+  // This code is unreachable but some compilers may not realizes that.

+  return std::vector<std::string>();

+}

+

+static std::string FormatWordList(const std::vector<std::string>& words) {

+  Message word_list;

+  for (size_t i = 0; i < words.size(); ++i) {

+    if (i > 0 && words.size() > 2) {

+      word_list << ", ";

+    }

+    if (i == words.size() - 1) {

+      word_list << "and ";

+    }

+    word_list << "'" << words[i] << "'";

+  }

+  return word_list.GetString();

+}

+

+bool ValidateTestPropertyName(const std::string& property_name,

+                              const std::vector<std::string>& reserved_names) {

+  if (std::find(reserved_names.begin(), reserved_names.end(), property_name) !=

+          reserved_names.end()) {

+    ADD_FAILURE() << "Reserved key used in RecordProperty(): " << property_name

+                  << " (" << FormatWordList(reserved_names)

+                  << " are reserved by " << GTEST_NAME_ << ")";

+    return false;

+  }

+  return true;

+}

+

+// Adds a failure if the key is a reserved attribute of the element named

+// xml_element.  Returns true if the property is valid.

+bool TestResult::ValidateTestProperty(const std::string& xml_element,

+                                      const TestProperty& test_property) {

+  return ValidateTestPropertyName(test_property.key(),

+                                  GetReservedAttributesForElement(xml_element));

+}

+

+// Clears the object.

+void TestResult::Clear() {

+  test_part_results_.clear();

+  test_properties_.clear();

+  death_test_count_ = 0;

+  elapsed_time_ = 0;

+}

+

+// Returns true iff the test failed.

+bool TestResult::Failed() const {

+  for (int i = 0; i < total_part_count(); ++i) {

+    if (GetTestPartResult(i).failed())

+      return true;

+  }

+  return false;

+}

+

+// Returns true iff the test part fatally failed.

+static bool TestPartFatallyFailed(const TestPartResult& result) {

+  return result.fatally_failed();

+}

+

+// Returns true iff the test fatally failed.

+bool TestResult::HasFatalFailure() const {

+  return CountIf(test_part_results_, TestPartFatallyFailed) > 0;

+}

+

+// Returns true iff the test part non-fatally failed.

+static bool TestPartNonfatallyFailed(const TestPartResult& result) {

+  return result.nonfatally_failed();

+}

+

+// Returns true iff the test has a non-fatal failure.

+bool TestResult::HasNonfatalFailure() const {

+  return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;

+}

+

+// Gets the number of all test parts.  This is the sum of the number

+// of successful test parts and the number of failed test parts.

+int TestResult::total_part_count() const {

+  return static_cast<int>(test_part_results_.size());

+}

+

+// Returns the number of the test properties.

+int TestResult::test_property_count() const {

+  return static_cast<int>(test_properties_.size());

+}

+

+// class Test

+

+// Creates a Test object.

+

+// The c'tor saves the values of all Google Test flags.

+Test::Test()

+    : gtest_flag_saver_(new internal::GTestFlagSaver) {

+}

+

+// The d'tor restores the values of all Google Test flags.

+Test::~Test() {

+  delete gtest_flag_saver_;

+}

+

+// Sets up the test fixture.

+//

+// A sub-class may override this.

+void Test::SetUp() {

+}

+

+// Tears down the test fixture.

+//

+// A sub-class may override this.

+void Test::TearDown() {

+}

+

+// Allows user supplied key value pairs to be recorded for later output.

+void Test::RecordProperty(const std::string& key, const std::string& value) {

+  UnitTest::GetInstance()->RecordProperty(key, value);

+}

+

+// Allows user supplied key value pairs to be recorded for later output.

+void Test::RecordProperty(const std::string& key, int value) {

+  Message value_message;

+  value_message << value;

+  RecordProperty(key, value_message.GetString().c_str());

+}

+

+namespace internal {

+

+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,

+                                    const std::string& message) {

+  // This function is a friend of UnitTest and as such has access to

+  // AddTestPartResult.

+  UnitTest::GetInstance()->AddTestPartResult(

+      result_type,

+      NULL,  // No info about the source file where the exception occurred.

+      -1,    // We have no info on which line caused the exception.

+      message,

+      "");   // No stack trace, either.

+}

+

+}  // namespace internal

+

+// Google Test requires all tests in the same test case to use the same test

+// fixture class.  This function checks if the current test has the

+// same fixture class as the first test in the current test case.  If

+// yes, it returns true; otherwise it generates a Google Test failure and

+// returns false.

+bool Test::HasSameFixtureClass() {

+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();

+  const TestCase* const test_case = impl->current_test_case();

+

+  // Info about the first test in the current test case.

+  const TestInfo* const first_test_info = test_case->test_info_list()[0];

+  const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;

+  const char* const first_test_name = first_test_info->name();

+

+  // Info about the current test.

+  const TestInfo* const this_test_info = impl->current_test_info();

+  const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;

+  const char* const this_test_name = this_test_info->name();

+

+  if (this_fixture_id != first_fixture_id) {

+    // Is the first test defined using TEST?

+    const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();

+    // Is this test defined using TEST?

+    const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();

+

+    if (first_is_TEST || this_is_TEST) {

+      // The user mixed TEST and TEST_F in this test case - we'll tell

+      // him/her how to fix it.

+

+      // Gets the name of the TEST and the name of the TEST_F.  Note

+      // that first_is_TEST and this_is_TEST cannot both be true, as

+      // the fixture IDs are different for the two tests.

+      const char* const TEST_name =

+          first_is_TEST ? first_test_name : this_test_name;

+      const char* const TEST_F_name =

+          first_is_TEST ? this_test_name : first_test_name;

+

+      ADD_FAILURE()

+          << "All tests in the same test case must use the same test fixture\n"

+          << "class, so mixing TEST_F and TEST in the same test case is\n"

+          << "illegal.  In test case " << this_test_info->test_case_name()

+          << ",\n"

+          << "test " << TEST_F_name << " is defined using TEST_F but\n"

+          << "test " << TEST_name << " is defined using TEST.  You probably\n"

+          << "want to change the TEST to TEST_F or move it to another test\n"

+          << "case.";

+    } else {

+      // The user defined two fixture classes with the same name in

+      // two namespaces - we'll tell him/her how to fix it.

+      ADD_FAILURE()

+          << "All tests in the same test case must use the same test fixture\n"

+          << "class.  However, in test case "

+          << this_test_info->test_case_name() << ",\n"

+          << "you defined test " << first_test_name

+          << " and test " << this_test_name << "\n"

+          << "using two different test fixture classes.  This can happen if\n"

+          << "the two classes are from different namespaces or translation\n"

+          << "units and have the same name.  You should probably rename one\n"

+          << "of the classes to put the tests into different test cases.";

+    }

+    return false;

+  }

+

+  return true;

+}

+

+#if GTEST_HAS_SEH

+

+// Adds an "exception thrown" fatal failure to the current test.  This

+// function returns its result via an output parameter pointer because VC++

+// prohibits creation of objects with destructors on stack in functions

+// using __try (see error C2712).

+static std::string* FormatSehExceptionMessage(DWORD exception_code,

+                                              const char* location) {

+  Message message;

+  message << "SEH exception with code 0x" << std::setbase(16) <<

+    exception_code << std::setbase(10) << " thrown in " << location << ".";

+

+  return new std::string(message.GetString());

+}

+

+#endif  // GTEST_HAS_SEH

+

+namespace internal {

+

+#if GTEST_HAS_EXCEPTIONS

+

+// Adds an "exception thrown" fatal failure to the current test.

+static std::string FormatCxxExceptionMessage(const char* description,

+                                             const char* location) {

+  Message message;

+  if (description != NULL) {

+    message << "C++ exception with description \"" << description << "\"";

+  } else {

+    message << "Unknown C++ exception";

+  }

+  message << " thrown in " << location << ".";

+

+  return message.GetString();

+}

+

+static std::string PrintTestPartResultToString(

+    const TestPartResult& test_part_result);

+

+GoogleTestFailureException::GoogleTestFailureException(

+    const TestPartResult& failure)

+    : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}

+

+#endif  // GTEST_HAS_EXCEPTIONS

+

+// We put these helper functions in the internal namespace as IBM's xlC

+// compiler rejects the code if they were declared static.

+

+// Runs the given method and handles SEH exceptions it throws, when

+// SEH is supported; returns the 0-value for type Result in case of an

+// SEH exception.  (Microsoft compilers cannot handle SEH and C++

+// exceptions in the same function.  Therefore, we provide a separate

+// wrapper function for handling SEH exceptions.)

+template <class T, typename Result>

+Result HandleSehExceptionsInMethodIfSupported(

+    T* object, Result (T::*method)(), const char* location) {

+#if GTEST_HAS_SEH

+  __try {

+    return (object->*method)();

+  } __except (internal::UnitTestOptions::GTestShouldProcessSEH(  // NOLINT

+      GetExceptionCode())) {

+    // We create the exception message on the heap because VC++ prohibits

+    // creation of objects with destructors on stack in functions using __try

+    // (see error C2712).

+    std::string* exception_message = FormatSehExceptionMessage(

+        GetExceptionCode(), location);

+    internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,

+                                             *exception_message);

+    delete exception_message;

+    return static_cast<Result>(0);

+  }

+#else

+  (void)location;

+  return (object->*method)();

+#endif  // GTEST_HAS_SEH

+}

+

+// Runs the given method and catches and reports C++ and/or SEH-style

+// exceptions, if they are supported; returns the 0-value for type

+// Result in case of an SEH exception.

+template <class T, typename Result>

+Result HandleExceptionsInMethodIfSupported(

+    T* object, Result (T::*method)(), const char* location) {

+  // NOTE: The user code can affect the way in which Google Test handles

+  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before

+  // RUN_ALL_TESTS() starts. It is technically possible to check the flag

+  // after the exception is caught and either report or re-throw the

+  // exception based on the flag's value:

+  //

+  // try {

+  //   // Perform the test method.

+  // } catch (...) {

+  //   if (GTEST_FLAG(catch_exceptions))

+  //     // Report the exception as failure.

+  //   else

+  //     throw;  // Re-throws the original exception.

+  // }

+  //

+  // However, the purpose of this flag is to allow the program to drop into

+  // the debugger when the exception is thrown. On most platforms, once the

+  // control enters the catch block, the exception origin information is

+  // lost and the debugger will stop the program at the point of the

+  // re-throw in this function -- instead of at the point of the original

+  // throw statement in the code under test.  For this reason, we perform

+  // the check early, sacrificing the ability to affect Google Test's

+  // exception handling in the method where the exception is thrown.

+  if (internal::GetUnitTestImpl()->catch_exceptions()) {

+#if GTEST_HAS_EXCEPTIONS

+    try {

+      return HandleSehExceptionsInMethodIfSupported(object, method, location);

+    } catch (const internal::GoogleTestFailureException&) {  // NOLINT

+      // This exception type can only be thrown by a failed Google

+      // Test assertion with the intention of letting another testing

+      // framework catch it.  Therefore we just re-throw it.

+      throw;

+    } catch (const std::exception& e) {  // NOLINT

+      internal::ReportFailureInUnknownLocation(

+          TestPartResult::kFatalFailure,

+          FormatCxxExceptionMessage(e.what(), location));

+    } catch (...) {  // NOLINT

+      internal::ReportFailureInUnknownLocation(

+          TestPartResult::kFatalFailure,

+          FormatCxxExceptionMessage(NULL, location));

+    }

+    return static_cast<Result>(0);

+#else

+    return HandleSehExceptionsInMethodIfSupported(object, method, location);

+#endif  // GTEST_HAS_EXCEPTIONS

+  } else {

+    return (object->*method)();

+  }

+}

+

+}  // namespace internal

+

+// Runs the test and updates the test result.

+void Test::Run() {

+  if (!HasSameFixtureClass()) return;

+

+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();

+  impl->os_stack_trace_getter()->UponLeavingGTest();

+  internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");

+  // We will run the test only if SetUp() was successful.

+  if (!HasFatalFailure()) {

+    impl->os_stack_trace_getter()->UponLeavingGTest();

+    internal::HandleExceptionsInMethodIfSupported(

+        this, &Test::TestBody, "the test body");

+  }

+

+  // However, we want to clean up as much as possible.  Hence we will

+  // always call TearDown(), even if SetUp() or the test body has

+  // failed.

+  impl->os_stack_trace_getter()->UponLeavingGTest();

+  internal::HandleExceptionsInMethodIfSupported(

+      this, &Test::TearDown, "TearDown()");

+}

+

+// Returns true iff the current test has a fatal failure.

+bool Test::HasFatalFailure() {

+  return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();

+}

+

+// Returns true iff the current test has a non-fatal failure.

+bool Test::HasNonfatalFailure() {

+  return internal::GetUnitTestImpl()->current_test_result()->

+      HasNonfatalFailure();

+}

+

+// class TestInfo

+

+// Constructs a TestInfo object. It assumes ownership of the test factory

+// object.

+TestInfo::TestInfo(const std::string& a_test_case_name,

+                   const std::string& a_name,

+                   const char* a_type_param,

+                   const char* a_value_param,

+                   internal::TypeId fixture_class_id,

+                   internal::TestFactoryBase* factory)

+    : test_case_name_(a_test_case_name),

+      name_(a_name),

+      type_param_(a_type_param ? new std::string(a_type_param) : NULL),

+      value_param_(a_value_param ? new std::string(a_value_param) : NULL),

+      fixture_class_id_(fixture_class_id),

+      should_run_(false),

+      is_disabled_(false),

+      matches_filter_(false),

+      factory_(factory),

+      result_() {}

+

+// Destructs a TestInfo object.

+TestInfo::~TestInfo() { delete factory_; }

+

+namespace internal {

+

+// Creates a new TestInfo object and registers it with Google Test;

+// returns the created object.

+//

+// Arguments:

+//

+//   test_case_name:   name of the test case

+//   name:             name of the test

+//   type_param:       the name of the test's type parameter, or NULL if

+//                     this is not a typed or a type-parameterized test.

+//   value_param:      text representation of the test's value parameter,

+//                     or NULL if this is not a value-parameterized test.

+//   fixture_class_id: ID of the test fixture class

+//   set_up_tc:        pointer to the function that sets up the test case

+//   tear_down_tc:     pointer to the function that tears down the test case

+//   factory:          pointer to the factory that creates a test object.

+//                     The newly created TestInfo instance will assume

+//                     ownership of the factory object.

+TestInfo* MakeAndRegisterTestInfo(

+    const char* test_case_name,

+    const char* name,

+    const char* type_param,

+    const char* value_param,

+    TypeId fixture_class_id,

+    SetUpTestCaseFunc set_up_tc,

+    TearDownTestCaseFunc tear_down_tc,

+    TestFactoryBase* factory) {

+  TestInfo* const test_info =

+      new TestInfo(test_case_name, name, type_param, value_param,

+                   fixture_class_id, factory);

+  GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);

+  return test_info;

+}

+

+#if GTEST_HAS_PARAM_TEST

+void ReportInvalidTestCaseType(const char* test_case_name,

+                               const char* file, int line) {

+  Message errors;

+  errors

+      << "Attempted redefinition of test case " << test_case_name << ".\n"

+      << "All tests in the same test case must use the same test fixture\n"

+      << "class.  However, in test case " << test_case_name << ", you tried\n"

+      << "to define a test using a fixture class different from the one\n"

+      << "used earlier. This can happen if the two fixture classes are\n"

+      << "from different namespaces and have the same name. You should\n"

+      << "probably rename one of the classes to put the tests into different\n"

+      << "test cases.";

+

+  fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),

+          errors.GetString().c_str());

+}

+#endif  // GTEST_HAS_PARAM_TEST

+

+}  // namespace internal

+

+namespace {

+

+// A predicate that checks the test name of a TestInfo against a known

+// value.

+//

+// This is used for implementation of the TestCase class only.  We put

+// it in the anonymous namespace to prevent polluting the outer

+// namespace.

+//

+// TestNameIs is copyable.

+class TestNameIs {

+ public:

+  // Constructor.

+  //

+  // TestNameIs has NO default constructor.

+  explicit TestNameIs(const char* name)

+      : name_(name) {}

+

+  // Returns true iff the test name of test_info matches name_.

+  bool operator()(const TestInfo * test_info) const {

+    return test_info && test_info->name() == name_;

+  }

+

+ private:

+  std::string name_;

+};

+

+}  // namespace

+

+namespace internal {

+

+// This method expands all parameterized tests registered with macros TEST_P

+// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.

+// This will be done just once during the program runtime.

+void UnitTestImpl::RegisterParameterizedTests() {

+#if GTEST_HAS_PARAM_TEST

+  if (!parameterized_tests_registered_) {

+    parameterized_test_registry_.RegisterTests();

+    parameterized_tests_registered_ = true;

+  }

+#endif

+}

+

+}  // namespace internal

+

+// Creates the test object, runs it, records its result, and then

+// deletes it.

+void TestInfo::Run() {

+  if (!should_run_) return;

+

+  // Tells UnitTest where to store test result.

+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();

+  impl->set_current_test_info(this);

+

+  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();

+

+  // Notifies the unit test event listeners that a test is about to start.

+  repeater->OnTestStart(*this);

+

+  const TimeInMillis start = internal::GetTimeInMillis();

+

+  impl->os_stack_trace_getter()->UponLeavingGTest();

+

+  // Creates the test object.

+  Test* const test = internal::HandleExceptionsInMethodIfSupported(

+      factory_, &internal::TestFactoryBase::CreateTest,

+      "the test fixture's constructor");

+

+  // Runs the test only if the test object was created and its

+  // constructor didn't generate a fatal failure.

+  if ((test != NULL) && !Test::HasFatalFailure()) {

+    // This doesn't throw as all user code that can throw are wrapped into

+    // exception handling code.

+    test->Run();

+  }

+

+  // Deletes the test object.

+  impl->os_stack_trace_getter()->UponLeavingGTest();

+  internal::HandleExceptionsInMethodIfSupported(

+      test, &Test::DeleteSelf_, "the test fixture's destructor");

+

+  result_.set_elapsed_time(internal::GetTimeInMillis() - start);

+

+  // Notifies the unit test event listener that a test has just finished.

+  repeater->OnTestEnd(*this);

+

+  // Tells UnitTest to stop associating assertion results to this

+  // test.

+  impl->set_current_test_info(NULL);

+}

+

+// class TestCase

+

+// Gets the number of successful tests in this test case.

+int TestCase::successful_test_count() const {

+  return CountIf(test_info_list_, TestPassed);

+}

+

+// Gets the number of failed tests in this test case.

+int TestCase::failed_test_count() const {

+  return CountIf(test_info_list_, TestFailed);

+}

+

+// Gets the number of disabled tests that will be reported in the XML report.

+int TestCase::reportable_disabled_test_count() const {

+  return CountIf(test_info_list_, TestReportableDisabled);

+}

+

+// Gets the number of disabled tests in this test case.

+int TestCase::disabled_test_count() const {

+  return CountIf(test_info_list_, TestDisabled);

+}

+

+// Gets the number of tests to be printed in the XML report.

+int TestCase::reportable_test_count() const {

+  return CountIf(test_info_list_, TestReportable);

+}

+

+// Get the number of tests in this test case that should run.

+int TestCase::test_to_run_count() const {

+  return CountIf(test_info_list_, ShouldRunTest);

+}

+

+// Gets the number of all tests.

+int TestCase::total_test_count() const {

+  return static_cast<int>(test_info_list_.size());

+}

+

+// Creates a TestCase with the given name.

+//

+// Arguments:

+//

+//   name:         name of the test case

+//   a_type_param: the name of the test case's type parameter, or NULL if

+//                 this is not a typed or a type-parameterized test case.

+//   set_up_tc:    pointer to the function that sets up the test case

+//   tear_down_tc: pointer to the function that tears down the test case

+TestCase::TestCase(const char* a_name, const char* a_type_param,

+                   Test::SetUpTestCaseFunc set_up_tc,

+                   Test::TearDownTestCaseFunc tear_down_tc)

+    : name_(a_name),

+      type_param_(a_type_param ? new std::string(a_type_param) : NULL),

+      set_up_tc_(set_up_tc),

+      tear_down_tc_(tear_down_tc),

+      should_run_(false),

+      elapsed_time_(0) {

+}

+

+// Destructor of TestCase.

+TestCase::~TestCase() {

+  // Deletes every Test in the collection.

+  ForEach(test_info_list_, internal::Delete<TestInfo>);

+}

+

+// Returns the i-th test among all the tests. i can range from 0 to

+// total_test_count() - 1. If i is not in that range, returns NULL.

+const TestInfo* TestCase::GetTestInfo(int i) const {

+  const int index = GetElementOr(test_indices_, i, -1);

+  return index < 0 ? NULL : test_info_list_[index];

+}

+

+// Returns the i-th test among all the tests. i can range from 0 to

+// total_test_count() - 1. If i is not in that range, returns NULL.

+TestInfo* TestCase::GetMutableTestInfo(int i) {

+  const int index = GetElementOr(test_indices_, i, -1);

+  return index < 0 ? NULL : test_info_list_[index];

+}

+

+// Adds a test to this test case.  Will delete the test upon

+// destruction of the TestCase object.

+void TestCase::AddTestInfo(TestInfo * test_info) {

+  test_info_list_.push_back(test_info);

+  test_indices_.push_back(static_cast<int>(test_indices_.size()));

+}

+

+// Runs every test in this TestCase.

+void TestCase::Run() {

+  if (!should_run_) return;

+

+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();

+  impl->set_current_test_case(this);

+

+  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();

+

+  repeater->OnTestCaseStart(*this);

+  impl->os_stack_trace_getter()->UponLeavingGTest();

+  internal::HandleExceptionsInMethodIfSupported(

+      this, &TestCase::RunSetUpTestCase, "SetUpTestCase()");

+

+  const internal::TimeInMillis start = internal::GetTimeInMillis();

+  for (int i = 0; i < total_test_count(); i++) {

+    GetMutableTestInfo(i)->Run();

+  }

+  elapsed_time_ = internal::GetTimeInMillis() - start;

+

+  impl->os_stack_trace_getter()->UponLeavingGTest();

+  internal::HandleExceptionsInMethodIfSupported(

+      this, &TestCase::RunTearDownTestCase, "TearDownTestCase()");

+

+  repeater->OnTestCaseEnd(*this);

+  impl->set_current_test_case(NULL);

+}

+

+// Clears the results of all tests in this test case.

+void TestCase::ClearResult() {

+  ad_hoc_test_result_.Clear();

+  ForEach(test_info_list_, TestInfo::ClearTestResult);

+}

+

+// Shuffles the tests in this test case.

+void TestCase::ShuffleTests(internal::Random* random) {

+  Shuffle(random, &test_indices_);

+}

+

+// Restores the test order to before the first shuffle.

+void TestCase::UnshuffleTests() {

+  for (size_t i = 0; i < test_indices_.size(); i++) {

+    test_indices_[i] = static_cast<int>(i);

+  }

+}

+

+// Formats a countable noun.  Depending on its quantity, either the

+// singular form or the plural form is used. e.g.

+//

+// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".

+// FormatCountableNoun(5, "book", "books") returns "5 books".

+static std::string FormatCountableNoun(int count,

+                                       const char * singular_form,

+                                       const char * plural_form) {

+  return internal::StreamableToString(count) + " " +

+      (count == 1 ? singular_form : plural_form);

+}

+

+// Formats the count of tests.

+static std::string FormatTestCount(int test_count) {

+  return FormatCountableNoun(test_count, "test", "tests");

+}

+

+// Formats the count of test cases.

+static std::string FormatTestCaseCount(int test_case_count) {

+  return FormatCountableNoun(test_case_count, "test case", "test cases");

+}

+

+// Converts a TestPartResult::Type enum to human-friendly string

+// representation.  Both kNonFatalFailure and kFatalFailure are translated

+// to "Failure", as the user usually doesn't care about the difference

+// between the two when viewing the test result.

+static const char * TestPartResultTypeToString(TestPartResult::Type type) {

+  switch (type) {

+    case TestPartResult::kSuccess:

+      return "Success";

+

+    case TestPartResult::kNonFatalFailure:

+    case TestPartResult::kFatalFailure:

+#ifdef _MSC_VER

+      return "error: ";

+#else

+      return "Failure\n";

+#endif

+    default:

+      return "Unknown result type";

+  }

+}

+

+namespace internal {

+

+// Prints a TestPartResult to an std::string.

+static std::string PrintTestPartResultToString(

+    const TestPartResult& test_part_result) {

+  return (Message()

+          << internal::FormatFileLocation(test_part_result.file_name(),

+                                          test_part_result.line_number())

+          << " " << TestPartResultTypeToString(test_part_result.type())

+          << test_part_result.message()).GetString();

+}

+

+// Prints a TestPartResult.

+static void PrintTestPartResult(const TestPartResult& test_part_result) {

+  const std::string& result =

+      PrintTestPartResultToString(test_part_result);

+  printf("%s\n", result.c_str());

+  fflush(stdout);

+  // If the test program runs in Visual Studio or a debugger, the

+  // following statements add the test part result message to the Output

+  // window such that the user can double-click on it to jump to the

+  // corresponding source code location; otherwise they do nothing.

+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE

+  // We don't call OutputDebugString*() on Windows Mobile, as printing

+  // to stdout is done by OutputDebugString() there already - we don't

+  // want the same message printed twice.

+  ::OutputDebugStringA(result.c_str());

+  ::OutputDebugStringA("\n");

+#endif

+}

+

+// class PrettyUnitTestResultPrinter

+

+enum GTestColor {

+  COLOR_DEFAULT,

+  COLOR_RED,

+  COLOR_GREEN,

+  COLOR_YELLOW

+};

+

+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE

+

+// Returns the character attribute for the given color.

+WORD GetColorAttribute(GTestColor color) {

+  switch (color) {

+    case COLOR_RED:    return FOREGROUND_RED;

+    case COLOR_GREEN:  return FOREGROUND_GREEN;

+    case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN;

+    default:           return 0;

+  }

+}

+

+#else

+

+// Returns the ANSI color code for the given color.  COLOR_DEFAULT is

+// an invalid input.

+const char* GetAnsiColorCode(GTestColor color) {

+  switch (color) {

+    case COLOR_RED:     return "1";

+    case COLOR_GREEN:   return "2";

+    case COLOR_YELLOW:  return "3";

+    default:            return NULL;

+  };

+}

+

+#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE

+

+// Returns true iff Google Test should use colors in the output.

+bool ShouldUseColor(bool stdout_is_tty) {

+  const char* const gtest_color = GTEST_FLAG(color).c_str();

+

+  if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {

+#if GTEST_OS_WINDOWS

+    // On Windows the TERM variable is usually not set, but the

+    // console there does support colors.

+    return stdout_is_tty;

+#else

+    // On non-Windows platforms, we rely on the TERM variable.

+    const char* const term = posix::GetEnv("TERM");

+    const bool term_supports_color =

+        String::CStringEquals(term, "xterm") ||

+        String::CStringEquals(term, "xterm-color") ||

+        String::CStringEquals(term, "xterm-256color") ||

+        String::CStringEquals(term, "screen") ||

+        String::CStringEquals(term, "screen-256color") ||

+        String::CStringEquals(term, "linux") ||

+        String::CStringEquals(term, "cygwin");

+    return stdout_is_tty && term_supports_color;

+#endif  // GTEST_OS_WINDOWS

+  }

+

+  return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||

+      String::CaseInsensitiveCStringEquals(gtest_color, "true") ||

+      String::CaseInsensitiveCStringEquals(gtest_color, "t") ||

+      String::CStringEquals(gtest_color, "1");

+  // We take "yes", "true", "t", and "1" as meaning "yes".  If the

+  // value is neither one of these nor "auto", we treat it as "no" to

+  // be conservative.

+}

+

+// Helpers for printing colored strings to stdout. Note that on Windows, we

+// cannot simply emit special characters and have the terminal change colors.

+// This routine must actually emit the characters rather than return a string

+// that would be colored when printed, as can be done on Linux.

+void ColoredPrintf(GTestColor color, const char* fmt, ...) {

+  va_list args;

+  va_start(args, fmt);

+

+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || GTEST_OS_IOS

+  const bool use_color = false;

+#else

+  static const bool in_color_mode =

+      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);

+  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);

+#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS

+  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.

+

+  if (!use_color) {

+    vprintf(fmt, args);

+    va_end(args);

+    return;

+  }

+

+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE

+  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);

+

+  // Gets the current text color.

+  CONSOLE_SCREEN_BUFFER_INFO buffer_info;

+  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);

+  const WORD old_color_attrs = buffer_info.wAttributes;

+

+  // We need to flush the stream buffers into the console before each

+  // SetConsoleTextAttribute call lest it affect the text that is already

+  // printed but has not yet reached the console.

+  fflush(stdout);

+  SetConsoleTextAttribute(stdout_handle,

+                          GetColorAttribute(color) | FOREGROUND_INTENSITY);

+  vprintf(fmt, args);

+

+  fflush(stdout);

+  // Restores the text color.

+  SetConsoleTextAttribute(stdout_handle, old_color_attrs);

+#else

+  printf("\033[0;3%sm", GetAnsiColorCode(color));

+  vprintf(fmt, args);

+  printf("\033[m");  // Resets the terminal to default.

+#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE

+  va_end(args);

+}

+

+// Text printed in Google Test's text output and --gunit_list_tests

+// output to label the type parameter and value parameter for a test.

+static const char kTypeParamLabel[] = "TypeParam";

+static const char kValueParamLabel[] = "GetParam()";

+

+void PrintFullTestCommentIfPresent(const TestInfo& test_info) {

+  const char* const type_param = test_info.type_param();

+  const char* const value_param = test_info.value_param();

+

+  if (type_param != NULL || value_param != NULL) {

+    printf(", where ");

+    if (type_param != NULL) {

+      printf("%s = %s", kTypeParamLabel, type_param);

+      if (value_param != NULL)

+        printf(" and ");

+    }

+    if (value_param != NULL) {

+      printf("%s = %s", kValueParamLabel, value_param);

+    }

+  }

+}

+

+// This class implements the TestEventListener interface.

+//

+// Class PrettyUnitTestResultPrinter is copyable.

+class PrettyUnitTestResultPrinter : public TestEventListener {

+ public:

+  PrettyUnitTestResultPrinter() {}

+  static void PrintTestName(const char * test_case, const char * test) {

+    printf("%s.%s", test_case, test);

+  }

+

+  // The following methods override what's in the TestEventListener class.

+  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}

+  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);

+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);

+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}

+  virtual void OnTestCaseStart(const TestCase& test_case);

+  virtual void OnTestStart(const TestInfo& test_info);

+  virtual void OnTestPartResult(const TestPartResult& result);

+  virtual void OnTestEnd(const TestInfo& test_info);

+  virtual void OnTestCaseEnd(const TestCase& test_case);

+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);

+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}

+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);

+  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}

+

+ private:

+  static void PrintFailedTests(const UnitTest& unit_test);

+};

+

+  // Fired before each iteration of tests starts.

+void PrettyUnitTestResultPrinter::OnTestIterationStart(

+    const UnitTest& unit_test, int iteration) {

+  if (GTEST_FLAG(repeat) != 1)

+    printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);

+

+  const char* const filter = GTEST_FLAG(filter).c_str();

+

+  // Prints the filter if it's not *.  This reminds the user that some

+  // tests may be skipped.

+  if (!String::CStringEquals(filter, kUniversalFilter)) {

+    ColoredPrintf(COLOR_YELLOW,

+                  "Note: %s filter = %s\n", GTEST_NAME_, filter);

+  }

+

+  if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {

+    const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);

+    ColoredPrintf(COLOR_YELLOW,

+                  "Note: This is test shard %d of %s.\n",

+                  static_cast<int>(shard_index) + 1,

+                  internal::posix::GetEnv(kTestTotalShards));

+  }

+

+  if (GTEST_FLAG(shuffle)) {

+    ColoredPrintf(COLOR_YELLOW,

+                  "Note: Randomizing tests' orders with a seed of %d .\n",

+                  unit_test.random_seed());

+  }

+

+  ColoredPrintf(COLOR_GREEN,  "[==========] ");

+  printf("Running %s from %s.\n",

+         FormatTestCount(unit_test.test_to_run_count()).c_str(),

+         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());

+  fflush(stdout);

+}

+

+void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(

+    const UnitTest& /*unit_test*/) {

+  ColoredPrintf(COLOR_GREEN,  "[----------] ");

+  printf("Global test environment set-up.\n");

+  fflush(stdout);

+}

+

+void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {

+  const std::string counts =

+      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");

+  ColoredPrintf(COLOR_GREEN, "[----------] ");

+  printf("%s from %s", counts.c_str(), test_case.name());

+  if (test_case.type_param() == NULL) {

+    printf("\n");

+  } else {

+    printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());

+  }

+  fflush(stdout);

+}

+

+void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {

+  ColoredPrintf(COLOR_GREEN,  "[ RUN      ] ");

+  PrintTestName(test_info.test_case_name(), test_info.name());

+  printf("\n");

+  fflush(stdout);

+}

+

+// Called after an assertion failure.

+void PrettyUnitTestResultPrinter::OnTestPartResult(

+    const TestPartResult& result) {

+  // If the test part succeeded, we don't need to do anything.

+  if (result.type() == TestPartResult::kSuccess)

+    return;

+

+  // Print failure message from the assertion (e.g. expected this and got that).

+  PrintTestPartResult(result);

+  fflush(stdout);

+}

+

+void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {

+  if (test_info.result()->Passed()) {

+    ColoredPrintf(COLOR_GREEN, "[       OK ] ");

+  } else {

+    ColoredPrintf(COLOR_RED, "[  FAILED  ] ");

+  }

+  PrintTestName(test_info.test_case_name(), test_info.name());

+  if (test_info.result()->Failed())

+    PrintFullTestCommentIfPresent(test_info);

+

+  if (GTEST_FLAG(print_time)) {

+    printf(" (%s ms)\n", internal::StreamableToString(

+           test_info.result()->elapsed_time()).c_str());

+  } else {

+    printf("\n");

+  }

+  fflush(stdout);

+}

+

+void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {

+  if (!GTEST_FLAG(print_time)) return;

+

+  const std::string counts =

+      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");

+  ColoredPrintf(COLOR_GREEN, "[----------] ");

+  printf("%s from %s (%s ms total)\n\n",

+         counts.c_str(), test_case.name(),

+         internal::StreamableToString(test_case.elapsed_time()).c_str());

+  fflush(stdout);

+}

+

+void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(

+    const UnitTest& /*unit_test*/) {

+  ColoredPrintf(COLOR_GREEN,  "[----------] ");

+  printf("Global test environment tear-down\n");

+  fflush(stdout);

+}

+

+// Internal helper for printing the list of failed tests.

+void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {

+  const int failed_test_count = unit_test.failed_test_count();

+  if (failed_test_count == 0) {

+    return;

+  }

+

+  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {

+    const TestCase& test_case = *unit_test.GetTestCase(i);

+    if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {

+      continue;

+    }

+    for (int j = 0; j < test_case.total_test_count(); ++j) {

+      const TestInfo& test_info = *test_case.GetTestInfo(j);

+      if (!test_info.should_run() || test_info.result()->Passed()) {

+        continue;

+      }

+      ColoredPrintf(COLOR_RED, "[  FAILED  ] ");

+      printf("%s.%s", test_case.name(), test_info.name());

+      PrintFullTestCommentIfPresent(test_info);

+      printf("\n");

+    }

+  }

+}

+

+void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,

+                                                     int /*iteration*/) {

+  ColoredPrintf(COLOR_GREEN,  "[==========] ");

+  printf("%s from %s ran.",

+         FormatTestCount(unit_test.test_to_run_count()).c_str(),

+         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());

+  if (GTEST_FLAG(print_time)) {

+    printf(" (%s ms total)",

+           internal::StreamableToString(unit_test.elapsed_time()).c_str());

+  }

+  printf("\n");

+  ColoredPrintf(COLOR_GREEN,  "[  PASSED  ] ");

+  printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());

+

+  int num_failures = unit_test.failed_test_count();

+  if (!unit_test.Passed()) {

+    const int failed_test_count = unit_test.failed_test_count();

+    ColoredPrintf(COLOR_RED,  "[  FAILED  ] ");

+    printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());

+    PrintFailedTests(unit_test);

+    printf("\n%2d FAILED %s\n", num_failures,

+                        num_failures == 1 ? "TEST" : "TESTS");

+  }

+

+  int num_disabled = unit_test.reportable_disabled_test_count();

+  if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {

+    if (!num_failures) {

+      printf("\n");  // Add a spacer if no FAILURE banner is displayed.

+    }

+    ColoredPrintf(COLOR_YELLOW,

+                  "  YOU HAVE %d DISABLED %s\n\n",

+                  num_disabled,

+                  num_disabled == 1 ? "TEST" : "TESTS");

+  }

+  // Ensure that Google Test output is printed before, e.g., heapchecker output.

+  fflush(stdout);

+}

+

+// End PrettyUnitTestResultPrinter

+

+// class TestEventRepeater

+//

+// This class forwards events to other event listeners.

+class TestEventRepeater : public TestEventListener {

+ public:

+  TestEventRepeater() : forwarding_enabled_(true) {}

+  virtual ~TestEventRepeater();

+  void Append(TestEventListener *listener);

+  TestEventListener* Release(TestEventListener* listener);

+

+  // Controls whether events will be forwarded to listeners_. Set to false

+  // in death test child processes.

+  bool forwarding_enabled() const { return forwarding_enabled_; }

+  void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }

+

+  virtual void OnTestProgramStart(const UnitTest& unit_test);

+  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);

+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);

+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);

+  virtual void OnTestCaseStart(const TestCase& test_case);

+  virtual void OnTestStart(const TestInfo& test_info);

+  virtual void OnTestPartResult(const TestPartResult& result);

+  virtual void OnTestEnd(const TestInfo& test_info);

+  virtual void OnTestCaseEnd(const TestCase& test_case);

+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);

+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);

+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);

+  virtual void OnTestProgramEnd(const UnitTest& unit_test);

+

+ private:

+  // Controls whether events will be forwarded to listeners_. Set to false

+  // in death test child processes.

+  bool forwarding_enabled_;

+  // The list of listeners that receive events.

+  std::vector<TestEventListener*> listeners_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);

+};

+

+TestEventRepeater::~TestEventRepeater() {

+  ForEach(listeners_, Delete<TestEventListener>);

+}

+

+void TestEventRepeater::Append(TestEventListener *listener) {

+  listeners_.push_back(listener);

+}

+

+// TODO(vladl@google.com): Factor the search functionality into Vector::Find.

+TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {

+  for (size_t i = 0; i < listeners_.size(); ++i) {

+    if (listeners_[i] == listener) {

+      listeners_.erase(listeners_.begin() + i);

+      return listener;

+    }

+  }

+

+  return NULL;

+}

+

+// Since most methods are very similar, use macros to reduce boilerplate.

+// This defines a member that forwards the call to all listeners.

+#define GTEST_REPEATER_METHOD_(Name, Type) \

+void TestEventRepeater::Name(const Type& parameter) { \

+  if (forwarding_enabled_) { \

+    for (size_t i = 0; i < listeners_.size(); i++) { \

+      listeners_[i]->Name(parameter); \

+    } \

+  } \

+}

+// This defines a member that forwards the call to all listeners in reverse

+// order.

+#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \

+void TestEventRepeater::Name(const Type& parameter) { \

+  if (forwarding_enabled_) { \

+    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \

+      listeners_[i]->Name(parameter); \

+    } \

+  } \

+}

+

+GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)

+GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)

+GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)

+GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)

+GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)

+GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)

+GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)

+GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)

+GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)

+GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)

+GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)

+

+#undef GTEST_REPEATER_METHOD_

+#undef GTEST_REVERSE_REPEATER_METHOD_

+

+void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,

+                                             int iteration) {

+  if (forwarding_enabled_) {

+    for (size_t i = 0; i < listeners_.size(); i++) {

+      listeners_[i]->OnTestIterationStart(unit_test, iteration);

+    }

+  }

+}

+

+void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,

+                                           int iteration) {

+  if (forwarding_enabled_) {

+    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {

+      listeners_[i]->OnTestIterationEnd(unit_test, iteration);

+    }

+  }

+}

+

+// End TestEventRepeater

+

+// This class generates an XML output file.

+class XmlUnitTestResultPrinter : public EmptyTestEventListener {

+ public:

+  explicit XmlUnitTestResultPrinter(const char* output_file);

+

+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);

+

+ private:

+  // Is c a whitespace character that is normalized to a space character

+  // when it appears in an XML attribute value?

+  static bool IsNormalizableWhitespace(char c) {

+    return c == 0x9 || c == 0xA || c == 0xD;

+  }

+

+  // May c appear in a well-formed XML document?

+  static bool IsValidXmlCharacter(char c) {

+    return IsNormalizableWhitespace(c) || c >= 0x20;

+  }

+

+  // Returns an XML-escaped copy of the input string str.  If

+  // is_attribute is true, the text is meant to appear as an attribute

+  // value, and normalizable whitespace is preserved by replacing it

+  // with character references.

+  static std::string EscapeXml(const std::string& str, bool is_attribute);

+

+  // Returns the given string with all characters invalid in XML removed.

+  static std::string RemoveInvalidXmlCharacters(const std::string& str);

+

+  // Convenience wrapper around EscapeXml when str is an attribute value.

+  static std::string EscapeXmlAttribute(const std::string& str) {

+    return EscapeXml(str, true);

+  }

+

+  // Convenience wrapper around EscapeXml when str is not an attribute value.

+  static std::string EscapeXmlText(const char* str) {

+    return EscapeXml(str, false);

+  }

+

+  // Verifies that the given attribute belongs to the given element and

+  // streams the attribute as XML.

+  static void OutputXmlAttribute(std::ostream* stream,

+                                 const std::string& element_name,

+                                 const std::string& name,

+                                 const std::string& value);

+

+  // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.

+  static void OutputXmlCDataSection(::std::ostream* stream, const char* data);

+

+  // Streams an XML representation of a TestInfo object.

+  static void OutputXmlTestInfo(::std::ostream* stream,

+                                const char* test_case_name,

+                                const TestInfo& test_info);

+

+  // Prints an XML representation of a TestCase object

+  static void PrintXmlTestCase(::std::ostream* stream,

+                               const TestCase& test_case);

+

+  // Prints an XML summary of unit_test to output stream out.

+  static void PrintXmlUnitTest(::std::ostream* stream,

+                               const UnitTest& unit_test);

+

+  // Produces a string representing the test properties in a result as space

+  // delimited XML attributes based on the property key="value" pairs.

+  // When the std::string is not empty, it includes a space at the beginning,

+  // to delimit this attribute from prior attributes.

+  static std::string TestPropertiesAsXmlAttributes(const TestResult& result);

+

+  // The output file.

+  const std::string output_file_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);

+};

+

+// Creates a new XmlUnitTestResultPrinter.

+XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)

+    : output_file_(output_file) {

+  if (output_file_.c_str() == NULL || output_file_.empty()) {

+    fprintf(stderr, "XML output file may not be null\n");

+    fflush(stderr);

+    exit(EXIT_FAILURE);

+  }

+}

+

+// Called after the unit test ends.

+void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,

+                                                  int /*iteration*/) {

+  FILE* xmlout = NULL;

+  FilePath output_file(output_file_);

+  FilePath output_dir(output_file.RemoveFileName());

+

+  if (output_dir.CreateDirectoriesRecursively()) {

+    xmlout = posix::FOpen(output_file_.c_str(), "w");

+  }

+  if (xmlout == NULL) {

+    // TODO(wan): report the reason of the failure.

+    //

+    // We don't do it for now as:

+    //

+    //   1. There is no urgent need for it.

+    //   2. It's a bit involved to make the errno variable thread-safe on

+    //      all three operating systems (Linux, Windows, and Mac OS).

+    //   3. To interpret the meaning of errno in a thread-safe way,

+    //      we need the strerror_r() function, which is not available on

+    //      Windows.

+    fprintf(stderr,

+            "Unable to open file \"%s\"\n",

+            output_file_.c_str());

+    fflush(stderr);

+    exit(EXIT_FAILURE);

+  }

+  std::stringstream stream;

+  PrintXmlUnitTest(&stream, unit_test);

+  fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());

+  fclose(xmlout);

+}

+

+// Returns an XML-escaped copy of the input string str.  If is_attribute

+// is true, the text is meant to appear as an attribute value, and

+// normalizable whitespace is preserved by replacing it with character

+// references.

+//

+// Invalid XML characters in str, if any, are stripped from the output.

+// It is expected that most, if not all, of the text processed by this

+// module will consist of ordinary English text.

+// If this module is ever modified to produce version 1.1 XML output,

+// most invalid characters can be retained using character references.

+// TODO(wan): It might be nice to have a minimally invasive, human-readable

+// escaping scheme for invalid characters, rather than dropping them.

+std::string XmlUnitTestResultPrinter::EscapeXml(

+    const std::string& str, bool is_attribute) {

+  Message m;

+

+  for (size_t i = 0; i < str.size(); ++i) {

+    const char ch = str[i];

+    switch (ch) {

+      case '<':

+        m << "&lt;";

+        break;

+      case '>':

+        m << "&gt;";

+        break;

+      case '&':

+        m << "&amp;";

+        break;

+      case '\'':

+        if (is_attribute)

+          m << "&apos;";

+        else

+          m << '\'';

+        break;

+      case '"':

+        if (is_attribute)

+          m << "&quot;";

+        else

+          m << '"';

+        break;

+      default:

+        if (IsValidXmlCharacter(ch)) {

+          if (is_attribute && IsNormalizableWhitespace(ch))

+            m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))

+              << ";";

+          else

+            m << ch;

+        }

+        break;

+    }

+  }

+

+  return m.GetString();

+}

+

+// Returns the given string with all characters invalid in XML removed.

+// Currently invalid characters are dropped from the string. An

+// alternative is to replace them with certain characters such as . or ?.

+std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(

+    const std::string& str) {

+  std::string output;

+  output.reserve(str.size());

+  for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)

+    if (IsValidXmlCharacter(*it))

+      output.push_back(*it);

+

+  return output;

+}

+

+// The following routines generate an XML representation of a UnitTest

+// object.

+//

+// This is how Google Test concepts map to the DTD:

+//

+// <testsuites name="AllTests">        <-- corresponds to a UnitTest object

+//   <testsuite name="testcase-name">  <-- corresponds to a TestCase object

+//     <testcase name="test-name">     <-- corresponds to a TestInfo object

+//       <failure message="...">...</failure>

+//       <failure message="...">...</failure>

+//       <failure message="...">...</failure>

+//                                     <-- individual assertion failures

+//     </testcase>

+//   </testsuite>

+// </testsuites>

+

+// Formats the given time in milliseconds as seconds.

+std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {

+  ::std::stringstream ss;

+  ss << ms/1000.0;

+  return ss.str();

+}

+

+// Converts the given epoch time in milliseconds to a date string in the ISO

+// 8601 format, without the timezone information.

+std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {

+  // Using non-reentrant version as localtime_r is not portable.

+  time_t seconds = static_cast<time_t>(ms / 1000);

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4996)  // Temporarily disables warning 4996

+                                // (function or variable may be unsafe).

+  const struct tm* const time_struct = localtime(&seconds);  // NOLINT

+# pragma warning(pop)           // Restores the warning state again.

+#else

+  const struct tm* const time_struct = localtime(&seconds);  // NOLINT

+#endif

+  if (time_struct == NULL)

+    return "";  // Invalid ms value

+

+  // YYYY-MM-DDThh:mm:ss

+  return StreamableToString(time_struct->tm_year + 1900) + "-" +

+      String::FormatIntWidth2(time_struct->tm_mon + 1) + "-" +

+      String::FormatIntWidth2(time_struct->tm_mday) + "T" +

+      String::FormatIntWidth2(time_struct->tm_hour) + ":" +

+      String::FormatIntWidth2(time_struct->tm_min) + ":" +

+      String::FormatIntWidth2(time_struct->tm_sec);

+}

+

+// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.

+void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,

+                                                     const char* data) {

+  const char* segment = data;

+  *stream << "<![CDATA[";

+  for (;;) {

+    const char* const next_segment = strstr(segment, "]]>");

+    if (next_segment != NULL) {

+      stream->write(

+          segment, static_cast<std::streamsize>(next_segment - segment));

+      *stream << "]]>]]&gt;<![CDATA[";

+      segment = next_segment + strlen("]]>");

+    } else {

+      *stream << segment;

+      break;

+    }

+  }

+  *stream << "]]>";

+}

+

+void XmlUnitTestResultPrinter::OutputXmlAttribute(

+    std::ostream* stream,

+    const std::string& element_name,

+    const std::string& name,

+    const std::string& value) {

+  const std::vector<std::string>& allowed_names =

+      GetReservedAttributesForElement(element_name);

+

+  GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=

+                   allowed_names.end())

+      << "Attribute " << name << " is not allowed for element <" << element_name

+      << ">.";

+

+  *stream << " " << name << "=\"" << EscapeXmlAttribute(value) << "\"";

+}

+

+// Prints an XML representation of a TestInfo object.

+// TODO(wan): There is also value in printing properties with the plain printer.

+void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,

+                                                 const char* test_case_name,

+                                                 const TestInfo& test_info) {

+  const TestResult& result = *test_info.result();

+  const std::string kTestcase = "testcase";

+

+  *stream << "    <testcase";

+  OutputXmlAttribute(stream, kTestcase, "name", test_info.name());

+

+  if (test_info.value_param() != NULL) {

+    OutputXmlAttribute(stream, kTestcase, "value_param",

+                       test_info.value_param());

+  }

+  if (test_info.type_param() != NULL) {

+    OutputXmlAttribute(stream, kTestcase, "type_param", test_info.type_param());

+  }

+

+  OutputXmlAttribute(stream, kTestcase, "status",

+                     test_info.should_run() ? "run" : "notrun");

+  OutputXmlAttribute(stream, kTestcase, "time",

+                     FormatTimeInMillisAsSeconds(result.elapsed_time()));

+  OutputXmlAttribute(stream, kTestcase, "classname", test_case_name);

+  *stream << TestPropertiesAsXmlAttributes(result);

+

+  int failures = 0;

+  for (int i = 0; i < result.total_part_count(); ++i) {

+    const TestPartResult& part = result.GetTestPartResult(i);

+    if (part.failed()) {

+      if (++failures == 1) {

+        *stream << ">\n";

+      }

+      const string location = internal::FormatCompilerIndependentFileLocation(

+          part.file_name(), part.line_number());

+      const string summary = location + "\n" + part.summary();

+      *stream << "      <failure message=\""

+              << EscapeXmlAttribute(summary.c_str())

+              << "\" type=\"\">";

+      const string detail = location + "\n" + part.message();

+      OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());

+      *stream << "</failure>\n";

+    }

+  }

+

+  if (failures == 0)

+    *stream << " />\n";

+  else

+    *stream << "    </testcase>\n";

+}

+

+// Prints an XML representation of a TestCase object

+void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,

+                                                const TestCase& test_case) {

+  const std::string kTestsuite = "testsuite";

+  *stream << "  <" << kTestsuite;

+  OutputXmlAttribute(stream, kTestsuite, "name", test_case.name());

+  OutputXmlAttribute(stream, kTestsuite, "tests",

+                     StreamableToString(test_case.reportable_test_count()));

+  OutputXmlAttribute(stream, kTestsuite, "failures",

+                     StreamableToString(test_case.failed_test_count()));

+  OutputXmlAttribute(

+      stream, kTestsuite, "disabled",

+      StreamableToString(test_case.reportable_disabled_test_count()));

+  OutputXmlAttribute(stream, kTestsuite, "errors", "0");

+  OutputXmlAttribute(stream, kTestsuite, "time",

+                     FormatTimeInMillisAsSeconds(test_case.elapsed_time()));

+  *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result())

+          << ">\n";

+

+  for (int i = 0; i < test_case.total_test_count(); ++i) {

+    if (test_case.GetTestInfo(i)->is_reportable())

+      OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));

+  }

+  *stream << "  </" << kTestsuite << ">\n";

+}

+

+// Prints an XML summary of unit_test to output stream out.

+void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,

+                                                const UnitTest& unit_test) {

+  const std::string kTestsuites = "testsuites";

+

+  *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";

+  *stream << "<" << kTestsuites;

+

+  OutputXmlAttribute(stream, kTestsuites, "tests",

+                     StreamableToString(unit_test.reportable_test_count()));

+  OutputXmlAttribute(stream, kTestsuites, "failures",

+                     StreamableToString(unit_test.failed_test_count()));

+  OutputXmlAttribute(

+      stream, kTestsuites, "disabled",

+      StreamableToString(unit_test.reportable_disabled_test_count()));

+  OutputXmlAttribute(stream, kTestsuites, "errors", "0");

+  OutputXmlAttribute(

+      stream, kTestsuites, "timestamp",

+      FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()));

+  OutputXmlAttribute(stream, kTestsuites, "time",

+                     FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));

+

+  if (GTEST_FLAG(shuffle)) {

+    OutputXmlAttribute(stream, kTestsuites, "random_seed",

+                       StreamableToString(unit_test.random_seed()));

+  }

+

+  *stream << TestPropertiesAsXmlAttributes(unit_test.ad_hoc_test_result());

+

+  OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");

+  *stream << ">\n";

+

+  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {

+    if (unit_test.GetTestCase(i)->reportable_test_count() > 0)

+      PrintXmlTestCase(stream, *unit_test.GetTestCase(i));

+  }

+  *stream << "</" << kTestsuites << ">\n";

+}

+

+// Produces a string representing the test properties in a result as space

+// delimited XML attributes based on the property key="value" pairs.

+std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(

+    const TestResult& result) {

+  Message attributes;

+  for (int i = 0; i < result.test_property_count(); ++i) {

+    const TestProperty& property = result.GetTestProperty(i);

+    attributes << " " << property.key() << "="

+        << "\"" << EscapeXmlAttribute(property.value()) << "\"";

+  }

+  return attributes.GetString();

+}

+

+// End XmlUnitTestResultPrinter

+

+#if GTEST_CAN_STREAM_RESULTS_

+

+// Checks if str contains '=', '&', '%' or '\n' characters. If yes,

+// replaces them by "%xx" where xx is their hexadecimal value. For

+// example, replaces "=" with "%3D".  This algorithm is O(strlen(str))

+// in both time and space -- important as the input str may contain an

+// arbitrarily long test failure message and stack trace.

+string StreamingListener::UrlEncode(const char* str) {

+  string result;

+  result.reserve(strlen(str) + 1);

+  for (char ch = *str; ch != '\0'; ch = *++str) {

+    switch (ch) {

+      case '%':

+      case '=':

+      case '&':

+      case '\n':

+        result.append("%" + String::FormatByte(static_cast<unsigned char>(ch)));

+        break;

+      default:

+        result.push_back(ch);

+        break;

+    }

+  }

+  return result;

+}

+

+void StreamingListener::SocketWriter::MakeConnection() {

+  GTEST_CHECK_(sockfd_ == -1)

+      << "MakeConnection() can't be called when there is already a connection.";

+

+  addrinfo hints;

+  memset(&hints, 0, sizeof(hints));

+  hints.ai_family = AF_UNSPEC;    // To allow both IPv4 and IPv6 addresses.

+  hints.ai_socktype = SOCK_STREAM;

+  addrinfo* servinfo = NULL;

+

+  // Use the getaddrinfo() to get a linked list of IP addresses for

+  // the given host name.

+  const int error_num = getaddrinfo(

+      host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);

+  if (error_num != 0) {

+    GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: "

+                        << gai_strerror(error_num);

+  }

+

+  // Loop through all the results and connect to the first we can.

+  for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;

+       cur_addr = cur_addr->ai_next) {

+    sockfd_ = socket(

+        cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);

+    if (sockfd_ != -1) {

+      // Connect the client socket to the server socket.

+      if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {

+        close(sockfd_);

+        sockfd_ = -1;

+      }

+    }

+  }

+

+  freeaddrinfo(servinfo);  // all done with this structure

+

+  if (sockfd_ == -1) {

+    GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to "

+                        << host_name_ << ":" << port_num_;

+  }

+}

+

+// End of class Streaming Listener

+#endif  // GTEST_CAN_STREAM_RESULTS__

+

+// Class ScopedTrace

+

+// Pushes the given source file location and message onto a per-thread

+// trace stack maintained by Google Test.

+ScopedTrace::ScopedTrace(const char* file, int line, const Message& message)

+    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {

+  TraceInfo trace;

+  trace.file = file;

+  trace.line = line;

+  trace.message = message.GetString();

+

+  UnitTest::GetInstance()->PushGTestTrace(trace);

+}

+

+// Pops the info pushed by the c'tor.

+ScopedTrace::~ScopedTrace()

+    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {

+  UnitTest::GetInstance()->PopGTestTrace();

+}

+

+

+// class OsStackTraceGetter

+

+// Returns the current OS stack trace as an std::string.  Parameters:

+//

+//   max_depth  - the maximum number of stack frames to be included

+//                in the trace.

+//   skip_count - the number of top frames to be skipped; doesn't count

+//                against max_depth.

+//

+string OsStackTraceGetter::CurrentStackTrace(int /* max_depth */,

+                                             int /* skip_count */)

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+  return "";

+}

+

+void OsStackTraceGetter::UponLeavingGTest()

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+}

+

+const char* const

+OsStackTraceGetter::kElidedFramesMarker =

+    "... " GTEST_NAME_ " internal frames ...";

+

+// A helper class that creates the premature-exit file in its

+// constructor and deletes the file in its destructor.

+class ScopedPrematureExitFile {

+ public:

+  explicit ScopedPrematureExitFile(const char* premature_exit_filepath)

+      : premature_exit_filepath_(premature_exit_filepath) {

+    // If a path to the premature-exit file is specified...

+    if (premature_exit_filepath != NULL && *premature_exit_filepath != '\0') {

+      // create the file with a single "0" character in it.  I/O

+      // errors are ignored as there's nothing better we can do and we

+      // don't want to fail the test because of this.

+      FILE* pfile = posix::FOpen(premature_exit_filepath, "w");

+      fwrite("0", 1, 1, pfile);

+      fclose(pfile);

+    }

+  }

+

+  ~ScopedPrematureExitFile() {

+    if (premature_exit_filepath_ != NULL && *premature_exit_filepath_ != '\0') {

+      remove(premature_exit_filepath_);

+    }

+  }

+

+ private:

+  const char* const premature_exit_filepath_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile);

+};

+

+}  // namespace internal

+

+// class TestEventListeners

+

+TestEventListeners::TestEventListeners()

+    : repeater_(new internal::TestEventRepeater()),

+      default_result_printer_(NULL),

+      default_xml_generator_(NULL) {

+}

+

+TestEventListeners::~TestEventListeners() { delete repeater_; }

+

+// Returns the standard listener responsible for the default console

+// output.  Can be removed from the listeners list to shut down default

+// console output.  Note that removing this object from the listener list

+// with Release transfers its ownership to the user.

+void TestEventListeners::Append(TestEventListener* listener) {

+  repeater_->Append(listener);

+}

+

+// Removes the given event listener from the list and returns it.  It then

+// becomes the caller's responsibility to delete the listener. Returns

+// NULL if the listener is not found in the list.

+TestEventListener* TestEventListeners::Release(TestEventListener* listener) {

+  if (listener == default_result_printer_)

+    default_result_printer_ = NULL;

+  else if (listener == default_xml_generator_)

+    default_xml_generator_ = NULL;

+  return repeater_->Release(listener);

+}

+

+// Returns repeater that broadcasts the TestEventListener events to all

+// subscribers.

+TestEventListener* TestEventListeners::repeater() { return repeater_; }

+

+// Sets the default_result_printer attribute to the provided listener.

+// The listener is also added to the listener list and previous

+// default_result_printer is removed from it and deleted. The listener can

+// also be NULL in which case it will not be added to the list. Does

+// nothing if the previous and the current listener objects are the same.

+void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {

+  if (default_result_printer_ != listener) {

+    // It is an error to pass this method a listener that is already in the

+    // list.

+    delete Release(default_result_printer_);

+    default_result_printer_ = listener;

+    if (listener != NULL)

+      Append(listener);

+  }

+}

+

+// Sets the default_xml_generator attribute to the provided listener.  The

+// listener is also added to the listener list and previous

+// default_xml_generator is removed from it and deleted. The listener can

+// also be NULL in which case it will not be added to the list. Does

+// nothing if the previous and the current listener objects are the same.

+void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {

+  if (default_xml_generator_ != listener) {

+    // It is an error to pass this method a listener that is already in the

+    // list.

+    delete Release(default_xml_generator_);

+    default_xml_generator_ = listener;

+    if (listener != NULL)

+      Append(listener);

+  }

+}

+

+// Controls whether events will be forwarded by the repeater to the

+// listeners in the list.

+bool TestEventListeners::EventForwardingEnabled() const {

+  return repeater_->forwarding_enabled();

+}

+

+void TestEventListeners::SuppressEventForwarding() {

+  repeater_->set_forwarding_enabled(false);

+}

+

+// class UnitTest

+

+// Gets the singleton UnitTest object.  The first time this method is

+// called, a UnitTest object is constructed and returned.  Consecutive

+// calls will return the same object.

+//

+// We don't protect this under mutex_ as a user is not supposed to

+// call this before main() starts, from which point on the return

+// value will never change.

+UnitTest* UnitTest::GetInstance() {

+  // When compiled with MSVC 7.1 in optimized mode, destroying the

+  // UnitTest object upon exiting the program messes up the exit code,

+  // causing successful tests to appear failed.  We have to use a

+  // different implementation in this case to bypass the compiler bug.

+  // This implementation makes the compiler happy, at the cost of

+  // leaking the UnitTest object.

+

+  // CodeGear C++Builder insists on a public destructor for the

+  // default implementation.  Use this implementation to keep good OO

+  // design with private destructor.

+

+#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)

+  static UnitTest* const instance = new UnitTest;

+  return instance;

+#else

+  static UnitTest instance;

+  return &instance;

+#endif  // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)

+}

+

+// Gets the number of successful test cases.

+int UnitTest::successful_test_case_count() const {

+  return impl()->successful_test_case_count();

+}

+

+// Gets the number of failed test cases.

+int UnitTest::failed_test_case_count() const {

+  return impl()->failed_test_case_count();

+}

+

+// Gets the number of all test cases.

+int UnitTest::total_test_case_count() const {

+  return impl()->total_test_case_count();

+}

+

+// Gets the number of all test cases that contain at least one test

+// that should run.

+int UnitTest::test_case_to_run_count() const {

+  return impl()->test_case_to_run_count();

+}

+

+// Gets the number of successful tests.

+int UnitTest::successful_test_count() const {

+  return impl()->successful_test_count();

+}

+

+// Gets the number of failed tests.

+int UnitTest::failed_test_count() const { return impl()->failed_test_count(); }

+

+// Gets the number of disabled tests that will be reported in the XML report.

+int UnitTest::reportable_disabled_test_count() const {

+  return impl()->reportable_disabled_test_count();

+}

+

+// Gets the number of disabled tests.

+int UnitTest::disabled_test_count() const {

+  return impl()->disabled_test_count();

+}

+

+// Gets the number of tests to be printed in the XML report.

+int UnitTest::reportable_test_count() const {

+  return impl()->reportable_test_count();

+}

+

+// Gets the number of all tests.

+int UnitTest::total_test_count() const { return impl()->total_test_count(); }

+

+// Gets the number of tests that should run.

+int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }

+

+// Gets the time of the test program start, in ms from the start of the

+// UNIX epoch.

+internal::TimeInMillis UnitTest::start_timestamp() const {

+    return impl()->start_timestamp();

+}

+

+// Gets the elapsed time, in milliseconds.

+internal::TimeInMillis UnitTest::elapsed_time() const {

+  return impl()->elapsed_time();

+}

+

+// Returns true iff the unit test passed (i.e. all test cases passed).

+bool UnitTest::Passed() const { return impl()->Passed(); }

+

+// Returns true iff the unit test failed (i.e. some test case failed

+// or something outside of all tests failed).

+bool UnitTest::Failed() const { return impl()->Failed(); }

+

+// Gets the i-th test case among all the test cases. i can range from 0 to

+// total_test_case_count() - 1. If i is not in that range, returns NULL.

+const TestCase* UnitTest::GetTestCase(int i) const {

+  return impl()->GetTestCase(i);

+}

+

+// Returns the TestResult containing information on test failures and

+// properties logged outside of individual test cases.

+const TestResult& UnitTest::ad_hoc_test_result() const {

+  return *impl()->ad_hoc_test_result();

+}

+

+// Gets the i-th test case among all the test cases. i can range from 0 to

+// total_test_case_count() - 1. If i is not in that range, returns NULL.

+TestCase* UnitTest::GetMutableTestCase(int i) {

+  return impl()->GetMutableTestCase(i);

+}

+

+// Returns the list of event listeners that can be used to track events

+// inside Google Test.

+TestEventListeners& UnitTest::listeners() {

+  return *impl()->listeners();

+}

+

+// Registers and returns a global test environment.  When a test

+// program is run, all global test environments will be set-up in the

+// order they were registered.  After all tests in the program have

+// finished, all global test environments will be torn-down in the

+// *reverse* order they were registered.

+//

+// The UnitTest object takes ownership of the given environment.

+//

+// We don't protect this under mutex_, as we only support calling it

+// from the main thread.

+Environment* UnitTest::AddEnvironment(Environment* env) {

+  if (env == NULL) {

+    return NULL;

+  }

+

+  impl_->environments().push_back(env);

+  return env;

+}

+

+// Adds a TestPartResult to the current TestResult object.  All Google Test

+// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call

+// this to report their results.  The user code should use the

+// assertion macros instead of calling this directly.

+void UnitTest::AddTestPartResult(

+    TestPartResult::Type result_type,

+    const char* file_name,

+    int line_number,

+    const std::string& message,

+    const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {

+  Message msg;

+  msg << message;

+

+  internal::MutexLock lock(&mutex_);

+  if (impl_->gtest_trace_stack().size() > 0) {

+    msg << "\n" << GTEST_NAME_ << " trace:";

+

+    for (int i = static_cast<int>(impl_->gtest_trace_stack().size());

+         i > 0; --i) {

+      const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];

+      msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)

+          << " " << trace.message;

+    }

+  }

+

+  if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {

+    msg << internal::kStackTraceMarker << os_stack_trace;

+  }

+

+  const TestPartResult result =

+    TestPartResult(result_type, file_name, line_number,

+                   msg.GetString().c_str());

+  impl_->GetTestPartResultReporterForCurrentThread()->

+      ReportTestPartResult(result);

+

+  if (result_type != TestPartResult::kSuccess) {

+    // gtest_break_on_failure takes precedence over

+    // gtest_throw_on_failure.  This allows a user to set the latter

+    // in the code (perhaps in order to use Google Test assertions

+    // with another testing framework) and specify the former on the

+    // command line for debugging.

+    if (GTEST_FLAG(break_on_failure)) {

+#if GTEST_OS_WINDOWS

+      // Using DebugBreak on Windows allows gtest to still break into a debugger

+      // when a failure happens and both the --gtest_break_on_failure and

+      // the --gtest_catch_exceptions flags are specified.

+      DebugBreak();

+#else

+      // Dereference NULL through a volatile pointer to prevent the compiler

+      // from removing. We use this rather than abort() or __builtin_trap() for

+      // portability: Symbian doesn't implement abort() well, and some debuggers

+      // don't correctly trap abort().

+      *static_cast<volatile int*>(NULL) = 1;

+#endif  // GTEST_OS_WINDOWS

+    } else if (GTEST_FLAG(throw_on_failure)) {

+#if GTEST_HAS_EXCEPTIONS

+      throw internal::GoogleTestFailureException(result);

+#else

+      // We cannot call abort() as it generates a pop-up in debug mode

+      // that cannot be suppressed in VC 7.1 or below.

+      exit(1);

+#endif

+    }

+  }

+}

+

+// Adds a TestProperty to the current TestResult object when invoked from

+// inside a test, to current TestCase's ad_hoc_test_result_ when invoked

+// from SetUpTestCase or TearDownTestCase, or to the global property set

+// when invoked elsewhere.  If the result already contains a property with

+// the same key, the value will be updated.

+void UnitTest::RecordProperty(const std::string& key,

+                              const std::string& value) {

+  impl_->RecordProperty(TestProperty(key, value));

+}

+

+// Runs all tests in this UnitTest object and prints the result.

+// Returns 0 if successful, or 1 otherwise.

+//

+// We don't protect this under mutex_, as we only support calling it

+// from the main thread.

+int UnitTest::Run() {

+  const bool in_death_test_child_process =

+      internal::GTEST_FLAG(internal_run_death_test).length() > 0;

+

+  // Google Test implements this protocol for catching that a test

+  // program exits before returning control to Google Test:

+  //

+  //   1. Upon start, Google Test creates a file whose absolute path

+  //      is specified by the environment variable

+  //      TEST_PREMATURE_EXIT_FILE.

+  //   2. When Google Test has finished its work, it deletes the file.

+  //

+  // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before

+  // running a Google-Test-based test program and check the existence

+  // of the file at the end of the test execution to see if it has

+  // exited prematurely.

+

+  // If we are in the child process of a death test, don't

+  // create/delete the premature exit file, as doing so is unnecessary

+  // and will confuse the parent process.  Otherwise, create/delete

+  // the file upon entering/leaving this function.  If the program

+  // somehow exits before this function has a chance to return, the

+  // premature-exit file will be left undeleted, causing a test runner

+  // that understands the premature-exit-file protocol to report the

+  // test as having failed.

+  const internal::ScopedPrematureExitFile premature_exit_file(

+      in_death_test_child_process ?

+      NULL : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));

+

+  // Captures the value of GTEST_FLAG(catch_exceptions).  This value will be

+  // used for the duration of the program.

+  impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions));

+

+#if GTEST_HAS_SEH

+  // Either the user wants Google Test to catch exceptions thrown by the

+  // tests or this is executing in the context of death test child

+  // process. In either case the user does not want to see pop-up dialogs

+  // about crashes - they are expected.

+  if (impl()->catch_exceptions() || in_death_test_child_process) {

+# if !GTEST_OS_WINDOWS_MOBILE

+    // SetErrorMode doesn't exist on CE.

+    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |

+                 SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);

+# endif  // !GTEST_OS_WINDOWS_MOBILE

+

+# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE

+    // Death test children can be terminated with _abort().  On Windows,

+    // _abort() can show a dialog with a warning message.  This forces the

+    // abort message to go to stderr instead.

+    _set_error_mode(_OUT_TO_STDERR);

+# endif

+

+# if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE

+    // In the debug version, Visual Studio pops up a separate dialog

+    // offering a choice to debug the aborted program. We need to suppress

+    // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement

+    // executed. Google Test will notify the user of any unexpected

+    // failure via stderr.

+    //

+    // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.

+    // Users of prior VC versions shall suffer the agony and pain of

+    // clicking through the countless debug dialogs.

+    // TODO(vladl@google.com): find a way to suppress the abort dialog() in the

+    // debug mode when compiled with VC 7.1 or lower.

+    if (!GTEST_FLAG(break_on_failure))

+      _set_abort_behavior(

+          0x0,                                    // Clear the following flags:

+          _WRITE_ABORT_MSG | _CALL_REPORTFAULT);  // pop-up window, core dump.

+# endif

+  }

+#endif  // GTEST_HAS_SEH

+

+  return internal::HandleExceptionsInMethodIfSupported(

+      impl(),

+      &internal::UnitTestImpl::RunAllTests,

+      "auxiliary test code (environments or event listeners)") ? 0 : 1;

+}

+

+// Returns the working directory when the first TEST() or TEST_F() was

+// executed.

+const char* UnitTest::original_working_dir() const {

+  return impl_->original_working_dir_.c_str();

+}

+

+// Returns the TestCase object for the test that's currently running,

+// or NULL if no test is running.

+const TestCase* UnitTest::current_test_case() const

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+  internal::MutexLock lock(&mutex_);

+  return impl_->current_test_case();

+}

+

+// Returns the TestInfo object for the test that's currently running,

+// or NULL if no test is running.

+const TestInfo* UnitTest::current_test_info() const

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+  internal::MutexLock lock(&mutex_);

+  return impl_->current_test_info();

+}

+

+// Returns the random seed used at the start of the current test run.

+int UnitTest::random_seed() const { return impl_->random_seed(); }

+

+#if GTEST_HAS_PARAM_TEST

+// Returns ParameterizedTestCaseRegistry object used to keep track of

+// value-parameterized tests and instantiate and register them.

+internal::ParameterizedTestCaseRegistry&

+    UnitTest::parameterized_test_registry()

+        GTEST_LOCK_EXCLUDED_(mutex_) {

+  return impl_->parameterized_test_registry();

+}

+#endif  // GTEST_HAS_PARAM_TEST

+

+// Creates an empty UnitTest.

+UnitTest::UnitTest() {

+  impl_ = new internal::UnitTestImpl(this);

+}

+

+// Destructor of UnitTest.

+UnitTest::~UnitTest() {

+  delete impl_;

+}

+

+// Pushes a trace defined by SCOPED_TRACE() on to the per-thread

+// Google Test trace stack.

+void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+  internal::MutexLock lock(&mutex_);

+  impl_->gtest_trace_stack().push_back(trace);

+}

+

+// Pops a trace from the per-thread Google Test trace stack.

+void UnitTest::PopGTestTrace()

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+  internal::MutexLock lock(&mutex_);

+  impl_->gtest_trace_stack().pop_back();

+}

+

+namespace internal {

+

+UnitTestImpl::UnitTestImpl(UnitTest* parent)

+    : parent_(parent),

+#ifdef _MSC_VER

+# pragma warning(push)                    // Saves the current warning state.

+# pragma warning(disable:4355)            // Temporarily disables warning 4355

+                                         // (using this in initializer).

+      default_global_test_part_result_reporter_(this),

+      default_per_thread_test_part_result_reporter_(this),

+# pragma warning(pop)                     // Restores the warning state again.

+#else

+      default_global_test_part_result_reporter_(this),

+      default_per_thread_test_part_result_reporter_(this),

+#endif  // _MSC_VER

+      global_test_part_result_repoter_(

+          &default_global_test_part_result_reporter_),

+      per_thread_test_part_result_reporter_(

+          &default_per_thread_test_part_result_reporter_),

+#if GTEST_HAS_PARAM_TEST

+      parameterized_test_registry_(),

+      parameterized_tests_registered_(false),

+#endif  // GTEST_HAS_PARAM_TEST

+      last_death_test_case_(-1),

+      current_test_case_(NULL),

+      current_test_info_(NULL),

+      ad_hoc_test_result_(),

+      os_stack_trace_getter_(NULL),

+      post_flag_parse_init_performed_(false),

+      random_seed_(0),  // Will be overridden by the flag before first use.

+      random_(0),  // Will be reseeded before first use.

+      start_timestamp_(0),

+      elapsed_time_(0),

+#if GTEST_HAS_DEATH_TEST

+      death_test_factory_(new DefaultDeathTestFactory),

+#endif

+      // Will be overridden by the flag before first use.

+      catch_exceptions_(false) {

+  listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);

+}

+

+UnitTestImpl::~UnitTestImpl() {

+  // Deletes every TestCase.

+  ForEach(test_cases_, internal::Delete<TestCase>);

+

+  // Deletes every Environment.

+  ForEach(environments_, internal::Delete<Environment>);

+

+  delete os_stack_trace_getter_;

+}

+

+// Adds a TestProperty to the current TestResult object when invoked in a

+// context of a test, to current test case's ad_hoc_test_result when invoke

+// from SetUpTestCase/TearDownTestCase, or to the global property set

+// otherwise.  If the result already contains a property with the same key,

+// the value will be updated.

+void UnitTestImpl::RecordProperty(const TestProperty& test_property) {

+  std::string xml_element;

+  TestResult* test_result;  // TestResult appropriate for property recording.

+

+  if (current_test_info_ != NULL) {

+    xml_element = "testcase";

+    test_result = &(current_test_info_->result_);

+  } else if (current_test_case_ != NULL) {

+    xml_element = "testsuite";

+    test_result = &(current_test_case_->ad_hoc_test_result_);

+  } else {

+    xml_element = "testsuites";

+    test_result = &ad_hoc_test_result_;

+  }

+  test_result->RecordProperty(xml_element, test_property);

+}

+

+#if GTEST_HAS_DEATH_TEST

+// Disables event forwarding if the control is currently in a death test

+// subprocess. Must not be called before InitGoogleTest.

+void UnitTestImpl::SuppressTestEventsIfInSubprocess() {

+  if (internal_run_death_test_flag_.get() != NULL)

+    listeners()->SuppressEventForwarding();

+}

+#endif  // GTEST_HAS_DEATH_TEST

+

+// Initializes event listeners performing XML output as specified by

+// UnitTestOptions. Must not be called before InitGoogleTest.

+void UnitTestImpl::ConfigureXmlOutput() {

+  const std::string& output_format = UnitTestOptions::GetOutputFormat();

+  if (output_format == "xml") {

+    listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(

+        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));

+  } else if (output_format != "") {

+    printf("WARNING: unrecognized output format \"%s\" ignored.\n",

+           output_format.c_str());

+    fflush(stdout);

+  }

+}

+

+#if GTEST_CAN_STREAM_RESULTS_

+// Initializes event listeners for streaming test results in string form.

+// Must not be called before InitGoogleTest.

+void UnitTestImpl::ConfigureStreamingOutput() {

+  const std::string& target = GTEST_FLAG(stream_result_to);

+  if (!target.empty()) {

+    const size_t pos = target.find(':');

+    if (pos != std::string::npos) {

+      listeners()->Append(new StreamingListener(target.substr(0, pos),

+                                                target.substr(pos+1)));

+    } else {

+      printf("WARNING: unrecognized streaming target \"%s\" ignored.\n",

+             target.c_str());

+      fflush(stdout);

+    }

+  }

+}

+#endif  // GTEST_CAN_STREAM_RESULTS_

+

+// Performs initialization dependent upon flag values obtained in

+// ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to

+// ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest

+// this function is also called from RunAllTests.  Since this function can be

+// called more than once, it has to be idempotent.

+void UnitTestImpl::PostFlagParsingInit() {

+  // Ensures that this function does not execute more than once.

+  if (!post_flag_parse_init_performed_) {

+    post_flag_parse_init_performed_ = true;

+

+#if GTEST_HAS_DEATH_TEST

+    InitDeathTestSubprocessControlInfo();

+    SuppressTestEventsIfInSubprocess();

+#endif  // GTEST_HAS_DEATH_TEST

+

+    // Registers parameterized tests. This makes parameterized tests

+    // available to the UnitTest reflection API without running

+    // RUN_ALL_TESTS.

+    RegisterParameterizedTests();

+

+    // Configures listeners for XML output. This makes it possible for users

+    // to shut down the default XML output before invoking RUN_ALL_TESTS.

+    ConfigureXmlOutput();

+

+#if GTEST_CAN_STREAM_RESULTS_

+    // Configures listeners for streaming test results to the specified server.

+    ConfigureStreamingOutput();

+#endif  // GTEST_CAN_STREAM_RESULTS_

+  }

+}

+

+// A predicate that checks the name of a TestCase against a known

+// value.

+//

+// This is used for implementation of the UnitTest class only.  We put

+// it in the anonymous namespace to prevent polluting the outer

+// namespace.

+//

+// TestCaseNameIs is copyable.

+class TestCaseNameIs {

+ public:

+  // Constructor.

+  explicit TestCaseNameIs(const std::string& name)

+      : name_(name) {}

+

+  // Returns true iff the name of test_case matches name_.

+  bool operator()(const TestCase* test_case) const {

+    return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;

+  }

+

+ private:

+  std::string name_;

+};

+

+// Finds and returns a TestCase with the given name.  If one doesn't

+// exist, creates one and returns it.  It's the CALLER'S

+// RESPONSIBILITY to ensure that this function is only called WHEN THE

+// TESTS ARE NOT SHUFFLED.

+//

+// Arguments:

+//

+//   test_case_name: name of the test case

+//   type_param:     the name of the test case's type parameter, or NULL if

+//                   this is not a typed or a type-parameterized test case.

+//   set_up_tc:      pointer to the function that sets up the test case

+//   tear_down_tc:   pointer to the function that tears down the test case

+TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,

+                                    const char* type_param,

+                                    Test::SetUpTestCaseFunc set_up_tc,

+                                    Test::TearDownTestCaseFunc tear_down_tc) {

+  // Can we find a TestCase with the given name?

+  const std::vector<TestCase*>::const_iterator test_case =

+      std::find_if(test_cases_.begin(), test_cases_.end(),

+                   TestCaseNameIs(test_case_name));

+

+  if (test_case != test_cases_.end())

+    return *test_case;

+

+  // No.  Let's create one.

+  TestCase* const new_test_case =

+      new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc);

+

+  // Is this a death test case?

+  if (internal::UnitTestOptions::MatchesFilter(test_case_name,

+                                               kDeathTestCaseFilter)) {

+    // Yes.  Inserts the test case after the last death test case

+    // defined so far.  This only works when the test cases haven't

+    // been shuffled.  Otherwise we may end up running a death test

+    // after a non-death test.

+    ++last_death_test_case_;

+    test_cases_.insert(test_cases_.begin() + last_death_test_case_,

+                       new_test_case);

+  } else {

+    // No.  Appends to the end of the list.

+    test_cases_.push_back(new_test_case);

+  }

+

+  test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));

+  return new_test_case;

+}

+

+// Helpers for setting up / tearing down the given environment.  They

+// are for use in the ForEach() function.

+static void SetUpEnvironment(Environment* env) { env->SetUp(); }

+static void TearDownEnvironment(Environment* env) { env->TearDown(); }

+

+// Runs all tests in this UnitTest object, prints the result, and

+// returns true if all tests are successful.  If any exception is

+// thrown during a test, the test is considered to be failed, but the

+// rest of the tests will still be run.

+//

+// When parameterized tests are enabled, it expands and registers

+// parameterized tests first in RegisterParameterizedTests().

+// All other functions called from RunAllTests() may safely assume that

+// parameterized tests are ready to be counted and run.

+bool UnitTestImpl::RunAllTests() {

+  // Makes sure InitGoogleTest() was called.

+  if (!GTestIsInitialized()) {

+    printf("%s",

+           "\nThis test program did NOT call ::testing::InitGoogleTest "

+           "before calling RUN_ALL_TESTS().  Please fix it.\n");

+    return false;

+  }

+

+  // Do not run any test if the --help flag was specified.

+  if (g_help_flag)

+    return true;

+

+  // Repeats the call to the post-flag parsing initialization in case the

+  // user didn't call InitGoogleTest.

+  PostFlagParsingInit();

+

+  // Even if sharding is not on, test runners may want to use the

+  // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding

+  // protocol.

+  internal::WriteToShardStatusFileIfNeeded();

+

+  // True iff we are in a subprocess for running a thread-safe-style

+  // death test.

+  bool in_subprocess_for_death_test = false;

+

+#if GTEST_HAS_DEATH_TEST

+  in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);

+#endif  // GTEST_HAS_DEATH_TEST

+

+  const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,

+                                        in_subprocess_for_death_test);

+

+  // Compares the full test names with the filter to decide which

+  // tests to run.

+  const bool has_tests_to_run = FilterTests(should_shard

+                                              ? HONOR_SHARDING_PROTOCOL

+                                              : IGNORE_SHARDING_PROTOCOL) > 0;

+

+  // Lists the tests and exits if the --gtest_list_tests flag was specified.

+  if (GTEST_FLAG(list_tests)) {

+    // This must be called *after* FilterTests() has been called.

+    ListTestsMatchingFilter();

+    return true;

+  }

+

+  random_seed_ = GTEST_FLAG(shuffle) ?

+      GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;

+

+  // True iff at least one test has failed.

+  bool failed = false;

+

+  TestEventListener* repeater = listeners()->repeater();

+

+  start_timestamp_ = GetTimeInMillis();

+  repeater->OnTestProgramStart(*parent_);

+

+  // How many times to repeat the tests?  We don't want to repeat them

+  // when we are inside the subprocess of a death test.

+  const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);

+  // Repeats forever if the repeat count is negative.

+  const bool forever = repeat < 0;

+  for (int i = 0; forever || i != repeat; i++) {

+    // We want to preserve failures generated by ad-hoc test

+    // assertions executed before RUN_ALL_TESTS().

+    ClearNonAdHocTestResult();

+

+    const TimeInMillis start = GetTimeInMillis();

+

+    // Shuffles test cases and tests if requested.

+    if (has_tests_to_run && GTEST_FLAG(shuffle)) {

+      random()->Reseed(random_seed_);

+      // This should be done before calling OnTestIterationStart(),

+      // such that a test event listener can see the actual test order

+      // in the event.

+      ShuffleTests();

+    }

+

+    // Tells the unit test event listeners that the tests are about to start.

+    repeater->OnTestIterationStart(*parent_, i);

+

+    // Runs each test case if there is at least one test to run.

+    if (has_tests_to_run) {

+      // Sets up all environments beforehand.

+      repeater->OnEnvironmentsSetUpStart(*parent_);

+      ForEach(environments_, SetUpEnvironment);

+      repeater->OnEnvironmentsSetUpEnd(*parent_);

+

+      // Runs the tests only if there was no fatal failure during global

+      // set-up.

+      if (!Test::HasFatalFailure()) {

+        for (int test_index = 0; test_index < total_test_case_count();

+             test_index++) {

+          GetMutableTestCase(test_index)->Run();

+        }

+      }

+

+      // Tears down all environments in reverse order afterwards.

+      repeater->OnEnvironmentsTearDownStart(*parent_);

+      std::for_each(environments_.rbegin(), environments_.rend(),

+                    TearDownEnvironment);

+      repeater->OnEnvironmentsTearDownEnd(*parent_);

+    }

+

+    elapsed_time_ = GetTimeInMillis() - start;

+

+    // Tells the unit test event listener that the tests have just finished.

+    repeater->OnTestIterationEnd(*parent_, i);

+

+    // Gets the result and clears it.

+    if (!Passed()) {

+      failed = true;

+    }

+

+    // Restores the original test order after the iteration.  This

+    // allows the user to quickly repro a failure that happens in the

+    // N-th iteration without repeating the first (N - 1) iterations.

+    // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in

+    // case the user somehow changes the value of the flag somewhere

+    // (it's always safe to unshuffle the tests).

+    UnshuffleTests();

+

+    if (GTEST_FLAG(shuffle)) {

+      // Picks a new random seed for each iteration.

+      random_seed_ = GetNextRandomSeed(random_seed_);

+    }

+  }

+

+  repeater->OnTestProgramEnd(*parent_);

+

+  return !failed;

+}

+

+// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file

+// if the variable is present. If a file already exists at this location, this

+// function will write over it. If the variable is present, but the file cannot

+// be created, prints an error and exits.

+void WriteToShardStatusFileIfNeeded() {

+  const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);

+  if (test_shard_file != NULL) {

+    FILE* const file = posix::FOpen(test_shard_file, "w");

+    if (file == NULL) {

+      ColoredPrintf(COLOR_RED,

+                    "Could not write to the test shard status file \"%s\" "

+                    "specified by the %s environment variable.\n",

+                    test_shard_file, kTestShardStatusFile);

+      fflush(stdout);

+      exit(EXIT_FAILURE);

+    }

+    fclose(file);

+  }

+}

+

+// Checks whether sharding is enabled by examining the relevant

+// environment variable values. If the variables are present,

+// but inconsistent (i.e., shard_index >= total_shards), prints

+// an error and exits. If in_subprocess_for_death_test, sharding is

+// disabled because it must only be applied to the original test

+// process. Otherwise, we could filter out death tests we intended to execute.

+bool ShouldShard(const char* total_shards_env,

+                 const char* shard_index_env,

+                 bool in_subprocess_for_death_test) {

+  if (in_subprocess_for_death_test) {

+    return false;

+  }

+

+  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);

+  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);

+

+  if (total_shards == -1 && shard_index == -1) {

+    return false;

+  } else if (total_shards == -1 && shard_index != -1) {

+    const Message msg = Message()

+      << "Invalid environment variables: you have "

+      << kTestShardIndex << " = " << shard_index

+      << ", but have left " << kTestTotalShards << " unset.\n";

+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());

+    fflush(stdout);

+    exit(EXIT_FAILURE);

+  } else if (total_shards != -1 && shard_index == -1) {

+    const Message msg = Message()

+      << "Invalid environment variables: you have "

+      << kTestTotalShards << " = " << total_shards

+      << ", but have left " << kTestShardIndex << " unset.\n";

+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());

+    fflush(stdout);

+    exit(EXIT_FAILURE);

+  } else if (shard_index < 0 || shard_index >= total_shards) {

+    const Message msg = Message()

+      << "Invalid environment variables: we require 0 <= "

+      << kTestShardIndex << " < " << kTestTotalShards

+      << ", but you have " << kTestShardIndex << "=" << shard_index

+      << ", " << kTestTotalShards << "=" << total_shards << ".\n";

+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());

+    fflush(stdout);

+    exit(EXIT_FAILURE);

+  }

+

+  return total_shards > 1;

+}

+

+// Parses the environment variable var as an Int32. If it is unset,

+// returns default_val. If it is not an Int32, prints an error

+// and aborts.

+Int32 Int32FromEnvOrDie(const char* var, Int32 default_val) {

+  const char* str_val = posix::GetEnv(var);

+  if (str_val == NULL) {

+    return default_val;

+  }

+

+  Int32 result;

+  if (!ParseInt32(Message() << "The value of environment variable " << var,

+                  str_val, &result)) {

+    exit(EXIT_FAILURE);

+  }

+  return result;

+}

+

+// Given the total number of shards, the shard index, and the test id,

+// returns true iff the test should be run on this shard. The test id is

+// some arbitrary but unique non-negative integer assigned to each test

+// method. Assumes that 0 <= shard_index < total_shards.

+bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {

+  return (test_id % total_shards) == shard_index;

+}

+

+// Compares the name of each test with the user-specified filter to

+// decide whether the test should be run, then records the result in

+// each TestCase and TestInfo object.

+// If shard_tests == true, further filters tests based on sharding

+// variables in the environment - see

+// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide.

+// Returns the number of tests that should run.

+int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {

+  const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?

+      Int32FromEnvOrDie(kTestTotalShards, -1) : -1;

+  const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?

+      Int32FromEnvOrDie(kTestShardIndex, -1) : -1;

+

+  // num_runnable_tests are the number of tests that will

+  // run across all shards (i.e., match filter and are not disabled).

+  // num_selected_tests are the number of tests to be run on

+  // this shard.

+  int num_runnable_tests = 0;

+  int num_selected_tests = 0;

+  for (size_t i = 0; i < test_cases_.size(); i++) {

+    TestCase* const test_case = test_cases_[i];

+    const std::string &test_case_name = test_case->name();

+    test_case->set_should_run(false);

+

+    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {

+      TestInfo* const test_info = test_case->test_info_list()[j];

+      const std::string test_name(test_info->name());

+      // A test is disabled if test case name or test name matches

+      // kDisableTestFilter.

+      const bool is_disabled =

+          internal::UnitTestOptions::MatchesFilter(test_case_name,

+                                                   kDisableTestFilter) ||

+          internal::UnitTestOptions::MatchesFilter(test_name,

+                                                   kDisableTestFilter);

+      test_info->is_disabled_ = is_disabled;

+

+      const bool matches_filter =

+          internal::UnitTestOptions::FilterMatchesTest(test_case_name,

+                                                       test_name);

+      test_info->matches_filter_ = matches_filter;

+

+      const bool is_runnable =

+          (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) &&

+          matches_filter;

+

+      const bool is_selected = is_runnable &&

+          (shard_tests == IGNORE_SHARDING_PROTOCOL ||

+           ShouldRunTestOnShard(total_shards, shard_index,

+                                num_runnable_tests));

+

+      num_runnable_tests += is_runnable;

+      num_selected_tests += is_selected;

+

+      test_info->should_run_ = is_selected;

+      test_case->set_should_run(test_case->should_run() || is_selected);

+    }

+  }

+  return num_selected_tests;

+}

+

+// Prints the given C-string on a single line by replacing all '\n'

+// characters with string "\\n".  If the output takes more than

+// max_length characters, only prints the first max_length characters

+// and "...".

+static void PrintOnOneLine(const char* str, int max_length) {

+  if (str != NULL) {

+    for (int i = 0; *str != '\0'; ++str) {

+      if (i >= max_length) {

+        printf("...");

+        break;

+      }

+      if (*str == '\n') {

+        printf("\\n");

+        i += 2;

+      } else {

+        printf("%c", *str);

+        ++i;

+      }

+    }

+  }

+}

+

+// Prints the names of the tests matching the user-specified filter flag.

+void UnitTestImpl::ListTestsMatchingFilter() {

+  // Print at most this many characters for each type/value parameter.

+  const int kMaxParamLength = 250;

+

+  for (size_t i = 0; i < test_cases_.size(); i++) {

+    const TestCase* const test_case = test_cases_[i];

+    bool printed_test_case_name = false;

+

+    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {

+      const TestInfo* const test_info =

+          test_case->test_info_list()[j];

+      if (test_info->matches_filter_) {

+        if (!printed_test_case_name) {

+          printed_test_case_name = true;

+          printf("%s.", test_case->name());

+          if (test_case->type_param() != NULL) {

+            printf("  # %s = ", kTypeParamLabel);

+            // We print the type parameter on a single line to make

+            // the output easy to parse by a program.

+            PrintOnOneLine(test_case->type_param(), kMaxParamLength);

+          }

+          printf("\n");

+        }

+        printf("  %s", test_info->name());

+        if (test_info->value_param() != NULL) {

+          printf("  # %s = ", kValueParamLabel);

+          // We print the value parameter on a single line to make the

+          // output easy to parse by a program.

+          PrintOnOneLine(test_info->value_param(), kMaxParamLength);

+        }

+        printf("\n");

+      }

+    }

+  }

+  fflush(stdout);

+}

+

+// Sets the OS stack trace getter.

+//

+// Does nothing if the input and the current OS stack trace getter are

+// the same; otherwise, deletes the old getter and makes the input the

+// current getter.

+void UnitTestImpl::set_os_stack_trace_getter(

+    OsStackTraceGetterInterface* getter) {

+  if (os_stack_trace_getter_ != getter) {

+    delete os_stack_trace_getter_;

+    os_stack_trace_getter_ = getter;

+  }

+}

+

+// Returns the current OS stack trace getter if it is not NULL;

+// otherwise, creates an OsStackTraceGetter, makes it the current

+// getter, and returns it.

+OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {

+  if (os_stack_trace_getter_ == NULL) {

+    os_stack_trace_getter_ = new OsStackTraceGetter;

+  }

+

+  return os_stack_trace_getter_;

+}

+

+// Returns the TestResult for the test that's currently running, or

+// the TestResult for the ad hoc test if no test is running.

+TestResult* UnitTestImpl::current_test_result() {

+  return current_test_info_ ?

+      &(current_test_info_->result_) : &ad_hoc_test_result_;

+}

+

+// Shuffles all test cases, and the tests within each test case,

+// making sure that death tests are still run first.

+void UnitTestImpl::ShuffleTests() {

+  // Shuffles the death test cases.

+  ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);

+

+  // Shuffles the non-death test cases.

+  ShuffleRange(random(), last_death_test_case_ + 1,

+               static_cast<int>(test_cases_.size()), &test_case_indices_);

+

+  // Shuffles the tests inside each test case.

+  for (size_t i = 0; i < test_cases_.size(); i++) {

+    test_cases_[i]->ShuffleTests(random());

+  }

+}

+

+// Restores the test cases and tests to their order before the first shuffle.

+void UnitTestImpl::UnshuffleTests() {

+  for (size_t i = 0; i < test_cases_.size(); i++) {

+    // Unshuffles the tests in each test case.

+    test_cases_[i]->UnshuffleTests();

+    // Resets the index of each test case.

+    test_case_indices_[i] = static_cast<int>(i);

+  }

+}

+

+// Returns the current OS stack trace as an std::string.

+//

+// The maximum number of stack frames to be included is specified by

+// the gtest_stack_trace_depth flag.  The skip_count parameter

+// specifies the number of top frames to be skipped, which doesn't

+// count against the number of frames to be included.

+//

+// For example, if Foo() calls Bar(), which in turn calls

+// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in

+// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.

+std::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,

+                                            int skip_count) {

+  // We pass skip_count + 1 to skip this wrapper function in addition

+  // to what the user really wants to skip.

+  return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);

+}

+

+// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to

+// suppress unreachable code warnings.

+namespace {

+class ClassUniqueToAlwaysTrue {};

+}

+

+bool IsTrue(bool condition) { return condition; }

+

+bool AlwaysTrue() {

+#if GTEST_HAS_EXCEPTIONS

+  // This condition is always false so AlwaysTrue() never actually throws,

+  // but it makes the compiler think that it may throw.

+  if (IsTrue(false))

+    throw ClassUniqueToAlwaysTrue();

+#endif  // GTEST_HAS_EXCEPTIONS

+  return true;

+}

+

+// If *pstr starts with the given prefix, modifies *pstr to be right

+// past the prefix and returns true; otherwise leaves *pstr unchanged

+// and returns false.  None of pstr, *pstr, and prefix can be NULL.

+bool SkipPrefix(const char* prefix, const char** pstr) {

+  const size_t prefix_len = strlen(prefix);

+  if (strncmp(*pstr, prefix, prefix_len) == 0) {

+    *pstr += prefix_len;

+    return true;

+  }

+  return false;

+}

+

+// Parses a string as a command line flag.  The string should have

+// the format "--flag=value".  When def_optional is true, the "=value"

+// part can be omitted.

+//

+// Returns the value of the flag, or NULL if the parsing failed.

+const char* ParseFlagValue(const char* str,

+                           const char* flag,

+                           bool def_optional) {

+  // str and flag must not be NULL.

+  if (str == NULL || flag == NULL) return NULL;

+

+  // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.

+  const std::string flag_str = std::string("--") + GTEST_FLAG_PREFIX_ + flag;

+  const size_t flag_len = flag_str.length();

+  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;

+

+  // Skips the flag name.

+  const char* flag_end = str + flag_len;

+

+  // When def_optional is true, it's OK to not have a "=value" part.

+  if (def_optional && (flag_end[0] == '\0')) {

+    return flag_end;

+  }

+

+  // If def_optional is true and there are more characters after the

+  // flag name, or if def_optional is false, there must be a '=' after

+  // the flag name.

+  if (flag_end[0] != '=') return NULL;

+

+  // Returns the string after "=".

+  return flag_end + 1;

+}

+

+// Parses a string for a bool flag, in the form of either

+// "--flag=value" or "--flag".

+//

+// In the former case, the value is taken as true as long as it does

+// not start with '0', 'f', or 'F'.

+//

+// In the latter case, the value is taken as true.

+//

+// On success, stores the value of the flag in *value, and returns

+// true.  On failure, returns false without changing *value.

+bool ParseBoolFlag(const char* str, const char* flag, bool* value) {

+  // Gets the value of the flag as a string.

+  const char* const value_str = ParseFlagValue(str, flag, true);

+

+  // Aborts if the parsing failed.

+  if (value_str == NULL) return false;

+

+  // Converts the string value to a bool.

+  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');

+  return true;

+}

+

+// Parses a string for an Int32 flag, in the form of

+// "--flag=value".

+//

+// On success, stores the value of the flag in *value, and returns

+// true.  On failure, returns false without changing *value.

+bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {

+  // Gets the value of the flag as a string.

+  const char* const value_str = ParseFlagValue(str, flag, false);

+

+  // Aborts if the parsing failed.

+  if (value_str == NULL) return false;

+

+  // Sets *value to the value of the flag.

+  return ParseInt32(Message() << "The value of flag --" << flag,

+                    value_str, value);

+}

+

+// Parses a string for a string flag, in the form of

+// "--flag=value".

+//

+// On success, stores the value of the flag in *value, and returns

+// true.  On failure, returns false without changing *value.

+bool ParseStringFlag(const char* str, const char* flag, std::string* value) {

+  // Gets the value of the flag as a string.

+  const char* const value_str = ParseFlagValue(str, flag, false);

+

+  // Aborts if the parsing failed.

+  if (value_str == NULL) return false;

+

+  // Sets *value to the value of the flag.

+  *value = value_str;

+  return true;

+}

+

+// Determines whether a string has a prefix that Google Test uses for its

+// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.

+// If Google Test detects that a command line flag has its prefix but is not

+// recognized, it will print its help message. Flags starting with

+// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test

+// internal flags and do not trigger the help message.

+static bool HasGoogleTestFlagPrefix(const char* str) {

+  return (SkipPrefix("--", &str) ||

+          SkipPrefix("-", &str) ||

+          SkipPrefix("/", &str)) &&

+         !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&

+         (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||

+          SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));

+}

+

+// Prints a string containing code-encoded text.  The following escape

+// sequences can be used in the string to control the text color:

+//

+//   @@    prints a single '@' character.

+//   @R    changes the color to red.

+//   @G    changes the color to green.

+//   @Y    changes the color to yellow.

+//   @D    changes to the default terminal text color.

+//

+// TODO(wan@google.com): Write tests for this once we add stdout

+// capturing to Google Test.

+static void PrintColorEncoded(const char* str) {

+  GTestColor color = COLOR_DEFAULT;  // The current color.

+

+  // Conceptually, we split the string into segments divided by escape

+  // sequences.  Then we print one segment at a time.  At the end of

+  // each iteration, the str pointer advances to the beginning of the

+  // next segment.

+  for (;;) {

+    const char* p = strchr(str, '@');

+    if (p == NULL) {

+      ColoredPrintf(color, "%s", str);

+      return;

+    }

+

+    ColoredPrintf(color, "%s", std::string(str, p).c_str());

+

+    const char ch = p[1];

+    str = p + 2;

+    if (ch == '@') {

+      ColoredPrintf(color, "@");

+    } else if (ch == 'D') {

+      color = COLOR_DEFAULT;

+    } else if (ch == 'R') {

+      color = COLOR_RED;

+    } else if (ch == 'G') {

+      color = COLOR_GREEN;

+    } else if (ch == 'Y') {

+      color = COLOR_YELLOW;

+    } else {

+      --str;

+    }

+  }

+}

+

+static const char kColorEncodedHelpMessage[] =

+"This program contains tests written using " GTEST_NAME_ ". You can use the\n"

+"following command line flags to control its behavior:\n"

+"\n"

+"Test Selection:\n"

+"  @G--" GTEST_FLAG_PREFIX_ "list_tests@D\n"

+"      List the names of all tests instead of running them. The name of\n"

+"      TEST(Foo, Bar) is \"Foo.Bar\".\n"

+"  @G--" GTEST_FLAG_PREFIX_ "filter=@YPOSTIVE_PATTERNS"

+    "[@G-@YNEGATIVE_PATTERNS]@D\n"

+"      Run only the tests whose name matches one of the positive patterns but\n"

+"      none of the negative patterns. '?' matches any single character; '*'\n"

+"      matches any substring; ':' separates two patterns.\n"

+"  @G--" GTEST_FLAG_PREFIX_ "also_run_disabled_tests@D\n"

+"      Run all disabled tests too.\n"

+"\n"

+"Test Execution:\n"

+"  @G--" GTEST_FLAG_PREFIX_ "repeat=@Y[COUNT]@D\n"

+"      Run the tests repeatedly; use a negative count to repeat forever.\n"

+"  @G--" GTEST_FLAG_PREFIX_ "shuffle@D\n"

+"      Randomize tests' orders on every iteration.\n"

+"  @G--" GTEST_FLAG_PREFIX_ "random_seed=@Y[NUMBER]@D\n"

+"      Random number seed to use for shuffling test orders (between 1 and\n"

+"      99999, or 0 to use a seed based on the current time).\n"

+"\n"

+"Test Output:\n"

+"  @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n"

+"      Enable/disable colored output. The default is @Gauto@D.\n"

+"  -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n"

+"      Don't print the elapsed time of each test.\n"

+"  @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G"

+    GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n"

+"      Generate an XML report in the given directory or with the given file\n"

+"      name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n"

+#if GTEST_CAN_STREAM_RESULTS_

+"  @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n"

+"      Stream test results to the given server.\n"

+#endif  // GTEST_CAN_STREAM_RESULTS_

+"\n"

+"Assertion Behavior:\n"

+#if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS

+"  @G--" GTEST_FLAG_PREFIX_ "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n"

+"      Set the default death test style.\n"

+#endif  // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS

+"  @G--" GTEST_FLAG_PREFIX_ "break_on_failure@D\n"

+"      Turn assertion failures into debugger break-points.\n"

+"  @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n"

+"      Turn assertion failures into C++ exceptions.\n"

+"  @G--" GTEST_FLAG_PREFIX_ "catch_exceptions=0@D\n"

+"      Do not report exceptions as test failures. Instead, allow them\n"

+"      to crash the program or throw a pop-up (on Windows).\n"

+"\n"

+"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set "

+    "the corresponding\n"

+"environment variable of a flag (all letters in upper-case). For example, to\n"

+"disable colored text output, you can either specify @G--" GTEST_FLAG_PREFIX_

+    "color=no@D or set\n"

+"the @G" GTEST_FLAG_PREFIX_UPPER_ "COLOR@D environment variable to @Gno@D.\n"

+"\n"

+"For more information, please read the " GTEST_NAME_ " documentation at\n"

+"@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_ "\n"

+"(not one in your own code or tests), please report it to\n"

+"@G<" GTEST_DEV_EMAIL_ ">@D.\n";

+

+// Parses the command line for Google Test flags, without initializing

+// other parts of Google Test.  The type parameter CharType can be

+// instantiated to either char or wchar_t.

+template <typename CharType>

+void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {

+  for (int i = 1; i < *argc; i++) {

+    const std::string arg_string = StreamableToString(argv[i]);

+    const char* const arg = arg_string.c_str();

+

+    using internal::ParseBoolFlag;

+    using internal::ParseInt32Flag;

+    using internal::ParseStringFlag;

+

+    // Do we see a Google Test flag?

+    if (ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,

+                      &GTEST_FLAG(also_run_disabled_tests)) ||

+        ParseBoolFlag(arg, kBreakOnFailureFlag,

+                      &GTEST_FLAG(break_on_failure)) ||

+        ParseBoolFlag(arg, kCatchExceptionsFlag,

+                      &GTEST_FLAG(catch_exceptions)) ||

+        ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||

+        ParseStringFlag(arg, kDeathTestStyleFlag,

+                        &GTEST_FLAG(death_test_style)) ||

+        ParseBoolFlag(arg, kDeathTestUseFork,

+                      &GTEST_FLAG(death_test_use_fork)) ||

+        ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||

+        ParseStringFlag(arg, kInternalRunDeathTestFlag,

+                        &GTEST_FLAG(internal_run_death_test)) ||

+        ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||

+        ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||

+        ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||

+        ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||

+        ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||

+        ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||

+        ParseInt32Flag(arg, kStackTraceDepthFlag,

+                       &GTEST_FLAG(stack_trace_depth)) ||

+        ParseStringFlag(arg, kStreamResultToFlag,

+                        &GTEST_FLAG(stream_result_to)) ||

+        ParseBoolFlag(arg, kThrowOnFailureFlag,

+                      &GTEST_FLAG(throw_on_failure))

+        ) {

+      // Yes.  Shift the remainder of the argv list left by one.  Note

+      // that argv has (*argc + 1) elements, the last one always being

+      // NULL.  The following loop moves the trailing NULL element as

+      // well.

+      for (int j = i; j != *argc; j++) {

+        argv[j] = argv[j + 1];

+      }

+

+      // Decrements the argument count.

+      (*argc)--;

+

+      // We also need to decrement the iterator as we just removed

+      // an element.

+      i--;

+    } else if (arg_string == "--help" || arg_string == "-h" ||

+               arg_string == "-?" || arg_string == "/?" ||

+               HasGoogleTestFlagPrefix(arg)) {

+      // Both help flag and unrecognized Google Test flags (excluding

+      // internal ones) trigger help display.

+      g_help_flag = true;

+    }

+  }

+

+  if (g_help_flag) {

+    // We print the help here instead of in RUN_ALL_TESTS(), as the

+    // latter may not be called at all if the user is using Google

+    // Test with another testing framework.

+    PrintColorEncoded(kColorEncodedHelpMessage);

+  }

+}

+

+// Parses the command line for Google Test flags, without initializing

+// other parts of Google Test.

+void ParseGoogleTestFlagsOnly(int* argc, char** argv) {

+  ParseGoogleTestFlagsOnlyImpl(argc, argv);

+}

+void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {

+  ParseGoogleTestFlagsOnlyImpl(argc, argv);

+}

+

+// The internal implementation of InitGoogleTest().

+//

+// The type parameter CharType can be instantiated to either char or

+// wchar_t.

+template <typename CharType>

+void InitGoogleTestImpl(int* argc, CharType** argv) {

+  g_init_gtest_count++;

+

+  // We don't want to run the initialization code twice.

+  if (g_init_gtest_count != 1) return;

+

+  if (*argc <= 0) return;

+

+  internal::g_executable_path = internal::StreamableToString(argv[0]);

+

+#if GTEST_HAS_DEATH_TEST

+

+  g_argvs.clear();

+  for (int i = 0; i != *argc; i++) {

+    g_argvs.push_back(StreamableToString(argv[i]));

+  }

+

+#endif  // GTEST_HAS_DEATH_TEST

+

+  ParseGoogleTestFlagsOnly(argc, argv);

+  GetUnitTestImpl()->PostFlagParsingInit();

+}

+

+}  // namespace internal

+

+// Initializes Google Test.  This must be called before calling

+// RUN_ALL_TESTS().  In particular, it parses a command line for the

+// flags that Google Test recognizes.  Whenever a Google Test flag is

+// seen, it is removed from argv, and *argc is decremented.

+//

+// No value is returned.  Instead, the Google Test flag variables are

+// updated.

+//

+// Calling the function for the second time has no user-visible effect.

+void InitGoogleTest(int* argc, char** argv) {

+  internal::InitGoogleTestImpl(argc, argv);

+}

+

+// This overloaded version can be used in Windows programs compiled in

+// UNICODE mode.

+void InitGoogleTest(int* argc, wchar_t** argv) {

+  internal::InitGoogleTestImpl(argc, argv);

+}

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/gtest/src/gtest_main.cc b/third_party/allwpilib_2018/gmock/gtest/src/gtest_main.cc
new file mode 100644
index 0000000..ae8b6ac
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/gtest/src/gtest_main.cc
@@ -0,0 +1,38 @@
+// Copyright 2006, 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 <stdio.h>

+

+#include "gtest/gtest.h"

+

+GTEST_API_ int main(int argc, char **argv) {

+  printf("Running main() from gtest_main.cc\n");

+  testing::InitGoogleTest(&argc, argv);

+  return RUN_ALL_TESTS();

+}

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-actions.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-actions.h
new file mode 100644
index 0000000..29fba3c
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-actions.h
@@ -0,0 +1,1078 @@
+// 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 <errno.h>

+#endif

+

+#include <algorithm>

+#include <string>

+

+#include "gmock/internal/gmock-internal-utils.h"

+#include "gmock/internal/gmock-port.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 <typename F1, typename F2>

+class ActionAdaptor;

+

+// BuiltInDefaultValue<T>::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 <typename T>

+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<T>();

+    // 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 <typename T>

+class BuiltInDefaultValue<const T> {

+ public:

+  static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }

+  static T Get() { return BuiltInDefaultValue<T>::Get(); }

+};

+

+// This partial specialization defines the default values for pointer

+// types.

+template <typename T>

+class BuiltInDefaultValue<T*> {

+ 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<type> { \

+   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<T> 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<T>::Set(foo);

+template <typename T>

+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<T>::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<T>::Get() : *value_;

+  }

+

+ private:

+  static const T* value_;

+};

+

+// This partial specialization allows a user to set default values for

+// reference types.

+template <typename T>

+class DefaultValue<T&> {

+ 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<T&>::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<T&>::Get() : *address_;

+  }

+

+ private:

+  static T* address_;

+};

+

+// This specialization allows DefaultValue<void>::Get() to

+// compile.

+template <>

+class DefaultValue<void> {

+ public:

+  static bool Exists() { return true; }

+  static void Get() {}

+};

+

+// Points to the user-set default value for type T.

+template <typename T>

+const T* DefaultValue<T>::value_ = NULL;

+

+// Points to the user-set default value for type T&.

+template <typename T>

+T* DefaultValue<T&>::address_ = NULL;

+

+// Implement this interface to define an action for function type F.

+template <typename F>

+class ActionInterface {

+ public:

+  typedef typename internal::Function<F>::Result Result;

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  ActionInterface() {}

+  virtual ~ActionInterface() {}

+

+  // Performs the action.  This method is not const, as in general an

+  // action can have side effects and be stateful.  For example, a

+  // get-the-next-element-from-the-collection action will need to

+  // remember the current element.

+  virtual Result Perform(const ArgumentTuple& args) = 0;

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);

+};

+

+// An Action<F> is a copyable and IMMUTABLE (except by assignment)

+// object that represents an action to be taken when a mock function

+// of type F is called.  The implementation of Action<T> is just a

+// linked_ptr to const ActionInterface<T>, so copying is fairly cheap.

+// Don't inherit from Action!

+//

+// You can view an object implementing ActionInterface<F> as a

+// concrete action (including its current state), and an Action<F>

+// object as a handle to it.

+template <typename F>

+class Action {

+ public:

+  typedef typename internal::Function<F>::Result Result;

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  // Constructs a null Action.  Needed for storing Action objects in

+  // STL containers.

+  Action() : impl_(NULL) {}

+

+  // Constructs an Action from its implementation.  A NULL impl is

+  // used to represent the "do-default" action.

+  explicit Action(ActionInterface<F>* impl) : impl_(impl) {}

+

+  // Copy constructor.

+  Action(const Action& action) : impl_(action.impl_) {}

+

+  // This constructor allows us to turn an Action<Func> object into an

+  // Action<F>, as long as F's arguments can be implicitly converted

+  // to Func's and Func's return type can be implicitly converted to

+  // F's.

+  template <typename Func>

+  explicit Action(const Action<Func>& action);

+

+  // Returns true iff this is the DoDefault() action.

+  bool IsDoDefault() const { return impl_.get() == NULL; }

+

+  // Performs the action.  Note that this method is const even though

+  // the corresponding method in ActionInterface is not.  The reason

+  // is that a const Action<F> means that it cannot be re-bound to

+  // another concrete action, not that the concrete action it binds to

+  // cannot change state.  (Think of the difference between a const

+  // pointer and a pointer to const.)

+  Result Perform(const ArgumentTuple& args) const {

+    internal::Assert(

+        !IsDoDefault(), __FILE__, __LINE__,

+        "You are using DoDefault() inside a composite action like "

+        "DoAll() or WithArgs().  This is not supported for technical "

+        "reasons.  Please instead spell out the default action, or "

+        "assign the default action to an Action variable and use "

+        "the variable in various places.");

+    return impl_->Perform(args);

+  }

+

+ private:

+  template <typename F1, typename F2>

+  friend class internal::ActionAdaptor;

+

+  internal::linked_ptr<ActionInterface<F> > impl_;

+};

+

+// The PolymorphicAction class template makes it easy to implement a

+// polymorphic action (i.e. an action that can be used in mock

+// functions of than one type, e.g. Return()).

+//

+// To define a polymorphic action, a user first provides a COPYABLE

+// implementation class that has a Perform() method template:

+//

+//   class FooAction {

+//    public:

+//     template <typename Result, typename ArgumentTuple>

+//     Result Perform(const ArgumentTuple& args) const {

+//       // Processes the arguments and returns a result, using

+//       // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.

+//     }

+//     ...

+//   };

+//

+// Then the user creates the polymorphic action using

+// MakePolymorphicAction(object) where object has type FooAction.  See

+// the definition of Return(void) and SetArgumentPointee<N>(value) for

+// complete examples.

+template <typename Impl>

+class PolymorphicAction {

+ public:

+  explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}

+

+  template <typename F>

+  operator Action<F>() const {

+    return Action<F>(new MonomorphicImpl<F>(impl_));

+  }

+

+ private:

+  template <typename F>

+  class MonomorphicImpl : public ActionInterface<F> {

+   public:

+    typedef typename internal::Function<F>::Result Result;

+    typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+    explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}

+

+    virtual Result Perform(const ArgumentTuple& args) {

+      return impl_.template Perform<Result>(args);

+    }

+

+   private:

+    Impl impl_;

+

+    GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);

+  };

+

+  Impl impl_;

+

+  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);

+};

+

+// Creates an Action from its implementation and returns it.  The

+// created Action object owns the implementation.

+template <typename F>

+Action<F> MakeAction(ActionInterface<F>* impl) {

+  return Action<F>(impl);

+}

+

+// Creates a polymorphic action from its implementation.  This is

+// easier to use than the PolymorphicAction<Impl> constructor as it

+// doesn't require you to explicitly write the template argument, e.g.

+//

+//   MakePolymorphicAction(foo);

+// vs

+//   PolymorphicAction<TypeOfFoo>(foo);

+template <typename Impl>

+inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {

+  return PolymorphicAction<Impl>(impl);

+}

+

+namespace internal {

+

+// Allows an Action<F2> object to pose as an Action<F1>, as long as F2

+// and F1 are compatible.

+template <typename F1, typename F2>

+class ActionAdaptor : public ActionInterface<F1> {

+ public:

+  typedef typename internal::Function<F1>::Result Result;

+  typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;

+

+  explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}

+

+  virtual Result Perform(const ArgumentTuple& args) {

+    return impl_->Perform(args);

+  }

+

+ private:

+  const internal::linked_ptr<ActionInterface<F2> > impl_;

+

+  GTEST_DISALLOW_ASSIGN_(ActionAdaptor);

+};

+

+// Implements the polymorphic Return(x) action, which can be used in

+// any function that returns the type of x, regardless of the argument

+// types.

+//

+// Note: The value passed into Return must be converted into

+// Function<F>::Result when this action is cast to Action<F> rather than

+// when that action is performed. This is important in scenarios like

+//

+// MOCK_METHOD1(Method, T(U));

+// ...

+// {

+//   Foo foo;

+//   X x(&foo);

+//   EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));

+// }

+//

+// In the example above the variable x holds reference to foo which leaves

+// scope and gets destroyed.  If copying X just copies a reference to foo,

+// that copy will be left with a hanging reference.  If conversion to T

+// makes a copy of foo, the above code is safe. To support that scenario, we

+// need to make sure that the type conversion happens inside the EXPECT_CALL

+// statement, and conversion of the result of Return to Action<T(U)> is a

+// good place for that.

+//

+template <typename R>

+class ReturnAction {

+ public:

+  // Constructs a ReturnAction object from the value to be returned.

+  // 'value' is passed by value instead of by const reference in order

+  // to allow Return("string literal") to compile.

+  explicit ReturnAction(R value) : value_(value) {}

+

+  // This template type conversion operator allows Return(x) to be

+  // used in ANY function that returns x's type.

+  template <typename F>

+  operator Action<F>() const {

+    // Assert statement belongs here because this is the best place to verify

+    // conditions on F. It produces the clearest error messages

+    // in most compilers.

+    // Impl really belongs in this scope as a local class but can't

+    // because MSVC produces duplicate symbols in different translation units

+    // in this case. Until MS fixes that bug we put Impl into the class scope

+    // and put the typedef both here (for use in assert statement) and

+    // in the Impl class. But both definitions must be the same.

+    typedef typename Function<F>::Result Result;

+    GTEST_COMPILE_ASSERT_(

+        !internal::is_reference<Result>::value,

+        use_ReturnRef_instead_of_Return_to_return_a_reference);

+    return Action<F>(new Impl<F>(value_));

+  }

+

+ private:

+  // Implements the Return(x) action for a particular function type F.

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename Function<F>::Result Result;

+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+

+    // The implicit cast is necessary when Result has more than one

+    // single-argument constructor (e.g. Result is std::vector<int>) and R

+    // has a type conversion operator template.  In that case, value_(value)

+    // won't compile as the compiler doesn't known which constructor of

+    // Result to call.  ImplicitCast_ forces the compiler to convert R to

+    // Result without considering explicit constructors, thus resolving the

+    // ambiguity. value_ is then initialized using its copy constructor.

+    explicit Impl(R value)

+        : value_(::testing::internal::ImplicitCast_<Result>(value)) {}

+

+    virtual Result Perform(const ArgumentTuple&) { return value_; }

+

+   private:

+    GTEST_COMPILE_ASSERT_(!internal::is_reference<Result>::value,

+                          Result_cannot_be_a_reference_type);

+    Result value_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  R value_;

+

+  GTEST_DISALLOW_ASSIGN_(ReturnAction);

+};

+

+// Implements the ReturnNull() action.

+class ReturnNullAction {

+ public:

+  // Allows ReturnNull() to be used in any pointer-returning function.

+  template <typename Result, typename ArgumentTuple>

+  static Result Perform(const ArgumentTuple&) {

+    GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,

+                          ReturnNull_can_be_used_to_return_a_pointer_only);

+    return NULL;

+  }

+};

+

+// Implements the Return() action.

+class ReturnVoidAction {

+ public:

+  // Allows Return() to be used in any void-returning function.

+  template <typename Result, typename ArgumentTuple>

+  static void Perform(const ArgumentTuple&) {

+    CompileAssertTypesEqual<void, Result>();

+  }

+};

+

+// Implements the polymorphic ReturnRef(x) action, which can be used

+// in any function that returns a reference to the type of x,

+// regardless of the argument types.

+template <typename T>

+class ReturnRefAction {

+ public:

+  // Constructs a ReturnRefAction object from the reference to be returned.

+  explicit ReturnRefAction(T& ref) : ref_(ref) {}  // NOLINT

+

+  // This template type conversion operator allows ReturnRef(x) to be

+  // used in ANY function that returns a reference to x's type.

+  template <typename F>

+  operator Action<F>() const {

+    typedef typename Function<F>::Result Result;

+    // Asserts that the function return type is a reference.  This

+    // catches the user error of using ReturnRef(x) when Return(x)

+    // should be used, and generates some helpful error message.

+    GTEST_COMPILE_ASSERT_(internal::is_reference<Result>::value,

+                          use_Return_instead_of_ReturnRef_to_return_a_value);

+    return Action<F>(new Impl<F>(ref_));

+  }

+

+ private:

+  // Implements the ReturnRef(x) action for a particular function type F.

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename Function<F>::Result Result;

+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+

+    explicit Impl(T& ref) : ref_(ref) {}  // NOLINT

+

+    virtual Result Perform(const ArgumentTuple&) {

+      return ref_;

+    }

+

+   private:

+    T& ref_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  T& ref_;

+

+  GTEST_DISALLOW_ASSIGN_(ReturnRefAction);

+};

+

+// Implements the polymorphic ReturnRefOfCopy(x) action, which can be

+// used in any function that returns a reference to the type of x,

+// regardless of the argument types.

+template <typename T>

+class ReturnRefOfCopyAction {

+ public:

+  // Constructs a ReturnRefOfCopyAction object from the reference to

+  // be returned.

+  explicit ReturnRefOfCopyAction(const T& value) : value_(value) {}  // NOLINT

+

+  // This template type conversion operator allows ReturnRefOfCopy(x) to be

+  // used in ANY function that returns a reference to x's type.

+  template <typename F>

+  operator Action<F>() const {

+    typedef typename Function<F>::Result Result;

+    // Asserts that the function return type is a reference.  This

+    // catches the user error of using ReturnRefOfCopy(x) when Return(x)

+    // should be used, and generates some helpful error message.

+    GTEST_COMPILE_ASSERT_(

+        internal::is_reference<Result>::value,

+        use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);

+    return Action<F>(new Impl<F>(value_));

+  }

+

+ private:

+  // Implements the ReturnRefOfCopy(x) action for a particular function type F.

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename Function<F>::Result Result;

+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+

+    explicit Impl(const T& value) : value_(value) {}  // NOLINT

+

+    virtual Result Perform(const ArgumentTuple&) {

+      return value_;

+    }

+

+   private:

+    T value_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  const T value_;

+

+  GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);

+};

+

+// Implements the polymorphic DoDefault() action.

+class DoDefaultAction {

+ public:

+  // This template type conversion operator allows DoDefault() to be

+  // used in any function.

+  template <typename F>

+  operator Action<F>() const { return Action<F>(NULL); }

+};

+

+// Implements the Assign action to set a given pointer referent to a

+// particular value.

+template <typename T1, typename T2>

+class AssignAction {

+ public:

+  AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}

+

+  template <typename Result, typename ArgumentTuple>

+  void Perform(const ArgumentTuple& /* args */) const {

+    *ptr_ = value_;

+  }

+

+ private:

+  T1* const ptr_;

+  const T2 value_;

+

+  GTEST_DISALLOW_ASSIGN_(AssignAction);

+};

+

+#if !GTEST_OS_WINDOWS_MOBILE

+

+// Implements the SetErrnoAndReturn action to simulate return from

+// various system calls and libc functions.

+template <typename T>

+class SetErrnoAndReturnAction {

+ public:

+  SetErrnoAndReturnAction(int errno_value, T result)

+      : errno_(errno_value),

+        result_(result) {}

+  template <typename Result, typename ArgumentTuple>

+  Result Perform(const ArgumentTuple& /* args */) const {

+    errno = errno_;

+    return result_;

+  }

+

+ private:

+  const int errno_;

+  const T result_;

+

+  GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);

+};

+

+#endif  // !GTEST_OS_WINDOWS_MOBILE

+

+// Implements the SetArgumentPointee<N>(x) action for any function

+// whose N-th argument (0-based) is a pointer to x's type.  The

+// template parameter kIsProto is true iff type A is ProtocolMessage,

+// proto2::Message, or a sub-class of those.

+template <size_t N, typename A, bool kIsProto>

+class SetArgumentPointeeAction {

+ public:

+  // Constructs an action that sets the variable pointed to by the

+  // N-th function argument to 'value'.

+  explicit SetArgumentPointeeAction(const A& value) : value_(value) {}

+

+  template <typename Result, typename ArgumentTuple>

+  void Perform(const ArgumentTuple& args) const {

+    CompileAssertTypesEqual<void, Result>();

+    *::std::tr1::get<N>(args) = value_;

+  }

+

+ private:

+  const A value_;

+

+  GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);

+};

+

+template <size_t N, typename Proto>

+class SetArgumentPointeeAction<N, Proto, true> {

+ public:

+  // Constructs an action that sets the variable pointed to by the

+  // N-th function argument to 'proto'.  Both ProtocolMessage and

+  // proto2::Message have the CopyFrom() method, so the same

+  // implementation works for both.

+  explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {

+    proto_->CopyFrom(proto);

+  }

+

+  template <typename Result, typename ArgumentTuple>

+  void Perform(const ArgumentTuple& args) const {

+    CompileAssertTypesEqual<void, Result>();

+    ::std::tr1::get<N>(args)->CopyFrom(*proto_);

+  }

+

+ private:

+  const internal::linked_ptr<Proto> proto_;

+

+  GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);

+};

+

+// Implements the InvokeWithoutArgs(f) action.  The template argument

+// FunctionImpl is the implementation type of f, which can be either a

+// function pointer or a functor.  InvokeWithoutArgs(f) can be used as an

+// Action<F> as long as f's type is compatible with F (i.e. f can be

+// assigned to a tr1::function<F>).

+template <typename FunctionImpl>

+class InvokeWithoutArgsAction {

+ public:

+  // The c'tor makes a copy of function_impl (either a function

+  // pointer or a functor).

+  explicit InvokeWithoutArgsAction(FunctionImpl function_impl)

+      : function_impl_(function_impl) {}

+

+  // Allows InvokeWithoutArgs(f) to be used as any action whose type is

+  // compatible with f.

+  template <typename Result, typename ArgumentTuple>

+  Result Perform(const ArgumentTuple&) { return function_impl_(); }

+

+ private:

+  FunctionImpl function_impl_;

+

+  GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction);

+};

+

+// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.

+template <class Class, typename MethodPtr>

+class InvokeMethodWithoutArgsAction {

+ public:

+  InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)

+      : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}

+

+  template <typename Result, typename ArgumentTuple>

+  Result Perform(const ArgumentTuple&) const {

+    return (obj_ptr_->*method_ptr_)();

+  }

+

+ private:

+  Class* const obj_ptr_;

+  const MethodPtr method_ptr_;

+

+  GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction);

+};

+

+// Implements the IgnoreResult(action) action.

+template <typename A>

+class IgnoreResultAction {

+ public:

+  explicit IgnoreResultAction(const A& action) : action_(action) {}

+

+  template <typename F>

+  operator Action<F>() const {

+    // Assert statement belongs here because this is the best place to verify

+    // conditions on F. It produces the clearest error messages

+    // in most compilers.

+    // Impl really belongs in this scope as a local class but can't

+    // because MSVC produces duplicate symbols in different translation units

+    // in this case. Until MS fixes that bug we put Impl into the class scope

+    // and put the typedef both here (for use in assert statement) and

+    // in the Impl class. But both definitions must be the same.

+    typedef typename internal::Function<F>::Result Result;

+

+    // Asserts at compile time that F returns void.

+    CompileAssertTypesEqual<void, Result>();

+

+    return Action<F>(new Impl<F>(action_));

+  }

+

+ private:

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename internal::Function<F>::Result Result;

+    typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+    explicit Impl(const A& action) : action_(action) {}

+

+    virtual void Perform(const ArgumentTuple& args) {

+      // Performs the action and ignores its result.

+      action_.Perform(args);

+    }

+

+   private:

+    // Type OriginalFunction is the same as F except that its return

+    // type is IgnoredValue.

+    typedef typename internal::Function<F>::MakeResultIgnoredValue

+        OriginalFunction;

+

+    const Action<OriginalFunction> action_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  const A action_;

+

+  GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);

+};

+

+// A ReferenceWrapper<T> object represents a reference to type T,

+// which can be either const or not.  It can be explicitly converted

+// from, and implicitly converted to, a T&.  Unlike a reference,

+// ReferenceWrapper<T> can be copied and can survive template type

+// inference.  This is used to support by-reference arguments in the

+// InvokeArgument<N>(...) action.  The idea was from "reference

+// wrappers" in tr1, which we don't have in our source tree yet.

+template <typename T>

+class ReferenceWrapper {

+ public:

+  // Constructs a ReferenceWrapper<T> object from a T&.

+  explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {}  // NOLINT

+

+  // Allows a ReferenceWrapper<T> object to be implicitly converted to

+  // a T&.

+  operator T&() const { return *pointer_; }

+ private:

+  T* pointer_;

+};

+

+// Allows the expression ByRef(x) to be printed as a reference to x.

+template <typename T>

+void PrintTo(const ReferenceWrapper<T>& ref, ::std::ostream* os) {

+  T& value = ref;

+  UniversalPrinter<T&>::Print(value, os);

+}

+

+// Does two actions sequentially.  Used for implementing the DoAll(a1,

+// a2, ...) action.

+template <typename Action1, typename Action2>

+class DoBothAction {

+ public:

+  DoBothAction(Action1 action1, Action2 action2)

+      : action1_(action1), action2_(action2) {}

+

+  // This template type conversion operator allows DoAll(a1, ..., a_n)

+  // to be used in ANY function of compatible type.

+  template <typename F>

+  operator Action<F>() const {

+    return Action<F>(new Impl<F>(action1_, action2_));

+  }

+

+ private:

+  // Implements the DoAll(...) action for a particular function type F.

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename Function<F>::Result Result;

+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+    typedef typename Function<F>::MakeResultVoid VoidResult;

+

+    Impl(const Action<VoidResult>& action1, const Action<F>& action2)

+        : action1_(action1), action2_(action2) {}

+

+    virtual Result Perform(const ArgumentTuple& args) {

+      action1_.Perform(args);

+      return action2_.Perform(args);

+    }

+

+   private:

+    const Action<VoidResult> action1_;

+    const Action<F> action2_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  Action1 action1_;

+  Action2 action2_;

+

+  GTEST_DISALLOW_ASSIGN_(DoBothAction);

+};

+

+}  // namespace internal

+

+// An Unused object can be implicitly constructed from ANY value.

+// This is handy when defining actions that ignore some or all of the

+// mock function arguments.  For example, given

+//

+//   MOCK_METHOD3(Foo, double(const string& label, double x, double y));

+//   MOCK_METHOD3(Bar, double(int index, double x, double y));

+//

+// instead of

+//

+//   double DistanceToOriginWithLabel(const string& label, double x, double y) {

+//     return sqrt(x*x + y*y);

+//   }

+//   double DistanceToOriginWithIndex(int index, double x, double y) {

+//     return sqrt(x*x + y*y);

+//   }

+//   ...

+//   EXEPCT_CALL(mock, Foo("abc", _, _))

+//       .WillOnce(Invoke(DistanceToOriginWithLabel));

+//   EXEPCT_CALL(mock, Bar(5, _, _))

+//       .WillOnce(Invoke(DistanceToOriginWithIndex));

+//

+// you could write

+//

+//   // We can declare any uninteresting argument as Unused.

+//   double DistanceToOrigin(Unused, double x, double y) {

+//     return sqrt(x*x + y*y);

+//   }

+//   ...

+//   EXEPCT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));

+//   EXEPCT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));

+typedef internal::IgnoredValue Unused;

+

+// This constructor allows us to turn an Action<From> object into an

+// Action<To>, as long as To's arguments can be implicitly converted

+// to From's and From's return type cann be implicitly converted to

+// To's.

+template <typename To>

+template <typename From>

+Action<To>::Action(const Action<From>& from)

+    : impl_(new internal::ActionAdaptor<To, From>(from)) {}

+

+// Creates an action that returns 'value'.  'value' is passed by value

+// instead of const reference - otherwise Return("string literal")

+// will trigger a compiler error about using array as initializer.

+template <typename R>

+internal::ReturnAction<R> Return(R value) {

+  return internal::ReturnAction<R>(value);

+}

+

+// Creates an action that returns NULL.

+inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {

+  return MakePolymorphicAction(internal::ReturnNullAction());

+}

+

+// Creates an action that returns from a void function.

+inline PolymorphicAction<internal::ReturnVoidAction> Return() {

+  return MakePolymorphicAction(internal::ReturnVoidAction());

+}

+

+// Creates an action that returns the reference to a variable.

+template <typename R>

+inline internal::ReturnRefAction<R> ReturnRef(R& x) {  // NOLINT

+  return internal::ReturnRefAction<R>(x);

+}

+

+// Creates an action that returns the reference to a copy of the

+// argument.  The copy is created when the action is constructed and

+// lives as long as the action.

+template <typename R>

+inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {

+  return internal::ReturnRefOfCopyAction<R>(x);

+}

+

+// Creates an action that does the default action for the give mock function.

+inline internal::DoDefaultAction DoDefault() {

+  return internal::DoDefaultAction();

+}

+

+// Creates an action that sets the variable pointed by the N-th

+// (0-based) function argument to 'value'.

+template <size_t N, typename T>

+PolymorphicAction<

+  internal::SetArgumentPointeeAction<

+    N, T, internal::IsAProtocolMessage<T>::value> >

+SetArgPointee(const T& x) {

+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<

+      N, T, internal::IsAProtocolMessage<T>::value>(x));

+}

+

+#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)

+// This overload allows SetArgPointee() to accept a string literal.

+// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish

+// this overload from the templated version and emit a compile error.

+template <size_t N>

+PolymorphicAction<

+  internal::SetArgumentPointeeAction<N, const char*, false> >

+SetArgPointee(const char* p) {

+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<

+      N, const char*, false>(p));

+}

+

+template <size_t N>

+PolymorphicAction<

+  internal::SetArgumentPointeeAction<N, const wchar_t*, false> >

+SetArgPointee(const wchar_t* p) {

+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<

+      N, const wchar_t*, false>(p));

+}

+#endif

+

+// The following version is DEPRECATED.

+template <size_t N, typename T>

+PolymorphicAction<

+  internal::SetArgumentPointeeAction<

+    N, T, internal::IsAProtocolMessage<T>::value> >

+SetArgumentPointee(const T& x) {

+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<

+      N, T, internal::IsAProtocolMessage<T>::value>(x));

+}

+

+// Creates an action that sets a pointer referent to a given value.

+template <typename T1, typename T2>

+PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {

+  return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));

+}

+

+#if !GTEST_OS_WINDOWS_MOBILE

+

+// Creates an action that sets errno and returns the appropriate error.

+template <typename T>

+PolymorphicAction<internal::SetErrnoAndReturnAction<T> >

+SetErrnoAndReturn(int errval, T result) {

+  return MakePolymorphicAction(

+      internal::SetErrnoAndReturnAction<T>(errval, result));

+}

+

+#endif  // !GTEST_OS_WINDOWS_MOBILE

+

+// Various overloads for InvokeWithoutArgs().

+

+// Creates an action that invokes 'function_impl' with no argument.

+template <typename FunctionImpl>

+PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >

+InvokeWithoutArgs(FunctionImpl function_impl) {

+  return MakePolymorphicAction(

+      internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));

+}

+

+// Creates an action that invokes the given method on the given object

+// with no argument.

+template <class Class, typename MethodPtr>

+PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >

+InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) {

+  return MakePolymorphicAction(

+      internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>(

+          obj_ptr, method_ptr));

+}

+

+// Creates an action that performs an_action and throws away its

+// result.  In other words, it changes the return type of an_action to

+// void.  an_action MUST NOT return void, or the code won't compile.

+template <typename A>

+inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {

+  return internal::IgnoreResultAction<A>(an_action);

+}

+

+// Creates a reference wrapper for the given L-value.  If necessary,

+// you can explicitly specify the type of the reference.  For example,

+// suppose 'derived' is an object of type Derived, ByRef(derived)

+// would wrap a Derived&.  If you want to wrap a const Base& instead,

+// where Base is a base class of Derived, just write:

+//

+//   ByRef<const Base>(derived)

+template <typename T>

+inline internal::ReferenceWrapper<T> ByRef(T& l_value) {  // NOLINT

+  return internal::ReferenceWrapper<T>(l_value);

+}

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-cardinalities.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-cardinalities.h
new file mode 100644
index 0000000..945a213
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-cardinalities.h
@@ -0,0 +1,147 @@
+// 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 cardinalities.  More

+// cardinalities can be defined by the user implementing the

+// CardinalityInterface interface if necessary.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_

+

+#include <limits.h>

+#include <ostream>  // NOLINT

+#include "gmock/internal/gmock-port.h"

+#include "gtest/gtest.h"

+

+namespace testing {

+

+// To implement a cardinality Foo, define:

+//   1. a class FooCardinality that implements the

+//      CardinalityInterface interface, and

+//   2. a factory function that creates a Cardinality object from a

+//      const FooCardinality*.

+//

+// The two-level delegation design follows that of Matcher, providing

+// consistency for extension developers.  It also eases ownership

+// management as Cardinality objects can now be copied like plain values.

+

+// The implementation of a cardinality.

+class CardinalityInterface {

+ public:

+  virtual ~CardinalityInterface() {}

+

+  // Conservative estimate on the lower/upper bound of the number of

+  // calls allowed.

+  virtual int ConservativeLowerBound() const { return 0; }

+  virtual int ConservativeUpperBound() const { return INT_MAX; }

+

+  // Returns true iff call_count calls will satisfy this cardinality.

+  virtual bool IsSatisfiedByCallCount(int call_count) const = 0;

+

+  // Returns true iff call_count calls will saturate this cardinality.

+  virtual bool IsSaturatedByCallCount(int call_count) const = 0;

+

+  // Describes self to an ostream.

+  virtual void DescribeTo(::std::ostream* os) const = 0;

+};

+

+// A Cardinality is a copyable and IMMUTABLE (except by assignment)

+// object that specifies how many times a mock function is expected to

+// be called.  The implementation of Cardinality is just a linked_ptr

+// to const CardinalityInterface, so copying is fairly cheap.

+// Don't inherit from Cardinality!

+class GTEST_API_ Cardinality {

+ public:

+  // Constructs a null cardinality.  Needed for storing Cardinality

+  // objects in STL containers.

+  Cardinality() {}

+

+  // Constructs a Cardinality from its implementation.

+  explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}

+

+  // Conservative estimate on the lower/upper bound of the number of

+  // calls allowed.

+  int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }

+  int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }

+

+  // Returns true iff call_count calls will satisfy this cardinality.

+  bool IsSatisfiedByCallCount(int call_count) const {

+    return impl_->IsSatisfiedByCallCount(call_count);

+  }

+

+  // Returns true iff call_count calls will saturate this cardinality.

+  bool IsSaturatedByCallCount(int call_count) const {

+    return impl_->IsSaturatedByCallCount(call_count);

+  }

+

+  // Returns true iff call_count calls will over-saturate this

+  // cardinality, i.e. exceed the maximum number of allowed calls.

+  bool IsOverSaturatedByCallCount(int call_count) const {

+    return impl_->IsSaturatedByCallCount(call_count) &&

+        !impl_->IsSatisfiedByCallCount(call_count);

+  }

+

+  // Describes self to an ostream

+  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }

+

+  // Describes the given actual call count to an ostream.

+  static void DescribeActualCallCountTo(int actual_call_count,

+                                        ::std::ostream* os);

+

+ private:

+  internal::linked_ptr<const CardinalityInterface> impl_;

+};

+

+// Creates a cardinality that allows at least n calls.

+GTEST_API_ Cardinality AtLeast(int n);

+

+// Creates a cardinality that allows at most n calls.

+GTEST_API_ Cardinality AtMost(int n);

+

+// Creates a cardinality that allows any number of calls.

+GTEST_API_ Cardinality AnyNumber();

+

+// Creates a cardinality that allows between min and max calls.

+GTEST_API_ Cardinality Between(int min, int max);

+

+// Creates a cardinality that allows exactly n calls.

+GTEST_API_ Cardinality Exactly(int n);

+

+// Creates a cardinality from its implementation.

+inline Cardinality MakeCardinality(const CardinalityInterface* c) {

+  return Cardinality(c);

+}

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-actions.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-actions.h
new file mode 100644
index 0000000..2b00d07
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-actions.h
@@ -0,0 +1,2415 @@
+// This file was GENERATED by a script.  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 implements some commonly used variadic actions.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_

+

+#include "gmock/gmock-actions.h"

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+namespace internal {

+

+// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary

+// function or method with the unpacked values, where F is a function

+// type that takes N arguments.

+template <typename Result, typename ArgumentTuple>

+class InvokeHelper;

+

+template <typename R>

+class InvokeHelper<R, ::std::tr1::tuple<> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<>&) {

+    return function();

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<>&) {

+    return (obj_ptr->*method_ptr)();

+  }

+};

+

+template <typename R, typename A1>

+class InvokeHelper<R, ::std::tr1::tuple<A1> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2,

+      A3>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3,

+      A4>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,

+      A5>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4, A5>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args), get<4>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,

+      A5, A6>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args), get<4>(args), get<5>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,

+      A5, A6, A7>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6,

+                            A7>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args), get<4>(args), get<5>(args), get<6>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,

+      A5, A6, A7, A8>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args), get<7>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7,

+                            A8>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8, typename A9>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,

+      A5, A6, A7, A8, A9>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,

+                            A9>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),

+        get<8>(args));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8, typename A9,

+    typename A10>

+class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,

+    A10> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,

+      A5, A6, A7, A8, A9, A10>& args) {

+    using ::std::tr1::get;

+    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),

+        get<9>(args));

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,

+                            A9, A10>& args) {

+    using ::std::tr1::get;

+    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),

+        get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),

+        get<8>(args), get<9>(args));

+  }

+};

+

+// CallableHelper has static methods for invoking "callables",

+// i.e. function pointers and functors.  It uses overloading to

+// provide a uniform interface for invoking different kinds of

+// callables.  In particular, you can use:

+//

+//   CallableHelper<R>::Call(callable, a1, a2, ..., an)

+//

+// to invoke an n-ary callable, where R is its return type.  If an

+// argument, say a2, needs to be passed by reference, you should write

+// ByRef(a2) instead of a2 in the above expression.

+template <typename R>

+class CallableHelper {

+ public:

+  // Calls a nullary callable.

+  template <typename Function>

+  static R Call(Function function) { return function(); }

+

+  // Calls a unary callable.

+

+  // We deliberately pass a1 by value instead of const reference here

+  // in case it is a C-string literal.  If we had declared the

+  // parameter as 'const A1& a1' and write Call(function, "Hi"), the

+  // compiler would've thought A1 is 'char[3]', which causes trouble

+  // when you need to copy a value of type A1.  By declaring the

+  // parameter as 'A1 a1', the compiler will correctly infer that A1

+  // is 'const char*' when it sees Call(function, "Hi").

+  //

+  // Since this function is defined inline, the compiler can get rid

+  // of the copying of the arguments.  Therefore the performance won't

+  // be hurt.

+  template <typename Function, typename A1>

+  static R Call(Function function, A1 a1) { return function(a1); }

+

+  // Calls a binary callable.

+  template <typename Function, typename A1, typename A2>

+  static R Call(Function function, A1 a1, A2 a2) {

+    return function(a1, a2);

+  }

+

+  // Calls a ternary callable.

+  template <typename Function, typename A1, typename A2, typename A3>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3) {

+    return function(a1, a2, a3);

+  }

+

+  // Calls a 4-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4) {

+    return function(a1, a2, a3, a4);

+  }

+

+  // Calls a 5-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4, typename A5>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {

+    return function(a1, a2, a3, a4, a5);

+  }

+

+  // Calls a 6-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4, typename A5, typename A6>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {

+    return function(a1, a2, a3, a4, a5, a6);

+  }

+

+  // Calls a 7-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4, typename A5, typename A6, typename A7>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,

+      A7 a7) {

+    return function(a1, a2, a3, a4, a5, a6, a7);

+  }

+

+  // Calls a 8-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4, typename A5, typename A6, typename A7, typename A8>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,

+      A7 a7, A8 a8) {

+    return function(a1, a2, a3, a4, a5, a6, a7, a8);

+  }

+

+  // Calls a 9-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4, typename A5, typename A6, typename A7, typename A8,

+      typename A9>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,

+      A7 a7, A8 a8, A9 a9) {

+    return function(a1, a2, a3, a4, a5, a6, a7, a8, a9);

+  }

+

+  // Calls a 10-ary callable.

+  template <typename Function, typename A1, typename A2, typename A3,

+      typename A4, typename A5, typename A6, typename A7, typename A8,

+      typename A9, typename A10>

+  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,

+      A7 a7, A8 a8, A9 a9, A10 a10) {

+    return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);

+  }

+};  // class CallableHelper

+

+// An INTERNAL macro for extracting the type of a tuple field.  It's

+// subject to change without notice - DO NOT USE IN USER CODE!

+#define GMOCK_FIELD_(Tuple, N) \

+    typename ::std::tr1::tuple_element<N, Tuple>::type

+

+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the

+// type of an n-ary function whose i-th (1-based) argument type is the

+// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple

+// type, and whose return type is Result.  For example,

+//   SelectArgs<int, ::std::tr1::tuple<bool, char, double, long>, 0, 3>::type

+// is int(bool, long).

+//

+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)

+// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.

+// For example,

+//   SelectArgs<int, ::std::tr1::tuple<bool, char, double>, 2, 0>::Select(

+//       ::std::tr1::make_tuple(true, 'a', 2.5))

+// returns ::std::tr1::tuple (2.5, true).

+//

+// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be

+// in the range [0, 10].  Duplicates are allowed and they don't have

+// to be in an ascending or descending order.

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4, int k5, int k6, int k7, int k8, int k9, int k10>

+class SelectArgs {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),

+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),

+      GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),

+      GMOCK_FIELD_(ArgumentTuple, k10));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),

+        get<k8>(args), get<k9>(args), get<k10>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple>

+class SelectArgs<Result, ArgumentTuple,

+                 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef Result type();

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& /* args */) {

+    using ::std::tr1::get;

+    return SelectedArgs();

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4, int k5>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args), get<k5>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4, int k5, int k6>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),

+      GMOCK_FIELD_(ArgumentTuple, k6));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args), get<k5>(args), get<k6>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4, int k5, int k6, int k7>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),

+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4, int k5, int k6, int k7, int k8>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),

+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),

+      GMOCK_FIELD_(ArgumentTuple, k8));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),

+        get<k8>(args));

+  }

+};

+

+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,

+    int k4, int k5, int k6, int k7, int k8, int k9>

+class SelectArgs<Result, ArgumentTuple,

+                 k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {

+ public:

+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),

+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),

+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),

+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),

+      GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),

+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),

+        get<k8>(args), get<k9>(args));

+  }

+};

+

+#undef GMOCK_FIELD_

+

+// Implements the WithArgs action.

+template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,

+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,

+    int k9 = -1, int k10 = -1>

+class WithArgsAction {

+ public:

+  explicit WithArgsAction(const InnerAction& action) : action_(action) {}

+

+  template <typename F>

+  operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }

+

+ private:

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename Function<F>::Result Result;

+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+

+    explicit Impl(const InnerAction& action) : action_(action) {}

+

+    virtual Result Perform(const ArgumentTuple& args) {

+      return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,

+          k5, k6, k7, k8, k9, k10>::Select(args));

+    }

+

+   private:

+    typedef typename SelectArgs<Result, ArgumentTuple,

+        k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;

+

+    Action<InnerFunctionType> action_;

+  };

+

+  const InnerAction action_;

+

+  GTEST_DISALLOW_ASSIGN_(WithArgsAction);

+};

+

+// A macro from the ACTION* family (defined later in this file)

+// defines an action that can be used in a mock function.  Typically,

+// these actions only care about a subset of the arguments of the mock

+// function.  For example, if such an action only uses the second

+// argument, it can be used in any mock function that takes >= 2

+// arguments where the type of the second argument is compatible.

+//

+// Therefore, the action implementation must be prepared to take more

+// arguments than it needs.  The ExcessiveArg type is used to

+// represent those excessive arguments.  In order to keep the compiler

+// error messages tractable, we define it in the testing namespace

+// instead of testing::internal.  However, this is an INTERNAL TYPE

+// and subject to change without notice, so a user MUST NOT USE THIS

+// TYPE DIRECTLY.

+struct ExcessiveArg {};

+

+// A helper class needed for implementing the ACTION* macros.

+template <typename Result, class Impl>

+class ActionHelper {

+ public:

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0>(args, get<0>(args),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),

+        get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),

+        get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2,

+      A3>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),

+        get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3, typename A4>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3,

+      A4>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,

+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),

+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3, typename A4,

+      typename A5>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,

+      A5>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,

+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),

+        get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3, typename A4,

+      typename A5, typename A6>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,

+      A5, A6>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,

+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),

+        get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3, typename A4,

+      typename A5, typename A6, typename A7>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,

+      A5, A6, A7>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,

+        A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3, typename A4,

+      typename A5, typename A6, typename A7, typename A8>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,

+      A5, A6, A7, A8>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,

+        A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),

+        ExcessiveArg());

+  }

+

+  template <typename A0, typename A1, typename A2, typename A3, typename A4,

+      typename A5, typename A6, typename A7, typename A8, typename A9>

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,

+      A5, A6, A7, A8, A9>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,

+        A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),

+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),

+        get<9>(args));

+  }

+};

+

+}  // namespace internal

+

+// Various overloads for Invoke().

+

+// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes

+// the selected arguments of the mock function to an_action and

+// performs it.  It serves as an adaptor between actions with

+// different argument lists.  C++ doesn't support default arguments for

+// function templates, so we have to overload it.

+template <int k1, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1>(action);

+}

+

+template <int k1, int k2, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2>(action);

+}

+

+template <int k1, int k2, int k3, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3>(action);

+}

+

+template <int k1, int k2, int k3, int k4, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4>(action);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>(action);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>(action);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,

+    typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6,

+      k7>(action);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,

+    typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7,

+      k8>(action);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,

+    int k9, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,

+      k9>(action);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,

+    int k9, int k10, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,

+    k9, k10>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,

+      k9, k10>(action);

+}

+

+// Creates an action that does actions a1, a2, ..., sequentially in

+// each invocation.

+template <typename Action1, typename Action2>

+inline internal::DoBothAction<Action1, Action2>

+DoAll(Action1 a1, Action2 a2) {

+  return internal::DoBothAction<Action1, Action2>(a1, a2);

+}

+

+template <typename Action1, typename Action2, typename Action3>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    Action3> >

+DoAll(Action1 a1, Action2 a2, Action3 a3) {

+  return DoAll(a1, DoAll(a2, a3));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, Action4> > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) {

+  return DoAll(a1, DoAll(a2, a3, a4));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4, typename Action5>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,

+    Action5> > > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) {

+  return DoAll(a1, DoAll(a2, a3, a4, a5));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4, typename Action5, typename Action6>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,

+    internal::DoBothAction<Action5, Action6> > > > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {

+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4, typename Action5, typename Action6, typename Action7>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,

+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,

+    Action7> > > > > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,

+    Action7 a7) {

+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4, typename Action5, typename Action6, typename Action7,

+    typename Action8>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,

+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,

+    internal::DoBothAction<Action7, Action8> > > > > > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,

+    Action7 a7, Action8 a8) {

+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4, typename Action5, typename Action6, typename Action7,

+    typename Action8, typename Action9>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,

+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,

+    internal::DoBothAction<Action7, internal::DoBothAction<Action8,

+    Action9> > > > > > > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,

+    Action7 a7, Action8 a8, Action9 a9) {

+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9));

+}

+

+template <typename Action1, typename Action2, typename Action3,

+    typename Action4, typename Action5, typename Action6, typename Action7,

+    typename Action8, typename Action9, typename Action10>

+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,

+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,

+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,

+    internal::DoBothAction<Action7, internal::DoBothAction<Action8,

+    internal::DoBothAction<Action9, Action10> > > > > > > > >

+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,

+    Action7 a7, Action8 a8, Action9 a9, Action10 a10) {

+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));

+}

+

+}  // namespace testing

+

+// The ACTION* family of macros can be used in a namespace scope to

+// define custom actions easily.  The syntax:

+//

+//   ACTION(name) { statements; }

+//

+// will define an action with the given name that executes the

+// statements.  The value returned by the statements will be used as

+// the return value of the action.  Inside the statements, you can

+// refer to the K-th (0-based) argument of the mock function by

+// 'argK', and refer to its type by 'argK_type'.  For example:

+//

+//   ACTION(IncrementArg1) {

+//     arg1_type temp = arg1;

+//     return ++(*temp);

+//   }

+//

+// allows you to write

+//

+//   ...WillOnce(IncrementArg1());

+//

+// You can also refer to the entire argument tuple and its type by

+// 'args' and 'args_type', and refer to the mock function type and its

+// return type by 'function_type' and 'return_type'.

+//

+// Note that you don't need to specify the types of the mock function

+// arguments.  However rest assured that your code is still type-safe:

+// you'll get a compiler error if *arg1 doesn't support the ++

+// operator, or if the type of ++(*arg1) isn't compatible with the

+// mock function's return type, for example.

+//

+// Sometimes you'll want to parameterize the action.   For that you can use

+// another macro:

+//

+//   ACTION_P(name, param_name) { statements; }

+//

+// For example:

+//

+//   ACTION_P(Add, n) { return arg0 + n; }

+//

+// will allow you to write:

+//

+//   ...WillOnce(Add(5));

+//

+// Note that you don't need to provide the type of the parameter

+// either.  If you need to reference the type of a parameter named

+// 'foo', you can write 'foo_type'.  For example, in the body of

+// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type

+// of 'n'.

+//

+// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support

+// multi-parameter actions.

+//

+// For the purpose of typing, you can view

+//

+//   ACTION_Pk(Foo, p1, ..., pk) { ... }

+//

+// as shorthand for

+//

+//   template <typename p1_type, ..., typename pk_type>

+//   FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }

+//

+// In particular, you can provide the template type arguments

+// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);

+// although usually you can rely on the compiler to infer the types

+// for you automatically.  You can assign the result of expression

+// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,

+// pk_type>.  This can be useful when composing actions.

+//

+// You can also overload actions with different numbers of parameters:

+//

+//   ACTION_P(Plus, a) { ... }

+//   ACTION_P2(Plus, a, b) { ... }

+//

+// While it's tempting to always use the ACTION* macros when defining

+// a new action, you should also consider implementing ActionInterface

+// or using MakePolymorphicAction() instead, especially if you need to

+// use the action a lot.  While these approaches require more work,

+// they give you more control on the types of the mock function

+// arguments and the action parameters, which in general leads to

+// better compiler error messages that pay off in the long run.  They

+// also allow overloading actions based on parameter types (as opposed

+// to just based on the number of parameters).

+//

+// CAVEAT:

+//

+// ACTION*() can only be used in a namespace scope.  The reason is

+// that C++ doesn't yet allow function-local types to be used to

+// instantiate templates.  The up-coming C++0x standard will fix this.

+// Once that's done, we'll consider supporting using ACTION*() inside

+// a function.

+//

+// MORE INFORMATION:

+//

+// To learn more about using these macros, please search for 'ACTION'

+// on http://code.google.com/p/googlemock/wiki/CookBook.

+

+// An internal macro needed for implementing ACTION*().

+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\

+    const args_type& args GTEST_ATTRIBUTE_UNUSED_, \

+    arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \

+    arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \

+    arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \

+    arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \

+    arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \

+    arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \

+    arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \

+    arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \

+    arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \

+    arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_

+

+// Sometimes you want to give an action explicit template parameters

+// that cannot be inferred from its value parameters.  ACTION() and

+// ACTION_P*() don't support that.  ACTION_TEMPLATE() remedies that

+// and can be viewed as an extension to ACTION() and ACTION_P*().

+//

+// The syntax:

+//

+//   ACTION_TEMPLATE(ActionName,

+//                   HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),

+//                   AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }

+//

+// defines an action template that takes m explicit template

+// parameters and n value parameters.  name_i is the name of the i-th

+// template parameter, and kind_i specifies whether it's a typename,

+// an integral constant, or a template.  p_i is the name of the i-th

+// value parameter.

+//

+// Example:

+//

+//   // DuplicateArg<k, T>(output) converts the k-th argument of the mock

+//   // function to type T and copies it to *output.

+//   ACTION_TEMPLATE(DuplicateArg,

+//                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),

+//                   AND_1_VALUE_PARAMS(output)) {

+//     *output = T(std::tr1::get<k>(args));

+//   }

+//   ...

+//     int n;

+//     EXPECT_CALL(mock, Foo(_, _))

+//         .WillOnce(DuplicateArg<1, unsigned char>(&n));

+//

+// To create an instance of an action template, write:

+//

+//   ActionName<t1, ..., t_m>(v1, ..., v_n)

+//

+// where the ts are the template arguments and the vs are the value

+// arguments.  The value argument types are inferred by the compiler.

+// If you want to explicitly specify the value argument types, you can

+// provide additional template arguments:

+//

+//   ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)

+//

+// where u_i is the desired type of v_i.

+//

+// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the

+// number of value parameters, but not on the number of template

+// parameters.  Without the restriction, the meaning of the following

+// is unclear:

+//

+//   OverloadedAction<int, bool>(x);

+//

+// Are we using a single-template-parameter action where 'bool' refers

+// to the type of x, or are we using a two-template-parameter action

+// where the compiler is asked to infer the type of x?

+//

+// Implementation notes:

+//

+// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and

+// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for

+// implementing ACTION_TEMPLATE.  The main trick we use is to create

+// new macro invocations when expanding a macro.  For example, we have

+//

+//   #define ACTION_TEMPLATE(name, template_params, value_params)

+//       ... GMOCK_INTERNAL_DECL_##template_params ...

+//

+// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)

+// to expand to

+//

+//       ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...

+//

+// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the

+// preprocessor will continue to expand it to

+//

+//       ... typename T ...

+//

+// This technique conforms to the C++ standard and is portable.  It

+// allows us to implement action templates using O(N) code, where N is

+// the maximum number of template/value parameters supported.  Without

+// using it, we'd have to devote O(N^2) amount of code to implement all

+// combinations of m and n.

+

+// Declares the template parameters.

+#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0

+#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \

+    name1) kind0 name0, kind1 name1

+#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2) kind0 name0, kind1 name1, kind2 name2

+#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \

+    kind3 name3

+#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \

+    kind2 name2, kind3 name3, kind4 name4

+#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \

+    kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5

+#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \

+    name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \

+    kind5 name5, kind6 name6

+#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \

+    kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \

+    kind4 name4, kind5 name5, kind6 name6, kind7 name7

+#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \

+    kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \

+    kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \

+    kind8 name8

+#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \

+    name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \

+    name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \

+    kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \

+    kind6 name6, kind7 name7, kind8 name8, kind9 name9

+

+// Lists the template parameters.

+#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0

+#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \

+    name1) name0, name1

+#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2) name0, name1, name2

+#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3) name0, name1, name2, name3

+#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \

+    name4

+#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \

+    name2, name3, name4, name5

+#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \

+    name6) name0, name1, name2, name3, name4, name5, name6

+#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \

+    kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7

+#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \

+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \

+    kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \

+    name6, name7, name8

+#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \

+    name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \

+    name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \

+    name3, name4, name5, name6, name7, name8, name9

+

+// Declares the types of value parameters.

+#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()

+#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \

+    typename p0##_type, typename p1##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \

+    typename p0##_type, typename p1##_type, typename p2##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \

+    typename p0##_type, typename p1##_type, typename p2##_type, \

+    typename p3##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \

+    typename p0##_type, typename p1##_type, typename p2##_type, \

+    typename p3##_type, typename p4##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \

+    typename p0##_type, typename p1##_type, typename p2##_type, \

+    typename p3##_type, typename p4##_type, typename p5##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6) , typename p0##_type, typename p1##_type, typename p2##_type, \

+    typename p3##_type, typename p4##_type, typename p5##_type, \

+    typename p6##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \

+    typename p3##_type, typename p4##_type, typename p5##_type, \

+    typename p6##_type, typename p7##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \

+    typename p3##_type, typename p4##_type, typename p5##_type, \

+    typename p6##_type, typename p7##_type, typename p8##_type

+#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \

+    typename p2##_type, typename p3##_type, typename p4##_type, \

+    typename p5##_type, typename p6##_type, typename p7##_type, \

+    typename p8##_type, typename p9##_type

+

+// Initializes the value parameters.

+#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\

+    ()

+#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\

+    (p0##_type gmock_p0) : p0(gmock_p0)

+#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\

+    (p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), p1(gmock_p1)

+#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2)

+#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3)

+#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4)

+#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5)

+#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+        p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6)

+#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+        p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+        p7(gmock_p7)

+#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+        p6##_type gmock_p6, p7##_type gmock_p7, \

+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \

+        p8(gmock_p8)

+#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8, p9)\

+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+        p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \

+        p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \

+        p8(gmock_p8), p9(gmock_p9)

+

+// Declares the fields for storing the value parameters.

+#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()

+#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;

+#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \

+    p1##_type p1;

+#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \

+    p1##_type p1; p2##_type p2;

+#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \

+    p1##_type p1; p2##_type p2; p3##_type p3;

+#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \

+    p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;

+#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \

+    p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \

+    p5##_type p5;

+#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \

+    p5##_type p5; p6##_type p6;

+#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \

+    p5##_type p5; p6##_type p6; p7##_type p7;

+#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \

+    p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;

+#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \

+    p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \

+    p9##_type p9;

+

+// Lists the value parameters.

+#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()

+#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0

+#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1

+#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2

+#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3

+#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \

+    p2, p3, p4

+#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \

+    p1, p2, p3, p4, p5

+#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6) p0, p1, p2, p3, p4, p5, p6

+#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7) p0, p1, p2, p3, p4, p5, p6, p7

+#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8

+#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9

+

+// Lists the value parameter types.

+#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()

+#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \

+    p1##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \

+    p1##_type, p2##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \

+    p0##_type, p1##_type, p2##_type, p3##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \

+    p0##_type, p1##_type, p2##_type, p3##_type, p4##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \

+    p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \

+    p6##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+    p5##_type, p6##_type, p7##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+    p5##_type, p6##_type, p7##_type, p8##_type

+#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+    p5##_type, p6##_type, p7##_type, p8##_type, p9##_type

+

+// Declares the value parameters.

+#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()

+#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0

+#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \

+    p1##_type p1

+#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \

+    p1##_type p1, p2##_type p2

+#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \

+    p1##_type p1, p2##_type p2, p3##_type p3

+#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \

+    p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4

+#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \

+    p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \

+    p5##_type p5

+#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \

+    p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \

+    p5##_type p5, p6##_type p6

+#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \

+    p5##_type p5, p6##_type p6, p7##_type p7

+#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+    p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8

+#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+    p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \

+    p9##_type p9

+

+// The suffix of the class template implementing the action template.

+#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()

+#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P

+#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2

+#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3

+#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4

+#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5

+#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6

+#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7

+#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7) P8

+#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8) P9

+#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \

+    p7, p8, p9) P10

+

+// The name of the class template implementing the action template.

+#define GMOCK_ACTION_CLASS_(name, value_params)\

+    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)

+

+#define ACTION_TEMPLATE(name, template_params, value_params)\

+  template <GMOCK_INTERNAL_DECL_##template_params\

+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\

+  class GMOCK_ACTION_CLASS_(name, value_params) {\

+   public:\

+    GMOCK_ACTION_CLASS_(name, value_params)\

+        GMOCK_INTERNAL_INIT_##value_params {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      GMOCK_INTERNAL_DEFN_##value_params\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(\

+          new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\

+    }\

+    GMOCK_INTERNAL_DEFN_##value_params\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\

+  };\

+  template <GMOCK_INTERNAL_DECL_##template_params\

+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\

+  inline GMOCK_ACTION_CLASS_(name, value_params)<\

+      GMOCK_INTERNAL_LIST_##template_params\

+      GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\

+          GMOCK_INTERNAL_DECL_##value_params) {\

+    return GMOCK_ACTION_CLASS_(name, value_params)<\

+        GMOCK_INTERNAL_LIST_##template_params\

+        GMOCK_INTERNAL_LIST_TYPE_##value_params>(\

+            GMOCK_INTERNAL_LIST_##value_params);\

+  }\

+  template <GMOCK_INTERNAL_DECL_##template_params\

+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      GMOCK_ACTION_CLASS_(name, value_params)<\

+          GMOCK_INTERNAL_LIST_##template_params\

+          GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\

+              gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION(name)\

+  class name##Action {\

+   public:\

+    name##Action() {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl() {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>());\

+    }\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##Action);\

+  };\

+  inline name##Action name() {\

+    return name##Action();\

+  }\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##Action::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P(name, p0)\

+  template <typename p0##_type>\

+  class name##ActionP {\

+   public:\

+    name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      explicit gmock_Impl(p0##_type gmock_p0) : p0(gmock_p0) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0));\

+    }\

+    p0##_type p0;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP);\

+  };\

+  template <typename p0##_type>\

+  inline name##ActionP<p0##_type> name(p0##_type p0) {\

+    return name##ActionP<p0##_type>(p0);\

+  }\

+  template <typename p0##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P2(name, p0, p1)\

+  template <typename p0##_type, typename p1##_type>\

+  class name##ActionP2 {\

+   public:\

+    name##ActionP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \

+        p1(gmock_p1) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \

+          p1(gmock_p1) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP2);\

+  };\

+  template <typename p0##_type, typename p1##_type>\

+  inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \

+      p1##_type p1) {\

+    return name##ActionP2<p0##_type, p1##_type>(p0, p1);\

+  }\

+  template <typename p0##_type, typename p1##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P3(name, p0, p1, p2)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type>\

+  class name##ActionP3 {\

+   public:\

+    name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \

+          p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP3);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type>\

+  inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \

+      p1##_type p1, p2##_type p2) {\

+    return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP3<p0##_type, p1##_type, \

+          p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P4(name, p0, p1, p2, p3)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type>\

+  class name##ActionP4 {\

+   public:\

+    name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+          p3(gmock_p3) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP4);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type>\

+  inline name##ActionP4<p0##_type, p1##_type, p2##_type, \

+      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \

+      p3##_type p3) {\

+    return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \

+        p2, p3);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP4<p0##_type, p1##_type, p2##_type, \

+          p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P5(name, p0, p1, p2, p3, p4)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type>\

+  class name##ActionP5 {\

+   public:\

+    name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, \

+        p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), \

+          p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP5);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type>\

+  inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+      p4##_type p4) {\

+    return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type>(p0, p1, p2, p3, p4);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \

+          p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type>\

+  class name##ActionP6 {\

+   public:\

+    name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, \

+          p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP6);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type>\

+  inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \

+      p3##_type p3, p4##_type p4, p5##_type p5) {\

+    return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+          p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type>\

+  class name##ActionP7 {\

+   public:\

+    name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \

+        p6(gmock_p6) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \

+          p6));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP7);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type>\

+  inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \

+      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \

+      p6##_type p6) {\

+    return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+          p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type>\

+  class name##ActionP8 {\

+   public:\

+    name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6, \

+        p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+        p7(gmock_p7) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), \

+          p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \

+          p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+      p7##_type p7;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \

+          p6, p7));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+    p7##_type p7;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP8);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type>\

+  inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \

+      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \

+      p6##_type p6, p7##_type p7) {\

+    return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \

+        p6, p7);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+          p5##_type, p6##_type, \

+          p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type>\

+  class name##ActionP9 {\

+   public:\

+    name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \

+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \

+        p8(gmock_p8) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6, p7##_type gmock_p7, \

+          p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+          p7(gmock_p7), p8(gmock_p8) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+      p7##_type p7;\

+      p8##_type p8;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \

+          p6, p7, p8));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+    p7##_type p7;\

+    p8##_type p8;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP9);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type>\

+  inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type, \

+      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \

+      p8##_type p8) {\

+    return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \

+        p3, p4, p5, p6, p7, p8);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+          p5##_type, p6##_type, p7##_type, \

+          p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+#define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type, \

+      typename p9##_type>\

+  class name##ActionP10 {\

+   public:\

+    name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \

+        p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+        p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \

+          p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+          p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <typename arg0_type, typename arg1_type, typename arg2_type, \

+          typename arg3_type, typename arg4_type, typename arg5_type, \

+          typename arg6_type, typename arg7_type, typename arg8_type, \

+          typename arg9_type>\

+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \

+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \

+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \

+          arg9_type arg9) const;\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+      p7##_type p7;\

+      p8##_type p8;\

+      p9##_type p9;\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \

+          p6, p7, p8, p9));\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+    p7##_type p7;\

+    p8##_type p8;\

+    p9##_type p9;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##ActionP10);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type, \

+      typename p9##_type>\

+  inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \

+      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \

+      p9##_type p9) {\

+    return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \

+        p1, p2, p3, p4, p5, p6, p7, p8, p9);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type, \

+      typename p9##_type>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+          p5##_type, p6##_type, p7##_type, p8##_type, \

+          p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+namespace testing {

+

+// The ACTION*() macros trigger warning C4100 (unreferenced formal

+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in

+// the macro definition, as the warnings are generated when the macro

+// is expanded and macro expansion cannot contain #pragma.  Therefore

+// we suppress them here.

+#ifdef _MSC_VER

+# pragma warning(push)

+# pragma warning(disable:4100)

+#endif

+

+// Various overloads for InvokeArgument<N>().

+//

+// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th

+// (0-based) argument, which must be a k-ary callable, of the mock

+// function, with arguments a1, a2, ..., a_k.

+//

+// Notes:

+//

+//   1. The arguments are passed by value by default.  If you need to

+//   pass an argument by reference, wrap it inside ByRef().  For

+//   example,

+//

+//     InvokeArgument<1>(5, string("Hello"), ByRef(foo))

+//

+//   passes 5 and string("Hello") by value, and passes foo by

+//   reference.

+//

+//   2. If the callable takes an argument by reference but ByRef() is

+//   not used, it will receive the reference to a copy of the value,

+//   instead of the original value.  For example, when the 0-th

+//   argument of the mock function takes a const string&, the action

+//

+//     InvokeArgument<0>(string("Hello"))

+//

+//   makes a copy of the temporary string("Hello") object and passes a

+//   reference of the copy, instead of the original temporary object,

+//   to the callable.  This makes it easy for a user to define an

+//   InvokeArgument action from temporary values and have it performed

+//   later.

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_0_VALUE_PARAMS()) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args));

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_1_VALUE_PARAMS(p0)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_2_VALUE_PARAMS(p0, p1)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_3_VALUE_PARAMS(p0, p1, p2)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);

+}

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);

+}

+

+// Various overloads for ReturnNew<T>().

+//

+// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new

+// instance of type T, constructed on the heap with constructor arguments

+// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_0_VALUE_PARAMS()) {

+  return new T();

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_1_VALUE_PARAMS(p0)) {

+  return new T(p0);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_2_VALUE_PARAMS(p0, p1)) {

+  return new T(p0, p1);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_3_VALUE_PARAMS(p0, p1, p2)) {

+  return new T(p0, p1, p2);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {

+  return new T(p0, p1, p2, p3);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {

+  return new T(p0, p1, p2, p3, p4);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {

+  return new T(p0, p1, p2, p3, p4, p5);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {

+  return new T(p0, p1, p2, p3, p4, p5, p6);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {

+  return new T(p0, p1, p2, p3, p4, p5, p6, p7);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {

+  return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);

+}

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {

+  return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);

+}

+

+#ifdef _MSC_VER

+# pragma warning(pop)

+#endif

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-actions.h.pump b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-actions.h.pump
new file mode 100644
index 0000000..1a345e2
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-actions.h.pump
@@ -0,0 +1,821 @@
+$$ -*- mode: c++; -*-

+$$ This is a Pump source file.  Please use Pump to convert it to

+$$ gmock-generated-actions.h.

+$$

+$var n = 10  $$ The maximum arity we support.

+$$}} This meta comment fixes auto-indentation in editors.

+// 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 variadic actions.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_

+

+#include "gmock/gmock-actions.h"

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+namespace internal {

+

+// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary

+// function or method with the unpacked values, where F is a function

+// type that takes N arguments.

+template <typename Result, typename ArgumentTuple>

+class InvokeHelper;

+

+

+$range i 0..n

+$for i [[

+$range j 1..i

+$var types = [[$for j [[, typename A$j]]]]

+$var as = [[$for j, [[A$j]]]]

+$var args = [[$if i==0 [[]] $else [[ args]]]]

+$var import = [[$if i==0 [[]] $else [[

+    using ::std::tr1::get;

+

+]]]]

+$var gets = [[$for j, [[get<$(j - 1)>(args)]]]]

+template <typename R$types>

+class InvokeHelper<R, ::std::tr1::tuple<$as> > {

+ public:

+  template <typename Function>

+  static R Invoke(Function function, const ::std::tr1::tuple<$as>&$args) {

+$import    return function($gets);

+  }

+

+  template <class Class, typename MethodPtr>

+  static R InvokeMethod(Class* obj_ptr,

+                        MethodPtr method_ptr,

+                        const ::std::tr1::tuple<$as>&$args) {

+$import    return (obj_ptr->*method_ptr)($gets);

+  }

+};

+

+

+]]

+// CallableHelper has static methods for invoking "callables",

+// i.e. function pointers and functors.  It uses overloading to

+// provide a uniform interface for invoking different kinds of

+// callables.  In particular, you can use:

+//

+//   CallableHelper<R>::Call(callable, a1, a2, ..., an)

+//

+// to invoke an n-ary callable, where R is its return type.  If an

+// argument, say a2, needs to be passed by reference, you should write

+// ByRef(a2) instead of a2 in the above expression.

+template <typename R>

+class CallableHelper {

+ public:

+  // Calls a nullary callable.

+  template <typename Function>

+  static R Call(Function function) { return function(); }

+

+  // Calls a unary callable.

+

+  // We deliberately pass a1 by value instead of const reference here

+  // in case it is a C-string literal.  If we had declared the

+  // parameter as 'const A1& a1' and write Call(function, "Hi"), the

+  // compiler would've thought A1 is 'char[3]', which causes trouble

+  // when you need to copy a value of type A1.  By declaring the

+  // parameter as 'A1 a1', the compiler will correctly infer that A1

+  // is 'const char*' when it sees Call(function, "Hi").

+  //

+  // Since this function is defined inline, the compiler can get rid

+  // of the copying of the arguments.  Therefore the performance won't

+  // be hurt.

+  template <typename Function, typename A1>

+  static R Call(Function function, A1 a1) { return function(a1); }

+

+$range i 2..n

+$for i

+[[

+$var arity = [[$if i==2 [[binary]] $elif i==3 [[ternary]] $else [[$i-ary]]]]

+

+  // Calls a $arity callable.

+

+$range j 1..i

+$var typename_As = [[$for j, [[typename A$j]]]]

+$var Aas = [[$for j, [[A$j a$j]]]]

+$var as = [[$for j, [[a$j]]]]

+$var typename_Ts = [[$for j, [[typename T$j]]]]

+$var Ts = [[$for j, [[T$j]]]]

+  template <typename Function, $typename_As>

+  static R Call(Function function, $Aas) {

+    return function($as);

+  }

+

+]]

+};  // class CallableHelper

+

+// An INTERNAL macro for extracting the type of a tuple field.  It's

+// subject to change without notice - DO NOT USE IN USER CODE!

+#define GMOCK_FIELD_(Tuple, N) \

+    typename ::std::tr1::tuple_element<N, Tuple>::type

+

+$range i 1..n

+

+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the

+// type of an n-ary function whose i-th (1-based) argument type is the

+// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple

+// type, and whose return type is Result.  For example,

+//   SelectArgs<int, ::std::tr1::tuple<bool, char, double, long>, 0, 3>::type

+// is int(bool, long).

+//

+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)

+// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.

+// For example,

+//   SelectArgs<int, ::std::tr1::tuple<bool, char, double>, 2, 0>::Select(

+//       ::std::tr1::make_tuple(true, 'a', 2.5))

+// returns ::std::tr1::tuple (2.5, true).

+//

+// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be

+// in the range [0, $n].  Duplicates are allowed and they don't have

+// to be in an ascending or descending order.

+

+template <typename Result, typename ArgumentTuple, $for i, [[int k$i]]>

+class SelectArgs {

+ public:

+  typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]);

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& args) {

+    using ::std::tr1::get;

+    return SelectedArgs($for i, [[get<k$i>(args)]]);

+  }

+};

+

+

+$for i [[

+$range j 1..n

+$range j1 1..i-1

+template <typename Result, typename ArgumentTuple$for j1[[, int k$j1]]>

+class SelectArgs<Result, ArgumentTuple,

+                 $for j, [[$if j <= i-1 [[k$j]] $else [[-1]]]]> {

+ public:

+  typedef Result type($for j1, [[GMOCK_FIELD_(ArgumentTuple, k$j1)]]);

+  typedef typename Function<type>::ArgumentTuple SelectedArgs;

+  static SelectedArgs Select(const ArgumentTuple& [[]]

+$if i == 1 [[/* args */]] $else [[args]]) {

+    using ::std::tr1::get;

+    return SelectedArgs($for j1, [[get<k$j1>(args)]]);

+  }

+};

+

+

+]]

+#undef GMOCK_FIELD_

+

+$var ks = [[$for i, [[k$i]]]]

+

+// Implements the WithArgs action.

+template <typename InnerAction, $for i, [[int k$i = -1]]>

+class WithArgsAction {

+ public:

+  explicit WithArgsAction(const InnerAction& action) : action_(action) {}

+

+  template <typename F>

+  operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }

+

+ private:

+  template <typename F>

+  class Impl : public ActionInterface<F> {

+   public:

+    typedef typename Function<F>::Result Result;

+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+

+    explicit Impl(const InnerAction& action) : action_(action) {}

+

+    virtual Result Perform(const ArgumentTuple& args) {

+      return action_.Perform(SelectArgs<Result, ArgumentTuple, $ks>::Select(args));

+    }

+

+   private:

+    typedef typename SelectArgs<Result, ArgumentTuple,

+        $ks>::type InnerFunctionType;

+

+    Action<InnerFunctionType> action_;

+  };

+

+  const InnerAction action_;

+

+  GTEST_DISALLOW_ASSIGN_(WithArgsAction);

+};

+

+// A macro from the ACTION* family (defined later in this file)

+// defines an action that can be used in a mock function.  Typically,

+// these actions only care about a subset of the arguments of the mock

+// function.  For example, if such an action only uses the second

+// argument, it can be used in any mock function that takes >= 2

+// arguments where the type of the second argument is compatible.

+//

+// Therefore, the action implementation must be prepared to take more

+// arguments than it needs.  The ExcessiveArg type is used to

+// represent those excessive arguments.  In order to keep the compiler

+// error messages tractable, we define it in the testing namespace

+// instead of testing::internal.  However, this is an INTERNAL TYPE

+// and subject to change without notice, so a user MUST NOT USE THIS

+// TYPE DIRECTLY.

+struct ExcessiveArg {};

+

+// A helper class needed for implementing the ACTION* macros.

+template <typename Result, class Impl>

+class ActionHelper {

+ public:

+$range i 0..n

+$for i

+

+[[

+$var template = [[$if i==0 [[]] $else [[

+$range j 0..i-1

+  template <$for j, [[typename A$j]]>

+]]]]

+$range j 0..i-1

+$var As = [[$for j, [[A$j]]]]

+$var as = [[$for j, [[get<$j>(args)]]]]

+$range k 1..n-i

+$var eas = [[$for k, [[ExcessiveArg()]]]]

+$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]]

+$template

+  static Result Perform(Impl* impl, const ::std::tr1::tuple<$As>& args) {

+    using ::std::tr1::get;

+    return impl->template gmock_PerformImpl<$As>(args, $arg_list);

+  }

+

+]]

+};

+

+}  // namespace internal

+

+// Various overloads for Invoke().

+

+// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes

+// the selected arguments of the mock function to an_action and

+// performs it.  It serves as an adaptor between actions with

+// different argument lists.  C++ doesn't support default arguments for

+// function templates, so we have to overload it.

+

+$range i 1..n

+$for i [[

+$range j 1..i

+template <$for j [[int k$j, ]]typename InnerAction>

+inline internal::WithArgsAction<InnerAction$for j [[, k$j]]>

+WithArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction$for j [[, k$j]]>(action);

+}

+

+

+]]

+// Creates an action that does actions a1, a2, ..., sequentially in

+// each invocation.

+$range i 2..n

+$for i [[

+$range j 2..i

+$var types = [[$for j, [[typename Action$j]]]]

+$var Aas = [[$for j [[, Action$j a$j]]]]

+

+template <typename Action1, $types>

+$range k 1..i-1

+

+inline $for k [[internal::DoBothAction<Action$k, ]]Action$i$for k  [[>]]

+

+DoAll(Action1 a1$Aas) {

+$if i==2 [[

+

+  return internal::DoBothAction<Action1, Action2>(a1, a2);

+]] $else [[

+$range j2 2..i

+

+  return DoAll(a1, DoAll($for j2, [[a$j2]]));

+]]

+

+}

+

+]]

+

+}  // namespace testing

+

+// The ACTION* family of macros can be used in a namespace scope to

+// define custom actions easily.  The syntax:

+//

+//   ACTION(name) { statements; }

+//

+// will define an action with the given name that executes the

+// statements.  The value returned by the statements will be used as

+// the return value of the action.  Inside the statements, you can

+// refer to the K-th (0-based) argument of the mock function by

+// 'argK', and refer to its type by 'argK_type'.  For example:

+//

+//   ACTION(IncrementArg1) {

+//     arg1_type temp = arg1;

+//     return ++(*temp);

+//   }

+//

+// allows you to write

+//

+//   ...WillOnce(IncrementArg1());

+//

+// You can also refer to the entire argument tuple and its type by

+// 'args' and 'args_type', and refer to the mock function type and its

+// return type by 'function_type' and 'return_type'.

+//

+// Note that you don't need to specify the types of the mock function

+// arguments.  However rest assured that your code is still type-safe:

+// you'll get a compiler error if *arg1 doesn't support the ++

+// operator, or if the type of ++(*arg1) isn't compatible with the

+// mock function's return type, for example.

+//

+// Sometimes you'll want to parameterize the action.   For that you can use

+// another macro:

+//

+//   ACTION_P(name, param_name) { statements; }

+//

+// For example:

+//

+//   ACTION_P(Add, n) { return arg0 + n; }

+//

+// will allow you to write:

+//

+//   ...WillOnce(Add(5));

+//

+// Note that you don't need to provide the type of the parameter

+// either.  If you need to reference the type of a parameter named

+// 'foo', you can write 'foo_type'.  For example, in the body of

+// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type

+// of 'n'.

+//

+// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P$n to support

+// multi-parameter actions.

+//

+// For the purpose of typing, you can view

+//

+//   ACTION_Pk(Foo, p1, ..., pk) { ... }

+//

+// as shorthand for

+//

+//   template <typename p1_type, ..., typename pk_type>

+//   FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }

+//

+// In particular, you can provide the template type arguments

+// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);

+// although usually you can rely on the compiler to infer the types

+// for you automatically.  You can assign the result of expression

+// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,

+// pk_type>.  This can be useful when composing actions.

+//

+// You can also overload actions with different numbers of parameters:

+//

+//   ACTION_P(Plus, a) { ... }

+//   ACTION_P2(Plus, a, b) { ... }

+//

+// While it's tempting to always use the ACTION* macros when defining

+// a new action, you should also consider implementing ActionInterface

+// or using MakePolymorphicAction() instead, especially if you need to

+// use the action a lot.  While these approaches require more work,

+// they give you more control on the types of the mock function

+// arguments and the action parameters, which in general leads to

+// better compiler error messages that pay off in the long run.  They

+// also allow overloading actions based on parameter types (as opposed

+// to just based on the number of parameters).

+//

+// CAVEAT:

+//

+// ACTION*() can only be used in a namespace scope.  The reason is

+// that C++ doesn't yet allow function-local types to be used to

+// instantiate templates.  The up-coming C++0x standard will fix this.

+// Once that's done, we'll consider supporting using ACTION*() inside

+// a function.

+//

+// MORE INFORMATION:

+//

+// To learn more about using these macros, please search for 'ACTION'

+// on http://code.google.com/p/googlemock/wiki/CookBook.

+

+$range i 0..n

+$range k 0..n-1

+

+// An internal macro needed for implementing ACTION*().

+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\

+    const args_type& args GTEST_ATTRIBUTE_UNUSED_

+$for k [[, \

+    arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]]

+

+

+// Sometimes you want to give an action explicit template parameters

+// that cannot be inferred from its value parameters.  ACTION() and

+// ACTION_P*() don't support that.  ACTION_TEMPLATE() remedies that

+// and can be viewed as an extension to ACTION() and ACTION_P*().

+//

+// The syntax:

+//

+//   ACTION_TEMPLATE(ActionName,

+//                   HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),

+//                   AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }

+//

+// defines an action template that takes m explicit template

+// parameters and n value parameters.  name_i is the name of the i-th

+// template parameter, and kind_i specifies whether it's a typename,

+// an integral constant, or a template.  p_i is the name of the i-th

+// value parameter.

+//

+// Example:

+//

+//   // DuplicateArg<k, T>(output) converts the k-th argument of the mock

+//   // function to type T and copies it to *output.

+//   ACTION_TEMPLATE(DuplicateArg,

+//                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),

+//                   AND_1_VALUE_PARAMS(output)) {

+//     *output = T(std::tr1::get<k>(args));

+//   }

+//   ...

+//     int n;

+//     EXPECT_CALL(mock, Foo(_, _))

+//         .WillOnce(DuplicateArg<1, unsigned char>(&n));

+//

+// To create an instance of an action template, write:

+//

+//   ActionName<t1, ..., t_m>(v1, ..., v_n)

+//

+// where the ts are the template arguments and the vs are the value

+// arguments.  The value argument types are inferred by the compiler.

+// If you want to explicitly specify the value argument types, you can

+// provide additional template arguments:

+//

+//   ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)

+//

+// where u_i is the desired type of v_i.

+//

+// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the

+// number of value parameters, but not on the number of template

+// parameters.  Without the restriction, the meaning of the following

+// is unclear:

+//

+//   OverloadedAction<int, bool>(x);

+//

+// Are we using a single-template-parameter action where 'bool' refers

+// to the type of x, or are we using a two-template-parameter action

+// where the compiler is asked to infer the type of x?

+//

+// Implementation notes:

+//

+// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and

+// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for

+// implementing ACTION_TEMPLATE.  The main trick we use is to create

+// new macro invocations when expanding a macro.  For example, we have

+//

+//   #define ACTION_TEMPLATE(name, template_params, value_params)

+//       ... GMOCK_INTERNAL_DECL_##template_params ...

+//

+// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)

+// to expand to

+//

+//       ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...

+//

+// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the

+// preprocessor will continue to expand it to

+//

+//       ... typename T ...

+//

+// This technique conforms to the C++ standard and is portable.  It

+// allows us to implement action templates using O(N) code, where N is

+// the maximum number of template/value parameters supported.  Without

+// using it, we'd have to devote O(N^2) amount of code to implement all

+// combinations of m and n.

+

+// Declares the template parameters.

+

+$range j 1..n

+$for j [[

+$range m 0..j-1

+#define GMOCK_INTERNAL_DECL_HAS_$j[[]]

+_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[kind$m name$m]]

+

+

+]]

+

+// Lists the template parameters.

+

+$for j [[

+$range m 0..j-1

+#define GMOCK_INTERNAL_LIST_HAS_$j[[]]

+_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[name$m]]

+

+

+]]

+

+// Declares the types of value parameters.

+

+$for i [[

+$range j 0..i-1

+#define GMOCK_INTERNAL_DECL_TYPE_AND_$i[[]]

+_VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]]

+

+

+]]

+

+// Initializes the value parameters.

+

+$for i [[

+$range j 0..i-1

+#define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\

+    ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(gmock_p$j)]]

+

+

+]]

+

+// Declares the fields for storing the value parameters.

+

+$for i [[

+$range j 0..i-1

+#define GMOCK_INTERNAL_DEFN_AND_$i[[]]

+_VALUE_PARAMS($for j, [[p$j]]) $for j [[p$j##_type p$j; ]]

+

+

+]]

+

+// Lists the value parameters.

+

+$for i [[

+$range j 0..i-1

+#define GMOCK_INTERNAL_LIST_AND_$i[[]]

+_VALUE_PARAMS($for j, [[p$j]]) $for j, [[p$j]]

+

+

+]]

+

+// Lists the value parameter types.

+

+$for i [[

+$range j 0..i-1

+#define GMOCK_INTERNAL_LIST_TYPE_AND_$i[[]]

+_VALUE_PARAMS($for j, [[p$j]]) $for j [[, p$j##_type]]

+

+

+]]

+

+// Declares the value parameters.

+

+$for i [[

+$range j 0..i-1

+#define GMOCK_INTERNAL_DECL_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]

+$for j, [[p$j##_type p$j]]

+

+

+]]

+

+// The suffix of the class template implementing the action template.

+$for i [[

+

+

+$range j 0..i-1

+#define GMOCK_INTERNAL_COUNT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]

+$if i==1 [[P]] $elif i>=2 [[P$i]]

+]]

+

+

+// The name of the class template implementing the action template.

+#define GMOCK_ACTION_CLASS_(name, value_params)\

+    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)

+

+$range k 0..n-1

+

+#define ACTION_TEMPLATE(name, template_params, value_params)\

+  template <GMOCK_INTERNAL_DECL_##template_params\

+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\

+  class GMOCK_ACTION_CLASS_(name, value_params) {\

+   public:\

+    GMOCK_ACTION_CLASS_(name, value_params)\

+        GMOCK_INTERNAL_INIT_##value_params {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <$for k, [[typename arg$k[[]]_type]]>\

+      return_type gmock_PerformImpl(const args_type& args[[]]

+$for k [[, arg$k[[]]_type arg$k]]) const;\

+      GMOCK_INTERNAL_DEFN_##value_params\

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(\

+          new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\

+    }\

+    GMOCK_INTERNAL_DEFN_##value_params\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\

+  };\

+  template <GMOCK_INTERNAL_DECL_##template_params\

+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\

+  inline GMOCK_ACTION_CLASS_(name, value_params)<\

+      GMOCK_INTERNAL_LIST_##template_params\

+      GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\

+          GMOCK_INTERNAL_DECL_##value_params) {\

+    return GMOCK_ACTION_CLASS_(name, value_params)<\

+        GMOCK_INTERNAL_LIST_##template_params\

+        GMOCK_INTERNAL_LIST_TYPE_##value_params>(\

+            GMOCK_INTERNAL_LIST_##value_params);\

+  }\

+  template <GMOCK_INTERNAL_DECL_##template_params\

+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\

+  template <typename F>\

+  template <typename arg0_type, typename arg1_type, typename arg2_type, \

+      typename arg3_type, typename arg4_type, typename arg5_type, \

+      typename arg6_type, typename arg7_type, typename arg8_type, \

+      typename arg9_type>\

+  typename ::testing::internal::Function<F>::Result\

+      GMOCK_ACTION_CLASS_(name, value_params)<\

+          GMOCK_INTERNAL_LIST_##template_params\

+          GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\

+              gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+

+$for i

+

+[[

+$var template = [[$if i==0 [[]] $else [[

+$range j 0..i-1

+

+  template <$for j, [[typename p$j##_type]]>\

+]]]]

+$var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]]

+                                                $else [[P$i]]]]]]

+$range j 0..i-1

+$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]

+$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]

+$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]

+$var param_field_decls = [[$for j

+[[

+

+      p$j##_type p$j;\

+]]]]

+$var param_field_decls2 = [[$for j

+[[

+

+    p$j##_type p$j;\

+]]]]

+$var params = [[$for j, [[p$j]]]]

+$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]

+$var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]]

+$var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]]

+$var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]]

+                                        $else [[ACTION_P$i]]]]

+

+#define $macro_name(name$for j [[, p$j]])\$template

+  class $class_name {\

+   public:\

+    $class_name($ctor_param_list)$inits {}\

+    template <typename F>\

+    class gmock_Impl : public ::testing::ActionInterface<F> {\

+     public:\

+      typedef F function_type;\

+      typedef typename ::testing::internal::Function<F>::Result return_type;\

+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\

+          args_type;\

+      [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\

+      virtual return_type Perform(const args_type& args) {\

+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\

+            Perform(this, args);\

+      }\

+      template <$typename_arg_types>\

+      return_type gmock_PerformImpl(const args_type& args, [[]]

+$arg_types_and_names) const;\$param_field_decls

+     private:\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename F> operator ::testing::Action<F>() const {\

+      return ::testing::Action<F>(new gmock_Impl<F>($params));\

+    }\$param_field_decls2

+   private:\

+    GTEST_DISALLOW_ASSIGN_($class_name);\

+  };\$template

+  inline $class_name$param_types name($param_types_and_names) {\

+    return $class_name$param_types($params);\

+  }\$template

+  template <typename F>\

+  template <$typename_arg_types>\

+  typename ::testing::internal::Function<F>::Result\

+      $class_name$param_types::gmock_Impl<F>::gmock_PerformImpl(\

+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const

+]]

+$$ }  // This meta comment fixes auto-indentation in Emacs.  It won't

+$$    // show up in the generated code.

+

+

+namespace testing {

+

+// The ACTION*() macros trigger warning C4100 (unreferenced formal

+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in

+// the macro definition, as the warnings are generated when the macro

+// is expanded and macro expansion cannot contain #pragma.  Therefore

+// we suppress them here.

+#ifdef _MSC_VER

+# pragma warning(push)

+# pragma warning(disable:4100)

+#endif

+

+// Various overloads for InvokeArgument<N>().

+//

+// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th

+// (0-based) argument, which must be a k-ary callable, of the mock

+// function, with arguments a1, a2, ..., a_k.

+//

+// Notes:

+//

+//   1. The arguments are passed by value by default.  If you need to

+//   pass an argument by reference, wrap it inside ByRef().  For

+//   example,

+//

+//     InvokeArgument<1>(5, string("Hello"), ByRef(foo))

+//

+//   passes 5 and string("Hello") by value, and passes foo by

+//   reference.

+//

+//   2. If the callable takes an argument by reference but ByRef() is

+//   not used, it will receive the reference to a copy of the value,

+//   instead of the original value.  For example, when the 0-th

+//   argument of the mock function takes a const string&, the action

+//

+//     InvokeArgument<0>(string("Hello"))

+//

+//   makes a copy of the temporary string("Hello") object and passes a

+//   reference of the copy, instead of the original temporary object,

+//   to the callable.  This makes it easy for a user to define an

+//   InvokeArgument action from temporary values and have it performed

+//   later.

+

+$range i 0..n

+$for i [[

+$range j 0..i-1

+

+ACTION_TEMPLATE(InvokeArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])) {

+  return internal::CallableHelper<return_type>::Call(

+      ::std::tr1::get<k>(args)$for j [[, p$j]]);

+}

+

+]]

+

+// Various overloads for ReturnNew<T>().

+//

+// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new

+// instance of type T, constructed on the heap with constructor arguments

+// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.

+$range i 0..n

+$for i [[

+$range j 0..i-1

+$var ps = [[$for j, [[p$j]]]]

+

+ACTION_TEMPLATE(ReturnNew,

+                HAS_1_TEMPLATE_PARAMS(typename, T),

+                AND_$i[[]]_VALUE_PARAMS($ps)) {

+  return new T($ps);

+}

+

+]]

+

+#ifdef _MSC_VER

+# pragma warning(pop)

+#endif

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-function-mockers.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-function-mockers.h
new file mode 100644
index 0000000..7b46f1f
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-function-mockers.h
@@ -0,0 +1,991 @@
+// This file was GENERATED by command:

+//     pump.py gmock-generated-function-mockers.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 implements function mockers of various arities.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

+

+#include "gmock/gmock-spec-builders.h"

+#include "gmock/internal/gmock-internal-utils.h"

+

+namespace testing {

+namespace internal {

+

+template <typename F>

+class FunctionMockerBase;

+

+// Note: class FunctionMocker really belongs to the ::testing

+// namespace.  However if we define it in ::testing, MSVC will

+// complain when classes in ::testing::internal declare it as a

+// friend class template.  To workaround this compiler bug, we define

+// FunctionMocker in ::testing::internal and import it into ::testing.

+template <typename F>

+class FunctionMocker;

+

+template <typename R>

+class FunctionMocker<R()> : public

+    internal::FunctionMockerBase<R()> {

+ public:

+  typedef R F();

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With() {

+    return this->current_spec();

+  }

+

+  R Invoke() {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple());

+  }

+};

+

+template <typename R, typename A1>

+class FunctionMocker<R(A1)> : public

+    internal::FunctionMockerBase<R(A1)> {

+ public:

+  typedef R F(A1);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1));

+  }

+};

+

+template <typename R, typename A1, typename A2>

+class FunctionMocker<R(A1, A2)> : public

+    internal::FunctionMockerBase<R(A1, A2)> {

+ public:

+  typedef R F(A1, A2);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3>

+class FunctionMocker<R(A1, A2, A3)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3)> {

+ public:

+  typedef R F(A1, A2, A3);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4>

+class FunctionMocker<R(A1, A2, A3, A4)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4)> {

+ public:

+  typedef R F(A1, A2, A3, A4);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5>

+class FunctionMocker<R(A1, A2, A3, A4, A5)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {

+ public:

+  typedef R F(A1, A2, A3, A4, A5);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4,

+        m5));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6>

+class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {

+ public:

+  typedef R F(A1, A2, A3, A4, A5, A6);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,

+      const Matcher<A6>& m6) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,

+        m6));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7>

+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {

+ public:

+  typedef R F(A1, A2, A3, A4, A5, A6, A7);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,

+      const Matcher<A6>& m6, const Matcher<A7>& m7) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,

+        m6, m7));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8>

+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {

+ public:

+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,

+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,

+        m6, m7, m8));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8, typename A9>

+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {

+ public:

+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,

+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,

+      const Matcher<A9>& m9) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,

+        m6, m7, m8, m9));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));

+  }

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8, typename A9,

+    typename A10>

+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public

+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {

+ public:

+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,

+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,

+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,

+      const Matcher<A9>& m9, const Matcher<A10>& m10) {

+    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,

+        m6, m7, m8, m9, m10));

+    return this->current_spec();

+  }

+

+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,

+      A10 a10) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,

+        a10));

+  }

+};

+

+}  // namespace internal

+

+// The style guide prohibits "using" statements in a namespace scope

+// inside a header file.  However, the FunctionMocker class template

+// is meant to be defined in the ::testing namespace.  The following

+// line is just a trick for working around a bug in MSVC 8.0, which

+// cannot handle it if we define FunctionMocker in ::testing.

+using internal::FunctionMocker;

+

+// GMOCK_RESULT_(tn, F) expands to the result type of function type F.

+// We define this as a variadic macro in case F contains unprotected

+// commas (the same reason that we use variadic macros in other places

+// in this file).

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_RESULT_(tn, ...) \

+    tn ::testing::internal::Function<__VA_ARGS__>::Result

+

+// The type of argument N of the given function type.

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_ARG_(tn, N, ...) \

+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N

+

+// The matcher type for argument N of the given function type.

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_MATCHER_(tn, N, ...) \

+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&

+

+// The variable for mocking the given method.

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_MOCKER_(arity, constness, Method) \

+    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      ) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 0), \

+        this_method_does_not_take_0_arguments); \

+    GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(0, constness, Method).Invoke(); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method() constness { \

+    GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(0, constness, Method).With(); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 1), \

+        this_method_does_not_take_1_argument); \

+    GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \

+    GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 2), \

+        this_method_does_not_take_2_arguments); \

+    GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \

+    GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 3), \

+        this_method_does_not_take_3_arguments); \

+    GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \

+    GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 4), \

+        this_method_does_not_take_4_arguments); \

+    GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \

+    GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \

+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 5), \

+        this_method_does_not_take_5_arguments); \

+    GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \

+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \

+    GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \

+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \

+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 6), \

+        this_method_does_not_take_6_arguments); \

+    GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \

+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \

+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \

+    GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \

+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \

+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \

+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 7), \

+        this_method_does_not_take_7_arguments); \

+    GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \

+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \

+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \

+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \

+    GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \

+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \

+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \

+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \

+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 8), \

+        this_method_does_not_take_8_arguments); \

+    GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \

+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \

+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \

+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \

+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \

+    GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \

+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \

+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \

+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \

+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \

+      GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 9), \

+        this_method_does_not_take_9_arguments); \

+    GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \

+        gmock_a9); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \

+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \

+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \

+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \

+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \

+                     GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \

+    GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \

+        gmock_a9); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \

+      Method)

+

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \

+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \

+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \

+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \

+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \

+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \

+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \

+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \

+      GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \

+      GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \

+            == 10), \

+        this_method_does_not_take_10_arguments); \

+    GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \

+        gmock_a10); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \

+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \

+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \

+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \

+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \

+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \

+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \

+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \

+                     GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \

+                     GMOCK_MATCHER_(tn, 10, \

+                         __VA_ARGS__) gmock_a10) constness { \

+    GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \

+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \

+        gmock_a10); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \

+      Method)

+

+#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)

+#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)

+

+#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)

+

+#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)

+#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)

+

+#define MOCK_CONST_METHOD0_T(m, ...) \

+    GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD1_T(m, ...) \

+    GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD2_T(m, ...) \

+    GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD3_T(m, ...) \

+    GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD4_T(m, ...) \

+    GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD5_T(m, ...) \

+    GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD6_T(m, ...) \

+    GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD7_T(m, ...) \

+    GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD8_T(m, ...) \

+    GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD9_T(m, ...) \

+    GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)

+#define MOCK_CONST_METHOD10_T(m, ...) \

+    GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)

+

+#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)

+

+#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)

+

+#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)

+#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)

+

+#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)

+#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)

+

+// A MockFunction<F> class has one mock method whose type is F.  It is

+// useful when you just want your test code to emit some messages and

+// have Google Mock verify the right messages are sent (and perhaps at

+// the right times).  For example, if you are exercising code:

+//

+//   Foo(1);

+//   Foo(2);

+//   Foo(3);

+//

+// and want to verify that Foo(1) and Foo(3) both invoke

+// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:

+//

+// TEST(FooTest, InvokesBarCorrectly) {

+//   MyMock mock;

+//   MockFunction<void(string check_point_name)> check;

+//   {

+//     InSequence s;

+//

+//     EXPECT_CALL(mock, Bar("a"));

+//     EXPECT_CALL(check, Call("1"));

+//     EXPECT_CALL(check, Call("2"));

+//     EXPECT_CALL(mock, Bar("a"));

+//   }

+//   Foo(1);

+//   check.Call("1");

+//   Foo(2);

+//   check.Call("2");

+//   Foo(3);

+// }

+//

+// The expectation spec says that the first Bar("a") must happen

+// before check point "1", the second Bar("a") must happen after check

+// point "2", and nothing should happen between the two check

+// points. The explicit check points make it easy to tell which

+// Bar("a") is called by which call to Foo().

+template <typename F>

+class MockFunction;

+

+template <typename R>

+class MockFunction<R()> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD0_T(Call, R());

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0>

+class MockFunction<R(A0)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD1_T(Call, R(A0));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1>

+class MockFunction<R(A0, A1)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD2_T(Call, R(A0, A1));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2>

+class MockFunction<R(A0, A1, A2)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD3_T(Call, R(A0, A1, A2));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3>

+class MockFunction<R(A0, A1, A2, A3)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3,

+    typename A4>

+class MockFunction<R(A0, A1, A2, A3, A4)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3,

+    typename A4, typename A5>

+class MockFunction<R(A0, A1, A2, A3, A4, A5)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3,

+    typename A4, typename A5, typename A6>

+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3,

+    typename A4, typename A5, typename A6, typename A7>

+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3,

+    typename A4, typename A5, typename A6, typename A7, typename A8>

+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+template <typename R, typename A0, typename A1, typename A2, typename A3,

+    typename A4, typename A5, typename A6, typename A7, typename A8,

+    typename A9>

+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump
new file mode 100644
index 0000000..b845df4
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump
@@ -0,0 +1,265 @@
+$$ -*- mode: c++; -*-

+$$ This is a Pump source file.  Please use Pump to convert it to

+$$ gmock-generated-function-mockers.h.

+$$

+$var n = 10  $$ The maximum arity we support.

+// 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 function mockers of various arities.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

+

+#include "gmock/gmock-spec-builders.h"

+#include "gmock/internal/gmock-internal-utils.h"

+

+namespace testing {

+namespace internal {

+

+template <typename F>

+class FunctionMockerBase;

+

+// Note: class FunctionMocker really belongs to the ::testing

+// namespace.  However if we define it in ::testing, MSVC will

+// complain when classes in ::testing::internal declare it as a

+// friend class template.  To workaround this compiler bug, we define

+// FunctionMocker in ::testing::internal and import it into ::testing.

+template <typename F>

+class FunctionMocker;

+

+

+$range i 0..n

+$for i [[

+$range j 1..i

+$var typename_As = [[$for j [[, typename A$j]]]]

+$var As = [[$for j, [[A$j]]]]

+$var as = [[$for j, [[a$j]]]]

+$var Aas = [[$for j, [[A$j a$j]]]]

+$var ms = [[$for j, [[m$j]]]]

+$var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]]

+template <typename R$typename_As>

+class FunctionMocker<R($As)> : public

+    internal::FunctionMockerBase<R($As)> {

+ public:

+  typedef R F($As);

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+

+  MockSpec<F>& With($matchers) {

+

+$if i >= 1 [[

+    this->current_spec().SetMatchers(::std::tr1::make_tuple($ms));

+

+]]

+    return this->current_spec();

+  }

+

+  R Invoke($Aas) {

+    // Even though gcc and MSVC don't enforce it, 'this->' is required

+    // by the C++ standard [14.6.4] here, as the base class type is

+    // dependent on the template argument (and thus shouldn't be

+    // looked into when resolving InvokeWith).

+    return this->InvokeWith(ArgumentTuple($as));

+  }

+};

+

+

+]]

+}  // namespace internal

+

+// The style guide prohibits "using" statements in a namespace scope

+// inside a header file.  However, the FunctionMocker class template

+// is meant to be defined in the ::testing namespace.  The following

+// line is just a trick for working around a bug in MSVC 8.0, which

+// cannot handle it if we define FunctionMocker in ::testing.

+using internal::FunctionMocker;

+

+// GMOCK_RESULT_(tn, F) expands to the result type of function type F.

+// We define this as a variadic macro in case F contains unprotected

+// commas (the same reason that we use variadic macros in other places

+// in this file).

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_RESULT_(tn, ...) \

+    tn ::testing::internal::Function<__VA_ARGS__>::Result

+

+// The type of argument N of the given function type.

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_ARG_(tn, N, ...) \

+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N

+

+// The matcher type for argument N of the given function type.

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_MATCHER_(tn, N, ...) \

+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&

+

+// The variable for mocking the given method.

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_MOCKER_(arity, constness, Method) \

+    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)

+

+

+$for i [[

+$range j 1..i

+$var arg_as = [[$for j, \

+      [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]]

+$var as = [[$for j, [[gmock_a$j]]]]

+$var matcher_as = [[$for j, \

+                     [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]]

+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!

+#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \

+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \

+      $arg_as) constness { \

+    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \

+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \

+        this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \

+    GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \

+    return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \

+  } \

+  ::testing::MockSpec<__VA_ARGS__>& \

+      gmock_##Method($matcher_as) constness { \

+    GMOCK_MOCKER_($i, constness, Method).RegisterOwner(this); \

+    return GMOCK_MOCKER_($i, constness, Method).With($as); \

+  } \

+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_($i, constness, Method)

+

+

+]]

+$for i [[

+#define MOCK_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, , , m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_CONST_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, const, , m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_METHOD$i[[]]_T(m, ...) GMOCK_METHOD$i[[]]_(typename, , , m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_CONST_METHOD$i[[]]_T(m, ...) \

+    GMOCK_METHOD$i[[]]_(typename, const, , m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD$i[[]]_(, , ct, m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD$i[[]]_(, const, ct, m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD$i[[]]_(typename, , ct, m, __VA_ARGS__)

+

+]]

+

+

+$for i [[

+#define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \

+    GMOCK_METHOD$i[[]]_(typename, const, ct, m, __VA_ARGS__)

+

+]]

+

+// A MockFunction<F> class has one mock method whose type is F.  It is

+// useful when you just want your test code to emit some messages and

+// have Google Mock verify the right messages are sent (and perhaps at

+// the right times).  For example, if you are exercising code:

+//

+//   Foo(1);

+//   Foo(2);

+//   Foo(3);

+//

+// and want to verify that Foo(1) and Foo(3) both invoke

+// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:

+//

+// TEST(FooTest, InvokesBarCorrectly) {

+//   MyMock mock;

+//   MockFunction<void(string check_point_name)> check;

+//   {

+//     InSequence s;

+//

+//     EXPECT_CALL(mock, Bar("a"));

+//     EXPECT_CALL(check, Call("1"));

+//     EXPECT_CALL(check, Call("2"));

+//     EXPECT_CALL(mock, Bar("a"));

+//   }

+//   Foo(1);

+//   check.Call("1");

+//   Foo(2);

+//   check.Call("2");

+//   Foo(3);

+// }

+//

+// The expectation spec says that the first Bar("a") must happen

+// before check point "1", the second Bar("a") must happen after check

+// point "2", and nothing should happen between the two check

+// points. The explicit check points make it easy to tell which

+// Bar("a") is called by which call to Foo().

+template <typename F>

+class MockFunction;

+

+

+$for i [[

+$range j 0..i-1

+template <typename R$for j [[, typename A$j]]>

+class MockFunction<R($for j, [[A$j]])> {

+ public:

+  MockFunction() {}

+

+  MOCK_METHOD$i[[]]_T(Call, R($for j, [[A$j]]));

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);

+};

+

+

+]]

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-matchers.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-matchers.h
new file mode 100644
index 0000000..6112e56
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-matchers.h
@@ -0,0 +1,2190 @@
+// This file was GENERATED by command:

+//     pump.py gmock-generated-matchers.h.pump

+// DO NOT EDIT BY HAND!!!

+

+// 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.

+

+// Google Mock - a framework for writing C++ mock classes.

+//

+// This file implements some commonly used variadic matchers.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

+

+#include <iterator>

+#include <sstream>

+#include <string>

+#include <vector>

+#include "gmock/gmock-matchers.h"

+

+namespace testing {

+namespace internal {

+

+// The type of the i-th (0-based) field of Tuple.

+#define GMOCK_FIELD_TYPE_(Tuple, i) \

+    typename ::std::tr1::tuple_element<i, Tuple>::type

+

+// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a

+// tuple of type Tuple.  It has two members:

+//

+//   type: a tuple type whose i-th field is the ki-th field of Tuple.

+//   GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.

+//

+// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:

+//

+//   type is tuple<int, bool>, and

+//   GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).

+

+template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,

+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,

+    int k9 = -1>

+class TupleFields;

+

+// This generic version is used when there are 10 selectors.

+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,

+    int k7, int k8, int k9>

+class TupleFields {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),

+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),

+      GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),

+      GMOCK_FIELD_TYPE_(Tuple, k9)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),

+        get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));

+  }

+};

+

+// The following specialization is used for 0 ~ 9 selectors.

+

+template <class Tuple>

+class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<> type;

+  static type GetSelectedFields(const Tuple& /* t */) {

+    using ::std::tr1::get;

+    return type();

+  }

+};

+

+template <class Tuple, int k0>

+class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1>

+class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2>

+class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2, int k3>

+class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2, int k3, int k4>

+class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>

+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),

+      GMOCK_FIELD_TYPE_(Tuple, k5)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),

+        get<k5>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>

+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),

+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),

+        get<k5>(t), get<k6>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,

+    int k7>

+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),

+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),

+      GMOCK_FIELD_TYPE_(Tuple, k7)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),

+        get<k5>(t), get<k6>(t), get<k7>(t));

+  }

+};

+

+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,

+    int k7, int k8>

+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {

+ public:

+  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),

+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),

+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),

+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),

+      GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),

+        get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));

+  }

+};

+

+#undef GMOCK_FIELD_TYPE_

+

+// Implements the Args() matcher.

+template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,

+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,

+    int k9 = -1>

+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {

+ public:

+  // ArgsTuple may have top-level const or reference modifiers.

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;

+  typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,

+      k6, k7, k8, k9>::type SelectedArgs;

+  typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;

+

+  template <typename InnerMatcher>

+  explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)

+      : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}

+

+  virtual bool MatchAndExplain(ArgsTuple args,

+                               MatchResultListener* listener) const {

+    const SelectedArgs& selected_args = GetSelectedArgs(args);

+    if (!listener->IsInterested())

+      return inner_matcher_.Matches(selected_args);

+

+    PrintIndices(listener->stream());

+    *listener << "are " << PrintToString(selected_args);

+

+    StringMatchResultListener inner_listener;

+    const bool match = inner_matcher_.MatchAndExplain(selected_args,

+                                                      &inner_listener);

+    PrintIfNotEmpty(inner_listener.str(), listener->stream());

+    return match;

+  }

+

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "are a tuple ";

+    PrintIndices(os);

+    inner_matcher_.DescribeTo(os);

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "are a tuple ";

+    PrintIndices(os);

+    inner_matcher_.DescribeNegationTo(os);

+  }

+

+ private:

+  static SelectedArgs GetSelectedArgs(ArgsTuple args) {

+    return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,

+        k9>::GetSelectedFields(args);

+  }

+

+  // Prints the indices of the selected fields.

+  static void PrintIndices(::std::ostream* os) {

+    *os << "whose fields (";

+    const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };

+    for (int i = 0; i < 10; i++) {

+      if (indices[i] < 0)

+        break;

+

+      if (i >= 1)

+        *os << ", ";

+

+      *os << "#" << indices[i];

+    }

+    *os << ") ";

+  }

+

+  const MonomorphicInnerMatcher inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);

+};

+

+template <class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,

+    int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,

+    int k8 = -1, int k9 = -1>

+class ArgsMatcher {

+ public:

+  explicit ArgsMatcher(const InnerMatcher& inner_matcher)

+      : inner_matcher_(inner_matcher) {}

+

+  template <typename ArgsTuple>

+  operator Matcher<ArgsTuple>() const {

+    return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,

+        k6, k7, k8, k9>(inner_matcher_));

+  }

+

+ private:

+  const InnerMatcher inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(ArgsMatcher);

+};

+

+// A set of metafunctions for computing the result type of AllOf.

+// AllOf(m1, ..., mN) returns

+// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.

+

+// Although AllOf isn't defined for one argument, AllOfResult1 is defined

+// to simplify the implementation.

+template <typename M1>

+struct AllOfResult1 {

+  typedef M1 type;

+};

+

+template <typename M1, typename M2>

+struct AllOfResult2 {

+  typedef BothOfMatcher<

+      typename AllOfResult1<M1>::type,

+      typename AllOfResult1<M2>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3>

+struct AllOfResult3 {

+  typedef BothOfMatcher<

+      typename AllOfResult1<M1>::type,

+      typename AllOfResult2<M2, M3>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4>

+struct AllOfResult4 {

+  typedef BothOfMatcher<

+      typename AllOfResult2<M1, M2>::type,

+      typename AllOfResult2<M3, M4>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5>

+struct AllOfResult5 {

+  typedef BothOfMatcher<

+      typename AllOfResult2<M1, M2>::type,

+      typename AllOfResult3<M3, M4, M5>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6>

+struct AllOfResult6 {

+  typedef BothOfMatcher<

+      typename AllOfResult3<M1, M2, M3>::type,

+      typename AllOfResult3<M4, M5, M6>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7>

+struct AllOfResult7 {

+  typedef BothOfMatcher<

+      typename AllOfResult3<M1, M2, M3>::type,

+      typename AllOfResult4<M4, M5, M6, M7>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8>

+struct AllOfResult8 {

+  typedef BothOfMatcher<

+      typename AllOfResult4<M1, M2, M3, M4>::type,

+      typename AllOfResult4<M5, M6, M7, M8>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9>

+struct AllOfResult9 {

+  typedef BothOfMatcher<

+      typename AllOfResult4<M1, M2, M3, M4>::type,

+      typename AllOfResult5<M5, M6, M7, M8, M9>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9, typename M10>

+struct AllOfResult10 {

+  typedef BothOfMatcher<

+      typename AllOfResult5<M1, M2, M3, M4, M5>::type,

+      typename AllOfResult5<M6, M7, M8, M9, M10>::type

+  > type;

+};

+

+// A set of metafunctions for computing the result type of AnyOf.

+// AnyOf(m1, ..., mN) returns

+// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.

+

+// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined

+// to simplify the implementation.

+template <typename M1>

+struct AnyOfResult1 {

+  typedef M1 type;

+};

+

+template <typename M1, typename M2>

+struct AnyOfResult2 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult1<M1>::type,

+      typename AnyOfResult1<M2>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3>

+struct AnyOfResult3 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult1<M1>::type,

+      typename AnyOfResult2<M2, M3>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4>

+struct AnyOfResult4 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult2<M1, M2>::type,

+      typename AnyOfResult2<M3, M4>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5>

+struct AnyOfResult5 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult2<M1, M2>::type,

+      typename AnyOfResult3<M3, M4, M5>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6>

+struct AnyOfResult6 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult3<M1, M2, M3>::type,

+      typename AnyOfResult3<M4, M5, M6>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7>

+struct AnyOfResult7 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult3<M1, M2, M3>::type,

+      typename AnyOfResult4<M4, M5, M6, M7>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8>

+struct AnyOfResult8 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult4<M1, M2, M3, M4>::type,

+      typename AnyOfResult4<M5, M6, M7, M8>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9>

+struct AnyOfResult9 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult4<M1, M2, M3, M4>::type,

+      typename AnyOfResult5<M5, M6, M7, M8, M9>::type

+  > type;

+};

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9, typename M10>

+struct AnyOfResult10 {

+  typedef EitherOfMatcher<

+      typename AnyOfResult5<M1, M2, M3, M4, M5>::type,

+      typename AnyOfResult5<M6, M7, M8, M9, M10>::type

+  > type;

+};

+

+}  // namespace internal

+

+// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected

+// fields of it matches a_matcher.  C++ doesn't support default

+// arguments for function templates, so we have to overload it.

+template <typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher>(matcher);

+}

+

+template <int k1, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1>(matcher);

+}

+

+template <int k1, int k2, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2>(matcher);

+}

+

+template <int k1, int k2, int k3, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,

+    typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6,

+      k7>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,

+    typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7,

+      k8>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,

+    int k9, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,

+      k9>(matcher);

+}

+

+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,

+    int k9, int k10, typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,

+    k10>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,

+      k9, k10>(matcher);

+}

+

+// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with

+// n elements, where the i-th element in the container must

+// match the i-th argument in the list.  Each argument of

+// ElementsAre() can be either a value or a matcher.  We support up to

+// 10 arguments.

+//

+// The use of DecayArray in the implementation allows ElementsAre()

+// to accept string literals, whose type is const char[N], but we

+// want to treat them as const char*.

+//

+// NOTE: Since ElementsAre() cares about the order of the elements, it

+// must not be used with containers whose elements's order is

+// undefined (e.g. hash_map).

+

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<> >

+ElementsAre() {

+  typedef std::tr1::tuple<> Args;

+  return internal::ElementsAreMatcher<Args>(Args());

+}

+

+template <typename T1>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type> >

+ElementsAre(const T1& e1) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1));

+}

+

+template <typename T1, typename T2>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type> >

+ElementsAre(const T1& e1, const T2& e2) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2));

+}

+

+template <typename T1, typename T2, typename T3>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3));

+}

+

+template <typename T1, typename T2, typename T3, typename T4>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type,

+        typename internal::DecayArray<T8>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7, const T8& e8) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type,

+      typename internal::DecayArray<T8>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,

+      e8));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type,

+        typename internal::DecayArray<T8>::type,

+        typename internal::DecayArray<T9>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type,

+      typename internal::DecayArray<T8>::type,

+      typename internal::DecayArray<T9>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,

+      e8, e9));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type,

+        typename internal::DecayArray<T8>::type,

+        typename internal::DecayArray<T9>::type,

+        typename internal::DecayArray<T10>::type> >

+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,

+    const T10& e10) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type,

+      typename internal::DecayArray<T8>::type,

+      typename internal::DecayArray<T9>::type,

+      typename internal::DecayArray<T10>::type> Args;

+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,

+      e8, e9, e10));

+}

+

+// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension

+// that matches n elements in any order.  We support up to n=10 arguments.

+

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<> >

+UnorderedElementsAre() {

+  typedef std::tr1::tuple<> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args());

+}

+

+template <typename T1>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type> >

+UnorderedElementsAre(const T1& e1) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1));

+}

+

+template <typename T1, typename T2>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2));

+}

+

+template <typename T1, typename T2, typename T3>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3));

+}

+

+template <typename T1, typename T2, typename T3, typename T4>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,

+      e6));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,

+      e6, e7));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type,

+        typename internal::DecayArray<T8>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7, const T8& e8) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type,

+      typename internal::DecayArray<T8>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,

+      e6, e7, e8));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type,

+        typename internal::DecayArray<T8>::type,

+        typename internal::DecayArray<T9>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type,

+      typename internal::DecayArray<T8>::type,

+      typename internal::DecayArray<T9>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,

+      e6, e7, e8, e9));

+}

+

+template <typename T1, typename T2, typename T3, typename T4, typename T5,

+    typename T6, typename T7, typename T8, typename T9, typename T10>

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+        typename internal::DecayArray<T1>::type,

+        typename internal::DecayArray<T2>::type,

+        typename internal::DecayArray<T3>::type,

+        typename internal::DecayArray<T4>::type,

+        typename internal::DecayArray<T5>::type,

+        typename internal::DecayArray<T6>::type,

+        typename internal::DecayArray<T7>::type,

+        typename internal::DecayArray<T8>::type,

+        typename internal::DecayArray<T9>::type,

+        typename internal::DecayArray<T10>::type> >

+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,

+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,

+    const T10& e10) {

+  typedef std::tr1::tuple<

+      typename internal::DecayArray<T1>::type,

+      typename internal::DecayArray<T2>::type,

+      typename internal::DecayArray<T3>::type,

+      typename internal::DecayArray<T4>::type,

+      typename internal::DecayArray<T5>::type,

+      typename internal::DecayArray<T6>::type,

+      typename internal::DecayArray<T7>::type,

+      typename internal::DecayArray<T8>::type,

+      typename internal::DecayArray<T9>::type,

+      typename internal::DecayArray<T10>::type> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,

+      e6, e7, e8, e9, e10));

+}

+

+// AllOf(m1, m2, ..., mk) matches any value that matches all of the given

+// sub-matchers.  AllOf is called fully qualified to prevent ADL from firing.

+

+template <typename M1, typename M2>

+inline typename internal::AllOfResult2<M1, M2>::type

+AllOf(M1 m1, M2 m2) {

+  return typename internal::AllOfResult2<M1, M2>::type(

+      m1,

+      m2);

+}

+

+template <typename M1, typename M2, typename M3>

+inline typename internal::AllOfResult3<M1, M2, M3>::type

+AllOf(M1 m1, M2 m2, M3 m3) {

+  return typename internal::AllOfResult3<M1, M2, M3>::type(

+      m1,

+      ::testing::AllOf(m2, m3));

+}

+

+template <typename M1, typename M2, typename M3, typename M4>

+inline typename internal::AllOfResult4<M1, M2, M3, M4>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4) {

+  return typename internal::AllOfResult4<M1, M2, M3, M4>::type(

+      ::testing::AllOf(m1, m2),

+      ::testing::AllOf(m3, m4));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5>

+inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {

+  return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type(

+      ::testing::AllOf(m1, m2),

+      ::testing::AllOf(m3, m4, m5));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6>

+inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {

+  return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type(

+      ::testing::AllOf(m1, m2, m3),

+      ::testing::AllOf(m4, m5, m6));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7>

+inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {

+  return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(

+      ::testing::AllOf(m1, m2, m3),

+      ::testing::AllOf(m4, m5, m6, m7));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8>

+inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {

+  return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(

+      ::testing::AllOf(m1, m2, m3, m4),

+      ::testing::AllOf(m5, m6, m7, m8));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9>

+inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {

+  return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,

+      M9>::type(

+      ::testing::AllOf(m1, m2, m3, m4),

+      ::testing::AllOf(m5, m6, m7, m8, m9));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9, typename M10>

+inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,

+    M10>::type

+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {

+  return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,

+      M10>::type(

+      ::testing::AllOf(m1, m2, m3, m4, m5),

+      ::testing::AllOf(m6, m7, m8, m9, m10));

+}

+

+// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given

+// sub-matchers.  AnyOf is called fully qualified to prevent ADL from firing.

+

+template <typename M1, typename M2>

+inline typename internal::AnyOfResult2<M1, M2>::type

+AnyOf(M1 m1, M2 m2) {

+  return typename internal::AnyOfResult2<M1, M2>::type(

+      m1,

+      m2);

+}

+

+template <typename M1, typename M2, typename M3>

+inline typename internal::AnyOfResult3<M1, M2, M3>::type

+AnyOf(M1 m1, M2 m2, M3 m3) {

+  return typename internal::AnyOfResult3<M1, M2, M3>::type(

+      m1,

+      ::testing::AnyOf(m2, m3));

+}

+

+template <typename M1, typename M2, typename M3, typename M4>

+inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) {

+  return typename internal::AnyOfResult4<M1, M2, M3, M4>::type(

+      ::testing::AnyOf(m1, m2),

+      ::testing::AnyOf(m3, m4));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5>

+inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {

+  return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type(

+      ::testing::AnyOf(m1, m2),

+      ::testing::AnyOf(m3, m4, m5));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6>

+inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {

+  return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type(

+      ::testing::AnyOf(m1, m2, m3),

+      ::testing::AnyOf(m4, m5, m6));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7>

+inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {

+  return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(

+      ::testing::AnyOf(m1, m2, m3),

+      ::testing::AnyOf(m4, m5, m6, m7));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8>

+inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {

+  return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(

+      ::testing::AnyOf(m1, m2, m3, m4),

+      ::testing::AnyOf(m5, m6, m7, m8));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9>

+inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {

+  return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,

+      M9>::type(

+      ::testing::AnyOf(m1, m2, m3, m4),

+      ::testing::AnyOf(m5, m6, m7, m8, m9));

+}

+

+template <typename M1, typename M2, typename M3, typename M4, typename M5,

+    typename M6, typename M7, typename M8, typename M9, typename M10>

+inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,

+    M10>::type

+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {

+  return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,

+      M10>::type(

+      ::testing::AnyOf(m1, m2, m3, m4, m5),

+      ::testing::AnyOf(m6, m7, m8, m9, m10));

+}

+

+}  // namespace testing

+

+

+// The MATCHER* family of macros can be used in a namespace scope to

+// define custom matchers easily.

+//

+// Basic Usage

+// ===========

+//

+// The syntax

+//

+//   MATCHER(name, description_string) { statements; }

+//

+// defines a matcher with the given name that executes the statements,

+// which must return a bool to indicate if the match succeeds.  Inside

+// the statements, you can refer to the value being matched by 'arg',

+// and refer to its type by 'arg_type'.

+//

+// The description string documents what the matcher does, and is used

+// to generate the failure message when the match fails.  Since a

+// MATCHER() is usually defined in a header file shared by multiple

+// C++ source files, we require the description to be a C-string

+// literal to avoid possible side effects.  It can be empty, in which

+// case we'll use the sequence of words in the matcher name as the

+// description.

+//

+// For example:

+//

+//   MATCHER(IsEven, "") { return (arg % 2) == 0; }

+//

+// allows you to write

+//

+//   // Expects mock_foo.Bar(n) to be called where n is even.

+//   EXPECT_CALL(mock_foo, Bar(IsEven()));

+//

+// or,

+//

+//   // Verifies that the value of some_expression is even.

+//   EXPECT_THAT(some_expression, IsEven());

+//

+// If the above assertion fails, it will print something like:

+//

+//   Value of: some_expression

+//   Expected: is even

+//     Actual: 7

+//

+// where the description "is even" is automatically calculated from the

+// matcher name IsEven.

+//

+// Argument Type

+// =============

+//

+// Note that the type of the value being matched (arg_type) is

+// determined by the context in which you use the matcher and is

+// supplied to you by the compiler, so you don't need to worry about

+// declaring it (nor can you).  This allows the matcher to be

+// polymorphic.  For example, IsEven() can be used to match any type

+// where the value of "(arg % 2) == 0" can be implicitly converted to

+// a bool.  In the "Bar(IsEven())" example above, if method Bar()

+// takes an int, 'arg_type' will be int; if it takes an unsigned long,

+// 'arg_type' will be unsigned long; and so on.

+//

+// Parameterizing Matchers

+// =======================

+//

+// Sometimes you'll want to parameterize the matcher.  For that you

+// can use another macro:

+//

+//   MATCHER_P(name, param_name, description_string) { statements; }

+//

+// For example:

+//

+//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }

+//

+// will allow you to write:

+//

+//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));

+//

+// which may lead to this message (assuming n is 10):

+//

+//   Value of: Blah("a")

+//   Expected: has absolute value 10

+//     Actual: -9

+//

+// Note that both the matcher description and its parameter are

+// printed, making the message human-friendly.

+//

+// In the matcher definition body, you can write 'foo_type' to

+// reference the type of a parameter named 'foo'.  For example, in the

+// body of MATCHER_P(HasAbsoluteValue, value) above, you can write

+// 'value_type' to refer to the type of 'value'.

+//

+// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to

+// support multi-parameter matchers.

+//

+// Describing Parameterized Matchers

+// =================================

+//

+// The last argument to MATCHER*() is a string-typed expression.  The

+// expression can reference all of the matcher's parameters and a

+// special bool-typed variable named 'negation'.  When 'negation' is

+// false, the expression should evaluate to the matcher's description;

+// otherwise it should evaluate to the description of the negation of

+// the matcher.  For example,

+//

+//   using testing::PrintToString;

+//

+//   MATCHER_P2(InClosedRange, low, hi,

+//       string(negation ? "is not" : "is") + " in range [" +

+//       PrintToString(low) + ", " + PrintToString(hi) + "]") {

+//     return low <= arg && arg <= hi;

+//   }

+//   ...

+//   EXPECT_THAT(3, InClosedRange(4, 6));

+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));

+//

+// would generate two failures that contain the text:

+//

+//   Expected: is in range [4, 6]

+//   ...

+//   Expected: is not in range [2, 4]

+//

+// If you specify "" as the description, the failure message will

+// contain the sequence of words in the matcher name followed by the

+// parameter values printed as a tuple.  For example,

+//

+//   MATCHER_P2(InClosedRange, low, hi, "") { ... }

+//   ...

+//   EXPECT_THAT(3, InClosedRange(4, 6));

+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));

+//

+// would generate two failures that contain the text:

+//

+//   Expected: in closed range (4, 6)

+//   ...

+//   Expected: not (in closed range (2, 4))

+//

+// Types of Matcher Parameters

+// ===========================

+//

+// For the purpose of typing, you can view

+//

+//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }

+//

+// as shorthand for

+//

+//   template <typename p1_type, ..., typename pk_type>

+//   FooMatcherPk<p1_type, ..., pk_type>

+//   Foo(p1_type p1, ..., pk_type pk) { ... }

+//

+// When you write Foo(v1, ..., vk), the compiler infers the types of

+// the parameters v1, ..., and vk for you.  If you are not happy with

+// the result of the type inference, you can specify the types by

+// explicitly instantiating the template, as in Foo<long, bool>(5,

+// false).  As said earlier, you don't get to (or need to) specify

+// 'arg_type' as that's determined by the context in which the matcher

+// is used.  You can assign the result of expression Foo(p1, ..., pk)

+// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This

+// can be useful when composing matchers.

+//

+// While you can instantiate a matcher template with reference types,

+// passing the parameters by pointer usually makes your code more

+// readable.  If, however, you still want to pass a parameter by

+// reference, be aware that in the failure message generated by the

+// matcher you will see the value of the referenced object but not its

+// address.

+//

+// Explaining Match Results

+// ========================

+//

+// Sometimes the matcher description alone isn't enough to explain why

+// the match has failed or succeeded.  For example, when expecting a

+// long string, it can be very helpful to also print the diff between

+// the expected string and the actual one.  To achieve that, you can

+// optionally stream additional information to a special variable

+// named result_listener, whose type is a pointer to class

+// MatchResultListener:

+//

+//   MATCHER_P(EqualsLongString, str, "") {

+//     if (arg == str) return true;

+//

+//     *result_listener << "the difference: "

+///                     << DiffStrings(str, arg);

+//     return false;

+//   }

+//

+// Overloading Matchers

+// ====================

+//

+// You can overload matchers with different numbers of parameters:

+//

+//   MATCHER_P(Blah, a, description_string1) { ... }

+//   MATCHER_P2(Blah, a, b, description_string2) { ... }

+//

+// Caveats

+// =======

+//

+// When defining a new matcher, you should also consider implementing

+// MatcherInterface or using MakePolymorphicMatcher().  These

+// approaches require more work than the MATCHER* macros, but also

+// give you more control on the types of the value being matched and

+// the matcher parameters, which may leads to better compiler error

+// messages when the matcher is used wrong.  They also allow

+// overloading matchers based on parameter types (as opposed to just

+// based on the number of parameters).

+//

+// MATCHER*() can only be used in a namespace scope.  The reason is

+// that C++ doesn't yet allow function-local types to be used to

+// instantiate templates.  The up-coming C++0x standard will fix this.

+// Once that's done, we'll consider supporting using MATCHER*() inside

+// a function.

+//

+// More Information

+// ================

+//

+// To learn more about using these macros, please search for 'MATCHER'

+// on http://code.google.com/p/googlemock/wiki/CookBook.

+

+#define MATCHER(name, description)\

+  class name##Matcher {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl()\

+           {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<>()));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>());\

+    }\

+    name##Matcher() {\

+    }\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##Matcher);\

+  };\

+  inline name##Matcher name() {\

+    return name##Matcher();\

+  }\

+  template <typename arg_type>\

+  bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P(name, p0, description)\

+  template <typename p0##_type>\

+  class name##MatcherP {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      explicit gmock_Impl(p0##_type gmock_p0)\

+           : p0(gmock_p0) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type>(p0)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0));\

+    }\

+    name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\

+    }\

+    p0##_type p0;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP);\

+  };\

+  template <typename p0##_type>\

+  inline name##MatcherP<p0##_type> name(p0##_type p0) {\

+    return name##MatcherP<p0##_type>(p0);\

+  }\

+  template <typename p0##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P2(name, p0, p1, description)\

+  template <typename p0##_type, typename p1##_type>\

+  class name##MatcherP2 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\

+           : p0(gmock_p0), p1(gmock_p1) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1));\

+    }\

+    name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \

+        p1(gmock_p1) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\

+  };\

+  template <typename p0##_type, typename p1##_type>\

+  inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \

+      p1##_type p1) {\

+    return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\

+  }\

+  template <typename p0##_type, typename p1##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP2<p0##_type, \

+      p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P3(name, p0, p1, p2, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type>\

+  class name##MatcherP3 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \

+                    p2)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2));\

+    }\

+    name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type>\

+  inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \

+      p1##_type p1, p2##_type p2) {\

+    return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP3<p0##_type, p1##_type, \

+      p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P4(name, p0, p1, p2, p3, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type>\

+  class name##MatcherP4 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \

+                    p3##_type>(p0, p1, p2, p3)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3));\

+    }\

+    name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type>\

+  inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \

+      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \

+      p3##_type p3) {\

+    return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \

+        p1, p2, p3);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \

+      p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type>\

+  class name##MatcherP5 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \

+               p4(gmock_p4) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \

+                    p4##_type>(p0, p1, p2, p3, p4)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\

+    }\

+    name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, \

+        p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type>\

+  inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+      p4##_type p4) {\

+    return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type>(p0, p1, p2, p3, p4);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type>\

+  class name##MatcherP6 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \

+               p4(gmock_p4), p5(gmock_p5) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \

+                    p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\

+    }\

+    name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type>\

+  inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \

+      p3##_type p3, p4##_type p4, p5##_type p5) {\

+    return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+      p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type>\

+  class name##MatcherP7 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \

+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \

+                    p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \

+                    p6)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\

+    }\

+    name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \

+        p6(gmock_p6) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type>\

+  inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \

+      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \

+      p6##_type p6) {\

+    return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+      p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type>\

+  class name##MatcherP8 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6, p7##_type gmock_p7)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \

+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+      p7##_type p7;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \

+                    p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \

+                    p3, p4, p5, p6, p7)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\

+    }\

+    name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6, \

+        p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+        p7(gmock_p7) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+    p7##_type p7;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type>\

+  inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \

+      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \

+      p6##_type p6, p7##_type p7) {\

+    return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \

+        p6, p7);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+      p5##_type, p6##_type, \

+      p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type>\

+  class name##MatcherP9 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \

+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \

+               p8(gmock_p8) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+      p7##_type p7;\

+      p8##_type p8;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \

+                    p4##_type, p5##_type, p6##_type, p7##_type, \

+                    p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\

+    }\

+    name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \

+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \

+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \

+        p8(gmock_p8) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+    p7##_type p7;\

+    p8##_type p8;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type>\

+  inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type, \

+      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \

+      p8##_type p8) {\

+    return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \

+        p3, p4, p5, p6, p7, p8);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \

+      p5##_type, p6##_type, p7##_type, \

+      p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type, \

+      typename p9##_type>\

+  class name##MatcherP10 {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \

+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \

+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \

+          p9##_type gmock_p9)\

+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \

+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \

+               p8(gmock_p8), p9(gmock_p9) {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\

+      p0##_type p0;\

+      p1##_type p1;\

+      p2##_type p2;\

+      p3##_type p3;\

+      p4##_type p4;\

+      p5##_type p5;\

+      p6##_type p6;\

+      p7##_type p7;\

+      p8##_type p8;\

+      p9##_type p9;\

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \

+                    p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \

+                    p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\

+    }\

+    name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \

+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \

+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \

+        p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \

+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \

+        p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\

+    }\

+    p0##_type p0;\

+    p1##_type p1;\

+    p2##_type p2;\

+    p3##_type p3;\

+    p4##_type p4;\

+    p5##_type p5;\

+    p6##_type p6;\

+    p7##_type p7;\

+    p8##_type p8;\

+    p9##_type p9;\

+   private:\

+    GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\

+  };\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type, \

+      typename p9##_type>\

+  inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \

+      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \

+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \

+      p9##_type p9) {\

+    return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \

+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \

+        p1, p2, p3, p4, p5, p6, p7, p8, p9);\

+  }\

+  template <typename p0##_type, typename p1##_type, typename p2##_type, \

+      typename p3##_type, typename p4##_type, typename p5##_type, \

+      typename p6##_type, typename p7##_type, typename p8##_type, \

+      typename p9##_type>\

+  template <typename arg_type>\

+  bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \

+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \

+      p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-matchers.h.pump b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-matchers.h.pump
new file mode 100644
index 0000000..ef9d890
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-matchers.h.pump
@@ -0,0 +1,674 @@
+$$ -*- mode: c++; -*-

+$$ This is a Pump source file.  Please use Pump to convert it to

+$$ gmock-generated-actions.h.

+$$

+$var n = 10  $$ The maximum arity we support.

+$$ }} This line fixes auto-indentation of the following code in Emacs.

+// 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.

+

+// Google Mock - a framework for writing C++ mock classes.

+//

+// This file implements some commonly used variadic matchers.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

+

+#include <iterator>

+#include <sstream>

+#include <string>

+#include <vector>

+#include "gmock/gmock-matchers.h"

+

+namespace testing {

+namespace internal {

+

+$range i 0..n-1

+

+// The type of the i-th (0-based) field of Tuple.

+#define GMOCK_FIELD_TYPE_(Tuple, i) \

+    typename ::std::tr1::tuple_element<i, Tuple>::type

+

+// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a

+// tuple of type Tuple.  It has two members:

+//

+//   type: a tuple type whose i-th field is the ki-th field of Tuple.

+//   GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.

+//

+// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:

+//

+//   type is tuple<int, bool>, and

+//   GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).

+

+template <class Tuple$for i [[, int k$i = -1]]>

+class TupleFields;

+

+// This generic version is used when there are $n selectors.

+template <class Tuple$for i [[, int k$i]]>

+class TupleFields {

+ public:

+  typedef ::std::tr1::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type;

+  static type GetSelectedFields(const Tuple& t) {

+    using ::std::tr1::get;

+    return type($for i, [[get<k$i>(t)]]);

+  }

+};

+

+// The following specialization is used for 0 ~ $(n-1) selectors.

+

+$for i [[

+$$ }}}

+$range j 0..i-1

+$range k 0..n-1

+

+template <class Tuple$for j [[, int k$j]]>

+class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> {

+ public:

+  typedef ::std::tr1::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type;

+  static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) {

+    using ::std::tr1::get;

+    return type($for j, [[get<k$j>(t)]]);

+  }

+};

+

+]]

+

+#undef GMOCK_FIELD_TYPE_

+

+// Implements the Args() matcher.

+

+$var ks = [[$for i, [[k$i]]]]

+template <class ArgsTuple$for i [[, int k$i = -1]]>

+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {

+ public:

+  // ArgsTuple may have top-level const or reference modifiers.

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;

+  typedef typename internal::TupleFields<RawArgsTuple, $ks>::type SelectedArgs;

+  typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;

+

+  template <typename InnerMatcher>

+  explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)

+      : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}

+

+  virtual bool MatchAndExplain(ArgsTuple args,

+                               MatchResultListener* listener) const {

+    const SelectedArgs& selected_args = GetSelectedArgs(args);

+    if (!listener->IsInterested())

+      return inner_matcher_.Matches(selected_args);

+

+    PrintIndices(listener->stream());

+    *listener << "are " << PrintToString(selected_args);

+

+    StringMatchResultListener inner_listener;

+    const bool match = inner_matcher_.MatchAndExplain(selected_args,

+                                                      &inner_listener);

+    PrintIfNotEmpty(inner_listener.str(), listener->stream());

+    return match;

+  }

+

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "are a tuple ";

+    PrintIndices(os);

+    inner_matcher_.DescribeTo(os);

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "are a tuple ";

+    PrintIndices(os);

+    inner_matcher_.DescribeNegationTo(os);

+  }

+

+ private:

+  static SelectedArgs GetSelectedArgs(ArgsTuple args) {

+    return TupleFields<RawArgsTuple, $ks>::GetSelectedFields(args);

+  }

+

+  // Prints the indices of the selected fields.

+  static void PrintIndices(::std::ostream* os) {

+    *os << "whose fields (";

+    const int indices[$n] = { $ks };

+    for (int i = 0; i < $n; i++) {

+      if (indices[i] < 0)

+        break;

+

+      if (i >= 1)

+        *os << ", ";

+

+      *os << "#" << indices[i];

+    }

+    *os << ") ";

+  }

+

+  const MonomorphicInnerMatcher inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);

+};

+

+template <class InnerMatcher$for i [[, int k$i = -1]]>

+class ArgsMatcher {

+ public:

+  explicit ArgsMatcher(const InnerMatcher& inner_matcher)

+      : inner_matcher_(inner_matcher) {}

+

+  template <typename ArgsTuple>

+  operator Matcher<ArgsTuple>() const {

+    return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, $ks>(inner_matcher_));

+  }

+

+ private:

+  const InnerMatcher inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(ArgsMatcher);

+};

+

+// A set of metafunctions for computing the result type of AllOf.

+// AllOf(m1, ..., mN) returns

+// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.

+

+// Although AllOf isn't defined for one argument, AllOfResult1 is defined

+// to simplify the implementation.

+template <typename M1>

+struct AllOfResult1 {

+  typedef M1 type;

+};

+

+$range i 1..n

+

+$range i 2..n

+$for i [[

+$range j 2..i

+$var m = i/2

+$range k 1..m

+$range t m+1..i

+

+template <typename M1$for j [[, typename M$j]]>

+struct AllOfResult$i {

+  typedef BothOfMatcher<

+      typename AllOfResult$m<$for k, [[M$k]]>::type,

+      typename AllOfResult$(i-m)<$for t, [[M$t]]>::type

+  > type;

+};

+

+]]

+

+// A set of metafunctions for computing the result type of AnyOf.

+// AnyOf(m1, ..., mN) returns

+// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.

+

+// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined

+// to simplify the implementation.

+template <typename M1>

+struct AnyOfResult1 {

+  typedef M1 type;

+};

+

+$range i 1..n

+

+$range i 2..n

+$for i [[

+$range j 2..i

+$var m = i/2

+$range k 1..m

+$range t m+1..i

+

+template <typename M1$for j [[, typename M$j]]>

+struct AnyOfResult$i {

+  typedef EitherOfMatcher<

+      typename AnyOfResult$m<$for k, [[M$k]]>::type,

+      typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type

+  > type;

+};

+

+]]

+

+}  // namespace internal

+

+// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected

+// fields of it matches a_matcher.  C++ doesn't support default

+// arguments for function templates, so we have to overload it.

+

+$range i 0..n

+$for i [[

+$range j 1..i

+template <$for j [[int k$j, ]]typename InnerMatcher>

+inline internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>

+Args(const InnerMatcher& matcher) {

+  return internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>(matcher);

+}

+

+

+]]

+// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with

+// n elements, where the i-th element in the container must

+// match the i-th argument in the list.  Each argument of

+// ElementsAre() can be either a value or a matcher.  We support up to

+// $n arguments.

+//

+// The use of DecayArray in the implementation allows ElementsAre()

+// to accept string literals, whose type is const char[N], but we

+// want to treat them as const char*.

+//

+// NOTE: Since ElementsAre() cares about the order of the elements, it

+// must not be used with containers whose elements's order is

+// undefined (e.g. hash_map).

+

+$range i 0..n

+$for i [[

+

+$range j 1..i

+

+$if i>0 [[

+

+template <$for j, [[typename T$j]]>

+]]

+

+inline internal::ElementsAreMatcher<

+    std::tr1::tuple<

+$for j, [[

+

+        typename internal::DecayArray<T$j[[]]>::type]]> >

+ElementsAre($for j, [[const T$j& e$j]]) {

+  typedef std::tr1::tuple<

+$for j, [[

+

+      typename internal::DecayArray<T$j[[]]>::type]]> Args;

+  return internal::ElementsAreMatcher<Args>(Args($for j, [[e$j]]));

+}

+

+]]

+

+// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension

+// that matches n elements in any order.  We support up to n=$n arguments.

+

+$range i 0..n

+$for i [[

+

+$range j 1..i

+

+$if i>0 [[

+

+template <$for j, [[typename T$j]]>

+]]

+

+inline internal::UnorderedElementsAreMatcher<

+    std::tr1::tuple<

+$for j, [[

+

+        typename internal::DecayArray<T$j[[]]>::type]]> >

+UnorderedElementsAre($for j, [[const T$j& e$j]]) {

+  typedef std::tr1::tuple<

+$for j, [[

+

+      typename internal::DecayArray<T$j[[]]>::type]]> Args;

+  return internal::UnorderedElementsAreMatcher<Args>(Args($for j, [[e$j]]));

+}

+

+]]

+

+// AllOf(m1, m2, ..., mk) matches any value that matches all of the given

+// sub-matchers.  AllOf is called fully qualified to prevent ADL from firing.

+

+$range i 2..n

+$for i [[

+$range j 1..i

+$var m = i/2

+$range k 1..m

+$range t m+1..i

+

+template <$for j, [[typename M$j]]>

+inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type

+AllOf($for j, [[M$j m$j]]) {

+  return typename internal::AllOfResult$i<$for j, [[M$j]]>::type(

+      $if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]],

+      $if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]);

+}

+

+]]

+

+// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given

+// sub-matchers.  AnyOf is called fully qualified to prevent ADL from firing.

+

+$range i 2..n

+$for i [[

+$range j 1..i

+$var m = i/2

+$range k 1..m

+$range t m+1..i

+

+template <$for j, [[typename M$j]]>

+inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type

+AnyOf($for j, [[M$j m$j]]) {

+  return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type(

+      $if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]],

+      $if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]);

+}

+

+]]

+

+}  // namespace testing

+$$ } // This Pump meta comment fixes auto-indentation in Emacs. It will not

+$$   // show up in the generated code.

+

+

+// The MATCHER* family of macros can be used in a namespace scope to

+// define custom matchers easily.

+//

+// Basic Usage

+// ===========

+//

+// The syntax

+//

+//   MATCHER(name, description_string) { statements; }

+//

+// defines a matcher with the given name that executes the statements,

+// which must return a bool to indicate if the match succeeds.  Inside

+// the statements, you can refer to the value being matched by 'arg',

+// and refer to its type by 'arg_type'.

+//

+// The description string documents what the matcher does, and is used

+// to generate the failure message when the match fails.  Since a

+// MATCHER() is usually defined in a header file shared by multiple

+// C++ source files, we require the description to be a C-string

+// literal to avoid possible side effects.  It can be empty, in which

+// case we'll use the sequence of words in the matcher name as the

+// description.

+//

+// For example:

+//

+//   MATCHER(IsEven, "") { return (arg % 2) == 0; }

+//

+// allows you to write

+//

+//   // Expects mock_foo.Bar(n) to be called where n is even.

+//   EXPECT_CALL(mock_foo, Bar(IsEven()));

+//

+// or,

+//

+//   // Verifies that the value of some_expression is even.

+//   EXPECT_THAT(some_expression, IsEven());

+//

+// If the above assertion fails, it will print something like:

+//

+//   Value of: some_expression

+//   Expected: is even

+//     Actual: 7

+//

+// where the description "is even" is automatically calculated from the

+// matcher name IsEven.

+//

+// Argument Type

+// =============

+//

+// Note that the type of the value being matched (arg_type) is

+// determined by the context in which you use the matcher and is

+// supplied to you by the compiler, so you don't need to worry about

+// declaring it (nor can you).  This allows the matcher to be

+// polymorphic.  For example, IsEven() can be used to match any type

+// where the value of "(arg % 2) == 0" can be implicitly converted to

+// a bool.  In the "Bar(IsEven())" example above, if method Bar()

+// takes an int, 'arg_type' will be int; if it takes an unsigned long,

+// 'arg_type' will be unsigned long; and so on.

+//

+// Parameterizing Matchers

+// =======================

+//

+// Sometimes you'll want to parameterize the matcher.  For that you

+// can use another macro:

+//

+//   MATCHER_P(name, param_name, description_string) { statements; }

+//

+// For example:

+//

+//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }

+//

+// will allow you to write:

+//

+//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));

+//

+// which may lead to this message (assuming n is 10):

+//

+//   Value of: Blah("a")

+//   Expected: has absolute value 10

+//     Actual: -9

+//

+// Note that both the matcher description and its parameter are

+// printed, making the message human-friendly.

+//

+// In the matcher definition body, you can write 'foo_type' to

+// reference the type of a parameter named 'foo'.  For example, in the

+// body of MATCHER_P(HasAbsoluteValue, value) above, you can write

+// 'value_type' to refer to the type of 'value'.

+//

+// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to

+// support multi-parameter matchers.

+//

+// Describing Parameterized Matchers

+// =================================

+//

+// The last argument to MATCHER*() is a string-typed expression.  The

+// expression can reference all of the matcher's parameters and a

+// special bool-typed variable named 'negation'.  When 'negation' is

+// false, the expression should evaluate to the matcher's description;

+// otherwise it should evaluate to the description of the negation of

+// the matcher.  For example,

+//

+//   using testing::PrintToString;

+//

+//   MATCHER_P2(InClosedRange, low, hi,

+//       string(negation ? "is not" : "is") + " in range [" +

+//       PrintToString(low) + ", " + PrintToString(hi) + "]") {

+//     return low <= arg && arg <= hi;

+//   }

+//   ...

+//   EXPECT_THAT(3, InClosedRange(4, 6));

+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));

+//

+// would generate two failures that contain the text:

+//

+//   Expected: is in range [4, 6]

+//   ...

+//   Expected: is not in range [2, 4]

+//

+// If you specify "" as the description, the failure message will

+// contain the sequence of words in the matcher name followed by the

+// parameter values printed as a tuple.  For example,

+//

+//   MATCHER_P2(InClosedRange, low, hi, "") { ... }

+//   ...

+//   EXPECT_THAT(3, InClosedRange(4, 6));

+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));

+//

+// would generate two failures that contain the text:

+//

+//   Expected: in closed range (4, 6)

+//   ...

+//   Expected: not (in closed range (2, 4))

+//

+// Types of Matcher Parameters

+// ===========================

+//

+// For the purpose of typing, you can view

+//

+//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }

+//

+// as shorthand for

+//

+//   template <typename p1_type, ..., typename pk_type>

+//   FooMatcherPk<p1_type, ..., pk_type>

+//   Foo(p1_type p1, ..., pk_type pk) { ... }

+//

+// When you write Foo(v1, ..., vk), the compiler infers the types of

+// the parameters v1, ..., and vk for you.  If you are not happy with

+// the result of the type inference, you can specify the types by

+// explicitly instantiating the template, as in Foo<long, bool>(5,

+// false).  As said earlier, you don't get to (or need to) specify

+// 'arg_type' as that's determined by the context in which the matcher

+// is used.  You can assign the result of expression Foo(p1, ..., pk)

+// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This

+// can be useful when composing matchers.

+//

+// While you can instantiate a matcher template with reference types,

+// passing the parameters by pointer usually makes your code more

+// readable.  If, however, you still want to pass a parameter by

+// reference, be aware that in the failure message generated by the

+// matcher you will see the value of the referenced object but not its

+// address.

+//

+// Explaining Match Results

+// ========================

+//

+// Sometimes the matcher description alone isn't enough to explain why

+// the match has failed or succeeded.  For example, when expecting a

+// long string, it can be very helpful to also print the diff between

+// the expected string and the actual one.  To achieve that, you can

+// optionally stream additional information to a special variable

+// named result_listener, whose type is a pointer to class

+// MatchResultListener:

+//

+//   MATCHER_P(EqualsLongString, str, "") {

+//     if (arg == str) return true;

+//

+//     *result_listener << "the difference: "

+///                     << DiffStrings(str, arg);

+//     return false;

+//   }

+//

+// Overloading Matchers

+// ====================

+//

+// You can overload matchers with different numbers of parameters:

+//

+//   MATCHER_P(Blah, a, description_string1) { ... }

+//   MATCHER_P2(Blah, a, b, description_string2) { ... }

+//

+// Caveats

+// =======

+//

+// When defining a new matcher, you should also consider implementing

+// MatcherInterface or using MakePolymorphicMatcher().  These

+// approaches require more work than the MATCHER* macros, but also

+// give you more control on the types of the value being matched and

+// the matcher parameters, which may leads to better compiler error

+// messages when the matcher is used wrong.  They also allow

+// overloading matchers based on parameter types (as opposed to just

+// based on the number of parameters).

+//

+// MATCHER*() can only be used in a namespace scope.  The reason is

+// that C++ doesn't yet allow function-local types to be used to

+// instantiate templates.  The up-coming C++0x standard will fix this.

+// Once that's done, we'll consider supporting using MATCHER*() inside

+// a function.

+//

+// More Information

+// ================

+//

+// To learn more about using these macros, please search for 'MATCHER'

+// on http://code.google.com/p/googlemock/wiki/CookBook.

+

+$range i 0..n

+$for i

+

+[[

+$var macro_name = [[$if i==0 [[MATCHER]] $elif i==1 [[MATCHER_P]]

+                                         $else [[MATCHER_P$i]]]]

+$var class_name = [[name##Matcher[[$if i==0 [[]] $elif i==1 [[P]]

+                                                 $else [[P$i]]]]]]

+$range j 0..i-1

+$var template = [[$if i==0 [[]] $else [[

+

+  template <$for j, [[typename p$j##_type]]>\

+]]]]

+$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]

+$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]

+$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]

+$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]

+$var params = [[$for j, [[p$j]]]]

+$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]

+$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]

+$var param_field_decls = [[$for j

+[[

+

+      p$j##_type p$j;\

+]]]]

+$var param_field_decls2 = [[$for j

+[[

+

+    p$j##_type p$j;\

+]]]]

+

+#define $macro_name(name$for j [[, p$j]], description)\$template

+  class $class_name {\

+   public:\

+    template <typename arg_type>\

+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\

+     public:\

+      [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\

+          $impl_inits {}\

+      virtual bool MatchAndExplain(\

+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\

+      virtual void DescribeTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(false);\

+      }\

+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\

+        *gmock_os << FormatDescription(true);\

+      }\$param_field_decls

+     private:\

+      ::testing::internal::string FormatDescription(bool negation) const {\

+        const ::testing::internal::string gmock_description = (description);\

+        if (!gmock_description.empty())\

+          return gmock_description;\

+        return ::testing::internal::FormatMatcherDescription(\

+            negation, #name, \

+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\

+                ::std::tr1::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\

+      }\

+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\

+    };\

+    template <typename arg_type>\

+    operator ::testing::Matcher<arg_type>() const {\

+      return ::testing::Matcher<arg_type>(\

+          new gmock_Impl<arg_type>($params));\

+    }\

+    $class_name($ctor_param_list)$inits {\

+    }\$param_field_decls2

+   private:\

+    GTEST_DISALLOW_ASSIGN_($class_name);\

+  };\$template

+  inline $class_name$param_types name($param_types_and_names) {\

+    return $class_name$param_types($params);\

+  }\$template

+  template <typename arg_type>\

+  bool $class_name$param_types::gmock_Impl<arg_type>::MatchAndExplain(\

+      arg_type arg, \

+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\

+          const

+]]

+

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-nice-strict.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-nice-strict.h
new file mode 100644
index 0000000..2e1dfa1
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-nice-strict.h
@@ -0,0 +1,397 @@
+// This file was GENERATED by command:

+//     pump.py gmock-generated-nice-strict.h.pump

+// DO NOT EDIT BY HAND!!!

+

+// 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: wan@google.com (Zhanyong Wan)

+

+// Implements class templates NiceMock, NaggyMock, and StrictMock.

+//

+// Given a mock class MockFoo that is created using Google Mock,

+// NiceMock<MockFoo> is a subclass of MockFoo that allows

+// uninteresting calls (i.e. calls to mock methods that have no

+// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo

+// that prints a warning when an uninteresting call occurs, and

+// StrictMock<MockFoo> is a subclass of MockFoo that treats all

+// uninteresting calls as errors.

+//

+// Currently a mock is naggy by default, so MockFoo and

+// NaggyMock<MockFoo> behave like the same.  However, we will soon

+// switch the default behavior of mocks to be nice, as that in general

+// leads to more maintainable tests.  When that happens, MockFoo will

+// stop behaving like NaggyMock<MockFoo> and start behaving like

+// NiceMock<MockFoo>.

+//

+// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of

+// their respective base class, with up-to 10 arguments.  Therefore

+// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock

+// where MockFoo has a constructor that accepts (int, const char*),

+// for example.

+//

+// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,

+// and StrictMock<MockFoo> only works for mock methods defined using

+// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.

+// If a mock method is defined in a base class of MockFoo, the "nice"

+// or "strict" modifier may not affect it, depending on the compiler.

+// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT

+// supported.

+//

+// Another known limitation is that the constructors of the base mock

+// cannot have arguments passed by non-const reference, which are

+// banned by the Google C++ style guide anyway.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_

+

+#include "gmock/gmock-spec-builders.h"

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+

+template <class MockClass>

+class NiceMock : public MockClass {

+ public:

+  // We don't factor out the constructor body to a common method, as

+  // we have to avoid a possible clash with members of MockClass.

+  NiceMock() {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  // C++ doesn't (yet) allow inheritance of constructors, so we have

+  // to define it for each arity.

+  template <typename A1>

+  explicit NiceMock(const A1& a1) : MockClass(a1) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+  template <typename A1, typename A2>

+  NiceMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3,

+      const A4& a4) : MockClass(a1, a2, a3, a4) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,

+      a6, a7) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,

+      a2, a3, a4, a5, a6, a7, a8) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8, typename A9>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,

+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8, typename A9, typename A10>

+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,

+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {

+    ::testing::Mock::AllowUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  virtual ~NiceMock() {

+    ::testing::Mock::UnregisterCallReaction(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);

+};

+

+template <class MockClass>

+class NaggyMock : public MockClass {

+ public:

+  // We don't factor out the constructor body to a common method, as

+  // we have to avoid a possible clash with members of MockClass.

+  NaggyMock() {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  // C++ doesn't (yet) allow inheritance of constructors, so we have

+  // to define it for each arity.

+  template <typename A1>

+  explicit NaggyMock(const A1& a1) : MockClass(a1) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+  template <typename A1, typename A2>

+  NaggyMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3,

+      const A4& a4) : MockClass(a1, a2, a3, a4) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,

+      a6, a7) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,

+      a2, a3, a4, a5, a6, a7, a8) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8, typename A9>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,

+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8, typename A9, typename A10>

+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,

+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {

+    ::testing::Mock::WarnUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  virtual ~NaggyMock() {

+    ::testing::Mock::UnregisterCallReaction(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock);

+};

+

+template <class MockClass>

+class StrictMock : public MockClass {

+ public:

+  // We don't factor out the constructor body to a common method, as

+  // we have to avoid a possible clash with members of MockClass.

+  StrictMock() {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  // C++ doesn't (yet) allow inheritance of constructors, so we have

+  // to define it for each arity.

+  template <typename A1>

+  explicit StrictMock(const A1& a1) : MockClass(a1) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+  template <typename A1, typename A2>

+  StrictMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3,

+      const A4& a4) : MockClass(a1, a2, a3, a4) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,

+      a6, a7) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,

+      a2, a3, a4, a5, a6, a7, a8) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8, typename A9>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,

+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  template <typename A1, typename A2, typename A3, typename A4, typename A5,

+      typename A6, typename A7, typename A8, typename A9, typename A10>

+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,

+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,

+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {

+    ::testing::Mock::FailUninterestingCalls(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  virtual ~StrictMock() {

+    ::testing::Mock::UnregisterCallReaction(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);

+};

+

+// The following specializations catch some (relatively more common)

+// user errors of nesting nice and strict mocks.  They do NOT catch

+// all possible errors.

+

+// These specializations are declared but not defined, as NiceMock,

+// NaggyMock, and StrictMock cannot be nested.

+

+template <typename MockClass>

+class NiceMock<NiceMock<MockClass> >;

+template <typename MockClass>

+class NiceMock<NaggyMock<MockClass> >;

+template <typename MockClass>

+class NiceMock<StrictMock<MockClass> >;

+

+template <typename MockClass>

+class NaggyMock<NiceMock<MockClass> >;

+template <typename MockClass>

+class NaggyMock<NaggyMock<MockClass> >;

+template <typename MockClass>

+class NaggyMock<StrictMock<MockClass> >;

+

+template <typename MockClass>

+class StrictMock<NiceMock<MockClass> >;

+template <typename MockClass>

+class StrictMock<NaggyMock<MockClass> >;

+template <typename MockClass>

+class StrictMock<StrictMock<MockClass> >;

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump
new file mode 100644
index 0000000..60191f5
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump
@@ -0,0 +1,161 @@
+$$ -*- mode: c++; -*-

+$$ This is a Pump source file.  Please use Pump to convert it to

+$$ gmock-generated-nice-strict.h.

+$$

+$var n = 10  $$ The maximum arity we support.

+// 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: wan@google.com (Zhanyong Wan)

+

+// Implements class templates NiceMock, NaggyMock, and StrictMock.

+//

+// Given a mock class MockFoo that is created using Google Mock,

+// NiceMock<MockFoo> is a subclass of MockFoo that allows

+// uninteresting calls (i.e. calls to mock methods that have no

+// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo

+// that prints a warning when an uninteresting call occurs, and

+// StrictMock<MockFoo> is a subclass of MockFoo that treats all

+// uninteresting calls as errors.

+//

+// Currently a mock is naggy by default, so MockFoo and

+// NaggyMock<MockFoo> behave like the same.  However, we will soon

+// switch the default behavior of mocks to be nice, as that in general

+// leads to more maintainable tests.  When that happens, MockFoo will

+// stop behaving like NaggyMock<MockFoo> and start behaving like

+// NiceMock<MockFoo>.

+//

+// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of

+// their respective base class, with up-to $n arguments.  Therefore

+// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock

+// where MockFoo has a constructor that accepts (int, const char*),

+// for example.

+//

+// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,

+// and StrictMock<MockFoo> only works for mock methods defined using

+// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.

+// If a mock method is defined in a base class of MockFoo, the "nice"

+// or "strict" modifier may not affect it, depending on the compiler.

+// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT

+// supported.

+//

+// Another known limitation is that the constructors of the base mock

+// cannot have arguments passed by non-const reference, which are

+// banned by the Google C++ style guide anyway.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_

+

+#include "gmock/gmock-spec-builders.h"

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+

+$range kind 0..2

+$for kind [[

+

+$var clazz=[[$if kind==0 [[NiceMock]]

+             $elif kind==1 [[NaggyMock]]

+             $else [[StrictMock]]]]

+

+$var method=[[$if kind==0 [[AllowUninterestingCalls]]

+             $elif kind==1 [[WarnUninterestingCalls]]

+             $else [[FailUninterestingCalls]]]]

+

+template <class MockClass>

+class $clazz : public MockClass {

+ public:

+  // We don't factor out the constructor body to a common method, as

+  // we have to avoid a possible clash with members of MockClass.

+  $clazz() {

+    ::testing::Mock::$method(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+  // C++ doesn't (yet) allow inheritance of constructors, so we have

+  // to define it for each arity.

+  template <typename A1>

+  explicit $clazz(const A1& a1) : MockClass(a1) {

+    ::testing::Mock::$method(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+$range i 2..n

+$for i [[

+$range j 1..i

+  template <$for j, [[typename A$j]]>

+  $clazz($for j, [[const A$j& a$j]]) : MockClass($for j, [[a$j]]) {

+    ::testing::Mock::$method(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+

+]]

+  virtual ~$clazz() {

+    ::testing::Mock::UnregisterCallReaction(

+        internal::ImplicitCast_<MockClass*>(this));

+  }

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_($clazz);

+};

+

+]]

+

+// The following specializations catch some (relatively more common)

+// user errors of nesting nice and strict mocks.  They do NOT catch

+// all possible errors.

+

+// These specializations are declared but not defined, as NiceMock,

+// NaggyMock, and StrictMock cannot be nested.

+

+template <typename MockClass>

+class NiceMock<NiceMock<MockClass> >;

+template <typename MockClass>

+class NiceMock<NaggyMock<MockClass> >;

+template <typename MockClass>

+class NiceMock<StrictMock<MockClass> >;

+

+template <typename MockClass>

+class NaggyMock<NiceMock<MockClass> >;

+template <typename MockClass>

+class NaggyMock<NaggyMock<MockClass> >;

+template <typename MockClass>

+class NaggyMock<StrictMock<MockClass> >;

+

+template <typename MockClass>

+class StrictMock<NiceMock<MockClass> >;

+template <typename MockClass>

+class StrictMock<NaggyMock<MockClass> >;

+template <typename MockClass>

+class StrictMock<StrictMock<MockClass> >;

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-matchers.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-matchers.h
new file mode 100644
index 0000000..ae44c48
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-matchers.h
@@ -0,0 +1,3986 @@
+// 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 argument matchers.  More

+// matchers can be defined by the user implementing the

+// MatcherInterface<T> interface if necessary.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_

+

+#include <math.h>

+#include <algorithm>

+#include <iterator>

+#include <limits>

+#include <ostream>  // NOLINT

+#include <sstream>

+#include <string>

+#include <utility>

+#include <vector>

+

+#include "gmock/internal/gmock-internal-utils.h"

+#include "gmock/internal/gmock-port.h"

+#include "gtest/gtest.h"

+

+#if GTEST_LANG_CXX11

+#include <initializer_list>  // NOLINT -- must be after gtest.h

+#endif

+

+namespace testing {

+

+// To implement a matcher Foo for type T, define:

+//   1. a class FooMatcherImpl that implements the

+//      MatcherInterface<T> interface, and

+//   2. a factory function that creates a Matcher<T> object from a

+//      FooMatcherImpl*.

+//

+// The two-level delegation design makes it possible to allow a user

+// to write "v" instead of "Eq(v)" where a Matcher is expected, which

+// is impossible if we pass matchers by pointers.  It also eases

+// ownership management as Matcher objects can now be copied like

+// plain values.

+

+// MatchResultListener is an abstract class.  Its << operator can be

+// used by a matcher to explain why a value matches or doesn't match.

+//

+// TODO(wan@google.com): add method

+//   bool InterestedInWhy(bool result) const;

+// to indicate whether the listener is interested in why the match

+// result is 'result'.

+class MatchResultListener {

+ public:

+  // Creates a listener object with the given underlying ostream.  The

+  // listener does not own the ostream, and does not dereference it

+  // in the constructor or destructor.

+  explicit MatchResultListener(::std::ostream* os) : stream_(os) {}

+  virtual ~MatchResultListener() = 0;  // Makes this class abstract.

+

+  // Streams x to the underlying ostream; does nothing if the ostream

+  // is NULL.

+  template <typename T>

+  MatchResultListener& operator<<(const T& x) {

+    if (stream_ != NULL)

+      *stream_ << x;

+    return *this;

+  }

+

+  // Returns the underlying ostream.

+  ::std::ostream* stream() { return stream_; }

+

+  // Returns true iff the listener is interested in an explanation of

+  // the match result.  A matcher's MatchAndExplain() method can use

+  // this information to avoid generating the explanation when no one

+  // intends to hear it.

+  bool IsInterested() const { return stream_ != NULL; }

+

+ private:

+  ::std::ostream* const stream_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener);

+};

+

+inline MatchResultListener::~MatchResultListener() {

+}

+

+// An instance of a subclass of this knows how to describe itself as a

+// matcher.

+class MatcherDescriberInterface {

+ public:

+  virtual ~MatcherDescriberInterface() {}

+

+  // Describes this matcher to an ostream.  The function should print

+  // a verb phrase that describes the property a value matching this

+  // matcher should have.  The subject of the verb phrase is the value

+  // being matched.  For example, the DescribeTo() method of the Gt(7)

+  // matcher prints "is greater than 7".

+  virtual void DescribeTo(::std::ostream* os) const = 0;

+

+  // Describes the negation of this matcher to an ostream.  For

+  // example, if the description of this matcher is "is greater than

+  // 7", the negated description could be "is not greater than 7".

+  // You are not required to override this when implementing

+  // MatcherInterface, but it is highly advised so that your matcher

+  // can produce good error messages.

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "not (";

+    DescribeTo(os);

+    *os << ")";

+  }

+};

+

+// The implementation of a matcher.

+template <typename T>

+class MatcherInterface : public MatcherDescriberInterface {

+ public:

+  // Returns true iff the matcher matches x; also explains the match

+  // result to 'listener' if necessary (see the next paragraph), in

+  // the form of a non-restrictive relative clause ("which ...",

+  // "whose ...", etc) that describes x.  For example, the

+  // MatchAndExplain() method of the Pointee(...) matcher should

+  // generate an explanation like "which points to ...".

+  //

+  // Implementations of MatchAndExplain() should add an explanation of

+  // the match result *if and only if* they can provide additional

+  // information that's not already present (or not obvious) in the

+  // print-out of x and the matcher's description.  Whether the match

+  // succeeds is not a factor in deciding whether an explanation is

+  // needed, as sometimes the caller needs to print a failure message

+  // when the match succeeds (e.g. when the matcher is used inside

+  // Not()).

+  //

+  // For example, a "has at least 10 elements" matcher should explain

+  // what the actual element count is, regardless of the match result,

+  // as it is useful information to the reader; on the other hand, an

+  // "is empty" matcher probably only needs to explain what the actual

+  // size is when the match fails, as it's redundant to say that the

+  // size is 0 when the value is already known to be empty.

+  //

+  // You should override this method when defining a new matcher.

+  //

+  // It's the responsibility of the caller (Google Mock) to guarantee

+  // that 'listener' is not NULL.  This helps to simplify a matcher's

+  // implementation when it doesn't care about the performance, as it

+  // can talk to 'listener' without checking its validity first.

+  // However, in order to implement dummy listeners efficiently,

+  // listener->stream() may be NULL.

+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;

+

+  // Inherits these methods from MatcherDescriberInterface:

+  //   virtual void DescribeTo(::std::ostream* os) const = 0;

+  //   virtual void DescribeNegationTo(::std::ostream* os) const;

+};

+

+// A match result listener that stores the explanation in a string.

+class StringMatchResultListener : public MatchResultListener {

+ public:

+  StringMatchResultListener() : MatchResultListener(&ss_) {}

+

+  // Returns the explanation accumulated so far.

+  internal::string str() const { return ss_.str(); }

+

+  // Clears the explanation accumulated so far.

+  void Clear() { ss_.str(""); }

+

+ private:

+  ::std::stringstream ss_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);

+};

+

+namespace internal {

+

+// A match result listener that ignores the explanation.

+class DummyMatchResultListener : public MatchResultListener {

+ public:

+  DummyMatchResultListener() : MatchResultListener(NULL) {}

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener);

+};

+

+// A match result listener that forwards the explanation to a given

+// ostream.  The difference between this and MatchResultListener is

+// that the former is concrete.

+class StreamMatchResultListener : public MatchResultListener {

+ public:

+  explicit StreamMatchResultListener(::std::ostream* os)

+      : MatchResultListener(os) {}

+

+ private:

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener);

+};

+

+// An internal class for implementing Matcher<T>, which will derive

+// from it.  We put functionalities common to all Matcher<T>

+// specializations here to avoid code duplication.

+template <typename T>

+class MatcherBase {

+ public:

+  // Returns true iff the matcher matches x; also explains the match

+  // result to 'listener'.

+  bool MatchAndExplain(T x, MatchResultListener* listener) const {

+    return impl_->MatchAndExplain(x, listener);

+  }

+

+  // Returns true iff this matcher matches x.

+  bool Matches(T x) const {

+    DummyMatchResultListener dummy;

+    return MatchAndExplain(x, &dummy);

+  }

+

+  // Describes this matcher to an ostream.

+  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }

+

+  // Describes the negation of this matcher to an ostream.

+  void DescribeNegationTo(::std::ostream* os) const {

+    impl_->DescribeNegationTo(os);

+  }

+

+  // Explains why x matches, or doesn't match, the matcher.

+  void ExplainMatchResultTo(T x, ::std::ostream* os) const {

+    StreamMatchResultListener listener(os);

+    MatchAndExplain(x, &listener);

+  }

+

+  // Returns the describer for this matcher object; retains ownership

+  // of the describer, which is only guaranteed to be alive when

+  // this matcher object is alive.

+  const MatcherDescriberInterface* GetDescriber() const {

+    return impl_.get();

+  }

+

+ protected:

+  MatcherBase() {}

+

+  // Constructs a matcher from its implementation.

+  explicit MatcherBase(const MatcherInterface<T>* impl)

+      : impl_(impl) {}

+

+  virtual ~MatcherBase() {}

+

+ private:

+  // shared_ptr (util/gtl/shared_ptr.h) and linked_ptr have similar

+  // interfaces.  The former dynamically allocates a chunk of memory

+  // to hold the reference count, while the latter tracks all

+  // references using a circular linked list without allocating

+  // memory.  It has been observed that linked_ptr performs better in

+  // typical scenarios.  However, shared_ptr can out-perform

+  // linked_ptr when there are many more uses of the copy constructor

+  // than the default constructor.

+  //

+  // If performance becomes a problem, we should see if using

+  // shared_ptr helps.

+  ::testing::internal::linked_ptr<const MatcherInterface<T> > impl_;

+};

+

+}  // namespace internal

+

+// A Matcher<T> is a copyable and IMMUTABLE (except by assignment)

+// object that can check whether a value of type T matches.  The

+// implementation of Matcher<T> is just a linked_ptr to const

+// MatcherInterface<T>, so copying is fairly cheap.  Don't inherit

+// from Matcher!

+template <typename T>

+class Matcher : public internal::MatcherBase<T> {

+ public:

+  // Constructs a null matcher.  Needed for storing Matcher objects in STL

+  // containers.  A default-constructed matcher is not yet initialized.  You

+  // cannot use it until a valid value has been assigned to it.

+  Matcher() {}

+

+  // Constructs a matcher from its implementation.

+  explicit Matcher(const MatcherInterface<T>* impl)

+      : internal::MatcherBase<T>(impl) {}

+

+  // Implicit constructor here allows people to write

+  // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes

+  Matcher(T value);  // NOLINT

+};

+

+// The following two specializations allow the user to write str

+// instead of Eq(str) and "foo" instead of Eq("foo") when a string

+// matcher is expected.

+template <>

+class GTEST_API_ Matcher<const internal::string&>

+    : public internal::MatcherBase<const internal::string&> {

+ public:

+  Matcher() {}

+

+  explicit Matcher(const MatcherInterface<const internal::string&>* impl)

+      : internal::MatcherBase<const internal::string&>(impl) {}

+

+  // Allows the user to write str instead of Eq(str) sometimes, where

+  // str is a string object.

+  Matcher(const internal::string& s);  // NOLINT

+

+  // Allows the user to write "foo" instead of Eq("foo") sometimes.

+  Matcher(const char* s);  // NOLINT

+};

+

+template <>

+class GTEST_API_ Matcher<internal::string>

+    : public internal::MatcherBase<internal::string> {

+ public:

+  Matcher() {}

+

+  explicit Matcher(const MatcherInterface<internal::string>* impl)

+      : internal::MatcherBase<internal::string>(impl) {}

+

+  // Allows the user to write str instead of Eq(str) sometimes, where

+  // str is a string object.

+  Matcher(const internal::string& s);  // NOLINT

+

+  // Allows the user to write "foo" instead of Eq("foo") sometimes.

+  Matcher(const char* s);  // NOLINT

+};

+

+#if GTEST_HAS_STRING_PIECE_

+// The following two specializations allow the user to write str

+// instead of Eq(str) and "foo" instead of Eq("foo") when a StringPiece

+// matcher is expected.

+template <>

+class GTEST_API_ Matcher<const StringPiece&>

+    : public internal::MatcherBase<const StringPiece&> {

+ public:

+  Matcher() {}

+

+  explicit Matcher(const MatcherInterface<const StringPiece&>* impl)

+      : internal::MatcherBase<const StringPiece&>(impl) {}

+

+  // Allows the user to write str instead of Eq(str) sometimes, where

+  // str is a string object.

+  Matcher(const internal::string& s);  // NOLINT

+

+  // Allows the user to write "foo" instead of Eq("foo") sometimes.

+  Matcher(const char* s);  // NOLINT

+

+  // Allows the user to pass StringPieces directly.

+  Matcher(StringPiece s);  // NOLINT

+};

+

+template <>

+class GTEST_API_ Matcher<StringPiece>

+    : public internal::MatcherBase<StringPiece> {

+ public:

+  Matcher() {}

+

+  explicit Matcher(const MatcherInterface<StringPiece>* impl)

+      : internal::MatcherBase<StringPiece>(impl) {}

+

+  // Allows the user to write str instead of Eq(str) sometimes, where

+  // str is a string object.

+  Matcher(const internal::string& s);  // NOLINT

+

+  // Allows the user to write "foo" instead of Eq("foo") sometimes.

+  Matcher(const char* s);  // NOLINT

+

+  // Allows the user to pass StringPieces directly.

+  Matcher(StringPiece s);  // NOLINT

+};

+#endif  // GTEST_HAS_STRING_PIECE_

+

+// The PolymorphicMatcher class template makes it easy to implement a

+// polymorphic matcher (i.e. a matcher that can match values of more

+// than one type, e.g. Eq(n) and NotNull()).

+//

+// To define a polymorphic matcher, a user should provide an Impl

+// class that has a DescribeTo() method and a DescribeNegationTo()

+// method, and define a member function (or member function template)

+//

+//   bool MatchAndExplain(const Value& value,

+//                        MatchResultListener* listener) const;

+//

+// See the definition of NotNull() for a complete example.

+template <class Impl>

+class PolymorphicMatcher {

+ public:

+  explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}

+

+  // Returns a mutable reference to the underlying matcher

+  // implementation object.

+  Impl& mutable_impl() { return impl_; }

+

+  // Returns an immutable reference to the underlying matcher

+  // implementation object.

+  const Impl& impl() const { return impl_; }

+

+  template <typename T>

+  operator Matcher<T>() const {

+    return Matcher<T>(new MonomorphicImpl<T>(impl_));

+  }

+

+ private:

+  template <typename T>

+  class MonomorphicImpl : public MatcherInterface<T> {

+   public:

+    explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      impl_.DescribeTo(os);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      impl_.DescribeNegationTo(os);

+    }

+

+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {

+      return impl_.MatchAndExplain(x, listener);

+    }

+

+   private:

+    const Impl impl_;

+

+    GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);

+  };

+

+  Impl impl_;

+

+  GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher);

+};

+

+// Creates a matcher from its implementation.  This is easier to use

+// than the Matcher<T> constructor as it doesn't require you to

+// explicitly write the template argument, e.g.

+//

+//   MakeMatcher(foo);

+// vs

+//   Matcher<const string&>(foo);

+template <typename T>

+inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) {

+  return Matcher<T>(impl);

+}

+

+// Creates a polymorphic matcher from its implementation.  This is

+// easier to use than the PolymorphicMatcher<Impl> constructor as it

+// doesn't require you to explicitly write the template argument, e.g.

+//

+//   MakePolymorphicMatcher(foo);

+// vs

+//   PolymorphicMatcher<TypeOfFoo>(foo);

+template <class Impl>

+inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) {

+  return PolymorphicMatcher<Impl>(impl);

+}

+

+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION

+// and MUST NOT BE USED IN USER CODE!!!

+namespace internal {

+

+// The MatcherCastImpl class template is a helper for implementing

+// MatcherCast().  We need this helper in order to partially

+// specialize the implementation of MatcherCast() (C++ allows

+// class/struct templates to be partially specialized, but not

+// function templates.).

+

+// This general version is used when MatcherCast()'s argument is a

+// polymorphic matcher (i.e. something that can be converted to a

+// Matcher but is not one yet; for example, Eq(value)) or a value (for

+// example, "hello").

+template <typename T, typename M>

+class MatcherCastImpl {

+ public:

+  static Matcher<T> Cast(M polymorphic_matcher_or_value) {

+    // M can be a polymorhic matcher, in which case we want to use

+    // its conversion operator to create Matcher<T>.  Or it can be a value

+    // that should be passed to the Matcher<T>'s constructor.

+    //

+    // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a

+    // polymorphic matcher because it'll be ambiguous if T has an implicit

+    // constructor from M (this usually happens when T has an implicit

+    // constructor from any type).

+    //

+    // It won't work to unconditionally implict_cast

+    // polymorphic_matcher_or_value to Matcher<T> because it won't trigger

+    // a user-defined conversion from M to T if one exists (assuming M is

+    // a value).

+    return CastImpl(

+        polymorphic_matcher_or_value,

+        BooleanConstant<

+            internal::ImplicitlyConvertible<M, Matcher<T> >::value>());

+  }

+

+ private:

+  static Matcher<T> CastImpl(M value, BooleanConstant<false>) {

+    // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic

+    // matcher.  It must be a value then.  Use direct initialization to create

+    // a matcher.

+    return Matcher<T>(ImplicitCast_<T>(value));

+  }

+

+  static Matcher<T> CastImpl(M polymorphic_matcher_or_value,

+                             BooleanConstant<true>) {

+    // M is implicitly convertible to Matcher<T>, which means that either

+    // M is a polymorhpic matcher or Matcher<T> has an implicit constructor

+    // from M.  In both cases using the implicit conversion will produce a

+    // matcher.

+    //

+    // Even if T has an implicit constructor from M, it won't be called because

+    // creating Matcher<T> would require a chain of two user-defined conversions

+    // (first to create T from M and then to create Matcher<T> from T).

+    return polymorphic_matcher_or_value;

+  }

+};

+

+// This more specialized version is used when MatcherCast()'s argument

+// is already a Matcher.  This only compiles when type T can be

+// statically converted to type U.

+template <typename T, typename U>

+class MatcherCastImpl<T, Matcher<U> > {

+ public:

+  static Matcher<T> Cast(const Matcher<U>& source_matcher) {

+    return Matcher<T>(new Impl(source_matcher));

+  }

+

+ private:

+  class Impl : public MatcherInterface<T> {

+   public:

+    explicit Impl(const Matcher<U>& source_matcher)

+        : source_matcher_(source_matcher) {}

+

+    // We delegate the matching logic to the source matcher.

+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {

+      return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);

+    }

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      source_matcher_.DescribeTo(os);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      source_matcher_.DescribeNegationTo(os);

+    }

+

+   private:

+    const Matcher<U> source_matcher_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+};

+

+// This even more specialized version is used for efficiently casting

+// a matcher to its own type.

+template <typename T>

+class MatcherCastImpl<T, Matcher<T> > {

+ public:

+  static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }

+};

+

+}  // namespace internal

+

+// In order to be safe and clear, casting between different matcher

+// types is done explicitly via MatcherCast<T>(m), which takes a

+// matcher m and returns a Matcher<T>.  It compiles only when T can be

+// statically converted to the argument type of m.

+template <typename T, typename M>

+inline Matcher<T> MatcherCast(M matcher) {

+  return internal::MatcherCastImpl<T, M>::Cast(matcher);

+}

+

+// Implements SafeMatcherCast().

+//

+// We use an intermediate class to do the actual safe casting as Nokia's

+// Symbian compiler cannot decide between

+// template <T, M> ... (M) and

+// template <T, U> ... (const Matcher<U>&)

+// for function templates but can for member function templates.

+template <typename T>

+class SafeMatcherCastImpl {

+ public:

+  // This overload handles polymorphic matchers and values only since

+  // monomorphic matchers are handled by the next one.

+  template <typename M>

+  static inline Matcher<T> Cast(M polymorphic_matcher_or_value) {

+    return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);

+  }

+

+  // This overload handles monomorphic matchers.

+  //

+  // In general, if type T can be implicitly converted to type U, we can

+  // safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is

+  // contravariant): just keep a copy of the original Matcher<U>, convert the

+  // argument from type T to U, and then pass it to the underlying Matcher<U>.

+  // The only exception is when U is a reference and T is not, as the

+  // underlying Matcher<U> may be interested in the argument's address, which

+  // is not preserved in the conversion from T to U.

+  template <typename U>

+  static inline Matcher<T> Cast(const Matcher<U>& matcher) {

+    // Enforce that T can be implicitly converted to U.

+    GTEST_COMPILE_ASSERT_((internal::ImplicitlyConvertible<T, U>::value),

+                          T_must_be_implicitly_convertible_to_U);

+    // Enforce that we are not converting a non-reference type T to a reference

+    // type U.

+    GTEST_COMPILE_ASSERT_(

+        internal::is_reference<T>::value || !internal::is_reference<U>::value,

+        cannot_convert_non_referentce_arg_to_reference);

+    // In case both T and U are arithmetic types, enforce that the

+    // conversion is not lossy.

+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;

+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;

+    const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;

+    const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;

+    GTEST_COMPILE_ASSERT_(

+        kTIsOther || kUIsOther ||

+        (internal::LosslessArithmeticConvertible<RawT, RawU>::value),

+        conversion_of_arithmetic_types_must_be_lossless);

+    return MatcherCast<T>(matcher);

+  }

+};

+

+template <typename T, typename M>

+inline Matcher<T> SafeMatcherCast(const M& polymorphic_matcher) {

+  return SafeMatcherCastImpl<T>::Cast(polymorphic_matcher);

+}

+

+// A<T>() returns a matcher that matches any value of type T.

+template <typename T>

+Matcher<T> A();

+

+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION

+// and MUST NOT BE USED IN USER CODE!!!

+namespace internal {

+

+// If the explanation is not empty, prints it to the ostream.

+inline void PrintIfNotEmpty(const internal::string& explanation,

+                            ::std::ostream* os) {

+  if (explanation != "" && os != NULL) {

+    *os << ", " << explanation;

+  }

+}

+

+// Returns true if the given type name is easy to read by a human.

+// This is used to decide whether printing the type of a value might

+// be helpful.

+inline bool IsReadableTypeName(const string& type_name) {

+  // We consider a type name readable if it's short or doesn't contain

+  // a template or function type.

+  return (type_name.length() <= 20 ||

+          type_name.find_first_of("<(") == string::npos);

+}

+

+// Matches the value against the given matcher, prints the value and explains

+// the match result to the listener. Returns the match result.

+// 'listener' must not be NULL.

+// Value cannot be passed by const reference, because some matchers take a

+// non-const argument.

+template <typename Value, typename T>

+bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,

+                          MatchResultListener* listener) {

+  if (!listener->IsInterested()) {

+    // If the listener is not interested, we do not need to construct the

+    // inner explanation.

+    return matcher.Matches(value);

+  }

+

+  StringMatchResultListener inner_listener;

+  const bool match = matcher.MatchAndExplain(value, &inner_listener);

+

+  UniversalPrint(value, listener->stream());

+#if GTEST_HAS_RTTI

+  const string& type_name = GetTypeName<Value>();

+  if (IsReadableTypeName(type_name))

+    *listener->stream() << " (of type " << type_name << ")";

+#endif

+  PrintIfNotEmpty(inner_listener.str(), listener->stream());

+

+  return match;

+}

+

+// An internal helper class for doing compile-time loop on a tuple's

+// fields.

+template <size_t N>

+class TuplePrefix {

+ public:

+  // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true

+  // iff the first N fields of matcher_tuple matches the first N

+  // fields of value_tuple, respectively.

+  template <typename MatcherTuple, typename ValueTuple>

+  static bool Matches(const MatcherTuple& matcher_tuple,

+                      const ValueTuple& value_tuple) {

+    using ::std::tr1::get;

+    return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)

+        && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));

+  }

+

+  // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)

+  // describes failures in matching the first N fields of matchers

+  // against the first N fields of values.  If there is no failure,

+  // nothing will be streamed to os.

+  template <typename MatcherTuple, typename ValueTuple>

+  static void ExplainMatchFailuresTo(const MatcherTuple& matchers,

+                                     const ValueTuple& values,

+                                     ::std::ostream* os) {

+    using ::std::tr1::tuple_element;

+    using ::std::tr1::get;

+

+    // First, describes failures in the first N - 1 fields.

+    TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);

+

+    // Then describes the failure (if any) in the (N - 1)-th (0-based)

+    // field.

+    typename tuple_element<N - 1, MatcherTuple>::type matcher =

+        get<N - 1>(matchers);

+    typedef typename tuple_element<N - 1, ValueTuple>::type Value;

+    Value value = get<N - 1>(values);

+    StringMatchResultListener listener;

+    if (!matcher.MatchAndExplain(value, &listener)) {

+      // TODO(wan): include in the message the name of the parameter

+      // as used in MOCK_METHOD*() when possible.

+      *os << "  Expected arg #" << N - 1 << ": ";

+      get<N - 1>(matchers).DescribeTo(os);

+      *os << "\n           Actual: ";

+      // We remove the reference in type Value to prevent the

+      // universal printer from printing the address of value, which

+      // isn't interesting to the user most of the time.  The

+      // matcher's MatchAndExplain() method handles the case when

+      // the address is interesting.

+      internal::UniversalPrint(value, os);

+      PrintIfNotEmpty(listener.str(), os);

+      *os << "\n";

+    }

+  }

+};

+

+// The base case.

+template <>

+class TuplePrefix<0> {

+ public:

+  template <typename MatcherTuple, typename ValueTuple>

+  static bool Matches(const MatcherTuple& /* matcher_tuple */,

+                      const ValueTuple& /* value_tuple */) {

+    return true;

+  }

+

+  template <typename MatcherTuple, typename ValueTuple>

+  static void ExplainMatchFailuresTo(const MatcherTuple& /* matchers */,

+                                     const ValueTuple& /* values */,

+                                     ::std::ostream* /* os */) {}

+};

+

+// TupleMatches(matcher_tuple, value_tuple) returns true iff all

+// matchers in matcher_tuple match the corresponding fields in

+// value_tuple.  It is a compiler error if matcher_tuple and

+// value_tuple have different number of fields or incompatible field

+// types.

+template <typename MatcherTuple, typename ValueTuple>

+bool TupleMatches(const MatcherTuple& matcher_tuple,

+                  const ValueTuple& value_tuple) {

+  using ::std::tr1::tuple_size;

+  // Makes sure that matcher_tuple and value_tuple have the same

+  // number of fields.

+  GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value ==

+                        tuple_size<ValueTuple>::value,

+                        matcher_and_value_have_different_numbers_of_fields);

+  return TuplePrefix<tuple_size<ValueTuple>::value>::

+      Matches(matcher_tuple, value_tuple);

+}

+

+// Describes failures in matching matchers against values.  If there

+// is no failure, nothing will be streamed to os.

+template <typename MatcherTuple, typename ValueTuple>

+void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,

+                                const ValueTuple& values,

+                                ::std::ostream* os) {

+  using ::std::tr1::tuple_size;

+  TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(

+      matchers, values, os);

+}

+

+// TransformTupleValues and its helper.

+//

+// TransformTupleValuesHelper hides the internal machinery that

+// TransformTupleValues uses to implement a tuple traversal.

+template <typename Tuple, typename Func, typename OutIter>

+class TransformTupleValuesHelper {

+ private:

+  typedef typename ::std::tr1::tuple_size<Tuple> TupleSize;

+

+ public:

+  // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.

+  // Returns the final value of 'out' in case the caller needs it.

+  static OutIter Run(Func f, const Tuple& t, OutIter out) {

+    return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);

+  }

+

+ private:

+  template <typename Tup, size_t kRemainingSize>

+  struct IterateOverTuple {

+    OutIter operator() (Func f, const Tup& t, OutIter out) const {

+      *out++ = f(::std::tr1::get<TupleSize::value - kRemainingSize>(t));

+      return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);

+    }

+  };

+  template <typename Tup>

+  struct IterateOverTuple<Tup, 0> {

+    OutIter operator() (Func /* f */, const Tup& /* t */, OutIter out) const {

+      return out;

+    }

+  };

+};

+

+// Successively invokes 'f(element)' on each element of the tuple 't',

+// appending each result to the 'out' iterator. Returns the final value

+// of 'out'.

+template <typename Tuple, typename Func, typename OutIter>

+OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {

+  return TransformTupleValuesHelper<Tuple, Func, OutIter>::Run(f, t, out);

+}

+

+// Implements A<T>().

+template <typename T>

+class AnyMatcherImpl : public MatcherInterface<T> {

+ public:

+  virtual bool MatchAndExplain(

+      T /* x */, MatchResultListener* /* listener */) const { return true; }

+  virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; }

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    // This is mostly for completeness' safe, as it's not very useful

+    // to write Not(A<bool>()).  However we cannot completely rule out

+    // such a possibility, and it doesn't hurt to be prepared.

+    *os << "never matches";

+  }

+};

+

+// Implements _, a matcher that matches any value of any

+// type.  This is a polymorphic matcher, so we need a template type

+// conversion operator to make it appearing as a Matcher<T> for any

+// type T.

+class AnythingMatcher {

+ public:

+  template <typename T>

+  operator Matcher<T>() const { return A<T>(); }

+};

+

+// Implements a matcher that compares a given value with a

+// pre-supplied value using one of the ==, <=, <, etc, operators.  The

+// two values being compared don't have to have the same type.

+//

+// The matcher defined here is polymorphic (for example, Eq(5) can be

+// used to match an int, a short, a double, etc).  Therefore we use

+// a template type conversion operator in the implementation.

+//

+// We define this as a macro in order to eliminate duplicated source

+// code.

+//

+// The following template definition assumes that the Rhs parameter is

+// a "bare" type (i.e. neither 'const T' nor 'T&').

+#define GMOCK_IMPLEMENT_COMPARISON_MATCHER_( \

+    name, op, relation, negated_relation) \

+  template <typename Rhs> class name##Matcher { \

+   public: \

+    explicit name##Matcher(const Rhs& rhs) : rhs_(rhs) {} \

+    template <typename Lhs> \

+    operator Matcher<Lhs>() const { \

+      return MakeMatcher(new Impl<Lhs>(rhs_)); \

+    } \

+   private: \

+    template <typename Lhs> \

+    class Impl : public MatcherInterface<Lhs> { \

+     public: \

+      explicit Impl(const Rhs& rhs) : rhs_(rhs) {} \

+      virtual bool MatchAndExplain(\

+          Lhs lhs, MatchResultListener* /* listener */) const { \

+        return lhs op rhs_; \

+      } \

+      virtual void DescribeTo(::std::ostream* os) const { \

+        *os << relation  " "; \

+        UniversalPrint(rhs_, os); \

+      } \

+      virtual void DescribeNegationTo(::std::ostream* os) const { \

+        *os << negated_relation  " "; \

+        UniversalPrint(rhs_, os); \

+      } \

+     private: \

+      Rhs rhs_; \

+      GTEST_DISALLOW_ASSIGN_(Impl); \

+    }; \

+    Rhs rhs_; \

+    GTEST_DISALLOW_ASSIGN_(name##Matcher); \

+  }

+

+// Implements Eq(v), Ge(v), Gt(v), Le(v), Lt(v), and Ne(v)

+// respectively.

+GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Eq, ==, "is equal to", "isn't equal to");

+GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Ge, >=, "is >=", "isn't >=");

+GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Gt, >, "is >", "isn't >");

+GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Le, <=, "is <=", "isn't <=");

+GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Lt, <, "is <", "isn't <");

+GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Ne, !=, "isn't equal to", "is equal to");

+

+#undef GMOCK_IMPLEMENT_COMPARISON_MATCHER_

+

+// Implements the polymorphic IsNull() matcher, which matches any raw or smart

+// pointer that is NULL.

+class IsNullMatcher {

+ public:

+  template <typename Pointer>

+  bool MatchAndExplain(const Pointer& p,

+                       MatchResultListener* /* listener */) const {

+    return GetRawPointer(p) == NULL;

+  }

+

+  void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "isn't NULL";

+  }

+};

+

+// Implements the polymorphic NotNull() matcher, which matches any raw or smart

+// pointer that is not NULL.

+class NotNullMatcher {

+ public:

+  template <typename Pointer>

+  bool MatchAndExplain(const Pointer& p,

+                       MatchResultListener* /* listener */) const {

+    return GetRawPointer(p) != NULL;

+  }

+

+  void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "is NULL";

+  }

+};

+

+// Ref(variable) matches any argument that is a reference to

+// 'variable'.  This matcher is polymorphic as it can match any

+// super type of the type of 'variable'.

+//

+// The RefMatcher template class implements Ref(variable).  It can

+// only be instantiated with a reference type.  This prevents a user

+// from mistakenly using Ref(x) to match a non-reference function

+// argument.  For example, the following will righteously cause a

+// compiler error:

+//

+//   int n;

+//   Matcher<int> m1 = Ref(n);   // This won't compile.

+//   Matcher<int&> m2 = Ref(n);  // This will compile.

+template <typename T>

+class RefMatcher;

+

+template <typename T>

+class RefMatcher<T&> {

+  // Google Mock is a generic framework and thus needs to support

+  // mocking any function types, including those that take non-const

+  // reference arguments.  Therefore the template parameter T (and

+  // Super below) can be instantiated to either a const type or a

+  // non-const type.

+ public:

+  // RefMatcher() takes a T& instead of const T&, as we want the

+  // compiler to catch using Ref(const_value) as a matcher for a

+  // non-const reference.

+  explicit RefMatcher(T& x) : object_(x) {}  // NOLINT

+

+  template <typename Super>

+  operator Matcher<Super&>() const {

+    // By passing object_ (type T&) to Impl(), which expects a Super&,

+    // we make sure that Super is a super type of T.  In particular,

+    // this catches using Ref(const_value) as a matcher for a

+    // non-const reference, as you cannot implicitly convert a const

+    // reference to a non-const reference.

+    return MakeMatcher(new Impl<Super>(object_));

+  }

+

+ private:

+  template <typename Super>

+  class Impl : public MatcherInterface<Super&> {

+   public:

+    explicit Impl(Super& x) : object_(x) {}  // NOLINT

+

+    // MatchAndExplain() takes a Super& (as opposed to const Super&)

+    // in order to match the interface MatcherInterface<Super&>.

+    virtual bool MatchAndExplain(

+        Super& x, MatchResultListener* listener) const {

+      *listener << "which is located @" << static_cast<const void*>(&x);

+      return &x == &object_;

+    }

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      *os << "references the variable ";

+      UniversalPrinter<Super&>::Print(object_, os);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      *os << "does not reference the variable ";

+      UniversalPrinter<Super&>::Print(object_, os);

+    }

+

+   private:

+    const Super& object_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  T& object_;

+

+  GTEST_DISALLOW_ASSIGN_(RefMatcher);

+};

+

+// Polymorphic helper functions for narrow and wide string matchers.

+inline bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) {

+  return String::CaseInsensitiveCStringEquals(lhs, rhs);

+}

+

+inline bool CaseInsensitiveCStringEquals(const wchar_t* lhs,

+                                         const wchar_t* rhs) {

+  return String::CaseInsensitiveWideCStringEquals(lhs, rhs);

+}

+

+// String comparison for narrow or wide strings that can have embedded NUL

+// characters.

+template <typename StringType>

+bool CaseInsensitiveStringEquals(const StringType& s1,

+                                 const StringType& s2) {

+  // Are the heads equal?

+  if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) {

+    return false;

+  }

+

+  // Skip the equal heads.

+  const typename StringType::value_type nul = 0;

+  const size_t i1 = s1.find(nul), i2 = s2.find(nul);

+

+  // Are we at the end of either s1 or s2?

+  if (i1 == StringType::npos || i2 == StringType::npos) {

+    return i1 == i2;

+  }

+

+  // Are the tails equal?

+  return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1));

+}

+

+// String matchers.

+

+// Implements equality-based string matchers like StrEq, StrCaseNe, and etc.

+template <typename StringType>

+class StrEqualityMatcher {

+ public:

+  StrEqualityMatcher(const StringType& str, bool expect_eq,

+                     bool case_sensitive)

+      : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}

+

+  // Accepts pointer types, particularly:

+  //   const char*

+  //   char*

+  //   const wchar_t*

+  //   wchar_t*

+  template <typename CharType>

+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {

+    if (s == NULL) {

+      return !expect_eq_;

+    }

+    return MatchAndExplain(StringType(s), listener);

+  }

+

+  // Matches anything that can convert to StringType.

+  //

+  // This is a template, not just a plain function with const StringType&,

+  // because StringPiece has some interfering non-explicit constructors.

+  template <typename MatcheeStringType>

+  bool MatchAndExplain(const MatcheeStringType& s,

+                       MatchResultListener* /* listener */) const {

+    const StringType& s2(s);

+    const bool eq = case_sensitive_ ? s2 == string_ :

+        CaseInsensitiveStringEquals(s2, string_);

+    return expect_eq_ == eq;

+  }

+

+  void DescribeTo(::std::ostream* os) const {

+    DescribeToHelper(expect_eq_, os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    DescribeToHelper(!expect_eq_, os);

+  }

+

+ private:

+  void DescribeToHelper(bool expect_eq, ::std::ostream* os) const {

+    *os << (expect_eq ? "is " : "isn't ");

+    *os << "equal to ";

+    if (!case_sensitive_) {

+      *os << "(ignoring case) ";

+    }

+    UniversalPrint(string_, os);

+  }

+

+  const StringType string_;

+  const bool expect_eq_;

+  const bool case_sensitive_;

+

+  GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);

+};

+

+// Implements the polymorphic HasSubstr(substring) matcher, which

+// can be used as a Matcher<T> as long as T can be converted to a

+// string.

+template <typename StringType>

+class HasSubstrMatcher {

+ public:

+  explicit HasSubstrMatcher(const StringType& substring)

+      : substring_(substring) {}

+

+  // Accepts pointer types, particularly:

+  //   const char*

+  //   char*

+  //   const wchar_t*

+  //   wchar_t*

+  template <typename CharType>

+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {

+    return s != NULL && MatchAndExplain(StringType(s), listener);

+  }

+

+  // Matches anything that can convert to StringType.

+  //

+  // This is a template, not just a plain function with const StringType&,

+  // because StringPiece has some interfering non-explicit constructors.

+  template <typename MatcheeStringType>

+  bool MatchAndExplain(const MatcheeStringType& s,

+                       MatchResultListener* /* listener */) const {

+    const StringType& s2(s);

+    return s2.find(substring_) != StringType::npos;

+  }

+

+  // Describes what this matcher matches.

+  void DescribeTo(::std::ostream* os) const {

+    *os << "has substring ";

+    UniversalPrint(substring_, os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "has no substring ";

+    UniversalPrint(substring_, os);

+  }

+

+ private:

+  const StringType substring_;

+

+  GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);

+};

+

+// Implements the polymorphic StartsWith(substring) matcher, which

+// can be used as a Matcher<T> as long as T can be converted to a

+// string.

+template <typename StringType>

+class StartsWithMatcher {

+ public:

+  explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {

+  }

+

+  // Accepts pointer types, particularly:

+  //   const char*

+  //   char*

+  //   const wchar_t*

+  //   wchar_t*

+  template <typename CharType>

+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {

+    return s != NULL && MatchAndExplain(StringType(s), listener);

+  }

+

+  // Matches anything that can convert to StringType.

+  //

+  // This is a template, not just a plain function with const StringType&,

+  // because StringPiece has some interfering non-explicit constructors.

+  template <typename MatcheeStringType>

+  bool MatchAndExplain(const MatcheeStringType& s,

+                       MatchResultListener* /* listener */) const {

+    const StringType& s2(s);

+    return s2.length() >= prefix_.length() &&

+        s2.substr(0, prefix_.length()) == prefix_;

+  }

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << "starts with ";

+    UniversalPrint(prefix_, os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "doesn't start with ";

+    UniversalPrint(prefix_, os);

+  }

+

+ private:

+  const StringType prefix_;

+

+  GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);

+};

+

+// Implements the polymorphic EndsWith(substring) matcher, which

+// can be used as a Matcher<T> as long as T can be converted to a

+// string.

+template <typename StringType>

+class EndsWithMatcher {

+ public:

+  explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}

+

+  // Accepts pointer types, particularly:

+  //   const char*

+  //   char*

+  //   const wchar_t*

+  //   wchar_t*

+  template <typename CharType>

+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {

+    return s != NULL && MatchAndExplain(StringType(s), listener);

+  }

+

+  // Matches anything that can convert to StringType.

+  //

+  // This is a template, not just a plain function with const StringType&,

+  // because StringPiece has some interfering non-explicit constructors.

+  template <typename MatcheeStringType>

+  bool MatchAndExplain(const MatcheeStringType& s,

+                       MatchResultListener* /* listener */) const {

+    const StringType& s2(s);

+    return s2.length() >= suffix_.length() &&

+        s2.substr(s2.length() - suffix_.length()) == suffix_;

+  }

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << "ends with ";

+    UniversalPrint(suffix_, os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "doesn't end with ";

+    UniversalPrint(suffix_, os);

+  }

+

+ private:

+  const StringType suffix_;

+

+  GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);

+};

+

+// Implements polymorphic matchers MatchesRegex(regex) and

+// ContainsRegex(regex), which can be used as a Matcher<T> as long as

+// T can be converted to a string.

+class MatchesRegexMatcher {

+ public:

+  MatchesRegexMatcher(const RE* regex, bool full_match)

+      : regex_(regex), full_match_(full_match) {}

+

+  // Accepts pointer types, particularly:

+  //   const char*

+  //   char*

+  //   const wchar_t*

+  //   wchar_t*

+  template <typename CharType>

+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {

+    return s != NULL && MatchAndExplain(internal::string(s), listener);

+  }

+

+  // Matches anything that can convert to internal::string.

+  //

+  // This is a template, not just a plain function with const internal::string&,

+  // because StringPiece has some interfering non-explicit constructors.

+  template <class MatcheeStringType>

+  bool MatchAndExplain(const MatcheeStringType& s,

+                       MatchResultListener* /* listener */) const {

+    const internal::string& s2(s);

+    return full_match_ ? RE::FullMatch(s2, *regex_) :

+        RE::PartialMatch(s2, *regex_);

+  }

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << (full_match_ ? "matches" : "contains")

+        << " regular expression ";

+    UniversalPrinter<internal::string>::Print(regex_->pattern(), os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "doesn't " << (full_match_ ? "match" : "contain")

+        << " regular expression ";

+    UniversalPrinter<internal::string>::Print(regex_->pattern(), os);

+  }

+

+ private:

+  const internal::linked_ptr<const RE> regex_;

+  const bool full_match_;

+

+  GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher);

+};

+

+// Implements a matcher that compares the two fields of a 2-tuple

+// using one of the ==, <=, <, etc, operators.  The two fields being

+// compared don't have to have the same type.

+//

+// The matcher defined here is polymorphic (for example, Eq() can be

+// used to match a tuple<int, short>, a tuple<const long&, double>,

+// etc).  Therefore we use a template type conversion operator in the

+// implementation.

+//

+// We define this as a macro in order to eliminate duplicated source

+// code.

+#define GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(name, op, relation) \

+  class name##2Matcher { \

+   public: \

+    template <typename T1, typename T2> \

+    operator Matcher< ::std::tr1::tuple<T1, T2> >() const { \

+      return MakeMatcher(new Impl< ::std::tr1::tuple<T1, T2> >); \

+    } \

+    template <typename T1, typename T2> \

+    operator Matcher<const ::std::tr1::tuple<T1, T2>&>() const { \

+      return MakeMatcher(new Impl<const ::std::tr1::tuple<T1, T2>&>); \

+    } \

+   private: \

+    template <typename Tuple> \

+    class Impl : public MatcherInterface<Tuple> { \

+     public: \

+      virtual bool MatchAndExplain( \

+          Tuple args, \

+          MatchResultListener* /* listener */) const { \

+        return ::std::tr1::get<0>(args) op ::std::tr1::get<1>(args); \

+      } \

+      virtual void DescribeTo(::std::ostream* os) const { \

+        *os << "are " relation;                                 \

+      } \

+      virtual void DescribeNegationTo(::std::ostream* os) const { \

+        *os << "aren't " relation; \

+      } \

+    }; \

+  }

+

+// Implements Eq(), Ge(), Gt(), Le(), Lt(), and Ne() respectively.

+GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Eq, ==, "an equal pair");

+GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(

+    Ge, >=, "a pair where the first >= the second");

+GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(

+    Gt, >, "a pair where the first > the second");

+GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(

+    Le, <=, "a pair where the first <= the second");

+GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(

+    Lt, <, "a pair where the first < the second");

+GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Ne, !=, "an unequal pair");

+

+#undef GMOCK_IMPLEMENT_COMPARISON2_MATCHER_

+

+// Implements the Not(...) matcher for a particular argument type T.

+// We do not nest it inside the NotMatcher class template, as that

+// will prevent different instantiations of NotMatcher from sharing

+// the same NotMatcherImpl<T> class.

+template <typename T>

+class NotMatcherImpl : public MatcherInterface<T> {

+ public:

+  explicit NotMatcherImpl(const Matcher<T>& matcher)

+      : matcher_(matcher) {}

+

+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {

+    return !matcher_.MatchAndExplain(x, listener);

+  }

+

+  virtual void DescribeTo(::std::ostream* os) const {

+    matcher_.DescribeNegationTo(os);

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    matcher_.DescribeTo(os);

+  }

+

+ private:

+  const Matcher<T> matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(NotMatcherImpl);

+};

+

+// Implements the Not(m) matcher, which matches a value that doesn't

+// match matcher m.

+template <typename InnerMatcher>

+class NotMatcher {

+ public:

+  explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}

+

+  // This template type conversion operator allows Not(m) to be used

+  // to match any type m can match.

+  template <typename T>

+  operator Matcher<T>() const {

+    return Matcher<T>(new NotMatcherImpl<T>(SafeMatcherCast<T>(matcher_)));

+  }

+

+ private:

+  InnerMatcher matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(NotMatcher);

+};

+

+// Implements the AllOf(m1, m2) matcher for a particular argument type

+// T. We do not nest it inside the BothOfMatcher class template, as

+// that will prevent different instantiations of BothOfMatcher from

+// sharing the same BothOfMatcherImpl<T> class.

+template <typename T>

+class BothOfMatcherImpl : public MatcherInterface<T> {

+ public:

+  BothOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)

+      : matcher1_(matcher1), matcher2_(matcher2) {}

+

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "(";

+    matcher1_.DescribeTo(os);

+    *os << ") and (";

+    matcher2_.DescribeTo(os);

+    *os << ")";

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "(";

+    matcher1_.DescribeNegationTo(os);

+    *os << ") or (";

+    matcher2_.DescribeNegationTo(os);

+    *os << ")";

+  }

+

+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {

+    // If either matcher1_ or matcher2_ doesn't match x, we only need

+    // to explain why one of them fails.

+    StringMatchResultListener listener1;

+    if (!matcher1_.MatchAndExplain(x, &listener1)) {

+      *listener << listener1.str();

+      return false;

+    }

+

+    StringMatchResultListener listener2;

+    if (!matcher2_.MatchAndExplain(x, &listener2)) {

+      *listener << listener2.str();

+      return false;

+    }

+

+    // Otherwise we need to explain why *both* of them match.

+    const internal::string s1 = listener1.str();

+    const internal::string s2 = listener2.str();

+

+    if (s1 == "") {

+      *listener << s2;

+    } else {

+      *listener << s1;

+      if (s2 != "") {

+        *listener << ", and " << s2;

+      }

+    }

+    return true;

+  }

+

+ private:

+  const Matcher<T> matcher1_;

+  const Matcher<T> matcher2_;

+

+  GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl);

+};

+

+#if GTEST_LANG_CXX11

+// MatcherList provides mechanisms for storing a variable number of matchers in

+// a list structure (ListType) and creating a combining matcher from such a

+// list.

+// The template is defined recursively using the following template paramters:

+//   * kSize is the length of the MatcherList.

+//   * Head is the type of the first matcher of the list.

+//   * Tail denotes the types of the remaining matchers of the list.

+template <int kSize, typename Head, typename... Tail>

+struct MatcherList {

+  typedef MatcherList<kSize - 1, Tail...> MatcherListTail;

+  typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType;

+

+  // BuildList stores variadic type values in a nested pair structure.

+  // Example:

+  // MatcherList<3, int, string, float>::BuildList(5, "foo", 2.0) will return

+  // the corresponding result of type pair<int, pair<string, float>>.

+  static ListType BuildList(const Head& matcher, const Tail&... tail) {

+    return ListType(matcher, MatcherListTail::BuildList(tail...));

+  }

+

+  // CreateMatcher<T> creates a Matcher<T> from a given list of matchers (built

+  // by BuildList()). CombiningMatcher<T> is used to combine the matchers of the

+  // list. CombiningMatcher<T> must implement MatcherInterface<T> and have a

+  // constructor taking two Matcher<T>s as input.

+  template <typename T, template <typename /* T */> class CombiningMatcher>

+  static Matcher<T> CreateMatcher(const ListType& matchers) {

+    return Matcher<T>(new CombiningMatcher<T>(

+        SafeMatcherCast<T>(matchers.first),

+        MatcherListTail::template CreateMatcher<T, CombiningMatcher>(

+            matchers.second)));

+  }

+};

+

+// The following defines the base case for the recursive definition of

+// MatcherList.

+template <typename Matcher1, typename Matcher2>

+struct MatcherList<2, Matcher1, Matcher2> {

+  typedef ::std::pair<Matcher1, Matcher2> ListType;

+

+  static ListType BuildList(const Matcher1& matcher1,

+                            const Matcher2& matcher2) {

+    return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2);

+  }

+

+  template <typename T, template <typename /* T */> class CombiningMatcher>

+  static Matcher<T> CreateMatcher(const ListType& matchers) {

+    return Matcher<T>(new CombiningMatcher<T>(

+        SafeMatcherCast<T>(matchers.first),

+        SafeMatcherCast<T>(matchers.second)));

+  }

+};

+

+// VariadicMatcher is used for the variadic implementation of

+// AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...).

+// CombiningMatcher<T> is used to recursively combine the provided matchers

+// (of type Args...).

+template <template <typename T> class CombiningMatcher, typename... Args>

+class VariadicMatcher {

+ public:

+  VariadicMatcher(const Args&... matchers)  // NOLINT

+      : matchers_(MatcherListType::BuildList(matchers...)) {}

+

+  // This template type conversion operator allows an

+  // VariadicMatcher<Matcher1, Matcher2...> object to match any type that

+  // all of the provided matchers (Matcher1, Matcher2, ...) can match.

+  template <typename T>

+  operator Matcher<T>() const {

+    return MatcherListType::template CreateMatcher<T, CombiningMatcher>(

+        matchers_);

+  }

+

+ private:

+  typedef MatcherList<sizeof...(Args), Args...> MatcherListType;

+

+  const typename MatcherListType::ListType matchers_;

+

+  GTEST_DISALLOW_ASSIGN_(VariadicMatcher);

+};

+

+template <typename... Args>

+using AllOfMatcher = VariadicMatcher<BothOfMatcherImpl, Args...>;

+

+#endif  // GTEST_LANG_CXX11

+

+// Used for implementing the AllOf(m_1, ..., m_n) matcher, which

+// matches a value that matches all of the matchers m_1, ..., and m_n.

+template <typename Matcher1, typename Matcher2>

+class BothOfMatcher {

+ public:

+  BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)

+      : matcher1_(matcher1), matcher2_(matcher2) {}

+

+  // This template type conversion operator allows a

+  // BothOfMatcher<Matcher1, Matcher2> object to match any type that

+  // both Matcher1 and Matcher2 can match.

+  template <typename T>

+  operator Matcher<T>() const {

+    return Matcher<T>(new BothOfMatcherImpl<T>(SafeMatcherCast<T>(matcher1_),

+                                               SafeMatcherCast<T>(matcher2_)));

+  }

+

+ private:

+  Matcher1 matcher1_;

+  Matcher2 matcher2_;

+

+  GTEST_DISALLOW_ASSIGN_(BothOfMatcher);

+};

+

+// Implements the AnyOf(m1, m2) matcher for a particular argument type

+// T.  We do not nest it inside the AnyOfMatcher class template, as

+// that will prevent different instantiations of AnyOfMatcher from

+// sharing the same EitherOfMatcherImpl<T> class.

+template <typename T>

+class EitherOfMatcherImpl : public MatcherInterface<T> {

+ public:

+  EitherOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)

+      : matcher1_(matcher1), matcher2_(matcher2) {}

+

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "(";

+    matcher1_.DescribeTo(os);

+    *os << ") or (";

+    matcher2_.DescribeTo(os);

+    *os << ")";

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "(";

+    matcher1_.DescribeNegationTo(os);

+    *os << ") and (";

+    matcher2_.DescribeNegationTo(os);

+    *os << ")";

+  }

+

+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {

+    // If either matcher1_ or matcher2_ matches x, we just need to

+    // explain why *one* of them matches.

+    StringMatchResultListener listener1;

+    if (matcher1_.MatchAndExplain(x, &listener1)) {

+      *listener << listener1.str();

+      return true;

+    }

+

+    StringMatchResultListener listener2;

+    if (matcher2_.MatchAndExplain(x, &listener2)) {

+      *listener << listener2.str();

+      return true;

+    }

+

+    // Otherwise we need to explain why *both* of them fail.

+    const internal::string s1 = listener1.str();

+    const internal::string s2 = listener2.str();

+

+    if (s1 == "") {

+      *listener << s2;

+    } else {

+      *listener << s1;

+      if (s2 != "") {

+        *listener << ", and " << s2;

+      }

+    }

+    return false;

+  }

+

+ private:

+  const Matcher<T> matcher1_;

+  const Matcher<T> matcher2_;

+

+  GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl);

+};

+

+#if GTEST_LANG_CXX11

+// AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...).

+template <typename... Args>

+using AnyOfMatcher = VariadicMatcher<EitherOfMatcherImpl, Args...>;

+

+#endif  // GTEST_LANG_CXX11

+

+// Used for implementing the AnyOf(m_1, ..., m_n) matcher, which

+// matches a value that matches at least one of the matchers m_1, ...,

+// and m_n.

+template <typename Matcher1, typename Matcher2>

+class EitherOfMatcher {

+ public:

+  EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)

+      : matcher1_(matcher1), matcher2_(matcher2) {}

+

+  // This template type conversion operator allows a

+  // EitherOfMatcher<Matcher1, Matcher2> object to match any type that

+  // both Matcher1 and Matcher2 can match.

+  template <typename T>

+  operator Matcher<T>() const {

+    return Matcher<T>(new EitherOfMatcherImpl<T>(

+        SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));

+  }

+

+ private:

+  Matcher1 matcher1_;

+  Matcher2 matcher2_;

+

+  GTEST_DISALLOW_ASSIGN_(EitherOfMatcher);

+};

+

+// Used for implementing Truly(pred), which turns a predicate into a

+// matcher.

+template <typename Predicate>

+class TrulyMatcher {

+ public:

+  explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}

+

+  // This method template allows Truly(pred) to be used as a matcher

+  // for type T where T is the argument type of predicate 'pred'.  The

+  // argument is passed by reference as the predicate may be

+  // interested in the address of the argument.

+  template <typename T>

+  bool MatchAndExplain(T& x,  // NOLINT

+                       MatchResultListener* /* listener */) const {

+    // Without the if-statement, MSVC sometimes warns about converting

+    // a value to bool (warning 4800).

+    //

+    // We cannot write 'return !!predicate_(x);' as that doesn't work

+    // when predicate_(x) returns a class convertible to bool but

+    // having no operator!().

+    if (predicate_(x))

+      return true;

+    return false;

+  }

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << "satisfies the given predicate";

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "doesn't satisfy the given predicate";

+  }

+

+ private:

+  Predicate predicate_;

+

+  GTEST_DISALLOW_ASSIGN_(TrulyMatcher);

+};

+

+// Used for implementing Matches(matcher), which turns a matcher into

+// a predicate.

+template <typename M>

+class MatcherAsPredicate {

+ public:

+  explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}

+

+  // This template operator() allows Matches(m) to be used as a

+  // predicate on type T where m is a matcher on type T.

+  //

+  // The argument x is passed by reference instead of by value, as

+  // some matcher may be interested in its address (e.g. as in

+  // Matches(Ref(n))(x)).

+  template <typename T>

+  bool operator()(const T& x) const {

+    // We let matcher_ commit to a particular type here instead of

+    // when the MatcherAsPredicate object was constructed.  This

+    // allows us to write Matches(m) where m is a polymorphic matcher

+    // (e.g. Eq(5)).

+    //

+    // If we write Matcher<T>(matcher_).Matches(x) here, it won't

+    // compile when matcher_ has type Matcher<const T&>; if we write

+    // Matcher<const T&>(matcher_).Matches(x) here, it won't compile

+    // when matcher_ has type Matcher<T>; if we just write

+    // matcher_.Matches(x), it won't compile when matcher_ is

+    // polymorphic, e.g. Eq(5).

+    //

+    // MatcherCast<const T&>() is necessary for making the code work

+    // in all of the above situations.

+    return MatcherCast<const T&>(matcher_).Matches(x);

+  }

+

+ private:

+  M matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(MatcherAsPredicate);

+};

+

+// For implementing ASSERT_THAT() and EXPECT_THAT().  The template

+// argument M must be a type that can be converted to a matcher.

+template <typename M>

+class PredicateFormatterFromMatcher {

+ public:

+  explicit PredicateFormatterFromMatcher(const M& m) : matcher_(m) {}

+

+  // This template () operator allows a PredicateFormatterFromMatcher

+  // object to act as a predicate-formatter suitable for using with

+  // Google Test's EXPECT_PRED_FORMAT1() macro.

+  template <typename T>

+  AssertionResult operator()(const char* value_text, const T& x) const {

+    // We convert matcher_ to a Matcher<const T&> *now* instead of

+    // when the PredicateFormatterFromMatcher object was constructed,

+    // as matcher_ may be polymorphic (e.g. NotNull()) and we won't

+    // know which type to instantiate it to until we actually see the

+    // type of x here.

+    //

+    // We write SafeMatcherCast<const T&>(matcher_) instead of

+    // Matcher<const T&>(matcher_), as the latter won't compile when

+    // matcher_ has type Matcher<T> (e.g. An<int>()).

+    // We don't write MatcherCast<const T&> either, as that allows

+    // potentially unsafe downcasting of the matcher argument.

+    const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);

+    StringMatchResultListener listener;

+    if (MatchPrintAndExplain(x, matcher, &listener))

+      return AssertionSuccess();

+

+    ::std::stringstream ss;

+    ss << "Value of: " << value_text << "\n"

+       << "Expected: ";

+    matcher.DescribeTo(&ss);

+    ss << "\n  Actual: " << listener.str();

+    return AssertionFailure() << ss.str();

+  }

+

+ private:

+  const M matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(PredicateFormatterFromMatcher);

+};

+

+// A helper function for converting a matcher to a predicate-formatter

+// without the user needing to explicitly write the type.  This is

+// used for implementing ASSERT_THAT() and EXPECT_THAT().

+template <typename M>

+inline PredicateFormatterFromMatcher<M>

+MakePredicateFormatterFromMatcher(const M& matcher) {

+  return PredicateFormatterFromMatcher<M>(matcher);

+}

+

+// Implements the polymorphic floating point equality matcher, which matches

+// two float values using ULP-based approximation or, optionally, a

+// user-specified epsilon.  The template is meant to be instantiated with

+// FloatType being either float or double.

+template <typename FloatType>

+class FloatingEqMatcher {

+ public:

+  // Constructor for FloatingEqMatcher.

+  // The matcher's input will be compared with rhs.  The matcher treats two

+  // NANs as equal if nan_eq_nan is true.  Otherwise, under IEEE standards,

+  // equality comparisons between NANs will always return false.  We specify a

+  // negative max_abs_error_ term to indicate that ULP-based approximation will

+  // be used for comparison.

+  FloatingEqMatcher(FloatType rhs, bool nan_eq_nan) :

+    rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {

+  }

+

+  // Constructor that supports a user-specified max_abs_error that will be used

+  // for comparison instead of ULP-based approximation.  The max absolute

+  // should be non-negative.

+  FloatingEqMatcher(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error) :

+    rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {

+    GTEST_CHECK_(max_abs_error >= 0)

+        << ", where max_abs_error is" << max_abs_error;

+  }

+

+  // Implements floating point equality matcher as a Matcher<T>.

+  template <typename T>

+  class Impl : public MatcherInterface<T> {

+   public:

+    Impl(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error) :

+      rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {}

+

+    virtual bool MatchAndExplain(T value,

+                                 MatchResultListener* /* listener */) const {

+      const FloatingPoint<FloatType> lhs(value), rhs(rhs_);

+

+      // Compares NaNs first, if nan_eq_nan_ is true.

+      if (lhs.is_nan() || rhs.is_nan()) {

+        if (lhs.is_nan() && rhs.is_nan()) {

+          return nan_eq_nan_;

+        }

+        // One is nan; the other is not nan.

+        return false;

+      }

+      if (HasMaxAbsError()) {

+        // We perform an equality check so that inf will match inf, regardless

+        // of error bounds.  If the result of value - rhs_ would result in

+        // overflow or if either value is inf, the default result is infinity,

+        // which should only match if max_abs_error_ is also infinity.

+        return value == rhs_ || fabs(value - rhs_) <= max_abs_error_;

+      } else {

+        return lhs.AlmostEquals(rhs);

+      }

+    }

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      // os->precision() returns the previously set precision, which we

+      // store to restore the ostream to its original configuration

+      // after outputting.

+      const ::std::streamsize old_precision = os->precision(

+          ::std::numeric_limits<FloatType>::digits10 + 2);

+      if (FloatingPoint<FloatType>(rhs_).is_nan()) {

+        if (nan_eq_nan_) {

+          *os << "is NaN";

+        } else {

+          *os << "never matches";

+        }

+      } else {

+        *os << "is approximately " << rhs_;

+        if (HasMaxAbsError()) {

+          *os << " (absolute error <= " << max_abs_error_ << ")";

+        }

+      }

+      os->precision(old_precision);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      // As before, get original precision.

+      const ::std::streamsize old_precision = os->precision(

+          ::std::numeric_limits<FloatType>::digits10 + 2);

+      if (FloatingPoint<FloatType>(rhs_).is_nan()) {

+        if (nan_eq_nan_) {

+          *os << "isn't NaN";

+        } else {

+          *os << "is anything";

+        }

+      } else {

+        *os << "isn't approximately " << rhs_;

+        if (HasMaxAbsError()) {

+          *os << " (absolute error > " << max_abs_error_ << ")";

+        }

+      }

+      // Restore original precision.

+      os->precision(old_precision);

+    }

+

+   private:

+    bool HasMaxAbsError() const {

+      return max_abs_error_ >= 0;

+    }

+

+    const FloatType rhs_;

+    const bool nan_eq_nan_;

+    // max_abs_error will be used for value comparison when >= 0.

+    const FloatType max_abs_error_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  // The following 3 type conversion operators allow FloatEq(rhs) and

+  // NanSensitiveFloatEq(rhs) to be used as a Matcher<float>, a

+  // Matcher<const float&>, or a Matcher<float&>, but nothing else.

+  // (While Google's C++ coding style doesn't allow arguments passed

+  // by non-const reference, we may see them in code not conforming to

+  // the style.  Therefore Google Mock needs to support them.)

+  operator Matcher<FloatType>() const {

+    return MakeMatcher(new Impl<FloatType>(rhs_, nan_eq_nan_, max_abs_error_));

+  }

+

+  operator Matcher<const FloatType&>() const {

+    return MakeMatcher(

+        new Impl<const FloatType&>(rhs_, nan_eq_nan_, max_abs_error_));

+  }

+

+  operator Matcher<FloatType&>() const {

+    return MakeMatcher(new Impl<FloatType&>(rhs_, nan_eq_nan_, max_abs_error_));

+  }

+

+ private:

+  const FloatType rhs_;

+  const bool nan_eq_nan_;

+  // max_abs_error will be used for value comparison when >= 0.

+  const FloatType max_abs_error_;

+

+  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);

+};

+

+// Implements the Pointee(m) matcher for matching a pointer whose

+// pointee matches matcher m.  The pointer can be either raw or smart.

+template <typename InnerMatcher>

+class PointeeMatcher {

+ public:

+  explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}

+

+  // This type conversion operator template allows Pointee(m) to be

+  // used as a matcher for any pointer type whose pointee type is

+  // compatible with the inner matcher, where type Pointer can be

+  // either a raw pointer or a smart pointer.

+  //

+  // The reason we do this instead of relying on

+  // MakePolymorphicMatcher() is that the latter is not flexible

+  // enough for implementing the DescribeTo() method of Pointee().

+  template <typename Pointer>

+  operator Matcher<Pointer>() const {

+    return MakeMatcher(new Impl<Pointer>(matcher_));

+  }

+

+ private:

+  // The monomorphic implementation that works for a particular pointer type.

+  template <typename Pointer>

+  class Impl : public MatcherInterface<Pointer> {

+   public:

+    typedef typename PointeeOf<GTEST_REMOVE_CONST_(  // NOLINT

+        GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee;

+

+    explicit Impl(const InnerMatcher& matcher)

+        : matcher_(MatcherCast<const Pointee&>(matcher)) {}

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      *os << "points to a value that ";

+      matcher_.DescribeTo(os);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      *os << "does not point to a value that ";

+      matcher_.DescribeTo(os);

+    }

+

+    virtual bool MatchAndExplain(Pointer pointer,

+                                 MatchResultListener* listener) const {

+      if (GetRawPointer(pointer) == NULL)

+        return false;

+

+      *listener << "which points to ";

+      return MatchPrintAndExplain(*pointer, matcher_, listener);

+    }

+

+   private:

+    const Matcher<const Pointee&> matcher_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+  const InnerMatcher matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(PointeeMatcher);

+};

+

+// Implements the Field() matcher for matching a field (i.e. member

+// variable) of an object.

+template <typename Class, typename FieldType>

+class FieldMatcher {

+ public:

+  FieldMatcher(FieldType Class::*field,

+               const Matcher<const FieldType&>& matcher)

+      : field_(field), matcher_(matcher) {}

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << "is an object whose given field ";

+    matcher_.DescribeTo(os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "is an object whose given field ";

+    matcher_.DescribeNegationTo(os);

+  }

+

+  template <typename T>

+  bool MatchAndExplain(const T& value, MatchResultListener* listener) const {

+    return MatchAndExplainImpl(

+        typename ::testing::internal::

+            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),

+        value, listener);

+  }

+

+ private:

+  // The first argument of MatchAndExplainImpl() is needed to help

+  // Symbian's C++ compiler choose which overload to use.  Its type is

+  // true_type iff the Field() matcher is used to match a pointer.

+  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,

+                           MatchResultListener* listener) const {

+    *listener << "whose given field is ";

+    return MatchPrintAndExplain(obj.*field_, matcher_, listener);

+  }

+

+  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,

+                           MatchResultListener* listener) const {

+    if (p == NULL)

+      return false;

+

+    *listener << "which points to an object ";

+    // Since *p has a field, it must be a class/struct/union type and

+    // thus cannot be a pointer.  Therefore we pass false_type() as

+    // the first argument.

+    return MatchAndExplainImpl(false_type(), *p, listener);

+  }

+

+  const FieldType Class::*field_;

+  const Matcher<const FieldType&> matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(FieldMatcher);

+};

+

+// Implements the Property() matcher for matching a property

+// (i.e. return value of a getter method) of an object.

+template <typename Class, typename PropertyType>

+class PropertyMatcher {

+ public:

+  // The property may have a reference type, so 'const PropertyType&'

+  // may cause double references and fail to compile.  That's why we

+  // need GTEST_REFERENCE_TO_CONST, which works regardless of

+  // PropertyType being a reference or not.

+  typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty;

+

+  PropertyMatcher(PropertyType (Class::*property)() const,

+                  const Matcher<RefToConstProperty>& matcher)

+      : property_(property), matcher_(matcher) {}

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << "is an object whose given property ";

+    matcher_.DescribeTo(os);

+  }

+

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "is an object whose given property ";

+    matcher_.DescribeNegationTo(os);

+  }

+

+  template <typename T>

+  bool MatchAndExplain(const T&value, MatchResultListener* listener) const {

+    return MatchAndExplainImpl(

+        typename ::testing::internal::

+            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),

+        value, listener);

+  }

+

+ private:

+  // The first argument of MatchAndExplainImpl() is needed to help

+  // Symbian's C++ compiler choose which overload to use.  Its type is

+  // true_type iff the Property() matcher is used to match a pointer.

+  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,

+                           MatchResultListener* listener) const {

+    *listener << "whose given property is ";

+    // Cannot pass the return value (for example, int) to MatchPrintAndExplain,

+    // which takes a non-const reference as argument.

+    RefToConstProperty result = (obj.*property_)();

+    return MatchPrintAndExplain(result, matcher_, listener);

+  }

+

+  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,

+                           MatchResultListener* listener) const {

+    if (p == NULL)

+      return false;

+

+    *listener << "which points to an object ";

+    // Since *p has a property method, it must be a class/struct/union

+    // type and thus cannot be a pointer.  Therefore we pass

+    // false_type() as the first argument.

+    return MatchAndExplainImpl(false_type(), *p, listener);

+  }

+

+  PropertyType (Class::*property_)() const;

+  const Matcher<RefToConstProperty> matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(PropertyMatcher);

+};

+

+// Type traits specifying various features of different functors for ResultOf.

+// The default template specifies features for functor objects.

+// Functor classes have to typedef argument_type and result_type

+// to be compatible with ResultOf.

+template <typename Functor>

+struct CallableTraits {

+  typedef typename Functor::result_type ResultType;

+  typedef Functor StorageType;

+

+  static void CheckIsValid(Functor /* functor */) {}

+  template <typename T>

+  static ResultType Invoke(Functor f, T arg) { return f(arg); }

+};

+

+// Specialization for function pointers.

+template <typename ArgType, typename ResType>

+struct CallableTraits<ResType(*)(ArgType)> {

+  typedef ResType ResultType;

+  typedef ResType(*StorageType)(ArgType);

+

+  static void CheckIsValid(ResType(*f)(ArgType)) {

+    GTEST_CHECK_(f != NULL)

+        << "NULL function pointer is passed into ResultOf().";

+  }

+  template <typename T>

+  static ResType Invoke(ResType(*f)(ArgType), T arg) {

+    return (*f)(arg);

+  }

+};

+

+// Implements the ResultOf() matcher for matching a return value of a

+// unary function of an object.

+template <typename Callable>

+class ResultOfMatcher {

+ public:

+  typedef typename CallableTraits<Callable>::ResultType ResultType;

+

+  ResultOfMatcher(Callable callable, const Matcher<ResultType>& matcher)

+      : callable_(callable), matcher_(matcher) {

+    CallableTraits<Callable>::CheckIsValid(callable_);

+  }

+

+  template <typename T>

+  operator Matcher<T>() const {

+    return Matcher<T>(new Impl<T>(callable_, matcher_));

+  }

+

+ private:

+  typedef typename CallableTraits<Callable>::StorageType CallableStorageType;

+

+  template <typename T>

+  class Impl : public MatcherInterface<T> {

+   public:

+    Impl(CallableStorageType callable, const Matcher<ResultType>& matcher)

+        : callable_(callable), matcher_(matcher) {}

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      *os << "is mapped by the given callable to a value that ";

+      matcher_.DescribeTo(os);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      *os << "is mapped by the given callable to a value that ";

+      matcher_.DescribeNegationTo(os);

+    }

+

+    virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const {

+      *listener << "which is mapped by the given callable to ";

+      // Cannot pass the return value (for example, int) to

+      // MatchPrintAndExplain, which takes a non-const reference as argument.

+      ResultType result =

+          CallableTraits<Callable>::template Invoke<T>(callable_, obj);

+      return MatchPrintAndExplain(result, matcher_, listener);

+    }

+

+   private:

+    // Functors often define operator() as non-const method even though

+    // they are actualy stateless. But we need to use them even when

+    // 'this' is a const pointer. It's the user's responsibility not to

+    // use stateful callables with ResultOf(), which does't guarantee

+    // how many times the callable will be invoked.

+    mutable CallableStorageType callable_;

+    const Matcher<ResultType> matcher_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };  // class Impl

+

+  const CallableStorageType callable_;

+  const Matcher<ResultType> matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(ResultOfMatcher);

+};

+

+// Implements a matcher that checks the size of an STL-style container.

+template <typename SizeMatcher>

+class SizeIsMatcher {

+ public:

+  explicit SizeIsMatcher(const SizeMatcher& size_matcher)

+       : size_matcher_(size_matcher) {

+  }

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    return MakeMatcher(new Impl<Container>(size_matcher_));

+  }

+

+  template <typename Container>

+  class Impl : public MatcherInterface<Container> {

+   public:

+    typedef internal::StlContainerView<

+         GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;

+    typedef typename ContainerView::type::size_type SizeType;

+    explicit Impl(const SizeMatcher& size_matcher)

+        : size_matcher_(MatcherCast<SizeType>(size_matcher)) {}

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      *os << "size ";

+      size_matcher_.DescribeTo(os);

+    }

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      *os << "size ";

+      size_matcher_.DescribeNegationTo(os);

+    }

+

+    virtual bool MatchAndExplain(Container container,

+                                 MatchResultListener* listener) const {

+      SizeType size = container.size();

+      StringMatchResultListener size_listener;

+      const bool result = size_matcher_.MatchAndExplain(size, &size_listener);

+      *listener

+          << "whose size " << size << (result ? " matches" : " doesn't match");

+      PrintIfNotEmpty(size_listener.str(), listener->stream());

+      return result;

+    }

+

+   private:

+    const Matcher<SizeType> size_matcher_;

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+ private:

+  const SizeMatcher size_matcher_;

+  GTEST_DISALLOW_ASSIGN_(SizeIsMatcher);

+};

+

+// Implements an equality matcher for any STL-style container whose elements

+// support ==. This matcher is like Eq(), but its failure explanations provide

+// more detailed information that is useful when the container is used as a set.

+// The failure message reports elements that are in one of the operands but not

+// the other. The failure messages do not report duplicate or out-of-order

+// elements in the containers (which don't properly matter to sets, but can

+// occur if the containers are vectors or lists, for example).

+//

+// Uses the container's const_iterator, value_type, operator ==,

+// begin(), and end().

+template <typename Container>

+class ContainerEqMatcher {

+ public:

+  typedef internal::StlContainerView<Container> View;

+  typedef typename View::type StlContainer;

+  typedef typename View::const_reference StlContainerReference;

+

+  // We make a copy of rhs in case the elements in it are modified

+  // after this matcher is created.

+  explicit ContainerEqMatcher(const Container& rhs) : rhs_(View::Copy(rhs)) {

+    // Makes sure the user doesn't instantiate this class template

+    // with a const or reference type.

+    (void)testing::StaticAssertTypeEq<Container,

+        GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();

+  }

+

+  void DescribeTo(::std::ostream* os) const {

+    *os << "equals ";

+    UniversalPrint(rhs_, os);

+  }

+  void DescribeNegationTo(::std::ostream* os) const {

+    *os << "does not equal ";

+    UniversalPrint(rhs_, os);

+  }

+

+  template <typename LhsContainer>

+  bool MatchAndExplain(const LhsContainer& lhs,

+                       MatchResultListener* listener) const {

+    // GTEST_REMOVE_CONST_() is needed to work around an MSVC 8.0 bug

+    // that causes LhsContainer to be a const type sometimes.

+    typedef internal::StlContainerView<GTEST_REMOVE_CONST_(LhsContainer)>

+        LhsView;

+    typedef typename LhsView::type LhsStlContainer;

+    StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);

+    if (lhs_stl_container == rhs_)

+      return true;

+

+    ::std::ostream* const os = listener->stream();

+    if (os != NULL) {

+      // Something is different. Check for extra values first.

+      bool printed_header = false;

+      for (typename LhsStlContainer::const_iterator it =

+               lhs_stl_container.begin();

+           it != lhs_stl_container.end(); ++it) {

+        if (internal::ArrayAwareFind(rhs_.begin(), rhs_.end(), *it) ==

+            rhs_.end()) {

+          if (printed_header) {

+            *os << ", ";

+          } else {

+            *os << "which has these unexpected elements: ";

+            printed_header = true;

+          }

+          UniversalPrint(*it, os);

+        }

+      }

+

+      // Now check for missing values.

+      bool printed_header2 = false;

+      for (typename StlContainer::const_iterator it = rhs_.begin();

+           it != rhs_.end(); ++it) {

+        if (internal::ArrayAwareFind(

+                lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==

+            lhs_stl_container.end()) {

+          if (printed_header2) {

+            *os << ", ";

+          } else {

+            *os << (printed_header ? ",\nand" : "which")

+                << " doesn't have these expected elements: ";

+            printed_header2 = true;

+          }

+          UniversalPrint(*it, os);

+        }

+      }

+    }

+

+    return false;

+  }

+

+ private:

+  const StlContainer rhs_;

+

+  GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher);

+};

+

+// A comparator functor that uses the < operator to compare two values.

+struct LessComparator {

+  template <typename T, typename U>

+  bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; }

+};

+

+// Implements WhenSortedBy(comparator, container_matcher).

+template <typename Comparator, typename ContainerMatcher>

+class WhenSortedByMatcher {

+ public:

+  WhenSortedByMatcher(const Comparator& comparator,

+                      const ContainerMatcher& matcher)

+      : comparator_(comparator), matcher_(matcher) {}

+

+  template <typename LhsContainer>

+  operator Matcher<LhsContainer>() const {

+    return MakeMatcher(new Impl<LhsContainer>(comparator_, matcher_));

+  }

+

+  template <typename LhsContainer>

+  class Impl : public MatcherInterface<LhsContainer> {

+   public:

+    typedef internal::StlContainerView<

+         GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;

+    typedef typename LhsView::type LhsStlContainer;

+    typedef typename LhsView::const_reference LhsStlContainerReference;

+    // Transforms std::pair<const Key, Value> into std::pair<Key, Value>

+    // so that we can match associative containers.

+    typedef typename RemoveConstFromKey<

+        typename LhsStlContainer::value_type>::type LhsValue;

+

+    Impl(const Comparator& comparator, const ContainerMatcher& matcher)

+        : comparator_(comparator), matcher_(matcher) {}

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      *os << "(when sorted) ";

+      matcher_.DescribeTo(os);

+    }

+

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      *os << "(when sorted) ";

+      matcher_.DescribeNegationTo(os);

+    }

+

+    virtual bool MatchAndExplain(LhsContainer lhs,

+                                 MatchResultListener* listener) const {

+      LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);

+      ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),

+                                               lhs_stl_container.end());

+      ::std::sort(

+           sorted_container.begin(), sorted_container.end(), comparator_);

+

+      if (!listener->IsInterested()) {

+        // If the listener is not interested, we do not need to

+        // construct the inner explanation.

+        return matcher_.Matches(sorted_container);

+      }

+

+      *listener << "which is ";

+      UniversalPrint(sorted_container, listener->stream());

+      *listener << " when sorted";

+

+      StringMatchResultListener inner_listener;

+      const bool match = matcher_.MatchAndExplain(sorted_container,

+                                                  &inner_listener);

+      PrintIfNotEmpty(inner_listener.str(), listener->stream());

+      return match;

+    }

+

+   private:

+    const Comparator comparator_;

+    const Matcher<const ::std::vector<LhsValue>&> matcher_;

+

+    GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);

+  };

+

+ private:

+  const Comparator comparator_;

+  const ContainerMatcher matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher);

+};

+

+// Implements Pointwise(tuple_matcher, rhs_container).  tuple_matcher

+// must be able to be safely cast to Matcher<tuple<const T1&, const

+// T2&> >, where T1 and T2 are the types of elements in the LHS

+// container and the RHS container respectively.

+template <typename TupleMatcher, typename RhsContainer>

+class PointwiseMatcher {

+ public:

+  typedef internal::StlContainerView<RhsContainer> RhsView;

+  typedef typename RhsView::type RhsStlContainer;

+  typedef typename RhsStlContainer::value_type RhsValue;

+

+  // Like ContainerEq, we make a copy of rhs in case the elements in

+  // it are modified after this matcher is created.

+  PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs)

+      : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {

+    // Makes sure the user doesn't instantiate this class template

+    // with a const or reference type.

+    (void)testing::StaticAssertTypeEq<RhsContainer,

+        GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>();

+  }

+

+  template <typename LhsContainer>

+  operator Matcher<LhsContainer>() const {

+    return MakeMatcher(new Impl<LhsContainer>(tuple_matcher_, rhs_));

+  }

+

+  template <typename LhsContainer>

+  class Impl : public MatcherInterface<LhsContainer> {

+   public:

+    typedef internal::StlContainerView<

+         GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;

+    typedef typename LhsView::type LhsStlContainer;

+    typedef typename LhsView::const_reference LhsStlContainerReference;

+    typedef typename LhsStlContainer::value_type LhsValue;

+    // We pass the LHS value and the RHS value to the inner matcher by

+    // reference, as they may be expensive to copy.  We must use tuple

+    // instead of pair here, as a pair cannot hold references (C++ 98,

+    // 20.2.2 [lib.pairs]).

+    typedef ::std::tr1::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;

+

+    Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)

+        // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.

+        : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),

+          rhs_(rhs) {}

+

+    virtual void DescribeTo(::std::ostream* os) const {

+      *os << "contains " << rhs_.size()

+          << " values, where each value and its corresponding value in ";

+      UniversalPrinter<RhsStlContainer>::Print(rhs_, os);

+      *os << " ";

+      mono_tuple_matcher_.DescribeTo(os);

+    }

+    virtual void DescribeNegationTo(::std::ostream* os) const {

+      *os << "doesn't contain exactly " << rhs_.size()

+          << " values, or contains a value x at some index i"

+          << " where x and the i-th value of ";

+      UniversalPrint(rhs_, os);

+      *os << " ";

+      mono_tuple_matcher_.DescribeNegationTo(os);

+    }

+

+    virtual bool MatchAndExplain(LhsContainer lhs,

+                                 MatchResultListener* listener) const {

+      LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);

+      const size_t actual_size = lhs_stl_container.size();

+      if (actual_size != rhs_.size()) {

+        *listener << "which contains " << actual_size << " values";

+        return false;

+      }

+

+      typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();

+      typename RhsStlContainer::const_iterator right = rhs_.begin();

+      for (size_t i = 0; i != actual_size; ++i, ++left, ++right) {

+        const InnerMatcherArg value_pair(*left, *right);

+

+        if (listener->IsInterested()) {

+          StringMatchResultListener inner_listener;

+          if (!mono_tuple_matcher_.MatchAndExplain(

+                  value_pair, &inner_listener)) {

+            *listener << "where the value pair (";

+            UniversalPrint(*left, listener->stream());

+            *listener << ", ";

+            UniversalPrint(*right, listener->stream());

+            *listener << ") at index #" << i << " don't match";

+            PrintIfNotEmpty(inner_listener.str(), listener->stream());

+            return false;

+          }

+        } else {

+          if (!mono_tuple_matcher_.Matches(value_pair))

+            return false;

+        }

+      }

+

+      return true;

+    }

+

+   private:

+    const Matcher<InnerMatcherArg> mono_tuple_matcher_;

+    const RhsStlContainer rhs_;

+

+    GTEST_DISALLOW_ASSIGN_(Impl);

+  };

+

+ private:

+  const TupleMatcher tuple_matcher_;

+  const RhsStlContainer rhs_;

+

+  GTEST_DISALLOW_ASSIGN_(PointwiseMatcher);

+};

+

+// Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.

+template <typename Container>

+class QuantifierMatcherImpl : public MatcherInterface<Container> {

+ public:

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;

+  typedef StlContainerView<RawContainer> View;

+  typedef typename View::type StlContainer;

+  typedef typename View::const_reference StlContainerReference;

+  typedef typename StlContainer::value_type Element;

+

+  template <typename InnerMatcher>

+  explicit QuantifierMatcherImpl(InnerMatcher inner_matcher)

+      : inner_matcher_(

+           testing::SafeMatcherCast<const Element&>(inner_matcher)) {}

+

+  // Checks whether:

+  // * All elements in the container match, if all_elements_should_match.

+  // * Any element in the container matches, if !all_elements_should_match.

+  bool MatchAndExplainImpl(bool all_elements_should_match,

+                           Container container,

+                           MatchResultListener* listener) const {

+    StlContainerReference stl_container = View::ConstReference(container);

+    size_t i = 0;

+    for (typename StlContainer::const_iterator it = stl_container.begin();

+         it != stl_container.end(); ++it, ++i) {

+      StringMatchResultListener inner_listener;

+      const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);

+

+      if (matches != all_elements_should_match) {

+        *listener << "whose element #" << i

+                  << (matches ? " matches" : " doesn't match");

+        PrintIfNotEmpty(inner_listener.str(), listener->stream());

+        return !all_elements_should_match;

+      }

+    }

+    return all_elements_should_match;

+  }

+

+ protected:

+  const Matcher<const Element&> inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl);

+};

+

+// Implements Contains(element_matcher) for the given argument type Container.

+// Symmetric to EachMatcherImpl.

+template <typename Container>

+class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {

+ public:

+  template <typename InnerMatcher>

+  explicit ContainsMatcherImpl(InnerMatcher inner_matcher)

+      : QuantifierMatcherImpl<Container>(inner_matcher) {}

+

+  // Describes what this matcher does.

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "contains at least one element that ";

+    this->inner_matcher_.DescribeTo(os);

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "doesn't contain any element that ";

+    this->inner_matcher_.DescribeTo(os);

+  }

+

+  virtual bool MatchAndExplain(Container container,

+                               MatchResultListener* listener) const {

+    return this->MatchAndExplainImpl(false, container, listener);

+  }

+

+ private:

+  GTEST_DISALLOW_ASSIGN_(ContainsMatcherImpl);

+};

+

+// Implements Each(element_matcher) for the given argument type Container.

+// Symmetric to ContainsMatcherImpl.

+template <typename Container>

+class EachMatcherImpl : public QuantifierMatcherImpl<Container> {

+ public:

+  template <typename InnerMatcher>

+  explicit EachMatcherImpl(InnerMatcher inner_matcher)

+      : QuantifierMatcherImpl<Container>(inner_matcher) {}

+

+  // Describes what this matcher does.

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "only contains elements that ";

+    this->inner_matcher_.DescribeTo(os);

+  }

+

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "contains some element that ";

+    this->inner_matcher_.DescribeNegationTo(os);

+  }

+

+  virtual bool MatchAndExplain(Container container,

+                               MatchResultListener* listener) const {

+    return this->MatchAndExplainImpl(true, container, listener);

+  }

+

+ private:

+  GTEST_DISALLOW_ASSIGN_(EachMatcherImpl);

+};

+

+// Implements polymorphic Contains(element_matcher).

+template <typename M>

+class ContainsMatcher {

+ public:

+  explicit ContainsMatcher(M m) : inner_matcher_(m) {}

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    return MakeMatcher(new ContainsMatcherImpl<Container>(inner_matcher_));

+  }

+

+ private:

+  const M inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(ContainsMatcher);

+};

+

+// Implements polymorphic Each(element_matcher).

+template <typename M>

+class EachMatcher {

+ public:

+  explicit EachMatcher(M m) : inner_matcher_(m) {}

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    return MakeMatcher(new EachMatcherImpl<Container>(inner_matcher_));

+  }

+

+ private:

+  const M inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(EachMatcher);

+};

+

+// Implements Key(inner_matcher) for the given argument pair type.

+// Key(inner_matcher) matches an std::pair whose 'first' field matches

+// inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an

+// std::map that contains at least one element whose key is >= 5.

+template <typename PairType>

+class KeyMatcherImpl : public MatcherInterface<PairType> {

+ public:

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;

+  typedef typename RawPairType::first_type KeyType;

+

+  template <typename InnerMatcher>

+  explicit KeyMatcherImpl(InnerMatcher inner_matcher)

+      : inner_matcher_(

+          testing::SafeMatcherCast<const KeyType&>(inner_matcher)) {

+  }

+

+  // Returns true iff 'key_value.first' (the key) matches the inner matcher.

+  virtual bool MatchAndExplain(PairType key_value,

+                               MatchResultListener* listener) const {

+    StringMatchResultListener inner_listener;

+    const bool match = inner_matcher_.MatchAndExplain(key_value.first,

+                                                      &inner_listener);

+    const internal::string explanation = inner_listener.str();

+    if (explanation != "") {

+      *listener << "whose first field is a value " << explanation;

+    }

+    return match;

+  }

+

+  // Describes what this matcher does.

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "has a key that ";

+    inner_matcher_.DescribeTo(os);

+  }

+

+  // Describes what the negation of this matcher does.

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "doesn't have a key that ";

+    inner_matcher_.DescribeTo(os);

+  }

+

+ private:

+  const Matcher<const KeyType&> inner_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(KeyMatcherImpl);

+};

+

+// Implements polymorphic Key(matcher_for_key).

+template <typename M>

+class KeyMatcher {

+ public:

+  explicit KeyMatcher(M m) : matcher_for_key_(m) {}

+

+  template <typename PairType>

+  operator Matcher<PairType>() const {

+    return MakeMatcher(new KeyMatcherImpl<PairType>(matcher_for_key_));

+  }

+

+ private:

+  const M matcher_for_key_;

+

+  GTEST_DISALLOW_ASSIGN_(KeyMatcher);

+};

+

+// Implements Pair(first_matcher, second_matcher) for the given argument pair

+// type with its two matchers. See Pair() function below.

+template <typename PairType>

+class PairMatcherImpl : public MatcherInterface<PairType> {

+ public:

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;

+  typedef typename RawPairType::first_type FirstType;

+  typedef typename RawPairType::second_type SecondType;

+

+  template <typename FirstMatcher, typename SecondMatcher>

+  PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)

+      : first_matcher_(

+            testing::SafeMatcherCast<const FirstType&>(first_matcher)),

+        second_matcher_(

+            testing::SafeMatcherCast<const SecondType&>(second_matcher)) {

+  }

+

+  // Describes what this matcher does.

+  virtual void DescribeTo(::std::ostream* os) const {

+    *os << "has a first field that ";

+    first_matcher_.DescribeTo(os);

+    *os << ", and has a second field that ";

+    second_matcher_.DescribeTo(os);

+  }

+

+  // Describes what the negation of this matcher does.

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    *os << "has a first field that ";

+    first_matcher_.DescribeNegationTo(os);

+    *os << ", or has a second field that ";

+    second_matcher_.DescribeNegationTo(os);

+  }

+

+  // Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second'

+  // matches second_matcher.

+  virtual bool MatchAndExplain(PairType a_pair,

+                               MatchResultListener* listener) const {

+    if (!listener->IsInterested()) {

+      // If the listener is not interested, we don't need to construct the

+      // explanation.

+      return first_matcher_.Matches(a_pair.first) &&

+             second_matcher_.Matches(a_pair.second);

+    }

+    StringMatchResultListener first_inner_listener;

+    if (!first_matcher_.MatchAndExplain(a_pair.first,

+                                        &first_inner_listener)) {

+      *listener << "whose first field does not match";

+      PrintIfNotEmpty(first_inner_listener.str(), listener->stream());

+      return false;

+    }

+    StringMatchResultListener second_inner_listener;

+    if (!second_matcher_.MatchAndExplain(a_pair.second,

+                                         &second_inner_listener)) {

+      *listener << "whose second field does not match";

+      PrintIfNotEmpty(second_inner_listener.str(), listener->stream());

+      return false;

+    }

+    ExplainSuccess(first_inner_listener.str(), second_inner_listener.str(),

+                   listener);

+    return true;

+  }

+

+ private:

+  void ExplainSuccess(const internal::string& first_explanation,

+                      const internal::string& second_explanation,

+                      MatchResultListener* listener) const {

+    *listener << "whose both fields match";

+    if (first_explanation != "") {

+      *listener << ", where the first field is a value " << first_explanation;

+    }

+    if (second_explanation != "") {

+      *listener << ", ";

+      if (first_explanation != "") {

+        *listener << "and ";

+      } else {

+        *listener << "where ";

+      }

+      *listener << "the second field is a value " << second_explanation;

+    }

+  }

+

+  const Matcher<const FirstType&> first_matcher_;

+  const Matcher<const SecondType&> second_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(PairMatcherImpl);

+};

+

+// Implements polymorphic Pair(first_matcher, second_matcher).

+template <typename FirstMatcher, typename SecondMatcher>

+class PairMatcher {

+ public:

+  PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)

+      : first_matcher_(first_matcher), second_matcher_(second_matcher) {}

+

+  template <typename PairType>

+  operator Matcher<PairType> () const {

+    return MakeMatcher(

+        new PairMatcherImpl<PairType>(

+            first_matcher_, second_matcher_));

+  }

+

+ private:

+  const FirstMatcher first_matcher_;

+  const SecondMatcher second_matcher_;

+

+  GTEST_DISALLOW_ASSIGN_(PairMatcher);

+};

+

+// Implements ElementsAre() and ElementsAreArray().

+template <typename Container>

+class ElementsAreMatcherImpl : public MatcherInterface<Container> {

+ public:

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;

+  typedef internal::StlContainerView<RawContainer> View;

+  typedef typename View::type StlContainer;

+  typedef typename View::const_reference StlContainerReference;

+  typedef typename StlContainer::value_type Element;

+

+  // Constructs the matcher from a sequence of element values or

+  // element matchers.

+  template <typename InputIter>

+  ElementsAreMatcherImpl(InputIter first, InputIter last) {

+    while (first != last) {

+      matchers_.push_back(MatcherCast<const Element&>(*first++));

+    }

+  }

+

+  // Describes what this matcher does.

+  virtual void DescribeTo(::std::ostream* os) const {

+    if (count() == 0) {

+      *os << "is empty";

+    } else if (count() == 1) {

+      *os << "has 1 element that ";

+      matchers_[0].DescribeTo(os);

+    } else {

+      *os << "has " << Elements(count()) << " where\n";

+      for (size_t i = 0; i != count(); ++i) {

+        *os << "element #" << i << " ";

+        matchers_[i].DescribeTo(os);

+        if (i + 1 < count()) {

+          *os << ",\n";

+        }

+      }

+    }

+  }

+

+  // Describes what the negation of this matcher does.

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    if (count() == 0) {

+      *os << "isn't empty";

+      return;

+    }

+

+    *os << "doesn't have " << Elements(count()) << ", or\n";

+    for (size_t i = 0; i != count(); ++i) {

+      *os << "element #" << i << " ";

+      matchers_[i].DescribeNegationTo(os);

+      if (i + 1 < count()) {

+        *os << ", or\n";

+      }

+    }

+  }

+

+  virtual bool MatchAndExplain(Container container,

+                               MatchResultListener* listener) const {

+    // To work with stream-like "containers", we must only walk

+    // through the elements in one pass.

+

+    const bool listener_interested = listener->IsInterested();

+

+    // explanations[i] is the explanation of the element at index i.

+    ::std::vector<internal::string> explanations(count());

+    StlContainerReference stl_container = View::ConstReference(container);

+    typename StlContainer::const_iterator it = stl_container.begin();

+    size_t exam_pos = 0;

+    bool mismatch_found = false;  // Have we found a mismatched element yet?

+

+    // Go through the elements and matchers in pairs, until we reach

+    // the end of either the elements or the matchers, or until we find a

+    // mismatch.

+    for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {

+      bool match;  // Does the current element match the current matcher?

+      if (listener_interested) {

+        StringMatchResultListener s;

+        match = matchers_[exam_pos].MatchAndExplain(*it, &s);

+        explanations[exam_pos] = s.str();

+      } else {

+        match = matchers_[exam_pos].Matches(*it);

+      }

+

+      if (!match) {

+        mismatch_found = true;

+        break;

+      }

+    }

+    // If mismatch_found is true, 'exam_pos' is the index of the mismatch.

+

+    // Find how many elements the actual container has.  We avoid

+    // calling size() s.t. this code works for stream-like "containers"

+    // that don't define size().

+    size_t actual_count = exam_pos;

+    for (; it != stl_container.end(); ++it) {

+      ++actual_count;

+    }

+

+    if (actual_count != count()) {

+      // The element count doesn't match.  If the container is empty,

+      // there's no need to explain anything as Google Mock already

+      // prints the empty container.  Otherwise we just need to show

+      // how many elements there actually are.

+      if (listener_interested && (actual_count != 0)) {

+        *listener << "which has " << Elements(actual_count);

+      }

+      return false;

+    }

+

+    if (mismatch_found) {

+      // The element count matches, but the exam_pos-th element doesn't match.

+      if (listener_interested) {

+        *listener << "whose element #" << exam_pos << " doesn't match";

+        PrintIfNotEmpty(explanations[exam_pos], listener->stream());

+      }

+      return false;

+    }

+

+    // Every element matches its expectation.  We need to explain why

+    // (the obvious ones can be skipped).

+    if (listener_interested) {

+      bool reason_printed = false;

+      for (size_t i = 0; i != count(); ++i) {

+        const internal::string& s = explanations[i];

+        if (!s.empty()) {

+          if (reason_printed) {

+            *listener << ",\nand ";

+          }

+          *listener << "whose element #" << i << " matches, " << s;

+          reason_printed = true;

+        }

+      }

+    }

+    return true;

+  }

+

+ private:

+  static Message Elements(size_t count) {

+    return Message() << count << (count == 1 ? " element" : " elements");

+  }

+

+  size_t count() const { return matchers_.size(); }

+

+  ::std::vector<Matcher<const Element&> > matchers_;

+

+  GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl);

+};

+

+// Connectivity matrix of (elements X matchers), in element-major order.

+// Initially, there are no edges.

+// Use NextGraph() to iterate over all possible edge configurations.

+// Use Randomize() to generate a random edge configuration.

+class GTEST_API_ MatchMatrix {

+ public:

+  MatchMatrix(size_t num_elements, size_t num_matchers)

+      : num_elements_(num_elements),

+        num_matchers_(num_matchers),

+        matched_(num_elements_* num_matchers_, 0) {

+  }

+

+  size_t LhsSize() const { return num_elements_; }

+  size_t RhsSize() const { return num_matchers_; }

+  bool HasEdge(size_t ilhs, size_t irhs) const {

+    return matched_[SpaceIndex(ilhs, irhs)] == 1;

+  }

+  void SetEdge(size_t ilhs, size_t irhs, bool b) {

+    matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;

+  }

+

+  // Treating the connectivity matrix as a (LhsSize()*RhsSize())-bit number,

+  // adds 1 to that number; returns false if incrementing the graph left it

+  // empty.

+  bool NextGraph();

+

+  void Randomize();

+

+  string DebugString() const;

+

+ private:

+  size_t SpaceIndex(size_t ilhs, size_t irhs) const {

+    return ilhs * num_matchers_ + irhs;

+  }

+

+  size_t num_elements_;

+  size_t num_matchers_;

+

+  // Each element is a char interpreted as bool. They are stored as a

+  // flattened array in lhs-major order, use 'SpaceIndex()' to translate

+  // a (ilhs, irhs) matrix coordinate into an offset.

+  ::std::vector<char> matched_;

+};

+

+typedef ::std::pair<size_t, size_t> ElementMatcherPair;

+typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs;

+

+// Returns a maximum bipartite matching for the specified graph 'g'.

+// The matching is represented as a vector of {element, matcher} pairs.

+GTEST_API_ ElementMatcherPairs

+FindMaxBipartiteMatching(const MatchMatrix& g);

+

+GTEST_API_ bool FindPairing(const MatchMatrix& matrix,

+                            MatchResultListener* listener);

+

+// Untyped base class for implementing UnorderedElementsAre.  By

+// putting logic that's not specific to the element type here, we

+// reduce binary bloat and increase compilation speed.

+class GTEST_API_ UnorderedElementsAreMatcherImplBase {

+ protected:

+  // A vector of matcher describers, one for each element matcher.

+  // Does not own the describers (and thus can be used only when the

+  // element matchers are alive).

+  typedef ::std::vector<const MatcherDescriberInterface*> MatcherDescriberVec;

+

+  // Describes this UnorderedElementsAre matcher.

+  void DescribeToImpl(::std::ostream* os) const;

+

+  // Describes the negation of this UnorderedElementsAre matcher.

+  void DescribeNegationToImpl(::std::ostream* os) const;

+

+  bool VerifyAllElementsAndMatchersAreMatched(

+      const ::std::vector<string>& element_printouts,

+      const MatchMatrix& matrix,

+      MatchResultListener* listener) const;

+

+  MatcherDescriberVec& matcher_describers() {

+    return matcher_describers_;

+  }

+

+  static Message Elements(size_t n) {

+    return Message() << n << " element" << (n == 1 ? "" : "s");

+  }

+

+ private:

+  MatcherDescriberVec matcher_describers_;

+

+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImplBase);

+};

+

+// Implements unordered ElementsAre and unordered ElementsAreArray.

+template <typename Container>

+class UnorderedElementsAreMatcherImpl

+    : public MatcherInterface<Container>,

+      public UnorderedElementsAreMatcherImplBase {

+ public:

+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;

+  typedef internal::StlContainerView<RawContainer> View;

+  typedef typename View::type StlContainer;

+  typedef typename View::const_reference StlContainerReference;

+  typedef typename StlContainer::const_iterator StlContainerConstIterator;

+  typedef typename StlContainer::value_type Element;

+

+  // Constructs the matcher from a sequence of element values or

+  // element matchers.

+  template <typename InputIter>

+  UnorderedElementsAreMatcherImpl(InputIter first, InputIter last) {

+    for (; first != last; ++first) {

+      matchers_.push_back(MatcherCast<const Element&>(*first));

+      matcher_describers().push_back(matchers_.back().GetDescriber());

+    }

+  }

+

+  // Describes what this matcher does.

+  virtual void DescribeTo(::std::ostream* os) const {

+    return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os);

+  }

+

+  // Describes what the negation of this matcher does.

+  virtual void DescribeNegationTo(::std::ostream* os) const {

+    return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os);

+  }

+

+  virtual bool MatchAndExplain(Container container,

+                               MatchResultListener* listener) const {

+    StlContainerReference stl_container = View::ConstReference(container);

+    ::std::vector<string> element_printouts;

+    MatchMatrix matrix = AnalyzeElements(stl_container.begin(),

+                                         stl_container.end(),

+                                         &element_printouts,

+                                         listener);

+

+    const size_t actual_count = matrix.LhsSize();

+    if (actual_count == 0 && matchers_.empty()) {

+      return true;

+    }

+    if (actual_count != matchers_.size()) {

+      // The element count doesn't match.  If the container is empty,

+      // there's no need to explain anything as Google Mock already

+      // prints the empty container. Otherwise we just need to show

+      // how many elements there actually are.

+      if (actual_count != 0 && listener->IsInterested()) {

+        *listener << "which has " << Elements(actual_count);

+      }

+      return false;

+    }

+

+    return VerifyAllElementsAndMatchersAreMatched(element_printouts,

+                                                  matrix, listener) &&

+           FindPairing(matrix, listener);

+  }

+

+ private:

+  typedef ::std::vector<Matcher<const Element&> > MatcherVec;

+

+  template <typename ElementIter>

+  MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last,

+                              ::std::vector<string>* element_printouts,

+                              MatchResultListener* listener) const {

+    element_printouts->clear();

+    ::std::vector<char> did_match;

+    size_t num_elements = 0;

+    for (; elem_first != elem_last; ++num_elements, ++elem_first) {

+      if (listener->IsInterested()) {

+        element_printouts->push_back(PrintToString(*elem_first));

+      }

+      for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {

+        did_match.push_back(Matches(matchers_[irhs])(*elem_first));

+      }

+    }

+

+    MatchMatrix matrix(num_elements, matchers_.size());

+    ::std::vector<char>::const_iterator did_match_iter = did_match.begin();

+    for (size_t ilhs = 0; ilhs != num_elements; ++ilhs) {

+      for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {

+        matrix.SetEdge(ilhs, irhs, *did_match_iter++ != 0);

+      }

+    }

+    return matrix;

+  }

+

+  MatcherVec matchers_;

+

+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImpl);

+};

+

+// Functor for use in TransformTuple.

+// Performs MatcherCast<Target> on an input argument of any type.

+template <typename Target>

+struct CastAndAppendTransform {

+  template <typename Arg>

+  Matcher<Target> operator()(const Arg& a) const {

+    return MatcherCast<Target>(a);

+  }

+};

+

+// Implements UnorderedElementsAre.

+template <typename MatcherTuple>

+class UnorderedElementsAreMatcher {

+ public:

+  explicit UnorderedElementsAreMatcher(const MatcherTuple& args)

+      : matchers_(args) {}

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;

+    typedef typename internal::StlContainerView<RawContainer>::type View;

+    typedef typename View::value_type Element;

+    typedef ::std::vector<Matcher<const Element&> > MatcherVec;

+    MatcherVec matchers;

+    matchers.reserve(::std::tr1::tuple_size<MatcherTuple>::value);

+    TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,

+                         ::std::back_inserter(matchers));

+    return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(

+                           matchers.begin(), matchers.end()));

+  }

+

+ private:

+  const MatcherTuple matchers_;

+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcher);

+};

+

+// Implements ElementsAre.

+template <typename MatcherTuple>

+class ElementsAreMatcher {

+ public:

+  explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {}

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;

+    typedef typename internal::StlContainerView<RawContainer>::type View;

+    typedef typename View::value_type Element;

+    typedef ::std::vector<Matcher<const Element&> > MatcherVec;

+    MatcherVec matchers;

+    matchers.reserve(::std::tr1::tuple_size<MatcherTuple>::value);

+    TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,

+                         ::std::back_inserter(matchers));

+    return MakeMatcher(new ElementsAreMatcherImpl<Container>(

+                           matchers.begin(), matchers.end()));

+  }

+

+ private:

+  const MatcherTuple matchers_;

+  GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher);

+};

+

+// Implements UnorderedElementsAreArray().

+template <typename T>

+class UnorderedElementsAreArrayMatcher {

+ public:

+  UnorderedElementsAreArrayMatcher() {}

+

+  template <typename Iter>

+  UnorderedElementsAreArrayMatcher(Iter first, Iter last)

+      : matchers_(first, last) {}

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    return MakeMatcher(

+        new UnorderedElementsAreMatcherImpl<Container>(matchers_.begin(),

+                                                       matchers_.end()));

+  }

+

+ private:

+  ::std::vector<T> matchers_;

+

+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreArrayMatcher);

+};

+

+// Implements ElementsAreArray().

+template <typename T>

+class ElementsAreArrayMatcher {

+ public:

+  template <typename Iter>

+  ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}

+

+  template <typename Container>

+  operator Matcher<Container>() const {

+    return MakeMatcher(new ElementsAreMatcherImpl<Container>(

+        matchers_.begin(), matchers_.end()));

+  }

+

+ private:

+  const ::std::vector<T> matchers_;

+

+  GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher);

+};

+

+// Returns the description for a matcher defined using the MATCHER*()

+// macro where the user-supplied description string is "", if

+// 'negation' is false; otherwise returns the description of the

+// negation of the matcher.  'param_values' contains a list of strings

+// that are the print-out of the matcher's parameters.

+GTEST_API_ string FormatMatcherDescription(bool negation,

+                                           const char* matcher_name,

+                                           const Strings& param_values);

+

+}  // namespace internal

+

+// ElementsAreArray(first, last)

+// ElementsAreArray(pointer, count)

+// ElementsAreArray(array)

+// ElementsAreArray(vector)

+// ElementsAreArray({ e1, e2, ..., en })

+//

+// The ElementsAreArray() functions are like ElementsAre(...), except

+// that they are given a homogeneous sequence rather than taking each

+// element as a function argument. The sequence can be specified as an

+// array, a pointer and count, a vector, an initializer list, or an

+// STL iterator range. In each of these cases, the underlying sequence

+// can be either a sequence of values or a sequence of matchers.

+//

+// All forms of ElementsAreArray() make a copy of the input matcher sequence.

+

+template <typename Iter>

+inline internal::ElementsAreArrayMatcher<

+    typename ::std::iterator_traits<Iter>::value_type>

+ElementsAreArray(Iter first, Iter last) {

+  typedef typename ::std::iterator_traits<Iter>::value_type T;

+  return internal::ElementsAreArrayMatcher<T>(first, last);

+}

+

+template <typename T>

+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(

+    const T* pointer, size_t count) {

+  return ElementsAreArray(pointer, pointer + count);

+}

+

+template <typename T, size_t N>

+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(

+    const T (&array)[N]) {

+  return ElementsAreArray(array, N);

+}

+

+template <typename T, typename A>

+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(

+    const ::std::vector<T, A>& vec) {

+  return ElementsAreArray(vec.begin(), vec.end());

+}

+

+#if GTEST_LANG_CXX11

+template <typename T>

+inline internal::ElementsAreArrayMatcher<T>

+ElementsAreArray(::std::initializer_list<T> xs) {

+  return ElementsAreArray(xs.begin(), xs.end());

+}

+#endif

+

+// UnorderedElementsAreArray(first, last)

+// UnorderedElementsAreArray(pointer, count)

+// UnorderedElementsAreArray(array)

+// UnorderedElementsAreArray(vector)

+// UnorderedElementsAreArray({ e1, e2, ..., en })

+//

+// The UnorderedElementsAreArray() functions are like

+// ElementsAreArray(...), but allow matching the elements in any order.

+template <typename Iter>

+inline internal::UnorderedElementsAreArrayMatcher<

+    typename ::std::iterator_traits<Iter>::value_type>

+UnorderedElementsAreArray(Iter first, Iter last) {

+  typedef typename ::std::iterator_traits<Iter>::value_type T;

+  return internal::UnorderedElementsAreArrayMatcher<T>(first, last);

+}

+

+template <typename T>

+inline internal::UnorderedElementsAreArrayMatcher<T>

+UnorderedElementsAreArray(const T* pointer, size_t count) {

+  return UnorderedElementsAreArray(pointer, pointer + count);

+}

+

+template <typename T, size_t N>

+inline internal::UnorderedElementsAreArrayMatcher<T>

+UnorderedElementsAreArray(const T (&array)[N]) {

+  return UnorderedElementsAreArray(array, N);

+}

+

+template <typename T, typename A>

+inline internal::UnorderedElementsAreArrayMatcher<T>

+UnorderedElementsAreArray(const ::std::vector<T, A>& vec) {

+  return UnorderedElementsAreArray(vec.begin(), vec.end());

+}

+

+#if GTEST_LANG_CXX11

+template <typename T>

+inline internal::UnorderedElementsAreArrayMatcher<T>

+UnorderedElementsAreArray(::std::initializer_list<T> xs) {

+  return UnorderedElementsAreArray(xs.begin(), xs.end());

+}

+#endif

+

+// _ is a matcher that matches anything of any type.

+//

+// This definition is fine as:

+//

+//   1. The C++ standard permits using the name _ in a namespace that

+//      is not the global namespace or ::std.

+//   2. The AnythingMatcher class has no data member or constructor,

+//      so it's OK to create global variables of this type.

+//   3. c-style has approved of using _ in this case.

+const internal::AnythingMatcher _ = {};

+// Creates a matcher that matches any value of the given type T.

+template <typename T>

+inline Matcher<T> A() { return MakeMatcher(new internal::AnyMatcherImpl<T>()); }

+

+// Creates a matcher that matches any value of the given type T.

+template <typename T>

+inline Matcher<T> An() { return A<T>(); }

+

+// Creates a polymorphic matcher that matches anything equal to x.

+// Note: if the parameter of Eq() were declared as const T&, Eq("foo")

+// wouldn't compile.

+template <typename T>

+inline internal::EqMatcher<T> Eq(T x) { return internal::EqMatcher<T>(x); }

+

+// Constructs a Matcher<T> from a 'value' of type T.  The constructed

+// matcher matches any value that's equal to 'value'.

+template <typename T>

+Matcher<T>::Matcher(T value) { *this = Eq(value); }

+

+// Creates a monomorphic matcher that matches anything with type Lhs

+// and equal to rhs.  A user may need to use this instead of Eq(...)

+// in order to resolve an overloading ambiguity.

+//

+// TypedEq<T>(x) is just a convenient short-hand for Matcher<T>(Eq(x))

+// or Matcher<T>(x), but more readable than the latter.

+//

+// We could define similar monomorphic matchers for other comparison

+// operations (e.g. TypedLt, TypedGe, and etc), but decided not to do

+// it yet as those are used much less than Eq() in practice.  A user

+// can always write Matcher<T>(Lt(5)) to be explicit about the type,

+// for example.

+template <typename Lhs, typename Rhs>

+inline Matcher<Lhs> TypedEq(const Rhs& rhs) { return Eq(rhs); }

+

+// Creates a polymorphic matcher that matches anything >= x.

+template <typename Rhs>

+inline internal::GeMatcher<Rhs> Ge(Rhs x) {

+  return internal::GeMatcher<Rhs>(x);

+}

+

+// Creates a polymorphic matcher that matches anything > x.

+template <typename Rhs>

+inline internal::GtMatcher<Rhs> Gt(Rhs x) {

+  return internal::GtMatcher<Rhs>(x);

+}

+

+// Creates a polymorphic matcher that matches anything <= x.

+template <typename Rhs>

+inline internal::LeMatcher<Rhs> Le(Rhs x) {

+  return internal::LeMatcher<Rhs>(x);

+}

+

+// Creates a polymorphic matcher that matches anything < x.

+template <typename Rhs>

+inline internal::LtMatcher<Rhs> Lt(Rhs x) {

+  return internal::LtMatcher<Rhs>(x);

+}

+

+// Creates a polymorphic matcher that matches anything != x.

+template <typename Rhs>

+inline internal::NeMatcher<Rhs> Ne(Rhs x) {

+  return internal::NeMatcher<Rhs>(x);

+}

+

+// Creates a polymorphic matcher that matches any NULL pointer.

+inline PolymorphicMatcher<internal::IsNullMatcher > IsNull() {

+  return MakePolymorphicMatcher(internal::IsNullMatcher());

+}

+

+// Creates a polymorphic matcher that matches any non-NULL pointer.

+// This is convenient as Not(NULL) doesn't compile (the compiler

+// thinks that that expression is comparing a pointer with an integer).

+inline PolymorphicMatcher<internal::NotNullMatcher > NotNull() {

+  return MakePolymorphicMatcher(internal::NotNullMatcher());

+}

+

+// Creates a polymorphic matcher that matches any argument that

+// references variable x.

+template <typename T>

+inline internal::RefMatcher<T&> Ref(T& x) {  // NOLINT

+  return internal::RefMatcher<T&>(x);

+}

+

+// Creates a matcher that matches any double argument approximately

+// equal to rhs, where two NANs are considered unequal.

+inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) {

+  return internal::FloatingEqMatcher<double>(rhs, false);

+}

+

+// Creates a matcher that matches any double argument approximately

+// equal to rhs, including NaN values when rhs is NaN.

+inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {

+  return internal::FloatingEqMatcher<double>(rhs, true);

+}

+

+// Creates a matcher that matches any double argument approximately equal to

+// rhs, up to the specified max absolute error bound, where two NANs are

+// considered unequal.  The max absolute error bound must be non-negative.

+inline internal::FloatingEqMatcher<double> DoubleNear(

+    double rhs, double max_abs_error) {

+  return internal::FloatingEqMatcher<double>(rhs, false, max_abs_error);

+}

+

+// Creates a matcher that matches any double argument approximately equal to

+// rhs, up to the specified max absolute error bound, including NaN values when

+// rhs is NaN.  The max absolute error bound must be non-negative.

+inline internal::FloatingEqMatcher<double> NanSensitiveDoubleNear(

+    double rhs, double max_abs_error) {

+  return internal::FloatingEqMatcher<double>(rhs, true, max_abs_error);

+}

+

+// Creates a matcher that matches any float argument approximately

+// equal to rhs, where two NANs are considered unequal.

+inline internal::FloatingEqMatcher<float> FloatEq(float rhs) {

+  return internal::FloatingEqMatcher<float>(rhs, false);

+}

+

+// Creates a matcher that matches any float argument approximately

+// equal to rhs, including NaN values when rhs is NaN.

+inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {

+  return internal::FloatingEqMatcher<float>(rhs, true);

+}

+

+// Creates a matcher that matches any float argument approximately equal to

+// rhs, up to the specified max absolute error bound, where two NANs are

+// considered unequal.  The max absolute error bound must be non-negative.

+inline internal::FloatingEqMatcher<float> FloatNear(

+    float rhs, float max_abs_error) {

+  return internal::FloatingEqMatcher<float>(rhs, false, max_abs_error);

+}

+

+// Creates a matcher that matches any float argument approximately equal to

+// rhs, up to the specified max absolute error bound, including NaN values when

+// rhs is NaN.  The max absolute error bound must be non-negative.

+inline internal::FloatingEqMatcher<float> NanSensitiveFloatNear(

+    float rhs, float max_abs_error) {

+  return internal::FloatingEqMatcher<float>(rhs, true, max_abs_error);

+}

+

+// Creates a matcher that matches a pointer (raw or smart) that points

+// to a value that matches inner_matcher.

+template <typename InnerMatcher>

+inline internal::PointeeMatcher<InnerMatcher> Pointee(

+    const InnerMatcher& inner_matcher) {

+  return internal::PointeeMatcher<InnerMatcher>(inner_matcher);

+}

+

+// Creates a matcher that matches an object whose given field matches

+// 'matcher'.  For example,

+//   Field(&Foo::number, Ge(5))

+// matches a Foo object x iff x.number >= 5.

+template <typename Class, typename FieldType, typename FieldMatcher>

+inline PolymorphicMatcher<

+  internal::FieldMatcher<Class, FieldType> > Field(

+    FieldType Class::*field, const FieldMatcher& matcher) {

+  return MakePolymorphicMatcher(

+      internal::FieldMatcher<Class, FieldType>(

+          field, MatcherCast<const FieldType&>(matcher)));

+  // The call to MatcherCast() is required for supporting inner

+  // matchers of compatible types.  For example, it allows

+  //   Field(&Foo::bar, m)

+  // to compile where bar is an int32 and m is a matcher for int64.

+}

+

+// Creates a matcher that matches an object whose given property

+// matches 'matcher'.  For example,

+//   Property(&Foo::str, StartsWith("hi"))

+// matches a Foo object x iff x.str() starts with "hi".

+template <typename Class, typename PropertyType, typename PropertyMatcher>

+inline PolymorphicMatcher<

+  internal::PropertyMatcher<Class, PropertyType> > Property(

+    PropertyType (Class::*property)() const, const PropertyMatcher& matcher) {

+  return MakePolymorphicMatcher(

+      internal::PropertyMatcher<Class, PropertyType>(

+          property,

+          MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));

+  // The call to MatcherCast() is required for supporting inner

+  // matchers of compatible types.  For example, it allows

+  //   Property(&Foo::bar, m)

+  // to compile where bar() returns an int32 and m is a matcher for int64.

+}

+

+// Creates a matcher that matches an object iff the result of applying

+// a callable to x matches 'matcher'.

+// For example,

+//   ResultOf(f, StartsWith("hi"))

+// matches a Foo object x iff f(x) starts with "hi".

+// callable parameter can be a function, function pointer, or a functor.

+// Callable has to satisfy the following conditions:

+//   * It is required to keep no state affecting the results of

+//     the calls on it and make no assumptions about how many calls

+//     will be made. Any state it keeps must be protected from the

+//     concurrent access.

+//   * If it is a function object, it has to define type result_type.

+//     We recommend deriving your functor classes from std::unary_function.

+template <typename Callable, typename ResultOfMatcher>

+internal::ResultOfMatcher<Callable> ResultOf(

+    Callable callable, const ResultOfMatcher& matcher) {

+  return internal::ResultOfMatcher<Callable>(

+          callable,

+          MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(

+              matcher));

+  // The call to MatcherCast() is required for supporting inner

+  // matchers of compatible types.  For example, it allows

+  //   ResultOf(Function, m)

+  // to compile where Function() returns an int32 and m is a matcher for int64.

+}

+

+// String matchers.

+

+// Matches a string equal to str.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >

+    StrEq(const internal::string& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(

+      str, true, true));

+}

+

+// Matches a string not equal to str.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >

+    StrNe(const internal::string& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(

+      str, false, true));

+}

+

+// Matches a string equal to str, ignoring case.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >

+    StrCaseEq(const internal::string& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(

+      str, true, false));

+}

+

+// Matches a string not equal to str, ignoring case.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >

+    StrCaseNe(const internal::string& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(

+      str, false, false));

+}

+

+// Creates a matcher that matches any string, std::string, or C string

+// that contains the given substring.

+inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >

+    HasSubstr(const internal::string& substring) {

+  return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::string>(

+      substring));

+}

+

+// Matches a string that starts with 'prefix' (case-sensitive).

+inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >

+    StartsWith(const internal::string& prefix) {

+  return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::string>(

+      prefix));

+}

+

+// Matches a string that ends with 'suffix' (case-sensitive).

+inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >

+    EndsWith(const internal::string& suffix) {

+  return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::string>(

+      suffix));

+}

+

+// Matches a string that fully matches regular expression 'regex'.

+// The matcher takes ownership of 'regex'.

+inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(

+    const internal::RE* regex) {

+  return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));

+}

+inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(

+    const internal::string& regex) {

+  return MatchesRegex(new internal::RE(regex));

+}

+

+// Matches a string that contains regular expression 'regex'.

+// The matcher takes ownership of 'regex'.

+inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(

+    const internal::RE* regex) {

+  return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));

+}

+inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(

+    const internal::string& regex) {

+  return ContainsRegex(new internal::RE(regex));

+}

+

+#if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING

+// Wide string matchers.

+

+// Matches a string equal to str.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >

+    StrEq(const internal::wstring& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(

+      str, true, true));

+}

+

+// Matches a string not equal to str.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >

+    StrNe(const internal::wstring& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(

+      str, false, true));

+}

+

+// Matches a string equal to str, ignoring case.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >

+    StrCaseEq(const internal::wstring& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(

+      str, true, false));

+}

+

+// Matches a string not equal to str, ignoring case.

+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >

+    StrCaseNe(const internal::wstring& str) {

+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(

+      str, false, false));

+}

+

+// Creates a matcher that matches any wstring, std::wstring, or C wide string

+// that contains the given substring.

+inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::wstring> >

+    HasSubstr(const internal::wstring& substring) {

+  return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::wstring>(

+      substring));

+}

+

+// Matches a string that starts with 'prefix' (case-sensitive).

+inline PolymorphicMatcher<internal::StartsWithMatcher<internal::wstring> >

+    StartsWith(const internal::wstring& prefix) {

+  return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::wstring>(

+      prefix));

+}

+

+// Matches a string that ends with 'suffix' (case-sensitive).

+inline PolymorphicMatcher<internal::EndsWithMatcher<internal::wstring> >

+    EndsWith(const internal::wstring& suffix) {

+  return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::wstring>(

+      suffix));

+}

+

+#endif  // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING

+

+// Creates a polymorphic matcher that matches a 2-tuple where the

+// first field == the second field.

+inline internal::Eq2Matcher Eq() { return internal::Eq2Matcher(); }

+

+// Creates a polymorphic matcher that matches a 2-tuple where the

+// first field >= the second field.

+inline internal::Ge2Matcher Ge() { return internal::Ge2Matcher(); }

+

+// Creates a polymorphic matcher that matches a 2-tuple where the

+// first field > the second field.

+inline internal::Gt2Matcher Gt() { return internal::Gt2Matcher(); }

+

+// Creates a polymorphic matcher that matches a 2-tuple where the

+// first field <= the second field.

+inline internal::Le2Matcher Le() { return internal::Le2Matcher(); }

+

+// Creates a polymorphic matcher that matches a 2-tuple where the

+// first field < the second field.

+inline internal::Lt2Matcher Lt() { return internal::Lt2Matcher(); }

+

+// Creates a polymorphic matcher that matches a 2-tuple where the

+// first field != the second field.

+inline internal::Ne2Matcher Ne() { return internal::Ne2Matcher(); }

+

+// Creates a matcher that matches any value of type T that m doesn't

+// match.

+template <typename InnerMatcher>

+inline internal::NotMatcher<InnerMatcher> Not(InnerMatcher m) {

+  return internal::NotMatcher<InnerMatcher>(m);

+}

+

+// Returns a matcher that matches anything that satisfies the given

+// predicate.  The predicate can be any unary function or functor

+// whose return type can be implicitly converted to bool.

+template <typename Predicate>

+inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >

+Truly(Predicate pred) {

+  return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred));

+}

+

+// Returns a matcher that matches the container size. The container must

+// support both size() and size_type which all STL-like containers provide.

+// Note that the parameter 'size' can be a value of type size_type as well as

+// matcher. For instance:

+//   EXPECT_THAT(container, SizeIs(2));     // Checks container has 2 elements.

+//   EXPECT_THAT(container, SizeIs(Le(2));  // Checks container has at most 2.

+template <typename SizeMatcher>

+inline internal::SizeIsMatcher<SizeMatcher>

+SizeIs(const SizeMatcher& size_matcher) {

+  return internal::SizeIsMatcher<SizeMatcher>(size_matcher);

+}

+

+// Returns a matcher that matches an equal container.

+// This matcher behaves like Eq(), but in the event of mismatch lists the

+// values that are included in one container but not the other. (Duplicate

+// values and order differences are not explained.)

+template <typename Container>

+inline PolymorphicMatcher<internal::ContainerEqMatcher<  // NOLINT

+                            GTEST_REMOVE_CONST_(Container)> >

+    ContainerEq(const Container& rhs) {

+  // This following line is for working around a bug in MSVC 8.0,

+  // which causes Container to be a const type sometimes.

+  typedef GTEST_REMOVE_CONST_(Container) RawContainer;

+  return MakePolymorphicMatcher(

+      internal::ContainerEqMatcher<RawContainer>(rhs));

+}

+

+// Returns a matcher that matches a container that, when sorted using

+// the given comparator, matches container_matcher.

+template <typename Comparator, typename ContainerMatcher>

+inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>

+WhenSortedBy(const Comparator& comparator,

+             const ContainerMatcher& container_matcher) {

+  return internal::WhenSortedByMatcher<Comparator, ContainerMatcher>(

+      comparator, container_matcher);

+}

+

+// Returns a matcher that matches a container that, when sorted using

+// the < operator, matches container_matcher.

+template <typename ContainerMatcher>

+inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>

+WhenSorted(const ContainerMatcher& container_matcher) {

+  return

+      internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>(

+          internal::LessComparator(), container_matcher);

+}

+

+// Matches an STL-style container or a native array that contains the

+// same number of elements as in rhs, where its i-th element and rhs's

+// i-th element (as a pair) satisfy the given pair matcher, for all i.

+// TupleMatcher must be able to be safely cast to Matcher<tuple<const

+// T1&, const T2&> >, where T1 and T2 are the types of elements in the

+// LHS container and the RHS container respectively.

+template <typename TupleMatcher, typename Container>

+inline internal::PointwiseMatcher<TupleMatcher,

+                                  GTEST_REMOVE_CONST_(Container)>

+Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {

+  // This following line is for working around a bug in MSVC 8.0,

+  // which causes Container to be a const type sometimes.

+  typedef GTEST_REMOVE_CONST_(Container) RawContainer;

+  return internal::PointwiseMatcher<TupleMatcher, RawContainer>(

+      tuple_matcher, rhs);

+}

+

+// Matches an STL-style container or a native array that contains at

+// least one element matching the given value or matcher.

+//

+// Examples:

+//   ::std::set<int> page_ids;

+//   page_ids.insert(3);

+//   page_ids.insert(1);

+//   EXPECT_THAT(page_ids, Contains(1));

+//   EXPECT_THAT(page_ids, Contains(Gt(2)));

+//   EXPECT_THAT(page_ids, Not(Contains(4)));

+//

+//   ::std::map<int, size_t> page_lengths;

+//   page_lengths[1] = 100;

+//   EXPECT_THAT(page_lengths,

+//               Contains(::std::pair<const int, size_t>(1, 100)));

+//

+//   const char* user_ids[] = { "joe", "mike", "tom" };

+//   EXPECT_THAT(user_ids, Contains(Eq(::std::string("tom"))));

+template <typename M>

+inline internal::ContainsMatcher<M> Contains(M matcher) {

+  return internal::ContainsMatcher<M>(matcher);

+}

+

+// Matches an STL-style container or a native array that contains only

+// elements matching the given value or matcher.

+//

+// Each(m) is semantically equivalent to Not(Contains(Not(m))). Only

+// the messages are different.

+//

+// Examples:

+//   ::std::set<int> page_ids;

+//   // Each(m) matches an empty container, regardless of what m is.

+//   EXPECT_THAT(page_ids, Each(Eq(1)));

+//   EXPECT_THAT(page_ids, Each(Eq(77)));

+//

+//   page_ids.insert(3);

+//   EXPECT_THAT(page_ids, Each(Gt(0)));

+//   EXPECT_THAT(page_ids, Not(Each(Gt(4))));

+//   page_ids.insert(1);

+//   EXPECT_THAT(page_ids, Not(Each(Lt(2))));

+//

+//   ::std::map<int, size_t> page_lengths;

+//   page_lengths[1] = 100;

+//   page_lengths[2] = 200;

+//   page_lengths[3] = 300;

+//   EXPECT_THAT(page_lengths, Not(Each(Pair(1, 100))));

+//   EXPECT_THAT(page_lengths, Each(Key(Le(3))));

+//

+//   const char* user_ids[] = { "joe", "mike", "tom" };

+//   EXPECT_THAT(user_ids, Not(Each(Eq(::std::string("tom")))));

+template <typename M>

+inline internal::EachMatcher<M> Each(M matcher) {

+  return internal::EachMatcher<M>(matcher);

+}

+

+// Key(inner_matcher) matches an std::pair whose 'first' field matches

+// inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an

+// std::map that contains at least one element whose key is >= 5.

+template <typename M>

+inline internal::KeyMatcher<M> Key(M inner_matcher) {

+  return internal::KeyMatcher<M>(inner_matcher);

+}

+

+// Pair(first_matcher, second_matcher) matches a std::pair whose 'first' field

+// matches first_matcher and whose 'second' field matches second_matcher.  For

+// example, EXPECT_THAT(map_type, ElementsAre(Pair(Ge(5), "foo"))) can be used

+// to match a std::map<int, string> that contains exactly one element whose key

+// is >= 5 and whose value equals "foo".

+template <typename FirstMatcher, typename SecondMatcher>

+inline internal::PairMatcher<FirstMatcher, SecondMatcher>

+Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {

+  return internal::PairMatcher<FirstMatcher, SecondMatcher>(

+      first_matcher, second_matcher);

+}

+

+// Returns a predicate that is satisfied by anything that matches the

+// given matcher.

+template <typename M>

+inline internal::MatcherAsPredicate<M> Matches(M matcher) {

+  return internal::MatcherAsPredicate<M>(matcher);

+}

+

+// Returns true iff the value matches the matcher.

+template <typename T, typename M>

+inline bool Value(const T& value, M matcher) {

+  return testing::Matches(matcher)(value);

+}

+

+// Matches the value against the given matcher and explains the match

+// result to listener.

+template <typename T, typename M>

+inline bool ExplainMatchResult(

+    M matcher, const T& value, MatchResultListener* listener) {

+  return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);

+}

+

+#if GTEST_LANG_CXX11

+// Define variadic matcher versions. They are overloaded in

+// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.

+template <typename... Args>

+inline internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) {

+  return internal::AllOfMatcher<Args...>(matchers...);

+}

+

+template <typename... Args>

+inline internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {

+  return internal::AnyOfMatcher<Args...>(matchers...);

+}

+

+#endif  // GTEST_LANG_CXX11

+

+// AllArgs(m) is a synonym of m.  This is useful in

+//

+//   EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));

+//

+// which is easier to read than

+//

+//   EXPECT_CALL(foo, Bar(_, _)).With(Eq());

+template <typename InnerMatcher>

+inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher; }

+

+// These macros allow using matchers to check values in Google Test

+// tests.  ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)

+// succeed iff the value matches the matcher.  If the assertion fails,

+// the value and the description of the matcher will be printed.

+#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\

+    ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)

+#define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\

+    ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-more-actions.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-more-actions.h
new file mode 100644
index 0000000..af8441f
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-more-actions.h
@@ -0,0 +1,233 @@
+// 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 actions that depend on gmock-generated-actions.h.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_

+

+#include <algorithm>

+

+#include "gmock/gmock-generated-actions.h"

+

+namespace testing {

+namespace internal {

+

+// Implements the Invoke(f) action.  The template argument

+// FunctionImpl is the implementation type of f, which can be either a

+// function pointer or a functor.  Invoke(f) can be used as an

+// Action<F> as long as f's type is compatible with F (i.e. f can be

+// assigned to a tr1::function<F>).

+template <typename FunctionImpl>

+class InvokeAction {

+ public:

+  // The c'tor makes a copy of function_impl (either a function

+  // pointer or a functor).

+  explicit InvokeAction(FunctionImpl function_impl)

+      : function_impl_(function_impl) {}

+

+  template <typename Result, typename ArgumentTuple>

+  Result Perform(const ArgumentTuple& args) {

+    return InvokeHelper<Result, ArgumentTuple>::Invoke(function_impl_, args);

+  }

+

+ private:

+  FunctionImpl function_impl_;

+

+  GTEST_DISALLOW_ASSIGN_(InvokeAction);

+};

+

+// Implements the Invoke(object_ptr, &Class::Method) action.

+template <class Class, typename MethodPtr>

+class InvokeMethodAction {

+ public:

+  InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)

+      : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}

+

+  template <typename Result, typename ArgumentTuple>

+  Result Perform(const ArgumentTuple& args) const {

+    return InvokeHelper<Result, ArgumentTuple>::InvokeMethod(

+        obj_ptr_, method_ptr_, args);

+  }

+

+ private:

+  Class* const obj_ptr_;

+  const MethodPtr method_ptr_;

+

+  GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);

+};

+

+}  // namespace internal

+

+// Various overloads for Invoke().

+

+// Creates an action that invokes 'function_impl' with the mock

+// function's arguments.

+template <typename FunctionImpl>

+PolymorphicAction<internal::InvokeAction<FunctionImpl> > Invoke(

+    FunctionImpl function_impl) {

+  return MakePolymorphicAction(

+      internal::InvokeAction<FunctionImpl>(function_impl));

+}

+

+// Creates an action that invokes the given method on the given object

+// with the mock function's arguments.

+template <class Class, typename MethodPtr>

+PolymorphicAction<internal::InvokeMethodAction<Class, MethodPtr> > Invoke(

+    Class* obj_ptr, MethodPtr method_ptr) {

+  return MakePolymorphicAction(

+      internal::InvokeMethodAction<Class, MethodPtr>(obj_ptr, method_ptr));

+}

+

+// WithoutArgs(inner_action) can be used in a mock function with a

+// non-empty argument list to perform inner_action, which takes no

+// argument.  In other words, it adapts an action accepting no

+// argument to one that accepts (and ignores) arguments.

+template <typename InnerAction>

+inline internal::WithArgsAction<InnerAction>

+WithoutArgs(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction>(action);

+}

+

+// WithArg<k>(an_action) creates an action that passes the k-th

+// (0-based) argument of the mock function to an_action and performs

+// it.  It adapts an action accepting one argument to one that accepts

+// multiple arguments.  For convenience, we also provide

+// WithArgs<k>(an_action) (defined below) as a synonym.

+template <int k, typename InnerAction>

+inline internal::WithArgsAction<InnerAction, k>

+WithArg(const InnerAction& action) {

+  return internal::WithArgsAction<InnerAction, k>(action);

+}

+

+// The ACTION*() macros trigger warning C4100 (unreferenced formal

+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in

+// the macro definition, as the warnings are generated when the macro

+// is expanded and macro expansion cannot contain #pragma.  Therefore

+// we suppress them here.

+#ifdef _MSC_VER

+# pragma warning(push)

+# pragma warning(disable:4100)

+#endif

+

+// Action ReturnArg<k>() returns the k-th argument of the mock function.

+ACTION_TEMPLATE(ReturnArg,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_0_VALUE_PARAMS()) {

+  return std::tr1::get<k>(args);

+}

+

+// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the

+// mock function to *pointer.

+ACTION_TEMPLATE(SaveArg,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_1_VALUE_PARAMS(pointer)) {

+  *pointer = ::std::tr1::get<k>(args);

+}

+

+// Action SaveArgPointee<k>(pointer) saves the value pointed to

+// by the k-th (0-based) argument of the mock function to *pointer.

+ACTION_TEMPLATE(SaveArgPointee,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_1_VALUE_PARAMS(pointer)) {

+  *pointer = *::std::tr1::get<k>(args);

+}

+

+// Action SetArgReferee<k>(value) assigns 'value' to the variable

+// referenced by the k-th (0-based) argument of the mock function.

+ACTION_TEMPLATE(SetArgReferee,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_1_VALUE_PARAMS(value)) {

+  typedef typename ::std::tr1::tuple_element<k, args_type>::type argk_type;

+  // Ensures that argument #k is a reference.  If you get a compiler

+  // error on the next line, you are using SetArgReferee<k>(value) in

+  // a mock function whose k-th (0-based) argument is not a reference.

+  GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,

+                        SetArgReferee_must_be_used_with_a_reference_argument);

+  ::std::tr1::get<k>(args) = value;

+}

+

+// Action SetArrayArgument<k>(first, last) copies the elements in

+// source range [first, last) to the array pointed to by the k-th

+// (0-based) argument, which can be either a pointer or an

+// iterator. The action does not take ownership of the elements in the

+// source range.

+ACTION_TEMPLATE(SetArrayArgument,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_2_VALUE_PARAMS(first, last)) {

+  // Microsoft compiler deprecates ::std::copy, so we want to suppress warning

+  // 4996 (Function call with parameters that may be unsafe) there.

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4996)  // Temporarily disables warning 4996.

+#endif

+  ::std::copy(first, last, ::std::tr1::get<k>(args));

+#ifdef _MSC_VER

+# pragma warning(pop)           // Restores the warning state.

+#endif

+}

+

+// Action DeleteArg<k>() deletes the k-th (0-based) argument of the mock

+// function.

+ACTION_TEMPLATE(DeleteArg,

+                HAS_1_TEMPLATE_PARAMS(int, k),

+                AND_0_VALUE_PARAMS()) {

+  delete ::std::tr1::get<k>(args);

+}

+

+// This action returns the value pointed to by 'pointer'.

+ACTION_P(ReturnPointee, pointer) { return *pointer; }

+

+// Action Throw(exception) can be used in a mock function of any type

+// to throw the given exception.  Any copyable value can be thrown.

+#if GTEST_HAS_EXCEPTIONS

+

+// Suppresses the 'unreachable code' warning that VC generates in opt modes.

+# ifdef _MSC_VER

+#  pragma warning(push)          // Saves the current warning state.

+#  pragma warning(disable:4702)  // Temporarily disables warning 4702.

+# endif

+ACTION_P(Throw, exception) { throw exception; }

+# ifdef _MSC_VER

+#  pragma warning(pop)           // Restores the warning state.

+# endif

+

+#endif  // GTEST_HAS_EXCEPTIONS

+

+#ifdef _MSC_VER

+# pragma warning(pop)

+#endif

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-more-matchers.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-more-matchers.h
new file mode 100644
index 0000000..162723b
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-more-matchers.h
@@ -0,0 +1,58 @@
+// Copyright 2013, 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: marcus.boerger@google.com (Marcus Boerger)

+

+// Google Mock - a framework for writing C++ mock classes.

+//

+// This file implements some matchers that depend on gmock-generated-matchers.h.

+//

+// Note that tests are implemented in gmock-matchers_test.cc rather than

+// gmock-more-matchers-test.cc.

+

+#ifndef GMOCK_GMOCK_MORE_MATCHERS_H_

+#define GMOCK_GMOCK_MORE_MATCHERS_H_

+

+#include "gmock/gmock-generated-matchers.h"

+

+namespace testing {

+

+// Defines a matcher that matches an empty container. The container must

+// support both size() and empty(), which all STL-like containers provide.

+MATCHER(IsEmpty, negation ? "isn't empty" : "is empty") {

+  if (arg.empty()) {

+    return true;

+  }

+  *result_listener << "whose size is " << arg.size();

+  return false;

+}

+

+}  // namespace testing

+

+#endif  // GMOCK_GMOCK_MORE_MATCHERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock-spec-builders.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock-spec-builders.h
new file mode 100644
index 0000000..8cb3c4a
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock-spec-builders.h
@@ -0,0 +1,1791 @@
+// 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 the ON_CALL() and EXPECT_CALL() macros.

+//

+// A user can use the ON_CALL() macro to specify the default action of

+// a mock method.  The syntax is:

+//

+//   ON_CALL(mock_object, Method(argument-matchers))

+//       .With(multi-argument-matcher)

+//       .WillByDefault(action);

+//

+//  where the .With() clause is optional.

+//

+// A user can use the EXPECT_CALL() macro to specify an expectation on

+// a mock method.  The syntax is:

+//

+//   EXPECT_CALL(mock_object, Method(argument-matchers))

+//       .With(multi-argument-matchers)

+//       .Times(cardinality)

+//       .InSequence(sequences)

+//       .After(expectations)

+//       .WillOnce(action)

+//       .WillRepeatedly(action)

+//       .RetiresOnSaturation();

+//

+// where all clauses are optional, and .InSequence()/.After()/

+// .WillOnce() can appear any number of times.

+

+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_

+#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_

+

+#include <map>

+#include <set>

+#include <sstream>

+#include <string>

+#include <vector>

+

+#if GTEST_HAS_EXCEPTIONS

+# include <stdexcept>  // NOLINT

+#endif

+

+#include "gmock/gmock-actions.h"

+#include "gmock/gmock-cardinalities.h"

+#include "gmock/gmock-matchers.h"

+#include "gmock/internal/gmock-internal-utils.h"

+#include "gmock/internal/gmock-port.h"

+#include "gtest/gtest.h"

+

+namespace testing {

+

+// An abstract handle of an expectation.

+class Expectation;

+

+// A set of expectation handles.

+class ExpectationSet;

+

+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION

+// and MUST NOT BE USED IN USER CODE!!!

+namespace internal {

+

+// Implements a mock function.

+template <typename F> class FunctionMocker;

+

+// Base class for expectations.

+class ExpectationBase;

+

+// Implements an expectation.

+template <typename F> class TypedExpectation;

+

+// Helper class for testing the Expectation class template.

+class ExpectationTester;

+

+// Base class for function mockers.

+template <typename F> class FunctionMockerBase;

+

+// Protects the mock object registry (in class Mock), all function

+// mockers, and all expectations.

+//

+// The reason we don't use more fine-grained protection is: when a

+// mock function Foo() is called, it needs to consult its expectations

+// to see which one should be picked.  If another thread is allowed to

+// call a mock function (either Foo() or a different one) at the same

+// time, it could affect the "retired" attributes of Foo()'s

+// expectations when InSequence() is used, and thus affect which

+// expectation gets picked.  Therefore, we sequence all mock function

+// calls to ensure the integrity of the mock objects' states.

+GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex);

+

+// Untyped base class for ActionResultHolder<R>.

+class UntypedActionResultHolderBase;

+

+// Abstract base class of FunctionMockerBase.  This is the

+// type-agnostic part of the function mocker interface.  Its pure

+// virtual methods are implemented by FunctionMockerBase.

+class GTEST_API_ UntypedFunctionMockerBase {

+ public:

+  UntypedFunctionMockerBase();

+  virtual ~UntypedFunctionMockerBase();

+

+  // Verifies that all expectations on this mock function have been

+  // satisfied.  Reports one or more Google Test non-fatal failures

+  // and returns false if not.

+  bool VerifyAndClearExpectationsLocked()

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);

+

+  // Clears the ON_CALL()s set on this mock function.

+  virtual void ClearDefaultActionsLocked()

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) = 0;

+

+  // In all of the following Untyped* functions, it's the caller's

+  // responsibility to guarantee the correctness of the arguments'

+  // types.

+

+  // Performs the default action with the given arguments and returns

+  // the action's result.  The call description string will be used in

+  // the error message to describe the call in the case the default

+  // action fails.

+  // L = *

+  virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(

+      const void* untyped_args,

+      const string& call_description) const = 0;

+

+  // Performs the given action with the given arguments and returns

+  // the action's result.

+  // L = *

+  virtual UntypedActionResultHolderBase* UntypedPerformAction(

+      const void* untyped_action,

+      const void* untyped_args) const = 0;

+

+  // Writes a message that the call is uninteresting (i.e. neither

+  // explicitly expected nor explicitly unexpected) to the given

+  // ostream.

+  virtual void UntypedDescribeUninterestingCall(

+      const void* untyped_args,

+      ::std::ostream* os) const

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;

+

+  // Returns the expectation that matches the given function arguments

+  // (or NULL is there's no match); when a match is found,

+  // untyped_action is set to point to the action that should be

+  // performed (or NULL if the action is "do default"), and

+  // is_excessive is modified to indicate whether the call exceeds the

+  // expected number.

+  virtual const ExpectationBase* UntypedFindMatchingExpectation(

+      const void* untyped_args,

+      const void** untyped_action, bool* is_excessive,

+      ::std::ostream* what, ::std::ostream* why)

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;

+

+  // Prints the given function arguments to the ostream.

+  virtual void UntypedPrintArgs(const void* untyped_args,

+                                ::std::ostream* os) const = 0;

+

+  // Sets the mock object this mock method belongs to, and registers

+  // this information in the global mock registry.  Will be called

+  // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock

+  // method.

+  // TODO(wan@google.com): rename to SetAndRegisterOwner().

+  void RegisterOwner(const void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);

+

+  // Sets the mock object this mock method belongs to, and sets the

+  // name of the mock function.  Will be called upon each invocation

+  // of this mock function.

+  void SetOwnerAndName(const void* mock_obj, const char* name)

+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);

+

+  // Returns the mock object this mock method belongs to.  Must be

+  // called after RegisterOwner() or SetOwnerAndName() has been

+  // called.

+  const void* MockObject() const

+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);

+

+  // Returns the name of this mock method.  Must be called after

+  // SetOwnerAndName() has been called.

+  const char* Name() const

+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);

+

+  // Returns the result of invoking this mock function with the given

+  // arguments.  This function can be safely called from multiple

+  // threads concurrently.  The caller is responsible for deleting the

+  // result.

+  const UntypedActionResultHolderBase* UntypedInvokeWith(

+      const void* untyped_args)

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex);

+

+ protected:

+  typedef std::vector<const void*> UntypedOnCallSpecs;

+

+  typedef std::vector<internal::linked_ptr<ExpectationBase> >

+  UntypedExpectations;

+

+  // Returns an Expectation object that references and co-owns exp,

+  // which must be an expectation on this mock function.

+  Expectation GetHandleOf(ExpectationBase* exp);

+

+  // Address of the mock object this mock method belongs to.  Only

+  // valid after this mock method has been called or

+  // ON_CALL/EXPECT_CALL has been invoked on it.

+  const void* mock_obj_;  // Protected by g_gmock_mutex.

+

+  // Name of the function being mocked.  Only valid after this mock

+  // method has been called.

+  const char* name_;  // Protected by g_gmock_mutex.

+

+  // All default action specs for this function mocker.

+  UntypedOnCallSpecs untyped_on_call_specs_;

+

+  // All expectations for this function mocker.

+  UntypedExpectations untyped_expectations_;

+};  // class UntypedFunctionMockerBase

+

+// Untyped base class for OnCallSpec<F>.

+class UntypedOnCallSpecBase {

+ public:

+  // The arguments are the location of the ON_CALL() statement.

+  UntypedOnCallSpecBase(const char* a_file, int a_line)

+      : file_(a_file), line_(a_line), last_clause_(kNone) {}

+

+  // Where in the source file was the default action spec defined?

+  const char* file() const { return file_; }

+  int line() const { return line_; }

+

+ protected:

+  // Gives each clause in the ON_CALL() statement a name.

+  enum Clause {

+    // Do not change the order of the enum members!  The run-time

+    // syntax checking relies on it.

+    kNone,

+    kWith,

+    kWillByDefault

+  };

+

+  // Asserts that the ON_CALL() statement has a certain property.

+  void AssertSpecProperty(bool property, const string& failure_message) const {

+    Assert(property, file_, line_, failure_message);

+  }

+

+  // Expects that the ON_CALL() statement has a certain property.

+  void ExpectSpecProperty(bool property, const string& failure_message) const {

+    Expect(property, file_, line_, failure_message);

+  }

+

+  const char* file_;

+  int line_;

+

+  // The last clause in the ON_CALL() statement as seen so far.

+  // Initially kNone and changes as the statement is parsed.

+  Clause last_clause_;

+};  // class UntypedOnCallSpecBase

+

+// This template class implements an ON_CALL spec.

+template <typename F>

+class OnCallSpec : public UntypedOnCallSpecBase {

+ public:

+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;

+

+  // Constructs an OnCallSpec object from the information inside

+  // the parenthesis of an ON_CALL() statement.

+  OnCallSpec(const char* a_file, int a_line,

+             const ArgumentMatcherTuple& matchers)

+      : UntypedOnCallSpecBase(a_file, a_line),

+        matchers_(matchers),

+        // By default, extra_matcher_ should match anything.  However,

+        // we cannot initialize it with _ as that triggers a compiler

+        // bug in Symbian's C++ compiler (cannot decide between two

+        // overloaded constructors of Matcher<const ArgumentTuple&>).

+        extra_matcher_(A<const ArgumentTuple&>()) {

+  }

+

+  // Implements the .With() clause.

+  OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {

+    // Makes sure this is called at most once.

+    ExpectSpecProperty(last_clause_ < kWith,

+                       ".With() cannot appear "

+                       "more than once in an ON_CALL().");

+    last_clause_ = kWith;

+

+    extra_matcher_ = m;

+    return *this;

+  }

+

+  // Implements the .WillByDefault() clause.

+  OnCallSpec& WillByDefault(const Action<F>& action) {

+    ExpectSpecProperty(last_clause_ < kWillByDefault,

+                       ".WillByDefault() must appear "

+                       "exactly once in an ON_CALL().");

+    last_clause_ = kWillByDefault;

+

+    ExpectSpecProperty(!action.IsDoDefault(),

+                       "DoDefault() cannot be used in ON_CALL().");

+    action_ = action;

+    return *this;

+  }

+

+  // Returns true iff the given arguments match the matchers.

+  bool Matches(const ArgumentTuple& args) const {

+    return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);

+  }

+

+  // Returns the action specified by the user.

+  const Action<F>& GetAction() const {

+    AssertSpecProperty(last_clause_ == kWillByDefault,

+                       ".WillByDefault() must appear exactly "

+                       "once in an ON_CALL().");

+    return action_;

+  }

+

+ private:

+  // The information in statement

+  //

+  //   ON_CALL(mock_object, Method(matchers))

+  //       .With(multi-argument-matcher)

+  //       .WillByDefault(action);

+  //

+  // is recorded in the data members like this:

+  //

+  //   source file that contains the statement => file_

+  //   line number of the statement            => line_

+  //   matchers                                => matchers_

+  //   multi-argument-matcher                  => extra_matcher_

+  //   action                                  => action_

+  ArgumentMatcherTuple matchers_;

+  Matcher<const ArgumentTuple&> extra_matcher_;

+  Action<F> action_;

+};  // class OnCallSpec

+

+// Possible reactions on uninteresting calls.

+enum CallReaction {

+  kAllow,

+  kWarn,

+  kFail,

+  kDefault = kWarn  // By default, warn about uninteresting calls.

+};

+

+}  // namespace internal

+

+// Utilities for manipulating mock objects.

+class GTEST_API_ Mock {

+ public:

+  // The following public methods can be called concurrently.

+

+  // Tells Google Mock to ignore mock_obj when checking for leaked

+  // mock objects.

+  static void AllowLeak(const void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Verifies and clears all expectations on the given mock object.

+  // If the expectations aren't satisfied, generates one or more

+  // Google Test non-fatal failures and returns false.

+  static bool VerifyAndClearExpectations(void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Verifies all expectations on the given mock object and clears its

+  // default actions and expectations.  Returns true iff the

+  // verification was successful.

+  static bool VerifyAndClear(void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+ private:

+  friend class internal::UntypedFunctionMockerBase;

+

+  // Needed for a function mocker to register itself (so that we know

+  // how to clear a mock object).

+  template <typename F>

+  friend class internal::FunctionMockerBase;

+

+  template <typename M>

+  friend class NiceMock;

+

+  template <typename M>

+  friend class NaggyMock;

+

+  template <typename M>

+  friend class StrictMock;

+

+  // Tells Google Mock to allow uninteresting calls on the given mock

+  // object.

+  static void AllowUninterestingCalls(const void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Tells Google Mock to warn the user about uninteresting calls on

+  // the given mock object.

+  static void WarnUninterestingCalls(const void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Tells Google Mock to fail uninteresting calls on the given mock

+  // object.

+  static void FailUninterestingCalls(const void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Tells Google Mock the given mock object is being destroyed and

+  // its entry in the call-reaction table should be removed.

+  static void UnregisterCallReaction(const void* mock_obj)

+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Returns the reaction Google Mock will have on uninteresting calls

+  // made on the given mock object.

+  static internal::CallReaction GetReactionOnUninterestingCalls(

+      const void* mock_obj)

+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Verifies that all expectations on the given mock object have been

+  // satisfied.  Reports one or more Google Test non-fatal failures

+  // and returns false if not.

+  static bool VerifyAndClearExpectationsLocked(void* mock_obj)

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);

+

+  // Clears all ON_CALL()s set on the given mock object.

+  static void ClearDefaultActionsLocked(void* mock_obj)

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);

+

+  // Registers a mock object and a mock method it owns.

+  static void Register(

+      const void* mock_obj,

+      internal::UntypedFunctionMockerBase* mocker)

+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Tells Google Mock where in the source code mock_obj is used in an

+  // ON_CALL or EXPECT_CALL.  In case mock_obj is leaked, this

+  // information helps the user identify which object it is.

+  static void RegisterUseByOnCallOrExpectCall(

+      const void* mock_obj, const char* file, int line)

+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);

+

+  // Unregisters a mock method; removes the owning mock object from

+  // the registry when the last mock method associated with it has

+  // been unregistered.  This is called only in the destructor of

+  // FunctionMockerBase.

+  static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);

+};  // class Mock

+

+// An abstract handle of an expectation.  Useful in the .After()

+// clause of EXPECT_CALL() for setting the (partial) order of

+// expectations.  The syntax:

+//

+//   Expectation e1 = EXPECT_CALL(...)...;

+//   EXPECT_CALL(...).After(e1)...;

+//

+// sets two expectations where the latter can only be matched after

+// the former has been satisfied.

+//

+// Notes:

+//   - This class is copyable and has value semantics.

+//   - Constness is shallow: a const Expectation object itself cannot

+//     be modified, but the mutable methods of the ExpectationBase

+//     object it references can be called via expectation_base().

+//   - The constructors and destructor are defined out-of-line because

+//     the Symbian WINSCW compiler wants to otherwise instantiate them

+//     when it sees this class definition, at which point it doesn't have

+//     ExpectationBase available yet, leading to incorrect destruction

+//     in the linked_ptr (or compilation errors if using a checking

+//     linked_ptr).

+class GTEST_API_ Expectation {

+ public:

+  // Constructs a null object that doesn't reference any expectation.

+  Expectation();

+

+  ~Expectation();

+

+  // This single-argument ctor must not be explicit, in order to support the

+  //   Expectation e = EXPECT_CALL(...);

+  // syntax.

+  //

+  // A TypedExpectation object stores its pre-requisites as

+  // Expectation objects, and needs to call the non-const Retire()

+  // method on the ExpectationBase objects they reference.  Therefore

+  // Expectation must receive a *non-const* reference to the

+  // ExpectationBase object.

+  Expectation(internal::ExpectationBase& exp);  // NOLINT

+

+  // The compiler-generated copy ctor and operator= work exactly as

+  // intended, so we don't need to define our own.

+

+  // Returns true iff rhs references the same expectation as this object does.

+  bool operator==(const Expectation& rhs) const {

+    return expectation_base_ == rhs.expectation_base_;

+  }

+

+  bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }

+

+ private:

+  friend class ExpectationSet;

+  friend class Sequence;

+  friend class ::testing::internal::ExpectationBase;

+  friend class ::testing::internal::UntypedFunctionMockerBase;

+

+  template <typename F>

+  friend class ::testing::internal::FunctionMockerBase;

+

+  template <typename F>

+  friend class ::testing::internal::TypedExpectation;

+

+  // This comparator is needed for putting Expectation objects into a set.

+  class Less {

+   public:

+    bool operator()(const Expectation& lhs, const Expectation& rhs) const {

+      return lhs.expectation_base_.get() < rhs.expectation_base_.get();

+    }

+  };

+

+  typedef ::std::set<Expectation, Less> Set;

+

+  Expectation(

+      const internal::linked_ptr<internal::ExpectationBase>& expectation_base);

+

+  // Returns the expectation this object references.

+  const internal::linked_ptr<internal::ExpectationBase>&

+  expectation_base() const {

+    return expectation_base_;

+  }

+

+  // A linked_ptr that co-owns the expectation this handle references.

+  internal::linked_ptr<internal::ExpectationBase> expectation_base_;

+};

+

+// A set of expectation handles.  Useful in the .After() clause of

+// EXPECT_CALL() for setting the (partial) order of expectations.  The

+// syntax:

+//

+//   ExpectationSet es;

+//   es += EXPECT_CALL(...)...;

+//   es += EXPECT_CALL(...)...;

+//   EXPECT_CALL(...).After(es)...;

+//

+// sets three expectations where the last one can only be matched

+// after the first two have both been satisfied.

+//

+// This class is copyable and has value semantics.

+class ExpectationSet {

+ public:

+  // A bidirectional iterator that can read a const element in the set.

+  typedef Expectation::Set::const_iterator const_iterator;

+

+  // An object stored in the set.  This is an alias of Expectation.

+  typedef Expectation::Set::value_type value_type;

+

+  // Constructs an empty set.

+  ExpectationSet() {}

+

+  // This single-argument ctor must not be explicit, in order to support the

+  //   ExpectationSet es = EXPECT_CALL(...);

+  // syntax.

+  ExpectationSet(internal::ExpectationBase& exp) {  // NOLINT

+    *this += Expectation(exp);

+  }

+

+  // This single-argument ctor implements implicit conversion from

+  // Expectation and thus must not be explicit.  This allows either an

+  // Expectation or an ExpectationSet to be used in .After().

+  ExpectationSet(const Expectation& e) {  // NOLINT

+    *this += e;

+  }

+

+  // The compiler-generator ctor and operator= works exactly as

+  // intended, so we don't need to define our own.

+

+  // Returns true iff rhs contains the same set of Expectation objects

+  // as this does.

+  bool operator==(const ExpectationSet& rhs) const {

+    return expectations_ == rhs.expectations_;

+  }

+

+  bool operator!=(const ExpectationSet& rhs) const { return !(*this == rhs); }

+

+  // Implements the syntax

+  //   expectation_set += EXPECT_CALL(...);

+  ExpectationSet& operator+=(const Expectation& e) {

+    expectations_.insert(e);

+    return *this;

+  }

+

+  int size() const { return static_cast<int>(expectations_.size()); }

+

+  const_iterator begin() const { return expectations_.begin(); }

+  const_iterator end() const { return expectations_.end(); }

+

+ private:

+  Expectation::Set expectations_;

+};

+

+

+// Sequence objects are used by a user to specify the relative order

+// in which the expectations should match.  They are copyable (we rely

+// on the compiler-defined copy constructor and assignment operator).

+class GTEST_API_ Sequence {

+ public:

+  // Constructs an empty sequence.

+  Sequence() : last_expectation_(new Expectation) {}

+

+  // Adds an expectation to this sequence.  The caller must ensure

+  // that no other thread is accessing this Sequence object.

+  void AddExpectation(const Expectation& expectation) const;

+

+ private:

+  // The last expectation in this sequence.  We use a linked_ptr here

+  // because Sequence objects are copyable and we want the copies to

+  // be aliases.  The linked_ptr allows the copies to co-own and share

+  // the same Expectation object.

+  internal::linked_ptr<Expectation> last_expectation_;

+};  // class Sequence

+

+// An object of this type causes all EXPECT_CALL() statements

+// encountered in its scope to be put in an anonymous sequence.  The

+// work is done in the constructor and destructor.  You should only

+// create an InSequence object on the stack.

+//

+// The sole purpose for this class is to support easy definition of

+// sequential expectations, e.g.

+//

+//   {

+//     InSequence dummy;  // The name of the object doesn't matter.

+//

+//     // The following expectations must match in the order they appear.

+//     EXPECT_CALL(a, Bar())...;

+//     EXPECT_CALL(a, Baz())...;

+//     ...

+//     EXPECT_CALL(b, Xyz())...;

+//   }

+//

+// You can create InSequence objects in multiple threads, as long as

+// they are used to affect different mock objects.  The idea is that

+// each thread can create and set up its own mocks as if it's the only

+// thread.  However, for clarity of your tests we recommend you to set

+// up mocks in the main thread unless you have a good reason not to do

+// so.

+class GTEST_API_ InSequence {

+ public:

+  InSequence();

+  ~InSequence();

+ private:

+  bool sequence_created_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence);  // NOLINT

+} GTEST_ATTRIBUTE_UNUSED_;

+

+namespace internal {

+

+// Points to the implicit sequence introduced by a living InSequence

+// object (if any) in the current thread or NULL.

+GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence;

+

+// Base class for implementing expectations.

+//

+// There are two reasons for having a type-agnostic base class for

+// Expectation:

+//

+//   1. We need to store collections of expectations of different

+//   types (e.g. all pre-requisites of a particular expectation, all

+//   expectations in a sequence).  Therefore these expectation objects

+//   must share a common base class.

+//

+//   2. We can avoid binary code bloat by moving methods not depending

+//   on the template argument of Expectation to the base class.

+//

+// This class is internal and mustn't be used by user code directly.

+class GTEST_API_ ExpectationBase {

+ public:

+  // source_text is the EXPECT_CALL(...) source that created this Expectation.

+  ExpectationBase(const char* file, int line, const string& source_text);

+

+  virtual ~ExpectationBase();

+

+  // Where in the source file was the expectation spec defined?

+  const char* file() const { return file_; }

+  int line() const { return line_; }

+  const char* source_text() const { return source_text_.c_str(); }

+  // Returns the cardinality specified in the expectation spec.

+  const Cardinality& cardinality() const { return cardinality_; }

+

+  // Describes the source file location of this expectation.

+  void DescribeLocationTo(::std::ostream* os) const {

+    *os << FormatFileLocation(file(), line()) << " ";

+  }

+

+  // Describes how many times a function call matching this

+  // expectation has occurred.

+  void DescribeCallCountTo(::std::ostream* os) const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);

+

+  // If this mock method has an extra matcher (i.e. .With(matcher)),

+  // describes it to the ostream.

+  virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;

+

+ protected:

+  friend class ::testing::Expectation;

+  friend class UntypedFunctionMockerBase;

+

+  enum Clause {

+    // Don't change the order of the enum members!

+    kNone,

+    kWith,

+    kTimes,

+    kInSequence,

+    kAfter,

+    kWillOnce,

+    kWillRepeatedly,

+    kRetiresOnSaturation

+  };

+

+  typedef std::vector<const void*> UntypedActions;

+

+  // Returns an Expectation object that references and co-owns this

+  // expectation.

+  virtual Expectation GetHandle() = 0;

+

+  // Asserts that the EXPECT_CALL() statement has the given property.

+  void AssertSpecProperty(bool property, const string& failure_message) const {

+    Assert(property, file_, line_, failure_message);

+  }

+

+  // Expects that the EXPECT_CALL() statement has the given property.

+  void ExpectSpecProperty(bool property, const string& failure_message) const {

+    Expect(property, file_, line_, failure_message);

+  }

+

+  // Explicitly specifies the cardinality of this expectation.  Used

+  // by the subclasses to implement the .Times() clause.

+  void SpecifyCardinality(const Cardinality& cardinality);

+

+  // Returns true iff the user specified the cardinality explicitly

+  // using a .Times().

+  bool cardinality_specified() const { return cardinality_specified_; }

+

+  // Sets the cardinality of this expectation spec.

+  void set_cardinality(const Cardinality& a_cardinality) {

+    cardinality_ = a_cardinality;

+  }

+

+  // The following group of methods should only be called after the

+  // EXPECT_CALL() statement, and only when g_gmock_mutex is held by

+  // the current thread.

+

+  // Retires all pre-requisites of this expectation.

+  void RetireAllPreRequisites()

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);

+

+  // Returns true iff this expectation is retired.

+  bool is_retired() const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    return retired_;

+  }

+

+  // Retires this expectation.

+  void Retire()

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    retired_ = true;

+  }

+

+  // Returns true iff this expectation is satisfied.

+  bool IsSatisfied() const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    return cardinality().IsSatisfiedByCallCount(call_count_);

+  }

+

+  // Returns true iff this expectation is saturated.

+  bool IsSaturated() const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    return cardinality().IsSaturatedByCallCount(call_count_);

+  }

+

+  // Returns true iff this expectation is over-saturated.

+  bool IsOverSaturated() const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    return cardinality().IsOverSaturatedByCallCount(call_count_);

+  }

+

+  // Returns true iff all pre-requisites of this expectation are satisfied.

+  bool AllPrerequisitesAreSatisfied() const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);

+

+  // Adds unsatisfied pre-requisites of this expectation to 'result'.

+  void FindUnsatisfiedPrerequisites(ExpectationSet* result) const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);

+

+  // Returns the number this expectation has been invoked.

+  int call_count() const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    return call_count_;

+  }

+

+  // Increments the number this expectation has been invoked.

+  void IncrementCallCount()

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    call_count_++;

+  }

+

+  // Checks the action count (i.e. the number of WillOnce() and

+  // WillRepeatedly() clauses) against the cardinality if this hasn't

+  // been done before.  Prints a warning if there are too many or too

+  // few actions.

+  void CheckActionCountIfNotDone() const

+      GTEST_LOCK_EXCLUDED_(mutex_);

+

+  friend class ::testing::Sequence;

+  friend class ::testing::internal::ExpectationTester;

+

+  template <typename Function>

+  friend class TypedExpectation;

+

+  // Implements the .Times() clause.

+  void UntypedTimes(const Cardinality& a_cardinality);

+

+  // This group of fields are part of the spec and won't change after

+  // an EXPECT_CALL() statement finishes.

+  const char* file_;          // The file that contains the expectation.

+  int line_;                  // The line number of the expectation.

+  const string source_text_;  // The EXPECT_CALL(...) source text.

+  // True iff the cardinality is specified explicitly.

+  bool cardinality_specified_;

+  Cardinality cardinality_;            // The cardinality of the expectation.

+  // The immediate pre-requisites (i.e. expectations that must be

+  // satisfied before this expectation can be matched) of this

+  // expectation.  We use linked_ptr in the set because we want an

+  // Expectation object to be co-owned by its FunctionMocker and its

+  // successors.  This allows multiple mock objects to be deleted at

+  // different times.

+  ExpectationSet immediate_prerequisites_;

+

+  // This group of fields are the current state of the expectation,

+  // and can change as the mock function is called.

+  int call_count_;  // How many times this expectation has been invoked.

+  bool retired_;    // True iff this expectation has retired.

+  UntypedActions untyped_actions_;

+  bool extra_matcher_specified_;

+  bool repeated_action_specified_;  // True if a WillRepeatedly() was specified.

+  bool retires_on_saturation_;

+  Clause last_clause_;

+  mutable bool action_count_checked_;  // Under mutex_.

+  mutable Mutex mutex_;  // Protects action_count_checked_.

+

+  GTEST_DISALLOW_ASSIGN_(ExpectationBase);

+};  // class ExpectationBase

+

+// Impements an expectation for the given function type.

+template <typename F>

+class TypedExpectation : public ExpectationBase {

+ public:

+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;

+  typedef typename Function<F>::Result Result;

+

+  TypedExpectation(FunctionMockerBase<F>* owner,

+                   const char* a_file, int a_line, const string& a_source_text,

+                   const ArgumentMatcherTuple& m)

+      : ExpectationBase(a_file, a_line, a_source_text),

+        owner_(owner),

+        matchers_(m),

+        // By default, extra_matcher_ should match anything.  However,

+        // we cannot initialize it with _ as that triggers a compiler

+        // bug in Symbian's C++ compiler (cannot decide between two

+        // overloaded constructors of Matcher<const ArgumentTuple&>).

+        extra_matcher_(A<const ArgumentTuple&>()),

+        repeated_action_(DoDefault()) {}

+

+  virtual ~TypedExpectation() {

+    // Check the validity of the action count if it hasn't been done

+    // yet (for example, if the expectation was never used).

+    CheckActionCountIfNotDone();

+    for (UntypedActions::const_iterator it = untyped_actions_.begin();

+         it != untyped_actions_.end(); ++it) {

+      delete static_cast<const Action<F>*>(*it);

+    }

+  }

+

+  // Implements the .With() clause.

+  TypedExpectation& With(const Matcher<const ArgumentTuple&>& m) {

+    if (last_clause_ == kWith) {

+      ExpectSpecProperty(false,

+                         ".With() cannot appear "

+                         "more than once in an EXPECT_CALL().");

+    } else {

+      ExpectSpecProperty(last_clause_ < kWith,

+                         ".With() must be the first "

+                         "clause in an EXPECT_CALL().");

+    }

+    last_clause_ = kWith;

+

+    extra_matcher_ = m;

+    extra_matcher_specified_ = true;

+    return *this;

+  }

+

+  // Implements the .Times() clause.

+  TypedExpectation& Times(const Cardinality& a_cardinality) {

+    ExpectationBase::UntypedTimes(a_cardinality);

+    return *this;

+  }

+

+  // Implements the .Times() clause.

+  TypedExpectation& Times(int n) {

+    return Times(Exactly(n));

+  }

+

+  // Implements the .InSequence() clause.

+  TypedExpectation& InSequence(const Sequence& s) {

+    ExpectSpecProperty(last_clause_ <= kInSequence,

+                       ".InSequence() cannot appear after .After(),"

+                       " .WillOnce(), .WillRepeatedly(), or "

+                       ".RetiresOnSaturation().");

+    last_clause_ = kInSequence;

+

+    s.AddExpectation(GetHandle());

+    return *this;

+  }

+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {

+    return InSequence(s1).InSequence(s2);

+  }

+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,

+                               const Sequence& s3) {

+    return InSequence(s1, s2).InSequence(s3);

+  }

+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,

+                               const Sequence& s3, const Sequence& s4) {

+    return InSequence(s1, s2, s3).InSequence(s4);

+  }

+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,

+                               const Sequence& s3, const Sequence& s4,

+                               const Sequence& s5) {

+    return InSequence(s1, s2, s3, s4).InSequence(s5);

+  }

+

+  // Implements that .After() clause.

+  TypedExpectation& After(const ExpectationSet& s) {

+    ExpectSpecProperty(last_clause_ <= kAfter,

+                       ".After() cannot appear after .WillOnce(),"

+                       " .WillRepeatedly(), or "

+                       ".RetiresOnSaturation().");

+    last_clause_ = kAfter;

+

+    for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {

+      immediate_prerequisites_ += *it;

+    }

+    return *this;

+  }

+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2) {

+    return After(s1).After(s2);

+  }

+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,

+                          const ExpectationSet& s3) {

+    return After(s1, s2).After(s3);

+  }

+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,

+                          const ExpectationSet& s3, const ExpectationSet& s4) {

+    return After(s1, s2, s3).After(s4);

+  }

+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,

+                          const ExpectationSet& s3, const ExpectationSet& s4,

+                          const ExpectationSet& s5) {

+    return After(s1, s2, s3, s4).After(s5);

+  }

+

+  // Implements the .WillOnce() clause.

+  TypedExpectation& WillOnce(const Action<F>& action) {

+    ExpectSpecProperty(last_clause_ <= kWillOnce,

+                       ".WillOnce() cannot appear after "

+                       ".WillRepeatedly() or .RetiresOnSaturation().");

+    last_clause_ = kWillOnce;

+

+    untyped_actions_.push_back(new Action<F>(action));

+    if (!cardinality_specified()) {

+      set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));

+    }

+    return *this;

+  }

+

+  // Implements the .WillRepeatedly() clause.

+  TypedExpectation& WillRepeatedly(const Action<F>& action) {

+    if (last_clause_ == kWillRepeatedly) {

+      ExpectSpecProperty(false,

+                         ".WillRepeatedly() cannot appear "

+                         "more than once in an EXPECT_CALL().");

+    } else {

+      ExpectSpecProperty(last_clause_ < kWillRepeatedly,

+                         ".WillRepeatedly() cannot appear "

+                         "after .RetiresOnSaturation().");

+    }

+    last_clause_ = kWillRepeatedly;

+    repeated_action_specified_ = true;

+

+    repeated_action_ = action;

+    if (!cardinality_specified()) {

+      set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));

+    }

+

+    // Now that no more action clauses can be specified, we check

+    // whether their count makes sense.

+    CheckActionCountIfNotDone();

+    return *this;

+  }

+

+  // Implements the .RetiresOnSaturation() clause.

+  TypedExpectation& RetiresOnSaturation() {

+    ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,

+                       ".RetiresOnSaturation() cannot appear "

+                       "more than once.");

+    last_clause_ = kRetiresOnSaturation;

+    retires_on_saturation_ = true;

+

+    // Now that no more action clauses can be specified, we check

+    // whether their count makes sense.

+    CheckActionCountIfNotDone();

+    return *this;

+  }

+

+  // Returns the matchers for the arguments as specified inside the

+  // EXPECT_CALL() macro.

+  const ArgumentMatcherTuple& matchers() const {

+    return matchers_;

+  }

+

+  // Returns the matcher specified by the .With() clause.

+  const Matcher<const ArgumentTuple&>& extra_matcher() const {

+    return extra_matcher_;

+  }

+

+  // Returns the action specified by the .WillRepeatedly() clause.

+  const Action<F>& repeated_action() const { return repeated_action_; }

+

+  // If this mock method has an extra matcher (i.e. .With(matcher)),

+  // describes it to the ostream.

+  virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) {

+    if (extra_matcher_specified_) {

+      *os << "    Expected args: ";

+      extra_matcher_.DescribeTo(os);

+      *os << "\n";

+    }

+  }

+

+ private:

+  template <typename Function>

+  friend class FunctionMockerBase;

+

+  // Returns an Expectation object that references and co-owns this

+  // expectation.

+  virtual Expectation GetHandle() {

+    return owner_->GetHandleOf(this);

+  }

+

+  // The following methods will be called only after the EXPECT_CALL()

+  // statement finishes and when the current thread holds

+  // g_gmock_mutex.

+

+  // Returns true iff this expectation matches the given arguments.

+  bool Matches(const ArgumentTuple& args) const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);

+  }

+

+  // Returns true iff this expectation should handle the given arguments.

+  bool ShouldHandleArguments(const ArgumentTuple& args) const

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+

+    // In case the action count wasn't checked when the expectation

+    // was defined (e.g. if this expectation has no WillRepeatedly()

+    // or RetiresOnSaturation() clause), we check it when the

+    // expectation is used for the first time.

+    CheckActionCountIfNotDone();

+    return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);

+  }

+

+  // Describes the result of matching the arguments against this

+  // expectation to the given ostream.

+  void ExplainMatchResultTo(

+      const ArgumentTuple& args,

+      ::std::ostream* os) const

+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+

+    if (is_retired()) {

+      *os << "         Expected: the expectation is active\n"

+          << "           Actual: it is retired\n";

+    } else if (!Matches(args)) {

+      if (!TupleMatches(matchers_, args)) {

+        ExplainMatchFailureTupleTo(matchers_, args, os);

+      }

+      StringMatchResultListener listener;

+      if (!extra_matcher_.MatchAndExplain(args, &listener)) {

+        *os << "    Expected args: ";

+        extra_matcher_.DescribeTo(os);

+        *os << "\n           Actual: don't match";

+

+        internal::PrintIfNotEmpty(listener.str(), os);

+        *os << "\n";

+      }

+    } else if (!AllPrerequisitesAreSatisfied()) {

+      *os << "         Expected: all pre-requisites are satisfied\n"

+          << "           Actual: the following immediate pre-requisites "

+          << "are not satisfied:\n";

+      ExpectationSet unsatisfied_prereqs;

+      FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);

+      int i = 0;

+      for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();

+           it != unsatisfied_prereqs.end(); ++it) {

+        it->expectation_base()->DescribeLocationTo(os);

+        *os << "pre-requisite #" << i++ << "\n";

+      }

+      *os << "                   (end of pre-requisites)\n";

+    } else {

+      // This line is here just for completeness' sake.  It will never

+      // be executed as currently the ExplainMatchResultTo() function

+      // is called only when the mock function call does NOT match the

+      // expectation.

+      *os << "The call matches the expectation.\n";

+    }

+  }

+

+  // Returns the action that should be taken for the current invocation.

+  const Action<F>& GetCurrentAction(

+      const FunctionMockerBase<F>* mocker,

+      const ArgumentTuple& args) const

+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    const int count = call_count();

+    Assert(count >= 1, __FILE__, __LINE__,

+           "call_count() is <= 0 when GetCurrentAction() is "

+           "called - this should never happen.");

+

+    const int action_count = static_cast<int>(untyped_actions_.size());

+    if (action_count > 0 && !repeated_action_specified_ &&

+        count > action_count) {

+      // If there is at least one WillOnce() and no WillRepeatedly(),

+      // we warn the user when the WillOnce() clauses ran out.

+      ::std::stringstream ss;

+      DescribeLocationTo(&ss);

+      ss << "Actions ran out in " << source_text() << "...\n"

+         << "Called " << count << " times, but only "

+         << action_count << " WillOnce()"

+         << (action_count == 1 ? " is" : "s are") << " specified - ";

+      mocker->DescribeDefaultActionTo(args, &ss);

+      Log(kWarning, ss.str(), 1);

+    }

+

+    return count <= action_count ?

+        *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :

+        repeated_action();

+  }

+

+  // Given the arguments of a mock function call, if the call will

+  // over-saturate this expectation, returns the default action;

+  // otherwise, returns the next action in this expectation.  Also

+  // describes *what* happened to 'what', and explains *why* Google

+  // Mock does it to 'why'.  This method is not const as it calls

+  // IncrementCallCount().  A return value of NULL means the default

+  // action.

+  const Action<F>* GetActionForArguments(

+      const FunctionMockerBase<F>* mocker,

+      const ArgumentTuple& args,

+      ::std::ostream* what,

+      ::std::ostream* why)

+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    if (IsSaturated()) {

+      // We have an excessive call.

+      IncrementCallCount();

+      *what << "Mock function called more times than expected - ";

+      mocker->DescribeDefaultActionTo(args, what);

+      DescribeCallCountTo(why);

+

+      // TODO(wan@google.com): allow the user to control whether

+      // unexpected calls should fail immediately or continue using a

+      // flag --gmock_unexpected_calls_are_fatal.

+      return NULL;

+    }

+

+    IncrementCallCount();

+    RetireAllPreRequisites();

+

+    if (retires_on_saturation_ && IsSaturated()) {

+      Retire();

+    }

+

+    // Must be done after IncrementCount()!

+    *what << "Mock function call matches " << source_text() <<"...\n";

+    return &(GetCurrentAction(mocker, args));

+  }

+

+  // All the fields below won't change once the EXPECT_CALL()

+  // statement finishes.

+  FunctionMockerBase<F>* const owner_;

+  ArgumentMatcherTuple matchers_;

+  Matcher<const ArgumentTuple&> extra_matcher_;

+  Action<F> repeated_action_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TypedExpectation);

+};  // class TypedExpectation

+

+// A MockSpec object is used by ON_CALL() or EXPECT_CALL() for

+// specifying the default behavior of, or expectation on, a mock

+// function.

+

+// Note: class MockSpec really belongs to the ::testing namespace.

+// However if we define it in ::testing, MSVC will complain when

+// classes in ::testing::internal declare it as a friend class

+// template.  To workaround this compiler bug, we define MockSpec in

+// ::testing::internal and import it into ::testing.

+

+// Logs a message including file and line number information.

+GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,

+                                const char* file, int line,

+                                const string& message);

+

+template <typename F>

+class MockSpec {

+ public:

+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;

+  typedef typename internal::Function<F>::ArgumentMatcherTuple

+      ArgumentMatcherTuple;

+

+  // Constructs a MockSpec object, given the function mocker object

+  // that the spec is associated with.

+  explicit MockSpec(internal::FunctionMockerBase<F>* function_mocker)

+      : function_mocker_(function_mocker) {}

+

+  // Adds a new default action spec to the function mocker and returns

+  // the newly created spec.

+  internal::OnCallSpec<F>& InternalDefaultActionSetAt(

+      const char* file, int line, const char* obj, const char* call) {

+    LogWithLocation(internal::kInfo, file, line,

+        string("ON_CALL(") + obj + ", " + call + ") invoked");

+    return function_mocker_->AddNewOnCallSpec(file, line, matchers_);

+  }

+

+  // Adds a new expectation spec to the function mocker and returns

+  // the newly created spec.

+  internal::TypedExpectation<F>& InternalExpectedAt(

+      const char* file, int line, const char* obj, const char* call) {

+    const string source_text(string("EXPECT_CALL(") + obj + ", " + call + ")");

+    LogWithLocation(internal::kInfo, file, line, source_text + " invoked");

+    return function_mocker_->AddNewExpectation(

+        file, line, source_text, matchers_);

+  }

+

+ private:

+  template <typename Function>

+  friend class internal::FunctionMocker;

+

+  void SetMatchers(const ArgumentMatcherTuple& matchers) {

+    matchers_ = matchers;

+  }

+

+  // The function mocker that owns this spec.

+  internal::FunctionMockerBase<F>* const function_mocker_;

+  // The argument matchers specified in the spec.

+  ArgumentMatcherTuple matchers_;

+

+  GTEST_DISALLOW_ASSIGN_(MockSpec);

+};  // class MockSpec

+

+// MSVC warns about using 'this' in base member initializer list, so

+// we need to temporarily disable the warning.  We have to do it for

+// the entire class to suppress the warning, even though it's about

+// the constructor only.

+

+#ifdef _MSC_VER

+# pragma warning(push)          // Saves the current warning state.

+# pragma warning(disable:4355)  // Temporarily disables warning 4355.

+#endif  // _MSV_VER

+

+// C++ treats the void type specially.  For example, you cannot define

+// a void-typed variable or pass a void value to a function.

+// ActionResultHolder<T> holds a value of type T, where T must be a

+// copyable type or void (T doesn't need to be default-constructable).

+// It hides the syntactic difference between void and other types, and

+// is used to unify the code for invoking both void-returning and

+// non-void-returning mock functions.

+

+// Untyped base class for ActionResultHolder<T>.

+class UntypedActionResultHolderBase {

+ public:

+  virtual ~UntypedActionResultHolderBase() {}

+

+  // Prints the held value as an action's result to os.

+  virtual void PrintAsActionResult(::std::ostream* os) const = 0;

+};

+

+// This generic definition is used when T is not void.

+template <typename T>

+class ActionResultHolder : public UntypedActionResultHolderBase {

+ public:

+  explicit ActionResultHolder(T a_value) : value_(a_value) {}

+

+  // The compiler-generated copy constructor and assignment operator

+  // are exactly what we need, so we don't need to define them.

+

+  // Returns the held value and deletes this object.

+  T GetValueAndDelete() const {

+    T retval(value_);

+    delete this;

+    return retval;

+  }

+

+  // Prints the held value as an action's result to os.

+  virtual void PrintAsActionResult(::std::ostream* os) const {

+    *os << "\n          Returns: ";

+    // T may be a reference type, so we don't use UniversalPrint().

+    UniversalPrinter<T>::Print(value_, os);

+  }

+

+  // Performs the given mock function's default action and returns the

+  // result in a new-ed ActionResultHolder.

+  template <typename F>

+  static ActionResultHolder* PerformDefaultAction(

+      const FunctionMockerBase<F>* func_mocker,

+      const typename Function<F>::ArgumentTuple& args,

+      const string& call_description) {

+    return new ActionResultHolder(

+        func_mocker->PerformDefaultAction(args, call_description));

+  }

+

+  // Performs the given action and returns the result in a new-ed

+  // ActionResultHolder.

+  template <typename F>

+  static ActionResultHolder*

+  PerformAction(const Action<F>& action,

+                const typename Function<F>::ArgumentTuple& args) {

+    return new ActionResultHolder(action.Perform(args));

+  }

+

+ private:

+  T value_;

+

+  // T could be a reference type, so = isn't supported.

+  GTEST_DISALLOW_ASSIGN_(ActionResultHolder);

+};

+

+// Specialization for T = void.

+template <>

+class ActionResultHolder<void> : public UntypedActionResultHolderBase {

+ public:

+  void GetValueAndDelete() const { delete this; }

+

+  virtual void PrintAsActionResult(::std::ostream* /* os */) const {}

+

+  // Performs the given mock function's default action and returns NULL;

+  template <typename F>

+  static ActionResultHolder* PerformDefaultAction(

+      const FunctionMockerBase<F>* func_mocker,

+      const typename Function<F>::ArgumentTuple& args,

+      const string& call_description) {

+    func_mocker->PerformDefaultAction(args, call_description);

+    return NULL;

+  }

+

+  // Performs the given action and returns NULL.

+  template <typename F>

+  static ActionResultHolder* PerformAction(

+      const Action<F>& action,

+      const typename Function<F>::ArgumentTuple& args) {

+    action.Perform(args);

+    return NULL;

+  }

+};

+

+// The base of the function mocker class for the given function type.

+// We put the methods in this class instead of its child to avoid code

+// bloat.

+template <typename F>

+class FunctionMockerBase : public UntypedFunctionMockerBase {

+ public:

+  typedef typename Function<F>::Result Result;

+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;

+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;

+

+  FunctionMockerBase() : current_spec_(this) {}

+

+  // The destructor verifies that all expectations on this mock

+  // function have been satisfied.  If not, it will report Google Test

+  // non-fatal failures for the violations.

+  virtual ~FunctionMockerBase()

+        GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+    MutexLock l(&g_gmock_mutex);

+    VerifyAndClearExpectationsLocked();

+    Mock::UnregisterLocked(this);

+    ClearDefaultActionsLocked();

+  }

+

+  // Returns the ON_CALL spec that matches this mock function with the

+  // given arguments; returns NULL if no matching ON_CALL is found.

+  // L = *

+  const OnCallSpec<F>* FindOnCallSpec(

+      const ArgumentTuple& args) const {

+    for (UntypedOnCallSpecs::const_reverse_iterator it

+             = untyped_on_call_specs_.rbegin();

+         it != untyped_on_call_specs_.rend(); ++it) {

+      const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it);

+      if (spec->Matches(args))

+        return spec;

+    }

+

+    return NULL;

+  }

+

+  // Performs the default action of this mock function on the given

+  // arguments and returns the result. Asserts (or throws if

+  // exceptions are enabled) with a helpful call descrption if there

+  // is no valid return value. This method doesn't depend on the

+  // mutable state of this object, and thus can be called concurrently

+  // without locking.

+  // L = *

+  Result PerformDefaultAction(const ArgumentTuple& args,

+                              const string& call_description) const {

+    const OnCallSpec<F>* const spec =

+        this->FindOnCallSpec(args);

+    if (spec != NULL) {

+      return spec->GetAction().Perform(args);

+    }

+    const string message = call_description +

+        "\n    The mock function has no default action "

+        "set, and its return type has no default value set.";

+#if GTEST_HAS_EXCEPTIONS

+    if (!DefaultValue<Result>::Exists()) {

+      throw std::runtime_error(message);

+    }

+#else

+    Assert(DefaultValue<Result>::Exists(), "", -1, message);

+#endif

+    return DefaultValue<Result>::Get();

+  }

+

+  // Performs the default action with the given arguments and returns

+  // the action's result.  The call description string will be used in

+  // the error message to describe the call in the case the default

+  // action fails.  The caller is responsible for deleting the result.

+  // L = *

+  virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(

+      const void* untyped_args,  // must point to an ArgumentTuple

+      const string& call_description) const {

+    const ArgumentTuple& args =

+        *static_cast<const ArgumentTuple*>(untyped_args);

+    return ResultHolder::PerformDefaultAction(this, args, call_description);

+  }

+

+  // Performs the given action with the given arguments and returns

+  // the action's result.  The caller is responsible for deleting the

+  // result.

+  // L = *

+  virtual UntypedActionResultHolderBase* UntypedPerformAction(

+      const void* untyped_action, const void* untyped_args) const {

+    // Make a copy of the action before performing it, in case the

+    // action deletes the mock object (and thus deletes itself).

+    const Action<F> action = *static_cast<const Action<F>*>(untyped_action);

+    const ArgumentTuple& args =

+        *static_cast<const ArgumentTuple*>(untyped_args);

+    return ResultHolder::PerformAction(action, args);

+  }

+

+  // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():

+  // clears the ON_CALL()s set on this mock function.

+  virtual void ClearDefaultActionsLocked()

+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+

+    // Deleting our default actions may trigger other mock objects to be

+    // deleted, for example if an action contains a reference counted smart

+    // pointer to that mock object, and that is the last reference. So if we

+    // delete our actions within the context of the global mutex we may deadlock

+    // when this method is called again. Instead, make a copy of the set of

+    // actions to delete, clear our set within the mutex, and then delete the

+    // actions outside of the mutex.

+    UntypedOnCallSpecs specs_to_delete;

+    untyped_on_call_specs_.swap(specs_to_delete);

+

+    g_gmock_mutex.Unlock();

+    for (UntypedOnCallSpecs::const_iterator it =

+             specs_to_delete.begin();

+         it != specs_to_delete.end(); ++it) {

+      delete static_cast<const OnCallSpec<F>*>(*it);

+    }

+

+    // Lock the mutex again, since the caller expects it to be locked when we

+    // return.

+    g_gmock_mutex.Lock();

+  }

+

+ protected:

+  template <typename Function>

+  friend class MockSpec;

+

+  typedef ActionResultHolder<Result> ResultHolder;

+

+  // Returns the result of invoking this mock function with the given

+  // arguments.  This function can be safely called from multiple

+  // threads concurrently.

+  Result InvokeWith(const ArgumentTuple& args)

+        GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+    return static_cast<const ResultHolder*>(

+        this->UntypedInvokeWith(&args))->GetValueAndDelete();

+  }

+

+  // Adds and returns a default action spec for this mock function.

+  OnCallSpec<F>& AddNewOnCallSpec(

+      const char* file, int line,

+      const ArgumentMatcherTuple& m)

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+    Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);

+    OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m);

+    untyped_on_call_specs_.push_back(on_call_spec);

+    return *on_call_spec;

+  }

+

+  // Adds and returns an expectation spec for this mock function.

+  TypedExpectation<F>& AddNewExpectation(

+      const char* file,

+      int line,

+      const string& source_text,

+      const ArgumentMatcherTuple& m)

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+    Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);

+    TypedExpectation<F>* const expectation =

+        new TypedExpectation<F>(this, file, line, source_text, m);

+    const linked_ptr<ExpectationBase> untyped_expectation(expectation);

+    untyped_expectations_.push_back(untyped_expectation);

+

+    // Adds this expectation into the implicit sequence if there is one.

+    Sequence* const implicit_sequence = g_gmock_implicit_sequence.get();

+    if (implicit_sequence != NULL) {

+      implicit_sequence->AddExpectation(Expectation(untyped_expectation));

+    }

+

+    return *expectation;

+  }

+

+  // The current spec (either default action spec or expectation spec)

+  // being described on this function mocker.

+  MockSpec<F>& current_spec() { return current_spec_; }

+

+ private:

+  template <typename Func> friend class TypedExpectation;

+

+  // Some utilities needed for implementing UntypedInvokeWith().

+

+  // Describes what default action will be performed for the given

+  // arguments.

+  // L = *

+  void DescribeDefaultActionTo(const ArgumentTuple& args,

+                               ::std::ostream* os) const {

+    const OnCallSpec<F>* const spec = FindOnCallSpec(args);

+

+    if (spec == NULL) {

+      *os << (internal::type_equals<Result, void>::value ?

+              "returning directly.\n" :

+              "returning default value.\n");

+    } else {

+      *os << "taking default action specified at:\n"

+          << FormatFileLocation(spec->file(), spec->line()) << "\n";

+    }

+  }

+

+  // Writes a message that the call is uninteresting (i.e. neither

+  // explicitly expected nor explicitly unexpected) to the given

+  // ostream.

+  virtual void UntypedDescribeUninterestingCall(

+      const void* untyped_args,

+      ::std::ostream* os) const

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+    const ArgumentTuple& args =

+        *static_cast<const ArgumentTuple*>(untyped_args);

+    *os << "Uninteresting mock function call - ";

+    DescribeDefaultActionTo(args, os);

+    *os << "    Function call: " << Name();

+    UniversalPrint(args, os);

+  }

+

+  // Returns the expectation that matches the given function arguments

+  // (or NULL is there's no match); when a match is found,

+  // untyped_action is set to point to the action that should be

+  // performed (or NULL if the action is "do default"), and

+  // is_excessive is modified to indicate whether the call exceeds the

+  // expected number.

+  //

+  // Critical section: We must find the matching expectation and the

+  // corresponding action that needs to be taken in an ATOMIC

+  // transaction.  Otherwise another thread may call this mock

+  // method in the middle and mess up the state.

+  //

+  // However, performing the action has to be left out of the critical

+  // section.  The reason is that we have no control on what the

+  // action does (it can invoke an arbitrary user function or even a

+  // mock function) and excessive locking could cause a dead lock.

+  virtual const ExpectationBase* UntypedFindMatchingExpectation(

+      const void* untyped_args,

+      const void** untyped_action, bool* is_excessive,

+      ::std::ostream* what, ::std::ostream* why)

+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+    const ArgumentTuple& args =

+        *static_cast<const ArgumentTuple*>(untyped_args);

+    MutexLock l(&g_gmock_mutex);

+    TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);

+    if (exp == NULL) {  // A match wasn't found.

+      this->FormatUnexpectedCallMessageLocked(args, what, why);

+      return NULL;

+    }

+

+    // This line must be done before calling GetActionForArguments(),

+    // which will increment the call count for *exp and thus affect

+    // its saturation status.

+    *is_excessive = exp->IsSaturated();

+    const Action<F>* action = exp->GetActionForArguments(this, args, what, why);

+    if (action != NULL && action->IsDoDefault())

+      action = NULL;  // Normalize "do default" to NULL.

+    *untyped_action = action;

+    return exp;

+  }

+

+  // Prints the given function arguments to the ostream.

+  virtual void UntypedPrintArgs(const void* untyped_args,

+                                ::std::ostream* os) const {

+    const ArgumentTuple& args =

+        *static_cast<const ArgumentTuple*>(untyped_args);

+    UniversalPrint(args, os);

+  }

+

+  // Returns the expectation that matches the arguments, or NULL if no

+  // expectation matches them.

+  TypedExpectation<F>* FindMatchingExpectationLocked(

+      const ArgumentTuple& args) const

+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    for (typename UntypedExpectations::const_reverse_iterator it =

+             untyped_expectations_.rbegin();

+         it != untyped_expectations_.rend(); ++it) {

+      TypedExpectation<F>* const exp =

+          static_cast<TypedExpectation<F>*>(it->get());

+      if (exp->ShouldHandleArguments(args)) {

+        return exp;

+      }

+    }

+    return NULL;

+  }

+

+  // Returns a message that the arguments don't match any expectation.

+  void FormatUnexpectedCallMessageLocked(

+      const ArgumentTuple& args,

+      ::std::ostream* os,

+      ::std::ostream* why) const

+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    *os << "\nUnexpected mock function call - ";

+    DescribeDefaultActionTo(args, os);

+    PrintTriedExpectationsLocked(args, why);

+  }

+

+  // Prints a list of expectations that have been tried against the

+  // current mock function call.

+  void PrintTriedExpectationsLocked(

+      const ArgumentTuple& args,

+      ::std::ostream* why) const

+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+    g_gmock_mutex.AssertHeld();

+    const int count = static_cast<int>(untyped_expectations_.size());

+    *why << "Google Mock tried the following " << count << " "

+         << (count == 1 ? "expectation, but it didn't match" :

+             "expectations, but none matched")

+         << ":\n";

+    for (int i = 0; i < count; i++) {

+      TypedExpectation<F>* const expectation =

+          static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());

+      *why << "\n";

+      expectation->DescribeLocationTo(why);

+      if (count > 1) {

+        *why << "tried expectation #" << i << ": ";

+      }

+      *why << expectation->source_text() << "...\n";

+      expectation->ExplainMatchResultTo(args, why);

+      expectation->DescribeCallCountTo(why);

+    }

+  }

+

+  // The current spec (either default action spec or expectation spec)

+  // being described on this function mocker.

+  MockSpec<F> current_spec_;

+

+  // There is no generally useful and implementable semantics of

+  // copying a mock object, so copying a mock is usually a user error.

+  // Thus we disallow copying function mockers.  If the user really

+  // wants to copy a mock object, he should implement his own copy

+  // operation, for example:

+  //

+  //   class MockFoo : public Foo {

+  //    public:

+  //     // Defines a copy constructor explicitly.

+  //     MockFoo(const MockFoo& src) {}

+  //     ...

+  //   };

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(FunctionMockerBase);

+};  // class FunctionMockerBase

+

+#ifdef _MSC_VER

+# pragma warning(pop)  // Restores the warning state.

+#endif  // _MSV_VER

+

+// Implements methods of FunctionMockerBase.

+

+// Verifies that all expectations on this mock function have been

+// satisfied.  Reports one or more Google Test non-fatal failures and

+// returns false if not.

+

+// Reports an uninteresting call (whose description is in msg) in the

+// manner specified by 'reaction'.

+void ReportUninterestingCall(CallReaction reaction, const string& msg);

+

+}  // namespace internal

+

+// The style guide prohibits "using" statements in a namespace scope

+// inside a header file.  However, the MockSpec class template is

+// meant to be defined in the ::testing namespace.  The following line

+// is just a trick for working around a bug in MSVC 8.0, which cannot

+// handle it if we define MockSpec in ::testing.

+using internal::MockSpec;

+

+// Const(x) is a convenient function for obtaining a const reference

+// to x.  This is useful for setting expectations on an overloaded

+// const mock method, e.g.

+//

+//   class MockFoo : public FooInterface {

+//    public:

+//     MOCK_METHOD0(Bar, int());

+//     MOCK_CONST_METHOD0(Bar, int&());

+//   };

+//

+//   MockFoo foo;

+//   // Expects a call to non-const MockFoo::Bar().

+//   EXPECT_CALL(foo, Bar());

+//   // Expects a call to const MockFoo::Bar().

+//   EXPECT_CALL(Const(foo), Bar());

+template <typename T>

+inline const T& Const(const T& x) { return x; }

+

+// Constructs an Expectation object that references and co-owns exp.

+inline Expectation::Expectation(internal::ExpectationBase& exp)  // NOLINT

+    : expectation_base_(exp.GetHandle().expectation_base()) {}

+

+}  // namespace testing

+

+// A separate macro is required to avoid compile errors when the name

+// of the method used in call is a result of macro expansion.

+// See CompilesWithMethodNameExpandedFromMacro tests in

+// internal/gmock-spec-builders_test.cc for more details.

+#define GMOCK_ON_CALL_IMPL_(obj, call) \

+    ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \

+                                                    #obj, #call)

+#define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call)

+

+#define GMOCK_EXPECT_CALL_IMPL_(obj, call) \

+    ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)

+#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/gmock.h b/third_party/allwpilib_2018/gmock/include/gmock/gmock.h
new file mode 100644
index 0000000..f183eb0
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/gmock.h
@@ -0,0 +1,94 @@
+// 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.

+

+#include "gmock/gmock-actions.h"

+#include "gmock/gmock-cardinalities.h"

+#include "gmock/gmock-generated-actions.h"

+#include "gmock/gmock-generated-function-mockers.h"

+#include "gmock/gmock-generated-nice-strict.h"

+#include "gmock/gmock-generated-matchers.h"

+#include "gmock/gmock-matchers.h"

+#include "gmock/gmock-more-actions.h"

+#include "gmock/gmock-more-matchers.h"

+#include "gmock/internal/gmock-internal-utils.h"

+

+namespace testing {

+

+// Declares Google Mock flags that we want a user to use programmatically.

+GMOCK_DECLARE_bool_(catch_leaked_mocks);

+GMOCK_DECLARE_string_(verbose);

+

+// Initializes Google Mock.  This must be called before running the

+// tests.  In particular, it parses the command line for the flags

+// that Google Mock recognizes.  Whenever a Google Mock flag is seen,

+// it is removed from argv, and *argc is decremented.

+//

+// No value is returned.  Instead, the Google Mock flag variables are

+// updated.

+//

+// Since Google Test is needed for Google Mock to work, this function

+// also initializes Google Test and parses its flags, if that hasn't

+// been done.

+GTEST_API_ void InitGoogleMock(int* argc, char** argv);

+

+// This overloaded version can be used in Windows programs compiled in

+// UNICODE mode.

+GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv);

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h
new file mode 100644
index 0000000..109084d
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h
@@ -0,0 +1,279 @@
+// 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_

+

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+

+template <typename T>

+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 <typename T>

+  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)

+};

+

+// MatcherTuple<T>::type is a tuple type where each field is a Matcher

+// for the corresponding field in tuple type T.

+template <typename Tuple>

+struct MatcherTuple;

+

+template <>

+struct MatcherTuple< ::std::tr1::tuple<> > {

+  typedef ::std::tr1::tuple< > type;

+};

+

+template <typename A1>

+struct MatcherTuple< ::std::tr1::tuple<A1> > {

+  typedef ::std::tr1::tuple<Matcher<A1> > type;

+};

+

+template <typename A1, typename A2>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2> > type;

+};

+

+template <typename A1, typename A2, typename A3>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,

+      Matcher<A4> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4, typename A5>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,

+      Matcher<A5> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4, typename A5,

+    typename A6>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,

+      Matcher<A5>, Matcher<A6> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4, typename A5,

+    typename A6, typename A7>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,

+      Matcher<A5>, Matcher<A6>, Matcher<A7> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4, typename A5,

+    typename A6, typename A7, typename A8>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,

+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4, typename A5,

+    typename A6, typename A7, typename A8, typename A9>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,

+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;

+};

+

+template <typename A1, typename A2, typename A3, typename A4, typename A5,

+    typename A6, typename A7, typename A8, typename A9, typename A10>

+struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,

+    A10> > {

+  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,

+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,

+      Matcher<A10> > type;

+};

+

+// Template struct Function<F>, 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 <typename F>

+struct Function;

+

+template <typename R>

+struct Function<R()> {

+  typedef R Result;

+  typedef ::std::tr1::tuple<> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid();

+  typedef IgnoredValue MakeResultIgnoredValue();

+};

+

+template <typename R, typename A1>

+struct Function<R(A1)>

+    : Function<R()> {

+  typedef A1 Argument1;

+  typedef ::std::tr1::tuple<A1> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1);

+  typedef IgnoredValue MakeResultIgnoredValue(A1);

+};

+

+template <typename R, typename A1, typename A2>

+struct Function<R(A1, A2)>

+    : Function<R(A1)> {

+  typedef A2 Argument2;

+  typedef ::std::tr1::tuple<A1, A2> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1, A2);

+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2);

+};

+

+template <typename R, typename A1, typename A2, typename A3>

+struct Function<R(A1, A2, A3)>

+    : Function<R(A1, A2)> {

+  typedef A3 Argument3;

+  typedef ::std::tr1::tuple<A1, A2, A3> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1, A2, A3);

+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4>

+struct Function<R(A1, A2, A3, A4)>

+    : Function<R(A1, A2, A3)> {

+  typedef A4 Argument4;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1, A2, A3, A4);

+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5>

+struct Function<R(A1, A2, A3, A4, A5)>

+    : Function<R(A1, A2, A3, A4)> {

+  typedef A5 Argument5;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1, A2, A3, A4, A5);

+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6>

+struct Function<R(A1, A2, A3, A4, A5, A6)>

+    : Function<R(A1, A2, A3, A4, A5)> {

+  typedef A6 Argument6;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);

+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7>

+struct Function<R(A1, A2, A3, A4, A5, A6, A7)>

+    : Function<R(A1, A2, A3, A4, A5, A6)> {

+  typedef A7 Argument7;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);

+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);

+};

+

+template <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8>

+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>

+    : Function<R(A1, A2, A3, A4, A5, A6, A7)> {

+  typedef A8 Argument8;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::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 <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8, typename A9>

+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>

+    : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {

+  typedef A9 Argument9;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::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 <typename R, typename A1, typename A2, typename A3, typename A4,

+    typename A5, typename A6, typename A7, typename A8, typename A9,

+    typename A10>

+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>

+    : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {

+  typedef A10 Argument10;

+  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,

+      A10> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::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_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump
new file mode 100644
index 0000000..fb08a8a
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump
@@ -0,0 +1,136 @@
+$$ -*- mode: c++; -*-

+$$ This is a Pump source file.  Please use Pump to convert it to

+$$ gmock-generated-function-mockers.h.

+$$

+$var n = 10  $$ The maximum arity we support.

+// 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_

+

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+

+template <typename T>

+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 <typename T>

+  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)

+};

+

+// MatcherTuple<T>::type is a tuple type where each field is a Matcher

+// for the corresponding field in tuple type T.

+template <typename Tuple>

+struct MatcherTuple;

+

+

+$range i 0..n

+$for i [[

+$range j 1..i

+$var typename_As = [[$for j, [[typename A$j]]]]

+$var As = [[$for j, [[A$j]]]]

+$var matcher_As = [[$for j, [[Matcher<A$j>]]]]

+template <$typename_As>

+struct MatcherTuple< ::std::tr1::tuple<$As> > {

+  typedef ::std::tr1::tuple<$matcher_As > type;

+};

+

+

+]]

+// Template struct Function<F>, 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 <typename F>

+struct Function;

+

+template <typename R>

+struct Function<R()> {

+  typedef R Result;

+  typedef ::std::tr1::tuple<> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid();

+  typedef IgnoredValue MakeResultIgnoredValue();

+};

+

+

+$range i 1..n

+$for i [[

+$range j 1..i

+$var typename_As = [[$for j [[, typename A$j]]]]

+$var As = [[$for j, [[A$j]]]]

+$var matcher_As = [[$for j, [[Matcher<A$j>]]]]

+$range k 1..i-1

+$var prev_As = [[$for k, [[A$k]]]]

+template <typename R$typename_As>

+struct Function<R($As)>

+    : Function<R($prev_As)> {

+  typedef A$i Argument$i;

+  typedef ::std::tr1::tuple<$As> ArgumentTuple;

+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;

+  typedef void MakeResultVoid($As);

+  typedef IgnoredValue MakeResultIgnoredValue($As);

+};

+

+

+]]

+}  // namespace internal

+

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-internal-utils.h b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-internal-utils.h
new file mode 100644
index 0000000..9ea4e7e
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-internal-utils.h
@@ -0,0 +1,498 @@
+// 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 <stdio.h>

+#include <ostream>  // NOLINT

+#include <string>

+

+#include "gmock/internal/gmock-generated-internal-utils.h"

+#include "gmock/internal/gmock-port.h"

+#include "gtest/gtest.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<Pointer>::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 <typename Pointer>

+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 <typename T>

+struct PointeeOf<T*> { 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 <typename Pointer>

+inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {

+  return p.get();

+}

+// This overloaded version is for the raw pointer case.

+template <typename Element>

+inline Element* GetRawPointer(Element* p) { return p; }

+

+// This comparator allows linked_ptr to be stored in sets.

+template <typename T>

+struct LinkedPtrLessThan {

+  bool operator()(const ::testing::internal::linked_ptr<T>& lhs,

+                  const ::testing::internal::linked_ptr<T>& 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<T>::value is the kind of type T.

+template <typename T> 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<type> { 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<type>::value)

+

+// Evaluates to true iff integer type T is signed.

+#define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)

+

+// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::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 <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>

+struct LosslessArithmeticConvertibleImpl : public false_type {};

+

+// Converting bool to bool is lossless.

+template <>

+struct LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>

+    : public true_type {};  // NOLINT

+

+// Converting bool to any integer type is lossless.

+template <typename To>

+struct LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>

+    : public true_type {};  // NOLINT

+

+// Converting bool to any floating-point type is lossless.

+template <typename To>

+struct LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>

+    : public true_type {};  // NOLINT

+

+// Converting an integer to bool is lossy.

+template <typename From>

+struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>

+    : 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 <typename From, typename To>

+struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>

+    : 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 <typename From, typename To>

+struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>

+    : public false_type {};  // NOLINT

+

+// Converting a floating-point to bool is lossy.

+template <typename From>

+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>

+    : public false_type {};  // NOLINT

+

+// Converting a floating-point to an integer is lossy.

+template <typename From, typename To>

+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>

+    : 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 <typename From, typename To>

+struct LosslessArithmeticConvertibleImpl<

+  kFloatingPoint, From, kFloatingPoint, To>

+    : public bool_constant<sizeof(From) <= sizeof(To)> {};  // NOLINT

+

+// LosslessArithmeticConvertible<From, To>::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 <typename From, typename To>

+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<T>::value is non-zero iff T is a reference type.

+template <typename T> struct is_reference : public false_type {};

+template <typename T> struct is_reference<T&> : public true_type {};

+

+// type_equals<T1, T2>::value is non-zero iff T1 and T2 are the same type.

+template <typename T1, typename T2> struct type_equals : public false_type {};

+template <typename T> struct type_equals<T, T> : public true_type {};

+

+// remove_reference<T>::type removes the reference from type T, if any.

+template <typename T> struct remove_reference { typedef T type; };  // NOLINT

+template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT

+

+// DecayArray<T>::type turns an array type U[N] to const U* and preserves

+// other types.  Useful for saving a copy of a function argument.

+template <typename T> struct DecayArray { typedef T type; };  // NOLINT

+template <typename T, size_t N> struct DecayArray<T[N]> {

+  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 <typename T> struct DecayArray<T[]> {

+  typedef const T* type;

+};

+

+// Invalid<T>() 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 <typename T>

+inline T Invalid() {

+  return const_cast<typename remove_reference<T>::type&>(

+      *static_cast<volatile typename remove_reference<T>::type*>(NULL));

+}

+template <>

+inline void Invalid<void>() {}

+

+// 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<RawContainer> 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 RawContainer>

+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<RawContainer,

+        GTEST_REMOVE_CONST_(RawContainer)>();

+    return container;

+  }

+  static type Copy(const RawContainer& container) { return container; }

+};

+

+// This specialization is used when RawContainer is a native array type.

+template <typename Element, size_t N>

+class StlContainerView<Element[N]> {

+ public:

+  typedef GTEST_REMOVE_CONST_(Element) RawElement;

+  typedef internal::NativeArray<RawElement> type;

+  // NativeArray<T> 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<Element, RawElement>();

+#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<char *>].NativeArray(

+    //     {lval} const char *[4], long, testing::internal::RelationToSource)'

+    //     does not match

+    // 'testing::internal::NativeArray<char *>::NativeArray(

+    //     char *const *, unsigned int, testing::internal::RelationToSource)'

+    // (instantiating: 'testing::internal::ContainsMatcherImpl

+    //     <const char * (&)[4]>::Matches(const char * (&)[4]) const')

+    // (instantiating: 'testing::internal::StlContainerView<char *[4]>::

+    //     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<Element*>(&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<Element*>(&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 <typename ElementPointer, typename Size>

+class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {

+ public:

+  typedef GTEST_REMOVE_CONST_(

+      typename internal::PointeeOf<ElementPointer>::type) RawElement;

+  typedef internal::NativeArray<RawElement> type;

+  typedef const type const_reference;

+

+  static const_reference ConstReference(

+      const ::std::tr1::tuple<ElementPointer, Size>& array) {

+    using ::std::tr1::get;

+    return type(get<0>(array), get<1>(array), kReference);

+  }

+  static type Copy(const ::std::tr1::tuple<ElementPointer, Size>& 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 <typename T> class StlContainerView<T&>;

+

+// 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 <typename T>

+struct RemoveConstFromKey {

+  typedef T type;

+};

+

+// Partially specialized to remove constness from std::pair<const K, V>.

+template <typename K, typename V>

+struct RemoveConstFromKey<std::pair<const K, V> > {

+  typedef std::pair<K, V> type;

+};

+

+// Mapping from booleans to types. Similar to boost::bool_<kValue> and

+// std::integral_constant<bool, kValue>.

+template <bool kValue>

+struct BooleanConstant {};

+

+}  // namespace internal

+}  // namespace testing

+

+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_

diff --git a/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-port.h b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-port.h
new file mode 100644
index 0000000..1f79c93
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/include/gmock/internal/gmock-port.h
@@ -0,0 +1,78 @@
+// 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 <assert.h>

+#include <stdlib.h>

+#include <iostream>

+

+// Most of the types needed for porting Google Mock are also required

+// for Google Test and are defined in gtest-port.h.

+#include "gtest/internal/gtest-linked_ptr.h"

+#include "gtest/internal/gtest-port.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_

diff --git a/third_party/allwpilib_2018/gmock/src/gmock-all.cc b/third_party/allwpilib_2018/gmock/src/gmock-all.cc
new file mode 100644
index 0000000..d589c12
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock-all.cc
@@ -0,0 +1,47 @@
+// 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: wan@google.com (Zhanyong Wan)

+//

+// Google C++ Mocking Framework (Google Mock)

+//

+// This file #includes all Google Mock implementation .cc files.  The

+// purpose is to allow a user to build Google Mock by compiling this

+// file alone.

+

+// This line ensures that gmock.h can be compiled on its own, even

+// when it's fused.

+#include "gmock/gmock.h"

+

+// The following lines pull in the real gmock *.cc files.

+#include "src/gmock-cardinalities.cc"

+#include "src/gmock-internal-utils.cc"

+#include "src/gmock-matchers.cc"

+#include "src/gmock-spec-builders.cc"

+#include "src/gmock.cc"

diff --git a/third_party/allwpilib_2018/gmock/src/gmock-cardinalities.cc b/third_party/allwpilib_2018/gmock/src/gmock-cardinalities.cc
new file mode 100644
index 0000000..6ca9600
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock-cardinalities.cc
@@ -0,0 +1,156 @@
+// 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 cardinalities.

+

+#include "gmock/gmock-cardinalities.h"

+

+#include <limits.h>

+#include <ostream>  // NOLINT

+#include <sstream>

+#include <string>

+#include "gmock/internal/gmock-internal-utils.h"

+#include "gtest/gtest.h"

+

+namespace testing {

+

+namespace {

+

+// Implements the Between(m, n) cardinality.

+class BetweenCardinalityImpl : public CardinalityInterface {

+ public:

+  BetweenCardinalityImpl(int min, int max)

+      : min_(min >= 0 ? min : 0),

+        max_(max >= min_ ? max : min_) {

+    std::stringstream ss;

+    if (min < 0) {

+      ss << "The invocation lower bound must be >= 0, "

+         << "but is actually " << min << ".";

+      internal::Expect(false, __FILE__, __LINE__, ss.str());

+    } else if (max < 0) {

+      ss << "The invocation upper bound must be >= 0, "

+         << "but is actually " << max << ".";

+      internal::Expect(false, __FILE__, __LINE__, ss.str());

+    } else if (min > max) {

+      ss << "The invocation upper bound (" << max

+         << ") must be >= the invocation lower bound (" << min

+         << ").";

+      internal::Expect(false, __FILE__, __LINE__, ss.str());

+    }

+  }

+

+  // Conservative estimate on the lower/upper bound of the number of

+  // calls allowed.

+  virtual int ConservativeLowerBound() const { return min_; }

+  virtual int ConservativeUpperBound() const { return max_; }

+

+  virtual bool IsSatisfiedByCallCount(int call_count) const {

+    return min_ <= call_count && call_count <= max_;

+  }

+

+  virtual bool IsSaturatedByCallCount(int call_count) const {

+    return call_count >= max_;

+  }

+

+  virtual void DescribeTo(::std::ostream* os) const;

+

+ private:

+  const int min_;

+  const int max_;

+

+  GTEST_DISALLOW_COPY_AND_ASSIGN_(BetweenCardinalityImpl);

+};

+

+// Formats "n times" in a human-friendly way.

+inline internal::string FormatTimes(int n) {

+  if (n == 1) {

+    return "once";

+  } else if (n == 2) {

+    return "twice";

+  } else {

+    std::stringstream ss;

+    ss << n << " times";

+    return ss.str();

+  }

+}

+

+// Describes the Between(m, n) cardinality in human-friendly text.

+void BetweenCardinalityImpl::DescribeTo(::std::ostream* os) const {

+  if (min_ == 0) {

+    if (max_ == 0) {

+      *os << "never called";

+    } else if (max_ == INT_MAX) {

+      *os << "called any number of times";

+    } else {

+      *os << "called at most " << FormatTimes(max_);

+    }

+  } else if (min_ == max_) {

+    *os << "called " << FormatTimes(min_);

+  } else if (max_ == INT_MAX) {

+    *os << "called at least " << FormatTimes(min_);

+  } else {

+    // 0 < min_ < max_ < INT_MAX

+    *os << "called between " << min_ << " and " << max_ << " times";

+  }

+}

+

+}  // Unnamed namespace

+

+// Describes the given call count to an ostream.

+void Cardinality::DescribeActualCallCountTo(int actual_call_count,

+                                            ::std::ostream* os) {

+  if (actual_call_count > 0) {

+    *os << "called " << FormatTimes(actual_call_count);

+  } else {

+    *os << "never called";

+  }

+}

+

+// Creates a cardinality that allows at least n calls.

+GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }

+

+// Creates a cardinality that allows at most n calls.

+GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); }

+

+// Creates a cardinality that allows any number of calls.

+GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); }

+

+// Creates a cardinality that allows between min and max calls.

+GTEST_API_ Cardinality Between(int min, int max) {

+  return Cardinality(new BetweenCardinalityImpl(min, max));

+}

+

+// Creates a cardinality that allows exactly n calls.

+GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); }

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/src/gmock-internal-utils.cc b/third_party/allwpilib_2018/gmock/src/gmock-internal-utils.cc
new file mode 100644
index 0000000..e364dd5
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock-internal-utils.cc
@@ -0,0 +1,174 @@
+// 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.

+

+#include "gmock/internal/gmock-internal-utils.h"

+

+#include <ctype.h>

+#include <ostream>  // NOLINT

+#include <string>

+#include "gmock/gmock.h"

+#include "gmock/internal/gmock-port.h"

+#include "gtest/gtest.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) {

+  string result;

+  char prev_char = '\0';

+  for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {

+    // We don't care about the current locale as the input is

+    // guaranteed to be a valid C++ identifier name.

+    const bool starts_new_word = IsUpper(*p) ||

+        (!IsAlpha(prev_char) && IsLower(*p)) ||

+        (!IsDigit(prev_char) && IsDigit(*p));

+

+    if (IsAlNum(*p)) {

+      if (starts_new_word && result != "")

+        result += ' ';

+      result += ToLower(*p);

+    }

+  }

+  return result;

+}

+

+// This class reports Google Mock failures as Google Test failures.  A

+// user can define another class in a similar fashion if he intends to

+// use Google Mock with a testing framework other than Google Test.

+class GoogleTestFailureReporter : public FailureReporterInterface {

+ public:

+  virtual void ReportFailure(FailureType type, const char* file, int line,

+                             const string& message) {

+    AssertHelper(type == kFatal ?

+                 TestPartResult::kFatalFailure :

+                 TestPartResult::kNonFatalFailure,

+                 file,

+                 line,

+                 message.c_str()) = Message();

+    if (type == kFatal) {

+      posix::Abort();

+    }

+  }

+};

+

+// Returns the global failure reporter.  Will create a

+// GoogleTestFailureReporter and return it the first time called.

+GTEST_API_ FailureReporterInterface* GetFailureReporter() {

+  // Points to the global failure reporter used by Google Mock.  gcc

+  // guarantees that the following use of failure_reporter is

+  // thread-safe.  We may need to add additional synchronization to

+  // protect failure_reporter if we port Google Mock to other

+  // compilers.

+  static FailureReporterInterface* const failure_reporter =

+      new GoogleTestFailureReporter();

+  return failure_reporter;

+}

+

+// Protects global resources (stdout in particular) used by Log().

+static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex);

+

+// Returns true iff a log with the given severity is visible according

+// to the --gmock_verbose flag.

+GTEST_API_ bool LogIsVisible(LogSeverity severity) {

+  if (GMOCK_FLAG(verbose) == kInfoVerbosity) {

+    // Always show the log if --gmock_verbose=info.

+    return true;

+  } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) {

+    // Always hide it if --gmock_verbose=error.

+    return false;

+  } else {

+    // If --gmock_verbose is neither "info" nor "error", we treat it

+    // as "warning" (its default value).

+    return severity == kWarning;

+  }

+}

+

+// 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) {

+  if (!LogIsVisible(severity))

+    return;

+

+  // Ensures that logs from different threads don't interleave.

+  MutexLock l(&g_log_mutex);

+

+  // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a

+  // macro.

+

+  if (severity == kWarning) {

+    // Prints a GMOCK WARNING marker to make the warnings easily searchable.

+    std::cout << "\nGMOCK WARNING:";

+  }

+  // Pre-pends a new-line to message if it doesn't start with one.

+  if (message.empty() || message[0] != '\n') {

+    std::cout << "\n";

+  }

+  std::cout << message;

+  if (stack_frames_to_skip >= 0) {

+#ifdef NDEBUG

+    // In opt mode, we have to be conservative and skip no stack frame.

+    const int actual_to_skip = 0;

+#else

+    // In dbg mode, we can do what the caller tell us to do (plus one

+    // for skipping this function's stack frame).

+    const int actual_to_skip = stack_frames_to_skip + 1;

+#endif  // NDEBUG

+

+    // Appends a new-line to message if it doesn't end with one.

+    if (!message.empty() && *message.rbegin() != '\n') {

+      std::cout << "\n";

+    }

+    std::cout << "Stack trace:\n"

+         << ::testing::internal::GetCurrentOsStackTraceExceptTop(

+             ::testing::UnitTest::GetInstance(), actual_to_skip);

+  }

+  std::cout << ::std::flush;

+}

+

+}  // namespace internal

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/src/gmock-matchers.cc b/third_party/allwpilib_2018/gmock/src/gmock-matchers.cc
new file mode 100644
index 0000000..4c8abfd
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock-matchers.cc
@@ -0,0 +1,498 @@
+// 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 Matcher<const string&>, Matcher<string>, and

+// utilities for defining matchers.

+

+#include "gmock/gmock-matchers.h"

+#include "gmock/gmock-generated-matchers.h"

+

+#include <string.h>

+#include <sstream>

+#include <string>

+

+namespace testing {

+

+// Constructs a matcher that matches a const string& whose value is

+// equal to s.

+Matcher<const internal::string&>::Matcher(const internal::string& s) {

+  *this = Eq(s);

+}

+

+// Constructs a matcher that matches a const string& whose value is

+// equal to s.

+Matcher<const internal::string&>::Matcher(const char* s) {

+  *this = Eq(internal::string(s));

+}

+

+// Constructs a matcher that matches a string whose value is equal to s.

+Matcher<internal::string>::Matcher(const internal::string& s) { *this = Eq(s); }

+

+// Constructs a matcher that matches a string whose value is equal to s.

+Matcher<internal::string>::Matcher(const char* s) {

+  *this = Eq(internal::string(s));

+}

+

+#if GTEST_HAS_STRING_PIECE_

+// Constructs a matcher that matches a const StringPiece& whose value is

+// equal to s.

+Matcher<const StringPiece&>::Matcher(const internal::string& s) {

+  *this = Eq(s);

+}

+

+// Constructs a matcher that matches a const StringPiece& whose value is

+// equal to s.

+Matcher<const StringPiece&>::Matcher(const char* s) {

+  *this = Eq(internal::string(s));

+}

+

+// Constructs a matcher that matches a const StringPiece& whose value is

+// equal to s.

+Matcher<const StringPiece&>::Matcher(StringPiece s) {

+  *this = Eq(s.ToString());

+}

+

+// Constructs a matcher that matches a StringPiece whose value is equal to s.

+Matcher<StringPiece>::Matcher(const internal::string& s) {

+  *this = Eq(s);

+}

+

+// Constructs a matcher that matches a StringPiece whose value is equal to s.

+Matcher<StringPiece>::Matcher(const char* s) {

+  *this = Eq(internal::string(s));

+}

+

+// Constructs a matcher that matches a StringPiece whose value is equal to s.

+Matcher<StringPiece>::Matcher(StringPiece s) {

+  *this = Eq(s.ToString());

+}

+#endif  // GTEST_HAS_STRING_PIECE_

+

+namespace internal {

+

+// Joins a vector of strings as if they are fields of a tuple; returns

+// the joined string.

+GTEST_API_ string JoinAsTuple(const Strings& fields) {

+  switch (fields.size()) {

+    case 0:

+      return "";

+    case 1:

+      return fields[0];

+    default:

+      string result = "(" + fields[0];

+      for (size_t i = 1; i < fields.size(); i++) {

+        result += ", ";

+        result += fields[i];

+      }

+      result += ")";

+      return result;

+  }

+}

+

+// Returns the description for a matcher defined using the MATCHER*()

+// macro where the user-supplied description string is "", if

+// 'negation' is false; otherwise returns the description of the

+// negation of the matcher.  'param_values' contains a list of strings

+// that are the print-out of the matcher's parameters.

+GTEST_API_ string FormatMatcherDescription(bool negation,

+                                           const char* matcher_name,

+                                           const Strings& param_values) {

+  string result = ConvertIdentifierNameToWords(matcher_name);

+  if (param_values.size() >= 1)

+    result += " " + JoinAsTuple(param_values);

+  return negation ? "not (" + result + ")" : result;

+}

+

+// FindMaxBipartiteMatching and its helper class.

+//

+// Uses the well-known Ford-Fulkerson max flow method to find a maximum

+// bipartite matching. Flow is considered to be from left to right.

+// There is an implicit source node that is connected to all of the left

+// nodes, and an implicit sink node that is connected to all of the

+// right nodes. All edges have unit capacity.

+//

+// Neither the flow graph nor the residual flow graph are represented

+// explicitly. Instead, they are implied by the information in 'graph' and

+// a vector<int> called 'left_' whose elements are initialized to the

+// value kUnused. This represents the initial state of the algorithm,

+// where the flow graph is empty, and the residual flow graph has the

+// following edges:

+//   - An edge from source to each left_ node

+//   - An edge from each right_ node to sink

+//   - An edge from each left_ node to each right_ node, if the

+//     corresponding edge exists in 'graph'.

+//

+// When the TryAugment() method adds a flow, it sets left_[l] = r for some

+// nodes l and r. This induces the following changes:

+//   - The edges (source, l), (l, r), and (r, sink) are added to the

+//     flow graph.

+//   - The same three edges are removed from the residual flow graph.

+//   - The reverse edges (l, source), (r, l), and (sink, r) are added

+//     to the residual flow graph, which is a directional graph

+//     representing unused flow capacity.

+//

+// When the method augments a flow (moving left_[l] from some r1 to some

+// other r2), this can be thought of as "undoing" the above steps with

+// respect to r1 and "redoing" them with respect to r2.

+//

+// It bears repeating that the flow graph and residual flow graph are

+// never represented explicitly, but can be derived by looking at the

+// information in 'graph' and in left_.

+//

+// As an optimization, there is a second vector<int> called right_ which

+// does not provide any new information. Instead, it enables more

+// efficient queries about edges entering or leaving the right-side nodes

+// of the flow or residual flow graphs. The following invariants are

+// maintained:

+//

+// left[l] == kUnused or right[left[l]] == l

+// right[r] == kUnused or left[right[r]] == r

+//

+// . [ source ]                                        .

+// .   |||                                             .

+// .   |||                                             .

+// .   ||\--> left[0]=1  ---\    right[0]=-1 ----\     .

+// .   ||                   |                    |     .

+// .   |\---> left[1]=-1    \--> right[1]=0  ---\|     .

+// .   |                                        ||     .

+// .   \----> left[2]=2  ------> right[2]=2  --\||     .

+// .                                           |||     .

+// .         elements           matchers       vvv     .

+// .                                         [ sink ]  .

+//

+// See Also:

+//   [1] Cormen, et al (2001). "Section 26.2: The Ford–Fulkerson method".

+//       "Introduction to Algorithms (Second ed.)", pp. 651–664.

+//   [2] "Ford–Fulkerson algorithm", Wikipedia,

+//       'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'

+class MaxBipartiteMatchState {

+ public:

+  explicit MaxBipartiteMatchState(const MatchMatrix& graph)

+      : graph_(&graph),

+        left_(graph_->LhsSize(), kUnused),

+        right_(graph_->RhsSize(), kUnused) {

+  }

+

+  // Returns the edges of a maximal match, each in the form {left, right}.

+  ElementMatcherPairs Compute() {

+    // 'seen' is used for path finding { 0: unseen, 1: seen }.

+    ::std::vector<char> seen;

+    // Searches the residual flow graph for a path from each left node to

+    // the sink in the residual flow graph, and if one is found, add flow

+    // to the graph. It's okay to search through the left nodes once. The

+    // edge from the implicit source node to each previously-visited left

+    // node will have flow if that left node has any path to the sink

+    // whatsoever. Subsequent augmentations can only add flow to the

+    // network, and cannot take away that previous flow unit from the source.

+    // Since the source-to-left edge can only carry one flow unit (or,

+    // each element can be matched to only one matcher), there is no need

+    // to visit the left nodes more than once looking for augmented paths.

+    // The flow is known to be possible or impossible by looking at the

+    // node once.

+    for (size_t ilhs = 0; ilhs < graph_->LhsSize(); ++ilhs) {

+      // Reset the path-marking vector and try to find a path from

+      // source to sink starting at the left_[ilhs] node.

+      GTEST_CHECK_(left_[ilhs] == kUnused)

+          << "ilhs: " << ilhs << ", left_[ilhs]: " << left_[ilhs];

+      // 'seen' initialized to 'graph_->RhsSize()' copies of 0.

+      seen.assign(graph_->RhsSize(), 0);

+      TryAugment(ilhs, &seen);

+    }

+    ElementMatcherPairs result;

+    for (size_t ilhs = 0; ilhs < left_.size(); ++ilhs) {

+      size_t irhs = left_[ilhs];

+      if (irhs == kUnused) continue;

+      result.push_back(ElementMatcherPair(ilhs, irhs));

+    }

+    return result;

+  }

+

+ private:

+  static const size_t kUnused = static_cast<size_t>(-1);

+

+  // Perform a depth-first search from left node ilhs to the sink.  If a

+  // path is found, flow is added to the network by linking the left and

+  // right vector elements corresponding each segment of the path.

+  // Returns true if a path to sink was found, which means that a unit of

+  // flow was added to the network. The 'seen' vector elements correspond

+  // to right nodes and are marked to eliminate cycles from the search.

+  //

+  // Left nodes will only be explored at most once because they

+  // are accessible from at most one right node in the residual flow

+  // graph.

+  //

+  // Note that left_[ilhs] is the only element of left_ that TryAugment will

+  // potentially transition from kUnused to another value. Any other

+  // left_ element holding kUnused before TryAugment will be holding it

+  // when TryAugment returns.

+  //

+  bool TryAugment(size_t ilhs, ::std::vector<char>* seen) {

+    for (size_t irhs = 0; irhs < graph_->RhsSize(); ++irhs) {

+      if ((*seen)[irhs])

+        continue;

+      if (!graph_->HasEdge(ilhs, irhs))

+        continue;

+      // There's an available edge from ilhs to irhs.

+      (*seen)[irhs] = 1;

+      // Next a search is performed to determine whether

+      // this edge is a dead end or leads to the sink.

+      //

+      // right_[irhs] == kUnused means that there is residual flow from

+      // right node irhs to the sink, so we can use that to finish this

+      // flow path and return success.

+      //

+      // Otherwise there is residual flow to some ilhs. We push flow

+      // along that path and call ourselves recursively to see if this

+      // ultimately leads to sink.

+      if (right_[irhs] == kUnused || TryAugment(right_[irhs], seen)) {

+        // Add flow from left_[ilhs] to right_[irhs].

+        left_[ilhs] = irhs;

+        right_[irhs] = ilhs;

+        return true;

+      }

+    }

+    return false;

+  }

+

+  const MatchMatrix* graph_;  // not owned

+  // Each element of the left_ vector represents a left hand side node

+  // (i.e. an element) and each element of right_ is a right hand side

+  // node (i.e. a matcher). The values in the left_ vector indicate

+  // outflow from that node to a node on the the right_ side. The values

+  // in the right_ indicate inflow, and specify which left_ node is

+  // feeding that right_ node, if any. For example, left_[3] == 1 means

+  // there's a flow from element #3 to matcher #1. Such a flow would also

+  // be redundantly represented in the right_ vector as right_[1] == 3.

+  // Elements of left_ and right_ are either kUnused or mutually

+  // referent. Mutually referent means that left_[right_[i]] = i and

+  // right_[left_[i]] = i.

+  ::std::vector<size_t> left_;

+  ::std::vector<size_t> right_;

+

+  GTEST_DISALLOW_ASSIGN_(MaxBipartiteMatchState);

+};

+

+const size_t MaxBipartiteMatchState::kUnused;

+

+GTEST_API_ ElementMatcherPairs

+FindMaxBipartiteMatching(const MatchMatrix& g) {

+  return MaxBipartiteMatchState(g).Compute();

+}

+

+static void LogElementMatcherPairVec(const ElementMatcherPairs& pairs,

+                                     ::std::ostream* stream) {

+  typedef ElementMatcherPairs::const_iterator Iter;

+  ::std::ostream& os = *stream;

+  os << "{";

+  const char *sep = "";

+  for (Iter it = pairs.begin(); it != pairs.end(); ++it) {

+    os << sep << "\n  ("

+       << "element #" << it->first << ", "

+       << "matcher #" << it->second << ")";

+    sep = ",";

+  }

+  os << "\n}";

+}

+

+// Tries to find a pairing, and explains the result.

+GTEST_API_ bool FindPairing(const MatchMatrix& matrix,

+                            MatchResultListener* listener) {

+  ElementMatcherPairs matches = FindMaxBipartiteMatching(matrix);

+

+  size_t max_flow = matches.size();

+  bool result = (max_flow == matrix.RhsSize());

+

+  if (!result) {

+    if (listener->IsInterested()) {

+      *listener << "where no permutation of the elements can "

+                   "satisfy all matchers, and the closest match is "

+                << max_flow << " of " << matrix.RhsSize()

+                << " matchers with the pairings:\n";

+      LogElementMatcherPairVec(matches, listener->stream());

+    }

+    return false;

+  }

+

+  if (matches.size() > 1) {

+    if (listener->IsInterested()) {

+      const char *sep = "where:\n";

+      for (size_t mi = 0; mi < matches.size(); ++mi) {

+        *listener << sep << " - element #" << matches[mi].first

+                  << " is matched by matcher #" << matches[mi].second;

+        sep = ",\n";

+      }

+    }

+  }

+  return true;

+}

+

+bool MatchMatrix::NextGraph() {

+  for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {

+    for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {

+      char& b = matched_[SpaceIndex(ilhs, irhs)];

+      if (!b) {

+        b = 1;

+        return true;

+      }

+      b = 0;

+    }

+  }

+  return false;

+}

+

+void MatchMatrix::Randomize() {

+  for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {

+    for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {

+      char& b = matched_[SpaceIndex(ilhs, irhs)];

+      b = static_cast<char>(rand() & 1);  // NOLINT

+    }

+  }

+}

+

+string MatchMatrix::DebugString() const {

+  ::std::stringstream ss;

+  const char *sep = "";

+  for (size_t i = 0; i < LhsSize(); ++i) {

+    ss << sep;

+    for (size_t j = 0; j < RhsSize(); ++j) {

+      ss << HasEdge(i, j);

+    }

+    sep = ";";

+  }

+  return ss.str();

+}

+

+void UnorderedElementsAreMatcherImplBase::DescribeToImpl(

+    ::std::ostream* os) const {

+  if (matcher_describers_.empty()) {

+    *os << "is empty";

+    return;

+  }

+  if (matcher_describers_.size() == 1) {

+    *os << "has " << Elements(1) << " and that element ";

+    matcher_describers_[0]->DescribeTo(os);

+    return;

+  }

+  *os << "has " << Elements(matcher_describers_.size())

+      << " and there exists some permutation of elements such that:\n";

+  const char* sep = "";

+  for (size_t i = 0; i != matcher_describers_.size(); ++i) {

+    *os << sep << " - element #" << i << " ";

+    matcher_describers_[i]->DescribeTo(os);

+    sep = ", and\n";

+  }

+}

+

+void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(

+    ::std::ostream* os) const {

+  if (matcher_describers_.empty()) {

+    *os << "isn't empty";

+    return;

+  }

+  if (matcher_describers_.size() == 1) {

+    *os << "doesn't have " << Elements(1)

+        << ", or has " << Elements(1) << " that ";

+    matcher_describers_[0]->DescribeNegationTo(os);

+    return;

+  }

+  *os << "doesn't have " << Elements(matcher_describers_.size())

+      << ", or there exists no permutation of elements such that:\n";

+  const char* sep = "";

+  for (size_t i = 0; i != matcher_describers_.size(); ++i) {

+    *os << sep << " - element #" << i << " ";

+    matcher_describers_[i]->DescribeTo(os);

+    sep = ", and\n";

+  }

+}

+

+// Checks that all matchers match at least one element, and that all

+// elements match at least one matcher. This enables faster matching

+// and better error reporting.

+// Returns false, writing an explanation to 'listener', if and only

+// if the success criteria are not met.

+bool UnorderedElementsAreMatcherImplBase::

+VerifyAllElementsAndMatchersAreMatched(

+    const ::std::vector<string>& element_printouts,

+    const MatchMatrix& matrix,

+    MatchResultListener* listener) const {

+  bool result = true;

+  ::std::vector<char> element_matched(matrix.LhsSize(), 0);

+  ::std::vector<char> matcher_matched(matrix.RhsSize(), 0);

+

+  for (size_t ilhs = 0; ilhs < matrix.LhsSize(); ilhs++) {

+    for (size_t irhs = 0; irhs < matrix.RhsSize(); irhs++) {

+      char matched = matrix.HasEdge(ilhs, irhs);

+      element_matched[ilhs] |= matched;

+      matcher_matched[irhs] |= matched;

+    }

+  }

+

+  {

+    const char* sep =

+        "where the following matchers don't match any elements:\n";

+    for (size_t mi = 0; mi < matcher_matched.size(); ++mi) {

+      if (matcher_matched[mi])

+        continue;

+      result = false;

+      if (listener->IsInterested()) {

+        *listener << sep << "matcher #" << mi << ": ";

+        matcher_describers_[mi]->DescribeTo(listener->stream());

+        sep = ",\n";

+      }

+    }

+  }

+

+  {

+    const char* sep =

+        "where the following elements don't match any matchers:\n";

+    const char* outer_sep = "";

+    if (!result) {

+      outer_sep = "\nand ";

+    }

+    for (size_t ei = 0; ei < element_matched.size(); ++ei) {

+      if (element_matched[ei])

+        continue;

+      result = false;

+      if (listener->IsInterested()) {

+        *listener << outer_sep << sep << "element #" << ei << ": "

+                  << element_printouts[ei];

+        sep = ",\n";

+        outer_sep = "";

+      }

+    }

+  }

+  return result;

+}

+

+}  // namespace internal

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/src/gmock-spec-builders.cc b/third_party/allwpilib_2018/gmock/src/gmock-spec-builders.cc
new file mode 100644
index 0000000..3dcdcca
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock-spec-builders.cc
@@ -0,0 +1,813 @@
+// 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 the spec builder syntax (ON_CALL and

+// EXPECT_CALL).

+

+#include "gmock/gmock-spec-builders.h"

+

+#include <stdlib.h>

+#include <iostream>  // NOLINT

+#include <map>

+#include <set>

+#include <string>

+#include "gmock/gmock.h"

+#include "gtest/gtest.h"

+

+#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC

+# include <unistd.h>  // NOLINT

+#endif

+

+namespace testing {

+namespace internal {

+

+// Protects the mock object registry (in class Mock), all function

+// mockers, and all expectations.

+GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex);

+

+// Logs a message including file and line number information.

+GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,

+                                const char* file, int line,

+                                const string& message) {

+  ::std::ostringstream s;

+  s << file << ":" << line << ": " << message << ::std::endl;

+  Log(severity, s.str(), 0);

+}

+

+// Constructs an ExpectationBase object.

+ExpectationBase::ExpectationBase(const char* a_file,

+                                 int a_line,

+                                 const string& a_source_text)

+    : file_(a_file),

+      line_(a_line),

+      source_text_(a_source_text),

+      cardinality_specified_(false),

+      cardinality_(Exactly(1)),

+      call_count_(0),

+      retired_(false),

+      extra_matcher_specified_(false),

+      repeated_action_specified_(false),

+      retires_on_saturation_(false),

+      last_clause_(kNone),

+      action_count_checked_(false) {}

+

+// Destructs an ExpectationBase object.

+ExpectationBase::~ExpectationBase() {}

+

+// Explicitly specifies the cardinality of this expectation.  Used by

+// the subclasses to implement the .Times() clause.

+void ExpectationBase::SpecifyCardinality(const Cardinality& a_cardinality) {

+  cardinality_specified_ = true;

+  cardinality_ = a_cardinality;

+}

+

+// Retires all pre-requisites of this expectation.

+void ExpectationBase::RetireAllPreRequisites()

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+  if (is_retired()) {

+    // We can take this short-cut as we never retire an expectation

+    // until we have retired all its pre-requisites.

+    return;

+  }

+

+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();

+       it != immediate_prerequisites_.end(); ++it) {

+    ExpectationBase* const prerequisite = it->expectation_base().get();

+    if (!prerequisite->is_retired()) {

+      prerequisite->RetireAllPreRequisites();

+      prerequisite->Retire();

+    }

+  }

+}

+

+// Returns true iff all pre-requisites of this expectation have been

+// satisfied.

+bool ExpectationBase::AllPrerequisitesAreSatisfied() const

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+  g_gmock_mutex.AssertHeld();

+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();

+       it != immediate_prerequisites_.end(); ++it) {

+    if (!(it->expectation_base()->IsSatisfied()) ||

+        !(it->expectation_base()->AllPrerequisitesAreSatisfied()))

+      return false;

+  }

+  return true;

+}

+

+// Adds unsatisfied pre-requisites of this expectation to 'result'.

+void ExpectationBase::FindUnsatisfiedPrerequisites(ExpectationSet* result) const

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+  g_gmock_mutex.AssertHeld();

+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();

+       it != immediate_prerequisites_.end(); ++it) {

+    if (it->expectation_base()->IsSatisfied()) {

+      // If *it is satisfied and has a call count of 0, some of its

+      // pre-requisites may not be satisfied yet.

+      if (it->expectation_base()->call_count_ == 0) {

+        it->expectation_base()->FindUnsatisfiedPrerequisites(result);

+      }

+    } else {

+      // Now that we know *it is unsatisfied, we are not so interested

+      // in whether its pre-requisites are satisfied.  Therefore we

+      // don't recursively call FindUnsatisfiedPrerequisites() here.

+      *result += *it;

+    }

+  }

+}

+

+// Describes how many times a function call matching this

+// expectation has occurred.

+void ExpectationBase::DescribeCallCountTo(::std::ostream* os) const

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+  g_gmock_mutex.AssertHeld();

+

+  // Describes how many times the function is expected to be called.

+  *os << "         Expected: to be ";

+  cardinality().DescribeTo(os);

+  *os << "\n           Actual: ";

+  Cardinality::DescribeActualCallCountTo(call_count(), os);

+

+  // Describes the state of the expectation (e.g. is it satisfied?

+  // is it active?).

+  *os << " - " << (IsOverSaturated() ? "over-saturated" :

+                   IsSaturated() ? "saturated" :

+                   IsSatisfied() ? "satisfied" : "unsatisfied")

+      << " and "

+      << (is_retired() ? "retired" : "active");

+}

+

+// Checks the action count (i.e. the number of WillOnce() and

+// WillRepeatedly() clauses) against the cardinality if this hasn't

+// been done before.  Prints a warning if there are too many or too

+// few actions.

+void ExpectationBase::CheckActionCountIfNotDone() const

+    GTEST_LOCK_EXCLUDED_(mutex_) {

+  bool should_check = false;

+  {

+    MutexLock l(&mutex_);

+    if (!action_count_checked_) {

+      action_count_checked_ = true;

+      should_check = true;

+    }

+  }

+

+  if (should_check) {

+    if (!cardinality_specified_) {

+      // The cardinality was inferred - no need to check the action

+      // count against it.

+      return;

+    }

+

+    // The cardinality was explicitly specified.

+    const int action_count = static_cast<int>(untyped_actions_.size());

+    const int upper_bound = cardinality().ConservativeUpperBound();

+    const int lower_bound = cardinality().ConservativeLowerBound();

+    bool too_many;  // True if there are too many actions, or false

+    // if there are too few.

+    if (action_count > upper_bound ||

+        (action_count == upper_bound && repeated_action_specified_)) {

+      too_many = true;

+    } else if (0 < action_count && action_count < lower_bound &&

+               !repeated_action_specified_) {

+      too_many = false;

+    } else {

+      return;

+    }

+

+    ::std::stringstream ss;

+    DescribeLocationTo(&ss);

+    ss << "Too " << (too_many ? "many" : "few")

+       << " actions specified in " << source_text() << "...\n"

+       << "Expected to be ";

+    cardinality().DescribeTo(&ss);

+    ss << ", but has " << (too_many ? "" : "only ")

+       << action_count << " WillOnce()"

+       << (action_count == 1 ? "" : "s");

+    if (repeated_action_specified_) {

+      ss << " and a WillRepeatedly()";

+    }

+    ss << ".";

+    Log(kWarning, ss.str(), -1);  // -1 means "don't print stack trace".

+  }

+}

+

+// Implements the .Times() clause.

+void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {

+  if (last_clause_ == kTimes) {

+    ExpectSpecProperty(false,

+                       ".Times() cannot appear "

+                       "more than once in an EXPECT_CALL().");

+  } else {

+    ExpectSpecProperty(last_clause_ < kTimes,

+                       ".Times() cannot appear after "

+                       ".InSequence(), .WillOnce(), .WillRepeatedly(), "

+                       "or .RetiresOnSaturation().");

+  }

+  last_clause_ = kTimes;

+

+  SpecifyCardinality(a_cardinality);

+}

+

+// Points to the implicit sequence introduced by a living InSequence

+// object (if any) in the current thread or NULL.

+GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;

+

+// Reports an uninteresting call (whose description is in msg) in the

+// manner specified by 'reaction'.

+void ReportUninterestingCall(CallReaction reaction, const string& msg) {

+  switch (reaction) {

+    case kAllow:

+      Log(kInfo, msg, 3);

+      break;

+    case kWarn:

+      Log(kWarning, msg, 3);

+      break;

+    default:  // FAIL

+      Expect(false, NULL, -1, msg);

+  }

+}

+

+UntypedFunctionMockerBase::UntypedFunctionMockerBase()

+    : mock_obj_(NULL), name_("") {}

+

+UntypedFunctionMockerBase::~UntypedFunctionMockerBase() {}

+

+// Sets the mock object this mock method belongs to, and registers

+// this information in the global mock registry.  Will be called

+// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock

+// method.

+void UntypedFunctionMockerBase::RegisterOwner(const void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+  {

+    MutexLock l(&g_gmock_mutex);

+    mock_obj_ = mock_obj;

+  }

+  Mock::Register(mock_obj, this);

+}

+

+// Sets the mock object this mock method belongs to, and sets the name

+// of the mock function.  Will be called upon each invocation of this

+// mock function.

+void UntypedFunctionMockerBase::SetOwnerAndName(const void* mock_obj,

+                                                const char* name)

+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+  // We protect name_ under g_gmock_mutex in case this mock function

+  // is called from two threads concurrently.

+  MutexLock l(&g_gmock_mutex);

+  mock_obj_ = mock_obj;

+  name_ = name;

+}

+

+// Returns the name of the function being mocked.  Must be called

+// after RegisterOwner() or SetOwnerAndName() has been called.

+const void* UntypedFunctionMockerBase::MockObject() const

+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+  const void* mock_obj;

+  {

+    // We protect mock_obj_ under g_gmock_mutex in case this mock

+    // function is called from two threads concurrently.

+    MutexLock l(&g_gmock_mutex);

+    Assert(mock_obj_ != NULL, __FILE__, __LINE__,

+           "MockObject() must not be called before RegisterOwner() or "

+           "SetOwnerAndName() has been called.");

+    mock_obj = mock_obj_;

+  }

+  return mock_obj;

+}

+

+// Returns the name of this mock method.  Must be called after

+// SetOwnerAndName() has been called.

+const char* UntypedFunctionMockerBase::Name() const

+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+  const char* name;

+  {

+    // We protect name_ under g_gmock_mutex in case this mock

+    // function is called from two threads concurrently.

+    MutexLock l(&g_gmock_mutex);

+    Assert(name_ != NULL, __FILE__, __LINE__,

+           "Name() must not be called before SetOwnerAndName() has "

+           "been called.");

+    name = name_;

+  }

+  return name;

+}

+

+// Calculates the result of invoking this mock function with the given

+// arguments, prints it, and returns it.  The caller is responsible

+// for deleting the result.

+const UntypedActionResultHolderBase*

+UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)

+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {

+  if (untyped_expectations_.size() == 0) {

+    // No expectation is set on this mock method - we have an

+    // uninteresting call.

+

+    // We must get Google Mock's reaction on uninteresting calls

+    // made on this mock object BEFORE performing the action,

+    // because the action may DELETE the mock object and make the

+    // following expression meaningless.

+    const CallReaction reaction =

+        Mock::GetReactionOnUninterestingCalls(MockObject());

+

+    // True iff we need to print this call's arguments and return

+    // value.  This definition must be kept in sync with

+    // the behavior of ReportUninterestingCall().

+    const bool need_to_report_uninteresting_call =

+        // If the user allows this uninteresting call, we print it

+        // only when he wants informational messages.

+        reaction == kAllow ? LogIsVisible(kInfo) :

+        // If the user wants this to be a warning, we print it only

+        // when he wants to see warnings.

+        reaction == kWarn ? LogIsVisible(kWarning) :

+        // Otherwise, the user wants this to be an error, and we

+        // should always print detailed information in the error.

+        true;

+

+    if (!need_to_report_uninteresting_call) {

+      // Perform the action without printing the call information.

+      return this->UntypedPerformDefaultAction(untyped_args, "");

+    }

+

+    // Warns about the uninteresting call.

+    ::std::stringstream ss;

+    this->UntypedDescribeUninterestingCall(untyped_args, &ss);

+

+    // Calculates the function result.

+    const UntypedActionResultHolderBase* const result =

+        this->UntypedPerformDefaultAction(untyped_args, ss.str());

+

+    // Prints the function result.

+    if (result != NULL)

+      result->PrintAsActionResult(&ss);

+

+    ReportUninterestingCall(reaction, ss.str());

+    return result;

+  }

+

+  bool is_excessive = false;

+  ::std::stringstream ss;

+  ::std::stringstream why;

+  ::std::stringstream loc;

+  const void* untyped_action = NULL;

+

+  // The UntypedFindMatchingExpectation() function acquires and

+  // releases g_gmock_mutex.

+  const ExpectationBase* const untyped_expectation =

+      this->UntypedFindMatchingExpectation(

+          untyped_args, &untyped_action, &is_excessive,

+          &ss, &why);

+  const bool found = untyped_expectation != NULL;

+

+  // True iff we need to print the call's arguments and return value.

+  // This definition must be kept in sync with the uses of Expect()

+  // and Log() in this function.

+  const bool need_to_report_call =

+      !found || is_excessive || LogIsVisible(kInfo);

+  if (!need_to_report_call) {

+    // Perform the action without printing the call information.

+    return

+        untyped_action == NULL ?

+        this->UntypedPerformDefaultAction(untyped_args, "") :

+        this->UntypedPerformAction(untyped_action, untyped_args);

+  }

+

+  ss << "    Function call: " << Name();

+  this->UntypedPrintArgs(untyped_args, &ss);

+

+  // In case the action deletes a piece of the expectation, we

+  // generate the message beforehand.

+  if (found && !is_excessive) {

+    untyped_expectation->DescribeLocationTo(&loc);

+  }

+

+  const UntypedActionResultHolderBase* const result =

+      untyped_action == NULL ?

+      this->UntypedPerformDefaultAction(untyped_args, ss.str()) :

+      this->UntypedPerformAction(untyped_action, untyped_args);

+  if (result != NULL)

+    result->PrintAsActionResult(&ss);

+  ss << "\n" << why.str();

+

+  if (!found) {

+    // No expectation matches this call - reports a failure.

+    Expect(false, NULL, -1, ss.str());

+  } else if (is_excessive) {

+    // We had an upper-bound violation and the failure message is in ss.

+    Expect(false, untyped_expectation->file(),

+           untyped_expectation->line(), ss.str());

+  } else {

+    // We had an expected call and the matching expectation is

+    // described in ss.

+    Log(kInfo, loc.str() + ss.str(), 2);

+  }

+

+  return result;

+}

+

+// Returns an Expectation object that references and co-owns exp,

+// which must be an expectation on this mock function.

+Expectation UntypedFunctionMockerBase::GetHandleOf(ExpectationBase* exp) {

+  for (UntypedExpectations::const_iterator it =

+           untyped_expectations_.begin();

+       it != untyped_expectations_.end(); ++it) {

+    if (it->get() == exp) {

+      return Expectation(*it);

+    }

+  }

+

+  Assert(false, __FILE__, __LINE__, "Cannot find expectation.");

+  return Expectation();

+  // The above statement is just to make the code compile, and will

+  // never be executed.

+}

+

+// Verifies that all expectations on this mock function have been

+// satisfied.  Reports one or more Google Test non-fatal failures

+// and returns false if not.

+bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {

+  g_gmock_mutex.AssertHeld();

+  bool expectations_met = true;

+  for (UntypedExpectations::const_iterator it =

+           untyped_expectations_.begin();

+       it != untyped_expectations_.end(); ++it) {

+    ExpectationBase* const untyped_expectation = it->get();

+    if (untyped_expectation->IsOverSaturated()) {

+      // There was an upper-bound violation.  Since the error was

+      // already reported when it occurred, there is no need to do

+      // anything here.

+      expectations_met = false;

+    } else if (!untyped_expectation->IsSatisfied()) {

+      expectations_met = false;

+      ::std::stringstream ss;

+      ss  << "Actual function call count doesn't match "

+          << untyped_expectation->source_text() << "...\n";

+      // No need to show the source file location of the expectation

+      // in the description, as the Expect() call that follows already

+      // takes care of it.

+      untyped_expectation->MaybeDescribeExtraMatcherTo(&ss);

+      untyped_expectation->DescribeCallCountTo(&ss);

+      Expect(false, untyped_expectation->file(),

+             untyped_expectation->line(), ss.str());

+    }

+  }

+

+  // Deleting our expectations may trigger other mock objects to be deleted, for

+  // example if an action contains a reference counted smart pointer to that

+  // mock object, and that is the last reference. So if we delete our

+  // expectations within the context of the global mutex we may deadlock when

+  // this method is called again. Instead, make a copy of the set of

+  // expectations to delete, clear our set within the mutex, and then clear the

+  // copied set outside of it.

+  UntypedExpectations expectations_to_delete;

+  untyped_expectations_.swap(expectations_to_delete);

+

+  g_gmock_mutex.Unlock();

+  expectations_to_delete.clear();

+  g_gmock_mutex.Lock();

+

+  return expectations_met;

+}

+

+}  // namespace internal

+

+// Class Mock.

+

+namespace {

+

+typedef std::set<internal::UntypedFunctionMockerBase*> FunctionMockers;

+

+// The current state of a mock object.  Such information is needed for

+// detecting leaked mock objects and explicitly verifying a mock's

+// expectations.

+struct MockObjectState {

+  MockObjectState()

+      : first_used_file(NULL), first_used_line(-1), leakable(false) {}

+

+  // Where in the source file an ON_CALL or EXPECT_CALL is first

+  // invoked on this mock object.

+  const char* first_used_file;

+  int first_used_line;

+  ::std::string first_used_test_case;

+  ::std::string first_used_test;

+  bool leakable;  // true iff it's OK to leak the object.

+  FunctionMockers function_mockers;  // All registered methods of the object.

+};

+

+// A global registry holding the state of all mock objects that are

+// alive.  A mock object is added to this registry the first time

+// Mock::AllowLeak(), ON_CALL(), or EXPECT_CALL() is called on it.  It

+// is removed from the registry in the mock object's destructor.

+class MockObjectRegistry {

+ public:

+  // Maps a mock object (identified by its address) to its state.

+  typedef std::map<const void*, MockObjectState> StateMap;

+

+  // This destructor will be called when a program exits, after all

+  // tests in it have been run.  By then, there should be no mock

+  // object alive.  Therefore we report any living object as test

+  // failure, unless the user explicitly asked us to ignore it.

+  ~MockObjectRegistry() {

+    // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is

+    // a macro.

+

+    if (!GMOCK_FLAG(catch_leaked_mocks))

+      return;

+

+    int leaked_count = 0;

+    for (StateMap::const_iterator it = states_.begin(); it != states_.end();

+         ++it) {

+      if (it->second.leakable)  // The user said it's fine to leak this object.

+        continue;

+

+      // TODO(wan@google.com): Print the type of the leaked object.

+      // This can help the user identify the leaked object.

+      std::cout << "\n";

+      const MockObjectState& state = it->second;

+      std::cout << internal::FormatFileLocation(state.first_used_file,

+                                                state.first_used_line);

+      std::cout << " ERROR: this mock object";

+      if (state.first_used_test != "") {

+        std::cout << " (used in test " << state.first_used_test_case << "."

+             << state.first_used_test << ")";

+      }

+      std::cout << " should be deleted but never is. Its address is @"

+           << it->first << ".";

+      leaked_count++;

+    }

+    if (leaked_count > 0) {

+      std::cout << "\nERROR: " << leaked_count

+           << " leaked mock " << (leaked_count == 1 ? "object" : "objects")

+           << " found at program exit.\n";

+      std::cout.flush();

+      ::std::cerr.flush();

+      // RUN_ALL_TESTS() has already returned when this destructor is

+      // called.  Therefore we cannot use the normal Google Test

+      // failure reporting mechanism.

+      _exit(1);  // We cannot call exit() as it is not reentrant and

+                 // may already have been called.

+    }

+  }

+

+  StateMap& states() { return states_; }

+

+ private:

+  StateMap states_;

+};

+

+// Protected by g_gmock_mutex.

+MockObjectRegistry g_mock_object_registry;

+

+// Maps a mock object to the reaction Google Mock should have when an

+// uninteresting method is called.  Protected by g_gmock_mutex.

+std::map<const void*, internal::CallReaction> g_uninteresting_call_reaction;

+

+// Sets the reaction Google Mock should have when an uninteresting

+// method of the given mock object is called.

+void SetReactionOnUninterestingCalls(const void* mock_obj,

+                                     internal::CallReaction reaction)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  g_uninteresting_call_reaction[mock_obj] = reaction;

+}

+

+}  // namespace

+

+// Tells Google Mock to allow uninteresting calls on the given mock

+// object.

+void Mock::AllowUninterestingCalls(const void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  SetReactionOnUninterestingCalls(mock_obj, internal::kAllow);

+}

+

+// Tells Google Mock to warn the user about uninteresting calls on the

+// given mock object.

+void Mock::WarnUninterestingCalls(const void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  SetReactionOnUninterestingCalls(mock_obj, internal::kWarn);

+}

+

+// Tells Google Mock to fail uninteresting calls on the given mock

+// object.

+void Mock::FailUninterestingCalls(const void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  SetReactionOnUninterestingCalls(mock_obj, internal::kFail);

+}

+

+// Tells Google Mock the given mock object is being destroyed and its

+// entry in the call-reaction table should be removed.

+void Mock::UnregisterCallReaction(const void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  g_uninteresting_call_reaction.erase(mock_obj);

+}

+

+// Returns the reaction Google Mock will have on uninteresting calls

+// made on the given mock object.

+internal::CallReaction Mock::GetReactionOnUninterestingCalls(

+    const void* mock_obj)

+        GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  return (g_uninteresting_call_reaction.count(mock_obj) == 0) ?

+      internal::kDefault : g_uninteresting_call_reaction[mock_obj];

+}

+

+// Tells Google Mock to ignore mock_obj when checking for leaked mock

+// objects.

+void Mock::AllowLeak(const void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  g_mock_object_registry.states()[mock_obj].leakable = true;

+}

+

+// Verifies and clears all expectations on the given mock object.  If

+// the expectations aren't satisfied, generates one or more Google

+// Test non-fatal failures and returns false.

+bool Mock::VerifyAndClearExpectations(void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  return VerifyAndClearExpectationsLocked(mock_obj);

+}

+

+// Verifies all expectations on the given mock object and clears its

+// default actions and expectations.  Returns true iff the

+// verification was successful.

+bool Mock::VerifyAndClear(void* mock_obj)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  ClearDefaultActionsLocked(mock_obj);

+  return VerifyAndClearExpectationsLocked(mock_obj);

+}

+

+// Verifies and clears all expectations on the given mock object.  If

+// the expectations aren't satisfied, generates one or more Google

+// Test non-fatal failures and returns false.

+bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {

+  internal::g_gmock_mutex.AssertHeld();

+  if (g_mock_object_registry.states().count(mock_obj) == 0) {

+    // No EXPECT_CALL() was set on the given mock object.

+    return true;

+  }

+

+  // Verifies and clears the expectations on each mock method in the

+  // given mock object.

+  bool expectations_met = true;

+  FunctionMockers& mockers =

+      g_mock_object_registry.states()[mock_obj].function_mockers;

+  for (FunctionMockers::const_iterator it = mockers.begin();

+       it != mockers.end(); ++it) {

+    if (!(*it)->VerifyAndClearExpectationsLocked()) {

+      expectations_met = false;

+    }

+  }

+

+  // We don't clear the content of mockers, as they may still be

+  // needed by ClearDefaultActionsLocked().

+  return expectations_met;

+}

+

+// Registers a mock object and a mock method it owns.

+void Mock::Register(const void* mock_obj,

+                    internal::UntypedFunctionMockerBase* mocker)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  g_mock_object_registry.states()[mock_obj].function_mockers.insert(mocker);

+}

+

+// Tells Google Mock where in the source code mock_obj is used in an

+// ON_CALL or EXPECT_CALL.  In case mock_obj is leaked, this

+// information helps the user identify which object it is.

+void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,

+                                           const char* file, int line)

+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {

+  internal::MutexLock l(&internal::g_gmock_mutex);

+  MockObjectState& state = g_mock_object_registry.states()[mock_obj];

+  if (state.first_used_file == NULL) {

+    state.first_used_file = file;

+    state.first_used_line = line;

+    const TestInfo* const test_info =

+        UnitTest::GetInstance()->current_test_info();

+    if (test_info != NULL) {

+      // TODO(wan@google.com): record the test case name when the

+      // ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or

+      // TearDownTestCase().

+      state.first_used_test_case = test_info->test_case_name();

+      state.first_used_test = test_info->name();

+    }

+  }

+}

+

+// Unregisters a mock method; removes the owning mock object from the

+// registry when the last mock method associated with it has been

+// unregistered.  This is called only in the destructor of

+// FunctionMockerBase.

+void Mock::UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {

+  internal::g_gmock_mutex.AssertHeld();

+  for (MockObjectRegistry::StateMap::iterator it =

+           g_mock_object_registry.states().begin();

+       it != g_mock_object_registry.states().end(); ++it) {

+    FunctionMockers& mockers = it->second.function_mockers;

+    if (mockers.erase(mocker) > 0) {

+      // mocker was in mockers and has been just removed.

+      if (mockers.empty()) {

+        g_mock_object_registry.states().erase(it);

+      }

+      return;

+    }

+  }

+}

+

+// Clears all ON_CALL()s set on the given mock object.

+void Mock::ClearDefaultActionsLocked(void* mock_obj)

+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {

+  internal::g_gmock_mutex.AssertHeld();

+

+  if (g_mock_object_registry.states().count(mock_obj) == 0) {

+    // No ON_CALL() was set on the given mock object.

+    return;

+  }

+

+  // Clears the default actions for each mock method in the given mock

+  // object.

+  FunctionMockers& mockers =

+      g_mock_object_registry.states()[mock_obj].function_mockers;

+  for (FunctionMockers::const_iterator it = mockers.begin();

+       it != mockers.end(); ++it) {

+    (*it)->ClearDefaultActionsLocked();

+  }

+

+  // We don't clear the content of mockers, as they may still be

+  // needed by VerifyAndClearExpectationsLocked().

+}

+

+Expectation::Expectation() {}

+

+Expectation::Expectation(

+    const internal::linked_ptr<internal::ExpectationBase>& an_expectation_base)

+    : expectation_base_(an_expectation_base) {}

+

+Expectation::~Expectation() {}

+

+// Adds an expectation to a sequence.

+void Sequence::AddExpectation(const Expectation& expectation) const {

+  if (*last_expectation_ != expectation) {

+    if (last_expectation_->expectation_base() != NULL) {

+      expectation.expectation_base()->immediate_prerequisites_

+          += *last_expectation_;

+    }

+    *last_expectation_ = expectation;

+  }

+}

+

+// Creates the implicit sequence if there isn't one.

+InSequence::InSequence() {

+  if (internal::g_gmock_implicit_sequence.get() == NULL) {

+    internal::g_gmock_implicit_sequence.set(new Sequence);

+    sequence_created_ = true;

+  } else {

+    sequence_created_ = false;

+  }

+}

+

+// Deletes the implicit sequence if it was created by the constructor

+// of this object.

+InSequence::~InSequence() {

+  if (sequence_created_) {

+    delete internal::g_gmock_implicit_sequence.get();

+    internal::g_gmock_implicit_sequence.set(NULL);

+  }

+}

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/src/gmock.cc b/third_party/allwpilib_2018/gmock/src/gmock.cc
new file mode 100644
index 0000000..1a5ba85
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock.cc
@@ -0,0 +1,182 @@
+// 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: wan@google.com (Zhanyong Wan)

+

+#include "gmock/gmock.h"

+#include "gmock/internal/gmock-port.h"

+

+namespace testing {

+

+// TODO(wan@google.com): support using environment variables to

+// control the flag values, like what Google Test does.

+

+GMOCK_DEFINE_bool_(catch_leaked_mocks, true,

+                   "true iff Google Mock should report leaked mock objects "

+                   "as failures.");

+

+GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity,

+                     "Controls how verbose Google Mock's output is."

+                     "  Valid values:\n"

+                     "  info    - prints all messages.\n"

+                     "  warning - prints warnings and errors.\n"

+                     "  error   - prints errors only.");

+

+namespace internal {

+

+// Parses a string as a command line flag.  The string should have the

+// format "--gmock_flag=value".  When def_optional is true, the

+// "=value" part can be omitted.

+//

+// Returns the value of the flag, or NULL if the parsing failed.

+static const char* ParseGoogleMockFlagValue(const char* str,

+                                            const char* flag,

+                                            bool def_optional) {

+  // str and flag must not be NULL.

+  if (str == NULL || flag == NULL) return NULL;

+

+  // The flag must start with "--gmock_".

+  const std::string flag_str = std::string("--gmock_") + flag;

+  const size_t flag_len = flag_str.length();

+  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;

+

+  // Skips the flag name.

+  const char* flag_end = str + flag_len;

+

+  // When def_optional is true, it's OK to not have a "=value" part.

+  if (def_optional && (flag_end[0] == '\0')) {

+    return flag_end;

+  }

+

+  // If def_optional is true and there are more characters after the

+  // flag name, or if def_optional is false, there must be a '=' after

+  // the flag name.

+  if (flag_end[0] != '=') return NULL;

+

+  // Returns the string after "=".

+  return flag_end + 1;

+}

+

+// Parses a string for a Google Mock bool flag, in the form of

+// "--gmock_flag=value".

+//

+// On success, stores the value of the flag in *value, and returns

+// true.  On failure, returns false without changing *value.

+static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,

+                                    bool* value) {

+  // Gets the value of the flag as a string.

+  const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);

+

+  // Aborts if the parsing failed.

+  if (value_str == NULL) return false;

+

+  // Converts the string value to a bool.

+  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');

+  return true;

+}

+

+// Parses a string for a Google Mock string flag, in the form of

+// "--gmock_flag=value".

+//

+// On success, stores the value of the flag in *value, and returns

+// true.  On failure, returns false without changing *value.

+static bool ParseGoogleMockStringFlag(const char* str, const char* flag,

+                                      std::string* value) {

+  // Gets the value of the flag as a string.

+  const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);

+

+  // Aborts if the parsing failed.

+  if (value_str == NULL) return false;

+

+  // Sets *value to the value of the flag.

+  *value = value_str;

+  return true;

+}

+

+// The internal implementation of InitGoogleMock().

+//

+// The type parameter CharType can be instantiated to either char or

+// wchar_t.

+template <typename CharType>

+void InitGoogleMockImpl(int* argc, CharType** argv) {

+  // Makes sure Google Test is initialized.  InitGoogleTest() is

+  // idempotent, so it's fine if the user has already called it.

+  InitGoogleTest(argc, argv);

+  if (*argc <= 0) return;

+

+  for (int i = 1; i != *argc; i++) {

+    const std::string arg_string = StreamableToString(argv[i]);

+    const char* const arg = arg_string.c_str();

+

+    // Do we see a Google Mock flag?

+    if (ParseGoogleMockBoolFlag(arg, "catch_leaked_mocks",

+                                &GMOCK_FLAG(catch_leaked_mocks)) ||

+        ParseGoogleMockStringFlag(arg, "verbose", &GMOCK_FLAG(verbose))) {

+      // Yes.  Shift the remainder of the argv list left by one.  Note

+      // that argv has (*argc + 1) elements, the last one always being

+      // NULL.  The following loop moves the trailing NULL element as

+      // well.

+      for (int j = i; j != *argc; j++) {

+        argv[j] = argv[j + 1];

+      }

+

+      // Decrements the argument count.

+      (*argc)--;

+

+      // We also need to decrement the iterator as we just removed

+      // an element.

+      i--;

+    }

+  }

+}

+

+}  // namespace internal

+

+// Initializes Google Mock.  This must be called before running the

+// tests.  In particular, it parses a command line for the flags that

+// Google Mock recognizes.  Whenever a Google Mock flag is seen, it is

+// removed from argv, and *argc is decremented.

+//

+// No value is returned.  Instead, the Google Mock flag variables are

+// updated.

+//

+// Since Google Test is needed for Google Mock to work, this function

+// also initializes Google Test and parses its flags, if that hasn't

+// been done.

+GTEST_API_ void InitGoogleMock(int* argc, char** argv) {

+  internal::InitGoogleMockImpl(argc, argv);

+}

+

+// This overloaded version can be used in Windows programs compiled in

+// UNICODE mode.

+GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv) {

+  internal::InitGoogleMockImpl(argc, argv);

+}

+

+}  // namespace testing

diff --git a/third_party/allwpilib_2018/gmock/src/gmock_main.cc b/third_party/allwpilib_2018/gmock/src/gmock_main.cc
new file mode 100644
index 0000000..e085ba3
--- /dev/null
+++ b/third_party/allwpilib_2018/gmock/src/gmock_main.cc
@@ -0,0 +1,54 @@
+// 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: wan@google.com (Zhanyong Wan)

+

+#include <iostream>

+#include "gmock/gmock.h"

+#include "gtest/gtest.h"

+

+// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which

+// causes a link error when _tmain is defined in a static library and UNICODE

+// is enabled. For this reason instead of _tmain, main function is used on

+// Windows. See the following link to track the current status of this bug:

+// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464  // NOLINT

+#if GTEST_OS_WINDOWS_MOBILE

+# include <tchar.h>  // NOLINT

+

+GTEST_API_ int _tmain(int argc, TCHAR** argv) {

+#else

+GTEST_API_ int main(int argc, char** argv) {

+#endif  // GTEST_OS_WINDOWS_MOBILE

+  std::cout << "Running main() from gmock_main.cc\n";

+  // Since Google Mock depends on Google Test, InitGoogleMock() is

+  // also responsible for initializing Google Test.  Therefore there's

+  // no need for calling testing::InitGoogleTest() separately.

+  testing::InitGoogleMock(&argc, argv);

+  return RUN_ALL_TESTS();

+}

diff --git a/third_party/allwpilib_2018/gradle/wrapper/gradle-wrapper.jar b/third_party/allwpilib_2018/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
--- /dev/null
+++ b/third_party/allwpilib_2018/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/third_party/allwpilib_2018/gradle/wrapper/gradle-wrapper.properties b/third_party/allwpilib_2018/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..fe51c02
--- /dev/null
+++ b/third_party/allwpilib_2018/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME

+distributionPath=wrapper/dists

+zipStoreBase=GRADLE_USER_HOME

+zipStorePath=wrapper/dists

+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip

diff --git a/third_party/allwpilib_2018/gradlew b/third_party/allwpilib_2018/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/third_party/allwpilib_2018/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/third_party/allwpilib_2018/gradlew.bat b/third_party/allwpilib_2018/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/third_party/allwpilib_2018/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off

+@rem ##########################################################################

+@rem

+@rem  Gradle startup script for Windows

+@rem

+@rem ##########################################################################

+

+@rem Set local scope for the variables with windows NT shell

+if "%OS%"=="Windows_NT" setlocal

+

+set DIRNAME=%~dp0

+if "%DIRNAME%" == "" set DIRNAME=.

+set APP_BASE_NAME=%~n0

+set APP_HOME=%DIRNAME%

+

+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.

+set DEFAULT_JVM_OPTS=

+

+@rem Find java.exe

+if defined JAVA_HOME goto findJavaFromJavaHome

+

+set JAVA_EXE=java.exe

+%JAVA_EXE% -version >NUL 2>&1

+if "%ERRORLEVEL%" == "0" goto init

+

+echo.

+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:findJavaFromJavaHome

+set JAVA_HOME=%JAVA_HOME:"=%

+set JAVA_EXE=%JAVA_HOME%/bin/java.exe

+

+if exist "%JAVA_EXE%" goto init

+

+echo.

+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:init

+@rem Get command-line arguments, handling Windows variants

+

+if not "%OS%" == "Windows_NT" goto win9xME_args

+

+:win9xME_args

+@rem Slurp the command line arguments.

+set CMD_LINE_ARGS=

+set _SKIP=2

+

+:win9xME_args_slurp

+if "x%~1" == "x" goto execute

+

+set CMD_LINE_ARGS=%*

+

+:execute

+@rem Setup the command line

+

+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

+

+@rem Execute Gradle

+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

+

+:end

+@rem End local scope for the variables with windows NT shell

+if "%ERRORLEVEL%"=="0" goto mainEnd

+

+:fail

+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

+rem the _cmd.exe /c_ return code!

+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1

+exit /b 1

+

+:mainEnd

+if "%OS%"=="Windows_NT" endlocal

+

+:omega

diff --git a/third_party/allwpilib_2018/hal/.styleguide b/third_party/allwpilib_2018/hal/.styleguide
new file mode 100644
index 0000000..83d03b0
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/.styleguide
@@ -0,0 +1,43 @@
+cppHeaderFileInclude {
+  \.h$
+  \.hpp$
+  \.inc$
+}
+
+cppSrcFileInclude {
+  \.cpp$
+}
+
+generatedFileExclude {
+  gmock/
+  ni-libraries/include/
+  ni-libraries/lib/
+  hal/src/main/native/athena/ctre/
+  hal/src/main/native/athena/frccansae/
+  hal/src/main/native/athena/visa/
+  hal/src/main/native/include/ctre/
+  UsageReporting\.h$
+}
+
+modifiableFileExclude {
+  wpilibj/src/arm-linux-jni/
+  wpilibj/src/main/native/cpp/
+  \.patch$
+  \.png$
+  \.py$
+  \.so$
+}
+
+includeOtherLibs {
+  ^FRC_FPGA_ChipObject/
+  ^FRC_NetworkCommunication/
+  ^i2clib/
+  ^llvm/
+  ^opencv2/
+  ^spilib/
+  ^support/
+}
+
+includeProject {
+  ^ctre/
+}
diff --git a/third_party/allwpilib_2018/hal/build.gradle b/third_party/allwpilib_2018/hal/build.gradle
new file mode 100644
index 0000000..3fef7b1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/build.gradle
@@ -0,0 +1,222 @@
+apply plugin: 'cpp'
+apply plugin: 'google-test'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+
+apply from: '../config.gradle'
+
+ext.addHalToLinker = { binary->
+    if (binary.targetPlatform.architecture.name == 'athena') {
+        binary.lib project: ':hal', library: 'halAthena', linkage: 'shared'
+    } else {
+        binary.lib project: ':hal', library: 'halSim', linkage: 'shared'
+    }
+}
+
+model {
+    dependencyConfigs {
+        wpiutil(DependencyConfig) {
+            groupId = 'edu.wpi.first.wpiutil'
+            artifactId = 'wpiutil-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '3.+'
+            sharedConfigs = [ halAthena: [], halSim: [], halDev: [], halSimTestingBaseTest: [] ]
+            staticConfigs = [ halSimStaticDeps: [] ]
+        }
+    }
+    // Exports config is a utility to enable exporting all symbols in a C++ library on windows to a DLL.
+    // This removes the need for DllExport on a library. However, the gradle C++ builder has a bug
+    // where some extra symbols are added that cannot be resolved at link time. This configuration
+    // lets you specify specific symbols to exlude from exporting.
+    exportsConfigs {
+        halSim(ExportsConfig) {
+            x86ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVbad_cast',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure' ]
+            x64ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVbad_cast',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure' ]
+        }
+        halSimStaticDeps(ExportsConfig) {
+            x86SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('HAL_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+            x64SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('HAL_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+        }
+    }
+    components {
+        if (!project.hasProperty('skipAthena')) {
+            halAthena(NativeLibrarySpec) {
+                baseName = 'wpiHal'
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = [ 'src/main/native/shared', 'src/main/native/athena' ]
+                            includes = ["**/*.cpp"]
+                        }
+                        exportedHeaders {
+                            srcDirs = ["src/main/native/include"]
+                        }
+                    }
+                }
+                binaries.all { binary->
+                    if (binary.targetPlatform.architecture.name != 'athena') {
+                        binary.buildable = false
+                    }
+                }
+            }
+        }
+        if (!project.hasProperty('onlyAthena')) {
+            halSim(NativeLibrarySpec) {
+                baseName = 'wpiHal'
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = [ 'src/main/native/shared', 'src/main/native/sim' ]
+                            includes = ["**/*.cpp"]
+                        }
+                        exportedHeaders {
+                            srcDirs = ["src/main/native/include"]
+                        }
+                    }
+                }
+                binaries.all { binary ->
+                    if (binary.targetPlatform.operatingSystem.linux) {
+                        linker.args "-ldl"
+                    }
+                }
+            }
+            if (project.hasProperty('buildHalStaticDeps')) {
+                halSimStaticDeps(NativeLibrarySpec) {
+                    baseName = 'wpiHal'
+                    binaries {
+                        withType(StaticLibraryBinarySpec) {
+                            buildable = false
+                        }
+                    }
+                    sources {
+                        cpp {
+                            source {
+                                srcDirs = [ 'src/main/native/shared', 'src/main/native/sim' ]
+                                includes = ["**/*.cpp"]
+                            }
+                            exportedHeaders {
+                                srcDirs = ["src/main/native/include"]
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        // The TestingBase library is a workaround for an issue with the GoogleTest plugin.
+        // The plugin by default will rebuild the entire test source set, which increases
+        // build time. By testing an empty library, and then just linking the already built component
+        // into the test, we save the extra build
+        halSimTestingBase(NativeLibrarySpec) { }
+        // By default, a development executable will be generated. This is to help the case of
+        // testing specific functionality of the library.
+        if (!project.hasProperty('skipDevExe')) {
+            halDev(NativeExecutableSpec) {
+                binaries.all {
+                    project.addHalToLinker(it)
+                }
+                sources {
+                    cpp {
+                        source {
+                            srcDirs 'src/dev/native/cpp'
+                            include '**/*.cpp'
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/dev/native/include'
+                        }
+                    }
+                }
+            }
+        }
+    }
+    testSuites {
+        halSimTestingBaseTest {
+            sources {
+                cpp.source.srcDir 'src/test/native/cpp'
+                cpp.exportedHeaders.srcDir 'src/test/native/include'
+            }
+        }
+    }
+    binaries {
+        all {
+            project(':ni-libraries').addNiLibrariesToLinker(it)
+        }
+        withType(GoogleTestTestSuiteBinarySpec) {
+            if (it.component.testedComponent.name.contains('TestingBase') && !project.hasProperty('onlyAthena')) {
+                project(':gmock').addGmockToLinker(it)
+                project.addHalToLinker(it)
+            } else {
+                it.buildable = false
+            }
+        }
+    }
+    tasks {
+        runCpp(Exec) {
+            def found = false
+            $.components.each {
+                if (it in NativeExecutableSpec && it.name == 'halDev') {
+                    it.binaries.each {
+                        if (!found) {
+                            def arch = it.targetPlatform.architecture.name
+                            if (arch == 'x86-64' || arch == 'x86') {
+                                dependsOn it.tasks.install
+                                commandLine it.tasks.install.runScript
+                                found = true
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        getHeaders(Task) {
+            def list = []
+            $.components.each {
+                if (it in NativeLibrarySpec && (it.name == 'halAthena' || it.name == 'halSim')) {
+                    it.sources.each {
+                        it.exportedHeaders.srcDirs.each {
+                            list.add(it)
+                        }
+                    }
+                    it.binaries.each {
+                        it.libs.each {
+                            it.includeRoots.each {
+                                list.add(it)
+                            }
+                        }
+                    }
+                }
+            }
+            list = list.unique(false)
+            doLast {
+                list.each {
+                    print "WPIHEADER: "
+                    println it
+                }
+            }
+        }
+    }
+}
+
+apply from: 'publish.gradle'
diff --git a/third_party/allwpilib_2018/hal/publish.gradle b/third_party/allwpilib_2018/hal/publish.gradle
new file mode 100644
index 0000000..924bf17
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/publish.gradle
@@ -0,0 +1,125 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'hal'
+def artifactGroupId = 'edu.wpi.first.hal'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'hal'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/athena') {
+        into '/athena'
+    }
+
+    from('src/main/native/sim') {
+        into '/sim'
+    }
+
+    from('src/main/native/shared') {
+        into '/shared'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'hal'
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+build.dependsOn cppHeadersZip
+build.dependsOn cppSourcesZip
+
+
+model {
+    publishing {
+        def halAthenaTaskList  = []
+        if (!project.hasProperty('skipAthena')) {
+            halAthenaTaskList = createComponentZipTasks($.components, 'halAthena', 'zipcpp', Zip, project, includeStandardZipFormat)
+        }
+        def halSimTaskList = []
+        if (!project.hasProperty('onlyAthena')) {
+            halSimTaskList = createComponentZipTasks($.components, 'halSim', 'zipcpp', Zip, project, includeStandardZipFormat)
+        }
+
+        def allTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            def combinedList = []
+            halAthenaTaskList.each {
+                combinedList.add(it)
+            }
+            halSimTaskList.each {
+                combinedList.add(it)
+            }
+            allTask = createAllCombined(combinedList, 'hal', 'zipcpp', Zip, project)
+        }
+
+        def halSimStaticDepsTaskList = []
+        if (project.hasProperty('buildHalStaticDeps')) {
+            halSimStaticDepsTaskList = createComponentZipTasks($.components, 'halSimStaticDeps', 'zipcpp', Zip, project, includeStandardZipFormat)
+            if (!project.hasProperty('jenkinsBuild')) {
+                def staticAllTask = createAllCombined(halSimStaticDepsTaskList, 'halSimStaticDeps', 'zipcpp', Zip, project)
+                halSimStaticDepsTaskList.add(staticAllTask)
+            }
+        }
+
+        publications {
+            cpp(MavenPublication) {
+                halAthenaTaskList.each {
+                    artifact it
+                }
+                halSimTaskList.each {
+                    artifact it
+                }
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allTask
+                }
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+            }
+            if (project.hasProperty('buildHalStaticDeps')) {
+                cppStaticDeps(MavenPublication) {
+                    halSimStaticDepsTaskList.each {
+                        artifact it
+                    }
+
+                    artifactId = baseArtifactId + 'StaticDeps'
+                    groupId artifactGroupId
+                    version pubVersion
+                }
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/hal/src/dev/native/cpp/main.cpp b/third_party/allwpilib_2018/hal/src/dev/native/cpp/main.cpp
new file mode 100644
index 0000000..4b3e1f7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/dev/native/cpp/main.cpp
@@ -0,0 +1,15 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "HAL/HAL.h"
+
+int main() {
+  std::cout << "Hello World" << std::endl;
+  std::cout << HAL_GetRuntimeType() << std::endl;
+}
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Accelerometer.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Accelerometer.cpp
new file mode 100644
index 0000000..f0917f4
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Accelerometer.cpp
@@ -0,0 +1,264 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Accelerometer.h"
+
+#include <stdint.h>
+
+#include <cassert>
+#include <cstdio>
+#include <memory>
+
+#include "HAL/ChipObject.h"
+#include "HAL/HAL.h"
+
+using namespace hal;
+
+// The 7-bit I2C address with a 0 "send" bit
+static constexpr uint8_t kSendAddress = (0x1c << 1) | 0;
+
+// The 7-bit I2C address with a 1 "receive" bit
+static constexpr uint8_t kReceiveAddress = (0x1c << 1) | 1;
+
+static constexpr uint8_t kControlTxRx = 1;
+static constexpr uint8_t kControlStart = 2;
+static constexpr uint8_t kControlStop = 4;
+
+static std::unique_ptr<tAccel> accel;
+static HAL_AccelerometerRange accelerometerRange;
+
+// Register addresses
+enum Register {
+  kReg_Status = 0x00,
+  kReg_OutXMSB = 0x01,
+  kReg_OutXLSB = 0x02,
+  kReg_OutYMSB = 0x03,
+  kReg_OutYLSB = 0x04,
+  kReg_OutZMSB = 0x05,
+  kReg_OutZLSB = 0x06,
+  kReg_Sysmod = 0x0B,
+  kReg_IntSource = 0x0C,
+  kReg_WhoAmI = 0x0D,
+  kReg_XYZDataCfg = 0x0E,
+  kReg_HPFilterCutoff = 0x0F,
+  kReg_PLStatus = 0x10,
+  kReg_PLCfg = 0x11,
+  kReg_PLCount = 0x12,
+  kReg_PLBfZcomp = 0x13,
+  kReg_PLThsReg = 0x14,
+  kReg_FFMtCfg = 0x15,
+  kReg_FFMtSrc = 0x16,
+  kReg_FFMtThs = 0x17,
+  kReg_FFMtCount = 0x18,
+  kReg_TransientCfg = 0x1D,
+  kReg_TransientSrc = 0x1E,
+  kReg_TransientThs = 0x1F,
+  kReg_TransientCount = 0x20,
+  kReg_PulseCfg = 0x21,
+  kReg_PulseSrc = 0x22,
+  kReg_PulseThsx = 0x23,
+  kReg_PulseThsy = 0x24,
+  kReg_PulseThsz = 0x25,
+  kReg_PulseTmlt = 0x26,
+  kReg_PulseLtcy = 0x27,
+  kReg_PulseWind = 0x28,
+  kReg_ASlpCount = 0x29,
+  kReg_CtrlReg1 = 0x2A,
+  kReg_CtrlReg2 = 0x2B,
+  kReg_CtrlReg3 = 0x2C,
+  kReg_CtrlReg4 = 0x2D,
+  kReg_CtrlReg5 = 0x2E,
+  kReg_OffX = 0x2F,
+  kReg_OffY = 0x30,
+  kReg_OffZ = 0x31
+};
+
+namespace hal {
+namespace init {
+void InitializeAccelerometer() {}
+}  // namespace init
+}  // namespace hal
+
+namespace hal {
+
+static void writeRegister(Register reg, uint8_t data);
+static uint8_t readRegister(Register reg);
+
+/**
+ * Initialize the accelerometer.
+ */
+static void initializeAccelerometer() {
+  int32_t status;
+
+  if (!accel) {
+    accel.reset(tAccel::create(&status));
+
+    accelerometerRange = HAL_AccelerometerRange::HAL_AccelerometerRange_k2G;
+
+    // Enable I2C
+    accel->writeCNFG(1, &status);
+
+    // Set the counter to 100 kbps
+    accel->writeCNTR(213, &status);
+
+    // The device identification number should be 0x2a
+    assert(readRegister(kReg_WhoAmI) == 0x2a);
+  }
+}
+
+static void writeRegister(Register reg, uint8_t data) {
+  int32_t status = 0;
+  uint64_t initialTime;
+
+  accel->writeADDR(kSendAddress, &status);
+
+  // Send a start transmit/receive message with the register address
+  accel->writeCNTL(kControlStart | kControlTxRx, &status);
+  accel->writeDATO(reg, &status);
+  accel->strobeGO(&status);
+
+  // Execute and wait until it's done (up to a millisecond)
+  initialTime = HAL_GetFPGATime(&status);
+  while (accel->readSTAT(&status) & 1) {
+    if (HAL_GetFPGATime(&status) > initialTime + 1000) break;
+  }
+
+  // Send a stop transmit/receive message with the data
+  accel->writeCNTL(kControlStop | kControlTxRx, &status);
+  accel->writeDATO(data, &status);
+  accel->strobeGO(&status);
+
+  // Execute and wait until it's done (up to a millisecond)
+  initialTime = HAL_GetFPGATime(&status);
+  while (accel->readSTAT(&status) & 1) {
+    if (HAL_GetFPGATime(&status) > initialTime + 1000) break;
+  }
+}
+
+static uint8_t readRegister(Register reg) {
+  int32_t status = 0;
+  uint64_t initialTime;
+
+  // Send a start transmit/receive message with the register address
+  accel->writeADDR(kSendAddress, &status);
+  accel->writeCNTL(kControlStart | kControlTxRx, &status);
+  accel->writeDATO(reg, &status);
+  accel->strobeGO(&status);
+
+  // Execute and wait until it's done (up to a millisecond)
+  initialTime = HAL_GetFPGATime(&status);
+  while (accel->readSTAT(&status) & 1) {
+    if (HAL_GetFPGATime(&status) > initialTime + 1000) break;
+  }
+
+  // Receive a message with the data and stop
+  accel->writeADDR(kReceiveAddress, &status);
+  accel->writeCNTL(kControlStart | kControlStop | kControlTxRx, &status);
+  accel->strobeGO(&status);
+
+  // Execute and wait until it's done (up to a millisecond)
+  initialTime = HAL_GetFPGATime(&status);
+  while (accel->readSTAT(&status) & 1) {
+    if (HAL_GetFPGATime(&status) > initialTime + 1000) break;
+  }
+
+  return accel->readDATI(&status);
+}
+
+/**
+ * Convert a 12-bit raw acceleration value into a scaled double in units of
+ * 1 g-force, taking into account the accelerometer range.
+ */
+static double unpackAxis(int16_t raw) {
+  // The raw value is actually 12 bits, not 16, so we need to propogate the
+  // 2's complement sign bit to the unused 4 bits for this to work with
+  // negative numbers.
+  raw <<= 4;
+  raw >>= 4;
+
+  switch (accelerometerRange) {
+    case HAL_AccelerometerRange_k2G:
+      return raw / 1024.0;
+    case HAL_AccelerometerRange_k4G:
+      return raw / 512.0;
+    case HAL_AccelerometerRange_k8G:
+      return raw / 256.0;
+    default:
+      return 0.0;
+  }
+}
+
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Set the accelerometer to active or standby mode.  It must be in standby
+ * mode to change any configuration.
+ */
+void HAL_SetAccelerometerActive(HAL_Bool active) {
+  initializeAccelerometer();
+
+  uint8_t ctrlReg1 = readRegister(kReg_CtrlReg1);
+  ctrlReg1 &= ~1;  // Clear the existing active bit
+  writeRegister(kReg_CtrlReg1, ctrlReg1 | (active ? 1 : 0));
+}
+
+/**
+ * Set the range of values that can be measured (either 2, 4, or 8 g-forces).
+ * The accelerometer should be in standby mode when this is called.
+ */
+void HAL_SetAccelerometerRange(HAL_AccelerometerRange range) {
+  initializeAccelerometer();
+
+  accelerometerRange = range;
+
+  uint8_t xyzDataCfg = readRegister(kReg_XYZDataCfg);
+  xyzDataCfg &= ~3;  // Clear the existing two range bits
+  writeRegister(kReg_XYZDataCfg, xyzDataCfg | range);
+}
+
+/**
+ * Get the x-axis acceleration
+ *
+ * This is a floating point value in units of 1 g-force
+ */
+double HAL_GetAccelerometerX(void) {
+  initializeAccelerometer();
+
+  int32_t raw =
+      (readRegister(kReg_OutXMSB) << 4) | (readRegister(kReg_OutXLSB) >> 4);
+  return unpackAxis(raw);
+}
+
+/**
+ * Get the y-axis acceleration
+ *
+ * This is a floating point value in units of 1 g-force
+ */
+double HAL_GetAccelerometerY(void) {
+  initializeAccelerometer();
+
+  int32_t raw =
+      (readRegister(kReg_OutYMSB) << 4) | (readRegister(kReg_OutYLSB) >> 4);
+  return unpackAxis(raw);
+}
+
+/**
+ * Get the z-axis acceleration
+ *
+ * This is a floating point value in units of 1 g-force
+ */
+double HAL_GetAccelerometerZ(void) {
+  initializeAccelerometer();
+
+  int32_t raw =
+      (readRegister(kReg_OutZMSB) << 4) | (readRegister(kReg_OutZLSB) >> 4);
+  return unpackAxis(raw);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogAccumulator.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogAccumulator.cpp
new file mode 100644
index 0000000..fe017e5
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogAccumulator.cpp
@@ -0,0 +1,204 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogAccumulator.h"
+
+#include "AnalogInternal.h"
+#include "HAL/HAL.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogAccumulator() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Is the channel attached to an accumulator.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ * @return The analog channel is attached to an accumulator.
+ */
+HAL_Bool HAL_IsAccumulatorChannel(HAL_AnalogInputHandle analogPortHandle,
+                                  int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  for (int32_t i = 0; i < kNumAccumulators; i++) {
+    if (port->channel == kAccumulatorChannels[i]) return true;
+  }
+  return false;
+}
+
+/**
+ * Initialize the accumulator.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ */
+void HAL_InitAccumulator(HAL_AnalogInputHandle analogPortHandle,
+                         int32_t* status) {
+  if (!HAL_IsAccumulatorChannel(analogPortHandle, status)) {
+    *status = HAL_INVALID_ACCUMULATOR_CHANNEL;
+    return;
+  }
+  HAL_SetAccumulatorCenter(analogPortHandle, 0, status);
+  HAL_ResetAccumulator(analogPortHandle, status);
+}
+
+/**
+ * Resets the accumulator to the initial value.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ */
+void HAL_ResetAccumulator(HAL_AnalogInputHandle analogPortHandle,
+                          int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (port->accumulator == nullptr) {
+    *status = NULL_PARAMETER;
+    return;
+  }
+  port->accumulator->strobeReset(status);
+}
+
+/**
+ * Set the center value of the accumulator.
+ *
+ * The center value is subtracted from each A/D value before it is added to the
+ * accumulator. This is used for the center value of devices like gyros and
+ * accelerometers to make integration work and to take the device offset into
+ * account when integrating.
+ *
+ * This center value is based on the output of the oversampled and averaged
+ * source from channel 1. Because of this, any non-zero oversample bits will
+ * affect the size of the value for this field.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ * @param center The center value of the accumulator.
+ */
+void HAL_SetAccumulatorCenter(HAL_AnalogInputHandle analogPortHandle,
+                              int32_t center, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (port->accumulator == nullptr) {
+    *status = NULL_PARAMETER;
+    return;
+  }
+  port->accumulator->writeCenter(center, status);
+}
+
+/**
+ * Set the accumulator's deadband.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ * @param deadband The deadband of the accumulator.
+ */
+void HAL_SetAccumulatorDeadband(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t deadband, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (port->accumulator == nullptr) {
+    *status = NULL_PARAMETER;
+    return;
+  }
+  port->accumulator->writeDeadband(deadband, status);
+}
+
+/**
+ * Read the accumulated value.
+ *
+ * Read the value that has been accumulating on channel 1.
+ * The accumulator is attached after the oversample and average engine.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ * @return The 64-bit value accumulated since the last Reset().
+ */
+int64_t HAL_GetAccumulatorValue(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  if (port->accumulator == nullptr) {
+    *status = NULL_PARAMETER;
+    return 0;
+  }
+  int64_t value = port->accumulator->readOutput_Value(status);
+  return value;
+}
+
+/**
+ * Read the number of accumulated values.
+ *
+ * Read the count of the accumulated values since the accumulator was last
+ * Reset().
+ *
+ * @param analogPortHandle Handle to the analog port.
+ * @return The number of times samples from the channel were accumulated.
+ */
+int64_t HAL_GetAccumulatorCount(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  if (port->accumulator == nullptr) {
+    *status = NULL_PARAMETER;
+    return 0;
+  }
+  return port->accumulator->readOutput_Count(status);
+}
+
+/**
+ * Read the accumulated value and the number of accumulated values atomically.
+ *
+ * This function reads the value and count from the FPGA atomically.
+ * This can be used for averaging.
+ *
+ * @param analogPortHandle Handle to the analog port.
+ * @param value Pointer to the 64-bit accumulated output.
+ * @param count Pointer to the number of accumulation cycles.
+ */
+void HAL_GetAccumulatorOutput(HAL_AnalogInputHandle analogPortHandle,
+                              int64_t* value, int64_t* count, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (port->accumulator == nullptr) {
+    *status = NULL_PARAMETER;
+    return;
+  }
+  if (value == nullptr || count == nullptr) {
+    *status = NULL_PARAMETER;
+    return;
+  }
+
+  tAccumulator::tOutput output = port->accumulator->readOutput(status);
+
+  *value = output.Value;
+  *count = output.Count;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogGyro.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogGyro.cpp
new file mode 100644
index 0000000..cdc9b0c
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogGyro.cpp
@@ -0,0 +1,255 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogGyro.h"
+
+#include <thread>
+
+#include "AnalogInternal.h"
+#include "HAL/AnalogAccumulator.h"
+#include "HAL/AnalogInput.h"
+#include "HAL/handles/IndexedHandleResource.h"
+
+namespace {
+
+struct AnalogGyro {
+  HAL_AnalogInputHandle handle;
+  double voltsPerDegreePerSecond;
+  double offset;
+  int32_t center;
+};
+
+}  // namespace
+
+static constexpr uint32_t kOversampleBits = 10;
+static constexpr uint32_t kAverageBits = 0;
+static constexpr double kSamplesPerSecond = 50.0;
+static constexpr double kCalibrationSampleTime = 5.0;
+static constexpr double kDefaultVoltsPerDegreePerSecond = 0.007;
+
+using namespace hal;
+
+static IndexedHandleResource<HAL_GyroHandle, AnalogGyro, kNumAccumulators,
+                             HAL_HandleEnum::AnalogGyro>* analogGyroHandles;
+
+namespace hal {
+namespace init {
+void InitializeAnalogGyro() {
+  static IndexedHandleResource<HAL_GyroHandle, AnalogGyro, kNumAccumulators,
+                               HAL_HandleEnum::AnalogGyro>
+      agHandles;
+  analogGyroHandles = &agHandles;
+}
+}  // namespace init
+}  // namespace hal
+
+static void Wait(double seconds) {
+  if (seconds < 0.0) return;
+  std::this_thread::sleep_for(std::chrono::duration<double>(seconds));
+}
+
+extern "C" {
+
+HAL_GyroHandle HAL_InitializeAnalogGyro(HAL_AnalogInputHandle analogHandle,
+                                        int32_t* status) {
+  if (!HAL_IsAccumulatorChannel(analogHandle, status)) {
+    if (*status == 0) {
+      *status = HAL_INVALID_ACCUMULATOR_CHANNEL;
+    }
+    return HAL_kInvalidHandle;
+  }
+
+  // handle known to be correct, so no need to type check
+  int16_t channel = getHandleIndex(analogHandle);
+
+  auto handle = analogGyroHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  // Initialize port structure
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {  // would only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  gyro->handle = analogHandle;
+  gyro->voltsPerDegreePerSecond = 0;
+  gyro->offset = 0;
+  gyro->center = 0;
+
+  return handle;
+}
+
+void HAL_SetupAnalogGyro(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  gyro->voltsPerDegreePerSecond = kDefaultVoltsPerDegreePerSecond;
+
+  HAL_SetAnalogAverageBits(gyro->handle, kAverageBits, status);
+  if (*status != 0) return;
+  HAL_SetAnalogOversampleBits(gyro->handle, kOversampleBits, status);
+  if (*status != 0) return;
+  double sampleRate =
+      kSamplesPerSecond * (1 << (kAverageBits + kOversampleBits));
+  HAL_SetAnalogSampleRate(sampleRate, status);
+  if (*status != 0) return;
+  Wait(0.1);
+
+  HAL_SetAnalogGyroDeadband(handle, 0.0, status);
+  if (*status != 0) return;
+}
+
+void HAL_FreeAnalogGyro(HAL_GyroHandle handle) {
+  analogGyroHandles->Free(handle);
+}
+
+void HAL_SetAnalogGyroParameters(HAL_GyroHandle handle,
+                                 double voltsPerDegreePerSecond, double offset,
+                                 int32_t center, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  gyro->voltsPerDegreePerSecond = voltsPerDegreePerSecond;
+  gyro->offset = offset;
+  gyro->center = center;
+  HAL_SetAccumulatorCenter(gyro->handle, center, status);
+}
+
+void HAL_SetAnalogGyroVoltsPerDegreePerSecond(HAL_GyroHandle handle,
+                                              double voltsPerDegreePerSecond,
+                                              int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  gyro->voltsPerDegreePerSecond = voltsPerDegreePerSecond;
+}
+
+void HAL_ResetAnalogGyro(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  HAL_ResetAccumulator(gyro->handle, status);
+  if (*status != 0) return;
+
+  const double sampleTime = 1.0 / HAL_GetAnalogSampleRate(status);
+  const double overSamples =
+      1 << HAL_GetAnalogOversampleBits(gyro->handle, status);
+  const double averageSamples =
+      1 << HAL_GetAnalogAverageBits(gyro->handle, status);
+  if (*status != 0) return;
+  Wait(sampleTime * overSamples * averageSamples);
+}
+
+void HAL_CalibrateAnalogGyro(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  HAL_InitAccumulator(gyro->handle, status);
+  if (*status != 0) return;
+  Wait(kCalibrationSampleTime);
+
+  int64_t value;
+  int64_t count;
+  HAL_GetAccumulatorOutput(gyro->handle, &value, &count, status);
+  if (*status != 0) return;
+
+  gyro->center = static_cast<int32_t>(
+      static_cast<double>(value) / static_cast<double>(count) + .5);
+
+  gyro->offset = static_cast<double>(value) / static_cast<double>(count) -
+                 static_cast<double>(gyro->center);
+  HAL_SetAccumulatorCenter(gyro->handle, gyro->center, status);
+  if (*status != 0) return;
+  HAL_ResetAnalogGyro(handle, status);
+}
+
+void HAL_SetAnalogGyroDeadband(HAL_GyroHandle handle, double volts,
+                               int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  int32_t deadband = static_cast<int32_t>(
+      volts * 1e9 / HAL_GetAnalogLSBWeight(gyro->handle, status) *
+      (1 << HAL_GetAnalogOversampleBits(gyro->handle, status)));
+  if (*status != 0) return;
+  HAL_SetAccumulatorDeadband(gyro->handle, deadband, status);
+}
+
+double HAL_GetAnalogGyroAngle(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  int64_t rawValue = 0;
+  int64_t count = 0;
+  HAL_GetAccumulatorOutput(gyro->handle, &rawValue, &count, status);
+
+  int64_t value = rawValue - static_cast<int64_t>(static_cast<double>(count) *
+                                                  gyro->offset);
+
+  double scaledValue =
+      value * 1e-9 *
+      static_cast<double>(HAL_GetAnalogLSBWeight(gyro->handle, status)) *
+      static_cast<double>(1 << HAL_GetAnalogAverageBits(gyro->handle, status)) /
+      (HAL_GetAnalogSampleRate(status) * gyro->voltsPerDegreePerSecond);
+
+  return scaledValue;
+}
+
+double HAL_GetAnalogGyroRate(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return (HAL_GetAnalogAverageValue(gyro->handle, status) -
+          (static_cast<double>(gyro->center) + gyro->offset)) *
+         1e-9 * HAL_GetAnalogLSBWeight(gyro->handle, status) /
+         ((1 << HAL_GetAnalogOversampleBits(gyro->handle, status)) *
+          gyro->voltsPerDegreePerSecond);
+}
+
+double HAL_GetAnalogGyroOffset(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return gyro->offset;
+}
+
+int32_t HAL_GetAnalogGyroCenter(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return gyro->center;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInput.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInput.cpp
new file mode 100644
index 0000000..e307eb1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInput.cpp
@@ -0,0 +1,392 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogInput.h"
+
+#include <FRC_NetworkCommunication/AICalibration.h>
+#include <support/mutex.h>
+
+#include "AnalogInternal.h"
+#include "HAL/AnalogAccumulator.h"
+#include "HAL/HAL.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "PortsInternal.h"
+
+namespace hal {
+namespace init {
+void InitializeAnalogInput() {}
+}  // namespace init
+}  // namespace hal
+
+using namespace hal;
+
+extern "C" {
+
+/**
+ * Initialize the analog input port using the given port object.
+ *
+ * @param portHandle Handle to the port to initialize.
+ */
+HAL_AnalogInputHandle HAL_InitializeAnalogInputPort(HAL_PortHandle portHandle,
+                                                    int32_t* status) {
+  initializeAnalog(status);
+
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  HAL_AnalogInputHandle handle = analogInputHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  // Initialize port structure
+  auto analog_port = analogInputHandles->Get(handle);
+  if (analog_port == nullptr) {  // would only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  analog_port->channel = static_cast<uint8_t>(channel);
+  if (HAL_IsAccumulatorChannel(handle, status)) {
+    analog_port->accumulator.reset(tAccumulator::create(channel, status));
+  } else {
+    analog_port->accumulator = nullptr;
+  }
+
+  // Set default configuration
+  analogInputSystem->writeScanList(channel, channel, status);
+  HAL_SetAnalogAverageBits(handle, kDefaultAverageBits, status);
+  HAL_SetAnalogOversampleBits(handle, kDefaultOversampleBits, status);
+  return handle;
+}
+
+/**
+ * @param analogPortHandle Handle to the analog port.
+ */
+void HAL_FreeAnalogInputPort(HAL_AnalogInputHandle analogPortHandle) {
+  // no status, so no need to check for a proper free.
+  analogInputHandles->Free(analogPortHandle);
+}
+
+/**
+ * Check that the analog module number is valid.
+ *
+ * @param module The analog module number.
+ * @return Analog module is valid and present
+ */
+HAL_Bool HAL_CheckAnalogModule(int32_t module) { return module == 1; }
+
+/**
+ * Check that the analog output channel number is value.
+ * Verify that the analog channel number is one of the legal channel numbers.
+ * Channel numbers are 0-based.
+ *
+ * @param channel The analog output channel number.
+ * @return Analog channel is valid
+ */
+HAL_Bool HAL_CheckAnalogInputChannel(int32_t channel) {
+  return channel < kNumAnalogInputs && channel >= 0;
+}
+
+/**
+ * Set the sample rate.
+ *
+ * This is a global setting for the Athena and effects all channels.
+ *
+ * @param samplesPerSecond The number of samples per channel per second.
+ */
+void HAL_SetAnalogSampleRate(double samplesPerSecond, int32_t* status) {
+  // TODO: This will change when variable size scan lists are implemented.
+  // TODO: Need double comparison with epsilon.
+  // wpi_assert(!sampleRateSet || GetSampleRate() == samplesPerSecond);
+  initializeAnalog(status);
+  if (*status != 0) return;
+  setAnalogSampleRate(samplesPerSecond, status);
+}
+
+/**
+ * Get the current sample rate.
+ *
+ * This assumes one entry in the scan list.
+ * This is a global setting for the Athena and effects all channels.
+ *
+ * @return Sample rate.
+ */
+double HAL_GetAnalogSampleRate(int32_t* status) {
+  initializeAnalog(status);
+  if (*status != 0) return 0;
+  uint32_t ticksPerConversion = analogInputSystem->readLoopTiming(status);
+  uint32_t ticksPerSample =
+      ticksPerConversion * getAnalogNumActiveChannels(status);
+  return static_cast<double>(kTimebase) / static_cast<double>(ticksPerSample);
+}
+
+/**
+ * Set the number of averaging bits.
+ *
+ * This sets the number of averaging bits. The actual number of averaged samples
+ * is 2**bits. Use averaging to improve the stability of your measurement at the
+ * expense of sampling rate. The averaging is done automatically in the FPGA.
+ *
+ * @param analogPortHandle Handle to the analog port to configure.
+ * @param bits Number of bits to average.
+ */
+void HAL_SetAnalogAverageBits(HAL_AnalogInputHandle analogPortHandle,
+                              int32_t bits, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  analogInputSystem->writeAverageBits(port->channel, static_cast<uint8_t>(bits),
+                                      status);
+}
+
+/**
+ * Get the number of averaging bits.
+ *
+ * This gets the number of averaging bits from the FPGA. The actual number of
+ * averaged samples is 2**bits. The averaging is done automatically in the FPGA.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return Bits to average.
+ */
+int32_t HAL_GetAnalogAverageBits(HAL_AnalogInputHandle analogPortHandle,
+                                 int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return kDefaultAverageBits;
+  }
+  uint8_t result = analogInputSystem->readAverageBits(port->channel, status);
+  return result;
+}
+
+/**
+ * Set the number of oversample bits.
+ *
+ * This sets the number of oversample bits. The actual number of oversampled
+ * values is 2**bits. Use oversampling to improve the resolution of your
+ * measurements at the expense of sampling rate. The oversampling is done
+ * automatically in the FPGA.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @param bits Number of bits to oversample.
+ */
+void HAL_SetAnalogOversampleBits(HAL_AnalogInputHandle analogPortHandle,
+                                 int32_t bits, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  analogInputSystem->writeOversampleBits(port->channel,
+                                         static_cast<uint8_t>(bits), status);
+}
+
+/**
+ * Get the number of oversample bits.
+ *
+ * This gets the number of oversample bits from the FPGA. The actual number of
+ * oversampled values is 2**bits. The oversampling is done automatically in the
+ * FPGA.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return Bits to oversample.
+ */
+int32_t HAL_GetAnalogOversampleBits(HAL_AnalogInputHandle analogPortHandle,
+                                    int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return kDefaultOversampleBits;
+  }
+  uint8_t result = analogInputSystem->readOversampleBits(port->channel, status);
+  return result;
+}
+
+/**
+ * Get a sample straight from the channel on this module.
+ *
+ * The sample is a 12-bit value representing the 0V to 5V range of the A/D
+ * converter in the module. The units are in A/D converter codes.  Use
+ * GetVoltage() to get the analog value in calibrated units.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return A sample straight from the channel on this module.
+ */
+int32_t HAL_GetAnalogValue(HAL_AnalogInputHandle analogPortHandle,
+                           int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  tAI::tReadSelect readSelect;
+  readSelect.Channel = port->channel;
+  readSelect.Averaged = false;
+
+  std::lock_guard<wpi::mutex> lock(analogRegisterWindowMutex);
+  analogInputSystem->writeReadSelect(readSelect, status);
+  analogInputSystem->strobeLatchOutput(status);
+  return static_cast<int16_t>(analogInputSystem->readOutput(status));
+}
+
+/**
+ * Get a sample from the output of the oversample and average engine for the
+ * channel.
+ *
+ * The sample is 12-bit + the value configured in SetOversampleBits().
+ * The value configured in SetAverageBits() will cause this value to be averaged
+ * 2**bits number of samples. This is not a sliding window.  The sample will not
+ * change until 2**(OversamplBits + AverageBits) samples have been acquired from
+ * the module on this channel. Use GetAverageVoltage() to get the analog value
+ * in calibrated units.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return A sample from the oversample and average engine for the channel.
+ */
+int32_t HAL_GetAnalogAverageValue(HAL_AnalogInputHandle analogPortHandle,
+                                  int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  tAI::tReadSelect readSelect;
+  readSelect.Channel = port->channel;
+  readSelect.Averaged = true;
+
+  std::lock_guard<wpi::mutex> lock(analogRegisterWindowMutex);
+  analogInputSystem->writeReadSelect(readSelect, status);
+  analogInputSystem->strobeLatchOutput(status);
+  return static_cast<int32_t>(analogInputSystem->readOutput(status));
+}
+
+/**
+ * Get a scaled sample straight from the channel on this module.
+ *
+ * The value is scaled to units of Volts using the calibrated scaling data from
+ * GetLSBWeight() and GetOffset().
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return A scaled sample straight from the channel on this module.
+ */
+double HAL_GetAnalogVoltage(HAL_AnalogInputHandle analogPortHandle,
+                            int32_t* status) {
+  int32_t value = HAL_GetAnalogValue(analogPortHandle, status);
+  int32_t LSBWeight = HAL_GetAnalogLSBWeight(analogPortHandle, status);
+  int32_t offset = HAL_GetAnalogOffset(analogPortHandle, status);
+  double voltage = LSBWeight * 1.0e-9 * value - offset * 1.0e-9;
+  return voltage;
+}
+
+/**
+ * Get a scaled sample from the output of the oversample and average engine for
+ * the channel.
+ *
+ * The value is scaled to units of Volts using the calibrated scaling data from
+ * GetLSBWeight() and GetOffset(). Using oversampling will cause this value to
+ * be higher resolution, but it will update more slowly. Using averaging will
+ * cause this value to be more stable, but it will update more slowly.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return A scaled sample from the output of the oversample and average engine
+ * for the channel.
+ */
+double HAL_GetAnalogAverageVoltage(HAL_AnalogInputHandle analogPortHandle,
+                                   int32_t* status) {
+  int32_t value = HAL_GetAnalogAverageValue(analogPortHandle, status);
+  int32_t LSBWeight = HAL_GetAnalogLSBWeight(analogPortHandle, status);
+  int32_t offset = HAL_GetAnalogOffset(analogPortHandle, status);
+  int32_t oversampleBits =
+      HAL_GetAnalogOversampleBits(analogPortHandle, status);
+  double voltage =
+      LSBWeight * 1.0e-9 * value / static_cast<double>(1 << oversampleBits) -
+      offset * 1.0e-9;
+  return voltage;
+}
+
+/**
+ * Convert a voltage to a raw value for a specified channel.
+ *
+ * This process depends on the calibration of each channel, so the channel must
+ * be specified.
+ *
+ * @todo This assumes raw values.  Oversampling not supported as is.
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @param voltage The voltage to convert.
+ * @return The raw value for the channel.
+ */
+int32_t HAL_GetAnalogVoltsToValue(HAL_AnalogInputHandle analogPortHandle,
+                                  double voltage, int32_t* status) {
+  if (voltage > 5.0) {
+    voltage = 5.0;
+    *status = VOLTAGE_OUT_OF_RANGE;
+  }
+  if (voltage < 0.0) {
+    voltage = 0.0;
+    *status = VOLTAGE_OUT_OF_RANGE;
+  }
+  int32_t LSBWeight = HAL_GetAnalogLSBWeight(analogPortHandle, status);
+  int32_t offset = HAL_GetAnalogOffset(analogPortHandle, status);
+  int32_t value =
+      static_cast<int32_t>((voltage + offset * 1.0e-9) / (LSBWeight * 1.0e-9));
+  return value;
+}
+
+/**
+ * Get the factory scaling least significant bit weight constant.
+ * The least significant bit weight constant for the channel that was calibrated
+ * in manufacturing and stored in an eeprom in the module.
+ *
+ * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return Least significant bit weight.
+ */
+int32_t HAL_GetAnalogLSBWeight(HAL_AnalogInputHandle analogPortHandle,
+                               int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  int32_t lsbWeight = FRC_NetworkCommunication_nAICalibration_getLSBWeight(
+      0, port->channel, status);  // XXX: aiSystemIndex == 0?
+  return lsbWeight;
+}
+
+/**
+ * Get the factory scaling offset constant.
+ * The offset constant for the channel that was calibrated in manufacturing and
+ * stored in an eeprom in the module.
+ *
+ * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
+ *
+ * @param analogPortHandle Handle to the analog port to use.
+ * @return Offset constant.
+ */
+int32_t HAL_GetAnalogOffset(HAL_AnalogInputHandle analogPortHandle,
+                            int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  int32_t offset = FRC_NetworkCommunication_nAICalibration_getOffset(
+      0, port->channel, status);  // XXX: aiSystemIndex == 0?
+  return offset;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInternal.cpp
new file mode 100644
index 0000000..e219f94
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInternal.cpp
@@ -0,0 +1,133 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogInternal.h"
+
+#include <atomic>
+
+#include <support/mutex.h>
+
+#include "HAL/AnalogInput.h"
+#include "HAL/ChipObject.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+wpi::mutex analogRegisterWindowMutex;
+std::unique_ptr<tAI> analogInputSystem;
+std::unique_ptr<tAO> analogOutputSystem;
+
+IndexedHandleResource<HAL_AnalogInputHandle, ::hal::AnalogPort,
+                      kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
+    analogInputHandles;
+
+static int32_t analogNumChannelsToActivate = 0;
+
+static std::atomic<bool> analogSystemInitialized{false};
+
+bool analogSampleRateSet = false;
+
+namespace init {
+void InitializeAnalogInternal() {
+  static IndexedHandleResource<HAL_AnalogInputHandle, ::hal::AnalogPort,
+                               kNumAnalogInputs, HAL_HandleEnum::AnalogInput>
+      alH;
+  analogInputHandles = &alH;
+}
+}  // namespace init
+
+/**
+ * Initialize the analog System.
+ */
+void initializeAnalog(int32_t* status) {
+  if (analogSystemInitialized) return;
+  std::lock_guard<wpi::mutex> lock(analogRegisterWindowMutex);
+  if (analogSystemInitialized) return;
+  analogInputSystem.reset(tAI::create(status));
+  analogOutputSystem.reset(tAO::create(status));
+  setAnalogNumChannelsToActivate(kNumAnalogInputs);
+  setAnalogSampleRate(kDefaultSampleRate, status);
+  analogSystemInitialized = true;
+}
+
+/**
+ * Return the number of channels on the module in use.
+ *
+ * @return Active channels.
+ */
+int32_t getAnalogNumActiveChannels(int32_t* status) {
+  int32_t scanSize = analogInputSystem->readConfig_ScanSize(status);
+  if (scanSize == 0) return 8;
+  return scanSize;
+}
+
+/**
+ * Get the number of active channels.
+ *
+ * This is an internal function to allow the atomic update of both the
+ * number of active channels and the sample rate.
+ *
+ * When the number of channels changes, use the new value.  Otherwise,
+ * return the curent value.
+ *
+ * @return Value to write to the active channels field.
+ */
+int32_t getAnalogNumChannelsToActivate(int32_t* status) {
+  if (analogNumChannelsToActivate == 0)
+    return getAnalogNumActiveChannels(status);
+  return analogNumChannelsToActivate;
+}
+
+/**
+ * Set the sample rate.
+ *
+ * This is a global setting for the Athena and effects all channels.
+ *
+ * @param samplesPerSecond The number of samples per channel per second.
+ */
+void setAnalogSampleRate(double samplesPerSecond, int32_t* status) {
+  // TODO: This will change when variable size scan lists are implemented.
+  // TODO: Need double comparison with epsilon.
+  // wpi_assert(!sampleRateSet || GetSampleRate() == samplesPerSecond);
+  analogSampleRateSet = true;
+
+  // Compute the convert rate
+  uint32_t ticksPerSample =
+      static_cast<uint32_t>(static_cast<double>(kTimebase) / samplesPerSecond);
+  uint32_t ticksPerConversion =
+      ticksPerSample / getAnalogNumChannelsToActivate(status);
+  // ticksPerConversion must be at least 80
+  if (ticksPerConversion < 80) {
+    if ((*status) >= 0) *status = SAMPLE_RATE_TOO_HIGH;
+    ticksPerConversion = 80;
+  }
+
+  // Atomically set the scan size and the convert rate so that the sample rate
+  // is constant
+  tAI::tConfig config;
+  config.ScanSize = getAnalogNumChannelsToActivate(status);
+  config.ConvertRate = ticksPerConversion;
+  analogInputSystem->writeConfig(config, status);
+
+  // Indicate that the scan size has been commited to hardware.
+  setAnalogNumChannelsToActivate(0);
+}
+
+/**
+ * Set the number of active channels.
+ *
+ * Store the number of active channels to set.  Don't actually commit to
+ * hardware
+ * until SetSampleRate().
+ *
+ * @param channels Number of active channels.
+ */
+void setAnalogNumChannelsToActivate(int32_t channels) {
+  analogNumChannelsToActivate = channels;
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInternal.h b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInternal.h
new file mode 100644
index 0000000..5c3a863
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogInternal.h
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "HAL/ChipObject.h"
+#include "HAL/Ports.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+constexpr int32_t kTimebase = 40000000;  ///< 40 MHz clock
+constexpr int32_t kDefaultOversampleBits = 0;
+constexpr int32_t kDefaultAverageBits = 7;
+constexpr double kDefaultSampleRate = 50000.0;
+static constexpr uint32_t kAccumulatorChannels[] = {0, 1};
+
+extern std::unique_ptr<tAI> analogInputSystem;
+extern std::unique_ptr<tAO> analogOutputSystem;
+extern wpi::mutex analogRegisterWindowMutex;
+extern bool analogSampleRateSet;
+
+struct AnalogPort {
+  uint8_t channel;
+  std::unique_ptr<tAccumulator> accumulator;
+};
+
+extern IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort,
+                             kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
+    analogInputHandles;
+
+int32_t getAnalogNumActiveChannels(int32_t* status);
+int32_t getAnalogNumChannelsToActivate(int32_t* status);
+void setAnalogNumChannelsToActivate(int32_t channels);
+void setAnalogSampleRate(double samplesPerSecond, int32_t* status);
+void initializeAnalog(int32_t* status);
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogOutput.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogOutput.cpp
new file mode 100644
index 0000000..eae0e21
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogOutput.cpp
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogOutput.h"
+
+#include "AnalogInternal.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+
+struct AnalogOutput {
+  uint8_t channel;
+};
+
+}  // namespace
+
+static IndexedHandleResource<HAL_AnalogOutputHandle, AnalogOutput,
+                             kNumAnalogOutputs, HAL_HandleEnum::AnalogOutput>*
+    analogOutputHandles;
+
+namespace hal {
+namespace init {
+void InitializeAnalogOutput() {
+  static IndexedHandleResource<HAL_AnalogOutputHandle, AnalogOutput,
+                               kNumAnalogOutputs, HAL_HandleEnum::AnalogOutput>
+      aoH;
+  analogOutputHandles = &aoH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Initialize the analog output port using the given port object.
+ */
+HAL_AnalogOutputHandle HAL_InitializeAnalogOutputPort(HAL_PortHandle portHandle,
+                                                      int32_t* status) {
+  initializeAnalog(status);
+
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  HAL_AnalogOutputHandle handle =
+      analogOutputHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = analogOutputHandles->Get(handle);
+  if (port == nullptr) {  // would only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  port->channel = static_cast<uint8_t>(channel);
+  return handle;
+}
+
+void HAL_FreeAnalogOutputPort(HAL_AnalogOutputHandle analogOutputHandle) {
+  // no status, so no need to check for a proper free.
+  analogOutputHandles->Free(analogOutputHandle);
+}
+
+/**
+ * Check that the analog output channel number is value.
+ * Verify that the analog channel number is one of the legal channel numbers.
+ * Channel numbers are 0-based.
+ *
+ * @return Analog channel is valid
+ */
+HAL_Bool HAL_CheckAnalogOutputChannel(int32_t channel) {
+  return channel < kNumAnalogOutputs && channel >= 0;
+}
+
+void HAL_SetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
+                         double voltage, int32_t* status) {
+  auto port = analogOutputHandles->Get(analogOutputHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  uint16_t rawValue = static_cast<uint16_t>(voltage / 5.0 * 0x1000);
+
+  if (voltage < 0.0)
+    rawValue = 0;
+  else if (voltage > 5.0)
+    rawValue = 0x1000;
+
+  analogOutputSystem->writeMXP(port->channel, rawValue, status);
+}
+
+double HAL_GetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
+                           int32_t* status) {
+  auto port = analogOutputHandles->Get(analogOutputHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  uint16_t rawValue = analogOutputSystem->readMXP(port->channel, status);
+
+  return rawValue * 5.0 / 0x1000;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogTrigger.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogTrigger.cpp
new file mode 100644
index 0000000..bcbe68a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/AnalogTrigger.cpp
@@ -0,0 +1,221 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogTrigger.h"
+
+#include "AnalogInternal.h"
+#include "HAL/AnalogInput.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+
+struct AnalogTrigger {
+  std::unique_ptr<tAnalogTrigger> trigger;
+  HAL_AnalogInputHandle analogHandle;
+  uint8_t index;
+};
+
+}  // namespace
+
+static LimitedHandleResource<HAL_AnalogTriggerHandle, AnalogTrigger,
+                             kNumAnalogTriggers, HAL_HandleEnum::AnalogTrigger>*
+    analogTriggerHandles;
+
+namespace hal {
+namespace init {
+void InitializeAnalogTrigger() {
+  static LimitedHandleResource<HAL_AnalogTriggerHandle, AnalogTrigger,
+                               kNumAnalogTriggers,
+                               HAL_HandleEnum::AnalogTrigger>
+      atH;
+  analogTriggerHandles = &atH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
+    HAL_AnalogInputHandle portHandle, int32_t* index, int32_t* status) {
+  // ensure we are given a valid and active AnalogInput handle
+  auto analog_port = analogInputHandles->Get(portHandle);
+  if (analog_port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  HAL_AnalogTriggerHandle handle = analogTriggerHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto trigger = analogTriggerHandles->Get(handle);
+  if (trigger == nullptr) {  // would only occur on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  trigger->analogHandle = portHandle;
+  trigger->index = static_cast<uint8_t>(getHandleIndex(handle));
+  *index = trigger->index;
+
+  trigger->trigger.reset(tAnalogTrigger::create(trigger->index, status));
+  trigger->trigger->writeSourceSelect_Channel(analog_port->channel, status);
+  return handle;
+}
+
+void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
+                            int32_t* status) {
+  analogTriggerHandles->Free(analogTriggerHandle);
+  // caller owns the analog input handle.
+}
+
+void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                   int32_t lower, int32_t upper,
+                                   int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (lower > upper) {
+    *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR;
+  }
+  trigger->trigger->writeLowerLimit(lower, status);
+  trigger->trigger->writeUpperLimit(upper, status);
+}
+
+/**
+ * Set the upper and lower limits of the analog trigger.
+ * The limits are given as floating point voltage values.
+ */
+void HAL_SetAnalogTriggerLimitsVoltage(
+    HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
+    int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (lower > upper) {
+    *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR;
+  }
+
+  // TODO: This depends on the averaged setting.  Only raw values will work as
+  // is.
+  trigger->trigger->writeLowerLimit(
+      HAL_GetAnalogVoltsToValue(trigger->analogHandle, lower, status), status);
+  trigger->trigger->writeUpperLimit(
+      HAL_GetAnalogVoltsToValue(trigger->analogHandle, upper, status), status);
+}
+
+/**
+ * Configure the analog trigger to use the averaged vs. raw values.
+ * If the value is true, then the averaged value is selected for the analog
+ * trigger, otherwise the immediate value is used.
+ */
+void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                  HAL_Bool useAveragedValue, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (trigger->trigger->readSourceSelect_Filter(status) != 0) {
+    *status = INCOMPATIBLE_STATE;
+    // TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not
+    // support average and filtering at the same time.");
+  }
+  trigger->trigger->writeSourceSelect_Averaged(useAveragedValue, status);
+}
+
+/**
+ * Configure the analog trigger to use a filtered value.
+ * The analog trigger will operate with a 3 point average rejection filter. This
+ * is designed to help with 360 degree pot applications for the period where the
+ * pot crosses through zero.
+ */
+void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                  HAL_Bool useFilteredValue, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (trigger->trigger->readSourceSelect_Averaged(status) != 0) {
+    *status = INCOMPATIBLE_STATE;
+    // TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not "
+    // "support average and filtering at the same time.");
+  }
+  trigger->trigger->writeSourceSelect_Filter(useFilteredValue, status);
+}
+
+/**
+ * Return the InWindow output of the analog trigger.
+ * True if the analog input is between the upper and lower limits.
+ * @return The InWindow output of the analog trigger.
+ */
+HAL_Bool HAL_GetAnalogTriggerInWindow(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return trigger->trigger->readOutput_InHysteresis(trigger->index, status) != 0;
+}
+
+/**
+ * Return the TriggerState output of the analog trigger.
+ * True if above upper limit.
+ * False if below lower limit.
+ * If in Hysteresis, maintain previous state.
+ * @return The TriggerState output of the analog trigger.
+ */
+HAL_Bool HAL_GetAnalogTriggerTriggerState(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return trigger->trigger->readOutput_OverLimit(trigger->index, status) != 0;
+}
+
+/**
+ * Get the state of the analog trigger output.
+ * @return The state of the analog trigger output.
+ */
+HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                    HAL_AnalogTriggerType type,
+                                    int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool result = false;
+  switch (type) {
+    case HAL_Trigger_kInWindow:
+      result =
+          trigger->trigger->readOutput_InHysteresis(trigger->index, status);
+      break;  // XXX: Backport
+    case HAL_Trigger_kState:
+      result = trigger->trigger->readOutput_OverLimit(trigger->index, status);
+      break;  // XXX: Backport
+    case HAL_Trigger_kRisingPulse:
+    case HAL_Trigger_kFallingPulse:
+      *status = ANALOG_TRIGGER_PULSE_OUTPUT_ERROR;
+      return false;
+  }
+  return result;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/CAN.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/CAN.cpp
new file mode 100644
index 0000000..251daef
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/CAN.cpp
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/CAN.h"
+
+#include <FRC_NetworkCommunication/CANSessionMux.h>
+
+namespace hal {
+namespace init {
+void InitializeCAN() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+void HAL_CAN_SendMessage(uint32_t messageID, const uint8_t* data,
+                         uint8_t dataSize, int32_t periodMs, int32_t* status) {
+  FRC_NetworkCommunication_CANSessionMux_sendMessage(messageID, data, dataSize,
+                                                     periodMs, status);
+}
+void HAL_CAN_ReceiveMessage(uint32_t* messageID, uint32_t messageIDMask,
+                            uint8_t* data, uint8_t* dataSize,
+                            uint32_t* timeStamp, int32_t* status) {
+  FRC_NetworkCommunication_CANSessionMux_receiveMessage(
+      messageID, messageIDMask, data, dataSize, timeStamp, status);
+}
+void HAL_CAN_OpenStreamSession(uint32_t* sessionHandle, uint32_t messageID,
+                               uint32_t messageIDMask, uint32_t maxMessages,
+                               int32_t* status) {
+  FRC_NetworkCommunication_CANSessionMux_openStreamSession(
+      sessionHandle, messageID, messageIDMask, maxMessages, status);
+}
+void HAL_CAN_CloseStreamSession(uint32_t sessionHandle) {
+  FRC_NetworkCommunication_CANSessionMux_closeStreamSession(sessionHandle);
+}
+void HAL_CAN_ReadStreamSession(uint32_t sessionHandle,
+                               struct HAL_CANStreamMessage* messages,
+                               uint32_t messagesToRead, uint32_t* messagesRead,
+                               int32_t* status) {
+  FRC_NetworkCommunication_CANSessionMux_readStreamSession(
+      sessionHandle, reinterpret_cast<tCANStreamMessage*>(messages),
+      messagesToRead, messagesRead, status);
+}
+void HAL_CAN_GetCANStatus(float* percentBusUtilization, uint32_t* busOffCount,
+                          uint32_t* txFullCount, uint32_t* receiveErrorCount,
+                          uint32_t* transmitErrorCount, int32_t* status) {
+  FRC_NetworkCommunication_CANSessionMux_getCANStatus(
+      percentBusUtilization, busOffCount, txFullCount, receiveErrorCount,
+      transmitErrorCount, status);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Compressor.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Compressor.cpp
new file mode 100644
index 0000000..c5277ef
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Compressor.cpp
@@ -0,0 +1,200 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Compressor.h"
+
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "PCMInternal.h"
+#include "PortsInternal.h"
+#include "ctre/PCM.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeCompressor() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_CompressorHandle HAL_InitializeCompressor(int32_t module, int32_t* status) {
+  // Use status to check for invalid index
+  initializePCM(module, status);
+  if (*status != 0) {
+    return HAL_kInvalidHandle;
+  }
+
+  // As compressors can have unlimited objects, just create a
+  // handle with the module number as the index.
+
+  return (HAL_CompressorHandle)createHandle(static_cast<int16_t>(module),
+                                            HAL_HandleEnum::Compressor, 0);
+}
+
+HAL_Bool HAL_CheckCompressorModule(int32_t module) {
+  return module < kNumPCMModules && module >= 0;
+}
+
+HAL_Bool HAL_GetCompressor(HAL_CompressorHandle compressorHandle,
+                           int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressor(value);
+
+  return value;
+}
+
+void HAL_SetCompressorClosedLoopControl(HAL_CompressorHandle compressorHandle,
+                                        HAL_Bool value, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  *status = PCM_modules[index]->SetClosedLoopControl(value);
+}
+
+HAL_Bool HAL_GetCompressorClosedLoopControl(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetClosedLoopControl(value);
+
+  return value;
+}
+
+HAL_Bool HAL_GetCompressorPressureSwitch(HAL_CompressorHandle compressorHandle,
+                                         int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetPressure(value);
+
+  return value;
+}
+
+double HAL_GetCompressorCurrent(HAL_CompressorHandle compressorHandle,
+                                int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  float value;
+
+  *status = PCM_modules[index]->GetCompressorCurrent(value);
+
+  return value;
+}
+HAL_Bool HAL_GetCompressorCurrentTooHighFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressorCurrentTooHighFault(value);
+
+  return value;
+}
+HAL_Bool HAL_GetCompressorCurrentTooHighStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressorCurrentTooHighStickyFault(value);
+
+  return value;
+}
+HAL_Bool HAL_GetCompressorShortedStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressorShortedStickyFault(value);
+
+  return value;
+}
+HAL_Bool HAL_GetCompressorShortedFault(HAL_CompressorHandle compressorHandle,
+                                       int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressorShortedFault(value);
+
+  return value;
+}
+HAL_Bool HAL_GetCompressorNotConnectedStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressorNotConnectedStickyFault(value);
+
+  return value;
+}
+HAL_Bool HAL_GetCompressorNotConnectedFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[index]->GetCompressorNotConnectedFault(value);
+
+  return value;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Constants.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Constants.cpp
new file mode 100644
index 0000000..13cf290
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Constants.cpp
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Constants.h"
+
+#include "ConstantsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeConstants() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+int32_t HAL_GetSystemClockTicksPerMicrosecond(void) {
+  return kSystemClockTicksPerMicrosecond;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ConstantsInternal.h b/third_party/allwpilib_2018/hal/src/main/native/athena/ConstantsInternal.h
new file mode 100644
index 0000000..55bbdee
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ConstantsInternal.h
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+namespace hal {
+
+constexpr int32_t kSystemClockTicksPerMicrosecond = 40;
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Counter.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Counter.cpp
new file mode 100644
index 0000000..ec2f9c4
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Counter.cpp
@@ -0,0 +1,480 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Counter.h"
+
+#include "ConstantsInternal.h"
+#include "DigitalInternal.h"
+#include "HAL/HAL.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+
+struct Counter {
+  std::unique_ptr<tCounter> counter;
+  uint8_t index;
+};
+
+}  // namespace
+
+static LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
+                             HAL_HandleEnum::Counter>* counterHandles;
+
+namespace hal {
+namespace init {
+void InitializeCounter() {
+  static LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
+                               HAL_HandleEnum::Counter>
+      ch;
+  counterHandles = &ch;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
+                                        int32_t* status) {
+  auto handle = counterHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {  // out of resources
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto counter = counterHandles->Get(handle);
+  if (counter == nullptr) {  // would only occur on thread issues
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  counter->index = static_cast<uint8_t>(getHandleIndex(handle));
+  *index = counter->index;
+
+  counter->counter.reset(tCounter::create(counter->index, status));
+  counter->counter->writeConfig_Mode(mode, status);
+  counter->counter->writeTimerConfig_AverageSize(1, status);
+  return handle;
+}
+
+void HAL_FreeCounter(HAL_CounterHandle counterHandle, int32_t* status) {
+  counterHandles->Free(counterHandle);
+}
+
+void HAL_SetCounterAverageSize(HAL_CounterHandle counterHandle, int32_t size,
+                               int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeTimerConfig_AverageSize(size, status);
+}
+
+/**
+ * Set the source object that causes the counter to count up.
+ * Set the up counting DigitalSource.
+ */
+void HAL_SetCounterUpSource(HAL_CounterHandle counterHandle,
+                            HAL_Handle digitalSourceHandle,
+                            HAL_AnalogTriggerType analogTriggerType,
+                            int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  bool routingAnalogTrigger = false;
+  uint8_t routingChannel = 0;
+  uint8_t routingModule = 0;
+  bool success =
+      remapDigitalSource(digitalSourceHandle, analogTriggerType, routingChannel,
+                         routingModule, routingAnalogTrigger);
+  if (!success) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  counter->counter->writeConfig_UpSource_Module(routingModule, status);
+  counter->counter->writeConfig_UpSource_Channel(routingChannel, status);
+  counter->counter->writeConfig_UpSource_AnalogTrigger(routingAnalogTrigger,
+                                                       status);
+
+  if (counter->counter->readConfig_Mode(status) == HAL_Counter_kTwoPulse ||
+      counter->counter->readConfig_Mode(status) ==
+          HAL_Counter_kExternalDirection) {
+    HAL_SetCounterUpSourceEdge(counterHandle, true, false, status);
+  }
+  counter->counter->strobeReset(status);
+}
+
+/**
+ * Set the edge sensitivity on an up counting source.
+ * Set the up source to either detect rising edges or falling edges.
+ */
+void HAL_SetCounterUpSourceEdge(HAL_CounterHandle counterHandle,
+                                HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_UpRisingEdge(risingEdge, status);
+  counter->counter->writeConfig_UpFallingEdge(fallingEdge, status);
+}
+
+/**
+ * Disable the up counting source to the counter.
+ */
+void HAL_ClearCounterUpSource(HAL_CounterHandle counterHandle,
+                              int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_UpFallingEdge(false, status);
+  counter->counter->writeConfig_UpRisingEdge(false, status);
+  // Index 0 of digital is always 0.
+  counter->counter->writeConfig_UpSource_Channel(0, status);
+  counter->counter->writeConfig_UpSource_AnalogTrigger(false, status);
+}
+
+/**
+ * Set the source object that causes the counter to count down.
+ * Set the down counting DigitalSource.
+ */
+void HAL_SetCounterDownSource(HAL_CounterHandle counterHandle,
+                              HAL_Handle digitalSourceHandle,
+                              HAL_AnalogTriggerType analogTriggerType,
+                              int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  uint8_t mode = counter->counter->readConfig_Mode(status);
+  if (mode != HAL_Counter_kTwoPulse && mode != HAL_Counter_kExternalDirection) {
+    // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "Counter only
+    // supports DownSource in TwoPulse and ExternalDirection modes.");
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  bool routingAnalogTrigger = false;
+  uint8_t routingChannel = 0;
+  uint8_t routingModule = 0;
+  bool success =
+      remapDigitalSource(digitalSourceHandle, analogTriggerType, routingChannel,
+                         routingModule, routingAnalogTrigger);
+  if (!success) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  counter->counter->writeConfig_DownSource_Module(routingModule, status);
+  counter->counter->writeConfig_DownSource_Channel(routingChannel, status);
+  counter->counter->writeConfig_DownSource_AnalogTrigger(routingAnalogTrigger,
+                                                         status);
+
+  HAL_SetCounterDownSourceEdge(counterHandle, true, false, status);
+  counter->counter->strobeReset(status);
+}
+
+/**
+ * Set the edge sensitivity on a down counting source.
+ * Set the down source to either detect rising edges or falling edges.
+ */
+void HAL_SetCounterDownSourceEdge(HAL_CounterHandle counterHandle,
+                                  HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                  int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_DownRisingEdge(risingEdge, status);
+  counter->counter->writeConfig_DownFallingEdge(fallingEdge, status);
+}
+
+/**
+ * Disable the down counting source to the counter.
+ */
+void HAL_ClearCounterDownSource(HAL_CounterHandle counterHandle,
+                                int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_DownFallingEdge(false, status);
+  counter->counter->writeConfig_DownRisingEdge(false, status);
+  // Index 0 of digital is always 0.
+  counter->counter->writeConfig_DownSource_Channel(0, status);
+  counter->counter->writeConfig_DownSource_AnalogTrigger(false, status);
+}
+
+/**
+ * Set standard up / down counting mode on this counter.
+ * Up and down counts are sourced independently from two inputs.
+ */
+void HAL_SetCounterUpDownMode(HAL_CounterHandle counterHandle,
+                              int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_Mode(HAL_Counter_kTwoPulse, status);
+}
+
+/**
+ * Set external direction mode on this counter.
+ * Counts are sourced on the Up counter input.
+ * The Down counter input represents the direction to count.
+ */
+void HAL_SetCounterExternalDirectionMode(HAL_CounterHandle counterHandle,
+                                         int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_Mode(HAL_Counter_kExternalDirection, status);
+}
+
+/**
+ * Set Semi-period mode on this counter.
+ * Counts up on both rising and falling edges.
+ */
+void HAL_SetCounterSemiPeriodMode(HAL_CounterHandle counterHandle,
+                                  HAL_Bool highSemiPeriod, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_Mode(HAL_Counter_kSemiperiod, status);
+  counter->counter->writeConfig_UpRisingEdge(highSemiPeriod, status);
+  HAL_SetCounterUpdateWhenEmpty(counterHandle, false, status);
+}
+
+/**
+ * Configure the counter to count in up or down based on the length of the input
+ * pulse.
+ * This mode is most useful for direction sensitive gear tooth sensors.
+ * @param threshold The pulse length beyond which the counter counts the
+ * opposite direction.  Units are seconds.
+ */
+void HAL_SetCounterPulseLengthMode(HAL_CounterHandle counterHandle,
+                                   double threshold, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeConfig_Mode(HAL_Counter_kPulseLength, status);
+  counter->counter->writeConfig_PulseLengthThreshold(
+      static_cast<uint32_t>(threshold * 1.0e6) *
+          kSystemClockTicksPerMicrosecond,
+      status);
+}
+
+/**
+ * Get the Samples to Average which specifies the number of samples of the timer
+ * to
+ * average when calculating the period. Perform averaging to account for
+ * mechanical imperfections or as oversampling to increase resolution.
+ * @return SamplesToAverage The number of samples being averaged (from 1 to 127)
+ */
+int32_t HAL_GetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
+                                       int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return counter->counter->readTimerConfig_AverageSize(status);
+}
+
+/**
+ * Set the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period. Perform averaging to account for
+ * mechanical imperfections or as oversampling to increase resolution.
+ * @param samplesToAverage The number of samples to average from 1 to 127.
+ */
+void HAL_SetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
+                                    int32_t samplesToAverage, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (samplesToAverage < 1 || samplesToAverage > 127) {
+    *status = PARAMETER_OUT_OF_RANGE;
+  }
+  counter->counter->writeTimerConfig_AverageSize(samplesToAverage, status);
+}
+
+/**
+ * Reset the Counter to zero.
+ * Set the counter value to zero. This doesn't effect the running state of the
+ * counter, just sets the current value to zero.
+ */
+void HAL_ResetCounter(HAL_CounterHandle counterHandle, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->strobeReset(status);
+}
+
+/**
+ * Read the current counter value.
+ * Read the value at this instant. It may still be running, so it reflects the
+ * current value. Next time it is read, it might have a different value.
+ */
+int32_t HAL_GetCounter(HAL_CounterHandle counterHandle, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  int32_t value = counter->counter->readOutput_Value(status);
+  return value;
+}
+
+/*
+ * Get the Period of the most recent count.
+ * Returns the time interval of the most recent count. This can be used for
+ * velocity calculations to determine shaft speed.
+ * @returns The period of the last two pulses in units of seconds.
+ */
+double HAL_GetCounterPeriod(HAL_CounterHandle counterHandle, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+  tCounter::tTimerOutput output = counter->counter->readTimerOutput(status);
+  double period;
+  if (output.Stalled) {
+    // Return infinity
+    double zero = 0.0;
+    period = 1.0 / zero;
+  } else {
+    // output.Period is a fixed point number that counts by 2 (24 bits, 25
+    // integer bits)
+    period = static_cast<double>(output.Period << 1) /
+             static_cast<double>(output.Count);
+  }
+  return static_cast<double>(period *
+                             2.5e-8);  // result * timebase (currently 25ns)
+}
+
+/**
+ * Set the maximum period where the device is still considered "moving".
+ * Sets the maximum period where the device is considered moving. This value is
+ * used to determine the "stopped" state of the counter using the GetStopped
+ * method.
+ * @param maxPeriod The maximum period where the counted device is considered
+ * moving in seconds.
+ */
+void HAL_SetCounterMaxPeriod(HAL_CounterHandle counterHandle, double maxPeriod,
+                             int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeTimerConfig_StallPeriod(
+      static_cast<uint32_t>(maxPeriod * 4.0e8), status);
+}
+
+/**
+ * Select whether you want to continue updating the event timer output when
+ * there are no samples captured. The output of the event timer has a buffer of
+ * periods that are averaged and posted to a register on the FPGA.  When the
+ * timer detects that the event source has stopped (based on the MaxPeriod) the
+ * buffer of samples to be averaged is emptied.  If you enable the update when
+ * empty, you will be notified of the stopped source and the event time will
+ * report 0 samples.  If you disable update when empty, the most recent average
+ * will remain on the output until a new sample is acquired.  You will never see
+ * 0 samples output (except when there have been no events since an FPGA reset)
+ * and you will likely not see the stopped bit become true (since it is updated
+ * at the end of an average and there are no samples to average).
+ */
+void HAL_SetCounterUpdateWhenEmpty(HAL_CounterHandle counterHandle,
+                                   HAL_Bool enabled, int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  counter->counter->writeTimerConfig_UpdateWhenEmpty(enabled, status);
+}
+
+/**
+ * Determine if the clock is stopped.
+ * Determine if the clocked input is stopped based on the MaxPeriod value set
+ * using the SetMaxPeriod method. If the clock exceeds the MaxPeriod, then the
+ * device (and counter) are assumed to be stopped and it returns true.
+ * @return Returns true if the most recent counter period exceeds the MaxPeriod
+ * value set by SetMaxPeriod.
+ */
+HAL_Bool HAL_GetCounterStopped(HAL_CounterHandle counterHandle,
+                               int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return counter->counter->readTimerOutput_Stalled(status);
+}
+
+/**
+ * The last direction the counter value changed.
+ * @return The last direction the counter value changed.
+ */
+HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
+                                 int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value = counter->counter->readOutput_Direction(status);
+  return value;
+}
+
+/**
+ * Set the Counter to return reversed sensing on the direction.
+ * This allows counters to change the direction they are counting in the case of
+ * 1X and 2X quadrature encoding only. Any other counter mode isn't supported.
+ * @param reverseDirection true if the value counted should be negated.
+ */
+void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
+                                    HAL_Bool reverseDirection,
+                                    int32_t* status) {
+  auto counter = counterHandles->Get(counterHandle);
+  if (counter == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (counter->counter->readConfig_Mode(status) ==
+      HAL_Counter_kExternalDirection) {
+    if (reverseDirection)
+      HAL_SetCounterDownSourceEdge(counterHandle, true, true, status);
+    else
+      HAL_SetCounterDownSourceEdge(counterHandle, false, true, status);
+  }
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/DIO.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/DIO.cpp
new file mode 100644
index 0000000..6608071
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/DIO.cpp
@@ -0,0 +1,587 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/DIO.h"
+
+#include <cmath>
+
+#include "DigitalInternal.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+// Create a mutex to protect changes to the DO PWM config
+static wpi::mutex digitalPwmMutex;
+
+static LimitedHandleResource<HAL_DigitalPWMHandle, uint8_t,
+                             kNumDigitalPWMOutputs, HAL_HandleEnum::DigitalPWM>*
+    digitalPWMHandles;
+
+namespace hal {
+namespace init {
+void InitializeDIO() {
+  static LimitedHandleResource<HAL_DigitalPWMHandle, uint8_t,
+                               kNumDigitalPWMOutputs,
+                               HAL_HandleEnum::DigitalPWM>
+      dpH;
+  digitalPWMHandles = &dpH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Create a new instance of a digital port.
+ */
+HAL_DigitalHandle HAL_InitializeDIOPort(HAL_PortHandle portHandle,
+                                        HAL_Bool input, int32_t* status) {
+  initializeDigital(status);
+
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex || channel >= kNumDigitalChannels) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  auto handle =
+      digitalChannelHandles->Allocate(channel, HAL_HandleEnum::DIO, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = digitalChannelHandles->Get(handle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  port->channel = static_cast<uint8_t>(channel);
+
+  std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+
+  tDIO::tOutputEnable outputEnable = digitalSystem->readOutputEnable(status);
+
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    if (!getPortHandleSPIEnable(portHandle)) {
+      // if this flag is not set, we actually want DIO.
+      uint32_t bitToSet = 1u << remapSPIChannel(port->channel);
+
+      uint16_t specialFunctions = spiSystem->readEnableDIO(status);
+      // Set the field to enable SPI DIO
+      spiSystem->writeEnableDIO(specialFunctions | bitToSet, status);
+
+      if (input) {
+        outputEnable.SPIPort =
+            outputEnable.SPIPort & (~bitToSet);  // clear the field for read
+      } else {
+        outputEnable.SPIPort =
+            outputEnable.SPIPort | bitToSet;  // set the bits for write
+      }
+    }
+  } else if (port->channel < kNumDigitalHeaders) {
+    uint32_t bitToSet = 1u << port->channel;
+    if (input) {
+      outputEnable.Headers =
+          outputEnable.Headers & (~bitToSet);  // clear the bit for read
+    } else {
+      outputEnable.Headers =
+          outputEnable.Headers | bitToSet;  // set the bit for write
+    }
+  } else {
+    uint32_t bitToSet = 1u << remapMXPChannel(port->channel);
+
+    uint16_t specialFunctions =
+        digitalSystem->readEnableMXPSpecialFunction(status);
+    digitalSystem->writeEnableMXPSpecialFunction(specialFunctions & ~bitToSet,
+                                                 status);
+
+    if (input) {
+      outputEnable.MXP =
+          outputEnable.MXP & (~bitToSet);  // clear the bit for read
+    } else {
+      outputEnable.MXP = outputEnable.MXP | bitToSet;  // set the bit for write
+    }
+  }
+
+  digitalSystem->writeOutputEnable(outputEnable, status);
+
+  return handle;
+}
+
+HAL_Bool HAL_CheckDIOChannel(int32_t channel) {
+  return channel < kNumDigitalChannels && channel >= 0;
+}
+
+void HAL_FreeDIOPort(HAL_DigitalHandle dioPortHandle) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  // no status, so no need to check for a proper free.
+  digitalChannelHandles->Free(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) return;
+  int32_t status = 0;
+  std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    // Unset the SPI flag
+    int32_t bitToUnset = 1 << remapSPIChannel(port->channel);
+    uint16_t specialFunctions = spiSystem->readEnableDIO(&status);
+    spiSystem->writeEnableDIO(specialFunctions & ~bitToUnset, &status);
+  } else if (port->channel >= kNumDigitalHeaders) {
+    // Unset the MXP flag
+    uint32_t bitToUnset = 1u << remapMXPChannel(port->channel);
+
+    uint16_t specialFunctions =
+        digitalSystem->readEnableMXPSpecialFunction(&status);
+    digitalSystem->writeEnableMXPSpecialFunction(specialFunctions | bitToUnset,
+                                                 &status);
+  }
+}
+
+/**
+ * Allocate a DO PWM Generator.
+ * Allocate PWM generators so that they are not accidentally reused.
+ *
+ * @return PWM Generator handle
+ */
+HAL_DigitalPWMHandle HAL_AllocateDigitalPWM(int32_t* status) {
+  auto handle = digitalPWMHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+
+  auto id = digitalPWMHandles->Get(handle);
+  if (id == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  *id = static_cast<uint8_t>(getHandleIndex(handle));
+
+  return handle;
+}
+
+/**
+ * Free the resource associated with a DO PWM generator.
+ *
+ * @param pwmGenerator The pwmGen to free that was allocated with
+ * allocateDigitalPWM()
+ */
+void HAL_FreeDigitalPWM(HAL_DigitalPWMHandle pwmGenerator, int32_t* status) {
+  digitalPWMHandles->Free(pwmGenerator);
+}
+
+/**
+ * Change the frequency of the DO PWM generator.
+ *
+ * The valid range is from 0.6 Hz to 19 kHz.  The frequency resolution is
+ * logarithmic.
+ *
+ * @param rate The frequency to output all digital output PWM signals.
+ */
+void HAL_SetDigitalPWMRate(double rate, int32_t* status) {
+  // Currently rounding in the log rate domain... heavy weight toward picking a
+  // higher freq.
+  // TODO: Round in the linear rate domain.
+  initializeDigital(status);
+  if (*status != 0) return;
+  uint16_t pwmPeriodPower = static_cast<uint16_t>(
+      std::log(1.0 / (16 * 1.0E-6 * rate)) / std::log(2.0) + 0.5);
+  digitalSystem->writePWMPeriodPower(pwmPeriodPower, status);
+}
+
+/**
+ * Configure the duty-cycle of the PWM generator
+ *
+ * @param pwmGenerator The generator index reserved by allocateDigitalPWM()
+ * @param dutyCycle The percent duty cycle to output [0..1].
+ */
+void HAL_SetDigitalPWMDutyCycle(HAL_DigitalPWMHandle pwmGenerator,
+                                double dutyCycle, int32_t* status) {
+  auto port = digitalPWMHandles->Get(pwmGenerator);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  int32_t id = *port;
+  if (dutyCycle > 1.0) dutyCycle = 1.0;
+  if (dutyCycle < 0.0) dutyCycle = 0.0;
+  double rawDutyCycle = 256.0 * dutyCycle;
+  if (rawDutyCycle > 255.5) rawDutyCycle = 255.5;
+  {
+    std::lock_guard<wpi::mutex> lock(digitalPwmMutex);
+    uint16_t pwmPeriodPower = digitalSystem->readPWMPeriodPower(status);
+    if (pwmPeriodPower < 4) {
+      // The resolution of the duty cycle drops close to the highest
+      // frequencies.
+      rawDutyCycle = rawDutyCycle / std::pow(2.0, 4 - pwmPeriodPower);
+    }
+    if (id < 4)
+      digitalSystem->writePWMDutyCycleA(id, static_cast<uint8_t>(rawDutyCycle),
+                                        status);
+    else
+      digitalSystem->writePWMDutyCycleB(
+          id - 4, static_cast<uint8_t>(rawDutyCycle), status);
+  }
+}
+
+/**
+ * Configure which DO channel the PWM signal is output on
+ *
+ * @param pwmGenerator The generator index reserved by allocateDigitalPWM()
+ * @param channel The Digital Output channel to output on
+ */
+void HAL_SetDigitalPWMOutputChannel(HAL_DigitalPWMHandle pwmGenerator,
+                                    int32_t channel, int32_t* status) {
+  auto port = digitalPWMHandles->Get(pwmGenerator);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  int32_t id = *port;
+  if (channel >= kNumDigitalHeaders &&
+      channel <
+          kNumDigitalHeaders + kNumDigitalMXPChannels) {  // If it is on the MXP
+    /* Then to write as a digital PWM channel an offset is needed to write on
+     * the correct channel
+     */
+    channel += kMXPDigitalPWMOffset;
+  }
+  digitalSystem->writePWMOutputSelect(id, channel, status);
+}
+
+/**
+ * Write a digital I/O bit to the FPGA.
+ * Set a single value on a digital I/O channel.
+ *
+ * @param channel The Digital I/O channel
+ * @param value The state to set the digital channel (if it is configured as an
+ * output)
+ */
+void HAL_SetDIO(HAL_DigitalHandle dioPortHandle, HAL_Bool value,
+                int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (value != 0 && value != 1) {
+    if (value != 0) value = 1;
+  }
+  {
+    std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+    tDIO::tDO currentDIO = digitalSystem->readDO(status);
+
+    if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+      if (value == 0) {
+        currentDIO.SPIPort =
+            currentDIO.SPIPort & ~(1u << remapSPIChannel(port->channel));
+      } else if (value == 1) {
+        currentDIO.SPIPort =
+            currentDIO.SPIPort | (1u << remapSPIChannel(port->channel));
+      }
+    } else if (port->channel < kNumDigitalHeaders) {
+      if (value == 0) {
+        currentDIO.Headers = currentDIO.Headers & ~(1u << port->channel);
+      } else if (value == 1) {
+        currentDIO.Headers = currentDIO.Headers | (1u << port->channel);
+      }
+    } else {
+      if (value == 0) {
+        currentDIO.MXP =
+            currentDIO.MXP & ~(1u << remapMXPChannel(port->channel));
+      } else if (value == 1) {
+        currentDIO.MXP =
+            currentDIO.MXP | (1u << remapMXPChannel(port->channel));
+      }
+    }
+    digitalSystem->writeDO(currentDIO, status);
+  }
+}
+
+/**
+ * Set direction of a DIO channel.
+ *
+ * @param channel The Digital I/O channel
+ * @param input true to set input, false for output
+ */
+void HAL_SetDIODirection(HAL_DigitalHandle dioPortHandle, HAL_Bool input,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  {
+    std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+    tDIO::tOutputEnable currentDIO = digitalSystem->readOutputEnable(status);
+
+    if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+      if (input) {
+        currentDIO.SPIPort =
+            currentDIO.SPIPort & ~(1u << remapSPIChannel(port->channel));
+      } else {
+        currentDIO.SPIPort =
+            currentDIO.SPIPort | (1u << remapSPIChannel(port->channel));
+      }
+    } else if (port->channel < kNumDigitalHeaders) {
+      if (input) {
+        currentDIO.Headers = currentDIO.Headers & ~(1u << port->channel);
+      } else {
+        currentDIO.Headers = currentDIO.Headers | (1u << port->channel);
+      }
+    } else {
+      if (input) {
+        currentDIO.MXP =
+            currentDIO.MXP & ~(1u << remapMXPChannel(port->channel));
+      } else {
+        currentDIO.MXP =
+            currentDIO.MXP | (1u << remapMXPChannel(port->channel));
+      }
+    }
+    digitalSystem->writeOutputEnable(currentDIO, status);
+  }
+}
+
+/**
+ * Read a digital I/O bit from the FPGA.
+ * Get a single value from a digital I/O channel.
+ *
+ * @param channel The digital I/O channel
+ * @return The state of the specified channel
+ */
+HAL_Bool HAL_GetDIO(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  tDIO::tDI currentDIO = digitalSystem->readDI(status);
+  // Shift 00000001 over channel-1 places.
+  // AND it against the currentDIO
+  // if it == 0, then return false
+  // else return true
+
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    return ((currentDIO.SPIPort >> remapSPIChannel(port->channel)) & 1) != 0;
+  } else if (port->channel < kNumDigitalHeaders) {
+    return ((currentDIO.Headers >> port->channel) & 1) != 0;
+  } else {
+    return ((currentDIO.MXP >> remapMXPChannel(port->channel)) & 1) != 0;
+  }
+}
+
+/**
+ * Read the direction of a the Digital I/O lines
+ * A 1 bit means output and a 0 bit means input.
+ *
+ * @param channel The digital I/O channel
+ * @return The direction of the specified channel
+ */
+HAL_Bool HAL_GetDIODirection(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  tDIO::tOutputEnable currentOutputEnable =
+      digitalSystem->readOutputEnable(status);
+  // Shift 00000001 over port->channel-1 places.
+  // AND it against the currentOutputEnable
+  // if it == 0, then return false
+  // else return true
+
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    return ((currentOutputEnable.SPIPort >> remapSPIChannel(port->channel)) &
+            1) != 0;
+  } else if (port->channel < kNumDigitalHeaders) {
+    return ((currentOutputEnable.Headers >> port->channel) & 1) != 0;
+  } else {
+    return ((currentOutputEnable.MXP >> remapMXPChannel(port->channel)) & 1) !=
+           0;
+  }
+}
+
+/**
+ * Generate a single pulse.
+ * Write a pulse to the specified digital output channel. There can only be a
+ * single pulse going at any time.
+ *
+ * @param channel The Digital Output channel that the pulse should be output on
+ * @param pulseLength The active length of the pulse (in seconds)
+ */
+void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLength,
+               int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  tDIO::tPulse pulse;
+
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    pulse.SPIPort = 1u << remapSPIChannel(port->channel);
+  } else if (port->channel < kNumDigitalHeaders) {
+    pulse.Headers = 1u << port->channel;
+  } else {
+    pulse.MXP = 1u << remapMXPChannel(port->channel);
+  }
+
+  digitalSystem->writePulseLength(
+      static_cast<uint8_t>(1.0e9 * pulseLength /
+                           (pwmSystem->readLoopTiming(status) * 25)),
+      status);
+  digitalSystem->writePulse(pulse, status);
+}
+
+/**
+ * Check a DIO line to see if it is currently generating a pulse.
+ *
+ * @return A pulse is in progress
+ */
+HAL_Bool HAL_IsPulsing(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  tDIO::tPulse pulseRegister = digitalSystem->readPulse(status);
+
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    return (pulseRegister.SPIPort & (1 << remapSPIChannel(port->channel))) != 0;
+  } else if (port->channel < kNumDigitalHeaders) {
+    return (pulseRegister.Headers & (1 << port->channel)) != 0;
+  } else {
+    return (pulseRegister.MXP & (1 << remapMXPChannel(port->channel))) != 0;
+  }
+}
+
+/**
+ * Check if any DIO line is currently generating a pulse.
+ *
+ * @return A pulse on some line is in progress
+ */
+HAL_Bool HAL_IsAnyPulsing(int32_t* status) {
+  initializeDigital(status);
+  if (*status != 0) return false;
+  tDIO::tPulse pulseRegister = digitalSystem->readPulse(status);
+  return pulseRegister.Headers != 0 && pulseRegister.MXP != 0 &&
+         pulseRegister.SPIPort != 0;
+}
+
+/**
+ * Write the filter index from the FPGA.
+ * Set the filter index used to filter out short pulses.
+ *
+ * @param dioPortHandle Handle to the digital I/O channel
+ * @param filterIndex The filter index.  Must be in the range 0 - 3, where 0
+ *                    means "none" and 1 - 3 means filter # filterIndex - 1.
+ */
+void HAL_SetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t filterIndex,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    // Channels 10-15 are SPI channels, so subtract our MXP channels
+    digitalSystem->writeFilterSelectHdr(port->channel - kNumDigitalMXPChannels,
+                                        filterIndex, status);
+  } else if (port->channel < kNumDigitalHeaders) {
+    digitalSystem->writeFilterSelectHdr(port->channel, filterIndex, status);
+  } else {
+    digitalSystem->writeFilterSelectMXP(remapMXPChannel(port->channel),
+                                        filterIndex, status);
+  }
+}
+
+/**
+ * Read the filter index from the FPGA.
+ * Get the filter index used to filter out short pulses.
+ *
+ * @param dioPortHandle Handle to the digital I/O channel
+ * @return filterIndex The filter index.  Must be in the range 0 - 3,
+ * where 0 means "none" and 1 - 3 means filter # filterIndex - 1.
+ */
+int32_t HAL_GetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    // Channels 10-15 are SPI channels, so subtract our MXP channels
+    return digitalSystem->readFilterSelectHdr(
+        port->channel - kNumDigitalMXPChannels, status);
+  } else if (port->channel < kNumDigitalHeaders) {
+    return digitalSystem->readFilterSelectHdr(port->channel, status);
+  } else {
+    return digitalSystem->readFilterSelectMXP(remapMXPChannel(port->channel),
+                                              status);
+  }
+}
+
+/**
+ * Set the filter period for the specified filter index.
+ *
+ * Set the filter period in FPGA cycles.  Even though there are 2 different
+ * filter index domains (MXP vs HDR), ignore that distinction for now since it
+ * compilicates the interface.  That can be changed later.
+ *
+ * @param filterIndex The filter index, 0 - 2.
+ * @param value The number of cycles that the signal must not transition to be
+ * counted as a transition.
+ */
+void HAL_SetFilterPeriod(int32_t filterIndex, int64_t value, int32_t* status) {
+  initializeDigital(status);
+  if (*status != 0) return;
+  std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+  digitalSystem->writeFilterPeriodHdr(filterIndex, value, status);
+  if (*status == 0) {
+    digitalSystem->writeFilterPeriodMXP(filterIndex, value, status);
+  }
+}
+
+/**
+ * Get the filter period for the specified filter index.
+ *
+ * Get the filter period in FPGA cycles.  Even though there are 2 different
+ * filter index domains (MXP vs HDR), ignore that distinction for now since it
+ * compilicates the interface.  Set status to NiFpga_Status_SoftwareFault if the
+ * filter values miss-match.
+ *
+ * @param filterIndex The filter index, 0 - 2.
+ * @param value The number of cycles that the signal must not transition to be
+ * counted as a transition.
+ */
+int64_t HAL_GetFilterPeriod(int32_t filterIndex, int32_t* status) {
+  initializeDigital(status);
+  if (*status != 0) return 0;
+  uint32_t hdrPeriod = 0;
+  uint32_t mxpPeriod = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(digitalDIOMutex);
+    hdrPeriod = digitalSystem->readFilterPeriodHdr(filterIndex, status);
+    if (*status == 0) {
+      mxpPeriod = digitalSystem->readFilterPeriodMXP(filterIndex, status);
+    }
+  }
+  if (hdrPeriod != mxpPeriod) {
+    *status = NiFpga_Status_SoftwareFault;
+    return -1;
+  }
+  return hdrPeriod;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/DigitalInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/DigitalInternal.cpp
new file mode 100644
index 0000000..2305ce2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/DigitalInternal.cpp
@@ -0,0 +1,198 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalInternal.h"
+
+#include <atomic>
+#include <thread>
+
+#include <FRC_NetworkCommunication/LoadOut.h>
+#include <support/mutex.h>
+
+#include "ConstantsInternal.h"
+#include "HAL/AnalogTrigger.h"
+#include "HAL/ChipObject.h"
+#include "HAL/HAL.h"
+#include "HAL/Ports.h"
+#include "HAL/cpp/UnsafeDIO.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+std::unique_ptr<tDIO> digitalSystem;
+std::unique_ptr<tRelay> relaySystem;
+std::unique_ptr<tPWM> pwmSystem;
+std::unique_ptr<tSPI> spiSystem;
+
+// Create a mutex to protect changes to the digital output values
+wpi::mutex digitalDIOMutex;
+
+DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
+                      kNumDigitalChannels + kNumPWMHeaders>*
+    digitalChannelHandles;
+
+namespace init {
+void InitializeDigitalInternal() {
+  static DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
+                               kNumDigitalChannels + kNumPWMHeaders>
+      dcH;
+  digitalChannelHandles = &dcH;
+}
+}  // namespace init
+
+namespace detail {
+wpi::mutex& UnsafeGetDIOMutex() { return digitalDIOMutex; }
+tDIO* UnsafeGetDigialSystem() { return digitalSystem.get(); }
+int32_t ComputeDigitalMask(HAL_DigitalHandle handle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(handle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  tDIO::tDO output;
+  output.value = 0;
+  if (port->channel >= kNumDigitalHeaders + kNumDigitalMXPChannels) {
+    output.SPIPort = (1u << remapSPIChannel(port->channel));
+  } else if (port->channel < kNumDigitalHeaders) {
+    output.Headers = (1u << port->channel);
+  } else {
+    output.MXP = (1u << remapMXPChannel(port->channel));
+  }
+  return output.value;
+}
+}  // namespace detail
+
+/**
+ * Initialize the digital system.
+ */
+void initializeDigital(int32_t* status) {
+  static std::atomic_bool initialized{false};
+  static wpi::mutex initializeMutex;
+  // Initial check, as if it's true initialization has finished
+  if (initialized) return;
+
+  std::lock_guard<wpi::mutex> lock(initializeMutex);
+  // Second check in case another thread was waiting
+  if (initialized) return;
+
+  digitalSystem.reset(tDIO::create(status));
+
+  // Relay Setup
+  relaySystem.reset(tRelay::create(status));
+
+  // Turn off all relay outputs.
+  relaySystem->writeValue_Forward(0, status);
+  relaySystem->writeValue_Reverse(0, status);
+
+  // PWM Setup
+  pwmSystem.reset(tPWM::create(status));
+
+  // Make sure that the 9403 IONode has had a chance to initialize before
+  // continuing.
+  while (pwmSystem->readLoopTiming(status) == 0) std::this_thread::yield();
+
+  if (pwmSystem->readLoopTiming(status) != kExpectedLoopTiming) {
+    *status = LOOP_TIMING_ERROR;  // NOTE: Doesn't display the error
+  }
+
+  // Calculate the length, in ms, of one DIO loop
+  double loopTime = pwmSystem->readLoopTiming(status) /
+                    (kSystemClockTicksPerMicrosecond * 1e3);
+
+  pwmSystem->writeConfig_Period(
+      static_cast<uint16_t>(kDefaultPwmPeriod / loopTime + .5), status);
+  uint16_t minHigh = static_cast<uint16_t>(
+      (kDefaultPwmCenter - kDefaultPwmStepsDown * loopTime) / loopTime + .5);
+  pwmSystem->writeConfig_MinHigh(minHigh, status);
+  // Ensure that PWM output values are set to OFF
+  for (uint8_t pwmIndex = 0; pwmIndex < kNumPWMChannels; pwmIndex++) {
+    // Copy of SetPWM
+    if (pwmIndex < tPWM::kNumHdrRegisters) {
+      pwmSystem->writeHdr(pwmIndex, kPwmDisabled, status);
+    } else {
+      pwmSystem->writeMXP(pwmIndex - tPWM::kNumHdrRegisters, kPwmDisabled,
+                          status);
+    }
+
+    // Copy of SetPWMPeriodScale, set to 4x by default.
+    if (pwmIndex < tPWM::kNumPeriodScaleHdrElements) {
+      pwmSystem->writePeriodScaleHdr(pwmIndex, 3, status);
+    } else {
+      pwmSystem->writePeriodScaleMXP(
+          pwmIndex - tPWM::kNumPeriodScaleHdrElements, 3, status);
+    }
+  }
+
+  // SPI setup
+  spiSystem.reset(tSPI::create(status));
+
+  initialized = true;
+}
+
+/**
+ * Map SPI channel numbers from their physical number (27 to 31) to their
+ * position in the bit field.
+ */
+int32_t remapSPIChannel(int32_t channel) { return channel - 26; }
+
+/**
+ * Map DIO channel numbers from their physical number (10 to 26) to their
+ * position in the bit field.
+ */
+int32_t remapMXPChannel(int32_t channel) { return channel - 10; }
+
+int32_t remapMXPPWMChannel(int32_t channel) {
+  if (channel < 14) {
+    return channel - 10;  // first block of 4 pwms (MXP 0-3)
+  } else {
+    return channel - 6;  // block of PWMs after SPI
+  }
+}
+
+/**
+ * remap the digital source channel and set the module.
+ * If it's an analog trigger, determine the module from the high order routing
+ * channel else do normal digital input remapping based on channel number
+ * (MXP)
+ */
+bool remapDigitalSource(HAL_Handle digitalSourceHandle,
+                        HAL_AnalogTriggerType analogTriggerType,
+                        uint8_t& channel, uint8_t& module,
+                        bool& analogTrigger) {
+  if (isHandleType(digitalSourceHandle, HAL_HandleEnum::AnalogTrigger)) {
+    // If handle passed, index is not negative
+    int32_t index = getHandleIndex(digitalSourceHandle);
+    channel = (index << 2) + analogTriggerType;
+    module = channel >> 4;
+    analogTrigger = true;
+    return true;
+  } else if (isHandleType(digitalSourceHandle, HAL_HandleEnum::DIO)) {
+    int32_t index = getHandleIndex(digitalSourceHandle);
+    if (index > kNumDigitalHeaders + kNumDigitalMXPChannels) {
+      // channels 10-15, so need to add headers to remap index
+      channel = remapSPIChannel(index) + kNumDigitalHeaders;
+      module = 0;
+    } else if (index >= kNumDigitalHeaders) {
+      channel = remapMXPChannel(index);
+      module = 1;
+    } else {
+      channel = index;
+      module = 0;
+    }
+    analogTrigger = false;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+}  // namespace hal
+
+// Unused function here to test template compile.
+__attribute__((unused)) static void CompileFunctorTest() {
+  hal::UnsafeManipulateDIO(0, nullptr, [](hal::DIOSetProxy& proxy) {});
+}
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/DigitalInternal.h b/third_party/allwpilib_2018/hal/src/main/native/athena/DigitalInternal.h
new file mode 100644
index 0000000..6ef8e29
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/DigitalInternal.h
@@ -0,0 +1,92 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/ChipObject.h"
+#include "HAL/Ports.h"
+#include "HAL/Types.h"
+#include "HAL/handles/DigitalHandleResource.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+/**
+ * MXP channels when used as digital output PWM are offset from actual value
+ */
+constexpr int32_t kMXPDigitalPWMOffset = 6;
+
+constexpr int32_t kExpectedLoopTiming = 40;
+
+/**
+ * kDefaultPwmPeriod is in ms
+ *
+ * - 20ms periods (50 Hz) are the "safest" setting in that this works for all
+ *   devices
+ * - 20ms periods seem to be desirable for Vex Motors
+ * - 20ms periods are the specified period for HS-322HD servos, but work
+ *   reliably down to 10.0 ms; starting at about 8.5ms, the servo sometimes hums
+ *   and get hot; by 5.0ms the hum is nearly continuous
+ * - 10ms periods work well for Victor 884
+ * - 5ms periods allows higher update rates for Luminary Micro Jaguar speed
+ *   controllers. Due to the shipping firmware on the Jaguar, we can't run the
+ *   update period less than 5.05 ms.
+ *
+ * kDefaultPwmPeriod is the 1x period (5.05 ms).  In hardware, the period
+ * scaling is implemented as an output squelch to get longer periods for old
+ * devices.
+ */
+constexpr double kDefaultPwmPeriod = 5.05;
+/**
+ * kDefaultPwmCenter is the PWM range center in ms
+ */
+constexpr double kDefaultPwmCenter = 1.5;
+/**
+ * kDefaultPWMStepsDown is the number of PWM steps below the centerpoint
+ */
+constexpr int32_t kDefaultPwmStepsDown = 1000;
+constexpr int32_t kPwmDisabled = 0;
+
+extern std::unique_ptr<tDIO> digitalSystem;
+extern std::unique_ptr<tRelay> relaySystem;
+extern std::unique_ptr<tPWM> pwmSystem;
+extern std::unique_ptr<tSPI> spiSystem;
+
+struct DigitalPort {
+  uint8_t channel;
+  bool configSet = false;
+  bool eliminateDeadband = false;
+  int32_t maxPwm = 0;
+  int32_t deadbandMaxPwm = 0;
+  int32_t centerPwm = 0;
+  int32_t deadbandMinPwm = 0;
+  int32_t minPwm = 0;
+};
+
+extern DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
+                             kNumDigitalChannels + kNumPWMHeaders>*
+    digitalChannelHandles;
+
+extern wpi::mutex digitalDIOMutex;
+
+void initializeDigital(int32_t* status);
+bool remapDigitalSource(HAL_Handle digitalSourceHandle,
+                        HAL_AnalogTriggerType analogTriggerType,
+                        uint8_t& channel, uint8_t& module, bool& analogTrigger);
+int32_t remapSPIChannel(int32_t channel);
+int32_t remapMXPPWMChannel(int32_t channel);
+int32_t remapMXPChannel(int32_t channel);
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Encoder.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Encoder.cpp
new file mode 100644
index 0000000..240c252
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Encoder.cpp
@@ -0,0 +1,460 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Encoder.h"
+
+#include "EncoderInternal.h"
+#include "FPGAEncoder.h"
+#include "HAL/ChipObject.h"
+#include "HAL/Counter.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/LimitedClassedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+Encoder::Encoder(HAL_Handle digitalSourceHandleA,
+                 HAL_AnalogTriggerType analogTriggerTypeA,
+                 HAL_Handle digitalSourceHandleB,
+                 HAL_AnalogTriggerType analogTriggerTypeB,
+                 bool reverseDirection, HAL_EncoderEncodingType encodingType,
+                 int32_t* status) {
+  m_encodingType = encodingType;
+  switch (encodingType) {
+    case HAL_Encoder_k4X: {
+      m_encodingScale = 4;
+      m_encoder = HAL_InitializeFPGAEncoder(
+          digitalSourceHandleA, analogTriggerTypeA, digitalSourceHandleB,
+          analogTriggerTypeB, reverseDirection, &m_index, status);
+      if (*status != 0) {
+        return;
+      }
+      m_counter = HAL_kInvalidHandle;
+      SetMaxPeriod(.5, status);
+      break;
+    }
+    case HAL_Encoder_k1X:
+    case HAL_Encoder_k2X: {
+      SetupCounter(digitalSourceHandleA, analogTriggerTypeA,
+                   digitalSourceHandleB, analogTriggerTypeB, reverseDirection,
+                   encodingType, status);
+
+      m_encodingScale = encodingType == HAL_Encoder_k1X ? 1 : 2;
+      break;
+    }
+    default:
+      *status = PARAMETER_OUT_OF_RANGE;
+      return;
+  }
+}
+
+void Encoder::SetupCounter(HAL_Handle digitalSourceHandleA,
+                           HAL_AnalogTriggerType analogTriggerTypeA,
+                           HAL_Handle digitalSourceHandleB,
+                           HAL_AnalogTriggerType analogTriggerTypeB,
+                           bool reverseDirection,
+                           HAL_EncoderEncodingType encodingType,
+                           int32_t* status) {
+  m_encodingScale = encodingType == HAL_Encoder_k1X ? 1 : 2;
+  m_counter =
+      HAL_InitializeCounter(HAL_Counter_kExternalDirection, &m_index, status);
+  if (*status != 0) return;
+  HAL_SetCounterMaxPeriod(m_counter, 0.5, status);
+  if (*status != 0) return;
+  HAL_SetCounterUpSource(m_counter, digitalSourceHandleA, analogTriggerTypeA,
+                         status);
+  if (*status != 0) return;
+  HAL_SetCounterDownSource(m_counter, digitalSourceHandleB, analogTriggerTypeB,
+                           status);
+  if (*status != 0) return;
+  if (encodingType == HAL_Encoder_k1X) {
+    HAL_SetCounterUpSourceEdge(m_counter, true, false, status);
+    HAL_SetCounterAverageSize(m_counter, 1, status);
+  } else {
+    HAL_SetCounterUpSourceEdge(m_counter, true, true, status);
+    HAL_SetCounterAverageSize(m_counter, 2, status);
+  }
+  HAL_SetCounterDownSourceEdge(m_counter, reverseDirection, true, status);
+}
+
+Encoder::~Encoder() {
+  if (m_counter != HAL_kInvalidHandle) {
+    int32_t status = 0;
+    HAL_FreeCounter(m_counter, &status);
+  } else {
+    int32_t status = 0;
+    HAL_FreeFPGAEncoder(m_encoder, &status);
+  }
+}
+
+// CounterBase interface
+int32_t Encoder::Get(int32_t* status) const {
+  return static_cast<int32_t>(GetRaw(status) * DecodingScaleFactor());
+}
+
+int32_t Encoder::GetRaw(int32_t* status) const {
+  if (m_counter) {
+    return HAL_GetCounter(m_counter, status);
+  } else {
+    return HAL_GetFPGAEncoder(m_encoder, status);
+  }
+}
+
+int32_t Encoder::GetEncodingScale(int32_t* status) const {
+  return m_encodingScale;
+}
+
+void Encoder::Reset(int32_t* status) {
+  if (m_counter) {
+    HAL_ResetCounter(m_counter, status);
+  } else {
+    HAL_ResetFPGAEncoder(m_encoder, status);
+  }
+}
+
+double Encoder::GetPeriod(int32_t* status) const {
+  if (m_counter) {
+    return HAL_GetCounterPeriod(m_counter, status) / DecodingScaleFactor();
+  } else {
+    return HAL_GetFPGAEncoderPeriod(m_encoder, status);
+  }
+}
+
+void Encoder::SetMaxPeriod(double maxPeriod, int32_t* status) {
+  if (m_counter) {
+    HAL_SetCounterMaxPeriod(m_counter, maxPeriod, status);
+  } else {
+    HAL_SetFPGAEncoderMaxPeriod(m_encoder, maxPeriod, status);
+  }
+}
+
+bool Encoder::GetStopped(int32_t* status) const {
+  if (m_counter) {
+    return HAL_GetCounterStopped(m_counter, status);
+  } else {
+    return HAL_GetFPGAEncoderStopped(m_encoder, status);
+  }
+}
+
+bool Encoder::GetDirection(int32_t* status) const {
+  if (m_counter) {
+    return HAL_GetCounterDirection(m_counter, status);
+  } else {
+    return HAL_GetFPGAEncoderDirection(m_encoder, status);
+  }
+}
+
+double Encoder::GetDistance(int32_t* status) const {
+  return GetRaw(status) * DecodingScaleFactor() * m_distancePerPulse;
+}
+
+double Encoder::GetRate(int32_t* status) const {
+  return m_distancePerPulse / GetPeriod(status);
+}
+
+void Encoder::SetMinRate(double minRate, int32_t* status) {
+  SetMaxPeriod(m_distancePerPulse / minRate, status);
+}
+
+void Encoder::SetDistancePerPulse(double distancePerPulse, int32_t* status) {
+  m_distancePerPulse = distancePerPulse;
+}
+
+void Encoder::SetReverseDirection(bool reverseDirection, int32_t* status) {
+  if (m_counter) {
+    HAL_SetCounterReverseDirection(m_counter, reverseDirection, status);
+  } else {
+    HAL_SetFPGAEncoderReverseDirection(m_encoder, reverseDirection, status);
+  }
+}
+
+void Encoder::SetSamplesToAverage(int32_t samplesToAverage, int32_t* status) {
+  if (samplesToAverage < 1 || samplesToAverage > 127) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+  if (m_counter) {
+    HAL_SetCounterSamplesToAverage(m_counter, samplesToAverage, status);
+  } else {
+    HAL_SetFPGAEncoderSamplesToAverage(m_encoder, samplesToAverage, status);
+  }
+}
+
+int32_t Encoder::GetSamplesToAverage(int32_t* status) const {
+  if (m_counter) {
+    return HAL_GetCounterSamplesToAverage(m_counter, status);
+  } else {
+    return HAL_GetFPGAEncoderSamplesToAverage(m_encoder, status);
+  }
+}
+
+void Encoder::SetIndexSource(HAL_Handle digitalSourceHandle,
+                             HAL_AnalogTriggerType analogTriggerType,
+                             HAL_EncoderIndexingType type, int32_t* status) {
+  if (m_counter) {
+    *status = HAL_COUNTER_NOT_SUPPORTED;
+    return;
+  }
+  bool activeHigh =
+      (type == HAL_kResetWhileHigh) || (type == HAL_kResetOnRisingEdge);
+  bool edgeSensitive =
+      (type == HAL_kResetOnFallingEdge) || (type == HAL_kResetOnRisingEdge);
+  HAL_SetFPGAEncoderIndexSource(m_encoder, digitalSourceHandle,
+                                analogTriggerType, activeHigh, edgeSensitive,
+                                status);
+}
+
+double Encoder::DecodingScaleFactor() const {
+  switch (m_encodingType) {
+    case HAL_Encoder_k1X:
+      return 1.0;
+    case HAL_Encoder_k2X:
+      return 0.5;
+    case HAL_Encoder_k4X:
+      return 0.25;
+    default:
+      return 0.0;
+  }
+}
+
+static LimitedClassedHandleResource<HAL_EncoderHandle, Encoder,
+                                    kNumEncoders + kNumCounters,
+                                    HAL_HandleEnum::Encoder>* encoderHandles;
+
+namespace hal {
+namespace init {
+void InitializeEncoder() {
+  static LimitedClassedHandleResource<HAL_EncoderHandle, Encoder,
+                                      kNumEncoders + kNumCounters,
+                                      HAL_HandleEnum::Encoder>
+      eH;
+  encoderHandles = &eH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_EncoderHandle HAL_InitializeEncoder(
+    HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,
+    HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB,
+    HAL_Bool reverseDirection, HAL_EncoderEncodingType encodingType,
+    int32_t* status) {
+  auto encoder = std::make_shared<Encoder>(
+      digitalSourceHandleA, analogTriggerTypeA, digitalSourceHandleB,
+      analogTriggerTypeB, reverseDirection, encodingType, status);
+  if (*status != 0) return HAL_kInvalidHandle;  // return in creation error
+  auto handle = encoderHandles->Allocate(encoder);
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  return handle;
+}
+
+void HAL_FreeEncoder(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  encoderHandles->Free(encoderHandle);
+}
+
+int32_t HAL_GetEncoder(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->Get(status);
+}
+
+int32_t HAL_GetEncoderRaw(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetRaw(status);
+}
+
+int32_t HAL_GetEncoderEncodingScale(HAL_EncoderHandle encoderHandle,
+                                    int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetEncodingScale(status);
+}
+
+void HAL_ResetEncoder(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->Reset(status);
+}
+
+double HAL_GetEncoderPeriod(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetPeriod(status);
+}
+
+void HAL_SetEncoderMaxPeriod(HAL_EncoderHandle encoderHandle, double maxPeriod,
+                             int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->SetMaxPeriod(maxPeriod, status);
+}
+
+HAL_Bool HAL_GetEncoderStopped(HAL_EncoderHandle encoderHandle,
+                               int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetStopped(status);
+}
+
+HAL_Bool HAL_GetEncoderDirection(HAL_EncoderHandle encoderHandle,
+                                 int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetDirection(status);
+}
+
+double HAL_GetEncoderDistance(HAL_EncoderHandle encoderHandle,
+                              int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetDistance(status);
+}
+
+double HAL_GetEncoderRate(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetRate(status);
+}
+
+void HAL_SetEncoderMinRate(HAL_EncoderHandle encoderHandle, double minRate,
+                           int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->SetMinRate(minRate, status);
+}
+
+void HAL_SetEncoderDistancePerPulse(HAL_EncoderHandle encoderHandle,
+                                    double distancePerPulse, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->SetDistancePerPulse(distancePerPulse, status);
+}
+
+void HAL_SetEncoderReverseDirection(HAL_EncoderHandle encoderHandle,
+                                    HAL_Bool reverseDirection,
+                                    int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->SetReverseDirection(reverseDirection, status);
+}
+
+void HAL_SetEncoderSamplesToAverage(HAL_EncoderHandle encoderHandle,
+                                    int32_t samplesToAverage, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->SetSamplesToAverage(samplesToAverage, status);
+}
+
+int32_t HAL_GetEncoderSamplesToAverage(HAL_EncoderHandle encoderHandle,
+                                       int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetSamplesToAverage(status);
+}
+
+double HAL_GetEncoderDecodingScaleFactor(HAL_EncoderHandle encoderHandle,
+                                         int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->DecodingScaleFactor();
+}
+
+double HAL_GetEncoderDistancePerPulse(HAL_EncoderHandle encoderHandle,
+                                      int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetDistancePerPulse();
+}
+
+HAL_EncoderEncodingType HAL_GetEncoderEncodingType(
+    HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_Encoder_k4X;  // default to k4X
+  }
+  return encoder->GetEncodingType();
+}
+
+void HAL_SetEncoderIndexSource(HAL_EncoderHandle encoderHandle,
+                               HAL_Handle digitalSourceHandle,
+                               HAL_AnalogTriggerType analogTriggerType,
+                               HAL_EncoderIndexingType type, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->SetIndexSource(digitalSourceHandle, analogTriggerType, type, status);
+}
+
+int32_t HAL_GetEncoderFPGAIndex(HAL_EncoderHandle encoderHandle,
+                                int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->GetFPGAIndex();
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/EncoderInternal.h b/third_party/allwpilib_2018/hal/src/main/native/athena/EncoderInternal.h
new file mode 100644
index 0000000..f25bb5a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/EncoderInternal.h
@@ -0,0 +1,78 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Encoder.h"
+
+namespace hal {
+
+class Encoder {
+ public:
+  Encoder(HAL_Handle digitalSourceHandleA,
+          HAL_AnalogTriggerType analogTriggerTypeA,
+          HAL_Handle digitalSourceHandleB,
+          HAL_AnalogTriggerType analogTriggerTypeB, bool reverseDirection,
+          HAL_EncoderEncodingType encodingType, int32_t* status);
+  ~Encoder();
+
+  // CounterBase interface
+  int32_t Get(int32_t* status) const;
+  int32_t GetRaw(int32_t* status) const;
+  int32_t GetEncodingScale(int32_t* status) const;
+  void Reset(int32_t* status);
+  double GetPeriod(int32_t* status) const;
+  void SetMaxPeriod(double maxPeriod, int32_t* status);
+  bool GetStopped(int32_t* status) const;
+  bool GetDirection(int32_t* status) const;
+
+  double GetDistance(int32_t* status) const;
+  double GetRate(int32_t* status) const;
+  void SetMinRate(double minRate, int32_t* status);
+  void SetDistancePerPulse(double distancePerPulse, int32_t* status);
+  void SetReverseDirection(bool reverseDirection, int32_t* status);
+  void SetSamplesToAverage(int32_t samplesToAverage, int32_t* status);
+  int32_t GetSamplesToAverage(int32_t* status) const;
+
+  void SetIndexSource(HAL_Handle digitalSourceHandle,
+                      HAL_AnalogTriggerType analogTriggerType,
+                      HAL_EncoderIndexingType type, int32_t* status);
+
+  int32_t GetFPGAIndex() const { return m_index; }
+
+  int32_t GetEncodingScale() const { return m_encodingScale; }
+
+  double DecodingScaleFactor() const;
+
+  double GetDistancePerPulse() const { return m_distancePerPulse; }
+
+  HAL_EncoderEncodingType GetEncodingType() const { return m_encodingType; }
+
+ private:
+  void SetupCounter(HAL_Handle digitalSourceHandleA,
+                    HAL_AnalogTriggerType analogTriggerTypeA,
+                    HAL_Handle digitalSourceHandleB,
+                    HAL_AnalogTriggerType analogTriggerTypeB,
+                    bool reverseDirection, HAL_EncoderEncodingType encodingType,
+                    int32_t* status);
+
+  HAL_FPGAEncoderHandle m_encoder = HAL_kInvalidHandle;
+
+  HAL_CounterHandle m_counter = HAL_kInvalidHandle;
+
+  int32_t m_index = 0;
+
+  double m_distancePerPulse = 1.0;
+
+  HAL_EncoderEncodingType m_encodingType;
+
+  int32_t m_encodingScale;
+};
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/FPGAEncoder.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/FPGAEncoder.cpp
new file mode 100644
index 0000000..764728e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/FPGAEncoder.cpp
@@ -0,0 +1,310 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "FPGAEncoder.h"
+
+#include <memory>
+
+#include "DigitalInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+
+struct Encoder {
+  std::unique_ptr<tEncoder> encoder;
+  uint8_t index;
+};
+
+}  // namespace
+
+static constexpr double DECODING_SCALING_FACTOR = 0.25;
+
+static LimitedHandleResource<HAL_FPGAEncoderHandle, Encoder, kNumEncoders,
+                             HAL_HandleEnum::FPGAEncoder>* fpgaEncoderHandles;
+
+namespace hal {
+namespace init {
+void InitializeFPGAEncoder() {
+  static LimitedHandleResource<HAL_FPGAEncoderHandle, Encoder, kNumEncoders,
+                               HAL_HandleEnum::FPGAEncoder>
+      feH;
+  fpgaEncoderHandles = &feH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_FPGAEncoderHandle HAL_InitializeFPGAEncoder(
+    HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,
+    HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB,
+    HAL_Bool reverseDirection, int32_t* index, int32_t* status) {
+  bool routingAnalogTriggerA = false;
+  uint8_t routingChannelA = 0;
+  uint8_t routingModuleA = 0;
+  bool successA = remapDigitalSource(digitalSourceHandleA, analogTriggerTypeA,
+                                     routingChannelA, routingModuleA,
+                                     routingAnalogTriggerA);
+  bool routingAnalogTriggerB = false;
+  uint8_t routingChannelB = 0;
+  uint8_t routingModuleB = 0;
+  bool successB = remapDigitalSource(digitalSourceHandleB, analogTriggerTypeB,
+                                     routingChannelB, routingModuleB,
+                                     routingAnalogTriggerB);
+
+  if (!successA || !successB) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  auto handle = fpgaEncoderHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {  // out of resources
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+
+  auto encoder = fpgaEncoderHandles->Get(handle);
+  if (encoder == nullptr) {  // will only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  encoder->index = static_cast<uint8_t>(getHandleIndex(handle));
+  *index = encoder->index;
+  // TODO: if (index == ~0ul) { CloneError(quadEncoders); return; }
+  encoder->encoder.reset(tEncoder::create(encoder->index, status));
+  encoder->encoder->writeConfig_ASource_Module(routingModuleA, status);
+  encoder->encoder->writeConfig_ASource_Channel(routingChannelA, status);
+  encoder->encoder->writeConfig_ASource_AnalogTrigger(routingAnalogTriggerA,
+                                                      status);
+  encoder->encoder->writeConfig_BSource_Module(routingModuleB, status);
+  encoder->encoder->writeConfig_BSource_Channel(routingChannelB, status);
+  encoder->encoder->writeConfig_BSource_AnalogTrigger(routingAnalogTriggerB,
+                                                      status);
+  encoder->encoder->strobeReset(status);
+  encoder->encoder->writeConfig_Reverse(reverseDirection, status);
+  encoder->encoder->writeTimerConfig_AverageSize(4, status);
+
+  return handle;
+}
+
+void HAL_FreeFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                         int32_t* status) {
+  fpgaEncoderHandles->Free(fpgaEncoderHandle);
+}
+
+/**
+ * Reset the Encoder distance to zero.
+ * Resets the current count to zero on the encoder.
+ */
+void HAL_ResetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                          int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->encoder->strobeReset(status);
+}
+
+/**
+ * Gets the fpga value from the encoder.
+ * The fpga value is the actual count unscaled by the 1x, 2x, or 4x scale
+ * factor.
+ * @return Current fpga count from the encoder
+ */
+int32_t HAL_GetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                           int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->encoder->readOutput_Value(status);
+}
+
+/**
+ * Returns the period of the most recent pulse.
+ * Returns the period of the most recent Encoder pulse in seconds.
+ * This method compenstates for the decoding type.
+ *
+ * @deprecated Use GetRate() in favor of this method.  This returns unscaled
+ * periods and GetRate() scales using value from SetDistancePerPulse().
+ *
+ * @return Period in seconds of the most recent pulse.
+ */
+double HAL_GetFPGAEncoderPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+  tEncoder::tTimerOutput output = encoder->encoder->readTimerOutput(status);
+  double value;
+  if (output.Stalled) {
+    // Return infinity
+    double zero = 0.0;
+    value = 1.0 / zero;
+  } else {
+    // output.Period is a fixed point number that counts by 2 (24 bits, 25
+    // integer bits)
+    value = static_cast<double>(output.Period << 1) /
+            static_cast<double>(output.Count);
+  }
+  double measuredPeriod = value * 2.5e-8;
+  return measuredPeriod / DECODING_SCALING_FACTOR;
+}
+
+/**
+ * Sets the maximum period for stopped detection.
+ * Sets the value that represents the maximum period of the Encoder before it
+ * will assume that the attached device is stopped. This timeout allows users
+ * to determine if the wheels or other shaft has stopped rotating.
+ * This method compensates for the decoding type.
+ *
+ * @deprecated Use SetMinRate() in favor of this method.  This takes unscaled
+ * periods and SetMinRate() scales using value from SetDistancePerPulse().
+ *
+ * @param maxPeriod The maximum time between rising and falling edges before the
+ * FPGA will
+ * report the device stopped. This is expressed in seconds.
+ */
+void HAL_SetFPGAEncoderMaxPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                 double maxPeriod, int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->encoder->writeTimerConfig_StallPeriod(
+      static_cast<uint32_t>(maxPeriod * 4.0e8 * DECODING_SCALING_FACTOR),
+      status);
+}
+
+/**
+ * Determine if the encoder is stopped.
+ * Using the MaxPeriod value, a boolean is returned that is true if the encoder
+ * is considered stopped and false if it is still moving. A stopped encoder is
+ * one where the most recent pulse width exceeds the MaxPeriod.
+ * @return True if the encoder is considered stopped.
+ */
+HAL_Bool HAL_GetFPGAEncoderStopped(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                   int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return encoder->encoder->readTimerOutput_Stalled(status) != 0;
+}
+
+/**
+ * The last direction the encoder value changed.
+ * @return The last direction the encoder value changed.
+ */
+HAL_Bool HAL_GetFPGAEncoderDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                     int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return encoder->encoder->readOutput_Direction(status);
+}
+
+/**
+ * Set the direction sensing for this encoder.
+ * This sets the direction sensing on the encoder so that it could count in the
+ * correct software direction regardless of the mounting.
+ * @param reverseDirection true if the encoder direction should be reversed
+ */
+void HAL_SetFPGAEncoderReverseDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                        HAL_Bool reverseDirection,
+                                        int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  encoder->encoder->writeConfig_Reverse(reverseDirection, status);
+}
+
+/**
+ * Set the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period. Perform averaging to account for
+ * mechanical imperfections or as oversampling to increase resolution.
+ * @param samplesToAverage The number of samples to average from 1 to 127.
+ */
+void HAL_SetFPGAEncoderSamplesToAverage(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                        int32_t samplesToAverage,
+                                        int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (samplesToAverage < 1 || samplesToAverage > 127) {
+    *status = PARAMETER_OUT_OF_RANGE;
+  }
+  encoder->encoder->writeTimerConfig_AverageSize(samplesToAverage, status);
+}
+
+/**
+ * Get the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period. Perform averaging to account for
+ * mechanical imperfections or as oversampling to increase resolution.
+ * @return SamplesToAverage The number of samples being averaged (from 1 to 127)
+ */
+int32_t HAL_GetFPGAEncoderSamplesToAverage(
+    HAL_FPGAEncoderHandle fpgaEncoderHandle, int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return encoder->encoder->readTimerConfig_AverageSize(status);
+}
+
+/**
+ * Set an index source for an encoder, which is an input that resets the
+ * encoder's count.
+ */
+void HAL_SetFPGAEncoderIndexSource(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                   HAL_Handle digitalSourceHandle,
+                                   HAL_AnalogTriggerType analogTriggerType,
+                                   HAL_Bool activeHigh, HAL_Bool edgeSensitive,
+                                   int32_t* status) {
+  auto encoder = fpgaEncoderHandles->Get(fpgaEncoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  bool routingAnalogTrigger = false;
+  uint8_t routingChannel = 0;
+  uint8_t routingModule = 0;
+  bool success =
+      remapDigitalSource(digitalSourceHandle, analogTriggerType, routingChannel,
+                         routingModule, routingAnalogTrigger);
+  if (!success) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  encoder->encoder->writeConfig_IndexSource_Channel(routingChannel, status);
+  encoder->encoder->writeConfig_IndexSource_Module(routingModule, status);
+  encoder->encoder->writeConfig_IndexSource_AnalogTrigger(routingAnalogTrigger,
+                                                          status);
+  encoder->encoder->writeConfig_IndexActiveHigh(activeHigh, status);
+  encoder->encoder->writeConfig_IndexEdgeSensitive(edgeSensitive, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/FPGAEncoder.h b/third_party/allwpilib_2018/hal/src/main/native/athena/FPGAEncoder.h
new file mode 100644
index 0000000..c05d436
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/FPGAEncoder.h
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Types.h"
+
+extern "C" {
+
+HAL_FPGAEncoderHandle HAL_InitializeFPGAEncoder(
+    HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,
+    HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB,
+    HAL_Bool reverseDirection, int32_t* index, int32_t* status);
+void HAL_FreeFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                         int32_t* status);
+void HAL_ResetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                          int32_t* status);
+int32_t HAL_GetFPGAEncoder(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                           int32_t* status);  // Raw value
+double HAL_GetFPGAEncoderPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                int32_t* status);
+void HAL_SetFPGAEncoderMaxPeriod(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                 double maxPeriod, int32_t* status);
+HAL_Bool HAL_GetFPGAEncoderStopped(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                   int32_t* status);
+HAL_Bool HAL_GetFPGAEncoderDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                     int32_t* status);
+void HAL_SetFPGAEncoderReverseDirection(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                        HAL_Bool reverseDirection,
+                                        int32_t* status);
+void HAL_SetFPGAEncoderSamplesToAverage(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                        int32_t samplesToAverage,
+                                        int32_t* status);
+int32_t HAL_GetFPGAEncoderSamplesToAverage(
+    HAL_FPGAEncoderHandle fpgaEncoderHandle, int32_t* status);
+void HAL_SetFPGAEncoderIndexSource(HAL_FPGAEncoderHandle fpgaEncoderHandle,
+                                   HAL_Handle digitalSourceHandle,
+                                   HAL_AnalogTriggerType analogTriggerType,
+                                   HAL_Bool activeHigh, HAL_Bool edgeSensitive,
+                                   int32_t* status);
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/FRCDriverStation.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/FRCDriverStation.cpp
new file mode 100644
index 0000000..32d29b9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/FRCDriverStation.cpp
@@ -0,0 +1,406 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <atomic>
+#include <chrono>
+#include <cstdlib>
+#include <cstring>
+#include <limits>
+
+#include <FRC_NetworkCommunication/FRCComm.h>
+#include <FRC_NetworkCommunication/NetCommRPCProxy_Occur.h>
+#include <llvm/raw_ostream.h>
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+#include "HAL/DriverStation.h"
+
+static_assert(sizeof(int32_t) >= sizeof(int),
+              "FRC_NetworkComm status variable is larger than 32 bits");
+
+struct HAL_JoystickAxesInt {
+  int16_t count;
+  int16_t axes[HAL_kMaxJoystickAxes];
+};
+
+static wpi::mutex msgMutex;
+static wpi::condition_variable* newDSDataAvailableCond;
+static wpi::mutex newDSDataAvailableMutex;
+static int newDSDataAvailableCounter{0};
+
+namespace hal {
+namespace init {
+void InitializeFRCDriverStation() {
+  static wpi::condition_variable nddaC;
+  newDSDataAvailableCond = &nddaC;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
+                      const char* details, const char* location,
+                      const char* callStack, HAL_Bool printMsg) {
+  // Avoid flooding console by keeping track of previous 5 error
+  // messages and only printing again if they're longer than 1 second old.
+  static constexpr int KEEP_MSGS = 5;
+  std::lock_guard<wpi::mutex> lock(msgMutex);
+  static std::string prevMsg[KEEP_MSGS];
+  static std::chrono::time_point<std::chrono::steady_clock>
+      prevMsgTime[KEEP_MSGS];
+  static bool initialized = false;
+  if (!initialized) {
+    for (int i = 0; i < KEEP_MSGS; i++) {
+      prevMsgTime[i] =
+          std::chrono::steady_clock::now() - std::chrono::seconds(2);
+    }
+    initialized = true;
+  }
+
+  auto curTime = std::chrono::steady_clock::now();
+  int i;
+  for (i = 0; i < KEEP_MSGS; ++i) {
+    if (prevMsg[i] == details) break;
+  }
+  int retval = 0;
+  if (i == KEEP_MSGS || (curTime - prevMsgTime[i]) >= std::chrono::seconds(1)) {
+    retval = FRC_NetworkCommunication_sendError(isError, errorCode, isLVCode,
+                                                details, location, callStack);
+    if (printMsg) {
+      if (location && location[0] != '\0') {
+        llvm::errs() << (isError ? "Error" : "Warning") << " at " << location
+                     << ": ";
+      }
+      llvm::errs() << details << "\n";
+      if (callStack && callStack[0] != '\0') {
+        llvm::errs() << callStack << "\n";
+      }
+    }
+    if (i == KEEP_MSGS) {
+      // replace the oldest one
+      i = 0;
+      auto first = prevMsgTime[0];
+      for (int j = 1; j < KEEP_MSGS; ++j) {
+        if (prevMsgTime[j] < first) {
+          first = prevMsgTime[j];
+          i = j;
+        }
+      }
+      prevMsg[i] = details;
+    }
+    prevMsgTime[i] = curTime;
+  }
+  return retval;
+}
+
+int32_t HAL_GetControlWord(HAL_ControlWord* controlWord) {
+  std::memset(controlWord, 0, sizeof(HAL_ControlWord));
+  return FRC_NetworkCommunication_getControlWord(
+      reinterpret_cast<ControlWord_t*>(controlWord));
+}
+
+HAL_AllianceStationID HAL_GetAllianceStation(int32_t* status) {
+  HAL_AllianceStationID allianceStation;
+  *status = FRC_NetworkCommunication_getAllianceStation(
+      reinterpret_cast<AllianceStationID_t*>(&allianceStation));
+  return allianceStation;
+}
+
+int32_t HAL_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes) {
+  HAL_JoystickAxesInt axesInt;
+
+  int retVal = FRC_NetworkCommunication_getJoystickAxes(
+      joystickNum, reinterpret_cast<JoystickAxes_t*>(&axesInt),
+      HAL_kMaxJoystickAxes);
+
+  // copy integer values to double values
+  axes->count = axesInt.count;
+  // current scaling is -128 to 127, can easily be patched in the future by
+  // changing this function.
+  for (int32_t i = 0; i < axesInt.count; i++) {
+    int8_t value = axesInt.axes[i];
+    if (value < 0) {
+      axes->axes[i] = value / 128.0;
+    } else {
+      axes->axes[i] = value / 127.0;
+    }
+  }
+
+  return retVal;
+}
+
+int32_t HAL_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs) {
+  return FRC_NetworkCommunication_getJoystickPOVs(
+      joystickNum, reinterpret_cast<JoystickPOV_t*>(povs),
+      HAL_kMaxJoystickPOVs);
+}
+
+int32_t HAL_GetJoystickButtons(int32_t joystickNum,
+                               HAL_JoystickButtons* buttons) {
+  return FRC_NetworkCommunication_getJoystickButtons(
+      joystickNum, &buttons->buttons, &buttons->count);
+}
+/**
+ * Retrieve the Joystick Descriptor for particular slot
+ * @param desc [out] descriptor (data transfer object) to fill in.  desc is
+ * filled in regardless of success. In other words, if descriptor is not
+ * available, desc is filled in with default values matching the init-values in
+ * Java and C++ Driverstation for when caller requests a too-large joystick
+ * index.
+ *
+ * @return error code reported from Network Comm back-end.  Zero is good,
+ * nonzero is bad.
+ */
+int32_t HAL_GetJoystickDescriptor(int32_t joystickNum,
+                                  HAL_JoystickDescriptor* desc) {
+  desc->isXbox = 0;
+  desc->type = std::numeric_limits<uint8_t>::max();
+  desc->name[0] = '\0';
+  desc->axisCount =
+      HAL_kMaxJoystickAxes; /* set to the desc->axisTypes's capacity */
+  desc->buttonCount = 0;
+  desc->povCount = 0;
+  int retval = FRC_NetworkCommunication_getJoystickDesc(
+      joystickNum, &desc->isXbox, &desc->type,
+      reinterpret_cast<char*>(&desc->name), &desc->axisCount,
+      reinterpret_cast<uint8_t*>(&desc->axisTypes), &desc->buttonCount,
+      &desc->povCount);
+  /* check the return, if there is an error and the RIOimage predates FRC2017,
+   * then axisCount needs to be cleared */
+  if (retval != 0) {
+    /* set count to zero so downstream code doesn't decode invalid axisTypes. */
+    desc->axisCount = 0;
+  }
+  return retval;
+}
+
+HAL_Bool HAL_GetJoystickIsXbox(int32_t joystickNum) {
+  HAL_JoystickDescriptor joystickDesc;
+  if (HAL_GetJoystickDescriptor(joystickNum, &joystickDesc) < 0) {
+    return 0;
+  } else {
+    return joystickDesc.isXbox;
+  }
+}
+
+int32_t HAL_GetJoystickType(int32_t joystickNum) {
+  HAL_JoystickDescriptor joystickDesc;
+  if (HAL_GetJoystickDescriptor(joystickNum, &joystickDesc) < 0) {
+    return -1;
+  } else {
+    return joystickDesc.type;
+  }
+}
+
+char* HAL_GetJoystickName(int32_t joystickNum) {
+  HAL_JoystickDescriptor joystickDesc;
+  if (HAL_GetJoystickDescriptor(joystickNum, &joystickDesc) < 0) {
+    char* name = static_cast<char*>(std::malloc(1));
+    name[0] = '\0';
+    return name;
+  } else {
+    size_t len = std::strlen(joystickDesc.name);
+    char* name = static_cast<char*>(std::malloc(len + 1));
+    std::strncpy(name, joystickDesc.name, len);
+    name[len] = '\0';
+    return name;
+  }
+}
+
+void HAL_FreeJoystickName(char* name) { std::free(name); }
+
+int32_t HAL_GetJoystickAxisType(int32_t joystickNum, int32_t axis) {
+  HAL_JoystickDescriptor joystickDesc;
+  if (HAL_GetJoystickDescriptor(joystickNum, &joystickDesc) < 0) {
+    return -1;
+  } else {
+    return joystickDesc.axisTypes[axis];
+  }
+}
+
+int32_t HAL_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+                               int32_t leftRumble, int32_t rightRumble) {
+  return FRC_NetworkCommunication_setJoystickOutputs(joystickNum, outputs,
+                                                     leftRumble, rightRumble);
+}
+
+double HAL_GetMatchTime(int32_t* status) {
+  float matchTime;
+  *status = FRC_NetworkCommunication_getMatchTime(&matchTime);
+  return matchTime;
+}
+
+int HAL_GetMatchInfo(HAL_MatchInfo* info) {
+  uint16_t gameSpecificMessageSize = 0;
+  int status = FRC_NetworkCommunication_getMatchInfo(
+      nullptr, nullptr, nullptr, nullptr, nullptr, &gameSpecificMessageSize);
+  if (status < 0) {
+    info->eventName = nullptr;
+    info->gameSpecificMessage = nullptr;
+    return status;
+  }
+  info->eventName = static_cast<char*>(std::malloc(256));
+  gameSpecificMessageSize = ((gameSpecificMessageSize + 1023) / 1024) * 1024;
+  uint16_t originalGameSpecificSize = gameSpecificMessageSize;
+  uint8_t* gameSpecificMessage =
+      static_cast<uint8_t*>(std::malloc(gameSpecificMessageSize));
+  MatchType_t matchType = MatchType_t::kMatchType_none;
+  uint16_t matchNumber = 0;
+  uint8_t replayNumber = 0;
+  status = FRC_NetworkCommunication_getMatchInfo(
+      info->eventName, &matchType, &matchNumber, &replayNumber,
+      gameSpecificMessage, &gameSpecificMessageSize);
+  if (status < 0) {
+    std::free(info->eventName);
+    std::free(gameSpecificMessage);
+    info->eventName = nullptr;
+    info->gameSpecificMessage = nullptr;
+    return status;
+  }
+  if (gameSpecificMessageSize >= originalGameSpecificSize) {
+    // Data has updated between size and read calls. Retry.
+    // Unless large lag, this call will be right.
+    std::free(gameSpecificMessage);
+    gameSpecificMessageSize = ((gameSpecificMessageSize + 1023) / 1024) * 1024;
+    gameSpecificMessage =
+        static_cast<uint8_t*>(std::malloc(gameSpecificMessageSize));
+    int status = FRC_NetworkCommunication_getMatchInfo(
+        nullptr, nullptr, nullptr, nullptr, gameSpecificMessage,
+        &gameSpecificMessageSize);
+    if (status < 0) {
+      std::free(info->eventName);
+      std::free(gameSpecificMessage);
+      info->eventName = nullptr;
+      info->gameSpecificMessage = nullptr;
+      return status;
+    }
+  }
+  info->eventName[255] = '\0';
+  info->matchType = static_cast<HAL_MatchType>(matchType);
+  info->matchNumber = matchNumber;
+  info->replayNumber = replayNumber;
+  info->gameSpecificMessage = reinterpret_cast<char*>(gameSpecificMessage);
+  info->gameSpecificMessage[gameSpecificMessageSize] = '\0';
+  return status;
+}
+
+void HAL_FreeMatchInfo(HAL_MatchInfo* info) {
+  std::free(info->eventName);
+  std::free(info->gameSpecificMessage);
+  info->eventName = nullptr;
+  info->gameSpecificMessage = nullptr;
+}
+
+void HAL_ObserveUserProgramStarting(void) {
+  FRC_NetworkCommunication_observeUserProgramStarting();
+}
+
+void HAL_ObserveUserProgramDisabled(void) {
+  FRC_NetworkCommunication_observeUserProgramDisabled();
+}
+
+void HAL_ObserveUserProgramAutonomous(void) {
+  FRC_NetworkCommunication_observeUserProgramAutonomous();
+}
+
+void HAL_ObserveUserProgramTeleop(void) {
+  FRC_NetworkCommunication_observeUserProgramTeleop();
+}
+
+void HAL_ObserveUserProgramTest(void) {
+  FRC_NetworkCommunication_observeUserProgramTest();
+}
+
+bool HAL_IsNewControlData(void) {
+  // There is a rollover error condition here. At Packet# = n * (uintmax), this
+  // will return false when instead it should return true. However, this at a
+  // 20ms rate occurs once every 2.7 years of DS connected runtime, so not
+  // worth the cycles to check.
+  thread_local int lastCount{-1};
+  int currentCount = 0;
+  {
+    std::unique_lock<wpi::mutex> lock(newDSDataAvailableMutex);
+    currentCount = newDSDataAvailableCounter;
+  }
+  if (lastCount == currentCount) return false;
+  lastCount = currentCount;
+  return true;
+}
+
+/**
+ * Waits for the newest DS packet to arrive. Note that this is a blocking call.
+ */
+void HAL_WaitForDSData(void) { HAL_WaitForDSDataTimeout(0); }
+
+/**
+ * Waits for the newest DS packet to arrive. If timeout is <= 0, this will wait
+ * forever. Otherwise, it will wait until either a new packet, or the timeout
+ * time has passed. Returns true on new data, false on timeout.
+ */
+HAL_Bool HAL_WaitForDSDataTimeout(double timeout) {
+  auto timeoutTime =
+      std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
+
+  std::unique_lock<wpi::mutex> lock(newDSDataAvailableMutex);
+  int currentCount = newDSDataAvailableCounter;
+  while (newDSDataAvailableCounter == currentCount) {
+    if (timeout > 0) {
+      auto timedOut = newDSDataAvailableCond->wait_until(lock, timeoutTime);
+      if (timedOut == std::cv_status::timeout) {
+        return false;
+      }
+    } else {
+      newDSDataAvailableCond->wait(lock);
+    }
+  }
+  return true;
+}
+
+// Constant number to be used for our occur handle
+constexpr int32_t refNumber = 42;
+
+static void newDataOccur(uint32_t refNum) {
+  // Since we could get other values, require our specific handle
+  // to signal our threads
+  if (refNum != refNumber) return;
+  std::lock_guard<wpi::mutex> lock(newDSDataAvailableMutex);
+  // Nofify all threads
+  newDSDataAvailableCounter++;
+  newDSDataAvailableCond->notify_all();
+}
+
+/*
+ * Call this to initialize the driver station communication. This will properly
+ * handle multiple calls. However note that this CANNOT be called from a library
+ * that interfaces with LabVIEW.
+ */
+void HAL_InitializeDriverStation(void) {
+  static std::atomic_bool initialized{false};
+  static wpi::mutex initializeMutex;
+  // Initial check, as if it's true initialization has finished
+  if (initialized) return;
+
+  std::lock_guard<wpi::mutex> lock(initializeMutex);
+  // Second check in case another thread was waiting
+  if (initialized) return;
+
+  // Set up the occur function internally with NetComm
+  NetCommRPCProxy_SetOccurFuncPointer(newDataOccur);
+  // Set up our occur reference number
+  setNewDataOccurRef(refNumber);
+
+  initialized = true;
+}
+
+/*
+ * Releases the DS Mutex to allow proper shutdown of any threads that are
+ * waiting on it.
+ */
+void HAL_ReleaseDSMutex(void) { newDataOccur(refNumber); }
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/HAL.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/HAL.cpp
new file mode 100644
index 0000000..4c65597
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/HAL.cpp
@@ -0,0 +1,434 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+
+#include <signal.h>  // linux for kill
+#include <sys/prctl.h>
+#include <unistd.h>
+
+#include <atomic>
+#include <cstdlib>
+#include <fstream>
+#include <thread>
+
+#include <FRC_NetworkCommunication/FRCComm.h>
+#include <FRC_NetworkCommunication/LoadOut.h>
+#include <llvm/raw_ostream.h>
+#include <support/mutex.h>
+#include <support/timestamp.h>
+
+#include "HAL/ChipObject.h"
+#include "HAL/DriverStation.h"
+#include "HAL/Errors.h"
+#include "HAL/Notifier.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HALInitializer.h"
+#include "ctre/ctre.h"
+#include "visa/visa.h"
+
+using namespace hal;
+
+static std::unique_ptr<tGlobal> global;
+static std::unique_ptr<tSysWatchdog> watchdog;
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeHAL() {
+  InitializeHandlesInternal();
+  InitializeAccelerometer();
+  InitializeAnalogAccumulator();
+  InitializeAnalogGyro();
+  InitializeAnalogInput();
+  InitializeAnalogInternal();
+  InitializeAnalogOutput();
+  InitializeAnalogTrigger();
+  InitializeCAN();
+  InitializeCompressor();
+  InitializeConstants();
+  InitializeCounter();
+  InitializeDigitalInternal();
+  InitializeDIO();
+  InitializeEncoder();
+  InitializeFPGAEncoder();
+  InitializeFRCDriverStation();
+  InitializeI2C();
+  InitialzeInterrupts();
+  InitializeNotifier();
+  InitializeOSSerialPort();
+  InitializePCMInternal();
+  InitializePDP();
+  InitializePorts();
+  InitializePower();
+  InitializePWM();
+  InitializeRelay();
+  InitializeSerialPort();
+  InitializeSolenoid();
+  InitializeSPI();
+  InitializeThreads();
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_PortHandle HAL_GetPort(int32_t channel) {
+  // Dont allow a number that wouldn't fit in a uint8_t
+  if (channel < 0 || channel >= 255) return HAL_kInvalidHandle;
+  return createPortHandle(channel, 1);
+}
+
+/**
+ * @deprecated Uses module numbers
+ */
+HAL_PortHandle HAL_GetPortWithModule(int32_t module, int32_t channel) {
+  // Dont allow a number that wouldn't fit in a uint8_t
+  if (channel < 0 || channel >= 255) return HAL_kInvalidHandle;
+  if (module < 0 || module >= 255) return HAL_kInvalidHandle;
+  return createPortHandle(channel, module);
+}
+
+const char* HAL_GetErrorMessage(int32_t code) {
+  switch (code) {
+    case 0:
+      return "";
+    case CTR_RxTimeout:
+      return CTR_RxTimeout_MESSAGE;
+    case CTR_TxTimeout:
+      return CTR_TxTimeout_MESSAGE;
+    case CTR_InvalidParamValue:
+      return CTR_InvalidParamValue_MESSAGE;
+    case CTR_UnexpectedArbId:
+      return CTR_UnexpectedArbId_MESSAGE;
+    case CTR_TxFailed:
+      return CTR_TxFailed_MESSAGE;
+    case CTR_SigNotUpdated:
+      return CTR_SigNotUpdated_MESSAGE;
+    case NiFpga_Status_FifoTimeout:
+      return NiFpga_Status_FifoTimeout_MESSAGE;
+    case NiFpga_Status_TransferAborted:
+      return NiFpga_Status_TransferAborted_MESSAGE;
+    case NiFpga_Status_MemoryFull:
+      return NiFpga_Status_MemoryFull_MESSAGE;
+    case NiFpga_Status_SoftwareFault:
+      return NiFpga_Status_SoftwareFault_MESSAGE;
+    case NiFpga_Status_InvalidParameter:
+      return NiFpga_Status_InvalidParameter_MESSAGE;
+    case NiFpga_Status_ResourceNotFound:
+      return NiFpga_Status_ResourceNotFound_MESSAGE;
+    case NiFpga_Status_ResourceNotInitialized:
+      return NiFpga_Status_ResourceNotInitialized_MESSAGE;
+    case NiFpga_Status_HardwareFault:
+      return NiFpga_Status_HardwareFault_MESSAGE;
+    case NiFpga_Status_IrqTimeout:
+      return NiFpga_Status_IrqTimeout_MESSAGE;
+    case SAMPLE_RATE_TOO_HIGH:
+      return SAMPLE_RATE_TOO_HIGH_MESSAGE;
+    case VOLTAGE_OUT_OF_RANGE:
+      return VOLTAGE_OUT_OF_RANGE_MESSAGE;
+    case LOOP_TIMING_ERROR:
+      return LOOP_TIMING_ERROR_MESSAGE;
+    case SPI_WRITE_NO_MOSI:
+      return SPI_WRITE_NO_MOSI_MESSAGE;
+    case SPI_READ_NO_MISO:
+      return SPI_READ_NO_MISO_MESSAGE;
+    case SPI_READ_NO_DATA:
+      return SPI_READ_NO_DATA_MESSAGE;
+    case INCOMPATIBLE_STATE:
+      return INCOMPATIBLE_STATE_MESSAGE;
+    case NO_AVAILABLE_RESOURCES:
+      return NO_AVAILABLE_RESOURCES_MESSAGE;
+    case RESOURCE_IS_ALLOCATED:
+      return RESOURCE_IS_ALLOCATED_MESSAGE;
+    case RESOURCE_OUT_OF_RANGE:
+      return RESOURCE_OUT_OF_RANGE_MESSAGE;
+    case HAL_INVALID_ACCUMULATOR_CHANNEL:
+      return HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE;
+    case HAL_HANDLE_ERROR:
+      return HAL_HANDLE_ERROR_MESSAGE;
+    case NULL_PARAMETER:
+      return NULL_PARAMETER_MESSAGE;
+    case ANALOG_TRIGGER_LIMIT_ORDER_ERROR:
+      return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE;
+    case ANALOG_TRIGGER_PULSE_OUTPUT_ERROR:
+      return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE;
+    case PARAMETER_OUT_OF_RANGE:
+      return PARAMETER_OUT_OF_RANGE_MESSAGE;
+    case HAL_COUNTER_NOT_SUPPORTED:
+      return HAL_COUNTER_NOT_SUPPORTED_MESSAGE;
+    case HAL_ERR_CANSessionMux_InvalidBuffer:
+      return ERR_CANSessionMux_InvalidBuffer_MESSAGE;
+    case HAL_ERR_CANSessionMux_MessageNotFound:
+      return ERR_CANSessionMux_MessageNotFound_MESSAGE;
+    case HAL_WARN_CANSessionMux_NoToken:
+      return WARN_CANSessionMux_NoToken_MESSAGE;
+    case HAL_ERR_CANSessionMux_NotAllowed:
+      return ERR_CANSessionMux_NotAllowed_MESSAGE;
+    case HAL_ERR_CANSessionMux_NotInitialized:
+      return ERR_CANSessionMux_NotInitialized_MESSAGE;
+    case VI_ERROR_SYSTEM_ERROR:
+      return VI_ERROR_SYSTEM_ERROR_MESSAGE;
+    case VI_ERROR_INV_OBJECT:
+      return VI_ERROR_INV_OBJECT_MESSAGE;
+    case VI_ERROR_RSRC_LOCKED:
+      return VI_ERROR_RSRC_LOCKED_MESSAGE;
+    case VI_ERROR_RSRC_NFOUND:
+      return VI_ERROR_RSRC_NFOUND_MESSAGE;
+    case VI_ERROR_INV_RSRC_NAME:
+      return VI_ERROR_INV_RSRC_NAME_MESSAGE;
+    case VI_ERROR_QUEUE_OVERFLOW:
+      return VI_ERROR_QUEUE_OVERFLOW_MESSAGE;
+    case VI_ERROR_IO:
+      return VI_ERROR_IO_MESSAGE;
+    case VI_ERROR_ASRL_PARITY:
+      return VI_ERROR_ASRL_PARITY_MESSAGE;
+    case VI_ERROR_ASRL_FRAMING:
+      return VI_ERROR_ASRL_FRAMING_MESSAGE;
+    case VI_ERROR_ASRL_OVERRUN:
+      return VI_ERROR_ASRL_OVERRUN_MESSAGE;
+    case VI_ERROR_RSRC_BUSY:
+      return VI_ERROR_RSRC_BUSY_MESSAGE;
+    case VI_ERROR_INV_PARAMETER:
+      return VI_ERROR_INV_PARAMETER_MESSAGE;
+    case HAL_PWM_SCALE_ERROR:
+      return HAL_PWM_SCALE_ERROR_MESSAGE;
+    case HAL_SERIAL_PORT_NOT_FOUND:
+      return HAL_SERIAL_PORT_NOT_FOUND_MESSAGE;
+    case HAL_THREAD_PRIORITY_ERROR:
+      return HAL_THREAD_PRIORITY_ERROR_MESSAGE;
+    case HAL_THREAD_PRIORITY_RANGE_ERROR:
+      return HAL_THREAD_PRIORITY_RANGE_ERROR_MESSAGE;
+    case HAL_SERIAL_PORT_OPEN_ERROR:
+      return HAL_SERIAL_PORT_OPEN_ERROR_MESSAGE;
+    case HAL_SERIAL_PORT_ERROR:
+      return HAL_SERIAL_PORT_ERROR_MESSAGE;
+    default:
+      return "Unknown error status";
+  }
+}
+
+/**
+ * Returns the runtime type of this HAL
+ */
+HAL_RuntimeType HAL_GetRuntimeType(void) { return HAL_Athena; }
+
+/**
+ * Return the FPGA Version number.
+ * For now, expect this to be competition year.
+ * @return FPGA Version number.
+ */
+int32_t HAL_GetFPGAVersion(int32_t* status) {
+  if (!global) {
+    *status = NiFpga_Status_ResourceNotInitialized;
+    return 0;
+  }
+  return global->readVersion(status);
+}
+
+/**
+ * Return the FPGA Revision number.
+ * The format of the revision is 3 numbers.
+ * The 12 most significant bits are the Major Revision.
+ * the next 8 bits are the Minor Revision.
+ * The 12 least significant bits are the Build Number.
+ * @return FPGA Revision number.
+ */
+int64_t HAL_GetFPGARevision(int32_t* status) {
+  if (!global) {
+    *status = NiFpga_Status_ResourceNotInitialized;
+    return 0;
+  }
+  return global->readRevision(status);
+}
+
+/**
+ * Read the microsecond-resolution timer on the FPGA.
+ *
+ * @return The current time in microseconds according to the FPGA (since FPGA
+ * reset).
+ */
+uint64_t HAL_GetFPGATime(int32_t* status) {
+  if (!global) {
+    *status = NiFpga_Status_ResourceNotInitialized;
+    return 0;
+  }
+
+  uint64_t upper1 = global->readLocalTimeUpper(status);
+  uint32_t lower = global->readLocalTime(status);
+  uint64_t upper2 = global->readLocalTimeUpper(status);
+  if (*status != 0) return 0;
+  if (upper1 != upper2) {
+    // Rolled over between the lower call, reread lower
+    lower = global->readLocalTime(status);
+    if (*status != 0) return 0;
+  }
+  return (upper2 << 32) + lower;
+}
+
+/**
+ * Get the state of the "USER" button on the roboRIO
+ * @return true if the button is currently pressed down
+ */
+HAL_Bool HAL_GetFPGAButton(int32_t* status) {
+  if (!global) {
+    *status = NiFpga_Status_ResourceNotInitialized;
+    return false;
+  }
+  return global->readUserButton(status);
+}
+
+HAL_Bool HAL_GetSystemActive(int32_t* status) {
+  if (!watchdog) {
+    *status = NiFpga_Status_ResourceNotInitialized;
+    return false;
+  }
+  return watchdog->readStatus_SystemActive(status);
+}
+
+HAL_Bool HAL_GetBrownedOut(int32_t* status) {
+  if (!watchdog) {
+    *status = NiFpga_Status_ResourceNotInitialized;
+    return false;
+  }
+  return !(watchdog->readStatus_PowerAlive(status));
+}
+
+void HAL_BaseInitialize(int32_t* status) {
+  static std::atomic_bool initialized{false};
+  static wpi::mutex initializeMutex;
+  // Initial check, as if it's true initialization has finished
+  if (initialized) return;
+
+  std::lock_guard<wpi::mutex> lock(initializeMutex);
+  // Second check in case another thread was waiting
+  if (initialized) return;
+  // image 4; Fixes errors caused by multiple processes. Talk to NI about this
+  nFPGA::nRoboRIO_FPGANamespace::g_currentTargetClass =
+      nLoadOut::kTargetClass_RoboRIO;
+
+  global.reset(tGlobal::create(status));
+  watchdog.reset(tSysWatchdog::create(status));
+  initialized = true;
+}
+
+static bool killExistingProgram(int timeout, int mode) {
+  // Kill any previous robot programs
+  std::fstream fs;
+  // By making this both in/out, it won't give us an error if it doesnt exist
+  fs.open("/var/lock/frc.pid", std::fstream::in | std::fstream::out);
+  if (fs.bad()) return false;
+
+  pid_t pid = 0;
+  if (!fs.eof() && !fs.fail()) {
+    fs >> pid;
+    // see if the pid is around, but we don't want to mess with init id=1, or
+    // ourselves
+    if (pid >= 2 && kill(pid, 0) == 0 && pid != getpid()) {
+      llvm::outs() << "Killing previously running FRC program...\n";
+      kill(pid, SIGTERM);  // try to kill it
+      std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
+      if (kill(pid, 0) == 0) {
+        // still not successfull
+        if (mode == 0) {
+          llvm::outs() << "FRC pid " << pid << " did not die within " << timeout
+                       << "ms. Aborting\n";
+          return 0;              // just fail
+        } else if (mode == 1) {  // kill -9 it
+          kill(pid, SIGKILL);
+        } else {
+          llvm::outs() << "WARNING: FRC pid " << pid << " did not die within "
+                       << timeout << "ms.\n";
+        }
+      }
+    }
+  }
+  fs.close();
+  // we will re-open it write only to truncate the file
+  fs.open("/var/lock/frc.pid", std::fstream::out | std::fstream::trunc);
+  fs.seekp(0);
+  pid = getpid();
+  fs << pid << std::endl;
+  fs.close();
+  return true;
+}
+
+/**
+ * Call this to start up HAL. This is required for robot programs.
+ */
+HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
+  static std::atomic_bool initialized{false};
+  static wpi::mutex initializeMutex;
+  // Initial check, as if it's true initialization has finished
+  if (initialized) return true;
+
+  std::lock_guard<wpi::mutex> lock(initializeMutex);
+  // Second check in case another thread was waiting
+  if (initialized) return true;
+
+  hal::init::InitializeHAL();
+
+  setlinebuf(stdin);
+  setlinebuf(stdout);
+  llvm::outs().SetUnbuffered();
+
+  prctl(PR_SET_PDEATHSIG, SIGTERM);
+
+  // Return false if program failed to kill an existing program
+  if (!killExistingProgram(timeout, mode)) {
+    return false;
+  }
+
+  FRC_NetworkCommunication_Reserve(nullptr);
+
+  std::atexit([]() {
+    // Unregister our new data condition variable.
+    setNewDataSem(nullptr);
+  });
+
+  int32_t status = 0;
+  HAL_BaseInitialize(&status);
+  if (status != 0) return false;
+
+  HAL_InitializeDriverStation();
+
+  // Set WPI_Now to use FPGA timestamp
+  wpi::SetNowImpl([]() -> uint64_t {
+    int32_t status = 0;
+    uint64_t rv = HAL_GetFPGATime(&status);
+    if (status != 0) {
+      llvm::errs()
+          << "Call to HAL_GetFPGATime failed."
+          << "Initialization might have failed. Time will not be correct\n";
+      llvm::errs().flush();
+      return 0u;
+    }
+    return rv;
+  });
+
+  initialized = true;
+  return true;
+}
+
+int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context,
+                   const char* feature) {
+  if (feature == nullptr) {
+    feature = "";
+  }
+
+  return FRC_NetworkCommunication_nUsageReporting_report(
+      resource, instanceNumber, context, feature);
+}
+
+// TODO: HACKS
+// No need for header definitions, as we should not run from user code.
+void NumericArrayResize(void) {}
+void RTSetCleanupProc(void) {}
+void EDVR_CreateReference(void) {}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/HALInitializer.h b/third_party/allwpilib_2018/hal/src/main/native/athena/HALInitializer.h
new file mode 100644
index 0000000..9527097
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/HALInitializer.h
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace hal {
+namespace init {
+extern void InitializeAccelerometer();
+extern void InitializeAnalogAccumulator();
+extern void InitializeAnalogGyro();
+extern void InitializeAnalogInput();
+extern void InitializeAnalogInternal();
+extern void InitializeAnalogOutput();
+extern void InitializeAnalogTrigger();
+extern void InitializeCAN();
+extern void InitializeCompressor();
+extern void InitializeConstants();
+extern void InitializeCounter();
+extern void InitializeDigitalInternal();
+extern void InitializeDIO();
+extern void InitializeEncoder();
+extern void InitializeFPGAEncoder();
+extern void InitializeFRCDriverStation();
+extern void InitializeHAL();
+extern void InitializeI2C();
+extern void InitialzeInterrupts();
+extern void InitializeNotifier();
+extern void InitializeOSSerialPort();
+extern void InitializePCMInternal();
+extern void InitializePDP();
+extern void InitializePorts();
+extern void InitializePower();
+extern void InitializePWM();
+extern void InitializeRelay();
+extern void InitializeSerialPort();
+extern void InitializeSolenoid();
+extern void InitializeSPI();
+extern void InitializeThreads();
+extern void InitializeHandlesInternal();
+}  // namespace init
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/I2C.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/I2C.cpp
new file mode 100644
index 0000000..98c5776
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/I2C.cpp
@@ -0,0 +1,231 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/I2C.h"
+
+#include <fcntl.h>
+#include <linux/i2c-dev.h>
+#include <linux/i2c.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+#include <cstring>
+
+#include "DigitalInternal.h"
+#include "HAL/DIO.h"
+#include "HAL/HAL.h"
+
+using namespace hal;
+
+static wpi::mutex digitalI2COnBoardMutex;
+static wpi::mutex digitalI2CMXPMutex;
+
+static uint8_t i2COnboardObjCount{0};
+static uint8_t i2CMXPObjCount{0};
+static int i2COnBoardHandle{-1};
+static int i2CMXPHandle{-1};
+
+static HAL_DigitalHandle i2CMXPDigitalHandle1{HAL_kInvalidHandle};
+static HAL_DigitalHandle i2CMXPDigitalHandle2{HAL_kInvalidHandle};
+
+namespace hal {
+namespace init {
+void InitializeI2C() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/*
+ * Initialize the I2C port. Opens the port if necessary and saves the handle.
+ * If opening the MXP port, also sets up the channel functions appropriately
+ * @param port The port to open, 0 for the on-board, 1 for the MXP.
+ */
+void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) {
+  initializeDigital(status);
+  if (*status != 0) return;
+
+  if (port > 1) {
+    // Set port out of range error here
+    return;
+  }
+
+  if (port == 0) {
+    std::lock_guard<wpi::mutex> lock(digitalI2COnBoardMutex);
+    i2COnboardObjCount++;
+    if (i2COnboardObjCount > 1) return;
+    int handle = open("/dev/i2c-2", O_RDWR);
+    if (handle < 0) {
+      std::printf("Failed to open onboard i2c bus: %s\n", std::strerror(errno));
+      return;
+    }
+    i2COnBoardHandle = handle;
+  } else {
+    std::lock_guard<wpi::mutex> lock(digitalI2CMXPMutex);
+    i2CMXPObjCount++;
+    if (i2CMXPObjCount > 1) return;
+    if ((i2CMXPDigitalHandle1 = HAL_InitializeDIOPort(
+             HAL_GetPort(24), false, status)) == HAL_kInvalidHandle) {
+      return;
+    }
+    if ((i2CMXPDigitalHandle2 = HAL_InitializeDIOPort(
+             HAL_GetPort(25), false, status)) == HAL_kInvalidHandle) {
+      HAL_FreeDIOPort(i2CMXPDigitalHandle1);  // free the first port allocated
+      return;
+    }
+    digitalSystem->writeEnableMXPSpecialFunction(
+        digitalSystem->readEnableMXPSpecialFunction(status) | 0xC000, status);
+    int handle = open("/dev/i2c-1", O_RDWR);
+    if (handle < 0) {
+      std::printf("Failed to open MXP i2c bus: %s\n", std::strerror(errno));
+      return;
+    }
+    i2CMXPHandle = handle;
+  }
+}
+
+/**
+ * Generic transaction.
+ *
+ * This is a lower-level interface to the I2C hardware giving you more control
+ * over each transaction.
+ *
+ * @param dataToSend Buffer of data to send as part of the transaction.
+ * @param sendSize Number of bytes to send as part of the transaction.
+ * @param dataReceived Buffer to read data into.
+ * @param receiveSize Number of bytes to read from the device.
+ * @return >= 0 on success or -1 on transfer abort.
+ */
+int32_t HAL_TransactionI2C(HAL_I2CPort port, int32_t deviceAddress,
+                           const uint8_t* dataToSend, int32_t sendSize,
+                           uint8_t* dataReceived, int32_t receiveSize) {
+  if (port > 1) {
+    // Set port out of range error here
+    return -1;
+  }
+
+  struct i2c_msg msgs[2];
+  msgs[0].addr = deviceAddress;
+  msgs[0].flags = 0;
+  msgs[0].len = sendSize;
+  msgs[0].buf = const_cast<uint8_t*>(dataToSend);
+  msgs[1].addr = deviceAddress;
+  msgs[1].flags = I2C_M_RD;
+  msgs[1].len = receiveSize;
+  msgs[1].buf = dataReceived;
+
+  struct i2c_rdwr_ioctl_data rdwr;
+  rdwr.msgs = msgs;
+  rdwr.nmsgs = 2;
+
+  if (port == 0) {
+    std::lock_guard<wpi::mutex> lock(digitalI2COnBoardMutex);
+    return ioctl(i2COnBoardHandle, I2C_RDWR, &rdwr);
+  } else {
+    std::lock_guard<wpi::mutex> lock(digitalI2CMXPMutex);
+    return ioctl(i2CMXPHandle, I2C_RDWR, &rdwr);
+  }
+}
+
+/**
+ * Execute a write transaction with the device.
+ *
+ * Write a single byte to a register on a device and wait until the
+ *   transaction is complete.
+ *
+ * @param registerAddress The address of the register on the device to be
+ * written.
+ * @param data The byte to write to the register on the device.
+ * @return >= 0 on success or -1 on transfer abort.
+ */
+int32_t HAL_WriteI2C(HAL_I2CPort port, int32_t deviceAddress,
+                     const uint8_t* dataToSend, int32_t sendSize) {
+  if (port > 1) {
+    // Set port out of range error here
+    return -1;
+  }
+
+  struct i2c_msg msg;
+  msg.addr = deviceAddress;
+  msg.flags = 0;
+  msg.len = sendSize;
+  msg.buf = const_cast<uint8_t*>(dataToSend);
+
+  struct i2c_rdwr_ioctl_data rdwr;
+  rdwr.msgs = &msg;
+  rdwr.nmsgs = 1;
+
+  if (port == 0) {
+    std::lock_guard<wpi::mutex> lock(digitalI2COnBoardMutex);
+    return ioctl(i2COnBoardHandle, I2C_RDWR, &rdwr);
+  } else {
+    std::lock_guard<wpi::mutex> lock(digitalI2CMXPMutex);
+    return ioctl(i2CMXPHandle, I2C_RDWR, &rdwr);
+  }
+}
+
+/**
+ * Execute a read transaction with the device.
+ *
+ * Read bytes from a device.
+ * Most I2C devices will auto-increment the register pointer internally allowing
+ *   you to read consecutive registers on a device in a single transaction.
+ *
+ * @param registerAddress The register to read first in the transaction.
+ * @param count The number of bytes to read in the transaction.
+ * @param buffer A pointer to the array of bytes to store the data read from the
+ * device.
+ * @return >= 0 on success or -1 on transfer abort.
+ */
+int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer,
+                    int32_t count) {
+  if (port > 1) {
+    // Set port out of range error here
+    return -1;
+  }
+
+  struct i2c_msg msg;
+  msg.addr = deviceAddress;
+  msg.flags = I2C_M_RD;
+  msg.len = count;
+  msg.buf = buffer;
+
+  struct i2c_rdwr_ioctl_data rdwr;
+  rdwr.msgs = &msg;
+  rdwr.nmsgs = 1;
+
+  if (port == 0) {
+    std::lock_guard<wpi::mutex> lock(digitalI2COnBoardMutex);
+    return ioctl(i2COnBoardHandle, I2C_RDWR, &rdwr);
+  } else {
+    std::lock_guard<wpi::mutex> lock(digitalI2CMXPMutex);
+    return ioctl(i2CMXPHandle, I2C_RDWR, &rdwr);
+  }
+}
+
+void HAL_CloseI2C(HAL_I2CPort port) {
+  if (port > 1) {
+    // Set port out of range error here
+    return;
+  }
+
+  if (port == 0) {
+    std::lock_guard<wpi::mutex> lock(digitalI2COnBoardMutex);
+    if (i2COnboardObjCount-- == 0) {
+      close(i2COnBoardHandle);
+    }
+  } else {
+    std::lock_guard<wpi::mutex> lock(digitalI2CMXPMutex);
+    if (i2CMXPObjCount-- == 0) {
+      close(i2CMXPHandle);
+    }
+    HAL_FreeDIOPort(i2CMXPDigitalHandle1);
+    HAL_FreeDIOPort(i2CMXPDigitalHandle2);
+  }
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Interrupts.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Interrupts.cpp
new file mode 100644
index 0000000..afc6ec0
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Interrupts.cpp
@@ -0,0 +1,270 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Interrupts.h"
+
+#include <memory>
+
+#include <support/SafeThread.h>
+
+#include "DigitalInternal.h"
+#include "HAL/ChipObject.h"
+#include "HAL/Errors.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+
+struct Interrupt {
+  std::unique_ptr<tInterrupt> anInterrupt;
+  std::unique_ptr<tInterruptManager> manager;
+};
+
+// Safe thread to allow callbacks to run on their own thread
+class InterruptThread : public wpi::SafeThread {
+ public:
+  void Main() {
+    std::unique_lock<wpi::mutex> lock(m_mutex);
+    while (m_active) {
+      m_cond.wait(lock, [&] { return !m_active || m_notify; });
+      if (!m_active) break;
+      m_notify = false;
+      HAL_InterruptHandlerFunction handler = m_handler;
+      uint32_t mask = m_mask;
+      void* param = m_param;
+      lock.unlock();  // don't hold mutex during callback execution
+      handler(mask, param);
+      lock.lock();
+    }
+  }
+
+  bool m_notify = false;
+  HAL_InterruptHandlerFunction m_handler;
+  void* m_param;
+  uint32_t m_mask;
+};
+
+class InterruptThreadOwner : public wpi::SafeThreadOwner<InterruptThread> {
+ public:
+  void SetFunc(HAL_InterruptHandlerFunction handler, void* param) {
+    auto thr = GetThread();
+    if (!thr) return;
+    thr->m_handler = handler;
+    thr->m_param = param;
+  }
+
+  void Notify(uint32_t mask) {
+    auto thr = GetThread();
+    if (!thr) return;
+    thr->m_mask = mask;
+    thr->m_notify = true;
+    thr->m_cond.notify_one();
+  }
+};
+
+}  // namespace
+
+static void threadedInterruptHandler(uint32_t mask, void* param) {
+  static_cast<InterruptThreadOwner*>(param)->Notify(mask);
+}
+
+static LimitedHandleResource<HAL_InterruptHandle, Interrupt, kNumInterrupts,
+                             HAL_HandleEnum::Interrupt>* interruptHandles;
+
+namespace hal {
+namespace init {
+void InitialzeInterrupts() {
+  static LimitedHandleResource<HAL_InterruptHandle, Interrupt, kNumInterrupts,
+                               HAL_HandleEnum::Interrupt>
+      iH;
+  interruptHandles = &iH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher,
+                                             int32_t* status) {
+  HAL_InterruptHandle handle = interruptHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto anInterrupt = interruptHandles->Get(handle);
+  uint32_t interruptIndex = static_cast<uint32_t>(getHandleIndex(handle));
+  // Expects the calling leaf class to allocate an interrupt index.
+  anInterrupt->anInterrupt.reset(tInterrupt::create(interruptIndex, status));
+  anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status);
+  anInterrupt->manager = std::make_unique<tInterruptManager>(
+      (1u << interruptIndex) | (1u << (interruptIndex + 8u)), watcher, status);
+  return handle;
+}
+
+void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status) {
+  interruptHandles->Free(interruptHandle);
+}
+
+/**
+ * In synchronous mode, wait for the defined interrupt to occur.
+ * @param timeout Timeout in seconds
+ * @param ignorePrevious If true, ignore interrupts that happened before
+ * waitForInterrupt was called.
+ * @return The mask of interrupts that fired.
+ */
+int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
+                             double timeout, HAL_Bool ignorePrevious,
+                             int32_t* status) {
+  uint32_t result;
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  result = anInterrupt->manager->watch(static_cast<int32_t>(timeout * 1e3),
+                                       ignorePrevious, status);
+
+  // Don't report a timeout as an error - the return code is enough to tell
+  // that a timeout happened.
+  if (*status == -NiFpga_Status_IrqTimeout) {
+    *status = NiFpga_Status_Success;
+  }
+
+  return result;
+}
+
+/**
+ * Enable interrupts to occur on this input.
+ * Interrupts are disabled when the RequestInterrupt call is made. This gives
+ * time to do the setup of the other options before starting to field
+ * interrupts.
+ */
+void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle,
+                          int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  anInterrupt->manager->enable(status);
+}
+
+/**
+ * Disable Interrupts without without deallocating structures.
+ */
+void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
+                           int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  anInterrupt->manager->disable(status);
+}
+
+/**
+ * Return the timestamp for the rising interrupt that occurred most recently.
+ * This is in the same time domain as GetClock().
+ * @return Timestamp in seconds since boot.
+ */
+double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
+                                        int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  uint32_t timestamp = anInterrupt->anInterrupt->readRisingTimeStamp(status);
+  return timestamp * 1e-6;
+}
+
+/**
+ * Return the timestamp for the falling interrupt that occurred most recently.
+ * This is in the same time domain as GetClock().
+ * @return Timestamp in seconds since boot.
+ */
+double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
+                                         int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  uint32_t timestamp = anInterrupt->anInterrupt->readFallingTimeStamp(status);
+  return timestamp * 1e-6;
+}
+
+void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
+                           HAL_Handle digitalSourceHandle,
+                           HAL_AnalogTriggerType analogTriggerType,
+                           int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status);
+  bool routingAnalogTrigger = false;
+  uint8_t routingChannel = 0;
+  uint8_t routingModule = 0;
+  bool success =
+      remapDigitalSource(digitalSourceHandle, analogTriggerType, routingChannel,
+                         routingModule, routingAnalogTrigger);
+  if (!success) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  anInterrupt->anInterrupt->writeConfig_Source_AnalogTrigger(
+      routingAnalogTrigger, status);
+  anInterrupt->anInterrupt->writeConfig_Source_Channel(routingChannel, status);
+  anInterrupt->anInterrupt->writeConfig_Source_Module(routingModule, status);
+}
+
+void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
+                                HAL_InterruptHandlerFunction handler,
+                                void* param, int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  anInterrupt->manager->registerHandler(handler, param, status);
+}
+
+void HAL_AttachInterruptHandlerThreaded(HAL_InterruptHandle interrupt_handle,
+                                        HAL_InterruptHandlerFunction handler,
+                                        void* param, int32_t* status) {
+  InterruptThreadOwner* intr = new InterruptThreadOwner;
+  intr->Start();
+  intr->SetFunc(handler, param);
+
+  HAL_AttachInterruptHandler(interrupt_handle, threadedInterruptHandler, intr,
+                             status);
+
+  if (*status != 0) {
+    delete intr;
+  }
+}
+
+void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
+                                  HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                  int32_t* status) {
+  auto anInterrupt = interruptHandles->Get(interruptHandle);
+  if (anInterrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  anInterrupt->anInterrupt->writeConfig_RisingEdge(risingEdge, status);
+  anInterrupt->anInterrupt->writeConfig_FallingEdge(fallingEdge, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Notifier.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Notifier.cpp
new file mode 100644
index 0000000..10aa0d2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Notifier.cpp
@@ -0,0 +1,228 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Notifier.h"
+
+#include <atomic>
+#include <cstdlib>  // For std::atexit()
+#include <memory>
+
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+#include "HAL/ChipObject.h"
+#include "HAL/Errors.h"
+#include "HAL/HAL.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/UnlimitedHandleResource.h"
+
+using namespace hal;
+
+static constexpr int32_t kTimerInterruptNumber = 28;
+
+static wpi::mutex notifierMutex;
+static std::unique_ptr<tAlarm> notifierAlarm;
+static std::unique_ptr<tInterruptManager> notifierManager;
+static uint64_t closestTrigger{UINT64_MAX};
+
+namespace {
+
+struct Notifier {
+  uint64_t triggerTime = UINT64_MAX;
+  uint64_t triggeredTime = UINT64_MAX;
+  bool active = true;
+  wpi::mutex mutex;
+  wpi::condition_variable cond;
+};
+
+}  // namespace
+
+static std::atomic_flag notifierAtexitRegistered{ATOMIC_FLAG_INIT};
+static std::atomic_int notifierRefCount{0};
+
+using namespace hal;
+
+class NotifierHandleContainer
+    : public UnlimitedHandleResource<HAL_NotifierHandle, Notifier,
+                                     HAL_HandleEnum::Notifier> {
+ public:
+  ~NotifierHandleContainer() {
+    ForEach([](HAL_NotifierHandle handle, Notifier* notifier) {
+      {
+        std::lock_guard<wpi::mutex> lock(notifier->mutex);
+        notifier->triggerTime = UINT64_MAX;
+        notifier->triggeredTime = 0;
+        notifier->active = false;
+      }
+      notifier->cond.notify_all();  // wake up any waiting threads
+    });
+  }
+};
+
+static NotifierHandleContainer* notifierHandles;
+
+static void alarmCallback(uint32_t, void*) {
+  std::lock_guard<wpi::mutex> lock(notifierMutex);
+  int32_t status = 0;
+  uint64_t currentTime = 0;
+
+  // the hardware disables itself after each alarm
+  closestTrigger = UINT64_MAX;
+
+  // process all notifiers
+  notifierHandles->ForEach([&](HAL_NotifierHandle handle, Notifier* notifier) {
+    if (notifier->triggerTime == UINT64_MAX) return;
+    if (currentTime == 0) currentTime = HAL_GetFPGATime(&status);
+    std::unique_lock<wpi::mutex> lock(notifier->mutex);
+    if (notifier->triggerTime < currentTime) {
+      notifier->triggerTime = UINT64_MAX;
+      notifier->triggeredTime = currentTime;
+      lock.unlock();
+      notifier->cond.notify_all();
+    } else if (notifier->triggerTime < closestTrigger) {
+      closestTrigger = notifier->triggerTime;
+    }
+  });
+
+  if (notifierAlarm && closestTrigger != UINT64_MAX) {
+    // Simply truncate the hardware trigger time to 32-bit.
+    notifierAlarm->writeTriggerTime(static_cast<uint32_t>(closestTrigger),
+                                    &status);
+    // Enable the alarm.  The hardware disables itself after each alarm.
+    notifierAlarm->writeEnable(true, &status);
+  }
+}
+
+static void cleanupNotifierAtExit() {
+  notifierAlarm = nullptr;
+  notifierManager = nullptr;
+}
+
+namespace hal {
+namespace init {
+void InitializeNotifier() {
+  static NotifierHandleContainer nH;
+  notifierHandles = &nH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_NotifierHandle HAL_InitializeNotifier(int32_t* status) {
+  if (!notifierAtexitRegistered.test_and_set())
+    std::atexit(cleanupNotifierAtExit);
+
+  if (notifierRefCount.fetch_add(1) == 0) {
+    std::lock_guard<wpi::mutex> lock(notifierMutex);
+    // create manager and alarm if not already created
+    if (!notifierManager) {
+      notifierManager = std::make_unique<tInterruptManager>(
+          1 << kTimerInterruptNumber, false, status);
+      notifierManager->registerHandler(alarmCallback, nullptr, status);
+      notifierManager->enable(status);
+    }
+    if (!notifierAlarm) notifierAlarm.reset(tAlarm::create(status));
+  }
+
+  std::shared_ptr<Notifier> notifier = std::make_shared<Notifier>();
+  HAL_NotifierHandle handle = notifierHandles->Allocate(notifier);
+  if (handle == HAL_kInvalidHandle) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  return handle;
+}
+
+void HAL_StopNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return;
+
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->triggerTime = UINT64_MAX;
+    notifier->triggeredTime = 0;
+    notifier->active = false;
+  }
+  notifier->cond.notify_all();  // wake up any waiting threads
+}
+
+void HAL_CleanNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
+  auto notifier = notifierHandles->Free(notifierHandle);
+  if (!notifier) return;
+
+  // Just in case HAL_StopNotifier() wasn't called...
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->triggerTime = UINT64_MAX;
+    notifier->triggeredTime = 0;
+    notifier->active = false;
+  }
+  notifier->cond.notify_all();
+
+  if (notifierRefCount.fetch_sub(1) == 1) {
+    // if this was the last notifier, clean up alarm and manager
+    // the notifier can call back into our callback, so don't hold the lock
+    // here (the atomic fetch_sub will prevent multiple parallel entries
+    // into this function)
+    if (notifierAlarm) notifierAlarm->writeEnable(false, status);
+    if (notifierManager) notifierManager->disable(status);
+
+    std::lock_guard<wpi::mutex> lock(notifierMutex);
+    notifierAlarm = nullptr;
+    notifierManager = nullptr;
+    closestTrigger = UINT64_MAX;
+  }
+}
+
+void HAL_UpdateNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                             uint64_t triggerTime, int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return;
+
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->triggerTime = triggerTime;
+    notifier->triggeredTime = UINT64_MAX;
+  }
+
+  std::lock_guard<wpi::mutex> lock(notifierMutex);
+  // Update alarm time if closer than current.
+  if (triggerTime < closestTrigger) {
+    bool wasActive = (closestTrigger != UINT64_MAX);
+    closestTrigger = triggerTime;
+    // Simply truncate the hardware trigger time to 32-bit.
+    notifierAlarm->writeTriggerTime(static_cast<uint32_t>(closestTrigger),
+                                    status);
+    // Enable the alarm.
+    if (!wasActive) notifierAlarm->writeEnable(true, status);
+  }
+}
+
+void HAL_CancelNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                             int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return;
+
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->triggerTime = UINT64_MAX;
+  }
+}
+
+uint64_t HAL_WaitForNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                                  int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return 0;
+  std::unique_lock<wpi::mutex> lock(notifier->mutex);
+  notifier->cond.wait(lock, [&] {
+    return !notifier->active || notifier->triggeredTime != UINT64_MAX;
+  });
+  return notifier->active ? notifier->triggeredTime : 0;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/OSSerialPort.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/OSSerialPort.cpp
new file mode 100644
index 0000000..ccb49fd
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/OSSerialPort.cpp
@@ -0,0 +1,244 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/OSSerialPort.h"
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <unistd.h>
+
+#include <chrono>
+#include <cstring>
+#include <string>
+
+#include "HAL/Errors.h"
+#include "HAL/cpp/SerialHelper.h"
+
+static int portHandles[4]{-1, -1, -1, -1};
+static std::chrono::milliseconds portTimeouts[4]{
+    std::chrono::milliseconds(0), std::chrono::milliseconds(0),
+    std::chrono::milliseconds(0), std::chrono::milliseconds(0)};
+
+namespace hal {
+namespace init {
+void InitializeOSSerialPort() {
+  for (int i = 0; i < 4; i++) {
+    portHandles[i] = -1;
+    portTimeouts[i] = std::chrono::milliseconds(0);
+  }
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+void HAL_InitializeOSSerialPort(HAL_SerialPort port, int32_t* status) {
+  std::string portName;
+
+  hal::SerialHelper serialHelper;
+
+  portName = serialHelper.GetOSSerialPortName(port, status);
+
+  if (*status < 0) {
+    return;
+  }
+
+  int fs = open(portName.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
+  if (fs == -1) {
+    *status = HAL_SERIAL_PORT_OPEN_ERROR;
+    return;
+  }
+  portHandles[port] = fs;
+
+  struct termios options;
+  tcgetattr(fs, &options);
+  options.c_cflag = B9600 | CS8 | CLOCAL | CREAD;
+  options.c_iflag = 0;
+  options.c_oflag = 0;
+  options.c_lflag = 0;
+  tcflush(fs, TCIFLUSH);
+  tcsetattr(fs, TCSANOW, &options);
+}
+
+void HAL_SetOSSerialBaudRate(HAL_SerialPort port, int32_t baud,
+                             int32_t* status) {
+  int baudRate = -1;
+  switch (baud) {
+    case 9600:
+      baudRate = B9600;
+      break;
+    case 19200:
+      baudRate = B19200;
+      break;
+    case 38400:
+      baudRate = B38400;
+      break;
+    case 57600:
+      baudRate = B57600;
+      break;
+    case 115200:
+      baudRate = B115200;
+      break;
+    default:
+      *status = PARAMETER_OUT_OF_RANGE;
+      return;
+  }
+
+  struct termios options;
+  tcgetattr(portHandles[port], &options);
+  auto set = cfsetospeed(&options, baudRate);
+  if (set != 0) {
+    *status = HAL_SERIAL_PORT_ERROR;
+    return;
+  }
+  set = tcsetattr(portHandles[port], TCSANOW, &options);
+  if (set != 0) {
+    *status = HAL_SERIAL_PORT_ERROR;
+    return;
+  }
+}
+
+void HAL_SetOSSerialDataBits(HAL_SerialPort port, int32_t bits,
+                             int32_t* status) {
+  int numBits = -1;
+  switch (bits) {
+    case 5:
+      numBits = CS5;
+      break;
+    case 6:
+      numBits = CS6;
+      break;
+    case 7:
+      numBits = CS7;
+      break;
+    case 8:
+      numBits = CS8;
+      break;
+    default:
+      *status = PARAMETER_OUT_OF_RANGE;
+      return;
+  }
+
+  struct termios options;
+  tcgetattr(portHandles[port], &options);
+  options.c_cflag &= ~CSIZE;
+  options.c_cflag |= numBits;
+  auto set = tcsetattr(portHandles[port], TCSANOW, &options);
+  if (set != 0) {
+    *status = HAL_SERIAL_PORT_ERROR;
+    return;
+  }
+}
+
+void HAL_SetOSSerialParity(HAL_SerialPort port, int32_t parity,
+                           int32_t* status) {
+  // Just set none parity
+  struct termios options;
+  tcgetattr(portHandles[port], &options);
+  options.c_cflag &= ~PARENB;
+  auto set = tcsetattr(portHandles[port], TCSANOW, &options);
+  if (set != 0) {
+    *status = HAL_SERIAL_PORT_ERROR;
+    return;
+  }
+}
+
+void HAL_SetOSSerialStopBits(HAL_SerialPort port, int32_t stopBits,
+                             int32_t* status) {
+  // Force 1 stop bit
+  struct termios options;
+  tcgetattr(portHandles[port], &options);
+  options.c_cflag &= ~CSTOPB;
+  auto set = tcsetattr(portHandles[port], TCSANOW, &options);
+  if (set != 0) {
+    *status = HAL_SERIAL_PORT_ERROR;
+    return;
+  }
+}
+
+void HAL_SetOSSerialWriteMode(HAL_SerialPort port, int32_t mode,
+                              int32_t* status) {
+  // No op
+}
+
+void HAL_SetOSSerialFlowControl(HAL_SerialPort port, int32_t flow,
+                                int32_t* status) {
+  // No op
+}
+
+void HAL_SetOSSerialTimeout(HAL_SerialPort port, double timeout,
+                            int32_t* status) {
+  // Convert to millis
+  int t = timeout / 1000;
+  portTimeouts[port] = std::chrono::milliseconds(t);
+}
+
+void HAL_EnableOSSerialTermination(HAL_SerialPort port, char terminator,
+                                   int32_t* status) {
+  // \n is hardcoded for now. Will fix later
+  // Seems like a VISA only setting, need to check
+}
+
+void HAL_DisableOSSerialTermination(HAL_SerialPort port, int32_t* status) {
+  // Seems like a VISA only setting, need to check
+}
+
+void HAL_SetOSSerialReadBufferSize(HAL_SerialPort port, int32_t size,
+                                   int32_t* status) {
+  // No op
+}
+
+void HAL_SetOSSerialWriteBufferSize(HAL_SerialPort port, int32_t size,
+                                    int32_t* status) {
+  // No op
+}
+
+int32_t HAL_GetOSSerialBytesReceived(HAL_SerialPort port, int32_t* status) {
+  int bytes = 0;
+  ioctl(portHandles[port], FIONREAD, &bytes);
+  return bytes;
+}
+
+int32_t HAL_ReadOSSerial(HAL_SerialPort port, char* buffer, int32_t count,
+                         int32_t* status) {
+  auto endTime = std::chrono::steady_clock::now() + portTimeouts[port];
+
+  int bytesRead = 0;
+
+  unsigned char buf[256];
+
+  do {
+    int rx = read(portHandles[port], buf, count - bytesRead);
+    std::memcpy(&buffer[bytesRead], buf, rx);
+    bytesRead += rx;
+    if (bytesRead >= count) break;
+    llvm::StringRef tmp(buffer, bytesRead);
+    auto loc = tmp.find('\n');
+    if (loc != llvm::StringRef::npos) {
+      bytesRead = loc;
+      break;
+    }
+  } while (std::chrono::steady_clock::now() < endTime);
+  return bytesRead;
+}
+
+int32_t HAL_WriteOSSerial(HAL_SerialPort port, const char* buffer,
+                          int32_t count, int32_t* status) {
+  return write(portHandles[port], buffer, count);
+}
+void HAL_FlushOSSerial(HAL_SerialPort port, int32_t* status) {
+  tcdrain(portHandles[port]);
+}
+void HAL_ClearOSSerial(HAL_SerialPort port, int32_t* status) {
+  tcflush(portHandles[port], TCIOFLUSH);
+}
+void HAL_CloseOSSerial(HAL_SerialPort port, int32_t* status) {
+  close(portHandles[port]);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/PCMInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/PCMInternal.cpp
new file mode 100644
index 0000000..eedc611
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/PCMInternal.cpp
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PCMInternal.h"
+
+#include "HAL/Errors.h"
+#include "HAL/Solenoid.h"
+#include "HAL/cpp/make_unique.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+std::unique_ptr<PCM> PCM_modules[kNumPCMModules];
+
+namespace init {
+void InitializePCMInternal() {
+  for (int i = 0; i < kNumPCMModules; i++) {
+    PCM_modules[i] = nullptr;
+  }
+}
+}  // namespace init
+
+void initializePCM(int32_t module, int32_t* status) {
+  if (!HAL_CheckSolenoidModule(module)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return;
+  }
+  if (!PCM_modules[module]) {
+    PCM_modules[module] = std::make_unique<PCM>(module);
+  }
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/PCMInternal.h b/third_party/allwpilib_2018/hal/src/main/native/athena/PCMInternal.h
new file mode 100644
index 0000000..bbd29de
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/PCMInternal.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "HAL/Errors.h"
+#include "HAL/Ports.h"
+#include "HAL/Solenoid.h"
+#include "PortsInternal.h"
+#include "ctre/PCM.h"
+
+namespace hal {
+
+extern std::unique_ptr<PCM> PCM_modules[kNumPCMModules];
+
+static inline bool checkPCMInit(int32_t module, int32_t* status) {
+  if (!HAL_CheckSolenoidModule(module)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return false;
+  }
+  if (!PCM_modules[module]) {
+    *status = INCOMPATIBLE_STATE;
+    return false;
+  }
+  return true;
+}
+
+void initializePCM(int32_t module, int32_t* status);
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/PDP.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/PDP.cpp
new file mode 100644
index 0000000..b0b0dd1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/PDP.cpp
@@ -0,0 +1,137 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/PDP.h"
+
+#include <memory>
+
+#include "HAL/Errors.h"
+#include "HAL/Ports.h"
+#include "HAL/cpp/make_unique.h"
+#include "PortsInternal.h"
+#include "ctre/PDP.h"
+
+using namespace hal;
+
+static std::unique_ptr<PDP> pdp[kNumPDPModules];
+
+static inline bool checkPDPInit(int32_t module, int32_t* status) {
+  if (!HAL_CheckPDPModule(module)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return false;
+  }
+  if (!pdp[module]) {
+    *status = INCOMPATIBLE_STATE;
+    return false;
+  }
+  return true;
+}
+
+namespace hal {
+namespace init {
+void InitializePDP() {
+  for (int i = 0; i < kNumPDPModules; i++) {
+    pdp[i] = nullptr;
+  }
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+void HAL_InitializePDP(int32_t module, int32_t* status) {
+  if (!HAL_CheckPDPModule(module)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return;
+  }
+  if (!pdp[module]) {
+    pdp[module] = std::make_unique<PDP>(module);
+  }
+}
+
+HAL_Bool HAL_CheckPDPModule(int32_t module) {
+  return module < kNumPDPModules && module >= 0;
+}
+
+HAL_Bool HAL_CheckPDPChannel(int32_t channel) {
+  return channel < kNumPDPChannels && channel >= 0;
+}
+
+double HAL_GetPDPTemperature(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return 0;
+
+  double temperature;
+
+  *status = pdp[module]->GetTemperature(temperature);
+
+  return temperature;
+}
+
+double HAL_GetPDPVoltage(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return 0;
+
+  double voltage;
+
+  *status = pdp[module]->GetVoltage(voltage);
+
+  return voltage;
+}
+
+double HAL_GetPDPChannelCurrent(int32_t module, int32_t channel,
+                                int32_t* status) {
+  if (!checkPDPInit(module, status)) return 0;
+
+  double current;
+
+  *status = pdp[module]->GetChannelCurrent(channel, current);
+
+  return current;
+}
+
+double HAL_GetPDPTotalCurrent(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return 0;
+
+  double current;
+
+  *status = pdp[module]->GetTotalCurrent(current);
+
+  return current;
+}
+
+double HAL_GetPDPTotalPower(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return 0;
+
+  double power;
+
+  *status = pdp[module]->GetTotalPower(power);
+
+  return power;
+}
+
+double HAL_GetPDPTotalEnergy(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return 0;
+
+  double energy;
+
+  *status = pdp[module]->GetTotalEnergy(energy);
+
+  return energy;
+}
+
+void HAL_ResetPDPTotalEnergy(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return;
+
+  *status = pdp[module]->ResetEnergy();
+}
+
+void HAL_ClearPDPStickyFaults(int32_t module, int32_t* status) {
+  if (!checkPDPInit(module, status)) return;
+
+  *status = pdp[module]->ClearStickyFaults();
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/PWM.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/PWM.cpp
new file mode 100644
index 0000000..05c58b4
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/PWM.cpp
@@ -0,0 +1,495 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/PWM.h"
+
+#include <cmath>
+
+#include "ConstantsInternal.h"
+#include "DigitalInternal.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+static inline int32_t GetMaxPositivePwm(DigitalPort* port) {
+  return port->maxPwm;
+}
+
+static inline int32_t GetMinPositivePwm(DigitalPort* port) {
+  if (port->eliminateDeadband) {
+    return port->deadbandMaxPwm;
+  } else {
+    return port->centerPwm + 1;
+  }
+}
+
+static inline int32_t GetCenterPwm(DigitalPort* port) {
+  return port->centerPwm;
+}
+
+static inline int32_t GetMaxNegativePwm(DigitalPort* port) {
+  if (port->eliminateDeadband) {
+    return port->deadbandMinPwm;
+  } else {
+    return port->centerPwm - 1;
+  }
+}
+
+static inline int32_t GetMinNegativePwm(DigitalPort* port) {
+  return port->minPwm;
+}
+
+static inline int32_t GetPositiveScaleFactor(DigitalPort* port) {
+  return GetMaxPositivePwm(port) - GetMinPositivePwm(port);
+}  ///< The scale for positive speeds.
+
+static inline int32_t GetNegativeScaleFactor(DigitalPort* port) {
+  return GetMaxNegativePwm(port) - GetMinNegativePwm(port);
+}  ///< The scale for negative speeds.
+
+static inline int32_t GetFullRangeScaleFactor(DigitalPort* port) {
+  return GetMaxPositivePwm(port) - GetMinNegativePwm(port);
+}  ///< The scale for positions.
+
+namespace hal {
+namespace init {
+void InitializePWM() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_DigitalHandle HAL_InitializePWMPort(HAL_PortHandle portHandle,
+                                        int32_t* status) {
+  initializeDigital(status);
+
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex || channel >= kNumPWMChannels) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  uint8_t origChannel = static_cast<uint8_t>(channel);
+
+  if (origChannel < kNumPWMHeaders) {
+    channel += kNumDigitalChannels;  // remap Headers to end of allocations
+  } else {
+    channel = remapMXPPWMChannel(channel) + 10;  // remap MXP to proper channel
+  }
+
+  auto handle =
+      digitalChannelHandles->Allocate(channel, HAL_HandleEnum::PWM, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = digitalChannelHandles->Get(handle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  port->channel = origChannel;
+
+  int32_t bitToSet = 1 << remapMXPPWMChannel(port->channel);
+  uint16_t specialFunctions =
+      digitalSystem->readEnableMXPSpecialFunction(status);
+  digitalSystem->writeEnableMXPSpecialFunction(specialFunctions | bitToSet,
+                                               status);
+
+  return handle;
+}
+void HAL_FreePWMPort(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  if (port->channel > tPWM::kNumHdrRegisters - 1) {
+    int32_t bitToUnset = 1 << remapMXPPWMChannel(port->channel);
+    uint16_t specialFunctions =
+        digitalSystem->readEnableMXPSpecialFunction(status);
+    digitalSystem->writeEnableMXPSpecialFunction(specialFunctions & ~bitToUnset,
+                                                 status);
+  }
+
+  digitalChannelHandles->Free(pwmPortHandle, HAL_HandleEnum::PWM);
+}
+
+HAL_Bool HAL_CheckPWMChannel(int32_t channel) {
+  return channel < kNumPWMChannels && channel >= 0;
+}
+
+void HAL_SetPWMConfig(HAL_DigitalHandle pwmPortHandle, double max,
+                      double deadbandMax, double center, double deadbandMin,
+                      double min, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  // calculate the loop time in milliseconds
+  double loopTime =
+      HAL_GetPWMLoopTiming(status) / (kSystemClockTicksPerMicrosecond * 1e3);
+  if (*status != 0) return;
+
+  int32_t maxPwm = static_cast<int32_t>((max - kDefaultPwmCenter) / loopTime +
+                                        kDefaultPwmStepsDown - 1);
+  int32_t deadbandMaxPwm = static_cast<int32_t>(
+      (deadbandMax - kDefaultPwmCenter) / loopTime + kDefaultPwmStepsDown - 1);
+  int32_t centerPwm = static_cast<int32_t>(
+      (center - kDefaultPwmCenter) / loopTime + kDefaultPwmStepsDown - 1);
+  int32_t deadbandMinPwm = static_cast<int32_t>(
+      (deadbandMin - kDefaultPwmCenter) / loopTime + kDefaultPwmStepsDown - 1);
+  int32_t minPwm = static_cast<int32_t>((min - kDefaultPwmCenter) / loopTime +
+                                        kDefaultPwmStepsDown - 1);
+
+  port->maxPwm = maxPwm;
+  port->deadbandMaxPwm = deadbandMaxPwm;
+  port->deadbandMinPwm = deadbandMinPwm;
+  port->centerPwm = centerPwm;
+  port->minPwm = minPwm;
+  port->configSet = true;
+}
+
+void HAL_SetPWMConfigRaw(HAL_DigitalHandle pwmPortHandle, int32_t maxPwm,
+                         int32_t deadbandMaxPwm, int32_t centerPwm,
+                         int32_t deadbandMinPwm, int32_t minPwm,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  port->maxPwm = maxPwm;
+  port->deadbandMaxPwm = deadbandMaxPwm;
+  port->deadbandMinPwm = deadbandMinPwm;
+  port->centerPwm = centerPwm;
+  port->minPwm = minPwm;
+}
+
+void HAL_GetPWMConfigRaw(HAL_DigitalHandle pwmPortHandle, int32_t* maxPwm,
+                         int32_t* deadbandMaxPwm, int32_t* centerPwm,
+                         int32_t* deadbandMinPwm, int32_t* minPwm,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  *maxPwm = port->maxPwm;
+  *deadbandMaxPwm = port->deadbandMaxPwm;
+  *deadbandMinPwm = port->deadbandMinPwm;
+  *centerPwm = port->centerPwm;
+  *minPwm = port->minPwm;
+}
+
+void HAL_SetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
+                                 HAL_Bool eliminateDeadband, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  port->eliminateDeadband = eliminateDeadband;
+}
+
+HAL_Bool HAL_GetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
+                                     int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return port->eliminateDeadband;
+}
+
+/**
+ * Set a PWM channel to the desired value. The values range from 0 to 255 and
+ * the period is controlled
+ * by the PWM Period and MinHigh registers.
+ *
+ * @param channel The PWM channel to set.
+ * @param value The PWM value to set.
+ */
+void HAL_SetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t value,
+                   int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  if (port->channel < tPWM::kNumHdrRegisters) {
+    pwmSystem->writeHdr(port->channel, value, status);
+  } else {
+    pwmSystem->writeMXP(port->channel - tPWM::kNumHdrRegisters, value, status);
+  }
+}
+
+/**
+ * Set a PWM channel to the desired scaled value. The values range from -1 to 1
+ * and
+ * the period is controlled
+ * by the PWM Period and MinHigh registers.
+ *
+ * @param channel The PWM channel to set.
+ * @param value The scaled PWM value to set.
+ */
+void HAL_SetPWMSpeed(HAL_DigitalHandle pwmPortHandle, double speed,
+                     int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  DigitalPort* dPort = port.get();
+
+  if (speed < -1.0) {
+    speed = -1.0;
+  } else if (speed > 1.0) {
+    speed = 1.0;
+  } else if (!std::isfinite(speed)) {
+    speed = 0.0;
+  }
+
+  // calculate the desired output pwm value by scaling the speed appropriately
+  int32_t rawValue;
+  if (speed == 0.0) {
+    rawValue = GetCenterPwm(dPort);
+  } else if (speed > 0.0) {
+    rawValue = static_cast<int32_t>(
+        speed * static_cast<double>(GetPositiveScaleFactor(dPort)) +
+        static_cast<double>(GetMinPositivePwm(dPort)) + 0.5);
+  } else {
+    rawValue = static_cast<int32_t>(
+        speed * static_cast<double>(GetNegativeScaleFactor(dPort)) +
+        static_cast<double>(GetMaxNegativePwm(dPort)) + 0.5);
+  }
+
+  if (!((rawValue >= GetMinNegativePwm(dPort)) &&
+        (rawValue <= GetMaxPositivePwm(dPort))) ||
+      rawValue == kPwmDisabled) {
+    *status = HAL_PWM_SCALE_ERROR;
+    return;
+  }
+
+  HAL_SetPWMRaw(pwmPortHandle, rawValue, status);
+}
+
+/**
+ * Set a PWM channel to the desired position value. The values range from 0 to 1
+ * and
+ * the period is controlled
+ * by the PWM Period and MinHigh registers.
+ *
+ * @param channel The PWM channel to set.
+ * @param value The scaled PWM value to set.
+ */
+void HAL_SetPWMPosition(HAL_DigitalHandle pwmPortHandle, double pos,
+                        int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+  DigitalPort* dPort = port.get();
+
+  if (pos < 0.0) {
+    pos = 0.0;
+  } else if (pos > 1.0) {
+    pos = 1.0;
+  }
+
+  // note, need to perform the multiplication below as floating point before
+  // converting to int
+  int32_t rawValue = static_cast<int32_t>(
+      (pos * static_cast<double>(GetFullRangeScaleFactor(dPort))) +
+      GetMinNegativePwm(dPort));
+
+  if (rawValue == kPwmDisabled) {
+    *status = HAL_PWM_SCALE_ERROR;
+    return;
+  }
+
+  HAL_SetPWMRaw(pwmPortHandle, rawValue, status);
+}
+
+void HAL_SetPWMDisabled(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  HAL_SetPWMRaw(pwmPortHandle, kPwmDisabled, status);
+}
+
+/**
+ * Get a value from a PWM channel. The values range from 0 to 255.
+ *
+ * @param channel The PWM channel to read from.
+ * @return The raw PWM value.
+ */
+int32_t HAL_GetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  if (port->channel < tPWM::kNumHdrRegisters) {
+    return pwmSystem->readHdr(port->channel, status);
+  } else {
+    return pwmSystem->readMXP(port->channel - tPWM::kNumHdrRegisters, status);
+  }
+}
+
+/**
+ * Get a scaled value from a PWM channel. The values range from -1 to 1.
+ *
+ * @param channel The PWM channel to read from.
+ * @return The scaled PWM value.
+ */
+double HAL_GetPWMSpeed(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return 0;
+  }
+
+  int32_t value = HAL_GetPWMRaw(pwmPortHandle, status);
+  if (*status != 0) return 0;
+  DigitalPort* dPort = port.get();
+
+  if (value == kPwmDisabled) {
+    return 0.0;
+  } else if (value > GetMaxPositivePwm(dPort)) {
+    return 1.0;
+  } else if (value < GetMinNegativePwm(dPort)) {
+    return -1.0;
+  } else if (value > GetMinPositivePwm(dPort)) {
+    return static_cast<double>(value - GetMinPositivePwm(dPort)) /
+           static_cast<double>(GetPositiveScaleFactor(dPort));
+  } else if (value < GetMaxNegativePwm(dPort)) {
+    return static_cast<double>(value - GetMaxNegativePwm(dPort)) /
+           static_cast<double>(GetNegativeScaleFactor(dPort));
+  } else {
+    return 0.0;
+  }
+}
+
+/**
+ * Get a position value from a PWM channel. The values range from 0 to 1.
+ *
+ * @param channel The PWM channel to read from.
+ * @return The scaled PWM value.
+ */
+double HAL_GetPWMPosition(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return 0;
+  }
+
+  int32_t value = HAL_GetPWMRaw(pwmPortHandle, status);
+  if (*status != 0) return 0;
+  DigitalPort* dPort = port.get();
+
+  if (value < GetMinNegativePwm(dPort)) {
+    return 0.0;
+  } else if (value > GetMaxPositivePwm(dPort)) {
+    return 1.0;
+  } else {
+    return static_cast<double>(value - GetMinNegativePwm(dPort)) /
+           static_cast<double>(GetFullRangeScaleFactor(dPort));
+  }
+}
+
+void HAL_LatchPWMZero(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  pwmSystem->writeZeroLatch(port->channel, true, status);
+  pwmSystem->writeZeroLatch(port->channel, false, status);
+}
+
+/**
+ * Set how how often the PWM signal is squelched, thus scaling the period.
+ *
+ * @param channel The PWM channel to configure.
+ * @param squelchMask The 2-bit mask of outputs to squelch.
+ */
+void HAL_SetPWMPeriodScale(HAL_DigitalHandle pwmPortHandle, int32_t squelchMask,
+                           int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  if (port->channel < tPWM::kNumPeriodScaleHdrElements) {
+    pwmSystem->writePeriodScaleHdr(port->channel, squelchMask, status);
+  } else {
+    pwmSystem->writePeriodScaleMXP(
+        port->channel - tPWM::kNumPeriodScaleHdrElements, squelchMask, status);
+  }
+}
+
+/**
+ * Get the loop timing of the PWM system
+ *
+ * @return The loop time
+ */
+int32_t HAL_GetPWMLoopTiming(int32_t* status) {
+  initializeDigital(status);
+  if (*status != 0) return 0;
+  return pwmSystem->readLoopTiming(status);
+}
+
+/**
+ * Get the pwm starting cycle time
+ *
+ * @return The pwm cycle start time.
+ */
+uint64_t HAL_GetPWMCycleStartTime(int32_t* status) {
+  initializeDigital(status);
+  if (*status != 0) return 0;
+
+  uint64_t upper1 = pwmSystem->readCycleStartTimeUpper(status);
+  uint32_t lower = pwmSystem->readCycleStartTime(status);
+  uint64_t upper2 = pwmSystem->readCycleStartTimeUpper(status);
+  if (*status != 0) return 0;
+  if (upper1 != upper2) {
+    // Rolled over between the lower call, reread lower
+    lower = pwmSystem->readCycleStartTime(status);
+    if (*status != 0) return 0;
+  }
+  return (upper2 << 32) + lower;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Ports.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Ports.cpp
new file mode 100644
index 0000000..e3b12e1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Ports.cpp
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Ports.h"
+
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePorts() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+int32_t HAL_GetNumAccumulators(void) { return kNumAccumulators; }
+int32_t HAL_GetNumAnalogTriggers(void) { return kNumAnalogTriggers; }
+int32_t HAL_GetNumAnalogInputs(void) { return kNumAnalogInputs; }
+int32_t HAL_GetNumAnalogOutputs(void) { return kNumAnalogOutputs; }
+int32_t HAL_GetNumCounters(void) { return kNumCounters; }
+int32_t HAL_GetNumDigitalHeaders(void) { return kNumDigitalHeaders; }
+int32_t HAL_GetNumPWMHeaders(void) { return kNumPWMHeaders; }
+int32_t HAL_GetNumDigitalChannels(void) { return kNumDigitalChannels; }
+int32_t HAL_GetNumPWMChannels(void) { return kNumPWMChannels; }
+int32_t HAL_GetNumDigitalPWMOutputs(void) { return kNumDigitalPWMOutputs; }
+int32_t HAL_GetNumEncoders(void) { return kNumEncoders; }
+int32_t HAL_GetNumInterrupts(void) { return kNumInterrupts; }
+int32_t HAL_GetNumRelayChannels(void) { return kNumRelayChannels; }
+int32_t HAL_GetNumRelayHeaders(void) { return kNumRelayHeaders; }
+int32_t HAL_GetNumPCMModules(void) { return kNumPCMModules; }
+int32_t HAL_GetNumSolenoidChannels(void) { return kNumSolenoidChannels; }
+int32_t HAL_GetNumPDPModules(void) { return kNumPDPModules; }
+int32_t HAL_GetNumPDPChannels(void) { return kNumPDPChannels; }
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/PortsInternal.h b/third_party/allwpilib_2018/hal/src/main/native/athena/PortsInternal.h
new file mode 100644
index 0000000..6d562a6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/PortsInternal.h
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/ChipObject.h"
+
+namespace hal {
+
+constexpr int32_t kNumAccumulators = tAccumulator::kNumSystems;
+constexpr int32_t kNumAnalogTriggers = tAnalogTrigger::kNumSystems;
+constexpr int32_t kNumAnalogInputs = 8;
+constexpr int32_t kNumAnalogOutputs = tAO::kNumMXPRegisters;
+constexpr int32_t kNumCounters = tCounter::kNumSystems;
+constexpr int32_t kNumDigitalHeaders = 10;
+constexpr int32_t kNumDigitalMXPChannels = 16;
+constexpr int32_t kNumDigitalSPIPortChannels = 5;
+constexpr int32_t kNumPWMHeaders = tPWM::kNumHdrRegisters;
+constexpr int32_t kNumDigitalChannels =
+    kNumDigitalHeaders + kNumDigitalMXPChannels + kNumDigitalSPIPortChannels;
+constexpr int32_t kNumPWMChannels = tPWM::kNumMXPRegisters + kNumPWMHeaders;
+constexpr int32_t kNumDigitalPWMOutputs =
+    tDIO::kNumPWMDutyCycleAElements + tDIO::kNumPWMDutyCycleBElements;
+constexpr int32_t kNumEncoders = tEncoder::kNumSystems;
+constexpr int32_t kNumInterrupts = tInterrupt::kNumSystems;
+constexpr int32_t kNumRelayChannels = 8;
+constexpr int32_t kNumRelayHeaders = kNumRelayChannels / 2;
+constexpr int32_t kNumPCMModules = 63;
+constexpr int32_t kNumSolenoidChannels = 8;
+constexpr int32_t kNumPDPModules = 63;
+constexpr int32_t kNumPDPChannels = 16;
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Power.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Power.cpp
new file mode 100644
index 0000000..c5c4dd9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Power.cpp
@@ -0,0 +1,151 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Power.h"
+
+#include <memory>
+
+#include "HAL/ChipObject.h"
+
+using namespace hal;
+
+namespace hal {
+
+static std::unique_ptr<tPower> power{nullptr};
+
+static void initializePower(int32_t* status) {
+  if (power == nullptr) {
+    power.reset(tPower::create(status));
+  }
+}
+
+}  // namespace hal
+
+namespace hal {
+namespace init {
+void InitializePower() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Get the roboRIO input voltage
+ */
+double HAL_GetVinVoltage(int32_t* status) {
+  initializePower(status);
+  return power->readVinVoltage(status) / 4.096 * 0.025733 - 0.029;
+}
+
+/**
+ * Get the roboRIO input current
+ */
+double HAL_GetVinCurrent(int32_t* status) {
+  initializePower(status);
+  return power->readVinCurrent(status) / 4.096 * 0.017042 - 0.071;
+}
+
+/**
+ * Get the 6V rail voltage
+ */
+double HAL_GetUserVoltage6V(int32_t* status) {
+  initializePower(status);
+  return power->readUserVoltage6V(status) / 4.096 * 0.007019 - 0.014;
+}
+
+/**
+ * Get the 6V rail current
+ */
+double HAL_GetUserCurrent6V(int32_t* status) {
+  initializePower(status);
+  return power->readUserCurrent6V(status) / 4.096 * 0.005566 - 0.009;
+}
+
+/**
+ * Get the active state of the 6V rail
+ */
+HAL_Bool HAL_GetUserActive6V(int32_t* status) {
+  initializePower(status);
+  return power->readStatus_User6V(status) == 4;
+}
+
+/**
+ * Get the fault count for the 6V rail
+ */
+int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
+  initializePower(status);
+  return static_cast<int32_t>(
+      power->readFaultCounts_OverCurrentFaultCount6V(status));
+}
+
+/**
+ * Get the 5V rail voltage
+ */
+double HAL_GetUserVoltage5V(int32_t* status) {
+  initializePower(status);
+  return power->readUserVoltage5V(status) / 4.096 * 0.005962 - 0.013;
+}
+
+/**
+ * Get the 5V rail current
+ */
+double HAL_GetUserCurrent5V(int32_t* status) {
+  initializePower(status);
+  return power->readUserCurrent5V(status) / 4.096 * 0.001996 - 0.002;
+}
+
+/**
+ * Get the active state of the 5V rail
+ */
+HAL_Bool HAL_GetUserActive5V(int32_t* status) {
+  initializePower(status);
+  return power->readStatus_User5V(status) == 4;
+}
+
+/**
+ * Get the fault count for the 5V rail
+ */
+int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
+  initializePower(status);
+  return static_cast<int32_t>(
+      power->readFaultCounts_OverCurrentFaultCount5V(status));
+}
+
+/**
+ * Get the 3.3V rail voltage
+ */
+double HAL_GetUserVoltage3V3(int32_t* status) {
+  initializePower(status);
+  return power->readUserVoltage3V3(status) / 4.096 * 0.004902 - 0.01;
+}
+
+/**
+ * Get the 3.3V rail current
+ */
+double HAL_GetUserCurrent3V3(int32_t* status) {
+  initializePower(status);
+  return power->readUserCurrent3V3(status) / 4.096 * 0.002486 - 0.003;
+}
+
+/**
+ * Get the active state of the 3.3V rail
+ */
+HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
+  initializePower(status);
+  return power->readStatus_User3V3(status) == 4;
+}
+
+/**
+ * Get the fault count for the 3.3V rail
+ */
+int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
+  initializePower(status);
+  return static_cast<int32_t>(
+      power->readFaultCounts_OverCurrentFaultCount3V3(status));
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Relay.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Relay.cpp
new file mode 100644
index 0000000..886fbcf
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Relay.cpp
@@ -0,0 +1,148 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Relay.h"
+
+#include "DigitalInternal.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+
+struct Relay {
+  uint8_t channel;
+  bool fwd;
+};
+
+}  // namespace
+
+static IndexedHandleResource<HAL_RelayHandle, Relay, kNumRelayChannels,
+                             HAL_HandleEnum::Relay>* relayHandles;
+
+// Create a mutex to protect changes to the relay values
+static wpi::mutex digitalRelayMutex;
+
+namespace hal {
+namespace init {
+void InitializeRelay() {
+  static IndexedHandleResource<HAL_RelayHandle, Relay, kNumRelayChannels,
+                               HAL_HandleEnum::Relay>
+      rH;
+  relayHandles = &rH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_RelayHandle HAL_InitializeRelayPort(HAL_PortHandle portHandle, HAL_Bool fwd,
+                                        int32_t* status) {
+  initializeDigital(status);
+
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  if (!fwd) channel += kNumRelayHeaders;  // add 4 to reverse channels
+
+  auto handle = relayHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = relayHandles->Get(handle);
+  if (port == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  if (!fwd) {
+    // Subtract number of headers to put channel in range
+    channel -= kNumRelayHeaders;
+
+    port->fwd = false;  // set to reverse
+  } else {
+    port->fwd = true;  // set to forward
+  }
+
+  port->channel = static_cast<uint8_t>(channel);
+  return handle;
+}
+
+void HAL_FreeRelayPort(HAL_RelayHandle relayPortHandle) {
+  // no status, so no need to check for a proper free.
+  relayHandles->Free(relayPortHandle);
+}
+
+HAL_Bool HAL_CheckRelayChannel(int32_t channel) {
+  // roboRIO only has 4 headers, and the FPGA has
+  // seperate functions for forward and reverse,
+  // instead of seperate channel IDs
+  return channel < kNumRelayHeaders && channel >= 0;
+}
+
+/**
+ * Set the state of a relay.
+ * Set the state of a relay output.
+ */
+void HAL_SetRelay(HAL_RelayHandle relayPortHandle, HAL_Bool on,
+                  int32_t* status) {
+  auto port = relayHandles->Get(relayPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  std::lock_guard<wpi::mutex> lock(digitalRelayMutex);
+  uint8_t relays = 0;
+  if (port->fwd) {
+    relays = relaySystem->readValue_Forward(status);
+  } else {
+    relays = relaySystem->readValue_Reverse(status);
+  }
+
+  if (*status != 0) return;  // bad status read
+
+  if (on) {
+    relays |= 1 << port->channel;
+  } else {
+    relays &= ~(1 << port->channel);
+  }
+
+  if (port->fwd) {
+    relaySystem->writeValue_Forward(relays, status);
+  } else {
+    relaySystem->writeValue_Reverse(relays, status);
+  }
+}
+
+/**
+ * Get the current state of the relay channel
+ */
+HAL_Bool HAL_GetRelay(HAL_RelayHandle relayPortHandle, int32_t* status) {
+  auto port = relayHandles->Get(relayPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  uint8_t relays = 0;
+  if (port->fwd) {
+    relays = relaySystem->readValue_Forward(status);
+  } else {
+    relays = relaySystem->readValue_Reverse(status);
+  }
+
+  return (relays & (1 << port->channel)) != 0;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/SPI.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/SPI.cpp
new file mode 100644
index 0000000..d8b2485
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/SPI.cpp
@@ -0,0 +1,717 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/SPI.h"
+
+#include <fcntl.h>
+#include <linux/spi/spidev.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+
+#include <array>
+#include <atomic>
+#include <cstring>
+
+#include <llvm/raw_ostream.h>
+#include <support/mutex.h>
+
+#include "DigitalInternal.h"
+#include "HAL/DIO.h"
+#include "HAL/HAL.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/HandlesInternal.h"
+
+using namespace hal;
+
+static int32_t m_spiCS0Handle{0};
+static int32_t m_spiCS1Handle{0};
+static int32_t m_spiCS2Handle{0};
+static int32_t m_spiCS3Handle{0};
+static int32_t m_spiMXPHandle{0};
+
+static constexpr int32_t kSpiMaxHandles = 5;
+
+// Indices 0-3 are for onboard CS0-CS2. Index 4 is for MXP.
+static std::array<wpi::mutex, kSpiMaxHandles> spiHandleMutexes;
+static std::array<wpi::mutex, kSpiMaxHandles> spiApiMutexes;
+static std::array<wpi::mutex, kSpiMaxHandles> spiAccumulatorMutexes;
+
+// MXP SPI does not count towards this
+static std::atomic<int32_t> spiPortCount{0};
+
+static HAL_DigitalHandle digitalHandles[9]{HAL_kInvalidHandle};
+
+static wpi::mutex spiAutoMutex;
+static int32_t spiAutoPort = kSpiMaxHandles;
+static std::atomic_bool spiAutoRunning{false};
+static std::unique_ptr<tDMAManager> spiAutoDMA;
+
+static bool SPIInUseByAuto(HAL_SPIPort port) {
+  // SPI engine conflicts with any other chip selects on the same SPI device.
+  // There are two SPI devices: one for ports 0-3 (onboard), the other for port
+  // 4 (MXP).
+  if (!spiAutoRunning) return false;
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  return (spiAutoPort >= 0 && spiAutoPort <= 3 && port >= 0 && port <= 3) ||
+         (spiAutoPort == 4 && port == 4);
+}
+
+namespace hal {
+namespace init {
+void InitializeSPI() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+static void CommonSPIPortInit(int32_t* status) {
+  // All false cases will set
+  if (spiPortCount.fetch_add(1) == 0) {
+    // Have not been initialized yet
+    initializeDigital(status);
+    if (*status != 0) return;
+    // MISO
+    if ((digitalHandles[3] = HAL_InitializeDIOPort(createPortHandleForSPI(29),
+                                                   false, status)) ==
+        HAL_kInvalidHandle) {
+      std::printf("Failed to allocate DIO 29 (MISO)\n");
+      return;
+    }
+    // MOSI
+    if ((digitalHandles[4] = HAL_InitializeDIOPort(createPortHandleForSPI(30),
+                                                   false, status)) ==
+        HAL_kInvalidHandle) {
+      std::printf("Failed to allocate DIO 30 (MOSI)\n");
+      HAL_FreeDIOPort(digitalHandles[3]);  // free the first port allocated
+      return;
+    }
+  }
+}
+
+static void CommonSPIPortFree(void) {
+  if (spiPortCount.fetch_sub(1) == 1) {
+    // Clean up SPI Handles
+    HAL_FreeDIOPort(digitalHandles[3]);
+    HAL_FreeDIOPort(digitalHandles[4]);
+  }
+}
+
+/*
+ * Initialize the spi port. Opens the port if necessary and saves the handle.
+ * If opening the MXP port, also sets up the channel functions appropriately
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS3, 4 for MXP
+ */
+void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  int handle;
+  if (HAL_GetSPIHandle(port) != 0) return;
+  switch (port) {
+    case 0:
+      CommonSPIPortInit(status);
+      if (*status != 0) return;
+      // CS0 is not a DIO port, so nothing to allocate
+      handle = open("/dev/spidev0.0", O_RDWR);
+      if (handle < 0) {
+        std::printf("Failed to open SPI port %d: %s\n", port,
+                    std::strerror(errno));
+        CommonSPIPortFree();
+        return;
+      }
+      HAL_SetSPIHandle(HAL_SPI_kOnboardCS0, handle);
+      break;
+    case 1:
+      CommonSPIPortInit(status);
+      if (*status != 0) return;
+      // CS1, Allocate
+      if ((digitalHandles[0] = HAL_InitializeDIOPort(createPortHandleForSPI(26),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        std::printf("Failed to allocate DIO 26 (CS1)\n");
+        CommonSPIPortFree();
+        return;
+      }
+      handle = open("/dev/spidev0.1", O_RDWR);
+      if (handle < 0) {
+        std::printf("Failed to open SPI port %d: %s\n", port,
+                    std::strerror(errno));
+        CommonSPIPortFree();
+        HAL_FreeDIOPort(digitalHandles[0]);
+        return;
+      }
+      HAL_SetSPIHandle(HAL_SPI_kOnboardCS1, handle);
+      break;
+    case 2:
+      CommonSPIPortInit(status);
+      if (*status != 0) return;
+      // CS2, Allocate
+      if ((digitalHandles[1] = HAL_InitializeDIOPort(createPortHandleForSPI(27),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        std::printf("Failed to allocate DIO 27 (CS2)\n");
+        CommonSPIPortFree();
+        return;
+      }
+      handle = open("/dev/spidev0.2", O_RDWR);
+      if (handle < 0) {
+        std::printf("Failed to open SPI port %d: %s\n", port,
+                    std::strerror(errno));
+        CommonSPIPortFree();
+        HAL_FreeDIOPort(digitalHandles[1]);
+        return;
+      }
+      HAL_SetSPIHandle(HAL_SPI_kOnboardCS2, handle);
+      break;
+    case 3:
+      CommonSPIPortInit(status);
+      if (*status != 0) return;
+      // CS3, Allocate
+      if ((digitalHandles[2] = HAL_InitializeDIOPort(createPortHandleForSPI(28),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        std::printf("Failed to allocate DIO 28 (CS3)\n");
+        CommonSPIPortFree();
+        return;
+      }
+      handle = open("/dev/spidev0.3", O_RDWR);
+      if (handle < 0) {
+        std::printf("Failed to open SPI port %d: %s\n", port,
+                    std::strerror(errno));
+        CommonSPIPortFree();
+        HAL_FreeDIOPort(digitalHandles[2]);
+        return;
+      }
+      HAL_SetSPIHandle(HAL_SPI_kOnboardCS3, handle);
+      break;
+    case 4:
+      initializeDigital(status);
+      if (*status != 0) return;
+      if ((digitalHandles[5] = HAL_InitializeDIOPort(createPortHandleForSPI(14),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        llvm::outs() << "Failed to allocate DIO 14\n";
+        return;
+      }
+      if ((digitalHandles[6] = HAL_InitializeDIOPort(createPortHandleForSPI(15),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        llvm::outs() << "Failed to allocate DIO 15\n";
+        HAL_FreeDIOPort(digitalHandles[5]);  // free the first port allocated
+        return;
+      }
+      if ((digitalHandles[7] = HAL_InitializeDIOPort(createPortHandleForSPI(16),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        llvm::outs() << "Failed to allocate DIO 16\n";
+        HAL_FreeDIOPort(digitalHandles[5]);  // free the first port allocated
+        HAL_FreeDIOPort(digitalHandles[6]);  // free the second port allocated
+        return;
+      }
+      if ((digitalHandles[8] = HAL_InitializeDIOPort(createPortHandleForSPI(17),
+                                                     false, status)) ==
+          HAL_kInvalidHandle) {
+        llvm::outs() << "Failed to allocate DIO 17\n";
+        HAL_FreeDIOPort(digitalHandles[5]);  // free the first port allocated
+        HAL_FreeDIOPort(digitalHandles[6]);  // free the second port allocated
+        HAL_FreeDIOPort(digitalHandles[7]);  // free the third port allocated
+        return;
+      }
+      digitalSystem->writeEnableMXPSpecialFunction(
+          digitalSystem->readEnableMXPSpecialFunction(status) | 0x00F0, status);
+      handle = open("/dev/spidev1.0", O_RDWR);
+      if (handle < 0) {
+        std::printf("Failed to open SPI port %d: %s\n", port,
+                    std::strerror(errno));
+        HAL_FreeDIOPort(digitalHandles[5]);  // free the first port allocated
+        HAL_FreeDIOPort(digitalHandles[6]);  // free the second port allocated
+        HAL_FreeDIOPort(digitalHandles[7]);  // free the third port allocated
+        HAL_FreeDIOPort(digitalHandles[8]);  // free the fourth port allocated
+        return;
+      }
+      HAL_SetSPIHandle(HAL_SPI_kMXP, handle);
+      break;
+    default:
+      *status = PARAMETER_OUT_OF_RANGE;
+      break;
+  }
+}
+
+/**
+ * Generic transaction.
+ *
+ * This is a lower-level interface to the spi hardware giving you more control
+ * over each transaction.
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ * @param dataToSend Buffer of data to send as part of the transaction.
+ * @param dataReceived Buffer to read data into.
+ * @param size Number of bytes to transfer. [0..7]
+ * @return Number of bytes transferred, -1 for error
+ */
+int32_t HAL_TransactionSPI(HAL_SPIPort port, const uint8_t* dataToSend,
+                           uint8_t* dataReceived, int32_t size) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return -1;
+  }
+
+  if (SPIInUseByAuto(port)) return -1;
+
+  struct spi_ioc_transfer xfer;
+  std::memset(&xfer, 0, sizeof(xfer));
+  xfer.tx_buf = (__u64)dataToSend;
+  xfer.rx_buf = (__u64)dataReceived;
+  xfer.len = size;
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  return ioctl(HAL_GetSPIHandle(port), SPI_IOC_MESSAGE(1), &xfer);
+}
+
+/**
+ * Execute a write transaction with the device.
+ *
+ * Write to a device and wait until the transaction is complete.
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ * @param datToSend The data to write to the register on the device.
+ * @param sendSize The number of bytes to be written
+ * @return The number of bytes written. -1 for an error
+ */
+int32_t HAL_WriteSPI(HAL_SPIPort port, const uint8_t* dataToSend,
+                     int32_t sendSize) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return -1;
+  }
+
+  if (SPIInUseByAuto(port)) return -1;
+
+  struct spi_ioc_transfer xfer;
+  std::memset(&xfer, 0, sizeof(xfer));
+  xfer.tx_buf = (__u64)dataToSend;
+  xfer.len = sendSize;
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  return ioctl(HAL_GetSPIHandle(port), SPI_IOC_MESSAGE(1), &xfer);
+}
+
+/**
+ * Execute a read from the device.
+ *
+ *   This method does not write any data out to the device
+ *   Most spi devices will require a register address to be written before
+ *   they begin returning data
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ * @param buffer A pointer to the array of bytes to store the data read from the
+ * device.
+ * @param count The number of bytes to read in the transaction. [1..7]
+ * @return Number of bytes read. -1 for error.
+ */
+int32_t HAL_ReadSPI(HAL_SPIPort port, uint8_t* buffer, int32_t count) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return -1;
+  }
+
+  if (SPIInUseByAuto(port)) return -1;
+
+  struct spi_ioc_transfer xfer;
+  std::memset(&xfer, 0, sizeof(xfer));
+  xfer.rx_buf = (__u64)buffer;
+  xfer.len = count;
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  return ioctl(HAL_GetSPIHandle(port), SPI_IOC_MESSAGE(1), &xfer);
+}
+
+/**
+ * Close the SPI port
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ */
+void HAL_CloseSPI(HAL_SPIPort port) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return;
+  }
+
+  int32_t status = 0;
+  HAL_FreeSPIAuto(port, &status);
+
+  {
+    std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+    close(HAL_GetSPIHandle(port));
+  }
+
+  HAL_SetSPIHandle(port, 0);
+  if (port < 4) {
+    CommonSPIPortFree();
+  }
+
+  switch (port) {
+    // Case 0 does not need to do anything
+    case 1:
+      HAL_FreeDIOPort(digitalHandles[0]);
+      break;
+    case 2:
+      HAL_FreeDIOPort(digitalHandles[1]);
+      break;
+    case 3:
+      HAL_FreeDIOPort(digitalHandles[2]);
+      break;
+    case 4:
+      HAL_FreeDIOPort(digitalHandles[5]);
+      HAL_FreeDIOPort(digitalHandles[6]);
+      HAL_FreeDIOPort(digitalHandles[7]);
+      HAL_FreeDIOPort(digitalHandles[8]);
+      break;
+    default:
+      break;
+  }
+}
+
+/**
+ * Set the clock speed for the SPI bus.
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ * @param speed The speed in Hz (0-1MHz)
+ */
+void HAL_SetSPISpeed(HAL_SPIPort port, int32_t speed) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  ioctl(HAL_GetSPIHandle(port), SPI_IOC_WR_MAX_SPEED_HZ, &speed);
+}
+
+/**
+ * Set the SPI options
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ * @param msbFirst True to write the MSB first, False for LSB first
+ * @param sampleOnTrailing True to sample on the trailing edge, False to sample
+ * on the leading edge
+ * @param clkIdleHigh True to set the clock to active low, False to set the
+ * clock active high
+ */
+void HAL_SetSPIOpts(HAL_SPIPort port, HAL_Bool msbFirst,
+                    HAL_Bool sampleOnTrailing, HAL_Bool clkIdleHigh) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return;
+  }
+
+  uint8_t mode = 0;
+  mode |= (!msbFirst ? 8 : 0);
+  mode |= (clkIdleHigh ? 2 : 0);
+  mode |= (sampleOnTrailing ? 1 : 0);
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  ioctl(HAL_GetSPIHandle(port), SPI_IOC_WR_MODE, &mode);
+}
+
+/**
+ * Set the CS Active high for a SPI port
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ */
+void HAL_SetSPIChipSelectActiveHigh(HAL_SPIPort port, int32_t* status) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  if (port < 4) {
+    spiSystem->writeChipSelectActiveHigh_Hdr(
+        spiSystem->readChipSelectActiveHigh_Hdr(status) | (1 << port), status);
+  } else {
+    spiSystem->writeChipSelectActiveHigh_MXP(1, status);
+  }
+}
+
+/**
+ * Set the CS Active low for a SPI port
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ */
+void HAL_SetSPIChipSelectActiveLow(HAL_SPIPort port, int32_t* status) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiApiMutexes[port]);
+  if (port < 4) {
+    spiSystem->writeChipSelectActiveHigh_Hdr(
+        spiSystem->readChipSelectActiveHigh_Hdr(status) & ~(1 << port), status);
+  } else {
+    spiSystem->writeChipSelectActiveHigh_MXP(0, status);
+  }
+}
+
+/**
+ * Get the stored handle for a SPI port
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for MXP
+ * @return The stored handle for the SPI port. 0 represents no stored handle.
+ */
+int32_t HAL_GetSPIHandle(HAL_SPIPort port) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return 0;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiHandleMutexes[port]);
+  switch (port) {
+    case 0:
+      return m_spiCS0Handle;
+    case 1:
+      return m_spiCS1Handle;
+    case 2:
+      return m_spiCS2Handle;
+    case 3:
+      return m_spiCS3Handle;
+    case 4:
+      return m_spiMXPHandle;
+    default:
+      return 0;
+  }
+}
+
+/**
+ * Set the stored handle for a SPI port
+ *
+ * @param port The number of the port to use. 0-3 for Onboard CS0-CS2, 4 for
+ * MXP.
+ * @param handle The value of the handle for the port.
+ */
+void HAL_SetSPIHandle(HAL_SPIPort port, int32_t handle) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiHandleMutexes[port]);
+  switch (port) {
+    case 0:
+      m_spiCS0Handle = handle;
+      break;
+    case 1:
+      m_spiCS1Handle = handle;
+      break;
+    case 2:
+      m_spiCS2Handle = handle;
+      break;
+    case 3:
+      m_spiCS3Handle = handle;
+      break;
+    case 4:
+      m_spiMXPHandle = handle;
+      break;
+    default:
+      break;
+  }
+}
+
+void HAL_InitSPIAuto(HAL_SPIPort port, int32_t bufferSize, int32_t* status) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (spiAutoPort != kSpiMaxHandles) {
+    *status = RESOURCE_IS_ALLOCATED;
+    return;
+  }
+
+  // remember the initialized port for other entry points
+  spiAutoPort = port;
+
+  // configure the correct chip select
+  if (port < 4) {
+    spiSystem->writeAutoSPI1Select(false, status);
+    spiSystem->writeAutoChipSelect(port, status);
+  } else {
+    spiSystem->writeAutoSPI1Select(true, status);
+    spiSystem->writeAutoChipSelect(0, status);
+  }
+
+  // configure DMA
+  tDMAChannelDescriptor desc;
+  spiSystem->getSystemInterface()->getDmaDescriptor(g_SpiAutoData_index, &desc);
+  spiAutoDMA = std::make_unique<tDMAManager>(desc.channel, bufferSize, status);
+}
+
+void HAL_FreeSPIAuto(HAL_SPIPort port, int32_t* status) {
+  if (port < 0 || port >= kSpiMaxHandles) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  if (spiAutoPort != port) return;
+  spiAutoPort = kSpiMaxHandles;
+
+  // disable by setting to internal clock and setting rate=0
+  spiSystem->writeAutoRate(0, status);
+  spiSystem->writeAutoTriggerConfig_ExternalClock(false, status);
+
+  // stop the DMA
+  spiAutoDMA->stop(status);
+
+  spiAutoDMA.reset(nullptr);
+
+  spiAutoRunning = false;
+}
+
+void HAL_StartSPIAutoRate(HAL_SPIPort port, double period, int32_t* status) {
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  spiAutoRunning = true;
+
+  // start the DMA
+  spiAutoDMA->start(status);
+
+  // auto rate is in microseconds
+  spiSystem->writeAutoRate(period * 1000000, status);
+
+  // disable the external clock
+  spiSystem->writeAutoTriggerConfig_ExternalClock(false, status);
+}
+
+void HAL_StartSPIAutoTrigger(HAL_SPIPort port, HAL_Handle digitalSourceHandle,
+                             HAL_AnalogTriggerType analogTriggerType,
+                             HAL_Bool triggerRising, HAL_Bool triggerFalling,
+                             int32_t* status) {
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  spiAutoRunning = true;
+
+  // start the DMA
+  spiAutoDMA->start(status);
+
+  // get channel routing
+  bool routingAnalogTrigger = false;
+  uint8_t routingChannel = 0;
+  uint8_t routingModule = 0;
+  if (!remapDigitalSource(digitalSourceHandle, analogTriggerType,
+                          routingChannel, routingModule,
+                          routingAnalogTrigger)) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  // configure external trigger and enable it
+  tSPI::tAutoTriggerConfig config;
+  config.ExternalClock = 1;
+  config.FallingEdge = triggerFalling ? 1 : 0;
+  config.RisingEdge = triggerRising ? 1 : 0;
+  config.ExternalClockSource_AnalogTrigger = routingAnalogTrigger ? 1 : 0;
+  config.ExternalClockSource_Module = routingModule;
+  config.ExternalClockSource_Channel = routingChannel;
+  spiSystem->writeAutoTriggerConfig(config, status);
+}
+
+void HAL_StopSPIAuto(HAL_SPIPort port, int32_t* status) {
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  // disable by setting to internal clock and setting rate=0
+  spiSystem->writeAutoRate(0, status);
+  spiSystem->writeAutoTriggerConfig_ExternalClock(false, status);
+
+  // stop the DMA
+  spiAutoDMA->stop(status);
+
+  spiAutoRunning = false;
+}
+
+void HAL_SetSPIAutoTransmitData(HAL_SPIPort port, const uint8_t* dataToSend,
+                                int32_t dataSize, int32_t zeroSize,
+                                int32_t* status) {
+  if (dataSize < 0 || dataSize > 16) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  if (zeroSize < 0 || zeroSize > 127) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  // set tx data registers
+  for (int32_t i = 0; i < dataSize; ++i)
+    spiSystem->writeAutoTx(i >> 2, i & 3, dataToSend[i], status);
+
+  // set byte counts
+  tSPI::tAutoByteCount config;
+  config.ZeroByteCount = static_cast<unsigned>(zeroSize) & 0x7f;
+  config.TxByteCount = static_cast<unsigned>(dataSize) & 0xf;
+  spiSystem->writeAutoByteCount(config, status);
+}
+
+void HAL_ForceSPIAutoRead(HAL_SPIPort port, int32_t* status) {
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  spiSystem->strobeAutoForceOne(status);
+}
+
+int32_t HAL_ReadSPIAutoReceivedData(HAL_SPIPort port, uint8_t* buffer,
+                                    int32_t numToRead, double timeout,
+                                    int32_t* status) {
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return 0;
+  }
+
+  size_t numRemaining = 0;
+  // timeout is in ms
+  spiAutoDMA->read(buffer, numToRead, timeout * 1000, &numRemaining, status);
+  return numRemaining;
+}
+
+int32_t HAL_GetSPIAutoDroppedCount(HAL_SPIPort port, int32_t* status) {
+  std::lock_guard<wpi::mutex> lock(spiAutoMutex);
+  // FPGA only has one auto SPI engine
+  if (port != spiAutoPort) {
+    *status = INCOMPATIBLE_STATE;
+    return 0;
+  }
+
+  return spiSystem->readTransferSkippedFullCount(status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/SerialPort.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/SerialPort.cpp
new file mode 100644
index 0000000..3867999
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/SerialPort.cpp
@@ -0,0 +1,165 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/SerialPort.h"
+
+#include <string>
+
+#include "HAL/cpp/SerialHelper.h"
+#include "visa/visa.h"
+
+static int32_t resourceManagerHandle{0};
+static HAL_SerialPort portHandles[4];
+
+namespace hal {
+namespace init {
+void InitializeSerialPort() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+void HAL_InitializeSerialPort(HAL_SerialPort port, int32_t* status) {
+  std::string portName;
+
+  if (resourceManagerHandle == 0)
+    viOpenDefaultRM(reinterpret_cast<ViSession*>(&resourceManagerHandle));
+
+  hal::SerialHelper serialHelper;
+
+  portName = serialHelper.GetVISASerialPortName(port, status);
+
+  if (*status < 0) {
+    return;
+  }
+
+  *status = viOpen(resourceManagerHandle, const_cast<char*>(portName.c_str()),
+                   VI_NULL, VI_NULL,
+                   reinterpret_cast<ViSession*>(&portHandles[port]));
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialBaudRate(HAL_SerialPort port, int32_t baud, int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_ASRL_BAUD, baud);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialDataBits(HAL_SerialPort port, int32_t bits, int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_ASRL_DATA_BITS, bits);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialParity(HAL_SerialPort port, int32_t parity, int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_ASRL_PARITY, parity);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialStopBits(HAL_SerialPort port, int32_t stopBits,
+                           int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_ASRL_STOP_BITS, stopBits);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialWriteMode(HAL_SerialPort port, int32_t mode,
+                            int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_WR_BUF_OPER_MODE, mode);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialFlowControl(HAL_SerialPort port, int32_t flow,
+                              int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_ASRL_FLOW_CNTRL, flow);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialTimeout(HAL_SerialPort port, double timeout,
+                          int32_t* status) {
+  *status = viSetAttribute(portHandles[port], VI_ATTR_TMO_VALUE,
+                           static_cast<uint32_t>(timeout * 1e3));
+  if (*status > 0) *status = 0;
+}
+
+void HAL_EnableSerialTermination(HAL_SerialPort port, char terminator,
+                                 int32_t* status) {
+  viSetAttribute(portHandles[port], VI_ATTR_TERMCHAR_EN, VI_TRUE);
+  viSetAttribute(portHandles[port], VI_ATTR_TERMCHAR, terminator);
+  *status = viSetAttribute(portHandles[port], VI_ATTR_ASRL_END_IN,
+                           VI_ASRL_END_TERMCHAR);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_DisableSerialTermination(HAL_SerialPort port, int32_t* status) {
+  viSetAttribute(portHandles[port], VI_ATTR_TERMCHAR_EN, VI_FALSE);
+  *status =
+      viSetAttribute(portHandles[port], VI_ATTR_ASRL_END_IN, VI_ASRL_END_NONE);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialReadBufferSize(HAL_SerialPort port, int32_t size,
+                                 int32_t* status) {
+  *status = viSetBuf(portHandles[port], VI_READ_BUF, size);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_SetSerialWriteBufferSize(HAL_SerialPort port, int32_t size,
+                                  int32_t* status) {
+  *status = viSetBuf(portHandles[port], VI_WRITE_BUF, size);
+  if (*status > 0) *status = 0;
+}
+
+int32_t HAL_GetSerialBytesReceived(HAL_SerialPort port, int32_t* status) {
+  int32_t bytes = 0;
+
+  *status = viGetAttribute(portHandles[port], VI_ATTR_ASRL_AVAIL_NUM, &bytes);
+  if (*status > 0) *status = 0;
+  return bytes;
+}
+
+int32_t HAL_ReadSerial(HAL_SerialPort port, char* buffer, int32_t count,
+                       int32_t* status) {
+  uint32_t retCount = 0;
+
+  *status =
+      viRead(portHandles[port], (ViPBuf)buffer, count, (ViPUInt32)&retCount);
+
+  if (*status == VI_ERROR_IO || *status == VI_ERROR_ASRL_OVERRUN ||
+      *status == VI_ERROR_ASRL_FRAMING || *status == VI_ERROR_ASRL_PARITY) {
+    int32_t localStatus = 0;
+    HAL_ClearSerial(port, &localStatus);
+  }
+
+  if (*status == VI_ERROR_TMO || *status > 0) *status = 0;
+  return static_cast<int32_t>(retCount);
+}
+
+int32_t HAL_WriteSerial(HAL_SerialPort port, const char* buffer, int32_t count,
+                        int32_t* status) {
+  uint32_t retCount = 0;
+
+  *status =
+      viWrite(portHandles[port], (ViPBuf)buffer, count, (ViPUInt32)&retCount);
+
+  if (*status > 0) *status = 0;
+  return static_cast<int32_t>(retCount);
+}
+
+void HAL_FlushSerial(HAL_SerialPort port, int32_t* status) {
+  *status = viFlush(portHandles[port], VI_WRITE_BUF);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_ClearSerial(HAL_SerialPort port, int32_t* status) {
+  *status = viClear(portHandles[port]);
+  if (*status > 0) *status = 0;
+}
+
+void HAL_CloseSerial(HAL_SerialPort port, int32_t* status) {
+  *status = viClose(portHandles[port]);
+  if (*status > 0) *status = 0;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Solenoid.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Solenoid.cpp
new file mode 100644
index 0000000..1787b76
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Solenoid.cpp
@@ -0,0 +1,189 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Solenoid.h"
+
+#include <FRC_NetworkCommunication/LoadOut.h>
+
+#include "HAL/ChipObject.h"
+#include "HAL/Errors.h"
+#include "HAL/Ports.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "PCMInternal.h"
+#include "PortsInternal.h"
+#include "ctre/PCM.h"
+
+namespace {
+
+struct Solenoid {
+  uint8_t module;
+  uint8_t channel;
+};
+
+}  // namespace
+
+using namespace hal;
+
+static IndexedHandleResource<HAL_SolenoidHandle, Solenoid,
+                             kNumPCMModules * kNumSolenoidChannels,
+                             HAL_HandleEnum::Solenoid>* solenoidHandles;
+
+namespace hal {
+namespace init {
+void InitializeSolenoid() {
+  static IndexedHandleResource<HAL_SolenoidHandle, Solenoid,
+                               kNumPCMModules * kNumSolenoidChannels,
+                               HAL_HandleEnum::Solenoid>
+      sH;
+  solenoidHandles = &sH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_SolenoidHandle HAL_InitializeSolenoidPort(HAL_PortHandle portHandle,
+                                              int32_t* status) {
+  int16_t channel = getPortHandleChannel(portHandle);
+  int16_t module = getPortHandleModule(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  // initializePCM will check the module
+  if (!HAL_CheckSolenoidChannel(channel)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  initializePCM(module, status);
+  if (*status != 0) {
+    return HAL_kInvalidHandle;
+  }
+
+  auto handle = solenoidHandles->Allocate(
+      module * kNumSolenoidChannels + channel, status);
+  if (*status != 0) {
+    return HAL_kInvalidHandle;
+  }
+  auto solenoidPort = solenoidHandles->Get(handle);
+  if (solenoidPort == nullptr) {  // would only occur on thread issues
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  solenoidPort->module = static_cast<uint8_t>(module);
+  solenoidPort->channel = static_cast<uint8_t>(channel);
+
+  return handle;
+}
+
+void HAL_FreeSolenoidPort(HAL_SolenoidHandle solenoidPortHandle) {
+  solenoidHandles->Free(solenoidPortHandle);
+}
+
+HAL_Bool HAL_CheckSolenoidModule(int32_t module) {
+  return module < kNumPCMModules && module >= 0;
+}
+
+HAL_Bool HAL_CheckSolenoidChannel(int32_t channel) {
+  return channel < kNumSolenoidChannels && channel >= 0;
+}
+
+HAL_Bool HAL_GetSolenoid(HAL_SolenoidHandle solenoidPortHandle,
+                         int32_t* status) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  bool value;
+
+  *status = PCM_modules[port->module]->GetSolenoid(port->channel, value);
+
+  return value;
+}
+
+int32_t HAL_GetAllSolenoids(int32_t module, int32_t* status) {
+  if (!checkPCMInit(module, status)) return 0;
+  uint8_t value;
+
+  *status = PCM_modules[module]->GetAllSolenoids(value);
+
+  return value;
+}
+
+void HAL_SetSolenoid(HAL_SolenoidHandle solenoidPortHandle, HAL_Bool value,
+                     int32_t* status) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  *status = PCM_modules[port->module]->SetSolenoid(port->channel, value);
+}
+
+void HAL_SetAllSolenoids(int32_t module, int32_t state, int32_t* status) {
+  if (!checkPCMInit(module, status)) return;
+
+  *status = PCM_modules[module]->SetAllSolenoids(state);
+}
+
+int32_t HAL_GetPCMSolenoidBlackList(int32_t module, int32_t* status) {
+  if (!checkPCMInit(module, status)) return 0;
+  uint8_t value;
+
+  *status = PCM_modules[module]->GetSolenoidBlackList(value);
+
+  return value;
+}
+HAL_Bool HAL_GetPCMSolenoidVoltageStickyFault(int32_t module, int32_t* status) {
+  if (!checkPCMInit(module, status)) return 0;
+  bool value;
+
+  *status = PCM_modules[module]->GetSolenoidStickyFault(value);
+
+  return value;
+}
+HAL_Bool HAL_GetPCMSolenoidVoltageFault(int32_t module, int32_t* status) {
+  if (!checkPCMInit(module, status)) return false;
+  bool value;
+
+  *status = PCM_modules[module]->GetSolenoidFault(value);
+
+  return value;
+}
+void HAL_ClearAllPCMStickyFaults(int32_t module, int32_t* status) {
+  if (!checkPCMInit(module, status)) return;
+
+  *status = PCM_modules[module]->ClearStickyFaults();
+}
+
+void HAL_SetOneShotDuration(HAL_SolenoidHandle solenoidPortHandle,
+                            int32_t durMS, int32_t* status) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  *status =
+      PCM_modules[port->module]->SetOneShotDurationMs(port->channel, durMS);
+}
+
+void HAL_FireOneShot(HAL_SolenoidHandle solenoidPortHandle, int32_t* status) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  *status = PCM_modules[port->module]->FireOneShotSolenoid(port->channel);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/Threads.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/Threads.cpp
new file mode 100644
index 0000000..9bfb099
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/Threads.cpp
@@ -0,0 +1,130 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Threads.h"
+
+#include <pthread.h>
+#include <sched.h>
+
+#include "HAL/Errors.h"
+
+namespace hal {
+namespace init {
+void InitializeThreads() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Get the thread priority for the specified thread.
+ *
+ * @param handle Native handle pointer to the thread to get the priority for
+ * @param isRealTime Set to true if thread is realtime, otherwise false
+ * @param status Error status variable. 0 on success
+ * @return The current thread priority. Scaled 1-99, with 1 being highest.
+ */
+int32_t HAL_GetThreadPriority(NativeThreadHandle handle, HAL_Bool* isRealTime,
+                              int32_t* status) {
+  sched_param sch;
+  int policy;
+  int success = pthread_getschedparam(*handle, &policy, &sch);
+  if (success == 0) {
+    *status = 0;
+  } else {
+    *status = HAL_THREAD_PRIORITY_ERROR;
+    return -1;
+  }
+  if (policy == SCHED_FIFO || policy == SCHED_RR) {
+    *isRealTime = true;
+    return sch.sched_priority;
+  } else {
+    *isRealTime = false;
+    // 0 is the only suppored priority for non-realtime, so scale to 1
+    return 1;
+  }
+}
+
+/**
+ * Get the thread priority for the current thread.
+ *
+ * @param handle Native handle pointer to the thread to get the priority for
+ * @param isRealTime Set to true if thread is realtime, otherwise false
+ * @param status Error status variable. 0 on success
+ * @return The current thread priority. Scaled 1-99, with 1 being highest.
+ */
+int32_t HAL_GetCurrentThreadPriority(HAL_Bool* isRealTime, int32_t* status) {
+  auto thread = pthread_self();
+  return HAL_GetThreadPriority(&thread, isRealTime, status);
+}
+
+/**
+ * Sets the thread priority for the specified thread
+ *
+ * @param thread Reference to the thread to set the priority of
+ * @param realTime Set to true to set a realtime priority, false for standard
+ * priority
+ * @param priority Priority to set the thread to. Scaled 1-99, with 1 being
+ * highest
+ * @param status Error status variable. 0 on success
+ *
+ * @return The success state of setting the priority
+ */
+HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime,
+                               int32_t priority, int32_t* status) {
+  if (handle == nullptr) {
+    *status = NULL_PARAMETER;
+    return false;
+  }
+
+  int scheduler = realTime ? SCHED_FIFO : SCHED_OTHER;
+  if (realTime) {
+    // We don't support setting priorities for non RT threads
+    // so we don't need to check for proper range
+    if (priority < sched_get_priority_min(scheduler) ||
+        priority > sched_get_priority_max(scheduler)) {
+      *status = HAL_THREAD_PRIORITY_RANGE_ERROR;
+      return false;
+    }
+  }
+
+  sched_param sch;
+  int policy;
+  pthread_getschedparam(*handle, &policy, &sch);
+  if (scheduler == SCHED_FIFO || scheduler == SCHED_RR)
+    sch.sched_priority = priority;
+  else
+    // Only need to set 0 priority for non RT thread
+    sch.sched_priority = 0;
+  if (pthread_setschedparam(*handle, scheduler, &sch)) {
+    *status = HAL_THREAD_PRIORITY_ERROR;
+    return false;
+  } else {
+    *status = 0;
+    return true;
+  }
+}
+
+/**
+ * Sets the thread priority for the current thread
+ *
+ * @param thread Reference to the thread to set the priority of
+ * @param realTime Set to true to set a realtime priority, false for standard
+ * priority
+ * @param priority Priority to set the thread to. Scaled 1-99, with 1 being
+ * highest
+ * @param status Error status variable. 0 on success
+ *
+ * @return The success state of setting the priority
+ */
+HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority,
+                                      int32_t* status) {
+  auto thread = pthread_self();
+  return HAL_SetThreadPriority(&thread, realTime, priority, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/cpp/SerialHelper.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/cpp/SerialHelper.cpp
new file mode 100644
index 0000000..c990c33
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/cpp/SerialHelper.cpp
@@ -0,0 +1,331 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/cpp/SerialHelper.h"
+
+#include <algorithm>
+#include <cstdio>
+#include <cstring>
+
+#include <llvm/FileSystem.h>
+#include <llvm/StringRef.h>
+
+#include "../visa/visa.h"
+#include "HAL/Errors.h"
+
+constexpr const char* OnboardResourceVISA = "ASRL1::INSTR";
+constexpr const char* MxpResourceVISA = "ASRL2::INSTR";
+
+constexpr const char* OnboardResourceOS = "/dev/ttyS0";
+constexpr const char* MxpResourceOS = "/dev/ttyS1";
+
+namespace hal {
+
+std::string SerialHelper::m_usbNames[2]{"", ""};
+
+wpi::mutex SerialHelper::m_nameMutex;
+
+SerialHelper::SerialHelper() {
+  viOpenDefaultRM(reinterpret_cast<ViSession*>(&m_resourceHandle));
+}
+
+std::string SerialHelper::GetVISASerialPortName(HAL_SerialPort port,
+                                                int32_t* status) {
+  if (port == HAL_SerialPort::HAL_SerialPort_Onboard) {
+    return OnboardResourceVISA;
+  } else if (port == HAL_SerialPort::HAL_SerialPort_MXP) {
+    return MxpResourceVISA;
+  }
+
+  QueryHubPaths(status);
+
+  // If paths are empty or status error, return error
+  if (*status != 0 || m_visaResource.empty() || m_osResource.empty() ||
+      m_sortedHubPath.empty()) {
+    *status = HAL_SERIAL_PORT_NOT_FOUND;
+    return "";
+  }
+
+  int32_t visaIndex = GetIndexForPort(port, status);
+  if (visaIndex == -1) {
+    *status = HAL_SERIAL_PORT_NOT_FOUND;
+    return "";
+    // Error
+  } else {
+    return m_visaResource[visaIndex].str();
+  }
+}
+
+std::string SerialHelper::GetOSSerialPortName(HAL_SerialPort port,
+                                              int32_t* status) {
+  if (port == HAL_SerialPort::HAL_SerialPort_Onboard) {
+    return OnboardResourceOS;
+  } else if (port == HAL_SerialPort::HAL_SerialPort_MXP) {
+    return MxpResourceOS;
+  }
+
+  QueryHubPaths(status);
+
+  // If paths are empty or status error, return error
+  if (*status != 0 || m_visaResource.empty() || m_osResource.empty() ||
+      m_sortedHubPath.empty()) {
+    *status = HAL_SERIAL_PORT_NOT_FOUND;
+    return "";
+  }
+
+  int32_t osIndex = GetIndexForPort(port, status);
+  if (osIndex == -1) {
+    *status = HAL_SERIAL_PORT_NOT_FOUND;
+    return "";
+    // Error
+  } else {
+    return m_osResource[osIndex].str();
+  }
+}
+
+std::vector<std::string> SerialHelper::GetVISASerialPortList(int32_t* status) {
+  std::vector<std::string> retVec;
+
+  // Always add 2 onboard ports
+  retVec.emplace_back(OnboardResourceVISA);
+  retVec.emplace_back(MxpResourceVISA);
+
+  QueryHubPaths(status);
+
+  // If paths are empty or status error, return only onboard list
+  if (*status != 0 || m_visaResource.empty() || m_osResource.empty() ||
+      m_sortedHubPath.empty()) {
+    *status = 0;
+    return retVec;
+  }
+
+  for (auto& i : m_visaResource) {
+    retVec.emplace_back(i.str());
+  }
+
+  return retVec;
+}
+
+std::vector<std::string> SerialHelper::GetOSSerialPortList(int32_t* status) {
+  std::vector<std::string> retVec;
+
+  // Always add 2 onboard ports
+  retVec.emplace_back(OnboardResourceOS);
+  retVec.emplace_back(MxpResourceOS);
+
+  QueryHubPaths(status);
+
+  // If paths are empty or status error, return only onboard list
+  if (*status != 0 || m_visaResource.empty() || m_osResource.empty() ||
+      m_sortedHubPath.empty()) {
+    *status = 0;
+    return retVec;
+  }
+
+  for (auto& i : m_osResource) {
+    retVec.emplace_back(i.str());
+  }
+
+  return retVec;
+}
+
+void SerialHelper::SortHubPathVector() {
+  m_sortedHubPath.clear();
+  m_sortedHubPath = m_unsortedHubPath;
+  std::sort(m_sortedHubPath.begin(), m_sortedHubPath.end(),
+            [](const llvm::SmallVectorImpl<char>& lhs,
+               const llvm::SmallVectorImpl<char>& rhs) -> int {
+              llvm::StringRef lhsRef(lhs.begin(), lhs.size());
+              llvm::StringRef rhsRef(rhs.begin(), rhs.size());
+              return lhsRef.compare(rhsRef);
+            });
+}
+
+void SerialHelper::CoiteratedSort(
+    llvm::SmallVectorImpl<llvm::SmallString<16>>& vec) {
+  llvm::SmallVector<llvm::SmallString<16>, 4> sortedVec;
+  for (auto& str : m_sortedHubPath) {
+    for (size_t i = 0; i < m_unsortedHubPath.size(); i++) {
+      if (llvm::StringRef{m_unsortedHubPath[i].begin(),
+                          m_unsortedHubPath[i].size()}
+              .equals(llvm::StringRef{str.begin(), str.size()})) {
+        sortedVec.push_back(vec[i]);
+        break;
+      }
+    }
+  }
+  vec = sortedVec;
+}
+
+void SerialHelper::QueryHubPaths(int32_t* status) {
+  // VISA resource matching string
+  const char* str = "?*";
+  // Items needed for VISA
+  ViUInt32 retCnt = 0;
+  ViFindList viList = 0;
+  ViChar desc[VI_FIND_BUFLEN];
+  *status = viFindRsrc(m_resourceHandle, const_cast<char*>(str), &viList,
+                       &retCnt, desc);
+
+  if (*status < 0) {
+    // Handle the bad status elsewhere
+    // Note let positive statii (warnings) continue
+    goto done;
+  }
+  // Status might be positive, so reset it to 0
+  *status = 0;
+
+  // Storage buffer for Visa call
+  char osName[256];
+
+  // Loop through all returned VISA objects.
+  // Increment the internal VISA ptr every loop
+  for (size_t i = 0; i < retCnt; i++, viFindNext(viList, desc)) {
+    // Ignore any matches to the 2 onboard ports
+    if (std::strcmp(OnboardResourceVISA, desc) == 0 ||
+        std::strcmp(MxpResourceVISA, desc) == 0) {
+      continue;
+    }
+
+    // Open the resource, grab its interface name, and close it.
+    ViSession vSession;
+    *status = viOpen(m_resourceHandle, desc, VI_NULL, VI_NULL, &vSession);
+    if (*status < 0) goto done;
+    *status = 0;
+
+    *status = viGetAttribute(vSession, VI_ATTR_INTF_INST_NAME, &osName);
+    // Ignore an error here, as we want to close the session on an error
+    // Use a seperate close variable so we can check
+    ViStatus closeStatus = viClose(vSession);
+    if (*status < 0) goto done;
+    if (closeStatus < 0) goto done;
+    *status = 0;
+
+    // split until (/dev/
+    llvm::StringRef devNameRef = llvm::StringRef{osName}.split("(/dev/").second;
+    // String not found, continue
+    if (devNameRef.equals("")) continue;
+
+    // Split at )
+    llvm::StringRef matchString = devNameRef.split(')').first;
+    if (matchString.equals(devNameRef)) continue;
+
+    // Search directories to get a list of system accessors
+    std::error_code ec;
+    for (auto p = llvm::sys::fs::recursive_directory_iterator(
+             "/sys/devices/soc0", ec);
+         p != llvm::sys::fs::recursive_directory_iterator(); p.increment(ec)) {
+      if (ec) break;
+      llvm::StringRef path{p->path()};
+      if (path.find("amba") == llvm::StringRef::npos) continue;
+      if (path.find("usb") == llvm::StringRef::npos) continue;
+      if (path.find(matchString) == llvm::StringRef::npos) continue;
+
+      llvm::SmallVector<llvm::StringRef, 16> pathSplitVec;
+      // Split path into individual directories
+      path.split(pathSplitVec, '/', -1, false);
+
+      // Find each individual item index
+      int findusb = -1;
+      int findtty = -1;
+      int findregex = -1;
+      for (size_t i = 0; i < pathSplitVec.size(); i++) {
+        if (findusb == -1 && pathSplitVec[i].equals("usb1")) {
+          findusb = i;
+        }
+        if (findtty == -1 && pathSplitVec[i].equals("tty")) {
+          findtty = i;
+        }
+        if (findregex == -1 && pathSplitVec[i].equals(matchString)) {
+          findregex = i;
+        }
+      }
+
+      // Get the index for our device
+      int hubIndex = findtty;
+      if (findtty == -1) hubIndex = findregex;
+
+      int devStart = findusb + 1;
+
+      if (hubIndex < devStart) continue;
+
+      // Add our devices to our list
+      m_unsortedHubPath.emplace_back(
+          llvm::StringRef{pathSplitVec[hubIndex - 2]});
+      m_visaResource.emplace_back(desc);
+      m_osResource.emplace_back(
+          llvm::StringRef{osName}.split("(").second.split(")").first);
+      break;
+    }
+  }
+
+  SortHubPathVector();
+
+  CoiteratedSort(m_visaResource);
+  CoiteratedSort(m_osResource);
+done:
+  viClose(viList);
+}
+
+int32_t SerialHelper::GetIndexForPort(HAL_SerialPort port, int32_t* status) {
+  // Hold lock whenever we're using the names array
+  std::lock_guard<wpi::mutex> lock(m_nameMutex);
+
+  std::string portString = m_usbNames[port - 2];
+
+  llvm::SmallVector<int32_t, 4> indices;
+
+  // If port has not been assigned, find the one to assign
+  if (portString.empty()) {
+    for (size_t i = 0; i < 2; i++) {
+      // Remove all used ports
+      auto idx = std::find(m_sortedHubPath.begin(), m_sortedHubPath.end(),
+                           m_usbNames[i]);
+      if (idx != m_sortedHubPath.end()) {
+        // found
+        m_sortedHubPath.erase(idx);
+      }
+      if (m_usbNames[i] == "") {
+        indices.push_back(i);
+      }
+    }
+
+    int32_t idx = -1;
+    for (size_t i = 0; i < indices.size(); i++) {
+      if (indices[i] == port - 2) {
+        idx = i;
+        break;
+      }
+    }
+
+    if (idx == -1) {
+      *status = HAL_SERIAL_PORT_NOT_FOUND;
+      return -1;
+    }
+
+    if (idx >= static_cast<int32_t>(m_sortedHubPath.size())) {
+      *status = HAL_SERIAL_PORT_NOT_FOUND;
+      return -1;
+    }
+
+    portString = m_sortedHubPath[idx].str();
+    m_usbNames[port - 2] = portString;
+  }
+
+  int retIndex = -1;
+
+  for (size_t i = 0; i < m_sortedHubPath.size(); i++) {
+    if (m_sortedHubPath[i].equals(portString)) {
+      retIndex = i;
+      break;
+    }
+  }
+
+  return retIndex;
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/CtreCanNode.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/CtreCanNode.cpp
new file mode 100644
index 0000000..8772a47
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/CtreCanNode.cpp
@@ -0,0 +1,163 @@
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"

+

+#include "CtreCanNode.h"

+#include "FRC_NetworkCommunication/CANSessionMux.h"

+#include <string.h> // memset

+

+static const UINT32 kFullMessageIDMask = 0x1fffffff;

+

+CtreCanNode::CtreCanNode(UINT8 deviceNumber)

+{

+	_deviceNumber = deviceNumber;

+}

+CtreCanNode::~CtreCanNode()

+{

+}

+void CtreCanNode::RegisterRx(uint32_t arbId)

+{

+	/* no need to do anything, we just use new API to poll last received message */

+}

+/**

+ * Schedule a CAN Frame for periodic transmit.

+ * @param arbId 	CAN Frame Arbitration ID.  Set BIT31 for 11bit ids, otherwise we use 29bit ids.

+ * @param periodMs	Period to transmit CAN frame.  Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.

+ * @param dlc 		Number of bytes to transmit (0 to 8).

+ * @param initialFrame	Ptr to the frame data to schedule for transmitting.  Passing null will result

+ *						in defaulting to zero data value.

+ */

+void CtreCanNode::RegisterTx(uint32_t arbId, uint32_t periodMs, uint32_t dlc, const uint8_t * initialFrame)

+{

+	int32_t status = 0;

+	if(dlc > 8)

+		dlc = 8;

+	txJob_t job = {0};

+	job.arbId = arbId;

+	job.periodMs = periodMs;

+	job.dlc = dlc;

+	if(initialFrame){

+		/* caller wants to specify original data */

+		memcpy(job.toSend, initialFrame, dlc);

+	}

+	_txJobs[arbId] = job;

+	FRC_NetworkCommunication_CANSessionMux_sendMessage(	job.arbId,

+														job.toSend,

+														job.dlc,

+														job.periodMs,

+														&status);

+}

+/**

+ * Schedule a CAN Frame for periodic transmit.  Assume eight byte DLC and zero value for initial transmission.

+ * @param arbId 	CAN Frame Arbitration ID.  Set BIT31 for 11bit ids, otherwise we use 29bit ids.

+ * @param periodMs	Period to transmit CAN frame.  Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.

+ */

+void CtreCanNode::RegisterTx(uint32_t arbId, uint32_t periodMs)

+{

+	RegisterTx(arbId,periodMs, 8, 0);

+}

+/**

+ * Remove a CAN frame Arbid to stop transmission.

+ * @param arbId 	CAN Frame Arbitration ID.  Set BIT31 for 11bit ids, otherwise we use 29bit ids.

+ */

+void CtreCanNode::UnregisterTx(uint32_t arbId)

+{

+	/* set period to zero */

+	ChangeTxPeriod(arbId, 0);

+	/* look and remove */

+	txJobs_t::iterator iter = _txJobs.find(arbId);

+	if(iter != _txJobs.end()) {

+		_txJobs.erase(iter);

+	}

+}

+timespec diff(const timespec & start, const timespec & end)

+{

+	timespec temp;

+	if ((end.tv_nsec-start.tv_nsec)<0) {

+		temp.tv_sec = end.tv_sec-start.tv_sec-1;

+		temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;

+	} else {

+		temp.tv_sec = end.tv_sec-start.tv_sec;

+		temp.tv_nsec = end.tv_nsec-start.tv_nsec;

+	}

+	return temp;

+}

+CTR_Code CtreCanNode::GetRx(uint32_t arbId,uint8_t * dataBytes, uint32_t timeoutMs)

+{

+	CTR_Code retval = CTR_OKAY;

+	int32_t status = 0;

+	uint8_t len = 0;

+	uint32_t timeStamp;

+	/* cap timeout at 999ms */

+	if(timeoutMs > 999)

+		timeoutMs = 999;

+	FRC_NetworkCommunication_CANSessionMux_receiveMessage(&arbId,kFullMessageIDMask,dataBytes,&len,&timeStamp,&status);

+	if(status == 0){

+		/* fresh update */

+		rxEvent_t & r = _rxRxEvents[arbId]; /* lookup entry or make a default new one with all zeroes */

+		clock_gettime(2,&r.time); 			/* fill in time */

+		memcpy(r.bytes,  dataBytes,  8);	/* fill in databytes */

+	}else{

+		/* did not get the message */

+		rxRxEvents_t::iterator i = _rxRxEvents.find(arbId);

+		if(i == _rxRxEvents.end()){

+			/* we've never gotten this mesage */

+			retval = CTR_RxTimeout;

+			/* fill caller's buffer with zeros */

+			memset(dataBytes,0,8);

+		}else{

+			/* we've gotten this message before but not recently */

+			memcpy(dataBytes,i->second.bytes,8);

+			/* get the time now */

+			struct timespec temp;

+			clock_gettime(2,&temp); /* get now */

+			/* how long has it been? */

+			temp = diff(i->second.time,temp); /* temp = now - last */

+			if(temp.tv_sec > 0){

+				retval = CTR_RxTimeout;

+			}else if(temp.tv_nsec > ((int32_t)timeoutMs*1000*1000)){

+				retval = CTR_RxTimeout;

+			}else {

+				/* our last update was recent enough */

+			}

+		}

+	}

+

+	return retval;

+}

+void CtreCanNode::FlushTx(uint32_t arbId)

+{

+	int32_t status = 0;

+	txJobs_t::iterator iter = _txJobs.find(arbId);

+	if(iter != _txJobs.end())

+		FRC_NetworkCommunication_CANSessionMux_sendMessage(	iter->second.arbId,

+															iter->second.toSend,

+															iter->second.dlc,

+															iter->second.periodMs,

+															&status);

+}

+/**

+ * Change the transmit period of an already scheduled CAN frame.

+ * This keeps the frame payload contents the same without caller having to perform

+ * a read-modify-write.

+ * @param arbId 	CAN Frame Arbitration ID.  Set BIT31 for 11bit ids, otherwise we use 29bit ids.

+ * @param periodMs	Period to transmit CAN frame.  Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.

+ * @return true if scheduled job was found and updated, false if there was no preceding job for the specified arbID.

+ */

+bool CtreCanNode::ChangeTxPeriod(uint32_t arbId, uint32_t periodMs)

+{

+	int32_t status = 0;

+	/* lookup the data bytes and period for this message */

+	txJobs_t::iterator iter = _txJobs.find(arbId);

+	if(iter != _txJobs.end()) {

+		/* modify th periodMs */

+		iter->second.periodMs = periodMs;

+		/* reinsert into scheduler with the same data bytes, only the period changed. */

+		FRC_NetworkCommunication_CANSessionMux_sendMessage(	iter->second.arbId,

+															iter->second.toSend,

+															iter->second.dlc,

+															iter->second.periodMs,

+															&status);

+		return true;

+	}

+	return false;

+}

+

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/CtreCanNode.h b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/CtreCanNode.h
new file mode 100644
index 0000000..2707598
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/CtreCanNode.h
@@ -0,0 +1,131 @@
+#ifndef CtreCanNode_H_

+#define CtreCanNode_H_

+#include "ctre.h"				//BIT Defines + Typedefs

+#include <map>

+#include <string.h> // memcpy

+#include <sys/time.h>

+class CtreCanNode

+{

+public:

+	CtreCanNode(UINT8 deviceNumber);

+    ~CtreCanNode();

+

+	UINT8 GetDeviceNumber()

+	{

+		return _deviceNumber;

+	}

+protected:

+

+

+	template <typename T> class txTask{

+		public:

+			uint32_t arbId;

+			T * toSend;

+			T * operator -> ()

+			{

+				return toSend;

+			}

+			T & operator*()

+			{

+				return *toSend;

+			}

+			bool IsEmpty()

+			{

+				if(toSend == 0)

+					return true;

+				return false;

+			}

+	};

+	template <typename T> class recMsg{

+		public:

+			uint32_t arbId;

+			uint8_t bytes[8];

+			CTR_Code err;

+			T * operator -> ()

+			{

+				return (T *)bytes;

+			}

+			T & operator*()

+			{

+				return *(T *)bytes;

+			}

+	};

+	UINT8 _deviceNumber;

+	void RegisterRx(uint32_t arbId);

+	/**

+	 * Schedule a CAN Frame for periodic transmit.  Assume eight byte DLC and zero value for initial transmission.

+	 * @param arbId 	CAN Frame Arbitration ID.  Set BIT31 for 11bit ids, otherwise we use 29bit ids.

+	 * @param periodMs	Period to transmit CAN frame.  Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.

+	 */

+	void RegisterTx(uint32_t arbId, uint32_t periodMs);

+	/**

+	 * Schedule a CAN Frame for periodic transmit.

+	 * @param arbId 	CAN Frame Arbitration ID.  Set BIT31 for 11bit ids, otherwise we use 29bit ids.

+	 * @param periodMs	Period to transmit CAN frame.  Pass 0 for one-shot, which also disables that ArbID's preceding periodic transmit.

+	 * @param dlc 		Number of bytes to transmit (0 to 8).

+	 * @param initialFrame	Ptr to the frame data to schedule for transmitting.  Passing null will result

+	 *						in defaulting to zero data value.

+	 */

+	void RegisterTx(uint32_t arbId, uint32_t periodMs, uint32_t dlc, const uint8_t * initialFrame);

+	void UnregisterTx(uint32_t arbId);

+

+	CTR_Code GetRx(uint32_t arbId,uint8_t * dataBytes,uint32_t timeoutMs);

+	void FlushTx(uint32_t arbId);

+	bool ChangeTxPeriod(uint32_t arbId, uint32_t periodMs);

+

+	template<typename T> txTask<T> GetTx(uint32_t arbId)

+	{

+		txTask<T> retval = {0, nullptr};

+		txJobs_t::iterator i = _txJobs.find(arbId);

+		if(i != _txJobs.end()){

+			retval.arbId = i->second.arbId;

+			retval.toSend = (T*)i->second.toSend;

+		}

+		return retval;

+	}

+	template<class T> void FlushTx(T & par)

+	{

+		FlushTx(par.arbId);

+	}

+

+	template<class T> recMsg<T> GetRx(uint32_t arbId, uint32_t timeoutMs)

+	{

+		recMsg<T> retval;

+		retval.err = GetRx(arbId,retval.bytes, timeoutMs);

+		return retval;

+	}

+

+private:

+

+	class txJob_t {

+		public:

+			uint32_t arbId;

+			uint8_t toSend[8];

+			uint32_t periodMs;

+			uint8_t dlc;

+	};

+

+	class rxEvent_t{

+		public:

+			uint8_t bytes[8];

+			struct timespec time;

+			rxEvent_t()

+			{

+				bytes[0] = 0;

+				bytes[1] = 0;

+				bytes[2] = 0;

+				bytes[3] = 0;

+				bytes[4] = 0;

+				bytes[5] = 0;

+				bytes[6] = 0;

+				bytes[7] = 0;

+			}

+	};

+

+	typedef std::map<uint32_t,txJob_t> txJobs_t;

+	txJobs_t _txJobs;

+

+	typedef std::map<uint32_t,rxEvent_t> rxRxEvents_t;

+	rxRxEvents_t _rxRxEvents;

+};

+#endif

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PCM.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PCM.cpp
new file mode 100644
index 0000000..0839408
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PCM.cpp
@@ -0,0 +1,574 @@
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"

+

+#include "PCM.h"

+#include "FRC_NetworkCommunication/CANSessionMux.h"

+#include <string.h> // memset

+/* This can be a constant, as long as nobody needs to update solenoids within

+    1/50 of a second. */

+static const INT32 kCANPeriod = 20;

+

+#define STATUS_1  			0x9041400

+#define STATUS_SOL_FAULTS  	0x9041440

+#define STATUS_DEBUG  		0x9041480

+

+#define EXPECTED_RESPONSE_TIMEOUT_MS	(50)

+#define GET_PCM_STATUS()			CtreCanNode::recMsg<PcmStatus_t> 		rx = GetRx<PcmStatus_t>			(STATUS_1|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+#define GET_PCM_SOL_FAULTS()		CtreCanNode::recMsg<PcmStatusFault_t> 	rx = GetRx<PcmStatusFault_t>	(STATUS_SOL_FAULTS|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+#define GET_PCM_DEBUG()				CtreCanNode::recMsg<PcmDebug_t> 		rx = GetRx<PcmDebug_t>			(STATUS_DEBUG|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+

+#define CONTROL_1 			0x09041C00	/* PCM_Control */

+#define CONTROL_2 			0x09041C40	/* PCM_SupplemControl */

+#define CONTROL_3 			0x09041C80	/* PcmControlSetOneShotDur_t */

+

+/* encoder/decoders */

+typedef struct _PcmStatus_t{

+	/* Byte 0 */

+	unsigned SolenoidBits:8;

+	/* Byte 1 */

+	unsigned compressorOn:1;

+	unsigned stickyFaultFuseTripped:1;

+	unsigned stickyFaultCompCurrentTooHigh:1;

+	unsigned faultFuseTripped:1;

+	unsigned faultCompCurrentTooHigh:1;

+	unsigned faultHardwareFailure:1;

+	unsigned isCloseloopEnabled:1;

+	unsigned pressureSwitchEn:1;

+	/* Byte 2*/

+	unsigned battVoltage:8;

+	/* Byte 3 */

+	unsigned solenoidVoltageTop8:8;

+	/* Byte 4 */

+	unsigned compressorCurrentTop6:6;

+	unsigned solenoidVoltageBtm2:2;

+	/* Byte 5 */

+	unsigned StickyFault_dItooHigh :1;

+	unsigned Fault_dItooHigh :1;

+	unsigned moduleEnabled:1;

+	unsigned closedLoopOutput:1;

+	unsigned compressorCurrentBtm4:4;

+	/* Byte 6 */

+	unsigned tokenSeedTop8:8;

+	/* Byte 7 */

+	unsigned tokenSeedBtm8:8;

+}PcmStatus_t;

+

+typedef struct _PcmControl_t{

+	/* Byte 0 */

+	unsigned tokenTop8:8;

+	/* Byte 1 */

+	unsigned tokenBtm8:8;

+	/* Byte 2 */

+	unsigned solenoidBits:8;

+	/* Byte 3*/

+	unsigned reserved:4;

+	unsigned closeLoopOutput:1;

+	unsigned compressorOn:1;

+	unsigned closedLoopEnable:1;

+	unsigned clearStickyFaults:1;

+	/* Byte 4 */

+	unsigned OneShotField_h8:8;

+	/* Byte 5 */

+	unsigned OneShotField_l8:8;

+}PcmControl_t;

+

+typedef struct _PcmControlSetOneShotDur_t{

+	uint8_t sol10MsPerUnit[8];

+}PcmControlSetOneShotDur_t;

+

+typedef struct _PcmStatusFault_t{

+	/* Byte 0 */

+	unsigned SolenoidBlacklist:8;

+	/* Byte 1 */

+	unsigned reserved_bit0 :1;

+	unsigned reserved_bit1 :1;

+	unsigned reserved_bit2 :1;

+	unsigned reserved_bit3 :1;

+	unsigned StickyFault_CompNoCurrent :1;

+	unsigned Fault_CompNoCurrent :1;

+	unsigned StickyFault_SolenoidJumper :1;

+	unsigned Fault_SolenoidJumper :1;

+}PcmStatusFault_t;

+

+typedef struct _PcmDebug_t{

+	unsigned tokFailsTop8:8;

+	unsigned tokFailsBtm8:8;

+	unsigned lastFailedTokTop8:8;

+	unsigned lastFailedTokBtm8:8;

+	unsigned tokSuccessTop8:8;

+	unsigned tokSuccessBtm8:8;

+}PcmDebug_t;

+

+

+/* PCM Constructor - Clears all vars, establishes default settings, starts PCM background process

+ *

+ * @Return	-	void

+ *

+ * @Param 	-	deviceNumber	- 	Device ID of PCM to be controlled

+ */

+PCM::PCM(UINT8 deviceNumber): CtreCanNode(deviceNumber)

+{

+	RegisterRx(STATUS_1 | deviceNumber );

+	RegisterRx(STATUS_SOL_FAULTS | deviceNumber );

+	RegisterRx(STATUS_DEBUG | deviceNumber );

+	RegisterTx(CONTROL_1 | deviceNumber, kCANPeriod);

+	/* enable close loop */

+	SetClosedLoopControl(1);

+}

+/* PCM D'tor

+ */

+PCM::~PCM()

+{

+

+}

+

+/* Set PCM solenoid state

+ *

+ * @Return	-	CTR_Code	-	Error code (if any) for setting solenoid

+ *

+ * @Param 	-	idx			- 	ID of solenoid (0-7)

+ * @Param 	-	en			- 	Enable / Disable identified solenoid

+ */

+CTR_Code PCM::SetSolenoid(unsigned char idx, bool en)

+{

+	CtreCanNode::txTask<PcmControl_t> toFill = GetTx<PcmControl_t>(CONTROL_1 | GetDeviceNumber());

+	if(toFill.IsEmpty())return CTR_UnexpectedArbId;

+	if (en)

+		toFill->solenoidBits |= (1ul << (idx));

+	else

+		toFill->solenoidBits &= ~(1ul << (idx));

+	FlushTx(toFill);

+	return CTR_OKAY;

+}

+

+/* Set all PCM solenoid states

+ *

+ * @Return	-	CTR_Code	-	Error code (if any) for setting solenoids

+ * @Param 	-	state			Bitfield to set all solenoids to

+ */

+CTR_Code PCM::SetAllSolenoids(UINT8 state) {

+	CtreCanNode::txTask<PcmControl_t> toFill = GetTx<PcmControl_t>(CONTROL_1 | GetDeviceNumber());

+	if(toFill.IsEmpty())return CTR_UnexpectedArbId;

+	toFill->solenoidBits = state;

+	FlushTx(toFill);

+	return CTR_OKAY;

+}

+

+/* Clears PCM sticky faults (indicators of past faults

+ *

+ * @Return	-	CTR_Code	-	Error code (if any) for setting solenoid

+ *

+ * @Param 	-	clr		- 	Clear / do not clear faults

+ */

+CTR_Code PCM::ClearStickyFaults()

+{

+	int32_t status = 0;

+	uint8_t pcmSupplemControl[] = { 0, 0, 0, 0x80 }; /* only bit set is ClearStickyFaults */

+	FRC_NetworkCommunication_CANSessionMux_sendMessage(CONTROL_2  | GetDeviceNumber(), pcmSupplemControl, sizeof(pcmSupplemControl), 0, &status);

+	if(status)

+		return CTR_TxFailed;

+	return CTR_OKAY;

+}

+

+/* Enables PCM Closed Loop Control of Compressor via pressure switch

+ *

+ * @Return	-	CTR_Code	-	Error code (if any) for setting solenoid

+ *

+ * @Param 	-	en		- 	Enable / Disable Closed Loop Control

+ */

+CTR_Code PCM::SetClosedLoopControl(bool en)

+{

+	CtreCanNode::txTask<PcmControl_t> toFill = GetTx<PcmControl_t>(CONTROL_1 | GetDeviceNumber());

+	if(toFill.IsEmpty())return CTR_UnexpectedArbId;

+	toFill->closedLoopEnable = en;

+	FlushTx(toFill);

+	return CTR_OKAY;

+}

+/* Get solenoid Blacklist status

+ * @Return	-	CTR_Code	-	Error code (if any)

+ * @Param	-	idx			-	ID of solenoid [0,7] to fire one shot pulse.

+ */

+CTR_Code PCM::FireOneShotSolenoid(UINT8 idx)

+{

+	CtreCanNode::txTask<PcmControl_t> toFill = GetTx<PcmControl_t>(CONTROL_1 | GetDeviceNumber());

+	if(toFill.IsEmpty())return CTR_UnexpectedArbId;

+	/* grab field as it is now */

+	uint16_t oneShotField;

+	oneShotField = toFill->OneShotField_h8;

+	oneShotField <<= 8;

+	oneShotField |= toFill->OneShotField_l8;

+	/* get the caller's channel */

+	uint16_t shift = 2*idx;

+	uint16_t mask = 3; /* two bits wide */

+	uint8_t chBits = (oneShotField >> shift) & mask;

+	/* flip it */

+	chBits = (chBits)%3 + 1;

+	/* clear out 2bits for this channel*/

+	oneShotField &= ~(mask << shift);

+	/* put new field in */

+	oneShotField |= chBits << shift;

+	/* apply field as it is now */

+	toFill->OneShotField_h8 = oneShotField >> 8;

+	toFill->OneShotField_l8 = oneShotField;

+	FlushTx(toFill);

+	return CTR_OKAY;

+}

+/* Configure the pulse width of a solenoid channel for one-shot pulse.

+ * Preprogrammed pulsewidth is 10ms resolution and can be between 10ms and

+ * 2.55s.

+ *

+ * @Return	-	CTR_Code	-	Error code (if any)

+ * @Param	-	idx			-	ID of solenoid [0,7] to configure.

+ * @Param	-	durMs		-	pulse width in ms.

+ */

+CTR_Code PCM::SetOneShotDurationMs(UINT8 idx,uint32_t durMs)

+{

+	/* sanity check caller's param */

+	if(idx > 7)

+		return CTR_InvalidParamValue;

+	/* get latest tx frame */

+	CtreCanNode::txTask<PcmControlSetOneShotDur_t> toFill = GetTx<PcmControlSetOneShotDur_t>(CONTROL_3 | GetDeviceNumber());

+	if(toFill.IsEmpty()){

+		/* only send this out if caller wants to do one-shots */

+		RegisterTx(CONTROL_3 | _deviceNumber, kCANPeriod);

+		/* grab it */

+		toFill = GetTx<PcmControlSetOneShotDur_t>(CONTROL_3 | GetDeviceNumber());

+	}

+	toFill->sol10MsPerUnit[idx] = std::min(durMs/10,(uint32_t)0xFF);

+	/* apply the new data bytes */

+	FlushTx(toFill);

+	return CTR_OKAY;

+}

+

+/* Get solenoid state

+ *

+ * @Return	-	True/False	-	True if solenoid enabled, false otherwise

+ *

+ * @Param 	-	idx		- 	ID of solenoid (0-7) to return status of

+ */

+CTR_Code PCM::GetSolenoid(UINT8 idx, bool &status)

+{

+	GET_PCM_STATUS();

+	status = (rx->SolenoidBits & (1ul<<(idx)) ) ? 1 : 0;

+	return rx.err;

+}

+

+/* Get solenoid state for all solenoids on the PCM

+ *

+ * @Return	-	Bitfield of solenoid states

+ */

+CTR_Code PCM::GetAllSolenoids(UINT8 &status)

+{

+	GET_PCM_STATUS();

+	status = rx->SolenoidBits;

+	return rx.err;

+}

+

+/* Get pressure switch state

+ *

+ * @Return	-	True/False	-	True if pressure adequate, false if low

+ */

+CTR_Code PCM::GetPressure(bool &status)

+{

+	GET_PCM_STATUS();

+	status = (rx->pressureSwitchEn ) ? 1 : 0;

+	return rx.err;

+}

+

+/* Get compressor state

+ *

+ * @Return	-	True/False	-	True if enabled, false if otherwise

+ */

+CTR_Code PCM::GetCompressor(bool &status)

+{

+	GET_PCM_STATUS();

+	status = (rx->compressorOn);

+	return rx.err;

+}

+

+/* Get closed loop control state

+ *

+ * @Return	-	True/False	-	True if closed loop enabled, false if otherwise

+ */

+CTR_Code PCM::GetClosedLoopControl(bool &status)

+{

+	GET_PCM_STATUS();

+	status = (rx->isCloseloopEnabled);

+	return rx.err;

+}

+

+/* Get compressor current draw

+ *

+ * @Return	-	Amperes	-	Compressor current

+ */

+CTR_Code PCM::GetCompressorCurrent(float &status)

+{

+	GET_PCM_STATUS();

+	uint32_t temp =(rx->compressorCurrentTop6);

+	temp <<= 4;

+	temp |=  rx->compressorCurrentBtm4;

+	status = temp * 0.03125; /* 5.5 fixed pt value in Amps */

+	return rx.err;

+}

+

+/* Get voltage across solenoid rail

+ *

+ * @Return	-	Volts	-	Voltage across solenoid rail

+ */

+CTR_Code PCM::GetSolenoidVoltage(float &status)

+{

+	GET_PCM_STATUS();

+	uint32_t raw =(rx->solenoidVoltageTop8);

+	raw <<= 2;

+	raw |=  rx->solenoidVoltageBtm2;

+	status = (double) raw * 0.03125; /* 5.5 fixed pt value in Volts */

+	return rx.err;

+}

+

+/* Get hardware fault value

+ *

+ * @Return	-	True/False	-	True if hardware failure detected, false if otherwise

+ */

+CTR_Code PCM::GetHardwareFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->faultHardwareFailure;

+	return rx.err;

+}

+

+/* Get compressor fault value

+ *

+ * @Return	-	True/False	-	True if shorted compressor detected, false if otherwise

+ */

+CTR_Code PCM::GetCompressorCurrentTooHighFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->faultCompCurrentTooHigh;

+	return rx.err;

+}

+CTR_Code PCM::GetCompressorShortedStickyFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->StickyFault_dItooHigh;

+	return rx.err;

+}

+CTR_Code PCM::GetCompressorShortedFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->Fault_dItooHigh;

+	return rx.err;

+}

+CTR_Code PCM::GetCompressorNotConnectedStickyFault(bool &status)

+{

+	GET_PCM_SOL_FAULTS();

+	status = rx->StickyFault_CompNoCurrent;

+	return rx.err;

+}

+CTR_Code PCM::GetCompressorNotConnectedFault(bool &status)

+{

+	GET_PCM_SOL_FAULTS();

+	status = rx->Fault_CompNoCurrent;

+	return rx.err;

+}

+

+/* Get solenoid fault value

+ *

+ * @Return	-	True/False	-	True if shorted solenoid detected, false if otherwise

+ */

+CTR_Code PCM::GetSolenoidFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->faultFuseTripped;

+	return rx.err;

+}

+

+/* Get compressor sticky fault value

+ *

+ * @Return	-	True/False	-	True if solenoid had previously been shorted

+ * 								(and sticky fault was not cleared), false if otherwise

+ */

+CTR_Code PCM::GetCompressorCurrentTooHighStickyFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->stickyFaultCompCurrentTooHigh;

+	return rx.err;

+}

+

+/* Get solenoid sticky fault value

+ *

+ * @Return	-	True/False	-	True if compressor had previously been shorted

+ * 								(and sticky fault was not cleared), false if otherwise

+ */

+CTR_Code PCM::GetSolenoidStickyFault(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->stickyFaultFuseTripped;

+	return rx.err;

+}

+/* Get battery voltage

+ *

+ * @Return	-	Volts	-	Voltage across PCM power ports

+ */

+CTR_Code PCM::GetBatteryVoltage(float &status)

+{

+	GET_PCM_STATUS();

+	status = (float)rx->battVoltage * 0.05 + 4.0; /* 50mV per unit plus 4V. */

+	return rx.err;

+}

+/* Return status of module enable/disable

+ *

+ * @Return	-	bool		-	Returns TRUE if PCM is enabled, FALSE if disabled

+ */

+CTR_Code PCM::isModuleEnabled(bool &status)

+{

+	GET_PCM_STATUS();

+	status = rx->moduleEnabled;

+	return rx.err;

+}

+/* Get number of total failed PCM Control Frame

+ *

+ * @Return	-	Failed Control Frames	-	Number of failed control frames (tokenization fails)

+ *

+ * @WARNING	-	Return only valid if [SeekDebugFrames] is enabled

+ * 				See function SeekDebugFrames

+ * 				See function EnableSeekDebugFrames

+ */

+CTR_Code PCM::GetNumberOfFailedControlFrames(UINT16 &status)

+{

+	GET_PCM_DEBUG();

+	status = rx->tokFailsTop8;

+	status <<= 8;

+	status |= rx->tokFailsBtm8;

+	return rx.err;

+}

+/* Get raw Solenoid Blacklist

+ *

+ * @Return	-	BINARY	-	Raw binary breakdown of Solenoid Blacklist

+ * 							BIT7 = Solenoid 1, BIT6 = Solenoid 2, etc.

+ *

+ * @WARNING	-	Return only valid if [SeekStatusFaultFrames] is enabled

+ * 				See function SeekStatusFaultFrames

+ * 				See function EnableSeekStatusFaultFrames

+ */

+CTR_Code PCM::GetSolenoidBlackList(UINT8 &status)

+{

+	GET_PCM_SOL_FAULTS();

+	status = rx->SolenoidBlacklist;

+	return rx.err;

+}

+/* Get solenoid Blacklist status

+ * - Blacklisted solenoids cannot be enabled until PCM is power cycled

+ *

+ * @Return	-	True/False	-	True if Solenoid is blacklisted, false if otherwise

+ *

+ * @Param	-	idx			-	ID of solenoid [0,7]

+ *

+ * @WARNING	-	Return only valid if [SeekStatusFaultFrames] is enabled

+ * 				See function SeekStatusFaultFrames

+ * 				See function EnableSeekStatusFaultFrames

+ */

+CTR_Code PCM::IsSolenoidBlacklisted(UINT8 idx, bool &status)

+{

+	GET_PCM_SOL_FAULTS();

+	status = (rx->SolenoidBlacklist & (1ul<<(idx)) )? 1 : 0;

+	return rx.err;

+}

+//------------------ C interface --------------------------------------------//

+extern "C" {

+	void * c_PCM_Init(void) {

+		return new PCM();

+	}

+	CTR_Code c_SetSolenoid(void * handle, unsigned char idx, INT8 param) {

+		return ((PCM*) handle)->SetSolenoid(idx, param);

+	}

+	CTR_Code c_SetAllSolenoids(void * handle, UINT8 state) {

+		return ((PCM*) handle)->SetAllSolenoids(state);

+	}

+	CTR_Code c_SetClosedLoopControl(void * handle, INT8 param) {

+		return ((PCM*) handle)->SetClosedLoopControl(param);

+	}

+	CTR_Code c_ClearStickyFaults(void * handle, INT8 param) {

+		return ((PCM*) handle)->ClearStickyFaults();

+	}

+	CTR_Code c_GetSolenoid(void * handle, UINT8 idx, INT8 * status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetSolenoid(idx, bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetAllSolenoids(void * handle, UINT8 * status) {

+		return ((PCM*) handle)->GetAllSolenoids(*status);

+	}

+	CTR_Code c_GetPressure(void * handle, INT8 * status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetPressure(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetCompressor(void * handle, INT8 * status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetCompressor(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetClosedLoopControl(void * handle, INT8 * status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetClosedLoopControl(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetCompressorCurrent(void * handle, float * status) {

+		CTR_Code retval = ((PCM*) handle)->GetCompressorCurrent(*status);

+		return retval;

+	}

+	CTR_Code c_GetSolenoidVoltage(void * handle, float*status) {

+		return ((PCM*) handle)->GetSolenoidVoltage(*status);

+	}

+	CTR_Code c_GetHardwareFault(void * handle, INT8*status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetHardwareFault(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetCompressorFault(void * handle, INT8*status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetCompressorCurrentTooHighFault(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetSolenoidFault(void * handle, INT8*status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetSolenoidFault(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetCompressorStickyFault(void * handle, INT8*status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetCompressorCurrentTooHighStickyFault(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetSolenoidStickyFault(void * handle, INT8*status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->GetSolenoidStickyFault(bstatus);

+		*status = bstatus;

+		return retval;

+	}

+	CTR_Code c_GetBatteryVoltage(void * handle, float*status) {

+		CTR_Code retval = ((PCM*) handle)->GetBatteryVoltage(*status);

+		return retval;

+	}

+	void c_SetDeviceNumber_PCM(void * handle, UINT8 deviceNumber) {

+	}

+	CTR_Code c_GetNumberOfFailedControlFrames(void * handle, UINT16*status) {

+		return ((PCM*) handle)->GetNumberOfFailedControlFrames(*status);

+	}

+	CTR_Code c_GetSolenoidBlackList(void * handle, UINT8 *status) {

+		return ((PCM*) handle)->GetSolenoidBlackList(*status);

+	}

+	CTR_Code c_IsSolenoidBlacklisted(void * handle, UINT8 idx, INT8*status) {

+		bool bstatus;

+		CTR_Code retval = ((PCM*) handle)->IsSolenoidBlacklisted(idx, bstatus);

+		*status = bstatus;

+		return retval;

+	}

+}

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PCM.h b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PCM.h
new file mode 100644
index 0000000..03d9b2d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PCM.h
@@ -0,0 +1,226 @@
+#ifndef PCM_H_

+#define PCM_H_

+#include "ctre.h"				//BIT Defines + Typedefs

+#include "CtreCanNode.h"

+class PCM : public CtreCanNode

+{

+public:

+    PCM(UINT8 deviceNumber=0);

+    ~PCM();

+

+    /* Set PCM solenoid state

+     *

+     * @Return	-	CTR_Code	-	Error code (if any) for setting solenoid

+     * @Param 	-	idx			- 	ID of solenoid (0-7)

+     * @Param 	-	en			- 	Enable / Disable identified solenoid

+     */

+    CTR_Code 	SetSolenoid(unsigned char idx, bool en);

+

+    /* Set all PCM solenoid states

+     *

+     * @Return	-	CTR_Code	-	Error code (if any) for setting solenoids

+     * @Param 	-	state			Bitfield to set all solenoids to

+     */

+    CTR_Code 	SetAllSolenoids(UINT8 state);

+

+    /* Enables PCM Closed Loop Control of Compressor via pressure switch

+     * @Return	-	CTR_Code	-	Error code (if any) for setting solenoid

+     * @Param 	-	en		- 	Enable / Disable Closed Loop Control

+     */

+    CTR_Code 	SetClosedLoopControl(bool en);

+

+    /* Clears PCM sticky faults (indicators of past faults

+     * @Return	-	CTR_Code	-	Error code (if any) for setting solenoid

+     */

+    CTR_Code 	ClearStickyFaults();

+

+    /* Get solenoid state

+     *

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param 	-	idx		- 	ID of solenoid (0-7) to return if solenoid is on.

+     * @Param	-	status	-	true if solenoid enabled, false otherwise

+     */

+    CTR_Code 	GetSolenoid(UINT8 idx, bool &status);

+

+    /* Get state of all solenoids

+     *

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status	-	bitfield of solenoid states

+     */

+    CTR_Code 	GetAllSolenoids(UINT8 &status);

+

+    /* Get pressure switch state

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if pressure adequate, false if low

+     */

+    CTR_Code 	GetPressure(bool &status);

+

+    /* Get compressor state

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if compress ouput is on, false if otherwise

+     */

+    CTR_Code	GetCompressor(bool &status);

+

+    /* Get closed loop control state

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status	-	True if closed loop enabled, false if otherwise

+     */

+    CTR_Code 	GetClosedLoopControl(bool &status);

+

+    /* Get compressor current draw

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	Compressor current returned in Amperes (A)

+     */

+    CTR_Code 	GetCompressorCurrent(float &status);

+

+    /* Get voltage across solenoid rail

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	Voltage across solenoid rail in Volts (V)

+     */

+    CTR_Code 	GetSolenoidVoltage(float &status);

+

+    /* Get hardware fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if hardware failure detected, false if otherwise

+     */

+    CTR_Code 	GetHardwareFault(bool &status);

+

+    /* Get compressor fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if abnormally high compressor current detected, false if otherwise

+     */

+    CTR_Code 	GetCompressorCurrentTooHighFault(bool &status);

+

+    /* Get solenoid fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if shorted solenoid detected, false if otherwise

+     */

+    CTR_Code 	GetSolenoidFault(bool &status);

+

+    /* Get compressor sticky fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if solenoid had previously been shorted

+     * 								(and sticky fault was not cleared), false if otherwise

+     */

+    CTR_Code 	GetCompressorCurrentTooHighStickyFault(bool &status);

+    /* Get compressor shorted sticky fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if compressor output is shorted, false if otherwise

+     */

+    CTR_Code 	GetCompressorShortedStickyFault(bool &status);

+    /* Get compressor shorted fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if compressor output is shorted, false if otherwise

+     */

+    CTR_Code 	GetCompressorShortedFault(bool &status);

+    /* Get compressor is not connected sticky fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if compressor current is too low,

+     * 					indicating compressor is not connected, false if otherwise

+     */

+    CTR_Code 	GetCompressorNotConnectedStickyFault(bool &status);

+    /* Get compressor is not connected fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if compressor current is too low,

+     * 					indicating compressor is not connected, false if otherwise

+     */

+    CTR_Code 	GetCompressorNotConnectedFault(bool &status);

+

+    /* Get solenoid sticky fault value

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	True if compressor had previously been shorted

+     * 								(and sticky fault was not cleared), false if otherwise

+     */

+    CTR_Code 	GetSolenoidStickyFault(bool &status);

+

+    /* Get battery voltage

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	Voltage across PCM power ports in Volts (V)

+     */

+    CTR_Code 	GetBatteryVoltage(float &status);

+

+    /* Set PCM Device Number and according CAN frame IDs

+     * @Return	-	void

+     * @Param	-	deviceNumber	-	Device number of PCM to control

+     */

+    void	SetDeviceNumber(UINT8 deviceNumber);

+    /* Get number of total failed PCM Control Frame

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	Number of failed control frames (tokenization fails)

+     * @WARNING	-	Return only valid if [SeekDebugFrames] is enabled

+     * 				See function SeekDebugFrames

+     * 				See function EnableSeekDebugFrames

+     */

+	CTR_Code GetNumberOfFailedControlFrames(UINT16 &status);

+

+    /* Get raw Solenoid Blacklist

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	Raw binary breakdown of Solenoid Blacklist

+     * 								BIT7 = Solenoid 1, BIT6 = Solenoid 2, etc.

+     * @WARNING	-	Return only valid if [SeekStatusFaultFrames] is enabled

+     * 				See function SeekStatusFaultFrames

+     * 				See function EnableSeekStatusFaultFrames

+     */

+    CTR_Code 	GetSolenoidBlackList(UINT8 &status);

+

+    /* Get solenoid Blacklist status

+     * - Blacklisted solenoids cannot be enabled until PCM is power cycled

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	idx			-	ID of solenoid [0,7]

+     * @Param	-	status		-	True if Solenoid is blacklisted, false if otherwise

+     * @WARNING	-	Return only valid if [SeekStatusFaultFrames] is enabled

+     * 				See function SeekStatusFaultFrames

+     * 				See function EnableSeekStatusFaultFrames

+     */

+    CTR_Code 	IsSolenoidBlacklisted(UINT8 idx, bool &status);

+

+    /* Return status of module enable/disable

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	status		-	Returns TRUE if PCM is enabled, FALSE if disabled

+     */

+    CTR_Code	isModuleEnabled(bool &status);

+

+    /* Get solenoid Blacklist status

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	idx			-	ID of solenoid [0,7] to fire one shot pulse.

+     */

+    CTR_Code FireOneShotSolenoid(UINT8 idx);

+

+    /* Configure the pulse width of a solenoid channel for one-shot pulse.

+	 * Preprogrammed pulsewidth is 10ms resolute and can be between 20ms and 5.1s.

+     * @Return	-	CTR_Code	-	Error code (if any)

+     * @Param	-	idx			-	ID of solenoid [0,7] to configure.

+     * @Param	-	durMs		-	pulse width in ms.

+     */

+    CTR_Code SetOneShotDurationMs(UINT8 idx,uint32_t durMs);

+

+};

+//------------------ C interface --------------------------------------------//

+extern "C" {

+	void * c_PCM_Init(void);

+	CTR_Code c_SetSolenoid(void * handle,unsigned char idx,INT8 param);

+	CTR_Code c_SetAllSolenoids(void * handle,UINT8 state);

+	CTR_Code c_SetClosedLoopControl(void * handle,INT8 param);

+	CTR_Code c_ClearStickyFaults(void * handle,INT8 param);

+	CTR_Code c_GetSolenoid(void * handle,UINT8 idx,INT8 * status);

+	CTR_Code c_GetAllSolenoids(void * handle,UINT8 * status);

+	CTR_Code c_GetPressure(void * handle,INT8 * status);

+	CTR_Code c_GetCompressor(void * handle,INT8 * status);

+	CTR_Code c_GetClosedLoopControl(void * handle,INT8 * status);

+	CTR_Code c_GetCompressorCurrent(void * handle,float * status);

+	CTR_Code c_GetSolenoidVoltage(void * handle,float*status);

+	CTR_Code c_GetHardwareFault(void * handle,INT8*status);

+	CTR_Code c_GetCompressorFault(void * handle,INT8*status);

+	CTR_Code c_GetSolenoidFault(void * handle,INT8*status);

+	CTR_Code c_GetCompressorStickyFault(void * handle,INT8*status);

+	CTR_Code c_GetSolenoidStickyFault(void * handle,INT8*status);

+	CTR_Code c_GetBatteryVoltage(void * handle,float*status);

+	void c_SetDeviceNumber_PCM(void * handle,UINT8 deviceNumber);

+	void c_EnableSeekStatusFrames(void * handle,INT8 enable);

+	void c_EnableSeekStatusFaultFrames(void * handle,INT8 enable);

+	void c_EnableSeekDebugFrames(void * handle,INT8 enable);

+	CTR_Code c_GetNumberOfFailedControlFrames(void * handle,UINT16*status);

+	CTR_Code c_GetSolenoidBlackList(void * handle,UINT8 *status);

+	CTR_Code c_IsSolenoidBlacklisted(void * handle,UINT8 idx,INT8*status);

+}

+#endif

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PDP.cpp b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PDP.cpp
new file mode 100644
index 0000000..61c6edb
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PDP.cpp
@@ -0,0 +1,230 @@
+#include "PDP.h"

+#include "FRC_NetworkCommunication/CANSessionMux.h"	//CAN Comm

+#include <string.h> // memset

+

+#define STATUS_1  		0x8041400

+#define STATUS_2  		0x8041440

+#define STATUS_3  		0x8041480

+#define STATUS_ENERGY	0x8041740

+

+#define CONTROL_1		0x08041C00	/* PDP_Control_ClearStats */

+

+#define EXPECTED_RESPONSE_TIMEOUT_MS	(50)

+#define GET_STATUS1()		CtreCanNode::recMsg<PdpStatus1_t> rx = GetRx<PdpStatus1_t>(STATUS_1|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+#define GET_STATUS2()		CtreCanNode::recMsg<PdpStatus2_t> rx = GetRx<PdpStatus2_t>(STATUS_2|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+#define GET_STATUS3()		CtreCanNode::recMsg<PdpStatus3_t> rx = GetRx<PdpStatus3_t>(STATUS_3|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+#define GET_STATUS_ENERGY()	CtreCanNode::recMsg<PDP_Status_Energy_t> rx = GetRx<PDP_Status_Energy_t>(STATUS_ENERGY|GetDeviceNumber(),EXPECTED_RESPONSE_TIMEOUT_MS)

+

+/* encoder/decoders */

+typedef struct _PdpStatus1_t{

+	unsigned chan1_h8:8;

+	unsigned chan2_h6:6;

+	unsigned chan1_l2:2;

+	unsigned chan3_h4:4;

+	unsigned chan2_l4:4;

+	unsigned chan4_h2:2;

+	unsigned chan3_l6:6;

+	unsigned chan4_l8:8;

+	unsigned chan5_h8:8;

+	unsigned chan6_h6:6;

+	unsigned chan5_l2:2;

+	unsigned reserved4:4;

+	unsigned chan6_l4:4;

+}PdpStatus1_t;

+typedef struct _PdpStatus2_t{

+	unsigned chan7_h8:8;

+	unsigned chan8_h6:6;

+	unsigned chan7_l2:2;

+	unsigned chan9_h4:4;

+	unsigned chan8_l4:4;

+	unsigned chan10_h2:2;

+	unsigned chan9_l6:6;

+	unsigned chan10_l8:8;

+	unsigned chan11_h8:8;

+	unsigned chan12_h6:6;

+	unsigned chan11_l2:2;

+	unsigned reserved4:4;

+	unsigned chan12_l4:4;

+}PdpStatus2_t;

+typedef struct _PdpStatus3_t{

+	unsigned chan13_h8:8;

+	unsigned chan14_h6:6;

+	unsigned chan13_l2:2;

+	unsigned chan15_h4:4;

+	unsigned chan14_l4:4;

+	unsigned chan16_h2:2;

+	unsigned chan15_l6:6;

+	unsigned chan16_l8:8;

+	unsigned internalResBattery_mOhms:8;

+	unsigned busVoltage:8;

+	unsigned temp:8;

+}PdpStatus3_t;

+typedef struct _PDP_Status_Energy_t {

+	unsigned TmeasMs_likelywillbe20ms_:8;

+	unsigned TotalCurrent_125mAperunit_h8:8;

+	unsigned Power_125mWperunit_h4:4;

+	unsigned TotalCurrent_125mAperunit_l4:4;

+	unsigned Power_125mWperunit_m8:8;

+	unsigned Energy_125mWPerUnitXTmeas_h4:4;

+	unsigned Power_125mWperunit_l4:4;

+	unsigned Energy_125mWPerUnitXTmeas_mh8:8;

+	unsigned Energy_125mWPerUnitXTmeas_ml8:8;

+	unsigned Energy_125mWPerUnitXTmeas_l8:8;

+} PDP_Status_Energy_t ;

+

+PDP::PDP(UINT8 deviceNumber): CtreCanNode(deviceNumber)

+{

+	RegisterRx(STATUS_1 | deviceNumber );

+	RegisterRx(STATUS_2 | deviceNumber );

+	RegisterRx(STATUS_3 | deviceNumber );

+}

+/* PDP D'tor

+ */

+PDP::~PDP()

+{

+}

+

+CTR_Code PDP::GetChannelCurrent(UINT8 idx, double &current)

+{

+	CTR_Code retval = CTR_InvalidParamValue;

+	uint32_t raw = 0;

+

+	if(idx <= 5){

+		GET_STATUS1();

+	    retval = rx.err;

+		switch(idx){

+			case 0:	raw = ((uint32_t)rx->chan1_h8 << 2) | rx->chan1_l2;	break;

+			case 1:	raw = ((uint32_t)rx->chan2_h6 << 4) | rx->chan2_l4;	break;

+			case 2:	raw = ((uint32_t)rx->chan3_h4 << 6) | rx->chan3_l6;	break;

+			case 3:	raw = ((uint32_t)rx->chan4_h2 << 8) | rx->chan4_l8;	break;

+			case 4:	raw = ((uint32_t)rx->chan5_h8 << 2) | rx->chan5_l2;	break;

+			case 5:	raw = ((uint32_t)rx->chan6_h6 << 4) | rx->chan6_l4;	break;

+			default:	retval = CTR_InvalidParamValue;	break;

+		}

+	}else if(idx <= 11){

+		GET_STATUS2();

+	    retval = rx.err;

+		switch(idx){

+			case  6:	raw = ((uint32_t)rx->chan7_h8  << 2) | rx->chan7_l2;	break;

+			case  7:	raw = ((uint32_t)rx->chan8_h6  << 4) | rx->chan8_l4;	break;

+			case  8:	raw = ((uint32_t)rx->chan9_h4  << 6) | rx->chan9_l6;	break;

+			case  9:	raw = ((uint32_t)rx->chan10_h2 << 8) | rx->chan10_l8;	break;

+			case 10:	raw = ((uint32_t)rx->chan11_h8 << 2) | rx->chan11_l2;	break;

+			case 11:	raw = ((uint32_t)rx->chan12_h6 << 4) | rx->chan12_l4;	break;

+			default:	retval = CTR_InvalidParamValue;	break;

+		}

+	}else if(idx <= 15){

+		GET_STATUS3();

+	    retval = rx.err;

+		switch(idx){

+			case 12:	raw = ((uint32_t)rx->chan13_h8  << 2) | rx->chan13_l2;	break;

+			case 13:	raw = ((uint32_t)rx->chan14_h6  << 4) | rx->chan14_l4;	break;

+			case 14:	raw = ((uint32_t)rx->chan15_h4  << 6) | rx->chan15_l6;	break;

+			case 15:	raw = ((uint32_t)rx->chan16_h2  << 8) | rx->chan16_l8;	break;

+			default:	retval = CTR_InvalidParamValue;	break;

+		}

+	}

+	/* convert to amps */

+	current = (double)raw * 0.125;  /* 7.3 fixed pt value in Amps */

+	/* signal caller with success */

+	return retval;

+}

+CTR_Code PDP::GetVoltage(double &voltage)

+{

+	GET_STATUS3();

+	uint32_t raw = rx->busVoltage;

+	voltage = (double)raw * 0.05 + 4.0; /* 50mV per unit plus 4V. */;

+	return rx.err;

+}

+CTR_Code PDP::GetTemperature(double &tempC)

+{

+	GET_STATUS3();

+	uint32_t raw = rx->temp;

+	tempC =	(double)raw * 1.03250836957542 - 67.8564500484966;

+	return rx.err;

+}

+CTR_Code PDP::GetTotalCurrent(double &currentAmps)

+{

+	GET_STATUS_ENERGY();

+	uint32_t raw;

+	raw = rx->TotalCurrent_125mAperunit_h8;

+	raw <<= 4;

+	raw |=  rx->TotalCurrent_125mAperunit_l4;

+	currentAmps = 0.125 * raw;

+	return rx.err;

+}

+CTR_Code PDP::GetTotalPower(double &powerWatts)

+{

+	GET_STATUS_ENERGY();

+	uint32_t raw;

+	raw = rx->Power_125mWperunit_h4;

+	raw <<= 8;

+	raw |=  rx->Power_125mWperunit_m8;

+	raw <<= 4;

+	raw |=  rx->Power_125mWperunit_l4;

+	powerWatts = 0.125 * raw;

+	return rx.err;

+}

+CTR_Code PDP::GetTotalEnergy(double &energyJoules)

+{

+	GET_STATUS_ENERGY();

+	uint32_t raw;

+	raw = rx->Energy_125mWPerUnitXTmeas_h4;

+	raw <<= 8;

+	raw |=  rx->Energy_125mWPerUnitXTmeas_mh8;

+	raw <<= 8;

+	raw |=  rx->Energy_125mWPerUnitXTmeas_ml8;

+	raw <<= 8;

+	raw |=  rx->Energy_125mWPerUnitXTmeas_l8;

+	energyJoules = 0.125 * raw; 						/* mW integrated every TmeasMs */

+	energyJoules *= 0.001;								/* convert from mW to W */

+	energyJoules *= rx->TmeasMs_likelywillbe20ms_;		/* multiplied by TmeasMs = joules */

+	return rx.err;

+}

+/* Clear sticky faults.

+ * @Return	-	CTR_Code	-	Error code (if any)

+ */

+CTR_Code PDP::ClearStickyFaults()

+{

+	int32_t status = 0;

+	uint8_t pdpControl[] = { 0x80 }; /* only bit set is ClearStickyFaults */

+	FRC_NetworkCommunication_CANSessionMux_sendMessage(CONTROL_1  | GetDeviceNumber(), pdpControl, sizeof(pdpControl), 0, &status);

+	if(status)

+		return CTR_TxFailed;

+	return CTR_OKAY;

+}

+

+/* Reset Energy Signals

+ * @Return	-	CTR_Code	-	Error code (if any)

+ */

+CTR_Code PDP::ResetEnergy()

+{

+	int32_t status = 0;

+	uint8_t pdpControl[] = { 0x40 }; /* only bit set is ResetEnergy */

+	FRC_NetworkCommunication_CANSessionMux_sendMessage(CONTROL_1  | GetDeviceNumber(), pdpControl, sizeof(pdpControl), 0, &status);

+	if(status)

+		return CTR_TxFailed;

+	return CTR_OKAY;

+}

+//------------------ C interface --------------------------------------------//

+extern "C" {

+	void * c_PDP_Init(void)

+	{

+		return new PDP();

+	}

+	CTR_Code c_GetChannelCurrent(void * handle,UINT8 idx, double *status)

+	{

+		return ((PDP*)handle)-> GetChannelCurrent(idx,*status);

+	}

+	CTR_Code c_GetVoltage(void * handle,double *status)

+	{

+		return ((PDP*)handle)-> GetVoltage(*status);

+	}

+	CTR_Code c_GetTemperature(void * handle,double *status)

+	{

+		return ((PDP*)handle)-> GetTemperature(*status);

+	}

+	void c_SetDeviceNumber_PDP(void * handle,UINT8 deviceNumber)

+	{

+	}

+}

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PDP.h b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PDP.h
new file mode 100644
index 0000000..b968a44
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/PDP.h
@@ -0,0 +1,62 @@
+#ifndef PDP_H_

+#define PDP_H_

+#include "ctre.h"				//BIT Defines + Typedefs

+#include "CtreCanNode.h"

+class PDP : public CtreCanNode

+{

+public:

+    /* Get PDP Channel Current

+     *

+     * @Param	-	deviceNumber	-	Device ID for PDP. Factory default is 60. Function defaults to 60.

+     */

+    PDP(UINT8 deviceNumber=0);

+    ~PDP();

+    /* Get PDP Channel Current

+     *

+     * @Return	-	CTR_Code	-	Error code (if any)

+     *

+     * @Param	-	idx			-	ID of channel to return current for (channels 1-16)

+     *

+     * @Param	-	status		-	Current of channel 'idx' in Amps (A)

+     */

+    CTR_Code GetChannelCurrent(UINT8 idx, double &status);

+

+    /* Get Bus Voltage of PDP

+     *

+     * @Return	-	CTR_Code	- 	Error code (if any)

+     *

+     * @Param	-	status		- 	Voltage (V) across PDP

+     */

+    CTR_Code GetVoltage(double &status);

+

+    /* Get Temperature of PDP

+     *

+     * @Return	-	CTR_Code	-	Error code (if any)

+     *

+     * @Param	-	status		-	Temperature of PDP in Centigrade / Celcius (C)

+     */

+    CTR_Code GetTemperature(double &status);

+

+	CTR_Code GetTotalCurrent(double &currentAmps);

+	CTR_Code GetTotalPower(double &powerWatts);

+	CTR_Code GetTotalEnergy(double &energyJoules);

+    /* Clear sticky faults.

+     * @Return	-	CTR_Code	-	Error code (if any)

+     */

+	CTR_Code ClearStickyFaults();

+

+	/* Reset Energy Signals

+	 * @Return	-	CTR_Code	-	Error code (if any)

+	 */

+	CTR_Code ResetEnergy();

+private:

+    uint64_t ReadCurrents(uint8_t api);

+};

+extern "C" {

+	void * c_PDP_Init();

+	CTR_Code c_GetChannelCurrent(void * handle,UINT8 idx, double *status);

+	CTR_Code c_GetVoltage(void * handle,double *status);

+	CTR_Code c_GetTemperature(void * handle,double *status);

+	void c_SetDeviceNumber_PDP(void * handle,UINT8 deviceNumber);

+}

+#endif /* PDP_H_ */

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/ctre.h b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/ctre.h
new file mode 100644
index 0000000..89c5c4d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/ctre/ctre.h
@@ -0,0 +1,55 @@
+/**

+ * @file ctre.h

+ * Common header for all CTRE HAL modules.

+ */

+#ifndef CTRE_H

+#define CTRE_H

+

+//Bit Defines

+#define BIT0 0x01

+#define BIT1 0x02

+#define BIT2 0x04

+#define BIT3 0x08

+#define BIT4 0x10

+#define BIT5 0x20

+#define BIT6 0x40

+#define BIT7 0x80

+#define BIT8  0x0100

+#define BIT9  0x0200

+#define BIT10 0x0400

+#define BIT11 0x0800

+#define BIT12 0x1000

+#define BIT13 0x2000

+#define BIT14 0x4000

+#define BIT15 0x8000

+

+//Signed

+typedef	signed char	INT8;

+typedef	signed short	INT16;

+typedef	signed int	INT32;

+typedef	signed long long INT64;

+

+//Unsigned

+typedef	unsigned char	UINT8;

+typedef	unsigned short	UINT16;

+typedef	unsigned int	UINT32;

+typedef	unsigned long long UINT64;

+

+//Other

+typedef	unsigned char	UCHAR;

+typedef unsigned short	USHORT;

+typedef	unsigned int	UINT;

+typedef unsigned long	ULONG;

+

+typedef enum {

+		CTR_OKAY,				//!< No Error - Function executed as expected

+		CTR_RxTimeout,			//!< CAN frame has not been received within specified period of time.

+		CTR_TxTimeout,			//!< Not used.

+		CTR_InvalidParamValue, 	//!< Caller passed an invalid param

+		CTR_UnexpectedArbId,	//!< Specified CAN Id is invalid.

+		CTR_TxFailed,			//!< Could not transmit the CAN frame.

+		CTR_SigNotUpdated,		//!< Have not received an value response for signal.

+		CTR_BufferFull,			//!< Caller attempted to insert data into a buffer that is full.

+}CTR_Code;

+

+#endif /* CTRE_H */

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/frccansae/CANDeviceInterface.h b/third_party/allwpilib_2018/hal/src/main/native/athena/frccansae/CANDeviceInterface.h
new file mode 100644
index 0000000..62a38cb
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/frccansae/CANDeviceInterface.h
@@ -0,0 +1,156 @@
+#ifndef __CAN_DEVICE_INTERFACE_H__

+#define __CAN_DEVICE_INTERFACE_H__

+

+#define MAX_STRING_LEN 64

+

+#define SUPPORT_UNIQUE_ID	(1) /* depends entirely on old vs new build */

+#define USE_NTH_ORDER		(0) /* zero to user deviceId */

+#define SUPPORT_MOTOR_CONTROLLER_PROFILE	(1)

+namespace CANDeviceInterface1

+{

+

+struct PIDSlot

+{

+	// Proportional gain

+	float pGain;

+	// Integral gain

+	float iGain;

+	// Differential gain

+	float dGain;

+	// Feed-forward gain

+	float fGain;

+	// Integral zone

+	float iZone;

+	// Closed-loop ramp rate

+	float clRampRate;

+};

+

+struct DeviceDescriptor

+{

+   // The full device ID, including the device number, manufacturer, and device type.

+   // The mask of a message the device supports is 0x1FFF003F.

+   unsigned int deviceID;

+#if SUPPORT_UNIQUE_ID != 0

+   // This is the ID that uniquely identifies the device node in the UI.

+   // The purpose of this is to be able to track the device across renames or deviceID changes.

+   unsigned int uniqueID;

+#endif

+   // An dynamically assigned ID that will make setting deviceIDs robust,

+   //  Never again will you need to isolate a CAN node just to fix it's ID.

+   unsigned int dynamicID;

+   // User visible name.  This can be customized by the user, but should have a

+   // reasonable default.

+   char name[MAX_STRING_LEN];

+   // This is a user visible model name that should match the can_devices.ini section.

+   char model[MAX_STRING_LEN];

+   // This is a version number that represents the version of firmware currently

+   // installed on the device.

+   char currentVersion[MAX_STRING_LEN];

+   // Hardware revision.

+   char hardwareRev[MAX_STRING_LEN];

+   // Bootloader version.  Will not change for the life of the product, but additional

+   // field upgrade features could be added in newer hardware.

+   char bootloaderRev[MAX_STRING_LEN];

+   // Manufacture Date.  Could be a calender date or just the FRC season year.

+   // Also helps troubleshooting "old ones" vs "new ones".

+   char manufactureDate[MAX_STRING_LEN];

+   // General status of the hardware.  For example if the device is in bootloader

+   // due to a bad flash UI could emphasize that.

+   char softwareStatus[MAX_STRING_LEN];

+   // Is the LED currently on?

+   bool led;

+	// Reserved fields for future use by CTRE.  Not touched by frccansae

+   unsigned int dynFlags;

+   unsigned int flags; 		/* bitfield */

+   unsigned int ptrToString;

+   //unsigned int reserved0;

+   //unsigned int reserved1;

+   //unsigned int reserved2;

+#if SUPPORT_MOTOR_CONTROLLER_PROFILE != 0

+	// Motor controller properties (ignored if SupportsMotorControllerProperties is false or unset for this model)

+	unsigned int brakeMode; // 0=Coast, 1=Brake

+	unsigned int limitSwitchFwdMode; // 0=disabled, 1=Normally Closed, 2=Normally Open

+	unsigned int limitSwitchRevMode; // 0=disabled, 1=Normally Closed, 2=Normally Open

+	// Limit-switch soft limits

+	bool bFwdSoftLimitEnable;

+	bool bRevSoftLimitEnable;

+	float softLimitFwd;

+	float softLimitRev;

+	// PID constants for slot 0

+	struct PIDSlot slot0;

+	// PID constants for slot 1

+	struct PIDSlot slot1;

+#endif

+};

+

+#define kLimitSwitchMode_Disabled		(0)

+#define kLimitSwitchMode_NormallyClosed	(1)

+#define kLimitSwitchMode_NormallyOpen	(2)

+

+// Interface functions that must be implemented by the CAN Firmware Update Library

+

+// Returns the number of devices that will be returned in a call to

+// getListOfDevices().  The calling library will use this info to allocate enough

+// memory to accept all device info.

+int getNumberOfDevices();

+

+// Return info about discovered devices.  The array of structs should be

+// populated before returning.  The numDescriptors input describes how many

+// elements were allocated to prevent memory corruption.  The number of devices

+// populated should be returned from this function as well.

+int getListOfDevices(DeviceDescriptor *devices, int numDescriptors);

+

+// When the user requests to update the firmware of a device a thread will be

+// spawned and this function is called from that thread.  This function should

+// complete the firmware update process before returning.  The image

+// contents and size are directly from the file selected by the user.  The

+// error message string can be filled with a NULL-terminated message to show the

+// user if there was a problem updating firmware.  The error message is only

+// displayed if a non-zero value is returned from this function.

+int updateFirmware(const DeviceDescriptor *device, const unsigned char *imageContents, unsigned int imageSize, char *errorMessage, int errorMessageMaxSize);

+

+// This function is called periodically from the UI thread while the firmware

+// update is in progress.  The percentComplete parameter should the filled in

+// with the current progress of the firmware update process to update a progress

+// bar in the UI.

+void checkUpdateProgress(const DeviceDescriptor *device, int *percentComplete);

+

+// This is called when the user selects a new ID to assign on the bus and

+// chooses to save.  The newDeviceID is really just the device number. The

+// manufacturer and device type will remain unchanged.  If a problem is detected

+// when assigning a new ID, this function should return a non-zero value.

+int assignBroadcastDeviceID(unsigned int newDeviceID);

+// The device descriptor should be updated with the new device ID.  The name may

+// also change in the descriptor and will be updated in the UI immediately.

+// Be sure to modify the descriptor first since the refresh from the UI is

+// asynchronous.

+int assignDeviceID(DeviceDescriptor *device, unsigned int newDeviceID);

+

+// This entry-point will get called when the user chooses to change the value

+// of the device's LED.  This will allow the user to identify devices which

+// support dynamic addresses or are otherwise unknown.  If this function returns

+// a non-zero value, the UI will report an error.

+int saveLightLed(const DeviceDescriptor *device, bool newLEDStatus);

+

+// This entry-point will get called when the user chooses to change the alias

+// of the device with the device specified.  If this function returns a non-

+// zero value, the UI will report an error.  The device descriptor must be

+// updated with the new name that was selected. If a different name is saved

+// to the descriptor than the user specified, this will require a manual

+// refresh by the user.  This is reported as CAR #505139

+int saveDeviceName(DeviceDescriptor *device, const char *newName);

+

+// This entry-point will get called when the user changes any of the motor

+// controller specific properties. If this function returns a non-zero value,

+// the UI will report an error.  The device descriptor may be updated with

+// coerced values.

+int saveMotorParameters(DeviceDescriptor *device);

+

+// Run some sort of self-test functionality on the device.  This can be anything

+// and the results will be displayed to the user.  A non-zero return value

+// indicates an error.

+int selfTest(const DeviceDescriptor *device, char *detailedResults, int detailedResultsMaxSize);

+

+} /* CANDeviceInterface */

+

+#endif /* __CAN_DEVICE_INTERFACE_H__ */

diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/visa/visa.h b/third_party/allwpilib_2018/hal/src/main/native/athena/visa/visa.h
new file mode 100644
index 0000000..3c6ad30
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/visa/visa.h
@@ -0,0 +1,1064 @@
+/*---------------------------------------------------------------------------*/
+/* Distributed by IVI Foundation Inc.                                        */
+/* Contains National Instruments extensions.                                 */
+/* Do not modify the contents of this file.                                  */
+/*---------------------------------------------------------------------------*/
+/*                                                                           */
+/* Title   : VISA.H                                                          */
+/* Date    : 10-09-2006                                                      */
+/* Purpose : Include file for the VISA Library 4.0 specification             */
+/*                                                                           */
+/*---------------------------------------------------------------------------*/
+/* When using NI-VISA extensions, you must link with the VISA library that   */
+/* comes with NI-VISA.  Currently, the extensions provided by NI-VISA are:   */
+/*                                                                           */
+/* PXI (Compact PCI eXtensions for Instrumentation) and PCI support.  To use */
+/* this, you must define the macro NIVISA_PXI before including this header.  */
+/* You must also create an INF file with the VISA Driver Development Wizard. */
+/*                                                                           */
+/* A fast set of macros for viPeekXX/viPokeXX that guarantees binary         */
+/* compatibility with other implementations of VISA.  To use this, you must  */
+/* define the macro NIVISA_PEEKPOKE before including this header.            */
+/*                                                                           */
+/* Support for USB devices that do not conform to a specific class.  To use  */
+/* this, you must define the macro NIVISA_USB before including this header.  */
+/* You must also create an INF file with the VISA Driver Development Wizard. */
+/*---------------------------------------------------------------------------*/
+
+#ifndef __VISA_HEADER__
+#define __VISA_HEADER__
+
+#include <stdarg.h>
+
+#if !defined(__VISATYPE_HEADER__)
+#include "visatype.h"
+#endif
+
+#define VI_SPEC_VERSION     (0x00400000UL)
+
+#if defined(__cplusplus) || defined(__cplusplus__)
+   extern "C" {
+#endif
+
+#if defined(_CVI_)
+#pragma EnableLibraryRuntimeChecking
+#endif
+
+/*- VISA Types --------------------------------------------------------------*/
+
+typedef ViObject             ViEvent;
+typedef ViEvent      _VI_PTR ViPEvent;
+typedef ViObject             ViFindList;
+typedef ViFindList   _VI_PTR ViPFindList;
+
+#if defined(_VI_INT64_UINT64_DEFINED) && defined(_VISA_ENV_IS_64_BIT)
+typedef ViUInt64             ViBusAddress;
+typedef ViUInt64             ViBusSize;
+typedef ViUInt64             ViAttrState;
+#else
+typedef ViUInt32             ViBusAddress;
+typedef ViUInt32             ViBusSize;
+typedef ViUInt32             ViAttrState;
+#endif
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+typedef ViUInt64             ViBusAddress64;
+typedef ViBusAddress64 _VI_PTR ViPBusAddress64;
+#endif
+
+typedef ViUInt32             ViEventType;
+typedef ViEventType  _VI_PTR ViPEventType;
+typedef ViEventType  _VI_PTR ViAEventType;
+typedef void         _VI_PTR ViPAttrState;
+typedef ViAttr       _VI_PTR ViPAttr;
+typedef ViAttr       _VI_PTR ViAAttr;
+
+typedef ViString             ViKeyId;
+typedef ViPString            ViPKeyId;
+typedef ViUInt32             ViJobId;
+typedef ViJobId      _VI_PTR ViPJobId;
+typedef ViUInt32             ViAccessMode;
+typedef ViAccessMode _VI_PTR ViPAccessMode;
+typedef ViBusAddress _VI_PTR ViPBusAddress;
+typedef ViUInt32             ViEventFilter;
+
+typedef va_list              ViVAList;
+
+typedef ViStatus (_VI_FUNCH _VI_PTR ViHndlr)
+   (ViSession vi, ViEventType eventType, ViEvent event, ViAddr userHandle);
+
+/*- Resource Manager Functions and Operations -------------------------------*/
+
+ViStatus _VI_FUNC  viOpenDefaultRM (ViPSession vi);
+ViStatus _VI_FUNC  viFindRsrc      (ViSession sesn, ViString expr, ViPFindList vi,
+                                    ViPUInt32 retCnt, ViChar _VI_FAR desc[]);
+ViStatus _VI_FUNC  viFindNext      (ViFindList vi, ViChar _VI_FAR desc[]);
+ViStatus _VI_FUNC  viParseRsrc     (ViSession rmSesn, ViRsrc rsrcName,
+                                    ViPUInt16 intfType, ViPUInt16 intfNum);
+ViStatus _VI_FUNC  viParseRsrcEx   (ViSession rmSesn, ViRsrc rsrcName, ViPUInt16 intfType,
+                                    ViPUInt16 intfNum, ViChar _VI_FAR rsrcClass[],
+                                    ViChar _VI_FAR expandedUnaliasedName[],
+                                    ViChar _VI_FAR aliasIfExists[]);
+ViStatus _VI_FUNC  viOpen          (ViSession sesn, ViRsrc name, ViAccessMode mode,
+                                    ViUInt32 timeout, ViPSession vi);
+
+/*- Resource Template Operations --------------------------------------------*/
+
+ViStatus _VI_FUNC  viClose         (ViObject vi);
+ViStatus _VI_FUNC  viSetAttribute  (ViObject vi, ViAttr attrName, ViAttrState attrValue);
+ViStatus _VI_FUNC  viGetAttribute  (ViObject vi, ViAttr attrName, void _VI_PTR attrValue);
+ViStatus _VI_FUNC  viStatusDesc    (ViObject vi, ViStatus status, ViChar _VI_FAR desc[]);
+ViStatus _VI_FUNC  viTerminate     (ViObject vi, ViUInt16 degree, ViJobId jobId);
+
+ViStatus _VI_FUNC  viLock          (ViSession vi, ViAccessMode lockType, ViUInt32 timeout,
+                                    ViKeyId requestedKey, ViChar _VI_FAR accessKey[]);
+ViStatus _VI_FUNC  viUnlock        (ViSession vi);
+ViStatus _VI_FUNC  viEnableEvent   (ViSession vi, ViEventType eventType, ViUInt16 mechanism,
+                                    ViEventFilter context);
+ViStatus _VI_FUNC  viDisableEvent  (ViSession vi, ViEventType eventType, ViUInt16 mechanism);
+ViStatus _VI_FUNC  viDiscardEvents (ViSession vi, ViEventType eventType, ViUInt16 mechanism);
+ViStatus _VI_FUNC  viWaitOnEvent   (ViSession vi, ViEventType inEventType, ViUInt32 timeout,
+                                    ViPEventType outEventType, ViPEvent outContext);
+ViStatus _VI_FUNC  viInstallHandler(ViSession vi, ViEventType eventType, ViHndlr handler,
+                                    ViAddr userHandle);
+ViStatus _VI_FUNC  viUninstallHandler(ViSession vi, ViEventType eventType, ViHndlr handler,
+                                      ViAddr userHandle);
+
+/*- Basic I/O Operations ----------------------------------------------------*/
+
+ViStatus _VI_FUNC  viRead          (ViSession vi, ViPBuf buf, ViUInt32 cnt, ViPUInt32 retCnt);
+ViStatus _VI_FUNC  viReadAsync     (ViSession vi, ViPBuf buf, ViUInt32 cnt, ViPJobId  jobId);
+ViStatus _VI_FUNC  viReadToFile    (ViSession vi, ViConstString filename, ViUInt32 cnt,
+                                    ViPUInt32 retCnt);
+ViStatus _VI_FUNC  viWrite         (ViSession vi, ViBuf  buf, ViUInt32 cnt, ViPUInt32 retCnt);
+ViStatus _VI_FUNC  viWriteAsync    (ViSession vi, ViBuf  buf, ViUInt32 cnt, ViPJobId  jobId);
+ViStatus _VI_FUNC  viWriteFromFile (ViSession vi, ViConstString filename, ViUInt32 cnt,
+                                    ViPUInt32 retCnt);
+ViStatus _VI_FUNC  viAssertTrigger (ViSession vi, ViUInt16 protocol);
+ViStatus _VI_FUNC  viReadSTB       (ViSession vi, ViPUInt16 status);
+ViStatus _VI_FUNC  viClear         (ViSession vi);
+
+/*- Formatted and Buffered I/O Operations -----------------------------------*/
+
+ViStatus _VI_FUNC  viSetBuf        (ViSession vi, ViUInt16 mask, ViUInt32 size);
+ViStatus _VI_FUNC  viFlush         (ViSession vi, ViUInt16 mask);
+
+ViStatus _VI_FUNC  viBufWrite      (ViSession vi, ViBuf  buf, ViUInt32 cnt, ViPUInt32 retCnt);
+ViStatus _VI_FUNC  viBufRead       (ViSession vi, ViPBuf buf, ViUInt32 cnt, ViPUInt32 retCnt);
+
+ViStatus _VI_FUNCC viPrintf        (ViSession vi, ViString writeFmt, ...);
+ViStatus _VI_FUNC  viVPrintf       (ViSession vi, ViString writeFmt, ViVAList params);
+ViStatus _VI_FUNCC viSPrintf       (ViSession vi, ViPBuf buf, ViString writeFmt, ...);
+ViStatus _VI_FUNC  viVSPrintf      (ViSession vi, ViPBuf buf, ViString writeFmt,
+                                    ViVAList parms);
+
+ViStatus _VI_FUNCC viScanf         (ViSession vi, ViString readFmt, ...);
+ViStatus _VI_FUNC  viVScanf        (ViSession vi, ViString readFmt, ViVAList params);
+ViStatus _VI_FUNCC viSScanf        (ViSession vi, ViBuf buf, ViString readFmt, ...);
+ViStatus _VI_FUNC  viVSScanf       (ViSession vi, ViBuf buf, ViString readFmt,
+                                    ViVAList parms);
+
+ViStatus _VI_FUNCC viQueryf        (ViSession vi, ViString writeFmt, ViString readFmt, ...);
+ViStatus _VI_FUNC  viVQueryf       (ViSession vi, ViString writeFmt, ViString readFmt, 
+                                    ViVAList params);
+
+/*- Memory I/O Operations ---------------------------------------------------*/
+
+ViStatus _VI_FUNC  viIn8           (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViPUInt8  val8);
+ViStatus _VI_FUNC  viOut8          (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViUInt8   val8);
+ViStatus _VI_FUNC  viIn16          (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViPUInt16 val16);
+ViStatus _VI_FUNC  viOut16         (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViUInt16  val16);
+ViStatus _VI_FUNC  viIn32          (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViPUInt32 val32);
+ViStatus _VI_FUNC  viOut32         (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViUInt32  val32);
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+ViStatus _VI_FUNC  viIn64          (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViPUInt64 val64);
+ViStatus _VI_FUNC  viOut64         (ViSession vi, ViUInt16 space,
+                                    ViBusAddress offset, ViUInt64  val64);
+
+ViStatus _VI_FUNC  viIn8Ex         (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViPUInt8  val8);
+ViStatus _VI_FUNC  viOut8Ex        (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViUInt8   val8);
+ViStatus _VI_FUNC  viIn16Ex        (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViPUInt16 val16);
+ViStatus _VI_FUNC  viOut16Ex       (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViUInt16  val16);
+ViStatus _VI_FUNC  viIn32Ex        (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViPUInt32 val32);
+ViStatus _VI_FUNC  viOut32Ex       (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViUInt32  val32);
+ViStatus _VI_FUNC  viIn64Ex        (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViPUInt64 val64);
+ViStatus _VI_FUNC  viOut64Ex       (ViSession vi, ViUInt16 space,
+                                    ViBusAddress64 offset, ViUInt64  val64);
+#endif
+
+ViStatus _VI_FUNC  viMoveIn8       (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt8  buf8);
+ViStatus _VI_FUNC  viMoveOut8      (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt8  buf8);
+ViStatus _VI_FUNC  viMoveIn16      (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt16 buf16);
+ViStatus _VI_FUNC  viMoveOut16     (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt16 buf16);
+ViStatus _VI_FUNC  viMoveIn32      (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt32 buf32);
+ViStatus _VI_FUNC  viMoveOut32     (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt32 buf32);
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+ViStatus _VI_FUNC  viMoveIn64      (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt64 buf64);
+ViStatus _VI_FUNC  viMoveOut64     (ViSession vi, ViUInt16 space, ViBusAddress offset,
+                                    ViBusSize length, ViAUInt64 buf64);
+
+ViStatus _VI_FUNC  viMoveIn8Ex     (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt8  buf8);
+ViStatus _VI_FUNC  viMoveOut8Ex    (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt8  buf8);
+ViStatus _VI_FUNC  viMoveIn16Ex    (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt16 buf16);
+ViStatus _VI_FUNC  viMoveOut16Ex   (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt16 buf16);
+ViStatus _VI_FUNC  viMoveIn32Ex    (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt32 buf32);
+ViStatus _VI_FUNC  viMoveOut32Ex   (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt32 buf32);
+ViStatus _VI_FUNC  viMoveIn64Ex    (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt64 buf64);
+ViStatus _VI_FUNC  viMoveOut64Ex   (ViSession vi, ViUInt16 space, ViBusAddress64 offset,
+                                    ViBusSize length, ViAUInt64 buf64);
+#endif
+
+ViStatus _VI_FUNC  viMove          (ViSession vi, ViUInt16 srcSpace, ViBusAddress srcOffset,
+                                    ViUInt16 srcWidth, ViUInt16 destSpace, 
+                                    ViBusAddress destOffset, ViUInt16 destWidth, 
+                                    ViBusSize srcLength); 
+ViStatus _VI_FUNC  viMoveAsync     (ViSession vi, ViUInt16 srcSpace, ViBusAddress srcOffset,
+                                    ViUInt16 srcWidth, ViUInt16 destSpace, 
+                                    ViBusAddress destOffset, ViUInt16 destWidth, 
+                                    ViBusSize srcLength, ViPJobId jobId);
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+ViStatus _VI_FUNC  viMoveEx        (ViSession vi, ViUInt16 srcSpace, ViBusAddress64 srcOffset,
+                                    ViUInt16 srcWidth, ViUInt16 destSpace, 
+                                    ViBusAddress64 destOffset, ViUInt16 destWidth, 
+                                    ViBusSize srcLength); 
+ViStatus _VI_FUNC  viMoveAsyncEx   (ViSession vi, ViUInt16 srcSpace, ViBusAddress64 srcOffset,
+                                    ViUInt16 srcWidth, ViUInt16 destSpace, 
+                                    ViBusAddress64 destOffset, ViUInt16 destWidth, 
+                                    ViBusSize srcLength, ViPJobId jobId);
+#endif
+
+ViStatus _VI_FUNC  viMapAddress    (ViSession vi, ViUInt16 mapSpace, ViBusAddress mapOffset,
+                                    ViBusSize mapSize, ViBoolean access,
+                                    ViAddr suggested, ViPAddr address);
+ViStatus _VI_FUNC  viUnmapAddress  (ViSession vi);
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+ViStatus _VI_FUNC  viMapAddressEx  (ViSession vi, ViUInt16 mapSpace, ViBusAddress64 mapOffset,
+                                    ViBusSize mapSize, ViBoolean access,
+                                    ViAddr suggested, ViPAddr address);
+#endif
+
+void     _VI_FUNC  viPeek8         (ViSession vi, ViAddr address, ViPUInt8  val8);
+void     _VI_FUNC  viPoke8         (ViSession vi, ViAddr address, ViUInt8   val8);
+void     _VI_FUNC  viPeek16        (ViSession vi, ViAddr address, ViPUInt16 val16);
+void     _VI_FUNC  viPoke16        (ViSession vi, ViAddr address, ViUInt16  val16);
+void     _VI_FUNC  viPeek32        (ViSession vi, ViAddr address, ViPUInt32 val32);
+void     _VI_FUNC  viPoke32        (ViSession vi, ViAddr address, ViUInt32  val32);
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+void     _VI_FUNC  viPeek64        (ViSession vi, ViAddr address, ViPUInt64 val64);
+void     _VI_FUNC  viPoke64        (ViSession vi, ViAddr address, ViUInt64  val64);
+#endif
+
+/*- Shared Memory Operations ------------------------------------------------*/
+
+ViStatus _VI_FUNC  viMemAlloc      (ViSession vi, ViBusSize size, ViPBusAddress offset);
+ViStatus _VI_FUNC  viMemFree       (ViSession vi, ViBusAddress offset);
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+ViStatus _VI_FUNC  viMemAllocEx    (ViSession vi, ViBusSize size, ViPBusAddress64 offset);
+ViStatus _VI_FUNC  viMemFreeEx     (ViSession vi, ViBusAddress64 offset);
+#endif
+
+/*- Interface Specific Operations -------------------------------------------*/
+
+ViStatus _VI_FUNC  viGpibControlREN(ViSession vi, ViUInt16 mode);
+ViStatus _VI_FUNC  viGpibControlATN(ViSession vi, ViUInt16 mode);
+ViStatus _VI_FUNC  viGpibSendIFC   (ViSession vi);
+ViStatus _VI_FUNC  viGpibCommand   (ViSession vi, ViBuf cmd, ViUInt32 cnt, ViPUInt32 retCnt);
+ViStatus _VI_FUNC  viGpibPassControl(ViSession vi, ViUInt16 primAddr, ViUInt16 secAddr);
+
+ViStatus _VI_FUNC  viVxiCommandQuery(ViSession vi, ViUInt16 mode, ViUInt32 cmd,
+                                     ViPUInt32 response);
+ViStatus _VI_FUNC  viAssertUtilSignal(ViSession vi, ViUInt16 line);
+ViStatus _VI_FUNC  viAssertIntrSignal(ViSession vi, ViInt16 mode, ViUInt32 statusID);
+ViStatus _VI_FUNC  viMapTrigger    (ViSession vi, ViInt16 trigSrc, ViInt16 trigDest, 
+                                    ViUInt16 mode);
+ViStatus _VI_FUNC  viUnmapTrigger  (ViSession vi, ViInt16 trigSrc, ViInt16 trigDest);
+ViStatus _VI_FUNC  viUsbControlOut (ViSession vi, ViInt16 bmRequestType, ViInt16 bRequest,
+                                    ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength,
+                                    ViBuf buf);
+ViStatus _VI_FUNC  viUsbControlIn  (ViSession vi, ViInt16 bmRequestType, ViInt16 bRequest,
+                                    ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength,
+                                    ViPBuf buf, ViPUInt16 retCnt);
+
+/*- Attributes (platform independent size) ----------------------------------*/
+
+#define VI_ATTR_RSRC_CLASS          (0xBFFF0001UL)
+#define VI_ATTR_RSRC_NAME           (0xBFFF0002UL)
+#define VI_ATTR_RSRC_IMPL_VERSION   (0x3FFF0003UL)
+#define VI_ATTR_RSRC_LOCK_STATE     (0x3FFF0004UL)
+#define VI_ATTR_MAX_QUEUE_LENGTH    (0x3FFF0005UL)
+#define VI_ATTR_USER_DATA_32        (0x3FFF0007UL)
+#define VI_ATTR_FDC_CHNL            (0x3FFF000DUL)
+#define VI_ATTR_FDC_MODE            (0x3FFF000FUL)
+#define VI_ATTR_FDC_GEN_SIGNAL_EN   (0x3FFF0011UL)
+#define VI_ATTR_FDC_USE_PAIR        (0x3FFF0013UL)
+#define VI_ATTR_SEND_END_EN         (0x3FFF0016UL)
+#define VI_ATTR_TERMCHAR            (0x3FFF0018UL)
+#define VI_ATTR_TMO_VALUE           (0x3FFF001AUL)
+#define VI_ATTR_GPIB_READDR_EN      (0x3FFF001BUL)
+#define VI_ATTR_IO_PROT             (0x3FFF001CUL)
+#define VI_ATTR_DMA_ALLOW_EN        (0x3FFF001EUL)
+#define VI_ATTR_ASRL_BAUD           (0x3FFF0021UL)
+#define VI_ATTR_ASRL_DATA_BITS      (0x3FFF0022UL)
+#define VI_ATTR_ASRL_PARITY         (0x3FFF0023UL)
+#define VI_ATTR_ASRL_STOP_BITS      (0x3FFF0024UL)
+#define VI_ATTR_ASRL_FLOW_CNTRL     (0x3FFF0025UL)
+#define VI_ATTR_RD_BUF_OPER_MODE    (0x3FFF002AUL)
+#define VI_ATTR_RD_BUF_SIZE         (0x3FFF002BUL)
+#define VI_ATTR_WR_BUF_OPER_MODE    (0x3FFF002DUL)
+#define VI_ATTR_WR_BUF_SIZE         (0x3FFF002EUL)
+#define VI_ATTR_SUPPRESS_END_EN     (0x3FFF0036UL)
+#define VI_ATTR_TERMCHAR_EN         (0x3FFF0038UL)
+#define VI_ATTR_DEST_ACCESS_PRIV    (0x3FFF0039UL)
+#define VI_ATTR_DEST_BYTE_ORDER     (0x3FFF003AUL)
+#define VI_ATTR_SRC_ACCESS_PRIV     (0x3FFF003CUL)
+#define VI_ATTR_SRC_BYTE_ORDER      (0x3FFF003DUL)
+#define VI_ATTR_SRC_INCREMENT       (0x3FFF0040UL)
+#define VI_ATTR_DEST_INCREMENT      (0x3FFF0041UL)
+#define VI_ATTR_WIN_ACCESS_PRIV     (0x3FFF0045UL)
+#define VI_ATTR_WIN_BYTE_ORDER      (0x3FFF0047UL)
+#define VI_ATTR_GPIB_ATN_STATE      (0x3FFF0057UL)
+#define VI_ATTR_GPIB_ADDR_STATE     (0x3FFF005CUL)
+#define VI_ATTR_GPIB_CIC_STATE      (0x3FFF005EUL)
+#define VI_ATTR_GPIB_NDAC_STATE     (0x3FFF0062UL)
+#define VI_ATTR_GPIB_SRQ_STATE      (0x3FFF0067UL)
+#define VI_ATTR_GPIB_SYS_CNTRL_STATE (0x3FFF0068UL)
+#define VI_ATTR_GPIB_HS488_CBL_LEN  (0x3FFF0069UL)
+#define VI_ATTR_CMDR_LA             (0x3FFF006BUL)
+#define VI_ATTR_VXI_DEV_CLASS       (0x3FFF006CUL)
+#define VI_ATTR_MAINFRAME_LA        (0x3FFF0070UL)
+#define VI_ATTR_MANF_NAME           (0xBFFF0072UL)
+#define VI_ATTR_MODEL_NAME          (0xBFFF0077UL)
+#define VI_ATTR_VXI_VME_INTR_STATUS (0x3FFF008BUL)
+#define VI_ATTR_VXI_TRIG_STATUS     (0x3FFF008DUL)
+#define VI_ATTR_VXI_VME_SYSFAIL_STATE (0x3FFF0094UL)
+#define VI_ATTR_WIN_BASE_ADDR_32    (0x3FFF0098UL)
+#define VI_ATTR_WIN_SIZE_32         (0x3FFF009AUL)
+#define VI_ATTR_ASRL_AVAIL_NUM      (0x3FFF00ACUL)
+#define VI_ATTR_MEM_BASE_32         (0x3FFF00ADUL)
+#define VI_ATTR_ASRL_CTS_STATE      (0x3FFF00AEUL)
+#define VI_ATTR_ASRL_DCD_STATE      (0x3FFF00AFUL)
+#define VI_ATTR_ASRL_DSR_STATE      (0x3FFF00B1UL)
+#define VI_ATTR_ASRL_DTR_STATE      (0x3FFF00B2UL)
+#define VI_ATTR_ASRL_END_IN         (0x3FFF00B3UL)
+#define VI_ATTR_ASRL_END_OUT        (0x3FFF00B4UL)
+#define VI_ATTR_ASRL_REPLACE_CHAR   (0x3FFF00BEUL)
+#define VI_ATTR_ASRL_RI_STATE       (0x3FFF00BFUL)
+#define VI_ATTR_ASRL_RTS_STATE      (0x3FFF00C0UL)
+#define VI_ATTR_ASRL_XON_CHAR       (0x3FFF00C1UL)
+#define VI_ATTR_ASRL_XOFF_CHAR      (0x3FFF00C2UL)
+#define VI_ATTR_WIN_ACCESS          (0x3FFF00C3UL)
+#define VI_ATTR_RM_SESSION          (0x3FFF00C4UL)
+#define VI_ATTR_VXI_LA              (0x3FFF00D5UL)
+#define VI_ATTR_MANF_ID             (0x3FFF00D9UL)
+#define VI_ATTR_MEM_SIZE_32         (0x3FFF00DDUL)
+#define VI_ATTR_MEM_SPACE           (0x3FFF00DEUL)
+#define VI_ATTR_MODEL_CODE          (0x3FFF00DFUL)
+#define VI_ATTR_SLOT                (0x3FFF00E8UL)
+#define VI_ATTR_INTF_INST_NAME      (0xBFFF00E9UL)
+#define VI_ATTR_IMMEDIATE_SERV      (0x3FFF0100UL)
+#define VI_ATTR_INTF_PARENT_NUM     (0x3FFF0101UL)
+#define VI_ATTR_RSRC_SPEC_VERSION   (0x3FFF0170UL)
+#define VI_ATTR_INTF_TYPE           (0x3FFF0171UL)
+#define VI_ATTR_GPIB_PRIMARY_ADDR   (0x3FFF0172UL)
+#define VI_ATTR_GPIB_SECONDARY_ADDR (0x3FFF0173UL)
+#define VI_ATTR_RSRC_MANF_NAME      (0xBFFF0174UL)
+#define VI_ATTR_RSRC_MANF_ID        (0x3FFF0175UL)
+#define VI_ATTR_INTF_NUM            (0x3FFF0176UL)
+#define VI_ATTR_TRIG_ID             (0x3FFF0177UL)
+#define VI_ATTR_GPIB_REN_STATE      (0x3FFF0181UL)
+#define VI_ATTR_GPIB_UNADDR_EN      (0x3FFF0184UL)
+#define VI_ATTR_DEV_STATUS_BYTE     (0x3FFF0189UL)
+#define VI_ATTR_FILE_APPEND_EN      (0x3FFF0192UL)
+#define VI_ATTR_VXI_TRIG_SUPPORT    (0x3FFF0194UL)
+#define VI_ATTR_TCPIP_ADDR          (0xBFFF0195UL)
+#define VI_ATTR_TCPIP_HOSTNAME      (0xBFFF0196UL)
+#define VI_ATTR_TCPIP_PORT          (0x3FFF0197UL)
+#define VI_ATTR_TCPIP_DEVICE_NAME   (0xBFFF0199UL)
+#define VI_ATTR_TCPIP_NODELAY       (0x3FFF019AUL)
+#define VI_ATTR_TCPIP_KEEPALIVE     (0x3FFF019BUL)
+#define VI_ATTR_4882_COMPLIANT      (0x3FFF019FUL)
+#define VI_ATTR_USB_SERIAL_NUM      (0xBFFF01A0UL)
+#define VI_ATTR_USB_INTFC_NUM       (0x3FFF01A1UL)
+#define VI_ATTR_USB_PROTOCOL        (0x3FFF01A7UL)
+#define VI_ATTR_USB_MAX_INTR_SIZE   (0x3FFF01AFUL)
+#define VI_ATTR_PXI_DEV_NUM         (0x3FFF0201UL)
+#define VI_ATTR_PXI_FUNC_NUM        (0x3FFF0202UL)
+#define VI_ATTR_PXI_BUS_NUM         (0x3FFF0205UL)
+#define VI_ATTR_PXI_CHASSIS         (0x3FFF0206UL)
+#define VI_ATTR_PXI_SLOTPATH        (0xBFFF0207UL)
+#define VI_ATTR_PXI_SLOT_LBUS_LEFT  (0x3FFF0208UL)
+#define VI_ATTR_PXI_SLOT_LBUS_RIGHT (0x3FFF0209UL)
+#define VI_ATTR_PXI_TRIG_BUS        (0x3FFF020AUL)
+#define VI_ATTR_PXI_STAR_TRIG_BUS   (0x3FFF020BUL)
+#define VI_ATTR_PXI_STAR_TRIG_LINE  (0x3FFF020CUL)
+#define VI_ATTR_PXI_MEM_TYPE_BAR0   (0x3FFF0211UL)
+#define VI_ATTR_PXI_MEM_TYPE_BAR1   (0x3FFF0212UL)
+#define VI_ATTR_PXI_MEM_TYPE_BAR2   (0x3FFF0213UL)
+#define VI_ATTR_PXI_MEM_TYPE_BAR3   (0x3FFF0214UL)
+#define VI_ATTR_PXI_MEM_TYPE_BAR4   (0x3FFF0215UL)
+#define VI_ATTR_PXI_MEM_TYPE_BAR5   (0x3FFF0216UL)
+#define VI_ATTR_PXI_MEM_BASE_BAR0   (0x3FFF0221UL)
+#define VI_ATTR_PXI_MEM_BASE_BAR1   (0x3FFF0222UL)
+#define VI_ATTR_PXI_MEM_BASE_BAR2   (0x3FFF0223UL)
+#define VI_ATTR_PXI_MEM_BASE_BAR3   (0x3FFF0224UL)
+#define VI_ATTR_PXI_MEM_BASE_BAR4   (0x3FFF0225UL)
+#define VI_ATTR_PXI_MEM_BASE_BAR5   (0x3FFF0226UL)
+#define VI_ATTR_PXI_MEM_SIZE_BAR0   (0x3FFF0231UL)
+#define VI_ATTR_PXI_MEM_SIZE_BAR1   (0x3FFF0232UL)
+#define VI_ATTR_PXI_MEM_SIZE_BAR2   (0x3FFF0233UL)
+#define VI_ATTR_PXI_MEM_SIZE_BAR3   (0x3FFF0234UL)
+#define VI_ATTR_PXI_MEM_SIZE_BAR4   (0x3FFF0235UL)
+#define VI_ATTR_PXI_MEM_SIZE_BAR5   (0x3FFF0236UL)
+#define VI_ATTR_PXI_IS_EXPRESS      (0x3FFF0240UL)
+#define VI_ATTR_PXI_SLOT_LWIDTH     (0x3FFF0241UL)
+#define VI_ATTR_PXI_MAX_LWIDTH      (0x3FFF0242UL)
+#define VI_ATTR_PXI_ACTUAL_LWIDTH   (0x3FFF0243UL)
+#define VI_ATTR_PXI_DSTAR_BUS       (0x3FFF0244UL)
+#define VI_ATTR_PXI_DSTAR_SET       (0x3FFF0245UL)
+
+#define VI_ATTR_JOB_ID              (0x3FFF4006UL)
+#define VI_ATTR_EVENT_TYPE          (0x3FFF4010UL)
+#define VI_ATTR_SIGP_STATUS_ID      (0x3FFF4011UL)
+#define VI_ATTR_RECV_TRIG_ID        (0x3FFF4012UL)
+#define VI_ATTR_INTR_STATUS_ID      (0x3FFF4023UL)
+#define VI_ATTR_STATUS              (0x3FFF4025UL)
+#define VI_ATTR_RET_COUNT_32        (0x3FFF4026UL)
+#define VI_ATTR_BUFFER              (0x3FFF4027UL)
+#define VI_ATTR_RECV_INTR_LEVEL     (0x3FFF4041UL)
+#define VI_ATTR_OPER_NAME           (0xBFFF4042UL)
+#define VI_ATTR_GPIB_RECV_CIC_STATE (0x3FFF4193UL)
+#define VI_ATTR_RECV_TCPIP_ADDR     (0xBFFF4198UL)
+#define VI_ATTR_USB_RECV_INTR_SIZE  (0x3FFF41B0UL)
+#define VI_ATTR_USB_RECV_INTR_DATA  (0xBFFF41B1UL)
+
+/*- Attributes (platform dependent size) ------------------------------------*/
+
+#if defined(_VI_INT64_UINT64_DEFINED) && defined(_VISA_ENV_IS_64_BIT)
+#define VI_ATTR_USER_DATA_64        (0x3FFF000AUL)
+#define VI_ATTR_RET_COUNT_64        (0x3FFF4028UL)
+#define VI_ATTR_USER_DATA           (VI_ATTR_USER_DATA_64)
+#define VI_ATTR_RET_COUNT           (VI_ATTR_RET_COUNT_64)
+#else
+#define VI_ATTR_USER_DATA           (VI_ATTR_USER_DATA_32)
+#define VI_ATTR_RET_COUNT           (VI_ATTR_RET_COUNT_32)
+#endif
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+#define VI_ATTR_WIN_BASE_ADDR_64    (0x3FFF009BUL)
+#define VI_ATTR_WIN_SIZE_64         (0x3FFF009CUL)
+#define VI_ATTR_MEM_BASE_64         (0x3FFF00D0UL)
+#define VI_ATTR_MEM_SIZE_64         (0x3FFF00D1UL)
+#endif
+#if defined(_VI_INT64_UINT64_DEFINED) && defined(_VISA_ENV_IS_64_BIT)
+#define VI_ATTR_WIN_BASE_ADDR       (VI_ATTR_WIN_BASE_ADDR_64)
+#define VI_ATTR_WIN_SIZE            (VI_ATTR_WIN_SIZE_64)
+#define VI_ATTR_MEM_BASE            (VI_ATTR_MEM_BASE_64)
+#define VI_ATTR_MEM_SIZE            (VI_ATTR_MEM_SIZE_64)
+#else
+#define VI_ATTR_WIN_BASE_ADDR       (VI_ATTR_WIN_BASE_ADDR_32)
+#define VI_ATTR_WIN_SIZE            (VI_ATTR_WIN_SIZE_32)
+#define VI_ATTR_MEM_BASE            (VI_ATTR_MEM_BASE_32)
+#define VI_ATTR_MEM_SIZE            (VI_ATTR_MEM_SIZE_32)
+#endif
+
+/*- Event Types -------------------------------------------------------------*/
+
+#define VI_EVENT_IO_COMPLETION      (0x3FFF2009UL)
+#define VI_EVENT_TRIG               (0xBFFF200AUL)
+#define VI_EVENT_SERVICE_REQ        (0x3FFF200BUL)
+#define VI_EVENT_CLEAR              (0x3FFF200DUL)
+#define VI_EVENT_EXCEPTION          (0xBFFF200EUL)
+#define VI_EVENT_GPIB_CIC           (0x3FFF2012UL)
+#define VI_EVENT_GPIB_TALK          (0x3FFF2013UL)
+#define VI_EVENT_GPIB_LISTEN        (0x3FFF2014UL)
+#define VI_EVENT_VXI_VME_SYSFAIL    (0x3FFF201DUL)
+#define VI_EVENT_VXI_VME_SYSRESET   (0x3FFF201EUL)
+#define VI_EVENT_VXI_SIGP           (0x3FFF2020UL)
+#define VI_EVENT_VXI_VME_INTR       (0xBFFF2021UL)
+#define VI_EVENT_PXI_INTR           (0x3FFF2022UL)
+#define VI_EVENT_TCPIP_CONNECT      (0x3FFF2036UL)
+#define VI_EVENT_USB_INTR           (0x3FFF2037UL)
+
+#define VI_ALL_ENABLED_EVENTS       (0x3FFF7FFFUL)
+
+/*- Completion and Error Codes ----------------------------------------------*/
+
+#define VI_SUCCESS_EVENT_EN                   (0x3FFF0002L) /* 3FFF0002,  1073676290 */
+#define VI_SUCCESS_EVENT_DIS                  (0x3FFF0003L) /* 3FFF0003,  1073676291 */
+#define VI_SUCCESS_QUEUE_EMPTY                (0x3FFF0004L) /* 3FFF0004,  1073676292 */
+#define VI_SUCCESS_TERM_CHAR                  (0x3FFF0005L) /* 3FFF0005,  1073676293 */
+#define VI_SUCCESS_MAX_CNT                    (0x3FFF0006L) /* 3FFF0006,  1073676294 */
+#define VI_SUCCESS_DEV_NPRESENT               (0x3FFF007DL) /* 3FFF007D,  1073676413 */
+#define VI_SUCCESS_TRIG_MAPPED                (0x3FFF007EL) /* 3FFF007E,  1073676414 */
+#define VI_SUCCESS_QUEUE_NEMPTY               (0x3FFF0080L) /* 3FFF0080,  1073676416 */
+#define VI_SUCCESS_NCHAIN                     (0x3FFF0098L) /* 3FFF0098,  1073676440 */
+#define VI_SUCCESS_NESTED_SHARED              (0x3FFF0099L) /* 3FFF0099,  1073676441 */
+#define VI_SUCCESS_NESTED_EXCLUSIVE           (0x3FFF009AL) /* 3FFF009A,  1073676442 */
+#define VI_SUCCESS_SYNC                       (0x3FFF009BL) /* 3FFF009B,  1073676443 */
+
+#define VI_WARN_QUEUE_OVERFLOW                (0x3FFF000CL) /* 3FFF000C,  1073676300 */
+#define VI_WARN_CONFIG_NLOADED                (0x3FFF0077L) /* 3FFF0077,  1073676407 */
+#define VI_WARN_NULL_OBJECT                   (0x3FFF0082L) /* 3FFF0082,  1073676418 */
+#define VI_WARN_NSUP_ATTR_STATE               (0x3FFF0084L) /* 3FFF0084,  1073676420 */
+#define VI_WARN_UNKNOWN_STATUS                (0x3FFF0085L) /* 3FFF0085,  1073676421 */
+#define VI_WARN_NSUP_BUF                      (0x3FFF0088L) /* 3FFF0088,  1073676424 */
+#define VI_WARN_EXT_FUNC_NIMPL                (0x3FFF00A9L) /* 3FFF00A9,  1073676457 */
+
+#define VI_ERROR_SYSTEM_ERROR       (_VI_ERROR+0x3FFF0000L) /* BFFF0000, -1073807360 */
+#define VI_ERROR_INV_OBJECT         (_VI_ERROR+0x3FFF000EL) /* BFFF000E, -1073807346 */
+#define VI_ERROR_RSRC_LOCKED        (_VI_ERROR+0x3FFF000FL) /* BFFF000F, -1073807345 */
+#define VI_ERROR_INV_EXPR           (_VI_ERROR+0x3FFF0010L) /* BFFF0010, -1073807344 */
+#define VI_ERROR_RSRC_NFOUND        (_VI_ERROR+0x3FFF0011L) /* BFFF0011, -1073807343 */
+#define VI_ERROR_INV_RSRC_NAME      (_VI_ERROR+0x3FFF0012L) /* BFFF0012, -1073807342 */
+#define VI_ERROR_INV_ACC_MODE       (_VI_ERROR+0x3FFF0013L) /* BFFF0013, -1073807341 */
+#define VI_ERROR_TMO                (_VI_ERROR+0x3FFF0015L) /* BFFF0015, -1073807339 */
+#define VI_ERROR_CLOSING_FAILED     (_VI_ERROR+0x3FFF0016L) /* BFFF0016, -1073807338 */
+#define VI_ERROR_INV_DEGREE         (_VI_ERROR+0x3FFF001BL) /* BFFF001B, -1073807333 */
+#define VI_ERROR_INV_JOB_ID         (_VI_ERROR+0x3FFF001CL) /* BFFF001C, -1073807332 */
+#define VI_ERROR_NSUP_ATTR          (_VI_ERROR+0x3FFF001DL) /* BFFF001D, -1073807331 */
+#define VI_ERROR_NSUP_ATTR_STATE    (_VI_ERROR+0x3FFF001EL) /* BFFF001E, -1073807330 */
+#define VI_ERROR_ATTR_READONLY      (_VI_ERROR+0x3FFF001FL) /* BFFF001F, -1073807329 */
+#define VI_ERROR_INV_LOCK_TYPE      (_VI_ERROR+0x3FFF0020L) /* BFFF0020, -1073807328 */
+#define VI_ERROR_INV_ACCESS_KEY     (_VI_ERROR+0x3FFF0021L) /* BFFF0021, -1073807327 */
+#define VI_ERROR_INV_EVENT          (_VI_ERROR+0x3FFF0026L) /* BFFF0026, -1073807322 */
+#define VI_ERROR_INV_MECH           (_VI_ERROR+0x3FFF0027L) /* BFFF0027, -1073807321 */
+#define VI_ERROR_HNDLR_NINSTALLED   (_VI_ERROR+0x3FFF0028L) /* BFFF0028, -1073807320 */
+#define VI_ERROR_INV_HNDLR_REF      (_VI_ERROR+0x3FFF0029L) /* BFFF0029, -1073807319 */
+#define VI_ERROR_INV_CONTEXT        (_VI_ERROR+0x3FFF002AL) /* BFFF002A, -1073807318 */
+#define VI_ERROR_QUEUE_OVERFLOW     (_VI_ERROR+0x3FFF002DL) /* BFFF002D, -1073807315 */
+#define VI_ERROR_NENABLED           (_VI_ERROR+0x3FFF002FL) /* BFFF002F, -1073807313 */
+#define VI_ERROR_ABORT              (_VI_ERROR+0x3FFF0030L) /* BFFF0030, -1073807312 */
+#define VI_ERROR_RAW_WR_PROT_VIOL   (_VI_ERROR+0x3FFF0034L) /* BFFF0034, -1073807308 */
+#define VI_ERROR_RAW_RD_PROT_VIOL   (_VI_ERROR+0x3FFF0035L) /* BFFF0035, -1073807307 */
+#define VI_ERROR_OUTP_PROT_VIOL     (_VI_ERROR+0x3FFF0036L) /* BFFF0036, -1073807306 */
+#define VI_ERROR_INP_PROT_VIOL      (_VI_ERROR+0x3FFF0037L) /* BFFF0037, -1073807305 */
+#define VI_ERROR_BERR               (_VI_ERROR+0x3FFF0038L) /* BFFF0038, -1073807304 */
+#define VI_ERROR_IN_PROGRESS        (_VI_ERROR+0x3FFF0039L) /* BFFF0039, -1073807303 */
+#define VI_ERROR_INV_SETUP          (_VI_ERROR+0x3FFF003AL) /* BFFF003A, -1073807302 */
+#define VI_ERROR_QUEUE_ERROR        (_VI_ERROR+0x3FFF003BL) /* BFFF003B, -1073807301 */
+#define VI_ERROR_ALLOC              (_VI_ERROR+0x3FFF003CL) /* BFFF003C, -1073807300 */
+#define VI_ERROR_INV_MASK           (_VI_ERROR+0x3FFF003DL) /* BFFF003D, -1073807299 */
+#define VI_ERROR_IO                 (_VI_ERROR+0x3FFF003EL) /* BFFF003E, -1073807298 */
+#define VI_ERROR_INV_FMT            (_VI_ERROR+0x3FFF003FL) /* BFFF003F, -1073807297 */
+#define VI_ERROR_NSUP_FMT           (_VI_ERROR+0x3FFF0041L) /* BFFF0041, -1073807295 */
+#define VI_ERROR_LINE_IN_USE        (_VI_ERROR+0x3FFF0042L) /* BFFF0042, -1073807294 */
+#define VI_ERROR_NSUP_MODE          (_VI_ERROR+0x3FFF0046L) /* BFFF0046, -1073807290 */
+#define VI_ERROR_SRQ_NOCCURRED      (_VI_ERROR+0x3FFF004AL) /* BFFF004A, -1073807286 */
+#define VI_ERROR_INV_SPACE          (_VI_ERROR+0x3FFF004EL) /* BFFF004E, -1073807282 */
+#define VI_ERROR_INV_OFFSET         (_VI_ERROR+0x3FFF0051L) /* BFFF0051, -1073807279 */
+#define VI_ERROR_INV_WIDTH          (_VI_ERROR+0x3FFF0052L) /* BFFF0052, -1073807278 */
+#define VI_ERROR_NSUP_OFFSET        (_VI_ERROR+0x3FFF0054L) /* BFFF0054, -1073807276 */
+#define VI_ERROR_NSUP_VAR_WIDTH     (_VI_ERROR+0x3FFF0055L) /* BFFF0055, -1073807275 */
+#define VI_ERROR_WINDOW_NMAPPED     (_VI_ERROR+0x3FFF0057L) /* BFFF0057, -1073807273 */
+#define VI_ERROR_RESP_PENDING       (_VI_ERROR+0x3FFF0059L) /* BFFF0059, -1073807271 */
+#define VI_ERROR_NLISTENERS         (_VI_ERROR+0x3FFF005FL) /* BFFF005F, -1073807265 */
+#define VI_ERROR_NCIC               (_VI_ERROR+0x3FFF0060L) /* BFFF0060, -1073807264 */
+#define VI_ERROR_NSYS_CNTLR         (_VI_ERROR+0x3FFF0061L) /* BFFF0061, -1073807263 */
+#define VI_ERROR_NSUP_OPER          (_VI_ERROR+0x3FFF0067L) /* BFFF0067, -1073807257 */
+#define VI_ERROR_INTR_PENDING       (_VI_ERROR+0x3FFF0068L) /* BFFF0068, -1073807256 */
+#define VI_ERROR_ASRL_PARITY        (_VI_ERROR+0x3FFF006AL) /* BFFF006A, -1073807254 */
+#define VI_ERROR_ASRL_FRAMING       (_VI_ERROR+0x3FFF006BL) /* BFFF006B, -1073807253 */
+#define VI_ERROR_ASRL_OVERRUN       (_VI_ERROR+0x3FFF006CL) /* BFFF006C, -1073807252 */
+#define VI_ERROR_TRIG_NMAPPED       (_VI_ERROR+0x3FFF006EL) /* BFFF006E, -1073807250 */
+#define VI_ERROR_NSUP_ALIGN_OFFSET  (_VI_ERROR+0x3FFF0070L) /* BFFF0070, -1073807248 */
+#define VI_ERROR_USER_BUF           (_VI_ERROR+0x3FFF0071L) /* BFFF0071, -1073807247 */
+#define VI_ERROR_RSRC_BUSY          (_VI_ERROR+0x3FFF0072L) /* BFFF0072, -1073807246 */
+#define VI_ERROR_NSUP_WIDTH         (_VI_ERROR+0x3FFF0076L) /* BFFF0076, -1073807242 */
+#define VI_ERROR_INV_PARAMETER      (_VI_ERROR+0x3FFF0078L) /* BFFF0078, -1073807240 */
+#define VI_ERROR_INV_PROT           (_VI_ERROR+0x3FFF0079L) /* BFFF0079, -1073807239 */
+#define VI_ERROR_INV_SIZE           (_VI_ERROR+0x3FFF007BL) /* BFFF007B, -1073807237 */
+#define VI_ERROR_WINDOW_MAPPED      (_VI_ERROR+0x3FFF0080L) /* BFFF0080, -1073807232 */
+#define VI_ERROR_NIMPL_OPER         (_VI_ERROR+0x3FFF0081L) /* BFFF0081, -1073807231 */
+#define VI_ERROR_INV_LENGTH         (_VI_ERROR+0x3FFF0083L) /* BFFF0083, -1073807229 */
+#define VI_ERROR_INV_MODE           (_VI_ERROR+0x3FFF0091L) /* BFFF0091, -1073807215 */
+#define VI_ERROR_SESN_NLOCKED       (_VI_ERROR+0x3FFF009CL) /* BFFF009C, -1073807204 */
+#define VI_ERROR_MEM_NSHARED        (_VI_ERROR+0x3FFF009DL) /* BFFF009D, -1073807203 */
+#define VI_ERROR_LIBRARY_NFOUND     (_VI_ERROR+0x3FFF009EL) /* BFFF009E, -1073807202 */
+#define VI_ERROR_NSUP_INTR          (_VI_ERROR+0x3FFF009FL) /* BFFF009F, -1073807201 */
+#define VI_ERROR_INV_LINE           (_VI_ERROR+0x3FFF00A0L) /* BFFF00A0, -1073807200 */
+#define VI_ERROR_FILE_ACCESS        (_VI_ERROR+0x3FFF00A1L) /* BFFF00A1, -1073807199 */
+#define VI_ERROR_FILE_IO            (_VI_ERROR+0x3FFF00A2L) /* BFFF00A2, -1073807198 */
+#define VI_ERROR_NSUP_LINE          (_VI_ERROR+0x3FFF00A3L) /* BFFF00A3, -1073807197 */
+#define VI_ERROR_NSUP_MECH          (_VI_ERROR+0x3FFF00A4L) /* BFFF00A4, -1073807196 */
+#define VI_ERROR_INTF_NUM_NCONFIG   (_VI_ERROR+0x3FFF00A5L) /* BFFF00A5, -1073807195 */
+#define VI_ERROR_CONN_LOST          (_VI_ERROR+0x3FFF00A6L) /* BFFF00A6, -1073807194 */
+#define VI_ERROR_MACHINE_NAVAIL     (_VI_ERROR+0x3FFF00A7L) /* BFFF00A7, -1073807193 */
+#define VI_ERROR_NPERMISSION        (_VI_ERROR+0x3FFF00A8L) /* BFFF00A8, -1073807192 */
+
+/*- Other VISA Definitions --------------------------------------------------*/
+
+#define VI_VERSION_MAJOR(ver)       ((((ViVersion)ver) & 0xFFF00000UL) >> 20)
+#define VI_VERSION_MINOR(ver)       ((((ViVersion)ver) & 0x000FFF00UL) >>  8)
+#define VI_VERSION_SUBMINOR(ver)    ((((ViVersion)ver) & 0x000000FFUL)      )
+
+#define VI_FIND_BUFLEN              (256)
+
+#define VI_INTF_GPIB                (1)
+#define VI_INTF_VXI                 (2)
+#define VI_INTF_GPIB_VXI            (3)
+#define VI_INTF_ASRL                (4)
+#define VI_INTF_PXI                 (5)
+#define VI_INTF_TCPIP               (6)
+#define VI_INTF_USB                 (7)
+
+#define VI_PROT_NORMAL              (1)
+#define VI_PROT_FDC                 (2)
+#define VI_PROT_HS488               (3)
+#define VI_PROT_4882_STRS           (4)
+#define VI_PROT_USBTMC_VENDOR       (5)
+
+#define VI_FDC_NORMAL               (1)
+#define VI_FDC_STREAM               (2)
+
+#define VI_LOCAL_SPACE              (0)
+#define VI_A16_SPACE                (1)
+#define VI_A24_SPACE                (2)
+#define VI_A32_SPACE                (3)
+#define VI_A64_SPACE                (4)
+#define VI_PXI_ALLOC_SPACE          (9)
+#define VI_PXI_CFG_SPACE            (10)
+#define VI_PXI_BAR0_SPACE           (11)
+#define VI_PXI_BAR1_SPACE           (12)
+#define VI_PXI_BAR2_SPACE           (13)
+#define VI_PXI_BAR3_SPACE           (14)
+#define VI_PXI_BAR4_SPACE           (15)
+#define VI_PXI_BAR5_SPACE           (16)
+#define VI_OPAQUE_SPACE             (0xFFFF)
+
+#define VI_UNKNOWN_LA               (-1)
+#define VI_UNKNOWN_SLOT             (-1)
+#define VI_UNKNOWN_LEVEL            (-1)
+#define VI_UNKNOWN_CHASSIS          (-1)
+
+#define VI_QUEUE                    (1)
+#define VI_HNDLR                    (2)
+#define VI_SUSPEND_HNDLR            (4)
+#define VI_ALL_MECH                 (0xFFFF)
+
+#define VI_ANY_HNDLR                (0)
+
+#define VI_TRIG_ALL                 (-2)
+#define VI_TRIG_SW                  (-1)
+#define VI_TRIG_TTL0                (0)
+#define VI_TRIG_TTL1                (1)
+#define VI_TRIG_TTL2                (2)
+#define VI_TRIG_TTL3                (3)
+#define VI_TRIG_TTL4                (4)
+#define VI_TRIG_TTL5                (5)
+#define VI_TRIG_TTL6                (6)
+#define VI_TRIG_TTL7                (7)
+#define VI_TRIG_ECL0                (8)
+#define VI_TRIG_ECL1                (9)
+#define VI_TRIG_PANEL_IN            (27)
+#define VI_TRIG_PANEL_OUT           (28)
+
+#define VI_TRIG_PROT_DEFAULT        (0)
+#define VI_TRIG_PROT_ON             (1)
+#define VI_TRIG_PROT_OFF            (2)
+#define VI_TRIG_PROT_SYNC           (5)
+#define VI_TRIG_PROT_RESERVE        (6)
+#define VI_TRIG_PROT_UNRESERVE      (7)
+
+#define VI_READ_BUF                 (1)
+#define VI_WRITE_BUF                (2)
+#define VI_READ_BUF_DISCARD         (4)
+#define VI_WRITE_BUF_DISCARD        (8)
+#define VI_IO_IN_BUF                (16)
+#define VI_IO_OUT_BUF               (32)
+#define VI_IO_IN_BUF_DISCARD        (64)
+#define VI_IO_OUT_BUF_DISCARD       (128)
+
+#define VI_FLUSH_ON_ACCESS          (1)
+#define VI_FLUSH_WHEN_FULL          (2)
+#define VI_FLUSH_DISABLE            (3)
+
+#define VI_NMAPPED                  (1)
+#define VI_USE_OPERS                (2)
+#define VI_DEREF_ADDR               (3)
+#define VI_DEREF_ADDR_BYTE_SWAP     (4)
+
+#define VI_TMO_IMMEDIATE            (0L)
+#define VI_TMO_INFINITE             (0xFFFFFFFFUL)
+
+#define VI_NO_LOCK                  (0)
+#define VI_EXCLUSIVE_LOCK           (1)
+#define VI_SHARED_LOCK              (2)
+#define VI_LOAD_CONFIG              (4)
+
+#define VI_NO_SEC_ADDR              (0xFFFF)
+
+#define VI_ASRL_PAR_NONE            (0)
+#define VI_ASRL_PAR_ODD             (1)
+#define VI_ASRL_PAR_EVEN            (2)
+#define VI_ASRL_PAR_MARK            (3)
+#define VI_ASRL_PAR_SPACE           (4)
+
+#define VI_ASRL_STOP_ONE            (10)
+#define VI_ASRL_STOP_ONE5           (15)
+#define VI_ASRL_STOP_TWO            (20)
+
+#define VI_ASRL_FLOW_NONE           (0)
+#define VI_ASRL_FLOW_XON_XOFF       (1)
+#define VI_ASRL_FLOW_RTS_CTS        (2)
+#define VI_ASRL_FLOW_DTR_DSR        (4)
+
+#define VI_ASRL_END_NONE            (0)
+#define VI_ASRL_END_LAST_BIT        (1)
+#define VI_ASRL_END_TERMCHAR        (2)
+#define VI_ASRL_END_BREAK           (3)
+
+#define VI_STATE_ASSERTED           (1)
+#define VI_STATE_UNASSERTED         (0)
+#define VI_STATE_UNKNOWN            (-1)
+
+#define VI_BIG_ENDIAN               (0)
+#define VI_LITTLE_ENDIAN            (1)
+
+#define VI_DATA_PRIV                (0)
+#define VI_DATA_NPRIV               (1)
+#define VI_PROG_PRIV                (2)
+#define VI_PROG_NPRIV               (3)
+#define VI_BLCK_PRIV                (4)
+#define VI_BLCK_NPRIV               (5)
+#define VI_D64_PRIV                 (6)
+#define VI_D64_NPRIV                (7)
+
+#define VI_WIDTH_8                  (1)
+#define VI_WIDTH_16                 (2)
+#define VI_WIDTH_32                 (4)
+#define VI_WIDTH_64                 (8)
+
+#define VI_GPIB_REN_DEASSERT        (0)
+#define VI_GPIB_REN_ASSERT          (1)
+#define VI_GPIB_REN_DEASSERT_GTL    (2)
+#define VI_GPIB_REN_ASSERT_ADDRESS  (3)
+#define VI_GPIB_REN_ASSERT_LLO      (4)
+#define VI_GPIB_REN_ASSERT_ADDRESS_LLO (5)
+#define VI_GPIB_REN_ADDRESS_GTL     (6)
+
+#define VI_GPIB_ATN_DEASSERT        (0)
+#define VI_GPIB_ATN_ASSERT          (1)
+#define VI_GPIB_ATN_DEASSERT_HANDSHAKE (2)
+#define VI_GPIB_ATN_ASSERT_IMMEDIATE (3)
+
+#define VI_GPIB_HS488_DISABLED      (0)
+#define VI_GPIB_HS488_NIMPL         (-1)
+
+#define VI_GPIB_UNADDRESSED         (0)
+#define VI_GPIB_TALKER              (1)
+#define VI_GPIB_LISTENER            (2)
+
+#define VI_VXI_CMD16                (0x0200)
+#define VI_VXI_CMD16_RESP16         (0x0202)
+#define VI_VXI_RESP16               (0x0002)
+#define VI_VXI_CMD32                (0x0400)
+#define VI_VXI_CMD32_RESP16         (0x0402)
+#define VI_VXI_CMD32_RESP32         (0x0404)
+#define VI_VXI_RESP32               (0x0004)
+
+#define VI_ASSERT_SIGNAL            (-1)
+#define VI_ASSERT_USE_ASSIGNED      (0)
+#define VI_ASSERT_IRQ1              (1)
+#define VI_ASSERT_IRQ2              (2)
+#define VI_ASSERT_IRQ3              (3)
+#define VI_ASSERT_IRQ4              (4)
+#define VI_ASSERT_IRQ5              (5)
+#define VI_ASSERT_IRQ6              (6)
+#define VI_ASSERT_IRQ7              (7)
+
+#define VI_UTIL_ASSERT_SYSRESET     (1)
+#define VI_UTIL_ASSERT_SYSFAIL      (2)
+#define VI_UTIL_DEASSERT_SYSFAIL    (3)
+
+#define VI_VXI_CLASS_MEMORY         (0)
+#define VI_VXI_CLASS_EXTENDED       (1)
+#define VI_VXI_CLASS_MESSAGE        (2)
+#define VI_VXI_CLASS_REGISTER       (3)
+#define VI_VXI_CLASS_OTHER          (4)
+
+#define VI_PXI_ADDR_NONE            (0)
+#define VI_PXI_ADDR_MEM             (1)
+#define VI_PXI_ADDR_IO              (2)
+#define VI_PXI_ADDR_CFG             (3)
+
+#define VI_TRIG_UNKNOWN             (-1)
+
+#define VI_PXI_LBUS_UNKNOWN         (-1)
+#define VI_PXI_LBUS_NONE            (0)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_0 (1000)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_1 (1001)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_2 (1002)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_3 (1003)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_4 (1004)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_5 (1005)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_6 (1006)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_7 (1007)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_8 (1008)
+#define VI_PXI_LBUS_STAR_TRIG_BUS_9 (1009)
+#define VI_PXI_STAR_TRIG_CONTROLLER (1413)
+
+/*- Backward Compatibility Macros -------------------------------------------*/
+
+#define viGetDefaultRM(vi)          viOpenDefaultRM(vi)
+#define VI_ERROR_INV_SESSION        (VI_ERROR_INV_OBJECT)
+#define VI_INFINITE                 (VI_TMO_INFINITE)
+#define VI_NORMAL                   (VI_PROT_NORMAL)
+#define VI_FDC                      (VI_PROT_FDC)
+#define VI_HS488                    (VI_PROT_HS488)
+#define VI_ASRL488                  (VI_PROT_4882_STRS)
+#define VI_ASRL_IN_BUF              (VI_IO_IN_BUF)
+#define VI_ASRL_OUT_BUF             (VI_IO_OUT_BUF)
+#define VI_ASRL_IN_BUF_DISCARD      (VI_IO_IN_BUF_DISCARD)
+#define VI_ASRL_OUT_BUF_DISCARD     (VI_IO_OUT_BUF_DISCARD)
+
+/*- National Instruments ----------------------------------------------------*/
+
+#define VI_INTF_RIO                 (8)
+#define VI_INTF_FIREWIRE            (9) 
+
+#define VI_ATTR_SYNC_MXI_ALLOW_EN   (0x3FFF0161UL) /* ViBoolean, read/write */
+
+/* This is for VXI SERVANT resources */
+
+#define VI_EVENT_VXI_DEV_CMD        (0xBFFF200FUL)
+#define VI_ATTR_VXI_DEV_CMD_TYPE    (0x3FFF4037UL) /* ViInt16, read-only */
+#define VI_ATTR_VXI_DEV_CMD_VALUE   (0x3FFF4038UL) /* ViUInt32, read-only */
+
+#define VI_VXI_DEV_CMD_TYPE_16      (16)
+#define VI_VXI_DEV_CMD_TYPE_32      (32)
+
+ViStatus _VI_FUNC viVxiServantResponse(ViSession vi, ViInt16 mode, ViUInt32 resp);
+/* mode values include VI_VXI_RESP16, VI_VXI_RESP32, and the next 2 values */
+#define VI_VXI_RESP_NONE            (0)
+#define VI_VXI_RESP_PROT_ERROR      (-1)
+
+/* This allows extended Serial support on Win32 and on NI ENET Serial products */
+
+#define VI_ATTR_ASRL_DISCARD_NULL   (0x3FFF00B0UL)
+#define VI_ATTR_ASRL_CONNECTED      (0x3FFF01BBUL)
+#define VI_ATTR_ASRL_BREAK_STATE    (0x3FFF01BCUL)
+#define VI_ATTR_ASRL_BREAK_LEN      (0x3FFF01BDUL)
+#define VI_ATTR_ASRL_ALLOW_TRANSMIT (0x3FFF01BEUL)
+#define VI_ATTR_ASRL_WIRE_MODE      (0x3FFF01BFUL)
+
+#define VI_ASRL_WIRE_485_4          (0)
+#define VI_ASRL_WIRE_485_2_DTR_ECHO (1)
+#define VI_ASRL_WIRE_485_2_DTR_CTRL (2)
+#define VI_ASRL_WIRE_485_2_AUTO     (3)
+#define VI_ASRL_WIRE_232_DTE        (128)
+#define VI_ASRL_WIRE_232_DCE        (129)
+#define VI_ASRL_WIRE_232_AUTO       (130)
+
+#define VI_EVENT_ASRL_BREAK         (0x3FFF2023UL)
+#define VI_EVENT_ASRL_CTS           (0x3FFF2029UL)
+#define VI_EVENT_ASRL_DSR           (0x3FFF202AUL)
+#define VI_EVENT_ASRL_DCD           (0x3FFF202CUL)
+#define VI_EVENT_ASRL_RI            (0x3FFF202EUL)
+#define VI_EVENT_ASRL_CHAR          (0x3FFF2035UL)
+#define VI_EVENT_ASRL_TERMCHAR      (0x3FFF2024UL)
+
+/* This is for fast viPeek/viPoke macros */
+
+#if defined(NIVISA_PEEKPOKE)
+
+#if defined(NIVISA_PEEKPOKE_SUPP)
+#undef NIVISA_PEEKPOKE_SUPP
+#endif
+
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_)
+/* This macro is supported for all Win32 compilers, including CVI. */
+#define NIVISA_PEEKPOKE_SUPP
+#elif (defined(_WINDOWS) || defined(_Windows)) && !defined(_CVI_) && !defined(_NI_mswin16_)
+/* This macro is supported for Borland and Microsoft compilers on Win16, but not CVI. */
+#define NIVISA_PEEKPOKE_SUPP
+#elif defined(_CVI_) && defined(_NI_sparc_)
+/* This macro is supported for Solaris 1 and 2, from CVI only. */
+#define NIVISA_PEEKPOKE_SUPP
+#else
+/* This macro is not supported on other platforms. */
+#endif
+
+#if defined(NIVISA_PEEKPOKE_SUPP)
+
+extern ViBoolean NI_viImplVISA1;
+ViStatus _VI_FUNC NI_viOpenDefaultRM (ViPSession vi);
+#define viOpenDefaultRM(vi) NI_viOpenDefaultRM(vi)
+
+#define viPeek8(vi,addr,val)                                                \
+   {                                                                        \
+      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
+      {                                                                     \
+         do (*((ViPUInt8)(val)) = *((volatile ViUInt8 _VI_PTR)(addr)));     \
+         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
+      }                                                                     \
+      else                                                                  \
+      {                                                                     \
+         (viPeek8)((vi),(addr),(val));                                      \
+      }                                                                     \
+   }
+
+#define viPoke8(vi,addr,val)                                                \
+   {                                                                        \
+      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
+      {                                                                     \
+         do (*((volatile ViUInt8 _VI_PTR)(addr)) = ((ViUInt8)(val)));       \
+         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
+      }                                                                     \
+      else                                                                  \
+      {                                                                     \
+         (viPoke8)((vi),(addr),(val));                                      \
+      }                                                                     \
+   }
+
+#define viPeek16(vi,addr,val)                                               \
+   {                                                                        \
+      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
+      {                                                                     \
+         do (*((ViPUInt16)(val)) = *((volatile ViUInt16 _VI_PTR)(addr)));   \
+         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
+      }                                                                     \
+      else                                                                  \
+      {                                                                     \
+         (viPeek16)((vi),(addr),(val));                                     \
+      }                                                                     \
+   }
+
+#define viPoke16(vi,addr,val)                                               \
+   {                                                                        \
+      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
+      {                                                                     \
+         do (*((volatile ViUInt16 _VI_PTR)(addr)) = ((ViUInt16)(val)));     \
+         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
+      }                                                                     \
+      else                                                                  \
+      {                                                                     \
+         (viPoke16)((vi),(addr),(val));                                     \
+      }                                                                     \
+   }
+
+#define viPeek32(vi,addr,val)                                               \
+   {                                                                        \
+      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
+      {                                                                     \
+         do (*((ViPUInt32)(val)) = *((volatile ViUInt32 _VI_PTR)(addr)));   \
+         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
+      }                                                                     \
+      else                                                                  \
+      {                                                                     \
+         (viPeek32)((vi),(addr),(val));                                     \
+      }                                                                     \
+   }
+
+#define viPoke32(vi,addr,val)                                               \
+   {                                                                        \
+      if ((NI_viImplVISA1) && (*((ViPUInt32)(vi))))                         \
+      {                                                                     \
+         do (*((volatile ViUInt32 _VI_PTR)(addr)) = ((ViUInt32)(val)));     \
+         while (**((volatile ViUInt8 _VI_PTR _VI_PTR)(vi)) & 0x10);         \
+      }                                                                     \
+      else                                                                  \
+      {                                                                     \
+         (viPoke32)((vi),(addr),(val));                                     \
+      }                                                                     \
+   }
+
+#endif
+
+#endif
+
+#if defined(NIVISA_PXI) || defined(PXISAVISA_PXI)
+
+#if 0
+/* The following 2 attributes were incorrectly implemented in earlier
+   versions of NI-VISA.  You should now query VI_ATTR_MANF_ID or
+   VI_ATTR_MODEL_CODE.  Those attributes contain sub-vendor information
+   when it exists.  To get both the actual primary and subvendor codes
+   from the device, you should call viIn16 using VI_PXI_CFG_SPACE. */
+#define VI_ATTR_PXI_SUB_MANF_ID     (0x3FFF0203UL)
+#define VI_ATTR_PXI_SUB_MODEL_CODE  (0x3FFF0204UL)
+#endif
+
+#define VI_ATTR_PXI_SRC_TRIG_BUS    (0x3FFF020DUL)
+#define VI_ATTR_PXI_DEST_TRIG_BUS   (0x3FFF020EUL)
+
+#define VI_ATTR_PXI_RECV_INTR_SEQ   (0x3FFF4240UL)
+#define VI_ATTR_PXI_RECV_INTR_DATA  (0x3FFF4241UL)
+
+#endif
+
+#if defined(NIVISA_USB)
+
+#define VI_ATTR_USB_BULK_OUT_PIPE   (0x3FFF01A2UL)
+#define VI_ATTR_USB_BULK_IN_PIPE    (0x3FFF01A3UL)
+#define VI_ATTR_USB_INTR_IN_PIPE    (0x3FFF01A4UL)
+#define VI_ATTR_USB_CLASS           (0x3FFF01A5UL)
+#define VI_ATTR_USB_SUBCLASS        (0x3FFF01A6UL)
+#define VI_ATTR_USB_ALT_SETTING     (0x3FFF01A8UL)
+#define VI_ATTR_USB_END_IN          (0x3FFF01A9UL)
+#define VI_ATTR_USB_NUM_INTFCS      (0x3FFF01AAUL)
+#define VI_ATTR_USB_NUM_PIPES       (0x3FFF01ABUL)
+#define VI_ATTR_USB_BULK_OUT_STATUS (0x3FFF01ACUL)
+#define VI_ATTR_USB_BULK_IN_STATUS  (0x3FFF01ADUL)
+#define VI_ATTR_USB_INTR_IN_STATUS  (0x3FFF01AEUL)
+#define VI_ATTR_USB_CTRL_PIPE       (0x3FFF01B0UL)
+
+#define VI_USB_PIPE_STATE_UNKNOWN   (-1)
+#define VI_USB_PIPE_READY           (0)
+#define VI_USB_PIPE_STALLED         (1)
+
+#define VI_USB_END_NONE             (0)
+#define VI_USB_END_SHORT            (4)
+#define VI_USB_END_SHORT_OR_COUNT   (5)
+
+#endif
+
+#define VI_ATTR_FIREWIRE_DEST_UPPER_OFFSET (0x3FFF01F0UL)
+#define VI_ATTR_FIREWIRE_SRC_UPPER_OFFSET  (0x3FFF01F1UL)
+#define VI_ATTR_FIREWIRE_WIN_UPPER_OFFSET  (0x3FFF01F2UL)
+#define VI_ATTR_FIREWIRE_VENDOR_ID         (0x3FFF01F3UL)
+#define VI_ATTR_FIREWIRE_LOWER_CHIP_ID     (0x3FFF01F4UL)
+#define VI_ATTR_FIREWIRE_UPPER_CHIP_ID     (0x3FFF01F5UL)
+
+#define VI_FIREWIRE_DFLT_SPACE           (5)
+
+#if defined(__cplusplus) || defined(__cplusplus__)
+   }
+#endif
+
+#endif
+
+/*- The End -----------------------------------------------------------------*/
diff --git a/third_party/allwpilib_2018/hal/src/main/native/athena/visa/visatype.h b/third_party/allwpilib_2018/hal/src/main/native/athena/visa/visatype.h
new file mode 100644
index 0000000..ef089dd
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/athena/visa/visatype.h
@@ -0,0 +1,201 @@
+/*---------------------------------------------------------------------------*/
+/* Distributed by IVI Foundation Inc.                                        */
+/*                                                                           */
+/* Do not modify the contents of this file.                                  */
+/*---------------------------------------------------------------------------*/
+/*                                                                           */
+/* Title   : VISATYPE.H                                                      */
+/* Date    : 04-14-2006                                                      */
+/* Purpose : Fundamental VISA data types and macro definitions               */
+/*                                                                           */
+/*---------------------------------------------------------------------------*/
+
+#ifndef __VISATYPE_HEADER__
+#define __VISATYPE_HEADER__
+
+#if defined(_WIN64)
+#define _VI_FAR
+#define _VI_FUNC            __fastcall
+#define _VI_FUNCC           __fastcall
+#define _VI_FUNCH           __fastcall
+#define _VI_SIGNED          signed
+#elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_)
+#define _VI_FAR
+#define _VI_FUNC            __stdcall
+#define _VI_FUNCC           __cdecl
+#define _VI_FUNCH           __stdcall
+#define _VI_SIGNED          signed
+#elif defined(_CVI_) && defined(_NI_i386_)
+#define _VI_FAR
+#define _VI_FUNC            _pascal
+#define _VI_FUNCC
+#define _VI_FUNCH           _pascal
+#define _VI_SIGNED          signed
+#elif (defined(_WINDOWS) || defined(_Windows)) && !defined(_NI_mswin16_)
+#define _VI_FAR             _far
+#define _VI_FUNC            _far _pascal _export
+#define _VI_FUNCC           _far _cdecl  _export
+#define _VI_FUNCH           _far _pascal
+#define _VI_SIGNED          signed
+#elif (defined(hpux) || defined(__hpux)) && (defined(__cplusplus) || defined(__cplusplus__))
+#define _VI_FAR
+#define _VI_FUNC
+#define _VI_FUNCC
+#define _VI_FUNCH
+#define _VI_SIGNED
+#else
+#define _VI_FAR
+#define _VI_FUNC
+#define _VI_FUNCC
+#define _VI_FUNCH
+#define _VI_SIGNED          signed
+#endif
+
+#define _VI_ERROR           (-2147483647L-1)  /* 0x80000000 */
+#define _VI_PTR             _VI_FAR *
+
+/*- VISA Types --------------------------------------------------------------*/
+
+#ifndef _VI_INT64_UINT64_DEFINED
+#if defined(_WIN64) || ((defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)) && !defined(_NI_mswin16_))
+#if (defined(_MSC_VER) && (_MSC_VER >= 1200)) || (defined(_CVI_) && (_CVI_ >= 700)) || (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520))
+typedef unsigned   __int64  ViUInt64;
+typedef _VI_SIGNED __int64  ViInt64;
+#define _VI_INT64_UINT64_DEFINED
+#if defined(_WIN64)
+#define _VISA_ENV_IS_64_BIT
+#else
+/* This is a 32-bit OS, not a 64-bit OS */
+#endif
+#endif
+#elif defined(__GNUC__) && (__GNUC__ >= 3)
+#include <limits.h>
+#include <sys/types.h>
+typedef u_int64_t           ViUInt64;
+typedef int64_t             ViInt64;
+#define _VI_INT64_UINT64_DEFINED
+#if defined(LONG_MAX) && (LONG_MAX > 0x7FFFFFFFL)
+#define _VISA_ENV_IS_64_BIT
+#else
+/* This is a 32-bit OS, not a 64-bit OS */
+#endif
+#else
+/* This platform does not support 64-bit types */
+#endif
+#endif
+
+#if defined(_VI_INT64_UINT64_DEFINED)
+typedef ViUInt64    _VI_PTR ViPUInt64;
+typedef ViUInt64    _VI_PTR ViAUInt64;
+typedef ViInt64     _VI_PTR ViPInt64;
+typedef ViInt64     _VI_PTR ViAInt64;
+#endif
+
+#if defined(LONG_MAX) && (LONG_MAX > 0x7FFFFFFFL)
+typedef unsigned int        ViUInt32;
+typedef _VI_SIGNED int      ViInt32;
+#else
+typedef unsigned long       ViUInt32;
+typedef _VI_SIGNED long     ViInt32;
+#endif
+
+typedef ViUInt32    _VI_PTR ViPUInt32;
+typedef ViUInt32    _VI_PTR ViAUInt32;
+typedef ViInt32     _VI_PTR ViPInt32;
+typedef ViInt32     _VI_PTR ViAInt32;
+
+typedef unsigned short      ViUInt16;
+typedef ViUInt16    _VI_PTR ViPUInt16;
+typedef ViUInt16    _VI_PTR ViAUInt16;
+
+typedef _VI_SIGNED short    ViInt16;
+typedef ViInt16     _VI_PTR ViPInt16;
+typedef ViInt16     _VI_PTR ViAInt16;
+
+typedef unsigned char       ViUInt8;
+typedef ViUInt8     _VI_PTR ViPUInt8;
+typedef ViUInt8     _VI_PTR ViAUInt8;
+
+typedef _VI_SIGNED char     ViInt8;
+typedef ViInt8      _VI_PTR ViPInt8;
+typedef ViInt8      _VI_PTR ViAInt8;
+
+typedef char                ViChar;
+typedef ViChar      _VI_PTR ViPChar;
+typedef ViChar      _VI_PTR ViAChar;
+
+typedef unsigned char       ViByte;
+typedef ViByte      _VI_PTR ViPByte;
+typedef ViByte      _VI_PTR ViAByte;
+
+typedef void        _VI_PTR ViAddr;
+typedef ViAddr      _VI_PTR ViPAddr;
+typedef ViAddr      _VI_PTR ViAAddr;
+
+typedef float               ViReal32;
+typedef ViReal32    _VI_PTR ViPReal32;
+typedef ViReal32    _VI_PTR ViAReal32;
+
+typedef double              ViReal64;
+typedef ViReal64    _VI_PTR ViPReal64;
+typedef ViReal64    _VI_PTR ViAReal64;
+
+typedef ViPByte             ViBuf;
+typedef ViPByte             ViPBuf;
+typedef ViPByte     _VI_PTR ViABuf;
+
+typedef ViPChar             ViString;
+typedef ViPChar             ViPString;
+typedef ViPChar     _VI_PTR ViAString;
+
+typedef ViString            ViRsrc;
+typedef ViString            ViPRsrc;
+typedef ViString    _VI_PTR ViARsrc;
+
+typedef ViUInt16            ViBoolean;
+typedef ViBoolean   _VI_PTR ViPBoolean;
+typedef ViBoolean   _VI_PTR ViABoolean;
+
+typedef ViInt32             ViStatus;
+typedef ViStatus    _VI_PTR ViPStatus;
+typedef ViStatus    _VI_PTR ViAStatus;
+
+typedef ViUInt32            ViVersion;
+typedef ViVersion   _VI_PTR ViPVersion;
+typedef ViVersion   _VI_PTR ViAVersion;
+
+typedef ViUInt32            ViObject;
+typedef ViObject    _VI_PTR ViPObject;
+typedef ViObject    _VI_PTR ViAObject;
+
+typedef ViObject            ViSession;
+typedef ViSession   _VI_PTR ViPSession;
+typedef ViSession   _VI_PTR ViASession;
+
+typedef ViUInt32             ViAttr;
+
+#ifndef _VI_CONST_STRING_DEFINED
+typedef const ViChar * ViConstString;
+#define _VI_CONST_STRING_DEFINED
+#endif  
+
+/*- Completion and Error Codes ----------------------------------------------*/
+
+#define VI_SUCCESS          (0L)
+
+/*- Other VISA Definitions --------------------------------------------------*/
+
+#define VI_NULL             (0)
+
+#define VI_TRUE             (1)
+#define VI_FALSE            (0)
+
+/*- Backward Compatibility Macros -------------------------------------------*/
+
+#define VISAFN              _VI_FUNC
+#define ViPtr               _VI_PTR
+
+#endif
+
+/*- The End -----------------------------------------------------------------*/
+
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Accelerometer.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Accelerometer.h
new file mode 100644
index 0000000..33c0bc4
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Accelerometer.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "HAL/Types.h"
+
+enum HAL_AccelerometerRange : int32_t {
+  HAL_AccelerometerRange_k2G = 0,
+  HAL_AccelerometerRange_k4G = 1,
+  HAL_AccelerometerRange_k8G = 2,
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+void HAL_SetAccelerometerActive(HAL_Bool active);
+void HAL_SetAccelerometerRange(HAL_AccelerometerRange range);
+double HAL_GetAccelerometerX(void);
+double HAL_GetAccelerometerY(void);
+double HAL_GetAccelerometerZ(void);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogAccumulator.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogAccumulator.h
new file mode 100644
index 0000000..bb5108d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogAccumulator.h
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_Bool HAL_IsAccumulatorChannel(HAL_AnalogInputHandle analogPortHandle,
+                                  int32_t* status);
+void HAL_InitAccumulator(HAL_AnalogInputHandle analogPortHandle,
+                         int32_t* status);
+void HAL_ResetAccumulator(HAL_AnalogInputHandle analogPortHandle,
+                          int32_t* status);
+void HAL_SetAccumulatorCenter(HAL_AnalogInputHandle analogPortHandle,
+                              int32_t center, int32_t* status);
+void HAL_SetAccumulatorDeadband(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t deadband, int32_t* status);
+int64_t HAL_GetAccumulatorValue(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t* status);
+int64_t HAL_GetAccumulatorCount(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t* status);
+void HAL_GetAccumulatorOutput(HAL_AnalogInputHandle analogPortHandle,
+                              int64_t* value, int64_t* count, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogGyro.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogGyro.h
new file mode 100644
index 0000000..94b47fd
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogGyro.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_GyroHandle HAL_InitializeAnalogGyro(HAL_AnalogInputHandle handle,
+                                        int32_t* status);
+void HAL_SetupAnalogGyro(HAL_GyroHandle handle, int32_t* status);
+void HAL_FreeAnalogGyro(HAL_GyroHandle handle);
+void HAL_SetAnalogGyroParameters(HAL_GyroHandle handle,
+                                 double voltsPerDegreePerSecond, double offset,
+                                 int32_t center, int32_t* status);
+void HAL_SetAnalogGyroVoltsPerDegreePerSecond(HAL_GyroHandle handle,
+                                              double voltsPerDegreePerSecond,
+                                              int32_t* status);
+void HAL_ResetAnalogGyro(HAL_GyroHandle handle, int32_t* status);
+void HAL_CalibrateAnalogGyro(HAL_GyroHandle handle, int32_t* status);
+void HAL_SetAnalogGyroDeadband(HAL_GyroHandle handle, double volts,
+                               int32_t* status);
+double HAL_GetAnalogGyroAngle(HAL_GyroHandle handle, int32_t* status);
+double HAL_GetAnalogGyroRate(HAL_GyroHandle handle, int32_t* status);
+double HAL_GetAnalogGyroOffset(HAL_GyroHandle handle, int32_t* status);
+int32_t HAL_GetAnalogGyroCenter(HAL_GyroHandle handle, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogInput.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogInput.h
new file mode 100644
index 0000000..e496bc2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogInput.h
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_AnalogInputHandle HAL_InitializeAnalogInputPort(HAL_PortHandle portHandle,
+                                                    int32_t* status);
+void HAL_FreeAnalogInputPort(HAL_AnalogInputHandle analogPortHandle);
+HAL_Bool HAL_CheckAnalogModule(int32_t module);
+HAL_Bool HAL_CheckAnalogInputChannel(int32_t channel);
+
+void HAL_SetAnalogSampleRate(double samplesPerSecond, int32_t* status);
+double HAL_GetAnalogSampleRate(int32_t* status);
+void HAL_SetAnalogAverageBits(HAL_AnalogInputHandle analogPortHandle,
+                              int32_t bits, int32_t* status);
+int32_t HAL_GetAnalogAverageBits(HAL_AnalogInputHandle analogPortHandle,
+                                 int32_t* status);
+void HAL_SetAnalogOversampleBits(HAL_AnalogInputHandle analogPortHandle,
+                                 int32_t bits, int32_t* status);
+int32_t HAL_GetAnalogOversampleBits(HAL_AnalogInputHandle analogPortHandle,
+                                    int32_t* status);
+int32_t HAL_GetAnalogValue(HAL_AnalogInputHandle analogPortHandle,
+                           int32_t* status);
+int32_t HAL_GetAnalogAverageValue(HAL_AnalogInputHandle analogPortHandle,
+                                  int32_t* status);
+int32_t HAL_GetAnalogVoltsToValue(HAL_AnalogInputHandle analogPortHandle,
+                                  double voltage, int32_t* status);
+double HAL_GetAnalogVoltage(HAL_AnalogInputHandle analogPortHandle,
+                            int32_t* status);
+double HAL_GetAnalogAverageVoltage(HAL_AnalogInputHandle analogPortHandle,
+                                   int32_t* status);
+int32_t HAL_GetAnalogLSBWeight(HAL_AnalogInputHandle analogPortHandle,
+                               int32_t* status);
+int32_t HAL_GetAnalogOffset(HAL_AnalogInputHandle analogPortHandle,
+                            int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogOutput.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogOutput.h
new file mode 100644
index 0000000..3cfd4ec
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogOutput.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_AnalogOutputHandle HAL_InitializeAnalogOutputPort(HAL_PortHandle portHandle,
+                                                      int32_t* status);
+void HAL_FreeAnalogOutputPort(HAL_AnalogOutputHandle analogOutputHandle);
+void HAL_SetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
+                         double voltage, int32_t* status);
+double HAL_GetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
+                           int32_t* status);
+HAL_Bool HAL_CheckAnalogOutputChannel(int32_t channel);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogTrigger.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogTrigger.h
new file mode 100644
index 0000000..53aab00
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/AnalogTrigger.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+enum HAL_AnalogTriggerType : int32_t {
+  HAL_Trigger_kInWindow = 0,
+  HAL_Trigger_kState = 1,
+  HAL_Trigger_kRisingPulse = 2,
+  HAL_Trigger_kFallingPulse = 3
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
+    HAL_AnalogInputHandle portHandle, int32_t* index, int32_t* status);
+void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
+                            int32_t* status);
+void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                   int32_t lower, int32_t upper,
+                                   int32_t* status);
+void HAL_SetAnalogTriggerLimitsVoltage(
+    HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
+    int32_t* status);
+void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                  HAL_Bool useAveragedValue, int32_t* status);
+void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                  HAL_Bool useFilteredValue, int32_t* status);
+HAL_Bool HAL_GetAnalogTriggerInWindow(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
+HAL_Bool HAL_GetAnalogTriggerTriggerState(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status);
+HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                    HAL_AnalogTriggerType type,
+                                    int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/CAN.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/CAN.h
new file mode 100644
index 0000000..16a1577
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/CAN.h
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+// These are copies of defines located in CANSessionMux.h prepended with HAL_
+
+#define HAL_CAN_SEND_PERIOD_NO_REPEAT 0
+#define HAL_CAN_SEND_PERIOD_STOP_REPEATING -1
+
+/* Flags in the upper bits of the messageID */
+#define HAL_CAN_IS_FRAME_REMOTE 0x80000000
+#define HAL_CAN_IS_FRAME_11BIT 0x40000000
+
+#define HAL_ERR_CANSessionMux_InvalidBuffer -44086
+#define HAL_ERR_CANSessionMux_MessageNotFound -44087
+#define HAL_WARN_CANSessionMux_NoToken 44087
+#define HAL_ERR_CANSessionMux_NotAllowed -44088
+#define HAL_ERR_CANSessionMux_NotInitialized -44089
+#define HAL_ERR_CANSessionMux_SessionOverrun 44050
+
+struct HAL_CANStreamMessage {
+  uint32_t messageID;
+  uint32_t timeStamp;
+  uint8_t data[8];
+  uint8_t dataSize;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HAL_CAN_SendMessage(uint32_t messageID, const uint8_t* data,
+                         uint8_t dataSize, int32_t periodMs, int32_t* status);
+void HAL_CAN_ReceiveMessage(uint32_t* messageID, uint32_t messageIDMask,
+                            uint8_t* data, uint8_t* dataSize,
+                            uint32_t* timeStamp, int32_t* status);
+void HAL_CAN_OpenStreamSession(uint32_t* sessionHandle, uint32_t messageID,
+                               uint32_t messageIDMask, uint32_t maxMessages,
+                               int32_t* status);
+void HAL_CAN_CloseStreamSession(uint32_t sessionHandle);
+void HAL_CAN_ReadStreamSession(uint32_t sessionHandle,
+                               struct HAL_CANStreamMessage* messages,
+                               uint32_t messagesToRead, uint32_t* messagesRead,
+                               int32_t* status);
+void HAL_CAN_GetCANStatus(float* percentBusUtilization, uint32_t* busOffCount,
+                          uint32_t* txFullCount, uint32_t* receiveErrorCount,
+                          uint32_t* transmitErrorCount, int32_t* status);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/ChipObject.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/ChipObject.h
new file mode 100644
index 0000000..878595b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/ChipObject.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpedantic"
+#pragma GCC diagnostic ignored "-Wignored-qualifiers"
+
+#include <stdint.h>
+
+#include <FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h>
+#include <FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h>
+#include <FRC_FPGA_ChipObject/tDMAChannelDescriptor.h>
+#include <FRC_FPGA_ChipObject/tDMAManager.h>
+#include <FRC_FPGA_ChipObject/tInterruptManager.h>
+#include <FRC_FPGA_ChipObject/tSystem.h>
+#include <FRC_FPGA_ChipObject/tSystemInterface.h>
+
+namespace hal {
+using namespace nFPGA;
+using namespace nRoboRIO_FPGANamespace;
+}  // namespace hal
+
+#pragma GCC diagnostic pop
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Compressor.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Compressor.h
new file mode 100644
index 0000000..5c7e57f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Compressor.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_CompressorHandle HAL_InitializeCompressor(int32_t module, int32_t* status);
+HAL_Bool HAL_CheckCompressorModule(int32_t module);
+
+HAL_Bool HAL_GetCompressor(HAL_CompressorHandle compressorHandle,
+                           int32_t* status);
+
+void HAL_SetCompressorClosedLoopControl(HAL_CompressorHandle compressorHandle,
+                                        HAL_Bool value, int32_t* status);
+HAL_Bool HAL_GetCompressorClosedLoopControl(
+    HAL_CompressorHandle compressorHandle, int32_t* status);
+
+HAL_Bool HAL_GetCompressorPressureSwitch(HAL_CompressorHandle compressorHandle,
+                                         int32_t* status);
+double HAL_GetCompressorCurrent(HAL_CompressorHandle compressorHandle,
+                                int32_t* status);
+
+HAL_Bool HAL_GetCompressorCurrentTooHighFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status);
+HAL_Bool HAL_GetCompressorCurrentTooHighStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status);
+HAL_Bool HAL_GetCompressorShortedStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status);
+HAL_Bool HAL_GetCompressorShortedFault(HAL_CompressorHandle compressorHandle,
+                                       int32_t* status);
+HAL_Bool HAL_GetCompressorNotConnectedStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status);
+HAL_Bool HAL_GetCompressorNotConnectedFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Constants.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Constants.h
new file mode 100644
index 0000000..60c72f6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Constants.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int32_t HAL_GetSystemClockTicksPerMicrosecond(void);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Counter.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Counter.h
new file mode 100644
index 0000000..cee8dbb
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Counter.h
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Types.h"
+
+enum HAL_Counter_Mode : int32_t {
+  HAL_Counter_kTwoPulse = 0,
+  HAL_Counter_kSemiperiod = 1,
+  HAL_Counter_kPulseLength = 2,
+  HAL_Counter_kExternalDirection = 3
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
+                                        int32_t* status);
+void HAL_FreeCounter(HAL_CounterHandle counterHandle, int32_t* status);
+void HAL_SetCounterAverageSize(HAL_CounterHandle counterHandle, int32_t size,
+                               int32_t* status);
+void HAL_SetCounterUpSource(HAL_CounterHandle counterHandle,
+                            HAL_Handle digitalSourceHandle,
+                            HAL_AnalogTriggerType analogTriggerType,
+                            int32_t* status);
+void HAL_SetCounterUpSourceEdge(HAL_CounterHandle counterHandle,
+                                HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                int32_t* status);
+void HAL_ClearCounterUpSource(HAL_CounterHandle counterHandle, int32_t* status);
+void HAL_SetCounterDownSource(HAL_CounterHandle counterHandle,
+                              HAL_Handle digitalSourceHandle,
+                              HAL_AnalogTriggerType analogTriggerType,
+                              int32_t* status);
+void HAL_SetCounterDownSourceEdge(HAL_CounterHandle counterHandle,
+                                  HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                  int32_t* status);
+void HAL_ClearCounterDownSource(HAL_CounterHandle counterHandle,
+                                int32_t* status);
+void HAL_SetCounterUpDownMode(HAL_CounterHandle counterHandle, int32_t* status);
+void HAL_SetCounterExternalDirectionMode(HAL_CounterHandle counterHandle,
+                                         int32_t* status);
+void HAL_SetCounterSemiPeriodMode(HAL_CounterHandle counterHandle,
+                                  HAL_Bool highSemiPeriod, int32_t* status);
+void HAL_SetCounterPulseLengthMode(HAL_CounterHandle counterHandle,
+                                   double threshold, int32_t* status);
+int32_t HAL_GetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
+                                       int32_t* status);
+void HAL_SetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
+                                    int32_t samplesToAverage, int32_t* status);
+void HAL_ResetCounter(HAL_CounterHandle counterHandle, int32_t* status);
+int32_t HAL_GetCounter(HAL_CounterHandle counterHandle, int32_t* status);
+double HAL_GetCounterPeriod(HAL_CounterHandle counterHandle, int32_t* status);
+void HAL_SetCounterMaxPeriod(HAL_CounterHandle counterHandle, double maxPeriod,
+                             int32_t* status);
+void HAL_SetCounterUpdateWhenEmpty(HAL_CounterHandle counterHandle,
+                                   HAL_Bool enabled, int32_t* status);
+HAL_Bool HAL_GetCounterStopped(HAL_CounterHandle counterHandle,
+                               int32_t* status);
+HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
+                                 int32_t* status);
+void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
+                                    HAL_Bool reverseDirection, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/DIO.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/DIO.h
new file mode 100644
index 0000000..26ce1c7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/DIO.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_DigitalHandle HAL_InitializeDIOPort(HAL_PortHandle portHandle,
+                                        HAL_Bool input, int32_t* status);
+HAL_Bool HAL_CheckDIOChannel(int32_t channel);
+void HAL_FreeDIOPort(HAL_DigitalHandle dioPortHandle);
+HAL_DigitalPWMHandle HAL_AllocateDigitalPWM(int32_t* status);
+void HAL_FreeDigitalPWM(HAL_DigitalPWMHandle pwmGenerator, int32_t* status);
+void HAL_SetDigitalPWMRate(double rate, int32_t* status);
+void HAL_SetDigitalPWMDutyCycle(HAL_DigitalPWMHandle pwmGenerator,
+                                double dutyCycle, int32_t* status);
+void HAL_SetDigitalPWMOutputChannel(HAL_DigitalPWMHandle pwmGenerator,
+                                    int32_t channel, int32_t* status);
+void HAL_SetDIO(HAL_DigitalHandle dioPortHandle, HAL_Bool value,
+                int32_t* status);
+void HAL_SetDIODirection(HAL_DigitalHandle dioPortHandle, HAL_Bool input,
+                         int32_t* status);
+HAL_Bool HAL_GetDIO(HAL_DigitalHandle dioPortHandle, int32_t* status);
+HAL_Bool HAL_GetDIODirection(HAL_DigitalHandle dioPortHandle, int32_t* status);
+void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLength,
+               int32_t* status);
+HAL_Bool HAL_IsPulsing(HAL_DigitalHandle dioPortHandle, int32_t* status);
+HAL_Bool HAL_IsAnyPulsing(int32_t* status);
+
+void HAL_SetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t filterIndex,
+                         int32_t* status);
+int32_t HAL_GetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t* status);
+void HAL_SetFilterPeriod(int32_t filterIndex, int64_t value, int32_t* status);
+int64_t HAL_GetFilterPeriod(int32_t filterIndex, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/DriverStation.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/DriverStation.h
new file mode 100644
index 0000000..427afc6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/DriverStation.h
@@ -0,0 +1,143 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2013-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <cstddef>
+
+#include "HAL/Types.h"
+
+#define HAL_IO_CONFIG_DATA_SIZE 32
+#define HAL_SYS_STATUS_DATA_SIZE 44
+#define HAL_USER_STATUS_DATA_SIZE \
+  (984 - HAL_IO_CONFIG_DATA_SIZE - HAL_SYS_STATUS_DATA_SIZE)
+
+#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17
+#define HALFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Header 19
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Extra1 20
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Vertices1 21
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Extra2 22
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Vertices2 23
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24
+#define HALFRC_NetworkCommunication_DynamicType_Kinect_Custom 25
+
+struct HAL_ControlWord {
+  uint32_t enabled : 1;
+  uint32_t autonomous : 1;
+  uint32_t test : 1;
+  uint32_t eStop : 1;
+  uint32_t fmsAttached : 1;
+  uint32_t dsAttached : 1;
+  uint32_t control_reserved : 26;
+};
+
+enum HAL_AllianceStationID : int32_t {
+  HAL_AllianceStationID_kRed1,
+  HAL_AllianceStationID_kRed2,
+  HAL_AllianceStationID_kRed3,
+  HAL_AllianceStationID_kBlue1,
+  HAL_AllianceStationID_kBlue2,
+  HAL_AllianceStationID_kBlue3,
+};
+
+enum HAL_MatchType {
+  HAL_kMatchType_none,
+  HAL_kMatchType_practice,
+  HAL_kMatchType_qualification,
+  HAL_kMatchType_elimination,
+};
+
+/* The maximum number of axes that will be stored in a single HALJoystickAxes
+ * struct. This is used for allocating buffers, not bounds checking, since
+ * there are usually less axes in practice.
+ */
+#define HAL_kMaxJoystickAxes 12
+#define HAL_kMaxJoystickPOVs 12
+
+struct HAL_JoystickAxes {
+  int16_t count;
+  float axes[HAL_kMaxJoystickAxes];
+};
+
+struct HAL_JoystickPOVs {
+  int16_t count;
+  int16_t povs[HAL_kMaxJoystickPOVs];
+};
+
+struct HAL_JoystickButtons {
+  uint32_t buttons;
+  uint8_t count;
+};
+
+struct HAL_JoystickDescriptor {
+  uint8_t isXbox;
+  uint8_t type;
+  char name[256];
+  uint8_t axisCount;
+  uint8_t axisTypes[HAL_kMaxJoystickAxes];
+  uint8_t buttonCount;
+  uint8_t povCount;
+};
+
+struct HAL_MatchInfo {
+  char* eventName;
+  HAL_MatchType matchType;
+  uint16_t matchNumber;
+  uint8_t replayNumber;
+  char* gameSpecificMessage;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
+                      const char* details, const char* location,
+                      const char* callStack, HAL_Bool printMsg);
+
+int32_t HAL_GetControlWord(HAL_ControlWord* controlWord);
+HAL_AllianceStationID HAL_GetAllianceStation(int32_t* status);
+int32_t HAL_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
+int32_t HAL_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
+int32_t HAL_GetJoystickButtons(int32_t joystickNum,
+                               HAL_JoystickButtons* buttons);
+int32_t HAL_GetJoystickDescriptor(int32_t joystickNum,
+                                  HAL_JoystickDescriptor* desc);
+HAL_Bool HAL_GetJoystickIsXbox(int32_t joystickNum);
+int32_t HAL_GetJoystickType(int32_t joystickNum);
+char* HAL_GetJoystickName(int32_t joystickNum);
+void HAL_FreeJoystickName(char* name);
+int32_t HAL_GetJoystickAxisType(int32_t joystickNum, int32_t axis);
+int32_t HAL_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+                               int32_t leftRumble, int32_t rightRumble);
+double HAL_GetMatchTime(int32_t* status);
+
+int HAL_GetMatchInfo(HAL_MatchInfo* info);
+void HAL_FreeMatchInfo(HAL_MatchInfo* info);
+
+#ifndef HAL_USE_LABVIEW
+
+void HAL_ReleaseDSMutex(void);
+bool HAL_IsNewControlData(void);
+void HAL_WaitForDSData(void);
+HAL_Bool HAL_WaitForDSDataTimeout(double timeout);
+void HAL_InitializeDriverStation(void);
+
+void HAL_ObserveUserProgramStarting(void);
+void HAL_ObserveUserProgramDisabled(void);
+void HAL_ObserveUserProgramAutonomous(void);
+void HAL_ObserveUserProgramTeleop(void);
+void HAL_ObserveUserProgramTest(void);
+
+#endif  // HAL_USE_LABVIEW
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Encoder.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Encoder.h
new file mode 100644
index 0000000..d26e160
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Encoder.h
@@ -0,0 +1,79 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Types.h"
+
+enum HAL_EncoderIndexingType : int32_t {
+  HAL_kResetWhileHigh,
+  HAL_kResetWhileLow,
+  HAL_kResetOnFallingEdge,
+  HAL_kResetOnRisingEdge
+};
+enum HAL_EncoderEncodingType : int32_t {
+  HAL_Encoder_k1X,
+  HAL_Encoder_k2X,
+  HAL_Encoder_k4X
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+HAL_EncoderHandle HAL_InitializeEncoder(
+    HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,
+    HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB,
+    HAL_Bool reverseDirection, HAL_EncoderEncodingType encodingType,
+    int32_t* status);
+void HAL_FreeEncoder(HAL_EncoderHandle encoderHandle, int32_t* status);
+int32_t HAL_GetEncoder(HAL_EncoderHandle encoderHandle, int32_t* status);
+int32_t HAL_GetEncoderRaw(HAL_EncoderHandle encoderHandle, int32_t* status);
+int32_t HAL_GetEncoderEncodingScale(HAL_EncoderHandle encoderHandle,
+                                    int32_t* status);
+void HAL_ResetEncoder(HAL_EncoderHandle encoderHandle, int32_t* status);
+double HAL_GetEncoderPeriod(HAL_EncoderHandle encoderHandle, int32_t* status);
+void HAL_SetEncoderMaxPeriod(HAL_EncoderHandle encoderHandle, double maxPeriod,
+                             int32_t* status);
+HAL_Bool HAL_GetEncoderStopped(HAL_EncoderHandle encoderHandle,
+                               int32_t* status);
+HAL_Bool HAL_GetEncoderDirection(HAL_EncoderHandle encoderHandle,
+                                 int32_t* status);
+double HAL_GetEncoderDistance(HAL_EncoderHandle encoderHandle, int32_t* status);
+double HAL_GetEncoderRate(HAL_EncoderHandle encoderHandle, int32_t* status);
+void HAL_SetEncoderMinRate(HAL_EncoderHandle encoderHandle, double minRate,
+                           int32_t* status);
+void HAL_SetEncoderDistancePerPulse(HAL_EncoderHandle encoderHandle,
+                                    double distancePerPulse, int32_t* status);
+void HAL_SetEncoderReverseDirection(HAL_EncoderHandle encoderHandle,
+                                    HAL_Bool reverseDirection, int32_t* status);
+void HAL_SetEncoderSamplesToAverage(HAL_EncoderHandle encoderHandle,
+                                    int32_t samplesToAverage, int32_t* status);
+int32_t HAL_GetEncoderSamplesToAverage(HAL_EncoderHandle encoderHandle,
+                                       int32_t* status);
+
+void HAL_SetEncoderIndexSource(HAL_EncoderHandle encoderHandle,
+                               HAL_Handle digitalSourceHandle,
+                               HAL_AnalogTriggerType analogTriggerType,
+                               HAL_EncoderIndexingType type, int32_t* status);
+
+int32_t HAL_GetEncoderFPGAIndex(HAL_EncoderHandle encoderHandle,
+                                int32_t* status);
+
+double HAL_GetEncoderDecodingScaleFactor(HAL_EncoderHandle encoderHandle,
+                                         int32_t* status);
+
+double HAL_GetEncoderDistancePerPulse(HAL_EncoderHandle encoderHandle,
+                                      int32_t* status);
+
+HAL_EncoderEncodingType HAL_GetEncoderEncodingType(
+    HAL_EncoderHandle encoderHandle, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Errors.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Errors.h
new file mode 100644
index 0000000..3111a7c
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Errors.h
@@ -0,0 +1,117 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#define CTR_RxTimeout_MESSAGE "CTRE CAN Receive Timeout"
+#define CTR_TxTimeout_MESSAGE "CTRE CAN Transmit Timeout"
+#define CTR_InvalidParamValue_MESSAGE "CTRE CAN Invalid Parameter"
+#define CTR_UnexpectedArbId_MESSAGE \
+  "CTRE Unexpected Arbitration ID (CAN Node ID)"
+#define CTR_TxFailed_MESSAGE "CTRE CAN Transmit Error"
+#define CTR_SigNotUpdated_MESSAGE "CTRE CAN Signal Not Updated"
+
+#define NiFpga_Status_FifoTimeout_MESSAGE "NIFPGA: FIFO timeout error"
+#define NiFpga_Status_TransferAborted_MESSAGE "NIFPGA: Transfer aborted error"
+#define NiFpga_Status_MemoryFull_MESSAGE \
+  "NIFPGA: Memory Allocation failed, memory full"
+#define NiFpga_Status_SoftwareFault_MESSAGE "NIFPGA: Unexpected software error"
+#define NiFpga_Status_InvalidParameter_MESSAGE "NIFPGA: Invalid Parameter"
+#define NiFpga_Status_ResourceNotFound_MESSAGE "NIFPGA: Resource not found"
+#define NiFpga_Status_ResourceNotInitialized_MESSAGE \
+  "NIFPGA: Resource not initialized"
+#define NiFpga_Status_HardwareFault_MESSAGE "NIFPGA: Hardware Fault"
+#define NiFpga_Status_IrqTimeout_MESSAGE "NIFPGA: Interrupt timeout"
+
+#define ERR_CANSessionMux_InvalidBuffer_MESSAGE "CAN: Invalid Buffer"
+#define ERR_CANSessionMux_MessageNotFound_MESSAGE "CAN: Message not found"
+#define WARN_CANSessionMux_NoToken_MESSAGE "CAN: No token"
+#define ERR_CANSessionMux_NotAllowed_MESSAGE "CAN: Not allowed"
+#define ERR_CANSessionMux_NotInitialized_MESSAGE "CAN: Not initialized"
+
+#define SAMPLE_RATE_TOO_HIGH 1001
+#define SAMPLE_RATE_TOO_HIGH_MESSAGE \
+  "HAL: Analog module sample rate is too high"
+#define VOLTAGE_OUT_OF_RANGE 1002
+#define VOLTAGE_OUT_OF_RANGE_MESSAGE \
+  "HAL: Voltage to convert to raw value is out of range [0; 5]"
+#define LOOP_TIMING_ERROR 1004
+#define LOOP_TIMING_ERROR_MESSAGE \
+  "HAL: Digital module loop timing is not the expected value"
+#define SPI_WRITE_NO_MOSI 1012
+#define SPI_WRITE_NO_MOSI_MESSAGE \
+  "HAL: Cannot write to SPI port with no MOSI output"
+#define SPI_READ_NO_MISO 1013
+#define SPI_READ_NO_MISO_MESSAGE \
+  "HAL: Cannot read from SPI port with no MISO input"
+#define SPI_READ_NO_DATA 1014
+#define SPI_READ_NO_DATA_MESSAGE "HAL: No data available to read from SPI"
+#define INCOMPATIBLE_STATE 1015
+#define INCOMPATIBLE_STATE_MESSAGE \
+  "HAL: Incompatible State: The operation cannot be completed"
+#define NO_AVAILABLE_RESOURCES -1004
+#define NO_AVAILABLE_RESOURCES_MESSAGE "HAL: No available resources to allocate"
+#define NULL_PARAMETER -1005
+#define NULL_PARAMETER_MESSAGE "HAL: A pointer parameter to a method is NULL"
+#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR -1010
+#define ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE \
+  "HAL: AnalogTrigger limits error.  Lower limit > Upper Limit"
+#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR -1011
+#define ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE \
+  "HAL: Attempted to read AnalogTrigger pulse output."
+#define PARAMETER_OUT_OF_RANGE -1028
+#define PARAMETER_OUT_OF_RANGE_MESSAGE "HAL: A parameter is out of range."
+#define RESOURCE_IS_ALLOCATED -1029
+#define RESOURCE_IS_ALLOCATED_MESSAGE "HAL: Resource already allocated"
+#define RESOURCE_OUT_OF_RANGE -1030
+#define RESOURCE_OUT_OF_RANGE_MESSAGE \
+  "HAL: The requested resource is out of range."
+#define HAL_INVALID_ACCUMULATOR_CHANNEL -1035
+#define HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE \
+  "HAL: The requested input is not an accumulator channel"
+#define HAL_COUNTER_NOT_SUPPORTED -1058
+#define HAL_COUNTER_NOT_SUPPORTED_MESSAGE \
+  "HAL: Counter mode not supported for encoder method"
+#define HAL_PWM_SCALE_ERROR -1072
+#define HAL_PWM_SCALE_ERROR_MESSAGE \
+  "HAL: The PWM Scale Factors are out of range"
+#define HAL_HANDLE_ERROR -1098
+#define HAL_HANDLE_ERROR_MESSAGE \
+  "HAL: A handle parameter was passed incorrectly"
+
+#define HAL_SERIAL_PORT_NOT_FOUND -1123
+#define HAL_SERIAL_PORT_NOT_FOUND_MESSAGE \
+  "HAL: The specified serial port device was not found"
+
+#define HAL_SERIAL_PORT_OPEN_ERROR -1124
+#define HAL_SERIAL_PORT_OPEN_ERROR_MESSAGE \
+  "HAL: The serial port could not be opened"
+
+#define HAL_SERIAL_PORT_ERROR -1125
+#define HAL_SERIAL_PORT_ERROR_MESSAGE \
+  "HAL: There was an error on the serial port"
+
+#define HAL_THREAD_PRIORITY_ERROR -1152
+#define HAL_THREAD_PRIORITY_ERROR_MESSAGE \
+  "HAL: Getting or setting the priority of a thread has failed";
+
+#define HAL_THREAD_PRIORITY_RANGE_ERROR -1153
+#define HAL_THREAD_PRIORITY_RANGE_ERROR_MESSAGE \
+  "HAL: The priority requested to be set is invalid"
+
+#define VI_ERROR_SYSTEM_ERROR_MESSAGE "HAL - VISA: System Error";
+#define VI_ERROR_INV_OBJECT_MESSAGE "HAL - VISA: Invalid Object"
+#define VI_ERROR_RSRC_LOCKED_MESSAGE "HAL - VISA: Resource Locked"
+#define VI_ERROR_RSRC_NFOUND_MESSAGE "HAL - VISA: Resource Not Found"
+#define VI_ERROR_INV_RSRC_NAME_MESSAGE "HAL - VISA: Invalid Resource Name"
+#define VI_ERROR_QUEUE_OVERFLOW_MESSAGE "HAL - VISA: Queue Overflow"
+#define VI_ERROR_IO_MESSAGE "HAL - VISA: General IO Error"
+#define VI_ERROR_ASRL_PARITY_MESSAGE "HAL - VISA: Parity Error"
+#define VI_ERROR_ASRL_FRAMING_MESSAGE "HAL - VISA: Framing Error"
+#define VI_ERROR_ASRL_OVERRUN_MESSAGE "HAL - VISA: Buffer Overrun Error"
+#define VI_ERROR_RSRC_BUSY_MESSAGE "HAL - VISA: Resource Busy"
+#define VI_ERROR_INV_PARAMETER_MESSAGE "HAL - VISA: Invalid Parameter"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Extensions.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Extensions.h
new file mode 100644
index 0000000..1021c5d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Extensions.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+/**
+ * HAL Simulator Extensions are libraries that provide additional simulator
+ * functionality, such as a Gazebo interface, or a more light weight simulation.
+ *
+ * An extension must expose the HALSIM_InitExtension entry point which is
+ * invoked after the library is loaded.
+ *
+ * The entry point is expected to return < 0 for errors that should stop
+ * the HAL completely, 0 for success, and > 0 for a non fatal error.
+ */
+typedef int halsim_extension_init_func_t(void);
+
+extern "C" {
+int HAL_LoadOneExtension(const char* library);
+int HAL_LoadExtensions(void);
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/HAL.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/HAL.h
new file mode 100644
index 0000000..2b765e5
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/HAL.h
@@ -0,0 +1,86 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2013-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#ifndef HAL_USE_LABVIEW
+
+#include "HAL/Accelerometer.h"
+#include "HAL/AnalogAccumulator.h"
+#include "HAL/AnalogGyro.h"
+#include "HAL/AnalogInput.h"
+#include "HAL/AnalogOutput.h"
+#include "HAL/AnalogTrigger.h"
+#include "HAL/CAN.h"
+#include "HAL/Compressor.h"
+#include "HAL/Constants.h"
+#include "HAL/Counter.h"
+#include "HAL/DIO.h"
+#include "HAL/DriverStation.h"
+#include "HAL/Errors.h"
+#include "HAL/I2C.h"
+#include "HAL/Interrupts.h"
+#include "HAL/Notifier.h"
+#include "HAL/PDP.h"
+#include "HAL/PWM.h"
+#include "HAL/Ports.h"
+#include "HAL/Power.h"
+#include "HAL/Relay.h"
+#include "HAL/SPI.h"
+#include "HAL/SerialPort.h"
+#include "HAL/Solenoid.h"
+
+#endif  // HAL_USE_LABVIEW
+
+#include "HAL/Types.h"
+#include "UsageReporting.h"
+
+namespace HALUsageReporting = nUsageReporting;
+
+enum HAL_RuntimeType : int32_t { HAL_Athena, HAL_Mock };
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const char* HAL_GetErrorMessage(int32_t code);
+
+int32_t HAL_GetFPGAVersion(int32_t* status);
+int64_t HAL_GetFPGARevision(int32_t* status);
+
+HAL_RuntimeType HAL_GetRuntimeType(void);
+HAL_Bool HAL_GetFPGAButton(int32_t* status);
+
+HAL_Bool HAL_GetSystemActive(int32_t* status);
+HAL_Bool HAL_GetBrownedOut(int32_t* status);
+
+void HAL_BaseInitialize(int32_t* status);
+
+#ifndef HAL_USE_LABVIEW
+
+HAL_PortHandle HAL_GetPort(int32_t channel);
+HAL_PortHandle HAL_GetPortWithModule(int32_t module, int32_t channel);
+
+uint64_t HAL_GetFPGATime(int32_t* status);
+
+HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode);
+
+// ifdef's definition is to allow for default parameters in C++.
+#ifdef __cplusplus
+int64_t HAL_Report(int32_t resource, int32_t instanceNumber,
+                   int32_t context = 0, const char* feature = nullptr);
+#else
+int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context,
+                   const char* feature);
+#endif
+
+#endif  // HAL_USE_LABVIEW
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/I2C.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/I2C.h
new file mode 100644
index 0000000..290430d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/I2C.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+enum HAL_I2CPort : int32_t { HAL_I2C_kOnboard = 0, HAL_I2C_kMXP };
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status);
+int32_t HAL_TransactionI2C(HAL_I2CPort port, int32_t deviceAddress,
+                           const uint8_t* dataToSend, int32_t sendSize,
+                           uint8_t* dataReceived, int32_t receiveSize);
+int32_t HAL_WriteI2C(HAL_I2CPort port, int32_t deviceAddress,
+                     const uint8_t* dataToSend, int32_t sendSize);
+int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer,
+                    int32_t count);
+void HAL_CloseI2C(HAL_I2CPort port);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Interrupts.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Interrupts.h
new file mode 100644
index 0000000..db522f9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Interrupts.h
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*HAL_InterruptHandlerFunction)(uint32_t interruptAssertedMask,
+                                             void* param);
+
+HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher, int32_t* status);
+void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
+
+int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
+                             double timeout, HAL_Bool ignorePrevious,
+                             int32_t* status);
+void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status);
+void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
+                           int32_t* status);
+double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
+                                        int32_t* status);
+double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
+                                         int32_t* status);
+void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
+                           HAL_Handle digitalSourceHandle,
+                           HAL_AnalogTriggerType analogTriggerType,
+                           int32_t* status);
+void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
+                                HAL_InterruptHandlerFunction handler,
+                                void* param, int32_t* status);
+void HAL_AttachInterruptHandlerThreaded(HAL_InterruptHandle interruptHandle,
+                                        HAL_InterruptHandlerFunction handler,
+                                        void* param, int32_t* status);
+void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
+                                  HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                  int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/LabVIEW/HAL.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/LabVIEW/HAL.h
new file mode 100644
index 0000000..4268a61
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/LabVIEW/HAL.h
@@ -0,0 +1,14 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#define HAL_USE_LABVIEW
+
+#include "HAL/DriverStation.h"
+#include "HAL/HAL.h"
+#include "HAL/Types.h"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Notifier.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Notifier.h
new file mode 100644
index 0000000..bd8544b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Notifier.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_NotifierHandle HAL_InitializeNotifier(int32_t* status);
+void HAL_StopNotifier(HAL_NotifierHandle notifierHandle, int32_t* status);
+void HAL_CleanNotifier(HAL_NotifierHandle notifierHandle, int32_t* status);
+void HAL_UpdateNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                             uint64_t triggerTime, int32_t* status);
+void HAL_CancelNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                             int32_t* status);
+uint64_t HAL_WaitForNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                                  int32_t* status);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/OSSerialPort.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/OSSerialPort.h
new file mode 100644
index 0000000..30e6f2a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/OSSerialPort.h
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "SerialPort.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HAL_InitializeOSSerialPort(HAL_SerialPort port, int32_t* status);
+void HAL_SetOSSerialBaudRate(HAL_SerialPort port, int32_t baud,
+                             int32_t* status);
+void HAL_SetOSSerialDataBits(HAL_SerialPort port, int32_t bits,
+                             int32_t* status);
+void HAL_SetOSSerialParity(HAL_SerialPort port, int32_t parity,
+                           int32_t* status);
+void HAL_SetOSSerialStopBits(HAL_SerialPort port, int32_t stopBits,
+                             int32_t* status);
+void HAL_SetOSSerialWriteMode(HAL_SerialPort port, int32_t mode,
+                              int32_t* status);
+void HAL_SetOSSerialFlowControl(HAL_SerialPort port, int32_t flow,
+                                int32_t* status);
+void HAL_SetOSSerialTimeout(HAL_SerialPort port, double timeout,
+                            int32_t* status);
+void HAL_EnableOSSerialTermination(HAL_SerialPort port, char terminator,
+                                   int32_t* status);
+void HAL_DisableOSSerialTermination(HAL_SerialPort port, int32_t* status);
+void HAL_SetOSSerialReadBufferSize(HAL_SerialPort port, int32_t size,
+                                   int32_t* status);
+void HAL_SetOSSerialWriteBufferSize(HAL_SerialPort port, int32_t size,
+                                    int32_t* status);
+int32_t HAL_GetOSSerialBytesReceived(HAL_SerialPort port, int32_t* status);
+int32_t HAL_ReadOSSerial(HAL_SerialPort port, char* buffer, int32_t count,
+                         int32_t* status);
+int32_t HAL_WriteOSSerial(HAL_SerialPort port, const char* buffer,
+                          int32_t count, int32_t* status);
+void HAL_FlushOSSerial(HAL_SerialPort port, int32_t* status);
+void HAL_ClearOSSerial(HAL_SerialPort port, int32_t* status);
+void HAL_CloseOSSerial(HAL_SerialPort port, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/PDP.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/PDP.h
new file mode 100644
index 0000000..c5c3bee
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/PDP.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HAL_InitializePDP(int32_t module, int32_t* status);
+HAL_Bool HAL_CheckPDPChannel(int32_t channel);
+HAL_Bool HAL_CheckPDPModule(int32_t module);
+double HAL_GetPDPTemperature(int32_t module, int32_t* status);
+double HAL_GetPDPVoltage(int32_t module, int32_t* status);
+double HAL_GetPDPChannelCurrent(int32_t module, int32_t channel,
+                                int32_t* status);
+double HAL_GetPDPTotalCurrent(int32_t module, int32_t* status);
+double HAL_GetPDPTotalPower(int32_t module, int32_t* status);
+double HAL_GetPDPTotalEnergy(int32_t module, int32_t* status);
+void HAL_ResetPDPTotalEnergy(int32_t module, int32_t* status);
+void HAL_ClearPDPStickyFaults(int32_t module, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/PWM.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/PWM.h
new file mode 100644
index 0000000..317449c
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/PWM.h
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_DigitalHandle HAL_InitializePWMPort(HAL_PortHandle portHandle,
+                                        int32_t* status);
+void HAL_FreePWMPort(HAL_DigitalHandle pwmPortHandle, int32_t* status);
+
+HAL_Bool HAL_CheckPWMChannel(int32_t channel);
+
+void HAL_SetPWMConfig(HAL_DigitalHandle pwmPortHandle, double maxPwm,
+                      double deadbandMaxPwm, double centerPwm,
+                      double deadbandMinPwm, double minPwm, int32_t* status);
+void HAL_SetPWMConfigRaw(HAL_DigitalHandle pwmPortHandle, int32_t maxPwm,
+                         int32_t deadbandMaxPwm, int32_t centerPwm,
+                         int32_t deadbandMinPwm, int32_t minPwm,
+                         int32_t* status);
+void HAL_GetPWMConfigRaw(HAL_DigitalHandle pwmPortHandle, int32_t* maxPwm,
+                         int32_t* deadbandMaxPwm, int32_t* centerPwm,
+                         int32_t* deadbandMinPwm, int32_t* minPwm,
+                         int32_t* status);
+void HAL_SetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
+                                 HAL_Bool eliminateDeadband, int32_t* status);
+HAL_Bool HAL_GetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
+                                     int32_t* status);
+void HAL_SetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t value,
+                   int32_t* status);
+void HAL_SetPWMSpeed(HAL_DigitalHandle pwmPortHandle, double speed,
+                     int32_t* status);
+void HAL_SetPWMPosition(HAL_DigitalHandle pwmPortHandle, double position,
+                        int32_t* status);
+void HAL_SetPWMDisabled(HAL_DigitalHandle pwmPortHandle, int32_t* status);
+int32_t HAL_GetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t* status);
+double HAL_GetPWMSpeed(HAL_DigitalHandle pwmPortHandle, int32_t* status);
+double HAL_GetPWMPosition(HAL_DigitalHandle pwmPortHandle, int32_t* status);
+void HAL_LatchPWMZero(HAL_DigitalHandle pwmPortHandle, int32_t* status);
+void HAL_SetPWMPeriodScale(HAL_DigitalHandle pwmPortHandle, int32_t squelchMask,
+                           int32_t* status);
+int32_t HAL_GetPWMLoopTiming(int32_t* status);
+uint64_t HAL_GetPWMCycleStartTime(int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Ports.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Ports.h
new file mode 100644
index 0000000..858e8dd
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Ports.h
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int32_t HAL_GetNumAccumulators(void);
+int32_t HAL_GetNumAnalogTriggers(void);
+int32_t HAL_GetNumAnalogInputs(void);
+int32_t HAL_GetNumAnalogOutputs(void);
+int32_t HAL_GetNumCounters(void);
+int32_t HAL_GetNumDigitalHeaders(void);
+int32_t HAL_GetNumPWMHeaders(void);
+int32_t HAL_GetNumDigitalChannels(void);
+int32_t HAL_GetNumPWMChannels(void);
+int32_t HAL_GetNumDigitalPWMOutputs(void);
+int32_t HAL_GetNumEncoders(void);
+int32_t HAL_GetNumInterrupts(void);
+int32_t HAL_GetNumRelayChannels(void);
+int32_t HAL_GetNumRelayHeaders(void);
+int32_t HAL_GetNumPCMModules(void);
+int32_t HAL_GetNumSolenoidChannels(void);
+int32_t HAL_GetNumPDPModules(void);
+int32_t HAL_GetNumPDPChannels(void);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Power.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Power.h
new file mode 100644
index 0000000..1cb3634
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Power.h
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double HAL_GetVinVoltage(int32_t* status);
+double HAL_GetVinCurrent(int32_t* status);
+double HAL_GetUserVoltage6V(int32_t* status);
+double HAL_GetUserCurrent6V(int32_t* status);
+HAL_Bool HAL_GetUserActive6V(int32_t* status);
+int32_t HAL_GetUserCurrentFaults6V(int32_t* status);
+double HAL_GetUserVoltage5V(int32_t* status);
+double HAL_GetUserCurrent5V(int32_t* status);
+HAL_Bool HAL_GetUserActive5V(int32_t* status);
+int32_t HAL_GetUserCurrentFaults5V(int32_t* status);
+double HAL_GetUserVoltage3V3(int32_t* status);
+double HAL_GetUserCurrent3V3(int32_t* status);
+HAL_Bool HAL_GetUserActive3V3(int32_t* status);
+int32_t HAL_GetUserCurrentFaults3V3(int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Relay.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Relay.h
new file mode 100644
index 0000000..6bc2526
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Relay.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_RelayHandle HAL_InitializeRelayPort(HAL_PortHandle portHandle, HAL_Bool fwd,
+                                        int32_t* status);
+void HAL_FreeRelayPort(HAL_RelayHandle relayPortHandle);
+
+HAL_Bool HAL_CheckRelayChannel(int32_t channel);
+
+void HAL_SetRelay(HAL_RelayHandle relayPortHandle, HAL_Bool on,
+                  int32_t* status);
+HAL_Bool HAL_GetRelay(HAL_RelayHandle relayPortHandle, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/SPI.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/SPI.h
new file mode 100644
index 0000000..c961e4e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/SPI.h
@@ -0,0 +1,61 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Types.h"
+
+enum HAL_SPIPort : int32_t {
+  HAL_SPI_kOnboardCS0 = 0,
+  HAL_SPI_kOnboardCS1,
+  HAL_SPI_kOnboardCS2,
+  HAL_SPI_kOnboardCS3,
+  HAL_SPI_kMXP
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status);
+int32_t HAL_TransactionSPI(HAL_SPIPort port, const uint8_t* dataToSend,
+                           uint8_t* dataReceived, int32_t size);
+int32_t HAL_WriteSPI(HAL_SPIPort port, const uint8_t* dataToSend,
+                     int32_t sendSize);
+int32_t HAL_ReadSPI(HAL_SPIPort port, uint8_t* buffer, int32_t count);
+void HAL_CloseSPI(HAL_SPIPort port);
+void HAL_SetSPISpeed(HAL_SPIPort port, int32_t speed);
+void HAL_SetSPIOpts(HAL_SPIPort port, HAL_Bool msbFirst,
+                    HAL_Bool sampleOnTrailing, HAL_Bool clkIdleHigh);
+void HAL_SetSPIChipSelectActiveHigh(HAL_SPIPort port, int32_t* status);
+void HAL_SetSPIChipSelectActiveLow(HAL_SPIPort port, int32_t* status);
+int32_t HAL_GetSPIHandle(HAL_SPIPort port);
+void HAL_SetSPIHandle(HAL_SPIPort port, int32_t handle);
+
+void HAL_InitSPIAuto(HAL_SPIPort port, int32_t bufferSize, int32_t* status);
+void HAL_FreeSPIAuto(HAL_SPIPort port, int32_t* status);
+void HAL_StartSPIAutoRate(HAL_SPIPort port, double period, int32_t* status);
+void HAL_StartSPIAutoTrigger(HAL_SPIPort port, HAL_Handle digitalSourceHandle,
+                             HAL_AnalogTriggerType analogTriggerType,
+                             HAL_Bool triggerRising, HAL_Bool triggerFalling,
+                             int32_t* status);
+void HAL_StopSPIAuto(HAL_SPIPort port, int32_t* status);
+void HAL_SetSPIAutoTransmitData(HAL_SPIPort port, const uint8_t* dataToSend,
+                                int32_t dataSize, int32_t zeroSize,
+                                int32_t* status);
+void HAL_ForceSPIAutoRead(HAL_SPIPort port, int32_t* status);
+int32_t HAL_ReadSPIAutoReceivedData(HAL_SPIPort port, uint8_t* buffer,
+                                    int32_t numToRead, double timeout,
+                                    int32_t* status);
+int32_t HAL_GetSPIAutoDroppedCount(HAL_SPIPort port, int32_t* status);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/SerialPort.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/SerialPort.h
new file mode 100644
index 0000000..fa7b2c9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/SerialPort.h
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+enum HAL_SerialPort : int32_t {
+  HAL_SerialPort_Onboard = 0,
+  HAL_SerialPort_MXP = 1,
+  HAL_SerialPort_USB1 = 2,
+  HAL_SerialPort_USB2 = 3
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HAL_InitializeSerialPort(HAL_SerialPort port, int32_t* status);
+void HAL_SetSerialBaudRate(HAL_SerialPort port, int32_t baud, int32_t* status);
+void HAL_SetSerialDataBits(HAL_SerialPort port, int32_t bits, int32_t* status);
+void HAL_SetSerialParity(HAL_SerialPort port, int32_t parity, int32_t* status);
+void HAL_SetSerialStopBits(HAL_SerialPort port, int32_t stopBits,
+                           int32_t* status);
+void HAL_SetSerialWriteMode(HAL_SerialPort port, int32_t mode, int32_t* status);
+void HAL_SetSerialFlowControl(HAL_SerialPort port, int32_t flow,
+                              int32_t* status);
+void HAL_SetSerialTimeout(HAL_SerialPort port, double timeout, int32_t* status);
+void HAL_EnableSerialTermination(HAL_SerialPort port, char terminator,
+                                 int32_t* status);
+void HAL_DisableSerialTermination(HAL_SerialPort port, int32_t* status);
+void HAL_SetSerialReadBufferSize(HAL_SerialPort port, int32_t size,
+                                 int32_t* status);
+void HAL_SetSerialWriteBufferSize(HAL_SerialPort port, int32_t size,
+                                  int32_t* status);
+int32_t HAL_GetSerialBytesReceived(HAL_SerialPort port, int32_t* status);
+int32_t HAL_ReadSerial(HAL_SerialPort port, char* buffer, int32_t count,
+                       int32_t* status);
+int32_t HAL_WriteSerial(HAL_SerialPort port, const char* buffer, int32_t count,
+                        int32_t* status);
+void HAL_FlushSerial(HAL_SerialPort port, int32_t* status);
+void HAL_ClearSerial(HAL_SerialPort port, int32_t* status);
+void HAL_CloseSerial(HAL_SerialPort port, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Solenoid.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Solenoid.h
new file mode 100644
index 0000000..d788f27
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Solenoid.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HAL_SolenoidHandle HAL_InitializeSolenoidPort(HAL_PortHandle portHandle,
+                                              int32_t* status);
+void HAL_FreeSolenoidPort(HAL_SolenoidHandle solenoidPortHandle);
+HAL_Bool HAL_CheckSolenoidModule(int32_t module);
+HAL_Bool HAL_CheckSolenoidChannel(int32_t channel);
+HAL_Bool HAL_GetSolenoid(HAL_SolenoidHandle solenoidPortHandle,
+                         int32_t* status);
+int32_t HAL_GetAllSolenoids(int32_t module, int32_t* status);
+void HAL_SetSolenoid(HAL_SolenoidHandle solenoidPortHandle, HAL_Bool value,
+                     int32_t* status);
+void HAL_SetAllSolenoids(int32_t module, int32_t state, int32_t* status);
+int32_t HAL_GetPCMSolenoidBlackList(int32_t module, int32_t* status);
+HAL_Bool HAL_GetPCMSolenoidVoltageStickyFault(int32_t module, int32_t* status);
+HAL_Bool HAL_GetPCMSolenoidVoltageFault(int32_t module, int32_t* status);
+void HAL_ClearAllPCMStickyFaults(int32_t module, int32_t* status);
+void HAL_SetOneShotDuration(HAL_SolenoidHandle solenoidPortHandle,
+                            int32_t durMS, int32_t* status);
+void HAL_FireOneShot(HAL_SolenoidHandle solenoidPortHandle, int32_t* status);
+#ifdef __cplusplus
+}  // extern "C"
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Threads.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Threads.h
new file mode 100644
index 0000000..cb41b3b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Threads.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifdef _WIN32
+#include <windows.h>
+#define NativeThreadHandle const HANDLE*
+#else
+#include <pthread.h>
+#define NativeThreadHandle const pthread_t*
+#endif
+
+#include "HAL/Types.h"
+
+extern "C" {
+int32_t HAL_GetThreadPriority(NativeThreadHandle handle, HAL_Bool* isRealTime,
+                              int32_t* status);
+int32_t HAL_GetCurrentThreadPriority(HAL_Bool* isRealTime, int32_t* status);
+HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime,
+                               int32_t priority, int32_t* status);
+HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority,
+                                      int32_t* status);
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Types.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Types.h
new file mode 100644
index 0000000..702f538
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/Types.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#define HAL_kInvalidHandle 0
+
+typedef int32_t HAL_Handle;
+
+typedef HAL_Handle HAL_PortHandle;
+
+typedef HAL_Handle HAL_AnalogInputHandle;
+
+typedef HAL_Handle HAL_AnalogOutputHandle;
+
+typedef HAL_Handle HAL_AnalogTriggerHandle;
+
+typedef HAL_Handle HAL_CompressorHandle;
+
+typedef HAL_Handle HAL_CounterHandle;
+
+typedef HAL_Handle HAL_DigitalHandle;
+
+typedef HAL_Handle HAL_DigitalPWMHandle;
+
+typedef HAL_Handle HAL_EncoderHandle;
+
+typedef HAL_Handle HAL_FPGAEncoderHandle;
+
+typedef HAL_Handle HAL_GyroHandle;
+
+typedef HAL_Handle HAL_InterruptHandle;
+
+typedef HAL_Handle HAL_NotifierHandle;
+
+typedef HAL_Handle HAL_RelayHandle;
+
+typedef HAL_Handle HAL_SolenoidHandle;
+
+typedef int32_t HAL_Bool;
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/UsageReporting.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/UsageReporting.h
new file mode 100644
index 0000000..aaa7d8d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/UsageReporting.h
@@ -0,0 +1,163 @@
+
+#ifndef __UsageReporting_h__
+#define __UsageReporting_h__
+
+#ifdef _WIN32
+#include <stdint.h>
+#define EXPORT_FUNC __declspec(dllexport) __cdecl
+#elif defined (__vxworks)
+#include <vxWorks.h>
+#define EXPORT_FUNC
+#else
+#include <stdint.h>
+#include <stdlib.h>
+#define EXPORT_FUNC
+#endif
+
+#define kUsageReporting_version 1
+
+namespace nUsageReporting
+{
+    typedef enum
+    {
+        kResourceType_Controller,
+        kResourceType_Module,
+        kResourceType_Language,
+        kResourceType_CANPlugin,
+        kResourceType_Accelerometer,
+        kResourceType_ADXL345,
+        kResourceType_AnalogChannel,
+        kResourceType_AnalogTrigger,
+        kResourceType_AnalogTriggerOutput,
+        kResourceType_CANJaguar,
+        kResourceType_Compressor, // 10
+        kResourceType_Counter,
+        kResourceType_Dashboard,
+        kResourceType_DigitalInput,
+        kResourceType_DigitalOutput,
+        kResourceType_DriverStationCIO,
+        kResourceType_DriverStationEIO,
+        kResourceType_DriverStationLCD,
+        kResourceType_Encoder,
+        kResourceType_GearTooth,
+        kResourceType_Gyro, // 20
+        kResourceType_I2C,
+        kResourceType_Framework,
+        kResourceType_Jaguar,
+        kResourceType_Joystick,
+        kResourceType_Kinect,
+        kResourceType_KinectStick,
+        kResourceType_PIDController,
+        kResourceType_Preferences,
+        kResourceType_PWM,
+        kResourceType_Relay, // 30
+        kResourceType_RobotDrive,
+        kResourceType_SerialPort,
+        kResourceType_Servo,
+        kResourceType_Solenoid,
+        kResourceType_SPI,
+        kResourceType_Task,
+        kResourceType_Ultrasonic,
+        kResourceType_Victor,
+        kResourceType_Button,
+        kResourceType_Command, // 40
+        kResourceType_AxisCamera,
+        kResourceType_PCVideoServer,
+        kResourceType_SmartDashboard,
+        kResourceType_Talon,
+        kResourceType_HiTechnicColorSensor,
+        kResourceType_HiTechnicAccel,
+        kResourceType_HiTechnicCompass,
+        kResourceType_SRF08,
+        kResourceType_AnalogOutput,
+        kResourceType_VictorSP, // 50
+        kResourceType_PWMTalonSRX,
+        kResourceType_CANTalonSRX,
+        kResourceType_ADXL362,
+        kResourceType_ADXRS450,
+        kResourceType_RevSPARK,
+        kResourceType_MindsensorsSD540,
+        kResourceType_DigitalFilter,
+        kResourceType_ADIS16448,
+        kResourceType_PDP,
+        kResourceType_PCM, // 60
+        kResourceType_PigeonIMU,
+        kResourceType_NidecBrushless,
+        kResourceType_CANifier,
+        kResourceType_CTRE_future0,
+        kResourceType_CTRE_future1,
+        kResourceType_CTRE_future2,
+        kResourceType_CTRE_future3,
+        kResourceType_CTRE_future4,
+        kResourceType_CTRE_future5,
+        kResourceType_CTRE_future6, // 70
+    } tResourceType;
+
+    typedef enum
+    {
+        kLanguage_LabVIEW = 1,
+        kLanguage_CPlusPlus = 2,
+        kLanguage_Java = 3,
+        kLanguage_Python = 4,
+        kLanguage_DotNet = 5,
+
+        kCANPlugin_BlackJagBridge = 1,
+        kCANPlugin_2CAN = 2,
+
+        kFramework_Iterative = 1,
+        kFramework_Simple = 2,
+        kFramework_CommandControl = 3,
+
+        kRobotDrive_ArcadeStandard = 1,
+        kRobotDrive_ArcadeButtonSpin = 2,
+        kRobotDrive_ArcadeRatioCurve = 3,
+        kRobotDrive_Tank = 4,
+        kRobotDrive_MecanumPolar = 5,
+        kRobotDrive_MecanumCartesian = 6,
+
+        kDriverStationCIO_Analog = 1,
+        kDriverStationCIO_DigitalIn = 2,
+        kDriverStationCIO_DigitalOut = 3,
+
+        kDriverStationEIO_Acceleration = 1,
+        kDriverStationEIO_AnalogIn = 2,
+        kDriverStationEIO_AnalogOut = 3,
+        kDriverStationEIO_Button = 4,
+        kDriverStationEIO_LED = 5,
+        kDriverStationEIO_DigitalIn = 6,
+        kDriverStationEIO_DigitalOut = 7,
+        kDriverStationEIO_FixedDigitalOut = 8,
+        kDriverStationEIO_PWM = 9,
+        kDriverStationEIO_Encoder = 10,
+        kDriverStationEIO_TouchSlider = 11,
+
+        kADXL345_SPI = 1,
+        kADXL345_I2C = 2,
+
+        kCommand_Scheduler = 1,
+
+        kSmartDashboard_Instance = 1,
+    } tInstances;
+
+    /**
+     * Report the usage of a resource of interest.
+     *
+     * @param resource one of the values in the tResourceType above (max value 51).
+     * @param instanceNumber an index that identifies the resource instance.
+     * @param context an optional additional context number for some cases (such as module number).  Set to 0 to omit.
+     * @param feature a string to be included describing features in use on a specific resource.  Setting the same resource more than once allows you to change the feature string.
+     */
+    uint32_t EXPORT_FUNC report(tResourceType resource, uint8_t instanceNumber, uint8_t context = 0, const char *feature = NULL);
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+    uint32_t EXPORT_FUNC FRC_NetworkCommunication_nUsageReporting_report(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char *feature);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __UsageReporting_h__
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/Log.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/Log.h
new file mode 100644
index 0000000..e57974e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/Log.h
@@ -0,0 +1,128 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <chrono>
+#include <string>
+
+#include <llvm/SmallString.h>
+#include <llvm/raw_ostream.h>
+
+inline std::string NowTime();
+
+enum TLogLevel {
+  logNONE,
+  logERROR,
+  logWARNING,
+  logINFO,
+  logDEBUG,
+  logDEBUG1,
+  logDEBUG2,
+  logDEBUG3,
+  logDEBUG4
+};
+
+class Log {
+ public:
+  Log();
+  virtual ~Log();
+  llvm::raw_ostream& Get(TLogLevel level = logINFO);
+
+ public:
+  static TLogLevel& ReportingLevel();
+  static std::string ToString(TLogLevel level);
+  static TLogLevel FromString(const std::string& level);
+
+ protected:
+  llvm::SmallString<128> buf;
+  llvm::raw_svector_ostream oss{buf};
+
+ private:
+  Log(const Log&);
+  Log& operator=(const Log&);
+};
+
+inline Log::Log() {}
+
+inline llvm::raw_ostream& Log::Get(TLogLevel level) {
+  oss << "- " << NowTime();
+  oss << " " << ToString(level) << ": ";
+  if (level > logDEBUG) {
+    oss << std::string(level - logDEBUG, '\t');
+  }
+  return oss;
+}
+
+inline Log::~Log() {
+  oss << "\n";
+  llvm::errs() << oss.str();
+}
+
+inline TLogLevel& Log::ReportingLevel() {
+  static TLogLevel reportingLevel = logDEBUG4;
+  return reportingLevel;
+}
+
+inline std::string Log::ToString(TLogLevel level) {
+  static const char* const buffer[] = {"NONE",   "ERROR",  "WARNING",
+                                       "INFO",   "DEBUG",  "DEBUG1",
+                                       "DEBUG2", "DEBUG3", "DEBUG4"};
+  return buffer[level];
+}
+
+inline TLogLevel Log::FromString(const std::string& level) {
+  if (level == "DEBUG4") return logDEBUG4;
+  if (level == "DEBUG3") return logDEBUG3;
+  if (level == "DEBUG2") return logDEBUG2;
+  if (level == "DEBUG1") return logDEBUG1;
+  if (level == "DEBUG") return logDEBUG;
+  if (level == "INFO") return logINFO;
+  if (level == "WARNING") return logWARNING;
+  if (level == "ERROR") return logERROR;
+  if (level == "NONE") return logNONE;
+  Log().Get(logWARNING) << "Unknown logging level '" << level
+                        << "'. Using INFO level as default.";
+  return logINFO;
+}
+
+typedef Log FILELog;
+
+#define FILE_LOG(level)                  \
+  if (level > FILELog::ReportingLevel()) \
+    ;                                    \
+  else                                   \
+    Log().Get(level)
+
+inline std::string NowTime() {
+  llvm::SmallString<128> buf;
+  llvm::raw_svector_ostream oss(buf);
+
+  using std::chrono::duration_cast;
+
+  auto now = std::chrono::system_clock::now().time_since_epoch();
+
+  // Hours
+  auto count = duration_cast<std::chrono::hours>(now).count() % 24;
+  if (count < 10) oss << "0";
+  oss << count << ":";
+
+  // Minutes
+  count = duration_cast<std::chrono::minutes>(now).count() % 60;
+  if (count < 10) oss << "0";
+  oss << count << ":";
+
+  // Seconds
+  count = duration_cast<std::chrono::seconds>(now).count() % 60;
+  if (count < 10) oss << "0";
+  oss << count << ".";
+
+  // Milliseconds
+  oss << duration_cast<std::chrono::milliseconds>(now).count() % 1000;
+
+  return oss.str();
+}
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/SerialHelper.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/SerialHelper.h
new file mode 100644
index 0000000..3b978b8
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/SerialHelper.h
@@ -0,0 +1,52 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <string>
+#include <vector>
+
+#include <llvm/SmallString.h>
+#include <llvm/SmallVector.h>
+#include <support/mutex.h>
+
+#include "HAL/SerialPort.h"
+
+namespace hal {
+class SerialHelper {
+ public:
+  SerialHelper();
+
+  std::string GetVISASerialPortName(HAL_SerialPort port, int32_t* status);
+  std::string GetOSSerialPortName(HAL_SerialPort port, int32_t* status);
+
+  std::vector<std::string> GetVISASerialPortList(int32_t* status);
+  std::vector<std::string> GetOSSerialPortList(int32_t* status);
+
+ private:
+  void SortHubPathVector();
+  void CoiteratedSort(llvm::SmallVectorImpl<llvm::SmallString<16>>& vec);
+  void QueryHubPaths(int32_t* status);
+
+  int32_t GetIndexForPort(HAL_SerialPort port, int32_t* status);
+
+  // Vectors to hold data before sorting.
+  // Note we will most likely have at max 2 instances, and the longest string
+  // is around 12, so these should never touch the heap;
+  llvm::SmallVector<llvm::SmallString<16>, 4> m_visaResource;
+  llvm::SmallVector<llvm::SmallString<16>, 4> m_osResource;
+  llvm::SmallVector<llvm::SmallString<16>, 4> m_unsortedHubPath;
+  llvm::SmallVector<llvm::SmallString<16>, 4> m_sortedHubPath;
+
+  int32_t m_resourceHandle;
+
+  static wpi::mutex m_nameMutex;
+  static std::string m_usbNames[2];
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/UnsafeDIO.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/UnsafeDIO.h
new file mode 100644
index 0000000..5d95100
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/UnsafeDIO.h
@@ -0,0 +1,85 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <support/mutex.h>
+
+#include "HAL/ChipObject.h"
+#include "HAL/Types.h"
+
+namespace hal {
+struct DIOSetProxy {
+  DIOSetProxy(const DIOSetProxy&) = delete;
+  DIOSetProxy(DIOSetProxy&&) = delete;
+  DIOSetProxy& operator=(const DIOSetProxy&) = delete;
+  DIOSetProxy& operator=(DIOSetProxy&&) = delete;
+
+  void SetOutputMode(int32_t* status) {
+    m_dio->writeOutputEnable(m_setOutputDirReg, status);
+  }
+
+  void SetInputMode(int32_t* status) {
+    m_dio->writeOutputEnable(m_unsetOutputDirReg, status);
+  }
+
+  void SetOutputTrue(int32_t* status) {
+    m_dio->writeDO(m_setOutputStateReg, status);
+  }
+
+  void SetOutputFalse(int32_t* status) {
+    m_dio->writeDO(m_unsetOutputStateReg, status);
+  }
+
+  tDIO::tOutputEnable m_setOutputDirReg;
+  tDIO::tOutputEnable m_unsetOutputDirReg;
+  tDIO::tDO m_setOutputStateReg;
+  tDIO::tDO m_unsetOutputStateReg;
+  tDIO* m_dio;
+};
+namespace detail {
+wpi::mutex& UnsafeGetDIOMutex();
+tDIO* UnsafeGetDigialSystem();
+int32_t ComputeDigitalMask(HAL_DigitalHandle handle, int32_t* status);
+}  // namespace detail
+
+/**
+ * Unsafe digital output set function
+ * This function can be used to perform fast and determinstically set digital
+ * outputs. This function holds the DIO lock, so calling anyting other then
+ * functions on the Proxy object passed as a parameter can deadlock your
+ * program.
+ *
+ */
+template <typename Functor>
+void UnsafeManipulateDIO(HAL_DigitalHandle handle, int32_t* status,
+                         Functor func) {
+  auto port = digitalChannelHandles->Get(handle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  wpi::mutex& dioMutex = detail::UnsafeGetDIOMutex();
+  tDIO* dSys = detail::UnsafeGetDigialSystem();
+  auto mask = detail::ComputeDigitalMask(handle, status);
+  if (status != 0) return;
+  std::lock_guard<wpi::mutex> lock(dioMutex);
+
+  tDIO::tOutputEnable enableOE = dSys->readOutputEnable(status);
+  enableOE.value |= mask;
+  auto disableOE = enableOE;
+  disableOE.value &= ~mask;
+  tDIO::tDO enableDO = dSys->readDO(status);
+  enableDO.value |= mask;
+  auto disableDO = enableDO;
+  disableDO.value &= ~mask;
+
+  DIOSetProxy dioData{enableOE, disableOE, enableDO, disableDO, dSys};
+  func(dioData);
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/fpga_clock.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/fpga_clock.h
new file mode 100644
index 0000000..6b13aaf
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/fpga_clock.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <chrono>
+#include <limits>
+
+namespace hal {
+
+class fpga_clock {
+ public:
+  typedef std::chrono::microseconds::rep rep;
+  typedef std::chrono::microseconds::period period;
+  typedef std::chrono::microseconds duration;
+  typedef std::chrono::time_point<fpga_clock> time_point;
+
+  static fpga_clock::time_point now() noexcept;
+  static constexpr bool is_steady = true;
+
+  static fpga_clock::time_point epoch() noexcept { return time_point(zero()); }
+
+  static fpga_clock::duration zero() noexcept { return duration(0); }
+
+  static const time_point min_time;
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/make_unique.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/make_unique.h
new file mode 100644
index 0000000..ffc2d6f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/cpp/make_unique.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+// Define make_unique for C++11-only compilers
+#if __cplusplus == 201103L
+#include <cstddef>
+#include <memory>
+#include <type_traits>
+#include <utility>
+
+namespace std {
+template <class T>
+struct _Unique_if {
+  typedef unique_ptr<T> _Single_object;
+};
+
+template <class T>
+struct _Unique_if<T[]> {
+  typedef unique_ptr<T[]> _Unknown_bound;
+};
+
+template <class T, size_t N>
+struct _Unique_if<T[N]> {
+  typedef void _Known_bound;
+};
+
+template <class T, class... Args>
+typename _Unique_if<T>::_Single_object make_unique(Args&&... args) {
+  return unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+
+template <class T>
+typename _Unique_if<T>::_Unknown_bound make_unique(size_t n) {
+  typedef typename remove_extent<T>::type U;
+  return unique_ptr<T>(new U[n]());
+}
+
+template <class T, class... Args>
+typename _Unique_if<T>::_Known_bound make_unique(Args&&...) = delete;
+}  // namespace std
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/DigitalHandleResource.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/DigitalHandleResource.h
new file mode 100644
index 0000000..6473d90
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/DigitalHandleResource.h
@@ -0,0 +1,106 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "HAL/Errors.h"
+#include "HAL/Types.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/HandlesInternal.h"
+
+namespace hal {
+
+/**
+ * The DigitalHandleResource class is a way to track handles. This version
+ * allows a limited number of handles that are allocated by index.
+ * The enum value is seperate, as 2 enum values are allowed per handle
+ * Because they are allocated by index, each individual index holds its own
+ * mutex, which reduces contention heavily.]
+ *
+ * @tparam THandle The Handle Type (Must be typedefed from HAL_Handle)
+ * @tparam TStruct The struct type held by this resource
+ * @tparam size The number of resources allowed to be allocated
+ *
+ */
+template <typename THandle, typename TStruct, int16_t size>
+class DigitalHandleResource : public HandleBase {
+  friend class DigitalHandleResourceTest;
+
+ public:
+  DigitalHandleResource() = default;
+  DigitalHandleResource(const DigitalHandleResource&) = delete;
+  DigitalHandleResource& operator=(const DigitalHandleResource&) = delete;
+
+  THandle Allocate(int16_t index, HAL_HandleEnum enumValue, int32_t* status);
+  std::shared_ptr<TStruct> Get(THandle handle, HAL_HandleEnum enumValue);
+  void Free(THandle handle, HAL_HandleEnum enumValue);
+  void ResetHandles() override;
+
+ private:
+  std::array<std::shared_ptr<TStruct>, size> m_structures;
+  std::array<wpi::mutex, size> m_handleMutexes;
+};
+
+template <typename THandle, typename TStruct, int16_t size>
+THandle DigitalHandleResource<THandle, TStruct, size>::Allocate(
+    int16_t index, HAL_HandleEnum enumValue, int32_t* status) {
+  // don't aquire the lock if we can fail early.
+  if (index < 0 || index >= size) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // check for allocation, otherwise allocate and return a valid handle
+  if (m_structures[index] != nullptr) {
+    *status = RESOURCE_IS_ALLOCATED;
+    return HAL_kInvalidHandle;
+  }
+  m_structures[index] = std::make_shared<TStruct>();
+  return static_cast<THandle>(hal::createHandle(index, enumValue, m_version));
+}
+
+template <typename THandle, typename TStruct, int16_t size>
+std::shared_ptr<TStruct> DigitalHandleResource<THandle, TStruct, size>::Get(
+    THandle handle, HAL_HandleEnum enumValue) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) {
+    return nullptr;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // return structure. Null will propogate correctly, so no need to manually
+  // check.
+  return m_structures[index];
+}
+
+template <typename THandle, typename TStruct, int16_t size>
+void DigitalHandleResource<THandle, TStruct, size>::Free(
+    THandle handle, HAL_HandleEnum enumValue) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) return;
+  // lock and deallocated handle
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  m_structures[index].reset();
+}
+
+template <typename THandle, typename TStruct, int16_t size>
+void DigitalHandleResource<THandle, TStruct, size>::ResetHandles() {
+  for (int i = 0; i < size; i++) {
+    std::lock_guard<wpi::mutex> lock(m_handleMutexes[i]);
+    m_structures[i].reset();
+  }
+  HandleBase::ResetHandles();
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/HandlesInternal.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/HandlesInternal.h
new file mode 100644
index 0000000..7b353d2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/HandlesInternal.h
@@ -0,0 +1,119 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "HAL/Types.h"
+
+/* General Handle Data Layout
+ * Bits 0-15:  Handle Index
+ * Bits 16-23: 8 bit rolling reset detection
+ * Bits 24-30: Handle Type
+ * Bit 31:     1 if handle error, 0 if no error
+ *
+ * Other specialized handles will use different formats, however Bits 24-31 are
+ * always reserved for type and error handling.
+ */
+
+namespace hal {
+
+class HandleBase {
+ public:
+  HandleBase();
+  ~HandleBase();
+  HandleBase(const HandleBase&) = delete;
+  HandleBase& operator=(const HandleBase&) = delete;
+  virtual void ResetHandles();
+  static void ResetGlobalHandles();
+
+ protected:
+  int16_t m_version;
+};
+
+constexpr int16_t InvalidHandleIndex = -1;
+
+enum class HAL_HandleEnum {
+  Undefined = 0,
+  DIO = 1,
+  Port = 2,
+  Notifier = 3,
+  Interrupt = 4,
+  AnalogOutput = 5,
+  AnalogInput = 6,
+  AnalogTrigger = 7,
+  Relay = 8,
+  PWM = 9,
+  DigitalPWM = 10,
+  Counter = 11,
+  FPGAEncoder = 12,
+  Encoder = 13,
+  Compressor = 14,
+  Solenoid = 15,
+  AnalogGyro = 16,
+  Vendor = 17
+};
+
+static inline int16_t getHandleIndex(HAL_Handle handle) {
+  // mask and return last 16 bits
+  return static_cast<int16_t>(handle & 0xffff);
+}
+static inline HAL_HandleEnum getHandleType(HAL_Handle handle) {
+  // mask first 8 bits and cast to enum
+  return static_cast<HAL_HandleEnum>((handle >> 24) & 0xff);
+}
+static inline bool isHandleType(HAL_Handle handle, HAL_HandleEnum handleType) {
+  return handleType == getHandleType(handle);
+}
+static inline bool isHandleCorrectVersion(HAL_Handle handle, int16_t version) {
+  return (((handle & 0xFF0000) >> 16) & version) == version;
+}
+static inline int16_t getHandleTypedIndex(HAL_Handle handle,
+                                          HAL_HandleEnum enumType,
+                                          int16_t version) {
+  if (!isHandleType(handle, enumType)) return InvalidHandleIndex;
+#if !defined(__FRC_ROBORIO__)
+  if (!isHandleCorrectVersion(handle, version)) return InvalidHandleIndex;
+#endif
+  return getHandleIndex(handle);
+}
+
+/* specialized functions for Port handle
+ * Port Handle Data Layout
+ * Bits 0-7:   Channel Number
+ * Bits 8-15:  Module Number
+ * Bits 16-23: Unused
+ * Bits 24-30: Handle Type
+ * Bit 31:     1 if handle error, 0 if no error
+ */
+
+// using a 16 bit value so we can store 0-255 and still report error
+static inline int16_t getPortHandleChannel(HAL_PortHandle handle) {
+  if (!isHandleType(handle, HAL_HandleEnum::Port)) return InvalidHandleIndex;
+  return static_cast<uint8_t>(handle & 0xff);
+}
+
+// using a 16 bit value so we can store 0-255 and still report error
+static inline int16_t getPortHandleModule(HAL_PortHandle handle) {
+  if (!isHandleType(handle, HAL_HandleEnum::Port)) return InvalidHandleIndex;
+  return static_cast<uint8_t>((handle >> 8) & 0xff);
+}
+
+// using a 16 bit value so we can store 0-255 and still report error
+static inline int16_t getPortHandleSPIEnable(HAL_PortHandle handle) {
+  if (!isHandleType(handle, HAL_HandleEnum::Port)) return InvalidHandleIndex;
+  return static_cast<uint8_t>((handle >> 16) & 0xff);
+}
+
+HAL_PortHandle createPortHandle(uint8_t channel, uint8_t module);
+
+HAL_PortHandle createPortHandleForSPI(uint8_t channel);
+
+HAL_Handle createHandle(int16_t index, HAL_HandleEnum handleType,
+                        int16_t version);
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/IndexedClassedHandleResource.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/IndexedClassedHandleResource.h
new file mode 100644
index 0000000..c13fb2a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/IndexedClassedHandleResource.h
@@ -0,0 +1,118 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+#include <vector>
+
+#include <support/mutex.h>
+
+#include "HAL/Errors.h"
+#include "HAL/Types.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/HandlesInternal.h"
+
+namespace hal {
+
+/**
+ * The IndexedClassedHandleResource class is a way to track handles. This
+ * version
+ * allows a limited number of handles that are allocated by index.
+ * Because they are allocated by index, each individual index holds its own
+ * mutex, which reduces contention heavily.]
+ *
+ * @tparam THandle The Handle Type (Must be typedefed from HAL_Handle)
+ * @tparam TStruct The struct type held by this resource
+ * @tparam size The number of resources allowed to be allocated
+ * @tparam enumValue The type value stored in the handle
+ *
+ */
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+class IndexedClassedHandleResource : public HandleBase {
+  friend class IndexedClassedHandleResourceTest;
+
+ public:
+  IndexedClassedHandleResource() = default;
+  IndexedClassedHandleResource(const IndexedClassedHandleResource&) = delete;
+  IndexedClassedHandleResource& operator=(const IndexedClassedHandleResource&) =
+      delete;
+
+  THandle Allocate(int16_t index, std::shared_ptr<TStruct> toSet,
+                   int32_t* status);
+  std::shared_ptr<TStruct> Get(THandle handle);
+  void Free(THandle handle);
+  void ResetHandles();
+
+ private:
+  std::array<std::shared_ptr<TStruct>, size> m_structures;
+  std::array<wpi::mutex, size> m_handleMutexes;
+};
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+THandle
+IndexedClassedHandleResource<THandle, TStruct, size, enumValue>::Allocate(
+    int16_t index, std::shared_ptr<TStruct> toSet, int32_t* status) {
+  // don't aquire the lock if we can fail early.
+  if (index < 0 || index >= size) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // check for allocation, otherwise allocate and return a valid handle
+  if (m_structures[index] != nullptr) {
+    *status = RESOURCE_IS_ALLOCATED;
+    return HAL_kInvalidHandle;
+  }
+  m_structures[index] = toSet;
+  return static_cast<THandle>(hal::createHandle(index, enumValue, m_version));
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+std::shared_ptr<TStruct>
+IndexedClassedHandleResource<THandle, TStruct, size, enumValue>::Get(
+    THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) {
+    return nullptr;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // return structure. Null will propogate correctly, so no need to manually
+  // check.
+  return m_structures[index];
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void IndexedClassedHandleResource<THandle, TStruct, size, enumValue>::Free(
+    THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) return;
+  // lock and deallocated handle
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  m_structures[index].reset();
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void IndexedClassedHandleResource<THandle, TStruct, size,
+                                  enumValue>::ResetHandles() {
+  for (int i = 0; i < size; i++) {
+    std::lock_guard<wpi::mutex> lock(m_handleMutexes[i]);
+    m_structures[i].reset();
+  }
+  HandleBase::ResetHandles();
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/IndexedHandleResource.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/IndexedHandleResource.h
new file mode 100644
index 0000000..1d5ea86
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/IndexedHandleResource.h
@@ -0,0 +1,111 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "HAL/Errors.h"
+#include "HAL/Types.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/HandlesInternal.h"
+
+namespace hal {
+
+/**
+ * The IndexedHandleResource class is a way to track handles. This version
+ * allows a limited number of handles that are allocated by index.
+ * Because they are allocated by index, each individual index holds its own
+ * mutex, which reduces contention heavily.]
+ *
+ * @tparam THandle The Handle Type (Must be typedefed from HAL_Handle)
+ * @tparam TStruct The struct type held by this resource
+ * @tparam size The number of resources allowed to be allocated
+ * @tparam enumValue The type value stored in the handle
+ *
+ */
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+class IndexedHandleResource : public HandleBase {
+  friend class IndexedHandleResourceTest;
+
+ public:
+  IndexedHandleResource() = default;
+  IndexedHandleResource(const IndexedHandleResource&) = delete;
+  IndexedHandleResource& operator=(const IndexedHandleResource&) = delete;
+
+  THandle Allocate(int16_t index, int32_t* status);
+  std::shared_ptr<TStruct> Get(THandle handle);
+  void Free(THandle handle);
+  void ResetHandles() override;
+
+ private:
+  std::array<std::shared_ptr<TStruct>, size> m_structures;
+  std::array<wpi::mutex, size> m_handleMutexes;
+};
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+THandle IndexedHandleResource<THandle, TStruct, size, enumValue>::Allocate(
+    int16_t index, int32_t* status) {
+  // don't aquire the lock if we can fail early.
+  if (index < 0 || index >= size) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // check for allocation, otherwise allocate and return a valid handle
+  if (m_structures[index] != nullptr) {
+    *status = RESOURCE_IS_ALLOCATED;
+    return HAL_kInvalidHandle;
+  }
+  m_structures[index] = std::make_shared<TStruct>();
+  return static_cast<THandle>(hal::createHandle(index, enumValue, m_version));
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+std::shared_ptr<TStruct>
+IndexedHandleResource<THandle, TStruct, size, enumValue>::Get(THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) {
+    return nullptr;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // return structure. Null will propogate correctly, so no need to manually
+  // check.
+  return m_structures[index];
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void IndexedHandleResource<THandle, TStruct, size, enumValue>::Free(
+    THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) return;
+  // lock and deallocated handle
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  m_structures[index].reset();
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void IndexedHandleResource<THandle, TStruct, size, enumValue>::ResetHandles() {
+  for (int i = 0; i < size; i++) {
+    std::lock_guard<wpi::mutex> lock(m_handleMutexes[i]);
+    m_structures[i].reset();
+  }
+  HandleBase::ResetHandles();
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/LimitedClassedHandleResource.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/LimitedClassedHandleResource.h
new file mode 100644
index 0000000..57b15a2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/LimitedClassedHandleResource.h
@@ -0,0 +1,117 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "HAL/Types.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/HandlesInternal.h"
+
+namespace hal {
+
+/**
+ * The LimitedClassedHandleResource class is a way to track handles. This
+ * version
+ * allows a limited number of handles that are allocated sequentially.
+ *
+ * @tparam THandle The Handle Type (Must be typedefed from HAL_Handle)
+ * @tparam TStruct The struct type held by this resource
+ * @tparam size The number of resources allowed to be allocated
+ * @tparam enumValue The type value stored in the handle
+ *
+ */
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+class LimitedClassedHandleResource : public HandleBase {
+  friend class LimitedClassedHandleResourceTest;
+
+ public:
+  LimitedClassedHandleResource() = default;
+  LimitedClassedHandleResource(const LimitedClassedHandleResource&) = delete;
+  LimitedClassedHandleResource& operator=(const LimitedClassedHandleResource&) =
+      delete;
+
+  THandle Allocate(std::shared_ptr<TStruct> toSet);
+  std::shared_ptr<TStruct> Get(THandle handle);
+  void Free(THandle handle);
+  void ResetHandles() override;
+
+ private:
+  std::array<std::shared_ptr<TStruct>, size> m_structures;
+  std::array<wpi::mutex, size> m_handleMutexes;
+  wpi::mutex m_allocateMutex;
+};
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+THandle
+LimitedClassedHandleResource<THandle, TStruct, size, enumValue>::Allocate(
+    std::shared_ptr<TStruct> toSet) {
+  // globally lock to loop through indices
+  std::lock_guard<wpi::mutex> lock(m_allocateMutex);
+  for (int16_t i = 0; i < size; i++) {
+    if (m_structures[i] == nullptr) {
+      // if a false index is found, grab its specific mutex
+      // and allocate it.
+      std::lock_guard<wpi::mutex> lock(m_handleMutexes[i]);
+      m_structures[i] = toSet;
+      return static_cast<THandle>(createHandle(i, enumValue, m_version));
+    }
+  }
+  return HAL_kInvalidHandle;
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+std::shared_ptr<TStruct>
+LimitedClassedHandleResource<THandle, TStruct, size, enumValue>::Get(
+    THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) {
+    return nullptr;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // return structure. Null will propogate correctly, so no need to manually
+  // check.
+  return m_structures[index];
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void LimitedClassedHandleResource<THandle, TStruct, size, enumValue>::Free(
+    THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) return;
+  // lock and deallocated handle
+  std::lock_guard<wpi::mutex> allocateLock(m_allocateMutex);
+  std::lock_guard<wpi::mutex> handleLock(m_handleMutexes[index]);
+  m_structures[index].reset();
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void LimitedClassedHandleResource<THandle, TStruct, size,
+                                  enumValue>::ResetHandles() {
+  {
+    std::lock_guard<wpi::mutex> allocateLock(m_allocateMutex);
+    for (int i = 0; i < size; i++) {
+      std::lock_guard<wpi::mutex> handleLock(m_handleMutexes[i]);
+      m_structures[i].reset();
+    }
+  }
+  HandleBase::ResetHandles();
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/LimitedHandleResource.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/LimitedHandleResource.h
new file mode 100644
index 0000000..afab748
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/LimitedHandleResource.h
@@ -0,0 +1,111 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <array>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "HAL/Types.h"
+#include "HAL/cpp/make_unique.h"
+#include "HandlesInternal.h"
+
+namespace hal {
+
+/**
+ * The LimitedHandleResource class is a way to track handles. This version
+ * allows a limited number of handles that are allocated sequentially.
+ *
+ * @tparam THandle The Handle Type (Must be typedefed from HAL_Handle)
+ * @tparam TStruct The struct type held by this resource
+ * @tparam size The number of resources allowed to be allocated
+ * @tparam enumValue The type value stored in the handle
+ *
+ */
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+class LimitedHandleResource : public HandleBase {
+  friend class LimitedHandleResourceTest;
+
+ public:
+  LimitedHandleResource() = default;
+  LimitedHandleResource(const LimitedHandleResource&) = delete;
+  LimitedHandleResource& operator=(const LimitedHandleResource&) = delete;
+
+  THandle Allocate();
+  std::shared_ptr<TStruct> Get(THandle handle);
+  void Free(THandle handle);
+  void ResetHandles() override;
+
+ private:
+  std::array<std::shared_ptr<TStruct>, size> m_structures;
+  std::array<wpi::mutex, size> m_handleMutexes;
+  wpi::mutex m_allocateMutex;
+};
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+THandle LimitedHandleResource<THandle, TStruct, size, enumValue>::Allocate() {
+  // globally lock to loop through indices
+  std::lock_guard<wpi::mutex> lock(m_allocateMutex);
+  for (int16_t i = 0; i < size; i++) {
+    if (m_structures[i] == nullptr) {
+      // if a false index is found, grab its specific mutex
+      // and allocate it.
+      std::lock_guard<wpi::mutex> lock(m_handleMutexes[i]);
+      m_structures[i] = std::make_shared<TStruct>();
+      return static_cast<THandle>(createHandle(i, enumValue, m_version));
+    }
+  }
+  return HAL_kInvalidHandle;
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+std::shared_ptr<TStruct>
+LimitedHandleResource<THandle, TStruct, size, enumValue>::Get(THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) {
+    return nullptr;
+  }
+  std::lock_guard<wpi::mutex> lock(m_handleMutexes[index]);
+  // return structure. Null will propogate correctly, so no need to manually
+  // check.
+  return m_structures[index];
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void LimitedHandleResource<THandle, TStruct, size, enumValue>::Free(
+    THandle handle) {
+  // get handle index, and fail early if index out of range or wrong handle
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  if (index < 0 || index >= size) return;
+  // lock and deallocated handle
+  std::lock_guard<wpi::mutex> allocateLock(m_allocateMutex);
+  std::lock_guard<wpi::mutex> handleLock(m_handleMutexes[index]);
+  m_structures[index].reset();
+}
+
+template <typename THandle, typename TStruct, int16_t size,
+          HAL_HandleEnum enumValue>
+void LimitedHandleResource<THandle, TStruct, size, enumValue>::ResetHandles() {
+  {
+    std::lock_guard<wpi::mutex> allocateLock(m_allocateMutex);
+    for (int i = 0; i < size; i++) {
+      std::lock_guard<wpi::mutex> handleLock(m_handleMutexes[i]);
+      m_structures[i].reset();
+    }
+  }
+  HandleBase::ResetHandles();
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/UnlimitedHandleResource.h b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/UnlimitedHandleResource.h
new file mode 100644
index 0000000..5941628
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/HAL/handles/UnlimitedHandleResource.h
@@ -0,0 +1,126 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include <support/mutex.h>
+
+#include "HAL/Types.h"
+#include "HAL/handles/HandlesInternal.h"
+
+namespace hal {
+
+/**
+ * The UnlimitedHandleResource class is a way to track handles. This version
+ * allows an unlimted number of handles that are allocated sequentially. When
+ * possible, indices are reused to save memory usage and keep the array length
+ * down.
+ * However, automatic array management has not been implemented, but might be in
+ * the future.
+ * Because we have to loop through the allocator, we must use a global mutex.
+
+ * @tparam THandle The Handle Type (Must be typedefed from HAL_Handle)
+ * @tparam TStruct The struct type held by this resource
+ * @tparam enumValue The type value stored in the handle
+ *
+ */
+template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
+class UnlimitedHandleResource : public HandleBase {
+  friend class UnlimitedHandleResourceTest;
+
+ public:
+  UnlimitedHandleResource() = default;
+  UnlimitedHandleResource(const UnlimitedHandleResource&) = delete;
+  UnlimitedHandleResource& operator=(const UnlimitedHandleResource&) = delete;
+
+  THandle Allocate(std::shared_ptr<TStruct> structure);
+  std::shared_ptr<TStruct> Get(THandle handle);
+  /* Returns structure previously at that handle (or nullptr if none) */
+  std::shared_ptr<TStruct> Free(THandle handle);
+  void ResetHandles() override;
+
+  /* Calls func(THandle, TStruct*) for each handle.  Note this holds the
+   * global lock for the entirety of execution.
+   */
+  template <typename Functor>
+  void ForEach(Functor func);
+
+ private:
+  std::vector<std::shared_ptr<TStruct>> m_structures;
+  wpi::mutex m_handleMutex;
+};
+
+template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
+THandle UnlimitedHandleResource<THandle, TStruct, enumValue>::Allocate(
+    std::shared_ptr<TStruct> structure) {
+  std::lock_guard<wpi::mutex> lock(m_handleMutex);
+  size_t i;
+  for (i = 0; i < m_structures.size(); i++) {
+    if (m_structures[i] == nullptr) {
+      m_structures[i] = structure;
+      return static_cast<THandle>(createHandle(i, enumValue, m_version));
+    }
+  }
+  if (i >= INT16_MAX) return HAL_kInvalidHandle;
+
+  m_structures.push_back(structure);
+  return static_cast<THandle>(
+      createHandle(static_cast<int16_t>(i), enumValue, m_version));
+}
+
+template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
+std::shared_ptr<TStruct>
+UnlimitedHandleResource<THandle, TStruct, enumValue>::Get(THandle handle) {
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  std::lock_guard<wpi::mutex> lock(m_handleMutex);
+  if (index < 0 || index >= static_cast<int16_t>(m_structures.size()))
+    return nullptr;
+  return m_structures[index];
+}
+
+template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
+std::shared_ptr<TStruct>
+UnlimitedHandleResource<THandle, TStruct, enumValue>::Free(THandle handle) {
+  int16_t index = getHandleTypedIndex(handle, enumValue, m_version);
+  std::lock_guard<wpi::mutex> lock(m_handleMutex);
+  if (index < 0 || index >= static_cast<int16_t>(m_structures.size()))
+    return nullptr;
+  return std::move(m_structures[index]);
+}
+
+template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
+void UnlimitedHandleResource<THandle, TStruct, enumValue>::ResetHandles() {
+  {
+    std::lock_guard<wpi::mutex> lock(m_handleMutex);
+    for (size_t i = 0; i < m_structures.size(); i++) {
+      m_structures[i].reset();
+    }
+  }
+  HandleBase::ResetHandles();
+}
+
+template <typename THandle, typename TStruct, HAL_HandleEnum enumValue>
+template <typename Functor>
+void UnlimitedHandleResource<THandle, TStruct, enumValue>::ForEach(
+    Functor func) {
+  std::lock_guard<wpi::mutex> lock(m_handleMutex);
+  size_t i;
+  for (i = 0; i < m_structures.size(); i++) {
+    if (m_structures[i] != nullptr) {
+      func(static_cast<THandle>(createHandle(i, enumValue, m_version)),
+           m_structures[i].get());
+    }
+  }
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AccelerometerData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AccelerometerData.h
new file mode 100644
index 0000000..dcf7b14
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AccelerometerData.h
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetAccelerometerData(int32_t index);
+int32_t HALSIM_RegisterAccelerometerActiveCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelAccelerometerActiveCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetAccelerometerActive(int32_t index);
+void HALSIM_SetAccelerometerActive(int32_t index, HAL_Bool active);
+
+int32_t HALSIM_RegisterAccelerometerRangeCallback(int32_t index,
+                                                  HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify);
+void HALSIM_CancelAccelerometerRangeCallback(int32_t index, int32_t uid);
+HAL_AccelerometerRange HALSIM_GetAccelerometerRange(int32_t index);
+void HALSIM_SetAccelerometerRange(int32_t index, HAL_AccelerometerRange range);
+
+int32_t HALSIM_RegisterAccelerometerXCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelAccelerometerXCallback(int32_t index, int32_t uid);
+double HALSIM_GetAccelerometerX(int32_t index);
+void HALSIM_SetAccelerometerX(int32_t index, double x);
+
+int32_t HALSIM_RegisterAccelerometerYCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelAccelerometerYCallback(int32_t index, int32_t uid);
+double HALSIM_GetAccelerometerY(int32_t index);
+void HALSIM_SetAccelerometerY(int32_t index, double y);
+
+int32_t HALSIM_RegisterAccelerometerZCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelAccelerometerZCallback(int32_t index, int32_t uid);
+double HALSIM_GetAccelerometerZ(int32_t index);
+void HALSIM_SetAccelerometerZ(int32_t index, double z);
+
+void HALSIM_RegisterAccelerometerAllCallbacks(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogGyroData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogGyroData.h
new file mode 100644
index 0000000..b15ddd5
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogGyroData.h
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetAnalogGyroData(int32_t index);
+int32_t HALSIM_RegisterAnalogGyroAngleCallback(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify);
+void HALSIM_CancelAnalogGyroAngleCallback(int32_t index, int32_t uid);
+double HALSIM_GetAnalogGyroAngle(int32_t index);
+void HALSIM_SetAnalogGyroAngle(int32_t index, double angle);
+
+int32_t HALSIM_RegisterAnalogGyroRateCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelAnalogGyroRateCallback(int32_t index, int32_t uid);
+double HALSIM_GetAnalogGyroRate(int32_t index);
+void HALSIM_SetAnalogGyroRate(int32_t index, double rate);
+
+int32_t HALSIM_RegisterAnalogGyroInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogGyroInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetAnalogGyroInitialized(int32_t index);
+void HALSIM_SetAnalogGyroInitialized(int32_t index, HAL_Bool initialized);
+
+void HALSIM_RegisterAnalogGyroAllCallbacks(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogInData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogInData.h
new file mode 100644
index 0000000..1e46b54
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogInData.h
@@ -0,0 +1,101 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetAnalogInData(int32_t index);
+int32_t HALSIM_RegisterAnalogInInitializedCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetAnalogInInitialized(int32_t index);
+void HALSIM_SetAnalogInInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterAnalogInAverageBitsCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInAverageBitsCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetAnalogInAverageBits(int32_t index);
+void HALSIM_SetAnalogInAverageBits(int32_t index, int32_t averageBits);
+
+int32_t HALSIM_RegisterAnalogInOversampleBitsCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInOversampleBitsCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetAnalogInOversampleBits(int32_t index);
+void HALSIM_SetAnalogInOversampleBits(int32_t index, int32_t oversampleBits);
+
+int32_t HALSIM_RegisterAnalogInVoltageCallback(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInVoltageCallback(int32_t index, int32_t uid);
+double HALSIM_GetAnalogInVoltage(int32_t index);
+void HALSIM_SetAnalogInVoltage(int32_t index, double voltage);
+
+int32_t HALSIM_RegisterAnalogInAccumulatorInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInAccumulatorInitializedCallback(int32_t index,
+                                                         int32_t uid);
+HAL_Bool HALSIM_GetAnalogInAccumulatorInitialized(int32_t index);
+void HALSIM_SetAnalogInAccumulatorInitialized(int32_t index,
+                                              HAL_Bool accumulatorInitialized);
+
+int32_t HALSIM_RegisterAnalogInAccumulatorValueCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInAccumulatorValueCallback(int32_t index, int32_t uid);
+int64_t HALSIM_GetAnalogInAccumulatorValue(int32_t index);
+void HALSIM_SetAnalogInAccumulatorValue(int32_t index,
+                                        int64_t accumulatorValue);
+
+int32_t HALSIM_RegisterAnalogInAccumulatorCountCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInAccumulatorCountCallback(int32_t index, int32_t uid);
+int64_t HALSIM_GetAnalogInAccumulatorCount(int32_t index);
+void HALSIM_SetAnalogInAccumulatorCount(int32_t index,
+                                        int64_t accumulatorCount);
+
+int32_t HALSIM_RegisterAnalogInAccumulatorCenterCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInAccumulatorCenterCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetAnalogInAccumulatorCenter(int32_t index);
+void HALSIM_SetAnalogInAccumulatorCenter(int32_t index,
+                                         int32_t accumulatorCenter);
+
+int32_t HALSIM_RegisterAnalogInAccumulatorDeadbandCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogInAccumulatorDeadbandCallback(int32_t index,
+                                                      int32_t uid);
+int32_t HALSIM_GetAnalogInAccumulatorDeadband(int32_t index);
+void HALSIM_SetAnalogInAccumulatorDeadband(int32_t index,
+                                           int32_t accumulatorDeadband);
+
+void HALSIM_RegisterAnalogInAllCallbacks(int32_t index,
+                                         HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogOutData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogOutData.h
new file mode 100644
index 0000000..c1721df
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogOutData.h
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetAnalogOutData(int32_t index);
+int32_t HALSIM_RegisterAnalogOutVoltageCallback(int32_t index,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify);
+void HALSIM_CancelAnalogOutVoltageCallback(int32_t index, int32_t uid);
+double HALSIM_GetAnalogOutVoltage(int32_t index);
+void HALSIM_SetAnalogOutVoltage(int32_t index, double voltage);
+
+int32_t HALSIM_RegisterAnalogOutInitializedCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogOutInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetAnalogOutInitialized(int32_t index);
+void HALSIM_SetAnalogOutInitialized(int32_t index, HAL_Bool initialized);
+
+void HALSIM_RegisterAnalogOutAllCallbacks(int32_t index,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogTriggerData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogTriggerData.h
new file mode 100644
index 0000000..848f16a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/AnalogTriggerData.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+enum HALSIM_AnalogTriggerMode : int32_t {
+  HALSIM_AnalogTriggerUnassigned,
+  HALSIM_AnalogTriggerFiltered,
+  HALSIM_AnalogTriggerAveraged
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetAnalogTriggerData(int32_t index);
+int32_t HALSIM_RegisterAnalogTriggerInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogTriggerInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetAnalogTriggerInitialized(int32_t index);
+void HALSIM_SetAnalogTriggerInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterAnalogTriggerTriggerLowerBoundCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogTriggerTriggerLowerBoundCallback(int32_t index,
+                                                         int32_t uid);
+double HALSIM_GetAnalogTriggerTriggerLowerBound(int32_t index);
+void HALSIM_SetAnalogTriggerTriggerLowerBound(int32_t index,
+                                              double triggerLowerBound);
+
+int32_t HALSIM_RegisterAnalogTriggerTriggerUpperBoundCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogTriggerTriggerUpperBoundCallback(int32_t index,
+                                                         int32_t uid);
+double HALSIM_GetAnalogTriggerTriggerUpperBound(int32_t index);
+void HALSIM_SetAnalogTriggerTriggerUpperBound(int32_t index,
+                                              double triggerUpperBound);
+
+int32_t HALSIM_RegisterAnalogTriggerTriggerModeCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelAnalogTriggerTriggerModeCallback(int32_t index, int32_t uid);
+HALSIM_AnalogTriggerMode HALSIM_GetAnalogTriggerTriggerMode(int32_t index);
+void HALSIM_SetAnalogTriggerTriggerMode(int32_t index,
+                                        HALSIM_AnalogTriggerMode triggerMode);
+
+void HALSIM_RegisterAnalogTriggerAllCallbacks(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/CanData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/CanData.h
new file mode 100644
index 0000000..ca91b03
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/CanData.h
@@ -0,0 +1,78 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "HAL_Value.h"
+#include "NotifyListener.h"
+
+typedef void (*HAL_CAN_SendMessageCallback)(const char* name, void* param,
+                                            uint32_t messageID,
+                                            const uint8_t* data,
+                                            uint8_t dataSize, int32_t periodMs,
+                                            int32_t* status);
+
+typedef void (*HAL_CAN_ReceiveMessageCallback)(
+    const char* name, void* param, uint32_t* messageID, uint32_t messageIDMask,
+    uint8_t* data, uint8_t* dataSize, uint32_t* timeStamp, int32_t* status);
+
+typedef void (*HAL_CAN_OpenStreamSessionCallback)(
+    const char* name, void* param, uint32_t* sessionHandle, uint32_t messageID,
+    uint32_t messageIDMask, uint32_t maxMessages, int32_t* status);
+
+typedef void (*HAL_CAN_CloseStreamSessionCallback)(const char* name,
+                                                   void* param,
+                                                   uint32_t sessionHandle);
+
+typedef void (*HAL_CAN_ReadStreamSessionCallback)(
+    const char* name, void* param, uint32_t sessionHandle,
+    struct HAL_CANStreamMessage* messages, uint32_t messagesToRead,
+    uint32_t* messagesRead, int32_t* status);
+
+typedef void (*HAL_CAN_GetCANStatusCallback)(
+    const char* name, void* param, float* percentBusUtilization,
+    uint32_t* busOffCount, uint32_t* txFullCount, uint32_t* receiveErrorCount,
+    uint32_t* transmitErrorCount, int32_t* status);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetCanData(void);
+
+int32_t HALSIM_RegisterCanSendMessageCallback(
+    HAL_CAN_SendMessageCallback callback, void* param);
+void HALSIM_CancelCanSendMessageCallback(int32_t uid);
+
+int32_t HALSIM_RegisterCanReceiveMessageCallback(
+    HAL_CAN_ReceiveMessageCallback callback, void* param);
+void HALSIM_CancelCanReceiveMessageCallback(int32_t uid);
+
+int32_t HALSIM_RegisterCanOpenStreamCallback(
+    HAL_CAN_OpenStreamSessionCallback callback, void* param);
+void HALSIM_CancelCanOpenStreamCallback(int32_t uid);
+
+int32_t HALSIM_RegisterCanCloseStreamCallback(
+    HAL_CAN_CloseStreamSessionCallback callback, void* param);
+void HALSIM_CancelCanCloseStreamCallback(int32_t uid);
+
+int32_t HALSIM_RegisterCanReadStreamCallback(
+    HAL_CAN_ReadStreamSessionCallback callback, void* param);
+void HALSIM_CancelCanReadStreamCallback(int32_t uid);
+
+int32_t HALSIM_RegisterCanGetCANStatusCallback(
+    HAL_CAN_GetCANStatusCallback callback, void* param);
+void HALSIM_CancelCanGetCANStatusCallback(int32_t uid);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DIOData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DIOData.h
new file mode 100644
index 0000000..fbbc02f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DIOData.h
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetDIOData(int32_t index);
+int32_t HALSIM_RegisterDIOInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelDIOInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetDIOInitialized(int32_t index);
+void HALSIM_SetDIOInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterDIOValueCallback(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDIOValueCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetDIOValue(int32_t index);
+void HALSIM_SetDIOValue(int32_t index, HAL_Bool value);
+
+int32_t HALSIM_RegisterDIOPulseLengthCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelDIOPulseLengthCallback(int32_t index, int32_t uid);
+double HALSIM_GetDIOPulseLength(int32_t index);
+void HALSIM_SetDIOPulseLength(int32_t index, double pulseLength);
+
+int32_t HALSIM_RegisterDIOIsInputCallback(int32_t index,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDIOIsInputCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetDIOIsInput(int32_t index);
+void HALSIM_SetDIOIsInput(int32_t index, HAL_Bool isInput);
+
+int32_t HALSIM_RegisterDIOFilterIndexCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelDIOFilterIndexCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetDIOFilterIndex(int32_t index);
+void HALSIM_SetDIOFilterIndex(int32_t index, int32_t filterIndex);
+
+void HALSIM_RegisterDIOAllCallbacks(int32_t index, HAL_NotifyCallback callback,
+                                    void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DigitalPWMData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DigitalPWMData.h
new file mode 100644
index 0000000..cdd419d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DigitalPWMData.h
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetDigitalPWMData(int32_t index);
+int32_t HALSIM_RegisterDigitalPWMInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelDigitalPWMInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetDigitalPWMInitialized(int32_t index);
+void HALSIM_SetDigitalPWMInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterDigitalPWMDutyCycleCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelDigitalPWMDutyCycleCallback(int32_t index, int32_t uid);
+double HALSIM_GetDigitalPWMDutyCycle(int32_t index);
+void HALSIM_SetDigitalPWMDutyCycle(int32_t index, double dutyCycle);
+
+int32_t HALSIM_RegisterDigitalPWMPinCallback(int32_t index,
+                                             HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify);
+void HALSIM_CancelDigitalPWMPinCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetDigitalPWMPin(int32_t index);
+void HALSIM_SetDigitalPWMPin(int32_t index, int32_t pin);
+
+void HALSIM_RegisterDigitalPWMAllCallbacks(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DriverStationData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DriverStationData.h
new file mode 100644
index 0000000..a9f1e76
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/DriverStationData.h
@@ -0,0 +1,99 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/DriverStation.h"
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetDriverStationData(void);
+int32_t HALSIM_RegisterDriverStationEnabledCallback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationEnabledCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationEnabled(void);
+void HALSIM_SetDriverStationEnabled(HAL_Bool enabled);
+
+int32_t HALSIM_RegisterDriverStationAutonomousCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationAutonomousCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationAutonomous(void);
+void HALSIM_SetDriverStationAutonomous(HAL_Bool autonomous);
+
+int32_t HALSIM_RegisterDriverStationTestCallback(HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationTestCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationTest(void);
+void HALSIM_SetDriverStationTest(HAL_Bool test);
+
+int32_t HALSIM_RegisterDriverStationEStopCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationEStopCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationEStop(void);
+void HALSIM_SetDriverStationEStop(HAL_Bool eStop);
+
+int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationFmsAttachedCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationFmsAttached(void);
+void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached);
+
+int32_t HALSIM_RegisterDriverStationDsAttachedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid);
+HAL_Bool HALSIM_GetDriverStationDsAttached(void);
+void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached);
+
+int32_t HALSIM_RegisterDriverStationAllianceStationIdCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid);
+HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId(void);
+void HALSIM_SetDriverStationAllianceStationId(
+    HAL_AllianceStationID allianceStationId);
+
+int32_t HALSIM_RegisterDriverStationMatchTimeCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify);
+void HALSIM_CancelDriverStationMatchTimeCallback(int32_t uid);
+double HALSIM_GetDriverStationMatchTime(void);
+void HALSIM_SetDriverStationMatchTime(double matchTime);
+
+void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
+void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
+void HALSIM_SetJoystickButtons(int32_t joystickNum,
+                               const HAL_JoystickButtons* buttons);
+void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
+                                  const HAL_JoystickDescriptor* descriptor);
+
+void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
+                               int32_t* leftRumble, int32_t* rightRumble);
+
+void HALSIM_SetMatchInfo(const HAL_MatchInfo* info);
+
+void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+
+void HALSIM_NotifyDriverStationNewData(void);
+
+void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/EncoderData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/EncoderData.h
new file mode 100644
index 0000000..382e41d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/EncoderData.h
@@ -0,0 +1,91 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetEncoderData(int32_t index);
+int32_t HALSIM_RegisterEncoderInitializedCallback(int32_t index,
+                                                  HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify);
+void HALSIM_CancelEncoderInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetEncoderInitialized(int32_t index);
+void HALSIM_SetEncoderInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterEncoderCountCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+void HALSIM_CancelEncoderCountCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetEncoderCount(int32_t index);
+void HALSIM_SetEncoderCount(int32_t index, int32_t count);
+
+int32_t HALSIM_RegisterEncoderPeriodCallback(int32_t index,
+                                             HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify);
+void HALSIM_CancelEncoderPeriodCallback(int32_t index, int32_t uid);
+double HALSIM_GetEncoderPeriod(int32_t index);
+void HALSIM_SetEncoderPeriod(int32_t index, double period);
+
+int32_t HALSIM_RegisterEncoderResetCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+void HALSIM_CancelEncoderResetCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetEncoderReset(int32_t index);
+void HALSIM_SetEncoderReset(int32_t index, HAL_Bool reset);
+
+int32_t HALSIM_RegisterEncoderMaxPeriodCallback(int32_t index,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify);
+void HALSIM_CancelEncoderMaxPeriodCallback(int32_t index, int32_t uid);
+double HALSIM_GetEncoderMaxPeriod(int32_t index);
+void HALSIM_SetEncoderMaxPeriod(int32_t index, double maxPeriod);
+
+int32_t HALSIM_RegisterEncoderDirectionCallback(int32_t index,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify);
+void HALSIM_CancelEncoderDirectionCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetEncoderDirection(int32_t index);
+void HALSIM_SetEncoderDirection(int32_t index, HAL_Bool direction);
+
+int32_t HALSIM_RegisterEncoderReverseDirectionCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelEncoderReverseDirectionCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetEncoderReverseDirection(int32_t index);
+void HALSIM_SetEncoderReverseDirection(int32_t index,
+                                       HAL_Bool reverseDirection);
+
+int32_t HALSIM_RegisterEncoderSamplesToAverageCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelEncoderSamplesToAverageCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetEncoderSamplesToAverage(int32_t index);
+void HALSIM_SetEncoderSamplesToAverage(int32_t index, int32_t samplesToAverage);
+
+void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/HAL_Value.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/HAL_Value.h
new file mode 100644
index 0000000..19308ed
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/HAL_Value.h
@@ -0,0 +1,71 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/Types.h"
+
+/** HAL data types. */
+enum HAL_Type {
+  HAL_UNASSIGNED = 0,
+  HAL_BOOLEAN = 0x01,
+  HAL_DOUBLE = 0x02,
+  HAL_ENUM = 0x16,
+  HAL_INT = 0x32,
+  HAL_LONG = 0x64,
+};
+
+/** HAL Entry Value.  Note this is a typed union. */
+struct HAL_Value {
+  union {
+    HAL_Bool v_boolean;
+    int32_t v_enum;
+    int32_t v_int;
+    int64_t v_long;
+    double v_double;
+  } data;
+  enum HAL_Type type;
+};
+
+inline HAL_Value MakeBoolean(HAL_Bool v) {
+  HAL_Value value;
+  value.type = HAL_BOOLEAN;
+  value.data.v_boolean = v;
+  return value;
+}
+
+inline HAL_Value MakeEnum(int v) {
+  HAL_Value value;
+  value.type = HAL_ENUM;
+  value.data.v_enum = v;
+  return value;
+}
+
+inline HAL_Value MakeInt(int v) {
+  HAL_Value value;
+  value.type = HAL_INT;
+  value.data.v_int = v;
+  return value;
+}
+
+inline HAL_Value MakeLong(int64_t v) {
+  HAL_Value value;
+  value.type = HAL_LONG;
+  value.data.v_long = v;
+  return value;
+}
+
+inline HAL_Value MakeDouble(double v) {
+  HAL_Value value;
+  value.type = HAL_DOUBLE;
+  value.data.v_double = v;
+  return value;
+}
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/I2CData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/I2CData.h
new file mode 100644
index 0000000..9b12bf7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/I2CData.h
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetI2CData(int32_t index);
+
+int32_t HALSIM_RegisterI2CInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelI2CInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetI2CInitialized(int32_t index);
+void HALSIM_SetI2CInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterI2CReadCallback(int32_t index,
+                                       HAL_BufferCallback callback,
+                                       void* param);
+void HALSIM_CancelI2CReadCallback(int32_t index, int32_t uid);
+
+int32_t HALSIM_RegisterI2CWriteCallback(int32_t index,
+                                        HAL_ConstBufferCallback callback,
+                                        void* param);
+void HALSIM_CancelI2CWriteCallback(int32_t index, int32_t uid);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/MockHooks.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/MockHooks.h
new file mode 100644
index 0000000..c67d198
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/MockHooks.h
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+extern "C" {
+void HALSIM_WaitForProgramStart(void);
+void HALSIM_SetProgramStarted(void);
+void HALSIM_RestartTiming(void);
+}  // extern "C"
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyCallbackHelpers.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyCallbackHelpers.h
new file mode 100644
index 0000000..588ae1b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyCallbackHelpers.h
@@ -0,0 +1,71 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include <memory>
+
+#include "MockData/NotifyListenerVector.h"
+
+template <typename VectorType, typename CallbackType>
+std::shared_ptr<VectorType> RegisterCallbackImpl(
+    std::shared_ptr<VectorType> currentVector, const char* name,
+    CallbackType callback, void* param, int32_t* newUid) {
+  std::shared_ptr<VectorType> newCallbacks;
+  if (currentVector == nullptr) {
+    newCallbacks = std::make_shared<VectorType>(
+        param, callback, reinterpret_cast<unsigned int*>(newUid));
+  } else {
+    newCallbacks = currentVector->emplace_back(
+        param, callback, reinterpret_cast<unsigned int*>(newUid));
+  }
+  return newCallbacks;
+}
+
+template <typename VectorType, typename CallbackType>
+std::shared_ptr<VectorType> CancelCallbackImpl(
+    std::shared_ptr<VectorType> currentVector, int32_t uid) {
+  // Create a copy of the callbacks to erase from
+  auto newCallbacks = currentVector->erase(uid);
+  return newCallbacks;
+}
+
+std::shared_ptr<hal::NotifyListenerVector> RegisterCallback(
+    std::shared_ptr<hal::NotifyListenerVector> currentVector, const char* name,
+    HAL_NotifyCallback callback, void* param, int32_t* newUid);
+
+std::shared_ptr<hal::NotifyListenerVector> CancelCallback(
+    std::shared_ptr<hal::NotifyListenerVector> currentVector, int32_t uid);
+
+void InvokeCallback(std::shared_ptr<hal::NotifyListenerVector> currentVector,
+                    const char* name, const HAL_Value* value);
+
+std::shared_ptr<hal::BufferListenerVector> RegisterCallback(
+    std::shared_ptr<hal::BufferListenerVector> currentVector, const char* name,
+    HAL_BufferCallback callback, void* param, int32_t* newUid);
+
+std::shared_ptr<hal::BufferListenerVector> CancelCallback(
+    std::shared_ptr<hal::BufferListenerVector> currentVector, int32_t uid);
+
+void InvokeCallback(std::shared_ptr<hal::BufferListenerVector> currentVector,
+                    const char* name, uint8_t* buffer, int32_t count);
+
+std::shared_ptr<hal::ConstBufferListenerVector> RegisterCallback(
+    std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
+    const char* name, HAL_ConstBufferCallback callback, void* param,
+    int32_t* newUid);
+
+std::shared_ptr<hal::ConstBufferListenerVector> CancelCallback(
+    std::shared_ptr<hal::ConstBufferListenerVector> currentVector, int32_t uid);
+
+void InvokeCallback(
+    std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
+    const char* name, const uint8_t* buffer, int32_t count);
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyListener.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyListener.h
new file mode 100644
index 0000000..8d7e199
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyListener.h
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL_Value.h"
+
+typedef void (*HAL_NotifyCallback)(const char* name, void* param,
+                                   const struct HAL_Value* value);
+
+typedef void (*HAL_BufferCallback)(const char* name, void* param,
+                                   unsigned char* buffer, unsigned int count);
+
+typedef void (*HAL_ConstBufferCallback)(const char* name, void* param,
+                                        const unsigned char* buffer,
+                                        unsigned int count);
+
+namespace hal {
+
+template <typename CallbackFunction>
+struct HalCallbackListener {
+  HalCallbackListener() = default;
+  HalCallbackListener(void* param_, CallbackFunction callback_)
+      : callback(callback_), param(param_) {}
+
+  explicit operator bool() const { return callback != nullptr; }
+
+  CallbackFunction callback;
+  void* param;
+};
+
+}  // namespace hal
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyListenerVector.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyListenerVector.h
new file mode 100644
index 0000000..7164784
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/NotifyListenerVector.h
@@ -0,0 +1,142 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include <memory>
+#include <queue>
+#include <vector>
+
+#include "NotifyListener.h"
+
+namespace hal {
+// Vector which provides an integrated freelist for removal and reuse of
+// individual elements.
+
+template <typename ListenerType>
+class HalCallbackListenerVectorImpl {
+  struct private_init {};
+
+ public:
+  typedef typename std::vector<HalCallbackListener<ListenerType>>::size_type
+      size_type;
+
+  // Constructor for creating copies of the vector
+  HalCallbackListenerVectorImpl(const HalCallbackListenerVectorImpl* copyFrom,
+                                const private_init&);
+
+  // Delete all default constructors so they cannot be used
+  HalCallbackListenerVectorImpl& operator=(
+      const HalCallbackListenerVectorImpl&) = delete;
+  HalCallbackListenerVectorImpl() = delete;
+  HalCallbackListenerVectorImpl(const HalCallbackListenerVectorImpl&) = delete;
+
+  // Create a new vector with a single callback inside of it
+  HalCallbackListenerVectorImpl(void* param, ListenerType callback,
+                                unsigned int* newUid) {
+    *newUid = emplace_back_impl(param, callback);
+  }
+
+  size_type size() const { return m_vector.size(); }
+  HalCallbackListener<ListenerType>& operator[](size_type i) {
+    return m_vector[i];
+  }
+  const HalCallbackListener<ListenerType>& operator[](size_type i) const {
+    return m_vector[i];
+  }
+
+  // Add a new NotifyListener to a copy of the vector.  If there are elements on
+  // the freelist,
+  // reuses the last one; otherwise adds to the end of the vector.
+  // Returns the resulting element index (+1).
+  std::shared_ptr<HalCallbackListenerVectorImpl<ListenerType>> emplace_back(
+      void* param, ListenerType callback, unsigned int* newUid);
+
+  // Removes the identified element by replacing it with a default-constructed
+  // one.  The element is added to the freelist for later reuse. Returns a copy
+  std::shared_ptr<HalCallbackListenerVectorImpl<ListenerType>> erase(
+      unsigned int uid);
+
+ private:
+  std::vector<HalCallbackListener<ListenerType>> m_vector;
+  std::vector<unsigned int> m_free;
+
+  // Add a new NotifyListener to the vector.  If there are elements on the
+  // freelist,
+  // reuses the last one; otherwise adds to the end of the vector.
+  // Returns the resulting element index (+1).
+  unsigned int emplace_back_impl(void* param, ListenerType callback);
+
+  // Removes the identified element by replacing it with a default-constructed
+  // one.  The element is added to the freelist for later reuse.
+  void erase_impl(unsigned int uid);
+};
+
+template <typename ListenerType>
+HalCallbackListenerVectorImpl<ListenerType>::HalCallbackListenerVectorImpl(
+    const HalCallbackListenerVectorImpl<ListenerType>* copyFrom,
+    const private_init&)
+    : m_vector(copyFrom->m_vector), m_free(copyFrom->m_free) {}
+
+template <typename ListenerType>
+std::shared_ptr<HalCallbackListenerVectorImpl<ListenerType>>
+HalCallbackListenerVectorImpl<ListenerType>::emplace_back(
+    void* param, ListenerType callback, unsigned int* newUid) {
+  auto newVector =
+      std::make_shared<HalCallbackListenerVectorImpl<ListenerType>>(
+          this, private_init());
+  newVector->m_vector = m_vector;
+  newVector->m_free = m_free;
+  *newUid = newVector->emplace_back_impl(param, callback);
+  return newVector;
+}
+
+template <typename ListenerType>
+std::shared_ptr<HalCallbackListenerVectorImpl<ListenerType>>
+HalCallbackListenerVectorImpl<ListenerType>::erase(unsigned int uid) {
+  auto newVector =
+      std::make_shared<HalCallbackListenerVectorImpl<ListenerType>>(
+          this, private_init());
+  newVector->m_vector = m_vector;
+  newVector->m_free = m_free;
+  newVector->erase_impl(uid);
+  return newVector;
+}
+
+template <typename ListenerType>
+unsigned int HalCallbackListenerVectorImpl<ListenerType>::emplace_back_impl(
+    void* param, ListenerType callback) {
+  unsigned int uid;
+  if (m_free.empty()) {
+    uid = m_vector.size();
+    m_vector.emplace_back(param, callback);
+  } else {
+    uid = m_free.back();
+    m_free.pop_back();
+    m_vector[uid] = HalCallbackListener<ListenerType>(param, callback);
+  }
+  return uid + 1;
+}
+
+template <typename ListenerType>
+void HalCallbackListenerVectorImpl<ListenerType>::erase_impl(unsigned int uid) {
+  --uid;
+  if (uid >= m_vector.size() || !m_vector[uid]) return;
+  m_free.push_back(uid);
+  m_vector[uid] = HalCallbackListener<ListenerType>();
+}
+
+typedef HalCallbackListenerVectorImpl<HAL_NotifyCallback> NotifyListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_BufferCallback> BufferListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_ConstBufferCallback>
+    ConstBufferListenerVector;
+
+}  // namespace hal
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PCMData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PCMData.h
new file mode 100644
index 0000000..083ef64
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PCMData.h
@@ -0,0 +1,93 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetPCMData(int32_t index);
+int32_t HALSIM_RegisterPCMSolenoidInitializedCallback(
+    int32_t index, int32_t channel, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelPCMSolenoidInitializedCallback(int32_t index, int32_t channel,
+                                                 int32_t uid);
+HAL_Bool HALSIM_GetPCMSolenoidInitialized(int32_t index, int32_t channel);
+void HALSIM_SetPCMSolenoidInitialized(int32_t index, int32_t channel,
+                                      HAL_Bool solenoidInitialized);
+
+int32_t HALSIM_RegisterPCMSolenoidOutputCallback(int32_t index, int32_t channel,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelPCMSolenoidOutputCallback(int32_t index, int32_t channel,
+                                            int32_t uid);
+HAL_Bool HALSIM_GetPCMSolenoidOutput(int32_t index, int32_t channel);
+void HALSIM_SetPCMSolenoidOutput(int32_t index, int32_t channel,
+                                 HAL_Bool solenoidOutput);
+
+int32_t HALSIM_RegisterPCMCompressorInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelPCMCompressorInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPCMCompressorInitialized(int32_t index);
+void HALSIM_SetPCMCompressorInitialized(int32_t index,
+                                        HAL_Bool compressorInitialized);
+
+int32_t HALSIM_RegisterPCMCompressorOnCallback(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify);
+void HALSIM_CancelPCMCompressorOnCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPCMCompressorOn(int32_t index);
+void HALSIM_SetPCMCompressorOn(int32_t index, HAL_Bool compressorOn);
+
+int32_t HALSIM_RegisterPCMClosedLoopEnabledCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelPCMClosedLoopEnabledCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPCMClosedLoopEnabled(int32_t index);
+void HALSIM_SetPCMClosedLoopEnabled(int32_t index, HAL_Bool closedLoopEnabled);
+
+int32_t HALSIM_RegisterPCMPressureSwitchCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelPCMPressureSwitchCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPCMPressureSwitch(int32_t index);
+void HALSIM_SetPCMPressureSwitch(int32_t index, HAL_Bool pressureSwitch);
+
+int32_t HALSIM_RegisterPCMCompressorCurrentCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelPCMCompressorCurrentCallback(int32_t index, int32_t uid);
+double HALSIM_GetPCMCompressorCurrent(int32_t index);
+void HALSIM_SetPCMCompressorCurrent(int32_t index, double compressorCurrent);
+
+void HALSIM_RegisterPCMAllNonSolenoidCallbacks(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify);
+
+void HALSIM_RegisterPCMAllSolenoidCallbacks(int32_t index, int32_t channel,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PDPData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PDPData.h
new file mode 100644
index 0000000..cac22c9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PDPData.h
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetPDPData(int32_t index);
+int32_t HALSIM_RegisterPDPInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelPDPInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPDPInitialized(int32_t index);
+void HALSIM_SetPDPInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterPDPTemperatureCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelPDPTemperatureCallback(int32_t index, int32_t uid);
+double HALSIM_GetPDPTemperature(int32_t index);
+void HALSIM_SetPDPTemperature(int32_t index, double temperature);
+
+int32_t HALSIM_RegisterPDPVoltageCallback(int32_t index,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify);
+void HALSIM_CancelPDPVoltageCallback(int32_t index, int32_t uid);
+double HALSIM_GetPDPVoltage(int32_t index);
+void HALSIM_SetPDPVoltage(int32_t index, double voltage);
+
+int32_t HALSIM_RegisterPDPCurrentCallback(int32_t index, int32_t channel,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify);
+void HALSIM_CancelPDPCurrentCallback(int32_t index, int32_t channel,
+                                     int32_t uid);
+double HALSIM_GetPDPCurrent(int32_t index, int32_t channel);
+void HALSIM_SetPDPCurrent(int32_t index, int32_t channel, double current);
+
+void HALSIM_RegisterPDPAllNonCurrentCallbacks(int32_t index, int32_t channel,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PWMData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PWMData.h
new file mode 100644
index 0000000..bf1b735
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/PWMData.h
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetPWMData(int32_t index);
+int32_t HALSIM_RegisterPWMInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelPWMInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPWMInitialized(int32_t index);
+void HALSIM_SetPWMInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterPWMRawValueCallback(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+void HALSIM_CancelPWMRawValueCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetPWMRawValue(int32_t index);
+void HALSIM_SetPWMRawValue(int32_t index, int32_t rawValue);
+
+int32_t HALSIM_RegisterPWMSpeedCallback(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+void HALSIM_CancelPWMSpeedCallback(int32_t index, int32_t uid);
+double HALSIM_GetPWMSpeed(int32_t index);
+void HALSIM_SetPWMSpeed(int32_t index, double speed);
+
+int32_t HALSIM_RegisterPWMPositionCallback(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+void HALSIM_CancelPWMPositionCallback(int32_t index, int32_t uid);
+double HALSIM_GetPWMPosition(int32_t index);
+void HALSIM_SetPWMPosition(int32_t index, double position);
+
+int32_t HALSIM_RegisterPWMPeriodScaleCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelPWMPeriodScaleCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetPWMPeriodScale(int32_t index);
+void HALSIM_SetPWMPeriodScale(int32_t index, int32_t periodScale);
+
+int32_t HALSIM_RegisterPWMZeroLatchCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+void HALSIM_CancelPWMZeroLatchCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetPWMZeroLatch(int32_t index);
+void HALSIM_SetPWMZeroLatch(int32_t index, HAL_Bool zeroLatch);
+
+void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
+                                    void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/RelayData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/RelayData.h
new file mode 100644
index 0000000..56727ea
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/RelayData.h
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetRelayData(int32_t index);
+int32_t HALSIM_RegisterRelayInitializedForwardCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelRelayInitializedForwardCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRelayInitializedForward(int32_t index);
+void HALSIM_SetRelayInitializedForward(int32_t index,
+                                       HAL_Bool initializedForward);
+
+int32_t HALSIM_RegisterRelayInitializedReverseCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelRelayInitializedReverseCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRelayInitializedReverse(int32_t index);
+void HALSIM_SetRelayInitializedReverse(int32_t index,
+                                       HAL_Bool initializedReverse);
+
+int32_t HALSIM_RegisterRelayForwardCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+void HALSIM_CancelRelayForwardCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRelayForward(int32_t index);
+void HALSIM_SetRelayForward(int32_t index, HAL_Bool forward);
+
+int32_t HALSIM_RegisterRelayReverseCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+void HALSIM_CancelRelayReverseCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRelayReverse(int32_t index);
+void HALSIM_SetRelayReverse(int32_t index, HAL_Bool reverse);
+
+void HALSIM_RegisterRelayAllCallbacks(int32_t index,
+                                      HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/RoboRioData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/RoboRioData.h
new file mode 100644
index 0000000..7cb3ca4
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/RoboRioData.h
@@ -0,0 +1,146 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetRoboRioData(int32_t index);
+int32_t HALSIM_RegisterRoboRioFPGAButtonCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioFPGAButtonCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRoboRioFPGAButton(int32_t index);
+void HALSIM_SetRoboRioFPGAButton(int32_t index, HAL_Bool fPGAButton);
+
+int32_t HALSIM_RegisterRoboRioVInVoltageCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioVInVoltageCallback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioVInVoltage(int32_t index);
+void HALSIM_SetRoboRioVInVoltage(int32_t index, double vInVoltage);
+
+int32_t HALSIM_RegisterRoboRioVInCurrentCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioVInCurrentCallback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioVInCurrent(int32_t index);
+void HALSIM_SetRoboRioVInCurrent(int32_t index, double vInCurrent);
+
+int32_t HALSIM_RegisterRoboRioUserVoltage6VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserVoltage6VCallback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioUserVoltage6V(int32_t index);
+void HALSIM_SetRoboRioUserVoltage6V(int32_t index, double userVoltage6V);
+
+int32_t HALSIM_RegisterRoboRioUserCurrent6VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserCurrent6VCallback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioUserCurrent6V(int32_t index);
+void HALSIM_SetRoboRioUserCurrent6V(int32_t index, double userCurrent6V);
+
+int32_t HALSIM_RegisterRoboRioUserActive6VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserActive6VCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRoboRioUserActive6V(int32_t index);
+void HALSIM_SetRoboRioUserActive6V(int32_t index, HAL_Bool userActive6V);
+
+int32_t HALSIM_RegisterRoboRioUserVoltage5VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserVoltage5VCallback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioUserVoltage5V(int32_t index);
+void HALSIM_SetRoboRioUserVoltage5V(int32_t index, double userVoltage5V);
+
+int32_t HALSIM_RegisterRoboRioUserCurrent5VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserCurrent5VCallback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioUserCurrent5V(int32_t index);
+void HALSIM_SetRoboRioUserCurrent5V(int32_t index, double userCurrent5V);
+
+int32_t HALSIM_RegisterRoboRioUserActive5VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserActive5VCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRoboRioUserActive5V(int32_t index);
+void HALSIM_SetRoboRioUserActive5V(int32_t index, HAL_Bool userActive5V);
+
+int32_t HALSIM_RegisterRoboRioUserVoltage3V3Callback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserVoltage3V3Callback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioUserVoltage3V3(int32_t index);
+void HALSIM_SetRoboRioUserVoltage3V3(int32_t index, double userVoltage3V3);
+
+int32_t HALSIM_RegisterRoboRioUserCurrent3V3Callback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserCurrent3V3Callback(int32_t index, int32_t uid);
+double HALSIM_GetRoboRioUserCurrent3V3(int32_t index);
+void HALSIM_SetRoboRioUserCurrent3V3(int32_t index, double userCurrent3V3);
+
+int32_t HALSIM_RegisterRoboRioUserActive3V3Callback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserActive3V3Callback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetRoboRioUserActive3V3(int32_t index);
+void HALSIM_SetRoboRioUserActive3V3(int32_t index, HAL_Bool userActive3V3);
+
+int32_t HALSIM_RegisterRoboRioUserFaults6VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserFaults6VCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetRoboRioUserFaults6V(int32_t index);
+void HALSIM_SetRoboRioUserFaults6V(int32_t index, int32_t userFaults6V);
+
+int32_t HALSIM_RegisterRoboRioUserFaults5VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserFaults5VCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetRoboRioUserFaults5V(int32_t index);
+void HALSIM_SetRoboRioUserFaults5V(int32_t index, int32_t userFaults5V);
+
+int32_t HALSIM_RegisterRoboRioUserFaults3V3Callback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify);
+void HALSIM_CancelRoboRioUserFaults3V3Callback(int32_t index, int32_t uid);
+int32_t HALSIM_GetRoboRioUserFaults3V3(int32_t index);
+void HALSIM_SetRoboRioUserFaults3V3(int32_t index, int32_t userFaults3V3);
+
+void HALSIM_RegisterRoboRioAllCallbacks(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/SPIAccelerometerData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/SPIAccelerometerData.h
new file mode 100644
index 0000000..adfbaa7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/SPIAccelerometerData.h
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetSPIAccelerometerData(int32_t index);
+int32_t HALSIM_RegisterSPIAccelerometerActiveCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelSPIAccelerometerActiveCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetSPIAccelerometerActive(int32_t index);
+void HALSIM_SetSPIAccelerometerActive(int32_t index, HAL_Bool active);
+
+int32_t HALSIM_RegisterSPIAccelerometerRangeCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify);
+void HALSIM_CancelSPIAccelerometerRangeCallback(int32_t index, int32_t uid);
+int32_t HALSIM_GetSPIAccelerometerRange(int32_t index);
+void HALSIM_SetSPIAccelerometerRange(int32_t index, int32_t range);
+
+int32_t HALSIM_RegisterSPIAccelerometerXCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelSPIAccelerometerXCallback(int32_t index, int32_t uid);
+double HALSIM_GetSPIAccelerometerX(int32_t index);
+void HALSIM_SetSPIAccelerometerX(int32_t index, double x);
+
+int32_t HALSIM_RegisterSPIAccelerometerYCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelSPIAccelerometerYCallback(int32_t index, int32_t uid);
+double HALSIM_GetSPIAccelerometerY(int32_t index);
+void HALSIM_SetSPIAccelerometerY(int32_t index, double y);
+
+int32_t HALSIM_RegisterSPIAccelerometerZCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+void HALSIM_CancelSPIAccelerometerZCallback(int32_t index, int32_t uid);
+double HALSIM_GetSPIAccelerometerZ(int32_t index);
+void HALSIM_SetSPIAccelerometerZ(int32_t index, double z);
+
+void HALSIM_RegisterSPIAccelerometerAllCallbcaks(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/include/MockData/SPIData.h b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/SPIData.h
new file mode 100644
index 0000000..6639fa5
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/include/MockData/SPIData.h
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifndef __FRC_ROBORIO__
+
+#include "HAL/HAL.h"
+#include "NotifyListener.h"
+
+typedef void (*HAL_SpiReadAutoReceiveBufferCallback)(const char* name,
+                                                     void* param,
+                                                     unsigned char* buffer,
+                                                     int32_t numToRead,
+                                                     int32_t* outputCount);
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void HALSIM_ResetSPIData(int32_t index);
+
+int32_t HALSIM_RegisterSPIInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+void HALSIM_CancelSPIInitializedCallback(int32_t index, int32_t uid);
+HAL_Bool HALSIM_GetSPIInitialized(int32_t index);
+void HALSIM_SetSPIInitialized(int32_t index, HAL_Bool initialized);
+
+int32_t HALSIM_RegisterSPIReadCallback(int32_t index,
+                                       HAL_BufferCallback callback,
+                                       void* param);
+void HALSIM_CancelSPIReadCallback(int32_t index, int32_t uid);
+
+int32_t HALSIM_RegisterSPIWriteCallback(int32_t index,
+                                        HAL_ConstBufferCallback callback,
+                                        void* param);
+void HALSIM_CancelSPIWriteCallback(int32_t index, int32_t uid);
+
+int32_t HALSIM_RegisterSPIReadAutoReceivedDataCallback(
+    int32_t index, HAL_SpiReadAutoReceiveBufferCallback callback, void* param);
+void HALSIM_CancelSPIReadAutoReceivedDataCallback(int32_t index, int32_t uid);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/hal/src/main/native/shared/cpp/fpga_clock.cpp b/third_party/allwpilib_2018/hal/src/main/native/shared/cpp/fpga_clock.cpp
new file mode 100644
index 0000000..bf1ffe1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/shared/cpp/fpga_clock.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/cpp/fpga_clock.h"
+
+#include <llvm/raw_ostream.h>
+
+#include "HAL/HAL.h"
+
+namespace hal {
+const fpga_clock::time_point fpga_clock::min_time =
+    fpga_clock::time_point(fpga_clock::duration(
+        std::numeric_limits<fpga_clock::duration::rep>::min()));
+
+fpga_clock::time_point fpga_clock::now() noexcept {
+  int32_t status = 0;
+  uint64_t currentTime = HAL_GetFPGATime(&status);
+  if (status != 0) {
+    llvm::errs()
+        << "Call to HAL_GetFPGATime failed."
+        << "Initialization might have failed. Time will not be correct\n";
+    llvm::errs().flush();
+    return epoch();
+  }
+  return time_point(std::chrono::microseconds(currentTime));
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/shared/handles/HandlesInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/shared/handles/HandlesInternal.cpp
new file mode 100644
index 0000000..89628a8
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/shared/handles/HandlesInternal.cpp
@@ -0,0 +1,96 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/handles/HandlesInternal.h"
+
+#include <algorithm>
+
+#include <llvm/SmallVector.h>
+#include <support/mutex.h>
+
+namespace hal {
+static llvm::SmallVector<HandleBase*, 32>* globalHandles;
+static wpi::mutex globalHandleMutex;
+namespace init {
+void InitializeHandlesInternal() {
+  static llvm::SmallVector<HandleBase*, 32> gH;
+  globalHandles = &gH;
+}
+}  // namespace init
+HandleBase::HandleBase() {
+  std::lock_guard<wpi::mutex> lock(globalHandleMutex);
+  auto index = std::find(globalHandles->begin(), globalHandles->end(), this);
+  if (index == globalHandles->end()) {
+    globalHandles->push_back(this);
+  } else {
+    *index = this;
+  }
+}
+HandleBase::~HandleBase() {
+  std::lock_guard<wpi::mutex> lock(globalHandleMutex);
+  auto index = std::find(globalHandles->begin(), globalHandles->end(), this);
+  if (index != globalHandles->end()) {
+    *index = nullptr;
+  }
+}
+void HandleBase::ResetHandles() {
+  m_version++;
+  if (m_version > 255) {
+    m_version = 0;
+  }
+}
+void HandleBase::ResetGlobalHandles() {
+  std::unique_lock<wpi::mutex> lock(globalHandleMutex);
+  for (auto&& i : *globalHandles) {
+    if (i != nullptr) {
+      lock.unlock();
+      i->ResetHandles();
+      lock.lock();
+    }
+  }
+}
+HAL_PortHandle createPortHandle(uint8_t channel, uint8_t module) {
+  // set last 8 bits, then shift to first 8 bits
+  HAL_PortHandle handle = static_cast<HAL_PortHandle>(HAL_HandleEnum::Port);
+  handle = handle << 24;
+  // shift module and add to 3rd set of 8 bits
+  int32_t temp = module;
+  temp = (temp << 8) & 0xff00;
+  handle += temp;
+  // add channel to last 8 bits
+  handle += channel;
+  return handle;
+}
+HAL_PortHandle createPortHandleForSPI(uint8_t channel) {
+  // set last 8 bits, then shift to first 8 bits
+  HAL_PortHandle handle = static_cast<HAL_PortHandle>(HAL_HandleEnum::Port);
+  handle = handle << 16;
+  // set second set up bits to 1
+  int32_t temp = 1;
+  temp = (temp << 8) & 0xff00;
+  handle += temp;
+  // shift to last set of bits
+  handle = handle << 8;
+  // add channel to last 8 bits
+  handle += channel;
+  return handle;
+}
+HAL_Handle createHandle(int16_t index, HAL_HandleEnum handleType,
+                        int16_t version) {
+  if (index < 0) return HAL_kInvalidHandle;
+  uint8_t hType = static_cast<uint8_t>(handleType);
+  if (hType == 0 || hType > 127) return HAL_kInvalidHandle;
+  // set last 8 bits, then shift to first 8 bits
+  HAL_Handle handle = hType;
+  handle = handle << 8;
+  handle += static_cast<uint8_t>(version);
+  handle = handle << 16;
+  // add index to set last 16 bits
+  handle += index;
+  return handle;
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Accelerometer.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Accelerometer.cpp
new file mode 100644
index 0000000..c5501bb
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Accelerometer.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Accelerometer.h"
+
+#include "MockData/AccelerometerDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAccelerometer() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+void HAL_SetAccelerometerActive(HAL_Bool active) {
+  SimAccelerometerData[0].SetActive(active);
+}
+
+void HAL_SetAccelerometerRange(HAL_AccelerometerRange range) {
+  SimAccelerometerData[0].SetRange(range);
+}
+double HAL_GetAccelerometerX(void) { return SimAccelerometerData[0].GetX(); }
+double HAL_GetAccelerometerY(void) { return SimAccelerometerData[0].GetY(); }
+double HAL_GetAccelerometerZ(void) { return SimAccelerometerData[0].GetZ(); }
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogAccumulator.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogAccumulator.cpp
new file mode 100644
index 0000000..5772d33
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogAccumulator.cpp
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogAccumulator.h"
+
+#include "AnalogInternal.h"
+#include "MockData/AnalogInDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogAccumulator() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_Bool HAL_IsAccumulatorChannel(HAL_AnalogInputHandle analogPortHandle,
+                                  int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  for (int32_t i = 0; i < kNumAccumulators; i++) {
+    if (port->channel == kAccumulatorChannels[i]) return true;
+  }
+  return false;
+}
+void HAL_InitAccumulator(HAL_AnalogInputHandle analogPortHandle,
+                         int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  if (!HAL_IsAccumulatorChannel(analogPortHandle, status)) {
+    *status = HAL_INVALID_ACCUMULATOR_CHANNEL;
+    return;
+  }
+
+  SimAnalogInData[port->channel].SetAccumulatorInitialized(true);
+}
+void HAL_ResetAccumulator(HAL_AnalogInputHandle analogPortHandle,
+                          int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogInData[port->channel].SetAccumulatorCenter(0);
+  SimAnalogInData[port->channel].SetAccumulatorCount(0);
+  SimAnalogInData[port->channel].SetAccumulatorValue(0);
+}
+void HAL_SetAccumulatorCenter(HAL_AnalogInputHandle analogPortHandle,
+                              int32_t center, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogInData[port->channel].SetAccumulatorCenter(center);
+}
+void HAL_SetAccumulatorDeadband(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t deadband, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogInData[port->channel].SetAccumulatorDeadband(deadband);
+}
+int64_t HAL_GetAccumulatorValue(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimAnalogInData[port->channel].GetAccumulatorValue();
+}
+int64_t HAL_GetAccumulatorCount(HAL_AnalogInputHandle analogPortHandle,
+                                int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimAnalogInData[port->channel].GetAccumulatorCount();
+}
+void HAL_GetAccumulatorOutput(HAL_AnalogInputHandle analogPortHandle,
+                              int64_t* value, int64_t* count, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  *count = SimAnalogInData[port->channel].GetAccumulatorCount();
+  *value = SimAnalogInData[port->channel].GetAccumulatorValue();
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogGyro.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogGyro.cpp
new file mode 100644
index 0000000..d359675
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogGyro.cpp
@@ -0,0 +1,145 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogGyro.h"
+
+#include <chrono>
+#include <thread>
+
+#include "AnalogInternal.h"
+#include "HAL/AnalogAccumulator.h"
+#include "HAL/AnalogInput.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "MockData/AnalogGyroDataInternal.h"
+
+namespace {
+struct AnalogGyro {
+  HAL_AnalogInputHandle handle;
+  uint8_t index;
+};
+}  // namespace
+
+using namespace hal;
+
+static IndexedHandleResource<HAL_GyroHandle, AnalogGyro, kNumAccumulators,
+                             HAL_HandleEnum::AnalogGyro>* analogGyroHandles;
+
+namespace hal {
+namespace init {
+void InitializeAnalogGyro() {
+  static IndexedHandleResource<HAL_GyroHandle, AnalogGyro, kNumAccumulators,
+                               HAL_HandleEnum::AnalogGyro>
+      agH;
+  analogGyroHandles = &agH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_GyroHandle HAL_InitializeAnalogGyro(HAL_AnalogInputHandle analogHandle,
+                                        int32_t* status) {
+  if (!HAL_IsAccumulatorChannel(analogHandle, status)) {
+    if (*status == 0) {
+      *status = HAL_INVALID_ACCUMULATOR_CHANNEL;
+    }
+    return HAL_kInvalidHandle;
+  }
+
+  // handle known to be correct, so no need to type check
+  int16_t channel = getHandleIndex(analogHandle);
+
+  auto handle = analogGyroHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  // Initialize port structure
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {  // would only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  gyro->handle = analogHandle;
+  gyro->index = channel;
+
+  SimAnalogGyroData[channel].SetInitialized(true);
+
+  return handle;
+}
+
+void HAL_SetupAnalogGyro(HAL_GyroHandle handle, int32_t* status) {
+  // No op
+}
+
+void HAL_FreeAnalogGyro(HAL_GyroHandle handle) {
+  auto gyro = analogGyroHandles->Get(handle);
+  analogGyroHandles->Free(handle);
+  if (gyro == nullptr) return;
+  SimAnalogGyroData[gyro->index].SetInitialized(false);
+}
+
+void HAL_SetAnalogGyroParameters(HAL_GyroHandle handle,
+                                 double voltsPerDegreePerSecond, double offset,
+                                 int32_t center, int32_t* status) {
+  // No op
+}
+
+void HAL_SetAnalogGyroVoltsPerDegreePerSecond(HAL_GyroHandle handle,
+                                              double voltsPerDegreePerSecond,
+                                              int32_t* status) {
+  // No op
+}
+
+void HAL_ResetAnalogGyro(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogGyroData[gyro->index].SetAngle(0.0);
+}
+
+void HAL_CalibrateAnalogGyro(HAL_GyroHandle handle, int32_t* status) {
+  // Just do a reset
+  HAL_ResetAnalogGyro(handle, status);
+}
+
+void HAL_SetAnalogGyroDeadband(HAL_GyroHandle handle, double volts,
+                               int32_t* status) {
+  // No op
+}
+
+double HAL_GetAnalogGyroAngle(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimAnalogGyroData[gyro->index].GetAngle();
+}
+
+double HAL_GetAnalogGyroRate(HAL_GyroHandle handle, int32_t* status) {
+  auto gyro = analogGyroHandles->Get(handle);
+  if (gyro == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimAnalogGyroData[gyro->index].GetRate();
+}
+
+double HAL_GetAnalogGyroOffset(HAL_GyroHandle handle, int32_t* status) {
+  return 0.0;
+}
+
+int32_t HAL_GetAnalogGyroCenter(HAL_GyroHandle handle, int32_t* status) {
+  return 0;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInput.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInput.cpp
new file mode 100644
index 0000000..391df71
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInput.cpp
@@ -0,0 +1,177 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogInput.h"
+
+#include "AnalogInternal.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/AnalogInDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogInput() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_AnalogInputHandle HAL_InitializeAnalogInputPort(HAL_PortHandle portHandle,
+                                                    int32_t* status) {
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  HAL_AnalogInputHandle handle = analogInputHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  // Initialize port structure
+  auto analog_port = analogInputHandles->Get(handle);
+  if (analog_port == nullptr) {  // would only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  analog_port->channel = static_cast<uint8_t>(channel);
+  if (HAL_IsAccumulatorChannel(handle, status)) {
+    analog_port->isAccumulator = true;
+  } else {
+    analog_port->isAccumulator = false;
+  }
+
+  SimAnalogInData[channel].SetInitialized(true);
+  SimAnalogInData[channel].SetAccumulatorInitialized(false);
+
+  return handle;
+}
+void HAL_FreeAnalogInputPort(HAL_AnalogInputHandle analogPortHandle) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  // no status, so no need to check for a proper free.
+  analogInputHandles->Free(analogPortHandle);
+  if (port == nullptr) return;
+  SimAnalogInData[port->channel].SetInitialized(false);
+  SimAnalogInData[port->channel].SetAccumulatorInitialized(false);
+}
+
+HAL_Bool HAL_CheckAnalogModule(int32_t module) { return module == 1; }
+
+HAL_Bool HAL_CheckAnalogInputChannel(int32_t channel) {
+  return channel < kNumAnalogInputs && channel >= 0;
+}
+
+void HAL_SetAnalogSampleRate(double samplesPerSecond, int32_t* status) {
+  // No op
+}
+double HAL_GetAnalogSampleRate(int32_t* status) { return kDefaultSampleRate; }
+void HAL_SetAnalogAverageBits(HAL_AnalogInputHandle analogPortHandle,
+                              int32_t bits, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogInData[port->channel].SetAverageBits(bits);
+}
+int32_t HAL_GetAnalogAverageBits(HAL_AnalogInputHandle analogPortHandle,
+                                 int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimAnalogInData[port->channel].GetAverageBits();
+}
+void HAL_SetAnalogOversampleBits(HAL_AnalogInputHandle analogPortHandle,
+                                 int32_t bits, int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogInData[port->channel].SetOversampleBits(bits);
+}
+int32_t HAL_GetAnalogOversampleBits(HAL_AnalogInputHandle analogPortHandle,
+                                    int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimAnalogInData[port->channel].GetOversampleBits();
+}
+int32_t HAL_GetAnalogValue(HAL_AnalogInputHandle analogPortHandle,
+                           int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  double voltage = SimAnalogInData[port->channel].GetVoltage();
+  return HAL_GetAnalogVoltsToValue(analogPortHandle, voltage, status);
+}
+int32_t HAL_GetAnalogAverageValue(HAL_AnalogInputHandle analogPortHandle,
+                                  int32_t* status) {
+  // No averaging supported
+  return HAL_GetAnalogValue(analogPortHandle, status);
+}
+int32_t HAL_GetAnalogVoltsToValue(HAL_AnalogInputHandle analogPortHandle,
+                                  double voltage, int32_t* status) {
+  if (voltage > 5.0) {
+    voltage = 5.0;
+    *status = VOLTAGE_OUT_OF_RANGE;
+  }
+  if (voltage < 0.0) {
+    voltage = 0.0;
+    *status = VOLTAGE_OUT_OF_RANGE;
+  }
+  int32_t LSBWeight = HAL_GetAnalogLSBWeight(analogPortHandle, status);
+  int32_t offset = HAL_GetAnalogOffset(analogPortHandle, status);
+  int32_t value =
+      static_cast<int32_t>((voltage + offset * 1.0e-9) / (LSBWeight * 1.0e-9));
+  return value;
+}
+double HAL_GetAnalogVoltage(HAL_AnalogInputHandle analogPortHandle,
+                            int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  return SimAnalogInData[port->channel].GetVoltage();
+}
+double HAL_GetAnalogAverageVoltage(HAL_AnalogInputHandle analogPortHandle,
+                                   int32_t* status) {
+  auto port = analogInputHandles->Get(analogPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  // No averaging supported
+  double voltage = SimAnalogInData[port->channel].GetVoltage();
+  return voltage;
+}
+int32_t HAL_GetAnalogLSBWeight(HAL_AnalogInputHandle analogPortHandle,
+                               int32_t* status) {
+  return 1220703;
+}
+int32_t HAL_GetAnalogOffset(HAL_AnalogInputHandle analogPortHandle,
+                            int32_t* status) {
+  return 0;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInternal.cpp
new file mode 100644
index 0000000..9bce87b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInternal.cpp
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogInternal.h"
+
+#include "HAL/AnalogInput.h"
+#include "PortsInternal.h"
+
+namespace hal {
+IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort, kNumAnalogInputs,
+                      HAL_HandleEnum::AnalogInput>* analogInputHandles;
+}  // namespace hal
+
+namespace hal {
+namespace init {
+void InitializeAnalogInternal() {
+  static IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort,
+                               kNumAnalogInputs, HAL_HandleEnum::AnalogInput>
+      aiH;
+  analogInputHandles = &aiH;
+}
+}  // namespace init
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInternal.h
new file mode 100644
index 0000000..0287b58
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogInternal.h
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "HAL/Ports.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "PortsInternal.h"
+
+namespace hal {
+constexpr int32_t kTimebase = 40000000;  ///< 40 MHz clock
+constexpr int32_t kDefaultOversampleBits = 0;
+constexpr int32_t kDefaultAverageBits = 7;
+constexpr double kDefaultSampleRate = 50000.0;
+static constexpr uint32_t kAccumulatorChannels[] = {0, 1};
+
+struct AnalogPort {
+  uint8_t channel;
+  bool isAccumulator;
+};
+
+extern IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort,
+                             kNumAnalogInputs, HAL_HandleEnum::AnalogInput>*
+    analogInputHandles;
+
+int32_t GetAnalogTriggerInputIndex(HAL_AnalogTriggerHandle handle,
+                                   int32_t* status);
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogOutput.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogOutput.cpp
new file mode 100644
index 0000000..31ef32b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogOutput.cpp
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogOutput.h"
+
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "MockData/AnalogOutDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+struct AnalogOutput {
+  uint8_t channel;
+};
+}  // namespace
+
+static IndexedHandleResource<HAL_AnalogOutputHandle, AnalogOutput,
+                             kNumAnalogOutputs, HAL_HandleEnum::AnalogOutput>*
+    analogOutputHandles;
+
+namespace hal {
+namespace init {
+void InitializeAnalogOutput() {
+  static IndexedHandleResource<HAL_AnalogOutputHandle, AnalogOutput,
+                               kNumAnalogOutputs, HAL_HandleEnum::AnalogOutput>
+      aoH;
+  analogOutputHandles = &aoH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_AnalogOutputHandle HAL_InitializeAnalogOutputPort(HAL_PortHandle portHandle,
+                                                      int32_t* status) {
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  HAL_AnalogOutputHandle handle =
+      analogOutputHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = analogOutputHandles->Get(handle);
+  if (port == nullptr) {  // would only error on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  port->channel = static_cast<uint8_t>(channel);
+
+  // Initialize sim analog input
+  SimAnalogOutData[channel].SetInitialized(true);
+  return handle;
+}
+
+void HAL_FreeAnalogOutputPort(HAL_AnalogOutputHandle analogOutputHandle) {
+  // no status, so no need to check for a proper free.
+  auto port = analogOutputHandles->Get(analogOutputHandle);
+  if (port == nullptr) return;
+  analogOutputHandles->Free(analogOutputHandle);
+  SimAnalogOutData[port->channel].SetInitialized(false);
+}
+
+HAL_Bool HAL_CheckAnalogOutputChannel(int32_t channel) {
+  return channel < kNumAnalogOutputs && channel >= 0;
+}
+
+void HAL_SetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
+                         double voltage, int32_t* status) {
+  auto port = analogOutputHandles->Get(analogOutputHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimAnalogOutData[port->channel].SetVoltage(voltage);
+}
+
+double HAL_GetAnalogOutput(HAL_AnalogOutputHandle analogOutputHandle,
+                           int32_t* status) {
+  auto port = analogOutputHandles->Get(analogOutputHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  return SimAnalogOutData[port->channel].GetVoltage();
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogTrigger.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogTrigger.cpp
new file mode 100644
index 0000000..2b990e2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/AnalogTrigger.cpp
@@ -0,0 +1,259 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogTrigger.h"
+
+#include "AnalogInternal.h"
+#include "HAL/AnalogInput.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "MockData/AnalogInDataInternal.h"
+#include "MockData/AnalogTriggerDataInternal.h"
+#include "PortsInternal.h"
+
+namespace {
+struct AnalogTrigger {
+  HAL_AnalogInputHandle analogHandle;
+  uint8_t index;
+  HAL_Bool trigState;
+};
+}  // namespace
+
+using namespace hal;
+
+static LimitedHandleResource<HAL_AnalogTriggerHandle, AnalogTrigger,
+                             kNumAnalogTriggers, HAL_HandleEnum::AnalogTrigger>*
+    analogTriggerHandles;
+
+namespace hal {
+namespace init {
+void InitializeAnalogTrigger() {
+  static LimitedHandleResource<HAL_AnalogTriggerHandle, AnalogTrigger,
+                               kNumAnalogTriggers,
+                               HAL_HandleEnum::AnalogTrigger>
+      atH;
+  analogTriggerHandles = &atH;
+}
+}  // namespace init
+}  // namespace hal
+
+int32_t hal::GetAnalogTriggerInputIndex(HAL_AnalogTriggerHandle handle,
+                                        int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(handle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return -1;
+  }
+
+  auto analog_port = analogInputHandles->Get(trigger->analogHandle);
+  if (analog_port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return -1;
+  }
+
+  return analog_port->channel;
+}
+
+extern "C" {
+
+HAL_AnalogTriggerHandle HAL_InitializeAnalogTrigger(
+    HAL_AnalogInputHandle portHandle, int32_t* index, int32_t* status) {
+  // ensure we are given a valid and active AnalogInput handle
+  auto analog_port = analogInputHandles->Get(portHandle);
+  if (analog_port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  HAL_AnalogTriggerHandle handle = analogTriggerHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto trigger = analogTriggerHandles->Get(handle);
+  if (trigger == nullptr) {  // would only occur on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  trigger->analogHandle = portHandle;
+  trigger->index = static_cast<uint8_t>(getHandleIndex(handle));
+  *index = trigger->index;
+
+  SimAnalogTriggerData[trigger->index].SetInitialized(true);
+
+  trigger->trigState = false;
+
+  return handle;
+}
+
+void HAL_CleanAnalogTrigger(HAL_AnalogTriggerHandle analogTriggerHandle,
+                            int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  analogTriggerHandles->Free(analogTriggerHandle);
+  if (trigger == nullptr) return;
+  SimAnalogTriggerData[trigger->index].SetInitialized(false);
+  // caller owns the analog input handle.
+}
+
+static double GetAnalogValueToVoltage(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t value,
+    int32_t* status) {
+  int32_t LSBWeight = HAL_GetAnalogLSBWeight(analogTriggerHandle, status);
+  int32_t offset = HAL_GetAnalogOffset(analogTriggerHandle, status);
+
+  double voltage = LSBWeight * 1.0e-9 * value - offset * 1.0e-9;
+  return voltage;
+}
+
+void HAL_SetAnalogTriggerLimitsRaw(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                   int32_t lower, int32_t upper,
+                                   int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (lower > upper) {
+    *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR;
+  }
+
+  double trigLower =
+      GetAnalogValueToVoltage(trigger->analogHandle, lower, status);
+  if (status != 0) return;
+  double trigUpper =
+      GetAnalogValueToVoltage(trigger->analogHandle, upper, status);
+  if (status != 0) return;
+
+  SimAnalogTriggerData[trigger->index].SetTriggerUpperBound(trigUpper);
+  SimAnalogTriggerData[trigger->index].SetTriggerLowerBound(trigLower);
+}
+void HAL_SetAnalogTriggerLimitsVoltage(
+    HAL_AnalogTriggerHandle analogTriggerHandle, double lower, double upper,
+    int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (lower > upper) {
+    *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR;
+  }
+
+  SimAnalogTriggerData[trigger->index].SetTriggerUpperBound(upper);
+  SimAnalogTriggerData[trigger->index].SetTriggerLowerBound(lower);
+}
+void HAL_SetAnalogTriggerAveraged(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                  HAL_Bool useAveragedValue, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  AnalogTriggerData* triggerData = &SimAnalogTriggerData[trigger->index];
+
+  if (triggerData->GetTriggerMode() == HALSIM_AnalogTriggerFiltered) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  auto setVal = useAveragedValue ? HALSIM_AnalogTriggerAveraged
+                                 : HALSIM_AnalogTriggerUnassigned;
+  triggerData->SetTriggerMode(setVal);
+}
+void HAL_SetAnalogTriggerFiltered(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                  HAL_Bool useFilteredValue, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  AnalogTriggerData* triggerData = &SimAnalogTriggerData[trigger->index];
+
+  if (triggerData->GetTriggerMode() == HALSIM_AnalogTriggerAveraged) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  auto setVal = useFilteredValue ? HALSIM_AnalogTriggerAveraged
+                                 : HALSIM_AnalogTriggerUnassigned;
+  triggerData->SetTriggerMode(setVal);
+}
+
+static double GetTriggerValue(AnalogTrigger* trigger, int32_t* status) {
+  auto analogIn = analogInputHandles->Get(trigger->analogHandle);
+  if (analogIn == nullptr) {
+    // Returning HAL Handle Error, but going to ignore lower down
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  return SimAnalogInData[analogIn->channel].GetVoltage();
+}
+
+HAL_Bool HAL_GetAnalogTriggerInWindow(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  double voltage = GetTriggerValue(trigger.get(), status);
+  if (*status == HAL_HANDLE_ERROR) {
+    // Don't error if analog has been destroyed
+    *status = 0;
+    return false;
+  }
+
+  auto trigUpper = SimAnalogTriggerData[trigger->index].GetTriggerUpperBound();
+  auto trigLower = SimAnalogTriggerData[trigger->index].GetTriggerLowerBound();
+
+  return voltage >= trigLower && voltage <= trigUpper;
+}
+HAL_Bool HAL_GetAnalogTriggerTriggerState(
+    HAL_AnalogTriggerHandle analogTriggerHandle, int32_t* status) {
+  auto trigger = analogTriggerHandles->Get(analogTriggerHandle);
+  if (trigger == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  double voltage = GetTriggerValue(trigger.get(), status);
+  if (*status == HAL_HANDLE_ERROR) {
+    // Don't error if analog has been destroyed
+    *status = 0;
+    return false;
+  }
+
+  auto trigUpper = SimAnalogTriggerData[trigger->index].GetTriggerUpperBound();
+  auto trigLower = SimAnalogTriggerData[trigger->index].GetTriggerLowerBound();
+
+  if (voltage < trigLower) {
+    trigger->trigState = false;
+    return false;
+  }
+  if (voltage > trigUpper) {
+    trigger->trigState = true;
+    return true;
+  }
+  return trigger->trigState;
+}
+HAL_Bool HAL_GetAnalogTriggerOutput(HAL_AnalogTriggerHandle analogTriggerHandle,
+                                    HAL_AnalogTriggerType type,
+                                    int32_t* status) {
+  if (type == HAL_Trigger_kInWindow) {
+    return HAL_GetAnalogTriggerInWindow(analogTriggerHandle, status);
+  } else if (type == HAL_Trigger_kState) {
+    return HAL_GetAnalogTriggerTriggerState(analogTriggerHandle, status);
+  } else {
+    *status = ANALOG_TRIGGER_PULSE_OUTPUT_ERROR;
+    return false;
+  }
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/CAN.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/CAN.cpp
new file mode 100644
index 0000000..72173c3
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/CAN.cpp
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/CAN.h"
+
+#include "MockData/CanDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeCAN() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+void HAL_CAN_SendMessage(uint32_t messageID, const uint8_t* data,
+                         uint8_t dataSize, int32_t periodMs, int32_t* status) {
+  SimCanData->SendMessage(messageID, data, dataSize, periodMs, status);
+}
+void HAL_CAN_ReceiveMessage(uint32_t* messageID, uint32_t messageIDMask,
+                            uint8_t* data, uint8_t* dataSize,
+                            uint32_t* timeStamp, int32_t* status) {
+  SimCanData->ReceiveMessage(messageID, messageIDMask, data, dataSize,
+                             timeStamp, status);
+}
+void HAL_CAN_OpenStreamSession(uint32_t* sessionHandle, uint32_t messageID,
+                               uint32_t messageIDMask, uint32_t maxMessages,
+                               int32_t* status) {
+  SimCanData->OpenStreamSession(sessionHandle, messageID, messageIDMask,
+                                maxMessages, status);
+}
+void HAL_CAN_CloseStreamSession(uint32_t sessionHandle) {
+  SimCanData->CloseStreamSession(sessionHandle);
+}
+void HAL_CAN_ReadStreamSession(uint32_t sessionHandle,
+                               struct HAL_CANStreamMessage* messages,
+                               uint32_t messagesToRead, uint32_t* messagesRead,
+                               int32_t* status) {
+  SimCanData->ReadStreamSession(sessionHandle, messages, messagesToRead,
+                                messagesRead, status);
+}
+void HAL_CAN_GetCANStatus(float* percentBusUtilization, uint32_t* busOffCount,
+                          uint32_t* txFullCount, uint32_t* receiveErrorCount,
+                          uint32_t* transmitErrorCount, int32_t* status) {
+  SimCanData->GetCANStatus(percentBusUtilization, busOffCount, txFullCount,
+                           receiveErrorCount, transmitErrorCount, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Compressor.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Compressor.cpp
new file mode 100644
index 0000000..ad9b2a2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Compressor.cpp
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Compressor.h"
+
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/PCMDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeCompressor() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_CompressorHandle HAL_InitializeCompressor(int32_t module, int32_t* status) {
+  // As compressors can have unlimited objects, just create a
+  // handle with the module number as the index.
+
+  SimPCMData[module].SetCompressorInitialized(true);
+  return (HAL_CompressorHandle)createHandle(static_cast<int16_t>(module),
+                                            HAL_HandleEnum::Compressor, 0);
+}
+
+HAL_Bool HAL_CheckCompressorModule(int32_t module) {
+  return module < kNumPCMModules && module >= 0;
+}
+
+HAL_Bool HAL_GetCompressor(HAL_CompressorHandle compressorHandle,
+                           int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  return SimPCMData[index].GetCompressorOn();
+}
+
+void HAL_SetCompressorClosedLoopControl(HAL_CompressorHandle compressorHandle,
+                                        HAL_Bool value, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimPCMData[index].SetClosedLoopEnabled(value);
+}
+
+HAL_Bool HAL_GetCompressorClosedLoopControl(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  return SimPCMData[index].GetClosedLoopEnabled();
+}
+
+HAL_Bool HAL_GetCompressorPressureSwitch(HAL_CompressorHandle compressorHandle,
+                                         int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  return SimPCMData[index].GetPressureSwitch();
+}
+
+double HAL_GetCompressorCurrent(HAL_CompressorHandle compressorHandle,
+                                int32_t* status) {
+  int16_t index =
+      getHandleTypedIndex(compressorHandle, HAL_HandleEnum::Compressor, 0);
+  if (index == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimPCMData[index].GetCompressorCurrent();
+}
+HAL_Bool HAL_GetCompressorCurrentTooHighFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  return false;
+}
+HAL_Bool HAL_GetCompressorCurrentTooHighStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  return false;
+}
+HAL_Bool HAL_GetCompressorShortedStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  return false;
+}
+HAL_Bool HAL_GetCompressorShortedFault(HAL_CompressorHandle compressorHandle,
+                                       int32_t* status) {
+  return false;
+}
+HAL_Bool HAL_GetCompressorNotConnectedStickyFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  return false;
+}
+HAL_Bool HAL_GetCompressorNotConnectedFault(
+    HAL_CompressorHandle compressorHandle, int32_t* status) {
+  return false;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Constants.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Constants.cpp
new file mode 100644
index 0000000..e059f2e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Constants.cpp
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Constants.h"
+
+#include "ConstantsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeConstants() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+int32_t HAL_GetSystemClockTicksPerMicrosecond(void) {
+  return kSystemClockTicksPerMicrosecond;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/ConstantsInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/ConstantsInternal.h
new file mode 100644
index 0000000..c3a6e8f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/ConstantsInternal.h
@@ -0,0 +1,14 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+namespace hal {
+constexpr int32_t kSystemClockTicksPerMicrosecond = 40;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Counter.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Counter.cpp
new file mode 100644
index 0000000..52ec724
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Counter.cpp
@@ -0,0 +1,96 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Counter.h"
+
+#include "CounterInternal.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
+                      HAL_HandleEnum::Counter>* counterHandles;
+}  // namespace hal
+
+namespace hal {
+namespace init {
+void InitializeCounter() {
+  static LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
+                               HAL_HandleEnum::Counter>
+      cH;
+  counterHandles = &cH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index,
+                                        int32_t* status) {
+  return 0;
+}
+void HAL_FreeCounter(HAL_CounterHandle counterHandle, int32_t* status) {}
+void HAL_SetCounterAverageSize(HAL_CounterHandle counterHandle, int32_t size,
+                               int32_t* status) {}
+void HAL_SetCounterUpSource(HAL_CounterHandle counterHandle,
+                            HAL_Handle digitalSourceHandle,
+                            HAL_AnalogTriggerType analogTriggerType,
+                            int32_t* status) {}
+void HAL_SetCounterUpSourceEdge(HAL_CounterHandle counterHandle,
+                                HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                int32_t* status) {}
+void HAL_ClearCounterUpSource(HAL_CounterHandle counterHandle,
+                              int32_t* status) {}
+void HAL_SetCounterDownSource(HAL_CounterHandle counterHandle,
+                              HAL_Handle digitalSourceHandle,
+                              HAL_AnalogTriggerType analogTriggerType,
+                              int32_t* status) {}
+void HAL_SetCounterDownSourceEdge(HAL_CounterHandle counterHandle,
+                                  HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                  int32_t* status) {}
+void HAL_ClearCounterDownSource(HAL_CounterHandle counterHandle,
+                                int32_t* status) {}
+void HAL_SetCounterUpDownMode(HAL_CounterHandle counterHandle,
+                              int32_t* status) {}
+void HAL_SetCounterExternalDirectionMode(HAL_CounterHandle counterHandle,
+                                         int32_t* status) {}
+void HAL_SetCounterSemiPeriodMode(HAL_CounterHandle counterHandle,
+                                  HAL_Bool highSemiPeriod, int32_t* status) {}
+void HAL_SetCounterPulseLengthMode(HAL_CounterHandle counterHandle,
+                                   double threshold, int32_t* status) {}
+int32_t HAL_GetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
+                                       int32_t* status) {
+  return 0;
+}
+void HAL_SetCounterSamplesToAverage(HAL_CounterHandle counterHandle,
+                                    int32_t samplesToAverage, int32_t* status) {
+}
+void HAL_ResetCounter(HAL_CounterHandle counterHandle, int32_t* status) {}
+int32_t HAL_GetCounter(HAL_CounterHandle counterHandle, int32_t* status) {
+  return 0;
+}
+double HAL_GetCounterPeriod(HAL_CounterHandle counterHandle, int32_t* status) {
+  return 0.0;
+}
+void HAL_SetCounterMaxPeriod(HAL_CounterHandle counterHandle, double maxPeriod,
+                             int32_t* status) {}
+void HAL_SetCounterUpdateWhenEmpty(HAL_CounterHandle counterHandle,
+                                   HAL_Bool enabled, int32_t* status) {}
+HAL_Bool HAL_GetCounterStopped(HAL_CounterHandle counterHandle,
+                               int32_t* status) {
+  return false;
+}
+HAL_Bool HAL_GetCounterDirection(HAL_CounterHandle counterHandle,
+                                 int32_t* status) {
+  return false;
+}
+void HAL_SetCounterReverseDirection(HAL_CounterHandle counterHandle,
+                                    HAL_Bool reverseDirection,
+                                    int32_t* status) {}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/CounterInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/CounterInternal.h
new file mode 100644
index 0000000..cd2f9c2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/CounterInternal.h
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+struct Counter {
+  uint8_t index;
+};
+
+extern LimitedHandleResource<HAL_CounterHandle, Counter, kNumCounters,
+                             HAL_HandleEnum::Counter>* counterHandles;
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/DIO.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/DIO.cpp
new file mode 100644
index 0000000..5c03927
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/DIO.cpp
@@ -0,0 +1,348 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/DIO.h"
+
+#include <cmath>
+
+#include "DigitalInternal.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "MockData/DIODataInternal.h"
+#include "MockData/DigitalPWMDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+static LimitedHandleResource<HAL_DigitalPWMHandle, uint8_t,
+                             kNumDigitalPWMOutputs, HAL_HandleEnum::DigitalPWM>*
+    digitalPWMHandles;
+
+namespace hal {
+namespace init {
+void InitializeDIO() {
+  static LimitedHandleResource<HAL_DigitalPWMHandle, uint8_t,
+                               kNumDigitalPWMOutputs,
+                               HAL_HandleEnum::DigitalPWM>
+      dpH;
+  digitalPWMHandles = &dpH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+/**
+ * Create a new instance of a digital port.
+ */
+HAL_DigitalHandle HAL_InitializeDIOPort(HAL_PortHandle portHandle,
+                                        HAL_Bool input, int32_t* status) {
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  auto handle =
+      digitalChannelHandles->Allocate(channel, HAL_HandleEnum::DIO, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = digitalChannelHandles->Get(handle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  port->channel = static_cast<uint8_t>(channel);
+
+  SimDIOData[channel].SetInitialized(true);
+
+  SimDIOData[channel].SetIsInput(input);
+
+  return handle;
+}
+
+HAL_Bool HAL_CheckDIOChannel(int32_t channel) {
+  return channel < kNumDigitalChannels && channel >= 0;
+}
+
+void HAL_FreeDIOPort(HAL_DigitalHandle dioPortHandle) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  // no status, so no need to check for a proper free.
+  digitalChannelHandles->Free(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) return;
+  SimDIOData[port->channel].SetInitialized(true);
+}
+
+/**
+ * Allocate a DO PWM Generator.
+ * Allocate PWM generators so that they are not accidentally reused.
+ *
+ * @return PWM Generator handle
+ */
+HAL_DigitalPWMHandle HAL_AllocateDigitalPWM(int32_t* status) {
+  auto handle = digitalPWMHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+
+  auto id = digitalPWMHandles->Get(handle);
+  if (id == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  *id = static_cast<uint8_t>(getHandleIndex(handle));
+
+  SimDigitalPWMData[*id].SetInitialized(true);
+
+  return handle;
+}
+
+/**
+ * Free the resource associated with a DO PWM generator.
+ *
+ * @param pwmGenerator The pwmGen to free that was allocated with
+ * allocateDigitalPWM()
+ */
+void HAL_FreeDigitalPWM(HAL_DigitalPWMHandle pwmGenerator, int32_t* status) {
+  auto port = digitalPWMHandles->Get(pwmGenerator);
+  digitalPWMHandles->Free(pwmGenerator);
+  if (port == nullptr) return;
+  int32_t id = *port;
+  SimDigitalPWMData[id].SetInitialized(false);
+}
+
+/**
+ * Change the frequency of the DO PWM generator.
+ *
+ * The valid range is from 0.6 Hz to 19 kHz.  The frequency resolution is
+ * logarithmic.
+ *
+ * @param rate The frequency to output all digital output PWM signals.
+ */
+void HAL_SetDigitalPWMRate(double rate, int32_t* status) {
+  // Currently rounding in the log rate domain... heavy weight toward picking a
+  // higher freq.
+  // TODO: Round in the linear rate domain.
+  // uint8_t pwmPeriodPower = static_cast<uint8_t>(
+  //    std::log(1.0 / (kExpectedLoopTiming * 0.25E-6 * rate)) /
+  //        std::log(2.0) +
+  //    0.5);
+  // TODO(THAD) : Add a case to set this in the simulator
+  // digitalSystem->writePWMPeriodPower(pwmPeriodPower, status);
+}
+
+/**
+ * Configure the duty-cycle of the PWM generator
+ *
+ * @param pwmGenerator The generator index reserved by allocateDigitalPWM()
+ * @param dutyCycle The percent duty cycle to output [0..1].
+ */
+void HAL_SetDigitalPWMDutyCycle(HAL_DigitalPWMHandle pwmGenerator,
+                                double dutyCycle, int32_t* status) {
+  auto port = digitalPWMHandles->Get(pwmGenerator);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  int32_t id = *port;
+  if (dutyCycle > 1.0) dutyCycle = 1.0;
+  if (dutyCycle < 0.0) dutyCycle = 0.0;
+  SimDigitalPWMData[id].SetDutyCycle(dutyCycle);
+}
+
+/**
+ * Configure which DO channel the PWM signal is output on
+ *
+ * @param pwmGenerator The generator index reserved by allocateDigitalPWM()
+ * @param channel The Digital Output channel to output on
+ */
+void HAL_SetDigitalPWMOutputChannel(HAL_DigitalPWMHandle pwmGenerator,
+                                    int32_t channel, int32_t* status) {
+  auto port = digitalPWMHandles->Get(pwmGenerator);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  int32_t id = *port;
+  SimDigitalPWMData[id].SetPin(channel);
+}
+
+/**
+ * Write a digital I/O bit to the FPGA.
+ * Set a single value on a digital I/O channel.
+ *
+ * @param channel The Digital I/O channel
+ * @param value The state to set the digital channel (if it is configured as an
+ * output)
+ */
+void HAL_SetDIO(HAL_DigitalHandle dioPortHandle, HAL_Bool value,
+                int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (value != 0 && value != 1) {
+    if (value != 0) value = 1;
+  }
+  SimDIOData[port->channel].SetValue(value);
+}
+
+/**
+ * Read a digital I/O bit from the FPGA.
+ * Get a single value from a digital I/O channel.
+ *
+ * @param channel The digital I/O channel
+ * @return The state of the specified channel
+ */
+HAL_Bool HAL_GetDIO(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  HAL_Bool value = SimDIOData[port->channel].GetValue();
+  if (value > 1) value = 1;
+  if (value < 0) value = 0;
+  return value;
+}
+
+/**
+ * Read the direction of a the Digital I/O lines
+ * A 1 bit means output and a 0 bit means input.
+ *
+ * @param channel The digital I/O channel
+ * @return The direction of the specified channel
+ */
+HAL_Bool HAL_GetDIODirection(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  HAL_Bool value = SimDIOData[port->channel].GetIsInput();
+  if (value > 1) value = 1;
+  if (value < 0) value = 0;
+  return value;
+}
+
+/**
+ * Generate a single pulse.
+ * Write a pulse to the specified digital output channel. There can only be a
+ * single pulse going at any time.
+ *
+ * @param channel The Digital Output channel that the pulse should be output on
+ * @param pulseLength The active length of the pulse (in seconds)
+ */
+void HAL_Pulse(HAL_DigitalHandle dioPortHandle, double pulseLength,
+               int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  // TODO (Thad) Add this
+}
+
+/**
+ * Check a DIO line to see if it is currently generating a pulse.
+ *
+ * @return A pulse is in progress
+ */
+HAL_Bool HAL_IsPulsing(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return false;
+  // TODO (Thad) Add this
+}
+
+/**
+ * Check if any DIO line is currently generating a pulse.
+ *
+ * @return A pulse on some line is in progress
+ */
+HAL_Bool HAL_IsAnyPulsing(int32_t* status) {
+  return false;  // TODO(Thad) Figure this out
+}
+
+/**
+ * Write the filter index from the FPGA.
+ * Set the filter index used to filter out short pulses.
+ *
+ * @param dioPortHandle Handle to the digital I/O channel
+ * @param filterIndex The filter index.  Must be in the range 0 - 3, where 0
+ *                    means "none" and 1 - 3 means filter # filterIndex - 1.
+ */
+void HAL_SetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t filterIndex,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  // TODO(Thad) Figure this out
+}
+
+/**
+ * Read the filter index from the FPGA.
+ * Get the filter index used to filter out short pulses.
+ *
+ * @param dioPortHandle Handle to the digital I/O channel
+ * @return filterIndex The filter index.  Must be in the range 0 - 3,
+ * where 0 means "none" and 1 - 3 means filter # filterIndex - 1.
+ */
+int32_t HAL_GetFilterSelect(HAL_DigitalHandle dioPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(dioPortHandle, HAL_HandleEnum::DIO);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  return 0;
+  // TODO(Thad) Figure this out
+}
+
+/**
+ * Set the filter period for the specified filter index.
+ *
+ * Set the filter period in FPGA cycles.  Even though there are 2 different
+ * filter index domains (MXP vs HDR), ignore that distinction for now since it
+ * compilicates the interface.  That can be changed later.
+ *
+ * @param filterIndex The filter index, 0 - 2.
+ * @param value The number of cycles that the signal must not transition to be
+ * counted as a transition.
+ */
+void HAL_SetFilterPeriod(int32_t filterIndex, int64_t value, int32_t* status) {
+  // TODO(Thad) figure this out
+}
+
+/**
+ * Get the filter period for the specified filter index.
+ *
+ * Get the filter period in FPGA cycles.  Even though there are 2 different
+ * filter index domains (MXP vs HDR), ignore that distinction for now since it
+ * compilicates the interface.  Set status to NiFpga_Status_SoftwareFault if the
+ * filter values miss-match.
+ *
+ * @param filterIndex The filter index, 0 - 2.
+ * @param value The number of cycles that the signal must not transition to be
+ * counted as a transition.
+ */
+int64_t HAL_GetFilterPeriod(int32_t filterIndex, int32_t* status) {
+  return 0;  // TODO(Thad) figure this out
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/DigitalInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/DigitalInternal.cpp
new file mode 100644
index 0000000..2c1ce47
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/DigitalInternal.cpp
@@ -0,0 +1,87 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalInternal.h"
+
+#include "ConstantsInternal.h"
+#include "HAL/AnalogTrigger.h"
+#include "HAL/HAL.h"
+#include "HAL/Ports.h"
+#include "PortsInternal.h"
+
+namespace hal {
+
+DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
+                      kNumDigitalChannels + kNumPWMHeaders>*
+    digitalChannelHandles;
+
+namespace init {
+void InitializeDigitalInternal() {
+  static DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
+                               kNumDigitalChannels + kNumPWMHeaders>
+      dcH;
+  digitalChannelHandles = &dcH;
+}
+}  // namespace init
+
+/**
+ * Map DIO channel numbers from their physical number (10 to 26) to their
+ * position in the bit field.
+ */
+int32_t remapMXPChannel(int32_t channel) { return channel - 10; }
+
+int32_t remapMXPPWMChannel(int32_t channel) {
+  if (channel < 14) {
+    return channel - 10;  // first block of 4 pwms (MXP 0-3)
+  } else {
+    return channel - 6;  // block of PWMs after SPI
+  }
+}
+
+/**
+ * remap the digital source channel and set the module.
+ * If it's an analog trigger, determine the module from the high order routing
+ * channel else do normal digital input remapping based on channel number
+ * (MXP)
+ */
+bool remapDigitalSource(HAL_Handle digitalSourceHandle,
+                        HAL_AnalogTriggerType analogTriggerType,
+                        uint8_t& channel, uint8_t& module,
+                        bool& analogTrigger) {
+  if (isHandleType(digitalSourceHandle, HAL_HandleEnum::AnalogTrigger)) {
+    // If handle passed, index is not negative
+    int32_t index = getHandleIndex(digitalSourceHandle);
+    channel = (index << 2) + analogTriggerType;
+    module = channel >> 4;
+    analogTrigger = true;
+    return true;
+  } else if (isHandleType(digitalSourceHandle, HAL_HandleEnum::DIO)) {
+    int32_t index = getHandleIndex(digitalSourceHandle);
+    if (index >= kNumDigitalHeaders) {
+      channel = remapMXPChannel(index);
+      module = 1;
+    } else {
+      channel = index;
+      module = 0;
+    }
+    analogTrigger = false;
+    return true;
+  } else {
+    return false;
+  }
+}
+
+int32_t GetDigitalInputChannel(HAL_DigitalHandle handle, int32_t* status) {
+  auto digital = digitalChannelHandles->Get(handle, HAL_HandleEnum::DIO);
+  if (digital == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return -1;
+  }
+
+  return digital->channel;
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/DigitalInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/DigitalInternal.h
new file mode 100644
index 0000000..053eb0b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/DigitalInternal.h
@@ -0,0 +1,80 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Ports.h"
+#include "HAL/Types.h"
+#include "HAL/handles/DigitalHandleResource.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "PortsInternal.h"
+
+namespace hal {
+/**
+ * MXP channels when used as digital output PWM are offset from actual value
+ */
+constexpr int32_t kMXPDigitalPWMOffset = 6;
+
+constexpr int32_t kExpectedLoopTiming = 40;
+
+/**
+ * kDefaultPwmPeriod is in ms
+ *
+ * - 20ms periods (50 Hz) are the "safest" setting in that this works for all
+ *   devices
+ * - 20ms periods seem to be desirable for Vex Motors
+ * - 20ms periods are the specified period for HS-322HD servos, but work
+ *   reliably down to 10.0 ms; starting at about 8.5ms, the servo sometimes hums
+ *   and get hot; by 5.0ms the hum is nearly continuous
+ * - 10ms periods work well for Victor 884
+ * - 5ms periods allows higher update rates for Luminary Micro Jaguar speed
+ *   controllers. Due to the shipping firmware on the Jaguar, we can't run the
+ *   update period less than 5.05 ms.
+ *
+ * kDefaultPwmPeriod is the 1x period (5.05 ms).  In hardware, the period
+ * scaling is implemented as an output squelch to get longer periods for old
+ * devices.
+ */
+constexpr float kDefaultPwmPeriod = 5.05;
+/**
+ * kDefaultPwmCenter is the PWM range center in ms
+ */
+constexpr float kDefaultPwmCenter = 1.5;
+/**
+ * kDefaultPWMStepsDown is the number of PWM steps below the centerpoint
+ */
+constexpr int32_t kDefaultPwmStepsDown = 1000;
+constexpr int32_t kPwmDisabled = 0;
+
+struct DigitalPort {
+  uint8_t channel;
+  bool configSet = false;
+  bool eliminateDeadband = false;
+  int32_t maxPwm = 0;
+  int32_t deadbandMaxPwm = 0;
+  int32_t centerPwm = 0;
+  int32_t deadbandMinPwm = 0;
+  int32_t minPwm = 0;
+};
+
+extern DigitalHandleResource<HAL_DigitalHandle, DigitalPort,
+                             kNumDigitalChannels + kNumPWMHeaders>*
+    digitalChannelHandles;
+
+bool remapDigitalSource(HAL_Handle digitalSourceHandle,
+                        HAL_AnalogTriggerType analogTriggerType,
+                        uint8_t& channel, uint8_t& module, bool& analogTrigger);
+int32_t remapMXPPWMChannel(int32_t channel);
+int32_t remapMXPChannel(int32_t channel);
+
+int32_t GetDigitalInputChannel(HAL_DigitalHandle handle, int32_t* status);
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/DriverStation.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/DriverStation.cpp
new file mode 100644
index 0000000..d2e2f9e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/DriverStation.cpp
@@ -0,0 +1,312 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/DriverStation.h"
+
+#ifdef __APPLE__
+#include <pthread.h>
+#endif
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <string>
+
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+#include "MockData/DriverStationDataInternal.h"
+#include "MockData/MockHooks.h"
+
+static wpi::mutex msgMutex;
+static wpi::condition_variable* newDSDataAvailableCond;
+static wpi::mutex newDSDataAvailableMutex;
+static int newDSDataAvailableCounter{0};
+
+namespace hal {
+namespace init {
+void InitializeDriverStation() {
+  static wpi::condition_variable nddaC;
+  newDSDataAvailableCond = &nddaC;
+}
+}  // namespace init
+}  // namespace hal
+
+using namespace hal;
+
+extern "C" {
+int32_t HAL_SendError(HAL_Bool isError, int32_t errorCode, HAL_Bool isLVCode,
+                      const char* details, const char* location,
+                      const char* callStack, HAL_Bool printMsg) {
+  // Avoid flooding console by keeping track of previous 5 error
+  // messages and only printing again if they're longer than 1 second old.
+  static constexpr int KEEP_MSGS = 5;
+  std::lock_guard<wpi::mutex> lock(msgMutex);
+  static std::string prevMsg[KEEP_MSGS];
+  static std::chrono::time_point<std::chrono::steady_clock>
+      prevMsgTime[KEEP_MSGS];
+  static bool initialized = false;
+  if (!initialized) {
+    for (int i = 0; i < KEEP_MSGS; i++) {
+      prevMsgTime[i] =
+          std::chrono::steady_clock::now() - std::chrono::seconds(2);
+    }
+    initialized = true;
+  }
+
+  auto curTime = std::chrono::steady_clock::now();
+  int i;
+  for (i = 0; i < KEEP_MSGS; ++i) {
+    if (prevMsg[i] == details) break;
+  }
+  int retval = 0;
+  if (i == KEEP_MSGS || (curTime - prevMsgTime[i]) >= std::chrono::seconds(1)) {
+    printMsg = true;
+    if (printMsg) {
+      if (location && location[0] != '\0') {
+        std::fprintf(stderr, "%s at %s: ", isError ? "Error" : "Warning",
+                     location);
+      }
+      std::fprintf(stderr, "%s\n", details);
+      if (callStack && callStack[0] != '\0') {
+        std::fprintf(stderr, "%s\n", callStack);
+      }
+    }
+    if (i == KEEP_MSGS) {
+      // replace the oldest one
+      i = 0;
+      auto first = prevMsgTime[0];
+      for (int j = 1; j < KEEP_MSGS; ++j) {
+        if (prevMsgTime[j] < first) {
+          first = prevMsgTime[j];
+          i = j;
+        }
+      }
+      prevMsg[i] = details;
+    }
+    prevMsgTime[i] = curTime;
+  }
+  return retval;
+}
+
+int32_t HAL_GetControlWord(HAL_ControlWord* controlWord) {
+  controlWord->enabled = SimDriverStationData->GetEnabled();
+  controlWord->autonomous = SimDriverStationData->GetAutonomous();
+  controlWord->test = SimDriverStationData->GetTest();
+  controlWord->eStop = SimDriverStationData->GetEStop();
+  controlWord->fmsAttached = SimDriverStationData->GetFmsAttached();
+  controlWord->dsAttached = SimDriverStationData->GetDsAttached();
+  return 0;
+}
+
+HAL_AllianceStationID HAL_GetAllianceStation(int32_t* status) {
+  *status = 0;
+  return SimDriverStationData->GetAllianceStationId();
+}
+
+int32_t HAL_GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes) {
+  SimDriverStationData->GetJoystickAxes(joystickNum, axes);
+  return 0;
+}
+
+int32_t HAL_GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs) {
+  SimDriverStationData->GetJoystickPOVs(joystickNum, povs);
+  return 0;
+}
+
+int32_t HAL_GetJoystickButtons(int32_t joystickNum,
+                               HAL_JoystickButtons* buttons) {
+  SimDriverStationData->GetJoystickButtons(joystickNum, buttons);
+  return 0;
+}
+/**
+ * Retrieve the Joystick Descriptor for particular slot
+ * @param desc [out] descriptor (data transfer object) to fill in.  desc is
+ * filled in regardless of success. In other words, if descriptor is not
+ * available, desc is filled in with default values matching the init-values in
+ * Java and C++ Driverstation for when caller requests a too-large joystick
+ * index.
+ *
+ * @return error code reported from Network Comm back-end.  Zero is good,
+ * nonzero is bad.
+ */
+int32_t HAL_GetJoystickDescriptor(int32_t joystickNum,
+                                  HAL_JoystickDescriptor* desc) {
+  SimDriverStationData->GetJoystickDescriptor(joystickNum, desc);
+  return 0;
+}
+
+HAL_Bool HAL_GetJoystickIsXbox(int32_t joystickNum) {
+  HAL_JoystickDescriptor desc;
+  SimDriverStationData->GetJoystickDescriptor(joystickNum, &desc);
+  return desc.isXbox;
+}
+
+int32_t HAL_GetJoystickType(int32_t joystickNum) {
+  HAL_JoystickDescriptor desc;
+  SimDriverStationData->GetJoystickDescriptor(joystickNum, &desc);
+  return desc.type;
+}
+
+char* HAL_GetJoystickName(int32_t joystickNum) {
+  HAL_JoystickDescriptor desc;
+  SimDriverStationData->GetJoystickDescriptor(joystickNum, &desc);
+  size_t len = std::strlen(desc.name);
+  char* name = static_cast<char*>(std::malloc(len + 1));
+  std::strncpy(name, desc.name, len);
+  name[len] = '\0';
+  return name;
+}
+
+void HAL_FreeJoystickName(char* name) { std::free(name); }
+
+int32_t HAL_GetJoystickAxisType(int32_t joystickNum, int32_t axis) { return 0; }
+
+int32_t HAL_SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+                               int32_t leftRumble, int32_t rightRumble) {
+  SimDriverStationData->SetJoystickOutputs(joystickNum, outputs, leftRumble,
+                                           rightRumble);
+  return 0;
+}
+
+double HAL_GetMatchTime(int32_t* status) {
+  return SimDriverStationData->GetMatchTime();
+}
+
+int HAL_GetMatchInfo(HAL_MatchInfo* info) {
+  SimDriverStationData->GetMatchInfo(info);
+  return 0;
+}
+
+void HAL_FreeMatchInfo(HAL_MatchInfo* info) {
+  SimDriverStationData->FreeMatchInfo(info);
+}
+
+void HAL_ObserveUserProgramStarting(void) { HALSIM_SetProgramStarted(); }
+
+void HAL_ObserveUserProgramDisabled(void) {
+  // TODO
+}
+
+void HAL_ObserveUserProgramAutonomous(void) {
+  // TODO
+}
+
+void HAL_ObserveUserProgramTeleop(void) {
+  // TODO
+}
+
+void HAL_ObserveUserProgramTest(void) {
+  // TODO
+}
+
+#ifdef __APPLE__
+static pthread_key_t lastCountKey;
+static pthread_once_t lastCountKeyOnce = PTHREAD_ONCE_INIT;
+
+static void InitLastCountKey(void) {
+  pthread_key_create(&lastCountKey, std::free);
+}
+#endif
+
+bool HAL_IsNewControlData(void) {
+#ifdef __APPLE__
+  pthread_once(&lastCountKeyOnce, InitLastCountKey);
+  int* lastCountPtr = static_cast<int*>(pthread_getspecific(lastCountKey));
+  if (!lastCountPtr) {
+    lastCountPtr = static_cast<int*>(std::malloc(sizeof(int)));
+    *lastCountPtr = -1;
+    pthread_setspecific(lastCountKey, lastCountPtr);
+  }
+  int& lastCount = *lastCountPtr;
+#else
+  thread_local int lastCount{-1};
+#endif
+  // There is a rollover error condition here. At Packet# = n * (uintmax), this
+  // will return false when instead it should return true. However, this at a
+  // 20ms rate occurs once every 2.7 years of DS connected runtime, so not
+  // worth the cycles to check.
+  int currentCount = 0;
+  {
+    std::unique_lock<wpi::mutex> lock(newDSDataAvailableMutex);
+    currentCount = newDSDataAvailableCounter;
+  }
+  if (lastCount == currentCount) return false;
+  lastCount = currentCount;
+  return true;
+}
+
+/**
+ * Waits for the newest DS packet to arrive. Note that this is a blocking call.
+ */
+void HAL_WaitForDSData(void) { HAL_WaitForDSDataTimeout(0); }
+
+/**
+ * Waits for the newest DS packet to arrive. If timeout is <= 0, this will wait
+ * forever. Otherwise, it will wait until either a new packet, or the timeout
+ * time has passed. Returns true on new data, false on timeout.
+ */
+HAL_Bool HAL_WaitForDSDataTimeout(double timeout) {
+  auto timeoutTime =
+      std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
+
+  std::unique_lock<wpi::mutex> lock(newDSDataAvailableMutex);
+  int currentCount = newDSDataAvailableCounter;
+  while (newDSDataAvailableCounter == currentCount) {
+    if (timeout > 0) {
+      auto timedOut = newDSDataAvailableCond->wait_until(lock, timeoutTime);
+      if (timedOut == std::cv_status::timeout) {
+        return false;
+      }
+    } else {
+      newDSDataAvailableCond->wait(lock);
+    }
+  }
+  return true;
+}
+
+// Constant number to be used for our occur handle
+constexpr int32_t refNumber = 42;
+
+static int32_t newDataOccur(uint32_t refNum) {
+  // Since we could get other values, require our specific handle
+  // to signal our threads
+  if (refNum != refNumber) return 0;
+  std::lock_guard<wpi::mutex> lock(newDSDataAvailableMutex);
+  // Nofify all threads
+  newDSDataAvailableCounter++;
+  newDSDataAvailableCond->notify_all();
+  return 0;
+}
+
+/*
+ * Call this to initialize the driver station communication. This will properly
+ * handle multiple calls. However note that this CANNOT be called from a library
+ * that interfaces with LabVIEW.
+ */
+void HAL_InitializeDriverStation(void) {
+  static std::atomic_bool initialized{false};
+  static wpi::mutex initializeMutex;
+  // Initial check, as if it's true initialization has finished
+  if (initialized) return;
+
+  std::lock_guard<wpi::mutex> lock(initializeMutex);
+  // Second check in case another thread was waiting
+  if (initialized) return;
+
+  SimDriverStationData->ResetData();
+
+  initialized = true;
+}
+
+/*
+ * Releases the DS Mutex to allow proper shutdown of any threads that are
+ * waiting on it.
+ */
+void HAL_ReleaseDSMutex(void) { newDataOccur(refNumber); }
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Encoder.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Encoder.cpp
new file mode 100644
index 0000000..870719a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Encoder.cpp
@@ -0,0 +1,341 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Encoder.h"
+
+#include "CounterInternal.h"
+#include "HAL/Counter.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "MockData/EncoderDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+struct Encoder {
+  HAL_Handle nativeHandle;
+  HAL_EncoderEncodingType encodingType;
+  double distancePerPulse;
+  uint8_t index;
+};
+struct Empty {};
+}  // namespace
+
+static LimitedHandleResource<HAL_EncoderHandle, Encoder,
+                             kNumEncoders + kNumCounters,
+                             HAL_HandleEnum::Encoder>* encoderHandles;
+
+static LimitedHandleResource<HAL_FPGAEncoderHandle, Empty, kNumEncoders,
+                             HAL_HandleEnum::FPGAEncoder>* fpgaEncoderHandles;
+
+namespace hal {
+namespace init {
+void InitializeEncoder() {
+  static LimitedHandleResource<HAL_FPGAEncoderHandle, Empty, kNumEncoders,
+                               HAL_HandleEnum::FPGAEncoder>
+      feH;
+  fpgaEncoderHandles = &feH;
+  static LimitedHandleResource<HAL_EncoderHandle, Encoder,
+                               kNumEncoders + kNumCounters,
+                               HAL_HandleEnum::Encoder>
+      eH;
+  encoderHandles = &eH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_EncoderHandle HAL_InitializeEncoder(
+    HAL_Handle digitalSourceHandleA, HAL_AnalogTriggerType analogTriggerTypeA,
+    HAL_Handle digitalSourceHandleB, HAL_AnalogTriggerType analogTriggerTypeB,
+    HAL_Bool reverseDirection, HAL_EncoderEncodingType encodingType,
+    int32_t* status) {
+  HAL_Handle nativeHandle = HAL_kInvalidHandle;
+  if (encodingType == HAL_EncoderEncodingType::HAL_Encoder_k4X) {
+    // k4x, allocate encoder
+    nativeHandle = fpgaEncoderHandles->Allocate();
+  } else {
+    // k2x or k1x, allocate counter
+    nativeHandle = counterHandles->Allocate();
+  }
+  if (nativeHandle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto handle = encoderHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto encoder = encoderHandles->Get(handle);
+  if (encoder == nullptr) {  // would only occur on thread issue
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  int16_t index = getHandleIndex(handle);
+  SimEncoderData[index].SetInitialized(true);
+  // TODO: Add encoding type to Sim data
+  encoder->index = index;
+  encoder->nativeHandle = nativeHandle;
+  encoder->encodingType = encodingType;
+  encoder->distancePerPulse = 1.0;
+  return handle;
+}
+
+void HAL_FreeEncoder(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  encoderHandles->Free(encoderHandle);
+  if (encoder == nullptr) return;
+  if (isHandleType(encoder->nativeHandle, HAL_HandleEnum::FPGAEncoder)) {
+    fpgaEncoderHandles->Free(encoder->nativeHandle);
+  } else if (isHandleType(encoder->nativeHandle, HAL_HandleEnum::Counter)) {
+    counterHandles->Free(encoder->nativeHandle);
+  }
+  SimEncoderData[encoder->index].SetInitialized(false);
+}
+
+static inline int EncodingScaleFactor(Encoder* encoder) {
+  switch (encoder->encodingType) {
+    case HAL_Encoder_k1X:
+      return 1;
+    case HAL_Encoder_k2X:
+      return 2;
+    case HAL_Encoder_k4X:
+      return 4;
+    default:
+      return 0;
+  }
+}
+
+static inline double DecodingScaleFactor(Encoder* encoder) {
+  switch (encoder->encodingType) {
+    case HAL_Encoder_k1X:
+      return 1.0;
+    case HAL_Encoder_k2X:
+      return 0.5;
+    case HAL_Encoder_k4X:
+      return 0.25;
+    default:
+      return 0.0;
+  }
+}
+
+int32_t HAL_GetEncoder(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetCount();
+}
+int32_t HAL_GetEncoderRaw(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetCount() /
+         DecodingScaleFactor(encoder.get());
+}
+int32_t HAL_GetEncoderEncodingScale(HAL_EncoderHandle encoderHandle,
+                                    int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return EncodingScaleFactor(encoder.get());
+}
+void HAL_ResetEncoder(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimEncoderData[encoder->index].SetCount(0);
+  SimEncoderData[encoder->index].SetPeriod(std::numeric_limits<double>::max());
+  SimEncoderData[encoder->index].SetReset(true);
+}
+double HAL_GetEncoderPeriod(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetPeriod();
+}
+void HAL_SetEncoderMaxPeriod(HAL_EncoderHandle encoderHandle, double maxPeriod,
+                             int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimEncoderData[encoder->index].SetMaxPeriod(maxPeriod);
+}
+HAL_Bool HAL_GetEncoderStopped(HAL_EncoderHandle encoderHandle,
+                               int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetPeriod() >
+         SimEncoderData[encoder->index].GetMaxPeriod();
+}
+HAL_Bool HAL_GetEncoderDirection(HAL_EncoderHandle encoderHandle,
+                                 int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetDirection();
+}
+double HAL_GetEncoderDistance(HAL_EncoderHandle encoderHandle,
+                              int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetCount() * encoder->distancePerPulse;
+}
+double HAL_GetEncoderRate(HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return encoder->distancePerPulse / SimEncoderData[encoder->index].GetPeriod();
+}
+void HAL_SetEncoderMinRate(HAL_EncoderHandle encoderHandle, double minRate,
+                           int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  if (minRate == 0.0) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+
+  SimEncoderData[encoder->index].SetMaxPeriod(encoder->distancePerPulse /
+                                              minRate);
+}
+void HAL_SetEncoderDistancePerPulse(HAL_EncoderHandle encoderHandle,
+                                    double distancePerPulse, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  if (distancePerPulse == 0.0) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return;
+  }
+  encoder->distancePerPulse = distancePerPulse;
+  SimEncoderData[encoder->index].SetDistancePerPulse(distancePerPulse);
+}
+void HAL_SetEncoderReverseDirection(HAL_EncoderHandle encoderHandle,
+                                    HAL_Bool reverseDirection,
+                                    int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimEncoderData[encoder->index].SetReverseDirection(reverseDirection);
+}
+void HAL_SetEncoderSamplesToAverage(HAL_EncoderHandle encoderHandle,
+                                    int32_t samplesToAverage, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimEncoderData[encoder->index].SetSamplesToAverage(samplesToAverage);
+}
+int32_t HAL_GetEncoderSamplesToAverage(HAL_EncoderHandle encoderHandle,
+                                       int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimEncoderData[encoder->index].GetSamplesToAverage();
+}
+
+void HAL_SetEncoderIndexSource(HAL_EncoderHandle encoderHandle,
+                               HAL_Handle digitalSourceHandle,
+                               HAL_AnalogTriggerType analogTriggerType,
+                               HAL_EncoderIndexingType type, int32_t* status) {
+  // Not implemented yet
+}
+
+int32_t HAL_GetEncoderFPGAIndex(HAL_EncoderHandle encoderHandle,
+                                int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return encoder->index;
+}
+
+double HAL_GetEncoderDecodingScaleFactor(HAL_EncoderHandle encoderHandle,
+                                         int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  return DecodingScaleFactor(encoder.get());
+}
+
+double HAL_GetEncoderDistancePerPulse(HAL_EncoderHandle encoderHandle,
+                                      int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0.0;
+  }
+
+  return encoder->distancePerPulse;
+}
+
+HAL_EncoderEncodingType HAL_GetEncoderEncodingType(
+    HAL_EncoderHandle encoderHandle, int32_t* status) {
+  auto encoder = encoderHandles->Get(encoderHandle);
+  if (encoder == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_Encoder_k4X;  // default to k4x
+  }
+
+  return encoder->encodingType;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/ErrorsInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/ErrorsInternal.h
new file mode 100644
index 0000000..55372d8
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/ErrorsInternal.h
@@ -0,0 +1,448 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+typedef enum {
+  CTR_OKAY,       // No Error - Function executed as expected
+  CTR_RxTimeout,  // CAN frame has not been received within specified period of
+                  // time.
+  CTR_TxTimeout,  // Not used.
+  CTR_InvalidParamValue,  // Caller passed an invalid param
+  CTR_UnexpectedArbId,    // Specified CAN Id is invalid.
+  CTR_TxFailed,           // Could not transmit the CAN frame.
+  CTR_SigNotUpdated,      // Have not received an value response for signal.
+  CTR_BufferFull,  // Caller attempted to insert data into a buffer that is
+                   // full.
+} CTR_Code;
+
+// VISA Error
+#define _VI_ERROR (-2147483647L - 1)
+#define VI_ERROR_SYSTEM_ERROR (_VI_ERROR + 0x3FFF0000L)
+#define VI_ERROR_INV_OBJECT (_VI_ERROR + 0x3FFF000EL)
+#define VI_ERROR_RSRC_LOCKED (_VI_ERROR + 0x3FFF000FL)
+#define VI_ERROR_INV_EXPR (_VI_ERROR + 0x3FFF0010L)
+#define VI_ERROR_RSRC_NFOUND (_VI_ERROR + 0x3FFF0011L)
+#define VI_ERROR_INV_RSRC_NAME (_VI_ERROR + 0x3FFF0012L)
+#define VI_ERROR_INV_ACC_MODE (_VI_ERROR + 0x3FFF0013L)
+#define VI_ERROR_TMO (_VI_ERROR + 0x3FFF0015L)
+#define VI_ERROR_CLOSING_FAILED (_VI_ERROR + 0x3FFF0016L)
+#define VI_ERROR_INV_DEGREE (_VI_ERROR + 0x3FFF001BL)
+#define VI_ERROR_INV_JOB_ID (_VI_ERROR + 0x3FFF001CL)
+#define VI_ERROR_NSUP_ATTR (_VI_ERROR + 0x3FFF001DL)
+#define VI_ERROR_NSUP_ATTR_STATE (_VI_ERROR + 0x3FFF001EL)
+#define VI_ERROR_ATTR_READONLY (_VI_ERROR + 0x3FFF001FL)
+#define VI_ERROR_INV_LOCK_TYPE (_VI_ERROR + 0x3FFF0020L)
+#define VI_ERROR_INV_ACCESS_KEY (_VI_ERROR + 0x3FFF0021L)
+#define VI_ERROR_INV_EVENT (_VI_ERROR + 0x3FFF0026L)
+#define VI_ERROR_INV_MECH (_VI_ERROR + 0x3FFF0027L)
+#define VI_ERROR_HNDLR_NINSTALLED (_VI_ERROR + 0x3FFF0028L)
+#define VI_ERROR_INV_HNDLR_REF (_VI_ERROR + 0x3FFF0029L)
+#define VI_ERROR_INV_CONTEXT (_VI_ERROR + 0x3FFF002AL)
+#define VI_ERROR_QUEUE_OVERFLOW (_VI_ERROR + 0x3FFF002DL)
+#define VI_ERROR_NENABLED (_VI_ERROR + 0x3FFF002FL)
+#define VI_ERROR_ABORT (_VI_ERROR + 0x3FFF0030L)
+#define VI_ERROR_RAW_WR_PROT_VIOL (_VI_ERROR + 0x3FFF0034L)
+#define VI_ERROR_RAW_RD_PROT_VIOL (_VI_ERROR + 0x3FFF0035L)
+#define VI_ERROR_OUTP_PROT_VIOL (_VI_ERROR + 0x3FFF0036L)
+#define VI_ERROR_INP_PROT_VIOL (_VI_ERROR + 0x3FFF0037L)
+#define VI_ERROR_BERR (_VI_ERROR + 0x3FFF0038L)
+#define VI_ERROR_IN_PROGRESS (_VI_ERROR + 0x3FFF0039L)
+#define VI_ERROR_INV_SETUP (_VI_ERROR + 0x3FFF003AL)
+#define VI_ERROR_QUEUE_ERROR (_VI_ERROR + 0x3FFF003BL)
+#define VI_ERROR_ALLOC (_VI_ERROR + 0x3FFF003CL)
+#define VI_ERROR_INV_MASK (_VI_ERROR + 0x3FFF003DL)
+#define VI_ERROR_IO (_VI_ERROR + 0x3FFF003EL)
+#define VI_ERROR_INV_FMT (_VI_ERROR + 0x3FFF003FL)
+#define VI_ERROR_NSUP_FMT (_VI_ERROR + 0x3FFF0041L)
+#define VI_ERROR_LINE_IN_USE (_VI_ERROR + 0x3FFF0042L)
+#define VI_ERROR_NSUP_MODE (_VI_ERROR + 0x3FFF0046L)
+#define VI_ERROR_SRQ_NOCCURRED (_VI_ERROR + 0x3FFF004AL)
+#define VI_ERROR_INV_SPACE (_VI_ERROR + 0x3FFF004EL)
+#define VI_ERROR_INV_OFFSET (_VI_ERROR + 0x3FFF0051L)
+#define VI_ERROR_INV_WIDTH (_VI_ERROR + 0x3FFF0052L)
+#define VI_ERROR_NSUP_OFFSET (_VI_ERROR + 0x3FFF0054L)
+#define VI_ERROR_NSUP_VAR_WIDTH (_VI_ERROR + 0x3FFF0055L)
+#define VI_ERROR_WINDOW_NMAPPED (_VI_ERROR + 0x3FFF0057L)
+#define VI_ERROR_RESP_PENDING (_VI_ERROR + 0x3FFF0059L)
+#define VI_ERROR_NLISTENERS (_VI_ERROR + 0x3FFF005FL)
+#define VI_ERROR_NCIC (_VI_ERROR + 0x3FFF0060L)
+#define VI_ERROR_NSYS_CNTLR (_VI_ERROR + 0x3FFF0061L)
+#define VI_ERROR_NSUP_OPER (_VI_ERROR + 0x3FFF0067L)
+#define VI_ERROR_INTR_PENDING (_VI_ERROR + 0x3FFF0068L)
+#define VI_ERROR_ASRL_PARITY (_VI_ERROR + 0x3FFF006AL)
+#define VI_ERROR_ASRL_FRAMING (_VI_ERROR + 0x3FFF006BL)
+#define VI_ERROR_ASRL_OVERRUN (_VI_ERROR + 0x3FFF006CL)
+#define VI_ERROR_TRIG_NMAPPED (_VI_ERROR + 0x3FFF006EL)
+#define VI_ERROR_NSUP_ALIGN_OFFSET (_VI_ERROR + 0x3FFF0070L)
+#define VI_ERROR_USER_BUF (_VI_ERROR + 0x3FFF0071L)
+#define VI_ERROR_RSRC_BUSY (_VI_ERROR + 0x3FFF0072L)
+#define VI_ERROR_NSUP_WIDTH (_VI_ERROR + 0x3FFF0076L)
+#define VI_ERROR_INV_PARAMETER (_VI_ERROR + 0x3FFF0078L)
+#define VI_ERROR_INV_PROT (_VI_ERROR + 0x3FFF0079L)
+#define VI_ERROR_INV_SIZE (_VI_ERROR + 0x3FFF007BL)
+#define VI_ERROR_WINDOW_MAPPED (_VI_ERROR + 0x3FFF0080L)
+#define VI_ERROR_NIMPL_OPER (_VI_ERROR + 0x3FFF0081L)
+#define VI_ERROR_INV_LENGTH (_VI_ERROR + 0x3FFF0083L)
+#define VI_ERROR_INV_MODE (_VI_ERROR + 0x3FFF0091L)
+#define VI_ERROR_SESN_NLOCKED (_VI_ERROR + 0x3FFF009CL)
+#define VI_ERROR_MEM_NSHARED (_VI_ERROR + 0x3FFF009DL)
+#define VI_ERROR_LIBRARY_NFOUND (_VI_ERROR + 0x3FFF009EL)
+#define VI_ERROR_NSUP_INTR (_VI_ERROR + 0x3FFF009FL)
+#define VI_ERROR_INV_LINE (_VI_ERROR + 0x3FFF00A0L)
+#define VI_ERROR_FILE_ACCESS (_VI_ERROR + 0x3FFF00A1L)
+#define VI_ERROR_FILE_IO (_VI_ERROR + 0x3FFF00A2L)
+#define VI_ERROR_NSUP_LINE (_VI_ERROR + 0x3FFF00A3L)
+#define VI_ERROR_NSUP_MECH (_VI_ERROR + 0x3FFF00A4L)
+#define VI_ERROR_INTF_NUM_NCONFIG (_VI_ERROR + 0x3FFF00A5L)
+#define VI_ERROR_CONN_LOST (_VI_ERROR + 0x3FFF00A6L)
+#define VI_ERROR_MACHINE_NAVAIL (_VI_ERROR + 0x3FFF00A7L)
+#define VI_ERROR_NPERMISSION (_VI_ERROR + 0x3FFF00A8L)
+
+// FPGA Errors
+
+/**
+ * Represents the resulting status of a function call through its return value.
+ * 0 is success, negative values are errors, and positive values are warnings.
+ */
+typedef int32_t NiFpga_Status;
+
+/**
+ * No errors or warnings.
+ */
+static const NiFpga_Status NiFpga_Status_Success = 0;
+
+/**
+ * The timeout expired before the FIFO operation could complete.
+ */
+static const NiFpga_Status NiFpga_Status_FifoTimeout = -50400;
+
+/**
+ * No transfer is in progress because the transfer was aborted by the client.
+ * The operation could not be completed as specified.
+ */
+static const NiFpga_Status NiFpga_Status_TransferAborted = -50405;
+
+/**
+ * A memory allocation failed. Try again after rebooting.
+ */
+static const NiFpga_Status NiFpga_Status_MemoryFull = -52000;
+
+/**
+ * An unexpected software error occurred.
+ */
+static const NiFpga_Status NiFpga_Status_SoftwareFault = -52003;
+
+/**
+ * A parameter to a function was not valid. This could be a NULL pointer, a bad
+ * value, etc.
+ */
+static const NiFpga_Status NiFpga_Status_InvalidParameter = -52005;
+
+/**
+ * A required resource was not found. The NiFpga.* library, the RIO resource, or
+ * some other resource may be missing.
+ */
+static const NiFpga_Status NiFpga_Status_ResourceNotFound = -52006;
+
+/**
+ * A required resource was not properly initialized. This could occur if
+ * NiFpga_Initialize was not called or a required NiFpga_IrqContext was not
+ * reserved.
+ */
+static const NiFpga_Status NiFpga_Status_ResourceNotInitialized = -52010;
+
+/**
+ * A hardware failure has occurred. The operation could not be completed as
+ * specified.
+ */
+static const NiFpga_Status NiFpga_Status_HardwareFault = -52018;
+
+/**
+ * The FPGA is already running.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaAlreadyRunning = -61003;
+
+/**
+ * An error occurred downloading the VI to the FPGA device. Verify that
+ * the target is connected and powered and that the resource of the target
+ * is properly configured.
+ */
+static const NiFpga_Status NiFpga_Status_DownloadError = -61018;
+
+/**
+ * The bitfile was not compiled for the specified resource's device type.
+ */
+static const NiFpga_Status NiFpga_Status_DeviceTypeMismatch = -61024;
+
+/**
+ * An error was detected in the communication between the host computer and the
+ * FPGA target.
+ */
+static const NiFpga_Status NiFpga_Status_CommunicationTimeout = -61046;
+
+/**
+ * The timeout expired before any of the IRQs were asserted.
+ */
+static const NiFpga_Status NiFpga_Status_IrqTimeout = -61060;
+
+/**
+ * The specified bitfile is invalid or corrupt.
+ */
+static const NiFpga_Status NiFpga_Status_CorruptBitfile = -61070;
+
+/**
+ * The requested FIFO depth is invalid. It is either 0 or an amount not
+ * supported by the hardware.
+ */
+static const NiFpga_Status NiFpga_Status_BadDepth = -61072;
+
+/**
+ * The number of FIFO elements is invalid. Either the number is greater than the
+ * depth of the host memory DMA FIFO, or more elements were requested for
+ * release than had been acquired.
+ */
+static const NiFpga_Status NiFpga_Status_BadReadWriteCount = -61073;
+
+/**
+ * A hardware clocking error occurred. A derived clock lost lock with its base
+ * clock during the execution of the LabVIEW FPGA VI. If any base clocks with
+ * derived clocks are referencing an external source, make sure that the
+ * external source is connected and within the supported frequency, jitter,
+ * accuracy, duty cycle, and voltage specifications. Also verify that the
+ * characteristics of the base clock match the configuration specified in the
+ * FPGA Base Clock Properties. If all base clocks with derived clocks are
+ * generated from free-running, on-board sources, please contact National
+ * Instruments technical support at ni.com/support.
+ */
+static const NiFpga_Status NiFpga_Status_ClockLostLock = -61083;
+
+/**
+ * The operation could not be performed because the FPGA is busy. Stop all
+ * activities on the FPGA before requesting this operation. If the target is in
+ * Scan Interface programming mode, put it in FPGA Interface programming mode.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusy = -61141;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * FPGA Interface C API mode. Stop all activities on the FPGA before requesting
+ * this operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterfaceCApi = -61200;
+
+/**
+ * The chassis is in Scan Interface programming mode. In order to run FPGA VIs,
+ * you must go to the chassis properties page, select FPGA programming mode, and
+ * deploy settings.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyScanInterface = -61201;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * FPGA Interface mode. Stop all activities on the FPGA before requesting this
+ * operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterface = -61202;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * Interactive mode. Stop all activities on the FPGA before requesting this
+ * operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyInteractive = -61203;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * Emulation mode. Stop all activities on the FPGA before requesting this
+ * operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyEmulation = -61204;
+
+/**
+ * LabVIEW FPGA does not support the Reset method for bitfiles that allow
+ * removal of implicit enable signals in single-cycle Timed Loops.
+ */
+static const NiFpga_Status NiFpga_Status_ResetCalledWithImplicitEnableRemoval =
+    -61211;
+
+/**
+ * LabVIEW FPGA does not support the Abort method for bitfiles that allow
+ * removal of implicit enable signals in single-cycle Timed Loops.
+ */
+static const NiFpga_Status NiFpga_Status_AbortCalledWithImplicitEnableRemoval =
+    -61212;
+
+/**
+ * LabVIEW FPGA does not support Close and Reset if Last Reference for bitfiles
+ * that allow removal of implicit enable signals in single-cycle Timed Loops.
+ * Pass the NiFpga_CloseAttribute_NoResetIfLastSession attribute to NiFpga_Close
+ * instead of 0.
+ */
+static const NiFpga_Status
+    NiFpga_Status_CloseAndResetCalledWithImplicitEnableRemoval = -61213;
+
+/**
+ * For bitfiles that allow removal of implicit enable signals in single-cycle
+ * Timed Loops, LabVIEW FPGA does not support this method prior to running the
+ * bitfile.
+ */
+static const NiFpga_Status NiFpga_Status_ImplicitEnableRemovalButNotYetRun =
+    -61214;
+
+/**
+ * Bitfiles that allow removal of implicit enable signals in single-cycle Timed
+ * Loops can run only once. Download the bitfile again before re-running the VI.
+ */
+static const NiFpga_Status
+    NiFpga_Status_RunAfterStoppedCalledWithImplicitEnableRemoval = -61215;
+
+/**
+ * A gated clock has violated the handshaking protocol. If you are using
+ * external gated clocks, ensure that they follow the required clock gating
+ * protocol. If you are generating your clocks internally, please contact
+ * National Instruments Technical Support.
+ */
+static const NiFpga_Status NiFpga_Status_GatedClockHandshakingViolation =
+    -61216;
+
+/**
+ * The number of elements requested must be less than or equal to the number of
+ * unacquired elements left in the host memory DMA FIFO. There are currently
+ * fewer unacquired elements left in the FIFO than are being requested. Release
+ * some acquired elements before acquiring more elements.
+ */
+static const NiFpga_Status NiFpga_Status_ElementsNotPermissibleToBeAcquired =
+    -61219;
+
+/**
+ * The operation could not be performed because the FPGA is in configuration or
+ * discovery mode. Wait for configuration or discovery to complete and retry
+ * your operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyConfiguration = -61252;
+
+/**
+ * An unexpected internal error occurred.
+ */
+static const NiFpga_Status NiFpga_Status_InternalError = -61499;
+
+/**
+ * The NI-RIO driver was unable to allocate memory for a FIFO. This can happen
+ * when the combined depth of all DMA FIFOs exceeds the maximum depth for the
+ * controller, or when the controller runs out of system memory. You may be able
+ * to reconfigure the controller with a greater maximum FIFO depth. For more
+ * information, refer to the NI KnowledgeBase article 65OF2ERQ.
+ */
+static const NiFpga_Status NiFpga_Status_TotalDmaFifoDepthExceeded = -63003;
+
+/**
+ * Access to the remote system was denied. Use MAX to check the Remote Device
+ * Access settings under Software>>NI-RIO>>NI-RIO Settings on the remote system.
+ */
+static const NiFpga_Status NiFpga_Status_AccessDenied = -63033;
+
+/**
+ * The NI-RIO software on the host is not compatible with the software on the
+ * target. Upgrade the NI-RIO software on the host in order to connect to this
+ * target.
+ */
+static const NiFpga_Status NiFpga_Status_HostVersionMismatch = -63038;
+
+/**
+ * A connection could not be established to the specified remote device. Ensure
+ * that the device is on and accessible over the network, that NI-RIO software
+ * is installed, and that the RIO server is running and properly configured.
+ */
+static const NiFpga_Status NiFpga_Status_RpcConnectionError = -63040;
+
+/**
+ * The RPC session is invalid. The target may have reset or been rebooted. Check
+ * the network connection and retry the operation.
+ */
+static const NiFpga_Status NiFpga_Status_RpcSessionError = -63043;
+
+/**
+ * The operation could not complete because another session is accessing the
+ * FIFO. Close the other session and retry.
+ */
+static const NiFpga_Status NiFpga_Status_FifoReserved = -63082;
+
+/**
+ * A Configure FIFO, Stop FIFO, Read FIFO, or Write FIFO function was called
+ * while the host had acquired elements of the FIFO. Release all acquired
+ * elements before configuring, stopping, reading, or writing.
+ */
+static const NiFpga_Status NiFpga_Status_FifoElementsCurrentlyAcquired = -63083;
+
+/**
+ * A function was called using a misaligned address. The address must be a
+ * multiple of the size of the datatype.
+ */
+static const NiFpga_Status NiFpga_Status_MisalignedAccess = -63084;
+
+/**
+ * The FPGA Read/Write Control Function is accessing a control or indicator
+ * with data that exceeds the maximum size supported on the current target.
+ * Refer to the hardware documentation for the limitations on data types for
+ * this target.
+ */
+static const NiFpga_Status NiFpga_Status_ControlOrIndicatorTooLarge = -63085;
+
+/**
+ * A valid .lvbitx bitfile is required. If you are using a valid .lvbitx
+ * bitfile, the bitfile may not be compatible with the software you are using.
+ * Determine which version of LabVIEW was used to make the bitfile, update your
+ * software to that version or later, and try again.
+ */
+static const NiFpga_Status NiFpga_Status_BitfileReadError = -63101;
+
+/**
+ * The specified signature does not match the signature of the bitfile. If the
+ * bitfile has been recompiled, regenerate the C API and rebuild the
+ * application.
+ */
+static const NiFpga_Status NiFpga_Status_SignatureMismatch = -63106;
+
+/**
+ * The bitfile you are trying to use is incompatible with the version
+ * of NI-RIO installed on the target and/or host. Update the version
+ * of NI-RIO on the target and/or host to the same version (or later)
+ * used to compile the bitfile. Alternatively, recompile the bitfile
+ * with the same version of NI-RIO that is currently installed on the
+ * target and/or host.
+ */
+static const NiFpga_Status NiFpga_Status_IncompatibleBitfile = -63107;
+
+/**
+ * Either the supplied resource name is invalid as a RIO resource name, or the
+ * device was not found. Use MAX to find the proper resource name for the
+ * intended device.
+ */
+static const NiFpga_Status NiFpga_Status_InvalidResourceName = -63192;
+
+/**
+ * The requested feature is not supported.
+ */
+static const NiFpga_Status NiFpga_Status_FeatureNotSupported = -63193;
+
+/**
+ * The NI-RIO software on the target system is not compatible with this
+ * software. Upgrade the NI-RIO software on the target system.
+ */
+static const NiFpga_Status NiFpga_Status_VersionMismatch = -63194;
+
+/**
+ * The session is invalid or has been closed.
+ */
+static const NiFpga_Status NiFpga_Status_InvalidSession = -63195;
+
+/**
+ * The maximum number of open FPGA sessions has been reached. Close some open
+ * sessions.
+ */
+static const NiFpga_Status NiFpga_Status_OutOfHandles = -63198;
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Extensions.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Extensions.cpp
new file mode 100644
index 0000000..f289b43
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Extensions.cpp
@@ -0,0 +1,89 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Extensions.h"
+
+#include <llvm/SmallString.h>
+#include <llvm/StringRef.h>
+
+#include "HAL/HAL.h"
+
+#if defined(WIN32) || defined(_WIN32)
+#include <windows.h>
+#else
+#include <dlfcn.h>
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+#define DELIM ';'
+#define HTYPE HMODULE
+#define DLOPEN(a) LoadLibrary(a)
+#define DLSYM GetProcAddress
+#define DLCLOSE FreeLibrary
+#else
+#define DELIM ':'
+#define HTYPE void*
+#define PREFIX "lib"
+#define DLOPEN(a) dlopen(a, RTLD_LAZY)
+#define DLSYM dlsym
+#define DLCLOSE dlclose
+#endif
+
+namespace hal {
+namespace init {
+void InitializeExtensions() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+int HAL_LoadOneExtension(const char* library) {
+  int rc = 1;  // It is expected and reasonable not to find an extra simulation
+  HTYPE handle = DLOPEN(library);
+#if !defined(WIN32) && !defined(_WIN32)
+  if (!handle) {
+    llvm::SmallString<128> libraryName("lib");
+    libraryName += library;
+#if defined(__APPLE__)
+    libraryName += ".dylib";
+#else
+    libraryName += ".so";
+#endif
+    handle = DLOPEN(libraryName.c_str());
+  }
+#endif
+  if (!handle) return rc;
+
+  auto init = reinterpret_cast<halsim_extension_init_func_t*>(
+      DLSYM(handle, "HALSIM_InitExtension"));
+
+  if (init) rc = (*init)();
+
+  if (rc != 0) DLCLOSE(handle);
+  return rc;
+}
+
+/**
+ * Load any extra halsim libraries provided in the HALSIM_EXTENSIONS
+ * environment variable.
+ */
+int HAL_LoadExtensions(void) {
+  int rc = 1;
+  llvm::SmallVector<llvm::StringRef, 2> libraries;
+  const char* e = std::getenv("HALSIM_EXTENSIONS");
+  if (!e) return rc;
+  llvm::StringRef env{e};
+  env.split(libraries, DELIM, -1, false);
+  for (auto& libref : libraries) {
+    llvm::SmallString<128> library(libref);
+    rc = HAL_LoadOneExtension(library.c_str());
+    if (rc < 0) break;
+  }
+  return rc;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/HAL.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/HAL.cpp
new file mode 100644
index 0000000..1014a97
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/HAL.cpp
@@ -0,0 +1,281 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+
+#include <llvm/raw_ostream.h>
+
+#include "ErrorsInternal.h"
+#include "HAL/DriverStation.h"
+#include "HAL/Errors.h"
+#include "HAL/Extensions.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HALInitializer.h"
+#include "MockData/RoboRioDataInternal.h"
+#include "MockHooksInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeHAL() {
+  InitializeHandlesInternal();
+  InitializeAccelerometerData();
+  InitializeAnalogGyroData();
+  InitializeAnalogInData();
+  InitializeAnalogOutData();
+  InitializeAnalogTriggerData();
+  InitializeCanData();
+  InitializeDigitalPWMData();
+  InitializeDIOData();
+  InitializeDriverStationData();
+  InitializeEncoderData();
+  InitializeI2CData();
+  InitializePCMData();
+  InitializePDPData();
+  InitializePWMData();
+  InitializeRelayData();
+  InitializeRoboRioData();
+  InitializeSPIAccelerometerData();
+  InitializeSPIData();
+  InitializeAccelerometer();
+  InitializeAnalogAccumulator();
+  InitializeAnalogGyro();
+  InitializeAnalogInput();
+  InitializeAnalogInternal();
+  InitializeAnalogOutput();
+  InitializeCAN();
+  InitializeCompressor();
+  InitializeConstants();
+  InitializeCounter();
+  InitializeDigitalInternal();
+  InitializeDIO();
+  InitializeDriverStation();
+  InitializeEncoder();
+  InitializeExtensions();
+  InitializeI2C();
+  InitializeInterrupts();
+  InitializeMockHooks();
+  InitializeNotifier();
+  InitializeOSSerialPort();
+  InitializePDP();
+  InitializePorts();
+  InitializePower();
+  InitializePWM();
+  InitializeRelay();
+  InitializeSerialPort();
+  InitializeSolenoid();
+  InitializeSPI();
+  InitializeThreads();
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_PortHandle HAL_GetPort(int32_t channel) {
+  // Dont allow a number that wouldn't fit in a uint8_t
+  if (channel < 0 || channel >= 255) return HAL_kInvalidHandle;
+  return createPortHandle(channel, 1);
+}
+
+/**
+ * @deprecated Uses module numbers
+ */
+HAL_PortHandle HAL_GetPortWithModule(int32_t module, int32_t channel) {
+  // Dont allow a number that wouldn't fit in a uint8_t
+  if (channel < 0 || channel >= 255) return HAL_kInvalidHandle;
+  if (module < 0 || module >= 255) return HAL_kInvalidHandle;
+  return createPortHandle(channel, module);
+}
+
+const char* HAL_GetErrorMessage(int32_t code) {
+  switch (code) {
+    case 0:
+      return "";
+    case CTR_RxTimeout:
+      return CTR_RxTimeout_MESSAGE;
+    case CTR_TxTimeout:
+      return CTR_TxTimeout_MESSAGE;
+    case CTR_InvalidParamValue:
+      return CTR_InvalidParamValue_MESSAGE;
+    case CTR_UnexpectedArbId:
+      return CTR_UnexpectedArbId_MESSAGE;
+    case CTR_TxFailed:
+      return CTR_TxFailed_MESSAGE;
+    case CTR_SigNotUpdated:
+      return CTR_SigNotUpdated_MESSAGE;
+    case NiFpga_Status_FifoTimeout:
+      return NiFpga_Status_FifoTimeout_MESSAGE;
+    case NiFpga_Status_TransferAborted:
+      return NiFpga_Status_TransferAborted_MESSAGE;
+    case NiFpga_Status_MemoryFull:
+      return NiFpga_Status_MemoryFull_MESSAGE;
+    case NiFpga_Status_SoftwareFault:
+      return NiFpga_Status_SoftwareFault_MESSAGE;
+    case NiFpga_Status_InvalidParameter:
+      return NiFpga_Status_InvalidParameter_MESSAGE;
+    case NiFpga_Status_ResourceNotFound:
+      return NiFpga_Status_ResourceNotFound_MESSAGE;
+    case NiFpga_Status_ResourceNotInitialized:
+      return NiFpga_Status_ResourceNotInitialized_MESSAGE;
+    case NiFpga_Status_HardwareFault:
+      return NiFpga_Status_HardwareFault_MESSAGE;
+    case NiFpga_Status_IrqTimeout:
+      return NiFpga_Status_IrqTimeout_MESSAGE;
+    case SAMPLE_RATE_TOO_HIGH:
+      return SAMPLE_RATE_TOO_HIGH_MESSAGE;
+    case VOLTAGE_OUT_OF_RANGE:
+      return VOLTAGE_OUT_OF_RANGE_MESSAGE;
+    case LOOP_TIMING_ERROR:
+      return LOOP_TIMING_ERROR_MESSAGE;
+    case SPI_WRITE_NO_MOSI:
+      return SPI_WRITE_NO_MOSI_MESSAGE;
+    case SPI_READ_NO_MISO:
+      return SPI_READ_NO_MISO_MESSAGE;
+    case SPI_READ_NO_DATA:
+      return SPI_READ_NO_DATA_MESSAGE;
+    case INCOMPATIBLE_STATE:
+      return INCOMPATIBLE_STATE_MESSAGE;
+    case NO_AVAILABLE_RESOURCES:
+      return NO_AVAILABLE_RESOURCES_MESSAGE;
+    case RESOURCE_IS_ALLOCATED:
+      return RESOURCE_IS_ALLOCATED_MESSAGE;
+    case RESOURCE_OUT_OF_RANGE:
+      return RESOURCE_OUT_OF_RANGE_MESSAGE;
+    case HAL_INVALID_ACCUMULATOR_CHANNEL:
+      return HAL_INVALID_ACCUMULATOR_CHANNEL_MESSAGE;
+    case HAL_HANDLE_ERROR:
+      return HAL_HANDLE_ERROR_MESSAGE;
+    case NULL_PARAMETER:
+      return NULL_PARAMETER_MESSAGE;
+    case ANALOG_TRIGGER_LIMIT_ORDER_ERROR:
+      return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE;
+    case ANALOG_TRIGGER_PULSE_OUTPUT_ERROR:
+      return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE;
+    case PARAMETER_OUT_OF_RANGE:
+      return PARAMETER_OUT_OF_RANGE_MESSAGE;
+    case HAL_COUNTER_NOT_SUPPORTED:
+      return HAL_COUNTER_NOT_SUPPORTED_MESSAGE;
+    case HAL_ERR_CANSessionMux_InvalidBuffer:
+      return ERR_CANSessionMux_InvalidBuffer_MESSAGE;
+    case HAL_ERR_CANSessionMux_MessageNotFound:
+      return ERR_CANSessionMux_MessageNotFound_MESSAGE;
+    case HAL_WARN_CANSessionMux_NoToken:
+      return WARN_CANSessionMux_NoToken_MESSAGE;
+    case HAL_ERR_CANSessionMux_NotAllowed:
+      return ERR_CANSessionMux_NotAllowed_MESSAGE;
+    case HAL_ERR_CANSessionMux_NotInitialized:
+      return ERR_CANSessionMux_NotInitialized_MESSAGE;
+    case VI_ERROR_SYSTEM_ERROR:
+      return VI_ERROR_SYSTEM_ERROR_MESSAGE;
+    case VI_ERROR_INV_OBJECT:
+      return VI_ERROR_INV_OBJECT_MESSAGE;
+    case VI_ERROR_RSRC_LOCKED:
+      return VI_ERROR_RSRC_LOCKED_MESSAGE;
+    case VI_ERROR_RSRC_NFOUND:
+      return VI_ERROR_RSRC_NFOUND_MESSAGE;
+    case VI_ERROR_INV_RSRC_NAME:
+      return VI_ERROR_INV_RSRC_NAME_MESSAGE;
+    case VI_ERROR_QUEUE_OVERFLOW:
+      return VI_ERROR_QUEUE_OVERFLOW_MESSAGE;
+    case VI_ERROR_IO:
+      return VI_ERROR_IO_MESSAGE;
+    case VI_ERROR_ASRL_PARITY:
+      return VI_ERROR_ASRL_PARITY_MESSAGE;
+    case VI_ERROR_ASRL_FRAMING:
+      return VI_ERROR_ASRL_FRAMING_MESSAGE;
+    case VI_ERROR_ASRL_OVERRUN:
+      return VI_ERROR_ASRL_OVERRUN_MESSAGE;
+    case VI_ERROR_RSRC_BUSY:
+      return VI_ERROR_RSRC_BUSY_MESSAGE;
+    case VI_ERROR_INV_PARAMETER:
+      return VI_ERROR_INV_PARAMETER_MESSAGE;
+    case HAL_PWM_SCALE_ERROR:
+      return HAL_PWM_SCALE_ERROR_MESSAGE;
+    default:
+      return "Unknown error status";
+  }
+}
+
+/**
+ * Returns the runtime type of this HAL
+ */
+HAL_RuntimeType HAL_GetRuntimeType(void) { return HAL_Mock; }
+
+/**
+ * Return the FPGA Version number.
+ * For now, expect this to be competition year.
+ * @return FPGA Version number.
+ */
+int32_t HAL_GetFPGAVersion(int32_t* status) {
+  return 2018;  // Automatically script this at some point
+}
+
+/**
+ * Return the FPGA Revision number.
+ * The format of the revision is 3 numbers.
+ * The 12 most significant bits are the Major Revision.
+ * the next 8 bits are the Minor Revision.
+ * The 12 least significant bits are the Build Number.
+ * @return FPGA Revision number.
+ */
+int64_t HAL_GetFPGARevision(int32_t* status) {
+  return 0;  // TODO: Find a better number to return;
+}
+
+/**
+ * Read the microsecond-resolution timer on the FPGA.
+ *
+ * @return The current time in microseconds according to the FPGA (since FPGA
+ * reset).
+ */
+uint64_t HAL_GetFPGATime(int32_t* status) { return hal::GetFPGATime(); }
+
+/**
+ * Get the state of the "USER" button on the roboRIO
+ * @return true if the button is currently pressed down
+ */
+HAL_Bool HAL_GetFPGAButton(int32_t* status) {
+  return SimRoboRioData[0].GetFPGAButton();
+}
+
+HAL_Bool HAL_GetSystemActive(int32_t* status) {
+  return true;  // Figure out if we need to handle this
+}
+
+HAL_Bool HAL_GetBrownedOut(int32_t* status) {
+  return false;  // Figure out if we need to detect a brownout condition
+}
+
+HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
+  static std::atomic_bool initialized{false};
+  static wpi::mutex initializeMutex;
+  // Initial check, as if it's true initialization has finished
+  if (initialized) return true;
+
+  std::lock_guard<wpi::mutex> lock(initializeMutex);
+  // Second check in case another thread was waiting
+  if (initialized) return true;
+
+  hal::init::InitializeHAL();
+
+  llvm::outs().SetUnbuffered();
+  if (HAL_LoadExtensions() < 0) return false;
+  hal::RestartTiming();
+  HAL_InitializeDriverStation();
+
+  initialized = true;
+  return true;  // Add initialization if we need to at a later point
+}
+
+int64_t HAL_Report(int32_t resource, int32_t instanceNumber, int32_t context,
+                   const char* feature) {
+  return 0;  // Do nothing for now
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/HALInitializer.h b/third_party/allwpilib_2018/hal/src/main/native/sim/HALInitializer.h
new file mode 100644
index 0000000..92318ee
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/HALInitializer.h
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace hal {
+namespace init {
+extern void InitializeHandlesInternal();
+extern void InitializeAccelerometerData();
+extern void InitializeAnalogGyroData();
+extern void InitializeAnalogInData();
+extern void InitializeAnalogOutData();
+extern void InitializeAnalogTriggerData();
+extern void InitializeCanData();
+extern void InitializeDigitalPWMData();
+extern void InitializeDIOData();
+extern void InitializeDriverStationData();
+extern void InitializeEncoderData();
+extern void InitializeI2CData();
+extern void InitializePCMData();
+extern void InitializePDPData();
+extern void InitializePWMData();
+extern void InitializeRelayData();
+extern void InitializeRoboRioData();
+extern void InitializeSPIAccelerometerData();
+extern void InitializeSPIData();
+extern void InitializeAccelerometer();
+extern void InitializeAnalogAccumulator();
+extern void InitializeAnalogGyro();
+extern void InitializeAnalogInput();
+extern void InitializeAnalogInternal();
+extern void InitializeAnalogOutput();
+extern void InitializeCAN();
+extern void InitializeCompressor();
+extern void InitializeConstants();
+extern void InitializeCounter();
+extern void InitializeDigitalInternal();
+extern void InitializeDIO();
+extern void InitializeDriverStation();
+extern void InitializeEncoder();
+extern void InitializeExtensions();
+extern void InitializeHAL();
+extern void InitializeI2C();
+extern void InitializeInterrupts();
+extern void InitializeMockHooks();
+extern void InitializeNotifier();
+extern void InitializeOSSerialPort();
+extern void InitializePDP();
+extern void InitializePorts();
+extern void InitializePower();
+extern void InitializePWM();
+extern void InitializeRelay();
+extern void InitializeSerialPort();
+extern void InitializeSolenoid();
+extern void InitializeSPI();
+extern void InitializeThreads();
+
+}  // namespace init
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/I2C.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/I2C.cpp
new file mode 100644
index 0000000..7108ed1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/I2C.cpp
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/I2C.h"
+
+#include "MockData/I2CDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeI2C() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) {
+  SimI2CData[port].SetInitialized(true);
+}
+int32_t HAL_TransactionI2C(HAL_I2CPort port, int32_t deviceAddress,
+                           const uint8_t* dataToSend, int32_t sendSize,
+                           uint8_t* dataReceived, int32_t receiveSize) {
+  SimI2CData[port].Write(deviceAddress, dataToSend, sendSize);
+  SimI2CData[port].Read(deviceAddress, dataReceived, receiveSize);
+  return 0;
+}
+int32_t HAL_WriteI2C(HAL_I2CPort port, int32_t deviceAddress,
+                     const uint8_t* dataToSend, int32_t sendSize) {
+  SimI2CData[port].Write(deviceAddress, dataToSend, sendSize);
+  return 0;
+}
+int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer,
+                    int32_t count) {
+  SimI2CData[port].Read(deviceAddress, buffer, count);
+  return 0;
+}
+void HAL_CloseI2C(HAL_I2CPort port) { SimI2CData[port].SetInitialized(false); }
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Interrupts.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Interrupts.cpp
new file mode 100644
index 0000000..27dab1e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Interrupts.cpp
@@ -0,0 +1,570 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Interrupts.h"
+
+#include <memory>
+
+#include <support/condition_variable.h>
+
+#include "AnalogInternal.h"
+#include "DigitalInternal.h"
+#include "ErrorsInternal.h"
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/LimitedHandleResource.h"
+#include "HAL/handles/UnlimitedHandleResource.h"
+#include "MockData/AnalogInDataInternal.h"
+#include "MockData/DIODataInternal.h"
+#include "MockData/HAL_Value.h"
+#include "MockHooksInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+enum WaitResult {
+  Timeout = 0x0,
+  RisingEdge = 0x1,
+  FallingEdge = 0x100,
+  Both = 0x101,
+};
+
+namespace {
+struct Interrupt {
+  bool isAnalog;
+  HAL_Handle portHandle;
+  uint8_t index;
+  HAL_AnalogTriggerType trigType;
+  bool watcher;
+  double risingTimestamp;
+  double fallingTimestamp;
+  bool previousState;
+  bool fireOnUp;
+  bool fireOnDown;
+  int32_t callbackId;
+
+  void* callbackParam;
+  HAL_InterruptHandlerFunction callbackFunction;
+};
+
+struct SynchronousWaitData {
+  HAL_InterruptHandle interruptHandle;
+  wpi::condition_variable waitCond;
+  HAL_Bool waitPredicate;
+};
+}  // namespace
+
+static LimitedHandleResource<HAL_InterruptHandle, Interrupt, kNumInterrupts,
+                             HAL_HandleEnum::Interrupt>* interruptHandles;
+
+typedef HAL_Handle SynchronousWaitDataHandle;
+static UnlimitedHandleResource<SynchronousWaitDataHandle, SynchronousWaitData,
+                               HAL_HandleEnum::Vendor>*
+    synchronousInterruptHandles;
+
+namespace hal {
+namespace init {
+void InitializeInterrupts() {
+  static LimitedHandleResource<HAL_InterruptHandle, Interrupt, kNumInterrupts,
+                               HAL_HandleEnum::Interrupt>
+      iH;
+  interruptHandles = &iH;
+  static UnlimitedHandleResource<SynchronousWaitDataHandle, SynchronousWaitData,
+                                 HAL_HandleEnum::Vendor>
+      siH;
+  synchronousInterruptHandles = &siH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher,
+                                             int32_t* status) {
+  HAL_InterruptHandle handle = interruptHandles->Allocate();
+  if (handle == HAL_kInvalidHandle) {
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto anInterrupt = interruptHandles->Get(handle);
+  if (anInterrupt == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  anInterrupt->index = getHandleIndex(handle);
+  anInterrupt->callbackId = -1;
+
+  anInterrupt->watcher = watcher;
+
+  return handle;
+}
+void HAL_CleanInterrupts(HAL_InterruptHandle interruptHandle, int32_t* status) {
+  HAL_DisableInterrupts(interruptHandle, status);
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  interruptHandles->Free(interruptHandle);
+}
+
+static void ProcessInterruptDigitalSynchronous(const char* name, void* param,
+                                               const struct HAL_Value* value) {
+  // void* is a SynchronousWaitDataHandle.
+  // convert to uintptr_t first, then to handle
+  uintptr_t handleTmp = reinterpret_cast<uintptr_t>(param);
+  SynchronousWaitDataHandle handle =
+      static_cast<SynchronousWaitDataHandle>(handleTmp);
+  auto interruptData = synchronousInterruptHandles->Get(handle);
+  if (interruptData == nullptr) return;
+  auto interrupt = interruptHandles->Get(interruptData->interruptHandle);
+  if (interrupt == nullptr) return;
+  // Have a valid interrupt
+  if (value->type != HAL_Type::HAL_BOOLEAN) return;
+  bool retVal = value->data.v_boolean;
+  // If no change in interrupt, return;
+  if (retVal == interrupt->previousState) return;
+  // If its a falling change, and we dont fire on falling return
+  if (interrupt->previousState && !interrupt->fireOnDown) return;
+  // If its a rising change, and we dont fire on rising return.
+  if (!interrupt->previousState && !interrupt->fireOnUp) return;
+
+  interruptData->waitPredicate = true;
+
+  // Pulse interrupt
+  interruptData->waitCond.notify_all();
+}
+
+static double GetAnalogTriggerValue(HAL_Handle triggerHandle,
+                                    HAL_AnalogTriggerType type,
+                                    int32_t* status) {
+  return HAL_GetAnalogTriggerOutput(triggerHandle, type, status);
+}
+
+static void ProcessInterruptAnalogSynchronous(const char* name, void* param,
+                                              const struct HAL_Value* value) {
+  // void* is a SynchronousWaitDataHandle.
+  // convert to uintptr_t first, then to handle
+  uintptr_t handleTmp = reinterpret_cast<uintptr_t>(param);
+  SynchronousWaitDataHandle handle =
+      static_cast<SynchronousWaitDataHandle>(handleTmp);
+  auto interruptData = synchronousInterruptHandles->Get(handle);
+  if (interruptData == nullptr) return;
+  auto interrupt = interruptHandles->Get(interruptData->interruptHandle);
+  if (interrupt == nullptr) return;
+  // Have a valid interrupt
+  if (value->type != HAL_Type::HAL_DOUBLE) return;
+  int32_t status = 0;
+  bool retVal = GetAnalogTriggerValue(interrupt->portHandle,
+                                      interrupt->trigType, &status);
+  if (status != 0) {
+    // Interrupt and Cancel
+    interruptData->waitPredicate = true;
+    // Pulse interrupt
+    interruptData->waitCond.notify_all();
+  }
+  // If no change in interrupt, return;
+  if (retVal == interrupt->previousState) return;
+  // If its a falling change, and we dont fire on falling return
+  if (interrupt->previousState && !interrupt->fireOnDown) return;
+  // If its a rising change, and we dont fire on rising return.
+  if (!interrupt->previousState && !interrupt->fireOnUp) return;
+
+  interruptData->waitPredicate = true;
+
+  // Pulse interrupt
+  interruptData->waitCond.notify_all();
+}
+
+static int64_t WaitForInterruptDigital(HAL_InterruptHandle handle,
+                                       Interrupt* interrupt, double timeout,
+                                       bool ignorePrevious) {
+  auto data = std::make_shared<SynchronousWaitData>();
+
+  auto dataHandle = synchronousInterruptHandles->Allocate(data);
+  if (dataHandle == HAL_kInvalidHandle) {
+    // Error allocating data
+    return WaitResult::Timeout;
+  }
+
+  // auto data = synchronousInterruptHandles->Get(dataHandle);
+  data->waitPredicate = false;
+  data->interruptHandle = handle;
+
+  int32_t status = 0;
+
+  int32_t digitalIndex = GetDigitalInputChannel(interrupt->portHandle, &status);
+
+  if (status != 0) return WaitResult::Timeout;
+
+  interrupt->previousState = SimDIOData[digitalIndex].GetValue();
+
+  int32_t uid = SimDIOData[digitalIndex].RegisterValueCallback(
+      &ProcessInterruptDigitalSynchronous,
+      reinterpret_cast<void*>(static_cast<uintptr_t>(dataHandle)), false);
+
+  bool timedOut = false;
+
+  wpi::mutex waitMutex;
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+  auto timeoutTime = std::chrono::steady_clock::now() +
+                     std::chrono::duration<int64_t, std::nano>(
+                         static_cast<int64_t>(timeout * 1e9));
+#else
+  auto timeoutTime =
+      std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
+#endif
+
+  {
+    std::unique_lock<wpi::mutex> lock(waitMutex);
+    while (!data->waitPredicate) {
+      if (data->waitCond.wait_until(lock, timeoutTime) ==
+          std::cv_status::timeout) {
+        timedOut = true;
+        break;
+      }
+    }
+  }
+
+  // Cancel our callback
+  SimDIOData[digitalIndex].CancelValueCallback(uid);
+  synchronousInterruptHandles->Free(dataHandle);
+
+  // Check for what to return
+  if (timedOut) return WaitResult::Timeout;
+  // True => false, Falling
+  if (interrupt->previousState) {
+    // Set our return value and our timestamps
+    interrupt->fallingTimestamp = hal::GetFPGATimestamp();
+    return 1 << (8 + interrupt->index);
+  } else {
+    interrupt->risingTimestamp = hal::GetFPGATimestamp();
+    return 1 << (interrupt->index);
+  }
+}
+
+static int64_t WaitForInterruptAnalog(HAL_InterruptHandle handle,
+                                      Interrupt* interrupt, double timeout,
+                                      bool ignorePrevious) {
+  auto data = std::make_shared<SynchronousWaitData>();
+
+  auto dataHandle = synchronousInterruptHandles->Allocate(data);
+  if (dataHandle == HAL_kInvalidHandle) {
+    // Error allocating data
+    return WaitResult::Timeout;
+  }
+
+  data->waitPredicate = false;
+  data->interruptHandle = handle;
+
+  int32_t status = 0;
+  interrupt->previousState = GetAnalogTriggerValue(
+      interrupt->portHandle, interrupt->trigType, &status);
+
+  if (status != 0) return WaitResult::Timeout;
+
+  int32_t analogIndex =
+      GetAnalogTriggerInputIndex(interrupt->portHandle, &status);
+
+  if (status != 0) return WaitResult::Timeout;
+
+  int32_t uid = SimAnalogInData[analogIndex].RegisterVoltageCallback(
+      &ProcessInterruptAnalogSynchronous,
+      reinterpret_cast<void*>(static_cast<uintptr_t>(dataHandle)), false);
+
+  bool timedOut = false;
+
+  wpi::mutex waitMutex;
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+  auto timeoutTime = std::chrono::steady_clock::now() +
+                     std::chrono::duration<int64_t, std::nano>(
+                         static_cast<int64_t>(timeout * 1e9));
+#else
+  auto timeoutTime =
+      std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
+#endif
+
+  {
+    std::unique_lock<wpi::mutex> lock(waitMutex);
+    while (!data->waitPredicate) {
+      if (data->waitCond.wait_until(lock, timeoutTime) ==
+          std::cv_status::timeout) {
+        timedOut = true;
+        break;
+      }
+    }
+  }
+
+  // Cancel our callback
+  SimAnalogInData[analogIndex].CancelVoltageCallback(uid);
+  synchronousInterruptHandles->Free(dataHandle);
+
+  // Check for what to return
+  if (timedOut) return WaitResult::Timeout;
+  // True => false, Falling
+  if (interrupt->previousState) {
+    // Set our return value and our timestamps
+    interrupt->fallingTimestamp = hal::GetFPGATimestamp();
+    return 1 << (8 + interrupt->index);
+  } else {
+    interrupt->risingTimestamp = hal::GetFPGATimestamp();
+    return 1 << (interrupt->index);
+  }
+}
+
+int64_t HAL_WaitForInterrupt(HAL_InterruptHandle interruptHandle,
+                             double timeout, HAL_Bool ignorePrevious,
+                             int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return WaitResult::Timeout;
+  }
+
+  // Check to make sure we are actually an interrupt in synchronous mode
+  if (!interrupt->watcher) {
+    *status = NiFpga_Status_InvalidParameter;
+    return WaitResult::Timeout;
+  }
+
+  if (interrupt->isAnalog) {
+    return WaitForInterruptAnalog(interruptHandle, interrupt.get(), timeout,
+                                  ignorePrevious);
+  } else {
+    return WaitForInterruptDigital(interruptHandle, interrupt.get(), timeout,
+                                   ignorePrevious);
+  }
+}
+
+static void ProcessInterruptDigitalAsynchronous(const char* name, void* param,
+                                                const struct HAL_Value* value) {
+  // void* is a HAL handle
+  // convert to uintptr_t first, then to handle
+  uintptr_t handleTmp = reinterpret_cast<uintptr_t>(param);
+  HAL_InterruptHandle handle = static_cast<HAL_InterruptHandle>(handleTmp);
+  auto interrupt = interruptHandles->Get(handle);
+  if (interrupt == nullptr) return;
+  // Have a valid interrupt
+  if (value->type != HAL_Type::HAL_BOOLEAN) return;
+  bool retVal = value->data.v_boolean;
+  // If no change in interrupt, return;
+  if (retVal == interrupt->previousState) return;
+  int32_t mask = 0;
+  if (interrupt->previousState) {
+    interrupt->previousState = retVal;
+    interrupt->fallingTimestamp = hal::GetFPGATimestamp();
+    mask = 1 << (8 + interrupt->index);
+    if (!interrupt->fireOnDown) return;
+  } else {
+    interrupt->previousState = retVal;
+    interrupt->risingTimestamp = hal::GetFPGATimestamp();
+    mask = 1 << (interrupt->index);
+    if (!interrupt->fireOnUp) return;
+  }
+
+  // run callback
+  auto callback = interrupt->callbackFunction;
+  if (callback == nullptr) return;
+  callback(mask, interrupt->callbackParam);
+}
+
+static void ProcessInterruptAnalogAsynchronous(const char* name, void* param,
+                                               const struct HAL_Value* value) {
+  // void* is a HAL handle
+  // convert to intptr_t first, then to handle
+  uintptr_t handleTmp = reinterpret_cast<uintptr_t>(param);
+  HAL_InterruptHandle handle = static_cast<HAL_InterruptHandle>(handleTmp);
+  auto interrupt = interruptHandles->Get(handle);
+  if (interrupt == nullptr) return;
+  // Have a valid interrupt
+  if (value->type != HAL_Type::HAL_DOUBLE) return;
+  int32_t status = 0;
+  bool retVal = GetAnalogTriggerValue(interrupt->portHandle,
+                                      interrupt->trigType, &status);
+  if (status != 0) return;
+  // If no change in interrupt, return;
+  if (retVal == interrupt->previousState) return;
+  int mask = 0;
+  if (interrupt->previousState) {
+    interrupt->previousState = retVal;
+    interrupt->fallingTimestamp = hal::GetFPGATimestamp();
+    if (!interrupt->fireOnDown) return;
+    mask = 1 << (8 + interrupt->index);
+  } else {
+    interrupt->previousState = retVal;
+    interrupt->risingTimestamp = hal::GetFPGATimestamp();
+    if (!interrupt->fireOnUp) return;
+    mask = 1 << (interrupt->index);
+  }
+
+  // run callback
+  auto callback = interrupt->callbackFunction;
+  if (callback == nullptr) return;
+  callback(mask, interrupt->callbackParam);
+}
+
+static void EnableInterruptsDigital(HAL_InterruptHandle handle,
+                                    Interrupt* interrupt) {
+  int32_t status = 0;
+  int32_t digitalIndex = GetDigitalInputChannel(interrupt->portHandle, &status);
+  if (status != 0) return;
+
+  interrupt->previousState = SimDIOData[digitalIndex].GetValue();
+
+  int32_t uid = SimDIOData[digitalIndex].RegisterValueCallback(
+      &ProcessInterruptDigitalAsynchronous,
+      reinterpret_cast<void*>(static_cast<uintptr_t>(handle)), false);
+  interrupt->callbackId = uid;
+}
+
+static void EnableInterruptsAnalog(HAL_InterruptHandle handle,
+                                   Interrupt* interrupt) {
+  int32_t status = 0;
+  int32_t analogIndex =
+      GetAnalogTriggerInputIndex(interrupt->portHandle, &status);
+  if (status != 0) return;
+
+  status = 0;
+  interrupt->previousState = GetAnalogTriggerValue(
+      interrupt->portHandle, interrupt->trigType, &status);
+  if (status != 0) return;
+
+  int32_t uid = SimAnalogInData[analogIndex].RegisterVoltageCallback(
+      &ProcessInterruptAnalogAsynchronous,
+      reinterpret_cast<void*>(static_cast<uintptr_t>(handle)), false);
+  interrupt->callbackId = uid;
+}
+
+void HAL_EnableInterrupts(HAL_InterruptHandle interruptHandle,
+                          int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  // If we have not had a callback set, error out
+  if (interrupt->callbackFunction == nullptr) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  // EnableInterrupts has already been called
+  if (interrupt->callbackId >= 0) {
+    // We can double enable safely.
+    return;
+  }
+
+  if (interrupt->isAnalog) {
+    EnableInterruptsAnalog(interruptHandle, interrupt.get());
+  } else {
+    EnableInterruptsDigital(interruptHandle, interrupt.get());
+  }
+}
+void HAL_DisableInterrupts(HAL_InterruptHandle interruptHandle,
+                           int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  // No need to disable if we are already disabled
+  if (interrupt->callbackId < 0) return;
+
+  if (interrupt->isAnalog) {
+    // Do analog
+    int32_t status = 0;
+    int32_t analogIndex =
+        GetAnalogTriggerInputIndex(interrupt->portHandle, &status);
+    if (status != 0) return;
+    SimAnalogInData[analogIndex].CancelVoltageCallback(interrupt->callbackId);
+  } else {
+    int32_t status = 0;
+    int32_t digitalIndex =
+        GetDigitalInputChannel(interrupt->portHandle, &status);
+    if (status != 0) return;
+    SimDIOData[digitalIndex].CancelValueCallback(interrupt->callbackId);
+  }
+  interrupt->callbackId = -1;
+}
+double HAL_ReadInterruptRisingTimestamp(HAL_InterruptHandle interruptHandle,
+                                        int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return interrupt->risingTimestamp;
+}
+double HAL_ReadInterruptFallingTimestamp(HAL_InterruptHandle interruptHandle,
+                                         int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return interrupt->fallingTimestamp;
+}
+void HAL_RequestInterrupts(HAL_InterruptHandle interruptHandle,
+                           HAL_Handle digitalSourceHandle,
+                           HAL_AnalogTriggerType analogTriggerType,
+                           int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  bool routingAnalogTrigger = false;
+  uint8_t routingChannel = 0;
+  uint8_t routingModule = 0;
+  bool success =
+      remapDigitalSource(digitalSourceHandle, analogTriggerType, routingChannel,
+                         routingModule, routingAnalogTrigger);
+  if (!success) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  interrupt->isAnalog = routingAnalogTrigger;
+  interrupt->trigType = analogTriggerType;
+  interrupt->portHandle = digitalSourceHandle;
+}
+void HAL_AttachInterruptHandler(HAL_InterruptHandle interruptHandle,
+                                HAL_InterruptHandlerFunction handler,
+                                void* param, int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  interrupt->callbackFunction = handler;
+  interrupt->callbackParam = param;
+}
+
+void HAL_AttachInterruptHandlerThreaded(HAL_InterruptHandle interruptHandle,
+                                        HAL_InterruptHandlerFunction handler,
+                                        void* param, int32_t* status) {
+  HAL_AttachInterruptHandler(interruptHandle, handler, param, status);
+}
+
+void HAL_SetInterruptUpSourceEdge(HAL_InterruptHandle interruptHandle,
+                                  HAL_Bool risingEdge, HAL_Bool fallingEdge,
+                                  int32_t* status) {
+  auto interrupt = interruptHandles->Get(interruptHandle);
+  if (interrupt == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  interrupt->fireOnDown = fallingEdge;
+  interrupt->fireOnUp = risingEdge;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AccelerometerData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AccelerometerData.cpp
new file mode 100644
index 0000000..173d7e3
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AccelerometerData.cpp
@@ -0,0 +1,334 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "AccelerometerDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAccelerometerData() {
+  static AccelerometerData sad[1];
+  ::hal::SimAccelerometerData = sad;
+}
+}  // namespace init
+}  // namespace hal
+
+AccelerometerData* hal::SimAccelerometerData;
+void AccelerometerData::ResetData() {
+  m_active = false;
+  m_activeCallbacks = nullptr;
+  m_range = static_cast<HAL_AccelerometerRange>(0);
+  m_rangeCallbacks = nullptr;
+  m_x = 0.0;
+  m_xCallbacks = nullptr;
+  m_y = 0.0;
+  m_yCallbacks = nullptr;
+  m_z = 0.0;
+  m_zCallbacks = nullptr;
+}
+
+int32_t AccelerometerData::RegisterActiveCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_activeCallbacks =
+        RegisterCallback(m_activeCallbacks, "Active", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetActive());
+    callback("Active", param, &value);
+  }
+  return newUid;
+}
+
+void AccelerometerData::CancelActiveCallback(int32_t uid) {
+  m_activeCallbacks = CancelCallback(m_activeCallbacks, uid);
+}
+
+void AccelerometerData::InvokeActiveCallback(HAL_Value value) {
+  InvokeCallback(m_activeCallbacks, "Active", &value);
+}
+
+HAL_Bool AccelerometerData::GetActive() { return m_active; }
+
+void AccelerometerData::SetActive(HAL_Bool active) {
+  HAL_Bool oldValue = m_active.exchange(active);
+  if (oldValue != active) {
+    InvokeActiveCallback(MakeBoolean(active));
+  }
+}
+
+int32_t AccelerometerData::RegisterRangeCallback(HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_rangeCallbacks =
+        RegisterCallback(m_rangeCallbacks, "Range", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeEnum(GetRange());
+    callback("Range", param, &value);
+  }
+  return newUid;
+}
+
+void AccelerometerData::CancelRangeCallback(int32_t uid) {
+  m_rangeCallbacks = CancelCallback(m_rangeCallbacks, uid);
+}
+
+void AccelerometerData::InvokeRangeCallback(HAL_Value value) {
+  InvokeCallback(m_rangeCallbacks, "Range", &value);
+}
+
+HAL_AccelerometerRange AccelerometerData::GetRange() { return m_range; }
+
+void AccelerometerData::SetRange(HAL_AccelerometerRange range) {
+  HAL_AccelerometerRange oldValue = m_range.exchange(range);
+  if (oldValue != range) {
+    InvokeRangeCallback(MakeEnum(range));
+  }
+}
+
+int32_t AccelerometerData::RegisterXCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_xCallbacks =
+        RegisterCallback(m_xCallbacks, "X", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetX());
+    callback("X", param, &value);
+  }
+  return newUid;
+}
+
+void AccelerometerData::CancelXCallback(int32_t uid) {
+  m_xCallbacks = CancelCallback(m_xCallbacks, uid);
+}
+
+void AccelerometerData::InvokeXCallback(HAL_Value value) {
+  InvokeCallback(m_xCallbacks, "X", &value);
+}
+
+double AccelerometerData::GetX() { return m_x; }
+
+void AccelerometerData::SetX(double x) {
+  double oldValue = m_x.exchange(x);
+  if (oldValue != x) {
+    InvokeXCallback(MakeDouble(x));
+  }
+}
+
+int32_t AccelerometerData::RegisterYCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_yCallbacks =
+        RegisterCallback(m_yCallbacks, "Y", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetY());
+    callback("Y", param, &value);
+  }
+  return newUid;
+}
+
+void AccelerometerData::CancelYCallback(int32_t uid) {
+  m_yCallbacks = CancelCallback(m_yCallbacks, uid);
+}
+
+void AccelerometerData::InvokeYCallback(HAL_Value value) {
+  InvokeCallback(m_yCallbacks, "Y", &value);
+}
+
+double AccelerometerData::GetY() { return m_y; }
+
+void AccelerometerData::SetY(double y) {
+  double oldValue = m_y.exchange(y);
+  if (oldValue != y) {
+    InvokeYCallback(MakeDouble(y));
+  }
+}
+
+int32_t AccelerometerData::RegisterZCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_zCallbacks =
+        RegisterCallback(m_zCallbacks, "Z", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetZ());
+    callback("Z", param, &value);
+  }
+  return newUid;
+}
+
+void AccelerometerData::CancelZCallback(int32_t uid) {
+  m_zCallbacks = CancelCallback(m_zCallbacks, uid);
+}
+
+void AccelerometerData::InvokeZCallback(HAL_Value value) {
+  InvokeCallback(m_zCallbacks, "Z", &value);
+}
+
+double AccelerometerData::GetZ() { return m_z; }
+
+void AccelerometerData::SetZ(double z) {
+  double oldValue = m_z.exchange(z);
+  if (oldValue != z) {
+    InvokeZCallback(MakeDouble(z));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetAccelerometerData(int32_t index) {
+  SimAccelerometerData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterAccelerometerActiveCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimAccelerometerData[index].RegisterActiveCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelAccelerometerActiveCallback(int32_t index, int32_t uid) {
+  SimAccelerometerData[index].CancelActiveCallback(uid);
+}
+
+HAL_Bool HALSIM_GetAccelerometerActive(int32_t index) {
+  return SimAccelerometerData[index].GetActive();
+}
+
+void HALSIM_SetAccelerometerActive(int32_t index, HAL_Bool active) {
+  SimAccelerometerData[index].SetActive(active);
+}
+
+int32_t HALSIM_RegisterAccelerometerRangeCallback(int32_t index,
+                                                  HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  return SimAccelerometerData[index].RegisterRangeCallback(callback, param,
+                                                           initialNotify);
+}
+
+void HALSIM_CancelAccelerometerRangeCallback(int32_t index, int32_t uid) {
+  SimAccelerometerData[index].CancelRangeCallback(uid);
+}
+
+HAL_AccelerometerRange HALSIM_GetAccelerometerRange(int32_t index) {
+  return SimAccelerometerData[index].GetRange();
+}
+
+void HALSIM_SetAccelerometerRange(int32_t index, HAL_AccelerometerRange range) {
+  SimAccelerometerData[index].SetRange(range);
+}
+
+int32_t HALSIM_RegisterAccelerometerXCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimAccelerometerData[index].RegisterXCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelAccelerometerXCallback(int32_t index, int32_t uid) {
+  SimAccelerometerData[index].CancelXCallback(uid);
+}
+
+double HALSIM_GetAccelerometerX(int32_t index) {
+  return SimAccelerometerData[index].GetX();
+}
+
+void HALSIM_SetAccelerometerX(int32_t index, double x) {
+  SimAccelerometerData[index].SetX(x);
+}
+
+int32_t HALSIM_RegisterAccelerometerYCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimAccelerometerData[index].RegisterYCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelAccelerometerYCallback(int32_t index, int32_t uid) {
+  SimAccelerometerData[index].CancelYCallback(uid);
+}
+
+double HALSIM_GetAccelerometerY(int32_t index) {
+  return SimAccelerometerData[index].GetY();
+}
+
+void HALSIM_SetAccelerometerY(int32_t index, double y) {
+  SimAccelerometerData[index].SetY(y);
+}
+
+int32_t HALSIM_RegisterAccelerometerZCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimAccelerometerData[index].RegisterZCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelAccelerometerZCallback(int32_t index, int32_t uid) {
+  SimAccelerometerData[index].CancelZCallback(uid);
+}
+
+double HALSIM_GetAccelerometerZ(int32_t index) {
+  return SimAccelerometerData[index].GetZ();
+}
+
+void HALSIM_SetAccelerometerZ(int32_t index, double z) {
+  SimAccelerometerData[index].SetZ(z);
+}
+
+void HALSIM_RegisterAccelerometerAllCallbacks(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  SimAccelerometerData[index].RegisterActiveCallback(callback, param,
+                                                     initialNotify);
+  SimAccelerometerData[index].RegisterRangeCallback(callback, param,
+                                                    initialNotify);
+  SimAccelerometerData[index].RegisterXCallback(callback, param, initialNotify);
+  SimAccelerometerData[index].RegisterYCallback(callback, param, initialNotify);
+  SimAccelerometerData[index].RegisterZCallback(callback, param, initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AccelerometerDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AccelerometerDataInternal.h
new file mode 100644
index 0000000..08efbc6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AccelerometerDataInternal.h
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/AccelerometerData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class AccelerometerData {
+ public:
+  int32_t RegisterActiveCallback(HAL_NotifyCallback callback, void* param,
+                                 HAL_Bool initialNotify);
+  void CancelActiveCallback(int32_t uid);
+  void InvokeActiveCallback(HAL_Value value);
+  HAL_Bool GetActive();
+  void SetActive(HAL_Bool active);
+
+  int32_t RegisterRangeCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelRangeCallback(int32_t uid);
+  void InvokeRangeCallback(HAL_Value value);
+  HAL_AccelerometerRange GetRange();
+  void SetRange(HAL_AccelerometerRange range);
+
+  int32_t RegisterXCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelXCallback(int32_t uid);
+  void InvokeXCallback(HAL_Value value);
+  double GetX();
+  void SetX(double x);
+
+  int32_t RegisterYCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelYCallback(int32_t uid);
+  void InvokeYCallback(HAL_Value value);
+  double GetY();
+  void SetY(double y);
+
+  int32_t RegisterZCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelZCallback(int32_t uid);
+  void InvokeZCallback(HAL_Value value);
+  double GetZ();
+  void SetZ(double z);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_active{false};
+  std::shared_ptr<NotifyListenerVector> m_activeCallbacks = nullptr;
+  std::atomic<HAL_AccelerometerRange> m_range{
+      static_cast<HAL_AccelerometerRange>(0)};
+  std::shared_ptr<NotifyListenerVector> m_rangeCallbacks = nullptr;
+  std::atomic<double> m_x{0.0};
+  std::shared_ptr<NotifyListenerVector> m_xCallbacks = nullptr;
+  std::atomic<double> m_y{0.0};
+  std::shared_ptr<NotifyListenerVector> m_yCallbacks = nullptr;
+  std::atomic<double> m_z{0.0};
+  std::shared_ptr<NotifyListenerVector> m_zCallbacks = nullptr;
+};
+extern AccelerometerData* SimAccelerometerData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogGyroData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogGyroData.cpp
new file mode 100644
index 0000000..cce0586
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogGyroData.cpp
@@ -0,0 +1,215 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "AnalogGyroDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogGyroData() {
+  static AnalogGyroData agd[kNumAccumulators];
+  ::hal::SimAnalogGyroData = agd;
+}
+}  // namespace init
+}  // namespace hal
+
+AnalogGyroData* hal::SimAnalogGyroData;
+void AnalogGyroData::ResetData() {
+  m_angle = 0.0;
+  m_angleCallbacks = nullptr;
+  m_rate = 0.0;
+  m_rateCallbacks = nullptr;
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+}
+
+int32_t AnalogGyroData::RegisterAngleCallback(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_angleCallbacks =
+        RegisterCallback(m_angleCallbacks, "Angle", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetAngle());
+    callback("Angle", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogGyroData::CancelAngleCallback(int32_t uid) {
+  m_angleCallbacks = CancelCallback(m_angleCallbacks, uid);
+}
+
+void AnalogGyroData::InvokeAngleCallback(HAL_Value value) {
+  InvokeCallback(m_angleCallbacks, "Angle", &value);
+}
+
+double AnalogGyroData::GetAngle() { return m_angle; }
+
+void AnalogGyroData::SetAngle(double angle) {
+  double oldValue = m_angle.exchange(angle);
+  if (oldValue != angle) {
+    InvokeAngleCallback(MakeDouble(angle));
+  }
+}
+
+int32_t AnalogGyroData::RegisterRateCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_rateCallbacks =
+        RegisterCallback(m_rateCallbacks, "Rate", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetRate());
+    callback("Rate", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogGyroData::CancelRateCallback(int32_t uid) {
+  m_rateCallbacks = CancelCallback(m_rateCallbacks, uid);
+}
+
+void AnalogGyroData::InvokeRateCallback(HAL_Value value) {
+  InvokeCallback(m_rateCallbacks, "Rate", &value);
+}
+
+double AnalogGyroData::GetRate() { return m_rate; }
+
+void AnalogGyroData::SetRate(double rate) {
+  double oldValue = m_rate.exchange(rate);
+  if (oldValue != rate) {
+    InvokeRateCallback(MakeDouble(rate));
+  }
+}
+
+int32_t AnalogGyroData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogGyroData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void AnalogGyroData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool AnalogGyroData::GetInitialized() { return m_initialized; }
+
+void AnalogGyroData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetAnalogGyroData(int32_t index) {
+  SimAnalogGyroData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterAnalogGyroAngleCallback(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  return SimAnalogGyroData[index].RegisterAngleCallback(callback, param,
+                                                        initialNotify);
+}
+
+void HALSIM_CancelAnalogGyroAngleCallback(int32_t index, int32_t uid) {
+  SimAnalogGyroData[index].CancelAngleCallback(uid);
+}
+
+double HALSIM_GetAnalogGyroAngle(int32_t index) {
+  return SimAnalogGyroData[index].GetAngle();
+}
+
+void HALSIM_SetAnalogGyroAngle(int32_t index, double angle) {
+  SimAnalogGyroData[index].SetAngle(angle);
+}
+
+int32_t HALSIM_RegisterAnalogGyroRateCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimAnalogGyroData[index].RegisterRateCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelAnalogGyroRateCallback(int32_t index, int32_t uid) {
+  SimAnalogGyroData[index].CancelRateCallback(uid);
+}
+
+double HALSIM_GetAnalogGyroRate(int32_t index) {
+  return SimAnalogGyroData[index].GetRate();
+}
+
+void HALSIM_SetAnalogGyroRate(int32_t index, double rate) {
+  SimAnalogGyroData[index].SetRate(rate);
+}
+
+int32_t HALSIM_RegisterAnalogGyroInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogGyroData[index].RegisterInitializedCallback(callback, param,
+                                                              initialNotify);
+}
+
+void HALSIM_CancelAnalogGyroInitializedCallback(int32_t index, int32_t uid) {
+  SimAnalogGyroData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetAnalogGyroInitialized(int32_t index) {
+  return SimAnalogGyroData[index].GetInitialized();
+}
+
+void HALSIM_SetAnalogGyroInitialized(int32_t index, HAL_Bool initialized) {
+  SimAnalogGyroData[index].SetInitialized(initialized);
+}
+
+void HALSIM_RegisterAnalogGyroAllCallbacks(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  SimAnalogGyroData[index].RegisterAngleCallback(callback, param,
+                                                 initialNotify);
+  SimAnalogGyroData[index].RegisterRateCallback(callback, param, initialNotify);
+  SimAnalogGyroData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogGyroDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogGyroDataInternal.h
new file mode 100644
index 0000000..180d7ef
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogGyroDataInternal.h
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/AnalogGyroData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class AnalogGyroData {
+ public:
+  int32_t RegisterAngleCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelAngleCallback(int32_t uid);
+  void InvokeAngleCallback(HAL_Value value);
+  double GetAngle();
+  void SetAngle(double angle);
+
+  int32_t RegisterRateCallback(HAL_NotifyCallback callback, void* param,
+                               HAL_Bool initialNotify);
+  void CancelRateCallback(int32_t uid);
+  void InvokeRateCallback(HAL_Value value);
+  double GetRate();
+  void SetRate(double rate);
+
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<double> m_angle{0.0};
+  std::shared_ptr<NotifyListenerVector> m_angleCallbacks = nullptr;
+  std::atomic<double> m_rate{0.0};
+  std::shared_ptr<NotifyListenerVector> m_rateCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+};
+extern AnalogGyroData* SimAnalogGyroData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogInData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogInData.cpp
new file mode 100644
index 0000000..79f7a22
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogInData.cpp
@@ -0,0 +1,585 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "AnalogInDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogInData() {
+  static AnalogInData sind[kNumAnalogInputs];
+  ::hal::SimAnalogInData = sind;
+}
+}  // namespace init
+}  // namespace hal
+
+AnalogInData* hal::SimAnalogInData;
+void AnalogInData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_averageBits = 7;
+  m_averageBitsCallbacks = nullptr;
+  m_oversampleBits = 0;
+  m_oversampleBitsCallbacks = nullptr;
+  m_voltage = 0.0;
+  m_voltageCallbacks = nullptr;
+  m_accumulatorInitialized = false;
+  m_accumulatorInitializedCallbacks = nullptr;
+  m_accumulatorValue = 0;
+  m_accumulatorValueCallbacks = nullptr;
+  m_accumulatorCount = 0;
+  m_accumulatorCountCallbacks = nullptr;
+  m_accumulatorCenter = 0;
+  m_accumulatorCenterCallbacks = nullptr;
+  m_accumulatorDeadband = 0;
+  m_accumulatorDeadbandCallbacks = nullptr;
+}
+
+int32_t AnalogInData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void AnalogInData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool AnalogInData::GetInitialized() { return m_initialized; }
+
+void AnalogInData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t AnalogInData::RegisterAverageBitsCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_averageBitsCallbacks = RegisterCallback(
+        m_averageBitsCallbacks, "AverageBits", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetAverageBits());
+    callback("AverageBits", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelAverageBitsCallback(int32_t uid) {
+  m_averageBitsCallbacks = CancelCallback(m_averageBitsCallbacks, uid);
+}
+
+void AnalogInData::InvokeAverageBitsCallback(HAL_Value value) {
+  InvokeCallback(m_averageBitsCallbacks, "AverageBits", &value);
+}
+
+int32_t AnalogInData::GetAverageBits() { return m_averageBits; }
+
+void AnalogInData::SetAverageBits(int32_t averageBits) {
+  int32_t oldValue = m_averageBits.exchange(averageBits);
+  if (oldValue != averageBits) {
+    InvokeAverageBitsCallback(MakeInt(averageBits));
+  }
+}
+
+int32_t AnalogInData::RegisterOversampleBitsCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_oversampleBitsCallbacks = RegisterCallback(
+        m_oversampleBitsCallbacks, "OversampleBits", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetOversampleBits());
+    callback("OversampleBits", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelOversampleBitsCallback(int32_t uid) {
+  m_oversampleBitsCallbacks = CancelCallback(m_oversampleBitsCallbacks, uid);
+}
+
+void AnalogInData::InvokeOversampleBitsCallback(HAL_Value value) {
+  InvokeCallback(m_oversampleBitsCallbacks, "OversampleBits", &value);
+}
+
+int32_t AnalogInData::GetOversampleBits() { return m_oversampleBits; }
+
+void AnalogInData::SetOversampleBits(int32_t oversampleBits) {
+  int32_t oldValue = m_oversampleBits.exchange(oversampleBits);
+  if (oldValue != oversampleBits) {
+    InvokeOversampleBitsCallback(MakeInt(oversampleBits));
+  }
+}
+
+int32_t AnalogInData::RegisterVoltageCallback(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_voltageCallbacks = RegisterCallback(m_voltageCallbacks, "Voltage",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetVoltage());
+    callback("Voltage", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelVoltageCallback(int32_t uid) {
+  m_voltageCallbacks = CancelCallback(m_voltageCallbacks, uid);
+}
+
+void AnalogInData::InvokeVoltageCallback(HAL_Value value) {
+  InvokeCallback(m_voltageCallbacks, "Voltage", &value);
+}
+
+double AnalogInData::GetVoltage() { return m_voltage; }
+
+void AnalogInData::SetVoltage(double voltage) {
+  double oldValue = m_voltage.exchange(voltage);
+  if (oldValue != voltage) {
+    InvokeVoltageCallback(MakeDouble(voltage));
+  }
+}
+
+int32_t AnalogInData::RegisterAccumulatorInitializedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_accumulatorInitializedCallbacks =
+        RegisterCallback(m_accumulatorInitializedCallbacks,
+                         "AccumulatorInitialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetAccumulatorInitialized());
+    callback("AccumulatorInitialized", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelAccumulatorInitializedCallback(int32_t uid) {
+  m_accumulatorInitializedCallbacks =
+      CancelCallback(m_accumulatorInitializedCallbacks, uid);
+}
+
+void AnalogInData::InvokeAccumulatorInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_accumulatorInitializedCallbacks, "AccumulatorInitialized",
+                 &value);
+}
+
+HAL_Bool AnalogInData::GetAccumulatorInitialized() {
+  return m_accumulatorInitialized;
+}
+
+void AnalogInData::SetAccumulatorInitialized(HAL_Bool accumulatorInitialized) {
+  HAL_Bool oldValue = m_accumulatorInitialized.exchange(accumulatorInitialized);
+  if (oldValue != accumulatorInitialized) {
+    InvokeAccumulatorInitializedCallback(MakeBoolean(accumulatorInitialized));
+  }
+}
+
+int32_t AnalogInData::RegisterAccumulatorValueCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_accumulatorValueCallbacks =
+        RegisterCallback(m_accumulatorValueCallbacks, "AccumulatorValue",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeLong(GetAccumulatorValue());
+    callback("AccumulatorValue", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelAccumulatorValueCallback(int32_t uid) {
+  m_accumulatorValueCallbacks =
+      CancelCallback(m_accumulatorValueCallbacks, uid);
+}
+
+void AnalogInData::InvokeAccumulatorValueCallback(HAL_Value value) {
+  InvokeCallback(m_accumulatorValueCallbacks, "AccumulatorValue", &value);
+}
+
+int64_t AnalogInData::GetAccumulatorValue() { return m_accumulatorValue; }
+
+void AnalogInData::SetAccumulatorValue(int64_t accumulatorValue) {
+  int64_t oldValue = m_accumulatorValue.exchange(accumulatorValue);
+  if (oldValue != accumulatorValue) {
+    InvokeAccumulatorValueCallback(MakeLong(accumulatorValue));
+  }
+}
+
+int32_t AnalogInData::RegisterAccumulatorCountCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_accumulatorCountCallbacks =
+        RegisterCallback(m_accumulatorCountCallbacks, "AccumulatorCount",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeLong(GetAccumulatorCount());
+    callback("AccumulatorCount", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelAccumulatorCountCallback(int32_t uid) {
+  m_accumulatorCountCallbacks =
+      CancelCallback(m_accumulatorCountCallbacks, uid);
+}
+
+void AnalogInData::InvokeAccumulatorCountCallback(HAL_Value value) {
+  InvokeCallback(m_accumulatorCountCallbacks, "AccumulatorCount", &value);
+}
+
+int64_t AnalogInData::GetAccumulatorCount() { return m_accumulatorCount; }
+
+void AnalogInData::SetAccumulatorCount(int64_t accumulatorCount) {
+  int64_t oldValue = m_accumulatorCount.exchange(accumulatorCount);
+  if (oldValue != accumulatorCount) {
+    InvokeAccumulatorCountCallback(MakeLong(accumulatorCount));
+  }
+}
+
+int32_t AnalogInData::RegisterAccumulatorCenterCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_accumulatorCenterCallbacks =
+        RegisterCallback(m_accumulatorCenterCallbacks, "AccumulatorCenter",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetAccumulatorCenter());
+    callback("AccumulatorCenter", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelAccumulatorCenterCallback(int32_t uid) {
+  m_accumulatorCenterCallbacks =
+      CancelCallback(m_accumulatorCenterCallbacks, uid);
+}
+
+void AnalogInData::InvokeAccumulatorCenterCallback(HAL_Value value) {
+  InvokeCallback(m_accumulatorCenterCallbacks, "AccumulatorCenter", &value);
+}
+
+int32_t AnalogInData::GetAccumulatorCenter() { return m_accumulatorCenter; }
+
+void AnalogInData::SetAccumulatorCenter(int32_t accumulatorCenter) {
+  int32_t oldValue = m_accumulatorCenter.exchange(accumulatorCenter);
+  if (oldValue != accumulatorCenter) {
+    InvokeAccumulatorCenterCallback(MakeInt(accumulatorCenter));
+  }
+}
+
+int32_t AnalogInData::RegisterAccumulatorDeadbandCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_accumulatorDeadbandCallbacks =
+        RegisterCallback(m_accumulatorDeadbandCallbacks, "AccumulatorDeadband",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetAccumulatorDeadband());
+    callback("AccumulatorDeadband", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogInData::CancelAccumulatorDeadbandCallback(int32_t uid) {
+  m_accumulatorDeadbandCallbacks =
+      CancelCallback(m_accumulatorDeadbandCallbacks, uid);
+}
+
+void AnalogInData::InvokeAccumulatorDeadbandCallback(HAL_Value value) {
+  InvokeCallback(m_accumulatorDeadbandCallbacks, "AccumulatorDeadband", &value);
+}
+
+int32_t AnalogInData::GetAccumulatorDeadband() { return m_accumulatorDeadband; }
+
+void AnalogInData::SetAccumulatorDeadband(int32_t accumulatorDeadband) {
+  int32_t oldValue = m_accumulatorDeadband.exchange(accumulatorDeadband);
+  if (oldValue != accumulatorDeadband) {
+    InvokeAccumulatorDeadbandCallback(MakeInt(accumulatorDeadband));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetAnalogInData(int32_t index) {
+  SimAnalogInData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterAnalogInInitializedCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterInitializedCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelAnalogInInitializedCallback(int32_t index, int32_t uid) {
+  SimAnalogInData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetAnalogInInitialized(int32_t index) {
+  return SimAnalogInData[index].GetInitialized();
+}
+
+void HALSIM_SetAnalogInInitialized(int32_t index, HAL_Bool initialized) {
+  SimAnalogInData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterAnalogInAverageBitsCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterAverageBitsCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelAnalogInAverageBitsCallback(int32_t index, int32_t uid) {
+  SimAnalogInData[index].CancelAverageBitsCallback(uid);
+}
+
+int32_t HALSIM_GetAnalogInAverageBits(int32_t index) {
+  return SimAnalogInData[index].GetAverageBits();
+}
+
+void HALSIM_SetAnalogInAverageBits(int32_t index, int32_t averageBits) {
+  SimAnalogInData[index].SetAverageBits(averageBits);
+}
+
+int32_t HALSIM_RegisterAnalogInOversampleBitsCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterOversampleBitsCallback(callback, param,
+                                                               initialNotify);
+}
+
+void HALSIM_CancelAnalogInOversampleBitsCallback(int32_t index, int32_t uid) {
+  SimAnalogInData[index].CancelOversampleBitsCallback(uid);
+}
+
+int32_t HALSIM_GetAnalogInOversampleBits(int32_t index) {
+  return SimAnalogInData[index].GetOversampleBits();
+}
+
+void HALSIM_SetAnalogInOversampleBits(int32_t index, int32_t oversampleBits) {
+  SimAnalogInData[index].SetOversampleBits(oversampleBits);
+}
+
+int32_t HALSIM_RegisterAnalogInVoltageCallback(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterVoltageCallback(callback, param,
+                                                        initialNotify);
+}
+
+void HALSIM_CancelAnalogInVoltageCallback(int32_t index, int32_t uid) {
+  SimAnalogInData[index].CancelVoltageCallback(uid);
+}
+
+double HALSIM_GetAnalogInVoltage(int32_t index) {
+  return SimAnalogInData[index].GetVoltage();
+}
+
+void HALSIM_SetAnalogInVoltage(int32_t index, double voltage) {
+  SimAnalogInData[index].SetVoltage(voltage);
+}
+
+int32_t HALSIM_RegisterAnalogInAccumulatorInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterAccumulatorInitializedCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogInAccumulatorInitializedCallback(int32_t index,
+                                                         int32_t uid) {
+  SimAnalogInData[index].CancelAccumulatorInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetAnalogInAccumulatorInitialized(int32_t index) {
+  return SimAnalogInData[index].GetAccumulatorInitialized();
+}
+
+void HALSIM_SetAnalogInAccumulatorInitialized(int32_t index,
+                                              HAL_Bool accumulatorInitialized) {
+  SimAnalogInData[index].SetAccumulatorInitialized(accumulatorInitialized);
+}
+
+int32_t HALSIM_RegisterAnalogInAccumulatorValueCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterAccumulatorValueCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogInAccumulatorValueCallback(int32_t index, int32_t uid) {
+  SimAnalogInData[index].CancelAccumulatorValueCallback(uid);
+}
+
+int64_t HALSIM_GetAnalogInAccumulatorValue(int32_t index) {
+  return SimAnalogInData[index].GetAccumulatorValue();
+}
+
+void HALSIM_SetAnalogInAccumulatorValue(int32_t index,
+                                        int64_t accumulatorValue) {
+  SimAnalogInData[index].SetAccumulatorValue(accumulatorValue);
+}
+
+int32_t HALSIM_RegisterAnalogInAccumulatorCountCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterAccumulatorCountCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogInAccumulatorCountCallback(int32_t index, int32_t uid) {
+  SimAnalogInData[index].CancelAccumulatorCountCallback(uid);
+}
+
+int64_t HALSIM_GetAnalogInAccumulatorCount(int32_t index) {
+  return SimAnalogInData[index].GetAccumulatorCount();
+}
+
+void HALSIM_SetAnalogInAccumulatorCount(int32_t index,
+                                        int64_t accumulatorCount) {
+  SimAnalogInData[index].SetAccumulatorCount(accumulatorCount);
+}
+
+int32_t HALSIM_RegisterAnalogInAccumulatorCenterCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterAccumulatorCenterCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogInAccumulatorCenterCallback(int32_t index,
+                                                    int32_t uid) {
+  SimAnalogInData[index].CancelAccumulatorCenterCallback(uid);
+}
+
+int32_t HALSIM_GetAnalogInAccumulatorCenter(int32_t index) {
+  return SimAnalogInData[index].GetAccumulatorCenter();
+}
+
+void HALSIM_SetAnalogInAccumulatorCenter(int32_t index,
+                                         int32_t accumulatorCenter) {
+  SimAnalogInData[index].SetAccumulatorCenter(accumulatorCenter);
+}
+
+int32_t HALSIM_RegisterAnalogInAccumulatorDeadbandCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogInData[index].RegisterAccumulatorDeadbandCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogInAccumulatorDeadbandCallback(int32_t index,
+                                                      int32_t uid) {
+  SimAnalogInData[index].CancelAccumulatorDeadbandCallback(uid);
+}
+
+int32_t HALSIM_GetAnalogInAccumulatorDeadband(int32_t index) {
+  return SimAnalogInData[index].GetAccumulatorDeadband();
+}
+
+void HALSIM_SetAnalogInAccumulatorDeadband(int32_t index,
+                                           int32_t accumulatorDeadband) {
+  SimAnalogInData[index].SetAccumulatorDeadband(accumulatorDeadband);
+}
+
+void HALSIM_RegisterAnalogInAllCallbacks(int32_t index,
+                                         HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify) {
+  SimAnalogInData[index].RegisterInitializedCallback(callback, param,
+                                                     initialNotify);
+  SimAnalogInData[index].RegisterAverageBitsCallback(callback, param,
+                                                     initialNotify);
+  SimAnalogInData[index].RegisterOversampleBitsCallback(callback, param,
+                                                        initialNotify);
+  SimAnalogInData[index].RegisterVoltageCallback(callback, param,
+                                                 initialNotify);
+  SimAnalogInData[index].RegisterAccumulatorInitializedCallback(callback, param,
+                                                                initialNotify);
+  SimAnalogInData[index].RegisterAccumulatorValueCallback(callback, param,
+                                                          initialNotify);
+  SimAnalogInData[index].RegisterAccumulatorCountCallback(callback, param,
+                                                          initialNotify);
+  SimAnalogInData[index].RegisterAccumulatorCenterCallback(callback, param,
+                                                           initialNotify);
+  SimAnalogInData[index].RegisterAccumulatorDeadbandCallback(callback, param,
+                                                             initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogInDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogInDataInternal.h
new file mode 100644
index 0000000..5000e16
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogInDataInternal.h
@@ -0,0 +1,113 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/AnalogInData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class AnalogInData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterAverageBitsCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelAverageBitsCallback(int32_t uid);
+  void InvokeAverageBitsCallback(HAL_Value value);
+  int32_t GetAverageBits();
+  void SetAverageBits(int32_t averageBits);
+
+  int32_t RegisterOversampleBitsCallback(HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+  void CancelOversampleBitsCallback(int32_t uid);
+  void InvokeOversampleBitsCallback(HAL_Value value);
+  int32_t GetOversampleBits();
+  void SetOversampleBits(int32_t oversampleBits);
+
+  int32_t RegisterVoltageCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelVoltageCallback(int32_t uid);
+  void InvokeVoltageCallback(HAL_Value value);
+  double GetVoltage();
+  void SetVoltage(double voltage);
+
+  int32_t RegisterAccumulatorInitializedCallback(HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify);
+  void CancelAccumulatorInitializedCallback(int32_t uid);
+  void InvokeAccumulatorInitializedCallback(HAL_Value value);
+  HAL_Bool GetAccumulatorInitialized();
+  void SetAccumulatorInitialized(HAL_Bool accumulatorInitialized);
+
+  int32_t RegisterAccumulatorValueCallback(HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+  void CancelAccumulatorValueCallback(int32_t uid);
+  void InvokeAccumulatorValueCallback(HAL_Value value);
+  int64_t GetAccumulatorValue();
+  void SetAccumulatorValue(int64_t accumulatorValue);
+
+  int32_t RegisterAccumulatorCountCallback(HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+  void CancelAccumulatorCountCallback(int32_t uid);
+  void InvokeAccumulatorCountCallback(HAL_Value value);
+  int64_t GetAccumulatorCount();
+  void SetAccumulatorCount(int64_t accumulatorCount);
+
+  int32_t RegisterAccumulatorCenterCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+  void CancelAccumulatorCenterCallback(int32_t uid);
+  void InvokeAccumulatorCenterCallback(HAL_Value value);
+  int32_t GetAccumulatorCenter();
+  void SetAccumulatorCenter(int32_t accumulatorCenter);
+
+  int32_t RegisterAccumulatorDeadbandCallback(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+  void CancelAccumulatorDeadbandCallback(int32_t uid);
+  void InvokeAccumulatorDeadbandCallback(HAL_Value value);
+  int32_t GetAccumulatorDeadband();
+  void SetAccumulatorDeadband(int32_t accumulatorDeadband);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<int32_t> m_averageBits{7};
+  std::shared_ptr<NotifyListenerVector> m_averageBitsCallbacks = nullptr;
+  std::atomic<int32_t> m_oversampleBits{0};
+  std::shared_ptr<NotifyListenerVector> m_oversampleBitsCallbacks = nullptr;
+  std::atomic<double> m_voltage{0.0};
+  std::shared_ptr<NotifyListenerVector> m_voltageCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_accumulatorInitialized{false};
+  std::shared_ptr<NotifyListenerVector> m_accumulatorInitializedCallbacks =
+      nullptr;
+  std::atomic<int64_t> m_accumulatorValue{0};
+  std::shared_ptr<NotifyListenerVector> m_accumulatorValueCallbacks = nullptr;
+  std::atomic<int64_t> m_accumulatorCount{0};
+  std::shared_ptr<NotifyListenerVector> m_accumulatorCountCallbacks = nullptr;
+  std::atomic<int32_t> m_accumulatorCenter{0};
+  std::shared_ptr<NotifyListenerVector> m_accumulatorCenterCallbacks = nullptr;
+  std::atomic<int32_t> m_accumulatorDeadband{0};
+  std::shared_ptr<NotifyListenerVector> m_accumulatorDeadbandCallbacks =
+      nullptr;
+};
+extern AnalogInData* SimAnalogInData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogOutData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogOutData.cpp
new file mode 100644
index 0000000..a13c573
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogOutData.cpp
@@ -0,0 +1,156 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "AnalogOutDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogOutData() {
+  static AnalogOutData siod[kNumAnalogOutputs];
+  ::hal::SimAnalogOutData = siod;
+}
+}  // namespace init
+}  // namespace hal
+
+AnalogOutData* hal::SimAnalogOutData;
+void AnalogOutData::ResetData() {
+  m_voltage = 0.0;
+  m_voltageCallbacks = nullptr;
+  m_initialized = 0;
+  m_initializedCallbacks = nullptr;
+}
+
+int32_t AnalogOutData::RegisterVoltageCallback(HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_voltageCallbacks = RegisterCallback(m_voltageCallbacks, "Voltage",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetVoltage());
+    callback("Voltage", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogOutData::CancelVoltageCallback(int32_t uid) {
+  m_voltageCallbacks = CancelCallback(m_voltageCallbacks, uid);
+}
+
+void AnalogOutData::InvokeVoltageCallback(HAL_Value value) {
+  InvokeCallback(m_voltageCallbacks, "Voltage", &value);
+}
+
+double AnalogOutData::GetVoltage() { return m_voltage; }
+
+void AnalogOutData::SetVoltage(double voltage) {
+  double oldValue = m_voltage.exchange(voltage);
+  if (oldValue != voltage) {
+    InvokeVoltageCallback(MakeDouble(voltage));
+  }
+}
+
+int32_t AnalogOutData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogOutData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void AnalogOutData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool AnalogOutData::GetInitialized() { return m_initialized; }
+
+void AnalogOutData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetAnalogOutData(int32_t index) {
+  SimAnalogOutData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterAnalogOutVoltageCallback(int32_t index,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  return SimAnalogOutData[index].RegisterVoltageCallback(callback, param,
+                                                         initialNotify);
+}
+
+void HALSIM_CancelAnalogOutVoltageCallback(int32_t index, int32_t uid) {
+  SimAnalogOutData[index].CancelVoltageCallback(uid);
+}
+
+double HALSIM_GetAnalogOutVoltage(int32_t index) {
+  return SimAnalogOutData[index].GetVoltage();
+}
+
+void HALSIM_SetAnalogOutVoltage(int32_t index, double voltage) {
+  SimAnalogOutData[index].SetVoltage(voltage);
+}
+
+int32_t HALSIM_RegisterAnalogOutInitializedCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimAnalogOutData[index].RegisterInitializedCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelAnalogOutInitializedCallback(int32_t index, int32_t uid) {
+  SimAnalogOutData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetAnalogOutInitialized(int32_t index) {
+  return SimAnalogOutData[index].GetInitialized();
+}
+
+void HALSIM_SetAnalogOutInitialized(int32_t index, HAL_Bool initialized) {
+  SimAnalogOutData[index].SetInitialized(initialized);
+}
+
+void HALSIM_RegisterAnalogOutAllCallbacks(int32_t index,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify) {
+  SimAnalogOutData[index].RegisterVoltageCallback(callback, param,
+                                                  initialNotify);
+  SimAnalogOutData[index].RegisterInitializedCallback(callback, param,
+                                                      initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogOutDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogOutDataInternal.h
new file mode 100644
index 0000000..c65e7f7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogOutDataInternal.h
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/AnalogOutData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class AnalogOutData {
+ public:
+  int32_t RegisterVoltageCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelVoltageCallback(int32_t uid);
+  void InvokeVoltageCallback(HAL_Value value);
+  double GetVoltage();
+  void SetVoltage(double voltage);
+
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<double> m_voltage{0.0};
+  std::shared_ptr<NotifyListenerVector> m_voltageCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_initialized{0};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+};
+extern AnalogOutData* SimAnalogOutData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogTriggerData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogTriggerData.cpp
new file mode 100644
index 0000000..3055233
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogTriggerData.cpp
@@ -0,0 +1,280 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "AnalogTriggerDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeAnalogTriggerData() {
+  static AnalogTriggerData satd[kNumAnalogTriggers];
+  ::hal::SimAnalogTriggerData = satd;
+}
+}  // namespace init
+}  // namespace hal
+
+AnalogTriggerData* hal::SimAnalogTriggerData;
+void AnalogTriggerData::ResetData() {
+  m_initialized = 0;
+  m_initializedCallbacks = nullptr;
+  m_triggerLowerBound = 0;
+  m_triggerLowerBoundCallbacks = nullptr;
+  m_triggerUpperBound = 0;
+  m_triggerUpperBoundCallbacks = nullptr;
+  m_triggerMode = static_cast<HALSIM_AnalogTriggerMode>(0);
+  m_triggerModeCallbacks = nullptr;
+}
+
+int32_t AnalogTriggerData::RegisterInitializedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogTriggerData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void AnalogTriggerData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool AnalogTriggerData::GetInitialized() { return m_initialized; }
+
+void AnalogTriggerData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t AnalogTriggerData::RegisterTriggerLowerBoundCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_triggerLowerBoundCallbacks =
+        RegisterCallback(m_triggerLowerBoundCallbacks, "TriggerLowerBound",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetTriggerLowerBound());
+    callback("TriggerLowerBound", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogTriggerData::CancelTriggerLowerBoundCallback(int32_t uid) {
+  m_triggerLowerBoundCallbacks =
+      CancelCallback(m_triggerLowerBoundCallbacks, uid);
+}
+
+void AnalogTriggerData::InvokeTriggerLowerBoundCallback(HAL_Value value) {
+  InvokeCallback(m_triggerLowerBoundCallbacks, "TriggerLowerBound", &value);
+}
+
+double AnalogTriggerData::GetTriggerLowerBound() { return m_triggerLowerBound; }
+
+void AnalogTriggerData::SetTriggerLowerBound(double triggerLowerBound) {
+  double oldValue = m_triggerLowerBound.exchange(triggerLowerBound);
+  if (oldValue != triggerLowerBound) {
+    InvokeTriggerLowerBoundCallback(MakeDouble(triggerLowerBound));
+  }
+}
+
+int32_t AnalogTriggerData::RegisterTriggerUpperBoundCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_triggerUpperBoundCallbacks =
+        RegisterCallback(m_triggerUpperBoundCallbacks, "TriggerUpperBound",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetTriggerUpperBound());
+    callback("TriggerUpperBound", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogTriggerData::CancelTriggerUpperBoundCallback(int32_t uid) {
+  m_triggerUpperBoundCallbacks =
+      CancelCallback(m_triggerUpperBoundCallbacks, uid);
+}
+
+void AnalogTriggerData::InvokeTriggerUpperBoundCallback(HAL_Value value) {
+  InvokeCallback(m_triggerUpperBoundCallbacks, "TriggerUpperBound", &value);
+}
+
+double AnalogTriggerData::GetTriggerUpperBound() { return m_triggerUpperBound; }
+
+void AnalogTriggerData::SetTriggerUpperBound(double triggerUpperBound) {
+  double oldValue = m_triggerUpperBound.exchange(triggerUpperBound);
+  if (oldValue != triggerUpperBound) {
+    InvokeTriggerUpperBoundCallback(MakeDouble(triggerUpperBound));
+  }
+}
+
+int32_t AnalogTriggerData::RegisterTriggerModeCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_triggerModeCallbacks = RegisterCallback(
+        m_triggerModeCallbacks, "TriggerMode", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeEnum(GetTriggerMode());
+    callback("TriggerMode", param, &value);
+  }
+  return newUid;
+}
+
+void AnalogTriggerData::CancelTriggerModeCallback(int32_t uid) {
+  m_triggerModeCallbacks = CancelCallback(m_triggerModeCallbacks, uid);
+}
+
+void AnalogTriggerData::InvokeTriggerModeCallback(HAL_Value value) {
+  InvokeCallback(m_triggerModeCallbacks, "TriggerMode", &value);
+}
+
+HALSIM_AnalogTriggerMode AnalogTriggerData::GetTriggerMode() {
+  return m_triggerMode;
+}
+
+void AnalogTriggerData::SetTriggerMode(HALSIM_AnalogTriggerMode triggerMode) {
+  HALSIM_AnalogTriggerMode oldValue = m_triggerMode.exchange(triggerMode);
+  if (oldValue != triggerMode) {
+    InvokeTriggerModeCallback(MakeEnum(triggerMode));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetAnalogTriggerData(int32_t index) {
+  SimAnalogTriggerData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterAnalogTriggerInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogTriggerData[index].RegisterInitializedCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogTriggerInitializedCallback(int32_t index, int32_t uid) {
+  SimAnalogTriggerData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetAnalogTriggerInitialized(int32_t index) {
+  return SimAnalogTriggerData[index].GetInitialized();
+}
+
+void HALSIM_SetAnalogTriggerInitialized(int32_t index, HAL_Bool initialized) {
+  SimAnalogTriggerData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterAnalogTriggerTriggerLowerBoundCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogTriggerData[index].RegisterTriggerLowerBoundCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogTriggerTriggerLowerBoundCallback(int32_t index,
+                                                         int32_t uid) {
+  SimAnalogTriggerData[index].CancelTriggerLowerBoundCallback(uid);
+}
+
+double HALSIM_GetAnalogTriggerTriggerLowerBound(int32_t index) {
+  return SimAnalogTriggerData[index].GetTriggerLowerBound();
+}
+
+void HALSIM_SetAnalogTriggerTriggerLowerBound(int32_t index,
+                                              double triggerLowerBound) {
+  SimAnalogTriggerData[index].SetTriggerLowerBound(triggerLowerBound);
+}
+
+int32_t HALSIM_RegisterAnalogTriggerTriggerUpperBoundCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogTriggerData[index].RegisterTriggerUpperBoundCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogTriggerTriggerUpperBoundCallback(int32_t index,
+                                                         int32_t uid) {
+  SimAnalogTriggerData[index].CancelTriggerUpperBoundCallback(uid);
+}
+
+double HALSIM_GetAnalogTriggerTriggerUpperBound(int32_t index) {
+  return SimAnalogTriggerData[index].GetTriggerUpperBound();
+}
+
+void HALSIM_SetAnalogTriggerTriggerUpperBound(int32_t index,
+                                              double triggerUpperBound) {
+  SimAnalogTriggerData[index].SetTriggerUpperBound(triggerUpperBound);
+}
+
+int32_t HALSIM_RegisterAnalogTriggerTriggerModeCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimAnalogTriggerData[index].RegisterTriggerModeCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelAnalogTriggerTriggerModeCallback(int32_t index, int32_t uid) {
+  SimAnalogTriggerData[index].CancelTriggerModeCallback(uid);
+}
+
+HALSIM_AnalogTriggerMode HALSIM_GetAnalogTriggerTriggerMode(int32_t index) {
+  return SimAnalogTriggerData[index].GetTriggerMode();
+}
+
+void HALSIM_SetAnalogTriggerTriggerMode(int32_t index,
+                                        HALSIM_AnalogTriggerMode triggerMode) {
+  SimAnalogTriggerData[index].SetTriggerMode(triggerMode);
+}
+
+void HALSIM_RegisterAnalogTriggerAllCallbacks(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  SimAnalogTriggerData[index].RegisterInitializedCallback(callback, param,
+                                                          initialNotify);
+  SimAnalogTriggerData[index].RegisterTriggerLowerBoundCallback(callback, param,
+                                                                initialNotify);
+  SimAnalogTriggerData[index].RegisterTriggerUpperBoundCallback(callback, param,
+                                                                initialNotify);
+  SimAnalogTriggerData[index].RegisterTriggerModeCallback(callback, param,
+                                                          initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogTriggerDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogTriggerDataInternal.h
new file mode 100644
index 0000000..abb632b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/AnalogTriggerDataInternal.h
@@ -0,0 +1,66 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/AnalogTriggerData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class AnalogTriggerData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterTriggerLowerBoundCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+  void CancelTriggerLowerBoundCallback(int32_t uid);
+  void InvokeTriggerLowerBoundCallback(HAL_Value value);
+  double GetTriggerLowerBound();
+  void SetTriggerLowerBound(double triggerLowerBound);
+
+  int32_t RegisterTriggerUpperBoundCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+  void CancelTriggerUpperBoundCallback(int32_t uid);
+  void InvokeTriggerUpperBoundCallback(HAL_Value value);
+  double GetTriggerUpperBound();
+  void SetTriggerUpperBound(double triggerUpperBound);
+
+  int32_t RegisterTriggerModeCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelTriggerModeCallback(int32_t uid);
+  void InvokeTriggerModeCallback(HAL_Value value);
+  HALSIM_AnalogTriggerMode GetTriggerMode();
+  void SetTriggerMode(HALSIM_AnalogTriggerMode triggerMode);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{0};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<double> m_triggerLowerBound{0};
+  std::shared_ptr<NotifyListenerVector> m_triggerLowerBoundCallbacks = nullptr;
+  std::atomic<double> m_triggerUpperBound{0};
+  std::shared_ptr<NotifyListenerVector> m_triggerUpperBoundCallbacks = nullptr;
+  std::atomic<HALSIM_AnalogTriggerMode> m_triggerMode{
+      static_cast<HALSIM_AnalogTriggerMode>(0)};
+  std::shared_ptr<NotifyListenerVector> m_triggerModeCallbacks = nullptr;
+};
+extern AnalogTriggerData* SimAnalogTriggerData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/CanDataInternal.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/CanDataInternal.cpp
new file mode 100644
index 0000000..cb4a906
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/CanDataInternal.cpp
@@ -0,0 +1,296 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "CanDataInternal.h"
+
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeCanData() {
+  static CanData scd;
+  ::hal::SimCanData = &scd;
+}
+}  // namespace init
+}  // namespace hal
+
+CanData* hal::SimCanData;
+void InvokeCallback(std::shared_ptr<CanSendMessageListenerVector> currentVector,
+                    const char* name, uint32_t messageID, const uint8_t* data,
+                    uint8_t dataSize, int32_t periodMs, int32_t* status) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, messageID, data, dataSize, periodMs,
+                      status);
+  }
+}
+
+void InvokeCallback(
+    std::shared_ptr<CanReceiveMessageListenerVector> currentVector,
+    const char* name, uint32_t* messageID, uint32_t messageIDMask,
+    uint8_t* data, uint8_t* dataSize, uint32_t* timeStamp, int32_t* status) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, messageID, messageIDMask, data,
+                      dataSize, timeStamp, status);
+  }
+}
+
+void InvokeCallback(
+    std::shared_ptr<CanOpenStreamSessionListenerVector> currentVector,
+    const char* name, uint32_t* sessionHandle, uint32_t messageID,
+    uint32_t messageIDMask, uint32_t maxMessages, int32_t* status) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, sessionHandle, messageID,
+                      messageIDMask, maxMessages, status);
+  }
+}
+
+void InvokeCallback(
+    std::shared_ptr<CanCloseStreamSessionListenerVector> currentVector,
+    const char* name, uint32_t sessionHandle) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, sessionHandle);
+  }
+}
+
+void InvokeCallback(
+    std::shared_ptr<CanReadStreamSessionListenerVector> currentVector,
+    const char* name, uint32_t sessionHandle,
+    struct HAL_CANStreamMessage* messages, uint32_t messagesToRead,
+    uint32_t* messagesRead, int32_t* status) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, sessionHandle, messages,
+                      messagesToRead, messagesRead, status);
+  }
+}
+
+void InvokeCallback(
+    std::shared_ptr<CanGetCANStatusListenerVector> currentVector,
+    const char* name, float* percentBusUtilization, uint32_t* busOffCount,
+    uint32_t* txFullCount, uint32_t* receiveErrorCount,
+    uint32_t* transmitErrorCount, int32_t* status) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, percentBusUtilization, busOffCount,
+                      txFullCount, receiveErrorCount, transmitErrorCount,
+                      status);
+  }
+}
+
+void CanData::ResetData() {
+  m_sendMessageCallback = nullptr;
+  m_receiveMessageCallback = nullptr;
+  m_openStreamSessionCallback = nullptr;
+  m_closeStreamSessionCallback = nullptr;
+  m_readStreamSessionCallback = nullptr;
+  m_getCanStatusCallback = nullptr;
+}
+
+void CanData::SendMessage(uint32_t messageID, const uint8_t* data,
+                          uint8_t dataSize, int32_t periodMs, int32_t* status) {
+  InvokeCallback(m_sendMessageCallback, "SendMessage", messageID, data,
+                 dataSize, periodMs, status);
+}
+
+void CanData::ReceiveMessage(uint32_t* messageID, uint32_t messageIDMask,
+                             uint8_t* data, uint8_t* dataSize,
+                             uint32_t* timeStamp, int32_t* status) {
+  InvokeCallback(m_receiveMessageCallback, "ReceiveMessage", messageID,
+                 messageIDMask, data, dataSize, timeStamp, status);
+}
+
+void CanData::OpenStreamSession(uint32_t* sessionHandle, uint32_t messageID,
+                                uint32_t messageIDMask, uint32_t maxMessages,
+                                int32_t* status) {
+  InvokeCallback(m_openStreamSessionCallback, "OpenStream", sessionHandle,
+                 messageID, messageIDMask, maxMessages, status);
+}
+
+void CanData::CloseStreamSession(uint32_t sessionHandle) {
+  InvokeCallback(m_closeStreamSessionCallback, "CloseStream", sessionHandle);
+}
+
+void CanData::ReadStreamSession(uint32_t sessionHandle,
+                                struct HAL_CANStreamMessage* messages,
+                                uint32_t messagesToRead, uint32_t* messagesRead,
+                                int32_t* status) {
+  InvokeCallback(m_readStreamSessionCallback, "ReadStream", sessionHandle,
+                 messages, messagesToRead, messagesRead, status);
+}
+
+void CanData::GetCANStatus(float* percentBusUtilization, uint32_t* busOffCount,
+                           uint32_t* txFullCount, uint32_t* receiveErrorCount,
+                           uint32_t* transmitErrorCount, int32_t* status) {
+  InvokeCallback(m_getCanStatusCallback, "GetCanStatus", percentBusUtilization,
+                 busOffCount, txFullCount, receiveErrorCount,
+                 transmitErrorCount, status);
+}
+
+int32_t CanData::RegisterSendMessageCallback(
+    HAL_CAN_SendMessageCallback callback, void* param) {
+  return RegisterCanCallback<CanSendMessageListenerVector,
+                             HAL_CAN_SendMessageCallback>(
+      callback, m_sendMessageCallback, "SendMessage", param);
+}
+void CanData::CancelSendMessageCallback(int32_t uid) {
+  m_sendMessageCallback = CancelCallbackImpl<CanSendMessageListenerVector,
+                                             HAL_CAN_SendMessageCallback>(
+      m_sendMessageCallback, uid);
+}
+
+int32_t CanData::RegisterReceiveMessageCallback(
+    HAL_CAN_ReceiveMessageCallback callback, void* param) {
+  return RegisterCanCallback<CanReceiveMessageListenerVector,
+                             HAL_CAN_ReceiveMessageCallback>(
+      callback, m_receiveMessageCallback, "ReceiveMessage", param);
+}
+void CanData::CancelReceiveMessageCallback(int32_t uid) {
+  m_receiveMessageCallback = CancelCallbackImpl<CanReceiveMessageListenerVector,
+                                                HAL_CAN_ReceiveMessageCallback>(
+      m_receiveMessageCallback, uid);
+}
+
+int32_t CanData::RegisterOpenStreamCallback(
+    HAL_CAN_OpenStreamSessionCallback callback, void* param) {
+  return RegisterCanCallback<CanOpenStreamSessionListenerVector,
+                             HAL_CAN_OpenStreamSessionCallback>(
+      callback, m_openStreamSessionCallback, "OpenStream", param);
+}
+void CanData::CancelOpenStreamCallback(int32_t uid) {
+  m_openStreamSessionCallback =
+      CancelCallbackImpl<CanOpenStreamSessionListenerVector,
+                         HAL_CAN_OpenStreamSessionCallback>(
+          m_openStreamSessionCallback, uid);
+}
+
+int32_t CanData::RegisterCloseStreamCallback(
+    HAL_CAN_CloseStreamSessionCallback callback, void* param) {
+  return RegisterCanCallback<CanCloseStreamSessionListenerVector,
+                             HAL_CAN_CloseStreamSessionCallback>(
+      callback, m_closeStreamSessionCallback, "CloseStream", param);
+}
+void CanData::CancelCloseStreamCallback(int32_t uid) {
+  m_closeStreamSessionCallback =
+      CancelCallbackImpl<CanCloseStreamSessionListenerVector,
+                         HAL_CAN_CloseStreamSessionCallback>(
+          m_closeStreamSessionCallback, uid);
+}
+
+int32_t CanData::RegisterReadStreamCallback(
+    HAL_CAN_ReadStreamSessionCallback callback, void* param) {
+  return RegisterCanCallback<CanReadStreamSessionListenerVector,
+                             HAL_CAN_ReadStreamSessionCallback>(
+      callback, m_readStreamSessionCallback, "ReadStream", param);
+}
+void CanData::CancelReadStreamCallback(int32_t uid) {
+  m_readStreamSessionCallback =
+      CancelCallbackImpl<CanReadStreamSessionListenerVector,
+                         HAL_CAN_ReadStreamSessionCallback>(
+          m_readStreamSessionCallback, uid);
+}
+int32_t CanData::RegisterGetCANStatusCallback(
+    HAL_CAN_GetCANStatusCallback callback, void* param) {
+  return RegisterCanCallback<CanGetCANStatusListenerVector,
+                             HAL_CAN_GetCANStatusCallback>(
+      callback, m_getCanStatusCallback, "GetCANStatus", param);
+}
+void CanData::CancelGetCANStatusCallback(int32_t uid) {
+  m_getCanStatusCallback =
+      CancelCallbackImpl<CanGetCANStatusListenerVector,
+                         HAL_CAN_ReadStreamSessionCallback>(
+          m_getCanStatusCallback, uid);
+}
+
+extern "C" {
+
+void HALSIM_ResetCanData(void) { SimCanData->ResetData(); }
+
+int32_t HALSIM_RegisterCanSendMessageCallback(
+    HAL_CAN_SendMessageCallback callback, void* param) {
+  return SimCanData->RegisterSendMessageCallback(callback, param);
+}
+void HALSIM_CancelCanSendMessageCallback(int32_t uid) {
+  SimCanData->CancelSendMessageCallback(uid);
+}
+
+int32_t HALSIM_RegisterCanReceiveMessageCallback(
+    HAL_CAN_ReceiveMessageCallback callback, void* param) {
+  return SimCanData->RegisterReceiveMessageCallback(callback, param);
+}
+void HALSIM_CancelCanReceiveMessageCallback(int32_t uid) {
+  SimCanData->CancelReceiveMessageCallback(uid);
+}
+
+int32_t HALSIM_RegisterCanOpenStreamCallback(
+    HAL_CAN_OpenStreamSessionCallback callback, void* param) {
+  return SimCanData->RegisterOpenStreamCallback(callback, param);
+}
+void HALSIM_CancelCanOpenStreamCallback(int32_t uid) {
+  SimCanData->CancelOpenStreamCallback(uid);
+}
+
+int32_t HALSIM_RegisterCanCloseStreamCallback(
+    HAL_CAN_CloseStreamSessionCallback callback, void* param) {
+  return SimCanData->RegisterCloseStreamCallback(callback, param);
+}
+void HALSIM_CancelCanCloseStreamCallback(int32_t uid) {
+  SimCanData->CancelCloseStreamCallback(uid);
+}
+
+int32_t HALSIM_RegisterCanReadStreamCallback(
+    HAL_CAN_ReadStreamSessionCallback callback, void* param) {
+  return SimCanData->RegisterReadStreamCallback(callback, param);
+}
+void HALSIM_CancelCanReadStreamCallback(int32_t uid) {
+  SimCanData->CancelReadStreamCallback(uid);
+}
+
+int32_t HALSIM_RegisterCanGetCANStatusCallback(
+    HAL_CAN_GetCANStatusCallback callback, void* param) {
+  return SimCanData->RegisterGetCANStatusCallback(callback, param);
+}
+void HALSIM_CancelCanGetCANStatusCallback(int32_t uid) {
+  SimCanData->CancelGetCANStatusCallback(uid);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/CanDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/CanDataInternal.h
new file mode 100644
index 0000000..2e64d78
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/CanDataInternal.h
@@ -0,0 +1,111 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <limits>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/CanData.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+
+typedef HalCallbackListenerVectorImpl<HAL_CAN_SendMessageCallback>
+    CanSendMessageListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_CAN_ReceiveMessageCallback>
+    CanReceiveMessageListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_CAN_OpenStreamSessionCallback>
+    CanOpenStreamSessionListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_CAN_CloseStreamSessionCallback>
+    CanCloseStreamSessionListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_CAN_ReadStreamSessionCallback>
+    CanReadStreamSessionListenerVector;
+typedef HalCallbackListenerVectorImpl<HAL_CAN_GetCANStatusCallback>
+    CanGetCANStatusListenerVector;
+
+class CanData {
+ public:
+  void ResetData();
+
+  void SendMessage(uint32_t messageID, const uint8_t* data, uint8_t dataSize,
+                   int32_t periodMs, int32_t* status);
+  void ReceiveMessage(uint32_t* messageID, uint32_t messageIDMask,
+                      uint8_t* data, uint8_t* dataSize, uint32_t* timeStamp,
+                      int32_t* status);
+  void OpenStreamSession(uint32_t* sessionHandle, uint32_t messageID,
+                         uint32_t messageIDMask, uint32_t maxMessages,
+                         int32_t* status);
+  void CloseStreamSession(uint32_t sessionHandle);
+  void ReadStreamSession(uint32_t sessionHandle,
+                         struct HAL_CANStreamMessage* messages,
+                         uint32_t messagesToRead, uint32_t* messagesRead,
+                         int32_t* status);
+  void GetCANStatus(float* percentBusUtilization, uint32_t* busOffCount,
+                    uint32_t* txFullCount, uint32_t* receiveErrorCount,
+                    uint32_t* transmitErrorCount, int32_t* status);
+
+  int32_t RegisterSendMessageCallback(HAL_CAN_SendMessageCallback callback,
+                                      void* param);
+  void CancelSendMessageCallback(int32_t uid);
+
+  int32_t RegisterReceiveMessageCallback(
+      HAL_CAN_ReceiveMessageCallback callback, void* param);
+  void CancelReceiveMessageCallback(int32_t uid);
+
+  int32_t RegisterOpenStreamCallback(HAL_CAN_OpenStreamSessionCallback callback,
+                                     void* param);
+  void CancelOpenStreamCallback(int32_t uid);
+
+  int32_t RegisterCloseStreamCallback(
+      HAL_CAN_CloseStreamSessionCallback callback, void* param);
+  void CancelCloseStreamCallback(int32_t uid);
+
+  int32_t RegisterReadStreamCallback(HAL_CAN_ReadStreamSessionCallback callback,
+                                     void* param);
+  void CancelReadStreamCallback(int32_t uid);
+
+  int32_t RegisterGetCANStatusCallback(HAL_CAN_GetCANStatusCallback callback,
+                                       void* param);
+  void CancelGetCANStatusCallback(int32_t uid);
+
+ protected:
+  template <typename VectorType, typename CallbackType>
+  int32_t RegisterCanCallback(CallbackType& callback,
+                              std::shared_ptr<VectorType>& callbackVector,
+                              const char* callbackName, void* param) {
+    // Must return -1 on a null callback for error handling
+    if (callback == nullptr) return -1;
+    int32_t newUid = 0;
+    {
+      std::lock_guard<wpi::mutex> lock(m_registerMutex);
+      callbackVector = RegisterCallbackImpl(callbackVector, callbackName,
+                                            callback, param, &newUid);
+    }
+    return newUid;
+  }
+
+  wpi::mutex m_registerMutex;
+
+  std::shared_ptr<CanSendMessageListenerVector> m_sendMessageCallback;
+  std::shared_ptr<CanReceiveMessageListenerVector> m_receiveMessageCallback;
+  std::shared_ptr<CanOpenStreamSessionListenerVector>
+      m_openStreamSessionCallback;
+  std::shared_ptr<CanCloseStreamSessionListenerVector>
+      m_closeStreamSessionCallback;
+  std::shared_ptr<CanReadStreamSessionListenerVector>
+      m_readStreamSessionCallback;
+  std::shared_ptr<CanGetCANStatusListenerVector> m_getCanStatusCallback;
+};
+
+extern CanData* SimCanData;
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DIOData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DIOData.cpp
new file mode 100644
index 0000000..0dcf299
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DIOData.cpp
@@ -0,0 +1,324 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "DIODataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeDIOData() {
+  static DIOData sdd[kNumDigitalChannels];
+  ::hal::SimDIOData = sdd;
+}
+}  // namespace init
+}  // namespace hal
+
+DIOData* hal::SimDIOData;
+void DIOData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_value = true;
+  m_valueCallbacks = nullptr;
+  m_pulseLength = 0.0;
+  m_pulseLengthCallbacks = nullptr;
+  m_isInput = true;
+  m_isInputCallbacks = nullptr;
+  m_filterIndex = -1;
+  m_filterIndexCallbacks = nullptr;
+}
+
+int32_t DIOData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void DIOData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void DIOData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool DIOData::GetInitialized() { return m_initialized; }
+
+void DIOData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t DIOData::RegisterValueCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_valueCallbacks =
+        RegisterCallback(m_valueCallbacks, "Value", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetValue());
+    callback("Value", param, &value);
+  }
+  return newUid;
+}
+
+void DIOData::CancelValueCallback(int32_t uid) {
+  m_valueCallbacks = CancelCallback(m_valueCallbacks, uid);
+}
+
+void DIOData::InvokeValueCallback(HAL_Value value) {
+  InvokeCallback(m_valueCallbacks, "Value", &value);
+}
+
+HAL_Bool DIOData::GetValue() { return m_value; }
+
+void DIOData::SetValue(HAL_Bool value) {
+  HAL_Bool oldValue = m_value.exchange(value);
+  if (oldValue != value) {
+    InvokeValueCallback(MakeBoolean(value));
+  }
+}
+
+int32_t DIOData::RegisterPulseLengthCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_pulseLengthCallbacks = RegisterCallback(
+        m_pulseLengthCallbacks, "PulseLength", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetPulseLength());
+    callback("PulseLength", param, &value);
+  }
+  return newUid;
+}
+
+void DIOData::CancelPulseLengthCallback(int32_t uid) {
+  m_pulseLengthCallbacks = CancelCallback(m_pulseLengthCallbacks, uid);
+}
+
+void DIOData::InvokePulseLengthCallback(HAL_Value value) {
+  InvokeCallback(m_pulseLengthCallbacks, "PulseLength", &value);
+}
+
+double DIOData::GetPulseLength() { return m_pulseLength; }
+
+void DIOData::SetPulseLength(double pulseLength) {
+  double oldValue = m_pulseLength.exchange(pulseLength);
+  if (oldValue != pulseLength) {
+    InvokePulseLengthCallback(MakeDouble(pulseLength));
+  }
+}
+
+int32_t DIOData::RegisterIsInputCallback(HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_isInputCallbacks = RegisterCallback(m_isInputCallbacks, "IsInput",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetIsInput());
+    callback("IsInput", param, &value);
+  }
+  return newUid;
+}
+
+void DIOData::CancelIsInputCallback(int32_t uid) {
+  m_isInputCallbacks = CancelCallback(m_isInputCallbacks, uid);
+}
+
+void DIOData::InvokeIsInputCallback(HAL_Value value) {
+  InvokeCallback(m_isInputCallbacks, "IsInput", &value);
+}
+
+HAL_Bool DIOData::GetIsInput() { return m_isInput; }
+
+void DIOData::SetIsInput(HAL_Bool isInput) {
+  HAL_Bool oldValue = m_isInput.exchange(isInput);
+  if (oldValue != isInput) {
+    InvokeIsInputCallback(MakeBoolean(isInput));
+  }
+}
+
+int32_t DIOData::RegisterFilterIndexCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_filterIndexCallbacks = RegisterCallback(
+        m_filterIndexCallbacks, "FilterIndex", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetFilterIndex());
+    callback("FilterIndex", param, &value);
+  }
+  return newUid;
+}
+
+void DIOData::CancelFilterIndexCallback(int32_t uid) {
+  m_filterIndexCallbacks = CancelCallback(m_filterIndexCallbacks, uid);
+}
+
+void DIOData::InvokeFilterIndexCallback(HAL_Value value) {
+  InvokeCallback(m_filterIndexCallbacks, "FilterIndex", &value);
+}
+
+int32_t DIOData::GetFilterIndex() { return m_filterIndex; }
+
+void DIOData::SetFilterIndex(int32_t filterIndex) {
+  int32_t oldValue = m_filterIndex.exchange(filterIndex);
+  if (oldValue != filterIndex) {
+    InvokeFilterIndexCallback(MakeInt(filterIndex));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetDIOData(int32_t index) { SimDIOData[index].ResetData(); }
+
+int32_t HALSIM_RegisterDIOInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimDIOData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelDIOInitializedCallback(int32_t index, int32_t uid) {
+  SimDIOData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetDIOInitialized(int32_t index) {
+  return SimDIOData[index].GetInitialized();
+}
+
+void HALSIM_SetDIOInitialized(int32_t index, HAL_Bool initialized) {
+  SimDIOData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterDIOValueCallback(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify) {
+  return SimDIOData[index].RegisterValueCallback(callback, param,
+                                                 initialNotify);
+}
+
+void HALSIM_CancelDIOValueCallback(int32_t index, int32_t uid) {
+  SimDIOData[index].CancelValueCallback(uid);
+}
+
+HAL_Bool HALSIM_GetDIOValue(int32_t index) {
+  return SimDIOData[index].GetValue();
+}
+
+void HALSIM_SetDIOValue(int32_t index, HAL_Bool value) {
+  SimDIOData[index].SetValue(value);
+}
+
+int32_t HALSIM_RegisterDIOPulseLengthCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimDIOData[index].RegisterPulseLengthCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelDIOPulseLengthCallback(int32_t index, int32_t uid) {
+  SimDIOData[index].CancelPulseLengthCallback(uid);
+}
+
+double HALSIM_GetDIOPulseLength(int32_t index) {
+  return SimDIOData[index].GetPulseLength();
+}
+
+void HALSIM_SetDIOPulseLength(int32_t index, double pulseLength) {
+  SimDIOData[index].SetPulseLength(pulseLength);
+}
+
+int32_t HALSIM_RegisterDIOIsInputCallback(int32_t index,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify) {
+  return SimDIOData[index].RegisterIsInputCallback(callback, param,
+                                                   initialNotify);
+}
+
+void HALSIM_CancelDIOIsInputCallback(int32_t index, int32_t uid) {
+  SimDIOData[index].CancelIsInputCallback(uid);
+}
+
+HAL_Bool HALSIM_GetDIOIsInput(int32_t index) {
+  return SimDIOData[index].GetIsInput();
+}
+
+void HALSIM_SetDIOIsInput(int32_t index, HAL_Bool isInput) {
+  SimDIOData[index].SetIsInput(isInput);
+}
+
+int32_t HALSIM_RegisterDIOFilterIndexCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimDIOData[index].RegisterFilterIndexCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelDIOFilterIndexCallback(int32_t index, int32_t uid) {
+  SimDIOData[index].CancelFilterIndexCallback(uid);
+}
+
+int32_t HALSIM_GetDIOFilterIndex(int32_t index) {
+  return SimDIOData[index].GetFilterIndex();
+}
+
+void HALSIM_SetDIOFilterIndex(int32_t index, int32_t filterIndex) {
+  SimDIOData[index].SetFilterIndex(filterIndex);
+}
+
+void HALSIM_RegisterDIOAllCallbacks(int32_t index, HAL_NotifyCallback callback,
+                                    void* param, HAL_Bool initialNotify) {
+  SimDIOData[index].RegisterInitializedCallback(callback, param, initialNotify);
+  SimDIOData[index].RegisterValueCallback(callback, param, initialNotify);
+  SimDIOData[index].RegisterPulseLengthCallback(callback, param, initialNotify);
+  SimDIOData[index].RegisterIsInputCallback(callback, param, initialNotify);
+  SimDIOData[index].RegisterFilterIndexCallback(callback, param, initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DIODataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DIODataInternal.h
new file mode 100644
index 0000000..3f51a8d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DIODataInternal.h
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/DIOData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class DIOData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterValueCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelValueCallback(int32_t uid);
+  void InvokeValueCallback(HAL_Value value);
+  HAL_Bool GetValue();
+  void SetValue(HAL_Bool value);
+
+  int32_t RegisterPulseLengthCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelPulseLengthCallback(int32_t uid);
+  void InvokePulseLengthCallback(HAL_Value value);
+  double GetPulseLength();
+  void SetPulseLength(double pulseLength);
+
+  int32_t RegisterIsInputCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelIsInputCallback(int32_t uid);
+  void InvokeIsInputCallback(HAL_Value value);
+  HAL_Bool GetIsInput();
+  void SetIsInput(HAL_Bool isInput);
+
+  int32_t RegisterFilterIndexCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelFilterIndexCallback(int32_t uid);
+  void InvokeFilterIndexCallback(HAL_Value value);
+  int32_t GetFilterIndex();
+  void SetFilterIndex(int32_t filterIndex);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_value{true};
+  std::shared_ptr<NotifyListenerVector> m_valueCallbacks = nullptr;
+  std::atomic<double> m_pulseLength{0.0};
+  std::shared_ptr<NotifyListenerVector> m_pulseLengthCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_isInput{true};
+  std::shared_ptr<NotifyListenerVector> m_isInputCallbacks = nullptr;
+  std::atomic<int32_t> m_filterIndex{-1};
+  std::shared_ptr<NotifyListenerVector> m_filterIndexCallbacks = nullptr;
+};
+extern DIOData* SimDIOData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DigitalPWMData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DigitalPWMData.cpp
new file mode 100644
index 0000000..f6721d5
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DigitalPWMData.cpp
@@ -0,0 +1,215 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "DigitalPWMDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeDigitalPWMData() {
+  static DigitalPWMData sdpd[kNumDigitalPWMOutputs];
+  ::hal::SimDigitalPWMData = sdpd;
+}
+}  // namespace init
+}  // namespace hal
+
+DigitalPWMData* hal::SimDigitalPWMData;
+void DigitalPWMData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_dutyCycle = false;
+  m_dutyCycleCallbacks = nullptr;
+  m_pin = 0;
+  m_pinCallbacks = nullptr;
+}
+
+int32_t DigitalPWMData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void DigitalPWMData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void DigitalPWMData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool DigitalPWMData::GetInitialized() { return m_initialized; }
+
+void DigitalPWMData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t DigitalPWMData::RegisterDutyCycleCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_dutyCycleCallbacks = RegisterCallback(m_dutyCycleCallbacks, "DutyCycle",
+                                            callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetDutyCycle());
+    callback("DutyCycle", param, &value);
+  }
+  return newUid;
+}
+
+void DigitalPWMData::CancelDutyCycleCallback(int32_t uid) {
+  m_dutyCycleCallbacks = CancelCallback(m_dutyCycleCallbacks, uid);
+}
+
+void DigitalPWMData::InvokeDutyCycleCallback(HAL_Value value) {
+  InvokeCallback(m_dutyCycleCallbacks, "DutyCycle", &value);
+}
+
+double DigitalPWMData::GetDutyCycle() { return m_dutyCycle; }
+
+void DigitalPWMData::SetDutyCycle(double dutyCycle) {
+  double oldValue = m_dutyCycle.exchange(dutyCycle);
+  if (oldValue != dutyCycle) {
+    InvokeDutyCycleCallback(MakeDouble(dutyCycle));
+  }
+}
+
+int32_t DigitalPWMData::RegisterPinCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_pinCallbacks =
+        RegisterCallback(m_pinCallbacks, "Pin", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetPin());
+    callback("Pin", param, &value);
+  }
+  return newUid;
+}
+
+void DigitalPWMData::CancelPinCallback(int32_t uid) {
+  m_pinCallbacks = CancelCallback(m_pinCallbacks, uid);
+}
+
+void DigitalPWMData::InvokePinCallback(HAL_Value value) {
+  InvokeCallback(m_pinCallbacks, "Pin", &value);
+}
+
+int32_t DigitalPWMData::GetPin() { return m_pin; }
+
+void DigitalPWMData::SetPin(int32_t pin) {
+  int32_t oldValue = m_pin.exchange(pin);
+  if (oldValue != pin) {
+    InvokePinCallback(MakeInt(pin));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetDigitalPWMData(int32_t index) {
+  SimDigitalPWMData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterDigitalPWMInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimDigitalPWMData[index].RegisterInitializedCallback(callback, param,
+                                                              initialNotify);
+}
+
+void HALSIM_CancelDigitalPWMInitializedCallback(int32_t index, int32_t uid) {
+  SimDigitalPWMData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetDigitalPWMInitialized(int32_t index) {
+  return SimDigitalPWMData[index].GetInitialized();
+}
+
+void HALSIM_SetDigitalPWMInitialized(int32_t index, HAL_Bool initialized) {
+  SimDigitalPWMData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterDigitalPWMDutyCycleCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimDigitalPWMData[index].RegisterDutyCycleCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelDigitalPWMDutyCycleCallback(int32_t index, int32_t uid) {
+  SimDigitalPWMData[index].CancelDutyCycleCallback(uid);
+}
+
+double HALSIM_GetDigitalPWMDutyCycle(int32_t index) {
+  return SimDigitalPWMData[index].GetDutyCycle();
+}
+
+void HALSIM_SetDigitalPWMDutyCycle(int32_t index, double dutyCycle) {
+  SimDigitalPWMData[index].SetDutyCycle(dutyCycle);
+}
+
+int32_t HALSIM_RegisterDigitalPWMPinCallback(int32_t index,
+                                             HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  return SimDigitalPWMData[index].RegisterPinCallback(callback, param,
+                                                      initialNotify);
+}
+
+void HALSIM_CancelDigitalPWMPinCallback(int32_t index, int32_t uid) {
+  SimDigitalPWMData[index].CancelPinCallback(uid);
+}
+
+int32_t HALSIM_GetDigitalPWMPin(int32_t index) {
+  return SimDigitalPWMData[index].GetPin();
+}
+
+void HALSIM_SetDigitalPWMPin(int32_t index, int32_t pin) {
+  SimDigitalPWMData[index].SetPin(pin);
+}
+
+void HALSIM_RegisterDigitalPWMAllCallbacks(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  SimDigitalPWMData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+  SimDigitalPWMData[index].RegisterDutyCycleCallback(callback, param,
+                                                     initialNotify);
+  SimDigitalPWMData[index].RegisterPinCallback(callback, param, initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DigitalPWMDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DigitalPWMDataInternal.h
new file mode 100644
index 0000000..3ea5c24
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DigitalPWMDataInternal.h
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/DigitalPWMData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class DigitalPWMData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterDutyCycleCallback(HAL_NotifyCallback callback, void* param,
+                                    HAL_Bool initialNotify);
+  void CancelDutyCycleCallback(int32_t uid);
+  void InvokeDutyCycleCallback(HAL_Value value);
+  double GetDutyCycle();
+  void SetDutyCycle(double dutyCycle);
+
+  int32_t RegisterPinCallback(HAL_NotifyCallback callback, void* param,
+                              HAL_Bool initialNotify);
+  void CancelPinCallback(int32_t uid);
+  void InvokePinCallback(HAL_Value value);
+  int32_t GetPin();
+  void SetPin(int32_t pin);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<double> m_dutyCycle{false};
+  std::shared_ptr<NotifyListenerVector> m_dutyCycleCallbacks = nullptr;
+  std::atomic<int32_t> m_pin{0};
+  std::shared_ptr<NotifyListenerVector> m_pinCallbacks = nullptr;
+};
+extern DigitalPWMData* SimDigitalPWMData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DriverStationData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DriverStationData.cpp
new file mode 100644
index 0000000..c88f8b6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DriverStationData.cpp
@@ -0,0 +1,641 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cstdlib>
+#include <cstring>
+#include <string>
+
+#include "DriverStationDataInternal.h"
+#include "HAL/cpp/make_unique.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+namespace hal {
+struct JoystickOutputStore {
+  int64_t outputs = 0;
+  int32_t leftRumble = 0;
+  int32_t rightRumble = 0;
+};
+struct MatchInfoDataStore {
+  std::string eventName;
+  std::string gameSpecificMessage;
+  int32_t replayNumber = 0;
+  int32_t matchNumber = 0;
+  HAL_MatchType matchType = HAL_MatchType::HAL_kMatchType_none;
+};
+}  // namespace hal
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeDriverStationData() {
+  static DriverStationData dsd;
+  ::hal::SimDriverStationData = &dsd;
+}
+}  // namespace init
+}  // namespace hal
+
+DriverStationData* hal::SimDriverStationData;
+
+DriverStationData::DriverStationData() { ResetData(); }
+
+void DriverStationData::ResetData() {
+  m_enabled = false;
+  m_enabledCallbacks = nullptr;
+  m_autonomous = false;
+  m_autonomousCallbacks = nullptr;
+  m_test = false;
+  m_testCallbacks = nullptr;
+  m_eStop = false;
+  m_eStopCallbacks = nullptr;
+  m_fmsAttached = false;
+  m_fmsAttachedCallbacks = nullptr;
+  m_dsAttached = false;
+  m_dsAttachedCallbacks = nullptr;
+
+  {
+    std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+    m_joystickAxes = std::make_unique<HAL_JoystickAxes[]>(6);
+    m_joystickPOVs = std::make_unique<HAL_JoystickPOVs[]>(6);
+    m_joystickButtons = std::make_unique<HAL_JoystickButtons[]>(6);
+    m_joystickOutputs = std::make_unique<JoystickOutputStore[]>(6);
+    m_joystickDescriptor = std::make_unique<HAL_JoystickDescriptor[]>(6);
+
+    for (int i = 0; i < 6; i++) {
+      m_joystickAxes[i].count = 0;
+      m_joystickPOVs[i].count = 0;
+      m_joystickButtons[i].count = 0;
+      m_joystickDescriptor[i].isXbox = 0;
+      m_joystickDescriptor[i].type = -1;
+      m_joystickDescriptor[i].name[0] = '\0';
+    }
+  }
+  {
+    std::lock_guard<wpi::mutex> lock(m_matchInfoMutex);
+
+    m_matchInfo = std::make_unique<MatchInfoDataStore>();
+  }
+}
+
+int32_t DriverStationData::RegisterEnabledCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_enabledCallbacks = RegisterCallback(m_enabledCallbacks, "Enabled",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetEnabled());
+    callback("Enabled", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelEnabledCallback(int32_t uid) {
+  m_enabledCallbacks = CancelCallback(m_enabledCallbacks, uid);
+}
+
+void DriverStationData::InvokeEnabledCallback(HAL_Value value) {
+  InvokeCallback(m_enabledCallbacks, "Enabled", &value);
+}
+
+HAL_Bool DriverStationData::GetEnabled() { return m_enabled; }
+
+void DriverStationData::SetEnabled(HAL_Bool enabled) {
+  HAL_Bool oldValue = m_enabled.exchange(enabled);
+  if (oldValue != enabled) {
+    InvokeEnabledCallback(MakeBoolean(enabled));
+  }
+}
+
+int32_t DriverStationData::RegisterAutonomousCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_autonomousCallbacks = RegisterCallback(
+        m_autonomousCallbacks, "Autonomous", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetAutonomous());
+    callback("Autonomous", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelAutonomousCallback(int32_t uid) {
+  m_autonomousCallbacks = CancelCallback(m_autonomousCallbacks, uid);
+}
+
+void DriverStationData::InvokeAutonomousCallback(HAL_Value value) {
+  InvokeCallback(m_autonomousCallbacks, "Autonomous", &value);
+}
+
+HAL_Bool DriverStationData::GetAutonomous() { return m_autonomous; }
+
+void DriverStationData::SetAutonomous(HAL_Bool autonomous) {
+  HAL_Bool oldValue = m_autonomous.exchange(autonomous);
+  if (oldValue != autonomous) {
+    InvokeAutonomousCallback(MakeBoolean(autonomous));
+  }
+}
+
+int32_t DriverStationData::RegisterTestCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_testCallbacks =
+        RegisterCallback(m_testCallbacks, "Test", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetTest());
+    callback("Test", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelTestCallback(int32_t uid) {
+  m_testCallbacks = CancelCallback(m_testCallbacks, uid);
+}
+
+void DriverStationData::InvokeTestCallback(HAL_Value value) {
+  InvokeCallback(m_testCallbacks, "Test", &value);
+}
+
+HAL_Bool DriverStationData::GetTest() { return m_test; }
+
+void DriverStationData::SetTest(HAL_Bool test) {
+  HAL_Bool oldValue = m_test.exchange(test);
+  if (oldValue != test) {
+    InvokeTestCallback(MakeBoolean(test));
+  }
+}
+
+int32_t DriverStationData::RegisterEStopCallback(HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_eStopCallbacks =
+        RegisterCallback(m_eStopCallbacks, "EStop", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetEStop());
+    callback("EStop", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelEStopCallback(int32_t uid) {
+  m_eStopCallbacks = CancelCallback(m_eStopCallbacks, uid);
+}
+
+void DriverStationData::InvokeEStopCallback(HAL_Value value) {
+  InvokeCallback(m_eStopCallbacks, "EStop", &value);
+}
+
+HAL_Bool DriverStationData::GetEStop() { return m_eStop; }
+
+void DriverStationData::SetEStop(HAL_Bool eStop) {
+  HAL_Bool oldValue = m_eStop.exchange(eStop);
+  if (oldValue != eStop) {
+    InvokeEStopCallback(MakeBoolean(eStop));
+  }
+}
+
+int32_t DriverStationData::RegisterFmsAttachedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_fmsAttachedCallbacks = RegisterCallback(
+        m_fmsAttachedCallbacks, "FmsAttached", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetFmsAttached());
+    callback("FmsAttached", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelFmsAttachedCallback(int32_t uid) {
+  m_fmsAttachedCallbacks = CancelCallback(m_fmsAttachedCallbacks, uid);
+}
+
+void DriverStationData::InvokeFmsAttachedCallback(HAL_Value value) {
+  InvokeCallback(m_fmsAttachedCallbacks, "FmsAttached", &value);
+}
+
+HAL_Bool DriverStationData::GetFmsAttached() { return m_fmsAttached; }
+
+void DriverStationData::SetFmsAttached(HAL_Bool fmsAttached) {
+  HAL_Bool oldValue = m_fmsAttached.exchange(fmsAttached);
+  if (oldValue != fmsAttached) {
+    InvokeFmsAttachedCallback(MakeBoolean(fmsAttached));
+  }
+}
+
+int32_t DriverStationData::RegisterDsAttachedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_dsAttachedCallbacks = RegisterCallback(
+        m_dsAttachedCallbacks, "DsAttached", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetDsAttached());
+    callback("DsAttached", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelDsAttachedCallback(int32_t uid) {
+  m_dsAttachedCallbacks = CancelCallback(m_dsAttachedCallbacks, uid);
+}
+
+void DriverStationData::InvokeDsAttachedCallback(HAL_Value value) {
+  InvokeCallback(m_dsAttachedCallbacks, "DsAttached", &value);
+}
+
+HAL_Bool DriverStationData::GetDsAttached() { return m_dsAttached; }
+
+void DriverStationData::SetDsAttached(HAL_Bool dsAttached) {
+  HAL_Bool oldValue = m_dsAttached.exchange(dsAttached);
+  if (oldValue != dsAttached) {
+    InvokeDsAttachedCallback(MakeBoolean(dsAttached));
+  }
+}
+
+int32_t DriverStationData::RegisterAllianceStationIdCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_allianceStationIdCallbacks =
+        RegisterCallback(m_allianceStationIdCallbacks, "AllianceStationId",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeEnum(GetAllianceStationId());
+    callback("AllianceStationId", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelAllianceStationIdCallback(int32_t uid) {
+  m_allianceStationIdCallbacks =
+      CancelCallback(m_allianceStationIdCallbacks, uid);
+}
+
+void DriverStationData::InvokeAllianceStationIdCallback(HAL_Value value) {
+  InvokeCallback(m_allianceStationIdCallbacks, "AllianceStationId", &value);
+}
+
+HAL_AllianceStationID DriverStationData::GetAllianceStationId() {
+  return m_allianceStationId;
+}
+
+void DriverStationData::SetAllianceStationId(
+    HAL_AllianceStationID allianceStationId) {
+  HAL_AllianceStationID oldValue =
+      m_allianceStationId.exchange(allianceStationId);
+  if (oldValue != allianceStationId) {
+    InvokeAllianceStationIdCallback(MakeEnum(allianceStationId));
+  }
+}
+
+int32_t DriverStationData::RegisterMatchTimeCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_matchTimeCallbacks = RegisterCallback(m_matchTimeCallbacks, "MatchTime",
+                                            callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetMatchTime());
+    callback("MatchTime", param, &value);
+  }
+  return newUid;
+}
+
+void DriverStationData::CancelMatchTimeCallback(int32_t uid) {
+  m_matchTimeCallbacks = CancelCallback(m_matchTimeCallbacks, uid);
+}
+
+void DriverStationData::InvokeMatchTimeCallback(HAL_Value value) {
+  InvokeCallback(m_matchTimeCallbacks, "MatchTime", &value);
+}
+
+double DriverStationData::GetMatchTime() { return m_matchTime; }
+
+void DriverStationData::SetMatchTime(double matchTime) {
+  double oldValue = m_matchTime.exchange(matchTime);
+  if (oldValue != matchTime) {
+    InvokeMatchTimeCallback(MakeDouble(matchTime));
+  }
+}
+
+void DriverStationData::GetJoystickAxes(int32_t joystickNum,
+                                        HAL_JoystickAxes* axes) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  *axes = m_joystickAxes[joystickNum];
+}
+void DriverStationData::GetJoystickPOVs(int32_t joystickNum,
+                                        HAL_JoystickPOVs* povs) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  *povs = m_joystickPOVs[joystickNum];
+}
+void DriverStationData::GetJoystickButtons(int32_t joystickNum,
+                                           HAL_JoystickButtons* buttons) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  *buttons = m_joystickButtons[joystickNum];
+}
+void DriverStationData::GetJoystickDescriptor(
+    int32_t joystickNum, HAL_JoystickDescriptor* descriptor) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  *descriptor = m_joystickDescriptor[joystickNum];
+  // Always ensure name is null terminated
+  descriptor->name[255] = '\0';
+}
+void DriverStationData::GetJoystickOutputs(int32_t joystickNum,
+                                           int64_t* outputs,
+                                           int32_t* leftRumble,
+                                           int32_t* rightRumble) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  *leftRumble = m_joystickOutputs[joystickNum].leftRumble;
+  *outputs = m_joystickOutputs[joystickNum].outputs;
+  *rightRumble = m_joystickOutputs[joystickNum].rightRumble;
+}
+void DriverStationData::GetMatchInfo(HAL_MatchInfo* info) {
+  std::lock_guard<wpi::mutex> lock(m_matchInfoMutex);
+  auto eventLen = m_matchInfo->eventName.size();
+  info->eventName = static_cast<char*>(std::malloc(eventLen + 1));
+  std::memcpy(info->eventName, m_matchInfo->eventName.c_str(), eventLen);
+  auto gameLen = m_matchInfo->gameSpecificMessage.size();
+  info->gameSpecificMessage = static_cast<char*>(std::malloc(gameLen + 1));
+  std::memcpy(info->gameSpecificMessage,
+              m_matchInfo->gameSpecificMessage.c_str(), gameLen);
+  info->gameSpecificMessage[gameLen] = '\0';
+  info->eventName[eventLen] = '\0';
+  info->matchNumber = m_matchInfo->matchNumber;
+  info->replayNumber = m_matchInfo->replayNumber;
+  info->matchType = m_matchInfo->matchType;
+}
+void DriverStationData::FreeMatchInfo(const HAL_MatchInfo* info) {
+  std::free(info->eventName);
+  std::free(info->gameSpecificMessage);
+}
+
+void DriverStationData::SetJoystickAxes(int32_t joystickNum,
+                                        const HAL_JoystickAxes* axes) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  m_joystickAxes[joystickNum] = *axes;
+}
+void DriverStationData::SetJoystickPOVs(int32_t joystickNum,
+                                        const HAL_JoystickPOVs* povs) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  m_joystickPOVs[joystickNum] = *povs;
+}
+void DriverStationData::SetJoystickButtons(int32_t joystickNum,
+                                           const HAL_JoystickButtons* buttons) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  m_joystickButtons[joystickNum] = *buttons;
+}
+
+void DriverStationData::SetJoystickDescriptor(
+    int32_t joystickNum, const HAL_JoystickDescriptor* descriptor) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  m_joystickDescriptor[joystickNum] = *descriptor;
+}
+
+void DriverStationData::SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+                                           int32_t leftRumble,
+                                           int32_t rightRumble) {
+  std::lock_guard<wpi::mutex> lock(m_joystickDataMutex);
+  m_joystickOutputs[joystickNum].leftRumble = leftRumble;
+  m_joystickOutputs[joystickNum].outputs = outputs;
+  m_joystickOutputs[joystickNum].rightRumble = rightRumble;
+}
+
+void DriverStationData::SetMatchInfo(const HAL_MatchInfo* info) {
+  std::lock_guard<wpi::mutex> lock(m_matchInfoMutex);
+  m_matchInfo->eventName = info->eventName;
+  m_matchInfo->gameSpecificMessage = info->gameSpecificMessage;
+  m_matchInfo->matchNumber = info->matchNumber;
+  m_matchInfo->matchType = info->matchType;
+  m_matchInfo->replayNumber = info->replayNumber;
+}
+
+void DriverStationData::NotifyNewData() { HAL_ReleaseDSMutex(); }
+
+extern "C" {
+void HALSIM_ResetDriverStationData(void) { SimDriverStationData->ResetData(); }
+
+int32_t HALSIM_RegisterDriverStationEnabledCallback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterEnabledCallback(callback, param,
+                                                       initialNotify);
+}
+void HALSIM_CancelDriverStationEnabledCallback(int32_t uid) {
+  SimDriverStationData->CancelEnabledCallback(uid);
+}
+HAL_Bool HALSIM_GetDriverStationEnabled(void) {
+  return SimDriverStationData->GetEnabled();
+}
+void HALSIM_SetDriverStationEnabled(HAL_Bool enabled) {
+  SimDriverStationData->SetEnabled(enabled);
+}
+
+int32_t HALSIM_RegisterDriverStationAutonomousCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterAutonomousCallback(callback, param,
+                                                          initialNotify);
+}
+void HALSIM_CancelDriverStationAutonomousCallback(int32_t uid) {
+  SimDriverStationData->CancelAutonomousCallback(uid);
+}
+HAL_Bool HALSIM_GetDriverStationAutonomous(void) {
+  return SimDriverStationData->GetAutonomous();
+}
+void HALSIM_SetDriverStationAutonomous(HAL_Bool autonomous) {
+  SimDriverStationData->SetAutonomous(autonomous);
+}
+
+int32_t HALSIM_RegisterDriverStationTestCallback(HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterTestCallback(callback, param,
+                                                    initialNotify);
+}
+void HALSIM_CancelDriverStationTestCallback(int32_t uid) {
+  SimDriverStationData->CancelTestCallback(uid);
+}
+HAL_Bool HALSIM_GetDriverStationTest(void) {
+  return SimDriverStationData->GetTest();
+}
+void HALSIM_SetDriverStationTest(HAL_Bool test) {
+  SimDriverStationData->SetTest(test);
+}
+
+int32_t HALSIM_RegisterDriverStationEStopCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterEStopCallback(callback, param,
+                                                     initialNotify);
+}
+void HALSIM_CancelDriverStationEStopCallback(int32_t uid) {
+  SimDriverStationData->CancelEStopCallback(uid);
+}
+HAL_Bool HALSIM_GetDriverStationEStop(void) {
+  return SimDriverStationData->GetEStop();
+}
+void HALSIM_SetDriverStationEStop(HAL_Bool eStop) {
+  SimDriverStationData->SetEStop(eStop);
+}
+
+int32_t HALSIM_RegisterDriverStationFmsAttachedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterFmsAttachedCallback(callback, param,
+                                                           initialNotify);
+}
+void HALSIM_CancelDriverStationFmsAttachedCallback(int32_t uid) {
+  SimDriverStationData->CancelFmsAttachedCallback(uid);
+}
+HAL_Bool HALSIM_GetDriverStationFmsAttached(void) {
+  return SimDriverStationData->GetFmsAttached();
+}
+void HALSIM_SetDriverStationFmsAttached(HAL_Bool fmsAttached) {
+  SimDriverStationData->SetFmsAttached(fmsAttached);
+}
+
+int32_t HALSIM_RegisterDriverStationDsAttachedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterDsAttachedCallback(callback, param,
+                                                          initialNotify);
+}
+void HALSIM_CancelDriverStationDsAttachedCallback(int32_t uid) {
+  SimDriverStationData->CancelDsAttachedCallback(uid);
+}
+HAL_Bool HALSIM_GetDriverStationDsAttached(void) {
+  return SimDriverStationData->GetDsAttached();
+}
+void HALSIM_SetDriverStationDsAttached(HAL_Bool dsAttached) {
+  SimDriverStationData->SetDsAttached(dsAttached);
+}
+
+int32_t HALSIM_RegisterDriverStationAllianceStationIdCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterAllianceStationIdCallback(
+      callback, param, initialNotify);
+}
+void HALSIM_CancelDriverStationAllianceStationIdCallback(int32_t uid) {
+  SimDriverStationData->CancelAllianceStationIdCallback(uid);
+}
+HAL_AllianceStationID HALSIM_GetDriverStationAllianceStationId(void) {
+  return SimDriverStationData->GetAllianceStationId();
+}
+void HALSIM_SetDriverStationAllianceStationId(
+    HAL_AllianceStationID allianceStationId) {
+  SimDriverStationData->SetAllianceStationId(allianceStationId);
+}
+
+int32_t HALSIM_RegisterDriverStationMatchTimeCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  return SimDriverStationData->RegisterMatchTimeCallback(callback, param,
+                                                         initialNotify);
+}
+void HALSIM_CancelDriverStationMatchTimeCallback(int32_t uid) {
+  SimDriverStationData->CancelMatchTimeCallback(uid);
+}
+double HALSIM_GetDriverStationMatchTime(void) {
+  return SimDriverStationData->GetMatchTime();
+}
+void HALSIM_SetDriverStationMatchTime(double matchTime) {
+  SimDriverStationData->SetMatchTime(matchTime);
+}
+
+void HALSIM_SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes) {
+  SimDriverStationData->SetJoystickAxes(joystickNum, axes);
+}
+
+void HALSIM_SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs) {
+  SimDriverStationData->SetJoystickPOVs(joystickNum, povs);
+}
+
+void HALSIM_SetJoystickButtons(int32_t joystickNum,
+                               const HAL_JoystickButtons* buttons) {
+  SimDriverStationData->SetJoystickButtons(joystickNum, buttons);
+}
+void HALSIM_SetJoystickDescriptor(int32_t joystickNum,
+                                  const HAL_JoystickDescriptor* descriptor) {
+  SimDriverStationData->SetJoystickDescriptor(joystickNum, descriptor);
+}
+
+void HALSIM_GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
+                               int32_t* leftRumble, int32_t* rightRumble) {
+  SimDriverStationData->GetJoystickOutputs(joystickNum, outputs, leftRumble,
+                                           rightRumble);
+}
+
+void HALSIM_SetMatchInfo(const HAL_MatchInfo* info) {
+  SimDriverStationData->SetMatchInfo(info);
+}
+
+void HALSIM_NotifyDriverStationNewData(void) {
+  SimDriverStationData->NotifyNewData();
+}
+
+void HALSIM_RegisterDriverStationAllCallbacks(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  SimDriverStationData->RegisterEnabledCallback(callback, param, initialNotify);
+  SimDriverStationData->RegisterAutonomousCallback(callback, param,
+                                                   initialNotify);
+  SimDriverStationData->RegisterTestCallback(callback, param, initialNotify);
+  SimDriverStationData->RegisterEStopCallback(callback, param, initialNotify);
+  SimDriverStationData->RegisterFmsAttachedCallback(callback, param,
+                                                    initialNotify);
+  SimDriverStationData->RegisterDsAttachedCallback(callback, param,
+                                                   initialNotify);
+  SimDriverStationData->RegisterAllianceStationIdCallback(callback, param,
+                                                          initialNotify);
+  SimDriverStationData->RegisterMatchTimeCallback(callback, param,
+                                                  initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DriverStationDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DriverStationDataInternal.h
new file mode 100644
index 0000000..16614c2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/DriverStationDataInternal.h
@@ -0,0 +1,139 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <array>
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/DriverStationData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+struct JoystickOutputStore;
+struct MatchInfoDataStore;
+
+class DriverStationData {
+ public:
+  DriverStationData();
+  void ResetData();
+
+  int32_t RegisterEnabledCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelEnabledCallback(int32_t uid);
+  void InvokeEnabledCallback(HAL_Value value);
+  HAL_Bool GetEnabled();
+  void SetEnabled(HAL_Bool enabled);
+
+  int32_t RegisterAutonomousCallback(HAL_NotifyCallback callback, void* param,
+                                     HAL_Bool initialNotify);
+  void CancelAutonomousCallback(int32_t uid);
+  void InvokeAutonomousCallback(HAL_Value value);
+  HAL_Bool GetAutonomous();
+  void SetAutonomous(HAL_Bool autonomous);
+
+  int32_t RegisterTestCallback(HAL_NotifyCallback callback, void* param,
+                               HAL_Bool initialNotify);
+  void CancelTestCallback(int32_t uid);
+  void InvokeTestCallback(HAL_Value value);
+  HAL_Bool GetTest();
+  void SetTest(HAL_Bool test);
+
+  int32_t RegisterEStopCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelEStopCallback(int32_t uid);
+  void InvokeEStopCallback(HAL_Value value);
+  HAL_Bool GetEStop();
+  void SetEStop(HAL_Bool eStop);
+
+  int32_t RegisterFmsAttachedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelFmsAttachedCallback(int32_t uid);
+  void InvokeFmsAttachedCallback(HAL_Value value);
+  HAL_Bool GetFmsAttached();
+  void SetFmsAttached(HAL_Bool fmsAttached);
+
+  int32_t RegisterDsAttachedCallback(HAL_NotifyCallback callback, void* param,
+                                     HAL_Bool initialNotify);
+  void CancelDsAttachedCallback(int32_t uid);
+  void InvokeDsAttachedCallback(HAL_Value value);
+  HAL_Bool GetDsAttached();
+  void SetDsAttached(HAL_Bool dsAttached);
+
+  int32_t RegisterAllianceStationIdCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+  void CancelAllianceStationIdCallback(int32_t uid);
+  void InvokeAllianceStationIdCallback(HAL_Value value);
+  HAL_AllianceStationID GetAllianceStationId();
+  void SetAllianceStationId(HAL_AllianceStationID allianceStationId);
+
+  int32_t RegisterMatchTimeCallback(HAL_NotifyCallback callback, void* param,
+                                    HAL_Bool initialNotify);
+  void CancelMatchTimeCallback(int32_t uid);
+  void InvokeMatchTimeCallback(HAL_Value value);
+  double GetMatchTime();
+  void SetMatchTime(double matchTime);
+
+  void GetJoystickAxes(int32_t joystickNum, HAL_JoystickAxes* axes);
+  void GetJoystickPOVs(int32_t joystickNum, HAL_JoystickPOVs* povs);
+  void GetJoystickButtons(int32_t joystickNum, HAL_JoystickButtons* buttons);
+  void GetJoystickDescriptor(int32_t joystickNum,
+                             HAL_JoystickDescriptor* descriptor);
+  void GetJoystickOutputs(int32_t joystickNum, int64_t* outputs,
+                          int32_t* leftRumble, int32_t* rightRumble);
+  void GetMatchInfo(HAL_MatchInfo* info);
+  void FreeMatchInfo(const HAL_MatchInfo* info);
+
+  void SetJoystickAxes(int32_t joystickNum, const HAL_JoystickAxes* axes);
+  void SetJoystickPOVs(int32_t joystickNum, const HAL_JoystickPOVs* povs);
+  void SetJoystickButtons(int32_t joystickNum,
+                          const HAL_JoystickButtons* buttons);
+  void SetJoystickDescriptor(int32_t joystickNum,
+                             const HAL_JoystickDescriptor* descriptor);
+  void SetJoystickOutputs(int32_t joystickNum, int64_t outputs,
+                          int32_t leftRumble, int32_t rightRumble);
+  void SetMatchInfo(const HAL_MatchInfo* info);
+
+  void NotifyNewData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_enabled{false};
+  std::shared_ptr<NotifyListenerVector> m_enabledCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_autonomous{false};
+  std::shared_ptr<NotifyListenerVector> m_autonomousCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_test{false};
+  std::shared_ptr<NotifyListenerVector> m_testCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_eStop{false};
+  std::shared_ptr<NotifyListenerVector> m_eStopCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_fmsAttached{false};
+  std::shared_ptr<NotifyListenerVector> m_fmsAttachedCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_dsAttached{false};
+  std::shared_ptr<NotifyListenerVector> m_dsAttachedCallbacks = nullptr;
+  std::atomic<HAL_AllianceStationID> m_allianceStationId{
+      static_cast<HAL_AllianceStationID>(0)};
+  std::shared_ptr<NotifyListenerVector> m_allianceStationIdCallbacks = nullptr;
+  std::atomic<double> m_matchTime{0.0};
+  std::shared_ptr<NotifyListenerVector> m_matchTimeCallbacks = nullptr;
+
+  wpi::mutex m_joystickDataMutex;
+  wpi::mutex m_matchInfoMutex;
+
+  std::unique_ptr<HAL_JoystickAxes[]> m_joystickAxes;
+  std::unique_ptr<HAL_JoystickPOVs[]> m_joystickPOVs;
+  std::unique_ptr<HAL_JoystickButtons[]> m_joystickButtons;
+
+  std::unique_ptr<JoystickOutputStore[]> m_joystickOutputs;
+  std::unique_ptr<HAL_JoystickDescriptor[]> m_joystickDescriptor;
+  std::unique_ptr<MatchInfoDataStore> m_matchInfo;
+};
+extern DriverStationData* SimDriverStationData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/EncoderData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/EncoderData.cpp
new file mode 100644
index 0000000..b8da1b7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/EncoderData.cpp
@@ -0,0 +1,555 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "EncoderDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeEncoderData() {
+  static EncoderData sed[kNumEncoders];
+  ::hal::SimEncoderData = sed;
+}
+}  // namespace init
+}  // namespace hal
+
+EncoderData* hal::SimEncoderData;
+void EncoderData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_count = 0;
+  m_countCallbacks = nullptr;
+  m_period = std::numeric_limits<double>::max();
+  m_periodCallbacks = nullptr;
+  m_reset = false;
+  m_resetCallbacks = nullptr;
+  m_maxPeriod = 0;
+  m_maxPeriodCallbacks = nullptr;
+  m_direction = false;
+  m_directionCallbacks = nullptr;
+  m_reverseDirection = false;
+  m_reverseDirectionCallbacks = nullptr;
+  m_samplesToAverage = 0;
+  m_samplesToAverageCallbacks = nullptr;
+  m_distancePerPulse = 0;
+  m_distancePerPulseCallbacks = nullptr;
+}
+
+int32_t EncoderData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void EncoderData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool EncoderData::GetInitialized() { return m_initialized; }
+
+void EncoderData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t EncoderData::RegisterCountCallback(HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_countCallbacks =
+        RegisterCallback(m_countCallbacks, "Count", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetCount());
+    callback("Count", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelCountCallback(int32_t uid) {
+  m_countCallbacks = CancelCallback(m_countCallbacks, uid);
+}
+
+void EncoderData::InvokeCountCallback(HAL_Value value) {
+  InvokeCallback(m_countCallbacks, "Count", &value);
+}
+
+int32_t EncoderData::GetCount() { return m_count; }
+
+void EncoderData::SetCount(int32_t count) {
+  int32_t oldValue = m_count.exchange(count);
+  if (oldValue != count) {
+    InvokeCountCallback(MakeInt(count));
+  }
+}
+
+int32_t EncoderData::RegisterPeriodCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_periodCallbacks =
+        RegisterCallback(m_periodCallbacks, "Period", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetPeriod());
+    callback("Period", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelPeriodCallback(int32_t uid) {
+  m_periodCallbacks = CancelCallback(m_periodCallbacks, uid);
+}
+
+void EncoderData::InvokePeriodCallback(HAL_Value value) {
+  InvokeCallback(m_periodCallbacks, "Period", &value);
+}
+
+double EncoderData::GetPeriod() { return m_period; }
+
+void EncoderData::SetPeriod(double period) {
+  double oldValue = m_period.exchange(period);
+  if (oldValue != period) {
+    InvokePeriodCallback(MakeDouble(period));
+  }
+}
+
+int32_t EncoderData::RegisterResetCallback(HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_resetCallbacks =
+        RegisterCallback(m_resetCallbacks, "Reset", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetReset());
+    callback("Reset", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelResetCallback(int32_t uid) {
+  m_resetCallbacks = CancelCallback(m_resetCallbacks, uid);
+}
+
+void EncoderData::InvokeResetCallback(HAL_Value value) {
+  InvokeCallback(m_resetCallbacks, "Reset", &value);
+}
+
+HAL_Bool EncoderData::GetReset() { return m_reset; }
+
+void EncoderData::SetReset(HAL_Bool reset) {
+  HAL_Bool oldValue = m_reset.exchange(reset);
+  if (oldValue != reset) {
+    InvokeResetCallback(MakeBoolean(reset));
+  }
+}
+
+int32_t EncoderData::RegisterMaxPeriodCallback(HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_maxPeriodCallbacks = RegisterCallback(m_maxPeriodCallbacks, "MaxPeriod",
+                                            callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetMaxPeriod());
+    callback("MaxPeriod", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelMaxPeriodCallback(int32_t uid) {
+  m_maxPeriodCallbacks = CancelCallback(m_maxPeriodCallbacks, uid);
+}
+
+void EncoderData::InvokeMaxPeriodCallback(HAL_Value value) {
+  InvokeCallback(m_maxPeriodCallbacks, "MaxPeriod", &value);
+}
+
+double EncoderData::GetMaxPeriod() { return m_maxPeriod; }
+
+void EncoderData::SetMaxPeriod(double maxPeriod) {
+  double oldValue = m_maxPeriod.exchange(maxPeriod);
+  if (oldValue != maxPeriod) {
+    InvokeMaxPeriodCallback(MakeDouble(maxPeriod));
+  }
+}
+
+int32_t EncoderData::RegisterDirectionCallback(HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_directionCallbacks = RegisterCallback(m_directionCallbacks, "Direction",
+                                            callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetDirection());
+    callback("Direction", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelDirectionCallback(int32_t uid) {
+  m_directionCallbacks = CancelCallback(m_directionCallbacks, uid);
+}
+
+void EncoderData::InvokeDirectionCallback(HAL_Value value) {
+  InvokeCallback(m_directionCallbacks, "Direction", &value);
+}
+
+HAL_Bool EncoderData::GetDirection() { return m_direction; }
+
+void EncoderData::SetDirection(HAL_Bool direction) {
+  HAL_Bool oldValue = m_direction.exchange(direction);
+  if (oldValue != direction) {
+    InvokeDirectionCallback(MakeBoolean(direction));
+  }
+}
+
+int32_t EncoderData::RegisterReverseDirectionCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_reverseDirectionCallbacks =
+        RegisterCallback(m_reverseDirectionCallbacks, "ReverseDirection",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetReverseDirection());
+    callback("ReverseDirection", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelReverseDirectionCallback(int32_t uid) {
+  m_reverseDirectionCallbacks =
+      CancelCallback(m_reverseDirectionCallbacks, uid);
+}
+
+void EncoderData::InvokeReverseDirectionCallback(HAL_Value value) {
+  InvokeCallback(m_reverseDirectionCallbacks, "ReverseDirection", &value);
+}
+
+HAL_Bool EncoderData::GetReverseDirection() { return m_reverseDirection; }
+
+void EncoderData::SetReverseDirection(HAL_Bool reverseDirection) {
+  HAL_Bool oldValue = m_reverseDirection.exchange(reverseDirection);
+  if (oldValue != reverseDirection) {
+    InvokeReverseDirectionCallback(MakeBoolean(reverseDirection));
+  }
+}
+
+int32_t EncoderData::RegisterSamplesToAverageCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_samplesToAverageCallbacks =
+        RegisterCallback(m_samplesToAverageCallbacks, "SamplesToAverage",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetSamplesToAverage());
+    callback("SamplesToAverage", param, &value);
+  }
+  return newUid;
+}
+
+void EncoderData::CancelSamplesToAverageCallback(int32_t uid) {
+  m_samplesToAverageCallbacks =
+      CancelCallback(m_samplesToAverageCallbacks, uid);
+}
+
+void EncoderData::InvokeSamplesToAverageCallback(HAL_Value value) {
+  InvokeCallback(m_samplesToAverageCallbacks, "SamplesToAverage", &value);
+}
+
+int32_t EncoderData::GetSamplesToAverage() { return m_samplesToAverage; }
+
+void EncoderData::SetSamplesToAverage(int32_t samplesToAverage) {
+  int32_t oldValue = m_samplesToAverage.exchange(samplesToAverage);
+  if (oldValue != samplesToAverage) {
+    InvokeSamplesToAverageCallback(MakeInt(samplesToAverage));
+  }
+}
+
+int32_t EncoderData::RegisterDistancePerPulseCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_distancePerPulseCallbacks =
+        RegisterCallback(m_distancePerPulseCallbacks, "DistancePerPulse",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetDistancePerPulse());
+    callback("DistancePerPulse", param, &value);
+  }
+  return newUid;
+}
+void EncoderData::CancelDistancePerPulseCallback(int32_t uid) {
+  m_distancePerPulseCallbacks =
+      CancelCallback(m_distancePerPulseCallbacks, uid);
+}
+
+void EncoderData::InvokeDistancePerPulseCallback(HAL_Value value) {
+  InvokeCallback(m_distancePerPulseCallbacks, "DistancePerPulse", &value);
+}
+
+double EncoderData::GetDistancePerPulse() { return m_distancePerPulse; }
+
+void EncoderData::SetDistancePerPulse(double distancePerPulse) {
+  double oldValue = m_distancePerPulse.exchange(distancePerPulse);
+  if (oldValue != distancePerPulse) {
+    InvokeDistancePerPulseCallback(MakeDouble(distancePerPulse));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetEncoderData(int32_t index) {
+  SimEncoderData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterEncoderInitializedCallback(int32_t index,
+                                                  HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterInitializedCallback(callback, param,
+                                                           initialNotify);
+}
+
+void HALSIM_CancelEncoderInitializedCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetEncoderInitialized(int32_t index) {
+  return SimEncoderData[index].GetInitialized();
+}
+
+void HALSIM_SetEncoderInitialized(int32_t index, HAL_Bool initialized) {
+  SimEncoderData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterEncoderCountCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterCountCallback(callback, param,
+                                                     initialNotify);
+}
+
+void HALSIM_CancelEncoderCountCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelCountCallback(uid);
+}
+
+int32_t HALSIM_GetEncoderCount(int32_t index) {
+  return SimEncoderData[index].GetCount();
+}
+
+void HALSIM_SetEncoderCount(int32_t index, int32_t count) {
+  SimEncoderData[index].SetCount(count);
+}
+
+int32_t HALSIM_RegisterEncoderPeriodCallback(int32_t index,
+                                             HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterPeriodCallback(callback, param,
+                                                      initialNotify);
+}
+
+void HALSIM_CancelEncoderPeriodCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelPeriodCallback(uid);
+}
+
+double HALSIM_GetEncoderPeriod(int32_t index) {
+  return SimEncoderData[index].GetPeriod();
+}
+
+void HALSIM_SetEncoderPeriod(int32_t index, double period) {
+  SimEncoderData[index].SetPeriod(period);
+}
+
+int32_t HALSIM_RegisterEncoderResetCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterResetCallback(callback, param,
+                                                     initialNotify);
+}
+
+void HALSIM_CancelEncoderResetCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelResetCallback(uid);
+}
+
+HAL_Bool HALSIM_GetEncoderReset(int32_t index) {
+  return SimEncoderData[index].GetReset();
+}
+
+void HALSIM_SetEncoderReset(int32_t index, HAL_Bool reset) {
+  SimEncoderData[index].SetReset(reset);
+}
+
+int32_t HALSIM_RegisterEncoderMaxPeriodCallback(int32_t index,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterMaxPeriodCallback(callback, param,
+                                                         initialNotify);
+}
+
+void HALSIM_CancelEncoderMaxPeriodCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelMaxPeriodCallback(uid);
+}
+
+double HALSIM_GetEncoderMaxPeriod(int32_t index) {
+  return SimEncoderData[index].GetMaxPeriod();
+}
+
+void HALSIM_SetEncoderMaxPeriod(int32_t index, double maxPeriod) {
+  SimEncoderData[index].SetMaxPeriod(maxPeriod);
+}
+
+int32_t HALSIM_RegisterEncoderDirectionCallback(int32_t index,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterDirectionCallback(callback, param,
+                                                         initialNotify);
+}
+
+void HALSIM_CancelEncoderDirectionCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelDirectionCallback(uid);
+}
+
+HAL_Bool HALSIM_GetEncoderDirection(int32_t index) {
+  return SimEncoderData[index].GetDirection();
+}
+
+void HALSIM_SetEncoderDirection(int32_t index, HAL_Bool direction) {
+  SimEncoderData[index].SetDirection(direction);
+}
+
+int32_t HALSIM_RegisterEncoderReverseDirectionCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterReverseDirectionCallback(callback, param,
+                                                                initialNotify);
+}
+
+void HALSIM_CancelEncoderReverseDirectionCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelReverseDirectionCallback(uid);
+}
+
+HAL_Bool HALSIM_GetEncoderReverseDirection(int32_t index) {
+  return SimEncoderData[index].GetReverseDirection();
+}
+
+void HALSIM_SetEncoderReverseDirection(int32_t index,
+                                       HAL_Bool reverseDirection) {
+  SimEncoderData[index].SetReverseDirection(reverseDirection);
+}
+
+int32_t HALSIM_RegisterEncoderSamplesToAverageCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimEncoderData[index].RegisterSamplesToAverageCallback(callback, param,
+                                                                initialNotify);
+}
+
+void HALSIM_CancelEncoderSamplesToAverageCallback(int32_t index, int32_t uid) {
+  SimEncoderData[index].CancelSamplesToAverageCallback(uid);
+}
+
+int32_t HALSIM_GetEncoderSamplesToAverage(int32_t index) {
+  return SimEncoderData[index].GetSamplesToAverage();
+}
+
+void HALSIM_SetEncoderSamplesToAverage(int32_t index,
+                                       int32_t samplesToAverage) {
+  SimEncoderData[index].SetSamplesToAverage(samplesToAverage);
+}
+
+void HALSIM_RegisterEncoderAllCallbacks(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify) {
+  SimEncoderData[index].RegisterInitializedCallback(callback, param,
+                                                    initialNotify);
+  SimEncoderData[index].RegisterCountCallback(callback, param, initialNotify);
+  SimEncoderData[index].RegisterPeriodCallback(callback, param, initialNotify);
+  SimEncoderData[index].RegisterResetCallback(callback, param, initialNotify);
+  SimEncoderData[index].RegisterMaxPeriodCallback(callback, param,
+                                                  initialNotify);
+  SimEncoderData[index].RegisterDirectionCallback(callback, param,
+                                                  initialNotify);
+  SimEncoderData[index].RegisterReverseDirectionCallback(callback, param,
+                                                         initialNotify);
+  SimEncoderData[index].RegisterSamplesToAverageCallback(callback, param,
+                                                         initialNotify);
+  SimEncoderData[index].RegisterDistancePerPulseCallback(callback, param,
+                                                         initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/EncoderDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/EncoderDataInternal.h
new file mode 100644
index 0000000..df86ec6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/EncoderDataInternal.h
@@ -0,0 +1,109 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <limits>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/EncoderData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class EncoderData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterCountCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelCountCallback(int32_t uid);
+  void InvokeCountCallback(HAL_Value value);
+  int32_t GetCount();
+  void SetCount(int32_t count);
+
+  int32_t RegisterPeriodCallback(HAL_NotifyCallback callback, void* param,
+                                 HAL_Bool initialNotify);
+  void CancelPeriodCallback(int32_t uid);
+  void InvokePeriodCallback(HAL_Value value);
+  double GetPeriod();
+  void SetPeriod(double period);
+
+  int32_t RegisterResetCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelResetCallback(int32_t uid);
+  void InvokeResetCallback(HAL_Value value);
+  HAL_Bool GetReset();
+  void SetReset(HAL_Bool reset);
+
+  int32_t RegisterMaxPeriodCallback(HAL_NotifyCallback callback, void* param,
+                                    HAL_Bool initialNotify);
+  void CancelMaxPeriodCallback(int32_t uid);
+  void InvokeMaxPeriodCallback(HAL_Value value);
+  double GetMaxPeriod();
+  void SetMaxPeriod(double maxPeriod);
+
+  int32_t RegisterDirectionCallback(HAL_NotifyCallback callback, void* param,
+                                    HAL_Bool initialNotify);
+  void CancelDirectionCallback(int32_t uid);
+  void InvokeDirectionCallback(HAL_Value value);
+  HAL_Bool GetDirection();
+  void SetDirection(HAL_Bool direction);
+
+  int32_t RegisterReverseDirectionCallback(HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+  void CancelReverseDirectionCallback(int32_t uid);
+  void InvokeReverseDirectionCallback(HAL_Value value);
+  HAL_Bool GetReverseDirection();
+  void SetReverseDirection(HAL_Bool reverseDirection);
+
+  int32_t RegisterSamplesToAverageCallback(HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+  void CancelSamplesToAverageCallback(int32_t uid);
+  void InvokeSamplesToAverageCallback(HAL_Value value);
+  int32_t GetSamplesToAverage();
+  void SetSamplesToAverage(int32_t samplesToAverage);
+
+  int32_t RegisterDistancePerPulseCallback(HAL_NotifyCallback callback,
+                                           void* param, HAL_Bool initialNotify);
+  void CancelDistancePerPulseCallback(int32_t uid);
+  void InvokeDistancePerPulseCallback(HAL_Value value);
+  double GetDistancePerPulse();
+  void SetDistancePerPulse(double distancePerPulse);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<int32_t> m_count{0};
+  std::shared_ptr<NotifyListenerVector> m_countCallbacks = nullptr;
+  std::atomic<double> m_period{std::numeric_limits<double>::max()};
+  std::shared_ptr<NotifyListenerVector> m_periodCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_reset{false};
+  std::shared_ptr<NotifyListenerVector> m_resetCallbacks = nullptr;
+  std::atomic<double> m_maxPeriod{0};
+  std::shared_ptr<NotifyListenerVector> m_maxPeriodCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_direction{false};
+  std::shared_ptr<NotifyListenerVector> m_directionCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_reverseDirection{false};
+  std::shared_ptr<NotifyListenerVector> m_reverseDirectionCallbacks = nullptr;
+  std::atomic<int32_t> m_samplesToAverage{0};
+  std::shared_ptr<NotifyListenerVector> m_samplesToAverageCallbacks = nullptr;
+  std::atomic<double> m_distancePerPulse{0};
+  std::shared_ptr<NotifyListenerVector> m_distancePerPulseCallbacks = nullptr;
+};
+extern EncoderData* SimEncoderData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/HALValueInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/HALValueInternal.h
new file mode 100644
index 0000000..05d59a1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/HALValueInternal.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include "MockData/HALValue.h"
+#include "MockData/llvm/StringRef.h"
+
+namespace hal {
+
+class Value;
+
+void ConvertToC(const Value& in, HAL_Value* out);
+std::shared_ptr<Value> ConvertFromC(const HAL_Value& value);
+void ConvertToC(llvm::StringRef in, HALString* out);
+inline llvm::StringRef ConvertFromC(const HALString& str) {
+  return llvm::StringRef(str.str, str.len);
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/I2CData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/I2CData.cpp
new file mode 100644
index 0000000..b129ff9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/I2CData.cpp
@@ -0,0 +1,161 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "../PortsInternal.h"
+#include "I2CDataInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeI2CData() {
+  static I2CData sid[2];
+  ::hal::SimI2CData = sid;
+}
+}  // namespace init
+}  // namespace hal
+
+I2CData* hal::SimI2CData;
+
+void I2CData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_readCallbacks = nullptr;
+}
+
+I2CData::I2CData() {}
+I2CData::~I2CData() {}
+
+///////////////////////////////////////////
+// Initialize
+///////////////////////////////////////////
+int32_t I2CData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void I2CData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void I2CData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool I2CData::GetInitialized() { return m_initialized; }
+
+void I2CData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t I2CData::RegisterReadCallback(HAL_BufferCallback callback,
+                                      void* param) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_readCallbacks =
+        RegisterCallback(m_readCallbacks, "Read", callback, param, &newUid);
+  }
+  return newUid;
+}
+
+void I2CData::CancelReadCallback(int32_t uid) {
+  m_readCallbacks = CancelCallback(m_readCallbacks, uid);
+}
+
+int32_t I2CData::RegisterWriteCallback(HAL_ConstBufferCallback callback,
+                                       void* param) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_writeCallbacks =
+        RegisterCallback(m_writeCallbacks, "Write", callback, param, &newUid);
+  }
+  return newUid;
+}
+
+void I2CData::CancelWriteCallback(int32_t uid) {
+  m_writeCallbacks = CancelCallback(m_writeCallbacks, uid);
+}
+
+void I2CData::Write(int32_t deviceAddress, const uint8_t* dataToSend,
+                    int32_t sendSize) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  InvokeCallback(m_writeCallbacks, "Write", const_cast<uint8_t*>(dataToSend),
+                 sendSize);
+}
+void I2CData::Read(int32_t deviceAddress, uint8_t* buffer, int32_t count) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  InvokeCallback(m_readCallbacks, "Read", buffer, count);
+}
+
+extern "C" {
+void HALSIM_ResetI2CData(int32_t index) { SimI2CData[index].ResetData(); }
+
+int32_t HALSIM_RegisterI2CInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimI2CData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelI2CInitializedCallback(int32_t index, int32_t uid) {
+  SimI2CData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetI2CInitialized(int32_t index) {
+  return SimI2CData[index].GetInitialized();
+}
+
+void HALSIM_SetI2CInitialized(int32_t index, HAL_Bool initialized) {
+  SimI2CData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterI2CReadCallback(int32_t index,
+                                       HAL_BufferCallback callback,
+                                       void* param) {
+  return SimI2CData[index].RegisterReadCallback(callback, param);
+}
+void HALSIM_CancelI2CReadCallback(int32_t index, int32_t uid) {
+  SimI2CData[index].CancelReadCallback(uid);
+}
+
+int32_t HALSIM_RegisterI2CWriteCallback(int32_t index,
+                                        HAL_ConstBufferCallback callback,
+                                        void* param) {
+  return SimI2CData[index].RegisterWriteCallback(callback, param);
+}
+void HALSIM_CancelI2CWriteCallback(int32_t index, int32_t uid) {
+  SimI2CData[index].CancelWriteCallback(uid);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/I2CDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/I2CDataInternal.h
new file mode 100644
index 0000000..3b53b25
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/I2CDataInternal.h
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <limits>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/I2CData.h"
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class I2CData {
+ public:
+  I2CData();
+  ~I2CData();
+
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterReadCallback(HAL_BufferCallback callback, void* param);
+  void CancelReadCallback(int32_t uid);
+
+  int32_t RegisterWriteCallback(HAL_ConstBufferCallback callback, void* param);
+  void CancelWriteCallback(int32_t uid);
+
+  void Write(int32_t deviceAddress, const uint8_t* dataToSend,
+             int32_t sendSize);
+  void Read(int32_t deviceAddress, uint8_t* buffer, int32_t count);
+
+  void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  wpi::mutex m_dataMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::shared_ptr<BufferListenerVector> m_readCallbacks = nullptr;
+  std::shared_ptr<ConstBufferListenerVector> m_writeCallbacks = nullptr;
+};
+extern I2CData* SimI2CData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/NotifyCallbackHelpers.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/NotifyCallbackHelpers.cpp
new file mode 100644
index 0000000..2a2b8b8
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/NotifyCallbackHelpers.cpp
@@ -0,0 +1,89 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+std::shared_ptr<NotifyListenerVector> RegisterCallback(
+    std::shared_ptr<NotifyListenerVector> currentVector, const char* name,
+    HAL_NotifyCallback callback, void* param, int32_t* newUid) {
+  return RegisterCallbackImpl<NotifyListenerVector, HAL_NotifyCallback>(
+      currentVector, name, callback, param, newUid);
+}
+
+std::shared_ptr<NotifyListenerVector> CancelCallback(
+    std::shared_ptr<NotifyListenerVector> currentVector, int32_t uid) {
+  return CancelCallbackImpl<NotifyListenerVector, HAL_NotifyCallback>(
+      currentVector, uid);
+}
+
+void InvokeCallback(std::shared_ptr<NotifyListenerVector> currentVector,
+                    const char* name, const HAL_Value* value) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, value);
+  }
+}
+
+std::shared_ptr<BufferListenerVector> RegisterCallback(
+    std::shared_ptr<BufferListenerVector> currentVector, const char* name,
+    HAL_BufferCallback callback, void* param, int32_t* newUid) {
+  return RegisterCallbackImpl<BufferListenerVector, HAL_BufferCallback>(
+      currentVector, name, callback, param, newUid);
+}
+
+std::shared_ptr<BufferListenerVector> CancelCallback(
+    std::shared_ptr<BufferListenerVector> currentVector, int32_t uid) {
+  return CancelCallbackImpl<BufferListenerVector, HAL_BufferCallback>(
+      currentVector, uid);
+}
+
+void InvokeCallback(std::shared_ptr<BufferListenerVector> currentVector,
+                    const char* name, uint8_t* buffer, int32_t count) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, buffer, count);
+  }
+}
+
+std::shared_ptr<ConstBufferListenerVector> RegisterCallback(
+    std::shared_ptr<ConstBufferListenerVector> currentVector, const char* name,
+    HAL_ConstBufferCallback callback, void* param, int32_t* newUid) {
+  return RegisterCallbackImpl<ConstBufferListenerVector,
+                              HAL_ConstBufferCallback>(currentVector, name,
+                                                       callback, param, newUid);
+}
+
+std::shared_ptr<ConstBufferListenerVector> CancelCallback(
+    std::shared_ptr<ConstBufferListenerVector> currentVector, int32_t uid) {
+  return CancelCallbackImpl<ConstBufferListenerVector, HAL_ConstBufferCallback>(
+      currentVector, uid);
+}
+
+void InvokeCallback(std::shared_ptr<ConstBufferListenerVector> currentVector,
+                    const char* name, const uint8_t* buffer, int32_t count) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, buffer, count);
+  }
+}
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PCMData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PCMData.cpp
new file mode 100644
index 0000000..b0848df
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PCMData.cpp
@@ -0,0 +1,486 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "PCMDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePCMData() {
+  static PCMData spd[kNumPCMModules];
+  ::hal::SimPCMData = spd;
+}
+}  // namespace init
+}  // namespace hal
+
+PCMData* hal::SimPCMData;
+void PCMData::ResetData() {
+  for (int i = 0; i < kNumSolenoidChannels; i++) {
+    m_solenoidInitialized[i] = false;
+    m_solenoidInitializedCallbacks[i] = nullptr;
+    m_solenoidOutput[i] = false;
+    m_solenoidOutputCallbacks[i] = nullptr;
+  }
+  m_compressorInitialized = false;
+  m_compressorInitializedCallbacks = nullptr;
+  m_compressorOn = false;
+  m_compressorOnCallbacks = nullptr;
+  m_closedLoopEnabled = true;
+  m_closedLoopEnabledCallbacks = nullptr;
+  m_pressureSwitch = false;
+  m_pressureSwitchCallbacks = nullptr;
+  m_compressorCurrent = 0.0;
+  m_compressorCurrentCallbacks = nullptr;
+}
+
+int32_t PCMData::RegisterSolenoidInitializedCallback(
+    int32_t channel, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_solenoidInitializedCallbacks[channel] =
+        RegisterCallback(m_solenoidInitializedCallbacks[channel],
+                         "SolenoidInitialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetSolenoidInitialized(channel));
+    callback("SolenoidInitialized", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelSolenoidInitializedCallback(int32_t channel, int32_t uid) {
+  m_solenoidInitializedCallbacks[channel] =
+      CancelCallback(m_solenoidInitializedCallbacks[channel], uid);
+}
+
+void PCMData::InvokeSolenoidInitializedCallback(int32_t channel,
+                                                HAL_Value value) {
+  InvokeCallback(m_solenoidInitializedCallbacks[channel], "SolenoidInitialized",
+                 &value);
+}
+
+HAL_Bool PCMData::GetSolenoidInitialized(int32_t channel) {
+  return m_solenoidInitialized[channel];
+}
+
+void PCMData::SetSolenoidInitialized(int32_t channel,
+                                     HAL_Bool solenoidInitialized) {
+  HAL_Bool oldValue =
+      m_solenoidInitialized[channel].exchange(solenoidInitialized);
+  if (oldValue != solenoidInitialized) {
+    InvokeSolenoidInitializedCallback(channel,
+                                      MakeBoolean(solenoidInitialized));
+  }
+}
+
+int32_t PCMData::RegisterSolenoidOutputCallback(int32_t channel,
+                                                HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_solenoidOutputCallbacks[channel] =
+        RegisterCallback(m_solenoidOutputCallbacks[channel], "SolenoidOutput",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetSolenoidOutput(channel));
+    callback("SolenoidOutput", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelSolenoidOutputCallback(int32_t channel, int32_t uid) {
+  m_solenoidOutputCallbacks[channel] =
+      CancelCallback(m_solenoidOutputCallbacks[channel], uid);
+}
+
+void PCMData::InvokeSolenoidOutputCallback(int32_t channel, HAL_Value value) {
+  InvokeCallback(m_solenoidOutputCallbacks[channel], "SolenoidOutput", &value);
+}
+
+HAL_Bool PCMData::GetSolenoidOutput(int32_t channel) {
+  return m_solenoidOutput[channel];
+}
+
+void PCMData::SetSolenoidOutput(int32_t channel, HAL_Bool solenoidOutput) {
+  HAL_Bool oldValue = m_solenoidOutput[channel].exchange(solenoidOutput);
+  if (oldValue != solenoidOutput) {
+    InvokeSolenoidOutputCallback(channel, MakeBoolean(solenoidOutput));
+  }
+}
+
+int32_t PCMData::RegisterCompressorInitializedCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_compressorInitializedCallbacks =
+        RegisterCallback(m_compressorInitializedCallbacks,
+                         "CompressorInitialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetCompressorInitialized());
+    callback("CompressorInitialized", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelCompressorInitializedCallback(int32_t uid) {
+  m_compressorInitializedCallbacks =
+      CancelCallback(m_compressorInitializedCallbacks, uid);
+}
+
+void PCMData::InvokeCompressorInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_compressorInitializedCallbacks, "CompressorInitialized",
+                 &value);
+}
+
+HAL_Bool PCMData::GetCompressorInitialized() { return m_compressorInitialized; }
+
+void PCMData::SetCompressorInitialized(HAL_Bool compressorInitialized) {
+  HAL_Bool oldValue = m_compressorInitialized.exchange(compressorInitialized);
+  if (oldValue != compressorInitialized) {
+    InvokeCompressorInitializedCallback(MakeBoolean(compressorInitialized));
+  }
+}
+
+int32_t PCMData::RegisterCompressorOnCallback(HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_compressorOnCallbacks = RegisterCallback(
+        m_compressorOnCallbacks, "CompressorOn", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetCompressorOn());
+    callback("CompressorOn", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelCompressorOnCallback(int32_t uid) {
+  m_compressorOnCallbacks = CancelCallback(m_compressorOnCallbacks, uid);
+}
+
+void PCMData::InvokeCompressorOnCallback(HAL_Value value) {
+  InvokeCallback(m_compressorOnCallbacks, "CompressorOn", &value);
+}
+
+HAL_Bool PCMData::GetCompressorOn() { return m_compressorOn; }
+
+void PCMData::SetCompressorOn(HAL_Bool compressorOn) {
+  HAL_Bool oldValue = m_compressorOn.exchange(compressorOn);
+  if (oldValue != compressorOn) {
+    InvokeCompressorOnCallback(MakeBoolean(compressorOn));
+  }
+}
+
+int32_t PCMData::RegisterClosedLoopEnabledCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_closedLoopEnabledCallbacks =
+        RegisterCallback(m_closedLoopEnabledCallbacks, "ClosedLoopEnabled",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetClosedLoopEnabled());
+    callback("ClosedLoopEnabled", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelClosedLoopEnabledCallback(int32_t uid) {
+  m_closedLoopEnabledCallbacks =
+      CancelCallback(m_closedLoopEnabledCallbacks, uid);
+}
+
+void PCMData::InvokeClosedLoopEnabledCallback(HAL_Value value) {
+  InvokeCallback(m_closedLoopEnabledCallbacks, "ClosedLoopEnabled", &value);
+}
+
+HAL_Bool PCMData::GetClosedLoopEnabled() { return m_closedLoopEnabled; }
+
+void PCMData::SetClosedLoopEnabled(HAL_Bool closedLoopEnabled) {
+  HAL_Bool oldValue = m_closedLoopEnabled.exchange(closedLoopEnabled);
+  if (oldValue != closedLoopEnabled) {
+    InvokeClosedLoopEnabledCallback(MakeBoolean(closedLoopEnabled));
+  }
+}
+
+int32_t PCMData::RegisterPressureSwitchCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_pressureSwitchCallbacks = RegisterCallback(
+        m_pressureSwitchCallbacks, "PressureSwitch", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetPressureSwitch());
+    callback("PressureSwitch", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelPressureSwitchCallback(int32_t uid) {
+  m_pressureSwitchCallbacks = CancelCallback(m_pressureSwitchCallbacks, uid);
+}
+
+void PCMData::InvokePressureSwitchCallback(HAL_Value value) {
+  InvokeCallback(m_pressureSwitchCallbacks, "PressureSwitch", &value);
+}
+
+HAL_Bool PCMData::GetPressureSwitch() { return m_pressureSwitch; }
+
+void PCMData::SetPressureSwitch(HAL_Bool pressureSwitch) {
+  HAL_Bool oldValue = m_pressureSwitch.exchange(pressureSwitch);
+  if (oldValue != pressureSwitch) {
+    InvokePressureSwitchCallback(MakeBoolean(pressureSwitch));
+  }
+}
+
+int32_t PCMData::RegisterCompressorCurrentCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_compressorCurrentCallbacks =
+        RegisterCallback(m_compressorCurrentCallbacks, "CompressorCurrent",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetCompressorCurrent());
+    callback("CompressorCurrent", param, &value);
+  }
+  return newUid;
+}
+
+void PCMData::CancelCompressorCurrentCallback(int32_t uid) {
+  m_compressorCurrentCallbacks =
+      CancelCallback(m_compressorCurrentCallbacks, uid);
+}
+
+void PCMData::InvokeCompressorCurrentCallback(HAL_Value value) {
+  InvokeCallback(m_compressorCurrentCallbacks, "CompressorCurrent", &value);
+}
+
+double PCMData::GetCompressorCurrent() { return m_compressorCurrent; }
+
+void PCMData::SetCompressorCurrent(double compressorCurrent) {
+  double oldValue = m_compressorCurrent.exchange(compressorCurrent);
+  if (oldValue != compressorCurrent) {
+    InvokeCompressorCurrentCallback(MakeDouble(compressorCurrent));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetPCMData(int32_t index) { SimPCMData[index].ResetData(); }
+
+int32_t HALSIM_RegisterPCMSolenoidInitializedCallback(
+    int32_t index, int32_t channel, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterSolenoidInitializedCallback(
+      channel, callback, param, initialNotify);
+}
+
+void HALSIM_CancelPCMSolenoidInitializedCallback(int32_t index, int32_t channel,
+                                                 int32_t uid) {
+  SimPCMData[index].CancelSolenoidInitializedCallback(channel, uid);
+}
+
+HAL_Bool HALSIM_GetPCMSolenoidInitialized(int32_t index, int32_t channel) {
+  return SimPCMData[index].GetSolenoidInitialized(channel);
+}
+
+void HALSIM_SetPCMSolenoidInitialized(int32_t index, int32_t channel,
+                                      HAL_Bool solenoidInitialized) {
+  SimPCMData[index].SetSolenoidInitialized(channel, solenoidInitialized);
+}
+
+int32_t HALSIM_RegisterPCMSolenoidOutputCallback(int32_t index, int32_t channel,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterSolenoidOutputCallback(channel, callback,
+                                                          param, initialNotify);
+}
+
+void HALSIM_CancelPCMSolenoidOutputCallback(int32_t index, int32_t channel,
+                                            int32_t uid) {
+  SimPCMData[index].CancelSolenoidOutputCallback(channel, uid);
+}
+
+HAL_Bool HALSIM_GetPCMSolenoidOutput(int32_t index, int32_t channel) {
+  return SimPCMData[index].GetSolenoidOutput(channel);
+}
+
+void HALSIM_SetPCMSolenoidOutput(int32_t index, int32_t channel,
+                                 HAL_Bool solenoidOutput) {
+  SimPCMData[index].SetSolenoidOutput(channel, solenoidOutput);
+}
+
+int32_t HALSIM_RegisterPCMCompressorInitializedCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterCompressorInitializedCallback(
+      callback, param, initialNotify);
+}
+
+void HALSIM_CancelPCMCompressorInitializedCallback(int32_t index, int32_t uid) {
+  SimPCMData[index].CancelCompressorInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPCMCompressorInitialized(int32_t index) {
+  return SimPCMData[index].GetCompressorInitialized();
+}
+
+void HALSIM_SetPCMCompressorInitialized(int32_t index,
+                                        HAL_Bool compressorInitialized) {
+  SimPCMData[index].SetCompressorInitialized(compressorInitialized);
+}
+
+int32_t HALSIM_RegisterPCMCompressorOnCallback(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterCompressorOnCallback(callback, param,
+                                                        initialNotify);
+}
+
+void HALSIM_CancelPCMCompressorOnCallback(int32_t index, int32_t uid) {
+  SimPCMData[index].CancelCompressorOnCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPCMCompressorOn(int32_t index) {
+  return SimPCMData[index].GetCompressorOn();
+}
+
+void HALSIM_SetPCMCompressorOn(int32_t index, HAL_Bool compressorOn) {
+  SimPCMData[index].SetCompressorOn(compressorOn);
+}
+
+int32_t HALSIM_RegisterPCMClosedLoopEnabledCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterClosedLoopEnabledCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelPCMClosedLoopEnabledCallback(int32_t index, int32_t uid) {
+  SimPCMData[index].CancelClosedLoopEnabledCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPCMClosedLoopEnabled(int32_t index) {
+  return SimPCMData[index].GetClosedLoopEnabled();
+}
+
+void HALSIM_SetPCMClosedLoopEnabled(int32_t index, HAL_Bool closedLoopEnabled) {
+  SimPCMData[index].SetClosedLoopEnabled(closedLoopEnabled);
+}
+
+int32_t HALSIM_RegisterPCMPressureSwitchCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterPressureSwitchCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelPCMPressureSwitchCallback(int32_t index, int32_t uid) {
+  SimPCMData[index].CancelPressureSwitchCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPCMPressureSwitch(int32_t index) {
+  return SimPCMData[index].GetPressureSwitch();
+}
+
+void HALSIM_SetPCMPressureSwitch(int32_t index, HAL_Bool pressureSwitch) {
+  SimPCMData[index].SetPressureSwitch(pressureSwitch);
+}
+
+int32_t HALSIM_RegisterPCMCompressorCurrentCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimPCMData[index].RegisterCompressorCurrentCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelPCMCompressorCurrentCallback(int32_t index, int32_t uid) {
+  SimPCMData[index].CancelCompressorCurrentCallback(uid);
+}
+
+double HALSIM_GetPCMCompressorCurrent(int32_t index) {
+  return SimPCMData[index].GetCompressorCurrent();
+}
+
+void HALSIM_SetPCMCompressorCurrent(int32_t index, double compressorCurrent) {
+  SimPCMData[index].SetCompressorCurrent(compressorCurrent);
+}
+
+void HALSIM_RegisterPCMAllNonSolenoidCallbacks(int32_t index,
+                                               HAL_NotifyCallback callback,
+                                               void* param,
+                                               HAL_Bool initialNotify) {
+  SimPCMData[index].RegisterCompressorInitializedCallback(callback, param,
+                                                          initialNotify);
+  SimPCMData[index].RegisterCompressorOnCallback(callback, param,
+                                                 initialNotify);
+  SimPCMData[index].RegisterClosedLoopEnabledCallback(callback, param,
+                                                      initialNotify);
+  SimPCMData[index].RegisterPressureSwitchCallback(callback, param,
+                                                   initialNotify);
+  SimPCMData[index].RegisterCompressorCurrentCallback(callback, param,
+                                                      initialNotify);
+}
+
+void HALSIM_RegisterPCMAllSolenoidCallbacks(int32_t index, int32_t channel,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  SimPCMData[index].RegisterSolenoidInitializedCallback(channel, callback,
+                                                        param, initialNotify);
+  SimPCMData[index].RegisterSolenoidOutputCallback(channel, callback, param,
+                                                   initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PCMDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PCMDataInternal.h
new file mode 100644
index 0000000..69b83cf
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PCMDataInternal.h
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/PCMData.h"
+
+namespace hal {
+class PCMData {
+ public:
+  int32_t RegisterSolenoidInitializedCallback(int32_t channel,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify);
+  void CancelSolenoidInitializedCallback(int32_t channel, int32_t uid);
+  void InvokeSolenoidInitializedCallback(int32_t channel, HAL_Value value);
+  HAL_Bool GetSolenoidInitialized(int32_t channel);
+  void SetSolenoidInitialized(int32_t channel, HAL_Bool solenoidInitialized);
+
+  int32_t RegisterSolenoidOutputCallback(int32_t channel,
+                                         HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+  void CancelSolenoidOutputCallback(int32_t channel, int32_t uid);
+  void InvokeSolenoidOutputCallback(int32_t channel, HAL_Value value);
+  HAL_Bool GetSolenoidOutput(int32_t channel);
+  void SetSolenoidOutput(int32_t channel, HAL_Bool solenoidOutput);
+
+  int32_t RegisterCompressorInitializedCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify);
+  void CancelCompressorInitializedCallback(int32_t uid);
+  void InvokeCompressorInitializedCallback(HAL_Value value);
+  HAL_Bool GetCompressorInitialized();
+  void SetCompressorInitialized(HAL_Bool compressorInitialized);
+
+  int32_t RegisterCompressorOnCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify);
+  void CancelCompressorOnCallback(int32_t uid);
+  void InvokeCompressorOnCallback(HAL_Value value);
+  HAL_Bool GetCompressorOn();
+  void SetCompressorOn(HAL_Bool compressorOn);
+
+  int32_t RegisterClosedLoopEnabledCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+  void CancelClosedLoopEnabledCallback(int32_t uid);
+  void InvokeClosedLoopEnabledCallback(HAL_Value value);
+  HAL_Bool GetClosedLoopEnabled();
+  void SetClosedLoopEnabled(HAL_Bool closedLoopEnabled);
+
+  int32_t RegisterPressureSwitchCallback(HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+  void CancelPressureSwitchCallback(int32_t uid);
+  void InvokePressureSwitchCallback(HAL_Value value);
+  HAL_Bool GetPressureSwitch();
+  void SetPressureSwitch(HAL_Bool pressureSwitch);
+
+  int32_t RegisterCompressorCurrentCallback(HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify);
+  void CancelCompressorCurrentCallback(int32_t uid);
+  void InvokeCompressorCurrentCallback(HAL_Value value);
+  double GetCompressorCurrent();
+  void SetCompressorCurrent(double compressorCurrent);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_solenoidInitialized[kNumSolenoidChannels];
+  std::shared_ptr<NotifyListenerVector>
+      m_solenoidInitializedCallbacks[kNumSolenoidChannels];
+  std::atomic<HAL_Bool> m_solenoidOutput[kNumSolenoidChannels];
+  std::shared_ptr<NotifyListenerVector>
+      m_solenoidOutputCallbacks[kNumSolenoidChannels];
+  std::atomic<HAL_Bool> m_compressorInitialized{false};
+  std::shared_ptr<NotifyListenerVector> m_compressorInitializedCallbacks =
+      nullptr;
+  std::atomic<HAL_Bool> m_compressorOn{false};
+  std::shared_ptr<NotifyListenerVector> m_compressorOnCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_closedLoopEnabled{true};
+  std::shared_ptr<NotifyListenerVector> m_closedLoopEnabledCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_pressureSwitch{false};
+  std::shared_ptr<NotifyListenerVector> m_pressureSwitchCallbacks = nullptr;
+  std::atomic<double> m_compressorCurrent{0.0};
+  std::shared_ptr<NotifyListenerVector> m_compressorCurrentCallbacks = nullptr;
+};
+extern PCMData* SimPCMData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PDPData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PDPData.cpp
new file mode 100644
index 0000000..25cbec9
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PDPData.cpp
@@ -0,0 +1,271 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "PDPDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePDPData() {
+  static PDPData spd[kNumPDPModules];
+  ::hal::SimPDPData = spd;
+}
+}  // namespace init
+}  // namespace hal
+
+PDPData* hal::SimPDPData;
+void PDPData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_temperature = 0.0;
+  m_temperatureCallbacks = nullptr;
+  m_voltage = 12.0;
+  m_voltageCallbacks = nullptr;
+  for (int i = 0; i < kNumPDPChannels; i++) {
+    m_current[i] = 0;
+    m_currentCallbacks[i] = nullptr;
+  }
+}
+
+int32_t PDPData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void PDPData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void PDPData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool PDPData::GetInitialized() { return m_initialized; }
+
+void PDPData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t PDPData::RegisterTemperatureCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_temperatureCallbacks = RegisterCallback(
+        m_temperatureCallbacks, "Temperature", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetTemperature());
+    callback("Temperature", param, &value);
+  }
+  return newUid;
+}
+
+void PDPData::CancelTemperatureCallback(int32_t uid) {
+  m_temperatureCallbacks = CancelCallback(m_temperatureCallbacks, uid);
+}
+
+void PDPData::InvokeTemperatureCallback(HAL_Value value) {
+  InvokeCallback(m_temperatureCallbacks, "Temperature", &value);
+}
+
+double PDPData::GetTemperature() { return m_temperature; }
+
+void PDPData::SetTemperature(double temperature) {
+  double oldValue = m_temperature.exchange(temperature);
+  if (oldValue != temperature) {
+    InvokeTemperatureCallback(MakeDouble(temperature));
+  }
+}
+
+int32_t PDPData::RegisterVoltageCallback(HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_voltageCallbacks = RegisterCallback(m_voltageCallbacks, "Voltage",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetVoltage());
+    callback("Voltage", param, &value);
+  }
+  return newUid;
+}
+
+void PDPData::CancelVoltageCallback(int32_t uid) {
+  m_voltageCallbacks = CancelCallback(m_voltageCallbacks, uid);
+}
+
+void PDPData::InvokeVoltageCallback(HAL_Value value) {
+  InvokeCallback(m_voltageCallbacks, "Voltage", &value);
+}
+
+double PDPData::GetVoltage() { return m_voltage; }
+
+void PDPData::SetVoltage(double voltage) {
+  double oldValue = m_voltage.exchange(voltage);
+  if (oldValue != voltage) {
+    InvokeVoltageCallback(MakeDouble(voltage));
+  }
+}
+
+int32_t PDPData::RegisterCurrentCallback(int32_t channel,
+                                         HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_currentCallbacks[channel] = RegisterCallback(
+        m_currentCallbacks[channel], "Current", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetCurrent(channel));
+    callback("Current", param, &value);
+  }
+  return newUid;
+}
+
+void PDPData::CancelCurrentCallback(int32_t channel, int32_t uid) {
+  m_currentCallbacks[channel] =
+      CancelCallback(m_currentCallbacks[channel], uid);
+}
+
+void PDPData::InvokeCurrentCallback(int32_t channel, HAL_Value value) {
+  InvokeCallback(m_currentCallbacks[channel], "Current", &value);
+}
+
+double PDPData::GetCurrent(int32_t channel) { return m_current[channel]; }
+
+void PDPData::SetCurrent(int32_t channel, double current) {
+  double oldValue = m_current[channel].exchange(current);
+  if (oldValue != current) {
+    InvokeCurrentCallback(channel, MakeDouble(current));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetPDPData(int32_t index) { SimPDPData[index].ResetData(); }
+
+int32_t HALSIM_RegisterPDPInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimPDPData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelPDPInitializedCallback(int32_t index, int32_t uid) {
+  SimPDPData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPDPInitialized(int32_t index) {
+  return SimPDPData[index].GetInitialized();
+}
+
+void HALSIM_SetPDPInitialized(int32_t index, HAL_Bool initialized) {
+  SimPDPData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterPDPTemperatureCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimPDPData[index].RegisterTemperatureCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelPDPTemperatureCallback(int32_t index, int32_t uid) {
+  SimPDPData[index].CancelTemperatureCallback(uid);
+}
+
+double HALSIM_GetPDPTemperature(int32_t index) {
+  return SimPDPData[index].GetTemperature();
+}
+
+void HALSIM_SetPDPTemperature(int32_t index, double temperature) {
+  SimPDPData[index].SetTemperature(temperature);
+}
+
+int32_t HALSIM_RegisterPDPVoltageCallback(int32_t index,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify) {
+  return SimPDPData[index].RegisterVoltageCallback(callback, param,
+                                                   initialNotify);
+}
+
+void HALSIM_CancelPDPVoltageCallback(int32_t index, int32_t uid) {
+  SimPDPData[index].CancelVoltageCallback(uid);
+}
+
+double HALSIM_GetPDPVoltage(int32_t index) {
+  return SimPDPData[index].GetVoltage();
+}
+
+void HALSIM_SetPDPVoltage(int32_t index, double voltage) {
+  SimPDPData[index].SetVoltage(voltage);
+}
+
+int32_t HALSIM_RegisterPDPCurrentCallback(int32_t index, int32_t channel,
+                                          HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify) {
+  return SimPDPData[index].RegisterCurrentCallback(channel, callback, param,
+                                                   initialNotify);
+}
+
+void HALSIM_CancelPDPCurrentCallback(int32_t index, int32_t channel,
+                                     int32_t uid) {
+  SimPDPData[index].CancelCurrentCallback(channel, uid);
+}
+
+double HALSIM_GetPDPCurrent(int32_t index, int32_t channel) {
+  return SimPDPData[index].GetCurrent(channel);
+}
+
+void HALSIM_SetPDPCurrent(int32_t index, int32_t channel, double current) {
+  SimPDPData[index].SetCurrent(channel, current);
+}
+
+void HALSIM_RegisterPDPAllNonCurrentCallbacks(int32_t index, int32_t channel,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  SimPDPData[index].RegisterInitializedCallback(callback, param, initialNotify);
+  SimPDPData[index].RegisterTemperatureCallback(callback, param, initialNotify);
+  SimPDPData[index].RegisterVoltageCallback(callback, param, initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PDPDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PDPDataInternal.h
new file mode 100644
index 0000000..aaa8104
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PDPDataInternal.h
@@ -0,0 +1,64 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/PDPData.h"
+
+namespace hal {
+class PDPData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterTemperatureCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelTemperatureCallback(int32_t uid);
+  void InvokeTemperatureCallback(HAL_Value value);
+  double GetTemperature();
+  void SetTemperature(double temperature);
+
+  int32_t RegisterVoltageCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelVoltageCallback(int32_t uid);
+  void InvokeVoltageCallback(HAL_Value value);
+  double GetVoltage();
+  void SetVoltage(double voltage);
+
+  int32_t RegisterCurrentCallback(int32_t channel, HAL_NotifyCallback callback,
+                                  void* param, HAL_Bool initialNotify);
+  void CancelCurrentCallback(int32_t channel, int32_t uid);
+  void InvokeCurrentCallback(int32_t channel, HAL_Value value);
+  double GetCurrent(int32_t channel);
+  void SetCurrent(int32_t channel, double current);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<double> m_temperature{0.0};
+  std::shared_ptr<NotifyListenerVector> m_temperatureCallbacks = nullptr;
+  std::atomic<double> m_voltage{12.0};
+  std::shared_ptr<NotifyListenerVector> m_voltageCallbacks = nullptr;
+  std::atomic<double> m_current[kNumPDPChannels];
+  std::shared_ptr<NotifyListenerVector> m_currentCallbacks[kNumPDPChannels];
+};
+extern PDPData* SimPDPData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PWMData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PWMData.cpp
new file mode 100644
index 0000000..681deaf
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PWMData.cpp
@@ -0,0 +1,383 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "PWMDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePWMData() {
+  static PWMData spd[kNumPWMChannels];
+  ::hal::SimPWMData = spd;
+}
+}  // namespace init
+}  // namespace hal
+
+PWMData* hal::SimPWMData;
+void PWMData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_rawValue = 0;
+  m_rawValueCallbacks = nullptr;
+  m_speed = 0;
+  m_speedCallbacks = nullptr;
+  m_position = 0;
+  m_positionCallbacks = nullptr;
+  m_periodScale = 0;
+  m_periodScaleCallbacks = nullptr;
+  m_zeroLatch = false;
+  m_zeroLatchCallbacks = nullptr;
+}
+
+int32_t PWMData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void PWMData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void PWMData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool PWMData::GetInitialized() { return m_initialized; }
+
+void PWMData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t PWMData::RegisterRawValueCallback(HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_rawValueCallbacks = RegisterCallback(m_rawValueCallbacks, "RawValue",
+                                           callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetRawValue());
+    callback("RawValue", param, &value);
+  }
+  return newUid;
+}
+
+void PWMData::CancelRawValueCallback(int32_t uid) {
+  m_rawValueCallbacks = CancelCallback(m_rawValueCallbacks, uid);
+}
+
+void PWMData::InvokeRawValueCallback(HAL_Value value) {
+  InvokeCallback(m_rawValueCallbacks, "RawValue", &value);
+}
+
+int32_t PWMData::GetRawValue() { return m_rawValue; }
+
+void PWMData::SetRawValue(int32_t rawValue) {
+  int32_t oldValue = m_rawValue.exchange(rawValue);
+  if (oldValue != rawValue) {
+    InvokeRawValueCallback(MakeInt(rawValue));
+  }
+}
+
+int32_t PWMData::RegisterSpeedCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_speedCallbacks =
+        RegisterCallback(m_speedCallbacks, "Speed", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetSpeed());
+    callback("Speed", param, &value);
+  }
+  return newUid;
+}
+
+void PWMData::CancelSpeedCallback(int32_t uid) {
+  m_speedCallbacks = CancelCallback(m_speedCallbacks, uid);
+}
+
+void PWMData::InvokeSpeedCallback(HAL_Value value) {
+  InvokeCallback(m_speedCallbacks, "Speed", &value);
+}
+
+double PWMData::GetSpeed() { return m_speed; }
+
+void PWMData::SetSpeed(double speed) {
+  double oldValue = m_speed.exchange(speed);
+  if (oldValue != speed) {
+    InvokeSpeedCallback(MakeDouble(speed));
+  }
+}
+
+int32_t PWMData::RegisterPositionCallback(HAL_NotifyCallback callback,
+                                          void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_positionCallbacks = RegisterCallback(m_positionCallbacks, "Position",
+                                           callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetPosition());
+    callback("Position", param, &value);
+  }
+  return newUid;
+}
+
+void PWMData::CancelPositionCallback(int32_t uid) {
+  m_positionCallbacks = CancelCallback(m_positionCallbacks, uid);
+}
+
+void PWMData::InvokePositionCallback(HAL_Value value) {
+  InvokeCallback(m_positionCallbacks, "Position", &value);
+}
+
+double PWMData::GetPosition() { return m_position; }
+
+void PWMData::SetPosition(double position) {
+  double oldValue = m_position.exchange(position);
+  if (oldValue != position) {
+    InvokePositionCallback(MakeDouble(position));
+  }
+}
+
+int32_t PWMData::RegisterPeriodScaleCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_periodScaleCallbacks = RegisterCallback(
+        m_periodScaleCallbacks, "PeriodScale", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetPeriodScale());
+    callback("PeriodScale", param, &value);
+  }
+  return newUid;
+}
+
+void PWMData::CancelPeriodScaleCallback(int32_t uid) {
+  m_periodScaleCallbacks = CancelCallback(m_periodScaleCallbacks, uid);
+}
+
+void PWMData::InvokePeriodScaleCallback(HAL_Value value) {
+  InvokeCallback(m_periodScaleCallbacks, "PeriodScale", &value);
+}
+
+int32_t PWMData::GetPeriodScale() { return m_periodScale; }
+
+void PWMData::SetPeriodScale(int32_t periodScale) {
+  int32_t oldValue = m_periodScale.exchange(periodScale);
+  if (oldValue != periodScale) {
+    InvokePeriodScaleCallback(MakeInt(periodScale));
+  }
+}
+
+int32_t PWMData::RegisterZeroLatchCallback(HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_zeroLatchCallbacks = RegisterCallback(m_zeroLatchCallbacks, "ZeroLatch",
+                                            callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetZeroLatch());
+    callback("ZeroLatch", param, &value);
+  }
+  return newUid;
+}
+
+void PWMData::CancelZeroLatchCallback(int32_t uid) {
+  m_zeroLatchCallbacks = CancelCallback(m_zeroLatchCallbacks, uid);
+}
+
+void PWMData::InvokeZeroLatchCallback(HAL_Value value) {
+  InvokeCallback(m_zeroLatchCallbacks, "ZeroLatch", &value);
+}
+
+HAL_Bool PWMData::GetZeroLatch() { return m_zeroLatch; }
+
+void PWMData::SetZeroLatch(HAL_Bool zeroLatch) {
+  HAL_Bool oldValue = m_zeroLatch.exchange(zeroLatch);
+  if (oldValue != zeroLatch) {
+    InvokeZeroLatchCallback(MakeBoolean(zeroLatch));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetPWMData(int32_t index) { SimPWMData[index].ResetData(); }
+
+int32_t HALSIM_RegisterPWMInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimPWMData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelPWMInitializedCallback(int32_t index, int32_t uid) {
+  SimPWMData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPWMInitialized(int32_t index) {
+  return SimPWMData[index].GetInitialized();
+}
+
+void HALSIM_SetPWMInitialized(int32_t index, HAL_Bool initialized) {
+  SimPWMData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterPWMRawValueCallback(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  return SimPWMData[index].RegisterRawValueCallback(callback, param,
+                                                    initialNotify);
+}
+
+void HALSIM_CancelPWMRawValueCallback(int32_t index, int32_t uid) {
+  SimPWMData[index].CancelRawValueCallback(uid);
+}
+
+int32_t HALSIM_GetPWMRawValue(int32_t index) {
+  return SimPWMData[index].GetRawValue();
+}
+
+void HALSIM_SetPWMRawValue(int32_t index, int32_t rawValue) {
+  SimPWMData[index].SetRawValue(rawValue);
+}
+
+int32_t HALSIM_RegisterPWMSpeedCallback(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify) {
+  return SimPWMData[index].RegisterSpeedCallback(callback, param,
+                                                 initialNotify);
+}
+
+void HALSIM_CancelPWMSpeedCallback(int32_t index, int32_t uid) {
+  SimPWMData[index].CancelSpeedCallback(uid);
+}
+
+double HALSIM_GetPWMSpeed(int32_t index) {
+  return SimPWMData[index].GetSpeed();
+}
+
+void HALSIM_SetPWMSpeed(int32_t index, double speed) {
+  SimPWMData[index].SetSpeed(speed);
+}
+
+int32_t HALSIM_RegisterPWMPositionCallback(int32_t index,
+                                           HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  return SimPWMData[index].RegisterPositionCallback(callback, param,
+                                                    initialNotify);
+}
+
+void HALSIM_CancelPWMPositionCallback(int32_t index, int32_t uid) {
+  SimPWMData[index].CancelPositionCallback(uid);
+}
+
+double HALSIM_GetPWMPosition(int32_t index) {
+  return SimPWMData[index].GetPosition();
+}
+
+void HALSIM_SetPWMPosition(int32_t index, double position) {
+  SimPWMData[index].SetPosition(position);
+}
+
+int32_t HALSIM_RegisterPWMPeriodScaleCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimPWMData[index].RegisterPeriodScaleCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelPWMPeriodScaleCallback(int32_t index, int32_t uid) {
+  SimPWMData[index].CancelPeriodScaleCallback(uid);
+}
+
+int32_t HALSIM_GetPWMPeriodScale(int32_t index) {
+  return SimPWMData[index].GetPeriodScale();
+}
+
+void HALSIM_SetPWMPeriodScale(int32_t index, int32_t periodScale) {
+  SimPWMData[index].SetPeriodScale(periodScale);
+}
+
+int32_t HALSIM_RegisterPWMZeroLatchCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  return SimPWMData[index].RegisterZeroLatchCallback(callback, param,
+                                                     initialNotify);
+}
+
+void HALSIM_CancelPWMZeroLatchCallback(int32_t index, int32_t uid) {
+  SimPWMData[index].CancelZeroLatchCallback(uid);
+}
+
+HAL_Bool HALSIM_GetPWMZeroLatch(int32_t index) {
+  return SimPWMData[index].GetZeroLatch();
+}
+
+void HALSIM_SetPWMZeroLatch(int32_t index, HAL_Bool zeroLatch) {
+  SimPWMData[index].SetZeroLatch(zeroLatch);
+}
+
+void HALSIM_RegisterPWMAllCallbacks(int32_t index, HAL_NotifyCallback callback,
+                                    void* param, HAL_Bool initialNotify) {
+  SimPWMData[index].RegisterInitializedCallback(callback, param, initialNotify);
+  SimPWMData[index].RegisterRawValueCallback(callback, param, initialNotify);
+  SimPWMData[index].RegisterSpeedCallback(callback, param, initialNotify);
+  SimPWMData[index].RegisterPositionCallback(callback, param, initialNotify);
+  SimPWMData[index].RegisterPeriodScaleCallback(callback, param, initialNotify);
+  SimPWMData[index].RegisterZeroLatchCallback(callback, param, initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PWMDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PWMDataInternal.h
new file mode 100644
index 0000000..76cd13a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/PWMDataInternal.h
@@ -0,0 +1,81 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/PWMData.h"
+
+namespace hal {
+class PWMData {
+ public:
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterRawValueCallback(HAL_NotifyCallback callback, void* param,
+                                   HAL_Bool initialNotify);
+  void CancelRawValueCallback(int32_t uid);
+  void InvokeRawValueCallback(HAL_Value value);
+  int32_t GetRawValue();
+  void SetRawValue(int32_t rawValue);
+
+  int32_t RegisterSpeedCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelSpeedCallback(int32_t uid);
+  void InvokeSpeedCallback(HAL_Value value);
+  double GetSpeed();
+  void SetSpeed(double speed);
+
+  int32_t RegisterPositionCallback(HAL_NotifyCallback callback, void* param,
+                                   HAL_Bool initialNotify);
+  void CancelPositionCallback(int32_t uid);
+  void InvokePositionCallback(HAL_Value value);
+  double GetPosition();
+  void SetPosition(double position);
+
+  int32_t RegisterPeriodScaleCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelPeriodScaleCallback(int32_t uid);
+  void InvokePeriodScaleCallback(HAL_Value value);
+  int32_t GetPeriodScale();
+  void SetPeriodScale(int32_t periodScale);
+
+  int32_t RegisterZeroLatchCallback(HAL_NotifyCallback callback, void* param,
+                                    HAL_Bool initialNotify);
+  void CancelZeroLatchCallback(int32_t uid);
+  void InvokeZeroLatchCallback(HAL_Value value);
+  HAL_Bool GetZeroLatch();
+  void SetZeroLatch(HAL_Bool zeroLatch);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::atomic<int32_t> m_rawValue{0};
+  std::shared_ptr<NotifyListenerVector> m_rawValueCallbacks = nullptr;
+  std::atomic<double> m_speed{0};
+  std::shared_ptr<NotifyListenerVector> m_speedCallbacks = nullptr;
+  std::atomic<double> m_position{0};
+  std::shared_ptr<NotifyListenerVector> m_positionCallbacks = nullptr;
+  std::atomic<int32_t> m_periodScale{0};
+  std::shared_ptr<NotifyListenerVector> m_periodScaleCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_zeroLatch{false};
+  std::shared_ptr<NotifyListenerVector> m_zeroLatchCallbacks = nullptr;
+};
+extern PWMData* SimPWMData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RelayData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RelayData.cpp
new file mode 100644
index 0000000..06c4cfe
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RelayData.cpp
@@ -0,0 +1,274 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "RelayDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeRelayData() {
+  static RelayData srd[kNumRelayHeaders];
+  ::hal::SimRelayData = srd;
+}
+}  // namespace init
+}  // namespace hal
+
+RelayData* hal::SimRelayData;
+void RelayData::ResetData() {
+  m_initializedForward = false;
+  m_initializedForwardCallbacks = nullptr;
+  m_initializedReverse = false;
+  m_initializedReverseCallbacks = nullptr;
+  m_forward = false;
+  m_forwardCallbacks = nullptr;
+  m_reverse = false;
+  m_reverseCallbacks = nullptr;
+}
+
+int32_t RelayData::RegisterInitializedForwardCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedForwardCallbacks =
+        RegisterCallback(m_initializedForwardCallbacks, "InitializedForward",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitializedForward());
+    callback("InitializedForward", param, &value);
+  }
+  return newUid;
+}
+
+void RelayData::CancelInitializedForwardCallback(int32_t uid) {
+  m_initializedForwardCallbacks =
+      CancelCallback(m_initializedForwardCallbacks, uid);
+}
+
+void RelayData::InvokeInitializedForwardCallback(HAL_Value value) {
+  InvokeCallback(m_initializedForwardCallbacks, "InitializedForward", &value);
+}
+
+HAL_Bool RelayData::GetInitializedForward() { return m_initializedForward; }
+
+void RelayData::SetInitializedForward(HAL_Bool initializedForward) {
+  HAL_Bool oldValue = m_initializedForward.exchange(initializedForward);
+  if (oldValue != initializedForward) {
+    InvokeInitializedForwardCallback(MakeBoolean(initializedForward));
+  }
+}
+
+int32_t RelayData::RegisterInitializedReverseCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedReverseCallbacks =
+        RegisterCallback(m_initializedReverseCallbacks, "InitializedReverse",
+                         callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitializedReverse());
+    callback("InitializedReverse", param, &value);
+  }
+  return newUid;
+}
+
+void RelayData::CancelInitializedReverseCallback(int32_t uid) {
+  m_initializedReverseCallbacks =
+      CancelCallback(m_initializedReverseCallbacks, uid);
+}
+
+void RelayData::InvokeInitializedReverseCallback(HAL_Value value) {
+  InvokeCallback(m_initializedReverseCallbacks, "InitializedReverse", &value);
+}
+
+HAL_Bool RelayData::GetInitializedReverse() { return m_initializedReverse; }
+
+void RelayData::SetInitializedReverse(HAL_Bool initializedReverse) {
+  HAL_Bool oldValue = m_initializedReverse.exchange(initializedReverse);
+  if (oldValue != initializedReverse) {
+    InvokeInitializedReverseCallback(MakeBoolean(initializedReverse));
+  }
+}
+
+int32_t RelayData::RegisterForwardCallback(HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_forwardCallbacks = RegisterCallback(m_forwardCallbacks, "Forward",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetForward());
+    callback("Forward", param, &value);
+  }
+  return newUid;
+}
+
+void RelayData::CancelForwardCallback(int32_t uid) {
+  m_forwardCallbacks = CancelCallback(m_forwardCallbacks, uid);
+}
+
+void RelayData::InvokeForwardCallback(HAL_Value value) {
+  InvokeCallback(m_forwardCallbacks, "Forward", &value);
+}
+
+HAL_Bool RelayData::GetForward() { return m_forward; }
+
+void RelayData::SetForward(HAL_Bool forward) {
+  HAL_Bool oldValue = m_forward.exchange(forward);
+  if (oldValue != forward) {
+    InvokeForwardCallback(MakeBoolean(forward));
+  }
+}
+
+int32_t RelayData::RegisterReverseCallback(HAL_NotifyCallback callback,
+                                           void* param,
+                                           HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_reverseCallbacks = RegisterCallback(m_reverseCallbacks, "Reverse",
+                                          callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetReverse());
+    callback("Reverse", param, &value);
+  }
+  return newUid;
+}
+
+void RelayData::CancelReverseCallback(int32_t uid) {
+  m_reverseCallbacks = CancelCallback(m_reverseCallbacks, uid);
+}
+
+void RelayData::InvokeReverseCallback(HAL_Value value) {
+  InvokeCallback(m_reverseCallbacks, "Reverse", &value);
+}
+
+HAL_Bool RelayData::GetReverse() { return m_reverse; }
+
+void RelayData::SetReverse(HAL_Bool reverse) {
+  HAL_Bool oldValue = m_reverse.exchange(reverse);
+  if (oldValue != reverse) {
+    InvokeReverseCallback(MakeBoolean(reverse));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetRelayData(int32_t index) { SimRelayData[index].ResetData(); }
+
+int32_t HALSIM_RegisterRelayInitializedForwardCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimRelayData[index].RegisterInitializedForwardCallback(callback, param,
+                                                                initialNotify);
+}
+
+void HALSIM_CancelRelayInitializedForwardCallback(int32_t index, int32_t uid) {
+  SimRelayData[index].CancelInitializedForwardCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRelayInitializedForward(int32_t index) {
+  return SimRelayData[index].GetInitializedForward();
+}
+
+void HALSIM_SetRelayInitializedForward(int32_t index,
+                                       HAL_Bool initializedForward) {
+  SimRelayData[index].SetInitializedForward(initializedForward);
+}
+
+int32_t HALSIM_RegisterRelayInitializedReverseCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimRelayData[index].RegisterInitializedReverseCallback(callback, param,
+                                                                initialNotify);
+}
+
+void HALSIM_CancelRelayInitializedReverseCallback(int32_t index, int32_t uid) {
+  SimRelayData[index].CancelInitializedReverseCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRelayInitializedReverse(int32_t index) {
+  return SimRelayData[index].GetInitializedReverse();
+}
+
+void HALSIM_SetRelayInitializedReverse(int32_t index,
+                                       HAL_Bool initializedReverse) {
+  SimRelayData[index].SetInitializedReverse(initializedReverse);
+}
+
+int32_t HALSIM_RegisterRelayForwardCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  return SimRelayData[index].RegisterForwardCallback(callback, param,
+                                                     initialNotify);
+}
+
+void HALSIM_CancelRelayForwardCallback(int32_t index, int32_t uid) {
+  SimRelayData[index].CancelForwardCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRelayForward(int32_t index) {
+  return SimRelayData[index].GetForward();
+}
+
+void HALSIM_SetRelayForward(int32_t index, HAL_Bool forward) {
+  SimRelayData[index].SetForward(forward);
+}
+
+int32_t HALSIM_RegisterRelayReverseCallback(int32_t index,
+                                            HAL_NotifyCallback callback,
+                                            void* param,
+                                            HAL_Bool initialNotify) {
+  return SimRelayData[index].RegisterReverseCallback(callback, param,
+                                                     initialNotify);
+}
+
+void HALSIM_CancelRelayReverseCallback(int32_t index, int32_t uid) {
+  SimRelayData[index].CancelReverseCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRelayReverse(int32_t index) {
+  return SimRelayData[index].GetReverse();
+}
+
+void HALSIM_SetRelayReverse(int32_t index, HAL_Bool reverse) {
+  SimRelayData[index].SetReverse(reverse);
+}
+
+void HALSIM_RegisterRelayAllCallbacks(int32_t index,
+                                      HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify) {
+  SimRelayData[index].RegisterInitializedForwardCallback(callback, param,
+                                                         initialNotify);
+  SimRelayData[index].RegisterInitializedReverseCallback(callback, param,
+                                                         initialNotify);
+  SimRelayData[index].RegisterForwardCallback(callback, param, initialNotify);
+  SimRelayData[index].RegisterReverseCallback(callback, param, initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RelayDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RelayDataInternal.h
new file mode 100644
index 0000000..ee32eb2
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RelayDataInternal.h
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/RelayData.h"
+
+namespace hal {
+class RelayData {
+ public:
+  int32_t RegisterInitializedForwardCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify);
+  void CancelInitializedForwardCallback(int32_t uid);
+  void InvokeInitializedForwardCallback(HAL_Value value);
+  HAL_Bool GetInitializedForward();
+  void SetInitializedForward(HAL_Bool initializedForward);
+
+  int32_t RegisterInitializedReverseCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify);
+  void CancelInitializedReverseCallback(int32_t uid);
+  void InvokeInitializedReverseCallback(HAL_Value value);
+  HAL_Bool GetInitializedReverse();
+  void SetInitializedReverse(HAL_Bool initializedReverse);
+
+  int32_t RegisterForwardCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelForwardCallback(int32_t uid);
+  void InvokeForwardCallback(HAL_Value value);
+  HAL_Bool GetForward();
+  void SetForward(HAL_Bool forward);
+
+  int32_t RegisterReverseCallback(HAL_NotifyCallback callback, void* param,
+                                  HAL_Bool initialNotify);
+  void CancelReverseCallback(int32_t uid);
+  void InvokeReverseCallback(HAL_Value value);
+  HAL_Bool GetReverse();
+  void SetReverse(HAL_Bool reverse);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_initializedForward{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedForwardCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_initializedReverse{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedReverseCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_forward{false};
+  std::shared_ptr<NotifyListenerVector> m_forwardCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_reverse{false};
+  std::shared_ptr<NotifyListenerVector> m_reverseCallbacks = nullptr;
+};
+extern RelayData* SimRelayData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RoboRioData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RoboRioData.cpp
new file mode 100644
index 0000000..8a4ef5e
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RoboRioData.cpp
@@ -0,0 +1,934 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "RoboRioDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeRoboRioData() {
+  static RoboRioData srrd[1];
+  ::hal::SimRoboRioData = srrd;
+}
+}  // namespace init
+}  // namespace hal
+
+RoboRioData* hal::SimRoboRioData;
+void RoboRioData::ResetData() {
+  m_fPGAButton = false;
+  m_fPGAButtonCallbacks = nullptr;
+  m_vInVoltage = 0.0;
+  m_vInVoltageCallbacks = nullptr;
+  m_vInCurrent = 0.0;
+  m_vInCurrentCallbacks = nullptr;
+  m_userVoltage6V = 6.0;
+  m_userVoltage6VCallbacks = nullptr;
+  m_userCurrent6V = 0.0;
+  m_userCurrent6VCallbacks = nullptr;
+  m_userActive6V = false;
+  m_userActive6VCallbacks = nullptr;
+  m_userVoltage5V = 5.0;
+  m_userVoltage5VCallbacks = nullptr;
+  m_userCurrent5V = 0.0;
+  m_userCurrent5VCallbacks = nullptr;
+  m_userActive5V = false;
+  m_userActive5VCallbacks = nullptr;
+  m_userVoltage3V3 = 3.3;
+  m_userVoltage3V3Callbacks = nullptr;
+  m_userCurrent3V3 = 0.0;
+  m_userCurrent3V3Callbacks = nullptr;
+  m_userActive3V3 = false;
+  m_userActive3V3Callbacks = nullptr;
+  m_userFaults6V = 0;
+  m_userFaults6VCallbacks = nullptr;
+  m_userFaults5V = 0;
+  m_userFaults5VCallbacks = nullptr;
+  m_userFaults3V3 = 0;
+  m_userFaults3V3Callbacks = nullptr;
+}
+
+int32_t RoboRioData::RegisterFPGAButtonCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_fPGAButtonCallbacks = RegisterCallback(
+        m_fPGAButtonCallbacks, "FPGAButton", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetFPGAButton());
+    callback("FPGAButton", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelFPGAButtonCallback(int32_t uid) {
+  m_fPGAButtonCallbacks = CancelCallback(m_fPGAButtonCallbacks, uid);
+}
+
+void RoboRioData::InvokeFPGAButtonCallback(HAL_Value value) {
+  InvokeCallback(m_fPGAButtonCallbacks, "FPGAButton", &value);
+}
+
+HAL_Bool RoboRioData::GetFPGAButton() { return m_fPGAButton; }
+
+void RoboRioData::SetFPGAButton(HAL_Bool fPGAButton) {
+  HAL_Bool oldValue = m_fPGAButton.exchange(fPGAButton);
+  if (oldValue != fPGAButton) {
+    InvokeFPGAButtonCallback(MakeBoolean(fPGAButton));
+  }
+}
+
+int32_t RoboRioData::RegisterVInVoltageCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_vInVoltageCallbacks = RegisterCallback(
+        m_vInVoltageCallbacks, "VInVoltage", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetVInVoltage());
+    callback("VInVoltage", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelVInVoltageCallback(int32_t uid) {
+  m_vInVoltageCallbacks = CancelCallback(m_vInVoltageCallbacks, uid);
+}
+
+void RoboRioData::InvokeVInVoltageCallback(HAL_Value value) {
+  InvokeCallback(m_vInVoltageCallbacks, "VInVoltage", &value);
+}
+
+double RoboRioData::GetVInVoltage() { return m_vInVoltage; }
+
+void RoboRioData::SetVInVoltage(double vInVoltage) {
+  double oldValue = m_vInVoltage.exchange(vInVoltage);
+  if (oldValue != vInVoltage) {
+    InvokeVInVoltageCallback(MakeDouble(vInVoltage));
+  }
+}
+
+int32_t RoboRioData::RegisterVInCurrentCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_vInCurrentCallbacks = RegisterCallback(
+        m_vInCurrentCallbacks, "VInCurrent", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetVInCurrent());
+    callback("VInCurrent", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelVInCurrentCallback(int32_t uid) {
+  m_vInCurrentCallbacks = CancelCallback(m_vInCurrentCallbacks, uid);
+}
+
+void RoboRioData::InvokeVInCurrentCallback(HAL_Value value) {
+  InvokeCallback(m_vInCurrentCallbacks, "VInCurrent", &value);
+}
+
+double RoboRioData::GetVInCurrent() { return m_vInCurrent; }
+
+void RoboRioData::SetVInCurrent(double vInCurrent) {
+  double oldValue = m_vInCurrent.exchange(vInCurrent);
+  if (oldValue != vInCurrent) {
+    InvokeVInCurrentCallback(MakeDouble(vInCurrent));
+  }
+}
+
+int32_t RoboRioData::RegisterUserVoltage6VCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userVoltage6VCallbacks = RegisterCallback(
+        m_userVoltage6VCallbacks, "UserVoltage6V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetUserVoltage6V());
+    callback("UserVoltage6V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserVoltage6VCallback(int32_t uid) {
+  m_userVoltage6VCallbacks = CancelCallback(m_userVoltage6VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserVoltage6VCallback(HAL_Value value) {
+  InvokeCallback(m_userVoltage6VCallbacks, "UserVoltage6V", &value);
+}
+
+double RoboRioData::GetUserVoltage6V() { return m_userVoltage6V; }
+
+void RoboRioData::SetUserVoltage6V(double userVoltage6V) {
+  double oldValue = m_userVoltage6V.exchange(userVoltage6V);
+  if (oldValue != userVoltage6V) {
+    InvokeUserVoltage6VCallback(MakeDouble(userVoltage6V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserCurrent6VCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userCurrent6VCallbacks = RegisterCallback(
+        m_userCurrent6VCallbacks, "UserCurrent6V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetUserCurrent6V());
+    callback("UserCurrent6V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserCurrent6VCallback(int32_t uid) {
+  m_userCurrent6VCallbacks = CancelCallback(m_userCurrent6VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserCurrent6VCallback(HAL_Value value) {
+  InvokeCallback(m_userCurrent6VCallbacks, "UserCurrent6V", &value);
+}
+
+double RoboRioData::GetUserCurrent6V() { return m_userCurrent6V; }
+
+void RoboRioData::SetUserCurrent6V(double userCurrent6V) {
+  double oldValue = m_userCurrent6V.exchange(userCurrent6V);
+  if (oldValue != userCurrent6V) {
+    InvokeUserCurrent6VCallback(MakeDouble(userCurrent6V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserActive6VCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userActive6VCallbacks = RegisterCallback(
+        m_userActive6VCallbacks, "UserActive6V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetUserActive6V());
+    callback("UserActive6V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserActive6VCallback(int32_t uid) {
+  m_userActive6VCallbacks = CancelCallback(m_userActive6VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserActive6VCallback(HAL_Value value) {
+  InvokeCallback(m_userActive6VCallbacks, "UserActive6V", &value);
+}
+
+HAL_Bool RoboRioData::GetUserActive6V() { return m_userActive6V; }
+
+void RoboRioData::SetUserActive6V(HAL_Bool userActive6V) {
+  HAL_Bool oldValue = m_userActive6V.exchange(userActive6V);
+  if (oldValue != userActive6V) {
+    InvokeUserActive6VCallback(MakeBoolean(userActive6V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserVoltage5VCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userVoltage5VCallbacks = RegisterCallback(
+        m_userVoltage5VCallbacks, "UserVoltage5V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetUserVoltage5V());
+    callback("UserVoltage5V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserVoltage5VCallback(int32_t uid) {
+  m_userVoltage5VCallbacks = CancelCallback(m_userVoltage5VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserVoltage5VCallback(HAL_Value value) {
+  InvokeCallback(m_userVoltage5VCallbacks, "UserVoltage5V", &value);
+}
+
+double RoboRioData::GetUserVoltage5V() { return m_userVoltage5V; }
+
+void RoboRioData::SetUserVoltage5V(double userVoltage5V) {
+  double oldValue = m_userVoltage5V.exchange(userVoltage5V);
+  if (oldValue != userVoltage5V) {
+    InvokeUserVoltage5VCallback(MakeDouble(userVoltage5V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserCurrent5VCallback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userCurrent5VCallbacks = RegisterCallback(
+        m_userCurrent5VCallbacks, "UserCurrent5V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetUserCurrent5V());
+    callback("UserCurrent5V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserCurrent5VCallback(int32_t uid) {
+  m_userCurrent5VCallbacks = CancelCallback(m_userCurrent5VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserCurrent5VCallback(HAL_Value value) {
+  InvokeCallback(m_userCurrent5VCallbacks, "UserCurrent5V", &value);
+}
+
+double RoboRioData::GetUserCurrent5V() { return m_userCurrent5V; }
+
+void RoboRioData::SetUserCurrent5V(double userCurrent5V) {
+  double oldValue = m_userCurrent5V.exchange(userCurrent5V);
+  if (oldValue != userCurrent5V) {
+    InvokeUserCurrent5VCallback(MakeDouble(userCurrent5V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserActive5VCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userActive5VCallbacks = RegisterCallback(
+        m_userActive5VCallbacks, "UserActive5V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetUserActive5V());
+    callback("UserActive5V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserActive5VCallback(int32_t uid) {
+  m_userActive5VCallbacks = CancelCallback(m_userActive5VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserActive5VCallback(HAL_Value value) {
+  InvokeCallback(m_userActive5VCallbacks, "UserActive5V", &value);
+}
+
+HAL_Bool RoboRioData::GetUserActive5V() { return m_userActive5V; }
+
+void RoboRioData::SetUserActive5V(HAL_Bool userActive5V) {
+  HAL_Bool oldValue = m_userActive5V.exchange(userActive5V);
+  if (oldValue != userActive5V) {
+    InvokeUserActive5VCallback(MakeBoolean(userActive5V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserVoltage3V3Callback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userVoltage3V3Callbacks = RegisterCallback(
+        m_userVoltage3V3Callbacks, "UserVoltage3V3", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetUserVoltage3V3());
+    callback("UserVoltage3V3", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserVoltage3V3Callback(int32_t uid) {
+  m_userVoltage3V3Callbacks = CancelCallback(m_userVoltage3V3Callbacks, uid);
+}
+
+void RoboRioData::InvokeUserVoltage3V3Callback(HAL_Value value) {
+  InvokeCallback(m_userVoltage3V3Callbacks, "UserVoltage3V3", &value);
+}
+
+double RoboRioData::GetUserVoltage3V3() { return m_userVoltage3V3; }
+
+void RoboRioData::SetUserVoltage3V3(double userVoltage3V3) {
+  double oldValue = m_userVoltage3V3.exchange(userVoltage3V3);
+  if (oldValue != userVoltage3V3) {
+    InvokeUserVoltage3V3Callback(MakeDouble(userVoltage3V3));
+  }
+}
+
+int32_t RoboRioData::RegisterUserCurrent3V3Callback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userCurrent3V3Callbacks = RegisterCallback(
+        m_userCurrent3V3Callbacks, "UserCurrent3V3", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetUserCurrent3V3());
+    callback("UserCurrent3V3", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserCurrent3V3Callback(int32_t uid) {
+  m_userCurrent3V3Callbacks = CancelCallback(m_userCurrent3V3Callbacks, uid);
+}
+
+void RoboRioData::InvokeUserCurrent3V3Callback(HAL_Value value) {
+  InvokeCallback(m_userCurrent3V3Callbacks, "UserCurrent3V3", &value);
+}
+
+double RoboRioData::GetUserCurrent3V3() { return m_userCurrent3V3; }
+
+void RoboRioData::SetUserCurrent3V3(double userCurrent3V3) {
+  double oldValue = m_userCurrent3V3.exchange(userCurrent3V3);
+  if (oldValue != userCurrent3V3) {
+    InvokeUserCurrent3V3Callback(MakeDouble(userCurrent3V3));
+  }
+}
+
+int32_t RoboRioData::RegisterUserActive3V3Callback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userActive3V3Callbacks = RegisterCallback(
+        m_userActive3V3Callbacks, "UserActive3V3", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetUserActive3V3());
+    callback("UserActive3V3", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserActive3V3Callback(int32_t uid) {
+  m_userActive3V3Callbacks = CancelCallback(m_userActive3V3Callbacks, uid);
+}
+
+void RoboRioData::InvokeUserActive3V3Callback(HAL_Value value) {
+  InvokeCallback(m_userActive3V3Callbacks, "UserActive3V3", &value);
+}
+
+HAL_Bool RoboRioData::GetUserActive3V3() { return m_userActive3V3; }
+
+void RoboRioData::SetUserActive3V3(HAL_Bool userActive3V3) {
+  HAL_Bool oldValue = m_userActive3V3.exchange(userActive3V3);
+  if (oldValue != userActive3V3) {
+    InvokeUserActive3V3Callback(MakeBoolean(userActive3V3));
+  }
+}
+
+int32_t RoboRioData::RegisterUserFaults6VCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userFaults6VCallbacks = RegisterCallback(
+        m_userFaults6VCallbacks, "UserFaults6V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetUserFaults6V());
+    callback("UserFaults6V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserFaults6VCallback(int32_t uid) {
+  m_userFaults6VCallbacks = CancelCallback(m_userFaults6VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserFaults6VCallback(HAL_Value value) {
+  InvokeCallback(m_userFaults6VCallbacks, "UserFaults6V", &value);
+}
+
+int32_t RoboRioData::GetUserFaults6V() { return m_userFaults6V; }
+
+void RoboRioData::SetUserFaults6V(int32_t userFaults6V) {
+  int32_t oldValue = m_userFaults6V.exchange(userFaults6V);
+  if (oldValue != userFaults6V) {
+    InvokeUserFaults6VCallback(MakeInt(userFaults6V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserFaults5VCallback(HAL_NotifyCallback callback,
+                                                  void* param,
+                                                  HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userFaults5VCallbacks = RegisterCallback(
+        m_userFaults5VCallbacks, "UserFaults5V", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetUserFaults5V());
+    callback("UserFaults5V", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserFaults5VCallback(int32_t uid) {
+  m_userFaults5VCallbacks = CancelCallback(m_userFaults5VCallbacks, uid);
+}
+
+void RoboRioData::InvokeUserFaults5VCallback(HAL_Value value) {
+  InvokeCallback(m_userFaults5VCallbacks, "UserFaults5V", &value);
+}
+
+int32_t RoboRioData::GetUserFaults5V() { return m_userFaults5V; }
+
+void RoboRioData::SetUserFaults5V(int32_t userFaults5V) {
+  int32_t oldValue = m_userFaults5V.exchange(userFaults5V);
+  if (oldValue != userFaults5V) {
+    InvokeUserFaults5VCallback(MakeInt(userFaults5V));
+  }
+}
+
+int32_t RoboRioData::RegisterUserFaults3V3Callback(HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_userFaults3V3Callbacks = RegisterCallback(
+        m_userFaults3V3Callbacks, "UserFaults3V3", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetUserFaults3V3());
+    callback("UserFaults3V3", param, &value);
+  }
+  return newUid;
+}
+
+void RoboRioData::CancelUserFaults3V3Callback(int32_t uid) {
+  m_userFaults3V3Callbacks = CancelCallback(m_userFaults3V3Callbacks, uid);
+}
+
+void RoboRioData::InvokeUserFaults3V3Callback(HAL_Value value) {
+  InvokeCallback(m_userFaults3V3Callbacks, "UserFaults3V3", &value);
+}
+
+int32_t RoboRioData::GetUserFaults3V3() { return m_userFaults3V3; }
+
+void RoboRioData::SetUserFaults3V3(int32_t userFaults3V3) {
+  int32_t oldValue = m_userFaults3V3.exchange(userFaults3V3);
+  if (oldValue != userFaults3V3) {
+    InvokeUserFaults3V3Callback(MakeInt(userFaults3V3));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetRoboRioData(int32_t index) {
+  SimRoboRioData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterRoboRioFPGAButtonCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterFPGAButtonCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelRoboRioFPGAButtonCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelFPGAButtonCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRoboRioFPGAButton(int32_t index) {
+  return SimRoboRioData[index].GetFPGAButton();
+}
+
+void HALSIM_SetRoboRioFPGAButton(int32_t index, HAL_Bool fPGAButton) {
+  SimRoboRioData[index].SetFPGAButton(fPGAButton);
+}
+
+int32_t HALSIM_RegisterRoboRioVInVoltageCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterVInVoltageCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelRoboRioVInVoltageCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelVInVoltageCallback(uid);
+}
+
+double HALSIM_GetRoboRioVInVoltage(int32_t index) {
+  return SimRoboRioData[index].GetVInVoltage();
+}
+
+void HALSIM_SetRoboRioVInVoltage(int32_t index, double vInVoltage) {
+  SimRoboRioData[index].SetVInVoltage(vInVoltage);
+}
+
+int32_t HALSIM_RegisterRoboRioVInCurrentCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterVInCurrentCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelRoboRioVInCurrentCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelVInCurrentCallback(uid);
+}
+
+double HALSIM_GetRoboRioVInCurrent(int32_t index) {
+  return SimRoboRioData[index].GetVInCurrent();
+}
+
+void HALSIM_SetRoboRioVInCurrent(int32_t index, double vInCurrent) {
+  SimRoboRioData[index].SetVInCurrent(vInCurrent);
+}
+
+int32_t HALSIM_RegisterRoboRioUserVoltage6VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserVoltage6VCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserVoltage6VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserVoltage6VCallback(uid);
+}
+
+double HALSIM_GetRoboRioUserVoltage6V(int32_t index) {
+  return SimRoboRioData[index].GetUserVoltage6V();
+}
+
+void HALSIM_SetRoboRioUserVoltage6V(int32_t index, double userVoltage6V) {
+  SimRoboRioData[index].SetUserVoltage6V(userVoltage6V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserCurrent6VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserCurrent6VCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserCurrent6VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserCurrent6VCallback(uid);
+}
+
+double HALSIM_GetRoboRioUserCurrent6V(int32_t index) {
+  return SimRoboRioData[index].GetUserCurrent6V();
+}
+
+void HALSIM_SetRoboRioUserCurrent6V(int32_t index, double userCurrent6V) {
+  SimRoboRioData[index].SetUserCurrent6V(userCurrent6V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserActive6VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserActive6VCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserActive6VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserActive6VCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRoboRioUserActive6V(int32_t index) {
+  return SimRoboRioData[index].GetUserActive6V();
+}
+
+void HALSIM_SetRoboRioUserActive6V(int32_t index, HAL_Bool userActive6V) {
+  SimRoboRioData[index].SetUserActive6V(userActive6V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserVoltage5VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserVoltage5VCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserVoltage5VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserVoltage5VCallback(uid);
+}
+
+double HALSIM_GetRoboRioUserVoltage5V(int32_t index) {
+  return SimRoboRioData[index].GetUserVoltage5V();
+}
+
+void HALSIM_SetRoboRioUserVoltage5V(int32_t index, double userVoltage5V) {
+  SimRoboRioData[index].SetUserVoltage5V(userVoltage5V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserCurrent5VCallback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserCurrent5VCallback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserCurrent5VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserCurrent5VCallback(uid);
+}
+
+double HALSIM_GetRoboRioUserCurrent5V(int32_t index) {
+  return SimRoboRioData[index].GetUserCurrent5V();
+}
+
+void HALSIM_SetRoboRioUserCurrent5V(int32_t index, double userCurrent5V) {
+  SimRoboRioData[index].SetUserCurrent5V(userCurrent5V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserActive5VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserActive5VCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserActive5VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserActive5VCallback(uid);
+}
+
+HAL_Bool HALSIM_GetRoboRioUserActive5V(int32_t index) {
+  return SimRoboRioData[index].GetUserActive5V();
+}
+
+void HALSIM_SetRoboRioUserActive5V(int32_t index, HAL_Bool userActive5V) {
+  SimRoboRioData[index].SetUserActive5V(userActive5V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserVoltage3V3Callback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserVoltage3V3Callback(callback, param,
+                                                              initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserVoltage3V3Callback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserVoltage3V3Callback(uid);
+}
+
+double HALSIM_GetRoboRioUserVoltage3V3(int32_t index) {
+  return SimRoboRioData[index].GetUserVoltage3V3();
+}
+
+void HALSIM_SetRoboRioUserVoltage3V3(int32_t index, double userVoltage3V3) {
+  SimRoboRioData[index].SetUserVoltage3V3(userVoltage3V3);
+}
+
+int32_t HALSIM_RegisterRoboRioUserCurrent3V3Callback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserCurrent3V3Callback(callback, param,
+                                                              initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserCurrent3V3Callback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserCurrent3V3Callback(uid);
+}
+
+double HALSIM_GetRoboRioUserCurrent3V3(int32_t index) {
+  return SimRoboRioData[index].GetUserCurrent3V3();
+}
+
+void HALSIM_SetRoboRioUserCurrent3V3(int32_t index, double userCurrent3V3) {
+  SimRoboRioData[index].SetUserCurrent3V3(userCurrent3V3);
+}
+
+int32_t HALSIM_RegisterRoboRioUserActive3V3Callback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserActive3V3Callback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserActive3V3Callback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserActive3V3Callback(uid);
+}
+
+HAL_Bool HALSIM_GetRoboRioUserActive3V3(int32_t index) {
+  return SimRoboRioData[index].GetUserActive3V3();
+}
+
+void HALSIM_SetRoboRioUserActive3V3(int32_t index, HAL_Bool userActive3V3) {
+  SimRoboRioData[index].SetUserActive3V3(userActive3V3);
+}
+
+int32_t HALSIM_RegisterRoboRioUserFaults6VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserFaults6VCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserFaults6VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserFaults6VCallback(uid);
+}
+
+int32_t HALSIM_GetRoboRioUserFaults6V(int32_t index) {
+  return SimRoboRioData[index].GetUserFaults6V();
+}
+
+void HALSIM_SetRoboRioUserFaults6V(int32_t index, int32_t userFaults6V) {
+  SimRoboRioData[index].SetUserFaults6V(userFaults6V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserFaults5VCallback(int32_t index,
+                                                   HAL_NotifyCallback callback,
+                                                   void* param,
+                                                   HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserFaults5VCallback(callback, param,
+                                                            initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserFaults5VCallback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserFaults5VCallback(uid);
+}
+
+int32_t HALSIM_GetRoboRioUserFaults5V(int32_t index) {
+  return SimRoboRioData[index].GetUserFaults5V();
+}
+
+void HALSIM_SetRoboRioUserFaults5V(int32_t index, int32_t userFaults5V) {
+  SimRoboRioData[index].SetUserFaults5V(userFaults5V);
+}
+
+int32_t HALSIM_RegisterRoboRioUserFaults3V3Callback(int32_t index,
+                                                    HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  return SimRoboRioData[index].RegisterUserFaults3V3Callback(callback, param,
+                                                             initialNotify);
+}
+
+void HALSIM_CancelRoboRioUserFaults3V3Callback(int32_t index, int32_t uid) {
+  SimRoboRioData[index].CancelUserFaults3V3Callback(uid);
+}
+
+int32_t HALSIM_GetRoboRioUserFaults3V3(int32_t index) {
+  return SimRoboRioData[index].GetUserFaults3V3();
+}
+
+void HALSIM_SetRoboRioUserFaults3V3(int32_t index, int32_t userFaults3V3) {
+  SimRoboRioData[index].SetUserFaults3V3(userFaults3V3);
+}
+
+void HALSIM_RegisterRoboRioAllCallbacks(int32_t index,
+                                        HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify) {
+  SimRoboRioData[index].RegisterFPGAButtonCallback(callback, param,
+                                                   initialNotify);
+  SimRoboRioData[index].RegisterVInVoltageCallback(callback, param,
+                                                   initialNotify);
+  SimRoboRioData[index].RegisterVInCurrentCallback(callback, param,
+                                                   initialNotify);
+  SimRoboRioData[index].RegisterUserVoltage6VCallback(callback, param,
+                                                      initialNotify);
+  SimRoboRioData[index].RegisterUserCurrent6VCallback(callback, param,
+                                                      initialNotify);
+  SimRoboRioData[index].RegisterUserActive6VCallback(callback, param,
+                                                     initialNotify);
+  SimRoboRioData[index].RegisterUserVoltage5VCallback(callback, param,
+                                                      initialNotify);
+  SimRoboRioData[index].RegisterUserCurrent5VCallback(callback, param,
+                                                      initialNotify);
+  SimRoboRioData[index].RegisterUserActive5VCallback(callback, param,
+                                                     initialNotify);
+  SimRoboRioData[index].RegisterUserVoltage3V3Callback(callback, param,
+                                                       initialNotify);
+  SimRoboRioData[index].RegisterUserCurrent3V3Callback(callback, param,
+                                                       initialNotify);
+  SimRoboRioData[index].RegisterUserActive3V3Callback(callback, param,
+                                                      initialNotify);
+  SimRoboRioData[index].RegisterUserFaults6VCallback(callback, param,
+                                                     initialNotify);
+  SimRoboRioData[index].RegisterUserFaults5VCallback(callback, param,
+                                                     initialNotify);
+  SimRoboRioData[index].RegisterUserFaults3V3Callback(callback, param,
+                                                      initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RoboRioDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RoboRioDataInternal.h
new file mode 100644
index 0000000..01cf245
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/RoboRioDataInternal.h
@@ -0,0 +1,162 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/RoboRioData.h"
+
+namespace hal {
+class RoboRioData {
+ public:
+  int32_t RegisterFPGAButtonCallback(HAL_NotifyCallback callback, void* param,
+                                     HAL_Bool initialNotify);
+  void CancelFPGAButtonCallback(int32_t uid);
+  void InvokeFPGAButtonCallback(HAL_Value value);
+  HAL_Bool GetFPGAButton();
+  void SetFPGAButton(HAL_Bool fPGAButton);
+
+  int32_t RegisterVInVoltageCallback(HAL_NotifyCallback callback, void* param,
+                                     HAL_Bool initialNotify);
+  void CancelVInVoltageCallback(int32_t uid);
+  void InvokeVInVoltageCallback(HAL_Value value);
+  double GetVInVoltage();
+  void SetVInVoltage(double vInVoltage);
+
+  int32_t RegisterVInCurrentCallback(HAL_NotifyCallback callback, void* param,
+                                     HAL_Bool initialNotify);
+  void CancelVInCurrentCallback(int32_t uid);
+  void InvokeVInCurrentCallback(HAL_Value value);
+  double GetVInCurrent();
+  void SetVInCurrent(double vInCurrent);
+
+  int32_t RegisterUserVoltage6VCallback(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+  void CancelUserVoltage6VCallback(int32_t uid);
+  void InvokeUserVoltage6VCallback(HAL_Value value);
+  double GetUserVoltage6V();
+  void SetUserVoltage6V(double userVoltage6V);
+
+  int32_t RegisterUserCurrent6VCallback(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+  void CancelUserCurrent6VCallback(int32_t uid);
+  void InvokeUserCurrent6VCallback(HAL_Value value);
+  double GetUserCurrent6V();
+  void SetUserCurrent6V(double userCurrent6V);
+
+  int32_t RegisterUserActive6VCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify);
+  void CancelUserActive6VCallback(int32_t uid);
+  void InvokeUserActive6VCallback(HAL_Value value);
+  HAL_Bool GetUserActive6V();
+  void SetUserActive6V(HAL_Bool userActive6V);
+
+  int32_t RegisterUserVoltage5VCallback(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+  void CancelUserVoltage5VCallback(int32_t uid);
+  void InvokeUserVoltage5VCallback(HAL_Value value);
+  double GetUserVoltage5V();
+  void SetUserVoltage5V(double userVoltage5V);
+
+  int32_t RegisterUserCurrent5VCallback(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+  void CancelUserCurrent5VCallback(int32_t uid);
+  void InvokeUserCurrent5VCallback(HAL_Value value);
+  double GetUserCurrent5V();
+  void SetUserCurrent5V(double userCurrent5V);
+
+  int32_t RegisterUserActive5VCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify);
+  void CancelUserActive5VCallback(int32_t uid);
+  void InvokeUserActive5VCallback(HAL_Value value);
+  HAL_Bool GetUserActive5V();
+  void SetUserActive5V(HAL_Bool userActive5V);
+
+  int32_t RegisterUserVoltage3V3Callback(HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+  void CancelUserVoltage3V3Callback(int32_t uid);
+  void InvokeUserVoltage3V3Callback(HAL_Value value);
+  double GetUserVoltage3V3();
+  void SetUserVoltage3V3(double userVoltage3V3);
+
+  int32_t RegisterUserCurrent3V3Callback(HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+  void CancelUserCurrent3V3Callback(int32_t uid);
+  void InvokeUserCurrent3V3Callback(HAL_Value value);
+  double GetUserCurrent3V3();
+  void SetUserCurrent3V3(double userCurrent3V3);
+
+  int32_t RegisterUserActive3V3Callback(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+  void CancelUserActive3V3Callback(int32_t uid);
+  void InvokeUserActive3V3Callback(HAL_Value value);
+  HAL_Bool GetUserActive3V3();
+  void SetUserActive3V3(HAL_Bool userActive3V3);
+
+  int32_t RegisterUserFaults6VCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify);
+  void CancelUserFaults6VCallback(int32_t uid);
+  void InvokeUserFaults6VCallback(HAL_Value value);
+  int32_t GetUserFaults6V();
+  void SetUserFaults6V(int32_t userFaults6V);
+
+  int32_t RegisterUserFaults5VCallback(HAL_NotifyCallback callback, void* param,
+                                       HAL_Bool initialNotify);
+  void CancelUserFaults5VCallback(int32_t uid);
+  void InvokeUserFaults5VCallback(HAL_Value value);
+  int32_t GetUserFaults5V();
+  void SetUserFaults5V(int32_t userFaults5V);
+
+  int32_t RegisterUserFaults3V3Callback(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+  void CancelUserFaults3V3Callback(int32_t uid);
+  void InvokeUserFaults3V3Callback(HAL_Value value);
+  int32_t GetUserFaults3V3();
+  void SetUserFaults3V3(int32_t userFaults3V3);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_fPGAButton{false};
+  std::shared_ptr<NotifyListenerVector> m_fPGAButtonCallbacks = nullptr;
+  std::atomic<double> m_vInVoltage{0.0};
+  std::shared_ptr<NotifyListenerVector> m_vInVoltageCallbacks = nullptr;
+  std::atomic<double> m_vInCurrent{0.0};
+  std::shared_ptr<NotifyListenerVector> m_vInCurrentCallbacks = nullptr;
+  std::atomic<double> m_userVoltage6V{6.0};
+  std::shared_ptr<NotifyListenerVector> m_userVoltage6VCallbacks = nullptr;
+  std::atomic<double> m_userCurrent6V{0.0};
+  std::shared_ptr<NotifyListenerVector> m_userCurrent6VCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_userActive6V{false};
+  std::shared_ptr<NotifyListenerVector> m_userActive6VCallbacks = nullptr;
+  std::atomic<double> m_userVoltage5V{5.0};
+  std::shared_ptr<NotifyListenerVector> m_userVoltage5VCallbacks = nullptr;
+  std::atomic<double> m_userCurrent5V{0.0};
+  std::shared_ptr<NotifyListenerVector> m_userCurrent5VCallbacks = nullptr;
+  std::atomic<HAL_Bool> m_userActive5V{false};
+  std::shared_ptr<NotifyListenerVector> m_userActive5VCallbacks = nullptr;
+  std::atomic<double> m_userVoltage3V3{3.3};
+  std::shared_ptr<NotifyListenerVector> m_userVoltage3V3Callbacks = nullptr;
+  std::atomic<double> m_userCurrent3V3{0.0};
+  std::shared_ptr<NotifyListenerVector> m_userCurrent3V3Callbacks = nullptr;
+  std::atomic<HAL_Bool> m_userActive3V3{false};
+  std::shared_ptr<NotifyListenerVector> m_userActive3V3Callbacks = nullptr;
+  std::atomic<int32_t> m_userFaults6V{0};
+  std::shared_ptr<NotifyListenerVector> m_userFaults6VCallbacks = nullptr;
+  std::atomic<int32_t> m_userFaults5V{0};
+  std::shared_ptr<NotifyListenerVector> m_userFaults5VCallbacks = nullptr;
+  std::atomic<int32_t> m_userFaults3V3{0};
+  std::shared_ptr<NotifyListenerVector> m_userFaults3V3Callbacks = nullptr;
+};
+extern RoboRioData* SimRoboRioData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIAccelerometerData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIAccelerometerData.cpp
new file mode 100644
index 0000000..ed13a3a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIAccelerometerData.cpp
@@ -0,0 +1,334 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "SPIAccelerometerDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeSPIAccelerometerData() {
+  static SPIAccelerometerData ssad[5];
+  ::hal::SimSPIAccelerometerData = ssad;
+}
+}  // namespace init
+}  // namespace hal
+
+SPIAccelerometerData* hal::SimSPIAccelerometerData;
+void SPIAccelerometerData::ResetData() {
+  m_active = false;
+  m_activeCallbacks = nullptr;
+  m_range = 0;
+  m_rangeCallbacks = nullptr;
+  m_x = 0.0;
+  m_xCallbacks = nullptr;
+  m_y = 0.0;
+  m_yCallbacks = nullptr;
+  m_z = 0.0;
+  m_zCallbacks = nullptr;
+}
+
+int32_t SPIAccelerometerData::RegisterActiveCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_activeCallbacks =
+        RegisterCallback(m_activeCallbacks, "Active", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetActive());
+    callback("Active", param, &value);
+  }
+  return newUid;
+}
+
+void SPIAccelerometerData::CancelActiveCallback(int32_t uid) {
+  m_activeCallbacks = CancelCallback(m_activeCallbacks, uid);
+}
+
+void SPIAccelerometerData::InvokeActiveCallback(HAL_Value value) {
+  InvokeCallback(m_activeCallbacks, "Active", &value);
+}
+
+HAL_Bool SPIAccelerometerData::GetActive() { return m_active; }
+
+void SPIAccelerometerData::SetActive(HAL_Bool active) {
+  HAL_Bool oldValue = m_active.exchange(active);
+  if (oldValue != active) {
+    InvokeActiveCallback(MakeBoolean(active));
+  }
+}
+
+int32_t SPIAccelerometerData::RegisterRangeCallback(HAL_NotifyCallback callback,
+                                                    void* param,
+                                                    HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_rangeCallbacks =
+        RegisterCallback(m_rangeCallbacks, "Range", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeInt(GetRange());
+    callback("Range", param, &value);
+  }
+  return newUid;
+}
+
+void SPIAccelerometerData::CancelRangeCallback(int32_t uid) {
+  m_rangeCallbacks = CancelCallback(m_rangeCallbacks, uid);
+}
+
+void SPIAccelerometerData::InvokeRangeCallback(HAL_Value value) {
+  InvokeCallback(m_rangeCallbacks, "Range", &value);
+}
+
+int32_t SPIAccelerometerData::GetRange() { return m_range; }
+
+void SPIAccelerometerData::SetRange(int32_t range) {
+  int32_t oldValue = m_range.exchange(range);
+  if (oldValue != range) {
+    InvokeRangeCallback(MakeInt(range));
+  }
+}
+
+int32_t SPIAccelerometerData::RegisterXCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_xCallbacks =
+        RegisterCallback(m_xCallbacks, "X", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetX());
+    callback("X", param, &value);
+  }
+  return newUid;
+}
+
+void SPIAccelerometerData::CancelXCallback(int32_t uid) {
+  m_xCallbacks = CancelCallback(m_xCallbacks, uid);
+}
+
+void SPIAccelerometerData::InvokeXCallback(HAL_Value value) {
+  InvokeCallback(m_xCallbacks, "X", &value);
+}
+
+double SPIAccelerometerData::GetX() { return m_x; }
+
+void SPIAccelerometerData::SetX(double x) {
+  double oldValue = m_x.exchange(x);
+  if (oldValue != x) {
+    InvokeXCallback(MakeDouble(x));
+  }
+}
+
+int32_t SPIAccelerometerData::RegisterYCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_yCallbacks =
+        RegisterCallback(m_yCallbacks, "Y", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetY());
+    callback("Y", param, &value);
+  }
+  return newUid;
+}
+
+void SPIAccelerometerData::CancelYCallback(int32_t uid) {
+  m_yCallbacks = CancelCallback(m_yCallbacks, uid);
+}
+
+void SPIAccelerometerData::InvokeYCallback(HAL_Value value) {
+  InvokeCallback(m_yCallbacks, "Y", &value);
+}
+
+double SPIAccelerometerData::GetY() { return m_y; }
+
+void SPIAccelerometerData::SetY(double y) {
+  double oldValue = m_y.exchange(y);
+  if (oldValue != y) {
+    InvokeYCallback(MakeDouble(y));
+  }
+}
+
+int32_t SPIAccelerometerData::RegisterZCallback(HAL_NotifyCallback callback,
+                                                void* param,
+                                                HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_zCallbacks =
+        RegisterCallback(m_zCallbacks, "Z", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetZ());
+    callback("Z", param, &value);
+  }
+  return newUid;
+}
+
+void SPIAccelerometerData::CancelZCallback(int32_t uid) {
+  m_zCallbacks = CancelCallback(m_zCallbacks, uid);
+}
+
+void SPIAccelerometerData::InvokeZCallback(HAL_Value value) {
+  InvokeCallback(m_zCallbacks, "Z", &value);
+}
+
+double SPIAccelerometerData::GetZ() { return m_z; }
+
+void SPIAccelerometerData::SetZ(double z) {
+  double oldValue = m_z.exchange(z);
+  if (oldValue != z) {
+    InvokeZCallback(MakeDouble(z));
+  }
+}
+
+extern "C" {
+void HALSIM_ResetSPIAccelerometerData(int32_t index) {
+  SimSPIAccelerometerData[index].ResetData();
+}
+
+int32_t HALSIM_RegisterSPIAccelerometerActiveCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimSPIAccelerometerData[index].RegisterActiveCallback(callback, param,
+                                                               initialNotify);
+}
+
+void HALSIM_CancelSPIAccelerometerActiveCallback(int32_t index, int32_t uid) {
+  SimSPIAccelerometerData[index].CancelActiveCallback(uid);
+}
+
+HAL_Bool HALSIM_GetSPIAccelerometerActive(int32_t index) {
+  return SimSPIAccelerometerData[index].GetActive();
+}
+
+void HALSIM_SetSPIAccelerometerActive(int32_t index, HAL_Bool active) {
+  SimSPIAccelerometerData[index].SetActive(active);
+}
+
+int32_t HALSIM_RegisterSPIAccelerometerRangeCallback(
+    int32_t index, HAL_NotifyCallback callback, void* param,
+    HAL_Bool initialNotify) {
+  return SimSPIAccelerometerData[index].RegisterRangeCallback(callback, param,
+                                                              initialNotify);
+}
+
+void HALSIM_CancelSPIAccelerometerRangeCallback(int32_t index, int32_t uid) {
+  SimSPIAccelerometerData[index].CancelRangeCallback(uid);
+}
+
+int32_t HALSIM_GetSPIAccelerometerRange(int32_t index) {
+  return SimSPIAccelerometerData[index].GetRange();
+}
+
+void HALSIM_SetSPIAccelerometerRange(int32_t index, int32_t range) {
+  SimSPIAccelerometerData[index].SetRange(range);
+}
+
+int32_t HALSIM_RegisterSPIAccelerometerXCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimSPIAccelerometerData[index].RegisterXCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelSPIAccelerometerXCallback(int32_t index, int32_t uid) {
+  SimSPIAccelerometerData[index].CancelXCallback(uid);
+}
+
+double HALSIM_GetSPIAccelerometerX(int32_t index) {
+  return SimSPIAccelerometerData[index].GetX();
+}
+
+void HALSIM_SetSPIAccelerometerX(int32_t index, double x) {
+  SimSPIAccelerometerData[index].SetX(x);
+}
+
+int32_t HALSIM_RegisterSPIAccelerometerYCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimSPIAccelerometerData[index].RegisterYCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelSPIAccelerometerYCallback(int32_t index, int32_t uid) {
+  SimSPIAccelerometerData[index].CancelYCallback(uid);
+}
+
+double HALSIM_GetSPIAccelerometerY(int32_t index) {
+  return SimSPIAccelerometerData[index].GetY();
+}
+
+void HALSIM_SetSPIAccelerometerY(int32_t index, double y) {
+  SimSPIAccelerometerData[index].SetY(y);
+}
+
+int32_t HALSIM_RegisterSPIAccelerometerZCallback(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  return SimSPIAccelerometerData[index].RegisterZCallback(callback, param,
+                                                          initialNotify);
+}
+
+void HALSIM_CancelSPIAccelerometerZCallback(int32_t index, int32_t uid) {
+  SimSPIAccelerometerData[index].CancelZCallback(uid);
+}
+
+double HALSIM_GetSPIAccelerometerZ(int32_t index) {
+  return SimSPIAccelerometerData[index].GetZ();
+}
+
+void HALSIM_SetSPIAccelerometerZ(int32_t index, double z) {
+  SimSPIAccelerometerData[index].SetZ(z);
+}
+
+void HALSIM_RegisterSPIAccelerometerAllCallbcaks(int32_t index,
+                                                 HAL_NotifyCallback callback,
+                                                 void* param,
+                                                 HAL_Bool initialNotify) {
+  SimSPIAccelerometerData[index].RegisterActiveCallback(callback, param,
+                                                        initialNotify);
+  SimSPIAccelerometerData[index].RegisterRangeCallback(callback, param,
+                                                       initialNotify);
+  SimSPIAccelerometerData[index].RegisterXCallback(callback, param,
+                                                   initialNotify);
+  SimSPIAccelerometerData[index].RegisterYCallback(callback, param,
+                                                   initialNotify);
+  SimSPIAccelerometerData[index].RegisterZCallback(callback, param,
+                                                   initialNotify);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIAccelerometerDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIAccelerometerDataInternal.h
new file mode 100644
index 0000000..c0df5ba
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIAccelerometerDataInternal.h
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/SPIAccelerometerData.h"
+
+namespace hal {
+class SPIAccelerometerData {
+ public:
+  int32_t RegisterActiveCallback(HAL_NotifyCallback callback, void* param,
+                                 HAL_Bool initialNotify);
+  void CancelActiveCallback(int32_t uid);
+  void InvokeActiveCallback(HAL_Value value);
+  HAL_Bool GetActive();
+  void SetActive(HAL_Bool active);
+
+  int32_t RegisterRangeCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelRangeCallback(int32_t uid);
+  void InvokeRangeCallback(HAL_Value value);
+  int32_t GetRange();
+  void SetRange(int32_t range);
+
+  int32_t RegisterXCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelXCallback(int32_t uid);
+  void InvokeXCallback(HAL_Value value);
+  double GetX();
+  void SetX(double x);
+
+  int32_t RegisterYCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelYCallback(int32_t uid);
+  void InvokeYCallback(HAL_Value value);
+  double GetY();
+  void SetY(double y);
+
+  int32_t RegisterZCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelZCallback(int32_t uid);
+  void InvokeZCallback(HAL_Value value);
+  double GetZ();
+  void SetZ(double z);
+
+  virtual void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  std::atomic<HAL_Bool> m_active{false};
+  std::shared_ptr<NotifyListenerVector> m_activeCallbacks = nullptr;
+  std::atomic<int32_t> m_range{0};
+  std::shared_ptr<NotifyListenerVector> m_rangeCallbacks = nullptr;
+  std::atomic<double> m_x{0.0};
+  std::shared_ptr<NotifyListenerVector> m_xCallbacks = nullptr;
+  std::atomic<double> m_y{0.0};
+  std::shared_ptr<NotifyListenerVector> m_yCallbacks = nullptr;
+  std::atomic<double> m_z{0.0};
+  std::shared_ptr<NotifyListenerVector> m_zCallbacks = nullptr;
+};
+extern SPIAccelerometerData* SimSPIAccelerometerData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIData.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIData.cpp
new file mode 100644
index 0000000..4fd29a0
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIData.cpp
@@ -0,0 +1,228 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "../PortsInternal.h"
+#include "MockData/NotifyCallbackHelpers.h"
+#include "SPIDataInternal.h"
+
+using namespace hal;
+
+void InvokeCallback(
+    std::shared_ptr<SpiAutoReceiveDataListenerVector> currentVector,
+    const char* name, uint8_t* buffer, int32_t numToRead,
+    int32_t* outputCount) {
+  // Return if no callbacks are assigned
+  if (currentVector == nullptr) return;
+  // Get a copy of the shared_ptr, then iterate and callback listeners
+  auto newCallbacks = currentVector;
+  for (size_t i = 0; i < newCallbacks->size(); ++i) {
+    if (!(*newCallbacks)[i]) continue;  // callback was removed
+    auto listener = (*newCallbacks)[i];
+    listener.callback(name, listener.param, buffer, numToRead, outputCount);
+  }
+}
+
+namespace hal {
+namespace init {
+void InitializeSPIData() {
+  static SPIData ssd[5];
+  ::hal::SimSPIData = ssd;
+}
+}  // namespace init
+}  // namespace hal
+
+SPIData* hal::SimSPIData;
+void SPIData::ResetData() {
+  m_initialized = false;
+  m_initializedCallbacks = nullptr;
+  m_readCallbacks = nullptr;
+  m_writeCallbacks = nullptr;
+  m_autoReceiveDataCallbacks = nullptr;
+}
+
+SPIData::SPIData() {}
+SPIData::~SPIData() {}
+
+int32_t SPIData::RegisterInitializedCallback(HAL_NotifyCallback callback,
+                                             void* param,
+                                             HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_initializedCallbacks = RegisterCallback(
+        m_initializedCallbacks, "Initialized", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeBoolean(GetInitialized());
+    callback("Initialized", param, &value);
+  }
+  return newUid;
+}
+
+void SPIData::CancelInitializedCallback(int32_t uid) {
+  m_initializedCallbacks = CancelCallback(m_initializedCallbacks, uid);
+}
+
+void SPIData::InvokeInitializedCallback(HAL_Value value) {
+  InvokeCallback(m_initializedCallbacks, "Initialized", &value);
+}
+
+HAL_Bool SPIData::GetInitialized() { return m_initialized; }
+
+void SPIData::SetInitialized(HAL_Bool initialized) {
+  HAL_Bool oldValue = m_initialized.exchange(initialized);
+  if (oldValue != initialized) {
+    InvokeInitializedCallback(MakeBoolean(initialized));
+  }
+}
+
+int32_t SPIData::RegisterReadCallback(HAL_BufferCallback callback,
+                                      void* param) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_readCallbacks =
+        RegisterCallback(m_readCallbacks, "Read", callback, param, &newUid);
+  }
+
+  return newUid;
+}
+
+void SPIData::CancelReadCallback(int32_t uid) {
+  m_readCallbacks = CancelCallback(m_readCallbacks, uid);
+}
+
+int32_t SPIData::RegisterWriteCallback(HAL_ConstBufferCallback callback,
+                                       void* param) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_writeCallbacks =
+        RegisterCallback(m_writeCallbacks, "Write", callback, param, &newUid);
+  }
+
+  return newUid;
+}
+
+void SPIData::CancelWriteCallback(int32_t uid) {
+  m_writeCallbacks = CancelCallback(m_writeCallbacks, uid);
+}
+
+int32_t SPIData::RegisterReadAutoReceivedDataCallback(
+    HAL_SpiReadAutoReceiveBufferCallback callback, void* param) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_autoReceiveDataCallbacks = RegisterCallbackImpl(
+        m_autoReceiveDataCallbacks, "AutoReceive", callback, param, &newUid);
+  }
+  return newUid;
+}
+
+void SPIData::CancelReadAutoReceivedDataCallback(int32_t uid) {
+  m_autoReceiveDataCallbacks =
+      CancelCallbackImpl<SpiAutoReceiveDataListenerVector,
+                         HAL_SpiReadAutoReceiveBufferCallback>(
+          m_autoReceiveDataCallbacks, uid);
+}
+
+int32_t SPIData::Read(uint8_t* buffer, int32_t count) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  InvokeCallback(m_readCallbacks, "Read", buffer, count);
+
+  return count;
+}
+
+int32_t SPIData::Write(const uint8_t* dataToSend, int32_t sendSize) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  InvokeCallback(m_writeCallbacks, "Write", const_cast<uint8_t*>(dataToSend),
+                 sendSize);
+
+  return sendSize;
+}
+
+int32_t SPIData::Transaction(const uint8_t* dataToSend, uint8_t* dataReceived,
+                             int32_t size) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  InvokeCallback(m_writeCallbacks, "Write", dataToSend, size);
+  InvokeCallback(m_readCallbacks, "Read", dataReceived, size);
+
+  return size;
+}
+
+int32_t SPIData::ReadAutoReceivedData(uint8_t* buffer, int32_t numToRead,
+                                      double timeout, int32_t* status) {
+  int32_t outputCount = 0;
+  InvokeCallback(m_autoReceiveDataCallbacks, "AutoReceive",
+                 const_cast<uint8_t*>(buffer), numToRead, &outputCount);
+
+  return outputCount;
+}
+
+extern "C" {
+void HALSIM_ResetSPIData(int32_t index) { SimSPIData[index].ResetData(); }
+
+int32_t HALSIM_RegisterSPIInitializedCallback(int32_t index,
+                                              HAL_NotifyCallback callback,
+                                              void* param,
+                                              HAL_Bool initialNotify) {
+  return SimSPIData[index].RegisterInitializedCallback(callback, param,
+                                                       initialNotify);
+}
+
+void HALSIM_CancelSPIInitializedCallback(int32_t index, int32_t uid) {
+  SimSPIData[index].CancelInitializedCallback(uid);
+}
+
+HAL_Bool HALSIM_GetSPIInitialized(int32_t index) {
+  return SimSPIData[index].GetInitialized();
+}
+
+void HALSIM_SetSPIInitialized(int32_t index, HAL_Bool initialized) {
+  SimSPIData[index].SetInitialized(initialized);
+}
+
+int32_t HALSIM_RegisterSPIReadCallback(int32_t index,
+                                       HAL_BufferCallback callback,
+                                       void* param) {
+  return SimSPIData[index].RegisterReadCallback(callback, param);
+}
+void HALSIM_CancelSPIReadCallback(int32_t index, int32_t uid) {
+  SimSPIData[index].CancelReadCallback(uid);
+}
+
+int32_t HALSIM_RegisterSPIWriteCallback(int32_t index,
+                                        HAL_ConstBufferCallback callback,
+                                        void* param) {
+  return SimSPIData[index].RegisterWriteCallback(callback, param);
+}
+void HALSIM_CancelSPIWriteCallback(int32_t index, int32_t uid) {
+  SimSPIData[index].CancelWriteCallback(uid);
+}
+
+int32_t HALSIM_RegisterSPIReadAutoReceivedDataCallback(
+    int32_t index, HAL_SpiReadAutoReceiveBufferCallback callback, void* param) {
+  return SimSPIData[index].RegisterReadAutoReceivedDataCallback(callback,
+                                                                param);
+}
+
+void HALSIM_CancelSPIReadAutoReceivedDataCallback(int32_t index, int32_t uid) {
+  SimSPIData[index].CancelReadAutoReceivedDataCallback(uid);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIDataInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIDataInternal.h
new file mode 100644
index 0000000..8f0180b
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockData/SPIDataInternal.h
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <limits>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+#include "MockData/SPIData.h"
+
+namespace hal {
+
+typedef HalCallbackListenerVectorImpl<HAL_SpiReadAutoReceiveBufferCallback>
+    SpiAutoReceiveDataListenerVector;
+
+class SPIData {
+ public:
+  SPIData();
+  ~SPIData();
+
+  int32_t RegisterInitializedCallback(HAL_NotifyCallback callback, void* param,
+                                      HAL_Bool initialNotify);
+  void CancelInitializedCallback(int32_t uid);
+  void InvokeInitializedCallback(HAL_Value value);
+  HAL_Bool GetInitialized();
+  void SetInitialized(HAL_Bool initialized);
+
+  int32_t RegisterReadCallback(HAL_BufferCallback callback, void* param);
+  void CancelReadCallback(int32_t uid);
+
+  int32_t RegisterWriteCallback(HAL_ConstBufferCallback callback, void* param);
+  void CancelWriteCallback(int32_t uid);
+
+  int32_t RegisterReadAutoReceivedDataCallback(
+      HAL_SpiReadAutoReceiveBufferCallback callback, void* param);
+  void CancelReadAutoReceivedDataCallback(int32_t uid);
+
+  int32_t Read(uint8_t* buffer, int32_t count);
+  int32_t Write(const uint8_t* dataToSend, int32_t sendSize);
+  int32_t Transaction(const uint8_t* dataToSend, uint8_t* dataReceived,
+                      int32_t size);
+
+  int32_t ReadAutoReceivedData(uint8_t* buffer, int32_t numToRead,
+                               double timeout, int32_t* status);
+
+  void ResetData();
+
+ private:
+  wpi::mutex m_registerMutex;
+  wpi::mutex m_dataMutex;
+  std::atomic<HAL_Bool> m_initialized{false};
+  std::shared_ptr<NotifyListenerVector> m_initializedCallbacks = nullptr;
+  std::shared_ptr<BufferListenerVector> m_readCallbacks = nullptr;
+  std::shared_ptr<ConstBufferListenerVector> m_writeCallbacks = nullptr;
+  std::shared_ptr<SpiAutoReceiveDataListenerVector> m_autoReceiveDataCallbacks =
+      nullptr;
+};
+extern SPIData* SimSPIData;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockHooks.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/MockHooks.cpp
new file mode 100644
index 0000000..06ecce4
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockHooks.cpp
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <atomic>
+#include <chrono>
+#include <cstdio>
+#include <thread>
+
+#include <support/timestamp.h>
+
+#include "MockHooksInternal.h"
+
+static std::atomic<bool> programStarted{false};
+
+static std::atomic<uint64_t> programStartTime{0};
+
+namespace hal {
+namespace init {
+void InitializeMockHooks() {}
+}  // namespace init
+}  // namespace hal
+
+namespace hal {
+void RestartTiming() { programStartTime = wpi::Now(); }
+
+int64_t GetFPGATime() {
+  auto now = wpi::Now();
+  auto currentTime = now - programStartTime;
+  return currentTime;
+}
+
+double GetFPGATimestamp() { return GetFPGATime() * 1.0e-6; }
+
+void SetProgramStarted() { programStarted = true; }
+}  // namespace hal
+
+using namespace hal;
+
+extern "C" {
+void HALSIM_WaitForProgramStart(void) {
+  int count = 0;
+  while (!programStarted) {
+    count++;
+    std::printf("Waiting for program start signal: %d\n", count);
+    std::this_thread::sleep_for(std::chrono::milliseconds(500));
+  }
+}
+
+void HALSIM_SetProgramStarted(void) { SetProgramStarted(); }
+
+void HALSIM_RestartTiming(void) { RestartTiming(); }
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/MockHooksInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/MockHooksInternal.h
new file mode 100644
index 0000000..d7fd06f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/MockHooksInternal.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "MockData/MockHooks.h"
+
+namespace hal {
+void RestartTiming();
+
+int64_t GetFPGATime();
+
+double GetFPGATimestamp();
+
+void SetProgramStarted();
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Notifier.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Notifier.cpp
new file mode 100644
index 0000000..264352d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Notifier.cpp
@@ -0,0 +1,155 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Notifier.h"
+
+#include <chrono>
+
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+#include <support/timestamp.h>
+
+#include "HAL/HAL.h"
+#include "HAL/cpp/fpga_clock.h"
+#include "HAL/cpp/make_unique.h"
+#include "HAL/handles/UnlimitedHandleResource.h"
+
+namespace {
+struct Notifier {
+  uint64_t waitTime;
+  bool updatedAlarm = false;
+  bool active = true;
+  bool running = false;
+  wpi::mutex mutex;
+  wpi::condition_variable cond;
+};
+}  // namespace
+
+using namespace hal;
+
+class NotifierHandleContainer
+    : public UnlimitedHandleResource<HAL_NotifierHandle, Notifier,
+                                     HAL_HandleEnum::Notifier> {
+ public:
+  ~NotifierHandleContainer() {
+    ForEach([](HAL_NotifierHandle handle, Notifier* notifier) {
+      {
+        std::lock_guard<wpi::mutex> lock(notifier->mutex);
+        notifier->active = false;
+        notifier->running = false;
+      }
+      notifier->cond.notify_all();  // wake up any waiting threads
+    });
+  }
+};
+
+static NotifierHandleContainer* notifierHandles;
+
+namespace hal {
+namespace init {
+void InitializeNotifier() {
+  static NotifierHandleContainer nH;
+  notifierHandles = &nH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_NotifierHandle HAL_InitializeNotifier(int32_t* status) {
+  std::shared_ptr<Notifier> notifier = std::make_shared<Notifier>();
+  HAL_NotifierHandle handle = notifierHandles->Allocate(notifier);
+  if (handle == HAL_kInvalidHandle) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  return handle;
+}
+
+void HAL_StopNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return;
+
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->active = false;
+    notifier->running = false;
+  }
+  notifier->cond.notify_all();
+}
+
+void HAL_CleanNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
+  auto notifier = notifierHandles->Free(notifierHandle);
+  if (!notifier) return;
+
+  // Just in case HAL_StopNotifier() wasn't called...
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->active = false;
+    notifier->running = false;
+  }
+  notifier->cond.notify_all();
+}
+
+void HAL_UpdateNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                             uint64_t triggerTime, int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return;
+
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->waitTime = triggerTime;
+    notifier->running = true;
+    notifier->updatedAlarm = true;
+  }
+
+  // We wake up any waiters to change how long they're sleeping for
+  notifier->cond.notify_all();
+}
+
+void HAL_CancelNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                             int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return;
+
+  {
+    std::lock_guard<wpi::mutex> lock(notifier->mutex);
+    notifier->running = false;
+  }
+}
+
+uint64_t HAL_WaitForNotifierAlarm(HAL_NotifierHandle notifierHandle,
+                                  int32_t* status) {
+  auto notifier = notifierHandles->Get(notifierHandle);
+  if (!notifier) return 0;
+
+  std::unique_lock<wpi::mutex> lock(notifier->mutex);
+  while (notifier->active) {
+    double waitTime;
+    if (!notifier->running) {
+      waitTime = (HAL_GetFPGATime(status) * 1e-6) + 1000.0;
+      // If not running, wait 1000 seconds
+    } else {
+      waitTime = notifier->waitTime * 1e-6;
+    }
+
+    auto timeoutTime =
+        hal::fpga_clock::epoch() + std::chrono::duration<double>(waitTime);
+    notifier->cond.wait_until(lock, timeoutTime);
+    if (notifier->updatedAlarm) {
+      notifier->updatedAlarm = false;
+      continue;
+    }
+    if (!notifier->running) continue;
+    if (!notifier->active) break;
+    notifier->running = false;
+    return HAL_GetFPGATime(status);
+  }
+  return 0;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/OSSerialPort.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/OSSerialPort.cpp
new file mode 100644
index 0000000..b5060ff
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/OSSerialPort.cpp
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/SerialPort.h"
+
+namespace hal {
+namespace init {
+void InitializeOSSerialPort() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+void HAL_InitializeOSSerialPort(HAL_SerialPort port, int32_t* status) {}
+void HAL_SetOSSerialBaudRate(HAL_SerialPort port, int32_t baud,
+                             int32_t* status) {}
+void HAL_SetOSSerialDataBits(HAL_SerialPort port, int32_t bits,
+                             int32_t* status) {}
+void HAL_SetOSSerialParity(HAL_SerialPort port, int32_t parity,
+                           int32_t* status) {}
+void HAL_SetOSSerialStopBits(HAL_SerialPort port, int32_t stopBits,
+                             int32_t* status) {}
+void HAL_SetOSSerialWriteMode(HAL_SerialPort port, int32_t mode,
+                              int32_t* status) {}
+void HAL_SetOSSerialFlowControl(HAL_SerialPort port, int32_t flow,
+                                int32_t* status) {}
+void HAL_SetOSSerialTimeout(HAL_SerialPort port, double timeout,
+                            int32_t* status) {}
+void HAL_EnableOSSerialTermination(HAL_SerialPort port, char terminator,
+                                   int32_t* status) {}
+void HAL_DisableOSSerialTermination(HAL_SerialPort port, int32_t* status) {}
+void HAL_SetOSSerialReadBufferSize(HAL_SerialPort port, int32_t size,
+                                   int32_t* status) {}
+void HAL_SetOSSerialWriteBufferSize(HAL_SerialPort port, int32_t size,
+                                    int32_t* status) {}
+int32_t HAL_GetOSSerialBytesReceived(HAL_SerialPort port, int32_t* status) {
+  return 0;
+}
+int32_t HAL_ReadOSSerial(HAL_SerialPort port, char* buffer, int32_t count,
+                         int32_t* status) {
+  return 0;
+}
+int32_t HAL_WriteOSSerial(HAL_SerialPort port, const char* buffer,
+                          int32_t count, int32_t* status) {
+  return 0;
+}
+void HAL_FlushOSSerial(HAL_SerialPort port, int32_t* status) {}
+void HAL_ClearOSSerial(HAL_SerialPort port, int32_t* status) {}
+void HAL_CloseOSSerial(HAL_SerialPort port, int32_t* status) {}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/PDP.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/PDP.cpp
new file mode 100644
index 0000000..3b4b098
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/PDP.cpp
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/PDP.h"
+
+#include "MockData/PDPDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePDP() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+void HAL_InitializePDP(int32_t module, int32_t* status) {
+  SimPDPData[module].SetInitialized(true);
+}
+HAL_Bool HAL_CheckPDPModule(int32_t module) {
+  return module < kNumPDPModules && module >= 0;
+}
+
+HAL_Bool HAL_CheckPDPChannel(int32_t channel) {
+  return channel < kNumPDPChannels && channel >= 0;
+}
+double HAL_GetPDPTemperature(int32_t module, int32_t* status) {
+  return SimPDPData[module].GetTemperature();
+}
+double HAL_GetPDPVoltage(int32_t module, int32_t* status) {
+  return SimPDPData[module].GetVoltage();
+}
+double HAL_GetPDPChannelCurrent(int32_t module, int32_t channel,
+                                int32_t* status) {
+  return SimPDPData[module].GetCurrent(channel);
+}
+double HAL_GetPDPTotalCurrent(int32_t module, int32_t* status) { return 0.0; }
+double HAL_GetPDPTotalPower(int32_t module, int32_t* status) { return 0.0; }
+double HAL_GetPDPTotalEnergy(int32_t module, int32_t* status) { return 0.0; }
+void HAL_ResetPDPTotalEnergy(int32_t module, int32_t* status) {}
+void HAL_ClearPDPStickyFaults(int32_t module, int32_t* status) {}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/PWM.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/PWM.cpp
new file mode 100644
index 0000000..e5b6778
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/PWM.cpp
@@ -0,0 +1,357 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/PWM.h"
+
+#include "ConstantsInternal.h"
+#include "DigitalInternal.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/PWMDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePWM() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+
+HAL_DigitalHandle HAL_InitializePWMPort(HAL_PortHandle portHandle,
+                                        int32_t* status) {
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  uint8_t origChannel = static_cast<uint8_t>(channel);
+
+  if (origChannel < kNumPWMHeaders) {
+    channel += kNumDigitalChannels;  // remap Headers to end of allocations
+  } else {
+    channel = remapMXPPWMChannel(channel) + 10;  // remap MXP to proper channel
+  }
+
+  auto handle =
+      digitalChannelHandles->Allocate(channel, HAL_HandleEnum::PWM, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = digitalChannelHandles->Get(handle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  port->channel = origChannel;
+
+  SimPWMData[origChannel].SetInitialized(true);
+
+  return handle;
+}
+void HAL_FreePWMPort(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimPWMData[port->channel].SetInitialized(false);
+
+  digitalChannelHandles->Free(pwmPortHandle, HAL_HandleEnum::PWM);
+}
+
+HAL_Bool HAL_CheckPWMChannel(int32_t channel) {
+  return channel < kNumPWMChannels && channel >= 0;
+}
+
+void HAL_SetPWMConfig(HAL_DigitalHandle pwmPortHandle, double max,
+                      double deadbandMax, double center, double deadbandMin,
+                      double min, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  // calculate the loop time in milliseconds
+  double loopTime =
+      HAL_GetPWMLoopTiming(status) / (kSystemClockTicksPerMicrosecond * 1e3);
+  if (*status != 0) return;
+
+  int32_t maxPwm = static_cast<int32_t>((max - kDefaultPwmCenter) / loopTime +
+                                        kDefaultPwmStepsDown - 1);
+  int32_t deadbandMaxPwm = static_cast<int32_t>(
+      (deadbandMax - kDefaultPwmCenter) / loopTime + kDefaultPwmStepsDown - 1);
+  int32_t centerPwm = static_cast<int32_t>(
+      (center - kDefaultPwmCenter) / loopTime + kDefaultPwmStepsDown - 1);
+  int32_t deadbandMinPwm = static_cast<int32_t>(
+      (deadbandMin - kDefaultPwmCenter) / loopTime + kDefaultPwmStepsDown - 1);
+  int32_t minPwm = static_cast<int32_t>((min - kDefaultPwmCenter) / loopTime +
+                                        kDefaultPwmStepsDown - 1);
+
+  port->maxPwm = maxPwm;
+  port->deadbandMaxPwm = deadbandMaxPwm;
+  port->deadbandMinPwm = deadbandMinPwm;
+  port->centerPwm = centerPwm;
+  port->minPwm = minPwm;
+  port->configSet = true;
+}
+
+void HAL_SetPWMConfigRaw(HAL_DigitalHandle pwmPortHandle, int32_t maxPwm,
+                         int32_t deadbandMaxPwm, int32_t centerPwm,
+                         int32_t deadbandMinPwm, int32_t minPwm,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  port->maxPwm = maxPwm;
+  port->deadbandMaxPwm = deadbandMaxPwm;
+  port->deadbandMinPwm = deadbandMinPwm;
+  port->centerPwm = centerPwm;
+  port->minPwm = minPwm;
+}
+
+void HAL_GetPWMConfigRaw(HAL_DigitalHandle pwmPortHandle, int32_t* maxPwm,
+                         int32_t* deadbandMaxPwm, int32_t* centerPwm,
+                         int32_t* deadbandMinPwm, int32_t* minPwm,
+                         int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  *maxPwm = port->maxPwm;
+  *deadbandMaxPwm = port->deadbandMaxPwm;
+  *deadbandMinPwm = port->deadbandMinPwm;
+  *centerPwm = port->centerPwm;
+  *minPwm = port->minPwm;
+}
+
+void HAL_SetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
+                                 HAL_Bool eliminateDeadband, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  port->eliminateDeadband = eliminateDeadband;
+}
+
+HAL_Bool HAL_GetPWMEliminateDeadband(HAL_DigitalHandle pwmPortHandle,
+                                     int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  return port->eliminateDeadband;
+}
+
+/**
+ * Set a PWM channel to the desired value. The values range from 0 to 255 and
+ * the period is controlled
+ * by the PWM Period and MinHigh registers.
+ *
+ * @param channel The PWM channel to set.
+ * @param value The PWM value to set.
+ */
+void HAL_SetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t value,
+                   int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimPWMData[port->channel].SetRawValue(value);
+}
+
+/**
+ * Set a PWM channel to the desired scaled value. The values range from -1 to 1
+ * and
+ * the period is controlled
+ * by the PWM Period and MinHigh registers.
+ *
+ * @param channel The PWM channel to set.
+ * @param value The scaled PWM value to set.
+ */
+void HAL_SetPWMSpeed(HAL_DigitalHandle pwmPortHandle, double speed,
+                     int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  if (speed < -1.0) {
+    speed = -1.0;
+  } else if (speed > 1.0) {
+    speed = 1.0;
+  }
+
+  SimPWMData[port->channel].SetSpeed(speed);
+}
+
+/**
+ * Set a PWM channel to the desired position value. The values range from 0 to 1
+ * and
+ * the period is controlled
+ * by the PWM Period and MinHigh registers.
+ *
+ * @param channel The PWM channel to set.
+ * @param value The scaled PWM value to set.
+ */
+void HAL_SetPWMPosition(HAL_DigitalHandle pwmPortHandle, double pos,
+                        int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return;
+  }
+
+  if (pos < 0.0) {
+    pos = 0.0;
+  } else if (pos > 1.0) {
+    pos = 1.0;
+  }
+
+  SimPWMData[port->channel].SetPosition(pos);
+}
+
+void HAL_SetPWMDisabled(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  SimPWMData[port->channel].SetRawValue(0);
+  SimPWMData[port->channel].SetPosition(0);
+  SimPWMData[port->channel].SetSpeed(0);
+}
+
+/**
+ * Get a value from a PWM channel. The values range from 0 to 255.
+ *
+ * @param channel The PWM channel to read from.
+ * @return The raw PWM value.
+ */
+int32_t HAL_GetPWMRaw(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+
+  return SimPWMData[port->channel].GetRawValue();
+}
+
+/**
+ * Get a scaled value from a PWM channel. The values range from -1 to 1.
+ *
+ * @param channel The PWM channel to read from.
+ * @return The scaled PWM value.
+ */
+double HAL_GetPWMSpeed(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return 0;
+  }
+
+  double speed = SimPWMData[port->channel].GetSpeed();
+  if (speed > 1) speed = 1;
+  if (speed < -1) speed = -1;
+  return speed;
+}
+
+/**
+ * Get a position value from a PWM channel. The values range from 0 to 1.
+ *
+ * @param channel The PWM channel to read from.
+ * @return The scaled PWM value.
+ */
+double HAL_GetPWMPosition(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return 0;
+  }
+  if (!port->configSet) {
+    *status = INCOMPATIBLE_STATE;
+    return 0;
+  }
+
+  double position = SimPWMData[port->channel].GetPosition();
+  if (position > 1) position = 1;
+  if (position < 0) position = 0;
+  return position;
+}
+
+void HAL_LatchPWMZero(HAL_DigitalHandle pwmPortHandle, int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimPWMData[port->channel].SetZeroLatch(true);
+  SimPWMData[port->channel].SetZeroLatch(false);
+}
+
+/**
+ * Set how how often the PWM signal is squelched, thus scaling the period.
+ *
+ * @param channel The PWM channel to configure.
+ * @param squelchMask The 2-bit mask of outputs to squelch.
+ */
+void HAL_SetPWMPeriodScale(HAL_DigitalHandle pwmPortHandle, int32_t squelchMask,
+                           int32_t* status) {
+  auto port = digitalChannelHandles->Get(pwmPortHandle, HAL_HandleEnum::PWM);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  SimPWMData[port->channel].SetPeriodScale(squelchMask);
+}
+
+/**
+ * Get the loop timing of the PWM system
+ *
+ * @return The loop time
+ */
+int32_t HAL_GetPWMLoopTiming(int32_t* status) { return kExpectedLoopTiming; }
+
+/**
+ * Get the pwm starting cycle time
+ *
+ * @return The pwm cycle start time.
+ */
+uint64_t HAL_GetPWMCycleStartTime(int32_t* status) { return 0; }
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Ports.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Ports.cpp
new file mode 100644
index 0000000..d7454b5
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Ports.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Ports.h"
+
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePorts() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+int32_t HAL_GetNumAccumulators(void) { return kNumAccumulators; }
+int32_t HAL_GetNumAnalogTriggers(void) { return kNumAnalogTriggers; }
+int32_t HAL_GetNumAnalogInputs(void) { return kNumAnalogInputs; }
+int32_t HAL_GetNumAnalogOutputs(void) { return kNumAnalogOutputs; }
+int32_t HAL_GetNumCounters(void) { return kNumCounters; }
+int32_t HAL_GetNumDigitalHeaders(void) { return kNumDigitalHeaders; }
+int32_t HAL_GetNumPWMHeaders(void) { return kNumPWMHeaders; }
+int32_t HAL_GetNumDigitalChannels(void) { return kNumDigitalChannels; }
+int32_t HAL_GetNumPWMChannels(void) { return kNumPWMChannels; }
+int32_t HAL_GetNumDigitalPWMOutputs(void) { return kNumDigitalPWMOutputs; }
+int32_t HAL_GetNumEncoders(void) { return kNumEncoders; }
+int32_t HAL_GetNumInterrupts(void) { return kNumInterrupts; }
+int32_t HAL_GetNumRelayChannels(void) { return kNumRelayChannels; }
+int32_t HAL_GetNumRelayHeaders(void) { return kNumRelayHeaders; }
+int32_t HAL_GetNumPCMModules(void) { return kNumPCMModules; }
+int32_t HAL_GetNumSolenoidChannels(void) { return kNumSolenoidChannels; }
+int32_t HAL_GetNumPDPModules(void) { return kNumPDPModules; }
+int32_t HAL_GetNumPDPChannels(void) { return kNumPDPChannels; }
+int32_t HAL_GetNumCanTalons(void) { return kNumCanTalons; }
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/PortsInternal.h b/third_party/allwpilib_2018/hal/src/main/native/sim/PortsInternal.h
new file mode 100644
index 0000000..0b899f7
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/PortsInternal.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+namespace hal {
+constexpr int32_t kNumAccumulators = 2;
+constexpr int32_t kNumAnalogTriggers = 8;
+constexpr int32_t kNumAnalogInputs = 8;
+constexpr int32_t kNumAnalogOutputs = 2;
+constexpr int32_t kNumCounters = 8;
+constexpr int32_t kNumDigitalHeaders = 10;
+constexpr int32_t kNumPWMHeaders = 10;
+constexpr int32_t kNumDigitalChannels = 26;
+constexpr int32_t kNumPWMChannels = 20;
+constexpr int32_t kNumDigitalPWMOutputs = 6;
+constexpr int32_t kNumEncoders = 8;
+constexpr int32_t kNumInterrupts = 8;
+constexpr int32_t kNumRelayChannels = 8;
+constexpr int32_t kNumRelayHeaders = kNumRelayChannels / 2;
+constexpr int32_t kNumPCMModules = 63;
+constexpr int32_t kNumSolenoidChannels = 8;
+constexpr int32_t kNumPDPModules = 63;
+constexpr int32_t kNumPDPChannels = 16;
+constexpr int32_t kNumCanTalons = 63;
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Power.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Power.cpp
new file mode 100644
index 0000000..95ea752
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Power.cpp
@@ -0,0 +1,64 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Power.h"
+
+#include "MockData/RoboRioDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializePower() {}
+}  // namespace init
+}  // namespace hal
+
+// TODO: Fix the naming in here
+extern "C" {
+double HAL_GetVinVoltage(int32_t* status) {
+  return SimRoboRioData[0].GetVInVoltage();
+}
+double HAL_GetVinCurrent(int32_t* status) {
+  return SimRoboRioData[0].GetVInCurrent();
+}
+double HAL_GetUserVoltage6V(int32_t* status) {
+  return SimRoboRioData[0].GetUserVoltage6V();
+}
+double HAL_GetUserCurrent6V(int32_t* status) {
+  return SimRoboRioData[0].GetUserCurrent6V();
+}
+HAL_Bool HAL_GetUserActive6V(int32_t* status) {
+  return SimRoboRioData[0].GetUserActive6V();
+}
+int32_t HAL_GetUserCurrentFaults6V(int32_t* status) {
+  return SimRoboRioData[0].GetUserFaults6V();
+}
+double HAL_GetUserVoltage5V(int32_t* status) {
+  return SimRoboRioData[0].GetUserVoltage5V();
+}
+double HAL_GetUserCurrent5V(int32_t* status) {
+  return SimRoboRioData[0].GetUserCurrent5V();
+}
+HAL_Bool HAL_GetUserActive5V(int32_t* status) {
+  return SimRoboRioData[0].GetUserActive5V();
+}
+int32_t HAL_GetUserCurrentFaults5V(int32_t* status) {
+  return SimRoboRioData[0].GetUserFaults5V();
+}
+double HAL_GetUserVoltage3V3(int32_t* status) {
+  return SimRoboRioData[0].GetUserVoltage3V3();
+}
+double HAL_GetUserCurrent3V3(int32_t* status) {
+  return SimRoboRioData[0].GetUserCurrent3V3();
+}
+HAL_Bool HAL_GetUserActive3V3(int32_t* status) {
+  return SimRoboRioData[0].GetUserActive3V3();
+}
+int32_t HAL_GetUserCurrentFaults3V3(int32_t* status) {
+  return SimRoboRioData[0].GetUserFaults3V3();
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Relay.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Relay.cpp
new file mode 100644
index 0000000..528579f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Relay.cpp
@@ -0,0 +1,119 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Relay.h"
+
+#include "HAL/handles/IndexedHandleResource.h"
+#include "MockData/RelayDataInternal.h"
+#include "PortsInternal.h"
+
+using namespace hal;
+
+namespace {
+struct Relay {
+  uint8_t channel;
+  bool fwd;
+};
+}  // namespace
+
+static IndexedHandleResource<HAL_RelayHandle, Relay, kNumRelayChannels,
+                             HAL_HandleEnum::Relay>* relayHandles;
+
+namespace hal {
+namespace init {
+void InitializeRelay() {
+  static IndexedHandleResource<HAL_RelayHandle, Relay, kNumRelayChannels,
+                               HAL_HandleEnum::Relay>
+      rH;
+  relayHandles = &rH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_RelayHandle HAL_InitializeRelayPort(HAL_PortHandle portHandle, HAL_Bool fwd,
+                                        int32_t* status) {
+  if (*status != 0) return HAL_kInvalidHandle;
+
+  int16_t channel = getPortHandleChannel(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = PARAMETER_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  if (!fwd) channel += kNumRelayHeaders;  // add 4 to reverse channels
+
+  auto handle = relayHandles->Allocate(channel, status);
+
+  if (*status != 0)
+    return HAL_kInvalidHandle;  // failed to allocate. Pass error back.
+
+  auto port = relayHandles->Get(handle);
+  if (port == nullptr) {  // would only occur on thread issue.
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  if (!fwd) {
+    // Subtract number of headers to put channel in range
+    channel -= kNumRelayHeaders;
+
+    port->fwd = false;  // set to reverse
+
+    SimRelayData[channel].SetInitializedReverse(true);
+  } else {
+    port->fwd = true;  // set to forward
+    SimRelayData[channel].SetInitializedForward(true);
+  }
+
+  port->channel = static_cast<uint8_t>(channel);
+
+  return handle;
+}
+
+void HAL_FreeRelayPort(HAL_RelayHandle relayPortHandle) {
+  auto port = relayHandles->Get(relayPortHandle);
+  relayHandles->Free(relayPortHandle);
+  if (port == nullptr) return;
+  if (port->fwd)
+    SimRelayData[port->channel].SetInitializedForward(false);
+  else
+    SimRelayData[port->channel].SetInitializedReverse(false);
+}
+
+HAL_Bool HAL_CheckRelayChannel(int32_t channel) {
+  // roboRIO only has 4 headers, and the FPGA has
+  // seperate functions for forward and reverse,
+  // instead of seperate channel IDs
+  return channel < kNumRelayHeaders && channel >= 0;
+}
+
+void HAL_SetRelay(HAL_RelayHandle relayPortHandle, HAL_Bool on,
+                  int32_t* status) {
+  auto port = relayHandles->Get(relayPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+  if (port->fwd)
+    SimRelayData[port->channel].SetForward(on);
+  else
+    SimRelayData[port->channel].SetReverse(on);
+}
+
+HAL_Bool HAL_GetRelay(HAL_RelayHandle relayPortHandle, int32_t* status) {
+  auto port = relayHandles->Get(relayPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+  if (port->fwd)
+    return SimRelayData[port->channel].GetForward();
+  else
+    return SimRelayData[port->channel].GetReverse();
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/SPI.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/SPI.cpp
new file mode 100644
index 0000000..b60497d
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/SPI.cpp
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/SPI.h"
+
+#include "MockData/SPIDataInternal.h"
+
+using namespace hal;
+
+namespace hal {
+namespace init {
+void InitializeSPI() {}
+}  // namespace init
+}  // namespace hal
+
+void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
+  SimSPIData[port].SetInitialized(true);
+}
+int32_t HAL_TransactionSPI(HAL_SPIPort port, const uint8_t* dataToSend,
+                           uint8_t* dataReceived, int32_t size) {
+  return SimSPIData[port].Transaction(dataToSend, dataReceived, size);
+}
+int32_t HAL_WriteSPI(HAL_SPIPort port, const uint8_t* dataToSend,
+                     int32_t sendSize) {
+  return SimSPIData[port].Write(dataToSend, sendSize);
+}
+int32_t HAL_ReadSPI(HAL_SPIPort port, uint8_t* buffer, int32_t count) {
+  return SimSPIData[port].Read(buffer, count);
+}
+void HAL_CloseSPI(HAL_SPIPort port) { SimSPIData[port].SetInitialized(false); }
+void HAL_SetSPISpeed(HAL_SPIPort port, int32_t speed) {}
+void HAL_SetSPIOpts(HAL_SPIPort port, HAL_Bool msbFirst,
+                    HAL_Bool sampleOnTrailing, HAL_Bool clkIdleHigh) {}
+void HAL_SetSPIChipSelectActiveHigh(HAL_SPIPort port, int32_t* status) {}
+void HAL_SetSPIChipSelectActiveLow(HAL_SPIPort port, int32_t* status) {}
+int32_t HAL_GetSPIHandle(HAL_SPIPort port) { return 0; }
+void HAL_SetSPIHandle(HAL_SPIPort port, int32_t handle) {}
+
+void HAL_InitSPIAuto(HAL_SPIPort port, int32_t bufferSize, int32_t* status) {}
+void HAL_FreeSPIAuto(HAL_SPIPort port, int32_t* status) {}
+void HAL_StartSPIAutoRate(HAL_SPIPort port, double period, int32_t* status) {}
+void HAL_StartSPIAutoTrigger(HAL_SPIPort port, HAL_Handle digitalSourceHandle,
+                             HAL_AnalogTriggerType analogTriggerType,
+                             HAL_Bool triggerRising, HAL_Bool triggerFalling,
+                             int32_t* status) {}
+void HAL_StopSPIAuto(HAL_SPIPort port, int32_t* status) {}
+void HAL_SetSPIAutoTransmitData(HAL_SPIPort port, const uint8_t* dataToSend,
+                                int32_t dataSize, int32_t zeroSize,
+                                int32_t* status) {}
+void HAL_ForceSPIAutoRead(HAL_SPIPort port, int32_t* status) {}
+int32_t HAL_ReadSPIAutoReceivedData(HAL_SPIPort port, uint8_t* buffer,
+                                    int32_t numToRead, double timeout,
+                                    int32_t* status) {
+  return SimSPIData[port].ReadAutoReceivedData(buffer, numToRead, timeout,
+                                               status);
+}
+int32_t HAL_GetSPIAutoDroppedCount(HAL_SPIPort port, int32_t* status) {
+  return 0;
+}
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/SerialPort.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/SerialPort.cpp
new file mode 100644
index 0000000..b44157a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/SerialPort.cpp
@@ -0,0 +1,70 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/SerialPort.h"
+
+namespace hal {
+namespace init {
+void InitializeSerialPort() {}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+void HAL_InitializeSerialPort(HAL_SerialPort port, int32_t* status) {}
+
+void HAL_SetSerialBaudRate(HAL_SerialPort port, int32_t baud, int32_t* status) {
+}
+
+void HAL_SetSerialDataBits(HAL_SerialPort port, int32_t bits, int32_t* status) {
+}
+
+void HAL_SetSerialParity(HAL_SerialPort port, int32_t parity, int32_t* status) {
+}
+
+void HAL_SetSerialStopBits(HAL_SerialPort port, int32_t stopBits,
+                           int32_t* status) {}
+
+void HAL_SetSerialWriteMode(HAL_SerialPort port, int32_t mode,
+                            int32_t* status) {}
+
+void HAL_SetSerialFlowControl(HAL_SerialPort port, int32_t flow,
+                              int32_t* status) {}
+
+void HAL_SetSerialTimeout(HAL_SerialPort port, double timeout,
+                          int32_t* status) {}
+
+void HAL_EnableSerialTermination(HAL_SerialPort port, char terminator,
+                                 int32_t* status) {}
+
+void HAL_DisableSerialTermination(HAL_SerialPort port, int32_t* status) {}
+
+void HAL_SetSerialReadBufferSize(HAL_SerialPort port, int32_t size,
+                                 int32_t* status) {}
+
+void HAL_SetSerialWriteBufferSize(HAL_SerialPort port, int32_t size,
+                                  int32_t* status) {}
+
+int32_t HAL_GetSerialBytesReceived(HAL_SerialPort port, int32_t* status) {
+  return 0;
+}
+
+int32_t HAL_ReadSerial(HAL_SerialPort port, char* buffer, int32_t count,
+                       int32_t* status) {
+  return 0;
+}
+
+int32_t HAL_WriteSerial(HAL_SerialPort port, const char* buffer, int32_t count,
+                        int32_t* status) {
+  return 0;
+}
+
+void HAL_FlushSerial(HAL_SerialPort port, int32_t* status) {}
+
+void HAL_ClearSerial(HAL_SerialPort port, int32_t* status) {}
+
+void HAL_CloseSerial(HAL_SerialPort port, int32_t* status) {}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Solenoid.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Solenoid.cpp
new file mode 100644
index 0000000..c227eea
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Solenoid.cpp
@@ -0,0 +1,134 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Solenoid.h"
+
+#include "HAL/Errors.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/handles/IndexedHandleResource.h"
+#include "MockData/PCMDataInternal.h"
+#include "PortsInternal.h"
+
+namespace {
+struct Solenoid {
+  uint8_t module;
+  uint8_t channel;
+};
+}  // namespace
+
+using namespace hal;
+
+static IndexedHandleResource<HAL_SolenoidHandle, Solenoid,
+                             kNumPCMModules * kNumSolenoidChannels,
+                             HAL_HandleEnum::Solenoid>* solenoidHandles;
+
+namespace hal {
+namespace init {
+void InitializeSolenoid() {
+  static IndexedHandleResource<HAL_SolenoidHandle, Solenoid,
+                               kNumPCMModules * kNumSolenoidChannels,
+                               HAL_HandleEnum::Solenoid>
+      sH;
+  solenoidHandles = &sH;
+}
+}  // namespace init
+}  // namespace hal
+
+extern "C" {
+HAL_SolenoidHandle HAL_InitializeSolenoidPort(HAL_PortHandle portHandle,
+                                              int32_t* status) {
+  int16_t channel = getPortHandleChannel(portHandle);
+  int16_t module = getPortHandleModule(portHandle);
+  if (channel == InvalidHandleIndex) {
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+
+  if (!HAL_CheckSolenoidChannel(channel)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  if (!HAL_CheckSolenoidModule(module)) {
+    *status = RESOURCE_OUT_OF_RANGE;
+    return HAL_kInvalidHandle;
+  }
+
+  auto handle = solenoidHandles->Allocate(
+      module * kNumSolenoidChannels + channel, status);
+  if (handle == HAL_kInvalidHandle) {  // out of resources
+    *status = NO_AVAILABLE_RESOURCES;
+    return HAL_kInvalidHandle;
+  }
+  auto solenoidPort = solenoidHandles->Get(handle);
+  if (solenoidPort == nullptr) {  // would only occur on thread issues
+    *status = HAL_HANDLE_ERROR;
+    return HAL_kInvalidHandle;
+  }
+  solenoidPort->module = static_cast<uint8_t>(module);
+  solenoidPort->channel = static_cast<uint8_t>(channel);
+
+  HALSIM_SetPCMSolenoidInitialized(module, channel, true);
+
+  return handle;
+}
+void HAL_FreeSolenoidPort(HAL_SolenoidHandle solenoidPortHandle) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) return;
+  solenoidHandles->Free(solenoidPortHandle);
+  HALSIM_SetPCMSolenoidInitialized(port->module, port->channel, false);
+}
+HAL_Bool HAL_CheckSolenoidModule(int32_t module) {
+  return module < kNumPCMModules && module >= 0;
+}
+
+HAL_Bool HAL_CheckSolenoidChannel(int32_t channel) {
+  return channel < kNumSolenoidChannels && channel >= 0;
+}
+HAL_Bool HAL_GetSolenoid(HAL_SolenoidHandle solenoidPortHandle,
+                         int32_t* status) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return false;
+  }
+
+  return HALSIM_GetPCMSolenoidOutput(port->module, port->channel);
+}
+int32_t HAL_GetAllSolenoids(int32_t module, int32_t* status) {
+  int32_t total = 0;
+  for (int i = 0; i < kNumSolenoidChannels; i++) {
+    int32_t channel = HALSIM_GetPCMSolenoidOutput(module, i) ? 1 : 0;
+    total = total + (channel << i);
+  }
+
+  return total;
+}
+void HAL_SetSolenoid(HAL_SolenoidHandle solenoidPortHandle, HAL_Bool value,
+                     int32_t* status) {
+  auto port = solenoidHandles->Get(solenoidPortHandle);
+  if (port == nullptr) {
+    *status = HAL_HANDLE_ERROR;
+    return;
+  }
+
+  HALSIM_SetPCMSolenoidOutput(port->module, port->channel, value);
+}
+int32_t HAL_GetPCMSolenoidBlackList(int32_t module, int32_t* status) {
+  return 0;
+}
+HAL_Bool HAL_GetPCMSolenoidVoltageStickyFault(int32_t module, int32_t* status) {
+  return 0;
+}
+HAL_Bool HAL_GetPCMSolenoidVoltageFault(int32_t module, int32_t* status) {
+  return 0;
+}
+void HAL_ClearAllPCMStickyFaults(int32_t module, int32_t* status) {}
+void HAL_SetOneShotDuration(HAL_SolenoidHandle solenoidPortHandle,
+                            int32_t durMS, int32_t* status) {}
+void HAL_FireOneShot(HAL_SolenoidHandle solenoidPortHandle, int32_t* status) {}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/hal/src/main/native/sim/Threads.cpp b/third_party/allwpilib_2018/hal/src/main/native/sim/Threads.cpp
new file mode 100644
index 0000000..67ca4fe
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/main/native/sim/Threads.cpp
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Threads.h"
+
+namespace hal {
+namespace init {
+void InitializeThreads() {}
+}  // namespace init
+}  // namespace hal
+
+int32_t HAL_GetThreadPriority(NativeThreadHandle handle, HAL_Bool* isRealTime,
+                              int32_t* status) {
+  return 0;
+}
+int32_t HAL_GetCurrentThreadPriority(HAL_Bool* isRealTime, int32_t* status) {
+  return 0;
+}
+HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime,
+                               int32_t priority, int32_t* status) {
+  return true;
+}
+HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority,
+                                      int32_t* status) {
+  return true;
+}
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/HALTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/HALTests.cpp
new file mode 100644
index 0000000..615b6de
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/HALTests.cpp
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/Solenoid.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+TEST(HALTests, RuntimeType) {
+  EXPECT_EQ(HAL_RuntimeType::HAL_Mock, HAL_GetRuntimeType());
+}
+
+TEST(HALSOLENOID, SolenoidTest) {
+  int32_t status = 0;
+  HAL_InitializeSolenoidPort(0, &status);
+  EXPECT_NE(status, 0);
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/AnalogInDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/AnalogInDataTests.cpp
new file mode 100644
index 0000000..9cf1c73
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/AnalogInDataTests.cpp
@@ -0,0 +1,80 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogInput.h"
+#include "HAL/HAL.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/AnalogInData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestAnalogInCallbackName;
+HAL_Value gTestAnalogInCallbackValue;
+
+void TestAnalogInInitializationCallback(const char* name, void* param,
+                                        const struct HAL_Value* value) {
+  gTestAnalogInCallbackName = name;
+  gTestAnalogInCallbackValue = *value;
+}
+
+TEST(AnalogInSimTests, TestAnalogInInitialization) {
+  const int INDEX_TO_TEST = 1;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterAnalogInInitializedCallback(
+      INDEX_TO_TEST, &TestAnalogInInitializationCallback, &callbackParam,
+      false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+  HAL_PortHandle portHandle;
+  HAL_DigitalHandle analogInHandle;
+
+  // Use out of range index
+  status = 0;
+  portHandle = 8000;
+  gTestAnalogInCallbackName = "Unset";
+  analogInHandle = HAL_InitializeAnalogInputPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, analogInHandle);
+  EXPECT_EQ(PARAMETER_OUT_OF_RANGE, status);
+  EXPECT_STREQ("Unset", gTestAnalogInCallbackName.c_str());
+
+  // Successful setup
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestAnalogInCallbackName = "Unset";
+  analogInHandle = HAL_InitializeAnalogInputPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != analogInHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestAnalogInCallbackName.c_str());
+
+  // Double initialize... should fail
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestAnalogInCallbackName = "Unset";
+  analogInHandle = HAL_InitializeAnalogInputPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, analogInHandle);
+  EXPECT_EQ(RESOURCE_IS_ALLOCATED, status);
+  EXPECT_STREQ("Unset", gTestAnalogInCallbackName.c_str());
+
+  // Reset, should allow you to re-register
+  hal::HandleBase::ResetGlobalHandles();
+  HALSIM_ResetAnalogInData(INDEX_TO_TEST);
+  callbackId = HALSIM_RegisterAnalogInInitializedCallback(
+      INDEX_TO_TEST, &TestAnalogInInitializationCallback, &callbackParam,
+      false);
+
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestAnalogInCallbackName = "Unset";
+  analogInHandle = HAL_InitializeAnalogInputPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != analogInHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestAnalogInCallbackName.c_str());
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/AnalogOutDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/AnalogOutDataTests.cpp
new file mode 100644
index 0000000..ffbf71a
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/AnalogOutDataTests.cpp
@@ -0,0 +1,80 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/AnalogOutput.h"
+#include "HAL/HAL.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/AnalogOutData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestAnalogOutCallbackName;
+HAL_Value gTestAnalogOutCallbackValue;
+
+void TestAnalogOutInitializationCallback(const char* name, void* param,
+                                         const struct HAL_Value* value) {
+  gTestAnalogOutCallbackName = name;
+  gTestAnalogOutCallbackValue = *value;
+}
+
+TEST(AnalogOutSimTests, TestAnalogOutInitialization) {
+  const int INDEX_TO_TEST = 1;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterAnalogOutInitializedCallback(
+      INDEX_TO_TEST, &TestAnalogOutInitializationCallback, &callbackParam,
+      false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+  HAL_PortHandle portHandle;
+  HAL_DigitalHandle analogOutHandle;
+
+  // Use out of range index
+  status = 0;
+  portHandle = 8000;
+  gTestAnalogOutCallbackName = "Unset";
+  analogOutHandle = HAL_InitializeAnalogOutputPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, analogOutHandle);
+  EXPECT_EQ(PARAMETER_OUT_OF_RANGE, status);
+  EXPECT_STREQ("Unset", gTestAnalogOutCallbackName.c_str());
+
+  // Successful setup
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestAnalogOutCallbackName = "Unset";
+  analogOutHandle = HAL_InitializeAnalogOutputPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != analogOutHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestAnalogOutCallbackName.c_str());
+
+  // Double initialize... should fail
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestAnalogOutCallbackName = "Unset";
+  analogOutHandle = HAL_InitializeAnalogOutputPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, analogOutHandle);
+  EXPECT_EQ(RESOURCE_IS_ALLOCATED, status);
+  EXPECT_STREQ("Unset", gTestAnalogOutCallbackName.c_str());
+
+  // Reset, should allow you to re-register
+  hal::HandleBase::ResetGlobalHandles();
+  HALSIM_ResetAnalogOutData(INDEX_TO_TEST);
+  callbackId = HALSIM_RegisterAnalogOutInitializedCallback(
+      INDEX_TO_TEST, &TestAnalogOutInitializationCallback, &callbackParam,
+      false);
+
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestAnalogOutCallbackName = "Unset";
+  analogOutHandle = HAL_InitializeAnalogOutputPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != analogOutHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestAnalogOutCallbackName.c_str());
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/DIODataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/DIODataTests.cpp
new file mode 100644
index 0000000..3a86a07
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/DIODataTests.cpp
@@ -0,0 +1,81 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/DIO.h"
+#include "HAL/HAL.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/DIOData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestDigitalIoCallbackName;
+HAL_Value gTestDigitalIoCallbackValue;
+
+void TestDigitalIoInitializationCallback(const char* name, void* param,
+                                         const struct HAL_Value* value) {
+  gTestDigitalIoCallbackName = name;
+  gTestDigitalIoCallbackValue = *value;
+}
+
+TEST(DigitalIoSimTests, TestDigitalIoInitialization) {
+  const int INDEX_TO_TEST = 3;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterDIOInitializedCallback(
+      INDEX_TO_TEST, &TestDigitalIoInitializationCallback, &callbackParam,
+      false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+  HAL_PortHandle portHandle;
+  HAL_DigitalHandle digitalIoHandle;
+
+  // Use out of range index
+  status = 0;
+  portHandle = 8000;
+  gTestDigitalIoCallbackName = "Unset";
+  digitalIoHandle = HAL_InitializeDIOPort(portHandle, true, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, digitalIoHandle);
+  EXPECT_EQ(PARAMETER_OUT_OF_RANGE, status);
+  EXPECT_STREQ("Unset", gTestDigitalIoCallbackName.c_str());
+
+  // Successful setup
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestDigitalIoCallbackName = "Unset";
+  digitalIoHandle = HAL_InitializeDIOPort(portHandle, true, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != digitalIoHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestDigitalIoCallbackName.c_str());
+
+  // Double initialize... should fail
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestDigitalIoCallbackName = "Unset";
+  digitalIoHandle = HAL_InitializeDIOPort(portHandle, true, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, digitalIoHandle);
+  EXPECT_EQ(RESOURCE_IS_ALLOCATED, status);
+  EXPECT_STREQ("Unset", gTestDigitalIoCallbackName.c_str());
+
+  // Reset, should allow you to re-register
+  hal::HandleBase::ResetGlobalHandles();
+  HALSIM_ResetDIOData(INDEX_TO_TEST);
+  callbackId = HALSIM_RegisterDIOInitializedCallback(
+      INDEX_TO_TEST, &TestDigitalIoInitializationCallback, &callbackParam,
+      false);
+
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestDigitalIoCallbackName = "Unset";
+  digitalIoHandle = HAL_InitializeDIOPort(portHandle, true, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != digitalIoHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestDigitalIoCallbackName.c_str());
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/DriverStationDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/DriverStationDataTests.cpp
new file mode 100644
index 0000000..ef1b7e6
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/DriverStationDataTests.cpp
@@ -0,0 +1,139 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cstring>
+
+#include "HAL/HAL.h"
+#include "HAL/Solenoid.h"
+#include "MockData/DriverStationData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+TEST(DriverStationTests, JoystickTests) {
+  HAL_JoystickAxes axes;
+  HAL_JoystickPOVs povs;
+  HAL_JoystickButtons buttons;
+
+  // Check default values before anything has been set
+  for (int joystickNum = 0; joystickNum < 6; ++joystickNum) {
+    HAL_GetJoystickAxes(joystickNum, &axes);
+    HAL_GetJoystickPOVs(joystickNum, &povs);
+    HAL_GetJoystickButtons(joystickNum, &buttons);
+
+    EXPECT_EQ(0, axes.count);
+    for (int i = 0; i < HAL_kMaxJoystickAxes; ++i) {
+      EXPECT_EQ(0, axes.axes[i]);
+    }
+
+    EXPECT_EQ(0, povs.count);
+    for (int i = 0; i < HAL_kMaxJoystickPOVs; ++i) {
+      EXPECT_EQ(0, povs.povs[i]);
+    }
+
+    EXPECT_EQ(0, buttons.count);
+    EXPECT_EQ(0u, buttons.buttons);
+  }
+
+  HAL_JoystickAxes set_axes;
+  std::memset(&set_axes, 0, sizeof(HAL_JoystickAxes));
+  HAL_JoystickPOVs set_povs;
+  std::memset(&set_povs, 0, sizeof(HAL_JoystickPOVs));
+  HAL_JoystickButtons set_buttons;
+  std::memset(&set_buttons, 0, sizeof(HAL_JoystickButtons));
+
+  // Set values
+  int joystickUnderTest = 4;
+  set_axes.count = 5;
+  for (int i = 0; i < set_axes.count; ++i) {
+    set_axes.axes[i] = i * .125;
+  }
+
+  set_povs.count = 3;
+  for (int i = 0; i < set_povs.count; ++i) {
+    set_povs.povs[i] = i * 15 + 12;
+  }
+
+  set_buttons.count = 8;
+  set_buttons.buttons = 0xDEADBEEF;
+
+  HALSIM_SetJoystickAxes(joystickUnderTest, &set_axes);
+  HALSIM_SetJoystickPOVs(joystickUnderTest, &set_povs);
+  HALSIM_SetJoystickButtons(joystickUnderTest, &set_buttons);
+
+  // Check the set values
+  HAL_GetJoystickAxes(joystickUnderTest, &axes);
+  HAL_GetJoystickPOVs(joystickUnderTest, &povs);
+  HAL_GetJoystickButtons(joystickUnderTest, &buttons);
+
+  EXPECT_EQ(5, axes.count);
+  EXPECT_NEAR(0.000, axes.axes[0], 0.000001);
+  EXPECT_NEAR(0.125, axes.axes[1], 0.000001);
+  EXPECT_NEAR(0.250, axes.axes[2], 0.000001);
+  EXPECT_NEAR(0.375, axes.axes[3], 0.000001);
+  EXPECT_NEAR(0.500, axes.axes[4], 0.000001);
+  EXPECT_NEAR(0, axes.axes[5], 0.000001);  // Should not have been set, still 0
+  EXPECT_NEAR(0, axes.axes[6], 0.000001);  // Should not have been set, still 0
+
+  EXPECT_EQ(3, povs.count);
+  EXPECT_EQ(12, povs.povs[0]);
+  EXPECT_EQ(27, povs.povs[1]);
+  EXPECT_EQ(42, povs.povs[2]);
+  EXPECT_EQ(0, povs.povs[3]);  // Should not have been set, still 0
+  EXPECT_EQ(0, povs.povs[4]);  // Should not have been set, still 0
+  EXPECT_EQ(0, povs.povs[5]);  // Should not have been set, still 0
+  EXPECT_EQ(0, povs.povs[6]);  // Should not have been set, still 0
+
+  EXPECT_EQ(8, buttons.count);
+  EXPECT_EQ(0xDEADBEEFu, buttons.buttons);
+
+  // Reset
+  HALSIM_ResetDriverStationData();
+  for (int joystickNum = 0; joystickNum < 6; ++joystickNum) {
+    HAL_GetJoystickAxes(joystickNum, &axes);
+    HAL_GetJoystickPOVs(joystickNum, &povs);
+    HAL_GetJoystickButtons(joystickNum, &buttons);
+
+    EXPECT_EQ(0, axes.count);
+    for (int i = 0; i < HAL_kMaxJoystickAxes; ++i) {
+      EXPECT_EQ(0, axes.axes[i]);
+    }
+
+    EXPECT_EQ(0, povs.count);
+    for (int i = 0; i < HAL_kMaxJoystickPOVs; ++i) {
+      EXPECT_EQ(0, povs.povs[i]);
+    }
+
+    EXPECT_EQ(0, buttons.count);
+    EXPECT_EQ(0u, buttons.buttons);
+  }
+}
+
+TEST(DriverStationTests, EventInfoTest) {
+  std::string eventName = "UnitTest";
+  std::string gameData = "Insert game specific info here :D";
+  HAL_MatchInfo info;
+  info.eventName = const_cast<char*>(eventName.c_str());
+  info.gameSpecificMessage = const_cast<char*>(gameData.c_str());
+  info.matchNumber = 5;
+  info.matchType = HAL_MatchType::HAL_kMatchType_qualification;
+  info.replayNumber = 42;
+  HALSIM_SetMatchInfo(&info);
+
+  HAL_MatchInfo dataBack;
+  HAL_GetMatchInfo(&dataBack);
+
+  EXPECT_STREQ(eventName.c_str(), dataBack.eventName);
+  EXPECT_STREQ(gameData.c_str(), dataBack.gameSpecificMessage);
+  EXPECT_EQ(5, dataBack.matchNumber);
+  EXPECT_EQ(HAL_MatchType::HAL_kMatchType_qualification, dataBack.matchType);
+  EXPECT_EQ(42, dataBack.replayNumber);
+
+  HAL_FreeMatchInfo(&dataBack);
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/I2CDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/I2CDataTests.cpp
new file mode 100644
index 0000000..11d01d1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/I2CDataTests.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/I2C.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/I2CData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestI2CCallbackName;
+HAL_Value gTestI2CCallbackValue;
+
+void TestI2CInitializationCallback(const char* name, void* param,
+                                   const struct HAL_Value* value) {
+  gTestI2CCallbackName = name;
+  gTestI2CCallbackValue = *value;
+}
+
+TEST(I2CSimTests, TestI2CInitialization) {
+  const int INDEX_TO_TEST = 1;
+
+  int32_t status;
+  HAL_I2CPort port;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterI2CInitializedCallback(
+      INDEX_TO_TEST, &TestI2CInitializationCallback, &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  status = 0;
+  port = HAL_I2C_kMXP;
+  gTestI2CCallbackName = "Unset";
+  HAL_InitializeI2C(port, &status);
+  EXPECT_STREQ("Initialized", gTestI2CCallbackName.c_str());
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PCMDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PCMDataTests.cpp
new file mode 100644
index 0000000..ef7814f
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PCMDataTests.cpp
@@ -0,0 +1,83 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/Solenoid.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/PCMData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestSolenoidCallbackName;
+HAL_Value gTestSolenoidCallbackValue;
+
+void TestSolenoidInitializationCallback(const char* name, void* param,
+                                        const struct HAL_Value* value) {
+  gTestSolenoidCallbackName = name;
+  gTestSolenoidCallbackValue = *value;
+}
+
+TEST(SolenoidSimTests, TestSolenoidInitialization) {
+  const int MODULE_TO_TEST = 2;
+  const int CHANNEL_TO_TEST = 3;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterPCMSolenoidInitializedCallback(
+      MODULE_TO_TEST, CHANNEL_TO_TEST, &TestSolenoidInitializationCallback,
+      &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+  HAL_PortHandle portHandle;
+  HAL_DigitalHandle solenoidHandle;
+
+  // Use out of range index
+  status = 0;
+  portHandle = 8000;
+  gTestSolenoidCallbackName = "Unset";
+  solenoidHandle = HAL_InitializeSolenoidPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, solenoidHandle);
+  EXPECT_EQ(HAL_HANDLE_ERROR, status);
+  EXPECT_STREQ("Unset", gTestSolenoidCallbackName.c_str());
+
+  // Successful setup
+  status = 0;
+  portHandle = HAL_GetPortWithModule(MODULE_TO_TEST, CHANNEL_TO_TEST);
+  gTestSolenoidCallbackName = "Unset";
+  solenoidHandle = HAL_InitializeSolenoidPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != solenoidHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("SolenoidInitialized", gTestSolenoidCallbackName.c_str());
+
+  // Double initialize... should fail
+  status = 0;
+  portHandle = HAL_GetPortWithModule(MODULE_TO_TEST, CHANNEL_TO_TEST);
+  gTestSolenoidCallbackName = "Unset";
+  solenoidHandle = HAL_InitializeSolenoidPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, solenoidHandle);
+  EXPECT_EQ(NO_AVAILABLE_RESOURCES, status);
+  EXPECT_STREQ("Unset", gTestSolenoidCallbackName.c_str());
+
+  // Reset, should allow you to re-register
+  hal::HandleBase::ResetGlobalHandles();
+  HALSIM_ResetPCMData(MODULE_TO_TEST);
+  callbackId = HALSIM_RegisterPCMSolenoidInitializedCallback(
+      MODULE_TO_TEST, CHANNEL_TO_TEST, &TestSolenoidInitializationCallback,
+      &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  status = 0;
+  portHandle = HAL_GetPortWithModule(MODULE_TO_TEST, CHANNEL_TO_TEST);
+  gTestSolenoidCallbackName = "Unset";
+  solenoidHandle = HAL_InitializeSolenoidPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != solenoidHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("SolenoidInitialized", gTestSolenoidCallbackName.c_str());
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PDPDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PDPDataTests.cpp
new file mode 100644
index 0000000..e3fe139
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PDPDataTests.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/PDP.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/PDPData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestPdpCallbackName;
+HAL_Value gTestPdpCallbackValue;
+
+void TestPdpInitializationCallback(const char* name, void* param,
+                                   const struct HAL_Value* value) {
+  gTestPdpCallbackName = name;
+  gTestPdpCallbackValue = *value;
+}
+
+TEST(PdpSimTests, TestPdpInitialization) {
+  const int INDEX_TO_TEST = 1;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterPDPInitializedCallback(
+      INDEX_TO_TEST, &TestPdpInitializationCallback, &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+
+  // Use out of range index
+  status = 0;
+  gTestPdpCallbackName = "Unset";
+  HAL_InitializePDP(INDEX_TO_TEST, &status);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestPdpCallbackName.c_str());
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PWMDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PWMDataTests.cpp
new file mode 100644
index 0000000..a580b74
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/PWMDataTests.cpp
@@ -0,0 +1,78 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/PWM.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/PWMData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestPwmCallbackName;
+HAL_Value gTestPwmCallbackValue;
+
+void TestPwmInitializationCallback(const char* name, void* param,
+                                   const struct HAL_Value* value) {
+  gTestPwmCallbackName = name;
+  gTestPwmCallbackValue = *value;
+}
+
+TEST(PWMSimTests, TestPwmInitialization) {
+  const int INDEX_TO_TEST = 7;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterPWMInitializedCallback(
+      INDEX_TO_TEST, &TestPwmInitializationCallback, &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+  HAL_PortHandle portHandle;
+  HAL_DigitalHandle pwmHandle;
+
+  // Use out of range index
+  status = 0;
+  portHandle = 8000;
+  gTestPwmCallbackName = "Unset";
+  pwmHandle = HAL_InitializePWMPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, pwmHandle);
+  EXPECT_EQ(PARAMETER_OUT_OF_RANGE, status);
+  EXPECT_STREQ("Unset", gTestPwmCallbackName.c_str());
+
+  // Successful setup
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestPwmCallbackName = "Unset";
+  pwmHandle = HAL_InitializePWMPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != pwmHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestPwmCallbackName.c_str());
+
+  // Double initialize... should fail
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestPwmCallbackName = "Unset";
+  pwmHandle = HAL_InitializePWMPort(portHandle, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, pwmHandle);
+  EXPECT_EQ(RESOURCE_IS_ALLOCATED, status);
+  EXPECT_STREQ("Unset", gTestPwmCallbackName.c_str());
+
+  // Reset, should allow you to re-register
+  hal::HandleBase::ResetGlobalHandles();
+  HALSIM_ResetPWMData(INDEX_TO_TEST);
+  callbackId = HALSIM_RegisterPWMInitializedCallback(
+      INDEX_TO_TEST, &TestPwmInitializationCallback, &callbackParam, false);
+
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestPwmCallbackName = "Unset";
+  pwmHandle = HAL_InitializePWMPort(portHandle, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != pwmHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("Initialized", gTestPwmCallbackName.c_str());
+}
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/RelayDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/RelayDataTests.cpp
new file mode 100644
index 0000000..444d9c3
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/RelayDataTests.cpp
@@ -0,0 +1,79 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/Relay.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/RelayData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestRelayCallbackName;
+HAL_Value gTestRelayCallbackValue;
+
+void TestRelayInitializationCallback(const char* name, void* param,
+                                     const struct HAL_Value* value) {
+  gTestRelayCallbackName = name;
+  gTestRelayCallbackValue = *value;
+}
+
+TEST(RelaySimTests, TestRelayInitialization) {
+  const int INDEX_TO_TEST = 3;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterRelayInitializedForwardCallback(
+      INDEX_TO_TEST, &TestRelayInitializationCallback, &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  int32_t status;
+  HAL_PortHandle portHandle;
+  HAL_DigitalHandle pdpHandle;
+
+  // Use out of range index
+  status = 0;
+  portHandle = 8000;
+  gTestRelayCallbackName = "Unset";
+  pdpHandle = HAL_InitializeRelayPort(portHandle, true, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, pdpHandle);
+  EXPECT_EQ(PARAMETER_OUT_OF_RANGE, status);
+  EXPECT_STREQ("Unset", gTestRelayCallbackName.c_str());
+
+  // Successful setup
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestRelayCallbackName = "Unset";
+  pdpHandle = HAL_InitializeRelayPort(portHandle, true, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != pdpHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("InitializedForward", gTestRelayCallbackName.c_str());
+
+  // Double initialize... should fail
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestRelayCallbackName = "Unset";
+  pdpHandle = HAL_InitializeRelayPort(portHandle, true, &status);
+  EXPECT_EQ(HAL_kInvalidHandle, pdpHandle);
+  EXPECT_EQ(RESOURCE_IS_ALLOCATED, status);
+  EXPECT_STREQ("Unset", gTestRelayCallbackName.c_str());
+
+  // Reset, should allow you to re-register
+  hal::HandleBase::ResetGlobalHandles();
+  HALSIM_ResetRelayData(INDEX_TO_TEST);
+  callbackId = HALSIM_RegisterRelayInitializedForwardCallback(
+      INDEX_TO_TEST, &TestRelayInitializationCallback, &callbackParam, false);
+
+  status = 0;
+  portHandle = HAL_GetPort(INDEX_TO_TEST);
+  gTestRelayCallbackName = "Unset";
+  pdpHandle = HAL_InitializeRelayPort(portHandle, true, &status);
+  EXPECT_TRUE(HAL_kInvalidHandle != pdpHandle);
+  EXPECT_EQ(0, status);
+  EXPECT_STREQ("InitializedForward", gTestRelayCallbackName.c_str());
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/SPIDataTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/SPIDataTests.cpp
new file mode 100644
index 0000000..9aae6fa
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/MockData/SPIDataTests.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/SPI.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "MockData/SPIData.h"
+#include "gtest/gtest.h"
+
+namespace hal {
+
+std::string gTestSpiCallbackName;
+HAL_Value gTestSpiCallbackValue;
+
+void TestSpiInitializationCallback(const char* name, void* param,
+                                   const struct HAL_Value* value) {
+  gTestSpiCallbackName = name;
+  gTestSpiCallbackValue = *value;
+}
+
+TEST(SpiSimTests, TestSpiInitialization) {
+  const int INDEX_TO_TEST = 2;
+
+  int32_t status;
+  HAL_SPIPort port;
+
+  int callbackParam = 0;
+  int callbackId = HALSIM_RegisterSPIInitializedCallback(
+      INDEX_TO_TEST, &TestSpiInitializationCallback, &callbackParam, false);
+  ASSERT_TRUE(0 != callbackId);
+
+  status = 0;
+  port = HAL_SPI_kOnboardCS2;
+  gTestSpiCallbackName = "Unset";
+  HAL_InitializeSPI(port, &status);
+  EXPECT_STREQ("Initialized", gTestSpiCallbackName.c_str());
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/handles/HandleTests.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/handles/HandleTests.cpp
new file mode 100644
index 0000000..76d4ca1
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/handles/HandleTests.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2018 FIRST. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "HAL/handles/IndexedClassedHandleResource.h"
+#include "gtest/gtest.h"
+
+#define HAL_TestHandle HAL_Handle
+
+namespace {
+class MyTestClass {};
+}  // namespace
+
+namespace hal {
+TEST(HandleTests, ClassedHandleTest) {
+  hal::IndexedClassedHandleResource<HAL_TestHandle, MyTestClass, 8,
+                                    HAL_HandleEnum::Vendor>
+      testClass;
+  int32_t status = 0;
+  testClass.Allocate(0, std::make_unique<MyTestClass>(), &status);
+  EXPECT_EQ(0, status);
+}
+
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/hal/src/test/native/cpp/main.cpp b/third_party/allwpilib_2018/hal/src/test/native/cpp/main.cpp
new file mode 100644
index 0000000..a875f04
--- /dev/null
+++ b/third_party/allwpilib_2018/hal/src/test/native/cpp/main.cpp
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/HAL.h"
+#include "gtest/gtest.h"
+
+int main(int argc, char** argv) {
+  HAL_Initialize(500, 0);
+  ::testing::InitGoogleTest(&argc, argv);
+  int ret = RUN_ALL_TESTS();
+  return ret;
+}
diff --git a/third_party/allwpilib_2018/myRobot/build.gradle b/third_party/allwpilib_2018/myRobot/build.gradle
new file mode 100644
index 0000000..e631111
--- /dev/null
+++ b/third_party/allwpilib_2018/myRobot/build.gradle
@@ -0,0 +1,101 @@
+import org.gradle.language.base.internal.ProjectLayout
+
+repositories {
+    mavenCentral()
+}
+
+apply plugin: 'cpp'
+apply plugin: 'java'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+
+apply from: '../config.gradle'
+
+dependencies {
+    compile project(':wpilibj')
+    compile 'edu.wpi.first.wpiutil:wpiutil-java:+'
+    compile 'edu.wpi.first.ntcore:ntcore-java:+'
+}
+
+model {
+    dependencyConfigs {
+        wpiutil(DependencyConfig) {
+            groupId = 'edu.wpi.first.wpiutil'
+            artifactId = 'wpiutil-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '+'
+            sharedConfigs = [ FRCUserProgram: [] ]
+        }
+        ntcore(DependencyConfig) {
+            groupId = 'edu.wpi.first.ntcore'
+            artifactId = 'ntcore-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '+'
+            sharedConfigs = [ FRCUserProgram: [] ]
+        }
+        cscore(DependencyConfig) {
+            groupId = 'edu.wpi.first.cscore'
+            artifactId = 'cscore-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '+'
+            sharedConfigs = [ FRCUserProgram: [] ]
+        }
+        opencv(DependencyConfig) {
+            groupId = 'org.opencv'
+            artifactId = 'opencv-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '3.2.0'
+            sharedConfigs = [ FRCUserProgram: [] ]
+        }
+    }
+    components {
+        FRCUserProgram(NativeExecutableSpec) {
+            sources {
+                cpp {
+                    source {
+                        srcDirs = ['src/main/native/cpp']
+                    }
+                    exportedHeaders {
+                        srcDirs = ['src/main/native/headers']
+                    }
+                }
+            }
+            binaries.all { binary->
+                project(':ni-libraries').addNiLibrariesToLinker(binary)
+                project(':hal').addHalToLinker(binary)
+                project(':wpilibc').addWpilibCCompilerArguments(binary)
+                project(':wpilibc').addWpilibCToLinker(binary)
+            }
+        }
+    }
+    tasks {
+        runCpp(Exec) {
+            def found = false
+            $.components.each {
+                if (it in NativeExecutableSpec && it.name == 'FRCUserProgram') {
+                    it.binaries.each {
+                        if (!found) {
+                            def arch = it.targetPlatform.architecture.name
+                            if (arch == 'x86-64' || arch == 'x86') {
+                                dependsOn it.tasks.install
+                                commandLine it.tasks.install.runScript
+                                found = true
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        installAthena(Task) {
+            $.binaries.each {
+                if (it in NativeExecutableBinarySpec && it.targetPlatform.architecture.name == 'athena') {
+                    dependsOn it.tasks.install
+                }
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/myRobot/src/main/native/cpp/MyRobot.cpp b/third_party/allwpilib_2018/myRobot/src/main/native/cpp/MyRobot.cpp
new file mode 100644
index 0000000..00d9b43
--- /dev/null
+++ b/third_party/allwpilib_2018/myRobot/src/main/native/cpp/MyRobot.cpp
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "IterativeRobot.h"
+
+class MyRobot : public frc::IterativeRobot {
+  /**
+   * This function is run when the robot is first started up and should be
+   * used for any initialization code.
+   */
+  void RobotInit() override {}
+
+  /**
+   * This function is run once each time the robot enters autonomous mode
+   */
+  void AutonomousInit() override {}
+
+  /**
+   * This function is called periodically during autonomous
+   */
+  void AutonomousPeriodic() override {}
+
+  /**
+   * This function is called once each time the robot enters tele-operated mode
+   */
+  void TeleopInit() override {}
+
+  /**
+   * This function is called periodically during operator control
+   */
+  void TeleopPeriodic() override {}
+
+  /**
+   * This function is called periodically during test mode
+   */
+  void TestPeriodic() override {}
+
+  /**
+   * This function is called periodically during all modes
+   */
+  void RobotPeriodic() override {}
+};
+
+START_ROBOT_CLASS(MyRobot)
diff --git a/third_party/allwpilib_2018/ni-libraries/FileLocations.txt b/third_party/allwpilib_2018/ni-libraries/FileLocations.txt
new file mode 100644
index 0000000..0d49ec8
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/FileLocations.txt
@@ -0,0 +1,10 @@
+libFRC_NetworkCommunication.so - \usr\local\frc\lib
+libi2c.so - \usr\local\frc\lib
+libNiFpga.so - \usr\local\natinst\lib
+libNiFpgaLv.so - \usr\local\natinst\lib
+libniriodevenum.so - \usr\local\natinst\lib
+libniriosession.so - \usr\local\natinst\lib
+libNiRioSrv.so - \usr\local\natinst\lib
+libRoboRIO_FRC_ChipObject.so - \usr\local\frc\lib
+libspi.so - \usr\local\frc\lib
+libvisa.so - \usr\local\vxipnp\linux\lib\
diff --git a/third_party/allwpilib_2018/ni-libraries/build.gradle b/third_party/allwpilib_2018/ni-libraries/build.gradle
new file mode 100644
index 0000000..533154c
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/build.gradle
@@ -0,0 +1,106 @@
+import edu.wpi.first.nativeutils.*

+import org.gradle.internal.os.OperatingSystem

+import org.apache.tools.ant.filters.*;

+

+public class NiDependencySet implements NativeDependencySet {

+    private Project m_project

+

+    public NiDependencySet(Project project) {

+        m_project = project

+    }

+

+    public FileCollection getIncludeRoots() {

+        return m_project.files("${m_project.projectDir}/include")

+    }

+

+    private FileCollection getFiles() {

+      def f = m_project.fileTree("${m_project.projectDir}/lib").filter { it.isFile() }

+      return f

+    }

+

+    public FileCollection getLinkFiles() {

+        return getFiles()

+    }

+

+    public FileCollection getRuntimeFiles() {

+        return m_project.files()

+    }

+}

+

+ext.addNiLibrariesToLinker = { binary->

+    if (binary.targetPlatform.architecture.name == 'athena') {

+        binary.lib(new NiDependencySet(project))

+    }

+}

+

+def outputsFolder = file("$project.buildDir/outputs")

+

+task libZip(type: Zip) {

+    destinationDir = outputsFolder

+    baseName = 'nilibraries-classifier'

+    classifier = "linuxathena"

+

+    from('lib') {

+        into '/linux/athena/shared/'

+    }

+}

+

+task headersZip(type: Zip) {

+    destinationDir = outputsFolder

+    baseName = 'nilibraries-classifier'

+    classifier = "headers"

+

+    from('include') {

+        into '/'

+    }

+}

+

+task build() {}

+

+build.dependsOn headersZip

+build.dependsOn libZip

+

+apply from: 'publish.gradle'

+

+task patchNiLibraries() {

+    doLast {

+        // Patch ChipObject headers to be self contained

+        FileTree chipTree = fileTree(dir: "$rootDir/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace")

+        chipTree.each {File file ->

+            String contents = file.getText('UTF-8')

+            contents = contents.replaceAll('#include \"tSystemInterface.h\"', '#include \"../tSystem.h\"\n#include \"../tSystemInterface.h\"')

+            file.write(contents, 'UTF-8')

+        }

+

+        // Patch NetComm headers to work on Windows

+        FileTree netTree = fileTree(dir: "$rootDir/ni-libraries/include/FRC_NetworkCommunication")

+        netTree.each {File file ->

+            String contents = file.getText('UTF-8')

+            contents = contents.replaceAll('#ifdef WIN32', '#ifdef _WIN32')

+            contents = contents.replaceAll('# include <vxWorks_compat.h>', '#include <windows.h>')

+            contents = contents.replaceAll('#include <vxWorks_compat.h>', '#include <windows.h>')

+            file.write(contents, 'UTF-8')

+        }

+

+        FileTree allTree = fileTree(dir: "$rootDir/ni-libraries/include/")

+        allTree.each {File file ->

+            String contents = file.getText('UTF-8')

+            contents = contents.replaceAll('\r\n', '\n')

+            file.write(contents, 'UTF-8')

+        }

+

+        // Move UsageReporting header to the HAL, because it is necessary for our

+        // UsageReporting in WPILibC.

+

+        copy {

+            from("$rootDir/ni-libraries/include/FRC_NetworkCommunication") {

+                include 'UsageReporting.h'

+            }

+            into "$rootDir/hal/src/main/native/include/HAL"

+        }

+

+        delete {

+            delete "$rootDir/ni-libraries/include/FRC_NetworkCommunication/UsageReporting.h"

+        }

+    }

+}

diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h
new file mode 100644
index 0000000..0726f92
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/RoboRIO_FRC_ChipObject_Aliases.h
@@ -0,0 +1,9 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __RoboRIO_FRC_ChipObject_Aliases_h__
+#define __RoboRIO_FRC_ChipObject_Aliases_h__
+
+#define nRoboRIO_FPGANamespace nFRC_2018_18_0_8
+
+#endif // __RoboRIO_FRC_ChipObject_Aliases_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/fpgainterfacecapi/NiFpga.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/fpgainterfacecapi/NiFpga.h
new file mode 100644
index 0000000..1ecbc5d
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/fpgainterfacecapi/NiFpga.h
@@ -0,0 +1,2807 @@
+/*
+ * FPGA Interface C API 17.0 header file.
+ *
+ * Copyright (c) 2017,
+ * National Instruments Corporation.
+ * All rights reserved.
+ */
+
+#ifndef __NiFpga_h__
+#define __NiFpga_h__
+
+/*
+ * Determine platform details.
+ */
+#if defined(_M_IX86) \
+ || defined(_M_X64) \
+ || defined(_M_AMD64) \
+ || defined(i386) \
+ || defined(__i386) \
+ || defined(__i386__) \
+ || defined(__i486__) \
+ || defined(__i586__) \
+ || defined(__i686__) \
+ || defined(__amd64__) \
+ || defined(__amd64) \
+ || defined(__x86_64__) \
+ || defined(__x86_64) \
+ || defined(__IA32__) \
+ || defined(_X86_) \
+ || defined(__THW_INTEL__) \
+ || defined(__I86__) \
+ || defined(__INTEL__) \
+ || defined(__X86__) \
+ || defined(__386__) \
+ || defined(__I86__) \
+ || defined(M_I386) \
+ || defined(M_I86) \
+ || defined(_M_I386) \
+ || defined(_M_I86)
+   #if defined(_WIN32) \
+    || defined(_WIN64) \
+    || defined(__WIN32__) \
+    || defined(__TOS_WIN__) \
+    || defined(__WINDOWS__) \
+    || defined(_WINDOWS) \
+    || defined(__WINDOWS_386__) \
+    || defined(__CYGWIN__)
+      /* Either Windows or Phar Lap ETS. */
+      #define NiFpga_Windows 1
+   #elif defined(__linux__) \
+      || defined(__linux) \
+      || defined(linux) \
+      || defined(__gnu_linux__)
+      #define NiFpga_Linux 1
+   #elif defined(__APPLE__) && defined(__MACH__)
+      #define NiFpga_MacOsX 1
+   #else
+      #error Unsupported OS.
+   #endif
+#elif defined(__powerpc) \
+   || defined(__powerpc__) \
+   || defined(__POWERPC__) \
+   || defined(__ppc__) \
+   || defined(__PPC) \
+   || defined(_M_PPC) \
+   || defined(_ARCH_PPC) \
+   || defined(__PPC__) \
+   || defined(__ppc)
+   #if defined(__vxworks)
+      #define NiFpga_VxWorks 1
+   #else
+      #error Unsupported OS.
+   #endif
+#elif defined(__arm__) \
+   || defined(__thumb__) \
+   || defined(__TARGET_ARCH_ARM) \
+   || defined(__TARGET_ARCH_THUMB) \
+   || defined(_ARM) \
+   || defined(_M_ARM) \
+   || defined(_M_ARMT)
+#if defined(__linux__) \
+ || defined(__linux) \
+ || defined(linux) \
+ || defined(__gnu_linux__)
+   #define NiFpga_Linux 1
+#else
+      #error Unsupported OS.
+   #endif
+#else
+   #error Unsupported architecture.
+#endif
+
+/*
+ * Determine compiler.
+ */
+#if defined(_MSC_VER)
+   #define NiFpga_Msvc 1
+#elif defined(__GNUC__)
+   #define NiFpga_Gcc 1
+#elif defined(_CVI_) && !defined(_TPC_)
+   #define NiFpga_Cvi 1
+   /* Enables CVI Library Protection Errors. */
+   #pragma EnableLibraryRuntimeChecking
+#else
+   /* Unknown compiler. */
+#endif
+
+/*
+ * Determine compliance with different C/C++ language standards.
+ */
+#if defined(__cplusplus)
+   #define NiFpga_Cpp 1
+   #if __cplusplus >= 199707L
+      #define NiFpga_Cpp98 1
+      #if __cplusplus >= 201103L
+         #define NiFpga_Cpp11 1
+      #endif
+   #endif
+#endif
+#if defined(__STDC__)
+   #define NiFpga_C89 1
+   #if defined(__STDC_VERSION__)
+      #define NiFpga_C90 1
+      #if __STDC_VERSION__ >= 199409L
+         #define NiFpga_C94 1
+         #if __STDC_VERSION__ >= 199901L
+            #define NiFpga_C99 1
+            #if __STDC_VERSION__ >= 201112L
+               #define NiFpga_C11 1
+            #endif
+         #endif
+      #endif
+   #endif
+#endif
+
+/*
+ * Determine ability to inline functions.
+ */
+#if NiFpga_Cpp || NiFpga_C99
+   /* The inline keyword exists in C++ and C99. */
+   #define NiFpga_Inline inline
+#elif NiFpga_Msvc
+   /* Visual C++ (at least since 6.0) also supports an alternate keyword. */
+   #define NiFpga_Inline __inline
+#elif NiFpga_Gcc
+   /* GCC (at least since 2.95.2) also supports an alternate keyword. */
+   #define NiFpga_Inline __inline__
+#elif !defined(NiFpga_Inline)
+   /*
+    * Disable inlining if inline support is unknown. To manually enable
+    * inlining, #define the following macro before #including NiFpga.h:
+    *
+    *    #define NiFpga_Inline inline
+    */
+   #define NiFpga_Inline
+#endif
+
+/*
+ * Define exact-width integer types, if they have not already been defined.
+ */
+#if NiFpga_ExactWidthIntegerTypesDefined \
+ || defined(_STDINT) \
+ || defined(_STDINT_H) \
+ || defined(_STDINT_H_) \
+ || defined(_INTTYPES_H) \
+ || defined(_INTTYPES_H_) \
+ || defined(_SYS_STDINT_H) \
+ || defined(_SYS_STDINT_H_) \
+ || defined(_SYS_INTTYPES_H) \
+ || defined(_SYS_INTTYPES_H_) \
+ || defined(_STDINT_H_INCLUDED) \
+ || defined(_MSC_STDINT_H_) \
+ || defined(_PSTDINT_H_INCLUDED)
+   /* Assume that exact-width integer types have already been defined. */
+#elif NiFpga_VxWorks
+   /* VxWorks (at least 6.3 and earlier) did not have stdint.h. */
+   #include <types/vxTypes.h>
+#elif NiFpga_C99 \
+   || NiFpga_Gcc /* GCC (at least since 3.0) has a stdint.h. */ \
+   || defined(HAVE_STDINT_H)
+   /* Assume that stdint.h can be included. */
+   #include <stdint.h>
+#elif NiFpga_Msvc \
+   || NiFpga_Cvi
+   /* Manually define exact-width integer types. */
+   typedef   signed    char  int8_t;
+   typedef unsigned    char uint8_t;
+   typedef            short  int16_t;
+   typedef unsigned   short uint16_t;
+   typedef              int  int32_t;
+   typedef unsigned     int uint32_t;
+   typedef          __int64  int64_t;
+   typedef unsigned __int64 uint64_t;
+#else
+   /*
+    * Exact-width integer types must be defined by the user, and the following
+    * macro must be #defined, before #including NiFpga.h:
+    *
+    *    #define NiFpga_ExactWidthIntegerTypesDefined 1
+    */
+   #error Exact-width integer types must be defined by the user. See comment.
+#endif
+
+/* Included for definition of size_t. */
+#include <stddef.h>
+
+#if NiFpga_Cpp
+extern "C"
+{
+#endif
+
+/**
+ * A boolean value; either NiFpga_False or NiFpga_True.
+ */
+typedef uint8_t NiFpga_Bool;
+
+/**
+ * Represents a false condition.
+ */
+static const NiFpga_Bool NiFpga_False = 0;
+
+/**
+ * Represents a true condition.
+ */
+static const NiFpga_Bool NiFpga_True = 1;
+
+/**
+ * Represents the resulting status of a function call through its return value.
+ * 0 is success, negative values are errors, and positive values are warnings.
+ */
+typedef int32_t NiFpga_Status;
+
+/**
+ * No errors or warnings.
+ */
+static const NiFpga_Status NiFpga_Status_Success = 0;
+
+/**
+ * The timeout expired before the FIFO operation could complete.
+ */
+static const NiFpga_Status NiFpga_Status_FifoTimeout = -50400;
+
+/**
+ * No transfer is in progress because the transfer was aborted by the client.
+ * The operation could not be completed as specified.
+ */
+static const NiFpga_Status NiFpga_Status_TransferAborted = -50405;
+
+/**
+ * A memory allocation failed. Try again after rebooting.
+ */
+static const NiFpga_Status NiFpga_Status_MemoryFull = -52000;
+
+/**
+ * An unexpected software error occurred.
+ */
+static const NiFpga_Status NiFpga_Status_SoftwareFault = -52003;
+
+/**
+ * A parameter to a function was not valid. This could be a NULL pointer, a bad
+ * value, etc.
+ */
+static const NiFpga_Status NiFpga_Status_InvalidParameter = -52005;
+
+/**
+ * A required resource was not found. The NiFpga.* library, the RIO resource, or
+ * some other resource may be missing.
+ */
+static const NiFpga_Status NiFpga_Status_ResourceNotFound = -52006;
+
+/**
+ * A required resource was not properly initialized. This could occur if
+ * NiFpga_Initialize was not called or a required NiFpga_IrqContext was not
+ * reserved.
+ */
+static const NiFpga_Status NiFpga_Status_ResourceNotInitialized = -52010;
+
+/**
+ * The FPGA is already running.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaAlreadyRunning = -61003;
+
+/**
+ * An error occurred downloading the VI to the FPGA device. Verify that
+ * the target is connected and powered and that the resource of the target
+ * is properly configured.
+ */
+static const NiFpga_Status NiFpga_Status_DownloadError = -61018;
+
+/**
+ * The bitfile was not compiled for the specified resource's device type.
+ */
+static const NiFpga_Status NiFpga_Status_DeviceTypeMismatch = -61024;
+
+/**
+ * An error was detected in the communication between the host computer and the
+ * FPGA target.
+ */
+static const NiFpga_Status NiFpga_Status_CommunicationTimeout = -61046;
+
+/**
+ * The timeout expired before any of the IRQs were asserted.
+ */
+static const NiFpga_Status NiFpga_Status_IrqTimeout = -61060;
+
+/**
+ * The specified bitfile is invalid or corrupt.
+ */
+static const NiFpga_Status NiFpga_Status_CorruptBitfile = -61070;
+
+/**
+ * The requested FIFO depth is invalid. It is either 0 or an amount not
+ * supported by the hardware.
+ */
+static const NiFpga_Status NiFpga_Status_BadDepth = -61072;
+
+/**
+ * The number of FIFO elements is invalid. Either the number is greater than the
+ * depth of the host memory DMA FIFO, or more elements were requested for
+ * release than had been acquired.
+ */
+static const NiFpga_Status NiFpga_Status_BadReadWriteCount = -61073;
+
+/**
+ * A hardware clocking error occurred. A derived clock lost lock with its base
+ * clock during the execution of the LabVIEW FPGA VI. If any base clocks with
+ * derived clocks are referencing an external source, make sure that the
+ * external source is connected and within the supported frequency, jitter,
+ * accuracy, duty cycle, and voltage specifications. Also verify that the
+ * characteristics of the base clock match the configuration specified in the
+ * FPGA Base Clock Properties. If all base clocks with derived clocks are
+ * generated from free-running, on-board sources, please contact National
+ * Instruments technical support at ni.com/support.
+ */
+static const NiFpga_Status NiFpga_Status_ClockLostLock = -61083;
+
+/**
+ * The operation could not be performed because the FPGA is busy. Stop all
+ * activities on the FPGA before requesting this operation. If the target is in
+ * Scan Interface programming mode, put it in FPGA Interface programming mode.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusy = -61141;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * FPGA Interface C API mode. Stop all activities on the FPGA before requesting
+ * this operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterfaceCApi = -61200;
+
+/**
+ * The chassis is in Scan Interface programming mode. In order to run FPGA VIs,
+ * you must go to the chassis properties page, select FPGA programming mode, and
+ * deploy settings.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyScanInterface = -61201;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * FPGA Interface mode. Stop all activities on the FPGA before requesting this
+ * operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterface = -61202;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * Interactive mode. Stop all activities on the FPGA before requesting this
+ * operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyInteractive = -61203;
+
+/**
+ * The operation could not be performed because the FPGA is busy operating in
+ * Emulation mode. Stop all activities on the FPGA before requesting this
+ * operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyEmulation = -61204;
+
+/**
+ * LabVIEW FPGA does not support the Reset method for bitfiles that allow
+ * removal of implicit enable signals in single-cycle Timed Loops.
+ */
+static const NiFpga_Status NiFpga_Status_ResetCalledWithImplicitEnableRemoval = -61211;
+
+/**
+ * LabVIEW FPGA does not support the Abort method for bitfiles that allow
+ * removal of implicit enable signals in single-cycle Timed Loops.
+ */
+static const NiFpga_Status NiFpga_Status_AbortCalledWithImplicitEnableRemoval = -61212;
+
+/**
+ * LabVIEW FPGA does not support Close and Reset if Last Reference for bitfiles
+ * that allow removal of implicit enable signals in single-cycle Timed Loops.
+ * Pass the NiFpga_CloseAttribute_NoResetIfLastSession attribute to NiFpga_Close
+ * instead of 0.
+ */
+static const NiFpga_Status NiFpga_Status_CloseAndResetCalledWithImplicitEnableRemoval = -61213;
+
+/**
+ * For bitfiles that allow removal of implicit enable signals in single-cycle
+ * Timed Loops, LabVIEW FPGA does not support this method prior to running the
+ * bitfile.
+ */
+static const NiFpga_Status NiFpga_Status_ImplicitEnableRemovalButNotYetRun = -61214;
+
+/**
+ * Bitfiles that allow removal of implicit enable signals in single-cycle Timed
+ * Loops can run only once. Download the bitfile again before re-running the VI.
+ */
+static const NiFpga_Status NiFpga_Status_RunAfterStoppedCalledWithImplicitEnableRemoval = -61215;
+
+/**
+ * A gated clock has violated the handshaking protocol. If you are using
+ * external gated clocks, ensure that they follow the required clock gating
+ * protocol. If you are generating your clocks internally, please contact
+ * National Instruments Technical Support.
+ */
+static const NiFpga_Status NiFpga_Status_GatedClockHandshakingViolation = -61216;
+
+/**
+ * The number of elements requested must be less than or equal to the number of
+ * unacquired elements left in the host memory DMA FIFO. There are currently
+ * fewer unacquired elements left in the FIFO than are being requested. Release
+ * some acquired elements before acquiring more elements.
+ */
+static const NiFpga_Status NiFpga_Status_ElementsNotPermissibleToBeAcquired = -61219;
+
+/**
+ * The operation could not be performed because the FPGA is in configuration or
+ * discovery mode. Wait for configuration or discovery to complete and retry
+ * your operation.
+ */
+static const NiFpga_Status NiFpga_Status_FpgaBusyConfiguration = -61252;
+
+/**
+ * LabVIEW FPGA does not support Close and Reset if Last Reference for bitfiles
+ * that do not support Reset. Pass the
+ * NiFpga_CloseAttribute_NoResetIfLastSession attribute to NiFpga_Close instead
+ * of 0.
+ */
+static const NiFpga_Status NiFpga_Status_CloseAndResetCalledWithResetNotSupported = -61253;
+
+/**
+ * An unexpected internal error occurred.
+ */
+static const NiFpga_Status NiFpga_Status_InternalError = -61499;
+
+/**
+ * The NI-RIO driver was unable to allocate memory for a FIFO. This can happen
+ * when the combined depth of all DMA FIFOs exceeds the maximum depth for the
+ * controller, or when the controller runs out of system memory. You may be able
+ * to reconfigure the controller with a greater maximum FIFO depth. For more
+ * information, refer to the NI KnowledgeBase article 65OF2ERQ.
+ */
+static const NiFpga_Status NiFpga_Status_TotalDmaFifoDepthExceeded = -63003;
+
+/**
+ * Access to the remote system was denied. Use MAX to check the Remote Device
+ * Access settings under Software>>NI-RIO>>NI-RIO Settings on the remote system.
+ */
+static const NiFpga_Status NiFpga_Status_AccessDenied = -63033;
+
+/**
+ * The NI-RIO software on the host is not compatible with the software on the
+ * target. Upgrade the NI-RIO software on the host in order to connect to this
+ * target.
+ */
+static const NiFpga_Status NiFpga_Status_HostVersionMismatch = -63038;
+
+/**
+ * A connection could not be established to the specified remote device. Ensure
+ * that the device is on and accessible over the network, that NI-RIO software
+ * is installed, and that the RIO server is running and properly configured.
+ */
+static const NiFpga_Status NiFpga_Status_RpcConnectionError = -63040;
+
+/**
+ * The RPC session is invalid. The target may have reset or been rebooted. Check
+ * the network connection and retry the operation.
+ */
+static const NiFpga_Status NiFpga_Status_RpcSessionError = -63043;
+
+/**
+ * The operation could not complete because another session is accessing the
+ * FIFO. Close the other session and retry.
+ */
+static const NiFpga_Status NiFpga_Status_FifoReserved = -63082;
+
+/**
+ * A Configure FIFO, Stop FIFO, Read FIFO, or Write FIFO function was called
+ * while the host had acquired elements of the FIFO. Release all acquired
+ * elements before configuring, stopping, reading, or writing.
+ */
+static const NiFpga_Status NiFpga_Status_FifoElementsCurrentlyAcquired = -63083;
+
+/**
+ * A function was called using a misaligned address. The address must be a
+ * multiple of the size of the datatype.
+ */
+static const NiFpga_Status NiFpga_Status_MisalignedAccess = -63084;
+
+/**
+ * The FPGA Read/Write Control Function is accessing a control or indicator
+ * with data that exceeds the maximum size supported on the current target.
+ * Refer to the hardware documentation for the limitations on data types for
+ * this target.
+ */
+static const NiFpga_Status NiFpga_Status_ControlOrIndicatorTooLarge = -63085;
+
+/**
+ * A valid .lvbitx bitfile is required. If you are using a valid .lvbitx
+ * bitfile, the bitfile may not be compatible with the software you are using.
+ * Determine which version of LabVIEW was used to make the bitfile, update your
+ * software to that version or later, and try again.
+ */
+static const NiFpga_Status NiFpga_Status_BitfileReadError = -63101;
+
+/**
+ * The specified signature does not match the signature of the bitfile. If the
+ * bitfile has been recompiled, regenerate the C API and rebuild the
+ * application.
+ */
+static const NiFpga_Status NiFpga_Status_SignatureMismatch = -63106;
+
+/**
+ * The bitfile you are trying to use is incompatible with the version
+ * of NI-RIO installed on the target and/or host. Update the version
+ * of NI-RIO on the target and/or host to the same version (or later)
+ * used to compile the bitfile. Alternatively, recompile the bitfile
+ * with the same version of NI-RIO that is currently installed on the
+ * target and/or host.
+ */
+static const NiFpga_Status NiFpga_Status_IncompatibleBitfile = -63107;
+
+/**
+ * A hardware failure has occurred. The operation could not be completed as
+ * specified.
+ */
+static const NiFpga_Status NiFpga_Status_HardwareFault = -63150;
+
+/**
+ * Either the supplied resource name is invalid as a RIO resource name, or the
+ * device was not found. Use MAX to find the proper resource name for the
+ * intended device.
+ */
+static const NiFpga_Status NiFpga_Status_InvalidResourceName = -63192;
+
+/**
+ * The requested feature is not supported.
+ */
+static const NiFpga_Status NiFpga_Status_FeatureNotSupported = -63193;
+
+/**
+ * The NI-RIO software on the target system is not compatible with this
+ * software. Upgrade the NI-RIO software on the target system.
+ */
+static const NiFpga_Status NiFpga_Status_VersionMismatch = -63194;
+
+/**
+ * The session is invalid or has been closed.
+ */
+static const NiFpga_Status NiFpga_Status_InvalidSession = -63195;
+
+/**
+ * The maximum number of open FPGA sessions has been reached. Close some open
+ * sessions.
+ */
+static const NiFpga_Status NiFpga_Status_OutOfHandles = -63198;
+
+/**
+ * Tests whether a status is an error.
+ *
+ * @param status status to check for an error
+ * @return whether the status was an error
+ */
+static NiFpga_Inline NiFpga_Bool NiFpga_IsError(const NiFpga_Status status)
+{
+   return status < NiFpga_Status_Success ? NiFpga_True : NiFpga_False;
+}
+
+/**
+ * Tests whether a status is not an error. Success and warnings are not errors.
+ *
+ * @param status status to check for an error
+ * @return whether the status was a success or warning
+ */
+static NiFpga_Inline NiFpga_Bool NiFpga_IsNotError(const NiFpga_Status status)
+{
+   return status >= NiFpga_Status_Success ? NiFpga_True : NiFpga_False;
+}
+
+/**
+ * Conditionally sets the status to a new value. The previous status is
+ * preserved unless the new status is more of an error, which means that
+ * warnings and errors overwrite successes, and errors overwrite warnings. New
+ * errors do not overwrite older errors, and new warnings do not overwrite
+ * older warnings.
+ *
+ * @param status status to conditionally set
+ * @param newStatus new status value that may be set
+ * @return the resulting status
+ */
+static NiFpga_Inline NiFpga_Status NiFpga_MergeStatus(
+                                               NiFpga_Status* const status,
+                                               const NiFpga_Status  newStatus)
+{
+   if (!status)
+      return NiFpga_Status_InvalidParameter;
+   if (NiFpga_IsNotError(*status)
+   &&  (*status == NiFpga_Status_Success || NiFpga_IsError(newStatus)))
+      *status = newStatus;
+   return *status;
+}
+
+/**
+ * This macro evaluates the expression only if the status is not an error. The
+ * expression must evaluate to an NiFpga_Status, such as a call to any NiFpga_*
+ * function, because the status will be set to the returned status if the
+ * expression is evaluated.
+ *
+ * You can use this macro to mimic status chaining in LabVIEW, where the status
+ * does not have to be explicitly checked after each call. Such code may look
+ * like the following example.
+ *
+ *    NiFpga_Status status = NiFpga_Status_Success;
+ *    NiFpga_IfIsNotError(status, NiFpga_WriteU32(...));
+ *    NiFpga_IfIsNotError(status, NiFpga_WriteU32(...));
+ *    NiFpga_IfIsNotError(status, NiFpga_WriteU32(...));
+ *
+ * @param status status to check for an error
+ * @param expression expression to call if the incoming status is not an error
+ */
+#define NiFpga_IfIsNotError(status, expression) \
+   if (NiFpga_IsNotError(status)) \
+      NiFpga_MergeStatus(&status, (expression)); \
+
+/**
+ * You must call this function before all other function calls. This function
+ * loads the NiFpga library so that all the other functions will work. If this
+ * function succeeds, you must call NiFpga_Finalize after all other function
+ * calls.
+ *
+ * @warning This function is not thread safe.
+ *
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Initialize(void);
+
+/**
+ * You must call this function after all other function calls if
+ * NiFpga_Initialize succeeds. This function unloads the NiFpga library.
+ *
+ * @warning This function is not thread safe.
+ *
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Finalize(void);
+
+/**
+ * A handle to an FPGA session.
+ */
+typedef uint32_t NiFpga_Session;
+
+/**
+ * Attributes that NiFpga_Open accepts.
+ */
+typedef enum
+{
+   NiFpga_OpenAttribute_NoRun = 1
+} NiFpga_OpenAttribute;
+
+/**
+ * Opens a session to the FPGA. This call ensures that the contents of the
+ * bitfile are programmed to the FPGA. The FPGA runs unless the
+ * NiFpga_OpenAttribute_NoRun attribute is used.
+ *
+ * Because different operating systems have different default current working
+ * directories for applications, you must pass an absolute path for the bitfile
+ * parameter. If you pass only the filename instead of an absolute path, the
+ * operating system may not be able to locate the bitfile. For example, the
+ * default current working directories are C:\ni-rt\system\ for Phar Lap ETS and
+ * /c/ for VxWorks. Because the generated *_Bitfile constant is a #define to a
+ * string literal, you can use C/C++ string-literal concatenation to form an
+ * absolute path. For example, if the bitfile is in the root directory of a
+ * Phar Lap ETS system, pass the following for the bitfile parameter.
+ *
+ *    "C:\\" NiFpga_MyApplication_Bitfile
+ *
+ * @param bitfile path to the bitfile
+ * @param signature signature of the bitfile
+ * @param resource RIO resource string to open ("RIO0" or "rio://mysystem/RIO")
+ * @param attribute bitwise OR of any NiFpga_OpenAttributes, or 0
+ * @param session outputs the session handle, which must be closed when no
+ *                longer needed
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Open(const char*     bitfile,
+                          const char*     signature,
+                          const char*     resource,
+                          uint32_t        attribute,
+                          NiFpga_Session* session);
+
+/**
+ * Attributes that NiFpga_Close accepts.
+ */
+typedef enum
+{
+   NiFpga_CloseAttribute_NoResetIfLastSession = 1
+} NiFpga_CloseAttribute;
+
+/**
+ * Closes the session to the FPGA. The FPGA resets unless either another session
+ * is still open or you use the NiFpga_CloseAttribute_NoResetIfLastSession
+ * attribute.
+ *
+ * @param session handle to a currently open session
+ * @param attribute bitwise OR of any NiFpga_CloseAttributes, or 0
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Close(NiFpga_Session session,
+                           uint32_t       attribute);
+
+/**
+ * Attributes that NiFpga_Run accepts.
+ */
+typedef enum
+{
+   NiFpga_RunAttribute_WaitUntilDone = 1
+} NiFpga_RunAttribute;
+
+/**
+ * Runs the FPGA VI on the target. If you use NiFpga_RunAttribute_WaitUntilDone,
+ * NiFpga_Run blocks the thread until the FPGA finishes running.
+ *
+ * @param session handle to a currently open session
+ * @param attribute bitwise OR of any NiFpga_RunAttributes, or 0
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Run(NiFpga_Session session,
+                         uint32_t       attribute);
+
+/**
+ * Aborts the FPGA VI.
+ *
+ * @param session handle to a currently open session
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Abort(NiFpga_Session session);
+
+/**
+ * Resets the FPGA VI.
+ *
+ * @param session handle to a currently open session
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Reset(NiFpga_Session session);
+
+/**
+ * Re-downloads the FPGA bitstream to the target.
+ *
+ * @param session handle to a currently open session
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_Download(NiFpga_Session session);
+
+/**
+ * Reads a boolean value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadBool(NiFpga_Session session,
+                              uint32_t       indicator,
+                              NiFpga_Bool*   value);
+
+/**
+ * Reads a signed 8-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadI8(NiFpga_Session session,
+                            uint32_t       indicator,
+                            int8_t*        value);
+
+/**
+ * Reads an unsigned 8-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadU8(NiFpga_Session session,
+                            uint32_t       indicator,
+                            uint8_t*       value);
+
+/**
+ * Reads a signed 16-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadI16(NiFpga_Session session,
+                             uint32_t       indicator,
+                             int16_t*       value);
+
+/**
+ * Reads an unsigned 16-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadU16(NiFpga_Session session,
+                             uint32_t       indicator,
+                             uint16_t*      value);
+
+/**
+ * Reads a signed 32-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadI32(NiFpga_Session session,
+                             uint32_t       indicator,
+                             int32_t*       value);
+
+/**
+ * Reads an unsigned 32-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadU32(NiFpga_Session session,
+                             uint32_t       indicator,
+                             uint32_t*      value);
+
+/**
+ * Reads a signed 64-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadI64(NiFpga_Session session,
+                             uint32_t       indicator,
+                             int64_t*       value);
+
+/**
+ * Reads an unsigned 64-bit integer value from a given indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadU64(NiFpga_Session session,
+                             uint32_t       indicator,
+                             uint64_t*      value);
+
+/**
+ * Reads a single-precision floating-point value from a given indicator or
+ * control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadSgl(NiFpga_Session session,
+                             uint32_t       indicator,
+                             float*         value);
+
+/**
+ * Reads a double-precision floating-point value from a given indicator or
+ * control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param value outputs the value that was read
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadDbl(NiFpga_Session session,
+                             uint32_t       indicator,
+                             double*        value);
+
+/**
+ * Writes a boolean value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteBool(NiFpga_Session session,
+                               uint32_t       control,
+                               NiFpga_Bool    value);
+
+/**
+ * Writes a signed 8-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteI8(NiFpga_Session session,
+                             uint32_t       control,
+                             int8_t         value);
+
+/**
+ * Writes an unsigned 8-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteU8(NiFpga_Session session,
+                             uint32_t       control,
+                             uint8_t        value);
+
+/**
+ * Writes a signed 16-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteI16(NiFpga_Session session,
+                              uint32_t       control,
+                              int16_t        value);
+
+/**
+ * Writes an unsigned 16-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteU16(NiFpga_Session session,
+                              uint32_t       control,
+                              uint16_t       value);
+
+/**
+ * Writes a signed 32-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteI32(NiFpga_Session session,
+                              uint32_t       control,
+                              int32_t        value);
+
+/**
+ * Writes an unsigned 32-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteU32(NiFpga_Session session,
+                              uint32_t       control,
+                              uint32_t       value);
+
+/**
+ * Writes a signed 64-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteI64(NiFpga_Session session,
+                              uint32_t       control,
+                              int64_t        value);
+
+/**
+ * Writes an unsigned 64-bit integer value to a given control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteU64(NiFpga_Session session,
+                              uint32_t       control,
+                              uint64_t       value);
+
+/**
+ * Writes a single-precision floating-point value to a given control or
+ * indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteSgl(NiFpga_Session session,
+                              uint32_t       control,
+                              float          value);
+
+/**
+ * Writes a double-precision floating-point value to a given control or
+ * indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param value value to write
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteDbl(NiFpga_Session session,
+                              uint32_t       control,
+                              double         value);
+
+/**
+ * Reads an entire array of boolean values from a given array indicator or
+ * control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayBool(NiFpga_Session session,
+                                   uint32_t       indicator,
+                                   NiFpga_Bool*   array,
+                                   size_t         size);
+
+/**
+ * Reads an entire array of signed 8-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayI8(NiFpga_Session session,
+                                 uint32_t       indicator,
+                                 int8_t*        array,
+                                 size_t         size);
+
+/**
+ * Reads an entire array of unsigned 8-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayU8(NiFpga_Session session,
+                                 uint32_t       indicator,
+                                 uint8_t*       array,
+                                 size_t         size);
+
+/**
+ * Reads an entire array of signed 16-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayI16(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  int16_t*       array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of unsigned 16-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayU16(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  uint16_t*      array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of signed 32-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayI32(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  int32_t*       array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of unsigned 32-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayU32(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  uint32_t*      array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of signed 64-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayI64(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  int64_t*       array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of unsigned 64-bit integer values from a given array
+ * indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayU64(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  uint64_t*      array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of single-precision floating-point values from a
+ * given array indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArraySgl(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  float*         array,
+                                  size_t         size);
+
+/**
+ * Reads an entire array of double-precision floating-point values from a
+ * given array indicator or control.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          indicator or control.
+ *
+ * @param session handle to a currently open session
+ * @param indicator indicator or control from which to read
+ * @param array outputs the entire array that was read
+ * @param size exact number of elements in the indicator or control
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadArrayDbl(NiFpga_Session session,
+                                  uint32_t       indicator,
+                                  double*        array,
+                                  size_t         size);
+
+/**
+ * Writes an entire array of boolean values to a given array control or
+ * indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayBool(NiFpga_Session     session,
+                                    uint32_t           control,
+                                    const NiFpga_Bool* array,
+                                    size_t             size);
+
+/**
+ * Writes an entire array of signed 8-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayI8(NiFpga_Session session,
+                                  uint32_t       control,
+                                  const int8_t*  array,
+                                  size_t         size);
+
+/**
+ * Writes an entire array of unsigned 8-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayU8(NiFpga_Session session,
+                                  uint32_t       control,
+                                  const uint8_t* array,
+                                  size_t         size);
+
+/**
+ * Writes an entire array of signed 16-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayI16(NiFpga_Session session,
+                                   uint32_t       control,
+                                   const int16_t* array,
+                                   size_t         size);
+
+/**
+ * Writes an entire array of unsigned 16-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayU16(NiFpga_Session  session,
+                                   uint32_t        control,
+                                   const uint16_t* array,
+                                   size_t          size);
+
+/**
+ * Writes an entire array of signed 32-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayI32(NiFpga_Session session,
+                                   uint32_t       control,
+                                   const int32_t* array,
+                                   size_t         size);
+
+/**
+ * Writes an entire array of unsigned 32-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayU32(NiFpga_Session  session,
+                                   uint32_t        control,
+                                   const uint32_t* array,
+                                   size_t          size);
+
+/**
+ * Writes an entire array of signed 64-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayI64(NiFpga_Session session,
+                                   uint32_t       control,
+                                   const int64_t* array,
+                                   size_t         size);
+
+/**
+ * Writes an entire array of unsigned 64-bit integer values to a given array
+ * control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayU64(NiFpga_Session  session,
+                                   uint32_t        control,
+                                   const uint64_t* array,
+                                   size_t          size);
+
+/**
+ * Writes an entire array of single-precision floating-point values to a given
+ * array control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArraySgl(NiFpga_Session session,
+                                   uint32_t       control,
+                                   const float*   array,
+                                   size_t         size);
+
+/**
+ * Writes an entire array of double-precision floating-point values to a given
+ * array control or indicator.
+ *
+ * @warning The size passed must be the exact number of elements in the
+ *          control or indicator.
+ *
+ * @param session handle to a currently open session
+ * @param control control or indicator to which to write
+ * @param array entire array to write
+ * @param size exact number of elements in the control or indicator
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteArrayDbl(NiFpga_Session session,
+                                   uint32_t       control,
+                                   const double*  array,
+                                   size_t         size);
+
+/**
+ * Enumeration of all 32 possible IRQs. Multiple IRQs can be bitwise ORed
+ * together like this:
+ *
+ *    NiFpga_Irq_3 | NiFpga_Irq_23
+ */
+typedef enum
+{
+   NiFpga_Irq_0  = 1 << 0,
+   NiFpga_Irq_1  = 1 << 1,
+   NiFpga_Irq_2  = 1 << 2,
+   NiFpga_Irq_3  = 1 << 3,
+   NiFpga_Irq_4  = 1 << 4,
+   NiFpga_Irq_5  = 1 << 5,
+   NiFpga_Irq_6  = 1 << 6,
+   NiFpga_Irq_7  = 1 << 7,
+   NiFpga_Irq_8  = 1 << 8,
+   NiFpga_Irq_9  = 1 << 9,
+   NiFpga_Irq_10 = 1 << 10,
+   NiFpga_Irq_11 = 1 << 11,
+   NiFpga_Irq_12 = 1 << 12,
+   NiFpga_Irq_13 = 1 << 13,
+   NiFpga_Irq_14 = 1 << 14,
+   NiFpga_Irq_15 = 1 << 15,
+   NiFpga_Irq_16 = 1 << 16,
+   NiFpga_Irq_17 = 1 << 17,
+   NiFpga_Irq_18 = 1 << 18,
+   NiFpga_Irq_19 = 1 << 19,
+   NiFpga_Irq_20 = 1 << 20,
+   NiFpga_Irq_21 = 1 << 21,
+   NiFpga_Irq_22 = 1 << 22,
+   NiFpga_Irq_23 = 1 << 23,
+   NiFpga_Irq_24 = 1 << 24,
+   NiFpga_Irq_25 = 1 << 25,
+   NiFpga_Irq_26 = 1 << 26,
+   NiFpga_Irq_27 = 1 << 27,
+   NiFpga_Irq_28 = 1 << 28,
+   NiFpga_Irq_29 = 1 << 29,
+   NiFpga_Irq_30 = 1 << 30,
+   NiFpga_Irq_31 = 1U << 31
+} NiFpga_Irq;
+
+/**
+ * Represents an infinite timeout.
+ */
+static const uint32_t NiFpga_InfiniteTimeout = 0xFFFFFFFF;
+
+/**
+ * See NiFpga_ReserveIrqContext for more information.
+ */
+typedef void* NiFpga_IrqContext;
+
+/**
+ * IRQ contexts are single-threaded; only one thread can wait with a
+ * particular context at any given time. To minimize jitter when first
+ * waiting on IRQs, reserve as many contexts as the application
+ * requires.
+ *
+ * If a context is successfully reserved (the returned status is not an error),
+ * it must be unreserved later. Otherwise a memory leak will occur.
+ *
+ * @param session handle to a currently open session
+ * @param context outputs the IRQ context
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReserveIrqContext(NiFpga_Session     session,
+                                       NiFpga_IrqContext* context);
+
+/**
+ * Unreserves an IRQ context obtained from NiFpga_ReserveIrqContext.
+ *
+ * @param session handle to a currently open session
+ * @param context IRQ context to unreserve
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_UnreserveIrqContext(NiFpga_Session    session,
+                                         NiFpga_IrqContext context);
+
+/**
+ * This is a blocking function that stops the calling thread until the
+ * FPGA asserts any IRQ in the irqs parameter, or until the function
+ * call times out.  Before calling this function, use
+ * NiFpga_ReserveIrqContext to reserve an IRQ context. No other
+ * threads can use the same context when this function is called.
+ *
+ * You can use the irqsAsserted parameter to determine which IRQs were asserted
+ * for each function call.
+ *
+ * @param session handle to a currently open session
+ * @param context IRQ context with which to wait
+ * @param irqs bitwise OR of NiFpga_Irqs
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param irqsAsserted if non-NULL, outputs bitwise OR of IRQs that were
+ *                     asserted
+ * @param timedOut if non-NULL, outputs whether the timeout expired
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WaitOnIrqs(NiFpga_Session    session,
+                                NiFpga_IrqContext context,
+                                uint32_t          irqs,
+                                uint32_t          timeout,
+                                uint32_t*         irqsAsserted,
+                                NiFpga_Bool*      timedOut);
+
+/**
+ * Acknowledges an IRQ or set of IRQs.
+ *
+ * @param session handle to a currently open session
+ * @param irqs bitwise OR of NiFpga_Irqs
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcknowledgeIrqs(NiFpga_Session session,
+                                     uint32_t       irqs);
+
+/**
+ * Specifies the depth of the host memory part of the DMA FIFO. This method is
+ * optional. In order to see the actual depth configured, use
+ * NiFpga_ConfigureFifo2.
+ *
+ * @param session handle to a currently open session
+ * @param fifo FIFO to configure
+ * @param depth requested number of elements in the host memory part of the
+ *              DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ConfigureFifo(NiFpga_Session session,
+                                   uint32_t       fifo,
+                                   size_t         depth);
+
+/**
+ * Specifies the depth of the host memory part of the DMA FIFO. This method is
+ * optional.
+ *
+ * @param session handle to a currently open session
+ * @param fifo FIFO to configure
+ * @param requestedDepth requested number of elements in the host memory part
+ *                       of the DMA FIFO
+ * @param actualDepth if non-NULL, outputs the actual number of elements in the
+ *                    host memory part of the DMA FIFO, which may be more than
+ *                    the requested number
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ConfigureFifo2(NiFpga_Session session,
+                                    uint32_t       fifo,
+                                    size_t         requestedDepth,
+                                    size_t*        actualDepth);
+
+/**
+ * Starts a FIFO. This method is optional.
+ *
+ * @param session handle to a currently open session
+ * @param fifo FIFO to start
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_StartFifo(NiFpga_Session session,
+                               uint32_t       fifo);
+
+/**
+ * Stops a FIFO. This method is optional.
+ *
+ * @param session handle to a currently open session
+ * @param fifo FIFO to stop
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_StopFifo(NiFpga_Session session,
+                              uint32_t       fifo);
+
+/**
+ * Reads from a target-to-host FIFO of booleans.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoBool(NiFpga_Session session,
+                                  uint32_t       fifo,
+                                  NiFpga_Bool*   data,
+                                  size_t         numberOfElements,
+                                  uint32_t       timeout,
+                                  size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of signed 8-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoI8(NiFpga_Session session,
+                                uint32_t       fifo,
+                                int8_t*        data,
+                                size_t         numberOfElements,
+                                uint32_t       timeout,
+                                size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of unsigned 8-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoU8(NiFpga_Session session,
+                                uint32_t       fifo,
+                                uint8_t*       data,
+                                size_t         numberOfElements,
+                                uint32_t       timeout,
+                                size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of signed 16-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoI16(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 int16_t*       data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of unsigned 16-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoU16(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 uint16_t*      data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of signed 32-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoI32(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 int32_t*       data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of unsigned 32-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoU32(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 uint32_t*      data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of signed 64-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoI64(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 int64_t*       data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of unsigned 64-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoU64(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 uint64_t*      data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of single-precision floating-point values.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoSgl(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 float*         data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Reads from a target-to-host FIFO of double-precision floating-point values.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param data outputs the data that was read
+ * @param numberOfElements number of elements to read
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReadFifoDbl(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 double*        data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        elementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of booleans.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoBool(NiFpga_Session     session,
+                                   uint32_t           fifo,
+                                   const NiFpga_Bool* data,
+                                   size_t             numberOfElements,
+                                   uint32_t           timeout,
+                                   size_t*            emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of signed 8-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoI8(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 const int8_t*  data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of unsigned 8-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoU8(NiFpga_Session session,
+                                 uint32_t       fifo,
+                                 const uint8_t* data,
+                                 size_t         numberOfElements,
+                                 uint32_t       timeout,
+                                 size_t*        emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of signed 16-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoI16(NiFpga_Session session,
+                                  uint32_t       fifo,
+                                  const int16_t* data,
+                                  size_t         numberOfElements,
+                                  uint32_t       timeout,
+                                  size_t*        emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of unsigned 16-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoU16(NiFpga_Session  session,
+                                  uint32_t        fifo,
+                                  const uint16_t* data,
+                                  size_t          numberOfElements,
+                                  uint32_t        timeout,
+                                  size_t*         emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of signed 32-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoI32(NiFpga_Session session,
+                                  uint32_t       fifo,
+                                  const int32_t* data,
+                                  size_t         numberOfElements,
+                                  uint32_t       timeout,
+                                  size_t*        emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of unsigned 32-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoU32(NiFpga_Session  session,
+                                  uint32_t        fifo,
+                                  const uint32_t* data,
+                                  size_t          numberOfElements,
+                                  uint32_t        timeout,
+                                  size_t*         emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of signed 64-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoI64(NiFpga_Session session,
+                                  uint32_t       fifo,
+                                  const int64_t* data,
+                                  size_t         numberOfElements,
+                                  uint32_t       timeout,
+                                  size_t*        emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of unsigned 64-bit integers.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoU64(NiFpga_Session  session,
+                                  uint32_t        fifo,
+                                  const uint64_t* data,
+                                  size_t          numberOfElements,
+                                  uint32_t        timeout,
+                                  size_t*         emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of single-precision floating-point values.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoSgl(NiFpga_Session session,
+                                  uint32_t       fifo,
+                                  const float*   data,
+                                  size_t         numberOfElements,
+                                  uint32_t       timeout,
+                                  size_t*        emptyElementsRemaining);
+
+/**
+ * Writes to a host-to-target FIFO of double-precision floating-point values.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param data data to write
+ * @param numberOfElements number of elements to write
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param emptyElementsRemaining if non-NULL, outputs the number of empty
+ *                               elements remaining in the host memory part of
+ *                               the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_WriteFifoDbl(NiFpga_Session session,
+                                  uint32_t       fifo,
+                                  const double*  data,
+                                  size_t         numberOfElements,
+                                  uint32_t       timeout,
+                                  size_t*        emptyElementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of booleans.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsBool(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             NiFpga_Bool**  elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of signed 8-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsI8(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             int8_t**       elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of unsigned 8-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsU8(
+                                            NiFpga_Session  session,
+                                            uint32_t        fifo,
+                                            uint8_t**       elements,
+                                            size_t          elementsRequested,
+                                            uint32_t        timeout,
+                                            size_t*         elementsAcquired,
+                                            size_t*         elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of signed 16-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsI16(
+                                            NiFpga_Session  session,
+                                            uint32_t        fifo,
+                                            int16_t**       elements,
+                                            size_t          elementsRequested,
+                                            uint32_t        timeout,
+                                            size_t*         elementsAcquired,
+                                            size_t*         elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of unsigned 16-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsU16(
+                                           NiFpga_Session   session,
+                                           uint32_t         fifo,
+                                           uint16_t**       elements,
+                                           size_t           elementsRequested,
+                                           uint32_t         timeout,
+                                           size_t*          elementsAcquired,
+                                           size_t*          elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of signed 32-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsI32(
+                                            NiFpga_Session  session,
+                                            uint32_t        fifo,
+                                            int32_t**       elements,
+                                            size_t          elementsRequested,
+                                            uint32_t        timeout,
+                                            size_t*         elementsAcquired,
+                                            size_t*         elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of unsigned 32-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsU32(
+                                           NiFpga_Session   session,
+                                           uint32_t         fifo,
+                                           uint32_t**       elements,
+                                           size_t           elementsRequested,
+                                           uint32_t         timeout,
+                                           size_t*          elementsAcquired,
+                                           size_t*          elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of signed 64-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsI64(
+                                            NiFpga_Session  session,
+                                            uint32_t        fifo,
+                                            int64_t**       elements,
+                                            size_t          elementsRequested,
+                                            uint32_t        timeout,
+                                            size_t*         elementsAcquired,
+                                            size_t*         elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of unsigned 64-bit
+ * integers.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsU64(
+                                           NiFpga_Session   session,
+                                           uint32_t         fifo,
+                                           uint64_t**       elements,
+                                           size_t           elementsRequested,
+                                           uint32_t         timeout,
+                                           size_t*          elementsAcquired,
+                                           size_t*          elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of single-precision
+ * floating-point values.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsSgl(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             float**        elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for reading from a target-to-host FIFO of double-precision
+ * floating-point values.
+ *
+ * Acquiring, reading, and releasing FIFO elements prevents the need to copy
+ * the contents of elements from the host memory buffer to a separate
+ * user-allocated buffer before reading. The FPGA target cannot write to
+ * elements acquired by the host. Therefore, the host must release elements
+ * after reading them. The number of elements acquired may differ from the
+ * number of elements requested if, for example, the number of elements
+ * requested reaches the end of the host memory buffer. Always release all
+ * acquired elements before closing the session. Do not attempt to access FIFO
+ * elements after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo target-to-host FIFO from which to read
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoReadElementsDbl(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             double**       elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of booleans.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsBool(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             NiFpga_Bool**  elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of signed 8-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsI8(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             int8_t**       elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of unsigned 8-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsU8(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             uint8_t**      elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of signed 16-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsI16(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             int16_t**      elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of unsigned 16-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsU16(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             uint16_t**     elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of signed 32-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsI32(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             int32_t**      elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of unsigned 32-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsU32(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             uint32_t**     elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of signed 64-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsI64(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             int64_t**      elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of unsigned 64-bit
+ * integers.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsU64(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             uint64_t**     elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of single-precision
+ * floating-point values.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsSgl(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             float**        elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Acquires elements for writing to a host-to-target FIFO of single-precision
+ * floating-point values.
+ *
+ * Acquiring, writing, and releasing FIFO elements prevents the need to write
+ * first into a separate user-allocated buffer and then copy the contents of
+ * elements to the host memory buffer. The FPGA target cannot read elements
+ * acquired by the host. Therefore, the host must release elements after
+ * writing to them. The number of elements acquired may differ from the number
+ * of elements requested if, for example, the number of elements requested
+ * reaches the end of the host memory buffer. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo host-to-target FIFO to which to write
+ * @param elements outputs a pointer to the elements acquired
+ * @param elementsRequested requested number of elements
+ * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout
+ * @param elementsAcquired actual number of elements acquired, which may be
+ *                         less than the requested number
+ * @param elementsRemaining if non-NULL, outputs the number of elements
+ *                          remaining in the host memory part of the DMA FIFO
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_AcquireFifoWriteElementsDbl(
+                                             NiFpga_Session session,
+                                             uint32_t       fifo,
+                                             double**       elements,
+                                             size_t         elementsRequested,
+                                             uint32_t       timeout,
+                                             size_t*        elementsAcquired,
+                                             size_t*        elementsRemaining);
+
+/**
+ * Releases previously acquired FIFO elements.
+ *
+ * The FPGA target cannot read elements acquired by the host. Therefore, the
+ * host must release elements after acquiring them. Always release all acquired
+ * elements before closing the session. Do not attempt to access FIFO elements
+ * after the elements are released or the session is closed.
+ *
+ * @param session handle to a currently open session
+ * @param fifo FIFO from which to release elements
+ * @param elements number of elements to release
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_ReleaseFifoElements(NiFpga_Session session,
+                                         uint32_t       fifo,
+                                         size_t         elements);
+
+/**
+ * Gets an endpoint reference to a peer-to-peer FIFO.
+ *
+ * @param session handle to a currently open session
+ * @param fifo peer-to-peer FIFO
+ * @param endpoint Outputs the endpoint reference.
+ *                 The actual type is a nip2p_tEndpointHandle usable by
+ *                 the NI Peer-to-Peer Streaming C/C++ API.
+ * @return result of the call
+ */
+NiFpga_Status NiFpga_GetPeerToPeerFifoEndpoint(NiFpga_Session session,
+                                               uint32_t       fifo,
+                                               uint32_t*      endpoint);
+
+#if NiFpga_Cpp
+}
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h
new file mode 100644
index 0000000..5b56ce9
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/nInterfaceGlobals.h
@@ -0,0 +1,18 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_nInterfaceGlobals_h__
+#define __nFRC_2018_18_0_8_nInterfaceGlobals_h__
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+   extern unsigned int g_currentTargetClass;
+
+   static const int g_SpiAutoData_index = 0;
+   static const int g_DMA_index = 1;
+}
+}
+
+#endif // __nFRC_2018_18_0_8_nInterfaceGlobals_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h
new file mode 100644
index 0000000..bf17516
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAI.h
@@ -0,0 +1,144 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_AI_h__
+#define __nFRC_2018_18_0_8_AI_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tAI
+{
+public:
+   tAI(){}
+   virtual ~tAI(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tAI* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned ScanSize : 3;
+         unsigned ConvertRate : 26;
+#else
+         unsigned ConvertRate : 26;
+         unsigned ScanSize : 3;
+#endif
+      };
+      struct{
+         unsigned value : 29;
+      };
+   } tConfig;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Channel : 3;
+         unsigned Averaged : 1;
+#else
+         unsigned Averaged : 1;
+         unsigned Channel : 3;
+#endif
+      };
+      struct{
+         unsigned value : 4;
+      };
+   } tReadSelect;
+
+
+
+   typedef enum
+   {
+   } tOutput_IfaceConstants;
+
+   virtual signed int readOutput(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_ScanSize(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_ConvertRate(unsigned int value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_ScanSize(tRioStatusCode *status) = 0;
+   virtual unsigned int readConfig_ConvertRate(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tLoopTiming_IfaceConstants;
+
+   virtual unsigned int readLoopTiming(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumOversampleBitsElements = 8,
+   } tOversampleBits_IfaceConstants;
+
+   virtual void writeOversampleBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readOversampleBits(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumAverageBitsElements = 8,
+   } tAverageBits_IfaceConstants;
+
+   virtual void writeAverageBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readAverageBits(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumScanListElements = 8,
+   } tScanList_IfaceConstants;
+
+   virtual void writeScanList(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readScanList(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tLatchOutput_IfaceConstants;
+
+   virtual void strobeLatchOutput(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tReadSelect_IfaceConstants;
+
+   virtual void writeReadSelect(tReadSelect value, tRioStatusCode *status) = 0;
+   virtual void writeReadSelect_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeReadSelect_Averaged(bool value, tRioStatusCode *status) = 0;
+   virtual tReadSelect readReadSelect(tRioStatusCode *status) = 0;
+   virtual unsigned char readReadSelect_Channel(tRioStatusCode *status) = 0;
+   virtual bool readReadSelect_Averaged(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tAI(const tAI&);
+   void operator=(const tAI&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_AI_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h
new file mode 100644
index 0000000..3ad6bca
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAO.h
@@ -0,0 +1,51 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_AO_h__
+#define __nFRC_2018_18_0_8_AO_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tAO
+{
+public:
+   tAO(){}
+   virtual ~tAO(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tAO* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+
+
+
+
+
+   typedef enum
+   {
+      kNumMXPRegisters = 2,
+   } tMXP_IfaceConstants;
+
+   virtual void writeMXP(unsigned char reg_index, unsigned short value, tRioStatusCode *status) = 0;
+   virtual unsigned short readMXP(unsigned char reg_index, tRioStatusCode *status) = 0;
+
+
+private:
+   tAO(const tAO&);
+   void operator=(const tAO&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_AO_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h
new file mode 100644
index 0000000..63945ab
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccel.h
@@ -0,0 +1,103 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Accel_h__
+#define __nFRC_2018_18_0_8_Accel_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tAccel
+{
+public:
+   tAccel(){}
+   virtual ~tAccel(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tAccel* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+
+
+
+   typedef enum
+   {
+   } tSTAT_IfaceConstants;
+
+   virtual unsigned char readSTAT(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDATO_IfaceConstants;
+
+   virtual void writeDATO(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readDATO(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tCNTR_IfaceConstants;
+
+   virtual void writeCNTR(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readCNTR(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tCNFG_IfaceConstants;
+
+   virtual void writeCNFG(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readCNFG(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tCNTL_IfaceConstants;
+
+   virtual void writeCNTL(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readCNTL(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDATI_IfaceConstants;
+
+   virtual unsigned char readDATI(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tGO_IfaceConstants;
+
+   virtual void strobeGO(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tADDR_IfaceConstants;
+
+   virtual void writeADDR(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readADDR(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tAccel(const tAccel&);
+   void operator=(const tAccel&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Accel_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h
new file mode 100644
index 0000000..114eba0
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAccumulator.h
@@ -0,0 +1,88 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Accumulator_h__
+#define __nFRC_2018_18_0_8_Accumulator_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tAccumulator
+{
+public:
+   tAccumulator(){}
+   virtual ~tAccumulator(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tAccumulator* create(unsigned char sys_index, tRioStatusCode *status);
+   virtual unsigned char getSystemIndex() = 0;
+
+
+   typedef enum
+   {
+      kNumSystems = 2,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+         signed long long Value;
+         unsigned Count : 32;
+      };
+      struct{
+         unsigned value : 32;
+         unsigned value2 : 32;
+         unsigned value3 : 32;
+      };
+   } tOutput;
+
+
+   typedef enum
+   {
+   } tOutput_IfaceConstants;
+
+   virtual tOutput readOutput(tRioStatusCode *status) = 0;
+   virtual signed long long readOutput_Value(tRioStatusCode *status) = 0;
+   virtual unsigned int readOutput_Count(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tCenter_IfaceConstants;
+
+   virtual void writeCenter(signed int value, tRioStatusCode *status) = 0;
+   virtual signed int readCenter(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDeadband_IfaceConstants;
+
+   virtual void writeDeadband(signed int value, tRioStatusCode *status) = 0;
+   virtual signed int readDeadband(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tReset_IfaceConstants;
+
+   virtual void strobeReset(tRioStatusCode *status) = 0;
+
+
+
+
+
+private:
+   tAccumulator(const tAccumulator&);
+   void operator=(const tAccumulator&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Accumulator_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h
new file mode 100644
index 0000000..4cdc678
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAlarm.h
@@ -0,0 +1,58 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Alarm_h__
+#define __nFRC_2018_18_0_8_Alarm_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tAlarm
+{
+public:
+   tAlarm(){}
+   virtual ~tAlarm(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tAlarm* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+
+
+
+   typedef enum
+   {
+   } tEnable_IfaceConstants;
+
+   virtual void writeEnable(bool value, tRioStatusCode *status) = 0;
+   virtual bool readEnable(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTriggerTime_IfaceConstants;
+
+   virtual void writeTriggerTime(unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readTriggerTime(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tAlarm(const tAlarm&);
+   void operator=(const tAlarm&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Alarm_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h
new file mode 100644
index 0000000..e87b168
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tAnalogTrigger.h
@@ -0,0 +1,130 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_AnalogTrigger_h__
+#define __nFRC_2018_18_0_8_AnalogTrigger_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tAnalogTrigger
+{
+public:
+   tAnalogTrigger(){}
+   virtual ~tAnalogTrigger(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tAnalogTrigger* create(unsigned char sys_index, tRioStatusCode *status);
+   virtual unsigned char getSystemIndex() = 0;
+
+
+   typedef enum
+   {
+      kNumSystems = 8,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned InHysteresis : 1;
+         unsigned OverLimit : 1;
+         unsigned Rising : 1;
+         unsigned Falling : 1;
+#else
+         unsigned Falling : 1;
+         unsigned Rising : 1;
+         unsigned OverLimit : 1;
+         unsigned InHysteresis : 1;
+#endif
+      };
+      struct{
+         unsigned value : 4;
+      };
+   } tOutput;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Channel : 3;
+         unsigned Averaged : 1;
+         unsigned Filter : 1;
+         unsigned FloatingRollover : 1;
+         signed RolloverLimit : 8;
+#else
+         signed RolloverLimit : 8;
+         unsigned FloatingRollover : 1;
+         unsigned Filter : 1;
+         unsigned Averaged : 1;
+         unsigned Channel : 3;
+#endif
+      };
+      struct{
+         unsigned value : 14;
+      };
+   } tSourceSelect;
+
+
+   typedef enum
+   {
+   } tSourceSelect_IfaceConstants;
+
+   virtual void writeSourceSelect(tSourceSelect value, tRioStatusCode *status) = 0;
+   virtual void writeSourceSelect_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeSourceSelect_Averaged(bool value, tRioStatusCode *status) = 0;
+   virtual void writeSourceSelect_Filter(bool value, tRioStatusCode *status) = 0;
+   virtual void writeSourceSelect_FloatingRollover(bool value, tRioStatusCode *status) = 0;
+   virtual void writeSourceSelect_RolloverLimit(signed short value, tRioStatusCode *status) = 0;
+   virtual tSourceSelect readSourceSelect(tRioStatusCode *status) = 0;
+   virtual unsigned char readSourceSelect_Channel(tRioStatusCode *status) = 0;
+   virtual bool readSourceSelect_Averaged(tRioStatusCode *status) = 0;
+   virtual bool readSourceSelect_Filter(tRioStatusCode *status) = 0;
+   virtual bool readSourceSelect_FloatingRollover(tRioStatusCode *status) = 0;
+   virtual signed short readSourceSelect_RolloverLimit(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUpperLimit_IfaceConstants;
+
+   virtual void writeUpperLimit(signed int value, tRioStatusCode *status) = 0;
+   virtual signed int readUpperLimit(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tLowerLimit_IfaceConstants;
+
+   virtual void writeLowerLimit(signed int value, tRioStatusCode *status) = 0;
+   virtual signed int readLowerLimit(tRioStatusCode *status) = 0;
+
+
+
+   typedef enum
+   {
+      kNumOutputElements = 8,
+   } tOutput_IfaceConstants;
+
+   virtual tOutput readOutput(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readOutput_InHysteresis(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readOutput_OverLimit(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readOutput_Rising(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readOutput_Falling(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tAnalogTrigger(const tAnalogTrigger&);
+   void operator=(const tAnalogTrigger&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_AnalogTrigger_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h
new file mode 100644
index 0000000..2bb7256
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tBIST.h
@@ -0,0 +1,91 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_BIST_h__
+#define __nFRC_2018_18_0_8_BIST_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tBIST
+{
+public:
+   tBIST(){}
+   virtual ~tBIST(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tBIST* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+
+
+
+   typedef enum
+   {
+   } tDO0SquareTicks_IfaceConstants;
+
+   virtual void writeDO0SquareTicks(unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readDO0SquareTicks(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tEnable_IfaceConstants;
+
+   virtual void writeEnable(bool value, tRioStatusCode *status) = 0;
+   virtual bool readEnable(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDO1SquareEnable_IfaceConstants;
+
+   virtual void writeDO1SquareEnable(bool value, tRioStatusCode *status) = 0;
+   virtual bool readDO1SquareEnable(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDO0SquareEnable_IfaceConstants;
+
+   virtual void writeDO0SquareEnable(bool value, tRioStatusCode *status) = 0;
+   virtual bool readDO0SquareEnable(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDO1SquareTicks_IfaceConstants;
+
+   virtual void writeDO1SquareTicks(unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readDO1SquareTicks(tRioStatusCode *status) = 0;
+
+
+
+
+   typedef enum
+   {
+      kNumDORegisters = 2,
+   } tDO_IfaceConstants;
+
+   virtual void writeDO(unsigned char reg_index, bool value, tRioStatusCode *status) = 0;
+   virtual bool readDO(unsigned char reg_index, tRioStatusCode *status) = 0;
+
+
+private:
+   tBIST(const tBIST&);
+   void operator=(const tBIST&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_BIST_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h
new file mode 100644
index 0000000..d4b70fd
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tCounter.h
@@ -0,0 +1,220 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Counter_h__
+#define __nFRC_2018_18_0_8_Counter_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tCounter
+{
+public:
+   tCounter(){}
+   virtual ~tCounter(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tCounter* create(unsigned char sys_index, tRioStatusCode *status);
+   virtual unsigned char getSystemIndex() = 0;
+
+
+   typedef enum
+   {
+      kNumSystems = 8,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Direction : 1;
+         signed Value : 31;
+#else
+         signed Value : 31;
+         unsigned Direction : 1;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tOutput;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned UpSource_Channel : 4;
+         unsigned UpSource_Module : 1;
+         unsigned UpSource_AnalogTrigger : 1;
+         unsigned DownSource_Channel : 4;
+         unsigned DownSource_Module : 1;
+         unsigned DownSource_AnalogTrigger : 1;
+         unsigned IndexSource_Channel : 4;
+         unsigned IndexSource_Module : 1;
+         unsigned IndexSource_AnalogTrigger : 1;
+         unsigned IndexActiveHigh : 1;
+         unsigned IndexEdgeSensitive : 1;
+         unsigned UpRisingEdge : 1;
+         unsigned UpFallingEdge : 1;
+         unsigned DownRisingEdge : 1;
+         unsigned DownFallingEdge : 1;
+         unsigned Mode : 2;
+         unsigned PulseLengthThreshold : 6;
+#else
+         unsigned PulseLengthThreshold : 6;
+         unsigned Mode : 2;
+         unsigned DownFallingEdge : 1;
+         unsigned DownRisingEdge : 1;
+         unsigned UpFallingEdge : 1;
+         unsigned UpRisingEdge : 1;
+         unsigned IndexEdgeSensitive : 1;
+         unsigned IndexActiveHigh : 1;
+         unsigned IndexSource_AnalogTrigger : 1;
+         unsigned IndexSource_Module : 1;
+         unsigned IndexSource_Channel : 4;
+         unsigned DownSource_AnalogTrigger : 1;
+         unsigned DownSource_Module : 1;
+         unsigned DownSource_Channel : 4;
+         unsigned UpSource_AnalogTrigger : 1;
+         unsigned UpSource_Module : 1;
+         unsigned UpSource_Channel : 4;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tConfig;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Period : 23;
+         signed Count : 8;
+         unsigned Stalled : 1;
+#else
+         unsigned Stalled : 1;
+         signed Count : 8;
+         unsigned Period : 23;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tTimerOutput;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned StallPeriod : 24;
+         unsigned AverageSize : 7;
+         unsigned UpdateWhenEmpty : 1;
+#else
+         unsigned UpdateWhenEmpty : 1;
+         unsigned AverageSize : 7;
+         unsigned StallPeriod : 24;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tTimerConfig;
+
+
+   typedef enum
+   {
+   } tOutput_IfaceConstants;
+
+   virtual tOutput readOutput(tRioStatusCode *status) = 0;
+   virtual bool readOutput_Direction(tRioStatusCode *status) = 0;
+   virtual signed int readOutput_Value(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_UpSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_UpSource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_UpSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_DownSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_DownSource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_DownSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexEdgeSensitive(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_UpRisingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_UpFallingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_DownRisingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_DownFallingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Mode(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_PulseLengthThreshold(unsigned short value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_UpSource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_UpSource_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_UpSource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_DownSource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_DownSource_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_DownSource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0;
+   virtual bool readConfig_IndexEdgeSensitive(tRioStatusCode *status) = 0;
+   virtual bool readConfig_UpRisingEdge(tRioStatusCode *status) = 0;
+   virtual bool readConfig_UpFallingEdge(tRioStatusCode *status) = 0;
+   virtual bool readConfig_DownRisingEdge(tRioStatusCode *status) = 0;
+   virtual bool readConfig_DownFallingEdge(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_Mode(tRioStatusCode *status) = 0;
+   virtual unsigned short readConfig_PulseLengthThreshold(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTimerOutput_IfaceConstants;
+
+   virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0;
+   virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0;
+   virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0;
+   virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tReset_IfaceConstants;
+
+   virtual void strobeReset(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTimerConfig_IfaceConstants;
+
+   virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0;
+   virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0;
+   virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0;
+   virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0;
+   virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0;
+   virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0;
+   virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0;
+
+
+
+
+
+private:
+   tCounter(const tCounter&);
+   void operator=(const tCounter&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Counter_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h
new file mode 100644
index 0000000..59b6afc
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDIO.h
@@ -0,0 +1,264 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_DIO_h__
+#define __nFRC_2018_18_0_8_DIO_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tDIO
+{
+public:
+   tDIO(){}
+   virtual ~tDIO(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tDIO* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Headers : 10;
+         unsigned SPIPort : 5;
+         unsigned Reserved : 1;
+         unsigned MXP : 16;
+#else
+         unsigned MXP : 16;
+         unsigned Reserved : 1;
+         unsigned SPIPort : 5;
+         unsigned Headers : 10;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tDO;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Headers : 10;
+         unsigned SPIPort : 5;
+         unsigned Reserved : 1;
+         unsigned MXP : 16;
+#else
+         unsigned MXP : 16;
+         unsigned Reserved : 1;
+         unsigned SPIPort : 5;
+         unsigned Headers : 10;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tOutputEnable;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Headers : 10;
+         unsigned SPIPort : 5;
+         unsigned Reserved : 1;
+         unsigned MXP : 16;
+#else
+         unsigned MXP : 16;
+         unsigned Reserved : 1;
+         unsigned SPIPort : 5;
+         unsigned Headers : 10;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tPulse;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Headers : 10;
+         unsigned SPIPort : 5;
+         unsigned Reserved : 1;
+         unsigned MXP : 16;
+#else
+         unsigned MXP : 16;
+         unsigned Reserved : 1;
+         unsigned SPIPort : 5;
+         unsigned Headers : 10;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tDI;
+
+
+
+   typedef enum
+   {
+   } tDO_IfaceConstants;
+
+   virtual void writeDO(tDO value, tRioStatusCode *status) = 0;
+   virtual void writeDO_Headers(unsigned short value, tRioStatusCode *status) = 0;
+   virtual void writeDO_SPIPort(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeDO_Reserved(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeDO_MXP(unsigned short value, tRioStatusCode *status) = 0;
+   virtual tDO readDO(tRioStatusCode *status) = 0;
+   virtual unsigned short readDO_Headers(tRioStatusCode *status) = 0;
+   virtual unsigned char readDO_SPIPort(tRioStatusCode *status) = 0;
+   virtual unsigned char readDO_Reserved(tRioStatusCode *status) = 0;
+   virtual unsigned short readDO_MXP(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumPWMDutyCycleAElements = 4,
+   } tPWMDutyCycleA_IfaceConstants;
+
+   virtual void writePWMDutyCycleA(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readPWMDutyCycleA(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumPWMDutyCycleBElements = 2,
+   } tPWMDutyCycleB_IfaceConstants;
+
+   virtual void writePWMDutyCycleB(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readPWMDutyCycleB(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumFilterSelectHdrElements = 16,
+   } tFilterSelectHdr_IfaceConstants;
+
+   virtual void writeFilterSelectHdr(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readFilterSelectHdr(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tOutputEnable_IfaceConstants;
+
+   virtual void writeOutputEnable(tOutputEnable value, tRioStatusCode *status) = 0;
+   virtual void writeOutputEnable_Headers(unsigned short value, tRioStatusCode *status) = 0;
+   virtual void writeOutputEnable_SPIPort(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeOutputEnable_Reserved(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeOutputEnable_MXP(unsigned short value, tRioStatusCode *status) = 0;
+   virtual tOutputEnable readOutputEnable(tRioStatusCode *status) = 0;
+   virtual unsigned short readOutputEnable_Headers(tRioStatusCode *status) = 0;
+   virtual unsigned char readOutputEnable_SPIPort(tRioStatusCode *status) = 0;
+   virtual unsigned char readOutputEnable_Reserved(tRioStatusCode *status) = 0;
+   virtual unsigned short readOutputEnable_MXP(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumPWMOutputSelectElements = 6,
+   } tPWMOutputSelect_IfaceConstants;
+
+   virtual void writePWMOutputSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readPWMOutputSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tPulse_IfaceConstants;
+
+   virtual void writePulse(tPulse value, tRioStatusCode *status) = 0;
+   virtual void writePulse_Headers(unsigned short value, tRioStatusCode *status) = 0;
+   virtual void writePulse_SPIPort(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writePulse_Reserved(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writePulse_MXP(unsigned short value, tRioStatusCode *status) = 0;
+   virtual tPulse readPulse(tRioStatusCode *status) = 0;
+   virtual unsigned short readPulse_Headers(tRioStatusCode *status) = 0;
+   virtual unsigned char readPulse_SPIPort(tRioStatusCode *status) = 0;
+   virtual unsigned char readPulse_Reserved(tRioStatusCode *status) = 0;
+   virtual unsigned short readPulse_MXP(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDI_IfaceConstants;
+
+   virtual tDI readDI(tRioStatusCode *status) = 0;
+   virtual unsigned short readDI_Headers(tRioStatusCode *status) = 0;
+   virtual unsigned char readDI_SPIPort(tRioStatusCode *status) = 0;
+   virtual unsigned char readDI_Reserved(tRioStatusCode *status) = 0;
+   virtual unsigned short readDI_MXP(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tEnableMXPSpecialFunction_IfaceConstants;
+
+   virtual void writeEnableMXPSpecialFunction(unsigned short value, tRioStatusCode *status) = 0;
+   virtual unsigned short readEnableMXPSpecialFunction(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumFilterSelectMXPElements = 16,
+   } tFilterSelectMXP_IfaceConstants;
+
+   virtual void writeFilterSelectMXP(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readFilterSelectMXP(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tPulseLength_IfaceConstants;
+
+   virtual void writePulseLength(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readPulseLength(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tPWMPeriodPower_IfaceConstants;
+
+   virtual void writePWMPeriodPower(unsigned short value, tRioStatusCode *status) = 0;
+   virtual unsigned short readPWMPeriodPower(tRioStatusCode *status) = 0;
+
+
+
+
+   typedef enum
+   {
+      kNumFilterPeriodMXPRegisters = 3,
+   } tFilterPeriodMXP_IfaceConstants;
+
+   virtual void writeFilterPeriodMXP(unsigned char reg_index, unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readFilterPeriodMXP(unsigned char reg_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumFilterPeriodHdrRegisters = 3,
+   } tFilterPeriodHdr_IfaceConstants;
+
+   virtual void writeFilterPeriodHdr(unsigned char reg_index, unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readFilterPeriodHdr(unsigned char reg_index, tRioStatusCode *status) = 0;
+
+
+private:
+   tDIO(const tDIO&);
+   void operator=(const tDIO&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_DIO_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h
new file mode 100644
index 0000000..4adce53
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tDMA.h
@@ -0,0 +1,198 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_DMA_h__
+#define __nFRC_2018_18_0_8_DMA_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tDMA
+{
+public:
+   tDMA(){}
+   virtual ~tDMA(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tDMA* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Pause : 1;
+         unsigned Enable_AI0_Low : 1;
+         unsigned Enable_AI0_High : 1;
+         unsigned Enable_AIAveraged0_Low : 1;
+         unsigned Enable_AIAveraged0_High : 1;
+         unsigned Enable_AI1_Low : 1;
+         unsigned Enable_AI1_High : 1;
+         unsigned Enable_AIAveraged1_Low : 1;
+         unsigned Enable_AIAveraged1_High : 1;
+         unsigned Enable_Accumulator0 : 1;
+         unsigned Enable_Accumulator1 : 1;
+         unsigned Enable_DI : 1;
+         unsigned Enable_AnalogTriggers : 1;
+         unsigned Enable_Counters_Low : 1;
+         unsigned Enable_Counters_High : 1;
+         unsigned Enable_CounterTimers_Low : 1;
+         unsigned Enable_CounterTimers_High : 1;
+         unsigned Enable_Encoders_Low : 1;
+         unsigned Enable_Encoders_High : 1;
+         unsigned Enable_EncoderTimers_Low : 1;
+         unsigned Enable_EncoderTimers_High : 1;
+         unsigned ExternalClock : 1;
+#else
+         unsigned ExternalClock : 1;
+         unsigned Enable_EncoderTimers_High : 1;
+         unsigned Enable_EncoderTimers_Low : 1;
+         unsigned Enable_Encoders_High : 1;
+         unsigned Enable_Encoders_Low : 1;
+         unsigned Enable_CounterTimers_High : 1;
+         unsigned Enable_CounterTimers_Low : 1;
+         unsigned Enable_Counters_High : 1;
+         unsigned Enable_Counters_Low : 1;
+         unsigned Enable_AnalogTriggers : 1;
+         unsigned Enable_DI : 1;
+         unsigned Enable_Accumulator1 : 1;
+         unsigned Enable_Accumulator0 : 1;
+         unsigned Enable_AIAveraged1_High : 1;
+         unsigned Enable_AIAveraged1_Low : 1;
+         unsigned Enable_AI1_High : 1;
+         unsigned Enable_AI1_Low : 1;
+         unsigned Enable_AIAveraged0_High : 1;
+         unsigned Enable_AIAveraged0_Low : 1;
+         unsigned Enable_AI0_High : 1;
+         unsigned Enable_AI0_Low : 1;
+         unsigned Pause : 1;
+#endif
+      };
+      struct{
+         unsigned value : 22;
+      };
+   } tConfig;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned ExternalClockSource_Channel : 4;
+         unsigned ExternalClockSource_Module : 1;
+         unsigned ExternalClockSource_AnalogTrigger : 1;
+         unsigned RisingEdge : 1;
+         unsigned FallingEdge : 1;
+#else
+         unsigned FallingEdge : 1;
+         unsigned RisingEdge : 1;
+         unsigned ExternalClockSource_AnalogTrigger : 1;
+         unsigned ExternalClockSource_Module : 1;
+         unsigned ExternalClockSource_Channel : 4;
+#endif
+      };
+      struct{
+         unsigned value : 8;
+      };
+   } tExternalTriggers;
+
+
+
+   typedef enum
+   {
+   } tRate_IfaceConstants;
+
+   virtual void writeRate(unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readRate(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Pause(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AI0_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AI0_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AIAveraged0_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AIAveraged0_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AI1_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AI1_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AIAveraged1_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AIAveraged1_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_Accumulator0(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_Accumulator1(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_DI(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_AnalogTriggers(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_Counters_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_Counters_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_CounterTimers_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_CounterTimers_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_Encoders_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_Encoders_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_EncoderTimers_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enable_EncoderTimers_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_ExternalClock(bool value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Pause(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AI0_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AI0_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AIAveraged0_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AIAveraged0_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AI1_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AI1_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AIAveraged1_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AIAveraged1_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_Accumulator0(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_Accumulator1(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_DI(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_AnalogTriggers(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_Counters_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_Counters_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_CounterTimers_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_CounterTimers_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_Encoders_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_Encoders_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_EncoderTimers_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enable_EncoderTimers_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_ExternalClock(tRioStatusCode *status) = 0;
+
+
+
+
+   typedef enum
+   {
+      kNumExternalTriggersRegisters = 2,
+      kNumExternalTriggersElements = 4,
+   } tExternalTriggers_IfaceConstants;
+
+   virtual void writeExternalTriggers(unsigned char reg_index, unsigned char bitfield_index, tExternalTriggers value, tRioStatusCode *status) = 0;
+   virtual void writeExternalTriggers_ExternalClockSource_Channel(unsigned char reg_index, unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeExternalTriggers_ExternalClockSource_Module(unsigned char reg_index, unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char reg_index, unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
+   virtual void writeExternalTriggers_RisingEdge(unsigned char reg_index, unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
+   virtual void writeExternalTriggers_FallingEdge(unsigned char reg_index, unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
+   virtual tExternalTriggers readExternalTriggers(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual unsigned char readExternalTriggers_ExternalClockSource_Channel(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual unsigned char readExternalTriggers_ExternalClockSource_Module(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readExternalTriggers_RisingEdge(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+   virtual bool readExternalTriggers_FallingEdge(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+private:
+   tDMA(const tDMA&);
+   void operator=(const tDMA&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_DMA_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h
new file mode 100644
index 0000000..1e310c8
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tEncoder.h
@@ -0,0 +1,200 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Encoder_h__
+#define __nFRC_2018_18_0_8_Encoder_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tEncoder
+{
+public:
+   tEncoder(){}
+   virtual ~tEncoder(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tEncoder* create(unsigned char sys_index, tRioStatusCode *status);
+   virtual unsigned char getSystemIndex() = 0;
+
+
+   typedef enum
+   {
+      kNumSystems = 8,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Direction : 1;
+         signed Value : 31;
+#else
+         signed Value : 31;
+         unsigned Direction : 1;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tOutput;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned ASource_Channel : 4;
+         unsigned ASource_Module : 1;
+         unsigned ASource_AnalogTrigger : 1;
+         unsigned BSource_Channel : 4;
+         unsigned BSource_Module : 1;
+         unsigned BSource_AnalogTrigger : 1;
+         unsigned IndexSource_Channel : 4;
+         unsigned IndexSource_Module : 1;
+         unsigned IndexSource_AnalogTrigger : 1;
+         unsigned IndexActiveHigh : 1;
+         unsigned IndexEdgeSensitive : 1;
+         unsigned Reverse : 1;
+#else
+         unsigned Reverse : 1;
+         unsigned IndexEdgeSensitive : 1;
+         unsigned IndexActiveHigh : 1;
+         unsigned IndexSource_AnalogTrigger : 1;
+         unsigned IndexSource_Module : 1;
+         unsigned IndexSource_Channel : 4;
+         unsigned BSource_AnalogTrigger : 1;
+         unsigned BSource_Module : 1;
+         unsigned BSource_Channel : 4;
+         unsigned ASource_AnalogTrigger : 1;
+         unsigned ASource_Module : 1;
+         unsigned ASource_Channel : 4;
+#endif
+      };
+      struct{
+         unsigned value : 21;
+      };
+   } tConfig;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Period : 23;
+         signed Count : 8;
+         unsigned Stalled : 1;
+#else
+         unsigned Stalled : 1;
+         signed Count : 8;
+         unsigned Period : 23;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tTimerOutput;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned StallPeriod : 24;
+         unsigned AverageSize : 7;
+         unsigned UpdateWhenEmpty : 1;
+#else
+         unsigned UpdateWhenEmpty : 1;
+         unsigned AverageSize : 7;
+         unsigned StallPeriod : 24;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tTimerConfig;
+
+
+   typedef enum
+   {
+   } tOutput_IfaceConstants;
+
+   virtual tOutput readOutput(tRioStatusCode *status) = 0;
+   virtual bool readOutput_Direction(tRioStatusCode *status) = 0;
+   virtual signed int readOutput_Value(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_ASource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_ASource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_ASource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_BSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_BSource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_BSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_IndexEdgeSensitive(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Reverse(bool value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_ASource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_ASource_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_ASource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_BSource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_BSource_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_BSource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0;
+   virtual bool readConfig_IndexEdgeSensitive(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Reverse(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTimerOutput_IfaceConstants;
+
+   virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0;
+   virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0;
+   virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0;
+   virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tReset_IfaceConstants;
+
+   virtual void strobeReset(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTimerConfig_IfaceConstants;
+
+   virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0;
+   virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0;
+   virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0;
+   virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0;
+   virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0;
+   virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0;
+   virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0;
+
+
+
+
+
+private:
+   tEncoder(const tEncoder&);
+   void operator=(const tEncoder&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Encoder_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h
new file mode 100644
index 0000000..cb41e6e
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tGlobal.h
@@ -0,0 +1,108 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Global_h__
+#define __nFRC_2018_18_0_8_Global_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tGlobal
+{
+public:
+   tGlobal(){}
+   virtual ~tGlobal(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tGlobal* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Comm : 8;
+         unsigned Mode : 8;
+         unsigned RSL : 1;
+#else
+         unsigned RSL : 1;
+         unsigned Mode : 8;
+         unsigned Comm : 8;
+#endif
+      };
+      struct{
+         unsigned value : 17;
+      };
+   } tLEDs;
+
+
+
+   typedef enum
+   {
+   } tLEDs_IfaceConstants;
+
+   virtual void writeLEDs(tLEDs value, tRioStatusCode *status) = 0;
+   virtual void writeLEDs_Comm(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeLEDs_Mode(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeLEDs_RSL(bool value, tRioStatusCode *status) = 0;
+   virtual tLEDs readLEDs(tRioStatusCode *status) = 0;
+   virtual unsigned char readLEDs_Comm(tRioStatusCode *status) = 0;
+   virtual unsigned char readLEDs_Mode(tRioStatusCode *status) = 0;
+   virtual bool readLEDs_RSL(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tLocalTimeUpper_IfaceConstants;
+
+   virtual unsigned int readLocalTimeUpper(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tVersion_IfaceConstants;
+
+   virtual unsigned short readVersion(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tLocalTime_IfaceConstants;
+
+   virtual unsigned int readLocalTime(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUserButton_IfaceConstants;
+
+   virtual bool readUserButton(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tRevision_IfaceConstants;
+
+   virtual unsigned int readRevision(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tGlobal(const tGlobal&);
+   void operator=(const tGlobal&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Global_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tHMB.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tHMB.h
new file mode 100644
index 0000000..2a11031
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tHMB.h
@@ -0,0 +1,149 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_HMB_h__
+#define __nFRC_2018_18_0_8_HMB_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tHMB
+{
+public:
+   tHMB(){}
+   virtual ~tHMB(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tHMB* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Enables_AI0_Low : 1;
+         unsigned Enables_AI0_High : 1;
+         unsigned Enables_AIAveraged0_Low : 1;
+         unsigned Enables_AIAveraged0_High : 1;
+         unsigned Enables_AI1_Low : 1;
+         unsigned Enables_AI1_High : 1;
+         unsigned Enables_AIAveraged1_Low : 1;
+         unsigned Enables_AIAveraged1_High : 1;
+         unsigned Enables_Accumulator0 : 1;
+         unsigned Enables_Accumulator1 : 1;
+         unsigned Enables_DI : 1;
+         unsigned Enables_AnalogTriggers : 1;
+         unsigned Enables_Counters_Low : 1;
+         unsigned Enables_Counters_High : 1;
+         unsigned Enables_CounterTimers_Low : 1;
+         unsigned Enables_CounterTimers_High : 1;
+         unsigned Enables_Encoders_Low : 1;
+         unsigned Enables_Encoders_High : 1;
+         unsigned Enables_EncoderTimers_Low : 1;
+         unsigned Enables_EncoderTimers_High : 1;
+#else
+         unsigned Enables_EncoderTimers_High : 1;
+         unsigned Enables_EncoderTimers_Low : 1;
+         unsigned Enables_Encoders_High : 1;
+         unsigned Enables_Encoders_Low : 1;
+         unsigned Enables_CounterTimers_High : 1;
+         unsigned Enables_CounterTimers_Low : 1;
+         unsigned Enables_Counters_High : 1;
+         unsigned Enables_Counters_Low : 1;
+         unsigned Enables_AnalogTriggers : 1;
+         unsigned Enables_DI : 1;
+         unsigned Enables_Accumulator1 : 1;
+         unsigned Enables_Accumulator0 : 1;
+         unsigned Enables_AIAveraged1_High : 1;
+         unsigned Enables_AIAveraged1_Low : 1;
+         unsigned Enables_AI1_High : 1;
+         unsigned Enables_AI1_Low : 1;
+         unsigned Enables_AIAveraged0_High : 1;
+         unsigned Enables_AIAveraged0_Low : 1;
+         unsigned Enables_AI0_High : 1;
+         unsigned Enables_AI0_Low : 1;
+#endif
+      };
+      struct{
+         unsigned value : 20;
+      };
+   } tConfig;
+
+
+
+   typedef enum
+   {
+   } tForceOnce_IfaceConstants;
+
+   virtual void writeForceOnce(bool value, tRioStatusCode *status) = 0;
+   virtual bool readForceOnce(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AI0_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AI0_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AIAveraged0_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AIAveraged0_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AI1_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AI1_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AIAveraged1_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AIAveraged1_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_Accumulator0(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_Accumulator1(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_DI(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_AnalogTriggers(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_Counters_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_Counters_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_CounterTimers_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_CounterTimers_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_Encoders_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_Encoders_High(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_EncoderTimers_Low(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Enables_EncoderTimers_High(bool value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AI0_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AI0_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AIAveraged0_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AIAveraged0_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AI1_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AI1_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AIAveraged1_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AIAveraged1_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_Accumulator0(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_Accumulator1(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_DI(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_AnalogTriggers(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_Counters_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_Counters_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_CounterTimers_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_CounterTimers_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_Encoders_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_Encoders_High(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_EncoderTimers_Low(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Enables_EncoderTimers_High(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tHMB(const tHMB&);
+   void operator=(const tHMB&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_HMB_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h
new file mode 100644
index 0000000..05808d9
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tInterrupt.h
@@ -0,0 +1,101 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Interrupt_h__
+#define __nFRC_2018_18_0_8_Interrupt_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tInterrupt
+{
+public:
+   tInterrupt(){}
+   virtual ~tInterrupt(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tInterrupt* create(unsigned char sys_index, tRioStatusCode *status);
+   virtual unsigned char getSystemIndex() = 0;
+
+
+   typedef enum
+   {
+      kNumSystems = 8,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Source_Channel : 4;
+         unsigned Source_Module : 1;
+         unsigned Source_AnalogTrigger : 1;
+         unsigned RisingEdge : 1;
+         unsigned FallingEdge : 1;
+         unsigned WaitForAck : 1;
+#else
+         unsigned WaitForAck : 1;
+         unsigned FallingEdge : 1;
+         unsigned RisingEdge : 1;
+         unsigned Source_AnalogTrigger : 1;
+         unsigned Source_Module : 1;
+         unsigned Source_Channel : 4;
+#endif
+      };
+      struct{
+         unsigned value : 9;
+      };
+   } tConfig;
+
+
+   typedef enum
+   {
+   } tFallingTimeStamp_IfaceConstants;
+
+   virtual unsigned int readFallingTimeStamp(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Source_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Source_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Source_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_RisingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_FallingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_WaitForAck(bool value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_Source_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readConfig_Source_Module(tRioStatusCode *status) = 0;
+   virtual bool readConfig_Source_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual bool readConfig_RisingEdge(tRioStatusCode *status) = 0;
+   virtual bool readConfig_FallingEdge(tRioStatusCode *status) = 0;
+   virtual bool readConfig_WaitForAck(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tRisingTimeStamp_IfaceConstants;
+
+   virtual unsigned int readRisingTimeStamp(tRioStatusCode *status) = 0;
+
+
+
+
+
+private:
+   tInterrupt(const tInterrupt&);
+   void operator=(const tInterrupt&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Interrupt_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h
new file mode 100644
index 0000000..1513f4d
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPWM.h
@@ -0,0 +1,135 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_PWM_h__
+#define __nFRC_2018_18_0_8_PWM_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tPWM
+{
+public:
+   tPWM(){}
+   virtual ~tPWM(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tPWM* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Period : 16;
+         unsigned MinHigh : 16;
+#else
+         unsigned MinHigh : 16;
+         unsigned Period : 16;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tConfig;
+
+
+
+   typedef enum
+   {
+   } tCycleStartTime_IfaceConstants;
+
+   virtual unsigned int readCycleStartTime(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tConfig_IfaceConstants;
+
+   virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_Period(unsigned short value, tRioStatusCode *status) = 0;
+   virtual void writeConfig_MinHigh(unsigned short value, tRioStatusCode *status) = 0;
+   virtual tConfig readConfig(tRioStatusCode *status) = 0;
+   virtual unsigned short readConfig_Period(tRioStatusCode *status) = 0;
+   virtual unsigned short readConfig_MinHigh(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tCycleStartTimeUpper_IfaceConstants;
+
+   virtual unsigned int readCycleStartTimeUpper(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tLoopTiming_IfaceConstants;
+
+   virtual unsigned short readLoopTiming(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumPeriodScaleMXPElements = 10,
+   } tPeriodScaleMXP_IfaceConstants;
+
+   virtual void writePeriodScaleMXP(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readPeriodScaleMXP(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumPeriodScaleHdrElements = 10,
+   } tPeriodScaleHdr_IfaceConstants;
+
+   virtual void writePeriodScaleHdr(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readPeriodScaleHdr(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumZeroLatchElements = 20,
+   } tZeroLatch_IfaceConstants;
+
+   virtual void writeZeroLatch(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0;
+   virtual bool readZeroLatch(unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+
+
+   typedef enum
+   {
+      kNumHdrRegisters = 10,
+   } tHdr_IfaceConstants;
+
+   virtual void writeHdr(unsigned char reg_index, unsigned short value, tRioStatusCode *status) = 0;
+   virtual unsigned short readHdr(unsigned char reg_index, tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+      kNumMXPRegisters = 10,
+   } tMXP_IfaceConstants;
+
+   virtual void writeMXP(unsigned char reg_index, unsigned short value, tRioStatusCode *status) = 0;
+   virtual unsigned short readMXP(unsigned char reg_index, tRioStatusCode *status) = 0;
+
+
+private:
+   tPWM(const tPWM&);
+   void operator=(const tPWM&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_PWM_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h
new file mode 100644
index 0000000..346ee85
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tPower.h
@@ -0,0 +1,221 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Power_h__
+#define __nFRC_2018_18_0_8_Power_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tPower
+{
+public:
+   tPower(){}
+   virtual ~tPower(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tPower* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned User3V3 : 8;
+         unsigned User5V : 8;
+         unsigned User6V : 8;
+#else
+         unsigned User6V : 8;
+         unsigned User5V : 8;
+         unsigned User3V3 : 8;
+#endif
+      };
+      struct{
+         unsigned value : 24;
+      };
+   } tStatus;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned OverCurrentFaultCount3V3 : 8;
+         unsigned OverCurrentFaultCount5V : 8;
+         unsigned OverCurrentFaultCount6V : 8;
+         unsigned UnderVoltageFaultCount5V : 8;
+#else
+         unsigned UnderVoltageFaultCount5V : 8;
+         unsigned OverCurrentFaultCount6V : 8;
+         unsigned OverCurrentFaultCount5V : 8;
+         unsigned OverCurrentFaultCount3V3 : 8;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tFaultCounts;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned User3V3 : 1;
+         unsigned User5V : 1;
+         unsigned User6V : 1;
+#else
+         unsigned User6V : 1;
+         unsigned User5V : 1;
+         unsigned User3V3 : 1;
+#endif
+      };
+      struct{
+         unsigned value : 3;
+      };
+   } tDisable;
+
+
+
+   typedef enum
+   {
+   } tUserVoltage3V3_IfaceConstants;
+
+   virtual unsigned short readUserVoltage3V3(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tStatus_IfaceConstants;
+
+   virtual tStatus readStatus(tRioStatusCode *status) = 0;
+   virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0;
+   virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0;
+   virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUserVoltage6V_IfaceConstants;
+
+   virtual unsigned short readUserVoltage6V(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tOnChipTemperature_IfaceConstants;
+
+   virtual unsigned short readOnChipTemperature(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUserVoltage5V_IfaceConstants;
+
+   virtual unsigned short readUserVoltage5V(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tResetFaultCounts_IfaceConstants;
+
+   virtual void strobeResetFaultCounts(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tIntegratedIO_IfaceConstants;
+
+   virtual unsigned short readIntegratedIO(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tMXP_DIOVoltage_IfaceConstants;
+
+   virtual unsigned short readMXP_DIOVoltage(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUserCurrent3V3_IfaceConstants;
+
+   virtual unsigned short readUserCurrent3V3(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tVinVoltage_IfaceConstants;
+
+   virtual unsigned short readVinVoltage(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUserCurrent6V_IfaceConstants;
+
+   virtual unsigned short readUserCurrent6V(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tUserCurrent5V_IfaceConstants;
+
+   virtual unsigned short readUserCurrent5V(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAOVoltage_IfaceConstants;
+
+   virtual unsigned short readAOVoltage(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tFaultCounts_IfaceConstants;
+
+   virtual tFaultCounts readFaultCounts(tRioStatusCode *status) = 0;
+   virtual unsigned char readFaultCounts_OverCurrentFaultCount3V3(tRioStatusCode *status) = 0;
+   virtual unsigned char readFaultCounts_OverCurrentFaultCount5V(tRioStatusCode *status) = 0;
+   virtual unsigned char readFaultCounts_OverCurrentFaultCount6V(tRioStatusCode *status) = 0;
+   virtual unsigned char readFaultCounts_UnderVoltageFaultCount5V(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tVinCurrent_IfaceConstants;
+
+   virtual unsigned short readVinCurrent(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDisable_IfaceConstants;
+
+   virtual void writeDisable(tDisable value, tRioStatusCode *status) = 0;
+   virtual void writeDisable_User3V3(bool value, tRioStatusCode *status) = 0;
+   virtual void writeDisable_User5V(bool value, tRioStatusCode *status) = 0;
+   virtual void writeDisable_User6V(bool value, tRioStatusCode *status) = 0;
+   virtual tDisable readDisable(tRioStatusCode *status) = 0;
+   virtual bool readDisable_User3V3(tRioStatusCode *status) = 0;
+   virtual bool readDisable_User5V(tRioStatusCode *status) = 0;
+   virtual bool readDisable_User6V(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tPower(const tPower&);
+   void operator=(const tPower&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Power_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h
new file mode 100644
index 0000000..3ddd635
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tRelay.h
@@ -0,0 +1,69 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_Relay_h__
+#define __nFRC_2018_18_0_8_Relay_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tRelay
+{
+public:
+   tRelay(){}
+   virtual ~tRelay(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tRelay* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Forward : 4;
+         unsigned Reverse : 4;
+#else
+         unsigned Reverse : 4;
+         unsigned Forward : 4;
+#endif
+      };
+      struct{
+         unsigned value : 8;
+      };
+   } tValue;
+
+
+
+   typedef enum
+   {
+   } tValue_IfaceConstants;
+
+   virtual void writeValue(tValue value, tRioStatusCode *status) = 0;
+   virtual void writeValue_Forward(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeValue_Reverse(unsigned char value, tRioStatusCode *status) = 0;
+   virtual tValue readValue(tRioStatusCode *status) = 0;
+   virtual unsigned char readValue_Forward(tRioStatusCode *status) = 0;
+   virtual unsigned char readValue_Reverse(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tRelay(const tRelay&);
+   void operator=(const tRelay&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_Relay_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h
new file mode 100644
index 0000000..058eb1a
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSPI.h
@@ -0,0 +1,237 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_SPI_h__
+#define __nFRC_2018_18_0_8_SPI_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tSPI
+{
+public:
+   tSPI(){}
+   virtual ~tSPI(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tSPI* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned ExternalClockSource_Channel : 4;
+         unsigned ExternalClockSource_Module : 1;
+         unsigned ExternalClockSource_AnalogTrigger : 1;
+         unsigned RisingEdge : 1;
+         unsigned FallingEdge : 1;
+         unsigned ExternalClock : 1;
+#else
+         unsigned ExternalClock : 1;
+         unsigned FallingEdge : 1;
+         unsigned RisingEdge : 1;
+         unsigned ExternalClockSource_AnalogTrigger : 1;
+         unsigned ExternalClockSource_Module : 1;
+         unsigned ExternalClockSource_Channel : 4;
+#endif
+      };
+      struct{
+         unsigned value : 9;
+      };
+   } tAutoTriggerConfig;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned TxByteCount : 4;
+         unsigned ZeroByteCount : 7;
+#else
+         unsigned ZeroByteCount : 7;
+         unsigned TxByteCount : 4;
+#endif
+      };
+      struct{
+         unsigned value : 11;
+      };
+   } tAutoByteCount;
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned Hdr : 4;
+         unsigned MXP : 1;
+#else
+         unsigned MXP : 1;
+         unsigned Hdr : 4;
+#endif
+      };
+      struct{
+         unsigned value : 5;
+      };
+   } tChipSelectActiveHigh;
+
+
+
+   typedef enum
+   {
+   } tDebugIntStatReadCount_IfaceConstants;
+
+   virtual unsigned int readDebugIntStatReadCount(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDebugState_IfaceConstants;
+
+   virtual unsigned short readDebugState(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAutoTriggerConfig_IfaceConstants;
+
+   virtual void writeAutoTriggerConfig(tAutoTriggerConfig value, tRioStatusCode *status) = 0;
+   virtual void writeAutoTriggerConfig_ExternalClockSource_Channel(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeAutoTriggerConfig_ExternalClockSource_Module(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeAutoTriggerConfig_ExternalClockSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0;
+   virtual void writeAutoTriggerConfig_RisingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeAutoTriggerConfig_FallingEdge(bool value, tRioStatusCode *status) = 0;
+   virtual void writeAutoTriggerConfig_ExternalClock(bool value, tRioStatusCode *status) = 0;
+   virtual tAutoTriggerConfig readAutoTriggerConfig(tRioStatusCode *status) = 0;
+   virtual unsigned char readAutoTriggerConfig_ExternalClockSource_Channel(tRioStatusCode *status) = 0;
+   virtual unsigned char readAutoTriggerConfig_ExternalClockSource_Module(tRioStatusCode *status) = 0;
+   virtual bool readAutoTriggerConfig_ExternalClockSource_AnalogTrigger(tRioStatusCode *status) = 0;
+   virtual bool readAutoTriggerConfig_RisingEdge(tRioStatusCode *status) = 0;
+   virtual bool readAutoTriggerConfig_FallingEdge(tRioStatusCode *status) = 0;
+   virtual bool readAutoTriggerConfig_ExternalClock(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAutoChipSelect_IfaceConstants;
+
+   virtual void writeAutoChipSelect(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readAutoChipSelect(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDebugRevision_IfaceConstants;
+
+   virtual unsigned int readDebugRevision(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTransferSkippedFullCount_IfaceConstants;
+
+   virtual unsigned int readTransferSkippedFullCount(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAutoByteCount_IfaceConstants;
+
+   virtual void writeAutoByteCount(tAutoByteCount value, tRioStatusCode *status) = 0;
+   virtual void writeAutoByteCount_TxByteCount(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeAutoByteCount_ZeroByteCount(unsigned char value, tRioStatusCode *status) = 0;
+   virtual tAutoByteCount readAutoByteCount(tRioStatusCode *status) = 0;
+   virtual unsigned char readAutoByteCount_TxByteCount(tRioStatusCode *status) = 0;
+   virtual unsigned char readAutoByteCount_ZeroByteCount(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDebugIntStat_IfaceConstants;
+
+   virtual unsigned int readDebugIntStat(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDebugEnabled_IfaceConstants;
+
+   virtual unsigned int readDebugEnabled(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAutoSPI1Select_IfaceConstants;
+
+   virtual void writeAutoSPI1Select(bool value, tRioStatusCode *status) = 0;
+   virtual bool readAutoSPI1Select(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tDebugSubstate_IfaceConstants;
+
+   virtual unsigned char readDebugSubstate(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAutoRate_IfaceConstants;
+
+   virtual void writeAutoRate(unsigned int value, tRioStatusCode *status) = 0;
+   virtual unsigned int readAutoRate(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tEnableDIO_IfaceConstants;
+
+   virtual void writeEnableDIO(unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readEnableDIO(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tChipSelectActiveHigh_IfaceConstants;
+
+   virtual void writeChipSelectActiveHigh(tChipSelectActiveHigh value, tRioStatusCode *status) = 0;
+   virtual void writeChipSelectActiveHigh_Hdr(unsigned char value, tRioStatusCode *status) = 0;
+   virtual void writeChipSelectActiveHigh_MXP(unsigned char value, tRioStatusCode *status) = 0;
+   virtual tChipSelectActiveHigh readChipSelectActiveHigh(tRioStatusCode *status) = 0;
+   virtual unsigned char readChipSelectActiveHigh_Hdr(tRioStatusCode *status) = 0;
+   virtual unsigned char readChipSelectActiveHigh_MXP(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tAutoForceOne_IfaceConstants;
+
+   virtual void strobeAutoForceOne(tRioStatusCode *status) = 0;
+
+
+
+
+   typedef enum
+   {
+      kNumAutoTxRegisters = 4,
+      kNumAutoTxElements = 4,
+   } tAutoTx_IfaceConstants;
+
+   virtual void writeAutoTx(unsigned char reg_index, unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0;
+   virtual unsigned char readAutoTx(unsigned char reg_index, unsigned char bitfield_index, tRioStatusCode *status) = 0;
+
+
+private:
+   tSPI(const tSPI&);
+   void operator=(const tSPI&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_SPI_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h
new file mode 100644
index 0000000..02db0aa
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/nRoboRIO_FPGANamespace/tSysWatchdog.h
@@ -0,0 +1,109 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+// Do Not Edit... this file is generated!
+
+#ifndef __nFRC_2018_18_0_8_SysWatchdog_h__
+#define __nFRC_2018_18_0_8_SysWatchdog_h__
+
+#include "../tSystem.h"
+#include "../tSystemInterface.h"
+
+namespace nFPGA
+{
+namespace nFRC_2018_18_0_8
+{
+
+class tSysWatchdog
+{
+public:
+   tSysWatchdog(){}
+   virtual ~tSysWatchdog(){}
+
+   virtual tSystemInterface* getSystemInterface() = 0;
+   static tSysWatchdog* create(tRioStatusCode *status);
+
+   typedef enum
+   {
+      kNumSystems = 1,
+   } tIfaceConstants;
+
+   typedef
+   union{
+      struct{
+#ifdef __vxworks
+         unsigned SystemActive : 1;
+         unsigned PowerAlive : 1;
+         unsigned SysDisableCount : 15;
+         unsigned PowerDisableCount : 15;
+#else
+         unsigned PowerDisableCount : 15;
+         unsigned SysDisableCount : 15;
+         unsigned PowerAlive : 1;
+         unsigned SystemActive : 1;
+#endif
+      };
+      struct{
+         unsigned value : 32;
+      };
+   } tStatus;
+
+
+
+   typedef enum
+   {
+   } tStatus_IfaceConstants;
+
+   virtual tStatus readStatus(tRioStatusCode *status) = 0;
+   virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0;
+   virtual bool readStatus_PowerAlive(tRioStatusCode *status) = 0;
+   virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0;
+   virtual unsigned short readStatus_PowerDisableCount(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tCommand_IfaceConstants;
+
+   virtual void writeCommand(unsigned short value, tRioStatusCode *status) = 0;
+   virtual unsigned short readCommand(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tChallenge_IfaceConstants;
+
+   virtual unsigned char readChallenge(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tActive_IfaceConstants;
+
+   virtual void writeActive(bool value, tRioStatusCode *status) = 0;
+   virtual bool readActive(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tTimer_IfaceConstants;
+
+   virtual unsigned int readTimer(tRioStatusCode *status) = 0;
+
+
+   typedef enum
+   {
+   } tForcedKills_IfaceConstants;
+
+   virtual unsigned short readForcedKills(tRioStatusCode *status) = 0;
+
+
+
+
+private:
+   tSysWatchdog(const tSysWatchdog&);
+   void operator=(const tSysWatchdog&);
+};
+
+}
+}
+
+#endif // __nFRC_2018_18_0_8_SysWatchdog_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/printFpgaVersion.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/printFpgaVersion.h
new file mode 100644
index 0000000..9ef9bf4
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/printFpgaVersion.h
@@ -0,0 +1,42 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+
+#ifndef __printFPGAVersion_h__
+#define __printFPGAVersion_h__
+
+namespace nFPGA
+{
+
+template<typename ttGlobal>
+inline void printFPGAVersion(ttGlobal &global)
+{
+   tRioStatusCode cleanStatus=0;
+   uint32_t hardwareGuid[4];
+   tSystemInterface &system = *global.getSystemInterface();
+   system.getHardwareFpgaSignature(hardwareGuid, &cleanStatus);
+   const uint32_t *softwareGuid = system.getExpectedFPGASignature();
+   printf("FPGA Hardware GUID: 0x");
+   for(int i=0; i<4; i++)
+   {
+      printf("%08X", hardwareGuid[i]);
+   }
+   printf("\n");
+   printf("FPGA Software GUID: 0x");
+   for(int i=0; i<4; i++)
+   {
+      printf("%08X", softwareGuid[i]);
+   }
+   printf("\n");
+   uint16_t fpgaHardwareVersion = global.readVersion(&cleanStatus);
+   uint16_t fpgaSoftwareVersion = system.getExpectedFPGAVersion();
+   printf("FPGA Hardware Version: %X\n", fpgaHardwareVersion);
+   printf("FPGA Software Version: %X\n", fpgaSoftwareVersion);
+   uint32_t fpgaHardwareRevision = global.readRevision(&cleanStatus);
+   uint32_t fpgaSoftwareRevision = system.getExpectedFPGARevision();
+   printf("FPGA Hardware Revision: %X.%X.%X\n", (fpgaHardwareRevision >> 20) & 0xFFF, (fpgaHardwareRevision >> 12) & 0xFF, fpgaHardwareRevision & 0xFFF);
+   printf("FPGA Software Revision: %X.%X.%X\n", (fpgaSoftwareRevision >> 20) & 0xFFF, (fpgaSoftwareRevision >> 12) & 0xFF, fpgaSoftwareRevision & 0xFFF);
+}
+
+}
+
+#endif // __printFPGAVersion_h__
+
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tDMAChannelDescriptor.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tDMAChannelDescriptor.h
new file mode 100644
index 0000000..2c7f54e
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tDMAChannelDescriptor.h
@@ -0,0 +1,17 @@
+// Describes the information needed to configure a DMA channel.
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+
+#include <stdint.h>
+
+#ifndef __tDMAChannelDescriptor_h__
+#define __tDMAChannelDescriptor_h__
+
+struct tDMAChannelDescriptor
+{
+   uint32_t channel;
+   uint32_t baseAddress;
+   uint32_t depth;
+   bool targetToHost;
+};
+
+#endif // __tDMAChannelDescriptor_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tDMAManager.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tDMAManager.h
new file mode 100644
index 0000000..7c7f99e
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tDMAManager.h
@@ -0,0 +1,53 @@
+// Class for handling DMA transfers.
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+
+#ifndef __tDMAManager_h__
+#define __tDMAManager_h__
+
+#include "tSystem.h"
+#include <stdint.h>
+
+namespace nFPGA
+{
+class tDMAManager : public tSystem
+{
+public:
+   tDMAManager(uint32_t dmaChannel, uint32_t hostBufferSize, tRioStatusCode *status);
+   ~tDMAManager();
+   void start(tRioStatusCode *status);
+   void stop(tRioStatusCode *status);
+   bool isStarted() {return _started;}
+   void read(
+      uint32_t*      buf,
+      size_t         num,
+      uint32_t       timeout,
+      size_t*        remaining,
+      tRioStatusCode *status);
+   void write(
+      uint32_t*      buf,
+      size_t         num,
+      uint32_t       timeout,
+      size_t*        remaining,
+      tRioStatusCode *status);
+   void read(
+      uint8_t*       buf,
+      size_t         num,
+      uint32_t       timeout,
+      size_t*        remaining,
+      tRioStatusCode *status);
+   void write(
+      uint8_t*       buf,
+      size_t         num,
+      uint32_t       timeout,
+      size_t*        remaining,
+      tRioStatusCode *status);
+private:
+   bool _started;
+   uint32_t _dmaChannel;
+   uint32_t _hostBufferSize;
+
+};
+
+}
+
+#endif // __tDMAManager_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tInterruptManager.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tInterruptManager.h
new file mode 100644
index 0000000..6c84b54
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tInterruptManager.h
@@ -0,0 +1,61 @@
+// Class for handling interrupts.
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+
+#ifndef __tInterruptManager_h__
+#define __tInterruptManager_h__
+
+#include "tSystem.h"
+
+namespace ni
+{
+   namespace dsc
+   {
+      namespace osdep
+      {
+         class CriticalSection;
+      }
+   }
+}
+
+namespace nFPGA
+{
+
+typedef void (*tInterruptHandler)(uint32_t interruptAssertedMask, void *param);
+
+class tInterruptManager : public tSystem
+{
+public:
+   tInterruptManager(uint32_t interruptMask, bool watcher, tRioStatusCode *status);
+   ~tInterruptManager();
+   void registerHandler(tInterruptHandler handler, void *param, tRioStatusCode *status);
+   uint32_t watch(int32_t timeoutInMs, bool ignorePrevious, tRioStatusCode *status);
+   void enable(tRioStatusCode *status);
+   void disable(tRioStatusCode *status);
+   bool isEnabled(tRioStatusCode *status);
+private:
+   class tInterruptThread;
+   friend class tInterruptThread;
+   void handler();
+   static int handlerWrapper(tInterruptManager *pInterrupt);
+
+   void acknowledge(tRioStatusCode *status);
+   void reserve(tRioStatusCode *status);
+   void unreserve(tRioStatusCode *status);
+   tInterruptHandler _handler;
+   uint32_t _interruptMask;
+   tInterruptThread *_thread;
+   NiFpga_IrqContext _rioContext;
+   bool _watcher;
+   bool _enabled;
+   void *_userParam;
+
+   // maintain the interrupts that are already dealt with.
+   static uint32_t _globalInterruptMask;
+   static ni::dsc::osdep::CriticalSection *_globalInterruptMaskSemaphore;
+};
+
+}
+
+
+#endif // __tInterruptManager_h__
+
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tSystem.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tSystem.h
new file mode 100644
index 0000000..cf54b05
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tSystem.h
@@ -0,0 +1,48 @@
+// Base class for generated chip objects
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+
+#ifndef __tSystem_h__
+#define __tSystem_h__
+
+#include "fpgainterfacecapi/NiFpga.h"
+typedef NiFpga_Status tRioStatusCode;
+
+#define FRC_FPGA_PRELOAD_BITFILE
+
+typedef uint32_t NiFpga_Session;
+
+namespace nFPGA
+{
+
+class tSystem
+{
+public:
+   tSystem(tRioStatusCode *status);
+   ~tSystem();
+   void getFpgaGuid(uint32_t *guid_ptr, tRioStatusCode *status);
+   void reset(tRioStatusCode *status);
+
+protected:
+   static NiFpga_Session _DeviceHandle;
+
+#ifdef FRC_FPGA_PRELOAD_BITFILE
+   void NiFpga_SharedOpen_common(const char*     bitfile);
+   NiFpga_Status NiFpga_SharedOpen(const char*     bitfile,
+                            const char*     signature,
+                            const char*     resource,
+                            uint32_t        attribute,
+                            NiFpga_Session* session);
+   NiFpga_Status NiFpgaLv_SharedOpen(const char* const     bitfile,
+                            const char* const     apiSignature,
+                            const char* const     resource,
+                            const uint32_t        attribute,
+                            NiFpga_Session* const session);
+private:
+    static char *_FileName;
+    static char *_Bitfile;
+#endif
+};
+
+}
+
+#endif // __tSystem_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tSystemInterface.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tSystemInterface.h
new file mode 100644
index 0000000..d5a5e63
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_FPGA_ChipObject/tSystemInterface.h
@@ -0,0 +1,30 @@
+// Copyright (c) National Instruments 2008.  All Rights Reserved.
+
+#ifndef __tSystemInterface_h__
+#define __tSystemInterface_h__
+
+#include "tDMAChannelDescriptor.h"
+
+namespace nFPGA
+{
+
+class tSystemInterface
+{
+public:
+   tSystemInterface(){}
+   virtual ~tSystemInterface(){}
+
+   virtual const uint16_t getExpectedFPGAVersion()=0;
+   virtual const uint32_t getExpectedFPGARevision()=0;
+   virtual const uint32_t * const getExpectedFPGASignature()=0;
+   virtual void getHardwareFpgaSignature(uint32_t *guid_ptr, tRioStatusCode *status)=0;
+   virtual uint32_t getLVHandle(tRioStatusCode *status)=0;
+   virtual uint32_t getHandle()=0;
+   virtual void reset(tRioStatusCode *status)=0;
+   virtual void getDmaDescriptor(int dmaChannelDescriptorIndex, tDMAChannelDescriptor *desc)=0;
+};
+
+}
+
+#endif // __tSystemInterface_h__
+
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/AICalibration.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/AICalibration.h
new file mode 100644
index 0000000..39755bd
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/AICalibration.h
@@ -0,0 +1,19 @@
+
+#ifndef __AICalibration_h__
+#define __AICalibration_h__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+	uint32_t FRC_NetworkCommunication_nAICalibration_getLSBWeight(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status);
+	int32_t FRC_NetworkCommunication_nAICalibration_getOffset(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __AICalibration_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/CANInterfacePlugin.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/CANInterfacePlugin.h
new file mode 100644
index 0000000..f3150fb
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/CANInterfacePlugin.h
@@ -0,0 +1,82 @@
+// CANInterfacePlugin.h
+//
+//  Defines the API for building a CAN Interface Plugin to support
+//    PWM-cable-free CAN motor control on FRC robots.  This allows you
+//    to connect any CAN interface to the secure Jaguar CAN driver.
+//
+
+#ifndef __CANInterfacePlugin_h__
+#define __CANInterfacePlugin_h__
+
+#include <stdint.h>
+
+#define CAN_IS_FRAME_REMOTE 0x80000000
+#define CAN_IS_FRAME_11BIT  0x40000000
+#define CAN_29BIT_MESSAGE_ID_MASK 0x1FFFFFFF
+#define CAN_11BIT_MESSAGE_ID_MASK 0x000007FF
+
+class CANInterfacePlugin
+{
+public:
+	CANInterfacePlugin() {}
+	virtual ~CANInterfacePlugin() {}
+
+	/**
+	 * This entry-point of the CANInterfacePlugin is passed a message that the driver needs to send to
+	 * a device on the CAN bus.
+	 * 
+	 * This function may be called from multiple contexts and must therefore be reentrant.
+	 * 
+	 * @param messageID The 29-bit CAN message ID in the lsbs.  The msb can indicate a remote frame.
+	 * @param data A pointer to a buffer containing between 0 and 8 bytes to send with the message.  May be NULL if dataSize is 0.
+	 * @param dataSize The number of bytes to send with the message.
+	 * @return Return any error code.  On success return 0.
+	 */
+	virtual int32_t sendMessage(uint32_t messageID, const uint8_t *data, uint8_t dataSize) = 0;
+
+	/**
+	 * This entry-point of the CANInterfacePlugin is passed buffers which should be populated with
+	 * any received messages from devices on the CAN bus.
+	 * 
+	 * This function is always called by a single task in the Jaguar driver, so it need not be reentrant.
+	 * 
+	 * This function is expected to block for some period of time waiting for a message from the CAN bus.
+	 * It may timeout periodically (returning non-zero to indicate no message was populated) to allow for
+	 * shutdown and unloading of the plugin.
+	 * 
+	 * @param messageID A reference to be populated with a received 29-bit CAN message ID in the lsbs.
+	 * @param data A pointer to a buffer of 8 bytes to be populated with data received with the message.
+	 * @param dataSize A reference to be populated with the size of the data received (0 - 8 bytes).
+	 * @return This should return 0 if a message was populated, non-0 if no message was not populated.
+	 */
+	virtual int32_t receiveMessage(uint32_t &messageID, uint8_t *data, uint8_t &dataSize) = 0;
+
+#if defined(__linux)
+	/**
+	 * This entry-point of the CANInterfacePlugin returns status of the CAN bus.
+	 * 
+	 * This function may be called from multiple contexts and must therefore be reentrant.
+	 * 
+	 * This function will return detailed hardware status if available for diagnostics of the CAN interface.
+	 * 
+	 * @param busOffCount The number of times that sendMessage failed with a busOff error indicating that messages
+	 *  are not successfully transmitted on the bus.
+	 * @param txFullCount The number of times that sendMessage failed with a txFifoFull error indicating that messages
+	 *  are not successfully received by any CAN device.
+	 * @param receiveErrorCount The count of receive errors as reported by the CAN driver.
+	 * @param transmitErrorCount The count of transmit errors as reported by the CAN driver.
+	 * @return This should return 0 if all status was retrieved successfully or an error code if not.
+	 */
+	virtual int32_t getStatus(uint32_t &busOffCount, uint32_t &txFullCount, uint32_t &receiveErrorCount, uint32_t &transmitErrorCount) {return 0;}
+#endif
+};
+
+/**
+ * This function allows you to register a CANInterfacePlugin to provide access a CAN bus.
+ * 
+ * @param interface A pointer to an object that inherits from CANInterfacePlugin and implements
+ * the pure virtual interface.  If NULL, unregister the current plugin.
+ */
+void FRC_NetworkCommunication_CANSessionMux_registerInterface(CANInterfacePlugin* interface);
+
+#endif // __CANInterfacePlugin_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/CANSessionMux.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/CANSessionMux.h
new file mode 100644
index 0000000..fe4cde0
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/CANSessionMux.h
@@ -0,0 +1,66 @@
+// CANSessionMux.h
+//
+//  Defines the API for building a CAN Interface Plugin to support
+//    PWM-cable-free CAN motor control on FRC robots.  This allows you
+//    to connect any CAN interface to the secure Jaguar CAN driver.
+//
+
+#ifndef __CANSessionMux_h__
+#define __CANSessionMux_h__
+
+#if defined(__vxworks)
+#include <vxWorks.h>
+#else
+#include <stdint.h>
+#endif
+
+#define CAN_SEND_PERIOD_NO_REPEAT 0
+#define CAN_SEND_PERIOD_STOP_REPEATING -1
+
+/* Flags in the upper bits of the messageID */
+#define CAN_IS_FRAME_REMOTE 0x80000000
+#define CAN_IS_FRAME_11BIT  0x40000000
+
+#define ERR_CANSessionMux_InvalidBuffer   -44086
+#define ERR_CANSessionMux_MessageNotFound -44087
+#define WARN_CANSessionMux_NoToken         44087
+#define ERR_CANSessionMux_NotAllowed      -44088
+#define ERR_CANSessionMux_NotInitialized  -44089
+#define ERR_CANSessionMux_SessionOverrun   44050
+
+struct tCANStreamMessage{
+	uint32_t messageID;
+	uint32_t timeStamp;
+	uint8_t data[8];
+	uint8_t dataSize;
+};
+
+#ifdef __cplusplus
+namespace nCANSessionMux
+{
+	void sendMessage_wrapper(uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t periodMs, int32_t *status);
+	void receiveMessage_wrapper(uint32_t *messageID, uint32_t messageIDMask, uint8_t *data, uint8_t *dataSize, uint32_t *timeStamp, int32_t *status);
+	void openStreamSession(uint32_t *sessionHandle, uint32_t messageID, uint32_t messageIDMask, uint32_t maxMessages, int32_t *status);
+	void closeStreamSession(uint32_t sessionHandle);
+	void readStreamSession(uint32_t sessionHandle, struct tCANStreamMessage *messages, uint32_t messagesToRead, uint32_t *messagesRead, int32_t *status);
+	void getCANStatus(float *percentBusUtilization, uint32_t *busOffCount, uint32_t *txFullCount, uint32_t *receiveErrorCount, uint32_t *transmitErrorCount, int32_t *status);
+}
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+	void FRC_NetworkCommunication_CANSessionMux_sendMessage(uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t periodMs, int32_t *status);
+	void FRC_NetworkCommunication_CANSessionMux_receiveMessage(uint32_t *messageID, uint32_t messageIDMask, uint8_t *data, uint8_t *dataSize, uint32_t *timeStamp, int32_t *status);
+	void FRC_NetworkCommunication_CANSessionMux_openStreamSession(uint32_t *sessionHandle, uint32_t messageID, uint32_t messageIDMask, uint32_t maxMessages, int32_t *status);
+	void FRC_NetworkCommunication_CANSessionMux_closeStreamSession(uint32_t sessionHandle);
+	void FRC_NetworkCommunication_CANSessionMux_readStreamSession(uint32_t sessionHandle, struct tCANStreamMessage *messages, uint32_t messagesToRead, uint32_t *messagesRead, int32_t *status);
+	void FRC_NetworkCommunication_CANSessionMux_getCANStatus(float *percentBusUtilization, uint32_t *busOffCount, uint32_t *txFullCount, uint32_t *receiveErrorCount, uint32_t *transmitErrorCount, int32_t *status);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __CANSessionMux_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/FRCComm.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/FRCComm.h
new file mode 100644
index 0000000..27220cb
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/FRCComm.h
@@ -0,0 +1,165 @@
+/*************************************************************
+ * 					NOTICE
+ * 
+ * 	These are the only externally exposed functions to the
+ *   NetworkCommunication library
+ * 
+ * This is an implementation of FRC Spec for Comm Protocol
+ * Revision 4.5, June 30, 2008
+ *
+ * Copyright (c) National Instruments 2008.  All Rights Reserved.
+ * 
+ *************************************************************/
+
+#ifndef __FRC_COMM_H__
+#define __FRC_COMM_H__
+
+#ifdef _WIN32
+#include <windows.h>
+#ifdef USE_THRIFT
+#  define EXPORT_FUNC
+# else
+#  define EXPORT_FUNC __declspec(dllexport) __cdecl
+# endif
+#elif defined(__vxworks)
+# include <vxWorks.h>
+# define EXPORT_FUNC
+#elif defined(__linux)
+# include <stdint.h>
+# include <pthread.h>
+# define EXPORT_FUNC
+#endif
+
+#define ERR_FRCSystem_NetCommNotResponding -44049
+#define ERR_FRCSystem_NoDSConnection -44018
+
+#ifdef _WIN32
+# define __DEPRECATED__ __declspec(deprecated)
+#else
+# define __DEPRECATED__ __attribute__((__deprecated__))
+#endif
+
+enum AllianceStationID_t {
+	kAllianceStationID_red1,
+	kAllianceStationID_red2,
+	kAllianceStationID_red3,
+	kAllianceStationID_blue1,
+	kAllianceStationID_blue2,
+	kAllianceStationID_blue3,
+};
+
+enum MatchType_t {
+	kMatchType_none,
+	kMatchType_practice,
+	kMatchType_qualification,
+	kMatchType_elimination,
+};
+
+struct ControlWord_t {
+#ifndef __vxworks
+	uint32_t enabled : 1;
+	uint32_t autonomous : 1;
+	uint32_t test :1;
+	uint32_t eStop : 1;
+	uint32_t fmsAttached:1;
+	uint32_t dsAttached:1;
+	uint32_t control_reserved : 26;
+#else
+	uint32_t control_reserved : 26;
+	uint32_t dsAttached:1;
+	uint32_t fmsAttached:1;
+	uint32_t eStop : 1;
+	uint32_t test :1;
+	uint32_t autonomous : 1;
+	uint32_t enabled : 1;
+#endif
+};
+
+struct JoystickAxes_t {
+	uint16_t count;
+	int16_t axes[1];
+};
+
+struct JoystickPOV_t {
+	uint16_t count;
+	int16_t povs[1];
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+	int EXPORT_FUNC FRC_NetworkCommunication_Reserve(void *instance);
+#ifndef SIMULATION
+	void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision);
+#endif
+	/**
+	 * Safely copy data into the status packet to be sent back to the driver station.
+	 * @deprecated battery is the only parameter to this function that is still used, and only on cRIO / simulation.
+	 */
+	__DEPRECATED__ int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber,
+			const char *userDataHigh, int userDataHighLength,
+			const char *userDataLow, int userDataLowLength, int wait_ms);
+	/**
+	 * Send error data to the DS
+	 * @deprecated This old method is hard to parse on the DS side. It will be removed soon. Use FRC_NetworkCommunication_sendError instead.
+	 * @param errorData is a cstr of the error message
+	 * @param errorDataLength is the length of the errorData
+	 * @param wait_ms is ignored (included for binary compatibility)
+	 * @return 0 on success, 1 on no DS connection
+	 */
+	__DEPRECATED__ int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms);
+
+	/**
+	 * Send a console output line to the Driver Station
+	 * @param line a null-terminated string
+	 * @return 0 on success, other on failure
+	 */
+	int EXPORT_FUNC FRC_NetworkCommunication_sendConsoleLine(const char *line);
+
+	/**
+	 * Send an error to the Driver Station
+	 * @param isError true if error, false if warning
+	 * @param errorCode value of error condition
+	 * @param isLVCode true if error code is defined in errors.txt, false if not (i.e. made up for C++)
+	 * @param details error description that contains details such as which resource number caused the failure
+	 * @param location Source file, function, and line number that the error was generated - optional
+	 * @param callStack The details about what functions were called through before the error was reported - optional
+	 * @return 0 on success, other on failure
+	 */
+	int EXPORT_FUNC FRC_NetworkCommunication_sendError(int isError, int32_t errorCode, int isLVCode,
+		const char *details, const char *location, const char *callStack);
+
+#ifdef _WIN32
+	void EXPORT_FUNC setNewDataSem(HANDLE);
+#elif defined (__vxworks)
+	void EXPORT_FUNC setNewDataSem(SEM_ID);
+#else
+	void EXPORT_FUNC setNewDataSem(pthread_cond_t *);
+#endif
+
+	// this uint32_t is really a LVRefNum
+	int EXPORT_FUNC setNewDataOccurRef(uint32_t refnum);
+
+	int EXPORT_FUNC FRC_NetworkCommunication_getControlWord(struct ControlWord_t *controlWord);
+	int EXPORT_FUNC FRC_NetworkCommunication_getAllianceStation(enum AllianceStationID_t *allianceStation);
+	int EXPORT_FUNC FRC_NetworkCommunication_getMatchInfo(char *eventName, enum MatchType_t *matchType, uint16_t *matchNumber, uint8_t *replayNumber,
+		uint8_t *gameSpecificMessage, uint16_t *gameSpecificMessageSize);
+	int EXPORT_FUNC FRC_NetworkCommunication_getMatchTime(float *matchTime);
+	int EXPORT_FUNC FRC_NetworkCommunication_getJoystickAxes(uint8_t joystickNum, struct JoystickAxes_t *axes, uint8_t maxAxes);
+	int EXPORT_FUNC FRC_NetworkCommunication_getJoystickButtons(uint8_t joystickNum, uint32_t *buttons, uint8_t *count);
+	int EXPORT_FUNC FRC_NetworkCommunication_getJoystickPOVs(uint8_t joystickNum, struct JoystickPOV_t *povs, uint8_t maxPOVs);
+	int EXPORT_FUNC FRC_NetworkCommunication_setJoystickOutputs(uint8_t joystickNum, uint32_t hidOutputs, uint16_t leftRumble, uint16_t rightRumble);
+	int EXPORT_FUNC FRC_NetworkCommunication_getJoystickDesc(uint8_t joystickNum, uint8_t *isXBox, uint8_t *type, char *name,
+		uint8_t *axisCount, uint8_t *axisTypes, uint8_t *buttonCount, uint8_t *povCount);
+
+	void EXPORT_FUNC FRC_NetworkCommunication_getVersionString(char *version);
+	int EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramStarting(void);
+	void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramDisabled(void);
+	void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void);
+	void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void);
+	void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void);
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/LoadOut.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/LoadOut.h
new file mode 100644
index 0000000..97fbe51
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/LoadOut.h
@@ -0,0 +1,58 @@
+
+#ifndef __LoadOut_h__
+#define __LoadOut_h__
+
+#ifdef _WIN32
+#include <windows.h>
+#define EXPORT_FUNC __declspec(dllexport) __cdecl
+#elif defined (__vxworks)
+#include <vxWorks.h>
+#define EXPORT_FUNC
+#else
+#include <stdint.h>
+#define EXPORT_FUNC
+#endif
+
+#define kMaxModuleNumber 2
+namespace nLoadOut
+{
+#if defined(__vxworks) || defined(SIMULATION)
+    typedef enum {
+        kModuleType_Unknown = 0x00,
+        kModuleType_Analog = 0x01,
+        kModuleType_Digital = 0x02,
+        kModuleType_Solenoid = 0x03,
+    } tModuleType;
+    bool EXPORT_FUNC getModulePresence(tModuleType moduleType, uint8_t moduleNumber);
+#endif
+    typedef enum {
+        kTargetClass_Unknown = 0x00,
+        kTargetClass_FRC1 = 0x10,
+        kTargetClass_FRC2 = 0x20,
+        kTargetClass_FRC3 = 0x30,
+        kTargetClass_RoboRIO = 0x40,
+#if defined(__vxworks) || defined(SIMULATION)
+        kTargetClass_FRC2_Analog = kTargetClass_FRC2 | kModuleType_Analog,
+        kTargetClass_FRC2_Digital = kTargetClass_FRC2 | kModuleType_Digital,
+        kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | kModuleType_Solenoid,
+#endif
+        kTargetClass_FamilyMask = 0xF0,
+        kTargetClass_ModuleMask = 0x0F,
+    } tTargetClass;
+    tTargetClass EXPORT_FUNC getTargetClass();
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__vxworks) || defined(SIMULATION)
+    uint32_t EXPORT_FUNC FRC_NetworkCommunication_nLoadOut_getModulePresence(uint32_t moduleType, uint8_t moduleNumber);
+#endif
+    uint32_t EXPORT_FUNC FRC_NetworkCommunication_nLoadOut_getTargetClass();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __LoadOut_h__
diff --git a/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/NetCommRPCProxy_Occur.h b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/NetCommRPCProxy_Occur.h
new file mode 100644
index 0000000..bfb44fc
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/include/FRC_NetworkCommunication/NetCommRPCProxy_Occur.h
@@ -0,0 +1,11 @@
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void NetCommRPCProxy_SetOccurFuncPointer(void (*Occur)(uint32_t));
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/third_party/allwpilib_2018/ni-libraries/publish.gradle b/third_party/allwpilib_2018/ni-libraries/publish.gradle
new file mode 100644
index 0000000..087f826
--- /dev/null
+++ b/third_party/allwpilib_2018/ni-libraries/publish.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'maven-publish'

+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'

+

+if (!hasProperty('releaseType')) {

+    WPILibVersion {

+        releaseType = 'dev'

+    }

+}

+

+def pubVersion

+if (project.hasProperty("publishVersion")) {

+    pubVersion = project.publishVersion

+} else {

+    pubVersion = WPILibVersion.version

+}

+

+def baseArtifactId = 'ni-libraries'

+def artifactGroupId = 'edu.wpi.first.ni-libraries'

+

+publishing {

+  publications {

+    nilibraries(MavenPublication) {

+      artifact libZip

+      artifact headersZip

+

+      artifactId = "${baseArtifactId}"

+      groupId artifactGroupId

+      version pubVersion

+    }

+  }

+}

diff --git a/third_party/allwpilib_2018/settings.gradle b/third_party/allwpilib_2018/settings.gradle
new file mode 100644
index 0000000..a787eb7
--- /dev/null
+++ b/third_party/allwpilib_2018/settings.gradle
@@ -0,0 +1,14 @@
+include 'gmock'
+include 'ni-libraries'
+include 'hal'
+include 'wpilibc'
+include 'wpilibcIntegrationTests'
+include 'wpilibcExamples'
+include 'wpilibj'
+include 'wpilibjIntegrationTests'
+include 'wpilibjExamples'
+include 'myRobot'
+include 'simulation:halsim_print'
+include 'simulation:halsim_lowfi'
+include 'simulation:adx_gyro_accelerometer'
+include 'simulation:halsim_ds_nt'
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/build.gradle b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/build.gradle
new file mode 100644
index 0000000..8b79a15
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/build.gradle
@@ -0,0 +1,59 @@
+description = "A simulation library for the ADXL345 I2C and SPI Accelerometer, ADXL362 SPI Accelerometer, and ADXRS450 SPI Gyro"
+
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'cpp'
+
+
+if (!project.hasProperty('onlyAthena')) {
+    ext.skipAthena = true
+
+    apply from: "../../config.gradle"
+
+
+    model {
+        dependencyConfigs {
+            wpiutil(DependencyConfig) {
+                groupId = 'edu.wpi.first.wpiutil'
+                artifactId = 'wpiutil-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.+'
+                sharedConfigs = [ halsim_adx_gyro_accelerometer: [] ]
+            }
+        }
+        exportsConfigs {
+            halsim_adx_gyro_accelerometer(ExportsConfig) {
+                x86ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                      '_CT??_R0?AVbad_cast',
+                                      '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                      '_TI5?AVfailure' ]
+                x64ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                      '_CT??_R0?AVbad_cast',
+                                      '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                      '_TI5?AVfailure' ]
+            }
+        }
+        components {
+            halsim_adx_gyro_accelerometer(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = [ 'src/main/native/cpp' ]
+                            includes = ["**/*.cpp"]
+                        }
+                        exportedHeaders {
+                            srcDirs = ["src/main/native/include"]
+                        }
+                    }
+                }
+            }
+        }
+
+        binaries {
+            all {
+                project(':hal').addHalToLinker(it)
+            }
+        }
+    }
+    apply from: 'publish.gradle'
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/publish.gradle b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/publish.gradle
new file mode 100644
index 0000000..c48466b
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/publish.gradle
@@ -0,0 +1,71 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'halsim-adx_gyro_accelerometer'
+def artifactGroupId = 'edu.wpi.first.halsim'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-adx_gyro_accelerometer'
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-adx_gyro_accelerometer'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+build.dependsOn cppSourcesZip
+build.dependsOn cppHeadersZip
+
+model {
+    publishing {
+        def libSpec = createComponentZipTasks($.components, 'halsim_adx_gyro_accelerometer', 'zipcpp', Zip, project, includeStandardZipFormat)
+
+        publications {
+            cpp(MavenPublication) {
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+
+                libSpec.each {
+                    artifact it
+                }
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL345_I2CAccelerometerData.cpp b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL345_I2CAccelerometerData.cpp
new file mode 100644
index 0000000..bf84b6f
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL345_I2CAccelerometerData.cpp
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL345_I2CAccelerometerData.h"
+
+#include <cstring>
+
+#include "MockData/I2CData.h"
+
+using namespace hal;
+
+const double ADXL345_I2CData::LSB = 1 / 0.00390625;
+
+static void ADXL345I2C_ReadBufferCallback(const char* name, void* param,
+                                          uint8_t* buffer, uint32_t count) {
+  ADXL345_I2CData* sim = static_cast<ADXL345_I2CData*>(param);
+  sim->HandleRead(buffer, count);
+}
+
+static void ADXL345I2C_WriteBufferCallback(const char* name, void* param,
+                                           const uint8_t* buffer,
+                                           uint32_t count) {
+  ADXL345_I2CData* sim = static_cast<ADXL345_I2CData*>(param);
+  sim->HandleWrite(buffer, count);
+}
+
+ADXL345_I2CData::ADXL345_I2CData(int port) : m_port(port) {
+  m_readCallbackId =
+      HALSIM_RegisterI2CReadCallback(port, ADXL345I2C_ReadBufferCallback, this);
+  m_writeCallbackId = HALSIM_RegisterI2CWriteCallback(
+      port, ADXL345I2C_WriteBufferCallback, this);
+}
+
+ADXL345_I2CData::~ADXL345_I2CData() {
+  HALSIM_CancelI2CReadCallback(m_port, m_readCallbackId);
+  HALSIM_CancelI2CWriteCallback(m_port, m_writeCallbackId);
+}
+
+void ADXL345_I2CData::ADXL345_I2CData::HandleWrite(const uint8_t* buffer,
+                                                   uint32_t count) {
+  m_lastWriteAddress = buffer[0];
+}
+
+void ADXL345_I2CData::HandleRead(uint8_t* buffer, uint32_t count) {
+  bool writeAll = count == 6;
+  int byteIndex = 0;
+
+  if (writeAll || m_lastWriteAddress == 0x32) {
+    int16_t val = static_cast<int16_t>(GetX() * LSB);
+    std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+    byteIndex += sizeof(val);
+  }
+
+  if (writeAll || m_lastWriteAddress == 0x34) {
+    int16_t val = static_cast<int16_t>(GetY() * LSB);
+    std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+    byteIndex += sizeof(val);
+  }
+
+  if (writeAll || m_lastWriteAddress == 0x36) {
+    int16_t val = static_cast<int16_t>(GetZ() * LSB);
+    std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+    byteIndex += sizeof(val);
+  }
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL345_SpiAccelerometerData.cpp b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL345_SpiAccelerometerData.cpp
new file mode 100644
index 0000000..5c8e2e2
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL345_SpiAccelerometerData.cpp
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL345_SpiAccelerometerData.h"
+
+#include <cstring>
+
+#include "MockData/SPIData.h"
+
+using namespace hal;
+
+const double ADXL345_SpiAccelerometer::LSB = 1 / 0.00390625;
+
+static void ADXL345SPI_ReadBufferCallback(const char* name, void* param,
+                                          uint8_t* buffer, uint32_t count) {
+  ADXL345_SpiAccelerometer* sim = static_cast<ADXL345_SpiAccelerometer*>(param);
+  sim->HandleRead(buffer, count);
+}
+
+static void ADXL345SPI_WriteBufferCallback(const char* name, void* param,
+                                           const uint8_t* buffer,
+                                           uint32_t count) {
+  ADXL345_SpiAccelerometer* sim = static_cast<ADXL345_SpiAccelerometer*>(param);
+  sim->HandleWrite(buffer, count);
+}
+
+ADXL345_SpiAccelerometer::ADXL345_SpiAccelerometer(int port) : m_port(port) {
+  m_readCallbackId =
+      HALSIM_RegisterSPIReadCallback(port, ADXL345SPI_ReadBufferCallback, this);
+  m_writeCallbackId = HALSIM_RegisterSPIWriteCallback(
+      port, ADXL345SPI_WriteBufferCallback, this);
+}
+
+ADXL345_SpiAccelerometer::~ADXL345_SpiAccelerometer() {
+  HALSIM_CancelSPIReadCallback(m_port, m_readCallbackId);
+  HALSIM_CancelSPIWriteCallback(m_port, m_writeCallbackId);
+}
+
+void ADXL345_SpiAccelerometer::HandleWrite(const uint8_t* buffer,
+                                           uint32_t count) {
+  m_lastWriteAddress = buffer[0] & 0xF;
+}
+
+void ADXL345_SpiAccelerometer::HandleRead(uint8_t* buffer, uint32_t count) {
+  bool writeAll = count == 7;
+  int byteIndex = 1;
+
+  if (writeAll || m_lastWriteAddress == 0x02) {
+    int16_t val = static_cast<int16_t>(GetX() * LSB);
+    std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+    byteIndex += sizeof(val);
+  }
+
+  if (writeAll || m_lastWriteAddress == 0x04) {
+    int16_t val = static_cast<int16_t>(GetY() * LSB);
+    std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+    byteIndex += sizeof(val);
+  }
+
+  if (writeAll || m_lastWriteAddress == 0x06) {
+    int16_t val = static_cast<int16_t>(GetZ() * LSB);
+    std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+    byteIndex += sizeof(val);
+  }
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL362_SpiAccelerometerData.cpp b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL362_SpiAccelerometerData.cpp
new file mode 100644
index 0000000..e0f27d3
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXL362_SpiAccelerometerData.cpp
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL362_SpiAccelerometerData.h"
+
+#include <cstring>
+
+#include "MockData/SPIData.h"
+
+using namespace hal;
+
+const double ADXL362_SpiAccelerometer::LSB = 1 / 0.001;
+
+static void ADXL362SPI_ReadBufferCallback(const char* name, void* param,
+                                          uint8_t* buffer, uint32_t count) {
+  ADXL362_SpiAccelerometer* sim = static_cast<ADXL362_SpiAccelerometer*>(param);
+  sim->HandleRead(buffer, count);
+}
+
+static void ADXL362SPI_WriteBufferCallback(const char* name, void* param,
+                                           const uint8_t* buffer,
+                                           uint32_t count) {
+  ADXL362_SpiAccelerometer* sim = static_cast<ADXL362_SpiAccelerometer*>(param);
+  sim->HandleWrite(buffer, count);
+}
+
+ADXL362_SpiAccelerometer::ADXL362_SpiAccelerometer(int port) : m_port(port) {
+  m_readCallbackId =
+      HALSIM_RegisterSPIReadCallback(port, ADXL362SPI_ReadBufferCallback, this);
+  m_writeCallbackId = HALSIM_RegisterSPIWriteCallback(
+      port, ADXL362SPI_WriteBufferCallback, this);
+}
+
+ADXL362_SpiAccelerometer::~ADXL362_SpiAccelerometer() {
+  HALSIM_CancelSPIReadCallback(m_port, m_readCallbackId);
+  HALSIM_CancelSPIWriteCallback(m_port, m_writeCallbackId);
+}
+
+void ADXL362_SpiAccelerometer::HandleWrite(const uint8_t* buffer,
+                                           uint32_t count) {
+  m_lastWriteAddress = buffer[1];
+}
+
+void ADXL362_SpiAccelerometer::HandleRead(uint8_t* buffer, uint32_t count) {
+  // Init check
+  if (m_lastWriteAddress == 0x02) {
+    uint32_t numToPut = 0xF20000;
+    std::memcpy(&buffer[0], &numToPut, sizeof(numToPut));
+  } else {
+    // Get Accelerations
+    bool writeAll = count == 8;
+    int byteIndex = 2;
+
+    if (writeAll || m_lastWriteAddress == 0x0E) {
+      int16_t val = static_cast<int16_t>(GetX() * LSB);
+      std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+      byteIndex += sizeof(val);
+    }
+
+    if (writeAll || m_lastWriteAddress == 0x10) {
+      int16_t val = static_cast<int16_t>(GetY() * LSB);
+      std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+      byteIndex += sizeof(val);
+    }
+
+    if (writeAll || m_lastWriteAddress == 0x12) {
+      int16_t val = static_cast<int16_t>(GetZ() * LSB);
+      std::memcpy(&buffer[byteIndex], &val, sizeof(val));
+      byteIndex += sizeof(val);
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXRS450_SpiGyroWrapperData.cpp b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXRS450_SpiGyroWrapperData.cpp
new file mode 100644
index 0000000..c97436c
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ADXRS450_SpiGyroWrapperData.cpp
@@ -0,0 +1,149 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXRS450_SpiGyroWrapperData.h"
+
+#include <algorithm>
+#include <cmath>
+#include <cstring>
+
+#include "MockData/NotifyCallbackHelpers.h"
+#include "MockData/SPIData.h"
+
+#ifdef _WIN32
+#include "Winsock2.h"
+#pragma comment(lib, "ws2_32.lib")
+#else
+#include <arpa/inet.h>
+#endif
+
+using namespace hal;
+
+const double ADXRS450_SpiGyroWrapper::kAngleLsb = 1 / 0.0125 / 0.0005;
+const double ADXRS450_SpiGyroWrapper::kMaxAngleDeltaPerMessage = 0.1875;
+const int ADXRS450_SpiGyroWrapper::kPacketSize = 4;
+
+template <class T>
+constexpr const T& clamp(const T& value, const T& low, const T& high) {
+  return std::max(low, std::min(value, high));
+}
+
+static void ADXRS450SPI_ReadBufferCallback(const char* name, void* param,
+                                           uint8_t* buffer, uint32_t count) {
+  auto sim = static_cast<ADXRS450_SpiGyroWrapper*>(param);
+  sim->HandleRead(buffer, count);
+}
+
+static void ADXRS450SPI_ReadAutoReceivedData(const char* name, void* param,
+                                             uint8_t* buffer, int32_t numToRead,
+                                             int32_t* outputCount) {
+  auto sim = static_cast<ADXRS450_SpiGyroWrapper*>(param);
+  sim->HandleAutoReceiveData(buffer, numToRead, *outputCount);
+}
+
+ADXRS450_SpiGyroWrapper::ADXRS450_SpiGyroWrapper(int port) : m_port(port) {
+  m_readCallbackId = HALSIM_RegisterSPIReadCallback(
+      port, ADXRS450SPI_ReadBufferCallback, this);
+  m_autoReceiveReadCallbackId = HALSIM_RegisterSPIReadAutoReceivedDataCallback(
+      port, ADXRS450SPI_ReadAutoReceivedData, this);
+}
+
+ADXRS450_SpiGyroWrapper::~ADXRS450_SpiGyroWrapper() {
+  HALSIM_CancelSPIReadCallback(m_port, m_readCallbackId);
+  HALSIM_CancelSPIReadAutoReceivedDataCallback(m_port,
+                                               m_autoReceiveReadCallbackId);
+}
+
+void ADXRS450_SpiGyroWrapper::ResetData() {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  m_angle = 0;
+  m_angleDiff = 0;
+  m_angleCallbacks = nullptr;
+}
+
+void ADXRS450_SpiGyroWrapper::HandleRead(uint8_t* buffer, uint32_t count) {
+  int returnCode = 0x00400AE0;
+  std::memcpy(&buffer[0], &returnCode, sizeof(returnCode));
+}
+
+void ADXRS450_SpiGyroWrapper::HandleAutoReceiveData(uint8_t* buffer,
+                                                    int32_t numToRead,
+                                                    int32_t& outputCount) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  int32_t messagesToSend = std::abs(
+      m_angleDiff > 0 ? std::ceil(m_angleDiff / kMaxAngleDeltaPerMessage)
+                      : std::floor(m_angleDiff / kMaxAngleDeltaPerMessage));
+
+  // Zero gets passed in during the "How much data do I need to read" step.
+  // Else it is actually reading the accumulator
+  if (numToRead == 0) {
+    outputCount = messagesToSend * kPacketSize;
+    return;
+  }
+
+  int valuesToRead = numToRead / kPacketSize;
+  std::memset(&buffer[0], 0, numToRead);
+
+  int msgCtr = 0;
+
+  while (msgCtr < valuesToRead) {
+    double cappedDiff =
+        clamp(m_angleDiff, -kMaxAngleDeltaPerMessage, kMaxAngleDeltaPerMessage);
+
+    int32_t valueToSend =
+        ((static_cast<int32_t>(cappedDiff * kAngleLsb) << 10) & (~0x0C00000E)) |
+        0x04000000;
+    valueToSend = ntohl(valueToSend);
+
+    std::memcpy(&buffer[msgCtr * kPacketSize], &valueToSend,
+                sizeof(valueToSend));
+
+    m_angleDiff -= cappedDiff;
+    msgCtr += 1;
+  }
+}
+
+int32_t ADXRS450_SpiGyroWrapper::RegisterAngleCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_angleCallbacks =
+        RegisterCallback(m_angleCallbacks, "Angle", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetAngle());
+    callback("Angle", param, &value);
+  }
+  return newUid;
+}
+
+void ADXRS450_SpiGyroWrapper::CancelAngleCallback(int32_t uid) {
+  m_angleCallbacks = CancelCallback(m_angleCallbacks, uid);
+}
+
+void ADXRS450_SpiGyroWrapper::InvokeAngleCallback(HAL_Value value) {
+  InvokeCallback(m_angleCallbacks, "Angle", &value);
+}
+
+double ADXRS450_SpiGyroWrapper::GetAngle() {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  return m_angle;
+}
+
+void ADXRS450_SpiGyroWrapper::SetAngle(double angle) {
+  std::lock_guard<wpi::mutex> lock(m_dataMutex);
+  if (m_angle != angle) {
+    InvokeAngleCallback(MakeDouble(angle));
+
+    m_angleDiff += angle - m_angle;
+    m_angle = angle;
+  }
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ThreeAxisAccelerometerData.cpp b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ThreeAxisAccelerometerData.cpp
new file mode 100644
index 0000000..38e274e
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/cpp/ThreeAxisAccelerometerData.cpp
@@ -0,0 +1,129 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ThreeAxisAccelerometerData.h"
+
+#include "MockData/NotifyCallbackHelpers.h"
+
+using namespace hal;
+
+ThreeAxisAccelerometerData::ThreeAxisAccelerometerData() {}
+
+ThreeAxisAccelerometerData::~ThreeAxisAccelerometerData() {}
+void ThreeAxisAccelerometerData::ResetData() {
+  m_x = 0.0;
+  m_xCallbacks = nullptr;
+  m_y = 0.0;
+  m_yCallbacks = nullptr;
+  m_z = 0.0;
+  m_zCallbacks = nullptr;
+}
+
+int32_t ThreeAxisAccelerometerData::RegisterXCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_xCallbacks =
+        RegisterCallback(m_xCallbacks, "X", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetX());
+    callback("X", param, &value);
+  }
+  return newUid;
+}
+
+void ThreeAxisAccelerometerData::CancelXCallback(int32_t uid) {
+  m_xCallbacks = CancelCallback(m_xCallbacks, uid);
+}
+
+void ThreeAxisAccelerometerData::InvokeXCallback(HAL_Value value) {
+  InvokeCallback(m_xCallbacks, "X", &value);
+}
+
+double ThreeAxisAccelerometerData::GetX() { return m_x; }
+
+void ThreeAxisAccelerometerData::SetX(double x) {
+  double oldValue = m_x.exchange(x);
+  if (oldValue != x) {
+    InvokeXCallback(MakeDouble(x));
+  }
+}
+
+int32_t ThreeAxisAccelerometerData::RegisterYCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_yCallbacks =
+        RegisterCallback(m_yCallbacks, "Y", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetY());
+    callback("Y", param, &value);
+  }
+  return newUid;
+}
+
+void ThreeAxisAccelerometerData::CancelYCallback(int32_t uid) {
+  m_yCallbacks = CancelCallback(m_yCallbacks, uid);
+}
+
+void ThreeAxisAccelerometerData::InvokeYCallback(HAL_Value value) {
+  InvokeCallback(m_yCallbacks, "Y", &value);
+}
+
+double ThreeAxisAccelerometerData::GetY() { return m_y; }
+
+void ThreeAxisAccelerometerData::SetY(double y) {
+  double oldValue = m_y.exchange(y);
+  if (oldValue != y) {
+    InvokeYCallback(MakeDouble(y));
+  }
+}
+
+int32_t ThreeAxisAccelerometerData::RegisterZCallback(
+    HAL_NotifyCallback callback, void* param, HAL_Bool initialNotify) {
+  // Must return -1 on a null callback for error handling
+  if (callback == nullptr) return -1;
+  int32_t newUid = 0;
+  {
+    std::lock_guard<wpi::mutex> lock(m_registerMutex);
+    m_zCallbacks =
+        RegisterCallback(m_zCallbacks, "Z", callback, param, &newUid);
+  }
+  if (initialNotify) {
+    // We know that the callback is not null because of earlier null check
+    HAL_Value value = MakeDouble(GetZ());
+    callback("Z", param, &value);
+  }
+  return newUid;
+}
+
+void ThreeAxisAccelerometerData::CancelZCallback(int32_t uid) {
+  m_zCallbacks = CancelCallback(m_zCallbacks, uid);
+}
+
+void ThreeAxisAccelerometerData::InvokeZCallback(HAL_Value value) {
+  InvokeCallback(m_zCallbacks, "Z", &value);
+}
+
+double ThreeAxisAccelerometerData::GetZ() { return m_z; }
+
+void ThreeAxisAccelerometerData::SetZ(double z) {
+  double oldValue = m_z.exchange(z);
+  if (oldValue != z) {
+    InvokeZCallback(MakeDouble(z));
+  }
+}
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL345_I2CAccelerometerData.h b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL345_I2CAccelerometerData.h
new file mode 100644
index 0000000..ad150b9
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL345_I2CAccelerometerData.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ThreeAxisAccelerometerData.h"
+
+namespace hal {
+class ADXL345_I2CData : public ThreeAxisAccelerometerData {
+ public:
+  explicit ADXL345_I2CData(int port);
+  virtual ~ADXL345_I2CData();
+
+  void HandleWrite(const uint8_t* buffer, uint32_t count);
+  void HandleRead(uint8_t* buffer, uint32_t count);
+
+ private:
+  int m_port;
+  int m_writeCallbackId;
+  int m_readCallbackId;
+
+  int m_lastWriteAddress;
+
+  static const double LSB;
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL345_SpiAccelerometerData.h b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL345_SpiAccelerometerData.h
new file mode 100644
index 0000000..481136a
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL345_SpiAccelerometerData.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ThreeAxisAccelerometerData.h"
+
+namespace hal {
+class ADXL345_SpiAccelerometer : public ThreeAxisAccelerometerData {
+ public:
+  explicit ADXL345_SpiAccelerometer(int port);
+  virtual ~ADXL345_SpiAccelerometer();
+
+  void HandleWrite(const uint8_t* buffer, uint32_t count);
+  void HandleRead(uint8_t* buffer, uint32_t count);
+
+ private:
+  int m_port;
+  int m_writeCallbackId;
+  int m_readCallbackId;
+
+  int m_lastWriteAddress;
+
+  static const double LSB;
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL362_SpiAccelerometerData.h b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL362_SpiAccelerometerData.h
new file mode 100644
index 0000000..ecae58f
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXL362_SpiAccelerometerData.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ThreeAxisAccelerometerData.h"
+
+namespace hal {
+class ADXL362_SpiAccelerometer : public ThreeAxisAccelerometerData {
+ public:
+  explicit ADXL362_SpiAccelerometer(int port);
+  virtual ~ADXL362_SpiAccelerometer();
+
+  void HandleWrite(const uint8_t* buffer, uint32_t count);
+  void HandleRead(uint8_t* buffer, uint32_t count);
+
+ private:
+  int m_port;
+  int m_writeCallbackId;
+  int m_readCallbackId;
+
+  int m_lastWriteAddress;
+
+  static const double LSB;
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXRS450_SpiGyroWrapperData.h b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXRS450_SpiGyroWrapperData.h
new file mode 100644
index 0000000..59164ff
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ADXRS450_SpiGyroWrapperData.h
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class ADXRS450_SpiGyroWrapper {
+ public:
+  explicit ADXRS450_SpiGyroWrapper(int port);
+  virtual ~ADXRS450_SpiGyroWrapper();
+
+  void HandleRead(uint8_t* buffer, uint32_t count);
+  void HandleAutoReceiveData(uint8_t* buffer, int32_t numToRead,
+                             int32_t& outputCount);
+
+  virtual void ResetData();
+
+  int32_t RegisterAngleCallback(HAL_NotifyCallback callback, void* param,
+                                HAL_Bool initialNotify);
+  void CancelAngleCallback(int32_t uid);
+  void InvokeAngleCallback(HAL_Value value);
+  double GetAngle();
+  void SetAngle(double angle);
+
+ private:
+  int m_port;
+  int m_readCallbackId;
+  int m_autoReceiveReadCallbackId;
+
+  wpi::mutex m_registerMutex;
+  wpi::mutex m_dataMutex;
+  double m_angle = 0.0;
+  double m_angleDiff = 0.0;
+  std::shared_ptr<NotifyListenerVector> m_angleCallbacks = nullptr;
+
+  static const double kAngleLsb;
+  // The maximum difference that can fit inside of the shifted and masked data
+  // field, per transaction
+  static const double kMaxAngleDeltaPerMessage;
+  static const int kPacketSize;
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ThreeAxisAccelerometerData.h b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ThreeAxisAccelerometerData.h
new file mode 100644
index 0000000..e466fb1
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/adx_gyro_accelerometer/src/main/native/include/ThreeAxisAccelerometerData.h
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+
+#include <support/mutex.h>
+
+#include "MockData/NotifyListenerVector.h"
+
+namespace hal {
+class ThreeAxisAccelerometerData {
+ public:
+  ThreeAxisAccelerometerData();
+  virtual ~ThreeAxisAccelerometerData();
+
+  int32_t RegisterXCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelXCallback(int32_t uid);
+  void InvokeXCallback(HAL_Value value);
+  double GetX();
+  void SetX(double x);
+
+  int32_t RegisterYCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelYCallback(int32_t uid);
+  void InvokeYCallback(HAL_Value value);
+  double GetY();
+  void SetY(double y);
+
+  int32_t RegisterZCallback(HAL_NotifyCallback callback, void* param,
+                            HAL_Bool initialNotify);
+  void CancelZCallback(int32_t uid);
+  void InvokeZCallback(HAL_Value value);
+  double GetZ();
+  void SetZ(double z);
+
+  virtual void ResetData();
+
+ protected:
+  wpi::mutex m_registerMutex;
+  std::atomic<double> m_x{0.0};
+  std::shared_ptr<NotifyListenerVector> m_xCallbacks = nullptr;
+  std::atomic<double> m_y{0.0};
+  std::shared_ptr<NotifyListenerVector> m_yCallbacks = nullptr;
+  std::atomic<double> m_z{0.0};
+  std::shared_ptr<NotifyListenerVector> m_zCallbacks = nullptr;
+};
+}  // namespace hal
diff --git a/third_party/allwpilib_2018/simulation/halsim_ds_nt/build.gradle b/third_party/allwpilib_2018/simulation/halsim_ds_nt/build.gradle
new file mode 100644
index 0000000..6f9d030
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_ds_nt/build.gradle
@@ -0,0 +1,58 @@
+description = "A simulation shared object that uses NetworkTables to act as a stand-in for the FRC Driver Station"
+
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'visual-studio'
+apply plugin: 'cpp'
+
+if (!project.hasProperty('onlyAthena')) {
+    ext.skipAthena = true
+
+    apply from: "../../config.gradle"
+
+
+    model {
+        dependencyConfigs {
+            ntcore(DependencyConfig) {
+                groupId = 'edu.wpi.first.ntcore'
+                artifactId = 'ntcore-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '4.+'
+                sharedConfigs = [ halsim_ds_nt: [] ]
+            }
+            wpiutil(DependencyConfig) {
+                groupId = 'edu.wpi.first.wpiutil'
+                artifactId = 'wpiutil-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.+'
+                sharedConfigs = [ halsim_ds_nt: [] ]
+            }
+        }
+        components {
+            halsim_ds_nt(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = [ 'src/main/native/cpp' ]
+                            includes = ["**/*.cpp"]
+                        }
+                        exportedHeaders {
+                            srcDirs = ["src/main/native/include"]
+                        }
+                    }
+                }
+            }
+        }
+
+        binaries {
+            all {
+                project(':hal').addHalToLinker(it)
+            }
+            withType(StaticLibraryBinarySpec) {
+                it.buildable = false
+            }
+        }
+    }
+    apply from: 'publish.gradle'
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_ds_nt/publish.gradle b/third_party/allwpilib_2018/simulation/halsim_ds_nt/publish.gradle
new file mode 100644
index 0000000..19ed913
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_ds_nt/publish.gradle
@@ -0,0 +1,94 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'halsim-ds-nt'
+def artifactGroupId = 'edu.wpi.first.halsim.ds'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-ds-nt'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-ds-nt'
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+build.dependsOn cppSourcesZip
+build.dependsOn cppHeadersZip
+
+
+model {
+    publishing {
+        def pluginTaskList = createComponentZipTasks($.components, 'halsim_ds_nt', 'zipcpp', Zip, project, { task, value->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                    }
+                }
+            }
+        })
+
+        def allTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allTask = createAllCombined(pluginTaskList, 'halsim_ds_nt', 'zipcpp', Zip, project)
+        }
+
+        publications {
+            cpp(MavenPublication) {
+                pluginTaskList.each {
+                    artifact it
+                }
+
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allTask
+                }
+
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/cpp/HALSimDsNt.cpp b/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/cpp/HALSimDsNt.cpp
new file mode 100644
index 0000000..ef510e4
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/cpp/HALSimDsNt.cpp
@@ -0,0 +1,194 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HALSimDsNt.h"
+
+void HALSimDSNT::Initialize() {
+  rootTable =
+      nt::NetworkTableInstance::GetDefault().GetTable("sim")->GetSubTable(
+          "DS_CONTROL");  // Not to be confused with sim::DriverStation from
+                          // HALSim LowFi
+
+  // LOOP TIMING //
+
+  auto timinghz = rootTable->GetEntry("timing_hz");
+  timinghz.ForceSetDouble(50);
+  timinghz.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        double valIn = ev.value->GetDouble();
+        double val = 0;
+        val = (valIn < 1 ? 1 : valIn > 100 ? 100 : valIn);
+
+        if (val != valIn) {
+          this->rootTable->GetEntry("timing_hz").ForceSetDouble(val);
+          Flush();
+        }
+
+        this->timingHz = val;
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  // MODES //
+
+  modeTable = rootTable->GetSubTable("mode");
+  auto mtele = modeTable->GetEntry("teleop?");
+  auto mauto = modeTable->GetEntry("auto?");
+  auto mtest = modeTable->GetEntry("test?");
+  auto enabled = modeTable->GetEntry("enabled?");
+  auto estop = modeTable->GetEntry("estop?");
+
+  mtele.ForceSetBoolean(true);
+  mauto.ForceSetBoolean(false);
+  mtest.ForceSetBoolean(false);
+  enabled.ForceSetBoolean(false);
+  estop.ForceSetBoolean(false);
+
+  mtele.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        this->HandleModePress(HALSimDSNT_Mode::teleop, ev.value->GetBoolean());
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  mauto.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        this->HandleModePress(HALSimDSNT_Mode::auton, ev.value->GetBoolean());
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  mtest.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        this->HandleModePress(HALSimDSNT_Mode::test, ev.value->GetBoolean());
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  enabled.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        std::lock_guard<wpi::mutex> lock(modeMutex);
+        if (!this->isEstop) {
+          this->isEnabled = ev.value->GetBoolean();
+        } else {
+          this->isEnabled = false;
+        }
+        this->DoModeUpdate();
+        this->UpdateModeButtons();
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  estop.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        std::lock_guard<wpi::mutex> lock(modeMutex);
+        this->isEstop = ev.value->GetBoolean();
+        if (this->isEstop) {
+          this->isEnabled = false;
+        }
+        this->DoModeUpdate();
+        this->UpdateModeButtons();
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  // ALLIANCES //
+
+  allianceTable = rootTable->GetSubTable("alliance");
+  auto allianceStation = allianceTable->GetEntry("station");
+  auto allianceColorRed = allianceTable->GetEntry("red?");
+
+  allianceStation.ForceSetDouble(1);
+  allianceColorRed.ForceSetBoolean(true);
+
+  allianceStation.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        double stnIn = ev.value->GetDouble();
+        double stn = 0;
+        stn = (stnIn > 3 ? 3 : stnIn < 1 ? 1 : stnIn);
+
+        if (stn != stnIn) {
+          this->allianceTable->GetEntry("station").ForceSetDouble(stn);
+          Flush();
+        }
+
+        this->allianceStation = stn;
+        this->DoAllianceUpdate();
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  allianceColorRed.AddListener(
+      [this](const nt::EntryNotification& ev) -> void {
+        this->isAllianceRed = ev.value->GetBoolean();
+        this->DoAllianceUpdate();
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  // FINAL LOGIC //
+
+  Flush();
+
+  loopThread = std::thread([this]() -> void {
+    this->running = true;
+    this->LoopFunc();
+  });
+  loopThread.detach();
+}
+
+void HALSimDSNT::HandleModePress(enum HALSimDSNT_Mode mode, bool isPressed) {
+  if (isPressed) {
+    if (mode != currentMode) {
+      std::lock_guard<wpi::mutex> lock(modeMutex);
+      currentMode = mode;
+      isEnabled = false;
+      this->DoModeUpdate();
+    }
+  }
+
+  this->UpdateModeButtons();
+}
+
+void HALSimDSNT::UpdateModeButtons() {
+  modeTable->GetEntry("teleop?").ForceSetBoolean(currentMode ==
+                                                 HALSimDSNT_Mode::teleop);
+  modeTable->GetEntry("auto?").ForceSetBoolean(currentMode ==
+                                               HALSimDSNT_Mode::auton);
+  modeTable->GetEntry("test?").ForceSetBoolean(currentMode ==
+                                               HALSimDSNT_Mode::test);
+  modeTable->GetEntry("enabled?").ForceSetBoolean(isEnabled);
+  Flush();
+}
+
+void HALSimDSNT::DoModeUpdate() {
+  HALSIM_SetDriverStationAutonomous(currentMode == HALSimDSNT_Mode::auton);
+  HALSIM_SetDriverStationTest(currentMode == HALSimDSNT_Mode::test);
+  HALSIM_SetDriverStationEnabled(isEnabled);
+  if (isEnabled && !lastIsEnabled) {
+    currentMatchTime = 0;
+  }
+  lastIsEnabled = isEnabled;
+  HALSIM_SetDriverStationEStop(isEstop);
+  HALSIM_SetDriverStationFmsAttached(false);
+  HALSIM_SetDriverStationDsAttached(true);
+  HALSIM_NotifyDriverStationNewData();
+}
+
+void HALSimDSNT::DoAllianceUpdate() {
+  HALSIM_SetDriverStationAllianceStationId(static_cast<HAL_AllianceStationID>(
+      (isAllianceRed ? HAL_AllianceStationID_kRed1
+                     : HAL_AllianceStationID_kBlue1) +
+      (static_cast<int32_t>(allianceStation) - 1)));
+}
+
+void HALSimDSNT::LoopFunc() {
+  while (running) {
+    double dt = 1000 / timingHz;
+    std::this_thread::sleep_for(
+        std::chrono::milliseconds(static_cast<int64_t>(dt)));
+    if (isEnabled) {
+      currentMatchTime = currentMatchTime + dt;
+      HALSIM_SetDriverStationMatchTime(currentMatchTime);
+    }
+    HALSIM_NotifyDriverStationNewData();
+  }
+}
+
+void HALSimDSNT::Flush() { rootTable->GetInstance().Flush(); }
diff --git a/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/cpp/main.cpp b/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/cpp/main.cpp
new file mode 100644
index 0000000..7090de9
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/cpp/main.cpp
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include <HALSimDsNt.h>
+
+static HALSimDSNT dsnt;
+
+extern "C" {
+#if defined(WIN32) || defined(_WIN32)
+__declspec(dllexport)
+#endif
+    int HALSIM_InitExtension(void) {
+  std::cout << "DriverStationNT Initializing." << std::endl;
+
+  dsnt.Initialize();
+
+  std::cout << "DriverStationNT Initialized!" << std::endl;
+  return 0;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/include/HALSimDsNt.h b/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/include/HALSimDsNt.h
new file mode 100644
index 0000000..0f57925
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_ds_nt/src/main/native/include/HALSimDsNt.h
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+#include <thread>
+
+#include <MockData/DriverStationData.h>
+#include <networktables/NetworkTableInstance.h>
+#include <support/mutex.h>
+
+enum HALSimDSNT_Mode { teleop, auton, test };
+
+class HALSimDSNT {
+ public:
+  std::shared_ptr<nt::NetworkTable> rootTable, modeTable, allianceTable;
+  enum HALSimDSNT_Mode currentMode;
+  bool isEnabled, lastIsEnabled, isEstop;
+  std::atomic<bool> isAllianceRed, running;
+  std::atomic<double> currentMatchTime, timingHz, allianceStation;
+  std::thread loopThread;
+  wpi::mutex modeMutex;
+
+  void Initialize();
+  void HandleModePress(enum HALSimDSNT_Mode mode, bool isPressed);
+  void UpdateModeButtons();
+  void DoModeUpdate();
+  void DoAllianceUpdate();
+  void LoopFunc();
+  void Flush();
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/build.gradle b/third_party/allwpilib_2018/simulation/halsim_lowfi/build.gradle
new file mode 100644
index 0000000..7edf98b
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/build.gradle
@@ -0,0 +1,58 @@
+description = "A simulation shared object that publishes basic robot I/O to NetworkTables."
+
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'visual-studio'
+apply plugin: 'cpp'
+
+if (!project.hasProperty('onlyAthena')) {
+    ext.skipAthena = true
+
+    apply from: "../../config.gradle"
+
+
+    model {
+        dependencyConfigs {
+            ntcore(DependencyConfig) {
+                groupId = 'edu.wpi.first.ntcore'
+                artifactId = 'ntcore-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '4.+'
+                sharedConfigs = [ halsim_lowfi: [] ]
+            }
+        wpiutil(DependencyConfig) {
+                groupId = 'edu.wpi.first.wpiutil'
+                artifactId = 'wpiutil-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.+'
+                sharedConfigs = [ halsim_lowfi: [] ]
+            }
+        }
+        components {
+            halsim_lowfi(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = [ 'src/main/native/cpp' ]
+                            includes = ["**/*.cpp"]
+                        }
+                        exportedHeaders {
+                            srcDirs = ["src/main/native/include"]
+                        }
+                    }
+                }
+            }
+        }
+
+        binaries {
+            all {
+                project(':hal').addHalToLinker(it)
+            }
+            withType(StaticLibraryBinarySpec) {
+                it.buildable = false
+            }
+        }
+    }
+    apply from: 'publish.gradle'
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/publish.gradle b/third_party/allwpilib_2018/simulation/halsim_lowfi/publish.gradle
new file mode 100644
index 0000000..b21497e
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/publish.gradle
@@ -0,0 +1,94 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'halsim-lowfi'
+def artifactGroupId = 'edu.wpi.first.halsim'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-lowfi'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-lowfi'
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+build.dependsOn cppSourcesZip
+build.dependsOn cppHeadersZip
+
+
+model {
+    publishing {
+        def pluginTaskList = createComponentZipTasks($.components, 'halsim_lowfi', 'zipcpp', Zip, project, { task, value->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                    }
+                }
+            }
+        })
+
+        def allTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allTask = createAllCombined(pluginTaskList, 'halsim_lowfi', 'zipcpp', Zip, project)
+        }
+
+        publications {
+            cpp(MavenPublication) {
+                pluginTaskList.each {
+                    artifact it
+                }
+
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allTask
+                }
+
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/HALSimLowFi.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/HALSimLowFi.cpp
new file mode 100644
index 0000000..46d96b5
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/HALSimLowFi.cpp
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HALSimLowFi.h"
+
+#include <llvm/Twine.h>
+
+void HALSimLowFi::Initialize() {
+  table = nt::NetworkTableInstance::GetDefault().GetTable("sim");
+}
+
+void HALSimNTProvider::Inject(std::shared_ptr<HALSimLowFi> parentArg,
+                              std::string tableNameArg) {
+  parent = parentArg;
+  tableName = std::move(tableNameArg);
+  table = parent->table->GetSubTable(tableName);
+
+  this->Initialize();
+}
+
+void NTProviderBaseCallback(const char* name, void* param,
+                            const struct HAL_Value* value) {
+  auto info =
+      static_cast<struct HALSimNTProvider::NTProviderCallbackInfo*>(param);
+  uint32_t chan = static_cast<uint32_t>(info->channel);
+  auto provider = info->provider;
+  auto table = info->table;
+  provider->OnCallback(chan, table);
+}
+
+void HALSimNTProvider::InitializeDefault(
+    int numChannels, HALCbRegisterIndexedFunc registerFunc) {
+  this->numChannels = numChannels;
+  cbInfos.reserve(numChannels);
+  for (int i = 0; i < numChannels; i++) {
+    struct NTProviderCallbackInfo info = {
+        this, table->GetSubTable(tableName + llvm::Twine(i)), i};
+    cbInfos.emplace_back(info);
+  }
+
+  for (auto& info : cbInfos) {
+    registerFunc(info.channel, NTProviderBaseCallback, &info, true);
+    OnInitializedChannel(info.channel, info.table);
+  }
+}
+
+void HALSimNTProvider::InitializeDefaultSingle(
+    HALCbRegisterSingleFunc registerFunc) {
+  struct NTProviderCallbackInfo info = {this, table, 0};
+  cbInfos.push_back(info);
+
+  for (auto& info : cbInfos) {
+    registerFunc(NTProviderBaseCallback, &info, true);
+  }
+}
+
+void HALSimNTProvider::OnInitializedChannel(
+    uint32_t channel, std::shared_ptr<nt::NetworkTable> table) {}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Analog.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Analog.cpp
new file mode 100644
index 0000000..43b1a89
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Analog.cpp
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_Analog.h"
+
+#include <HAL/Ports.h>
+#include <MockData/AnalogInData.h>
+#include <MockData/AnalogOutData.h>
+
+void HALSimNTProviderAnalogIn::Initialize() {
+  InitializeDefault(HAL_GetNumAnalogInputs(),
+                    HALSIM_RegisterAnalogInAllCallbacks);
+}
+
+void HALSimNTProviderAnalogIn::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init?").SetBoolean(HALSIM_GetAnalogInInitialized(chan));
+  table->GetEntry("avg_bits").SetDouble(HALSIM_GetAnalogInAverageBits(chan));
+  table->GetEntry("oversample_bits")
+      .SetDouble(HALSIM_GetAnalogInOversampleBits(chan));
+  table->GetEntry("voltage").SetDouble(HALSIM_GetAnalogInVoltage(chan));
+
+  auto accum = table->GetSubTable("accum");
+  accum->GetEntry("init?").SetBoolean(
+      HALSIM_GetAnalogInAccumulatorInitialized(chan));
+  accum->GetEntry("value").SetDouble(HALSIM_GetAnalogInAccumulatorValue(chan));
+  accum->GetEntry("count").SetDouble(HALSIM_GetAnalogInAccumulatorCount(chan));
+  accum->GetEntry("center").SetDouble(
+      HALSIM_GetAnalogInAccumulatorCenter(chan));
+  accum->GetEntry("deadband")
+      .SetDouble(HALSIM_GetAnalogInAccumulatorDeadband(chan));
+}
+
+void HALSimNTProviderAnalogIn::OnInitializedChannel(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("voltage").AddListener(
+      [=](const nt::EntryNotification& ev) -> void {
+        HALSIM_SetAnalogInVoltage(chan, ev.value->GetDouble());
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+}
+
+void HALSimNTProviderAnalogOut::Initialize() {
+  InitializeDefault(HAL_GetNumAnalogOutputs(),
+                    HALSIM_RegisterAnalogOutAllCallbacks);
+}
+
+void HALSimNTProviderAnalogOut::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init?").SetBoolean(HALSIM_GetAnalogOutInitialized(chan));
+  table->GetEntry("voltage").SetDouble(HALSIM_GetAnalogOutVoltage(chan));
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_DIO.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_DIO.cpp
new file mode 100644
index 0000000..bf6f6ea
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_DIO.cpp
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_DIO.h"
+
+#include <HAL/Ports.h>
+#include <MockData/DIOData.h>
+
+void HALSimNTProviderDIO::Initialize() {
+  InitializeDefault(HAL_GetNumDigitalChannels(),
+                    HALSIM_RegisterDIOAllCallbacks);
+}
+
+void HALSimNTProviderDIO::OnCallback(uint32_t chan,
+                                     std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init?").SetBoolean(HALSIM_GetDIOInitialized(chan));
+  table->GetEntry("value").SetBoolean(HALSIM_GetDIOValue(chan));
+  table->GetEntry("pulse_length").SetDouble(HALSIM_GetDIOPulseLength(chan));
+  table->GetEntry("input?").SetBoolean(HALSIM_GetDIOIsInput(chan));
+}
+
+void HALSimNTProviderDIO::OnInitializedChannel(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("value").AddListener(
+      [=](const nt::EntryNotification& ev) -> void {
+        if (HALSIM_GetDIOIsInput(chan)) {
+          HALSIM_SetDIOValue(chan, ev.value->GetBoolean());
+        }
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_DriverStation.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_DriverStation.cpp
new file mode 100644
index 0000000..c730895
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_DriverStation.cpp
@@ -0,0 +1,61 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_DriverStation.h"
+
+#include <HAL/Ports.h>
+#include <MockData/DriverStationData.h>
+
+void HALSimNTProviderDriverStation::Initialize() {
+  InitializeDefaultSingle(HALSIM_RegisterDriverStationAllCallbacks);
+}
+
+void HALSimNTProviderDriverStation::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  bool auton = HALSIM_GetDriverStationAutonomous(),
+       test = HALSIM_GetDriverStationTest(),
+       enabled = HALSIM_GetDriverStationEnabled();
+
+  bool teleop = (!auton && !test && enabled);
+
+  table->GetEntry("enabled?").SetBoolean(enabled);
+  table->GetEntry("autonomous?").SetBoolean(auton);
+  table->GetEntry("test?").SetBoolean(test);
+  table->GetEntry("teleop?").SetBoolean(teleop);
+  table->GetEntry("estop?").SetBoolean(HALSIM_GetDriverStationEStop());
+  table->GetEntry("fms?").SetBoolean(HALSIM_GetDriverStationFmsAttached());
+  table->GetEntry("ds?").SetBoolean(HALSIM_GetDriverStationDsAttached());
+  table->GetEntry("match_time").SetDouble(HALSIM_GetDriverStationMatchTime());
+
+  // TODO: Joysticks
+
+  auto alliance = table->GetSubTable("alliance");
+  auto allianceValue = HALSIM_GetDriverStationAllianceStationId();
+  alliance->GetEntry("color").SetString(
+      (allianceValue == HAL_AllianceStationID_kRed1 ||
+       allianceValue == HAL_AllianceStationID_kRed2 ||
+       allianceValue == HAL_AllianceStationID_kRed3)
+          ? "red"
+          : "blue");
+  int station = 0;
+
+  switch (allianceValue) {
+    case HAL_AllianceStationID_kRed1:
+    case HAL_AllianceStationID_kBlue1:
+      station = 1;
+      break;
+    case HAL_AllianceStationID_kRed2:
+    case HAL_AllianceStationID_kBlue2:
+      station = 2;
+      break;
+    case HAL_AllianceStationID_kRed3:
+    case HAL_AllianceStationID_kBlue3:
+      station = 3;
+      break;
+  }
+  alliance->GetEntry("station").SetDouble(station);
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Encoder.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Encoder.cpp
new file mode 100644
index 0000000..7e91e5d
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Encoder.cpp
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_Encoder.h"
+
+#include <HAL/Ports.h>
+#include <MockData/EncoderData.h>
+
+void HALSimNTProviderEncoder::Initialize() {
+  InitializeDefault(HAL_GetNumEncoders(), HALSIM_RegisterEncoderAllCallbacks);
+}
+
+void HALSimNTProviderEncoder::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init?").SetBoolean(HALSIM_GetEncoderInitialized(chan));
+  table->GetEntry("count").SetDouble(HALSIM_GetEncoderCount(chan));
+  table->GetEntry("period").SetDouble(HALSIM_GetEncoderPeriod(chan));
+  table->GetEntry("reset?").SetBoolean(HALSIM_GetEncoderReset(chan));
+  table->GetEntry("max_period").SetDouble(HALSIM_GetEncoderMaxPeriod(chan));
+  table->GetEntry("direction").SetBoolean(HALSIM_GetEncoderDirection(chan));
+  table->GetEntry("reverse_direction?")
+      .SetBoolean(HALSIM_GetEncoderReverseDirection(chan));
+  table->GetEntry("samples_to_avg")
+      .SetDouble(HALSIM_GetEncoderSamplesToAverage(chan));
+}
+
+void HALSimNTProviderEncoder::OnInitializedChannel(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("count").AddListener(
+      [=](const nt::EntryNotification& ev) -> void {
+        HALSIM_SetEncoderCount(chan,
+                               static_cast<int32_t>(ev.value->GetDouble()));
+      },
+      NT_NotifyKind::NT_NOTIFY_UPDATE);
+
+  table->GetEntry("direction")
+      .AddListener(
+          [=](const nt::EntryNotification& ev) -> void {
+            HALSIM_SetEncoderDirection(chan, ev.value->GetBoolean());
+          },
+          NT_NotifyKind::NT_NOTIFY_UPDATE);
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_PWM.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_PWM.cpp
new file mode 100644
index 0000000..8df4aa2
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_PWM.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_PWM.h"
+
+#include <HAL/Ports.h>
+#include <MockData/PWMData.h>
+
+void HALSimNTProviderPWM::Initialize() {
+  InitializeDefault(HAL_GetNumPWMChannels(), HALSIM_RegisterPWMAllCallbacks);
+}
+
+void HALSimNTProviderPWM::OnCallback(uint32_t chan,
+                                     std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init?").SetBoolean(HALSIM_GetPWMInitialized(chan));
+  table->GetEntry("speed").SetDouble(HALSIM_GetPWMSpeed(chan));
+  table->GetEntry("position").SetDouble(HALSIM_GetPWMPosition(chan));
+  table->GetEntry("raw").SetDouble(HALSIM_GetPWMRawValue(chan));
+  table->GetEntry("period_scale").SetDouble(HALSIM_GetPWMPeriodScale(chan));
+  table->GetEntry("zero_latch?").SetBoolean(HALSIM_GetPWMZeroLatch(chan));
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Relay.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Relay.cpp
new file mode 100644
index 0000000..5c1cd65
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_Relay.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_Relay.h"
+
+#include <HAL/Ports.h>
+#include <MockData/RelayData.h>
+
+void HALSimNTProviderRelay::Initialize() {
+  InitializeDefault(HAL_GetNumRelayHeaders(), HALSIM_RegisterRelayAllCallbacks);
+}
+
+void HALSimNTProviderRelay::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init_fwd?")
+      .SetBoolean(HALSIM_GetRelayInitializedForward(chan));
+  table->GetEntry("init_rvs?")
+      .SetBoolean(HALSIM_GetRelayInitializedReverse(chan));
+  table->GetEntry("fwd?").SetBoolean(HALSIM_GetRelayForward(chan));
+  table->GetEntry("rvs?").SetBoolean(HALSIM_GetRelayReverse(chan));
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_RoboRIO.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_RoboRIO.cpp
new file mode 100644
index 0000000..89442f8
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_RoboRIO.cpp
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_RoboRIO.h"
+
+#include <HAL/Ports.h>
+#include <MockData/RoboRioData.h>
+
+void HALSimNTProviderRoboRIO::Initialize() {
+  InitializeDefault(1, HALSIM_RegisterRoboRioAllCallbacks);
+}
+
+void HALSimNTProviderRoboRIO::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("fpga_button?").SetBoolean(HALSIM_GetRoboRioFPGAButton(chan));
+
+  table->GetEntry("vin_voltage").SetDouble(HALSIM_GetRoboRioVInVoltage(chan));
+  table->GetEntry("vin_current").SetDouble(HALSIM_GetRoboRioVInCurrent(chan));
+
+  auto t6v = table->GetSubTable("6V");
+  t6v->GetEntry("voltage").SetDouble(HALSIM_GetRoboRioUserVoltage6V(chan));
+  t6v->GetEntry("current").SetDouble(HALSIM_GetRoboRioUserCurrent6V(chan));
+  t6v->GetEntry("active?").SetBoolean(HALSIM_GetRoboRioUserActive6V(chan));
+  t6v->GetEntry("faults").SetDouble(HALSIM_GetRoboRioUserFaults6V(chan));
+
+  auto t5v = table->GetSubTable("5V");
+  t5v->GetEntry("voltage").SetDouble(HALSIM_GetRoboRioUserVoltage5V(chan));
+  t5v->GetEntry("current").SetDouble(HALSIM_GetRoboRioUserCurrent5V(chan));
+  t5v->GetEntry("active?").SetBoolean(HALSIM_GetRoboRioUserActive5V(chan));
+  t5v->GetEntry("faults").SetDouble(HALSIM_GetRoboRioUserFaults5V(chan));
+
+  auto t3v3 = table->GetSubTable("3V3");
+  t3v3->GetEntry("voltage").SetDouble(HALSIM_GetRoboRioUserVoltage3V3(chan));
+  t3v3->GetEntry("current").SetDouble(HALSIM_GetRoboRioUserCurrent3V3(chan));
+  t3v3->GetEntry("active?").SetBoolean(HALSIM_GetRoboRioUserActive3V3(chan));
+  t3v3->GetEntry("faults").SetDouble(HALSIM_GetRoboRioUserFaults3V3(chan));
+}
+
+void HALSimNTProviderRoboRIO::OnInitializedChannel(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("fpga_button?")
+      .AddListener(
+          [=](const nt::EntryNotification& ev) -> void {
+            HALSIM_SetRoboRioFPGAButton(chan, ev.value->GetBoolean());
+          },
+          NT_NotifyKind::NT_NOTIFY_UPDATE);
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_dPWM.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_dPWM.cpp
new file mode 100644
index 0000000..76f20dc
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/NTProvider_dPWM.cpp
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NTProvider_dPWM.h"
+
+#include <HAL/Ports.h>
+#include <MockData/DigitalPWMData.h>
+
+void HALSimNTProviderDigitalPWM::Initialize() {
+  InitializeDefault(HAL_GetNumDigitalPWMOutputs(),
+                    HALSIM_RegisterDigitalPWMAllCallbacks);
+}
+
+void HALSimNTProviderDigitalPWM::OnCallback(
+    uint32_t chan, std::shared_ptr<nt::NetworkTable> table) {
+  table->GetEntry("init?").SetBoolean(HALSIM_GetDigitalPWMInitialized(chan));
+  table->GetEntry("dio_pin").SetDouble(HALSIM_GetDigitalPWMPin(chan));
+  table->GetEntry("duty_cycle").SetDouble(HALSIM_GetDigitalPWMDutyCycle(chan));
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/main.cpp b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/main.cpp
new file mode 100644
index 0000000..b94a634
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/cpp/main.cpp
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include <HALSimLowFi.h>
+#include <NTProvider_Analog.h>
+#include <NTProvider_DIO.h>
+#include <NTProvider_DriverStation.h>
+#include <NTProvider_Encoder.h>
+#include <NTProvider_PWM.h>
+#include <NTProvider_Relay.h>
+#include <NTProvider_RoboRIO.h>
+#include <NTProvider_dPWM.h>
+
+static HALSimLowFi halsim_lowfi;
+
+static HALSimNTProviderPWM pwm_provider;
+static HALSimNTProviderDigitalPWM dpwm_provider;
+static HALSimNTProviderDIO dio_provider;
+static HALSimNTProviderAnalogIn ai_provider;
+static HALSimNTProviderAnalogOut ao_provider;
+static HALSimNTProviderDriverStation ds_provider;
+static HALSimNTProviderEncoder encoder_provider;
+static HALSimNTProviderRelay relay_provider;
+static HALSimNTProviderRoboRIO roborio_provider;
+
+extern "C" {
+#if defined(WIN32) || defined(_WIN32)
+__declspec(dllexport)
+#endif
+    int HALSIM_InitExtension(void) {
+  std::cout << "NetworkTables LowFi Simulator Initializing." << std::endl;
+  halsim_lowfi.Initialize();
+  halsim_lowfi.table->GetInstance().StartServer("networktables.ini");
+  halsim_lowfi.table->GetInstance().SetUpdateRate(0.05);
+  auto lowfi = std::make_shared<HALSimLowFi>(halsim_lowfi);
+
+  pwm_provider.Inject(lowfi, "PWM");
+  dpwm_provider.Inject(lowfi, "dPWM");
+  dio_provider.Inject(lowfi, "DIO");
+  ai_provider.Inject(lowfi, "AI");
+  ao_provider.Inject(lowfi, "AO");
+  ds_provider.Inject(lowfi, "DriverStation");
+  encoder_provider.Inject(lowfi, "Encoder");
+  relay_provider.Inject(lowfi, "Relay");
+  roborio_provider.Inject(lowfi, "RoboRIO");
+
+  std::cout << "NetworkTables LowFi Simulator Initialized!" << std::endl;
+  return 0;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/HALSimLowFi.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/HALSimLowFi.h
new file mode 100644
index 0000000..c3a2b30
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/HALSimLowFi.h
@@ -0,0 +1,58 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <cinttypes>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <MockData/NotifyListener.h>
+#include <networktables/NetworkTableInstance.h>
+
+class HALSimLowFi {
+ public:
+  std::shared_ptr<nt::NetworkTable> table;
+  void Initialize();
+};
+
+typedef void (*HALCbRegisterIndexedFunc)(int32_t index,
+                                         HAL_NotifyCallback callback,
+                                         void* param, HAL_Bool initialNotify);
+typedef void (*HALCbRegisterSingleFunc)(HAL_NotifyCallback callback,
+                                        void* param, HAL_Bool initialNotify);
+
+void NTProviderBaseCallback(const char* name, void* param,
+                            const struct HAL_Value* value);
+
+class HALSimNTProvider {
+ public:
+  struct NTProviderCallbackInfo {
+    HALSimNTProvider* provider;
+    std::shared_ptr<nt::NetworkTable> table;
+    int channel;
+  };
+
+  void Inject(std::shared_ptr<HALSimLowFi> parent, std::string table);
+  // Initialize is called by inject.
+  virtual void Initialize() = 0;
+  virtual void InitializeDefault(int numChannels,
+                                 HALCbRegisterIndexedFunc registerFunc);
+  virtual void InitializeDefaultSingle(HALCbRegisterSingleFunc registerFunc);
+  virtual void OnCallback(uint32_t channel,
+                          std::shared_ptr<nt::NetworkTable> table) = 0;
+  virtual void OnInitializedChannel(uint32_t channel,
+                                    std::shared_ptr<nt::NetworkTable> table);
+
+  int numChannels;
+  std::string tableName;
+
+  std::shared_ptr<HALSimLowFi> parent;
+  std::shared_ptr<nt::NetworkTable> table;
+  std::vector<NTProviderCallbackInfo> cbInfos;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Analog.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Analog.h
new file mode 100644
index 0000000..8672b46
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Analog.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderAnalogIn : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+  void OnInitializedChannel(uint32_t channel,
+                            std::shared_ptr<nt::NetworkTable> table) override;
+};
+
+class HALSimNTProviderAnalogOut : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_DIO.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_DIO.h
new file mode 100644
index 0000000..b584b48
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_DIO.h
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderDIO : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+  void OnInitializedChannel(uint32_t channel,
+                            std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_DriverStation.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_DriverStation.h
new file mode 100644
index 0000000..5041b02
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_DriverStation.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderDriverStation : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Encoder.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Encoder.h
new file mode 100644
index 0000000..f3ef70f
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Encoder.h
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderEncoder : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+  void OnInitializedChannel(uint32_t channel,
+                            std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_PWM.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_PWM.h
new file mode 100644
index 0000000..47c416e
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_PWM.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderPWM : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Relay.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Relay.h
new file mode 100644
index 0000000..cc8439a
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_Relay.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderRelay : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_RoboRIO.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_RoboRIO.h
new file mode 100644
index 0000000..055b6e6
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_RoboRIO.h
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderRoboRIO : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+  void OnInitializedChannel(uint32_t channel,
+                            std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_dPWM.h b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_dPWM.h
new file mode 100644
index 0000000..0af607f
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_lowfi/src/main/native/include/NTProvider_dPWM.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HALSimLowFi.h>
+
+class HALSimNTProviderDigitalPWM : public HALSimNTProvider {
+ public:
+  void Initialize() override;
+  void OnCallback(uint32_t channel,
+                  std::shared_ptr<nt::NetworkTable> table) override;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_print/build.gradle b/third_party/allwpilib_2018/simulation/halsim_print/build.gradle
new file mode 100644
index 0000000..3fc7c32
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_print/build.gradle
@@ -0,0 +1,39 @@
+description = "A simulation shared object that simply prints robot behaviors"
+
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'cpp'
+
+if (!project.hasProperty('onlyAthena')) {
+    ext.skipAthena = true
+
+    apply from: "../../config.gradle"
+
+
+    model {
+        components {
+            halsim_print(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = [ 'src/main/native/cpp' ]
+                            includes = ["**/*.cpp"]
+                        }
+                        exportedHeaders {
+                            srcDirs = ["src/main/native/include"]
+                        }
+                    }
+                }
+            }
+        }
+
+        binaries {
+            all {
+                project(':hal').addHalToLinker(it)
+            }
+            withType(StaticLibraryBinarySpec) {
+                it.buildable = false
+            }
+        }
+    }
+    apply from: 'publish.gradle'
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_print/publish.gradle b/third_party/allwpilib_2018/simulation/halsim_print/publish.gradle
new file mode 100644
index 0000000..fc2cdd5
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_print/publish.gradle
@@ -0,0 +1,94 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'halsim-print'
+def artifactGroupId = 'edu.wpi.first.halsim'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-print'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'halsim-print'
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+build.dependsOn cppSourcesZip
+build.dependsOn cppHeadersZip
+
+
+model {
+    publishing {
+        def pluginTaskList = createComponentZipTasks($.components, 'halsim_print', 'zipcpp', Zip, project, { task, value->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                    }
+                }
+            }
+        })
+
+        def allTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allTask = createAllCombined(pluginTaskList, 'halsim_print', 'zipcpp', Zip, project)
+        }
+
+        publications {
+            cpp(MavenPublication) {
+                pluginTaskList.each {
+                    artifact it
+                }
+
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allTask
+                }
+
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/cpp/PrintPWM.cpp b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/cpp/PrintPWM.cpp
new file mode 100644
index 0000000..4d7a3e3
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/cpp/PrintPWM.cpp
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PrintPWM.h"
+
+#include <iostream>
+
+#include "MockData/HAL_Value.h"
+#include "MockData/NotifyListener.h"
+#include "MockData/PWMData.h"
+
+static void PWMCallback(const char* name, void* param,
+                        const struct HAL_Value* value) {
+  auto pwm = static_cast<PrintPWM*>(param);
+  pwm->Publish(value->data.v_double);
+}
+
+PrintPWM::PrintPWM(int port) {
+  m_port = port;
+  HALSIM_RegisterPWMSpeedCallback(port, PWMCallback, this, false);
+}
+
+void PrintPWM::Publish(double value) {
+  std::cout << "PWM " << m_port << ": " << value << std::endl;
+}
diff --git a/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/cpp/main.cpp b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/cpp/main.cpp
new file mode 100644
index 0000000..5f83b06
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/cpp/main.cpp
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include <HAL/Ports.h>
+
+#include "HALSimPrint.h"
+#include "PrintPWM.h"
+
+/**
+ * Currently, robots never terminate, so we keep a single static object
+ * and it is never properly released or cleaned up.
+ */
+static HALSimPrint halsim;
+
+extern "C" {
+#if defined(WIN32) || defined(_WIN32)
+__declspec(dllexport)
+#endif
+    int HALSIM_InitExtension(void) {
+  std::cout << "Print Simulator Initializing." << std::endl;
+
+  int pwmCount = HAL_GetNumPWMChannels();
+  halsim.m_pwms.reserve(pwmCount);
+  for (int i = 0; i < pwmCount; i++) halsim.m_pwms.emplace_back(i);
+
+  return 0;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/include/HALSimPrint.h b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/include/HALSimPrint.h
new file mode 100644
index 0000000..69dafec
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/include/HALSimPrint.h
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <vector>
+
+class PrintPWM;
+
+class HALSimPrint {
+ public:
+  std::vector<PrintPWM> m_pwms;
+};
diff --git a/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/include/PrintPWM.h b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/include/PrintPWM.h
new file mode 100644
index 0000000..98803ff
--- /dev/null
+++ b/third_party/allwpilib_2018/simulation/halsim_print/src/main/native/include/PrintPWM.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "HALSimPrint.h"
+
+class PrintPWM {
+ public:
+  explicit PrintPWM(int port);
+  void Publish(double value);
+
+ private:
+  int m_port;
+};
diff --git a/third_party/allwpilib_2018/styleguide/checkstyle.xml b/third_party/allwpilib_2018/styleguide/checkstyle.xml
new file mode 100644
index 0000000..830c3a5
--- /dev/null
+++ b/third_party/allwpilib_2018/styleguide/checkstyle.xml
@@ -0,0 +1,227 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+        "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+        "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+    Checkstyle configuration that checks the Google coding conventions from Google Java Style
+    that can be found at https://google.github.io/styleguide/javaguide.html.
+
+    Checkstyle is very configurable. Be sure to read the documentation at
+    http://checkstyle.sf.net (or in your downloaded distribution).
+
+    To completely disable a check, just comment it out or delete it from the file.
+
+    Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
+ -->
+
+<module name = "Checker">
+    <property name="charset" value="UTF-8"/>
+
+    <property name="severity" value="error"/>
+
+    <module name="SuppressionFilter">
+        <property name="file" value="styleguide/suppressions.xml" />
+    </module>
+
+    <property name="fileExtensions" value="java, properties, xml"/>
+    <!-- Checks for whitespace                               -->
+    <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+    <module name="FileTabCharacter">
+        <property name="eachLine" value="true"/>
+    </module>
+    <module name="NewlineAtEndOfFile">
+        <property name="lineSeparator" value="lf"/>
+    </module>
+
+    <module name="SuppressWarningsFilter" />
+
+    <module name="TreeWalker">
+        <module name="SuppressWarningsHolder" />
+        <module name="OuterTypeFilename"/>
+        <module name="IllegalTokenText">
+            <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
+            <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
+            <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
+        </module>
+        <module name="AvoidEscapedUnicodeCharacters">
+            <property name="allowEscapesForControlCharacters" value="true"/>
+            <property name="allowByTailComment" value="true"/>
+            <property name="allowNonPrintableEscapes" value="true"/>
+        </module>
+        <module name="LineLength">
+            <property name="max" value="100"/>
+            <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+        </module>
+        <module name="AvoidStarImport"/>
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+        <module name="OneTopLevelClass"/>
+        <module name="NoLineWrap"/>
+        <module name="EmptyBlock">
+            <property name="option" value="TEXT"/>
+            <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
+        </module>
+        <module name="NeedBraces"/>
+        <module name="LeftCurly">
+            <property name="maxLineLength" value="100"/>
+        </module>
+        <module name="RightCurly"/>
+        <module name="RightCurly">
+            <property name="option" value="alone"/>
+            <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
+        </module>
+        <module name="WhitespaceAround">
+            <property name="allowEmptyConstructors" value="true"/>
+            <property name="allowEmptyMethods" value="true"/>
+            <property name="allowEmptyTypes" value="true"/>
+            <property name="allowEmptyLoops" value="true"/>
+            <message key="ws.notFollowed"
+                     value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
+            <message key="ws.notPreceded"
+                     value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+        </module>
+        <module name="WhitespaceAfter"/>
+        <module name="OneStatementPerLine"/>
+        <module name="MultipleVariableDeclarations"/>
+        <module name="ArrayTypeStyle"/>
+        <module name="MissingSwitchDefault"/>
+        <module name="FallThrough"/>
+        <module name="SimplifyBooleanExpression"/>
+        <module name="SimplifyBooleanReturn"/>
+        <module name="StringLiteralEquality"/>
+        <module name="UnnecessaryParentheses"/>
+        <module name="UpperEll"/>
+        <module name="ModifierOrder"/>
+        <module name="RedundantModifier"/>
+        <module name="EmptyLineSeparator">
+            <property name="allowNoEmptyLineBetweenFields" value="true"/>
+        </module>
+        <module name="SeparatorWrap">
+            <property name="tokens" value="DOT"/>
+            <property name="option" value="nl"/>
+        </module>
+        <module name="SeparatorWrap">
+            <property name="tokens" value="COMMA"/>
+            <property name="option" value="EOL"/>
+        </module>
+        <module name="PackageName">
+            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+            <message key="name.invalidPattern"
+                     value="Package name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="TypeName">
+            <message key="name.invalidPattern"
+                     value="Type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="MemberName">
+            <property name="format" value="^m_[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <message key="name.invalidPattern"
+                     value="Member name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="ParameterName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <message key="name.invalidPattern"
+                     value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="CatchParameterName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <message key="name.invalidPattern"
+                     value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="LocalVariableName">
+            <property name="tokens" value="VARIABLE_DEF"/>
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <property name="allowOneCharVarInForLoop" value="true"/>
+            <message key="name.invalidPattern"
+                     value="Local variable name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="ClassTypeParameterName">
+            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+            <message key="name.invalidPattern"
+                     value="Class type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="MethodTypeParameterName">
+            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+            <message key="name.invalidPattern"
+                     value="Method type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="InterfaceTypeParameterName">
+            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+            <message key="name.invalidPattern"
+                     value="Interface type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="NoFinalizer"/>
+        <module name="GenericWhitespace">
+            <message key="ws.followed"
+                     value="GenericWhitespace ''{0}'' is followed by whitespace."/>
+            <message key="ws.preceded"
+                     value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
+            <message key="ws.illegalFollow"
+                     value="GenericWhitespace ''{0}'' should followed by whitespace."/>
+            <message key="ws.notPreceded"
+                     value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
+        </module>
+        <module name="Indentation">
+            <property name="basicOffset" value="2"/>
+            <property name="braceAdjustment" value="0"/>
+            <property name="caseIndent" value="2"/>
+            <property name="throwsIndent" value="4"/>
+            <property name="lineWrappingIndentation" value="4"/>
+            <property name="arrayInitIndent" value="2"/>
+        </module>
+        <module name="AbbreviationAsWordInName">
+            <property name="ignoreFinal" value="false"/>
+            <property name="allowedAbbreviationLength" value="3"/>
+        </module>
+        <module name="OverloadMethodsDeclarationOrder"/>
+        <module name="VariableDeclarationUsageDistance"/>
+        <module name="MethodParamPad"/>
+        <module name="TypecastParenPad"/>
+        <module name="OperatorWrap">
+            <property name="option" value="NL"/>
+            <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
+        </module>
+        <module name="AnnotationLocation">
+            <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
+        </module>
+        <module name="AnnotationLocation">
+            <property name="tokens" value="VARIABLE_DEF"/>
+            <property name="allowSamelineMultipleAnnotations" value="true"/>
+        </module>
+        <module name="NonEmptyAtclauseDescription"/>
+        <module name="JavadocTagContinuationIndentation"/>
+        <module name="SummaryJavadoc">
+            <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
+        </module>
+        <module name="JavadocParagraph"/>
+        <module name="AtclauseOrder">
+            <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
+            <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
+        </module>
+        <module name="JavadocMethod">
+            <property name="scope" value="public"/>
+            <property name="allowMissingParamTags" value="true"/>
+            <property name="allowMissingThrowsTags" value="true"/>
+            <property name="allowMissingReturnTag" value="true"/>
+            <property name="minLineCount" value="2"/>
+            <property name="allowedAnnotations"
+                      value="Override, Test, Before, After, BeforeClass, AfterClass, Parameters"/>
+            <property name="allowUndeclaredRTE" value="true"/>
+            <property name="allowThrowsTagsForSubclasses" value="true"/>
+            <property name="suppressLoadErrors" value="true"/>
+        </module>
+        <module name="MethodName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
+            <message key="name.invalidPattern"
+                     value="Method name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="SingleLineJavadoc">
+            <property name="ignoreInlineTags" value="false"/>
+        </module>
+        <module name="EmptyCatchBlock">
+            <property name="exceptionVariableName" value="expected"/>
+        </module>
+        <module name="CommentsIndentation"/>
+    </module>
+</module>
diff --git a/third_party/allwpilib_2018/styleguide/checkstyleEclipse.xml b/third_party/allwpilib_2018/styleguide/checkstyleEclipse.xml
new file mode 100644
index 0000000..ee6ca99
--- /dev/null
+++ b/third_party/allwpilib_2018/styleguide/checkstyleEclipse.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+        "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+        "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<!--
+    Checkstyle configuration that checks the Google coding conventions from Google Java Style
+    that can be found at https://google.github.io/styleguide/javaguide.html.
+
+    Checkstyle is very configurable. Be sure to read the documentation at
+    http://checkstyle.sf.net (or in your downloaded distribution).
+
+    To completely disable a check, just comment it out or delete it from the file.
+
+    Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
+ -->
+
+<module name = "Checker">
+    <property name="charset" value="UTF-8"/>
+
+    <property name="severity" value="error"/>
+
+    <property name="fileExtensions" value="java, properties, xml"/>
+
+    <module name="SuppressWarningsFilter" />
+
+    <module name="TreeWalker">
+        <property name="tabWidth" value="2"/>
+        <module name="RegexpSinglelineJava">
+            <property name="format" value="^\t* "/>
+            <property name="message" value="Indent must use tab characters"/>
+            <property name="ignoreComments" value="true"/>
+        </module>
+        <module name="SuppressWarningsHolder" />
+        <module name="OuterTypeFilename"/>
+        <module name="IllegalTokenText">
+            <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
+            <property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
+            <property name="message" value="Avoid using corresponding octal or Unicode escape."/>
+        </module>
+        <module name="AvoidEscapedUnicodeCharacters">
+            <property name="allowEscapesForControlCharacters" value="true"/>
+            <property name="allowByTailComment" value="true"/>
+            <property name="allowNonPrintableEscapes" value="true"/>
+        </module>
+        <module name="LineLength">
+            <property name="max" value="80"/>
+            <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
+        </module>
+        <module name="AvoidStarImport"/>
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+        <module name="OneTopLevelClass"/>
+        <module name="NoLineWrap"/>
+        <module name="EmptyBlock">
+            <property name="option" value="TEXT"/>
+            <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
+        </module>
+        <module name="NeedBraces"/>
+        <module name="LeftCurly">
+            <property name="maxLineLength" value="80"/>
+        </module>
+        <module name="RightCurly"/>
+        <module name="RightCurly">
+            <property name="option" value="alone"/>
+            <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, LITERAL_DO, STATIC_INIT, INSTANCE_INIT"/>
+        </module>
+        <module name="WhitespaceAround">
+            <property name="allowEmptyConstructors" value="true"/>
+            <property name="allowEmptyMethods" value="true"/>
+            <property name="allowEmptyTypes" value="true"/>
+            <property name="allowEmptyLoops" value="true"/>
+            <message key="ws.notFollowed"
+                     value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
+            <message key="ws.notPreceded"
+                     value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+        </module>
+        <module name="WhitespaceAfter"/>
+        <module name="OneStatementPerLine"/>
+        <module name="MultipleVariableDeclarations"/>
+        <module name="ArrayTypeStyle"/>
+        <module name="MissingSwitchDefault"/>
+        <module name="FallThrough"/>
+        <module name="UpperEll"/>
+        <module name="ModifierOrder"/>
+        <module name="EmptyLineSeparator">
+            <property name="allowNoEmptyLineBetweenFields" value="true"/>
+        </module>
+        <module name="SeparatorWrap">
+            <property name="tokens" value="DOT"/>
+            <property name="option" value="nl"/>
+        </module>
+        <module name="SeparatorWrap">
+            <property name="tokens" value="COMMA"/>
+            <property name="option" value="EOL"/>
+        </module>
+        <module name="PackageName">
+            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+            <message key="name.invalidPattern"
+                     value="Package name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="TypeName">
+            <message key="name.invalidPattern"
+                     value="Type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="MemberName">
+            <property name="format" value="^m_[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <message key="name.invalidPattern"
+                     value="Member name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="ParameterName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <message key="name.invalidPattern"
+                     value="Parameter name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="CatchParameterName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <message key="name.invalidPattern"
+                     value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="LocalVariableName">
+            <property name="tokens" value="VARIABLE_DEF"/>
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
+            <property name="allowOneCharVarInForLoop" value="true"/>
+            <message key="name.invalidPattern"
+                     value="Local variable name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="ClassTypeParameterName">
+            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+            <message key="name.invalidPattern"
+                     value="Class type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="MethodTypeParameterName">
+            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+            <message key="name.invalidPattern"
+                     value="Method type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="InterfaceTypeParameterName">
+            <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
+            <message key="name.invalidPattern"
+                     value="Interface type name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="NoFinalizer"/>
+        <module name="GenericWhitespace">
+            <message key="ws.followed"
+                     value="GenericWhitespace ''{0}'' is followed by whitespace."/>
+            <message key="ws.preceded"
+                     value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
+            <message key="ws.illegalFollow"
+                     value="GenericWhitespace ''{0}'' should followed by whitespace."/>
+            <message key="ws.notPreceded"
+                     value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
+        </module>
+        <module name="Indentation">
+            <property name="basicOffset" value="2"/>
+            <property name="braceAdjustment" value="0"/>
+            <property name="caseIndent" value="2"/>
+            <property name="throwsIndent" value="4"/>
+            <property name="lineWrappingIndentation" value="4"/>
+            <property name="arrayInitIndent" value="2"/>
+        </module>
+        <module name="AbbreviationAsWordInName">
+            <property name="ignoreFinal" value="false"/>
+            <property name="allowedAbbreviationLength" value="3"/>
+        </module>
+        <module name="OverloadMethodsDeclarationOrder"/>
+        <module name="VariableDeclarationUsageDistance">
+            <property name="allowedDistance" value="8"/>
+        </module>
+        <module name="MethodParamPad"/>
+        <module name="TypecastParenPad"/>
+        <module name="OperatorWrap">
+            <property name="option" value="NL"/>
+            <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR "/>
+        </module>
+        <module name="AnnotationLocation">
+            <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
+        </module>
+        <module name="AnnotationLocation">
+            <property name="tokens" value="VARIABLE_DEF"/>
+            <property name="allowSamelineMultipleAnnotations" value="true"/>
+        </module>
+        <module name="NonEmptyAtclauseDescription"/>
+        <module name="JavadocTagContinuationIndentation"/>
+        <module name="SummaryJavadoc">
+            <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
+        </module>
+        <module name="JavadocParagraph"/>
+        <module name="AtclauseOrder">
+            <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
+            <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
+        </module>
+        <module name="JavadocMethod">
+            <property name="allowMissingParamTags" value="true"/>
+            <property name="allowMissingThrowsTags" value="true"/>
+            <property name="allowMissingReturnTag" value="true"/>
+            <property name="minLineCount" value="2"/>
+            <property name="allowedAnnotations"
+                      value="Override, Test, Before, After, BeforeClass, AfterClass, Parameters"/>
+            <property name="allowUndeclaredRTE" value="true"/>
+            <property name="allowThrowsTagsForSubclasses" value="true"/>
+            <property name="suppressLoadErrors" value="true"/>
+            <property name="tokens" value="METHOD_DEF, ANNOTATION_FIELD_DEF"/>
+        </module>
+        <module name="MethodName">
+            <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
+            <message key="name.invalidPattern"
+                     value="Method name ''{0}'' must match pattern ''{1}''."/>
+        </module>
+        <module name="SingleLineJavadoc">
+            <property name="ignoreInlineTags" value="false"/>
+        </module>
+        <module name="EmptyCatchBlock">
+            <property name="exceptionVariableName" value="expected"/>
+        </module>
+        <module name="CommentsIndentation"/>
+    </module>
+</module>
diff --git a/third_party/allwpilib_2018/styleguide/pmd-ruleset.xml b/third_party/allwpilib_2018/styleguide/pmd-ruleset.xml
new file mode 100644
index 0000000..950c133
--- /dev/null
+++ b/third_party/allwpilib_2018/styleguide/pmd-ruleset.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<ruleset name="WPILibRuleset"
+         xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
+    <rule ref="rulesets/java/basic.xml" />
+    <rule ref="rulesets/java/braces.xml" />
+    <rule ref="rulesets/java/empty.xml" />
+    <rule ref="rulesets/java/empty.xml/EmptyCatchBlock">
+        <properties>
+            <property name="allowCommentedBlocks" value="true"/>
+        </properties>
+    </rule>
+    <rule ref="rulesets/java/imports.xml" />
+    <rule ref="rulesets/java/junit.xml">
+        <exclude name="JUnitTestContainsTooManyAsserts" />
+    </rule>
+    <rule ref="rulesets/java/strings.xml">
+        <exclude name="AvoidDuplicateLiterals" />
+    </rule>
+    <rule ref="rulesets/java/unnecessary.xml" />
+    <rule ref="rulesets/java/unusedcode.xml" />
+    <rule ref="rulesets/java/unusedcode.xml/UnusedFormalParameter">
+        <properties>
+            <property name="checkAll" value="true"/>
+        </properties>
+    </rule>
+
+    <!-- Custom Rules -->
+
+    <rule name="UseRequireNonNull"
+          message="Use Objects.requireNonNull() instead of throwing a NullPointerException yourself."
+          language="java"
+          class="net.sourceforge.pmd.lang.rule.XPathRule">
+        <description>
+           Use Objects.requireNonNull() instead of throwing a NullPointerException yourself.
+        </description>
+        <properties>
+            <property name="xpath">
+                <value>
+                    <![CDATA[
+                        //IfStatement[child::Expression//NullLiteral]/Statement//ThrowStatement/Expression/PrimaryExpression/PrimaryPrefix/AllocationExpression/ClassOrInterfaceType[@Image='NullPointerException']
+                    ]]>
+                </value>
+            </property>
+        </properties>
+        <priority>3</priority>
+        <example>
+            <![CDATA[
+                public class Example {
+	                public Example(Object example) {
+		                if (example == null) {
+			                throw new NullPointerException();
+		                }
+	                }
+                }
+            ]]>
+        </example>
+    </rule>
+
+</ruleset>
diff --git a/third_party/allwpilib_2018/styleguide/suppressions.xml b/third_party/allwpilib_2018/styleguide/suppressions.xml
new file mode 100644
index 0000000..9c98b44
--- /dev/null
+++ b/third_party/allwpilib_2018/styleguide/suppressions.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE suppressions PUBLIC
+        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+        "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+<suppressions>
+    <suppress files=".*sim.*" checks="[a-zA-Z0-9]*"/>
+    <suppress files="edu.wpi.first.wpilibj.util.WPILibVersion" checks="[a-zA-Z0-9]*"/>
+</suppressions>
diff --git a/third_party/allwpilib_2018/test-scripts/.gitattributes b/third_party/allwpilib_2018/test-scripts/.gitattributes
new file mode 100644
index 0000000..cb5c152
--- /dev/null
+++ b/third_party/allwpilib_2018/test-scripts/.gitattributes
@@ -0,0 +1,4 @@
+# Set the default behavior, in case people don't have core.autocrlf set.
+* text=auto
+
+*.sh text eol=lf
diff --git a/third_party/allwpilib_2018/test-scripts/README.md b/third_party/allwpilib_2018/test-scripts/README.md
new file mode 100644
index 0000000..a96764e
--- /dev/null
+++ b/third_party/allwpilib_2018/test-scripts/README.md
@@ -0,0 +1,17 @@
+# WPILIB TEST SCRIPTS
+## Overview
+These test scripts are designed to allow the user of the WPILib test framework to quickly and easily deploy and run their tests on the WPI roboRIO.
+
+In order for the automated test system to work there is a driverstation onboard the roboRIO that handles a queue of users waiting to use the driver station. All of the interaction with this queue is handled internally by test scripts contained within this folder.
+
+If you deploy code to the test stand using the Eclipse plugins, you _must_ remove the build artifacts in `/home/lvuser`, or you will break tests.
+
+## roboRIO Setup
+The roboRIO on the test bench must be updated everytime NI releases a new image.
+
+1. [Use the roboRIO Imaging Tool to format the roboRIO with the lastest image.](https://wpilib.screenstepslive.com/s/4485/m/13503/l/144984-imaging-your-roborio)
+2. [Install Java on the roboRIO.](https://wpilib.screenstepslive.com/s/4485/m/13503/l/599747-installing-java-8-on-the-roborio-using-the-frc-roborio-java-installer-java-only)
+3. SFTP the [teststand, netconsole, and libstdc++ ipk files](https://users.wpi.edu/~phplenefisch/ipk/) on to the roboRIO.
+4. ssh on to the roboRIO as the admin user (ex: `ssh admin@roboRIO-190-FRC.local`)
+5. Use opkg to install the ipk files (ex: `opkg install teststand_1.2-1_armv7a-vfp.ipk`)
+6. Reboot the roboRIO
diff --git a/third_party/allwpilib_2018/test-scripts/config.sh b/third_party/allwpilib_2018/test-scripts/config.sh
new file mode 100755
index 0000000..48eeda4
--- /dev/null
+++ b/third_party/allwpilib_2018/test-scripts/config.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+#*----------------------------------------------------------------------------*#
+#* Copyright (c) FIRST 2014. All Rights Reserved.							  *#
+#* Open Source Software - may be modified and shared by FRC teams. The code   *#
+#* must be accompanied by the FIRST BSD license file in the root directory of *#
+#* the project.															      *#
+#*----------------------------------------------------------------------------*#
+
+# If this is changed, update the .gitignore
+# so that test results are not commited to the repo
+DEFAULT_LOCAL_TEST_RESULTS_DIR=../test-reports
+
+ROBOT_ADDRESS=admin@roboRIO-190-FRC.local
+ADMIN_ROBOT_ADDRESS=admin@roboRIO-190-FRC.local
+DEFAULT_LOCAL_RUN_TEST_SCRIPT="run-tests-on-robot.sh"
+
+DEFAULT_DESTINATION_DIR=/home/admin
+DEFAULT_TEST_SCP_DIR=${DEFAULT_DESTINATION_DIR}/deployedTests
+DEFAULT_DESTINATION_TEST_RESULTS_DIR=${DEFAULT_DESTINATION_DIR}/testResults
+
+# C++ test variables
+DEFAULT_CPP_TEST_NAME=FRCUserProgram
+DEFAULT_CPP_TEST_ARGS="--gtest_color=yes"
+DEFAULT_LOCAL_CPP_TEST_FILE=../build/integrationTestFiles/cpp/FRCUserProgram
+
+CPP_REPORT=cppreport.xml
+DEFAULT_LOCAL_CPP_TEST_RESULT=${DEFAULT_LOCAL_TEST_RESULTS_DIR}/${CPP_REPORT}
+DEFAULT_DESTINATION_CPP_TEST_RESULTS=${DEFAULT_DESTINATION_TEST_RESULTS_DIR}/${CPP_REPORT}
+
+# Java test variables
+DEFAULT_JAVA_TEST_NAME=FRCUserProgram.jar
+DEFAULT_JAVA_TEST_ARGS=""
+
+DEFAULT_LOCAL_JAVA_TEST_FILE=../build/integrationTestFiles/java/wpilibjIntegrationTests-all.jar
+
+JAVA_REPORT=javareport.xml
+DEFAULT_LIBRARY_NATIVE_FILES=../build/integrationTestFiles/libs
+DEFAULT_LIBRARY_NATIVE_DESTINATION=/usr/local/frc/lib
+DEFAULT_LOCAL_JAVA_TEST_RESULT=${DEFAULT_LOCAL_TEST_RESULTS_DIR}/${JAVA_REPORT}
+DEFAULT_DESTINATION_JAVA_TEST_RESULTS=${DEFAULT_DESTINATION_TEST_RESULTS_DIR}/AntReports/TEST-edu.wpi.first.wpilibj.test.TestSuite.xml
diff --git a/third_party/allwpilib_2018/test-scripts/deploy-and-run-test-on-robot.sh b/third_party/allwpilib_2018/test-scripts/deploy-and-run-test-on-robot.sh
new file mode 100755
index 0000000..c2d896e
--- /dev/null
+++ b/third_party/allwpilib_2018/test-scripts/deploy-and-run-test-on-robot.sh
@@ -0,0 +1,89 @@
+#!/usr/bin/env bash
+#*----------------------------------------------------------------------------*#
+#* Copyright (c) FIRST 2014. All Rights Reserved.							  *#
+#* Open Source Software - may be modified and shared by FRC teams. The code   *#
+#* must be accompanied by the FIRST BSD license file in the root directory of *#
+#* the project.															      *#
+#*----------------------------------------------------------------------------*#
+
+# Configurable variables
+source config.sh
+
+# Java variables
+DEFAULT_DESTINATION_JAVA_TEST_FILE=${DEFAULT_TEST_SCP_DIR}/${DEFAULT_JAVA_TEST_NAME}
+
+# C++ Variables
+DEFAULT_DESTINATION_CPP_TEST_FILE=${DEFAULT_TEST_SCP_DIR}/${DEFAULT_CPP_TEST_NAME}
+
+DEFAULT_DESTINATION_RUN_TEST_SCRIPT=${DEFAULT_DESTINATION_DIR}/${DEFAULT_LOCAL_RUN_TEST_SCRIPT}
+
+usage="$(basename "$0") [-h] (java|cpp) [-A] [arg] [arg]...
+A script designed to run the integration tests.
+This script should only be run on the roborio.
+Where:
+    -h    Show this help text.
+    -A    Disable language recomended arguments.
+    arg   Additional arguments to be passed to test."
+
+
+# These variables are set when the language is selected
+LANGUAGE=none
+LOCAL_TEST_FILE=none
+DESTINATION_TEST_FILE=none
+LIBRARY_FILES=none
+TEST_RUN_ARGS=""
+
+# Begin searching for options from the third paramater on
+PARAM_ARGS=${@:2}
+
+if [[ "$1" = java ]]; then
+	LANGUAGE=$1
+	LOCAL_TEST_FILE=$DEFAULT_LOCAL_JAVA_TEST_FILE
+	DESTINATION_TEST_FILE=$DEFAULT_DESTINATION_JAVA_TEST_FILE
+elif [[ "$1" = cpp ]]; then
+	LANGUAGE=$1
+	LOCAL_TEST_FILE=$DEFAULT_LOCAL_CPP_TEST_FILE
+	DESTINATION_TEST_FILE=$DEFAULT_DESTINATION_CPP_TEST_FILE
+elif [[ "$1" = "-h" ]]; then
+	printf "Usage:\n"
+	echo "$usage"
+	exit
+else
+	printf "Invalid language selection: %s\n\n" "$1" >&2
+	echo "$usage" >&2
+	exit 1
+fi
+
+# Check if the test file to upload exists
+if [[ ! -e ${LOCAL_TEST_FILE} ]]; then
+	printf "The test file does not exist: %s\nAre you sure that you compiled the tests??\n\n" "${LOCAL_TEST_FILE}" >&2
+	echo "$usage" >&2
+	exit 1
+fi
+
+TEST_RUN_ARGS="${@:2}"
+
+shopt -s huponexit
+
+SCP_TEST_SCRIPT="scp config.sh ${DEFAULT_LOCAL_RUN_TEST_SCRIPT} ${ROBOT_ADDRESS}:/${DEFAULT_DESTINATION_DIR}"
+SSH_CHMOD_AND_MAKE_TEMP_TEST_DIR="ssh -t ${ROBOT_ADDRESS} \"chmod a+x ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT}; mkdir ${DEFAULT_TEST_SCP_DIR}; touch ${DESTINATION_TEST_FILE}\""
+SCP_TEST_PROGRAM="scp ${LOCAL_TEST_FILE} ${ROBOT_ADDRESS}:${DESTINATION_TEST_FILE}"
+SSH_RUN_TESTS="ssh -t ${ROBOT_ADDRESS} ${DEFAULT_DESTINATION_RUN_TEST_SCRIPT} ${LANGUAGE} $(whoami) -d ${DEFAULT_TEST_SCP_DIR} ${TEST_RUN_ARGS}"
+SCP_NATIVE_LIBRARIES="scp ${DEFAULT_LIBRARY_NATIVE_FILES}/* ${ROBOT_ADDRESS}:${DEFAULT_LIBRARY_NATIVE_DESTINATION}"
+CONFIG_NATIVE_LIBRARIES="ssh -t ${ADMIN_ROBOT_ADDRESS} ldconfig"
+
+if [ $(which sshpass) ]; then
+	sshpass -p "" ${SCP_NATIVE_LIBRARIES}
+	sshpass -p "" ${CONFIG_NATIVE_LIBRARIES}
+	sshpass -p "" ${SCP_TEST_SCRIPT}
+	sshpass -p "" ${SSH_CHMOD_AND_MAKE_TEMP_TEST_DIR}
+	sshpass -p "" ${SCP_TEST_PROGRAM}
+	sshpass -p "" ${SSH_RUN_TESTS}
+else
+	eval ${SCP_NATIVE_LIBRARIES}
+	eval ${CONFIG_NATIVE_LIBRARIES}
+	eval ${SCP_TEST_SCRIPT}
+	eval ${SSH_CHMOD_AND_MAKE_TEMP_TEST_DIR}
+	eval ${SCP_TEST_PROGRAM}
+	eval ${SSH_RUN_TESTS}
+fi
diff --git a/third_party/allwpilib_2018/test-scripts/jenkins-run-tests-get-results.sh b/third_party/allwpilib_2018/test-scripts/jenkins-run-tests-get-results.sh
new file mode 100755
index 0000000..d1975f4
--- /dev/null
+++ b/third_party/allwpilib_2018/test-scripts/jenkins-run-tests-get-results.sh
@@ -0,0 +1,79 @@
+#!/usr/bin/env bash
+#*----------------------------------------------------------------------------*#
+#* Copyright (c) FIRST 2014. All Rights Reserved.							  *#
+#* Open Source Software - may be modified and shared by FRC teams. The code   *#
+#* must be accompanied by the FIRST BSD license file in the root directory of *#
+#* the project.															      *#
+#*----------------------------------------------------------------------------*#
+
+# Configurable variables
+source config.sh
+
+(
+# Wait for lock
+printf "Getting exclusive lock for RIO execution...\n"
+flock -x 200 || exit 1
+
+# Ensure the teststand is dead
+SSH_STOP_TESTSTAND="ssh -t ${ROBOT_ADDRESS} sh -c '/etc/init.d/teststand stop; sleep 1'"
+if [ $(which sshpass) ]; then
+	sshpass -p "" ${SSH_STOP_TESTSTAND}
+else
+	eval ${SSH_STOP_TESTSTAND}
+fi
+
+# If there are already test results in the repository then remove them
+if [[ -e ${DEFAULT_LOCAL_TEST_RESULTS_DIR} ]]; then
+	rm -R ${DEFAULT_LOCAL_TEST_RESULTS_DIR}
+fi
+
+# Make the directory where the tests should live
+mkdir ${DEFAULT_LOCAL_TEST_RESULTS_DIR} 2>/dev/null
+
+# Remove the preivous test results from the the robot
+SSH_REMOVE_OLD_TEST_RESULTS="ssh -t ${ROBOT_ADDRESS} rm -R ${DEFAULT_DESTINATION_TEST_RESULTS_DIR}; mkdir ${DEFAULT_DESTINATION_TEST_RESULTS_DIR}"
+if [ $(which sshpass) ]; then
+	sshpass -p "" ${SSH_REMOVE_OLD_TEST_RESULTS}
+else
+	eval ${SSH_REMOVE_OLD_TEST_RESULTS}
+fi
+
+printf "Running cpp test\n"
+
+# Run the C++ Tests
+./deploy-and-run-test-on-robot.sh cpp -A "--gtest_output=xml:${DEFAULT_DESTINATION_CPP_TEST_RESULTS}"
+
+# Retrive the C++ Test Results
+SCP_GET_CPP_TEST_RESULT="scp ${ROBOT_ADDRESS}:${DEFAULT_DESTINATION_CPP_TEST_RESULTS} ${DEFAULT_LOCAL_CPP_TEST_RESULT}"
+if [ $(which sshpass) ]; then
+	sshpass -p "" ${SCP_GET_CPP_TEST_RESULT}
+else
+	eval ${SCP_GET_CPP_TEST_RESULT}
+fi
+
+sleep 10
+
+# Run the Java Tests
+./deploy-and-run-test-on-robot.sh java
+
+# Retrive the Java Test Results
+SCP_GET_JAVA_TEST_RESULT="scp ${ROBOT_ADDRESS}:${DEFAULT_DESTINATION_JAVA_TEST_RESULTS} ${DEFAULT_LOCAL_JAVA_TEST_RESULT}"
+if [ $(which sshpass) ]; then
+	sshpass -p "" ${SCP_GET_JAVA_TEST_RESULT}
+else
+	eval ${SCP_GET_JAVA_TEST_RESULT}
+fi
+
+# Make sure that we got test results back.
+if [ ! -e ${DEFAULT_LOCAL_CPP_TEST_RESULT} ]; then
+  echo "There are no results from the C++ tests; they must have failed."
+  exit 100
+fi
+
+if [ ! -e ${DEFAULT_LOCAL_JAVA_TEST_RESULT} ]; then
+  echo "There are no results from the Java tests; they must have failed."
+  exit 101
+fi
+
+# The mutex is released when this program exits
+) 200>/var/lock/jenkins.rio.exclusivelock
diff --git a/third_party/allwpilib_2018/test-scripts/run-tests-on-robot.sh b/third_party/allwpilib_2018/test-scripts/run-tests-on-robot.sh
new file mode 100755
index 0000000..e0785ad
--- /dev/null
+++ b/third_party/allwpilib_2018/test-scripts/run-tests-on-robot.sh
@@ -0,0 +1,157 @@
+#!/usr/bin/env bash
+#*----------------------------------------------------------------------------*#
+#* Copyright (c) FIRST 2014. All Rights Reserved.							  *#
+#* Open Source Software - may be modified and shared by FRC teams. The code   *#
+#* must be accompanied by the FIRST BSD license file in the root directory of *#
+#* the project.															      *#
+#*----------------------------------------------------------------------------*#
+
+# This file is intended to be run in the DEFAULT_TEST_DIR on the roboRIO.
+# Do not attempt to run this file on your local system.
+# There is one file (delploy-and-run-test-on-robot.sh) that is designed to
+# deploy this file allong with the compiled tests for you.
+
+# Configurable variables
+source config.sh
+
+DEFAULT_TEST_DIR=${DEFAULT_DESTINATION_DIR}
+DEFAULT_PATH_TO_JRE=/usr/local/frc/JRE/bin/java
+
+usage="$(basename "$0") [-h] (java|cpp) name [-d test_dir] [-A] [arg] [arg]...
+A script designed to run the integration tests.
+This script should only be run on the roborio.
+Where:
+    -h    Show this help text
+    name  The name of the user trying to run the tests (used for driver station)
+    -d    The directory where the tests have been placed.
+          This is done to prevent overwriting an already running program.
+          This scrip will automatically move the test into the ${DEFAULT_TEST_DIR}
+          directory.
+          Default: Assumes the test is in the same directory as this scrip.
+    -A    Do not use the default arguments for the given language.
+    arg   The arguments to be passed to test."
+
+
+# Are you trying to run this program on a platform other than the roboRIO?
+if [[ ! -e "${DEFAULT_TEST_DIR}" ]]; then
+	printf "Failed to find %s\nAre you trying to run this file on your local computer?\n" "${DEFAULT_TEST_DIR}"
+	printf "This script should only be run on the roboRIO.\n\n"
+	echo "$usage"
+	exit 1
+fi
+
+LANGUAGE=none
+TEST_FILE=none
+NAME=$2
+TEST_DIR="$DEFAULT_TEST_DIR"
+# Begin searching for options from the third paramater on
+PARAM_ARGS=${@:3}
+# Where the test arguments start
+TEST_RUN_ARGS=${@:3}
+RUN_WITH_DEFAULT_ARGS=true
+DEFAULT_ARGS=""
+
+# Determine the language that we are attempting to run
+if [[ "$1" = java ]]; then
+	LANGUAGE=$1
+	TEST_FILE=$DEFAULT_JAVA_TEST_NAME
+	DEFAULT_ARGS=$DEFAULT_JAVA_TEST_ARGS
+elif [[ "$1" = cpp ]]; then
+	LANGUAGE=$1
+	TEST_FILE=$DEFAULT_CPP_TEST_NAME
+	DEFAULT_ARGS=$DEFAULT_CPP_TEST_ARGS
+elif [[ "$1" = "-h" ]]; then
+	#If the first argument is the help option
+	#Allow it to be searhced for in getopts
+	PARAM_ARGS=${@}
+else
+	printf "Invalid language selection: %s\n\n" "$1" >&2
+	echo "$usage" >&2
+	exit 1
+fi
+
+PARAM_COUNTER=2
+printf "Param Args ${PARAM_ARGS}\n"
+
+# Check for optional paramaters
+while  getopts ':hmd:A' option $PARAM_ARGS ; do
+	case "$option" in
+	h)
+		# Print the help message
+		printf "Usage:\n"
+		echo "$usage"
+		exit
+		;;
+	A)
+		# Remove the default arguments
+		RUN_WITH_DEFAULT_ARGS=false
+		PARAM_COUNTER=$[$PARAM_COUNTER +1]
+		;;
+	d)
+		TEST_DIR=$OPTARG
+		# Since we are selecting the directory the run args start from the 5th argument
+		PARAM_COUNTER=$[$PARAM_COUNTER +2]
+		;;
+	?)
+		# When an unknown param is found then we are done so break
+		break
+		;;
+	esac
+done
+
+TEST_RUN_ARGS=${@:$[$PARAM_COUNTER +1]}
+
+if [[ "$RUN_WITH_DEFAULT_ARGS" == true ]]; then
+	TEST_RUN_ARGS="${DEFAULT_ARGS} ${TEST_RUN_ARGS}"
+fi
+
+# Make sure at least two paramaters are passed or four if running with -d option
+if [[ $# -lt $PARAM_COUNTER ]]; then
+	printf "Invalid arg count. Should be %s, was %s.\n" "${PARAM_COUNTER}" "$#"
+	echo "$usage"
+	exit 1
+fi
+
+# Kill all running robot programs
+killall java FRCUserProgram
+
+# If we are running with the -d argument move the test to the DEFAULT_TEST_DIR
+if [[ ! -e "${TEST_DIR}/${TEST_FILE}" ]]; then
+	printf "Failed to find %s.\nDid you copy the test file correctly?\n" "${TEST_DIR}/${TEST_FILE}"
+	echo "$usage"
+	exit 1
+elif [[ $TEST_DIR != "$DEFAULT_TEST_DIR" ]]; then
+	mv "${TEST_DIR}/${TEST_FILE}" "${DEFAULT_TEST_DIR}"
+fi
+
+# Make sure the excecutable file has permission to run
+
+# Get the serial number and FPGADeviceCode for this rio
+export serialnum=`/sbin/fw_printenv -n serial#`
+export eval `/sbin/fw_printenv DeviceCode FPGADeviceCode DeviceDesc TargetClass`
+
+# Store the run command for the language
+RUN_COMMAND=none
+if [[ ${LANGUAGE} = java ]]; then
+	chmod a+x ${DEFAULT_JAVA_TEST_NAME}
+	RUN_COMMAND="env LD_LIBRARY_PATH=/opt/GenICam_v3_0_NI/bin/Linux32_ARM/:/usr/local/frc/lib ${DEFAULT_PATH_TO_JRE} -ea -jar ${DEFAULT_JAVA_TEST_NAME} ${TEST_RUN_ARGS}"
+elif [[ ${LANGUAGE} = cpp ]]; then
+	chmod a+x ${DEFAULT_CPP_TEST_NAME}
+	RUN_COMMAND="./${DEFAULT_CPP_TEST_NAME} ${TEST_RUN_ARGS}"
+fi
+
+printf "Running: %s\n\n" "${RUN_COMMAND}"
+COREDUMP_DIR=${DEFAULT_DESTINATION_TEST_RESULTS_DIR}/coredump
+mkdir -p ${COREDUMP_DIR}
+CORE_LOCATION=${COREDUMP_DIR}/core
+echo ${CORE_LOCATION} > /proc/sys/kernel/core_pattern
+ulimit -c unlimited
+eval ${RUN_COMMAND}
+if [[ $? -gt 127 && -e ${CORE_LOCATION} ]]; then
+	mv ${CORE_LOCATION} ${COREDUMP_DIR}/core.${LANGUAGE}
+	if [[ ${LANGUAGE} = java ]]; then
+		cp -p ${DEFAULT_JAVA_TEST_NAME} ${COREDUMP_DIR}/
+	elif [[ ${LANGUAGE} = cpp ]]; then
+		cp -p ${DEFAULT_CPP_TEST_NAME} ${COREDUMP_DIR}/
+	fi
+fi
diff --git a/third_party/allwpilib_2018/wpilibc/build.gradle b/third_party/allwpilib_2018/wpilibc/build.gradle
new file mode 100644
index 0000000..23d06a3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/build.gradle
@@ -0,0 +1,233 @@
+apply plugin: 'cpp'
+apply plugin: 'google-test'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+
+apply from: '../config.gradle'
+
+ext.addWpilibCCompilerArguments = { binary->
+    binary.tasks.withType(CppCompile) {
+        binary.cppCompiler.args "-DNAMESPACED_WPILIB"
+    }
+}
+
+ext.addWpilibCToLinker = { binary->
+    binary.lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
+}
+
+def versionClass = """
+/*
+ * Autogenerated file! Do not manually edit this file. This version is regenerated
+ * any time the publish task is run, or when this file is deleted.
+ */
+const char* GetWPILibVersion() {
+  return "${WPILibVersion.version}";
+}
+""".trim()
+
+def wpilibVersionFile = file('src/main/native/cpp/WPILibVersion.cpp')
+
+def willPublish = false
+gradle.taskGraph.addTaskExecutionGraphListener { graph ->
+    willPublish = graph.hasTask(publish)
+}
+
+task generateCppVersion() {
+    description = 'Generates the wpilib version class'
+    group = 'WPILib'
+
+    // We follow a simple set of checks to determine whether we should generate a new version file:
+    // 1. If the release type is not development, we generate a new verison file
+    // 2. If there is no generated version number, we generate a new version file
+    // 3. If there is a generated build number, and the release type is development, then we will
+    //    only generate if the publish task is run.
+    doLast {
+        if (!WPILibVersion.releaseType.toString().equalsIgnoreCase('official') && !willPublish && wpilibVersionFile.exists()) {
+            return
+        }
+        println "Writing version ${WPILibVersion.version} to $wpilibVersionFile"
+
+        if (wpilibVersionFile.exists()) {
+            wpilibVersionFile.delete()
+        }
+        wpilibVersionFile.write(versionClass)
+    }
+}
+
+clean {
+    delete wpilibVersionFile
+}
+
+model {
+    dependencyConfigs {
+        wpiutil(DependencyConfig) {
+            groupId = 'edu.wpi.first.wpiutil'
+            artifactId = 'wpiutil-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '3.+'
+            sharedConfigs = [ wpilibc: [],
+                              wpilibcTestingBaseTest: [],
+                              wpilibcDev: [] ]
+        }
+        ntcore(DependencyConfig) {
+            groupId = 'edu.wpi.first.ntcore'
+            artifactId = 'ntcore-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '4.+'
+            sharedConfigs = [ wpilibc: [],
+                              wpilibcTestingBaseTest: [],
+                              wpilibcDev: [] ]
+        }
+        opencv(DependencyConfig) {
+            groupId = 'org.opencv'
+            artifactId = 'opencv-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '3.2.0'
+            sharedConfigs = [ wpilibc: [],
+                              wpilibcTestingBaseTest: [],
+                              wpilibcDev: [] ]
+        }
+        cscore(DependencyConfig) {
+            groupId = 'edu.wpi.first.cscore'
+            artifactId = 'cscore-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '1.+'
+            sharedConfigs = [ wpilibc: [],
+                    wpilibcTestingBaseTest: [],
+                    wpilibcDev: [] ]
+        }
+    }
+    exportsConfigs {
+        wpilibc(ExportsConfig) {
+            x86ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVbad_cast',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure' ]
+            x64ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVbad_cast',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure' ]
+        }
+    }
+    components {
+        wpilibc(NativeLibrarySpec) {
+            sources {
+                cpp {
+                    source {
+                        srcDirs = [ 'src/main/native/cpp' ]
+                        includes = ["**/*.cpp"]
+                    }
+                    exportedHeaders {
+                        srcDirs = ["src/main/native/include"]
+                    }
+                }
+            }
+        }
+        // The TestingBase library is a workaround for an issue with the GoogleTest plugin.
+        // The plugin by default will rebuild the entire test source set, which increases
+        // build time. By testing an empty library, and then just linking the already built component
+        // into the test, we save the extra build
+        if (!project.hasProperty('onlyAthena')) {
+            wpilibcTestingBase(NativeLibrarySpec) { }
+        }
+        // By default, a development executable will be generated. This is to help the case of
+        // testing specific functionality of the library.
+        if (!project.hasProperty('skipDevExe')) {
+            wpilibcDev(NativeExecutableSpec) {
+                binaries.all {
+                    project.addWpilibCToLinker(it)
+                }
+                sources {
+                    cpp {
+                        source {
+                            srcDirs 'src/dev/native/cpp'
+                            include '**/*.cpp'
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/dev/native/include'
+                        }
+                    }
+                }
+            }
+        }
+    }
+    testSuites {
+        if (!project.hasProperty('onlyAthena')) {
+            wpilibcTestingBaseTest {
+                sources {
+                    cpp.source.srcDir 'src/test/native/cpp'
+                    cpp.exportedHeaders.srcDir 'src/test/native/include'
+                }
+            }
+        }
+    }
+    binaries {
+        all {
+            tasks.withType(CppCompile) {
+                dependsOn generateCppVersion
+            }
+            project(':ni-libraries').addNiLibrariesToLinker(it)
+            project(':hal').addHalToLinker(it)
+            project.addWpilibCCompilerArguments(it)
+        }
+        withType(GoogleTestTestSuiteBinarySpec) {
+            if (it.component.testedComponent.name.contains('TestingBase') && !project.hasProperty('onlyAthena')) {
+                project(':gmock').addGmockToLinker(it)
+                project.addWpilibCToLinker(it)
+            } else {
+                it.buildable = false
+            }
+        }
+    }
+    tasks {
+        runCpp(Exec) {
+            def found = false
+            $.components.each {
+                if (it in NativeExecutableSpec && it.name == 'wpilibcDev') {
+                    it.binaries.each {
+                        if (!found) {
+                            def arch = it.targetPlatform.architecture.name
+                            if (arch == 'x86-64' || arch == 'x86') {
+                                dependsOn it.tasks.install
+                                commandLine it.tasks.install.runScript
+                                found = true
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        getHeaders(Task) {
+            def list = []
+            $.components.each {
+                if (it in NativeLibrarySpec && it.name == 'wpilibc') {
+                    it.sources.each {
+                        it.exportedHeaders.srcDirs.each {
+                            list.add(it)
+                        }
+                    }
+                    it.binaries.each {
+                        it.libs.each {
+                            it.includeRoots.each {
+                                list.add(it)
+                            }
+                        }
+                    }
+                }
+            }
+            list = list.unique(false)
+            doLast {
+                list.each {
+                    print "WPIHEADER: "
+                    println it
+                }
+            }
+        }
+    }
+}
+
+apply from: 'publish.gradle'
diff --git a/third_party/allwpilib_2018/wpilibc/publish.gradle b/third_party/allwpilib_2018/wpilibc/publish.gradle
new file mode 100644
index 0000000..6277667
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/publish.gradle
@@ -0,0 +1,148 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion = ''
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'wpilibc'
+def artifactGroupId = 'edu.wpi.first.wpilibc'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibc'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibc'
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+build.dependsOn cppHeadersZip
+build.dependsOn cppSourcesZip
+
+def linkFile = project.file("${buildDir}/libwpi.so")
+
+task linkScriptZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibclinkscript-classifier'
+    classifier = "linuxathena"
+
+    from(licenseFile) {
+        into '/'
+    }
+    from (linkFile) {
+        into '/linux/athena/shared'
+    }
+}
+
+build.dependsOn linkScriptZip
+
+model {
+    publishing {
+        def wpilibCTaskList = createComponentZipTasks($.components, 'wpilibc', 'zipcpp', Zip, project, includeStandardZipFormat)
+        def allTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allTask = createAllCombined(wpilibCTaskList, 'wpilibc', 'zipcpp', Zip, project)
+        }
+
+        $.components.each {
+            if (it in NativeLibrarySpec && it.name == 'wpilibc') {
+                def libSpec = it
+                tasks.create('generateWpilibLinkScript', Task) {
+                    build.dependsOn it
+                    linkScriptZip.dependsOn it
+                    libSpec.binaries.each {
+                        if (getClassifier(it) == 'linuxathena' && it in SharedLibraryBinarySpec) {
+                            dependsOn it.buildTask
+                        }
+                    }
+
+                    outputs.file linkFile
+                    outputs.upToDateWhen { false }
+
+                    doLast {
+                        def libs = []
+                        libSpec.binaries.each {
+                            if (getClassifier(it) == 'linuxathena' && it in SharedLibraryBinarySpec) {
+                                it.libs.each {
+                                    it.linkFiles.each {
+                                        libs.add it.name
+                                    }
+
+                                }
+                                libs.add it.sharedLibraryFile.name
+                            }
+                        }
+
+                        linkFile.withWriter { out ->
+                            out.println '/* GNU ld script */'
+                            out.println 'OUTPUT_FORMAT(elf32-littlearm)'
+                            out.print 'GROUP ( AS_NEEDED ( '
+                            libs.each {
+                                out.print it
+                                out.print ' '
+                            }
+                            out.println ') )'
+                        }
+                    }
+                }
+            }
+        }
+
+
+
+        publications {
+            cpp(MavenPublication) {
+                wpilibCTaskList.each {
+                    artifact it
+                }
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allTask
+                }
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+                artifactId = baseArtifactId
+                groupId artifactGroupId
+                version pubVersion
+            }
+            linkscripts(MavenPublication) {
+                artifact linkScriptZip
+
+                artifactId = "${baseArtifactId}-linkscripts"
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/dev/native/cpp/main.cpp b/third_party/allwpilib_2018/wpilibc/src/dev/native/cpp/main.cpp
new file mode 100644
index 0000000..8fea95c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/dev/native/cpp/main.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include <HAL/HAL.h>
+
+#include "WPILibVersion.h"
+
+int main() {
+  std::cout << "Hello World" << std::endl;
+  std::cout << HAL_GetRuntimeType() << std::endl;
+  std::cout << GetWPILibVersion() << std::endl;
+  return 0;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp
new file mode 100644
index 0000000..3e1897a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL345_I2C.cpp
@@ -0,0 +1,88 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL345_I2C.h"
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+/**
+ * Constructs the ADXL345 Accelerometer over I2C.
+ *
+ * @param port          The I2C port the accelerometer is attached to
+ * @param range         The range (+ or -) that the accelerometer will measure
+ * @param deviceAddress The I2C address of the accelerometer (0x1D or 0x53)
+ */
+ADXL345_I2C::ADXL345_I2C(I2C::Port port, Range range, int deviceAddress)
+    : m_i2c(port, deviceAddress) {
+  // Turn on the measurements
+  m_i2c.Write(kPowerCtlRegister, kPowerCtl_Measure);
+  // Specify the data format to read
+  SetRange(range);
+
+  HAL_Report(HALUsageReporting::kResourceType_ADXL345,
+             HALUsageReporting::kADXL345_I2C, 0);
+  SetName("ADXL345_I2C", port);
+}
+
+void ADXL345_I2C::SetRange(Range range) {
+  m_i2c.Write(kDataFormatRegister,
+              kDataFormat_FullRes | static_cast<uint8_t>(range));
+}
+
+double ADXL345_I2C::GetX() { return GetAcceleration(kAxis_X); }
+
+double ADXL345_I2C::GetY() { return GetAcceleration(kAxis_Y); }
+
+double ADXL345_I2C::GetZ() { return GetAcceleration(kAxis_Z); }
+
+/**
+ * Get the acceleration of one axis in Gs.
+ *
+ * @param axis The axis to read from.
+ * @return Acceleration of the ADXL345 in Gs.
+ */
+double ADXL345_I2C::GetAcceleration(ADXL345_I2C::Axes axis) {
+  int16_t rawAccel = 0;
+  m_i2c.Read(kDataRegister + static_cast<int>(axis), sizeof(rawAccel),
+             reinterpret_cast<uint8_t*>(&rawAccel));
+  return rawAccel * kGsPerLSB;
+}
+
+/**
+ * Get the acceleration of all axes in Gs.
+ *
+ * @return An object containing the acceleration measured on each axis of the
+ *         ADXL345 in Gs.
+ */
+ADXL345_I2C::AllAxes ADXL345_I2C::GetAccelerations() {
+  AllAxes data = AllAxes();
+  int16_t rawData[3];
+  m_i2c.Read(kDataRegister, sizeof(rawData),
+             reinterpret_cast<uint8_t*>(rawData));
+
+  data.XAxis = rawData[0] * kGsPerLSB;
+  data.YAxis = rawData[1] * kGsPerLSB;
+  data.ZAxis = rawData[2] * kGsPerLSB;
+  return data;
+}
+
+void ADXL345_I2C::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("3AxisAccelerometer");
+  auto x = builder.GetEntry("X").GetHandle();
+  auto y = builder.GetEntry("Y").GetHandle();
+  auto z = builder.GetEntry("Z").GetHandle();
+  builder.SetUpdateTable([=]() {
+    auto data = GetAccelerations();
+    nt::NetworkTableEntry(x).SetDouble(data.XAxis);
+    nt::NetworkTableEntry(y).SetDouble(data.YAxis);
+    nt::NetworkTableEntry(z).SetDouble(data.ZAxis);
+  });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp
new file mode 100644
index 0000000..43257b8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL345_SPI.cpp
@@ -0,0 +1,115 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL345_SPI.h"
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+/**
+ * Constructor.
+ *
+ * @param port  The SPI port the accelerometer is attached to
+ * @param range The range (+ or -) that the accelerometer will measure
+ */
+ADXL345_SPI::ADXL345_SPI(SPI::Port port, ADXL345_SPI::Range range)
+    : m_spi(port) {
+  m_spi.SetClockRate(500000);
+  m_spi.SetMSBFirst();
+  m_spi.SetSampleDataOnFalling();
+  m_spi.SetClockActiveLow();
+  m_spi.SetChipSelectActiveHigh();
+
+  uint8_t commands[2];
+  // Turn on the measurements
+  commands[0] = kPowerCtlRegister;
+  commands[1] = kPowerCtl_Measure;
+  m_spi.Transaction(commands, commands, 2);
+
+  SetRange(range);
+
+  HAL_Report(HALUsageReporting::kResourceType_ADXL345,
+             HALUsageReporting::kADXL345_SPI);
+
+  SetName("ADXL345_SPI", port);
+}
+
+void ADXL345_SPI::SetRange(Range range) {
+  uint8_t commands[2];
+
+  // Specify the data format to read
+  commands[0] = kDataFormatRegister;
+  commands[1] = kDataFormat_FullRes | static_cast<uint8_t>(range & 0x03);
+  m_spi.Transaction(commands, commands, 2);
+}
+
+double ADXL345_SPI::GetX() { return GetAcceleration(kAxis_X); }
+
+double ADXL345_SPI::GetY() { return GetAcceleration(kAxis_Y); }
+
+double ADXL345_SPI::GetZ() { return GetAcceleration(kAxis_Z); }
+
+/**
+ * Get the acceleration of one axis in Gs.
+ *
+ * @param axis The axis to read from.
+ * @return Acceleration of the ADXL345 in Gs.
+ */
+double ADXL345_SPI::GetAcceleration(ADXL345_SPI::Axes axis) {
+  uint8_t buffer[3];
+  uint8_t command[3] = {0, 0, 0};
+  command[0] = (kAddress_Read | kAddress_MultiByte | kDataRegister) +
+               static_cast<uint8_t>(axis);
+  m_spi.Transaction(command, buffer, 3);
+
+  // Sensor is little endian... swap bytes
+  int16_t rawAccel = buffer[2] << 8 | buffer[1];
+  return rawAccel * kGsPerLSB;
+}
+
+/**
+ * Get the acceleration of all axes in Gs.
+ *
+ * @return An object containing the acceleration measured on each axis of the
+ *         ADXL345 in Gs.
+ */
+ADXL345_SPI::AllAxes ADXL345_SPI::GetAccelerations() {
+  AllAxes data = AllAxes();
+  uint8_t dataBuffer[7] = {0, 0, 0, 0, 0, 0, 0};
+  int16_t rawData[3];
+
+  // Select the data address.
+  dataBuffer[0] = (kAddress_Read | kAddress_MultiByte | kDataRegister);
+  m_spi.Transaction(dataBuffer, dataBuffer, 7);
+
+  for (int i = 0; i < 3; i++) {
+    // Sensor is little endian... swap bytes
+    rawData[i] = dataBuffer[i * 2 + 2] << 8 | dataBuffer[i * 2 + 1];
+  }
+
+  data.XAxis = rawData[0] * kGsPerLSB;
+  data.YAxis = rawData[1] * kGsPerLSB;
+  data.ZAxis = rawData[2] * kGsPerLSB;
+
+  return data;
+}
+
+void ADXL345_SPI::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("3AxisAccelerometer");
+  auto x = builder.GetEntry("X").GetHandle();
+  auto y = builder.GetEntry("Y").GetHandle();
+  auto z = builder.GetEntry("Z").GetHandle();
+  builder.SetUpdateTable([=]() {
+    auto data = GetAccelerations();
+    nt::NetworkTableEntry(x).SetDouble(data.XAxis);
+    nt::NetworkTableEntry(y).SetDouble(data.YAxis);
+    nt::NetworkTableEntry(z).SetDouble(data.ZAxis);
+  });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL362.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL362.cpp
new file mode 100644
index 0000000..e9fecd2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXL362.cpp
@@ -0,0 +1,175 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXL362.h"
+
+#include <HAL/HAL.h>
+
+#include "DriverStation.h"
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+static constexpr int kRegWrite = 0x0A;
+static constexpr int kRegRead = 0x0B;
+
+static constexpr int kPartIdRegister = 0x02;
+static constexpr int kDataRegister = 0x0E;
+static constexpr int kFilterCtlRegister = 0x2C;
+static constexpr int kPowerCtlRegister = 0x2D;
+
+// static constexpr int kFilterCtl_Range2G = 0x00;
+// static constexpr int kFilterCtl_Range4G = 0x40;
+// static constexpr int kFilterCtl_Range8G = 0x80;
+static constexpr int kFilterCtl_ODR_100Hz = 0x03;
+
+static constexpr int kPowerCtl_UltraLowNoise = 0x20;
+// static constexpr int kPowerCtl_AutoSleep = 0x04;
+static constexpr int kPowerCtl_Measure = 0x02;
+
+/**
+ * Constructor.  Uses the onboard CS1.
+ *
+ * @param range The range (+ or -) that the accelerometer will measure.
+ */
+ADXL362::ADXL362(Range range) : ADXL362(SPI::Port::kOnboardCS1, range) {}
+
+/**
+ * Constructor.
+ *
+ * @param port  The SPI port the accelerometer is attached to
+ * @param range The range (+ or -) that the accelerometer will measure.
+ */
+ADXL362::ADXL362(SPI::Port port, Range range) : m_spi(port) {
+  m_spi.SetClockRate(3000000);
+  m_spi.SetMSBFirst();
+  m_spi.SetSampleDataOnFalling();
+  m_spi.SetClockActiveLow();
+  m_spi.SetChipSelectActiveLow();
+
+  // Validate the part ID
+  uint8_t commands[3];
+  commands[0] = kRegRead;
+  commands[1] = kPartIdRegister;
+  commands[2] = 0;
+  m_spi.Transaction(commands, commands, 3);
+  if (commands[2] != 0xF2) {
+    DriverStation::ReportError("could not find ADXL362");
+    m_gsPerLSB = 0.0;
+    return;
+  }
+
+  SetRange(range);
+
+  // Turn on the measurements
+  commands[0] = kRegWrite;
+  commands[1] = kPowerCtlRegister;
+  commands[2] = kPowerCtl_Measure | kPowerCtl_UltraLowNoise;
+  m_spi.Write(commands, 3);
+
+  HAL_Report(HALUsageReporting::kResourceType_ADXL362, port);
+
+  SetName("ADXL362", port);
+}
+
+void ADXL362::SetRange(Range range) {
+  if (m_gsPerLSB == 0.0) return;
+
+  uint8_t commands[3];
+
+  switch (range) {
+    case kRange_2G:
+      m_gsPerLSB = 0.001;
+      break;
+    case kRange_4G:
+      m_gsPerLSB = 0.002;
+      break;
+    case kRange_8G:
+    case kRange_16G:  // 16G not supported; treat as 8G
+      m_gsPerLSB = 0.004;
+      break;
+  }
+
+  // Specify the data format to read
+  commands[0] = kRegWrite;
+  commands[1] = kFilterCtlRegister;
+  commands[2] =
+      kFilterCtl_ODR_100Hz | static_cast<uint8_t>((range & 0x03) << 6);
+  m_spi.Write(commands, 3);
+}
+
+double ADXL362::GetX() { return GetAcceleration(kAxis_X); }
+
+double ADXL362::GetY() { return GetAcceleration(kAxis_Y); }
+
+double ADXL362::GetZ() { return GetAcceleration(kAxis_Z); }
+
+/**
+ * Get the acceleration of one axis in Gs.
+ *
+ * @param axis The axis to read from.
+ * @return Acceleration of the ADXL362 in Gs.
+ */
+double ADXL362::GetAcceleration(ADXL362::Axes axis) {
+  if (m_gsPerLSB == 0.0) return 0.0;
+
+  uint8_t buffer[4];
+  uint8_t command[4] = {0, 0, 0, 0};
+  command[0] = kRegRead;
+  command[1] = kDataRegister + static_cast<uint8_t>(axis);
+  m_spi.Transaction(command, buffer, 4);
+
+  // Sensor is little endian... swap bytes
+  int16_t rawAccel = buffer[3] << 8 | buffer[2];
+  return rawAccel * m_gsPerLSB;
+}
+
+/**
+ * Get the acceleration of all axes in Gs.
+ *
+ * @return An object containing the acceleration measured on each axis of the
+ *         ADXL362 in Gs.
+ */
+ADXL362::AllAxes ADXL362::GetAccelerations() {
+  AllAxes data = AllAxes();
+  if (m_gsPerLSB == 0.0) {
+    data.XAxis = data.YAxis = data.ZAxis = 0.0;
+    return data;
+  }
+
+  uint8_t dataBuffer[8] = {0, 0, 0, 0, 0, 0, 0, 0};
+  int16_t rawData[3];
+
+  // Select the data address.
+  dataBuffer[0] = kRegRead;
+  dataBuffer[1] = kDataRegister;
+  m_spi.Transaction(dataBuffer, dataBuffer, 8);
+
+  for (int i = 0; i < 3; i++) {
+    // Sensor is little endian... swap bytes
+    rawData[i] = dataBuffer[i * 2 + 3] << 8 | dataBuffer[i * 2 + 2];
+  }
+
+  data.XAxis = rawData[0] * m_gsPerLSB;
+  data.YAxis = rawData[1] * m_gsPerLSB;
+  data.ZAxis = rawData[2] * m_gsPerLSB;
+
+  return data;
+}
+
+void ADXL362::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("3AxisAccelerometer");
+  auto x = builder.GetEntry("X").GetHandle();
+  auto y = builder.GetEntry("Y").GetHandle();
+  auto z = builder.GetEntry("Z").GetHandle();
+  builder.SetUpdateTable([=]() {
+    auto data = GetAccelerations();
+    nt::NetworkTableEntry(x).SetDouble(data.XAxis);
+    nt::NetworkTableEntry(y).SetDouble(data.YAxis);
+    nt::NetworkTableEntry(z).SetDouble(data.ZAxis);
+  });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp
new file mode 100644
index 0000000..66caa78
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ADXRS450_Gyro.cpp
@@ -0,0 +1,154 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ADXRS450_Gyro.h"
+
+#include <HAL/HAL.h>
+
+#include "DriverStation.h"
+#include "Timer.h"
+
+using namespace frc;
+
+static constexpr double kSamplePeriod = 0.0005;
+static constexpr double kCalibrationSampleTime = 5.0;
+static constexpr double kDegreePerSecondPerLSB = 0.0125;
+
+static constexpr int kRateRegister = 0x00;
+static constexpr int kTemRegister = 0x02;
+static constexpr int kLoCSTRegister = 0x04;
+static constexpr int kHiCSTRegister = 0x06;
+static constexpr int kQuadRegister = 0x08;
+static constexpr int kFaultRegister = 0x0A;
+static constexpr int kPIDRegister = 0x0C;
+static constexpr int kSNHighRegister = 0x0E;
+static constexpr int kSNLowRegister = 0x10;
+
+/**
+ * Initialize the gyro.
+ *
+ * Calibrate the gyro by running for a number of samples and computing the
+ * center value. Then use the center value as the Accumulator center value for
+ * subsequent measurements.
+ *
+ * It's important to make sure that the robot is not moving while the centering
+ * calculations are in progress, this is typically done when the robot is first
+ * turned on while it's sitting at rest before the competition starts.
+ */
+void ADXRS450_Gyro::Calibrate() {
+  Wait(0.1);
+
+  m_spi.SetAccumulatorCenter(0);
+  m_spi.ResetAccumulator();
+
+  Wait(kCalibrationSampleTime);
+
+  m_spi.SetAccumulatorCenter(static_cast<int>(m_spi.GetAccumulatorAverage()));
+  m_spi.ResetAccumulator();
+}
+
+/**
+ * Gyro constructor on onboard CS0.
+ */
+ADXRS450_Gyro::ADXRS450_Gyro() : ADXRS450_Gyro(SPI::kOnboardCS0) {}
+
+/**
+ * Gyro constructor on the specified SPI port.
+ *
+ * @param port The SPI port the gyro is attached to.
+ */
+ADXRS450_Gyro::ADXRS450_Gyro(SPI::Port port) : m_spi(port) {
+  m_spi.SetClockRate(3000000);
+  m_spi.SetMSBFirst();
+  m_spi.SetSampleDataOnRising();
+  m_spi.SetClockActiveHigh();
+  m_spi.SetChipSelectActiveLow();
+
+  // Validate the part ID
+  if ((ReadRegister(kPIDRegister) & 0xff00) != 0x5200) {
+    DriverStation::ReportError("could not find ADXRS450 gyro");
+    return;
+  }
+
+  m_spi.InitAccumulator(kSamplePeriod, 0x20000000u, 4, 0x0c00000eu, 0x04000000u,
+                        10u, 16u, true, true);
+
+  Calibrate();
+
+  HAL_Report(HALUsageReporting::kResourceType_ADXRS450, port);
+  SetName("ADXRS450_Gyro", port);
+}
+
+static bool CalcParity(int v) {
+  bool parity = false;
+  while (v != 0) {
+    parity = !parity;
+    v = v & (v - 1);
+  }
+  return parity;
+}
+
+static inline int BytesToIntBE(uint8_t* buf) {
+  int result = static_cast<int>(buf[0]) << 24;
+  result |= static_cast<int>(buf[1]) << 16;
+  result |= static_cast<int>(buf[2]) << 8;
+  result |= static_cast<int>(buf[3]);
+  return result;
+}
+
+uint16_t ADXRS450_Gyro::ReadRegister(int reg) {
+  int cmd = 0x80000000 | static_cast<int>(reg) << 17;
+  if (!CalcParity(cmd)) cmd |= 1u;
+
+  // big endian
+  uint8_t buf[4] = {static_cast<uint8_t>((cmd >> 24) & 0xff),
+                    static_cast<uint8_t>((cmd >> 16) & 0xff),
+                    static_cast<uint8_t>((cmd >> 8) & 0xff),
+                    static_cast<uint8_t>(cmd & 0xff)};
+
+  m_spi.Write(buf, 4);
+  m_spi.Read(false, buf, 4);
+  if ((buf[0] & 0xe0) == 0) return 0;  // error, return 0
+  return static_cast<uint16_t>((BytesToIntBE(buf) >> 5) & 0xffff);
+}
+
+/**
+ * Reset the gyro.
+ *
+ * Resets the gyro to a heading of zero. This can be used if there is
+ * significant drift in the gyro and it needs to be recalibrated after it has
+ * been running.
+ */
+void ADXRS450_Gyro::Reset() { m_spi.ResetAccumulator(); }
+
+/**
+ * Return the actual angle in degrees that the robot is currently facing.
+ *
+ * The angle is based on the current accumulator value corrected by the
+ * oversampling rate, the gyro type and the A/D calibration values.
+ * The angle is continuous, that is it will continue from 360->361 degrees. This
+ * allows algorithms that wouldn't want to see a discontinuity in the gyro
+ * output as it sweeps from 360 to 0 on the second time around.
+ *
+ * @return the current heading of the robot in degrees. This heading is based on
+ *         integration of the returned rate from the gyro.
+ */
+double ADXRS450_Gyro::GetAngle() const {
+  return m_spi.GetAccumulatorValue() * kDegreePerSecondPerLSB * kSamplePeriod;
+}
+
+/**
+ * Return the rate of rotation of the gyro
+ *
+ * The rate is based on the most recent reading of the gyro analog value
+ *
+ * @return the current rate in degrees per second
+ */
+double ADXRS450_Gyro::GetRate() const {
+  return static_cast<double>(m_spi.GetAccumulatorLastValue()) *
+         kDegreePerSecondPerLSB;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp
new file mode 100644
index 0000000..75663fa
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogAccelerometer.cpp
@@ -0,0 +1,122 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogAccelerometer.h"
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Common function for initializing the accelerometer.
+ */
+void AnalogAccelerometer::InitAccelerometer() {
+  HAL_Report(HALUsageReporting::kResourceType_Accelerometer,
+             m_analogInput->GetChannel());
+  SetName("Accelerometer", m_analogInput->GetChannel());
+}
+
+/**
+ * Create a new instance of an accelerometer.
+ *
+ * The constructor allocates desired analog input.
+ *
+ * @param channel The channel number for the analog input the accelerometer is
+ *                connected to
+ */
+AnalogAccelerometer::AnalogAccelerometer(int channel)
+    : AnalogAccelerometer(std::make_shared<AnalogInput>(channel)) {
+  AddChild(m_analogInput);
+}
+
+/**
+ * Create a new instance of Accelerometer from an existing AnalogInput.
+ *
+ * Make a new instance of accelerometer given an AnalogInput. This is
+ * particularly useful if the port is going to be read as an analog channel as
+ * well as through the Accelerometer class.
+ *
+ * @param channel The existing AnalogInput object for the analog input the
+ *                accelerometer is connected to
+ */
+AnalogAccelerometer::AnalogAccelerometer(AnalogInput* channel)
+    : m_analogInput(channel, NullDeleter<AnalogInput>()) {
+  if (channel == nullptr) {
+    wpi_setWPIError(NullParameter);
+  } else {
+    InitAccelerometer();
+  }
+}
+
+/**
+ * Create a new instance of Accelerometer from an existing AnalogInput.
+ *
+ * Make a new instance of accelerometer given an AnalogInput. This is
+ * particularly useful if the port is going to be read as an analog channel as
+ * well as through the Accelerometer class.
+ *
+ * @param channel The existing AnalogInput object for the analog input the
+ *                accelerometer is connected to
+ */
+AnalogAccelerometer::AnalogAccelerometer(std::shared_ptr<AnalogInput> channel)
+    : m_analogInput(channel) {
+  if (channel == nullptr) {
+    wpi_setWPIError(NullParameter);
+  } else {
+    InitAccelerometer();
+  }
+}
+
+/**
+ * Return the acceleration in Gs.
+ *
+ * The acceleration is returned units of Gs.
+ *
+ * @return The current acceleration of the sensor in Gs.
+ */
+double AnalogAccelerometer::GetAcceleration() const {
+  return (m_analogInput->GetAverageVoltage() - m_zeroGVoltage) / m_voltsPerG;
+}
+
+/**
+ * Set the accelerometer sensitivity.
+ *
+ * This sets the sensitivity of the accelerometer used for calculating the
+ * acceleration. The sensitivity varies by accelerometer model. There are
+ * constants defined for various models.
+ *
+ * @param sensitivity The sensitivity of accelerometer in Volts per G.
+ */
+void AnalogAccelerometer::SetSensitivity(double sensitivity) {
+  m_voltsPerG = sensitivity;
+}
+
+/**
+ * Set the voltage that corresponds to 0 G.
+ *
+ * The zero G voltage varies by accelerometer model. There are constants defined
+ * for various models.
+ *
+ * @param zero The zero G voltage.
+ */
+void AnalogAccelerometer::SetZero(double zero) { m_zeroGVoltage = zero; }
+
+/**
+ * Get the Acceleration for the PID Source parent.
+ *
+ * @return The current acceleration in Gs.
+ */
+double AnalogAccelerometer::PIDGet() { return GetAcceleration(); }
+
+void AnalogAccelerometer::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Accelerometer");
+  builder.AddDoubleProperty("Value", [=]() { return GetAcceleration(); },
+                            nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogGyro.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogGyro.cpp
new file mode 100644
index 0000000..af253fa
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogGyro.cpp
@@ -0,0 +1,270 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogGyro.h"
+
+#include <climits>
+
+#include <HAL/AnalogGyro.h>
+#include <HAL/Errors.h>
+#include <HAL/HAL.h>
+
+#include "AnalogInput.h"
+#include "Timer.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Gyro constructor using the Analog Input channel number.
+ *
+ * @param channel The analog channel the gyro is connected to. Gyros can only
+ *                be used on on-board Analog Inputs 0-1.
+ */
+AnalogGyro::AnalogGyro(int channel)
+    : AnalogGyro(std::make_shared<AnalogInput>(channel)) {
+  AddChild(m_analog);
+}
+
+/**
+ * Gyro constructor with a precreated AnalogInput object.
+ *
+ * Use this constructor when the analog channel needs to be shared.
+ * This object will not clean up the AnalogInput object when using this
+ * constructor.
+ *
+ * Gyros can only be used on on-board channels 0-1.
+ *
+ * @param channel A pointer to the AnalogInput object that the gyro is
+ *                connected to.
+ */
+AnalogGyro::AnalogGyro(AnalogInput* channel)
+    : AnalogGyro(
+          std::shared_ptr<AnalogInput>(channel, NullDeleter<AnalogInput>())) {}
+
+/**
+ * Gyro constructor with a precreated AnalogInput object.
+ *
+ * Use this constructor when the analog channel needs to be shared.
+ * This object will not clean up the AnalogInput object when using this
+ * constructor.
+ *
+ * @param channel A pointer to the AnalogInput object that the gyro is
+ *                connected to.
+ */
+AnalogGyro::AnalogGyro(std::shared_ptr<AnalogInput> channel)
+    : m_analog(channel) {
+  if (channel == nullptr) {
+    wpi_setWPIError(NullParameter);
+  } else {
+    InitGyro();
+    Calibrate();
+  }
+}
+
+/**
+ * Gyro constructor using the Analog Input channel number with parameters for
+ * presetting the center and offset values. Bypasses calibration.
+ *
+ * @param channel The analog channel the gyro is connected to. Gyros can only
+ *                be used on on-board Analog Inputs 0-1.
+ * @param center  Preset uncalibrated value to use as the accumulator center
+ *                value.
+ * @param offset  Preset uncalibrated value to use as the gyro offset.
+ */
+AnalogGyro::AnalogGyro(int channel, int center, double offset)
+    : AnalogGyro(std::make_shared<AnalogInput>(channel), center, offset) {
+  AddChild(m_analog);
+}
+
+/**
+ * Gyro constructor with a precreated AnalogInput object and calibrated
+ * parameters.
+ *
+ * Use this constructor when the analog channel needs to be shared.
+ * This object will not clean up the AnalogInput object when using this
+ * constructor.
+ *
+ * @param channel A pointer to the AnalogInput object that the gyro is
+ *                connected to.
+ */
+AnalogGyro::AnalogGyro(std::shared_ptr<AnalogInput> channel, int center,
+                       double offset)
+    : m_analog(channel) {
+  if (channel == nullptr) {
+    wpi_setWPIError(NullParameter);
+  } else {
+    InitGyro();
+    int32_t status = 0;
+    HAL_SetAnalogGyroParameters(m_gyroHandle, kDefaultVoltsPerDegreePerSecond,
+                                offset, center, &status);
+    if (status != 0) {
+      wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+      m_gyroHandle = HAL_kInvalidHandle;
+      return;
+    }
+    Reset();
+  }
+}
+
+/**
+ * AnalogGyro Destructor
+ *
+ */
+AnalogGyro::~AnalogGyro() { HAL_FreeAnalogGyro(m_gyroHandle); }
+
+/**
+ * Reset the gyro.
+ *
+ * Resets the gyro to a heading of zero. This can be used if there is
+ * significant drift in the gyro and it needs to be recalibrated after it has
+ * been running.
+ */
+void AnalogGyro::Reset() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_ResetAnalogGyro(m_gyroHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Initialize the gyro.  Calibration is handled by Calibrate().
+ */
+void AnalogGyro::InitGyro() {
+  if (StatusIsFatal()) return;
+  if (m_gyroHandle == HAL_kInvalidHandle) {
+    int32_t status = 0;
+    m_gyroHandle = HAL_InitializeAnalogGyro(m_analog->m_port, &status);
+    if (status == PARAMETER_OUT_OF_RANGE) {
+      wpi_setWPIErrorWithContext(ParameterOutOfRange,
+                                 " channel (must be accumulator channel)");
+      m_analog = nullptr;
+      m_gyroHandle = HAL_kInvalidHandle;
+      return;
+    }
+    if (status != 0) {
+      wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+      m_analog = nullptr;
+      m_gyroHandle = HAL_kInvalidHandle;
+      return;
+    }
+  }
+
+  int32_t status = 0;
+  HAL_SetupAnalogGyro(m_gyroHandle, &status);
+  if (status != 0) {
+    wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+    m_analog = nullptr;
+    m_gyroHandle = HAL_kInvalidHandle;
+    return;
+  }
+
+  HAL_Report(HALUsageReporting::kResourceType_Gyro, m_analog->GetChannel());
+  SetName("AnalogGyro", m_analog->GetChannel());
+}
+
+void AnalogGyro::Calibrate() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_CalibrateAnalogGyro(m_gyroHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Return the actual angle in degrees that the robot is currently facing.
+ *
+ * The angle is based on the current accumulator value corrected by the
+ * oversampling rate, the gyro type and the A/D calibration values.
+ * The angle is continuous, that is it will continue from 360->361 degrees. This
+ * allows algorithms that wouldn't want to see a discontinuity in the gyro
+ * output as it sweeps from 360 to 0 on the second time around.
+ *
+ * @return the current heading of the robot in degrees. This heading is based on
+ *         integration of the returned rate from the gyro.
+ */
+double AnalogGyro::GetAngle() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetAnalogGyroAngle(m_gyroHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Return the rate of rotation of the gyro
+ *
+ * The rate is based on the most recent reading of the gyro analog value
+ *
+ * @return the current rate in degrees per second
+ */
+double AnalogGyro::GetRate() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetAnalogGyroRate(m_gyroHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Return the gyro offset value. If run after calibration,
+ * the offset value can be used as a preset later.
+ *
+ * @return the current offset value
+ */
+double AnalogGyro::GetOffset() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetAnalogGyroOffset(m_gyroHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Return the gyro center value. If run after calibration,
+ * the center value can be used as a preset later.
+ *
+ * @return the current center value
+ */
+int AnalogGyro::GetCenter() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int value = HAL_GetAnalogGyroCenter(m_gyroHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Set the gyro sensitivity.
+ *
+ * This takes the number of volts/degree/second sensitivity of the gyro and uses
+ * it in subsequent calculations to allow the code to work with multiple gyros.
+ * This value is typically found in the gyro datasheet.
+ *
+ * @param voltsPerDegreePerSecond The sensitivity in Volts/degree/second
+ */
+void AnalogGyro::SetSensitivity(double voltsPerDegreePerSecond) {
+  int32_t status = 0;
+  HAL_SetAnalogGyroVoltsPerDegreePerSecond(m_gyroHandle,
+                                           voltsPerDegreePerSecond, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the size of the neutral zone.
+ *
+ * Any voltage from the gyro less than this amount from the center is
+ * considered stationary.  Setting a deadband will decrease the amount of drift
+ * when the gyro isn't rotating, but will make it less accurate.
+ *
+ * @param volts The size of the deadband in volts
+ */
+void AnalogGyro::SetDeadband(double volts) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogGyroDeadband(m_gyroHandle, volts, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogInput.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogInput.cpp
new file mode 100644
index 0000000..7cd90b2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogInput.cpp
@@ -0,0 +1,416 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogInput.h"
+
+#include <HAL/AnalogAccumulator.h>
+#include <HAL/AnalogInput.h>
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "Timer.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Construct an analog input.
+ *
+ * @param channel The channel number on the roboRIO to represent. 0-3 are
+ *                on-board 4-7 are on the MXP port.
+ */
+AnalogInput::AnalogInput(int channel) {
+  if (!SensorBase::CheckAnalogInputChannel(channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "Analog Input " + llvm::Twine(channel));
+    return;
+  }
+
+  m_channel = channel;
+
+  HAL_PortHandle port = HAL_GetPort(channel);
+  int32_t status = 0;
+  m_port = HAL_InitializeAnalogInputPort(port, &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumAnalogInputs(), channel,
+                                 HAL_GetErrorMessage(status));
+    m_channel = std::numeric_limits<int>::max();
+    m_port = HAL_kInvalidHandle;
+    return;
+  }
+
+  HAL_Report(HALUsageReporting::kResourceType_AnalogChannel, channel);
+  SetName("AnalogInput", channel);
+}
+
+/**
+ * Channel destructor.
+ */
+AnalogInput::~AnalogInput() {
+  HAL_FreeAnalogInputPort(m_port);
+  m_port = HAL_kInvalidHandle;
+}
+
+/**
+ * Get a sample straight from this channel.
+ *
+ * The sample is a 12-bit value representing the 0V to 5V range of the A/D
+ * converter in the module.  The units are in A/D converter codes.  Use
+ * GetVoltage() to get the analog value in calibrated units.
+ *
+ * @return A sample straight from this channel.
+ */
+int AnalogInput::GetValue() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int value = HAL_GetAnalogValue(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Get a sample from the output of the oversample and average engine for this
+ * channel.
+ *
+ * The sample is 12-bit + the bits configured in SetOversampleBits().
+ * The value configured in SetAverageBits() will cause this value to be averaged
+ * 2**bits number of samples.
+ * This is not a sliding window.  The sample will not change until
+ * 2**(OversampleBits + AverageBits) samples
+ * have been acquired from the module on this channel.
+ * Use GetAverageVoltage() to get the analog value in calibrated units.
+ *
+ * @return A sample from the oversample and average engine for this channel.
+ */
+int AnalogInput::GetAverageValue() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int value = HAL_GetAnalogAverageValue(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Get a scaled sample straight from this channel.
+ *
+ * The value is scaled to units of Volts using the calibrated scaling data from
+ * GetLSBWeight() and GetOffset().
+ *
+ * @return A scaled sample straight from this channel.
+ */
+double AnalogInput::GetVoltage() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double voltage = HAL_GetAnalogVoltage(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return voltage;
+}
+
+/**
+ * Get a scaled sample from the output of the oversample and average engine for
+ * this channel.
+ *
+ * The value is scaled to units of Volts using the calibrated scaling data from
+ * GetLSBWeight() and GetOffset().
+ * Using oversampling will cause this value to be higher resolution, but it will
+ * update more slowly.
+ * Using averaging will cause this value to be more stable, but it will update
+ * more slowly.
+ *
+ * @return A scaled sample from the output of the oversample and average engine
+ * for this channel.
+ */
+double AnalogInput::GetAverageVoltage() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double voltage = HAL_GetAnalogAverageVoltage(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return voltage;
+}
+
+/**
+ * Get the factory scaling least significant bit weight constant.
+ *
+ * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
+ *
+ * @return Least significant bit weight.
+ */
+int AnalogInput::GetLSBWeight() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int lsbWeight = HAL_GetAnalogLSBWeight(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return lsbWeight;
+}
+
+/**
+ * Get the factory scaling offset constant.
+ *
+ * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
+ *
+ * @return Offset constant.
+ */
+int AnalogInput::GetOffset() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int offset = HAL_GetAnalogOffset(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return offset;
+}
+
+/**
+ * Get the channel number.
+ *
+ * @return The channel number.
+ */
+int AnalogInput::GetChannel() const {
+  if (StatusIsFatal()) return 0;
+  return m_channel;
+}
+
+/**
+ * Set the number of averaging bits.
+ *
+ * This sets the number of averaging bits. The actual number of averaged samples
+ * is 2^bits.
+ * Use averaging to improve the stability of your measurement at the expense of
+ * sampling rate.
+ * The averaging is done automatically in the FPGA.
+ *
+ * @param bits Number of bits of averaging.
+ */
+void AnalogInput::SetAverageBits(int bits) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogAverageBits(m_port, bits, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the number of averaging bits previously configured.
+ *
+ * This gets the number of averaging bits from the FPGA. The actual number of
+ * averaged samples is 2^bits. The averaging is done automatically in the FPGA.
+ *
+ * @return Number of bits of averaging previously configured.
+ */
+int AnalogInput::GetAverageBits() const {
+  int32_t status = 0;
+  int averageBits = HAL_GetAnalogAverageBits(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return averageBits;
+}
+
+/**
+ * Set the number of oversample bits.
+ *
+ * This sets the number of oversample bits. The actual number of oversampled
+ * values is 2^bits. Use oversampling to improve the resolution of your
+ * measurements at the expense of sampling rate. The oversampling is done
+ * automatically in the FPGA.
+ *
+ * @param bits Number of bits of oversampling.
+ */
+void AnalogInput::SetOversampleBits(int bits) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogOversampleBits(m_port, bits, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the number of oversample bits previously configured.
+ *
+ * This gets the number of oversample bits from the FPGA. The actual number of
+ * oversampled values is 2^bits. The oversampling is done automatically in the
+ * FPGA.
+ *
+ * @return Number of bits of oversampling previously configured.
+ */
+int AnalogInput::GetOversampleBits() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int oversampleBits = HAL_GetAnalogOversampleBits(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return oversampleBits;
+}
+
+/**
+ * Is the channel attached to an accumulator.
+ *
+ * @return The analog input is attached to an accumulator.
+ */
+bool AnalogInput::IsAccumulatorChannel() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool isAccum = HAL_IsAccumulatorChannel(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return isAccum;
+}
+
+/**
+ * Initialize the accumulator.
+ */
+void AnalogInput::InitAccumulator() {
+  if (StatusIsFatal()) return;
+  m_accumulatorOffset = 0;
+  int32_t status = 0;
+  HAL_InitAccumulator(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set an initial value for the accumulator.
+ *
+ * This will be added to all values returned to the user.
+ *
+ * @param initialValue The value that the accumulator should start from when
+ *                     reset.
+ */
+void AnalogInput::SetAccumulatorInitialValue(int64_t initialValue) {
+  if (StatusIsFatal()) return;
+  m_accumulatorOffset = initialValue;
+}
+
+/**
+ * Resets the accumulator to the initial value.
+ */
+void AnalogInput::ResetAccumulator() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_ResetAccumulator(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  if (!StatusIsFatal()) {
+    // Wait until the next sample, so the next call to GetAccumulator*()
+    // won't have old values.
+    const double sampleTime = 1.0 / GetSampleRate();
+    const double overSamples = 1 << GetOversampleBits();
+    const double averageSamples = 1 << GetAverageBits();
+    Wait(sampleTime * overSamples * averageSamples);
+  }
+}
+
+/**
+ * Set the center value of the accumulator.
+ *
+ * The center value is subtracted from each A/D value before it is added to the
+ * accumulator. This is used for the center value of devices like gyros and
+ * accelerometers to take the device offset into account when integrating.
+ *
+ * This center value is based on the output of the oversampled and averaged
+ * source from the accumulator channel. Because of this, any non-zero
+ * oversample bits will affect the size of the value for this field.
+ */
+void AnalogInput::SetAccumulatorCenter(int center) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAccumulatorCenter(m_port, center, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the accumulator's deadband.
+ */
+void AnalogInput::SetAccumulatorDeadband(int deadband) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAccumulatorDeadband(m_port, deadband, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Read the accumulated value.
+ *
+ * Read the value that has been accumulating.
+ * The accumulator is attached after the oversample and average engine.
+ *
+ * @return The 64-bit value accumulated since the last Reset().
+ */
+int64_t AnalogInput::GetAccumulatorValue() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int64_t value = HAL_GetAccumulatorValue(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value + m_accumulatorOffset;
+}
+
+/**
+ * Read the number of accumulated values.
+ *
+ * Read the count of the accumulated values since the accumulator was last
+ * Reset().
+ *
+ * @return The number of times samples from the channel were accumulated.
+ */
+int64_t AnalogInput::GetAccumulatorCount() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int64_t count = HAL_GetAccumulatorCount(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return count;
+}
+
+/**
+ * Read the accumulated value and the number of accumulated values atomically.
+ *
+ * This function reads the value and count from the FPGA atomically.
+ * This can be used for averaging.
+ *
+ * @param value Reference to the 64-bit accumulated output.
+ * @param count Reference to the number of accumulation cycles.
+ */
+void AnalogInput::GetAccumulatorOutput(int64_t& value, int64_t& count) const {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_GetAccumulatorOutput(m_port, &value, &count, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  value += m_accumulatorOffset;
+}
+
+/**
+ * Set the sample rate per channel for all analog channels.
+ *
+ * The maximum rate is 500kS/s divided by the number of channels in use.
+ * This is 62500 samples/s per channel.
+ *
+ * @param samplesPerSecond The number of samples per second.
+ */
+void AnalogInput::SetSampleRate(double samplesPerSecond) {
+  int32_t status = 0;
+  HAL_SetAnalogSampleRate(samplesPerSecond, &status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the current sample rate for all channels
+ *
+ * @return Sample rate.
+ */
+double AnalogInput::GetSampleRate() {
+  int32_t status = 0;
+  double sampleRate = HAL_GetAnalogSampleRate(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return sampleRate;
+}
+
+/**
+ * Get the Average value for the PID Source base object.
+ *
+ * @return The average voltage.
+ */
+double AnalogInput::PIDGet() {
+  if (StatusIsFatal()) return 0.0;
+  return GetAverageVoltage();
+}
+
+void AnalogInput::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Analog Input");
+  builder.AddDoubleProperty("Value", [=]() { return GetAverageVoltage(); },
+                            nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogOutput.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogOutput.cpp
new file mode 100644
index 0000000..f70bf07
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogOutput.cpp
@@ -0,0 +1,96 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogOutput.h"
+
+#include <limits>
+
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Construct an analog output on the given channel.
+ *
+ * All analog outputs are located on the MXP port.
+ *
+ * @param channel The channel number on the roboRIO to represent.
+ */
+AnalogOutput::AnalogOutput(int channel) {
+  if (!SensorBase::CheckAnalogOutputChannel(channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "analog output " + llvm::Twine(channel));
+    m_channel = std::numeric_limits<int>::max();
+    m_port = HAL_kInvalidHandle;
+    return;
+  }
+
+  m_channel = channel;
+
+  HAL_PortHandle port = HAL_GetPort(m_channel);
+  int32_t status = 0;
+  m_port = HAL_InitializeAnalogOutputPort(port, &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumAnalogOutputs(), channel,
+                                 HAL_GetErrorMessage(status));
+    m_channel = std::numeric_limits<int>::max();
+    m_port = HAL_kInvalidHandle;
+    return;
+  }
+
+  HAL_Report(HALUsageReporting::kResourceType_AnalogOutput, m_channel);
+  SetName("AnalogOutput", m_channel);
+}
+
+/**
+ * Destructor.
+ *
+ * Frees analog output resource.
+ */
+AnalogOutput::~AnalogOutput() { HAL_FreeAnalogOutputPort(m_port); }
+
+/**
+ * Get the channel of this AnalogOutput.
+ */
+int AnalogOutput::GetChannel() { return m_channel; }
+
+/**
+ * Set the value of the analog output.
+ *
+ * @param voltage The output value in Volts, from 0.0 to +5.0
+ */
+void AnalogOutput::SetVoltage(double voltage) {
+  int32_t status = 0;
+  HAL_SetAnalogOutput(m_port, voltage, &status);
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the voltage of the analog output
+ *
+ * @return The value in Volts, from 0.0 to +5.0
+ */
+double AnalogOutput::GetVoltage() const {
+  int32_t status = 0;
+  double voltage = HAL_GetAnalogOutput(m_port, &status);
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  return voltage;
+}
+
+void AnalogOutput::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Analog Output");
+  builder.AddDoubleProperty("Value", [=]() { return GetVoltage(); },
+                            [=](double value) { SetVoltage(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp
new file mode 100644
index 0000000..8654309
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogPotentiometer.cpp
@@ -0,0 +1,87 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogPotentiometer.h"
+
+#include "RobotController.h"
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+/**
+ * Construct an Analog Potentiometer object from a channel number.
+ *
+ * @param channel   The channel number on the roboRIO to represent. 0-3 are
+ *                  on-board 4-7 are on the MXP port.
+ * @param fullRange The angular value (in desired units) representing the full
+ *                  0-5V range of the input.
+ * @param offset    The angular value (in desired units) representing the
+ *                  angular output at 0V.
+ */
+AnalogPotentiometer::AnalogPotentiometer(int channel, double fullRange,
+                                         double offset)
+    : m_analog_input(std::make_shared<AnalogInput>(channel)),
+      m_fullRange(fullRange),
+      m_offset(offset) {
+  AddChild(m_analog_input);
+}
+
+/**
+ * Construct an Analog Potentiometer object from an existing Analog Input
+ * pointer.
+ *
+ * @param channel   The existing Analog Input pointer
+ * @param fullRange The angular value (in desired units) representing the full
+ *                  0-5V range of the input.
+ * @param offset    The angular value (in desired units) representing the
+ *                  angular output at 0V.
+ */
+AnalogPotentiometer::AnalogPotentiometer(AnalogInput* input, double fullRange,
+                                         double offset)
+    : m_analog_input(input, NullDeleter<AnalogInput>()),
+      m_fullRange(fullRange),
+      m_offset(offset) {}
+
+/**
+ * Construct an Analog Potentiometer object from an existing Analog Input
+ * pointer.
+ *
+ * @param channel   The existing Analog Input pointer
+ * @param fullRange The angular value (in desired units) representing the full
+ *                  0-5V range of the input.
+ * @param offset    The angular value (in desired units) representing the
+ *                  angular output at 0V.
+ */
+AnalogPotentiometer::AnalogPotentiometer(std::shared_ptr<AnalogInput> input,
+                                         double fullRange, double offset)
+    : m_analog_input(input), m_fullRange(fullRange), m_offset(offset) {}
+
+/**
+ * Get the current reading of the potentiometer.
+ *
+ * @return The current position of the potentiometer (in the units used for
+ *         fullRange and offset).
+ */
+double AnalogPotentiometer::Get() const {
+  return (m_analog_input->GetVoltage() / RobotController::GetVoltage5V()) *
+             m_fullRange +
+         m_offset;
+}
+
+/**
+ * Implement the PIDSource interface.
+ *
+ * @return The current reading.
+ */
+double AnalogPotentiometer::PIDGet() { return Get(); }
+
+/**
+ * Live Window code, only does anything if live window is activated.
+ */
+void AnalogPotentiometer::InitSendable(SendableBuilder& builder) {
+  m_analog_input->InitSendable(builder);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogTrigger.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogTrigger.cpp
new file mode 100644
index 0000000..8e1d687
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogTrigger.cpp
@@ -0,0 +1,192 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogTrigger.h"
+
+#include <memory>
+
+#include <HAL/HAL.h>
+
+#include "AnalogInput.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Constructor for an analog trigger given a channel number.
+ *
+ * @param channel The channel number on the roboRIO to represent. 0-3 are
+ *                on-board 4-7 are on the MXP port.
+ */
+AnalogTrigger::AnalogTrigger(int channel)
+    : AnalogTrigger(new AnalogInput(channel)) {
+  m_ownsAnalog = true;
+  AddChild(m_analogInput);
+}
+
+/**
+ * Construct an analog trigger given an analog input.
+ *
+ * This should be used in the case of sharing an analog channel between the
+ * trigger and an analog input object.
+ *
+ * @param channel The pointer to the existing AnalogInput object
+ */
+AnalogTrigger::AnalogTrigger(AnalogInput* input) {
+  m_analogInput = input;
+  int32_t status = 0;
+  int index = 0;
+  m_trigger = HAL_InitializeAnalogTrigger(input->m_port, &index, &status);
+  if (status != 0) {
+    wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+    m_index = std::numeric_limits<int>::max();
+    m_trigger = HAL_kInvalidHandle;
+    return;
+  }
+  m_index = index;
+
+  HAL_Report(HALUsageReporting::kResourceType_AnalogTrigger, input->m_channel);
+  SetName("AnalogTrigger", input->GetChannel());
+}
+
+AnalogTrigger::~AnalogTrigger() {
+  int32_t status = 0;
+  HAL_CleanAnalogTrigger(m_trigger, &status);
+
+  if (m_ownsAnalog && m_analogInput != nullptr) {
+    delete m_analogInput;
+  }
+}
+
+/**
+ * Set the upper and lower limits of the analog trigger.
+ *
+ * The limits are given in ADC codes.  If oversampling is used, the units must
+ * be scaled appropriately.
+ *
+ * @param lower The lower limit of the trigger in ADC codes (12-bit values).
+ * @param upper The upper limit of the trigger in ADC codes (12-bit values).
+ */
+void AnalogTrigger::SetLimitsRaw(int lower, int upper) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerLimitsRaw(m_trigger, lower, upper, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the upper and lower limits of the analog trigger.
+ *
+ * The limits are given as floating point voltage values.
+ *
+ * @param lower The lower limit of the trigger in Volts.
+ * @param upper The upper limit of the trigger in Volts.
+ */
+void AnalogTrigger::SetLimitsVoltage(double lower, double upper) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerLimitsVoltage(m_trigger, lower, upper, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Configure the analog trigger to use the averaged vs. raw values.
+ *
+ * If the value is true, then the averaged value is selected for the analog
+ * trigger, otherwise the immediate value is used.
+ *
+ * @param useAveragedValue If true, use the Averaged value, otherwise use the
+ *                         instantaneous reading
+ */
+void AnalogTrigger::SetAveraged(bool useAveragedValue) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerAveraged(m_trigger, useAveragedValue, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Configure the analog trigger to use a filtered value.
+ *
+ * The analog trigger will operate with a 3 point average rejection filter. This
+ * is designed to help with 360 degree pot applications for the period where
+ * the pot crosses through zero.
+ *
+ * @param useFilteredValue If true, use the 3 point rejection filter, otherwise
+ *                         use the unfiltered value
+ */
+void AnalogTrigger::SetFiltered(bool useFilteredValue) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerFiltered(m_trigger, useFilteredValue, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Return the index of the analog trigger.
+ *
+ * This is the FPGA index of this analog trigger instance.
+ *
+ * @return The index of the analog trigger.
+ */
+int AnalogTrigger::GetIndex() const {
+  if (StatusIsFatal()) return -1;
+  return m_index;
+}
+
+/**
+ * Return the InWindow output of the analog trigger.
+ *
+ * True if the analog input is between the upper and lower limits.
+ *
+ * @return True if the analog input is between the upper and lower limits.
+ */
+bool AnalogTrigger::GetInWindow() {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool result = HAL_GetAnalogTriggerInWindow(m_trigger, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return result;
+}
+
+/**
+ * Return the TriggerState output of the analog trigger.
+ *
+ * True if above upper limit.
+ * False if below lower limit.
+ * If in Hysteresis, maintain previous state.
+ *
+ * @return True if above upper limit. False if below lower limit. If in
+ *         Hysteresis, maintain previous state.
+ */
+bool AnalogTrigger::GetTriggerState() {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool result = HAL_GetAnalogTriggerTriggerState(m_trigger, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return result;
+}
+
+/**
+ * Creates an AnalogTriggerOutput object.
+ *
+ * Gets an output object that can be used for routing.
+ * Caller is responsible for deleting the AnalogTriggerOutput object.
+ *
+ * @param type An enum of the type of output object to create.
+ * @return A pointer to a new AnalogTriggerOutput object.
+ */
+std::shared_ptr<AnalogTriggerOutput> AnalogTrigger::CreateOutput(
+    AnalogTriggerType type) const {
+  if (StatusIsFatal()) return nullptr;
+  return std::shared_ptr<AnalogTriggerOutput>(
+      new AnalogTriggerOutput(*this, type), NullDeleter<AnalogTriggerOutput>());
+}
+
+void AnalogTrigger::InitSendable(SendableBuilder& builder) {
+  if (m_ownsAnalog) m_analogInput->InitSendable(builder);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogTriggerOutput.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogTriggerOutput.cpp
new file mode 100644
index 0000000..612180f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/AnalogTriggerOutput.cpp
@@ -0,0 +1,82 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogTriggerOutput.h"
+
+#include <HAL/HAL.h>
+
+#include "AnalogTrigger.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Create an object that represents one of the four outputs from an analog
+ * trigger.
+ *
+ * Because this class derives from DigitalSource, it can be passed into routing
+ * functions for Counter, Encoder, etc.
+ *
+ * @param trigger    A pointer to the trigger for which this is an output.
+ * @param outputType An enum that specifies the output on the trigger to
+ *                   represent.
+ */
+AnalogTriggerOutput::AnalogTriggerOutput(const AnalogTrigger& trigger,
+                                         AnalogTriggerType outputType)
+    : m_trigger(trigger), m_outputType(outputType) {
+  HAL_Report(HALUsageReporting::kResourceType_AnalogTriggerOutput,
+             trigger.GetIndex(), static_cast<uint8_t>(outputType));
+}
+
+AnalogTriggerOutput::~AnalogTriggerOutput() {
+  if (m_interrupt != HAL_kInvalidHandle) {
+    int32_t status = 0;
+    HAL_CleanInterrupts(m_interrupt, &status);
+    // ignore status, as an invalid handle just needs to be ignored.
+    m_interrupt = HAL_kInvalidHandle;
+  }
+}
+
+/**
+ * Get the state of the analog trigger output.
+ *
+ * @return The state of the analog trigger output.
+ */
+bool AnalogTriggerOutput::Get() const {
+  int32_t status = 0;
+  bool result = HAL_GetAnalogTriggerOutput(
+      m_trigger.m_trigger, static_cast<HAL_AnalogTriggerType>(m_outputType),
+      &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return result;
+}
+
+/**
+ * @return The HAL Handle to the specified source.
+ */
+HAL_Handle AnalogTriggerOutput::GetPortHandleForRouting() const {
+  return m_trigger.m_trigger;
+}
+
+/**
+ * Is source an AnalogTrigger
+ */
+bool AnalogTriggerOutput::IsAnalogTrigger() const { return true; }
+
+/**
+ * @return The type of analog trigger output to be used.
+ */
+AnalogTriggerType AnalogTriggerOutput::GetAnalogTriggerTypeForRouting() const {
+  return m_outputType;
+}
+
+/**
+ * @return The channel of the source.
+ */
+int AnalogTriggerOutput::GetChannel() const { return m_trigger.m_index; }
+
+void AnalogTriggerOutput::InitSendable(SendableBuilder&) {}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp
new file mode 100644
index 0000000..12b5e8d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/BuiltInAccelerometer.cpp
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "BuiltInAccelerometer.h"
+
+#include <HAL/Accelerometer.h>
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Constructor.
+ *
+ * @param range The range the accelerometer will measure
+ */
+BuiltInAccelerometer::BuiltInAccelerometer(Range range) {
+  SetRange(range);
+
+  HAL_Report(HALUsageReporting::kResourceType_Accelerometer, 0, 0,
+             "Built-in accelerometer");
+  SetName("BuiltInAccel", 0);
+}
+
+void BuiltInAccelerometer::SetRange(Range range) {
+  if (range == kRange_16G) {
+    wpi_setWPIErrorWithContext(
+        ParameterOutOfRange, "16G range not supported (use k2G, k4G, or k8G)");
+  }
+
+  HAL_SetAccelerometerActive(false);
+  HAL_SetAccelerometerRange((HAL_AccelerometerRange)range);
+  HAL_SetAccelerometerActive(true);
+}
+
+/**
+ * @return The acceleration of the roboRIO along the X axis in g-forces
+ */
+double BuiltInAccelerometer::GetX() { return HAL_GetAccelerometerX(); }
+
+/**
+ * @return The acceleration of the roboRIO along the Y axis in g-forces
+ */
+double BuiltInAccelerometer::GetY() { return HAL_GetAccelerometerY(); }
+
+/**
+ * @return The acceleration of the roboRIO along the Z axis in g-forces
+ */
+double BuiltInAccelerometer::GetZ() { return HAL_GetAccelerometerZ(); }
+
+void BuiltInAccelerometer::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("3AxisAccelerometer");
+  builder.AddDoubleProperty("X", [=]() { return GetX(); }, nullptr);
+  builder.AddDoubleProperty("Y", [=]() { return GetY(); }, nullptr);
+  builder.AddDoubleProperty("Z", [=]() { return GetZ(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/Button.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/Button.cpp
new file mode 100644
index 0000000..fc08d5e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/Button.cpp
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/Button.h"
+
+using namespace frc;
+
+/**
+ * Specifies the command to run when a button is first pressed.
+ *
+ * @param command The pointer to the command to run
+ */
+void Button::WhenPressed(Command* command) { WhenActive(command); }
+
+/**
+ * Specifies the command to be scheduled while the button is pressed.
+ *
+ * The command will be scheduled repeatedly while the button is pressed and will
+ * be canceled when the button is released.
+ *
+ * @param command The pointer to the command to run
+ */
+void Button::WhileHeld(Command* command) { WhileActive(command); }
+
+/**
+ * Specifies the command to run when the button is released.
+ *
+ * The command will be scheduled a single time.
+ *
+ * @param command The pointer to the command to run
+ */
+void Button::WhenReleased(Command* command) { WhenInactive(command); }
+
+/**
+ * Cancels the specificed command when the button is pressed.
+ *
+ * @param command The command to be canceled
+ */
+void Button::CancelWhenPressed(Command* command) { CancelWhenActive(command); }
+
+/**
+ * Toggle the specified command when the button is pressed.
+ *
+ * @param command The command to be toggled
+ */
+void Button::ToggleWhenPressed(Command* command) { ToggleWhenActive(command); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ButtonScheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ButtonScheduler.cpp
new file mode 100644
index 0000000..d10a3bf
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ButtonScheduler.cpp
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/ButtonScheduler.h"
+
+#include "Commands/Scheduler.h"
+
+using namespace frc;
+
+ButtonScheduler::ButtonScheduler(bool last, Trigger* button, Command* orders)
+    : m_pressedLast(last), m_button(button), m_command(orders) {}
+
+void ButtonScheduler::Start() { Scheduler::GetInstance()->AddButton(this); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/CancelButtonScheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/CancelButtonScheduler.cpp
new file mode 100644
index 0000000..74a77c7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/CancelButtonScheduler.cpp
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/CancelButtonScheduler.h"
+
+#include "Buttons/Button.h"
+#include "Commands/Command.h"
+
+using namespace frc;
+
+CancelButtonScheduler::CancelButtonScheduler(bool last, Trigger* button,
+                                             Command* orders)
+    : ButtonScheduler(last, button, orders) {
+  pressedLast = m_button->Grab();
+}
+
+void CancelButtonScheduler::Execute() {
+  if (m_button->Grab()) {
+    if (!pressedLast) {
+      pressedLast = true;
+      m_command->Cancel();
+    }
+  } else {
+    pressedLast = false;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/HeldButtonScheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/HeldButtonScheduler.cpp
new file mode 100644
index 0000000..55420f0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/HeldButtonScheduler.cpp
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/HeldButtonScheduler.h"
+
+#include "Buttons/Button.h"
+#include "Commands/Command.h"
+
+using namespace frc;
+
+HeldButtonScheduler::HeldButtonScheduler(bool last, Trigger* button,
+                                         Command* orders)
+    : ButtonScheduler(last, button, orders) {}
+
+void HeldButtonScheduler::Execute() {
+  if (m_button->Grab()) {
+    m_pressedLast = true;
+    m_command->Start();
+  } else {
+    if (m_pressedLast) {
+      m_pressedLast = false;
+      m_command->Cancel();
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/InternalButton.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/InternalButton.cpp
new file mode 100644
index 0000000..b19b377
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/InternalButton.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/InternalButton.h"
+
+using namespace frc;
+
+InternalButton::InternalButton(bool inverted)
+    : m_pressed(inverted), m_inverted(inverted) {}
+
+void InternalButton::SetInverted(bool inverted) { m_inverted = inverted; }
+
+void InternalButton::SetPressed(bool pressed) { m_pressed = pressed; }
+
+bool InternalButton::Get() { return m_pressed ^ m_inverted; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/JoystickButton.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/JoystickButton.cpp
new file mode 100644
index 0000000..047d5b6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/JoystickButton.cpp
@@ -0,0 +1,15 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/JoystickButton.h"
+
+using namespace frc;
+
+JoystickButton::JoystickButton(GenericHID* joystick, int buttonNumber)
+    : m_joystick(joystick), m_buttonNumber(buttonNumber) {}
+
+bool JoystickButton::Get() { return m_joystick->GetRawButton(m_buttonNumber); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/NetworkButton.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/NetworkButton.cpp
new file mode 100644
index 0000000..475ee7c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/NetworkButton.cpp
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/NetworkButton.h"
+
+#include <networktables/NetworkTable.h>
+#include <networktables/NetworkTableInstance.h>
+
+using namespace frc;
+
+NetworkButton::NetworkButton(const llvm::Twine& tableName,
+                             const llvm::Twine& field)
+    : NetworkButton(nt::NetworkTableInstance::GetDefault().GetTable(tableName),
+                    field) {}
+
+NetworkButton::NetworkButton(std::shared_ptr<nt::NetworkTable> table,
+                             const llvm::Twine& field)
+    : m_entry(table->GetEntry(field)) {}
+
+bool NetworkButton::Get() {
+  return m_entry.GetInstance().IsConnected() && m_entry.GetBoolean(false);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/PressedButtonScheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/PressedButtonScheduler.cpp
new file mode 100644
index 0000000..a98b363
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/PressedButtonScheduler.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/PressedButtonScheduler.h"
+
+#include "Buttons/Button.h"
+#include "Commands/Command.h"
+
+using namespace frc;
+
+PressedButtonScheduler::PressedButtonScheduler(bool last, Trigger* button,
+                                               Command* orders)
+    : ButtonScheduler(last, button, orders) {}
+
+void PressedButtonScheduler::Execute() {
+  if (m_button->Grab()) {
+    if (!m_pressedLast) {
+      m_pressedLast = true;
+      m_command->Start();
+    }
+  } else {
+    m_pressedLast = false;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ReleasedButtonScheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ReleasedButtonScheduler.cpp
new file mode 100644
index 0000000..0da8694
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ReleasedButtonScheduler.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/ReleasedButtonScheduler.h"
+
+#include "Buttons/Button.h"
+#include "Commands/Command.h"
+
+using namespace frc;
+
+ReleasedButtonScheduler::ReleasedButtonScheduler(bool last, Trigger* button,
+                                                 Command* orders)
+    : ButtonScheduler(last, button, orders) {}
+
+void ReleasedButtonScheduler::Execute() {
+  if (m_button->Grab()) {
+    m_pressedLast = true;
+  } else {
+    if (m_pressedLast) {
+      m_pressedLast = false;
+      m_command->Start();
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ToggleButtonScheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ToggleButtonScheduler.cpp
new file mode 100644
index 0000000..db45edc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/ToggleButtonScheduler.cpp
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/ToggleButtonScheduler.h"
+
+#include "Buttons/Button.h"
+#include "Commands/Command.h"
+
+using namespace frc;
+
+ToggleButtonScheduler::ToggleButtonScheduler(bool last, Trigger* button,
+                                             Command* orders)
+    : ButtonScheduler(last, button, orders) {
+  pressedLast = m_button->Grab();
+}
+
+void ToggleButtonScheduler::Execute() {
+  if (m_button->Grab()) {
+    if (!pressedLast) {
+      pressedLast = true;
+      if (m_command->IsRunning()) {
+        m_command->Cancel();
+      } else {
+        m_command->Start();
+      }
+    }
+  } else {
+    pressedLast = false;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/Trigger.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/Trigger.cpp
new file mode 100644
index 0000000..a845f34
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Buttons/Trigger.cpp
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Buttons/Button.h"
+#include "Buttons/CancelButtonScheduler.h"
+#include "Buttons/HeldButtonScheduler.h"
+#include "Buttons/PressedButtonScheduler.h"
+#include "Buttons/ReleasedButtonScheduler.h"
+#include "Buttons/ToggleButtonScheduler.h"
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+bool Trigger::Grab() { return Get() || m_sendablePressed; }
+
+void Trigger::WhenActive(Command* command) {
+  auto pbs = new PressedButtonScheduler(Grab(), this, command);
+  pbs->Start();
+}
+
+void Trigger::WhileActive(Command* command) {
+  auto hbs = new HeldButtonScheduler(Grab(), this, command);
+  hbs->Start();
+}
+
+void Trigger::WhenInactive(Command* command) {
+  auto rbs = new ReleasedButtonScheduler(Grab(), this, command);
+  rbs->Start();
+}
+
+void Trigger::CancelWhenActive(Command* command) {
+  auto cbs = new CancelButtonScheduler(Grab(), this, command);
+  cbs->Start();
+}
+
+void Trigger::ToggleWhenActive(Command* command) {
+  auto tbs = new ToggleButtonScheduler(Grab(), this, command);
+  tbs->Start();
+}
+
+void Trigger::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Button");
+  builder.SetSafeState([=]() { m_sendablePressed = false; });
+  builder.AddBooleanProperty("pressed", [=]() { return Grab(); },
+                             [=](bool value) { m_sendablePressed = value; });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/CameraServer.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/CameraServer.cpp
new file mode 100644
index 0000000..d0c45f8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/CameraServer.cpp
@@ -0,0 +1,677 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "CameraServer.h"
+
+#include <HAL/HAL.h>
+#include <llvm/SmallString.h>
+#include <llvm/raw_ostream.h>
+#include <networktables/NetworkTableInstance.h>
+
+#include "Utility.h"
+#include "WPIErrors.h"
+#include "ntcore_cpp.h"
+
+using namespace frc;
+
+CameraServer* CameraServer::GetInstance() {
+  static CameraServer instance;
+  return &instance;
+}
+
+static llvm::StringRef MakeSourceValue(CS_Source source,
+                                       llvm::SmallVectorImpl<char>& buf) {
+  CS_Status status = 0;
+  buf.clear();
+  switch (cs::GetSourceKind(source, &status)) {
+#ifdef __linux__
+    case cs::VideoSource::kUsb: {
+      llvm::StringRef prefix{"usb:"};
+      buf.append(prefix.begin(), prefix.end());
+      auto path = cs::GetUsbCameraPath(source, &status);
+      buf.append(path.begin(), path.end());
+      break;
+    }
+#endif
+    case cs::VideoSource::kHttp: {
+      llvm::StringRef prefix{"ip:"};
+      buf.append(prefix.begin(), prefix.end());
+      auto urls = cs::GetHttpCameraUrls(source, &status);
+      if (!urls.empty()) buf.append(urls[0].begin(), urls[0].end());
+      break;
+    }
+    case cs::VideoSource::kCv:
+      // FIXME: Should be "cv:", but LabVIEW dashboard requires "usb:".
+      // https://github.com/wpilibsuite/allwpilib/issues/407
+      return "usb:";
+    default:
+      return "unknown:";
+  }
+
+  return llvm::StringRef{buf.begin(), buf.size()};
+}
+
+static std::string MakeStreamValue(llvm::StringRef address, int port) {
+  std::string rv;
+  llvm::raw_string_ostream stream(rv);
+  stream << "mjpg:http://" << address << ':' << port << "/?action=stream";
+  stream.flush();
+  return rv;
+}
+
+std::shared_ptr<nt::NetworkTable> CameraServer::GetSourceTable(
+    CS_Source source) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  return m_tables.lookup(source);
+}
+
+std::vector<std::string> CameraServer::GetSinkStreamValues(CS_Sink sink) {
+  CS_Status status = 0;
+
+  // Ignore all but MjpegServer
+  if (cs::GetSinkKind(sink, &status) != CS_SINK_MJPEG)
+    return std::vector<std::string>{};
+
+  // Get port
+  int port = cs::GetMjpegServerPort(sink, &status);
+
+  // Generate values
+  std::vector<std::string> values;
+  auto listenAddress = cs::GetMjpegServerListenAddress(sink, &status);
+  if (!listenAddress.empty()) {
+    // If a listen address is specified, only use that
+    values.emplace_back(MakeStreamValue(listenAddress, port));
+  } else {
+    // Otherwise generate for hostname and all interface addresses
+    values.emplace_back(MakeStreamValue(cs::GetHostname() + ".local", port));
+
+    for (const auto& addr : m_addresses) {
+      if (addr == "127.0.0.1") continue;  // ignore localhost
+      values.emplace_back(MakeStreamValue(addr, port));
+    }
+  }
+
+  return values;
+}
+
+std::vector<std::string> CameraServer::GetSourceStreamValues(CS_Source source) {
+  CS_Status status = 0;
+
+  // Ignore all but HttpCamera
+  if (cs::GetSourceKind(source, &status) != CS_SOURCE_HTTP)
+    return std::vector<std::string>{};
+
+  // Generate values
+  auto values = cs::GetHttpCameraUrls(source, &status);
+  for (auto& value : values) value = "mjpg:" + value;
+
+  // Look to see if we have a passthrough server for this source
+  for (const auto& i : m_sinks) {
+    CS_Sink sink = i.second.GetHandle();
+    CS_Source sinkSource = cs::GetSinkSource(sink, &status);
+    if (source == sinkSource &&
+        cs::GetSinkKind(sink, &status) == CS_SINK_MJPEG) {
+      // Add USB-only passthrough
+      int port = cs::GetMjpegServerPort(sink, &status);
+      values.emplace_back(MakeStreamValue("172.22.11.2", port));
+      break;
+    }
+  }
+
+  // Set table value
+  return values;
+}
+
+void CameraServer::UpdateStreamValues() {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  // Over all the sinks...
+  for (const auto& i : m_sinks) {
+    CS_Status status = 0;
+    CS_Sink sink = i.second.GetHandle();
+
+    // Get the source's subtable (if none exists, we're done)
+    CS_Source source = cs::GetSinkSource(sink, &status);
+    if (source == 0) continue;
+    auto table = m_tables.lookup(source);
+    if (table) {
+      // Don't set stream values if this is a HttpCamera passthrough
+      if (cs::GetSourceKind(source, &status) == CS_SOURCE_HTTP) continue;
+
+      // Set table value
+      auto values = GetSinkStreamValues(sink);
+      if (!values.empty()) table->GetEntry("streams").SetStringArray(values);
+    }
+  }
+
+  // Over all the sources...
+  for (const auto& i : m_sources) {
+    CS_Source source = i.second.GetHandle();
+
+    // Get the source's subtable (if none exists, we're done)
+    auto table = m_tables.lookup(source);
+    if (table) {
+      // Set table value
+      auto values = GetSourceStreamValues(source);
+      if (!values.empty()) table->GetEntry("streams").SetStringArray(values);
+    }
+  }
+}
+
+static std::string PixelFormatToString(int pixelFormat) {
+  switch (pixelFormat) {
+    case cs::VideoMode::PixelFormat::kMJPEG:
+      return "MJPEG";
+    case cs::VideoMode::PixelFormat::kYUYV:
+      return "YUYV";
+    case cs::VideoMode::PixelFormat::kRGB565:
+      return "RGB565";
+    case cs::VideoMode::PixelFormat::kBGR:
+      return "BGR";
+    case cs::VideoMode::PixelFormat::kGray:
+      return "Gray";
+    default:
+      return "Unknown";
+  }
+}
+
+static std::string VideoModeToString(const cs::VideoMode& mode) {
+  std::string rv;
+  llvm::raw_string_ostream oss{rv};
+  oss << mode.width << "x" << mode.height;
+  oss << " " << PixelFormatToString(mode.pixelFormat) << " ";
+  oss << mode.fps << " fps";
+  return oss.str();
+}
+
+static std::vector<std::string> GetSourceModeValues(int source) {
+  std::vector<std::string> rv;
+  CS_Status status = 0;
+  for (const auto& mode : cs::EnumerateSourceVideoModes(source, &status))
+    rv.emplace_back(VideoModeToString(mode));
+  return rv;
+}
+
+static inline llvm::StringRef Concatenate(llvm::StringRef lhs,
+                                          llvm::StringRef rhs,
+                                          llvm::SmallVectorImpl<char>& buf) {
+  buf.clear();
+  llvm::raw_svector_ostream oss{buf};
+  oss << lhs << rhs;
+  return oss.str();
+}
+
+static void PutSourcePropertyValue(nt::NetworkTable* table,
+                                   const cs::VideoEvent& event, bool isNew) {
+  llvm::SmallString<64> name;
+  llvm::SmallString<64> infoName;
+  if (llvm::StringRef{event.name}.startswith("raw_")) {
+    name = "RawProperty/";
+    name += event.name;
+    infoName = "RawPropertyInfo/";
+    infoName += event.name;
+  } else {
+    name = "Property/";
+    name += event.name;
+    infoName = "PropertyInfo/";
+    infoName += event.name;
+  }
+
+  llvm::SmallString<64> buf;
+  CS_Status status = 0;
+  nt::NetworkTableEntry entry = table->GetEntry(name);
+  switch (event.propertyKind) {
+    case cs::VideoProperty::kBoolean:
+      if (isNew)
+        entry.SetDefaultBoolean(event.value != 0);
+      else
+        entry.SetBoolean(event.value != 0);
+      break;
+    case cs::VideoProperty::kInteger:
+    case cs::VideoProperty::kEnum:
+      if (isNew) {
+        entry.SetDefaultDouble(event.value);
+        table->GetEntry(Concatenate(infoName, "/min", buf))
+            .SetDouble(cs::GetPropertyMin(event.propertyHandle, &status));
+        table->GetEntry(Concatenate(infoName, "/max", buf))
+            .SetDouble(cs::GetPropertyMax(event.propertyHandle, &status));
+        table->GetEntry(Concatenate(infoName, "/step", buf))
+            .SetDouble(cs::GetPropertyStep(event.propertyHandle, &status));
+        table->GetEntry(Concatenate(infoName, "/default", buf))
+            .SetDouble(cs::GetPropertyDefault(event.propertyHandle, &status));
+      } else {
+        entry.SetDouble(event.value);
+      }
+      break;
+    case cs::VideoProperty::kString:
+      if (isNew)
+        entry.SetDefaultString(event.valueStr);
+      else
+        entry.SetString(event.valueStr);
+      break;
+    default:
+      break;
+  }
+}
+
+CameraServer::CameraServer()
+    : m_publishTable{nt::NetworkTableInstance::GetDefault().GetTable(
+          kPublishName)},
+      m_nextPort(kBasePort) {
+  // We publish sources to NetworkTables using the following structure:
+  // "/CameraPublisher/{Source.Name}/" - root
+  // - "source" (string): Descriptive, prefixed with type (e.g. "usb:0")
+  // - "streams" (string array): URLs that can be used to stream data
+  // - "description" (string): Description of the source
+  // - "connected" (boolean): Whether source is connected
+  // - "mode" (string): Current video mode
+  // - "modes" (string array): Available video modes
+  // - "Property/{Property}" - Property values
+  // - "PropertyInfo/{Property}" - Property supporting information
+
+  // Listener for video events
+  m_videoListener = cs::VideoListener{
+      [=](const cs::VideoEvent& event) {
+        CS_Status status = 0;
+        switch (event.kind) {
+          case cs::VideoEvent::kSourceCreated: {
+            // Create subtable for the camera
+            auto table = m_publishTable->GetSubTable(event.name);
+            {
+              std::lock_guard<wpi::mutex> lock(m_mutex);
+              m_tables.insert(std::make_pair(event.sourceHandle, table));
+            }
+            llvm::SmallString<64> buf;
+            table->GetEntry("source").SetString(
+                MakeSourceValue(event.sourceHandle, buf));
+            llvm::SmallString<64> descBuf;
+            table->GetEntry("description")
+                .SetString(cs::GetSourceDescription(event.sourceHandle, descBuf,
+                                                    &status));
+            table->GetEntry("connected")
+                .SetBoolean(cs::IsSourceConnected(event.sourceHandle, &status));
+            table->GetEntry("streams").SetStringArray(
+                GetSourceStreamValues(event.sourceHandle));
+            auto mode = cs::GetSourceVideoMode(event.sourceHandle, &status);
+            table->GetEntry("mode").SetDefaultString(VideoModeToString(mode));
+            table->GetEntry("modes").SetStringArray(
+                GetSourceModeValues(event.sourceHandle));
+            break;
+          }
+          case cs::VideoEvent::kSourceDestroyed: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table) {
+              table->GetEntry("source").SetString("");
+              table->GetEntry("streams").SetStringArray(
+                  std::vector<std::string>{});
+              table->GetEntry("modes").SetStringArray(
+                  std::vector<std::string>{});
+            }
+            break;
+          }
+          case cs::VideoEvent::kSourceConnected: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table) {
+              // update the description too (as it may have changed)
+              llvm::SmallString<64> descBuf;
+              table->GetEntry("description")
+                  .SetString(cs::GetSourceDescription(event.sourceHandle,
+                                                      descBuf, &status));
+              table->GetEntry("connected").SetBoolean(true);
+            }
+            break;
+          }
+          case cs::VideoEvent::kSourceDisconnected: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table) table->GetEntry("connected").SetBoolean(false);
+            break;
+          }
+          case cs::VideoEvent::kSourceVideoModesUpdated: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table)
+              table->GetEntry("modes").SetStringArray(
+                  GetSourceModeValues(event.sourceHandle));
+            break;
+          }
+          case cs::VideoEvent::kSourceVideoModeChanged: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table)
+              table->GetEntry("mode").SetString(VideoModeToString(event.mode));
+            break;
+          }
+          case cs::VideoEvent::kSourcePropertyCreated: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table) PutSourcePropertyValue(table.get(), event, true);
+            break;
+          }
+          case cs::VideoEvent::kSourcePropertyValueUpdated: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table) PutSourcePropertyValue(table.get(), event, false);
+            break;
+          }
+          case cs::VideoEvent::kSourcePropertyChoicesUpdated: {
+            auto table = GetSourceTable(event.sourceHandle);
+            if (table) {
+              llvm::SmallString<64> name{"PropertyInfo/"};
+              name += event.name;
+              name += "/choices";
+              auto choices =
+                  cs::GetEnumPropertyChoices(event.propertyHandle, &status);
+              table->GetEntry(name).SetStringArray(choices);
+            }
+            break;
+          }
+          case cs::VideoEvent::kSinkSourceChanged:
+          case cs::VideoEvent::kSinkCreated:
+          case cs::VideoEvent::kSinkDestroyed:
+          case cs::VideoEvent::kNetworkInterfacesChanged: {
+            m_addresses = cs::GetNetworkInterfaces();
+            UpdateStreamValues();
+            break;
+          }
+          default:
+            break;
+        }
+      },
+      0x4fff, true};
+
+  // Listener for NetworkTable events
+  // We don't currently support changing settings via NT due to
+  // synchronization issues, so just update to current setting if someone
+  // else tries to change it.
+  llvm::SmallString<64> buf;
+  m_tableListener = nt::NetworkTableInstance::GetDefault().AddEntryListener(
+      Concatenate(kPublishName, "/", buf),
+      [=](const nt::EntryNotification& event) {
+        llvm::StringRef relativeKey =
+            event.name.substr(llvm::StringRef(kPublishName).size() + 1);
+
+        // get source (sourceName/...)
+        auto subKeyIndex = relativeKey.find('/');
+        if (subKeyIndex == llvm::StringRef::npos) return;
+        llvm::StringRef sourceName = relativeKey.slice(0, subKeyIndex);
+        auto sourceIt = m_sources.find(sourceName);
+        if (sourceIt == m_sources.end()) return;
+
+        // get subkey
+        relativeKey = relativeKey.substr(subKeyIndex + 1);
+
+        // handle standard names
+        llvm::StringRef propName;
+        nt::NetworkTableEntry entry{event.entry};
+        if (relativeKey == "mode") {
+          // reset to current mode
+          entry.SetString(VideoModeToString(sourceIt->second.GetVideoMode()));
+          return;
+        } else if (relativeKey.startswith("Property/")) {
+          propName = relativeKey.substr(9);
+        } else if (relativeKey.startswith("RawProperty/")) {
+          propName = relativeKey.substr(12);
+        } else {
+          return;  // ignore
+        }
+
+        // everything else is a property
+        auto property = sourceIt->second.GetProperty(propName);
+        switch (property.GetKind()) {
+          case cs::VideoProperty::kNone:
+            return;
+          case cs::VideoProperty::kBoolean:
+            entry.SetBoolean(property.Get() != 0);
+            return;
+          case cs::VideoProperty::kInteger:
+          case cs::VideoProperty::kEnum:
+            entry.SetDouble(property.Get());
+            return;
+          case cs::VideoProperty::kString:
+            entry.SetString(property.GetString());
+            return;
+          default:
+            return;
+        }
+      },
+      NT_NOTIFY_IMMEDIATE | NT_NOTIFY_UPDATE);
+}
+#ifdef __linux__
+cs::UsbCamera CameraServer::StartAutomaticCapture() {
+  cs::UsbCamera camera = StartAutomaticCapture(m_defaultUsbDevice++);
+  HAL_Report(HALUsageReporting::kResourceType_PCVideoServer,
+             camera.GetHandle());
+  return camera;
+}
+
+cs::UsbCamera CameraServer::StartAutomaticCapture(int dev) {
+  llvm::SmallString<64> buf;
+  llvm::raw_svector_ostream name{buf};
+  name << "USB Camera " << dev;
+
+  cs::UsbCamera camera{name.str(), dev};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_PCVideoServer,
+             camera.GetHandle());
+  return camera;
+}
+
+cs::UsbCamera CameraServer::StartAutomaticCapture(llvm::StringRef name,
+                                                  int dev) {
+  cs::UsbCamera camera{name, dev};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_PCVideoServer,
+             camera.GetHandle());
+  return camera;
+}
+
+cs::UsbCamera CameraServer::StartAutomaticCapture(llvm::StringRef name,
+                                                  llvm::StringRef path) {
+  cs::UsbCamera camera{name, path};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_PCVideoServer,
+             camera.GetHandle());
+  return camera;
+}
+#endif
+
+cs::AxisCamera CameraServer::AddAxisCamera(llvm::StringRef host) {
+  return AddAxisCamera("Axis Camera", host);
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(const char* host) {
+  return AddAxisCamera("Axis Camera", host);
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(const std::string& host) {
+  return AddAxisCamera("Axis Camera", host);
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(llvm::ArrayRef<std::string> hosts) {
+  return AddAxisCamera("Axis Camera", hosts);
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(llvm::StringRef name,
+                                           llvm::StringRef host) {
+  cs::AxisCamera camera{name, host};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_AxisCamera, camera.GetHandle());
+  return camera;
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(llvm::StringRef name,
+                                           const char* host) {
+  cs::AxisCamera camera{name, host};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_AxisCamera, camera.GetHandle());
+  return camera;
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(llvm::StringRef name,
+                                           const std::string& host) {
+  cs::AxisCamera camera{name, host};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_AxisCamera, camera.GetHandle());
+  return camera;
+}
+
+cs::AxisCamera CameraServer::AddAxisCamera(llvm::StringRef name,
+                                           llvm::ArrayRef<std::string> hosts) {
+  cs::AxisCamera camera{name, hosts};
+  StartAutomaticCapture(camera);
+  HAL_Report(HALUsageReporting::kResourceType_AxisCamera, camera.GetHandle());
+  return camera;
+}
+
+void CameraServer::StartAutomaticCapture(const cs::VideoSource& camera) {
+  llvm::SmallString<64> name{"serve_"};
+  name += camera.GetName();
+
+  AddCamera(camera);
+  auto server = AddServer(name);
+  server.SetSource(camera);
+}
+
+cs::CvSink CameraServer::GetVideo() {
+  cs::VideoSource source;
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    if (m_primarySourceName.empty()) {
+      wpi_setWPIErrorWithContext(CameraServerError, "no camera available");
+      return cs::CvSink{};
+    }
+    auto it = m_sources.find(m_primarySourceName);
+    if (it == m_sources.end()) {
+      wpi_setWPIErrorWithContext(CameraServerError, "no camera available");
+      return cs::CvSink{};
+    }
+    source = it->second;
+  }
+  return GetVideo(std::move(source));
+}
+
+cs::CvSink CameraServer::GetVideo(const cs::VideoSource& camera) {
+  llvm::SmallString<64> name{"opencv_"};
+  name += camera.GetName();
+
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    auto it = m_sinks.find(name);
+    if (it != m_sinks.end()) {
+      auto kind = it->second.GetKind();
+      if (kind != cs::VideoSink::kCv) {
+        llvm::SmallString<64> buf;
+        llvm::raw_svector_ostream err{buf};
+        err << "expected OpenCV sink, but got " << kind;
+        wpi_setWPIErrorWithContext(CameraServerError, err.str());
+        return cs::CvSink{};
+      }
+      return *static_cast<cs::CvSink*>(&it->second);
+    }
+  }
+
+  cs::CvSink newsink{name};
+  newsink.SetSource(camera);
+  AddServer(newsink);
+  return newsink;
+}
+
+cs::CvSink CameraServer::GetVideo(llvm::StringRef name) {
+  cs::VideoSource source;
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    auto it = m_sources.find(name);
+    if (it == m_sources.end()) {
+      llvm::SmallString<64> buf;
+      llvm::raw_svector_ostream err{buf};
+      err << "could not find camera " << name;
+      wpi_setWPIErrorWithContext(CameraServerError, err.str());
+      return cs::CvSink{};
+    }
+    source = it->second;
+  }
+  return GetVideo(source);
+}
+
+cs::CvSource CameraServer::PutVideo(llvm::StringRef name, int width,
+                                    int height) {
+  cs::CvSource source{name, cs::VideoMode::kMJPEG, width, height, 30};
+  StartAutomaticCapture(source);
+  return source;
+}
+
+cs::MjpegServer CameraServer::AddServer(llvm::StringRef name) {
+  int port;
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    port = m_nextPort++;
+  }
+  return AddServer(name, port);
+}
+
+cs::MjpegServer CameraServer::AddServer(llvm::StringRef name, int port) {
+  cs::MjpegServer server{name, port};
+  AddServer(server);
+  return server;
+}
+
+void CameraServer::AddServer(const cs::VideoSink& server) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_sinks.emplace_second(server.GetName(), server);
+}
+
+void CameraServer::RemoveServer(llvm::StringRef name) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_sinks.erase(name);
+}
+
+cs::VideoSink CameraServer::GetServer() {
+  llvm::SmallString<64> name;
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    if (m_primarySourceName.empty()) {
+      wpi_setWPIErrorWithContext(CameraServerError, "no camera available");
+      return cs::VideoSink{};
+    }
+    name = "serve_";
+    name += m_primarySourceName;
+  }
+  return GetServer(name);
+}
+
+cs::VideoSink CameraServer::GetServer(llvm::StringRef name) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  auto it = m_sinks.find(name);
+  if (it == m_sinks.end()) {
+    llvm::SmallString<64> buf;
+    llvm::raw_svector_ostream err{buf};
+    err << "could not find server " << name;
+    wpi_setWPIErrorWithContext(CameraServerError, err.str());
+    return cs::VideoSink{};
+  }
+  return it->second;
+}
+
+void CameraServer::AddCamera(const cs::VideoSource& camera) {
+  std::string name = camera.GetName();
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (m_primarySourceName.empty()) m_primarySourceName = name;
+  m_sources.emplace_second(name, camera);
+}
+
+void CameraServer::RemoveCamera(llvm::StringRef name) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_sources.erase(name);
+}
+
+void CameraServer::SetSize(int size) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (m_primarySourceName.empty()) return;
+  auto it = m_sources.find(m_primarySourceName);
+  if (it == m_sources.end()) return;
+  if (size == kSize160x120)
+    it->second.SetResolution(160, 120);
+  else if (size == kSize320x240)
+    it->second.SetResolution(320, 240);
+  else if (size == kSize640x480)
+    it->second.SetResolution(640, 480);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Command.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Command.cpp
new file mode 100644
index 0000000..f189b61
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Command.cpp
@@ -0,0 +1,455 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/Command.h"
+
+#include <typeinfo>
+
+#include "Commands/CommandGroup.h"
+#include "Commands/Scheduler.h"
+#include "LiveWindow/LiveWindow.h"
+#include "RobotState.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "Timer.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+int Command::m_commandCounter = 0;
+
+/**
+ * Creates a new command.
+ *
+ * The name of this command will be default.
+ */
+Command::Command() : Command("", -1.0) {}
+
+/**
+ * Creates a new command with the given name and no timeout.
+ *
+ * @param name the name for this command
+ */
+Command::Command(const llvm::Twine& name) : Command(name, -1.0) {}
+
+/**
+ * Creates a new command with the given timeout and a default name.
+ *
+ * @param timeout the time (in seconds) before this command "times out"
+ * @see IsTimedOut()
+ */
+Command::Command(double timeout) : Command("", timeout) {}
+
+/**
+ * Creates a new command with the given name and timeout.
+ *
+ * @param name    the name of the command
+ * @param timeout the time (in seconds) before this command "times out"
+ * @see IsTimedOut()
+ */
+Command::Command(const llvm::Twine& name, double timeout)
+    : SendableBase(false) {
+  // We use -1.0 to indicate no timeout.
+  if (timeout < 0.0 && timeout != -1.0)
+    wpi_setWPIErrorWithContext(ParameterOutOfRange, "timeout < 0.0");
+
+  m_timeout = timeout;
+
+  // If name contains an empty string
+  if (name.isTriviallyEmpty() ||
+      (name.isSingleStringRef() && name.getSingleStringRef().empty())) {
+    SetName("Command_" + llvm::Twine(typeid(*this).name()));
+  } else {
+    SetName(name);
+  }
+}
+
+/**
+ * Get the ID (sequence number) for this command.
+ *
+ * The ID is a unique sequence number that is incremented for each command.
+ *
+ * @return The ID of this command
+ */
+int Command::GetID() const { return m_commandID; }
+
+/**
+ * Sets the timeout of this command.
+ *
+ * @param timeout the timeout (in seconds)
+ * @see IsTimedOut()
+ */
+void Command::SetTimeout(double timeout) {
+  if (timeout < 0.0)
+    wpi_setWPIErrorWithContext(ParameterOutOfRange, "timeout < 0.0");
+  else
+    m_timeout = timeout;
+}
+
+/**
+ * Returns the time since this command was initialized (in seconds).
+ *
+ * This function will work even if there is no specified timeout.
+ *
+ * @return the time since this command was initialized (in seconds).
+ */
+double Command::TimeSinceInitialized() const {
+  if (m_startTime < 0.0)
+    return 0.0;
+  else
+    return Timer::GetFPGATimestamp() - m_startTime;
+}
+
+/**
+ * This method specifies that the given Subsystem is used by this command.
+ *
+ * This method is crucial to the functioning of the Command System in general.
+ *
+ * Note that the recommended way to call this method is in the constructor.
+ *
+ * @param subsystem The Subsystem required
+ * @see Subsystem
+ */
+void Command::Requires(Subsystem* subsystem) {
+  if (!AssertUnlocked("Can not add new requirement to command")) return;
+
+  if (subsystem != nullptr)
+    m_requirements.insert(subsystem);
+  else
+    wpi_setWPIErrorWithContext(NullParameter, "subsystem");
+}
+
+/**
+ * Called when the command has been removed.
+ *
+ * This will call Interrupted() or End().
+ */
+void Command::Removed() {
+  if (m_initialized) {
+    if (IsCanceled()) {
+      Interrupted();
+      _Interrupted();
+    } else {
+      End();
+      _End();
+    }
+  }
+  m_initialized = false;
+  m_canceled = false;
+  m_running = false;
+  m_completed = true;
+}
+
+/**
+ * Starts up the command. Gets the command ready to start.
+ *
+ * Note that the command will eventually start, however it will not necessarily
+ * do so immediately, and may in fact be canceled before initialize is even
+ * called.
+ */
+void Command::Start() {
+  LockChanges();
+  if (m_parent != nullptr)
+    wpi_setWPIErrorWithContext(
+        CommandIllegalUse,
+        "Can not start a command that is part of a command group");
+
+  m_completed = false;
+  Scheduler::GetInstance()->AddCommand(this);
+}
+
+/**
+ * The run method is used internally to actually run the commands.
+ *
+ * @return Whether or not the command should stay within the Scheduler.
+ */
+bool Command::Run() {
+  if (!m_runWhenDisabled && m_parent == nullptr && RobotState::IsDisabled())
+    Cancel();
+
+  if (IsCanceled()) return false;
+
+  if (!m_initialized) {
+    m_initialized = true;
+    StartTiming();
+    _Initialize();
+    Initialize();
+  }
+  _Execute();
+  Execute();
+  return !IsFinished();
+}
+
+/**
+ * The initialize method is called the first time this Command is run after
+ * being started.
+ */
+void Command::Initialize() {}
+
+/**
+ * The execute method is called repeatedly until this Command either finishes
+ * or is canceled.
+ */
+void Command::Execute() {}
+
+/**
+ * Called when the command ended peacefully. This is where you may want to wrap
+ * up loose ends, like shutting off a motor that was being used in the command.
+ */
+void Command::End() {}
+
+/**
+ * Called when the command ends because somebody called Cancel() or another
+ * command shared the same requirements as this one, and booted it out.
+ *
+ * This is where you may want to wrap up loose ends, like shutting off a motor
+ * that was being used in the command.
+ *
+ * Generally, it is useful to simply call the End() method within this method,
+ * as done here.
+ */
+void Command::Interrupted() { End(); }
+
+void Command::_Initialize() { m_completed = false; }
+
+void Command::_Interrupted() { m_completed = true; }
+
+void Command::_Execute() {}
+
+void Command::_End() { m_completed = true; }
+
+/**
+ * Called to indicate that the timer should start.
+ *
+ * This is called right before Initialize() is, inside the Run() method.
+ */
+void Command::StartTiming() { m_startTime = Timer::GetFPGATimestamp(); }
+
+/**
+ * Returns whether or not the TimeSinceInitialized() method returns a number
+ * which is greater than or equal to the timeout for the command.
+ *
+ * If there is no timeout, this will always return false.
+ *
+ * @return whether the time has expired
+ */
+bool Command::IsTimedOut() const {
+  return m_timeout != -1 && TimeSinceInitialized() >= m_timeout;
+}
+
+/**
+ * Returns the requirements (as an std::set of Subsystem pointers) of this
+ * command.
+ *
+ * @return The requirements (as an std::set of Subsystem pointers) of this
+ *         command
+ */
+Command::SubsystemSet Command::GetRequirements() const {
+  return m_requirements;
+}
+
+/**
+ * Prevents further changes from being made.
+ */
+void Command::LockChanges() { m_locked = true; }
+
+/**
+ * If changes are locked, then this will generate a CommandIllegalUse error.
+ *
+ * @param message The message to report on error (it is appended by a default
+ *                message)
+ * @return True if assert passed, false if assert failed.
+ */
+bool Command::AssertUnlocked(const std::string& message) {
+  if (m_locked) {
+    std::string buf =
+        message + " after being started or being added to a command group";
+    wpi_setWPIErrorWithContext(CommandIllegalUse, buf);
+    return false;
+  }
+  return true;
+}
+
+/**
+ * Sets the parent of this command. No actual change is made to the group.
+ *
+ * @param parent the parent
+ */
+void Command::SetParent(CommandGroup* parent) {
+  if (parent == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "parent");
+  } else if (m_parent != nullptr) {
+    wpi_setWPIErrorWithContext(CommandIllegalUse,
+                               "Can not give command to a command group after "
+                               "already being put in a command group");
+  } else {
+    LockChanges();
+    m_parent = parent;
+  }
+}
+
+/**
+ * Returns whether the command has a parent.
+ *
+ * @param True if the command has a parent.
+ */
+bool Command::IsParented() const { return m_parent != nullptr; }
+
+/**
+ * Clears list of subsystem requirements.
+ *
+ * This is only used by ConditionalCommand so cancelling the chosen command
+ * works properly in CommandGroup.
+ */
+void Command::ClearRequirements() { m_requirements.clear(); }
+
+/**
+ * This is used internally to mark that the command has been started.
+ *
+ * The lifecycle of a command is:
+ *
+ * StartRunning() is called. Run() is called (multiple times potentially).
+ * Removed() is called.
+ *
+ * It is very important that StartRunning() and Removed() be called in order or
+ * some assumptions of the code will be broken.
+ */
+void Command::StartRunning() {
+  m_running = true;
+  m_startTime = -1;
+  m_completed = false;
+}
+
+/**
+ * Returns whether or not the command is running.
+ *
+ * This may return true even if the command has just been canceled, as it may
+ * not have yet called Interrupted().
+ *
+ * @return whether or not the command is running
+ */
+bool Command::IsRunning() const { return m_running; }
+
+/**
+ * Returns whether or not the command has been initialized.
+ *
+ * @return whether or not the command has been initialized.
+ */
+bool Command::IsInitialized() const { return m_initialized; }
+
+/**
+ * Returns whether or not the command has completed running.
+ *
+ * @return whether or not the command has completed running.
+ */
+bool Command::IsCompleted() const { return m_completed; }
+
+/**
+ * This will cancel the current command.
+ *
+ * This will cancel the current command eventually. It can be called multiple
+ * times. And it can be called when the command is not running. If the command
+ * is running though, then the command will be marked as canceled and eventually
+ * removed.
+ *
+ * A command can not be canceled if it is a part of a command group, you must
+ * cancel the command group instead.
+ */
+void Command::Cancel() {
+  if (m_parent != nullptr)
+    wpi_setWPIErrorWithContext(
+        CommandIllegalUse,
+        "Can not cancel a command that is part of a command group");
+
+  _Cancel();
+}
+
+/**
+ * This works like Cancel(), except that it doesn't throw an exception if it is
+ * a part of a command group.
+ *
+ * Should only be called by the parent command group.
+ */
+void Command::_Cancel() {
+  if (IsRunning()) m_canceled = true;
+}
+
+/**
+ * Returns whether or not this has been canceled.
+ *
+ * @return whether or not this has been canceled
+ */
+bool Command::IsCanceled() const { return m_canceled; }
+
+/**
+ * Returns whether or not this command can be interrupted.
+ *
+ * @return whether or not this command can be interrupted
+ */
+bool Command::IsInterruptible() const { return m_interruptible; }
+
+/**
+ * Sets whether or not this command can be interrupted.
+ *
+ * @param interruptible whether or not this command can be interrupted
+ */
+void Command::SetInterruptible(bool interruptible) {
+  m_interruptible = interruptible;
+}
+
+/**
+ * Checks if the command requires the given Subsystem.
+ *
+ * @param system the system
+ * @return whether or not the subsystem is required (false if given nullptr)
+ */
+bool Command::DoesRequire(Subsystem* system) const {
+  return m_requirements.count(system) > 0;
+}
+
+/**
+ * Returns the CommandGroup that this command is a part of.
+ *
+ * Will return null if this Command is not in a group.
+ *
+ * @return The CommandGroup that this command is a part of (or null if not in
+ *         group)
+ */
+CommandGroup* Command::GetGroup() const { return m_parent; }
+
+/**
+ * Sets whether or not this Command should run when the robot is disabled.
+ *
+ * By default a command will not run when the robot is disabled, and will in
+ * fact be canceled.
+ *
+ * @param run Whether this command should run when the robot is disabled.
+ */
+void Command::SetRunWhenDisabled(bool run) { m_runWhenDisabled = run; }
+
+/**
+ * Returns whether or not this Command will run when the robot is disabled, or
+ * if it will cancel itself.
+ *
+ * @return Whether this Command will run when the robot is disabled, or if it
+ * will cancel itself.
+ */
+bool Command::WillRunWhenDisabled() const { return m_runWhenDisabled; }
+
+void Command::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Command");
+  builder.AddStringProperty(".name", [=]() { return GetName(); }, nullptr);
+  builder.AddBooleanProperty("running", [=]() { return IsRunning(); },
+                             [=](bool value) {
+                               if (value) {
+                                 if (!IsRunning()) Start();
+                               } else {
+                                 if (IsRunning()) Cancel();
+                               }
+                             });
+  builder.AddBooleanProperty(".isParented", [=]() { return IsParented(); },
+                             nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/CommandGroup.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/CommandGroup.cpp
new file mode 100644
index 0000000..ccf691c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/CommandGroup.cpp
@@ -0,0 +1,314 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/CommandGroup.h"
+
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Creates a new CommandGroup with the given name.
+ *
+ * @param name The name for this command group
+ */
+CommandGroup::CommandGroup(const llvm::Twine& name) : Command(name) {}
+
+/**
+ * Adds a new Command to the group. The Command will be started after all the
+ * previously added Commands.
+ *
+ * Note that any requirements the given Command has will be added to the group.
+ * For this reason, a Command's requirements can not be changed after being
+ * added to a group.
+ *
+ * It is recommended that this method be called in the constructor.
+ *
+ * @param command The Command to be added
+ */
+void CommandGroup::AddSequential(Command* command) {
+  if (command == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "command");
+    return;
+  }
+  if (!AssertUnlocked("Cannot add new command to command group")) return;
+
+  command->SetParent(this);
+
+  m_commands.push_back(
+      CommandGroupEntry(command, CommandGroupEntry::kSequence_InSequence));
+  // Iterate through command->GetRequirements() and call Requires() on each
+  // required subsystem
+  Command::SubsystemSet requirements = command->GetRequirements();
+  for (auto iter = requirements.begin(); iter != requirements.end(); iter++)
+    Requires(*iter);
+}
+
+/**
+ * Adds a new Command to the group with a given timeout. The Command will be
+ * started after all the previously added commands.
+ *
+ * Once the Command is started, it will be run until it finishes or the time
+ * expires, whichever is sooner.  Note that the given Command will have no
+ * knowledge that it is on a timer.
+ *
+ * Note that any requirements the given Command has will be added to the group.
+ * For this reason, a Command's requirements can not be changed after being
+ * added to a group.
+ *
+ * It is recommended that this method be called in the constructor.
+ *
+ * @param command The Command to be added
+ * @param timeout The timeout (in seconds)
+ */
+void CommandGroup::AddSequential(Command* command, double timeout) {
+  if (command == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "command");
+    return;
+  }
+  if (!AssertUnlocked("Cannot add new command to command group")) return;
+  if (timeout < 0.0) {
+    wpi_setWPIErrorWithContext(ParameterOutOfRange, "timeout < 0.0");
+    return;
+  }
+
+  command->SetParent(this);
+
+  m_commands.push_back(CommandGroupEntry(
+      command, CommandGroupEntry::kSequence_InSequence, timeout));
+  // Iterate through command->GetRequirements() and call Requires() on each
+  // required subsystem
+  Command::SubsystemSet requirements = command->GetRequirements();
+  for (auto iter = requirements.begin(); iter != requirements.end(); iter++)
+    Requires(*iter);
+}
+
+/**
+ * Adds a new child Command to the group. The Command will be started after all
+ * the previously added Commands.
+ *
+ * Instead of waiting for the child to finish, a CommandGroup will have it run
+ * at the same time as the subsequent Commands. The child will run until either
+ * it finishes, a new child with conflicting requirements is started, or the
+ * main sequence runs a Command with conflicting requirements. In the latter two
+ * cases, the child will be canceled even if it says it can't be interrupted.
+ *
+ * Note that any requirements the given Command has will be added to the group.
+ * For this reason, a Command's requirements can not be changed after being
+ * added to a group.
+ *
+ * It is recommended that this method be called in the constructor.
+ *
+ * @param command The command to be added
+ */
+void CommandGroup::AddParallel(Command* command) {
+  if (command == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "command");
+    return;
+  }
+  if (!AssertUnlocked("Cannot add new command to command group")) return;
+
+  command->SetParent(this);
+
+  m_commands.push_back(
+      CommandGroupEntry(command, CommandGroupEntry::kSequence_BranchChild));
+  // Iterate through command->GetRequirements() and call Requires() on each
+  // required subsystem
+  Command::SubsystemSet requirements = command->GetRequirements();
+  for (auto iter = requirements.begin(); iter != requirements.end(); iter++)
+    Requires(*iter);
+}
+
+/**
+ * Adds a new child Command to the group with the given timeout. The Command
+ * will be started after all the previously added Commands.
+ *
+ * Once the Command is started, it will run until it finishes, is interrupted,
+ * or the time expires, whichever is sooner. Note that the given Command will
+ * have no knowledge that it is on a timer.
+ *
+ * Instead of waiting for the child to finish, a CommandGroup will have it run
+ * at the same time as the subsequent Commands. The child will run until either
+ * it finishes, the timeout expires, a new child with conflicting requirements
+ * is started, or the main sequence runs a Command with conflicting
+ * requirements. In the latter two cases, the child will be canceled even if it
+ * says it can't be interrupted.
+ *
+ * Note that any requirements the given Command has will be added to the group.
+ * For this reason, a Command's requirements can not be changed after being
+ * added to a group.
+ *
+ * It is recommended that this method be called in the constructor.
+ *
+ * @param command The command to be added
+ * @param timeout The timeout (in seconds)
+ */
+void CommandGroup::AddParallel(Command* command, double timeout) {
+  if (command == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "command");
+    return;
+  }
+  if (!AssertUnlocked("Cannot add new command to command group")) return;
+  if (timeout < 0.0) {
+    wpi_setWPIErrorWithContext(ParameterOutOfRange, "timeout < 0.0");
+    return;
+  }
+
+  command->SetParent(this);
+
+  m_commands.push_back(CommandGroupEntry(
+      command, CommandGroupEntry::kSequence_BranchChild, timeout));
+  // Iterate through command->GetRequirements() and call Requires() on each
+  // required subsystem
+  Command::SubsystemSet requirements = command->GetRequirements();
+  for (auto iter = requirements.begin(); iter != requirements.end(); iter++)
+    Requires(*iter);
+}
+
+void CommandGroup::_Initialize() { m_currentCommandIndex = -1; }
+
+void CommandGroup::_Execute() {
+  CommandGroupEntry entry;
+  Command* cmd = nullptr;
+  bool firstRun = false;
+
+  if (m_currentCommandIndex == -1) {
+    firstRun = true;
+    m_currentCommandIndex = 0;
+  }
+
+  while (static_cast<size_t>(m_currentCommandIndex) < m_commands.size()) {
+    if (cmd != nullptr) {
+      if (entry.IsTimedOut()) cmd->_Cancel();
+
+      if (cmd->Run()) {
+        break;
+      } else {
+        cmd->Removed();
+        m_currentCommandIndex++;
+        firstRun = true;
+        cmd = nullptr;
+        continue;
+      }
+    }
+
+    entry = m_commands[m_currentCommandIndex];
+    cmd = nullptr;
+
+    switch (entry.m_state) {
+      case CommandGroupEntry::kSequence_InSequence:
+        cmd = entry.m_command;
+        if (firstRun) {
+          cmd->StartRunning();
+          CancelConflicts(cmd);
+          firstRun = false;
+        }
+        break;
+
+      case CommandGroupEntry::kSequence_BranchPeer:
+        m_currentCommandIndex++;
+        entry.m_command->Start();
+        break;
+
+      case CommandGroupEntry::kSequence_BranchChild:
+        m_currentCommandIndex++;
+        CancelConflicts(entry.m_command);
+        entry.m_command->StartRunning();
+        m_children.push_back(entry);
+        break;
+    }
+  }
+
+  // Run Children
+  for (auto iter = m_children.begin(); iter != m_children.end();) {
+    entry = *iter;
+    Command* child = entry.m_command;
+    if (entry.IsTimedOut()) child->_Cancel();
+
+    if (!child->Run()) {
+      child->Removed();
+      iter = m_children.erase(iter);
+    } else {
+      iter++;
+    }
+  }
+}
+
+void CommandGroup::_End() {
+  // Theoretically, we don't have to check this, but we do if teams override the
+  // IsFinished method
+  if (m_currentCommandIndex != -1 &&
+      static_cast<size_t>(m_currentCommandIndex) < m_commands.size()) {
+    Command* cmd = m_commands[m_currentCommandIndex].m_command;
+    cmd->_Cancel();
+    cmd->Removed();
+  }
+
+  for (auto iter = m_children.begin(); iter != m_children.end(); iter++) {
+    Command* cmd = iter->m_command;
+    cmd->_Cancel();
+    cmd->Removed();
+  }
+  m_children.clear();
+}
+
+void CommandGroup::_Interrupted() { _End(); }
+
+// Can be overwritten by teams
+void CommandGroup::Initialize() {}
+
+// Can be overwritten by teams
+void CommandGroup::Execute() {}
+
+// Can be overwritten by teams
+void CommandGroup::End() {}
+
+// Can be overwritten by teams
+void CommandGroup::Interrupted() {}
+
+bool CommandGroup::IsFinished() {
+  return static_cast<size_t>(m_currentCommandIndex) >= m_commands.size() &&
+         m_children.empty();
+}
+
+bool CommandGroup::IsInterruptible() const {
+  if (!Command::IsInterruptible()) return false;
+
+  if (m_currentCommandIndex != -1 &&
+      static_cast<size_t>(m_currentCommandIndex) < m_commands.size()) {
+    Command* cmd = m_commands[m_currentCommandIndex].m_command;
+    if (!cmd->IsInterruptible()) return false;
+  }
+
+  for (auto iter = m_children.cbegin(); iter != m_children.cend(); iter++) {
+    if (!iter->m_command->IsInterruptible()) return false;
+  }
+
+  return true;
+}
+
+void CommandGroup::CancelConflicts(Command* command) {
+  for (auto childIter = m_children.begin(); childIter != m_children.end();) {
+    Command* child = childIter->m_command;
+    bool erased = false;
+
+    Command::SubsystemSet requirements = command->GetRequirements();
+    for (auto requirementIter = requirements.begin();
+         requirementIter != requirements.end(); requirementIter++) {
+      if (child->DoesRequire(*requirementIter)) {
+        child->_Cancel();
+        child->Removed();
+        childIter = m_children.erase(childIter);
+        erased = true;
+        break;
+      }
+    }
+    if (!erased) childIter++;
+  }
+}
+
+int CommandGroup::GetSize() const { return m_children.size(); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/CommandGroupEntry.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/CommandGroupEntry.cpp
new file mode 100644
index 0000000..3cfc4ea
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/CommandGroupEntry.cpp
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/CommandGroupEntry.h"
+
+#include "Commands/Command.h"
+
+using namespace frc;
+
+CommandGroupEntry::CommandGroupEntry(Command* command, Sequence state,
+                                     double timeout)
+    : m_timeout(timeout), m_command(command), m_state(state) {}
+
+bool CommandGroupEntry::IsTimedOut() const {
+  if (m_timeout < 0.0) return false;
+  double time = m_command->TimeSinceInitialized();
+  if (time == 0.0) return false;
+  return time >= m_timeout;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/ConditionalCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/ConditionalCommand.cpp
new file mode 100644
index 0000000..ffcd696
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/ConditionalCommand.cpp
@@ -0,0 +1,95 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/ConditionalCommand.h"
+
+#include <iostream>
+
+#include "Commands/Scheduler.h"
+
+using namespace frc;
+
+static void RequireAll(Command& command, Command* onTrue, Command* onFalse) {
+  if (onTrue != nullptr) {
+    for (auto requirement : onTrue->GetRequirements())
+      command.Requires(requirement);
+  }
+  if (onFalse != nullptr) {
+    for (auto requirement : onFalse->GetRequirements())
+      command.Requires(requirement);
+  }
+}
+
+/**
+ * Creates a new ConditionalCommand with given onTrue and onFalse Commands.
+ *
+ * @param onTrue  The Command to execute if Condition() returns true
+ * @param onFalse The Command to execute if Condition() returns false
+ */
+ConditionalCommand::ConditionalCommand(Command* onTrue, Command* onFalse) {
+  m_onTrue = onTrue;
+  m_onFalse = onFalse;
+
+  RequireAll(*this, onTrue, onFalse);
+}
+
+/**
+ * Creates a new ConditionalCommand with given onTrue and onFalse Commands.
+ *
+ * @param name    The name for this command group
+ * @param onTrue  The Command to execute if Condition() returns true
+ * @param onFalse The Command to execute if Condition() returns false
+ */
+ConditionalCommand::ConditionalCommand(const llvm::Twine& name, Command* onTrue,
+                                       Command* onFalse)
+    : Command(name) {
+  m_onTrue = onTrue;
+  m_onFalse = onFalse;
+
+  RequireAll(*this, onTrue, onFalse);
+}
+
+void ConditionalCommand::_Initialize() {
+  if (Condition()) {
+    m_chosenCommand = m_onTrue;
+  } else {
+    m_chosenCommand = m_onFalse;
+  }
+
+  if (m_chosenCommand != nullptr) {
+    // This is a hack to make cancelling the chosen command inside a
+    // CommandGroup work properly
+    m_chosenCommand->ClearRequirements();
+
+    m_chosenCommand->Start();
+  }
+  Command::_Initialize();
+}
+
+void ConditionalCommand::_Cancel() {
+  if (m_chosenCommand != nullptr && m_chosenCommand->IsRunning()) {
+    m_chosenCommand->Cancel();
+  }
+
+  Command::_Cancel();
+}
+
+bool ConditionalCommand::IsFinished() {
+  if (m_chosenCommand != nullptr) {
+    return m_chosenCommand->IsCompleted();
+  } else {
+    return true;
+  }
+}
+
+void ConditionalCommand::_Interrupted() {
+  if (m_chosenCommand != nullptr && m_chosenCommand->IsRunning()) {
+    m_chosenCommand->Cancel();
+  }
+
+  Command::_Interrupted();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/InstantCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/InstantCommand.cpp
new file mode 100644
index 0000000..a8d2881
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/InstantCommand.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/InstantCommand.h"
+
+using namespace frc;
+
+/**
+ * Creates a new InstantCommand with the given name.
+ *
+ * @param name The name for this command
+ */
+InstantCommand::InstantCommand(const llvm::Twine& name) : Command(name) {}
+
+bool InstantCommand::IsFinished() { return true; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PIDCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PIDCommand.cpp
new file mode 100644
index 0000000..35d5ecc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PIDCommand.cpp
@@ -0,0 +1,74 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/PIDCommand.h"
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+PIDCommand::PIDCommand(const llvm::Twine& name, double p, double i, double d,
+                       double f, double period)
+    : Command(name) {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this, period);
+}
+
+PIDCommand::PIDCommand(double p, double i, double d, double f, double period) {
+  m_controller =
+      std::make_shared<PIDController>(p, i, d, f, this, this, period);
+}
+
+PIDCommand::PIDCommand(const llvm::Twine& name, double p, double i, double d)
+    : Command(name) {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this);
+}
+
+PIDCommand::PIDCommand(const llvm::Twine& name, double p, double i, double d,
+                       double period)
+    : Command(name) {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this, period);
+}
+
+PIDCommand::PIDCommand(double p, double i, double d) {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this);
+}
+
+PIDCommand::PIDCommand(double p, double i, double d, double period) {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this, period);
+}
+
+void PIDCommand::_Initialize() { m_controller->Enable(); }
+
+void PIDCommand::_End() { m_controller->Disable(); }
+
+void PIDCommand::_Interrupted() { _End(); }
+
+void PIDCommand::SetSetpointRelative(double deltaSetpoint) {
+  SetSetpoint(GetSetpoint() + deltaSetpoint);
+}
+
+void PIDCommand::PIDWrite(double output) { UsePIDOutput(output); }
+
+double PIDCommand::PIDGet() { return ReturnPIDInput(); }
+
+std::shared_ptr<PIDController> PIDCommand::GetPIDController() const {
+  return m_controller;
+}
+
+void PIDCommand::SetSetpoint(double setpoint) {
+  m_controller->SetSetpoint(setpoint);
+}
+
+double PIDCommand::GetSetpoint() const { return m_controller->GetSetpoint(); }
+
+double PIDCommand::GetPosition() { return ReturnPIDInput(); }
+
+void PIDCommand::InitSendable(SendableBuilder& builder) {
+  m_controller->InitSendable(builder);
+  Command::InitSendable(builder);
+  builder.SetSmartDashboardType("PIDCommand");
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PIDSubsystem.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PIDSubsystem.cpp
new file mode 100644
index 0000000..070f390
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PIDSubsystem.cpp
@@ -0,0 +1,241 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/PIDSubsystem.h"
+
+#include "PIDController.h"
+
+using namespace frc;
+
+/**
+ * Instantiates a PIDSubsystem that will use the given P, I, and D values.
+ *
+ * @param name the name
+ * @param p    the proportional value
+ * @param i    the integral value
+ * @param d    the derivative value
+ */
+PIDSubsystem::PIDSubsystem(const llvm::Twine& name, double p, double i,
+                           double d)
+    : Subsystem(name) {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this);
+  AddChild("PIDController", m_controller);
+}
+
+/**
+ * Instantiates a PIDSubsystem that will use the given P, I, and D values.
+ *
+ * @param name the name
+ * @param p    the proportional value
+ * @param i    the integral value
+ * @param d    the derivative value
+ * @param f    the feedforward value
+ */
+PIDSubsystem::PIDSubsystem(const llvm::Twine& name, double p, double i,
+                           double d, double f)
+    : Subsystem(name) {
+  m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
+  AddChild("PIDController", m_controller);
+}
+
+/**
+ * Instantiates a PIDSubsystem that will use the given P, I, and D values.
+ *
+ * It will also space the time between PID loop calculations to be equal to the
+ * given period.
+ *
+ * @param name   the name
+ * @param p      the proportional value
+ * @param i      the integral value
+ * @param d      the derivative value
+ * @param f      the feedfoward value
+ * @param period the time (in seconds) between calculations
+ */
+PIDSubsystem::PIDSubsystem(const llvm::Twine& name, double p, double i,
+                           double d, double f, double period)
+    : Subsystem(name) {
+  m_controller =
+      std::make_shared<PIDController>(p, i, d, f, this, this, period);
+  AddChild("PIDController", m_controller);
+}
+
+/**
+ * Instantiates a PIDSubsystem that will use the given P, I, and D values.
+ *
+ * It will use the class name as its name.
+ *
+ * @param p the proportional value
+ * @param i the integral value
+ * @param d the derivative value
+ */
+PIDSubsystem::PIDSubsystem(double p, double i, double d)
+    : Subsystem("PIDSubsystem") {
+  m_controller = std::make_shared<PIDController>(p, i, d, this, this);
+  AddChild("PIDController", m_controller);
+}
+
+/**
+ * Instantiates a PIDSubsystem that will use the given P, I, and D values.
+ *
+ * It will use the class name as its name.
+ *
+ * @param p the proportional value
+ * @param i the integral value
+ * @param d the derivative value
+ * @param f the feedforward value
+ */
+PIDSubsystem::PIDSubsystem(double p, double i, double d, double f)
+    : Subsystem("PIDSubsystem") {
+  m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
+  AddChild("PIDController", m_controller);
+}
+
+/**
+ * Instantiates a PIDSubsystem that will use the given P, I, and D values.
+ *
+ * It will use the class name as its name. It will also space the time
+ * between PID loop calculations to be equal to the given period.
+ *
+ * @param p      the proportional value
+ * @param i      the integral value
+ * @param d      the derivative value
+ * @param f      the feedforward value
+ * @param period the time (in seconds) between calculations
+ */
+PIDSubsystem::PIDSubsystem(double p, double i, double d, double f,
+                           double period)
+    : Subsystem("PIDSubsystem") {
+  m_controller =
+      std::make_shared<PIDController>(p, i, d, f, this, this, period);
+  AddChild("PIDController", m_controller);
+}
+
+/**
+ * Enables the internal PIDController.
+ */
+void PIDSubsystem::Enable() { m_controller->Enable(); }
+
+/**
+ * Disables the internal PIDController.
+ */
+void PIDSubsystem::Disable() { m_controller->Disable(); }
+
+/**
+ * Returns the PIDController used by this PIDSubsystem.
+ *
+ * Use this if you would like to fine tune the PID loop.
+ *
+ * @return The PIDController used by this PIDSubsystem
+ */
+std::shared_ptr<PIDController> PIDSubsystem::GetPIDController() {
+  return m_controller;
+}
+
+/**
+ * Sets the setpoint to the given value.
+ *
+ * If SetRange() was called, then the given setpoint will be trimmed to fit
+ * within the range.
+ *
+ * @param setpoint the new setpoint
+ */
+void PIDSubsystem::SetSetpoint(double setpoint) {
+  m_controller->SetSetpoint(setpoint);
+}
+
+/**
+ * Adds the given value to the setpoint.
+ *
+ * If SetRange() was used, then the bounds will still be honored by this method.
+ *
+ * @param deltaSetpoint the change in the setpoint
+ */
+void PIDSubsystem::SetSetpointRelative(double deltaSetpoint) {
+  SetSetpoint(GetSetpoint() + deltaSetpoint);
+}
+
+/**
+ * Return the current setpoint.
+ *
+ * @return The current setpoint
+ */
+double PIDSubsystem::GetSetpoint() { return m_controller->GetSetpoint(); }
+
+/**
+ * Sets the maximum and minimum values expected from the input.
+ *
+ * @param minimumInput the minimum value expected from the input
+ * @param maximumInput the maximum value expected from the output
+ */
+void PIDSubsystem::SetInputRange(double minimumInput, double maximumInput) {
+  m_controller->SetInputRange(minimumInput, maximumInput);
+}
+
+/**
+ * Sets the maximum and minimum values to write.
+ *
+ * @param minimumOutput the minimum value to write to the output
+ * @param maximumOutput the maximum value to write to the output
+ */
+void PIDSubsystem::SetOutputRange(double minimumOutput, double maximumOutput) {
+  m_controller->SetOutputRange(minimumOutput, maximumOutput);
+}
+
+/**
+ * Set the absolute error which is considered tolerable for use with
+ * OnTarget.
+ *
+ * @param absValue absolute error which is tolerable
+ */
+void PIDSubsystem::SetAbsoluteTolerance(double absValue) {
+  m_controller->SetAbsoluteTolerance(absValue);
+}
+
+/**
+ * Set the percentage error which is considered tolerable for use with
+ * OnTarget().
+ *
+ * @param percent percentage error which is tolerable
+ */
+void PIDSubsystem::SetPercentTolerance(double percent) {
+  m_controller->SetPercentTolerance(percent);
+}
+
+/**
+ * Return true if the error is within the percentage of the total input range,
+ * determined by SetTolerance().
+ *
+ * This asssumes that the maximum and minimum input were set using SetInput().
+ * Use OnTarget() in the IsFinished() method of commands that use this
+ * subsystem.
+ *
+ * Currently this just reports on target as the actual value passes through the
+ * setpoint. Ideally it should be based on being within the tolerance for some
+ * period of time.
+ *
+ * @return True if the error is within the percentage tolerance of the input
+ *         range
+ */
+bool PIDSubsystem::OnTarget() const { return m_controller->OnTarget(); }
+
+/**
+ * Returns the current position.
+ *
+ * @return the current position
+ */
+double PIDSubsystem::GetPosition() { return ReturnPIDInput(); }
+
+/**
+ * Returns the current rate.
+ *
+ * @return the current rate
+ */
+double PIDSubsystem::GetRate() { return ReturnPIDInput(); }
+
+void PIDSubsystem::PIDWrite(double output) { UsePIDOutput(output); }
+
+double PIDSubsystem::PIDGet() { return ReturnPIDInput(); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PrintCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PrintCommand.cpp
new file mode 100644
index 0000000..e53ea4a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/PrintCommand.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/PrintCommand.h"
+
+#include <llvm/raw_ostream.h>
+
+using namespace frc;
+
+PrintCommand::PrintCommand(const llvm::Twine& message)
+    : InstantCommand("Print \"" + message + llvm::Twine('"')) {
+  m_message = message.str();
+}
+
+void PrintCommand::Initialize() { llvm::outs() << m_message << '\n'; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Scheduler.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Scheduler.cpp
new file mode 100644
index 0000000..bebab30
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Scheduler.cpp
@@ -0,0 +1,270 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/Scheduler.h"
+
+#include <algorithm>
+#include <set>
+
+#include "Buttons/ButtonScheduler.h"
+#include "Commands/Subsystem.h"
+#include "HLUsageReporting.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+Scheduler::Scheduler() {
+  HLUsageReporting::ReportScheduler();
+  SetName("Scheduler");
+}
+
+/**
+ * Returns the Scheduler, creating it if one does not exist.
+ *
+ * @return the Scheduler
+ */
+Scheduler* Scheduler::GetInstance() {
+  static Scheduler instance;
+  return &instance;
+}
+
+void Scheduler::SetEnabled(bool enabled) { m_enabled = enabled; }
+
+/**
+ * Add a command to be scheduled later.
+ *
+ * In any pass through the scheduler, all commands are added to the additions
+ * list, then at the end of the pass, they are all scheduled.
+ *
+ * @param command The command to be scheduled
+ */
+void Scheduler::AddCommand(Command* command) {
+  std::lock_guard<wpi::mutex> lock(m_additionsMutex);
+  if (std::find(m_additions.begin(), m_additions.end(), command) !=
+      m_additions.end())
+    return;
+  m_additions.push_back(command);
+}
+
+void Scheduler::AddButton(ButtonScheduler* button) {
+  std::lock_guard<wpi::mutex> lock(m_buttonsMutex);
+  m_buttons.push_back(button);
+}
+
+void Scheduler::ProcessCommandAddition(Command* command) {
+  if (command == nullptr) return;
+
+  // Check to make sure no adding during adding
+  if (m_adding) {
+    wpi_setWPIErrorWithContext(IncompatibleState,
+                               "Can not start command from cancel method");
+    return;
+  }
+
+  // Only add if not already in
+  auto found = m_commands.find(command);
+  if (found == m_commands.end()) {
+    // Check that the requirements can be had
+    Command::SubsystemSet requirements = command->GetRequirements();
+    for (Command::SubsystemSet::iterator iter = requirements.begin();
+         iter != requirements.end(); iter++) {
+      Subsystem* lock = *iter;
+      if (lock->GetCurrentCommand() != nullptr &&
+          !lock->GetCurrentCommand()->IsInterruptible())
+        return;
+    }
+
+    // Give it the requirements
+    m_adding = true;
+    for (Command::SubsystemSet::iterator iter = requirements.begin();
+         iter != requirements.end(); iter++) {
+      Subsystem* lock = *iter;
+      if (lock->GetCurrentCommand() != nullptr) {
+        lock->GetCurrentCommand()->Cancel();
+        Remove(lock->GetCurrentCommand());
+      }
+      lock->SetCurrentCommand(command);
+    }
+    m_adding = false;
+
+    m_commands.insert(command);
+
+    command->StartRunning();
+    m_runningCommandsChanged = true;
+  }
+}
+
+/**
+ * Runs a single iteration of the loop.
+ *
+ * This method should be called often in order to have a functioning
+ * Command system. The loop has five stages:
+ *
+ * <ol>
+ *   <li>Poll the Buttons</li>
+ *   <li>Execute/Remove the Commands</li>
+ *   <li>Send values to SmartDashboard</li>
+ *   <li>Add Commands</li>
+ *   <li>Add Defaults</li>
+ * </ol>
+ */
+void Scheduler::Run() {
+  // Get button input (going backwards preserves button priority)
+  {
+    if (!m_enabled) return;
+
+    std::lock_guard<wpi::mutex> lock(m_buttonsMutex);
+    for (auto rButtonIter = m_buttons.rbegin(); rButtonIter != m_buttons.rend();
+         rButtonIter++) {
+      (*rButtonIter)->Execute();
+    }
+  }
+
+  // Call every subsystem's periodic method
+  for (auto subsystemIter = m_subsystems.begin();
+       subsystemIter != m_subsystems.end(); subsystemIter++) {
+    Subsystem* subsystem = *subsystemIter;
+    subsystem->Periodic();
+  }
+
+  m_runningCommandsChanged = false;
+
+  // Loop through the commands
+  for (auto commandIter = m_commands.begin();
+       commandIter != m_commands.end();) {
+    Command* command = *commandIter;
+    // Increment before potentially removing to keep the iterator valid
+    ++commandIter;
+    if (!command->Run()) {
+      Remove(command);
+      m_runningCommandsChanged = true;
+    }
+  }
+
+  // Add the new things
+  {
+    std::lock_guard<wpi::mutex> lock(m_additionsMutex);
+    for (auto additionsIter = m_additions.begin();
+         additionsIter != m_additions.end(); additionsIter++) {
+      ProcessCommandAddition(*additionsIter);
+    }
+    m_additions.clear();
+  }
+
+  // Add in the defaults
+  for (auto subsystemIter = m_subsystems.begin();
+       subsystemIter != m_subsystems.end(); subsystemIter++) {
+    Subsystem* lock = *subsystemIter;
+    if (lock->GetCurrentCommand() == nullptr) {
+      ProcessCommandAddition(lock->GetDefaultCommand());
+    }
+    lock->ConfirmCommand();
+  }
+}
+
+/**
+ * Registers a Subsystem to this Scheduler, so that the Scheduler might know if
+ * a default Command needs to be run.
+ *
+ * All Subsystems should call this.
+ *
+ * @param system the system
+ */
+void Scheduler::RegisterSubsystem(Subsystem* subsystem) {
+  if (subsystem == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "subsystem");
+    return;
+  }
+  m_subsystems.insert(subsystem);
+}
+
+/**
+ * Removes the Command from the Scheduler.
+ *
+ * @param command the command to remove
+ */
+void Scheduler::Remove(Command* command) {
+  if (command == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "command");
+    return;
+  }
+
+  if (!m_commands.erase(command)) return;
+
+  Command::SubsystemSet requirements = command->GetRequirements();
+  for (auto iter = requirements.begin(); iter != requirements.end(); iter++) {
+    Subsystem* lock = *iter;
+    lock->SetCurrentCommand(nullptr);
+  }
+
+  command->Removed();
+}
+
+void Scheduler::RemoveAll() {
+  while (m_commands.size() > 0) {
+    Remove(*m_commands.begin());
+  }
+}
+
+/**
+ * Completely resets the scheduler. Undefined behavior if running.
+ */
+void Scheduler::ResetAll() {
+  RemoveAll();
+  m_subsystems.clear();
+  m_buttons.clear();
+  m_additions.clear();
+  m_commands.clear();
+  m_namesEntry = nt::NetworkTableEntry();
+  m_idsEntry = nt::NetworkTableEntry();
+  m_cancelEntry = nt::NetworkTableEntry();
+}
+
+void Scheduler::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Scheduler");
+  m_namesEntry = builder.GetEntry("Names");
+  m_idsEntry = builder.GetEntry("Ids");
+  m_cancelEntry = builder.GetEntry("Cancel");
+  builder.SetUpdateTable([=]() {
+    // Get the list of possible commands to cancel
+    auto new_toCancel = m_cancelEntry.GetValue();
+    if (new_toCancel)
+      toCancel = new_toCancel->GetDoubleArray();
+    else
+      toCancel.resize(0);
+
+    // Cancel commands whose cancel buttons were pressed on the SmartDashboard
+    if (!toCancel.empty()) {
+      for (auto commandIter = m_commands.begin();
+           commandIter != m_commands.end(); ++commandIter) {
+        for (size_t i = 0; i < toCancel.size(); i++) {
+          Command* c = *commandIter;
+          if (c->GetID() == toCancel[i]) {
+            c->Cancel();
+          }
+        }
+      }
+      toCancel.resize(0);
+      m_cancelEntry.SetDoubleArray(toCancel);
+    }
+
+    // Set the running commands
+    if (m_runningCommandsChanged) {
+      commands.resize(0);
+      ids.resize(0);
+      for (auto commandIter = m_commands.begin();
+           commandIter != m_commands.end(); ++commandIter) {
+        Command* c = *commandIter;
+        commands.push_back(c->GetName());
+        ids.push_back(c->GetID());
+      }
+      m_namesEntry.SetStringArray(commands);
+      m_idsEntry.SetDoubleArray(ids);
+    }
+  });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/StartCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/StartCommand.cpp
new file mode 100644
index 0000000..df8a141
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/StartCommand.cpp
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/StartCommand.h"
+
+using namespace frc;
+
+StartCommand::StartCommand(Command* commandToStart)
+    : InstantCommand("StartCommand") {
+  m_commandToFork = commandToStart;
+}
+
+void StartCommand::Initialize() { m_commandToFork->Start(); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Subsystem.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Subsystem.cpp
new file mode 100644
index 0000000..ea51b68
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/Subsystem.cpp
@@ -0,0 +1,218 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/Subsystem.h"
+
+#include "Commands/Command.h"
+#include "Commands/Scheduler.h"
+#include "LiveWindow/LiveWindow.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Creates a subsystem with the given name.
+ *
+ * @param name the name of the subsystem
+ */
+Subsystem::Subsystem(const llvm::Twine& name) {
+  SetName(name, name);
+  Scheduler::GetInstance()->RegisterSubsystem(this);
+}
+
+/**
+ * Initialize the default command for this subsystem.
+ *
+ * This is meant to be the place to call SetDefaultCommand in a subsystem and
+ * will be called on all the subsystems by the CommandBase method before the
+ * program starts running by using the list of all registered Subsystems inside
+ * the Scheduler.
+ *
+ * This should be overridden by a Subsystem that has a default Command
+ */
+void Subsystem::InitDefaultCommand() {}
+
+/**
+ * Sets the default command.  If this is not called or is called with null,
+ * then there will be no default command for the subsystem.
+ *
+ * <b>WARNING:</b> This should <b>NOT</b> be called in a constructor if the
+ * subsystem is a singleton.
+ *
+ * @param command the default command (or null if there should be none)
+ */
+void Subsystem::SetDefaultCommand(Command* command) {
+  if (command == nullptr) {
+    m_defaultCommand = nullptr;
+  } else {
+    bool found = false;
+    Command::SubsystemSet requirements = command->GetRequirements();
+    for (auto iter = requirements.begin(); iter != requirements.end(); iter++) {
+      if (*iter == this) {
+        found = true;
+        break;
+      }
+    }
+
+    if (!found) {
+      wpi_setWPIErrorWithContext(
+          CommandIllegalUse, "A default command must require the subsystem");
+      return;
+    }
+
+    m_defaultCommand = command;
+  }
+}
+
+/**
+ * Returns the default command (or null if there is none).
+ *
+ * @return the default command
+ */
+Command* Subsystem::GetDefaultCommand() {
+  if (!m_initializedDefaultCommand) {
+    m_initializedDefaultCommand = true;
+    InitDefaultCommand();
+  }
+  return m_defaultCommand;
+}
+
+/**
+ * Returns the default command name, or empty string is there is none.
+ *
+ * @return the default command name
+ */
+llvm::StringRef Subsystem::GetDefaultCommandName() {
+  Command* defaultCommand = GetDefaultCommand();
+  if (defaultCommand) {
+    return defaultCommand->GetName();
+  } else {
+    return llvm::StringRef();
+  }
+}
+
+/**
+ * Sets the current command.
+ *
+ * @param command the new current command
+ */
+void Subsystem::SetCurrentCommand(Command* command) {
+  m_currentCommand = command;
+  m_currentCommandChanged = true;
+}
+
+/**
+ * Returns the command which currently claims this subsystem.
+ *
+ * @return the command which currently claims this subsystem
+ */
+Command* Subsystem::GetCurrentCommand() const { return m_currentCommand; }
+
+/**
+ * Returns the current command name, or empty string if no current command.
+ *
+ * @return the current command name
+ */
+llvm::StringRef Subsystem::GetCurrentCommandName() const {
+  Command* currentCommand = GetCurrentCommand();
+  if (currentCommand) {
+    return currentCommand->GetName();
+  } else {
+    return llvm::StringRef();
+  }
+}
+
+/**
+ * When the run method of the scheduler is called this method will be called.
+ */
+void Subsystem::Periodic() {}
+
+/**
+ * Call this to alert Subsystem that the current command is actually the
+ * command.
+ *
+ * Sometimes, the Subsystem is told that it has no command while the Scheduler
+ * is going through the loop, only to be soon after given a new one. This will
+ * avoid that situation.
+ */
+void Subsystem::ConfirmCommand() {
+  if (m_currentCommandChanged) m_currentCommandChanged = false;
+}
+
+/**
+ * Associate a Sendable with this Subsystem.
+ * Also update the child's name.
+ *
+ * @param name name to give child
+ * @param child sendable
+ */
+void Subsystem::AddChild(const llvm::Twine& name,
+                         std::shared_ptr<Sendable> child) {
+  AddChild(name, *child);
+}
+
+/**
+ * Associate a Sendable with this Subsystem.
+ * Also update the child's name.
+ *
+ * @param name name to give child
+ * @param child sendable
+ */
+void Subsystem::AddChild(const llvm::Twine& name, Sendable* child) {
+  AddChild(name, *child);
+}
+
+/**
+ * Associate a Sendable with this Subsystem.
+ * Also update the child's name.
+ *
+ * @param name name to give child
+ * @param child sendable
+ */
+void Subsystem::AddChild(const llvm::Twine& name, Sendable& child) {
+  child.SetName(GetSubsystem(), name);
+  LiveWindow::GetInstance()->Add(&child);
+}
+
+/**
+ * Associate a {@link Sendable} with this Subsystem.
+ *
+ * @param child sendable
+ */
+void Subsystem::AddChild(std::shared_ptr<Sendable> child) { AddChild(*child); }
+
+/**
+ * Associate a {@link Sendable} with this Subsystem.
+ *
+ * @param child sendable
+ */
+void Subsystem::AddChild(Sendable* child) { AddChild(*child); }
+
+/**
+ * Associate a {@link Sendable} with this Subsystem.
+ *
+ * @param child sendable
+ */
+void Subsystem::AddChild(Sendable& child) {
+  child.SetSubsystem(GetSubsystem());
+  LiveWindow::GetInstance()->Add(&child);
+}
+
+void Subsystem::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Subsystem");
+
+  builder.AddBooleanProperty(
+      ".hasDefault", [=]() { return m_defaultCommand != nullptr; }, nullptr);
+  builder.AddStringProperty(".default",
+                            [=]() { return GetDefaultCommandName(); }, nullptr);
+
+  builder.AddBooleanProperty(
+      ".hasCommand", [=]() { return m_currentCommand != nullptr; }, nullptr);
+  builder.AddStringProperty(".command",
+                            [=]() { return GetCurrentCommandName(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/TimedCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/TimedCommand.cpp
new file mode 100644
index 0000000..6ee9927
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/TimedCommand.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/TimedCommand.h"
+
+using namespace frc;
+
+/**
+ * Creates a new TimedCommand with the given name and timeout.
+ *
+ * @param name    the name of the command
+ * @param timeout the time (in seconds) before this command "times out"
+ */
+TimedCommand::TimedCommand(const llvm::Twine& name, double timeout)
+    : Command(name, timeout) {}
+
+/**
+ * Creates a new WaitCommand with the given timeout.
+ *
+ * @param timeout the time (in seconds) before this command "times out"
+ */
+TimedCommand::TimedCommand(double timeout) : Command(timeout) {}
+
+/**
+ * Ends command when timed out.
+ */
+bool TimedCommand::IsFinished() { return IsTimedOut(); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitCommand.cpp
new file mode 100644
index 0000000..d61b179
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitCommand.cpp
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/WaitCommand.h"
+
+using namespace frc;
+
+/**
+ * Creates a new WaitCommand with the given name and timeout.
+ *
+ * @param name    the name of the command
+ * @param timeout the time (in seconds) before this command "times out"
+ */
+WaitCommand::WaitCommand(double timeout)
+    : TimedCommand("Wait(" + std::to_string(timeout) + ")", timeout) {}
+
+/**
+ * Creates a new WaitCommand with the given timeout.
+ *
+ * @param timeout the time (in seconds) before this command "times out"
+ */
+WaitCommand::WaitCommand(const llvm::Twine& name, double timeout)
+    : TimedCommand(name, timeout) {}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitForChildren.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitForChildren.cpp
new file mode 100644
index 0000000..72a4f38
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitForChildren.cpp
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/WaitForChildren.h"
+
+#include "Commands/CommandGroup.h"
+
+using namespace frc;
+
+WaitForChildren::WaitForChildren(double timeout)
+    : Command("WaitForChildren", timeout) {}
+
+WaitForChildren::WaitForChildren(const llvm::Twine& name, double timeout)
+    : Command(name, timeout) {}
+
+bool WaitForChildren::IsFinished() {
+  return GetGroup() == nullptr || GetGroup()->GetSize() == 0;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitUntilCommand.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitUntilCommand.cpp
new file mode 100644
index 0000000..442ea87
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Commands/WaitUntilCommand.cpp
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/WaitUntilCommand.h"
+
+#include "Timer.h"
+
+using namespace frc;
+
+/**
+ * A WaitCommand will wait until a certain match time before finishing.
+ *
+ * This will wait until the game clock reaches some value, then continue to the
+ * next command.
+ * @see CommandGroup
+ */
+WaitUntilCommand::WaitUntilCommand(double time)
+    : Command("WaitUntilCommand", time) {
+  m_time = time;
+}
+
+WaitUntilCommand::WaitUntilCommand(const llvm::Twine& name, double time)
+    : Command(name, time) {
+  m_time = time;
+}
+
+/**
+ * Check if we've reached the actual finish time.
+ */
+bool WaitUntilCommand::IsFinished() { return Timer::GetMatchTime() >= m_time; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Compressor.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Compressor.cpp
new file mode 100644
index 0000000..33e184f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Compressor.cpp
@@ -0,0 +1,317 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Compressor.h"
+
+#include <HAL/Compressor.h>
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+#include <HAL/Solenoid.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Constructor.
+ *
+ * @param module The PCM ID to use (0-62)
+ */
+Compressor::Compressor(int pcmID) : m_module(pcmID) {
+  int32_t status = 0;
+  m_compressorHandle = HAL_InitializeCompressor(m_module, &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumPCMModules(), pcmID,
+                                 HAL_GetErrorMessage(status));
+    return;
+  }
+  SetClosedLoopControl(true);
+
+  HAL_Report(HALUsageReporting::kResourceType_Compressor, pcmID);
+  SetName("Compressor", pcmID);
+}
+
+/**
+ * Starts closed-loop control. Note that closed loop control is enabled by
+ * default.
+ */
+void Compressor::Start() {
+  if (StatusIsFatal()) return;
+  SetClosedLoopControl(true);
+}
+
+/**
+ * Stops closed-loop control. Note that closed loop control is enabled by
+ * default.
+ */
+void Compressor::Stop() {
+  if (StatusIsFatal()) return;
+  SetClosedLoopControl(false);
+}
+
+/**
+ * Check if compressor output is active.
+ *
+ * @return true if the compressor is on
+ */
+bool Compressor::Enabled() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressor(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Check if the pressure switch is triggered.
+ *
+ * @return true if pressure is low
+ */
+bool Compressor::GetPressureSwitchValue() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorPressureSwitch(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query how much current the compressor is drawing.
+ *
+ * @return The current through the compressor, in amps
+ */
+double Compressor::GetCompressorCurrent() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  double value;
+
+  value = HAL_GetCompressorCurrent(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Enables or disables automatically turning the compressor on when the
+ * pressure is low.
+ *
+ * @param on Set to true to enable closed loop control of the compressor. False
+ *           to disable.
+ */
+void Compressor::SetClosedLoopControl(bool on) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+
+  HAL_SetCompressorClosedLoopControl(m_compressorHandle, on, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+}
+
+/**
+ * Returns true if the compressor will automatically turn on when the
+ * pressure is low.
+ *
+ * @return True if closed loop control of the compressor is enabled. False if
+ *         disabled.
+ */
+bool Compressor::GetClosedLoopControl() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorClosedLoopControl(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query if the compressor output has been disabled due to high current draw.
+ *
+ * @return true if PCM is in fault state : Compressor Drive is
+ *         disabled due to compressor current being too high.
+ */
+bool Compressor::GetCompressorCurrentTooHighFault() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorCurrentTooHighFault(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query if the compressor output has been disabled due to high current draw
+ * (sticky).
+ *
+ * A sticky fault will not clear on device reboot, it must be cleared through
+ * code or the webdash.
+ *
+ * @return true if PCM sticky fault is set : Compressor Drive is
+ *         disabled due to compressor current being too high.
+ */
+bool Compressor::GetCompressorCurrentTooHighStickyFault() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value =
+      HAL_GetCompressorCurrentTooHighStickyFault(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query if the compressor output has been disabled due to a short circuit
+ * (sticky).
+ *
+ * A sticky fault will not clear on device reboot, it must be cleared through
+ * code or the webdash.
+ *
+ * @return true if PCM sticky fault is set : Compressor output
+ *         appears to be shorted.
+ */
+bool Compressor::GetCompressorShortedStickyFault() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorShortedStickyFault(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query if the compressor output has been disabled due to a short circuit.
+ *
+ * @return true if PCM is in fault state : Compressor output
+ *         appears to be shorted.
+ */
+bool Compressor::GetCompressorShortedFault() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorShortedFault(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query if the compressor output does not appear to be wired (sticky).
+ *
+ * A sticky fault will not clear on device reboot, it must be cleared through
+ * code or the webdash.
+ *
+ * @return true if PCM sticky fault is set : Compressor does not
+ *         appear to be wired, i.e. compressor is not drawing enough current.
+ */
+bool Compressor::GetCompressorNotConnectedStickyFault() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorNotConnectedStickyFault(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Query if the compressor output does not appear to be wired.
+ *
+ * @return true if PCM is in fault state : Compressor does not
+ *         appear to be wired, i.e. compressor is not drawing enough current.
+ */
+bool Compressor::GetCompressorNotConnectedFault() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value;
+
+  value = HAL_GetCompressorNotConnectedFault(m_compressorHandle, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+
+  return value;
+}
+
+/**
+ * Clear ALL sticky faults inside PCM that Compressor is wired to.
+ *
+ * If a sticky fault is set, then it will be persistently cleared.  Compressor
+ * drive maybe momentarily disable while flags are being cleared. Care should
+ * be taken to not call this too frequently, otherwise normal compressor
+ * functionality may be prevented.
+ *
+ * If no sticky faults are set then this call will have no effect.
+ */
+void Compressor::ClearAllPCMStickyFaults() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+
+  HAL_ClearAllPCMStickyFaults(m_module, &status);
+
+  if (status) {
+    wpi_setWPIError(Timeout);
+  }
+}
+
+void Compressor::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Compressor");
+  builder.AddBooleanProperty("Enabled", [=]() { return Enabled(); },
+                             [=](bool value) {
+                               if (value)
+                                 Start();
+                               else
+                                 Stop();
+                             });
+  builder.AddBooleanProperty(
+      "Pressure switch", [=]() { return GetPressureSwitchValue(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ControllerPower.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ControllerPower.cpp
new file mode 100644
index 0000000..6427a1b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ControllerPower.cpp
@@ -0,0 +1,205 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ControllerPower.h"
+
+#include <stdint.h>
+
+#include <HAL/HAL.h>
+#include <HAL/Power.h>
+
+#include "ErrorBase.h"
+
+using namespace frc;
+
+/**
+ * Get the input voltage to the robot controller.
+ *
+ * @return The controller input voltage value in Volts
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetInputVoltage() {
+  int32_t status = 0;
+  double retVal = HAL_GetVinVoltage(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the input current to the robot controller.
+ *
+ * @return The controller input current value in Amps
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetInputCurrent() {
+  int32_t status = 0;
+  double retVal = HAL_GetVinCurrent(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the voltage of the 6V rail.
+ *
+ * @return The controller 6V rail voltage value in Volts
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetVoltage6V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserVoltage6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the current output of the 6V rail.
+ *
+ * @return The controller 6V rail output current value in Amps
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetCurrent6V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserCurrent6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the enabled state of the 6V rail. The rail may be disabled due to a
+ * controller brownout, a short circuit on the rail, or controller over-voltage.
+ *
+ * @return The controller 6V rail enabled value. True for enabled.
+ * @deprecated Use RobotController static class method
+ */
+bool ControllerPower::GetEnabled6V() {
+  int32_t status = 0;
+  bool retVal = HAL_GetUserActive6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the count of the total current faults on the 6V rail since the controller
+ * has booted.
+ *
+ * @return The number of faults.
+ * @deprecated Use RobotController static class method
+ */
+int ControllerPower::GetFaultCount6V() {
+  int32_t status = 0;
+  int retVal = HAL_GetUserCurrentFaults6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the voltage of the 5V rail.
+ *
+ * @return The controller 5V rail voltage value in Volts
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetVoltage5V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserVoltage5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the current output of the 5V rail.
+ *
+ * @return The controller 5V rail output current value in Amps
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetCurrent5V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserCurrent5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the enabled state of the 5V rail. The rail may be disabled due to a
+ * controller brownout, a short circuit on the rail, or controller over-voltage.
+ *
+ * @return The controller 5V rail enabled value. True for enabled.
+ * @deprecated Use RobotController static class method
+ */
+bool ControllerPower::GetEnabled5V() {
+  int32_t status = 0;
+  bool retVal = HAL_GetUserActive5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the count of the total current faults on the 5V rail since the controller
+ * has booted.
+ *
+ * @return The number of faults
+ * @deprecated Use RobotController static class method
+ */
+int ControllerPower::GetFaultCount5V() {
+  int32_t status = 0;
+  int retVal = HAL_GetUserCurrentFaults5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the voltage of the 3.3V rail.
+ *
+ * @return The controller 3.3V rail voltage value in Volts
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetVoltage3V3() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserVoltage3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the current output of the 3.3V rail.
+ *
+ * @return The controller 3.3V rail output current value in Amps
+ * @deprecated Use RobotController static class method
+ */
+double ControllerPower::GetCurrent3V3() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserCurrent3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the enabled state of the 3.3V rail. The rail may be disabled due to a
+ * controller brownout, a short circuit on the rail, or controller over-voltage.
+ *
+ * @return The controller 3.3V rail enabled value. True for enabled.
+ * @deprecated Use RobotController static class method
+ */
+bool ControllerPower::GetEnabled3V3() {
+  int32_t status = 0;
+  bool retVal = HAL_GetUserActive3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the count of the total current faults on the 3.3V rail since the
+ * controller has booted.
+ *
+ * @return The number of faults
+ * @deprecated Use RobotController static class method
+ */
+int ControllerPower::GetFaultCount3V3() {
+  int32_t status = 0;
+  int retVal = HAL_GetUserCurrentFaults3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Counter.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Counter.cpp
new file mode 100644
index 0000000..963f59b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Counter.cpp
@@ -0,0 +1,613 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Counter.h"
+
+#include <HAL/HAL.h>
+
+#include "AnalogTrigger.h"
+#include "DigitalInput.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Create an instance of a counter where no sources are selected.
+ *
+ * They all must be selected by calling functions to specify the upsource and
+ * the downsource independently.
+ *
+ * This creates a ChipObject counter and initializes status variables
+ * appropriately.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param mode The counter mode
+ */
+Counter::Counter(Mode mode) {
+  int32_t status = 0;
+  m_counter = HAL_InitializeCounter((HAL_Counter_Mode)mode, &m_index, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  SetMaxPeriod(.5);
+
+  HAL_Report(HALUsageReporting::kResourceType_Counter, m_index, mode);
+  SetName("Counter", m_index);
+}
+
+/**
+ * Create an instance of a counter from a Digital Source (such as a Digital
+ * Input).
+ *
+ * This is used if an existing digital input is to be shared by multiple other
+ * objects such as encoders or if the Digital Source is not a Digital Input
+ * channel (such as an Analog Trigger).
+ *
+ * The counter will start counting immediately.
+ * @param source A pointer to the existing DigitalSource object. It will be set
+ *               as the Up Source.
+ */
+Counter::Counter(DigitalSource* source) : Counter(kTwoPulse) {
+  SetUpSource(source);
+  ClearDownSource();
+}
+
+/**
+ * Create an instance of a counter from a Digital Source (such as a Digital
+ * Input).
+ *
+ * This is used if an existing digital input is to be shared by multiple other
+ * objects such as encoders or if the Digital Source is not a Digital Input
+ * channel (such as an Analog Trigger).
+ *
+ * The counter will start counting immediately.
+ *
+ * @param source A pointer to the existing DigitalSource object. It will be
+ *               set as the Up Source.
+ */
+Counter::Counter(std::shared_ptr<DigitalSource> source) : Counter(kTwoPulse) {
+  SetUpSource(source);
+  ClearDownSource();
+}
+
+/**
+ * Create an instance of a Counter object.
+ *
+ * Create an up-Counter instance given a channel.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param channel The DIO channel to use as the up source. 0-9 are on-board,
+ *                10-25 are on the MXP
+ */
+Counter::Counter(int channel) : Counter(kTwoPulse) {
+  SetUpSource(channel);
+  ClearDownSource();
+}
+
+/**
+ * Create an instance of a Counter object.
+ *
+ * Create an instance of a simple up-Counter given an analog trigger.
+ * Use the trigger state output from the analog trigger.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param trigger The reference to the existing AnalogTrigger object.
+ */
+Counter::Counter(const AnalogTrigger& trigger) : Counter(kTwoPulse) {
+  SetUpSource(trigger.CreateOutput(AnalogTriggerType::kState));
+  ClearDownSource();
+}
+
+/**
+ * Create an instance of a Counter object.
+ *
+ * Creates a full up-down counter given two Digital Sources.
+ *
+ * @param encodingType The quadrature decoding mode (1x or 2x)
+ * @param upSource     The pointer to the DigitalSource to set as the up source
+ * @param downSource   The pointer to the DigitalSource to set as the down
+ *                     source
+ * @param inverted     True to invert the output (reverse the direction)
+ */
+Counter::Counter(EncodingType encodingType, DigitalSource* upSource,
+                 DigitalSource* downSource, bool inverted)
+    : Counter(encodingType,
+              std::shared_ptr<DigitalSource>(upSource,
+                                             NullDeleter<DigitalSource>()),
+              std::shared_ptr<DigitalSource>(downSource,
+                                             NullDeleter<DigitalSource>()),
+              inverted) {}
+
+/**
+ * Create an instance of a Counter object.
+ *
+ * Creates a full up-down counter given two Digital Sources.
+ *
+ * @param encodingType The quadrature decoding mode (1x or 2x)
+ * @param upSource     The pointer to the DigitalSource to set as the up source
+ * @param downSource   The pointer to the DigitalSource to set as the down
+ *                     source
+ * @param inverted     True to invert the output (reverse the direction)
+ */
+Counter::Counter(EncodingType encodingType,
+                 std::shared_ptr<DigitalSource> upSource,
+                 std::shared_ptr<DigitalSource> downSource, bool inverted)
+    : Counter(kExternalDirection) {
+  if (encodingType != k1X && encodingType != k2X) {
+    wpi_setWPIErrorWithContext(
+        ParameterOutOfRange,
+        "Counter only supports 1X and 2X quadrature decoding.");
+    return;
+  }
+  SetUpSource(upSource);
+  SetDownSource(downSource);
+  int32_t status = 0;
+
+  if (encodingType == k1X) {
+    SetUpSourceEdge(true, false);
+    HAL_SetCounterAverageSize(m_counter, 1, &status);
+  } else {
+    SetUpSourceEdge(true, true);
+    HAL_SetCounterAverageSize(m_counter, 2, &status);
+  }
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  SetDownSourceEdge(inverted, true);
+}
+
+/**
+ * Delete the Counter object.
+ */
+Counter::~Counter() {
+  SetUpdateWhenEmpty(true);
+
+  int32_t status = 0;
+  HAL_FreeCounter(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  m_counter = HAL_kInvalidHandle;
+}
+
+/**
+ * Set the upsource for the counter as a digital input channel.
+ *
+ * @param channel The DIO channel to use as the up source. 0-9 are on-board,
+ *                10-25 are on the MXP
+ */
+void Counter::SetUpSource(int channel) {
+  if (StatusIsFatal()) return;
+  SetUpSource(std::make_shared<DigitalInput>(channel));
+  AddChild(m_upSource);
+}
+
+/**
+ * Set the up counting source to be an analog trigger.
+ *
+ * @param analogTrigger The analog trigger object that is used for the Up Source
+ * @param triggerType   The analog trigger output that will trigger the counter.
+ */
+void Counter::SetUpSource(AnalogTrigger* analogTrigger,
+                          AnalogTriggerType triggerType) {
+  SetUpSource(std::shared_ptr<AnalogTrigger>(analogTrigger,
+                                             NullDeleter<AnalogTrigger>()),
+              triggerType);
+}
+
+/**
+ * Set the up counting source to be an analog trigger.
+ *
+ * @param analogTrigger The analog trigger object that is used for the Up Source
+ * @param triggerType   The analog trigger output that will trigger the counter.
+ */
+void Counter::SetUpSource(std::shared_ptr<AnalogTrigger> analogTrigger,
+                          AnalogTriggerType triggerType) {
+  if (StatusIsFatal()) return;
+  SetUpSource(analogTrigger->CreateOutput(triggerType));
+}
+
+/**
+ * Set the source object that causes the counter to count up.
+ *
+ * Set the up counting DigitalSource.
+ *
+ * @param source Pointer to the DigitalSource object to set as the up source
+ */
+void Counter::SetUpSource(std::shared_ptr<DigitalSource> source) {
+  if (StatusIsFatal()) return;
+  m_upSource = source;
+  if (m_upSource->StatusIsFatal()) {
+    CloneError(*m_upSource);
+  } else {
+    int32_t status = 0;
+    HAL_SetCounterUpSource(
+        m_counter, source->GetPortHandleForRouting(),
+        (HAL_AnalogTriggerType)source->GetAnalogTriggerTypeForRouting(),
+        &status);
+    wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  }
+}
+
+void Counter::SetUpSource(DigitalSource* source) {
+  SetUpSource(
+      std::shared_ptr<DigitalSource>(source, NullDeleter<DigitalSource>()));
+}
+
+/**
+ * Set the source object that causes the counter to count up.
+ *
+ * Set the up counting DigitalSource.
+ *
+ * @param source Reference to the DigitalSource object to set as the up source
+ */
+void Counter::SetUpSource(DigitalSource& source) {
+  SetUpSource(
+      std::shared_ptr<DigitalSource>(&source, NullDeleter<DigitalSource>()));
+}
+
+/**
+ * Set the edge sensitivity on an up counting source.
+ *
+ * Set the up source to either detect rising edges or falling edges or both.
+ *
+ * @param risingEdge  True to trigger on rising edges
+ * @param fallingEdge True to trigger on falling edges
+ */
+void Counter::SetUpSourceEdge(bool risingEdge, bool fallingEdge) {
+  if (StatusIsFatal()) return;
+  if (m_upSource == nullptr) {
+    wpi_setWPIErrorWithContext(
+        NullParameter,
+        "Must set non-nullptr UpSource before setting UpSourceEdge");
+  }
+  int32_t status = 0;
+  HAL_SetCounterUpSourceEdge(m_counter, risingEdge, fallingEdge, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Disable the up counting source to the counter.
+ */
+void Counter::ClearUpSource() {
+  if (StatusIsFatal()) return;
+  m_upSource.reset();
+  int32_t status = 0;
+  HAL_ClearCounterUpSource(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the down counting source to be a digital input channel.
+ *
+ * @param channel The DIO channel to use as the up source. 0-9 are on-board,
+ *                10-25 are on the MXP
+ */
+void Counter::SetDownSource(int channel) {
+  if (StatusIsFatal()) return;
+  SetDownSource(std::make_shared<DigitalInput>(channel));
+  AddChild(m_downSource);
+}
+
+/**
+ * Set the down counting source to be an analog trigger.
+ *
+ * @param analogTrigger The analog trigger object that is used for the Down
+ *                      Source
+ * @param triggerType   The analog trigger output that will trigger the counter.
+ */
+void Counter::SetDownSource(AnalogTrigger* analogTrigger,
+                            AnalogTriggerType triggerType) {
+  SetDownSource(std::shared_ptr<AnalogTrigger>(analogTrigger,
+                                               NullDeleter<AnalogTrigger>()),
+                triggerType);
+}
+
+/**
+ * Set the down counting source to be an analog trigger.
+ *
+ * @param analogTrigger The analog trigger object that is used for the Down
+ *                      Source
+ * @param triggerType   The analog trigger output that will trigger the counter.
+ */
+void Counter::SetDownSource(std::shared_ptr<AnalogTrigger> analogTrigger,
+                            AnalogTriggerType triggerType) {
+  if (StatusIsFatal()) return;
+  SetDownSource(analogTrigger->CreateOutput(triggerType));
+}
+
+/**
+ * Set the source object that causes the counter to count down.
+ *
+ * Set the down counting DigitalSource.
+ *
+ * @param source Pointer to the DigitalSource object to set as the down source
+ */
+void Counter::SetDownSource(std::shared_ptr<DigitalSource> source) {
+  if (StatusIsFatal()) return;
+  m_downSource = source;
+  if (m_downSource->StatusIsFatal()) {
+    CloneError(*m_downSource);
+  } else {
+    int32_t status = 0;
+    HAL_SetCounterDownSource(
+        m_counter, source->GetPortHandleForRouting(),
+        (HAL_AnalogTriggerType)source->GetAnalogTriggerTypeForRouting(),
+        &status);
+    wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  }
+}
+
+void Counter::SetDownSource(DigitalSource* source) {
+  SetDownSource(
+      std::shared_ptr<DigitalSource>(source, NullDeleter<DigitalSource>()));
+}
+
+/**
+ * Set the source object that causes the counter to count down.
+ *
+ * Set the down counting DigitalSource.
+ *
+ * @param source Reference to the DigitalSource object to set as the down source
+ */
+void Counter::SetDownSource(DigitalSource& source) {
+  SetDownSource(
+      std::shared_ptr<DigitalSource>(&source, NullDeleter<DigitalSource>()));
+}
+
+/**
+ * Set the edge sensitivity on a down counting source.
+ *
+ * Set the down source to either detect rising edges or falling edges.
+ *
+ * @param risingEdge  True to trigger on rising edges
+ * @param fallingEdge True to trigger on falling edges
+ */
+void Counter::SetDownSourceEdge(bool risingEdge, bool fallingEdge) {
+  if (StatusIsFatal()) return;
+  if (m_downSource == nullptr) {
+    wpi_setWPIErrorWithContext(
+        NullParameter,
+        "Must set non-nullptr DownSource before setting DownSourceEdge");
+  }
+  int32_t status = 0;
+  HAL_SetCounterDownSourceEdge(m_counter, risingEdge, fallingEdge, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Disable the down counting source to the counter.
+ */
+void Counter::ClearDownSource() {
+  if (StatusIsFatal()) return;
+  m_downSource.reset();
+  int32_t status = 0;
+  HAL_ClearCounterDownSource(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set standard up / down counting mode on this counter.
+ *
+ * Up and down counts are sourced independently from two inputs.
+ */
+void Counter::SetUpDownCounterMode() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterUpDownMode(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set external direction mode on this counter.
+ *
+ * Counts are sourced on the Up counter input.
+ * The Down counter input represents the direction to count.
+ */
+void Counter::SetExternalDirectionMode() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterExternalDirectionMode(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set Semi-period mode on this counter.
+ *
+ * Counts up on both rising and falling edges.
+ */
+void Counter::SetSemiPeriodMode(bool highSemiPeriod) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterSemiPeriodMode(m_counter, highSemiPeriod, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Configure the counter to count in up or down based on the length of the input
+ * pulse.
+ *
+ * This mode is most useful for direction sensitive gear tooth sensors.
+ *
+ * @param threshold The pulse length beyond which the counter counts the
+ *                  opposite direction.  Units are seconds.
+ */
+void Counter::SetPulseLengthMode(double threshold) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterPulseLengthMode(m_counter, threshold, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period.
+ *
+ * Perform averaging to account for mechanical imperfections or as oversampling
+ * to increase resolution.
+ *
+ * @return The number of samples being averaged (from 1 to 127)
+ */
+int Counter::GetSamplesToAverage() const {
+  int32_t status = 0;
+  int samples = HAL_GetCounterSamplesToAverage(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return samples;
+}
+
+/**
+ * Set the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period. Perform averaging to account for
+ * mechanical imperfections or as oversampling to increase resolution.
+ *
+ * @param samplesToAverage The number of samples to average from 1 to 127.
+ */
+void Counter::SetSamplesToAverage(int samplesToAverage) {
+  if (samplesToAverage < 1 || samplesToAverage > 127) {
+    wpi_setWPIErrorWithContext(
+        ParameterOutOfRange,
+        "Average counter values must be between 1 and 127");
+  }
+  int32_t status = 0;
+  HAL_SetCounterSamplesToAverage(m_counter, samplesToAverage, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Read the current counter value.
+ *
+ * Read the value at this instant. It may still be running, so it reflects the
+ * current value. Next time it is read, it might have a different value.
+ */
+int Counter::Get() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int value = HAL_GetCounter(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Reset the Counter to zero.
+ *
+ * Set the counter value to zero. This doesn't effect the running state of the
+ * counter, just sets the current value to zero.
+ */
+void Counter::Reset() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_ResetCounter(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the Period of the most recent count.
+ *
+ * Returns the time interval of the most recent count. This can be used for
+ * velocity calculations to determine shaft speed.
+ *
+ * @returns The period between the last two pulses in units of seconds.
+ */
+double Counter::GetPeriod() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetCounterPeriod(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Set the maximum period where the device is still considered "moving".
+ *
+ * Sets the maximum period where the device is considered moving. This value is
+ * used to determine the "stopped" state of the counter using the GetStopped
+ * method.
+ *
+ * @param maxPeriod The maximum period where the counted device is considered
+ *                  moving in seconds.
+ */
+void Counter::SetMaxPeriod(double maxPeriod) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterMaxPeriod(m_counter, maxPeriod, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Select whether you want to continue updating the event timer output when
+ * there are no samples captured.
+ *
+ * The output of the event timer has a buffer of periods that are averaged and
+ * posted to a register on the FPGA.  When the timer detects that the event
+ * source has stopped (based on the MaxPeriod) the buffer of samples to be
+ * averaged is emptied.  If you enable the update when empty, you will be
+ * notified of the stopped source and the event time will report 0 samples.
+ * If you disable update when empty, the most recent average will remain on
+ * the output until a new sample is acquired.  You will never see 0 samples
+ * output (except when there have been no events since an FPGA reset) and you
+ * will likely not see the stopped bit become true (since it is updated at the
+ * end of an average and there are no samples to average).
+ *
+ * @param enabled True to enable update when empty
+ */
+void Counter::SetUpdateWhenEmpty(bool enabled) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterUpdateWhenEmpty(m_counter, enabled, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Determine if the clock is stopped.
+ *
+ * Determine if the clocked input is stopped based on the MaxPeriod value set
+ * using the SetMaxPeriod method. If the clock exceeds the MaxPeriod, then the
+ * device (and counter) are assumed to be stopped and it returns true.
+ *
+ * @return Returns true if the most recent counter period exceeds the MaxPeriod
+ *         value set by SetMaxPeriod.
+ */
+bool Counter::GetStopped() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value = HAL_GetCounterStopped(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * The last direction the counter value changed.
+ *
+ * @return The last direction the counter value changed.
+ */
+bool Counter::GetDirection() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value = HAL_GetCounterDirection(m_counter, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Set the Counter to return reversed sensing on the direction.
+ *
+ * This allows counters to change the direction they are counting in the case of
+ * 1X and 2X quadrature encoding only. Any other counter mode isn't supported.
+ *
+ * @param reverseDirection true if the value counted should be negated.
+ */
+void Counter::SetReverseDirection(bool reverseDirection) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetCounterReverseDirection(m_counter, reverseDirection, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+void Counter::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Counter");
+  builder.AddDoubleProperty("Value", [=]() { return Get(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DMC60.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DMC60.cpp
new file mode 100644
index 0000000..29dc5b8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DMC60.cpp
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DMC60.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Constructor for a Digilent DMC 60.
+ *
+ * @param channel The PWM channel that the DMC 60 is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+DMC60::DMC60(int channel) : PWMSpeedController(channel) {
+  /**
+   * Note that the DMC 60 uses the following bounds for PWM values. These
+   * values should work reasonably well for most controllers, but if users
+   * experience issues such as asymmetric behavior around the deadband or
+   * inability to saturate the controller in either direction, calibration is
+   * recommended. The calibration procedure can be found in the DMC 60 User
+   * Manual available from Digilent.
+   *
+   *   2.004ms = full "forward"
+   *   1.52ms = the "high end" of the deadband range
+   *   1.50ms = center of the deadband range (off)
+   *   1.48ms = the "low end" of the deadband range
+   *   0.997ms = full "reverse"
+   */
+  SetBounds(2.004, 1.52, 1.50, 1.48, .997);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  // HAL_Report(HALUsageReporting::kResourceType_VictorSP, GetChannel());
+  SetName("DMC60", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalGlitchFilter.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalGlitchFilter.cpp
new file mode 100644
index 0000000..7ab9790
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalGlitchFilter.cpp
@@ -0,0 +1,204 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalGlitchFilter.h"
+
+#include <algorithm>
+#include <array>
+
+#include <HAL/Constants.h>
+#include <HAL/DIO.h>
+#include <HAL/HAL.h>
+
+#include "Counter.h"
+#include "Encoder.h"
+#include "Utility.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+std::array<bool, 3> DigitalGlitchFilter::m_filterAllocated = {
+    {false, false, false}};
+wpi::mutex DigitalGlitchFilter::m_mutex;
+
+DigitalGlitchFilter::DigitalGlitchFilter() {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  auto index =
+      std::find(m_filterAllocated.begin(), m_filterAllocated.end(), false);
+  wpi_assert(index != m_filterAllocated.end());
+
+  m_channelIndex = std::distance(m_filterAllocated.begin(), index);
+  *index = true;
+
+  HAL_Report(HALUsageReporting::kResourceType_DigitalFilter, m_channelIndex);
+  SetName("DigitalGlitchFilter", m_channelIndex);
+}
+
+DigitalGlitchFilter::~DigitalGlitchFilter() {
+  if (m_channelIndex >= 0) {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    m_filterAllocated[m_channelIndex] = false;
+  }
+}
+
+/**
+ * Assigns the DigitalSource to this glitch filter.
+ *
+ * @param input The DigitalSource to add.
+ */
+void DigitalGlitchFilter::Add(DigitalSource* input) {
+  DoAdd(input, m_channelIndex + 1);
+}
+
+void DigitalGlitchFilter::DoAdd(DigitalSource* input, int requestedIndex) {
+  // Some sources from Counters and Encoders are null. By pushing the check
+  // here, we catch the issue more generally.
+  if (input) {
+    // We don't support GlitchFilters on AnalogTriggers.
+    if (input->IsAnalogTrigger()) {
+      wpi_setErrorWithContext(
+          -1, "Analog Triggers not supported for DigitalGlitchFilters");
+      return;
+    }
+    int32_t status = 0;
+    HAL_SetFilterSelect(input->GetPortHandleForRouting(), requestedIndex,
+                        &status);
+    wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+    // Validate that we set it correctly.
+    int actualIndex =
+        HAL_GetFilterSelect(input->GetPortHandleForRouting(), &status);
+    wpi_assertEqual(actualIndex, requestedIndex);
+
+    HAL_Report(HALUsageReporting::kResourceType_DigitalInput,
+               input->GetChannel());
+  }
+}
+
+/**
+ * Assigns the Encoder to this glitch filter.
+ *
+ * @param input The Encoder to add.
+ */
+void DigitalGlitchFilter::Add(Encoder* input) {
+  Add(input->m_aSource.get());
+  if (StatusIsFatal()) {
+    return;
+  }
+  Add(input->m_bSource.get());
+}
+
+/**
+ * Assigns the Counter to this glitch filter.
+ *
+ * @param input The Counter to add.
+ */
+void DigitalGlitchFilter::Add(Counter* input) {
+  Add(input->m_upSource.get());
+  if (StatusIsFatal()) {
+    return;
+  }
+  Add(input->m_downSource.get());
+}
+
+/**
+ * Removes a digital input from this filter.
+ *
+ * Removes the DigitalSource from this glitch filter and re-assigns it to
+ * the default filter.
+ *
+ * @param input The DigitalSource to remove.
+ */
+void DigitalGlitchFilter::Remove(DigitalSource* input) { DoAdd(input, 0); }
+
+/**
+ * Removes an encoder from this filter.
+ *
+ * Removes the Encoder from this glitch filter and re-assigns it to
+ * the default filter.
+ *
+ * @param input The Encoder to remove.
+ */
+void DigitalGlitchFilter::Remove(Encoder* input) {
+  Remove(input->m_aSource.get());
+  if (StatusIsFatal()) {
+    return;
+  }
+  Remove(input->m_bSource.get());
+}
+
+/**
+ * Removes a counter from this filter.
+ *
+ * Removes the Counter from this glitch filter and re-assigns it to
+ * the default filter.
+ *
+ * @param input The Counter to remove.
+ */
+void DigitalGlitchFilter::Remove(Counter* input) {
+  Remove(input->m_upSource.get());
+  if (StatusIsFatal()) {
+    return;
+  }
+  Remove(input->m_downSource.get());
+}
+
+/**
+ * Sets the number of cycles that the input must not change state for.
+ *
+ * @param fpgaCycles The number of FPGA cycles.
+ */
+void DigitalGlitchFilter::SetPeriodCycles(int fpgaCycles) {
+  int32_t status = 0;
+  HAL_SetFilterPeriod(m_channelIndex, fpgaCycles, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Sets the number of nanoseconds that the input must not change state for.
+ *
+ * @param nanoseconds The number of nanoseconds.
+ */
+void DigitalGlitchFilter::SetPeriodNanoSeconds(uint64_t nanoseconds) {
+  int32_t status = 0;
+  int fpgaCycles =
+      nanoseconds * HAL_GetSystemClockTicksPerMicrosecond() / 4 / 1000;
+  HAL_SetFilterPeriod(m_channelIndex, fpgaCycles, &status);
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Gets the number of cycles that the input must not change state for.
+ *
+ * @return The number of cycles.
+ */
+int DigitalGlitchFilter::GetPeriodCycles() {
+  int32_t status = 0;
+  int fpgaCycles = HAL_GetFilterPeriod(m_channelIndex, &status);
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  return fpgaCycles;
+}
+
+/**
+ * Gets the number of nanoseconds that the input must not change state for.
+ *
+ * @return The number of nanoseconds.
+ */
+uint64_t DigitalGlitchFilter::GetPeriodNanoSeconds() {
+  int32_t status = 0;
+  int fpgaCycles = HAL_GetFilterPeriod(m_channelIndex, &status);
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  return static_cast<uint64_t>(fpgaCycles) * 1000L /
+         static_cast<uint64_t>(HAL_GetSystemClockTicksPerMicrosecond() / 4);
+}
+
+void DigitalGlitchFilter::InitSendable(SendableBuilder&) {}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalInput.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalInput.cpp
new file mode 100644
index 0000000..521b698
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalInput.cpp
@@ -0,0 +1,104 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalInput.h"
+
+#include <limits>
+
+#include <HAL/DIO.h>
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Create an instance of a Digital Input class.
+ *
+ * Creates a digital input given a channel.
+ *
+ * @param channel The DIO channel 0-9 are on-board, 10-25 are on the MXP port
+ */
+DigitalInput::DigitalInput(int channel) {
+  if (!CheckDigitalChannel(channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "Digital Channel " + llvm::Twine(channel));
+    m_channel = std::numeric_limits<int>::max();
+    return;
+  }
+  m_channel = channel;
+
+  int32_t status = 0;
+  m_handle = HAL_InitializeDIOPort(HAL_GetPort(channel), true, &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumDigitalChannels(),
+                                 channel, HAL_GetErrorMessage(status));
+    m_handle = HAL_kInvalidHandle;
+    m_channel = std::numeric_limits<int>::max();
+    return;
+  }
+
+  HAL_Report(HALUsageReporting::kResourceType_DigitalInput, channel);
+  SetName("DigitalInput", channel);
+}
+
+/**
+ * Free resources associated with the Digital Input class.
+ */
+DigitalInput::~DigitalInput() {
+  if (StatusIsFatal()) return;
+  if (m_interrupt != HAL_kInvalidHandle) {
+    int32_t status = 0;
+    HAL_CleanInterrupts(m_interrupt, &status);
+    // Ignore status, as an invalid handle just needs to be ignored.
+    m_interrupt = HAL_kInvalidHandle;
+  }
+
+  HAL_FreeDIOPort(m_handle);
+}
+
+/**
+ * Get the value from a digital input channel.
+ *
+ * Retrieve the value of a single digital input channel from the FPGA.
+ */
+bool DigitalInput::Get() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value = HAL_GetDIO(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * @return The GPIO channel number that this object represents.
+ */
+int DigitalInput::GetChannel() const { return m_channel; }
+
+/**
+ * @return The HAL Handle to the specified source.
+ */
+HAL_Handle DigitalInput::GetPortHandleForRouting() const { return m_handle; }
+
+/**
+ * Is source an AnalogTrigger
+ */
+bool DigitalInput::IsAnalogTrigger() const { return false; }
+
+/**
+ * @return The type of analog trigger output to be used. 0 for Digitals
+ */
+AnalogTriggerType DigitalInput::GetAnalogTriggerTypeForRouting() const {
+  return (AnalogTriggerType)0;
+}
+
+void DigitalInput::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Digital Input");
+  builder.AddBooleanProperty("Value", [=]() { return Get(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalOutput.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalOutput.cpp
new file mode 100644
index 0000000..cc7897b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DigitalOutput.cpp
@@ -0,0 +1,220 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalOutput.h"
+
+#include <limits>
+
+#include <HAL/DIO.h>
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Create an instance of a digital output.
+ *
+ * Create a digital output given a channel.
+ *
+ * @param channel The digital channel 0-9 are on-board, 10-25 are on the MXP
+ *                port
+ */
+DigitalOutput::DigitalOutput(int channel) {
+  m_pwmGenerator = HAL_kInvalidHandle;
+  if (!SensorBase::CheckDigitalChannel(channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "Digital Channel " + llvm::Twine(channel));
+    m_channel = std::numeric_limits<int>::max();
+    return;
+  }
+  m_channel = channel;
+
+  int32_t status = 0;
+  m_handle = HAL_InitializeDIOPort(HAL_GetPort(channel), false, &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumDigitalChannels(),
+                                 channel, HAL_GetErrorMessage(status));
+    m_channel = std::numeric_limits<int>::max();
+    m_handle = HAL_kInvalidHandle;
+    return;
+  }
+
+  HAL_Report(HALUsageReporting::kResourceType_DigitalOutput, channel);
+  SetName("DigitalOutput", channel);
+}
+
+/**
+ * Free the resources associated with a digital output.
+ */
+DigitalOutput::~DigitalOutput() {
+  if (StatusIsFatal()) return;
+  // Disable the PWM in case it was running.
+  DisablePWM();
+
+  HAL_FreeDIOPort(m_handle);
+}
+
+/**
+ * Set the value of a digital output.
+ *
+ * Set the value of a digital output to either one (true) or zero (false).
+ *
+ * @param value 1 (true) for high, 0 (false) for disabled
+ */
+void DigitalOutput::Set(bool value) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+  HAL_SetDIO(m_handle, value, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Gets the value being output from the Digital Output.
+ *
+ * @return the state of the digital output.
+ */
+bool DigitalOutput::Get() const {
+  if (StatusIsFatal()) return false;
+
+  int32_t status = 0;
+  bool val = HAL_GetDIO(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return val;
+}
+
+/**
+ * @return The GPIO channel number that this object represents.
+ */
+int DigitalOutput::GetChannel() const { return m_channel; }
+
+/**
+ * Output a single pulse on the digital output line.
+ *
+ * Send a single pulse on the digital output line where the pulse duration is
+ * specified in seconds. Maximum pulse length is 0.0016 seconds.
+ *
+ * @param length The pulse length in seconds
+ */
+void DigitalOutput::Pulse(double length) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+  HAL_Pulse(m_handle, length, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Determine if the pulse is still going.
+ *
+ * Determine if a previously started pulse is still going.
+ */
+bool DigitalOutput::IsPulsing() const {
+  if (StatusIsFatal()) return false;
+
+  int32_t status = 0;
+  bool value = HAL_IsPulsing(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Change the PWM frequency of the PWM output on a Digital Output line.
+ *
+ * The valid range is from 0.6 Hz to 19 kHz.  The frequency resolution is
+ * logarithmic.
+ *
+ * There is only one PWM frequency for all digital channels.
+ *
+ * @param rate The frequency to output all digital output PWM signals.
+ */
+void DigitalOutput::SetPWMRate(double rate) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+  HAL_SetDigitalPWMRate(rate, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Enable a PWM Output on this line.
+ *
+ * Allocate one of the 6 DO PWM generator resources from this module.
+ *
+ * Supply the initial duty-cycle to output so as to avoid a glitch when first
+ * starting.
+ *
+ * The resolution of the duty cycle is 8-bit for low frequencies (1kHz or less)
+ * but is reduced the higher the frequency of the PWM signal is.
+ *
+ * @param initialDutyCycle The duty-cycle to start generating. [0..1]
+ */
+void DigitalOutput::EnablePWM(double initialDutyCycle) {
+  if (m_pwmGenerator != HAL_kInvalidHandle) return;
+
+  int32_t status = 0;
+
+  if (StatusIsFatal()) return;
+  m_pwmGenerator = HAL_AllocateDigitalPWM(&status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  if (StatusIsFatal()) return;
+  HAL_SetDigitalPWMDutyCycle(m_pwmGenerator, initialDutyCycle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  if (StatusIsFatal()) return;
+  HAL_SetDigitalPWMOutputChannel(m_pwmGenerator, m_channel, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Change this line from a PWM output back to a static Digital Output line.
+ *
+ * Free up one of the 6 DO PWM generator resources that were in use.
+ */
+void DigitalOutput::DisablePWM() {
+  if (StatusIsFatal()) return;
+  if (m_pwmGenerator == HAL_kInvalidHandle) return;
+
+  int32_t status = 0;
+
+  // Disable the output by routing to a dead bit.
+  HAL_SetDigitalPWMOutputChannel(m_pwmGenerator, SensorBase::kDigitalChannels,
+                                 &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  HAL_FreeDigitalPWM(m_pwmGenerator, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  m_pwmGenerator = HAL_kInvalidHandle;
+}
+
+/**
+ * Change the duty-cycle that is being generated on the line.
+ *
+ * The resolution of the duty cycle is 8-bit for low frequencies (1kHz or less)
+ * but is reduced the higher the frequency of the PWM signal is.
+ *
+ * @param dutyCycle The duty-cycle to change to. [0..1]
+ */
+void DigitalOutput::UpdateDutyCycle(double dutyCycle) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+  HAL_SetDigitalPWMDutyCycle(m_pwmGenerator, dutyCycle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+void DigitalOutput::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Digital Output");
+  builder.AddBooleanProperty("Value", [=]() { return Get(); },
+                             [=](bool value) { Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp
new file mode 100644
index 0000000..4cef7ff
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DoubleSolenoid.cpp
@@ -0,0 +1,207 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DoubleSolenoid.h"
+
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+#include <HAL/Solenoid.h>
+
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Constructor.
+ *
+ * Uses the default PCM ID of 0.
+ *
+ * @param forwardChannel The forward channel number on the PCM (0..7).
+ * @param reverseChannel The reverse channel number on the PCM (0..7).
+ */
+DoubleSolenoid::DoubleSolenoid(int forwardChannel, int reverseChannel)
+    : DoubleSolenoid(SensorBase::GetDefaultSolenoidModule(), forwardChannel,
+                     reverseChannel) {}
+
+/**
+ * Constructor.
+ *
+ * @param moduleNumber   The CAN ID of the PCM.
+ * @param forwardChannel The forward channel on the PCM to control (0..7).
+ * @param reverseChannel The reverse channel on the PCM to control (0..7).
+ */
+DoubleSolenoid::DoubleSolenoid(int moduleNumber, int forwardChannel,
+                               int reverseChannel)
+    : SolenoidBase(moduleNumber),
+      m_forwardChannel(forwardChannel),
+      m_reverseChannel(reverseChannel) {
+  if (!SensorBase::CheckSolenoidModule(m_moduleNumber)) {
+    wpi_setWPIErrorWithContext(
+        ModuleIndexOutOfRange,
+        "Solenoid Module " + llvm::Twine(m_moduleNumber));
+    return;
+  }
+  if (!SensorBase::CheckSolenoidChannel(m_forwardChannel)) {
+    wpi_setWPIErrorWithContext(
+        ChannelIndexOutOfRange,
+        "Solenoid Channel " + llvm::Twine(m_forwardChannel));
+    return;
+  }
+  if (!SensorBase::CheckSolenoidChannel(m_reverseChannel)) {
+    wpi_setWPIErrorWithContext(
+        ChannelIndexOutOfRange,
+        "Solenoid Channel " + llvm::Twine(m_reverseChannel));
+    return;
+  }
+  int32_t status = 0;
+  m_forwardHandle = HAL_InitializeSolenoidPort(
+      HAL_GetPortWithModule(moduleNumber, m_forwardChannel), &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumSolenoidChannels(),
+                                 forwardChannel, HAL_GetErrorMessage(status));
+    m_forwardHandle = HAL_kInvalidHandle;
+    m_reverseHandle = HAL_kInvalidHandle;
+    return;
+  }
+
+  m_reverseHandle = HAL_InitializeSolenoidPort(
+      HAL_GetPortWithModule(moduleNumber, m_reverseChannel), &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumSolenoidChannels(),
+                                 reverseChannel, HAL_GetErrorMessage(status));
+    // free forward solenoid
+    HAL_FreeSolenoidPort(m_forwardHandle);
+    m_forwardHandle = HAL_kInvalidHandle;
+    m_reverseHandle = HAL_kInvalidHandle;
+    return;
+  }
+
+  m_forwardMask = 1 << m_forwardChannel;
+  m_reverseMask = 1 << m_reverseChannel;
+
+  HAL_Report(HALUsageReporting::kResourceType_Solenoid, m_forwardChannel,
+             m_moduleNumber);
+  HAL_Report(HALUsageReporting::kResourceType_Solenoid, m_reverseChannel,
+             m_moduleNumber);
+  SetName("DoubleSolenoid", m_moduleNumber, m_forwardChannel);
+}
+
+/**
+ * Destructor.
+ */
+DoubleSolenoid::~DoubleSolenoid() {
+  HAL_FreeSolenoidPort(m_forwardHandle);
+  HAL_FreeSolenoidPort(m_reverseHandle);
+}
+
+/**
+ * Set the value of a solenoid.
+ *
+ * @param value The value to set (Off, Forward or Reverse)
+ */
+void DoubleSolenoid::Set(Value value) {
+  if (StatusIsFatal()) return;
+
+  bool forward = false;
+  bool reverse = false;
+  switch (value) {
+    case kOff:
+      forward = false;
+      reverse = false;
+      break;
+    case kForward:
+      forward = true;
+      reverse = false;
+      break;
+    case kReverse:
+      forward = false;
+      reverse = true;
+      break;
+  }
+  int fstatus = 0;
+  HAL_SetSolenoid(m_forwardHandle, forward, &fstatus);
+  int rstatus = 0;
+  HAL_SetSolenoid(m_reverseHandle, reverse, &rstatus);
+
+  wpi_setErrorWithContext(fstatus, HAL_GetErrorMessage(fstatus));
+  wpi_setErrorWithContext(rstatus, HAL_GetErrorMessage(rstatus));
+}
+
+/**
+ * Read the current value of the solenoid.
+ *
+ * @return The current value of the solenoid.
+ */
+DoubleSolenoid::Value DoubleSolenoid::Get() const {
+  if (StatusIsFatal()) return kOff;
+  int fstatus = 0;
+  int rstatus = 0;
+  bool valueForward = HAL_GetSolenoid(m_forwardHandle, &fstatus);
+  bool valueReverse = HAL_GetSolenoid(m_reverseHandle, &rstatus);
+
+  wpi_setErrorWithContext(fstatus, HAL_GetErrorMessage(fstatus));
+  wpi_setErrorWithContext(rstatus, HAL_GetErrorMessage(rstatus));
+
+  if (valueForward) return kForward;
+  if (valueReverse) return kReverse;
+  return kOff;
+}
+
+/**
+ * Check if the forward solenoid is blacklisted.
+ *
+ * If a solenoid is shorted, it is added to the blacklist and
+ * disabled until power cycle, or until faults are cleared.
+ * @see ClearAllPCMStickyFaults()
+ *
+ * @return If solenoid is disabled due to short.
+ */
+bool DoubleSolenoid::IsFwdSolenoidBlackListed() const {
+  int blackList = GetPCMSolenoidBlackList(m_moduleNumber);
+  return (blackList & m_forwardMask) != 0;
+}
+
+/**
+ * Check if the reverse solenoid is blacklisted.
+ *
+ * If a solenoid is shorted, it is added to the blacklist and
+ * disabled until power cycle, or until faults are cleared.
+ *
+ * @see ClearAllPCMStickyFaults()
+ * @return If solenoid is disabled due to short.
+ */
+bool DoubleSolenoid::IsRevSolenoidBlackListed() const {
+  int blackList = GetPCMSolenoidBlackList(m_moduleNumber);
+  return (blackList & m_reverseMask) != 0;
+}
+
+void DoubleSolenoid::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Double Solenoid");
+  builder.SetSafeState([=]() { Set(kOff); });
+  builder.AddSmallStringProperty(
+      "Value",
+      [=](llvm::SmallVectorImpl<char>& buf) -> llvm::StringRef {
+        switch (Get()) {
+          case kForward:
+            return "Forward";
+          case kReverse:
+            return "Reverse";
+          default:
+            return "Off";
+        }
+      },
+      [=](llvm::StringRef value) {
+        Value lvalue = kOff;
+        if (value == "Forward")
+          lvalue = kForward;
+        else if (value == "Reverse")
+          lvalue = kReverse;
+        Set(lvalue);
+      });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/DifferentialDrive.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/DifferentialDrive.cpp
new file mode 100644
index 0000000..4f8802d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/DifferentialDrive.cpp
@@ -0,0 +1,268 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Drive/DifferentialDrive.h"
+
+#include <cmath>
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "SpeedController.h"
+
+using namespace frc;
+
+/**
+ * Construct a DifferentialDrive.
+ *
+ * To pass multiple motors per side, use a SpeedControllerGroup. If a motor
+ * needs to be inverted, do so before passing it in.
+ */
+DifferentialDrive::DifferentialDrive(SpeedController& leftMotor,
+                                     SpeedController& rightMotor)
+    : m_leftMotor(leftMotor), m_rightMotor(rightMotor) {
+  AddChild(&m_leftMotor);
+  AddChild(&m_rightMotor);
+  static int instances = 0;
+  ++instances;
+  SetName("DifferentialDrive", instances);
+}
+
+/**
+ * Arcade drive method for differential drive platform.
+ *
+ * Note: Some drivers may prefer inverted rotation controls. This can be done by
+ * negating the value passed for rotation.
+ *
+ * @param xSpeed        The speed at which the robot should drive along the X
+ *                      axis [-1.0..1.0]. Forward is negative.
+ * @param zRotation     The rotation rate of the robot around the Z axis
+ *                      [-1.0..1.0]. Clockwise is positive.
+ * @param squaredInputs If set, decreases the input sensitivity at low speeds.
+ */
+void DifferentialDrive::ArcadeDrive(double xSpeed, double zRotation,
+                                    bool squaredInputs) {
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
+               HALUsageReporting::kRobotDrive_ArcadeStandard);
+    reported = true;
+  }
+
+  xSpeed = Limit(xSpeed);
+  xSpeed = ApplyDeadband(xSpeed, m_deadband);
+
+  zRotation = Limit(zRotation);
+  zRotation = ApplyDeadband(zRotation, m_deadband);
+
+  // Square the inputs (while preserving the sign) to increase fine control
+  // while permitting full power.
+  if (squaredInputs) {
+    xSpeed = std::copysign(xSpeed * xSpeed, xSpeed);
+    zRotation = std::copysign(zRotation * zRotation, zRotation);
+  }
+
+  double leftMotorOutput;
+  double rightMotorOutput;
+
+  double maxInput =
+      std::copysign(std::max(std::abs(xSpeed), std::abs(zRotation)), xSpeed);
+
+  if (xSpeed >= 0.0) {
+    // First quadrant, else second quadrant
+    if (zRotation >= 0.0) {
+      leftMotorOutput = maxInput;
+      rightMotorOutput = xSpeed - zRotation;
+    } else {
+      leftMotorOutput = xSpeed + zRotation;
+      rightMotorOutput = maxInput;
+    }
+  } else {
+    // Third quadrant, else fourth quadrant
+    if (zRotation >= 0.0) {
+      leftMotorOutput = xSpeed + zRotation;
+      rightMotorOutput = maxInput;
+    } else {
+      leftMotorOutput = maxInput;
+      rightMotorOutput = xSpeed - zRotation;
+    }
+  }
+
+  m_leftMotor.Set(Limit(leftMotorOutput) * m_maxOutput);
+  m_rightMotor.Set(-Limit(rightMotorOutput) * m_maxOutput);
+
+  m_safetyHelper.Feed();
+}
+
+/**
+ * Curvature drive method for differential drive platform.
+ *
+ * The rotation argument controls the curvature of the robot's path rather than
+ * its rate of heading change. This makes the robot more controllable at high
+ * speeds. Also handles the robot's quick turn functionality - "quick turn"
+ * overrides constant-curvature turning for turn-in-place maneuvers.
+ *
+ * @param xSpeed      The robot's speed along the X axis [-1.0..1.0]. Forward is
+ *                    positive.
+ * @param zRotation   The robot's rotation rate around the Z axis [-1.0..1.0].
+ *                    Clockwise is positive.
+ * @param isQuickTurn If set, overrides constant-curvature turning for
+ *                    turn-in-place maneuvers.
+ */
+void DifferentialDrive::CurvatureDrive(double xSpeed, double zRotation,
+                                       bool isQuickTurn) {
+  static bool reported = false;
+  if (!reported) {
+    // HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
+    //            HALUsageReporting::kRobotDrive_Curvature);
+    reported = true;
+  }
+
+  xSpeed = Limit(xSpeed);
+  xSpeed = ApplyDeadband(xSpeed, m_deadband);
+
+  zRotation = Limit(zRotation);
+  zRotation = ApplyDeadband(zRotation, m_deadband);
+
+  double angularPower;
+  bool overPower;
+
+  if (isQuickTurn) {
+    if (std::abs(xSpeed) < m_quickStopThreshold) {
+      m_quickStopAccumulator = (1 - m_quickStopAlpha) * m_quickStopAccumulator +
+                               m_quickStopAlpha * Limit(zRotation) * 2;
+    }
+    overPower = true;
+    angularPower = zRotation;
+  } else {
+    overPower = false;
+    angularPower = std::abs(xSpeed) * zRotation - m_quickStopAccumulator;
+
+    if (m_quickStopAccumulator > 1) {
+      m_quickStopAccumulator -= 1;
+    } else if (m_quickStopAccumulator < -1) {
+      m_quickStopAccumulator += 1;
+    } else {
+      m_quickStopAccumulator = 0.0;
+    }
+  }
+
+  double leftMotorOutput = xSpeed + angularPower;
+  double rightMotorOutput = xSpeed - angularPower;
+
+  // If rotation is overpowered, reduce both outputs to within acceptable range
+  if (overPower) {
+    if (leftMotorOutput > 1.0) {
+      rightMotorOutput -= leftMotorOutput - 1.0;
+      leftMotorOutput = 1.0;
+    } else if (rightMotorOutput > 1.0) {
+      leftMotorOutput -= rightMotorOutput - 1.0;
+      rightMotorOutput = 1.0;
+    } else if (leftMotorOutput < -1.0) {
+      rightMotorOutput -= leftMotorOutput + 1.0;
+      leftMotorOutput = -1.0;
+    } else if (rightMotorOutput < -1.0) {
+      leftMotorOutput -= rightMotorOutput + 1.0;
+      rightMotorOutput = -1.0;
+    }
+  }
+
+  m_leftMotor.Set(leftMotorOutput * m_maxOutput);
+  m_rightMotor.Set(-rightMotorOutput * m_maxOutput);
+
+  m_safetyHelper.Feed();
+}
+
+/**
+ * Tank drive method for differential drive platform.
+ *
+ * @param leftSpeed     The robot left side's speed along the X axis
+ *                      [-1.0..1.0]. Forward is positive.
+ * @param rightSpeed    The robot right side's speed along the X axis
+ *                      [-1.0..1.0]. Forward is positive.
+ * @param squaredInputs If set, decreases the input sensitivity at low speeds.
+ */
+void DifferentialDrive::TankDrive(double leftSpeed, double rightSpeed,
+                                  bool squaredInputs) {
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 2,
+               HALUsageReporting::kRobotDrive_Tank);
+    reported = true;
+  }
+
+  leftSpeed = Limit(leftSpeed);
+  leftSpeed = ApplyDeadband(leftSpeed, m_deadband);
+
+  rightSpeed = Limit(rightSpeed);
+  rightSpeed = ApplyDeadband(rightSpeed, m_deadband);
+
+  // Square the inputs (while preserving the sign) to increase fine control
+  // while permitting full power.
+  if (squaredInputs) {
+    leftSpeed = std::copysign(leftSpeed * leftSpeed, leftSpeed);
+    rightSpeed = std::copysign(rightSpeed * rightSpeed, rightSpeed);
+  }
+
+  m_leftMotor.Set(leftSpeed * m_maxOutput);
+  m_rightMotor.Set(-rightSpeed * m_maxOutput);
+
+  m_safetyHelper.Feed();
+}
+
+/**
+ * Sets the QuickStop speed threshold in curvature drive.
+ *
+ * QuickStop compensates for the robot's moment of inertia when stopping after a
+ * QuickTurn.
+ *
+ * While QuickTurn is enabled, the QuickStop accumulator takes on the rotation
+ * rate value outputted by the low-pass filter when the robot's speed along the
+ * X axis is below the threshold. When QuickTurn is disabled, the accumulator's
+ * value is applied against the computed angular power request to slow the
+ * robot's rotation.
+ *
+ * @param threshold X speed below which quick stop accumulator will receive
+ *                  rotation rate values [0..1.0].
+ */
+void DifferentialDrive::SetQuickStopThreshold(double threshold) {
+  m_quickStopThreshold = threshold;
+}
+
+/**
+ * Sets the low-pass filter gain for QuickStop in curvature drive.
+ *
+ * The low-pass filter filters incoming rotation rate commands to smooth out
+ * high frequency changes.
+ *
+ * @param alpha Low-pass filter gain [0.0..2.0]. Smaller values result in slower
+ *              output changes. Values between 1.0 and 2.0 result in output
+ *              oscillation. Values below 0.0 and above 2.0 are unstable.
+ */
+void DifferentialDrive::SetQuickStopAlpha(double alpha) {
+  m_quickStopAlpha = alpha;
+}
+
+void DifferentialDrive::StopMotor() {
+  m_leftMotor.StopMotor();
+  m_rightMotor.StopMotor();
+  m_safetyHelper.Feed();
+}
+
+void DifferentialDrive::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "DifferentialDrive";
+}
+
+void DifferentialDrive::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("DifferentialDrive");
+  builder.AddDoubleProperty("Left Motor Speed",
+                            [=]() { return m_leftMotor.Get(); },
+                            [=](double value) { m_leftMotor.Set(value); });
+  builder.AddDoubleProperty("Right Motor Speed",
+                            [=]() { return -m_rightMotor.Get(); },
+                            [=](double value) { m_rightMotor.Set(-value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/KilloughDrive.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/KilloughDrive.cpp
new file mode 100644
index 0000000..20ee1a7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/KilloughDrive.cpp
@@ -0,0 +1,168 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Drive/KilloughDrive.h"
+
+#include <algorithm>
+#include <cmath>
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "SpeedController.h"
+
+using namespace frc;
+
+constexpr double kPi = 3.14159265358979323846;
+
+/**
+ * Construct a Killough drive with the given motors and default motor angles.
+ *
+ * The default motor angles make the wheels on each corner parallel to their
+ * respective opposite sides.
+ *
+ * If a motor needs to be inverted, do so before passing it in.
+ *
+ * @param leftMotor  The motor on the left corner.
+ * @param rightMotor The motor on the right corner.
+ * @param backMotor  The motor on the back corner.
+ */
+KilloughDrive::KilloughDrive(SpeedController& leftMotor,
+                             SpeedController& rightMotor,
+                             SpeedController& backMotor)
+    : KilloughDrive(leftMotor, rightMotor, backMotor, kDefaultLeftMotorAngle,
+                    kDefaultRightMotorAngle, kDefaultBackMotorAngle) {}
+
+/**
+ * Construct a Killough drive with the given motors.
+ *
+ * Angles are measured in degrees clockwise from the positive X axis.
+ *
+ * @param leftMotor       The motor on the left corner.
+ * @param rightMotor      The motor on the right corner.
+ * @param backMotor       The motor on the back corner.
+ * @param leftMotorAngle  The angle of the left wheel's forward direction of
+ *                        travel.
+ * @param rightMotorAngle The angle of the right wheel's forward direction of
+ *                        travel.
+ * @param backMotorAngle  The angle of the back wheel's forward direction of
+ *                        travel.
+ */
+KilloughDrive::KilloughDrive(SpeedController& leftMotor,
+                             SpeedController& rightMotor,
+                             SpeedController& backMotor, double leftMotorAngle,
+                             double rightMotorAngle, double backMotorAngle)
+    : m_leftMotor(leftMotor), m_rightMotor(rightMotor), m_backMotor(backMotor) {
+  m_leftVec = {std::cos(leftMotorAngle * (kPi / 180.0)),
+               std::sin(leftMotorAngle * (kPi / 180.0))};
+  m_rightVec = {std::cos(rightMotorAngle * (kPi / 180.0)),
+                std::sin(rightMotorAngle * (kPi / 180.0))};
+  m_backVec = {std::cos(backMotorAngle * (kPi / 180.0)),
+               std::sin(backMotorAngle * (kPi / 180.0))};
+  AddChild(&m_leftMotor);
+  AddChild(&m_rightMotor);
+  AddChild(&m_backMotor);
+  static int instances = 0;
+  ++instances;
+  SetName("KilloughDrive", instances);
+}
+
+/**
+ * Drive method for Killough platform.
+ *
+ * Angles are measured clockwise from the positive X axis. The robot's speed is
+ * independent from its angle or rotation rate.
+ *
+ * @param ySpeed    The robot's speed along the Y axis [-1.0..1.0]. Right is
+ *                  positive.
+ * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is
+ *                  positive.
+ * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0].
+ *                  Clockwise is positive.
+ * @param gyroAngle The current angle reading from the gyro in degrees around
+ *                  the Z axis. Use this to implement field-oriented controls.
+ */
+void KilloughDrive::DriveCartesian(double ySpeed, double xSpeed,
+                                   double zRotation, double gyroAngle) {
+  if (!reported) {
+    // HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 3,
+    //            HALUsageReporting::kRobotDrive_KilloughCartesian);
+    reported = true;
+  }
+
+  ySpeed = Limit(ySpeed);
+  ySpeed = ApplyDeadband(ySpeed, m_deadband);
+
+  xSpeed = Limit(xSpeed);
+  xSpeed = ApplyDeadband(xSpeed, m_deadband);
+
+  // Compensate for gyro angle.
+  Vector2d input{ySpeed, xSpeed};
+  input.Rotate(-gyroAngle);
+
+  double wheelSpeeds[3];
+  wheelSpeeds[kLeft] = input.ScalarProject(m_leftVec) + zRotation;
+  wheelSpeeds[kRight] = input.ScalarProject(m_rightVec) + zRotation;
+  wheelSpeeds[kBack] = input.ScalarProject(m_backVec) + zRotation;
+
+  Normalize(wheelSpeeds);
+
+  m_leftMotor.Set(wheelSpeeds[kLeft] * m_maxOutput);
+  m_rightMotor.Set(wheelSpeeds[kRight] * m_maxOutput);
+  m_backMotor.Set(wheelSpeeds[kBack] * m_maxOutput);
+
+  m_safetyHelper.Feed();
+}
+
+/**
+ * Drive method for Killough platform.
+ *
+ * Angles are measured clockwise from the positive X axis. The robot's speed is
+ * independent from its angle or rotation rate.
+ *
+ * @param magnitude The robot's speed at a given angle [-1.0..1.0]. Forward is
+ *                  positive.
+ * @param angle     The angle around the Z axis at which the robot drives in
+ *                  degrees [-180..180].
+ * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0].
+ *                  Clockwise is positive.
+ */
+void KilloughDrive::DrivePolar(double magnitude, double angle,
+                               double rotation) {
+  if (!reported) {
+    // HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 3,
+    //            HALUsageReporting::kRobotDrive_KilloughPolar);
+    reported = true;
+  }
+
+  DriveCartesian(magnitude * std::sin(angle * (kPi / 180.0)),
+                 magnitude * std::cos(angle * (kPi / 180.0)), rotation, 0.0);
+}
+
+void KilloughDrive::StopMotor() {
+  m_leftMotor.StopMotor();
+  m_rightMotor.StopMotor();
+  m_backMotor.StopMotor();
+  m_safetyHelper.Feed();
+}
+
+void KilloughDrive::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "KilloughDrive";
+}
+
+void KilloughDrive::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("KilloughDrive");
+  builder.AddDoubleProperty("Left Motor Speed",
+                            [=]() { return m_leftMotor.Get(); },
+                            [=](double value) { m_leftMotor.Set(value); });
+  builder.AddDoubleProperty("Right Motor Speed",
+                            [=]() { return m_rightMotor.Get(); },
+                            [=](double value) { m_rightMotor.Set(value); });
+  builder.AddDoubleProperty("Back Motor Speed",
+                            [=]() { return m_backMotor.Get(); },
+                            [=](double value) { m_backMotor.Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/MecanumDrive.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/MecanumDrive.cpp
new file mode 100644
index 0000000..71b896f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/MecanumDrive.cpp
@@ -0,0 +1,145 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Drive/MecanumDrive.h"
+
+#include <algorithm>
+#include <cmath>
+
+#include <HAL/HAL.h>
+
+#include "Drive/Vector2d.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "SpeedController.h"
+
+using namespace frc;
+
+constexpr double kPi = 3.14159265358979323846;
+
+/**
+ * Construct a MecanumDrive.
+ *
+ * If a motor needs to be inverted, do so before passing it in.
+ */
+MecanumDrive::MecanumDrive(SpeedController& frontLeftMotor,
+                           SpeedController& rearLeftMotor,
+                           SpeedController& frontRightMotor,
+                           SpeedController& rearRightMotor)
+    : m_frontLeftMotor(frontLeftMotor),
+      m_rearLeftMotor(rearLeftMotor),
+      m_frontRightMotor(frontRightMotor),
+      m_rearRightMotor(rearRightMotor) {
+  AddChild(&m_frontLeftMotor);
+  AddChild(&m_rearLeftMotor);
+  AddChild(&m_frontRightMotor);
+  AddChild(&m_rearRightMotor);
+  static int instances = 0;
+  ++instances;
+  SetName("MecanumDrive", instances);
+}
+
+/**
+ * Drive method for Mecanum platform.
+ *
+ * Angles are measured clockwise from the positive X axis. The robot's speed is
+ * independent from its angle or rotation rate.
+ *
+ * @param ySpeed    The robot's speed along the Y axis [-1.0..1.0]. Right is
+ *                  positive.
+ * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is
+ *                  positive.
+ * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0].
+ *                  Clockwise is positive.
+ * @param gyroAngle The current angle reading from the gyro in degrees around
+ *                  the Z axis. Use this to implement field-oriented controls.
+ */
+void MecanumDrive::DriveCartesian(double ySpeed, double xSpeed,
+                                  double zRotation, double gyroAngle) {
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 4,
+               HALUsageReporting::kRobotDrive_MecanumCartesian);
+    reported = true;
+  }
+
+  ySpeed = Limit(ySpeed);
+  ySpeed = ApplyDeadband(ySpeed, m_deadband);
+
+  xSpeed = Limit(xSpeed);
+  xSpeed = ApplyDeadband(xSpeed, m_deadband);
+
+  // Compensate for gyro angle.
+  Vector2d input{ySpeed, xSpeed};
+  input.Rotate(-gyroAngle);
+
+  double wheelSpeeds[4];
+  wheelSpeeds[kFrontLeft] = input.x + input.y + zRotation;
+  wheelSpeeds[kFrontRight] = input.x - input.y + zRotation;
+  wheelSpeeds[kRearLeft] = -input.x + input.y + zRotation;
+  wheelSpeeds[kRearRight] = -input.x - input.y + zRotation;
+
+  Normalize(wheelSpeeds);
+
+  m_frontLeftMotor.Set(wheelSpeeds[kFrontLeft] * m_maxOutput);
+  m_frontRightMotor.Set(wheelSpeeds[kFrontRight] * m_maxOutput);
+  m_rearLeftMotor.Set(wheelSpeeds[kRearLeft] * m_maxOutput);
+  m_rearRightMotor.Set(wheelSpeeds[kRearRight] * m_maxOutput);
+
+  m_safetyHelper.Feed();
+}
+
+/**
+ * Drive method for Mecanum platform.
+ *
+ * Angles are measured clockwise from the positive X axis. The robot's speed is
+ * independent from its angle or rotation rate.
+ *
+ * @param magnitude The robot's speed at a given angle [-1.0..1.0]. Forward is
+ *                  positive.
+ * @param angle     The angle around the Z axis at which the robot drives in
+ *                  degrees [-180..180].
+ * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0].
+ *                  Clockwise is positive.
+ */
+void MecanumDrive::DrivePolar(double magnitude, double angle,
+                              double zRotation) {
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, 4,
+               HALUsageReporting::kRobotDrive_MecanumPolar);
+    reported = true;
+  }
+
+  DriveCartesian(magnitude * std::sin(angle * (kPi / 180.0)),
+                 magnitude * std::cos(angle * (kPi / 180.0)), zRotation, 0.0);
+}
+
+void MecanumDrive::StopMotor() {
+  m_frontLeftMotor.StopMotor();
+  m_frontRightMotor.StopMotor();
+  m_rearLeftMotor.StopMotor();
+  m_rearRightMotor.StopMotor();
+  m_safetyHelper.Feed();
+}
+
+void MecanumDrive::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "MecanumDrive";
+}
+
+void MecanumDrive::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("MecanumDrive");
+  builder.AddDoubleProperty("Front Left Motor Speed",
+                            [=]() { return m_frontLeftMotor.Get(); },
+                            [=](double value) { m_frontLeftMotor.Set(value); });
+  builder.AddDoubleProperty(
+      "Front Right Motor Speed", [=]() { return m_frontRightMotor.Get(); },
+      [=](double value) { m_frontRightMotor.Set(value); });
+  builder.AddDoubleProperty("Rear Left Motor Speed",
+                            [=]() { return m_rearLeftMotor.Get(); },
+                            [=](double value) { m_rearLeftMotor.Set(value); });
+  builder.AddDoubleProperty("Rear Right Motor Speed",
+                            [=]() { return m_rearRightMotor.Get(); },
+                            [=](double value) { m_rearRightMotor.Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp
new file mode 100644
index 0000000..fee4387
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/RobotDriveBase.cpp
@@ -0,0 +1,107 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Drive/RobotDriveBase.h"
+
+#include <algorithm>
+#include <cmath>
+#include <cstddef>
+
+#include <HAL/HAL.h>
+
+#include "Base.h"
+#include "SpeedController.h"
+
+using namespace frc;
+
+RobotDriveBase::RobotDriveBase() { m_safetyHelper.SetSafetyEnabled(true); }
+
+/**
+ * Change the default value for deadband scaling. The default value is
+ * 0.02. Values smaller then the deadband are set to 0, while values
+ * larger then the deadband are scaled from 0.0 to 1.0. See ApplyDeadband().
+ *
+ * @param deadband The deadband to set.
+ */
+void RobotDriveBase::SetDeadband(double deadband) { m_deadband = deadband; }
+
+/**
+ * Configure the scaling factor for using RobotDrive with motor controllers in a
+ * mode other than PercentVbus or to limit the maximum output.
+ *
+ * @param maxOutput Multiplied with the output percentage computed by the drive
+ *                  functions.
+ */
+void RobotDriveBase::SetMaxOutput(double maxOutput) { m_maxOutput = maxOutput; }
+
+void RobotDriveBase::SetExpiration(double timeout) {
+  m_safetyHelper.SetExpiration(timeout);
+}
+
+double RobotDriveBase::GetExpiration() const {
+  return m_safetyHelper.GetExpiration();
+}
+
+bool RobotDriveBase::IsAlive() const { return m_safetyHelper.IsAlive(); }
+
+bool RobotDriveBase::IsSafetyEnabled() const {
+  return m_safetyHelper.IsSafetyEnabled();
+}
+
+void RobotDriveBase::SetSafetyEnabled(bool enabled) {
+  m_safetyHelper.SetSafetyEnabled(enabled);
+}
+
+/**
+ * Limit motor values to the -1.0 to +1.0 range.
+ */
+double RobotDriveBase::Limit(double value) {
+  if (value > 1.0) {
+    return 1.0;
+  }
+  if (value < -1.0) {
+    return -1.0;
+  }
+  return value;
+}
+
+/**
+ * Returns 0.0 if the given value is within the specified range around zero. The
+ * remaining range between the deadband and 1.0 is scaled from 0.0 to 1.0.
+ *
+ * @param value    value to clip
+ * @param deadband range around zero
+ */
+double RobotDriveBase::ApplyDeadband(double value, double deadband) {
+  if (std::abs(value) > deadband) {
+    if (value > 0.0) {
+      return (value - deadband) / (1.0 - deadband);
+    } else {
+      return (value + deadband) / (1.0 - deadband);
+    }
+  } else {
+    return 0.0;
+  }
+}
+
+/**
+ * Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.
+ */
+void RobotDriveBase::Normalize(llvm::MutableArrayRef<double> wheelSpeeds) {
+  double maxMagnitude = std::abs(wheelSpeeds[0]);
+  for (size_t i = 1; i < wheelSpeeds.size(); i++) {
+    double temp = std::abs(wheelSpeeds[i]);
+    if (maxMagnitude < temp) {
+      maxMagnitude = temp;
+    }
+  }
+  if (maxMagnitude > 1.0) {
+    for (size_t i = 0; i < wheelSpeeds.size(); i++) {
+      wheelSpeeds[i] = wheelSpeeds[i] / maxMagnitude;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/Vector2d.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/Vector2d.cpp
new file mode 100644
index 0000000..7c26486
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Drive/Vector2d.cpp
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Drive/Vector2d.h"
+
+#include <cmath>
+
+using namespace frc;
+
+constexpr double kPi = 3.14159265358979323846;
+
+Vector2d::Vector2d(double x, double y) {
+  this->x = x;
+  this->y = y;
+}
+
+/**
+ * Rotate a vector in Cartesian space.
+ *
+ * @param angle angle in degrees by which to rotate vector counter-clockwise.
+ */
+void Vector2d::Rotate(double angle) {
+  double cosA = std::cos(angle * (kPi / 180.0));
+  double sinA = std::sin(angle * (kPi / 180.0));
+  double out[2];
+  out[0] = x * cosA - y * sinA;
+  out[1] = x * sinA + y * cosA;
+  x = out[0];
+  y = out[1];
+}
+
+/**
+ * Returns dot product of this vector with argument.
+ *
+ * @param vec Vector with which to perform dot product.
+ */
+double Vector2d::Dot(const Vector2d& vec) const {
+  return x * vec.x + y * vec.y;
+}
+
+/**
+ * Returns magnitude of vector.
+ */
+double Vector2d::Magnitude() const { return std::sqrt(x * x + y * y); }
+
+/**
+ * Returns scalar projection of this vector onto argument.
+ *
+ * @param vec Vector onto which to project this vector.
+ */
+double Vector2d::ScalarProject(const Vector2d& vec) const {
+  return Dot(vec) / vec.Magnitude();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DriverStation.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DriverStation.cpp
new file mode 100644
index 0000000..88329ca
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/DriverStation.cpp
@@ -0,0 +1,917 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriverStation.h"
+
+#include <chrono>
+
+#include <HAL/HAL.h>
+#include <HAL/Power.h>
+#include <HAL/cpp/Log.h>
+#include <llvm/SmallString.h>
+#include <llvm/StringRef.h>
+#include <networktables/NetworkTable.h>
+#include <networktables/NetworkTableEntry.h>
+#include <networktables/NetworkTableInstance.h>
+
+#include "AnalogInput.h"
+#include "MotorSafetyHelper.h"
+#include "Timer.h"
+#include "Utility.h"
+#include "WPIErrors.h"
+
+namespace frc {
+struct MatchInfoData {
+  std::string eventName;
+  std::string gameSpecificMessage;
+  int matchNumber = 0;
+  int replayNumber = 0;
+  DriverStation::MatchType matchType = DriverStation::MatchType::kNone;
+};
+
+class MatchDataSender {
+ public:
+  std::shared_ptr<nt::NetworkTable> table;
+  nt::NetworkTableEntry typeMetadata;
+  nt::NetworkTableEntry gameSpecificMessage;
+  nt::NetworkTableEntry eventName;
+  nt::NetworkTableEntry matchNumber;
+  nt::NetworkTableEntry replayNumber;
+  nt::NetworkTableEntry matchType;
+  nt::NetworkTableEntry alliance;
+  nt::NetworkTableEntry station;
+  nt::NetworkTableEntry controlWord;
+
+  MatchDataSender() {
+    table = nt::NetworkTableInstance::GetDefault().GetTable("FMSInfo");
+    typeMetadata = table->GetEntry(".type");
+    typeMetadata.ForceSetString("FMSInfo");
+    gameSpecificMessage = table->GetEntry("GameSpecificMessage");
+    gameSpecificMessage.ForceSetString("");
+    eventName = table->GetEntry("EventName");
+    eventName.ForceSetString("");
+    matchNumber = table->GetEntry("MatchNumber");
+    matchNumber.ForceSetDouble(0);
+    replayNumber = table->GetEntry("ReplayNumber");
+    replayNumber.ForceSetDouble(0);
+    matchType = table->GetEntry("MatchType");
+    matchType.ForceSetDouble(0);
+    alliance = table->GetEntry("IsRedAlliance");
+    alliance.ForceSetBoolean(true);
+    station = table->GetEntry("StationNumber");
+    station.ForceSetDouble(1);
+    controlWord = table->GetEntry("FMSControlData");
+    controlWord.ForceSetDouble(0);
+  }
+};
+}  // namespace frc
+
+using namespace frc;
+
+static constexpr double kJoystickUnpluggedMessageInterval = 1.0;
+
+DriverStation::~DriverStation() {
+  m_isRunning = false;
+  // Trigger a DS mutex release in case there is no driver station running.
+  HAL_ReleaseDSMutex();
+  m_dsThread.join();
+}
+
+/**
+ * Return a pointer to the singleton DriverStation.
+ *
+ * @return Pointer to the DS instance
+ */
+DriverStation& DriverStation::GetInstance() {
+  static DriverStation instance;
+  return instance;
+}
+
+/**
+ * Report an error to the DriverStation messages window.
+ *
+ * The error is also printed to the program console.
+ */
+void DriverStation::ReportError(const llvm::Twine& error) {
+  llvm::SmallString<128> temp;
+  HAL_SendError(1, 1, 0, error.toNullTerminatedStringRef(temp).data(), "", "",
+                1);
+}
+
+/**
+ * Report a warning to the DriverStation messages window.
+ *
+ * The warning is also printed to the program console.
+ */
+void DriverStation::ReportWarning(const llvm::Twine& error) {
+  llvm::SmallString<128> temp;
+  HAL_SendError(0, 1, 0, error.toNullTerminatedStringRef(temp).data(), "", "",
+                1);
+}
+
+/**
+ * Report an error to the DriverStation messages window.
+ *
+ * The error is also printed to the program console.
+ */
+void DriverStation::ReportError(bool isError, int32_t code,
+                                const llvm::Twine& error,
+                                const llvm::Twine& location,
+                                const llvm::Twine& stack) {
+  llvm::SmallString<128> errorTemp;
+  llvm::SmallString<128> locationTemp;
+  llvm::SmallString<128> stackTemp;
+  HAL_SendError(isError, code, 0,
+                error.toNullTerminatedStringRef(errorTemp).data(),
+                location.toNullTerminatedStringRef(locationTemp).data(),
+                stack.toNullTerminatedStringRef(stackTemp).data(), 1);
+}
+
+/**
+ * The state of one joystick button. Button indexes begin at 1.
+ *
+ * @param stick  The joystick to read.
+ * @param button The button index, beginning at 1.
+ * @return The state of the joystick button.
+ */
+bool DriverStation::GetStickButton(int stick, int button) {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return false;
+  }
+  if (button == 0) {
+    ReportJoystickUnpluggedError(
+        "ERROR: Button indexes begin at 1 in WPILib for C++ and Java");
+    return false;
+  }
+  std::unique_lock<wpi::mutex> lock(m_cacheDataMutex);
+  if (button > m_joystickButtons[stick].count) {
+    // Unlock early so error printing isn't locked.
+    lock.unlock();
+    ReportJoystickUnpluggedWarning(
+        "Joystick Button missing, check if all controllers are "
+        "plugged in");
+    return false;
+  }
+
+  return m_joystickButtons[stick].buttons & 1 << (button - 1);
+}
+
+/**
+ * Whether one joystick button was pressed since the last check. Button indexes
+ * begin at 1.
+ *
+ * @param stick  The joystick to read.
+ * @param button The button index, beginning at 1.
+ * @return Whether the joystick button was pressed since the last check.
+ */
+bool DriverStation::GetStickButtonPressed(int stick, int button) {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return false;
+  }
+  if (button == 0) {
+    ReportJoystickUnpluggedError(
+        "ERROR: Button indexes begin at 1 in WPILib for C++ and Java");
+    return false;
+  }
+  std::unique_lock<wpi::mutex> lock(m_cacheDataMutex);
+  if (button > m_joystickButtons[stick].count) {
+    // Unlock early so error printing isn't locked.
+    lock.unlock();
+    ReportJoystickUnpluggedWarning(
+        "Joystick Button missing, check if all controllers are "
+        "plugged in");
+    return false;
+  }
+
+  // If button was pressed, clear flag and return true
+  if (m_joystickButtonsPressed[stick] & 1 << (button - 1)) {
+    m_joystickButtonsPressed[stick] &= ~(1 << (button - 1));
+    return true;
+  } else {
+    return false;
+  }
+}
+
+/**
+ * Whether one joystick button was released since the last check. Button indexes
+ * begin at 1.
+ *
+ * @param stick  The joystick to read.
+ * @param button The button index, beginning at 1.
+ * @return Whether the joystick button was released since the last check.
+ */
+bool DriverStation::GetStickButtonReleased(int stick, int button) {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return false;
+  }
+  if (button == 0) {
+    ReportJoystickUnpluggedError(
+        "ERROR: Button indexes begin at 1 in WPILib for C++ and Java");
+    return false;
+  }
+  std::unique_lock<wpi::mutex> lock(m_cacheDataMutex);
+  if (button > m_joystickButtons[stick].count) {
+    // Unlock early so error printing isn't locked.
+    lock.unlock();
+    ReportJoystickUnpluggedWarning(
+        "Joystick Button missing, check if all controllers are "
+        "plugged in");
+    return false;
+  }
+
+  // If button was released, clear flag and return true
+  if (m_joystickButtonsReleased[stick] & 1 << (button - 1)) {
+    m_joystickButtonsReleased[stick] &= ~(1 << (button - 1));
+    return true;
+  } else {
+    return false;
+  }
+}
+
+/**
+ * Get the value of the axis on a joystick.
+ *
+ * This depends on the mapping of the joystick connected to the specified port.
+ *
+ * @param stick The joystick to read.
+ * @param axis  The analog axis value to read from the joystick.
+ * @return The value of the axis on the joystick.
+ */
+double DriverStation::GetStickAxis(int stick, int axis) {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return 0;
+  }
+  std::unique_lock<wpi::mutex> lock(m_cacheDataMutex);
+  if (axis >= m_joystickAxes[stick].count) {
+    // Unlock early so error printing isn't locked.
+    m_cacheDataMutex.unlock();
+    lock.release();
+    if (axis >= HAL_kMaxJoystickAxes)
+      wpi_setWPIError(BadJoystickAxis);
+    else
+      ReportJoystickUnpluggedWarning(
+          "Joystick Axis missing, check if all controllers are plugged in");
+    return 0.0;
+  }
+
+  return m_joystickAxes[stick].axes[axis];
+}
+
+/**
+ * Get the state of a POV on the joystick.
+ *
+ * @return the angle of the POV in degrees, or -1 if the POV is not pressed.
+ */
+int DriverStation::GetStickPOV(int stick, int pov) {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return -1;
+  }
+  std::unique_lock<wpi::mutex> lock(m_cacheDataMutex);
+  if (pov >= m_joystickPOVs[stick].count) {
+    // Unlock early so error printing isn't locked.
+    lock.unlock();
+    if (pov >= HAL_kMaxJoystickPOVs)
+      wpi_setWPIError(BadJoystickAxis);
+    else
+      ReportJoystickUnpluggedWarning(
+          "Joystick POV missing, check if all controllers are plugged in");
+    return -1;
+  }
+
+  return m_joystickPOVs[stick].povs[pov];
+}
+
+/**
+ * The state of the buttons on the joystick.
+ *
+ * @param stick The joystick to read.
+ * @return The state of the buttons on the joystick.
+ */
+int DriverStation::GetStickButtons(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return 0;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_joystickButtons[stick].buttons;
+}
+
+/**
+ * Returns the number of axes on a given joystick port.
+ *
+ * @param stick The joystick port number
+ * @return The number of axes on the indicated joystick
+ */
+int DriverStation::GetStickAxisCount(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return 0;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_joystickAxes[stick].count;
+}
+
+/**
+ * Returns the number of POVs on a given joystick port.
+ *
+ * @param stick The joystick port number
+ * @return The number of POVs on the indicated joystick
+ */
+int DriverStation::GetStickPOVCount(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return 0;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_joystickPOVs[stick].count;
+}
+
+/**
+ * Returns the number of buttons on a given joystick port.
+ *
+ * @param stick The joystick port number
+ * @return The number of buttons on the indicated joystick
+ */
+int DriverStation::GetStickButtonCount(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return 0;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_joystickButtons[stick].count;
+}
+
+/**
+ * Returns a boolean indicating if the controller is an xbox controller.
+ *
+ * @param stick The joystick port number
+ * @return A boolean that is true if the controller is an xbox controller.
+ */
+bool DriverStation::GetJoystickIsXbox(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return false;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return static_cast<bool>(m_joystickDescriptor[stick].isXbox);
+}
+
+/**
+ * Returns the type of joystick at a given port.
+ *
+ * @param stick The joystick port number
+ * @return The HID type of joystick at the given port
+ */
+int DriverStation::GetJoystickType(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return -1;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return static_cast<int>(m_joystickDescriptor[stick].type);
+}
+
+/**
+ * Returns the name of the joystick at the given port.
+ *
+ * @param stick The joystick port number
+ * @return The name of the joystick at the given port
+ */
+std::string DriverStation::GetJoystickName(int stick) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  std::string retVal(m_joystickDescriptor[stick].name);
+  return retVal;
+}
+
+/**
+ * Returns the types of Axes on a given joystick port.
+ *
+ * @param stick The joystick port number and the target axis
+ * @return What type of axis the axis is reporting to be
+ */
+int DriverStation::GetJoystickAxisType(int stick, int axis) const {
+  if (stick >= kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+    return -1;
+  }
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_joystickDescriptor[stick].axisTypes[axis];
+}
+
+/**
+ * Check if the DS has enabled the robot.
+ *
+ * @return True if the robot is enabled and the DS is connected
+ */
+bool DriverStation::IsEnabled() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return controlWord.enabled && controlWord.dsAttached;
+}
+
+/**
+ * Check if the robot is disabled.
+ *
+ * @return True if the robot is explicitly disabled or the DS is not connected
+ */
+bool DriverStation::IsDisabled() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return !(controlWord.enabled && controlWord.dsAttached);
+}
+
+/**
+ * Check if the DS is commanding autonomous mode.
+ *
+ * @return True if the robot is being commanded to be in autonomous mode
+ */
+bool DriverStation::IsAutonomous() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return controlWord.autonomous;
+}
+
+/**
+ * Check if the DS is commanding teleop mode.
+ *
+ * @return True if the robot is being commanded to be in teleop mode
+ */
+bool DriverStation::IsOperatorControl() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return !(controlWord.autonomous || controlWord.test);
+}
+
+/**
+ * Check if the DS is commanding test mode.
+ *
+ * @return True if the robot is being commanded to be in test mode
+ */
+bool DriverStation::IsTest() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return controlWord.test;
+}
+
+/**
+ * Check if the DS is attached.
+ *
+ * @return True if the DS is connected to the robot
+ */
+bool DriverStation::IsDSAttached() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return controlWord.dsAttached;
+}
+
+/**
+ * Has a new control packet from the driver station arrived since the last time
+ * this function was called?
+ *
+ * Warning: If you call this function from more than one place at the same time,
+ * you will not get the intended behavior.
+ *
+ * @return True if the control data has been updated since the last call.
+ */
+bool DriverStation::IsNewControlData() const { return HAL_IsNewControlData(); }
+
+/**
+ * Is the driver station attached to a Field Management System?
+ *
+ * @return True if the robot is competing on a field being controlled by a Field
+ *         Management System
+ */
+bool DriverStation::IsFMSAttached() const {
+  HAL_ControlWord controlWord;
+  UpdateControlWord(false, controlWord);
+  return controlWord.fmsAttached;
+}
+
+/**
+ * Check if the FPGA outputs are enabled.
+ *
+ * The outputs may be disabled if the robot is disabled or e-stopped, the
+ * watchdog has expired, or if the roboRIO browns out.
+ *
+ * @return True if the FPGA outputs are enabled.
+ * @deprecated Use RobotController static class method
+ */
+bool DriverStation::IsSysActive() const {
+  int32_t status = 0;
+  bool retVal = HAL_GetSystemActive(&status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Check if the system is browned out.
+ *
+ * @return True if the system is browned out
+ * @deprecated Use RobotController static class method
+ */
+bool DriverStation::IsBrownedOut() const {
+  int32_t status = 0;
+  bool retVal = HAL_GetBrownedOut(&status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+std::string DriverStation::GetGameSpecificMessage() const {
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_matchInfo->gameSpecificMessage;
+}
+
+std::string DriverStation::GetEventName() const {
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_matchInfo->eventName;
+}
+
+DriverStation::MatchType DriverStation::GetMatchType() const {
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_matchInfo->matchType;
+}
+
+int DriverStation::GetMatchNumber() const {
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_matchInfo->matchNumber;
+}
+
+int DriverStation::GetReplayNumber() const {
+  std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+  return m_matchInfo->replayNumber;
+}
+
+/**
+ * Return the alliance that the driver station says it is on.
+ *
+ * This could return kRed or kBlue.
+ *
+ * @return The Alliance enum (kRed, kBlue or kInvalid)
+ */
+DriverStation::Alliance DriverStation::GetAlliance() const {
+  int32_t status = 0;
+  auto allianceStationID = HAL_GetAllianceStation(&status);
+  switch (allianceStationID) {
+    case HAL_AllianceStationID_kRed1:
+    case HAL_AllianceStationID_kRed2:
+    case HAL_AllianceStationID_kRed3:
+      return kRed;
+    case HAL_AllianceStationID_kBlue1:
+    case HAL_AllianceStationID_kBlue2:
+    case HAL_AllianceStationID_kBlue3:
+      return kBlue;
+    default:
+      return kInvalid;
+  }
+}
+
+/**
+ * Return the driver station location on the field.
+ *
+ * This could return 1, 2, or 3.
+ *
+ * @return The location of the driver station (1-3, 0 for invalid)
+ */
+int DriverStation::GetLocation() const {
+  int32_t status = 0;
+  auto allianceStationID = HAL_GetAllianceStation(&status);
+  switch (allianceStationID) {
+    case HAL_AllianceStationID_kRed1:
+    case HAL_AllianceStationID_kBlue1:
+      return 1;
+    case HAL_AllianceStationID_kRed2:
+    case HAL_AllianceStationID_kBlue2:
+      return 2;
+    case HAL_AllianceStationID_kRed3:
+    case HAL_AllianceStationID_kBlue3:
+      return 3;
+    default:
+      return 0;
+  }
+}
+
+/**
+ * Wait until a new packet comes from the driver station.
+ *
+ * This blocks on a semaphore, so the waiting is efficient.
+ *
+ * This is a good way to delay processing until there is new driver station data
+ * to act on.
+ */
+void DriverStation::WaitForData() { WaitForData(0); }
+
+/**
+ * Wait until a new packet comes from the driver station, or wait for a timeout.
+ *
+ * If the timeout is less then or equal to 0, wait indefinitely.
+ *
+ * Timeout is in milliseconds
+ *
+ * This blocks on a semaphore, so the waiting is efficient.
+ *
+ * This is a good way to delay processing until there is new driver station data
+ * to act on.
+ *
+ * @param timeout Timeout time in seconds
+ *
+ * @return true if new data, otherwise false
+ */
+bool DriverStation::WaitForData(double timeout) {
+  auto timeoutTime =
+      std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
+
+  std::unique_lock<wpi::mutex> lock(m_waitForDataMutex);
+  int currentCount = m_waitForDataCounter;
+  while (m_waitForDataCounter == currentCount) {
+    if (timeout > 0) {
+      auto timedOut = m_waitForDataCond.wait_until(lock, timeoutTime);
+      if (timedOut == std::cv_status::timeout) {
+        return false;
+      }
+    } else {
+      m_waitForDataCond.wait(lock);
+    }
+  }
+  return true;
+}
+
+/**
+ * Return the approximate match time.
+ *
+ * The FMS does not send an official match time to the robots, but does send an
+ * approximate match time.  The value will count down the time remaining in the
+ * current period (auto or teleop).
+ *
+ * Warning: This is not an official time (so it cannot be used to dispute ref
+ * calls or guarantee that a function will trigger before the match ends).
+ *
+ * The Practice Match function of the DS approximates the behaviour seen on the
+ * field.
+ *
+ * @return Time remaining in current match period (auto or teleop)
+ */
+double DriverStation::GetMatchTime() const {
+  int32_t status;
+  return HAL_GetMatchTime(&status);
+}
+
+/**
+ * Read the battery voltage.
+ *
+ * @return The battery voltage in Volts.
+ */
+double DriverStation::GetBatteryVoltage() const {
+  int32_t status = 0;
+  double voltage = HAL_GetVinVoltage(&status);
+  wpi_setErrorWithContext(status, "getVinVoltage");
+
+  return voltage;
+}
+
+void DriverStation::SendMatchData() {
+  int32_t status = 0;
+  HAL_AllianceStationID alliance = HAL_GetAllianceStation(&status);
+  bool isRedAlliance = false;
+  int stationNumber = 1;
+  switch (alliance) {
+    case HAL_AllianceStationID::HAL_AllianceStationID_kBlue1:
+      isRedAlliance = false;
+      stationNumber = 1;
+      break;
+    case HAL_AllianceStationID::HAL_AllianceStationID_kBlue2:
+      isRedAlliance = false;
+      stationNumber = 2;
+      break;
+    case HAL_AllianceStationID::HAL_AllianceStationID_kBlue3:
+      isRedAlliance = false;
+      stationNumber = 3;
+      break;
+    case HAL_AllianceStationID::HAL_AllianceStationID_kRed1:
+      isRedAlliance = true;
+      stationNumber = 1;
+      break;
+    case HAL_AllianceStationID::HAL_AllianceStationID_kRed2:
+      isRedAlliance = true;
+      stationNumber = 2;
+      break;
+    default:
+      isRedAlliance = true;
+      stationNumber = 3;
+      break;
+  }
+
+  MatchInfoData tmpDataStore;
+  {
+    std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+    tmpDataStore = *m_matchInfo;
+  }
+
+  m_matchDataSender->alliance.SetBoolean(isRedAlliance);
+  m_matchDataSender->station.SetDouble(stationNumber);
+  m_matchDataSender->eventName.SetString(tmpDataStore.eventName);
+  m_matchDataSender->gameSpecificMessage.SetString(
+      tmpDataStore.gameSpecificMessage);
+  m_matchDataSender->matchNumber.SetDouble(tmpDataStore.matchNumber);
+  m_matchDataSender->replayNumber.SetDouble(tmpDataStore.replayNumber);
+  m_matchDataSender->matchType.SetDouble(
+      static_cast<int>(tmpDataStore.matchType));
+
+  HAL_ControlWord ctlWord;
+  {
+    // Valid, as in other places we guarentee ctlWord >= int32
+    std::lock_guard<wpi::mutex> lock(m_controlWordMutex);
+    ctlWord = m_controlWordCache;
+  }
+  int32_t wordInt = 0;
+  std::memcpy(&wordInt, &ctlWord, sizeof(wordInt));
+  m_matchDataSender->controlWord.SetDouble(wordInt);
+}
+
+/**
+ * Copy data from the DS task for the user.
+ *
+ * If no new data exists, it will just be returned, otherwise
+ * the data will be copied from the DS polling loop.
+ */
+void DriverStation::GetData() {
+  // Get the status of all of the joysticks, and save to the cache
+  for (uint8_t stick = 0; stick < kJoystickPorts; stick++) {
+    HAL_GetJoystickAxes(stick, &m_joystickAxesCache[stick]);
+    HAL_GetJoystickPOVs(stick, &m_joystickPOVsCache[stick]);
+    HAL_GetJoystickButtons(stick, &m_joystickButtonsCache[stick]);
+    HAL_GetJoystickDescriptor(stick, &m_joystickDescriptorCache[stick]);
+  }
+  // Grab match specific data
+  HAL_MatchInfo matchInfo;
+  auto status = HAL_GetMatchInfo(&matchInfo);
+  if (status == 0) {
+    m_matchInfoCache->eventName = matchInfo.eventName;
+    m_matchInfoCache->matchNumber = matchInfo.matchNumber;
+    m_matchInfoCache->replayNumber = matchInfo.replayNumber;
+    m_matchInfoCache->matchType =
+        static_cast<DriverStation::MatchType>(matchInfo.matchType);
+    m_matchInfoCache->gameSpecificMessage = matchInfo.gameSpecificMessage;
+  }
+  HAL_FreeMatchInfo(&matchInfo);
+
+  // Force a control word update, to make sure the data is the newest.
+  HAL_ControlWord controlWord;
+  UpdateControlWord(true, controlWord);
+
+  {
+    // Obtain a write lock on the data, swap the cached data into the
+    // main data arrays
+    std::lock_guard<wpi::mutex> lock(m_cacheDataMutex);
+
+    for (int32_t i = 0; i < kJoystickPorts; i++) {
+      // If buttons weren't pressed and are now, set flags in m_buttonsPressed
+      m_joystickButtonsPressed[i] |=
+          ~m_joystickButtons[i].buttons & m_joystickButtonsCache[i].buttons;
+
+      // If buttons were pressed and aren't now, set flags in m_buttonsReleased
+      m_joystickButtonsReleased[i] |=
+          m_joystickButtons[i].buttons & ~m_joystickButtonsCache[i].buttons;
+    }
+
+    m_joystickAxes.swap(m_joystickAxesCache);
+    m_joystickPOVs.swap(m_joystickPOVsCache);
+    m_joystickButtons.swap(m_joystickButtonsCache);
+    m_joystickDescriptor.swap(m_joystickDescriptorCache);
+    m_matchInfo.swap(m_matchInfoCache);
+  }
+
+  {
+    std::lock_guard<wpi::mutex> waitLock(m_waitForDataMutex);
+    // Nofify all threads
+    m_waitForDataCounter++;
+    m_waitForDataCond.notify_all();
+  }
+
+  SendMatchData();
+}
+
+/**
+ * DriverStation constructor.
+ *
+ * This is only called once the first time GetInstance() is called
+ */
+DriverStation::DriverStation() {
+  m_waitForDataCounter = 0;
+  m_joystickAxes = std::make_unique<HAL_JoystickAxes[]>(kJoystickPorts);
+  m_joystickPOVs = std::make_unique<HAL_JoystickPOVs[]>(kJoystickPorts);
+  m_joystickButtons = std::make_unique<HAL_JoystickButtons[]>(kJoystickPorts);
+  m_joystickDescriptor =
+      std::make_unique<HAL_JoystickDescriptor[]>(kJoystickPorts);
+  m_matchInfo = std::make_unique<MatchInfoData>();
+  m_joystickAxesCache = std::make_unique<HAL_JoystickAxes[]>(kJoystickPorts);
+  m_joystickPOVsCache = std::make_unique<HAL_JoystickPOVs[]>(kJoystickPorts);
+  m_joystickButtonsCache =
+      std::make_unique<HAL_JoystickButtons[]>(kJoystickPorts);
+  m_joystickDescriptorCache =
+      std::make_unique<HAL_JoystickDescriptor[]>(kJoystickPorts);
+  m_matchInfoCache = std::make_unique<MatchInfoData>();
+
+  m_matchDataSender = std::make_unique<MatchDataSender>();
+
+  // All joysticks should default to having zero axes, povs and buttons, so
+  // uninitialized memory doesn't get sent to speed controllers.
+  for (unsigned int i = 0; i < kJoystickPorts; i++) {
+    m_joystickAxes[i].count = 0;
+    m_joystickPOVs[i].count = 0;
+    m_joystickButtons[i].count = 0;
+    m_joystickDescriptor[i].isXbox = 0;
+    m_joystickDescriptor[i].type = -1;
+    m_joystickDescriptor[i].name[0] = '\0';
+
+    m_joystickAxesCache[i].count = 0;
+    m_joystickPOVsCache[i].count = 0;
+    m_joystickButtonsCache[i].count = 0;
+    m_joystickDescriptorCache[i].isXbox = 0;
+    m_joystickDescriptorCache[i].type = -1;
+    m_joystickDescriptorCache[i].name[0] = '\0';
+
+    m_joystickButtonsPressed[i] = 0;
+    m_joystickButtonsReleased[i] = 0;
+  }
+
+  m_dsThread = std::thread(&DriverStation::Run, this);
+}
+
+/**
+ * Reports errors related to unplugged joysticks
+ * Throttles the errors so that they don't overwhelm the DS
+ */
+void DriverStation::ReportJoystickUnpluggedError(const llvm::Twine& message) {
+  double currentTime = Timer::GetFPGATimestamp();
+  if (currentTime > m_nextMessageTime) {
+    ReportError(message);
+    m_nextMessageTime = currentTime + kJoystickUnpluggedMessageInterval;
+  }
+}
+
+/**
+ * Reports errors related to unplugged joysticks.
+ *
+ * Throttles the errors so that they don't overwhelm the DS.
+ */
+void DriverStation::ReportJoystickUnpluggedWarning(const llvm::Twine& message) {
+  double currentTime = Timer::GetFPGATimestamp();
+  if (currentTime > m_nextMessageTime) {
+    ReportWarning(message);
+    m_nextMessageTime = currentTime + kJoystickUnpluggedMessageInterval;
+  }
+}
+
+void DriverStation::Run() {
+  m_isRunning = true;
+  int safetyCounter = 0;
+  while (m_isRunning) {
+    HAL_WaitForDSData();
+    GetData();
+
+    if (IsDisabled()) safetyCounter = 0;
+
+    if (++safetyCounter >= 4) {
+      MotorSafetyHelper::CheckMotors();
+      safetyCounter = 0;
+    }
+    if (m_userInDisabled) HAL_ObserveUserProgramDisabled();
+    if (m_userInAutonomous) HAL_ObserveUserProgramAutonomous();
+    if (m_userInTeleop) HAL_ObserveUserProgramTeleop();
+    if (m_userInTest) HAL_ObserveUserProgramTest();
+  }
+}
+
+/**
+ * Gets ControlWord data from the cache. If 50ms has passed, or the force
+ * parameter is set, the cached data is updated. Otherwise the data is just
+ * copied from the cache.
+ *
+ * @param force True to force an update to the cache, otherwise update if 50ms
+ *              have passed.
+ * @param controlWord Structure to put the return control word data into.
+ */
+void DriverStation::UpdateControlWord(bool force,
+                                      HAL_ControlWord& controlWord) const {
+  auto now = std::chrono::steady_clock::now();
+  std::lock_guard<wpi::mutex> lock(m_controlWordMutex);
+  // Update every 50 ms or on force.
+  if ((now - m_lastControlWordUpdate > std::chrono::milliseconds(50)) ||
+      force) {
+    HAL_GetControlWord(&m_controlWordCache);
+    m_lastControlWordUpdate = now;
+  }
+  controlWord = m_controlWordCache;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Encoder.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Encoder.cpp
new file mode 100644
index 0000000..5cc40de
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Encoder.cpp
@@ -0,0 +1,511 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Encoder.h"
+
+#include <HAL/HAL.h>
+
+#include "DigitalInput.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Common initialization code for Encoders.
+ *
+ * This code allocates resources for Encoders and is common to all constructors.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param reverseDirection If true, counts down instead of up (this is all
+ *                         relative)
+ * @param encodingType     either k1X, k2X, or k4X to indicate 1X, 2X or 4X
+ *                         decoding. If 4X is selected, then an encoder FPGA
+ *                         object is used and the returned counts will be 4x
+ *                         the encoder spec'd value since all rising and
+ *                         falling edges are counted. If 1X or 2X are selected
+ *                         then a counter object will be used and the returned
+ *                         value will either exactly match the spec'd count or
+ *                         be double (2x) the spec'd count.
+ */
+void Encoder::InitEncoder(bool reverseDirection, EncodingType encodingType) {
+  int32_t status = 0;
+  m_encoder = HAL_InitializeEncoder(
+      m_aSource->GetPortHandleForRouting(),
+      (HAL_AnalogTriggerType)m_aSource->GetAnalogTriggerTypeForRouting(),
+      m_bSource->GetPortHandleForRouting(),
+      (HAL_AnalogTriggerType)m_bSource->GetAnalogTriggerTypeForRouting(),
+      reverseDirection, (HAL_EncoderEncodingType)encodingType, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  HAL_Report(HALUsageReporting::kResourceType_Encoder, GetFPGAIndex(),
+             encodingType);
+  SetName("Encoder", m_aSource->GetChannel());
+}
+
+/**
+ * Encoder constructor.
+ *
+ * Construct a Encoder given a and b channels.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param aChannel         The a channel DIO channel. 0-9 are on-board, 10-25
+ *                         are on the MXP port
+ * @param bChannel         The b channel DIO channel. 0-9 are on-board, 10-25
+ *                         are on the MXP port
+ * @param reverseDirection represents the orientation of the encoder and
+ *                         inverts the output values if necessary so forward
+ *                         represents positive values.
+ * @param encodingType     either k1X, k2X, or k4X to indicate 1X, 2X or 4X
+ *                         decoding. If 4X is selected, then an encoder FPGA
+ *                         object is used and the returned counts will be 4x
+ *                         the encoder spec'd value since all rising and
+ *                         falling edges are counted. If 1X or 2X are selected
+ *                         then a counter object will be used and the returned
+ *                         value will either exactly match the spec'd count or
+ *                         be double (2x) the spec'd count.
+ */
+Encoder::Encoder(int aChannel, int bChannel, bool reverseDirection,
+                 EncodingType encodingType) {
+  m_aSource = std::make_shared<DigitalInput>(aChannel);
+  m_bSource = std::make_shared<DigitalInput>(bChannel);
+  InitEncoder(reverseDirection, encodingType);
+  AddChild(m_aSource);
+  AddChild(m_bSource);
+}
+
+/**
+ * Encoder constructor.
+ *
+ * Construct a Encoder given a and b channels as digital inputs. This is used in
+ * the case where the digital inputs are shared. The Encoder class will not
+ * allocate the digital inputs and assume that they already are counted.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param aSource          The source that should be used for the a channel.
+ * @param bSource          the source that should be used for the b channel.
+ * @param reverseDirection represents the orientation of the encoder and
+ *                         inverts the output values if necessary so forward
+ *                         represents positive values.
+ * @param encodingType     either k1X, k2X, or k4X to indicate 1X, 2X or 4X
+ *                         decoding. If 4X is selected, then an encoder FPGA
+ *                         object is used and the returned counts will be 4x
+ *                         the encoder spec'd value since all rising and
+ *                         falling edges are counted. If 1X or 2X are selected
+ *                         then a counter object will be used and the returned
+ *                         value will either exactly match the spec'd count or
+ *                         be double (2x) the spec'd count.
+ */
+Encoder::Encoder(DigitalSource* aSource, DigitalSource* bSource,
+                 bool reverseDirection, EncodingType encodingType)
+    : m_aSource(aSource, NullDeleter<DigitalSource>()),
+      m_bSource(bSource, NullDeleter<DigitalSource>()) {
+  if (m_aSource == nullptr || m_bSource == nullptr)
+    wpi_setWPIError(NullParameter);
+  else
+    InitEncoder(reverseDirection, encodingType);
+}
+
+Encoder::Encoder(std::shared_ptr<DigitalSource> aSource,
+                 std::shared_ptr<DigitalSource> bSource, bool reverseDirection,
+                 EncodingType encodingType)
+    : m_aSource(aSource), m_bSource(bSource) {
+  if (m_aSource == nullptr || m_bSource == nullptr)
+    wpi_setWPIError(NullParameter);
+  else
+    InitEncoder(reverseDirection, encodingType);
+}
+
+/**
+ * Encoder constructor.
+ *
+ * Construct a Encoder given a and b channels as digital inputs. This is used in
+ * the case where the digital inputs are shared. The Encoder class will not
+ * allocate the digital inputs and assume that they already are counted.
+ *
+ * The counter will start counting immediately.
+ *
+ * @param aSource          The source that should be used for the a channel.
+ * @param bSource          the source that should be used for the b channel.
+ * @param reverseDirection represents the orientation of the encoder and
+ *                         inverts the output values if necessary so forward
+ *                         represents positive values.
+ * @param encodingType     either k1X, k2X, or k4X to indicate 1X, 2X or 4X
+ *                         decoding. If 4X is selected, then an encoder FPGA
+ *                         object is used and the returned counts will be 4x
+ *                         the encoder spec'd value since all rising and
+ *                         falling edges are counted. If 1X or 2X are selected
+ *                         then a counter object will be used and the returned
+ *                         value will either exactly match the spec'd count or
+ *                         be double (2x) the spec'd count.
+ */
+Encoder::Encoder(DigitalSource& aSource, DigitalSource& bSource,
+                 bool reverseDirection, EncodingType encodingType)
+    : m_aSource(&aSource, NullDeleter<DigitalSource>()),
+      m_bSource(&bSource, NullDeleter<DigitalSource>()) {
+  InitEncoder(reverseDirection, encodingType);
+}
+
+/**
+ * Free the resources for an Encoder.
+ *
+ * Frees the FPGA resources associated with an Encoder.
+ */
+Encoder::~Encoder() {
+  int32_t status = 0;
+  HAL_FreeEncoder(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * The encoding scale factor 1x, 2x, or 4x, per the requested encodingType.
+ *
+ * Used to divide raw edge counts down to spec'd counts.
+ */
+int Encoder::GetEncodingScale() const {
+  int32_t status = 0;
+  int val = HAL_GetEncoderEncodingScale(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return val;
+}
+
+/**
+ * Gets the raw value from the encoder.
+ *
+ * The raw value is the actual count unscaled by the 1x, 2x, or 4x scale
+ * factor.
+ *
+ * @return Current raw count from the encoder
+ */
+int Encoder::GetRaw() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int value = HAL_GetEncoderRaw(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Gets the current count.
+ *
+ * Returns the current count on the Encoder. This method compensates for the
+ * decoding type.
+ *
+ * @return Current count from the Encoder adjusted for the 1x, 2x, or 4x scale
+ *         factor.
+ */
+int Encoder::Get() const {
+  if (StatusIsFatal()) return 0;
+  int32_t status = 0;
+  int value = HAL_GetEncoder(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Reset the Encoder distance to zero.
+ *
+ * Resets the current count to zero on the encoder.
+ */
+void Encoder::Reset() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_ResetEncoder(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Returns the period of the most recent pulse.
+ *
+ * Returns the period of the most recent Encoder pulse in seconds. This method
+ * compensates for the decoding type.
+ *
+ * Warning: This returns unscaled periods. Use GetRate() for rates that are
+ * scaled using the value from SetDistancePerPulse().
+ *
+ * @return Period in seconds of the most recent pulse.
+ */
+double Encoder::GetPeriod() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetEncoderPeriod(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Sets the maximum period for stopped detection.
+ *
+ * Sets the value that represents the maximum period of the Encoder before it
+ * will assume that the attached device is stopped. This timeout allows users
+ * to determine if the wheels or other shaft has stopped rotating.
+ * This method compensates for the decoding type.
+ *
+ * @deprecated Use SetMinRate() in favor of this method.  This takes unscaled
+ *             periods and SetMinRate() scales using value from
+ *             SetDistancePerPulse().
+ *
+ * @param maxPeriod The maximum time between rising and falling edges before
+ *                  the FPGA will report the device stopped. This is expressed
+ *                  in seconds.
+ */
+void Encoder::SetMaxPeriod(double maxPeriod) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetEncoderMaxPeriod(m_encoder, maxPeriod, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Determine if the encoder is stopped.
+ *
+ * Using the MaxPeriod value, a boolean is returned that is true if the encoder
+ * is considered stopped and false if it is still moving. A stopped encoder is
+ * one where the most recent pulse width exceeds the MaxPeriod.
+ *
+ * @return True if the encoder is considered stopped.
+ */
+bool Encoder::GetStopped() const {
+  if (StatusIsFatal()) return true;
+  int32_t status = 0;
+  bool value = HAL_GetEncoderStopped(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * The last direction the encoder value changed.
+ *
+ * @return The last direction the encoder value changed.
+ */
+bool Encoder::GetDirection() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value = HAL_GetEncoderDirection(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * The scale needed to convert a raw counter value into a number of encoder
+ * pulses.
+ */
+double Encoder::DecodingScaleFactor() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double val = HAL_GetEncoderDecodingScaleFactor(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return val;
+}
+
+/**
+ * Get the distance the robot has driven since the last reset.
+ *
+ * @return The distance driven since the last reset as scaled by the value from
+ *         SetDistancePerPulse().
+ */
+double Encoder::GetDistance() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetEncoderDistance(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Get the current rate of the encoder.
+ *
+ * Units are distance per second as scaled by the value from
+ * SetDistancePerPulse().
+ *
+ * @return The current rate of the encoder.
+ */
+double Encoder::GetRate() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double value = HAL_GetEncoderRate(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Set the minimum rate of the device before the hardware reports it stopped.
+ *
+ * @param minRate The minimum rate.  The units are in distance per second as
+ *                scaled by the value from SetDistancePerPulse().
+ */
+void Encoder::SetMinRate(double minRate) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetEncoderMinRate(m_encoder, minRate, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the distance per pulse for this encoder.
+ *
+ * This sets the multiplier used to determine the distance driven based on the
+ * count value from the encoder.
+ *
+ * Do not include the decoding type in this scale.  The library already
+ * compensates for the decoding type.
+ *
+ * Set this value based on the encoder's rated Pulses per Revolution and
+ * factor in gearing reductions following the encoder shaft.
+ *
+ * This distance can be in any units you like, linear or angular.
+ *
+ * @param distancePerPulse The scale factor that will be used to convert pulses
+ *                         to useful units.
+ */
+void Encoder::SetDistancePerPulse(double distancePerPulse) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetEncoderDistancePerPulse(m_encoder, distancePerPulse, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the distance per pulse for this encoder.
+ *
+ * @return The scale factor that will be used to convert pulses to useful units.
+ */
+double Encoder::GetDistancePerPulse() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double distancePerPulse = HAL_GetEncoderDistancePerPulse(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return distancePerPulse;
+}
+
+/**
+ * Set the direction sensing for this encoder.
+ *
+ * This sets the direction sensing on the encoder so that it could count in the
+ * correct software direction regardless of the mounting.
+ *
+ * @param reverseDirection true if the encoder direction should be reversed
+ */
+void Encoder::SetReverseDirection(bool reverseDirection) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetEncoderReverseDirection(m_encoder, reverseDirection, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period.
+ *
+ * Perform averaging to account for mechanical imperfections or as oversampling
+ * to increase resolution.
+ *
+ * @param samplesToAverage The number of samples to average from 1 to 127.
+ */
+void Encoder::SetSamplesToAverage(int samplesToAverage) {
+  if (samplesToAverage < 1 || samplesToAverage > 127) {
+    wpi_setWPIErrorWithContext(
+        ParameterOutOfRange,
+        "Average counter values must be between 1 and 127");
+    return;
+  }
+  int32_t status = 0;
+  HAL_SetEncoderSamplesToAverage(m_encoder, samplesToAverage, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the Samples to Average which specifies the number of samples of the timer
+ * to average when calculating the period.
+ *
+ * Perform averaging to account for mechanical imperfections or as oversampling
+ * to increase resolution.
+ *
+ * @return The number of samples being averaged (from 1 to 127)
+ */
+int Encoder::GetSamplesToAverage() const {
+  int32_t status = 0;
+  int result = HAL_GetEncoderSamplesToAverage(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return result;
+}
+
+/**
+ * Implement the PIDSource interface.
+ *
+ * @return The current value of the selected source parameter.
+ */
+double Encoder::PIDGet() {
+  if (StatusIsFatal()) return 0.0;
+  switch (GetPIDSourceType()) {
+    case PIDSourceType::kDisplacement:
+      return GetDistance();
+    case PIDSourceType::kRate:
+      return GetRate();
+    default:
+      return 0.0;
+  }
+}
+
+/**
+ * Set the index source for the encoder.
+ *
+ * When this source is activated, the encoder count automatically resets.
+ *
+ * @param channel A DIO channel to set as the encoder index
+ * @param type    The state that will cause the encoder to reset
+ */
+void Encoder::SetIndexSource(int channel, Encoder::IndexingType type) {
+  // Force digital input if just given an index
+  m_indexSource = std::make_shared<DigitalInput>(channel);
+  AddChild(m_indexSource);
+  SetIndexSource(*m_indexSource.get(), type);
+}
+
+/**
+ * Set the index source for the encoder.
+ *
+ * When this source is activated, the encoder count automatically resets.
+ *
+ * @param channel A digital source to set as the encoder index
+ * @param type    The state that will cause the encoder to reset
+ */
+void Encoder::SetIndexSource(const DigitalSource& source,
+                             Encoder::IndexingType type) {
+  int32_t status = 0;
+  HAL_SetEncoderIndexSource(
+      m_encoder, source.GetPortHandleForRouting(),
+      (HAL_AnalogTriggerType)source.GetAnalogTriggerTypeForRouting(),
+      (HAL_EncoderIndexingType)type, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+int Encoder::GetFPGAIndex() const {
+  int32_t status = 0;
+  int val = HAL_GetEncoderFPGAIndex(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return val;
+}
+
+void Encoder::InitSendable(SendableBuilder& builder) {
+  int32_t status = 0;
+  HAL_EncoderEncodingType type = HAL_GetEncoderEncodingType(m_encoder, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  if (type == HAL_EncoderEncodingType::HAL_Encoder_k4X)
+    builder.SetSmartDashboardType("Quadrature Encoder");
+  else
+    builder.SetSmartDashboardType("Encoder");
+
+  builder.AddDoubleProperty("Speed", [=]() { return GetRate(); }, nullptr);
+  builder.AddDoubleProperty("Distance", [=]() { return GetDistance(); },
+                            nullptr);
+  builder.AddDoubleProperty("Distance per Tick",
+                            [=]() { return GetDistancePerPulse(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Error.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Error.cpp
new file mode 100644
index 0000000..a3717ad
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Error.cpp
@@ -0,0 +1,82 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Error.h"
+
+#include <llvm/Path.h>
+
+#include "DriverStation.h"
+#include "Timer.h"
+#include "Utility.h"
+
+using namespace frc;
+
+void Error::Clone(const Error& error) {
+  m_code = error.m_code;
+  m_message = error.m_message;
+  m_filename = error.m_filename;
+  m_function = error.m_function;
+  m_lineNumber = error.m_lineNumber;
+  m_originatingObject = error.m_originatingObject;
+  m_timestamp = error.m_timestamp;
+}
+
+Error::Code Error::GetCode() const { return m_code; }
+
+std::string Error::GetMessage() const { return m_message; }
+
+std::string Error::GetFilename() const { return m_filename; }
+
+std::string Error::GetFunction() const { return m_function; }
+
+int Error::GetLineNumber() const { return m_lineNumber; }
+
+const ErrorBase* Error::GetOriginatingObject() const {
+  return m_originatingObject;
+}
+
+double Error::GetTimestamp() const { return m_timestamp; }
+
+void Error::Set(Code code, const llvm::Twine& contextMessage,
+                llvm::StringRef filename, llvm::StringRef function,
+                int lineNumber, const ErrorBase* originatingObject) {
+  bool report = true;
+
+  if (code == m_code && GetTime() - m_timestamp < 1) {
+    report = false;
+  }
+
+  m_code = code;
+  m_message = contextMessage.str();
+  m_filename = filename;
+  m_function = function;
+  m_lineNumber = lineNumber;
+  m_originatingObject = originatingObject;
+
+  if (report) {
+    m_timestamp = GetTime();
+    Report();
+  }
+}
+
+void Error::Report() {
+  DriverStation::ReportError(
+      true, m_code, m_message,
+      m_function + llvm::Twine(" [") + llvm::sys::path::filename(m_filename) +
+          llvm::Twine(':') + llvm::Twine(m_lineNumber) + llvm::Twine(']'),
+      GetStackTrace(4));
+}
+
+void Error::Clear() {
+  m_code = 0;
+  m_message = "";
+  m_filename = "";
+  m_function = "";
+  m_lineNumber = 0;
+  m_originatingObject = nullptr;
+  m_timestamp = 0.0;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ErrorBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ErrorBase.cpp
new file mode 100644
index 0000000..358e85b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/ErrorBase.cpp
@@ -0,0 +1,230 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ErrorBase.h"
+
+#include <cerrno>
+#include <cstdio>
+#include <cstring>
+
+#include <HAL/HAL.h>
+
+#define WPI_ERRORS_DEFINE_STRINGS
+#include "WPIErrors.h"
+#include "llvm/Format.h"
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+
+using namespace frc;
+
+wpi::mutex ErrorBase::_globalErrorMutex;
+Error ErrorBase::_globalError;
+
+ErrorBase::ErrorBase() { HAL_Initialize(500, 0); }
+
+/**
+ * @brief Retrieve the current error.
+ *
+ * Get the current error information associated with this sensor.
+ */
+Error& ErrorBase::GetError() { return m_error; }
+
+const Error& ErrorBase::GetError() const { return m_error; }
+
+/**
+ * @brief Clear the current error information associated with this sensor.
+ */
+void ErrorBase::ClearError() const { m_error.Clear(); }
+
+/**
+ * @brief Set error information associated with a C library call that set an
+ *        error to the "errno" global variable.
+ *
+ * @param contextMessage A custom message from the code that set the error.
+ * @param filename       Filename of the error source
+ * @param function       Function of the error source
+ * @param lineNumber     Line number of the error source
+ */
+void ErrorBase::SetErrnoError(const llvm::Twine& contextMessage,
+                              llvm::StringRef filename,
+                              llvm::StringRef function, int lineNumber) const {
+  llvm::SmallString<128> buf;
+  llvm::raw_svector_ostream err(buf);
+  int errNo = errno;
+  if (errNo == 0) {
+    err << "OK: ";
+  } else {
+    err << std::strerror(errNo) << " (" << llvm::format_hex(errNo, 10, true)
+        << "): ";
+  }
+
+  // Set the current error information for this object.
+  m_error.Set(-1, err.str() + contextMessage, filename, function, lineNumber,
+              this);
+
+  // Update the global error if there is not one already set.
+  std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+  if (_globalError.GetCode() == 0) {
+    _globalError.Clone(m_error);
+  }
+}
+
+/**
+ * @brief Set the current error information associated from the nivision Imaq
+ *        API.
+ *
+ * @param success        The return from the function
+ * @param contextMessage A custom message from the code that set the error.
+ * @param filename       Filename of the error source
+ * @param function       Function of the error source
+ * @param lineNumber     Line number of the error source
+ */
+void ErrorBase::SetImaqError(int success, const llvm::Twine& contextMessage,
+                             llvm::StringRef filename, llvm::StringRef function,
+                             int lineNumber) const {
+  // If there was an error
+  if (success <= 0) {
+    // Set the current error information for this object.
+    m_error.Set(success, llvm::Twine(success) + ": " + contextMessage, filename,
+                function, lineNumber, this);
+
+    // Update the global error if there is not one already set.
+    std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+    if (_globalError.GetCode() == 0) {
+      _globalError.Clone(m_error);
+    }
+  }
+}
+
+/**
+ * @brief Set the current error information associated with this sensor.
+ *
+ * @param code           The error code
+ * @param contextMessage A custom message from the code that set the error.
+ * @param filename       Filename of the error source
+ * @param function       Function of the error source
+ * @param lineNumber     Line number of the error source
+ */
+void ErrorBase::SetError(Error::Code code, const llvm::Twine& contextMessage,
+                         llvm::StringRef filename, llvm::StringRef function,
+                         int lineNumber) const {
+  //  If there was an error
+  if (code != 0) {
+    //  Set the current error information for this object.
+    m_error.Set(code, contextMessage, filename, function, lineNumber, this);
+
+    // Update the global error if there is not one already set.
+    std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+    if (_globalError.GetCode() == 0) {
+      _globalError.Clone(m_error);
+    }
+  }
+}
+
+/**
+ * @brief Set the current error information associated with this sensor.
+ * Range versions use for initialization code.
+ *
+ * @param code           The error code
+ * @param minRange       The minimum allowed allocation range
+ * @param maxRange       The maximum allowed allocation range
+ * @param requestedValue The requested value to allocate
+ * @param contextMessage A custom message from the code that set the error.
+ * @param filename       Filename of the error source
+ * @param function       Function of the error source
+ * @param lineNumber     Line number of the error source
+ */
+void ErrorBase::SetErrorRange(Error::Code code, int32_t minRange,
+                              int32_t maxRange, int32_t requestedValue,
+                              const llvm::Twine& contextMessage,
+                              llvm::StringRef filename,
+                              llvm::StringRef function, int lineNumber) const {
+  //  If there was an error
+  if (code != 0) {
+    //  Set the current error information for this object.
+    m_error.Set(code,
+                contextMessage + ", Minimum Value: " + llvm::Twine(minRange) +
+                    ", MaximumValue: " + llvm::Twine(maxRange) +
+                    ", Requested Value: " + llvm::Twine(requestedValue),
+                filename, function, lineNumber, this);
+
+    // Update the global error if there is not one already set.
+    std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+    if (_globalError.GetCode() == 0) {
+      _globalError.Clone(m_error);
+    }
+  }
+}
+
+/**
+ * @brief Set the current error information associated with this sensor.
+ *
+ * @param errorMessage   The error message from WPIErrors.h
+ * @param contextMessage A custom message from the code that set the error.
+ * @param filename       Filename of the error source
+ * @param function       Function of the error source
+ * @param lineNumber     Line number of the error source
+ */
+void ErrorBase::SetWPIError(const llvm::Twine& errorMessage, Error::Code code,
+                            const llvm::Twine& contextMessage,
+                            llvm::StringRef filename, llvm::StringRef function,
+                            int lineNumber) const {
+  //  Set the current error information for this object.
+  m_error.Set(code, errorMessage + ": " + contextMessage, filename, function,
+              lineNumber, this);
+
+  // Update the global error if there is not one already set.
+  std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+  if (_globalError.GetCode() == 0) {
+    _globalError.Clone(m_error);
+  }
+}
+
+void ErrorBase::CloneError(const ErrorBase& rhs) const {
+  m_error.Clone(rhs.GetError());
+}
+
+/**
+ * @brief Check if the current error code represents a fatal error.
+ *
+ * @return true if the current error is fatal.
+ */
+bool ErrorBase::StatusIsFatal() const { return m_error.GetCode() < 0; }
+
+void ErrorBase::SetGlobalError(Error::Code code,
+                               const llvm::Twine& contextMessage,
+                               llvm::StringRef filename,
+                               llvm::StringRef function, int lineNumber) {
+  // If there was an error
+  if (code != 0) {
+    std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+
+    // Set the current error information for this object.
+    _globalError.Set(code, contextMessage, filename, function, lineNumber,
+                     nullptr);
+  }
+}
+
+void ErrorBase::SetGlobalWPIError(const llvm::Twine& errorMessage,
+                                  const llvm::Twine& contextMessage,
+                                  llvm::StringRef filename,
+                                  llvm::StringRef function, int lineNumber) {
+  std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+  if (_globalError.GetCode() != 0) {
+    _globalError.Clear();
+  }
+  _globalError.Set(-1, errorMessage + ": " + contextMessage, filename, function,
+                   lineNumber, nullptr);
+}
+
+/**
+ * Retrieve the current global error.
+ */
+Error& ErrorBase::GetGlobalError() {
+  std::lock_guard<wpi::mutex> mutex(_globalErrorMutex);
+  return _globalError;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Filters/Filter.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Filters/Filter.cpp
new file mode 100644
index 0000000..e9744c2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Filters/Filter.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Filters/Filter.h"
+
+#include "Base.h"
+
+using namespace frc;
+
+Filter::Filter(PIDSource& source)
+    : m_source(std::shared_ptr<PIDSource>(&source, NullDeleter<PIDSource>())) {}
+
+Filter::Filter(std::shared_ptr<PIDSource> source)
+    : m_source(std::move(source)) {}
+
+void Filter::SetPIDSourceType(PIDSourceType pidSource) {
+  m_source->SetPIDSourceType(pidSource);
+}
+
+PIDSourceType Filter::GetPIDSourceType() const {
+  return m_source->GetPIDSourceType();
+}
+
+double Filter::PIDGetSource() { return m_source->PIDGet(); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Filters/LinearDigitalFilter.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Filters/LinearDigitalFilter.cpp
new file mode 100644
index 0000000..c115754
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Filters/LinearDigitalFilter.cpp
@@ -0,0 +1,195 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Filters/LinearDigitalFilter.h"
+
+#include <cassert>
+#include <cmath>
+
+using namespace frc;
+
+/**
+ * Create a linear FIR or IIR filter.
+ *
+ * @param source  The PIDSource object that is used to get values
+ * @param ffGains The "feed forward" or FIR gains
+ * @param fbGains The "feed back" or IIR gains
+ */
+LinearDigitalFilter::LinearDigitalFilter(PIDSource& source,
+                                         llvm::ArrayRef<double> ffGains,
+                                         llvm::ArrayRef<double> fbGains)
+    : Filter(source),
+      m_inputs(ffGains.size()),
+      m_outputs(fbGains.size()),
+      m_inputGains(ffGains),
+      m_outputGains(fbGains) {}
+
+/**
+ * Create a linear FIR or IIR filter.
+ *
+ * @param source  The PIDSource object that is used to get values
+ * @param ffGains The "feed forward" or FIR gains
+ * @param fbGains The "feed back" or IIR gains
+ */
+LinearDigitalFilter::LinearDigitalFilter(std::shared_ptr<PIDSource> source,
+                                         llvm::ArrayRef<double> ffGains,
+                                         llvm::ArrayRef<double> fbGains)
+    : Filter(source),
+      m_inputs(ffGains.size()),
+      m_outputs(fbGains.size()),
+      m_inputGains(ffGains),
+      m_outputGains(fbGains) {}
+
+/**
+ * Creates a one-pole IIR low-pass filter of the form:<br>
+ *   y[n] = (1 - gain) * x[n] + gain * y[n-1]<br>
+ * where gain = e<sup>-dt / T</sup>, T is the time constant in seconds
+ *
+ * This filter is stable for time constants greater than zero.
+ *
+ * @param source       The PIDSource object that is used to get values
+ * @param timeConstant The discrete-time time constant in seconds
+ * @param period       The period in seconds between samples taken by the user
+ */
+LinearDigitalFilter LinearDigitalFilter::SinglePoleIIR(PIDSource& source,
+                                                       double timeConstant,
+                                                       double period) {
+  double gain = std::exp(-period / timeConstant);
+  return LinearDigitalFilter(source, {1.0 - gain}, {-gain});
+}
+
+/**
+ * Creates a first-order high-pass filter of the form:<br>
+ *   y[n] = gain * x[n] + (-gain) * x[n-1] + gain * y[n-1]<br>
+ * where gain = e<sup>-dt / T</sup>, T is the time constant in seconds
+ *
+ * This filter is stable for time constants greater than zero.
+ *
+ * @param source       The PIDSource object that is used to get values
+ * @param timeConstant The discrete-time time constant in seconds
+ * @param period       The period in seconds between samples taken by the user
+ */
+LinearDigitalFilter LinearDigitalFilter::HighPass(PIDSource& source,
+                                                  double timeConstant,
+                                                  double period) {
+  double gain = std::exp(-period / timeConstant);
+  return LinearDigitalFilter(source, {gain, -gain}, {-gain});
+}
+
+/**
+ * Creates a K-tap FIR moving average filter of the form:<br>
+ *   y[n] = 1/k * (x[k] + x[k-1] + … + x[0])
+ *
+ * This filter is always stable.
+ *
+ * @param source The PIDSource object that is used to get values
+ * @param taps   The number of samples to average over. Higher = smoother but
+ *               slower
+ */
+LinearDigitalFilter LinearDigitalFilter::MovingAverage(PIDSource& source,
+                                                       int taps) {
+  assert(taps > 0);
+
+  std::vector<double> gains(taps, 1.0 / taps);
+  return LinearDigitalFilter(source, gains, {});
+}
+
+/**
+ * Creates a one-pole IIR low-pass filter of the form:<br>
+ *   y[n] = (1 - gain) * x[n] + gain * y[n-1]<br>
+ * where gain = e<sup>-dt / T</sup>, T is the time constant in seconds
+ *
+ * This filter is stable for time constants greater than zero.
+ *
+ * @param source       The PIDSource object that is used to get values
+ * @param timeConstant The discrete-time time constant in seconds
+ * @param period       The period in seconds between samples taken by the user
+ */
+LinearDigitalFilter LinearDigitalFilter::SinglePoleIIR(
+    std::shared_ptr<PIDSource> source, double timeConstant, double period) {
+  double gain = std::exp(-period / timeConstant);
+  return LinearDigitalFilter(std::move(source), {1.0 - gain}, {-gain});
+}
+
+/**
+ * Creates a first-order high-pass filter of the form:<br>
+ *   y[n] = gain * x[n] + (-gain) * x[n-1] + gain * y[n-1]<br>
+ * where gain = e<sup>-dt / T</sup>, T is the time constant in seconds
+ *
+ * This filter is stable for time constants greater than zero.
+ *
+ * @param source       The PIDSource object that is used to get values
+ * @param timeConstant The discrete-time time constant in seconds
+ * @param period       The period in seconds between samples taken by the user
+ */
+LinearDigitalFilter LinearDigitalFilter::HighPass(
+    std::shared_ptr<PIDSource> source, double timeConstant, double period) {
+  double gain = std::exp(-period / timeConstant);
+  return LinearDigitalFilter(std::move(source), {gain, -gain}, {-gain});
+}
+
+/**
+ * Creates a K-tap FIR moving average filter of the form:<br>
+ *   y[n] = 1/k * (x[k] + x[k-1] + … + x[0])
+ *
+ * This filter is always stable.
+ *
+ * @param source The PIDSource object that is used to get values
+ * @param taps   The number of samples to average over. Higher = smoother but
+ *               slower
+ */
+LinearDigitalFilter LinearDigitalFilter::MovingAverage(
+    std::shared_ptr<PIDSource> source, int taps) {
+  assert(taps > 0);
+
+  std::vector<double> gains(taps, 1.0 / taps);
+  return LinearDigitalFilter(std::move(source), gains, {});
+}
+
+double LinearDigitalFilter::Get() const {
+  double retVal = 0.0;
+
+  // Calculate the new value
+  for (size_t i = 0; i < m_inputGains.size(); i++) {
+    retVal += m_inputs[i] * m_inputGains[i];
+  }
+  for (size_t i = 0; i < m_outputGains.size(); i++) {
+    retVal -= m_outputs[i] * m_outputGains[i];
+  }
+
+  return retVal;
+}
+
+void LinearDigitalFilter::Reset() {
+  m_inputs.reset();
+  m_outputs.reset();
+}
+
+/**
+ * Calculates the next value of the filter
+ *
+ * @return The filtered value at this step
+ */
+double LinearDigitalFilter::PIDGet() {
+  double retVal = 0.0;
+
+  // Rotate the inputs
+  m_inputs.push_front(PIDGetSource());
+
+  // Calculate the new value
+  for (size_t i = 0; i < m_inputGains.size(); i++) {
+    retVal += m_inputs[i] * m_inputGains[i];
+  }
+  for (size_t i = 0; i < m_outputGains.size(); i++) {
+    retVal -= m_outputs[i] * m_outputGains[i];
+  }
+
+  // Rotate the outputs
+  m_outputs.push_front(retVal);
+
+  return retVal;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GamepadBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GamepadBase.cpp
new file mode 100644
index 0000000..3be392b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GamepadBase.cpp
@@ -0,0 +1,12 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "GamepadBase.h"
+
+using namespace frc;
+
+GamepadBase::GamepadBase(int port) : GenericHID(port) {}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GearTooth.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GearTooth.cpp
new file mode 100644
index 0000000..8959821
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GearTooth.cpp
@@ -0,0 +1,74 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "GearTooth.h"
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+constexpr double GearTooth::kGearToothThreshold;
+
+/**
+ * Common code called by the constructors.
+ */
+void GearTooth::EnableDirectionSensing(bool directionSensitive) {
+  if (directionSensitive) {
+    SetPulseLengthMode(kGearToothThreshold);
+  }
+}
+
+/**
+ * Construct a GearTooth sensor given a channel.
+ *
+ * @param channel            The DIO channel that the sensor is connected to.
+ *                           0-9 are on-board, 10-25 are on the MXP.
+ * @param directionSensitive True to enable the pulse length decoding in
+ *                           hardware to specify count direction.
+ */
+GearTooth::GearTooth(int channel, bool directionSensitive) : Counter(channel) {
+  EnableDirectionSensing(directionSensitive);
+  SetName("GearTooth", channel);
+}
+
+/**
+ * Construct a GearTooth sensor given a digital input.
+ *
+ * This should be used when sharing digital inputs.
+ *
+ * @param source             A pointer to the existing DigitalSource object
+ *                           (such as a DigitalInput)
+ * @param directionSensitive True to enable the pulse length decoding in
+ *                           hardware to specify count direction.
+ */
+GearTooth::GearTooth(DigitalSource* source, bool directionSensitive)
+    : Counter(source) {
+  EnableDirectionSensing(directionSensitive);
+  SetName("GearTooth", source->GetChannel());
+}
+
+/**
+ * Construct a GearTooth sensor given a digital input.
+ *
+ * This should be used when sharing digital inputs.
+ *
+ * @param source             A reference to the existing DigitalSource object
+ *                           (such as a DigitalInput)
+ * @param directionSensitive True to enable the pulse length decoding in
+ *                           hardware to specify count direction.
+ */
+GearTooth::GearTooth(std::shared_ptr<DigitalSource> source,
+                     bool directionSensitive)
+    : Counter(source) {
+  EnableDirectionSensing(directionSensitive);
+  SetName("GearTooth", source->GetChannel());
+}
+
+void GearTooth::InitSendable(SendableBuilder& builder) {
+  Counter::InitSendable(builder);
+  builder.SetSmartDashboardType("Gear Tooth");
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GenericHID.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GenericHID.cpp
new file mode 100644
index 0000000..369e29b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GenericHID.cpp
@@ -0,0 +1,179 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "GenericHID.h"
+
+#include <HAL/HAL.h>
+
+#include "DriverStation.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+GenericHID::GenericHID(int port) : m_ds(DriverStation::GetInstance()) {
+  if (port >= DriverStation::kJoystickPorts) {
+    wpi_setWPIError(BadJoystickIndex);
+  }
+  m_port = port;
+}
+
+/**
+ * Get the button value (starting at button 1).
+ *
+ * The buttons are returned in a single 16 bit value with one bit representing
+ * the state of each button. The appropriate button is returned as a boolean
+ * value.
+ *
+ * @param button The button number to be read (starting at 1)
+ * @return The state of the button.
+ */
+bool GenericHID::GetRawButton(int button) const {
+  return m_ds.GetStickButton(m_port, button);
+}
+
+/**
+ * Whether the button was pressed since the last check. Button indexes begin at
+ * 1.
+ *
+ * @param button The button index, beginning at 1.
+ * @return Whether the button was pressed since the last check.
+ */
+bool GenericHID::GetRawButtonPressed(int button) {
+  return m_ds.GetStickButtonPressed(m_port, button);
+}
+
+/**
+ * Whether the button was released since the last check. Button indexes begin at
+ * 1.
+ *
+ * @param button The button index, beginning at 1.
+ * @return Whether the button was released since the last check.
+ */
+bool GenericHID::GetRawButtonReleased(int button) {
+  return m_ds.GetStickButtonReleased(m_port, button);
+}
+
+/**
+ * Get the value of the axis.
+ *
+ * @param axis The axis to read, starting at 0.
+ * @return The value of the axis.
+ */
+double GenericHID::GetRawAxis(int axis) const {
+  return m_ds.GetStickAxis(m_port, axis);
+}
+
+/**
+ * Get the angle in degrees of a POV on the HID.
+ *
+ * The POV angles start at 0 in the up direction, and increase clockwise
+ * (e.g. right is 90, upper-left is 315).
+ *
+ * @param pov The index of the POV to read (starting at 0)
+ * @return the angle of the POV in degrees, or -1 if the POV is not pressed.
+ */
+int GenericHID::GetPOV(int pov) const { return m_ds.GetStickPOV(m_port, pov); }
+
+/**
+ * Get the number of axes for the HID.
+ *
+ * @return the number of axis for the current HID
+ */
+int GenericHID::GetAxisCount() const { return m_ds.GetStickAxisCount(m_port); }
+
+/**
+ * Get the number of POVs for the HID.
+ *
+ * @return the number of POVs for the current HID
+ */
+int GenericHID::GetPOVCount() const { return m_ds.GetStickPOVCount(m_port); }
+
+/**
+ * Get the number of buttons for the HID.
+ *
+ * @return the number of buttons on the current HID
+ */
+int GenericHID::GetButtonCount() const {
+  return m_ds.GetStickButtonCount(m_port);
+}
+
+/**
+ * Get the type of the HID.
+ *
+ * @return the type of the HID.
+ */
+GenericHID::HIDType GenericHID::GetType() const {
+  return static_cast<HIDType>(m_ds.GetJoystickType(m_port));
+}
+
+/**
+ * Get the name of the HID.
+ *
+ * @return the name of the HID.
+ */
+std::string GenericHID::GetName() const { return m_ds.GetJoystickName(m_port); }
+
+/**
+ * Get the axis type of a joystick axis.
+ *
+ * @return the axis type of a joystick axis.
+ */
+int GenericHID::GetAxisType(int axis) const {
+  return m_ds.GetJoystickAxisType(m_port, axis);
+}
+
+/**
+ * Get the port number of the HID.
+ *
+ * @return The port number of the HID.
+ */
+int GenericHID::GetPort() const { return m_port; }
+
+/**
+ * Set a single HID output value for the HID.
+ *
+ * @param outputNumber The index of the output to set (1-32)
+ * @param value        The value to set the output to
+ */
+
+void GenericHID::SetOutput(int outputNumber, bool value) {
+  m_outputs =
+      (m_outputs & ~(1 << (outputNumber - 1))) | (value << (outputNumber - 1));
+
+  HAL_SetJoystickOutputs(m_port, m_outputs, m_leftRumble, m_rightRumble);
+}
+
+/**
+ * Set all output values for the HID.
+ *
+ * @param value The 32 bit output value (1 bit for each output)
+ */
+void GenericHID::SetOutputs(int value) {
+  m_outputs = value;
+  HAL_SetJoystickOutputs(m_port, m_outputs, m_leftRumble, m_rightRumble);
+}
+
+/**
+ * Set the rumble output for the HID.
+ *
+ * The DS currently supports 2 rumble values, left rumble and right rumble.
+ *
+ * @param type  Which rumble value to set
+ * @param value The normalized value (0 to 1) to set the rumble to
+ */
+void GenericHID::SetRumble(RumbleType type, double value) {
+  if (value < 0)
+    value = 0;
+  else if (value > 1)
+    value = 1;
+  if (type == kLeftRumble) {
+    m_leftRumble = value * 65535;
+  } else {
+    m_rightRumble = value * 65535;
+  }
+  HAL_SetJoystickOutputs(m_port, m_outputs, m_leftRumble, m_rightRumble);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GyroBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GyroBase.cpp
new file mode 100644
index 0000000..51d641a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/GyroBase.cpp
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "GyroBase.h"
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Get the PIDOutput for the PIDSource base object. Can be set to return
+ * angle or rate using SetPIDSourceType(). Defaults to angle.
+ *
+ * @return The PIDOutput (angle or rate, defaults to angle)
+ */
+double GyroBase::PIDGet() {
+  switch (GetPIDSourceType()) {
+    case PIDSourceType::kRate:
+      return GetRate();
+    case PIDSourceType::kDisplacement:
+      return GetAngle();
+    default:
+      return 0;
+  }
+}
+
+void GyroBase::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Gyro");
+  builder.AddDoubleProperty("Value", [=]() { return GetAngle(); }, nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/HLUsageReporting.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/HLUsageReporting.cpp
new file mode 100644
index 0000000..da8b888
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/HLUsageReporting.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HLUsageReporting.h"
+
+using namespace frc;
+
+HLUsageReportingInterface* HLUsageReporting::impl = nullptr;
+
+void HLUsageReporting::SetImplementation(HLUsageReportingInterface* i) {
+  impl = i;
+}
+
+void HLUsageReporting::ReportScheduler() {
+  if (impl != nullptr) {
+    impl->ReportScheduler();
+  }
+}
+
+void HLUsageReporting::ReportSmartDashboard() {
+  if (impl != nullptr) {
+    impl->ReportSmartDashboard();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/I2C.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/I2C.cpp
new file mode 100644
index 0000000..0952b1e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/I2C.cpp
@@ -0,0 +1,183 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "I2C.h"
+
+#include <HAL/HAL.h>
+#include <HAL/I2C.h>
+
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Constructor.
+ *
+ * @param port          The I2C port to which the device is connected.
+ * @param deviceAddress The address of the device on the I2C bus.
+ */
+I2C::I2C(Port port, int deviceAddress)
+    : m_port(static_cast<HAL_I2CPort>(port)), m_deviceAddress(deviceAddress) {
+  int32_t status = 0;
+  HAL_InitializeI2C(m_port, &status);
+  // wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  HAL_Report(HALUsageReporting::kResourceType_I2C, deviceAddress);
+}
+
+/**
+ * Destructor.
+ */
+I2C::~I2C() { HAL_CloseI2C(m_port); }
+
+/**
+ * Generic transaction.
+ *
+ * This is a lower-level interface to the I2C hardware giving you more control
+ * over each transaction.
+ *
+ * @param dataToSend   Buffer of data to send as part of the transaction.
+ * @param sendSize     Number of bytes to send as part of the transaction.
+ * @param dataReceived Buffer to read data into.
+ * @param receiveSize  Number of bytes to read from the device.
+ * @return Transfer Aborted... false for success, true for aborted.
+ */
+bool I2C::Transaction(uint8_t* dataToSend, int sendSize, uint8_t* dataReceived,
+                      int receiveSize) {
+  int32_t status = 0;
+  status = HAL_TransactionI2C(m_port, m_deviceAddress, dataToSend, sendSize,
+                              dataReceived, receiveSize);
+  // wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return status < 0;
+}
+
+/**
+ * Attempt to address a device on the I2C bus.
+ *
+ * This allows you to figure out if there is a device on the I2C bus that
+ * responds to the address specified in the constructor.
+ *
+ * @return Transfer Aborted... false for success, true for aborted.
+ */
+bool I2C::AddressOnly() { return Transaction(nullptr, 0, nullptr, 0); }
+
+/**
+ * Execute a write transaction with the device.
+ *
+ * Write a single byte to a register on a device and wait until the
+ *   transaction is complete.
+ *
+ * @param registerAddress The address of the register on the device to be
+ *                        written.
+ * @param data            The byte to write to the register on the device.
+ * @return Transfer Aborted... false for success, true for aborted.
+ */
+bool I2C::Write(int registerAddress, uint8_t data) {
+  uint8_t buffer[2];
+  buffer[0] = registerAddress;
+  buffer[1] = data;
+  int32_t status = 0;
+  status = HAL_WriteI2C(m_port, m_deviceAddress, buffer, sizeof(buffer));
+  return status < 0;
+}
+
+/**
+ * Execute a bulk write transaction with the device.
+ *
+ * Write multiple bytes to a device and wait until the
+ *   transaction is complete.
+ *
+ * @param data  The data to write to the register on the device.
+ * @param count The number of bytes to be written.
+ * @return Transfer Aborted... false for success, true for aborted.
+ */
+bool I2C::WriteBulk(uint8_t* data, int count) {
+  int32_t status = 0;
+  status = HAL_WriteI2C(m_port, m_deviceAddress, data, count);
+  return status < 0;
+}
+
+/**
+ * Execute a read transaction with the device.
+ *
+ * Read bytes from a device.
+ * Most I2C devices will auto-increment the register pointer internally allowing
+ * you to read consecutive registers on a device in a single transaction.
+ *
+ * @param registerAddress The register to read first in the transaction.
+ * @param count           The number of bytes to read in the transaction.
+ * @param buffer          A pointer to the array of bytes to store the data
+ *                        read from the device.
+ * @return Transfer Aborted... false for success, true for aborted.
+ */
+bool I2C::Read(int registerAddress, int count, uint8_t* buffer) {
+  if (count < 1) {
+    wpi_setWPIErrorWithContext(ParameterOutOfRange, "count");
+    return true;
+  }
+  if (buffer == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "buffer");
+    return true;
+  }
+  uint8_t regAddr = registerAddress;
+  return Transaction(&regAddr, sizeof(regAddr), buffer, count);
+}
+
+/**
+ * Execute a read only transaction with the device.
+ *
+ * Read bytes from a device. This method does not write any data to prompt the
+ * device.
+ *
+ * @param buffer A pointer to the array of bytes to store the data read from
+ *               the device.
+ * @param count  The number of bytes to read in the transaction.
+ * @return Transfer Aborted... false for success, true for aborted.
+ */
+bool I2C::ReadOnly(int count, uint8_t* buffer) {
+  if (count < 1) {
+    wpi_setWPIErrorWithContext(ParameterOutOfRange, "count");
+    return true;
+  }
+  if (buffer == nullptr) {
+    wpi_setWPIErrorWithContext(NullParameter, "buffer");
+    return true;
+  }
+  return HAL_ReadI2C(m_port, m_deviceAddress, buffer, count) < 0;
+}
+
+/**
+ * Verify that a device's registers contain expected values.
+ *
+ * Most devices will have a set of registers that contain a known value that
+ * can be used to identify them.  This allows an I2C device driver to easily
+ * verify that the device contains the expected value.
+ *
+ * @pre The device must support and be configured to use register
+ * auto-increment.
+ *
+ * @param registerAddress The base register to start reading from the device.
+ * @param count           The size of the field to be verified.
+ * @param expected        A buffer containing the values expected from the
+ *                        device.
+ */
+bool I2C::VerifySensor(int registerAddress, int count,
+                       const uint8_t* expected) {
+  // TODO: Make use of all 7 read bytes
+  uint8_t deviceData[4];
+  for (int i = 0, curRegisterAddress = registerAddress; i < count;
+       i += 4, curRegisterAddress += 4) {
+    int toRead = count - i < 4 ? count - i : 4;
+    // Read the chunk of data.  Return false if the sensor does not respond.
+    if (Read(curRegisterAddress, toRead, deviceData)) return false;
+
+    for (int j = 0; j < toRead; j++) {
+      if (deviceData[j] != expected[i + j]) return false;
+    }
+  }
+  return true;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Internal/HardwareHLReporting.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Internal/HardwareHLReporting.cpp
new file mode 100644
index 0000000..39d95c7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Internal/HardwareHLReporting.cpp
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Internal/HardwareHLReporting.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+void HardwareHLReporting::ReportScheduler() {
+  HAL_Report(HALUsageReporting::kResourceType_Command,
+             HALUsageReporting::kCommand_Scheduler);
+}
+
+void HardwareHLReporting::ReportSmartDashboard() {
+  HAL_Report(HALUsageReporting::kResourceType_SmartDashboard, 0);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/InterruptableSensorBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/InterruptableSensorBase.cpp
new file mode 100644
index 0000000..5c9d448
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/InterruptableSensorBase.cpp
@@ -0,0 +1,201 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "InterruptableSensorBase.h"
+
+#include <HAL/HAL.h>
+
+#include "Utility.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Request one of the 8 interrupts asynchronously on this digital input.
+ *
+ * Request interrupts in asynchronous mode where the user's interrupt handler
+ * will be called when the interrupt fires. Users that want control over the
+ * thread priority should use the synchronous method with their own spawned
+ * thread. The default is interrupt on rising edges only.
+ */
+void InterruptableSensorBase::RequestInterrupts(
+    HAL_InterruptHandlerFunction handler, void* param) {
+  if (StatusIsFatal()) return;
+
+  wpi_assert(m_interrupt == HAL_kInvalidHandle);
+  AllocateInterrupts(false);
+  if (StatusIsFatal()) return;  // if allocate failed, out of interrupts
+
+  int32_t status = 0;
+  HAL_RequestInterrupts(
+      m_interrupt, GetPortHandleForRouting(),
+      static_cast<HAL_AnalogTriggerType>(GetAnalogTriggerTypeForRouting()),
+      &status);
+  SetUpSourceEdge(true, false);
+  HAL_AttachInterruptHandler(m_interrupt, handler, param, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Request one of the 8 interrupts synchronously on this digital input.
+ *
+ * Request interrupts in synchronous mode where the user program will have to
+ * explicitly wait for the interrupt to occur using WaitForInterrupt.
+ * The default is interrupt on rising edges only.
+ */
+void InterruptableSensorBase::RequestInterrupts() {
+  if (StatusIsFatal()) return;
+
+  wpi_assert(m_interrupt == HAL_kInvalidHandle);
+  AllocateInterrupts(true);
+  if (StatusIsFatal()) return;  // if allocate failed, out of interrupts
+
+  int32_t status = 0;
+  HAL_RequestInterrupts(
+      m_interrupt, GetPortHandleForRouting(),
+      static_cast<HAL_AnalogTriggerType>(GetAnalogTriggerTypeForRouting()),
+      &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  SetUpSourceEdge(true, false);
+}
+
+void InterruptableSensorBase::AllocateInterrupts(bool watcher) {
+  wpi_assert(m_interrupt == HAL_kInvalidHandle);
+  // Expects the calling leaf class to allocate an interrupt index.
+  int32_t status = 0;
+  m_interrupt = HAL_InitializeInterrupts(watcher, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Cancel interrupts on this device.
+ *
+ * This deallocates all the chipobject structures and disables any interrupts.
+ */
+void InterruptableSensorBase::CancelInterrupts() {
+  if (StatusIsFatal()) return;
+  wpi_assert(m_interrupt != HAL_kInvalidHandle);
+  int32_t status = 0;
+  HAL_CleanInterrupts(m_interrupt, &status);
+  // Ignore status, as an invalid handle just needs to be ignored.
+  m_interrupt = HAL_kInvalidHandle;
+}
+
+/**
+ * In synchronous mode, wait for the defined interrupt to occur.
+ *
+ * You should <b>NOT</b> attempt to read the sensor from another thread while
+ * waiting for an interrupt. This is not threadsafe, and can cause memory
+ * corruption
+ *
+ * @param timeout        Timeout in seconds
+ * @param ignorePrevious If true, ignore interrupts that happened before
+ *                       WaitForInterrupt was called.
+ * @return What interrupts fired
+ */
+InterruptableSensorBase::WaitResult InterruptableSensorBase::WaitForInterrupt(
+    double timeout, bool ignorePrevious) {
+  if (StatusIsFatal()) return InterruptableSensorBase::kTimeout;
+  wpi_assert(m_interrupt != HAL_kInvalidHandle);
+  int32_t status = 0;
+  int result;
+
+  result = HAL_WaitForInterrupt(m_interrupt, timeout, ignorePrevious, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  // Rising edge result is the interrupt bit set in the byte 0xFF
+  // Falling edge result is the interrupt bit set in the byte 0xFF00
+  // Set any bit set to be true for that edge, and AND the 2 results
+  // together to match the existing enum for all interrupts
+  int32_t rising = (result & 0xFF) ? 0x1 : 0x0;
+  int32_t falling = ((result & 0xFF00) ? 0x0100 : 0x0);
+  return static_cast<WaitResult>(falling | rising);
+}
+
+/**
+ * Enable interrupts to occur on this input.
+ *
+ * Interrupts are disabled when the RequestInterrupt call is made. This gives
+ * time to do the setup of the other options before starting to field
+ * interrupts.
+ */
+void InterruptableSensorBase::EnableInterrupts() {
+  if (StatusIsFatal()) return;
+  wpi_assert(m_interrupt != HAL_kInvalidHandle);
+  int32_t status = 0;
+  HAL_EnableInterrupts(m_interrupt, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Disable Interrupts without without deallocating structures.
+ */
+void InterruptableSensorBase::DisableInterrupts() {
+  if (StatusIsFatal()) return;
+  wpi_assert(m_interrupt != HAL_kInvalidHandle);
+  int32_t status = 0;
+  HAL_DisableInterrupts(m_interrupt, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Return the timestamp for the rising interrupt that occurred most recently.
+ *
+ * This is in the same time domain as GetClock().
+ * The rising-edge interrupt should be enabled with
+ * {@link #DigitalInput.SetUpSourceEdge}
+ *
+ * @return Timestamp in seconds since boot.
+ */
+double InterruptableSensorBase::ReadRisingTimestamp() {
+  if (StatusIsFatal()) return 0.0;
+  wpi_assert(m_interrupt != HAL_kInvalidHandle);
+  int32_t status = 0;
+  double timestamp = HAL_ReadInterruptRisingTimestamp(m_interrupt, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return timestamp;
+}
+
+/**
+ * Return the timestamp for the falling interrupt that occurred most recently.
+ *
+ * This is in the same time domain as GetClock().
+ * The falling-edge interrupt should be enabled with
+ * {@link #DigitalInput.SetUpSourceEdge}
+ *
+ * @return Timestamp in seconds since boot.
+ */
+double InterruptableSensorBase::ReadFallingTimestamp() {
+  if (StatusIsFatal()) return 0.0;
+  wpi_assert(m_interrupt != HAL_kInvalidHandle);
+  int32_t status = 0;
+  double timestamp = HAL_ReadInterruptFallingTimestamp(m_interrupt, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return timestamp;
+}
+
+/**
+ * Set which edge to trigger interrupts on
+ *
+ * @param risingEdge  true to interrupt on rising edge
+ * @param fallingEdge true to interrupt on falling edge
+ */
+void InterruptableSensorBase::SetUpSourceEdge(bool risingEdge,
+                                              bool fallingEdge) {
+  if (StatusIsFatal()) return;
+  if (m_interrupt == HAL_kInvalidHandle) {
+    wpi_setWPIErrorWithContext(
+        NullParameter,
+        "You must call RequestInterrupts before SetUpSourceEdge");
+    return;
+  }
+  if (m_interrupt != HAL_kInvalidHandle) {
+    int32_t status = 0;
+    HAL_SetInterruptUpSourceEdge(m_interrupt, risingEdge, fallingEdge, &status);
+    wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/IterativeRobot.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/IterativeRobot.cpp
new file mode 100644
index 0000000..4497ff5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/IterativeRobot.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "IterativeRobot.h"
+
+#include <HAL/HAL.h>
+
+#include "DriverStation.h"
+
+using namespace frc;
+
+IterativeRobot::IterativeRobot() {
+  HAL_Report(HALUsageReporting::kResourceType_Framework,
+             HALUsageReporting::kFramework_Iterative);
+}
+
+/**
+ * Provide an alternate "main loop" via StartCompetition().
+ *
+ * This specific StartCompetition() implements "main loop" behaviour synced with
+ * the DS packets.
+ */
+void IterativeRobot::StartCompetition() {
+  RobotInit();
+
+  // Tell the DS that the robot is ready to be enabled
+  HAL_ObserveUserProgramStarting();
+
+  // Loop forever, calling the appropriate mode-dependent function
+  while (true) {
+    // Wait for driver station data so the loop doesn't hog the CPU
+    DriverStation::GetInstance().WaitForData();
+
+    LoopFunc();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/IterativeRobotBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/IterativeRobotBase.cpp
new file mode 100644
index 0000000..ea7ea9d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/IterativeRobotBase.cpp
@@ -0,0 +1,198 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "IterativeRobotBase.h"
+
+#include <cstdio>
+
+#include <HAL/HAL.h>
+#include <llvm/raw_ostream.h>
+
+#include "Commands/Scheduler.h"
+#include "LiveWindow/LiveWindow.h"
+#include "SmartDashboard/SmartDashboard.h"
+
+using namespace frc;
+
+/**
+ * Robot-wide initialization code should go here.
+ *
+ * Users should override this method for default Robot-wide initialization which
+ * will be called when the robot is first powered on. It will be called exactly
+ * one time.
+ *
+ * Warning: the Driver Station "Robot Code" light and FMS "Robot Ready"
+ * indicators will be off until RobotInit() exits. Code in RobotInit() that
+ * waits for enable will cause the robot to never indicate that the code is
+ * ready, causing the robot to be bypassed in a match.
+ */
+void IterativeRobotBase::RobotInit() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Initialization code for disabled mode should go here.
+ *
+ * Users should override this method for initialization code which will be
+ * called each time
+ * the robot enters disabled mode.
+ */
+void IterativeRobotBase::DisabledInit() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Initialization code for autonomous mode should go here.
+ *
+ * Users should override this method for initialization code which will be
+ * called each time the robot enters autonomous mode.
+ */
+void IterativeRobotBase::AutonomousInit() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Initialization code for teleop mode should go here.
+ *
+ * Users should override this method for initialization code which will be
+ * called each time the robot enters teleop mode.
+ */
+void IterativeRobotBase::TeleopInit() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Initialization code for test mode should go here.
+ *
+ * Users should override this method for initialization code which will be
+ * called each time the robot enters test mode.
+ */
+void IterativeRobotBase::TestInit() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Periodic code for all modes should go here.
+ *
+ * This function is called each time a new packet is received from the driver
+ * station.
+ */
+void IterativeRobotBase::RobotPeriodic() {
+  static bool firstRun = true;
+  if (firstRun) {
+    llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+    firstRun = false;
+  }
+}
+
+/**
+ * Periodic code for disabled mode should go here.
+ *
+ * Users should override this method for code which will be called each time a
+ * new packet is received from the driver station and the robot is in disabled
+ * mode.
+ */
+void IterativeRobotBase::DisabledPeriodic() {
+  static bool firstRun = true;
+  if (firstRun) {
+    llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+    firstRun = false;
+  }
+}
+
+/**
+ * Periodic code for autonomous mode should go here.
+ *
+ * Users should override this method for code which will be called each time a
+ * new packet is received from the driver station and the robot is in autonomous
+ * mode.
+ */
+void IterativeRobotBase::AutonomousPeriodic() {
+  static bool firstRun = true;
+  if (firstRun) {
+    llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+    firstRun = false;
+  }
+}
+
+/**
+ * Periodic code for teleop mode should go here.
+ *
+ * Users should override this method for code which will be called each time a
+ * new packet is received from the driver station and the robot is in teleop
+ * mode.
+ */
+void IterativeRobotBase::TeleopPeriodic() {
+  static bool firstRun = true;
+  if (firstRun) {
+    llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+    firstRun = false;
+  }
+}
+
+/**
+ * Periodic code for test mode should go here.
+ *
+ * Users should override this method for code which will be called each time a
+ * new packet is received from the driver station and the robot is in test mode.
+ */
+void IterativeRobotBase::TestPeriodic() {
+  static bool firstRun = true;
+  if (firstRun) {
+    llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+    firstRun = false;
+  }
+}
+
+void IterativeRobotBase::LoopFunc() {
+  // Call the appropriate function depending upon the current robot mode
+  if (IsDisabled()) {
+    // Call DisabledInit() if we are now just entering disabled mode from
+    // either a different mode or from power-on.
+    if (m_lastMode != Mode::kDisabled) {
+      LiveWindow::GetInstance()->SetEnabled(false);
+      DisabledInit();
+      m_lastMode = Mode::kDisabled;
+    }
+    HAL_ObserveUserProgramDisabled();
+    DisabledPeriodic();
+  } else if (IsAutonomous()) {
+    // Call AutonomousInit() if we are now just entering autonomous mode from
+    // either a different mode or from power-on.
+    if (m_lastMode != Mode::kAutonomous) {
+      LiveWindow::GetInstance()->SetEnabled(false);
+      AutonomousInit();
+      m_lastMode = Mode::kAutonomous;
+    }
+    HAL_ObserveUserProgramAutonomous();
+    AutonomousPeriodic();
+  } else if (IsOperatorControl()) {
+    // Call TeleopInit() if we are now just entering teleop mode from
+    // either a different mode or from power-on.
+    if (m_lastMode != Mode::kTeleop) {
+      LiveWindow::GetInstance()->SetEnabled(false);
+      TeleopInit();
+      m_lastMode = Mode::kTeleop;
+      Scheduler::GetInstance()->SetEnabled(true);
+    }
+    HAL_ObserveUserProgramTeleop();
+    TeleopPeriodic();
+  } else {
+    // Call TestInit() if we are now just entering test mode from
+    // either a different mode or from power-on.
+    if (m_lastMode != Mode::kTest) {
+      LiveWindow::GetInstance()->SetEnabled(true);
+      TestInit();
+      m_lastMode = Mode::kTest;
+    }
+    HAL_ObserveUserProgramTest();
+    TestPeriodic();
+  }
+  RobotPeriodic();
+  SmartDashboard::UpdateValues();
+  LiveWindow::GetInstance()->UpdateValues();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Jaguar.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Jaguar.cpp
new file mode 100644
index 0000000..214937b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Jaguar.cpp
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Jaguar.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Constructor for a Jaguar connected via PWM.
+ *
+ * @param channel The PWM channel that the Jaguar is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+Jaguar::Jaguar(int channel) : PWMSpeedController(channel) {
+  /**
+   * Input profile defined by Luminary Micro.
+   *
+   * Full reverse ranges from 0.671325ms to 0.6972211ms
+   * Proportional reverse ranges from 0.6972211ms to 1.4482078ms
+   * Neutral ranges from 1.4482078ms to 1.5517922ms
+   * Proportional forward ranges from 1.5517922ms to 2.3027789ms
+   * Full forward ranges from 2.3027789ms to 2.328675ms
+   */
+  SetBounds(2.31, 1.55, 1.507, 1.454, .697);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_Jaguar, GetChannel());
+  SetName("Jaguar", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Joystick.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Joystick.cpp
new file mode 100644
index 0000000..b3ae602
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Joystick.cpp
@@ -0,0 +1,304 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Joystick.h"
+
+#include <cmath>
+
+#include <HAL/HAL.h>
+
+#include "DriverStation.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+constexpr double kPi = 3.14159265358979323846;
+
+/**
+ * Construct an instance of a joystick.
+ *
+ * The joystick index is the USB port on the Driver Station.
+ *
+ * @param port The port on the Driver Station that the joystick is plugged into
+ *             (0-5).
+ */
+Joystick::Joystick(int port) : GenericHID(port) {
+  m_axes[Axis::kX] = kDefaultXAxis;
+  m_axes[Axis::kY] = kDefaultYAxis;
+  m_axes[Axis::kZ] = kDefaultZAxis;
+  m_axes[Axis::kTwist] = kDefaultTwistAxis;
+  m_axes[Axis::kThrottle] = kDefaultThrottleAxis;
+
+  HAL_Report(HALUsageReporting::kResourceType_Joystick, port);
+}
+
+/**
+ * Set the channel associated with a specified axis.
+ *
+ * @param axis    The axis to set the channel for.
+ * @param channel The channel to set the axis to.
+ */
+void Joystick::SetAxisChannel(AxisType axis, int channel) {
+  m_axes[axis] = channel;
+}
+
+/**
+ * Set the channel associated with the X axis.
+ *
+ * @param channel The channel to set the axis to.
+ */
+void Joystick::SetXChannel(int channel) { m_axes[Axis::kX] = channel; }
+
+/**
+ * Set the channel associated with the Y axis.
+ *
+ * @param axis    The axis to set the channel for.
+ * @param channel The channel to set the axis to.
+ */
+void Joystick::SetYChannel(int channel) { m_axes[Axis::kY] = channel; }
+
+/**
+ * Set the channel associated with the Z axis.
+ *
+ * @param axis    The axis to set the channel for.
+ * @param channel The channel to set the axis to.
+ */
+void Joystick::SetZChannel(int channel) { m_axes[Axis::kZ] = channel; }
+
+/**
+ * Set the channel associated with the twist axis.
+ *
+ * @param axis    The axis to set the channel for.
+ * @param channel The channel to set the axis to.
+ */
+void Joystick::SetTwistChannel(int channel) { m_axes[Axis::kTwist] = channel; }
+
+/**
+ * Set the channel associated with the throttle axis.
+ *
+ * @param axis    The axis to set the channel for.
+ * @param channel The channel to set the axis to.
+ */
+void Joystick::SetThrottleChannel(int channel) {
+  m_axes[Axis::kThrottle] = channel;
+}
+
+/**
+ * Get the channel currently associated with the X axis.
+ *
+ * @return The channel for the axis.
+ */
+int Joystick::GetXChannel() const { return m_axes[Axis::kX]; }
+
+/**
+ * Get the channel currently associated with the Y axis.
+ *
+ * @return The channel for the axis.
+ */
+int Joystick::GetYChannel() const { return m_axes[Axis::kY]; }
+
+/**
+ * Get the channel currently associated with the Z axis.
+ *
+ * @return The channel for the axis.
+ */
+int Joystick::GetZChannel() const { return m_axes[Axis::kZ]; }
+
+/**
+ * Get the channel currently associated with the twist axis.
+ *
+ * @return The channel for the axis.
+ */
+int Joystick::GetTwistChannel() const { return m_axes[Axis::kTwist]; }
+
+/**
+ * Get the channel currently associated with the throttle axis.
+ *
+ * @return The channel for the axis.
+ */
+int Joystick::GetThrottleChannel() const { return m_axes[Axis::kThrottle]; }
+
+/**
+ * Get the X value of the joystick.
+ *
+ * This depends on the mapping of the joystick connected to the current port.
+ *
+ * @param hand This parameter is ignored for the Joystick class and is only
+ *             here to complete the GenericHID interface.
+ */
+double Joystick::GetX(JoystickHand hand) const {
+  return GetRawAxis(m_axes[kDefaultXAxis]);
+}
+
+/**
+ * Get the Y value of the joystick.
+ *
+ * This depends on the mapping of the joystick connected to the current port.
+ *
+ * @param hand This parameter is ignored for the Joystick class and is only
+ *             here to complete the GenericHID interface.
+ */
+double Joystick::GetY(JoystickHand hand) const {
+  return GetRawAxis(m_axes[kDefaultYAxis]);
+}
+
+/**
+ * Get the Z value of the current joystick.
+ *
+ * This depends on the mapping of the joystick connected to the current port.
+ */
+double Joystick::GetZ() const { return GetRawAxis(m_axes[kDefaultZAxis]); }
+
+/**
+ * Get the twist value of the current joystick.
+ *
+ * This depends on the mapping of the joystick connected to the current port.
+ */
+double Joystick::GetTwist() const {
+  return GetRawAxis(m_axes[kDefaultTwistAxis]);
+}
+
+/**
+ * Get the throttle value of the current joystick.
+ *
+ * This depends on the mapping of the joystick connected to the current port.
+ */
+double Joystick::GetThrottle() const {
+  return GetRawAxis(m_axes[kDefaultThrottleAxis]);
+}
+
+/**
+ * For the current joystick, return the axis determined by the argument.
+ *
+ * This is for cases where the joystick axis is returned programatically,
+ * otherwise one of the previous functions would be preferable (for example
+ * GetX()).
+ *
+ * @param axis The axis to read.
+ * @return The value of the axis.
+ */
+double Joystick::GetAxis(AxisType axis) const {
+  switch (axis) {
+    case kXAxis:
+      return GetX();
+    case kYAxis:
+      return GetY();
+    case kZAxis:
+      return GetZ();
+    case kTwistAxis:
+      return GetTwist();
+    case kThrottleAxis:
+      return GetThrottle();
+    default:
+      wpi_setWPIError(BadJoystickAxis);
+      return 0.0;
+  }
+}
+
+/**
+ * Read the state of the trigger on the joystick.
+ *
+ * Look up which button has been assigned to the trigger and read its state.
+ *
+ * @return The state of the trigger.
+ */
+bool Joystick::GetTrigger() const { return GetRawButton(Button::kTrigger); }
+
+/**
+ * Whether the trigger was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool Joystick::GetTriggerPressed() {
+  return GetRawButtonPressed(Button::kTrigger);
+}
+
+/**
+ * Whether the trigger was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool Joystick::GetTriggerReleased() {
+  return GetRawButtonReleased(Button::kTrigger);
+}
+
+/**
+ * Read the state of the top button on the joystick.
+ *
+ * Look up which button has been assigned to the top and read its state.
+ *
+ * @return The state of the top button.
+ */
+bool Joystick::GetTop() const { return GetRawButton(Button::kTop); }
+
+/**
+ * Whether the top button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool Joystick::GetTopPressed() { return GetRawButtonPressed(Button::kTop); }
+
+/**
+ * Whether the top button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool Joystick::GetTopReleased() { return GetRawButtonReleased(Button::kTop); }
+
+Joystick* Joystick::GetStickForPort(int port) {
+  static std::array<std::unique_ptr<Joystick>, DriverStation::kJoystickPorts>
+      joysticks{};
+  auto stick = joysticks[port].get();
+  if (stick == nullptr) {
+    joysticks[port] = std::make_unique<Joystick>(port);
+    stick = joysticks[port].get();
+  }
+  return stick;
+}
+
+/**
+ * Get buttons based on an enumerated type.
+ *
+ * The button type will be looked up in the list of buttons and then read.
+ *
+ * @param button The type of button to read.
+ * @return The state of the button.
+ */
+bool Joystick::GetButton(ButtonType button) const {
+  int temp = button;
+  return GetRawButton(static_cast<Button>(temp));
+}
+
+/**
+ * Get the magnitude of the direction vector formed by the joystick's
+ * current position relative to its origin.
+ *
+ * @return The magnitude of the direction vector
+ */
+double Joystick::GetMagnitude() const {
+  return std::sqrt(std::pow(GetX(), 2) + std::pow(GetY(), 2));
+}
+
+/**
+ * Get the direction of the vector formed by the joystick and its origin
+ * in radians.
+ *
+ * @return The direction of the vector in radians
+ */
+double Joystick::GetDirectionRadians() const {
+  return std::atan2(GetX(), -GetY());
+}
+
+/**
+ * Get the direction of the vector formed by the joystick and its origin
+ * in degrees.
+ *
+ * @return The direction of the vector in degrees
+ */
+double Joystick::GetDirectionDegrees() const {
+  return (180 / kPi) * GetDirectionRadians();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/JoystickBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/JoystickBase.cpp
new file mode 100644
index 0000000..c2822d6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/JoystickBase.cpp
@@ -0,0 +1,12 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "JoystickBase.h"
+
+using namespace frc;
+
+JoystickBase::JoystickBase(int port) : GenericHID(port) {}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/LiveWindow/LiveWindow.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/LiveWindow/LiveWindow.cpp
new file mode 100644
index 0000000..7622a9b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/LiveWindow/LiveWindow.cpp
@@ -0,0 +1,351 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2012-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "LiveWindow/LiveWindow.h"
+
+#include <algorithm>
+
+#include <llvm/DenseMap.h>
+#include <llvm/SmallString.h>
+#include <llvm/raw_ostream.h>
+#include <networktables/NetworkTable.h>
+#include <networktables/NetworkTableEntry.h>
+#include <networktables/NetworkTableInstance.h>
+#include <support/mutex.h>
+
+#include "Commands/Scheduler.h"
+#include "SmartDashboard/SendableBuilderImpl.h"
+
+using namespace frc;
+
+using llvm::Twine;
+
+struct LiveWindow::Impl {
+  Impl();
+
+  struct Component {
+    std::shared_ptr<Sendable> sendable;
+    Sendable* parent = nullptr;
+    SendableBuilderImpl builder;
+    bool firstTime = true;
+    bool telemetryEnabled = true;
+  };
+
+  wpi::mutex mutex;
+
+  llvm::DenseMap<void*, Component> components;
+
+  std::shared_ptr<nt::NetworkTable> liveWindowTable;
+  std::shared_ptr<nt::NetworkTable> statusTable;
+  nt::NetworkTableEntry enabledEntry;
+
+  bool startLiveWindow = false;
+  bool liveWindowEnabled = false;
+  bool telemetryEnabled = true;
+};
+
+LiveWindow::Impl::Impl()
+    : liveWindowTable(
+          nt::NetworkTableInstance::GetDefault().GetTable("LiveWindow")) {
+  statusTable = liveWindowTable->GetSubTable(".status");
+  enabledEntry = statusTable->GetEntry("LW Enabled");
+}
+
+/**
+ * Get an instance of the LiveWindow main class.
+ *
+ * This is a singleton to guarantee that there is only a single instance
+ * regardless of how many times GetInstance is called.
+ */
+LiveWindow* LiveWindow::GetInstance() {
+  static LiveWindow instance;
+  return &instance;
+}
+
+/**
+ * LiveWindow constructor.
+ *
+ * Allocate the necessary tables.
+ */
+LiveWindow::LiveWindow() : m_impl(new Impl) {}
+
+bool LiveWindow::IsEnabled() const {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  return m_impl->liveWindowEnabled;
+}
+
+/**
+ * Change the enabled status of LiveWindow.
+ *
+ * If it changes to enabled, start livewindow running otherwise stop it
+ */
+void LiveWindow::SetEnabled(bool enabled) {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  if (m_impl->liveWindowEnabled == enabled) return;
+  Scheduler* scheduler = Scheduler::GetInstance();
+  if (enabled) {
+    scheduler->SetEnabled(false);
+    scheduler->RemoveAll();
+  } else {
+    for (auto& i : m_impl->components) {
+      i.getSecond().builder.StopLiveWindowMode();
+    }
+    scheduler->SetEnabled(true);
+  }
+  m_impl->startLiveWindow = enabled;
+  m_impl->liveWindowEnabled = enabled;
+  m_impl->enabledEntry.SetBoolean(enabled);
+}
+
+/**
+ * @name AddSensor(subsystem, name, component)
+ *
+ * Add a Sensor associated with the subsystem and call it by the given name.
+ *
+ * @param subsystem The subsystem this component is part of.
+ * @param name      The name of this component.
+ * @param component A Sendable component that represents a sensor.
+ */
+//@{
+/**
+ * @brief Use a STL smart pointer to share ownership of component.
+ * @deprecated Use Sendable::SetName() instead.
+ */
+void LiveWindow::AddSensor(const llvm::Twine& subsystem,
+                           const llvm::Twine& name,
+                           std::shared_ptr<Sendable> component) {
+  Add(component);
+  component->SetName(subsystem, name);
+}
+
+/**
+ * @brief Pass a reference to LiveWindow and retain ownership of the component.
+ * @deprecated Use Sendable::SetName() instead.
+ */
+void LiveWindow::AddSensor(const llvm::Twine& subsystem,
+                           const llvm::Twine& name, Sendable& component) {
+  Add(&component);
+  component.SetName(subsystem, name);
+}
+
+/**
+ * @brief Use a raw pointer to the LiveWindow.
+ * @deprecated Use Sendable::SetName() instead.
+ */
+void LiveWindow::AddSensor(const llvm::Twine& subsystem,
+                           const llvm::Twine& name, Sendable* component) {
+  Add(component);
+  component->SetName(subsystem, name);
+}
+//@}
+
+/**
+ * @name AddActuator(subsystem, name, component)
+ *
+ * Add an Actuator associated with the subsystem and call it by the given name.
+ * @deprecated Use Sendable::SetName() instead.
+ *
+ * @param subsystem The subsystem this component is part of.
+ * @param name      The name of this component.
+ * @param component A Sendable component that represents a actuator.
+ */
+//@{
+/**
+ * @brief Use a STL smart pointer to share ownership of component.
+ */
+void LiveWindow::AddActuator(const llvm::Twine& subsystem,
+                             const llvm::Twine& name,
+                             std::shared_ptr<Sendable> component) {
+  Add(component);
+  component->SetName(subsystem, name);
+}
+
+/**
+ * @brief Pass a reference to LiveWindow and retain ownership of the component.
+ * @deprecated Use Sendable::SetName() instead.
+ */
+void LiveWindow::AddActuator(const llvm::Twine& subsystem,
+                             const llvm::Twine& name, Sendable& component) {
+  Add(&component);
+  component.SetName(subsystem, name);
+}
+
+/**
+ * @brief Use a raw pointer to the LiveWindow.
+ * @deprecated Use Sendable::SetName() instead.
+ */
+void LiveWindow::AddActuator(const llvm::Twine& subsystem,
+                             const llvm::Twine& name, Sendable* component) {
+  Add(component);
+  component->SetName(subsystem, name);
+}
+//@}
+
+/**
+ * Meant for internal use in other WPILib classes.
+ * @deprecated Use SensorBase::SetName() instead.
+ */
+void LiveWindow::AddSensor(const llvm::Twine& type, int channel,
+                           Sendable* component) {
+  Add(component);
+  component->SetName("Ungrouped",
+                     type + Twine('[') + Twine(channel) + Twine(']'));
+}
+
+/**
+ * Meant for internal use in other WPILib classes.
+ * @deprecated Use SensorBase::SetName() instead.
+ */
+void LiveWindow::AddActuator(const llvm::Twine& type, int channel,
+                             Sendable* component) {
+  Add(component);
+  component->SetName("Ungrouped",
+                     type + Twine('[') + Twine(channel) + Twine(']'));
+}
+
+/**
+ * Meant for internal use in other WPILib classes.
+ * @deprecated Use SensorBase::SetName() instead.
+ */
+void LiveWindow::AddActuator(const llvm::Twine& type, int module, int channel,
+                             Sendable* component) {
+  Add(component);
+  component->SetName("Ungrouped", type + Twine('[') + Twine(module) +
+                                      Twine(',') + Twine(channel) + Twine(']'));
+}
+
+/**
+ * Add a component to the LiveWindow.
+ *
+ * @param sendable component to add
+ */
+void LiveWindow::Add(std::shared_ptr<Sendable> sendable) {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  auto& comp = m_impl->components[sendable.get()];
+  comp.sendable = sendable;
+}
+
+/**
+ * Add a component to the LiveWindow.
+ *
+ * @param sendable component to add
+ */
+void LiveWindow::Add(Sendable* sendable) {
+  Add(std::shared_ptr<Sendable>(sendable, NullDeleter<Sendable>()));
+}
+
+/**
+ * Add a child component to a component.
+ *
+ * @param parent parent component
+ * @param child child component
+ */
+void LiveWindow::AddChild(Sendable* parent, std::shared_ptr<Sendable> child) {
+  AddChild(parent, child.get());
+}
+
+/**
+ * Add a child component to a component.
+ *
+ * @param parent parent component
+ * @param child child component
+ */
+void LiveWindow::AddChild(Sendable* parent, void* child) {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  auto& comp = m_impl->components[child];
+  comp.parent = parent;
+  comp.telemetryEnabled = false;
+}
+
+/**
+ * Remove the component from the LiveWindow.
+ *
+ * @param sendable component to remove
+ */
+void LiveWindow::Remove(Sendable* sendable) {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  m_impl->components.erase(sendable);
+}
+
+/**
+ * Enable telemetry for a single component.
+ *
+ * @param sendable component
+ */
+void LiveWindow::EnableTelemetry(Sendable* sendable) {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  // Re-enable global setting in case DisableAllTelemetry() was called.
+  m_impl->telemetryEnabled = true;
+  auto i = m_impl->components.find(sendable);
+  if (i != m_impl->components.end()) i->getSecond().telemetryEnabled = true;
+}
+
+/**
+ * Disable telemetry for a single component.
+ *
+ * @param sendable component
+ */
+void LiveWindow::DisableTelemetry(Sendable* sendable) {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  auto i = m_impl->components.find(sendable);
+  if (i != m_impl->components.end()) i->getSecond().telemetryEnabled = false;
+}
+
+/**
+ * Disable ALL telemetry.
+ */
+void LiveWindow::DisableAllTelemetry() {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  m_impl->telemetryEnabled = false;
+  for (auto& i : m_impl->components) i.getSecond().telemetryEnabled = false;
+}
+
+/**
+ * Tell all the sensors to update (send) their values.
+ *
+ * Actuators are handled through callbacks on their value changing from the
+ * SmartDashboard widgets.
+ */
+void LiveWindow::UpdateValues() {
+  std::lock_guard<wpi::mutex> lock(m_impl->mutex);
+  // Only do this if either LiveWindow mode or telemetry is enabled.
+  if (!m_impl->liveWindowEnabled && !m_impl->telemetryEnabled) return;
+
+  for (auto& i : m_impl->components) {
+    auto& comp = i.getSecond();
+    if (comp.sendable && !comp.parent &&
+        (m_impl->liveWindowEnabled || comp.telemetryEnabled)) {
+      if (comp.firstTime) {
+        // By holding off creating the NetworkTable entries, it allows the
+        // components to be redefined. This allows default sensor and actuator
+        // values to be created that are replaced with the custom names from
+        // users calling setName.
+        auto name = comp.sendable->GetName();
+        if (name.empty()) continue;
+        auto subsystem = comp.sendable->GetSubsystem();
+        auto ssTable = m_impl->liveWindowTable->GetSubTable(subsystem);
+        std::shared_ptr<NetworkTable> table;
+        // Treat name==subsystem as top level of subsystem
+        if (name == subsystem)
+          table = ssTable;
+        else
+          table = ssTable->GetSubTable(name);
+        table->GetEntry(".name").SetString(name);
+        comp.builder.SetTable(table);
+        comp.sendable->InitSendable(comp.builder);
+        ssTable->GetEntry(".type").SetString("LW Subsystem");
+
+        comp.firstTime = false;
+      }
+
+      if (m_impl->startLiveWindow) comp.builder.StartLiveWindowMode();
+      comp.builder.UpdateTable();
+    }
+  }
+
+  m_impl->startLiveWindow = false;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/LiveWindow/LiveWindowSendable.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/LiveWindow/LiveWindowSendable.cpp
new file mode 100644
index 0000000..bddb136
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/LiveWindow/LiveWindowSendable.cpp
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "LiveWindow/LiveWindowSendable.h"
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+std::string LiveWindowSendable::GetName() const { return std::string(); }
+
+void LiveWindowSendable::SetName(const llvm::Twine&) {}
+
+std::string LiveWindowSendable::GetSubsystem() const { return std::string(); }
+
+void LiveWindowSendable::SetSubsystem(const llvm::Twine&) {}
+
+void LiveWindowSendable::InitSendable(SendableBuilder& builder) {
+  builder.SetUpdateTable([=]() { UpdateTable(); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/MotorSafetyHelper.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/MotorSafetyHelper.cpp
new file mode 100644
index 0000000..a0e7d75
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/MotorSafetyHelper.cpp
@@ -0,0 +1,156 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "MotorSafetyHelper.h"
+
+#include <llvm/SmallString.h>
+#include <llvm/raw_ostream.h>
+
+#include "DriverStation.h"
+#include "MotorSafety.h"
+#include "Timer.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+std::set<MotorSafetyHelper*> MotorSafetyHelper::m_helperList;
+wpi::mutex MotorSafetyHelper::m_listMutex;
+
+/**
+ * The constructor for a MotorSafetyHelper object.
+ *
+ * The helper object is constructed for every object that wants to implement the
+ * Motor Safety protocol. The helper object has the code to actually do the
+ * timing and call the motors Stop() method when the timeout expires. The motor
+ * object is expected to call the Feed() method whenever the motors value is
+ * updated.
+ *
+ * @param safeObject a pointer to the motor object implementing MotorSafety.
+ *                   This is used to call the Stop() method on the motor.
+ */
+MotorSafetyHelper::MotorSafetyHelper(MotorSafety* safeObject)
+    : m_safeObject(safeObject) {
+  m_enabled = false;
+  m_expiration = DEFAULT_SAFETY_EXPIRATION;
+  m_stopTime = Timer::GetFPGATimestamp();
+
+  std::lock_guard<wpi::mutex> lock(m_listMutex);
+  m_helperList.insert(this);
+}
+
+MotorSafetyHelper::~MotorSafetyHelper() {
+  std::lock_guard<wpi::mutex> lock(m_listMutex);
+  m_helperList.erase(this);
+}
+
+/**
+ * Feed the motor safety object.
+ *
+ * Resets the timer on this object that is used to do the timeouts.
+ */
+void MotorSafetyHelper::Feed() {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_stopTime = Timer::GetFPGATimestamp() + m_expiration;
+}
+
+/**
+ * Set the expiration time for the corresponding motor safety object.
+ *
+ * @param expirationTime The timeout value in seconds.
+ */
+void MotorSafetyHelper::SetExpiration(double expirationTime) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_expiration = expirationTime;
+}
+
+/**
+ * Retrieve the timeout value for the corresponding motor safety object.
+ *
+ * @return the timeout value in seconds.
+ */
+double MotorSafetyHelper::GetExpiration() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_expiration;
+}
+
+/**
+ * Determine if the motor is still operating or has timed out.
+ *
+ * @return a true value if the motor is still operating normally and hasn't
+ * timed out.
+ */
+bool MotorSafetyHelper::IsAlive() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return !m_enabled || m_stopTime > Timer::GetFPGATimestamp();
+}
+
+/**
+ * Check if this motor has exceeded its timeout.
+ *
+ * This method is called periodically to determine if this motor has exceeded
+ * its timeout value. If it has, the stop method is called, and the motor is
+ * shut down until its value is updated again.
+ */
+void MotorSafetyHelper::Check() {
+  bool enabled;
+  double stopTime;
+
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    enabled = m_enabled;
+    stopTime = m_stopTime;
+  }
+
+  DriverStation& ds = DriverStation::GetInstance();
+  if (!enabled || ds.IsDisabled() || ds.IsTest()) return;
+
+  if (stopTime < Timer::GetFPGATimestamp()) {
+    llvm::SmallString<128> buf;
+    llvm::raw_svector_ostream desc(buf);
+    m_safeObject->GetDescription(desc);
+    desc << "... Output not updated often enough.";
+    wpi_setWPIErrorWithContext(Timeout, desc.str());
+    m_safeObject->StopMotor();
+  }
+}
+
+/**
+ * Enable/disable motor safety for this device
+ *
+ * Turn on and off the motor safety option for this PWM object.
+ *
+ * @param enabled True if motor safety is enforced for this object
+ */
+void MotorSafetyHelper::SetSafetyEnabled(bool enabled) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_enabled = enabled;
+}
+
+/**
+ * Return the state of the motor safety enabled flag
+ *
+ * Return if the motor safety is currently enabled for this devicce.
+ *
+ * @return True if motor safety is enforced for this device
+ */
+bool MotorSafetyHelper::IsSafetyEnabled() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_enabled;
+}
+
+/**
+ * Check the motors to see if any have timed out.
+ *
+ * This static method is called periodically to poll all the motors and stop any
+ * that have timed out.
+ */
+void MotorSafetyHelper::CheckMotors() {
+  std::lock_guard<wpi::mutex> lock(m_listMutex);
+  for (auto elem : m_helperList) {
+    elem->Check();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/NidecBrushless.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/NidecBrushless.cpp
new file mode 100644
index 0000000..bb5869c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/NidecBrushless.cpp
@@ -0,0 +1,155 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NidecBrushless.h"
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+/**
+ * Constructor.
+ *
+ * @param pwmChannel The PWM channel that the Nidec Brushless controller is
+ *                   attached to. 0-9 are on-board, 10-19 are on the MXP port.
+ * @param dioChannel The DIO channel that the Nidec Brushless controller is
+ *                   attached to. 0-9 are on-board, 10-25 are on the MXP port.
+ */
+NidecBrushless::NidecBrushless(int pwmChannel, int dioChannel)
+    : m_safetyHelper(this), m_dio(dioChannel), m_pwm(pwmChannel) {
+  AddChild(&m_dio);
+  AddChild(&m_pwm);
+  m_safetyHelper.SetExpiration(0.0);
+  m_safetyHelper.SetSafetyEnabled(false);
+
+  // the dio controls the output (in PWM mode)
+  m_dio.SetPWMRate(15625);
+  m_dio.EnablePWM(0.5);
+
+  HAL_Report(HALUsageReporting::kResourceType_NidecBrushless, pwmChannel);
+  SetName("Nidec Brushless", pwmChannel);
+}
+
+/**
+ * Set the PWM value.
+ *
+ * The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the
+ * value for the FPGA.
+ *
+ * @param speed The speed value between -1.0 and 1.0 to set.
+ */
+void NidecBrushless::Set(double speed) {
+  if (!m_disabled) {
+    m_speed = speed;
+    m_dio.UpdateDutyCycle(0.5 + 0.5 * (m_isInverted ? -speed : speed));
+    m_pwm.SetRaw(0xffff);
+  }
+  m_safetyHelper.Feed();
+}
+
+/**
+ * Get the recently set value of the PWM.
+ *
+ * @return The most recently set value for the PWM between -1.0 and 1.0.
+ */
+double NidecBrushless::Get() const { return m_speed; }
+
+void NidecBrushless::SetInverted(bool isInverted) { m_isInverted = isInverted; }
+
+bool NidecBrushless::GetInverted() const { return m_isInverted; }
+
+/**
+ * Write out the PID value as seen in the PIDOutput base object.
+ *
+ * @param output Write out the PWM value as was found in the PIDController
+ */
+void NidecBrushless::PIDWrite(double output) { Set(output); }
+
+/**
+ * Set the safety expiration time.
+ *
+ * @param timeout The timeout (in seconds) for this motor object
+ */
+void NidecBrushless::SetExpiration(double timeout) {
+  m_safetyHelper.SetExpiration(timeout);
+}
+
+/**
+ * Return the safety expiration time.
+ *
+ * @return The expiration time value.
+ */
+double NidecBrushless::GetExpiration() const {
+  return m_safetyHelper.GetExpiration();
+}
+
+/**
+ * Check if the motor is currently alive or stopped due to a timeout.
+ *
+ * @return a bool value that is true if the motor has NOT timed out and should
+ *         still be running.
+ */
+bool NidecBrushless::IsAlive() const { return m_safetyHelper.IsAlive(); }
+
+/**
+ * Stop the motor. This is called by the MotorSafetyHelper object when it has a
+ * timeout for this PWM and needs to stop it from running. Calling Set() will
+ * re-enable the motor.
+ */
+void NidecBrushless::StopMotor() {
+  m_dio.UpdateDutyCycle(0.5);
+  m_pwm.SetDisabled();
+}
+
+/**
+ * Check if motor safety is enabled.
+ *
+ * @return True if motor safety is enforced for this object
+ */
+bool NidecBrushless::IsSafetyEnabled() const {
+  return m_safetyHelper.IsSafetyEnabled();
+}
+
+void NidecBrushless::SetSafetyEnabled(bool enabled) {
+  m_safetyHelper.SetSafetyEnabled(enabled);
+}
+
+void NidecBrushless::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "Nidec " << GetChannel();
+}
+
+/**
+ * Disable the motor.  The Enable() function must be called to re-enable
+ * the motor.
+ */
+void NidecBrushless::Disable() {
+  m_disabled = true;
+  m_dio.UpdateDutyCycle(0.5);
+  m_pwm.SetDisabled();
+}
+
+/**
+ * Re-enable the motor after Disable() has been called.  The Set()
+ * function must be called to set a new motor speed.
+ */
+void NidecBrushless::Enable() { m_disabled = false; }
+
+/**
+ * Gets the channel number associated with the object.
+ *
+ * @return The channel number.
+ */
+int NidecBrushless::GetChannel() const { return m_pwm.GetChannel(); }
+
+void NidecBrushless::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Nidec Brushless");
+  builder.SetSafeState([=]() { StopMotor(); });
+  builder.AddDoubleProperty("Value", [=]() { return Get(); },
+                            [=](double value) { Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Notifier.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Notifier.cpp
new file mode 100644
index 0000000..81bf7f9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Notifier.cpp
@@ -0,0 +1,141 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Notifier.h"
+
+#include <HAL/HAL.h>
+
+#include "Timer.h"
+#include "Utility.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Create a Notifier for timer event notification.
+ *
+ * @param handler The handler is called at the notification time which is set
+ *                using StartSingle or StartPeriodic.
+ */
+Notifier::Notifier(TimerEventHandler handler) {
+  if (handler == nullptr)
+    wpi_setWPIErrorWithContext(NullParameter, "handler must not be nullptr");
+  m_handler = handler;
+  int32_t status = 0;
+  m_notifier = HAL_InitializeNotifier(&status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  m_thread = std::thread([=] {
+    for (;;) {
+      int32_t status = 0;
+      HAL_NotifierHandle notifier = m_notifier.load();
+      if (notifier == 0) break;
+      uint64_t curTime = HAL_WaitForNotifierAlarm(notifier, &status);
+      if (curTime == 0 || status != 0) break;
+
+      TimerEventHandler handler;
+      {
+        std::lock_guard<wpi::mutex> lock(m_processMutex);
+        handler = m_handler;
+        if (m_periodic) {
+          m_expirationTime += m_period;
+          UpdateAlarm();
+        }
+      }
+
+      // call callback
+      if (handler) handler();
+    }
+  });
+}
+
+/**
+ * Free the resources for a timer event.
+ */
+Notifier::~Notifier() {
+  int32_t status = 0;
+  // atomically set handle to 0, then clean
+  HAL_NotifierHandle handle = m_notifier.exchange(0);
+  HAL_StopNotifier(handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  // Join the thread to ensure the handler has exited.
+  if (m_thread.joinable()) m_thread.join();
+
+  HAL_CleanNotifier(handle, &status);
+}
+
+/**
+ * Update the HAL alarm time.
+ */
+void Notifier::UpdateAlarm() {
+  int32_t status = 0;
+  // Return if we are being destructed, or were not created successfully
+  auto notifier = m_notifier.load();
+  if (notifier == 0) return;
+  HAL_UpdateNotifierAlarm(
+      notifier, static_cast<uint64_t>(m_expirationTime * 1e6), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Change the handler function.
+ *
+ * @param handler Handler
+ */
+void Notifier::SetHandler(TimerEventHandler handler) {
+  std::lock_guard<wpi::mutex> lock(m_processMutex);
+  m_handler = handler;
+}
+
+/**
+ * Register for single event notification.
+ *
+ * A timer event is queued for a single event after the specified delay.
+ *
+ * @param delay Seconds to wait before the handler is called.
+ */
+void Notifier::StartSingle(double delay) {
+  std::lock_guard<wpi::mutex> lock(m_processMutex);
+  m_periodic = false;
+  m_period = delay;
+  m_expirationTime = Timer::GetFPGATimestamp() + m_period;
+  UpdateAlarm();
+}
+
+/**
+ * Register for periodic event notification.
+ *
+ * A timer event is queued for periodic event notification. Each time the
+ * interrupt occurs, the event will be immediately requeued for the same time
+ * interval.
+ *
+ * @param period Period in seconds to call the handler starting one period
+ *               after the call to this method.
+ */
+void Notifier::StartPeriodic(double period) {
+  std::lock_guard<wpi::mutex> lock(m_processMutex);
+  m_periodic = true;
+  m_period = period;
+  m_expirationTime = Timer::GetFPGATimestamp() + m_period;
+  UpdateAlarm();
+}
+
+/**
+ * Stop timer events from occuring.
+ *
+ * Stop any repeating timer events from occuring. This will also remove any
+ * single notification events from the queue.
+ *
+ * If a timer-based call to the registered handler is in progress, this function
+ * will block until the handler call is complete.
+ */
+void Notifier::Stop() {
+  int32_t status = 0;
+  HAL_CancelNotifierAlarm(m_notifier, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PIDController.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PIDController.cpp
new file mode 100644
index 0000000..1e38e22
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PIDController.cpp
@@ -0,0 +1,667 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PIDController.h"
+
+#include <algorithm>
+#include <cmath>
+#include <vector>
+
+#include <HAL/HAL.h>
+
+#include "Notifier.h"
+#include "PIDOutput.h"
+#include "PIDSource.h"
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+template <class T>
+constexpr const T& clamp(const T& value, const T& low, const T& high) {
+  return std::max(low, std::min(value, high));
+}
+
+/**
+ * Allocate a PID object with the given constants for P, I, D.
+ *
+ * @param Kp     the proportional coefficient
+ * @param Ki     the integral coefficient
+ * @param Kd     the derivative coefficient
+ * @param source The PIDSource object that is used to get values
+ * @param output The PIDOutput object that is set to the output value
+ * @param period the loop time for doing calculations. This particularly
+ *               effects calculations of the integral and differental terms.
+ *               The default is 50ms.
+ */
+PIDController::PIDController(double Kp, double Ki, double Kd, PIDSource* source,
+                             PIDOutput* output, double period)
+    : PIDController(Kp, Ki, Kd, 0.0, source, output, period) {}
+
+/**
+ * Allocate a PID object with the given constants for P, I, D.
+ *
+ * @param Kp     the proportional coefficient
+ * @param Ki     the integral coefficient
+ * @param Kd     the derivative coefficient
+ * @param source The PIDSource object that is used to get values
+ * @param output The PIDOutput object that is set to the output value
+ * @param period the loop time for doing calculations. This particularly
+ *               effects calculations of the integral and differental terms.
+ *               The default is 50ms.
+ */
+PIDController::PIDController(double Kp, double Ki, double Kd, double Kf,
+                             PIDSource* source, PIDOutput* output,
+                             double period)
+    : SendableBase(false) {
+  m_controlLoop = std::make_unique<Notifier>(&PIDController::Calculate, this);
+
+  m_P = Kp;
+  m_I = Ki;
+  m_D = Kd;
+  m_F = Kf;
+
+  // Save original source
+  m_origSource = std::shared_ptr<PIDSource>(source, NullDeleter<PIDSource>());
+
+  // Create LinearDigitalFilter with original source as its source argument
+  m_filter = LinearDigitalFilter::MovingAverage(m_origSource, 1);
+  m_pidInput = &m_filter;
+
+  m_pidOutput = output;
+  m_period = period;
+
+  m_controlLoop->StartPeriodic(m_period);
+  m_setpointTimer.Start();
+
+  static int instances = 0;
+  instances++;
+  HAL_Report(HALUsageReporting::kResourceType_PIDController, instances);
+  SetName("PIDController", instances);
+}
+
+/**
+ * Allocate a PID object with the given constants for P, I, D.
+ *
+ * @param Kp     the proportional coefficient
+ * @param Ki     the integral coefficient
+ * @param Kd     the derivative coefficient
+ * @param source The PIDSource object that is used to get values
+ * @param output The PIDOutput object that is set to the output value
+ * @param period the loop time for doing calculations. This particularly
+ *               effects calculations of the integral and differental terms.
+ *               The default is 50ms.
+ */
+PIDController::PIDController(double Kp, double Ki, double Kd, PIDSource& source,
+                             PIDOutput& output, double period)
+    : PIDController(Kp, Ki, Kd, 0.0, &source, &output, period) {}
+
+/**
+ * Allocate a PID object with the given constants for P, I, D.
+ *
+ * @param Kp     the proportional coefficient
+ * @param Ki     the integral coefficient
+ * @param Kd     the derivative coefficient
+ * @param source The PIDSource object that is used to get values
+ * @param output The PIDOutput object that is set to the output value
+ * @param period the loop time for doing calculations. This particularly
+ *               effects calculations of the integral and differental terms.
+ *               The default is 50ms.
+ */
+PIDController::PIDController(double Kp, double Ki, double Kd, double Kf,
+                             PIDSource& source, PIDOutput& output,
+                             double period)
+    : PIDController(Kp, Ki, Kd, Kf, &source, &output, period) {}
+
+PIDController::~PIDController() {
+  // forcefully stopping the notifier so the callback can successfully run.
+  m_controlLoop->Stop();
+}
+
+/**
+ * Read the input, calculate the output accordingly, and write to the output.
+ * This should only be called by the Notifier.
+ */
+void PIDController::Calculate() {
+  if (m_origSource == nullptr || m_pidOutput == nullptr) return;
+
+  bool enabled;
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    enabled = m_enabled;
+  }
+
+  if (enabled) {
+    double input;
+
+    // Storage for function inputs
+    PIDSourceType pidSourceType;
+    double P;
+    double I;
+    double D;
+    double feedForward = CalculateFeedForward();
+    double minimumOutput;
+    double maximumOutput;
+
+    // Storage for function input-outputs
+    double prevError;
+    double error;
+    double totalError;
+
+    {
+      std::lock_guard<wpi::mutex> lock(m_thisMutex);
+
+      input = m_pidInput->PIDGet();
+
+      pidSourceType = m_pidInput->GetPIDSourceType();
+      P = m_P;
+      I = m_I;
+      D = m_D;
+      minimumOutput = m_minimumOutput;
+      maximumOutput = m_maximumOutput;
+
+      prevError = m_prevError;
+      error = GetContinuousError(m_setpoint - input);
+      totalError = m_totalError;
+    }
+
+    // Storage for function outputs
+    double result;
+
+    if (pidSourceType == PIDSourceType::kRate) {
+      if (P != 0) {
+        totalError =
+            clamp(totalError + error, minimumOutput / P, maximumOutput / P);
+      }
+
+      result = D * error + P * totalError + feedForward;
+    } else {
+      if (I != 0) {
+        totalError =
+            clamp(totalError + error, minimumOutput / I, maximumOutput / I);
+      }
+
+      result =
+          P * error + I * totalError + D * (error - prevError) + feedForward;
+    }
+
+    result = clamp(result, minimumOutput, maximumOutput);
+
+    {
+      // Ensures m_enabled check and PIDWrite() call occur atomically
+      std::lock_guard<wpi::mutex> pidWriteLock(m_pidWriteMutex);
+      std::unique_lock<wpi::mutex> mainLock(m_thisMutex);
+      if (m_enabled) {
+        // Don't block other PIDController operations on PIDWrite()
+        mainLock.unlock();
+
+        m_pidOutput->PIDWrite(result);
+      }
+    }
+
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    m_prevError = m_error;
+    m_error = error;
+    m_totalError = totalError;
+    m_result = result;
+  }
+}
+
+/**
+ * Calculate the feed forward term.
+ *
+ * Both of the provided feed forward calculations are velocity feed forwards.
+ * If a different feed forward calculation is desired, the user can override
+ * this function and provide his or her own. This function does no
+ * synchronization because the PIDController class only calls it in synchronized
+ * code, so be careful if calling it oneself.
+ *
+ * If a velocity PID controller is being used, the F term should be set to 1
+ * over the maximum setpoint for the output. If a position PID controller is
+ * being used, the F term should be set to 1 over the maximum speed for the
+ * output measured in setpoint units per this controller's update period (see
+ * the default period in this class's constructor).
+ */
+double PIDController::CalculateFeedForward() {
+  if (m_pidInput->GetPIDSourceType() == PIDSourceType::kRate) {
+    return m_F * GetSetpoint();
+  } else {
+    double temp = m_F * GetDeltaSetpoint();
+    m_prevSetpoint = m_setpoint;
+    m_setpointTimer.Reset();
+    return temp;
+  }
+}
+
+/**
+ * Set the PID Controller gain parameters.
+ *
+ * Set the proportional, integral, and differential coefficients.
+ *
+ * @param p Proportional coefficient
+ * @param i Integral coefficient
+ * @param d Differential coefficient
+ */
+void PIDController::SetPID(double p, double i, double d) {
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    m_P = p;
+    m_I = i;
+    m_D = d;
+  }
+}
+
+/**
+ * Set the PID Controller gain parameters.
+ *
+ * Set the proportional, integral, and differential coefficients.
+ *
+ * @param p Proportional coefficient
+ * @param i Integral coefficient
+ * @param d Differential coefficient
+ * @param f Feed forward coefficient
+ */
+void PIDController::SetPID(double p, double i, double d, double f) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_P = p;
+  m_I = i;
+  m_D = d;
+  m_F = f;
+}
+
+/**
+ * Set the Proportional coefficient of the PID controller gain.
+ *
+ * @param p proportional coefficient
+ */
+void PIDController::SetP(double p) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_P = p;
+}
+
+/**
+ * Set the Integral coefficient of the PID controller gain.
+ *
+ * @param i integral coefficient
+ */
+void PIDController::SetI(double i) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_I = i;
+}
+
+/**
+ * Set the Differential coefficient of the PID controller gain.
+ *
+ * @param d differential coefficient
+ */
+void PIDController::SetD(double d) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_D = d;
+}
+
+/**
+ * Get the Feed forward coefficient of the PID controller gain.
+ *
+ * @param f Feed forward coefficient
+ */
+void PIDController::SetF(double f) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_F = f;
+}
+
+/**
+ * Get the Proportional coefficient.
+ *
+ * @return proportional coefficient
+ */
+double PIDController::GetP() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_P;
+}
+
+/**
+ * Get the Integral coefficient.
+ *
+ * @return integral coefficient
+ */
+double PIDController::GetI() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_I;
+}
+
+/**
+ * Get the Differential coefficient.
+ *
+ * @return differential coefficient
+ */
+double PIDController::GetD() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_D;
+}
+
+/**
+ * Get the Feed forward coefficient.
+ *
+ * @return Feed forward coefficient
+ */
+double PIDController::GetF() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_F;
+}
+
+/**
+ * Return the current PID result.
+ *
+ * This is always centered on zero and constrained the the max and min outs.
+ *
+ * @return the latest calculated output
+ */
+double PIDController::Get() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_result;
+}
+
+/**
+ * Set the PID controller to consider the input to be continuous,
+ *
+ * Rather then using the max and min input range as constraints, it considers
+ * them to be the same point and automatically calculates the shortest route to
+ * the setpoint.
+ *
+ * @param continuous true turns on continuous, false turns off continuous
+ */
+void PIDController::SetContinuous(bool continuous) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_continuous = continuous;
+}
+
+/**
+ * Sets the maximum and minimum values expected from the input.
+ *
+ * @param minimumInput the minimum value expected from the input
+ * @param maximumInput the maximum value expected from the output
+ */
+void PIDController::SetInputRange(double minimumInput, double maximumInput) {
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    m_minimumInput = minimumInput;
+    m_maximumInput = maximumInput;
+    m_inputRange = maximumInput - minimumInput;
+  }
+
+  SetSetpoint(m_setpoint);
+}
+
+/**
+ * Sets the minimum and maximum values to write.
+ *
+ * @param minimumOutput the minimum value to write to the output
+ * @param maximumOutput the maximum value to write to the output
+ */
+void PIDController::SetOutputRange(double minimumOutput, double maximumOutput) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_minimumOutput = minimumOutput;
+  m_maximumOutput = maximumOutput;
+}
+
+/**
+ * Set the setpoint for the PIDController.
+ *
+ * @param setpoint the desired setpoint
+ */
+void PIDController::SetSetpoint(double setpoint) {
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+
+    if (m_maximumInput > m_minimumInput) {
+      if (setpoint > m_maximumInput)
+        m_setpoint = m_maximumInput;
+      else if (setpoint < m_minimumInput)
+        m_setpoint = m_minimumInput;
+      else
+        m_setpoint = setpoint;
+    } else {
+      m_setpoint = setpoint;
+    }
+  }
+}
+
+/**
+ * Returns the current setpoint of the PIDController.
+ *
+ * @return the current setpoint
+ */
+double PIDController::GetSetpoint() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_setpoint;
+}
+
+/**
+ * Returns the change in setpoint over time of the PIDController.
+ *
+ * @return the change in setpoint over time
+ */
+double PIDController::GetDeltaSetpoint() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return (m_setpoint - m_prevSetpoint) / m_setpointTimer.Get();
+}
+
+/**
+ * Returns the current difference of the input from the setpoint.
+ *
+ * @return the current error
+ */
+double PIDController::GetError() const {
+  double setpoint = GetSetpoint();
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    return GetContinuousError(setpoint - m_pidInput->PIDGet());
+  }
+}
+
+/**
+ * Returns the current average of the error over the past few iterations.
+ *
+ * You can specify the number of iterations to average with SetToleranceBuffer()
+ * (defaults to 1). This is the same value that is used for OnTarget().
+ *
+ * @return the average error
+ */
+double PIDController::GetAvgError() const { return GetError(); }
+
+/**
+ * Sets what type of input the PID controller will use.
+ */
+void PIDController::SetPIDSourceType(PIDSourceType pidSource) {
+  m_pidInput->SetPIDSourceType(pidSource);
+}
+/**
+ * Returns the type of input the PID controller is using.
+ *
+ * @return the PID controller input type
+ */
+PIDSourceType PIDController::GetPIDSourceType() const {
+  return m_pidInput->GetPIDSourceType();
+}
+
+/*
+ * Set the percentage error which is considered tolerable for use with
+ * OnTarget.
+ *
+ * @param percentage error which is tolerable
+ */
+void PIDController::SetTolerance(double percent) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_toleranceType = kPercentTolerance;
+  m_tolerance = percent;
+}
+
+/*
+ * Set the absolute error which is considered tolerable for use with
+ * OnTarget.
+ *
+ * @param percentage error which is tolerable
+ */
+void PIDController::SetAbsoluteTolerance(double absTolerance) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_toleranceType = kAbsoluteTolerance;
+  m_tolerance = absTolerance;
+}
+
+/*
+ * Set the percentage error which is considered tolerable for use with
+ * OnTarget.
+ *
+ * @param percentage error which is tolerable
+ */
+void PIDController::SetPercentTolerance(double percent) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_toleranceType = kPercentTolerance;
+  m_tolerance = percent;
+}
+
+/*
+ * Set the number of previous error samples to average for tolerancing. When
+ * determining whether a mechanism is on target, the user may want to use a
+ * rolling average of previous measurements instead of a precise position or
+ * velocity. This is useful for noisy sensors which return a few erroneous
+ * measurements when the mechanism is on target. However, the mechanism will
+ * not register as on target for at least the specified bufLength cycles.
+ *
+ * @param bufLength Number of previous cycles to average. Defaults to 1.
+ */
+void PIDController::SetToleranceBuffer(int bufLength) {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+
+  // Create LinearDigitalFilter with original source as its source argument
+  m_filter = LinearDigitalFilter::MovingAverage(m_origSource, bufLength);
+  m_pidInput = &m_filter;
+}
+
+/*
+ * Return true if the error is within the percentage of the total input range,
+ * determined by SetTolerance. This asssumes that the maximum and minimum input
+ * were set using SetInput.
+ *
+ * Currently this just reports on target as the actual value passes through the
+ * setpoint. Ideally it should be based on being within the tolerance for some
+ * period of time.
+ *
+ * This will return false until at least one input value has been computed.
+ */
+bool PIDController::OnTarget() const {
+  double error = GetError();
+
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  switch (m_toleranceType) {
+    case kPercentTolerance:
+      return std::fabs(error) < m_tolerance / 100 * m_inputRange;
+      break;
+    case kAbsoluteTolerance:
+      return std::fabs(error) < m_tolerance;
+      break;
+    case kNoTolerance:
+      // TODO: this case needs an error
+      return false;
+  }
+  return false;
+}
+
+/**
+ * Begin running the PIDController.
+ */
+void PIDController::Enable() {
+  {
+    std::lock_guard<wpi::mutex> lock(m_thisMutex);
+    m_enabled = true;
+  }
+}
+
+/**
+ * Stop running the PIDController, this sets the output to zero before stopping.
+ */
+void PIDController::Disable() {
+  {
+    // Ensures m_enabled modification and PIDWrite() call occur atomically
+    std::lock_guard<wpi::mutex> pidWriteLock(m_pidWriteMutex);
+    {
+      std::lock_guard<wpi::mutex> mainLock(m_thisMutex);
+      m_enabled = false;
+    }
+
+    m_pidOutput->PIDWrite(0);
+  }
+}
+
+/**
+ * Set the enabled state of the PIDController.
+ */
+void PIDController::SetEnabled(bool enable) {
+  if (enable) {
+    Enable();
+  } else {
+    Disable();
+  }
+}
+
+/**
+ * Return true if PIDController is enabled.
+ */
+bool PIDController::IsEnabled() const {
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  return m_enabled;
+}
+
+/**
+ * Reset the previous error, the integral term, and disable the controller.
+ */
+void PIDController::Reset() {
+  Disable();
+
+  std::lock_guard<wpi::mutex> lock(m_thisMutex);
+  m_prevError = 0;
+  m_totalError = 0;
+  m_result = 0;
+}
+
+void PIDController::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("PIDController");
+  builder.SetSafeState([=]() { Reset(); });
+  builder.AddDoubleProperty("p", [=]() { return GetP(); },
+                            [=](double value) { SetP(value); });
+  builder.AddDoubleProperty("i", [=]() { return GetI(); },
+                            [=](double value) { SetI(value); });
+  builder.AddDoubleProperty("d", [=]() { return GetD(); },
+                            [=](double value) { SetD(value); });
+  builder.AddDoubleProperty("f", [=]() { return GetF(); },
+                            [=](double value) { SetF(value); });
+  builder.AddDoubleProperty("setpoint", [=]() { return GetSetpoint(); },
+                            [=](double value) { SetSetpoint(value); });
+  builder.AddBooleanProperty("enabled", [=]() { return IsEnabled(); },
+                             [=](bool value) { SetEnabled(value); });
+}
+
+/**
+ * Wraps error around for continuous inputs. The original error is returned if
+ * continuous mode is disabled. This is an unsynchronized function.
+ *
+ * @param error The current error of the PID controller.
+ * @return Error for continuous inputs.
+ */
+double PIDController::GetContinuousError(double error) const {
+  if (m_continuous && m_inputRange != 0) {
+    error = std::fmod(error, m_inputRange);
+    if (std::fabs(error) > m_inputRange / 2) {
+      if (error > 0) {
+        return error - m_inputRange;
+      } else {
+        return error + m_inputRange;
+      }
+    }
+  }
+
+  return error;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PIDSource.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PIDSource.cpp
new file mode 100644
index 0000000..aabef3f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PIDSource.cpp
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PIDSource.h"
+
+using namespace frc;
+
+/**
+ * Set which parameter you are using as a process control variable.
+ *
+ * @param pidSource An enum to select the parameter.
+ */
+void PIDSource::SetPIDSourceType(PIDSourceType pidSource) {
+  m_pidSource = pidSource;
+}
+
+PIDSourceType PIDSource::GetPIDSourceType() const { return m_pidSource; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWM.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWM.cpp
new file mode 100644
index 0000000..cc39c94
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWM.cpp
@@ -0,0 +1,318 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PWM.h"
+
+#include <HAL/HAL.h>
+#include <HAL/PWM.h>
+#include <HAL/Ports.h>
+
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "Utility.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Allocate a PWM given a channel number.
+ *
+ * Checks channel value range and allocates the appropriate channel.
+ * The allocation is only done to help users ensure that they don't double
+ * assign channels.
+ *
+ * @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the
+ *                MXP port
+ */
+PWM::PWM(int channel) {
+  if (!SensorBase::CheckPWMChannel(channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "PWM Channel " + llvm::Twine(channel));
+    return;
+  }
+
+  int32_t status = 0;
+  m_handle = HAL_InitializePWMPort(HAL_GetPort(channel), &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumPWMChannels(), channel,
+                                 HAL_GetErrorMessage(status));
+    m_channel = std::numeric_limits<int>::max();
+    m_handle = HAL_kInvalidHandle;
+    return;
+  }
+
+  m_channel = channel;
+
+  HAL_SetPWMDisabled(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  status = 0;
+  HAL_SetPWMEliminateDeadband(m_handle, false, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  HAL_Report(HALUsageReporting::kResourceType_PWM, channel);
+  SetName("PWM", channel);
+}
+
+/**
+ * Free the PWM channel.
+ *
+ * Free the resource associated with the PWM channel and set the value to 0.
+ */
+PWM::~PWM() {
+  int32_t status = 0;
+
+  HAL_SetPWMDisabled(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  HAL_FreePWMPort(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Optionally eliminate the deadband from a speed controller.
+ *
+ * @param eliminateDeadband If true, set the motor curve on the Jaguar to
+ *                          eliminate the deadband in the middle of the range.
+ *                          Otherwise, keep the full range without modifying
+ *                          any values.
+ */
+void PWM::EnableDeadbandElimination(bool eliminateDeadband) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetPWMEliminateDeadband(m_handle, eliminateDeadband, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the bounds on the PWM pulse widths.
+ *
+ * This sets the bounds on the PWM values for a particular type of controller.
+ * The values determine the upper and lower speeds as well as the deadband
+ * bracket.
+ *
+ * @param max         The max PWM pulse width in ms
+ * @param deadbandMax The high end of the deadband range pulse width in ms
+ * @param center      The center (off) pulse width in ms
+ * @param deadbandMin The low end of the deadband pulse width in ms
+ * @param min         The minimum pulse width in ms
+ */
+void PWM::SetBounds(double max, double deadbandMax, double center,
+                    double deadbandMin, double min) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetPWMConfig(m_handle, max, deadbandMax, center, deadbandMin, min,
+                   &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the bounds on the PWM values.
+ *
+ * This sets the bounds on the PWM values for a particular each type of
+ * controller. The values determine the upper and lower speeds as well as the
+ * deadband bracket.
+ *
+ * @param max         The Minimum pwm value
+ * @param deadbandMax The high end of the deadband range
+ * @param center      The center speed (off)
+ * @param deadbandMin The low end of the deadband range
+ * @param min         The minimum pwm value
+ */
+void PWM::SetRawBounds(int max, int deadbandMax, int center, int deadbandMin,
+                       int min) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetPWMConfigRaw(m_handle, max, deadbandMax, center, deadbandMin, min,
+                      &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the bounds on the PWM values.
+ *
+ * This Gets the bounds on the PWM values for a particular each type of
+ * controller. The values determine the upper and lower speeds as well as the
+ * deadband bracket.
+ *
+ * @param max         The Minimum pwm value
+ * @param deadbandMax The high end of the deadband range
+ * @param center      The center speed (off)
+ * @param deadbandMin The low end of the deadband range
+ * @param min         The minimum pwm value
+ */
+void PWM::GetRawBounds(int* max, int* deadbandMax, int* center,
+                       int* deadbandMin, int* min) {
+  int32_t status = 0;
+  HAL_GetPWMConfigRaw(m_handle, max, deadbandMax, center, deadbandMin, min,
+                      &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the PWM value based on a position.
+ *
+ * This is intended to be used by servos.
+ *
+ * @pre SetMaxPositivePwm() called.
+ * @pre SetMinNegativePwm() called.
+ *
+ * @param pos The position to set the servo between 0.0 and 1.0.
+ */
+void PWM::SetPosition(double pos) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetPWMPosition(m_handle, pos, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the PWM value in terms of a position.
+ *
+ * This is intended to be used by servos.
+ *
+ * @pre SetMaxPositivePwm() called.
+ * @pre SetMinNegativePwm() called.
+ *
+ * @return The position the servo is set to between 0.0 and 1.0.
+ */
+double PWM::GetPosition() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double position = HAL_GetPWMPosition(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return position;
+}
+
+/**
+ * Set the PWM value based on a speed.
+ *
+ * This is intended to be used by speed controllers.
+ *
+ * @pre SetMaxPositivePwm() called.
+ * @pre SetMinPositivePwm() called.
+ * @pre SetCenterPwm() called.
+ * @pre SetMaxNegativePwm() called.
+ * @pre SetMinNegativePwm() called.
+ *
+ * @param speed The speed to set the speed controller between -1.0 and 1.0.
+ */
+void PWM::SetSpeed(double speed) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetPWMSpeed(m_handle, speed, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the PWM value in terms of speed.
+ *
+ * This is intended to be used by speed controllers.
+ *
+ * @pre SetMaxPositivePwm() called.
+ * @pre SetMinPositivePwm() called.
+ * @pre SetMaxNegativePwm() called.
+ * @pre SetMinNegativePwm() called.
+ *
+ * @return The most recently set speed between -1.0 and 1.0.
+ */
+double PWM::GetSpeed() const {
+  if (StatusIsFatal()) return 0.0;
+  int32_t status = 0;
+  double speed = HAL_GetPWMSpeed(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return speed;
+}
+
+/**
+ * Set the PWM value directly to the hardware.
+ *
+ * Write a raw value to a PWM channel.
+ *
+ * @param value Raw PWM value.
+ */
+void PWM::SetRaw(uint16_t value) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+  HAL_SetPWMRaw(m_handle, value, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the PWM value directly from the hardware.
+ *
+ * Read a raw value from a PWM channel.
+ *
+ * @return Raw PWM control value.
+ */
+uint16_t PWM::GetRaw() const {
+  if (StatusIsFatal()) return 0;
+
+  int32_t status = 0;
+  uint16_t value = HAL_GetPWMRaw(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  return value;
+}
+
+/**
+ * Slow down the PWM signal for old devices.
+ *
+ * @param mult The period multiplier to apply to this channel
+ */
+void PWM::SetPeriodMultiplier(PeriodMultiplier mult) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+
+  switch (mult) {
+    case kPeriodMultiplier_4X:
+      HAL_SetPWMPeriodScale(m_handle, 3,
+                            &status);  // Squelch 3 out of 4 outputs
+      break;
+    case kPeriodMultiplier_2X:
+      HAL_SetPWMPeriodScale(m_handle, 1,
+                            &status);  // Squelch 1 out of 2 outputs
+      break;
+    case kPeriodMultiplier_1X:
+      HAL_SetPWMPeriodScale(m_handle, 0, &status);  // Don't squelch any outputs
+      break;
+    default:
+      wpi_assert(false);
+  }
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Temporarily disables the PWM output. The next set call will reenable
+ * the output.
+ */
+void PWM::SetDisabled() {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+
+  HAL_SetPWMDisabled(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+void PWM::SetZeroLatch() {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+
+  HAL_LatchPWMZero(m_handle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+void PWM::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Speed Controller");
+  builder.SetSafeState([=]() { SetDisabled(); });
+  builder.AddDoubleProperty("Value", [=]() { return GetSpeed(); },
+                            [=](double value) { SetSpeed(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMSpeedController.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMSpeedController.cpp
new file mode 100644
index 0000000..b42862b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMSpeedController.cpp
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PWMSpeedController.h"
+
+using namespace frc;
+
+/**
+ * Constructor for a PWM Speed Controller connected via PWM.
+ *
+ * @param channel The PWM channel that the controller is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+PWMSpeedController::PWMSpeedController(int channel) : SafePWM(channel) {}
+
+/**
+ * Set the PWM value.
+ *
+ * The PWM value is set using a range of -1.0 to 1.0, appropriately
+ * scaling the value for the FPGA.
+ *
+ * @param speed The speed value between -1.0 and 1.0 to set.
+ */
+void PWMSpeedController::Set(double speed) {
+  SetSpeed(m_isInverted ? -speed : speed);
+}
+
+/**
+ * Get the recently set value of the PWM.
+ *
+ * @return The most recently set value for the PWM between -1.0 and 1.0.
+ */
+double PWMSpeedController::Get() const { return GetSpeed(); }
+
+void PWMSpeedController::SetInverted(bool isInverted) {
+  m_isInverted = isInverted;
+}
+
+bool PWMSpeedController::GetInverted() const { return m_isInverted; }
+
+void PWMSpeedController::Disable() { SetDisabled(); }
+
+void PWMSpeedController::StopMotor() { SafePWM::StopMotor(); }
+
+/**
+ * Write out the PID value as seen in the PIDOutput base object.
+ *
+ * @param output Write out the PWM value as was found in the PIDController
+ */
+void PWMSpeedController::PIDWrite(double output) { Set(output); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMTalonSRX.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMTalonSRX.cpp
new file mode 100644
index 0000000..c746d20
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMTalonSRX.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PWMTalonSRX.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Construct a PWMTalonSRX connected via PWM.
+ *
+ * @param channel The PWM channel that the PWMTalonSRX is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+PWMTalonSRX::PWMTalonSRX(int channel) : PWMSpeedController(channel) {
+  /* Note that the PWMTalonSRX uses the following bounds for PWM values. These
+   * values should work reasonably well for most controllers, but if users
+   * experience issues such as asymmetric behavior around the deadband or
+   * inability to saturate the controller in either direction, calibration is
+   * recommended. The calibration procedure can be found in the TalonSRX User
+   * Manual available from Cross The Road Electronics.
+   *   2.004ms = full "forward"
+   *   1.52ms = the "high end" of the deadband range
+   *   1.50ms = center of the deadband range (off)
+   *   1.48ms = the "low end" of the deadband range
+   *   0.997ms = full "reverse"
+   */
+  SetBounds(2.004, 1.52, 1.50, 1.48, .997);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_PWMTalonSRX, GetChannel());
+  SetName("PWMTalonSRX", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMVictorSPX.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMVictorSPX.cpp
new file mode 100644
index 0000000..921291e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PWMVictorSPX.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PWMVictorSPX.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Construct a PWMVictorSPX connected via PWM.
+ *
+ * @param channel The PWM channel that the PWMVictorSPX is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+PWMVictorSPX::PWMVictorSPX(int channel) : PWMSpeedController(channel) {
+  /* Note that the PWMVictorSPX uses the following bounds for PWM values. These
+   * values should work reasonably well for most controllers, but if users
+   * experience issues such as asymmetric behavior around the deadband or
+   * inability to saturate the controller in either direction, calibration is
+   * recommended. The calibration procedure can be found in the VictorSPX User
+   * Manual available from Cross The Road Electronics.
+   *   2.004ms = full "forward"
+   *   1.52ms = the "high end" of the deadband range
+   *   1.50ms = center of the deadband range (off)
+   *   1.48ms = the "low end" of the deadband range
+   *   0.997ms = full "reverse"
+   */
+  SetBounds(2.004, 1.52, 1.50, 1.48, .997);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  // HAL_Report(HALUsageReporting::kResourceType_PWMVictorSPX, GetChannel());
+  SetName("PWMVictorSPX", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp
new file mode 100644
index 0000000..beac93d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/PowerDistributionPanel.cpp
@@ -0,0 +1,184 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PowerDistributionPanel.h"
+
+#include <HAL/HAL.h>
+#include <HAL/PDP.h>
+#include <HAL/Ports.h>
+#include <llvm/SmallString.h>
+#include <llvm/raw_ostream.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+PowerDistributionPanel::PowerDistributionPanel() : PowerDistributionPanel(0) {}
+
+/**
+ * Initialize the PDP.
+ */
+PowerDistributionPanel::PowerDistributionPanel(int module) : m_module(module) {
+  int32_t status = 0;
+  HAL_InitializePDP(m_module, &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumPDPModules(), module,
+                                 HAL_GetErrorMessage(status));
+    m_module = -1;
+    return;
+  }
+  SetName("PowerDistributionPanel", module);
+}
+
+/**
+ * Query the input voltage of the PDP.
+ *
+ * @return The voltage of the PDP in volts
+ */
+double PowerDistributionPanel::GetVoltage() const {
+  int32_t status = 0;
+
+  double voltage = HAL_GetPDPVoltage(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+
+  return voltage;
+}
+
+/**
+ * Query the temperature of the PDP.
+ *
+ * @return The temperature of the PDP in degrees Celsius
+ */
+double PowerDistributionPanel::GetTemperature() const {
+  int32_t status = 0;
+
+  double temperature = HAL_GetPDPTemperature(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+
+  return temperature;
+}
+
+/**
+ * Query the current of a single channel of the PDP.
+ *
+ * @return The current of one of the PDP channels (channels 0-15) in Amperes
+ */
+double PowerDistributionPanel::GetCurrent(int channel) const {
+  int32_t status = 0;
+
+  if (!CheckPDPChannel(channel)) {
+    llvm::SmallString<32> str;
+    llvm::raw_svector_ostream buf(str);
+    buf << "PDP Channel " << channel;
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, buf.str());
+  }
+
+  double current = HAL_GetPDPChannelCurrent(m_module, channel, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+
+  return current;
+}
+
+/**
+ * Query the total current of all monitored PDP channels (0-15).
+ *
+ * @return The the total current drawn from the PDP channels in Amperes
+ */
+double PowerDistributionPanel::GetTotalCurrent() const {
+  int32_t status = 0;
+
+  double current = HAL_GetPDPTotalCurrent(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+
+  return current;
+}
+
+/**
+ * Query the total power drawn from the monitored PDP channels.
+ *
+ * @return The the total power drawn from the PDP channels in Watts
+ */
+double PowerDistributionPanel::GetTotalPower() const {
+  int32_t status = 0;
+
+  double power = HAL_GetPDPTotalPower(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+
+  return power;
+}
+
+/**
+ * Query the total energy drawn from the monitored PDP channels.
+ *
+ * @return The the total energy drawn from the PDP channels in Joules
+ */
+double PowerDistributionPanel::GetTotalEnergy() const {
+  int32_t status = 0;
+
+  double energy = HAL_GetPDPTotalEnergy(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+
+  return energy;
+}
+
+/**
+ * Reset the total energy drawn from the PDP.
+ *
+ * @see PowerDistributionPanel#GetTotalEnergy
+ */
+void PowerDistributionPanel::ResetTotalEnergy() {
+  int32_t status = 0;
+
+  HAL_ResetPDPTotalEnergy(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+}
+
+/**
+ * Remove all of the fault flags on the PDP.
+ */
+void PowerDistributionPanel::ClearStickyFaults() {
+  int32_t status = 0;
+
+  HAL_ClearPDPStickyFaults(m_module, &status);
+
+  if (status) {
+    wpi_setWPIErrorWithContext(Timeout, "");
+  }
+}
+
+void PowerDistributionPanel::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("PowerDistributionPanel");
+  for (int i = 0; i < kPDPChannels; ++i) {
+    builder.AddDoubleProperty("Chan" + llvm::Twine(i),
+                              [=]() { return GetCurrent(i); }, nullptr);
+  }
+  builder.AddDoubleProperty("Voltage", [=]() { return GetVoltage(); }, nullptr);
+  builder.AddDoubleProperty("TotalCurrent", [=]() { return GetTotalCurrent(); },
+                            nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Preferences.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Preferences.cpp
new file mode 100644
index 0000000..6c02034
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Preferences.cpp
@@ -0,0 +1,224 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Preferences.h"
+
+#include <algorithm>
+
+#include <HAL/HAL.h>
+#include <llvm/StringRef.h>
+#include <networktables/NetworkTableInstance.h>
+
+#include "WPIErrors.h"
+
+using namespace frc;
+
+// The Preferences table name
+static llvm::StringRef kTableName{"Preferences"};
+
+Preferences::Preferences()
+    : m_table(nt::NetworkTableInstance::GetDefault().GetTable(kTableName)) {
+  m_table->GetEntry(".type").SetString("RobotPreferences");
+  m_listener = m_table->AddEntryListener(
+      [=](nt::NetworkTable* table, llvm::StringRef name,
+          nt::NetworkTableEntry entry, std::shared_ptr<nt::Value> value,
+          int flags) { entry.SetPersistent(); },
+      NT_NOTIFY_NEW | NT_NOTIFY_IMMEDIATE);
+  HAL_Report(HALUsageReporting::kResourceType_Preferences, 0);
+}
+
+/**
+ * Get the one and only {@link Preferences} object.
+ *
+ * @return pointer to the {@link Preferences}
+ */
+Preferences* Preferences::GetInstance() {
+  static Preferences instance;
+  return &instance;
+}
+
+/**
+ * Returns a vector of all the keys.
+ *
+ * @return a vector of the keys
+ */
+std::vector<std::string> Preferences::GetKeys() { return m_table->GetKeys(); }
+
+/**
+ * Returns the string at the given key.  If this table does not have a value
+ * for that position, then the given defaultValue will be returned.
+ *
+ * @param key          the key
+ * @param defaultValue the value to return if none exists in the table
+ * @return either the value in the table, or the defaultValue
+ */
+std::string Preferences::GetString(llvm::StringRef key,
+                                   llvm::StringRef defaultValue) {
+  return m_table->GetString(key, defaultValue);
+}
+
+/**
+ * Returns the int at the given key.  If this table does not have a value for
+ * that position, then the given defaultValue value will be returned.
+ *
+ * @param key          the key
+ * @param defaultValue the value to return if none exists in the table
+ * @return either the value in the table, or the defaultValue
+ */
+int Preferences::GetInt(llvm::StringRef key, int defaultValue) {
+  return static_cast<int>(m_table->GetNumber(key, defaultValue));
+}
+
+/**
+ * Returns the double at the given key.  If this table does not have a value
+ * for that position, then the given defaultValue value will be returned.
+ *
+ * @param key          the key
+ * @param defaultValue the value to return if none exists in the table
+ * @return either the value in the table, or the defaultValue
+ */
+double Preferences::GetDouble(llvm::StringRef key, double defaultValue) {
+  return m_table->GetNumber(key, defaultValue);
+}
+
+/**
+ * Returns the float at the given key.  If this table does not have a value
+ * for that position, then the given defaultValue value will be returned.
+ *
+ * @param key          the key
+ * @param defaultValue the value to return if none exists in the table
+ * @return either the value in the table, or the defaultValue
+ */
+float Preferences::GetFloat(llvm::StringRef key, float defaultValue) {
+  return m_table->GetNumber(key, defaultValue);
+}
+
+/**
+ * Returns the boolean at the given key.  If this table does not have a value
+ * for that position, then the given defaultValue value will be returned.
+ *
+ * @param key          the key
+ * @param defaultValue the value to return if none exists in the table
+ * @return either the value in the table, or the defaultValue
+ */
+bool Preferences::GetBoolean(llvm::StringRef key, bool defaultValue) {
+  return m_table->GetBoolean(key, defaultValue);
+}
+
+/**
+ * Returns the long (int64_t) at the given key.  If this table does not have a
+ * value for that position, then the given defaultValue value will be returned.
+ *
+ * @param key          the key
+ * @param defaultValue the value to return if none exists in the table
+ * @return either the value in the table, or the defaultValue
+ */
+int64_t Preferences::GetLong(llvm::StringRef key, int64_t defaultValue) {
+  return static_cast<int64_t>(m_table->GetNumber(key, defaultValue));
+}
+
+/**
+ * Puts the given string into the preferences table.
+ *
+ * The value may not have quotation marks, nor may the key have any whitespace
+ * nor an equals sign.
+ *
+ * @param key   the key
+ * @param value the value
+ */
+void Preferences::PutString(llvm::StringRef key, llvm::StringRef value) {
+  auto entry = m_table->GetEntry(key);
+  entry.SetString(value);
+  entry.SetPersistent();
+}
+
+/**
+ * Puts the given int into the preferences table.
+ *
+ * The key may not have any whitespace nor an equals sign.
+ *
+ * @param key   the key
+ * @param value the value
+ */
+void Preferences::PutInt(llvm::StringRef key, int value) {
+  auto entry = m_table->GetEntry(key);
+  entry.SetDouble(value);
+  entry.SetPersistent();
+}
+
+/**
+ * Puts the given double into the preferences table.
+ *
+ * The key may not have any whitespace nor an equals sign.
+ *
+ * @param key   the key
+ * @param value the value
+ */
+void Preferences::PutDouble(llvm::StringRef key, double value) {
+  auto entry = m_table->GetEntry(key);
+  entry.SetDouble(value);
+  entry.SetPersistent();
+}
+
+/**
+ * Puts the given float into the preferences table.
+ *
+ * The key may not have any whitespace nor an equals sign.
+ *
+ * @param key   the key
+ * @param value the value
+ */
+void Preferences::PutFloat(llvm::StringRef key, float value) {
+  auto entry = m_table->GetEntry(key);
+  entry.SetDouble(value);
+  entry.SetPersistent();
+}
+
+/**
+ * Puts the given boolean into the preferences table.
+ *
+ * The key may not have any whitespace nor an equals sign.
+ *
+ * @param key   the key
+ * @param value the value
+ */
+void Preferences::PutBoolean(llvm::StringRef key, bool value) {
+  auto entry = m_table->GetEntry(key);
+  entry.SetBoolean(value);
+  entry.SetPersistent();
+}
+
+/**
+ * Puts the given long (int64_t) into the preferences table.
+ *
+ * The key may not have any whitespace nor an equals sign.
+ *
+ * @param key   the key
+ * @param value the value
+ */
+void Preferences::PutLong(llvm::StringRef key, int64_t value) {
+  auto entry = m_table->GetEntry(key);
+  entry.SetDouble(value);
+  entry.SetPersistent();
+}
+
+/**
+ * Returns whether or not there is a key with the given name.
+ *
+ * @param key the key
+ * @return if there is a value at the given key
+ */
+bool Preferences::ContainsKey(llvm::StringRef key) {
+  return m_table->ContainsKey(key);
+}
+
+/**
+ * Remove a preference.
+ *
+ * @param key the key
+ */
+void Preferences::Remove(llvm::StringRef key) { m_table->Delete(key); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Relay.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Relay.cpp
new file mode 100644
index 0000000..9eaf756
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Relay.cpp
@@ -0,0 +1,302 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Relay.h"
+
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+#include <HAL/Relay.h>
+#include <llvm/raw_ostream.h>
+
+#include "MotorSafetyHelper.h"
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Relay constructor given a channel.
+ *
+ * This code initializes the relay and reserves all resources that need to be
+ * locked. Initially the relay is set to both lines at 0v.
+ *
+ * @param channel   The channel number (0-3).
+ * @param direction The direction that the Relay object will control.
+ */
+Relay::Relay(int channel, Relay::Direction direction)
+    : m_channel(channel), m_direction(direction) {
+  if (!SensorBase::CheckRelayChannel(m_channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "Relay Channel " + llvm::Twine(m_channel));
+    return;
+  }
+
+  HAL_PortHandle portHandle = HAL_GetPort(channel);
+
+  if (m_direction == kBothDirections || m_direction == kForwardOnly) {
+    int32_t status = 0;
+    m_forwardHandle = HAL_InitializeRelayPort(portHandle, true, &status);
+    if (status != 0) {
+      wpi_setErrorWithContextRange(status, 0, HAL_GetNumRelayChannels(),
+                                   channel, HAL_GetErrorMessage(status));
+      m_forwardHandle = HAL_kInvalidHandle;
+      m_reverseHandle = HAL_kInvalidHandle;
+      return;
+    }
+    HAL_Report(HALUsageReporting::kResourceType_Relay, m_channel);
+  }
+  if (m_direction == kBothDirections || m_direction == kReverseOnly) {
+    int32_t status = 0;
+    m_reverseHandle = HAL_InitializeRelayPort(portHandle, false, &status);
+    if (status != 0) {
+      wpi_setErrorWithContextRange(status, 0, HAL_GetNumRelayChannels(),
+                                   channel, HAL_GetErrorMessage(status));
+      m_forwardHandle = HAL_kInvalidHandle;
+      m_reverseHandle = HAL_kInvalidHandle;
+      return;
+    }
+
+    HAL_Report(HALUsageReporting::kResourceType_Relay, m_channel + 128);
+  }
+
+  int32_t status = 0;
+  if (m_forwardHandle != HAL_kInvalidHandle) {
+    HAL_SetRelay(m_forwardHandle, false, &status);
+    if (status != 0) {
+      wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+      m_forwardHandle = HAL_kInvalidHandle;
+      m_reverseHandle = HAL_kInvalidHandle;
+      return;
+    }
+  }
+  if (m_reverseHandle != HAL_kInvalidHandle) {
+    HAL_SetRelay(m_reverseHandle, false, &status);
+    if (status != 0) {
+      wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+      m_forwardHandle = HAL_kInvalidHandle;
+      m_reverseHandle = HAL_kInvalidHandle;
+      return;
+    }
+  }
+
+  m_safetyHelper = std::make_unique<MotorSafetyHelper>(this);
+  m_safetyHelper->SetSafetyEnabled(false);
+
+  SetName("Relay", m_channel);
+}
+
+/**
+ * Free the resource associated with a relay.
+ *
+ * The relay channels are set to free and the relay output is turned off.
+ */
+Relay::~Relay() {
+  int32_t status = 0;
+  HAL_SetRelay(m_forwardHandle, false, &status);
+  HAL_SetRelay(m_reverseHandle, false, &status);
+  // ignore errors, as we want to make sure a free happens.
+  if (m_forwardHandle != HAL_kInvalidHandle) HAL_FreeRelayPort(m_forwardHandle);
+  if (m_reverseHandle != HAL_kInvalidHandle) HAL_FreeRelayPort(m_reverseHandle);
+}
+
+/**
+ * Set the relay state.
+ *
+ * Valid values depend on which directions of the relay are controlled by the
+ * object.
+ *
+ * When set to kBothDirections, the relay can be any of the four states:
+ * 0v-0v, 0v-12v, 12v-0v, 12v-12v
+ *
+ * When set to kForwardOnly or kReverseOnly, you can specify the constant for
+ * the direction or you can simply specify kOff and kOn.  Using only kOff and
+ * kOn is recommended.
+ *
+ * @param value The state to set the relay.
+ */
+void Relay::Set(Relay::Value value) {
+  if (StatusIsFatal()) return;
+
+  int32_t status = 0;
+
+  switch (value) {
+    case kOff:
+      if (m_direction == kBothDirections || m_direction == kForwardOnly) {
+        HAL_SetRelay(m_forwardHandle, false, &status);
+      }
+      if (m_direction == kBothDirections || m_direction == kReverseOnly) {
+        HAL_SetRelay(m_reverseHandle, false, &status);
+      }
+      break;
+    case kOn:
+      if (m_direction == kBothDirections || m_direction == kForwardOnly) {
+        HAL_SetRelay(m_forwardHandle, true, &status);
+      }
+      if (m_direction == kBothDirections || m_direction == kReverseOnly) {
+        HAL_SetRelay(m_reverseHandle, true, &status);
+      }
+      break;
+    case kForward:
+      if (m_direction == kReverseOnly) {
+        wpi_setWPIError(IncompatibleMode);
+        break;
+      }
+      if (m_direction == kBothDirections || m_direction == kForwardOnly) {
+        HAL_SetRelay(m_forwardHandle, true, &status);
+      }
+      if (m_direction == kBothDirections) {
+        HAL_SetRelay(m_reverseHandle, false, &status);
+      }
+      break;
+    case kReverse:
+      if (m_direction == kForwardOnly) {
+        wpi_setWPIError(IncompatibleMode);
+        break;
+      }
+      if (m_direction == kBothDirections) {
+        HAL_SetRelay(m_forwardHandle, false, &status);
+      }
+      if (m_direction == kBothDirections || m_direction == kReverseOnly) {
+        HAL_SetRelay(m_reverseHandle, true, &status);
+      }
+      break;
+  }
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the Relay State
+ *
+ * Gets the current state of the relay.
+ *
+ * When set to kForwardOnly or kReverseOnly, value is returned as kOn/kOff not
+ * kForward/kReverse (per the recommendation in Set).
+ *
+ * @return The current state of the relay as a Relay::Value
+ */
+Relay::Value Relay::Get() const {
+  int32_t status;
+
+  if (m_direction == kForwardOnly) {
+    if (HAL_GetRelay(m_forwardHandle, &status)) {
+      return kOn;
+    } else {
+      return kOff;
+    }
+  } else if (m_direction == kReverseOnly) {
+    if (HAL_GetRelay(m_reverseHandle, &status)) {
+      return kOn;
+    } else {
+      return kOff;
+    }
+  } else {
+    if (HAL_GetRelay(m_forwardHandle, &status)) {
+      if (HAL_GetRelay(m_reverseHandle, &status)) {
+        return kOn;
+      } else {
+        return kForward;
+      }
+    } else {
+      if (HAL_GetRelay(m_reverseHandle, &status)) {
+        return kReverse;
+      } else {
+        return kOff;
+      }
+    }
+  }
+
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+int Relay::GetChannel() const { return m_channel; }
+
+/**
+ * Set the expiration time for the Relay object.
+ *
+ * @param timeout The timeout (in seconds) for this relay object
+ */
+void Relay::SetExpiration(double timeout) {
+  m_safetyHelper->SetExpiration(timeout);
+}
+
+/**
+ * Return the expiration time for the relay object.
+ *
+ * @return The expiration time value.
+ */
+double Relay::GetExpiration() const { return m_safetyHelper->GetExpiration(); }
+
+/**
+ * Check if the relay object is currently alive or stopped due to a timeout.
+ *
+ * @return a bool value that is true if the motor has NOT timed out and should
+ *         still be running.
+ */
+bool Relay::IsAlive() const { return m_safetyHelper->IsAlive(); }
+
+/**
+ * Stop the motor associated with this PWM object.
+ *
+ * This is called by the MotorSafetyHelper object when it has a timeout for this
+ * relay and needs to stop it from running.
+ */
+void Relay::StopMotor() { Set(kOff); }
+
+/**
+ * Enable/disable motor safety for this device.
+ *
+ * Turn on and off the motor safety option for this relay object.
+ *
+ * @param enabled True if motor safety is enforced for this object
+ */
+void Relay::SetSafetyEnabled(bool enabled) {
+  m_safetyHelper->SetSafetyEnabled(enabled);
+}
+
+/**
+ * Check if motor safety is enabled for this object.
+ *
+ * @returns True if motor safety is enforced for this object
+ */
+bool Relay::IsSafetyEnabled() const {
+  return m_safetyHelper->IsSafetyEnabled();
+}
+
+void Relay::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "Relay " << GetChannel();
+}
+
+void Relay::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Relay");
+  builder.SetSafeState([=]() { Set(kOff); });
+  builder.AddSmallStringProperty(
+      "Value",
+      [=](llvm::SmallVectorImpl<char>& buf) -> llvm::StringRef {
+        switch (Get()) {
+          case kOn:
+            return "On";
+          case kForward:
+            return "Forward";
+          case kReverse:
+            return "Reverse";
+          default:
+            return "Off";
+        }
+      },
+      [=](llvm::StringRef value) {
+        if (value == "Off")
+          Set(kOff);
+        else if (value == "Forward")
+          Set(kForward);
+        else if (value == "Reverse")
+          Set(kReverse);
+        else if (value == "On")
+          Set(kOn);
+      });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Resource.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Resource.cpp
new file mode 100644
index 0000000..b30044a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Resource.cpp
@@ -0,0 +1,105 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Resource.h"
+
+#include "ErrorBase.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+wpi::mutex Resource::m_createMutex;
+
+/**
+ * Allocate storage for a new instance of Resource.
+ *
+ * Allocate a bool array of values that will get initialized to indicate that no
+ * resources have been allocated yet. The indicies of the resources are [0 ..
+ * elements - 1].
+ */
+Resource::Resource(uint32_t elements) {
+  m_isAllocated = std::vector<bool>(elements, false);
+}
+
+/**
+ * Factory method to create a Resource allocation-tracker *if* needed.
+ *
+ * @param r        address of the caller's Resource pointer. If *r == nullptr,
+ *                 this will construct a Resource and make *r point to it. If
+ *                 *r != nullptr, i.e. the caller already has a Resource
+ *                 instance, this won't do anything.
+ * @param elements the number of elements for this Resource allocator to
+ *                 track, that is, it will allocate resource numbers in the
+ *                 range [0 .. elements - 1].
+ */
+void Resource::CreateResourceObject(std::unique_ptr<Resource>& r,
+                                    uint32_t elements) {
+  std::lock_guard<wpi::mutex> lock(m_createMutex);
+  if (!r) {
+    r = std::make_unique<Resource>(elements);
+  }
+}
+
+/**
+ * Allocate a resource.
+ *
+ * When a resource is requested, mark it allocated. In this case, a free
+ * resource value within the range is located and returned after it is marked
+ * allocated.
+ */
+uint32_t Resource::Allocate(const std::string& resourceDesc) {
+  std::lock_guard<wpi::mutex> lock(m_allocateMutex);
+  for (uint32_t i = 0; i < m_isAllocated.size(); i++) {
+    if (!m_isAllocated[i]) {
+      m_isAllocated[i] = true;
+      return i;
+    }
+  }
+  wpi_setWPIErrorWithContext(NoAvailableResources, resourceDesc);
+  return std::numeric_limits<uint32_t>::max();
+}
+
+/**
+ * Allocate a specific resource value.
+ *
+ * The user requests a specific resource value, i.e. channel number and it is
+ * verified unallocated, then returned.
+ */
+uint32_t Resource::Allocate(uint32_t index, const std::string& resourceDesc) {
+  std::lock_guard<wpi::mutex> lock(m_allocateMutex);
+  if (index >= m_isAllocated.size()) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, resourceDesc);
+    return std::numeric_limits<uint32_t>::max();
+  }
+  if (m_isAllocated[index]) {
+    wpi_setWPIErrorWithContext(ResourceAlreadyAllocated, resourceDesc);
+    return std::numeric_limits<uint32_t>::max();
+  }
+  m_isAllocated[index] = true;
+  return index;
+}
+
+/**
+ * Free an allocated resource.
+ *
+ * After a resource is no longer needed, for example a destructor is called for
+ * a channel assignment class, Free will release the resource value so it can
+ * be reused somewhere else in the program.
+ */
+void Resource::Free(uint32_t index) {
+  std::unique_lock<wpi::mutex> lock(m_allocateMutex);
+  if (index == std::numeric_limits<uint32_t>::max()) return;
+  if (index >= m_isAllocated.size()) {
+    wpi_setWPIError(NotAllocated);
+    return;
+  }
+  if (!m_isAllocated[index]) {
+    wpi_setWPIError(NotAllocated);
+    return;
+  }
+  m_isAllocated[index] = false;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotBase.cpp
new file mode 100644
index 0000000..0a33d6e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotBase.cpp
@@ -0,0 +1,118 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "RobotBase.h"
+
+#include <cstdio>
+
+#include <HAL/HAL.h>
+#include <networktables/NetworkTableInstance.h>
+
+#include "DriverStation.h"
+#include "HLUsageReporting.h"
+#include "Internal/HardwareHLReporting.h"
+#include "LiveWindow/LiveWindow.h"
+#include "RobotState.h"
+#include "SmartDashboard/SmartDashboard.h"
+#include "Utility.h"
+#include "WPILibVersion.h"
+
+using namespace frc;
+
+std::thread::id RobotBase::m_threadId;
+
+/**
+ * Constructor for a generic robot program.
+ *
+ * User code should be placed in the constructor that runs before the Autonomous
+ * or Operator Control period starts. The constructor will run to completion
+ * before Autonomous is entered.
+ *
+ * This must be used to ensure that the communications code starts. In the
+ * future it would be nice to put this code into it's own task that loads on
+ * boot so ensure that it runs.
+ */
+RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
+  m_threadId = std::this_thread::get_id();
+
+  RobotState::SetImplementation(DriverStation::GetInstance());
+  HLUsageReporting::SetImplementation(new HardwareHLReporting());
+
+  auto inst = nt::NetworkTableInstance::GetDefault();
+  inst.SetNetworkIdentity("Robot");
+  inst.StartServer("/home/lvuser/networktables.ini");
+
+  SmartDashboard::init();
+
+  std::FILE* file = nullptr;
+  file = std::fopen("/tmp/frc_versions/FRC_Lib_Version.ini", "w");
+
+  if (file != nullptr) {
+    std::fputs("C++ ", file);
+    std::fputs(GetWPILibVersion(), file);
+    std::fclose(file);
+  }
+
+  // First and one-time initialization
+  inst.GetTable("LiveWindow")
+      ->GetSubTable(".status")
+      ->GetEntry("LW Enabled")
+      .SetBoolean(false);
+
+  LiveWindow::GetInstance()->SetEnabled(false);
+}
+
+/**
+ * Determine if the Robot is currently enabled.
+ *
+ * @return True if the Robot is currently enabled by the field controls.
+ */
+bool RobotBase::IsEnabled() const { return m_ds.IsEnabled(); }
+
+/**
+ * Determine if the Robot is currently disabled.
+ *
+ * @return True if the Robot is currently disabled by the field controls.
+ */
+bool RobotBase::IsDisabled() const { return m_ds.IsDisabled(); }
+
+/**
+ * Determine if the robot is currently in Autonomous mode.
+ *
+ * @return True if the robot is currently operating Autonomously as determined
+ *         by the field controls.
+ */
+bool RobotBase::IsAutonomous() const { return m_ds.IsAutonomous(); }
+
+/**
+ * Determine if the robot is currently in Operator Control mode.
+ *
+ * @return True if the robot is currently operating in Tele-Op mode as
+ *         determined by the field controls.
+ */
+bool RobotBase::IsOperatorControl() const { return m_ds.IsOperatorControl(); }
+
+/**
+ * Determine if the robot is currently in Test mode.
+ *
+ * @return True if the robot is currently running tests as determined by the
+ *         field controls.
+ */
+bool RobotBase::IsTest() const { return m_ds.IsTest(); }
+
+/**
+ * Indicates if new data is available from the driver station.
+ *
+ * @return Has new data arrived over the network since the last time this
+ *         function was called?
+ */
+bool RobotBase::IsNewDataAvailable() const { return m_ds.IsNewControlData(); }
+
+/**
+ * Gets the ID of the main robot thread.
+ */
+std::thread::id RobotBase::GetThreadId() { return m_threadId; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotController.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotController.cpp
new file mode 100644
index 0000000..422207d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotController.cpp
@@ -0,0 +1,291 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "RobotController.h"
+
+#include <HAL/HAL.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+/**
+ * Return the FPGA Version number.
+ *
+ * For now, expect this to be competition year.
+ *
+ * @return FPGA Version number.
+ */
+int RobotController::GetFPGAVersion() {
+  int32_t status = 0;
+  int version = HAL_GetFPGAVersion(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return version;
+}
+
+/**
+ * Return the FPGA Revision number.
+ *
+ * The format of the revision is 3 numbers. The 12 most significant bits are the
+ * Major Revision. The next 8 bits are the Minor Revision. The 12 least
+ * significant bits are the Build Number.
+ *
+ * @return FPGA Revision number.
+ */
+int64_t RobotController::GetFPGARevision() {
+  int32_t status = 0;
+  int64_t revision = HAL_GetFPGARevision(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return revision;
+}
+
+/**
+ * Read the microsecond-resolution timer on the FPGA.
+ *
+ * @return The current time in microseconds according to the FPGA (since FPGA
+ *         reset).
+ */
+uint64_t RobotController::GetFPGATime() {
+  int32_t status = 0;
+  uint64_t time = HAL_GetFPGATime(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return time;
+}
+
+/**
+ * Get the state of the "USER" button on the roboRIO.
+ *
+ * @return True if the button is currently pressed down
+ */
+bool RobotController::GetUserButton() {
+  int32_t status = 0;
+
+  bool value = HAL_GetFPGAButton(&status);
+  wpi_setGlobalError(status);
+
+  return value;
+}
+
+/**
+ * Check if the FPGA outputs are enabled.
+ *
+ * The outputs may be disabled if the robot is disabled or e-stopped, the
+ * watchdog has expired, or if the roboRIO browns out.
+ *
+ * @return True if the FPGA outputs are enabled.
+ */
+bool RobotController::IsSysActive() {
+  int32_t status = 0;
+  bool retVal = HAL_GetSystemActive(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Check if the system is browned out.
+ *
+ * @return True if the system is browned out
+ */
+bool RobotController::IsBrownedOut() {
+  int32_t status = 0;
+  bool retVal = HAL_GetBrownedOut(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the input voltage to the robot controller.
+ *
+ * @return The controller input voltage value in Volts
+ */
+double RobotController::GetInputVoltage() {
+  int32_t status = 0;
+  double retVal = HAL_GetVinVoltage(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the input current to the robot controller.
+ *
+ * @return The controller input current value in Amps
+ */
+double RobotController::GetInputCurrent() {
+  int32_t status = 0;
+  double retVal = HAL_GetVinCurrent(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the voltage of the 6V rail.
+ *
+ * @return The controller 6V rail voltage value in Volts
+ */
+double RobotController::GetVoltage6V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserVoltage6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the current output of the 6V rail.
+ *
+ * @return The controller 6V rail output current value in Amps
+ */
+double RobotController::GetCurrent6V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserCurrent6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the enabled state of the 6V rail. The rail may be disabled due to a
+ * controller brownout, a short circuit on the rail, or controller over-voltage.
+ *
+ * @return The controller 6V rail enabled value. True for enabled.
+ */
+bool RobotController::GetEnabled6V() {
+  int32_t status = 0;
+  bool retVal = HAL_GetUserActive6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the count of the total current faults on the 6V rail since the controller
+ * has booted.
+ *
+ * @return The number of faults.
+ */
+int RobotController::GetFaultCount6V() {
+  int32_t status = 0;
+  int retVal = HAL_GetUserCurrentFaults6V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the voltage of the 5V rail.
+ *
+ * @return The controller 5V rail voltage value in Volts
+ */
+double RobotController::GetVoltage5V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserVoltage5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the current output of the 5V rail.
+ *
+ * @return The controller 5V rail output current value in Amps
+ */
+double RobotController::GetCurrent5V() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserCurrent5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the enabled state of the 5V rail. The rail may be disabled due to a
+ * controller brownout, a short circuit on the rail, or controller over-voltage.
+ *
+ * @return The controller 5V rail enabled value. True for enabled.
+ */
+bool RobotController::GetEnabled5V() {
+  int32_t status = 0;
+  bool retVal = HAL_GetUserActive5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the count of the total current faults on the 5V rail since the controller
+ * has booted.
+ *
+ * @return The number of faults
+ */
+int RobotController::GetFaultCount5V() {
+  int32_t status = 0;
+  int retVal = HAL_GetUserCurrentFaults5V(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the voltage of the 3.3V rail.
+ *
+ * @return The controller 3.3V rail voltage value in Volts
+ */
+double RobotController::GetVoltage3V3() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserVoltage3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the current output of the 3.3V rail.
+ *
+ * @return The controller 3.3V rail output current value in Amps
+ */
+double RobotController::GetCurrent3V3() {
+  int32_t status = 0;
+  double retVal = HAL_GetUserCurrent3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the enabled state of the 3.3V rail. The rail may be disabled due to a
+ * controller brownout, a short circuit on the rail, or controller over-voltage.
+ *
+ * @return The controller 3.3V rail enabled value. True for enabled.
+ */
+bool RobotController::GetEnabled3V3() {
+  int32_t status = 0;
+  bool retVal = HAL_GetUserActive3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Get the count of the total current faults on the 3.3V rail since the
+ * controller has booted.
+ *
+ * @return The number of faults
+ */
+int RobotController::GetFaultCount3V3() {
+  int32_t status = 0;
+  int retVal = HAL_GetUserCurrentFaults3V3(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+CANStatus RobotController::GetCANStatus() {
+  int32_t status = 0;
+  float percentBusUtilization = 0;
+  uint32_t busOffCount = 0;
+  uint32_t txFullCount = 0;
+  uint32_t receiveErrorCount = 0;
+  uint32_t transmitErrorCount = 0;
+  HAL_CAN_GetCANStatus(&percentBusUtilization, &busOffCount, &txFullCount,
+                       &receiveErrorCount, &transmitErrorCount, &status);
+  if (status != 0) {
+    wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+    return {};
+  }
+  return {percentBusUtilization, static_cast<int>(busOffCount),
+          static_cast<int>(txFullCount), static_cast<int>(receiveErrorCount),
+          static_cast<int>(transmitErrorCount)};
+}
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotDrive.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotDrive.cpp
new file mode 100644
index 0000000..72ecd58
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotDrive.cpp
@@ -0,0 +1,748 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "RobotDrive.h"
+
+#include <algorithm>
+#include <cmath>
+
+#include <HAL/HAL.h>
+
+#include "GenericHID.h"
+#include "Joystick.h"
+#include "Talon.h"
+#include "Utility.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+static std::shared_ptr<SpeedController> make_shared_nodelete(
+    SpeedController* ptr) {
+  return std::shared_ptr<SpeedController>(ptr, NullDeleter<SpeedController>());
+}
+
+/*
+ * Driving functions
+ * These functions provide an interface to multiple motors that is used for C
+ * programming.
+ * The Drive(speed, direction) function is the main part of the set that makes
+ * it easy to set speeds and direction independently in one call.
+ */
+
+/**
+ * Common function to initialize all the robot drive constructors.
+ *
+ * Create a motor safety object (the real reason for the common code) and
+ * initialize all the motor assignments. The default timeout is set for the
+ * robot drive.
+ */
+void RobotDrive::InitRobotDrive() {
+  m_safetyHelper = std::make_unique<MotorSafetyHelper>(this);
+  m_safetyHelper->SetSafetyEnabled(true);
+}
+
+/**
+ * Constructor for RobotDrive with 2 motors specified with channel numbers.
+ *
+ * Set up parameters for a two wheel drive system where the
+ * left and right motor pwm channels are specified in the call.
+ * This call assumes Talons for controlling the motors.
+ *
+ * @param leftMotorChannel  The PWM channel number that drives the left motor.
+ *                          0-9 are on-board, 10-19 are on the MXP port
+ * @param rightMotorChannel The PWM channel number that drives the right motor.
+ *                          0-9 are on-board, 10-19 are on the MXP port
+ */
+RobotDrive::RobotDrive(int leftMotorChannel, int rightMotorChannel) {
+  InitRobotDrive();
+  m_rearLeftMotor = std::make_shared<Talon>(leftMotorChannel);
+  m_rearRightMotor = std::make_shared<Talon>(rightMotorChannel);
+  SetLeftRightMotorOutputs(0.0, 0.0);
+}
+
+/**
+ * Constructor for RobotDrive with 4 motors specified with channel numbers.
+ *
+ * Set up parameters for a four wheel drive system where all four motor
+ * pwm channels are specified in the call.
+ * This call assumes Talons for controlling the motors.
+ *
+ * @param frontLeftMotor  Front left motor channel number. 0-9 are on-board,
+ *                        10-19 are on the MXP port
+ * @param rearLeftMotor   Rear Left motor channel number. 0-9 are on-board,
+ *                        10-19 are on the MXP port
+ * @param frontRightMotor Front right motor channel number. 0-9 are on-board,
+ *                        10-19 are on the MXP port
+ * @param rearRightMotor  Rear Right motor channel number. 0-9 are on-board,
+ *                        10-19 are on the MXP port
+ */
+RobotDrive::RobotDrive(int frontLeftMotor, int rearLeftMotor,
+                       int frontRightMotor, int rearRightMotor) {
+  InitRobotDrive();
+  m_rearLeftMotor = std::make_shared<Talon>(rearLeftMotor);
+  m_rearRightMotor = std::make_shared<Talon>(rearRightMotor);
+  m_frontLeftMotor = std::make_shared<Talon>(frontLeftMotor);
+  m_frontRightMotor = std::make_shared<Talon>(frontRightMotor);
+  SetLeftRightMotorOutputs(0.0, 0.0);
+}
+
+/**
+ * Constructor for RobotDrive with 2 motors specified as SpeedController
+ * objects.
+ *
+ * The SpeedController version of the constructor enables programs to use the
+ * RobotDrive classes with subclasses of the SpeedController objects, for
+ * example, versions with ramping or reshaping of the curve to suit motor bias
+ * or deadband elimination.
+ *
+ * @param leftMotor  The left SpeedController object used to drive the robot.
+ * @param rightMotor The right SpeedController object used to drive the robot.
+ */
+RobotDrive::RobotDrive(SpeedController* leftMotor,
+                       SpeedController* rightMotor) {
+  InitRobotDrive();
+  if (leftMotor == nullptr || rightMotor == nullptr) {
+    wpi_setWPIError(NullParameter);
+    m_rearLeftMotor = m_rearRightMotor = nullptr;
+    return;
+  }
+  m_rearLeftMotor = make_shared_nodelete(leftMotor);
+  m_rearRightMotor = make_shared_nodelete(rightMotor);
+}
+
+// TODO: Change to rvalue references & move syntax.
+RobotDrive::RobotDrive(SpeedController& leftMotor,
+                       SpeedController& rightMotor) {
+  InitRobotDrive();
+  m_rearLeftMotor = make_shared_nodelete(&leftMotor);
+  m_rearRightMotor = make_shared_nodelete(&rightMotor);
+}
+
+RobotDrive::RobotDrive(std::shared_ptr<SpeedController> leftMotor,
+                       std::shared_ptr<SpeedController> rightMotor) {
+  InitRobotDrive();
+  if (leftMotor == nullptr || rightMotor == nullptr) {
+    wpi_setWPIError(NullParameter);
+    m_rearLeftMotor = m_rearRightMotor = nullptr;
+    return;
+  }
+  m_rearLeftMotor = leftMotor;
+  m_rearRightMotor = rightMotor;
+}
+
+/**
+ * Constructor for RobotDrive with 4 motors specified as SpeedController
+ * objects.
+ *
+ * Speed controller input version of RobotDrive (see previous comments).
+ *
+ * @param frontLeftMotor  The front left SpeedController object used to drive
+ *                        the robot.
+ * @param rearLeftMotor   The back left SpeedController object used to drive
+ *                        the robot.
+ * @param frontRightMotor The front right SpeedController object used to drive
+ *                        the robot.
+ * @param rearRightMotor  The back right SpeedController object used to drive
+ *                        the robot.
+ */
+RobotDrive::RobotDrive(SpeedController* frontLeftMotor,
+                       SpeedController* rearLeftMotor,
+                       SpeedController* frontRightMotor,
+                       SpeedController* rearRightMotor) {
+  InitRobotDrive();
+  if (frontLeftMotor == nullptr || rearLeftMotor == nullptr ||
+      frontRightMotor == nullptr || rearRightMotor == nullptr) {
+    wpi_setWPIError(NullParameter);
+    return;
+  }
+  m_frontLeftMotor = make_shared_nodelete(frontLeftMotor);
+  m_rearLeftMotor = make_shared_nodelete(rearLeftMotor);
+  m_frontRightMotor = make_shared_nodelete(frontRightMotor);
+  m_rearRightMotor = make_shared_nodelete(rearRightMotor);
+}
+
+RobotDrive::RobotDrive(SpeedController& frontLeftMotor,
+                       SpeedController& rearLeftMotor,
+                       SpeedController& frontRightMotor,
+                       SpeedController& rearRightMotor) {
+  InitRobotDrive();
+  m_frontLeftMotor = make_shared_nodelete(&frontLeftMotor);
+  m_rearLeftMotor = make_shared_nodelete(&rearLeftMotor);
+  m_frontRightMotor = make_shared_nodelete(&frontRightMotor);
+  m_rearRightMotor = make_shared_nodelete(&rearRightMotor);
+}
+
+RobotDrive::RobotDrive(std::shared_ptr<SpeedController> frontLeftMotor,
+                       std::shared_ptr<SpeedController> rearLeftMotor,
+                       std::shared_ptr<SpeedController> frontRightMotor,
+                       std::shared_ptr<SpeedController> rearRightMotor) {
+  InitRobotDrive();
+  if (frontLeftMotor == nullptr || rearLeftMotor == nullptr ||
+      frontRightMotor == nullptr || rearRightMotor == nullptr) {
+    wpi_setWPIError(NullParameter);
+    return;
+  }
+  m_frontLeftMotor = frontLeftMotor;
+  m_rearLeftMotor = rearLeftMotor;
+  m_frontRightMotor = frontRightMotor;
+  m_rearRightMotor = rearRightMotor;
+}
+
+/**
+ * Drive the motors at "outputMagnitude" and "curve".
+ * Both outputMagnitude and curve are -1.0 to +1.0 values, where 0.0 represents
+ * stopped and not turning. curve < 0 will turn left and curve > 0 will turn
+ * right.
+ *
+ * The algorithm for steering provides a constant turn radius for any normal
+ * speed range, both forward and backward. Increasing m_sensitivity causes
+ * sharper turns for fixed values of curve.
+ *
+ * This function will most likely be used in an autonomous routine.
+ *
+ * @param outputMagnitude The speed setting for the outside wheel in a turn,
+ *                        forward or backwards, +1 to -1.
+ * @param curve           The rate of turn, constant for different forward
+ *                        speeds. Set curve < 0 for left turn or curve > 0 for
+ *                        right turn.
+ *
+ * Set curve = e^(-r/w) to get a turn radius r for wheelbase w of your robot.
+ * Conversely, turn radius r = -ln(curve)*w for a given value of curve and
+ * wheelbase w.
+ */
+void RobotDrive::Drive(double outputMagnitude, double curve) {
+  double leftOutput, rightOutput;
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, GetNumMotors(),
+               HALUsageReporting::kRobotDrive_ArcadeRatioCurve);
+    reported = true;
+  }
+
+  if (curve < 0) {
+    double value = std::log(-curve);
+    double ratio = (value - m_sensitivity) / (value + m_sensitivity);
+    if (ratio == 0) ratio = .0000000001;
+    leftOutput = outputMagnitude / ratio;
+    rightOutput = outputMagnitude;
+  } else if (curve > 0) {
+    double value = std::log(curve);
+    double ratio = (value - m_sensitivity) / (value + m_sensitivity);
+    if (ratio == 0) ratio = .0000000001;
+    leftOutput = outputMagnitude;
+    rightOutput = outputMagnitude / ratio;
+  } else {
+    leftOutput = outputMagnitude;
+    rightOutput = outputMagnitude;
+  }
+  SetLeftRightMotorOutputs(leftOutput, rightOutput);
+}
+
+/**
+ * Provide tank steering using the stored robot configuration.
+ *
+ * Drive the robot using two joystick inputs. The Y-axis will be selected from
+ * each Joystick object.
+ *
+ * @param leftStick  The joystick to control the left side of the robot.
+ * @param rightStick The joystick to control the right side of the robot.
+ * @param squaredInputs If true, the sensitivity will be decreased for small
+ *                      values
+ */
+void RobotDrive::TankDrive(GenericHID* leftStick, GenericHID* rightStick,
+                           bool squaredInputs) {
+  if (leftStick == nullptr || rightStick == nullptr) {
+    wpi_setWPIError(NullParameter);
+    return;
+  }
+  TankDrive(leftStick->GetY(), rightStick->GetY(), squaredInputs);
+}
+
+/**
+ * Provide tank steering using the stored robot configuration.
+ *
+ * Drive the robot using two joystick inputs. The Y-axis will be selected from
+ * each Joystick object.
+ *
+ * @param leftStick  The joystick to control the left side of the robot.
+ * @param rightStick The joystick to control the right side of the robot.
+ * @param squaredInputs If true, the sensitivity will be decreased for small
+ *                      values
+ */
+void RobotDrive::TankDrive(GenericHID& leftStick, GenericHID& rightStick,
+                           bool squaredInputs) {
+  TankDrive(leftStick.GetY(), rightStick.GetY(), squaredInputs);
+}
+
+/**
+ * Provide tank steering using the stored robot configuration.
+ *
+ * This function lets you pick the axis to be used on each Joystick object for
+ * the left and right sides of the robot.
+ *
+ * @param leftStick  The Joystick object to use for the left side of the robot.
+ * @param leftAxis   The axis to select on the left side Joystick object.
+ * @param rightStick The Joystick object to use for the right side of the
+ *                   robot.
+ * @param rightAxis  The axis to select on the right side Joystick object.
+ * @param squaredInputs If true, the sensitivity will be decreased for small
+ *                      values
+ */
+void RobotDrive::TankDrive(GenericHID* leftStick, int leftAxis,
+                           GenericHID* rightStick, int rightAxis,
+                           bool squaredInputs) {
+  if (leftStick == nullptr || rightStick == nullptr) {
+    wpi_setWPIError(NullParameter);
+    return;
+  }
+  TankDrive(leftStick->GetRawAxis(leftAxis), rightStick->GetRawAxis(rightAxis),
+            squaredInputs);
+}
+
+void RobotDrive::TankDrive(GenericHID& leftStick, int leftAxis,
+                           GenericHID& rightStick, int rightAxis,
+                           bool squaredInputs) {
+  TankDrive(leftStick.GetRawAxis(leftAxis), rightStick.GetRawAxis(rightAxis),
+            squaredInputs);
+}
+
+/**
+ * Provide tank steering using the stored robot configuration.
+ *
+ * This function lets you directly provide joystick values from any source.
+ *
+ * @param leftValue  The value of the left stick.
+ * @param rightValue The value of the right stick.
+ * @param squaredInputs If true, the sensitivity will be decreased for small
+ *                      values
+ */
+void RobotDrive::TankDrive(double leftValue, double rightValue,
+                           bool squaredInputs) {
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, GetNumMotors(),
+               HALUsageReporting::kRobotDrive_Tank);
+    reported = true;
+  }
+
+  leftValue = Limit(leftValue);
+  rightValue = Limit(rightValue);
+
+  // square the inputs (while preserving the sign) to increase fine control
+  // while permitting full power
+  if (squaredInputs) {
+    leftValue = std::copysign(leftValue * leftValue, leftValue);
+    rightValue = std::copysign(rightValue * rightValue, rightValue);
+  }
+
+  SetLeftRightMotorOutputs(leftValue, rightValue);
+}
+
+/**
+ * Arcade drive implements single stick driving.
+ *
+ * Given a single Joystick, the class assumes the Y axis for the move value and
+ * the X axis for the rotate value.
+ * (Should add more information here regarding the way that arcade drive works.)
+ *
+ * @param stick         The joystick to use for Arcade single-stick driving.
+ *                      The Y-axis will be selected for forwards/backwards and
+ *                      the X-axis will be selected for rotation rate.
+ * @param squaredInputs If true, the sensitivity will be decreased for small
+ *                      values
+ */
+void RobotDrive::ArcadeDrive(GenericHID* stick, bool squaredInputs) {
+  // simply call the full-featured ArcadeDrive with the appropriate values
+  ArcadeDrive(stick->GetY(), stick->GetX(), squaredInputs);
+}
+
+/**
+ * Arcade drive implements single stick driving.
+ *
+ * Given a single Joystick, the class assumes the Y axis for the move value and
+ * the X axis for the rotate value.
+ * (Should add more information here regarding the way that arcade drive works.)
+ *
+ * @param stick         The joystick to use for Arcade single-stick driving.
+ *                      The Y-axis will be selected for forwards/backwards and
+ *                      the X-axis will be selected for rotation rate.
+ * @param squaredInputs If true, the sensitivity will be decreased for small
+ *                      values
+ */
+void RobotDrive::ArcadeDrive(GenericHID& stick, bool squaredInputs) {
+  // simply call the full-featured ArcadeDrive with the appropriate values
+  ArcadeDrive(stick.GetY(), stick.GetX(), squaredInputs);
+}
+
+/**
+ * Arcade drive implements single stick driving.
+ *
+ * Given two joystick instances and two axis, compute the values to send to
+ * either two or four motors.
+ *
+ * @param moveStick     The Joystick object that represents the
+ *                      forward/backward direction
+ * @param moveAxis      The axis on the moveStick object to use for
+ *                      forwards/backwards (typically Y_AXIS)
+ * @param rotateStick   The Joystick object that represents the rotation value
+ * @param rotateAxis    The axis on the rotation object to use for the rotate
+ *                      right/left (typically X_AXIS)
+ * @param squaredInputs Setting this parameter to true increases the
+ *                      sensitivity at lower speeds
+ */
+void RobotDrive::ArcadeDrive(GenericHID* moveStick, int moveAxis,
+                             GenericHID* rotateStick, int rotateAxis,
+                             bool squaredInputs) {
+  double moveValue = moveStick->GetRawAxis(moveAxis);
+  double rotateValue = rotateStick->GetRawAxis(rotateAxis);
+
+  ArcadeDrive(moveValue, rotateValue, squaredInputs);
+}
+
+/**
+ * Arcade drive implements single stick driving.
+ *
+ * Given two joystick instances and two axis, compute the values to send to
+ * either two or four motors.
+ *
+ * @param moveStick     The Joystick object that represents the
+ *                      forward/backward direction
+ * @param moveAxis      The axis on the moveStick object to use for
+ *                      forwards/backwards (typically Y_AXIS)
+ * @param rotateStick   The Joystick object that represents the rotation value
+ * @param rotateAxis    The axis on the rotation object to use for the rotate
+ *                      right/left (typically X_AXIS)
+ * @param squaredInputs Setting this parameter to true increases the
+ *                      sensitivity at lower speeds
+ */
+void RobotDrive::ArcadeDrive(GenericHID& moveStick, int moveAxis,
+                             GenericHID& rotateStick, int rotateAxis,
+                             bool squaredInputs) {
+  double moveValue = moveStick.GetRawAxis(moveAxis);
+  double rotateValue = rotateStick.GetRawAxis(rotateAxis);
+
+  ArcadeDrive(moveValue, rotateValue, squaredInputs);
+}
+
+/**
+ * Arcade drive implements single stick driving.
+ *
+ * This function lets you directly provide joystick values from any source.
+ *
+ * @param moveValue     The value to use for fowards/backwards
+ * @param rotateValue   The value to use for the rotate right/left
+ * @param squaredInputs If set, increases the sensitivity at low speeds
+ */
+void RobotDrive::ArcadeDrive(double moveValue, double rotateValue,
+                             bool squaredInputs) {
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, GetNumMotors(),
+               HALUsageReporting::kRobotDrive_ArcadeStandard);
+    reported = true;
+  }
+
+  // local variables to hold the computed PWM values for the motors
+  double leftMotorOutput;
+  double rightMotorOutput;
+
+  moveValue = Limit(moveValue);
+  rotateValue = Limit(rotateValue);
+
+  // square the inputs (while preserving the sign) to increase fine control
+  // while permitting full power
+  if (squaredInputs) {
+    moveValue = std::copysign(moveValue * moveValue, moveValue);
+    rotateValue = std::copysign(rotateValue * rotateValue, rotateValue);
+  }
+
+  if (moveValue > 0.0) {
+    if (rotateValue > 0.0) {
+      leftMotorOutput = moveValue - rotateValue;
+      rightMotorOutput = std::max(moveValue, rotateValue);
+    } else {
+      leftMotorOutput = std::max(moveValue, -rotateValue);
+      rightMotorOutput = moveValue + rotateValue;
+    }
+  } else {
+    if (rotateValue > 0.0) {
+      leftMotorOutput = -std::max(-moveValue, rotateValue);
+      rightMotorOutput = moveValue + rotateValue;
+    } else {
+      leftMotorOutput = moveValue - rotateValue;
+      rightMotorOutput = -std::max(-moveValue, -rotateValue);
+    }
+  }
+  SetLeftRightMotorOutputs(leftMotorOutput, rightMotorOutput);
+}
+
+/**
+ * Drive method for Mecanum wheeled robots.
+ *
+ * A method for driving with Mecanum wheeled robots. There are 4 wheels
+ * on the robot, arranged so that the front and back wheels are toed in 45
+ * degrees.
+ * When looking at the wheels from the top, the roller axles should form an X
+ * across the robot.
+ *
+ * This is designed to be directly driven by joystick axes.
+ *
+ * @param x         The speed that the robot should drive in the X direction.
+ *                  [-1.0..1.0]
+ * @param y         The speed that the robot should drive in the Y direction.
+ *                  This input is inverted to match the forward == -1.0 that
+ *                  joysticks produce. [-1.0..1.0]
+ * @param rotation  The rate of rotation for the robot that is completely
+ *                  independent of the translation. [-1.0..1.0]
+ * @param gyroAngle The current angle reading from the gyro.  Use this to
+ *                  implement field-oriented controls.
+ */
+void RobotDrive::MecanumDrive_Cartesian(double x, double y, double rotation,
+                                        double gyroAngle) {
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, GetNumMotors(),
+               HALUsageReporting::kRobotDrive_MecanumCartesian);
+    reported = true;
+  }
+
+  double xIn = x;
+  double yIn = y;
+  // Negate y for the joystick.
+  yIn = -yIn;
+  // Compenstate for gyro angle.
+  RotateVector(xIn, yIn, gyroAngle);
+
+  double wheelSpeeds[kMaxNumberOfMotors];
+  wheelSpeeds[kFrontLeftMotor] = xIn + yIn + rotation;
+  wheelSpeeds[kFrontRightMotor] = -xIn + yIn - rotation;
+  wheelSpeeds[kRearLeftMotor] = -xIn + yIn + rotation;
+  wheelSpeeds[kRearRightMotor] = xIn + yIn - rotation;
+
+  Normalize(wheelSpeeds);
+
+  m_frontLeftMotor->Set(wheelSpeeds[kFrontLeftMotor] * m_maxOutput);
+  m_frontRightMotor->Set(wheelSpeeds[kFrontRightMotor] * m_maxOutput);
+  m_rearLeftMotor->Set(wheelSpeeds[kRearLeftMotor] * m_maxOutput);
+  m_rearRightMotor->Set(wheelSpeeds[kRearRightMotor] * m_maxOutput);
+
+  m_safetyHelper->Feed();
+}
+
+/**
+ * Drive method for Mecanum wheeled robots.
+ *
+ * A method for driving with Mecanum wheeled robots. There are 4 wheels
+ * on the robot, arranged so that the front and back wheels are toed in 45
+ * degrees.
+ * When looking at the wheels from the top, the roller axles should form an X
+ * across the robot.
+ *
+ * @param magnitude The speed that the robot should drive in a given direction.
+ *                  [-1.0..1.0]
+ * @param direction The direction the robot should drive in degrees. The
+ *                  direction and maginitute are independent of the rotation
+ *                  rate.
+ * @param rotation  The rate of rotation for the robot that is completely
+ *                  independent of the magnitute or direction. [-1.0..1.0]
+ */
+void RobotDrive::MecanumDrive_Polar(double magnitude, double direction,
+                                    double rotation) {
+  static bool reported = false;
+  if (!reported) {
+    HAL_Report(HALUsageReporting::kResourceType_RobotDrive, GetNumMotors(),
+               HALUsageReporting::kRobotDrive_MecanumPolar);
+    reported = true;
+  }
+
+  // Normalized for full power along the Cartesian axes.
+  magnitude = Limit(magnitude) * std::sqrt(2.0);
+  // The rollers are at 45 degree angles.
+  double dirInRad = (direction + 45.0) * 3.14159 / 180.0;
+  double cosD = std::cos(dirInRad);
+  double sinD = std::sin(dirInRad);
+
+  double wheelSpeeds[kMaxNumberOfMotors];
+  wheelSpeeds[kFrontLeftMotor] = sinD * magnitude + rotation;
+  wheelSpeeds[kFrontRightMotor] = cosD * magnitude - rotation;
+  wheelSpeeds[kRearLeftMotor] = cosD * magnitude + rotation;
+  wheelSpeeds[kRearRightMotor] = sinD * magnitude - rotation;
+
+  Normalize(wheelSpeeds);
+
+  m_frontLeftMotor->Set(wheelSpeeds[kFrontLeftMotor] * m_maxOutput);
+  m_frontRightMotor->Set(wheelSpeeds[kFrontRightMotor] * m_maxOutput);
+  m_rearLeftMotor->Set(wheelSpeeds[kRearLeftMotor] * m_maxOutput);
+  m_rearRightMotor->Set(wheelSpeeds[kRearRightMotor] * m_maxOutput);
+
+  m_safetyHelper->Feed();
+}
+
+/**
+ * Holonomic Drive method for Mecanum wheeled robots.
+ *
+ * This is an alias to MecanumDrive_Polar() for backward compatability
+ *
+ * @param magnitude The speed that the robot should drive in a given direction.
+ *                  [-1.0..1.0]
+ * @param direction The direction the robot should drive. The direction and
+ *                  magnitude are independent of the rotation rate.
+ * @param rotation  The rate of rotation for the robot that is completely
+ *                  independent of the magnitude or direction.  [-1.0..1.0]
+ */
+void RobotDrive::HolonomicDrive(double magnitude, double direction,
+                                double rotation) {
+  MecanumDrive_Polar(magnitude, direction, rotation);
+}
+
+/**
+ * Set the speed of the right and left motors.
+ *
+ * This is used once an appropriate drive setup function is called such as
+ * TwoWheelDrive(). The motors are set to "leftOutput" and "rightOutput"
+ * and includes flipping the direction of one side for opposing motors.
+ *
+ * @param leftOutput  The speed to send to the left side of the robot.
+ * @param rightOutput The speed to send to the right side of the robot.
+ */
+void RobotDrive::SetLeftRightMotorOutputs(double leftOutput,
+                                          double rightOutput) {
+  wpi_assert(m_rearLeftMotor != nullptr && m_rearRightMotor != nullptr);
+
+  if (m_frontLeftMotor != nullptr)
+    m_frontLeftMotor->Set(Limit(leftOutput) * m_maxOutput);
+  m_rearLeftMotor->Set(Limit(leftOutput) * m_maxOutput);
+
+  if (m_frontRightMotor != nullptr)
+    m_frontRightMotor->Set(-Limit(rightOutput) * m_maxOutput);
+  m_rearRightMotor->Set(-Limit(rightOutput) * m_maxOutput);
+
+  m_safetyHelper->Feed();
+}
+
+/**
+ * Limit motor values to the -1.0 to +1.0 range.
+ */
+double RobotDrive::Limit(double number) {
+  if (number > 1.0) {
+    return 1.0;
+  }
+  if (number < -1.0) {
+    return -1.0;
+  }
+  return number;
+}
+
+/**
+ * Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.
+ */
+void RobotDrive::Normalize(double* wheelSpeeds) {
+  double maxMagnitude = std::fabs(wheelSpeeds[0]);
+  for (int i = 1; i < kMaxNumberOfMotors; i++) {
+    double temp = std::fabs(wheelSpeeds[i]);
+    if (maxMagnitude < temp) maxMagnitude = temp;
+  }
+  if (maxMagnitude > 1.0) {
+    for (int i = 0; i < kMaxNumberOfMotors; i++) {
+      wheelSpeeds[i] = wheelSpeeds[i] / maxMagnitude;
+    }
+  }
+}
+
+/**
+ * Rotate a vector in Cartesian space.
+ */
+void RobotDrive::RotateVector(double& x, double& y, double angle) {
+  double cosA = std::cos(angle * (3.14159 / 180.0));
+  double sinA = std::sin(angle * (3.14159 / 180.0));
+  double xOut = x * cosA - y * sinA;
+  double yOut = x * sinA + y * cosA;
+  x = xOut;
+  y = yOut;
+}
+
+/*
+ * Invert a motor direction.
+ *
+ * This is used when a motor should run in the opposite direction as the drive
+ * code would normally run it. Motors that are direct drive would be inverted,
+ * the Drive code assumes that the motors are geared with one reversal.
+ *
+ * @param motor      The motor index to invert.
+ * @param isInverted True if the motor should be inverted when operated.
+ */
+void RobotDrive::SetInvertedMotor(MotorType motor, bool isInverted) {
+  if (motor < 0 || motor > 3) {
+    wpi_setWPIError(InvalidMotorIndex);
+    return;
+  }
+  switch (motor) {
+    case kFrontLeftMotor:
+      m_frontLeftMotor->SetInverted(isInverted);
+      break;
+    case kFrontRightMotor:
+      m_frontRightMotor->SetInverted(isInverted);
+      break;
+    case kRearLeftMotor:
+      m_rearLeftMotor->SetInverted(isInverted);
+      break;
+    case kRearRightMotor:
+      m_rearRightMotor->SetInverted(isInverted);
+      break;
+  }
+}
+
+/**
+ * Set the turning sensitivity.
+ *
+ * This only impacts the Drive() entry-point.
+ *
+ * @param sensitivity Effectively sets the turning sensitivity (or turn radius
+ *                    for a given value)
+ */
+void RobotDrive::SetSensitivity(double sensitivity) {
+  m_sensitivity = sensitivity;
+}
+
+/**
+ * Configure the scaling factor for using RobotDrive with motor controllers in a
+ * mode other than PercentVbus.
+ *
+ * @param maxOutput Multiplied with the output percentage computed by the drive
+ *                  functions.
+ */
+void RobotDrive::SetMaxOutput(double maxOutput) { m_maxOutput = maxOutput; }
+
+void RobotDrive::SetExpiration(double timeout) {
+  m_safetyHelper->SetExpiration(timeout);
+}
+
+double RobotDrive::GetExpiration() const {
+  return m_safetyHelper->GetExpiration();
+}
+
+bool RobotDrive::IsAlive() const { return m_safetyHelper->IsAlive(); }
+
+bool RobotDrive::IsSafetyEnabled() const {
+  return m_safetyHelper->IsSafetyEnabled();
+}
+
+void RobotDrive::SetSafetyEnabled(bool enabled) {
+  m_safetyHelper->SetSafetyEnabled(enabled);
+}
+
+void RobotDrive::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "RobotDrive";
+}
+
+void RobotDrive::StopMotor() {
+  if (m_frontLeftMotor != nullptr) m_frontLeftMotor->StopMotor();
+  if (m_frontRightMotor != nullptr) m_frontRightMotor->StopMotor();
+  if (m_rearLeftMotor != nullptr) m_rearLeftMotor->StopMotor();
+  if (m_rearRightMotor != nullptr) m_rearRightMotor->StopMotor();
+  m_safetyHelper->Feed();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotState.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotState.cpp
new file mode 100644
index 0000000..82a005d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/RobotState.cpp
@@ -0,0 +1,58 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "RobotState.h"
+
+#include "Base.h"
+
+using namespace frc;
+
+std::shared_ptr<RobotStateInterface> RobotState::impl;
+
+void RobotState::SetImplementation(RobotStateInterface& i) {
+  impl = std::shared_ptr<RobotStateInterface>(
+      &i, NullDeleter<RobotStateInterface>());
+}
+
+void RobotState::SetImplementation(std::shared_ptr<RobotStateInterface> i) {
+  impl = i;
+}
+
+bool RobotState::IsDisabled() {
+  if (impl != nullptr) {
+    return impl->IsDisabled();
+  }
+  return true;
+}
+
+bool RobotState::IsEnabled() {
+  if (impl != nullptr) {
+    return impl->IsEnabled();
+  }
+  return false;
+}
+
+bool RobotState::IsOperatorControl() {
+  if (impl != nullptr) {
+    return impl->IsOperatorControl();
+  }
+  return true;
+}
+
+bool RobotState::IsAutonomous() {
+  if (impl != nullptr) {
+    return impl->IsAutonomous();
+  }
+  return false;
+}
+
+bool RobotState::IsTest() {
+  if (impl != nullptr) {
+    return impl->IsTest();
+  }
+  return false;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SD540.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SD540.cpp
new file mode 100644
index 0000000..cd0b267
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SD540.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SD540.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Note that the SD540 uses the following bounds for PWM values. These values
+ * should work reasonably well for most controllers, but if users experience
+ * issues such as asymmetric behavior around the deadband or inability to
+ * saturate the controller in either direction, calibration is recommended.
+ * The calibration procedure can be found in the SD540 User Manual available
+ * from Mindsensors.
+ *
+ *   2.05ms = full "forward"
+ *   1.55ms = the "high end" of the deadband range
+ *   1.50ms = center of the deadband range (off)
+ *   1.44ms = the "low end" of the deadband range
+ *   0.94ms = full "reverse"
+ */
+
+/**
+ * Constructor for a SD540.
+ *
+ * @param channel The PWM channel that the SD540 is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+SD540::SD540(int channel) : PWMSpeedController(channel) {
+  SetBounds(2.05, 1.55, 1.50, 1.44, .94);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_MindsensorsSD540, GetChannel());
+  SetName("SD540", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SPI.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SPI.cpp
new file mode 100644
index 0000000..f8c154c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SPI.cpp
@@ -0,0 +1,561 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SPI.h"
+
+#include <cstring>
+
+#include <HAL/HAL.h>
+#include <HAL/SPI.h>
+#include <llvm/SmallVector.h>
+#include <support/mutex.h>
+
+#include "DigitalSource.h"
+#include "Notifier.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+static constexpr int kAccumulateDepth = 2048;
+
+class SPI::Accumulator {
+ public:
+  Accumulator(HAL_SPIPort port, int xferSize, int validMask, int validValue,
+              int dataShift, int dataSize, bool isSigned, bool bigEndian)
+      : m_notifier([=]() {
+          std::lock_guard<wpi::mutex> lock(m_mutex);
+          Update();
+        }),
+        m_buf(new uint8_t[xferSize * kAccumulateDepth]),
+        m_validMask(validMask),
+        m_validValue(validValue),
+        m_dataMax(1 << dataSize),
+        m_dataMsbMask(1 << (dataSize - 1)),
+        m_dataShift(dataShift),
+        m_xferSize(xferSize),
+        m_isSigned(isSigned),
+        m_bigEndian(bigEndian),
+        m_port(port) {}
+  ~Accumulator() { delete[] m_buf; }
+
+  void Update();
+
+  Notifier m_notifier;
+  uint8_t* m_buf;
+  wpi::mutex m_mutex;
+
+  int64_t m_value = 0;
+  uint32_t m_count = 0;
+  int32_t m_lastValue = 0;
+
+  int32_t m_center = 0;
+  int32_t m_deadband = 0;
+
+  int32_t m_validMask;
+  int32_t m_validValue;
+  int32_t m_dataMax;      // one more than max data value
+  int32_t m_dataMsbMask;  // data field MSB mask (for signed)
+  uint8_t m_dataShift;    // data field shift right amount, in bits
+  int32_t m_xferSize;     // SPI transfer size, in bytes
+  bool m_isSigned;        // is data field signed?
+  bool m_bigEndian;       // is response big endian?
+  HAL_SPIPort m_port;
+};
+
+void SPI::Accumulator::Update() {
+  bool done;
+  do {
+    done = true;
+    int32_t status = 0;
+
+    // get amount of data available
+    int32_t numToRead =
+        HAL_ReadSPIAutoReceivedData(m_port, m_buf, 0, 0, &status);
+    if (status != 0) return;  // error reading
+
+    // only get whole responses
+    numToRead -= numToRead % m_xferSize;
+    if (numToRead > m_xferSize * kAccumulateDepth) {
+      numToRead = m_xferSize * kAccumulateDepth;
+      done = false;
+    }
+    if (numToRead == 0) return;  // no samples
+
+    // read buffered data
+    HAL_ReadSPIAutoReceivedData(m_port, m_buf, numToRead, 0, &status);
+    if (status != 0) return;  // error reading
+
+    // loop over all responses
+    for (int32_t off = 0; off < numToRead; off += m_xferSize) {
+      // convert from bytes
+      uint32_t resp = 0;
+      if (m_bigEndian) {
+        for (int32_t i = 0; i < m_xferSize; ++i) {
+          resp <<= 8;
+          resp |= m_buf[off + i] & 0xff;
+        }
+      } else {
+        for (int32_t i = m_xferSize - 1; i >= 0; --i) {
+          resp <<= 8;
+          resp |= m_buf[off + i] & 0xff;
+        }
+      }
+
+      // process response
+      if ((resp & m_validMask) == static_cast<uint32_t>(m_validValue)) {
+        // valid sensor data; extract data field
+        int32_t data = static_cast<int32_t>(resp >> m_dataShift);
+        data &= m_dataMax - 1;
+        // 2s complement conversion if signed MSB is set
+        if (m_isSigned && (data & m_dataMsbMask) != 0) data -= m_dataMax;
+        // center offset
+        data -= m_center;
+        // only accumulate if outside deadband
+        if (data < -m_deadband || data > m_deadband) m_value += data;
+        ++m_count;
+        m_lastValue = data;
+      } else {
+        // no data from the sensor; just clear the last value
+        m_lastValue = 0;
+      }
+    }
+  } while (!done);
+}
+
+/**
+ * Constructor
+ *
+ * @param port the physical SPI port
+ */
+SPI::SPI(Port port) : m_port(static_cast<HAL_SPIPort>(port)) {
+  int32_t status = 0;
+  HAL_InitializeSPI(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  static int instances = 0;
+  instances++;
+  HAL_Report(HALUsageReporting::kResourceType_SPI, instances);
+}
+
+/**
+ * Destructor.
+ */
+SPI::~SPI() { HAL_CloseSPI(m_port); }
+
+/**
+ * Configure the rate of the generated clock signal.
+ *
+ * The default value is 500,000Hz.
+ * The maximum value is 4,000,000Hz.
+ *
+ * @param hz The clock rate in Hertz.
+ */
+void SPI::SetClockRate(double hz) { HAL_SetSPISpeed(m_port, hz); }
+
+/**
+ * Configure the order that bits are sent and received on the wire
+ * to be most significant bit first.
+ */
+void SPI::SetMSBFirst() {
+  m_msbFirst = true;
+  HAL_SetSPIOpts(m_port, m_msbFirst, m_sampleOnTrailing, m_clk_idle_high);
+}
+
+/**
+ * Configure the order that bits are sent and received on the wire
+ * to be least significant bit first.
+ */
+void SPI::SetLSBFirst() {
+  m_msbFirst = false;
+  HAL_SetSPIOpts(m_port, m_msbFirst, m_sampleOnTrailing, m_clk_idle_high);
+}
+
+/**
+ * Configure that the data is stable on the falling edge and the data
+ * changes on the rising edge.
+ */
+void SPI::SetSampleDataOnFalling() {
+  m_sampleOnTrailing = true;
+  HAL_SetSPIOpts(m_port, m_msbFirst, m_sampleOnTrailing, m_clk_idle_high);
+}
+
+/**
+ * Configure that the data is stable on the rising edge and the data
+ * changes on the falling edge.
+ */
+void SPI::SetSampleDataOnRising() {
+  m_sampleOnTrailing = false;
+  HAL_SetSPIOpts(m_port, m_msbFirst, m_sampleOnTrailing, m_clk_idle_high);
+}
+
+/**
+ * Configure the clock output line to be active low.
+ * This is sometimes called clock polarity high or clock idle high.
+ */
+void SPI::SetClockActiveLow() {
+  m_clk_idle_high = true;
+  HAL_SetSPIOpts(m_port, m_msbFirst, m_sampleOnTrailing, m_clk_idle_high);
+}
+
+/**
+ * Configure the clock output line to be active high.
+ * This is sometimes called clock polarity low or clock idle low.
+ */
+void SPI::SetClockActiveHigh() {
+  m_clk_idle_high = false;
+  HAL_SetSPIOpts(m_port, m_msbFirst, m_sampleOnTrailing, m_clk_idle_high);
+}
+
+/**
+ * Configure the chip select line to be active high.
+ */
+void SPI::SetChipSelectActiveHigh() {
+  int32_t status = 0;
+  HAL_SetSPIChipSelectActiveHigh(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Configure the chip select line to be active low.
+ */
+void SPI::SetChipSelectActiveLow() {
+  int32_t status = 0;
+  HAL_SetSPIChipSelectActiveLow(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Write data to the slave device.  Blocks until there is space in the
+ * output FIFO.
+ *
+ * If not running in output only mode, also saves the data received
+ * on the MISO input during the transfer into the receive FIFO.
+ */
+int SPI::Write(uint8_t* data, int size) {
+  int retVal = 0;
+  retVal = HAL_WriteSPI(m_port, data, size);
+  return retVal;
+}
+
+/**
+ * Read a word from the receive FIFO.
+ *
+ * Waits for the current transfer to complete if the receive FIFO is empty.
+ *
+ * If the receive FIFO is empty, there is no active transfer, and initiate
+ * is false, errors.
+ *
+ * @param initiate If true, this function pushes "0" into the transmit buffer
+ *                 and initiates a transfer. If false, this function assumes
+ *                 that data is already in the receive FIFO from a previous
+ *                 write.
+ */
+int SPI::Read(bool initiate, uint8_t* dataReceived, int size) {
+  int retVal = 0;
+  if (initiate) {
+    llvm::SmallVector<uint8_t, 32> dataToSend;
+    dataToSend.resize(size);
+    retVal = HAL_TransactionSPI(m_port, dataToSend.data(), dataReceived, size);
+  } else {
+    retVal = HAL_ReadSPI(m_port, dataReceived, size);
+  }
+  return retVal;
+}
+
+/**
+ * Perform a simultaneous read/write transaction with the device
+ *
+ * @param dataToSend   The data to be written out to the device
+ * @param dataReceived Buffer to receive data from the device
+ * @param size         The length of the transaction, in bytes
+ */
+int SPI::Transaction(uint8_t* dataToSend, uint8_t* dataReceived, int size) {
+  int retVal = 0;
+  retVal = HAL_TransactionSPI(m_port, dataToSend, dataReceived, size);
+  return retVal;
+}
+
+/**
+ * Initialize automatic SPI transfer engine.
+ *
+ * Only a single engine is available, and use of it blocks use of all other
+ * chip select usage on the same physical SPI port while it is running.
+ *
+ * @param bufferSize buffer size in bytes
+ */
+void SPI::InitAuto(int bufferSize) {
+  int32_t status = 0;
+  HAL_InitSPIAuto(m_port, bufferSize, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Frees the automatic SPI transfer engine.
+ */
+void SPI::FreeAuto() {
+  int32_t status = 0;
+  HAL_FreeSPIAuto(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the data to be transmitted by the engine.
+ *
+ * Up to 16 bytes are configurable, and may be followed by up to 127 zero
+ * bytes.
+ *
+ * @param dataToSend data to send (maximum 16 bytes)
+ * @param zeroSize number of zeros to send after the data
+ */
+void SPI::SetAutoTransmitData(llvm::ArrayRef<uint8_t> dataToSend,
+                              int zeroSize) {
+  int32_t status = 0;
+  HAL_SetSPIAutoTransmitData(m_port, dataToSend.data(), dataToSend.size(),
+                             zeroSize, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Start running the automatic SPI transfer engine at a periodic rate.
+ *
+ * InitAuto() and SetAutoTransmitData() must be called before calling this
+ * function.
+ *
+ * @param period period between transfers, in seconds (us resolution)
+ */
+void SPI::StartAutoRate(double period) {
+  int32_t status = 0;
+  HAL_StartSPIAutoRate(m_port, period, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Start running the automatic SPI transfer engine when a trigger occurs.
+ *
+ * InitAuto() and SetAutoTransmitData() must be called before calling this
+ * function.
+ *
+ * @param source digital source for the trigger (may be an analog trigger)
+ * @param rising trigger on the rising edge
+ * @param falling trigger on the falling edge
+ */
+void SPI::StartAutoTrigger(DigitalSource& source, bool rising, bool falling) {
+  int32_t status = 0;
+  HAL_StartSPIAutoTrigger(
+      m_port, source.GetPortHandleForRouting(),
+      (HAL_AnalogTriggerType)source.GetAnalogTriggerTypeForRouting(), rising,
+      falling, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Stop running the automatic SPI transfer engine.
+ */
+void SPI::StopAuto() {
+  int32_t status = 0;
+  HAL_StopSPIAuto(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Force the engine to make a single transfer.
+ */
+void SPI::ForceAutoRead() {
+  int32_t status = 0;
+  HAL_ForceSPIAutoRead(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Read data that has been transferred by the automatic SPI transfer engine.
+ *
+ * Transfers may be made a byte at a time, so it's necessary for the caller
+ * to handle cases where an entire transfer has not been completed.
+ *
+ * Blocks until numToRead bytes have been read or timeout expires.
+ * May be called with numToRead=0 to retrieve how many bytes are available.
+ *
+ * @param buffer buffer where read bytes are stored
+ * @param numToRead number of bytes to read
+ * @param timeout timeout in seconds (ms resolution)
+ * @return Number of bytes remaining to be read
+ */
+int SPI::ReadAutoReceivedData(uint8_t* buffer, int numToRead, double timeout) {
+  int32_t status = 0;
+  int32_t val =
+      HAL_ReadSPIAutoReceivedData(m_port, buffer, numToRead, timeout, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return val;
+}
+
+/**
+ * Get the number of bytes dropped by the automatic SPI transfer engine due
+ * to the receive buffer being full.
+ *
+ * @return Number of bytes dropped
+ */
+int SPI::GetAutoDroppedCount() {
+  int32_t status = 0;
+  int32_t val = HAL_GetSPIAutoDroppedCount(m_port, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return val;
+}
+
+/**
+ * Initialize the accumulator.
+ *
+ * @param period    Time between reads
+ * @param cmd       SPI command to send to request data
+ * @param xferSize  SPI transfer size, in bytes
+ * @param validMask Mask to apply to received data for validity checking
+ * @param validData After valid_mask is applied, required matching value for
+ *                  validity checking
+ * @param dataShift Bit shift to apply to received data to get actual data
+ *                  value
+ * @param dataSize  Size (in bits) of data field
+ * @param isSigned  Is data field signed?
+ * @param bigEndian Is device big endian?
+ */
+void SPI::InitAccumulator(double period, int cmd, int xferSize, int validMask,
+                          int validValue, int dataShift, int dataSize,
+                          bool isSigned, bool bigEndian) {
+  InitAuto(xferSize * kAccumulateDepth);
+  uint8_t cmdBytes[4] = {0, 0, 0, 0};
+  if (bigEndian) {
+    for (int32_t i = xferSize - 1; i >= 0; --i) {
+      cmdBytes[i] = cmd & 0xff;
+      cmd >>= 8;
+    }
+  } else {
+    cmdBytes[0] = cmd & 0xff;
+    cmd >>= 8;
+    cmdBytes[1] = cmd & 0xff;
+    cmd >>= 8;
+    cmdBytes[2] = cmd & 0xff;
+    cmd >>= 8;
+    cmdBytes[3] = cmd & 0xff;
+  }
+  SetAutoTransmitData(cmdBytes, xferSize - 4);
+  StartAutoRate(period);
+
+  m_accum.reset(new Accumulator(m_port, xferSize, validMask, validValue,
+                                dataShift, dataSize, isSigned, bigEndian));
+  m_accum->m_notifier.StartPeriodic(period * kAccumulateDepth / 2);
+}
+
+/**
+ * Frees the accumulator.
+ */
+void SPI::FreeAccumulator() {
+  m_accum.reset(nullptr);
+  FreeAuto();
+}
+
+/**
+ * Resets the accumulator to zero.
+ */
+void SPI::ResetAccumulator() {
+  if (!m_accum) return;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->m_value = 0;
+  m_accum->m_count = 0;
+  m_accum->m_lastValue = 0;
+}
+
+/**
+ * Set the center value of the accumulator.
+ *
+ * The center value is subtracted from each value before it is added to the
+ * accumulator. This is used for the center value of devices like gyros and
+ * accelerometers to make integration work and to take the device offset into
+ * account when integrating.
+ */
+void SPI::SetAccumulatorCenter(int center) {
+  if (!m_accum) return;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->m_center = center;
+}
+
+/**
+ * Set the accumulator's deadband.
+ */
+void SPI::SetAccumulatorDeadband(int deadband) {
+  if (!m_accum) return;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->m_deadband = deadband;
+}
+
+/**
+ * Read the last value read by the accumulator engine.
+ */
+int SPI::GetAccumulatorLastValue() const {
+  if (!m_accum) return 0;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->Update();
+  return m_accum->m_lastValue;
+}
+
+/**
+ * Read the accumulated value.
+ *
+ * @return The 64-bit value accumulated since the last Reset().
+ */
+int64_t SPI::GetAccumulatorValue() const {
+  if (!m_accum) return 0;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->Update();
+  return m_accum->m_value;
+}
+
+/**
+ * Read the number of accumulated values.
+ *
+ * Read the count of the accumulated values since the accumulator was last
+ * Reset().
+ *
+ * @return The number of times samples from the channel were accumulated.
+ */
+int64_t SPI::GetAccumulatorCount() const {
+  if (!m_accum) return 0;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->Update();
+  return m_accum->m_count;
+}
+
+/**
+ * Read the average of the accumulated value.
+ *
+ * @return The accumulated average value (value / count).
+ */
+double SPI::GetAccumulatorAverage() const {
+  if (!m_accum) return 0;
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->Update();
+  if (m_accum->m_count == 0) return 0.0;
+  return static_cast<double>(m_accum->m_value) / m_accum->m_count;
+}
+
+/**
+ * Read the accumulated value and the number of accumulated values atomically.
+ *
+ * This function reads the value and count atomically.
+ * This can be used for averaging.
+ *
+ * @param value Pointer to the 64-bit accumulated output.
+ * @param count Pointer to the number of accumulation cycles.
+ */
+void SPI::GetAccumulatorOutput(int64_t& value, int64_t& count) const {
+  if (!m_accum) {
+    value = 0;
+    count = 0;
+    return;
+  }
+  std::lock_guard<wpi::mutex> lock(m_accum->m_mutex);
+  m_accum->Update();
+  value = m_accum->m_value;
+  count = m_accum->m_count;
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SafePWM.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SafePWM.cpp
new file mode 100644
index 0000000..d573649
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SafePWM.cpp
@@ -0,0 +1,92 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SafePWM.h"
+
+using namespace frc;
+
+/**
+ * Constructor for a SafePWM object taking a channel number.
+ *
+ * @param channel The PWM channel number 0-9 are on-board, 10-19 are on the MXP
+ *                port
+ */
+SafePWM::SafePWM(int channel) : PWM(channel) {
+  m_safetyHelper = std::make_unique<MotorSafetyHelper>(this);
+  m_safetyHelper->SetSafetyEnabled(false);
+}
+
+/**
+ * Set the expiration time for the PWM object.
+ *
+ * @param timeout The timeout (in seconds) for this motor object
+ */
+void SafePWM::SetExpiration(double timeout) {
+  m_safetyHelper->SetExpiration(timeout);
+}
+
+/**
+ * Return the expiration time for the PWM object.
+ *
+ * @returns The expiration time value.
+ */
+double SafePWM::GetExpiration() const {
+  return m_safetyHelper->GetExpiration();
+}
+
+/**
+ * Check if the PWM object is currently alive or stopped due to a timeout.
+ *
+ * @return a bool value that is true if the motor has NOT timed out and should
+ *         still be running.
+ */
+bool SafePWM::IsAlive() const { return m_safetyHelper->IsAlive(); }
+
+/**
+ * Stop the motor associated with this PWM object.
+ *
+ * This is called by the MotorSafetyHelper object when it has a timeout for this
+ * PWM and needs to stop it from running.
+ */
+void SafePWM::StopMotor() { SetDisabled(); }
+
+/**
+ * Enable/disable motor safety for this device.
+ *
+ * Turn on and off the motor safety option for this PWM object.
+ *
+ * @param enabled True if motor safety is enforced for this object
+ */
+void SafePWM::SetSafetyEnabled(bool enabled) {
+  m_safetyHelper->SetSafetyEnabled(enabled);
+}
+
+/**
+ * Check if motor safety is enabled for this object.
+ *
+ * @returns True if motor safety is enforced for this object
+ */
+bool SafePWM::IsSafetyEnabled() const {
+  return m_safetyHelper->IsSafetyEnabled();
+}
+
+void SafePWM::GetDescription(llvm::raw_ostream& desc) const {
+  desc << "PWM " << GetChannel();
+}
+
+/**
+ * Feed the MotorSafety timer when setting the speed.
+ *
+ * This method is called by the subclass motor whenever it updates its speed,
+ * thereby reseting the timeout value.
+ *
+ * @param speed Value to pass to the PWM class
+ */
+void SafePWM::SetSpeed(double speed) {
+  PWM::SetSpeed(speed);
+  m_safetyHelper->Feed();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SampleRobot.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SampleRobot.cpp
new file mode 100644
index 0000000..3041388
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SampleRobot.cpp
@@ -0,0 +1,144 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SampleRobot.h"
+
+#include <llvm/raw_ostream.h>
+#include <networktables/NetworkTable.h>
+
+#include "DriverStation.h"
+#include "LiveWindow/LiveWindow.h"
+#include "Timer.h"
+
+using namespace frc;
+
+/**
+ * Start a competition.
+ *
+ * This code needs to track the order of the field starting to ensure that
+ * everything happens in the right order. Repeatedly run the correct method,
+ * either Autonomous or OperatorControl or Test when the robot is enabled.
+ * After running the correct method, wait for some state to change, either the
+ * other mode starts or the robot is disabled. Then go back and wait for the
+ * robot to be enabled again.
+ */
+void SampleRobot::StartCompetition() {
+  LiveWindow* lw = LiveWindow::GetInstance();
+
+  RobotInit();
+
+  // Tell the DS that the robot is ready to be enabled
+  HAL_ObserveUserProgramStarting();
+
+  RobotMain();
+
+  if (!m_robotMainOverridden) {
+    while (true) {
+      if (IsDisabled()) {
+        m_ds.InDisabled(true);
+        Disabled();
+        m_ds.InDisabled(false);
+        while (IsDisabled()) m_ds.WaitForData();
+      } else if (IsAutonomous()) {
+        m_ds.InAutonomous(true);
+        Autonomous();
+        m_ds.InAutonomous(false);
+        while (IsAutonomous() && IsEnabled()) m_ds.WaitForData();
+      } else if (IsTest()) {
+        lw->SetEnabled(true);
+        m_ds.InTest(true);
+        Test();
+        m_ds.InTest(false);
+        while (IsTest() && IsEnabled()) m_ds.WaitForData();
+        lw->SetEnabled(false);
+      } else {
+        m_ds.InOperatorControl(true);
+        OperatorControl();
+        m_ds.InOperatorControl(false);
+        while (IsOperatorControl() && IsEnabled()) m_ds.WaitForData();
+      }
+    }
+  }
+}
+
+/**
+ * Robot-wide initialization code should go here.
+ *
+ * Users should override this method for default Robot-wide initialization which
+ * will be called when the robot is first powered on. It will be called exactly
+ * one time.
+ *
+ * Warning: the Driver Station "Robot Code" light and FMS "Robot Ready"
+ * indicators will be off until RobotInit() exits. Code in RobotInit() that
+ * waits for enable will cause the robot to never indicate that the code is
+ * ready, causing the robot to be bypassed in a match.
+ */
+void SampleRobot::RobotInit() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Disabled should go here.
+ *
+ * Programmers should override this method to run code that should run while the
+ * field is disabled.
+ */
+void SampleRobot::Disabled() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Autonomous should go here.
+ *
+ * Programmers should override this method to run code that should run while the
+ * field is in the autonomous period. This will be called once each time the
+ * robot enters the autonomous state.
+ */
+void SampleRobot::Autonomous() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Operator control (tele-operated) code should go here.
+ *
+ * Programmers should override this method to run code that should run while the
+ * field is in the Operator Control (tele-operated) period. This is called once
+ * each time the robot enters the teleop state.
+ */
+void SampleRobot::OperatorControl() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Test program should go here.
+ *
+ * Programmers should override this method to run code that executes while the
+ * robot is in test mode. This will be called once whenever the robot enters
+ * test mode
+ */
+void SampleRobot::Test() {
+  llvm::outs() << "Default " << __FUNCTION__ << "() method... Overload me!\n";
+}
+
+/**
+ * Robot main program for free-form programs.
+ *
+ * This should be overridden by user subclasses if the intent is to not use the
+ * Autonomous() and OperatorControl() methods. In that case, the program is
+ * responsible for sensing when to run the autonomous and operator control
+ * functions in their program.
+ *
+ * This method will be called immediately after the constructor is called. If it
+ * has not been overridden by a user subclass (i.e. the default version runs),
+ * then the Autonomous() and OperatorControl() methods will be called.
+ */
+void SampleRobot::RobotMain() { m_robotMainOverridden = false; }
+
+SampleRobot::SampleRobot() {
+  HAL_Report(HALUsageReporting::kResourceType_Framework,
+             HALUsageReporting::kFramework_Simple);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SensorBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SensorBase.cpp
new file mode 100644
index 0000000..ca87fa3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SensorBase.cpp
@@ -0,0 +1,117 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SensorBase.h"
+
+#include <HAL/AnalogInput.h>
+#include <HAL/AnalogOutput.h>
+#include <HAL/DIO.h>
+#include <HAL/HAL.h>
+#include <HAL/PDP.h>
+#include <HAL/PWM.h>
+#include <HAL/Ports.h>
+#include <HAL/Relay.h>
+#include <HAL/Solenoid.h>
+
+#include "WPIErrors.h"
+
+using namespace frc;
+
+const int SensorBase::kDigitalChannels = HAL_GetNumDigitalChannels();
+const int SensorBase::kAnalogInputs = HAL_GetNumAnalogInputs();
+const int SensorBase::kSolenoidChannels = HAL_GetNumSolenoidChannels();
+const int SensorBase::kSolenoidModules = HAL_GetNumPCMModules();
+const int SensorBase::kPwmChannels = HAL_GetNumPWMChannels();
+const int SensorBase::kRelayChannels = HAL_GetNumRelayHeaders();
+const int SensorBase::kPDPChannels = HAL_GetNumPDPChannels();
+
+/**
+ * Check that the solenoid module number is valid.
+ *
+ * @return Solenoid module is valid and present
+ */
+bool SensorBase::CheckSolenoidModule(int moduleNumber) {
+  return HAL_CheckSolenoidModule(moduleNumber);
+}
+
+/**
+ * Check that the digital channel number is valid.
+ *
+ * Verify that the channel number is one of the legal channel numbers. Channel
+ * numbers are 1-based.
+ *
+ * @return Digital channel is valid
+ */
+bool SensorBase::CheckDigitalChannel(int channel) {
+  return HAL_CheckDIOChannel(channel);
+}
+
+/**
+ * Check that the relay channel number is valid.
+ *
+ * Verify that the channel number is one of the legal channel numbers. Channel
+ * numbers are 0-based.
+ *
+ * @return Relay channel is valid
+ */
+bool SensorBase::CheckRelayChannel(int channel) {
+  return HAL_CheckRelayChannel(channel);
+}
+
+/**
+ * Check that the digital channel number is valid.
+ *
+ * Verify that the channel number is one of the legal channel numbers. Channel
+ * numbers are 1-based.
+ *
+ * @return PWM channel is valid
+ */
+bool SensorBase::CheckPWMChannel(int channel) {
+  return HAL_CheckPWMChannel(channel);
+}
+
+/**
+ * Check that the analog input number is value.
+ *
+ * Verify that the analog input number is one of the legal channel numbers.
+ * Channel numbers are 0-based.
+ *
+ * @return Analog channel is valid
+ */
+bool SensorBase::CheckAnalogInputChannel(int channel) {
+  return HAL_CheckAnalogInputChannel(channel);
+}
+
+/**
+ * Check that the analog output number is valid.
+ *
+ * Verify that the analog output number is one of the legal channel numbers.
+ * Channel numbers are 0-based.
+ *
+ * @return Analog channel is valid
+ */
+bool SensorBase::CheckAnalogOutputChannel(int channel) {
+  return HAL_CheckAnalogOutputChannel(channel);
+}
+
+/**
+ * Verify that the solenoid channel number is within limits.
+ *
+ * @return Solenoid channel is valid
+ */
+bool SensorBase::CheckSolenoidChannel(int channel) {
+  return HAL_CheckSolenoidChannel(channel);
+}
+
+/**
+ * Verify that the power distribution channel number is within limits.
+ *
+ * @return PDP channel is valid
+ */
+bool SensorBase::CheckPDPChannel(int channel) {
+  return HAL_CheckPDPModule(channel);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SerialPort.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SerialPort.cpp
new file mode 100644
index 0000000..70262db
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SerialPort.cpp
@@ -0,0 +1,252 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SerialPort.h"
+
+#include <HAL/HAL.h>
+#include <HAL/SerialPort.h>
+
+// static ViStatus _VI_FUNCH ioCompleteHandler (ViSession vi, ViEventType
+// eventType, ViEvent event, ViAddr userHandle);
+
+using namespace frc;
+
+/**
+ * Create an instance of a Serial Port class.
+ *
+ * @param baudRate The baud rate to configure the serial port.
+ * @param port     The physical port to use
+ * @param dataBits The number of data bits per transfer.  Valid values are
+ *                 between 5 and 8 bits.
+ * @param parity   Select the type of parity checking to use.
+ * @param stopBits The number of stop bits to use as defined by the enum
+ *                 StopBits.
+ */
+SerialPort::SerialPort(int baudRate, Port port, int dataBits,
+                       SerialPort::Parity parity,
+                       SerialPort::StopBits stopBits) {
+  int32_t status = 0;
+
+  m_port = port;
+
+  HAL_InitializeSerialPort(static_cast<HAL_SerialPort>(port), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  // Don't continue if initialization failed
+  if (status < 0) return;
+  HAL_SetSerialBaudRate(static_cast<HAL_SerialPort>(port), baudRate, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  HAL_SetSerialDataBits(static_cast<HAL_SerialPort>(port), dataBits, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  HAL_SetSerialParity(static_cast<HAL_SerialPort>(port), parity, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  HAL_SetSerialStopBits(static_cast<HAL_SerialPort>(port), stopBits, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+
+  // Set the default timeout to 5 seconds.
+  SetTimeout(5.0);
+
+  // Don't wait until the buffer is full to transmit.
+  SetWriteBufferMode(kFlushOnAccess);
+
+  EnableTermination();
+
+  // viInstallHandler(m_portHandle, VI_EVENT_IO_COMPLETION, ioCompleteHandler,
+  // this);
+  // viEnableEvent(m_portHandle, VI_EVENT_IO_COMPLETION, VI_HNDLR, VI_NULL);
+
+  HAL_Report(HALUsageReporting::kResourceType_SerialPort, 0);
+}
+
+/**
+ * Destructor.
+ */
+SerialPort::~SerialPort() {
+  int32_t status = 0;
+  HAL_CloseSerial(static_cast<HAL_SerialPort>(m_port), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Set the type of flow control to enable on this port.
+ *
+ * By default, flow control is disabled.
+ */
+void SerialPort::SetFlowControl(SerialPort::FlowControl flowControl) {
+  int32_t status = 0;
+  HAL_SetSerialFlowControl(static_cast<HAL_SerialPort>(m_port), flowControl,
+                           &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Enable termination and specify the termination character.
+ *
+ * Termination is currently only implemented for receive.
+ * When the the terminator is recieved, the Read() or Scanf() will return
+ * fewer bytes than requested, stopping after the terminator.
+ *
+ * @param terminator The character to use for termination.
+ */
+void SerialPort::EnableTermination(char terminator) {
+  int32_t status = 0;
+  HAL_EnableSerialTermination(static_cast<HAL_SerialPort>(m_port), terminator,
+                              &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Disable termination behavior.
+ */
+void SerialPort::DisableTermination() {
+  int32_t status = 0;
+  HAL_DisableSerialTermination(static_cast<HAL_SerialPort>(m_port), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Get the number of bytes currently available to read from the serial port.
+ *
+ * @return The number of bytes available to read
+ */
+int SerialPort::GetBytesReceived() {
+  int32_t status = 0;
+  int retVal =
+      HAL_GetSerialBytesReceived(static_cast<HAL_SerialPort>(m_port), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Read raw bytes out of the buffer.
+ *
+ * @param buffer Pointer to the buffer to store the bytes in.
+ * @param count  The maximum number of bytes to read.
+ * @return The number of bytes actually read into the buffer.
+ */
+int SerialPort::Read(char* buffer, int count) {
+  int32_t status = 0;
+  int retVal = HAL_ReadSerial(static_cast<HAL_SerialPort>(m_port), buffer,
+                              count, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Write raw bytes to the buffer.
+ *
+ * @param buffer Pointer to the buffer to read the bytes from.
+ * @param count  The maximum number of bytes to write.
+ * @return The number of bytes actually written into the port.
+ */
+int SerialPort::Write(const char* buffer, int count) {
+  return Write(llvm::StringRef(buffer, static_cast<size_t>(count)));
+}
+
+/**
+ * Write raw bytes to the buffer.
+ *
+ * Use Write({data, len}) to get a buffer that is shorter than the length of the
+ * string.
+ *
+ * @param buffer StringRef to the buffer to read the bytes from.
+ * @return The number of bytes actually written into the port.
+ */
+int SerialPort::Write(llvm::StringRef buffer) {
+  int32_t status = 0;
+  int retVal = HAL_WriteSerial(static_cast<HAL_SerialPort>(m_port),
+                               buffer.data(), buffer.size(), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return retVal;
+}
+
+/**
+ * Configure the timeout of the serial port.
+ *
+ * This defines the timeout for transactions with the hardware.
+ * It will affect reads and very large writes.
+ *
+ * @param timeout The number of seconds to to wait for I/O.
+ */
+void SerialPort::SetTimeout(double timeout) {
+  int32_t status = 0;
+  HAL_SetSerialTimeout(static_cast<HAL_SerialPort>(m_port), timeout, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Specify the size of the input buffer.
+ *
+ * Specify the amount of data that can be stored before data
+ * from the device is returned to Read or Scanf.  If you want
+ * data that is recieved to be returned immediately, set this to 1.
+ *
+ * It the buffer is not filled before the read timeout expires, all
+ * data that has been received so far will be returned.
+ *
+ * @param size The read buffer size.
+ */
+void SerialPort::SetReadBufferSize(int size) {
+  int32_t status = 0;
+  HAL_SetSerialReadBufferSize(static_cast<HAL_SerialPort>(m_port), size,
+                              &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Specify the size of the output buffer.
+ *
+ * Specify the amount of data that can be stored before being
+ * transmitted to the device.
+ *
+ * @param size The write buffer size.
+ */
+void SerialPort::SetWriteBufferSize(int size) {
+  int32_t status = 0;
+  HAL_SetSerialWriteBufferSize(static_cast<HAL_SerialPort>(m_port), size,
+                               &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Specify the flushing behavior of the output buffer.
+ *
+ * When set to kFlushOnAccess, data is synchronously written to the serial port
+ * after each call to either Printf() or Write().
+ *
+ * When set to kFlushWhenFull, data will only be written to the serial port when
+ * the buffer is full or when Flush() is called.
+ *
+ * @param mode The write buffer mode.
+ */
+void SerialPort::SetWriteBufferMode(SerialPort::WriteBufferMode mode) {
+  int32_t status = 0;
+  HAL_SetSerialWriteMode(static_cast<HAL_SerialPort>(m_port), mode, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Force the output buffer to be written to the port.
+ *
+ * This is used when SetWriteBufferMode() is set to kFlushWhenFull to force a
+ * flush before the buffer is full.
+ */
+void SerialPort::Flush() {
+  int32_t status = 0;
+  HAL_FlushSerial(static_cast<HAL_SerialPort>(m_port), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Reset the serial port driver to a known state.
+ *
+ * Empty the transmit and receive buffers in the device and formatted I/O.
+ */
+void SerialPort::Reset() {
+  int32_t status = 0;
+  HAL_ClearSerial(static_cast<HAL_SerialPort>(m_port), &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Servo.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Servo.cpp
new file mode 100644
index 0000000..4fdf9e6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Servo.cpp
@@ -0,0 +1,104 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Servo.h"
+
+#include <HAL/HAL.h>
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+constexpr double Servo::kMaxServoAngle;
+constexpr double Servo::kMinServoAngle;
+
+constexpr double Servo::kDefaultMaxServoPWM;
+constexpr double Servo::kDefaultMinServoPWM;
+
+/**
+ * @param channel The PWM channel to which the servo is attached. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+Servo::Servo(int channel) : SafePWM(channel) {
+  // Set minimum and maximum PWM values supported by the servo
+  SetBounds(kDefaultMaxServoPWM, 0.0, 0.0, 0.0, kDefaultMinServoPWM);
+
+  // Assign defaults for period multiplier for the servo PWM control signal
+  SetPeriodMultiplier(kPeriodMultiplier_4X);
+
+  HAL_Report(HALUsageReporting::kResourceType_Servo, channel);
+  SetName("Servo", channel);
+}
+
+/**
+ * Set the servo position.
+ *
+ * Servo values range from 0.0 to 1.0 corresponding to the range of full left to
+ * full right.
+ *
+ * @param value Position from 0.0 to 1.0.
+ */
+void Servo::Set(double value) { SetPosition(value); }
+
+/**
+ * Set the servo to offline.
+ *
+ * Set the servo raw value to 0 (undriven)
+ */
+void Servo::SetOffline() { SetRaw(0); }
+
+/**
+ * Get the servo position.
+ *
+ * Servo values range from 0.0 to 1.0 corresponding to the range of full left to
+ * full right.
+ *
+ * @return Position from 0.0 to 1.0.
+ */
+double Servo::Get() const { return GetPosition(); }
+
+/**
+ * Set the servo angle.
+ *
+ * Assume that the servo angle is linear with respect to the PWM value (big
+ * assumption, need to test).
+ *
+ * Servo angles that are out of the supported range of the servo simply
+ * "saturate" in that direction. In other words, if the servo has a range of
+ * (X degrees to Y degrees) than angles of less than X result in an angle of
+ * X being set and angles of more than Y degrees result in an angle of Y being
+ * set.
+ *
+ * @param degrees The angle in degrees to set the servo.
+ */
+void Servo::SetAngle(double degrees) {
+  if (degrees < kMinServoAngle) {
+    degrees = kMinServoAngle;
+  } else if (degrees > kMaxServoAngle) {
+    degrees = kMaxServoAngle;
+  }
+
+  SetPosition((degrees - kMinServoAngle) / GetServoAngleRange());
+}
+
+/**
+ * Get the servo angle.
+ *
+ * Assume that the servo angle is linear with respect to the PWM value (big
+ * assumption, need to test).
+ *
+ * @return The angle in degrees to which the servo is set.
+ */
+double Servo::GetAngle() const {
+  return GetPosition() * GetServoAngleRange() + kMinServoAngle;
+}
+
+void Servo::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Servo");
+  builder.AddDoubleProperty("Value", [=]() { return Get(); },
+                            [=](double value) { Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/NamedSendable.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/NamedSendable.cpp
new file mode 100644
index 0000000..fe812c1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/NamedSendable.cpp
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SmartDashboard/NamedSendable.h"
+
+using namespace frc;
+
+void NamedSendable::SetName(const llvm::Twine&) {}
+
+std::string NamedSendable::GetSubsystem() const { return std::string(); }
+
+void NamedSendable::SetSubsystem(const llvm::Twine&) {}
+
+void NamedSendable::InitSendable(SendableBuilder&) {}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableBase.cpp
new file mode 100644
index 0000000..41fbd0e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableBase.cpp
@@ -0,0 +1,91 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SmartDashboard/SendableBase.h"
+
+#include "LiveWindow/LiveWindow.h"
+
+using namespace frc;
+
+/**
+ * Creates an instance of the sensor base.
+ *
+ * @param addLiveWindow if true, add this Sendable to LiveWindow
+ */
+SendableBase::SendableBase(bool addLiveWindow) {
+  if (addLiveWindow) LiveWindow::GetInstance()->Add(this);
+}
+
+/**
+ * Free the resources used by this object.
+ */
+SendableBase::~SendableBase() { LiveWindow::GetInstance()->Remove(this); }
+
+std::string SendableBase::GetName() const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  return m_name;
+}
+
+void SendableBase::SetName(const llvm::Twine& name) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_name = name.str();
+}
+
+std::string SendableBase::GetSubsystem() const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  return m_subsystem;
+}
+
+void SendableBase::SetSubsystem(const llvm::Twine& subsystem) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_subsystem = subsystem.str();
+}
+
+/**
+ * Add a child component.
+ *
+ * @param child child component
+ */
+void SendableBase::AddChild(std::shared_ptr<Sendable> child) {
+  LiveWindow::GetInstance()->AddChild(this, child);
+}
+
+/**
+ * Add a child component.
+ *
+ * @param child child component
+ */
+void SendableBase::AddChild(void* child) {
+  LiveWindow::GetInstance()->AddChild(this, child);
+}
+
+/**
+ * Sets the name of the sensor with a channel number.
+ *
+ * @param moduleType A string that defines the module name in the label for the
+ *                   value
+ * @param channel    The channel number the device is plugged into
+ */
+void SendableBase::SetName(const llvm::Twine& moduleType, int channel) {
+  SetName(moduleType + llvm::Twine('[') + llvm::Twine(channel) +
+          llvm::Twine(']'));
+}
+
+/**
+ * Sets the name of the sensor with a module and channel number.
+ *
+ * @param moduleType   A string that defines the module name in the label for
+ *                     the value
+ * @param moduleNumber The number of the particular module type
+ * @param channel      The channel number the device is plugged into (usually
+ * PWM)
+ */
+void SendableBase::SetName(const llvm::Twine& moduleType, int moduleNumber,
+                           int channel) {
+  SetName(moduleType + llvm::Twine('[') + llvm::Twine(moduleNumber) +
+          llvm::Twine(',') + llvm::Twine(channel) + llvm::Twine(']'));
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableBuilderImpl.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableBuilderImpl.cpp
new file mode 100644
index 0000000..2af2f3a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableBuilderImpl.cpp
@@ -0,0 +1,373 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SmartDashboard/SendableBuilderImpl.h"
+
+#include <llvm/SmallString.h>
+
+#include "ntcore_cpp.h"
+
+using namespace frc;
+
+void SendableBuilderImpl::SetTable(std::shared_ptr<nt::NetworkTable> table) {
+  m_table = table;
+}
+
+std::shared_ptr<nt::NetworkTable> SendableBuilderImpl::GetTable() {
+  return m_table;
+}
+
+void SendableBuilderImpl::UpdateTable() {
+  uint64_t time = nt::Now();
+  for (auto& property : m_properties) {
+    if (property.update) property.update(property.entry, time);
+  }
+  if (m_updateTable) m_updateTable();
+}
+
+void SendableBuilderImpl::StartListeners() {
+  for (auto& property : m_properties) property.StartListener();
+}
+
+void SendableBuilderImpl::StopListeners() {
+  for (auto& property : m_properties) property.StopListener();
+}
+
+void SendableBuilderImpl::StartLiveWindowMode() {
+  if (m_safeState) m_safeState();
+  StartListeners();
+}
+
+void SendableBuilderImpl::StopLiveWindowMode() {
+  StopListeners();
+  if (m_safeState) m_safeState();
+}
+
+void SendableBuilderImpl::SetSmartDashboardType(const llvm::Twine& type) {
+  m_table->GetEntry(".type").SetString(type);
+}
+
+void SendableBuilderImpl::SetSafeState(std::function<void()> func) {
+  m_safeState = func;
+}
+
+void SendableBuilderImpl::SetUpdateTable(std::function<void()> func) {
+  m_updateTable = func;
+}
+
+nt::NetworkTableEntry SendableBuilderImpl::GetEntry(const llvm::Twine& key) {
+  return m_table->GetEntry(key);
+}
+
+void SendableBuilderImpl::AddBooleanProperty(const llvm::Twine& key,
+                                             std::function<bool()> getter,
+                                             std::function<void(bool)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeBoolean(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsBoolean()) return;
+            setter(event.value->GetBoolean());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddDoubleProperty(
+    const llvm::Twine& key, std::function<double()> getter,
+    std::function<void(double)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeDouble(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsDouble()) return;
+            setter(event.value->GetDouble());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddStringProperty(
+    const llvm::Twine& key, std::function<std::string()> getter,
+    std::function<void(llvm::StringRef)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeString(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsString()) return;
+            setter(event.value->GetString());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddBooleanArrayProperty(
+    const llvm::Twine& key, std::function<std::vector<int>()> getter,
+    std::function<void(llvm::ArrayRef<int>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeBooleanArray(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsBooleanArray()) return;
+            setter(event.value->GetBooleanArray());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddDoubleArrayProperty(
+    const llvm::Twine& key, std::function<std::vector<double>()> getter,
+    std::function<void(llvm::ArrayRef<double>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeDoubleArray(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsDoubleArray()) return;
+            setter(event.value->GetDoubleArray());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddStringArrayProperty(
+    const llvm::Twine& key, std::function<std::vector<std::string>()> getter,
+    std::function<void(llvm::ArrayRef<std::string>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeStringArray(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsStringArray()) return;
+            setter(event.value->GetStringArray());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddRawProperty(
+    const llvm::Twine& key, std::function<std::string()> getter,
+    std::function<void(llvm::StringRef)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(nt::Value::MakeRaw(getter(), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsRaw()) return;
+            setter(event.value->GetRaw());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddValueProperty(
+    const llvm::Twine& key, std::function<std::shared_ptr<nt::Value>()> getter,
+    std::function<void(std::shared_ptr<nt::Value>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      entry.SetValue(getter());
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) { setter(event.value); },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddSmallStringProperty(
+    const llvm::Twine& key,
+    std::function<llvm::StringRef(llvm::SmallVectorImpl<char>& buf)> getter,
+    std::function<void(llvm::StringRef)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      llvm::SmallString<128> buf;
+      entry.SetValue(nt::Value::MakeString(getter(buf), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsString()) return;
+            setter(event.value->GetString());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddSmallBooleanArrayProperty(
+    const llvm::Twine& key,
+    std::function<llvm::ArrayRef<int>(llvm::SmallVectorImpl<int>& buf)> getter,
+    std::function<void(llvm::ArrayRef<int>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      llvm::SmallVector<int, 16> buf;
+      entry.SetValue(nt::Value::MakeBooleanArray(getter(buf), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsBooleanArray()) return;
+            setter(event.value->GetBooleanArray());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddSmallDoubleArrayProperty(
+    const llvm::Twine& key,
+    std::function<llvm::ArrayRef<double>(llvm::SmallVectorImpl<double>& buf)>
+        getter,
+    std::function<void(llvm::ArrayRef<double>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      llvm::SmallVector<double, 16> buf;
+      entry.SetValue(nt::Value::MakeDoubleArray(getter(buf), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsDoubleArray()) return;
+            setter(event.value->GetDoubleArray());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddSmallStringArrayProperty(
+    const llvm::Twine& key,
+    std::function<
+        llvm::ArrayRef<std::string>(llvm::SmallVectorImpl<std::string>& buf)>
+        getter,
+    std::function<void(llvm::ArrayRef<std::string>)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      llvm::SmallVector<std::string, 16> buf;
+      entry.SetValue(nt::Value::MakeStringArray(getter(buf), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsStringArray()) return;
+            setter(event.value->GetStringArray());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
+
+void SendableBuilderImpl::AddSmallRawProperty(
+    const llvm::Twine& key,
+    std::function<llvm::StringRef(llvm::SmallVectorImpl<char>& buf)> getter,
+    std::function<void(llvm::StringRef)> setter) {
+  m_properties.emplace_back(*m_table, key);
+  if (getter) {
+    m_properties.back().update = [=](nt::NetworkTableEntry entry,
+                                     uint64_t time) {
+      llvm::SmallVector<char, 128> buf;
+      entry.SetValue(nt::Value::MakeRaw(getter(buf), time));
+    };
+  }
+  if (setter) {
+    m_properties.back().createListener =
+        [=](nt::NetworkTableEntry entry) -> NT_EntryListener {
+      return entry.AddListener(
+          [=](const nt::EntryNotification& event) {
+            if (!event.value->IsRaw()) return;
+            setter(event.value->GetRaw());
+          },
+          NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+    };
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableChooserBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableChooserBase.cpp
new file mode 100644
index 0000000..3edd099
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SendableChooserBase.cpp
@@ -0,0 +1,14 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SmartDashboard/SendableChooserBase.h"
+
+using namespace frc;
+
+const char* SendableChooserBase::kDefault = "default";
+const char* SendableChooserBase::kOptions = "options";
+const char* SendableChooserBase::kSelected = "selected";
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SmartDashboard.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SmartDashboard.cpp
new file mode 100644
index 0000000..1c5c5a6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SmartDashboard/SmartDashboard.cpp
@@ -0,0 +1,561 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SmartDashboard/SmartDashboard.h"
+
+#include <llvm/StringMap.h>
+#include <networktables/NetworkTable.h>
+#include <networktables/NetworkTableInstance.h>
+#include <support/mutex.h>
+
+#include "HLUsageReporting.h"
+#include "SmartDashboard/Sendable.h"
+#include "SmartDashboard/SendableBuilderImpl.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+namespace {
+class SmartDashboardData {
+ public:
+  SmartDashboardData() = default;
+  explicit SmartDashboardData(Sendable* sendable_) : sendable(sendable_) {}
+
+  Sendable* sendable = nullptr;
+  SendableBuilderImpl builder;
+};
+
+class Singleton {
+ public:
+  static Singleton& GetInstance();
+
+  std::shared_ptr<nt::NetworkTable> table;
+  llvm::StringMap<SmartDashboardData> tablesToData;
+  wpi::mutex tablesToDataMutex;
+
+ private:
+  Singleton() {
+    table = nt::NetworkTableInstance::GetDefault().GetTable("SmartDashboard");
+    HLUsageReporting::ReportSmartDashboard();
+  }
+  Singleton(const Singleton&) = delete;
+  Singleton& operator=(const Singleton&) = delete;
+};
+
+}  // namespace
+
+Singleton& Singleton::GetInstance() {
+  static Singleton instance;
+  return instance;
+}
+
+void SmartDashboard::init() { Singleton::GetInstance(); }
+
+/**
+ * Determines whether the given key is in this table.
+ *
+ * @param key the key to search for
+ * @return true if the table as a value assigned to the given key
+ */
+bool SmartDashboard::ContainsKey(llvm::StringRef key) {
+  return Singleton::GetInstance().table->ContainsKey(key);
+}
+
+/**
+ * @param types bitmask of types; 0 is treated as a "don't care".
+ * @return keys currently in the table
+ */
+std::vector<std::string> SmartDashboard::GetKeys(int types) {
+  return Singleton::GetInstance().table->GetKeys(types);
+}
+
+/**
+ * Makes a key's value persistent through program restarts.
+ *
+ * @param key the key to make persistent
+ */
+void SmartDashboard::SetPersistent(llvm::StringRef key) {
+  Singleton::GetInstance().table->GetEntry(key).SetPersistent();
+}
+
+/**
+ * Stop making a key's value persistent through program restarts.
+ * The key cannot be null.
+ *
+ * @param key the key name
+ */
+void SmartDashboard::ClearPersistent(llvm::StringRef key) {
+  Singleton::GetInstance().table->GetEntry(key).ClearPersistent();
+}
+
+/**
+ * Returns whether the value is persistent through program restarts.
+ * The key cannot be null.
+ *
+ * @param key the key name
+ */
+bool SmartDashboard::IsPersistent(llvm::StringRef key) {
+  return Singleton::GetInstance().table->GetEntry(key).IsPersistent();
+}
+
+/**
+ * Sets flags on the specified key in this table. The key can
+ * not be null.
+ *
+ * @param key the key name
+ * @param flags the flags to set (bitmask)
+ */
+void SmartDashboard::SetFlags(llvm::StringRef key, unsigned int flags) {
+  Singleton::GetInstance().table->GetEntry(key).SetFlags(flags);
+}
+
+/**
+ * Clears flags on the specified key in this table. The key can
+ * not be null.
+ *
+ * @param key the key name
+ * @param flags the flags to clear (bitmask)
+ */
+void SmartDashboard::ClearFlags(llvm::StringRef key, unsigned int flags) {
+  Singleton::GetInstance().table->GetEntry(key).ClearFlags(flags);
+}
+
+/**
+ * Returns the flags for the specified key.
+ *
+ * @param key the key name
+ * @return the flags, or 0 if the key is not defined
+ */
+unsigned int SmartDashboard::GetFlags(llvm::StringRef key) {
+  return Singleton::GetInstance().table->GetEntry(key).GetFlags();
+}
+
+/**
+ * Deletes the specified key in this table.
+ *
+ * @param key the key name
+ */
+void SmartDashboard::Delete(llvm::StringRef key) {
+  Singleton::GetInstance().table->Delete(key);
+}
+
+/**
+ * Maps the specified key to the specified value in this table.
+ *
+ * The value can be retrieved by calling the get method with a key that is equal
+ * to the original key.
+ *
+ * @param keyName the key
+ * @param value   the value
+ */
+void SmartDashboard::PutData(llvm::StringRef key, Sendable* data) {
+  if (data == nullptr) {
+    wpi_setGlobalWPIErrorWithContext(NullParameter, "value");
+    return;
+  }
+  auto& inst = Singleton::GetInstance();
+  std::lock_guard<wpi::mutex> lock(inst.tablesToDataMutex);
+  auto& sddata = inst.tablesToData[key];
+  if (!sddata.sendable || sddata.sendable != data) {
+    sddata = SmartDashboardData(data);
+    auto dataTable = inst.table->GetSubTable(key);
+    sddata.builder.SetTable(dataTable);
+    data->InitSendable(sddata.builder);
+    sddata.builder.UpdateTable();
+    sddata.builder.StartListeners();
+    dataTable->GetEntry(".name").SetString(key);
+  }
+}
+
+/**
+ * Maps the specified key (where the key is the name of the Sendable)
+ * to the specified value in this table.
+ *
+ * The value can be retrieved by calling the get method with a key that is equal
+ * to the original key.
+ *
+ * @param value the value
+ */
+void SmartDashboard::PutData(Sendable* value) {
+  if (value == nullptr) {
+    wpi_setGlobalWPIErrorWithContext(NullParameter, "value");
+    return;
+  }
+  PutData(value->GetName(), value);
+}
+
+/**
+ * Returns the value at the specified key.
+ *
+ * @param keyName the key
+ * @return the value
+ */
+Sendable* SmartDashboard::GetData(llvm::StringRef key) {
+  auto& inst = Singleton::GetInstance();
+  std::lock_guard<wpi::mutex> lock(inst.tablesToDataMutex);
+  auto data = inst.tablesToData.find(key);
+  if (data == inst.tablesToData.end()) {
+    wpi_setGlobalWPIErrorWithContext(SmartDashboardMissingKey, key);
+    return nullptr;
+  }
+  return data->getValue().sendable;
+}
+
+/**
+ * Maps the specified key to the specified complex value (such as an array) in
+ * this table.
+ *
+ * The value can be retrieved by calling the RetrieveValue method with a key
+ * that is equal to the original key.
+ *
+ * @param keyName the key
+ * @param value   the value
+ * @return        False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutValue(llvm::StringRef keyName,
+                              std::shared_ptr<nt::Value> value) {
+  return Singleton::GetInstance().table->GetEntry(keyName).SetValue(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ *
+ * @param key the key
+ * @param defaultValue The default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultValue(llvm::StringRef key,
+                                     std::shared_ptr<nt::Value> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultValue(
+      defaultValue);
+}
+
+/**
+ * Retrieves the complex value (such as an array) in this table into the complex
+ * data object.
+ *
+ * @param keyName the key
+ * @param value   the object to retrieve the value into
+ */
+std::shared_ptr<nt::Value> SmartDashboard::GetValue(llvm::StringRef keyName) {
+  return Singleton::GetInstance().table->GetEntry(keyName).GetValue();
+}
+
+/**
+ * Maps the specified key to the specified value in this table.
+ *
+ * The value can be retrieved by calling the get method with a key that is equal
+ * to the original key.
+ *
+ * @param keyName the key
+ * @param value   the value
+ * @return        False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutBoolean(llvm::StringRef keyName, bool value) {
+  return Singleton::GetInstance().table->GetEntry(keyName).SetBoolean(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ * @param key the key
+ * @param defaultValue the default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultBoolean(llvm::StringRef key, bool defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultBoolean(
+      defaultValue);
+}
+
+/**
+ * Returns the value at the specified key.
+ *
+ * If the key is not found, returns the default value.
+ *
+ * @param keyName the key
+ * @return the value
+ */
+bool SmartDashboard::GetBoolean(llvm::StringRef keyName, bool defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(keyName).GetBoolean(
+      defaultValue);
+}
+
+/**
+ * Maps the specified key to the specified value in this table.
+ *
+ * The value can be retrieved by calling the get method with a key that is equal
+ * to the original key.
+ *
+ * @param keyName the key
+ * @param value   the value
+ * @return        False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutNumber(llvm::StringRef keyName, double value) {
+  return Singleton::GetInstance().table->GetEntry(keyName).SetDouble(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ *
+ * @param key          The key.
+ * @param defaultValue The default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultNumber(llvm::StringRef key,
+                                      double defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultDouble(
+      defaultValue);
+}
+
+/**
+ * Returns the value at the specified key.
+ *
+ * If the key is not found, returns the default value.
+ *
+ * @param keyName the key
+ * @return the value
+ */
+double SmartDashboard::GetNumber(llvm::StringRef keyName, double defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(keyName).GetDouble(
+      defaultValue);
+}
+
+/**
+ * Maps the specified key to the specified value in this table.
+ *
+ * The value can be retrieved by calling the get method with a key that is equal
+ * to the original key.
+ *
+ * @param keyName the key
+ * @param value   the value
+ * @return        False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutString(llvm::StringRef keyName, llvm::StringRef value) {
+  return Singleton::GetInstance().table->GetEntry(keyName).SetString(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ * @param key the key
+ * @param defaultValue the default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultString(llvm::StringRef key,
+                                      llvm::StringRef defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultString(
+      defaultValue);
+}
+
+/**
+ * Returns the value at the specified key.
+ *
+ * If the key is not found, returns the default value.
+ *
+ * @param keyName the key
+ * @return the value
+ */
+std::string SmartDashboard::GetString(llvm::StringRef keyName,
+                                      llvm::StringRef defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(keyName).GetString(
+      defaultValue);
+}
+
+/**
+ * Put a boolean array in the table.
+ *
+ * @param key the key to be assigned to
+ * @param value the value that will be assigned
+ * @return False if the table key already exists with a different type
+ *
+ * @note The array must be of int's rather than of bool's because
+ *       std::vector<bool> is special-cased in C++. 0 is false, any
+ *       non-zero value is true.
+ */
+bool SmartDashboard::PutBooleanArray(llvm::StringRef key,
+                                     llvm::ArrayRef<int> value) {
+  return Singleton::GetInstance().table->GetEntry(key).SetBooleanArray(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ *
+ * @param key the key
+ * @param defaultValue the default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultBooleanArray(llvm::StringRef key,
+                                            llvm::ArrayRef<int> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultBooleanArray(
+      defaultValue);
+}
+
+/**
+ * Returns the boolean array the key maps to.
+ *
+ * If the key does not exist or is of different type, it will return the default
+ * value.
+ *
+ * @param key          The key to look up.
+ * @param defaultValue The value to be returned if no value is found.
+ * @return the value associated with the given key or the given default value
+ *         if there is no value associated with the key
+ *
+ * @note This makes a copy of the array. If the overhead of this is a concern,
+ *       use GetValue() instead.
+ *
+ * @note The returned array is std::vector<int> instead of std::vector<bool>
+ *       because std::vector<bool> is special-cased in C++. 0 is false, any
+ *       non-zero value is true.
+ */
+std::vector<int> SmartDashboard::GetBooleanArray(
+    llvm::StringRef key, llvm::ArrayRef<int> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).GetBooleanArray(
+      defaultValue);
+}
+
+/**
+ * Put a number array in the table.
+ *
+ * @param key   The key to be assigned to.
+ * @param value The value that will be assigned.
+ * @return False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutNumberArray(llvm::StringRef key,
+                                    llvm::ArrayRef<double> value) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDoubleArray(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ *
+ * @param key          The key.
+ * @param defaultValue The default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultNumberArray(
+    llvm::StringRef key, llvm::ArrayRef<double> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultDoubleArray(
+      defaultValue);
+}
+
+/**
+ * Returns the number array the key maps to.
+ *
+ * If the key does not exist or is of different type, it will return the default
+ * value.
+ *
+ * @param key The key to look up.
+ * @param defaultValue The value to be returned if no value is found.
+ * @return the value associated with the given key or the given default value
+ * if there is no value associated with the key
+ *
+ * @note This makes a copy of the array. If the overhead of this is a concern,
+ *       use GetValue() instead.
+ */
+std::vector<double> SmartDashboard::GetNumberArray(
+    llvm::StringRef key, llvm::ArrayRef<double> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).GetDoubleArray(
+      defaultValue);
+}
+
+/**
+ * Put a string array in the table.
+ *
+ * @param key   The key to be assigned to.
+ * @param value The value that will be assigned.
+ * @return False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutStringArray(llvm::StringRef key,
+                                    llvm::ArrayRef<std::string> value) {
+  return Singleton::GetInstance().table->GetEntry(key).SetStringArray(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ *
+ * @param key          The key.
+ * @param defaultValue The default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultStringArray(
+    llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultStringArray(
+      defaultValue);
+}
+
+/**
+ * Returns the string array the key maps to.
+ *
+ * If the key does not exist or is of different type, it will return the default
+ * value.
+ *
+ * @param key          The key to look up.
+ * @param defaultValue The value to be returned if no value is found.
+ * @return the value associated with the given key or the given default value
+ * if there is no value associated with the key
+ *
+ * @note This makes a copy of the array. If the overhead of this is a concern,
+ *       use GetValue() instead.
+ */
+std::vector<std::string> SmartDashboard::GetStringArray(
+    llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).GetStringArray(
+      defaultValue);
+}
+
+/**
+ * Put a raw value (byte array) in the table.
+ *
+ * @param key   The key to be assigned to.
+ * @param value The value that will be assigned.
+ * @return False if the table key already exists with a different type
+ */
+bool SmartDashboard::PutRaw(llvm::StringRef key, llvm::StringRef value) {
+  return Singleton::GetInstance().table->GetEntry(key).SetRaw(value);
+}
+
+/**
+ * Gets the current value in the table, setting it if it does not exist.
+ *
+ * @param key          The key.
+ * @param defaultValue The default value to set if key doesn't exist.
+ * @returns False if the table key exists with a different type
+ */
+bool SmartDashboard::SetDefaultRaw(llvm::StringRef key,
+                                   llvm::StringRef defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).SetDefaultRaw(
+      defaultValue);
+}
+
+/**
+ * Returns the raw value (byte array) the key maps to.
+ *
+ * If the key does not exist or is of different type, it will return the default
+ * value.
+ *
+ * @param key          The key to look up.
+ * @param defaultValue The value to be returned if no value is found.
+ * @return the value associated with the given key or the given default value
+ * if there is no value associated with the key
+ *
+ * @note This makes a copy of the raw contents. If the overhead of this is a
+ *       concern, use GetValue() instead.
+ */
+std::string SmartDashboard::GetRaw(llvm::StringRef key,
+                                   llvm::StringRef defaultValue) {
+  return Singleton::GetInstance().table->GetEntry(key).GetRaw(defaultValue);
+}
+
+/**
+ * Puts all sendable data to the dashboard.
+ */
+void SmartDashboard::UpdateValues() {
+  auto& inst = Singleton::GetInstance();
+  std::lock_guard<wpi::mutex> lock(inst.tablesToDataMutex);
+  for (auto& i : inst.tablesToData) {
+    i.getValue().builder.UpdateTable();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Solenoid.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Solenoid.cpp
new file mode 100644
index 0000000..1d27391
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Solenoid.cpp
@@ -0,0 +1,143 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Solenoid.h"
+
+#include <HAL/HAL.h>
+#include <HAL/Ports.h>
+#include <HAL/Solenoid.h>
+
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+/**
+ * Constructor using the default PCM ID (0).
+ *
+ * @param channel The channel on the PCM to control (0..7).
+ */
+Solenoid::Solenoid(int channel)
+    : Solenoid(SensorBase::GetDefaultSolenoidModule(), channel) {}
+
+/**
+ * Constructor.
+ *
+ * @param moduleNumber The CAN ID of the PCM the solenoid is attached to
+ * @param channel      The channel on the PCM to control (0..7).
+ */
+Solenoid::Solenoid(int moduleNumber, int channel)
+    : SolenoidBase(moduleNumber), m_channel(channel) {
+  if (!SensorBase::CheckSolenoidModule(m_moduleNumber)) {
+    wpi_setWPIErrorWithContext(
+        ModuleIndexOutOfRange,
+        "Solenoid Module " + llvm::Twine(m_moduleNumber));
+    return;
+  }
+  if (!SensorBase::CheckSolenoidChannel(m_channel)) {
+    wpi_setWPIErrorWithContext(ChannelIndexOutOfRange,
+                               "Solenoid Channel " + llvm::Twine(m_channel));
+    return;
+  }
+
+  int32_t status = 0;
+  m_solenoidHandle = HAL_InitializeSolenoidPort(
+      HAL_GetPortWithModule(moduleNumber, channel), &status);
+  if (status != 0) {
+    wpi_setErrorWithContextRange(status, 0, HAL_GetNumSolenoidChannels(),
+                                 channel, HAL_GetErrorMessage(status));
+    m_solenoidHandle = HAL_kInvalidHandle;
+    return;
+  }
+
+  HAL_Report(HALUsageReporting::kResourceType_Solenoid, m_channel,
+             m_moduleNumber);
+  SetName("Solenoid", m_moduleNumber, m_channel);
+}
+
+/**
+ * Destructor.
+ */
+Solenoid::~Solenoid() { HAL_FreeSolenoidPort(m_solenoidHandle); }
+
+/**
+ * Set the value of a solenoid.
+ *
+ * @param on Turn the solenoid output off or on.
+ */
+void Solenoid::Set(bool on) {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetSolenoid(m_solenoidHandle, on, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Read the current value of the solenoid.
+ *
+ * @return The current value of the solenoid.
+ */
+bool Solenoid::Get() const {
+  if (StatusIsFatal()) return false;
+  int32_t status = 0;
+  bool value = HAL_GetSolenoid(m_solenoidHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Check if solenoid is blacklisted.
+ *
+ * If a solenoid is shorted, it is added to the blacklist and
+ * disabled until power cycle, or until faults are cleared.
+ *
+ * @see ClearAllPCMStickyFaults()
+ *
+ * @return If solenoid is disabled due to short.
+ */
+bool Solenoid::IsBlackListed() const {
+  int value = GetPCMSolenoidBlackList(m_moduleNumber) & (1 << m_channel);
+  return (value != 0);
+}
+
+/**
+ * Set the pulse duration in the PCM. This is used in conjunction with
+ * the startPulse method to allow the PCM to control the timing of a pulse.
+ * The timing can be controlled in 0.01 second increments.
+ *
+ * @param durationSeconds The duration of the pulse, from 0.01 to 2.55 seconds.
+ *
+ * @see startPulse()
+ */
+void Solenoid::SetPulseDuration(double durationSeconds) {
+  int32_t durationMS = durationSeconds * 1000;
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_SetOneShotDuration(m_solenoidHandle, durationMS, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+/**
+ * Trigger the PCM to generate a pulse of the duration set in
+ * setPulseDuration.
+ *
+ * @see setPulseDuration()
+ */
+void Solenoid::StartPulse() {
+  if (StatusIsFatal()) return;
+  int32_t status = 0;
+  HAL_FireOneShot(m_solenoidHandle, &status);
+  wpi_setErrorWithContext(status, HAL_GetErrorMessage(status));
+}
+
+void Solenoid::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Solenoid");
+  builder.SetSafeState([=]() { Set(false); });
+  builder.AddBooleanProperty("Value", [=]() { return Get(); },
+                             [=](bool value) { Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SolenoidBase.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SolenoidBase.cpp
new file mode 100644
index 0000000..a3f20ae
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SolenoidBase.cpp
@@ -0,0 +1,138 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SolenoidBase.h"
+
+#include <HAL/HAL.h>
+#include <HAL/Solenoid.h>
+
+using namespace frc;
+
+/**
+ * Constructor
+ *
+ * @param moduleNumber The CAN PCM ID.
+ */
+SolenoidBase::SolenoidBase(int moduleNumber) : m_moduleNumber(moduleNumber) {}
+
+/**
+ * Read all 8 solenoids as a single byte
+ *
+ * @param module the module to read from
+ * @return The current value of all 8 solenoids on the module.
+ */
+int SolenoidBase::GetAll(int module) {
+  int value = 0;
+  int32_t status = 0;
+  value = HAL_GetAllSolenoids(module, &status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return value;
+}
+
+/**
+ * Read all 8 solenoids as a single byte
+ *
+ * @return The current value of all 8 solenoids on the module.
+ */
+int SolenoidBase::GetAll() const {
+  return SolenoidBase::GetAll(m_moduleNumber);
+}
+
+/**
+ * Reads complete solenoid blacklist for all 8 solenoids as a single byte.
+ *
+ * If a solenoid is shorted, it is added to the blacklist and
+ * disabled until power cycle, or until faults are cleared.
+ * @see ClearAllPCMStickyFaults()
+ *
+ * @param module the module to read from
+ * @return The solenoid blacklist of all 8 solenoids on the module.
+ */
+int SolenoidBase::GetPCMSolenoidBlackList(int module) {
+  int32_t status = 0;
+  return HAL_GetPCMSolenoidBlackList(module, &status);
+}
+
+/**
+ * Reads complete solenoid blacklist for all 8 solenoids as a single byte.
+ *
+ * If a solenoid is shorted, it is added to the blacklist and
+ * disabled until power cycle, or until faults are cleared.
+ * @see ClearAllPCMStickyFaults()
+ *
+ * @return The solenoid blacklist of all 8 solenoids on the module.
+ */
+int SolenoidBase::GetPCMSolenoidBlackList() const {
+  return SolenoidBase::GetPCMSolenoidBlackList(m_moduleNumber);
+}
+
+/**
+ * @param module the module to read from
+ * @return true if PCM sticky fault is set : The common highside solenoid
+ *         voltage rail is too low, most likely a solenoid channel is shorted.
+ */
+bool SolenoidBase::GetPCMSolenoidVoltageStickyFault(int module) {
+  int32_t status = 0;
+  return HAL_GetPCMSolenoidVoltageStickyFault(module, &status);
+}
+
+/**
+ * @return true if PCM sticky fault is set : The common highside solenoid
+ *         voltage rail is too low, most likely a solenoid channel is shorted.
+ */
+bool SolenoidBase::GetPCMSolenoidVoltageStickyFault() const {
+  return SolenoidBase::GetPCMSolenoidVoltageStickyFault(m_moduleNumber);
+}
+
+/**
+ * @param module the module to read from
+ * @return true if PCM is in fault state : The common highside solenoid voltage
+ *         rail is too low, most likely a solenoid channel is shorted.
+ */
+bool SolenoidBase::GetPCMSolenoidVoltageFault(int module) {
+  int32_t status = 0;
+  return HAL_GetPCMSolenoidVoltageFault(module, &status);
+}
+
+/**
+ * @return true if PCM is in fault state : The common highside solenoid voltage
+ *         rail is too low, most likely a solenoid channel is shorted.
+ */
+bool SolenoidBase::GetPCMSolenoidVoltageFault() const {
+  return SolenoidBase::GetPCMSolenoidVoltageFault(m_moduleNumber);
+}
+
+/**
+ * Clear ALL sticky faults inside PCM that Compressor is wired to.
+ *
+ * If a sticky fault is set, then it will be persistently cleared.  Compressor
+ * drive maybe momentarily disable while flags are being cleared. Care should
+ * be taken to not call this too frequently, otherwise normal compressor
+ * functionality may be prevented.
+ *
+ * If no sticky faults are set then this call will have no effect.
+ *
+ * @param module the module to read from
+ */
+void SolenoidBase::ClearAllPCMStickyFaults(int module) {
+  int32_t status = 0;
+  return HAL_ClearAllPCMStickyFaults(module, &status);
+}
+
+/**
+ * Clear ALL sticky faults inside PCM that Compressor is wired to.
+ *
+ * If a sticky fault is set, then it will be persistently cleared.  Compressor
+ * drive maybe momentarily disable while flags are being cleared. Care should
+ * be taken to not call this too frequently, otherwise normal compressor
+ * functionality may be prevented.
+ *
+ * If no sticky faults are set then this call will have no effect.
+ */
+void SolenoidBase::ClearAllPCMStickyFaults() {
+  SolenoidBase::ClearAllPCMStickyFaults(m_moduleNumber);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Spark.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Spark.cpp
new file mode 100644
index 0000000..69566a6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Spark.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Spark.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Note that the Spark uses the following bounds for PWM values. These values
+ * should work reasonably well for most controllers, but if users experience
+ * issues such as asymmetric behavior around the deadband or inability to
+ * saturate the controller in either direction, calibration is recommended.
+ * The calibration procedure can be found in the Spark User Manual available
+ * from REV Robotics.
+ *
+ *   2.003ms = full "forward"
+ *   1.55ms = the "high end" of the deadband range
+ *   1.50ms = center of the deadband range (off)
+ *   1.46ms = the "low end" of the deadband range
+ *   0.999ms = full "reverse"
+ */
+
+/**
+ * Constructor for a Spark.
+ *
+ * @param channel The PWM channel that the Spark is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+Spark::Spark(int channel) : PWMSpeedController(channel) {
+  SetBounds(2.003, 1.55, 1.50, 1.46, .999);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_RevSPARK, GetChannel());
+  SetName("Spark", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp
new file mode 100644
index 0000000..4b9f010
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/SpeedControllerGroup.cpp
@@ -0,0 +1,52 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SpeedControllerGroup.h"
+
+#include "SmartDashboard/SendableBuilder.h"
+
+using namespace frc;
+
+void SpeedControllerGroup::Set(double speed) {
+  for (auto speedController : m_speedControllers) {
+    speedController.get().Set(m_isInverted ? -speed : speed);
+  }
+}
+
+double SpeedControllerGroup::Get() const {
+  if (!m_speedControllers.empty()) {
+    return m_speedControllers.front().get().Get() * (m_isInverted ? -1 : 1);
+  }
+  return 0.0;
+}
+
+void SpeedControllerGroup::SetInverted(bool isInverted) {
+  m_isInverted = isInverted;
+}
+
+bool SpeedControllerGroup::GetInverted() const { return m_isInverted; }
+
+void SpeedControllerGroup::Disable() {
+  for (auto speedController : m_speedControllers) {
+    speedController.get().Disable();
+  }
+}
+
+void SpeedControllerGroup::StopMotor() {
+  for (auto speedController : m_speedControllers) {
+    speedController.get().StopMotor();
+  }
+}
+
+void SpeedControllerGroup::PIDWrite(double output) { Set(output); }
+
+void SpeedControllerGroup::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Speed Controller");
+  builder.SetSafeState([=]() { StopMotor(); });
+  builder.AddDoubleProperty("Value", [=]() { return Get(); },
+                            [=](double value) { Set(value); });
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Talon.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Talon.cpp
new file mode 100644
index 0000000..d6a1893
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Talon.cpp
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Talon.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Constructor for a Talon (original or Talon SR).
+ *
+ * @param channel The PWM channel number that the Talon is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+Talon::Talon(int channel) : PWMSpeedController(channel) {
+  /* Note that the Talon uses the following bounds for PWM values. These values
+   * should work reasonably well for most controllers, but if users experience
+   * issues such as asymmetric behavior around the deadband or inability to
+   * saturate the controller in either direction, calibration is recommended.
+   * The calibration procedure can be found in the Talon User Manual available
+   * from CTRE.
+   *
+   *   2.037ms = full "forward"
+   *   1.539ms = the "high end" of the deadband range
+   *   1.513ms = center of the deadband range (off)
+   *   1.487ms = the "low end" of the deadband range
+   *   0.989ms = full "reverse"
+   */
+  SetBounds(2.037, 1.539, 1.513, 1.487, .989);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_Talon, GetChannel());
+  SetName("Talon", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Threads.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Threads.cpp
new file mode 100644
index 0000000..fb6e4c8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Threads.cpp
@@ -0,0 +1,85 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Threads.h"
+
+#include <HAL/HAL.h>
+#include <HAL/Threads.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+/**
+ * Get the thread priority for the specified thread.
+ *
+ * @param thread     Reference to the thread to get the priority for.
+ * @param isRealTime Set to true if thread is realtime, otherwise false.
+ * @return The current thread priority. Scaled 1-99, with 1 being highest.
+ */
+int GetThreadPriority(std::thread& thread, bool* isRealTime) {
+  int32_t status = 0;
+  HAL_Bool rt = false;
+  auto native = thread.native_handle();
+  auto ret = HAL_GetThreadPriority(&native, &rt, &status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  *isRealTime = rt;
+  return ret;
+}
+
+/**
+ * Get the thread priority for the current thread
+ *
+ * @param isRealTime Set to true if thread is realtime, otherwise false.
+ * @return The current thread priority. Scaled 1-99.
+ */
+int GetCurrentThreadPriority(bool* isRealTime) {
+  int32_t status = 0;
+  HAL_Bool rt = false;
+  auto ret = HAL_GetCurrentThreadPriority(&rt, &status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  *isRealTime = rt;
+  return ret;
+}
+
+/**
+ * Sets the thread priority for the specified thread
+ *
+ * @param thread   Reference to the thread to set the priority of.
+ * @param realTime Set to true to set a realtime priority, false for standard
+ *                 priority.
+ * @param priority Priority to set the thread to. Scaled 1-99, with 1 being
+ *                 highest. On RoboRIO, priority is ignored for non realtime
+ *                 setting.
+ *
+ * @return The success state of setting the priority
+ */
+bool SetThreadPriority(std::thread& thread, bool realTime, int priority) {
+  int32_t status = 0;
+  auto native = thread.native_handle();
+  auto ret = HAL_SetThreadPriority(&native, realTime, priority, &status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return ret;
+}
+
+/**
+ * Sets the thread priority for the current thread
+ *
+ * @param realTime Set to true to set a realtime priority, false for standard
+ *                 priority.
+ * @param priority Priority to set the thread to. Scaled 1-99, with 1 being
+ *                 highest. On RoboRIO, priority is ignored for non realtime
+ *                 setting.
+ *
+ * @return The success state of setting the priority
+ */
+bool SetCurrentThreadPriority(bool realTime, int priority) {
+  int32_t status = 0;
+  auto ret = HAL_SetCurrentThreadPriority(realTime, priority, &status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return ret;
+}
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/TimedRobot.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/TimedRobot.cpp
new file mode 100644
index 0000000..9ef480e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/TimedRobot.cpp
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "TimedRobot.h"
+
+#include <chrono>
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Provide an alternate "main loop" via StartCompetition().
+ */
+void TimedRobot::StartCompetition() {
+  RobotInit();
+
+  // Tell the DS that the robot is ready to be enabled
+  HAL_ObserveUserProgramStarting();
+
+  // Loop forever, calling the appropriate mode-dependent function
+  m_startLoop = true;
+  m_loop->StartPeriodic(m_period);
+  while (true) {
+    std::this_thread::sleep_for(std::chrono::hours(24));
+  }
+}
+
+/**
+ * Set time period between calls to Periodic() functions.
+ *
+ * A timer event is queued for periodic event notification. Each time the
+ * interrupt occurs, the event will be immediately requeued for the same time
+ * interval.
+ *
+ * @param period Period in seconds.
+ */
+void TimedRobot::SetPeriod(double period) {
+  m_period = period;
+
+  if (m_startLoop) {
+    m_loop->StartPeriodic(m_period);
+  }
+}
+
+TimedRobot::TimedRobot() {
+  m_loop = std::make_unique<Notifier>(&TimedRobot::LoopFunc, this);
+
+  // HAL_Report(HALUsageReporting::kResourceType_Framework,
+  //            HALUsageReporting::kFramework_Periodic);
+  HAL_Report(HALUsageReporting::kResourceType_Framework,
+             HALUsageReporting::kFramework_Iterative);
+}
+
+TimedRobot::~TimedRobot() { m_loop->Stop(); }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Timer.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Timer.cpp
new file mode 100644
index 0000000..2b03e28
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Timer.cpp
@@ -0,0 +1,191 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Timer.h"
+
+#include <chrono>
+#include <thread>
+
+#include <HAL/HAL.h>
+
+#include "DriverStation.h"
+#include "RobotController.h"
+
+namespace frc {
+
+/**
+ * Pause the task for a specified time.
+ *
+ * Pause the execution of the program for a specified period of time given in
+ * seconds. Motors will continue to run at their last assigned values, and
+ * sensors will continue to update. Only the task containing the wait will pause
+ * until the wait time is expired.
+ *
+ * @param seconds Length of time to pause, in seconds.
+ */
+void Wait(double seconds) {
+  std::this_thread::sleep_for(std::chrono::duration<double>(seconds));
+}
+
+/**
+ * Return the FPGA system clock time in seconds.
+ *
+ * This is deprecated and just forwards to Timer::GetFPGATimestamp().
+ *
+ * @return Robot running time in seconds.
+ */
+double GetClock() { return Timer::GetFPGATimestamp(); }
+
+/**
+ * @brief  Gives real-time clock system time with nanosecond resolution
+ * @return The time, just in case you want the robot to start autonomous at 8pm
+ *         on Saturday.
+ */
+double GetTime() {
+  using std::chrono::duration;
+  using std::chrono::duration_cast;
+  using std::chrono::system_clock;
+
+  return duration_cast<duration<double>>(system_clock::now().time_since_epoch())
+      .count();
+}
+
+}  // namespace frc
+
+using namespace frc;
+
+// for compatibility with msvc12--see C2864
+const double Timer::kRolloverTime = (1ll << 32) / 1e6;
+/**
+ * Create a new timer object.
+ *
+ * Create a new timer object and reset the time to zero. The timer is initially
+ * not running and must be started.
+ */
+Timer::Timer() { Reset(); }
+
+/**
+ * Get the current time from the timer. If the clock is running it is derived
+ * from the current system clock the start time stored in the timer class. If
+ * the clock is not running, then return the time when it was last stopped.
+ *
+ * @return Current time value for this timer in seconds
+ */
+double Timer::Get() const {
+  double result;
+  double currentTime = GetFPGATimestamp();
+
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (m_running) {
+    // If the current time is before the start time, then the FPGA clock rolled
+    // over. Compensate by adding the ~71 minutes that it takes to roll over to
+    // the current time.
+    if (currentTime < m_startTime) {
+      currentTime += kRolloverTime;
+    }
+
+    result = (currentTime - m_startTime) + m_accumulatedTime;
+  } else {
+    result = m_accumulatedTime;
+  }
+
+  return result;
+}
+
+/**
+ * Reset the timer by setting the time to 0.
+ *
+ * Make the timer startTime the current time so new requests will be relative to
+ * now.
+ */
+void Timer::Reset() {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_accumulatedTime = 0;
+  m_startTime = GetFPGATimestamp();
+}
+
+/**
+ * Start the timer running.
+ *
+ * Just set the running flag to true indicating that all time requests should be
+ * relative to the system clock.
+ */
+void Timer::Start() {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (!m_running) {
+    m_startTime = GetFPGATimestamp();
+    m_running = true;
+  }
+}
+
+/**
+ * Stop the timer.
+ *
+ * This computes the time as of now and clears the running flag, causing all
+ * subsequent time requests to be read from the accumulated time rather than
+ * looking at the system clock.
+ */
+void Timer::Stop() {
+  double temp = Get();
+
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (m_running) {
+    m_accumulatedTime = temp;
+    m_running = false;
+  }
+}
+
+/**
+ * Check if the period specified has passed and if it has, advance the start
+ * time by that period. This is useful to decide if it's time to do periodic
+ * work without drifting later by the time it took to get around to checking.
+ *
+ * @param period The period to check for (in seconds).
+ * @return       True if the period has passed.
+ */
+bool Timer::HasPeriodPassed(double period) {
+  if (Get() > period) {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    // Advance the start time by the period.
+    m_startTime += period;
+    // Don't set it to the current time... we want to avoid drift.
+    return true;
+  }
+  return false;
+}
+
+/**
+ * Return the FPGA system clock time in seconds.
+ *
+ * Return the time from the FPGA hardware clock in seconds since the FPGA
+ * started. Rolls over after 71 minutes.
+ *
+ * @returns Robot running time in seconds.
+ */
+double Timer::GetFPGATimestamp() {
+  // FPGA returns the timestamp in microseconds
+  return RobotController::GetFPGATime() * 1.0e-6;
+}
+
+/**
+ * Return the approximate match time.
+ *
+ * The FMS does not send an official match time to the robots, but does send an
+ * approximate match time.  The value will count down the time remaining in the
+ * current period (auto or teleop).
+ *
+ * Warning: This is not an official time (so it cannot be used to dispute ref
+ * calls or guarantee that a function will trigger before the match ends).
+ *
+ * The Practice Match function of the DS approximates the behaviour seen on the
+ * field.
+ *
+ * @return Time remaining in current match period (auto or teleop)
+ */
+double Timer::GetMatchTime() {
+  return DriverStation::GetInstance().GetMatchTime();
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Ultrasonic.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Ultrasonic.cpp
new file mode 100644
index 0000000..bebf816
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Ultrasonic.cpp
@@ -0,0 +1,322 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Ultrasonic.h"
+
+#include <HAL/HAL.h>
+
+#include "Counter.h"
+#include "DigitalInput.h"
+#include "DigitalOutput.h"
+#include "SmartDashboard/SendableBuilder.h"
+#include "Timer.h"
+#include "Utility.h"
+#include "WPIErrors.h"
+
+using namespace frc;
+
+// Automatic round robin mode
+std::atomic<bool> Ultrasonic::m_automaticEnabled{false};
+
+std::vector<Ultrasonic*> Ultrasonic::m_sensors;
+std::thread Ultrasonic::m_thread;
+
+/**
+ * Background task that goes through the list of ultrasonic sensors and pings
+ * each one in turn. The counter is configured to read the timing of the
+ * returned echo pulse.
+ *
+ * DANGER WILL ROBINSON, DANGER WILL ROBINSON:
+ * This code runs as a task and assumes that none of the ultrasonic sensors
+ * will change while it's running. Make sure to disable automatic mode before
+ * touching the list.
+ */
+void Ultrasonic::UltrasonicChecker() {
+  while (m_automaticEnabled) {
+    for (auto& sensor : m_sensors) {
+      if (!m_automaticEnabled) break;
+
+      if (sensor->IsEnabled()) {
+        sensor->m_pingChannel->Pulse(kPingTime);  // do the ping
+      }
+
+      Wait(0.1);  // wait for ping to return
+    }
+  }
+}
+
+/**
+ * Initialize the Ultrasonic Sensor.
+ *
+ * This is the common code that initializes the ultrasonic sensor given that
+ * there are two digital I/O channels allocated. If the system was running in
+ * automatic mode (round robin) when the new sensor is added, it is stopped, the
+ * sensor is added, then automatic mode is restored.
+ */
+void Ultrasonic::Initialize() {
+  bool originalMode = m_automaticEnabled;
+  SetAutomaticMode(false);  // Kill task when adding a new sensor
+  // Link this instance on the list
+  m_sensors.emplace_back(this);
+
+  m_counter.SetMaxPeriod(1.0);
+  m_counter.SetSemiPeriodMode(true);
+  m_counter.Reset();
+  m_enabled = true;  // Make it available for round robin scheduling
+  SetAutomaticMode(originalMode);
+
+  static int instances = 0;
+  instances++;
+  HAL_Report(HALUsageReporting::kResourceType_Ultrasonic, instances);
+  SetName("Ultrasonic", m_echoChannel->GetChannel());
+}
+
+/**
+ * Create an instance of the Ultrasonic Sensor.
+ *
+ * This is designed to support the Daventech SRF04 and Vex ultrasonic sensors.
+ *
+ * @param pingChannel The digital output channel that sends the pulse to
+ *                    initiate the sensor sending the ping.
+ * @param echoChannel The digital input channel that receives the echo. The
+ *                    length of time that the echo is high represents the
+ *                    round trip time of the ping, and the distance.
+ * @param units       The units returned in either kInches or kMilliMeters
+ */
+Ultrasonic::Ultrasonic(int pingChannel, int echoChannel, DistanceUnit units)
+    : m_pingChannel(std::make_shared<DigitalOutput>(pingChannel)),
+      m_echoChannel(std::make_shared<DigitalInput>(echoChannel)),
+      m_counter(m_echoChannel) {
+  m_units = units;
+  Initialize();
+  AddChild(m_pingChannel);
+  AddChild(m_echoChannel);
+}
+
+/**
+ * Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo
+ * channel and a DigitalOutput for the ping channel.
+ *
+ * @param pingChannel The digital output object that starts the sensor doing a
+ *                    ping. Requires a 10uS pulse to start.
+ * @param echoChannel The digital input object that times the return pulse to
+ *                    determine the range.
+ * @param units       The units returned in either kInches or kMilliMeters
+ */
+Ultrasonic::Ultrasonic(DigitalOutput* pingChannel, DigitalInput* echoChannel,
+                       DistanceUnit units)
+    : m_pingChannel(pingChannel, NullDeleter<DigitalOutput>()),
+      m_echoChannel(echoChannel, NullDeleter<DigitalInput>()),
+      m_counter(m_echoChannel) {
+  if (pingChannel == nullptr || echoChannel == nullptr) {
+    wpi_setWPIError(NullParameter);
+    m_units = units;
+    return;
+  }
+  m_units = units;
+  Initialize();
+}
+
+/**
+ * Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo
+ * channel and a DigitalOutput for the ping channel.
+ *
+ * @param pingChannel The digital output object that starts the sensor doing a
+ *                    ping. Requires a 10uS pulse to start.
+ * @param echoChannel The digital input object that times the return pulse to
+ *                    determine the range.
+ * @param units       The units returned in either kInches or kMilliMeters
+ */
+Ultrasonic::Ultrasonic(DigitalOutput& pingChannel, DigitalInput& echoChannel,
+                       DistanceUnit units)
+    : m_pingChannel(&pingChannel, NullDeleter<DigitalOutput>()),
+      m_echoChannel(&echoChannel, NullDeleter<DigitalInput>()),
+      m_counter(m_echoChannel) {
+  m_units = units;
+  Initialize();
+}
+
+/**
+ * Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo
+ * channel and a DigitalOutput for the ping channel.
+ *
+ * @param pingChannel The digital output object that starts the sensor doing a
+ *                    ping. Requires a 10uS pulse to start.
+ * @param echoChannel The digital input object that times the return pulse to
+ *                    determine the range.
+ * @param units       The units returned in either kInches or kMilliMeters
+ */
+Ultrasonic::Ultrasonic(std::shared_ptr<DigitalOutput> pingChannel,
+                       std::shared_ptr<DigitalInput> echoChannel,
+                       DistanceUnit units)
+    : m_pingChannel(pingChannel),
+      m_echoChannel(echoChannel),
+      m_counter(m_echoChannel) {
+  m_units = units;
+  Initialize();
+}
+
+/**
+ * Destructor for the ultrasonic sensor.
+ *
+ * Delete the instance of the ultrasonic sensor by freeing the allocated digital
+ * channels. If the system was in automatic mode (round robin), then it is
+ * stopped, then started again after this sensor is removed (provided this
+ * wasn't the last sensor).
+ */
+Ultrasonic::~Ultrasonic() {
+  bool wasAutomaticMode = m_automaticEnabled;
+  SetAutomaticMode(false);
+
+  // No synchronization needed because the background task is stopped.
+  m_sensors.erase(std::remove(m_sensors.begin(), m_sensors.end(), this),
+                  m_sensors.end());
+
+  if (!m_sensors.empty() && wasAutomaticMode) {
+    SetAutomaticMode(true);
+  }
+}
+
+/**
+ * Turn Automatic mode on/off.
+ *
+ * When in Automatic mode, all sensors will fire in round robin, waiting a set
+ * time between each sensor.
+ *
+ * @param enabling Set to true if round robin scheduling should start for all
+ *                 the ultrasonic sensors. This scheduling method assures that
+ *                 the sensors are non-interfering because no two sensors fire
+ *                 at the same time. If another scheduling algorithm is
+ *                 prefered, it can be implemented by pinging the sensors
+ *                 manually and waiting for the results to come back.
+ */
+void Ultrasonic::SetAutomaticMode(bool enabling) {
+  if (enabling == m_automaticEnabled) return;  // ignore the case of no change
+
+  m_automaticEnabled = enabling;
+
+  if (enabling) {
+    /* Clear all the counters so no data is valid. No synchronization is needed
+     * because the background task is stopped.
+     */
+    for (auto& sensor : m_sensors) {
+      sensor->m_counter.Reset();
+    }
+
+    m_thread = std::thread(&Ultrasonic::UltrasonicChecker);
+
+    // TODO: Currently, lvuser does not have permissions to set task priorities.
+    // Until that is the case, uncommenting this will break user code that calls
+    // Ultrasonic::SetAutomicMode().
+    // m_task.SetPriority(kPriority);
+  } else {
+    // Wait for background task to stop running
+    m_thread.join();
+
+    // Clear all the counters (data now invalid) since automatic mode is
+    // disabled. No synchronization is needed because the background task is
+    // stopped.
+    for (auto& sensor : m_sensors) {
+      sensor->m_counter.Reset();
+    }
+  }
+}
+
+/**
+ * Single ping to ultrasonic sensor.
+ *
+ * Send out a single ping to the ultrasonic sensor. This only works if automatic
+ * (round robin) mode is disabled. A single ping is sent out, and the counter
+ * should count the semi-period when it comes in. The counter is reset to make
+ * the current value invalid.
+ */
+void Ultrasonic::Ping() {
+  wpi_assert(!m_automaticEnabled);
+
+  // Reset the counter to zero (invalid data now)
+  m_counter.Reset();
+
+  // Do the ping to start getting a single range
+  m_pingChannel->Pulse(kPingTime);
+}
+
+/**
+ * Check if there is a valid range measurement.
+ *
+ * The ranges are accumulated in a counter that will increment on each edge of
+ * the echo (return) signal. If the count is not at least 2, then the range has
+ * not yet been measured, and is invalid.
+ */
+bool Ultrasonic::IsRangeValid() const { return m_counter.Get() > 1; }
+
+/**
+ * Get the range in inches from the ultrasonic sensor.
+ *
+ * @return Range in inches of the target returned from the ultrasonic sensor. If
+ *         there is no valid value yet, i.e. at least one measurement hasn't
+ *         completed, then return 0.
+ */
+double Ultrasonic::GetRangeInches() const {
+  if (IsRangeValid())
+    return m_counter.GetPeriod() * kSpeedOfSoundInchesPerSec / 2.0;
+  else
+    return 0;
+}
+
+/**
+ * Get the range in millimeters from the ultrasonic sensor.
+ *
+ * @return Range in millimeters of the target returned by the ultrasonic sensor.
+ *         If there is no valid value yet, i.e. at least one measurement hasn't
+ *         completed, then return 0.
+ */
+double Ultrasonic::GetRangeMM() const { return GetRangeInches() * 25.4; }
+
+/**
+ * Get the range in the current DistanceUnit for the PIDSource base object.
+ *
+ * @return The range in DistanceUnit
+ */
+double Ultrasonic::PIDGet() {
+  switch (m_units) {
+    case Ultrasonic::kInches:
+      return GetRangeInches();
+    case Ultrasonic::kMilliMeters:
+      return GetRangeMM();
+    default:
+      return 0.0;
+  }
+}
+
+void Ultrasonic::SetPIDSourceType(PIDSourceType pidSource) {
+  if (wpi_assert(pidSource == PIDSourceType::kDisplacement)) {
+    m_pidSource = pidSource;
+  }
+}
+
+/**
+ * Set the current DistanceUnit that should be used for the PIDSource base
+ * object.
+ *
+ * @param units The DistanceUnit that should be used.
+ */
+void Ultrasonic::SetDistanceUnits(DistanceUnit units) { m_units = units; }
+
+/**
+ * Get the current DistanceUnit that is used for the PIDSource base object.
+ *
+ * @return The type of DistanceUnit that is being used.
+ */
+Ultrasonic::DistanceUnit Ultrasonic::GetDistanceUnits() const {
+  return m_units;
+}
+
+void Ultrasonic::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("Ultrasonic");
+  builder.AddDoubleProperty("Value", [=]() { return GetRangeInches(); },
+                            nullptr);
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Utility.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Utility.cpp
new file mode 100644
index 0000000..7d5e615
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Utility.cpp
@@ -0,0 +1,260 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Utility.h"
+
+#ifndef _WIN32
+#include <cxxabi.h>
+#include <execinfo.h>
+#endif
+
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include <llvm/Path.h>
+
+#include "ErrorBase.h"
+#include "HAL/DriverStation.h"
+#include "HAL/HAL.h"
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+
+using namespace frc;
+
+/**
+ * Assert implementation.
+ *
+ * This allows breakpoints to be set on an assert. The users don't call this,
+ * but instead use the wpi_assert macros in Utility.h.
+ */
+bool wpi_assert_impl(bool conditionValue, const llvm::Twine& conditionText,
+                     const llvm::Twine& message, llvm::StringRef fileName,
+                     int lineNumber, llvm::StringRef funcName) {
+  if (!conditionValue) {
+    llvm::SmallString<128> locBuf;
+    llvm::raw_svector_ostream locStream(locBuf);
+    locStream << funcName << " [" << llvm::sys::path::filename(fileName) << ":"
+              << lineNumber << "]";
+
+    llvm::SmallString<128> errorBuf;
+    llvm::raw_svector_ostream errorStream(errorBuf);
+
+    errorStream << "Assertion \"" << conditionText << "\" ";
+
+    if (message.isTriviallyEmpty() ||
+        (message.isSingleStringRef() && message.getSingleStringRef().empty())) {
+      errorStream << "failed.\n";
+    } else {
+      errorStream << "failed: " << message << "\n";
+    }
+
+    std::string stack = GetStackTrace(2);
+
+    // Print the error and send it to the DriverStation
+    HAL_SendError(1, 1, 0, errorBuf.c_str(), locBuf.c_str(), stack.c_str(), 1);
+  }
+
+  return conditionValue;
+}
+
+/**
+ * Common error routines for wpi_assertEqual_impl and wpi_assertNotEqual_impl.
+ *
+ * This should not be called directly; it should only be used by
+ * wpi_assertEqual_impl and wpi_assertNotEqual_impl.
+ */
+void wpi_assertEqual_common_impl(const llvm::Twine& valueA,
+                                 const llvm::Twine& valueB,
+                                 const llvm::Twine& equalityType,
+                                 const llvm::Twine& message,
+                                 llvm::StringRef fileName, int lineNumber,
+                                 llvm::StringRef funcName) {
+  llvm::SmallString<128> locBuf;
+  llvm::raw_svector_ostream locStream(locBuf);
+  locStream << funcName << " [" << llvm::sys::path::filename(fileName) << ":"
+            << lineNumber << "]";
+
+  llvm::SmallString<128> errorBuf;
+  llvm::raw_svector_ostream errorStream(errorBuf);
+
+  errorStream << "Assertion \"" << valueA << " " << equalityType << " "
+              << valueB << "\" ";
+
+  if (message.isTriviallyEmpty() ||
+      (message.isSingleStringRef() && message.getSingleStringRef().empty())) {
+    errorStream << "failed.\n";
+  } else {
+    errorStream << "failed: " << message << "\n";
+  }
+
+  std::string trace = GetStackTrace(3);
+
+  // Print the error and send it to the DriverStation
+  HAL_SendError(1, 1, 0, errorBuf.c_str(), locBuf.c_str(), trace.c_str(), 1);
+}
+
+/**
+ * Assert equal implementation.
+ *
+ * This determines whether the two given integers are equal. If not, the value
+ * of each is printed along with an optional message string. The users don't
+ * call this, but instead use the wpi_assertEqual macros in Utility.h.
+ */
+bool wpi_assertEqual_impl(int valueA, int valueB,
+                          const llvm::Twine& valueAString,
+                          const llvm::Twine& valueBString,
+                          const llvm::Twine& message, llvm::StringRef fileName,
+                          int lineNumber, llvm::StringRef funcName) {
+  if (!(valueA == valueB)) {
+    wpi_assertEqual_common_impl(valueAString, valueBString, "==", message,
+                                fileName, lineNumber, funcName);
+  }
+  return valueA == valueB;
+}
+
+/**
+ * Assert not equal implementation.
+ *
+ * This determines whether the two given integers are equal. If so, the value of
+ * each is printed along with an optional message string. The users don't call
+ * this, but instead use the wpi_assertNotEqual macros in Utility.h.
+ */
+bool wpi_assertNotEqual_impl(int valueA, int valueB,
+                             const llvm::Twine& valueAString,
+                             const llvm::Twine& valueBString,
+                             const llvm::Twine& message,
+                             llvm::StringRef fileName, int lineNumber,
+                             llvm::StringRef funcName) {
+  if (!(valueA != valueB)) {
+    wpi_assertEqual_common_impl(valueAString, valueBString, "!=", message,
+                                fileName, lineNumber, funcName);
+  }
+  return valueA != valueB;
+}
+
+namespace frc {
+
+/**
+ * Return the FPGA Version number.
+ *
+ * For now, expect this to be competition year.
+ *
+ * @return FPGA Version number.
+ * @deprecated Use RobotController static class method
+ */
+int GetFPGAVersion() {
+  int32_t status = 0;
+  int version = HAL_GetFPGAVersion(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return version;
+}
+
+/**
+ * Return the FPGA Revision number.
+ *
+ * The format of the revision is 3 numbers. The 12 most significant bits are the
+ * Major Revision. The next 8 bits are the Minor Revision. The 12 least
+ * significant bits are the Build Number.
+ *
+ * @return FPGA Revision number.
+ * @deprecated Use RobotController static class method
+ */
+int64_t GetFPGARevision() {
+  int32_t status = 0;
+  int64_t revision = HAL_GetFPGARevision(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return revision;
+}
+
+/**
+ * Read the microsecond-resolution timer on the FPGA.
+ *
+ * @return The current time in microseconds according to the FPGA (since FPGA
+ *         reset).
+ * @deprecated Use RobotController static class method
+ */
+uint64_t GetFPGATime() {
+  int32_t status = 0;
+  uint64_t time = HAL_GetFPGATime(&status);
+  wpi_setGlobalErrorWithContext(status, HAL_GetErrorMessage(status));
+  return time;
+}
+
+/**
+ * Get the state of the "USER" button on the roboRIO.
+ *
+ * @return True if the button is currently pressed down
+ * @deprecated Use RobotController static class method
+ */
+bool GetUserButton() {
+  int32_t status = 0;
+
+  bool value = HAL_GetFPGAButton(&status);
+  wpi_setGlobalError(status);
+
+  return value;
+}
+
+#ifndef _WIN32
+
+/**
+ * Demangle a C++ symbol, used for printing stack traces.
+ */
+static std::string demangle(char const* mangledSymbol) {
+  char buffer[256];
+  size_t length;
+  int32_t status;
+
+  if (std::sscanf(mangledSymbol, "%*[^(]%*[(]%255[^)+]", buffer)) {
+    char* symbol = abi::__cxa_demangle(buffer, nullptr, &length, &status);
+    if (status == 0) {
+      return symbol;
+    } else {
+      // If the symbol couldn't be demangled, it's probably a C function,
+      // so just return it as-is.
+      return buffer;
+    }
+  }
+
+  // If everything else failed, just return the mangled symbol
+  return mangledSymbol;
+}
+
+/**
+ * Get a stack trace, ignoring the first "offset" symbols.
+ *
+ * @param offset The number of symbols at the top of the stack to ignore
+ */
+std::string GetStackTrace(int offset) {
+  void* stackTrace[128];
+  int stackSize = backtrace(stackTrace, 128);
+  char** mangledSymbols = backtrace_symbols(stackTrace, stackSize);
+  llvm::SmallString<1024> buf;
+  llvm::raw_svector_ostream trace(buf);
+
+  for (int i = offset; i < stackSize; i++) {
+    // Only print recursive functions once in a row.
+    if (i == 0 || stackTrace[i] != stackTrace[i - 1]) {
+      trace << "\tat " << demangle(mangledSymbols[i]) << "\n";
+    }
+  }
+
+  std::free(mangledSymbols);
+
+  return trace.str();
+}
+
+#else
+static std::string demangle(char const* mangledSymbol) {
+  return "no demangling on windows";
+}
+
+std::string GetStackTrace(int offset) { return "no stack trace on windows"; }
+#endif
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Victor.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Victor.cpp
new file mode 100644
index 0000000..93ab479
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/Victor.cpp
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Victor.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Constructor for a Victor.
+ *
+ * @param channel The PWM channel number that the Victor is attached to. 0-9
+ *                are on-board, 10-19 are on the MXP port
+ */
+Victor::Victor(int channel) : PWMSpeedController(channel) {
+  /* Note that the Victor uses the following bounds for PWM values.  These
+   * values were determined empirically and optimized for the Victor 888. These
+   * values should work reasonably well for Victor 884 controllers as well but
+   * if users experience issues such as asymmetric behaviour around the deadband
+   * or inability to saturate the controller in either direction, calibration is
+   * recommended. The calibration procedure can be found in the Victor 884 User
+   * Manual available from IFI.
+   *
+   *   2.027ms = full "forward"
+   *   1.525ms = the "high end" of the deadband range
+   *   1.507ms = center of the deadband range (off)
+   *   1.49ms = the "low end" of the deadband range
+   *   1.026ms = full "reverse"
+   */
+  SetBounds(2.027, 1.525, 1.507, 1.49, 1.026);
+  SetPeriodMultiplier(kPeriodMultiplier_2X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_Victor, GetChannel());
+  SetName("Victor", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/VictorSP.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/VictorSP.cpp
new file mode 100644
index 0000000..6bfeb98
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/VictorSP.cpp
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "VictorSP.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Constructor for a VictorSP.
+ *
+ * @param channel The PWM channel that the VictorSP is attached to. 0-9 are
+ *                on-board, 10-19 are on the MXP port
+ */
+VictorSP::VictorSP(int channel) : PWMSpeedController(channel) {
+  /**
+   * Note that the VictorSP uses the following bounds for PWM values. These
+   * values should work reasonably well for most controllers, but if users
+   * experience issues such as asymmetric behavior around the deadband or
+   * inability to saturate the controller in either direction, calibration is
+   * recommended. The calibration procedure can be found in the VictorSP User
+   * Manual available from Vex.
+   *
+   *   2.004ms = full "forward"
+   *   1.52ms = the "high end" of the deadband range
+   *   1.50ms = center of the deadband range (off)
+   *   1.48ms = the "low end" of the deadband range
+   *   0.997ms = full "reverse"
+   */
+  SetBounds(2.004, 1.52, 1.50, 1.48, .997);
+  SetPeriodMultiplier(kPeriodMultiplier_1X);
+  SetSpeed(0.0);
+  SetZeroLatch();
+
+  HAL_Report(HALUsageReporting::kResourceType_VictorSP, GetChannel());
+  SetName("VictorSP", GetChannel());
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/XboxController.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/XboxController.cpp
new file mode 100644
index 0000000..aea64a4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/XboxController.cpp
@@ -0,0 +1,311 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "XboxController.h"
+
+#include <HAL/HAL.h>
+
+using namespace frc;
+
+/**
+ * Construct an instance of an Xbox controller.
+ *
+ * The controller index is the USB port on the Driver Station.
+ *
+ * @param port The port on the Driver Station that the controller is plugged
+ *             into (0-5).
+ */
+XboxController::XboxController(int port) : GenericHID(port) {
+  // HAL_Report(HALUsageReporting::kResourceType_XboxController, port);
+  HAL_Report(HALUsageReporting::kResourceType_Joystick, port);
+}
+
+/**
+ * Get the X axis value of the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ */
+double XboxController::GetX(JoystickHand hand) const {
+  if (hand == kLeftHand) {
+    return GetRawAxis(0);
+  } else {
+    return GetRawAxis(4);
+  }
+}
+
+/**
+ * Get the Y axis value of the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ */
+double XboxController::GetY(JoystickHand hand) const {
+  if (hand == kLeftHand) {
+    return GetRawAxis(1);
+  } else {
+    return GetRawAxis(5);
+  }
+}
+
+/**
+ * Get the trigger axis value of the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ */
+double XboxController::GetTriggerAxis(JoystickHand hand) const {
+  if (hand == kLeftHand) {
+    return GetRawAxis(2);
+  } else {
+    return GetRawAxis(3);
+  }
+}
+
+/**
+ * Read the value of the bumper button on the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ */
+bool XboxController::GetBumper(JoystickHand hand) const {
+  if (hand == kLeftHand) {
+    return GetRawButton(static_cast<int>(Button::kBumperLeft));
+  } else {
+    return GetRawButton(static_cast<int>(Button::kBumperRight));
+  }
+}
+
+/**
+ * Whether the bumper was pressed since the last check.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetBumperPressed(JoystickHand hand) {
+  if (hand == kLeftHand) {
+    return GetRawButtonPressed(static_cast<int>(Button::kBumperLeft));
+  } else {
+    return GetRawButtonPressed(static_cast<int>(Button::kBumperRight));
+  }
+}
+
+/**
+ * Whether the bumper was released since the last check.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetBumperReleased(JoystickHand hand) {
+  if (hand == kLeftHand) {
+    return GetRawButtonReleased(static_cast<int>(Button::kBumperLeft));
+  } else {
+    return GetRawButtonReleased(static_cast<int>(Button::kBumperRight));
+  }
+}
+
+/**
+ * Read the value of the stick button on the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return The state of the button.
+ */
+bool XboxController::GetStickButton(JoystickHand hand) const {
+  if (hand == kLeftHand) {
+    return GetRawButton(static_cast<int>(Button::kStickLeft));
+  } else {
+    return GetRawButton(static_cast<int>(Button::kStickRight));
+  }
+}
+
+/**
+ * Whether the stick button was pressed since the last check.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetStickButtonPressed(JoystickHand hand) {
+  if (hand == kLeftHand) {
+    return GetRawButtonPressed(static_cast<int>(Button::kStickLeft));
+  } else {
+    return GetRawButtonPressed(static_cast<int>(Button::kStickRight));
+  }
+}
+
+/**
+ * Whether the stick button was released since the last check.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetStickButtonReleased(JoystickHand hand) {
+  if (hand == kLeftHand) {
+    return GetRawButtonReleased(static_cast<int>(Button::kStickLeft));
+  } else {
+    return GetRawButtonReleased(static_cast<int>(Button::kStickRight));
+  }
+}
+
+/**
+ * Read the value of the A button on the controller.
+ *
+ * @return The state of the button.
+ */
+bool XboxController::GetAButton() const {
+  return GetRawButton(static_cast<int>(Button::kA));
+}
+
+/**
+ * Whether the A button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetAButtonPressed() {
+  return GetRawButtonPressed(static_cast<int>(Button::kA));
+}
+
+/**
+ * Whether the A button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetAButtonReleased() {
+  return GetRawButtonReleased(static_cast<int>(Button::kA));
+}
+
+/**
+ * Read the value of the B button on the controller.
+ *
+ * @return The state of the button.
+ */
+bool XboxController::GetBButton() const {
+  return GetRawButton(static_cast<int>(Button::kB));
+}
+
+/**
+ * Whether the B button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetBButtonPressed() {
+  return GetRawButtonPressed(static_cast<int>(Button::kB));
+}
+
+/**
+ * Whether the B button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetBButtonReleased() {
+  return GetRawButtonReleased(static_cast<int>(Button::kB));
+}
+
+/**
+ * Read the value of the X button on the controller.
+ *
+ * @return The state of the button.
+ */
+bool XboxController::GetXButton() const {
+  return GetRawButton(static_cast<int>(Button::kX));
+}
+
+/**
+ * Whether the X button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetXButtonPressed() {
+  return GetRawButtonPressed(static_cast<int>(Button::kX));
+}
+
+/**
+ * Whether the X button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetXButtonReleased() {
+  return GetRawButtonReleased(static_cast<int>(Button::kX));
+}
+
+/**
+ * Read the value of the Y button on the controller.
+ *
+ * @return The state of the button.
+ */
+bool XboxController::GetYButton() const {
+  return GetRawButton(static_cast<int>(Button::kY));
+}
+
+/**
+ * Whether the Y button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetYButtonPressed() {
+  return GetRawButtonPressed(static_cast<int>(Button::kY));
+}
+
+/**
+ * Whether the Y button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetYButtonReleased() {
+  return GetRawButtonReleased(static_cast<int>(Button::kY));
+}
+
+/**
+ * Read the value of the back button on the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return The state of the button.
+ */
+bool XboxController::GetBackButton() const {
+  return GetRawButton(static_cast<int>(Button::kBack));
+}
+
+/**
+ * Whether the back button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetBackButtonPressed() {
+  return GetRawButtonPressed(static_cast<int>(Button::kBack));
+}
+
+/**
+ * Whether the back button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetBackButtonReleased() {
+  return GetRawButtonReleased(static_cast<int>(Button::kBack));
+}
+
+/**
+ * Read the value of the start button on the controller.
+ *
+ * @param hand Side of controller whose value should be returned.
+ * @return The state of the button.
+ */
+bool XboxController::GetStartButton() const {
+  return GetRawButton(static_cast<int>(Button::kStart));
+}
+
+/**
+ * Whether the start button was pressed since the last check.
+ *
+ * @return Whether the button was pressed since the last check.
+ */
+bool XboxController::GetStartButtonPressed() {
+  return GetRawButtonPressed(static_cast<int>(Button::kStart));
+}
+
+/**
+ * Whether the start button was released since the last check.
+ *
+ * @return Whether the button was released since the last check.
+ */
+bool XboxController::GetStartButtonReleased() {
+  return GetRawButtonReleased(static_cast<int>(Button::kStart));
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/interfaces/Potentiometer.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/interfaces/Potentiometer.cpp
new file mode 100644
index 0000000..b8f3e03
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/interfaces/Potentiometer.cpp
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "interfaces/Potentiometer.h"
+
+#include <Utility.h>
+
+using namespace frc;
+
+void Potentiometer::SetPIDSourceType(PIDSourceType pidSource) {
+  if (wpi_assert(pidSource == PIDSourceType::kDisplacement)) {
+    m_pidSource = pidSource;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/vision/VisionRunner.cpp b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/vision/VisionRunner.cpp
new file mode 100644
index 0000000..9cd8365
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/cpp/vision/VisionRunner.cpp
@@ -0,0 +1,83 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "vision/VisionRunner.h"
+
+#include <opencv2/core/mat.hpp>
+
+#include "DriverStation.h"
+#include "RobotBase.h"
+
+using namespace frc;
+
+/**
+ * Creates a new vision runner. It will take images from the {@code
+ * videoSource}, and call the virtual DoProcess() method.
+ *
+ * @param videoSource the video source to use to supply images for the pipeline
+ */
+VisionRunnerBase::VisionRunnerBase(cs::VideoSource videoSource)
+    : m_image(std::make_unique<cv::Mat>()),
+      m_cvSink("VisionRunner CvSink"),
+      m_enabled(true) {
+  m_cvSink.SetSource(videoSource);
+}
+
+// Located here and not in header due to cv::Mat forward declaration.
+VisionRunnerBase::~VisionRunnerBase() {}
+
+/**
+ * Runs the pipeline one time, giving it the next image from the video source
+ * specified in the constructor. This will block until the source either has an
+ * image or throws an error. If the source successfully supplied a frame, the
+ * pipeline's image input will be set, the pipeline will run, and the listener
+ * specified in the constructor will be called to notify it that the pipeline
+ * ran. This must be run in a dedicated thread, and cannot be used in the main
+ * robot thread because it will freeze the robot program.
+ *
+ * <p>This method is exposed to allow teams to add additional functionality or
+ * have their own ways to run the pipeline. Most teams, however, should just
+ * use {@link #runForever} in its own thread using a std::thread.</p>
+ */
+void VisionRunnerBase::RunOnce() {
+  if (std::this_thread::get_id() == RobotBase::GetThreadId()) {
+    wpi_setErrnoErrorWithContext(
+        "VisionRunner::RunOnce() cannot be called from the main robot thread");
+    return;
+  }
+  auto frameTime = m_cvSink.GrabFrame(*m_image);
+  if (frameTime == 0) {
+    auto error = m_cvSink.GetError();
+    DriverStation::ReportError(error);
+  } else {
+    DoProcess(*m_image);
+  }
+}
+
+/**
+ * A convenience method that calls {@link #runOnce()} in an infinite loop. This
+ * must be run in a dedicated thread, and cannot be used in the main robot
+ * thread because it will freeze the robot program.
+ *
+ * <strong>Do not call this method directly from the main thread.</strong>
+ */
+void VisionRunnerBase::RunForever() {
+  if (std::this_thread::get_id() == RobotBase::GetThreadId()) {
+    wpi_setErrnoErrorWithContext(
+        "VisionRunner::RunForever() cannot be called from the main robot "
+        "thread");
+    return;
+  }
+  while (m_enabled) {
+    RunOnce();
+  }
+}
+
+/**
+ * Stop a RunForever() loop.
+ */
+void VisionRunnerBase::Stop() { m_enabled = false; }
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL345_I2C.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL345_I2C.h
new file mode 100644
index 0000000..e03a16e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL345_I2C.h
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "I2C.h"
+#include "SensorBase.h"
+#include "interfaces/Accelerometer.h"
+
+namespace frc {
+
+/**
+ * ADXL345 Accelerometer on I2C.
+ *
+ * This class allows access to a Analog Devices ADXL345 3-axis accelerometer on
+ * an I2C bus. This class assumes the default (not alternate) sensor address of
+ * 0x1D (7-bit address).
+ */
+class ADXL345_I2C : public SensorBase, public Accelerometer {
+ public:
+  enum Axes { kAxis_X = 0x00, kAxis_Y = 0x02, kAxis_Z = 0x04 };
+
+  struct AllAxes {
+    double XAxis;
+    double YAxis;
+    double ZAxis;
+  };
+
+  explicit ADXL345_I2C(I2C::Port port, Range range = kRange_2G,
+                       int deviceAddress = kAddress);
+  ~ADXL345_I2C() override = default;
+
+  ADXL345_I2C(const ADXL345_I2C&) = delete;
+  ADXL345_I2C& operator=(const ADXL345_I2C&) = delete;
+
+  // Accelerometer interface
+  void SetRange(Range range) override;
+  double GetX() override;
+  double GetY() override;
+  double GetZ() override;
+
+  virtual double GetAcceleration(Axes axis);
+  virtual AllAxes GetAccelerations();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  I2C m_i2c;
+
+  static constexpr int kAddress = 0x1D;
+  static constexpr int kPowerCtlRegister = 0x2D;
+  static constexpr int kDataFormatRegister = 0x31;
+  static constexpr int kDataRegister = 0x32;
+  static constexpr double kGsPerLSB = 0.00390625;
+
+  enum PowerCtlFields {
+    kPowerCtl_Link = 0x20,
+    kPowerCtl_AutoSleep = 0x10,
+    kPowerCtl_Measure = 0x08,
+    kPowerCtl_Sleep = 0x04
+  };
+
+  enum DataFormatFields {
+    kDataFormat_SelfTest = 0x80,
+    kDataFormat_SPI = 0x40,
+    kDataFormat_IntInvert = 0x20,
+    kDataFormat_FullRes = 0x08,
+    kDataFormat_Justify = 0x04
+  };
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL345_SPI.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL345_SPI.h
new file mode 100644
index 0000000..ac6e4f4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL345_SPI.h
@@ -0,0 +1,75 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SPI.h"
+#include "SensorBase.h"
+#include "interfaces/Accelerometer.h"
+
+namespace frc {
+
+/**
+ * ADXL345 Accelerometer on SPI.
+ *
+ * This class allows access to an Analog Devices ADXL345 3-axis accelerometer
+ * via SPI. This class assumes the sensor is wired in 4-wire SPI mode.
+ */
+class ADXL345_SPI : public SensorBase, public Accelerometer {
+ public:
+  enum Axes { kAxis_X = 0x00, kAxis_Y = 0x02, kAxis_Z = 0x04 };
+
+  struct AllAxes {
+    double XAxis;
+    double YAxis;
+    double ZAxis;
+  };
+
+  explicit ADXL345_SPI(SPI::Port port, Range range = kRange_2G);
+  ~ADXL345_SPI() override = default;
+
+  ADXL345_SPI(const ADXL345_SPI&) = delete;
+  ADXL345_SPI& operator=(const ADXL345_SPI&) = delete;
+
+  // Accelerometer interface
+  void SetRange(Range range) override;
+  double GetX() override;
+  double GetY() override;
+  double GetZ() override;
+
+  virtual double GetAcceleration(Axes axis);
+  virtual AllAxes GetAccelerations();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  SPI m_spi;
+
+  static constexpr int kPowerCtlRegister = 0x2D;
+  static constexpr int kDataFormatRegister = 0x31;
+  static constexpr int kDataRegister = 0x32;
+  static constexpr double kGsPerLSB = 0.00390625;
+
+  enum SPIAddressFields { kAddress_Read = 0x80, kAddress_MultiByte = 0x40 };
+
+  enum PowerCtlFields {
+    kPowerCtl_Link = 0x20,
+    kPowerCtl_AutoSleep = 0x10,
+    kPowerCtl_Measure = 0x08,
+    kPowerCtl_Sleep = 0x04
+  };
+
+  enum DataFormatFields {
+    kDataFormat_SelfTest = 0x80,
+    kDataFormat_SPI = 0x40,
+    kDataFormat_IntInvert = 0x20,
+    kDataFormat_FullRes = 0x08,
+    kDataFormat_Justify = 0x04
+  };
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL362.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL362.h
new file mode 100644
index 0000000..8083df1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXL362.h
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SPI.h"
+#include "SensorBase.h"
+#include "interfaces/Accelerometer.h"
+
+namespace frc {
+
+/**
+ * ADXL362 SPI Accelerometer.
+ *
+ * This class allows access to an Analog Devices ADXL362 3-axis accelerometer.
+ */
+class ADXL362 : public SensorBase, public Accelerometer {
+ public:
+  enum Axes { kAxis_X = 0x00, kAxis_Y = 0x02, kAxis_Z = 0x04 };
+  struct AllAxes {
+    double XAxis;
+    double YAxis;
+    double ZAxis;
+  };
+
+ public:
+  explicit ADXL362(Range range = kRange_2G);
+  explicit ADXL362(SPI::Port port, Range range = kRange_2G);
+  virtual ~ADXL362() = default;
+
+  ADXL362(const ADXL362&) = delete;
+  ADXL362& operator=(const ADXL362&) = delete;
+
+  // Accelerometer interface
+  void SetRange(Range range) override;
+  double GetX() override;
+  double GetY() override;
+  double GetZ() override;
+
+  virtual double GetAcceleration(Axes axis);
+  virtual AllAxes GetAccelerations();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  SPI m_spi;
+  double m_gsPerLSB = 0.001;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXRS450_Gyro.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXRS450_Gyro.h
new file mode 100644
index 0000000..5c52364
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ADXRS450_Gyro.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "GyroBase.h"
+#include "SPI.h"
+
+namespace frc {
+
+/**
+ * Use a rate gyro to return the robots heading relative to a starting position.
+ *
+ * The Gyro class tracks the robots heading based on the starting position. As
+ * the robot rotates the new heading is computed by integrating the rate of
+ * rotation returned by the sensor. When the class is instantiated, it does a
+ * short calibration routine where it samples the gyro while at rest to
+ * determine the default offset. This is subtracted from each sample to
+ * determine the heading.
+ *
+ * This class is for the digital ADXRS450 gyro sensor that connects via SPI.
+ */
+class ADXRS450_Gyro : public GyroBase {
+ public:
+  ADXRS450_Gyro();
+  explicit ADXRS450_Gyro(SPI::Port port);
+  virtual ~ADXRS450_Gyro() = default;
+
+  double GetAngle() const override;
+  double GetRate() const override;
+  void Reset() override;
+  void Calibrate() override;
+
+ private:
+  SPI m_spi;
+
+  uint16_t ReadRegister(int reg);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogAccelerometer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogAccelerometer.h
new file mode 100644
index 0000000..ec9b4dd
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogAccelerometer.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include "AnalogInput.h"
+#include "PIDSource.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+/**
+ * Handle operation of an analog accelerometer.
+ *
+ * The accelerometer reads acceleration directly through the sensor. Many
+ * sensors have multiple axis and can be treated as multiple devices. Each is
+ * calibrated by finding the center value over a period of time.
+ */
+class AnalogAccelerometer : public SensorBase, public PIDSource {
+ public:
+  explicit AnalogAccelerometer(int channel);
+  explicit AnalogAccelerometer(AnalogInput* channel);
+  explicit AnalogAccelerometer(std::shared_ptr<AnalogInput> channel);
+  ~AnalogAccelerometer() override = default;
+
+  double GetAcceleration() const;
+  void SetSensitivity(double sensitivity);
+  void SetZero(double zero);
+  double PIDGet() override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  void InitAccelerometer();
+
+  std::shared_ptr<AnalogInput> m_analogInput;
+  double m_voltsPerG = 1.0;
+  double m_zeroGVoltage = 2.5;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogGyro.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogGyro.h
new file mode 100644
index 0000000..cb83313
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogGyro.h
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HAL/Types.h>
+
+#include "GyroBase.h"
+
+namespace frc {
+
+class AnalogInput;
+
+/**
+ * Use a rate gyro to return the robots heading relative to a starting position.
+ * The Gyro class tracks the robots heading based on the starting position. As
+ * the robot rotates the new heading is computed by integrating the rate of
+ * rotation returned by the sensor. When the class is instantiated, it does a
+ * short calibration routine where it samples the gyro while at rest to
+ * determine the default offset. This is subtracted from each sample to
+ * determine the heading. This gyro class must be used with a channel that is
+ * assigned one of the Analog accumulators from the FPGA. See AnalogInput for
+ * the current accumulator assignments.
+ *
+ * This class is for gyro sensors that connect to an analog input.
+ */
+class AnalogGyro : public GyroBase {
+ public:
+  static constexpr int kOversampleBits = 10;
+  static constexpr int kAverageBits = 0;
+  static constexpr double kSamplesPerSecond = 50.0;
+  static constexpr double kCalibrationSampleTime = 5.0;
+  static constexpr double kDefaultVoltsPerDegreePerSecond = 0.007;
+
+  explicit AnalogGyro(int channel);
+  explicit AnalogGyro(AnalogInput* channel);
+  explicit AnalogGyro(std::shared_ptr<AnalogInput> channel);
+  AnalogGyro(int channel, int center, double offset);
+  AnalogGyro(std::shared_ptr<AnalogInput> channel, int center, double offset);
+  virtual ~AnalogGyro();
+
+  double GetAngle() const override;
+  double GetRate() const override;
+  virtual int GetCenter() const;
+  virtual double GetOffset() const;
+  void SetSensitivity(double voltsPerDegreePerSecond);
+  void SetDeadband(double volts);
+  void Reset() override;
+  virtual void InitGyro();
+  void Calibrate() override;
+
+ protected:
+  std::shared_ptr<AnalogInput> m_analog;
+
+ private:
+  HAL_GyroHandle m_gyroHandle = HAL_kInvalidHandle;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogInput.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogInput.h
new file mode 100644
index 0000000..0400798
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogInput.h
@@ -0,0 +1,83 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <HAL/Types.h>
+
+#include "PIDSource.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+/**
+ * Analog input class.
+ *
+ * Connected to each analog channel is an averaging and oversampling engine.
+ * This engine accumulates the specified ( by SetAverageBits() and
+ * SetOversampleBits() ) number of samples before returning a new value. This is
+ * not a sliding window average. The only difference between the oversampled
+ * samples and the averaged samples is that the oversampled samples are simply
+ * accumulated effectively increasing the resolution, while the averaged samples
+ * are divided by the number of samples to retain the resolution, but get more
+ * stable values.
+ */
+class AnalogInput : public SensorBase, public PIDSource {
+  friend class AnalogTrigger;
+  friend class AnalogGyro;
+
+ public:
+  static constexpr int kAccumulatorModuleNumber = 1;
+  static constexpr int kAccumulatorNumChannels = 2;
+  static constexpr int kAccumulatorChannels[kAccumulatorNumChannels] = {0, 1};
+
+  explicit AnalogInput(int channel);
+  ~AnalogInput() override;
+
+  int GetValue() const;
+  int GetAverageValue() const;
+
+  double GetVoltage() const;
+  double GetAverageVoltage() const;
+
+  int GetChannel() const;
+
+  void SetAverageBits(int bits);
+  int GetAverageBits() const;
+  void SetOversampleBits(int bits);
+  int GetOversampleBits() const;
+
+  int GetLSBWeight() const;
+  int GetOffset() const;
+
+  bool IsAccumulatorChannel() const;
+  void InitAccumulator();
+  void SetAccumulatorInitialValue(int64_t value);
+  void ResetAccumulator();
+  void SetAccumulatorCenter(int center);
+  void SetAccumulatorDeadband(int deadband);
+  int64_t GetAccumulatorValue() const;
+  int64_t GetAccumulatorCount() const;
+  void GetAccumulatorOutput(int64_t& value, int64_t& count) const;
+
+  static void SetSampleRate(double samplesPerSecond);
+  static double GetSampleRate();
+
+  double PIDGet() override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_channel;
+  // TODO: Adjust HAL to avoid use of raw pointers.
+  HAL_AnalogInputHandle m_port;
+  int64_t m_accumulatorOffset;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogOutput.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogOutput.h
new file mode 100644
index 0000000..4d28759
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogOutput.h
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/AnalogOutput.h>
+
+#include "ErrorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * MXP analog output class.
+ */
+class AnalogOutput : public ErrorBase, public SendableBase {
+ public:
+  explicit AnalogOutput(int channel);
+  ~AnalogOutput() override;
+
+  void SetVoltage(double voltage);
+  double GetVoltage() const;
+  int GetChannel();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  int m_channel;
+  HAL_AnalogOutputHandle m_port;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogPotentiometer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogPotentiometer.h
new file mode 100644
index 0000000..e41a8a3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogPotentiometer.h
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include "AnalogInput.h"
+#include "SensorBase.h"
+#include "interfaces/Potentiometer.h"
+
+namespace frc {
+
+/**
+ * Class for reading analog potentiometers. Analog potentiometers read in an
+ * analog voltage that corresponds to a position. The position is in whichever
+ * units you choose, by way of the scaling and offset constants passed to the
+ * constructor.
+ */
+class AnalogPotentiometer : public SensorBase, public Potentiometer {
+ public:
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * Use the fullRange and offset values so that the output produces meaningful
+   * values. I.E: you have a 270 degree potentiometer and you want the output to
+   * be degrees with the halfway point as 0 degrees. The fullRange value is
+   * 270.0 degrees and the offset is -135.0 since the halfway point after
+   * scaling is 135 degrees.
+   *
+   * This will calculate the result from the fullRange times the fraction of the
+   * supply voltage, plus the offset.
+   *
+   * @param channel   The analog channel this potentiometer is plugged into.
+   * @param fullRange The scaling to multiply the voltage by to get a meaningful
+   *                  unit.
+   * @param offset    The offset to add to the scaled value for controlling the
+   *                  zero value.
+   */
+  explicit AnalogPotentiometer(int channel, double fullRange = 1.0,
+                               double offset = 0.0);
+
+  explicit AnalogPotentiometer(AnalogInput* input, double fullRange = 1.0,
+                               double offset = 0.0);
+
+  explicit AnalogPotentiometer(std::shared_ptr<AnalogInput> input,
+                               double fullRange = 1.0, double offset = 0.0);
+
+  ~AnalogPotentiometer() override = default;
+
+  /**
+   * Get the current reading of the potentiomer.
+   *
+   * @return The current position of the potentiometer.
+   */
+  double Get() const override;
+
+  /**
+   * Implement the PIDSource interface.
+   *
+   * @return The current reading.
+   */
+  double PIDGet() override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  std::shared_ptr<AnalogInput> m_analog_input;
+  double m_fullRange, m_offset;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTrigger.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTrigger.h
new file mode 100644
index 0000000..21a1b2f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTrigger.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HAL/Types.h>
+
+#include "AnalogTriggerOutput.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+class AnalogInput;
+
+class AnalogTrigger : public SensorBase {
+  friend class AnalogTriggerOutput;
+
+ public:
+  explicit AnalogTrigger(int channel);
+  explicit AnalogTrigger(AnalogInput* channel);
+  ~AnalogTrigger() override;
+
+  void SetLimitsVoltage(double lower, double upper);
+  void SetLimitsRaw(int lower, int upper);
+  void SetAveraged(bool useAveragedValue);
+  void SetFiltered(bool useFilteredValue);
+  int GetIndex() const;
+  bool GetInWindow();
+  bool GetTriggerState();
+  std::shared_ptr<AnalogTriggerOutput> CreateOutput(
+      AnalogTriggerType type) const;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_index;
+  HAL_AnalogTriggerHandle m_trigger;
+  AnalogInput* m_analogInput = nullptr;
+  bool m_ownsAnalog = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTriggerOutput.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTriggerOutput.h
new file mode 100644
index 0000000..6eb6a6e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTriggerOutput.h
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/AnalogTrigger.h>
+
+#include "DigitalSource.h"
+
+namespace frc {
+
+class AnalogTrigger;
+
+/**
+ * Class to represent a specific output from an analog trigger.
+ *
+ * This class is used to get the current output value and also as a
+ * DigitalSource to provide routing of an output to digital subsystems on the
+ * FPGA such as Counter, Encoder, and Interrupt.
+ *
+ * The TriggerState output indicates the primary output value of the trigger.
+ * If the analog signal is less than the lower limit, the output is false. If
+ * the analog value is greater than the upper limit, then the output is true.
+ * If the analog value is in between, then the trigger output state maintains
+ * its most recent value.
+ *
+ * The InWindow output indicates whether or not the analog signal is inside the
+ * range defined by the limits.
+ *
+ * The RisingPulse and FallingPulse outputs detect an instantaneous transition
+ * from above the upper limit to below the lower limit, and vise versa. These
+ * pulses represent a rollover condition of a sensor and can be routed to an up
+ * / down counter or to interrupts. Because the outputs generate a pulse, they
+ * cannot be read directly. To help ensure that a rollover condition is not
+ * missed, there is an average rejection filter available that operates on the
+ * upper 8 bits of a 12 bit number and selects the nearest outlyer of 3 samples.
+ * This will reject a sample that is (due to averaging or sampling) errantly
+ * between the two limits. This filter will fail if more than one sample in a
+ * row is errantly in between the two limits. You may see this problem if
+ * attempting to use this feature with a mechanical rollover sensor, such as a
+ * 360 degree no-stop potentiometer without signal conditioning, because the
+ * rollover transition is not sharp / clean enough. Using the averaging engine
+ * may help with this, but rotational speeds of the sensor will then be limited.
+ */
+class AnalogTriggerOutput : public DigitalSource {
+  friend class AnalogTrigger;
+
+ public:
+  ~AnalogTriggerOutput() override;
+  bool Get() const;
+
+  // DigitalSource interface
+  HAL_Handle GetPortHandleForRouting() const override;
+  AnalogTriggerType GetAnalogTriggerTypeForRouting() const override;
+  bool IsAnalogTrigger() const override;
+  int GetChannel() const override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  AnalogTriggerOutput(const AnalogTrigger& trigger,
+                      AnalogTriggerType outputType);
+
+ private:
+  // Uses reference rather than smart pointer because a user can not construct
+  // an AnalogTriggerOutput themselves and because the AnalogTriggerOutput
+  // should always be in scope at the same time as an AnalogTrigger.
+  const AnalogTrigger& m_trigger;
+  AnalogTriggerType m_outputType;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTriggerType.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTriggerType.h
new file mode 100644
index 0000000..f15fb03
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/AnalogTriggerType.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+enum class AnalogTriggerType {
+  kInWindow = 0,
+  kState = 1,
+  kRisingPulse = 2,
+  kFallingPulse = 3
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Base.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Base.h
new file mode 100644
index 0000000..15786e3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Base.h
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5
+static_assert(0,
+              "GCC must be 5 or greater. If building for the roboRIO, please "
+              "update to the 2018 toolchains.");
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+static_assert(0, "Visual Studio 2015 or greater required.");
+#endif
+
+#include <HAL/cpp/make_unique.h>
+
+#define DEFAULT_MOVE_CONSTRUCTOR(ClassName) ClassName(ClassName&&) = default
+
+namespace frc {
+
+// A struct to use as a deleter when a std::shared_ptr must wrap a raw pointer
+// that is being deleted by someone else.
+template <class T>
+struct NullDeleter {
+  void operator()(T*) const noexcept {};
+};
+
+}  // namespace frc
+
+#include <atomic>
+
+namespace frc {
+
+// Use this for determining whether the default move constructor has been
+// called on a containing object. This serves the purpose of allowing us to
+// use the default move constructor of an object for moving all the data around
+// while being able to use this to, for instance, chose not to de-allocate
+// a PWM port in a destructor.
+struct HasBeenMoved {
+  HasBeenMoved(HasBeenMoved&& other) {
+    other.moved = true;
+    moved = false;
+  }
+  HasBeenMoved() = default;
+  std::atomic<bool> moved{false};
+  operator bool() const { return moved; }
+};
+
+}  // namespace frc
+
+// For backwards compatibility
+#ifndef NAMESPACED_WPILIB
+using namespace frc;  // NOLINT
+#endif
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/BuiltInAccelerometer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/BuiltInAccelerometer.h
new file mode 100644
index 0000000..90ad556
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/BuiltInAccelerometer.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SensorBase.h"
+#include "interfaces/Accelerometer.h"
+
+namespace frc {
+
+/**
+ * Built-in accelerometer.
+ *
+ * This class allows access to the roboRIO's internal accelerometer.
+ */
+class BuiltInAccelerometer : public SensorBase, public Accelerometer {
+ public:
+  explicit BuiltInAccelerometer(Range range = kRange_8G);
+
+  // Accelerometer interface
+  void SetRange(Range range) override;
+  double GetX() override;
+  double GetY() override;
+  double GetZ() override;
+
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/Button.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/Button.h
new file mode 100644
index 0000000..7cfc21c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/Button.h
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/Trigger.h"
+#include "Commands/Command.h"
+
+namespace frc {
+
+/**
+ * This class provides an easy way to link commands to OI inputs.
+ *
+ * It is very easy to link a button to a command.  For instance, you could link
+ * the trigger button of a joystick to a "score" command.
+ *
+ * This class represents a subclass of Trigger that is specifically aimed at
+ * buttons on an operator interface as a common use case of the more generalized
+ * Trigger objects. This is a simple wrapper around Trigger with the method
+ * names renamed to fit the Button object use.
+ */
+class Button : public Trigger {
+ public:
+  virtual void WhenPressed(Command* command);
+  virtual void WhileHeld(Command* command);
+  virtual void WhenReleased(Command* command);
+  virtual void CancelWhenPressed(Command* command);
+  virtual void ToggleWhenPressed(Command* command);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ButtonScheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ButtonScheduler.h
new file mode 100644
index 0000000..5f2ccb6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ButtonScheduler.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+class Trigger;
+class Command;
+
+class ButtonScheduler {
+ public:
+  ButtonScheduler(bool last, Trigger* button, Command* orders);
+  virtual ~ButtonScheduler() = default;
+  virtual void Execute() = 0;
+  void Start();
+
+ protected:
+  bool m_pressedLast;
+  Trigger* m_button;
+  Command* m_command;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/CancelButtonScheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/CancelButtonScheduler.h
new file mode 100644
index 0000000..9b90a79
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/CancelButtonScheduler.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/ButtonScheduler.h"
+
+namespace frc {
+
+class Trigger;
+class Command;
+
+class CancelButtonScheduler : public ButtonScheduler {
+ public:
+  CancelButtonScheduler(bool last, Trigger* button, Command* orders);
+  virtual ~CancelButtonScheduler() = default;
+  virtual void Execute();
+
+ private:
+  bool pressedLast;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/HeldButtonScheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/HeldButtonScheduler.h
new file mode 100644
index 0000000..f7600e5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/HeldButtonScheduler.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/ButtonScheduler.h"
+
+namespace frc {
+
+class Trigger;
+class Command;
+
+class HeldButtonScheduler : public ButtonScheduler {
+ public:
+  HeldButtonScheduler(bool last, Trigger* button, Command* orders);
+  virtual ~HeldButtonScheduler() = default;
+  virtual void Execute();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/InternalButton.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/InternalButton.h
new file mode 100644
index 0000000..aa4c93b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/InternalButton.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/Button.h"
+
+namespace frc {
+
+class InternalButton : public Button {
+ public:
+  InternalButton() = default;
+  explicit InternalButton(bool inverted);
+  virtual ~InternalButton() = default;
+
+  void SetInverted(bool inverted);
+  void SetPressed(bool pressed);
+
+  virtual bool Get();
+
+ private:
+  bool m_pressed = false;
+  bool m_inverted = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/JoystickButton.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/JoystickButton.h
new file mode 100644
index 0000000..a7ed9c2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/JoystickButton.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/Button.h"
+#include "GenericHID.h"
+
+namespace frc {
+
+class JoystickButton : public Button {
+ public:
+  JoystickButton(GenericHID* joystick, int buttonNumber);
+  virtual ~JoystickButton() = default;
+
+  virtual bool Get();
+
+ private:
+  GenericHID* m_joystick;
+  int m_buttonNumber;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/NetworkButton.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/NetworkButton.h
new file mode 100644
index 0000000..dffc9ff
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/NetworkButton.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/Twine.h>
+#include <networktables/NetworkTable.h>
+#include <networktables/NetworkTableEntry.h>
+
+#include "Buttons/Button.h"
+
+namespace frc {
+
+class NetworkButton : public Button {
+ public:
+  NetworkButton(const llvm::Twine& tableName, const llvm::Twine& field);
+  NetworkButton(std::shared_ptr<nt::NetworkTable> table,
+                const llvm::Twine& field);
+  virtual ~NetworkButton() = default;
+
+  virtual bool Get();
+
+ private:
+  nt::NetworkTableEntry m_entry;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/PressedButtonScheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/PressedButtonScheduler.h
new file mode 100644
index 0000000..ceab9de
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/PressedButtonScheduler.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/ButtonScheduler.h"
+
+namespace frc {
+
+class Trigger;
+class Command;
+
+class PressedButtonScheduler : public ButtonScheduler {
+ public:
+  PressedButtonScheduler(bool last, Trigger* button, Command* orders);
+  virtual ~PressedButtonScheduler() = default;
+  virtual void Execute();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ReleasedButtonScheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ReleasedButtonScheduler.h
new file mode 100644
index 0000000..c0782b8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ReleasedButtonScheduler.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/ButtonScheduler.h"
+
+namespace frc {
+
+class Trigger;
+class Command;
+
+class ReleasedButtonScheduler : public ButtonScheduler {
+ public:
+  ReleasedButtonScheduler(bool last, Trigger* button, Command* orders);
+  virtual ~ReleasedButtonScheduler() = default;
+  virtual void Execute();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ToggleButtonScheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ToggleButtonScheduler.h
new file mode 100644
index 0000000..5e875e9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/ToggleButtonScheduler.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Buttons/ButtonScheduler.h"
+
+namespace frc {
+
+class Trigger;
+class Command;
+
+class ToggleButtonScheduler : public ButtonScheduler {
+ public:
+  ToggleButtonScheduler(bool last, Trigger* button, Command* orders);
+  virtual ~ToggleButtonScheduler() = default;
+  virtual void Execute();
+
+ private:
+  bool pressedLast;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/Trigger.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/Trigger.h
new file mode 100644
index 0000000..c25c25b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Buttons/Trigger.h
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+class Command;
+
+/**
+ * This class provides an easy way to link commands to inputs.
+ *
+ * It is very easy to link a polled input to a command. For instance, you could
+ * link the trigger button of a joystick to a "score" command or an encoder
+ * reaching a particular value.
+ *
+ * It is encouraged that teams write a subclass of Trigger if they want to have
+ * something unusual (for instance, if they want to react to the user holding
+ * a button while the robot is reading a certain sensor input). For this, they
+ * only have to write the {@link Trigger#Get()} method to get the full
+ * functionality of the Trigger class.
+ */
+class Trigger : public SendableBase {
+ public:
+  Trigger() = default;
+  ~Trigger() override = default;
+  bool Grab();
+  virtual bool Get() = 0;
+  void WhenActive(Command* command);
+  void WhileActive(Command* command);
+  void WhenInactive(Command* command);
+  void CancelWhenActive(Command* command);
+  void ToggleWhenActive(Command* command);
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  std::atomic_bool m_sendablePressed{false};
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/CameraServer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/CameraServer.h
new file mode 100644
index 0000000..2474845
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/CameraServer.h
@@ -0,0 +1,313 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <atomic>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <llvm/DenseMap.h>
+#include <llvm/StringMap.h>
+#include <llvm/StringRef.h>
+#include <networktables/NetworkTable.h>
+#include <support/mutex.h>
+
+#include "ErrorBase.h"
+#include "cscore.h"
+
+namespace frc {
+
+/**
+ * Singleton class for creating and keeping camera servers.
+ *
+ * Also publishes camera information to NetworkTables.
+ */
+class CameraServer : public ErrorBase {
+ public:
+  static constexpr uint16_t kBasePort = 1181;
+  static constexpr int kSize640x480 = 0;
+  static constexpr int kSize320x240 = 1;
+  static constexpr int kSize160x120 = 2;
+
+  /**
+   * Get the CameraServer instance.
+   */
+  static CameraServer* GetInstance();
+
+#ifdef __linux__
+  // USBCamera does not work on anything except Linux.
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * You should call this method to see a camera feed on the dashboard. If you
+   * also want to perform vision processing on the roboRIO, use getVideo() to
+   * get access to the camera images.
+   *
+   * The first time this overload is called, it calls StartAutomaticCapture()
+   * with device 0, creating a camera named "USB Camera 0".  Subsequent calls
+   * increment the device number (e.g. 1, 2, etc).
+   */
+  cs::UsbCamera StartAutomaticCapture();
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * This overload calls StartAutomaticCapture() with a name of "USB Camera
+   * {dev}".
+   *
+   * @param dev The device number of the camera interface
+   */
+  cs::UsbCamera StartAutomaticCapture(int dev);
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * @param name The name to give the camera
+   * @param dev  The device number of the camera interface
+   */
+  cs::UsbCamera StartAutomaticCapture(llvm::StringRef name, int dev);
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * @param name The name to give the camera
+   * @param path The device path (e.g. "/dev/video0") of the camera
+   */
+  cs::UsbCamera StartAutomaticCapture(llvm::StringRef name,
+                                      llvm::StringRef path);
+#endif
+
+  /**
+   * Start automatically capturing images to send to the dashboard from
+   * an existing camera.
+   *
+   * @param camera Camera
+   */
+  void StartAutomaticCapture(const cs::VideoSource& camera);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * This overload calls AddAxisCamera() with name "Axis Camera".
+   *
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  cs::AxisCamera AddAxisCamera(llvm::StringRef host);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * This overload calls AddAxisCamera() with name "Axis Camera".
+   *
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  cs::AxisCamera AddAxisCamera(const char* host);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * This overload calls AddAxisCamera() with name "Axis Camera".
+   *
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  cs::AxisCamera AddAxisCamera(const std::string& host);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * This overload calls AddAxisCamera() with name "Axis Camera".
+   *
+   * @param hosts Array of Camera host IPs/DNS names
+   */
+  cs::AxisCamera AddAxisCamera(llvm::ArrayRef<std::string> hosts);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * This overload calls AddAxisCamera() with name "Axis Camera".
+   *
+   * @param hosts Array of Camera host IPs/DNS names
+   */
+  template <typename T>
+  cs::AxisCamera AddAxisCamera(std::initializer_list<T> hosts);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  cs::AxisCamera AddAxisCamera(llvm::StringRef name, llvm::StringRef host);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  cs::AxisCamera AddAxisCamera(llvm::StringRef name, const char* host);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  cs::AxisCamera AddAxisCamera(llvm::StringRef name, const std::string& host);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param hosts Array of Camera host IPs/DNS names
+   */
+  cs::AxisCamera AddAxisCamera(llvm::StringRef name,
+                               llvm::ArrayRef<std::string> hosts);
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param hosts Array of Camera host IPs/DNS names
+   */
+  template <typename T>
+  cs::AxisCamera AddAxisCamera(llvm::StringRef name,
+                               std::initializer_list<T> hosts);
+
+  /**
+   * Get OpenCV access to the primary camera feed.  This allows you to
+   * get images from the camera for image processing on the roboRIO.
+   *
+   * <p>This is only valid to call after a camera feed has been added
+   * with startAutomaticCapture() or addServer().
+   */
+  cs::CvSink GetVideo();
+
+  /**
+   * Get OpenCV access to the specified camera.  This allows you to get
+   * images from the camera for image processing on the roboRIO.
+   *
+   * @param camera Camera (e.g. as returned by startAutomaticCapture).
+   */
+  cs::CvSink GetVideo(const cs::VideoSource& camera);
+
+  /**
+   * Get OpenCV access to the specified camera.  This allows you to get
+   * images from the camera for image processing on the roboRIO.
+   *
+   * @param name Camera name
+   */
+  cs::CvSink GetVideo(llvm::StringRef name);
+
+  /**
+   * Create a MJPEG stream with OpenCV input. This can be called to pass custom
+   * annotated images to the dashboard.
+   *
+   * @param name Name to give the stream
+   * @param width Width of the image being sent
+   * @param height Height of the image being sent
+   */
+  cs::CvSource PutVideo(llvm::StringRef name, int width, int height);
+
+  /**
+   * Adds a MJPEG server at the next available port.
+   *
+   * @param name Server name
+   */
+  cs::MjpegServer AddServer(llvm::StringRef name);
+
+  /**
+   * Adds a MJPEG server.
+   *
+   * @param name Server name
+   */
+  cs::MjpegServer AddServer(llvm::StringRef name, int port);
+
+  /**
+   * Adds an already created server.
+   *
+   * @param server Server
+   */
+  void AddServer(const cs::VideoSink& server);
+
+  /**
+   * Removes a server by name.
+   *
+   * @param name Server name
+   */
+  void RemoveServer(llvm::StringRef name);
+
+  /**
+   * Get server for the primary camera feed.
+   *
+   * This is only valid to call after a camera feed has been added with
+   * StartAutomaticCapture() or AddServer().
+   */
+  cs::VideoSink GetServer();
+
+  /**
+   * Gets a server by name.
+   *
+   * @param name Server name
+   */
+  cs::VideoSink GetServer(llvm::StringRef name);
+
+  /**
+   * Adds an already created camera.
+   *
+   * @param camera Camera
+   */
+  void AddCamera(const cs::VideoSource& camera);
+
+  /**
+   * Removes a camera by name.
+   *
+   * @param name Camera name
+   */
+  void RemoveCamera(llvm::StringRef name);
+
+  /**
+   * Sets the size of the image to use. Use the public kSize constants to set
+   * the correct mode, or set it directly on a camera and call the appropriate
+   * StartAutomaticCapture method.
+   *
+   * @deprecated Use SetResolution on the UsbCamera returned by
+   *             StartAutomaticCapture() instead.
+   * @param size The size to use
+   */
+  void SetSize(int size);
+
+ private:
+  CameraServer();
+
+  std::shared_ptr<nt::NetworkTable> GetSourceTable(CS_Source source);
+  std::vector<std::string> GetSinkStreamValues(CS_Sink sink);
+  std::vector<std::string> GetSourceStreamValues(CS_Source source);
+  void UpdateStreamValues();
+
+  static constexpr char const* kPublishName = "/CameraPublisher";
+
+  wpi::mutex m_mutex;
+  std::atomic<int> m_defaultUsbDevice;
+  std::string m_primarySourceName;
+  llvm::StringMap<cs::VideoSource> m_sources;
+  llvm::StringMap<cs::VideoSink> m_sinks;
+  llvm::DenseMap<CS_Source, std::shared_ptr<nt::NetworkTable>> m_tables;
+  std::shared_ptr<nt::NetworkTable> m_publishTable;
+  cs::VideoListener m_videoListener;
+  int m_tableListener;
+  int m_nextPort;
+  std::vector<std::string> m_addresses;
+};
+
+}  // namespace frc
+
+#include "CameraServer.inc"
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/CameraServer.inc b/third_party/allwpilib_2018/wpilibc/src/main/native/include/CameraServer.inc
new file mode 100644
index 0000000..9922fc4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/CameraServer.inc
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+#include <vector>
+
+namespace frc {
+
+template <typename T>
+inline cs::AxisCamera CameraServer::AddAxisCamera(
+    std::initializer_list<T> hosts) {
+  return AddAxisCamera("Axis Camera", hosts);
+}
+
+template <typename T>
+inline cs::AxisCamera CameraServer::AddAxisCamera(
+    llvm::StringRef name, std::initializer_list<T> hosts) {
+  std::vector<std::string> vec;
+  vec.reserve(hosts.size());
+  for (const auto& host : hosts) vec.emplace_back(host);
+  return AddAxisCamera(name, vec);
+}
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Command.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Command.h
new file mode 100644
index 0000000..ee8b942
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Command.h
@@ -0,0 +1,163 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <set>
+#include <string>
+
+#include <llvm/Twine.h>
+
+#include "ErrorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+class CommandGroup;
+class Subsystem;
+
+/**
+ * The Command class is at the very core of the entire command framework.
+ *
+ * Every command can be started with a call to Start(). Once a command is
+ * started it will call Initialize(), and then will repeatedly call Execute()
+ * until the IsFinished() returns true. Once it does,End() will be called.
+ *
+ * However, if at any point while it is running Cancel() is called, then the
+ * command will be stopped and Interrupted() will be called.
+ *
+ * If a command uses a Subsystem, then it should specify that it does so by
+ * calling the Requires() method in its constructor. Note that a Command may
+ * have multiple requirements, and Requires() should be called for each one.
+ *
+ * If a command is running and a new command with shared requirements is
+ * started, then one of two things will happen. If the active command is
+ * interruptible, then Cancel() will be called and the command will be removed
+ * to make way for the new one. If the active command is not interruptible, the
+ * other one will not even be started, and the active one will continue
+ * functioning.
+ *
+ * @see CommandGroup
+ * @see Subsystem
+ */
+class Command : public ErrorBase, public SendableBase {
+  friend class CommandGroup;
+  friend class Scheduler;
+
+ public:
+  Command();
+  explicit Command(const llvm::Twine& name);
+  explicit Command(double timeout);
+  Command(const llvm::Twine& name, double timeout);
+  ~Command() override = default;
+  double TimeSinceInitialized() const;
+  void Requires(Subsystem* s);
+  bool IsCanceled() const;
+  void Start();
+  bool Run();
+  void Cancel();
+  bool IsRunning() const;
+  bool IsInitialized() const;
+  bool IsCompleted() const;
+  bool IsInterruptible() const;
+  void SetInterruptible(bool interruptible);
+  bool DoesRequire(Subsystem* subsystem) const;
+  typedef std::set<Subsystem*> SubsystemSet;
+  SubsystemSet GetRequirements() const;
+  CommandGroup* GetGroup() const;
+  void SetRunWhenDisabled(bool run);
+  bool WillRunWhenDisabled() const;
+  int GetID() const;
+
+ protected:
+  void SetTimeout(double timeout);
+  bool IsTimedOut() const;
+  bool AssertUnlocked(const std::string& message);
+  void SetParent(CommandGroup* parent);
+  bool IsParented() const;
+  void ClearRequirements();
+
+  virtual void Initialize();
+  virtual void Execute();
+
+  /**
+   * Returns whether this command is finished.
+   *
+   * If it is, then the command will be removed and End() will be called.
+   *
+   * It may be useful for a team to reference the IsTimedOut() method for
+   * time-sensitive commands.
+   *
+   * Returning false will result in the command never ending automatically.
+   * It may still be cancelled manually or interrupted by another command.
+   * Returning true will result in the command executing once and finishing
+   * immediately. We recommend using InstantCommand for this.
+   *
+   * @return Whether this command is finished.
+   * @see IsTimedOut()
+   */
+  virtual bool IsFinished() = 0;
+
+  virtual void End();
+  virtual void Interrupted();
+
+  virtual void _Initialize();
+  virtual void _Interrupted();
+  virtual void _Execute();
+  virtual void _End();
+  virtual void _Cancel();
+
+  friend class ConditionalCommand;
+
+ private:
+  void LockChanges();
+  void Removed();
+  void StartRunning();
+  void StartTiming();
+
+  // The time since this command was initialized
+  double m_startTime = -1;
+
+  // The time (in seconds) before this command "times out" (-1 if no timeout)
+  double m_timeout;
+
+  // Whether or not this command has been initialized
+  bool m_initialized = false;
+
+  // The requirements (or null if no requirements)
+  SubsystemSet m_requirements;
+
+  // Whether or not it is running
+  bool m_running = false;
+
+  // Whether or not it is interruptible
+  bool m_interruptible = true;
+
+  // Whether or not it has been canceled
+  bool m_canceled = false;
+
+  // Whether or not it has been locked
+  bool m_locked = false;
+
+  // Whether this command should run when the robot is disabled
+  bool m_runWhenDisabled = false;
+
+  // The CommandGroup this is in
+  CommandGroup* m_parent = nullptr;
+
+  // Whether or not this command has completed running
+  bool m_completed = false;
+
+  int m_commandID = m_commandCounter++;
+  static int m_commandCounter;
+
+ public:
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/CommandGroup.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/CommandGroup.h
new file mode 100644
index 0000000..f504216
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/CommandGroup.h
@@ -0,0 +1,74 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <list>
+#include <vector>
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+#include "Commands/CommandGroupEntry.h"
+
+namespace frc {
+
+/**
+ * A CommandGroup is a list of commands which are executed in sequence.
+ *
+ * Commands in a CommandGroup are added using the AddSequential() method and are
+ * called sequentially. CommandGroups are themselves Commands and can be given
+ * to other CommandGroups.
+ *
+ * CommandGroups will carry all of the requirements of their Command
+ * subcommands. Additional requirements can be specified by calling Requires()
+ * normally in the constructor.
+ *
+ * CommandGroups can also execute commands in parallel, simply by adding them
+ * using AddParallel().
+ *
+ * @see Command
+ * @see Subsystem
+ */
+class CommandGroup : public Command {
+ public:
+  CommandGroup() = default;
+  explicit CommandGroup(const llvm::Twine& name);
+  virtual ~CommandGroup() = default;
+
+  void AddSequential(Command* command);
+  void AddSequential(Command* command, double timeout);
+  void AddParallel(Command* command);
+  void AddParallel(Command* command, double timeout);
+  bool IsInterruptible() const;
+  int GetSize() const;
+
+ protected:
+  virtual void Initialize();
+  virtual void Execute();
+  virtual bool IsFinished();
+  virtual void End();
+  virtual void Interrupted();
+  virtual void _Initialize();
+  virtual void _Interrupted();
+  virtual void _Execute();
+  virtual void _End();
+
+ private:
+  void CancelConflicts(Command* command);
+
+  // The commands in this group (stored in entries)
+  std::vector<CommandGroupEntry> m_commands;
+
+  // The active children in this group (stored in entries)
+  std::list<CommandGroupEntry> m_children;
+
+  // The current command, -1 signifies that none have been run
+  int m_currentCommandIndex = -1;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/CommandGroupEntry.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/CommandGroupEntry.h
new file mode 100644
index 0000000..14fcede
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/CommandGroupEntry.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+class Command;
+
+class CommandGroupEntry {
+ public:
+  typedef enum {
+    kSequence_InSequence,
+    kSequence_BranchPeer,
+    kSequence_BranchChild
+  } Sequence;
+
+  CommandGroupEntry() = default;
+  CommandGroupEntry(Command* command, Sequence state, double timeout = -1.0);
+  bool IsTimedOut() const;
+
+  double m_timeout = -1.0;
+  Command* m_command = nullptr;
+  Sequence m_state = kSequence_InSequence;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/ConditionalCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/ConditionalCommand.h
new file mode 100644
index 0000000..eee5370
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/ConditionalCommand.h
@@ -0,0 +1,66 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+
+namespace frc {
+
+/**
+ * A ConditionalCommand is a Command that starts one of two commands.
+ *
+ * A ConditionalCommand uses the Condition method to determine whether it should
+ * run onTrue or onFalse.
+ *
+ * A ConditionalCommand adds the proper Command to the Scheduler during
+ * Initialize() and then IsFinished() will return true once that Command has
+ * finished executing.
+ *
+ * If no Command is specified for onFalse, the occurrence of that condition
+ * will be a no-op.
+ *
+ * A CondtionalCommand will require the superset of subsystems of the onTrue
+ * and onFalse commands.
+ *
+ * @see Command
+ * @see Scheduler
+ */
+class ConditionalCommand : public Command {
+ public:
+  explicit ConditionalCommand(Command* onTrue, Command* onFalse = nullptr);
+  ConditionalCommand(const llvm::Twine& name, Command* onTrue,
+                     Command* onFalse = nullptr);
+  virtual ~ConditionalCommand() = default;
+
+ protected:
+  /**
+   * The Condition to test to determine which Command to run.
+   *
+   * @return true if m_onTrue should be run or false if m_onFalse should be run.
+   */
+  virtual bool Condition() = 0;
+
+  void _Initialize() override;
+  void _Cancel() override;
+  bool IsFinished() override;
+  void _Interrupted() override;
+
+ private:
+  // The Command to execute if Condition() returns true
+  Command* m_onTrue;
+
+  // The Command to execute if Condition() returns false
+  Command* m_onFalse;
+
+  // Stores command chosen by condition
+  Command* m_chosenCommand = nullptr;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/InstantCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/InstantCommand.h
new file mode 100644
index 0000000..54ef31f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/InstantCommand.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+
+namespace frc {
+
+/**
+ * This command will execute once, then finish immediately afterward.
+ *
+ * Subclassing InstantCommand is shorthand for returning true from IsFinished().
+ */
+class InstantCommand : public Command {
+ public:
+  explicit InstantCommand(const llvm::Twine& name);
+  InstantCommand() = default;
+  virtual ~InstantCommand() = default;
+
+ protected:
+  bool IsFinished() override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PIDCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PIDCommand.h
new file mode 100644
index 0000000..950bb7e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PIDCommand.h
@@ -0,0 +1,61 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+#include "PIDController.h"
+#include "PIDOutput.h"
+#include "PIDSource.h"
+
+namespace frc {
+
+class PIDCommand : public Command, public PIDOutput, public PIDSource {
+ public:
+  PIDCommand(const llvm::Twine& name, double p, double i, double d);
+  PIDCommand(const llvm::Twine& name, double p, double i, double d,
+             double period);
+  PIDCommand(const llvm::Twine& name, double p, double i, double d, double f,
+             double period);
+  PIDCommand(double p, double i, double d);
+  PIDCommand(double p, double i, double d, double period);
+  PIDCommand(double p, double i, double d, double f, double period);
+  virtual ~PIDCommand() = default;
+
+  void SetSetpointRelative(double deltaSetpoint);
+
+  // PIDOutput interface
+  void PIDWrite(double output) override;
+
+  // PIDSource interface
+  double PIDGet() override;
+
+ protected:
+  std::shared_ptr<PIDController> GetPIDController() const;
+  void _Initialize() override;
+  void _Interrupted() override;
+  void _End() override;
+  void SetSetpoint(double setpoint);
+  double GetSetpoint() const;
+  double GetPosition();
+
+  virtual double ReturnPIDInput() = 0;
+  virtual void UsePIDOutput(double output) = 0;
+
+ private:
+  // The internal PIDController
+  std::shared_ptr<PIDController> m_controller;
+
+ public:
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PIDSubsystem.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PIDSubsystem.h
new file mode 100644
index 0000000..0790280
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PIDSubsystem.h
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/Twine.h>
+
+#include "Commands/Subsystem.h"
+#include "PIDController.h"
+#include "PIDOutput.h"
+#include "PIDSource.h"
+
+namespace frc {
+
+/**
+ * This class is designed to handle the case where there is a Subsystem which
+ * uses a single PIDController almost constantly (for instance, an elevator
+ * which attempts to stay at a constant height).
+ *
+ * It provides some convenience methods to run an internal PIDController. It
+ * also allows access to the internal PIDController in order to give total
+ * control to the programmer.
+ */
+class PIDSubsystem : public Subsystem, public PIDOutput, public PIDSource {
+ public:
+  PIDSubsystem(const llvm::Twine& name, double p, double i, double d);
+  PIDSubsystem(const llvm::Twine& name, double p, double i, double d, double f);
+  PIDSubsystem(const llvm::Twine& name, double p, double i, double d, double f,
+               double period);
+  PIDSubsystem(double p, double i, double d);
+  PIDSubsystem(double p, double i, double d, double f);
+  PIDSubsystem(double p, double i, double d, double f, double period);
+  ~PIDSubsystem() override = default;
+
+  void Enable();
+  void Disable();
+
+  // PIDOutput interface
+  void PIDWrite(double output) override;
+
+  // PIDSource interface
+  double PIDGet() override;
+  void SetSetpoint(double setpoint);
+  void SetSetpointRelative(double deltaSetpoint);
+  void SetInputRange(double minimumInput, double maximumInput);
+  void SetOutputRange(double minimumOutput, double maximumOutput);
+  double GetSetpoint();
+  double GetPosition();
+  double GetRate();
+
+  virtual void SetAbsoluteTolerance(double absValue);
+  virtual void SetPercentTolerance(double percent);
+  virtual bool OnTarget() const;
+
+ protected:
+  std::shared_ptr<PIDController> GetPIDController();
+
+  virtual double ReturnPIDInput() = 0;
+  virtual void UsePIDOutput(double output) = 0;
+
+ private:
+  // The internal PIDController
+  std::shared_ptr<PIDController> m_controller;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PrintCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PrintCommand.h
new file mode 100644
index 0000000..8d32feb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/PrintCommand.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include <llvm/Twine.h>
+
+#include "Commands/InstantCommand.h"
+
+namespace frc {
+
+class PrintCommand : public InstantCommand {
+ public:
+  explicit PrintCommand(const llvm::Twine& message);
+  virtual ~PrintCommand() = default;
+
+ protected:
+  virtual void Initialize();
+
+ private:
+  std::string m_message;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Scheduler.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Scheduler.h
new file mode 100644
index 0000000..29d48ce
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Scheduler.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+
+#include <networktables/NetworkTableEntry.h>
+#include <support/mutex.h>
+
+#include "Commands/Command.h"
+#include "ErrorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+class ButtonScheduler;
+class Subsystem;
+
+class Scheduler : public ErrorBase, public SendableBase {
+ public:
+  static Scheduler* GetInstance();
+
+  void AddCommand(Command* command);
+  void AddButton(ButtonScheduler* button);
+  void RegisterSubsystem(Subsystem* subsystem);
+  void Run();
+  void Remove(Command* command);
+  void RemoveAll();
+  void ResetAll();
+  void SetEnabled(bool enabled);
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  Scheduler();
+  ~Scheduler() override = default;
+
+  void ProcessCommandAddition(Command* command);
+
+  Command::SubsystemSet m_subsystems;
+  wpi::mutex m_buttonsMutex;
+  typedef std::vector<ButtonScheduler*> ButtonVector;
+  ButtonVector m_buttons;
+  typedef std::vector<Command*> CommandVector;
+  wpi::mutex m_additionsMutex;
+  CommandVector m_additions;
+  typedef std::set<Command*> CommandSet;
+  CommandSet m_commands;
+  bool m_adding = false;
+  bool m_enabled = true;
+  std::vector<std::string> commands;
+  std::vector<double> ids;
+  std::vector<double> toCancel;
+  nt::NetworkTableEntry m_namesEntry;
+  nt::NetworkTableEntry m_idsEntry;
+  nt::NetworkTableEntry m_cancelEntry;
+  bool m_runningCommandsChanged = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/StartCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/StartCommand.h
new file mode 100644
index 0000000..71168eb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/StartCommand.h
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Commands/InstantCommand.h"
+
+namespace frc {
+
+class StartCommand : public InstantCommand {
+ public:
+  explicit StartCommand(Command* commandToStart);
+  virtual ~StartCommand() = default;
+
+ protected:
+  virtual void Initialize();
+
+ private:
+  Command* m_commandToFork;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Subsystem.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Subsystem.h
new file mode 100644
index 0000000..6d7e008
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/Subsystem.h
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+
+#include "ErrorBase.h"
+#include "SmartDashboard/Sendable.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+class Command;
+
+class Subsystem : public ErrorBase, public SendableBase {
+  friend class Scheduler;
+
+ public:
+  explicit Subsystem(const llvm::Twine& name);
+
+  void SetDefaultCommand(Command* command);
+  Command* GetDefaultCommand();
+  llvm::StringRef GetDefaultCommandName();
+  void SetCurrentCommand(Command* command);
+  Command* GetCurrentCommand() const;
+  llvm::StringRef GetCurrentCommandName() const;
+  virtual void Periodic();
+  virtual void InitDefaultCommand();
+
+  void AddChild(const llvm::Twine& name, std::shared_ptr<Sendable> child);
+  void AddChild(const llvm::Twine& name, Sendable* child);
+  void AddChild(const llvm::Twine& name, Sendable& child);
+  void AddChild(std::shared_ptr<Sendable> child);
+  void AddChild(Sendable* child);
+  void AddChild(Sendable& child);
+
+ private:
+  void ConfirmCommand();
+
+  Command* m_currentCommand = nullptr;
+  bool m_currentCommandChanged = true;
+  Command* m_defaultCommand = nullptr;
+  bool m_initializedDefaultCommand = false;
+
+ public:
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/TimedCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/TimedCommand.h
new file mode 100644
index 0000000..e521093
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/TimedCommand.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+
+namespace frc {
+
+/**
+ * A TimedCommand will wait for a timeout before finishing.
+ *
+ * TimedCommand is used to execute a command for a given amount of time.
+ */
+class TimedCommand : public Command {
+ public:
+  TimedCommand(const llvm::Twine& name, double timeout);
+  explicit TimedCommand(double timeout);
+  virtual ~TimedCommand() = default;
+
+ protected:
+  bool IsFinished() override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitCommand.h
new file mode 100644
index 0000000..4a64580
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitCommand.h
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/Twine.h>
+
+#include "Commands/TimedCommand.h"
+
+namespace frc {
+
+class WaitCommand : public TimedCommand {
+ public:
+  explicit WaitCommand(double timeout);
+  WaitCommand(const llvm::Twine& name, double timeout);
+  virtual ~WaitCommand() = default;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitForChildren.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitForChildren.h
new file mode 100644
index 0000000..e5ee31d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitForChildren.h
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+
+namespace frc {
+
+class WaitForChildren : public Command {
+ public:
+  explicit WaitForChildren(double timeout);
+  WaitForChildren(const llvm::Twine& name, double timeout);
+  virtual ~WaitForChildren() = default;
+
+ protected:
+  virtual bool IsFinished();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitUntilCommand.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitUntilCommand.h
new file mode 100644
index 0000000..7813d6a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Commands/WaitUntilCommand.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/Twine.h>
+
+#include "Commands/Command.h"
+
+namespace frc {
+
+class WaitUntilCommand : public Command {
+ public:
+  explicit WaitUntilCommand(double time);
+  WaitUntilCommand(const llvm::Twine& name, double time);
+  virtual ~WaitUntilCommand() = default;
+
+ protected:
+  virtual bool IsFinished();
+
+ private:
+  double m_time;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Compressor.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Compressor.h
new file mode 100644
index 0000000..763d493
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Compressor.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/Types.h>
+
+#include "ErrorBase.h"
+#include "SensorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * Class for operating a compressor connected to a %PCM (Pneumatic Control
+ * Module).
+ *
+ * The PCM will automatically run in closed loop mode by default whenever a
+ * Solenoid object is created. For most cases, a Compressor object does not need
+ * to be instantiated or used in a robot program. This class is only required in
+ * cases where the robot program needs a more detailed status of the compressor
+ * or to enable/disable closed loop control.
+ *
+ * Note: you cannot operate the compressor directly from this class as doing so
+ * would circumvent the safety provided by using the pressure switch and closed
+ * loop control. You can only turn off closed loop control, thereby stopping
+ * the compressor from operating.
+ */
+class Compressor : public ErrorBase, public SendableBase {
+ public:
+  // Default PCM ID is 0
+  explicit Compressor(int pcmID = SensorBase::GetDefaultSolenoidModule());
+  ~Compressor() override = default;
+
+  void Start();
+  void Stop();
+  bool Enabled() const;
+
+  bool GetPressureSwitchValue() const;
+
+  double GetCompressorCurrent() const;
+
+  void SetClosedLoopControl(bool on);
+  bool GetClosedLoopControl() const;
+
+  bool GetCompressorCurrentTooHighFault() const;
+  bool GetCompressorCurrentTooHighStickyFault() const;
+  bool GetCompressorShortedStickyFault() const;
+  bool GetCompressorShortedFault() const;
+  bool GetCompressorNotConnectedStickyFault() const;
+  bool GetCompressorNotConnectedFault() const;
+  void ClearAllPCMStickyFaults();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  HAL_CompressorHandle m_compressorHandle;
+
+ private:
+  void SetCompressor(bool on);
+  int m_module;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Controller.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Controller.h
new file mode 100644
index 0000000..4c3753d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Controller.h
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+/**
+ * Interface for Controllers.
+ *
+ * Common interface for controllers. Controllers run control loops, the most
+ * common are PID controllers and their variants, but this includes anything
+ * that is controlling an actuator in a separate thread.
+ */
+class Controller {
+ public:
+  virtual ~Controller() = default;
+
+  /**
+   * Allows the control loop to run
+   */
+  virtual void Enable() = 0;
+
+  /**
+   * Stops the control loop from running until explicitly re-enabled by calling
+   * enable()
+   */
+  virtual void Disable() = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/ControllerPower.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ControllerPower.h
new file mode 100644
index 0000000..29b8a3d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ControllerPower.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <support/deprecated.h>
+
+namespace frc {
+
+class ControllerPower {
+ public:
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetInputVoltage();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetInputCurrent();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetVoltage3V3();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetCurrent3V3();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static bool GetEnabled3V3();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static int GetFaultCount3V3();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetVoltage5V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetCurrent5V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static bool GetEnabled5V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static int GetFaultCount5V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetVoltage6V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static double GetCurrent6V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static bool GetEnabled6V();
+  WPI_DEPRECATED("Use RobotController static class method")
+  static int GetFaultCount6V();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Counter.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Counter.h
new file mode 100644
index 0000000..9c0d0e5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Counter.h
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HAL/Counter.h>
+#include <HAL/Types.h>
+
+#include "AnalogTrigger.h"
+#include "CounterBase.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+class DigitalGlitchFilter;
+
+/**
+ * Class for counting the number of ticks on a digital input channel.
+ *
+ * This is a general purpose class for counting repetitive events. It can return
+ * the number of counts, the period of the most recent cycle, and detect when
+ * the signal being counted has stopped by supplying a maximum cycle time.
+ *
+ * All counters will immediately start counting - Reset() them if you need them
+ * to be zeroed before use.
+ */
+class Counter : public SensorBase, public CounterBase {
+ public:
+  enum Mode {
+    kTwoPulse = 0,
+    kSemiperiod = 1,
+    kPulseLength = 2,
+    kExternalDirection = 3
+  };
+
+  explicit Counter(Mode mode = kTwoPulse);
+  explicit Counter(int channel);
+  explicit Counter(DigitalSource* source);
+  explicit Counter(std::shared_ptr<DigitalSource> source);
+  explicit Counter(const AnalogTrigger& trigger);
+  Counter(EncodingType encodingType, DigitalSource* upSource,
+          DigitalSource* downSource, bool inverted);
+  Counter(EncodingType encodingType, std::shared_ptr<DigitalSource> upSource,
+          std::shared_ptr<DigitalSource> downSource, bool inverted);
+  ~Counter() override;
+
+  void SetUpSource(int channel);
+  void SetUpSource(AnalogTrigger* analogTrigger, AnalogTriggerType triggerType);
+  void SetUpSource(std::shared_ptr<AnalogTrigger> analogTrigger,
+                   AnalogTriggerType triggerType);
+  void SetUpSource(DigitalSource* source);
+  void SetUpSource(std::shared_ptr<DigitalSource> source);
+  void SetUpSource(DigitalSource& source);
+  void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
+  void ClearUpSource();
+
+  void SetDownSource(int channel);
+  void SetDownSource(AnalogTrigger* analogTrigger,
+                     AnalogTriggerType triggerType);
+  void SetDownSource(std::shared_ptr<AnalogTrigger> analogTrigger,
+                     AnalogTriggerType triggerType);
+  void SetDownSource(DigitalSource* source);
+  void SetDownSource(std::shared_ptr<DigitalSource> source);
+  void SetDownSource(DigitalSource& source);
+  void SetDownSourceEdge(bool risingEdge, bool fallingEdge);
+  void ClearDownSource();
+
+  void SetUpDownCounterMode();
+  void SetExternalDirectionMode();
+  void SetSemiPeriodMode(bool highSemiPeriod);
+  void SetPulseLengthMode(double threshold);
+
+  void SetReverseDirection(bool reverseDirection);
+
+  // CounterBase interface
+  int Get() const override;
+  void Reset() override;
+  double GetPeriod() const override;
+  void SetMaxPeriod(double maxPeriod) override;
+  void SetUpdateWhenEmpty(bool enabled);
+  bool GetStopped() const override;
+  bool GetDirection() const override;
+
+  void SetSamplesToAverage(int samplesToAverage);
+  int GetSamplesToAverage() const;
+  int GetFPGAIndex() const { return m_index; }
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  // Makes the counter count up.
+  std::shared_ptr<DigitalSource> m_upSource;
+
+  // Makes the counter count down.
+  std::shared_ptr<DigitalSource> m_downSource;
+
+  // The FPGA counter object
+  HAL_CounterHandle m_counter = HAL_kInvalidHandle;
+
+ private:
+  int m_index = 0;  // The index of this counter.
+
+  friend class DigitalGlitchFilter;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/CounterBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/CounterBase.h
new file mode 100644
index 0000000..6883341
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/CounterBase.h
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+/**
+ * Interface for counting the number of ticks on a digital input channel.
+ *
+ * Encoders, Gear tooth sensors, and counters should all subclass this so it can
+ * be used to build more advanced classes for control and driving.
+ *
+ * All counters will immediately start counting - Reset() them if you need them
+ * to be zeroed before use.
+ */
+class CounterBase {
+ public:
+  enum EncodingType { k1X, k2X, k4X };
+
+  virtual ~CounterBase() = default;
+  virtual int Get() const = 0;
+  virtual void Reset() = 0;
+  virtual double GetPeriod() const = 0;
+  virtual void SetMaxPeriod(double maxPeriod) = 0;
+  virtual bool GetStopped() const = 0;
+  virtual bool GetDirection() const = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DMC60.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DMC60.h
new file mode 100644
index 0000000..ca62a7e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DMC60.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Digilent DMC 60 Speed Controller.
+ */
+class DMC60 : public PWMSpeedController {
+ public:
+  explicit DMC60(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalGlitchFilter.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalGlitchFilter.h
new file mode 100644
index 0000000..55448d7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalGlitchFilter.h
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <array>
+
+#include <support/mutex.h>
+
+#include "DigitalSource.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+class Encoder;
+class Counter;
+
+/**
+ * Class to enable glitch filtering on a set of digital inputs.
+ *
+ * This class will manage adding and removing digital inputs from a FPGA glitch
+ * filter. The filter lets the user configure the time that an input must remain
+ * high or low before it is classified as high or low.
+ */
+class DigitalGlitchFilter : public SensorBase {
+ public:
+  DigitalGlitchFilter();
+  ~DigitalGlitchFilter() override;
+
+  void Add(DigitalSource* input);
+  void Add(Encoder* input);
+  void Add(Counter* input);
+
+  void Remove(DigitalSource* input);
+  void Remove(Encoder* input);
+  void Remove(Counter* input);
+
+  void SetPeriodCycles(int fpgaCycles);
+  void SetPeriodNanoSeconds(uint64_t nanoseconds);
+
+  int GetPeriodCycles();
+  uint64_t GetPeriodNanoSeconds();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  // Sets the filter for the input to be the requested index. A value of 0
+  // disables the filter, and the filter value must be between 1 and 3,
+  // inclusive.
+  void DoAdd(DigitalSource* input, int requested_index);
+
+  int m_channelIndex = -1;
+  static wpi::mutex m_mutex;
+  static std::array<bool, 3> m_filterAllocated;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalInput.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalInput.h
new file mode 100644
index 0000000..f00c1b3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalInput.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "DigitalSource.h"
+
+namespace frc {
+
+class DigitalGlitchFilter;
+
+/**
+ * Class to read a digital input.
+ *
+ * This class will read digital inputs and return the current value on the
+ * channel. Other devices such as encoders, gear tooth sensors, etc. that are
+ * implemented elsewhere will automatically allocate digital inputs and outputs
+ * as required. This class is only for devices like switches etc. that aren't
+ * implemented anywhere else.
+ */
+class DigitalInput : public DigitalSource {
+ public:
+  explicit DigitalInput(int channel);
+  ~DigitalInput() override;
+  bool Get() const;
+  int GetChannel() const override;
+
+  // Digital Source Interface
+  HAL_Handle GetPortHandleForRouting() const override;
+  AnalogTriggerType GetAnalogTriggerTypeForRouting() const override;
+  bool IsAnalogTrigger() const override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_channel;
+  HAL_DigitalHandle m_handle;
+
+  friend class DigitalGlitchFilter;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalOutput.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalOutput.h
new file mode 100644
index 0000000..7089ade
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalOutput.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/Types.h>
+
+#include "ErrorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * Class to write to digital outputs.
+ *
+ * Write values to the digital output channels. Other devices implemented
+ * elsewhere will allocate channels automatically so for those devices it
+ * shouldn't be done here.
+ */
+class DigitalOutput : public ErrorBase, public SendableBase {
+ public:
+  explicit DigitalOutput(int channel);
+  ~DigitalOutput() override;
+  void Set(bool value);
+  bool Get() const;
+  int GetChannel() const;
+  void Pulse(double length);
+  bool IsPulsing() const;
+  void SetPWMRate(double rate);
+  void EnablePWM(double initialDutyCycle);
+  void DisablePWM();
+  void UpdateDutyCycle(double dutyCycle);
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_channel;
+  HAL_DigitalHandle m_handle;
+  HAL_DigitalPWMHandle m_pwmGenerator;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalSource.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalSource.h
new file mode 100644
index 0000000..74bab0b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DigitalSource.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/Types.h>
+
+#include "InterruptableSensorBase.h"
+
+namespace frc {
+
+/**
+ * DigitalSource Interface.
+ *
+ * The DigitalSource represents all the possible inputs for a counter or a
+ * quadrature encoder. The source may be either a digital input or an analog
+ * input. If the caller just provides a channel, then a digital input will be
+ * constructed and freed when finished for the source. The source can either be
+ * a digital input or analog trigger but not both.
+ */
+class DigitalSource : public InterruptableSensorBase {
+ public:
+  virtual HAL_Handle GetPortHandleForRouting() const = 0;
+  virtual AnalogTriggerType GetAnalogTriggerTypeForRouting() const = 0;
+  virtual bool IsAnalogTrigger() const = 0;
+  virtual int GetChannel() const = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DoubleSolenoid.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DoubleSolenoid.h
new file mode 100644
index 0000000..9f2970e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DoubleSolenoid.h
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/Types.h>
+
+#include "SolenoidBase.h"
+
+namespace frc {
+
+/**
+ * DoubleSolenoid class for running 2 channels of high voltage Digital Output
+ * (PCM).
+ *
+ * The DoubleSolenoid class is typically used for pneumatics solenoids that
+ * have two positions controlled by two separate channels.
+ */
+class DoubleSolenoid : public SolenoidBase {
+ public:
+  enum Value { kOff, kForward, kReverse };
+
+  explicit DoubleSolenoid(int forwardChannel, int reverseChannel);
+  DoubleSolenoid(int moduleNumber, int forwardChannel, int reverseChannel);
+  ~DoubleSolenoid() override;
+  virtual void Set(Value value);
+  virtual Value Get() const;
+  bool IsFwdSolenoidBlackListed() const;
+  bool IsRevSolenoidBlackListed() const;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_forwardChannel;  // The forward channel on the module to control.
+  int m_reverseChannel;  // The reverse channel on the module to control.
+  int m_forwardMask;     // The mask for the forward channel.
+  int m_reverseMask;     // The mask for the reverse channel.
+  HAL_SolenoidHandle m_forwardHandle = HAL_kInvalidHandle;
+  HAL_SolenoidHandle m_reverseHandle = HAL_kInvalidHandle;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/DifferentialDrive.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/DifferentialDrive.h
new file mode 100644
index 0000000..afbdb66
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/DifferentialDrive.h
@@ -0,0 +1,132 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/raw_ostream.h>
+
+#include "Drive/RobotDriveBase.h"
+
+namespace frc {
+
+class SpeedController;
+
+/**
+ * A class for driving differential drive/skid-steer drive platforms such as
+ * the Kit of Parts drive base, "tank drive", or West Coast Drive.
+ *
+ * These drive bases typically have drop-center / skid-steer with two or more
+ * wheels per side (e.g., 6WD or 8WD). This class takes a SpeedController per
+ * side. For four and six motor drivetrains, construct and pass in
+ * SpeedControllerGroup instances as follows.
+ *
+ * Four motor drivetrain:
+ * @code{.cpp}
+ * class Robot {
+ *  public:
+ *   frc::Spark m_frontLeft{1};
+ *   frc::Spark m_rearLeft{2};
+ *   frc::SpeedControllerGroup m_left{m_frontLeft, m_rearLeft};
+ *
+ *   frc::Spark m_frontRight{3};
+ *   frc::Spark m_rearRight{4};
+ *   frc::SpeedControllerGroup m_right{m_frontRight, m_rearRight};
+ *
+ *   frc::DifferentialDrive m_drive{m_left, m_right};
+ * };
+ * @endcode
+ *
+ * Six motor drivetrain:
+ * @code{.cpp}
+ * class Robot {
+ *  public:
+ *   frc::Spark m_frontLeft{1};
+ *   frc::Spark m_midLeft{2};
+ *   frc::Spark m_rearLeft{3};
+ *   frc::SpeedControllerGroup m_left{m_frontLeft, m_midLeft, m_rearLeft};
+ *
+ *   frc::Spark m_frontRight{4};
+ *   frc::Spark m_midRight{5};
+ *   frc::Spark m_rearRight{6};
+ *   frc::SpeedControllerGroup m_right{m_frontRight, m_midRight, m_rearRight};
+ *
+ *   frc::DifferentialDrive m_drive{m_left, m_right};
+ * };
+ * @endcode
+ *
+ * A differential drive robot has left and right wheels separated by an
+ * arbitrary width.
+ *
+ * Drive base diagram:
+ * <pre>
+ * |_______|
+ * | |   | |
+ *   |   |
+ * |_|___|_|
+ * |       |
+ * </pre>
+ *
+ * Each Drive() function provides different inverse kinematic relations for a
+ * differential drive robot. Motor outputs for the right side are negated, so
+ * motor direction inversion by the user is usually unnecessary.
+ *
+ * This library uses the NED axes convention (North-East-Down as external
+ * reference in the world frame):
+ * http://www.nuclearprojects.com/ins/images/axis_big.png.
+ *
+ * The positive X axis points ahead, the positive Y axis points to the right,
+ * and the positive Z axis points down. Rotations follow the right-hand rule, so
+ * clockwise rotation around the Z axis is positive.
+ *
+ * Inputs smaller then 0.02 will be set to 0, and larger values will be scaled
+ * so that the full range is still used. This deadband value can be changed
+ * with SetDeadband().
+ *
+ * <p>RobotDrive porting guide:
+ * <br>TankDrive(double, double, bool) is equivalent to
+ * RobotDrive#TankDrive(double, double, bool) if a deadband of 0 is used.
+ * <br>ArcadeDrive(double, double, bool) is equivalent to
+ * RobotDrive#ArcadeDrive(double, double, bool) if a deadband of 0 is used
+ * and the the rotation input is inverted eg ArcadeDrive(y, -rotation, false)
+ * <br>CurvatureDrive(double, double, bool) is similar in concept to
+ * RobotDrive#Drive(double, double) with the addition of a quick turn
+ * mode. However, it is not designed to give exactly the same response.
+ */
+class DifferentialDrive : public RobotDriveBase {
+ public:
+  static constexpr double kDefaultQuickStopThreshold = 0.2;
+  static constexpr double kDefaultQuickStopAlpha = 0.1;
+
+  DifferentialDrive(SpeedController& leftMotor, SpeedController& rightMotor);
+  ~DifferentialDrive() override = default;
+
+  DifferentialDrive(const DifferentialDrive&) = delete;
+  DifferentialDrive& operator=(const DifferentialDrive&) = delete;
+
+  void ArcadeDrive(double xSpeed, double zRotation, bool squaredInputs = true);
+  void CurvatureDrive(double xSpeed, double zRotation, bool isQuickTurn);
+  void TankDrive(double leftSpeed, double rightSpeed,
+                 bool squaredInputs = true);
+
+  void SetQuickStopThreshold(double threshold);
+  void SetQuickStopAlpha(double alpha);
+
+  void StopMotor() override;
+  void GetDescription(llvm::raw_ostream& desc) const override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  SpeedController& m_leftMotor;
+  SpeedController& m_rightMotor;
+
+  double m_quickStopThreshold = kDefaultQuickStopThreshold;
+  double m_quickStopAlpha = kDefaultQuickStopAlpha;
+  double m_quickStopAccumulator = 0.0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/KilloughDrive.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/KilloughDrive.h
new file mode 100644
index 0000000..34844ed
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/KilloughDrive.h
@@ -0,0 +1,84 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/raw_ostream.h>
+
+#include "Drive/RobotDriveBase.h"
+#include "Drive/Vector2d.h"
+
+namespace frc {
+
+class SpeedController;
+
+/**
+ * A class for driving Killough drive platforms.
+ *
+ * Killough drives are triangular with one omni wheel on each corner.
+ *
+ * Drive base diagram:
+ * <pre>
+ *  /_____\
+ * / \   / \
+ *    \ /
+ *    ---
+ * </pre>
+ *
+ * Each Drive() function provides different inverse kinematic relations for a
+ * Killough drive. The default wheel vectors are parallel to their respective
+ * opposite sides, but can be overridden. See the constructor for more
+ * information.
+ *
+ * This library uses the NED axes convention (North-East-Down as external
+ * reference in the world frame):
+ * http://www.nuclearprojects.com/ins/images/axis_big.png.
+ *
+ * The positive X axis points ahead, the positive Y axis points right, and the
+ * and the positive Z axis points down. Rotations follow the right-hand rule, so
+ * clockwise rotation around the Z axis is positive.
+ */
+class KilloughDrive : public RobotDriveBase {
+ public:
+  static constexpr double kDefaultLeftMotorAngle = 60.0;
+  static constexpr double kDefaultRightMotorAngle = 120.0;
+  static constexpr double kDefaultBackMotorAngle = 270.0;
+
+  KilloughDrive(SpeedController& leftMotor, SpeedController& rightMotor,
+                SpeedController& backMotor);
+  KilloughDrive(SpeedController& leftMotor, SpeedController& rightMotor,
+                SpeedController& backMotor, double leftMotorAngle,
+                double rightMotorAngle, double backMotorAngle);
+  ~KilloughDrive() override = default;
+
+  KilloughDrive(const KilloughDrive&) = delete;
+  KilloughDrive& operator=(const KilloughDrive&) = delete;
+
+  void DriveCartesian(double ySpeed, double xSpeed, double zRotation,
+                      double gyroAngle = 0.0);
+  void DrivePolar(double magnitude, double angle, double zRotation);
+
+  void StopMotor() override;
+  void GetDescription(llvm::raw_ostream& desc) const override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  SpeedController& m_leftMotor;
+  SpeedController& m_rightMotor;
+  SpeedController& m_backMotor;
+
+  Vector2d m_leftVec;
+  Vector2d m_rightVec;
+  Vector2d m_backVec;
+
+  bool reported = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/MecanumDrive.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/MecanumDrive.h
new file mode 100644
index 0000000..46e45a9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/MecanumDrive.h
@@ -0,0 +1,93 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/raw_ostream.h>
+
+#include "Drive/RobotDriveBase.h"
+
+namespace frc {
+
+class SpeedController;
+
+/**
+ * A class for driving Mecanum drive platforms.
+ *
+ * Mecanum drives are rectangular with one wheel on each corner. Each wheel has
+ * rollers toed in 45 degrees toward the front or back. When looking at the
+ * wheels from the top, the roller axles should form an X across the robot.
+ *
+ * Drive base diagram:
+ * <pre>
+ * \\_______/
+ * \\ |   | /
+ *   |   |
+ * /_|___|_\\
+ * /       \\
+ * </pre>
+ *
+ * Each Drive() function provides different inverse kinematic relations for a
+ * Mecanum drive robot. Motor outputs for the right side are negated, so motor
+ * direction inversion by the user is usually unnecessary.
+ *
+ * This library uses the NED axes convention (North-East-Down as external
+ * reference in the world frame):
+ * http://www.nuclearprojects.com/ins/images/axis_big.png.
+ *
+ * The positive X axis points ahead, the positive Y axis points to the right,
+ * and the positive Z axis points down. Rotations follow the right-hand rule, so
+ * clockwise rotation around the Z axis is positive.
+ *
+ * Inputs smaller then 0.02 will be set to 0, and larger values will be scaled
+ * so that the full range is still used. This deadband value can be changed
+ * with SetDeadband().
+ *
+ * RobotDrive porting guide:
+ * <br>In MecanumDrive, the right side speed controllers are automatically
+ * inverted, while in RobotDrive, no speed controllers are automatically
+ * inverted.
+ * <br>DriveCartesian(double, double, double, double) is equivalent to
+ * RobotDrive#MecanumDrive_Cartesian(double, double, double, double)
+ * if a deadband of 0 is used, and the ySpeed and gyroAngle values are inverted
+ * compared to RobotDrive (eg DriveCartesian(xSpeed, -ySpeed, zRotation,
+ * -gyroAngle).
+ * <br>DrivePolar(double, double, double) is equivalent to
+ * RobotDrive#MecanumDrive_Polar(double, double, double) if a
+ * deadband of 0 is used.
+ */
+class MecanumDrive : public RobotDriveBase {
+ public:
+  MecanumDrive(SpeedController& frontLeftMotor, SpeedController& rearLeftMotor,
+               SpeedController& frontRightMotor,
+               SpeedController& rearRightMotor);
+  ~MecanumDrive() override = default;
+
+  MecanumDrive(const MecanumDrive&) = delete;
+  MecanumDrive& operator=(const MecanumDrive&) = delete;
+
+  void DriveCartesian(double x, double y, double rotation,
+                      double gyroAngle = 0.0);
+  void DrivePolar(double magnitude, double angle, double rotation);
+
+  void StopMotor() override;
+  void GetDescription(llvm::raw_ostream& desc) const override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  SpeedController& m_frontLeftMotor;
+  SpeedController& m_rearLeftMotor;
+  SpeedController& m_frontRightMotor;
+  SpeedController& m_rearRightMotor;
+
+  bool reported = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/RobotDriveBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/RobotDriveBase.h
new file mode 100644
index 0000000..aad36c1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/RobotDriveBase.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/raw_ostream.h>
+
+#include "MotorSafety.h"
+#include "MotorSafetyHelper.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+class SpeedController;
+
+/**
+ * Common base class for drive platforms.
+ */
+class RobotDriveBase : public MotorSafety, public SendableBase {
+ public:
+  /**
+   * The location of a motor on the robot for the purpose of driving.
+   */
+  enum MotorType {
+    kFrontLeft = 0,
+    kFrontRight = 1,
+    kRearLeft = 2,
+    kRearRight = 3,
+    kLeft = 0,
+    kRight = 1,
+    kBack = 2
+  };
+
+  RobotDriveBase();
+  ~RobotDriveBase() override = default;
+
+  RobotDriveBase(const RobotDriveBase&) = delete;
+  RobotDriveBase& operator=(const RobotDriveBase&) = delete;
+
+  void SetDeadband(double deadband);
+  void SetMaxOutput(double maxOutput);
+
+  void SetExpiration(double timeout) override;
+  double GetExpiration() const override;
+  bool IsAlive() const override;
+  void StopMotor() override = 0;
+  bool IsSafetyEnabled() const override;
+  void SetSafetyEnabled(bool enabled) override;
+  void GetDescription(llvm::raw_ostream& desc) const override = 0;
+
+ protected:
+  double Limit(double number);
+  double ApplyDeadband(double number, double deadband);
+  void Normalize(llvm::MutableArrayRef<double> wheelSpeeds);
+
+  double m_deadband = 0.02;
+  double m_maxOutput = 1.0;
+  MotorSafetyHelper m_safetyHelper{this};
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/Vector2d.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/Vector2d.h
new file mode 100644
index 0000000..891670e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Drive/Vector2d.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+/**
+ * This is a 2D vector struct that supports basic vector operations.
+ */
+struct Vector2d {
+  Vector2d() = default;
+  Vector2d(double x, double y);
+
+  void Rotate(double angle);
+  double Dot(const Vector2d& vec) const;
+  double Magnitude() const;
+  double ScalarProject(const Vector2d& vec) const;
+
+  double x = 0.0;
+  double y = 0.0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/DriverStation.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DriverStation.h
new file mode 100644
index 0000000..9f9b1af
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/DriverStation.h
@@ -0,0 +1,183 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <array>
+#include <atomic>
+#include <memory>
+#include <string>
+#include <thread>
+
+#include <HAL/DriverStation.h>
+#include <llvm/Twine.h>
+#include <support/condition_variable.h>
+#include <support/deprecated.h>
+#include <support/mutex.h>
+
+#include "ErrorBase.h"
+#include "RobotState.h"
+
+namespace frc {
+
+struct MatchInfoData;
+class MatchDataSender;
+
+/**
+ * Provide access to the network communication data to / from the Driver
+ * Station.
+ */
+class DriverStation : public ErrorBase, public RobotStateInterface {
+ public:
+  enum Alliance { kRed, kBlue, kInvalid };
+  enum MatchType { kNone, kPractice, kQualification, kElimination };
+
+  ~DriverStation() override;
+  static DriverStation& GetInstance();
+  static void ReportError(const llvm::Twine& error);
+  static void ReportWarning(const llvm::Twine& error);
+  static void ReportError(bool isError, int code, const llvm::Twine& error,
+                          const llvm::Twine& location,
+                          const llvm::Twine& stack);
+
+  static constexpr int kJoystickPorts = 6;
+
+  bool GetStickButton(int stick, int button);
+  bool GetStickButtonPressed(int stick, int button);
+  bool GetStickButtonReleased(int stick, int button);
+
+  double GetStickAxis(int stick, int axis);
+  int GetStickPOV(int stick, int pov);
+  int GetStickButtons(int stick) const;
+
+  int GetStickAxisCount(int stick) const;
+  int GetStickPOVCount(int stick) const;
+  int GetStickButtonCount(int stick) const;
+
+  bool GetJoystickIsXbox(int stick) const;
+  int GetJoystickType(int stick) const;
+  std::string GetJoystickName(int stick) const;
+  int GetJoystickAxisType(int stick, int axis) const;
+
+  bool IsEnabled() const override;
+  bool IsDisabled() const override;
+  bool IsAutonomous() const override;
+  bool IsOperatorControl() const override;
+  bool IsTest() const override;
+  bool IsDSAttached() const;
+  bool IsNewControlData() const;
+  bool IsFMSAttached() const;
+  WPI_DEPRECATED("Use RobotController static class method")
+  bool IsSysActive() const;
+  WPI_DEPRECATED("Use RobotController static class method")
+  bool IsBrownedOut() const;
+
+  std::string GetGameSpecificMessage() const;
+  std::string GetEventName() const;
+  MatchType GetMatchType() const;
+  int GetMatchNumber() const;
+  int GetReplayNumber() const;
+
+  Alliance GetAlliance() const;
+  int GetLocation() const;
+  void WaitForData();
+  bool WaitForData(double timeout);
+  double GetMatchTime() const;
+  double GetBatteryVoltage() const;
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be
+   * executing for diagnostic purposes only.
+   *
+   * @param entering If true, starting disabled code; if false, leaving disabled
+   *                 code.
+   */
+  void InDisabled(bool entering) { m_userInDisabled = entering; }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be
+   * executing for diagnostic purposes only.
+   *
+   * @param entering If true, starting autonomous code; if false, leaving
+   *                 autonomous code.
+   */
+  void InAutonomous(bool entering) { m_userInAutonomous = entering; }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be
+   * executing for diagnostic purposes only.
+   *
+   * @param entering If true, starting teleop code; if false, leaving teleop
+   *                 code.
+   */
+  void InOperatorControl(bool entering) { m_userInTeleop = entering; }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be
+   * executing for diagnostic purposes only.
+   *
+   * @param entering If true, starting test code; if false, leaving test code.
+   */
+  void InTest(bool entering) { m_userInTest = entering; }
+
+ protected:
+  void GetData();
+
+ private:
+  DriverStation();
+
+  void ReportJoystickUnpluggedError(const llvm::Twine& message);
+  void ReportJoystickUnpluggedWarning(const llvm::Twine& message);
+  void Run();
+  void UpdateControlWord(bool force, HAL_ControlWord& controlWord) const;
+  void SendMatchData();
+
+  // Joystick User Data
+  std::unique_ptr<HAL_JoystickAxes[]> m_joystickAxes;
+  std::unique_ptr<HAL_JoystickPOVs[]> m_joystickPOVs;
+  std::unique_ptr<HAL_JoystickButtons[]> m_joystickButtons;
+  std::unique_ptr<HAL_JoystickDescriptor[]> m_joystickDescriptor;
+  std::unique_ptr<MatchInfoData> m_matchInfo;
+
+  // Joystick Cached Data
+  std::unique_ptr<HAL_JoystickAxes[]> m_joystickAxesCache;
+  std::unique_ptr<HAL_JoystickPOVs[]> m_joystickPOVsCache;
+  std::unique_ptr<HAL_JoystickButtons[]> m_joystickButtonsCache;
+  std::unique_ptr<HAL_JoystickDescriptor[]> m_joystickDescriptorCache;
+  std::unique_ptr<MatchInfoData> m_matchInfoCache;
+
+  std::unique_ptr<MatchDataSender> m_matchDataSender;
+
+  // Joystick button rising/falling edge flags
+  std::array<uint32_t, kJoystickPorts> m_joystickButtonsPressed;
+  std::array<uint32_t, kJoystickPorts> m_joystickButtonsReleased;
+
+  // Internal Driver Station thread
+  std::thread m_dsThread;
+  std::atomic<bool> m_isRunning{false};
+
+  wpi::mutex m_waitForDataMutex;
+  wpi::condition_variable m_waitForDataCond;
+  int m_waitForDataCounter;
+
+  mutable wpi::mutex m_cacheDataMutex;
+
+  // Robot state status variables
+  bool m_userInDisabled = false;
+  bool m_userInAutonomous = false;
+  bool m_userInTeleop = false;
+  bool m_userInTest = false;
+
+  // Control word variables
+  mutable HAL_ControlWord m_controlWordCache;
+  mutable std::chrono::steady_clock::time_point m_lastControlWordUpdate;
+  mutable wpi::mutex m_controlWordMutex;
+
+  double m_nextMessageTime = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Encoder.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Encoder.h
new file mode 100644
index 0000000..79ade49
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Encoder.h
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HAL/Encoder.h>
+
+#include "Counter.h"
+#include "CounterBase.h"
+#include "PIDSource.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+class DigitalSource;
+class DigitalGlitchFilter;
+
+/**
+ * Class to read quad encoders.
+ *
+ * Quadrature encoders are devices that count shaft rotation and can sense
+ * direction. The output of the QuadEncoder class is an integer that can count
+ * either up or down, and can go negative for reverse direction counting. When
+ * creating QuadEncoders, a direction is supplied that changes the sense of the
+ * output to make code more readable if the encoder is mounted such that forward
+ * movement generates negative values. Quadrature encoders have two digital
+ * outputs, an A Channel and a B Channel that are out of phase with each other
+ * to allow the FPGA to do direction sensing.
+ *
+ * All encoders will immediately start counting - Reset() them if you need them
+ * to be zeroed before use.
+ */
+class Encoder : public SensorBase, public CounterBase, public PIDSource {
+ public:
+  enum IndexingType {
+    kResetWhileHigh,
+    kResetWhileLow,
+    kResetOnFallingEdge,
+    kResetOnRisingEdge
+  };
+
+  Encoder(int aChannel, int bChannel, bool reverseDirection = false,
+          EncodingType encodingType = k4X);
+  Encoder(std::shared_ptr<DigitalSource> aSource,
+          std::shared_ptr<DigitalSource> bSource, bool reverseDirection = false,
+          EncodingType encodingType = k4X);
+  Encoder(DigitalSource* aSource, DigitalSource* bSource,
+          bool reverseDirection = false, EncodingType encodingType = k4X);
+  Encoder(DigitalSource& aSource, DigitalSource& bSource,
+          bool reverseDirection = false, EncodingType encodingType = k4X);
+  ~Encoder() override;
+
+  // CounterBase interface
+  int Get() const override;
+  int GetRaw() const;
+  int GetEncodingScale() const;
+  void Reset() override;
+  double GetPeriod() const override;
+  void SetMaxPeriod(double maxPeriod) override;
+  bool GetStopped() const override;
+  bool GetDirection() const override;
+
+  double GetDistance() const;
+  double GetRate() const;
+  void SetMinRate(double minRate);
+  void SetDistancePerPulse(double distancePerPulse);
+  double GetDistancePerPulse() const;
+  void SetReverseDirection(bool reverseDirection);
+  void SetSamplesToAverage(int samplesToAverage);
+  int GetSamplesToAverage() const;
+  double PIDGet() override;
+
+  void SetIndexSource(int channel, IndexingType type = kResetOnRisingEdge);
+  void SetIndexSource(const DigitalSource& source,
+                      IndexingType type = kResetOnRisingEdge);
+
+  void InitSendable(SendableBuilder& builder) override;
+
+  int GetFPGAIndex() const;
+
+ private:
+  void InitEncoder(bool reverseDirection, EncodingType encodingType);
+
+  double DecodingScaleFactor() const;
+
+  std::shared_ptr<DigitalSource> m_aSource;  // The A phase of the quad encoder
+  std::shared_ptr<DigitalSource> m_bSource;  // The B phase of the quad encoder
+  std::shared_ptr<DigitalSource> m_indexSource = nullptr;
+  HAL_EncoderHandle m_encoder = HAL_kInvalidHandle;
+
+  friend class DigitalGlitchFilter;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Error.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Error.h
new file mode 100644
index 0000000..532b2ab
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Error.h
@@ -0,0 +1,66 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <string>
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+
+#ifdef _WIN32
+#include <Windows.h>
+// Windows.h defines #define GetMessage GetMessageW, which we don't want.
+#undef GetMessage
+#endif
+
+#include "Base.h"
+
+namespace frc {
+
+class ErrorBase;
+
+/**
+ * Error object represents a library error.
+ */
+class Error {
+ public:
+  typedef int Code;
+
+  Error() = default;
+
+  Error(const Error&) = delete;
+  Error& operator=(const Error&) = delete;
+
+  void Clone(const Error& error);
+  Code GetCode() const;
+  std::string GetMessage() const;
+  std::string GetFilename() const;
+  std::string GetFunction() const;
+  int GetLineNumber() const;
+  const ErrorBase* GetOriginatingObject() const;
+  double GetTimestamp() const;
+  void Clear();
+  void Set(Code code, const llvm::Twine& contextMessage,
+           llvm::StringRef filename, llvm::StringRef function, int lineNumber,
+           const ErrorBase* originatingObject);
+
+ private:
+  void Report();
+
+  Code m_code = 0;
+  std::string m_message;
+  std::string m_filename;
+  std::string m_function;
+  int m_lineNumber = 0;
+  const ErrorBase* m_originatingObject = nullptr;
+  double m_timestamp = 0.0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/ErrorBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ErrorBase.h
new file mode 100644
index 0000000..5f510d5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/ErrorBase.h
@@ -0,0 +1,124 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+#include <support/mutex.h>
+
+#include "Base.h"
+#include "Error.h"
+
+#define wpi_setErrnoErrorWithContext(context) \
+  this->SetErrnoError((context), __FILE__, __FUNCTION__, __LINE__)
+#define wpi_setErrnoError() wpi_setErrnoErrorWithContext("")
+#define wpi_setImaqErrorWithContext(code, context)                             \
+  do {                                                                         \
+    if ((code) != 0)                                                           \
+      this->SetImaqError((code), (context), __FILE__, __FUNCTION__, __LINE__); \
+  } while (0)
+#define wpi_setErrorWithContext(code, context)                             \
+  do {                                                                     \
+    if ((code) != 0)                                                       \
+      this->SetError((code), (context), __FILE__, __FUNCTION__, __LINE__); \
+  } while (0)
+#define wpi_setErrorWithContextRange(code, min, max, req, context)          \
+  do {                                                                      \
+    if ((code) != 0)                                                        \
+      this->SetErrorRange((code), (min), (max), (req), (context), __FILE__, \
+                          __FUNCTION__, __LINE__);                          \
+  } while (0)
+#define wpi_setError(code) wpi_setErrorWithContext(code, "")
+#define wpi_setStaticErrorWithContext(object, code, context)                 \
+  do {                                                                       \
+    if ((code) != 0)                                                         \
+      object->SetError((code), (context), __FILE__, __FUNCTION__, __LINE__); \
+  } while (0)
+#define wpi_setStaticError(object, code) \
+  wpi_setStaticErrorWithContext(object, code, "")
+#define wpi_setGlobalErrorWithContext(code, context)                \
+  do {                                                              \
+    if ((code) != 0)                                                \
+      ::frc::ErrorBase::SetGlobalError((code), (context), __FILE__, \
+                                       __FUNCTION__, __LINE__);     \
+  } while (0)
+#define wpi_setGlobalError(code) wpi_setGlobalErrorWithContext(code, "")
+#define wpi_setWPIErrorWithContext(error, context)                    \
+  this->SetWPIError((wpi_error_s_##error), (wpi_error_value_##error), \
+                    (context), __FILE__, __FUNCTION__, __LINE__)
+#define wpi_setWPIError(error) (wpi_setWPIErrorWithContext(error, ""))
+#define wpi_setStaticWPIErrorWithContext(object, error, context)  \
+  object->SetWPIError((wpi_error_s_##error), (context), __FILE__, \
+                      __FUNCTION__, __LINE__)
+#define wpi_setStaticWPIError(object, error) \
+  wpi_setStaticWPIErrorWithContext(object, error, "")
+#define wpi_setGlobalWPIErrorWithContext(error, context)                \
+  ::frc::ErrorBase::SetGlobalWPIError((wpi_error_s_##error), (context), \
+                                      __FILE__, __FUNCTION__, __LINE__)
+#define wpi_setGlobalWPIError(error) wpi_setGlobalWPIErrorWithContext(error, "")
+
+namespace frc {
+
+/**
+ * Base class for most objects.
+ *
+ * ErrorBase is the base class for most objects since it holds the generated
+ * error for that object. In addition, there is a single instance of a global
+ * error object.
+ */
+class ErrorBase {
+  // TODO: Consider initializing instance variables and cleanup in destructor
+ public:
+  ErrorBase();
+  virtual ~ErrorBase() = default;
+
+  ErrorBase(const ErrorBase&) = delete;
+  ErrorBase& operator=(const ErrorBase&) = delete;
+
+  virtual Error& GetError();
+  virtual const Error& GetError() const;
+  virtual void SetErrnoError(const llvm::Twine& contextMessage,
+                             llvm::StringRef filename, llvm::StringRef function,
+                             int lineNumber) const;
+  virtual void SetImaqError(int success, const llvm::Twine& contextMessage,
+                            llvm::StringRef filename, llvm::StringRef function,
+                            int lineNumber) const;
+  virtual void SetError(Error::Code code, const llvm::Twine& contextMessage,
+                        llvm::StringRef filename, llvm::StringRef function,
+                        int lineNumber) const;
+  virtual void SetErrorRange(Error::Code code, int32_t minRange,
+                             int32_t maxRange, int32_t requestedValue,
+                             const llvm::Twine& contextMessage,
+                             llvm::StringRef filename, llvm::StringRef function,
+                             int lineNumber) const;
+  virtual void SetWPIError(const llvm::Twine& errorMessage, Error::Code code,
+                           const llvm::Twine& contextMessage,
+                           llvm::StringRef filename, llvm::StringRef function,
+                           int lineNumber) const;
+  virtual void CloneError(const ErrorBase& rhs) const;
+  virtual void ClearError() const;
+  virtual bool StatusIsFatal() const;
+  static void SetGlobalError(Error::Code code,
+                             const llvm::Twine& contextMessage,
+                             llvm::StringRef filename, llvm::StringRef function,
+                             int lineNumber);
+  static void SetGlobalWPIError(const llvm::Twine& errorMessage,
+                                const llvm::Twine& contextMessage,
+                                llvm::StringRef filename,
+                                llvm::StringRef function, int lineNumber);
+  static Error& GetGlobalError();
+
+ protected:
+  mutable Error m_error;
+
+  // TODO: Replace globalError with a global list of all errors.
+  static wpi::mutex _globalErrorMutex;
+  static Error _globalError;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Filters/Filter.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Filters/Filter.h
new file mode 100644
index 0000000..3168c5e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Filters/Filter.h
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include "PIDSource.h"
+
+namespace frc {
+
+/**
+ * Interface for filters
+ */
+class Filter : public PIDSource {
+ public:
+  explicit Filter(PIDSource& source);
+  explicit Filter(std::shared_ptr<PIDSource> source);
+  virtual ~Filter() = default;
+
+  // PIDSource interface
+  void SetPIDSourceType(PIDSourceType pidSource) override;
+  PIDSourceType GetPIDSourceType() const override;
+  double PIDGet() override = 0;
+
+  /**
+   * Returns the current filter estimate without also inserting new data as
+   * PIDGet() would do.
+   *
+   * @return The current filter estimate
+   */
+  virtual double Get() const = 0;
+
+  /**
+   * Reset the filter state
+   */
+  virtual void Reset() = 0;
+
+ protected:
+  /**
+   * Calls PIDGet() of source
+   *
+   * @return Current value of source
+   */
+  double PIDGetSource();
+
+ private:
+  std::shared_ptr<PIDSource> m_source;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Filters/LinearDigitalFilter.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Filters/LinearDigitalFilter.h
new file mode 100644
index 0000000..0e265a9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Filters/LinearDigitalFilter.h
@@ -0,0 +1,105 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+
+#include "Filter.h"
+#include "circular_buffer.h"
+
+namespace frc {
+
+/**
+ * This class implements a linear, digital filter. All types of FIR and IIR
+ * filters are supported. Static factory methods are provided to create commonly
+ * used types of filters.
+ *
+ * Filters are of the form:<br>
+ *  y[n] = (b0 * x[n] + b1 * x[n-1] + … + bP * x[n-P]) -
+ *         (a0 * y[n-1] + a2 * y[n-2] + … + aQ * y[n-Q])
+ *
+ * Where:<br>
+ *  y[n] is the output at time "n"<br>
+ *  x[n] is the input at time "n"<br>
+ *  y[n-1] is the output from the LAST time step ("n-1")<br>
+ *  x[n-1] is the input from the LAST time step ("n-1")<br>
+ *  b0 … bP are the "feedforward" (FIR) gains<br>
+ *  a0 … aQ are the "feedback" (IIR) gains<br>
+ * IMPORTANT! Note the "-" sign in front of the feedback term! This is a common
+ *            convention in signal processing.
+ *
+ * What can linear filters do? Basically, they can filter, or diminish, the
+ * effects of undesirable input frequencies. High frequencies, or rapid changes,
+ * can be indicative of sensor noise or be otherwise undesirable. A "low pass"
+ * filter smooths out the signal, reducing the impact of these high frequency
+ * components.  Likewise, a "high pass" filter gets rid of slow-moving signal
+ * components, letting you detect large changes more easily.
+ *
+ * Example FRC applications of filters:
+ *  - Getting rid of noise from an analog sensor input (note: the roboRIO's FPGA
+ *    can do this faster in hardware)
+ *  - Smoothing out joystick input to prevent the wheels from slipping or the
+ *    robot from tipping
+ *  - Smoothing motor commands so that unnecessary strain isn't put on
+ *    electrical or mechanical components
+ *  - If you use clever gains, you can make a PID controller out of this class!
+ *
+ * For more on filters, I highly recommend the following articles:<br>
+ *  http://en.wikipedia.org/wiki/Linear_filter<br>
+ *  http://en.wikipedia.org/wiki/Iir_filter<br>
+ *  http://en.wikipedia.org/wiki/Fir_filter<br>
+ *
+ * Note 1: PIDGet() should be called by the user on a known, regular period.
+ * You can set up a Notifier to do this (look at the WPILib PIDController
+ * class), or do it "inline" with code in a periodic function.
+ *
+ * Note 2: For ALL filters, gains are necessarily a function of frequency. If
+ * you make a filter that works well for you at, say, 100Hz, you will most
+ * definitely need to adjust the gains if you then want to run it at 200Hz!
+ * Combining this with Note 1 - the impetus is on YOU as a developer to make
+ * sure PIDGet() gets called at the desired, constant frequency!
+ */
+class LinearDigitalFilter : public Filter {
+ public:
+  LinearDigitalFilter(PIDSource& source, llvm::ArrayRef<double> ffGains,
+                      llvm::ArrayRef<double> fbGains);
+  LinearDigitalFilter(std::shared_ptr<PIDSource> source,
+                      llvm::ArrayRef<double> ffGains,
+                      llvm::ArrayRef<double> fbGains);
+
+  // Static methods to create commonly used filters
+  static LinearDigitalFilter SinglePoleIIR(PIDSource& source,
+                                           double timeConstant, double period);
+  static LinearDigitalFilter HighPass(PIDSource& source, double timeConstant,
+                                      double period);
+  static LinearDigitalFilter MovingAverage(PIDSource& source, int taps);
+  static LinearDigitalFilter SinglePoleIIR(std::shared_ptr<PIDSource> source,
+                                           double timeConstant, double period);
+  static LinearDigitalFilter HighPass(std::shared_ptr<PIDSource> source,
+                                      double timeConstant, double period);
+  static LinearDigitalFilter MovingAverage(std::shared_ptr<PIDSource> source,
+                                           int taps);
+
+  // Filter interface
+  double Get() const override;
+  void Reset() override;
+
+  // PIDSource interface
+  double PIDGet() override;
+
+ private:
+  circular_buffer<double> m_inputs;
+  circular_buffer<double> m_outputs;
+  std::vector<double> m_inputGains;
+  std::vector<double> m_outputGains;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/GamepadBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GamepadBase.h
new file mode 100644
index 0000000..ba2ca57
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GamepadBase.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <support/deprecated.h>
+
+#include "GenericHID.h"
+
+namespace frc {
+
+/**
+ * Gamepad Interface.
+ */
+class WPI_DEPRECATED("Inherit directly from GenericHID instead.") GamepadBase
+    : public GenericHID {
+ public:
+  explicit GamepadBase(int port);
+  virtual ~GamepadBase() = default;
+
+  virtual bool GetBumper(JoystickHand hand = kRightHand) const = 0;
+  virtual bool GetStickButton(JoystickHand hand) const = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/GearTooth.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GearTooth.h
new file mode 100644
index 0000000..4c26074
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GearTooth.h
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include "Counter.h"
+
+namespace frc {
+
+/**
+ * Alias for counter class.
+ *
+ * Implements the gear tooth sensor supplied by FIRST. Currently there is no
+ * reverse sensing on the gear tooth sensor, but in future versions we might
+ * implement the necessary timing in the FPGA to sense direction.
+ */
+class GearTooth : public Counter {
+ public:
+  // 55 uSec for threshold
+  static constexpr double kGearToothThreshold = 55e-6;
+
+  explicit GearTooth(int channel, bool directionSensitive = false);
+  explicit GearTooth(DigitalSource* source, bool directionSensitive = false);
+  explicit GearTooth(std::shared_ptr<DigitalSource> source,
+                     bool directionSensitive = false);
+
+  void EnableDirectionSensing(bool directionSensitive);
+
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/GenericHID.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GenericHID.h
new file mode 100644
index 0000000..6a05ada
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GenericHID.h
@@ -0,0 +1,84 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <string>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+class DriverStation;
+
+/**
+ * GenericHID Interface.
+ */
+class GenericHID : public ErrorBase {
+ public:
+  enum RumbleType { kLeftRumble, kRightRumble };
+
+  enum HIDType {
+    kUnknown = -1,
+    kXInputUnknown = 0,
+    kXInputGamepad = 1,
+    kXInputWheel = 2,
+    kXInputArcadeStick = 3,
+    kXInputFlightStick = 4,
+    kXInputDancePad = 5,
+    kXInputGuitar = 6,
+    kXInputGuitar2 = 7,
+    kXInputDrumKit = 8,
+    kXInputGuitar3 = 11,
+    kXInputArcadePad = 19,
+    kHIDJoystick = 20,
+    kHIDGamepad = 21,
+    kHIDDriving = 22,
+    kHIDFlight = 23,
+    kHID1stPerson = 24
+  };
+
+  enum JoystickHand { kLeftHand = 0, kRightHand = 1 };
+
+  explicit GenericHID(int port);
+  virtual ~GenericHID() = default;
+
+  virtual double GetX(JoystickHand hand = kRightHand) const = 0;
+  virtual double GetY(JoystickHand hand = kRightHand) const = 0;
+
+  bool GetRawButton(int button) const;
+  bool GetRawButtonPressed(int button);
+  bool GetRawButtonReleased(int button);
+
+  double GetRawAxis(int axis) const;
+  int GetPOV(int pov = 0) const;
+
+  int GetAxisCount() const;
+  int GetPOVCount() const;
+  int GetButtonCount() const;
+
+  GenericHID::HIDType GetType() const;
+  std::string GetName() const;
+  int GetAxisType(int axis) const;
+
+  int GetPort() const;
+
+  void SetOutput(int outputNumber, bool value);
+  void SetOutputs(int value);
+  void SetRumble(RumbleType type, double value);
+
+ private:
+  DriverStation& m_ds;
+  int m_port;
+  int m_outputs = 0;
+  uint16_t m_leftRumble = 0;
+  uint16_t m_rightRumble = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/GyroBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GyroBase.h
new file mode 100644
index 0000000..ddd561f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/GyroBase.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PIDSource.h"
+#include "SensorBase.h"
+#include "interfaces/Gyro.h"
+
+namespace frc {
+
+/**
+ * GyroBase is the common base class for Gyro implementations such as
+ * AnalogGyro.
+ */
+class GyroBase : public Gyro, public SensorBase, public PIDSource {
+ public:
+  // PIDSource interface
+  double PIDGet() override;
+
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/HLUsageReporting.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/HLUsageReporting.h
new file mode 100644
index 0000000..74a70ac
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/HLUsageReporting.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2017 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+class HLUsageReportingInterface {
+ public:
+  virtual ~HLUsageReportingInterface() = default;
+  virtual void ReportScheduler() = 0;
+  virtual void ReportSmartDashboard() = 0;
+};
+
+class HLUsageReporting {
+ private:
+  static HLUsageReportingInterface* impl;
+
+ public:
+  static void SetImplementation(HLUsageReportingInterface* i);
+  static void ReportScheduler();
+  static void ReportSmartDashboard();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/I2C.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/I2C.h
new file mode 100644
index 0000000..51631e8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/I2C.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include "ErrorBase.h"
+
+enum HAL_I2CPort : int32_t;
+
+namespace frc {
+
+/**
+ * I2C bus interface class.
+ *
+ * This class is intended to be used by sensor (and other I2C device) drivers.
+ * It probably should not be used directly.
+ */
+class I2C : public ErrorBase {
+ public:
+  enum Port { kOnboard = 0, kMXP };
+
+  I2C(Port port, int deviceAddress);
+  ~I2C() override;
+
+  I2C(const I2C&) = delete;
+  I2C& operator=(const I2C&) = delete;
+
+  bool Transaction(uint8_t* dataToSend, int sendSize, uint8_t* dataReceived,
+                   int receiveSize);
+  bool AddressOnly();
+  bool Write(int registerAddress, uint8_t data);
+  bool WriteBulk(uint8_t* data, int count);
+  bool Read(int registerAddress, int count, uint8_t* data);
+  bool ReadOnly(int count, uint8_t* buffer);
+  bool VerifySensor(int registerAddress, int count, const uint8_t* expected);
+
+ private:
+  HAL_I2CPort m_port;
+  int m_deviceAddress;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Internal/HardwareHLReporting.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Internal/HardwareHLReporting.h
new file mode 100644
index 0000000..aef69bc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Internal/HardwareHLReporting.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "HLUsageReporting.h"
+
+namespace frc {
+
+class HardwareHLReporting : public HLUsageReportingInterface {
+ public:
+  virtual void ReportScheduler();
+  virtual void ReportSmartDashboard();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/InterruptableSensorBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/InterruptableSensorBase.h
new file mode 100644
index 0000000..267353a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/InterruptableSensorBase.h
@@ -0,0 +1,64 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/Interrupts.h>
+
+#include "AnalogTriggerType.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+class InterruptableSensorBase : public SensorBase {
+ public:
+  enum WaitResult {
+    kTimeout = 0x0,
+    kRisingEdge = 0x1,
+    kFallingEdge = 0x100,
+    kBoth = 0x101,
+  };
+
+  InterruptableSensorBase() = default;
+
+  virtual HAL_Handle GetPortHandleForRouting() const = 0;
+  virtual AnalogTriggerType GetAnalogTriggerTypeForRouting() const = 0;
+
+  // Asynchronous handler version.
+  virtual void RequestInterrupts(HAL_InterruptHandlerFunction handler,
+                                 void* param);
+
+  // Synchronous wait version.
+  virtual void RequestInterrupts();
+
+  // Free up the underlying ChipObject functions.
+  virtual void CancelInterrupts();
+
+  // Synchronous version.
+  virtual WaitResult WaitForInterrupt(double timeout,
+                                      bool ignorePrevious = true);
+
+  // Enable interrupts - after finishing setup.
+  virtual void EnableInterrupts();
+
+  // Disable, but don't deallocate.
+  virtual void DisableInterrupts();
+
+  // Return the timestamp for the rising interrupt that occurred.
+  virtual double ReadRisingTimestamp();
+
+  // Return the timestamp for the falling interrupt that occurred.
+  virtual double ReadFallingTimestamp();
+
+  virtual void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
+
+ protected:
+  HAL_InterruptHandle m_interrupt = HAL_kInvalidHandle;
+  void AllocateInterrupts(bool watcher);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/IterativeRobot.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/IterativeRobot.h
new file mode 100644
index 0000000..e677937
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/IterativeRobot.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "IterativeRobotBase.h"
+
+namespace frc {
+
+/**
+ * IterativeRobot implements the IterativeRobotBase robot program framework.
+ *
+ * The IterativeRobot class is intended to be subclassed by a user creating a
+ * robot program.
+ *
+ * Periodic() functions from the base class are called each time a new packet is
+ * received from the driver station.
+ */
+class IterativeRobot : public IterativeRobotBase {
+ public:
+  IterativeRobot();
+  virtual ~IterativeRobot() = default;
+
+  void StartCompetition() override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/IterativeRobotBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/IterativeRobotBase.h
new file mode 100644
index 0000000..173a4c0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/IterativeRobotBase.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "RobotBase.h"
+
+namespace frc {
+
+/**
+ * IterativeRobotBase implements a specific type of robot program framework,
+ * extending the RobotBase class.
+ *
+ * The IterativeRobotBase class does not implement StartCompetition(), so it
+ * should not be used by teams directly.
+ *
+ * This class provides the following functions which are called by the main
+ * loop, StartCompetition(), at the appropriate times:
+ *
+ * RobotInit() -- provide for initialization at robot power-on
+ *
+ * Init() functions -- each of the following functions is called once when the
+ *                     appropriate mode is entered:
+ *   - DisabledInit()   -- called only when first disabled
+ *   - AutonomousInit() -- called each and every time autonomous is entered from
+ *                         another mode
+ *   - TeleopInit()     -- called each and every time teleop is entered from
+ *                         another mode
+ *   - TestInit()       -- called each and every time test is entered from
+ *                         another mode
+ *
+ * Periodic() functions -- each of these functions is called on an interval:
+ *   - RobotPeriodic()
+ *   - DisabledPeriodic()
+ *   - AutonomousPeriodic()
+ *   - TeleopPeriodic()
+ *   - TestPeriodic()
+ */
+class IterativeRobotBase : public RobotBase {
+ public:
+  virtual void RobotInit();
+  virtual void DisabledInit();
+  virtual void AutonomousInit();
+  virtual void TeleopInit();
+  virtual void TestInit();
+
+  virtual void RobotPeriodic();
+  virtual void DisabledPeriodic();
+  virtual void AutonomousPeriodic();
+  virtual void TeleopPeriodic();
+  virtual void TestPeriodic();
+
+ protected:
+  virtual ~IterativeRobotBase() = default;
+
+  void LoopFunc();
+
+ private:
+  enum class Mode { kNone, kDisabled, kAutonomous, kTeleop, kTest };
+
+  Mode m_lastMode = Mode::kNone;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Jaguar.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Jaguar.h
new file mode 100644
index 0000000..bc85743
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Jaguar.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Luminary Micro / Vex Robotics Jaguar Speed Controller with PWM control.
+ */
+class Jaguar : public PWMSpeedController {
+ public:
+  explicit Jaguar(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Joystick.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Joystick.h
new file mode 100644
index 0000000..3ed257a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Joystick.h
@@ -0,0 +1,95 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <array>
+
+#include <support/deprecated.h>
+
+#include "GenericHID.h"
+
+namespace frc {
+
+/**
+ * Handle input from standard Joysticks connected to the Driver Station.
+ *
+ * This class handles standard input that comes from the Driver Station. Each
+ * time a value is requested the most recent value is returned. There is a
+ * single class instance for each joystick and the mapping of ports to hardware
+ * buttons depends on the code in the Driver Station.
+ */
+class Joystick : public GenericHID {
+ public:
+  static constexpr int kDefaultXAxis = 0;
+  static constexpr int kDefaultYAxis = 1;
+  static constexpr int kDefaultZAxis = 2;
+  static constexpr int kDefaultTwistAxis = 2;
+  static constexpr int kDefaultThrottleAxis = 3;
+
+  enum AxisType { kXAxis, kYAxis, kZAxis, kTwistAxis, kThrottleAxis };
+  enum ButtonType { kTriggerButton, kTopButton };
+
+  explicit Joystick(int port);
+  virtual ~Joystick() = default;
+
+  Joystick(const Joystick&) = delete;
+  Joystick& operator=(const Joystick&) = delete;
+
+  void SetXChannel(int channel);
+  void SetYChannel(int channel);
+  void SetZChannel(int channel);
+  void SetTwistChannel(int channel);
+  void SetThrottleChannel(int channel);
+
+  WPI_DEPRECATED("Use the more specific axis channel setter functions.")
+  void SetAxisChannel(AxisType axis, int channel);
+
+  int GetXChannel() const;
+  int GetYChannel() const;
+  int GetZChannel() const;
+  int GetTwistChannel() const;
+  int GetThrottleChannel() const;
+
+  WPI_DEPRECATED("Use the more specific axis channel getter functions.")
+  int GetAxisChannel(AxisType axis) const;
+
+  double GetX(JoystickHand hand = kRightHand) const override;
+  double GetY(JoystickHand hand = kRightHand) const override;
+  double GetZ() const;
+  double GetTwist() const;
+  double GetThrottle() const;
+
+  WPI_DEPRECATED("Use the more specific axis channel getter functions.")
+  double GetAxis(AxisType axis) const;
+
+  bool GetTrigger() const;
+  bool GetTriggerPressed();
+  bool GetTriggerReleased();
+
+  bool GetTop() const;
+  bool GetTopPressed();
+  bool GetTopReleased();
+
+  WPI_DEPRECATED("Use Joystick instances instead.")
+  static Joystick* GetStickForPort(int port);
+
+  WPI_DEPRECATED("Use the more specific button getter functions.")
+  bool GetButton(ButtonType button) const;
+
+  double GetMagnitude() const;
+  double GetDirectionRadians() const;
+  double GetDirectionDegrees() const;
+
+ private:
+  enum Axis { kX, kY, kZ, kTwist, kThrottle, kNumAxes };
+  enum Button { kTrigger = 1, kTop = 2 };
+
+  std::array<int, Axis::kNumAxes> m_axes;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/JoystickBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/JoystickBase.h
new file mode 100644
index 0000000..f936e3f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/JoystickBase.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <support/deprecated.h>
+
+#include "GenericHID.h"
+
+namespace frc {
+
+/**
+ * Joystick Interface.
+ */
+class WPI_DEPRECATED("Inherit directly from GenericHID instead.") JoystickBase
+    : public GenericHID {
+ public:
+  explicit JoystickBase(int port);
+  virtual ~JoystickBase() = default;
+
+  virtual double GetZ(JoystickHand hand = kRightHand) const = 0;
+  virtual double GetTwist() const = 0;
+  virtual double GetThrottle() const = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/LiveWindow/LiveWindow.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/LiveWindow/LiveWindow.h
new file mode 100644
index 0000000..56d6f85
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/LiveWindow/LiveWindow.h
@@ -0,0 +1,82 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2012-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/Twine.h>
+#include <support/deprecated.h>
+
+#include "SmartDashboard/Sendable.h"
+
+namespace frc {
+
+/**
+ * The LiveWindow class is the public interface for putting sensors and
+ * actuators on the LiveWindow.
+ */
+class LiveWindow {
+ public:
+  LiveWindow(const LiveWindow&) = delete;
+  LiveWindow& operator=(const LiveWindow&) = delete;
+
+  static LiveWindow* GetInstance();
+
+  WPI_DEPRECATED("no longer required")
+  void Run() { UpdateValues(); }
+
+  WPI_DEPRECATED("use Sendable::SetName() instead")
+  void AddSensor(const llvm::Twine& subsystem, const llvm::Twine& name,
+                 Sendable* component);
+  WPI_DEPRECATED("use Sendable::SetName() instead")
+  void AddSensor(const llvm::Twine& subsystem, const llvm::Twine& name,
+                 Sendable& component);
+  WPI_DEPRECATED("use Sendable::SetName() instead")
+  void AddSensor(const llvm::Twine& subsystem, const llvm::Twine& name,
+                 std::shared_ptr<Sendable> component);
+  WPI_DEPRECATED("use Sendable::SetName() instead")
+  void AddActuator(const llvm::Twine& subsystem, const llvm::Twine& name,
+                   Sendable* component);
+  WPI_DEPRECATED("use Sendable::SetName() instead")
+  void AddActuator(const llvm::Twine& subsystem, const llvm::Twine& name,
+                   Sendable& component);
+  WPI_DEPRECATED("use Sendable::SetName() instead")
+  void AddActuator(const llvm::Twine& subsystem, const llvm::Twine& name,
+                   std::shared_ptr<Sendable> component);
+
+  WPI_DEPRECATED("use SensorBase::SetName() instead")
+  void AddSensor(const llvm::Twine& type, int channel, Sendable* component);
+  WPI_DEPRECATED("use SensorBase::SetName() instead")
+  void AddActuator(const llvm::Twine& type, int channel, Sendable* component);
+  WPI_DEPRECATED("use SensorBase::SetName() instead")
+  void AddActuator(const llvm::Twine& type, int module, int channel,
+                   Sendable* component);
+
+  void Add(std::shared_ptr<Sendable> component);
+  void Add(Sendable* component);
+  void AddChild(Sendable* parent, std::shared_ptr<Sendable> component);
+  void AddChild(Sendable* parent, void* component);
+  void Remove(Sendable* component);
+
+  void EnableTelemetry(Sendable* component);
+  void DisableTelemetry(Sendable* component);
+  void DisableAllTelemetry();
+
+  bool IsEnabled() const;
+  void SetEnabled(bool enabled);
+
+  void UpdateValues();
+
+ private:
+  LiveWindow();
+
+  struct Impl;
+  std::unique_ptr<Impl> m_impl;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/LiveWindow/LiveWindowSendable.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/LiveWindow/LiveWindowSendable.h
new file mode 100644
index 0000000..101334a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/LiveWindow/LiveWindowSendable.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2012-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include <support/deprecated.h>
+
+#include "SmartDashboard/Sendable.h"
+
+namespace frc {
+
+/**
+ * Live Window Sendable is a special type of object sendable to the live window.
+ * @deprecated Use Sendable directly instead
+ */
+class WPI_DEPRECATED("use Sendable directly instead") LiveWindowSendable
+    : public Sendable {
+ public:
+  /**
+   * Update the table for this sendable object with the latest values.
+   */
+  virtual void UpdateTable() = 0;
+
+  /**
+   * Start having this sendable object automatically respond to value changes
+   * reflect the value on the table.
+   */
+  virtual void StartLiveWindowMode() = 0;
+
+  /**
+   * Stop having this sendable object automatically respond to value changes.
+   */
+  virtual void StopLiveWindowMode() = 0;
+
+  std::string GetName() const override;
+  void SetName(const llvm::Twine& name) override;
+  std::string GetSubsystem() const override;
+  void SetSubsystem(const llvm::Twine& subsystem) override;
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/MotorSafety.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/MotorSafety.h
new file mode 100644
index 0000000..37a7339
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/MotorSafety.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#define DEFAULT_SAFETY_EXPIRATION 0.1
+
+#include <llvm/raw_ostream.h>
+
+namespace frc {
+
+class MotorSafety {
+ public:
+  virtual void SetExpiration(double timeout) = 0;
+  virtual double GetExpiration() const = 0;
+  virtual bool IsAlive() const = 0;
+  virtual void StopMotor() = 0;
+  virtual void SetSafetyEnabled(bool enabled) = 0;
+  virtual bool IsSafetyEnabled() const = 0;
+  virtual void GetDescription(llvm::raw_ostream& desc) const = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/MotorSafetyHelper.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/MotorSafetyHelper.h
new file mode 100644
index 0000000..7e51818
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/MotorSafetyHelper.h
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <set>
+
+#include <support/mutex.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+class MotorSafety;
+
+class MotorSafetyHelper : public ErrorBase {
+ public:
+  explicit MotorSafetyHelper(MotorSafety* safeObject);
+  ~MotorSafetyHelper();
+  void Feed();
+  void SetExpiration(double expirationTime);
+  double GetExpiration() const;
+  bool IsAlive() const;
+  void Check();
+  void SetSafetyEnabled(bool enabled);
+  bool IsSafetyEnabled() const;
+  static void CheckMotors();
+
+ private:
+  // The expiration time for this object
+  double m_expiration;
+
+  // True if motor safety is enabled for this motor
+  bool m_enabled;
+
+  // The FPGA clock value when this motor has expired
+  double m_stopTime;
+
+  // Protect accesses to the state for this object
+  mutable wpi::mutex m_thisMutex;
+
+  // The object that is using the helper
+  MotorSafety* m_safeObject;
+
+  // List of all existing MotorSafetyHelper objects.
+  static std::set<MotorSafetyHelper*> m_helperList;
+
+  // Protect accesses to the list of helpers
+  static wpi::mutex m_listMutex;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/NidecBrushless.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/NidecBrushless.h
new file mode 100644
index 0000000..f228b93
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/NidecBrushless.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+
+#include "DigitalOutput.h"
+#include "ErrorBase.h"
+#include "MotorSafety.h"
+#include "MotorSafetyHelper.h"
+#include "PWM.h"
+#include "SmartDashboard/SendableBase.h"
+#include "SpeedController.h"
+
+namespace frc {
+
+/**
+ * Nidec Brushless Motor.
+ */
+class NidecBrushless : public ErrorBase,
+                       public SendableBase,
+                       public SpeedController,
+                       public MotorSafety {
+ public:
+  NidecBrushless(int pwmChannel, int dioChannel);
+  ~NidecBrushless() override = default;
+
+  // SpeedController interface
+  void Set(double speed) override;
+  double Get() const override;
+  void SetInverted(bool isInverted) override;
+  bool GetInverted() const override;
+  void Disable() override;
+  void StopMotor() override;
+
+  void Enable();
+
+  // PIDOutput interface
+  void PIDWrite(double output) override;
+
+  // MotorSafety interface
+  void SetExpiration(double timeout) override;
+  double GetExpiration() const override;
+  bool IsAlive() const override;
+  void SetSafetyEnabled(bool enabled) override;
+  bool IsSafetyEnabled() const override;
+  void GetDescription(llvm::raw_ostream& desc) const override;
+
+  int GetChannel() const;
+
+  // Sendable interface
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  MotorSafetyHelper m_safetyHelper;
+  bool m_isInverted = false;
+  std::atomic_bool m_disabled{false};
+  DigitalOutput m_dio;
+  PWM m_pwm;
+  double m_speed = 0.0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Notifier.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Notifier.h
new file mode 100644
index 0000000..02eaff1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Notifier.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <atomic>
+#include <functional>
+#include <thread>
+#include <utility>
+
+#include <HAL/Notifier.h>
+#include <support/mutex.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+typedef std::function<void()> TimerEventHandler;
+
+class Notifier : public ErrorBase {
+ public:
+  explicit Notifier(TimerEventHandler handler);
+
+  template <typename Callable, typename Arg, typename... Args>
+  Notifier(Callable&& f, Arg&& arg, Args&&... args)
+      : Notifier(std::bind(std::forward<Callable>(f), std::forward<Arg>(arg),
+                           std::forward<Args>(args)...)) {}
+
+  virtual ~Notifier();
+
+  Notifier(const Notifier&) = delete;
+  Notifier& operator=(const Notifier&) = delete;
+
+  void SetHandler(TimerEventHandler handler);
+  void StartSingle(double delay);
+  void StartPeriodic(double period);
+  void Stop();
+
+ private:
+  // update the HAL alarm
+  void UpdateAlarm();
+  // the thread waiting on the HAL alarm
+  std::thread m_thread;
+  // held while updating process information
+  wpi::mutex m_processMutex;
+  // HAL handle, atomic for proper destruction
+  std::atomic<HAL_NotifierHandle> m_notifier{0};
+
+  // Address of the handler
+  TimerEventHandler m_handler;
+
+  // The absolute expiration time
+  double m_expirationTime = 0;
+
+  // The relative time (either periodic or single)
+  double m_period = 0;
+
+  // True if this is a periodic event
+  bool m_periodic = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDController.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDController.h
new file mode 100644
index 0000000..7d8592a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDController.h
@@ -0,0 +1,176 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <support/deprecated.h>
+#include <support/mutex.h>
+
+#include "Base.h"
+#include "Controller.h"
+#include "Filters/LinearDigitalFilter.h"
+#include "Notifier.h"
+#include "PIDInterface.h"
+#include "PIDSource.h"
+#include "SmartDashboard/SendableBase.h"
+#include "Timer.h"
+
+namespace frc {
+
+class PIDOutput;
+
+/**
+ * Class implements a PID Control Loop.
+ *
+ * Creates a separate thread which reads the given PIDSource and takes care of
+ * the integral calculations, as well as writing the given PIDOutput.
+ *
+ * This feedback controller runs in discrete time, so time deltas are not used
+ * in the integral and derivative calculations. Therefore, the sample rate
+ * affects the controller's behavior for a given set of PID constants.
+ */
+class PIDController : public SendableBase, public PIDInterface {
+ public:
+  PIDController(double p, double i, double d, PIDSource* source,
+                PIDOutput* output, double period = 0.05);
+  PIDController(double p, double i, double d, double f, PIDSource* source,
+                PIDOutput* output, double period = 0.05);
+  PIDController(double p, double i, double d, PIDSource& source,
+                PIDOutput& output, double period = 0.05);
+  PIDController(double p, double i, double d, double f, PIDSource& source,
+                PIDOutput& output, double period = 0.05);
+  ~PIDController() override;
+
+  PIDController(const PIDController&) = delete;
+  PIDController& operator=(const PIDController) = delete;
+
+  virtual double Get() const;
+  virtual void SetContinuous(bool continuous = true);
+  virtual void SetInputRange(double minimumInput, double maximumInput);
+  virtual void SetOutputRange(double minimumOutput, double maximumOutput);
+  void SetPID(double p, double i, double d) override;
+  virtual void SetPID(double p, double i, double d, double f);
+  void SetP(double p);
+  void SetI(double i);
+  void SetD(double d);
+  void SetF(double f);
+  double GetP() const override;
+  double GetI() const override;
+  double GetD() const override;
+  virtual double GetF() const;
+
+  void SetSetpoint(double setpoint) override;
+  double GetSetpoint() const override;
+  double GetDeltaSetpoint() const;
+
+  virtual double GetError() const;
+
+  WPI_DEPRECATED("Use a LinearDigitalFilter as the input and GetError().")
+  virtual double GetAvgError() const;
+
+  virtual void SetPIDSourceType(PIDSourceType pidSource);
+  virtual PIDSourceType GetPIDSourceType() const;
+
+  WPI_DEPRECATED("Use SetPercentTolerance() instead.")
+  virtual void SetTolerance(double percent);
+  virtual void SetAbsoluteTolerance(double absValue);
+  virtual void SetPercentTolerance(double percentValue);
+
+  WPI_DEPRECATED("Use a LinearDigitalFilter as the input.")
+  virtual void SetToleranceBuffer(int buf = 1);
+
+  virtual bool OnTarget() const;
+
+  void Enable() override;
+  void Disable() override;
+  void SetEnabled(bool enable);
+  bool IsEnabled() const override;
+
+  void Reset() override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ protected:
+  PIDSource* m_pidInput;
+  PIDOutput* m_pidOutput;
+
+  virtual void Calculate();
+  virtual double CalculateFeedForward();
+  double GetContinuousError(double error) const;
+
+ private:
+  // Factor for "proportional" control
+  double m_P;
+
+  // Factor for "integral" control
+  double m_I;
+
+  // Factor for "derivative" control
+  double m_D;
+
+  // Factor for "feed forward" control
+  double m_F;
+
+  // |maximum output|
+  double m_maximumOutput = 1.0;
+
+  // |minimum output|
+  double m_minimumOutput = -1.0;
+
+  // Maximum input - limit setpoint to this
+  double m_maximumInput = 0;
+
+  // Minimum input - limit setpoint to this
+  double m_minimumInput = 0;
+
+  // input range - difference between maximum and minimum
+  double m_inputRange = 0;
+
+  // Do the endpoints wrap around? eg. Absolute encoder
+  bool m_continuous = false;
+
+  // Is the pid controller enabled
+  bool m_enabled = false;
+
+  // The prior error (used to compute velocity)
+  double m_prevError = 0;
+
+  // The sum of the errors for use in the integral calc
+  double m_totalError = 0;
+
+  enum {
+    kAbsoluteTolerance,
+    kPercentTolerance,
+    kNoTolerance
+  } m_toleranceType = kNoTolerance;
+
+  // The percetage or absolute error that is considered on target.
+  double m_tolerance = 0.05;
+
+  double m_setpoint = 0;
+  double m_prevSetpoint = 0;
+  double m_error = 0;
+  double m_result = 0;
+  double m_period;
+
+  std::shared_ptr<PIDSource> m_origSource;
+  LinearDigitalFilter m_filter{nullptr, {}, {}};
+
+  mutable wpi::mutex m_thisMutex;
+
+  // Ensures when Disable() is called, PIDWrite() won't run if Calculate()
+  // is already running at that time.
+  mutable wpi::mutex m_pidWriteMutex;
+
+  std::unique_ptr<Notifier> m_controlLoop;
+  Timer m_setpointTimer;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDInterface.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDInterface.h
new file mode 100644
index 0000000..cb56f1b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDInterface.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Base.h"
+#include "Controller.h"
+
+namespace frc {
+
+class PIDInterface : public Controller {
+  virtual void SetPID(double p, double i, double d) = 0;
+  virtual double GetP() const = 0;
+  virtual double GetI() const = 0;
+  virtual double GetD() const = 0;
+
+  virtual void SetSetpoint(double setpoint) = 0;
+  virtual double GetSetpoint() const = 0;
+
+  virtual void Enable() = 0;
+  virtual void Disable() = 0;
+  virtual bool IsEnabled() const = 0;
+
+  virtual void Reset() = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDOutput.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDOutput.h
new file mode 100644
index 0000000..5bc9210
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDOutput.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Base.h"
+
+namespace frc {
+
+/**
+ * PIDOutput interface is a generic output for the PID class.
+ *
+ * PWMs use this class. Users implement this interface to allow for a
+ * PIDController to read directly from the inputs.
+ */
+class PIDOutput {
+ public:
+  virtual void PIDWrite(double output) = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDSource.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDSource.h
new file mode 100644
index 0000000..c4227fd
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PIDSource.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+enum class PIDSourceType { kDisplacement, kRate };
+
+/**
+ * PIDSource interface is a generic sensor source for the PID class.
+ *
+ * All sensors that can be used with the PID class will implement the PIDSource
+ * that returns a standard value that will be used in the PID code.
+ */
+class PIDSource {
+ public:
+  virtual void SetPIDSourceType(PIDSourceType pidSource);
+  virtual PIDSourceType GetPIDSourceType() const;
+  virtual double PIDGet() = 0;
+
+ protected:
+  PIDSourceType m_pidSource = PIDSourceType::kDisplacement;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWM.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWM.h
new file mode 100644
index 0000000..325e67d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWM.h
@@ -0,0 +1,84 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <HAL/Types.h>
+
+#include "ErrorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * Class implements the PWM generation in the FPGA.
+ *
+ * The values supplied as arguments for PWM outputs range from -1.0 to 1.0. They
+ * are mapped to the hardware dependent values, in this case 0-2000 for the
+ * FPGA. Changes are immediately sent to the FPGA, and the update occurs at the
+ * next FPGA cycle (5.005ms). There is no delay.
+ *
+ * As of revision 0.1.10 of the FPGA, the FPGA interprets the 0-2000 values as
+ * follows:
+ *   - 2000 = maximum pulse width
+ *   - 1999 to 1001 = linear scaling from "full forward" to "center"
+ *   - 1000 = center value
+ *   - 999 to 2 = linear scaling from "center" to "full reverse"
+ *   - 1 = minimum pulse width (currently .5ms)
+ *   - 0 = disabled (i.e. PWM output is held low)
+ */
+class PWM : public ErrorBase, public SendableBase {
+ public:
+  /**
+   * Represents the amount to multiply the minimum servo-pulse pwm period by.
+   */
+  enum PeriodMultiplier {
+    /**
+     * Don't skip pulses. PWM pulses occur every 5.005 ms
+     */
+    kPeriodMultiplier_1X = 1,
+    /**
+     * Skip every other pulse. PWM pulses occur every 10.010 ms
+     */
+    kPeriodMultiplier_2X = 2,
+    /**
+     * Skip three out of four pulses. PWM pulses occur every 20.020 ms
+     */
+    kPeriodMultiplier_4X = 4
+  };
+
+  explicit PWM(int channel);
+  ~PWM() override;
+  virtual void SetRaw(uint16_t value);
+  virtual uint16_t GetRaw() const;
+  virtual void SetPosition(double pos);
+  virtual double GetPosition() const;
+  virtual void SetSpeed(double speed);
+  virtual double GetSpeed() const;
+  virtual void SetDisabled();
+  void SetPeriodMultiplier(PeriodMultiplier mult);
+  void SetZeroLatch();
+  void EnableDeadbandElimination(bool eliminateDeadband);
+  void SetBounds(double max, double deadbandMax, double center,
+                 double deadbandMin, double min);
+  void SetRawBounds(int max, int deadbandMax, int center, int deadbandMin,
+                    int min);
+  void GetRawBounds(int32_t* max, int32_t* deadbandMax, int32_t* center,
+                    int32_t* deadbandMin, int32_t* min);
+  int GetChannel() const { return m_channel; }
+
+ protected:
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_channel;
+  HAL_DigitalHandle m_handle;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMSpeedController.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMSpeedController.h
new file mode 100644
index 0000000..5647095
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMSpeedController.h
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SafePWM.h"
+#include "SpeedController.h"
+
+namespace frc {
+
+/**
+ * Common base class for all PWM Speed Controllers.
+ */
+class PWMSpeedController : public SafePWM, public SpeedController {
+ public:
+  void Set(double value) override;
+  double Get() const override;
+  void SetInverted(bool isInverted) override;
+  bool GetInverted() const override;
+  void Disable() override;
+  void StopMotor() override;
+
+  void PIDWrite(double output) override;
+
+ protected:
+  explicit PWMSpeedController(int channel);
+
+ private:
+  bool m_isInverted = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMTalonSRX.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMTalonSRX.h
new file mode 100644
index 0000000..2b92e0c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMTalonSRX.h
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Cross the Road Electronics (CTRE) Talon SRX Speed Controller with PWM
+ * control.
+ */
+class PWMTalonSRX : public PWMSpeedController {
+ public:
+  explicit PWMTalonSRX(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMVictorSPX.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMVictorSPX.h
new file mode 100644
index 0000000..0fd5f9f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PWMVictorSPX.h
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Cross the Road Electronics (CTRE) Victor SPX Speed Controller with PWM
+ * control.
+ */
+class PWMVictorSPX : public PWMSpeedController {
+ public:
+  explicit PWMVictorSPX(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/PowerDistributionPanel.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PowerDistributionPanel.h
new file mode 100644
index 0000000..b2576b2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/PowerDistributionPanel.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SensorBase.h"
+
+namespace frc {
+
+/**
+ * Class for getting voltage, current, temperature, power and energy from the
+ * CAN PDP.
+ */
+class PowerDistributionPanel : public SensorBase {
+ public:
+  PowerDistributionPanel();
+  explicit PowerDistributionPanel(int module);
+
+  double GetVoltage() const;
+  double GetTemperature() const;
+  double GetCurrent(int channel) const;
+  double GetTotalCurrent() const;
+  double GetTotalPower() const;
+  double GetTotalEnergy() const;
+  void ResetTotalEnergy();
+  void ClearStickyFaults();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_module;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Preferences.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Preferences.h
new file mode 100644
index 0000000..f984668
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Preferences.h
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <networktables/NetworkTable.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+/**
+ * The preferences class provides a relatively simple way to save important
+ * values to the roboRIO to access the next time the roboRIO is booted.
+ *
+ * This class loads and saves from a file inside the roboRIO.  The user cannot
+ * access the file directly, but may modify values at specific fields which will
+ * then be automatically periodically saved to the file by the NetworkTable
+ * server.
+ *
+ * This class is thread safe.
+ *
+ * This will also interact with {@link NetworkTable} by creating a table called
+ * "Preferences" with all the key-value pairs.
+ */
+class Preferences : public ErrorBase {
+ public:
+  static Preferences* GetInstance();
+
+  std::vector<std::string> GetKeys();
+  std::string GetString(llvm::StringRef key, llvm::StringRef defaultValue = "");
+  int GetInt(llvm::StringRef key, int defaultValue = 0);
+  double GetDouble(llvm::StringRef key, double defaultValue = 0.0);
+  float GetFloat(llvm::StringRef key, float defaultValue = 0.0);
+  bool GetBoolean(llvm::StringRef key, bool defaultValue = false);
+  int64_t GetLong(llvm::StringRef key, int64_t defaultValue = 0);
+  void PutString(llvm::StringRef key, llvm::StringRef value);
+  void PutInt(llvm::StringRef key, int value);
+  void PutDouble(llvm::StringRef key, double value);
+  void PutFloat(llvm::StringRef key, float value);
+  void PutBoolean(llvm::StringRef key, bool value);
+  void PutLong(llvm::StringRef key, int64_t value);
+  bool ContainsKey(llvm::StringRef key);
+  void Remove(llvm::StringRef key);
+
+ protected:
+  Preferences();
+  virtual ~Preferences() = default;
+
+ private:
+  std::shared_ptr<nt::NetworkTable> m_table;
+  NT_EntryListener m_listener;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Relay.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Relay.h
new file mode 100644
index 0000000..241029a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Relay.h
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <HAL/Types.h>
+#include <llvm/raw_ostream.h>
+
+#include "ErrorBase.h"
+#include "MotorSafety.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+class MotorSafetyHelper;
+
+/**
+ * Class for Spike style relay outputs.
+ *
+ * Relays are intended to be connected to spikes or similar relays. The relay
+ * channels controls a pair of pins that are either both off, one on, the other
+ * on, or both on. This translates into two spike outputs at 0v, one at 12v and
+ * one at 0v, one at 0v and the other at 12v, or two spike outputs at 12V. This
+ * allows off, full forward, or full reverse control of motors without variable
+ * speed. It also allows the two channels (forward and reverse) to be used
+ * independently for something that does not care about voltage polarity (like
+ * a solenoid).
+ */
+class Relay : public MotorSafety, public ErrorBase, public SendableBase {
+ public:
+  enum Value { kOff, kOn, kForward, kReverse };
+  enum Direction { kBothDirections, kForwardOnly, kReverseOnly };
+
+  explicit Relay(int channel, Direction direction = kBothDirections);
+  ~Relay() override;
+
+  void Set(Value value);
+  Value Get() const;
+  int GetChannel() const;
+
+  void SetExpiration(double timeout) override;
+  double GetExpiration() const override;
+  bool IsAlive() const override;
+  void StopMotor() override;
+  bool IsSafetyEnabled() const override;
+  void SetSafetyEnabled(bool enabled) override;
+  void GetDescription(llvm::raw_ostream& desc) const override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  int m_channel;
+  Direction m_direction;
+
+  HAL_RelayHandle m_forwardHandle = HAL_kInvalidHandle;
+  HAL_RelayHandle m_reverseHandle = HAL_kInvalidHandle;
+
+  std::unique_ptr<MotorSafetyHelper> m_safetyHelper;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Resource.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Resource.h
new file mode 100644
index 0000000..0cd7d56
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Resource.h
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <support/mutex.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+/**
+ * The Resource class is a convenient way to track allocated resources.
+ *
+ * It tracks them as indicies in the range [0 .. elements - 1]. E.g. the library
+ * uses this to track hardware channel allocation.
+ *
+ * The Resource class does not allocate the hardware channels or other
+ * resources; it just tracks which indices were marked in use by Allocate and
+ * not yet freed by Free.
+ */
+class Resource : public ErrorBase {
+ public:
+  virtual ~Resource() = default;
+
+  Resource(const Resource&) = delete;
+  Resource& operator=(const Resource&) = delete;
+
+  static void CreateResourceObject(std::unique_ptr<Resource>& r,
+                                   uint32_t elements);
+  explicit Resource(uint32_t size);
+  uint32_t Allocate(const std::string& resourceDesc);
+  uint32_t Allocate(uint32_t index, const std::string& resourceDesc);
+  void Free(uint32_t index);
+
+ private:
+  std::vector<bool> m_isAllocated;
+  wpi::mutex m_allocateMutex;
+
+  static wpi::mutex m_createMutex;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotBase.h
new file mode 100644
index 0000000..95f0a82
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotBase.h
@@ -0,0 +1,77 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <thread>
+
+#include <HAL/HAL.h>
+#include <llvm/raw_ostream.h>
+
+#include "Base.h"
+
+namespace frc {
+
+class DriverStation;
+
+#define START_ROBOT_CLASS(_ClassName_)                                  \
+  int main() {                                                          \
+    if (!HAL_Initialize(500, 0)) {                                      \
+      llvm::errs() << "FATAL ERROR: HAL could not be initialized\n";    \
+      return -1;                                                        \
+    }                                                                   \
+    HAL_Report(HALUsageReporting::kResourceType_Language,               \
+               HALUsageReporting::kLanguage_CPlusPlus);                 \
+    llvm::outs() << "\n********** Robot program starting **********\n"; \
+    static _ClassName_ robot;                                           \
+    robot.StartCompetition();                                           \
+  }
+
+/**
+ * Implement a Robot Program framework.
+ *
+ * The RobotBase class is intended to be subclassed by a user creating a robot
+ * program. Overridden Autonomous() and OperatorControl() methods are called at
+ * the appropriate time as the match proceeds. In the current implementation,
+ * the Autonomous code will run to completion before the OperatorControl code
+ * could start. In the future the Autonomous code might be spawned as a task,
+ * then killed at the end of the Autonomous period.
+ */
+class RobotBase {
+ public:
+  bool IsEnabled() const;
+  bool IsDisabled() const;
+  bool IsAutonomous() const;
+  bool IsOperatorControl() const;
+  bool IsTest() const;
+  bool IsNewDataAvailable() const;
+  static std::thread::id GetThreadId();
+  virtual void StartCompetition() = 0;
+
+  static constexpr bool IsReal() {
+#ifdef __FRC_ROBORIO__
+    return true;
+#else
+    return false;
+#endif
+  }
+
+  static constexpr bool IsSimulation() { return !IsReal(); }
+
+ protected:
+  RobotBase();
+  virtual ~RobotBase() = default;
+
+  RobotBase(const RobotBase&) = delete;
+  RobotBase& operator=(const RobotBase&) = delete;
+
+  DriverStation& m_ds;
+
+  static std::thread::id m_threadId;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotController.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotController.h
new file mode 100644
index 0000000..2196f4e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotController.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+namespace frc {
+
+struct CANStatus {
+  float percentBusUtilization;
+  int busOffCount;
+  int txFullCount;
+  int receiveErrorCount;
+  int transmitErrorCount;
+};
+
+class RobotController {
+ public:
+  RobotController() = delete;
+  static int GetFPGAVersion();
+  static int64_t GetFPGARevision();
+  static uint64_t GetFPGATime();
+  static bool GetUserButton();
+  static bool IsSysActive();
+  static bool IsBrownedOut();
+  static double GetInputVoltage();
+  static double GetInputCurrent();
+  static double GetVoltage3V3();
+  static double GetCurrent3V3();
+  static bool GetEnabled3V3();
+  static int GetFaultCount3V3();
+  static double GetVoltage5V();
+  static double GetCurrent5V();
+  static bool GetEnabled5V();
+  static int GetFaultCount5V();
+  static double GetVoltage6V();
+  static double GetCurrent6V();
+  static bool GetEnabled6V();
+  static int GetFaultCount6V();
+  static CANStatus GetCANStatus();
+};
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotDrive.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotDrive.h
new file mode 100644
index 0000000..8344690
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotDrive.h
@@ -0,0 +1,138 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/raw_ostream.h>
+#include <support/deprecated.h>
+
+#include "ErrorBase.h"
+#include "MotorSafety.h"
+#include "MotorSafetyHelper.h"
+
+namespace frc {
+
+class SpeedController;
+class GenericHID;
+
+/**
+ * Utility class for handling Robot drive based on a definition of the motor
+ * configuration.
+ *
+ * The robot drive class handles basic driving for a robot. Currently, 2 and 4
+ * motor tank and mecanum drive trains are supported. In the future other drive
+ * types like swerve might be implemented. Motor channel numbers are passed
+ * supplied on creation of the class. Those are used for either the Drive
+ * function (intended for hand created drive code, such as autonomous) or with
+ * the Tank/Arcade functions intended to be used for Operator Control driving.
+ */
+class RobotDrive : public MotorSafety, public ErrorBase {
+ public:
+  enum MotorType {
+    kFrontLeftMotor = 0,
+    kFrontRightMotor = 1,
+    kRearLeftMotor = 2,
+    kRearRightMotor = 3
+  };
+
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(int leftMotorChannel, int rightMotorChannel);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(int frontLeftMotorChannel, int rearLeftMotorChannel,
+             int frontRightMotorChannel, int rearRightMotorChannel);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(SpeedController* leftMotor, SpeedController* rightMotor);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(SpeedController& leftMotor, SpeedController& rightMotor);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(std::shared_ptr<SpeedController> leftMotor,
+             std::shared_ptr<SpeedController> rightMotor);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(SpeedController* frontLeftMotor, SpeedController* rearLeftMotor,
+             SpeedController* frontRightMotor, SpeedController* rearRightMotor);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(SpeedController& frontLeftMotor, SpeedController& rearLeftMotor,
+             SpeedController& frontRightMotor, SpeedController& rearRightMotor);
+  WPI_DEPRECATED("Use DifferentialDrive or MecanumDrive classes instead.")
+  RobotDrive(std::shared_ptr<SpeedController> frontLeftMotor,
+             std::shared_ptr<SpeedController> rearLeftMotor,
+             std::shared_ptr<SpeedController> frontRightMotor,
+             std::shared_ptr<SpeedController> rearRightMotor);
+  virtual ~RobotDrive() = default;
+
+  RobotDrive(const RobotDrive&) = delete;
+  RobotDrive& operator=(const RobotDrive&) = delete;
+
+  void Drive(double outputMagnitude, double curve);
+  void TankDrive(GenericHID* leftStick, GenericHID* rightStick,
+                 bool squaredInputs = true);
+  void TankDrive(GenericHID& leftStick, GenericHID& rightStick,
+                 bool squaredInputs = true);
+  void TankDrive(GenericHID* leftStick, int leftAxis, GenericHID* rightStick,
+                 int rightAxis, bool squaredInputs = true);
+  void TankDrive(GenericHID& leftStick, int leftAxis, GenericHID& rightStick,
+                 int rightAxis, bool squaredInputs = true);
+  void TankDrive(double leftValue, double rightValue,
+                 bool squaredInputs = true);
+  void ArcadeDrive(GenericHID* stick, bool squaredInputs = true);
+  void ArcadeDrive(GenericHID& stick, bool squaredInputs = true);
+  void ArcadeDrive(GenericHID* moveStick, int moveChannel,
+                   GenericHID* rotateStick, int rotateChannel,
+                   bool squaredInputs = true);
+  void ArcadeDrive(GenericHID& moveStick, int moveChannel,
+                   GenericHID& rotateStick, int rotateChannel,
+                   bool squaredInputs = true);
+  void ArcadeDrive(double moveValue, double rotateValue,
+                   bool squaredInputs = true);
+  void MecanumDrive_Cartesian(double x, double y, double rotation,
+                              double gyroAngle = 0.0);
+  void MecanumDrive_Polar(double magnitude, double direction, double rotation);
+  void HolonomicDrive(double magnitude, double direction, double rotation);
+  virtual void SetLeftRightMotorOutputs(double leftOutput, double rightOutput);
+  void SetInvertedMotor(MotorType motor, bool isInverted);
+  void SetSensitivity(double sensitivity);
+  void SetMaxOutput(double maxOutput);
+
+  void SetExpiration(double timeout) override;
+  double GetExpiration() const override;
+  bool IsAlive() const override;
+  void StopMotor() override;
+  bool IsSafetyEnabled() const override;
+  void SetSafetyEnabled(bool enabled) override;
+  void GetDescription(llvm::raw_ostream& desc) const override;
+
+ protected:
+  void InitRobotDrive();
+  double Limit(double number);
+  void Normalize(double* wheelSpeeds);
+  void RotateVector(double& x, double& y, double angle);
+
+  static constexpr int kMaxNumberOfMotors = 4;
+
+  double m_sensitivity = 0.5;
+  double m_maxOutput = 1.0;
+
+  std::shared_ptr<SpeedController> m_frontLeftMotor;
+  std::shared_ptr<SpeedController> m_frontRightMotor;
+  std::shared_ptr<SpeedController> m_rearLeftMotor;
+  std::shared_ptr<SpeedController> m_rearRightMotor;
+  std::unique_ptr<MotorSafetyHelper> m_safetyHelper;
+
+ private:
+  int GetNumMotors() {
+    int motors = 0;
+    if (m_frontLeftMotor) motors++;
+    if (m_frontRightMotor) motors++;
+    if (m_rearLeftMotor) motors++;
+    if (m_rearRightMotor) motors++;
+    return motors;
+  }
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotState.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotState.h
new file mode 100644
index 0000000..2063355
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/RobotState.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+namespace frc {
+
+class RobotStateInterface {
+ public:
+  virtual ~RobotStateInterface() = default;
+  virtual bool IsDisabled() const = 0;
+  virtual bool IsEnabled() const = 0;
+  virtual bool IsOperatorControl() const = 0;
+  virtual bool IsAutonomous() const = 0;
+  virtual bool IsTest() const = 0;
+};
+
+class RobotState {
+ private:
+  static std::shared_ptr<RobotStateInterface> impl;
+
+ public:
+  static void SetImplementation(RobotStateInterface& i);
+  static void SetImplementation(std::shared_ptr<RobotStateInterface> i);
+  static bool IsDisabled();
+  static bool IsEnabled();
+  static bool IsOperatorControl();
+  static bool IsAutonomous();
+  static bool IsTest();
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SD540.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SD540.h
new file mode 100644
index 0000000..b0253b9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SD540.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Mindsensors SD540 Speed Controller.
+ */
+class SD540 : public PWMSpeedController {
+ public:
+  explicit SD540(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SPI.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SPI.h
new file mode 100644
index 0000000..c54eb7d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SPI.h
@@ -0,0 +1,95 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#include <memory>
+
+#include <llvm/ArrayRef.h>
+
+#include "ErrorBase.h"
+
+enum HAL_SPIPort : int32_t;
+
+namespace frc {
+
+class DigitalSource;
+
+/**
+ * SPI bus interface class.
+ *
+ * This class is intended to be used by sensor (and other SPI device) drivers.
+ * It probably should not be used directly.
+ *
+ */
+class SPI : public ErrorBase {
+ public:
+  enum Port { kOnboardCS0 = 0, kOnboardCS1, kOnboardCS2, kOnboardCS3, kMXP };
+
+  explicit SPI(Port port);
+  ~SPI() override;
+
+  SPI(const SPI&) = delete;
+  SPI& operator=(const SPI&) = delete;
+
+  void SetClockRate(double hz);
+
+  void SetMSBFirst();
+  void SetLSBFirst();
+
+  void SetSampleDataOnFalling();
+  void SetSampleDataOnRising();
+
+  void SetClockActiveLow();
+  void SetClockActiveHigh();
+
+  void SetChipSelectActiveHigh();
+  void SetChipSelectActiveLow();
+
+  virtual int Write(uint8_t* data, int size);
+  virtual int Read(bool initiate, uint8_t* dataReceived, int size);
+  virtual int Transaction(uint8_t* dataToSend, uint8_t* dataReceived, int size);
+
+  void InitAuto(int bufferSize);
+  void FreeAuto();
+  void SetAutoTransmitData(llvm::ArrayRef<uint8_t> dataToSend, int zeroSize);
+  void StartAutoRate(double period);
+  void StartAutoTrigger(DigitalSource& source, bool rising, bool falling);
+  void StopAuto();
+  void ForceAutoRead();
+  int ReadAutoReceivedData(uint8_t* buffer, int numToRead, double timeout);
+  int GetAutoDroppedCount();
+
+  void InitAccumulator(double period, int cmd, int xferSize, int validMask,
+                       int validValue, int dataShift, int dataSize,
+                       bool isSigned, bool bigEndian);
+  void FreeAccumulator();
+  void ResetAccumulator();
+  void SetAccumulatorCenter(int center);
+  void SetAccumulatorDeadband(int deadband);
+  int GetAccumulatorLastValue() const;
+  int64_t GetAccumulatorValue() const;
+  int64_t GetAccumulatorCount() const;
+  double GetAccumulatorAverage() const;
+  void GetAccumulatorOutput(int64_t& value, int64_t& count) const;
+
+ protected:
+  HAL_SPIPort m_port;
+  bool m_msbFirst = false;          // Default little-endian
+  bool m_sampleOnTrailing = false;  // Default data updated on falling edge
+  bool m_clk_idle_high = false;     // Default clock active high
+
+ private:
+  void Init();
+
+  class Accumulator;
+  std::unique_ptr<Accumulator> m_accum;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SafePWM.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SafePWM.h
new file mode 100644
index 0000000..3d37edc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SafePWM.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/raw_ostream.h>
+
+#include "MotorSafety.h"
+#include "MotorSafetyHelper.h"
+#include "PWM.h"
+
+namespace frc {
+
+/**
+ * A safe version of the PWM class.
+ *
+ * It is safe because it implements the MotorSafety interface that provides
+ * timeouts in the event that the motor value is not updated before the
+ * expiration time. This delegates the actual work to a MotorSafetyHelper
+ * object that is used for all objects that implement MotorSafety.
+ */
+class SafePWM : public PWM, public MotorSafety {
+ public:
+  explicit SafePWM(int channel);
+  virtual ~SafePWM() = default;
+
+  void SetExpiration(double timeout);
+  double GetExpiration() const;
+  bool IsAlive() const;
+  void StopMotor();
+  bool IsSafetyEnabled() const;
+  void SetSafetyEnabled(bool enabled);
+  void GetDescription(llvm::raw_ostream& desc) const;
+
+  virtual void SetSpeed(double speed);
+
+ private:
+  std::unique_ptr<MotorSafetyHelper> m_safetyHelper;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SampleRobot.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SampleRobot.h
new file mode 100644
index 0000000..4858a33
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SampleRobot.h
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <support/deprecated.h>
+
+#include "RobotBase.h"
+
+namespace frc {
+
+class WPI_DEPRECATED(
+    "WARNING: While it may look like a good choice to use for your code if "
+    "you're inexperienced, don't. Unless you know what you are doing, complex "
+    "code will be much more difficult under this system. Use TimedRobot or "
+    "Command-Based instead.") SampleRobot : public RobotBase {
+ public:
+  void StartCompetition() override;
+
+  virtual void RobotInit();
+  virtual void Disabled();
+  virtual void Autonomous();
+  virtual void OperatorControl();
+  virtual void Test();
+  virtual void RobotMain();
+
+ protected:
+  SampleRobot();
+  virtual ~SampleRobot() = default;
+
+ private:
+  bool m_robotMainOverridden = true;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SensorBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SensorBase.h
new file mode 100644
index 0000000..27405c3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SensorBase.h
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include "Base.h"
+#include "ErrorBase.h"
+#include "SmartDashboard/Sendable.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * Base class for all sensors.
+ *
+ * Stores most recent status information as well as containing utility functions
+ * for checking channels and error processing.
+ */
+class SensorBase : public ErrorBase, public SendableBase {
+ public:
+  SensorBase() = default;
+
+  SensorBase(const SensorBase&) = delete;
+  SensorBase& operator=(const SensorBase&) = delete;
+
+  static int GetDefaultSolenoidModule() { return 0; }
+
+  static bool CheckSolenoidModule(int moduleNumber);
+  static bool CheckDigitalChannel(int channel);
+  static bool CheckRelayChannel(int channel);
+  static bool CheckPWMChannel(int channel);
+  static bool CheckAnalogInputChannel(int channel);
+  static bool CheckAnalogOutputChannel(int channel);
+  static bool CheckSolenoidChannel(int channel);
+  static bool CheckPDPChannel(int channel);
+
+  static const int kDigitalChannels;
+  static const int kAnalogInputs;
+  static const int kAnalogOutputs;
+  static const int kSolenoidChannels;
+  static const int kSolenoidModules;
+  static const int kPwmChannels;
+  static const int kRelayChannels;
+  static const int kPDPChannels;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SerialPort.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SerialPort.h
new file mode 100644
index 0000000..cfc0fe4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SerialPort.h
@@ -0,0 +1,85 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include <llvm/StringRef.h>
+
+#include "ErrorBase.h"
+
+namespace frc {
+
+/**
+ * Driver for the RS-232 serial port on the roboRIO.
+ *
+ * The current implementation uses the VISA formatted I/O mode.  This means that
+ * all traffic goes through the fomatted buffers.  This allows the intermingled
+ * use of Printf(), Scanf(), and the raw buffer accessors Read() and Write().
+ *
+ * More information can be found in the NI-VISA User Manual here:
+ *   http://www.ni.com/pdf/manuals/370423a.pdf
+ * and the NI-VISA Programmer's Reference Manual here:
+ *   http://www.ni.com/pdf/manuals/370132c.pdf
+ */
+class SerialPort : public ErrorBase {
+ public:
+  enum Parity {
+    kParity_None = 0,
+    kParity_Odd = 1,
+    kParity_Even = 2,
+    kParity_Mark = 3,
+    kParity_Space = 4
+  };
+
+  enum StopBits {
+    kStopBits_One = 10,
+    kStopBits_OnePointFive = 15,
+    kStopBits_Two = 20
+  };
+
+  enum FlowControl {
+    kFlowControl_None = 0,
+    kFlowControl_XonXoff = 1,
+    kFlowControl_RtsCts = 2,
+    kFlowControl_DtrDsr = 4
+  };
+
+  enum WriteBufferMode { kFlushOnAccess = 1, kFlushWhenFull = 2 };
+
+  enum Port { kOnboard = 0, kMXP = 1, kUSB = 2, kUSB1 = 2, kUSB2 = 3 };
+
+  SerialPort(int baudRate, Port port = kOnboard, int dataBits = 8,
+             Parity parity = kParity_None, StopBits stopBits = kStopBits_One);
+  ~SerialPort();
+
+  SerialPort(const SerialPort&) = delete;
+  SerialPort& operator=(const SerialPort&) = delete;
+
+  void SetFlowControl(FlowControl flowControl);
+  void EnableTermination(char terminator = '\n');
+  void DisableTermination();
+  int GetBytesReceived();
+  int Read(char* buffer, int count);
+  int Write(const char* buffer, int count);
+  int Write(llvm::StringRef buffer);
+  void SetTimeout(double timeout);
+  void SetReadBufferSize(int size);
+  void SetWriteBufferSize(int size);
+  void SetWriteBufferMode(WriteBufferMode mode);
+  void Flush();
+  void Reset();
+
+ private:
+  int m_resourceManagerHandle = 0;
+  int m_portHandle = 0;
+  bool m_consoleModeEnabled = false;
+  int m_port;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Servo.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Servo.h
new file mode 100644
index 0000000..205ec7c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Servo.h
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SafePWM.h"
+#include "SpeedController.h"
+
+namespace frc {
+
+/**
+ * Standard hobby style servo.
+ *
+ * The range parameters default to the appropriate values for the Hitec HS-322HD
+ * servo provided in the FIRST Kit of Parts in 2008.
+ */
+class Servo : public SafePWM {
+ public:
+  explicit Servo(int channel);
+  void Set(double value);
+  void SetOffline();
+  double Get() const;
+  void SetAngle(double angle);
+  double GetAngle() const;
+  static double GetMaxAngle() { return kMaxServoAngle; }
+  static double GetMinAngle() { return kMinServoAngle; }
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  double GetServoAngleRange() const { return kMaxServoAngle - kMinServoAngle; }
+
+  static constexpr double kMaxServoAngle = 180.0;
+  static constexpr double kMinServoAngle = 0.0;
+
+  static constexpr double kDefaultMaxServoPWM = 2.4;
+  static constexpr double kDefaultMinServoPWM = .6;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/NamedSendable.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/NamedSendable.h
new file mode 100644
index 0000000..ff3e1c3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/NamedSendable.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2012-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include <support/deprecated.h>
+
+#include "SmartDashboard/Sendable.h"
+
+namespace frc {
+
+/**
+ * The interface for sendable objects that gives the sendable a default name in
+ * the Smart Dashboard.
+ * @deprecated Use Sendable directly instead
+ */
+class WPI_DEPRECATED("use Sendable directly instead") NamedSendable
+    : public Sendable {
+ public:
+  void SetName(const llvm::Twine& name) override;
+  std::string GetSubsystem() const override;
+  void SetSubsystem(const llvm::Twine& subsystem) override;
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/Sendable.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/Sendable.h
new file mode 100644
index 0000000..ffaf7c5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/Sendable.h
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include <llvm/Twine.h>
+
+namespace frc {
+
+class SendableBuilder;
+
+class Sendable {
+ public:
+  virtual ~Sendable() = default;
+
+  /**
+   * Gets the name of this Sendable object.
+   *
+   * @return Name
+   */
+  virtual std::string GetName() const = 0;
+
+  /**
+   * Sets the name of this Sendable object.
+   *
+   * @param name name
+   */
+  virtual void SetName(const llvm::Twine& name) = 0;
+
+  /**
+   * Sets both the subsystem name and device name of this Sendable object.
+   *
+   * @param subsystem subsystem name
+   * @param name device name
+   */
+  void SetName(const llvm::Twine& subsystem, const llvm::Twine& name) {
+    SetSubsystem(subsystem);
+    SetName(name);
+  }
+
+  /**
+   * Gets the subsystem name of this Sendable object.
+   *
+   * @return Subsystem name
+   */
+  virtual std::string GetSubsystem() const = 0;
+
+  /**
+   * Sets the subsystem name of this Sendable object.
+   *
+   * @param subsystem subsystem name
+   */
+  virtual void SetSubsystem(const llvm::Twine& subsystem) = 0;
+
+  /**
+   * Initializes this Sendable object.
+   *
+   * @param builder sendable builder
+   */
+  virtual void InitSendable(SendableBuilder& builder) = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBase.h
new file mode 100644
index 0000000..e2b9533
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBase.h
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <support/mutex.h>
+
+#include "Sendable.h"
+
+namespace frc {
+
+class SendableBase : public Sendable {
+ public:
+  explicit SendableBase(bool addLiveWindow = true);
+  ~SendableBase() override;
+
+  using Sendable::SetName;
+
+  std::string GetName() const final;
+  void SetName(const llvm::Twine& name) final;
+  std::string GetSubsystem() const final;
+  void SetSubsystem(const llvm::Twine& subsystem) final;
+
+ protected:
+  void AddChild(std::shared_ptr<Sendable> child);
+  void AddChild(void* child);
+
+  void SetName(const llvm::Twine& moduleType, int channel);
+  void SetName(const llvm::Twine& moduleType, int moduleNumber, int channel);
+
+ private:
+  mutable wpi::mutex m_mutex;
+  std::string m_name;
+  std::string m_subsystem = "Ungrouped";
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBuilder.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBuilder.h
new file mode 100644
index 0000000..49be390
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBuilder.h
@@ -0,0 +1,216 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/SmallVector.h>
+#include <llvm/Twine.h>
+#include <networktables/NetworkTableEntry.h>
+#include <networktables/NetworkTableValue.h>
+
+namespace frc {
+
+class SendableBuilder {
+ public:
+  virtual ~SendableBuilder() = default;
+
+  /**
+   * Set the string representation of the named data type that will be used
+   * by the smart dashboard for this sendable.
+   *
+   * @param type    data type
+   */
+  virtual void SetSmartDashboardType(const llvm::Twine& type) = 0;
+
+  /**
+   * Set the function that should be called to set the Sendable into a safe
+   * state.  This is called when entering and exiting Live Window mode.
+   *
+   * @param func    function
+   */
+  virtual void SetSafeState(std::function<void()> func) = 0;
+
+  /**
+   * Set the function that should be called to update the network table
+   * for things other than properties.  Note this function is not passed
+   * the network table object; instead it should use the entry handles
+   * returned by GetEntry().
+   *
+   * @param func    function
+   */
+  virtual void SetUpdateTable(std::function<void()> func) = 0;
+
+  /**
+   * Add a property without getters or setters.  This can be used to get
+   * entry handles for the function called by SetUpdateTable().
+   *
+   * @param key   property name
+   * @return Network table entry
+   */
+  virtual nt::NetworkTableEntry GetEntry(const llvm::Twine& key) = 0;
+
+  /**
+   * Add a boolean property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddBooleanProperty(const llvm::Twine& key,
+                                  std::function<bool()> getter,
+                                  std::function<void(bool)> setter) = 0;
+
+  /**
+   * Add a double property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddDoubleProperty(const llvm::Twine& key,
+                                 std::function<double()> getter,
+                                 std::function<void(double)> setter) = 0;
+
+  /**
+   * Add a string property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddStringProperty(
+      const llvm::Twine& key, std::function<std::string()> getter,
+      std::function<void(llvm::StringRef)> setter) = 0;
+
+  /**
+   * Add a boolean array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddBooleanArrayProperty(
+      const llvm::Twine& key, std::function<std::vector<int>()> getter,
+      std::function<void(llvm::ArrayRef<int>)> setter) = 0;
+
+  /**
+   * Add a double array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddDoubleArrayProperty(
+      const llvm::Twine& key, std::function<std::vector<double>()> getter,
+      std::function<void(llvm::ArrayRef<double>)> setter) = 0;
+
+  /**
+   * Add a string array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddStringArrayProperty(
+      const llvm::Twine& key, std::function<std::vector<std::string>()> getter,
+      std::function<void(llvm::ArrayRef<std::string>)> setter) = 0;
+
+  /**
+   * Add a raw property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddRawProperty(const llvm::Twine& key,
+                              std::function<std::string()> getter,
+                              std::function<void(llvm::StringRef)> setter) = 0;
+
+  /**
+   * Add a NetworkTableValue property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddValueProperty(
+      const llvm::Twine& key,
+      std::function<std::shared_ptr<nt::Value>()> getter,
+      std::function<void(std::shared_ptr<nt::Value>)> setter) = 0;
+
+  /**
+   * Add a string property (SmallString form).
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddSmallStringProperty(
+      const llvm::Twine& key,
+      std::function<llvm::StringRef(llvm::SmallVectorImpl<char>& buf)> getter,
+      std::function<void(llvm::StringRef)> setter) = 0;
+
+  /**
+   * Add a boolean array property (SmallVector form).
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddSmallBooleanArrayProperty(
+      const llvm::Twine& key,
+      std::function<llvm::ArrayRef<int>(llvm::SmallVectorImpl<int>& buf)>
+          getter,
+      std::function<void(llvm::ArrayRef<int>)> setter) = 0;
+
+  /**
+   * Add a double array property (SmallVector form).
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddSmallDoubleArrayProperty(
+      const llvm::Twine& key,
+      std::function<llvm::ArrayRef<double>(llvm::SmallVectorImpl<double>& buf)>
+          getter,
+      std::function<void(llvm::ArrayRef<double>)> setter) = 0;
+
+  /**
+   * Add a string array property (SmallVector form).
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddSmallStringArrayProperty(
+      const llvm::Twine& key,
+      std::function<
+          llvm::ArrayRef<std::string>(llvm::SmallVectorImpl<std::string>& buf)>
+          getter,
+      std::function<void(llvm::ArrayRef<std::string>)> setter) = 0;
+
+  /**
+   * Add a raw property (SmallVector form).
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  virtual void AddSmallRawProperty(
+      const llvm::Twine& key,
+      std::function<llvm::StringRef(llvm::SmallVectorImpl<char>& buf)> getter,
+      std::function<void(llvm::StringRef)> setter) = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBuilderImpl.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBuilderImpl.h
new file mode 100644
index 0000000..6278de6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableBuilderImpl.h
@@ -0,0 +1,194 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/SmallVector.h>
+#include <llvm/Twine.h>
+#include <networktables/NetworkTable.h>
+#include <networktables/NetworkTableEntry.h>
+#include <networktables/NetworkTableValue.h>
+
+#include "SendableBuilder.h"
+
+namespace frc {
+
+class SendableBuilderImpl : public SendableBuilder {
+ public:
+  SendableBuilderImpl() = default;
+  SendableBuilderImpl(const SendableBuilderImpl&) = delete;
+  SendableBuilderImpl(SendableBuilderImpl&& other) = default;
+  SendableBuilderImpl& operator=(const SendableBuilderImpl&) = delete;
+  SendableBuilderImpl& operator=(SendableBuilderImpl&& other) = default;
+  ~SendableBuilderImpl() override = default;
+
+  /**
+   * Set the network table.  Must be called prior to any Add* functions being
+   * called.
+   * @param table Network table
+   */
+  void SetTable(std::shared_ptr<nt::NetworkTable> table);
+
+  /**
+   * Get the network table.
+   * @return The network table
+   */
+  std::shared_ptr<nt::NetworkTable> GetTable();
+
+  /**
+   * Update the network table values by calling the getters for all properties.
+   */
+  void UpdateTable();
+
+  /**
+   * Hook setters for all properties.
+   */
+  void StartListeners();
+
+  /**
+   * Unhook setters for all properties.
+   */
+  void StopListeners();
+
+  /**
+   * Start LiveWindow mode by hooking the setters for all properties.  Also
+   * calls the SafeState function if one was provided.
+   */
+  void StartLiveWindowMode();
+
+  /**
+   * Stop LiveWindow mode by unhooking the setters for all properties.  Also
+   * calls the SafeState function if one was provided.
+   */
+  void StopLiveWindowMode();
+
+  void SetSmartDashboardType(const llvm::Twine& type) override;
+  void SetSafeState(std::function<void()> func) override;
+  void SetUpdateTable(std::function<void()> func) override;
+  nt::NetworkTableEntry GetEntry(const llvm::Twine& key) override;
+
+  void AddBooleanProperty(const llvm::Twine& key, std::function<bool()> getter,
+                          std::function<void(bool)> setter) override;
+
+  void AddDoubleProperty(const llvm::Twine& key, std::function<double()> getter,
+                         std::function<void(double)> setter) override;
+
+  void AddStringProperty(const llvm::Twine& key,
+                         std::function<std::string()> getter,
+                         std::function<void(llvm::StringRef)> setter) override;
+
+  void AddBooleanArrayProperty(
+      const llvm::Twine& key, std::function<std::vector<int>()> getter,
+      std::function<void(llvm::ArrayRef<int>)> setter) override;
+
+  void AddDoubleArrayProperty(
+      const llvm::Twine& key, std::function<std::vector<double>()> getter,
+      std::function<void(llvm::ArrayRef<double>)> setter) override;
+
+  void AddStringArrayProperty(
+      const llvm::Twine& key, std::function<std::vector<std::string>()> getter,
+      std::function<void(llvm::ArrayRef<std::string>)> setter) override;
+
+  void AddRawProperty(const llvm::Twine& key,
+                      std::function<std::string()> getter,
+                      std::function<void(llvm::StringRef)> setter) override;
+
+  void AddValueProperty(
+      const llvm::Twine& key,
+      std::function<std::shared_ptr<nt::Value>()> getter,
+      std::function<void(std::shared_ptr<nt::Value>)> setter) override;
+
+  void AddSmallStringProperty(
+      const llvm::Twine& key,
+      std::function<llvm::StringRef(llvm::SmallVectorImpl<char>& buf)> getter,
+      std::function<void(llvm::StringRef)> setter) override;
+
+  void AddSmallBooleanArrayProperty(
+      const llvm::Twine& key,
+      std::function<llvm::ArrayRef<int>(llvm::SmallVectorImpl<int>& buf)>
+          getter,
+      std::function<void(llvm::ArrayRef<int>)> setter) override;
+
+  void AddSmallDoubleArrayProperty(
+      const llvm::Twine& key,
+      std::function<llvm::ArrayRef<double>(llvm::SmallVectorImpl<double>& buf)>
+          getter,
+      std::function<void(llvm::ArrayRef<double>)> setter) override;
+
+  void AddSmallStringArrayProperty(
+      const llvm::Twine& key,
+      std::function<
+          llvm::ArrayRef<std::string>(llvm::SmallVectorImpl<std::string>& buf)>
+          getter,
+      std::function<void(llvm::ArrayRef<std::string>)> setter) override;
+
+  void AddSmallRawProperty(
+      const llvm::Twine& key,
+      std::function<llvm::StringRef(llvm::SmallVectorImpl<char>& buf)> getter,
+      std::function<void(llvm::StringRef)> setter) override;
+
+ private:
+  struct Property {
+    Property(nt::NetworkTable& table, const llvm::Twine& key)
+        : entry(table.GetEntry(key)) {}
+
+    Property(const Property&) = delete;
+    Property& operator=(const Property&) = delete;
+
+    Property(Property&& other) noexcept
+        : entry(other.entry),
+          listener(other.listener),
+          update(std::move(other.update)),
+          createListener(std::move(other.createListener)) {
+      other.entry = nt::NetworkTableEntry();
+      other.listener = 0;
+    }
+
+    Property& operator=(Property&& other) noexcept {
+      entry = other.entry;
+      listener = other.listener;
+      other.entry = nt::NetworkTableEntry();
+      other.listener = 0;
+      update = std::move(other.update);
+      createListener = std::move(other.createListener);
+      return *this;
+    }
+
+    ~Property() { StopListener(); }
+
+    void StartListener() {
+      if (entry && listener == 0 && createListener)
+        listener = createListener(entry);
+    }
+
+    void StopListener() {
+      if (entry && listener != 0) {
+        entry.RemoveListener(listener);
+        listener = 0;
+      }
+    }
+
+    nt::NetworkTableEntry entry;
+    NT_EntryListener listener = 0;
+    std::function<void(nt::NetworkTableEntry entry, uint64_t time)> update;
+    std::function<NT_EntryListener(nt::NetworkTableEntry entry)> createListener;
+  };
+
+  std::vector<Property> m_properties;
+  std::function<void()> m_safeState;
+  std::function<void()> m_updateTable;
+  std::shared_ptr<nt::NetworkTable> m_table;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooser.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooser.h
new file mode 100644
index 0000000..9a8a69d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooser.h
@@ -0,0 +1,58 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include <llvm/StringMap.h>
+#include <llvm/StringRef.h>
+
+#include "SmartDashboard/SendableChooserBase.h"
+
+namespace frc {
+
+/**
+ * The SendableChooser class is a useful tool for presenting a selection of
+ * options to the SmartDashboard.
+ *
+ * For instance, you may wish to be able to select between multiple autonomous
+ * modes. You can do this by putting every possible Command you want to run as
+ * an autonomous into a SendableChooser and then put it into the SmartDashboard
+ * to have a list of options appear on the laptop. Once autonomous starts,
+ * simply ask the SendableChooser what the selected value is.
+ *
+ * @tparam T The type of values to be stored
+ * @see SmartDashboard
+ */
+template <class T>
+class SendableChooser : public SendableChooserBase {
+  llvm::StringMap<T> m_choices;
+
+  template <class U>
+  static U _unwrap_smart_ptr(const U& value);
+
+  template <class U>
+  static U* _unwrap_smart_ptr(const std::unique_ptr<U>& value);
+
+  template <class U>
+  static std::weak_ptr<U> _unwrap_smart_ptr(const std::shared_ptr<U>& value);
+
+ public:
+  ~SendableChooser() override = default;
+
+  void AddObject(llvm::StringRef name, T object);
+  void AddDefault(llvm::StringRef name, T object);
+
+  auto GetSelected() -> decltype(_unwrap_smart_ptr(m_choices[""]));
+
+  void InitSendable(SendableBuilder& builder) override;
+};
+
+}  // namespace frc
+
+#include "SendableChooser.inc"
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooser.inc b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooser.inc
new file mode 100644
index 0000000..f46266f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooser.inc
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <algorithm>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <llvm/StringRef.h>
+
+#include "SendableBuilder.h"
+
+namespace frc {
+
+/**
+ * Adds the given object to the list of options.
+ *
+ * On the SmartDashboard on the desktop, the object will appear as the given
+ * name.
+ *
+ * @param name   the name of the option
+ * @param object the option
+ */
+template <class T>
+void SendableChooser<T>::AddObject(llvm::StringRef name, T object) {
+  m_choices[name] = std::move(object);
+}
+
+/**
+ * Add the given object to the list of options and marks it as the default.
+ *
+ * Functionally, this is very close to AddObject() except that it will use this
+ * as the default option if none other is explicitly selected.
+ *
+ * @param name   the name of the option
+ * @param object the option
+ */
+template <class T>
+void SendableChooser<T>::AddDefault(llvm::StringRef name, T object) {
+  m_defaultChoice = name;
+  AddObject(name, std::move(object));
+}
+
+/**
+ * Returns a copy of the selected option (a raw pointer U* if T =
+ * std::unique_ptr<U> or a std::weak_ptr<U> if T = std::shared_ptr<U>).
+ *
+ * If there is none selected, it will return the default. If there is none
+ * selected and no default, then it will return a value-initialized instance.
+ * For integer types, this is 0. For container types like std::string, this is
+ * an empty string.
+ *
+ * @return The option selected
+ */
+template <class T>
+auto SendableChooser<T>::GetSelected()
+    -> decltype(_unwrap_smart_ptr(m_choices[""])) {
+  llvm::StringRef selected = m_defaultChoice;
+  if (m_selectedEntry) {
+    selected = m_selectedEntry.GetString(m_defaultChoice);
+  }
+  if (selected.empty()) {
+    return decltype(_unwrap_smart_ptr(m_choices[""])){};
+  } else {
+    return _unwrap_smart_ptr(m_choices[selected]);
+  }
+}
+
+template <class T>
+void SendableChooser<T>::InitSendable(SendableBuilder& builder) {
+  builder.SetSmartDashboardType("String Chooser");
+  builder.AddStringArrayProperty(kOptions,
+                                 [=]() {
+                                   std::vector<std::string> keys;
+                                   for (const auto& choice : m_choices) {
+                                     keys.push_back(choice.first());
+                                   }
+
+                                   // Unlike std::map, llvm::StringMap elements
+                                   // are not sorted
+                                   std::sort(keys.begin(), keys.end());
+
+                                   return keys;
+                                 },
+                                 nullptr);
+  builder.AddSmallStringProperty(
+      kDefault,
+      [=](const llvm::SmallVectorImpl<char>&) -> llvm::StringRef {
+        return m_defaultChoice;
+      },
+      nullptr);
+  m_selectedEntry = builder.GetEntry(kSelected);
+}
+
+template <class T>
+template <class U>
+U SendableChooser<T>::_unwrap_smart_ptr(const U& value) {
+  return value;
+}
+
+template <class T>
+template <class U>
+U* SendableChooser<T>::_unwrap_smart_ptr(const std::unique_ptr<U>& value) {
+  return value.get();
+}
+
+template <class T>
+template <class U>
+std::weak_ptr<U> SendableChooser<T>::_unwrap_smart_ptr(
+    const std::shared_ptr<U>& value) {
+  return value;
+}
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooserBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooserBase.h
new file mode 100644
index 0000000..de504a0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SendableChooserBase.h
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <string>
+
+#include <networktables/NetworkTableEntry.h>
+
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * This class is a non-template base class for SendableChooser.
+ *
+ * It contains static, non-templated variables to avoid their duplication in the
+ * template class.
+ */
+class SendableChooserBase : public SendableBase {
+ public:
+  ~SendableChooserBase() override = default;
+
+ protected:
+  static const char* kDefault;
+  static const char* kOptions;
+  static const char* kSelected;
+
+  std::string m_defaultChoice;
+  nt::NetworkTableEntry m_selectedEntry;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SmartDashboard.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SmartDashboard.h
new file mode 100644
index 0000000..717a69b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SmartDashboard/SmartDashboard.h
@@ -0,0 +1,93 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2011-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <networktables/NetworkTableValue.h>
+
+#include "SensorBase.h"
+
+namespace frc {
+
+class Sendable;
+
+class SmartDashboard : public SensorBase {
+ public:
+  static void init();
+
+  static bool ContainsKey(llvm::StringRef key);
+
+  static std::vector<std::string> GetKeys(int types = 0);
+
+  static void SetPersistent(llvm::StringRef key);
+  static void ClearPersistent(llvm::StringRef key);
+  static bool IsPersistent(llvm::StringRef key);
+
+  static void SetFlags(llvm::StringRef key, unsigned int flags);
+  static void ClearFlags(llvm::StringRef key, unsigned int flags);
+  static unsigned int GetFlags(llvm::StringRef key);
+
+  static void Delete(llvm::StringRef key);
+
+  static void PutData(llvm::StringRef key, Sendable* data);
+  static void PutData(Sendable* value);
+  static Sendable* GetData(llvm::StringRef keyName);
+
+  static bool PutBoolean(llvm::StringRef keyName, bool value);
+  static bool SetDefaultBoolean(llvm::StringRef key, bool defaultValue);
+  static bool GetBoolean(llvm::StringRef keyName, bool defaultValue);
+
+  static bool PutNumber(llvm::StringRef keyName, double value);
+  static bool SetDefaultNumber(llvm::StringRef key, double defaultValue);
+  static double GetNumber(llvm::StringRef keyName, double defaultValue);
+
+  static bool PutString(llvm::StringRef keyName, llvm::StringRef value);
+  static bool SetDefaultString(llvm::StringRef key,
+                               llvm::StringRef defaultValue);
+  static std::string GetString(llvm::StringRef keyName,
+                               llvm::StringRef defaultValue);
+
+  static bool PutBooleanArray(llvm::StringRef key, llvm::ArrayRef<int> value);
+  static bool SetDefaultBooleanArray(llvm::StringRef key,
+                                     llvm::ArrayRef<int> defaultValue);
+  static std::vector<int> GetBooleanArray(llvm::StringRef key,
+                                          llvm::ArrayRef<int> defaultValue);
+
+  static bool PutNumberArray(llvm::StringRef key, llvm::ArrayRef<double> value);
+  static bool SetDefaultNumberArray(llvm::StringRef key,
+                                    llvm::ArrayRef<double> defaultValue);
+  static std::vector<double> GetNumberArray(
+      llvm::StringRef key, llvm::ArrayRef<double> defaultValue);
+
+  static bool PutStringArray(llvm::StringRef key,
+                             llvm::ArrayRef<std::string> value);
+  static bool SetDefaultStringArray(llvm::StringRef key,
+                                    llvm::ArrayRef<std::string> defaultValue);
+  static std::vector<std::string> GetStringArray(
+      llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue);
+
+  static bool PutRaw(llvm::StringRef key, llvm::StringRef value);
+  static bool SetDefaultRaw(llvm::StringRef key, llvm::StringRef defaultValue);
+  static std::string GetRaw(llvm::StringRef key, llvm::StringRef defaultValue);
+
+  static bool PutValue(llvm::StringRef keyName,
+                       std::shared_ptr<nt::Value> value);
+  static bool SetDefaultValue(llvm::StringRef key,
+                              std::shared_ptr<nt::Value> defaultValue);
+  static std::shared_ptr<nt::Value> GetValue(llvm::StringRef keyName);
+
+  static void UpdateValues();
+
+ private:
+  virtual ~SmartDashboard() = default;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Solenoid.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Solenoid.h
new file mode 100644
index 0000000..bc9dd4c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Solenoid.h
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <HAL/Types.h>
+
+#include "SolenoidBase.h"
+
+namespace frc {
+
+/**
+ * Solenoid class for running high voltage Digital Output (PCM).
+ *
+ * The Solenoid class is typically used for pneumatics solenoids, but could be
+ * used for any device within the current spec of the PCM.
+ */
+class Solenoid : public SolenoidBase {
+ public:
+  explicit Solenoid(int channel);
+  Solenoid(int moduleNumber, int channel);
+  ~Solenoid() override;
+  virtual void Set(bool on);
+  virtual bool Get() const;
+  bool IsBlackListed() const;
+  void SetPulseDuration(double durationSeconds);
+  void StartPulse();
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  HAL_SolenoidHandle m_solenoidHandle = HAL_kInvalidHandle;
+  int m_channel;  // The channel on the module to control
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SolenoidBase.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SolenoidBase.h
new file mode 100644
index 0000000..e0eaa61
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SolenoidBase.h
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ErrorBase.h"
+#include "SmartDashboard/SendableBase.h"
+
+namespace frc {
+
+/**
+ * SolenoidBase class is the common base class for the Solenoid and
+ * DoubleSolenoid classes.
+ */
+class SolenoidBase : public ErrorBase, public SendableBase {
+ public:
+  static int GetAll(int module);
+  int GetAll() const;
+
+  static int GetPCMSolenoidBlackList(int module);
+  int GetPCMSolenoidBlackList() const;
+  static bool GetPCMSolenoidVoltageStickyFault(int module);
+  bool GetPCMSolenoidVoltageStickyFault() const;
+  static bool GetPCMSolenoidVoltageFault(int module);
+  bool GetPCMSolenoidVoltageFault() const;
+  static void ClearAllPCMStickyFaults(int module);
+  void ClearAllPCMStickyFaults();
+
+ protected:
+  explicit SolenoidBase(int pcmID);
+
+  static constexpr int m_maxModules = 63;
+  static constexpr int m_maxPorts = 8;
+
+  int m_moduleNumber;  // PCM module number
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Spark.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Spark.h
new file mode 100644
index 0000000..ef620b6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Spark.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * REV Robotics Speed Controller.
+ */
+class Spark : public PWMSpeedController {
+ public:
+  explicit Spark(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedController.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedController.h
new file mode 100644
index 0000000..7673c31
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedController.h
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PIDOutput.h"
+
+namespace frc {
+
+/**
+ * Interface for speed controlling devices.
+ */
+class SpeedController : public PIDOutput {
+ public:
+  virtual ~SpeedController() = default;
+  /**
+   * Common interface for setting the speed of a speed controller.
+   *
+   * @param speed The speed to set.  Value should be between -1.0 and 1.0.
+   */
+  virtual void Set(double speed) = 0;
+
+  /**
+   * Common interface for getting the current set speed of a speed controller.
+   *
+   * @return The current set speed.  Value is between -1.0 and 1.0.
+   */
+  virtual double Get() const = 0;
+
+  /**
+   * Common interface for inverting direction of a speed controller.
+   *
+   * @param isInverted The state of inversion, true is inverted.
+   */
+  virtual void SetInverted(bool isInverted) = 0;
+
+  /**
+   * Common interface for returning the inversion state of a speed controller.
+   *
+   * @return isInverted The state of inversion, true is inverted.
+   */
+  virtual bool GetInverted() const = 0;
+
+  /**
+   * Common interface for disabling a motor.
+   */
+  virtual void Disable() = 0;
+
+  /**
+   * Common interface to stop the motor until Set is called again.
+   */
+  virtual void StopMotor() = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedControllerGroup.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedControllerGroup.h
new file mode 100644
index 0000000..b14fbd9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedControllerGroup.h
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <functional>
+#include <vector>
+
+#include "SmartDashboard/SendableBase.h"
+#include "SpeedController.h"
+
+namespace frc {
+
+class SpeedControllerGroup : public SendableBase, public SpeedController {
+ public:
+  template <class... SpeedControllers>
+  explicit SpeedControllerGroup(SpeedController& speedController,
+                                SpeedControllers&... speedControllers);
+  ~SpeedControllerGroup() override = default;
+
+  void Set(double speed) override;
+  double Get() const override;
+  void SetInverted(bool isInverted) override;
+  bool GetInverted() const override;
+  void Disable() override;
+  void StopMotor() override;
+  void PIDWrite(double output) override;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  bool m_isInverted = false;
+  std::vector<std::reference_wrapper<SpeedController>> m_speedControllers;
+};
+
+}  // namespace frc
+
+#include "SpeedControllerGroup.inc"
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedControllerGroup.inc b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedControllerGroup.inc
new file mode 100644
index 0000000..ba4b766
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/SpeedControllerGroup.inc
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+template <class... SpeedControllers>
+SpeedControllerGroup::SpeedControllerGroup(
+    SpeedController& speedController, SpeedControllers&... speedControllers)
+    : m_speedControllers{speedController, speedControllers...} {
+  for (auto& speedController : m_speedControllers)
+    AddChild(&speedController.get());
+  static int instances = 0;
+  ++instances;
+  SetName("SpeedControllerGroup", instances);
+}
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Talon.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Talon.h
new file mode 100644
index 0000000..362efe9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Talon.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Cross the Road Electronics (CTRE) Talon and Talon SR Speed Controller.
+ */
+class Talon : public PWMSpeedController {
+ public:
+  explicit Talon(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Threads.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Threads.h
new file mode 100644
index 0000000..075fb77
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Threads.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <thread>
+
+namespace frc {
+
+int GetThreadPriority(std::thread& thread, bool* isRealTime);
+int GetCurrentThreadPriority(bool* isRealTime);
+bool SetThreadPriority(std::thread& thread, bool realTime, int priority);
+bool SetCurrentThreadPriority(bool realTime, int priority);
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/TimedRobot.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/TimedRobot.h
new file mode 100644
index 0000000..ca348db
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/TimedRobot.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <memory>
+
+#include "IterativeRobotBase.h"
+#include "Notifier.h"
+
+namespace frc {
+
+/**
+ * TimedRobot implements the IterativeRobotBase robot program framework.
+ *
+ * The TimedRobot class is intended to be subclassed by a user creating a
+ * robot program.
+ *
+ * Periodic() functions from the base class are called on an interval by a
+ * Notifier instance.
+ */
+class TimedRobot : public IterativeRobotBase {
+ public:
+  static constexpr double kDefaultPeriod = 0.02;
+
+  void StartCompetition() override;
+
+  void SetPeriod(double seconds);
+
+ protected:
+  TimedRobot();
+  virtual ~TimedRobot();
+
+ private:
+  double m_period = kDefaultPeriod;
+
+  // Prevents loop from starting if user calls SetPeriod() in RobotInit()
+  bool m_startLoop = false;
+
+  std::unique_ptr<Notifier> m_loop;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Timer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Timer.h
new file mode 100644
index 0000000..228a521
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Timer.h
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <support/deprecated.h>
+#include <support/mutex.h>
+
+#include "Base.h"
+
+namespace frc {
+
+typedef void (*TimerInterruptHandler)(void* param);
+
+void Wait(double seconds);
+WPI_DEPRECATED("Use Timer::GetFPGATimestamp() instead.")
+double GetClock();
+double GetTime();
+
+/**
+ * Timer objects measure accumulated time in seconds.
+ *
+ * The timer object functions like a stopwatch. It can be started, stopped, and
+ * cleared. When the timer is running its value counts up in seconds. When
+ * stopped, the timer holds the current value. The implementation simply records
+ * the time when started and subtracts the current time whenever the value is
+ * requested.
+ */
+class Timer {
+ public:
+  Timer();
+  virtual ~Timer() = default;
+
+  Timer(const Timer&) = delete;
+  Timer& operator=(const Timer&) = delete;
+
+  double Get() const;
+  void Reset();
+  void Start();
+  void Stop();
+  bool HasPeriodPassed(double period);
+
+  static double GetFPGATimestamp();
+  static double GetMatchTime();
+
+  // The time, in seconds, at which the 32-bit FPGA timestamp rolls over to 0
+  static const double kRolloverTime;
+
+ private:
+  double m_startTime = 0.0;
+  double m_accumulatedTime = 0.0;
+  bool m_running = false;
+  mutable wpi::mutex m_mutex;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Ultrasonic.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Ultrasonic.h
new file mode 100644
index 0000000..51f3b4b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Ultrasonic.h
@@ -0,0 +1,96 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <memory>
+#include <thread>
+#include <vector>
+
+#include "Counter.h"
+#include "PIDSource.h"
+#include "SensorBase.h"
+
+namespace frc {
+
+class DigitalInput;
+class DigitalOutput;
+
+/**
+ * Ultrasonic rangefinder class.
+ *
+ * The Ultrasonic rangefinder measures absolute distance based on the round-trip
+ * time of a ping generated by the controller. These sensors use two
+ * transducers, a speaker and a microphone both tuned to the ultrasonic range. A
+ * common ultrasonic sensor, the Daventech SRF04 requires a short pulse to be
+ * generated on a digital channel. This causes the chirp to be emitted. A second
+ * line becomes high as the ping is transmitted and goes low when the echo is
+ * received. The time that the line is high determines the round trip distance
+ * (time of flight).
+ */
+class Ultrasonic : public SensorBase, public PIDSource {
+ public:
+  enum DistanceUnit { kInches = 0, kMilliMeters = 1 };
+
+  Ultrasonic(DigitalOutput* pingChannel, DigitalInput* echoChannel,
+             DistanceUnit units = kInches);
+  Ultrasonic(DigitalOutput& pingChannel, DigitalInput& echoChannel,
+             DistanceUnit units = kInches);
+  Ultrasonic(std::shared_ptr<DigitalOutput> pingChannel,
+             std::shared_ptr<DigitalInput> echoChannel,
+             DistanceUnit units = kInches);
+  Ultrasonic(int pingChannel, int echoChannel, DistanceUnit units = kInches);
+  ~Ultrasonic() override;
+
+  void Ping();
+  bool IsRangeValid() const;
+  static void SetAutomaticMode(bool enabling);
+  double GetRangeInches() const;
+  double GetRangeMM() const;
+  bool IsEnabled() const { return m_enabled; }
+  void SetEnabled(bool enable) { m_enabled = enable; }
+
+  double PIDGet() override;
+  void SetPIDSourceType(PIDSourceType pidSource) override;
+  void SetDistanceUnits(DistanceUnit units);
+  DistanceUnit GetDistanceUnits() const;
+
+  void InitSendable(SendableBuilder& builder) override;
+
+ private:
+  void Initialize();
+
+  static void UltrasonicChecker();
+
+  // Time (sec) for the ping trigger pulse.
+  static constexpr double kPingTime = 10 * 1e-6;
+
+  // Priority that the ultrasonic round robin task runs.
+  static constexpr int kPriority = 64;
+
+  // Max time (ms) between readings.
+  static constexpr double kMaxUltrasonicTime = 0.1;
+  static constexpr double kSpeedOfSoundInchesPerSec = 1130.0 * 12.0;
+
+  // Thread doing the round-robin automatic sensing
+  static std::thread m_thread;
+
+  // Ultrasonic sensors
+  static std::vector<Ultrasonic*> m_sensors;
+
+  // Automatic round-robin mode
+  static std::atomic<bool> m_automaticEnabled;
+
+  std::shared_ptr<DigitalOutput> m_pingChannel;
+  std::shared_ptr<DigitalInput> m_echoChannel;
+  bool m_enabled = false;
+  Counter m_counter;
+  DistanceUnit m_units;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Utility.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Utility.h
new file mode 100644
index 0000000..616f4e3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Utility.h
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+/**
+ * @file Contains global utility functions
+ */
+
+#include <stdint.h>
+
+#include <string>
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+#include <support/deprecated.h>
+
+#define wpi_assert(condition) \
+  wpi_assert_impl(condition, #condition, "", __FILE__, __LINE__, __FUNCTION__)
+#define wpi_assertWithMessage(condition, message)                     \
+  wpi_assert_impl(condition, #condition, message, __FILE__, __LINE__, \
+                  __FUNCTION__)
+
+#define wpi_assertEqual(a, b) \
+  wpi_assertEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__)
+#define wpi_assertEqualWithMessage(a, b, message) \
+  wpi_assertEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, __FUNCTION__)
+
+#define wpi_assertNotEqual(a, b) \
+  wpi_assertNotEqual_impl(a, b, #a, #b, "", __FILE__, __LINE__, __FUNCTION__)
+#define wpi_assertNotEqualWithMessage(a, b, message)                 \
+  wpi_assertNotEqual_impl(a, b, #a, #b, message, __FILE__, __LINE__, \
+                          __FUNCTION__)
+
+bool wpi_assert_impl(bool conditionValue, const llvm::Twine& conditionText,
+                     const llvm::Twine& message, llvm::StringRef fileName,
+                     int lineNumber, llvm::StringRef funcName);
+bool wpi_assertEqual_impl(int valueA, int valueB,
+                          const llvm::Twine& valueAString,
+                          const llvm::Twine& valueBString,
+                          const llvm::Twine& message, llvm::StringRef fileName,
+                          int lineNumber, llvm::StringRef funcName);
+bool wpi_assertNotEqual_impl(int valueA, int valueB,
+                             const llvm::Twine& valueAString,
+                             const llvm::Twine& valueBString,
+                             const llvm::Twine& message,
+                             llvm::StringRef fileName, int lineNumber,
+                             llvm::StringRef funcName);
+
+void wpi_suspendOnAssertEnabled(bool enabled);
+
+namespace frc {
+
+WPI_DEPRECATED("Use RobotController static class method")
+int GetFPGAVersion();
+WPI_DEPRECATED("Use RobotController static class method")
+int64_t GetFPGARevision();
+WPI_DEPRECATED("Use RobotController static class method")
+uint64_t GetFPGATime();
+WPI_DEPRECATED("Use RobotController static class method")
+bool GetUserButton();
+std::string GetStackTrace(int offset);
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/Victor.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Victor.h
new file mode 100644
index 0000000..1993f03
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/Victor.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Vex Robotics Victor 888 Speed Controller.
+ *
+ * The Vex Robotics Victor 884 Speed Controller can also be used with this
+ * class but may need to be calibrated per the Victor 884 user manual.
+ */
+class Victor : public PWMSpeedController {
+ public:
+  explicit Victor(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/VictorSP.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/VictorSP.h
new file mode 100644
index 0000000..73bcb0b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/VictorSP.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PWMSpeedController.h"
+
+namespace frc {
+
+/**
+ * Vex Robotics Victor SP Speed Controller.
+ */
+class VictorSP : public PWMSpeedController {
+ public:
+  explicit VictorSP(int channel);
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPIErrors.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPIErrors.h
new file mode 100644
index 0000000..bbebe3d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPIErrors.h
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+#ifdef WPI_ERRORS_DEFINE_STRINGS
+#define S(label, offset, message)            \
+  const char* wpi_error_s_##label = message; \
+  constexpr int wpi_error_value_##label = offset
+#else
+#define S(label, offset, message)         \
+  extern const char* wpi_error_s_##label; \
+  constexpr int wpi_error_value_##label = offset
+#endif
+
+// Fatal errors
+S(ModuleIndexOutOfRange, -1,
+  "Allocating module that is out of range or not found");
+S(ChannelIndexOutOfRange, -1, "Allocating channel that is out of range");
+S(NotAllocated, -2, "Attempting to free unallocated resource");
+S(ResourceAlreadyAllocated, -3, "Attempted to reuse an allocated resource");
+S(NoAvailableResources, -4, "No available resources to allocate");
+S(NullParameter, -5, "A pointer parameter to a method is nullptr");
+S(Timeout, -6, "A timeout has been exceeded");
+S(CompassManufacturerError, -7, "Compass manufacturer doesn't match HiTechnic");
+S(CompassTypeError, -8,
+  "Compass type doesn't match expected type for HiTechnic compass");
+S(IncompatibleMode, -9, "The object is in an incompatible mode");
+S(AnalogTriggerLimitOrderError, -10,
+  "AnalogTrigger limits error.  Lower limit > Upper Limit");
+S(AnalogTriggerPulseOutputError, -11,
+  "Attempted to read AnalogTrigger pulse output.");
+S(TaskError, -12, "Task can't be started");
+S(TaskIDError, -13, "Task error: Invalid ID.");
+S(TaskDeletedError, -14, "Task error: Task already deleted.");
+S(TaskOptionsError, -15, "Task error: Invalid options.");
+S(TaskMemoryError, -16, "Task can't be started due to insufficient memory.");
+S(TaskPriorityError, -17, "Task error: Invalid priority [1-255].");
+S(DriveUninitialized, -18, "RobotDrive not initialized for the C interface");
+S(CompressorNonMatching, -19,
+  "Compressor slot/channel doesn't match previous instance");
+S(CompressorAlreadyDefined, -20, "Creating a second compressor instance");
+S(CompressorUndefined, -21,
+  "Using compressor functions without defining compressor");
+S(InconsistentArrayValueAdded, -22,
+  "When packing data into an array to the dashboard, not all values added were "
+  "of the same type.");
+S(MismatchedComplexTypeClose, -23,
+  "When packing data to the dashboard, a Close for a complex type was called "
+  "without a matching Open.");
+S(DashboardDataOverflow, -24,
+  "When packing data to the dashboard, too much data was packed and the buffer "
+  "overflowed.");
+S(DashboardDataCollision, -25,
+  "The same buffer was used for packing data and for printing.");
+S(EnhancedIOMissing, -26, "IO is not attached or Enhanced IO is not enabled.");
+S(LineNotOutput, -27,
+  "Cannot SetDigitalOutput for a line not configured for output.");
+S(ParameterOutOfRange, -28, "A parameter is out of range.");
+S(SPIClockRateTooLow, -29, "SPI clock rate was below the minimum supported");
+S(JaguarVersionError, -30, "Jaguar firmware version error");
+S(JaguarMessageNotFound, -31, "Jaguar message not found");
+S(NetworkTablesReadError, -40, "Error reading NetworkTables socket");
+S(NetworkTablesBufferFull, -41, "Buffer full writing to NetworkTables socket");
+S(NetworkTablesWrongType, -42,
+  "The wrong type was read from the NetworkTables entry");
+S(NetworkTablesCorrupt, -43, "NetworkTables data stream is corrupt");
+S(SmartDashboardMissingKey, -43, "SmartDashboard data does not exist");
+S(CommandIllegalUse, -50, "Illegal use of Command");
+S(UnsupportedInSimulation, -80, "Unsupported in simulation");
+S(CameraServerError, -90, "CameraServer error");
+
+// Warnings
+S(SampleRateTooHigh, 1, "Analog module sample rate is too high");
+S(VoltageOutOfRange, 2,
+  "Voltage to convert to raw value is out of range [-10; 10]");
+S(CompressorTaskError, 3, "Compressor task won't start");
+S(LoopTimingError, 4, "Digital module loop timing is not the expected value");
+S(NonBinaryDigitalValue, 5, "Digital output value is not 0 or 1");
+S(IncorrectBatteryChannel, 6,
+  "Battery measurement channel is not correct value");
+S(BadJoystickIndex, 7, "Joystick index is out of range, should be 0-3");
+S(BadJoystickAxis, 8, "Joystick axis or POV is out of range");
+S(InvalidMotorIndex, 9, "Motor index is out of range, should be 0-3");
+S(DriverStationTaskError, 10, "Driver Station task won't start");
+S(EnhancedIOPWMPeriodOutOfRange, 11,
+  "Driver Station Enhanced IO PWM Output period out of range.");
+S(SPIWriteNoMOSI, 12, "Cannot write to SPI port with no MOSI output");
+S(SPIReadNoMISO, 13, "Cannot read from SPI port with no MISO input");
+S(SPIReadNoData, 14, "No data available to read from SPI");
+S(IncompatibleState, 15,
+  "Incompatible State: The operation cannot be completed");
+
+#undef S
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPILib.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPILib.h
new file mode 100644
index 0000000..b166354
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPILib.h
@@ -0,0 +1,99 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "ADXL345_I2C.h"
+#include "ADXL345_SPI.h"
+#include "ADXL362.h"
+#include "ADXRS450_Gyro.h"
+#include "AnalogAccelerometer.h"
+#include "AnalogGyro.h"
+#include "AnalogInput.h"
+#include "AnalogOutput.h"
+#include "AnalogPotentiometer.h"
+#include "AnalogTrigger.h"
+#include "AnalogTriggerOutput.h"
+#include "BuiltInAccelerometer.h"
+#include "Buttons/InternalButton.h"
+#include "Buttons/JoystickButton.h"
+#include "Buttons/NetworkButton.h"
+#include "CameraServer.h"
+#include "Commands/Command.h"
+#include "Commands/CommandGroup.h"
+#include "Commands/PIDCommand.h"
+#include "Commands/PIDSubsystem.h"
+#include "Commands/PrintCommand.h"
+#include "Commands/Scheduler.h"
+#include "Commands/StartCommand.h"
+#include "Commands/Subsystem.h"
+#include "Commands/WaitCommand.h"
+#include "Commands/WaitForChildren.h"
+#include "Commands/WaitUntilCommand.h"
+#include "Compressor.h"
+#include "ControllerPower.h"
+#include "Counter.h"
+#include "DMC60.h"
+#include "DigitalInput.h"
+#include "DigitalOutput.h"
+#include "DigitalSource.h"
+#include "DoubleSolenoid.h"
+#include "Drive/DifferentialDrive.h"
+#include "Drive/KilloughDrive.h"
+#include "Drive/MecanumDrive.h"
+#include "DriverStation.h"
+#include "Encoder.h"
+#include "ErrorBase.h"
+#include "Filters/LinearDigitalFilter.h"
+#include "GearTooth.h"
+#include "GenericHID.h"
+#include "I2C.h"
+#include "InterruptableSensorBase.h"
+#include "IterativeRobot.h"
+#include "Jaguar.h"
+#include "Joystick.h"
+#include "NidecBrushless.h"
+#include "Notifier.h"
+#include "PIDController.h"
+#include "PIDOutput.h"
+#include "PIDSource.h"
+#include "PWM.h"
+#include "PWMSpeedController.h"
+#include "PWMTalonSRX.h"
+#include "PWMVictorSPX.h"
+#include "PowerDistributionPanel.h"
+#include "Preferences.h"
+#include "Relay.h"
+#include "RobotBase.h"
+#include "RobotController.h"
+#include "RobotDrive.h"
+#include "SD540.h"
+#include "SPI.h"
+#include "SampleRobot.h"
+#include "SensorBase.h"
+#include "SerialPort.h"
+#include "Servo.h"
+#include "SmartDashboard/SendableChooser.h"
+#include "SmartDashboard/SmartDashboard.h"
+#include "Solenoid.h"
+#include "Spark.h"
+#include "SpeedController.h"
+#include "SpeedControllerGroup.h"
+#include "Talon.h"
+#include "Threads.h"
+#include "TimedRobot.h"
+#include "Timer.h"
+#include "Ultrasonic.h"
+#include "Utility.h"
+#include "Victor.h"
+#include "VictorSP.h"
+#include "WPIErrors.h"
+#include "XboxController.h"
+#include "interfaces/Accelerometer.h"
+#include "interfaces/Gyro.h"
+#include "interfaces/Potentiometer.h"
+#include "vision/VisionRunner.h"
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPILibVersion.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPILibVersion.h
new file mode 100644
index 0000000..8aab880
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/WPILibVersion.h
@@ -0,0 +1,14 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+/*
+ * The corresponding WPILibVersion.cpp file is autogenerated by the build
+ * system. If it does not exist, make sure that you run a build.
+ */
+extern const char* GetWPILibVersion();
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/XboxController.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/XboxController.h
new file mode 100644
index 0000000..71be824
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/XboxController.h
@@ -0,0 +1,82 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "GenericHID.h"
+
+namespace frc {
+
+/**
+ * Handle input from Xbox 360 or Xbox One controllers connected to the Driver
+ * Station.
+ *
+ * This class handles Xbox input that comes from the Driver Station. Each time a
+ * value is requested the most recent value is returned. There is a single class
+ * instance for each controller and the mapping of ports to hardware buttons
+ * depends on the code in the Driver Station.
+ */
+class XboxController : public GenericHID {
+ public:
+  explicit XboxController(int port);
+  virtual ~XboxController() = default;
+
+  XboxController(const XboxController&) = delete;
+  XboxController& operator=(const XboxController&) = delete;
+
+  double GetX(JoystickHand hand) const override;
+  double GetY(JoystickHand hand) const override;
+  double GetTriggerAxis(JoystickHand hand) const;
+
+  bool GetBumper(JoystickHand hand) const;
+  bool GetBumperPressed(JoystickHand hand);
+  bool GetBumperReleased(JoystickHand hand);
+
+  bool GetStickButton(JoystickHand hand) const;
+  bool GetStickButtonPressed(JoystickHand hand);
+  bool GetStickButtonReleased(JoystickHand hand);
+
+  bool GetAButton() const;
+  bool GetAButtonPressed();
+  bool GetAButtonReleased();
+
+  bool GetBButton() const;
+  bool GetBButtonPressed();
+  bool GetBButtonReleased();
+
+  bool GetXButton() const;
+  bool GetXButtonPressed();
+  bool GetXButtonReleased();
+
+  bool GetYButton() const;
+  bool GetYButtonPressed();
+  bool GetYButtonReleased();
+
+  bool GetBackButton() const;
+  bool GetBackButtonPressed();
+  bool GetBackButtonReleased();
+
+  bool GetStartButton() const;
+  bool GetStartButtonPressed();
+  bool GetStartButtonReleased();
+
+ private:
+  enum class Button {
+    kBumperLeft = 5,
+    kBumperRight = 6,
+    kStickLeft = 9,
+    kStickRight = 10,
+    kA = 1,
+    kB = 2,
+    kX = 3,
+    kY = 4,
+    kBack = 7,
+    kStart = 8
+  };
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/circular_buffer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/circular_buffer.h
new file mode 100644
index 0000000..f54f946
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/circular_buffer.h
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <cstddef>
+#include <vector>
+
+namespace frc {
+
+/**
+ * This is a simple circular buffer so we don't need to "bucket brigade" copy
+ * old values.
+ */
+template <class T>
+class circular_buffer {
+ public:
+  explicit circular_buffer(size_t size);
+
+  typedef T value_type;
+  typedef value_type& reference;
+  typedef const value_type& const_reference;
+  typedef value_type* pointer;
+  typedef size_t size_type;
+  typedef std::forward_iterator_tag iterator_category;
+  typedef std::ptrdiff_t difference_type;
+
+  size_type size() const;
+  T& front();
+  const T& front() const;
+  T& back();
+  const T& back() const;
+  void push_front(T value);
+  void push_back(T value);
+  T pop_front();
+  T pop_back();
+  void resize(size_t size);
+  void reset();
+
+  T& operator[](size_t index);
+  const T& operator[](size_t index) const;
+
+ private:
+  std::vector<T> m_data;
+
+  // Index of element at front of buffer
+  size_t m_front = 0;
+
+  // Number of elements used in buffer
+  size_t m_length = 0;
+
+  size_t ModuloInc(size_t index);
+  size_t ModuloDec(size_t index);
+};
+
+}  // namespace frc
+
+#include "circular_buffer.inc"
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/circular_buffer.inc b/third_party/allwpilib_2018/wpilibc/src/main/native/include/circular_buffer.inc
new file mode 100644
index 0000000..4af5040
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/circular_buffer.inc
@@ -0,0 +1,239 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <algorithm>
+
+namespace frc {
+
+template <class T>
+circular_buffer<T>::circular_buffer(size_t size) : m_data(size, 0) {}
+
+/**
+ * Returns number of elements in buffer
+ */
+template <class T>
+typename circular_buffer<T>::size_type circular_buffer<T>::size() const {
+  return m_length;
+}
+
+/**
+ * Returns value at front of buffer
+ */
+template <class T>
+T& circular_buffer<T>::front() {
+  return (*this)[0];
+}
+
+/**
+ * Returns value at front of buffer
+ */
+template <class T>
+const T& circular_buffer<T>::front() const {
+  return (*this)[0];
+}
+
+/**
+ * Returns value at back of buffer
+ */
+template <class T>
+T& circular_buffer<T>::back() {
+  // If there are no elements in the buffer, do nothing
+  if (m_length == 0) {
+    return 0;
+  }
+
+  return m_data[(m_front + m_length - 1) % m_data.size()];
+}
+
+/**
+ * Returns value at back of buffer
+ */
+template <class T>
+const T& circular_buffer<T>::back() const {
+  // If there are no elements in the buffer, do nothing
+  if (m_length == 0) {
+    return 0;
+  }
+
+  return m_data[(m_front + m_length - 1) % m_data.size()];
+}
+
+/**
+ * Push new value onto front of the buffer. The value at the back is overwritten
+ * if the buffer is full.
+ */
+template <class T>
+void circular_buffer<T>::push_front(T value) {
+  if (m_data.size() == 0) {
+    return;
+  }
+
+  m_front = ModuloDec(m_front);
+
+  m_data[m_front] = value;
+
+  if (m_length < m_data.size()) {
+    m_length++;
+  }
+}
+
+/**
+ * Push new value onto back of the buffer. The value at the front is overwritten
+ * if the buffer is full.
+ */
+template <class T>
+void circular_buffer<T>::push_back(T value) {
+  if (m_data.size() == 0) {
+    return;
+  }
+
+  m_data[(m_front + m_length) % m_data.size()] = value;
+
+  if (m_length < m_data.size()) {
+    m_length++;
+  } else {
+    // Increment front if buffer is full to maintain size
+    m_front = ModuloInc(m_front);
+  }
+}
+
+/**
+ * Pop value at front of buffer.
+ */
+template <class T>
+T circular_buffer<T>::pop_front() {
+  // If there are no elements in the buffer, do nothing
+  if (m_length == 0) {
+    return 0;
+  }
+
+  T& temp = m_data[m_front];
+  m_front = ModuloInc(m_front);
+  m_length--;
+  return temp;
+}
+
+/**
+ * Pop value at back of buffer.
+ */
+template <class T>
+T circular_buffer<T>::pop_back() {
+  // If there are no elements in the buffer, do nothing
+  if (m_length == 0) {
+    return 0;
+  }
+
+  m_length--;
+  return m_data[(m_front + m_length) % m_data.size()];
+}
+
+/**
+ * Resizes internal buffer to given size.
+ */
+template <class T>
+void circular_buffer<T>::resize(size_t size) {
+  if (size > m_data.size()) {
+    // Find end of buffer
+    size_t insertLocation = (m_front + m_length) % m_data.size();
+
+    // If insertion location precedes front of buffer, push front index back
+    if (insertLocation <= m_front) {
+      m_front += size - m_data.size();
+    }
+
+    // Add elements to end of buffer
+    m_data.insert(m_data.begin() + insertLocation, size - m_data.size(), 0);
+  } else if (size < m_data.size()) {
+    /* 1) Shift element block start at "front" left as many blocks as were
+     *    removed up to but not exceeding buffer[0]
+     * 2) Shrink buffer, which will remove even more elements automatically if
+     *    necessary
+     */
+    size_t elemsToRemove = m_data.size() - size;
+    auto frontIter = m_data.begin() + m_front;
+    if (m_front < elemsToRemove) {
+      /* Remove elements from end of buffer before shifting start of element
+       * block. Doing so saves a few copies.
+       */
+      m_data.erase(frontIter + size, m_data.end());
+
+      // Shift start of element block to left
+      m_data.erase(m_data.begin(), frontIter);
+
+      // Update metadata
+      m_front = 0;
+    } else {
+      // Shift start of element block to left
+      m_data.erase(frontIter - elemsToRemove, frontIter);
+
+      // Update metadata
+      m_front -= elemsToRemove;
+    }
+
+    /* Length only changes during a shrink if all unused spaces have been
+     * removed. Length decreases as used spaces are removed to meet the
+     * required size.
+     */
+    if (m_length > size) {
+      m_length = size;
+    }
+  }
+}
+
+/**
+ * Sets internal buffer contents to zero.
+ */
+template <class T>
+void circular_buffer<T>::reset() {
+  std::fill(m_data.begin(), m_data.end(), 0);
+  m_front = 0;
+  m_length = 0;
+}
+
+/**
+ * @return Element at index starting from front of buffer.
+ */
+template <class T>
+T& circular_buffer<T>::operator[](size_t index) {
+  return m_data[(m_front + index) % m_data.size()];
+}
+
+/**
+ * @return Element at index starting from front of buffer.
+ */
+template <class T>
+const T& circular_buffer<T>::operator[](size_t index) const {
+  return m_data[(m_front + index) % m_data.size()];
+}
+
+/**
+ * Increment an index modulo the length of the buffer.
+ *
+ * @return The result of the modulo operation.
+ */
+template <class T>
+size_t circular_buffer<T>::ModuloInc(size_t index) {
+  return (index + 1) % m_data.size();
+}
+
+/**
+ * Decrement an index modulo the length of the buffer.
+ *
+ * @return The result of the modulo operation.
+ */
+template <class T>
+size_t circular_buffer<T>::ModuloDec(size_t index) {
+  if (index == 0) {
+    return m_data.size() - 1;
+  } else {
+    return index - 1;
+  }
+}
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Accelerometer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Accelerometer.h
new file mode 100644
index 0000000..c1f6c1f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Accelerometer.h
@@ -0,0 +1,52 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+/**
+ * Interface for 3-axis accelerometers.
+ */
+class Accelerometer {
+ public:
+  virtual ~Accelerometer() = default;
+
+  enum Range { kRange_2G = 0, kRange_4G = 1, kRange_8G = 2, kRange_16G = 3 };
+
+  /**
+   * Common interface for setting the measuring range of an accelerometer.
+   *
+   * @param range The maximum acceleration, positive or negative, that the
+   *              accelerometer will measure. Not all accelerometers support all
+   *              ranges.
+   */
+  virtual void SetRange(Range range) = 0;
+
+  /**
+   * Common interface for getting the x axis acceleration.
+   *
+   * @return The acceleration along the x axis in g-forces
+   */
+  virtual double GetX() = 0;
+
+  /**
+   * Common interface for getting the y axis acceleration.
+   *
+   * @return The acceleration along the y axis in g-forces
+   */
+  virtual double GetY() = 0;
+
+  /**
+   * Common interface for getting the z axis acceleration.
+   *
+   * @return The acceleration along the z axis in g-forces
+   */
+  virtual double GetZ() = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Gyro.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Gyro.h
new file mode 100644
index 0000000..11ba3f6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Gyro.h
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+/**
+ * Interface for yaw rate gyros.
+ */
+class Gyro {
+ public:
+  virtual ~Gyro() = default;
+
+  /**
+   * Calibrate the gyro by running for a number of samples and computing the
+   * center value. Then use the center value as the Accumulator center value for
+   * subsequent measurements. It's important to make sure that the robot is not
+   * moving while the centering calculations are in progress, this is typically
+   * done when the robot is first turned on while it's sitting at rest before
+   * the competition starts.
+   */
+  virtual void Calibrate() = 0;
+
+  /**
+   * Reset the gyro. Resets the gyro to a heading of zero. This can be used if
+   * there is significant drift in the gyro and it needs to be recalibrated
+   * after it has been running.
+   */
+  virtual void Reset() = 0;
+
+  /**
+   * Return the actual angle in degrees that the robot is currently facing.
+   *
+   * The angle is based on the current accumulator value corrected by the
+   * oversampling rate, the gyro type and the A/D calibration values. The angle
+   * is continuous, that is it will continue from 360 to 361 degrees. This
+   * allows algorithms that wouldn't want to see a discontinuity in the gyro
+   * output as it sweeps past from 360 to 0 on the second time around.
+   *
+   * @return the current heading of the robot in degrees. This heading is based
+   *         on integration of the returned rate from the gyro.
+   */
+  virtual double GetAngle() const = 0;
+
+  /**
+   * Return the rate of rotation of the gyro.
+   *
+   * The rate is based on the most recent reading of the gyro analog value.
+   *
+   * @return the current rate in degrees per second
+   */
+  virtual double GetRate() const = 0;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Potentiometer.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Potentiometer.h
new file mode 100644
index 0000000..e399296
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/interfaces/Potentiometer.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "PIDSource.h"
+
+namespace frc {
+
+/**
+ * Interface for potentiometers.
+ */
+class Potentiometer : public PIDSource {
+ public:
+  virtual ~Potentiometer() = default;
+
+  /**
+   * Common interface for getting the current value of a potentiometer.
+   *
+   * @return The current set speed. Value is between -1.0 and 1.0.
+   */
+  virtual double Get() const = 0;
+
+  void SetPIDSourceType(PIDSourceType pidSource) override;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionPipeline.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionPipeline.h
new file mode 100644
index 0000000..de8e54c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionPipeline.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace cv {
+class Mat;
+}  // namespace cv
+
+namespace frc {
+
+/**
+ * A vision pipeline is responsible for running a group of OpenCV algorithms to
+ * extract data from an image.
+ *
+ * @see VisionRunner
+ */
+class VisionPipeline {
+ public:
+  virtual ~VisionPipeline() = default;
+
+  /**
+   * Processes the image input and sets the result objects. Implementations
+   * should make these objects accessible.
+   */
+  virtual void Process(cv::Mat& mat) = 0;
+};
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionRunner.h b/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionRunner.h
new file mode 100644
index 0000000..dfe6ce2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionRunner.h
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <functional>
+#include <memory>
+
+#include "ErrorBase.h"
+#include "cscore.h"
+#include "vision/VisionPipeline.h"
+
+namespace frc {
+
+/**
+ * Non-template base class for VisionRunner.
+ */
+class VisionRunnerBase : public ErrorBase {
+ public:
+  explicit VisionRunnerBase(cs::VideoSource videoSource);
+  ~VisionRunnerBase() override;
+
+  VisionRunnerBase(const VisionRunnerBase&) = delete;
+  VisionRunnerBase& operator=(const VisionRunnerBase&) = delete;
+
+  void RunOnce();
+
+  void RunForever();
+
+  void Stop();
+
+ protected:
+  virtual void DoProcess(cv::Mat& image) = 0;
+
+ private:
+  std::unique_ptr<cv::Mat> m_image;
+  cs::CvSink m_cvSink;
+  std::atomic_bool m_enabled;
+};
+
+/**
+ * A vision runner is a convenient wrapper object to make it easy to run vision
+ * pipelines from robot code. The easiest way to use this is to run it in a
+ * std::thread and use the listener to take snapshots of the pipeline's outputs.
+ *
+ * @see VisionPipeline
+ */
+template <typename T>
+class VisionRunner : public VisionRunnerBase {
+ public:
+  VisionRunner(cs::VideoSource videoSource, T* pipeline,
+               std::function<void(T&)> listener);
+  virtual ~VisionRunner() = default;
+
+ protected:
+  void DoProcess(cv::Mat& image) override;
+
+ private:
+  T* m_pipeline;
+  std::function<void(T&)> m_listener;
+};
+}  // namespace frc
+
+#include "VisionRunner.inc"
diff --git a/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionRunner.inc b/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionRunner.inc
new file mode 100644
index 0000000..1a38048
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/main/native/include/vision/VisionRunner.inc
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+namespace frc {
+
+/**
+ * Creates a new vision runner. It will take images from the {@code
+ * videoSource}, send them to the {@code pipeline}, and call the {@code
+ * listener} when the pipeline has finished to alert user code when it is safe
+ * to access the pipeline's outputs.
+ *
+ * @param videoSource The video source to use to supply images for the pipeline
+ * @param pipeline    The vision pipeline to run
+ * @param listener    A function to call after the pipeline has finished running
+ */
+template <typename T>
+VisionRunner<T>::VisionRunner(cs::VideoSource videoSource, T* pipeline,
+                              std::function<void(T&)> listener)
+    : VisionRunnerBase(videoSource),
+      m_pipeline(pipeline),
+      m_listener(listener) {}
+
+template <typename T>
+void VisionRunner<T>::DoProcess(cv::Mat& image) {
+  m_pipeline->Process(image);
+  m_listener(*m_pipeline);
+}
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibc/src/test/native/cpp/main.cpp b/third_party/allwpilib_2018/wpilibc/src/test/native/cpp/main.cpp
new file mode 100644
index 0000000..298f23c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibc/src/test/native/cpp/main.cpp
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <HAL/HAL.h>
+
+#include "gtest/gtest.h"
+
+int main(int argc, char** argv) {
+  HAL_Initialize(500, 0);
+  ::testing::InitGoogleTest(&argc, argv);
+  int ret = RUN_ALL_TESTS();
+  return ret;
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/.clang-format b/third_party/allwpilib_2018/wpilibcExamples/.clang-format
new file mode 100644
index 0000000..504fb82
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/.clang-format
@@ -0,0 +1,76 @@
+---
+Language: Cpp
+AccessModifierOffset: -8
+AlignAfterOpenBracket: DontAlign
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: true
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Inline
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping: {AfterClass: false, AfterControlStatement: false, AfterEnum: false,
+  AfterFunction: true, AfterNamespace: false, AfterObjCDeclaration: false, AfterStruct: false,
+  AfterUnion: false, BeforeCatch: false, BeforeElse: false, IndentBraces: false}
+BreakBeforeBinaryOperators: NonAssignment
+BreakBeforeBraces: Attach
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializersBeforeComma: true
+ColumnLimit: 80
+CommentPragmas: '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 16
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: true
+ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH]
+IncludeCategories:
+  - {Priority: 2, Regex: ^"(llvm|llvm-c|clang|clang-c)/}
+  - {Priority: 3, Regex: ^(<|"(gtest|isl|json)/)}
+  - {Priority: 1, Regex: .*}
+IndentCaseLabels: true
+IndentWidth: 8
+IndentWrappedFunctionNames: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: Inner
+ObjCBlockIndentWidth: 0
+ObjCSpaceAfterProperty: true
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 345
+PenaltyBreakFirstLessLess: 150
+PenaltyBreakString: 618
+PenaltyExcessCharacter: 977572
+PenaltyReturnTypeOnItsOwnLine: 41
+PointerAlignment: Left
+ReflowComments: true
+SortIncludes: true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 2
+SpacesInAngles: false
+SpacesInCStyleCastParentheses: true
+SpacesInContainerLiterals: true
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Cpp03
+TabWidth: 8
+UseTab: Always
+...
diff --git a/third_party/allwpilib_2018/wpilibcExamples/.styleguide b/third_party/allwpilib_2018/wpilibcExamples/.styleguide
new file mode 100644
index 0000000..1925143
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/.styleguide
@@ -0,0 +1,45 @@
+cppHeaderFileInclude {
+  \.h$
+  \.hpp$
+  \.inc$
+}
+
+cppSrcFileInclude {
+  \.cpp$
+}
+
+generatedFileExclude {
+  gmock/
+  ni-libraries/include/
+  ni-libraries/lib/
+  hal/src/main/native/athena/ctre/
+  hal/src/main/native/athena/frccansae/
+  hal/src/main/native/athena/visa/
+  hal/src/main/native/include/ctre/
+  UsageReporting\.h$
+}
+
+modifiableFileExclude {
+  wpilibj/src/arm-linux-jni/
+  wpilibj/src/main/native/cpp/
+  \.patch$
+  \.png$
+  \.py$
+  \.so$
+}
+
+includeGuardRoots {
+  wpilibcExamples/src/main/cpp/examples/
+  wpilibcExamples/src/main/cpp/templates/
+}
+
+includeOtherLibs {
+  ^HAL/
+  ^llvm/
+  ^opencv2/
+  ^support/
+}
+
+includeProject {
+  ^ctre/
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/build.gradle b/third_party/allwpilib_2018/wpilibcExamples/build.gradle
new file mode 100644
index 0000000..d0b6649
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/build.gradle
@@ -0,0 +1,114 @@
+import org.gradle.language.base.internal.ProjectLayout
+
+if (!project.hasProperty('skipAthena')) {
+    apply plugin: 'cpp'
+    apply plugin: 'visual-studio'
+    apply plugin: 'edu.wpi.first.NativeUtils'
+
+    apply from: '../config.gradle'
+
+    ext.examplesMap = [:]
+    ext.templatesMap = [:]
+
+    File examplesTree = file("$projectDir/src/main/cpp/examples")
+    examplesTree.list(new FilenameFilter() {
+      @Override
+      public boolean accept(File current, String name) {
+        return new File(current, name).isDirectory();
+      }
+    }).each {
+        examplesMap.put(it, [])
+    }
+    File templatesTree = file("$projectDir/src/main/cpp/templates")
+    templatesTree.list(new FilenameFilter() {
+      @Override
+      public boolean accept(File current, String name) {
+        return new File(current, name).isDirectory();
+      }
+    }).each {
+        templatesMap.put(it, [])
+    }
+
+    model {
+        dependencyConfigs {
+            wpiutil(DependencyConfig) {
+                groupId = 'edu.wpi.first.wpiutil'
+                artifactId = 'wpiutil-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.+'
+                sharedConfigs = examplesMap + templatesMap
+            }
+            ntcore(DependencyConfig) {
+                groupId = 'edu.wpi.first.ntcore'
+                artifactId = 'ntcore-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '4.+'
+                sharedConfigs = examplesMap + templatesMap
+            }
+            opencv(DependencyConfig) {
+                groupId = 'org.opencv'
+                artifactId = 'opencv-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.2.0'
+                sharedConfigs = examplesMap + templatesMap
+            }
+            cscore(DependencyConfig) {
+                groupId = 'edu.wpi.first.cscore'
+                artifactId = 'cscore-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '1.+'
+                sharedConfigs = examplesMap + templatesMap
+            }
+        }
+
+        components {
+            examplesMap.each { key, value->
+                "${key}"(NativeExecutableSpec) {
+                    binaries.all { binary->
+                        if (binary.targetPlatform.architecture.name == 'athena') {
+                            project(':ni-libraries').addNiLibrariesToLinker(binary)
+                            project(':hal').addHalToLinker(binary)
+                            project(':wpilibc').addWpilibCToLinker(binary)
+                        } else {
+                            binary.buildable = false
+                        }
+                    }
+                    sources {
+                        cpp {
+                            source {
+                                srcDirs 'src/main/cpp/examples/' + "${key}"
+                                include '**/*.cpp'
+                            }
+                        }
+                    }
+                }
+            }
+            templatesMap.each { key, value->
+                "${key}"(NativeExecutableSpec) {
+                    binaries.all { binary->
+                        if (binary.targetPlatform.architecture.name == 'athena') {
+                            project(':ni-libraries').addNiLibrariesToLinker(binary)
+                            project(':hal').addHalToLinker(binary)
+                            project(':wpilibc').addWpilibCToLinker(binary)
+                        } else {
+                            binary.buildable = false
+                        }
+                    }
+                    sources {
+                        cpp {
+                            source {
+                                srcDirs 'src/main/cpp/templates/' + "${key}"
+                                include '**/*.cpp'
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    apply from: 'publish.gradle'
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/examples.xml b/third_party/allwpilib_2018/wpilibcExamples/examples.xml
new file mode 100644
index 0000000..5450e84
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/examples.xml
@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<examples>
+    <!-- TODO add back in when there are enough samples to justify tags
+    <tagDescription>
+      <name>Simple Robot</name>
+      <description>Examples for simple robot programs.</description>
+    </tagDescription>
+    <tagDescription>
+      <name>Network Tables</name>
+      <description>Examples of how to use Network Tables to accomplish a
+      variety of tasks such as sending and receiving values to both
+      dashboards and co-processors.</description>
+    </tagDescription>
+    <tagDescription>
+      <name>Simulation</name>
+      <description>Examples that can be run in simulation.</description>
+    </tagDescription>-->
+    <tagDescription>
+        <name>Getting Started with C++</name>
+        <description>Examples for getting started with FRC C++</description>
+    </tagDescription>
+    <tagDescription>
+        <name>CommandBased Robot</name>
+        <description>Examples for CommandBased robot programs.</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Actuators</name>
+        <description>Example programs that demonstrate the use of various actuators</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Analog</name>
+        <description>Examples programs that show different uses of analog inputs,
+            outputs and various analog sensors</description>
+    </tagDescription>
+    <tagDescription>
+        <name>CAN</name>
+        <description>Example programs that demonstrate the use of the CAN components in the control
+            system</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Complete List</name>
+        <description>Complete list of all sample programs across all categories</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Digital</name>
+        <description>Example programs that demonstrate the sensors that use the digital I/O ports</description>
+    </tagDescription>
+    <tagDescription>
+        <name>I2C</name>
+        <description>Example programs that demonstrate the use of I2C and various sensors that use
+            it</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Joystick</name>
+        <description>Example programs that demonstate different uses of joysticks for robot
+            driving</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Pneumatics</name>
+        <description>Example programs that demonstrate the use of the compressor and solenoids</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Robot and Motor</name>
+        <description>Example programs that demonstrate driving a robot and motors including safety,
+            servos, etc.</description>
+    </tagDescription>
+    <tagDescription>
+        <name>SPI</name>
+        <description>Example programs that demonstrate the use of the SPI bus and sensors that
+            connect to it</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Safety</name>
+        <description>Example programs that demonstate the motor safety classes and how to use them
+            with your programs</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Sensors</name>
+        <description>Example programs that demonstrate the use of the various commonly used sensors
+            on FRC robots</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Vision</name>
+        <description>Example programs that demonstrate the use of a camera for image acquisition and
+            processing</description>
+    </tagDescription>
+    <example>
+        <name>Motor Controller</name>
+        <description>Demonstrate controlling a single motor with a Joystick.</description>
+        <tags>
+            <tag>Robot and Motor</tag>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/MotorControl/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Motor Control With Encoder</name>
+        <description>Demonstrate controlling a single motor with a Joystick and displaying the net
+            movement of the motor using an encoder.</description>
+        <tags>
+            <tag>Robot and Motor</tag>
+            <tag>Digital</tag>
+            <tag>Sensors</tag>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/MotorControl/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Relay</name>
+        <description>Demonstrate controlling a Relay from Joystick buttons.</description>
+        <tags>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/Relay/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>PDP CAN Monitoring</name>
+        <description>Demonstrate using CAN to monitor the voltage, current, and temperature in the
+            Power Distribution Panel.</description>
+        <tags>
+            <tag>Complete List</tag>
+            <tag>CAN</tag>
+            <tag>Sensors</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/CANPDP/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Solenoids</name>
+        <description>Demonstrate controlling a single and double solenoid from Joystick buttons.</description>
+        <tags>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Pneumatics</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/Solenoid/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Encoder</name>
+        <description>Demonstrate displaying the value of a quadrature encoder on the
+            SmartDashboard.</description>
+        <tags>
+            <tag>Complete List</tag>
+            <tag>Digital</tag>
+            <tag>Sensors</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/Encoder/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Arcade Drive</name>
+        <description>An example program which demonstrates the use of Arcade Drive with the DifferentialDrive class</description>
+        <tags>
+            <tag>Getting Started with C++</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Joystick</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/ArcadeDrive/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Mecanum Drive</name>
+        <description>An example program which demonstrates the use of Mecanum Drive with the MecanumDrive class</description>
+        <tags>
+            <tag>Getting Started with C++</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Joystick</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/MecanumDrive/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Ultrasonic</name>
+        <description>Demonstrate maintaining a set distance using an ultrasonic sensor.</description>
+        <tags>
+            <tag>Robot and Motor</tag>
+            <tag>Complete List</tag>
+            <tag>Sensors</tag>
+            <tag>Analog</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/Ultrasonic/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>UltrasonicPID</name>
+        <description>Demonstrate maintaining a set distance using an ultrasonic sensor and PID
+            control.</description>
+        <tags>
+            <tag>Robot and Motor</tag>
+            <tag>Complete List</tag>
+            <tag>Sensors</tag>
+            <tag>Analog</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/UltrasonicPID/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Gyro</name>
+        <description>An example program showing how to drive straight with using a gyro sensor.</description>
+        <tags>
+            <tag>Robot and Motor</tag>
+            <tag>Complete List</tag>
+            <tag>Sensors</tag>
+            <tag>Analog</tag>
+            <tag>Joystick</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/Gyro/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Gyro Mecanum</name>
+        <description>An example program showing how to perform mecanum drive with field oriented
+            controls.</description>
+        <tags>
+            <tag>Robot and Motor</tag>
+            <tag>Complete List</tag>
+            <tag>Sensors</tag>
+            <tag>Analog</tag>
+            <tag>Joysitck</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/GyroMecanum/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>PotentiometerPID</name>
+        <description>An example to demonstrate the use of a potentiometer and PID control to reach
+            elevator position setpoints.</description>
+        <tags>
+            <tag>Joystick</tag>
+            <tag>Actuators</tag>
+            <tag>Complete List</tag>
+            <tag>Sensors</tag>
+            <tag>Analog</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/PotentiometerPID/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Getting Started</name>
+        <description>An example program which demonstrates the simplest autonomous and
+            teleoperated routines.</description>
+        <tags>
+            <tag>Getting Started with C++</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/GettingStarted/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Simple Vision</name>
+        <description>The minimal program to acquire images from an attached USB camera on the robot
+            and send them to the dashboard.</description>
+        <tags>
+            <tag>Vision</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/QuickVision/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Intermediate Vision</name>
+        <description>An example program that acquires images from an attached USB camera and adds
+            some
+            annotation to the image as you might do for showing operators the result of some image
+            recognition, and sends it to the dashboard for display.</description>
+        <tags>
+            <tag>Vision</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/IntermediateVision/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>Axis Camera Sample</name>
+        <description>An example program that acquires images from an Axis network camera and adds
+            some
+            annotation to the image as you might do for showing operators the result of some image
+            recognition, and sends it to the dashboard for display. This demonstrates the use of the
+            AxisCamera class.</description>
+        <tags>
+            <tag>Vision</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src</package>
+        </packages>
+        <files>
+            <file source="examples/AxisCameraSample/src/Robot.cpp" destination="src/Robot.cpp" />
+        </files>
+    </example>
+    <example>
+        <name>GearsBot</name>
+        <description>A fully functional example CommandBased program for
+            WPIs GearsBot robot. This code can run on your computer if it
+            supports simulation.</description>
+        <tags>
+            <tag>CommandBased Robot</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
+        <packages>
+            <package>src</package>
+            <package>src/Commands</package>
+            <package>src/Subsystems</package>
+        </packages>
+        <files>
+            <file source="examples/GearsBot/src/Commands/Autonomous.cpp" destination="src/Commands/Autonomous.cpp" />
+            <file source="examples/GearsBot/src/Commands/Autonomous.h" destination="src/Commands/Autonomous.h" />
+            <file source="examples/GearsBot/src/Commands/CloseClaw.cpp" destination="src/Commands/CloseClaw.cpp" />
+            <file source="examples/GearsBot/src/Commands/CloseClaw.h" destination="src/Commands/CloseClaw.h" />
+            <file source="examples/GearsBot/src/Commands/DriveStraight.cpp" destination="src/Commands/DriveStraight.cpp" />
+            <file source="examples/GearsBot/src/Commands/DriveStraight.h" destination="src/Commands/DriveStraight.h" />
+            <file source="examples/GearsBot/src/Commands/OpenClaw.cpp" destination="src/Commands/OpenClaw.cpp" />
+            <file source="examples/GearsBot/src/Commands/OpenClaw.h" destination="src/Commands/OpenClaw.h" />
+            <file source="examples/GearsBot/src/Commands/Pickup.cpp" destination="src/Commands/Pickup.cpp" />
+            <file source="examples/GearsBot/src/Commands/Pickup.h" destination="src/Commands/Pickup.h" />
+            <file source="examples/GearsBot/src/Commands/Place.cpp" destination="src/Commands/Place.cpp" />
+            <file source="examples/GearsBot/src/Commands/Place.h" destination="src/Commands/Place.h" />
+            <file source="examples/GearsBot/src/Commands/PrepareToPickup.cpp" destination="src/Commands/PrepareToPickup.cpp" />
+            <file source="examples/GearsBot/src/Commands/PrepareToPickup.h" destination="src/Commands/PrepareToPickup.h" />
+            <file source="examples/GearsBot/src/Commands/SetDistanceToBox.cpp" destination="src/Commands/SetDistanceToBox.cpp" />
+            <file source="examples/GearsBot/src/Commands/SetDistanceToBox.h" destination="src/Commands/SetDistanceToBox.h" />
+            <file source="examples/GearsBot/src/Commands/SetElevatorSetpoint.cpp" destination="src/Commands/SetElevatorSetpoint.cpp" />
+            <file source="examples/GearsBot/src/Commands/SetElevatorSetpoint.h" destination="src/Commands/SetElevatorSetpoint.h" />
+            <file source="examples/GearsBot/src/Commands/SetWristSetpoint.cpp" destination="src/Commands/SetWristSetpoint.cpp" />
+            <file source="examples/GearsBot/src/Commands/SetWristSetpoint.h" destination="src/Commands/SetWristSetpoint.h" />
+            <file source="examples/GearsBot/src/Commands/TankDriveWithJoystick.cpp" destination="src/Commands/TankDriveWithJoystick.cpp" />
+            <file source="examples/GearsBot/src/Commands/TankDriveWithJoystick.h" destination="src/Commands/TankDriveWithJoystick.h" />
+            <file source="examples/GearsBot/src/OI.cpp" destination="src/OI.cpp" />
+            <file source="examples/GearsBot/src/OI.h" destination="src/OI.h" />
+            <file source="examples/GearsBot/src/Robot.cpp" destination="src/Robot.cpp" />
+            <file source="examples/GearsBot/src/Robot.h" destination="src/Robot.h" />
+            <file source="examples/GearsBot/src/Subsystems/Claw.cpp" destination="src/Subsystems/Claw.cpp" />
+            <file source="examples/GearsBot/src/Subsystems/Claw.h" destination="src/Subsystems/Claw.h" />
+            <file source="examples/GearsBot/src/Subsystems/DriveTrain.cpp" destination="src/Subsystems/DriveTrain.cpp" />
+            <file source="examples/GearsBot/src/Subsystems/DriveTrain.h" destination="src/Subsystems/DriveTrain.h" />
+            <file source="examples/GearsBot/src/Subsystems/Elevator.cpp" destination="src/Subsystems/Elevator.cpp" />
+            <file source="examples/GearsBot/src/Subsystems/Elevator.h" destination="src/Subsystems/Elevator.h" />
+            <file source="examples/GearsBot/src/Subsystems/Wrist.cpp" destination="src/Subsystems/Wrist.cpp" />
+            <file source="examples/GearsBot/src/Subsystems/Wrist.h" destination="src/Subsystems/Wrist.h" />
+        </files>
+    </example>
+    <example>
+        <name>PacGoat</name>
+        <description>A fully functional example CommandBased program for FRC Team 190&amp;#39;s 2014
+            robot. This code can run on your computer if it supports simulation.</description>
+        <tags>
+            <tag>CommandBased Robot</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
+        <packages>
+            <package>src</package>
+            <package>src/Commands</package>
+            <package>src/Subsystems</package>
+            <package>src/Triggers</package>
+        </packages>
+        <files>
+            <file source="examples/PacGoat/src/Commands/CheckForHotGoal.cpp" destination="src/Commands/CheckForHotGoal.cpp" />
+            <file source="examples/PacGoat/src/Commands/CheckForHotGoal.h" destination="src/Commands/CheckForHotGoal.h" />
+            <file source="examples/PacGoat/src/Commands/CloseClaw.cpp" destination="src/Commands/CloseClaw.cpp" />
+            <file source="examples/PacGoat/src/Commands/CloseClaw.h" destination="src/Commands/CloseClaw.h" />
+            <file source="examples/PacGoat/src/Commands/Collect.cpp" destination="src/Commands/Collect.cpp" />
+            <file source="examples/PacGoat/src/Commands/Collect.h" destination="src/Commands/Collect.h" />
+            <file source="examples/PacGoat/src/Commands/DriveAndShootAutonomous.cpp" destination="src/Commands/DriveAndShootAutonomous.cpp" />
+            <file source="examples/PacGoat/src/Commands/DriveAndShootAutonomous.h" destination="src/Commands/DriveAndShootAutonomous.h" />
+            <file source="examples/PacGoat/src/Commands/DriveForward.cpp" destination="src/Commands/DriveForward.cpp" />
+            <file source="examples/PacGoat/src/Commands/DriveForward.h" destination="src/Commands/DriveForward.h" />
+            <file source="examples/PacGoat/src/Commands/DriveWithJoystick.cpp" destination="src/Commands/DriveWithJoystick.cpp" />
+            <file source="examples/PacGoat/src/Commands/DriveWithJoystick.h" destination="src/Commands/DriveWithJoystick.h" />
+            <file source="examples/PacGoat/src/Commands/ExtendShooter.cpp" destination="src/Commands/ExtendShooter.cpp" />
+            <file source="examples/PacGoat/src/Commands/ExtendShooter.h" destination="src/Commands/ExtendShooter.h" />
+            <file source="examples/PacGoat/src/Commands/LowGoal.cpp" destination="src/Commands/LowGoal.cpp" />
+            <file source="examples/PacGoat/src/Commands/LowGoal.h" destination="src/Commands/LowGoal.h" />
+            <file source="examples/PacGoat/src/Commands/OpenClaw.cpp" destination="src/Commands/OpenClaw.cpp" />
+            <file source="examples/PacGoat/src/Commands/OpenClaw.h" destination="src/Commands/OpenClaw.h" />
+            <file source="examples/PacGoat/src/Commands/SetCollectionSpeed.cpp" destination="src/Commands/SetCollectionSpeed.cpp" />
+            <file source="examples/PacGoat/src/Commands/SetCollectionSpeed.h" destination="src/Commands/SetCollectionSpeed.h" />
+            <file source="examples/PacGoat/src/Commands/SetPivotSetpoint.cpp" destination="src/Commands/SetPivotSetpoint.cpp" />
+            <file source="examples/PacGoat/src/Commands/SetPivotSetpoint.h" destination="src/Commands/SetPivotSetpoint.h" />
+            <file source="examples/PacGoat/src/Commands/Shoot.cpp" destination="src/Commands/Shoot.cpp" />
+            <file source="examples/PacGoat/src/Commands/Shoot.h" destination="src/Commands/Shoot.h" />
+            <file source="examples/PacGoat/src/Commands/WaitForBall.cpp" destination="src/Commands/WaitForBall.cpp" />
+            <file source="examples/PacGoat/src/Commands/WaitForBall.h" destination="src/Commands/WaitForBall.h" />
+            <file source="examples/PacGoat/src/Commands/WaitForPressure.cpp" destination="src/Commands/WaitForPressure.cpp" />
+            <file source="examples/PacGoat/src/Commands/WaitForPressure.h" destination="src/Commands/WaitForPressure.h" />
+            <file source="examples/PacGoat/src/OI.cpp" destination="src/OI.cpp" />
+            <file source="examples/PacGoat/src/OI.h" destination="src/OI.h" />
+            <file source="examples/PacGoat/src/Robot.cpp" destination="src/Robot.cpp" />
+            <file source="examples/PacGoat/src/Robot.h" destination="src/Robot.h" />
+            <file source="examples/PacGoat/src/Subsystems/Collector.cpp" destination="src/Subsystems/Collector.cpp" />
+            <file source="examples/PacGoat/src/Subsystems/Collector.h" destination="src/Subsystems/Collector.h" />
+            <file source="examples/PacGoat/src/Subsystems/DriveTrain.cpp" destination="src/Subsystems/DriveTrain.cpp" />
+            <file source="examples/PacGoat/src/Subsystems/DriveTrain.h" destination="src/Subsystems/DriveTrain.h" />
+            <file source="examples/PacGoat/src/Subsystems/Pivot.cpp" destination="src/Subsystems/Pivot.cpp" />
+            <file source="examples/PacGoat/src/Subsystems/Pivot.h" destination="src/Subsystems/Pivot.h" />
+            <file source="examples/PacGoat/src/Subsystems/Pneumatics.cpp" destination="src/Subsystems/Pneumatics.cpp" />
+            <file source="examples/PacGoat/src/Subsystems/Pneumatics.h" destination="src/Subsystems/Pneumatics.h" />
+            <file source="examples/PacGoat/src/Subsystems/Shooter.cpp" destination="src/Subsystems/Shooter.cpp" />
+            <file source="examples/PacGoat/src/Subsystems/Shooter.h" destination="src/Subsystems/Shooter.h" />
+            <file source="examples/PacGoat/src/Triggers/DoubleButton.cpp" destination="src/Triggers/DoubleButton.cpp" />
+            <file source="examples/PacGoat/src/Triggers/DoubleButton.h" destination="src/Triggers/DoubleButton.h" />
+        </files>
+    </example>
+</examples>
diff --git a/third_party/allwpilib_2018/wpilibcExamples/publish.gradle b/third_party/allwpilib_2018/wpilibcExamples/publish.gradle
new file mode 100644
index 0000000..a6558a8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/publish.gradle
@@ -0,0 +1,74 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseExamplesArtifactId = 'examples'
+def baseTemplatesArtifactId = 'templates'
+def artifactGroupId = 'edu.wpi.first.wpilibc'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppExamplesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibc-examples'
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/cpp/examples') {
+        into 'examples'
+    }
+
+    from ('examples.xml') {
+        into 'examples'
+    }
+}
+
+task cppTemplatesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibc-templates'
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/cpp/templates') {
+        into 'templates'
+    }
+}
+
+build.dependsOn cppTemplatesZip
+build.dependsOn cppExamplesZip
+
+publishing {
+    publications {
+        examples(MavenPublication) {
+            artifact cppExamplesZip
+
+            artifactId = baseExamplesArtifactId
+            groupId artifactGroupId
+            version pubVersion
+        }
+
+        templates(MavenPublication) {
+            artifact cppTemplatesZip
+
+            artifactId = baseTemplatesArtifactId
+            groupId artifactGroupId
+            version pubVersion
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/src/Robot.cpp
new file mode 100644
index 0000000..5632db3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/src/Robot.cpp
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <Drive/DifferentialDrive.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Spark.h>
+
+/**
+ * This is a demo program showing the use of the DifferentialDrive class.
+ * Runs the motors with arcade steering.
+ */
+class Robot : public frc::IterativeRobot {
+	frc::Spark m_leftMotor{0};
+	frc::Spark m_rightMotor{1};
+	frc::DifferentialDrive m_robotDrive{m_leftMotor, m_rightMotor};
+	frc::Joystick m_stick{0};
+
+public:
+	void TeleopPeriodic() {
+		// drive with arcade style
+		m_robotDrive.ArcadeDrive(m_stick.GetY(), m_stick.GetX());
+	}
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/AxisCameraSample/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/AxisCameraSample/src/Robot.cpp
new file mode 100644
index 0000000..22dc823
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/AxisCameraSample/src/Robot.cpp
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <CameraServer.h>
+#include <IterativeRobot.h>
+#include <opencv2/core/core.hpp>
+#include <opencv2/core/types.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+
+/**
+ * This is a demo program showing the use of OpenCV to do vision processing. The
+ * image is acquired from the Axis camera, then a rectangle is put on the image
+ * and
+ * sent to the dashboard. OpenCV has many methods for different types of
+ * processing.
+ */
+class Robot : public frc::IterativeRobot {
+private:
+	static void VisionThread() {
+		// Get the Axis camera from CameraServer
+		cs::AxisCamera camera =
+				CameraServer::GetInstance()->AddAxisCamera(
+						"axis-camera.local");
+		// Set the resolution
+		camera.SetResolution(640, 480);
+
+		// Get a CvSink. This will capture Mats from the Camera
+		cs::CvSink cvSink = CameraServer::GetInstance()->GetVideo();
+		// Setup a CvSource. This will send images back to the Dashboard
+		cs::CvSource outputStream =
+				CameraServer::GetInstance()->PutVideo(
+						"Rectangle", 640, 480);
+
+		// Mats are very memory expensive. Lets reuse this Mat.
+		cv::Mat mat;
+
+		while (true) {
+			// Tell the CvSink to grab a frame from the camera and
+			// put it
+			// in the source mat.  If there is an error notify the
+			// output.
+			if (cvSink.GrabFrame(mat) == 0) {
+				// Send the output the error.
+				outputStream.NotifyError(cvSink.GetError());
+				// skip the rest of the current iteration
+				continue;
+			}
+			// Put a rectangle on the image
+			rectangle(mat, cv::Point(100, 100), cv::Point(400, 400),
+					cv::Scalar(255, 255, 255), 5);
+			// Give the output stream a new image to display
+			outputStream.PutFrame(mat);
+		}
+	}
+
+	void RobotInit() {
+		// We need to run our vision program in a separate Thread.
+		// If not, our robot program will not run
+		std::thread visionThread(VisionThread);
+		visionThread.detach();
+	}
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/CANPDP/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/CANPDP/src/Robot.cpp
new file mode 100644
index 0000000..07f01fb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/CANPDP/src/Robot.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <IterativeRobot.h>
+#include <PowerDistributionPanel.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+/**
+ * This is a sample program showing how to retrieve information from the Power
+ * Distribution Panel via CAN. The information will be displayed under variables
+ * through the SmartDashboard.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void TeleopPeriodic() override {
+		/* Get the current going through channel 7, in Amperes. The PDP
+		 * returns the current in increments of 0.125A. At low currents
+		 * the
+		 * current readings tend to be less accurate.
+		 */
+		frc::SmartDashboard::PutNumber(
+				"Current Channel 7", m_pdp.GetCurrent(7));
+
+		/* Get the voltage going into the PDP, in Volts.
+		 * The PDP returns the voltage in increments of 0.05 Volts.
+		 */
+		frc::SmartDashboard::PutNumber("Voltage", m_pdp.GetVoltage());
+
+		// Retrieves the temperature of the PDP, in degrees Celsius.
+		frc::SmartDashboard::PutNumber(
+				"Temperature", m_pdp.GetTemperature());
+	}
+
+private:
+	// Object for dealing with the Power Distribution Panel (PDP).
+	frc::PowerDistributionPanel m_pdp;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Encoder/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Encoder/src/Robot.cpp
new file mode 100644
index 0000000..f31942f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Encoder/src/Robot.cpp
@@ -0,0 +1,94 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <Encoder.h>
+#include <IterativeRobot.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+/**
+ * Sample program displaying the value of a quadrature encoder on the
+ *   SmartDashboard.
+ * Quadrature Encoders are digital sensors which can detect the amount the
+ *   encoder has rotated since starting as well as the direction in which the
+ *   encoder shaft is rotating. However, encoders can not tell you the absolute
+ *   position of the encoder shaft (ie, it considers where it starts to be the
+ *   zero position, no matter where it starts), and so can only tell you how
+ *   much the encoder has rotated since starting.
+ * Depending on the precision of an encoder, it will have fewer or greater
+ *   ticks per revolution; the number of ticks per revolution will affect the
+ *   conversion between ticks and distance, as specified by DistancePerPulse.
+ * One of the most common uses of encoders is in the drivetrain, so that the
+ *   distance that the robot drives can be precisely controlled during the
+ *   autonomous mode.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	Robot() {
+		/* Defines the number of samples to average when determining the
+		 * rate.
+		 * On a quadrature encoder, values range from 1-255; larger
+		 * values
+		 *   result in smoother but potentially less accurate rates than
+		 * lower
+		 *   values.
+		 */
+		m_encoder.SetSamplesToAverage(5);
+
+		/* Defines how far the mechanism attached to the encoder moves
+		 * per pulse.
+		 * In this case, we assume that a 360 count encoder is directly
+		 * attached
+		 * to a 3 inch diameter (1.5inch radius) wheel, and that we want
+		 * to
+		 * measure distance in inches.
+		 */
+		m_encoder.SetDistancePerPulse(1.0 / 360.0 * 2.0 * 3.1415 * 1.5);
+
+		/* Defines the lowest rate at which the encoder will not be
+		 * considered
+		 *   stopped, for the purposes of the GetStopped() method.
+		 * Units are in distance / second, where distance refers to the
+		 * units
+		 *   of distance that you are using, in this case inches.
+		 */
+		m_encoder.SetMinRate(1.0);
+	}
+
+	void TeleopPeriodic() override {
+		// Retrieve the net displacement of the Encoder since the last
+		// Reset.
+		frc::SmartDashboard::PutNumber(
+				"Encoder Distance", m_encoder.GetDistance());
+
+		// Retrieve the current rate of the encoder.
+		frc::SmartDashboard::PutNumber(
+				"Encoder Rate", m_encoder.GetRate());
+	}
+
+private:
+	/**
+	 * The Encoder object is constructed with 4 parameters, the last two
+	 * being
+	 *   optional.
+	 * The first two parameters (1, 2 in this case) refer to the ports on
+	 * the
+	 *   roboRIO which the encoder uses. Because a quadrature encoder has
+	 *   two signal wires, the signal from two DIO ports on the roboRIO are
+	 * used.
+	 * The third (optional) parameter is a boolean which defaults to false.
+	 *   If you set this parameter to true, the direction of the encoder
+	 * will
+	 *   be reversed, in case it makes more sense mechanically.
+	 * The final (optional) parameter specifies encoding rate (k1X, k2X, or
+	 * k4X)
+	 *   and defaults to k4X. Faster (k4X) encoding gives greater positional
+	 *   precision but more noise in the rate.
+	 */
+	frc::Encoder m_encoder{1, 2, false, Encoder::k4X};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Autonomous.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Autonomous.cpp
new file mode 100644
index 0000000..c6ce399
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Autonomous.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Autonomous.h"
+
+#include "CloseClaw.h"
+#include "DriveStraight.h"
+#include "Pickup.h"
+#include "Place.h"
+#include "PrepareToPickup.h"
+#include "SetDistanceToBox.h"
+#include "SetWristSetpoint.h"
+
+Autonomous::Autonomous()
+    : frc::CommandGroup("Autonomous") {
+	AddSequential(new PrepareToPickup());
+	AddSequential(new Pickup());
+	AddSequential(new SetDistanceToBox(0.10));
+	// AddSequential(new DriveStraight(4));  // Use Encoders if ultrasonic
+	// is broken
+	AddSequential(new Place());
+	AddSequential(new SetDistanceToBox(0.60));
+	// AddSequential(new DriveStraight(-2));  // Use Encoders if ultrasonic
+	// is broken
+	AddParallel(new SetWristSetpoint(-45));
+	AddSequential(new CloseClaw());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Autonomous.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Autonomous.h
new file mode 100644
index 0000000..44bff14
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Autonomous.h
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * The main autonomous command to pickup and deliver the soda to the box.
+ */
+class Autonomous : public frc::CommandGroup {
+public:
+	Autonomous();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/CloseClaw.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/CloseClaw.cpp
new file mode 100644
index 0000000..732fc80
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/CloseClaw.cpp
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "CloseClaw.h"
+
+#include "../Robot.h"
+
+CloseClaw::CloseClaw()
+    : frc::Command("CloseClaw") {
+	Requires(&Robot::claw);
+}
+
+// Called just before this Command runs the first time
+void CloseClaw::Initialize() {
+	Robot::claw.Close();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool CloseClaw::IsFinished() {
+	return Robot::claw.IsGripping();
+}
+
+// Called once after isFinished returns true
+void CloseClaw::End() {
+// NOTE: Doesn't stop in simulation due to lower friction causing the can to
+// fall out
+// + there is no need to worry about stalling the motor or crushing the can.
+#ifndef SIMULATION
+	Robot::claw.Stop();
+#endif
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/CloseClaw.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/CloseClaw.h
new file mode 100644
index 0000000..350ddb8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/CloseClaw.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Opens the claw for one second. Real robots should use sensors, stalling
+ * motors is BAD!
+ */
+class CloseClaw : public frc::Command {
+public:
+	CloseClaw();
+	void Initialize() override;
+	bool IsFinished() override;
+	void End() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/DriveStraight.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/DriveStraight.cpp
new file mode 100644
index 0000000..cb4ea73
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/DriveStraight.cpp
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriveStraight.h"
+
+#include "../Robot.h"
+
+DriveStraight::DriveStraight(double distance) {
+	Requires(&Robot::drivetrain);
+	m_pid.SetAbsoluteTolerance(0.01);
+	m_pid.SetSetpoint(distance);
+}
+
+// Called just before this Command runs the first time
+void DriveStraight::Initialize() {
+	// Get everything in a safe starting state.
+	Robot::drivetrain.Reset();
+	m_pid.Reset();
+	m_pid.Enable();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool DriveStraight::IsFinished() {
+	return m_pid.OnTarget();
+}
+
+// Called once after isFinished returns true
+void DriveStraight::End() {
+	// Stop PID and the wheels
+	m_pid.Disable();
+	Robot::drivetrain.Drive(0, 0);
+}
+
+double DriveStraight::DriveStraightPIDSource::PIDGet() {
+	return Robot::drivetrain.GetDistance();
+}
+
+void DriveStraight::DriveStraightPIDOutput::PIDWrite(double d) {
+	Robot::drivetrain.Drive(d, d);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/DriveStraight.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/DriveStraight.h
new file mode 100644
index 0000000..8cdfc84
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/DriveStraight.h
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+#include <PIDController.h>
+#include <PIDOutput.h>
+#include <PIDSource.h>
+
+/**
+ * Drive the given distance straight (negative values go backwards).
+ * Uses a local PID controller to run a simple PID loop that is only
+ * enabled while this command is running. The input is the averaged
+ * values of the left and right encoders.
+ */
+class DriveStraight : public frc::Command {
+public:
+	explicit DriveStraight(double distance);
+	void Initialize() override;
+	bool IsFinished() override;
+	void End() override;
+
+	class DriveStraightPIDSource : public frc::PIDSource {
+	public:
+		virtual ~DriveStraightPIDSource() = default;
+		double PIDGet() override;
+	};
+
+	class DriveStraightPIDOutput : public frc::PIDOutput {
+	public:
+		virtual ~DriveStraightPIDOutput() = default;
+		void PIDWrite(double d) override;
+	};
+
+private:
+	DriveStraightPIDSource m_source;
+	DriveStraightPIDOutput m_output;
+	frc::PIDController m_pid{4, 0, 0, &m_source, &m_output};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/OpenClaw.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/OpenClaw.cpp
new file mode 100644
index 0000000..b522640
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/OpenClaw.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "OpenClaw.h"
+
+#include "../Robot.h"
+
+OpenClaw::OpenClaw()
+    : frc::Command("OpenClaw") {
+	Requires(&Robot::claw);
+	SetTimeout(1);
+}
+
+// Called just before this Command runs the first time
+void OpenClaw::Initialize() {
+	Robot::claw.Open();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool OpenClaw::IsFinished() {
+	return IsTimedOut();
+}
+
+// Called once after isFinished returns true
+void OpenClaw::End() {
+	Robot::claw.Stop();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/OpenClaw.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/OpenClaw.h
new file mode 100644
index 0000000..3e0aa2f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/OpenClaw.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Opens the claw for one second. Real robots should use sensors, stalling
+ * motors is BAD!
+ */
+class OpenClaw : public frc::Command {
+public:
+	OpenClaw();
+	void Initialize() override;
+	bool IsFinished() override;
+	void End() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Pickup.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Pickup.cpp
new file mode 100644
index 0000000..aef208f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Pickup.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Pickup.h"
+
+#include "CloseClaw.h"
+#include "SetElevatorSetpoint.h"
+#include "SetWristSetpoint.h"
+
+Pickup::Pickup()
+    : frc::CommandGroup("Pickup") {
+	AddSequential(new CloseClaw());
+	AddParallel(new SetWristSetpoint(-45));
+	AddSequential(new SetElevatorSetpoint(0.25));
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Pickup.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Pickup.h
new file mode 100644
index 0000000..f407690
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Pickup.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Pickup a soda can (if one is between the open claws) and
+ * get it in a safe state to drive around.
+ */
+class Pickup : public frc::CommandGroup {
+public:
+	Pickup();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Place.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Place.cpp
new file mode 100644
index 0000000..d3dfedc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Place.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Place.h"
+
+#include "OpenClaw.h"
+#include "SetElevatorSetpoint.h"
+#include "SetWristSetpoint.h"
+
+Place::Place()
+    : frc::CommandGroup("Place") {
+	AddSequential(new SetElevatorSetpoint(0.25));
+	AddSequential(new SetWristSetpoint(0));
+	AddSequential(new OpenClaw());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Place.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Place.h
new file mode 100644
index 0000000..ceeb3e3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/Place.h
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Place a held soda can onto the platform.
+ */
+class Place : public frc::CommandGroup {
+public:
+	Place();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/PrepareToPickup.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/PrepareToPickup.cpp
new file mode 100644
index 0000000..c3d6781
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/PrepareToPickup.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PrepareToPickup.h"
+
+#include "OpenClaw.h"
+#include "SetElevatorSetpoint.h"
+#include "SetWristSetpoint.h"
+
+PrepareToPickup::PrepareToPickup()
+    : frc::CommandGroup("PrepareToPickup") {
+	AddParallel(new OpenClaw());
+	AddParallel(new SetWristSetpoint(0));
+	AddSequential(new SetElevatorSetpoint(0));
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/PrepareToPickup.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/PrepareToPickup.h
new file mode 100644
index 0000000..13ac8b4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/PrepareToPickup.h
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Make sure the robot is in a state to pickup soda cans.
+ */
+class PrepareToPickup : public frc::CommandGroup {
+public:
+	PrepareToPickup();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetDistanceToBox.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetDistanceToBox.cpp
new file mode 100644
index 0000000..7ce503d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetDistanceToBox.cpp
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SetDistanceToBox.h"
+
+#include <PIDController.h>
+
+#include "../Robot.h"
+
+SetDistanceToBox::SetDistanceToBox(double distance) {
+	Requires(&Robot::drivetrain);
+	m_pid.SetAbsoluteTolerance(0.01);
+	m_pid.SetSetpoint(distance);
+}
+
+// Called just before this Command runs the first time
+void SetDistanceToBox::Initialize() {
+	// Get everything in a safe starting state.
+	Robot::drivetrain.Reset();
+	m_pid.Reset();
+	m_pid.Enable();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool SetDistanceToBox::IsFinished() {
+	return m_pid.OnTarget();
+}
+
+// Called once after isFinished returns true
+void SetDistanceToBox::End() {
+	// Stop PID and the wheels
+	m_pid.Disable();
+	Robot::drivetrain.Drive(0, 0);
+}
+
+double SetDistanceToBox::SetDistanceToBoxPIDSource::PIDGet() {
+	return Robot::drivetrain.GetDistanceToObstacle();
+}
+
+void SetDistanceToBox::SetDistanceToBoxPIDOutput::PIDWrite(double d) {
+	Robot::drivetrain.Drive(d, d);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetDistanceToBox.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetDistanceToBox.h
new file mode 100644
index 0000000..7c0ce86
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetDistanceToBox.h
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+#include <PIDController.h>
+#include <PIDOutput.h>
+#include <PIDSource.h>
+
+/**
+ * Drive until the robot is the given distance away from the box. Uses a local
+ * PID controller to run a simple PID loop that is only enabled while this
+ * command is running. The input is the averaged values of the left and right
+ * encoders.
+ */
+class SetDistanceToBox : public frc::Command {
+public:
+	explicit SetDistanceToBox(double distance);
+	void Initialize() override;
+	bool IsFinished() override;
+	void End() override;
+
+	class SetDistanceToBoxPIDSource : public frc::PIDSource {
+	public:
+		virtual ~SetDistanceToBoxPIDSource() = default;
+		double PIDGet() override;
+	};
+
+	class SetDistanceToBoxPIDOutput : public frc::PIDOutput {
+	public:
+		virtual ~SetDistanceToBoxPIDOutput() = default;
+		void PIDWrite(double d) override;
+	};
+
+private:
+	SetDistanceToBoxPIDSource m_source;
+	SetDistanceToBoxPIDOutput m_output;
+	frc::PIDController m_pid{-2, 0, 0, &m_source, &m_output};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetElevatorSetpoint.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetElevatorSetpoint.cpp
new file mode 100644
index 0000000..daef19c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetElevatorSetpoint.cpp
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SetElevatorSetpoint.h"
+
+#include <cmath>
+
+#include "../Robot.h"
+
+SetElevatorSetpoint::SetElevatorSetpoint(double setpoint)
+    : frc::Command("SetElevatorSetpoint") {
+	m_setpoint = setpoint;
+	Requires(&Robot::elevator);
+}
+
+// Called just before this Command runs the first time
+void SetElevatorSetpoint::Initialize() {
+	Robot::elevator.SetSetpoint(m_setpoint);
+	Robot::elevator.Enable();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool SetElevatorSetpoint::IsFinished() {
+	return Robot::elevator.OnTarget();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetElevatorSetpoint.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetElevatorSetpoint.h
new file mode 100644
index 0000000..494d104
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetElevatorSetpoint.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Move the elevator to a given location. This command finishes when it is
+ * within
+ * the tolerance, but leaves the PID loop running to maintain the position.
+ * Other
+ * commands using the elevator should make sure they disable PID!
+ */
+class SetElevatorSetpoint : public frc::Command {
+public:
+	explicit SetElevatorSetpoint(double setpoint);
+	void Initialize() override;
+	bool IsFinished() override;
+
+private:
+	double m_setpoint;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetWristSetpoint.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetWristSetpoint.cpp
new file mode 100644
index 0000000..be8da58
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetWristSetpoint.cpp
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SetWristSetpoint.h"
+
+#include "../Robot.h"
+
+SetWristSetpoint::SetWristSetpoint(double setpoint)
+    : frc::Command("SetWristSetpoint") {
+	m_setpoint = setpoint;
+	Requires(&Robot::wrist);
+}
+
+// Called just before this Command runs the first time
+void SetWristSetpoint::Initialize() {
+	Robot::wrist.SetSetpoint(m_setpoint);
+	Robot::wrist.Enable();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool SetWristSetpoint::IsFinished() {
+	return Robot::wrist.OnTarget();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetWristSetpoint.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetWristSetpoint.h
new file mode 100644
index 0000000..ccc698a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/SetWristSetpoint.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Move the wrist to a given angle. This command finishes when it is within
+ * the tolerance, but leaves the PID loop running to maintain the position.
+ * Other commands using the wrist should make sure they disable PID!
+ */
+class SetWristSetpoint : public frc::Command {
+public:
+	explicit SetWristSetpoint(double setpoint);
+	void Initialize() override;
+	bool IsFinished() override;
+
+private:
+	double m_setpoint;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/TankDriveWithJoystick.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/TankDriveWithJoystick.cpp
new file mode 100644
index 0000000..e0a22dc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/TankDriveWithJoystick.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "TankDriveWithJoystick.h"
+
+#include "../Robot.h"
+
+TankDriveWithJoystick::TankDriveWithJoystick()
+    : frc::Command("TankDriveWithJoystick") {
+	Requires(&Robot::drivetrain);
+}
+
+// Called repeatedly when this Command is scheduled to run
+void TankDriveWithJoystick::Execute() {
+	auto& joystick = Robot::oi.GetJoystick();
+	Robot::drivetrain.Drive(-joystick.GetY(), -joystick.GetRawAxis(4));
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool TankDriveWithJoystick::IsFinished() {
+	return false;
+}
+
+// Called once after isFinished returns true
+void TankDriveWithJoystick::End() {
+	Robot::drivetrain.Drive(0, 0);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/TankDriveWithJoystick.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/TankDriveWithJoystick.h
new file mode 100644
index 0000000..4beae78
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Commands/TankDriveWithJoystick.h
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Have the robot drive tank style using the PS3 Joystick until interrupted.
+ */
+class TankDriveWithJoystick : public frc::Command {
+public:
+	TankDriveWithJoystick();
+	void Execute() override;
+	bool IsFinished() override;
+	void End() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/OI.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/OI.cpp
new file mode 100644
index 0000000..34906a8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/OI.cpp
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "OI.h"
+
+#include <SmartDashboard/SmartDashboard.h>
+
+#include "Commands/Autonomous.h"
+#include "Commands/CloseClaw.h"
+#include "Commands/OpenClaw.h"
+#include "Commands/Pickup.h"
+#include "Commands/Place.h"
+#include "Commands/PrepareToPickup.h"
+#include "Commands/SetElevatorSetpoint.h"
+
+OI::OI() {
+	frc::SmartDashboard::PutData("Open Claw", new OpenClaw());
+	frc::SmartDashboard::PutData("Close Claw", new CloseClaw());
+
+	// Connect the buttons to commands
+	m_dUp.WhenPressed(new SetElevatorSetpoint(0.2));
+	m_dDown.WhenPressed(new SetElevatorSetpoint(-0.2));
+	m_dRight.WhenPressed(new CloseClaw());
+	m_dLeft.WhenPressed(new OpenClaw());
+
+	m_r1.WhenPressed(new PrepareToPickup());
+	m_r2.WhenPressed(new Pickup());
+	m_l1.WhenPressed(new Place());
+	m_l2.WhenPressed(new Autonomous());
+}
+
+frc::Joystick& OI::GetJoystick() {
+	return m_joy;
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/OI.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/OI.h
new file mode 100644
index 0000000..a63e570
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/OI.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Buttons/JoystickButton.h>
+#include <Joystick.h>
+
+class OI {
+public:
+	OI();
+	frc::Joystick& GetJoystick();
+
+private:
+	frc::Joystick m_joy{0};
+
+	// Create some buttons
+	frc::JoystickButton m_dUp{&m_joy, 5};
+	frc::JoystickButton m_dRight{&m_joy, 6};
+	frc::JoystickButton m_dDown{&m_joy, 7};
+	frc::JoystickButton m_dLeft{&m_joy, 8};
+	frc::JoystickButton m_l2{&m_joy, 9};
+	frc::JoystickButton m_r2{&m_joy, 10};
+	frc::JoystickButton m_l1{&m_joy, 11};
+	frc::JoystickButton m_r1{&m_joy, 12};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Robot.cpp
new file mode 100644
index 0000000..bce1f71
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Robot.cpp
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Robot.h"
+
+#include <iostream>
+
+DriveTrain Robot::drivetrain;
+Elevator Robot::elevator;
+Wrist Robot::wrist;
+Claw Robot::claw;
+OI Robot::oi;
+
+void Robot::RobotInit() {
+	// Show what command your subsystem is running on the SmartDashboard
+	frc::SmartDashboard::PutData(&drivetrain);
+	frc::SmartDashboard::PutData(&elevator);
+	frc::SmartDashboard::PutData(&wrist);
+	frc::SmartDashboard::PutData(&claw);
+}
+
+void Robot::AutonomousInit() {
+	m_autonomousCommand.Start();
+	std::cout << "Starting Auto" << std::endl;
+}
+
+void Robot::AutonomousPeriodic() {
+	frc::Scheduler::GetInstance()->Run();
+}
+
+void Robot::TeleopInit() {
+	// This makes sure that the autonomous stops running when
+	// teleop starts running. If you want the autonomous to
+	// continue until interrupted by another command, remove
+	// this line or comment it out.
+	m_autonomousCommand.Cancel();
+	std::cout << "Starting Teleop" << std::endl;
+}
+
+void Robot::TeleopPeriodic() {
+	frc::Scheduler::GetInstance()->Run();
+}
+
+void Robot::TestPeriodic() {}
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Robot.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Robot.h
new file mode 100644
index 0000000..65fd2e8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Robot.h
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+#include <Commands/Scheduler.h>
+#include <IterativeRobot.h>
+#include <LiveWindow/LiveWindow.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+#include "Commands/Autonomous.h"
+#include "OI.h"
+#include "Subsystems/Claw.h"
+#include "Subsystems/DriveTrain.h"
+#include "Subsystems/Elevator.h"
+#include "Subsystems/Wrist.h"
+
+class Robot : public frc::IterativeRobot {
+public:
+	static DriveTrain drivetrain;
+	static Elevator elevator;
+	static Wrist wrist;
+	static Claw claw;
+	static OI oi;
+
+private:
+	Autonomous m_autonomousCommand;
+	frc::LiveWindow& m_lw = *frc::LiveWindow::GetInstance();
+
+	void RobotInit() override;
+	void AutonomousInit() override;
+	void AutonomousPeriodic() override;
+	void TeleopInit() override;
+	void TeleopPeriodic() override;
+	void TestPeriodic() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Claw.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Claw.cpp
new file mode 100644
index 0000000..768d0d3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Claw.cpp
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Claw.h"
+
+Claw::Claw()
+    : frc::Subsystem("Claw") {
+	// Let's show everything on the LiveWindow
+	AddChild("Motor", m_motor);
+}
+
+void Claw::InitDefaultCommand() {}
+
+void Claw::Open() {
+	m_motor.Set(-1);
+}
+
+void Claw::Close() {
+	m_motor.Set(1);
+}
+
+void Claw::Stop() {
+	m_motor.Set(0);
+}
+
+bool Claw::IsGripping() {
+	return m_contact.Get();
+}
+
+void Claw::Log() {}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Claw.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Claw.h
new file mode 100644
index 0000000..6d4b264
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Claw.h
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Subsystem.h>
+#include <DigitalInput.h>
+#include <Spark.h>
+
+/**
+ * The claw subsystem is a simple system with a motor for opening and closing.
+ * If using stronger motors, you should probably use a sensor so that the
+ * motors don't stall.
+ */
+class Claw : public frc::Subsystem {
+public:
+	Claw();
+
+	void InitDefaultCommand() override;
+
+	/**
+	 * Set the claw motor to move in the open direction.
+	 */
+	void Open();
+
+	/**
+	 * Set the claw motor to move in the close direction.
+	 */
+	void Close();
+
+	/**
+	 * Stops the claw motor from moving.
+	 */
+	void Stop();
+
+	/**
+	 * Return true when the robot is grabbing an object hard enough
+	 * to trigger the limit switch.
+	 */
+	bool IsGripping();
+
+	void Log();
+
+private:
+	frc::Spark m_motor{7};
+	frc::DigitalInput m_contact{5};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/DriveTrain.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/DriveTrain.cpp
new file mode 100644
index 0000000..a732782
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/DriveTrain.cpp
@@ -0,0 +1,87 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriveTrain.h"
+
+#include <Joystick.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+#include "../Commands/TankDriveWithJoystick.h"
+
+DriveTrain::DriveTrain()
+    : frc::Subsystem("DriveTrain") {
+// Encoders may measure differently in the real world and in
+// simulation. In this example the robot moves 0.042 barleycorns
+// per tick in the real world, but the simulated encoders
+// simulate 360 tick encoders. This if statement allows for the
+// real robot to handle this difference in devices.
+#ifndef SIMULATION
+	m_leftEncoder.SetDistancePerPulse(0.042);
+	m_rightEncoder.SetDistancePerPulse(0.042);
+#else
+	// Circumference in ft = 4in/12(in/ft)*PI
+	m_leftEncoder.SetDistancePerPulse(
+			static_cast<double>(4.0 / 12.0 * M_PI) / 360.0);
+	m_rightEncoder.SetDistancePerPulse(
+			static_cast<double>(4.0 / 12.0 * M_PI) / 360.0);
+#endif
+
+	// Let's show everything on the LiveWindow
+	// AddChild("Front_Left Motor", m_frontLeft);
+	// AddChild("Rear Left Motor", m_rearLeft);
+	// AddChild("Front Right Motor", m_frontRight);
+	// AddChild("Rear Right Motor", m_rearRight);
+	AddChild("Left Encoder", m_leftEncoder);
+	AddChild("Right Encoder", m_rightEncoder);
+	AddChild("Rangefinder", m_rangefinder);
+	AddChild("Gyro", m_gyro);
+}
+
+/**
+ * When no other command is running let the operator drive around
+ * using the PS3 joystick.
+ */
+void DriveTrain::InitDefaultCommand() {
+	SetDefaultCommand(new TankDriveWithJoystick());
+}
+
+/**
+ * The log method puts interesting information to the SmartDashboard.
+ */
+void DriveTrain::Log() {
+	frc::SmartDashboard::PutNumber(
+			"Left Distance", m_leftEncoder.GetDistance());
+	frc::SmartDashboard::PutNumber(
+			"Right Distance", m_rightEncoder.GetDistance());
+	frc::SmartDashboard::PutNumber("Left Speed", m_leftEncoder.GetRate());
+	frc::SmartDashboard::PutNumber("Right Speed", m_rightEncoder.GetRate());
+	frc::SmartDashboard::PutNumber("Gyro", m_gyro.GetAngle());
+}
+
+void DriveTrain::Drive(double left, double right) {
+	m_robotDrive.TankDrive(left, right);
+}
+
+double DriveTrain::GetHeading() {
+	return m_gyro.GetAngle();
+}
+
+void DriveTrain::Reset() {
+	m_gyro.Reset();
+	m_leftEncoder.Reset();
+	m_rightEncoder.Reset();
+}
+
+double DriveTrain::GetDistance() {
+	return (m_leftEncoder.GetDistance() + m_rightEncoder.GetDistance())
+	       / 2.0;
+}
+
+double DriveTrain::GetDistanceToObstacle() {
+	// Really meters in simulation since it's a rangefinder...
+	return m_rangefinder.GetAverageVoltage();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/DriveTrain.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/DriveTrain.h
new file mode 100644
index 0000000..9b02849
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/DriveTrain.h
@@ -0,0 +1,84 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <AnalogGyro.h>
+#include <AnalogInput.h>
+#include <Commands/Subsystem.h>
+#include <Drive/DifferentialDrive.h>
+#include <Encoder.h>
+#include <Spark.h>
+#include <SpeedControllerGroup.h>
+
+namespace frc {
+class Joystick;
+}  // namespace frc
+
+/**
+ * The DriveTrain subsystem incorporates the sensors and actuators attached to
+ * the robots chassis. These include four drive motors, a left and right encoder
+ * and a gyro.
+ */
+class DriveTrain : public frc::Subsystem {
+public:
+	DriveTrain();
+
+	/**
+	 * When no other command is running let the operator drive around
+	 * using the PS3 joystick.
+	 */
+	void InitDefaultCommand() override;
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	void Log();
+
+	/**
+	 * Tank style driving for the DriveTrain.
+	 * @param left Speed in range [-1,1]
+	 * @param right Speed in range [-1,1]
+	 */
+	void Drive(double left, double right);
+
+	/**
+	 * @return The robots heading in degrees.
+	 */
+	double GetHeading();
+
+	/**
+	 * Reset the robots sensors to the zero states.
+	 */
+	void Reset();
+
+	/**
+	 * @return The distance driven (average of left and right encoders).
+	 */
+	double GetDistance();
+
+	/**
+	 * @return The distance to the obstacle detected by the rangefinder.
+	 */
+	double GetDistanceToObstacle();
+
+private:
+	frc::Spark m_frontLeft{1};
+	frc::Spark m_rearLeft{2};
+	frc::SpeedControllerGroup m_left{m_frontLeft, m_rearLeft};
+
+	frc::Spark m_frontRight{3};
+	frc::Spark m_rearRight{4};
+	frc::SpeedControllerGroup m_right{m_frontRight, m_rearRight};
+
+	frc::DifferentialDrive m_robotDrive{m_left, m_right};
+
+	frc::Encoder m_leftEncoder{1, 2};
+	frc::Encoder m_rightEncoder{3, 4};
+	frc::AnalogInput m_rangefinder{6};
+	frc::AnalogGyro m_gyro{1};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Elevator.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Elevator.cpp
new file mode 100644
index 0000000..4ff59e3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Elevator.cpp
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Elevator.h"
+
+#include <LiveWindow/LiveWindow.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+Elevator::Elevator()
+    : frc::PIDSubsystem("Elevator", kP_real, kI_real, 0.0) {
+#ifdef SIMULATION  // Check for simulation and update PID values
+	GetPIDController()->SetPID(kP_simulation, kI_simulation, 0, 0);
+#endif
+	SetAbsoluteTolerance(0.005);
+
+	// Let's show everything on the LiveWindow
+	AddChild("Motor", m_motor);
+	AddChild("Pot", &m_pot);
+}
+
+void Elevator::InitDefaultCommand() {}
+
+void Elevator::Log() {
+	// frc::SmartDashboard::PutData("Wrist Pot", &m_pot);
+}
+
+double Elevator::ReturnPIDInput() {
+	return m_pot.Get();
+}
+
+void Elevator::UsePIDOutput(double d) {
+	m_motor.Set(d);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Elevator.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Elevator.h
new file mode 100644
index 0000000..a77bd0e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Elevator.h
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <AnalogPotentiometer.h>
+#include <Commands/PIDSubsystem.h>
+#include <Spark.h>
+
+/**
+ * The elevator subsystem uses PID to go to a given height. Unfortunately, in
+ * it's current
+ * state PID values for simulation are different than in the real world do to
+ * minor differences.
+ */
+class Elevator : public frc::PIDSubsystem {
+public:
+	Elevator();
+
+	void InitDefaultCommand() override;
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	void Log();
+
+	/**
+	 * Use the potentiometer as the PID sensor. This method is automatically
+	 * called by the subsystem.
+	 */
+	double ReturnPIDInput();
+
+	/**
+	 * Use the motor as the PID output. This method is automatically called
+	 * by
+	 * the subsystem.
+	 */
+	void UsePIDOutput(double d);
+
+private:
+	frc::Spark m_motor{5};
+
+// Conversion value of potentiometer varies between the real world and
+// simulation
+#ifndef SIMULATION
+	frc::AnalogPotentiometer m_pot{2, -2.0 / 5};
+#else
+	frc::AnalogPotentiometer m_pot{2};  // Defaults to meters
+#endif
+
+	static constexpr double kP_real = 4;
+	static constexpr double kI_real = 0.07;
+	static constexpr double kP_simulation = 18;
+	static constexpr double kI_simulation = 0.2;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Wrist.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Wrist.cpp
new file mode 100644
index 0000000..b1be1dc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Wrist.cpp
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Wrist.h"
+
+#include <SmartDashboard/SmartDashboard.h>
+
+Wrist::Wrist()
+    : frc::PIDSubsystem("Wrist", kP_real, 0.0, 0.0) {
+#ifdef SIMULATION  // Check for simulation and update PID values
+	GetPIDController()->SetPID(kP_simulation, 0, 0, 0);
+#endif
+	SetAbsoluteTolerance(2.5);
+
+	// Let's show everything on the LiveWindow
+	AddChild("Motor", m_motor);
+	AddChild("Pot", m_pot);
+}
+
+void Wrist::InitDefaultCommand() {}
+
+void Wrist::Log() {
+	// frc::SmartDashboard::PutData("Wrist Angle", &m_pot);
+}
+
+double Wrist::ReturnPIDInput() {
+	return m_pot.Get();
+}
+
+void Wrist::UsePIDOutput(double d) {
+	m_motor.Set(d);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Wrist.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Wrist.h
new file mode 100644
index 0000000..2cd5a64
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GearsBot/src/Subsystems/Wrist.h
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <AnalogPotentiometer.h>
+#include <Commands/PIDSubsystem.h>
+#include <Spark.h>
+
+/**
+ * The wrist subsystem is like the elevator, but with a rotational joint instead
+ * of a linear joint.
+ */
+class Wrist : public PIDSubsystem {
+public:
+	Wrist();
+
+	void InitDefaultCommand() override;
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	void Log();
+
+	/**
+	 * Use the potentiometer as the PID sensor. This method is automatically
+	 * called by the subsystem.
+	 */
+	double ReturnPIDInput() override;
+
+	/**
+	 * Use the motor as the PID output. This method is automatically called
+	 * by
+	 * the subsystem.
+	 */
+	void UsePIDOutput(double d) override;
+
+private:
+	frc::Spark m_motor{6};
+
+// Conversion value of potentiometer varies between the real world and
+// simulation
+#ifndef SIMULATION
+	frc::AnalogPotentiometer m_pot{3, -270.0 / 5};
+#else
+	frc::AnalogPotentiometer m_pot{3};  // Defaults to degrees
+#endif
+
+	static constexpr double kP_real = 1;
+	static constexpr double kP_simulation = 0.05;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GettingStarted/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GettingStarted/src/Robot.cpp
new file mode 100644
index 0000000..e0bebe5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GettingStarted/src/Robot.cpp
@@ -0,0 +1,58 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <Drive/DifferentialDrive.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <LiveWindow/LiveWindow.h>
+#include <Spark.h>
+#include <Timer.h>
+
+class Robot : public frc::IterativeRobot {
+public:
+	Robot() {
+		m_robotDrive.SetExpiration(0.1);
+		m_timer.Start();
+	}
+
+	void AutonomousInit() override {
+		m_timer.Reset();
+		m_timer.Start();
+	}
+
+	void AutonomousPeriodic() override {
+		// Drive for 2 seconds
+		if (m_timer.Get() < 2.0) {
+			// Drive forwards half speed
+			m_robotDrive.ArcadeDrive(-0.5, 0.0);
+		} else {
+			// Stop robot
+			m_robotDrive.ArcadeDrive(0.0, 0.0);
+		}
+	}
+
+	void TeleopInit() override {}
+
+	void TeleopPeriodic() override {
+		// Drive with arcade style (use right stick)
+		m_robotDrive.ArcadeDrive(m_stick.GetY(), m_stick.GetX());
+	}
+
+	void TestPeriodic() override {}
+
+private:
+	// Robot drive system
+	frc::Spark m_left{0};
+	frc::Spark m_right{1};
+	frc::DifferentialDrive m_robotDrive{m_left, m_right};
+
+	frc::Joystick m_stick{0};
+	frc::LiveWindow& m_lw = *frc::LiveWindow::GetInstance();
+	frc::Timer m_timer;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Gyro/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Gyro/src/Robot.cpp
new file mode 100644
index 0000000..b67ea86
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Gyro/src/Robot.cpp
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cmath>
+
+#include <AnalogGyro.h>
+#include <Drive/DifferentialDrive.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Spark.h>
+
+/**
+ * This is a sample program to demonstrate how to use a gyro sensor to make a
+ * robot drive straight. This program uses a joystick to drive forwards and
+ * backwards while the gyro is used for direction keeping.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void RobotInit() override {
+		m_gyro.SetSensitivity(kVoltsPerDegreePerSecond);
+	}
+
+	/**
+	 * The motor speed is set from the joystick while the DifferentialDrive
+	 * turning value is assigned from the error between the setpoint and the
+	 * gyro angle.
+	 */
+	void TeleopPeriodic() override {
+		double turningValue = (kAngleSetpoint - m_gyro.GetAngle()) * kP;
+		// Invert the direction of the turn if we are going backwards
+		turningValue = std::copysign(turningValue, m_joystick.GetY());
+		m_robotDrive.ArcadeDrive(m_joystick.GetY(), turningValue);
+	}
+
+private:
+	static constexpr double kAngleSetpoint = 0.0;
+	static constexpr double kP = 0.005;  // Proportional turning constant
+
+	// Gyro calibration constant, may need to be adjusted
+	// Gyro value of 360 is set to correspond to one full revolution
+	static constexpr double kVoltsPerDegreePerSecond = 0.0128;
+
+	static constexpr int kLeftMotorPort = 0;
+	static constexpr int kRightMotorPort = 1;
+	static constexpr int kGyroPort = 0;
+	static constexpr int kJoystickPort = 0;
+
+	frc::Spark m_left{kLeftMotorPort};
+	frc::Spark m_right{kRightMotorPort};
+	frc::DifferentialDrive m_robotDrive{m_left, m_right};
+
+	frc::AnalogGyro m_gyro{kGyroPort};
+	frc::Joystick m_joystick{kJoystickPort};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GyroMecanum/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GyroMecanum/src/Robot.cpp
new file mode 100644
index 0000000..47ae63a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/GyroMecanum/src/Robot.cpp
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <AnalogGyro.h>
+#include <Drive/MecanumDrive.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Spark.h>
+
+/**
+ * This is a sample program that uses mecanum drive with a gyro sensor to
+ * maintian rotation vectorsin relation to the starting orientation of the robot
+ * (field-oriented controls).
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void RobotInit() override {
+		// invert the left side motors
+		// you may need to change or remove this to match your robot
+		m_frontLeft.SetInverted(true);
+		m_rearLeft.SetInverted(true);
+
+		m_gyro.SetSensitivity(kVoltsPerDegreePerSecond);
+	}
+
+	/**
+	 * Mecanum drive is used with the gyro angle as an input.
+	 */
+	void TeleopPeriodic() override {
+		m_robotDrive.DriveCartesian(m_joystick.GetX(),
+				m_joystick.GetY(), m_joystick.GetZ(),
+				m_gyro.GetAngle());
+	}
+
+private:
+	// Gyro calibration constant, may need to be adjusted
+	// Gyro value of 360 is set to correspond to one full revolution
+	static constexpr double kVoltsPerDegreePerSecond = 0.0128;
+
+	static constexpr int kFrontLeftMotorPort = 0;
+	static constexpr int kRearLeftMotorPort = 1;
+	static constexpr int kFrontRightMotorPort = 2;
+	static constexpr int kRearRightMotorPort = 3;
+	static constexpr int kGyroPort = 0;
+	static constexpr int kJoystickPort = 0;
+
+	frc::Spark m_frontLeft{kFrontLeftMotorPort};
+	frc::Spark m_rearLeft{kRearLeftMotorPort};
+	frc::Spark m_frontRight{kFrontRightMotorPort};
+	frc::Spark m_rearRight{kRearRightMotorPort};
+	frc::MecanumDrive m_robotDrive{
+			m_frontLeft, m_rearLeft, m_frontRight, m_rearRight};
+
+	frc::AnalogGyro m_gyro{kGyroPort};
+	frc::Joystick m_joystick{kJoystickPort};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/IntermediateVision/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/IntermediateVision/src/Robot.cpp
new file mode 100644
index 0000000..808574d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/IntermediateVision/src/Robot.cpp
@@ -0,0 +1,70 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <thread>
+
+#include <CameraServer.h>
+#include <IterativeRobot.h>
+#include <opencv2/core/core.hpp>
+#include <opencv2/core/types.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
+
+/**
+ * This is a demo program showing the use of OpenCV to do vision processing. The
+ * image is acquired from the USB camera, then a rectangle is put on the image
+ * and
+ * sent to the dashboard. OpenCV has many methods for different types of
+ * processing.
+ */
+class Robot : public frc::IterativeRobot {
+private:
+	static void VisionThread() {
+		// Get the USB camera from CameraServer
+		cs::UsbCamera camera =
+				CameraServer::GetInstance()
+						->StartAutomaticCapture();
+		// Set the resolution
+		camera.SetResolution(640, 480);
+
+		// Get a CvSink. This will capture Mats from the Camera
+		cs::CvSink cvSink = CameraServer::GetInstance()->GetVideo();
+		// Setup a CvSource. This will send images back to the Dashboard
+		cs::CvSource outputStream =
+				CameraServer::GetInstance()->PutVideo(
+						"Rectangle", 640, 480);
+
+		// Mats are very memory expensive. Lets reuse this Mat.
+		cv::Mat mat;
+
+		while (true) {
+			// Tell the CvSink to grab a frame from the camera and
+			// put it
+			// in the source mat.  If there is an error notify the
+			// output.
+			if (cvSink.GrabFrame(mat) == 0) {
+				// Send the output the error.
+				outputStream.NotifyError(cvSink.GetError());
+				// skip the rest of the current iteration
+				continue;
+			}
+			// Put a rectangle on the image
+			rectangle(mat, cv::Point(100, 100), cv::Point(400, 400),
+					cv::Scalar(255, 255, 255), 5);
+			// Give the output stream a new image to display
+			outputStream.PutFrame(mat);
+		}
+	}
+
+	void RobotInit() {
+		// We need to run our vision program in a separate Thread.
+		// If not, our robot program will not run
+		std::thread visionThread(VisionThread);
+		visionThread.detach();
+	}
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/MecanumDrive/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/MecanumDrive/src/Robot.cpp
new file mode 100644
index 0000000..6eb1a89
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/MecanumDrive/src/Robot.cpp
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <Drive/MecanumDrive.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Spark.h>
+
+/**
+ * This is a demo program showing how to use Mecanum control with the
+ * MecanumDrive class.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void RobotInit() {
+		// Invert the left side motors
+		// You may need to change or remove this to match your robot
+		m_frontLeft.SetInverted(true);
+		m_rearLeft.SetInverted(true);
+	}
+
+	void TeleopPeriodic() override {
+		/* Use the joystick X axis for lateral movement, Y axis for
+		 * forward
+		 * movement, and Z axis for rotation.
+		 */
+		m_robotDrive.DriveCartesian(
+				m_stick.GetX(), m_stick.GetY(), m_stick.GetZ());
+	}
+
+private:
+	static constexpr int kFrontLeftChannel = 0;
+	static constexpr int kRearLeftChannel = 1;
+	static constexpr int kFrontRightChannel = 2;
+	static constexpr int kRearRightChannel = 3;
+
+	static constexpr int kJoystickChannel = 0;
+
+	frc::Spark m_frontLeft{kFrontLeftChannel};
+	frc::Spark m_rearLeft{kRearLeftChannel};
+	frc::Spark m_frontRight{kFrontRightChannel};
+	frc::Spark m_rearRight{kRearRightChannel};
+	frc::MecanumDrive m_robotDrive{
+			m_frontLeft, m_rearLeft, m_frontRight, m_rearRight};
+
+	frc::Joystick m_stick{kJoystickChannel};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/MotorControl/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/MotorControl/src/Robot.cpp
new file mode 100644
index 0000000..7247fae
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/MotorControl/src/Robot.cpp
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Spark.h>
+
+/**
+ * This sample program shows how to control a motor using a joystick. In the
+ * operator control part of the program, the joystick is read and the value is
+ * written to the motor.
+ *
+ * Joystick analog values range from -1 to 1 and speed controller inputs as
+ * range from -1 to 1 making it easy to work together.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void TeleopPeriodic() override { m_motor.Set(m_stick.GetY()); }
+
+private:
+	frc::Joystick m_stick{0};
+	frc::Spark m_motor{0};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CheckForHotGoal.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CheckForHotGoal.cpp
new file mode 100644
index 0000000..54fd249
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CheckForHotGoal.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "CheckForHotGoal.h"
+
+#include "../Robot.h"
+
+CheckForHotGoal::CheckForHotGoal(double time) {
+	SetTimeout(time);
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool CheckForHotGoal::IsFinished() {
+	return IsTimedOut() || Robot::shooter.GoalIsHot();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CheckForHotGoal.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CheckForHotGoal.h
new file mode 100644
index 0000000..7f67990
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CheckForHotGoal.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * This command looks for the hot goal and waits until it's detected or timed
+ * out. The timeout is because it's better to shoot and get some autonomous
+ * points than get none. When called sequentially, this command will block until
+ * the hot goal is detected or until it is timed out.
+ */
+class CheckForHotGoal : public frc::Command {
+public:
+	explicit CheckForHotGoal(double time);
+	bool IsFinished() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CloseClaw.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CloseClaw.cpp
new file mode 100644
index 0000000..8305521
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CloseClaw.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "CloseClaw.h"
+
+#include "../Robot.h"
+
+CloseClaw::CloseClaw() {
+	Requires(&Robot::collector);
+}
+
+// Called just before this Command runs the first time
+void CloseClaw::Initialize() {
+	Robot::collector.Close();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CloseClaw.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CloseClaw.h
new file mode 100644
index 0000000..0e3edac
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/CloseClaw.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/InstantCommand.h>
+
+/**
+ * Close the claw.
+ *
+ * NOTE: It doesn't wait for the claw to close since there is no sensor to
+ * detect that.
+ */
+class CloseClaw : public frc::InstantCommand {
+public:
+	CloseClaw();
+	void Initialize() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Collect.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Collect.cpp
new file mode 100644
index 0000000..1c22657
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Collect.cpp
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Collect.h"
+
+#include "../Robot.h"
+#include "CloseClaw.h"
+#include "SetCollectionSpeed.h"
+#include "SetPivotSetpoint.h"
+#include "WaitForBall.h"
+
+Collect::Collect() {
+	AddSequential(new SetCollectionSpeed(Collector::kForward));
+	AddParallel(new CloseClaw());
+	AddSequential(new SetPivotSetpoint(Pivot::kCollect));
+	AddSequential(new WaitForBall());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Collect.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Collect.h
new file mode 100644
index 0000000..496a65f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Collect.h
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Get the robot set to collect balls.
+ */
+class Collect : public frc::CommandGroup {
+public:
+	Collect();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveAndShootAutonomous.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveAndShootAutonomous.cpp
new file mode 100644
index 0000000..2b9341b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveAndShootAutonomous.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriveAndShootAutonomous.h"
+
+#include "../Robot.h"
+#include "CheckForHotGoal.h"
+#include "CloseClaw.h"
+#include "DriveForward.h"
+#include "SetPivotSetpoint.h"
+#include "Shoot.h"
+#include "WaitForPressure.h"
+
+DriveAndShootAutonomous::DriveAndShootAutonomous() {
+	AddSequential(new CloseClaw());
+	AddSequential(new WaitForPressure(), 2);
+#ifndef SIMULATION
+	// NOTE: Simulation doesn't currently have the concept of hot.
+	AddSequential(new CheckForHotGoal(2));
+#endif
+	AddSequential(new SetPivotSetpoint(45));
+	AddSequential(new DriveForward(8, 0.3));
+	AddSequential(new Shoot());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveAndShootAutonomous.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveAndShootAutonomous.h
new file mode 100644
index 0000000..0df3975
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveAndShootAutonomous.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Drive over the line and then shoot the ball. If the hot goal is not detected,
+ * it will wait briefly.
+ */
+class DriveAndShootAutonomous : public frc::CommandGroup {
+public:
+	DriveAndShootAutonomous();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveForward.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveForward.cpp
new file mode 100644
index 0000000..a0d4442
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveForward.cpp
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriveForward.h"
+
+#include <cmath>
+
+#include "../Robot.h"
+
+void DriveForward::init(double dist, double maxSpeed) {
+	Requires(&Robot::drivetrain);
+	m_distance = dist;
+	m_driveForwardSpeed = maxSpeed;
+}
+
+DriveForward::DriveForward() {
+	init(10, 0.5);
+}
+
+DriveForward::DriveForward(double dist) {
+	init(dist, 0.5);
+}
+
+DriveForward::DriveForward(double dist, double maxSpeed) {
+	init(dist, maxSpeed);
+}
+
+// Called just before this Command runs the first time
+void DriveForward::Initialize() {
+	Robot::drivetrain.GetRightEncoder().Reset();
+	SetTimeout(2);
+}
+
+// Called repeatedly when this Command is scheduled to run
+void DriveForward::Execute() {
+	m_error = (m_distance
+			- Robot::drivetrain.GetRightEncoder().GetDistance());
+	if (m_driveForwardSpeed * kP * m_error >= m_driveForwardSpeed) {
+		Robot::drivetrain.TankDrive(
+				m_driveForwardSpeed, m_driveForwardSpeed);
+	} else {
+		Robot::drivetrain.TankDrive(m_driveForwardSpeed * kP * m_error,
+				m_driveForwardSpeed * kP * m_error);
+	}
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool DriveForward::IsFinished() {
+	return (std::fabs(m_error) <= kTolerance) || IsTimedOut();
+}
+
+// Called once after isFinished returns true
+void DriveForward::End() {
+	Robot::drivetrain.Stop();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveForward.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveForward.h
new file mode 100644
index 0000000..248c865
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveForward.h
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * This command drives the robot over a given distance with simple proportional
+ * control This command will drive a given distance limiting to a maximum speed.
+ */
+class DriveForward : public frc::Command {
+public:
+	DriveForward();
+	explicit DriveForward(double dist);
+	DriveForward(double dist, double maxSpeed);
+	void Initialize() override;
+	void Execute() override;
+	bool IsFinished() override;
+	void End() override;
+
+private:
+	double m_driveForwardSpeed;
+	double m_distance;
+	double m_error = 0;
+	static constexpr double kTolerance = 0.1;
+	static constexpr double kP = -1.0 / 5.0;
+
+	void init(double dist, double maxSpeed);
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveWithJoystick.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveWithJoystick.cpp
new file mode 100644
index 0000000..f07e129
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveWithJoystick.cpp
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriveWithJoystick.h"
+
+#include "../Robot.h"
+
+DriveWithJoystick::DriveWithJoystick() {
+	Requires(&Robot::drivetrain);
+}
+
+// Called repeatedly when this Command is scheduled to run
+void DriveWithJoystick::Execute() {
+	auto& joystick = Robot::oi.GetJoystick();
+	Robot::drivetrain.TankDrive(joystick.GetY(), joystick.GetRawAxis(4));
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool DriveWithJoystick::IsFinished() {
+	return false;
+}
+
+// Called once after isFinished returns true
+void DriveWithJoystick::End() {
+	Robot::drivetrain.Stop();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveWithJoystick.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveWithJoystick.h
new file mode 100644
index 0000000..79ae75f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/DriveWithJoystick.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * This command allows PS3 joystick to drive the robot. It is always running
+ * except when interrupted by another command.
+ */
+class DriveWithJoystick : public frc::Command {
+public:
+	DriveWithJoystick();
+	void Execute() override;
+	bool IsFinished() override;
+	void End() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/ExtendShooter.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/ExtendShooter.cpp
new file mode 100644
index 0000000..a2fe843
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/ExtendShooter.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ExtendShooter.h"
+
+#include "../Robot.h"
+
+ExtendShooter::ExtendShooter()
+    : frc::TimedCommand(1.0) {
+	Requires(&Robot::shooter);
+}
+
+// Called just before this Command runs the first time
+void ExtendShooter::Initialize() {
+	Robot::shooter.ExtendBoth();
+}
+
+// Called once after isFinished returns true
+void ExtendShooter::End() {
+	Robot::shooter.RetractBoth();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/ExtendShooter.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/ExtendShooter.h
new file mode 100644
index 0000000..c129e60
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/ExtendShooter.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/TimedCommand.h>
+
+/**
+ * Extend the shooter and then retract it after a second.
+ */
+class ExtendShooter : public frc::TimedCommand {
+public:
+	ExtendShooter();
+	void Initialize() override;
+	void End() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/LowGoal.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/LowGoal.cpp
new file mode 100644
index 0000000..ce9068c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/LowGoal.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "LowGoal.h"
+
+#include "../Robot.h"
+#include "ExtendShooter.h"
+#include "SetCollectionSpeed.h"
+#include "SetPivotSetpoint.h"
+
+LowGoal::LowGoal() {
+	AddSequential(new SetPivotSetpoint(Pivot::kLowGoal));
+	AddSequential(new SetCollectionSpeed(Collector::kReverse));
+	AddSequential(new ExtendShooter());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/LowGoal.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/LowGoal.h
new file mode 100644
index 0000000..361e8eb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/LowGoal.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Spit the ball out into the low goal assuming that the robot is in front of
+ * it.
+ */
+class LowGoal : public frc::CommandGroup {
+public:
+	LowGoal();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/OpenClaw.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/OpenClaw.cpp
new file mode 100644
index 0000000..5a36e58
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/OpenClaw.cpp
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "OpenClaw.h"
+
+#include "../Robot.h"
+
+OpenClaw::OpenClaw() {
+	Requires(&Robot::collector);
+}
+
+// Called just before this Command runs the first time
+void OpenClaw::Initialize() {
+	Robot::collector.Open();
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool OpenClaw::IsFinished() {
+	return Robot::collector.IsOpen();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/OpenClaw.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/OpenClaw.h
new file mode 100644
index 0000000..0485d35
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/OpenClaw.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Opens the claw
+ */
+class OpenClaw : public frc::Command {
+public:
+	OpenClaw();
+	void Initialize() override;
+	bool IsFinished() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetCollectionSpeed.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetCollectionSpeed.cpp
new file mode 100644
index 0000000..1e26121
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetCollectionSpeed.cpp
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SetCollectionSpeed.h"
+
+#include "../Robot.h"
+
+SetCollectionSpeed::SetCollectionSpeed(double speed) {
+	Requires(&Robot::collector);
+	m_speed = speed;
+}
+
+// Called just before this Command runs the first time
+void SetCollectionSpeed::Initialize() {
+	Robot::collector.SetSpeed(m_speed);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetCollectionSpeed.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetCollectionSpeed.h
new file mode 100644
index 0000000..07de772
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetCollectionSpeed.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/InstantCommand.h>
+
+/**
+ * This command sets the collector rollers spinning at the given speed. Since
+ * there is no sensor for detecting speed, it finishes immediately. As a result,
+ * the spinners may still be adjusting their speed.
+ */
+class SetCollectionSpeed : public frc::InstantCommand {
+public:
+	explicit SetCollectionSpeed(double speed);
+	void Initialize() override;
+
+private:
+	double m_speed;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetPivotSetpoint.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetPivotSetpoint.cpp
new file mode 100644
index 0000000..ce30562
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetPivotSetpoint.cpp
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SetPivotSetpoint.h"
+
+#include "../Robot.h"
+
+SetPivotSetpoint::SetPivotSetpoint(double setpoint) {
+	m_setpoint = setpoint;
+	Requires(&Robot::pivot);
+}
+
+// Called just before this Command runs the first time
+void SetPivotSetpoint::Initialize() {
+	Robot::pivot.Enable();
+	Robot::pivot.SetSetpoint(m_setpoint);
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool SetPivotSetpoint::IsFinished() {
+	return Robot::pivot.OnTarget();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetPivotSetpoint.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetPivotSetpoint.h
new file mode 100644
index 0000000..681417e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/SetPivotSetpoint.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Moves the  pivot to a given angle. This command finishes when it is within
+ * the tolerance, but leaves the PID loop running to maintain the position.
+ * Other commands using the pivot should make sure they disable PID!
+ */
+class SetPivotSetpoint : public frc::Command {
+public:
+	explicit SetPivotSetpoint(double setpoint);
+	void Initialize() override;
+	bool IsFinished() override;
+
+private:
+	double m_setpoint;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Shoot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Shoot.cpp
new file mode 100644
index 0000000..fa47d36
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Shoot.cpp
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Shoot.h"
+
+#include "../Robot.h"
+#include "ExtendShooter.h"
+#include "OpenClaw.h"
+#include "SetCollectionSpeed.h"
+#include "WaitForPressure.h"
+
+Shoot::Shoot() {
+	AddSequential(new WaitForPressure());
+	AddSequential(new SetCollectionSpeed(Collector::kStop));
+	AddSequential(new OpenClaw());
+	AddSequential(new ExtendShooter());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Shoot.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Shoot.h
new file mode 100644
index 0000000..b652104
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/Shoot.h
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/CommandGroup.h>
+
+/**
+ * Shoot the ball at the current angle.
+ */
+class Shoot : public frc::CommandGroup {
+public:
+	Shoot();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForBall.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForBall.cpp
new file mode 100644
index 0000000..9a5d83c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForBall.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "WaitForBall.h"
+
+#include "../Robot.h"
+
+WaitForBall::WaitForBall() {
+	Requires(&Robot::collector);
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool WaitForBall::IsFinished() {
+	return Robot::collector.HasBall();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForBall.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForBall.h
new file mode 100644
index 0000000..82017e1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForBall.h
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Wait until the collector senses that it has the ball. This command does
+ * nothing and is intended to be used in command groups to wait for this
+ * condition.
+ */
+class WaitForBall : public frc::Command {
+public:
+	WaitForBall();
+	bool IsFinished() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForPressure.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForPressure.cpp
new file mode 100644
index 0000000..a3d60a0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForPressure.cpp
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "WaitForPressure.h"
+
+#include "../Robot.h"
+
+WaitForPressure::WaitForPressure() {
+	Requires(&Robot::pneumatics);
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool WaitForPressure::IsFinished() {
+	return Robot::pneumatics.IsPressurized();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForPressure.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForPressure.h
new file mode 100644
index 0000000..95bdfe0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Commands/WaitForPressure.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+/**
+ * Wait until the pneumatics are fully pressurized. This command does nothing
+ * and is intended to be used in command groups to wait for this condition.
+ */
+class WaitForPressure : public frc::Command {
+public:
+	WaitForPressure();
+	bool IsFinished() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/OI.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/OI.cpp
new file mode 100644
index 0000000..d3d6f1a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/OI.cpp
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "OI.h"
+
+#include "Commands/Collect.h"
+#include "Commands/DriveForward.h"
+#include "Commands/LowGoal.h"
+#include "Commands/SetCollectionSpeed.h"
+#include "Commands/SetPivotSetpoint.h"
+#include "Commands/Shoot.h"
+#include "SmartDashboard/SmartDashboard.h"
+#include "Subsystems/Collector.h"
+#include "Subsystems/Pivot.h"
+
+OI::OI() {
+	m_r1.WhenPressed(new LowGoal());
+	m_r2.WhenPressed(new Collect());
+
+	m_l1.WhenPressed(new SetPivotSetpoint(Pivot::kShoot));
+	m_l2.WhenPressed(new SetPivotSetpoint(Pivot::kShootNear));
+
+	m_sticks.WhenActive(new Shoot());
+
+	// SmartDashboard Buttons
+	frc::SmartDashboard::PutData("Drive Forward", new DriveForward(2.25));
+	frc::SmartDashboard::PutData("Drive Backward", new DriveForward(-2.25));
+	frc::SmartDashboard::PutData("Start Rollers",
+			new SetCollectionSpeed(Collector::kForward));
+	frc::SmartDashboard::PutData("Stop Rollers",
+			new SetCollectionSpeed(Collector::kStop));
+	frc::SmartDashboard::PutData("Reverse Rollers",
+			new SetCollectionSpeed(Collector::kReverse));
+}
+
+frc::Joystick& OI::GetJoystick() {
+	return m_joystick;
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/OI.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/OI.h
new file mode 100644
index 0000000..b3228aa
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/OI.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Buttons/JoystickButton.h>
+#include <Joystick.h>
+
+#include "Triggers/DoubleButton.h"
+
+class OI {
+public:
+	OI();
+	frc::Joystick& GetJoystick();
+
+private:
+	frc::Joystick m_joystick{0};
+
+	frc::JoystickButton m_l1{&m_joystick, 11};
+	frc::JoystickButton m_l2{&m_joystick, 9};
+	frc::JoystickButton m_r1{&m_joystick, 12};
+	frc::JoystickButton m_r2{&m_joystick, 10};
+
+	DoubleButton m_sticks{&m_joystick, 2, 3};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Robot.cpp
new file mode 100644
index 0000000..fb90037
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Robot.cpp
@@ -0,0 +1,87 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Robot.h"
+
+#include <iostream>
+
+#include <Commands/Scheduler.h>
+#include <LiveWindow/LiveWindow.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+DriveTrain Robot::drivetrain;
+Pivot Robot::pivot;
+Collector Robot::collector;
+Shooter Robot::shooter;
+Pneumatics Robot::pneumatics;
+OI Robot::oi;
+
+void Robot::RobotInit() {
+	// Show what command your subsystem is running on the SmartDashboard
+	frc::SmartDashboard::PutData(&drivetrain);
+	frc::SmartDashboard::PutData(&pivot);
+	frc::SmartDashboard::PutData(&collector);
+	frc::SmartDashboard::PutData(&shooter);
+	frc::SmartDashboard::PutData(&pneumatics);
+
+	// instantiate the command used for the autonomous period
+	m_autoChooser.AddDefault("Drive and Shoot", &m_driveAndShootAuto);
+	m_autoChooser.AddObject("Drive Forward", &m_driveForwardAuto);
+	frc::SmartDashboard::PutData("Auto Mode", &m_autoChooser);
+
+	pneumatics.Start();  // Pressurize the pneumatics.
+}
+
+void Robot::AutonomousInit() {
+	m_autonomousCommand = m_autoChooser.GetSelected();
+	m_autonomousCommand->Start();
+}
+
+void Robot::AutonomousPeriodic() {
+	frc::Scheduler::GetInstance()->Run();
+	Log();
+}
+
+void Robot::TeleopInit() {
+	// This makes sure that the autonomous stops running when
+	// teleop starts running. If you want the autonomous to
+	// continue until interrupted by another command, remove
+	// this line or comment it out.
+	if (m_autonomousCommand != nullptr) {
+		m_autonomousCommand->Cancel();
+	}
+	std::cout << "Starting Teleop" << std::endl;
+}
+
+void Robot::TeleopPeriodic() {
+	frc::Scheduler::GetInstance()->Run();
+	Log();
+}
+
+void Robot::TestPeriodic() {}
+
+void Robot::DisabledInit() {
+	shooter.Unlatch();
+}
+
+void Robot::DisabledPeriodic() {
+	Log();
+}
+
+/**
+ * Log interesting values to the SmartDashboard.
+ */
+void Robot::Log() {
+	Robot::pneumatics.WritePressure();
+	frc::SmartDashboard::PutNumber("Pivot Pot Value", pivot.GetAngle());
+	frc::SmartDashboard::PutNumber("Left Distance",
+			drivetrain.GetLeftEncoder().GetDistance());
+	frc::SmartDashboard::PutNumber("Right Distance",
+			drivetrain.GetRightEncoder().GetDistance());
+}
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Robot.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Robot.h
new file mode 100644
index 0000000..33c3073
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Robot.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+#include <IterativeRobot.h>
+#include <SmartDashboard/SendableChooser.h>
+
+#include "Commands/DriveAndShootAutonomous.h"
+#include "Commands/DriveForward.h"
+#include "OI.h"
+#include "Subsystems/Collector.h"
+#include "Subsystems/DriveTrain.h"
+#include "Subsystems/Pivot.h"
+#include "Subsystems/Pneumatics.h"
+#include "Subsystems/Shooter.h"
+
+class Robot : public IterativeRobot {
+public:
+	static DriveTrain drivetrain;
+	static Pivot pivot;
+	static Collector collector;
+	static Shooter shooter;
+	static Pneumatics pneumatics;
+	static OI oi;
+
+private:
+	frc::Command* m_autonomousCommand = nullptr;
+	DriveAndShootAutonomous m_driveAndShootAuto;
+	DriveForward m_driveForwardAuto;
+	SendableChooser<frc::Command*> m_autoChooser;
+
+	void RobotInit() override;
+	void AutonomousInit() override;
+	void AutonomousPeriodic() override;
+	void TeleopInit() override;
+	void TeleopPeriodic() override;
+	void TestPeriodic() override;
+	void DisabledInit() override;
+	void DisabledPeriodic() override;
+
+	void Log();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Collector.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Collector.cpp
new file mode 100644
index 0000000..fa81dc1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Collector.cpp
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Collector.h"
+
+#include <LiveWindow/LiveWindow.h>
+
+Collector::Collector()
+    : frc::Subsystem("Collector") {
+	// Put everything to the LiveWindow for testing.
+	AddChild("Roller Motor", m_rollerMotor);
+	AddChild("Ball Detector", m_ballDetector);
+	AddChild("Claw Open Detector", m_openDetector);
+	AddChild("Piston", m_piston);
+}
+
+bool Collector::HasBall() {
+	return m_ballDetector.Get();  // TODO: prepend ! to reflect real robot
+}
+
+void Collector::SetSpeed(double speed) {
+	m_rollerMotor.Set(-speed);
+}
+
+void Collector::Stop() {
+	m_rollerMotor.Set(0);
+}
+
+bool Collector::IsOpen() {
+	return m_openDetector.Get();  // TODO: prepend ! to reflect real robot
+}
+
+void Collector::Open() {
+	m_piston.Set(true);
+}
+
+void Collector::Close() {
+	m_piston.Set(false);
+}
+
+void Collector::InitDefaultCommand() {}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Collector.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Collector.h
new file mode 100644
index 0000000..e6ad0e4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Collector.h
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Subsystem.h>
+#include <DigitalInput.h>
+#include <Solenoid.h>
+#include <Spark.h>
+
+/**
+ * The Collector subsystem has one motor for the rollers, a limit switch for
+ * ball
+ * detection, a piston for opening and closing the claw, and a reed switch to
+ * check if the piston is open.
+ */
+class Collector : public frc::Subsystem {
+public:
+	// Constants for some useful speeds
+	static constexpr double kForward = 1;
+	static constexpr double kStop = 0;
+	static constexpr double kReverse = -1;
+
+	Collector();
+
+	/**
+	 * NOTE: The current simulation model uses the the lower part of the
+	 * claw
+	 * since the limit switch wasn't exported. At some point, this will be
+	 * updated.
+	 *
+	 * @return Whether or not the robot has the ball.
+	 */
+	bool HasBall();
+
+	/**
+	 * @param speed The speed to spin the rollers.
+	 */
+	void SetSpeed(double speed);
+
+	/**
+	 * Stop the rollers from spinning
+	 */
+	void Stop();
+
+	/**
+	 * @return Whether or not the claw is open.
+	 */
+	bool IsOpen();
+
+	/**
+	 * Open the claw up. (For shooting)
+	 */
+	void Open();
+
+	/**
+	 * Close the claw. (For collecting and driving)
+	 */
+	void Close();
+
+	/**
+	 * No default command.
+	 */
+	void InitDefaultCommand() override;
+
+private:
+	// Subsystem devices
+	frc::Spark m_rollerMotor{6};
+	frc::DigitalInput m_ballDetector{10};
+	frc::Solenoid m_piston{1};
+	frc::DigitalInput m_openDetector{6};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/DriveTrain.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/DriveTrain.cpp
new file mode 100644
index 0000000..f0ac65a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/DriveTrain.cpp
@@ -0,0 +1,79 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriveTrain.h"
+
+#include <cmath>
+
+#include <Joystick.h>
+
+#include "../Commands/DriveWithJoystick.h"
+
+DriveTrain::DriveTrain()
+    : frc::Subsystem("DriveTrain") {
+	// AddChild("Front Left CIM", m_frontLeftCIM);
+	// AddChild("Front Right CIM", m_frontRightCIM);
+	// AddChild("Back Left CIM", m_backLeftCIM);
+	// AddChild("Back Right CIM", m_backRightCIM);
+
+	// Configure the DifferentialDrive to reflect the fact that all our
+	// motors are wired backwards and our drivers sensitivity preferences.
+	m_robotDrive.SetSafetyEnabled(false);
+	m_robotDrive.SetExpiration(0.1);
+	m_robotDrive.SetMaxOutput(1.0);
+	m_leftCIMs.SetInverted(true);
+	m_rightCIMs.SetInverted(true);
+
+	// Configure encoders
+	m_rightEncoder.SetPIDSourceType(PIDSourceType::kDisplacement);
+	m_leftEncoder.SetPIDSourceType(PIDSourceType::kDisplacement);
+
+#ifndef SIMULATION
+	// Converts to feet
+	m_rightEncoder.SetDistancePerPulse(0.0785398);
+	m_leftEncoder.SetDistancePerPulse(0.0785398);
+#else
+	// Convert to feet 4in diameter wheels with 360 tick simulated encoders
+	m_rightEncoder.SetDistancePerPulse(
+			(4.0 /*in*/ * M_PI) / (360.0 * 12.0 /*in/ft*/));
+	m_leftEncoder.SetDistancePerPulse(
+			(4.0 /*in*/ * M_PI) / (360.0 * 12.0 /*in/ft*/));
+#endif
+
+	AddChild("Right Encoder", m_rightEncoder);
+	AddChild("Left Encoder", m_leftEncoder);
+
+// Configure gyro
+#ifndef SIMULATION
+	m_gyro.SetSensitivity(0.007);  // TODO: Handle more gracefully?
+#endif
+	AddChild("Gyro", m_gyro);
+}
+
+void DriveTrain::InitDefaultCommand() {
+	SetDefaultCommand(new DriveWithJoystick());
+}
+
+void DriveTrain::TankDrive(double leftAxis, double rightAxis) {
+	m_robotDrive.TankDrive(leftAxis, rightAxis);
+}
+
+void DriveTrain::Stop() {
+	m_robotDrive.TankDrive(0.0, 0.0);
+}
+
+Encoder& DriveTrain::GetLeftEncoder() {
+	return m_leftEncoder;
+}
+
+Encoder& DriveTrain::GetRightEncoder() {
+	return m_rightEncoder;
+}
+
+double DriveTrain::GetAngle() {
+	return m_gyro.GetAngle();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/DriveTrain.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/DriveTrain.h
new file mode 100644
index 0000000..b0eb100
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/DriveTrain.h
@@ -0,0 +1,79 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <AnalogGyro.h>
+#include <Commands/Subsystem.h>
+#include <Drive/DifferentialDrive.h>
+#include <Encoder.h>
+#include <Spark.h>
+#include <SpeedControllerGroup.h>
+
+namespace frc {
+class Joystick;
+}  // namespace frc
+
+/**
+ * The DriveTrain subsystem controls the robot's chassis and reads in
+ * information about it's speed and position.
+ */
+class DriveTrain : public frc::Subsystem {
+public:
+	DriveTrain();
+
+	/**
+	 * When other commands aren't using the drivetrain, allow tank drive
+	 * with
+	 * the joystick.
+	 */
+	void InitDefaultCommand();
+
+	/**
+	 * @param leftAxis Left sides value
+	 * @param rightAxis Right sides value
+	 */
+	void TankDrive(double leftAxis, double rightAxis);
+
+	/**
+	 * Stop the drivetrain from moving.
+	 */
+	void Stop();
+
+	/**
+	 * @return The encoder getting the distance and speed of left side of
+	 * the drivetrain.
+	 */
+	Encoder& GetLeftEncoder();
+
+	/**
+	 * @return The encoder getting the distance and speed of right side of
+	 * the drivetrain.
+	 */
+	Encoder& GetRightEncoder();
+
+	/**
+	 * @return The current angle of the drivetrain.
+	 */
+	double GetAngle();
+
+private:
+	// Subsystem devices
+	frc::Spark m_frontLeftCIM{1};
+	frc::Spark m_rearLeftCIM{2};
+	frc::SpeedControllerGroup m_leftCIMs{m_frontLeftCIM, m_rearLeftCIM};
+
+	frc::Spark m_frontRightCIM{3};
+	frc::Spark m_rearRightCIM{4};
+	frc::SpeedControllerGroup m_rightCIMs{m_frontRightCIM, m_rearRightCIM};
+
+	frc::DifferentialDrive m_robotDrive{m_leftCIMs, m_rightCIMs};
+
+	frc::Encoder m_rightEncoder{1, 2, true, Encoder::k4X};
+	frc::Encoder m_leftEncoder{3, 4, false, Encoder::k4X};
+	frc::AnalogGyro m_gyro{0};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pivot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pivot.cpp
new file mode 100644
index 0000000..1c2a4d7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pivot.cpp
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Pivot.h"
+
+Pivot::Pivot()
+    : frc::PIDSubsystem("Pivot", 7.0, 0.0, 8.0) {
+	SetAbsoluteTolerance(0.005);
+	GetPIDController()->SetContinuous(false);
+#ifdef SIMULATION
+	// PID is different in simulation.
+	GetPIDController()->SetPID(0.5, 0.001, 2);
+	SetAbsoluteTolerance(5);
+#endif
+
+	// Put everything to the LiveWindow for testing.
+	AddChild("Upper Limit Switch", m_upperLimitSwitch);
+	AddChild("Lower Limit Switch", m_lowerLimitSwitch);
+	AddChild("Pot", m_pot);
+	AddChild("Motor", m_motor);
+}
+
+void InitDefaultCommand() {}
+
+double Pivot::ReturnPIDInput() {
+	return m_pot.Get();
+}
+
+void Pivot::UsePIDOutput(double output) {
+	m_motor.PIDWrite(output);
+}
+
+bool Pivot::IsAtUpperLimit() {
+	return m_upperLimitSwitch.Get();  // TODO: inverted from real robot
+					  // (prefix with !)
+}
+
+bool Pivot::IsAtLowerLimit() {
+	return m_lowerLimitSwitch.Get();  // TODO: inverted from real robot
+					  // (prefix with !)
+}
+
+double Pivot::GetAngle() {
+	return m_pot.Get();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pivot.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pivot.h
new file mode 100644
index 0000000..b145caf
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pivot.h
@@ -0,0 +1,74 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <AnalogPotentiometer.h>
+#include <Commands/PIDSubsystem.h>
+#include <DigitalInput.h>
+#include <Spark.h>
+
+/**
+ * The Pivot subsystem contains the Van-door motor and the pot for PID control
+ * of angle of the pivot and claw.
+ */
+class Pivot : public frc::PIDSubsystem {
+public:
+	// Constants for some useful angles
+	static constexpr double kCollect = 105;
+	static constexpr double kLowGoal = 90;
+	static constexpr double kShoot = 45;
+	static constexpr double kShootNear = 30;
+
+	Pivot();
+
+	/**
+	 *  No default command, if PID is enabled, the current setpoint will be
+	 * maintained.
+	 */
+	void InitDefaultCommand() override {}
+
+	/**
+	 * @return The angle read in by the potentiometer
+	 */
+	double ReturnPIDInput() override;
+
+	/**
+	 * Set the motor speed based off of the PID output
+	 */
+	void UsePIDOutput(double output) override;
+
+	/**
+	 * @return If the pivot is at its upper limit.
+	 */
+	bool IsAtUpperLimit();
+
+	/**
+	 * @return If the pivot is at its lower limit.
+	 */
+	bool IsAtLowerLimit();
+
+	/**
+	 * @return The current angle of the pivot.
+	 */
+	double GetAngle();
+
+private:
+	// Subsystem devices
+
+	// Sensors for measuring the position of the pivot
+	frc::DigitalInput m_upperLimitSwitch{13};
+	frc::DigitalInput m_lowerLimitSwitch{12};
+
+	/* 0 degrees is vertical facing up.
+	 * Angle increases the more forward the pivot goes.
+	 */
+	frc::AnalogPotentiometer m_pot{1};
+
+	// Motor to move the pivot
+	frc::Spark m_motor{5};
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pneumatics.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pneumatics.cpp
new file mode 100644
index 0000000..9128b0d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pneumatics.cpp
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Pneumatics.h"
+
+#include <SmartDashboard/SmartDashboard.h>
+
+Pneumatics::Pneumatics()
+    : frc::Subsystem("Pneumatics") {
+	AddChild("Pressure Sensor", m_pressureSensor);
+}
+
+/**
+ * No default command
+ */
+void Pneumatics::InitDefaultCommand() {}
+
+/**
+ * Start the compressor going. The compressor automatically starts and stops as
+ * it goes above and below maximum pressure.
+ */
+void Pneumatics::Start() {
+#ifndef SIMULATION
+	m_compressor.Start();
+#endif
+}
+
+/**
+ * @return Whether or not the system is fully pressurized.
+ */
+bool Pneumatics::IsPressurized() {
+#ifndef SIMULATION
+	return kMaxPressure <= m_pressureSensor.GetVoltage();
+#else
+	return true;  // NOTE: Simulation always has full pressure
+#endif
+}
+
+/**
+ * Puts the pressure on the SmartDashboard.
+ */
+void Pneumatics::WritePressure() {
+	frc::SmartDashboard::PutNumber(
+			"Pressure", m_pressureSensor.GetVoltage());
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pneumatics.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pneumatics.h
new file mode 100644
index 0000000..4d8ba1d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Pneumatics.h
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <AnalogInput.h>
+#include <Commands/Subsystem.h>
+#include <Compressor.h>
+
+/**
+ * The Pneumatics subsystem contains the compressor and a pressure sensor.
+ *
+ * NOTE: The simulator currently doesn't support the compressor or pressure
+ * sensors.
+ */
+class Pneumatics : public frc::Subsystem {
+public:
+	Pneumatics();
+
+	/**
+	 * No default command
+	 */
+	void InitDefaultCommand() override;
+
+	/**
+	 * Start the compressor going. The compressor automatically starts and
+	 * stops as it goes above and below maximum pressure.
+	 */
+	void Start();
+
+	/**
+	 * @return Whether or not the system is fully pressurized.
+	 */
+	bool IsPressurized();
+
+	/**
+	 * Puts the pressure on the SmartDashboard.
+	 */
+	void WritePressure();
+
+private:
+	frc::AnalogInput m_pressureSensor{3};
+
+#ifndef SIMULATION
+	frc::Compressor m_compressor{1};  // TODO: (1, 14, 1, 8);
+#endif
+
+	static constexpr double kMaxPressure = 2.55;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Shooter.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Shooter.cpp
new file mode 100644
index 0000000..b1d87a9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Shooter.cpp
@@ -0,0 +1,85 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Shooter.h"
+
+Shooter::Shooter()
+    : Subsystem("Shooter") {
+	// Put everything to the LiveWindow for testing.
+	AddChild("Hot Goal Sensor", m_hotGoalSensor);
+	AddChild("Piston1 Reed Switch Front ", m_piston1ReedSwitchFront);
+	AddChild("Piston1 Reed Switch Back ", m_piston1ReedSwitchBack);
+	AddChild("Latch Piston", m_latchPiston);
+}
+
+void Shooter::InitDefaultCommand() {
+	// Set the default command for a subsystem here.
+	// SetDefaultCommand(new MySpecialCommand());
+}
+
+void Shooter::ExtendBoth() {
+	m_piston1.Set(frc::DoubleSolenoid::kForward);
+	m_piston2.Set(frc::DoubleSolenoid::kForward);
+}
+
+void Shooter::RetractBoth() {
+	m_piston1.Set(frc::DoubleSolenoid::kReverse);
+	m_piston2.Set(frc::DoubleSolenoid::kReverse);
+}
+
+void Shooter::Extend1() {
+	m_piston1.Set(frc::DoubleSolenoid::kForward);
+}
+
+void Shooter::Retract1() {
+	m_piston1.Set(frc::DoubleSolenoid::kReverse);
+}
+
+void Shooter::Extend2() {
+	m_piston2.Set(frc::DoubleSolenoid::kReverse);
+}
+
+void Shooter::Retract2() {
+	m_piston2.Set(frc::DoubleSolenoid::kForward);
+}
+
+void Shooter::Off1() {
+	m_piston1.Set(frc::DoubleSolenoid::kOff);
+}
+
+void Shooter::Off2() {
+	m_piston2.Set(frc::DoubleSolenoid::kOff);
+}
+
+void Shooter::Unlatch() {
+	m_latchPiston.Set(true);
+}
+
+void Shooter::Latch() {
+	m_latchPiston.Set(false);
+}
+
+void Shooter::ToggleLatchPosition() {
+	m_latchPiston.Set(!m_latchPiston.Get());
+}
+
+bool Shooter::Piston1IsExtended() {
+	return !m_piston1ReedSwitchFront.Get();
+}
+
+bool Shooter::Piston1IsRetracted() {
+	return !m_piston1ReedSwitchBack.Get();
+}
+
+void Shooter::OffBoth() {
+	m_piston1.Set(frc::DoubleSolenoid::kOff);
+	m_piston2.Set(frc::DoubleSolenoid::kOff);
+}
+
+bool Shooter::GoalIsHot() {
+	return m_hotGoalSensor.Get();
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Shooter.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Shooter.h
new file mode 100644
index 0000000..c22c407
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Subsystems/Shooter.h
@@ -0,0 +1,127 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Subsystem.h>
+#include <DigitalInput.h>
+#include <DoubleSolenoid.h>
+#include <Solenoid.h>
+
+/**
+ * The Shooter subsystem handles shooting. The mechanism for shooting is
+ * slightly complicated because it has to pneumatic cylinders for shooting, and
+ * a third latch to allow the pressure to partially build up and reduce the
+ * effect of the airflow. For shorter shots, when full power isn't needed, only
+ * one cylinder fires.
+ *
+ * NOTE: Simulation currently approximates this as as single pneumatic cylinder
+ * and ignores the latch.
+ */
+class Shooter : public frc::Subsystem {
+public:
+	Shooter();
+	void InitDefaultCommand() override;
+
+	/**
+	 * Extend both solenoids to shoot.
+	 */
+	void ExtendBoth();
+
+	/**
+	 * Retract both solenoids to prepare to shoot.
+	 */
+	void RetractBoth();
+
+	/**
+	 * Extend solenoid 1 to shoot.
+	 */
+	void Extend1();
+
+	/**
+	 * Retract solenoid 1 to prepare to shoot.
+	 */
+	void Retract1();
+
+	/**
+	 * Extend solenoid 2 to shoot.
+	 */
+	void Extend2();
+
+	/**
+	 * Retract solenoid 2 to prepare to shoot.
+	 */
+	void Retract2();
+
+	/**
+	 * Turns off the piston1 double solenoid. This won't actuate anything
+	 * because double solenoids preserve their state when turned off. This
+	 * should be called in order to reduce the amount of time that the coils
+	 * are
+	 * powered.
+	 */
+	void Off1();
+
+	/**
+	 * Turns off the piston1 double solenoid. This won't actuate anything
+	 * because double solenoids preserve their state when turned off. This
+	 * should be called in order to reduce the amount of time that the coils
+	 * are
+	 * powered.
+	 */
+	void Off2();
+
+	/**
+	 * Release the latch so that we can shoot
+	 */
+	void Unlatch();
+
+	/**
+	 * Latch so that pressure can build up and we aren't limited by air
+	 * flow.
+	 */
+	void Latch();
+
+	/**
+	 * Toggles the latch postions
+	 */
+	void ToggleLatchPosition();
+
+	/**
+	 * @return Whether or not piston 1 is fully extended.
+	 */
+	bool Piston1IsExtended();
+
+	/**
+	 * @return Whether or not piston 1 is fully retracted.
+	 */
+	bool Piston1IsRetracted();
+
+	/**
+	 * Turns off all double solenoids. Double solenoids hold their position
+	 * when
+	 * they are turned off. We should turn them off whenever possible to
+	 * extend
+	 * the life of the coils
+	 */
+	void OffBoth();
+
+	/**
+	 * @return Whether or not the goal is hot as read by the banner sensor
+	 */
+	bool GoalIsHot();
+
+private:
+	// Devices
+	frc::DoubleSolenoid m_piston1{3, 4};
+	frc::DoubleSolenoid m_piston2{5, 6};
+	frc::Solenoid m_latchPiston{1, 2};
+	frc::DigitalInput m_piston1ReedSwitchFront{9};
+	frc::DigitalInput m_piston1ReedSwitchBack{11};
+	frc::DigitalInput m_hotGoalSensor{
+			7};  // NOTE: Currently ignored in simulation
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Triggers/DoubleButton.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Triggers/DoubleButton.cpp
new file mode 100644
index 0000000..c8b485d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Triggers/DoubleButton.cpp
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DoubleButton.h"
+
+#include <Joystick.h>
+
+DoubleButton::DoubleButton(frc::Joystick* joy, int button1, int button2)
+    : m_joy(*joy) {
+	m_button1 = button1;
+	m_button2 = button2;
+}
+
+bool DoubleButton::Get() {
+	return m_joy.GetRawButton(m_button1) && m_joy.GetRawButton(m_button2);
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Triggers/DoubleButton.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Triggers/DoubleButton.h
new file mode 100644
index 0000000..a0b8f67
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PacGoat/src/Triggers/DoubleButton.h
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Buttons/Trigger.h>
+
+namespace frc {
+class Joystick;
+}  // namespace frc
+
+class DoubleButton : public frc::Trigger {
+public:
+	DoubleButton(frc::Joystick* joy, int button1, int button2);
+
+	bool Get();
+
+private:
+	frc::Joystick& m_joy;
+	int m_button1;
+	int m_button2;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/src/Robot.cpp
new file mode 100644
index 0000000..d2ef3f2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/PotentiometerPID/src/Robot.cpp
@@ -0,0 +1,82 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <array>
+
+#include <AnalogInput.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <PIDController.h>
+#include <Spark.h>
+
+/**
+ * This is a sample program to demonstrate how to use a soft potentiometer and a
+ * PID Controller to reach and maintain position setpoints on an elevator
+ * mechanism.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void RobotInit() override { m_pidController.SetInputRange(0, 5); }
+
+	void TeleopInit() override { m_pidController.Enable(); }
+
+	void TeleopPeriodic() override {
+		// when the button is pressed once, the selected elevator
+		// setpoint
+		// is incremented
+		bool currentButtonValue = m_joystick.GetTrigger();
+		if (currentButtonValue && !m_previousButtonValue) {
+			// index of the elevator setpoint wraps around.
+			m_index = (m_index + 1) % (sizeof(kSetPoints) / 8);
+		}
+		m_previousButtonValue = currentButtonValue;
+
+		m_pidController.SetSetpoint(kSetPoints[m_index]);
+	}
+
+private:
+	static constexpr int kPotChannel = 1;
+	static constexpr int kMotorChannel = 7;
+	static constexpr int kJoystickChannel = 0;
+
+	// Bottom, middle, and top elevator setpoints
+	static constexpr std::array<double, 3> kSetPoints = {1.0, 2.6, 4.3};
+
+	/* proportional, integral, and derivative speed constants; motor
+	 * inverted
+	 * DANGER: when tuning PID constants, high/inappropriate values for
+	 * pGain,
+	 * iGain, and dGain may cause dangerous, uncontrollable, or
+	 * undesired behavior!
+	 *
+	 * These may need to be positive for a non-inverted motor
+	 */
+	static constexpr double kP = -5.0;
+	static constexpr double kI = -0.02;
+	static constexpr double kD = -2.0;
+
+	int m_index = 0;
+	bool m_previousButtonValue = false;
+
+	frc::AnalogInput m_potentiometer{kPotChannel};
+	frc::Joystick m_joystick{kJoystickChannel};
+	frc::Spark m_elevatorMotor{kMotorChannel};
+
+	/* potentiometer (AnalogInput) and elevatorMotor (Victor) can be used as
+	 * a
+	 * PIDSource and PIDOutput respectively. The PIDController takes
+	 * pointers
+	 * to the PIDSource and PIDOutput, so you must use &potentiometer and
+	 * &elevatorMotor to get their pointers.
+	 */
+	frc::PIDController m_pidController{
+			kP, kI, kD, &m_potentiometer, &m_elevatorMotor};
+};
+
+constexpr std::array<double, 3> Robot::kSetPoints;
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/QuickVision/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/QuickVision/src/Robot.cpp
new file mode 100644
index 0000000..2511d3a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/QuickVision/src/Robot.cpp
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <CameraServer.h>
+#include <IterativeRobot.h>
+
+/**
+ * Uses the CameraServer class to automatically capture video from a USB webcam
+ * and send it to the FRC dashboard without doing any vision processing. This
+ * is the easiest way to get camera images to the dashboard. Just add this to
+ * the
+ * RobotInit() method in your program.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void RobotInit() {
+		CameraServer::GetInstance()->StartAutomaticCapture();
+	}
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Relay/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Relay/src/Robot.cpp
new file mode 100644
index 0000000..99c60ea
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Relay/src/Robot.cpp
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Relay.h>
+
+/**
+ * This is a sample program which uses joystick buttons to control a relay.
+ * A Relay (generally a spike) has two outputs, each of which can be at either
+ *   0V or 12V and so can be used for actions such as turning a motor off,
+ *   full forwards, or full reverse, and is generally used on the compressor.
+ * This program uses two buttons on a joystick and each button corresponds to
+ *   one output; pressing the button sets the output to 12V and releasing sets
+ *   it to 0V.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void TeleopPeriodic() override {
+		/* Retrieve the button values. GetRawButton will return
+		 * true if the button is pressed and false if not.
+		 */
+		bool forward = m_stick.GetRawButton(kRelayForwardButton);
+		bool reverse = m_stick.GetRawButton(kRelayReverseButton);
+
+		/* Depending on the button values, we want to use one of
+		 *   kOn, kOff, kForward, or kReverse.
+		 * kOn sets both outputs to 12V, kOff sets both to 0V,
+		 * kForward sets forward to 12V and reverse to 0V, and
+		 * kReverse sets reverse to 12V and forward to 0V.
+		 */
+		if (forward && reverse) {
+			m_relay.Set(Relay::kOn);
+		} else if (forward) {
+			m_relay.Set(Relay::kForward);
+		} else if (reverse) {
+			m_relay.Set(Relay::kReverse);
+		} else {
+			m_relay.Set(Relay::kOff);
+		}
+	}
+
+private:
+	frc::Joystick m_stick{0};
+	frc::Relay m_relay{0};
+
+	static constexpr int kRelayForwardButton = 1;
+	static constexpr int kRelayReverseButton = 2;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Solenoid/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Solenoid/src/Robot.cpp
new file mode 100644
index 0000000..f880075
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Solenoid/src/Robot.cpp
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <DoubleSolenoid.h>
+#include <IterativeRobot.h>
+#include <Joystick.h>
+#include <Solenoid.h>
+
+/**
+ * This is a sample program showing the use of the solenoid classes during
+ *   operator control.
+ * Three buttons from a joystick will be used to control two solenoids:
+ *   One button to control the position of a single solenoid and the other
+ *   two buttons to control a double solenoid.
+ * Single solenoids can either be on or off, such that the air diverted through
+ *   them goes through either one channel or the other.
+ * Double solenoids have three states: Off, Forward, and Reverse. Forward and
+ *   Reverse divert the air through the two channels and correspond to the
+ *   on and off of a single solenoid, but a double solenoid can also be "off",
+ *   where both channels are diverted to exhaust such that there is no pressure
+ *   in either channel.
+ * Additionally, double solenoids take up two channels on your PCM whereas
+ *   single solenoids only take a single channel.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	void TeleopPeriodic() override {
+		/* The output of GetRawButton is true/false depending on whether
+		 * the button is pressed; Set takes a boolean for for whether to
+		 * use the default (false) channel or the other (true).
+		 */
+		m_solenoid.Set(m_stick.GetRawButton(kSolenoidButton));
+
+		/* In order to set the double solenoid, we will say that if
+		 * neither
+		 * button is pressed, it is off, if just one button is pressed,
+		 * set the solenoid to correspond to that button, and if both
+		 * are pressed, set the solenoid to Forwards.
+		 */
+		if (m_stick.GetRawButton(kDoubleSolenoidForward)) {
+			m_doubleSolenoid.Set(frc::DoubleSolenoid::kForward);
+		} else if (m_stick.GetRawButton(kDoubleSolenoidReverse)) {
+			m_doubleSolenoid.Set(frc::DoubleSolenoid::kReverse);
+		} else {
+			m_doubleSolenoid.Set(frc::DoubleSolenoid::kOff);
+		}
+	}
+
+private:
+	frc::Joystick m_stick{0};
+
+	// Solenoid corresponds to a single solenoid.
+	frc::Solenoid m_solenoid{0};
+
+	// DoubleSolenoid corresponds to a double solenoid.
+	frc::DoubleSolenoid m_doubleSolenoid{1, 2};
+
+	static constexpr int kSolenoidButton = 1;
+	static constexpr int kDoubleSolenoidForward = 2;
+	static constexpr int kDoubleSolenoidReverse = 3;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Ultrasonic/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Ultrasonic/src/Robot.cpp
new file mode 100644
index 0000000..080fd72
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/Ultrasonic/src/Robot.cpp
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <AnalogInput.h>
+#include <Drive/DifferentialDrive.h>
+#include <IterativeRobot.h>
+#include <Spark.h>
+
+/**
+ * This is a sample program demonstrating how to use an ultrasonic sensor and
+ * proportional control to maintain a set distance from an object.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	/**
+	 * Tells the robot to drive to a set distance (in inches) from an object
+	 * using proportional control.
+	 */
+	void TeleopPeriodic() override {
+		// sensor returns a value from 0-4095 that is scaled to inches
+		double currentDistance =
+				m_ultrasonic.GetValue() * kValueToInches;
+		// convert distance error to a motor speed
+		double currentSpeed = (kHoldDistance - currentDistance) * kP;
+		// drive robot
+		m_robotDrive.ArcadeDrive(currentSpeed, 0);
+	}
+
+private:
+	// Distance in inches the robot wants to stay from an object
+	static constexpr int kHoldDistance = 12;
+
+	// Factor to convert sensor values to a distance in inches
+	static constexpr double kValueToInches = 0.125;
+
+	// Proportional speed constant
+	static constexpr double kP = 0.05;
+
+	static constexpr int kLeftMotorPort = 0;
+	static constexpr int kRightMotorPort = 1;
+	static constexpr int kUltrasonicPort = 0;
+
+	frc::AnalogInput m_ultrasonic{kUltrasonicPort};
+
+	frc::Spark m_left{kLeftMotorPort};
+	frc::Spark m_right{kRightMotorPort};
+	frc::DifferentialDrive m_robotDrive{m_left, m_right};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/UltrasonicPID/src/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/UltrasonicPID/src/Robot.cpp
new file mode 100644
index 0000000..e0576af
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/examples/UltrasonicPID/src/Robot.cpp
@@ -0,0 +1,86 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <AnalogInput.h>
+#include <Drive/DifferentialDrive.h>
+#include <IterativeRobot.h>
+#include <PIDController.h>
+#include <PIDOutput.h>
+#include <Spark.h>
+
+/**
+ * This is a sample program demonstrating how to use an ultrasonic sensor and
+ * proportional control to maintain a set distance from an object.
+ */
+class Robot : public frc::IterativeRobot {
+public:
+	/**
+	 * Drives the robot a set distance from an object using PID control and
+	 * the
+	 * ultrasonic sensor.
+	 */
+	void TeleopInit() override {
+		// Set expected range to 0-24 inches; e.g. at 24 inches from
+		// object go
+		// full forward, at 0 inches from object go full backward.
+		m_pidController.SetInputRange(0, 24 * kValueToInches);
+
+		// Set setpoint of the pidController
+		m_pidController.SetSetpoint(kHoldDistance * kValueToInches);
+
+		// Begin PID control
+		m_pidController.Enable();
+	}
+
+private:
+	// Internal class to write to robot drive using a PIDOutput
+	class MyPIDOutput : public frc::PIDOutput {
+	public:
+		explicit MyPIDOutput(frc::DifferentialDrive& r)
+		    : m_rd(r) {
+			m_rd.SetSafetyEnabled(false);
+		}
+
+		void PIDWrite(double output) override {
+			// Write to robot drive by reference
+			m_rd.ArcadeDrive(output, 0);
+		}
+
+	private:
+		frc::DifferentialDrive& m_rd;
+	};
+
+	// Distance in inches the robot wants to stay from an object
+	static constexpr int kHoldDistance = 12;
+
+	// Factor to convert sensor values to a distance in inches
+	static constexpr double kValueToInches = 0.125;
+
+	// proportional speed constant
+	static constexpr double kP = 7.0;
+
+	// integral speed constant
+	static constexpr double kI = 0.018;
+
+	// derivative speed constant
+	static constexpr double kD = 1.5;
+
+	static constexpr int kLeftMotorPort = 0;
+	static constexpr int kRightMotorPort = 1;
+	static constexpr int kUltrasonicPort = 0;
+
+	frc::AnalogInput m_ultrasonic{kUltrasonicPort};
+
+	frc::Spark m_left{kLeftMotorPort};
+	frc::Spark m_right{kRightMotorPort};
+	frc::DifferentialDrive m_robotDrive{m_left, m_right};
+
+	frc::PIDController m_pidController{kP, kI, kD, &m_ultrasonic,
+			new MyPIDOutput(m_robotDrive)};
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/ExampleCommand.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/ExampleCommand.cpp
new file mode 100644
index 0000000..86bd891
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/ExampleCommand.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ExampleCommand.h"
+
+ExampleCommand::ExampleCommand() {
+	// Use Requires() here to declare subsystem dependencies
+	// eg. Requires(&Robot::chassis);
+}
+
+// Called just before this Command runs the first time
+void ExampleCommand::Initialize() {}
+
+// Called repeatedly when this Command is scheduled to run
+void ExampleCommand::Execute() {}
+
+// Make this return true when this Command no longer needs to run execute()
+bool ExampleCommand::IsFinished() {
+	return false;
+}
+
+// Called once after isFinished returns true
+void ExampleCommand::End() {}
+
+// Called when another command which requires one or more of the same
+// subsystems is scheduled to run
+void ExampleCommand::Interrupted() {}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/ExampleCommand.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/ExampleCommand.h
new file mode 100644
index 0000000..44a9e5c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/ExampleCommand.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+class ExampleCommand : public frc::Command {
+public:
+	ExampleCommand();
+	void Initialize() override;
+	void Execute() override;
+	bool IsFinished() override;
+	void End() override;
+	void Interrupted() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/MyAutoCommand.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/MyAutoCommand.cpp
new file mode 100644
index 0000000..f548b68
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/MyAutoCommand.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "MyAutoCommand.h"
+
+MyAutoCommand::MyAutoCommand() {
+	// Use Requires() here to declare subsystem dependencies
+	// eg. Requires(&Robot::chassis);
+}
+
+// Called just before this Command runs the first time
+void MyAutoCommand::Initialize() {}
+
+// Called repeatedly when this Command is scheduled to run
+void MyAutoCommand::Execute() {}
+
+// Make this return true when this Command no longer needs to run execute()
+bool MyAutoCommand::IsFinished() {
+	return false;
+}
+
+// Called once after isFinished returns true
+void MyAutoCommand::End() {}
+
+// Called when another command which requires one or more of the same
+// subsystems is scheduled to run
+void MyAutoCommand::Interrupted() {}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/MyAutoCommand.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/MyAutoCommand.h
new file mode 100644
index 0000000..452753b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Commands/MyAutoCommand.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Command.h>
+
+class MyAutoCommand : public frc::Command {
+public:
+	MyAutoCommand();
+	void Initialize() override;
+	void Execute() override;
+	bool IsFinished() override;
+	void End() override;
+	void Interrupted() override;
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/OI.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/OI.cpp
new file mode 100644
index 0000000..bc51ff6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/OI.cpp
@@ -0,0 +1,14 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "OI.h"
+
+#include <WPILib.h>
+
+OI::OI() {
+	// Process operator interface input here.
+}
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/OI.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/OI.h
new file mode 100644
index 0000000..345b25a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/OI.h
@@ -0,0 +1,13 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+class OI {
+public:
+	OI();
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Robot.cpp
new file mode 100644
index 0000000..d54d8fc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Robot.cpp
@@ -0,0 +1,97 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <Commands/Command.h>
+#include <Commands/Scheduler.h>
+#include <LiveWindow/LiveWindow.h>
+#include <SmartDashboard/SendableChooser.h>
+#include <SmartDashboard/SmartDashboard.h>
+#include <TimedRobot.h>
+
+#include "Commands/ExampleCommand.h"
+#include "Commands/MyAutoCommand.h"
+
+class Robot : public frc::TimedRobot {
+public:
+	void RobotInit() override {
+		m_chooser.AddDefault("Default Auto", &m_defaultAuto);
+		m_chooser.AddObject("My Auto", &m_myAuto);
+		frc::SmartDashboard::PutData("Auto Modes", &m_chooser);
+	}
+
+	/**
+	 * This function is called once each time the robot enters Disabled
+	 * mode.
+	 * You can use it to reset any subsystem information you want to clear
+	 * when
+	 * the robot is disabled.
+	 */
+	void DisabledInit() override {}
+
+	void DisabledPeriodic() override {
+		frc::Scheduler::GetInstance()->Run();
+	}
+
+	/**
+	 * This autonomous (along with the chooser code above) shows how to
+	 * select
+	 * between different autonomous modes using the dashboard. The sendable
+	 * chooser code works with the Java SmartDashboard. If you prefer the
+	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
+	 * GetString code to get the auto name from the text box below the Gyro.
+	 *
+	 * You can add additional auto modes by adding additional commands to
+	 * the
+	 * chooser code above (like the commented example) or additional
+	 * comparisons
+	 * to the if-else structure below with additional strings & commands.
+	 */
+	void AutonomousInit() override {
+		std::string autoSelected = frc::SmartDashboard::GetString(
+				"Auto Selector", "Default");
+		if (autoSelected == "My Auto") {
+			m_autonomousCommand = &m_myAuto;
+		} else {
+			m_autonomousCommand = &m_defaultAuto;
+		}
+
+		m_autonomousCommand = m_chooser.GetSelected();
+
+		if (m_autonomousCommand != nullptr) {
+			m_autonomousCommand->Start();
+		}
+	}
+
+	void AutonomousPeriodic() override {
+		frc::Scheduler::GetInstance()->Run();
+	}
+
+	void TeleopInit() override {
+		// This makes sure that the autonomous stops running when
+		// teleop starts running. If you want the autonomous to
+		// continue until interrupted by another command, remove
+		// this line or comment it out.
+		if (m_autonomousCommand != nullptr) {
+			m_autonomousCommand->Cancel();
+			m_autonomousCommand = nullptr;
+		}
+	}
+
+	void TeleopPeriodic() override { frc::Scheduler::GetInstance()->Run(); }
+
+	void TestPeriodic() override {}
+
+private:
+	// Have it null by default so that if testing teleop it
+	// doesn't have undefined behavior and potentially crash.
+	frc::Command* m_autonomousCommand = nullptr;
+	ExampleCommand m_defaultAuto;
+	MyAutoCommand m_myAuto;
+	frc::SendableChooser<frc::Command*> m_chooser;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/RobotMap.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/RobotMap.h
new file mode 100644
index 0000000..dd78a21
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/RobotMap.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+/**
+ * The RobotMap is a mapping from the ports sensors and actuators are wired into
+ * to a variable name. This provides flexibility changing wiring, makes checking
+ * the wiring easier and significantly reduces the number of magic numbers
+ * floating around.
+ */
+
+// For example to map the left and right motors, you could define the
+// following variables to use with your drivetrain subsystem.
+// constexpr int kLeftMotor = 1;
+// constexpr int kRightMotor = 2;
+
+// If you are using multiple modules, make sure to define both the port
+// number and the module. For example you with a rangefinder:
+// constexpr int kRangeFinderPort = 1;
+// constexpr int kRangeFinderModule = 1;
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Subsystems/ExampleSubsystem.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Subsystems/ExampleSubsystem.cpp
new file mode 100644
index 0000000..da13125
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Subsystems/ExampleSubsystem.cpp
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ExampleSubsystem.h"
+
+#include "../RobotMap.h"
+
+ExampleSubsystem::ExampleSubsystem()
+    : frc::Subsystem("ExampleSubsystem") {}
+
+void ExampleSubsystem::InitDefaultCommand() {
+	// Set the default command for a subsystem here.
+	// SetDefaultCommand(new MySpecialCommand());
+}
+
+// Put methods for controlling this subsystem
+// here. Call these from Commands.
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Subsystems/ExampleSubsystem.h b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Subsystems/ExampleSubsystem.h
new file mode 100644
index 0000000..d64acb0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/commandbased/Subsystems/ExampleSubsystem.h
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <Commands/Subsystem.h>
+
+class ExampleSubsystem : public frc::Subsystem {
+public:
+	ExampleSubsystem();
+	void InitDefaultCommand() override;
+
+private:
+	// It's desirable that everything possible under private except
+	// for methods that implement subsystem capabilities
+};
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/iterative/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/iterative/Robot.cpp
new file mode 100644
index 0000000..c9695e4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/iterative/Robot.cpp
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+#include <string>
+
+#include <IterativeRobot.h>
+#include <LiveWindow/LiveWindow.h>
+#include <SmartDashboard/SendableChooser.h>
+#include <SmartDashboard/SmartDashboard.h>
+
+class Robot : public frc::IterativeRobot {
+public:
+	void RobotInit() {
+		m_chooser.AddDefault(kAutoNameDefault, kAutoNameDefault);
+		m_chooser.AddObject(kAutoNameCustom, kAutoNameCustom);
+		frc::SmartDashboard::PutData("Auto Modes", &m_chooser);
+	}
+
+	/*
+	 * This autonomous (along with the chooser code above) shows how to
+	 * select
+	 * between different autonomous modes using the dashboard. The sendable
+	 * chooser code works with the Java SmartDashboard. If you prefer the
+	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
+	 * GetString line to get the auto name from the text box below the Gyro.
+	 *
+	 * You can add additional auto modes by adding additional comparisons to
+	 * the
+	 * if-else structure below with additional strings. If using the
+	 * SendableChooser make sure to add them to the chooser code above as
+	 * well.
+	 */
+	void AutonomousInit() override {
+		m_autoSelected = m_chooser.GetSelected();
+		// m_autoSelected = SmartDashboard::GetString(
+		// 		"Auto Selector", kAutoNameDefault);
+		std::cout << "Auto selected: " << m_autoSelected << std::endl;
+
+		if (m_autoSelected == kAutoNameCustom) {
+			// Custom Auto goes here
+		} else {
+			// Default Auto goes here
+		}
+	}
+
+	void AutonomousPeriodic() {
+		if (m_autoSelected == kAutoNameCustom) {
+			// Custom Auto goes here
+		} else {
+			// Default Auto goes here
+		}
+	}
+
+	void TeleopInit() {}
+
+	void TeleopPeriodic() {}
+
+	void TestPeriodic() {}
+
+private:
+	frc::LiveWindow& m_lw = *LiveWindow::GetInstance();
+	frc::SendableChooser<std::string> m_chooser;
+	const std::string kAutoNameDefault = "Default";
+	const std::string kAutoNameCustom = "My Auto";
+	std::string m_autoSelected;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/sample/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/sample/Robot.cpp
new file mode 100644
index 0000000..e62e49c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/sample/Robot.cpp
@@ -0,0 +1,125 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+#include <string>
+
+#include <Drive/DifferentialDrive.h>
+#include <Joystick.h>
+#include <SampleRobot.h>
+#include <SmartDashboard/SendableChooser.h>
+#include <SmartDashboard/SmartDashboard.h>
+#include <Spark.h>
+#include <Timer.h>
+
+/**
+ * This is a demo program showing the use of the DifferentialDrive class.
+ * The SampleRobot class is the base of a robot application that will
+ * automatically call your Autonomous and OperatorControl methods at the right
+ * time as controlled by the switches on the driver station or the field
+ * controls.
+ *
+ * WARNING: While it may look like a good choice to use for your code if you're
+ * inexperienced, don't. Unless you know what you are doing, complex code will
+ * be much more difficult under this system. Use IterativeRobot or Command-Based
+ * instead if you're new.
+ */
+class Robot : public frc::SampleRobot {
+public:
+	Robot() {
+		// Note SmartDashboard is not initialized here, wait until
+		// RobotInit to make SmartDashboard calls
+		m_robotDrive.SetExpiration(0.1);
+	}
+
+	void RobotInit() {
+		m_chooser.AddDefault(kAutoNameDefault, kAutoNameDefault);
+		m_chooser.AddObject(kAutoNameCustom, kAutoNameCustom);
+		frc::SmartDashboard::PutData("Auto Modes", &m_chooser);
+	}
+
+	/*
+	 * This autonomous (along with the chooser code above) shows how to
+	 * select between different autonomous modes using the dashboard. The
+	 * sendable chooser code works with the Java SmartDashboard. If you
+	 * prefer the LabVIEW Dashboard, remove all of the chooser code and
+	 * uncomment the GetString line to get the auto name from the text box
+	 * below the Gyro.
+	 *
+	 * You can add additional auto modes by adding additional comparisons to
+	 * the if-else structure below with additional strings. If using the
+	 * SendableChooser make sure to add them to the chooser code above as
+	 * well.
+	 */
+	void Autonomous() {
+		std::string autoSelected = m_chooser.GetSelected();
+		// std::string autoSelected = frc::SmartDashboard::GetString(
+		// "Auto Selector", kAutoNameDefault);
+		std::cout << "Auto selected: " << autoSelected << std::endl;
+
+		// MotorSafety improves safety when motors are updated in loops
+		// but is disabled here because motor updates are not looped in
+		// this autonomous mode.
+		m_robotDrive.SetSafetyEnabled(false);
+
+		if (autoSelected == kAutoNameCustom) {
+			// Custom Auto goes here
+			std::cout << "Running custom Autonomous" << std::endl;
+
+			// Spin at half speed for two seconds
+			m_robotDrive.ArcadeDrive(0.0, 0.5);
+			frc::Wait(2.0);
+
+			// Stop robot
+			m_robotDrive.ArcadeDrive(0.0, 0.0);
+		} else {
+			// Default Auto goes here
+			std::cout << "Running default Autonomous" << std::endl;
+
+			// Drive forwards at half speed for two seconds
+			m_robotDrive.ArcadeDrive(-0.5, 0.0);
+			frc::Wait(2.0);
+
+			// Stop robot
+			m_robotDrive.ArcadeDrive(0.0, 0.0);
+		}
+	}
+
+	/*
+	 * Runs the motors with arcade steering.
+	 */
+	void OperatorControl() override {
+		m_robotDrive.SetSafetyEnabled(true);
+		while (IsOperatorControl() && IsEnabled()) {
+			// Drive with arcade style (use right stick)
+			m_robotDrive.ArcadeDrive(
+					-m_stick.GetY(), m_stick.GetX());
+
+			// The motors will be updated every 5ms
+			frc::Wait(0.005);
+		}
+	}
+
+	/*
+	 * Runs during test mode
+	 */
+	void Test() override {}
+
+private:
+	// Robot drive system
+	frc::Spark m_leftMotor{0};
+	frc::Spark m_rightMotor{1};
+	frc::DifferentialDrive m_robotDrive{m_leftMotor, m_rightMotor};
+
+	frc::Joystick m_stick{0};
+
+	frc::SendableChooser<std::string> m_chooser;
+	const std::string kAutoNameDefault = "Default";
+	const std::string kAutoNameCustom = "My Auto";
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/timed/Robot.cpp b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/timed/Robot.cpp
new file mode 100644
index 0000000..677a37e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcExamples/src/main/cpp/templates/timed/Robot.cpp
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+#include <string>
+
+#include <LiveWindow/LiveWindow.h>
+#include <SmartDashboard/SendableChooser.h>
+#include <SmartDashboard/SmartDashboard.h>
+#include <TimedRobot.h>
+
+class Robot : public frc::TimedRobot {
+public:
+	void RobotInit() {
+		m_chooser.AddDefault(kAutoNameDefault, kAutoNameDefault);
+		m_chooser.AddObject(kAutoNameCustom, kAutoNameCustom);
+		frc::SmartDashboard::PutData("Auto Modes", &m_chooser);
+	}
+
+	/*
+	 * This autonomous (along with the chooser code above) shows how to
+	 * select between different autonomous modes using the dashboard. The
+	 * sendable chooser code works with the Java SmartDashboard. If you
+	 * prefer the LabVIEW Dashboard, remove all of the chooser code and
+	 * uncomment the GetString line to get the auto name from the text box
+	 * below the Gyro.
+	 *
+	 * You can add additional auto modes by adding additional comparisons to
+	 * the if-else structure below with additional strings. If using the
+	 * SendableChooser make sure to add them to the chooser code above as
+	 * well.
+	 */
+	void AutonomousInit() override {
+		m_autoSelected = m_chooser.GetSelected();
+		// m_autoSelected = SmartDashboard::GetString("Auto Selector",
+		//		 kAutoNameDefault);
+		std::cout << "Auto selected: " << m_autoSelected << std::endl;
+
+		if (m_autoSelected == kAutoNameCustom) {
+			// Custom Auto goes here
+		} else {
+			// Default Auto goes here
+		}
+	}
+
+	void AutonomousPeriodic() {
+		if (m_autoSelected == kAutoNameCustom) {
+			// Custom Auto goes here
+		} else {
+			// Default Auto goes here
+		}
+	}
+
+	void TeleopInit() {}
+
+	void TeleopPeriodic() {}
+
+	void TestPeriodic() {}
+
+private:
+	frc::LiveWindow& m_lw = *LiveWindow::GetInstance();
+	frc::SendableChooser<std::string> m_chooser;
+	const std::string kAutoNameDefault = "Default";
+	const std::string kAutoNameCustom = "My Auto";
+	std::string m_autoSelected;
+};
+
+START_ROBOT_CLASS(Robot)
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/build.gradle b/third_party/allwpilib_2018/wpilibcIntegrationTests/build.gradle
new file mode 100644
index 0000000..cf85be9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/build.gradle
@@ -0,0 +1,125 @@
+import org.gradle.language.base.internal.ProjectLayout
+
+if (!project.hasProperty('skipAthena')) {
+    apply plugin: 'cpp'
+    apply plugin: 'visual-studio'
+    apply plugin: 'edu.wpi.first.NativeUtils'
+
+    apply from: '../config.gradle'
+
+    model {
+        dependencyConfigs {
+            wpiutil(DependencyConfig) {
+                groupId = 'edu.wpi.first.wpiutil'
+                artifactId = 'wpiutil-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.+'
+                sharedConfigs = [ wpilibcIntegrationTests: [] ]
+            }
+            ntcore(DependencyConfig) {
+                groupId = 'edu.wpi.first.ntcore'
+                artifactId = 'ntcore-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '4.+'
+                sharedConfigs = [ wpilibcIntegrationTests: [] ]
+            }
+            opencv(DependencyConfig) {
+                groupId = 'org.opencv'
+                artifactId = 'opencv-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '3.2.0'
+                sharedConfigs = [ wpilibcIntegrationTests: [] ]
+            }
+            cscore(DependencyConfig) {
+                groupId = 'edu.wpi.first.cscore'
+                artifactId = 'cscore-cpp'
+                headerClassifier = 'headers'
+                ext = 'zip'
+                version = '1.+'
+                sharedConfigs = [ wpilibcIntegrationTests: [] ]
+            }
+        }
+    }
+
+    model {
+        components {
+            wpilibcIntegrationTests(NativeExecutableSpec) {
+                baseName = 'FRCUserProgram'
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = ["${rootDir}/gmock/gtest/src", 'src/FRCUserProgram/cpp']
+                            includes = ['*-all.cc', '*_main.cc', '**/*.cpp']
+                        }
+                        exportedHeaders {
+                            srcDirs = ["${rootDir}/gmock/gtest/include", "${rootDir}/gmock/gtest", 'src/FRCUserProgram/headers']
+                            includes = ['**/*.h', '**/*.cc']
+                        }
+                    }
+                }
+                binaries.all { binary->
+                    if (binary.targetPlatform.architecture.name == 'athena') {
+                        binary.tasks.withType(CppCompile) {
+                            cppCompiler.args "-Wno-missing-field-initializers"
+                            cppCompiler.args "-Wno-unused-variable"
+                            cppCompiler.args "-Wno-error=deprecated-declarations"
+                        }
+                        project(':ni-libraries').addNiLibrariesToLinker(binary)
+                        project(':hal').addHalToLinker(binary)
+                        project(':wpilibc').addWpilibCCompilerArguments(binary)
+                        project(':wpilibc').addWpilibCToLinker(binary)
+                    } else {
+                        binary.buildable = false
+                    }
+                }
+            }
+        }
+    }
+}
+
+def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles")
+
+
+model {
+    tasks {
+        copyWpilibCTestLibrariesToOutput(Task) {
+            $.binaries.each {
+                if (it in NativeExecutableBinarySpec && it.targetPlatform.architecture.name == 'athena') {
+                    def spec = it
+                    dependsOn spec.buildTask
+                }
+            }
+            outputs.file testOutputFolder
+            outputs.upToDateWhen { false }
+
+            def bin = $.binaries
+            doLast {
+                bin.each {
+                    if (it in NativeExecutableBinarySpec && it.targetPlatform.architecture.name == 'athena') {
+                        def spec = it
+                        spec.libs.each {
+                            it.runtimeFiles.each { f ->
+                                copy {
+                                    from file(f)
+                                    into testOutputFolder.toString() + '/libs'
+                                }
+                            }
+                        }
+                        copy {
+                            from spec.executable.file
+                            into testOutputFolder.toString() + '/cpp'
+                        }
+                    }
+                }
+            }
+        }
+        // This is in a separate if statement because of what I would assume is a bug in grade.
+        // Will file an issue on their side.
+        if (!project.hasProperty('skipAthena')) {
+            build.dependsOn copyWpilibCTestLibrariesToOutput
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/AnalogLoopTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/AnalogLoopTest.cpp
new file mode 100644
index 0000000..b27b935
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/AnalogLoopTest.cpp
@@ -0,0 +1,131 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogInput.h"
+#include "AnalogOutput.h"
+#include "AnalogTrigger.h"
+#include "Counter.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kDelayTime = 0.01;
+
+/**
+ * A fixture with an analog input and an analog output wired together
+ */
+class AnalogLoopTest : public testing::Test {
+ protected:
+  AnalogInput* m_input;
+  AnalogOutput* m_output;
+
+  void SetUp() override {
+    m_input = new AnalogInput(TestBench::kFakeAnalogOutputChannel);
+    m_output = new AnalogOutput(TestBench::kAnalogOutputChannel);
+  }
+
+  void TearDown() override {
+    delete m_input;
+    delete m_output;
+  }
+};
+
+/**
+ * Test analog inputs and outputs by setting one and making sure the other
+ * matches.
+ */
+TEST_F(AnalogLoopTest, AnalogInputWorks) {
+  // Set the output voltage and check if the input measures the same voltage
+  for (int32_t i = 0; i < 50; i++) {
+    m_output->SetVoltage(i / 10.0);
+
+    Wait(kDelayTime);
+
+    EXPECT_NEAR(m_output->GetVoltage(), m_input->GetVoltage(), 0.01);
+  }
+}
+
+/**
+ * Test if we can use an analog trigger to  check if the output is within a
+ * range correctly.
+ */
+TEST_F(AnalogLoopTest, AnalogTriggerWorks) {
+  AnalogTrigger trigger(m_input);
+  trigger.SetLimitsVoltage(2.0, 3.0);
+
+  m_output->SetVoltage(1.0);
+  Wait(kDelayTime);
+
+  EXPECT_FALSE(trigger.GetInWindow())
+      << "Analog trigger is in the window (2V, 3V)";
+  EXPECT_FALSE(trigger.GetTriggerState()) << "Analog trigger is on";
+
+  m_output->SetVoltage(2.5);
+  Wait(kDelayTime);
+
+  EXPECT_TRUE(trigger.GetInWindow())
+      << "Analog trigger is not in the window (2V, 3V)";
+  EXPECT_FALSE(trigger.GetTriggerState()) << "Analog trigger is on";
+
+  m_output->SetVoltage(4.0);
+  Wait(kDelayTime);
+
+  EXPECT_FALSE(trigger.GetInWindow())
+      << "Analog trigger is in the window (2V, 3V)";
+  EXPECT_TRUE(trigger.GetTriggerState()) << "Analog trigger is not on";
+}
+
+/**
+ * Test if we can count the right number of ticks from an analog trigger with
+ * a counter.
+ */
+TEST_F(AnalogLoopTest, AnalogTriggerCounterWorks) {
+  AnalogTrigger trigger(m_input);
+  trigger.SetLimitsVoltage(2.0, 3.0);
+
+  Counter counter(trigger);
+
+  // Turn the analog output low and high 50 times
+  for (int32_t i = 0; i < 50; i++) {
+    m_output->SetVoltage(1.0);
+    Wait(kDelayTime);
+    m_output->SetVoltage(4.0);
+    Wait(kDelayTime);
+  }
+
+  // The counter should be 50
+  EXPECT_EQ(50, counter.Get())
+      << "Analog trigger counter did not count 50 ticks";
+}
+
+static void InterruptHandler(uint32_t interruptAssertedMask, void* param) {
+  *reinterpret_cast<int32_t*>(param) = 12345;
+}
+
+TEST_F(AnalogLoopTest, AsynchronusInterruptWorks) {
+  int32_t param = 0;
+  AnalogTrigger trigger(m_input);
+  trigger.SetLimitsVoltage(2.0, 3.0);
+
+  // Given an interrupt handler that sets an int32_t to 12345
+  std::shared_ptr<AnalogTriggerOutput> triggerOutput =
+      trigger.CreateOutput(AnalogTriggerType::kState);
+  triggerOutput->RequestInterrupts(InterruptHandler, &param);
+  triggerOutput->EnableInterrupts();
+
+  // If the analog output moves from below to above the window
+  m_output->SetVoltage(0.0);
+  Wait(kDelayTime);
+  m_output->SetVoltage(5.0);
+  triggerOutput->CancelInterrupts();
+
+  // Then the int32_t should be 12345
+  Wait(kDelayTime);
+  EXPECT_EQ(12345, param) << "The interrupt did not run.";
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/AnalogPotentiometerTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/AnalogPotentiometerTest.cpp
new file mode 100644
index 0000000..940cbbf
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/AnalogPotentiometerTest.cpp
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogPotentiometer.h"  // NOLINT(build/include_order)
+
+#include "AnalogOutput.h"
+#include "RobotController.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kScale = 270.0;
+static const double kAngle = 180.0;
+
+class AnalogPotentiometerTest : public testing::Test {
+ protected:
+  AnalogOutput* m_fakePot;
+  AnalogPotentiometer* m_pot;
+
+  void SetUp() override {
+    m_fakePot = new AnalogOutput(TestBench::kAnalogOutputChannel);
+    m_pot =
+        new AnalogPotentiometer(TestBench::kFakeAnalogOutputChannel, kScale);
+  }
+
+  void TearDown() override {
+    delete m_fakePot;
+    delete m_pot;
+  }
+};
+
+TEST_F(AnalogPotentiometerTest, TestInitialSettings) {
+  m_fakePot->SetVoltage(0.0);
+  Wait(0.1);
+  EXPECT_NEAR(0.0, m_pot->Get(), 5.0)
+      << "The potentiometer did not initialize to 0.";
+}
+
+TEST_F(AnalogPotentiometerTest, TestRangeValues) {
+  m_fakePot->SetVoltage(kAngle / kScale * RobotController::GetVoltage5V());
+  Wait(0.1);
+  EXPECT_NEAR(kAngle, m_pot->Get(), 2.0)
+      << "The potentiometer did not measure the correct angle.";
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/BuiltInAccelerometerTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/BuiltInAccelerometerTest.cpp
new file mode 100644
index 0000000..1148210
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/BuiltInAccelerometerTest.cpp
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "BuiltInAccelerometer.h"  // NOLINT(build/include_order)
+
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static constexpr double kAccelerationTolerance = 0.1;
+/**
+ * There's not much we can automatically test with the on-board accelerometer,
+ * but checking for gravity is probably good enough to tell that it's working.
+ */
+TEST(BuiltInAccelerometerTest, Accelerometer) {
+  BuiltInAccelerometer accelerometer;
+
+  /* The testbench sometimes shakes a little from a previous test.  Give it
+          some time. */
+  Wait(1.0);
+
+  ASSERT_NEAR(0.0, accelerometer.GetX(), kAccelerationTolerance);
+  ASSERT_NEAR(1.0, accelerometer.GetY(), kAccelerationTolerance);
+  ASSERT_NEAR(0.0, accelerometer.GetZ(), kAccelerationTolerance);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/CircularBufferTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/CircularBufferTest.cpp
new file mode 100644
index 0000000..47d222e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/CircularBufferTest.cpp
@@ -0,0 +1,211 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "circular_buffer.h"  // NOLINT(build/include_order)
+
+#include <array>
+
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const std::array<double, 10> values = {
+    751.848, 766.366, 342.657, 234.252, 716.126,
+    132.344, 445.697, 22.727,  421.125, 799.913};
+
+static const std::array<double, 8> pushFrontOut = {
+    799.913, 421.125, 22.727, 445.697, 132.344, 716.126, 234.252, 342.657};
+
+static const std::array<double, 8> pushBackOut = {
+    342.657, 234.252, 716.126, 132.344, 445.697, 22.727, 421.125, 799.913};
+
+TEST(CircularBufferTest, PushFrontTest) {
+  circular_buffer<double> queue(8);
+
+  for (auto& value : values) {
+    queue.push_front(value);
+  }
+
+  for (size_t i = 0; i < pushFrontOut.size(); i++) {
+    EXPECT_EQ(pushFrontOut[i], queue[i]);
+  }
+}
+
+TEST(CircularBufferTest, PushBackTest) {
+  circular_buffer<double> queue(8);
+
+  for (auto& value : values) {
+    queue.push_back(value);
+  }
+
+  for (size_t i = 0; i < pushBackOut.size(); i++) {
+    EXPECT_EQ(pushBackOut[i], queue[i]);
+  }
+}
+
+TEST(CircularBufferTest, PushPopTest) {
+  circular_buffer<double> queue(3);
+
+  // Insert three elements into the buffer
+  queue.push_back(1.0);
+  queue.push_back(2.0);
+  queue.push_back(3.0);
+
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+  EXPECT_EQ(3.0, queue[2]);
+
+  /*
+   * The buffer is full now, so pushing subsequent elements will overwrite the
+   * front-most elements.
+   */
+
+  queue.push_back(4.0);  // Overwrite 1 with 4
+
+  // The buffer now contains 2, 3 and 4
+  EXPECT_EQ(2.0, queue[0]);
+  EXPECT_EQ(3.0, queue[1]);
+  EXPECT_EQ(4.0, queue[2]);
+
+  queue.push_back(5.0);  // Overwrite 2 with 5
+
+  // The buffer now contains 3, 4 and 5
+  EXPECT_EQ(3.0, queue[0]);
+  EXPECT_EQ(4.0, queue[1]);
+  EXPECT_EQ(5.0, queue[2]);
+
+  EXPECT_EQ(5.0, queue.pop_back());  // 5 is removed
+
+  // The buffer now contains 3 and 4
+  EXPECT_EQ(3.0, queue[0]);
+  EXPECT_EQ(4.0, queue[1]);
+
+  EXPECT_EQ(3.0, queue.pop_front());  // 3 is removed
+
+  // Leaving only one element with value == 4
+  EXPECT_EQ(4.0, queue[0]);
+}
+
+TEST(CircularBufferTest, ResetTest) {
+  circular_buffer<double> queue(5);
+
+  for (size_t i = 1; i < 6; i++) {
+    queue.push_back(i);
+  }
+
+  queue.reset();
+
+  for (size_t i = 0; i < 5; i++) {
+    EXPECT_EQ(0.0, queue[i]);
+  }
+}
+
+TEST(CircularBufferTest, ResizeTest) {
+  circular_buffer<double> queue(5);
+
+  /* Buffer contains {1, 2, 3, _, _}
+   *                  ^ front
+   */
+  queue.push_back(1.0);
+  queue.push_back(2.0);
+  queue.push_back(3.0);
+
+  queue.resize(2);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.resize(5);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.reset();
+
+  /* Buffer contains {_, 1, 2, 3, _}
+   *                     ^ front
+   */
+  queue.push_back(0.0);
+  queue.push_back(1.0);
+  queue.push_back(2.0);
+  queue.push_back(3.0);
+  queue.pop_front();
+
+  queue.resize(2);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.resize(5);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.reset();
+
+  /* Buffer contains {_, _, 1, 2, 3}
+   *                        ^ front
+   */
+  queue.push_back(0.0);
+  queue.push_back(0.0);
+  queue.push_back(1.0);
+  queue.push_back(2.0);
+  queue.push_back(3.0);
+  queue.pop_front();
+  queue.pop_front();
+
+  queue.resize(2);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.resize(5);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.reset();
+
+  /* Buffer contains {3, _, _, 1, 2}
+   *                           ^ front
+   */
+  queue.push_back(3.0);
+  queue.push_front(2.0);
+  queue.push_front(1.0);
+
+  queue.resize(2);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.resize(5);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.reset();
+
+  /* Buffer contains {2, 3, _, _, 1}
+   *                              ^ front
+   */
+  queue.push_back(2.0);
+  queue.push_back(3.0);
+  queue.push_front(1.0);
+
+  queue.resize(2);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  queue.resize(5);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+
+  // Test push_back() after resize
+  queue.push_back(3.0);
+  EXPECT_EQ(1.0, queue[0]);
+  EXPECT_EQ(2.0, queue[1]);
+  EXPECT_EQ(3.0, queue[2]);
+
+  // Test push_front() after resize
+  queue.push_front(4.0);
+  EXPECT_EQ(4.0, queue[0]);
+  EXPECT_EQ(1.0, queue[1]);
+  EXPECT_EQ(2.0, queue[2]);
+  EXPECT_EQ(3.0, queue[3]);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/CounterTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/CounterTest.cpp
new file mode 100644
index 0000000..954fd6b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/CounterTest.cpp
@@ -0,0 +1,176 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Counter.h"  // NOLINT(build/include_order)
+
+#include "Jaguar.h"
+#include "Talon.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "Victor.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kMotorDelay = 2.5;
+
+static const double kMaxPeriod = 2.0;
+
+class CounterTest : public testing::Test {
+ protected:
+  Counter* m_talonCounter;
+  Counter* m_victorCounter;
+  Counter* m_jaguarCounter;
+  Talon* m_talon;
+  Victor* m_victor;
+  Jaguar* m_jaguar;
+
+  void SetUp() override {
+    m_talonCounter = new Counter(TestBench::kTalonEncoderChannelA);
+    m_victorCounter = new Counter(TestBench::kVictorEncoderChannelA);
+    m_jaguarCounter = new Counter(TestBench::kJaguarEncoderChannelA);
+    m_victor = new Victor(TestBench::kVictorChannel);
+    m_talon = new Talon(TestBench::kTalonChannel);
+    m_jaguar = new Jaguar(TestBench::kJaguarChannel);
+  }
+
+  void TearDown() override {
+    delete m_talonCounter;
+    delete m_victorCounter;
+    delete m_jaguarCounter;
+    delete m_victor;
+    delete m_talon;
+    delete m_jaguar;
+  }
+
+  void Reset() {
+    m_talonCounter->Reset();
+    m_victorCounter->Reset();
+    m_jaguarCounter->Reset();
+    m_talon->Set(0.0);
+    m_victor->Set(0.0);
+    m_jaguar->Set(0.0);
+  }
+};
+
+/**
+ * Tests the counter by moving the motor and determining if the
+ * counter is counting.
+ */
+TEST_F(CounterTest, CountTalon) {
+  Reset();
+
+  /* Run the motor forward and determine if the counter is counting. */
+  m_talon->Set(1.0);
+  Wait(0.5);
+
+  EXPECT_NE(0.0, m_talonCounter->Get()) << "The counter did not count (talon)";
+
+  /* Set the motor to 0 and determine if the counter resets to 0. */
+  m_talon->Set(0.0);
+  Wait(0.5);
+  m_talonCounter->Reset();
+
+  EXPECT_FLOAT_EQ(0.0, m_talonCounter->Get())
+      << "The counter did not restart to 0 (talon)";
+}
+
+TEST_F(CounterTest, CountVictor) {
+  Reset();
+
+  /* Run the motor forward and determine if the counter is counting. */
+  m_victor->Set(1.0);
+  Wait(0.5);
+
+  EXPECT_NE(0.0, m_victorCounter->Get())
+      << "The counter did not count (victor)";
+
+  /* Set the motor to 0 and determine if the counter resets to 0. */
+  m_victor->Set(0.0);
+  Wait(0.5);
+  m_victorCounter->Reset();
+
+  EXPECT_FLOAT_EQ(0.0, m_victorCounter->Get())
+      << "The counter did not restart to 0 (jaguar)";
+}
+
+TEST_F(CounterTest, CountJaguar) {
+  Reset();
+
+  /* Run the motor forward and determine if the counter is counting. */
+  m_jaguar->Set(1.0);
+  Wait(0.5);
+
+  EXPECT_NE(0.0, m_jaguarCounter->Get())
+      << "The counter did not count (jaguar)";
+
+  /* Set the motor to 0 and determine if the counter resets to 0. */
+  m_jaguar->Set(0.0);
+  Wait(0.5);
+  m_jaguarCounter->Reset();
+
+  EXPECT_FLOAT_EQ(0.0, m_jaguarCounter->Get())
+      << "The counter did not restart to 0 (jaguar)";
+}
+
+/**
+ * Tests the GetStopped and SetMaxPeriod methods by setting the Max Period and
+ * getting the value after a period of time.
+ */
+TEST_F(CounterTest, TalonGetStopped) {
+  Reset();
+
+  /* Set the Max Period of the counter and run the motor */
+  m_talonCounter->SetMaxPeriod(kMaxPeriod);
+  m_talon->Set(1.0);
+  Wait(0.5);
+
+  EXPECT_FALSE(m_talonCounter->GetStopped()) << "The counter did not count.";
+
+  /* Stop the motor and wait until the Max Period is exceeded */
+  m_talon->Set(0.0);
+  Wait(kMotorDelay);
+
+  EXPECT_TRUE(m_talonCounter->GetStopped())
+      << "The counter did not stop counting.";
+}
+
+TEST_F(CounterTest, VictorGetStopped) {
+  Reset();
+
+  /* Set the Max Period of the counter and run the motor */
+  m_victorCounter->SetMaxPeriod(kMaxPeriod);
+  m_victor->Set(1.0);
+  Wait(0.5);
+
+  EXPECT_FALSE(m_victorCounter->GetStopped()) << "The counter did not count.";
+
+  /* Stop the motor and wait until the Max Period is exceeded */
+  m_victor->Set(0.0);
+  Wait(kMotorDelay);
+
+  EXPECT_TRUE(m_victorCounter->GetStopped())
+      << "The counter did not stop counting.";
+}
+
+TEST_F(CounterTest, JaguarGetStopped) {
+  Reset();
+
+  /* Set the Max Period of the counter and run the motor */
+  m_jaguarCounter->SetMaxPeriod(kMaxPeriod);
+  m_jaguar->Set(1.0);
+  Wait(0.5);
+
+  EXPECT_FALSE(m_jaguarCounter->GetStopped()) << "The counter did not count.";
+
+  /* Stop the motor and wait until the Max Period is exceeded */
+  m_jaguar->Set(0.0);
+  Wait(kMotorDelay);
+
+  EXPECT_TRUE(m_jaguarCounter->GetStopped())
+      << "The counter did not stop counting.";
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DIOLoopTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DIOLoopTest.cpp
new file mode 100644
index 0000000..2eae1a4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DIOLoopTest.cpp
@@ -0,0 +1,188 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalInput.h"  // NOLINT(build/include_order)
+
+#include "DigitalOutput.h"  // NOLINT(build/include_order)
+
+#include "Counter.h"
+#include "InterruptableSensorBase.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kCounterTime = 0.001;
+
+static const double kDelayTime = 0.1;
+
+static const double kSynchronousInterruptTime = 2.0;
+static const double kSynchronousInterruptTimeTolerance = 0.01;
+
+/**
+ * A fixture with a digital input and a digital output physically wired
+ * together.
+ */
+class DIOLoopTest : public testing::Test {
+ protected:
+  DigitalInput* m_input;
+  DigitalOutput* m_output;
+
+  void SetUp() override {
+    m_input = new DigitalInput(TestBench::kLoop1InputChannel);
+    m_output = new DigitalOutput(TestBench::kLoop1OutputChannel);
+  }
+
+  void TearDown() override {
+    delete m_input;
+    delete m_output;
+  }
+
+  void Reset() { m_output->Set(false); }
+};
+
+/**
+ * Test the DigitalInput and DigitalOutput classes by setting the output and
+ * reading the input.
+ */
+TEST_F(DIOLoopTest, Loop) {
+  Reset();
+
+  m_output->Set(false);
+  Wait(kDelayTime);
+  EXPECT_FALSE(m_input->Get()) << "The digital output was turned off, but "
+                               << "the digital input is on.";
+
+  m_output->Set(true);
+  Wait(kDelayTime);
+  EXPECT_TRUE(m_input->Get()) << "The digital output was turned on, but "
+                              << "the digital input is off.";
+}
+/**
+ * Tests to see if the DIO PWM functionality works.
+ */
+TEST_F(DIOLoopTest, DIOPWM) {
+  Reset();
+
+  m_output->Set(false);
+  Wait(kDelayTime);
+  EXPECT_FALSE(m_input->Get()) << "The digital output was turned off, but "
+                               << "the digital input is on.";
+
+  // Set frequency to 2.0 Hz
+  m_output->SetPWMRate(2.0);
+  // Enable PWM, but leave it off
+  m_output->EnablePWM(0.0);
+  Wait(0.5);
+  m_output->UpdateDutyCycle(0.5);
+  m_input->RequestInterrupts();
+  m_input->SetUpSourceEdge(false, true);
+  InterruptableSensorBase::WaitResult result =
+      m_input->WaitForInterrupt(3.0, true);
+
+  Wait(0.5);
+  bool firstCycle = m_input->Get();
+  Wait(0.5);
+  bool secondCycle = m_input->Get();
+  Wait(0.5);
+  bool thirdCycle = m_input->Get();
+  Wait(0.5);
+  bool forthCycle = m_input->Get();
+  Wait(0.5);
+  bool fifthCycle = m_input->Get();
+  Wait(0.5);
+  bool sixthCycle = m_input->Get();
+  Wait(0.5);
+  bool seventhCycle = m_input->Get();
+  m_output->DisablePWM();
+  Wait(0.5);
+  bool firstAfterStop = m_input->Get();
+  Wait(0.5);
+  bool secondAfterStop = m_input->Get();
+
+  EXPECT_EQ(InterruptableSensorBase::WaitResult::kFallingEdge, result)
+      << "WaitForInterrupt was not falling.";
+
+  EXPECT_FALSE(firstCycle) << "Input not low after first delay";
+  EXPECT_TRUE(secondCycle) << "Input not high after second delay";
+  EXPECT_FALSE(thirdCycle) << "Input not low after third delay";
+  EXPECT_TRUE(forthCycle) << "Input not high after forth delay";
+  EXPECT_FALSE(fifthCycle) << "Input not low after fifth delay";
+  EXPECT_TRUE(sixthCycle) << "Input not high after sixth delay";
+  EXPECT_FALSE(seventhCycle) << "Input not low after seventh delay";
+  EXPECT_FALSE(firstAfterStop) << "Input not low after stopping first read";
+  EXPECT_FALSE(secondAfterStop) << "Input not low after stopping second read";
+}
+
+/**
+ * Test a fake "counter" that uses the DIO loop as an input to make sure the
+ * Counter class works
+ */
+TEST_F(DIOLoopTest, FakeCounter) {
+  Reset();
+
+  Counter counter(m_input);
+
+  EXPECT_EQ(0, counter.Get()) << "Counter did not initialize to 0.";
+
+  /* Count 100 ticks.  The counter value should be 100 after this loop. */
+  for (int32_t i = 0; i < 100; i++) {
+    m_output->Set(true);
+    Wait(kCounterTime);
+    m_output->Set(false);
+    Wait(kCounterTime);
+  }
+
+  EXPECT_EQ(100, counter.Get()) << "Counter did not count up to 100.";
+}
+
+static void InterruptHandler(uint32_t interruptAssertedMask, void* param) {
+  *reinterpret_cast<int32_t*>(param) = 12345;
+}
+
+TEST_F(DIOLoopTest, AsynchronousInterruptWorks) {
+  int32_t param = 0;
+
+  // Given an interrupt handler that sets an int32_t to 12345
+  m_input->RequestInterrupts(InterruptHandler, &param);
+  m_input->EnableInterrupts();
+
+  // If the voltage rises
+  m_output->Set(false);
+  m_output->Set(true);
+  m_input->CancelInterrupts();
+
+  // Then the int32_t should be 12345
+  Wait(kDelayTime);
+  EXPECT_EQ(12345, param) << "The interrupt did not run.";
+}
+
+static void* InterruptTriggerer(void* data) {
+  DigitalOutput* output = static_cast<DigitalOutput*>(data);
+  output->Set(false);
+  Wait(kSynchronousInterruptTime);
+  output->Set(true);
+  return nullptr;
+}
+
+TEST_F(DIOLoopTest, SynchronousInterruptWorks) {
+  // Given a synchronous interrupt
+  m_input->RequestInterrupts();
+
+  // If we have another thread trigger the interrupt in a few seconds
+  pthread_t interruptTriggererLoop;
+  pthread_create(&interruptTriggererLoop, nullptr, InterruptTriggerer,
+                 m_output);
+
+  // Then this thread should pause and resume after that number of seconds
+  Timer timer;
+  timer.Start();
+  m_input->WaitForInterrupt(kSynchronousInterruptTime + 1.0);
+  EXPECT_NEAR(kSynchronousInterruptTime, timer.Get(),
+              kSynchronousInterruptTimeTolerance);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DigitalGlitchFilterTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DigitalGlitchFilterTest.cpp
new file mode 100644
index 0000000..5f32427
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DigitalGlitchFilterTest.cpp
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DigitalGlitchFilter.h"  // NOLINT(build/include_order)
+
+#include "Counter.h"
+#include "DigitalInput.h"
+#include "Encoder.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+/**
+ * Tests that configuring inputs to be filtered succeeds.
+ *
+ * This test actually tests everything except that the actual FPGA
+ * implementation works as intended.  We configure the FPGA and then query it to
+ * make sure that the acutal configuration matches.
+ */
+TEST(DigitalGlitchFilterTest, BasicTest) {
+  DigitalInput input1(1);
+  DigitalInput input2(2);
+  DigitalInput input3(3);
+  DigitalInput input4(4);
+  Encoder encoder5(5, 6);
+  Counter counter7(7);
+
+  // Check that we can make a single filter and set the period.
+  DigitalGlitchFilter filter1;
+  filter1.Add(&input1);
+  filter1.SetPeriodNanoSeconds(4200);
+
+  // Check that we can make a second filter with 2 inputs.
+  DigitalGlitchFilter filter2;
+  filter2.Add(&input2);
+  filter2.Add(&input3);
+  filter2.SetPeriodNanoSeconds(97100);
+
+  // Check that we can make a third filter with an input, an encoder, and a
+  // counter.
+  DigitalGlitchFilter filter3;
+  filter3.Add(&input4);
+  filter3.Add(&encoder5);
+  filter3.Add(&counter7);
+  filter3.SetPeriodNanoSeconds(167800);
+
+  // Verify that the period was properly set for all 3 filters.
+  EXPECT_EQ(4200u, filter1.GetPeriodNanoSeconds());
+  EXPECT_EQ(97100u, filter2.GetPeriodNanoSeconds());
+  EXPECT_EQ(167800u, filter3.GetPeriodNanoSeconds());
+
+  // Clean up.
+  filter1.Remove(&input1);
+  filter2.Remove(&input2);
+  filter2.Remove(&input3);
+  filter3.Remove(&input4);
+  filter3.Remove(&encoder5);
+  filter3.Remove(&counter7);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DriverStationTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DriverStationTest.cpp
new file mode 100644
index 0000000..717ec91
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/DriverStationTest.cpp
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DriverStation.h"  // NOLINT(build/include_order)
+
+#include "RobotController.h"
+#include "TestBench.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+constexpr double TIMER_TOLERANCE = 0.2;
+constexpr int64_t TIMER_RUNTIME = 1000000;  // 1 second
+
+class DriverStationTest : public testing::Test {};
+
+/**
+ * Test if the WaitForData function works
+ */
+TEST_F(DriverStationTest, WaitForData) {
+  uint64_t initialTime = RobotController::GetFPGATime();
+
+  for (int i = 0; i < 50; i++) {
+    DriverStation::GetInstance().WaitForData();
+  }
+
+  uint64_t finalTime = RobotController::GetFPGATime();
+
+  EXPECT_NEAR(TIMER_RUNTIME, finalTime - initialTime,
+              TIMER_TOLERANCE * TIMER_RUNTIME);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FakeEncoderTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FakeEncoderTest.cpp
new file mode 100644
index 0000000..8e8bcf2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FakeEncoderTest.cpp
@@ -0,0 +1,161 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Encoder.h"  // NOLINT(build/include_order)
+
+#include "AnalogOutput.h"
+#include "AnalogTrigger.h"
+#include "DigitalOutput.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kDelayTime = 0.001;
+
+class FakeEncoderTest : public testing::Test {
+ protected:
+  DigitalOutput* m_outputA;
+  DigitalOutput* m_outputB;
+  AnalogOutput* m_indexOutput;
+
+  Encoder* m_encoder;
+  AnalogTrigger* m_indexAnalogTrigger;
+  std::shared_ptr<AnalogTriggerOutput> m_indexAnalogTriggerOutput;
+
+  void SetUp() override {
+    m_outputA = new DigitalOutput(TestBench::kLoop2OutputChannel);
+    m_outputB = new DigitalOutput(TestBench::kLoop1OutputChannel);
+    m_indexOutput = new AnalogOutput(TestBench::kAnalogOutputChannel);
+    m_outputA->Set(false);
+    m_outputB->Set(false);
+    m_encoder = new Encoder(TestBench::kLoop1InputChannel,
+                            TestBench::kLoop2InputChannel);
+    m_indexAnalogTrigger =
+        new AnalogTrigger(TestBench::kFakeAnalogOutputChannel);
+    m_indexAnalogTrigger->SetLimitsVoltage(2.0, 3.0);
+    m_indexAnalogTriggerOutput =
+        m_indexAnalogTrigger->CreateOutput(AnalogTriggerType::kState);
+  }
+
+  void TearDown() override {
+    delete m_outputA;
+    delete m_outputB;
+    delete m_indexOutput;
+    delete m_encoder;
+    delete m_indexAnalogTrigger;
+  }
+
+  /**
+   * Output pulses to the encoder's input channels to simulate a change of 100
+   * ticks
+   */
+  void Simulate100QuadratureTicks() {
+    for (int32_t i = 0; i < 100; i++) {
+      m_outputA->Set(true);
+      Wait(kDelayTime);
+      m_outputB->Set(true);
+      Wait(kDelayTime);
+      m_outputA->Set(false);
+      Wait(kDelayTime);
+      m_outputB->Set(false);
+      Wait(kDelayTime);
+    }
+  }
+
+  void SetIndexHigh() {
+    m_indexOutput->SetVoltage(5.0);
+    Wait(kDelayTime);
+  }
+
+  void SetIndexLow() {
+    m_indexOutput->SetVoltage(0.0);
+    Wait(kDelayTime);
+  }
+};
+
+/**
+ * Test the encoder by reseting it to 0 and reading the value.
+ */
+TEST_F(FakeEncoderTest, TestDefaultState) {
+  EXPECT_FLOAT_EQ(0.0, m_encoder->Get()) << "The encoder did not start at 0.";
+}
+
+/**
+ * Test the encoder by setting the digital outputs and reading the value.
+ */
+TEST_F(FakeEncoderTest, TestCountUp) {
+  m_encoder->Reset();
+  Simulate100QuadratureTicks();
+
+  EXPECT_FLOAT_EQ(100.0, m_encoder->Get()) << "Encoder did not count to 100.";
+}
+
+/**
+ * Test that the encoder can stay reset while the index source is high
+ */
+TEST_F(FakeEncoderTest, TestResetWhileHigh) {
+  m_encoder->SetIndexSource(*m_indexAnalogTriggerOutput,
+                            Encoder::IndexingType::kResetWhileHigh);
+
+  SetIndexLow();
+  Simulate100QuadratureTicks();
+  SetIndexHigh();
+  EXPECT_EQ(0, m_encoder->Get());
+
+  Simulate100QuadratureTicks();
+  EXPECT_EQ(0, m_encoder->Get());
+}
+
+/**
+ * Test that the encoder can reset when the index source goes from low to high
+ */
+TEST_F(FakeEncoderTest, TestResetOnRisingEdge) {
+  m_encoder->SetIndexSource(*m_indexAnalogTriggerOutput,
+                            Encoder::IndexingType::kResetOnRisingEdge);
+
+  SetIndexLow();
+  Simulate100QuadratureTicks();
+  SetIndexHigh();
+  EXPECT_EQ(0, m_encoder->Get());
+
+  Simulate100QuadratureTicks();
+  EXPECT_EQ(100, m_encoder->Get());
+}
+
+/**
+ * Test that the encoder can stay reset while the index source is low
+ */
+TEST_F(FakeEncoderTest, TestResetWhileLow) {
+  m_encoder->SetIndexSource(*m_indexAnalogTriggerOutput,
+                            Encoder::IndexingType::kResetWhileLow);
+
+  SetIndexHigh();
+  Simulate100QuadratureTicks();
+  SetIndexLow();
+  EXPECT_EQ(0, m_encoder->Get());
+
+  Simulate100QuadratureTicks();
+  EXPECT_EQ(0, m_encoder->Get());
+}
+
+/**
+ * Test that the encoder can reset when the index source goes from high to low
+ */
+TEST_F(FakeEncoderTest, TestResetOnFallingEdge) {
+  m_encoder->SetIndexSource(*m_indexAnalogTriggerOutput,
+                            Encoder::IndexingType::kResetOnFallingEdge);
+
+  SetIndexHigh();
+  Simulate100QuadratureTicks();
+  SetIndexLow();
+  EXPECT_EQ(0, m_encoder->Get());
+
+  Simulate100QuadratureTicks();
+  EXPECT_EQ(100, m_encoder->Get());
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FilterNoiseTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FilterNoiseTest.cpp
new file mode 100644
index 0000000..0adbb63
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FilterNoiseTest.cpp
@@ -0,0 +1,129 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Filters/LinearDigitalFilter.h"  // NOLINT(build/include_order)
+
+#include <cmath>
+#include <functional>
+#include <memory>
+#include <random>
+#include <thread>
+
+#include "Base.h"
+#include "TestBench.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+enum FilterNoiseTestType { TEST_SINGLE_POLE_IIR, TEST_MOVAVG };
+
+std::ostream& operator<<(std::ostream& os, const FilterNoiseTestType& type) {
+  switch (type) {
+    case TEST_SINGLE_POLE_IIR:
+      os << "LinearDigitalFilter SinglePoleIIR";
+      break;
+    case TEST_MOVAVG:
+      os << "LinearDigitalFilter MovingAverage";
+      break;
+  }
+
+  return os;
+}
+
+constexpr double kStdDev = 10.0;
+
+/**
+ * Adds Gaussian white noise to a function returning data. The noise will have
+ * the standard deviation provided in the constructor.
+ */
+class NoiseGenerator : public PIDSource {
+ public:
+  NoiseGenerator(double (*dataFunc)(double), double stdDev)
+      : m_distr(0.0, stdDev) {
+    m_dataFunc = dataFunc;
+  }
+
+  void SetPIDSourceType(PIDSourceType pidSource) override {}
+
+  double Get() { return m_dataFunc(m_count) + m_noise; }
+
+  double PIDGet() override {
+    m_noise = m_distr(m_gen);
+    m_count += TestBench::kFilterStep;
+    return m_dataFunc(m_count) + m_noise;
+  }
+
+  void Reset() { m_count = -TestBench::kFilterStep; }
+
+ private:
+  std::function<double(double)> m_dataFunc;
+  double m_noise = 0.0;
+
+  // Make sure first call to PIDGet() uses m_count == 0
+  double m_count = -TestBench::kFilterStep;
+
+  std::random_device m_rd;
+  std::mt19937 m_gen{m_rd()};
+  std::normal_distribution<double> m_distr;
+};
+
+/**
+ * A fixture that includes a noise generator wrapped in a filter
+ */
+class FilterNoiseTest : public testing::TestWithParam<FilterNoiseTestType> {
+ protected:
+  std::unique_ptr<PIDSource> m_filter;
+  std::shared_ptr<NoiseGenerator> m_noise;
+
+  static double GetData(double t) { return 100.0 * std::sin(2.0 * M_PI * t); }
+
+  void SetUp() override {
+    m_noise = std::make_shared<NoiseGenerator>(GetData, kStdDev);
+
+    switch (GetParam()) {
+      case TEST_SINGLE_POLE_IIR: {
+        m_filter = std::make_unique<LinearDigitalFilter>(
+            LinearDigitalFilter::SinglePoleIIR(
+                m_noise, TestBench::kSinglePoleIIRTimeConstant,
+                TestBench::kFilterStep));
+        break;
+      }
+
+      case TEST_MOVAVG: {
+        m_filter = std::make_unique<LinearDigitalFilter>(
+            LinearDigitalFilter::MovingAverage(m_noise,
+                                               TestBench::kMovAvgTaps));
+        break;
+      }
+    }
+  }
+};
+
+/**
+ * Test if the filter reduces the noise produced by a signal generator
+ */
+TEST_P(FilterNoiseTest, NoiseReduce) {
+  double theoryData = 0.0;
+  double noiseGenError = 0.0;
+  double filterError = 0.0;
+
+  m_noise->Reset();
+  for (double t = 0; t < TestBench::kFilterTime; t += TestBench::kFilterStep) {
+    theoryData = GetData(t);
+    filterError += std::abs(m_filter->PIDGet() - theoryData);
+    noiseGenError += std::abs(m_noise->Get() - theoryData);
+  }
+
+  RecordProperty("FilterError", filterError);
+
+  // The filter should have produced values closer to the theory
+  EXPECT_GT(noiseGenError, filterError)
+      << "Filter should have reduced noise accumulation but failed";
+}
+
+INSTANTIATE_TEST_CASE_P(Test, FilterNoiseTest,
+                        testing::Values(TEST_SINGLE_POLE_IIR, TEST_MOVAVG));
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FilterOutputTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FilterOutputTest.cpp
new file mode 100644
index 0000000..e9e1b75
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/FilterOutputTest.cpp
@@ -0,0 +1,150 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Filters/LinearDigitalFilter.h"  // NOLINT(build/include_order)
+
+#include <cmath>
+#include <functional>
+#include <memory>
+#include <random>
+#include <thread>
+
+#include "Base.h"
+#include "TestBench.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+enum FilterOutputTestType {
+  TEST_SINGLE_POLE_IIR,
+  TEST_HIGH_PASS,
+  TEST_MOVAVG,
+  TEST_PULSE
+};
+
+std::ostream& operator<<(std::ostream& os, const FilterOutputTestType& type) {
+  switch (type) {
+    case TEST_SINGLE_POLE_IIR:
+      os << "LinearDigitalFilter SinglePoleIIR";
+      break;
+    case TEST_HIGH_PASS:
+      os << "LinearDigitalFilter HighPass";
+      break;
+    case TEST_MOVAVG:
+      os << "LinearDigitalFilter MovingAverage";
+      break;
+    case TEST_PULSE:
+      os << "LinearDigitalFilter Pulse";
+      break;
+  }
+
+  return os;
+}
+
+class DataWrapper : public PIDSource {
+ public:
+  explicit DataWrapper(double (*dataFunc)(double)) { m_dataFunc = dataFunc; }
+
+  virtual void SetPIDSourceType(PIDSourceType pidSource) {}
+
+  virtual double PIDGet() {
+    m_count += TestBench::kFilterStep;
+    return m_dataFunc(m_count);
+  }
+
+  void Reset() { m_count = -TestBench::kFilterStep; }
+
+ private:
+  std::function<double(double)> m_dataFunc;
+
+  // Make sure first call to PIDGet() uses m_count == 0
+  double m_count = -TestBench::kFilterStep;
+};
+
+/**
+ * A fixture that includes a consistent data source wrapped in a filter
+ */
+class FilterOutputTest : public testing::TestWithParam<FilterOutputTestType> {
+ protected:
+  std::unique_ptr<PIDSource> m_filter;
+  std::shared_ptr<DataWrapper> m_data;
+  double m_expectedOutput = 0.0;
+
+  static double GetData(double t) {
+    return 100.0 * std::sin(2.0 * M_PI * t) + 20.0 * std::cos(50.0 * M_PI * t);
+  }
+
+  static double GetPulseData(double t) {
+    if (std::abs(t - 1.0) < 0.001) {
+      return 1.0;
+    } else {
+      return 0.0;
+    }
+  }
+
+  void SetUp() override {
+    switch (GetParam()) {
+      case TEST_SINGLE_POLE_IIR: {
+        m_data = std::make_shared<DataWrapper>(GetData);
+        m_filter = std::make_unique<LinearDigitalFilter>(
+            LinearDigitalFilter::SinglePoleIIR(
+                m_data, TestBench::kSinglePoleIIRTimeConstant,
+                TestBench::kFilterStep));
+        m_expectedOutput = TestBench::kSinglePoleIIRExpectedOutput;
+        break;
+      }
+
+      case TEST_HIGH_PASS: {
+        m_data = std::make_shared<DataWrapper>(GetData);
+        m_filter =
+            std::make_unique<LinearDigitalFilter>(LinearDigitalFilter::HighPass(
+                m_data, TestBench::kHighPassTimeConstant,
+                TestBench::kFilterStep));
+        m_expectedOutput = TestBench::kHighPassExpectedOutput;
+        break;
+      }
+
+      case TEST_MOVAVG: {
+        m_data = std::make_shared<DataWrapper>(GetData);
+        m_filter = std::make_unique<LinearDigitalFilter>(
+            LinearDigitalFilter::MovingAverage(m_data, TestBench::kMovAvgTaps));
+        m_expectedOutput = TestBench::kMovAvgExpectedOutput;
+        break;
+      }
+
+      case TEST_PULSE: {
+        m_data = std::make_shared<DataWrapper>(GetPulseData);
+        m_filter = std::make_unique<LinearDigitalFilter>(
+            LinearDigitalFilter::MovingAverage(m_data, TestBench::kMovAvgTaps));
+        m_expectedOutput = 0.0;
+        break;
+      }
+    }
+  }
+};
+
+/**
+ * Test if the linear digital filters produce consistent output
+ */
+TEST_P(FilterOutputTest, FilterOutput) {
+  m_data->Reset();
+
+  double filterOutput = 0.0;
+  for (double t = 0.0; t < TestBench::kFilterTime;
+       t += TestBench::kFilterStep) {
+    filterOutput = m_filter->PIDGet();
+  }
+
+  RecordProperty("FilterOutput", filterOutput);
+
+  EXPECT_FLOAT_EQ(m_expectedOutput, filterOutput)
+      << "Filter output didn't match expected value";
+}
+
+INSTANTIATE_TEST_CASE_P(Test, FilterOutputTest,
+                        testing::Values(TEST_SINGLE_POLE_IIR, TEST_HIGH_PASS,
+                                        TEST_MOVAVG, TEST_PULSE));
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MockSpeedController.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MockSpeedController.cpp
new file mode 100644
index 0000000..875fec1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MockSpeedController.cpp
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "MockSpeedController.h"
+
+using namespace frc;
+
+void MockSpeedController::Set(double speed) {
+  m_speed = m_isInverted ? -speed : speed;
+}
+
+double MockSpeedController::Get() const { return m_speed; }
+
+void MockSpeedController::SetInverted(bool isInverted) {
+  m_isInverted = isInverted;
+}
+
+bool MockSpeedController::GetInverted() const { return m_isInverted; }
+
+void MockSpeedController::Disable() { m_speed = 0; }
+
+void MockSpeedController::StopMotor() { Disable(); }
+
+void MockSpeedController::PIDWrite(double output) { Set(output); }
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MotorEncoderTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MotorEncoderTest.cpp
new file mode 100644
index 0000000..7e1f25f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MotorEncoderTest.cpp
@@ -0,0 +1,193 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Encoder.h"
+#include "Filters/LinearDigitalFilter.h"
+#include "Jaguar.h"
+#include "PIDController.h"
+#include "Talon.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "Victor.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+enum MotorEncoderTestType { TEST_VICTOR, TEST_JAGUAR, TEST_TALON };
+
+std::ostream& operator<<(std::ostream& os, MotorEncoderTestType const& type) {
+  switch (type) {
+    case TEST_VICTOR:
+      os << "Victor";
+      break;
+    case TEST_JAGUAR:
+      os << "Jaguar";
+      break;
+    case TEST_TALON:
+      os << "Talon";
+      break;
+  }
+
+  return os;
+}
+
+static constexpr double kMotorTime = 0.5;
+
+/**
+ * A fixture that includes a PWM speed controller and an encoder connected to
+ * the same motor.
+ */
+class MotorEncoderTest : public testing::TestWithParam<MotorEncoderTestType> {
+ protected:
+  SpeedController* m_speedController;
+  Encoder* m_encoder;
+  LinearDigitalFilter* m_filter;
+
+  void SetUp() override {
+    switch (GetParam()) {
+      case TEST_VICTOR:
+        m_speedController = new Victor(TestBench::kVictorChannel);
+        m_encoder = new Encoder(TestBench::kVictorEncoderChannelA,
+                                TestBench::kVictorEncoderChannelB);
+        break;
+
+      case TEST_JAGUAR:
+        m_speedController = new Jaguar(TestBench::kJaguarChannel);
+        m_encoder = new Encoder(TestBench::kJaguarEncoderChannelA,
+                                TestBench::kJaguarEncoderChannelB);
+        break;
+
+      case TEST_TALON:
+        m_speedController = new Talon(TestBench::kTalonChannel);
+        m_encoder = new Encoder(TestBench::kTalonEncoderChannelA,
+                                TestBench::kTalonEncoderChannelB);
+        break;
+    }
+    m_filter = new LinearDigitalFilter(
+        LinearDigitalFilter::MovingAverage(*m_encoder, 50));
+  }
+
+  void TearDown() override {
+    delete m_speedController;
+    delete m_encoder;
+    delete m_filter;
+  }
+
+  void Reset() {
+    m_speedController->Set(0.0);
+    m_encoder->Reset();
+    m_filter->Reset();
+  }
+};
+
+/**
+ * Test if the encoder value increments after the motor drives forward
+ */
+TEST_P(MotorEncoderTest, Increment) {
+  Reset();
+
+  /* Drive the speed controller briefly to move the encoder */
+  m_speedController->Set(0.2f);
+  Wait(kMotorTime);
+  m_speedController->Set(0.0);
+
+  /* The encoder should be positive now */
+  EXPECT_GT(m_encoder->Get(), 0)
+      << "Encoder should have incremented after the motor moved";
+}
+
+/**
+ * Test if the encoder value decrements after the motor drives backwards
+ */
+TEST_P(MotorEncoderTest, Decrement) {
+  Reset();
+
+  /* Drive the speed controller briefly to move the encoder */
+  m_speedController->Set(-0.2);
+  Wait(kMotorTime);
+  m_speedController->Set(0.0);
+
+  /* The encoder should be positive now */
+  EXPECT_LT(m_encoder->Get(), 0.0)
+      << "Encoder should have decremented after the motor moved";
+}
+
+/**
+ * Test if motor speeds are clamped to [-1,1]
+ */
+TEST_P(MotorEncoderTest, ClampSpeed) {
+  Reset();
+
+  m_speedController->Set(2.0);
+  Wait(kMotorTime);
+
+  EXPECT_FLOAT_EQ(1.0, m_speedController->Get());
+
+  m_speedController->Set(-2.0);
+  Wait(kMotorTime);
+
+  EXPECT_FLOAT_EQ(-1.0, m_speedController->Get());
+}
+
+/**
+ * Test if position PID loop works
+ */
+TEST_P(MotorEncoderTest, PositionPIDController) {
+  Reset();
+  double goal = 1000;
+  m_encoder->SetPIDSourceType(PIDSourceType::kDisplacement);
+  PIDController pid(0.001, 0.0005, 0.0, m_encoder, m_speedController);
+  pid.SetAbsoluteTolerance(50.0);
+  pid.SetOutputRange(-0.2, 0.2);
+  pid.SetSetpoint(goal);
+
+  /* 10 seconds should be plenty time to get to the setpoint */
+  pid.Enable();
+  Wait(10.0);
+  pid.Disable();
+
+  RecordProperty("PIDError", pid.GetError());
+
+  EXPECT_TRUE(pid.OnTarget())
+      << "PID loop did not converge within 10 seconds. Goal was: " << goal
+      << " Error was: " << pid.GetError();
+}
+
+/**
+ * Test if velocity PID loop works
+ */
+TEST_P(MotorEncoderTest, VelocityPIDController) {
+  Reset();
+
+  m_encoder->SetPIDSourceType(PIDSourceType::kRate);
+  PIDController pid(1e-5, 0.0, 3e-5, 8e-5, m_filter, m_speedController);
+  pid.SetAbsoluteTolerance(200.0);
+  pid.SetOutputRange(-0.3, 0.3);
+  pid.SetSetpoint(600);
+
+  /* 10 seconds should be plenty time to get to the setpoint */
+  pid.Enable();
+  Wait(10.0);
+  pid.Disable();
+  RecordProperty("PIDError", pid.GetError());
+
+  EXPECT_TRUE(pid.OnTarget())
+      << "PID loop did not converge within 10 seconds. Goal was: " << 600
+      << " Error was: " << pid.GetError();
+}
+
+/**
+ * Test resetting encoders
+ */
+TEST_P(MotorEncoderTest, Reset) {
+  Reset();
+
+  EXPECT_EQ(0, m_encoder->Get()) << "Encoder did not reset to 0";
+}
+
+INSTANTIATE_TEST_CASE_P(Test, MotorEncoderTest,
+                        testing::Values(TEST_VICTOR, TEST_JAGUAR, TEST_TALON));
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MotorInvertingTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MotorInvertingTest.cpp
new file mode 100644
index 0000000..cd09c43
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/MotorInvertingTest.cpp
@@ -0,0 +1,156 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Encoder.h"
+#include "Jaguar.h"
+#include "Talon.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "Victor.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+enum MotorInvertingTestType { TEST_VICTOR, TEST_JAGUAR, TEST_TALON };
+static const double motorSpeed = 0.15;
+static const double delayTime = 0.5;
+std::ostream& operator<<(std::ostream& os, MotorInvertingTestType const& type) {
+  switch (type) {
+    case TEST_VICTOR:
+      os << "Victor";
+      break;
+    case TEST_JAGUAR:
+      os << "Jaguar";
+      break;
+    case TEST_TALON:
+      os << "Talon";
+      break;
+  }
+
+  return os;
+}
+class MotorInvertingTest
+    : public testing::TestWithParam<MotorInvertingTestType> {
+ protected:
+  SpeedController* m_speedController;
+  Encoder* m_encoder;
+
+  void SetUp() override {
+    switch (GetParam()) {
+      case TEST_VICTOR:
+        m_speedController = new Victor(TestBench::kVictorChannel);
+        m_encoder = new Encoder(TestBench::kVictorEncoderChannelA,
+                                TestBench::kVictorEncoderChannelB);
+        break;
+
+      case TEST_JAGUAR:
+        m_speedController = new Jaguar(TestBench::kJaguarChannel);
+        m_encoder = new Encoder(TestBench::kJaguarEncoderChannelA,
+                                TestBench::kJaguarEncoderChannelB);
+        break;
+
+      case TEST_TALON:
+        m_speedController = new Talon(TestBench::kTalonChannel);
+        m_encoder = new Encoder(TestBench::kTalonEncoderChannelA,
+                                TestBench::kTalonEncoderChannelB);
+        break;
+    }
+  }
+
+  void TearDown() override {
+    delete m_speedController;
+    delete m_encoder;
+  }
+
+  void Reset() {
+    m_speedController->SetInverted(false);
+    m_speedController->Set(0.0);
+    m_encoder->Reset();
+  }
+};
+
+TEST_P(MotorInvertingTest, InvertingPositive) {
+  Reset();
+
+  m_speedController->Set(motorSpeed);
+
+  Wait(delayTime);
+
+  bool initDirection = m_encoder->GetDirection();
+  m_speedController->SetInverted(true);
+  m_speedController->Set(motorSpeed);
+
+  Wait(delayTime);
+
+  EXPECT_TRUE(m_encoder->GetDirection() != initDirection)
+      << "Inverting with Positive value does not change direction";
+
+  Reset();
+}
+
+TEST_P(MotorInvertingTest, InvertingNegative) {
+  Reset();
+
+  m_speedController->SetInverted(false);
+  m_speedController->Set(-motorSpeed);
+
+  Wait(delayTime);
+
+  bool initDirection = m_encoder->GetDirection();
+  m_speedController->SetInverted(true);
+  m_speedController->Set(-motorSpeed);
+
+  Wait(delayTime);
+
+  EXPECT_TRUE(m_encoder->GetDirection() != initDirection)
+      << "Inverting with Negative value does not change direction";
+
+  Reset();
+}
+
+TEST_P(MotorInvertingTest, InvertingSwitchingPosToNeg) {
+  Reset();
+
+  m_speedController->SetInverted(false);
+  m_speedController->Set(motorSpeed);
+
+  Wait(delayTime);
+
+  bool initDirection = m_encoder->GetDirection();
+  m_speedController->SetInverted(true);
+  m_speedController->Set(-motorSpeed);
+
+  Wait(delayTime);
+
+  EXPECT_TRUE(m_encoder->GetDirection() == initDirection)
+      << "Inverting with Switching value does change direction";
+
+  Reset();
+}
+
+TEST_P(MotorInvertingTest, InvertingSwitchingNegToPos) {
+  Reset();
+
+  m_speedController->SetInverted(false);
+  m_speedController->Set(-motorSpeed);
+
+  Wait(delayTime);
+
+  bool initDirection = m_encoder->GetDirection();
+  m_speedController->SetInverted(true);
+  m_speedController->Set(motorSpeed);
+
+  Wait(delayTime);
+
+  EXPECT_TRUE(m_encoder->GetDirection() == initDirection)
+      << "Inverting with Switching value does change direction";
+
+  Reset();
+}
+
+INSTANTIATE_TEST_CASE_P(Test, MotorInvertingTest,
+                        testing::Values(TEST_VICTOR, TEST_JAGUAR, TEST_TALON));
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/NotifierTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/NotifierTest.cpp
new file mode 100644
index 0000000..012312a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/NotifierTest.cpp
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Notifier.h"  // NOLINT(build/include_order)
+
+#include <llvm/raw_ostream.h>
+
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+unsigned notifierCounter;
+
+void notifierHandler(void*) { notifierCounter++; }
+
+/**
+ * Test if the Wait function works
+ */
+TEST(NotifierTest, DISABLED_TestTimerNotifications) {
+  llvm::outs() << "NotifierTest...\n";
+  notifierCounter = 0;
+  llvm::outs() << "notifier(notifierHandler, nullptr)...\n";
+  Notifier notifier(notifierHandler, nullptr);
+  llvm::outs() << "Start Periodic...\n";
+  notifier.StartPeriodic(1.0);
+
+  llvm::outs() << "Wait...\n";
+  Wait(10.5);
+  llvm::outs() << "...Wait\n";
+
+  EXPECT_EQ(10u, notifierCounter)
+      << "Received " << notifierCounter << " notifications in 10.5 seconds";
+  llvm::outs() << "Received " << notifierCounter
+               << " notifications in 10.5 seconds";
+
+  llvm::outs() << "...NotifierTest\n";
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PCMTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PCMTest.cpp
new file mode 100644
index 0000000..d53a743
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PCMTest.cpp
@@ -0,0 +1,241 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "AnalogInput.h"
+#include "Compressor.h"
+#include "DigitalInput.h"
+#include "DigitalOutput.h"
+#include "DoubleSolenoid.h"
+#include "Solenoid.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+/* The PCM switches the compressor up to a couple seconds after the pressure
+        switch changes. */
+static const double kCompressorDelayTime = 3.0;
+
+/* Solenoids should change much more quickly */
+static const double kSolenoidDelayTime = 0.5;
+
+/* The voltage divider on the test bench should bring the compressor output
+        to around these values. */
+static const double kCompressorOnVoltage = 5.00;
+static const double kCompressorOffVoltage = 1.68;
+
+class PCMTest : public testing::Test {
+ protected:
+  Compressor* m_compressor;
+
+  DigitalOutput* m_fakePressureSwitch;
+  AnalogInput* m_fakeCompressor;
+  DoubleSolenoid* m_doubleSolenoid;
+  DigitalInput *m_fakeSolenoid1, *m_fakeSolenoid2;
+
+  void SetUp() override {
+    m_compressor = new Compressor();
+
+    m_fakePressureSwitch =
+        new DigitalOutput(TestBench::kFakePressureSwitchChannel);
+    m_fakeCompressor = new AnalogInput(TestBench::kFakeCompressorChannel);
+    m_fakeSolenoid1 = new DigitalInput(TestBench::kFakeSolenoid1Channel);
+    m_fakeSolenoid2 = new DigitalInput(TestBench::kFakeSolenoid2Channel);
+  }
+
+  void TearDown() override {
+    delete m_compressor;
+    delete m_fakePressureSwitch;
+    delete m_fakeCompressor;
+    delete m_fakeSolenoid1;
+    delete m_fakeSolenoid2;
+  }
+
+  void Reset() {
+    m_compressor->Stop();
+    m_fakePressureSwitch->Set(false);
+  }
+};
+
+/**
+ * Test if the compressor turns on and off when the pressure switch is toggled
+ */
+TEST_F(PCMTest, PressureSwitch) {
+  Reset();
+
+  m_compressor->SetClosedLoopControl(true);
+
+  // Turn on the compressor
+  m_fakePressureSwitch->Set(true);
+  Wait(kCompressorDelayTime);
+  EXPECT_NEAR(kCompressorOnVoltage, m_fakeCompressor->GetVoltage(), 0.5)
+      << "Compressor did not turn on when the pressure switch turned on.";
+
+  // Turn off the compressor
+  m_fakePressureSwitch->Set(false);
+  Wait(kCompressorDelayTime);
+  EXPECT_NEAR(kCompressorOffVoltage, m_fakeCompressor->GetVoltage(), 0.5)
+      << "Compressor did not turn off when the pressure switch turned off.";
+}
+
+/**
+ * Test if the correct solenoids turn on and off when they should
+ */
+TEST_F(PCMTest, Solenoid) {
+  Reset();
+  Solenoid solenoid1(TestBench::kSolenoidChannel1);
+  Solenoid solenoid2(TestBench::kSolenoidChannel2);
+
+  // Turn both solenoids off
+  solenoid1.Set(false);
+  solenoid2.Set(false);
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+
+  // Turn one solenoid on and one off
+  solenoid1.Set(true);
+  solenoid2.Set(false);
+  Wait(kSolenoidDelayTime);
+  EXPECT_FALSE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn on";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_TRUE(solenoid1.Get()) << "Solenoid #1 did not read on";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+
+  // Turn one solenoid on and one off
+  solenoid1.Set(false);
+  solenoid2.Set(true);
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_TRUE(solenoid2.Get()) << "Solenoid #2 did not read on";
+
+  // Turn both on
+  solenoid1.Set(true);
+  solenoid2.Set(true);
+  Wait(kSolenoidDelayTime);
+  EXPECT_FALSE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn on";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_TRUE(solenoid1.Get()) << "Solenoid #1 did not read on";
+  EXPECT_TRUE(solenoid2.Get()) << "Solenoid #2 did not read on";
+}
+
+/**
+ * Test if the correct solenoids turn on and off when they should when used
+ * with the DoubleSolenoid class.
+ */
+TEST_F(PCMTest, DoubleSolenoid) {
+  DoubleSolenoid solenoid(TestBench::kSolenoidChannel1,
+                          TestBench::kSolenoidChannel2);
+
+  solenoid.Set(DoubleSolenoid::kOff);
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_TRUE(solenoid.Get() == DoubleSolenoid::kOff)
+      << "Solenoid does not read off";
+
+  solenoid.Set(DoubleSolenoid::kForward);
+  Wait(kSolenoidDelayTime);
+  EXPECT_FALSE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn on";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_TRUE(solenoid.Get() == DoubleSolenoid::kForward)
+      << "Solenoid does not read forward";
+
+  solenoid.Set(DoubleSolenoid::kReverse);
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_TRUE(solenoid.Get() == DoubleSolenoid::kReverse)
+      << "Solenoid does not read reverse";
+}
+
+TEST_F(PCMTest, OneShot) {
+  Reset();
+  Solenoid solenoid1(TestBench::kSolenoidChannel1);
+  Solenoid solenoid2(TestBench::kSolenoidChannel2);
+
+  // Turn both solenoids off
+  solenoid1.Set(false);
+  solenoid2.Set(false);
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+
+  // Pulse Solenoid #1 on, and turn Solenoid #2 off
+  solenoid1.SetPulseDuration(2 * kSolenoidDelayTime);
+  solenoid2.Set(false);
+  solenoid1.StartPulse();
+  Wait(kSolenoidDelayTime);
+  EXPECT_FALSE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn on";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_TRUE(solenoid1.Get()) << "Solenoid #1 did not read on";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+  Wait(2 * kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+
+  // Turn Solenoid #1 off, and pulse Solenoid #2 on
+  solenoid1.Set(false);
+  solenoid2.SetPulseDuration(2 * kSolenoidDelayTime);
+  solenoid2.StartPulse();
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_TRUE(solenoid2.Get()) << "Solenoid #2 did not read on";
+  Wait(2 * kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+
+  // Pulse both Solenoids on
+  solenoid1.SetPulseDuration(2 * kSolenoidDelayTime);
+  solenoid2.SetPulseDuration(2 * kSolenoidDelayTime);
+  solenoid1.StartPulse();
+  solenoid2.StartPulse();
+  Wait(kSolenoidDelayTime);
+  EXPECT_FALSE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn on";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_TRUE(solenoid1.Get()) << "Solenoid #1 did not read on";
+  EXPECT_TRUE(solenoid2.Get()) << "Solenoid #2 did not read on";
+  Wait(2 * kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+
+  // Pulse both Solenoids on with different durations
+  solenoid1.SetPulseDuration(1.5 * kSolenoidDelayTime);
+  solenoid2.SetPulseDuration(2.5 * kSolenoidDelayTime);
+  solenoid1.StartPulse();
+  solenoid2.StartPulse();
+  Wait(kSolenoidDelayTime);
+  EXPECT_FALSE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn on";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_TRUE(solenoid1.Get()) << "Solenoid #1 did not read on";
+  EXPECT_TRUE(solenoid2.Get()) << "Solenoid #2 did not read on";
+  Wait(kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_FALSE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn on";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_TRUE(solenoid2.Get()) << "Solenoid #2 did not read on";
+  Wait(2 * kSolenoidDelayTime);
+  EXPECT_TRUE(m_fakeSolenoid1->Get()) << "Solenoid #1 did not turn off";
+  EXPECT_TRUE(m_fakeSolenoid2->Get()) << "Solenoid #2 did not turn off";
+  EXPECT_FALSE(solenoid1.Get()) << "Solenoid #1 did not read off";
+  EXPECT_FALSE(solenoid2.Get()) << "Solenoid #2 did not read off";
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PIDToleranceTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PIDToleranceTest.cpp
new file mode 100644
index 0000000..0c267e7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PIDToleranceTest.cpp
@@ -0,0 +1,107 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PIDController.h"
+#include "PIDOutput.h"
+#include "PIDSource.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+class PIDToleranceTest : public testing::Test {
+ protected:
+  const double setpoint = 50.0;
+  const double range = 200;
+  const double tolerance = 10.0;
+
+  class FakeInput : public PIDSource {
+   public:
+    double val = 0;
+
+    void SetPIDSourceType(PIDSourceType pidSource) {}
+
+    PIDSourceType GetPIDSourceType() { return PIDSourceType::kDisplacement; }
+
+    double PIDGet() { return val; }
+  };
+
+  class FakeOutput : public PIDOutput {
+    void PIDWrite(double output) {}
+  };
+
+  FakeInput inp;
+  FakeOutput out;
+  PIDController* pid;
+
+  void SetUp() override {
+    pid = new PIDController(0.5, 0.0, 0.0, &inp, &out);
+    pid->SetInputRange(-range / 2, range / 2);
+  }
+
+  void TearDown() override { delete pid; }
+
+  void Reset() { inp.val = 0; }
+};
+
+TEST_F(PIDToleranceTest, Absolute) {
+  Reset();
+
+  pid->SetAbsoluteTolerance(tolerance);
+  pid->SetSetpoint(setpoint);
+  pid->Enable();
+
+  EXPECT_FALSE(pid->OnTarget())
+      << "Error was in tolerance when it should not have been. Error was "
+      << pid->GetError();
+
+  inp.val = setpoint + tolerance / 2;
+  Wait(1.0);
+
+  EXPECT_TRUE(pid->OnTarget())
+      << "Error was not in tolerance when it should have been. Error was "
+      << pid->GetError();
+
+  inp.val = setpoint + 10 * tolerance;
+  Wait(1.0);
+
+  EXPECT_FALSE(pid->OnTarget())
+      << "Error was in tolerance when it should not have been. Error was "
+      << pid->GetError();
+}
+
+TEST_F(PIDToleranceTest, Percent) {
+  Reset();
+
+  pid->SetPercentTolerance(tolerance);
+  pid->SetSetpoint(setpoint);
+  pid->Enable();
+
+  EXPECT_FALSE(pid->OnTarget())
+      << "Error was in tolerance when it should not have been. Error was "
+      << pid->GetError();
+
+  inp.val =
+      setpoint + (tolerance) / 200 *
+                     range;  // half of percent tolerance away from setpoint
+  Wait(1.0);
+
+  EXPECT_TRUE(pid->OnTarget())
+      << "Error was not in tolerance when it should have been. Error was "
+      << pid->GetError();
+
+  inp.val =
+      setpoint +
+      (tolerance) / 50 * range;  // double percent tolerance away from setPoint
+
+  Wait(1.0);
+
+  EXPECT_FALSE(pid->OnTarget())
+      << "Error was in tolerance when it should not have been. Error was "
+      << pid->GetError();
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PowerDistributionPanelTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PowerDistributionPanelTest.cpp
new file mode 100644
index 0000000..32534e2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PowerDistributionPanelTest.cpp
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "PowerDistributionPanel.h"  // NOLINT(build/include_order)
+
+#include "Jaguar.h"
+#include "Talon.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "Victor.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kMotorTime = 0.25;
+
+class PowerDistributionPanelTest : public testing::Test {
+ protected:
+  PowerDistributionPanel* m_pdp;
+  Talon* m_talon;
+  Victor* m_victor;
+  Jaguar* m_jaguar;
+
+  void SetUp() override {
+    m_pdp = new PowerDistributionPanel();
+    m_talon = new Talon(TestBench::kTalonChannel);
+    m_victor = new Victor(TestBench::kVictorChannel);
+    m_jaguar = new Jaguar(TestBench::kJaguarChannel);
+  }
+
+  void TearDown() override {
+    delete m_pdp;
+    delete m_talon;
+    delete m_victor;
+    delete m_jaguar;
+  }
+};
+
+/**
+ * Test if the current changes when the motor is driven using a talon
+ */
+TEST_F(PowerDistributionPanelTest, CheckCurrentTalon) {
+  Wait(kMotorTime);
+
+  /* The Current should be 0 */
+  EXPECT_FLOAT_EQ(0, m_pdp->GetCurrent(TestBench::kTalonPDPChannel))
+      << "The Talon current was non-zero";
+
+  /* Set the motor to full forward */
+  m_talon->Set(1.0);
+  Wait(kMotorTime);
+
+  /* The current should now be positive */
+  ASSERT_GT(m_pdp->GetCurrent(TestBench::kTalonPDPChannel), 0)
+      << "The Talon current was not positive";
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PreferencesTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PreferencesTest.cpp
new file mode 100644
index 0000000..b523371
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/PreferencesTest.cpp
@@ -0,0 +1,107 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Preferences.h"  // NOLINT(build/include_order)
+
+#include <cstdio>
+#include <fstream>
+
+#include <networktables/NetworkTableInstance.h>
+
+#include "Timer.h"
+#include "gtest/gtest.h"
+#include "ntcore.h"
+
+using namespace frc;
+
+static const char* kFileName = "networktables.ini";
+static const double kSaveTime = 1.2;
+
+/**
+ * If we write a new networktables.ini with some sample values, test that
+ * we get those same values back using the Preference class.
+ */
+TEST(PreferencesTest, ReadPreferencesFromFile) {
+  auto inst = nt::NetworkTableInstance::GetDefault();
+  inst.StopServer();
+  std::remove(kFileName);
+  std::ofstream preferencesFile(kFileName);
+  preferencesFile << "[NetworkTables Storage 3.0]" << std::endl;
+  preferencesFile
+      << "string \"/Preferences/testFileGetString\"=\"Hello, preferences file\""
+      << std::endl;
+  preferencesFile << "double \"/Preferences/testFileGetInt\"=1" << std::endl;
+  preferencesFile << "double \"/Preferences/testFileGetDouble\"=0.5"
+                  << std::endl;
+  preferencesFile << "double \"/Preferences/testFileGetFloat\"=0.25"
+                  << std::endl;
+  preferencesFile << "boolean \"/Preferences/testFileGetBoolean\"=true"
+                  << std::endl;
+  preferencesFile
+      << "double \"/Preferences/testFileGetLong\"=1000000000000000000"
+      << std::endl;
+  preferencesFile.close();
+  inst.StartServer();
+
+  Preferences* preferences = Preferences::GetInstance();
+  EXPECT_EQ("Hello, preferences file",
+            preferences->GetString("testFileGetString"));
+  EXPECT_EQ(1, preferences->GetInt("testFileGetInt"));
+  EXPECT_FLOAT_EQ(0.5, preferences->GetDouble("testFileGetDouble"));
+  EXPECT_FLOAT_EQ(0.25f, preferences->GetFloat("testFileGetFloat"));
+  EXPECT_TRUE(preferences->GetBoolean("testFileGetBoolean"));
+  EXPECT_EQ(1000000000000000000ll, preferences->GetLong("testFileGetLong"));
+}
+
+/**
+ * If we set some values using the Preferences class, test that they show up
+ * in networktables.ini
+ */
+TEST(PreferencesTest, WritePreferencesToFile) {
+  auto inst = nt::NetworkTableInstance::GetDefault();
+  inst.StartServer();
+  Preferences* preferences = Preferences::GetInstance();
+  preferences->Remove("testFileGetString");
+  preferences->Remove("testFileGetInt");
+  preferences->Remove("testFileGetDouble");
+  preferences->Remove("testFileGetFloat");
+  preferences->Remove("testFileGetBoolean");
+  preferences->Remove("testFileGetLong");
+
+  Wait(kSaveTime);
+
+  preferences->PutString("testFilePutString", "Hello, preferences file");
+  preferences->PutInt("testFilePutInt", 1);
+  preferences->PutDouble("testFilePutDouble", 0.5);
+  preferences->PutFloat("testFilePutFloat", 0.25f);
+  preferences->PutBoolean("testFilePutBoolean", true);
+  preferences->PutLong("testFilePutLong", 1000000000000000000ll);
+
+  Wait(kSaveTime);
+
+  static char const* kExpectedFileContents[] = {
+      "[NetworkTables Storage 3.0]",
+      "string \"/Preferences/.type\"=\"RobotPreferences\"",
+      "boolean \"/Preferences/testFilePutBoolean\"=true",
+      "double \"/Preferences/testFilePutDouble\"=0.5",
+      "double \"/Preferences/testFilePutFloat\"=0.25",
+      "double \"/Preferences/testFilePutInt\"=1",
+      "double \"/Preferences/testFilePutLong\"=1e+18",
+      "string \"/Preferences/testFilePutString\"=\"Hello, preferences file\""};
+
+  std::ifstream preferencesFile(kFileName);
+  for (auto& kExpectedFileContent : kExpectedFileContents) {
+    ASSERT_FALSE(preferencesFile.eof())
+        << "Preferences file prematurely reached EOF";
+
+    std::string line;
+    std::getline(preferencesFile, line);
+
+    ASSERT_EQ(kExpectedFileContent, line)
+        << "A line in networktables.ini was not correct";
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/RelayTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/RelayTest.cpp
new file mode 100644
index 0000000..cedf502
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/RelayTest.cpp
@@ -0,0 +1,93 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Relay.h"  // NOLINT(build/include_order)
+
+#include "DigitalInput.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kDelayTime = 0.01;
+
+class RelayTest : public testing::Test {
+ protected:
+  Relay* m_relay;
+  DigitalInput* m_forward;
+  DigitalInput* m_reverse;
+
+  void SetUp() override {
+    m_relay = new Relay(TestBench::kRelayChannel);
+    m_forward = new DigitalInput(TestBench::kFakeRelayForward);
+    m_reverse = new DigitalInput(TestBench::kFakeRelayReverse);
+  }
+
+  void TearDown() override {
+    delete m_relay;
+    delete m_forward;
+    delete m_reverse;
+  }
+
+  void Reset() { m_relay->Set(Relay::kOff); }
+};
+
+/**
+ * Test the relay by setting it forward, reverse, off, and on.
+ */
+TEST_F(RelayTest, Relay) {
+  Reset();
+
+  // set the relay to forward
+  m_relay->Set(Relay::kForward);
+  Wait(kDelayTime);
+  EXPECT_TRUE(m_forward->Get()) << "Relay did not set forward";
+  EXPECT_FALSE(m_reverse->Get()) << "Relay did not set forward";
+  EXPECT_EQ(m_relay->Get(), Relay::kForward);
+
+  // set the relay to reverse
+  m_relay->Set(Relay::kReverse);
+  Wait(kDelayTime);
+  EXPECT_TRUE(m_reverse->Get()) << "Relay did not set reverse";
+  EXPECT_FALSE(m_forward->Get()) << "Relay did not set reverse";
+  EXPECT_EQ(m_relay->Get(), Relay::kReverse);
+
+  // set the relay to off
+  m_relay->Set(Relay::kOff);
+  Wait(kDelayTime);
+  EXPECT_FALSE(m_forward->Get()) << "Relay did not set off";
+  EXPECT_FALSE(m_reverse->Get()) << "Relay did not set off";
+  EXPECT_EQ(m_relay->Get(), Relay::kOff);
+
+  // set the relay to on
+  m_relay->Set(Relay::kOn);
+  Wait(kDelayTime);
+  EXPECT_TRUE(m_forward->Get()) << "Relay did not set on";
+  EXPECT_TRUE(m_reverse->Get()) << "Relay did not set on";
+  EXPECT_EQ(m_relay->Get(), Relay::kOn);
+
+  // test forward direction
+  delete m_relay;
+  m_relay = new Relay(TestBench::kRelayChannel, Relay::kForwardOnly);
+
+  m_relay->Set(Relay::kOn);
+  Wait(kDelayTime);
+  EXPECT_TRUE(m_forward->Get()) << "Relay did not set forward";
+  EXPECT_FALSE(m_reverse->Get()) << "Relay did not set forward";
+  EXPECT_EQ(m_relay->Get(), Relay::kOn);
+
+  // test reverse direction
+  delete m_relay;
+  m_relay = new Relay(TestBench::kRelayChannel, Relay::kReverseOnly);
+
+  m_relay->Set(Relay::kOn);
+  Wait(kDelayTime);
+  EXPECT_FALSE(m_forward->Get()) << "Relay did not set reverse";
+  EXPECT_TRUE(m_reverse->Get()) << "Relay did not set reverse";
+  EXPECT_EQ(m_relay->Get(), Relay::kOn);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/RobotDriveTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/RobotDriveTest.cpp
new file mode 100644
index 0000000..69fea17
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/RobotDriveTest.cpp
@@ -0,0 +1,191 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Drive/DifferentialDrive.h"
+#include "Drive/MecanumDrive.h"
+#include "MockSpeedController.h"
+#include "RobotDrive.h"
+#include "TestBench.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+class RobotDriveTest : public testing::Test {
+ protected:
+  MockSpeedController m_rdFrontLeft;
+  MockSpeedController m_rdRearLeft;
+  MockSpeedController m_rdFrontRight;
+  MockSpeedController m_rdRearRight;
+  MockSpeedController m_frontLeft;
+  MockSpeedController m_rearLeft;
+  MockSpeedController m_frontRight;
+  MockSpeedController m_rearRight;
+  frc::RobotDrive m_robotDrive{m_rdFrontLeft, m_rdRearLeft, m_rdFrontRight,
+                               m_rdRearRight};
+  frc::DifferentialDrive m_differentialDrive{m_frontLeft, m_frontRight};
+  frc::MecanumDrive m_mecanumDrive{m_frontLeft, m_rearLeft, m_frontRight,
+                                   m_rearRight};
+
+  double m_testJoystickValues[9] = {-1.0, -0.9, -0.5, -0.01, 0.0,
+                                    0.01, 0.5,  0.9,  1.0};
+  double m_testGyroValues[19] = {0,    45,   90,   135,  180, 225,  270,
+                                 305,  360,  540,  -45,  -90, -135, -180,
+                                 -225, -270, -305, -360, -540};
+};
+
+TEST_F(RobotDriveTest, TankDrive) {
+  int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
+  double leftJoystick, rightJoystick;
+  m_differentialDrive.SetDeadband(0.0);
+  m_differentialDrive.SetSafetyEnabled(false);
+  m_mecanumDrive.SetSafetyEnabled(false);
+  m_robotDrive.SetSafetyEnabled(false);
+  for (int i = 0; i < joystickSize; i++) {
+    for (int j = 0; j < joystickSize; j++) {
+      leftJoystick = m_testJoystickValues[i];
+      rightJoystick = m_testJoystickValues[j];
+      m_robotDrive.TankDrive(leftJoystick, rightJoystick, false);
+      m_differentialDrive.TankDrive(leftJoystick, rightJoystick, false);
+      ASSERT_NEAR(m_rdFrontLeft.Get(), m_frontLeft.Get(), 0.01);
+      ASSERT_NEAR(m_rdFrontRight.Get(), m_frontRight.Get(), 0.01);
+    }
+  }
+}
+
+TEST_F(RobotDriveTest, TankDriveSquared) {
+  int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
+  double leftJoystick, rightJoystick;
+  m_differentialDrive.SetDeadband(0.0);
+  m_differentialDrive.SetSafetyEnabled(false);
+  m_mecanumDrive.SetSafetyEnabled(false);
+  m_robotDrive.SetSafetyEnabled(false);
+  for (int i = 0; i < joystickSize; i++) {
+    for (int j = 0; j < joystickSize; j++) {
+      leftJoystick = m_testJoystickValues[i];
+      rightJoystick = m_testJoystickValues[j];
+      m_robotDrive.TankDrive(leftJoystick, rightJoystick, true);
+      m_differentialDrive.TankDrive(leftJoystick, rightJoystick, true);
+      ASSERT_NEAR(m_rdFrontLeft.Get(), m_frontLeft.Get(), 0.01);
+      ASSERT_NEAR(m_rdFrontRight.Get(), m_frontRight.Get(), 0.01);
+    }
+  }
+}
+
+TEST_F(RobotDriveTest, ArcadeDriveSquared) {
+  int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
+  double moveJoystick, rotateJoystick;
+  m_differentialDrive.SetDeadband(0.0);
+  m_differentialDrive.SetSafetyEnabled(false);
+  m_mecanumDrive.SetSafetyEnabled(false);
+  m_robotDrive.SetSafetyEnabled(false);
+  for (int i = 0; i < joystickSize; i++) {
+    for (int j = 0; j < joystickSize; j++) {
+      moveJoystick = m_testJoystickValues[i];
+      rotateJoystick = m_testJoystickValues[j];
+      m_robotDrive.ArcadeDrive(moveJoystick, rotateJoystick, true);
+      m_differentialDrive.ArcadeDrive(moveJoystick, -rotateJoystick, true);
+      ASSERT_NEAR(m_rdFrontLeft.Get(), m_frontLeft.Get(), 0.01);
+      ASSERT_NEAR(m_rdFrontRight.Get(), m_frontRight.Get(), 0.01);
+    }
+  }
+}
+
+TEST_F(RobotDriveTest, ArcadeDrive) {
+  int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
+  double moveJoystick, rotateJoystick;
+  m_differentialDrive.SetDeadband(0.0);
+  m_differentialDrive.SetSafetyEnabled(false);
+  m_mecanumDrive.SetSafetyEnabled(false);
+  m_robotDrive.SetSafetyEnabled(false);
+  for (int i = 0; i < joystickSize; i++) {
+    for (int j = 0; j < joystickSize; j++) {
+      moveJoystick = m_testJoystickValues[i];
+      rotateJoystick = m_testJoystickValues[j];
+      m_robotDrive.ArcadeDrive(moveJoystick, rotateJoystick, false);
+      m_differentialDrive.ArcadeDrive(moveJoystick, -rotateJoystick, false);
+      ASSERT_NEAR(m_rdFrontLeft.Get(), m_frontLeft.Get(), 0.01);
+      ASSERT_NEAR(m_rdFrontRight.Get(), m_frontRight.Get(), 0.01);
+    }
+  }
+}
+
+TEST_F(RobotDriveTest, MecanumCartesian) {
+  int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
+  int gyroSize = sizeof(m_testGyroValues) / sizeof(double);
+  double xJoystick, yJoystick, rotateJoystick, gyroValue;
+  m_mecanumDrive.SetDeadband(0.0);
+  m_mecanumDrive.SetSafetyEnabled(false);
+  m_differentialDrive.SetSafetyEnabled(false);
+  m_robotDrive.SetSafetyEnabled(false);
+  for (int i = 0; i < joystickSize; i++) {
+    for (int j = 0; j < joystickSize; j++) {
+      for (int k = 0; k < joystickSize; k++) {
+        for (int l = 0; l < gyroSize; l++) {
+          xJoystick = m_testJoystickValues[i];
+          yJoystick = m_testJoystickValues[j];
+          rotateJoystick = m_testJoystickValues[k];
+          gyroValue = m_testGyroValues[l];
+          m_robotDrive.MecanumDrive_Cartesian(xJoystick, yJoystick,
+                                              rotateJoystick, gyroValue);
+          m_mecanumDrive.DriveCartesian(xJoystick, -yJoystick, rotateJoystick,
+                                        -gyroValue);
+          ASSERT_NEAR(m_rdFrontLeft.Get(), m_frontLeft.Get(), 0.01)
+              << "X: " << xJoystick << " Y: " << yJoystick
+              << " Rotate: " << rotateJoystick << " Gyro: " << gyroValue;
+          ASSERT_NEAR(m_rdFrontRight.Get(), -m_frontRight.Get(), 0.01)
+              << "X: " << xJoystick << " Y: " << yJoystick
+              << " Rotate: " << rotateJoystick << " Gyro: " << gyroValue;
+          ASSERT_NEAR(m_rdRearLeft.Get(), m_rearLeft.Get(), 0.01)
+              << "X: " << xJoystick << " Y: " << yJoystick
+              << " Rotate: " << rotateJoystick << " Gyro: " << gyroValue;
+          ASSERT_NEAR(m_rdRearRight.Get(), -m_rearRight.Get(), 0.01)
+              << "X: " << xJoystick << " Y: " << yJoystick
+              << " Rotate: " << rotateJoystick << " Gyro: " << gyroValue;
+        }
+      }
+    }
+  }
+}
+
+TEST_F(RobotDriveTest, MecanumPolar) {
+  int joystickSize = sizeof(m_testJoystickValues) / sizeof(double);
+  int gyroSize = sizeof(m_testGyroValues) / sizeof(double);
+  double magnitudeJoystick, directionJoystick, rotateJoystick;
+  m_mecanumDrive.SetDeadband(0.0);
+  m_mecanumDrive.SetSafetyEnabled(false);
+  m_differentialDrive.SetSafetyEnabled(false);
+  m_robotDrive.SetSafetyEnabled(false);
+  for (int i = 0; i < joystickSize; i++) {
+    for (int j = 0; j < gyroSize; j++) {
+      for (int k = 0; k < joystickSize; k++) {
+        magnitudeJoystick = m_testJoystickValues[i];
+        directionJoystick = m_testGyroValues[j];
+        rotateJoystick = m_testJoystickValues[k];
+        m_robotDrive.MecanumDrive_Polar(magnitudeJoystick, directionJoystick,
+                                        rotateJoystick);
+        m_mecanumDrive.DrivePolar(magnitudeJoystick, directionJoystick,
+                                  rotateJoystick);
+        ASSERT_NEAR(m_rdFrontLeft.Get(), m_frontLeft.Get(), 0.01)
+            << "Magnitude: " << magnitudeJoystick
+            << " Direction: " << directionJoystick
+            << " Rotate: " << rotateJoystick;
+        ASSERT_NEAR(m_rdFrontRight.Get(), -m_frontRight.Get(), 0.01)
+            << "Magnitude: " << magnitudeJoystick
+            << " Direction: " << directionJoystick
+            << " Rotate: " << rotateJoystick;
+        ASSERT_NEAR(m_rdRearLeft.Get(), m_rearLeft.Get(), 0.01)
+            << "Magnitude: " << magnitudeJoystick
+            << " Direction: " << directionJoystick
+            << " Rotate: " << rotateJoystick;
+        ASSERT_NEAR(m_rdRearRight.Get(), -m_rearRight.Get(), 0.01)
+            << "Magnitude: " << magnitudeJoystick
+            << " Direction: " << directionJoystick
+            << " Rotate: " << rotateJoystick;
+      }
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/SpeedControllerGroupTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/SpeedControllerGroupTest.cpp
new file mode 100644
index 0000000..933bef3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/SpeedControllerGroupTest.cpp
@@ -0,0 +1,137 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SpeedControllerGroup.h"  // NOLINT(build/include_order)
+
+#include <memory>
+#include <vector>
+
+#include "MockSpeedController.h"
+#include "TestBench.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+enum SpeedControllerGroupTestType { TEST_ONE, TEST_TWO, TEST_THREE };
+
+std::ostream& operator<<(std::ostream& os,
+                         const SpeedControllerGroupTestType& type) {
+  switch (type) {
+    case TEST_ONE:
+      os << "SpeedControllerGroup with one speed controller";
+      break;
+    case TEST_TWO:
+      os << "SpeedControllerGroup with two speed controllers";
+      break;
+    case TEST_THREE:
+      os << "SpeedControllerGroup with three speed controllers";
+      break;
+  }
+
+  return os;
+}
+
+/**
+ * A fixture used for SpeedControllerGroup testing.
+ */
+class SpeedControllerGroupTest
+    : public testing::TestWithParam<SpeedControllerGroupTestType> {
+ protected:
+  std::vector<MockSpeedController> m_speedControllers;
+  std::unique_ptr<SpeedControllerGroup> m_group;
+
+  void SetUp() override {
+    switch (GetParam()) {
+      case TEST_ONE: {
+        m_speedControllers.emplace_back();
+        m_group = std::make_unique<SpeedControllerGroup>(m_speedControllers[0]);
+        break;
+      }
+
+      case TEST_TWO: {
+        m_speedControllers.emplace_back();
+        m_speedControllers.emplace_back();
+        m_group = std::make_unique<SpeedControllerGroup>(m_speedControllers[0],
+                                                         m_speedControllers[1]);
+        break;
+      }
+
+      case TEST_THREE: {
+        m_speedControllers.emplace_back();
+        m_speedControllers.emplace_back();
+        m_speedControllers.emplace_back();
+        m_group = std::make_unique<SpeedControllerGroup>(m_speedControllers[0],
+                                                         m_speedControllers[1],
+                                                         m_speedControllers[2]);
+        break;
+      }
+    }
+  }
+};
+
+TEST_P(SpeedControllerGroupTest, Set) {
+  m_group->Set(1.0);
+
+  for (auto& speedController : m_speedControllers) {
+    EXPECT_FLOAT_EQ(speedController.Get(), 1.0);
+  }
+}
+
+TEST_P(SpeedControllerGroupTest, GetInverted) {
+  m_group->SetInverted(true);
+
+  EXPECT_TRUE(m_group->GetInverted());
+}
+
+TEST_P(SpeedControllerGroupTest, SetInvertedDoesNotModifySpeedControllers) {
+  for (auto& speedController : m_speedControllers) {
+    speedController.SetInverted(false);
+  }
+  m_group->SetInverted(true);
+
+  for (auto& speedController : m_speedControllers) {
+    EXPECT_EQ(speedController.GetInverted(), false);
+  }
+}
+
+TEST_P(SpeedControllerGroupTest, SetInvertedDoesInvert) {
+  m_group->SetInverted(true);
+  m_group->Set(1.0);
+
+  for (auto& speedController : m_speedControllers) {
+    EXPECT_FLOAT_EQ(speedController.Get(), -1.0);
+  }
+}
+
+TEST_P(SpeedControllerGroupTest, Disable) {
+  m_group->Set(1.0);
+  m_group->Disable();
+
+  for (auto& speedController : m_speedControllers) {
+    EXPECT_FLOAT_EQ(speedController.Get(), 0.0);
+  }
+}
+
+TEST_P(SpeedControllerGroupTest, StopMotor) {
+  m_group->Set(1.0);
+  m_group->StopMotor();
+
+  for (auto& speedController : m_speedControllers) {
+    EXPECT_FLOAT_EQ(speedController.Get(), 0.0);
+  }
+}
+
+TEST_P(SpeedControllerGroupTest, PIDWrite) {
+  m_group->PIDWrite(1.0);
+
+  for (auto& speedController : m_speedControllers) {
+    EXPECT_FLOAT_EQ(speedController.Get(), 1.0);
+  }
+}
+
+INSTANTIATE_TEST_CASE_P(Test, SpeedControllerGroupTest,
+                        testing::Values(TEST_ONE, TEST_TWO, TEST_THREE));
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TestEnvironment.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TestEnvironment.cpp
new file mode 100644
index 0000000..dd5b368
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TestEnvironment.cpp
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cstdlib>
+
+#include <HAL/HAL.h>
+#include <llvm/raw_ostream.h>
+
+#include "DriverStation.h"
+#include "LiveWindow/LiveWindow.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+#include "mockds/MockDS.h"
+
+using namespace frc;
+
+class TestEnvironment : public testing::Environment {
+  bool m_alreadySetUp = false;
+  MockDS m_mockDS;
+
+ public:
+  void SetUp() override {
+    /* Only set up once.  This allows gtest_repeat to be used to
+            automatically repeat tests. */
+    if (m_alreadySetUp) return;
+    m_alreadySetUp = true;
+
+    if (!HAL_Initialize(500, 0)) {
+      llvm::errs() << "FATAL ERROR: HAL could not be initialized\n";
+      std::exit(-1);
+    }
+
+    m_mockDS.start();
+
+    /* This sets up the network communications library to enable the driver
+            station. After starting network coms, it will loop until the driver
+            station returns that the robot is enabled, to ensure that tests
+            will be able to run on the hardware. */
+    HAL_ObserveUserProgramStarting();
+    LiveWindow::GetInstance()->SetEnabled(false);
+
+    llvm::outs() << "Started coms\n";
+
+    int enableCounter = 0;
+    while (!DriverStation::GetInstance().IsEnabled()) {
+      if (enableCounter > 50) {
+        // Robot did not enable properly after 5 seconds.
+        // Force exit
+        llvm::errs() << " Failed to enable. Aborting\n";
+        std::terminate();
+      }
+
+      Wait(0.1);
+
+      llvm::outs() << "Waiting for enable: " << enableCounter++ << "\n";
+    }
+  }
+
+  void TearDown() override { m_mockDS.stop(); }
+};
+
+testing::Environment* const environment =
+    testing::AddGlobalTestEnvironment(new TestEnvironment);
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TiltPanCameraTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TiltPanCameraTest.cpp
new file mode 100644
index 0000000..3e4967a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TiltPanCameraTest.cpp
@@ -0,0 +1,172 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cmath>
+
+#include "ADXL345_SPI.h"
+#include "AnalogGyro.h"
+#include "Servo.h"
+#include "TestBench.h"
+#include "Timer.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static constexpr double kServoResetTime = 2.0;
+
+static constexpr double kTestAngle = 90.0;
+
+static constexpr double kTiltSetpoint0 = 0.22;
+static constexpr double kTiltSetpoint45 = 0.45;
+static constexpr double kTiltSetpoint90 = 0.68;
+static constexpr double kTiltTime = 1.0;
+static constexpr double kAccelerometerTolerance = 0.2;
+static constexpr double kSensitivity = 0.013;
+
+/**
+ * A fixture for the camera with two servos and a gyro
+ */
+class TiltPanCameraTest : public testing::Test {
+ protected:
+  static AnalogGyro* m_gyro;
+  Servo *m_tilt, *m_pan;
+  Accelerometer* m_spiAccel;
+
+  static void SetUpTestCase() {
+    // The gyro object blocks for 5 seconds in the constructor, so only
+    // construct it once for the whole test case
+    m_gyro = new AnalogGyro(TestBench::kCameraGyroChannel);
+    m_gyro->SetSensitivity(kSensitivity);
+  }
+
+  static void TearDownTestCase() { delete m_gyro; }
+
+  void SetUp() override {
+    m_tilt = new Servo(TestBench::kCameraTiltChannel);
+    m_pan = new Servo(TestBench::kCameraPanChannel);
+    m_spiAccel = new ADXL345_SPI(SPI::kOnboardCS1);
+
+    m_tilt->Set(kTiltSetpoint45);
+    m_pan->SetAngle(0.0);
+
+    Wait(kServoResetTime);
+
+    m_gyro->Reset();
+  }
+
+  void DefaultGyroAngle();
+  void GyroAngle();
+  void GyroCalibratedParameters();
+
+  void TearDown() override {
+    delete m_tilt;
+    delete m_pan;
+    delete m_spiAccel;
+  }
+};
+
+AnalogGyro* TiltPanCameraTest::m_gyro = nullptr;
+
+/**
+ * Test if the gyro angle defaults to 0 immediately after being reset.
+ */
+void TiltPanCameraTest::DefaultGyroAngle() {
+  EXPECT_NEAR(0.0, m_gyro->GetAngle(), 1.0);
+}
+
+/**
+ * Test if the servo turns 90 degrees and the gyroscope measures this angle
+ * Note servo on TestBench is not the same type of servo that servo class
+ * was designed for so setAngle is significantly off. This has been calibrated
+ * for the servo on the rig.
+ */
+void TiltPanCameraTest::GyroAngle() {
+  // Make sure that the gyro doesn't get jerked when the servo goes to zero.
+  m_pan->SetAngle(0.0);
+  Wait(0.5);
+  m_gyro->Reset();
+
+  for (int32_t i = 0; i < 600; i++) {
+    m_pan->Set(i / 1000.0);
+    Wait(0.001);
+  }
+
+  double gyroAngle = m_gyro->GetAngle();
+
+  EXPECT_NEAR(gyroAngle, kTestAngle, 10.0)
+      << "Gyro measured " << gyroAngle << " degrees, servo should have turned "
+      << kTestAngle << " degrees";
+}
+
+/**
+ * Gets calibrated parameters from previously calibrated gyro, allocates a new
+ * gyro with the given parameters for center and offset, and re-runs tests on
+ * the new gyro.
+ */
+void TiltPanCameraTest::GyroCalibratedParameters() {
+  uint32_t cCenter = m_gyro->GetCenter();
+  double cOffset = m_gyro->GetOffset();
+  delete m_gyro;
+  m_gyro = new AnalogGyro(TestBench::kCameraGyroChannel, cCenter, cOffset);
+  m_gyro->SetSensitivity(kSensitivity);
+
+  // Default gyro angle test
+  // Accumulator needs a small amount of time to reset before being tested
+  m_gyro->Reset();
+  Wait(0.001);
+  EXPECT_NEAR(0.0, m_gyro->GetAngle(), 1.0);
+
+  // Gyro angle test
+  // Make sure that the gyro doesn't get jerked when the servo goes to zero.
+  m_pan->SetAngle(0.0);
+  Wait(0.5);
+  m_gyro->Reset();
+
+  for (int32_t i = 0; i < 600; i++) {
+    m_pan->Set(i / 1000.0);
+    Wait(0.001);
+  }
+
+  double gyroAngle = m_gyro->GetAngle();
+
+  EXPECT_NEAR(gyroAngle, kTestAngle, 10.0)
+      << "Gyro measured " << gyroAngle << " degrees, servo should have turned "
+      << kTestAngle << " degrees";
+}
+
+/**
+ * Run all gyro tests in one function to make sure they are run in order.
+ */
+TEST_F(TiltPanCameraTest, TestAllGyroTests) {
+  DefaultGyroAngle();
+  GyroAngle();
+  GyroCalibratedParameters();
+}
+
+/**
+ * Test if the accelerometer measures gravity along the correct axes when the
+ * camera rotates
+ */
+TEST_F(TiltPanCameraTest, SPIAccelerometer) {
+  m_tilt->Set(kTiltSetpoint0);
+  Wait(kTiltTime);
+  EXPECT_NEAR(-1.0, m_spiAccel->GetX(), kAccelerometerTolerance);
+  EXPECT_NEAR(0.0, m_spiAccel->GetY(), kAccelerometerTolerance);
+  EXPECT_NEAR(0.0, m_spiAccel->GetZ(), kAccelerometerTolerance);
+
+  m_tilt->Set(kTiltSetpoint45);
+  Wait(kTiltTime);
+  EXPECT_NEAR(-std::sqrt(0.5), m_spiAccel->GetX(), kAccelerometerTolerance);
+  EXPECT_NEAR(0.0, m_spiAccel->GetY(), kAccelerometerTolerance);
+  EXPECT_NEAR(std::sqrt(0.5), m_spiAccel->GetZ(), kAccelerometerTolerance);
+
+  m_tilt->Set(kTiltSetpoint90);
+  Wait(kTiltTime);
+  EXPECT_NEAR(0.0, m_spiAccel->GetX(), kAccelerometerTolerance);
+  EXPECT_NEAR(0.0, m_spiAccel->GetY(), kAccelerometerTolerance);
+  EXPECT_NEAR(1.0, m_spiAccel->GetZ(), kAccelerometerTolerance);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TimerTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TimerTest.cpp
new file mode 100644
index 0000000..7c54957
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/TimerTest.cpp
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Timer.h"  // NOLINT(build/include_order)
+
+#include "TestBench.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+static const double kWaitTime = 0.5;
+
+class TimerTest : public testing::Test {
+ protected:
+  Timer* m_timer;
+
+  void SetUp() override { m_timer = new Timer; }
+
+  void TearDown() override { delete m_timer; }
+
+  void Reset() { m_timer->Reset(); }
+};
+
+/**
+ * Test if the Wait function works
+ */
+TEST_F(TimerTest, Wait) {
+  Reset();
+
+  double initialTime = m_timer->GetFPGATimestamp();
+
+  Wait(kWaitTime);
+
+  double finalTime = m_timer->GetFPGATimestamp();
+
+  EXPECT_NEAR(kWaitTime, finalTime - initialTime, 0.001);
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/CommandTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/CommandTest.cpp
new file mode 100644
index 0000000..ac08c17
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/CommandTest.cpp
@@ -0,0 +1,444 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Commands/CommandGroup.h"
+#include "Commands/Scheduler.h"
+#include "Commands/Subsystem.h"
+#include "DriverStation.h"
+#include "RobotState.h"
+#include "Timer.h"
+#include "command/MockCommand.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+class CommandTest : public testing::Test {
+ protected:
+  void SetUp() override {
+    RobotState::SetImplementation(DriverStation::GetInstance());
+    Scheduler::GetInstance()->SetEnabled(true);
+  }
+
+  /**
+   * Tears Down the Scheduler at the end of each test.
+   * Must be called at the end of each test inside each test in order to prevent
+   * them being deallocated
+   * when they leave the scope of the test (causing a segfault).
+   * This can not be done within the virtual void Teardown() method because it
+   * is called outside of the
+   * scope of the test.
+   */
+  void TeardownScheduler() { Scheduler::GetInstance()->ResetAll(); }
+
+  void AssertCommandState(MockCommand& command, int32_t initialize,
+                          int32_t execute, int32_t isFinished, int32_t end,
+                          int32_t interrupted) {
+    EXPECT_EQ(initialize, command.GetInitializeCount());
+    EXPECT_EQ(execute, command.GetExecuteCount());
+    EXPECT_EQ(isFinished, command.GetIsFinishedCount());
+    EXPECT_EQ(end, command.GetEndCount());
+    EXPECT_EQ(interrupted, command.GetInterruptedCount());
+  }
+};
+
+class ASubsystem : public Subsystem {
+ private:
+  Command* m_command = nullptr;
+
+ public:
+  explicit ASubsystem(const std::string& name) : Subsystem(name) {}
+
+  void InitDefaultCommand() override {
+    if (m_command != nullptr) {
+      SetDefaultCommand(m_command);
+    }
+  }
+
+  void Init(Command* command) { m_command = command; }
+};
+
+// CommandParallelGroupTest ported from CommandParallelGroupTest.java
+TEST_F(CommandTest, ParallelCommands) {
+  MockCommand command1;
+  MockCommand command2;
+  CommandGroup commandGroup;
+
+  commandGroup.AddParallel(&command1);
+  commandGroup.AddParallel(&command2);
+
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  commandGroup.Start();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 0);
+  AssertCommandState(command2, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 2, 2, 0, 0);
+  AssertCommandState(command2, 1, 2, 2, 0, 0);
+  command1.SetHasFinished(true);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 3, 3, 1, 0);
+  AssertCommandState(command2, 1, 3, 3, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 3, 3, 1, 0);
+  AssertCommandState(command2, 1, 4, 4, 0, 0);
+  command2.SetHasFinished(true);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 3, 3, 1, 0);
+  AssertCommandState(command2, 1, 5, 5, 1, 0);
+
+  TeardownScheduler();
+}
+// END CommandParallelGroupTest
+
+// CommandScheduleTest ported from CommandScheduleTest.java
+TEST_F(CommandTest, RunAndTerminate) {
+  MockCommand command;
+  command.Start();
+  AssertCommandState(command, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 2, 2, 0, 0);
+  command.SetHasFinished(true);
+  AssertCommandState(command, 1, 2, 2, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 3, 3, 1, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 3, 3, 1, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(CommandTest, RunAndCancel) {
+  MockCommand command;
+  command.Start();
+  AssertCommandState(command, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 2, 2, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 3, 3, 0, 0);
+  command.Cancel();
+  AssertCommandState(command, 1, 3, 3, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 3, 3, 0, 1);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 3, 3, 0, 1);
+
+  TeardownScheduler();
+}
+// END CommandScheduleTest
+
+// CommandSequentialGroupTest ported from CommandSequentialGroupTest.java
+TEST_F(CommandTest, ThreeCommandOnSubSystem) {
+  ASubsystem subsystem("Three Command Test Subsystem");
+  MockCommand command1;
+  command1.Requires(&subsystem);
+  MockCommand command2;
+  command2.Requires(&subsystem);
+  MockCommand command3;
+  command3.Requires(&subsystem);
+
+  CommandGroup commandGroup;
+  commandGroup.AddSequential(&command1, 1.0);
+  commandGroup.AddSequential(&command2, 2.0);
+  commandGroup.AddSequential(&command3);
+
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  AssertCommandState(command3, 0, 0, 0, 0, 0);
+
+  commandGroup.Start();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  AssertCommandState(command3, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  AssertCommandState(command3, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+  AssertCommandState(command3, 0, 0, 0, 0, 0);
+  Wait(1);  // command 1 timeout
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 1, 1, 0, 0);
+  AssertCommandState(command3, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 0);
+  AssertCommandState(command3, 0, 0, 0, 0, 0);
+  Wait(2);  // command 2 timeout
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 1);
+  AssertCommandState(command3, 1, 1, 1, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 1);
+  AssertCommandState(command3, 1, 2, 2, 0, 0);
+  command3.SetHasFinished(true);
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 1);
+  AssertCommandState(command3, 1, 2, 2, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 1);
+  AssertCommandState(command3, 1, 3, 3, 1, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 1);
+  AssertCommandState(command3, 1, 3, 3, 1, 0);
+
+  TeardownScheduler();
+}
+// END CommandSequentialGroupTest
+
+// CommandSequentialGroupTest ported from CommandSequentialGroupTest.java
+TEST_F(CommandTest, OneCommandSupersedingAnotherBecauseOfDependencies) {
+  auto subsystem = new ASubsystem("Command Superseding Test Subsystem");
+  MockCommand command1;
+  command1.Requires(subsystem);
+  MockCommand command2;
+  command2.Requires(subsystem);
+
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  command1.Start();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 2, 2, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 3, 3, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  command2.Start();
+  AssertCommandState(command1, 1, 3, 3, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 4, 4, 0, 1);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 4, 4, 0, 1);
+  AssertCommandState(command2, 1, 1, 1, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 4, 4, 0, 1);
+  AssertCommandState(command2, 1, 2, 2, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 4, 4, 0, 1);
+  AssertCommandState(command2, 1, 3, 3, 0, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(CommandTest,
+       OneCommandFailingSupersedingBecauseFirstCanNotBeInterrupted) {
+  ASubsystem subsystem("Command Superseding Test Subsystem");
+  MockCommand command1;
+
+  command1.Requires(&subsystem);
+
+  command1.SetInterruptible(false);
+  MockCommand command2;
+  command2.Requires(&subsystem);
+
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  command1.Start();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 0, 0, 0, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 1, 1, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 2, 2, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 3, 3, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  command2.Start();
+  AssertCommandState(command1, 1, 3, 3, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command1, 1, 4, 4, 0, 0);
+  AssertCommandState(command2, 0, 0, 0, 0, 0);
+
+  TeardownScheduler();
+}
+
+// END CommandSequentialGroupTest
+
+class ModifiedMockCommand : public MockCommand {
+ public:
+  ModifiedMockCommand() : MockCommand() { SetTimeout(2.0); }
+  bool IsFinished() override {
+    return MockCommand::IsFinished() || IsTimedOut();
+  }
+};
+
+TEST_F(CommandTest, TwoSecondTimeout) {
+  ASubsystem subsystem("Two Second Timeout Test Subsystem");
+  ModifiedMockCommand command;
+  command.Requires(&subsystem);
+
+  command.Start();
+  AssertCommandState(command, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 2, 2, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 3, 3, 0, 0);
+  Wait(2);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 4, 4, 1, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(command, 1, 4, 4, 1, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(CommandTest, DefaultCommandWhereTheInteruptingCommandEndsItself) {
+  ASubsystem subsystem("Default Command Test Subsystem");
+  MockCommand defaultCommand;
+  defaultCommand.Requires(&subsystem);
+  MockCommand anotherCommand;
+  anotherCommand.Requires(&subsystem);
+
+  AssertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+  subsystem.Init(&defaultCommand);
+
+  AssertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+
+  anotherCommand.Start();
+  AssertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+  AssertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+  anotherCommand.SetHasFinished(true);
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 3, 3, 1, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 2, 4, 4, 0, 1);
+  AssertCommandState(anotherCommand, 1, 3, 3, 1, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 2, 5, 5, 0, 1);
+  AssertCommandState(anotherCommand, 1, 3, 3, 1, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(CommandTest, DefaultCommandsInterruptingCommandCanceled) {
+  ASubsystem subsystem("Default Command Test Subsystem");
+  MockCommand defaultCommand;
+  defaultCommand.Requires(&subsystem);
+  MockCommand anotherCommand;
+  anotherCommand.Requires(&subsystem);
+
+  AssertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+  subsystem.Init(&defaultCommand);
+  subsystem.InitDefaultCommand();
+  AssertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+
+  anotherCommand.Start();
+  AssertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+  AssertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 1, 1, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+  anotherCommand.Cancel();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 1);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 2, 4, 4, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 1);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(defaultCommand, 2, 5, 5, 0, 1);
+  AssertCommandState(anotherCommand, 1, 2, 2, 0, 1);
+
+  TeardownScheduler();
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/ConditionalCommandTest.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/ConditionalCommandTest.cpp
new file mode 100644
index 0000000..d289bc1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/ConditionalCommandTest.cpp
@@ -0,0 +1,437 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <DriverStation.h>
+#include <RobotState.h>
+
+#include "Commands/ConditionalCommand.h"
+#include "Commands/Scheduler.h"
+#include "Commands/Subsystem.h"
+#include "command/MockCommand.h"
+#include "command/MockConditionalCommand.h"
+#include "gtest/gtest.h"
+
+using namespace frc;
+
+class ConditionalCommandTest : public testing::Test {
+ public:
+  MockConditionalCommand* m_command;
+  MockCommand* m_onTrue;
+  MockCommand* m_onFalse;
+  MockConditionalCommand* m_commandNull;
+  Subsystem* m_subsystem;
+
+ protected:
+  void SetUp() override {
+    RobotState::SetImplementation(DriverStation::GetInstance());
+    Scheduler::GetInstance()->SetEnabled(true);
+
+    m_subsystem = new Subsystem("MockSubsystem");
+    m_onTrue = new MockCommand(m_subsystem);
+    m_onFalse = new MockCommand(m_subsystem);
+    m_command = new MockConditionalCommand(m_onTrue, m_onFalse);
+    m_commandNull = new MockConditionalCommand(m_onTrue, nullptr);
+  }
+
+  void TearDown() override { delete m_command; }
+
+  /**
+   * Tears Down the Scheduler at the end of each test.
+   *
+   * Must be called at the end of each test inside each test in order to prevent
+   * them being deallocated when they leave the scope of the test (causing a
+   * segfault). This cannot be done within the virtual void Teardown() method
+   * because it is called outside of the scope of the test.
+   */
+  void TeardownScheduler() { Scheduler::GetInstance()->ResetAll(); }
+
+  void AssertCommandState(MockCommand& command, int32_t initialize,
+                          int32_t execute, int32_t isFinished, int32_t end,
+                          int32_t interrupted) {
+    EXPECT_EQ(initialize, command.GetInitializeCount());
+    EXPECT_EQ(execute, command.GetExecuteCount());
+    EXPECT_EQ(isFinished, command.GetIsFinishedCount());
+    EXPECT_EQ(end, command.GetEndCount());
+    EXPECT_EQ(interrupted, command.GetInterruptedCount());
+  }
+
+  void AssertConditionalCommandState(MockConditionalCommand& command,
+                                     int32_t initialize, int32_t execute,
+                                     int32_t isFinished, int32_t end,
+                                     int32_t interrupted) {
+    EXPECT_EQ(initialize, command.GetInitializeCount());
+    EXPECT_EQ(execute, command.GetExecuteCount());
+    EXPECT_EQ(isFinished, command.GetIsFinishedCount());
+    EXPECT_EQ(end, command.GetEndCount());
+    EXPECT_EQ(interrupted, command.GetInterruptedCount());
+  }
+};
+
+TEST_F(ConditionalCommandTest, OnTrueTest) {
+  m_command->SetCondition(true);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("6");
+  m_onTrue->SetHasFinished(true);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+  SCOPED_TRACE("7");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+
+  EXPECT_TRUE(m_onTrue->GetInitializeCount() > 0)
+      << "Did not initialize the true command\n";
+  EXPECT_TRUE(m_onFalse->GetInitializeCount() == 0)
+      << "Initialized the false command\n";
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, OnFalseTest) {
+  m_command->SetCondition(false);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onFalse, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onFalse, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("6");
+  m_onFalse->SetHasFinished(true);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onFalse, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+  SCOPED_TRACE("7");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onFalse, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+
+  EXPECT_TRUE(m_onFalse->GetInitializeCount() > 0)
+      << "Did not initialize the false command";
+  EXPECT_TRUE(m_onTrue->GetInitializeCount() == 0)
+      << "Initialized the true command";
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, CancelSubCommandTest) {
+  m_command->SetCondition(true);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("6");
+  m_onTrue->Cancel();
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 1);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+  SCOPED_TRACE("7");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 1);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, CancelCondCommandTest) {
+  m_command->SetCondition(true);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("6");
+  m_command->Cancel();
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 1);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 1);
+  SCOPED_TRACE("7");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 1);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 1);
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, OnTrueTwiceTest) {
+  m_command->SetCondition(true);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("6");
+  m_onTrue->SetHasFinished(true);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+  SCOPED_TRACE("7");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+
+  m_onTrue->ResetCounters();
+  m_command->ResetCounters();
+  Scheduler::GetInstance()->AddCommand(m_command);
+
+  SCOPED_TRACE("11");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("12");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("13");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("14");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("15");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("16");
+  m_onTrue->SetHasFinished(true);
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+  SCOPED_TRACE("17");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 1, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, OnTrueInstantTest) {
+  m_command->SetCondition(true);
+  m_onTrue->SetHasFinished(true);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 1, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 1, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 1, 0);
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, CancelRequiresTest) {
+  m_command->SetCondition(true);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_command);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 1, 1, 0, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 1, 1, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 2, 2, 0, 0);
+  SCOPED_TRACE("5");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 2, 2, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 3, 3, 0, 0);
+  SCOPED_TRACE("6");
+  m_onFalse->Start();
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 0, 0);
+  AssertCommandState(*m_onFalse, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 0, 1);
+  SCOPED_TRACE("7");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 1, 3, 3, 0, 1);
+  AssertCommandState(*m_onFalse, 1, 1, 1, 0, 0);
+  AssertConditionalCommandState(*m_command, 1, 4, 4, 0, 1);
+
+  TeardownScheduler();
+}
+
+TEST_F(ConditionalCommandTest, OnFalseNullTest) {
+  m_command->SetCondition(false);
+
+  SCOPED_TRACE("1");
+  Scheduler::GetInstance()->AddCommand(m_commandNull);
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_commandNull, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("2");
+  Scheduler::GetInstance()->Run();  // init command and select m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_commandNull, 0, 0, 0, 0, 0);
+  SCOPED_TRACE("3");
+  Scheduler::GetInstance()->Run();  // init m_onTrue
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_commandNull, 1, 1, 1, 1, 0);
+  SCOPED_TRACE("4");
+  Scheduler::GetInstance()->Run();
+  AssertCommandState(*m_onTrue, 0, 0, 0, 0, 0);
+  AssertConditionalCommandState(*m_commandNull, 1, 1, 1, 1, 0);
+
+  TeardownScheduler();
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/MockCommand.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/MockCommand.cpp
new file mode 100644
index 0000000..bcaed0b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/MockCommand.cpp
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "command/MockCommand.h"
+
+using namespace frc;
+
+MockCommand::MockCommand(Subsystem* subsys) : MockCommand() {
+  Requires(subsys);
+}
+
+MockCommand::MockCommand() {
+  m_initializeCount = 0;
+  m_executeCount = 0;
+  m_isFinishedCount = 0;
+  m_hasFinished = false;
+  m_endCount = 0;
+  m_interruptedCount = 0;
+}
+
+bool MockCommand::HasInitialized() { return GetInitializeCount() > 0; }
+
+bool MockCommand::HasEnd() { return GetEndCount() > 0; }
+
+bool MockCommand::HasInterrupted() { return GetInterruptedCount() > 0; }
+
+void MockCommand::Initialize() { ++m_initializeCount; }
+
+void MockCommand::Execute() { ++m_executeCount; }
+
+bool MockCommand::IsFinished() {
+  ++m_isFinishedCount;
+  return IsHasFinished();
+}
+
+void MockCommand::End() { ++m_endCount; }
+
+void MockCommand::Interrupted() { ++m_interruptedCount; }
+
+void MockCommand::ResetCounters() {
+  m_initializeCount = 0;
+  m_executeCount = 0;
+  m_isFinishedCount = 0;
+  m_hasFinished = false;
+  m_endCount = 0;
+  m_interruptedCount = 0;
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/MockConditionalCommand.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/MockConditionalCommand.cpp
new file mode 100644
index 0000000..9434131
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/command/MockConditionalCommand.cpp
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "command/MockConditionalCommand.h"
+
+using namespace frc;
+
+MockConditionalCommand::MockConditionalCommand(MockCommand* onTrue,
+                                               MockCommand* onFalse)
+    : ConditionalCommand(onTrue, onFalse) {
+  m_initializeCount = 0;
+  m_executeCount = 0;
+  m_isFinishedCount = 0;
+  m_endCount = 0;
+  m_interruptedCount = 0;
+}
+
+void MockConditionalCommand::SetCondition(bool condition) {
+  m_condition = condition;
+}
+
+bool MockConditionalCommand::Condition() { return m_condition; }
+
+bool MockConditionalCommand::HasInitialized() {
+  return GetInitializeCount() > 0;
+}
+
+bool MockConditionalCommand::HasEnd() { return GetEndCount() > 0; }
+
+bool MockConditionalCommand::HasInterrupted() {
+  return GetInterruptedCount() > 0;
+}
+
+void MockConditionalCommand::Initialize() { ++m_initializeCount; }
+
+void MockConditionalCommand::Execute() { ++m_executeCount; }
+
+bool MockConditionalCommand::IsFinished() {
+  ++m_isFinishedCount;
+  return ConditionalCommand::IsFinished();
+}
+
+void MockConditionalCommand::End() { ++m_endCount; }
+
+void MockConditionalCommand::Interrupted() { ++m_interruptedCount; }
+
+void MockConditionalCommand::ResetCounters() {
+  m_initializeCount = 0;
+  m_executeCount = 0;
+  m_isFinishedCount = 0;
+  m_endCount = 0;
+  m_interruptedCount = 0;
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/mockds/MockDS.cpp b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/mockds/MockDS.cpp
new file mode 100644
index 0000000..fa30743
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/mockds/MockDS.cpp
@@ -0,0 +1,90 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "MockDS.h"
+
+#include <stdint.h>
+
+#include <HAL/cpp/fpga_clock.h>
+#include <llvm/SmallString.h>
+#include <llvm/SmallVector.h>
+#include <llvm/raw_ostream.h>
+#include <support/Logger.h>
+
+#include "udpsockets/UDPClient.h"
+
+static void LoggerFunc(unsigned int level, const char* file, unsigned int line,
+                       const char* msg) {
+  llvm::SmallString<128> buf;
+  llvm::raw_svector_ostream oss(buf);
+  if (level == 20) {
+    oss << "DS: " << msg << '\n';
+    llvm::errs() << oss.str();
+    return;
+  }
+
+  llvm::StringRef levelmsg;
+  if (level >= 50)
+    levelmsg = "CRITICAL: ";
+  else if (level >= 40)
+    levelmsg = "ERROR: ";
+  else if (level >= 30)
+    levelmsg = "WARNING: ";
+  else
+    return;
+  oss << "DS: " << levelmsg << msg << " (" << file << ':' << line << ")\n";
+  llvm::errs() << oss.str();
+}
+
+static void generateEnabledDsPacket(llvm::SmallVectorImpl<uint8_t>& data,
+                                    uint16_t sendCount) {
+  data.clear();
+  data.push_back(sendCount >> 8);
+  data.push_back(sendCount);
+  data.push_back(0x01);  // general data tag
+  data.push_back(0x04);  // teleop enabled
+  data.push_back(0x10);  // normal data request
+  data.push_back(0x00);  // red 1 station
+}
+
+using namespace frc;
+
+void MockDS::start() {
+  if (m_active) return;
+  m_active = true;
+  m_thread = std::thread([&]() {
+    wpi::Logger logger(LoggerFunc);
+    wpi::UDPClient client(logger);
+    client.start();
+    auto timeout_time = hal::fpga_clock::now();
+    int initCount = 0;
+    uint16_t sendCount = 0;
+    llvm::SmallVector<uint8_t, 8> data;
+    while (m_active) {
+      // Keep 20ms intervals, and increase time to next interval
+      auto current = hal::fpga_clock::now();
+      while (timeout_time <= current) {
+        timeout_time += std::chrono::milliseconds(20);
+      }
+      std::this_thread::sleep_until(timeout_time);
+      generateEnabledDsPacket(data, sendCount++);
+      // ~10 disabled packets are required to make the robot actually enable
+      // 1 is definitely not enough.
+      if (initCount < 10) {
+        initCount++;
+        data[3] = 0;
+      }
+      client.send(data, "127.0.0.1", 1110);
+    }
+    client.shutdown();
+  });
+}
+
+void MockDS::stop() {
+  m_active = false;
+  if (m_thread.joinable()) m_thread.join();
+}
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/mockds/MockDS.h b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/mockds/MockDS.h
new file mode 100644
index 0000000..99b17b1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/cpp/mockds/MockDS.h
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <atomic>
+#include <thread>
+
+namespace frc {
+class MockDS {
+ public:
+  MockDS() = default;
+  ~MockDS() { stop(); }
+  MockDS(const MockDS& other) = delete;
+  MockDS& operator=(const MockDS& other) = delete;
+
+  void start();
+  void stop();
+
+ private:
+  std::thread m_thread;
+  std::atomic_bool m_active{false};
+};
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/MockSpeedController.h b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/MockSpeedController.h
new file mode 100644
index 0000000..e40a346
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/MockSpeedController.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "SpeedController.h"
+
+namespace frc {
+
+class MockSpeedController : public SpeedController {
+ public:
+  void Set(double speed) override;
+  double Get() const override;
+  void SetInverted(bool isInverted) override;
+  bool GetInverted() const override;
+  void Disable() override;
+  void StopMotor() override;
+
+  void PIDWrite(double output) override;
+
+ private:
+  double m_speed = 0.0;
+  bool m_isInverted = false;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/TestBench.h b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/TestBench.h
new file mode 100644
index 0000000..cc04f6b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/TestBench.h
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <stdint.h>
+
+class TestBench {
+ public:
+  /* Analog input channels */
+  static const uint32_t kCameraGyroChannel = 0;
+  static const uint32_t kFakeCompressorChannel = 1;
+  static const uint32_t kFakeAnalogOutputChannel = 2;
+
+  /* Analog output channels */
+  static const uint32_t kAnalogOutputChannel = 0;
+
+  /* DIO channels */
+  static const uint32_t kTalonEncoderChannelA = 0;
+  static const uint32_t kTalonEncoderChannelB = 1;
+  static const uint32_t kVictorEncoderChannelA = 2;
+  static const uint32_t kVictorEncoderChannelB = 3;
+  static const uint32_t kJaguarEncoderChannelA = 4;
+  static const uint32_t kJaguarEncoderChannelB = 5;
+  static const uint32_t kLoop1OutputChannel = 6;
+  static const uint32_t kLoop1InputChannel = 7;
+  static const uint32_t kLoop2OutputChannel = 8;
+  static const uint32_t kLoop2InputChannel = 9;
+
+  /* PWM channels */
+  static const uint32_t kVictorChannel = 1;
+  static const uint32_t kJaguarChannel = 2;
+  static const uint32_t kCameraPanChannel = 8;
+  static const uint32_t kCameraTiltChannel = 9;
+
+  /* MXP digital channels */
+  static const uint32_t kTalonChannel = 10;
+  static const uint32_t kFakePressureSwitchChannel = 11;
+  static const uint32_t kFakeSolenoid1Channel = 12;
+  static const uint32_t kFakeSolenoid2Channel = 13;
+  static const uint32_t kFakeRelayForward = 18;
+  static const uint32_t kFakeRelayReverse = 19;
+
+  /* Relay channels */
+  static const uint32_t kRelayChannel = 0;
+
+  /* PDP channels */
+  static const uint32_t kJaguarPDPChannel = 6;
+  static const uint32_t kVictorPDPChannel = 8;
+  static const uint32_t kTalonPDPChannel = 10;
+
+  /* PCM channels */
+  static const int32_t kSolenoidChannel1 = 0;
+  static const int32_t kSolenoidChannel2 = 1;
+
+  /* Filter constants */
+  static constexpr double kFilterStep = 0.005;
+  static constexpr double kFilterTime = 2.0;
+  static constexpr double kSinglePoleIIRTimeConstant = 0.015915;
+  static constexpr double kSinglePoleIIRExpectedOutput = -3.2172003;
+  static constexpr double kHighPassTimeConstant = 0.006631;
+  static constexpr double kHighPassExpectedOutput = 10.074717;
+  static constexpr int32_t kMovAvgTaps = 6;
+  static constexpr double kMovAvgExpectedOutput = -10.191644;
+};
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/command/MockCommand.h b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/command/MockCommand.h
new file mode 100644
index 0000000..0353c81
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/command/MockCommand.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Commands/Command.h"
+
+namespace frc {
+
+class MockCommand : public Command {
+ public:
+  explicit MockCommand(Subsystem*);
+  MockCommand();
+  int32_t GetInitializeCount() { return m_initializeCount; }
+  bool HasInitialized();
+
+  int32_t GetExecuteCount() { return m_executeCount; }
+  int32_t GetIsFinishedCount() { return m_isFinishedCount; }
+  bool IsHasFinished() { return m_hasFinished; }
+  void SetHasFinished(bool hasFinished) { m_hasFinished = hasFinished; }
+  int32_t GetEndCount() { return m_endCount; }
+  bool HasEnd();
+
+  int32_t GetInterruptedCount() { return m_interruptedCount; }
+  bool HasInterrupted();
+  void ResetCounters();
+
+ protected:
+  void Initialize() override;
+  void Execute() override;
+  bool IsFinished() override;
+  void End() override;
+  void Interrupted() override;
+
+ private:
+  int32_t m_initializeCount;
+  int32_t m_executeCount;
+  int32_t m_isFinishedCount;
+  bool m_hasFinished;
+  int32_t m_endCount;
+  int32_t m_interruptedCount;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/command/MockConditionalCommand.h b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/command/MockConditionalCommand.h
new file mode 100644
index 0000000..66fad03
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibcIntegrationTests/src/FRCUserProgram/headers/command/MockConditionalCommand.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include "Commands/ConditionalCommand.h"
+#include "command/MockCommand.h"
+
+namespace frc {
+
+class MockConditionalCommand : public ConditionalCommand {
+ public:
+  MockConditionalCommand(MockCommand* onTrue, MockCommand* onFalse);
+  void SetCondition(bool condition);
+  int32_t GetInitializeCount() { return m_initializeCount; }
+  bool HasInitialized();
+
+  int32_t GetExecuteCount() { return m_executeCount; }
+  int32_t GetIsFinishedCount() { return m_isFinishedCount; }
+  int32_t GetEndCount() { return m_endCount; }
+  bool HasEnd();
+
+  int32_t GetInterruptedCount() { return m_interruptedCount; }
+  bool HasInterrupted();
+  void ResetCounters();
+
+ protected:
+  bool Condition() override;
+  void Initialize() override;
+  void Execute() override;
+  bool IsFinished() override;
+  void End() override;
+  void Interrupted() override;
+
+ private:
+  bool m_condition = false;
+  int32_t m_initializeCount;
+  int32_t m_executeCount;
+  int32_t m_isFinishedCount;
+  int32_t m_endCount;
+  int32_t m_interruptedCount;
+};
+
+}  // namespace frc
diff --git a/third_party/allwpilib_2018/wpilibj/build.gradle b/third_party/allwpilib_2018/wpilibj/build.gradle
new file mode 100644
index 0000000..080eb92
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/build.gradle
@@ -0,0 +1,320 @@
+import edu.wpi.first.nativeutils.NativeUtils
+import org.gradle.api.file.FileCollection
+import org.gradle.internal.os.OperatingSystem
+
+repositories {
+    mavenCentral()
+}
+
+apply plugin: 'cpp'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'java'
+apply plugin: 'net.ltgt.errorprone'
+apply plugin: 'pmd'
+apply plugin: TestingModelBasePlugin
+
+configurations.errorprone {
+    resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.9'
+}
+
+apply from: '../config.gradle'
+
+sourceSets {
+    dev
+}
+
+task nativeTestFilesJar(type: Jar) {
+    destinationDir = project.buildDir
+    classifier = "nativeTestFiles"
+
+    project.model {
+        binaries {
+            withType(SharedLibraryBinarySpec) { binary ->
+                if (binary.component.name == 'wpilibJNIStatic') {
+                    from(binary.sharedLibraryFile) {
+                        into NativeUtils.getPlatformPath(binary)
+                    }
+                    dependsOn binary.buildTask
+                }
+            }
+        }
+    }
+}
+
+task run(type: JavaExec) {
+    classpath = sourceSets.dev.runtimeClasspath
+
+    main = 'edu.wpi.first.wpilibj.DevMain'
+}
+
+test.dependsOn nativeTestFilesJar
+run.dependsOn nativeTestFilesJar
+
+def versionClass = """
+package edu.wpi.first.wpilibj.util;
+
+/*
+ * Autogenerated file! Do not manually edit this file. This version is regenerated
+ * any time the publish task is run, or when this file is deleted.
+ */
+
+public final class WPILibVersion {
+  public static final String Version = "${WPILibVersion.version}";
+}
+""".trim()
+
+def wpilibVersionFile = file('src/main/java/edu/wpi/first/wpilibj/util/WPILibVersion.java')
+
+def willPublish = false
+gradle.taskGraph.addTaskExecutionGraphListener { graph ->
+    willPublish = graph.hasTask(publish)
+}
+
+task generateJavaVersion() {
+    description = 'Generates the wpilib version class.'
+    group = 'WPILib'
+
+    // We follow a simple set of checks to determine whether we should generate a new version file:
+    // 1. If the release type is not development, we generate a new verison file
+    // 2. If there is no generated version number, we generate a new version file
+    // 3. If there is a generated build number, and the release type is development, then we will
+    //    only generate if the publish task is run.
+    doLast {
+        if (!WPILibVersion.releaseType.toString().equalsIgnoreCase('official') && !willPublish && wpilibVersionFile.exists()) {
+            return
+        }
+        println "Writing version ${WPILibVersion.version} to $wpilibVersionFile"
+
+        if (wpilibVersionFile.exists()) {
+            wpilibVersionFile.delete()
+        }
+        wpilibVersionFile.write(versionClass)
+    }
+}
+
+clean {
+    delete wpilibVersionFile
+}
+
+compileJava.dependsOn generateJavaVersion
+
+pmd {
+    sourceSets = [sourceSets.main]
+    consoleOutput = true
+    reportsDir = file("$project.buildDir/reports/pmd")
+    ruleSetFiles = files(new File(rootDir, "styleguide/pmd-ruleset.xml"))
+    ruleSets = []
+}
+
+dependencies {
+    compile 'edu.wpi.first.wpiutil:wpiutil-java:3.+'
+    compile 'edu.wpi.first.ntcore:ntcore-java:4.+'
+    compile 'org.opencv:opencv-java:3.2.0'
+    compile 'edu.wpi.first.cscore:cscore-java:1.+'
+    testCompile 'org.hamcrest:hamcrest-all:1.3'
+    testCompile 'junit:junit:4.12'
+    testCompile 'com.google.guava:guava:19.0'
+    testRuntime files(project.nativeTestFilesJar.archivePath)
+    testRuntime 'edu.wpi.first.ntcore:ntcore-jni:4.+:all'
+    testRuntime 'org.opencv:opencv-jni:3.2.0:all'
+    testRuntime 'edu.wpi.first.cscore:cscore-jni:1.+:all'
+    devCompile 'edu.wpi.first.wpiutil:wpiutil-java:3.+'
+    devCompile 'edu.wpi.first.ntcore:ntcore-java:4.+'
+    devCompile 'org.opencv:opencv-java:3.2.0'
+    devCompile 'edu.wpi.first.cscore:cscore-java:1.+'
+    devCompile sourceSets.main.output
+    devRuntime files(project.nativeTestFilesJar.archivePath)
+    devRuntime 'edu.wpi.first.ntcore:ntcore-jni:4.+:all'
+    devRuntime 'org.opencv:opencv-jni:3.2.0:all'
+    devRuntime 'edu.wpi.first.cscore:cscore-jni:1.+:all'
+}
+
+def jniClasses = [
+    'edu.wpi.first.wpilibj.can.CANJNI',
+    'edu.wpi.first.wpilibj.hal.FRCNetComm',
+    'edu.wpi.first.wpilibj.hal.HAL',
+    'edu.wpi.first.wpilibj.hal.HALUtil',
+    'edu.wpi.first.wpilibj.hal.JNIWrapper',
+    'edu.wpi.first.wpilibj.hal.AccelerometerJNI',
+    'edu.wpi.first.wpilibj.hal.AnalogJNI',
+    'edu.wpi.first.wpilibj.hal.AnalogGyroJNI',
+    'edu.wpi.first.wpilibj.hal.ConstantsJNI',
+    'edu.wpi.first.wpilibj.hal.CounterJNI',
+    'edu.wpi.first.wpilibj.hal.DigitalGlitchFilterJNI',
+    'edu.wpi.first.wpilibj.hal.DIOJNI',
+    'edu.wpi.first.wpilibj.hal.EncoderJNI',
+    'edu.wpi.first.wpilibj.hal.I2CJNI',
+    'edu.wpi.first.wpilibj.hal.InterruptJNI',
+    'edu.wpi.first.wpilibj.hal.NotifierJNI',
+    'edu.wpi.first.wpilibj.hal.PortsJNI',
+    'edu.wpi.first.wpilibj.hal.PWMJNI',
+    'edu.wpi.first.wpilibj.hal.RelayJNI',
+    'edu.wpi.first.wpilibj.hal.SPIJNI',
+    'edu.wpi.first.wpilibj.hal.SolenoidJNI',
+    'edu.wpi.first.wpilibj.hal.CompressorJNI',
+    'edu.wpi.first.wpilibj.hal.PDPJNI',
+    'edu.wpi.first.wpilibj.hal.PowerJNI',
+    'edu.wpi.first.wpilibj.hal.SerialPortJNI',
+    'edu.wpi.first.wpilibj.hal.OSSerialPortJNI',
+    'edu.wpi.first.wpilibj.hal.ThreadsJNI',
+]
+
+model {
+    jniConfigs {
+        wpilibJNIShared(JNIConfig) {
+            jniDefinitionClasses = jniClasses
+            jniArmHeaderLocations = [ all: file("${projectDir}/src/arm-linux-jni") ]
+            sourceSets = [ project.sourceSets.main ]
+        }
+        wpilibJNIStatic(JNIConfig) {
+            jniDefinitionClasses = jniClasses
+            jniArmHeaderLocations = [ all: file("${projectDir}/src/arm-linux-jni") ]
+            sourceSets = [ project.sourceSets.main ]
+        }
+    }
+    exportsConfigs {
+        wpilibJNIShared(ExportsConfig) {
+            x86SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('Java_') || symbol.startsWith('JNI_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+            x64SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('Java_') || symbol.startsWith('JNI_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+        }
+        wpilibJNIStatic(ExportsConfig) {
+            x86SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('Java_') || symbol.startsWith('JNI_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+            x64SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('Java_') || symbol.startsWith('JNI_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+        }
+    }
+    dependencyConfigs {
+        wpiutil(DependencyConfig) {
+            groupId = 'edu.wpi.first.wpiutil'
+            artifactId = 'wpiutil-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '3.+'
+            sharedConfigs = [ wpilibJNIShared: [] ]
+            staticConfigs = [ wpilibJNIStatic: [] ]
+        }
+    }
+    components {
+        wpilibJNIStatic(NativeLibrarySpec) {
+            baseName = 'wpilibJNI'
+            binaries.withType(NativeBinarySpec) { binary ->
+                if (binary.targetPlatform.architecture.name == 'athena') {
+                    binary.lib project: ':hal', library: 'halAthena', linkage: 'static'
+                } else {
+                    binary.lib project: ':hal', library: 'halSim', linkage: 'static'
+                }
+            }
+            sources {
+                cpp {
+                    source {
+                        srcDirs = ['src/main/native/cpp']
+                        includes = ['**/*.cpp']
+                    }
+                }
+            }
+        }
+        wpilibJNIShared(NativeLibrarySpec) {
+            baseName = 'wpilibJNI'
+            binaries.withType(NativeBinarySpec) { binary ->
+                if (binary.targetPlatform.architecture.name == 'athena') {
+                    binary.lib project: ':hal', library: 'halAthena', linkage: 'shared'
+                } else {
+                    binary.lib project: ':hal', library: 'halSim', linkage: 'shared'
+                }
+            }
+            sources {
+                cpp {
+                    source {
+                        srcDirs = ['src/main/native/cpp']
+                        includes = ['**/*.cpp']
+                    }
+                }
+            }
+        }
+
+    }
+    binaries {
+        withType(NativeBinarySpec) {
+            project(':ni-libraries').addNiLibrariesToLinker(it)
+        }
+        withType(StaticLibraryBinarySpec) {
+            it.buildable = false
+        }
+    }
+    tasks {
+        getHeaders(Task) {
+            def list = []
+            $.components.each {
+                if (it in NativeLibrarySpec && it.name == 'wpilibJNIStatic') {
+                    it.sources.each {
+                        it.exportedHeaders.srcDirs.each {
+                            list.add(it)
+                        }
+                    }
+                    it.binaries.each {
+                        it.libs.each {
+                            it.includeRoots.each {
+                                list.add(it)
+                            }
+                        }
+                    }
+                }
+            }
+            // use file to normalize this dir
+            list.add(file("$buildDir/wpilibJNIStatic/jniinclude"))
+            list = list.unique(false)
+            doLast {
+                list.each {
+                    print "WPIHEADER: "
+                    println it
+                }
+            }
+        }
+    }
+}
+
+apply from: 'publish.gradle'
+apply from: 'integrationTestingFiles.gradle'
+
+test {
+    testLogging {
+        events "failed"
+        exceptionFormat "full"
+    }
+}
+
+if (project.hasProperty('onlyAthena')) {
+    test.enabled = false
+}
diff --git a/third_party/allwpilib_2018/wpilibj/integrationTestingFiles.gradle b/third_party/allwpilib_2018/wpilibj/integrationTestingFiles.gradle
new file mode 100644
index 0000000..175c7c9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/integrationTestingFiles.gradle
@@ -0,0 +1,21 @@
+def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles")
+
+model {
+    tasks {
+        copyWpilibJTestLibrariesToOutput(Copy) {
+            destinationDir testOutputFolder
+            $.binaries.each {
+                if (it in SharedLibraryBinarySpec && it.targetPlatform.architecture.name == 'athena') {
+                    def spec = it
+                    dependsOn spec.buildTask
+                    from(spec.sharedLibraryFile) {
+                            into '/libs'
+                    }
+                }
+            }
+            outputs.file testOutputFolder
+            outputs.upToDateWhen { false }
+        }
+        build.dependsOn copyWpilibJTestLibrariesToOutput
+    }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/publish.gradle b/third_party/allwpilib_2018/wpilibj/publish.gradle
new file mode 100644
index 0000000..aab1243
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/publish.gradle
@@ -0,0 +1,170 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseArtifactId = 'wpilibj'
+def artifactGroupId = 'edu.wpi.first.wpilibj'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibJNI'
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+
+    model {
+        tasks {
+            it.each {
+                if (it in getJNIHeadersClass()) {
+                    from (it.outputs.files) {
+                        into '/'
+                    }
+                    dependsOn it
+                }
+            }
+        }
+    }
+}
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+    classifier = 'sources'
+    from sourceSets.main.allSource
+}
+
+task javadoc(type: Javadoc, overwrite: true) {
+    javadoc.options.links("http://docs.oracle.com/javase/8/docs/api/")
+    options.addStringOption "tag", "pre:a:Pre-Condition"
+    options.addStringOption('Xdoclint:accessibility,syntax,html', '-quiet')
+    source = sourceSets.main.allJava
+    failOnError = true
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
+if (project.hasProperty('jenkinsBuild')) {
+    jar {
+        classifier = 'javaArtifact'
+    }
+}
+
+artifacts {
+    archives sourcesJar
+    archives javadocJar
+    archives cppSourcesZip
+}
+
+model {
+    publishing {
+        def wpilibJNIStaticTaskList = createComponentZipTasks($.components, 'wpilibJNIStatic', 'jni', Jar, project, { task, value ->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary)
+                        }
+                    }
+                }
+            }
+        })
+
+        def wpilibJNISharedTaskList = createComponentZipTasks($.components, 'wpilibJNIShared', 'jni', Jar, project, { task, value ->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                        task.from(new File(binary.sharedLibraryFile.absolutePath + ".debug")) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                    }
+                }
+            }
+        })
+
+        def allSharedTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allSharedTask = createAllCombined(wpilibJNISharedTaskList, 'wpilibJNIShared', 'jni', Jar, project)
+        }
+
+        def allStaticTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allStaticTask = createAllCombined(wpilibJNIStaticTaskList, 'wpilibJNIStatic', 'jni', Jar, project)
+        }
+
+        publications {
+            jniShared(MavenPublication) {
+                wpilibJNISharedTaskList.each {
+                    artifact it
+                }
+
+                 if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allSharedTask
+                }
+
+                artifact cppSourcesZip
+
+                artifactId = "${baseArtifactId}-jniShared"
+                groupId artifactGroupId
+                version pubVersion
+            }
+
+            jni(MavenPublication) {
+                wpilibJNIStaticTaskList.each {
+                    artifact it
+                }
+
+                 if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allStaticTask
+                }
+
+                artifact cppSourcesZip
+
+                artifactId = "${baseArtifactId}-jni"
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
+
+
+publishing {
+  publications {
+
+    java(MavenPublication) {
+      artifact jar
+      artifact sourcesJar
+      artifact javadocJar
+
+      artifactId = "${baseArtifactId}-java"
+      groupId artifactGroupId
+      version pubVersion
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/LICENSE b/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/LICENSE
new file mode 100644
index 0000000..b40a0f4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/LICENSE
@@ -0,0 +1,347 @@
+The GNU General Public License (GPL)
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it.  By contrast, the GNU General Public License is intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users.  This General Public License applies to
+most of the Free Software Foundation's software and to any other program whose
+authors commit to using it.  (Some other Free Software Foundation software is
+covered by the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+When we speak of free software, we are referring to freedom, not price.  Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights.  These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have.  You must
+make sure that they, too, receive or can get the source code.  And you must
+show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software.  If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.  We
+wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must be licensed for
+everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms of
+this General Public License.  The "Program", below, refers to any such program
+or work, and a "work based on the Program" means either the Program or any
+derivative work under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with modifications and/or
+translated into another language.  (Hereinafter, translation is included
+without limitation in the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification are not covered by
+this License; they are outside its scope.  The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made by
+running the Program).  Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as
+you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may
+at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus
+forming a work based on the Program, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in whole or
+    in part contains or is derived from the Program or any part thereof, to be
+    licensed as a whole at no charge to all third parties under the terms of
+    this License.
+
+    c) If the modified program normally reads commands interactively when run,
+    you must cause it, when started running for such interactive use in the
+    most ordinary way, to print or display an announcement including an
+    appropriate copyright notice and a notice that there is no warranty (or
+    else, saying that you provide a warranty) and that users may redistribute
+    the program under these conditions, and telling the user how to view a copy
+    of this License.  (Exception: if the Program itself is interactive but does
+    not normally print such an announcement, your work based on the Program is
+    not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If identifiable
+sections of that work are not derived from the Program, and can be reasonably
+considered independent and separate works in themselves, then this License, and
+its terms, do not apply to those sections when you distribute them as separate
+works.  But when you distribute the same sections as part of a whole which is a
+work based on the Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based on
+the Program.
+
+In addition, mere aggregation of another work not based on the Program with the
+Program (or with a work based on the Program) on a volume of a storage or
+distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1 and
+2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source
+    code, which must be distributed under the terms of Sections 1 and 2 above
+    on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three years, to
+    give any third party, for a charge no more than your cost of physically
+    performing source distribution, a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of Sections 1
+    and 2 above on a medium customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer to
+    distribute corresponding source code.  (This alternative is allowed only
+    for noncommercial distribution and only if you received the program in
+    object code or executable form with such an offer, in accord with
+    Subsection b above.)
+
+The source code for a work means the preferred form of the work for making
+modifications to it.  For an executable work, complete source code means all
+the source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and installation
+of the executable.  However, as a special exception, the source code
+distributed need not include anything that is normally distributed (in either
+source or binary form) with the major components (compiler, kernel, and so on)
+of the operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the source
+code from the same place counts as distribution of the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License.  Any attempt otherwise to copy, modify,
+sublicense or distribute the Program is void, and will automatically terminate
+your rights under this License.  However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the Program
+or its derivative works.  These actions are prohibited by law if you do not
+accept this License.  Therefore, by modifying or distributing the Program (or
+any work based on the Program), you indicate your acceptance of this License to
+do so, and all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program),
+the recipient automatically receives a license from the original licensor to
+copy, distribute or modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the recipients' exercise of the
+rights granted herein.  You are not responsible for enforcing compliance by
+third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License.  If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices.  Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded.  In
+such case, this License incorporates the limitation as if written in the body
+of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the
+General Public License from time to time.  Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any later
+version", you have the option of following the terms and conditions either of
+that version or of any later version published by the Free Software Foundation.
+If the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission.  For software which is copyrighted by the Free Software Foundation,
+write to the Free Software Foundation; we sometimes make exceptions for this.
+Our decision will be guided by the two goals of preserving the free status of
+all derivatives of our free software and of promoting the sharing and reuse of
+software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
+ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
+PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
+OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible
+use to the public, the best way to achieve this is to make it free software
+which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest to attach
+them to the start of each source file to most effectively convey the exclusion
+of warranty; and each file should have at least the "copyright" line and a
+pointer to where the full notice is found.
+
+    One line to give the program's name and a brief idea of what it does.
+
+    Copyright (C) <year> <name of author>
+
+    This program is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the Free
+    Software Foundation; either version 2 of the License, or (at your option)
+    any later version.
+
+    This program is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+    more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc., 59
+    Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it
+starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
+    with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free
+    software, and you are welcome to redistribute it under certain conditions;
+    type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may be
+called something other than 'show w' and 'show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.  Here
+is a sample; alter the names:
+
+    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+    'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+    signature of Ty Coon, 1 April 1989
+
+    Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General Public
+License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL
+
+Certain source files distributed by Oracle America and/or its affiliates are
+subject to the following clarification and special exception to the GPL, but
+only where Oracle has expressly included in the particular source file's header
+the words "Oracle designates this particular file as subject to the "Classpath"
+exception as provided by Oracle in the LICENSE file that accompanied this code."
+
+    Linking this library statically or dynamically with other modules is making
+    a combined work based on this library.  Thus, the terms and conditions of
+    the GNU General Public License cover the whole combination.
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,
+    and to copy and distribute the resulting executable under terms of your
+    choice, provided that you also meet, for each linked independent module,
+    the terms and conditions of the license of that module.  An independent
+    module is a module which is not derived from or based on this library.  If
+    you modify this library, you may extend this exception to your version of
+    the library, but you are not obligated to do so.  If you do not wish to do
+    so, delete this exception statement from your version.
diff --git a/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/jni.h b/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/jni.h
new file mode 100644
index 0000000..2e83cb7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/jni.h
@@ -0,0 +1,1960 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+   and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char   jboolean;
+typedef unsigned short  jchar;
+typedef short           jshort;
+typedef float           jfloat;
+typedef double          jdouble;
+
+typedef jint            jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+    jboolean z;
+    jbyte    b;
+    jchar    c;
+    jshort   s;
+    jint     i;
+    jlong    j;
+    jfloat   f;
+    jdouble  d;
+    jobject  l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+     JNIInvalidRefType    = 0,
+     JNILocalRefType      = 1,
+     JNIGlobalRefType     = 2,
+     JNIWeakGlobalRefType = 3
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK           0                 /* success */
+#define JNI_ERR          (-1)              /* unknown error */
+#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
+#define JNI_EVERSION     (-3)              /* JNI version error */
+#define JNI_ENOMEM       (-4)              /* not enough memory */
+#define JNI_EEXIST       (-5)              /* VM already created */
+#define JNI_EINVAL       (-6)              /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+    char *name;
+    char *signature;
+    void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    void *reserved3;
+    jint (JNICALL *GetVersion)(JNIEnv *env);
+
+    jclass (JNICALL *DefineClass)
+      (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+       jsize len);
+    jclass (JNICALL *FindClass)
+      (JNIEnv *env, const char *name);
+
+    jmethodID (JNICALL *FromReflectedMethod)
+      (JNIEnv *env, jobject method);
+    jfieldID (JNICALL *FromReflectedField)
+      (JNIEnv *env, jobject field);
+
+    jobject (JNICALL *ToReflectedMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+    jclass (JNICALL *GetSuperclass)
+      (JNIEnv *env, jclass sub);
+    jboolean (JNICALL *IsAssignableFrom)
+      (JNIEnv *env, jclass sub, jclass sup);
+
+    jobject (JNICALL *ToReflectedField)
+      (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+    jint (JNICALL *Throw)
+      (JNIEnv *env, jthrowable obj);
+    jint (JNICALL *ThrowNew)
+      (JNIEnv *env, jclass clazz, const char *msg);
+    jthrowable (JNICALL *ExceptionOccurred)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionDescribe)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionClear)
+      (JNIEnv *env);
+    void (JNICALL *FatalError)
+      (JNIEnv *env, const char *msg);
+
+    jint (JNICALL *PushLocalFrame)
+      (JNIEnv *env, jint capacity);
+    jobject (JNICALL *PopLocalFrame)
+      (JNIEnv *env, jobject result);
+
+    jobject (JNICALL *NewGlobalRef)
+      (JNIEnv *env, jobject lobj);
+    void (JNICALL *DeleteGlobalRef)
+      (JNIEnv *env, jobject gref);
+    void (JNICALL *DeleteLocalRef)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsSameObject)
+      (JNIEnv *env, jobject obj1, jobject obj2);
+    jobject (JNICALL *NewLocalRef)
+      (JNIEnv *env, jobject ref);
+    jint (JNICALL *EnsureLocalCapacity)
+      (JNIEnv *env, jint capacity);
+
+    jobject (JNICALL *AllocObject)
+      (JNIEnv *env, jclass clazz);
+    jobject (JNICALL *NewObject)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *NewObjectV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *NewObjectA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jclass (JNICALL *GetObjectClass)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsInstanceOf)
+      (JNIEnv *env, jobject obj, jclass clazz);
+
+    jmethodID (JNICALL *GetMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallObjectMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jobject (JNICALL *CallObjectMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallObjectMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jboolean (JNICALL *CallBooleanMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jboolean (JNICALL *CallBooleanMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallBooleanMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jbyte (JNICALL *CallByteMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jbyte (JNICALL *CallByteMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallByteMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallCharMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jchar (JNICALL *CallCharMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallCharMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallShortMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jshort (JNICALL *CallShortMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallShortMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallIntMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jint (JNICALL *CallIntMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jint (JNICALL *CallIntMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallLongMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jlong (JNICALL *CallLongMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallLongMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallFloatMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jfloat (JNICALL *CallFloatMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallFloatMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallDoubleMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jdouble (JNICALL *CallDoubleMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallDoubleMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallVoidMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    void (JNICALL *CallVoidMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    void (JNICALL *CallVoidMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jobject (JNICALL *CallNonvirtualObjectMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallNonvirtualObjectMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jobject (JNICALL *CallNonvirtualObjectMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jboolean (JNICALL *CallNonvirtualBooleanMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jbyte (JNICALL *CallNonvirtualByteMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallNonvirtualByteMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jbyte (JNICALL *CallNonvirtualByteMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jchar (JNICALL *CallNonvirtualCharMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallNonvirtualCharMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jchar (JNICALL *CallNonvirtualCharMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jshort (JNICALL *CallNonvirtualShortMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallNonvirtualShortMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jshort (JNICALL *CallNonvirtualShortMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jint (JNICALL *CallNonvirtualIntMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallNonvirtualIntMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jint (JNICALL *CallNonvirtualIntMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jlong (JNICALL *CallNonvirtualLongMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallNonvirtualLongMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jlong (JNICALL *CallNonvirtualLongMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jfloat (JNICALL *CallNonvirtualFloatMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallNonvirtualFloatMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jfloat (JNICALL *CallNonvirtualFloatMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jdouble (JNICALL *CallNonvirtualDoubleMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    void (JNICALL *CallNonvirtualVoidMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    void (JNICALL *CallNonvirtualVoidMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    void (JNICALL *CallNonvirtualVoidMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jfieldID (JNICALL *GetFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *GetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jboolean (JNICALL *GetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jbyte (JNICALL *GetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jchar (JNICALL *GetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jshort (JNICALL *GetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jint (JNICALL *GetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jlong (JNICALL *GetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jfloat (JNICALL *GetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jdouble (JNICALL *GetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+    void (JNICALL *SetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+    void (JNICALL *SetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+    void (JNICALL *SetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+    void (JNICALL *SetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+    void (JNICALL *SetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+    void (JNICALL *SetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+    void (JNICALL *SetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+    void (JNICALL *SetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+    void (JNICALL *SetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+    jmethodID (JNICALL *GetStaticMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallStaticObjectMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallStaticObjectMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallStaticObjectMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jboolean (JNICALL *CallStaticBooleanMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallStaticBooleanMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallStaticBooleanMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jbyte (JNICALL *CallStaticByteMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallStaticByteMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallStaticByteMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallStaticCharMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallStaticCharMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallStaticCharMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallStaticShortMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallStaticShortMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallStaticShortMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallStaticIntMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallStaticIntMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jint (JNICALL *CallStaticIntMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallStaticLongMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallStaticLongMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallStaticLongMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallStaticFloatMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallStaticFloatMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallStaticFloatMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallStaticDoubleMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallStaticDoubleMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallStaticDoubleMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallStaticVoidMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+    void (JNICALL *CallStaticVoidMethodV)
+      (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+    void (JNICALL *CallStaticVoidMethodA)
+      (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+    jfieldID (JNICALL *GetStaticFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+    jobject (JNICALL *GetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jboolean (JNICALL *GetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jbyte (JNICALL *GetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jchar (JNICALL *GetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jshort (JNICALL *GetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jint (JNICALL *GetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jlong (JNICALL *GetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jfloat (JNICALL *GetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jdouble (JNICALL *GetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+    void (JNICALL *SetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+    void (JNICALL *SetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+    void (JNICALL *SetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+    void (JNICALL *SetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+    void (JNICALL *SetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+    void (JNICALL *SetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+    void (JNICALL *SetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+    void (JNICALL *SetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+    void (JNICALL *SetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+    jstring (JNICALL *NewString)
+      (JNIEnv *env, const jchar *unicode, jsize len);
+    jsize (JNICALL *GetStringLength)
+      (JNIEnv *env, jstring str);
+    const jchar *(JNICALL *GetStringChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringChars)
+      (JNIEnv *env, jstring str, const jchar *chars);
+
+    jstring (JNICALL *NewStringUTF)
+      (JNIEnv *env, const char *utf);
+    jsize (JNICALL *GetStringUTFLength)
+      (JNIEnv *env, jstring str);
+    const char* (JNICALL *GetStringUTFChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringUTFChars)
+      (JNIEnv *env, jstring str, const char* chars);
+
+
+    jsize (JNICALL *GetArrayLength)
+      (JNIEnv *env, jarray array);
+
+    jobjectArray (JNICALL *NewObjectArray)
+      (JNIEnv *env, jsize len, jclass clazz, jobject init);
+    jobject (JNICALL *GetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index);
+    void (JNICALL *SetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+    jbooleanArray (JNICALL *NewBooleanArray)
+      (JNIEnv *env, jsize len);
+    jbyteArray (JNICALL *NewByteArray)
+      (JNIEnv *env, jsize len);
+    jcharArray (JNICALL *NewCharArray)
+      (JNIEnv *env, jsize len);
+    jshortArray (JNICALL *NewShortArray)
+      (JNIEnv *env, jsize len);
+    jintArray (JNICALL *NewIntArray)
+      (JNIEnv *env, jsize len);
+    jlongArray (JNICALL *NewLongArray)
+      (JNIEnv *env, jsize len);
+    jfloatArray (JNICALL *NewFloatArray)
+      (JNIEnv *env, jsize len);
+    jdoubleArray (JNICALL *NewDoubleArray)
+      (JNIEnv *env, jsize len);
+
+    jboolean * (JNICALL *GetBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+    jbyte * (JNICALL *GetByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+    jchar * (JNICALL *GetCharArrayElements)
+      (JNIEnv *env, jcharArray array, jboolean *isCopy);
+    jshort * (JNICALL *GetShortArrayElements)
+      (JNIEnv *env, jshortArray array, jboolean *isCopy);
+    jint * (JNICALL *GetIntArrayElements)
+      (JNIEnv *env, jintArray array, jboolean *isCopy);
+    jlong * (JNICALL *GetLongArrayElements)
+      (JNIEnv *env, jlongArray array, jboolean *isCopy);
+    jfloat * (JNICALL *GetFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+    jdouble * (JNICALL *GetDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+    void (JNICALL *ReleaseBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+    void (JNICALL *ReleaseByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+    void (JNICALL *ReleaseCharArrayElements)
+      (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+    void (JNICALL *ReleaseShortArrayElements)
+      (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+    void (JNICALL *ReleaseIntArrayElements)
+      (JNIEnv *env, jintArray array, jint *elems, jint mode);
+    void (JNICALL *ReleaseLongArrayElements)
+      (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+    void (JNICALL *ReleaseFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+    void (JNICALL *ReleaseDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+    void (JNICALL *GetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+    void (JNICALL *GetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+    void (JNICALL *GetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+    void (JNICALL *GetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+    void (JNICALL *GetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+    void (JNICALL *GetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+    void (JNICALL *GetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+    void (JNICALL *SetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+    void (JNICALL *SetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+    void (JNICALL *SetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+    void (JNICALL *SetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+    void (JNICALL *SetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+    void (JNICALL *SetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+    void (JNICALL *SetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+    void (JNICALL *SetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+    jint (JNICALL *RegisterNatives)
+      (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+       jint nMethods);
+    jint (JNICALL *UnregisterNatives)
+      (JNIEnv *env, jclass clazz);
+
+    jint (JNICALL *MonitorEnter)
+      (JNIEnv *env, jobject obj);
+    jint (JNICALL *MonitorExit)
+      (JNIEnv *env, jobject obj);
+
+    jint (JNICALL *GetJavaVM)
+      (JNIEnv *env, JavaVM **vm);
+
+    void (JNICALL *GetStringRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetStringUTFRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+    void * (JNICALL *GetPrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, jboolean *isCopy);
+    void (JNICALL *ReleasePrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, void *carray, jint mode);
+
+    const jchar * (JNICALL *GetStringCritical)
+      (JNIEnv *env, jstring string, jboolean *isCopy);
+    void (JNICALL *ReleaseStringCritical)
+      (JNIEnv *env, jstring string, const jchar *cstring);
+
+    jweak (JNICALL *NewWeakGlobalRef)
+       (JNIEnv *env, jobject obj);
+    void (JNICALL *DeleteWeakGlobalRef)
+       (JNIEnv *env, jweak ref);
+
+    jboolean (JNICALL *ExceptionCheck)
+       (JNIEnv *env);
+
+    jobject (JNICALL *NewDirectByteBuffer)
+       (JNIEnv* env, void* address, jlong capacity);
+    void* (JNICALL *GetDirectBufferAddress)
+       (JNIEnv* env, jobject buf);
+    jlong (JNICALL *GetDirectBufferCapacity)
+       (JNIEnv* env, jobject buf);
+
+    /* New JNI 1.6 Features */
+
+    jobjectRefType (JNICALL *GetObjectRefType)
+        (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ *    env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ *    (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+    const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint GetVersion() {
+        return functions->GetVersion(this);
+    }
+    jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+                       jsize len) {
+        return functions->DefineClass(this, name, loader, buf, len);
+    }
+    jclass FindClass(const char *name) {
+        return functions->FindClass(this, name);
+    }
+    jmethodID FromReflectedMethod(jobject method) {
+        return functions->FromReflectedMethod(this,method);
+    }
+    jfieldID FromReflectedField(jobject field) {
+        return functions->FromReflectedField(this,field);
+    }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+        return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+    }
+
+    jclass GetSuperclass(jclass sub) {
+        return functions->GetSuperclass(this, sub);
+    }
+    jboolean IsAssignableFrom(jclass sub, jclass sup) {
+        return functions->IsAssignableFrom(this, sub, sup);
+    }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+        return functions->ToReflectedField(this,cls,fieldID,isStatic);
+    }
+
+    jint Throw(jthrowable obj) {
+        return functions->Throw(this, obj);
+    }
+    jint ThrowNew(jclass clazz, const char *msg) {
+        return functions->ThrowNew(this, clazz, msg);
+    }
+    jthrowable ExceptionOccurred() {
+        return functions->ExceptionOccurred(this);
+    }
+    void ExceptionDescribe() {
+        functions->ExceptionDescribe(this);
+    }
+    void ExceptionClear() {
+        functions->ExceptionClear(this);
+    }
+    void FatalError(const char *msg) {
+        functions->FatalError(this, msg);
+    }
+
+    jint PushLocalFrame(jint capacity) {
+        return functions->PushLocalFrame(this,capacity);
+    }
+    jobject PopLocalFrame(jobject result) {
+        return functions->PopLocalFrame(this,result);
+    }
+
+    jobject NewGlobalRef(jobject lobj) {
+        return functions->NewGlobalRef(this,lobj);
+    }
+    void DeleteGlobalRef(jobject gref) {
+        functions->DeleteGlobalRef(this,gref);
+    }
+    void DeleteLocalRef(jobject obj) {
+        functions->DeleteLocalRef(this, obj);
+    }
+
+    jboolean IsSameObject(jobject obj1, jobject obj2) {
+        return functions->IsSameObject(this,obj1,obj2);
+    }
+
+    jobject NewLocalRef(jobject ref) {
+        return functions->NewLocalRef(this,ref);
+    }
+    jint EnsureLocalCapacity(jint capacity) {
+        return functions->EnsureLocalCapacity(this,capacity);
+    }
+
+    jobject AllocObject(jclass clazz) {
+        return functions->AllocObject(this,clazz);
+    }
+    jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args, methodID);
+        result = functions->NewObjectV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject NewObjectV(jclass clazz, jmethodID methodID,
+                       va_list args) {
+        return functions->NewObjectV(this,clazz,methodID,args);
+    }
+    jobject NewObjectA(jclass clazz, jmethodID methodID,
+                       const jvalue *args) {
+        return functions->NewObjectA(this,clazz,methodID,args);
+    }
+
+    jclass GetObjectClass(jobject obj) {
+        return functions->GetObjectClass(this,obj);
+    }
+    jboolean IsInstanceOf(jobject obj, jclass clazz) {
+        return functions->IsInstanceOf(this,obj,clazz);
+    }
+
+    jmethodID GetMethodID(jclass clazz, const char *name,
+                          const char *sig) {
+        return functions->GetMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallObjectMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallObjectMethodV(this,obj,methodID,args);
+    }
+    jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallObjectMethodA(this,obj,methodID,args);
+    }
+
+    jboolean CallBooleanMethod(jobject obj,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallBooleanMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+                                va_list args) {
+        return functions->CallBooleanMethodV(this,obj,methodID,args);
+    }
+    jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+                                const jvalue * args) {
+        return functions->CallBooleanMethodA(this,obj,methodID, args);
+    }
+
+    jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallByteMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallByteMethodV(this,obj,methodID,args);
+    }
+    jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallByteMethodA(this,obj,methodID,args);
+    }
+
+    jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallCharMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallCharMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallCharMethodV(this,obj,methodID,args);
+    }
+    jchar CallCharMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallCharMethodA(this,obj,methodID,args);
+    }
+
+    jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallShortMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallShortMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallShortMethodV(this,obj,methodID,args);
+    }
+    jshort CallShortMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallShortMethodA(this,obj,methodID,args);
+    }
+
+    jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallIntMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallIntMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallIntMethodV(this,obj,methodID,args);
+    }
+    jint CallIntMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallIntMethodA(this,obj,methodID,args);
+    }
+
+    jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallLongMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallLongMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallLongMethodV(this,obj,methodID,args);
+    }
+    jlong CallLongMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallLongMethodA(this,obj,methodID,args);
+    }
+
+    jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallFloatMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallFloatMethodV(this,obj,methodID,args);
+    }
+    jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallFloatMethodA(this,obj,methodID,args);
+    }
+
+    jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallDoubleMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallDoubleMethodV(this,obj,methodID,args);
+    }
+    jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallDoubleMethodA(this,obj,methodID,args);
+    }
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallVoidMethodV(this,obj,methodID,args);
+        va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID,
+                         va_list args) {
+        functions->CallVoidMethodV(this,obj,methodID,args);
+    }
+    void CallVoidMethodA(jobject obj, jmethodID methodID,
+                         const jvalue * args) {
+        functions->CallVoidMethodA(this,obj,methodID,args);
+    }
+
+    jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+                                         jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                         methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+                                          jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                       methodID,args);
+    }
+    jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+                                          jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+                                                       methodID, args);
+    }
+
+    jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                     methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                   methodID,args);
+    }
+    jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+                                  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+                                                   methodID,args);
+    }
+
+    jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      va_list args) {
+        return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      const jvalue * args) {
+        return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        va_list args) {
+        return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        const jvalue * args) {
+        return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+                                  jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+        va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   va_list args) {
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+    }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   const jvalue * args) {
+        functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+    }
+
+    jfieldID GetFieldID(jclass clazz, const char *name,
+                        const char *sig) {
+        return functions->GetFieldID(this,clazz,name,sig);
+    }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID) {
+        return functions->GetObjectField(this,obj,fieldID);
+    }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+        return functions->GetBooleanField(this,obj,fieldID);
+    }
+    jbyte GetByteField(jobject obj, jfieldID fieldID) {
+        return functions->GetByteField(this,obj,fieldID);
+    }
+    jchar GetCharField(jobject obj, jfieldID fieldID) {
+        return functions->GetCharField(this,obj,fieldID);
+    }
+    jshort GetShortField(jobject obj, jfieldID fieldID) {
+        return functions->GetShortField(this,obj,fieldID);
+    }
+    jint GetIntField(jobject obj, jfieldID fieldID) {
+        return functions->GetIntField(this,obj,fieldID);
+    }
+    jlong GetLongField(jobject obj, jfieldID fieldID) {
+        return functions->GetLongField(this,obj,fieldID);
+    }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+        return functions->GetFloatField(this,obj,fieldID);
+    }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+        return functions->GetDoubleField(this,obj,fieldID);
+    }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+        functions->SetObjectField(this,obj,fieldID,val);
+    }
+    void SetBooleanField(jobject obj, jfieldID fieldID,
+                         jboolean val) {
+        functions->SetBooleanField(this,obj,fieldID,val);
+    }
+    void SetByteField(jobject obj, jfieldID fieldID,
+                      jbyte val) {
+        functions->SetByteField(this,obj,fieldID,val);
+    }
+    void SetCharField(jobject obj, jfieldID fieldID,
+                      jchar val) {
+        functions->SetCharField(this,obj,fieldID,val);
+    }
+    void SetShortField(jobject obj, jfieldID fieldID,
+                       jshort val) {
+        functions->SetShortField(this,obj,fieldID,val);
+    }
+    void SetIntField(jobject obj, jfieldID fieldID,
+                     jint val) {
+        functions->SetIntField(this,obj,fieldID,val);
+    }
+    void SetLongField(jobject obj, jfieldID fieldID,
+                      jlong val) {
+        functions->SetLongField(this,obj,fieldID,val);
+    }
+    void SetFloatField(jobject obj, jfieldID fieldID,
+                       jfloat val) {
+        functions->SetFloatField(this,obj,fieldID,val);
+    }
+    void SetDoubleField(jobject obj, jfieldID fieldID,
+                        jdouble val) {
+        functions->SetDoubleField(this,obj,fieldID,val);
+    }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char *name,
+                                const char *sig) {
+        return functions->GetStaticMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+                             ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+                              va_list args) {
+        return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+    }
+    jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+                              const jvalue *args) {
+        return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+    }
+
+    jboolean CallStaticBooleanMethod(jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallStaticBooleanMethodV(jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+    }
+    jboolean CallStaticBooleanMethodA(jclass clazz,
+                                      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+    }
+
+    jbyte CallStaticByteMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallStaticByteMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+    }
+    jbyte CallStaticByteMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+    }
+
+    jchar CallStaticCharMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallStaticCharMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+    }
+    jchar CallStaticCharMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+    }
+
+    jshort CallStaticShortMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallStaticShortMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+    }
+    jshort CallStaticShortMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+    }
+
+    jint CallStaticIntMethod(jclass clazz,
+                             jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallStaticIntMethodV(jclass clazz,
+                              jmethodID methodID, va_list args) {
+        return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+    }
+    jint CallStaticIntMethodA(jclass clazz,
+                              jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+    }
+
+    jlong CallStaticLongMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallStaticLongMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+    }
+    jlong CallStaticLongMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+    }
+
+    jfloat CallStaticFloatMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallStaticFloatMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+    }
+    jfloat CallStaticFloatMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+    }
+
+    jdouble CallStaticDoubleMethod(jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallStaticDoubleMethodV(jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+    }
+    jdouble CallStaticDoubleMethodA(jclass clazz,
+                                    jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+    }
+
+    void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+        va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+                               va_list args) {
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+    }
+    void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+                               const jvalue * args) {
+        functions->CallStaticVoidMethodA(this,cls,methodID,args);
+    }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char *name,
+                              const char *sig) {
+        return functions->GetStaticFieldID(this,clazz,name,sig);
+    }
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticObjectField(this,clazz,fieldID);
+    }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticBooleanField(this,clazz,fieldID);
+    }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticByteField(this,clazz,fieldID);
+    }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticCharField(this,clazz,fieldID);
+    }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticShortField(this,clazz,fieldID);
+    }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticIntField(this,clazz,fieldID);
+    }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticLongField(this,clazz,fieldID);
+    }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticFloatField(this,clazz,fieldID);
+    }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticDoubleField(this,clazz,fieldID);
+    }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+                        jobject value) {
+      functions->SetStaticObjectField(this,clazz,fieldID,value);
+    }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+                        jboolean value) {
+      functions->SetStaticBooleanField(this,clazz,fieldID,value);
+    }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID,
+                        jbyte value) {
+      functions->SetStaticByteField(this,clazz,fieldID,value);
+    }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID,
+                        jchar value) {
+      functions->SetStaticCharField(this,clazz,fieldID,value);
+    }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID,
+                        jshort value) {
+      functions->SetStaticShortField(this,clazz,fieldID,value);
+    }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID,
+                        jint value) {
+      functions->SetStaticIntField(this,clazz,fieldID,value);
+    }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID,
+                        jlong value) {
+      functions->SetStaticLongField(this,clazz,fieldID,value);
+    }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+                        jfloat value) {
+      functions->SetStaticFloatField(this,clazz,fieldID,value);
+    }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+                        jdouble value) {
+      functions->SetStaticDoubleField(this,clazz,fieldID,value);
+    }
+
+    jstring NewString(const jchar *unicode, jsize len) {
+        return functions->NewString(this,unicode,len);
+    }
+    jsize GetStringLength(jstring str) {
+        return functions->GetStringLength(this,str);
+    }
+    const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringChars(this,str,isCopy);
+    }
+    void ReleaseStringChars(jstring str, const jchar *chars) {
+        functions->ReleaseStringChars(this,str,chars);
+    }
+
+    jstring NewStringUTF(const char *utf) {
+        return functions->NewStringUTF(this,utf);
+    }
+    jsize GetStringUTFLength(jstring str) {
+        return functions->GetStringUTFLength(this,str);
+    }
+    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringUTFChars(this,str,isCopy);
+    }
+    void ReleaseStringUTFChars(jstring str, const char* chars) {
+        functions->ReleaseStringUTFChars(this,str,chars);
+    }
+
+    jsize GetArrayLength(jarray array) {
+        return functions->GetArrayLength(this,array);
+    }
+
+    jobjectArray NewObjectArray(jsize len, jclass clazz,
+                                jobject init) {
+        return functions->NewObjectArray(this,len,clazz,init);
+    }
+    jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+        return functions->GetObjectArrayElement(this,array,index);
+    }
+    void SetObjectArrayElement(jobjectArray array, jsize index,
+                               jobject val) {
+        functions->SetObjectArrayElement(this,array,index,val);
+    }
+
+    jbooleanArray NewBooleanArray(jsize len) {
+        return functions->NewBooleanArray(this,len);
+    }
+    jbyteArray NewByteArray(jsize len) {
+        return functions->NewByteArray(this,len);
+    }
+    jcharArray NewCharArray(jsize len) {
+        return functions->NewCharArray(this,len);
+    }
+    jshortArray NewShortArray(jsize len) {
+        return functions->NewShortArray(this,len);
+    }
+    jintArray NewIntArray(jsize len) {
+        return functions->NewIntArray(this,len);
+    }
+    jlongArray NewLongArray(jsize len) {
+        return functions->NewLongArray(this,len);
+    }
+    jfloatArray NewFloatArray(jsize len) {
+        return functions->NewFloatArray(this,len);
+    }
+    jdoubleArray NewDoubleArray(jsize len) {
+        return functions->NewDoubleArray(this,len);
+    }
+
+    jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+        return functions->GetBooleanArrayElements(this,array,isCopy);
+    }
+    jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+        return functions->GetByteArrayElements(this,array,isCopy);
+    }
+    jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+        return functions->GetCharArrayElements(this,array,isCopy);
+    }
+    jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+        return functions->GetShortArrayElements(this,array,isCopy);
+    }
+    jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+        return functions->GetIntArrayElements(this,array,isCopy);
+    }
+    jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+        return functions->GetLongArrayElements(this,array,isCopy);
+    }
+    jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+        return functions->GetFloatArrayElements(this,array,isCopy);
+    }
+    jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+        return functions->GetDoubleArrayElements(this,array,isCopy);
+    }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array,
+                                     jboolean *elems,
+                                     jint mode) {
+        functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+    }
+    void ReleaseByteArrayElements(jbyteArray array,
+                                  jbyte *elems,
+                                  jint mode) {
+        functions->ReleaseByteArrayElements(this,array,elems,mode);
+    }
+    void ReleaseCharArrayElements(jcharArray array,
+                                  jchar *elems,
+                                  jint mode) {
+        functions->ReleaseCharArrayElements(this,array,elems,mode);
+    }
+    void ReleaseShortArrayElements(jshortArray array,
+                                   jshort *elems,
+                                   jint mode) {
+        functions->ReleaseShortArrayElements(this,array,elems,mode);
+    }
+    void ReleaseIntArrayElements(jintArray array,
+                                 jint *elems,
+                                 jint mode) {
+        functions->ReleaseIntArrayElements(this,array,elems,mode);
+    }
+    void ReleaseLongArrayElements(jlongArray array,
+                                  jlong *elems,
+                                  jint mode) {
+        functions->ReleaseLongArrayElements(this,array,elems,mode);
+    }
+    void ReleaseFloatArrayElements(jfloatArray array,
+                                   jfloat *elems,
+                                   jint mode) {
+        functions->ReleaseFloatArrayElements(this,array,elems,mode);
+    }
+    void ReleaseDoubleArrayElements(jdoubleArray array,
+                                    jdouble *elems,
+                                    jint mode) {
+        functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+    }
+
+    void GetBooleanArrayRegion(jbooleanArray array,
+                               jsize start, jsize len, jboolean *buf) {
+        functions->GetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void GetByteArrayRegion(jbyteArray array,
+                            jsize start, jsize len, jbyte *buf) {
+        functions->GetByteArrayRegion(this,array,start,len,buf);
+    }
+    void GetCharArrayRegion(jcharArray array,
+                            jsize start, jsize len, jchar *buf) {
+        functions->GetCharArrayRegion(this,array,start,len,buf);
+    }
+    void GetShortArrayRegion(jshortArray array,
+                             jsize start, jsize len, jshort *buf) {
+        functions->GetShortArrayRegion(this,array,start,len,buf);
+    }
+    void GetIntArrayRegion(jintArray array,
+                           jsize start, jsize len, jint *buf) {
+        functions->GetIntArrayRegion(this,array,start,len,buf);
+    }
+    void GetLongArrayRegion(jlongArray array,
+                            jsize start, jsize len, jlong *buf) {
+        functions->GetLongArrayRegion(this,array,start,len,buf);
+    }
+    void GetFloatArrayRegion(jfloatArray array,
+                             jsize start, jsize len, jfloat *buf) {
+        functions->GetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void GetDoubleArrayRegion(jdoubleArray array,
+                              jsize start, jsize len, jdouble *buf) {
+        functions->GetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+                               const jboolean *buf) {
+        functions->SetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+                            const jbyte *buf) {
+        functions->SetByteArrayRegion(this,array,start,len,buf);
+    }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+                            const jchar *buf) {
+        functions->SetCharArrayRegion(this,array,start,len,buf);
+    }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+                             const jshort *buf) {
+        functions->SetShortArrayRegion(this,array,start,len,buf);
+    }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+                           const jint *buf) {
+        functions->SetIntArrayRegion(this,array,start,len,buf);
+    }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+                            const jlong *buf) {
+        functions->SetLongArrayRegion(this,array,start,len,buf);
+    }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+                             const jfloat *buf) {
+        functions->SetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+                              const jdouble *buf) {
+        functions->SetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+                         jint nMethods) {
+        return functions->RegisterNatives(this,clazz,methods,nMethods);
+    }
+    jint UnregisterNatives(jclass clazz) {
+        return functions->UnregisterNatives(this,clazz);
+    }
+
+    jint MonitorEnter(jobject obj) {
+        return functions->MonitorEnter(this,obj);
+    }
+    jint MonitorExit(jobject obj) {
+        return functions->MonitorExit(this,obj);
+    }
+
+    jint GetJavaVM(JavaVM **vm) {
+        return functions->GetJavaVM(this,vm);
+    }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+        functions->GetStringRegion(this,str,start,len,buf);
+    }
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+        functions->GetStringUTFRegion(this,str,start,len,buf);
+    }
+
+    void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+        return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+    }
+    void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+        functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+    }
+
+    const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+        return functions->GetStringCritical(this,string,isCopy);
+    }
+    void ReleaseStringCritical(jstring string, const jchar *cstring) {
+        functions->ReleaseStringCritical(this,string,cstring);
+    }
+
+    jweak NewWeakGlobalRef(jobject obj) {
+        return functions->NewWeakGlobalRef(this,obj);
+    }
+    void DeleteWeakGlobalRef(jweak ref) {
+        functions->DeleteWeakGlobalRef(this,ref);
+    }
+
+    jboolean ExceptionCheck() {
+        return functions->ExceptionCheck(this);
+    }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity) {
+        return functions->NewDirectByteBuffer(this, address, capacity);
+    }
+    void* GetDirectBufferAddress(jobject buf) {
+        return functions->GetDirectBufferAddress(this, buf);
+    }
+    jlong GetDirectBufferCapacity(jobject buf) {
+        return functions->GetDirectBufferCapacity(this, buf);
+    }
+    jobjectRefType GetObjectRefType(jobject obj) {
+        return functions->GetObjectRefType(this, obj);
+    }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+    char *optionString;
+    void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint version;
+
+    jint nOptions;
+    JavaVMOption *options;
+    jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+    jint version;
+
+    char *name;
+    jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+    jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+    jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+    jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+    jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+    const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint DestroyJavaVM() {
+        return functions->DestroyJavaVM(this);
+    }
+    jint AttachCurrentThread(void **penv, void *args) {
+        return functions->AttachCurrentThread(this, penv, args);
+    }
+    jint DetachCurrentThread() {
+        return functions->DetachCurrentThread(this);
+    }
+
+    jint GetEnv(void **penv, jint version) {
+        return functions->GetEnv(this, penv, version);
+    }
+    jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+        return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+    }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+#define JNI_VERSION_1_8 0x00010008
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
diff --git a/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/linux/jni_md.h b/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/linux/jni_md.h
new file mode 100644
index 0000000..80eedf3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/arm-linux-jni/linux/jni_md.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#ifndef __has_attribute
+  #define __has_attribute(x) 0
+#endif
+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
+  #define JNIEXPORT     __attribute__((visibility("default")))
+  #define JNIIMPORT     __attribute__((visibility("default")))
+#else
+  #define JNIEXPORT
+  #define JNIIMPORT
+#endif
+
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit Solaris */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/third_party/allwpilib_2018/wpilibj/src/dev/java/edu/wpi/first/wpilibj/DevMain.java b/third_party/allwpilib_2018/wpilibj/src/dev/java/edu/wpi/first/wpilibj/DevMain.java
new file mode 100644
index 0000000..fbab673
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/dev/java/edu/wpi/first/wpilibj/DevMain.java
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.networktables.NetworkTablesJNI;
+import edu.wpi.first.wpiutil.RuntimeDetector;
+import edu.wpi.first.wpilibj.hal.HALUtil;
+
+public class DevMain {
+  /**
+   * Main entry point.
+   */
+  public static void main(String[] args) {
+    System.out.println("Hello World!");
+    System.out.println(RuntimeDetector.getPlatformPath());
+    System.out.println(NetworkTablesJNI.now());
+    System.out.println(HALUtil.getHALRuntimeType());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_I2C.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_I2C.java
new file mode 100644
index 0000000..ea21f81
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_I2C.java
@@ -0,0 +1,187 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.interfaces.Accelerometer;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * ADXL345 I2C Accelerometer.
+ */
+@SuppressWarnings({"TypeName", "PMD.UnusedPrivateField"})
+public class ADXL345_I2C extends SensorBase implements Accelerometer, Sendable {
+  private static final byte kAddress = 0x1D;
+  private static final byte kPowerCtlRegister = 0x2D;
+  private static final byte kDataFormatRegister = 0x31;
+  private static final byte kDataRegister = 0x32;
+  private static final double kGsPerLSB = 0.00390625;
+  private static final byte kPowerCtl_Link = 0x20;
+  private static final byte kPowerCtl_AutoSleep = 0x10;
+  private static final byte kPowerCtl_Measure = 0x08;
+  private static final byte kPowerCtl_Sleep = 0x04;
+
+  private static final byte kDataFormat_SelfTest = (byte) 0x80;
+  private static final byte kDataFormat_SPI = 0x40;
+  private static final byte kDataFormat_IntInvert = 0x20;
+  private static final byte kDataFormat_FullRes = 0x08;
+  private static final byte kDataFormat_Justify = 0x04;
+
+  public enum Axes {
+    kX((byte) 0x00),
+    kY((byte) 0x02),
+    kZ((byte) 0x04);
+
+    /**
+     * The integer value representing this enumeration.
+     */
+    @SuppressWarnings("MemberName")
+    public final byte value;
+
+    Axes(byte value) {
+      this.value = value;
+    }
+  }
+
+  @SuppressWarnings("MemberName")
+  public static class AllAxes {
+    public double XAxis;
+    public double YAxis;
+    public double ZAxis;
+  }
+
+  protected I2C m_i2c;
+
+  /**
+   * Constructs the ADXL345 Accelerometer with I2C address 0x1D.
+   *
+   * @param port  The I2C port the accelerometer is attached to
+   * @param range The range (+ or -) that the accelerometer will measure.
+   */
+  public ADXL345_I2C(I2C.Port port, Range range) {
+    this(port, range, kAddress);
+  }
+
+  /**
+   * Constructs the ADXL345 Accelerometer over I2C.
+   *
+   * @param port          The I2C port the accelerometer is attached to
+   * @param range         The range (+ or -) that the accelerometer will measure.
+   * @param deviceAddress I2C address of the accelerometer (0x1D or 0x53)
+   */
+  public ADXL345_I2C(I2C.Port port, Range range, int deviceAddress) {
+    m_i2c = new I2C(port, deviceAddress);
+
+    // Turn on the measurements
+    m_i2c.write(kPowerCtlRegister, kPowerCtl_Measure);
+
+    setRange(range);
+
+    HAL.report(tResourceType.kResourceType_ADXL345, tInstances.kADXL345_I2C);
+    setName("ADXL345_I2C", port.value);
+  }
+
+  @Override
+  public void free() {
+    super.free();
+    m_i2c.free();
+  }
+
+  @Override
+  public void setRange(Range range) {
+    final byte value;
+
+    switch (range) {
+      case k2G:
+        value = 0;
+        break;
+      case k4G:
+        value = 1;
+        break;
+      case k8G:
+        value = 2;
+        break;
+      case k16G:
+        value = 3;
+        break;
+      default:
+        throw new IllegalArgumentException(range + " unsupported range type");
+    }
+
+    // Specify the data format to read
+    m_i2c.write(kDataFormatRegister, kDataFormat_FullRes | value);
+  }
+
+  @Override
+  public double getX() {
+    return getAcceleration(Axes.kX);
+  }
+
+  @Override
+  public double getY() {
+    return getAcceleration(Axes.kY);
+  }
+
+  @Override
+  public double getZ() {
+    return getAcceleration(Axes.kZ);
+  }
+
+  /**
+   * Get the acceleration of one axis in Gs.
+   *
+   * @param axis The axis to read from.
+   * @return Acceleration of the ADXL345 in Gs.
+   */
+  public double getAcceleration(Axes axis) {
+    ByteBuffer rawAccel = ByteBuffer.allocate(2);
+    m_i2c.read(kDataRegister + axis.value, 2, rawAccel);
+
+    // Sensor is little endian... swap bytes
+    rawAccel.order(ByteOrder.LITTLE_ENDIAN);
+    return rawAccel.getShort(0) * kGsPerLSB;
+  }
+
+  /**
+   * Get the acceleration of all axes in Gs.
+   *
+   * @return An object containing the acceleration measured on each axis of the ADXL345 in Gs.
+   */
+  public AllAxes getAccelerations() {
+    AllAxes data = new AllAxes();
+    ByteBuffer rawData = ByteBuffer.allocate(6);
+    m_i2c.read(kDataRegister, 6, rawData);
+
+    // Sensor is little endian... swap bytes
+    rawData.order(ByteOrder.LITTLE_ENDIAN);
+    data.XAxis = rawData.getShort(0) * kGsPerLSB;
+    data.YAxis = rawData.getShort(2) * kGsPerLSB;
+    data.ZAxis = rawData.getShort(4) * kGsPerLSB;
+    return data;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("3AxisAccelerometer");
+    NetworkTableEntry entryX = builder.getEntry("X");
+    NetworkTableEntry entryY = builder.getEntry("Y");
+    NetworkTableEntry entryZ = builder.getEntry("Z");
+    builder.setUpdateTable(() -> {
+      AllAxes data = getAccelerations();
+      entryX.setDouble(data.XAxis);
+      entryY.setDouble(data.YAxis);
+      entryZ.setDouble(data.ZAxis);
+    });
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java
new file mode 100644
index 0000000..48e0240
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL345_SPI.java
@@ -0,0 +1,203 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.interfaces.Accelerometer;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * ADXL345 SPI Accelerometer.
+ */
+@SuppressWarnings({"TypeName", "PMD.UnusedPrivateField"})
+public class ADXL345_SPI extends SensorBase implements Accelerometer, Sendable {
+  private static final int kPowerCtlRegister = 0x2D;
+  private static final int kDataFormatRegister = 0x31;
+  private static final int kDataRegister = 0x32;
+  private static final double kGsPerLSB = 0.00390625;
+
+  private static final int kAddress_Read = 0x80;
+  private static final int kAddress_MultiByte = 0x40;
+
+  private static final int kPowerCtl_Link = 0x20;
+  private static final int kPowerCtl_AutoSleep = 0x10;
+  private static final int kPowerCtl_Measure = 0x08;
+  private static final int kPowerCtl_Sleep = 0x04;
+
+  private static final int kDataFormat_SelfTest = 0x80;
+  private static final int kDataFormat_SPI = 0x40;
+  private static final int kDataFormat_IntInvert = 0x20;
+  private static final int kDataFormat_FullRes = 0x08;
+  private static final int kDataFormat_Justify = 0x04;
+
+  public enum Axes {
+    kX((byte) 0x00),
+    kY((byte) 0x02),
+    kZ((byte) 0x04);
+
+    /**
+     * The integer value representing this enumeration.
+     */
+    @SuppressWarnings("MemberName")
+    public final byte value;
+
+    Axes(byte value) {
+      this.value = value;
+    }
+  }
+
+  @SuppressWarnings("MemberName")
+  public static class AllAxes {
+    public double XAxis;
+    public double YAxis;
+    public double ZAxis;
+  }
+
+  protected SPI m_spi;
+
+  /**
+   * Constructor.
+   *
+   * @param port  The SPI port that the accelerometer is connected to
+   * @param range The range (+ or -) that the accelerometer will measure.
+   */
+  public ADXL345_SPI(SPI.Port port, Range range) {
+    m_spi = new SPI(port);
+    init(range);
+    setName("ADXL345_SPI", port.value);
+  }
+
+  @Override
+  public void free() {
+    super.free();
+    m_spi.free();
+  }
+
+  /**
+   * Set SPI bus parameters, bring device out of sleep and set format.
+   *
+   * @param range The range (+ or -) that the accelerometer will measure.
+   */
+  private void init(Range range) {
+    m_spi.setClockRate(500000);
+    m_spi.setMSBFirst();
+    m_spi.setSampleDataOnFalling();
+    m_spi.setClockActiveLow();
+    m_spi.setChipSelectActiveHigh();
+
+    // Turn on the measurements
+    byte[] commands = new byte[2];
+    commands[0] = kPowerCtlRegister;
+    commands[1] = kPowerCtl_Measure;
+    m_spi.write(commands, 2);
+
+    setRange(range);
+
+    HAL.report(tResourceType.kResourceType_ADXL345, tInstances.kADXL345_SPI);
+  }
+
+  @Override
+  public void setRange(Range range) {
+    final byte value;
+
+    switch (range) {
+      case k2G:
+        value = 0;
+        break;
+      case k4G:
+        value = 1;
+        break;
+      case k8G:
+        value = 2;
+        break;
+      case k16G:
+        value = 3;
+        break;
+      default:
+        throw new IllegalArgumentException(range + " unsupported");
+    }
+
+    // Specify the data format to read
+    byte[] commands = new byte[]{kDataFormatRegister, (byte) (kDataFormat_FullRes | value)};
+    m_spi.write(commands, commands.length);
+  }
+
+  @Override
+  public double getX() {
+    return getAcceleration(Axes.kX);
+  }
+
+  @Override
+  public double getY() {
+    return getAcceleration(Axes.kY);
+  }
+
+  @Override
+  public double getZ() {
+    return getAcceleration(Axes.kZ);
+  }
+
+  /**
+   * Get the acceleration of one axis in Gs.
+   *
+   * @param axis The axis to read from.
+   * @return Acceleration of the ADXL345 in Gs.
+   */
+  public double getAcceleration(ADXL345_SPI.Axes axis) {
+    ByteBuffer transferBuffer = ByteBuffer.allocate(3);
+    transferBuffer.put(0,
+        (byte) ((kAddress_Read | kAddress_MultiByte | kDataRegister) + axis.value));
+    m_spi.transaction(transferBuffer, transferBuffer, 3);
+    // Sensor is little endian
+    transferBuffer.order(ByteOrder.LITTLE_ENDIAN);
+
+    return transferBuffer.getShort(1) * kGsPerLSB;
+  }
+
+  /**
+   * Get the acceleration of all axes in Gs.
+   *
+   * @return An object containing the acceleration measured on each axis of the ADXL345 in Gs.
+   */
+  public ADXL345_SPI.AllAxes getAccelerations() {
+    ADXL345_SPI.AllAxes data = new ADXL345_SPI.AllAxes();
+    if (m_spi != null) {
+      ByteBuffer dataBuffer = ByteBuffer.allocate(7);
+      // Select the data address.
+      dataBuffer.put(0, (byte) (kAddress_Read | kAddress_MultiByte | kDataRegister));
+      m_spi.transaction(dataBuffer, dataBuffer, 7);
+      // Sensor is little endian... swap bytes
+      dataBuffer.order(ByteOrder.LITTLE_ENDIAN);
+
+      data.XAxis = dataBuffer.getShort(1) * kGsPerLSB;
+      data.YAxis = dataBuffer.getShort(3) * kGsPerLSB;
+      data.ZAxis = dataBuffer.getShort(5) * kGsPerLSB;
+    }
+    return data;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("3AxisAccelerometer");
+    NetworkTableEntry entryX = builder.getEntry("X");
+    NetworkTableEntry entryY = builder.getEntry("Y");
+    NetworkTableEntry entryZ = builder.getEntry("Z");
+    builder.setUpdateTable(() -> {
+      AllAxes data = getAccelerations();
+      entryX.setDouble(data.XAxis);
+      entryY.setDouble(data.YAxis);
+      entryZ.setDouble(data.ZAxis);
+    });
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java
new file mode 100644
index 0000000..021417d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXL362.java
@@ -0,0 +1,227 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.interfaces.Accelerometer;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * ADXL362 SPI Accelerometer.
+ *
+ * <p>This class allows access to an Analog Devices ADXL362 3-axis accelerometer.
+ */
+@SuppressWarnings("PMD.UnusedPrivateField")
+public class ADXL362 extends SensorBase implements Accelerometer, Sendable {
+  private static final byte kRegWrite = 0x0A;
+  private static final byte kRegRead = 0x0B;
+
+  private static final byte kPartIdRegister = 0x02;
+  private static final byte kDataRegister = 0x0E;
+  private static final byte kFilterCtlRegister = 0x2C;
+  private static final byte kPowerCtlRegister = 0x2D;
+
+  private static final byte kFilterCtl_Range2G = 0x00;
+  private static final byte kFilterCtl_Range4G = 0x40;
+  private static final byte kFilterCtl_Range8G = (byte) 0x80;
+  private static final byte kFilterCtl_ODR_100Hz = 0x03;
+
+  private static final byte kPowerCtl_UltraLowNoise = 0x20;
+  private static final byte kPowerCtl_AutoSleep = 0x04;
+  private static final byte kPowerCtl_Measure = 0x02;
+
+  public enum Axes {
+    kX((byte) 0x00),
+    kY((byte) 0x02),
+    kZ((byte) 0x04);
+
+    @SuppressWarnings("MemberName")
+    public final byte value;
+
+    Axes(byte value) {
+      this.value = value;
+    }
+  }
+
+  @SuppressWarnings("MemberName")
+  public static class AllAxes {
+    public double XAxis;
+    public double YAxis;
+    public double ZAxis;
+  }
+
+  private SPI m_spi;
+  private double m_gsPerLSB;
+
+  /**
+   * Constructor.  Uses the onboard CS1.
+   *
+   * @param range The range (+ or -) that the accelerometer will measure.
+   */
+  public ADXL362(Range range) {
+    this(SPI.Port.kOnboardCS1, range);
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param port  The SPI port that the accelerometer is connected to
+   * @param range The range (+ or -) that the accelerometer will measure.
+   */
+  public ADXL362(SPI.Port port, Range range) {
+    m_spi = new SPI(port);
+
+    m_spi.setClockRate(3000000);
+    m_spi.setMSBFirst();
+    m_spi.setSampleDataOnFalling();
+    m_spi.setClockActiveLow();
+    m_spi.setChipSelectActiveLow();
+
+    // Validate the part ID
+    ByteBuffer transferBuffer = ByteBuffer.allocate(3);
+    transferBuffer.put(0, kRegRead);
+    transferBuffer.put(1, kPartIdRegister);
+    m_spi.transaction(transferBuffer, transferBuffer, 3);
+    if (transferBuffer.get(2) != (byte) 0xF2) {
+      m_spi.free();
+      m_spi = null;
+      DriverStation.reportError("could not find ADXL362 on SPI port " + port.value, false);
+      return;
+    }
+
+    setRange(range);
+
+    // Turn on the measurements
+    transferBuffer.put(0, kRegWrite);
+    transferBuffer.put(1, kPowerCtlRegister);
+    transferBuffer.put(2, (byte) (kPowerCtl_Measure | kPowerCtl_UltraLowNoise));
+    m_spi.write(transferBuffer, 3);
+
+    HAL.report(tResourceType.kResourceType_ADXL362, port.value);
+    setName("ADXL362", port.value);
+  }
+
+  @Override
+  public void free() {
+    super.free();
+    if (m_spi != null) {
+      m_spi.free();
+      m_spi = null;
+    }
+  }
+
+  @Override
+  public void setRange(Range range) {
+    if (m_spi == null) {
+      return;
+    }
+
+    final byte value;
+    switch (range) {
+      case k2G:
+        value = kFilterCtl_Range2G;
+        m_gsPerLSB = 0.001;
+        break;
+      case k4G:
+        value = kFilterCtl_Range4G;
+        m_gsPerLSB = 0.002;
+        break;
+      case k8G:
+      case k16G:  // 16G not supported; treat as 8G
+        value = kFilterCtl_Range8G;
+        m_gsPerLSB = 0.004;
+        break;
+      default:
+        throw new IllegalArgumentException(range + " unsupported");
+
+    }
+
+    // Specify the data format to read
+    byte[] commands = new byte[]{kRegWrite, kFilterCtlRegister, (byte) (kFilterCtl_ODR_100Hz
+        | value)};
+    m_spi.write(commands, commands.length);
+  }
+
+
+  @Override
+  public double getX() {
+    return getAcceleration(Axes.kX);
+  }
+
+  @Override
+  public double getY() {
+    return getAcceleration(Axes.kY);
+  }
+
+  @Override
+  public double getZ() {
+    return getAcceleration(Axes.kZ);
+  }
+
+  /**
+   * Get the acceleration of one axis in Gs.
+   *
+   * @param axis The axis to read from.
+   * @return Acceleration of the ADXL362 in Gs.
+   */
+  public double getAcceleration(ADXL362.Axes axis) {
+    if (m_spi == null) {
+      return 0.0;
+    }
+    ByteBuffer transferBuffer = ByteBuffer.allocate(4);
+    transferBuffer.put(0, kRegRead);
+    transferBuffer.put(1, (byte) (kDataRegister + axis.value));
+    m_spi.transaction(transferBuffer, transferBuffer, 4);
+    // Sensor is little endian
+    transferBuffer.order(ByteOrder.LITTLE_ENDIAN);
+
+    return transferBuffer.getShort(2) * m_gsPerLSB;
+  }
+
+  /**
+   * Get the acceleration of all axes in Gs.
+   *
+   * @return An object containing the acceleration measured on each axis of the ADXL362 in Gs.
+   */
+  public ADXL362.AllAxes getAccelerations() {
+    ADXL362.AllAxes data = new ADXL362.AllAxes();
+    if (m_spi != null) {
+      ByteBuffer dataBuffer = ByteBuffer.allocate(8);
+      // Select the data address.
+      dataBuffer.put(0, kRegRead);
+      dataBuffer.put(1, kDataRegister);
+      m_spi.transaction(dataBuffer, dataBuffer, 8);
+      // Sensor is little endian... swap bytes
+      dataBuffer.order(ByteOrder.LITTLE_ENDIAN);
+
+      data.XAxis = dataBuffer.getShort(2) * m_gsPerLSB;
+      data.YAxis = dataBuffer.getShort(4) * m_gsPerLSB;
+      data.ZAxis = dataBuffer.getShort(6) * m_gsPerLSB;
+    }
+    return data;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("3AxisAccelerometer");
+    NetworkTableEntry entryX = builder.getEntry("X");
+    NetworkTableEntry entryY = builder.getEntry("Y");
+    NetworkTableEntry entryZ = builder.getEntry("Z");
+    builder.setUpdateTable(() -> {
+      AllAxes data = getAccelerations();
+      entryX.setDouble(data.XAxis);
+      entryY.setDouble(data.YAxis);
+      entryZ.setDouble(data.ZAxis);
+    });
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java
new file mode 100644
index 0000000..bbef3c5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ADXRS450_Gyro.java
@@ -0,0 +1,161 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.interfaces.Gyro;
+
+/**
+ * Use a rate gyro to return the robots heading relative to a starting position. The Gyro class
+ * tracks the robots heading based on the starting position. As the robot rotates the new heading is
+ * computed by integrating the rate of rotation returned by the sensor. When the class is
+ * instantiated, it does a short calibration routine where it samples the gyro while at rest to
+ * determine the default offset. This is subtracted from each sample to determine the heading.
+ *
+ * <p>This class is for the digital ADXRS450 gyro sensor that connects via SPI.
+ */
+@SuppressWarnings({"TypeName", "AbbreviationAsWordInName", "PMD.UnusedPrivateField"})
+public class ADXRS450_Gyro extends GyroBase implements Gyro, PIDSource, Sendable {
+  private static final double kSamplePeriod = 0.0005;
+  private static final double kCalibrationSampleTime = 5.0;
+  private static final double kDegreePerSecondPerLSB = 0.0125;
+
+  private static final int kRateRegister = 0x00;
+  private static final int kTemRegister = 0x02;
+  private static final int kLoCSTRegister = 0x04;
+  private static final int kHiCSTRegister = 0x06;
+  private static final int kQuadRegister = 0x08;
+  private static final int kFaultRegister = 0x0A;
+  private static final int kPIDRegister = 0x0C;
+  private static final int kSNHighRegister = 0x0E;
+  private static final int kSNLowRegister = 0x10;
+
+  private SPI m_spi;
+
+  /**
+   * Constructor.  Uses the onboard CS0.
+   */
+  public ADXRS450_Gyro() {
+    this(SPI.Port.kOnboardCS0);
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param port The SPI port that the gyro is connected to
+   */
+  public ADXRS450_Gyro(SPI.Port port) {
+    m_spi = new SPI(port);
+
+    m_spi.setClockRate(3000000);
+    m_spi.setMSBFirst();
+    m_spi.setSampleDataOnRising();
+    m_spi.setClockActiveHigh();
+    m_spi.setChipSelectActiveLow();
+
+    // Validate the part ID
+    if ((readRegister(kPIDRegister) & 0xff00) != 0x5200) {
+      m_spi.free();
+      m_spi = null;
+      DriverStation.reportError("could not find ADXRS450 gyro on SPI port " + port.value,
+          false);
+      return;
+    }
+
+    m_spi.initAccumulator(kSamplePeriod, 0x20000000, 4, 0x0c00000e, 0x04000000, 10, 16,
+        true, true);
+
+    calibrate();
+
+    HAL.report(tResourceType.kResourceType_ADXRS450, port.value);
+    setName("ADXRS450_Gyro", port.value);
+  }
+
+  @Override
+  public void calibrate() {
+    if (m_spi == null) {
+      return;
+    }
+
+    Timer.delay(0.1);
+
+    m_spi.setAccumulatorCenter(0);
+    m_spi.resetAccumulator();
+
+    Timer.delay(kCalibrationSampleTime);
+
+    m_spi.setAccumulatorCenter((int) m_spi.getAccumulatorAverage());
+    m_spi.resetAccumulator();
+  }
+
+  private boolean calcParity(int value) {
+    boolean parity = false;
+    while (value != 0) {
+      parity = !parity;
+      value = value & (value - 1);
+    }
+    return parity;
+  }
+
+  private int readRegister(int reg) {
+    int cmdhi = 0x8000 | (reg << 1);
+    boolean parity = calcParity(cmdhi);
+
+    ByteBuffer buf = ByteBuffer.allocate(4);
+    buf.order(ByteOrder.BIG_ENDIAN);
+    buf.put(0, (byte) (cmdhi >> 8));
+    buf.put(1, (byte) (cmdhi & 0xff));
+    buf.put(2, (byte) 0);
+    buf.put(3, (byte) (parity ? 0 : 1));
+
+    m_spi.write(buf, 4);
+    m_spi.read(false, buf, 4);
+
+    if ((buf.get(0) & 0xe0) == 0) {
+      return 0;  // error, return 0
+    }
+    return (buf.getInt(0) >> 5) & 0xffff;
+  }
+
+  @Override
+  public void reset() {
+    m_spi.resetAccumulator();
+  }
+
+  /**
+   * Delete (free) the spi port used for the gyro and stop accumulating.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_spi != null) {
+      m_spi.free();
+      m_spi = null;
+    }
+  }
+
+  @Override
+  public double getAngle() {
+    if (m_spi == null) {
+      return 0.0;
+    }
+    return m_spi.getAccumulatorValue() * kDegreePerSecondPerLSB * kSamplePeriod;
+  }
+
+  @Override
+  public double getRate() {
+    if (m_spi == null) {
+      return 0.0;
+    }
+    return m_spi.getAccumulatorLastValue() * kDegreePerSecondPerLSB;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AccumulatorResult.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AccumulatorResult.java
new file mode 100644
index 0000000..7921637
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AccumulatorResult.java
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Structure for holding the values stored in an accumulator.
+ */
+public class AccumulatorResult {
+  /**
+   * The total value accumulated.
+   */
+  @SuppressWarnings("MemberName")
+  public long value;
+  /**
+   * The number of sample value was accumulated over.
+   */
+  @SuppressWarnings("MemberName")
+  public long count;
+
+  /**
+   * Set the value and count.
+   */
+  public void set(long value, long count) {
+    this.value = value;
+    this.count = count;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogAccelerometer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogAccelerometer.java
new file mode 100644
index 0000000..a7c2c82
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogAccelerometer.java
@@ -0,0 +1,141 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Handle operation of an analog accelerometer. The accelerometer reads acceleration directly
+ * through the sensor. Many sensors have multiple axis and can be treated as multiple devices. Each
+ * is calibrated by finding the center value over a period of time.
+ */
+public class AnalogAccelerometer extends SensorBase implements PIDSource, Sendable {
+  private AnalogInput m_analogChannel;
+  private double m_voltsPerG = 1.0;
+  private double m_zeroGVoltage = 2.5;
+  private boolean m_allocatedChannel;
+  protected PIDSourceType m_pidSource = PIDSourceType.kDisplacement;
+
+  /**
+   * Common initialization.
+   */
+  private void initAccelerometer() {
+    HAL.report(tResourceType.kResourceType_Accelerometer,
+                                   m_analogChannel.getChannel());
+    setName("Accelerometer", m_analogChannel.getChannel());
+  }
+
+  /**
+   * Create a new instance of an accelerometer.
+   *
+   * <p>The constructor allocates desired analog channel.
+   *
+   * @param channel The channel number for the analog input the accelerometer is connected to
+   */
+  public AnalogAccelerometer(final int channel) {
+    this(new AnalogInput(channel));
+    m_allocatedChannel = true;
+    addChild(m_analogChannel);
+  }
+
+  /**
+   * Create a new instance of Accelerometer from an existing AnalogChannel. Make a new instance of
+   * accelerometer given an AnalogChannel. This is particularly useful if the port is going to be
+   * read as an analog channel as well as through the Accelerometer class.
+   *
+   * @param channel The existing AnalogInput object for the analog input the accelerometer is
+   *                connected to
+   */
+  public AnalogAccelerometer(AnalogInput channel) {
+    requireNonNull(channel, "Analog Channel given was null");
+
+    m_allocatedChannel = false;
+    m_analogChannel = channel;
+    initAccelerometer();
+  }
+
+  /**
+   * Delete the analog components used for the accelerometer.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_analogChannel != null && m_allocatedChannel) {
+      m_analogChannel.free();
+    }
+    m_analogChannel = null;
+  }
+
+  /**
+   * Return the acceleration in Gs.
+   *
+   * <p>The acceleration is returned units of Gs.
+   *
+   * @return The current acceleration of the sensor in Gs.
+   */
+  public double getAcceleration() {
+    if (m_analogChannel == null) {
+      return 0.0;
+    }
+    return (m_analogChannel.getAverageVoltage() - m_zeroGVoltage) / m_voltsPerG;
+  }
+
+  /**
+   * Set the accelerometer sensitivity.
+   *
+   * <p>This sets the sensitivity of the accelerometer used for calculating the acceleration. The
+   * sensitivity varies by accelerometer model. There are constants defined for various models.
+   *
+   * @param sensitivity The sensitivity of accelerometer in Volts per G.
+   */
+  public void setSensitivity(double sensitivity) {
+    m_voltsPerG = sensitivity;
+  }
+
+  /**
+   * Set the voltage that corresponds to 0 G.
+   *
+   * <p>The zero G voltage varies by accelerometer model. There are constants defined for various
+   * models.
+   *
+   * @param zero The zero G voltage.
+   */
+  public void setZero(double zero) {
+    m_zeroGVoltage = zero;
+  }
+
+  @Override
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    m_pidSource = pidSource;
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  /**
+   * Get the Acceleration for the PID Source parent.
+   *
+   * @return The current acceleration in Gs.
+   */
+  @Override
+  public double pidGet() {
+    return getAcceleration();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Accelerometer");
+    builder.addDoubleProperty("Value", this::getAcceleration, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogGyro.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogGyro.java
new file mode 100644
index 0000000..b03fa99
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogGyro.java
@@ -0,0 +1,189 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.AnalogGyroJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.interfaces.Gyro;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Use a rate gyro to return the robots heading relative to a starting position. The Gyro class
+ * tracks the robots heading based on the starting position. As the robot rotates the new heading is
+ * computed by integrating the rate of rotation returned by the sensor. When the class is
+ * instantiated, it does a short calibration routine where it samples the gyro while at rest to
+ * determine the default offset. This is subtracted from each sample to determine the heading.
+ *
+ * <p>This class is for gyro sensors that connect to an analog input.
+ */
+public class AnalogGyro extends GyroBase implements Gyro, PIDSource, Sendable {
+  private static final double kDefaultVoltsPerDegreePerSecond = 0.007;
+  protected AnalogInput m_analog;
+  private boolean m_channelAllocated = false;
+
+  private int m_gyroHandle = 0;
+
+  /**
+   * Initialize the gyro. Calibration is handled by calibrate().
+   */
+  public void initGyro() {
+    if (m_gyroHandle == 0) {
+      m_gyroHandle = AnalogGyroJNI.initializeAnalogGyro(m_analog.m_port);
+    }
+
+    AnalogGyroJNI.setupAnalogGyro(m_gyroHandle);
+
+    HAL.report(tResourceType.kResourceType_Gyro, m_analog.getChannel());
+    setName("AnalogGyro", m_analog.getChannel());
+  }
+
+  @Override
+  public void calibrate() {
+    AnalogGyroJNI.calibrateAnalogGyro(m_gyroHandle);
+  }
+
+  /**
+   * Gyro constructor using the channel number.
+   *
+   * @param channel The analog channel the gyro is connected to. Gyros can only be used on on-board
+   *                channels 0-1.
+   */
+  public AnalogGyro(int channel) {
+    this(new AnalogInput(channel));
+    m_channelAllocated = true;
+    addChild(m_analog);
+  }
+
+  /**
+   * Gyro constructor with a precreated analog channel object. Use this constructor when the analog
+   * channel needs to be shared.
+   *
+   * @param channel The AnalogInput object that the gyro is connected to. Gyros can only be used on
+   *                on-board channels 0-1.
+   */
+  public AnalogGyro(AnalogInput channel) {
+    requireNonNull(channel, "AnalogInput supplied to Gyro constructor is null");
+
+    m_analog = channel;
+    initGyro();
+    calibrate();
+  }
+
+  /**
+   * Gyro constructor using the channel number along with parameters for presetting the center and
+   * offset values. Bypasses calibration.
+   *
+   * @param channel The analog channel the gyro is connected to. Gyros can only be used on on-board
+   *                channels 0-1.
+   * @param center  Preset uncalibrated value to use as the accumulator center value.
+   * @param offset  Preset uncalibrated value to use as the gyro offset.
+   */
+  public AnalogGyro(int channel, int center, double offset) {
+    this(new AnalogInput(channel), center, offset);
+    m_channelAllocated = true;
+    addChild(m_analog);
+  }
+
+  /**
+   * Gyro constructor with a precreated analog channel object along with parameters for presetting
+   * the center and offset values. Bypasses calibration.
+   *
+   * @param channel The analog channel the gyro is connected to. Gyros can only be used on on-board
+   *                channels 0-1.
+   * @param center  Preset uncalibrated value to use as the accumulator center value.
+   * @param offset  Preset uncalibrated value to use as the gyro offset.
+   */
+  public AnalogGyro(AnalogInput channel, int center, double offset) {
+    requireNonNull(channel, "AnalogInput supplied to Gyro constructor is null");
+
+    m_analog = channel;
+    initGyro();
+    AnalogGyroJNI.setAnalogGyroParameters(m_gyroHandle, kDefaultVoltsPerDegreePerSecond,
+                                          offset, center);
+    reset();
+  }
+
+  @Override
+  public void reset() {
+    AnalogGyroJNI.resetAnalogGyro(m_gyroHandle);
+  }
+
+  /**
+   * Delete (free) the accumulator and the analog components used for the gyro.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_analog != null && m_channelAllocated) {
+      m_analog.free();
+    }
+    m_analog = null;
+    AnalogGyroJNI.freeAnalogGyro(m_gyroHandle);
+  }
+
+  @Override
+  public double getAngle() {
+    if (m_analog == null) {
+      return 0.0;
+    } else {
+      return AnalogGyroJNI.getAnalogGyroAngle(m_gyroHandle);
+    }
+  }
+
+  @Override
+  public double getRate() {
+    if (m_analog == null) {
+      return 0.0;
+    } else {
+      return AnalogGyroJNI.getAnalogGyroRate(m_gyroHandle);
+    }
+  }
+
+  /**
+   * Return the gyro offset value set during calibration to use as a future preset.
+   *
+   * @return the current offset value
+   */
+  public double getOffset() {
+    return AnalogGyroJNI.getAnalogGyroOffset(m_gyroHandle);
+  }
+
+  /**
+   * Return the gyro center value set during calibration to use as a future preset.
+   *
+   * @return the current center value
+   */
+  public int getCenter() {
+    return AnalogGyroJNI.getAnalogGyroCenter(m_gyroHandle);
+  }
+
+  /**
+   * Set the gyro sensitivity. This takes the number of volts/degree/second sensitivity of the gyro
+   * and uses it in subsequent calculations to allow the code to work with multiple gyros. This
+   * value is typically found in the gyro datasheet.
+   *
+   * @param voltsPerDegreePerSecond The sensitivity in Volts/degree/second.
+   */
+  public void setSensitivity(double voltsPerDegreePerSecond) {
+    AnalogGyroJNI.setAnalogGyroVoltsPerDegreePerSecond(m_gyroHandle,
+                                                       voltsPerDegreePerSecond);
+  }
+
+  /**
+   * Set the size of the neutral zone. Any voltage from the gyro less than this amount from the
+   * center is considered stationary. Setting a deadband will decrease the amount of drift when the
+   * gyro isn't rotating, but will make it less accurate.
+   *
+   * @param volts The size of the deadband in volts
+   */
+  void setDeadband(double volts) {
+    AnalogGyroJNI.setAnalogGyroDeadband(m_gyroHandle, volts);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogInput.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogInput.java
new file mode 100644
index 0000000..43426f8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogInput.java
@@ -0,0 +1,353 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.AnalogJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+import edu.wpi.first.wpilibj.util.AllocationException;
+
+/**
+ * Analog channel class.
+ *
+ * <p>Each analog channel is read from hardware as a 12-bit number representing 0V to 5V.
+ *
+ * <p>Connected to each analog channel is an averaging and oversampling engine. This engine
+ * accumulates the specified ( by setAverageBits() and setOversampleBits() ) number of samples
+ * before returning a new value. This is not a sliding window average. The only difference between
+ * the oversampled samples and the averaged samples is that the oversampled samples are simply
+ * accumulated effectively increasing the resolution, while the averaged samples are divided by the
+ * number of samples to retain the resolution, but get more stable values.
+ */
+public class AnalogInput extends SensorBase implements PIDSource, Sendable {
+  private static final int kAccumulatorSlot = 1;
+  int m_port; // explicit no modifier, private and package accessible.
+  private int m_channel;
+  private static final int[] kAccumulatorChannels = {0, 1};
+  private long m_accumulatorOffset;
+  protected PIDSourceType m_pidSource = PIDSourceType.kDisplacement;
+
+  /**
+   * Construct an analog channel.
+   *
+   * @param channel The channel number to represent. 0-3 are on-board 4-7 are on the MXP port.
+   */
+  public AnalogInput(final int channel) {
+    checkAnalogInputChannel(channel);
+    m_channel = channel;
+
+    final int portHandle = AnalogJNI.getPort((byte) channel);
+    m_port = AnalogJNI.initializeAnalogInputPort(portHandle);
+
+    HAL.report(tResourceType.kResourceType_AnalogChannel, channel);
+    setName("AnalogInput", channel);
+  }
+
+  /**
+   * Channel destructor.
+   */
+  @Override
+  public void free() {
+    super.free();
+    AnalogJNI.freeAnalogInputPort(m_port);
+    m_port = 0;
+    m_channel = 0;
+    m_accumulatorOffset = 0;
+  }
+
+  /**
+   * Get a sample straight from this channel. The sample is a 12-bit value representing the 0V to 5V
+   * range of the A/D converter. The units are in A/D converter codes. Use GetVoltage() to get the
+   * analog value in calibrated units.
+   *
+   * @return A sample straight from this channel.
+   */
+  public int getValue() {
+    return AnalogJNI.getAnalogValue(m_port);
+  }
+
+  /**
+   * Get a sample from the output of the oversample and average engine for this channel. The sample
+   * is 12-bit + the bits configured in SetOversampleBits(). The value configured in
+   * setAverageBits() will cause this value to be averaged 2^bits number of samples. This is not a
+   * sliding window. The sample will not change until 2^(OversampleBits + AverageBits) samples have
+   * been acquired from this channel. Use getAverageVoltage() to get the analog value in calibrated
+   * units.
+   *
+   * @return A sample from the oversample and average engine for this channel.
+   */
+  public int getAverageValue() {
+    return AnalogJNI.getAnalogAverageValue(m_port);
+  }
+
+  /**
+   * Get a scaled sample straight from this channel. The value is scaled to units of Volts using the
+   * calibrated scaling data from getLSBWeight() and getOffset().
+   *
+   * @return A scaled sample straight from this channel.
+   */
+  public double getVoltage() {
+    return AnalogJNI.getAnalogVoltage(m_port);
+  }
+
+  /**
+   * Get a scaled sample from the output of the oversample and average engine for this channel. The
+   * value is scaled to units of Volts using the calibrated scaling data from getLSBWeight() and
+   * getOffset(). Using oversampling will cause this value to be higher resolution, but it will
+   * update more slowly. Using averaging will cause this value to be more stable, but it will update
+   * more slowly.
+   *
+   * @return A scaled sample from the output of the oversample and average engine for this channel.
+   */
+  public double getAverageVoltage() {
+    return AnalogJNI.getAnalogAverageVoltage(m_port);
+  }
+
+  /**
+   * Get the factory scaling least significant bit weight constant. The least significant bit weight
+   * constant for the channel that was calibrated in manufacturing and stored in an eeprom.
+   *
+   * <p>Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
+   *
+   * @return Least significant bit weight.
+   */
+  public long getLSBWeight() {
+    return AnalogJNI.getAnalogLSBWeight(m_port);
+  }
+
+  /**
+   * Get the factory scaling offset constant. The offset constant for the channel that was
+   * calibrated in manufacturing and stored in an eeprom.
+   *
+   * <p>Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
+   *
+   * @return Offset constant.
+   */
+  public int getOffset() {
+    return AnalogJNI.getAnalogOffset(m_port);
+  }
+
+  /**
+   * Get the channel number.
+   *
+   * @return The channel number.
+   */
+  public int getChannel() {
+    return m_channel;
+  }
+
+  /**
+   * Set the number of averaging bits. This sets the number of averaging bits. The actual number of
+   * averaged samples is 2^bits. The averaging is done automatically in the FPGA.
+   *
+   * @param bits The number of averaging bits.
+   */
+  public void setAverageBits(final int bits) {
+    AnalogJNI.setAnalogAverageBits(m_port, bits);
+  }
+
+  /**
+   * Get the number of averaging bits. This gets the number of averaging bits from the FPGA. The
+   * actual number of averaged samples is 2^bits. The averaging is done automatically in the FPGA.
+   *
+   * @return The number of averaging bits.
+   */
+  public int getAverageBits() {
+    return AnalogJNI.getAnalogAverageBits(m_port);
+  }
+
+  /**
+   * Set the number of oversample bits. This sets the number of oversample bits. The actual number
+   * of oversampled values is 2^bits. The oversampling is done automatically in the FPGA.
+   *
+   * @param bits The number of oversample bits.
+   */
+  public void setOversampleBits(final int bits) {
+    AnalogJNI.setAnalogOversampleBits(m_port, bits);
+  }
+
+  /**
+   * Get the number of oversample bits. This gets the number of oversample bits from the FPGA. The
+   * actual number of oversampled values is 2^bits. The oversampling is done automatically in the
+   * FPGA.
+   *
+   * @return The number of oversample bits.
+   */
+  public int getOversampleBits() {
+    return AnalogJNI.getAnalogOversampleBits(m_port);
+  }
+
+  /**
+   * Initialize the accumulator.
+   */
+  public void initAccumulator() {
+    if (!isAccumulatorChannel()) {
+      throw new AllocationException("Accumulators are only available on slot " + kAccumulatorSlot
+          + " on channels " + kAccumulatorChannels[0] + ", " + kAccumulatorChannels[1]);
+    }
+    m_accumulatorOffset = 0;
+    AnalogJNI.initAccumulator(m_port);
+  }
+
+  /**
+   * Set an initial value for the accumulator.
+   *
+   * <p>This will be added to all values returned to the user.
+   *
+   * @param initialValue The value that the accumulator should start from when reset.
+   */
+  public void setAccumulatorInitialValue(long initialValue) {
+    m_accumulatorOffset = initialValue;
+  }
+
+  /**
+   * Resets the accumulator to the initial value.
+   */
+  public void resetAccumulator() {
+    AnalogJNI.resetAccumulator(m_port);
+
+    // Wait until the next sample, so the next call to getAccumulator*()
+    // won't have old values.
+    final double sampleTime = 1.0 / getGlobalSampleRate();
+    final double overSamples = 1 << getOversampleBits();
+    final double averageSamples = 1 << getAverageBits();
+    Timer.delay(sampleTime * overSamples * averageSamples);
+
+  }
+
+  /**
+   * Set the center value of the accumulator.
+   *
+   * <p>The center value is subtracted from each A/D value before it is added to the accumulator.
+   * This is used for the center value of devices like gyros and accelerometers to take the device
+   * offset into account when integrating.
+   *
+   * <p>This center value is based on the output of the oversampled and averaged source the
+   * accumulator channel. Because of this, any non-zero oversample bits will affect the size of the
+   * value for this field.
+   */
+  public void setAccumulatorCenter(int center) {
+    AnalogJNI.setAccumulatorCenter(m_port, center);
+  }
+
+  /**
+   * Set the accumulator's deadband.
+   *
+   * @param deadband The deadband size in ADC codes (12-bit value)
+   */
+  public void setAccumulatorDeadband(int deadband) {
+    AnalogJNI.setAccumulatorDeadband(m_port, deadband);
+  }
+
+  /**
+   * Read the accumulated value.
+   *
+   * <p>Read the value that has been accumulating. The accumulator is attached after the oversample
+   * and average engine.
+   *
+   * @return The 64-bit value accumulated since the last Reset().
+   */
+  public long getAccumulatorValue() {
+    return AnalogJNI.getAccumulatorValue(m_port) + m_accumulatorOffset;
+  }
+
+  /**
+   * Read the number of accumulated values.
+   *
+   * <p>Read the count of the accumulated values since the accumulator was last Reset().
+   *
+   * @return The number of times samples from the channel were accumulated.
+   */
+  public long getAccumulatorCount() {
+    return AnalogJNI.getAccumulatorCount(m_port);
+  }
+
+  /**
+   * Read the accumulated value and the number of accumulated values atomically.
+   *
+   * <p>This function reads the value and count from the FPGA atomically. This can be used for
+   * averaging.
+   *
+   * @param result AccumulatorResult object to store the results in.
+   */
+  public void getAccumulatorOutput(AccumulatorResult result) {
+    if (result == null) {
+      throw new IllegalArgumentException("Null parameter `result'");
+    }
+    if (!isAccumulatorChannel()) {
+      throw new IllegalArgumentException(
+          "Channel " + m_channel + " is not an accumulator channel.");
+    }
+    AnalogJNI.getAccumulatorOutput(m_port, result);
+    result.value += m_accumulatorOffset;
+  }
+
+  /**
+   * Is the channel attached to an accumulator.
+   *
+   * @return The analog channel is attached to an accumulator.
+   */
+  public boolean isAccumulatorChannel() {
+    for (int channel : kAccumulatorChannels) {
+      if (m_channel == channel) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Set the sample rate per channel.
+   *
+   * <p>This is a global setting for all channels. The maximum rate is 500kS/s divided by the number
+   * of channels in use. This is 62500 samples/s per channel if all 8 channels are used.
+   *
+   * @param samplesPerSecond The number of samples per second.
+   */
+  public static void setGlobalSampleRate(final double samplesPerSecond) {
+    AnalogJNI.setAnalogSampleRate(samplesPerSecond);
+  }
+
+  /**
+   * Get the current sample rate.
+   *
+   * <p>This assumes one entry in the scan list. This is a global setting for all channels.
+   *
+   * @return Sample rate.
+   */
+  public static double getGlobalSampleRate() {
+    return AnalogJNI.getAnalogSampleRate();
+  }
+
+  @Override
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    m_pidSource = pidSource;
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  /**
+   * Get the average voltage for use with PIDController.
+   *
+   * @return the average voltage
+   */
+  @Override
+  public double pidGet() {
+    return getAverageVoltage();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Analog Input");
+    builder.addDoubleProperty("Value", this::getAverageVoltage, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java
new file mode 100644
index 0000000..e354234
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogOutput.java
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.AnalogJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Analog output class.
+ */
+public class AnalogOutput extends SendableBase implements Sendable {
+  private int m_port;
+  private int m_channel;
+
+  /**
+   * Construct an analog output on a specified MXP channel.
+   *
+   * @param channel The channel number to represent.
+   */
+  public AnalogOutput(final int channel) {
+    SensorBase.checkAnalogOutputChannel(channel);
+    m_channel = channel;
+
+    final int portHandle = AnalogJNI.getPort((byte) channel);
+    m_port = AnalogJNI.initializeAnalogOutputPort(portHandle);
+
+    HAL.report(tResourceType.kResourceType_AnalogOutput, channel);
+    setName("AnalogOutput", channel);
+  }
+
+  /**
+   * Channel destructor.
+   */
+  @Override
+  public void free() {
+    super.free();
+    AnalogJNI.freeAnalogOutputPort(m_port);
+    m_port = 0;
+    m_channel = 0;
+  }
+
+  /**
+   * Get the channel of this AnalogOutput.
+   */
+  public int getChannel() {
+    return m_channel;
+  }
+
+  public void setVoltage(double voltage) {
+    AnalogJNI.setAnalogOutput(m_port, voltage);
+  }
+
+  public double getVoltage() {
+    return AnalogJNI.getAnalogOutput(m_port);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Analog Output");
+    builder.addDoubleProperty("Value", this::getVoltage, this::setVoltage);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogPotentiometer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogPotentiometer.java
new file mode 100644
index 0000000..d2ae80b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogPotentiometer.java
@@ -0,0 +1,169 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.interfaces.Potentiometer;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Class for reading analog potentiometers. Analog potentiometers read in an analog voltage that
+ * corresponds to a position. The position is in whichever units you choose, by way of the scaling
+ * and offset constants passed to the constructor.
+ */
+public class AnalogPotentiometer extends SensorBase implements Potentiometer, Sendable {
+  private AnalogInput m_analogInput;
+  private boolean m_initAnalogInput;
+  private double m_fullRange;
+  private double m_offset;
+  protected PIDSourceType m_pidSource = PIDSourceType.kDisplacement;
+
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
+   * have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
+   * 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
+   * point after scaling is 135 degrees. This will calculate the result from the fullRange times
+   * the fraction of the supply voltage, plus the offset.
+   *
+   * @param channel   The analog channel this potentiometer is plugged into.
+   * @param fullRange The scaling to multiply the fraction by to get a meaningful unit.
+   * @param offset    The offset to add to the scaled value for controlling the zero value
+   */
+  public AnalogPotentiometer(final int channel, double fullRange, double offset) {
+    this(new AnalogInput(channel), fullRange, offset);
+    m_initAnalogInput = true;
+    addChild(m_analogInput);
+  }
+
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
+   * have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
+   * 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
+   * point after scaling is 135 degrees. This will calculate the result from the fullRange times
+   * the fraction of the supply voltage, plus the offset.
+   *
+   * @param input     The {@link AnalogInput} this potentiometer is plugged into.
+   * @param fullRange The scaling to multiply the fraction by to get a meaningful unit.
+   * @param offset    The offset to add to the scaled value for controlling the zero value
+   */
+  public AnalogPotentiometer(final AnalogInput input, double fullRange, double offset) {
+    setName("AnalogPotentiometer", input.getChannel());
+    m_analogInput = input;
+    m_initAnalogInput = false;
+
+    m_fullRange = fullRange;
+    m_offset = offset;
+  }
+
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
+   * have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
+   * 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
+   * point after scaling is 135 degrees.
+   *
+   * @param channel The analog channel this potentiometer is plugged into.
+   * @param scale   The scaling to multiply the voltage by to get a meaningful unit.
+   */
+  public AnalogPotentiometer(final int channel, double scale) {
+    this(channel, scale, 0);
+  }
+
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
+   * have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
+   * 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
+   * point after scaling is 135 degrees.
+   *
+   * @param input The {@link AnalogInput} this potentiometer is plugged into.
+   * @param scale The scaling to multiply the voltage by to get a meaningful unit.
+   */
+  public AnalogPotentiometer(final AnalogInput input, double scale) {
+    this(input, scale, 0);
+  }
+
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * @param channel The analog channel this potentiometer is plugged into.
+   */
+  public AnalogPotentiometer(final int channel) {
+    this(channel, 1, 0);
+  }
+
+  /**
+   * AnalogPotentiometer constructor.
+   *
+   * @param input The {@link AnalogInput} this potentiometer is plugged into.
+   */
+  public AnalogPotentiometer(final AnalogInput input) {
+    this(input, 1, 0);
+  }
+
+  /**
+   * Get the current reading of the potentiometer.
+   *
+   * @return The current position of the potentiometer.
+   */
+  @Override
+  public double get() {
+    if (m_analogInput == null) {
+      return m_offset;
+    }
+    return (m_analogInput.getVoltage() / RobotController.getVoltage5V()) * m_fullRange + m_offset;
+  }
+
+  @Override
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    if (!pidSource.equals(PIDSourceType.kDisplacement)) {
+      throw new IllegalArgumentException("Only displacement PID is allowed for potentiometers.");
+    }
+    m_pidSource = pidSource;
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  /**
+   * Implement the PIDSource interface.
+   *
+   * @return The current reading.
+   */
+  @Override
+  public double pidGet() {
+    return get();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    if (m_analogInput != null) {
+      m_analogInput.initSendable(builder);
+    }
+  }
+
+  /**
+   * Frees this resource.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_initAnalogInput) {
+      m_analogInput.free();
+      m_analogInput = null;
+      m_initAnalogInput = false;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTrigger.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTrigger.java
new file mode 100644
index 0000000..f7f7c1e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTrigger.java
@@ -0,0 +1,186 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import edu.wpi.first.wpilibj.AnalogTriggerOutput.AnalogTriggerType;
+import edu.wpi.first.wpilibj.hal.AnalogJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+import edu.wpi.first.wpilibj.util.BoundaryException;
+
+/**
+ * Class for creating and configuring Analog Triggers.
+ */
+public class AnalogTrigger extends SensorBase implements Sendable {
+  /**
+   * Exceptions dealing with improper operation of the Analog trigger.
+   */
+  public class AnalogTriggerException extends RuntimeException {
+    /**
+     * Create a new exception with the given message.
+     *
+     * @param message the message to pass with the exception
+     */
+    public AnalogTriggerException(String message) {
+      super(message);
+    }
+
+  }
+
+  /**
+   * Where the analog trigger is attached.
+   */
+  protected int m_port;
+  protected int m_index;
+  protected AnalogInput m_analogInput = null;
+  protected boolean m_ownsAnalog = false;
+
+  /**
+   * Constructor for an analog trigger given a channel number.
+   *
+   * @param channel the port to use for the analog trigger
+   */
+  public AnalogTrigger(final int channel) {
+    this(new AnalogInput(channel));
+    m_ownsAnalog = true;
+    addChild(m_analogInput);
+  }
+
+  /**
+   * Construct an analog trigger given an analog channel. This should be used in the case of sharing
+   * an analog channel between the trigger and an analog input object.
+   *
+   * @param channel the AnalogInput to use for the analog trigger
+   */
+  public AnalogTrigger(AnalogInput channel) {
+    m_analogInput = channel;
+    ByteBuffer index = ByteBuffer.allocateDirect(4);
+    index.order(ByteOrder.LITTLE_ENDIAN);
+
+    m_port =
+        AnalogJNI.initializeAnalogTrigger(channel.m_port, index.asIntBuffer());
+    m_index = index.asIntBuffer().get(0);
+
+    HAL.report(tResourceType.kResourceType_AnalogTrigger, channel.getChannel());
+    setName("AnalogTrigger", channel.getChannel());
+  }
+
+  /**
+   * Release the resources used by this object.
+   */
+  @Override
+  public void free() {
+    super.free();
+    AnalogJNI.cleanAnalogTrigger(m_port);
+    m_port = 0;
+    if (m_ownsAnalog && m_analogInput != null) {
+      m_analogInput.free();
+    }
+  }
+
+  /**
+   * Set the upper and lower limits of the analog trigger. The limits are given in ADC codes. If
+   * oversampling is used, the units must be scaled appropriately.
+   *
+   * @param lower the lower raw limit
+   * @param upper the upper raw limit
+   */
+  public void setLimitsRaw(final int lower, final int upper) {
+    if (lower > upper) {
+      throw new BoundaryException("Lower bound is greater than upper");
+    }
+    AnalogJNI.setAnalogTriggerLimitsRaw(m_port, lower, upper);
+  }
+
+  /**
+   * Set the upper and lower limits of the analog trigger. The limits are given as floating point
+   * voltage values.
+   *
+   * @param lower the lower voltage limit
+   * @param upper the upper voltage limit
+   */
+  public void setLimitsVoltage(double lower, double upper) {
+    if (lower > upper) {
+      throw new BoundaryException("Lower bound is greater than upper bound");
+    }
+    AnalogJNI.setAnalogTriggerLimitsVoltage(m_port, lower, upper);
+  }
+
+  /**
+   * Configure the analog trigger to use the averaged vs. raw values. If the value is true, then the
+   * averaged value is selected for the analog trigger, otherwise the immediate value is used.
+   *
+   * @param useAveragedValue true to use an averaged value, false otherwise
+   */
+  public void setAveraged(boolean useAveragedValue) {
+    AnalogJNI.setAnalogTriggerAveraged(m_port, useAveragedValue);
+  }
+
+  /**
+   * Configure the analog trigger to use a filtered value. The analog trigger will operate with a 3
+   * point average rejection filter. This is designed to help with 360 degree pot applications for
+   * the period where the pot crosses through zero.
+   *
+   * @param useFilteredValue true to use a filtered value, false otherwise
+   */
+  public void setFiltered(boolean useFilteredValue) {
+    AnalogJNI.setAnalogTriggerFiltered(m_port, useFilteredValue);
+  }
+
+  /**
+   * Return the index of the analog trigger. This is the FPGA index of this analog trigger
+   * instance.
+   *
+   * @return The index of the analog trigger.
+   */
+  public int getIndex() {
+    return m_index;
+  }
+
+  /**
+   * Return the InWindow output of the analog trigger. True if the analog input is between the upper
+   * and lower limits.
+   *
+   * @return The InWindow output of the analog trigger.
+   */
+  public boolean getInWindow() {
+    return AnalogJNI.getAnalogTriggerInWindow(m_port);
+  }
+
+  /**
+   * Return the TriggerState output of the analog trigger. True if above upper limit. False if below
+   * lower limit. If in Hysteresis, maintain previous state.
+   *
+   * @return The TriggerState output of the analog trigger.
+   */
+  public boolean getTriggerState() {
+    return AnalogJNI.getAnalogTriggerTriggerState(m_port);
+  }
+
+  /**
+   * Creates an AnalogTriggerOutput object. Gets an output object that can be used for routing.
+   * Caller is responsible for deleting the AnalogTriggerOutput object.
+   *
+   * @param type An enum of the type of output object to create.
+   * @return A pointer to a new AnalogTriggerOutput object.
+   */
+  public AnalogTriggerOutput createOutput(AnalogTriggerType type) {
+    return new AnalogTriggerOutput(this, type);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    if (m_ownsAnalog) {
+      m_analogInput.initSendable(builder);
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java
new file mode 100644
index 0000000..ade6c9f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/AnalogTriggerOutput.java
@@ -0,0 +1,128 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.AnalogJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Class to represent a specific output from an analog trigger. This class is used to get the
+ * current output value and also as a DigitalSource to provide routing of an output to digital
+ * subsystems on the FPGA such as Counter, Encoder, and Interrupt.
+ *
+ * <p>The TriggerState output indicates the primary output value of the trigger. If the analog
+ * signal is less than the lower limit, the output is false. If the analog value is greater than the
+ * upper limit, then the output is true. If the analog value is in between, then the trigger output
+ * state maintains its most recent value.
+ *
+ * <p>The InWindow output indicates whether or not the analog signal is inside the range defined by
+ * the limits.
+ *
+ * <p>The RisingPulse and FallingPulse outputs detect an instantaneous transition from above the
+ * upper limit to below the lower limit, and vise versa. These pulses represent a rollover condition
+ * of a sensor and can be routed to an up / down counter or to interrupts. Because the outputs
+ * generate a pulse, they cannot be read directly. To help ensure that a rollover condition is not
+ * missed, there is an average rejection filter available that operates on the upper 8 bits of a 12
+ * bit number and selects the nearest outlier of 3 samples. This will reject a sample that is (due
+ * to averaging or sampling) errantly between the two limits. This filter will fail if more than one
+ * sample in a row is errantly in between the two limits. You may see this problem if attempting to
+ * use this feature with a mechanical rollover sensor, such as a 360 degree no-stop potentiometer
+ * without signal conditioning, because the rollover transition is not sharp / clean enough. Using
+ * the averaging engine may help with this, but rotational speeds of the sensor will then be
+ * limited.
+ */
+public class AnalogTriggerOutput extends DigitalSource {
+  /**
+   * Exceptions dealing with improper operation of the Analog trigger output.
+   */
+  public class AnalogTriggerOutputException extends RuntimeException {
+    /**
+     * Create a new exception with the given message.
+     *
+     * @param message the message to pass with the exception
+     */
+    public AnalogTriggerOutputException(String message) {
+      super(message);
+    }
+  }
+
+  private final AnalogTrigger m_trigger;
+  private final AnalogTriggerType m_outputType;
+
+  /**
+   * Create an object that represents one of the four outputs from an analog trigger.
+   *
+   * <p>Because this class derives from DigitalSource, it can be passed into routing functions for
+   * Counter, Encoder, etc.
+   *
+   * @param trigger    The trigger for which this is an output.
+   * @param outputType An enum that specifies the output on the trigger to represent.
+   */
+  public AnalogTriggerOutput(AnalogTrigger trigger, final AnalogTriggerType outputType) {
+    requireNonNull(trigger, "Analog Trigger given was null");
+    requireNonNull(outputType, "Analog Trigger Type given was null");
+
+    m_trigger = trigger;
+    m_outputType = outputType;
+    HAL.report(tResourceType.kResourceType_AnalogTriggerOutput,
+        trigger.getIndex(), outputType.value);
+  }
+
+  /**
+   * Get the state of the analog trigger output.
+   *
+   * @return The state of the analog trigger output.
+   */
+  public boolean get() {
+    return AnalogJNI.getAnalogTriggerOutput(m_trigger.m_port, m_outputType.value);
+  }
+
+  @Override
+  public int getPortHandleForRouting() {
+    return m_trigger.m_port;
+  }
+
+  @Override
+  public int getAnalogTriggerTypeForRouting() {
+    return m_outputType.value;
+  }
+
+  @Override
+  public int getChannel() {
+    return m_trigger.m_index;
+  }
+
+  @Override
+  public boolean isAnalogTrigger() {
+    return true;
+  }
+
+  /**
+   * Defines the state in which the AnalogTrigger triggers.
+   */
+  public enum AnalogTriggerType {
+    kInWindow(AnalogJNI.AnalogTriggerType.kInWindow), kState(AnalogJNI.AnalogTriggerType.kState),
+    kRisingPulse(AnalogJNI.AnalogTriggerType.kRisingPulse),
+    kFallingPulse(AnalogJNI.AnalogTriggerType.kFallingPulse);
+
+    @SuppressWarnings("MemberName")
+    private final int value;
+
+    AnalogTriggerType(int value) {
+      this.value = value;
+    }
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/BuiltInAccelerometer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/BuiltInAccelerometer.java
new file mode 100644
index 0000000..ec46b9a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/BuiltInAccelerometer.java
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.AccelerometerJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.interfaces.Accelerometer;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Built-in accelerometer.
+ *
+ * <p>This class allows access to the roboRIO's internal accelerometer.
+ */
+public class BuiltInAccelerometer extends SensorBase implements Accelerometer, Sendable {
+  /**
+   * Constructor.
+   *
+   * @param range The range the accelerometer will measure
+   */
+  public BuiltInAccelerometer(Range range) {
+    setRange(range);
+    HAL.report(tResourceType.kResourceType_Accelerometer, 0, 0, "Built-in accelerometer");
+    setName("BuiltInAccel", 0);
+  }
+
+  /**
+   * Constructor. The accelerometer will measure +/-8 g-forces
+   */
+  public BuiltInAccelerometer() {
+    this(Range.k8G);
+  }
+
+  @Override
+  public void setRange(Range range) {
+    AccelerometerJNI.setAccelerometerActive(false);
+
+    switch (range) {
+      case k2G:
+        AccelerometerJNI.setAccelerometerRange(0);
+        break;
+      case k4G:
+        AccelerometerJNI.setAccelerometerRange(1);
+        break;
+      case k8G:
+        AccelerometerJNI.setAccelerometerRange(2);
+        break;
+      case k16G:
+      default:
+        throw new IllegalArgumentException(range + " range not supported (use k2G, k4G, or k8G)");
+
+    }
+
+    AccelerometerJNI.setAccelerometerActive(true);
+  }
+
+  /**
+   * The acceleration in the X axis.
+   *
+   * @return The acceleration of the roboRIO along the X axis in g-forces
+   */
+  @Override
+  public double getX() {
+    return AccelerometerJNI.getAccelerometerX();
+  }
+
+  /**
+   * The acceleration in the Y axis.
+   *
+   * @return The acceleration of the roboRIO along the Y axis in g-forces
+   */
+  @Override
+  public double getY() {
+    return AccelerometerJNI.getAccelerometerY();
+  }
+
+  /**
+   * The acceleration in the Z axis.
+   *
+   * @return The acceleration of the roboRIO along the Z axis in g-forces
+   */
+  @Override
+  public double getZ() {
+    return AccelerometerJNI.getAccelerometerZ();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("3AxisAccelerometer");
+    builder.addDoubleProperty("X", this::getX, null);
+    builder.addDoubleProperty("Y", this::getY, null);
+    builder.addDoubleProperty("Z", this::getZ, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java
new file mode 100644
index 0000000..fc596ee
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CameraServer.java
@@ -0,0 +1,768 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.cscore.AxisCamera;
+import edu.wpi.cscore.CameraServerJNI;
+import edu.wpi.cscore.CvSink;
+import edu.wpi.cscore.CvSource;
+import edu.wpi.cscore.MjpegServer;
+import edu.wpi.cscore.UsbCamera;
+import edu.wpi.cscore.VideoEvent;
+import edu.wpi.cscore.VideoException;
+import edu.wpi.cscore.VideoListener;
+import edu.wpi.cscore.VideoMode;
+import edu.wpi.cscore.VideoMode.PixelFormat;
+import edu.wpi.cscore.VideoProperty;
+import edu.wpi.cscore.VideoSink;
+import edu.wpi.cscore.VideoSource;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.networktables.EntryListenerFlags;
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.ArrayList;
+import java.util.Hashtable;
+
+/**
+ * Singleton class for creating and keeping camera servers.
+ * Also publishes camera information to NetworkTables.
+ */
+public class CameraServer {
+  public static final int kBasePort = 1181;
+
+  @Deprecated
+  public static final int kSize640x480 = 0;
+  @Deprecated
+  public static final int kSize320x240 = 1;
+  @Deprecated
+  public static final int kSize160x120 = 2;
+
+  private static final String kPublishName = "/CameraPublisher";
+  private static CameraServer server;
+
+  /**
+   * Get the CameraServer instance.
+   */
+  public static synchronized CameraServer getInstance() {
+    if (server == null) {
+      server = new CameraServer();
+    }
+    return server;
+  }
+
+  private AtomicInteger m_defaultUsbDevice;
+  private String m_primarySourceName;
+  private final Hashtable<String, VideoSource> m_sources;
+  private final Hashtable<String, VideoSink> m_sinks;
+  private final Hashtable<Integer, NetworkTable> m_tables;  // indexed by source handle
+  private final NetworkTable m_publishTable;
+  private final VideoListener m_videoListener; //NOPMD
+  private final int m_tableListener; //NOPMD
+  private int m_nextPort;
+  private String[] m_addresses;
+
+  @SuppressWarnings("JavadocMethod")
+  private static String makeSourceValue(int source) {
+    switch (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))) {
+      case kUsb:
+        return "usb:" + CameraServerJNI.getUsbCameraPath(source);
+      case kHttp: {
+        String[] urls = CameraServerJNI.getHttpCameraUrls(source);
+        if (urls.length > 0) {
+          return "ip:" + urls[0];
+        } else {
+          return "ip:";
+        }
+      }
+      case kCv:
+        // FIXME: Should be "cv:", but LabVIEW dashboard requires "usb:".
+        // https://github.com/wpilibsuite/allwpilib/issues/407
+        return "usb:";
+      default:
+        return "unknown:";
+    }
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  private static String makeStreamValue(String address, int port) {
+    return "mjpg:http://" + address + ":" + port + "/?action=stream";
+  }
+
+  @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+  private synchronized String[] getSinkStreamValues(int sink) {
+    // Ignore all but MjpegServer
+    if (VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink)) != VideoSink.Kind.kMjpeg) {
+      return new String[0];
+    }
+
+    // Get port
+    int port = CameraServerJNI.getMjpegServerPort(sink);
+
+    // Generate values
+    ArrayList<String> values = new ArrayList<>(m_addresses.length + 1);
+    String listenAddress = CameraServerJNI.getMjpegServerListenAddress(sink);
+    if (!listenAddress.isEmpty()) {
+      // If a listen address is specified, only use that
+      values.add(makeStreamValue(listenAddress, port));
+    } else {
+      // Otherwise generate for hostname and all interface addresses
+      values.add(makeStreamValue(CameraServerJNI.getHostname() + ".local", port));
+      for (String addr : m_addresses) {
+        if (addr.equals("127.0.0.1")) {
+          continue;  // ignore localhost
+        }
+        values.add(makeStreamValue(addr, port));
+      }
+    }
+
+    return values.toArray(new String[0]);
+  }
+
+  @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+  private synchronized String[] getSourceStreamValues(int source) {
+    // Ignore all but HttpCamera
+    if (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))
+            != VideoSource.Kind.kHttp) {
+      return new String[0];
+    }
+
+    // Generate values
+    String[] values = CameraServerJNI.getHttpCameraUrls(source);
+    for (int j = 0; j < values.length; j++) {
+      values[j] = "mjpg:" + values[j];
+    }
+
+    // Look to see if we have a passthrough server for this source
+    for (VideoSink i : m_sinks.values()) {
+      int sink = i.getHandle();
+      int sinkSource = CameraServerJNI.getSinkSource(sink);
+      if (source == sinkSource
+          && VideoSink.getKindFromInt(CameraServerJNI.getSinkKind(sink)) == VideoSink.Kind.kMjpeg) {
+        // Add USB-only passthrough
+        String[] finalValues = new String[values.length + 1];
+        for (int j = 0; j < values.length; j++) {
+          finalValues[j] = values[j];
+        }
+        int port = CameraServerJNI.getMjpegServerPort(sink);
+        finalValues[values.length] = makeStreamValue("172.22.11.2", port);
+        return finalValues;
+      }
+    }
+
+    return values;
+  }
+
+  @SuppressWarnings({"JavadocMethod", "PMD.AvoidUsingHardCodedIP"})
+  private synchronized void updateStreamValues() {
+    // Over all the sinks...
+    for (VideoSink i : m_sinks.values()) {
+      int sink = i.getHandle();
+
+      // Get the source's subtable (if none exists, we're done)
+      int source = CameraServerJNI.getSinkSource(sink);
+      if (source == 0) {
+        continue;
+      }
+      NetworkTable table = m_tables.get(source);
+      if (table != null) {
+        // Don't set stream values if this is a HttpCamera passthrough
+        if (VideoSource.getKindFromInt(CameraServerJNI.getSourceKind(source))
+            == VideoSource.Kind.kHttp) {
+          continue;
+        }
+
+        // Set table value
+        String[] values = getSinkStreamValues(sink);
+        if (values.length > 0) {
+          table.getEntry("streams").setStringArray(values);
+        }
+      }
+    }
+
+    // Over all the sources...
+    for (VideoSource i : m_sources.values()) {
+      int source = i.getHandle();
+
+      // Get the source's subtable (if none exists, we're done)
+      NetworkTable table = m_tables.get(source);
+      if (table != null) {
+        // Set table value
+        String[] values = getSourceStreamValues(source);
+        if (values.length > 0) {
+          table.getEntry("streams").setStringArray(values);
+        }
+      }
+    }
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  private static String pixelFormatToString(PixelFormat pixelFormat) {
+    switch (pixelFormat) {
+      case kMJPEG:
+        return "MJPEG";
+      case kYUYV:
+        return "YUYV";
+      case kRGB565:
+        return "RGB565";
+      case kBGR:
+        return "BGR";
+      case kGray:
+        return "Gray";
+      default:
+        return "Unknown";
+    }
+  }
+
+  /// Provide string description of video mode.
+  /// The returned string is "{width}x{height} {format} {fps} fps".
+  @SuppressWarnings("JavadocMethod")
+  private static String videoModeToString(VideoMode mode) {
+    return mode.width + "x" + mode.height + " " + pixelFormatToString(mode.pixelFormat)
+        + " " + mode.fps + " fps";
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  private static String[] getSourceModeValues(int sourceHandle) {
+    VideoMode[] modes = CameraServerJNI.enumerateSourceVideoModes(sourceHandle);
+    String[] modeStrings = new String[modes.length];
+    for (int i = 0; i < modes.length; i++) {
+      modeStrings[i] = videoModeToString(modes[i]);
+    }
+    return modeStrings;
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  private static void putSourcePropertyValue(NetworkTable table, VideoEvent event, boolean isNew) {
+    String name;
+    String infoName;
+    if (event.name.startsWith("raw_")) {
+      name = "RawProperty/" + event.name;
+      infoName = "RawPropertyInfo/" + event.name;
+    } else {
+      name = "Property/" + event.name;
+      infoName = "PropertyInfo/" + event.name;
+    }
+
+    NetworkTableEntry entry = table.getEntry(name);
+    switch (event.propertyKind) {
+      case kBoolean:
+        if (isNew) {
+          entry.setDefaultBoolean(event.value != 0);
+        } else {
+          entry.setBoolean(event.value != 0);
+        }
+        break;
+      case kInteger:
+      case kEnum:
+        if (isNew) {
+          entry.setDefaultDouble(event.value);
+          table.getEntry(infoName + "/min").setDouble(
+              CameraServerJNI.getPropertyMin(event.propertyHandle));
+          table.getEntry(infoName + "/max").setDouble(
+              CameraServerJNI.getPropertyMax(event.propertyHandle));
+          table.getEntry(infoName + "/step").setDouble(
+              CameraServerJNI.getPropertyStep(event.propertyHandle));
+          table.getEntry(infoName + "/default").setDouble(
+              CameraServerJNI.getPropertyDefault(event.propertyHandle));
+        } else {
+          entry.setDouble(event.value);
+        }
+        break;
+      case kString:
+        if (isNew) {
+          entry.setDefaultString(event.valueStr);
+        } else {
+          entry.setString(event.valueStr);
+        }
+        break;
+      default:
+        break;
+    }
+  }
+
+  @SuppressWarnings({"JavadocMethod", "PMD.UnusedLocalVariable"})
+  private CameraServer() {
+    m_defaultUsbDevice = new AtomicInteger();
+    m_sources = new Hashtable<>();
+    m_sinks = new Hashtable<>();
+    m_tables = new Hashtable<>();
+    m_publishTable = NetworkTableInstance.getDefault().getTable(kPublishName);
+    m_nextPort = kBasePort;
+    m_addresses = new String[0];
+
+    // We publish sources to NetworkTables using the following structure:
+    // "/CameraPublisher/{Source.Name}/" - root
+    // - "source" (string): Descriptive, prefixed with type (e.g. "usb:0")
+    // - "streams" (string array): URLs that can be used to stream data
+    // - "description" (string): Description of the source
+    // - "connected" (boolean): Whether source is connected
+    // - "mode" (string): Current video mode
+    // - "modes" (string array): Available video modes
+    // - "Property/{Property}" - Property values
+    // - "PropertyInfo/{Property}" - Property supporting information
+
+    // Listener for video events
+    m_videoListener = new VideoListener(event -> {
+      switch (event.kind) {
+        case kSourceCreated: {
+          // Create subtable for the camera
+          NetworkTable table = m_publishTable.getSubTable(event.name);
+          m_tables.put(event.sourceHandle, table);
+          table.getEntry("source").setString(makeSourceValue(event.sourceHandle));
+          table.getEntry("description").setString(
+              CameraServerJNI.getSourceDescription(event.sourceHandle));
+          table.getEntry("connected").setBoolean(
+              CameraServerJNI.isSourceConnected(event.sourceHandle));
+          table.getEntry("streams").setStringArray(getSourceStreamValues(event.sourceHandle));
+          try {
+            VideoMode mode = CameraServerJNI.getSourceVideoMode(event.sourceHandle);
+            table.getEntry("mode").setDefaultString(videoModeToString(mode));
+            table.getEntry("modes").setStringArray(getSourceModeValues(event.sourceHandle));
+          } catch (VideoException ex) {
+            // Do nothing. Let the other event handlers update this if there is an error.
+          }
+          break;
+        }
+        case kSourceDestroyed: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            table.getEntry("source").setString("");
+            table.getEntry("streams").setStringArray(new String[0]);
+            table.getEntry("modes").setStringArray(new String[0]);
+          }
+          break;
+        }
+        case kSourceConnected: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            // update the description too (as it may have changed)
+            table.getEntry("description").setString(
+                CameraServerJNI.getSourceDescription(event.sourceHandle));
+            table.getEntry("connected").setBoolean(true);
+          }
+          break;
+        }
+        case kSourceDisconnected: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            table.getEntry("connected").setBoolean(false);
+          }
+          break;
+        }
+        case kSourceVideoModesUpdated: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            table.getEntry("modes").setStringArray(getSourceModeValues(event.sourceHandle));
+          }
+          break;
+        }
+        case kSourceVideoModeChanged: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            table.getEntry("mode").setString(videoModeToString(event.mode));
+          }
+          break;
+        }
+        case kSourcePropertyCreated: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            putSourcePropertyValue(table, event, true);
+          }
+          break;
+        }
+        case kSourcePropertyValueUpdated: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            putSourcePropertyValue(table, event, false);
+          }
+          break;
+        }
+        case kSourcePropertyChoicesUpdated: {
+          NetworkTable table = m_tables.get(event.sourceHandle);
+          if (table != null) {
+            String[] choices = CameraServerJNI.getEnumPropertyChoices(event.propertyHandle);
+            table.getEntry("PropertyInfo/" + event.name + "/choices").setStringArray(choices);
+          }
+          break;
+        }
+        case kSinkSourceChanged:
+        case kSinkCreated:
+        case kSinkDestroyed:
+        case kNetworkInterfacesChanged: {
+          m_addresses = CameraServerJNI.getNetworkInterfaces();
+          updateStreamValues();
+          break;
+        }
+        default:
+          break;
+      }
+    }, 0x4fff, true);
+
+    // Listener for NetworkTable events
+    // We don't currently support changing settings via NT due to
+    // synchronization issues, so just update to current setting if someone
+    // else tries to change it.
+    m_tableListener = NetworkTableInstance.getDefault().addEntryListener(kPublishName + "/",
+      (event) -> {
+        String relativeKey = event.name.substring(kPublishName.length() + 1);
+
+        // get source (sourceName/...)
+        int subKeyIndex = relativeKey.indexOf('/');
+        if (subKeyIndex == -1) {
+          return;
+        }
+        String sourceName = relativeKey.substring(0, subKeyIndex);
+        VideoSource source = m_sources.get(sourceName);
+        if (source == null) {
+          return;
+        }
+
+        // get subkey
+        relativeKey = relativeKey.substring(subKeyIndex + 1);
+
+        // handle standard names
+        String propName;
+        if (relativeKey.equals("mode")) {
+          // reset to current mode
+          event.getEntry().setString(videoModeToString(source.getVideoMode()));
+          return;
+        } else if (relativeKey.startsWith("Property/")) {
+          propName = relativeKey.substring(9);
+        } else if (relativeKey.startsWith("RawProperty/")) {
+          propName = relativeKey.substring(12);
+        } else {
+          return;  // ignore
+        }
+
+        // everything else is a property
+        VideoProperty property = source.getProperty(propName);
+        switch (property.getKind()) {
+          case kNone:
+            return;
+          case kBoolean:
+            // reset to current setting
+            event.getEntry().setBoolean(property.get() != 0);
+            return;
+          case kInteger:
+          case kEnum:
+            // reset to current setting
+            event.getEntry().setDouble(property.get());
+            return;
+          case kString:
+            // reset to current setting
+            event.getEntry().setString(property.getString());
+            return;
+          default:
+            return;
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kUpdate);
+  }
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * <p>You should call this method to see a camera feed on the dashboard.
+   * If you also want to perform vision processing on the roboRIO, use
+   * getVideo() to get access to the camera images.
+   *
+   * <p>The first time this overload is called, it calls
+   * {@link #startAutomaticCapture(int)} with device 0, creating a camera
+   * named "USB Camera 0".  Subsequent calls increment the device number
+   * (e.g. 1, 2, etc).
+   */
+  public UsbCamera startAutomaticCapture() {
+    UsbCamera camera = startAutomaticCapture(m_defaultUsbDevice.getAndIncrement());
+    HAL.report(tResourceType.kResourceType_PCVideoServer, camera.getHandle());
+    return camera;
+  }
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * <p>This overload calls {@link #startAutomaticCapture(String, int)} with
+   * a name of "USB Camera {dev}".
+   *
+   * @param dev The device number of the camera interface
+   */
+  public UsbCamera startAutomaticCapture(int dev) {
+    UsbCamera camera = new UsbCamera("USB Camera " + dev, dev);
+    startAutomaticCapture(camera);
+    HAL.report(tResourceType.kResourceType_PCVideoServer, camera.getHandle());
+    return camera;
+  }
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * @param name The name to give the camera
+   * @param dev The device number of the camera interface
+   */
+  public UsbCamera startAutomaticCapture(String name, int dev) {
+    UsbCamera camera = new UsbCamera(name, dev);
+    startAutomaticCapture(camera);
+    HAL.report(tResourceType.kResourceType_PCVideoServer, camera.getHandle());
+    return camera;
+  }
+
+  /**
+   * Start automatically capturing images to send to the dashboard.
+   *
+   * @param name The name to give the camera
+   * @param path The device path (e.g. "/dev/video0") of the camera
+   */
+  public UsbCamera startAutomaticCapture(String name, String path) {
+    UsbCamera camera = new UsbCamera(name, path);
+    startAutomaticCapture(camera);
+    HAL.report(tResourceType.kResourceType_PCVideoServer, camera.getHandle());
+    return camera;
+  }
+
+  /**
+   * Start automatically capturing images to send to the dashboard from
+   * an existing camera.
+   *
+   * @param camera Camera
+   */
+  public void startAutomaticCapture(VideoSource camera) {
+    addCamera(camera);
+    VideoSink server = addServer("serve_" + camera.getName());
+    server.setSource(camera);
+  }
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * <p>This overload calls {@link #addAxisCamera(String, String)} with
+   * name "Axis Camera".
+   *
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  public AxisCamera addAxisCamera(String host) {
+    return addAxisCamera("Axis Camera", host);
+  }
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * <p>This overload calls {@link #addAxisCamera(String, String[])} with
+   * name "Axis Camera".
+   *
+   * @param hosts Array of Camera host IPs/DNS names
+   */
+  public AxisCamera addAxisCamera(String[] hosts) {
+    return addAxisCamera("Axis Camera", hosts);
+  }
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
+   */
+  public AxisCamera addAxisCamera(String name, String host) {
+    AxisCamera camera = new AxisCamera(name, host);
+    // Create a passthrough MJPEG server for USB access
+    startAutomaticCapture(camera);
+    HAL.report(tResourceType.kResourceType_AxisCamera, camera.getHandle());
+    return camera;
+  }
+
+  /**
+   * Adds an Axis IP camera.
+   *
+   * @param name The name to give the camera
+   * @param hosts Array of Camera host IPs/DNS names
+   */
+  public AxisCamera addAxisCamera(String name, String[] hosts) {
+    AxisCamera camera = new AxisCamera(name, hosts);
+    // Create a passthrough MJPEG server for USB access
+    startAutomaticCapture(camera);
+    HAL.report(tResourceType.kResourceType_AxisCamera, camera.getHandle());
+    return camera;
+  }
+
+  /**
+   * Get OpenCV access to the primary camera feed.  This allows you to
+   * get images from the camera for image processing on the roboRIO.
+   *
+   * <p>This is only valid to call after a camera feed has been added
+   * with startAutomaticCapture() or addServer().
+   */
+  public CvSink getVideo() {
+    VideoSource source;
+    synchronized (this) {
+      if (m_primarySourceName == null) {
+        throw new VideoException("no camera available");
+      }
+      source = m_sources.get(m_primarySourceName);
+    }
+    if (source == null) {
+      throw new VideoException("no camera available");
+    }
+    return getVideo(source);
+  }
+
+  /**
+   * Get OpenCV access to the specified camera.  This allows you to get
+   * images from the camera for image processing on the roboRIO.
+   *
+   * @param camera Camera (e.g. as returned by startAutomaticCapture).
+   */
+  public CvSink getVideo(VideoSource camera) {
+    String name = "opencv_" + camera.getName();
+
+    synchronized (this) {
+      VideoSink sink = m_sinks.get(name);
+      if (sink != null) {
+        VideoSink.Kind kind = sink.getKind();
+        if (kind != VideoSink.Kind.kCv) {
+          throw new VideoException("expected OpenCV sink, but got " + kind);
+        }
+        return (CvSink) sink;
+      }
+    }
+
+    CvSink newsink = new CvSink(name);
+    newsink.setSource(camera);
+    addServer(newsink);
+    return newsink;
+  }
+
+  /**
+   * Get OpenCV access to the specified camera.  This allows you to get
+   * images from the camera for image processing on the roboRIO.
+   *
+   * @param name Camera name
+   */
+  public CvSink getVideo(String name) {
+    VideoSource source;
+    synchronized (this) {
+      source = m_sources.get(name);
+      if (source == null) {
+        throw new VideoException("could not find camera " + name);
+      }
+    }
+    return getVideo(source);
+  }
+
+  /**
+   * Create a MJPEG stream with OpenCV input. This can be called to pass custom
+   * annotated images to the dashboard.
+   *
+   * @param name Name to give the stream
+   * @param width Width of the image being sent
+   * @param height Height of the image being sent
+   */
+  public CvSource putVideo(String name, int width, int height) {
+    CvSource source = new CvSource(name, VideoMode.PixelFormat.kMJPEG, width, height, 30);
+    startAutomaticCapture(source);
+    return source;
+  }
+
+  /**
+   * Adds a MJPEG server at the next available port.
+   *
+   * @param name Server name
+   */
+  public MjpegServer addServer(String name) {
+    int port;
+    synchronized (this) {
+      port = m_nextPort;
+      m_nextPort++;
+    }
+    return addServer(name, port);
+  }
+
+  /**
+   * Adds a MJPEG server.
+   *
+   * @param name Server name
+   */
+  public MjpegServer addServer(String name, int port) {
+    MjpegServer server = new MjpegServer(name, port);
+    addServer(server);
+    return server;
+  }
+
+  /**
+   * Adds an already created server.
+   *
+   * @param server Server
+   */
+  public void addServer(VideoSink server) {
+    synchronized (this) {
+      m_sinks.put(server.getName(), server);
+    }
+  }
+
+  /**
+   * Removes a server by name.
+   *
+   * @param name Server name
+   */
+  public void removeServer(String name) {
+    synchronized (this) {
+      m_sinks.remove(name);
+    }
+  }
+
+  /**
+   * Get server for the primary camera feed.
+   *
+   * <p>This is only valid to call after a camera feed has been added
+   * with startAutomaticCapture() or addServer().
+   */
+  public VideoSink getServer() {
+    synchronized (this) {
+      if (m_primarySourceName == null) {
+        throw new VideoException("no camera available");
+      }
+      return getServer("serve_" + m_primarySourceName);
+    }
+  }
+
+  /**
+   * Gets a server by name.
+   *
+   * @param name Server name
+   */
+  public VideoSink getServer(String name) {
+    synchronized (this) {
+      return m_sinks.get(name);
+    }
+  }
+
+  /**
+   * Adds an already created camera.
+   *
+   * @param camera Camera
+   */
+  public void addCamera(VideoSource camera) {
+    String name = camera.getName();
+    synchronized (this) {
+      if (m_primarySourceName == null) {
+        m_primarySourceName = name;
+      }
+      m_sources.put(name, camera);
+    }
+  }
+
+  /**
+   * Removes a camera by name.
+   *
+   * @param name Camera name
+   */
+  public void removeCamera(String name) {
+    synchronized (this) {
+      m_sources.remove(name);
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CircularBuffer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CircularBuffer.java
new file mode 100644
index 0000000..c7089bb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CircularBuffer.java
@@ -0,0 +1,186 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * This is a simple circular buffer so we don't need to "bucket brigade" copy old values.
+ */
+public class CircularBuffer {
+  private double[] m_data;
+
+  // Index of element at front of buffer
+  private int m_front = 0;
+
+  // Number of elements used in buffer
+  private int m_length = 0;
+
+  /**
+   * Create a CircularBuffer with the provided size.
+   *
+   * @param size The size of the circular buffer.
+   */
+  public CircularBuffer(int size) {
+    m_data = new double[size];
+    for (int i = 0; i < m_data.length; i++) {
+      m_data[i] = 0.0;
+    }
+  }
+
+  /**
+   * Returns number of elements in buffer.
+   *
+   * @return number of elements in buffer
+   */
+  double size() {
+    return m_length;
+  }
+
+  /**
+   * Get value at front of buffer.
+   *
+   * @return value at front of buffer
+   */
+  double getFirst() {
+    return m_data[m_front];
+  }
+
+  /**
+   * Get value at back of buffer.
+   *
+   * @return value at back of buffer
+   */
+  double getLast() {
+    // If there are no elements in the buffer, do nothing
+    if (m_length == 0) {
+      return 0.0;
+    }
+
+    return m_data[(m_front + m_length - 1) % m_data.length];
+  }
+
+  /**
+   * Push new value onto front of the buffer. The value at the back is overwritten if the buffer is
+   * full.
+   */
+  public void addFirst(double value) {
+    if (m_data.length == 0) {
+      return;
+    }
+
+    m_front = moduloDec(m_front);
+
+    m_data[m_front] = value;
+
+    if (m_length < m_data.length) {
+      m_length++;
+    }
+  }
+
+  /**
+   * Push new value onto back of the buffer. The value at the front is overwritten if the buffer is
+   * full.
+   */
+  public void addLast(double value) {
+    if (m_data.length == 0) {
+      return;
+    }
+
+    m_data[(m_front + m_length) % m_data.length] = value;
+
+    if (m_length < m_data.length) {
+      m_length++;
+    } else {
+      // Increment front if buffer is full to maintain size
+      m_front = moduloInc(m_front);
+    }
+  }
+
+  /**
+   * Pop value at front of buffer.
+   *
+   * @return value at front of buffer
+   */
+  public double removeFirst() {
+    // If there are no elements in the buffer, do nothing
+    if (m_length == 0) {
+      return 0.0;
+    }
+
+    double temp = m_data[m_front];
+    m_front = moduloInc(m_front);
+    m_length--;
+    return temp;
+  }
+
+
+  /**
+   * Pop value at back of buffer.
+   */
+  public double removeLast() {
+    // If there are no elements in the buffer, do nothing
+    if (m_length == 0) {
+      return 0.0;
+    }
+
+    m_length--;
+    return m_data[(m_front + m_length) % m_data.length];
+  }
+
+  /**
+   * Resizes internal buffer to given size.
+   *
+   * <p>A new buffer is allocated because arrays are not resizable.
+   */
+  void resize(int size) {
+    double[] newBuffer = new double[size];
+    m_length = Math.min(m_length, size);
+    for (int i = 0; i < m_length; i++) {
+      newBuffer[i] = m_data[(m_front + i) % m_data.length];
+    }
+    m_data = newBuffer;
+    m_front = 0;
+  }
+
+  /**
+   * Sets internal buffer contents to zero.
+   */
+  public void clear() {
+    for (int i = 0; i < m_data.length; i++) {
+      m_data[i] = 0.0;
+    }
+    m_front = 0;
+    m_length = 0;
+  }
+
+  /**
+   * Get the element at the provided index relative to the start of the buffer.
+   *
+   * @return Element at index starting from front of buffer.
+   */
+  public double get(int index) {
+    return m_data[(m_front + index) % m_data.length];
+  }
+
+  /**
+   * Increment an index modulo the length of the m_data buffer.
+   */
+  private int moduloInc(int index) {
+    return (index + 1) % m_data.length;
+  }
+
+  /**
+   * Decrement an index modulo the length of the m_data buffer.
+   */
+  private int moduloDec(int index) {
+    if (index == 0) {
+      return m_data.length - 1;
+    } else {
+      return index - 1;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Compressor.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Compressor.java
new file mode 100644
index 0000000..e0f8c2d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Compressor.java
@@ -0,0 +1,205 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.CompressorJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Class for operating a compressor connected to a PCM (Pneumatic Control Module). The PCM will
+ * automatically run in closed loop mode by default whenever a {@link Solenoid} object is created.
+ * For most cases, a Compressor object does not need to be instantiated or used in a robot program.
+ * This class is only required in cases where the robot program needs a more detailed status of the
+ * compressor or to enable/disable closed loop control.
+ *
+ * <p>Note: you cannot operate the compressor directly from this class as doing so would circumvent
+ * the safety provided by using the pressure switch and closed loop control. You can only turn off
+ * closed loop control, thereby stopping the compressor from operating.
+ */
+public class Compressor extends SendableBase implements Sendable {
+  private int m_compressorHandle;
+  private byte m_module;
+
+  /**
+   * Makes a new instance of the compressor using the provided CAN device ID.  Use this constructor
+   * when you have more than one PCM.
+   *
+   * @param module The PCM CAN device ID (0 - 62 inclusive)
+   */
+  public Compressor(int module) {
+    m_module = (byte) module;
+
+    m_compressorHandle = CompressorJNI.initializeCompressor((byte) module);
+
+    HAL.report(tResourceType.kResourceType_Compressor, module);
+    setName("Compressor", module);
+  }
+
+  /**
+   * Makes a new instance of the compressor using the default PCM ID of 0.
+   *
+   * <p>Additional modules can be supported by making a new instance and {@link #Compressor(int)
+   * specifying the CAN ID.}
+   */
+  public Compressor() {
+    this(SensorBase.getDefaultSolenoidModule());
+  }
+
+  /**
+   * Start the compressor running in closed loop control mode.
+   *
+   * <p>Use the method in cases where you would like to manually stop and start the compressor for
+   * applications such as conserving battery or making sure that the compressor motor doesn't start
+   * during critical operations.
+   */
+  public void start() {
+    setClosedLoopControl(true);
+  }
+
+  /**
+   * Stop the compressor from running in closed loop control mode.
+   *
+   * <p>Use the method in cases where you would like to manually stop and start the compressor for
+   * applications such as conserving battery or making sure that the compressor motor doesn't start
+   * during critical operations.
+   */
+  public void stop() {
+    setClosedLoopControl(false);
+  }
+
+  /**
+   * Get the status of the compressor.
+   *
+   * @return true if the compressor is on
+   */
+  public boolean enabled() {
+    return CompressorJNI.getCompressor(m_compressorHandle);
+  }
+
+  /**
+   * Get the pressure switch value.
+   *
+   * @return true if the pressure is low
+   */
+  public boolean getPressureSwitchValue() {
+    return CompressorJNI.getCompressorPressureSwitch(m_compressorHandle);
+  }
+
+  /**
+   * Get the current being used by the compressor.
+   *
+   * @return current consumed by the compressor in amps
+   */
+  public double getCompressorCurrent() {
+    return CompressorJNI.getCompressorCurrent(m_compressorHandle);
+  }
+
+  /**
+   * Set the PCM in closed loop control mode.
+   *
+   * @param on if true sets the compressor to be in closed loop control mode (default)
+   */
+  public void setClosedLoopControl(boolean on) {
+    CompressorJNI.setCompressorClosedLoopControl(m_compressorHandle, on);
+  }
+
+  /**
+   * Gets the current operating mode of the PCM.
+   *
+   * @return true if compressor is operating on closed-loop mode
+   */
+  public boolean getClosedLoopControl() {
+    return CompressorJNI.getCompressorClosedLoopControl(m_compressorHandle);
+  }
+
+  /**
+   * If PCM is in fault state : Compressor Drive is disabled due to compressor current being too
+   * high.
+   *
+   * @return true if PCM is in fault state.
+   */
+  public boolean getCompressorCurrentTooHighFault() {
+    return CompressorJNI.getCompressorCurrentTooHighFault(m_compressorHandle);
+  }
+
+  /**
+   * If PCM sticky fault is set : Compressor is disabled due to compressor current being too
+   * high.
+   *
+   * @return true if PCM sticky fault is set.
+   */
+  public boolean getCompressorCurrentTooHighStickyFault() {
+    return CompressorJNI.getCompressorCurrentTooHighStickyFault(m_compressorHandle);
+  }
+
+  /**
+   * If PCM sticky fault is set : Compressor output appears to be shorted.
+   *
+   * @return true if PCM sticky fault is set.
+   */
+  public boolean getCompressorShortedStickyFault() {
+    return CompressorJNI.getCompressorShortedStickyFault(m_compressorHandle);
+  }
+
+  /**
+   * If PCM is in fault state : Compressor output appears to be shorted.
+   *
+   * @return true if PCM is in fault state.
+   */
+  public boolean getCompressorShortedFault() {
+    return CompressorJNI.getCompressorShortedFault(m_compressorHandle);
+  }
+
+  /**
+   * If PCM sticky fault is set : Compressor does not appear to be wired, i.e. compressor is not
+   * drawing enough current.
+   *
+   * @return true if PCM sticky fault is set.
+   */
+  public boolean getCompressorNotConnectedStickyFault() {
+    return CompressorJNI.getCompressorNotConnectedStickyFault(m_compressorHandle);
+  }
+
+  /**
+   * If PCM is in fault state : Compressor does not appear to be wired, i.e. compressor is not
+   * drawing enough current.
+   *
+   * @return true if PCM is in fault state.
+   */
+  public boolean getCompressorNotConnectedFault() {
+    return CompressorJNI.getCompressorNotConnectedFault(m_compressorHandle);
+  }
+
+  /**
+   * Clear ALL sticky faults inside PCM that Compressor is wired to.
+   *
+   * <p>If a sticky fault is set, then it will be persistently cleared. The compressor might
+   * momentarily disable while the flags are being cleared. Doo not call this method too
+   * frequently, otherwise normal compressor functionality may be prevented.
+   *
+   * <p>If no sticky faults are set then this call will have no effect.
+   */
+  public void clearAllPCMStickyFaults() {
+    CompressorJNI.clearAllPCMStickyFaults(m_module);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Compressor");
+    builder.addBooleanProperty("Enabled", this::enabled, (value) -> {
+      if (value) {
+        start();
+      } else {
+        stop();
+      }
+    });
+    builder.addBooleanProperty("Pressure switch", this::getPressureSwitchValue, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Controller.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Controller.java
new file mode 100644
index 0000000..fa2c4dc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Controller.java
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * An interface for controllers. Controllers run control loops, the most command are PID controllers
+ * and there variants, but this includes anything that is controlling an actuator in a separate
+ * thread.
+ */
+interface Controller {
+  /**
+   * Allows the control loop to run.
+   */
+  void enable();
+
+  /**
+   * Stops the control loop from running until explicitly re-enabled by calling {@link #enable()}.
+   */
+  void disable();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ControllerPower.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ControllerPower.java
new file mode 100644
index 0000000..fde4ad4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/ControllerPower.java
@@ -0,0 +1,160 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.PowerJNI;
+
+/**
+ * Old Controller PR class.
+ * @deprecated Use RobotController class instead
+ */
+@Deprecated
+public class ControllerPower {
+  /**
+   * Get the input voltage to the robot controller.
+   *
+   * @return The controller input voltage value in Volts
+   */
+  @Deprecated
+  public static double getInputVoltage() {
+    return PowerJNI.getVinVoltage();
+  }
+
+  /**
+   * Get the input current to the robot controller.
+   *
+   * @return The controller input current value in Amps
+   */
+  @Deprecated
+  public static double getInputCurrent() {
+    return PowerJNI.getVinCurrent();
+  }
+
+  /**
+   * Get the voltage of the 3.3V rail.
+   *
+   * @return The controller 3.3V rail voltage value in Volts
+   */
+  @Deprecated
+  public static double getVoltage3V3() {
+    return PowerJNI.getUserVoltage3V3();
+  }
+
+  /**
+   * Get the current output of the 3.3V rail.
+   *
+   * @return The controller 3.3V rail output current value in Volts
+   */
+  @Deprecated
+  public static double getCurrent3V3() {
+    return PowerJNI.getUserCurrent3V3();
+  }
+
+  /**
+   * Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout,
+   * a short circuit on the rail, or controller over-voltage.
+   *
+   * @return The controller 3.3V rail enabled value
+   */
+  @Deprecated
+  public static boolean getEnabled3V3() {
+    return PowerJNI.getUserActive3V3();
+  }
+
+  /**
+   * Get the count of the total current faults on the 3.3V rail since the controller has booted.
+   *
+   * @return The number of faults
+   */
+  @Deprecated
+  public static int getFaultCount3V3() {
+    return PowerJNI.getUserCurrentFaults3V3();
+  }
+
+  /**
+   * Get the voltage of the 5V rail.
+   *
+   * @return The controller 5V rail voltage value in Volts
+   */
+  @Deprecated
+  public static double getVoltage5V() {
+    return PowerJNI.getUserVoltage5V();
+  }
+
+  /**
+   * Get the current output of the 5V rail.
+   *
+   * @return The controller 5V rail output current value in Amps
+   */
+  @Deprecated
+  public static double getCurrent5V() {
+    return PowerJNI.getUserCurrent5V();
+  }
+
+  /**
+   * Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a
+   * short circuit on the rail, or controller over-voltage.
+   *
+   * @return The controller 5V rail enabled value
+   */
+  @Deprecated
+  public static boolean getEnabled5V() {
+    return PowerJNI.getUserActive5V();
+  }
+
+  /**
+   * Get the count of the total current faults on the 5V rail since the controller has booted.
+   *
+   * @return The number of faults
+   */
+  @Deprecated
+  public static int getFaultCount5V() {
+    return PowerJNI.getUserCurrentFaults5V();
+  }
+
+  /**
+   * Get the voltage of the 6V rail.
+   *
+   * @return The controller 6V rail voltage value in Volts
+   */
+  @Deprecated
+  public static double getVoltage6V() {
+    return PowerJNI.getUserVoltage6V();
+  }
+
+  /**
+   * Get the current output of the 6V rail.
+   *
+   * @return The controller 6V rail output current value in Amps
+   */
+  @Deprecated
+  public static double getCurrent6V() {
+    return PowerJNI.getUserCurrent6V();
+  }
+
+  /**
+   * Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a
+   * short circuit on the rail, or controller over-voltage.
+   *
+   * @return The controller 6V rail enabled value
+   */
+  @Deprecated
+  public static boolean getEnabled6V() {
+    return PowerJNI.getUserActive6V();
+  }
+
+  /**
+   * Get the count of the total current faults on the 6V rail since the controller has booted.
+   *
+   * @return The number of faults
+   */
+  @Deprecated
+  public static int getFaultCount6V() {
+    return PowerJNI.getUserCurrentFaults6V();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
new file mode 100644
index 0000000..e0ae1e4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Counter.java
@@ -0,0 +1,561 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+import edu.wpi.first.wpilibj.AnalogTriggerOutput.AnalogTriggerType;
+import edu.wpi.first.wpilibj.hal.CounterJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Class for counting the number of ticks on a digital input channel.
+ *
+ * <p>This is a general purpose class for counting repetitive events. It can return the number of
+ * counts, the period of the most recent cycle, and detect when the signal being counted has
+ * stopped by supplying a maximum cycle time.
+ *
+ * <p>All counters will immediately start counting - reset() them if you need them to be zeroed
+ * before use.
+ */
+public class Counter extends SensorBase implements CounterBase, Sendable, PIDSource {
+  /**
+   * Mode determines how and what the counter counts.
+   */
+  public enum Mode {
+    /**
+     * mode: two pulse.
+     */
+    kTwoPulse(0),
+    /**
+     * mode: semi period.
+     */
+    kSemiperiod(1),
+    /**
+     * mode: pulse length.
+     */
+    kPulseLength(2),
+    /**
+     * mode: external direction.
+     */
+    kExternalDirection(3);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    Mode(int value) {
+      this.value = value;
+    }
+  }
+
+  protected DigitalSource m_upSource; // /< What makes the counter count up.
+  protected DigitalSource m_downSource; // /< What makes the counter count down.
+  private boolean m_allocatedUpSource;
+  private boolean m_allocatedDownSource;
+  private int m_counter; // /< The FPGA counter object.
+  private int m_index; // /< The index of this counter.
+  private PIDSourceType m_pidSource;
+  private double m_distancePerPulse; // distance of travel for each tick
+
+  /**
+   * Create an instance of a counter with the given mode.
+   */
+  public Counter(final Mode mode) {
+    ByteBuffer index = ByteBuffer.allocateDirect(4);
+    // set the byte order
+    index.order(ByteOrder.LITTLE_ENDIAN);
+    m_counter = CounterJNI.initializeCounter(mode.value, index.asIntBuffer());
+    m_index = index.asIntBuffer().get(0);
+
+    m_allocatedUpSource = false;
+    m_allocatedDownSource = false;
+    m_upSource = null;
+    m_downSource = null;
+
+    setMaxPeriod(.5);
+
+    HAL.report(tResourceType.kResourceType_Counter, m_index, mode.value);
+    setName("Counter", m_index);
+  }
+
+  /**
+   * Create an instance of a counter where no sources are selected. Then they all must be selected
+   * by calling functions to specify the upsource and the downsource independently.
+   *
+   * <p>The counter will start counting immediately.
+   */
+  public Counter() {
+    this(Mode.kTwoPulse);
+  }
+
+  /**
+   * Create an instance of a counter from a Digital Input. This is used if an existing digital input
+   * is to be shared by multiple other objects such as encoders or if the Digital Source is not a
+   * DIO channel (such as an Analog Trigger)
+   *
+   * <p>The counter will start counting immediately.
+   *
+   * @param source the digital source to count
+   */
+  public Counter(DigitalSource source) {
+    this();
+
+    requireNonNull(source, "Digital Source given was null");
+    setUpSource(source);
+  }
+
+  /**
+   * Create an instance of a Counter object. Create an up-Counter instance given a channel.
+   *
+   * <p>The counter will start counting immediately.
+   *
+   * @param channel the DIO channel to use as the up source. 0-9 are on-board, 10-25 are on the MXP
+   */
+  public Counter(int channel) {
+    this();
+    setUpSource(channel);
+  }
+
+  /**
+   * Create an instance of a Counter object. Create an instance of a simple up-Counter given an
+   * analog trigger. Use the trigger state output from the analog trigger.
+   *
+   * <p>The counter will start counting immediately.
+   *
+   * @param encodingType which edges to count
+   * @param upSource     first source to count
+   * @param downSource   second source for direction
+   * @param inverted     true to invert the count
+   */
+  public Counter(EncodingType encodingType, DigitalSource upSource, DigitalSource downSource,
+                 boolean inverted) {
+    this(Mode.kExternalDirection);
+
+    requireNonNull(encodingType, "Encoding type given was null");
+    requireNonNull(upSource, "Up Source given was null");
+    requireNonNull(downSource, "Down Source given was null");
+
+    if (encodingType != EncodingType.k1X && encodingType != EncodingType.k2X) {
+      throw new RuntimeException("Counters only support 1X and 2X quadrature decoding!");
+    }
+
+    setUpSource(upSource);
+    setDownSource(downSource);
+
+    if (encodingType == EncodingType.k1X) {
+      setUpSourceEdge(true, false);
+      CounterJNI.setCounterAverageSize(m_counter, 1);
+    } else {
+      setUpSourceEdge(true, true);
+      CounterJNI.setCounterAverageSize(m_counter, 2);
+    }
+
+    setDownSourceEdge(inverted, true);
+  }
+
+  /**
+   * Create an instance of a Counter object. Create an instance of a simple up-Counter given an
+   * analog trigger. Use the trigger state output from the analog trigger.
+   *
+   * <p>The counter will start counting immediately.
+   *
+   * @param trigger the analog trigger to count
+   */
+  public Counter(AnalogTrigger trigger) {
+    this();
+
+    requireNonNull(trigger, "The Analog Trigger given was null");
+
+    setUpSource(trigger.createOutput(AnalogTriggerType.kState));
+  }
+
+  @Override
+  public void free() {
+    super.free();
+    setUpdateWhenEmpty(true);
+
+    clearUpSource();
+    clearDownSource();
+
+    CounterJNI.freeCounter(m_counter);
+
+    m_upSource = null;
+    m_downSource = null;
+    m_counter = 0;
+  }
+
+  /**
+   * The counter's FPGA index.
+   *
+   * @return the Counter's FPGA index
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public int getFPGAIndex() {
+    return m_index;
+  }
+
+  /**
+   * Set the upsource for the counter as a digital input channel.
+   *
+   * @param channel the DIO channel to count 0-9 are on-board, 10-25 are on the MXP
+   */
+  public void setUpSource(int channel) {
+    setUpSource(new DigitalInput(channel));
+    m_allocatedUpSource = true;
+    addChild(m_upSource);
+  }
+
+  /**
+   * Set the source object that causes the counter to count up. Set the up counting DigitalSource.
+   *
+   * @param source the digital source to count
+   */
+  public void setUpSource(DigitalSource source) {
+    if (m_upSource != null && m_allocatedUpSource) {
+      m_upSource.free();
+      m_allocatedUpSource = false;
+    }
+    m_upSource = source;
+    CounterJNI.setCounterUpSource(m_counter, source.getPortHandleForRouting(),
+        source.getAnalogTriggerTypeForRouting());
+  }
+
+  /**
+   * Set the up counting source to be an analog trigger.
+   *
+   * @param analogTrigger The analog trigger object that is used for the Up Source
+   * @param triggerType   The analog trigger output that will trigger the counter.
+   */
+  public void setUpSource(AnalogTrigger analogTrigger, AnalogTriggerType triggerType) {
+    requireNonNull(analogTrigger, "Analog Trigger given was null");
+    requireNonNull(triggerType, "Analog Trigger Type given was null");
+
+    setUpSource(analogTrigger.createOutput(triggerType));
+    m_allocatedUpSource = true;
+  }
+
+  /**
+   * Set the edge sensitivity on an up counting source. Set the up source to either detect rising
+   * edges or falling edges.
+   *
+   * @param risingEdge  true to count rising edge
+   * @param fallingEdge true to count falling edge
+   */
+  public void setUpSourceEdge(boolean risingEdge, boolean fallingEdge) {
+    if (m_upSource == null) {
+      throw new RuntimeException("Up Source must be set before setting the edge!");
+    }
+    CounterJNI.setCounterUpSourceEdge(m_counter, risingEdge, fallingEdge);
+  }
+
+  /**
+   * Disable the up counting source to the counter.
+   */
+  public void clearUpSource() {
+    if (m_upSource != null && m_allocatedUpSource) {
+      m_upSource.free();
+      m_allocatedUpSource = false;
+    }
+    m_upSource = null;
+
+    CounterJNI.clearCounterUpSource(m_counter);
+  }
+
+  /**
+   * Set the down counting source to be a digital input channel.
+   *
+   * @param channel the DIO channel to count 0-9 are on-board, 10-25 are on the MXP
+   */
+  public void setDownSource(int channel) {
+    setDownSource(new DigitalInput(channel));
+    m_allocatedDownSource = true;
+    addChild(m_downSource);
+  }
+
+  /**
+   * Set the source object that causes the counter to count down. Set the down counting
+   * DigitalSource.
+   *
+   * @param source the digital source to count
+   */
+  public void setDownSource(DigitalSource source) {
+    requireNonNull(source, "The Digital Source given was null");
+
+    if (m_downSource != null && m_allocatedDownSource) {
+      m_downSource.free();
+      m_allocatedDownSource = false;
+    }
+    CounterJNI.setCounterDownSource(m_counter, source.getPortHandleForRouting(),
+        source.getAnalogTriggerTypeForRouting());
+    m_downSource = source;
+  }
+
+  /**
+   * Set the down counting source to be an analog trigger.
+   *
+   * @param analogTrigger The analog trigger object that is used for the Down Source
+   * @param triggerType   The analog trigger output that will trigger the counter.
+   */
+  public void setDownSource(AnalogTrigger analogTrigger, AnalogTriggerType triggerType) {
+    requireNonNull(analogTrigger, "Analog Trigger given was null");
+    requireNonNull(triggerType, "Analog Trigger Type given was null");
+
+    setDownSource(analogTrigger.createOutput(triggerType));
+    m_allocatedDownSource = true;
+  }
+
+  /**
+   * Set the edge sensitivity on a down counting source. Set the down source to either detect rising
+   * edges or falling edges.
+   *
+   * @param risingEdge  true to count the rising edge
+   * @param fallingEdge true to count the falling edge
+   */
+  public void setDownSourceEdge(boolean risingEdge, boolean fallingEdge) {
+    requireNonNull(m_downSource, "Down Source must be set before setting the edge!");
+
+    CounterJNI.setCounterDownSourceEdge(m_counter, risingEdge, fallingEdge);
+  }
+
+  /**
+   * Disable the down counting source to the counter.
+   */
+  public void clearDownSource() {
+    if (m_downSource != null && m_allocatedDownSource) {
+      m_downSource.free();
+      m_allocatedDownSource = false;
+    }
+    m_downSource = null;
+
+    CounterJNI.clearCounterDownSource(m_counter);
+  }
+
+  /**
+   * Set standard up / down counting mode on this counter. Up and down counts are sourced
+   * independently from two inputs.
+   */
+  public void setUpDownCounterMode() {
+    CounterJNI.setCounterUpDownMode(m_counter);
+  }
+
+  /**
+   * Set external direction mode on this counter. Counts are sourced on the Up counter input. The
+   * Down counter input represents the direction to count.
+   */
+  public void setExternalDirectionMode() {
+    CounterJNI.setCounterExternalDirectionMode(m_counter);
+  }
+
+  /**
+   * Set Semi-period mode on this counter. Counts up on both rising and falling edges.
+   *
+   * @param highSemiPeriod true to count up on both rising and falling
+   */
+  public void setSemiPeriodMode(boolean highSemiPeriod) {
+    CounterJNI.setCounterSemiPeriodMode(m_counter, highSemiPeriod);
+  }
+
+  /**
+   * Configure the counter to count in up or down based on the length of the input pulse. This mode
+   * is most useful for direction sensitive gear tooth sensors.
+   *
+   * @param threshold The pulse length beyond which the counter counts the opposite direction. Units
+   *                  are seconds.
+   */
+  public void setPulseLengthMode(double threshold) {
+    CounterJNI.setCounterPulseLengthMode(m_counter, threshold);
+  }
+
+  /**
+   * Read the current counter value. Read the value at this instant. It may still be running, so it
+   * reflects the current value. Next time it is read, it might have a different value.
+   */
+  @Override
+  public int get() {
+    return CounterJNI.getCounter(m_counter);
+  }
+
+  /**
+   * Read the current scaled counter value. Read the value at this instant, scaled by the distance
+   * per pulse (defaults to 1).
+   *
+   * @return The distance since the last reset
+   */
+  public double getDistance() {
+    return get() * m_distancePerPulse;
+  }
+
+  /**
+   * Reset the Counter to zero. Set the counter value to zero. This doesn't effect the running state
+   * of the counter, just sets the current value to zero.
+   */
+  @Override
+  public void reset() {
+    CounterJNI.resetCounter(m_counter);
+  }
+
+  /**
+   * Set the maximum period where the device is still considered "moving". Sets the maximum period
+   * where the device is considered moving. This value is used to determine the "stopped" state of
+   * the counter using the GetStopped method.
+   *
+   * @param maxPeriod The maximum period where the counted device is considered moving in seconds.
+   */
+  @Override
+  public void setMaxPeriod(double maxPeriod) {
+    CounterJNI.setCounterMaxPeriod(m_counter, maxPeriod);
+  }
+
+  /**
+   * Select whether you want to continue updating the event timer output when there are no samples
+   * captured. The output of the event timer has a buffer of periods that are averaged and posted to
+   * a register on the FPGA. When the timer detects that the event source has stopped (based on the
+   * MaxPeriod) the buffer of samples to be averaged is emptied. If you enable the update when
+   * empty, you will be notified of the stopped source and the event time will report 0 samples. If
+   * you disable update when empty, the most recent average will remain on the output until a new
+   * sample is acquired. You will never see 0 samples output (except when there have been no events
+   * since an FPGA reset) and you will likely not see the stopped bit become true (since it is
+   * updated at the end of an average and there are no samples to average).
+   *
+   * @param enabled true to continue updating
+   */
+  public void setUpdateWhenEmpty(boolean enabled) {
+    CounterJNI.setCounterUpdateWhenEmpty(m_counter, enabled);
+  }
+
+  /**
+   * Determine if the clock is stopped. Determine if the clocked input is stopped based on the
+   * MaxPeriod value set using the SetMaxPeriod method. If the clock exceeds the MaxPeriod, then the
+   * device (and counter) are assumed to be stopped and it returns true.
+   *
+   * @return true if the most recent counter period exceeds the MaxPeriod value set by SetMaxPeriod.
+   */
+  @Override
+  public boolean getStopped() {
+    return CounterJNI.getCounterStopped(m_counter);
+  }
+
+  /**
+   * The last direction the counter value changed.
+   *
+   * @return The last direction the counter value changed.
+   */
+  @Override
+  public boolean getDirection() {
+    return CounterJNI.getCounterDirection(m_counter);
+  }
+
+  /**
+   * Set the Counter to return reversed sensing on the direction. This allows counters to change the
+   * direction they are counting in the case of 1X and 2X quadrature encoding only. Any other
+   * counter mode isn't supported.
+   *
+   * @param reverseDirection true if the value counted should be negated.
+   */
+  public void setReverseDirection(boolean reverseDirection) {
+    CounterJNI.setCounterReverseDirection(m_counter, reverseDirection);
+  }
+
+  /**
+   * Get the Period of the most recent count. Returns the time interval of the most recent count.
+   * This can be used for velocity calculations to determine shaft speed.
+   *
+   * @return The period of the last two pulses in units of seconds.
+   */
+  @Override
+  public double getPeriod() {
+    return CounterJNI.getCounterPeriod(m_counter);
+  }
+
+  /**
+   * Get the current rate of the Counter. Read the current rate of the counter accounting for the
+   * distance per pulse value. The default value for distance per pulse (1) yields units of pulses
+   * per second.
+   *
+   * @return The rate in units/sec
+   */
+  public double getRate() {
+    return m_distancePerPulse / getPeriod();
+  }
+
+  /**
+   * Set the Samples to Average which specifies the number of samples of the timer to average when
+   * calculating the period. Perform averaging to account for mechanical imperfections or as
+   * oversampling to increase resolution.
+   *
+   * @param samplesToAverage The number of samples to average from 1 to 127.
+   */
+  public void setSamplesToAverage(int samplesToAverage) {
+    CounterJNI.setCounterSamplesToAverage(m_counter, samplesToAverage);
+  }
+
+  /**
+   * Get the Samples to Average which specifies the number of samples of the timer to average when
+   * calculating the period. Perform averaging to account for mechanical imperfections or as
+   * oversampling to increase resolution.
+   *
+   * @return SamplesToAverage The number of samples being averaged (from 1 to 127)
+   */
+  public int getSamplesToAverage() {
+    return CounterJNI.getCounterSamplesToAverage(m_counter);
+  }
+
+  /**
+   * Set the distance per pulse for this counter. This sets the multiplier used to determine the
+   * distance driven based on the count value from the encoder. Set this value based on the Pulses
+   * per Revolution and factor in any gearing reductions. This distance can be in any units you
+   * like, linear or angular.
+   *
+   * @param distancePerPulse The scale factor that will be used to convert pulses to useful units.
+   */
+  public void setDistancePerPulse(double distancePerPulse) {
+    m_distancePerPulse = distancePerPulse;
+  }
+
+  /**
+   * Set which parameter of the encoder you are using as a process control variable. The counter
+   * class supports the rate and distance parameters.
+   *
+   * @param pidSource An enum to select the parameter.
+   */
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    requireNonNull(pidSource, "PID Source Parameter given was null");
+    if (pidSource != PIDSourceType.kDisplacement && pidSource != PIDSourceType.kRate) {
+      throw new IllegalArgumentException("PID Source parameter was not valid type: " + pidSource);
+    }
+
+    m_pidSource = pidSource;
+  }
+
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  @Override
+  public double pidGet() {
+    switch (m_pidSource) {
+      case kDisplacement:
+        return getDistance();
+      case kRate:
+        return getRate();
+      default:
+        return 0.0;
+    }
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Counter");
+    builder.addDoubleProperty("Value", this::get, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java
new file mode 100644
index 0000000..2663fab
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/CounterBase.java
@@ -0,0 +1,84 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Interface for counting the number of ticks on a digital input channel. Encoders, Gear tooth
+ * sensors, and counters should all subclass this so it can be used to build more advanced classes
+ * for control and driving.
+ *
+ * <p>All counters will immediately start counting - reset() them if you need them to be zeroed
+ * before use.
+ */
+public interface CounterBase {
+
+  /**
+   * The number of edges for the counterbase to increment or decrement on.
+   */
+  enum EncodingType {
+    /**
+     * Count only the rising edge.
+     */
+    k1X(0),
+    /**
+     * Count both the rising and falling edge.
+     */
+    k2X(1),
+    /**
+     * Count rising and falling on both channels.
+     */
+    k4X(2);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    EncodingType(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Get the count.
+   *
+   * @return the count
+   */
+  int get();
+
+  /**
+   * Reset the count to zero.
+   */
+  void reset();
+
+  /**
+   * Get the time between the last two edges counted.
+   *
+   * @return the time between the last two ticks in seconds
+   */
+  double getPeriod();
+
+  /**
+   * Set the maximum time between edges to be considered stalled.
+   *
+   * @param maxPeriod the maximum period in seconds
+   */
+  void setMaxPeriod(double maxPeriod);
+
+  /**
+   * Determine if the counter is not moving.
+   *
+   * @return true if the counter has not changed for the max period
+   */
+  boolean getStopped();
+
+  /**
+   * Determine which direction the counter is going.
+   *
+   * @return true for one direction, false for the other
+   */
+  boolean getDirection();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMC60.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMC60.java
new file mode 100644
index 0000000..95770fc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DMC60.java
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+//import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+//import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Digilent DMC 60 Speed Controller.
+ */
+public class DMC60 extends PWMSpeedController {
+  /**
+   * Constructor.
+   *
+   * <p>Note that the DMC uses the following bounds for PWM values. These values should work
+   * reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the DMC 60 User Manual
+   * available from Digilent
+   *
+   * <p>- 2.004ms = full "forward" - 1.52ms = the "high end" of the deadband range - 1.50ms =
+   * center of the deadband range (off) - 1.48ms = the "low end" of the deadband range - .997ms =
+   * full "reverse"
+   *
+   * @param channel The PWM channel that the DMC60 is attached to. 0-9 are
+   *        on-board, 10-19 are on the MXP port
+   */
+  public DMC60(final int channel) {
+    super(channel);
+
+    setBounds(2.004, 1.52, 1.50, 1.48, .997);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    //HAL.report(tResourceType.kResourceType_VictorSP, getChannel());
+    setName("DMC60", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalGlitchFilter.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalGlitchFilter.java
new file mode 100644
index 0000000..2082647
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalGlitchFilter.java
@@ -0,0 +1,182 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import edu.wpi.first.wpilibj.hal.DigitalGlitchFilterJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Class to enable glitch filtering on a set of digital inputs. This class will manage adding and
+ * removing digital inputs from a FPGA glitch filter. The filter lets the user configure the time
+ * that an input must remain high or low before it is classified as high or low.
+ */
+public class DigitalGlitchFilter extends SensorBase {
+  /**
+   * Configures the Digital Glitch Filter to its default settings.
+   */
+  public DigitalGlitchFilter() {
+    synchronized (m_mutex) {
+      int index = 0;
+      while (m_filterAllocated[index] && index < m_filterAllocated.length) {
+        index++;
+      }
+      if (index != m_filterAllocated.length) {
+        m_channelIndex = index;
+        m_filterAllocated[index] = true;
+        HAL.report(tResourceType.kResourceType_DigitalFilter,
+            m_channelIndex, 0);
+        setName("DigitalGlitchFilter", index);
+      }
+    }
+  }
+
+  /**
+   * Free the resources used by this object.
+   */
+  public void free() {
+    super.free();
+    if (m_channelIndex >= 0) {
+      synchronized (m_mutex) {
+        m_filterAllocated[m_channelIndex] = false;
+      }
+      m_channelIndex = -1;
+    }
+  }
+
+  private static void setFilter(DigitalSource input, int channelIndex) {
+    if (input != null) { // Counter might have just one input
+      // analog triggers are not supported for DigitalGlitchFilters
+      if (input.isAnalogTrigger()) {
+        throw new IllegalStateException("Analog Triggers not supported for DigitalGlitchFilters");
+      }
+      DigitalGlitchFilterJNI.setFilterSelect(input.getPortHandleForRouting(), channelIndex);
+
+      int selected = DigitalGlitchFilterJNI.getFilterSelect(input.getPortHandleForRouting());
+      if (selected != channelIndex) {
+        throw new IllegalStateException("DigitalGlitchFilterJNI.setFilterSelect("
+            + channelIndex + ") failed -> " + selected);
+      }
+    }
+  }
+
+  /**
+   * Assigns the DigitalSource to this glitch filter.
+   *
+   * @param input The DigitalSource to add.
+   */
+  public void add(DigitalSource input) {
+    setFilter(input, m_channelIndex + 1);
+  }
+
+  /**
+   * Assigns the Encoder to this glitch filter.
+   *
+   * @param input The Encoder to add.
+   */
+  public void add(Encoder input) {
+    add(input.m_aSource);
+    add(input.m_bSource);
+  }
+
+  /**
+   * Assigns the Counter to this glitch filter.
+   *
+   * @param input The Counter to add.
+   */
+  public void add(Counter input) {
+    add(input.m_upSource);
+    add(input.m_downSource);
+  }
+
+  /**
+   * Removes this filter from the given digital input.
+   *
+   * @param input The DigitalSource to stop filtering.
+   */
+  public void remove(DigitalSource input) {
+    setFilter(input, 0);
+  }
+
+  /**
+   * Removes this filter from the given Encoder.
+   *
+   * @param input the Encoder to stop filtering.
+   */
+  public void remove(Encoder input) {
+    remove(input.m_aSource);
+    remove(input.m_bSource);
+  }
+
+  /**
+   * Removes this filter from the given Counter.
+   *
+   * @param input The Counter to stop filtering.
+   */
+  public void remove(Counter input) {
+    remove(input.m_upSource);
+    remove(input.m_downSource);
+  }
+
+  /**
+   * Sets the number of FPGA cycles that the input must hold steady to pass through this glitch
+   * filter.
+   *
+   * @param fpgaCycles The number of FPGA cycles.
+   */
+  public void setPeriodCycles(int fpgaCycles) {
+    DigitalGlitchFilterJNI.setFilterPeriod(m_channelIndex, fpgaCycles);
+  }
+
+  /**
+   * Sets the number of nanoseconds that the input must hold steady to pass through this glitch
+   * filter.
+   *
+   * @param nanoseconds The number of nanoseconds.
+   */
+  public void setPeriodNanoSeconds(long nanoseconds) {
+    int fpgaCycles = (int) (nanoseconds * kSystemClockTicksPerMicrosecond / 4
+        / 1000);
+    setPeriodCycles(fpgaCycles);
+  }
+
+  /**
+   * Gets the number of FPGA cycles that the input must hold steady to pass through this glitch
+   * filter.
+   *
+   * @return The number of cycles.
+   */
+  public int getPeriodCycles() {
+    return DigitalGlitchFilterJNI.getFilterPeriod(m_channelIndex);
+  }
+
+  /**
+   * Gets the number of nanoseconds that the input must hold steady to pass through this glitch
+   * filter.
+   *
+   * @return The number of nanoseconds.
+   */
+  public long getPeriodNanoSeconds() {
+    int fpgaCycles = getPeriodCycles();
+
+    return (long) fpgaCycles * 1000L
+        / (long) (kSystemClockTicksPerMicrosecond / 4);
+  }
+
+  @SuppressWarnings("PMD.UnusedFormalParameter")
+  public void initSendable(SendableBuilder builder) {
+  }
+
+  private int m_channelIndex = -1;
+  private static final Lock m_mutex = new ReentrantLock(true);
+  private static final boolean[] m_filterAllocated = new boolean[3];
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalInput.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalInput.java
new file mode 100644
index 0000000..f7e54b7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalInput.java
@@ -0,0 +1,107 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.DIOJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Class to read a digital input. This class will read digital inputs and return the current value
+ * on the channel. Other devices such as encoders, gear tooth sensors, etc. that are implemented
+ * elsewhere will automatically allocate digital inputs and outputs as required. This class is only
+ * for devices like switches etc. that aren't implemented anywhere else.
+ */
+public class DigitalInput extends DigitalSource implements Sendable {
+  private int m_channel = 0;
+  private int m_handle = 0;
+
+  /**
+   * Create an instance of a Digital Input class. Creates a digital input given a channel.
+   *
+   * @param channel the DIO channel for the digital input 0-9 are on-board, 10-25 are on the MXP
+   */
+  public DigitalInput(int channel) {
+    checkDigitalChannel(channel);
+    m_channel = channel;
+
+    m_handle = DIOJNI.initializeDIOPort(DIOJNI.getPort((byte) channel), true);
+
+    HAL.report(tResourceType.kResourceType_DigitalInput, channel);
+    setName("DigitalInput", channel);
+  }
+
+  /**
+   * Frees the resources for this output.
+   */
+  public void free() {
+    super.free();
+    if (m_interrupt != 0) {
+      cancelInterrupts();
+    }
+
+    DIOJNI.freeDIOPort(m_handle);
+  }
+
+  /**
+   * Get the value from a digital input channel. Retrieve the value of a single digital input
+   * channel from the FPGA.
+   *
+   * @return the status of the digital input
+   */
+  public boolean get() {
+    return DIOJNI.getDIO(m_handle);
+  }
+
+  /**
+   * Get the channel of the digital input.
+   *
+   * @return The GPIO channel number that this object represents.
+   */
+  @Override
+  public int getChannel() {
+    return m_channel;
+  }
+
+  /**
+   * Get the analog trigger type.
+   *
+   * @return false
+   */
+  @Override
+  public int getAnalogTriggerTypeForRouting() {
+    return 0;
+  }
+
+  /**
+   * Is this an analog trigger.
+   *
+   * @return true if this is an analog trigger
+   */
+  @Override
+  public boolean isAnalogTrigger() {
+    return false;
+  }
+
+  /**
+   * Get the HAL Port Handle.
+   *
+   * @return The HAL Handle to the specified source.
+   */
+  @Override
+  public int getPortHandleForRouting() {
+    return m_handle;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Digital Input");
+    builder.addBooleanProperty("Value", this::get, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalOutput.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalOutput.java
new file mode 100644
index 0000000..d1ff8f0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalOutput.java
@@ -0,0 +1,172 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.DIOJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Class to write digital outputs. This class will write digital outputs. Other devices that are
+ * implemented elsewhere will automatically allocate digital inputs and outputs as required.
+ */
+public class DigitalOutput extends SendableBase implements Sendable {
+  private static final int invalidPwmGenerator = 0;
+  private int m_pwmGenerator = invalidPwmGenerator;
+
+  private int m_channel = 0;
+  private int m_handle = 0;
+
+  /**
+   * Create an instance of a digital output. Create an instance of a digital output given a
+   * channel.
+   *
+   * @param channel the DIO channel to use for the digital output. 0-9 are on-board, 10-25 are on
+   *                the MXP
+   */
+  public DigitalOutput(int channel) {
+    SensorBase.checkDigitalChannel(channel);
+    m_channel = channel;
+
+    m_handle = DIOJNI.initializeDIOPort(DIOJNI.getPort((byte) channel), false);
+
+    HAL.report(tResourceType.kResourceType_DigitalOutput, channel);
+    setName("DigitalOutput", channel);
+  }
+
+  /**
+   * Free the resources associated with a digital output.
+   */
+  @Override
+  public void free() {
+    super.free();
+    // disable the pwm only if we have allocated it
+    if (m_pwmGenerator != invalidPwmGenerator) {
+      disablePWM();
+    }
+    DIOJNI.freeDIOPort(m_handle);
+    m_handle = 0;
+  }
+
+  /**
+   * Set the value of a digital output.
+   *
+   * @param value true is on, off is false
+   */
+  public void set(boolean value) {
+    DIOJNI.setDIO(m_handle, (short) (value ? 1 : 0));
+  }
+
+  /**
+   * Gets the value being output from the Digital Output.
+   *
+   * @return the state of the digital output.
+   */
+  public boolean get() {
+    return DIOJNI.getDIO(m_handle);
+  }
+
+  /**
+   * Get the GPIO channel number that this object represents.
+   *
+   * @return The GPIO channel number.
+   */
+  public int getChannel() {
+    return m_channel;
+  }
+
+  /**
+   * Generate a single pulse. There can only be a single pulse going at any time.
+   *
+   * @param pulseLength The length of the pulse.
+   */
+  public void pulse(final double pulseLength) {
+    DIOJNI.pulse(m_handle, pulseLength);
+  }
+
+  /**
+   * Determine if the pulse is still going. Determine if a previously started pulse is still going.
+   *
+   * @return true if pulsing
+   */
+  public boolean isPulsing() {
+    return DIOJNI.isPulsing(m_handle);
+  }
+
+  /**
+   * Change the PWM frequency of the PWM output on a Digital Output line.
+   *
+   * <p>The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is logarithmic.
+   *
+   * <p>There is only one PWM frequency for all channels.
+   *
+   * @param rate The frequency to output all digital output PWM signals.
+   */
+  public void setPWMRate(double rate) {
+    DIOJNI.setDigitalPWMRate(rate);
+  }
+
+  /**
+   * Enable a PWM Output on this line.
+   *
+   * <p>Allocate one of the 6 DO PWM generator resources.
+   *
+   * <p>Supply the initial duty-cycle to output so as to avoid a glitch when first starting.
+   *
+   * <p>The resolution of the duty cycle is 8-bit for low frequencies (1kHz or less) but is reduced
+   * the higher the frequency of the PWM signal is.
+   *
+   * @param initialDutyCycle The duty-cycle to start generating. [0..1]
+   */
+  public void enablePWM(double initialDutyCycle) {
+    if (m_pwmGenerator != invalidPwmGenerator) {
+      return;
+    }
+    m_pwmGenerator = DIOJNI.allocateDigitalPWM();
+    DIOJNI.setDigitalPWMDutyCycle(m_pwmGenerator, initialDutyCycle);
+    DIOJNI.setDigitalPWMOutputChannel(m_pwmGenerator, m_channel);
+  }
+
+  /**
+   * Change this line from a PWM output back to a static Digital Output line.
+   *
+   * <p>Free up one of the 6 DO PWM generator resources that were in use.
+   */
+  public void disablePWM() {
+    if (m_pwmGenerator == invalidPwmGenerator) {
+      return;
+    }
+    // Disable the output by routing to a dead bit.
+    DIOJNI.setDigitalPWMOutputChannel(m_pwmGenerator, SensorBase.kDigitalChannels);
+    DIOJNI.freeDigitalPWM(m_pwmGenerator);
+    m_pwmGenerator = invalidPwmGenerator;
+  }
+
+  /**
+   * Change the duty-cycle that is being generated on the line.
+   *
+   * <p>The resolution of the duty cycle is 8-bit for low frequencies (1kHz or less) but is reduced
+   * the
+   * higher the frequency of the PWM signal is.
+   *
+   * @param dutyCycle The duty-cycle to change to. [0..1]
+   */
+  public void updateDutyCycle(double dutyCycle) {
+    if (m_pwmGenerator == invalidPwmGenerator) {
+      return;
+    }
+    DIOJNI.setDigitalPWMDutyCycle(m_pwmGenerator, dutyCycle);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Digital Output");
+    builder.addBooleanProperty("Value", this::get, this::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalSource.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalSource.java
new file mode 100644
index 0000000..d31e191
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DigitalSource.java
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * DigitalSource Interface. The DigitalSource represents all the possible inputs for a counter or a
+ * quadrature encoder. The source may be either a digital input or an analog input. If the caller
+ * just provides a channel, then a digital input will be constructed and freed when finished for the
+ * source. The source can either be a digital input or analog trigger but not both.
+ */
+public abstract class DigitalSource extends InterruptableSensorBase {
+  public abstract boolean isAnalogTrigger();
+
+  public abstract int getChannel();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java
new file mode 100644
index 0000000..9542408
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DoubleSolenoid.java
@@ -0,0 +1,183 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.SolenoidJNI;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * DoubleSolenoid class for running 2 channels of high voltage Digital Output on the PCM.
+ *
+ * <p>The DoubleSolenoid class is typically used for pneumatics solenoids that have two positions
+ * controlled by two separate channels.
+ */
+public class DoubleSolenoid extends SolenoidBase implements Sendable {
+  /**
+   * Possible values for a DoubleSolenoid.
+   */
+  public enum Value {
+    kOff,
+    kForward,
+    kReverse
+  }
+
+  private byte m_forwardMask; // The mask for the forward channel.
+  private byte m_reverseMask; // The mask for the reverse channel.
+  private int m_forwardHandle = 0;
+  private int m_reverseHandle = 0;
+
+  /**
+   * Constructor. Uses the default PCM ID (defaults to 0).
+   *
+   * @param forwardChannel The forward channel number on the PCM (0..7).
+   * @param reverseChannel The reverse channel number on the PCM (0..7).
+   */
+  public DoubleSolenoid(final int forwardChannel, final int reverseChannel) {
+    this(SensorBase.getDefaultSolenoidModule(), forwardChannel, reverseChannel);
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param moduleNumber   The module number of the solenoid module to use.
+   * @param forwardChannel The forward channel on the module to control (0..7).
+   * @param reverseChannel The reverse channel on the module to control (0..7).
+   */
+  public DoubleSolenoid(final int moduleNumber, final int forwardChannel,
+                        final int reverseChannel) {
+    super(moduleNumber);
+
+    SensorBase.checkSolenoidModule(m_moduleNumber);
+    SensorBase.checkSolenoidChannel(forwardChannel);
+    SensorBase.checkSolenoidChannel(reverseChannel);
+
+    int portHandle = SolenoidJNI.getPortWithModule((byte) m_moduleNumber, (byte) forwardChannel);
+    m_forwardHandle = SolenoidJNI.initializeSolenoidPort(portHandle);
+
+    try {
+      portHandle = SolenoidJNI.getPortWithModule((byte) m_moduleNumber, (byte) reverseChannel);
+      m_reverseHandle = SolenoidJNI.initializeSolenoidPort(portHandle);
+    } catch (RuntimeException ex) {
+      // free the forward handle on exception, then rethrow
+      SolenoidJNI.freeSolenoidPort(m_forwardHandle);
+      m_forwardHandle = 0;
+      m_reverseHandle = 0;
+      throw ex;
+    }
+
+    m_forwardMask = (byte) (1 << forwardChannel);
+    m_reverseMask = (byte) (1 << reverseChannel);
+
+    HAL.report(tResourceType.kResourceType_Solenoid, forwardChannel,
+                                   m_moduleNumber);
+    HAL.report(tResourceType.kResourceType_Solenoid, reverseChannel,
+                                   m_moduleNumber);
+    setName("DoubleSolenoid", m_moduleNumber, forwardChannel);
+  }
+
+  /**
+   * Destructor.
+   */
+  @Override
+  public synchronized void free() {
+    super.free();
+    SolenoidJNI.freeSolenoidPort(m_forwardHandle);
+    SolenoidJNI.freeSolenoidPort(m_reverseHandle);
+    super.free();
+  }
+
+  /**
+   * Set the value of a solenoid.
+   *
+   * @param value The value to set (Off, Forward, Reverse)
+   */
+  public void set(final Value value) {
+    boolean forward = false;
+    boolean reverse = false;
+
+    switch (value) {
+      case kOff:
+        forward = false;
+        reverse = false;
+        break;
+      case kForward:
+        forward = true;
+        reverse = false;
+        break;
+      case kReverse:
+        forward = false;
+        reverse = true;
+        break;
+      default:
+        throw new AssertionError("Illegal value: " + value);
+
+    }
+
+    SolenoidJNI.setSolenoid(m_forwardHandle, forward);
+    SolenoidJNI.setSolenoid(m_reverseHandle, reverse);
+  }
+
+  /**
+   * Read the current value of the solenoid.
+   *
+   * @return The current value of the solenoid.
+   */
+  public Value get() {
+    boolean valueForward = SolenoidJNI.getSolenoid(m_forwardHandle);
+    boolean valueReverse = SolenoidJNI.getSolenoid(m_reverseHandle);
+
+    if (valueForward) {
+      return Value.kForward;
+    }
+    if (valueReverse) {
+      return Value.kReverse;
+    }
+    return Value.kOff;
+  }
+
+  /**
+   * Check if the forward solenoid is blacklisted. If a solenoid is shorted, it is added to the
+   * blacklist and disabled until power cycle, or until faults are cleared.
+   *
+   * @return If solenoid is disabled due to short.
+   * @see #clearAllPCMStickyFaults()
+   */
+  public boolean isFwdSolenoidBlackListed() {
+    int blackList = getPCMSolenoidBlackList();
+    return (blackList & m_forwardMask) != 0;
+  }
+
+  /**
+   * Check if the reverse solenoid is blacklisted. If a solenoid is shorted, it is added to the
+   * blacklist and disabled until power cycle, or until faults are cleared.
+   *
+   * @return If solenoid is disabled due to short.
+   * @see #clearAllPCMStickyFaults()
+   */
+  public boolean isRevSolenoidBlackListed() {
+    int blackList = getPCMSolenoidBlackList();
+    return (blackList & m_reverseMask) != 0;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Double Solenoid");
+    builder.setSafeState(() -> set(Value.kOff));
+    builder.addStringProperty("Value", () -> get().name().substring(1), (value) -> {
+      if ("Forward".equals(value)) {
+        set(Value.kForward);
+      } else if ("Reverse".equals(value)) {
+        set(Value.kReverse);
+      } else {
+        set(Value.kOff);
+      }
+    });
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java
new file mode 100644
index 0000000..f6c847d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/DriverStation.java
@@ -0,0 +1,1147 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.hal.AllianceStationID;
+import edu.wpi.first.wpilibj.hal.ControlWord;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.MatchInfoData;
+import edu.wpi.first.wpilibj.hal.PowerJNI;
+
+/**
+ * Provide access to the network communication data to / from the Driver Station.
+ */
+public class DriverStation implements RobotState.Interface {
+  /**
+   * Number of Joystick Ports.
+   */
+  public static final int kJoystickPorts = 6;
+
+  private class HALJoystickButtons {
+    public int m_buttons;
+    public byte m_count;
+  }
+
+  private class HALJoystickAxes {
+    public float[] m_axes;
+    public short m_count;
+
+    HALJoystickAxes(int count) {
+      m_axes = new float[count];
+    }
+  }
+
+  private class HALJoystickPOVs {
+    public short[] m_povs;
+    public short m_count;
+
+    HALJoystickPOVs(int count) {
+      m_povs = new short[count];
+    }
+  }
+
+  /**
+   * The robot alliance that the robot is a part of.
+   */
+  public enum Alliance {
+    Red, Blue, Invalid
+  }
+
+  public enum MatchType {
+    None, Practice, Qualification, Elimination
+  }
+
+  private static final double JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL = 1.0;
+  private double m_nextMessageTime = 0.0;
+
+  private static class DriverStationTask implements Runnable {
+    private DriverStation m_ds;
+
+    DriverStationTask(DriverStation ds) {
+      m_ds = ds;
+    }
+
+    public void run() {
+      m_ds.run();
+    }
+  } /* DriverStationTask */
+
+  private static class MatchDataSender {
+    @SuppressWarnings("MemberName")
+    NetworkTable table;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry typeMetadata;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry gameSpecificMessage;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry eventName;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry matchNumber;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry replayNumber;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry matchType;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry alliance;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry station;
+    @SuppressWarnings("MemberName")
+    NetworkTableEntry controlWord;
+
+    MatchDataSender() {
+      table = NetworkTableInstance.getDefault().getTable("FMSInfo");
+      typeMetadata = table.getEntry(".type");
+      typeMetadata.forceSetString("FMSInfo");
+      gameSpecificMessage = table.getEntry("GameSpecificMessage");
+      gameSpecificMessage.forceSetString("");
+      eventName = table.getEntry("EventName");
+      eventName.forceSetString("");
+      matchNumber = table.getEntry("MatchNumber");
+      matchNumber.forceSetDouble(0);
+      replayNumber = table.getEntry("ReplayNumber");
+      replayNumber.forceSetDouble(0);
+      matchType = table.getEntry("MatchType");
+      matchType.forceSetDouble(0);
+      alliance = table.getEntry("IsRedAlliance");
+      alliance.forceSetBoolean(true);
+      station = table.getEntry("StationNumber");
+      station.forceSetDouble(1);
+      controlWord = table.getEntry("FMSControlData");
+      controlWord.forceSetDouble(0);
+    }
+  }
+
+  private static DriverStation instance = new DriverStation();
+
+  // Joystick User Data
+  private HALJoystickAxes[] m_joystickAxes = new HALJoystickAxes[kJoystickPorts];
+  private HALJoystickPOVs[] m_joystickPOVs = new HALJoystickPOVs[kJoystickPorts];
+  private HALJoystickButtons[] m_joystickButtons = new HALJoystickButtons[kJoystickPorts];
+  private MatchInfoData m_matchInfo = new MatchInfoData();
+
+  // Joystick Cached Data
+  private HALJoystickAxes[] m_joystickAxesCache = new HALJoystickAxes[kJoystickPorts];
+  private HALJoystickPOVs[] m_joystickPOVsCache = new HALJoystickPOVs[kJoystickPorts];
+  private HALJoystickButtons[] m_joystickButtonsCache = new HALJoystickButtons[kJoystickPorts];
+  private MatchInfoData m_matchInfoCache = new MatchInfoData();
+
+  // Joystick button rising/falling edge flags
+  HALJoystickButtons[] m_joystickButtonsPressed = new HALJoystickButtons[kJoystickPorts];
+  HALJoystickButtons[] m_joystickButtonsReleased = new HALJoystickButtons[kJoystickPorts];
+
+  // preallocated byte buffer for button count
+  private ByteBuffer m_buttonCountBuffer = ByteBuffer.allocateDirect(1);
+
+  private MatchDataSender m_matchDataSender;
+
+  // Internal Driver Station thread
+  private Thread m_thread;
+  private volatile boolean m_threadKeepAlive = true;
+
+  private final Object m_cacheDataMutex;
+
+  private final Lock m_waitForDataMutex;
+  private final Condition m_waitForDataCond;
+  private int m_waitForDataCount;
+
+  // Robot state status variables
+  private boolean m_userInDisabled = false;
+  private boolean m_userInAutonomous = false;
+  private boolean m_userInTeleop = false;
+  private boolean m_userInTest = false;
+
+  // Control word variables
+  private final Object m_controlWordMutex;
+  private ControlWord m_controlWordCache;
+  private long m_lastControlWordUpdate;
+
+  /**
+   * Gets an instance of the DriverStation.
+   *
+   * @return The DriverStation.
+   */
+  public static DriverStation getInstance() {
+    return DriverStation.instance;
+  }
+
+  /**
+   * DriverStation constructor.
+   *
+   * <p>The single DriverStation instance is created statically with the instance static member
+   * variable.
+   */
+  private DriverStation() {
+    m_waitForDataCount = 0;
+    m_waitForDataMutex = new ReentrantLock();
+    m_waitForDataCond = m_waitForDataMutex.newCondition();
+
+    m_cacheDataMutex = new Object();
+    for (int i = 0; i < kJoystickPorts; i++) {
+      m_joystickButtons[i] = new HALJoystickButtons();
+      m_joystickAxes[i] = new HALJoystickAxes(HAL.kMaxJoystickAxes);
+      m_joystickPOVs[i] = new HALJoystickPOVs(HAL.kMaxJoystickPOVs);
+
+      m_joystickButtonsCache[i] = new HALJoystickButtons();
+      m_joystickAxesCache[i] = new HALJoystickAxes(HAL.kMaxJoystickAxes);
+      m_joystickPOVsCache[i] = new HALJoystickPOVs(HAL.kMaxJoystickPOVs);
+
+      m_joystickButtonsPressed[i] = new HALJoystickButtons();
+      m_joystickButtonsReleased[i] = new HALJoystickButtons();
+    }
+
+    m_controlWordMutex = new Object();
+    m_controlWordCache = new ControlWord();
+    m_lastControlWordUpdate = 0;
+
+    m_matchDataSender = new MatchDataSender();
+
+    m_thread = new Thread(new DriverStationTask(this), "FRCDriverStation");
+    m_thread.setPriority((Thread.NORM_PRIORITY + Thread.MAX_PRIORITY) / 2);
+
+    m_thread.start();
+  }
+
+  /**
+   * Kill the thread.
+   */
+  public void release() {
+    m_threadKeepAlive = false;
+  }
+
+  /**
+   * Report error to Driver Station. Optionally appends Stack trace
+   * to error message.
+   *
+   * @param printTrace If true, append stack trace to error string
+   */
+  public static void reportError(String error, boolean printTrace) {
+    reportErrorImpl(true, 1, error, printTrace);
+  }
+
+  /**
+   * Report error to Driver Station. Appends provided stack trace
+   * to error message.
+   *
+   * @param stackTrace The stack trace to append
+   */
+  public static void reportError(String error, StackTraceElement[] stackTrace) {
+    reportErrorImpl(true, 1, error, stackTrace);
+  }
+
+  /**
+   * Report warning to Driver Station. Optionally appends Stack
+   * trace to warning message.
+   *
+   * @param printTrace If true, append stack trace to warning string
+   */
+  public static void reportWarning(String error, boolean printTrace) {
+    reportErrorImpl(false, 1, error, printTrace);
+  }
+
+  /**
+   * Report warning to Driver Station. Appends provided stack
+   * trace to warning message.
+   *
+   * @param stackTrace The stack trace to append
+   */
+  public static void reportWarning(String error, StackTraceElement[] stackTrace) {
+    reportErrorImpl(false, 1, error, stackTrace);
+  }
+
+  private static void reportErrorImpl(boolean isError, int code, String error, boolean
+      printTrace) {
+    reportErrorImpl(isError, code, error, printTrace, Thread.currentThread().getStackTrace(), 3);
+  }
+
+  private static void reportErrorImpl(boolean isError, int code, String error,
+      StackTraceElement[] stackTrace) {
+    reportErrorImpl(isError, code, error, true, stackTrace, 0);
+  }
+
+  private static void reportErrorImpl(boolean isError, int code, String error,
+      boolean printTrace, StackTraceElement[] stackTrace, int stackTraceFirst) {
+    String locString;
+    if (stackTrace.length >= stackTraceFirst + 1) {
+      locString = stackTrace[stackTraceFirst].toString();
+    } else {
+      locString = "";
+    }
+    String traceString = "";
+    if (printTrace) {
+      boolean haveLoc = false;
+      for (int i = stackTraceFirst; i < stackTrace.length; i++) {
+        String loc = stackTrace[i].toString();
+        traceString += "\tat " + loc + "\n";
+        // get first user function
+        if (!haveLoc && !loc.startsWith("edu.wpi.first")) {
+          locString = loc;
+          haveLoc = true;
+        }
+      }
+    }
+    HAL.sendError(isError, code, false, error, locString, traceString, true);
+  }
+
+  /**
+   * The state of one joystick button. Button indexes begin at 1.
+   *
+   * @param stick  The joystick to read.
+   * @param button The button index, beginning at 1.
+   * @return The state of the joystick button.
+   */
+  public boolean getStickButton(final int stick, final int button) {
+    if (button <= 0) {
+      reportJoystickUnpluggedError("Button indexes begin at 1 in WPILib for C++ and Java\n");
+      return false;
+    }
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-3");
+    }
+    boolean error = false;
+    boolean retVal = false;
+    synchronized (m_cacheDataMutex) {
+      if (button > m_joystickButtons[stick].m_count) {
+        error = true;
+        retVal = false;
+      } else {
+        retVal = (m_joystickButtons[stick].m_buttons & 1 << (button - 1)) != 0;
+      }
+    }
+    if (error) {
+      reportJoystickUnpluggedWarning("Joystick Button " + button + " on port " + stick
+          + " not available, check if controller is plugged in");
+    }
+    return retVal;
+  }
+
+  /**
+   * Whether one joystick button was pressed since the last check. Button indexes begin at 1.
+   *
+   * @param stick  The joystick to read.
+   * @param button The button index, beginning at 1.
+   * @return Whether the joystick button was pressed since the last check.
+   */
+  boolean getStickButtonPressed(final int stick, final int button) {
+    if (button <= 0) {
+      reportJoystickUnpluggedError("Button indexes begin at 1 in WPILib for C++ and Java\n");
+      return false;
+    }
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-3");
+    }
+
+    // If button was pressed, clear flag and return true
+    if ((m_joystickButtonsPressed[stick].m_buttons & 1 << (button - 1)) != 0) {
+      m_joystickButtonsPressed[stick].m_buttons &= ~(1 << (button - 1));
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Whether one joystick button was released since the last check. Button indexes
+   * begin at 1.
+   *
+   * @param stick  The joystick to read.
+   * @param button The button index, beginning at 1.
+   * @return Whether the joystick button was released since the last check.
+   */
+  boolean getStickButtonReleased(final int stick, final int button) {
+    if (button <= 0) {
+      reportJoystickUnpluggedError("Button indexes begin at 1 in WPILib for C++ and Java\n");
+      return false;
+    }
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-3");
+    }
+
+    // If button was released, clear flag and return true
+    if ((m_joystickButtonsReleased[stick].m_buttons & 1 << (button - 1)) != 0) {
+      m_joystickButtonsReleased[stick].m_buttons &= ~(1 << (button - 1));
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Get the value of the axis on a joystick. This depends on the mapping of the joystick connected
+   * to the specified port.
+   *
+   * @param stick The joystick to read.
+   * @param axis  The analog axis value to read from the joystick.
+   * @return The value of the axis on the joystick.
+   */
+  public double getStickAxis(int stick, int axis) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    if (axis < 0 || axis >= HAL.kMaxJoystickAxes) {
+      throw new RuntimeException("Joystick axis is out of range");
+    }
+
+    boolean error = false;
+    double retVal = 0.0;
+    synchronized (m_cacheDataMutex) {
+      if (axis >= m_joystickAxes[stick].m_count) {
+        // set error
+        error = true;
+        retVal = 0.0;
+      } else {
+        retVal =  m_joystickAxes[stick].m_axes[axis];
+      }
+    }
+    if (error) {
+      reportJoystickUnpluggedWarning("Joystick axis " + axis + " on port " + stick
+          + " not available, check if controller is plugged in");
+    }
+    return retVal;
+  }
+
+  /**
+   * Get the state of a POV on the joystick.
+   *
+   * @return the angle of the POV in degrees, or -1 if the POV is not pressed.
+   */
+  public int getStickPOV(int stick, int pov) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    if (pov < 0 || pov >= HAL.kMaxJoystickPOVs) {
+      throw new RuntimeException("Joystick POV is out of range");
+    }
+    boolean error = false;
+    int retVal = -1;
+    synchronized (m_cacheDataMutex) {
+      if (pov >= m_joystickPOVs[stick].m_count) {
+        error = true;
+        retVal = -1;
+      } else {
+        retVal = m_joystickPOVs[stick].m_povs[pov];
+      }
+    }
+    if (error) {
+      reportJoystickUnpluggedWarning("Joystick POV " + pov + " on port " + stick
+          + " not available, check if controller is plugged in");
+    }
+    return retVal;
+  }
+
+  /**
+   * The state of the buttons on the joystick.
+   *
+   * @param stick The joystick to read.
+   * @return The state of the buttons on the joystick.
+   */
+  public int getStickButtons(final int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-3");
+    }
+    synchronized (m_cacheDataMutex) {
+      return m_joystickButtons[stick].m_buttons;
+    }
+  }
+
+  /**
+   * Returns the number of axes on a given joystick port.
+   *
+   * @param stick The joystick port number
+   * @return The number of axes on the indicated joystick
+   */
+  public int getStickAxisCount(int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    synchronized (m_cacheDataMutex) {
+      return m_joystickAxes[stick].m_count;
+    }
+  }
+
+  /**
+   * Returns the number of POVs on a given joystick port.
+   *
+   * @param stick The joystick port number
+   * @return The number of POVs on the indicated joystick
+   */
+  public int getStickPOVCount(int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    synchronized (m_cacheDataMutex) {
+      return m_joystickPOVs[stick].m_count;
+    }
+  }
+
+  /**
+   * Gets the number of buttons on a joystick.
+   *
+   * @param stick The joystick port number
+   * @return The number of buttons on the indicated joystick
+   */
+  public int getStickButtonCount(int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    synchronized (m_cacheDataMutex) {
+      return m_joystickButtons[stick].m_count;
+    }
+  }
+
+  /**
+   * Gets the value of isXbox on a joystick.
+   *
+   * @param stick The joystick port number
+   * @return A boolean that returns the value of isXbox
+   */
+  public boolean getJoystickIsXbox(int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    boolean error = false;
+    boolean retVal = false;
+    synchronized (m_cacheDataMutex) {
+      // TODO: Remove this when calling for descriptor on empty stick no longer
+      // crashes
+      if (1 > m_joystickButtons[stick].m_count && 1 > m_joystickAxes[stick].m_count) {
+        error = true;
+        retVal = false;
+      } else if (HAL.getJoystickIsXbox((byte) stick) == 1) {
+        retVal = true;
+      }
+    }
+    if (error) {
+      reportJoystickUnpluggedWarning("Joystick on port " + stick
+          + " not available, check if controller is plugged in");
+    }
+    return retVal;
+  }
+
+  /**
+   * Gets the value of type on a joystick.
+   *
+   * @param stick The joystick port number
+   * @return The value of type
+   */
+  public int getJoystickType(int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    boolean error = false;
+    int retVal = -1;
+    synchronized (m_cacheDataMutex) {
+      // TODO: Remove this when calling for descriptor on empty stick no longer
+      // crashes
+      if (1 > m_joystickButtons[stick].m_count && 1 > m_joystickAxes[stick].m_count) {
+        error = true;
+        retVal = -1;
+      } else {
+        retVal = HAL.getJoystickType((byte) stick);
+      }
+    }
+    if (error) {
+      reportJoystickUnpluggedWarning("Joystick on port " + stick
+          + " not available, check if controller is plugged in");
+    }
+    return retVal;
+  }
+
+  /**
+   * Gets the name of the joystick at a port.
+   *
+   * @param stick The joystick port number
+   * @return The value of name
+   */
+  public String getJoystickName(int stick) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+    boolean error = false;
+    String retVal = "";
+    synchronized (m_cacheDataMutex) {
+      // TODO: Remove this when calling for descriptor on empty stick no longer
+      // crashes
+      if (1 > m_joystickButtons[stick].m_count && 1 > m_joystickAxes[stick].m_count) {
+        error = true;
+        retVal = "";
+      } else {
+        retVal = HAL.getJoystickName((byte) stick);
+      }
+    }
+    if (error) {
+      reportJoystickUnpluggedWarning("Joystick on port " + stick
+          + " not available, check if controller is plugged in");
+    }
+    return retVal;
+  }
+
+  /**
+   * Returns the types of Axes on a given joystick port.
+   *
+   * @param stick The joystick port number
+   * @param axis The target axis
+   * @return What type of axis the axis is reporting to be
+   */
+  public int getJoystickAxisType(int stick, int axis) {
+    if (stick < 0 || stick >= kJoystickPorts) {
+      throw new RuntimeException("Joystick index is out of range, should be 0-5");
+    }
+
+    int retVal = -1;
+    synchronized (m_cacheDataMutex) {
+      retVal = HAL.getJoystickAxisType((byte) stick, (byte) axis);
+    }
+    return retVal;
+  }
+
+  /**
+   * Gets a value indicating whether the Driver Station requires the robot to be enabled.
+   *
+   * @return True if the robot is enabled, false otherwise.
+   */
+  public boolean isEnabled() {
+    synchronized (m_controlWordMutex) {
+      updateControlWord(false);
+      return m_controlWordCache.getEnabled() && m_controlWordCache.getDSAttached();
+    }
+  }
+
+  /**
+   * Gets a value indicating whether the Driver Station requires the robot to be disabled.
+   *
+   * @return True if the robot should be disabled, false otherwise.
+   */
+  public boolean isDisabled() {
+    return !isEnabled();
+  }
+
+  /**
+   * Gets a value indicating whether the Driver Station requires the robot to be running in
+   * autonomous mode.
+   *
+   * @return True if autonomous mode should be enabled, false otherwise.
+   */
+  public boolean isAutonomous() {
+    synchronized (m_controlWordMutex) {
+      updateControlWord(false);
+      return m_controlWordCache.getAutonomous();
+    }
+  }
+
+  /**
+   * Gets a value indicating whether the Driver Station requires the robot to be running in
+   * operator-controlled mode.
+   *
+   * @return True if operator-controlled mode should be enabled, false otherwise.
+   */
+  public boolean isOperatorControl() {
+    return !(isAutonomous() || isTest());
+  }
+
+  /**
+   * Gets a value indicating whether the Driver Station requires the robot to be running in test
+   * mode.
+   *
+   * @return True if test mode should be enabled, false otherwise.
+   */
+  public boolean isTest() {
+    synchronized (m_controlWordMutex) {
+      updateControlWord(false);
+      return m_controlWordCache.getTest();
+    }
+  }
+
+  /**
+   * Gets a value indicating whether the Driver Station is attached.
+   *
+   * @return True if Driver Station is attached, false otherwise.
+   */
+  public boolean isDSAttached() {
+    synchronized (m_controlWordMutex) {
+      updateControlWord(false);
+      return m_controlWordCache.getDSAttached();
+    }
+  }
+
+  /**
+   * Gets if a new control packet from the driver station arrived since the last time this function
+   * was called.
+   *
+   * @return True if the control data has been updated since the last call.
+   */
+  public boolean isNewControlData() {
+    return HAL.isNewControlData();
+  }
+
+  /**
+   * Gets if the driver station attached to a Field Management System.
+   *
+   * @return true if the robot is competing on a field being controlled by a Field Management System
+   */
+  public boolean isFMSAttached() {
+    synchronized (m_controlWordMutex) {
+      updateControlWord(false);
+      return m_controlWordCache.getFMSAttached();
+    }
+  }
+
+  /**
+   * Gets a value indicating whether the FPGA outputs are enabled. The outputs may be disabled if
+   * the robot is disabled or e-stopped, the watchdog has expired, or if the roboRIO browns out.
+   *
+   * @return True if the FPGA outputs are enabled.
+   * @deprecated Use RobotController.isSysActive()
+   */
+  @Deprecated
+  public boolean isSysActive() {
+    return HAL.getSystemActive();
+  }
+
+  /**
+   * Check if the system is browned out.
+   *
+   * @return True if the system is browned out
+   * @deprecated Use RobotController.isBrownedOut()
+   */
+  @Deprecated
+  public boolean isBrownedOut() {
+    return HAL.getBrownedOut();
+  }
+
+  /**
+   * Get the game specific message.
+   *
+   * @return the game specific message
+   */
+  public String getGameSpecificMessage() {
+    synchronized (m_cacheDataMutex) {
+      return m_matchInfo.gameSpecificMessage;
+    }
+  }
+
+  /**
+   * Get the event name.
+   *
+   * @return the event name
+   */
+  public String getEventName() {
+    synchronized (m_cacheDataMutex) {
+      return m_matchInfo.eventName;
+    }
+  }
+
+  /**
+   * Get the match type.
+   *
+   * @return the match type
+   */
+  public MatchType getMatchType() {
+    int matchType;
+    synchronized (m_cacheDataMutex) {
+      matchType = m_matchInfo.matchType;
+    }
+    switch (matchType) {
+      case 1:
+        return MatchType.Practice;
+      case 2:
+        return MatchType.Qualification;
+      case 3:
+        return MatchType.Elimination;
+      default:
+        return MatchType.None;
+    }
+  }
+
+  /**
+   * Get the match number.
+   *
+   * @return the match number
+   */
+  public int getMatchNumber() {
+    synchronized (m_cacheDataMutex) {
+      return m_matchInfo.matchNumber;
+    }
+  }
+
+  /**
+   * Get the replay number.
+   *
+   * @return the replay number
+   */
+  public int getReplayNumber() {
+    synchronized (m_cacheDataMutex) {
+      return m_matchInfo.replayNumber;
+    }
+  }
+
+  /**
+   * Get the current alliance from the FMS.
+   *
+   * @return the current alliance
+   */
+  public Alliance getAlliance() {
+    AllianceStationID allianceStationID = HAL.getAllianceStation();
+    if (allianceStationID == null) {
+      return Alliance.Invalid;
+    }
+
+    switch (allianceStationID) {
+      case Red1:
+      case Red2:
+      case Red3:
+        return Alliance.Red;
+
+      case Blue1:
+      case Blue2:
+      case Blue3:
+        return Alliance.Blue;
+
+      default:
+        return Alliance.Invalid;
+    }
+  }
+
+  /**
+   * Gets the location of the team's driver station controls.
+   *
+   * @return the location of the team's driver station controls: 1, 2, or 3
+   */
+  public int getLocation() {
+    AllianceStationID allianceStationID = HAL.getAllianceStation();
+    if (allianceStationID == null) {
+      return 0;
+    }
+    switch (allianceStationID) {
+      case Red1:
+      case Blue1:
+        return 1;
+
+      case Red2:
+      case Blue2:
+        return 2;
+
+      case Blue3:
+      case Red3:
+        return 3;
+
+      default:
+        return 0;
+    }
+  }
+
+  /**
+   * Wait for new data from the driver station.
+   */
+  public void waitForData() {
+    waitForData(0);
+  }
+
+  /**
+   * Wait for new data or for timeout, which ever comes first. If timeout is 0, wait for new data
+   * only.
+   *
+   * @param timeout The maximum time in seconds to wait.
+   * @return true if there is new data, otherwise false
+   */
+  public boolean waitForData(double timeout) {
+    long startTime = RobotController.getFPGATime();
+    long timeoutMicros = (long) (timeout * 1000000);
+    m_waitForDataMutex.lock();
+    try {
+      int currentCount = m_waitForDataCount;
+      while (m_waitForDataCount == currentCount) {
+        if (timeout > 0) {
+          long now = RobotController.getFPGATime();
+          if (now < startTime + timeoutMicros) {
+            // We still have time to wait
+            boolean signaled = m_waitForDataCond.await(startTime + timeoutMicros - now,
+                                                TimeUnit.MICROSECONDS);
+            if (!signaled) {
+              // Return false if a timeout happened
+              return false;
+            }
+          } else {
+            // Time has elapsed.
+            return false;
+          }
+        } else {
+          m_waitForDataCond.await();
+        }
+      }
+      // Return true if we have received a proper signal
+      return true;
+    } catch (InterruptedException ex) {
+      // return false on a thread interrupt
+      return false;
+    } finally {
+      m_waitForDataMutex.unlock();
+    }
+  }
+
+  /**
+   * Return the approximate match time. The FMS does not send an official match time to the robots,
+   * but does send an approximate match time. The value will count down the time remaining in the
+   * current period (auto or teleop). Warning: This is not an official time (so it cannot be used to
+   * dispute ref calls or guarantee that a function will trigger before the match ends) The
+   * Practice Match function of the DS approximates the behaviour seen on the field.
+   *
+   * @return Time remaining in current match period (auto or teleop) in seconds
+   */
+  public double getMatchTime() {
+    return HAL.getMatchTime();
+  }
+
+  /**
+   * Read the battery voltage.
+   *
+   * @return The battery voltage in Volts.
+   * @deprecated Use RobotController.getBatteryVoltage
+   */
+  @Deprecated
+  public double getBatteryVoltage() {
+    return PowerJNI.getVinVoltage();
+  }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be executing for diagnostic
+   * purposes only.
+   *
+   * @param entering If true, starting disabled code; if false, leaving disabled code
+   */
+  @SuppressWarnings("MethodName")
+  public void InDisabled(boolean entering) {
+    m_userInDisabled = entering;
+  }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be executing for diagnostic
+   * purposes only.
+   *
+   * @param entering If true, starting autonomous code; if false, leaving autonomous code
+   */
+  @SuppressWarnings("MethodName")
+  public void InAutonomous(boolean entering) {
+    m_userInAutonomous = entering;
+  }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be executing for diagnostic
+   * purposes only.
+   *
+   * @param entering If true, starting teleop code; if false, leaving teleop code
+   */
+  @SuppressWarnings("MethodName")
+  public void InOperatorControl(boolean entering) {
+    m_userInTeleop = entering;
+  }
+
+  /**
+   * Only to be used to tell the Driver Station what code you claim to be executing for diagnostic
+   * purposes only.
+   *
+   * @param entering If true, starting test code; if false, leaving test code
+   */
+  @SuppressWarnings("MethodName")
+  public void InTest(boolean entering) {
+    m_userInTest = entering;
+  }
+
+  private void sendMatchData() {
+    AllianceStationID alliance = HAL.getAllianceStation();
+    boolean isRedAlliance = false;
+    int stationNumber = 1;
+    switch (alliance) {
+      case Blue1:
+        isRedAlliance = false;
+        stationNumber = 1;
+        break;
+      case Blue2:
+        isRedAlliance = false;
+        stationNumber = 2;
+        break;
+      case Blue3:
+        isRedAlliance = false;
+        stationNumber = 3;
+        break;
+      case Red1:
+        isRedAlliance = true;
+        stationNumber = 1;
+        break;
+      case Red2:
+        isRedAlliance = true;
+        stationNumber = 2;
+        break;
+      default:
+        isRedAlliance = true;
+        stationNumber = 3;
+        break;
+    }
+
+
+    String eventName;
+    String gameSpecificMessage;
+    int matchNumber;
+    int replayNumber;
+    int matchType;
+    synchronized (m_cacheDataMutex) {
+      eventName = m_matchInfo.eventName;
+      gameSpecificMessage = m_matchInfo.gameSpecificMessage;
+      matchNumber = m_matchInfo.matchNumber;
+      replayNumber = m_matchInfo.replayNumber;
+      matchType = m_matchInfo.matchType;
+    }
+
+    m_matchDataSender.alliance.setBoolean(isRedAlliance);
+    m_matchDataSender.station.setDouble(stationNumber);
+    m_matchDataSender.eventName.setString(eventName);
+    m_matchDataSender.gameSpecificMessage.setString(gameSpecificMessage);
+    m_matchDataSender.matchNumber.setDouble(matchNumber);
+    m_matchDataSender.replayNumber.setDouble(replayNumber);
+    m_matchDataSender.matchType.setDouble(matchType);
+    m_matchDataSender.controlWord.setDouble(HAL.nativeGetControlWord());
+  }
+
+  /**
+   * Copy data from the DS task for the user. If no new data exists, it will just be returned,
+   * otherwise the data will be copied from the DS polling loop.
+   */
+  protected void getData() {
+    // Get the status of all of the joysticks
+    for (byte stick = 0; stick < kJoystickPorts; stick++) {
+      m_joystickAxesCache[stick].m_count =
+          HAL.getJoystickAxes(stick, m_joystickAxesCache[stick].m_axes);
+      m_joystickPOVsCache[stick].m_count =
+          HAL.getJoystickPOVs(stick, m_joystickPOVsCache[stick].m_povs);
+      m_joystickButtonsCache[stick].m_buttons = HAL.getJoystickButtons(stick, m_buttonCountBuffer);
+      m_joystickButtonsCache[stick].m_count = m_buttonCountBuffer.get(0);
+    }
+
+    HAL.getMatchInfo(m_matchInfoCache);
+
+    // Force a control word update, to make sure the data is the newest.
+    updateControlWord(true);
+
+    // lock joystick mutex to swap cache data
+    synchronized (m_cacheDataMutex) {
+      for (int i = 0; i < kJoystickPorts; i++) {
+        // If buttons weren't pressed and are now, set flags in m_buttonsPressed
+        m_joystickButtonsPressed[i].m_buttons |=
+            ~m_joystickButtons[i].m_buttons & m_joystickButtonsCache[i].m_buttons;
+
+        // If buttons were pressed and aren't now, set flags in m_buttonsReleased
+        m_joystickButtonsReleased[i].m_buttons |=
+            m_joystickButtons[i].m_buttons & ~m_joystickButtonsCache[i].m_buttons;
+      }
+
+      // move cache to actual data
+      HALJoystickAxes[] currentAxes = m_joystickAxes;
+      m_joystickAxes = m_joystickAxesCache;
+      m_joystickAxesCache = currentAxes;
+
+      HALJoystickButtons[] currentButtons = m_joystickButtons;
+      m_joystickButtons = m_joystickButtonsCache;
+      m_joystickButtonsCache = currentButtons;
+
+      HALJoystickPOVs[] currentPOVs = m_joystickPOVs;
+      m_joystickPOVs = m_joystickPOVsCache;
+      m_joystickPOVsCache = currentPOVs;
+
+      MatchInfoData currentInfo = m_matchInfo;
+      m_matchInfo = m_matchInfoCache;
+      m_matchInfoCache = currentInfo;
+    }
+
+    m_waitForDataMutex.lock();
+    m_waitForDataCount++;
+    m_waitForDataCond.signalAll();
+    m_waitForDataMutex.unlock();
+
+    sendMatchData();
+  }
+
+  /**
+   * Reports errors related to unplugged joysticks Throttles the errors so that they don't overwhelm
+   * the DS.
+   */
+  private void reportJoystickUnpluggedError(String message) {
+    double currentTime = Timer.getFPGATimestamp();
+    if (currentTime > m_nextMessageTime) {
+      reportError(message, false);
+      m_nextMessageTime = currentTime + JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL;
+    }
+  }
+
+  /**
+   * Reports errors related to unplugged joysticks Throttles the errors so that they don't overwhelm
+   * the DS.
+   */
+  private void reportJoystickUnpluggedWarning(String message) {
+    double currentTime = Timer.getFPGATimestamp();
+    if (currentTime > m_nextMessageTime) {
+      reportWarning(message, false);
+      m_nextMessageTime = currentTime + JOYSTICK_UNPLUGGED_MESSAGE_INTERVAL;
+    }
+  }
+
+  /**
+   * Provides the service routine for the DS polling m_thread.
+   */
+  private void run() {
+    int safetyCounter = 0;
+    while (m_threadKeepAlive) {
+      HAL.waitForDSData();
+      getData();
+
+      if (isDisabled()) {
+        safetyCounter = 0;
+      }
+
+      if (++safetyCounter >= 4) {
+        MotorSafetyHelper.checkMotors();
+        safetyCounter = 0;
+      }
+      if (m_userInDisabled) {
+        HAL.observeUserProgramDisabled();
+      }
+      if (m_userInAutonomous) {
+        HAL.observeUserProgramAutonomous();
+      }
+      if (m_userInTeleop) {
+        HAL.observeUserProgramTeleop();
+      }
+      if (m_userInTest) {
+        HAL.observeUserProgramTest();
+      }
+    }
+  }
+
+  /**
+   * Updates the data in the control word cache. Updates if the force parameter is set, or if
+   * 50ms have passed since the last update.
+   *
+   * @param force True to force an update to the cache, otherwise update if 50ms have passed.
+   */
+  private void updateControlWord(boolean force) {
+    long now = System.currentTimeMillis();
+    synchronized (m_controlWordMutex) {
+      if (now - m_lastControlWordUpdate > 50 || force) {
+        HAL.getControlWord(m_controlWordCache);
+        m_lastControlWordUpdate = now;
+      }
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java
new file mode 100644
index 0000000..93d70f1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Encoder.java
@@ -0,0 +1,570 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.EncoderJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+import edu.wpi.first.wpilibj.util.AllocationException;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Class to read quadrature encoders.
+ *
+ * <p>Quadrature encoders are devices that count shaft rotation and can sense direction. The output
+ * of the Encoder class is an integer that can count either up or down, and can go negative for
+ * reverse direction counting. When creating Encoders, a direction can be supplied that inverts the
+ * sense of the output to make code more readable if the encoder is mounted such that forward
+ * movement generates negative values. Quadrature encoders have two digital outputs, an A Channel
+ * and a B Channel, that are out of phase with each other for direction sensing.
+ *
+ * <p>All encoders will immediately start counting - reset() them if you need them to be zeroed
+ * before use.
+ */
+public class Encoder extends SensorBase implements CounterBase, PIDSource, Sendable {
+  public enum IndexingType {
+    kResetWhileHigh(0), kResetWhileLow(1), kResetOnFallingEdge(2), kResetOnRisingEdge(3);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    IndexingType(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * The a source.
+   */
+  @SuppressWarnings("MemberName")
+  protected DigitalSource m_aSource; // the A phase of the quad encoder
+  /**
+   * The b source.
+   */
+  @SuppressWarnings("MemberName")
+  protected DigitalSource m_bSource; // the B phase of the quad encoder
+  /**
+   * The index source.
+   */
+  protected DigitalSource m_indexSource = null; // Index on some encoders
+  private boolean m_allocatedA;
+  private boolean m_allocatedB;
+  private boolean m_allocatedI;
+  private PIDSourceType m_pidSource;
+
+  private int m_encoder; // the HAL encoder object
+
+
+  /**
+   * Common initialization code for Encoders. This code allocates resources for Encoders and is
+   * common to all constructors.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param reverseDirection If true, counts down instead of up (this is all relative)
+   */
+  private void initEncoder(boolean reverseDirection, final EncodingType type) {
+    m_encoder = EncoderJNI.initializeEncoder(m_aSource.getPortHandleForRouting(),
+        m_aSource.getAnalogTriggerTypeForRouting(), m_bSource.getPortHandleForRouting(),
+        m_bSource.getAnalogTriggerTypeForRouting(), reverseDirection, type.value);
+
+    m_pidSource = PIDSourceType.kDisplacement;
+
+    int fpgaIndex = getFPGAIndex();
+    HAL.report(tResourceType.kResourceType_Encoder, fpgaIndex, type.value);
+    setName("Encoder", fpgaIndex);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param channelA         The a channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
+   * @param channelB         The b channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
+   * @param reverseDirection represents the orientation of the encoder and inverts the output values
+   *                         if necessary so forward represents positive values.
+   */
+  public Encoder(final int channelA, final int channelB, boolean reverseDirection) {
+    this(channelA, channelB, reverseDirection, EncodingType.k4X);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param channelA The a channel digital input channel.
+   * @param channelB The b channel digital input channel.
+   */
+  public Encoder(final int channelA, final int channelB) {
+    this(channelA, channelB, false);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param channelA         The a channel digital input channel.
+   * @param channelB         The b channel digital input channel.
+   * @param reverseDirection represents the orientation of the encoder and inverts the output values
+   *                         if necessary so forward represents positive values.
+   * @param encodingType     either k1X, k2X, or k4X to indicate 1X, 2X or 4X decoding. If 4X is
+   *                         selected, then an encoder FPGA object is used and the returned counts
+   *                         will be 4x the encoder spec'd value since all rising and falling edges
+   *                         are counted. If 1X or 2X are selected then a m_counter object will be
+   *                         used and the returned value will either exactly match the spec'd count
+   *                         or be double (2x) the spec'd count.
+   */
+  public Encoder(final int channelA, final int channelB, boolean reverseDirection,
+                 final EncodingType encodingType) {
+    requireNonNull(encodingType, "Given encoding type was null");
+
+    m_allocatedA = true;
+    m_allocatedB = true;
+    m_allocatedI = false;
+    m_aSource = new DigitalInput(channelA);
+    m_bSource = new DigitalInput(channelB);
+    addChild(m_aSource);
+    addChild(m_bSource);
+    initEncoder(reverseDirection, encodingType);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels. Using an index pulse forces 4x
+   * encoding
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param channelA         The a channel digital input channel.
+   * @param channelB         The b channel digital input channel.
+   * @param indexChannel     The index channel digital input channel.
+   * @param reverseDirection represents the orientation of the encoder and inverts the output values
+   *                         if necessary so forward represents positive values.
+   */
+  public Encoder(final int channelA, final int channelB, final int indexChannel,
+                 boolean reverseDirection) {
+    this(channelA, channelB, reverseDirection);
+    m_allocatedI = true;
+    m_indexSource = new DigitalInput(indexChannel);
+    addChild(m_indexSource);
+    setIndexSource(m_indexSource);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels. Using an index pulse forces 4x
+   * encoding
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param channelA     The a channel digital input channel.
+   * @param channelB     The b channel digital input channel.
+   * @param indexChannel The index channel digital input channel.
+   */
+  public Encoder(final int channelA, final int channelB, final int indexChannel) {
+    this(channelA, channelB, indexChannel, false);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels as digital inputs. This is used
+   * in the case where the digital inputs are shared. The Encoder class will not allocate the
+   * digital inputs and assume that they already are counted.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param sourceA          The source that should be used for the a channel.
+   * @param sourceB          the source that should be used for the b channel.
+   * @param reverseDirection represents the orientation of the encoder and inverts the output values
+   *                         if necessary so forward represents positive values.
+   */
+  public Encoder(DigitalSource sourceA, DigitalSource sourceB, boolean reverseDirection) {
+    this(sourceA, sourceB, reverseDirection, EncodingType.k4X);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels as digital inputs. This is used
+   * in the case where the digital inputs are shared. The Encoder class will not allocate the
+   * digital inputs and assume that they already are counted.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param sourceA The source that should be used for the a channel.
+   * @param sourceB the source that should be used for the b channel.
+   */
+  public Encoder(DigitalSource sourceA, DigitalSource sourceB) {
+    this(sourceA, sourceB, false);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a and b channels as digital inputs. This is used
+   * in the case where the digital inputs are shared. The Encoder class will not allocate the
+   * digital inputs and assume that they already are counted.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param sourceA          The source that should be used for the a channel.
+   * @param sourceB          the source that should be used for the b channel.
+   * @param reverseDirection represents the orientation of the encoder and inverts the output values
+   *                         if necessary so forward represents positive values.
+   * @param encodingType     either k1X, k2X, or k4X to indicate 1X, 2X or 4X decoding. If 4X is
+   *                         selected, then an encoder FPGA object is used and the returned counts
+   *                         will be 4x the encoder spec'd value since all rising and falling edges
+   *                         are counted. If 1X or 2X are selected then a m_counter object will be
+   *                         used and the returned value will either exactly match the spec'd count
+   *                         or be double (2x) the spec'd count.
+   */
+  public Encoder(DigitalSource sourceA, DigitalSource sourceB, boolean reverseDirection,
+                 final EncodingType encodingType) {
+    requireNonNull(sourceA, "Digital Source A was null");
+    requireNonNull(sourceB, "Digital Source B was null");
+    requireNonNull(encodingType, "Given encoding type was null");
+
+    m_allocatedA = false;
+    m_allocatedB = false;
+    m_allocatedI = false;
+    m_aSource = sourceA;
+    m_bSource = sourceB;
+    initEncoder(reverseDirection, encodingType);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a, b and index channels as digital inputs. This
+   * is used in the case where the digital inputs are shared. The Encoder class will not allocate
+   * the digital inputs and assume that they already are counted.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param sourceA          The source that should be used for the a channel.
+   * @param sourceB          the source that should be used for the b channel.
+   * @param indexSource      the source that should be used for the index channel.
+   * @param reverseDirection represents the orientation of the encoder and inverts the output values
+   *                         if necessary so forward represents positive values.
+   */
+  public Encoder(DigitalSource sourceA, DigitalSource sourceB, DigitalSource indexSource,
+                 boolean reverseDirection) {
+    this(sourceA, sourceB, reverseDirection);
+    m_allocatedI = false;
+    m_indexSource = indexSource;
+    setIndexSource(indexSource);
+  }
+
+  /**
+   * Encoder constructor. Construct a Encoder given a, b and index channels as digital inputs. This
+   * is used in the case where the digital inputs are shared. The Encoder class will not allocate
+   * the digital inputs and assume that they already are counted.
+   *
+   * <p>The encoder will start counting immediately.
+   *
+   * @param sourceA     The source that should be used for the a channel.
+   * @param sourceB     the source that should be used for the b channel.
+   * @param indexSource the source that should be used for the index channel.
+   */
+  public Encoder(DigitalSource sourceA, DigitalSource sourceB, DigitalSource indexSource) {
+    this(sourceA, sourceB, indexSource, false);
+  }
+
+  /**
+   * Get the FPGA index of the encoder.
+   *
+   * @return The Encoder's FPGA index.
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public int getFPGAIndex() {
+    return EncoderJNI.getEncoderFPGAIndex(m_encoder);
+  }
+
+  /**
+   * Used to divide raw edge counts down to spec'd counts.
+   *
+   * @return The encoding scale factor 1x, 2x, or 4x, per the requested encoding type.
+   */
+  public int getEncodingScale() {
+    return EncoderJNI.getEncoderEncodingScale(m_encoder);
+  }
+
+  /**
+   * Free the resources used by this object.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_aSource != null && m_allocatedA) {
+      m_aSource.free();
+      m_allocatedA = false;
+    }
+    if (m_bSource != null && m_allocatedB) {
+      m_bSource.free();
+      m_allocatedB = false;
+    }
+    if (m_indexSource != null && m_allocatedI) {
+      m_indexSource.free();
+      m_allocatedI = false;
+    }
+
+    m_aSource = null;
+    m_bSource = null;
+    m_indexSource = null;
+    EncoderJNI.freeEncoder(m_encoder);
+    m_encoder = 0;
+  }
+
+  /**
+   * Gets the raw value from the encoder. The raw value is the actual count unscaled by the 1x, 2x,
+   * or 4x scale factor.
+   *
+   * @return Current raw count from the encoder
+   */
+  public int getRaw() {
+    return EncoderJNI.getEncoderRaw(m_encoder);
+  }
+
+  /**
+   * Gets the current count. Returns the current count on the Encoder. This method compensates for
+   * the decoding type.
+   *
+   * @return Current count from the Encoder adjusted for the 1x, 2x, or 4x scale factor.
+   */
+  public int get() {
+    return EncoderJNI.getEncoder(m_encoder);
+  }
+
+  /**
+   * Reset the Encoder distance to zero. Resets the current count to zero on the encoder.
+   */
+  public void reset() {
+    EncoderJNI.resetEncoder(m_encoder);
+  }
+
+  /**
+   * Returns the period of the most recent pulse. Returns the period of the most recent Encoder
+   * pulse in seconds. This method compensates for the decoding type.
+   *
+   * <p><b>Warning:</b> This returns unscaled periods. Use getRate() for rates that are scaled using
+   * the value from setDistancePerPulse().
+   *
+   * @return Period in seconds of the most recent pulse.
+   * @deprecated Use getRate() in favor of this method.
+   */
+  @Deprecated
+  public double getPeriod() {
+    return EncoderJNI.getEncoderPeriod(m_encoder);
+  }
+
+  /**
+   * Sets the maximum period for stopped detection. Sets the value that represents the maximum
+   * period of the Encoder before it will assume that the attached device is stopped. This timeout
+   * allows users to determine if the wheels or other shaft has stopped rotating. This method
+   * compensates for the decoding type.
+   *
+   * @param maxPeriod The maximum time between rising and falling edges before the FPGA will report
+   *                  the device stopped. This is expressed in seconds.
+   */
+  public void setMaxPeriod(double maxPeriod) {
+    EncoderJNI.setEncoderMaxPeriod(m_encoder, maxPeriod);
+  }
+
+  /**
+   * Determine if the encoder is stopped. Using the MaxPeriod value, a boolean is returned that is
+   * true if the encoder is considered stopped and false if it is still moving. A stopped encoder is
+   * one where the most recent pulse width exceeds the MaxPeriod.
+   *
+   * @return True if the encoder is considered stopped.
+   */
+  public boolean getStopped() {
+    return EncoderJNI.getEncoderStopped(m_encoder);
+  }
+
+  /**
+   * The last direction the encoder value changed.
+   *
+   * @return The last direction the encoder value changed.
+   */
+  public boolean getDirection() {
+    return EncoderJNI.getEncoderDirection(m_encoder);
+  }
+
+  /**
+   * Get the distance the robot has driven since the last reset as scaled by the value from {@link
+   * #setDistancePerPulse(double)}.
+   *
+   * @return The distance driven since the last reset
+   */
+  public double getDistance() {
+    return EncoderJNI.getEncoderDistance(m_encoder);
+  }
+
+  /**
+   * Get the current rate of the encoder. Units are distance per second as scaled by the value from
+   * setDistancePerPulse().
+   *
+   * @return The current rate of the encoder.
+   */
+  public double getRate() {
+    return EncoderJNI.getEncoderRate(m_encoder);
+  }
+
+  /**
+   * Set the minimum rate of the device before the hardware reports it stopped.
+   *
+   * @param minRate The minimum rate. The units are in distance per second as scaled by the value
+   *                from setDistancePerPulse().
+   */
+  public void setMinRate(double minRate) {
+    EncoderJNI.setEncoderMinRate(m_encoder, minRate);
+  }
+
+  /**
+   * Set the distance per pulse for this encoder. This sets the multiplier used to determine the
+   * distance driven based on the count value from the encoder. Do not include the decoding type in
+   * this scale. The library already compensates for the decoding type. Set this value based on the
+   * encoder's rated Pulses per Revolution and factor in gearing reductions following the encoder
+   * shaft. This distance can be in any units you like, linear or angular.
+   *
+   * @param distancePerPulse The scale factor that will be used to convert pulses to useful units.
+   */
+  public void setDistancePerPulse(double distancePerPulse) {
+    EncoderJNI.setEncoderDistancePerPulse(m_encoder, distancePerPulse);
+  }
+
+  /**
+   * Get the distance per pulse for this encoder.
+   *
+   * @return The scale factor that will be used to convert pulses to useful units.
+   */
+  public double getDistancePerPulse() {
+    return EncoderJNI.getEncoderDistancePerPulse(m_encoder);
+  }
+
+  /**
+   * Set the direction sensing for this encoder. This sets the direction sensing on the encoder so
+   * that it could count in the correct software direction regardless of the mounting.
+   *
+   * @param reverseDirection true if the encoder direction should be reversed
+   */
+  public void setReverseDirection(boolean reverseDirection) {
+    EncoderJNI.setEncoderReverseDirection(m_encoder, reverseDirection);
+  }
+
+  /**
+   * Set the Samples to Average which specifies the number of samples of the timer to average when
+   * calculating the period. Perform averaging to account for mechanical imperfections or as
+   * oversampling to increase resolution.
+   *
+   * @param samplesToAverage The number of samples to average from 1 to 127.
+   */
+  public void setSamplesToAverage(int samplesToAverage) {
+    EncoderJNI.setEncoderSamplesToAverage(m_encoder, samplesToAverage);
+  }
+
+  /**
+   * Get the Samples to Average which specifies the number of samples of the timer to average when
+   * calculating the period. Perform averaging to account for mechanical imperfections or as
+   * oversampling to increase resolution.
+   *
+   * @return SamplesToAverage The number of samples being averaged (from 1 to 127)
+   */
+  public int getSamplesToAverage() {
+    return EncoderJNI.getEncoderSamplesToAverage(m_encoder);
+  }
+
+  /**
+   * Set which parameter of the encoder you are using as a process control variable. The encoder
+   * class supports the rate and distance parameters.
+   *
+   * @param pidSource An enum to select the parameter.
+   */
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    m_pidSource = pidSource;
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  /**
+   * Implement the PIDSource interface.
+   *
+   * @return The current value of the selected source parameter.
+   */
+  public double pidGet() {
+    switch (m_pidSource) {
+      case kDisplacement:
+        return getDistance();
+      case kRate:
+        return getRate();
+      default:
+        return 0.0;
+    }
+  }
+
+  /**
+   * Set the index source for the encoder. When this source is activated, the encoder count
+   * automatically resets.
+   *
+   * @param channel A DIO channel to set as the encoder index
+   */
+  public void setIndexSource(int channel) {
+    setIndexSource(channel, IndexingType.kResetOnRisingEdge);
+  }
+
+  /**
+   * Set the index source for the encoder. When this source is activated, the encoder count
+   * automatically resets.
+   *
+   * @param source A digital source to set as the encoder index
+   */
+  public void setIndexSource(DigitalSource source) {
+    setIndexSource(source, IndexingType.kResetOnRisingEdge);
+  }
+
+  /**
+   * Set the index source for the encoder. When this source rises, the encoder count automatically
+   * resets.
+   *
+   * @param channel A DIO channel to set as the encoder index
+   * @param type    The state that will cause the encoder to reset
+   */
+  public void setIndexSource(int channel, IndexingType type) {
+    if (m_allocatedI) {
+      throw new AllocationException("Digital Input for Indexing already allocated");
+    }
+    m_indexSource = new DigitalInput(channel);
+    m_allocatedI = true;
+    addChild(m_indexSource);
+    setIndexSource(m_indexSource, type);
+  }
+
+  /**
+   * Set the index source for the encoder. When this source rises, the encoder count automatically
+   * resets.
+   *
+   * @param source A digital source to set as the encoder index
+   * @param type   The state that will cause the encoder to reset
+   */
+  public void setIndexSource(DigitalSource source, IndexingType type) {
+    EncoderJNI.setEncoderIndexSource(m_encoder, source.getPortHandleForRouting(),
+        source.getAnalogTriggerTypeForRouting(), type.value);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    if (EncoderJNI.getEncoderEncodingType(m_encoder) == EncodingType.k4X.value) {
+      builder.setSmartDashboardType("Quadrature Encoder");
+    } else {
+      builder.setSmartDashboardType("Encoder");
+    }
+
+    builder.addDoubleProperty("Speed", this::getRate, null);
+    builder.addDoubleProperty("Distance", this::getDistance, null);
+    builder.addDoubleProperty("Distance per Tick", this::getDistancePerPulse, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GamepadBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GamepadBase.java
new file mode 100644
index 0000000..0d3387d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GamepadBase.java
@@ -0,0 +1,61 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Gamepad Interface.
+ *
+ * @deprecated Inherit directly from GenericHID instead.
+ */
+@Deprecated
+public abstract class GamepadBase extends GenericHID {
+  public GamepadBase(int port) {
+    super(port);
+  }
+
+  public abstract double getRawAxis(int axis);
+
+  /**
+   * Is the bumper pressed.
+   *
+   * @param hand which hand
+   * @return true if the bumper is pressed
+   */
+  public abstract boolean getBumper(Hand hand);
+
+  /**
+   * Is the bumper pressed.
+   *
+   * @return true if the bumper is pressed
+   */
+  public boolean getBumper() {
+    return getBumper(Hand.kRight);
+  }
+
+  public abstract boolean getStickButton(Hand hand);
+
+  public boolean getStickButton() {
+    return getStickButton(Hand.kRight);
+  }
+
+  public abstract boolean getRawButton(int button);
+
+  public abstract int getPOV(int pov);
+
+  public abstract int getPOVCount();
+
+  public abstract HIDType getType();
+
+  public abstract String getName();
+
+  public abstract void setOutput(int outputNumber, boolean value);
+
+  public abstract void setOutputs(int value);
+
+  public abstract void setRumble(RumbleType type, double value);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GearTooth.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GearTooth.java
new file mode 100644
index 0000000..d0ccef7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GearTooth.java
@@ -0,0 +1,97 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Alias for counter class. Implement the gear tooth sensor supplied by FIRST. Currently there is no
+ * reverse sensing on the gear tooth sensor, but in future versions we might implement the necessary
+ * timing in the FPGA to sense direction.
+ */
+public class GearTooth extends Counter {
+  private static final double kGearToothThreshold = 55e-6;
+
+  /**
+   * Common code called by the constructors.
+   */
+  public void enableDirectionSensing(boolean directionSensitive) {
+    if (directionSensitive) {
+      setPulseLengthMode(kGearToothThreshold);
+    }
+  }
+
+  /**
+   * Construct a GearTooth sensor given a channel.
+   *
+   * <p>No direction sensing is assumed.
+   *
+   * @param channel The GPIO channel that the sensor is connected to.
+   */
+  public GearTooth(final int channel) {
+    this(channel, false);
+  }
+
+  /**
+   * Construct a GearTooth sensor given a channel.
+   *
+   * @param channel            The DIO channel that the sensor is connected to. 0-9 are on-board,
+   *                           10-25 are on the MXP port
+   * @param directionSensitive True to enable the pulse length decoding in hardware to specify count
+   *                           direction.
+   */
+  public GearTooth(final int channel, boolean directionSensitive) {
+    super(channel);
+    enableDirectionSensing(directionSensitive);
+    if (directionSensitive) {
+      HAL.report(tResourceType.kResourceType_GearTooth, channel, 0, "D");
+    } else {
+      HAL.report(tResourceType.kResourceType_GearTooth, channel, 0);
+    }
+    setName("GearTooth", channel);
+  }
+
+  /**
+   * Construct a GearTooth sensor given a digital input. This should be used when sharing digital
+   * inputs.
+   *
+   * @param source             An existing DigitalSource object (such as a DigitalInput)
+   * @param directionSensitive True to enable the pulse length decoding in hardware to specify count
+   *                           direction.
+   */
+  public GearTooth(DigitalSource source, boolean directionSensitive) {
+    super(source);
+    enableDirectionSensing(directionSensitive);
+    if (directionSensitive) {
+      HAL.report(tResourceType.kResourceType_GearTooth, source.getChannel(), 0, "D");
+    } else {
+      HAL.report(tResourceType.kResourceType_GearTooth, source.getChannel(), 0);
+    }
+    setName("GearTooth", source.getChannel());
+  }
+
+  /**
+   * Construct a GearTooth sensor given a digital input. This should be used when sharing digital
+   * inputs.
+   *
+   * <p>No direction sensing is assumed.
+   *
+   * @param source An object that fully describes the input that the sensor is connected to.
+   */
+  public GearTooth(DigitalSource source) {
+    this(source, false);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    super.initSendable(builder);
+    builder.setSmartDashboardType("Gear Tooth");
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
new file mode 100644
index 0000000..11293c3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GenericHID.java
@@ -0,0 +1,271 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * GenericHID Interface.
+ */
+public abstract class GenericHID {
+  /**
+   * Represents a rumble output on the JoyStick.
+   */
+  public enum RumbleType {
+    kLeftRumble, kRightRumble
+  }
+
+  public enum HIDType {
+    kUnknown(-1),
+    kXInputUnknown(0),
+    kXInputGamepad(1),
+    kXInputWheel(2),
+    kXInputArcadeStick(3),
+    kXInputFlightStick(4),
+    kXInputDancePad(5),
+    kXInputGuitar(6),
+    kXInputGuitar2(7),
+    kXInputDrumKit(8),
+    kXInputGuitar3(11),
+    kXInputArcadePad(19),
+    kHIDJoystick(20),
+    kHIDGamepad(21),
+    kHIDDriving(22),
+    kHIDFlight(23),
+    kHID1stPerson(24);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    HIDType(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Which hand the Human Interface Device is associated with.
+   */
+  public enum Hand {
+    kLeft(0), kRight(1);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    Hand(int value) {
+      this.value = value;
+    }
+  }
+
+  private DriverStation m_ds;
+  private final int m_port;
+  private int m_outputs;
+  private short m_leftRumble;
+  private short m_rightRumble;
+
+  public GenericHID(int port) {
+    m_ds = DriverStation.getInstance();
+    m_port = port;
+  }
+
+  /**
+   * Get the x position of the HID.
+   *
+   * @return the x position of the HID
+   */
+  public final double getX() {
+    return getX(Hand.kRight);
+  }
+
+  /**
+   * Get the x position of HID.
+   *
+   * @param hand which hand, left or right
+   * @return the x position
+   */
+  public abstract double getX(Hand hand);
+
+  /**
+   * Get the y position of the HID.
+   *
+   * @return the y position
+   */
+  public final double getY() {
+    return getY(Hand.kRight);
+  }
+
+  /**
+   * Get the y position of the HID.
+   *
+   * @param hand which hand, left or right
+   * @return the y position
+   */
+  public abstract double getY(Hand hand);
+
+  /**
+   * Get the button value (starting at button 1).
+   *
+   * <p>The buttons are returned in a single 16 bit value with one bit representing the state of
+   * each button. The appropriate button is returned as a boolean value.
+   *
+   * @param button The button number to be read (starting at 1)
+   * @return The state of the button.
+   */
+  public boolean getRawButton(int button) {
+    return m_ds.getStickButton(m_port, (byte) button);
+  }
+
+  /**
+   * Whether the button was pressed since the last check. Button indexes begin at
+   * 1.
+   *
+   * @param button The button index, beginning at 1.
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getRawButtonPressed(int button) {
+    return m_ds.getStickButtonPressed(m_port, (byte) button);
+  }
+
+  /**
+   * Whether the button was released since the last check. Button indexes begin at
+   * 1.
+   *
+   * @param button The button index, beginning at 1.
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getRawButtonReleased(int button) {
+    return m_ds.getStickButtonReleased(m_port, button);
+  }
+
+  /**
+   * Get the value of the axis.
+   *
+   * @param axis The axis to read, starting at 0.
+   * @return The value of the axis.
+   */
+  public double getRawAxis(int axis) {
+    return m_ds.getStickAxis(m_port, axis);
+  }
+
+  /**
+   * Get the angle in degrees of a POV on the HID.
+   *
+   * <p>The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90,
+   * upper-left is 315).
+   *
+   * @param pov The index of the POV to read (starting at 0)
+   * @return the angle of the POV in degrees, or -1 if the POV is not pressed.
+   */
+  public int getPOV(int pov) {
+    return m_ds.getStickPOV(m_port, pov);
+  }
+
+  public int getPOV() {
+    return getPOV(0);
+  }
+
+  /**
+   * Get the number of axes for the HID.
+   *
+   * @return the number of axis for the current HID
+   */
+  public int getAxisCount() {
+    return m_ds.getStickAxisCount(m_port);
+  }
+
+  /**
+   * For the current HID, return the number of POVs.
+   */
+  public int getPOVCount() {
+    return m_ds.getStickPOVCount(m_port);
+  }
+
+  /**
+   * For the current HID, return the number of buttons.
+   */
+  public int getButtonCount() {
+    return m_ds.getStickButtonCount(m_port);
+  }
+
+  /**
+   * Get the type of the HID.
+   *
+   * @return the type of the HID.
+   */
+  public HIDType getType() {
+    return HIDType.values()[m_ds.getJoystickType(m_port)];
+  }
+
+  /**
+   * Get the name of the HID.
+   *
+   * @return the name of the HID.
+   */
+  public String getName() {
+    return m_ds.getJoystickName(m_port);
+  }
+
+  /**
+   * Get the axis type of a joystick axis.
+   *
+   * @return the axis type of a joystick axis.
+   */
+  public int getAxisType(int axis) {
+    return m_ds.getJoystickAxisType(m_port, axis);
+  }
+
+  /**
+   * Get the port number of the HID.
+   *
+   * @return The port number of the HID.
+   */
+  public int getPort() {
+    return m_port;
+  }
+
+  /**
+   * Set a single HID output value for the HID.
+   *
+   * @param outputNumber The index of the output to set (1-32)
+   * @param value        The value to set the output to
+   */
+  public void setOutput(int outputNumber, boolean value) {
+    m_outputs = (m_outputs & ~(1 << (outputNumber - 1))) | ((value ? 1 : 0) << (outputNumber - 1));
+    HAL.setJoystickOutputs((byte) m_port, m_outputs, m_leftRumble, m_rightRumble);
+  }
+
+  /**
+   * Set all HID output values for the HID.
+   *
+   * @param value The 32 bit output value (1 bit for each output)
+   */
+  public void setOutputs(int value) {
+    m_outputs = value;
+    HAL.setJoystickOutputs((byte) m_port, m_outputs, m_leftRumble, m_rightRumble);
+  }
+
+  /**
+   * Set the rumble output for the HID. The DS currently supports 2 rumble values, left rumble and
+   * right rumble.
+   *
+   * @param type  Which rumble value to set
+   * @param value The normalized value (0 to 1) to set the rumble to
+   */
+  public void setRumble(RumbleType type, double value) {
+    if (value < 0) {
+      value = 0;
+    } else if (value > 1) {
+      value = 1;
+    }
+    if (type == RumbleType.kLeftRumble) {
+      m_leftRumble = (short) (value * 65535);
+    } else {
+      m_rightRumble = (short) (value * 65535);
+    }
+    HAL.setJoystickOutputs((byte) m_port, m_outputs, m_leftRumble, m_rightRumble);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GyroBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GyroBase.java
new file mode 100644
index 0000000..9647df7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/GyroBase.java
@@ -0,0 +1,58 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.interfaces.Gyro;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * GyroBase is the common base class for Gyro implementations such as AnalogGyro.
+ */
+public abstract class GyroBase extends SensorBase implements Gyro, PIDSource, Sendable {
+  private PIDSourceType m_pidSource = PIDSourceType.kDisplacement;
+
+  /**
+   * Set which parameter of the gyro you are using as a process control variable. The Gyro class
+   * supports the rate and displacement parameters
+   *
+   * @param pidSource An enum to select the parameter.
+   */
+  @Override
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    m_pidSource = pidSource;
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  /**
+   * Get the output of the gyro for use with PIDControllers. May be the angle or rate depending on
+   * the set PIDSourceType
+   *
+   * @return the output according to the gyro
+   */
+  @Override
+  public double pidGet() {
+    switch (m_pidSource) {
+      case kRate:
+        return getRate();
+      case kDisplacement:
+        return getAngle();
+      default:
+        return 0.0;
+    }
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Gyro");
+    builder.addDoubleProperty("Value", this::getAngle, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/HLUsageReporting.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/HLUsageReporting.java
new file mode 100644
index 0000000..3eca63b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/HLUsageReporting.java
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;
+
+/**
+ * Support for high level usage reporting.
+ */
+@SuppressWarnings("JavadocMethod")
+public class HLUsageReporting {
+  private static Interface impl;
+
+  @SuppressWarnings("MethodName")
+  public static void SetImplementation(Interface implementation) {
+    impl = implementation;
+  }
+
+  public static void reportScheduler() {
+    if (impl != null) {
+      impl.reportScheduler();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, HLUsageReporting.class);
+    }
+  }
+
+  public static void reportPIDController(int num) {
+    if (impl != null) {
+      impl.reportPIDController(num);
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, HLUsageReporting.class);
+    }
+  }
+
+  public static void reportSmartDashboard() {
+    if (impl != null) {
+      impl.reportSmartDashboard();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, HLUsageReporting.class);
+    }
+  }
+
+  public interface Interface {
+    void reportScheduler();
+
+    void reportPIDController(int num);
+
+    void reportSmartDashboard();
+  }
+
+  public static class Null implements Interface {
+    public void reportScheduler() {
+    }
+
+    @SuppressWarnings("PMD.UnusedFormalParameter")
+    public void reportPIDController(int num) {
+    }
+
+    public void reportSmartDashboard() {
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java
new file mode 100644
index 0000000..7c76ac9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/I2C.java
@@ -0,0 +1,370 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.I2CJNI;
+import edu.wpi.first.wpilibj.util.BoundaryException;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * I2C bus interface class.
+ *
+ * <p>This class is intended to be used by sensor (and other I2C device) drivers. It probably should
+ * not be used directly.
+ */
+public class I2C {
+  public enum Port {
+    kOnboard(0), kMXP(1);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    Port(int value) {
+      this.value = value;
+    }
+  }
+
+  private final int m_port;
+  private final int m_deviceAddress;
+
+  /**
+   * Constructor.
+   *
+   * @param port          The I2C port the device is connected to.
+   * @param deviceAddress The address of the device on the I2C bus.
+   */
+  public I2C(Port port, int deviceAddress) {
+    m_port = port.value;
+    m_deviceAddress = deviceAddress;
+
+    I2CJNI.i2CInitialize((byte) port.value);
+
+    HAL.report(tResourceType.kResourceType_I2C, deviceAddress);
+  }
+
+  /**
+   * Destructor.
+   */
+  public void free() {
+    I2CJNI.i2CClose(m_port);
+  }
+
+  /**
+   * Generic transaction.
+   *
+   * <p>This is a lower-level interface to the I2C hardware giving you more control over each
+   * transaction.
+   *
+   * @param dataToSend   Buffer of data to send as part of the transaction.
+   * @param sendSize     Number of bytes to send as part of the transaction.
+   * @param dataReceived Buffer to read data into.
+   * @param receiveSize  Number of bytes to read from the device.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public synchronized boolean transaction(byte[] dataToSend, int sendSize,
+                                          byte[] dataReceived, int receiveSize) {
+    if (dataToSend.length < sendSize) {
+      throw new IllegalArgumentException("dataToSend is too small, must be at least " + sendSize);
+    }
+    if (dataReceived.length < receiveSize) {
+      throw new IllegalArgumentException(
+          "dataReceived is too small, must be at least " + receiveSize);
+    }
+    return I2CJNI.i2CTransactionB(m_port, (byte) m_deviceAddress, dataToSend,
+                                  (byte) sendSize, dataReceived, (byte) receiveSize) < 0;
+  }
+
+  /**
+   * Generic transaction.
+   *
+   * <p>This is a lower-level interface to the I2C hardware giving you more control over each
+   * transaction.
+   *
+   * @param dataToSend   Buffer of data to send as part of the transaction.
+   * @param sendSize     Number of bytes to send as part of the transaction.
+   * @param dataReceived Buffer to read data into.
+   * @param receiveSize  Number of bytes to read from the device.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public synchronized boolean transaction(ByteBuffer dataToSend, int sendSize,
+                                          ByteBuffer dataReceived, int receiveSize) {
+    if (dataToSend.hasArray() && dataReceived.hasArray()) {
+      return transaction(dataToSend.array(), sendSize, dataReceived.array(), receiveSize);
+    }
+    if (!dataToSend.isDirect()) {
+      throw new IllegalArgumentException("dataToSend must be a direct buffer");
+    }
+    if (dataToSend.capacity() < sendSize) {
+      throw new IllegalArgumentException("dataToSend is too small, must be at least " + sendSize);
+    }
+    if (!dataReceived.isDirect()) {
+      throw new IllegalArgumentException("dataReceived must be a direct buffer");
+    }
+    if (dataReceived.capacity() < receiveSize) {
+      throw new IllegalArgumentException(
+          "dataReceived is too small, must be at least " + receiveSize);
+    }
+
+    return I2CJNI.i2CTransaction(m_port, (byte) m_deviceAddress, dataToSend,
+                                 (byte) sendSize, dataReceived, (byte) receiveSize) < 0;
+  }
+
+  /**
+   * Attempt to address a device on the I2C bus.
+   *
+   * <p>This allows you to figure out if there is a device on the I2C bus that responds to the
+   * address specified in the constructor.
+   *
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public boolean addressOnly() {
+    return transaction(new byte[0], (byte) 0, new byte[0], (byte) 0);
+  }
+
+  /**
+   * Execute a write transaction with the device.
+   *
+   * <p>Write a single byte to a register on a device and wait until the transaction is complete.
+   *
+   * @param registerAddress The address of the register on the device to be written.
+   * @param data            The byte to write to the register on the device.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public synchronized boolean write(int registerAddress, int data) {
+    byte[] buffer = new byte[2];
+    buffer[0] = (byte) registerAddress;
+    buffer[1] = (byte) data;
+    return I2CJNI.i2CWriteB(m_port, (byte) m_deviceAddress, buffer,
+                            (byte) buffer.length) < 0;
+  }
+
+  /**
+   * Execute a write transaction with the device.
+   *
+   * <p>Write multiple bytes to a register on a device and wait until the transaction is complete.
+   *
+   * @param data The data to write to the device.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public synchronized boolean writeBulk(byte[] data) {
+    return writeBulk(data, data.length);
+  }
+
+  /**
+   * Execute a write transaction with the device.
+   *
+   * <p>Write multiple bytes to a register on a device and wait until the transaction is complete.
+   *
+   * @param data The data to write to the device.
+   * @param size The number of data bytes to write.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public synchronized boolean writeBulk(byte[] data, int size) {
+    if (data.length < size) {
+      throw new IllegalArgumentException(
+          "buffer is too small, must be at least " + size);
+    }
+    return I2CJNI.i2CWriteB(m_port, (byte) m_deviceAddress, data, (byte) size) < 0;
+  }
+
+  /**
+   * Execute a write transaction with the device.
+   *
+   * <p>Write multiple bytes to a register on a device and wait until the transaction is complete.
+   *
+   * @param data The data to write to the device.
+   * @param size The number of data bytes to write.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public synchronized boolean writeBulk(ByteBuffer data, int size) {
+    if (data.hasArray()) {
+      return writeBulk(data.array(), size);
+    }
+    if (!data.isDirect()) {
+      throw new IllegalArgumentException("must be a direct buffer");
+    }
+    if (data.capacity() < size) {
+      throw new IllegalArgumentException(
+          "buffer is too small, must be at least " + size);
+    }
+
+    return I2CJNI.i2CWrite(m_port, (byte) m_deviceAddress, data, (byte) size) < 0;
+  }
+
+  /**
+   * Execute a read transaction with the device.
+   *
+   * <p>Read bytes from a device. Most I2C devices will auto-increment the register pointer
+   * internally allowing you to read consecutive registers on a device in a single transaction.
+   *
+   * @param registerAddress The register to read first in the transaction.
+   * @param count           The number of bytes to read in the transaction.
+   * @param buffer          A pointer to the array of bytes to store the data read from the device.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public boolean read(int registerAddress, int count, byte[] buffer) {
+    requireNonNull(buffer, "Null return buffer was given");
+
+    if (count < 1) {
+      throw new BoundaryException("Value must be at least 1, " + count + " given");
+    }
+    if (buffer.length < count) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + count);
+    }
+
+    byte[] registerAddressArray = new byte[1];
+    registerAddressArray[0] = (byte) registerAddress;
+
+    return transaction(registerAddressArray, registerAddressArray.length, buffer, count);
+  }
+
+  private ByteBuffer m_readDataToSendBuffer = null;
+
+  /**
+   * Execute a read transaction with the device.
+   *
+   * <p>Read bytes from a device. Most I2C devices will auto-increment the register pointer
+   * internally allowing you to read consecutive registers on a device in a single transaction.
+   *
+   * @param registerAddress The register to read first in the transaction.
+   * @param count           The number of bytes to read in the transaction.
+   * @param buffer          A buffer to store the data read from the device.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public boolean read(int registerAddress, int count, ByteBuffer buffer) {
+    if (count < 1) {
+      throw new BoundaryException("Value must be at least 1, " + count + " given");
+    }
+
+    if (buffer.hasArray()) {
+      return read(registerAddress, count, buffer.array());
+    }
+
+    if (!buffer.isDirect()) {
+      throw new IllegalArgumentException("must be a direct buffer");
+    }
+    if (buffer.capacity() < count) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + count);
+    }
+
+    synchronized (this) {
+      if (m_readDataToSendBuffer == null) {
+        m_readDataToSendBuffer = ByteBuffer.allocateDirect(1);
+      }
+      m_readDataToSendBuffer.put(0, (byte) registerAddress);
+
+      return transaction(m_readDataToSendBuffer, 1, buffer, count);
+    }
+  }
+
+  /**
+   * Execute a read only transaction with the device.
+   *
+   * <p>Read bytes from a device. This method does not write any data to prompt the device.
+   *
+   * @param buffer A pointer to the array of bytes to store the data read from the device.
+   * @param count  The number of bytes to read in the transaction.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public boolean readOnly(byte[] buffer, int count) {
+    requireNonNull(buffer, "Null return buffer was given");
+    if (count < 1) {
+      throw new BoundaryException("Value must be at least 1, " + count + " given");
+    }
+    if (buffer.length < count) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + count);
+    }
+
+    return I2CJNI.i2CReadB(m_port, (byte) m_deviceAddress, buffer,
+                           (byte) count) < 0;
+  }
+
+  /**
+   * Execute a read only transaction with the device.
+   *
+   * <p>Read bytes from a device. This method does not write any data to prompt the device.
+   *
+   * @param buffer A pointer to the array of bytes to store the data read from the device.
+   * @param count  The number of bytes to read in the transaction.
+   * @return Transfer Aborted... false for success, true for aborted.
+   */
+  public boolean readOnly(ByteBuffer buffer, int count) {
+    if (count < 1) {
+      throw new BoundaryException("Value must be at least 1, " + count
+          + " given");
+    }
+
+    if (buffer.hasArray()) {
+      return readOnly(buffer.array(), count);
+    }
+
+    if (!buffer.isDirect()) {
+      throw new IllegalArgumentException("must be a direct buffer");
+    }
+    if (buffer.capacity() < count) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + count);
+    }
+
+    return I2CJNI.i2CRead(m_port, (byte) m_deviceAddress, buffer, (byte) count)
+        < 0;
+  }
+
+  /*
+   * Send a broadcast write to all devices on the I2C bus.
+   *
+   * <p>This is not currently implemented!
+   *
+   * @param registerAddress The register to write on all devices on the bus.
+   * @param data            The value to write to the devices.
+   */
+  // public void broadcast(int registerAddress, int data) {
+  // }
+
+  /**
+   * Verify that a device's registers contain expected values.
+   *
+   * <p>Most devices will have a set of registers that contain a known value that can be used to
+   * identify them. This allows an I2C device driver to easily verify that the device contains the
+   * expected value.
+   *
+   * @param registerAddress The base register to start reading from the device.
+   * @param count           The size of the field to be verified.
+   * @param expected        A buffer containing the values expected from the device.
+   * @return true if the sensor was verified to be connected
+   * @pre The device must support and be configured to use register auto-increment.
+   */
+  public boolean verifySensor(int registerAddress, int count,
+                              byte[] expected) {
+    // TODO: Make use of all 7 read bytes
+    byte[] dataToSend = new byte[1];
+
+    byte[] deviceData = new byte[4];
+    for (int i = 0, curRegisterAddress = registerAddress;
+         i < count; i += 4, curRegisterAddress += 4) {
+      int toRead = count - i < 4 ? count - i : 4;
+      // Read the chunk of data. Return false if the sensor does not
+      // respond.
+      dataToSend[0] = (byte) curRegisterAddress;
+      if (transaction(dataToSend, 1, deviceData, toRead)) {
+        return false;
+      }
+
+      for (byte j = 0; j < toRead; j++) {
+        if (deviceData[j] != expected[i + j]) {
+          return false;
+        }
+      }
+    }
+    return true;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptHandlerFunction.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptHandlerFunction.java
new file mode 100644
index 0000000..ed9048e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptHandlerFunction.java
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.InterruptJNI.InterruptJNIHandlerFunction;
+
+
+/**
+ * It is recommended that you use this class in conjunction with classes from {@link
+ * java.util.concurrent.atomic} as these objects are all thread safe.
+ *
+ * @param <T> The type of the parameter that should be returned to the the method {@link
+ *            #interruptFired(int, Object)}
+ */
+public abstract class InterruptHandlerFunction<T> {
+  /**
+   * The entry point for the interrupt. When the interrupt fires the {@link #apply(int, Object)}
+   * method is called. The outer class is provided as an interface to allow the implementer to pass
+   * a generic object to the interrupt fired method.
+   */
+  private class Function implements InterruptJNIHandlerFunction {
+    @SuppressWarnings("unchecked")
+    @Override
+    public void apply(int interruptAssertedMask, Object param) {
+      interruptFired(interruptAssertedMask, (T) param);
+    }
+  }
+
+  final Function m_function = new Function();
+
+  /**
+   * This method is run every time an interrupt is fired.
+   *
+   * @param interruptAssertedMask Interrupt Mask
+   * @param param                 The parameter provided by overriding the {@link
+   *                              #overridableParameter()} method.
+   */
+  public abstract void interruptFired(int interruptAssertedMask, T param);
+
+
+  /**
+   * Override this method if you would like to pass a specific parameter to the {@link
+   * #interruptFired(int, Object)} when it is fired by the interrupt. This method is called once
+   * when {@link InterruptableSensorBase#requestInterrupts(InterruptHandlerFunction)} is run.
+   *
+   * @return The object that should be passed to the interrupt when it runs
+   */
+  public T overridableParameter() {
+    return null;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java
new file mode 100644
index 0000000..f690d3a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/InterruptableSensorBase.java
@@ -0,0 +1,251 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.InterruptJNI;
+import edu.wpi.first.wpilibj.util.AllocationException;
+
+
+/**
+ * Base for sensors to be used with interrupts.
+ */
+public abstract class InterruptableSensorBase extends SensorBase {
+  @SuppressWarnings("JavadocMethod")
+  public enum WaitResult {
+    kTimeout(0x0), kRisingEdge(0x1), kFallingEdge(0x100), kBoth(0x101);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    WaitResult(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * The interrupt resource.
+   */
+  protected int m_interrupt = InterruptJNI.HalInvalidHandle;
+
+  /**
+   * Flags if the interrupt being allocated is synchronous.
+   */
+  protected boolean m_isSynchronousInterrupt = false;
+
+  /**
+   * Create a new InterrupatableSensorBase.
+   */
+  public InterruptableSensorBase() {
+    m_interrupt = 0;
+  }
+
+  /**
+   * Frees the resources for this output.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_interrupt != 0) {
+      cancelInterrupts();
+    }
+  }
+
+  /**
+   * If this is an analog trigger.
+   *
+   * @return true if this is an analog trigger.
+   */
+  public abstract int getAnalogTriggerTypeForRouting();
+
+  /**
+   * The channel routing number.
+   *
+   * @return channel routing number
+   */
+  public abstract int getPortHandleForRouting();
+
+  /**
+   * Request one of the 8 interrupts asynchronously on this digital input.
+   *
+   * @param handler The {@link InterruptHandlerFunction} that contains the method {@link
+   *                InterruptHandlerFunction#interruptFired(int, Object)} that will be called
+   *                whenever there is an interrupt on this device. Request interrupts in synchronous
+   *                mode where the user program interrupt handler will be called when an interrupt
+   *                occurs. The default is interrupt on rising edges only.
+   */
+  public void requestInterrupts(InterruptHandlerFunction<?> handler) {
+    if (m_interrupt != 0) {
+      throw new AllocationException("The interrupt has already been allocated");
+    }
+
+    allocateInterrupts(false);
+
+    assert m_interrupt != 0;
+
+    InterruptJNI.requestInterrupts(m_interrupt, getPortHandleForRouting(),
+        getAnalogTriggerTypeForRouting());
+    setUpSourceEdge(true, false);
+    InterruptJNI.attachInterruptHandler(m_interrupt, handler.m_function,
+        handler.overridableParameter());
+  }
+
+  /**
+   * Request one of the 8 interrupts synchronously on this digital input. Request interrupts in
+   * synchronous mode where the user program will have to explicitly wait for the interrupt to occur
+   * using {@link #waitForInterrupt}. The default is interrupt on rising edges only.
+   */
+  public void requestInterrupts() {
+    if (m_interrupt != 0) {
+      throw new AllocationException("The interrupt has already been allocated");
+    }
+
+    allocateInterrupts(true);
+
+    assert m_interrupt != 0;
+
+    InterruptJNI.requestInterrupts(m_interrupt, getPortHandleForRouting(),
+        getAnalogTriggerTypeForRouting());
+    setUpSourceEdge(true, false);
+
+  }
+
+  /**
+   * Allocate the interrupt.
+   *
+   * @param watcher true if the interrupt should be in synchronous mode where the user program will
+   *                have to explicitly wait for the interrupt to occur.
+   */
+  protected void allocateInterrupts(boolean watcher) {
+    m_isSynchronousInterrupt = watcher;
+
+    m_interrupt = InterruptJNI.initializeInterrupts(watcher);
+  }
+
+  /**
+   * Cancel interrupts on this device. This deallocates all the chipobject structures and disables
+   * any interrupts.
+   */
+  public void cancelInterrupts() {
+    if (m_interrupt == 0) {
+      throw new IllegalStateException("The interrupt is not allocated.");
+    }
+    InterruptJNI.cleanInterrupts(m_interrupt);
+    m_interrupt = 0;
+  }
+
+  /**
+   * In synchronous mode, wait for the defined interrupt to occur.
+   *
+   * @param timeout        Timeout in seconds
+   * @param ignorePrevious If true, ignore interrupts that happened before waitForInterrupt was
+   *                       called.
+   * @return Result of the wait.
+   */
+  public WaitResult waitForInterrupt(double timeout, boolean ignorePrevious) {
+    if (m_interrupt == 0) {
+      throw new IllegalStateException("The interrupt is not allocated.");
+    }
+    int result = InterruptJNI.waitForInterrupt(m_interrupt, timeout, ignorePrevious);
+
+    // Rising edge result is the interrupt bit set in the byte 0xFF
+    // Falling edge result is the interrupt bit set in the byte 0xFF00
+    // Set any bit set to be true for that edge, and AND the 2 results
+    // together to match the existing enum for all interrupts
+    int rising = ((result & 0xFF) != 0) ? 0x1 : 0x0;
+    int falling = ((result & 0xFF00) != 0) ? 0x0100 : 0x0;
+    result = rising | falling;
+
+    for (WaitResult mode : WaitResult.values()) {
+      if (mode.value == result) {
+        return mode;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * In synchronous mode, wait for the defined interrupt to occur.
+   *
+   * @param timeout Timeout in seconds
+   * @return Result of the wait.
+   */
+  public WaitResult waitForInterrupt(double timeout) {
+    return waitForInterrupt(timeout, true);
+  }
+
+  /**
+   * Enable interrupts to occur on this input. Interrupts are disabled when the RequestInterrupt
+   * call is made. This gives time to do the setup of the other options before starting to field
+   * interrupts.
+   */
+  public void enableInterrupts() {
+    if (m_interrupt == 0) {
+      throw new IllegalStateException("The interrupt is not allocated.");
+    }
+    if (m_isSynchronousInterrupt) {
+      throw new IllegalStateException("You do not need to enable synchronous interrupts");
+    }
+    InterruptJNI.enableInterrupts(m_interrupt);
+  }
+
+  /**
+   * Disable Interrupts without without deallocating structures.
+   */
+  public void disableInterrupts() {
+    if (m_interrupt == 0) {
+      throw new IllegalStateException("The interrupt is not allocated.");
+    }
+    if (m_isSynchronousInterrupt) {
+      throw new IllegalStateException("You can not disable synchronous interrupts");
+    }
+    InterruptJNI.disableInterrupts(m_interrupt);
+  }
+
+  /**
+   * Return the timestamp for the rising interrupt that occurred most recently. This is in the same
+   * time domain as getClock(). The rising-edge interrupt should be enabled with {@link
+   * #setUpSourceEdge}.
+   *
+   * @return Timestamp in seconds since boot.
+   */
+  public double readRisingTimestamp() {
+    if (m_interrupt == 0) {
+      throw new IllegalStateException("The interrupt is not allocated.");
+    }
+    return InterruptJNI.readInterruptRisingTimestamp(m_interrupt);
+  }
+
+  /**
+   * Return the timestamp for the falling interrupt that occurred most recently. This is in the same
+   * time domain as getClock(). The falling-edge interrupt should be enabled with {@link
+   * #setUpSourceEdge}.
+   *
+   * @return Timestamp in seconds since boot.
+   */
+  public double readFallingTimestamp() {
+    if (m_interrupt == 0) {
+      throw new IllegalStateException("The interrupt is not allocated.");
+    }
+    return InterruptJNI.readInterruptFallingTimestamp(m_interrupt);
+  }
+
+  /**
+   * Set which edge to trigger interrupts on.
+   *
+   * @param risingEdge  true to interrupt on rising edge
+   * @param fallingEdge true to interrupt on falling edge
+   */
+  public void setUpSourceEdge(boolean risingEdge, boolean fallingEdge) {
+    if (m_interrupt != 0) {
+      InterruptJNI.setInterruptUpSourceEdge(m_interrupt, risingEdge,
+          fallingEdge);
+    } else {
+      throw new IllegalArgumentException("You must call RequestInterrupts before setUpSourceEdge");
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java
new file mode 100644
index 0000000..10ddd4b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * IterativeRobot implements the IterativeRobotBase robot program framework.
+ *
+ * <p>The IterativeRobot class is intended to be subclassed by a user creating a robot program.
+ *
+ * <p>periodic() functions from the base class are called each time a new packet is received from
+ * the driver station.
+ */
+public class IterativeRobot extends IterativeRobotBase {
+  public IterativeRobot() {
+    HAL.report(tResourceType.kResourceType_Framework, tInstances.kFramework_Iterative);
+  }
+
+  /**
+   * Provide an alternate "main loop" via startCompetition().
+   */
+  public void startCompetition() {
+    robotInit();
+
+    // Tell the DS that the robot is ready to be enabled
+    HAL.observeUserProgramStarting();
+
+    // Loop forever, calling the appropriate mode-dependent function
+    while (true) {
+      // Wait for new data to arrive
+      m_ds.waitForData();
+
+      loopFunc();
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
new file mode 100644
index 0000000..16d5b13
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/IterativeRobotBase.java
@@ -0,0 +1,229 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.livewindow.LiveWindow;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * IterativeRobotBase implements a specific type of robot program framework, extending the RobotBase
+ * class.
+ *
+ * <p>The IterativeRobotBase class does not implement startCompetition(), so it should not be used
+ * by teams directly.
+ *
+ * <p>This class provides the following functions which are called by the main loop,
+ * startCompetition(), at the appropriate times:
+ *
+ * <p>robotInit() -- provide for initialization at robot power-on
+ *
+ * <p>init() functions -- each of the following functions is called once when the
+ * appropriate mode is entered:
+ *   - disabledInit()   -- called only when first disabled
+ *   - autonomousInit() -- called each and every time autonomous is entered from
+ *                         another mode
+ *   - teleopInit()     -- called each and every time teleop is entered from
+ *                         another mode
+ *   - testInit()       -- called each and every time test is entered from
+ *                         another mode
+ *
+ * <p>periodic() functions -- each of these functions is called on an interval:
+ *   - robotPeriodic()
+ *   - disabledPeriodic()
+ *   - autonomousPeriodic()
+ *   - teleopPeriodic()
+ *   - testPeriodic()
+ */
+public abstract class IterativeRobotBase extends RobotBase {
+  private enum Mode {
+    kNone,
+    kDisabled,
+    kAutonomous,
+    kTeleop,
+    kTest
+  }
+
+  private Mode m_lastMode = Mode.kNone;
+
+  /**
+   * Provide an alternate "main loop" via startCompetition().
+   */
+  public abstract void startCompetition();
+
+  /* ----------- Overridable initialization code ----------------- */
+
+  /**
+   * Robot-wide initialization code should go here.
+   *
+   * <p>Users should override this method for default Robot-wide initialization which will be called
+   * when the robot is first powered on. It will be called exactly one time.
+   *
+   * <p>Warning: the Driver Station "Robot Code" light and FMS "Robot Ready" indicators will be off
+   * until RobotInit() exits. Code in RobotInit() that waits for enable will cause the robot to
+   * never indicate that the code is ready, causing the robot to be bypassed in a match.
+   */
+  public void robotInit() {
+    System.out.println("Default robotInit() method... Overload me!");
+  }
+
+  /**
+   * Initialization code for disabled mode should go here.
+   *
+   * <p>Users should override this method for initialization code which will be called each time the
+   * robot enters disabled mode.
+   */
+  public void disabledInit() {
+    System.out.println("Default disabledInit() method... Overload me!");
+  }
+
+  /**
+   * Initialization code for autonomous mode should go here.
+   *
+   * <p>Users should override this method for initialization code which will be called each time the
+   * robot enters autonomous mode.
+   */
+  public void autonomousInit() {
+    System.out.println("Default autonomousInit() method... Overload me!");
+  }
+
+  /**
+   * Initialization code for teleop mode should go here.
+   *
+   * <p>Users should override this method for initialization code which will be called each time the
+   * robot enters teleop mode.
+   */
+  public void teleopInit() {
+    System.out.println("Default teleopInit() method... Overload me!");
+  }
+
+  /**
+   * Initialization code for test mode should go here.
+   *
+   * <p>Users should override this method for initialization code which will be called each time the
+   * robot enters test mode.
+   */
+  @SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
+  public void testInit() {
+    System.out.println("Default testInit() method... Overload me!");
+  }
+
+  /* ----------- Overridable periodic code ----------------- */
+
+  private boolean m_rpFirstRun = true;
+
+  /**
+   * Periodic code for all robot modes should go here.
+   */
+  public void robotPeriodic() {
+    if (m_rpFirstRun) {
+      System.out.println("Default robotPeriodic() method... Overload me!");
+      m_rpFirstRun = false;
+    }
+  }
+
+  private boolean m_dpFirstRun = true;
+
+  /**
+   * Periodic code for disabled mode should go here.
+   */
+  public void disabledPeriodic() {
+    if (m_dpFirstRun) {
+      System.out.println("Default disabledPeriodic() method... Overload me!");
+      m_dpFirstRun = false;
+    }
+  }
+
+  private boolean m_apFirstRun = true;
+
+  /**
+   * Periodic code for autonomous mode should go here.
+   */
+  public void autonomousPeriodic() {
+    if (m_apFirstRun) {
+      System.out.println("Default autonomousPeriodic() method... Overload me!");
+      m_apFirstRun = false;
+    }
+  }
+
+  private boolean m_tpFirstRun = true;
+
+  /**
+   * Periodic code for teleop mode should go here.
+   */
+  public void teleopPeriodic() {
+    if (m_tpFirstRun) {
+      System.out.println("Default teleopPeriodic() method... Overload me!");
+      m_tpFirstRun = false;
+    }
+  }
+
+  private boolean m_tmpFirstRun = true;
+
+  /**
+   * Periodic code for test mode should go here.
+   */
+  @SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
+  public void testPeriodic() {
+    if (m_tmpFirstRun) {
+      System.out.println("Default testPeriodic() method... Overload me!");
+      m_tmpFirstRun = false;
+    }
+  }
+
+  protected void loopFunc() {
+    // Call the appropriate function depending upon the current robot mode
+    if (isDisabled()) {
+      // call DisabledInit() if we are now just entering disabled mode from
+      // either a different mode or from power-on
+      if (m_lastMode != Mode.kDisabled) {
+        LiveWindow.setEnabled(false);
+        disabledInit();
+        m_lastMode = Mode.kDisabled;
+      }
+      HAL.observeUserProgramDisabled();
+      disabledPeriodic();
+    } else if (isAutonomous()) {
+      // call Autonomous_Init() if this is the first time
+      // we've entered autonomous_mode
+      if (m_lastMode != Mode.kAutonomous) {
+        LiveWindow.setEnabled(false);
+        // KBS NOTE: old code reset all PWMs and relays to "safe values"
+        // whenever entering autonomous mode, before calling
+        // "Autonomous_Init()"
+        autonomousInit();
+        m_lastMode = Mode.kAutonomous;
+      }
+      HAL.observeUserProgramAutonomous();
+      autonomousPeriodic();
+    } else if (isOperatorControl()) {
+      // call Teleop_Init() if this is the first time
+      // we've entered teleop_mode
+      if (m_lastMode != Mode.kTeleop) {
+        LiveWindow.setEnabled(false);
+        teleopInit();
+        m_lastMode = Mode.kTeleop;
+      }
+      HAL.observeUserProgramTeleop();
+      teleopPeriodic();
+    } else {
+      // call TestInit() if we are now just entering test mode from either
+      // a different mode or from power-on
+      if (m_lastMode != Mode.kTest) {
+        LiveWindow.setEnabled(true);
+        testInit();
+        m_lastMode = Mode.kTest;
+      }
+      HAL.observeUserProgramTest();
+      testPeriodic();
+    }
+    robotPeriodic();
+    SmartDashboard.updateValues();
+    LiveWindow.updateValues();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Jaguar.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Jaguar.java
new file mode 100644
index 0000000..c83cf01
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Jaguar.java
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Texas Instruments / Vex Robotics Jaguar Speed Controller as a PWM device.
+ */
+public class Jaguar extends PWMSpeedController {
+  /**
+   * Constructor.
+   *
+   * @param channel The PWM channel that the Jaguar is attached to. 0-9 are on-board, 10-19 are on
+   *                the MXP port
+   */
+  public Jaguar(final int channel) {
+    super(channel);
+
+    /*
+     * Input profile defined by Luminary Micro.
+     *
+     * Full reverse ranges from 0.671325ms to 0.6972211ms Proportional reverse
+     * ranges from 0.6972211ms to 1.4482078ms Neutral ranges from 1.4482078ms to
+     * 1.5517922ms Proportional forward ranges from 1.5517922ms to 2.3027789ms
+     * Full forward ranges from 2.3027789ms to 2.328675ms
+     */
+    setBounds(2.31, 1.55, 1.507, 1.454, .697);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_Jaguar, getChannel());
+    setName("Jaguar", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java
new file mode 100644
index 0000000..de302ad
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Joystick.java
@@ -0,0 +1,393 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Handle input from standard Joysticks connected to the Driver Station.
+ *
+ * <p>This class handles standard input that comes from the Driver Station. Each time a value is
+ * requested the most recent value is returned. There is a single class instance for each joystick
+ * and the mapping of ports to hardware buttons depends on the code in the Driver Station.
+ */
+public class Joystick extends GenericHID {
+  static final byte kDefaultXAxis = 0;
+  static final byte kDefaultYAxis = 1;
+  static final byte kDefaultZAxis = 2;
+  static final byte kDefaultTwistAxis = 2;
+  static final byte kDefaultThrottleAxis = 3;
+
+  /**
+   * Represents an analog axis on a joystick.
+   */
+  public enum AxisType {
+    kX(0), kY(1), kZ(2), kTwist(3), kThrottle(4);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    AxisType(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents a digital button on a joystick.
+   */
+  public enum ButtonType {
+    kTrigger(1), kTop(2);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    ButtonType(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents a digital button on a joystick.
+   */
+  private enum Button {
+    kTrigger(1), kTop(2);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    Button(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents an analog axis on a joystick.
+   */
+  private enum Axis {
+    kX(0), kY(1), kZ(2), kTwist(3), kThrottle(4), kNumAxes(5);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    Axis(int value) {
+      this.value = value;
+    }
+  }
+
+  private final byte[] m_axes = new byte[Axis.kNumAxes.value];
+
+  /**
+   * Construct an instance of a joystick. The joystick index is the USB port on the drivers
+   * station.
+   *
+   * @param port The port on the Driver Station that the joystick is plugged into.
+   */
+  public Joystick(final int port) {
+    super(port);
+
+    m_axes[Axis.kX.value] = kDefaultXAxis;
+    m_axes[Axis.kY.value] = kDefaultYAxis;
+    m_axes[Axis.kZ.value] = kDefaultZAxis;
+    m_axes[Axis.kTwist.value] = kDefaultTwistAxis;
+    m_axes[Axis.kThrottle.value] = kDefaultThrottleAxis;
+
+    HAL.report(tResourceType.kResourceType_Joystick, port);
+  }
+
+  /**
+   * Set the channel associated with the X axis.
+   *
+   * @param channel The channel to set the axis to.
+   */
+  public void setXChannel(int channel) {
+    m_axes[Axis.kX.value] = (byte) channel;
+  }
+
+  /**
+   * Set the channel associated with the Y axis.
+   *
+   * @param channel The channel to set the axis to.
+   */
+  public void setYChannel(int channel) {
+    m_axes[Axis.kY.value] = (byte) channel;
+  }
+
+  /**
+   * Set the channel associated with the Z axis.
+   *
+   * @param channel The channel to set the axis to.
+   */
+  public void setZChannel(int channel) {
+    m_axes[Axis.kZ.value] = (byte) channel;
+  }
+
+  /**
+   * Set the channel associated with the throttle axis.
+   *
+   * @param channel The channel to set the axis to.
+   */
+  public void setThrottleChannel(int channel) {
+    m_axes[Axis.kThrottle.value] = (byte) channel;
+  }
+
+  /**
+   * Set the channel associated with the twist axis.
+   *
+   * @param channel The channel to set the axis to.
+   */
+  public void setTwistChannel(int channel) {
+    m_axes[Axis.kTwist.value] = (byte) channel;
+  }
+
+  /**
+   * Set the channel associated with a specified axis.
+   *
+   * @deprecated    Use the more specific axis channel setter functions.
+   * @param axis    The axis to set the channel for.
+   * @param channel The channel to set the axis to.
+   */
+  @Deprecated
+  public void setAxisChannel(AxisType axis, int channel) {
+    m_axes[axis.value] = (byte) channel;
+  }
+
+  /**
+   * Get the channel currently associated with the X axis.
+   *
+   * @return The channel for the axis.
+   */
+  public int getXChannel() {
+    return m_axes[Axis.kX.value];
+  }
+
+  /**
+   * Get the channel currently associated with the Y axis.
+   *
+   * @return The channel for the axis.
+   */
+  public int getYChannel() {
+    return m_axes[Axis.kY.value];
+  }
+
+  /**
+   * Get the channel currently associated with the Z axis.
+   *
+   * @return The channel for the axis.
+   */
+  public int getZChannel() {
+    return m_axes[Axis.kZ.value];
+  }
+
+  /**
+   * Get the channel currently associated with the twist axis.
+   *
+   * @return The channel for the axis.
+   */
+  public int getTwistChannel() {
+    return m_axes[Axis.kTwist.value];
+  }
+
+  /**
+   * Get the channel currently associated with the throttle axis.
+   *
+   * @return The channel for the axis.
+   */
+  public int getThrottleChannel() {
+    return m_axes[Axis.kThrottle.value];
+  }
+
+  /**
+   * Get the channel currently associated with the specified axis.
+   *
+   * @deprecated Use the more specific axis channel getter functions.
+   * @param axis The axis to look up the channel for.
+   * @return The channel for the axis.
+   */
+  @Deprecated
+  public int getAxisChannel(AxisType axis) {
+    return m_axes[axis.value];
+  }
+
+  /**
+   * Get the X value of the joystick. This depends on the mapping of the joystick connected to the
+   * current port.
+   *
+   * @param hand Unused
+   * @return The X value of the joystick.
+   */
+  @Override
+  public final double getX(Hand hand) {
+    return getRawAxis(m_axes[Axis.kX.value]);
+  }
+
+  /**
+   * Get the Y value of the joystick. This depends on the mapping of the joystick connected to the
+   * current port.
+   *
+   * @param hand Unused
+   * @return The Y value of the joystick.
+   */
+  @Override
+  public final double getY(Hand hand) {
+    return getRawAxis(m_axes[Axis.kY.value]);
+  }
+
+  /**
+   * Get the z position of the HID.
+   *
+   * @return the z position
+   */
+  public double getZ() {
+    return getRawAxis(m_axes[Axis.kZ.value]);
+  }
+
+  /**
+   * Get the twist value of the current joystick. This depends on the mapping of the joystick
+   * connected to the current port.
+   *
+   * @return The Twist value of the joystick.
+   */
+  public double getTwist() {
+    return getRawAxis(m_axes[Axis.kTwist.value]);
+  }
+
+  /**
+   * Get the throttle value of the current joystick. This depends on the mapping of the joystick
+   * connected to the current port.
+   *
+   * @return The Throttle value of the joystick.
+   */
+  public double getThrottle() {
+    return getRawAxis(m_axes[Axis.kThrottle.value]);
+  }
+
+  /**
+   * For the current joystick, return the axis determined by the argument.
+   *
+   * <p>This is for cases where the joystick axis is returned programmatically, otherwise one of the
+   * previous functions would be preferable (for example getX()).
+   *
+   * @deprecated Use the more specific axis getter functions.
+   * @param axis The axis to read.
+   * @return The value of the axis.
+   */
+  @Deprecated
+  public double getAxis(final AxisType axis) {
+    switch (axis) {
+      case kX:
+        return getX();
+      case kY:
+        return getY();
+      case kZ:
+        return getZ();
+      case kTwist:
+        return getTwist();
+      case kThrottle:
+        return getThrottle();
+      default:
+        return 0.0;
+    }
+  }
+
+  /**
+   * Read the state of the trigger on the joystick.
+   *
+   * @return The state of the trigger.
+   */
+  public boolean getTrigger() {
+    return getRawButton(Button.kTrigger.value);
+  }
+
+  /**
+   * Whether the trigger was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getTriggerPressed() {
+    return getRawButtonPressed(Button.kTrigger.value);
+  }
+
+  /**
+   * Whether the trigger was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getTriggerReleased() {
+    return getRawButtonReleased(Button.kTrigger.value);
+  }
+
+  /**
+   * Read the state of the top button on the joystick.
+   *
+   * @return The state of the top button.
+   */
+  public boolean getTop() {
+    return getRawButton(Button.kTop.value);
+  }
+
+  /**
+   * Whether the top button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getTopPressed() {
+    return getRawButtonPressed(Button.kTop.value);
+  }
+
+  /**
+   * Whether the top button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getTopReleased() {
+    return getRawButtonReleased(Button.kTop.value);
+  }
+
+  /**
+   * Get buttons based on an enumerated type.
+   *
+   * <p>The button type will be looked up in the list of buttons and then read.
+   *
+   * @deprecated Use Button enum values instead of ButtonType.
+   * @param button The type of button to read.
+   * @return The state of the button.
+   */
+  @Deprecated
+  public boolean getButton(ButtonType button) {
+    return getRawButton(button.value);
+  }
+
+  /**
+   * Get the magnitude of the direction vector formed by the joystick's current position relative to
+   * its origin.
+   *
+   * @return The magnitude of the direction vector
+   */
+  public double getMagnitude() {
+    return Math.sqrt(Math.pow(getX(), 2) + Math.pow(getY(), 2));
+  }
+
+  /**
+   * Get the direction of the vector formed by the joystick and its origin in radians.
+   *
+   * @return The direction of the vector in radians
+   */
+  public double getDirectionRadians() {
+    return Math.atan2(getX(), -getY());
+  }
+
+  /**
+   * Get the direction of the vector formed by the joystick and its origin in degrees.
+   *
+   * @return The direction of the vector in degrees
+   */
+  public double getDirectionDegrees() {
+    return Math.toDegrees(getDirectionRadians());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/JoystickBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/JoystickBase.java
new file mode 100644
index 0000000..56d4eba
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/JoystickBase.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * JoystickBase Interface.
+ *
+ * @deprecated Inherit directly from GenericHID instead.
+ */
+@Deprecated
+public abstract class JoystickBase extends GenericHID {
+  public JoystickBase(int port) {
+    super(port);
+  }
+
+  /**
+   * Get the z position of the HID.
+   *
+   * @param hand which hand, left or right
+   * @return the z position
+   */
+  public abstract double getZ(Hand hand);
+
+  public double getZ() {
+    return getZ(Hand.kRight);
+  }
+
+  /**
+   * Get the twist value.
+   *
+   * @return the twist value
+   */
+  public abstract double getTwist();
+
+  /**
+   * Get the throttle.
+   *
+   * @return the throttle value
+   */
+  public abstract double getThrottle();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java
new file mode 100644
index 0000000..80b86ff
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafety.java
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Shuts off motors when their outputs aren't updated often enough.
+ */
+public interface MotorSafety {
+  double DEFAULT_SAFETY_EXPIRATION = 0.1;
+
+  void setExpiration(double timeout);
+
+  double getExpiration();
+
+  boolean isAlive();
+
+  void stopMotor();
+
+  void setSafetyEnabled(boolean enabled);
+
+  boolean isSafetyEnabled();
+
+  String getDescription();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafetyHelper.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafetyHelper.java
new file mode 100644
index 0000000..f9c6645
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/MotorSafetyHelper.java
@@ -0,0 +1,150 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+/**
+ * The MotorSafetyHelper object is constructed for every object that wants to implement the Motor
+ * Safety protocol. The helper object has the code to actually do the timing and call the motors
+ * Stop() method when the timeout expires. The motor object is expected to call the Feed() method
+ * whenever the motors value is updated.
+ */
+public final class MotorSafetyHelper {
+  private double m_expiration;
+  private boolean m_enabled;
+  private double m_stopTime;
+  private final Object m_thisMutex = new Object();
+  private final MotorSafety m_safeObject;
+  private static final Set<MotorSafetyHelper> m_helperList = new LinkedHashSet<>();
+  private static final Object m_listMutex = new Object();
+
+  /**
+   * The constructor for a MotorSafetyHelper object. The helper object is constructed for every
+   * object that wants to implement the Motor Safety protocol. The helper object has the code to
+   * actually do the timing and call the motors Stop() method when the timeout expires. The motor
+   * object is expected to call the Feed() method whenever the motors value is updated.
+   *
+   * @param safeObject a pointer to the motor object implementing MotorSafety. This is used to call
+   *                   the Stop() method on the motor.
+   */
+  public MotorSafetyHelper(MotorSafety safeObject) {
+    m_safeObject = safeObject;
+    m_enabled = false;
+    m_expiration = MotorSafety.DEFAULT_SAFETY_EXPIRATION;
+    m_stopTime = Timer.getFPGATimestamp();
+
+    synchronized (m_listMutex) {
+      m_helperList.add(this);
+    }
+  }
+
+  /**
+   * Feed the motor safety object. Resets the timer on this object that is used to do the timeouts.
+   */
+  public void feed() {
+    synchronized (m_thisMutex) {
+      m_stopTime = Timer.getFPGATimestamp() + m_expiration;
+    }
+  }
+
+  /**
+   * Set the expiration time for the corresponding motor safety object.
+   *
+   * @param expirationTime The timeout value in seconds.
+   */
+  public void setExpiration(double expirationTime) {
+    synchronized (m_thisMutex) {
+      m_expiration = expirationTime;
+    }
+  }
+
+  /**
+   * Retrieve the timeout value for the corresponding motor safety object.
+   *
+   * @return the timeout value in seconds.
+   */
+  public double getExpiration() {
+    synchronized (m_thisMutex) {
+      return m_expiration;
+    }
+  }
+
+  /**
+   * Determine of the motor is still operating or has timed out.
+   *
+   * @return a true value if the motor is still operating normally and hasn't timed out.
+   */
+  public boolean isAlive() {
+    synchronized (m_thisMutex) {
+      return !m_enabled || m_stopTime > Timer.getFPGATimestamp();
+    }
+  }
+
+  /**
+   * Check if this motor has exceeded its timeout. This method is called periodically to determine
+   * if this motor has exceeded its timeout value. If it has, the stop method is called, and the
+   * motor is shut down until its value is updated again.
+   */
+  public void check() {
+    boolean enabled;
+    double stopTime;
+
+    synchronized (m_thisMutex) {
+      enabled = m_enabled;
+      stopTime = m_stopTime;
+    }
+
+    if (!enabled || RobotState.isDisabled() || RobotState.isTest()) {
+      return;
+    }
+    if (stopTime < Timer.getFPGATimestamp()) {
+      DriverStation.reportError(m_safeObject.getDescription() + "... Output not updated often "
+          + "enough.", false);
+
+      m_safeObject.stopMotor();
+    }
+  }
+
+  /**
+   * Enable/disable motor safety for this device Turn on and off the motor safety option for this
+   * PWM object.
+   *
+   * @param enabled True if motor safety is enforced for this object
+   */
+  public void setSafetyEnabled(boolean enabled) {
+    synchronized (m_thisMutex) {
+      m_enabled = enabled;
+    }
+  }
+
+  /**
+   * Return the state of the motor safety enabled flag Return if the motor safety is currently
+   * enabled for this device.
+   *
+   * @return True if motor safety is enforced for this device
+   */
+  public boolean isSafetyEnabled() {
+    synchronized (m_thisMutex) {
+      return m_enabled;
+    }
+  }
+
+  /**
+   * Check the motors to see if any have timed out. This static method is called periodically to
+   * poll all the motors and stop any that have timed out.
+   */
+  public static void checkMotors() {
+    synchronized (m_listMutex) {
+      for (MotorSafetyHelper elem : m_helperList) {
+        elem.check();
+      }
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/NamedSendable.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/NamedSendable.java
new file mode 100644
index 0000000..0d88114
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/NamedSendable.java
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * The interface for sendable objects that gives the sendable a default name in the Smart
+ * Dashboard.
+ * @deprecated Use Sendable directly instead
+ */
+@Deprecated
+public interface NamedSendable extends Sendable {
+
+  /**
+   * The name of the subtable.
+   *
+   * @return the name of the subtable of SmartDashboard that the Sendable object will use.
+   */
+  String getName();
+
+  @Override
+  default void setName(String name) {
+  }
+
+  @Override
+  default String getSubsystem() {
+    return "";
+  }
+
+  @Override
+  default void setSubsystem(String subsystem) {
+  }
+
+  @Override
+  default void initSendable(SendableBuilder builder) {
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/NidecBrushless.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/NidecBrushless.java
new file mode 100644
index 0000000..427cb59
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/NidecBrushless.java
@@ -0,0 +1,205 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Nidec Brushless Motor.
+ */
+public class NidecBrushless extends SendableBase implements SpeedController, MotorSafety, Sendable {
+  private final MotorSafetyHelper m_safetyHelper;
+  private boolean m_isInverted = false;
+  private DigitalOutput m_dio;
+  private PWM m_pwm;
+  private volatile double m_speed = 0.0;
+  private volatile boolean m_disabled = false;
+
+  /**
+   * Constructor.
+   *
+   * @param pwmChannel The PWM channel that the Nidec Brushless controller is attached to.
+   *                   0-9 are on-board, 10-19 are on the MXP port
+   * @param dioChannel The DIO channel that the Nidec Brushless controller is attached to.
+   *                   0-9 are on-board, 10-25 are on the MXP port
+   */
+  public NidecBrushless(final int pwmChannel, final int dioChannel) {
+    m_safetyHelper = new MotorSafetyHelper(this);
+    m_safetyHelper.setExpiration(0.0);
+    m_safetyHelper.setSafetyEnabled(false);
+
+    // the dio controls the output (in PWM mode)
+    m_dio = new DigitalOutput(dioChannel);
+    addChild(m_dio);
+    m_dio.setPWMRate(15625);
+    m_dio.enablePWM(0.5);
+
+    // the pwm enables the controller
+    m_pwm = new PWM(pwmChannel);
+    addChild(m_pwm);
+
+    HAL.report(tResourceType.kResourceType_NidecBrushless, pwmChannel);
+    setName("Nidec Brushless", pwmChannel);
+  }
+
+  /**
+   * Free the resources used by this object.
+   */
+  @Override
+  public void free() {
+    super.free();
+    m_dio.free();
+    m_pwm.free();
+  }
+
+  /**
+   * Set the PWM value.
+   *
+   * <p>The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the
+   * FPGA.
+   *
+   * @param speed The speed value between -1.0 and 1.0 to set.
+   */
+  @Override
+  public void set(double speed) {
+    if (!m_disabled) {
+      m_speed = speed;
+      m_dio.updateDutyCycle(0.5 + 0.5 * (m_isInverted ? -speed : speed));
+      m_pwm.setRaw(0xffff);
+    }
+    m_safetyHelper.feed();
+  }
+
+  /**
+   * Get the recently set value of the PWM.
+   *
+   * @return The most recently set value for the PWM between -1.0 and 1.0.
+   */
+  @Override
+  public double get() {
+    return m_speed;
+  }
+
+  @Override
+  public void setInverted(boolean isInverted) {
+    m_isInverted = isInverted;
+  }
+
+  @Override
+  public boolean getInverted() {
+    return m_isInverted;
+  }
+
+  /**
+   * Write out the PID value as seen in the PIDOutput base object.
+   *
+   * @param output Write out the PWM value as was found in the PIDController
+   */
+  @Override
+  public void pidWrite(double output) {
+    set(output);
+  }
+
+  /**
+   * Set the safety expiration time.
+   *
+   * @param timeout The timeout (in seconds) for this motor object
+   */
+  @Override
+  public void setExpiration(double timeout) {
+    m_safetyHelper.setExpiration(timeout);
+  }
+
+  /**
+   * Return the safety expiration time.
+   *
+   * @return The expiration time value.
+   */
+  @Override
+  public double getExpiration() {
+    return m_safetyHelper.getExpiration();
+  }
+
+  /**
+   * Check if the motor is currently alive or stopped due to a timeout.
+   *
+   * @return a bool value that is true if the motor has NOT timed out and should still be running.
+   */
+  @Override
+  public boolean isAlive() {
+    return m_safetyHelper.isAlive();
+  }
+
+  /**
+   * Stop the motor. This is called by the MotorSafetyHelper object
+   * when it has a timeout for this PWM and needs to stop it from running.
+   * Calling set() will re-enable the motor.
+   */
+  @Override
+  public void stopMotor() {
+    m_dio.updateDutyCycle(0.5);
+    m_pwm.setDisabled();
+  }
+
+  /**
+   * Check if motor safety is enabled.
+   *
+   * @return True if motor safety is enforced for this object
+   */
+  @Override
+  public boolean isSafetyEnabled() {
+    return m_safetyHelper.isSafetyEnabled();
+  }
+
+  @Override
+  public void setSafetyEnabled(boolean enabled) {
+    m_safetyHelper.setSafetyEnabled(enabled);
+  }
+
+  @Override
+  public String getDescription() {
+    return "Nidec " + getChannel();
+  }
+
+  /**
+   * Disable the motor.  The enable() function must be called to re-enable
+   * the motor.
+   */
+  @Override
+  public void disable() {
+    m_disabled = true;
+    m_dio.updateDutyCycle(0.5);
+    m_pwm.setDisabled();
+  }
+
+  /**
+   * Re-enable the motor after disable() has been called.  The set()
+   * function must be called to set a new motor speed.
+   */
+  public void enable() {
+    m_disabled = false;
+  }
+
+  /**
+   * Gets the channel number associated with the object.
+   *
+   * @return The channel number.
+   */
+  public int getChannel() {
+    return m_pwm.getChannel();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Nidec Brushless");
+    builder.setSafeState(this::stopMotor);
+    builder.addDoubleProperty("Value", this::get, this::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Notifier.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Notifier.java
new file mode 100644
index 0000000..89ee185
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Notifier.java
@@ -0,0 +1,165 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReentrantLock;
+
+import edu.wpi.first.wpilibj.hal.NotifierJNI;
+
+public class Notifier {
+  // The thread waiting on the HAL alarm.
+  private final Thread m_thread;
+  // The lock for the process information.
+  private final ReentrantLock m_processLock = new ReentrantLock();
+  // The C pointer to the notifier object. We don't use it directly, it is
+  // just passed to the JNI bindings.
+  private final AtomicInteger m_notifier = new AtomicInteger();
+  // The time, in microseconds, at which the corresponding handler should be
+  // called. Has the same zero as Utility.getFPGATime().
+  private double m_expirationTime = 0;
+  // The handler passed in by the user which should be called at the
+  // appropriate interval.
+  private Runnable m_handler;
+  // Whether we are calling the handler just once or periodically.
+  private boolean m_periodic = false;
+  // If periodic, the period of the calling; if just once, stores how long it
+  // is until we call the handler.
+  private double m_period = 0;
+
+  @Override
+  @SuppressWarnings("NoFinalizer")
+  protected void finalize() {
+    int handle = m_notifier.getAndSet(0);
+    NotifierJNI.stopNotifier(handle);
+    // Join the thread to ensure the handler has exited.
+    if (m_thread.isAlive()) {
+      try {
+        m_thread.interrupt();
+        m_thread.join();
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+      }
+    }
+    NotifierJNI.cleanNotifier(handle);
+  }
+
+  /**
+   * Update the alarm hardware to reflect the next alarm.
+   */
+  private void updateAlarm() {
+    int notifier = m_notifier.get();
+    if (notifier == 0) {
+      return;
+    }
+    NotifierJNI.updateNotifierAlarm(notifier, (long) (m_expirationTime * 1e6));
+  }
+
+  /**
+   * Create a Notifier for timer event notification.
+   *
+   * @param run The handler that is called at the notification time which is set using StartSingle
+   *            or StartPeriodic.
+   */
+  public Notifier(Runnable run) {
+    m_handler = run;
+    m_notifier.set(NotifierJNI.initializeNotifier());
+
+    m_thread = new Thread(() -> {
+      while (!Thread.interrupted()) {
+        int notifier = m_notifier.get();
+        if (notifier == 0) {
+          break;
+        }
+        long curTime = NotifierJNI.waitForNotifierAlarm(notifier);
+        if (curTime == 0) {
+          break;
+        }
+
+        Runnable handler = null;
+        m_processLock.lock();
+        try {
+          handler = m_handler;
+          if (m_periodic) {
+            m_expirationTime += m_period;
+            updateAlarm();
+          }
+        } finally {
+          m_processLock.unlock();
+        }
+
+        if (handler != null) {
+          handler.run();
+        }
+      }
+    });
+    m_thread.setDaemon(true);
+    m_thread.start();
+  }
+
+  /**
+   * Change the handler function.
+   *
+   * @param handler Handler
+   */
+  public void setHandler(Runnable handler) {
+    m_processLock.lock();
+    try {
+      m_handler = handler;
+    } finally {
+      m_processLock.unlock();
+    }
+  }
+
+  /**
+   * Register for single event notification. A timer event is queued for a single event after the
+   * specified delay.
+   *
+   * @param delay Seconds to wait before the handler is called.
+   */
+  public void startSingle(double delay) {
+    m_processLock.lock();
+    try {
+      m_periodic = false;
+      m_period = delay;
+      m_expirationTime = RobotController.getFPGATime() * 1e-6 + delay;
+      updateAlarm();
+    } finally {
+      m_processLock.unlock();
+    }
+  }
+
+  /**
+   * Register for periodic event notification. A timer event is queued for periodic event
+   * notification. Each time the interrupt occurs, the event will be immediately requeued for the
+   * same time interval.
+   *
+   * @param period Period in seconds to call the handler starting one period after the call to this
+   *               method.
+   */
+  public void startPeriodic(double period) {
+    m_processLock.lock();
+    try {
+      m_periodic = true;
+      m_period = period;
+      m_expirationTime = RobotController.getFPGATime() * 1e-6 + period;
+      updateAlarm();
+    } finally {
+      m_processLock.unlock();
+    }
+  }
+
+  /**
+   * Stop timer events from occurring. Stop any repeating timer events from occurring. This will
+   * also remove any single notification events from the queue. If a timer-based call to the
+   * registered handler is in progress, this function will block until the handler call is complete.
+   */
+  public void stop() {
+    NotifierJNI.cancelNotifierAlarm(m_notifier.get());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java
new file mode 100644
index 0000000..2782dbb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDController.java
@@ -0,0 +1,914 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.util.TimerTask;
+import java.util.concurrent.locks.ReentrantLock;
+
+import edu.wpi.first.wpilibj.filters.LinearDigitalFilter;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+import edu.wpi.first.wpilibj.util.BoundaryException;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Class implements a PID Control Loop.
+ *
+ * <p>Creates a separate thread which reads the given PIDSource and takes care of the integral
+ * calculations, as well as writing the given PIDOutput.
+ *
+ * <p>This feedback controller runs in discrete time, so time deltas are not used in the integral
+ * and derivative calculations. Therefore, the sample rate affects the controller's behavior for a
+ * given set of PID constants.
+ */
+public class PIDController extends SendableBase implements PIDInterface, Sendable, Controller {
+  public static final double kDefaultPeriod = .05;
+  private static int instances = 0;
+  @SuppressWarnings("MemberName")
+  private double m_P; // factor for "proportional" control
+  @SuppressWarnings("MemberName")
+  private double m_I; // factor for "integral" control
+  @SuppressWarnings("MemberName")
+  private double m_D; // factor for "derivative" control
+  @SuppressWarnings("MemberName")
+  private double m_F; // factor for feedforward term
+  private double m_maximumOutput = 1.0; // |maximum output|
+  private double m_minimumOutput = -1.0; // |minimum output|
+  private double m_maximumInput = 0.0; // maximum input - limit setpoint to this
+  private double m_minimumInput = 0.0; // minimum input - limit setpoint to this
+  private double m_inputRange = 0.0; // input range - difference between maximum and minimum
+  // do the endpoints wrap around? eg. Absolute encoder
+  private boolean m_continuous = false;
+  private boolean m_enabled = false; // is the pid controller enabled
+  // the prior error (used to compute velocity)
+  private double m_prevError = 0.0;
+  // the sum of the errors for use in the integral calc
+  private double m_totalError = 0.0;
+  // the tolerance object used to check if on target
+  private Tolerance m_tolerance;
+  private double m_setpoint = 0.0;
+  private double m_prevSetpoint = 0.0;
+  @SuppressWarnings("PMD.UnusedPrivateField")
+  private double m_error = 0.0;
+  private double m_result = 0.0;
+  private double m_period = kDefaultPeriod;
+
+  PIDSource m_origSource;
+  LinearDigitalFilter m_filter;
+
+  ReentrantLock m_thisMutex = new ReentrantLock();
+
+  // Ensures when disable() is called, pidWrite() won't run if calculate()
+  // is already running at that time.
+  ReentrantLock m_pidWriteMutex = new ReentrantLock();
+
+  protected PIDSource m_pidInput;
+  protected PIDOutput m_pidOutput;
+  java.util.Timer m_controlLoop;
+  Timer m_setpointTimer;
+
+  /**
+   * Tolerance is the type of tolerance used to specify if the PID controller is on target.
+   *
+   * <p>The various implementations of this class such as PercentageTolerance and AbsoluteTolerance
+   * specify types of tolerance specifications to use.
+   */
+  public interface Tolerance {
+    boolean onTarget();
+  }
+
+  /**
+   * Used internally for when Tolerance hasn't been set.
+   */
+  public class NullTolerance implements Tolerance {
+    @Override
+    public boolean onTarget() {
+      throw new RuntimeException("No tolerance value set when calling onTarget().");
+    }
+  }
+
+  public class PercentageTolerance implements Tolerance {
+    private final double m_percentage;
+
+    PercentageTolerance(double value) {
+      m_percentage = value;
+    }
+
+    @Override
+    public boolean onTarget() {
+      return Math.abs(getError()) < m_percentage / 100 * m_inputRange;
+    }
+  }
+
+  public class AbsoluteTolerance implements Tolerance {
+    private final double m_value;
+
+    AbsoluteTolerance(double value) {
+      m_value = value;
+    }
+
+    @Override
+    public boolean onTarget() {
+      return Math.abs(getError()) < m_value;
+    }
+  }
+
+  private class PIDTask extends TimerTask {
+    private PIDController m_controller;
+
+    PIDTask(PIDController controller) {
+      requireNonNull(controller, "Given PIDController was null");
+
+      m_controller = controller;
+    }
+
+    @Override
+    public void run() {
+      m_controller.calculate();
+    }
+  }
+
+  /**
+   * Allocate a PID object with the given constants for P, I, D, and F.
+   *
+   * @param Kp     the proportional coefficient
+   * @param Ki     the integral coefficient
+   * @param Kd     the derivative coefficient
+   * @param Kf     the feed forward term
+   * @param source The PIDSource object that is used to get values
+   * @param output The PIDOutput object that is set to the output percentage
+   * @param period the loop time for doing calculations. This particularly effects calculations of
+   *               the integral and differential terms. The default is 50ms.
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDController(double Kp, double Ki, double Kd, double Kf, PIDSource source,
+                       PIDOutput output, double period) {
+    super(false);
+    requireNonNull(source, "Null PIDSource was given");
+    requireNonNull(output, "Null PIDOutput was given");
+
+    m_controlLoop = new java.util.Timer();
+    m_setpointTimer = new Timer();
+    m_setpointTimer.start();
+
+    m_P = Kp;
+    m_I = Ki;
+    m_D = Kd;
+    m_F = Kf;
+
+    // Save original source
+    m_origSource = source;
+
+    // Create LinearDigitalFilter with original source as its source argument
+    m_filter = LinearDigitalFilter.movingAverage(m_origSource, 1);
+    m_pidInput = m_filter;
+
+    m_pidOutput = output;
+    m_period = period;
+
+    m_controlLoop.schedule(new PIDTask(this), 0L, (long) (m_period * 1000));
+
+    instances++;
+    HLUsageReporting.reportPIDController(instances);
+    m_tolerance = new NullTolerance();
+    setName("PIDController", instances);
+  }
+
+  /**
+   * Allocate a PID object with the given constants for P, I, D and period.
+   *
+   * @param Kp     the proportional coefficient
+   * @param Ki     the integral coefficient
+   * @param Kd     the derivative coefficient
+   * @param source the PIDSource object that is used to get values
+   * @param output the PIDOutput object that is set to the output percentage
+   * @param period the loop time for doing calculations. This particularly effects calculations of
+   *               the integral and differential terms. The default is 50ms.
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDController(double Kp, double Ki, double Kd, PIDSource source, PIDOutput output,
+                       double period) {
+    this(Kp, Ki, Kd, 0.0, source, output, period);
+  }
+
+  /**
+   * Allocate a PID object with the given constants for P, I, D, using a 50ms period.
+   *
+   * @param Kp     the proportional coefficient
+   * @param Ki     the integral coefficient
+   * @param Kd     the derivative coefficient
+   * @param source The PIDSource object that is used to get values
+   * @param output The PIDOutput object that is set to the output percentage
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDController(double Kp, double Ki, double Kd, PIDSource source, PIDOutput output) {
+    this(Kp, Ki, Kd, source, output, kDefaultPeriod);
+  }
+
+  /**
+   * Allocate a PID object with the given constants for P, I, D, using a 50ms period.
+   *
+   * @param Kp     the proportional coefficient
+   * @param Ki     the integral coefficient
+   * @param Kd     the derivative coefficient
+   * @param Kf     the feed forward term
+   * @param source The PIDSource object that is used to get values
+   * @param output The PIDOutput object that is set to the output percentage
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDController(double Kp, double Ki, double Kd, double Kf, PIDSource source,
+                       PIDOutput output) {
+    this(Kp, Ki, Kd, Kf, source, output, kDefaultPeriod);
+  }
+
+  /**
+   * Free the PID object.
+   */
+  @Override
+  public void free() {
+    super.free();
+    m_controlLoop.cancel();
+    m_thisMutex.lock();
+    try {
+      m_pidOutput = null;
+      m_pidInput = null;
+      m_controlLoop = null;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Read the input, calculate the output accordingly, and write to the output. This should only be
+   * called by the PIDTask and is created during initialization.
+   */
+  @SuppressWarnings("LocalVariableName")
+  protected void calculate() {
+    if (m_origSource == null || m_pidOutput == null) {
+      return;
+    }
+
+    boolean enabled;
+
+    m_thisMutex.lock();
+    try {
+      enabled = m_enabled;
+    } finally {
+      m_thisMutex.unlock();
+    }
+
+    if (enabled) {
+      double input;
+
+      // Storage for function inputs
+      PIDSourceType pidSourceType;
+      double P;
+      double I;
+      double D;
+      double feedForward = calculateFeedForward();
+      double minimumOutput;
+      double maximumOutput;
+
+      // Storage for function input-outputs
+      double prevError;
+      double error;
+      double totalError;
+
+      m_thisMutex.lock();
+      try {
+        input = m_pidInput.pidGet();
+
+        pidSourceType = m_pidInput.getPIDSourceType();
+        P = m_P;
+        I = m_I;
+        D = m_D;
+        minimumOutput = m_minimumOutput;
+        maximumOutput = m_maximumOutput;
+
+        prevError = m_prevError;
+        error = getContinuousError(m_setpoint - input);
+        totalError = m_totalError;
+      } finally {
+        m_thisMutex.unlock();
+      }
+
+      // Storage for function outputs
+      double result;
+
+      if (pidSourceType.equals(PIDSourceType.kRate)) {
+        if (P != 0) {
+          totalError = clamp(totalError + error, minimumOutput / P,
+              maximumOutput / P);
+        }
+
+        result = P * totalError + D * error + feedForward;
+      } else {
+        if (I != 0) {
+          totalError = clamp(totalError + error, minimumOutput / I,
+              maximumOutput / I);
+        }
+
+        result = P * error + I * totalError + D * (error - prevError)
+            + feedForward;
+      }
+
+      result = clamp(result, minimumOutput, maximumOutput);
+
+      // Ensures m_enabled check and pidWrite() call occur atomically
+      m_pidWriteMutex.lock();
+      try {
+        m_thisMutex.lock();
+        try {
+          if (m_enabled) {
+            // Don't block other PIDController operations on pidWrite()
+            m_thisMutex.unlock();
+
+            m_pidOutput.pidWrite(result);
+          }
+        } finally {
+          if (m_thisMutex.isHeldByCurrentThread()) {
+            m_thisMutex.unlock();
+          }
+        }
+      } finally {
+        m_pidWriteMutex.unlock();
+      }
+
+      m_thisMutex.lock();
+      try {
+        m_prevError = error;
+        m_error = error;
+        m_totalError = totalError;
+        m_result = result;
+      } finally {
+        m_thisMutex.unlock();
+      }
+    }
+  }
+
+  /**
+   * Calculate the feed forward term.
+   *
+   * <p>Both of the provided feed forward calculations are velocity feed forwards. If a different
+   * feed forward calculation is desired, the user can override this function and provide his or
+   * her own. This function  does no synchronization because the PIDController class only calls it
+   * in synchronized code, so be careful if calling it oneself.
+   *
+   * <p>If a velocity PID controller is being used, the F term should be set to 1 over the maximum
+   * setpoint for the output. If a position PID controller is being used, the F term should be set
+   * to 1 over the maximum speed for the output measured in setpoint units per this controller's
+   * update period (see the default period in this class's constructor).
+   */
+  protected double calculateFeedForward() {
+    if (m_pidInput.getPIDSourceType().equals(PIDSourceType.kRate)) {
+      return m_F * getSetpoint();
+    } else {
+      double temp = m_F * getDeltaSetpoint();
+      m_prevSetpoint = m_setpoint;
+      m_setpointTimer.reset();
+      return temp;
+    }
+  }
+
+  /**
+   * Set the PID Controller gain parameters. Set the proportional, integral, and differential
+   * coefficients.
+   *
+   * @param p Proportional coefficient
+   * @param i Integral coefficient
+   * @param d Differential coefficient
+   */
+  @SuppressWarnings("ParameterName")
+  public void setPID(double p, double i, double d) {
+    m_thisMutex.lock();
+    try {
+      m_P = p;
+      m_I = i;
+      m_D = d;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the PID Controller gain parameters. Set the proportional, integral, and differential
+   * coefficients.
+   *
+   * @param p Proportional coefficient
+   * @param i Integral coefficient
+   * @param d Differential coefficient
+   * @param f Feed forward coefficient
+   */
+  @SuppressWarnings("ParameterName")
+  public void setPID(double p, double i, double d, double f) {
+    m_thisMutex.lock();
+    try {
+      m_P = p;
+      m_I = i;
+      m_D = d;
+      m_F = f;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the Proportional coefficient of the PID controller gain.
+   *
+   * @param p Proportional coefficient
+   */
+  @SuppressWarnings("ParameterName")
+  public void setP(double p) {
+    m_thisMutex.lock();
+    try {
+      m_P = p;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the Integral coefficient of the PID controller gain.
+   *
+   * @param i Integral coefficient
+   */
+  @SuppressWarnings("ParameterName")
+  public void setI(double i) {
+    m_thisMutex.lock();
+    try {
+      m_I = i;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the Differential coefficient of the PID controller gain.
+   *
+   * @param d differential coefficient
+   */
+  @SuppressWarnings("ParameterName")
+  public void setD(double d) {
+    m_thisMutex.lock();
+    try {
+      m_D = d;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the Feed forward coefficient of the PID controller gain.
+   *
+   * @param f feed forward coefficient
+   */
+  @SuppressWarnings("ParameterName")
+  public void setF(double f) {
+    m_thisMutex.lock();
+    try {
+      m_F = f;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Get the Proportional coefficient.
+   *
+   * @return proportional coefficient
+   */
+  public double getP() {
+    m_thisMutex.lock();
+    try {
+      return m_P;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Get the Integral coefficient.
+   *
+   * @return integral coefficient
+   */
+  public double getI() {
+    m_thisMutex.lock();
+    try {
+      return m_I;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Get the Differential coefficient.
+   *
+   * @return differential coefficient
+   */
+  public double getD() {
+    m_thisMutex.lock();
+    try {
+      return m_D;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Get the Feed forward coefficient.
+   *
+   * @return feed forward coefficient
+   */
+  public double getF() {
+    m_thisMutex.lock();
+    try {
+      return m_F;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Return the current PID result This is always centered on zero and constrained the the max and
+   * min outs.
+   *
+   * @return the latest calculated output
+   */
+  public double get() {
+    m_thisMutex.lock();
+    try {
+      return m_result;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the PID controller to consider the input to be continuous, Rather then using the max and
+   * min input range as constraints, it considers them to be the same point and automatically
+   * calculates the shortest route to the setpoint.
+   *
+   * @param continuous Set to true turns on continuous, false turns off continuous
+   */
+  public void setContinuous(boolean continuous) {
+    if (continuous && m_inputRange <= 0) {
+      throw new RuntimeException("No input range set when calling setContinuous().");
+    }
+    m_thisMutex.lock();
+    try {
+      m_continuous = continuous;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the PID controller to consider the input to be continuous, Rather then using the max and
+   * min input range as constraints, it considers them to be the same point and automatically
+   * calculates the shortest route to the setpoint.
+   */
+  public void setContinuous() {
+    setContinuous(true);
+  }
+
+  /**
+   * Sets the maximum and minimum values expected from the input and setpoint.
+   *
+   * @param minimumInput the minimum value expected from the input
+   * @param maximumInput the maximum value expected from the input
+   */
+  public void setInputRange(double minimumInput, double maximumInput) {
+    m_thisMutex.lock();
+    try {
+      if (minimumInput > maximumInput) {
+        throw new BoundaryException("Lower bound is greater than upper bound");
+      }
+      m_minimumInput = minimumInput;
+      m_maximumInput = maximumInput;
+      m_inputRange = maximumInput - minimumInput;
+    } finally {
+      m_thisMutex.unlock();
+    }
+
+    setSetpoint(m_setpoint);
+  }
+
+  /**
+   * Sets the minimum and maximum values to write.
+   *
+   * @param minimumOutput the minimum percentage to write to the output
+   * @param maximumOutput the maximum percentage to write to the output
+   */
+  public void setOutputRange(double minimumOutput, double maximumOutput) {
+    m_thisMutex.lock();
+    try {
+      if (minimumOutput > maximumOutput) {
+        throw new BoundaryException("Lower bound is greater than upper bound");
+      }
+      m_minimumOutput = minimumOutput;
+      m_maximumOutput = maximumOutput;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the setpoint for the PIDController.
+   *
+   * @param setpoint the desired setpoint
+   */
+  public void setSetpoint(double setpoint) {
+    m_thisMutex.lock();
+    try {
+      if (m_maximumInput > m_minimumInput) {
+        if (setpoint > m_maximumInput) {
+          m_setpoint = m_maximumInput;
+        } else if (setpoint < m_minimumInput) {
+          m_setpoint = m_minimumInput;
+        } else {
+          m_setpoint = setpoint;
+        }
+      } else {
+        m_setpoint = setpoint;
+      }
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Returns the current setpoint of the PIDController.
+   *
+   * @return the current setpoint
+   */
+  public double getSetpoint() {
+    m_thisMutex.lock();
+    try {
+      return m_setpoint;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Returns the change in setpoint over time of the PIDController.
+   *
+   * @return the change in setpoint over time
+   */
+  public double getDeltaSetpoint() {
+    m_thisMutex.lock();
+    try {
+      return (m_setpoint - m_prevSetpoint) / m_setpointTimer.get();
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Returns the current difference of the input from the setpoint.
+   *
+   * @return the current error
+   */
+  public double getError() {
+    m_thisMutex.lock();
+    try {
+      return getContinuousError(getSetpoint() - m_pidInput.pidGet());
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Returns the current difference of the error over the past few iterations. You can specify the
+   * number of iterations to average with setToleranceBuffer() (defaults to 1). getAvgError() is
+   * used for the onTarget() function.
+   *
+   * @deprecated Use getError(), which is now already filtered.
+   * @return     the current average of the error
+   */
+  @Deprecated
+  public double getAvgError() {
+    m_thisMutex.lock();
+    try {
+      return getError();
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Sets what type of input the PID controller will use.
+   *
+   * @param pidSource the type of input
+   */
+  void setPIDSourceType(PIDSourceType pidSource) {
+    m_pidInput.setPIDSourceType(pidSource);
+  }
+
+  /**
+   * Returns the type of input the PID controller is using.
+   *
+   * @return the PID controller input type
+   */
+  PIDSourceType getPIDSourceType() {
+    return m_pidInput.getPIDSourceType();
+  }
+
+  /**
+   * Set the PID tolerance using a Tolerance object. Tolerance can be specified as a percentage of
+   * the range or as an absolute value. The Tolerance object encapsulates those options in an
+   * object. Use it by creating the type of tolerance that you want to use: setTolerance(new
+   * PIDController.AbsoluteTolerance(0.1))
+   *
+   * @deprecated      Use setPercentTolerance() instead.
+   * @param tolerance A tolerance object of the right type, e.g. PercentTolerance or
+   *                  AbsoluteTolerance
+   */
+  @Deprecated
+  public void setTolerance(Tolerance tolerance) {
+    m_tolerance = tolerance;
+  }
+
+  /**
+   * Set the absolute error which is considered tolerable for use with OnTarget.
+   *
+   * @param absvalue absolute error which is tolerable in the units of the input object
+   */
+  public void setAbsoluteTolerance(double absvalue) {
+    m_thisMutex.lock();
+    try {
+      m_tolerance = new AbsoluteTolerance(absvalue);
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the percentage error which is considered tolerable for use with OnTarget. (Input of 15.0 =
+   * 15 percent)
+   *
+   * @param percentage percent error which is tolerable
+   */
+  public void setPercentTolerance(double percentage) {
+    m_thisMutex.lock();
+    try {
+      m_tolerance = new PercentageTolerance(percentage);
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the number of previous error samples to average for tolerancing. When determining whether a
+   * mechanism is on target, the user may want to use a rolling average of previous measurements
+   * instead of a precise position or velocity. This is useful for noisy sensors which return a few
+   * erroneous measurements when the mechanism is on target. However, the mechanism will not
+   * register as on target for at least the specified bufLength cycles.
+   *
+   * @deprecated      Use a LinearDigitalFilter as the input.
+   * @param bufLength Number of previous cycles to average.
+   */
+  @Deprecated
+  public void setToleranceBuffer(int bufLength) {
+    m_thisMutex.lock();
+    try {
+      m_filter = LinearDigitalFilter.movingAverage(m_origSource, bufLength);
+      m_pidInput = m_filter;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Return true if the error is within the percentage of the total input range, determined by
+   * setTolerance. This assumes that the maximum and minimum input were set using setInput.
+   *
+   * @return true if the error is less than the tolerance
+   */
+  public boolean onTarget() {
+    m_thisMutex.lock();
+    try {
+      return m_tolerance.onTarget();
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Begin running the PIDController.
+   */
+  @Override
+  public void enable() {
+    m_thisMutex.lock();
+    try {
+      m_enabled = true;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Stop running the PIDController, this sets the output to zero before stopping.
+   */
+  @Override
+  public void disable() {
+    // Ensures m_enabled check and pidWrite() call occur atomically
+    m_pidWriteMutex.lock();
+    try {
+      m_thisMutex.lock();
+      try {
+        m_enabled = false;
+      } finally {
+        m_thisMutex.unlock();
+      }
+
+      m_pidOutput.pidWrite(0);
+    } finally {
+      m_pidWriteMutex.unlock();
+    }
+  }
+
+  /**
+   * Set the enabled state of the PIDController.
+   */
+  public void setEnabled(boolean enable) {
+    if (enable) {
+      enable();
+    } else {
+      disable();
+    }
+  }
+
+  /**
+   * Return true if PIDController is enabled.
+   */
+  @Override
+  public boolean isEnabled() {
+    m_thisMutex.lock();
+    try {
+      return m_enabled;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  /**
+   * Reset the previous error,, the integral term, and disable the controller.
+   */
+  @Override
+  public void reset() {
+    disable();
+
+    m_thisMutex.lock();
+    try {
+      m_prevError = 0;
+      m_totalError = 0;
+      m_result = 0;
+    } finally {
+      m_thisMutex.unlock();
+    }
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("PIDController");
+    builder.setSafeState(this::reset);
+    builder.addDoubleProperty("p", this::getP, this::setP);
+    builder.addDoubleProperty("i", this::getI, this::setI);
+    builder.addDoubleProperty("d", this::getD, this::setD);
+    builder.addDoubleProperty("f", this::getF, this::setF);
+    builder.addDoubleProperty("setpoint", this::getSetpoint, this::setSetpoint);
+    builder.addBooleanProperty("enabled", this::isEnabled, this::setEnabled);
+  }
+
+  /**
+   * Wraps error around for continuous inputs. The original error is returned if continuous mode is
+   * disabled. This is an unsynchronized function.
+   *
+   * @param error The current error of the PID controller.
+   * @return Error for continuous inputs.
+   */
+  protected double getContinuousError(double error) {
+    if (m_continuous && m_inputRange > 0) {
+      error %= m_inputRange;
+      if (Math.abs(error) > m_inputRange / 2) {
+        if (error > 0) {
+          return error - m_inputRange;
+        } else {
+          return error + m_inputRange;
+        }
+      }
+    }
+
+    return error;
+  }
+
+  private static double clamp(double value, double low, double high) {
+    return Math.max(low, Math.min(value, high));
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java
new file mode 100644
index 0000000..b3c3a32
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDInterface.java
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+@SuppressWarnings("SummaryJavadoc")
+public interface PIDInterface extends Controller {
+
+  @SuppressWarnings("ParameterName")
+  void setPID(double p, double i, double d);
+
+  double getP();
+
+  double getI();
+
+  double getD();
+
+  void setSetpoint(double setpoint);
+
+  double getSetpoint();
+
+  double getError();
+
+  void enable();
+
+  void disable();
+
+  boolean isEnabled();
+
+  void reset();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDOutput.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDOutput.java
new file mode 100644
index 0000000..dd6afbe
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDOutput.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * This interface allows PIDController to write it's results to its output.
+ */
+@FunctionalInterface
+public interface PIDOutput {
+
+  /**
+   * Set the output to the value calculated by PIDController.
+   *
+   * @param output the value calculated by PIDController
+   */
+  void pidWrite(double output);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDSource.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDSource.java
new file mode 100644
index 0000000..841a232
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDSource.java
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * This interface allows for PIDController to automatically read from this object.
+ */
+public interface PIDSource {
+  /**
+   * Set which parameter of the device you are using as a process control variable.
+   *
+   * @param pidSource An enum to select the parameter.
+   */
+  void setPIDSourceType(PIDSourceType pidSource);
+
+  /**
+   * Get which parameter of the device you are using as a process control variable.
+   *
+   * @return the currently selected PID source parameter
+   */
+  PIDSourceType getPIDSourceType();
+
+  /**
+   * Get the result to use in PIDController.
+   *
+   * @return the result to use in PIDController
+   */
+  double pidGet();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDSourceType.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDSourceType.java
new file mode 100644
index 0000000..31aa79a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PIDSourceType.java
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * A description for the type of output value to provide to a PIDController.
+ */
+public enum PIDSourceType {
+  kDisplacement,
+  kRate
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java
new file mode 100644
index 0000000..d609f75
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWM.java
@@ -0,0 +1,251 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.DIOJNI;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.PWMJNI;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Class implements the PWM generation in the FPGA.
+ *
+ * <p>The values supplied as arguments for PWM outputs range from -1.0 to 1.0. They are mapped to
+ * the hardware dependent values, in this case 0-2000 for the FPGA. Changes are immediately sent to
+ * the FPGA, and the update occurs at the next FPGA cycle (5.005ms). There is no delay.
+ *
+ * <p>As of revision 0.1.10 of the FPGA, the FPGA interprets the 0-2000 values as follows: - 2000 =
+ * maximum pulse width - 1999 to 1001 = linear scaling from "full forward" to "center" - 1000 =
+ * center value - 999 to 2 = linear scaling from "center" to "full reverse" - 1 = minimum pulse
+ * width (currently .5ms) - 0 = disabled (i.e. PWM output is held low)
+ */
+public class PWM extends SendableBase implements Sendable {
+  /**
+   * Represents the amount to multiply the minimum servo-pulse pwm period by.
+   */
+  public enum PeriodMultiplier {
+    /**
+     * Period Multiplier: don't skip pulses. PWM pulses occur every 5.005 ms
+     */
+    k1X,
+    /**
+     * Period Multiplier: skip every other pulse. PWM pulses occur every 10.010 ms
+     */
+    k2X,
+    /**
+     * Period Multiplier: skip three out of four pulses. PWM pulses occur every 20.020 ms
+     */
+    k4X
+  }
+
+  private int m_channel;
+  private int m_handle;
+
+  /**
+   * Allocate a PWM given a channel.
+   *
+   * @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP port
+   */
+  public PWM(final int channel) {
+    SensorBase.checkPWMChannel(channel);
+    m_channel = channel;
+
+    m_handle = PWMJNI.initializePWMPort(DIOJNI.getPort((byte) channel));
+
+    setDisabled();
+
+    PWMJNI.setPWMEliminateDeadband(m_handle, false);
+
+    HAL.report(tResourceType.kResourceType_PWM, channel);
+    setName("PWM", channel);
+  }
+
+  /**
+   * Free the PWM channel.
+   *
+   * <p>Free the resource associated with the PWM channel and set the value to 0.
+   */
+  @Override
+  public void free() {
+    super.free();
+    if (m_handle == 0) {
+      return;
+    }
+    setDisabled();
+    PWMJNI.freePWMPort(m_handle);
+    m_handle = 0;
+  }
+
+  /**
+   * Optionally eliminate the deadband from a speed controller.
+   *
+   * @param eliminateDeadband If true, set the motor curve on the Jaguar to eliminate the deadband
+   *                          in the middle of the range. Otherwise, keep the full range without
+   *                          modifying any values.
+   */
+  public void enableDeadbandElimination(boolean eliminateDeadband) {
+    PWMJNI.setPWMEliminateDeadband(m_handle, eliminateDeadband);
+  }
+
+  /**
+   * Set the bounds on the PWM pulse widths. This sets the bounds on the PWM values for a particular
+   * type of controller. The values determine the upper and lower speeds as well as the deadband
+   * bracket.
+   *
+   * @param max         The max PWM pulse width in ms
+   * @param deadbandMax The high end of the deadband range pulse width in ms
+   * @param center      The center (off) pulse width in ms
+   * @param deadbandMin The low end of the deadband pulse width in ms
+   * @param min         The minimum pulse width in ms
+   */
+  public void setBounds(double max, double deadbandMax, double center, double deadbandMin,
+                           double min) {
+    PWMJNI.setPWMConfig(m_handle, max, deadbandMax, center, deadbandMin, min);
+  }
+
+  /**
+   * Gets the bounds on the PWM pulse widths. This Gets the bounds on the PWM values for a
+   * particular type of controller. The values determine the upper and lower speeds as well
+   * as the deadband bracket.
+   */
+  public PWMConfigDataResult getRawBounds() {
+    return PWMJNI.getPWMConfigRaw(m_handle);
+  }
+
+  /**
+   * Gets the channel number associated with the PWM Object.
+   *
+   * @return The channel number.
+   */
+  public int getChannel() {
+    return m_channel;
+  }
+
+  /**
+   * Set the PWM value based on a position.
+   *
+   * <p>This is intended to be used by servos.
+   *
+   * @param pos The position to set the servo between 0.0 and 1.0.
+   * @pre SetMaxPositivePwm() called.
+   * @pre SetMinNegativePwm() called.
+   */
+  public void setPosition(double pos) {
+    PWMJNI.setPWMPosition(m_handle, pos);
+  }
+
+  /**
+   * Get the PWM value in terms of a position.
+   *
+   * <p>This is intended to be used by servos.
+   *
+   * @return The position the servo is set to between 0.0 and 1.0.
+   * @pre SetMaxPositivePwm() called.
+   * @pre SetMinNegativePwm() called.
+   */
+  public double getPosition() {
+    return PWMJNI.getPWMPosition(m_handle);
+  }
+
+  /**
+   * Set the PWM value based on a speed.
+   *
+   * <p>This is intended to be used by speed controllers.
+   *
+   * @param speed The speed to set the speed controller between -1.0 and 1.0.
+   * @pre SetMaxPositivePwm() called.
+   * @pre SetMinPositivePwm() called.
+   * @pre SetCenterPwm() called.
+   * @pre SetMaxNegativePwm() called.
+   * @pre SetMinNegativePwm() called.
+   */
+  public void setSpeed(double speed) {
+    PWMJNI.setPWMSpeed(m_handle, speed);
+  }
+
+  /**
+   * Get the PWM value in terms of speed.
+   *
+   * <p>This is intended to be used by speed controllers.
+   *
+   * @return The most recently set speed between -1.0 and 1.0.
+   * @pre SetMaxPositivePwm() called.
+   * @pre SetMinPositivePwm() called.
+   * @pre SetMaxNegativePwm() called.
+   * @pre SetMinNegativePwm() called.
+   */
+  public double getSpeed() {
+    return PWMJNI.getPWMSpeed(m_handle);
+  }
+
+  /**
+   * Set the PWM value directly to the hardware.
+   *
+   * <p>Write a raw value to a PWM channel.
+   *
+   * @param value Raw PWM value. Range 0 - 255.
+   */
+  public void setRaw(int value) {
+    PWMJNI.setPWMRaw(m_handle, (short) value);
+  }
+
+  /**
+   * Get the PWM value directly from the hardware.
+   *
+   * <p>Read a raw value from a PWM channel.
+   *
+   * @return Raw PWM control value. Range: 0 - 255.
+   */
+  public int getRaw() {
+    return PWMJNI.getPWMRaw(m_handle);
+  }
+
+  /**
+   * Temporarily disables the PWM output. The next set call will reenable
+   * the output.
+   */
+  public void setDisabled() {
+    PWMJNI.setPWMDisabled(m_handle);
+  }
+
+  /**
+   * Slow down the PWM signal for old devices.
+   *
+   * @param mult The period multiplier to apply to this channel
+   */
+  public void setPeriodMultiplier(PeriodMultiplier mult) {
+    switch (mult) {
+      case k4X:
+        // Squelch 3 out of 4 outputs
+        PWMJNI.setPWMPeriodScale(m_handle, 3);
+        break;
+      case k2X:
+        // Squelch 1 out of 2 outputs
+        PWMJNI.setPWMPeriodScale(m_handle, 1);
+        break;
+      case k1X:
+        // Don't squelch any outputs
+        PWMJNI.setPWMPeriodScale(m_handle, 0);
+        break;
+      default:
+        // Cannot hit this, limited by PeriodMultiplier enum
+    }
+  }
+
+  protected void setZeroLatch() {
+    PWMJNI.latchPWMZero(m_handle);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Speed Controller");
+    builder.setSafeState(this::setDisabled);
+    builder.addDoubleProperty("Value", this::getSpeed, this::setSpeed);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMConfigDataResult.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMConfigDataResult.java
new file mode 100644
index 0000000..9373d91
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMConfigDataResult.java
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Structure for holding the config data result for PWM.
+ */
+public class PWMConfigDataResult {
+  PWMConfigDataResult(int max, int deadbandMax, int center, int deadbandMin, int min) {
+    this.max = max;
+    this.deadbandMax = deadbandMax;
+    this.center = center;
+    this.deadbandMin = deadbandMin;
+    this.min = min;
+  }
+
+  /**
+   * The maximum PWM value.
+   */
+  @SuppressWarnings("MemberName")
+  public int max;
+
+  /**
+   * The deadband maximum PWM value.
+   */
+  @SuppressWarnings("MemberName")
+  public int deadbandMax;
+
+  /**
+   * The center PWM value.
+   */
+  @SuppressWarnings("MemberName")
+  public int center;
+
+  /**
+   * The deadband minimum PWM value.
+   */
+  @SuppressWarnings("MemberName")
+  public int deadbandMin;
+
+  /**
+   * The minimum PWM value.
+   */
+  @SuppressWarnings("MemberName")
+  public int min;
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMSpeedController.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMSpeedController.java
new file mode 100644
index 0000000..8581a4c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMSpeedController.java
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Common base class for all PWM Speed Controllers.
+ */
+public abstract class PWMSpeedController extends SafePWM implements SpeedController {
+  private boolean m_isInverted = false;
+
+  /**
+   * Constructor.
+   *
+   * @param channel The PWM channel that the controller is attached to. 0-9 are on-board, 10-19 are
+   *                on the MXP port
+   */
+  protected PWMSpeedController(int channel) {
+    super(channel);
+  }
+
+  /**
+   * Set the PWM value.
+   *
+   * <p>The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the
+   * FPGA.
+   *
+   * @param speed The speed value between -1.0 and 1.0 to set.
+   */
+  @Override
+  public void set(double speed) {
+    setSpeed(m_isInverted ? -speed : speed);
+    feed();
+  }
+
+  /**
+   * Get the recently set value of the PWM.
+   *
+   * @return The most recently set value for the PWM between -1.0 and 1.0.
+   */
+  @Override
+  public double get() {
+    return getSpeed();
+  }
+
+  @Override
+  public void setInverted(boolean isInverted) {
+    m_isInverted = isInverted;
+  }
+
+  @Override
+  public boolean getInverted() {
+    return m_isInverted;
+  }
+
+  /**
+   * Write out the PID value as seen in the PIDOutput base object.
+   *
+   * @param output Write out the PWM value as was found in the PIDController
+   */
+  @Override
+  public void pidWrite(double output) {
+    set(output);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMTalonSRX.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMTalonSRX.java
new file mode 100644
index 0000000..c461bc0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMTalonSRX.java
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Cross the Road Electronics (CTRE) Talon SRX Speed Controller with PWM control.
+ */
+public class PWMTalonSRX extends PWMSpeedController {
+  /**
+   * Constructor for a PWMTalonSRX connected via PWM.
+   *
+   * <p>Note that the PWMTalonSRX uses the following bounds for PWM values. These values should work
+   * reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the TalonSRX User Manual
+   * available from CTRE.
+   *
+   * <p>- 2.0004ms = full "forward" - 1.52ms = the "high end" of the deadband range - 1.50ms =
+   * center
+   * of the deadband range (off) - 1.48ms = the "low end" of the deadband range - .997ms = full
+   * "reverse"
+   *
+   * @param channel The PWM channel that the PWMTalonSRX is attached to. 0-9 are on-board, 10-19 are
+   *                on the MXP port
+   */
+  public PWMTalonSRX(final int channel) {
+    super(channel);
+
+    setBounds(2.004, 1.52, 1.50, 1.48, .997);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_PWMTalonSRX, getChannel());
+    setName("PWMTalonSRX", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMVictorSPX.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMVictorSPX.java
new file mode 100644
index 0000000..caa1bb2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PWMVictorSPX.java
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+//import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+//import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Cross the Road Electronics (CTRE) Victor SPX Speed Controller with PWM control.
+ */
+public class PWMVictorSPX extends PWMSpeedController {
+  /**
+   * Constructor for a PWMVictorSPX connected via PWM.
+   *
+   * <p>Note that the PWMVictorSPX uses the following bounds for PWM values. These values should
+   *  work reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the VictorSPX User
+   * Manual available from CTRE.
+   *
+   * <p>- 2.0004ms = full "forward" - 1.52ms = the "high end" of the deadband range - 1.50ms =
+   * center
+   * of the deadband range (off) - 1.48ms = the "low end" of the deadband range - .997ms = full
+   * "reverse"
+   *
+   * @param channel The PWM channel that the PWMVictorSPX is attached to. 0-9 are on-board, 10-19
+   *                are on the MXP port
+   */
+  public PWMVictorSPX(final int channel) {
+    super(channel);
+
+    setBounds(2.004, 1.52, 1.50, 1.48, .997);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    //HAL.report(tResourceType.kResourceType_PWMVictorSPX, getChannel());
+    setName("PWMVictorSPX", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java
new file mode 100644
index 0000000..958d2e0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/PowerDistributionPanel.java
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.PDPJNI;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Class for getting voltage, current, temperature, power and energy from the Power Distribution
+ * Panel over CAN.
+ */
+public class PowerDistributionPanel extends SensorBase implements Sendable {
+  private final int m_module;
+
+  /**
+   * Constructor.
+   *
+   * @param module The CAN ID of the PDP
+   */
+  public PowerDistributionPanel(int module) {
+    m_module = module;
+    checkPDPModule(module);
+    PDPJNI.initializePDP(module);
+    setName("PowerDistributionPanel", module);
+  }
+
+  /**
+   * Constructor.  Uses the default CAN ID (0).
+   */
+  public PowerDistributionPanel() {
+    this(0);
+  }
+
+  /**
+   * Query the input voltage of the PDP.
+   *
+   * @return The voltage of the PDP in volts
+   */
+  public double getVoltage() {
+    return PDPJNI.getPDPVoltage(m_module);
+  }
+
+  /**
+   * Query the temperature of the PDP.
+   *
+   * @return The temperature of the PDP in degrees Celsius
+   */
+  public double getTemperature() {
+    return PDPJNI.getPDPTemperature(m_module);
+  }
+
+  /**
+   * Query the current of a single channel of the PDP.
+   *
+   * @return The current of one of the PDP channels (channels 0-15) in Amperes
+   */
+  public double getCurrent(int channel) {
+    double current = PDPJNI.getPDPChannelCurrent((byte) channel, m_module);
+
+    checkPDPChannel(channel);
+
+    return current;
+  }
+
+  /**
+   * Query the current of all monitored PDP channels (0-15).
+   *
+   * @return The current of all the channels in Amperes
+   */
+  public double getTotalCurrent() {
+    return PDPJNI.getPDPTotalCurrent(m_module);
+  }
+
+  /**
+   * Query the total power drawn from the monitored PDP channels.
+   *
+   * @return the total power in Watts
+   */
+  public double getTotalPower() {
+    return PDPJNI.getPDPTotalPower(m_module);
+  }
+
+  /**
+   * Query the total energy drawn from the monitored PDP channels.
+   *
+   * @return the total energy in Joules
+   */
+  public double getTotalEnergy() {
+    return PDPJNI.getPDPTotalEnergy(m_module);
+  }
+
+  /**
+   * Reset the total energy to 0.
+   */
+  public void resetTotalEnergy() {
+    PDPJNI.resetPDPTotalEnergy(m_module);
+  }
+
+  /**
+   * Clear all PDP sticky faults.
+   */
+  public void clearStickyFaults() {
+    PDPJNI.clearPDPStickyFaults(m_module);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("PowerDistributionPanel");
+    for (int i = 0; i < kPDPChannels; ++i) {
+      final int chan = i;
+      builder.addDoubleProperty("Chan" + i, () -> getCurrent(chan), null);
+    }
+    builder.addDoubleProperty("Voltage", this::getVoltage, null);
+    builder.addDoubleProperty("TotalCurrent", this::getTotalCurrent, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java
new file mode 100644
index 0000000..fcab667
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Preferences.java
@@ -0,0 +1,247 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.util.Vector;
+
+import edu.wpi.first.networktables.EntryListenerFlags;
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * The preferences class provides a relatively simple way to save important values to the roboRIO to
+ * access the next time the roboRIO is booted.
+ *
+ * <p> This class loads and saves from a file inside the roboRIO. The user can not access the file
+ * directly, but may modify values at specific fields which will then be automatically saved to the
+ * file by the NetworkTables server. </p>
+ *
+ * <p> This class is thread safe. </p>
+ *
+ * <p> This will also interact with {@link NetworkTable} by creating a table called "Preferences"
+ * with all the key-value pairs. </p>
+ */
+public class Preferences {
+  /**
+   * The Preferences table name.
+   */
+  private static final String TABLE_NAME = "Preferences";
+  /**
+   * The singleton instance.
+   */
+  private static Preferences instance;
+  /**
+   * The network table.
+   */
+  private final NetworkTable m_table;
+
+  /**
+   * Returns the preferences instance.
+   *
+   * @return the preferences instance
+   */
+  public static synchronized Preferences getInstance() {
+    if (instance == null) {
+      instance = new Preferences();
+    }
+    return instance;
+  }
+
+  /**
+   * Creates a preference class.
+   */
+  private Preferences() {
+    m_table = NetworkTableInstance.getDefault().getTable(TABLE_NAME);
+    m_table.getEntry(".type").setString("RobotPreferences");
+    // Listener to set all Preferences values to persistent
+    // (for backwards compatibility with old dashboards).
+    m_table.addEntryListener(
+        (table, key, entry, value, flags) -> entry.setPersistent(),
+        EntryListenerFlags.kImmediate | EntryListenerFlags.kNew);
+    HAL.report(tResourceType.kResourceType_Preferences, 0);
+  }
+
+  /**
+   * Gets the vector of keys.
+   * @return a vector of the keys
+   */
+  public Vector<String> getKeys() {
+    return new Vector<>(m_table.getKeys());
+  }
+
+  /**
+   * Puts the given string into the preferences table.
+   *
+   * @param key   the key
+   * @param value the value
+   * @throws NullPointerException if value is null
+   */
+  public void putString(String key, String value) {
+    requireNonNull(value, "Provided value was null");
+
+    NetworkTableEntry entry = m_table.getEntry(key);
+    entry.setString(value);
+    entry.setPersistent();
+  }
+
+  /**
+   * Puts the given int into the preferences table.
+   *
+   * @param key   the key
+   * @param value the value
+   */
+  public void putInt(String key, int value) {
+    NetworkTableEntry entry = m_table.getEntry(key);
+    entry.setDouble(value);
+    entry.setPersistent();
+  }
+
+  /**
+   * Puts the given double into the preferences table.
+   *
+   * @param key   the key
+   * @param value the value
+   */
+  public void putDouble(String key, double value) {
+    NetworkTableEntry entry = m_table.getEntry(key);
+    entry.setDouble(value);
+    entry.setPersistent();
+  }
+
+  /**
+   * Puts the given float into the preferences table.
+   *
+   * @param key   the key
+   * @param value the value
+   */
+  public void putFloat(String key, float value) {
+    NetworkTableEntry entry = m_table.getEntry(key);
+    entry.setDouble(value);
+    entry.setPersistent();
+  }
+
+  /**
+   * Puts the given boolean into the preferences table.
+   *
+   * @param key   the key
+   * @param value the value
+   */
+  public void putBoolean(String key, boolean value) {
+    NetworkTableEntry entry = m_table.getEntry(key);
+    entry.setBoolean(value);
+    entry.setPersistent();
+  }
+
+  /**
+   * Puts the given long into the preferences table.
+   *
+   * @param key   the key
+   * @param value the value
+   */
+  public void putLong(String key, long value) {
+    NetworkTableEntry entry = m_table.getEntry(key);
+    entry.setDouble(value);
+    entry.setPersistent();
+  }
+
+  /**
+   * Returns whether or not there is a key with the given name.
+   *
+   * @param key the key
+   * @return if there is a value at the given key
+   */
+  public boolean containsKey(String key) {
+    return m_table.containsKey(key);
+  }
+
+  /**
+   * Remove a preference.
+   *
+   * @param key the key
+   */
+  public void remove(String key) {
+    m_table.delete(key);
+  }
+
+  /**
+   * Returns the string at the given key. If this table does not have a value for that position,
+   * then the given backup value will be returned.
+   *
+   * @param key    the key
+   * @param backup the value to return if none exists in the table
+   * @return either the value in the table, or the backup
+   */
+  public String getString(String key, String backup) {
+    return m_table.getEntry(key).getString(backup);
+  }
+
+  /**
+   * Returns the int at the given key. If this table does not have a value for that position, then
+   * the given backup value will be returned.
+   *
+   * @param key    the key
+   * @param backup the value to return if none exists in the table
+   * @return either the value in the table, or the backup
+   */
+  public int getInt(String key, int backup) {
+    return (int) m_table.getEntry(key).getDouble(backup);
+  }
+
+  /**
+   * Returns the double at the given key. If this table does not have a value for that position,
+   * then the given backup value will be returned.
+   *
+   * @param key    the key
+   * @param backup the value to return if none exists in the table
+   * @return either the value in the table, or the backup
+   */
+  public double getDouble(String key, double backup) {
+    return m_table.getEntry(key).getDouble(backup);
+  }
+
+  /**
+   * Returns the boolean at the given key. If this table does not have a value for that position,
+   * then the given backup value will be returned.
+   *
+   * @param key    the key
+   * @param backup the value to return if none exists in the table
+   * @return either the value in the table, or the backup
+   */
+  public boolean getBoolean(String key, boolean backup) {
+    return m_table.getEntry(key).getBoolean(backup);
+  }
+
+  /**
+   * Returns the float at the given key. If this table does not have a value for that position, then
+   * the given backup value will be returned.
+   *
+   * @param key    the key
+   * @param backup the value to return if none exists in the table
+   * @return either the value in the table, or the backup
+   */
+  public float getFloat(String key, float backup) {
+    return (float) m_table.getEntry(key).getDouble(backup);
+  }
+
+  /**
+   * Returns the long at the given key. If this table does not have a value for that position, then
+   * the given backup value will be returned.
+   *
+   * @param key    the key
+   * @param backup the value to return if none exists in the table
+   * @return either the value in the table, or the backup
+   */
+  public long getLong(String key, long backup) {
+    return (long) m_table.getEntry(key).getDouble(backup);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java
new file mode 100644
index 0000000..38e18a5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Relay.java
@@ -0,0 +1,339 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.RelayJNI;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+import java.util.Arrays;
+import java.util.Optional;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Class for VEX Robotics Spike style relay outputs. Relays are intended to be connected to Spikes
+ * or similar relays. The relay channels controls a pair of channels that are either both off, one
+ * on, the other on, or both on. This translates into two Spike outputs at 0v, one at 12v and one
+ * at 0v, one at 0v and the other at 12v, or two Spike outputs at 12V. This allows off, full
+ * forward, or full reverse control of motors without variable speed. It also allows the two
+ * channels (forward and reverse) to be used independently for something that does not care about
+ * voltage polarity (like a solenoid).
+ */
+public class Relay extends SendableBase implements MotorSafety, Sendable {
+  private MotorSafetyHelper m_safetyHelper;
+
+  /**
+   * This class represents errors in trying to set relay values contradictory to the direction to
+   * which the relay is set.
+   */
+  public class InvalidValueException extends RuntimeException {
+    /**
+     * Create a new exception with the given message.
+     *
+     * @param message the message to pass with the exception
+     */
+    public InvalidValueException(String message) {
+      super(message);
+    }
+  }
+
+  /**
+   * The state to drive a Relay to.
+   */
+  public enum Value {
+    kOff("Off"),
+    kOn("On"),
+    kForward("Forward"),
+    kReverse("Reverse");
+
+    private final String m_prettyValue;
+
+    Value(String prettyValue) {
+      m_prettyValue = prettyValue;
+    }
+
+    public String getPrettyValue() {
+      return m_prettyValue;
+    }
+
+    public static Optional<Value> getValueOf(String value) {
+      return Arrays.stream(Value.values()).filter(v -> v.m_prettyValue.equals(value)).findFirst();
+    }
+  }
+
+  /**
+   * The Direction(s) that a relay is configured to operate in.
+   */
+  public enum Direction {
+    /**
+     * direction: both directions are valid.
+     */
+
+    kBoth,
+    /**
+     * direction: Only forward is valid.
+     */
+    kForward,
+    /**
+     * direction: only reverse is valid.
+     */
+    kReverse
+  }
+
+  private final int m_channel;
+
+  private int m_forwardHandle = 0;
+  private int m_reverseHandle = 0;
+
+  private Direction m_direction;
+
+  /**
+   * Common relay initialization method. This code is common to all Relay constructors and
+   * initializes the relay and reserves all resources that need to be locked. Initially the relay is
+   * set to both lines at 0v.
+   */
+  private void initRelay() {
+    SensorBase.checkRelayChannel(m_channel);
+
+    int portHandle = RelayJNI.getPort((byte) m_channel);
+    if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
+      m_forwardHandle = RelayJNI.initializeRelayPort(portHandle, true);
+      HAL.report(tResourceType.kResourceType_Relay, m_channel);
+    }
+    if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
+      m_reverseHandle = RelayJNI.initializeRelayPort(portHandle, false);
+      HAL.report(tResourceType.kResourceType_Relay, m_channel + 128);
+    }
+
+    m_safetyHelper = new MotorSafetyHelper(this);
+    m_safetyHelper.setSafetyEnabled(false);
+
+    setName("Relay", m_channel);
+  }
+
+  /**
+   * Relay constructor given a channel.
+   *
+   * @param channel The channel number for this relay (0 - 3).
+   * @param direction The direction that the Relay object will control.
+   */
+  public Relay(final int channel, Direction direction) {
+    m_channel = channel;
+    m_direction = requireNonNull(direction, "Null Direction was given");
+    initRelay();
+    set(Value.kOff);
+  }
+
+  /**
+   * Relay constructor given a channel, allowing both directions.
+   *
+   * @param channel The channel number for this relay (0 - 3).
+   */
+  public Relay(final int channel) {
+    this(channel, Direction.kBoth);
+  }
+
+  @Override
+  public void free() {
+    super.free();
+    freeRelay();
+  }
+
+  private void freeRelay() {
+    try {
+      RelayJNI.setRelay(m_forwardHandle, false);
+    } catch (RuntimeException ex) {
+      // do nothing. Ignore
+    }
+    try {
+      RelayJNI.setRelay(m_reverseHandle, false);
+    } catch (RuntimeException ex) {
+      // do nothing. Ignore
+    }
+
+    RelayJNI.freeRelayPort(m_forwardHandle);
+    RelayJNI.freeRelayPort(m_reverseHandle);
+
+    m_forwardHandle = 0;
+    m_reverseHandle = 0;
+  }
+
+  /**
+   * Set the relay state.
+   *
+   * <p>Valid values depend on which directions of the relay are controlled by the object.
+   *
+   * <p>When set to kBothDirections, the relay can be set to any of the four states: 0v-0v, 12v-0v,
+   * 0v-12v, 12v-12v
+   *
+   * <p>When set to kForwardOnly or kReverseOnly, you can specify the constant for the direction or
+   * you can simply specify kOff and kOn. Using only kOff and kOn is recommended.
+   *
+   * @param value The state to set the relay.
+   */
+  public void set(Value value) {
+    switch (value) {
+      case kOff:
+        if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
+          RelayJNI.setRelay(m_forwardHandle, false);
+        }
+        if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
+          RelayJNI.setRelay(m_reverseHandle, false);
+        }
+        break;
+      case kOn:
+        if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
+          RelayJNI.setRelay(m_forwardHandle, true);
+        }
+        if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
+          RelayJNI.setRelay(m_reverseHandle, true);
+        }
+        break;
+      case kForward:
+        if (m_direction == Direction.kReverse) {
+          throw new InvalidValueException("A relay configured for reverse cannot be set to "
+              + "forward");
+        }
+        if (m_direction == Direction.kBoth || m_direction == Direction.kForward) {
+          RelayJNI.setRelay(m_forwardHandle, true);
+        }
+        if (m_direction == Direction.kBoth) {
+          RelayJNI.setRelay(m_reverseHandle, false);
+        }
+        break;
+      case kReverse:
+        if (m_direction == Direction.kForward) {
+          throw new InvalidValueException("A relay configured for forward cannot be set to "
+              + "reverse");
+        }
+        if (m_direction == Direction.kBoth) {
+          RelayJNI.setRelay(m_forwardHandle, false);
+        }
+        if (m_direction == Direction.kBoth || m_direction == Direction.kReverse) {
+          RelayJNI.setRelay(m_reverseHandle, true);
+        }
+        break;
+      default:
+        // Cannot hit this, limited by Value enum
+    }
+  }
+
+  /**
+   * Get the Relay State.
+   *
+   * <p>Gets the current state of the relay.
+   *
+   * <p>When set to kForwardOnly or kReverseOnly, value is returned as kOn/kOff not
+   * kForward/kReverse (per the recommendation in Set)
+   *
+   * @return The current state of the relay as a Relay::Value
+   */
+  public Value get() {
+    if (m_direction == Direction.kForward) {
+      if (RelayJNI.getRelay(m_forwardHandle)) {
+        return Value.kOn;
+      } else {
+        return Value.kOff;
+      }
+    } else if (m_direction == Direction.kReverse) {
+      if (RelayJNI.getRelay(m_reverseHandle)) {
+        return Value.kOn;
+      } else {
+        return Value.kOff;
+      }
+    } else {
+      if (RelayJNI.getRelay(m_forwardHandle)) {
+        if (RelayJNI.getRelay(m_reverseHandle)) {
+          return Value.kOn;
+        } else {
+          return Value.kForward;
+        }
+      } else {
+        if (RelayJNI.getRelay(m_reverseHandle)) {
+          return Value.kReverse;
+        } else {
+          return Value.kOff;
+        }
+      }
+    }
+  }
+
+  /**
+   * Get the channel number.
+   *
+   * @return The channel number.
+   */
+  public int getChannel() {
+    return m_channel;
+  }
+
+  @Override
+  public void setExpiration(double timeout) {
+    m_safetyHelper.setExpiration(timeout);
+  }
+
+  @Override
+  public double getExpiration() {
+    return m_safetyHelper.getExpiration();
+  }
+
+  @Override
+  public boolean isAlive() {
+    return m_safetyHelper.isAlive();
+  }
+
+  @Override
+  public void stopMotor() {
+    set(Value.kOff);
+  }
+
+  @Override
+  public boolean isSafetyEnabled() {
+    return m_safetyHelper.isSafetyEnabled();
+  }
+
+  @Override
+  public void setSafetyEnabled(boolean enabled) {
+    m_safetyHelper.setSafetyEnabled(enabled);
+  }
+
+  @Override
+  public String getDescription() {
+    return "Relay ID " + getChannel();
+  }
+
+  /**
+   * Set the Relay Direction.
+   *
+   * <p>Changes which values the relay can be set to depending on which direction is used
+   *
+   * <p>Valid inputs are kBothDirections, kForwardOnly, and kReverseOnly
+   *
+   * @param direction The direction for the relay to operate in
+   */
+  public void setDirection(Direction direction) {
+    requireNonNull(direction, "Null Direction was given");
+    if (m_direction == direction) {
+      return;
+    }
+
+    freeRelay();
+    m_direction = direction;
+    initRelay();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Relay");
+    builder.setSafeState(() -> set(Value.kOff));
+    builder.addStringProperty("Value", () -> get().getPrettyValue(),
+        (value) -> set(Value.getValueOf(value).orElse(Value.kOff)));
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java
new file mode 100644
index 0000000..4e9ebb1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Resource.java
@@ -0,0 +1,110 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.util.AllocationException;
+import edu.wpi.first.wpilibj.util.CheckedAllocationException;
+
+/**
+ * Track resources in the program. The Resource class is a convenient way of keeping track of
+ * allocated arbitrary resources in the program. Resources are just indices that have an lower and
+ * upper bound that are tracked by this class. In the library they are used for tracking allocation
+ * of hardware channels but this is purely arbitrary. The resource class does not do any actual
+ * allocation, but simply tracks if a given index is currently in use.
+ *
+ * <p><b>WARNING:</b> this should only be statically allocated. When the program loads into memory
+ * all the static constructors are called. At that time a linked list of all the "Resources" is
+ * created. Then when the program actually starts - in the Robot constructor, all resources are
+ * initialized. This ensures that the program is restartable in memory without having to
+ * unload/reload.
+ */
+public final class Resource {
+  private static Resource resourceList = null;
+  private final boolean[] m_numAllocated;
+  private final int m_size;
+  private final Resource m_nextResource;
+
+  /**
+   * Clears all allocated resources.
+   */
+  public static void restartProgram() {
+    for (Resource r = Resource.resourceList; r != null; r = r.m_nextResource) {
+      for (int i = 0; i < r.m_size; i++) {
+        r.m_numAllocated[i] = false;
+      }
+    }
+  }
+
+  /**
+   * Allocate storage for a new instance of Resource. Allocate a bool array of values that will get
+   * initialized to indicate that no resources have been allocated yet. The indices of the
+   * resources are 0..size-1.
+   *
+   * @param size The number of blocks to allocate
+   */
+  public Resource(final int size) {
+    m_size = size;
+    m_numAllocated = new boolean[size];
+    for (int i = 0; i < size; i++) {
+      m_numAllocated[i] = false;
+    }
+    m_nextResource = Resource.resourceList;
+    Resource.resourceList = this;
+  }
+
+  /**
+   * Allocate a resource. When a resource is requested, mark it allocated. In this case, a free
+   * resource value within the range is located and returned after it is marked allocated.
+   *
+   * @return The index of the allocated block.
+   * @throws CheckedAllocationException If there are no resources available to be allocated.
+   */
+  public int allocate() throws CheckedAllocationException {
+    for (int i = 0; i < m_size; i++) {
+      if (!m_numAllocated[i]) {
+        m_numAllocated[i] = true;
+        return i;
+      }
+    }
+    throw new CheckedAllocationException("No available resources");
+  }
+
+  /**
+   * Allocate a specific resource value. The user requests a specific resource value, i.e. channel
+   * number and it is verified unallocated, then returned.
+   *
+   * @param index The resource to allocate
+   * @return The index of the allocated block
+   * @throws CheckedAllocationException If there are no resources available to be allocated.
+   */
+  public int allocate(final int index) throws CheckedAllocationException {
+    if (index >= m_size || index < 0) {
+      throw new CheckedAllocationException("Index " + index + " out of range");
+    }
+    if (m_numAllocated[index]) {
+      throw new CheckedAllocationException("Resource at index " + index + " already allocated");
+    }
+    m_numAllocated[index] = true;
+    return index;
+  }
+
+  /**
+   * Free an allocated resource. After a resource is no longer needed, for example a destructor is
+   * called for a channel assignment class, Free will release the resource value so it can be reused
+   * somewhere else in the program.
+   *
+   * @param index The index of the resource to free.
+   */
+  public void free(final int index) {
+    if (!m_numAllocated[index]) {
+      throw new AllocationException("No resource available to be freed");
+    }
+    m_numAllocated[index] = false;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
new file mode 100644
index 0000000..693df20
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotBase.java
@@ -0,0 +1,272 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.jar.Manifest;
+
+import edu.wpi.cscore.CameraServerJNI;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.HALUtil;
+import edu.wpi.first.wpilibj.internal.HardwareHLUsageReporting;
+import edu.wpi.first.wpilibj.internal.HardwareTimer;
+import edu.wpi.first.wpilibj.livewindow.LiveWindow;
+import edu.wpi.first.wpilibj.util.WPILibVersion;
+
+/**
+ * Implement a Robot Program framework. The RobotBase class is intended to be subclassed by a user
+ * creating a robot program. Overridden autonomous() and operatorControl() methods are called at the
+ * appropriate time as the match proceeds. In the current implementation, the Autonomous code will
+ * run to completion before the OperatorControl code could start. In the future the Autonomous code
+ * might be spawned as a task, then killed at the end of the Autonomous period.
+ */
+public abstract class RobotBase {
+  /**
+   * The VxWorks priority that robot code should work at (so Java code should run at).
+   */
+  public static final int ROBOT_TASK_PRIORITY = 101;
+
+  /**
+   * The ID of the main Java thread.
+   */
+  // This is usually 1, but it is best to make sure
+  public static final long MAIN_THREAD_ID = Thread.currentThread().getId();
+
+  protected final DriverStation m_ds;
+
+  /**
+   * Constructor for a generic robot program. User code should be placed in the constructor that
+   * runs before the Autonomous or Operator Control period starts. The constructor will run to
+   * completion before Autonomous is entered.
+   *
+   * <p>This must be used to ensure that the communications code starts. In the future it would be
+   * nice
+   * to put this code into it's own task that loads on boot so ensure that it runs.
+   */
+  protected RobotBase() {
+    NetworkTableInstance inst = NetworkTableInstance.getDefault();
+    inst.setNetworkIdentity("Robot");
+    inst.startServer("/home/lvuser/networktables.ini");
+    m_ds = DriverStation.getInstance();
+    inst.getTable("LiveWindow").getSubTable(".status").getEntry("LW Enabled").setBoolean(false);
+
+    LiveWindow.setEnabled(false);
+  }
+
+  /**
+   * Free the resources for a RobotBase class.
+   */
+  public void free() {
+  }
+
+  /**
+   * Get if the robot is a simulation.
+   *
+   * @return If the robot is running in simulation.
+   */
+  public static boolean isSimulation() {
+    return !isReal();
+  }
+
+  /**
+   * Get if the robot is real.
+   *
+   * @return If the robot is running in the real world.
+   */
+  public static boolean isReal() {
+    return HALUtil.getHALRuntimeType() == 0;
+  }
+
+  /**
+   * Determine if the Robot is currently disabled.
+   *
+   * @return True if the Robot is currently disabled by the field controls.
+   */
+  public boolean isDisabled() {
+    return m_ds.isDisabled();
+  }
+
+  /**
+   * Determine if the Robot is currently enabled.
+   *
+   * @return True if the Robot is currently enabled by the field controls.
+   */
+  public boolean isEnabled() {
+    return m_ds.isEnabled();
+  }
+
+  /**
+   * Determine if the robot is currently in Autonomous mode as determined by the field
+   * controls.
+   *
+   * @return True if the robot is currently operating Autonomously.
+   */
+  public boolean isAutonomous() {
+    return m_ds.isAutonomous();
+  }
+
+  /**
+   * Determine if the robot is currently in Test mode as determined by the driver
+   * station.
+   *
+   * @return True if the robot is currently operating in Test mode.
+   */
+  public boolean isTest() {
+    return m_ds.isTest();
+  }
+
+  /**
+   * Determine if the robot is currently in Operator Control mode as determined by the field
+   * controls.
+   *
+   * @return True if the robot is currently operating in Tele-Op mode.
+   */
+  public boolean isOperatorControl() {
+    return m_ds.isOperatorControl();
+  }
+
+  /**
+   * Indicates if new data is available from the driver station.
+   *
+   * @return Has new data arrived over the network since the last time this function was called?
+   */
+  public boolean isNewDataAvailable() {
+    return m_ds.isNewControlData();
+  }
+
+  /**
+   * Provide an alternate "main loop" via startCompetition().
+   */
+  public abstract void startCompetition();
+
+  @SuppressWarnings("JavadocMethod")
+  public static boolean getBooleanProperty(String name, boolean defaultValue) {
+    String propVal = System.getProperty(name);
+    if (propVal == null) {
+      return defaultValue;
+    }
+    if (propVal.equalsIgnoreCase("false")) {
+      return false;
+    } else if (propVal.equalsIgnoreCase("true")) {
+      return true;
+    } else {
+      throw new IllegalStateException(propVal);
+    }
+  }
+
+  /**
+   * Common initialization for all robot programs.
+   */
+  public static void initializeHardwareConfiguration() {
+    if (!HAL.initialize(500, 0)) {
+      throw new IllegalStateException("Failed to initialize. Terminating");
+    }
+
+    // Set some implementations so that the static methods work properly
+    Timer.SetImplementation(new HardwareTimer());
+    HLUsageReporting.SetImplementation(new HardwareHLUsageReporting());
+    RobotState.SetImplementation(DriverStation.getInstance());
+
+    // Call a CameraServer JNI function to force OpenCV native library loading
+    // Needed because all the OpenCV JNI functions don't have built in loading
+    CameraServerJNI.enumerateSinks();
+  }
+
+  /**
+   * Starting point for the applications.
+   */
+  @SuppressWarnings("PMD.UnusedFormalParameter")
+  public static void main(String... args) {
+    initializeHardwareConfiguration();
+
+    HAL.report(tResourceType.kResourceType_Language, tInstances.kLanguage_Java);
+
+    String robotName = "";
+    Enumeration<URL> resources = null;
+    try {
+      resources = RobotBase.class.getClassLoader().getResources("META-INF/MANIFEST.MF");
+    } catch (IOException ex) {
+      ex.printStackTrace();
+    }
+    while (resources != null && resources.hasMoreElements()) {
+      try {
+        Manifest manifest = new Manifest(resources.nextElement().openStream());
+        robotName = manifest.getMainAttributes().getValue("Robot-Class");
+      } catch (IOException ex) {
+        ex.printStackTrace();
+      }
+    }
+
+    System.out.println("********** Robot program starting **********");
+
+    RobotBase robot;
+    try {
+      robot = (RobotBase) Class.forName(robotName).newInstance();
+    } catch (Throwable throwable) {
+      Throwable cause = throwable.getCause();
+      if (cause != null) {
+        throwable = cause;
+      }
+      DriverStation.reportError("Unhandled exception instantiating robot " + robotName + " "
+          + throwable.toString(), throwable.getStackTrace());
+      DriverStation.reportWarning("Robots should not quit, but yours did!", false);
+      DriverStation.reportError("Could not instantiate robot " + robotName + "!", false);
+      System.exit(1);
+      return;
+    }
+
+    try {
+      final File file = new File("/tmp/frc_versions/FRC_Lib_Version.ini");
+
+      if (file.exists()) {
+        file.delete();
+      }
+
+      file.createNewFile();
+
+      try (FileOutputStream output = new FileOutputStream(file)) {
+        output.write("Java ".getBytes());
+        output.write(WPILibVersion.Version.getBytes());
+      }
+
+    } catch (IOException ex) {
+      ex.printStackTrace();
+    }
+
+    boolean errorOnExit = false;
+    try {
+      robot.startCompetition();
+    } catch (Throwable throwable) {
+      Throwable cause = throwable.getCause();
+      if (cause != null) {
+        throwable = cause;
+      }
+      DriverStation.reportError("Unhandled exception: " + throwable.toString(),
+          throwable.getStackTrace());
+      errorOnExit = true;
+    } finally {
+      // startCompetition never returns unless exception occurs....
+      DriverStation.reportWarning("Robots should not quit, but yours did!", false);
+      if (errorOnExit) {
+        DriverStation.reportError(
+            "The startCompetition() method (or methods called by it) should have "
+                + "handled the exception above.", false);
+      } else {
+        DriverStation.reportError("Unexpected return from startCompetition() method.", false);
+      }
+    }
+    System.exit(1);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotController.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotController.java
new file mode 100644
index 0000000..5a2b52f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotController.java
@@ -0,0 +1,231 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.can.CANJNI;
+import edu.wpi.first.wpilibj.can.CANStatus;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.HALUtil;
+import edu.wpi.first.wpilibj.hal.PowerJNI;
+
+/**
+ * Contains functions for roboRIO functionality.
+ */
+public final class RobotController {
+  private RobotController() {
+  }
+
+  /**
+   * Return the FPGA Version number. For now, expect this to be the current
+   * year.
+   *
+   * @return FPGA Version number.
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public static int getFPGAVersion() {
+    return HALUtil.getFPGAVersion();
+  }
+
+  /**
+   * Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most
+   * significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least
+   * significant bits are the Build Number.
+   *
+   * @return FPGA Revision number.
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public static long getFPGARevision() {
+    return (long) HALUtil.getFPGARevision();
+  }
+
+  /**
+   * Read the microsecond timer from the FPGA.
+   *
+   * @return The current time in microseconds according to the FPGA.
+   */
+  public static long getFPGATime() {
+    return HALUtil.getFPGATime();
+  }
+
+  /**
+   * Get the state of the "USER" button on the roboRIO.
+   *
+   * @return true if the button is currently pressed down
+   */
+  public static boolean getUserButton() {
+    return HALUtil.getFPGAButton();
+  }
+
+  /**
+   * Read the battery voltage.
+   *
+   * @return The battery voltage in Volts.
+   */
+  public static double getBatteryVoltage() {
+    return PowerJNI.getVinVoltage();
+  }
+
+  /**
+   * Gets a value indicating whether the FPGA outputs are enabled. The outputs may be disabled if
+   * the robot is disabled or e-stopped, the watchdog has expired, or if the roboRIO browns out.
+   *
+   * @return True if the FPGA outputs are enabled.
+   */
+  public static boolean isSysActive() {
+    return HAL.getSystemActive();
+  }
+
+  /**
+   * Check if the system is browned out.
+   *
+   * @return True if the system is browned out
+   */
+  public static boolean isBrownedOut() {
+    return HAL.getBrownedOut();
+  }
+
+  /**
+   * Get the input voltage to the robot controller.
+   *
+   * @return The controller input voltage value in Volts
+   */
+  public static double getInputVoltage() {
+    return PowerJNI.getVinVoltage();
+  }
+
+  /**
+   * Get the input current to the robot controller.
+   *
+   * @return The controller input current value in Amps
+   */
+  public static double getInputCurrent() {
+    return PowerJNI.getVinCurrent();
+  }
+
+  /**
+   * Get the voltage of the 3.3V rail.
+   *
+   * @return The controller 3.3V rail voltage value in Volts
+   */
+  public static double getVoltage3V3() {
+    return PowerJNI.getUserVoltage3V3();
+  }
+
+  /**
+   * Get the current output of the 3.3V rail.
+   *
+   * @return The controller 3.3V rail output current value in Volts
+   */
+  public static double getCurrent3V3() {
+    return PowerJNI.getUserCurrent3V3();
+  }
+
+  /**
+   * Get the enabled state of the 3.3V rail. The rail may be disabled due to a controller brownout,
+   * a short circuit on the rail, or controller over-voltage.
+   *
+   * @return The controller 3.3V rail enabled value
+   */
+  public static boolean getEnabled3V3() {
+    return PowerJNI.getUserActive3V3();
+  }
+
+  /**
+   * Get the count of the total current faults on the 3.3V rail since the controller has booted.
+   *
+   * @return The number of faults
+   */
+  public static int getFaultCount3V3() {
+    return PowerJNI.getUserCurrentFaults3V3();
+  }
+
+  /**
+   * Get the voltage of the 5V rail.
+   *
+   * @return The controller 5V rail voltage value in Volts
+   */
+  public static double getVoltage5V() {
+    return PowerJNI.getUserVoltage5V();
+  }
+
+  /**
+   * Get the current output of the 5V rail.
+   *
+   * @return The controller 5V rail output current value in Amps
+   */
+  public static double getCurrent5V() {
+    return PowerJNI.getUserCurrent5V();
+  }
+
+  /**
+   * Get the enabled state of the 5V rail. The rail may be disabled due to a controller brownout, a
+   * short circuit on the rail, or controller over-voltage.
+   *
+   * @return The controller 5V rail enabled value
+   */
+  public static boolean getEnabled5V() {
+    return PowerJNI.getUserActive5V();
+  }
+
+  /**
+   * Get the count of the total current faults on the 5V rail since the controller has booted.
+   *
+   * @return The number of faults
+   */
+  public static int getFaultCount5V() {
+    return PowerJNI.getUserCurrentFaults5V();
+  }
+
+  /**
+   * Get the voltage of the 6V rail.
+   *
+   * @return The controller 6V rail voltage value in Volts
+   */
+  public static double getVoltage6V() {
+    return PowerJNI.getUserVoltage6V();
+  }
+
+  /**
+   * Get the current output of the 6V rail.
+   *
+   * @return The controller 6V rail output current value in Amps
+   */
+  public static double getCurrent6V() {
+    return PowerJNI.getUserCurrent6V();
+  }
+
+  /**
+   * Get the enabled state of the 6V rail. The rail may be disabled due to a controller brownout, a
+   * short circuit on the rail, or controller over-voltage.
+   *
+   * @return The controller 6V rail enabled value
+   */
+  public static boolean getEnabled6V() {
+    return PowerJNI.getUserActive6V();
+  }
+
+  /**
+   * Get the count of the total current faults on the 6V rail since the controller has booted.
+   *
+   * @return The number of faults
+   */
+  public static int getFaultCount6V() {
+    return PowerJNI.getUserCurrentFaults6V();
+  }
+
+  /**
+   * Get the current status of the CAN bus.
+   *
+   * @return The status of the CAN bus
+   */
+  public static CANStatus getCANStatus() {
+    CANStatus status = new CANStatus();
+    CANJNI.GetCANStatus(status);
+    return status;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java
new file mode 100644
index 0000000..9092758
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotDrive.java
@@ -0,0 +1,757 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Utility class for handling Robot drive based on a definition of the motor configuration. The
+ * robot drive class handles basic driving for a robot. Currently, 2 and 4 motor tank and mecanum
+ * drive trains are supported. In the future other drive types like swerve might be implemented.
+ * Motor channel numbers are supplied on creation of the class. Those are used for either the drive
+ * function (intended for hand created drive code, such as autonomous) or with the Tank/Arcade
+ * functions intended to be used for Operator Control driving.
+ *
+ * @deprecated Use {@link edu.wpi.first.wpilibj.drive.DifferentialDrive}
+ *             or {@link edu.wpi.first.wpilibj.drive.MecanumDrive} classes instead.
+ */
+@Deprecated
+public class RobotDrive implements MotorSafety {
+  protected MotorSafetyHelper m_safetyHelper;
+
+  /**
+   * The location of a motor on the robot for the purpose of driving.
+   */
+  public enum MotorType {
+    kFrontLeft(0), kFrontRight(1), kRearLeft(2), kRearRight(3);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    MotorType(int value) {
+      this.value = value;
+    }
+  }
+
+  public static final double kDefaultExpirationTime = 0.1;
+  public static final double kDefaultSensitivity = 0.5;
+  public static final double kDefaultMaxOutput = 1.0;
+  protected static final int kMaxNumberOfMotors = 4;
+  protected double m_sensitivity;
+  protected double m_maxOutput;
+  protected SpeedController m_frontLeftMotor;
+  protected SpeedController m_frontRightMotor;
+  protected SpeedController m_rearLeftMotor;
+  protected SpeedController m_rearRightMotor;
+  protected boolean m_allocatedSpeedControllers;
+  protected static boolean kArcadeRatioCurve_Reported = false;
+  protected static boolean kTank_Reported = false;
+  protected static boolean kArcadeStandard_Reported = false;
+  protected static boolean kMecanumCartesian_Reported = false;
+  protected static boolean kMecanumPolar_Reported = false;
+
+  /**
+   * Constructor for RobotDrive with 2 motors specified with channel numbers. Set up parameters for
+   * a two wheel drive system where the left and right motor pwm channels are specified in the call.
+   * This call assumes Talons for controlling the motors.
+   *
+   * @param leftMotorChannel  The PWM channel number that drives the left motor.
+   * @param rightMotorChannel The PWM channel number that drives the right motor.
+   */
+  public RobotDrive(final int leftMotorChannel, final int rightMotorChannel) {
+    m_sensitivity = kDefaultSensitivity;
+    m_maxOutput = kDefaultMaxOutput;
+    m_frontLeftMotor = null;
+    m_rearLeftMotor = new Talon(leftMotorChannel);
+    m_frontRightMotor = null;
+    m_rearRightMotor = new Talon(rightMotorChannel);
+    m_allocatedSpeedControllers = true;
+    setupMotorSafety();
+    drive(0, 0);
+  }
+
+  /**
+   * Constructor for RobotDrive with 4 motors specified with channel numbers. Set up parameters for
+   * a four wheel drive system where all four motor pwm channels are specified in the call. This
+   * call assumes Talons for controlling the motors.
+   *
+   * @param frontLeftMotor  Front left motor channel number
+   * @param rearLeftMotor   Rear Left motor channel number
+   * @param frontRightMotor Front right motor channel number
+   * @param rearRightMotor  Rear Right motor channel number
+   */
+  public RobotDrive(final int frontLeftMotor, final int rearLeftMotor, final int frontRightMotor,
+                    final int rearRightMotor) {
+    m_sensitivity = kDefaultSensitivity;
+    m_maxOutput = kDefaultMaxOutput;
+    m_rearLeftMotor = new Talon(rearLeftMotor);
+    m_rearRightMotor = new Talon(rearRightMotor);
+    m_frontLeftMotor = new Talon(frontLeftMotor);
+    m_frontRightMotor = new Talon(frontRightMotor);
+    m_allocatedSpeedControllers = true;
+    setupMotorSafety();
+    drive(0, 0);
+  }
+
+  /**
+   * Constructor for RobotDrive with 2 motors specified as SpeedController objects. The
+   * SpeedController version of the constructor enables programs to use the RobotDrive classes with
+   * subclasses of the SpeedController objects, for example, versions with ramping or reshaping of
+   * the curve to suit motor bias or dead-band elimination.
+   *
+   * @param leftMotor  The left SpeedController object used to drive the robot.
+   * @param rightMotor the right SpeedController object used to drive the robot.
+   */
+  public RobotDrive(SpeedController leftMotor, SpeedController rightMotor) {
+    requireNonNull(leftMotor, "Provided left motor was null");
+    requireNonNull(rightMotor, "Provided right motor was null");
+
+    m_frontLeftMotor = null;
+    m_rearLeftMotor = leftMotor;
+    m_frontRightMotor = null;
+    m_rearRightMotor = rightMotor;
+    m_sensitivity = kDefaultSensitivity;
+    m_maxOutput = kDefaultMaxOutput;
+    m_allocatedSpeedControllers = false;
+    setupMotorSafety();
+    drive(0, 0);
+  }
+
+  /**
+   * Constructor for RobotDrive with 4 motors specified as SpeedController objects. Speed controller
+   * input version of RobotDrive (see previous comments).
+   *
+   * @param frontLeftMotor  The front left SpeedController object used to drive the robot
+   * @param rearLeftMotor   The back left SpeedController object used to drive the robot.
+   * @param frontRightMotor The front right SpeedController object used to drive the robot.
+   * @param rearRightMotor  The back right SpeedController object used to drive the robot.
+   */
+  public RobotDrive(SpeedController frontLeftMotor, SpeedController rearLeftMotor,
+                    SpeedController frontRightMotor, SpeedController rearRightMotor) {
+    m_frontLeftMotor = requireNonNull(frontLeftMotor, "frontLeftMotor cannot be null");
+    m_rearLeftMotor = requireNonNull(rearLeftMotor, "rearLeftMotor cannot be null");
+    m_frontRightMotor = requireNonNull(frontRightMotor, "frontRightMotor cannot be null");
+    m_rearRightMotor = requireNonNull(rearRightMotor, "rearRightMotor cannot be null");
+    m_sensitivity = kDefaultSensitivity;
+    m_maxOutput = kDefaultMaxOutput;
+    m_allocatedSpeedControllers = false;
+    setupMotorSafety();
+    drive(0, 0);
+  }
+
+  /**
+   * Drive the motors at "outputMagnitude" and "curve". Both outputMagnitude and curve are -1.0 to
+   * +1.0 values, where 0.0 represents stopped and not turning. {@literal curve < 0 will turn left
+   * and curve > 0} will turn right.
+   *
+   * <p>The algorithm for steering provides a constant turn radius for any normal speed range, both
+   * forward and backward. Increasing sensitivity causes sharper turns for fixed values of curve.
+   *
+   * <p>This function will most likely be used in an autonomous routine.
+   *
+   * @param outputMagnitude The speed setting for the outside wheel in a turn, forward or backwards,
+   *                        +1 to -1.
+   * @param curve           The rate of turn, constant for different forward speeds. Set {@literal
+   *                        curve < 0 for left turn or curve > 0 for right turn.} Set curve =
+   *                        e^(-r/w) to get a turn radius r for wheelbase w of your robot.
+   *                        Conversely, turn radius r = -ln(curve)*w for a given value of curve and
+   *                        wheelbase w.
+   */
+  public void drive(double outputMagnitude, double curve) {
+    final double leftOutput;
+    final double rightOutput;
+
+    if (!kArcadeRatioCurve_Reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, getNumMotors(),
+          tInstances.kRobotDrive_ArcadeRatioCurve);
+      kArcadeRatioCurve_Reported = true;
+    }
+    if (curve < 0) {
+      double value = Math.log(-curve);
+      double ratio = (value - m_sensitivity) / (value + m_sensitivity);
+      if (ratio == 0) {
+        ratio = .0000000001;
+      }
+      leftOutput = outputMagnitude / ratio;
+      rightOutput = outputMagnitude;
+    } else if (curve > 0) {
+      double value = Math.log(curve);
+      double ratio = (value - m_sensitivity) / (value + m_sensitivity);
+      if (ratio == 0) {
+        ratio = .0000000001;
+      }
+      leftOutput = outputMagnitude;
+      rightOutput = outputMagnitude / ratio;
+    } else {
+      leftOutput = outputMagnitude;
+      rightOutput = outputMagnitude;
+    }
+    setLeftRightMotorOutputs(leftOutput, rightOutput);
+  }
+
+  /**
+   * Provide tank steering using the stored robot configuration. drive the robot using two joystick
+   * inputs. The Y-axis will be selected from each Joystick object. The calculated values will be
+   * squared to decrease sensitivity at low speeds.
+   *
+   * @param leftStick  The joystick to control the left side of the robot.
+   * @param rightStick The joystick to control the right side of the robot.
+   */
+  public void tankDrive(GenericHID leftStick, GenericHID rightStick) {
+    requireNonNull(leftStick, "Provided left stick was null");
+    requireNonNull(rightStick, "Provided right stick was null");
+
+    tankDrive(leftStick.getY(), rightStick.getY(), true);
+  }
+
+  /**
+   * Provide tank steering using the stored robot configuration. drive the robot using two joystick
+   * inputs. The Y-axis will be selected from each Joystick object.
+   *
+   * @param leftStick     The joystick to control the left side of the robot.
+   * @param rightStick    The joystick to control the right side of the robot.
+   * @param squaredInputs Setting this parameter to true decreases the sensitivity at lower speeds
+   */
+  public void tankDrive(GenericHID leftStick, GenericHID rightStick, boolean squaredInputs) {
+    requireNonNull(leftStick, "Provided left stick was null");
+    requireNonNull(rightStick, "Provided right stick was null");
+
+    tankDrive(leftStick.getY(), rightStick.getY(), squaredInputs);
+  }
+
+  /**
+   * Provide tank steering using the stored robot configuration. This function lets you pick the
+   * axis to be used on each Joystick object for the left and right sides of the robot. The
+   * calculated values will be squared to decrease sensitivity at low speeds.
+   *
+   * @param leftStick  The Joystick object to use for the left side of the robot.
+   * @param leftAxis   The axis to select on the left side Joystick object.
+   * @param rightStick The Joystick object to use for the right side of the robot.
+   * @param rightAxis  The axis to select on the right side Joystick object.
+   */
+  public void tankDrive(GenericHID leftStick, final int leftAxis, GenericHID rightStick,
+                        final int rightAxis) {
+    requireNonNull(leftStick, "Provided left stick was null");
+    requireNonNull(rightStick, "Provided right stick was null");
+
+    tankDrive(leftStick.getRawAxis(leftAxis), rightStick.getRawAxis(rightAxis), true);
+  }
+
+  /**
+   * Provide tank steering using the stored robot configuration. This function lets you pick the
+   * axis to be used on each Joystick object for the left and right sides of the robot.
+   *
+   * @param leftStick     The Joystick object to use for the left side of the robot.
+   * @param leftAxis      The axis to select on the left side Joystick object.
+   * @param rightStick    The Joystick object to use for the right side of the robot.
+   * @param rightAxis     The axis to select on the right side Joystick object.
+   * @param squaredInputs Setting this parameter to true decreases the sensitivity at lower speeds
+   */
+  public void tankDrive(GenericHID leftStick, final int leftAxis, GenericHID rightStick,
+                        final int rightAxis, boolean squaredInputs) {
+    requireNonNull(leftStick, "Provided left stick was null");
+    requireNonNull(rightStick, "Provided right stick was null");
+
+    tankDrive(leftStick.getRawAxis(leftAxis), rightStick.getRawAxis(rightAxis), squaredInputs);
+  }
+
+  /**
+   * Provide tank steering using the stored robot configuration. This function lets you directly
+   * provide joystick values from any source.
+   *
+   * @param leftValue     The value of the left stick.
+   * @param rightValue    The value of the right stick.
+   * @param squaredInputs Setting this parameter to true decreases the sensitivity at lower speeds
+   */
+  public void tankDrive(double leftValue, double rightValue, boolean squaredInputs) {
+
+    if (!kTank_Reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, getNumMotors(),
+          tInstances.kRobotDrive_Tank);
+      kTank_Reported = true;
+    }
+
+    leftValue = limit(leftValue);
+    rightValue = limit(rightValue);
+
+    // square the inputs (while preserving the sign) to increase fine control
+    // while permitting full power
+    if (squaredInputs) {
+      leftValue = Math.copySign(leftValue * leftValue, leftValue);
+      rightValue = Math.copySign(rightValue * rightValue, rightValue);
+    }
+    setLeftRightMotorOutputs(leftValue, rightValue);
+  }
+
+  /**
+   * Provide tank steering using the stored robot configuration. This function lets you directly
+   * provide joystick values from any source. The calculated values will be squared to decrease
+   * sensitivity at low speeds.
+   *
+   * @param leftValue  The value of the left stick.
+   * @param rightValue The value of the right stick.
+   */
+  public void tankDrive(double leftValue, double rightValue) {
+    tankDrive(leftValue, rightValue, true);
+  }
+
+  /**
+   * Arcade drive implements single stick driving. Given a single Joystick, the class assumes the Y
+   * axis for the move value and the X axis for the rotate value. (Should add more information here
+   * regarding the way that arcade drive works.)
+   *
+   * @param stick         The joystick to use for Arcade single-stick driving. The Y-axis will be
+   *                      selected for forwards/backwards and the X-axis will be selected for
+   *                      rotation rate.
+   * @param squaredInputs If true, the sensitivity will be decreased for small values
+   */
+  public void arcadeDrive(GenericHID stick, boolean squaredInputs) {
+    // simply call the full-featured arcadeDrive with the appropriate values
+    arcadeDrive(stick.getY(), stick.getX(), squaredInputs);
+  }
+
+  /**
+   * Arcade drive implements single stick driving. Given a single Joystick, the class assumes the Y
+   * axis for the move value and the X axis for the rotate value. (Should add more information here
+   * regarding the way that arcade drive works.) The calculated values will be squared to decrease
+   * sensitivity at low speeds.
+   *
+   * @param stick The joystick to use for Arcade single-stick driving. The Y-axis will be selected
+   *              for forwards/backwards and the X-axis will be selected for rotation rate.
+   */
+  public void arcadeDrive(GenericHID stick) {
+    arcadeDrive(stick, true);
+  }
+
+  /**
+   * Arcade drive implements single stick driving. Given two joystick instances and two axis,
+   * compute the values to send to either two or four motors.
+   *
+   * @param moveStick     The Joystick object that represents the forward/backward direction
+   * @param moveAxis      The axis on the moveStick object to use for forwards/backwards (typically
+   *                      Y_AXIS)
+   * @param rotateStick   The Joystick object that represents the rotation value
+   * @param rotateAxis    The axis on the rotation object to use for the rotate right/left
+   *                      (typically X_AXIS)
+   * @param squaredInputs Setting this parameter to true decreases the sensitivity at lower speeds
+   */
+  public void arcadeDrive(GenericHID moveStick, final int moveAxis, GenericHID rotateStick,
+                          final int rotateAxis, boolean squaredInputs) {
+    double moveValue = moveStick.getRawAxis(moveAxis);
+    double rotateValue = rotateStick.getRawAxis(rotateAxis);
+
+    arcadeDrive(moveValue, rotateValue, squaredInputs);
+  }
+
+  /**
+   * Arcade drive implements single stick driving. Given two joystick instances and two axis,
+   * compute the values to send to either two or four motors. The calculated values will be
+   * squared to decrease sensitivity at low speeds.
+   *
+   * @param moveStick   The Joystick object that represents the forward/backward direction
+   * @param moveAxis    The axis on the moveStick object to use for forwards/backwards (typically
+   *                    Y_AXIS)
+   * @param rotateStick The Joystick object that represents the rotation value
+   * @param rotateAxis  The axis on the rotation object to use for the rotate right/left (typically
+   *                    X_AXIS)
+   */
+  public void arcadeDrive(GenericHID moveStick, final int moveAxis, GenericHID rotateStick,
+                          final int rotateAxis) {
+    arcadeDrive(moveStick, moveAxis, rotateStick, rotateAxis, true);
+  }
+
+  /**
+   * Arcade drive implements single stick driving. This function lets you directly provide
+   * joystick values from any source.
+   *
+   * @param moveValue     The value to use for forwards/backwards
+   * @param rotateValue   The value to use for the rotate right/left
+   * @param squaredInputs If set, decreases the sensitivity at low speeds
+   */
+  public void arcadeDrive(double moveValue, double rotateValue, boolean squaredInputs) {
+    // local variables to hold the computed PWM values for the motors
+    if (!kArcadeStandard_Reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, getNumMotors(),
+          tInstances.kRobotDrive_ArcadeStandard);
+      kArcadeStandard_Reported = true;
+    }
+
+    double leftMotorSpeed;
+    double rightMotorSpeed;
+
+    moveValue = limit(moveValue);
+    rotateValue = limit(rotateValue);
+
+    // square the inputs (while preserving the sign) to increase fine control
+    // while permitting full power
+    if (squaredInputs) {
+      // square the inputs (while preserving the sign) to increase fine control
+      // while permitting full power
+      moveValue = Math.copySign(moveValue * moveValue, moveValue);
+      rotateValue = Math.copySign(rotateValue * rotateValue, rotateValue);
+    }
+
+    if (moveValue > 0.0) {
+      if (rotateValue > 0.0) {
+        leftMotorSpeed = moveValue - rotateValue;
+        rightMotorSpeed = Math.max(moveValue, rotateValue);
+      } else {
+        leftMotorSpeed = Math.max(moveValue, -rotateValue);
+        rightMotorSpeed = moveValue + rotateValue;
+      }
+    } else {
+      if (rotateValue > 0.0) {
+        leftMotorSpeed = -Math.max(-moveValue, rotateValue);
+        rightMotorSpeed = moveValue + rotateValue;
+      } else {
+        leftMotorSpeed = moveValue - rotateValue;
+        rightMotorSpeed = -Math.max(-moveValue, -rotateValue);
+      }
+    }
+
+    setLeftRightMotorOutputs(leftMotorSpeed, rightMotorSpeed);
+  }
+
+  /**
+   * Arcade drive implements single stick driving. This function lets you directly provide
+   * joystick values from any source. The calculated values will be squared to decrease
+   * sensitivity at low speeds.
+   *
+   * @param moveValue   The value to use for forwards/backwards
+   * @param rotateValue The value to use for the rotate right/left
+   */
+  public void arcadeDrive(double moveValue, double rotateValue) {
+    arcadeDrive(moveValue, rotateValue, true);
+  }
+
+  /**
+   * Drive method for Mecanum wheeled robots.
+   *
+   * <p>A method for driving with Mecanum wheeled robots. There are 4 wheels on the robot, arranged
+   * so that the front and back wheels are toed in 45 degrees. When looking at the wheels from the
+   * top, the roller axles should form an X across the robot.
+   *
+   * <p>This is designed to be directly driven by joystick axes.
+   *
+   * @param x         The speed that the robot should drive in the X direction. [-1.0..1.0]
+   * @param y         The speed that the robot should drive in the Y direction. This input is
+   *                  inverted to match the forward == -1.0 that joysticks produce. [-1.0..1.0]
+   * @param rotation  The rate of rotation for the robot that is completely independent of the
+   *                  translation. [-1.0..1.0]
+   * @param gyroAngle The current angle reading from the gyro. Use this to implement field-oriented
+   *                  controls.
+   */
+  @SuppressWarnings("ParameterName")
+  public void mecanumDrive_Cartesian(double x, double y, double rotation, double gyroAngle) {
+    if (!kMecanumCartesian_Reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, getNumMotors(),
+          tInstances.kRobotDrive_MecanumCartesian);
+      kMecanumCartesian_Reported = true;
+    }
+    @SuppressWarnings("LocalVariableName")
+    double xIn = x;
+    @SuppressWarnings("LocalVariableName")
+    double yIn = y;
+    // Negate y for the joystick.
+    yIn = -yIn;
+    // Compensate for gyro angle.
+    double[] rotated = rotateVector(xIn, yIn, gyroAngle);
+    xIn = rotated[0];
+    yIn = rotated[1];
+
+    double[] wheelSpeeds = new double[kMaxNumberOfMotors];
+    wheelSpeeds[MotorType.kFrontLeft.value] = xIn + yIn + rotation;
+    wheelSpeeds[MotorType.kFrontRight.value] = -xIn + yIn - rotation;
+    wheelSpeeds[MotorType.kRearLeft.value] = -xIn + yIn + rotation;
+    wheelSpeeds[MotorType.kRearRight.value] = xIn + yIn - rotation;
+
+    normalize(wheelSpeeds);
+    m_frontLeftMotor.set(wheelSpeeds[MotorType.kFrontLeft.value] * m_maxOutput);
+    m_frontRightMotor.set(wheelSpeeds[MotorType.kFrontRight.value] * m_maxOutput);
+    m_rearLeftMotor.set(wheelSpeeds[MotorType.kRearLeft.value] * m_maxOutput);
+    m_rearRightMotor.set(wheelSpeeds[MotorType.kRearRight.value] * m_maxOutput);
+
+    if (m_safetyHelper != null) {
+      m_safetyHelper.feed();
+    }
+  }
+
+  /**
+   * Drive method for Mecanum wheeled robots.
+   *
+   * <p>A method for driving with Mecanum wheeled robots. There are 4 wheels on the robot, arranged
+   * so that the front and back wheels are toed in 45 degrees. When looking at the wheels from the
+   * top, the roller axles should form an X across the robot.
+   *
+   * @param magnitude The speed that the robot should drive in a given direction. [-1.0..1.0]
+   * @param direction The angle the robot should drive in degrees. The direction and magnitude
+   *                  are independent of the rotation rate. [-180.0..180.0]
+   * @param rotation  The rate of rotation for the robot that is completely independent of the
+   *                  magnitude or direction. [-1.0..1.0]
+   */
+  public void mecanumDrive_Polar(double magnitude, double direction, double rotation) {
+    if (!kMecanumPolar_Reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, getNumMotors(),
+          tInstances.kRobotDrive_MecanumPolar);
+      kMecanumPolar_Reported = true;
+    }
+    // Normalized for full power along the Cartesian axes.
+    magnitude = limit(magnitude) * Math.sqrt(2.0);
+    // The rollers are at 45 degree angles.
+    double dirInRad = (direction + 45.0) * Math.PI / 180.0;
+    double cosD = Math.cos(dirInRad);
+    double sinD = Math.sin(dirInRad);
+
+    double[] wheelSpeeds = new double[kMaxNumberOfMotors];
+    wheelSpeeds[MotorType.kFrontLeft.value] = sinD * magnitude + rotation;
+    wheelSpeeds[MotorType.kFrontRight.value] = cosD * magnitude - rotation;
+    wheelSpeeds[MotorType.kRearLeft.value] = cosD * magnitude + rotation;
+    wheelSpeeds[MotorType.kRearRight.value] = sinD * magnitude - rotation;
+
+    normalize(wheelSpeeds);
+
+    m_frontLeftMotor.set(wheelSpeeds[MotorType.kFrontLeft.value] * m_maxOutput);
+    m_frontRightMotor.set(wheelSpeeds[MotorType.kFrontRight.value] * m_maxOutput);
+    m_rearLeftMotor.set(wheelSpeeds[MotorType.kRearLeft.value] * m_maxOutput);
+    m_rearRightMotor.set(wheelSpeeds[MotorType.kRearRight.value] * m_maxOutput);
+
+    if (m_safetyHelper != null) {
+      m_safetyHelper.feed();
+    }
+  }
+
+  /**
+   * Holonomic Drive method for Mecanum wheeled robots.
+   *
+   * <p>This is an alias to mecanumDrive_Polar() for backward compatibility
+   *
+   * @param magnitude The speed that the robot should drive in a given direction. [-1.0..1.0]
+   * @param direction The direction the robot should drive. The direction and maginitude are
+   *                  independent of the rotation rate.
+   * @param rotation  The rate of rotation for the robot that is completely independent of the
+   *                  magnitute or direction. [-1.0..1.0]
+   */
+  void holonomicDrive(double magnitude, double direction, double rotation) {
+    mecanumDrive_Polar(magnitude, direction, rotation);
+  }
+
+  /**
+   * Set the speed of the right and left motors. This is used once an appropriate drive setup
+   * function is called such as twoWheelDrive(). The motors are set to "leftSpeed" and
+   * "rightSpeed" and includes flipping the direction of one side for opposing motors.
+   *
+   * @param leftOutput  The speed to send to the left side of the robot.
+   * @param rightOutput The speed to send to the right side of the robot.
+   */
+  public void setLeftRightMotorOutputs(double leftOutput, double rightOutput) {
+    requireNonNull(m_rearLeftMotor, "Provided left motor was null");
+    requireNonNull(m_rearRightMotor, "Provided right motor was null");
+
+    if (m_frontLeftMotor != null) {
+      m_frontLeftMotor.set(limit(leftOutput) * m_maxOutput);
+    }
+    m_rearLeftMotor.set(limit(leftOutput) * m_maxOutput);
+
+    if (m_frontRightMotor != null) {
+      m_frontRightMotor.set(-limit(rightOutput) * m_maxOutput);
+    }
+    m_rearRightMotor.set(-limit(rightOutput) * m_maxOutput);
+
+    if (m_safetyHelper != null) {
+      m_safetyHelper.feed();
+    }
+  }
+
+  /**
+   * Limit motor values to the -1.0 to +1.0 range.
+   */
+  protected static double limit(double number) {
+    if (number > 1.0) {
+      return 1.0;
+    }
+    if (number < -1.0) {
+      return -1.0;
+    }
+    return number;
+  }
+
+  /**
+   * Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.
+   */
+  protected static void normalize(double[] wheelSpeeds) {
+    double maxMagnitude = Math.abs(wheelSpeeds[0]);
+    for (int i = 1; i < kMaxNumberOfMotors; i++) {
+      double temp = Math.abs(wheelSpeeds[i]);
+      if (maxMagnitude < temp) {
+        maxMagnitude = temp;
+      }
+    }
+    if (maxMagnitude > 1.0) {
+      for (int i = 0; i < kMaxNumberOfMotors; i++) {
+        wheelSpeeds[i] = wheelSpeeds[i] / maxMagnitude;
+      }
+    }
+  }
+
+  /**
+   * Rotate a vector in Cartesian space.
+   */
+  @SuppressWarnings("ParameterName")
+  protected static double[] rotateVector(double x, double y, double angle) {
+    double cosA = Math.cos(angle * (Math.PI / 180.0));
+    double sinA = Math.sin(angle * (Math.PI / 180.0));
+    double[] out = new double[2];
+    out[0] = x * cosA - y * sinA;
+    out[1] = x * sinA + y * cosA;
+    return out;
+  }
+
+  /**
+   * Invert a motor direction. This is used when a motor should run in the opposite direction as the
+   * drive code would normally run it. Motors that are direct drive would be inverted, the drive
+   * code assumes that the motors are geared with one reversal.
+   *
+   * @param motor      The motor index to invert.
+   * @param isInverted True if the motor should be inverted when operated.
+   */
+  public void setInvertedMotor(MotorType motor, boolean isInverted) {
+    switch (motor) {
+      case kFrontLeft:
+        m_frontLeftMotor.setInverted(isInverted);
+        break;
+      case kFrontRight:
+        m_frontRightMotor.setInverted(isInverted);
+        break;
+      case kRearLeft:
+        m_rearLeftMotor.setInverted(isInverted);
+        break;
+      case kRearRight:
+        m_rearRightMotor.setInverted(isInverted);
+        break;
+      default:
+        throw new IllegalArgumentException("Illegal motor type: " + motor);
+    }
+  }
+
+  /**
+   * Set the turning sensitivity.
+   *
+   * <p>This only impacts the drive() entry-point.
+   *
+   * @param sensitivity Effectively sets the turning sensitivity (or turn radius for a given value)
+   */
+  public void setSensitivity(double sensitivity) {
+    m_sensitivity = sensitivity;
+  }
+
+  /**
+   * Configure the scaling factor for using RobotDrive with motor controllers in a mode other than
+   * PercentVbus.
+   *
+   * @param maxOutput Multiplied with the output percentage computed by the drive functions.
+   */
+  public void setMaxOutput(double maxOutput) {
+    m_maxOutput = maxOutput;
+  }
+
+  /**
+   * Free the speed controllers if they were allocated locally.
+   */
+  public void free() {
+    if (m_allocatedSpeedControllers) {
+      if (m_frontLeftMotor != null) {
+        ((PWM) m_frontLeftMotor).free();
+      }
+      if (m_frontRightMotor != null) {
+        ((PWM) m_frontRightMotor).free();
+      }
+      if (m_rearLeftMotor != null) {
+        ((PWM) m_rearLeftMotor).free();
+      }
+      if (m_rearRightMotor != null) {
+        ((PWM) m_rearRightMotor).free();
+      }
+    }
+  }
+
+  @Override
+  public void setExpiration(double timeout) {
+    m_safetyHelper.setExpiration(timeout);
+  }
+
+  @Override
+  public double getExpiration() {
+    return m_safetyHelper.getExpiration();
+  }
+
+  @Override
+  public boolean isAlive() {
+    return m_safetyHelper.isAlive();
+  }
+
+  @Override
+  public boolean isSafetyEnabled() {
+    return m_safetyHelper.isSafetyEnabled();
+  }
+
+  @Override
+  public void setSafetyEnabled(boolean enabled) {
+    m_safetyHelper.setSafetyEnabled(enabled);
+  }
+
+  @Override
+  public String getDescription() {
+    return "Robot Drive";
+  }
+
+  @Override
+  public void stopMotor() {
+    if (m_frontLeftMotor != null) {
+      m_frontLeftMotor.stopMotor();
+    }
+    if (m_frontRightMotor != null) {
+      m_frontRightMotor.stopMotor();
+    }
+    if (m_rearLeftMotor != null) {
+      m_rearLeftMotor.stopMotor();
+    }
+    if (m_rearRightMotor != null) {
+      m_rearRightMotor.stopMotor();
+    }
+    if (m_safetyHelper != null) {
+      m_safetyHelper.feed();
+    }
+  }
+
+  private void setupMotorSafety() {
+    m_safetyHelper = new MotorSafetyHelper(this);
+    m_safetyHelper.setExpiration(kDefaultExpirationTime);
+    m_safetyHelper.setSafetyEnabled(true);
+  }
+
+  protected int getNumMotors() {
+    int motors = 0;
+    if (m_frontLeftMotor != null) {
+      motors++;
+    }
+    if (m_frontRightMotor != null) {
+      motors++;
+    }
+    if (m_rearLeftMotor != null) {
+      motors++;
+    }
+    if (m_rearRightMotor != null) {
+      motors++;
+    }
+    return motors;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java
new file mode 100644
index 0000000..98d847f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/RobotState.java
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;
+
+@SuppressWarnings("JavadocMethod")
+public class RobotState {
+  private static Interface m_impl;
+
+  @SuppressWarnings("MethodName")
+  public static void SetImplementation(Interface implementation) {
+    m_impl = implementation;
+  }
+
+  public static boolean isDisabled() {
+    if (m_impl != null) {
+      return m_impl.isDisabled();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, RobotState.class);
+    }
+  }
+
+  public static boolean isEnabled() {
+    if (m_impl != null) {
+      return m_impl.isEnabled();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, RobotState.class);
+    }
+  }
+
+  public static boolean isOperatorControl() {
+    if (m_impl != null) {
+      return m_impl.isOperatorControl();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, RobotState.class);
+    }
+  }
+
+  public static boolean isAutonomous() {
+    if (m_impl != null) {
+      return m_impl.isAutonomous();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, RobotState.class);
+    }
+  }
+
+  public static boolean isTest() {
+    if (m_impl != null) {
+      return m_impl.isTest();
+    } else {
+      throw new BaseSystemNotInitializedException(Interface.class, RobotState.class);
+    }
+  }
+
+  interface Interface {
+    boolean isDisabled();
+
+    boolean isEnabled();
+
+    boolean isOperatorControl();
+
+    boolean isAutonomous();
+
+    boolean isTest();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SD540.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SD540.java
new file mode 100644
index 0000000..0da8839
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SD540.java
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Mindsensors SD540 Speed Controller.
+ */
+public class SD540 extends PWMSpeedController {
+  /**
+   * Common initialization code called by all constructors.
+   *
+   * <p>Note that the SD540 uses the following bounds for PWM values. These values should work
+   * reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the SD540 User Manual
+   * available from Mindsensors.
+   *
+   * <p>- 2.05ms = full "forward" - 1.55ms = the "high end" of the deadband range - 1.50ms = center
+   * of the deadband range (off) - 1.44ms = the "low end" of the deadband range - .94ms = full
+   * "reverse"
+   */
+  protected void initSD540() {
+    setBounds(2.05, 1.55, 1.50, 1.44, .94);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_MindsensorsSD540, getChannel());
+    setName("SD540", getChannel());
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param channel The PWM channel that the SD540 is attached to. 0-9 are on-board, 10-19 are on
+   *                the MXP port
+   */
+  public SD540(final int channel) {
+    super(channel);
+    initSD540();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java
new file mode 100644
index 0000000..e80c4d2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SPI.java
@@ -0,0 +1,680 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.nio.ByteBuffer;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.SPIJNI;
+
+/**
+ * Represents a SPI bus port.
+ */
+public class SPI {
+  public enum Port {
+    kOnboardCS0(0), kOnboardCS1(1), kOnboardCS2(2), kOnboardCS3(3), kMXP(4);
+
+    @SuppressWarnings("MemberName")
+    public int value;
+
+    Port(int value) {
+      this.value = value;
+    }
+  }
+
+  private static int devices = 0;
+
+  private int m_port;
+  private int m_bitOrder;
+  private int m_clockPolarity;
+  private int m_dataOnTrailing;
+
+  /**
+   * Constructor.
+   *
+   * @param port the physical SPI port
+   */
+  public SPI(Port port) {
+    m_port = (byte) port.value;
+    devices++;
+
+    SPIJNI.spiInitialize(m_port);
+
+    HAL.report(tResourceType.kResourceType_SPI, devices);
+  }
+
+  /**
+   * Free the resources used by this object.
+   */
+  public void free() {
+    if (m_accum != null) {
+      m_accum.free();
+      m_accum = null;
+    }
+    SPIJNI.spiClose(m_port);
+  }
+
+  /**
+   * Configure the rate of the generated clock signal. The default value is 500,000 Hz. The maximum
+   * value is 4,000,000 Hz.
+   *
+   * @param hz The clock rate in Hertz.
+   */
+  public final void setClockRate(int hz) {
+    SPIJNI.spiSetSpeed(m_port, hz);
+  }
+
+  /**
+   * Configure the order that bits are sent and received on the wire to be most significant bit
+   * first.
+   */
+  public final void setMSBFirst() {
+    m_bitOrder = 1;
+    SPIJNI.spiSetOpts(m_port, m_bitOrder, m_dataOnTrailing, m_clockPolarity);
+  }
+
+  /**
+   * Configure the order that bits are sent and received on the wire to be least significant bit
+   * first.
+   */
+  public final void setLSBFirst() {
+    m_bitOrder = 0;
+    SPIJNI.spiSetOpts(m_port, m_bitOrder, m_dataOnTrailing, m_clockPolarity);
+  }
+
+  /**
+   * Configure the clock output line to be active low. This is sometimes called clock polarity high
+   * or clock idle high.
+   */
+  public final void setClockActiveLow() {
+    m_clockPolarity = 1;
+    SPIJNI.spiSetOpts(m_port, m_bitOrder, m_dataOnTrailing, m_clockPolarity);
+  }
+
+  /**
+   * Configure the clock output line to be active high. This is sometimes called clock polarity low
+   * or clock idle low.
+   */
+  public final void setClockActiveHigh() {
+    m_clockPolarity = 0;
+    SPIJNI.spiSetOpts(m_port, m_bitOrder, m_dataOnTrailing, m_clockPolarity);
+  }
+
+  /**
+   * Configure that the data is stable on the falling edge and the data changes on the rising edge.
+   */
+  public final void setSampleDataOnFalling() {
+    m_dataOnTrailing = 1;
+    SPIJNI.spiSetOpts(m_port, m_bitOrder, m_dataOnTrailing, m_clockPolarity);
+  }
+
+  /**
+   * Configure that the data is stable on the rising edge and the data changes on the falling edge.
+   */
+  public final void setSampleDataOnRising() {
+    m_dataOnTrailing = 0;
+    SPIJNI.spiSetOpts(m_port, m_bitOrder, m_dataOnTrailing, m_clockPolarity);
+  }
+
+  /**
+   * Configure the chip select line to be active high.
+   */
+  public final void setChipSelectActiveHigh() {
+    SPIJNI.spiSetChipSelectActiveHigh(m_port);
+  }
+
+  /**
+   * Configure the chip select line to be active low.
+   */
+  public final void setChipSelectActiveLow() {
+    SPIJNI.spiSetChipSelectActiveLow(m_port);
+  }
+
+  /**
+   * Write data to the slave device. Blocks until there is space in the output FIFO.
+   *
+   * <p>If not running in output only mode, also saves the data received on the MISO input during
+   * the transfer into the receive FIFO.
+   */
+  public int write(byte[] dataToSend, int size) {
+    if (dataToSend.length < size) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + size);
+    }
+    return SPIJNI.spiWriteB(m_port, dataToSend, (byte) size);
+  }
+
+  /**
+   * Write data to the slave device. Blocks until there is space in the output FIFO.
+   *
+   * <p>If not running in output only mode, also saves the data received on the MISO input during
+   * the transfer into the receive FIFO.
+   *
+   * @param dataToSend The buffer containing the data to send.
+   */
+  public int write(ByteBuffer dataToSend, int size) {
+    if (dataToSend.hasArray()) {
+      return write(dataToSend.array(), size);
+    }
+    if (!dataToSend.isDirect()) {
+      throw new IllegalArgumentException("must be a direct buffer");
+    }
+    if (dataToSend.capacity() < size) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + size);
+    }
+    return SPIJNI.spiWrite(m_port, dataToSend, (byte) size);
+  }
+
+  /**
+   * Read a word from the receive FIFO.
+   *
+   * <p>Waits for the current transfer to complete if the receive FIFO is empty.
+   *
+   * <p>If the receive FIFO is empty, there is no active transfer, and initiate is false, errors.
+   *
+   * @param initiate If true, this function pushes "0" into the transmit buffer and initiates a
+   *                 transfer. If false, this function assumes that data is already in the receive
+   *                 FIFO from a previous write.
+   */
+  public int read(boolean initiate, byte[] dataReceived, int size) {
+    if (dataReceived.length < size) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + size);
+    }
+    return SPIJNI.spiReadB(m_port, initiate, dataReceived, (byte) size);
+  }
+
+  /**
+   * Read a word from the receive FIFO.
+   *
+   * <p>Waits for the current transfer to complete if the receive FIFO is empty.
+   *
+   * <p>If the receive FIFO is empty, there is no active transfer, and initiate is false, errors.
+   *
+   * @param initiate     If true, this function pushes "0" into the transmit buffer and initiates
+   *                     a transfer. If false, this function assumes that data is already in the
+   *                     receive FIFO from a previous write.
+   * @param dataReceived The buffer to be filled with the received data.
+   * @param size         The length of the transaction, in bytes
+   */
+  public int read(boolean initiate, ByteBuffer dataReceived, int size) {
+    if (dataReceived.hasArray()) {
+      return read(initiate, dataReceived.array(), size);
+    }
+    if (!dataReceived.isDirect()) {
+      throw new IllegalArgumentException("must be a direct buffer");
+    }
+    if (dataReceived.capacity() < size) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + size);
+    }
+    return SPIJNI.spiRead(m_port, initiate, dataReceived, (byte) size);
+  }
+
+  /**
+   * Perform a simultaneous read/write transaction with the device.
+   *
+   * @param dataToSend   The data to be written out to the device
+   * @param dataReceived Buffer to receive data from the device
+   * @param size         The length of the transaction, in bytes
+   */
+  public int transaction(byte[] dataToSend, byte[] dataReceived, int size) {
+    if (dataToSend.length < size) {
+      throw new IllegalArgumentException("dataToSend is too small, must be at least " + size);
+    }
+    if (dataReceived.length < size) {
+      throw new IllegalArgumentException("dataReceived is too small, must be at least " + size);
+    }
+    return SPIJNI.spiTransactionB(m_port, dataToSend, dataReceived, (byte) size);
+  }
+
+  /**
+   * Perform a simultaneous read/write transaction with the device.
+   *
+   * @param dataToSend   The data to be written out to the device.
+   * @param dataReceived Buffer to receive data from the device.
+   * @param size         The length of the transaction, in bytes
+   */
+  public int transaction(ByteBuffer dataToSend, ByteBuffer dataReceived, int size) {
+    if (dataToSend.hasArray() && dataReceived.hasArray()) {
+      return transaction(dataToSend.array(), dataReceived.array(), size);
+    }
+    if (!dataToSend.isDirect()) {
+      throw new IllegalArgumentException("dataToSend must be a direct buffer");
+    }
+    if (dataToSend.capacity() < size) {
+      throw new IllegalArgumentException("dataToSend is too small, must be at least " + size);
+    }
+    if (!dataReceived.isDirect()) {
+      throw new IllegalArgumentException("dataReceived must be a direct buffer");
+    }
+    if (dataReceived.capacity() < size) {
+      throw new IllegalArgumentException("dataReceived is too small, must be at least " + size);
+    }
+    return SPIJNI.spiTransaction(m_port, dataToSend, dataReceived, (byte) size);
+  }
+
+  /**
+   * Initialize automatic SPI transfer engine.
+   *
+   * <p>Only a single engine is available, and use of it blocks use of all other
+   * chip select usage on the same physical SPI port while it is running.
+   *
+   * @param bufferSize buffer size in bytes
+   */
+  public void initAuto(int bufferSize) {
+    SPIJNI.spiInitAuto(m_port, bufferSize);
+  }
+
+  /**
+   * Frees the automatic SPI transfer engine.
+   */
+  public void freeAuto() {
+    SPIJNI.spiFreeAuto(m_port);
+  }
+
+  /**
+   * Set the data to be transmitted by the engine.
+   *
+   * <p>Up to 16 bytes are configurable, and may be followed by up to 127 zero
+   * bytes.
+   *
+   * @param dataToSend data to send (maximum 16 bytes)
+   * @param zeroSize number of zeros to send after the data
+   */
+  public void setAutoTransmitData(byte[] dataToSend, int zeroSize) {
+    SPIJNI.spiSetAutoTransmitData(m_port, dataToSend, zeroSize);
+  }
+
+  /**
+   * Start running the automatic SPI transfer engine at a periodic rate.
+   *
+   * <p>{@link #initAuto(int)} and {@link #setAutoTransmitData(byte[], int)} must
+   * be called before calling this function.
+   *
+   * @param period period between transfers, in seconds (us resolution)
+   */
+  public void startAutoRate(double period) {
+    SPIJNI.spiStartAutoRate(m_port, period);
+  }
+
+  /**
+   * Start running the automatic SPI transfer engine when a trigger occurs.
+   *
+   * <p>{@link #initAuto(int)} and {@link #setAutoTransmitData(byte[], int)} must
+   * be called before calling this function.
+   *
+   * @param source digital source for the trigger (may be an analog trigger)
+   * @param rising trigger on the rising edge
+   * @param falling trigger on the falling edge
+   */
+  public void startAutoTrigger(DigitalSource source, boolean rising, boolean falling) {
+    SPIJNI.spiStartAutoTrigger(m_port, source.getPortHandleForRouting(),
+                               source.getAnalogTriggerTypeForRouting(), rising, falling);
+  }
+
+  /**
+   * Stop running the automatic SPI transfer engine.
+   */
+  public void stopAuto() {
+    SPIJNI.spiStopAuto(m_port);
+  }
+
+  /**
+   * Force the engine to make a single transfer.
+   */
+  public void forceAutoRead() {
+    SPIJNI.spiForceAutoRead(m_port);
+  }
+
+  /**
+   * Read data that has been transferred by the automatic SPI transfer engine.
+   *
+   * <p>Transfers may be made a byte at a time, so it's necessary for the caller
+   * to handle cases where an entire transfer has not been completed.
+   *
+   * <p>Blocks until numToRead bytes have been read or timeout expires.
+   * May be called with numToRead=0 to retrieve how many bytes are available.
+   *
+   * @param buffer buffer where read bytes are stored
+   * @param numToRead number of bytes to read
+   * @param timeout timeout in seconds (ms resolution)
+   * @return Number of bytes remaining to be read
+   */
+  public int readAutoReceivedData(ByteBuffer buffer, int numToRead, double timeout) {
+    if (buffer.hasArray()) {
+      return readAutoReceivedData(buffer.array(), numToRead, timeout);
+    }
+    if (!buffer.isDirect()) {
+      throw new IllegalArgumentException("must be a direct buffer");
+    }
+    if (buffer.capacity() < numToRead) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + numToRead);
+    }
+    return SPIJNI.spiReadAutoReceivedData(m_port, buffer, numToRead, timeout);
+  }
+
+  /**
+   * Read data that has been transferred by the automatic SPI transfer engine.
+   *
+   * <p>Transfers may be made a byte at a time, so it's necessary for the caller
+   * to handle cases where an entire transfer has not been completed.
+   *
+   * <p>Blocks until numToRead bytes have been read or timeout expires.
+   * May be called with numToRead=0 to retrieve how many bytes are available.
+   *
+   * @param buffer array where read bytes are stored
+   * @param numToRead number of bytes to read
+   * @param timeout timeout in seconds (ms resolution)
+   * @return Number of bytes remaining to be read
+   */
+  public int readAutoReceivedData(byte[] buffer, int numToRead, double timeout) {
+    if (buffer.length < numToRead) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + numToRead);
+    }
+    return SPIJNI.spiReadAutoReceivedData(m_port, buffer, numToRead, timeout);
+  }
+
+  /**
+   * Get the number of bytes dropped by the automatic SPI transfer engine due
+   * to the receive buffer being full.
+   *
+   * @return Number of bytes dropped
+   */
+  public int getAutoDroppedCount() {
+    return SPIJNI.spiGetAutoDroppedCount(m_port);
+  }
+
+  private static final int kAccumulateDepth = 2048;
+
+  private static class Accumulator {
+    Accumulator(int port, int xferSize, int validMask, int validValue, int dataShift,
+                int dataSize, boolean isSigned, boolean bigEndian) {
+      m_notifier = new Notifier(this::update);
+      m_buf = ByteBuffer.allocateDirect(xferSize * kAccumulateDepth);
+      m_xferSize = xferSize;
+      m_validMask = validMask;
+      m_validValue = validValue;
+      m_dataShift = dataShift;
+      m_dataMax = 1 << dataSize;
+      m_dataMsbMask = 1 << (dataSize - 1);
+      m_isSigned = isSigned;
+      m_bigEndian = bigEndian;
+      m_port = port;
+    }
+
+    void free() {
+      m_notifier.stop();
+    }
+
+    final Notifier m_notifier;
+    final ByteBuffer m_buf;
+    final Object m_mutex = new Object();
+
+    long m_value;
+    int m_count;
+    int m_lastValue;
+
+    int m_center;
+    int m_deadband;
+
+    final int m_validMask;
+    final int m_validValue;
+    final int m_dataMax;        // one more than max data value
+    final int m_dataMsbMask;    // data field MSB mask (for signed)
+    final int m_dataShift;      // data field shift right amount, in bits
+    final int m_xferSize;       // SPI transfer size, in bytes
+    final boolean m_isSigned;   // is data field signed?
+    final boolean m_bigEndian;  // is response big endian?
+    final int m_port;
+
+    void update() {
+      synchronized (m_mutex) {
+        boolean done = false;
+        while (!done) {
+          done = true;
+
+          // get amount of data available
+          int numToRead = SPIJNI.spiReadAutoReceivedData(m_port, m_buf, 0, 0);
+
+          // only get whole responses
+          numToRead -= numToRead % m_xferSize;
+          if (numToRead > m_xferSize * kAccumulateDepth) {
+            numToRead = m_xferSize * kAccumulateDepth;
+            done = false;
+          }
+          if (numToRead == 0) {
+            return;  // no samples
+          }
+
+          // read buffered data
+          SPIJNI.spiReadAutoReceivedData(m_port, m_buf, numToRead, 0);
+
+          // loop over all responses
+          for (int off = 0; off < numToRead; off += m_xferSize) {
+            // convert from bytes
+            int resp = 0;
+            if (m_bigEndian) {
+              for (int i = 0; i < m_xferSize; ++i) {
+                resp <<= 8;
+                resp |= ((int) m_buf.get(off + i)) & 0xff;
+              }
+            } else {
+              for (int i = m_xferSize - 1; i >= 0; --i) {
+                resp <<= 8;
+                resp |= ((int) m_buf.get(off + i)) & 0xff;
+              }
+            }
+
+            // process response
+            if ((resp & m_validMask) == m_validValue) {
+              // valid sensor data; extract data field
+              int data = resp >> m_dataShift;
+              data &= m_dataMax - 1;
+              // 2s complement conversion if signed MSB is set
+              if (m_isSigned && (data & m_dataMsbMask) != 0) {
+                data -= m_dataMax;
+              }
+              // center offset
+              data -= m_center;
+              // only accumulate if outside deadband
+              if (data < -m_deadband || data > m_deadband) {
+                m_value += data;
+              }
+              ++m_count;
+              m_lastValue = data;
+            } else {
+              // no data from the sensor; just clear the last value
+              m_lastValue = 0;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  private Accumulator m_accum = null;
+
+  /**
+   * Initialize the accumulator.
+   *
+   * @param period     Time between reads
+   * @param cmd        SPI command to send to request data
+   * @param xferSize   SPI transfer size, in bytes
+   * @param validMask  Mask to apply to received data for validity checking
+   * @param validValue After validMask is applied, required matching value for validity checking
+   * @param dataShift  Bit shift to apply to received data to get actual data value
+   * @param dataSize   Size (in bits) of data field
+   * @param isSigned   Is data field signed?
+   * @param bigEndian  Is device big endian?
+   */
+  public void initAccumulator(double period, int cmd, int xferSize,
+                              int validMask, int validValue,
+                              int dataShift, int dataSize,
+                              boolean isSigned, boolean bigEndian) {
+    initAuto(xferSize * 2048);
+    byte[] cmdBytes = new byte[] {0, 0, 0, 0};
+    if (bigEndian) {
+      for (int i = xferSize - 1; i >= 0; --i) {
+        cmdBytes[i] = (byte) (cmd & 0xff);
+        cmd >>= 8;
+      }
+    } else {
+      cmdBytes[0] = (byte) (cmd & 0xff);
+      cmd >>= 8;
+      cmdBytes[1] = (byte) (cmd & 0xff);
+      cmd >>= 8;
+      cmdBytes[2] = (byte) (cmd & 0xff);
+      cmd >>= 8;
+      cmdBytes[3] = (byte) (cmd & 0xff);
+    }
+    setAutoTransmitData(cmdBytes, xferSize - 4);
+    startAutoRate(period);
+
+    m_accum = new Accumulator(m_port, xferSize, validMask, validValue, dataShift, dataSize,
+                              isSigned, bigEndian);
+    m_accum.m_notifier.startPeriodic(period * 1024);
+  }
+
+  /**
+   * Frees the accumulator.
+   */
+  public void freeAccumulator() {
+    if (m_accum != null) {
+      m_accum.free();
+      m_accum = null;
+    }
+    freeAuto();
+  }
+
+  /**
+   * Resets the accumulator to zero.
+   */
+  public void resetAccumulator() {
+    if (m_accum == null) {
+      return;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.m_value = 0;
+      m_accum.m_count = 0;
+      m_accum.m_lastValue = 0;
+    }
+  }
+
+  /**
+   * Set the center value of the accumulator.
+   *
+   * <p>The center value is subtracted from each value before it is added to the accumulator. This
+   * is used for the center value of devices like gyros and accelerometers to make integration work
+   * and to take the device offset into account when integrating.
+   */
+  public void setAccumulatorCenter(int center) {
+    if (m_accum == null) {
+      return;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.m_center = center;
+    }
+  }
+
+  /**
+   * Set the accumulator's deadband.
+   */
+  public void setAccumulatorDeadband(int deadband) {
+    if (m_accum == null) {
+      return;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.m_deadband = deadband;
+    }
+  }
+
+  /**
+   * Read the last value read by the accumulator engine.
+   */
+  public int getAccumulatorLastValue() {
+    if (m_accum == null) {
+      return 0;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.update();
+      return m_accum.m_lastValue;
+    }
+  }
+
+  /**
+   * Read the accumulated value.
+   *
+   * @return The 64-bit value accumulated since the last Reset().
+   */
+  public long getAccumulatorValue() {
+    if (m_accum == null) {
+      return 0;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.update();
+      return m_accum.m_value;
+    }
+  }
+
+  /**
+   * Read the number of accumulated values.
+   *
+   * <p>Read the count of the accumulated values since the accumulator was last Reset().
+   *
+   * @return The number of times samples from the channel were accumulated.
+   */
+  public int getAccumulatorCount() {
+    if (m_accum == null) {
+      return 0;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.update();
+      return m_accum.m_count;
+    }
+  }
+
+  /**
+   * Read the average of the accumulated value.
+   *
+   * @return The accumulated average value (value / count).
+   */
+  public double getAccumulatorAverage() {
+    if (m_accum == null) {
+      return 0;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.update();
+      if (m_accum.m_count == 0) {
+        return 0.0;
+      }
+      return ((double) m_accum.m_value) / m_accum.m_count;
+    }
+  }
+
+  /**
+   * Read the accumulated value and the number of accumulated values atomically.
+   *
+   * <p>This function reads the value and count atomically. This can be used for averaging.
+   *
+   * @param result AccumulatorResult object to store the results in.
+   */
+  public void getAccumulatorOutput(AccumulatorResult result) {
+    if (result == null) {
+      throw new IllegalArgumentException("Null parameter `result'");
+    }
+    if (m_accum == null) {
+      result.value = 0;
+      result.count = 0;
+      return;
+    }
+    synchronized (m_accum.m_mutex) {
+      m_accum.update();
+      result.value = m_accum.m_value;
+      result.count = m_accum.m_count;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SafePWM.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SafePWM.java
new file mode 100644
index 0000000..f48ddb1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SafePWM.java
@@ -0,0 +1,105 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Manages a PWM object.
+ */
+public class SafePWM extends PWM implements MotorSafety {
+  private final MotorSafetyHelper m_safetyHelper;
+
+  /**
+   * Constructor for a SafePWM object taking a channel number.
+   *
+   * @param channel The channel number to be used for the underlying PWM object. 0-9 are on-board,
+   *                10-19 are on the MXP port.
+   */
+  public SafePWM(final int channel) {
+    super(channel);
+
+    m_safetyHelper = new MotorSafetyHelper(this);
+    m_safetyHelper.setExpiration(0.0);
+    m_safetyHelper.setSafetyEnabled(false);
+  }
+
+  /**
+   * Set the expiration time for the PWM object.
+   *
+   * @param timeout The timeout (in seconds) for this motor object
+   */
+  public void setExpiration(double timeout) {
+    m_safetyHelper.setExpiration(timeout);
+  }
+
+  /**
+   * Return the expiration time for the PWM object.
+   *
+   * @return The expiration time value.
+   */
+  public double getExpiration() {
+    return m_safetyHelper.getExpiration();
+  }
+
+  /**
+   * Check if the PWM object is currently alive or stopped due to a timeout.
+   *
+   * @return a bool value that is true if the motor has NOT timed out and should still be running.
+   */
+  public boolean isAlive() {
+    return m_safetyHelper.isAlive();
+  }
+
+  /**
+   * Stop the motor associated with this PWM object. This is called by the MotorSafetyHelper object
+   * when it has a timeout for this PWM and needs to stop it from running.
+   */
+  public void stopMotor() {
+    disable();
+  }
+
+  /**
+   * Check if motor safety is enabled for this object.
+   *
+   * @return True if motor safety is enforced for this object
+   */
+  public boolean isSafetyEnabled() {
+    return m_safetyHelper.isSafetyEnabled();
+  }
+
+  /**
+   * Feed the MotorSafety timer. This method is called by the subclass motor whenever it updates its
+   * speed, thereby resetting the timeout value.
+   *
+   * @deprecated Use {@link #feed()} instead.
+   */
+  @Deprecated
+  @SuppressWarnings("MethodName")
+  public void Feed() {
+    feed();
+  }
+
+  /**
+   * Feed the MotorSafety timer. This method is called by the subclass motor whenever it updates its
+   * speed, thereby resetting the timeout value.
+   */
+  public void feed() {
+    m_safetyHelper.feed();
+  }
+
+  public void setSafetyEnabled(boolean enabled) {
+    m_safetyHelper.setSafetyEnabled(enabled);
+  }
+
+  public String getDescription() {
+    return "PWM " + getChannel();
+  }
+
+  public void disable() {
+    setDisabled();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SampleRobot.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SampleRobot.java
new file mode 100644
index 0000000..2ff7c2d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SampleRobot.java
@@ -0,0 +1,161 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.livewindow.LiveWindow;
+
+/**
+ * A simple robot base class that knows the standard FRC competition states (disabled, autonomous,
+ * or operator controlled).
+ *
+ * <p>You can build a simple robot program off of this by overriding the robotinit(), disabled(),
+ * autonomous() and operatorControl() methods. The startCompetition() method will calls these
+ * methods (sometimes repeatedly). depending on the state of the competition.
+ *
+ * <p>Alternatively you can override the robotMain() method and manage all aspects of the robot
+ * yourself.
+ *
+ * @deprecated WARNING: While it may look like a good choice to use for your code if you're
+ *     inexperienced, don't. Unless you know what you are doing, complex code will
+ *     be much more difficult under this system. Use TimedRobot or Command-Based
+ *     instead.
+ */
+@Deprecated
+public class SampleRobot extends RobotBase {
+  private boolean m_robotMainOverridden = true;
+
+  /**
+   * Create a new SampleRobot.
+   */
+  public SampleRobot() {
+    HAL.report(tResourceType.kResourceType_Framework, tInstances.kFramework_Simple);
+  }
+
+  /**
+   * Robot-wide initialization code should go here.
+   *
+   * <p>Users should override this method for default Robot-wide initialization which will be called
+   * when the robot is first powered on. It will be called exactly one time.
+   *
+   * <p>Warning: the Driver Station "Robot Code" light and FMS "Robot Ready" indicators will be off
+   * until RobotInit() exits. Code in RobotInit() that waits for enable will cause the robot to
+   * never indicate that the code is ready, causing the robot to be bypassed in a match.
+   */
+  protected void robotInit() {
+    System.out.println("Default robotInit() method running, consider providing your own");
+  }
+
+  /**
+   * Disabled should go here. Users should overload this method to run code that should run while
+   * the field is disabled.
+   *
+   * <p>Called once each time the robot enters the disabled state.
+   */
+  protected void disabled() {
+    System.out.println("Default disabled() method running, consider providing your own");
+  }
+
+  /**
+   * Autonomous should go here. Users should add autonomous code to this method that should run
+   * while the field is in the autonomous period.
+   *
+   * <p>Called once each time the robot enters the autonomous state.
+   */
+  public void autonomous() {
+    System.out.println("Default autonomous() method running, consider providing your own");
+  }
+
+  /**
+   * Operator control (tele-operated) code should go here. Users should add Operator Control code to
+   * this method that should run while the field is in the Operator Control (tele-operated) period.
+   *
+   * <p>Called once each time the robot enters the operator-controlled state.
+   */
+  public void operatorControl() {
+    System.out.println("Default operatorControl() method running, consider providing your own");
+  }
+
+  /**
+   * Test code should go here. Users should add test code to this method that should run while the
+   * robot is in test mode.
+   */
+  @SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
+  public void test() {
+    System.out.println("Default test() method running, consider providing your own");
+  }
+
+  /**
+   * Robot main program for free-form programs.
+   *
+   * <p>This should be overridden by user subclasses if the intent is to not use the autonomous()
+   * and operatorControl() methods. In that case, the program is responsible for sensing when to run
+   * the autonomous and operator control functions in their program.
+   *
+   * <p>This method will be called immediately after the constructor is called. If it has not been
+   * overridden by a user subclass (i.e. the default version runs), then the robotInit(),
+   * disabled(), autonomous() and operatorControl() methods will be called.
+   */
+  public void robotMain() {
+    m_robotMainOverridden = false;
+  }
+
+  /**
+   * Start a competition. This code tracks the order of the field starting to ensure that everything
+   * happens in the right order. Repeatedly run the correct method, either Autonomous or
+   * OperatorControl when the robot is enabled. After running the correct method, wait for some
+   * state to change, either the other mode starts or the robot is disabled. Then go back and wait
+   * for the robot to be enabled again.
+   */
+  public void startCompetition() {
+    robotInit();
+
+    // Tell the DS that the robot is ready to be enabled
+    HAL.observeUserProgramStarting();
+
+    robotMain();
+
+    if (!m_robotMainOverridden) {
+      while (true) {
+        if (isDisabled()) {
+          m_ds.InDisabled(true);
+          disabled();
+          m_ds.InDisabled(false);
+          while (isDisabled()) {
+            Timer.delay(0.01);
+          }
+        } else if (isAutonomous()) {
+          m_ds.InAutonomous(true);
+          autonomous();
+          m_ds.InAutonomous(false);
+          while (isAutonomous() && !isDisabled()) {
+            Timer.delay(0.01);
+          }
+        } else if (isTest()) {
+          LiveWindow.setEnabled(true);
+          m_ds.InTest(true);
+          test();
+          m_ds.InTest(false);
+          while (isTest() && isEnabled()) {
+            Timer.delay(0.01);
+          }
+          LiveWindow.setEnabled(false);
+        } else {
+          m_ds.InOperatorControl(true);
+          operatorControl();
+          m_ds.InOperatorControl(false);
+          while (isOperatorControl() && !isDisabled()) {
+            Timer.delay(0.01);
+          }
+        }
+      } /* while loop */
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Sendable.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Sendable.java
new file mode 100644
index 0000000..76eb03c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Sendable.java
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+
+/**
+ * The base interface for objects that can be sent over the network through network tables.
+ */
+public interface Sendable {
+  /**
+   * Gets the name of this {@link Sendable} object.
+   *
+   * @return Name
+   */
+  String getName();
+
+  /**
+   * Sets the name of this {@link Sendable} object.
+   *
+   * @param name name
+   */
+  void setName(String name);
+
+  /**
+   * Sets both the subsystem name and device name of this {@link Sendable} object.
+   *
+   * @param subsystem subsystem name
+   * @param name device name
+   */
+  default void setName(String subsystem, String name) {
+    setSubsystem(subsystem);
+    setName(name);
+  }
+
+  /**
+   * Gets the subsystem name of this {@link Sendable} object.
+   *
+   * @return Subsystem name
+   */
+  String getSubsystem();
+
+  /**
+   * Sets the subsystem name of this {@link Sendable} object.
+   *
+   * @param subsystem subsystem name
+   */
+  void setSubsystem(String subsystem);
+
+  /**
+   * Initializes this {@link Sendable} object.
+   *
+   * @param builder sendable builder
+   */
+  void initSendable(SendableBuilder builder);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SendableBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SendableBase.java
new file mode 100644
index 0000000..ffa64ff
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SendableBase.java
@@ -0,0 +1,94 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.livewindow.LiveWindow;
+
+/**
+ * Base class for all sensors. Stores most recent status information as well as containing utility
+ * functions for checking channels and error processing.
+ */
+public abstract class SendableBase implements Sendable {
+  private String m_name = "";
+  private String m_subsystem = "Ungrouped";
+
+  /**
+   * Creates an instance of the sensor base.
+   */
+  public SendableBase() {
+    this(true);
+  }
+
+  /**
+   * Creates an instance of the sensor base.
+   *
+   * @param addLiveWindow if true, add this Sendable to LiveWindow
+   */
+  public SendableBase(boolean addLiveWindow) {
+    if (addLiveWindow) {
+      LiveWindow.add(this);
+    }
+  }
+
+  /**
+   * Free the resources used by this object.
+   */
+  public void free() {
+    LiveWindow.remove(this);
+  }
+
+  @Override
+  public final synchronized String getName() {
+    return m_name;
+  }
+
+  @Override
+  public final synchronized void setName(String name) {
+    m_name = name;
+  }
+
+  /**
+   * Sets the name of the sensor with a channel number.
+   *
+   * @param moduleType A string that defines the module name in the label for the value
+   * @param channel    The channel number the device is plugged into
+   */
+  protected final void setName(String moduleType, int channel) {
+    setName(moduleType + "[" + channel + "]");
+  }
+
+  /**
+   * Sets the name of the sensor with a module and channel number.
+   *
+   * @param moduleType   A string that defines the module name in the label for the value
+   * @param moduleNumber The number of the particular module type
+   * @param channel      The channel number the device is plugged into (usually PWM)
+   */
+  protected final void setName(String moduleType, int moduleNumber, int channel) {
+    setName(moduleType + "[" + moduleNumber + "," + channel + "]");
+  }
+
+  @Override
+  public final synchronized String getSubsystem() {
+    return m_subsystem;
+  }
+
+  @Override
+  public final synchronized void setSubsystem(String subsystem) {
+    m_subsystem = subsystem;
+  }
+
+  /**
+   * Add a child component.
+   *
+   * @param child child component
+   */
+  protected final void addChild(Object child) {
+    LiveWindow.addChild(this, child);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorBase.java
new file mode 100644
index 0000000..6e33a79
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SensorBase.java
@@ -0,0 +1,236 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.AnalogJNI;
+import edu.wpi.first.wpilibj.hal.ConstantsJNI;
+import edu.wpi.first.wpilibj.hal.DIOJNI;
+import edu.wpi.first.wpilibj.hal.PDPJNI;
+import edu.wpi.first.wpilibj.hal.PWMJNI;
+import edu.wpi.first.wpilibj.hal.PortsJNI;
+import edu.wpi.first.wpilibj.hal.RelayJNI;
+import edu.wpi.first.wpilibj.hal.SolenoidJNI;
+
+/**
+ * Base class for all sensors. Stores most recent status information as well as containing utility
+ * functions for checking channels and error processing.
+ */
+public abstract class SensorBase extends SendableBase {
+  /**
+   * Ticks per microsecond.
+   */
+  public static final int kSystemClockTicksPerMicrosecond =
+      ConstantsJNI.getSystemClockTicksPerMicrosecond();
+  /**
+   * Number of digital channels per roboRIO.
+   */
+  public static final int kDigitalChannels = PortsJNI.getNumDigitalChannels();
+  /**
+   * Number of analog input channels per roboRIO.
+   */
+  public static final int kAnalogInputChannels = PortsJNI.getNumAnalogInputs();
+  /**
+   * Number of analog output channels per roboRIO.
+   */
+  public static final int kAnalogOutputChannels = PortsJNI.getNumAnalogOutputs();
+  /**
+   * Number of solenoid channels per module.
+   */
+  public static final int kSolenoidChannels = PortsJNI.getNumSolenoidChannels();
+  /**
+   * Number of PWM channels per roboRIO.
+   */
+  public static final int kPwmChannels = PortsJNI.getNumPWMChannels();
+  /**
+   * Number of relay channels per roboRIO.
+   */
+  public static final int kRelayChannels = PortsJNI.getNumRelayHeaders();
+  /**
+   * Number of power distribution channels per PDP.
+   */
+  public static final int kPDPChannels = PortsJNI.getNumPDPChannels();
+  /**
+   * Number of power distribution modules per PDP.
+   */
+  public static final int kPDPModules = PortsJNI.getNumPDPModules();
+  /**
+   * Number of PCM Modules.
+   */
+  public static final int kPCMModules = PortsJNI.getNumPCMModules();
+
+  private static int m_defaultSolenoidModule = 0;
+
+  /**
+   * Set the default location for the Solenoid module.
+   *
+   * @param moduleNumber The number of the solenoid module to use.
+   */
+  public static void setDefaultSolenoidModule(final int moduleNumber) {
+    checkSolenoidModule(moduleNumber);
+    SensorBase.m_defaultSolenoidModule = moduleNumber;
+  }
+
+  /**
+   * Verify that the solenoid module is correct.
+   *
+   * @param moduleNumber The solenoid module module number to check.
+   */
+  public static void checkSolenoidModule(final int moduleNumber) {
+    if (!SolenoidJNI.checkSolenoidModule(moduleNumber)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested solenoid module is out of range. Minimum: 0, Maximum: ")
+        .append(kPCMModules)
+        .append(", Requested: ")
+        .append(moduleNumber);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Check that the digital channel number is valid. Verify that the channel number is one of the
+   * legal channel numbers. Channel numbers are 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkDigitalChannel(final int channel) {
+    if (!DIOJNI.checkDIOChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested DIO channel is out of range. Minimum: 0, Maximum: ")
+        .append(kDigitalChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Check that the digital channel number is valid. Verify that the channel number is one of the
+   * legal channel numbers. Channel numbers are 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkRelayChannel(final int channel) {
+    if (!RelayJNI.checkRelayChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested relay channel is out of range. Minimum: 0, Maximum: ")
+        .append(kRelayChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Check that the digital channel number is valid. Verify that the channel number is one of the
+   * legal channel numbers. Channel numbers are 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkPWMChannel(final int channel) {
+    if (!PWMJNI.checkPWMChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested PWM channel is out of range. Minimum: 0, Maximum: ")
+        .append(kPwmChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Check that the analog input number is value. Verify that the analog input number is one of the
+   * legal channel numbers. Channel numbers are 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkAnalogInputChannel(final int channel) {
+    if (!AnalogJNI.checkAnalogInputChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested analog input channel is out of range. Minimum: 0, Maximum: ")
+        .append(kAnalogInputChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Check that the analog input number is value. Verify that the analog input number is one of the
+   * legal channel numbers. Channel numbers are 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkAnalogOutputChannel(final int channel) {
+    if (!AnalogJNI.checkAnalogOutputChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested analog output channel is out of range. Minimum: 0, Maximum: ")
+        .append(kAnalogOutputChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Verify that the solenoid channel number is within limits. Channel numbers are 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkSolenoidChannel(final int channel) {
+    if (!SolenoidJNI.checkSolenoidChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested solenoid channel is out of range. Minimum: 0, Maximum: ")
+        .append(kSolenoidChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Verify that the power distribution channel number is within limits. Channel numbers are
+   * 0-based.
+   *
+   * @param channel The channel number to check.
+   */
+  public static void checkPDPChannel(final int channel) {
+    if (!PDPJNI.checkPDPChannel(channel)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested PDP channel is out of range. Minimum: 0, Maximum: ")
+        .append(kPDPChannels)
+        .append(", Requested: ")
+        .append(channel);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Verify that the PDP module number is within limits. module numbers are 0-based.
+   *
+   * @param module The module number to check.
+   */
+  public static void checkPDPModule(final int module) {
+    if (!PDPJNI.checkPDPModule(module)) {
+      StringBuilder buf = new StringBuilder();
+      buf.append("Requested PDP module is out of range. Minimum: 0, Maximum: ")
+        .append(kPDPModules)
+        .append(", Requested: ")
+        .append(module);
+      throw new IndexOutOfBoundsException(buf.toString());
+    }
+  }
+
+  /**
+   * Get the number of the default solenoid module.
+   *
+   * @return The number of the default solenoid module.
+   */
+  public static int getDefaultSolenoidModule() {
+    return SensorBase.m_defaultSolenoidModule;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
new file mode 100644
index 0000000..57cd2f2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SerialPort.java
@@ -0,0 +1,358 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.io.UnsupportedEncodingException;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.SerialPortJNI;
+
+/**
+ * Driver for the RS-232 serial port on the roboRIO.
+ *
+ * <p>The current implementation uses the VISA formatted I/O mode. This means that all traffic goes
+ * through the formatted buffers. This allows the intermingled use of print(), readString(), and the
+ * raw buffer accessors read() and write().
+ *
+ * <p>More information can be found in the NI-VISA User Manual here: http://www.ni
+ * .com/pdf/manuals/370423a.pdf and the NI-VISA Programmer's Reference Manual here:
+ * http://www.ni.com/pdf/manuals/370132c.pdf
+ */
+public class SerialPort {
+  private byte m_port;
+
+  public enum Port {
+    kOnboard(0), kMXP(1), kUSB(2), kUSB1(2), kUSB2(3);
+
+    @SuppressWarnings("MemberName")
+    public int value;
+
+    Port(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents the parity to use for serial communications.
+   */
+  public enum Parity {
+    kNone(0), kOdd(1), kEven(2), kMark(3), kSpace(4);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    Parity(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents the number of stop bits to use for Serial Communication.
+   */
+  public enum StopBits {
+    kOne(10), kOnePointFive(15), kTwo(20);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    StopBits(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents what type of flow control to use for serial communication.
+   */
+  public enum FlowControl {
+    kNone(0), kXonXoff(1), kRtsCts(2), kDtsDsr(4);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    FlowControl(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Represents which type of buffer mode to use when writing to a serial m_port.
+   */
+  public enum WriteBufferMode {
+    kFlushOnAccess(1), kFlushWhenFull(2);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    WriteBufferMode(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Create an instance of a Serial Port class.
+   *
+   * @param baudRate The baud rate to configure the serial port.
+   * @param port     The Serial port to use
+   * @param dataBits The number of data bits per transfer. Valid values are between 5 and 8 bits.
+   * @param parity   Select the type of parity checking to use.
+   * @param stopBits The number of stop bits to use as defined by the enum StopBits.
+   */
+  public SerialPort(final int baudRate, Port port, final int dataBits, Parity parity,
+                    StopBits stopBits) {
+    m_port = (byte) port.value;
+
+    SerialPortJNI.serialInitializePort(m_port);
+    SerialPortJNI.serialSetBaudRate(m_port, baudRate);
+    SerialPortJNI.serialSetDataBits(m_port, (byte) dataBits);
+    SerialPortJNI.serialSetParity(m_port, (byte) parity.value);
+    SerialPortJNI.serialSetStopBits(m_port, (byte) stopBits.value);
+
+    // Set the default read buffer size to 1 to return bytes immediately
+    setReadBufferSize(1);
+
+    // Set the default timeout to 5 seconds.
+    setTimeout(5.0);
+
+    // Don't wait until the buffer is full to transmit.
+    setWriteBufferMode(WriteBufferMode.kFlushOnAccess);
+
+    disableTermination();
+
+    HAL.report(tResourceType.kResourceType_SerialPort, 0);
+  }
+
+  /**
+   * Create an instance of a Serial Port class. Defaults to one stop bit.
+   *
+   * @param baudRate The baud rate to configure the serial port.
+   * @param dataBits The number of data bits per transfer. Valid values are between 5 and 8 bits.
+   * @param parity   Select the type of parity checking to use.
+   */
+  public SerialPort(final int baudRate, Port port, final int dataBits, Parity parity) {
+    this(baudRate, port, dataBits, parity, StopBits.kOne);
+  }
+
+  /**
+   * Create an instance of a Serial Port class. Defaults to no parity and one stop bit.
+   *
+   * @param baudRate The baud rate to configure the serial port.
+   * @param dataBits The number of data bits per transfer. Valid values are between 5 and 8 bits.
+   */
+  public SerialPort(final int baudRate, Port port, final int dataBits) {
+    this(baudRate, port, dataBits, Parity.kNone, StopBits.kOne);
+  }
+
+  /**
+   * Create an instance of a Serial Port class. Defaults to 8 databits, no parity, and one stop
+   * bit.
+   *
+   * @param baudRate The baud rate to configure the serial port.
+   */
+  public SerialPort(final int baudRate, Port port) {
+    this(baudRate, port, 8, Parity.kNone, StopBits.kOne);
+  }
+
+  /**
+   * Destructor.
+   */
+  public void free() {
+    SerialPortJNI.serialClose(m_port);
+  }
+
+  /**
+   * Set the type of flow control to enable on this port.
+   *
+   * <p>By default, flow control is disabled.
+   *
+   * @param flowControl the FlowControl m_value to use
+   */
+  public void setFlowControl(FlowControl flowControl) {
+    SerialPortJNI.serialSetFlowControl(m_port, (byte) flowControl.value);
+  }
+
+  /**
+   * Enable termination and specify the termination character.
+   *
+   * <p>Termination is currently only implemented for receive. When the the terminator is received,
+   * the read() or readString() will return fewer bytes than requested, stopping after the
+   * terminator.
+   *
+   * @param terminator The character to use for termination.
+   */
+  public void enableTermination(char terminator) {
+    SerialPortJNI.serialEnableTermination(m_port, terminator);
+  }
+
+  /**
+   * Enable termination with the default terminator '\n'
+   *
+   * <p>Termination is currently only implemented for receive. When the the terminator is received,
+   * the read() or readString() will return fewer bytes than requested, stopping after the
+   * terminator.
+   *
+   * <p>The default terminator is '\n'
+   */
+  public void enableTermination() {
+    enableTermination('\n');
+  }
+
+  /**
+   * Disable termination behavior.
+   */
+  public void disableTermination() {
+    SerialPortJNI.serialDisableTermination(m_port);
+  }
+
+  /**
+   * Get the number of bytes currently available to read from the serial port.
+   *
+   * @return The number of bytes available to read.
+   */
+  public int getBytesReceived() {
+    return SerialPortJNI.serialGetBytesReceived(m_port);
+  }
+
+  /**
+   * Read a string out of the buffer. Reads the entire contents of the buffer
+   *
+   * @return The read string
+   */
+  public String readString() {
+    return readString(getBytesReceived());
+  }
+
+  /**
+   * Read a string out of the buffer. Reads the entire contents of the buffer
+   *
+   * @param count the number of characters to read into the string
+   * @return The read string
+   */
+  public String readString(int count) {
+    byte[] out = read(count);
+    try {
+      return new String(out, 0, out.length, "US-ASCII");
+    } catch (UnsupportedEncodingException ex) {
+      ex.printStackTrace();
+      return "";
+    }
+  }
+
+  /**
+   * Read raw bytes out of the buffer.
+   *
+   * @param count The maximum number of bytes to read.
+   * @return An array of the read bytes
+   */
+  public byte[] read(final int count) {
+    byte[] dataReceivedBuffer = new byte[count];
+    int gotten = SerialPortJNI.serialRead(m_port, dataReceivedBuffer, count);
+    if (gotten == count) {
+      return dataReceivedBuffer;
+    }
+    byte[] retVal = new byte[gotten];
+    System.arraycopy(dataReceivedBuffer, 0, retVal, 0, gotten);
+    return retVal;
+  }
+
+  /**
+   * Write raw bytes to the serial port.
+   *
+   * @param buffer The buffer of bytes to write.
+   * @param count  The maximum number of bytes to write.
+   * @return The number of bytes actually written into the port.
+   */
+  public int write(byte[] buffer, int count) {
+    if (buffer.length < count) {
+      throw new IllegalArgumentException("buffer is too small, must be at least " + count);
+    }
+    return SerialPortJNI.serialWrite(m_port, buffer, count);
+  }
+
+  /**
+   * Write a string to the serial port.
+   *
+   * @param data The string to write to the serial port.
+   * @return The number of bytes actually written into the port.
+   */
+  public int writeString(String data) {
+    return write(data.getBytes(), data.length());
+  }
+
+  /**
+   * Configure the timeout of the serial m_port.
+   *
+   * <p>This defines the timeout for transactions with the hardware. It will affect reads if less
+   * bytes are available than the read buffer size (defaults to 1) and very large writes.
+   *
+   * @param timeout The number of seconds to to wait for I/O.
+   */
+  public void setTimeout(double timeout) {
+    SerialPortJNI.serialSetTimeout(m_port, timeout);
+  }
+
+  /**
+   * Specify the size of the input buffer.
+   *
+   * <p>Specify the amount of data that can be stored before data from the device is returned to
+   * Read. If you want data that is received to be returned immediately, set this to 1.
+   *
+   * <p>It the buffer is not filled before the read timeout expires, all data that has been received
+   * so far will be returned.
+   *
+   * @param size The read buffer size.
+   */
+  public void setReadBufferSize(int size) {
+    SerialPortJNI.serialSetReadBufferSize(m_port, size);
+  }
+
+  /**
+   * Specify the size of the output buffer.
+   *
+   * <p>Specify the amount of data that can be stored before being transmitted to the device.
+   *
+   * @param size The write buffer size.
+   */
+  public void setWriteBufferSize(int size) {
+    SerialPortJNI.serialSetWriteBufferSize(m_port, size);
+  }
+
+  /**
+   * Specify the flushing behavior of the output buffer.
+   *
+   * <p>When set to kFlushOnAccess, data is synchronously written to the serial port after each
+   * call to either print() or write().
+   *
+   * <p>When set to kFlushWhenFull, data will only be written to the serial port when the buffer
+   * is full or when flush() is called.
+   *
+   * @param mode The write buffer mode.
+   */
+  public void setWriteBufferMode(WriteBufferMode mode) {
+    SerialPortJNI.serialSetWriteMode(m_port, (byte) mode.value);
+  }
+
+  /**
+   * Force the output buffer to be written to the port.
+   *
+   * <p>This is used when setWriteBufferMode() is set to kFlushWhenFull to force a flush before the
+   * buffer is full.
+   */
+  public void flush() {
+    SerialPortJNI.serialFlush(m_port);
+  }
+
+  /**
+   * Reset the serial port driver to a known state.
+   *
+   * <p>Empty the transmit and receive buffers in the device and formatted I/O.
+   */
+  public void reset() {
+    SerialPortJNI.serialClear(m_port);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Servo.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Servo.java
new file mode 100644
index 0000000..5f8b88a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Servo.java
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Standard hobby style servo.
+ *
+ * <p>The range parameters default to the appropriate values for the Hitec HS-322HD servo provided
+ * in the FIRST Kit of Parts in 2008.
+ */
+public class Servo extends PWM {
+  private static final double kMaxServoAngle = 180.0;
+  private static final double kMinServoAngle = 0.0;
+
+  protected static final double kDefaultMaxServoPWM = 2.4;
+  protected static final double kDefaultMinServoPWM = .6;
+
+  /**
+   * Constructor.<br>
+   *
+   * <p>By default {@value #kDefaultMaxServoPWM} ms is used as the maxPWM value<br> By default
+   * {@value #kDefaultMinServoPWM} ms is used as the minPWM value<br>
+   *
+   * @param channel The PWM channel to which the servo is attached. 0-9 are on-board, 10-19 are on
+   *                the MXP port
+   */
+  public Servo(final int channel) {
+    super(channel);
+    setBounds(kDefaultMaxServoPWM, 0, 0, 0, kDefaultMinServoPWM);
+    setPeriodMultiplier(PeriodMultiplier.k4X);
+
+    HAL.report(tResourceType.kResourceType_Servo, getChannel());
+    setName("Servo", getChannel());
+  }
+
+
+  /**
+   * Set the servo position.
+   *
+   * <p>Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.
+   *
+   * @param value Position from 0.0 to 1.0.
+   */
+  public void set(double value) {
+    setPosition(value);
+  }
+
+  /**
+   * Get the servo position.
+   *
+   * <p>Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.
+   *
+   * @return Position from 0.0 to 1.0.
+   */
+  public double get() {
+    return getPosition();
+  }
+
+  /**
+   * Set the servo angle.
+   *
+   * <p>Assume that the servo angle is linear with respect to the PWM value (big assumption, need to
+   * test).
+   *
+   * <p>Servo angles that are out of the supported range of the servo simply "saturate" in that
+   * direction In other words, if the servo has a range of (X degrees to Y degrees) than angles of
+   * less than X result in an angle of X being set and angles of more than Y degrees result in an
+   * angle of Y being set.
+   *
+   * @param degrees The angle in degrees to set the servo.
+   */
+  public void setAngle(double degrees) {
+    if (degrees < kMinServoAngle) {
+      degrees = kMinServoAngle;
+    } else if (degrees > kMaxServoAngle) {
+      degrees = kMaxServoAngle;
+    }
+
+    setPosition(((degrees - kMinServoAngle)) / getServoAngleRange());
+  }
+
+  /**
+   * Get the servo angle.
+   *
+   * <p>Assume that the servo angle is linear with respect to the PWM value (big assumption, need to
+   * test).
+   *
+   * @return The angle in degrees to which the servo is set.
+   */
+  public double getAngle() {
+    return getPosition() * getServoAngleRange() + kMinServoAngle;
+  }
+
+  private double getServoAngleRange() {
+    return kMaxServoAngle - kMinServoAngle;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Servo");
+    builder.addDoubleProperty("Value", this::get, this::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java
new file mode 100644
index 0000000..a421a5a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Solenoid.java
@@ -0,0 +1,124 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.hal.SolenoidJNI;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Solenoid class for running high voltage Digital Output on the PCM.
+ *
+ * <p>The Solenoid class is typically used for pneumatic solenoids, but could be used for any
+ * device within the current spec of the PCM.
+ */
+public class Solenoid extends SolenoidBase implements Sendable {
+  private final int m_channel; // The channel to control.
+  private int m_solenoidHandle;
+
+  /**
+   * Constructor using the default PCM ID (defaults to 0).
+   *
+   * @param channel The channel on the PCM to control (0..7).
+   */
+  public Solenoid(final int channel) {
+    this(SensorBase.getDefaultSolenoidModule(), channel);
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param moduleNumber The CAN ID of the PCM the solenoid is attached to.
+   * @param channel      The channel on the PCM to control (0..7).
+   */
+  public Solenoid(final int moduleNumber, final int channel) {
+    super(moduleNumber);
+    m_channel = channel;
+
+    SensorBase.checkSolenoidModule(m_moduleNumber);
+    SensorBase.checkSolenoidChannel(m_channel);
+
+    int portHandle = SolenoidJNI.getPortWithModule((byte) m_moduleNumber, (byte) m_channel);
+    m_solenoidHandle = SolenoidJNI.initializeSolenoidPort(portHandle);
+
+    HAL.report(tResourceType.kResourceType_Solenoid, m_channel, m_moduleNumber);
+    setName("Solenoid", m_moduleNumber, m_channel);
+  }
+
+  /**
+   * Destructor.
+   */
+  @Override
+  public synchronized void free() {
+    super.free();
+    SolenoidJNI.freeSolenoidPort(m_solenoidHandle);
+    m_solenoidHandle = 0;
+  }
+
+  /**
+   * Set the value of a solenoid.
+   *
+   * @param on True will turn the solenoid output on. False will turn the solenoid output off.
+   */
+  public void set(boolean on) {
+    SolenoidJNI.setSolenoid(m_solenoidHandle, on);
+  }
+
+  /**
+   * Read the current value of the solenoid.
+   *
+   * @return True if the solenoid output is on or false if the solenoid output is off.
+   */
+  public boolean get() {
+    return SolenoidJNI.getSolenoid(m_solenoidHandle);
+  }
+
+  /**
+   * Check if solenoid is blacklisted. If a solenoid is shorted, it is added to the blacklist and
+   * disabled until power cycle, or until faults are cleared.
+   *
+   * @return If solenoid is disabled due to short.
+   * @see #clearAllPCMStickyFaults()
+   */
+  public boolean isBlackListed() {
+    int value = getPCMSolenoidBlackList() & (1 << m_channel);
+    return value != 0;
+  }
+
+  /**
+   * Set the pulse duration in the PCM. This is used in conjunction with
+   * the startPulse method to allow the PCM to control the timing of a pulse.
+   * The timing can be controlled in 0.01 second increments.
+   *
+   * @param durationSeconds The duration of the pulse, from 0.01 to 2.55 seconds.
+   *
+   * @see #startPulse()
+   */
+  public void setPulseDuration(double durationSeconds) {
+    long durationMS = (long) (durationSeconds * 1000);
+    SolenoidJNI.setOneShotDuration(m_solenoidHandle, durationMS);
+  }
+
+  /**
+   * Trigger the PCM to generate a pulse of the duration set in
+   * setPulseDuration.
+   *
+   * @see #setPulseDuration(double)
+   */
+  public void startPulse() {
+    SolenoidJNI.fireOneShot(m_solenoidHandle);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Solenoid");
+    builder.setSafeState(() -> set(false));
+    builder.addBooleanProperty("Value", this::get, this::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SolenoidBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SolenoidBase.java
new file mode 100644
index 0000000..ff70dcd
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SolenoidBase.java
@@ -0,0 +1,141 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.SolenoidJNI;
+
+/**
+ * SolenoidBase class is the common base class for the {@link Solenoid} and {@link DoubleSolenoid}
+ * classes.
+ */
+public abstract class SolenoidBase extends SendableBase {
+  protected final int m_moduleNumber; // The number of the solenoid module being used.
+
+  /**
+   * Constructor.
+   *
+   * @param moduleNumber The PCM CAN ID
+   */
+  public SolenoidBase(final int moduleNumber) {
+    m_moduleNumber = moduleNumber;
+  }
+
+  /**
+   * Read all 8 solenoids from the specified module as a single byte.
+   *
+   * @param moduleNumber the module number to read
+   * @return The current value of all 8 solenoids on the module.
+   */
+  public static int getAll(int moduleNumber) {
+    return SolenoidJNI.getAllSolenoids(moduleNumber);
+  }
+
+  /**
+   * Read all 8 solenoids from the module used by this solenoid as a single byte.
+   *
+   * @return The current value of all 8 solenoids on this module.
+   */
+  public int getAll() {
+    return SolenoidBase.getAll(m_moduleNumber);
+  }
+
+  /**
+   * Reads complete solenoid blacklist for all 8 solenoids as a single byte. If a solenoid is
+   * shorted, it is added to the blacklist and disabled until power cycle, or until faults are
+   * cleared.
+   *
+   * @param moduleNumber the module number to read
+   * @return The solenoid blacklist of all 8 solenoids on the module.
+   * @see #clearAllPCMStickyFaults()
+   */
+  public static int getPCMSolenoidBlackList(int moduleNumber) {
+    return SolenoidJNI.getPCMSolenoidBlackList(moduleNumber);
+  }
+
+  /**
+   * Reads complete solenoid blacklist for all 8 solenoids as a single byte. If a solenoid is
+   * shorted, it is added to the blacklist and disabled until power cycle, or until faults are
+   * cleared.
+   *
+   * @return The solenoid blacklist of all 8 solenoids on the module.
+   * @see #clearAllPCMStickyFaults()
+   */
+  public int getPCMSolenoidBlackList() {
+    return SolenoidBase.getPCMSolenoidBlackList(m_moduleNumber);
+  }
+
+  /**
+   * If true, the common highside solenoid voltage rail is too low, most likely a solenoid channel
+   * is shorted.
+   *
+   * @param moduleNumber the module number to read
+   * @return true if PCM sticky fault is set
+   */
+  public static boolean getPCMSolenoidVoltageStickyFault(int moduleNumber) {
+    return SolenoidJNI.getPCMSolenoidVoltageStickyFault(moduleNumber);
+  }
+
+  /**
+   * If true, the common highside solenoid voltage rail is too low, most likely a solenoid channel
+   * is shorted.
+   *
+   * @return true if PCM sticky fault is set
+   */
+  public boolean getPCMSolenoidVoltageStickyFault() {
+    return SolenoidBase.getPCMSolenoidVoltageStickyFault(m_moduleNumber);
+  }
+
+  /**
+   * The common highside solenoid voltage rail is too low, most likely a solenoid channel is
+   * shorted.
+   *
+   * @param moduleNumber the module number to read
+   * @return true if PCM is in fault state.
+   */
+  public static boolean getPCMSolenoidVoltageFault(int moduleNumber) {
+    return SolenoidJNI.getPCMSolenoidVoltageFault(moduleNumber);
+  }
+
+  /**
+   * The common highside solenoid voltage rail is too low, most likely a solenoid channel is
+   * shorted.
+   *
+   * @return true if PCM is in fault state.
+   */
+  public boolean getPCMSolenoidVoltageFault() {
+    return SolenoidBase.getPCMSolenoidVoltageFault(m_moduleNumber);
+  }
+
+  /**
+   * Clear ALL sticky faults inside PCM that Compressor is wired to.
+   *
+   * <p>If a sticky fault is set, then it will be persistently cleared. Compressor drive maybe
+   * momentarily disable while flags are being cleared. Care should be taken to not call this too
+   * frequently, otherwise normal compressor functionality may be prevented.
+   *
+   * <p>If no sticky faults are set then this call will have no effect.
+   *
+   * @param moduleNumber the module number to read
+   */
+  public static void clearAllPCMStickyFaults(int moduleNumber) {
+    SolenoidJNI.clearAllPCMStickyFaults(moduleNumber);
+  }
+
+  /**
+   * Clear ALL sticky faults inside PCM that Compressor is wired to.
+   *
+   * <p>If a sticky fault is set, then it will be persistently cleared. Compressor drive maybe
+   * momentarily disable while flags are being cleared. Care should be taken to not call this too
+   * frequently, otherwise normal compressor functionality may be prevented.
+   *
+   * <p>If no sticky faults are set then this call will have no effect.
+   */
+  public void clearAllPCMStickyFaults() {
+    SolenoidBase.clearAllPCMStickyFaults(m_moduleNumber);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Spark.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Spark.java
new file mode 100644
index 0000000..1deefe5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Spark.java
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * REV Robotics SPARK Speed Controller.
+ */
+public class Spark extends PWMSpeedController {
+  /**
+   * Common initialization code called by all constructors.
+   *
+   * <p>Note that the SPARK uses the following bounds for PWM values. These values should work
+   * reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the Spark User Manual
+   * available from REV Robotics.
+   *
+   * <p>- 2.003ms = full "forward" - 1.55ms = the "high end" of the deadband range - 1.50ms =
+   * center of the deadband range (off) - 1.46ms = the "low end" of the deadband range - .999ms =
+   * full "reverse"
+   */
+  protected void initSpark() {
+    setBounds(2.003, 1.55, 1.50, 1.46, .999);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_RevSPARK, getChannel());
+    setName("Spark", getChannel());
+  }
+
+  /**
+   * Constructor.
+   *
+   * @param channel The PWM channel that the SPARK is attached to. 0-9 are on-board, 10-19 are on
+   *                the MXP port
+   */
+  public Spark(final int channel) {
+    super(channel);
+    initSpark();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedController.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedController.java
new file mode 100644
index 0000000..b90d19f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedController.java
@@ -0,0 +1,52 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * Interface for speed controlling devices.
+ */
+public interface SpeedController extends PIDOutput {
+  /**
+   * Common interface for setting the speed of a speed controller.
+   *
+   * @param speed The speed to set. Value should be between -1.0 and 1.0.
+   */
+  void set(double speed);
+
+  /**
+   * Common interface for getting the current set speed of a speed controller.
+   *
+   * @return The current set speed. Value is between -1.0 and 1.0.
+   */
+  double get();
+
+  /**
+   * Common interface for inverting direction of a speed controller.
+   *
+   * @param isInverted The state of inversion true is inverted.
+   */
+  void setInverted(boolean isInverted);
+
+  /**
+   * Common interface for returning if a speed controller is in the inverted state or not.
+   *
+   * @return isInverted The state of the inversion true is inverted.
+   */
+  boolean getInverted();
+
+  /**
+   * Disable the speed controller.
+   */
+  void disable();
+
+  /**
+   * Stops motor movement. Motor can be moved again by calling set without having to re-enable the
+   * motor.
+   */
+  void stopMotor();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java
new file mode 100644
index 0000000..75dff58
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/SpeedControllerGroup.java
@@ -0,0 +1,88 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * Allows multiple {@link SpeedController} objects to be linked together.
+ */
+public class SpeedControllerGroup extends SendableBase implements SpeedController {
+  private boolean m_isInverted = false;
+  private final SpeedController[] m_speedControllers;
+  private static int instances = 0;
+
+  /**
+   * Create a new SpeedControllerGroup with the provided SpeedControllers.
+   *
+   * @param speedControllers The SpeedControllers to add
+   */
+  public SpeedControllerGroup(SpeedController speedController,
+                              SpeedController... speedControllers) {
+    m_speedControllers = new SpeedController[speedControllers.length + 1];
+    m_speedControllers[0] = speedController;
+    addChild(speedController);
+    for (int i = 0; i < speedControllers.length; i++) {
+      m_speedControllers[i + 1] = speedControllers[i];
+      addChild(speedControllers[i]);
+    }
+    instances++;
+    setName("SpeedControllerGroup", instances);
+  }
+
+  @Override
+  public void set(double speed) {
+    for (SpeedController speedController : m_speedControllers) {
+      speedController.set(m_isInverted ? -speed : speed);
+    }
+  }
+
+  @Override
+  public double get() {
+    if (m_speedControllers.length > 0) {
+      return m_speedControllers[0].get() * (m_isInverted ? -1 : 1);
+    }
+    return 0.0;
+  }
+
+  @Override
+  public void setInverted(boolean isInverted) {
+    m_isInverted = isInverted;
+  }
+
+  @Override
+  public boolean getInverted() {
+    return m_isInverted;
+  }
+
+  @Override
+  public void disable() {
+    for (SpeedController speedController : m_speedControllers) {
+      speedController.disable();
+    }
+  }
+
+  @Override
+  public void stopMotor() {
+    for (SpeedController speedController : m_speedControllers) {
+      speedController.stopMotor();
+    }
+  }
+
+  @Override
+  public void pidWrite(double output) {
+    set(output);
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Speed Controller");
+    builder.setSafeState(this::stopMotor);
+    builder.addDoubleProperty("Value", this::get, this::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Talon.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Talon.java
new file mode 100644
index 0000000..9e42a56
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Talon.java
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Cross the Road Electronics (CTRE) Talon and Talon SR Speed Controller.
+ */
+public class Talon extends PWMSpeedController {
+  /**
+   * Constructor for a Talon (original or Talon SR).
+   *
+   * <p>Note that the Talon uses the following bounds for PWM values. These values should work
+   * reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the Talon User Manual
+   * available from CTRE.
+   *
+   * <p>- 2.037ms = full "forward" - 1.539ms = the "high end" of the deadband range - 1.513ms =
+   * center of the deadband range (off) - 1.487ms = the "low end" of the deadband range - .989ms
+   * = full "reverse"
+   *
+   * @param channel The PWM channel that the Talon is attached to. 0-9 are on-board, 10-19 are on
+   *                the MXP port
+   */
+  public Talon(final int channel) {
+    super(channel);
+
+    setBounds(2.037, 1.539, 1.513, 1.487, .989);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_Talon, getChannel());
+    setName("Talon", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Threads.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Threads.java
new file mode 100644
index 0000000..5d455e2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Threads.java
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.ThreadsJNI;
+
+public class Threads {
+  /**
+  * Get the thread priority for the current thread.
+  * @return The current thread priority. Scaled 1-99.
+  */
+  public static int getCurrentThreadPriority() {
+    return ThreadsJNI.getCurrentThreadPriority();
+  }
+
+  /**
+  * Get if the current thread is realtime.
+  * @return If the current thread is realtime
+  */
+  public static boolean getCurrentThreadIsRealTime() {
+    return ThreadsJNI.getCurrentThreadIsRealTime();
+  }
+
+  /**
+  * Sets the thread priority for the current thread.
+  *
+  * @param realTime Set to true to set a realtime priority, false for standard
+  *     priority
+  * @param priority Priority to set the thread to. Scaled 1-99, with 1 being
+  *     highest. On RoboRIO, priority is ignored for non realtime setting
+  *
+  * @return The success state of setting the priority
+  */
+  public static boolean setCurrentThreadPriority(boolean realTime, int priority) {
+    return ThreadsJNI.setCurrentThreadPriority(realTime, priority);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/TimedRobot.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/TimedRobot.java
new file mode 100644
index 0000000..d533313
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/TimedRobot.java
@@ -0,0 +1,71 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * TimedRobot implements the IterativeRobotBase robot program framework.
+ *
+ * <p>The TimedRobot class is intended to be subclassed by a user creating a robot program.
+ *
+ * <p>periodic() functions from the base class are called on an interval by a Notifier instance.
+ */
+public class TimedRobot extends IterativeRobotBase {
+  public static final double DEFAULT_PERIOD = 0.02;
+
+  private double m_period = DEFAULT_PERIOD;
+
+  // Prevents loop from starting if user calls setPeriod() in robotInit()
+  private boolean m_startLoop = false;
+
+  private Notifier m_loop = new Notifier(() -> {
+    loopFunc();
+  });
+
+  public TimedRobot() {
+    // HAL.report(tResourceType.kResourceType_Framework, tInstances.kFramework_Periodic);
+    HAL.report(tResourceType.kResourceType_Framework, tInstances.kFramework_Iterative);
+  }
+
+  /**
+   * Provide an alternate "main loop" via startCompetition().
+   */
+  public void startCompetition() {
+    robotInit();
+
+    // Tell the DS that the robot is ready to be enabled
+    HAL.observeUserProgramStarting();
+
+    // Loop forever, calling the appropriate mode-dependent function
+    m_startLoop = true;
+    m_loop.startPeriodic(m_period);
+    while (true) {
+      try {
+        Thread.sleep(1000 * 60 * 60 * 24);
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+      }
+    }
+  }
+
+  /**
+   * Set time period between calls to Periodic() functions.
+   *
+   * @param period Period in seconds.
+   */
+  public void setPeriod(double period) {
+    m_period = period;
+
+    if (m_startLoop) {
+      m_loop.startPeriodic(m_period);
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java
new file mode 100644
index 0000000..7184115
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Timer.java
@@ -0,0 +1,179 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;
+
+public class Timer {
+  private static StaticInterface impl;
+
+  @SuppressWarnings("MethodName")
+  public static void SetImplementation(StaticInterface ti) {
+    impl = ti;
+  }
+
+  /**
+   * Return the system clock time in seconds. Return the time from the FPGA hardware clock in
+   * seconds since the FPGA started.
+   *
+   * @return Robot running time in seconds.
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public static double getFPGATimestamp() {
+    if (impl != null) {
+      return impl.getFPGATimestamp();
+    } else {
+      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
+    }
+  }
+
+  /**
+   * Return the approximate match time. The FMS does not send an official match time to the robots,
+   * but does send an approximate match time. The value will count down the time remaining in the
+   * current period (auto or teleop). Warning: This is not an official time (so it cannot be used to
+   * dispute ref calls or guarantee that a function will trigger before the match ends) The
+   * Practice Match function of the DS approximates the behaviour seen on the field.
+   *
+   * @return Time remaining in current match period (auto or teleop) in seconds
+   */
+  public static double getMatchTime() {
+    if (impl != null) {
+      return impl.getMatchTime();
+    } else {
+      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
+    }
+  }
+
+  /**
+   * Pause the thread for a specified time. Pause the execution of the thread for a specified period
+   * of time given in seconds. Motors will continue to run at their last assigned values, and
+   * sensors will continue to update. Only the task containing the wait will pause until the wait
+   * time is expired.
+   *
+   * @param seconds Length of time to pause
+   */
+  public static void delay(final double seconds) {
+    if (impl != null) {
+      impl.delay(seconds);
+    } else {
+      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
+    }
+  }
+
+  public interface StaticInterface {
+    @SuppressWarnings("AbbreviationAsWordInName")
+    double getFPGATimestamp();
+
+    double getMatchTime();
+
+    void delay(double seconds);
+
+    @SuppressWarnings("JavadocMethod")
+    Interface newTimer();
+  }
+
+  private final Interface m_timer;
+
+  @SuppressWarnings("JavadocMethod")
+  public Timer() {
+    if (impl != null) {
+      m_timer = impl.newTimer();
+    } else {
+      throw new BaseSystemNotInitializedException(StaticInterface.class, Timer.class);
+    }
+  }
+
+  /**
+   * Get the current time from the timer. If the clock is running it is derived from the current
+   * system clock the start time stored in the timer class. If the clock is not running, then return
+   * the time when it was last stopped.
+   *
+   * @return Current time value for this timer in seconds
+   */
+  public double get() {
+    return m_timer.get();
+  }
+
+  /**
+   * Reset the timer by setting the time to 0. Make the timer startTime the current time so new
+   * requests will be relative now
+   */
+  public void reset() {
+    m_timer.reset();
+  }
+
+  /**
+   * Start the timer running. Just set the running flag to true indicating that all time requests
+   * should be relative to the system clock.
+   */
+  public void start() {
+    m_timer.start();
+  }
+
+  /**
+   * Stop the timer. This computes the time as of now and clears the running flag, causing all
+   * subsequent time requests to be read from the accumulated time rather than looking at the system
+   * clock.
+   */
+  public void stop() {
+    m_timer.stop();
+  }
+
+  /**
+   * Check if the period specified has passed and if it has, advance the start time by that period.
+   * This is useful to decide if it's time to do periodic work without drifting later by the time it
+   * took to get around to checking.
+   *
+   * @param period The period to check for (in seconds).
+   * @return If the period has passed.
+   */
+  public boolean hasPeriodPassed(double period) {
+    return m_timer.hasPeriodPassed(period);
+  }
+
+  public interface Interface {
+    /**
+     * Get the current time from the timer. If the clock is running it is derived from the current
+     * system clock the start time stored in the timer class. If the clock is not running, then
+     * return the time when it was last stopped.
+     *
+     * @return Current time value for this timer in seconds
+     */
+    double get();
+
+    /**
+     * Reset the timer by setting the time to 0. Make the timer startTime the current time so new
+     * requests will be relative now
+     */
+    void reset();
+
+    /**
+     * Start the timer running. Just set the running flag to true indicating that all time requests
+     * should be relative to the system clock.
+     */
+    void start();
+
+    /**
+     * Stop the timer. This computes the time as of now and clears the running flag, causing all
+     * subsequent time requests to be read from the accumulated time rather than looking at the
+     * system clock.
+     */
+    void stop();
+
+
+    /**
+     * Check if the period specified has passed and if it has, advance the start time by that
+     * period. This is useful to decide if it's time to do periodic work without drifting later by
+     * the time it took to get around to checking.
+     *
+     * @param period The period to check for (in seconds).
+     * @return If the period has passed.
+     */
+    boolean hasPeriodPassed(double period);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java
new file mode 100644
index 0000000..a89f088
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Ultrasonic.java
@@ -0,0 +1,398 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Ultrasonic rangefinder class. The Ultrasonic rangefinder measures absolute distance based on the
+ * round-trip time of a ping generated by the controller. These sensors use two transducers, a
+ * speaker and a microphone both tuned to the ultrasonic range. A common ultrasonic sensor, the
+ * Daventech SRF04 requires a short pulse to be generated on a digital channel. This causes the
+ * chirp to be emitted. A second line becomes high as the ping is transmitted and goes low when the
+ * echo is received. The time that the line is high determines the round trip distance (time of
+ * flight).
+ */
+public class Ultrasonic extends SensorBase implements PIDSource, Sendable {
+  /**
+   * The units to return when PIDGet is called.
+   */
+  public enum Unit {
+    /**
+     * Use inches for PIDGet.
+     */
+    kInches,
+    /**
+     * Use millimeters for PIDGet.
+     */
+    kMillimeters
+  }
+
+  // Time (sec) for the ping trigger pulse.
+  private static final double kPingTime = 10 * 1e-6;
+  private static final double kSpeedOfSoundInchesPerSec = 1130.0 * 12.0;
+  // head of the ultrasonic sensor list
+  private static Ultrasonic m_firstSensor = null;
+  // automatic round robin mode
+  private static boolean m_automaticEnabled = false;
+  private DigitalInput m_echoChannel;
+  private DigitalOutput m_pingChannel = null;
+  private boolean m_allocatedChannels;
+  private boolean m_enabled = false;
+  private Counter m_counter = null;
+  private Ultrasonic m_nextSensor = null;
+  // task doing the round-robin automatic sensing
+  private static Thread m_task = null;
+  private Unit m_units;
+  private static int m_instances = 0;
+  protected PIDSourceType m_pidSource = PIDSourceType.kDisplacement;
+
+  /**
+   * Background task that goes through the list of ultrasonic sensors and pings each one in turn.
+   * The counter is configured to read the timing of the returned echo pulse.
+   *
+   * <p><b>DANGER WILL ROBINSON, DANGER WILL ROBINSON:</b> This code runs as a task and assumes that
+   * none of the ultrasonic sensors will change while it's running. If one does, then this will
+   * certainly break. Make sure to disable automatic mode before changing anything with the
+   * sensors!!
+   */
+  private class UltrasonicChecker extends Thread {
+    @Override
+    public synchronized void run() {
+      Ultrasonic ultrasonic = null;
+      while (m_automaticEnabled) {
+        if (ultrasonic == null) {
+          ultrasonic = m_firstSensor;
+        }
+        if (ultrasonic == null) {
+          return;
+        }
+        if (ultrasonic.isEnabled()) {
+          // Do the ping
+          ultrasonic.m_pingChannel.pulse(kPingTime);
+        }
+        ultrasonic = ultrasonic.m_nextSensor;
+        Timer.delay(.1); // wait for ping to return
+      }
+    }
+  }
+
+  /**
+   * Initialize the Ultrasonic Sensor. This is the common code that initializes the ultrasonic
+   * sensor given that there are two digital I/O channels allocated. If the system was running in
+   * automatic mode (round robin) when the new sensor is added, it is stopped, the sensor is added,
+   * then automatic mode is restored.
+   */
+  private synchronized void initialize() {
+    if (m_task == null) {
+      m_task = new UltrasonicChecker();
+    }
+    final boolean originalMode = m_automaticEnabled;
+    setAutomaticMode(false); // kill task when adding a new sensor
+    m_nextSensor = m_firstSensor;
+    m_firstSensor = this;
+
+    m_counter = new Counter(m_echoChannel); // set up counter for this
+    addChild(m_counter);
+    // sensor
+    m_counter.setMaxPeriod(1.0);
+    m_counter.setSemiPeriodMode(true);
+    m_counter.reset();
+    m_enabled = true; // make it available for round robin scheduling
+    setAutomaticMode(originalMode);
+
+    m_instances++;
+    HAL.report(tResourceType.kResourceType_Ultrasonic, m_instances);
+    setName("Ultrasonic", m_echoChannel.getChannel());
+  }
+
+  /**
+   * Create an instance of the Ultrasonic Sensor. This is designed to supchannel the Daventech SRF04
+   * and Vex ultrasonic sensors.
+   *
+   * @param pingChannel The digital output channel that sends the pulse to initiate the sensor
+   *                    sending the ping.
+   * @param echoChannel The digital input channel that receives the echo. The length of time that
+   *                    the echo is high represents the round trip time of the ping, and the
+   *                    distance.
+   * @param units       The units returned in either kInches or kMilliMeters
+   */
+  public Ultrasonic(final int pingChannel, final int echoChannel, Unit units) {
+    m_pingChannel = new DigitalOutput(pingChannel);
+    m_echoChannel = new DigitalInput(echoChannel);
+    addChild(m_pingChannel);
+    addChild(m_echoChannel);
+    m_allocatedChannels = true;
+    m_units = units;
+    initialize();
+  }
+
+  /**
+   * Create an instance of the Ultrasonic Sensor. This is designed to supchannel the Daventech SRF04
+   * and Vex ultrasonic sensors. Default unit is inches.
+   *
+   * @param pingChannel The digital output channel that sends the pulse to initiate the sensor
+   *                    sending the ping.
+   * @param echoChannel The digital input channel that receives the echo. The length of time that
+   *                    the echo is high represents the round trip time of the ping, and the
+   *                    distance.
+   */
+  public Ultrasonic(final int pingChannel, final int echoChannel) {
+    this(pingChannel, echoChannel, Unit.kInches);
+  }
+
+  /**
+   * Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo channel and a
+   * DigitalOutput for the ping channel.
+   *
+   * @param pingChannel The digital output object that starts the sensor doing a ping. Requires a
+   *                    10uS pulse to start.
+   * @param echoChannel The digital input object that times the return pulse to determine the
+   *                    range.
+   * @param units       The units returned in either kInches or kMilliMeters
+   */
+  public Ultrasonic(DigitalOutput pingChannel, DigitalInput echoChannel, Unit units) {
+    requireNonNull(pingChannel, "Provided ping channel was null");
+    requireNonNull(echoChannel, "Provided echo channel was null");
+
+    m_allocatedChannels = false;
+    m_pingChannel = pingChannel;
+    m_echoChannel = echoChannel;
+    m_units = units;
+    initialize();
+  }
+
+  /**
+   * Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo channel and a
+   * DigitalOutput for the ping channel. Default unit is inches.
+   *
+   * @param pingChannel The digital output object that starts the sensor doing a ping. Requires a
+   *                    10uS pulse to start.
+   * @param echoChannel The digital input object that times the return pulse to determine the
+   *                    range.
+   */
+  public Ultrasonic(DigitalOutput pingChannel, DigitalInput echoChannel) {
+    this(pingChannel, echoChannel, Unit.kInches);
+  }
+
+  /**
+   * Destructor for the ultrasonic sensor. Delete the instance of the ultrasonic sensor by freeing
+   * the allocated digital channels. If the system was in automatic mode (round robin), then it is
+   * stopped, then started again after this sensor is removed (provided this wasn't the last
+   * sensor).
+   */
+  @Override
+  public synchronized void free() {
+    super.free();
+    final boolean wasAutomaticMode = m_automaticEnabled;
+    setAutomaticMode(false);
+    if (m_allocatedChannels) {
+      if (m_pingChannel != null) {
+        m_pingChannel.free();
+      }
+      if (m_echoChannel != null) {
+        m_echoChannel.free();
+      }
+    }
+
+    if (m_counter != null) {
+      m_counter.free();
+      m_counter = null;
+    }
+
+    m_pingChannel = null;
+    m_echoChannel = null;
+
+    if (this == m_firstSensor) {
+      m_firstSensor = m_nextSensor;
+      if (m_firstSensor == null) {
+        setAutomaticMode(false);
+      }
+    } else {
+      for (Ultrasonic s = m_firstSensor; s != null; s = s.m_nextSensor) {
+        if (this == s.m_nextSensor) {
+          s.m_nextSensor = s.m_nextSensor.m_nextSensor;
+          break;
+        }
+      }
+    }
+    if (m_firstSensor != null && wasAutomaticMode) {
+      setAutomaticMode(true);
+    }
+  }
+
+  /**
+   * Turn Automatic mode on/off. When in Automatic mode, all sensors will fire in round robin,
+   * waiting a set time between each sensor.
+   *
+   * @param enabling Set to true if round robin scheduling should start for all the ultrasonic
+   *                 sensors. This scheduling method assures that the sensors are non-interfering
+   *                 because no two sensors fire at the same time. If another scheduling algorithm
+   *                 is preferred, it can be implemented by pinging the sensors manually and waiting
+   *                 for the results to come back.
+   */
+  public void setAutomaticMode(boolean enabling) {
+    if (enabling == m_automaticEnabled) {
+      return; // ignore the case of no change
+    }
+    m_automaticEnabled = enabling;
+
+    if (enabling) {
+      /* Clear all the counters so no data is valid. No synchronization is
+       * needed because the background task is stopped.
+       */
+      for (Ultrasonic u = m_firstSensor; u != null; u = u.m_nextSensor) {
+        u.m_counter.reset();
+      }
+
+      // Start round robin task
+      m_task.start();
+    } else {
+      // Wait for background task to stop running
+      try {
+        m_task.join();
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+        ex.printStackTrace();
+      }
+
+      /* Clear all the counters (data now invalid) since automatic mode is
+       * disabled. No synchronization is needed because the background task is
+       * stopped.
+       */
+      for (Ultrasonic u = m_firstSensor; u != null; u = u.m_nextSensor) {
+        u.m_counter.reset();
+      }
+    }
+  }
+
+  /**
+   * Single ping to ultrasonic sensor. Send out a single ping to the ultrasonic sensor. This only
+   * works if automatic (round robin) mode is disabled. A single ping is sent out, and the counter
+   * should count the semi-period when it comes in. The counter is reset to make the current value
+   * invalid.
+   */
+  public void ping() {
+    setAutomaticMode(false); // turn off automatic round robin if pinging
+    // single sensor
+    m_counter.reset(); // reset the counter to zero (invalid data now)
+    // do the ping to start getting a single range
+    m_pingChannel.pulse(kPingTime);
+  }
+
+  /**
+   * Check if there is a valid range measurement. The ranges are accumulated in a counter that will
+   * increment on each edge of the echo (return) signal. If the count is not at least 2, then the
+   * range has not yet been measured, and is invalid.
+   *
+   * @return true if the range is valid
+   */
+  public boolean isRangeValid() {
+    return m_counter.get() > 1;
+  }
+
+  /**
+   * Get the range in inches from the ultrasonic sensor. If there is no valid value yet, i.e. at
+   * least one measurement hasn't completed, then return 0.
+   *
+   * @return double Range in inches of the target returned from the ultrasonic sensor.
+   */
+  public double getRangeInches() {
+    if (isRangeValid()) {
+      return m_counter.getPeriod() * kSpeedOfSoundInchesPerSec / 2.0;
+    } else {
+      return 0;
+    }
+  }
+
+  /**
+   * Get the range in millimeters from the ultrasonic sensor. If there is no valid value yet, i.e.
+   * at least one measurement hasn't completed, then return 0.
+   *
+   * @return double Range in millimeters of the target returned by the ultrasonic sensor.
+   */
+  public double getRangeMM() {
+    return getRangeInches() * 25.4;
+  }
+
+  @Override
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    if (!pidSource.equals(PIDSourceType.kDisplacement)) {
+      throw new IllegalArgumentException("Only displacement PID is allowed for ultrasonics.");
+    }
+    m_pidSource = pidSource;
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_pidSource;
+  }
+
+  /**
+   * Get the range in the current DistanceUnit for the PIDSource base object.
+   *
+   * @return The range in DistanceUnit
+   */
+  @Override
+  public double pidGet() {
+    switch (m_units) {
+      case kInches:
+        return getRangeInches();
+      case kMillimeters:
+        return getRangeMM();
+      default:
+        return 0.0;
+    }
+  }
+
+  /**
+   * Set the current DistanceUnit that should be used for the PIDSource base object.
+   *
+   * @param units The DistanceUnit that should be used.
+   */
+  public void setDistanceUnits(Unit units) {
+    m_units = units;
+  }
+
+  /**
+   * Get the current DistanceUnit that is used for the PIDSource base object.
+   *
+   * @return The type of DistanceUnit that is being used.
+   */
+  public Unit getDistanceUnits() {
+    return m_units;
+  }
+
+  /**
+   * Is the ultrasonic enabled.
+   *
+   * @return true if the ultrasonic is enabled
+   */
+  public boolean isEnabled() {
+    return m_enabled;
+  }
+
+  /**
+   * Set if the ultrasonic is enabled.
+   *
+   * @param enable set to true to enable the ultrasonic
+   */
+  public void setEnabled(boolean enable) {
+    m_enabled = enable;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Ultrasonic");
+    builder.addDoubleProperty("Value", this::getRangeInches, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Utility.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Utility.java
new file mode 100644
index 0000000..26c9e69
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Utility.java
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.HALUtil;
+
+/**
+ * Contains global utility functions.
+ * @deprecated Use RobotController class instead
+ */
+@Deprecated
+public final class Utility {
+  private Utility() {
+  }
+
+  /**
+   * Return the FPGA Version number. For now, expect this to be 2009.
+   *
+   * @return FPGA Version number.
+   * @deprecated Use RobotController.getFPGAVersion()
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  @Deprecated
+  int getFPGAVersion() {
+    return HALUtil.getFPGAVersion();
+  }
+
+  /**
+   * Return the FPGA Revision number. The format of the revision is 3 numbers. The 12 most
+   * significant bits are the Major Revision. the next 8 bits are the Minor Revision. The 12 least
+   * significant bits are the Build Number.
+   *
+   * @return FPGA Revision number.
+   * @deprecated Use RobotController.getFPGARevision()
+   */
+  @SuppressWarnings("AbbreviationAsWordInName")
+  @Deprecated
+  long getFPGARevision() {
+    return (long) HALUtil.getFPGARevision();
+  }
+
+  /**
+   * Read the microsecond timer from the FPGA.
+   *
+   * @return The current time in microseconds according to the FPGA.
+   * @deprecated Use RobotController.getFPGATime()
+   */
+  @Deprecated
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public static long getFPGATime() {
+    return HALUtil.getFPGATime();
+  }
+
+  /**
+   * Get the state of the "USER" button on the roboRIO.
+   *
+   * @return true if the button is currently pressed down
+   * @deprecated Use RobotController.getUserButton()
+   */
+  @Deprecated
+  public static boolean getUserButton() {
+    return HALUtil.getFPGAButton();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Victor.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Victor.java
new file mode 100644
index 0000000..886e07d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/Victor.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * VEX Robotics Victor 888 Speed Controller The Vex Robotics Victor 884 Speed Controller can also
+ * be used with this class but may need to be calibrated per the Victor 884 user manual.
+ */
+public class Victor extends PWMSpeedController {
+  /**
+   * Constructor.
+   *
+   * <p>Note that the Victor uses the following bounds for PWM values. These values were determined
+   * empirically and optimized for the Victor 888. These values should work reasonably well for
+   * Victor 884 controllers also but if users experience issues such as asymmetric behaviour around
+   * the deadband or inability to saturate the controller in either direction, calibration is
+   * recommended. The calibration procedure can be found in the Victor 884 User Manual available
+   * from VEX Robotics: http://content.vexrobotics.com/docs/ifi-v884-users-manual-9-25-06.pdf
+   *
+   * <p>- 2.027ms = full "forward" - 1.525ms = the "high end" of the deadband range - 1.507ms =
+   * center of the deadband range (off) - 1.49ms = the "low end" of the deadband range - 1.026ms =
+   * full "reverse"
+   *
+   * @param channel The PWM channel that the Victor is attached to. 0-9 are
+   *        on-board, 10-19 are on the MXP port
+   */
+  public Victor(final int channel) {
+    super(channel);
+
+    setBounds(2.027, 1.525, 1.507, 1.49, 1.026);
+    setPeriodMultiplier(PeriodMultiplier.k2X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_Victor, getChannel());
+    setName("Victor", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/VictorSP.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/VictorSP.java
new file mode 100644
index 0000000..88e6414
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/VictorSP.java
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * VEX Robotics Victor SP Speed Controller.
+ */
+public class VictorSP extends PWMSpeedController {
+  /**
+   * Constructor.
+   *
+   * <p>Note that the VictorSP uses the following bounds for PWM values. These values should work
+   * reasonably well for most controllers, but if users experience issues such as asymmetric
+   * behavior around the deadband or inability to saturate the controller in either direction,
+   * calibration is recommended. The calibration procedure can be found in the VictorSP User Manual
+   * available from CTRE.
+   *
+   * <p>- 2.004ms = full "forward" - 1.52ms = the "high end" of the deadband range - 1.50ms =
+   * center of the deadband range (off) - 1.48ms = the "low end" of the deadband range - .997ms =
+   * full "reverse"
+   *
+   * @param channel The PWM channel that the VictorSP is attached to. 0-9 are
+   *        on-board, 10-19 are on the MXP port
+   */
+  public VictorSP(final int channel) {
+    super(channel);
+
+    setBounds(2.004, 1.52, 1.50, 1.48, .997);
+    setPeriodMultiplier(PeriodMultiplier.k1X);
+    setSpeed(0.0);
+    setZeroLatch();
+
+    HAL.report(tResourceType.kResourceType_VictorSP, getChannel());
+    setName("VictorSP", getChannel());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/XboxController.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/XboxController.java
new file mode 100644
index 0000000..140ce36
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/XboxController.java
@@ -0,0 +1,346 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * Handle input from Xbox 360 or Xbox One controllers connected to the Driver Station.
+ *
+ * <p>This class handles Xbox input that comes from the Driver Station. Each time a value is
+ * requested the most recent value is returned. There is a single class instance for each controller
+ * and the mapping of ports to hardware buttons depends on the code in the Driver Station.
+ */
+public class XboxController extends GenericHID {
+  /**
+   * Represents a digital button on an XboxController.
+   */
+  private enum Button {
+    kBumperLeft(5),
+    kBumperRight(6),
+    kStickLeft(9),
+    kStickRight(10),
+    kA(1),
+    kB(2),
+    kX(3),
+    kY(4),
+    kBack(7),
+    kStart(8);
+
+    @SuppressWarnings("MemberName")
+    private int value;
+
+    Button(int value) {
+      this.value = value;
+    }
+  }
+
+  /**
+   * Construct an instance of a joystick. The joystick index is the USB port on the drivers
+   * station.
+   *
+   * @param port The port on the Driver Station that the joystick is plugged into.
+   */
+  public XboxController(final int port) {
+    super(port);
+
+    // HAL.report(tResourceType.kResourceType_XboxController, port);
+    HAL.report(tResourceType.kResourceType_Joystick, port);
+  }
+
+  /**
+   * Get the X axis value of the controller.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return The X axis value of the controller.
+   */
+  @Override
+  public double getX(Hand hand) {
+    if (hand.equals(Hand.kLeft)) {
+      return getRawAxis(0);
+    } else {
+      return getRawAxis(4);
+    }
+  }
+
+  /**
+   * Get the Y axis value of the controller.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return The Y axis value of the controller.
+   */
+  @Override
+  public double getY(Hand hand) {
+    if (hand.equals(Hand.kLeft)) {
+      return getRawAxis(1);
+    } else {
+      return getRawAxis(5);
+    }
+  }
+
+  /**
+   * Get the trigger axis value of the controller.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return The trigger axis value of the controller.
+   */
+  public double getTriggerAxis(Hand hand) {
+    if (hand.equals(Hand.kLeft)) {
+      return getRawAxis(2);
+    } else {
+      return getRawAxis(3);
+    }
+  }
+
+  /**
+   * Read the value of the bumper button on the controller.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return The state of the button.
+   */
+  public boolean getBumper(Hand hand) {
+    if (hand.equals(Hand.kLeft)) {
+      return getRawButton(Button.kBumperLeft.value);
+    } else {
+      return getRawButton(Button.kBumperRight.value);
+    }
+  }
+
+  /**
+   * Whether the bumper was pressed since the last check.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getBumperPressed(Hand hand) {
+    if (hand == Hand.kLeft) {
+      return getRawButtonPressed(Button.kBumperLeft.value);
+    } else {
+      return getRawButtonPressed(Button.kBumperRight.value);
+    }
+  }
+
+  /**
+   * Whether the bumper was released since the last check.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getBumperReleased(Hand hand) {
+    if (hand == Hand.kLeft) {
+      return getRawButtonReleased(Button.kBumperLeft.value);
+    } else {
+      return getRawButtonReleased(Button.kBumperRight.value);
+    }
+  }
+
+  /**
+   * Read the value of the stick button on the controller.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return The state of the button.
+   */
+  public boolean getStickButton(Hand hand) {
+    if (hand.equals(Hand.kLeft)) {
+      return getRawButton(Button.kStickLeft.value);
+    } else {
+      return getRawButton(Button.kStickRight.value);
+    }
+  }
+
+  /**
+   * Whether the stick button was pressed since the last check.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getStickButtonPressed(Hand hand) {
+    if (hand == Hand.kLeft) {
+      return getRawButtonPressed(Button.kStickLeft.value);
+    } else {
+      return getRawButtonPressed(Button.kStickRight.value);
+    }
+  }
+
+  /**
+   * Whether the stick button was released since the last check.
+   *
+   * @param hand Side of controller whose value should be returned.
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getStickButtonReleased(Hand hand) {
+    if (hand == Hand.kLeft) {
+      return getRawButtonReleased(Button.kStickLeft.value);
+    } else {
+      return getRawButtonReleased(Button.kStickRight.value);
+    }
+  }
+
+  /**
+   * Read the value of the A button on the controller.
+   *
+   * @return The state of the button.
+   */
+  public boolean getAButton() {
+    return getRawButton(Button.kA.value);
+  }
+
+  /**
+   * Whether the A button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getAButtonPressed() {
+    return getRawButtonPressed(Button.kA.value);
+  }
+
+  /**
+   * Whether the A button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getAButtonReleased() {
+    return getRawButtonReleased(Button.kA.value);
+  }
+
+  /**
+   * Read the value of the B button on the controller.
+   *
+   * @return The state of the button.
+   */
+  public boolean getBButton() {
+    return getRawButton(Button.kB.value);
+  }
+
+  /**
+   * Whether the B button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getBButtonPressed() {
+    return getRawButtonPressed(Button.kB.value);
+  }
+
+  /**
+   * Whether the B button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getBButtonReleased() {
+    return getRawButtonReleased(Button.kB.value);
+  }
+
+  /**
+   * Read the value of the X button on the controller.
+   *
+   * @return The state of the button.
+   */
+  public boolean getXButton() {
+    return getRawButton(Button.kX.value);
+  }
+
+  /**
+   * Whether the X button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getXButtonPressed() {
+    return getRawButtonPressed(Button.kX.value);
+  }
+
+  /**
+   * Whether the X button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getXButtonReleased() {
+    return getRawButtonReleased(Button.kX.value);
+  }
+
+  /**
+   * Read the value of the Y button on the controller.
+   *
+   * @return The state of the button.
+   */
+  public boolean getYButton() {
+    return getRawButton(Button.kY.value);
+  }
+
+  /**
+   * Whether the Y button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getYButtonPressed() {
+    return getRawButtonPressed(Button.kY.value);
+  }
+
+  /**
+   * Whether the Y button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getYButtonReleased() {
+    return getRawButtonReleased(Button.kY.value);
+  }
+
+  /**
+   * Read the value of the back button on the controller.
+   *
+   * @return The state of the button.
+   */
+  public boolean getBackButton() {
+    return getRawButton(Button.kBack.value);
+  }
+
+  /**
+   * Whether the back button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getBackButtonPressed() {
+    return getRawButtonPressed(Button.kBack.value);
+  }
+
+  /**
+   * Whether the back button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getBackButtonReleased() {
+    return getRawButtonReleased(Button.kBack.value);
+  }
+
+  /**
+   * Read the value of the start button on the controller.
+   *
+   * @return The state of the button.
+   */
+  public boolean getStartButton() {
+    return getRawButton(Button.kStart.value);
+  }
+
+  /**
+   * Whether the start button was pressed since the last check.
+   *
+   * @return Whether the button was pressed since the last check.
+   */
+  public boolean getStartButtonPressed() {
+    return getRawButtonPressed(Button.kStart.value);
+  }
+
+  /**
+   * Whether the start button was released since the last check.
+   *
+   * @return Whether the button was released since the last check.
+   */
+  public boolean getStartButtonReleased() {
+    return getRawButtonReleased(Button.kStart.value);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/Button.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/Button.java
new file mode 100644
index 0000000..a7dc2fa
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/Button.java
@@ -0,0 +1,70 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.buttons;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ * This class provides an easy way to link commands to OI inputs.
+ *
+ * <p>It is very easy to link a button to a command. For instance, you could link the trigger button
+ * of a joystick to a "score" command.
+ *
+ * <p>This class represents a subclass of Trigger that is specifically aimed at buttons on an
+ * operator interface as a common use case of the more generalized Trigger objects. This is a simple
+ * wrapper around Trigger with the method names renamed to fit the Button object use.
+ */
+public abstract class Button extends Trigger {
+  /**
+   * Starts the given command whenever the button is newly pressed.
+   *
+   * @param command the command to start
+   */
+  public void whenPressed(final Command command) {
+    whenActive(command);
+  }
+
+  /**
+   * Constantly starts the given command while the button is held.
+   *
+   * {@link Command#start()} will be called repeatedly while the button is held, and will be
+   * canceled when the button is released.
+   *
+   * @param command the command to start
+   */
+  public void whileHeld(final Command command) {
+    whileActive(command);
+  }
+
+  /**
+   * Starts the command when the button is released.
+   *
+   * @param command the command to start
+   */
+  public void whenReleased(final Command command) {
+    whenInactive(command);
+  }
+
+  /**
+   * Toggles the command whenever the button is pressed (on then off then on).
+   *
+   * @param command the command to start
+   */
+  public void toggleWhenPressed(final Command command) {
+    toggleWhenActive(command);
+  }
+
+  /**
+   * Cancel the command when the button is pressed.
+   *
+   * @param command the command to start
+   */
+  public void cancelWhenPressed(final Command command) {
+    cancelWhenActive(command);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/InternalButton.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/InternalButton.java
new file mode 100644
index 0000000..a44df17
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/InternalButton.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.buttons;
+
+/**
+ * This class is intended to be used within a program. The programmer can manually set its value.
+ * Also includes a setting for whether or not it should invert its value.
+ */
+public class InternalButton extends Button {
+  private boolean m_pressed;
+  private boolean m_inverted;
+
+  /**
+   * Creates an InternalButton that is not inverted.
+   */
+  public InternalButton() {
+    this(false);
+  }
+
+  /**
+   * Creates an InternalButton which is inverted depending on the input.
+   *
+   * @param inverted if false, then this button is pressed when set to true, otherwise it is pressed
+   *                 when set to false.
+   */
+  public InternalButton(boolean inverted) {
+    m_pressed = m_inverted = inverted;
+  }
+
+  public void setInverted(boolean inverted) {
+    m_inverted = inverted;
+  }
+
+  public void setPressed(boolean pressed) {
+    m_pressed = pressed;
+  }
+
+  public boolean get() {
+    return m_pressed ^ m_inverted;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/JoystickButton.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/JoystickButton.java
new file mode 100644
index 0000000..516f6ad
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/JoystickButton.java
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.buttons;
+
+import edu.wpi.first.wpilibj.GenericHID;
+
+/**
+ * A {@link Button} that gets its state from a {@link GenericHID}.
+ */
+public class JoystickButton extends Button {
+  private final GenericHID m_joystick;
+  private final int m_buttonNumber;
+
+  /**
+   * Create a joystick button for triggering commands.
+   *
+   * @param joystick     The GenericHID object that has the button (e.g. Joystick, KinectStick,
+   *                     etc)
+   * @param buttonNumber The button number (see {@link GenericHID#getRawButton(int) }
+   */
+  public JoystickButton(GenericHID joystick, int buttonNumber) {
+    m_joystick = joystick;
+    m_buttonNumber = buttonNumber;
+  }
+
+  /**
+   * Gets the value of the joystick button.
+   *
+   * @return The value of the joystick button
+   */
+  public boolean get() {
+    return m_joystick.getRawButton(m_buttonNumber);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/NetworkButton.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/NetworkButton.java
new file mode 100644
index 0000000..90a1593
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/NetworkButton.java
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.buttons;
+
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+
+/**
+ * A {@link Button} that uses a {@link NetworkTable} boolean field.
+ */
+public class NetworkButton extends Button {
+  private final NetworkTableEntry m_entry;
+
+  public NetworkButton(String table, String field) {
+    this(NetworkTableInstance.getDefault().getTable(table), field);
+  }
+
+  public NetworkButton(NetworkTable table, String field) {
+    m_entry = table.getEntry(field);
+  }
+
+  public boolean get() {
+    return m_entry.getInstance().isConnected() && m_entry.getBoolean(false);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java
new file mode 100644
index 0000000..6541562
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/buttons/Trigger.java
@@ -0,0 +1,198 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.buttons;
+
+import edu.wpi.first.wpilibj.SendableBase;
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * This class provides an easy way to link commands to inputs.
+ *
+ * <p>It is very easy to link a button to a command. For instance, you could link the trigger
+ * button of a joystick to a "score" command.
+ *
+ * <p>It is encouraged that teams write a subclass of Trigger if they want to have something unusual
+ * (for instance, if they want to react to the user holding a button while the robot is reading a
+ * certain sensor input). For this, they only have to write the {@link Trigger#get()} method to get
+ * the full functionality of the Trigger class.
+ */
+public abstract class Trigger extends SendableBase {
+  private volatile boolean m_sendablePressed = false;
+
+  /**
+   * Returns whether or not the trigger is active.
+   *
+   * <p>This method will be called repeatedly a command is linked to the Trigger.
+   *
+   * @return whether or not the trigger condition is active.
+   */
+  public abstract boolean get();
+
+  /**
+   * Returns whether get() return true or the internal table for SmartDashboard use is pressed.
+   *
+   * @return whether get() return true or the internal table for SmartDashboard use is pressed.
+   */
+  @SuppressWarnings("PMD.UselessParentheses")
+  private boolean grab() {
+    return get() || m_sendablePressed;
+  }
+
+  /**
+   * Starts the given command whenever the trigger just becomes active.
+   *
+   * @param command the command to start
+   */
+  public void whenActive(final Command command) {
+    new ButtonScheduler() {
+
+      private boolean m_pressedLast = grab();
+
+      @Override
+      public void execute() {
+        if (grab()) {
+          if (!m_pressedLast) {
+            m_pressedLast = true;
+            command.start();
+          }
+        } else {
+          m_pressedLast = false;
+        }
+      }
+    }.start();
+  }
+
+  /**
+   * Constantly starts the given command while the button is held.
+   *
+   * {@link Command#start()} will be called repeatedly while the trigger is active, and will be
+   * canceled when the trigger becomes inactive.
+   *
+   * @param command the command to start
+   */
+  public void whileActive(final Command command) {
+    new ButtonScheduler() {
+
+      private boolean m_pressedLast = grab();
+
+      @Override
+      public void execute() {
+        if (grab()) {
+          m_pressedLast = true;
+          command.start();
+        } else {
+          if (m_pressedLast) {
+            m_pressedLast = false;
+            command.cancel();
+          }
+        }
+      }
+    }.start();
+  }
+
+  /**
+   * Starts the command when the trigger becomes inactive.
+   *
+   * @param command the command to start
+   */
+  public void whenInactive(final Command command) {
+    new ButtonScheduler() {
+
+      private boolean m_pressedLast = grab();
+
+      @Override
+      public void execute() {
+        if (grab()) {
+          m_pressedLast = true;
+        } else {
+          if (m_pressedLast) {
+            m_pressedLast = false;
+            command.start();
+          }
+        }
+      }
+    }.start();
+  }
+
+  /**
+   * Toggles a command when the trigger becomes active.
+   *
+   * @param command the command to toggle
+   */
+  public void toggleWhenActive(final Command command) {
+    new ButtonScheduler() {
+
+      private boolean m_pressedLast = grab();
+
+      @Override
+      public void execute() {
+        if (grab()) {
+          if (!m_pressedLast) {
+            m_pressedLast = true;
+            if (command.isRunning()) {
+              command.cancel();
+            } else {
+              command.start();
+            }
+          }
+        } else {
+          m_pressedLast = false;
+        }
+      }
+    }.start();
+  }
+
+  /**
+   * Cancels a command when the trigger becomes active.
+   *
+   * @param command the command to cancel
+   */
+  public void cancelWhenActive(final Command command) {
+    new ButtonScheduler() {
+
+      private boolean m_pressedLast = grab();
+
+      @Override
+      public void execute() {
+        if (grab()) {
+          if (!m_pressedLast) {
+            m_pressedLast = true;
+            command.cancel();
+          }
+        } else {
+          m_pressedLast = false;
+        }
+      }
+    }.start();
+  }
+
+  /**
+   * An internal class of {@link Trigger}. The user should ignore this, it is only public to
+   * interface between packages.
+   */
+  public abstract class ButtonScheduler {
+    public abstract void execute();
+
+    protected void start() {
+      Scheduler.getInstance().addButton(this);
+    }
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Button");
+    builder.setSafeState(() -> {
+      m_sendablePressed = false;
+    });
+    builder.addBooleanProperty("pressed", this::grab, (value) -> {
+      m_sendablePressed = value;
+    });
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANExceptionFactory.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANExceptionFactory.java
new file mode 100644
index 0000000..79670cf
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANExceptionFactory.java
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+import edu.wpi.first.wpilibj.communication.NIRioStatus;
+import edu.wpi.first.wpilibj.util.UncleanStatusException;
+
+public class CANExceptionFactory {
+  // FRC Error codes
+  static final int ERR_CANSessionMux_InvalidBuffer = -44086;
+  static final int ERR_CANSessionMux_MessageNotFound = -44087;
+  static final int ERR_CANSessionMux_NotAllowed = -44088;
+  static final int ERR_CANSessionMux_NotInitialized = -44089;
+
+  @SuppressWarnings("JavadocMethod")
+  public static void checkStatus(int status, int messageID) throws CANInvalidBufferException,
+      CANMessageNotAllowedException, CANNotInitializedException, UncleanStatusException {
+    switch (status) {
+      case NIRioStatus.kRioStatusSuccess:
+        // Everything is ok... don't throw.
+        return;
+      case ERR_CANSessionMux_InvalidBuffer:
+      case NIRioStatus.kRIOStatusBufferInvalidSize:
+        throw new CANInvalidBufferException();
+      case ERR_CANSessionMux_MessageNotFound:
+      case NIRioStatus.kRIOStatusOperationTimedOut:
+        throw new CANMessageNotFoundException();
+      case ERR_CANSessionMux_NotAllowed:
+      case NIRioStatus.kRIOStatusFeatureNotSupported:
+        throw new CANMessageNotAllowedException("MessageID = " + Integer.toString(messageID));
+      case ERR_CANSessionMux_NotInitialized:
+      case NIRioStatus.kRIOStatusResourceNotInitialized:
+        throw new CANNotInitializedException();
+      default:
+        throw new UncleanStatusException("Fatal status code detected:  " + Integer.toString(
+            status));
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANInvalidBufferException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANInvalidBufferException.java
new file mode 100644
index 0000000..3ce53bf
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANInvalidBufferException.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+/**
+ * Exception indicating that a CAN driver library entry-point was passed an invalid buffer.
+ * Typically, this is due to a buffer being too small to include the needed safety token.
+ */
+public class CANInvalidBufferException extends RuntimeException {
+  public CANInvalidBufferException() {
+    super();
+  }
+
+  public CANInvalidBufferException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANJNI.java
new file mode 100644
index 0000000..2430776
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANJNI.java
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+import java.nio.ByteBuffer;
+import java.nio.IntBuffer;
+
+import edu.wpi.first.wpilibj.hal.JNIWrapper;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class CANJNI extends JNIWrapper {
+  public static final int CAN_SEND_PERIOD_NO_REPEAT = 0;
+  public static final int CAN_SEND_PERIOD_STOP_REPEATING = -1;
+
+  /* Flags in the upper bits of the messageID */
+  public static final int CAN_IS_FRAME_REMOTE = 0x80000000;
+  public static final int CAN_IS_FRAME_11BIT = 0x40000000;
+
+  @SuppressWarnings("MethodName")
+  public static native void FRCNetCommCANSessionMuxSendMessage(int messageID,
+                                                               byte[] data,
+                                                               int periodMs);
+
+  @SuppressWarnings("MethodName")
+  public static native byte[] FRCNetCommCANSessionMuxReceiveMessage(
+      IntBuffer messageID, int messageIDMask, ByteBuffer timeStamp);
+
+
+  @SuppressWarnings("MethodName")
+  public static native void GetCANStatus(CANStatus status);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANMessageNotAllowedException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANMessageNotAllowedException.java
new file mode 100644
index 0000000..7977aa4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANMessageNotAllowedException.java
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+/**
+ * Exception indicating that the Jaguar CAN Driver layer refused to send a restricted message ID to
+ * the CAN bus.
+ */
+public class CANMessageNotAllowedException extends RuntimeException {
+  public CANMessageNotAllowedException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANMessageNotFoundException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANMessageNotFoundException.java
new file mode 100644
index 0000000..d6f6f12
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANMessageNotFoundException.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+/**
+ * Exception indicating that a can message is not available from Network Communications. This
+ * usually just means we already have the most recent value cached locally.
+ */
+public class CANMessageNotFoundException extends RuntimeException {
+  public CANMessageNotFoundException() {
+    super();
+  }
+
+  public CANMessageNotFoundException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANNotInitializedException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANNotInitializedException.java
new file mode 100644
index 0000000..16079b4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANNotInitializedException.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+/**
+ * Exception indicating that the CAN driver layer has not been initialized. This happens when an
+ * entry-point is called before a CAN driver plugin has been installed.
+ */
+public class CANNotInitializedException extends RuntimeException {
+  public CANNotInitializedException() {
+    super();
+  }
+
+  public CANNotInitializedException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANStatus.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANStatus.java
new file mode 100644
index 0000000..d9c2920
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/can/CANStatus.java
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+/**
+ * Structure for holding the result of a CAN Status request.
+ */
+public class CANStatus {
+  /**
+   * The utilization of the CAN Bus.
+   */
+  @SuppressWarnings("MemberName")
+  public double percentBusUtilization;
+
+  /**
+   * The CAN Bus off count.
+   */
+  @SuppressWarnings("MemberName")
+  public int busOffCount;
+
+  /**
+   * The CAN Bus TX full count.
+   */
+  @SuppressWarnings("MemberName")
+  public int txFullCount;
+
+  /**
+   * The CAN Bus receive error count.
+   */
+  @SuppressWarnings("MemberName")
+  public int receiveErrorCount;
+
+  /**
+   * The CAN Bus transmit error count.
+   */
+  @SuppressWarnings("MemberName")
+  public int transmitErrorCount;
+
+  @SuppressWarnings("JavadocMethod")
+  public void setStatus(double percentBusUtilization, int busOffCount, int txFullCount,
+                        int receiveErrorCount, int transmitErrorCount) {
+    this.percentBusUtilization = percentBusUtilization;
+    this.busOffCount = busOffCount;
+    this.txFullCount = txFullCount;
+    this.receiveErrorCount = receiveErrorCount;
+    this.transmitErrorCount = transmitErrorCount;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Command.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Command.java
new file mode 100644
index 0000000..cdcbc9d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Command.java
@@ -0,0 +1,572 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import java.util.Enumeration;
+
+import edu.wpi.first.wpilibj.RobotState;
+import edu.wpi.first.wpilibj.Sendable;
+import edu.wpi.first.wpilibj.SendableBase;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * The Command class is at the very core of the entire command framework. Every command can be
+ * started with a call to {@link Command#start() start()}. Once a command is started it will call
+ * {@link Command#initialize() initialize()}, and then will repeatedly call {@link Command#execute()
+ * execute()} until the {@link Command#isFinished() isFinished()} returns true. Once it does, {@link
+ * Command#end() end()} will be called.
+ *
+ * <p>However, if at any point while it is running {@link Command#cancel() cancel()} is called,
+ * then the command will be stopped and {@link Command#interrupted() interrupted()} will be called.
+ *
+ * <p>If a command uses a {@link Subsystem}, then it should specify that it does so by calling the
+ * {@link Command#requires(Subsystem) requires(...)} method in its constructor. Note that a Command
+ * may have multiple requirements, and {@link Command#requires(Subsystem) requires(...)} should be
+ * called for each one.
+ *
+ * <p>If a command is running and a new command with shared requirements is started, then one of
+ * two things will happen. If the active command is interruptible, then {@link Command#cancel()
+ * cancel()} will be called and the command will be removed to make way for the new one. If the
+ * active command is not interruptible, the other one will not even be started, and the active one
+ * will continue functioning.
+ *
+ * @see Subsystem
+ * @see CommandGroup
+ * @see IllegalUseOfCommandException
+ */
+public abstract class Command extends SendableBase implements Sendable {
+  /**
+   * The time since this command was initialized.
+   */
+  private double m_startTime = -1;
+
+  /**
+   * The time (in seconds) before this command "times out" (or -1 if no timeout).
+   */
+  private double m_timeout = -1;
+
+  /**
+   * Whether or not this command has been initialized.
+   */
+  private boolean m_initialized = false;
+
+  /**
+   * The required subsystems.
+   */
+  private final Set m_requirements = new Set();
+
+  /**
+   * Whether or not it is running.
+   */
+  private boolean m_running = false;
+
+  /**
+   * Whether or not it is interruptible.
+   */
+  private boolean m_interruptible = true;
+
+  /**
+   * Whether or not it has been canceled.
+   */
+  private boolean m_canceled = false;
+
+  /**
+   * Whether or not it has been locked.
+   */
+  private boolean m_locked = false;
+
+  /**
+   * Whether this command should run when the robot is disabled.
+   */
+  private boolean m_runWhenDisabled = false;
+
+  /**
+   * Whether or not this command has completed running.
+   */
+  private boolean m_completed = false;
+
+  /**
+   * The {@link CommandGroup} this is in.
+   */
+  private CommandGroup m_parent;
+
+  /**
+   * Creates a new command. The name of this command will be set to its class name.
+   */
+  public Command() {
+    super(false);
+    String name = getClass().getName();
+    setName(name.substring(name.lastIndexOf('.') + 1));
+  }
+
+  /**
+   * Creates a new command with the given name.
+   *
+   * @param name the name for this command
+   * @throws IllegalArgumentException if name is null
+   */
+  public Command(String name) {
+    super(false);
+    if (name == null) {
+      throw new IllegalArgumentException("Name must not be null.");
+    }
+    setName(name);
+  }
+
+  /**
+   * Creates a new command with the given timeout and a default name. The default name is the name
+   * of the class.
+   *
+   * @param timeout the time (in seconds) before this command "times out"
+   * @throws IllegalArgumentException if given a negative timeout
+   * @see Command#isTimedOut() isTimedOut()
+   */
+  public Command(double timeout) {
+    this();
+    if (timeout < 0) {
+      throw new IllegalArgumentException("Timeout must not be negative.  Given:" + timeout);
+    }
+    m_timeout = timeout;
+  }
+
+  /**
+   * Creates a new command with the given name and timeout.
+   *
+   * @param name    the name of the command
+   * @param timeout the time (in seconds) before this command "times out"
+   * @throws IllegalArgumentException if given a negative timeout or name was null.
+   * @see Command#isTimedOut() isTimedOut()
+   */
+  public Command(String name, double timeout) {
+    this(name);
+    if (timeout < 0) {
+      throw new IllegalArgumentException("Timeout must not be negative.  Given:" + timeout);
+    }
+    m_timeout = timeout;
+  }
+
+  /**
+   * Sets the timeout of this command.
+   *
+   * @param seconds the timeout (in seconds)
+   * @throws IllegalArgumentException if seconds is negative
+   * @see Command#isTimedOut() isTimedOut()
+   */
+  protected final synchronized void setTimeout(double seconds) {
+    if (seconds < 0) {
+      throw new IllegalArgumentException("Seconds must be positive.  Given:" + seconds);
+    }
+    m_timeout = seconds;
+  }
+
+  /**
+   * Returns the time since this command was initialized (in seconds). This function will work even
+   * if there is no specified timeout.
+   *
+   * @return the time since this command was initialized (in seconds).
+   */
+  public final synchronized double timeSinceInitialized() {
+    return m_startTime < 0 ? 0 : Timer.getFPGATimestamp() - m_startTime;
+  }
+
+  /**
+   * This method specifies that the given {@link Subsystem} is used by this command. This method is
+   * crucial to the functioning of the Command System in general.
+   *
+   * <p>Note that the recommended way to call this method is in the constructor.
+   *
+   * @param subsystem the {@link Subsystem} required
+   * @throws IllegalArgumentException     if subsystem is null
+   * @throws IllegalUseOfCommandException if this command has started before or if it has been given
+   *                                      to a {@link CommandGroup}
+   * @see Subsystem
+   */
+  protected synchronized void requires(Subsystem subsystem) {
+    validate("Can not add new requirement to command");
+    if (subsystem != null) {
+      m_requirements.add(subsystem);
+    } else {
+      throw new IllegalArgumentException("Subsystem must not be null.");
+    }
+  }
+
+  /**
+   * Called when the command has been removed. This will call {@link Command#interrupted()
+   * interrupted()} or {@link Command#end() end()}.
+   */
+  synchronized void removed() {
+    if (m_initialized) {
+      if (isCanceled()) {
+        interrupted();
+        _interrupted();
+      } else {
+        end();
+        _end();
+      }
+    }
+    m_initialized = false;
+    m_canceled = false;
+    m_running = false;
+    m_completed = true;
+  }
+
+  /**
+   * The run method is used internally to actually run the commands.
+   *
+   * @return whether or not the command should stay within the {@link Scheduler}.
+   */
+  synchronized boolean run() {
+    if (!m_runWhenDisabled && m_parent == null && RobotState.isDisabled()) {
+      cancel();
+    }
+    if (isCanceled()) {
+      return false;
+    }
+    if (!m_initialized) {
+      m_initialized = true;
+      startTiming();
+      _initialize();
+      initialize();
+    }
+    _execute();
+    execute();
+    return !isFinished();
+  }
+
+  /**
+   * The initialize method is called the first time this Command is run after being started.
+   */
+  protected void initialize() {}
+
+  /**
+   * A shadow method called before {@link Command#initialize() initialize()}.
+   */
+  @SuppressWarnings("MethodName")
+  void _initialize() {
+  }
+
+  /**
+   * The execute method is called repeatedly until this Command either finishes or is canceled.
+   */
+  @SuppressWarnings("MethodName")
+  protected void execute() {}
+
+  /**
+   * A shadow method called before {@link Command#execute() execute()}.
+   */
+  @SuppressWarnings("MethodName")
+  void _execute() {
+  }
+
+  /**
+   * Returns whether this command is finished. If it is, then the command will be removed and {@link
+   * Command#end() end()} will be called.
+   *
+   * <p>It may be useful for a team to reference the {@link Command#isTimedOut() isTimedOut()}
+   * method for time-sensitive commands.
+   *
+   * <p>Returning false will result in the command never ending automatically. It may still be
+   * cancelled manually or interrupted by another command. Returning true will result in the
+   * command executing once and finishing immediately. We recommend using {@link InstantCommand}
+   * for this.
+   *
+   * @return whether this command is finished.
+   * @see Command#isTimedOut() isTimedOut()
+   */
+  protected abstract boolean isFinished();
+
+  /**
+   * Called when the command ended peacefully. This is where you may want to wrap up loose ends,
+   * like shutting off a motor that was being used in the command.
+   */
+  protected void end() {}
+
+  /**
+   * A shadow method called after {@link Command#end() end()}.
+   */
+  @SuppressWarnings("MethodName")
+  void _end() {
+  }
+
+  /**
+   * Called when the command ends because somebody called {@link Command#cancel() cancel()} or
+   * another command shared the same requirements as this one, and booted it out.
+   *
+   * <p>This is where you may want to wrap up loose ends, like shutting off a motor that was being
+   * used in the command.
+   *
+   * <p>Generally, it is useful to simply call the {@link Command#end() end()} method within this
+   * method, as done here.
+   */
+  protected void interrupted() {
+    end();
+  }
+
+  /**
+   * A shadow method called after {@link Command#interrupted() interrupted()}.
+   */
+  @SuppressWarnings("MethodName")
+  void _interrupted() {}
+
+  /**
+   * Called to indicate that the timer should start. This is called right before {@link
+   * Command#initialize() initialize()} is, inside the {@link Command#run() run()} method.
+   */
+  private void startTiming() {
+    m_startTime = Timer.getFPGATimestamp();
+  }
+
+  /**
+   * Returns whether or not the {@link Command#timeSinceInitialized() timeSinceInitialized()} method
+   * returns a number which is greater than or equal to the timeout for the command. If there is no
+   * timeout, this will always return false.
+   *
+   * @return whether the time has expired
+   */
+  protected synchronized boolean isTimedOut() {
+    return m_timeout != -1 && timeSinceInitialized() >= m_timeout;
+  }
+
+  /**
+   * Returns the requirements (as an {@link Enumeration Enumeration} of {@link Subsystem
+   * Subsystems}) of this command.
+   *
+   * @return the requirements (as an {@link Enumeration Enumeration} of {@link Subsystem
+   * Subsystems}) of this command
+   */
+  synchronized Enumeration getRequirements() {
+    return m_requirements.getElements();
+  }
+
+  /**
+   * Prevents further changes from being made.
+   */
+  synchronized void lockChanges() {
+    m_locked = true;
+  }
+
+  /**
+   * If changes are locked, then this will throw an {@link IllegalUseOfCommandException}.
+   *
+   * @param message the message to say (it is appended by a default message)
+   */
+  synchronized void validate(String message) {
+    if (m_locked) {
+      throw new IllegalUseOfCommandException(message
+          + " after being started or being added to a command group");
+    }
+  }
+
+  /**
+   * Sets the parent of this command. No actual change is made to the group.
+   *
+   * @param parent the parent
+   * @throws IllegalUseOfCommandException if this {@link Command} already is already in a group
+   */
+  synchronized void setParent(CommandGroup parent) {
+    if (m_parent != null) {
+      throw new IllegalUseOfCommandException(
+          "Can not give command to a command group after already being put in a command group");
+    }
+    lockChanges();
+    m_parent = parent;
+  }
+
+  /**
+   * Returns whether the command has a parent.
+   *
+   * @param True if the command has a parent.
+   */
+  synchronized boolean isParented() {
+    return m_parent != null;
+  }
+
+  /**
+   * Clears list of subsystem requirements. This is only used by
+   * {@link ConditionalCommand} so cancelling the chosen command works properly
+   * in {@link CommandGroup}.
+   */
+  protected void clearRequirements() {
+    m_requirements.clear();
+  }
+
+  /**
+   * Starts up the command. Gets the command ready to start. <p> Note that the command will
+   * eventually start, however it will not necessarily do so immediately, and may in fact be
+   * canceled before initialize is even called. </p>
+   *
+   * @throws IllegalUseOfCommandException if the command is a part of a CommandGroup
+   */
+  public synchronized void start() {
+    lockChanges();
+    if (m_parent != null) {
+      throw new IllegalUseOfCommandException(
+          "Can not start a command that is a part of a command group");
+    }
+    Scheduler.getInstance().add(this);
+    m_completed = false;
+  }
+
+  /**
+   * This is used internally to mark that the command has been started. The lifecycle of a command
+   * is:
+   *
+   * <p>startRunning() is called. run() is called (multiple times potentially) removed() is called.
+   *
+   * <p>It is very important that startRunning and removed be called in order or some assumptions of
+   * the code will be broken.
+   */
+  synchronized void startRunning() {
+    m_running = true;
+    m_startTime = -1;
+  }
+
+  /**
+   * Returns whether or not the command is running. This may return true even if the command has
+   * just been canceled, as it may not have yet called {@link Command#interrupted()}.
+   *
+   * @return whether or not the command is running
+   */
+  public synchronized boolean isRunning() {
+    return m_running;
+  }
+
+  /**
+   * This will cancel the current command. <p> This will cancel the current command eventually. It
+   * can be called multiple times. And it can be called when the command is not running. If the
+   * command is running though, then the command will be marked as canceled and eventually removed.
+   * </p> <p> A command can not be canceled if it is a part of a command group, you must cancel the
+   * command group instead. </p>
+   *
+   * @throws IllegalUseOfCommandException if this command is a part of a command group
+   */
+  public synchronized void cancel() {
+    if (m_parent != null) {
+      throw new IllegalUseOfCommandException("Can not manually cancel a command in a command "
+          + "group");
+    }
+    _cancel();
+  }
+
+  /**
+   * This works like cancel(), except that it doesn't throw an exception if it is a part of a
+   * command group. Should only be called by the parent command group.
+   */
+  @SuppressWarnings("MethodName")
+  synchronized void _cancel() {
+    if (isRunning()) {
+      m_canceled = true;
+    }
+  }
+
+  /**
+   * Returns whether or not this has been canceled.
+   *
+   * @return whether or not this has been canceled
+   */
+  public synchronized boolean isCanceled() {
+    return m_canceled;
+  }
+
+  /**
+   * Whether or not this command has completed running.
+   *
+   * @return whether or not this command has completed running.
+   */
+  public synchronized boolean isCompleted() {
+    return m_completed;
+  }
+
+  /**
+   * Returns whether or not this command can be interrupted.
+   *
+   * @return whether or not this command can be interrupted
+   */
+  public synchronized boolean isInterruptible() {
+    return m_interruptible;
+  }
+
+  /**
+   * Sets whether or not this command can be interrupted.
+   *
+   * @param interruptible whether or not this command can be interrupted
+   */
+  protected synchronized void setInterruptible(boolean interruptible) {
+    m_interruptible = interruptible;
+  }
+
+  /**
+   * Checks if the command requires the given {@link Subsystem}.
+   *
+   * @param system the system
+   * @return whether or not the subsystem is required, or false if given null
+   */
+  public synchronized boolean doesRequire(Subsystem system) {
+    return m_requirements.contains(system);
+  }
+
+  /**
+   * Returns the {@link CommandGroup} that this command is a part of. Will return null if this
+   * {@link Command} is not in a group.
+   *
+   * @return the {@link CommandGroup} that this command is a part of (or null if not in group)
+   */
+  public synchronized CommandGroup getGroup() {
+    return m_parent;
+  }
+
+  /**
+   * Sets whether or not this {@link Command} should run when the robot is disabled.
+   *
+   * <p>By default a command will not run when the robot is disabled, and will in fact be canceled.
+   *
+   * @param run whether or not this command should run when the robot is disabled
+   */
+  public void setRunWhenDisabled(boolean run) {
+    m_runWhenDisabled = run;
+  }
+
+  /**
+   * Returns whether or not this {@link Command} will run when the robot is disabled, or if it will
+   * cancel itself.
+   *
+   * @return True if this command will run when the robot is disabled.
+   */
+  public boolean willRunWhenDisabled() {
+    return m_runWhenDisabled;
+  }
+
+  /**
+   * The string representation for a {@link Command} is by default its name.
+   *
+   * @return the string representation of this object
+   */
+  @Override
+  public String toString() {
+    return getName();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Command");
+    builder.addStringProperty(".name", this::getName, null);
+    builder.addBooleanProperty("running", this::isRunning, (value) -> {
+      if (value) {
+        if (!isRunning()) {
+          start();
+        }
+      } else {
+        if (isRunning()) {
+          cancel();
+        }
+      }
+    });
+    builder.addBooleanProperty(".isParented", this::isParented, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/CommandGroup.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/CommandGroup.java
new file mode 100644
index 0000000..4cc2ac4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/CommandGroup.java
@@ -0,0 +1,410 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * A {@link CommandGroup} is a list of commands which are executed in sequence.
+ *
+ * <p> Commands in a {@link CommandGroup} are added using the {@link
+ * CommandGroup#addSequential(Command) addSequential(...)} method and are called sequentially.
+ * {@link CommandGroup CommandGroups} are themselves {@link Command commands} and can be given to
+ * other {@link CommandGroup CommandGroups}. </p>
+ *
+ * <p> {@link CommandGroup CommandGroups} will carry all of the requirements of their {@link Command
+ * subcommands}. Additional requirements can be specified by calling {@link
+ * CommandGroup#requires(Subsystem) requires(...)} normally in the constructor. </P>
+ *
+ * <p> CommandGroups can also execute commands in parallel, simply by adding them using {@link
+ * CommandGroup#addParallel(Command) addParallel(...)}. </p>
+ *
+ * @see Command
+ * @see Subsystem
+ * @see IllegalUseOfCommandException
+ */
+public class CommandGroup extends Command {
+  /**
+   * The commands in this group (stored in entries).
+   */
+  private final Vector<Entry> m_commands = new Vector<>();
+  /*
+   * Intentionally package private
+   */
+  /**
+   * The active children in this group (stored in entries).
+   */
+  final Vector<Entry> m_children = new Vector<>();
+  /**
+   * The current command, -1 signifies that none have been run.
+   */
+  private int m_currentCommandIndex = -1;
+
+  /**
+   * Creates a new {@link CommandGroup CommandGroup}. The name of this command will be set to its
+   * class name.
+   */
+  public CommandGroup() {
+  }
+
+  /**
+   * Creates a new {@link CommandGroup CommandGroup} with the given name.
+   *
+   * @param name the name for this command group
+   * @throws IllegalArgumentException if name is null
+   */
+  public CommandGroup(String name) {
+    super(name);
+  }
+
+  /**
+   * Adds a new {@link Command Command} to the group. The {@link Command Command} will be started
+   * after all the previously added {@link Command Commands}.
+   *
+   * <p> Note that any requirements the given {@link Command Command} has will be added to the
+   * group. For this reason, a {@link Command Command's} requirements can not be changed after being
+   * added to a group. </p>
+   *
+   * <p> It is recommended that this method be called in the constructor. </p>
+   *
+   * @param command The {@link Command Command} to be added
+   * @throws IllegalUseOfCommandException if the group has been started before or been given to
+   *                                      another group
+   * @throws IllegalArgumentException     if command is null
+   */
+  public final synchronized void addSequential(Command command) {
+    validate("Can not add new command to command group");
+    if (command == null) {
+      throw new IllegalArgumentException("Given null command");
+    }
+
+    command.setParent(this);
+
+    m_commands.addElement(new Entry(command, Entry.IN_SEQUENCE));
+    for (Enumeration e = command.getRequirements(); e.hasMoreElements(); ) {
+      requires((Subsystem) e.nextElement());
+    }
+  }
+
+  /**
+   * Adds a new {@link Command Command} to the group with a given timeout. The {@link Command
+   * Command} will be started after all the previously added commands.
+   *
+   * <p> Once the {@link Command Command} is started, it will be run until it finishes or the time
+   * expires, whichever is sooner. Note that the given {@link Command Command} will have no
+   * knowledge that it is on a timer. </p>
+   *
+   * <p> Note that any requirements the given {@link Command Command} has will be added to the
+   * group. For this reason, a {@link Command Command's} requirements can not be changed after being
+   * added to a group. </p>
+   *
+   * <p> It is recommended that this method be called in the constructor. </p>
+   *
+   * @param command The {@link Command Command} to be added
+   * @param timeout The timeout (in seconds)
+   * @throws IllegalUseOfCommandException if the group has been started before or been given to
+   *                                      another group or if the {@link Command Command} has been
+   *                                      started before or been given to another group
+   * @throws IllegalArgumentException     if command is null or timeout is negative
+   */
+  public final synchronized void addSequential(Command command, double timeout) {
+    validate("Can not add new command to command group");
+    if (command == null) {
+      throw new IllegalArgumentException("Given null command");
+    }
+    if (timeout < 0) {
+      throw new IllegalArgumentException("Can not be given a negative timeout");
+    }
+
+    command.setParent(this);
+
+    m_commands.addElement(new Entry(command, Entry.IN_SEQUENCE, timeout));
+    for (Enumeration e = command.getRequirements(); e.hasMoreElements(); ) {
+      requires((Subsystem) e.nextElement());
+    }
+  }
+
+  /**
+   * Adds a new child {@link Command} to the group. The {@link Command} will be started after all
+   * the previously added {@link Command Commands}.
+   *
+   * <p> Instead of waiting for the child to finish, a {@link CommandGroup} will have it run at the
+   * same time as the subsequent {@link Command Commands}. The child will run until either it
+   * finishes, a new child with conflicting requirements is started, or the main sequence runs a
+   * {@link Command} with conflicting requirements. In the latter two cases, the child will be
+   * canceled even if it says it can't be interrupted. </p>
+   *
+   * <p> Note that any requirements the given {@link Command Command} has will be added to the
+   * group. For this reason, a {@link Command Command's} requirements can not be changed after being
+   * added to a group. </p>
+   *
+   * <p> It is recommended that this method be called in the constructor. </p>
+   *
+   * @param command The command to be added
+   * @throws IllegalUseOfCommandException if the group has been started before or been given to
+   *                                      another command group
+   * @throws IllegalArgumentException     if command is null
+   */
+  public final synchronized void addParallel(Command command) {
+    requireNonNull(command, "Provided command was null");
+    validate("Can not add new command to command group");
+
+    command.setParent(this);
+
+    m_commands.addElement(new Entry(command, Entry.BRANCH_CHILD));
+    for (Enumeration e = command.getRequirements(); e.hasMoreElements(); ) {
+      requires((Subsystem) e.nextElement());
+    }
+  }
+
+  /**
+   * Adds a new child {@link Command} to the group with the given timeout. The {@link Command} will
+   * be started after all the previously added {@link Command Commands}.
+   *
+   * <p> Once the {@link Command Command} is started, it will run until it finishes, is interrupted,
+   * or the time expires, whichever is sooner. Note that the given {@link Command Command} will have
+   * no knowledge that it is on a timer. </p>
+   *
+   * <p> Instead of waiting for the child to finish, a {@link CommandGroup} will have it run at the
+   * same time as the subsequent {@link Command Commands}. The child will run until either it
+   * finishes, the timeout expires, a new child with conflicting requirements is started, or the
+   * main sequence runs a {@link Command} with conflicting requirements. In the latter two cases,
+   * the child will be canceled even if it says it can't be interrupted. </p>
+   *
+   * <p> Note that any requirements the given {@link Command Command} has will be added to the
+   * group. For this reason, a {@link Command Command's} requirements can not be changed after being
+   * added to a group. </p>
+   *
+   * <p> It is recommended that this method be called in the constructor. </p>
+   *
+   * @param command The command to be added
+   * @param timeout The timeout (in seconds)
+   * @throws IllegalUseOfCommandException if the group has been started before or been given to
+   *                                      another command group
+   * @throws IllegalArgumentException     if command is null
+   */
+  public final synchronized void addParallel(Command command, double timeout) {
+    requireNonNull(command, "Provided command was null");
+    if (timeout < 0) {
+      throw new IllegalArgumentException("Can not be given a negative timeout");
+    }
+    validate("Can not add new command to command group");
+
+    command.setParent(this);
+
+    m_commands.addElement(new Entry(command, Entry.BRANCH_CHILD, timeout));
+    for (Enumeration e = command.getRequirements(); e.hasMoreElements(); ) {
+      requires((Subsystem) e.nextElement());
+    }
+  }
+
+  @SuppressWarnings("MethodName")
+  void _initialize() {
+    m_currentCommandIndex = -1;
+  }
+
+  @SuppressWarnings("MethodName")
+  void _execute() {
+    Entry entry = null;
+    Command cmd = null;
+    boolean firstRun = false;
+    if (m_currentCommandIndex == -1) {
+      firstRun = true;
+      m_currentCommandIndex = 0;
+    }
+
+    while (m_currentCommandIndex < m_commands.size()) {
+
+      if (cmd != null) {
+        if (entry.isTimedOut()) {
+          cmd._cancel();
+        }
+        if (cmd.run()) {
+          break;
+        } else {
+          cmd.removed();
+          m_currentCommandIndex++;
+          firstRun = true;
+          cmd = null;
+          continue;
+        }
+      }
+
+      entry = m_commands.elementAt(m_currentCommandIndex);
+      cmd = null;
+
+      switch (entry.m_state) {
+        case Entry.IN_SEQUENCE:
+          cmd = entry.m_command;
+          if (firstRun) {
+            cmd.startRunning();
+            cancelConflicts(cmd);
+          }
+          firstRun = false;
+          break;
+        case Entry.BRANCH_PEER:
+          m_currentCommandIndex++;
+          entry.m_command.start();
+          break;
+        case Entry.BRANCH_CHILD:
+          m_currentCommandIndex++;
+          cancelConflicts(entry.m_command);
+          entry.m_command.startRunning();
+          m_children.addElement(entry);
+          break;
+        default:
+          break;
+      }
+    }
+
+    // Run Children
+    for (int i = 0; i < m_children.size(); i++) {
+      entry = m_children.elementAt(i);
+      Command child = entry.m_command;
+      if (entry.isTimedOut()) {
+        child._cancel();
+      }
+      if (!child.run()) {
+        child.removed();
+        m_children.removeElementAt(i--);
+      }
+    }
+  }
+
+  @SuppressWarnings("MethodName")
+  void _end() {
+    // Theoretically, we don't have to check this, but we do if teams override
+    // the isFinished method
+    if (m_currentCommandIndex != -1 && m_currentCommandIndex < m_commands.size()) {
+      Command cmd = m_commands.elementAt(m_currentCommandIndex).m_command;
+      cmd._cancel();
+      cmd.removed();
+    }
+
+    Enumeration children = m_children.elements();
+    while (children.hasMoreElements()) {
+      Command cmd = ((Entry) children.nextElement()).m_command;
+      cmd._cancel();
+      cmd.removed();
+    }
+    m_children.removeAllElements();
+  }
+
+  @SuppressWarnings("MethodName")
+  void _interrupted() {
+    _end();
+  }
+
+  /**
+   * Returns true if all the {@link Command Commands} in this group have been started and have
+   * finished.
+   *
+   * <p> Teams may override this method, although they should probably reference super.isFinished()
+   * if they do. </p>
+   *
+   * @return whether this {@link CommandGroup} is finished
+   */
+  protected boolean isFinished() {
+    return m_currentCommandIndex >= m_commands.size() && m_children.isEmpty();
+  }
+
+  // Can be overwritten by teams
+  protected void initialize() {
+  }
+
+  // Can be overwritten by teams
+  protected void execute() {
+  }
+
+  // Can be overwritten by teams
+  protected void end() {
+  }
+
+  // Can be overwritten by teams
+  protected void interrupted() {
+  }
+
+  /**
+   * Returns whether or not this group is interruptible. A command group will be uninterruptible if
+   * {@link CommandGroup#setInterruptible(boolean) setInterruptable(false)} was called or if it is
+   * currently running an uninterruptible command or child.
+   *
+   * @return whether or not this {@link CommandGroup} is interruptible.
+   */
+  public synchronized boolean isInterruptible() {
+    if (!super.isInterruptible()) {
+      return false;
+    }
+
+    if (m_currentCommandIndex != -1 && m_currentCommandIndex < m_commands.size()) {
+      Command cmd = m_commands.elementAt(m_currentCommandIndex).m_command;
+      if (!cmd.isInterruptible()) {
+        return false;
+      }
+    }
+
+    for (int i = 0; i < m_children.size(); i++) {
+      if (!m_children.elementAt(i).m_command.isInterruptible()) {
+        return false;
+      }
+    }
+
+    return true;
+  }
+
+  private void cancelConflicts(Command command) {
+    for (int i = 0; i < m_children.size(); i++) {
+      Command child = m_children.elementAt(i).m_command;
+
+      Enumeration requirements = command.getRequirements();
+
+      while (requirements.hasMoreElements()) {
+        Object requirement = requirements.nextElement();
+        if (child.doesRequire((Subsystem) requirement)) {
+          child._cancel();
+          child.removed();
+          m_children.removeElementAt(i--);
+          break;
+        }
+      }
+    }
+  }
+
+  private static class Entry {
+    private static final int IN_SEQUENCE = 0;
+    private static final int BRANCH_PEER = 1;
+    private static final int BRANCH_CHILD = 2;
+    private final Command m_command;
+    private final int m_state;
+    private final double m_timeout;
+
+    Entry(Command command, int state) {
+      m_command = command;
+      m_state = state;
+      m_timeout = -1;
+    }
+
+    Entry(Command command, int state, double timeout) {
+      m_command = command;
+      m_state = state;
+      m_timeout = timeout;
+    }
+
+    boolean isTimedOut() {
+      if (m_timeout == -1) {
+        return false;
+      } else {
+        double time = m_command.timeSinceInitialized();
+        return time != 0 && time >= m_timeout;
+      }
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/ConditionalCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/ConditionalCommand.java
new file mode 100644
index 0000000..9d06d3d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/ConditionalCommand.java
@@ -0,0 +1,175 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import java.util.Enumeration;
+
+/**
+ * A {@link ConditionalCommand} is a {@link Command} that starts one of two commands.
+ *
+ * <p>
+ * A {@link ConditionalCommand} uses m_condition to determine whether it should run m_onTrue or
+ * m_onFalse.
+ * </p>
+ *
+ * <p>
+ * A {@link ConditionalCommand} adds the proper {@link Command} to the {@link Scheduler} during
+ * {@link ConditionalCommand#initialize()} and then {@link ConditionalCommand#isFinished()} will
+ * return true once that {@link Command} has finished executing.
+ * </p>
+ *
+ * <p>
+ * If no {@link Command} is specified for m_onFalse, the occurrence of that condition will be a
+ * no-op.
+ * </p>
+ *
+ * @see Command
+ * @see Scheduler
+ */
+public abstract class ConditionalCommand extends Command {
+  /**
+   * The Command to execute if {@link ConditionalCommand#condition()} returns true.
+   */
+  private Command m_onTrue;
+
+  /**
+   * The Command to execute if {@link ConditionalCommand#condition()} returns false.
+   */
+  private Command m_onFalse;
+
+  /**
+   * Stores command chosen by condition.
+   */
+  private Command m_chosenCommand = null;
+
+  private void requireAll() {
+    if (m_onTrue != null) {
+      for (Enumeration e = m_onTrue.getRequirements(); e.hasMoreElements(); ) {
+        requires((Subsystem) e.nextElement());
+      }
+    }
+
+    if (m_onFalse != null) {
+      for (Enumeration e = m_onFalse.getRequirements(); e.hasMoreElements(); ) {
+        requires((Subsystem) e.nextElement());
+      }
+    }
+  }
+
+  /**
+   * Creates a new ConditionalCommand with given onTrue and onFalse Commands.
+   *
+   * <p>Users of this constructor should also override condition().
+   *
+   * @param onTrue The Command to execute if {@link ConditionalCommand#condition()} returns true
+   */
+  public ConditionalCommand(Command onTrue) {
+    this(onTrue, null);
+  }
+
+  /**
+   * Creates a new ConditionalCommand with given onTrue and onFalse Commands.
+   *
+   * <p>Users of this constructor should also override condition().
+   *
+   * @param onTrue The Command to execute if {@link ConditionalCommand#condition()} returns true
+   * @param onFalse The Command to execute if {@link ConditionalCommand#condition()} returns false
+   */
+  public ConditionalCommand(Command onTrue, Command onFalse) {
+    m_onTrue = onTrue;
+    m_onFalse = onFalse;
+
+    requireAll();
+  }
+
+  /**
+   * Creates a new ConditionalCommand with given name and onTrue and onFalse Commands.
+   *
+   * <p>Users of this constructor should also override condition().
+   *
+   * @param name the name for this command group
+   * @param onTrue The Command to execute if {@link ConditionalCommand#condition()} returns true
+   */
+  public ConditionalCommand(String name, Command onTrue) {
+    this(name, onTrue, null);
+  }
+
+  /**
+   * Creates a new ConditionalCommand with given name and onTrue and onFalse Commands.
+   *
+   * <p>Users of this constructor should also override condition().
+   *
+   * @param name the name for this command group
+   * @param onTrue The Command to execute if {@link ConditionalCommand#condition()} returns true
+   * @param onFalse The Command to execute if {@link ConditionalCommand#condition()} returns false
+   */
+  public ConditionalCommand(String name, Command onTrue, Command onFalse) {
+    super(name);
+    m_onTrue = onTrue;
+    m_onFalse = onFalse;
+
+    requireAll();
+  }
+
+  /**
+   * The Condition to test to determine which Command to run.
+   *
+   * @return true if m_onTrue should be run or false if m_onFalse should be run.
+   */
+  protected abstract boolean condition();
+
+  /**
+   * Calls {@link ConditionalCommand#condition()} and runs the proper command.
+   */
+  @Override
+  protected void _initialize() {
+    if (condition()) {
+      m_chosenCommand = m_onTrue;
+    } else {
+      m_chosenCommand = m_onFalse;
+    }
+
+    if (m_chosenCommand != null) {
+      /*
+       * This is a hack to make cancelling the chosen command inside a
+       * CommandGroup work properly
+       */
+      m_chosenCommand.clearRequirements();
+
+      m_chosenCommand.start();
+    }
+    super._initialize();
+  }
+
+  @Override
+  protected void _cancel() {
+    if (m_chosenCommand != null && m_chosenCommand.isRunning()) {
+      m_chosenCommand.cancel();
+    }
+
+    super._cancel();
+  }
+
+  @Override
+  protected boolean isFinished() {
+    if (m_chosenCommand != null) {
+      return m_chosenCommand.isCompleted();
+    } else {
+      return true;
+    }
+  }
+
+  @Override
+  protected void _interrupted() {
+    if (m_chosenCommand != null && m_chosenCommand.isRunning()) {
+      m_chosenCommand.cancel();
+    }
+
+    super._interrupted();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/IllegalUseOfCommandException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/IllegalUseOfCommandException.java
new file mode 100644
index 0000000..59f6e9c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/IllegalUseOfCommandException.java
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * This exception will be thrown if a command is used illegally. There are several ways for this to
+ * happen.
+ *
+ * <p> Basically, a command becomes "locked" after it is first started or added to a command group.
+ * </p>
+ *
+ * <p> This exception should be thrown if (after a command has been locked) its requirements change,
+ * it is put into multiple command groups, it is started from outside its command group, or it adds
+ * a new child. </p>
+ */
+public class IllegalUseOfCommandException extends RuntimeException {
+  /**
+   * Instantiates an {@link IllegalUseOfCommandException}.
+   */
+  public IllegalUseOfCommandException() {
+  }
+
+  /**
+   * Instantiates an {@link IllegalUseOfCommandException} with the given message.
+   *
+   * @param message the message
+   */
+  public IllegalUseOfCommandException(String message) {
+    super(message);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/InstantCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/InstantCommand.java
new file mode 100644
index 0000000..ca27472
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/InstantCommand.java
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * This command will execute once, then finish immediately afterward.
+ *
+ * <p>Subclassing {@link InstantCommand} is shorthand for returning true from
+ * {@link Command isFinished}.
+ */
+public class InstantCommand extends Command {
+  public InstantCommand() {
+  }
+
+  /**
+   * Creates a new {@link InstantCommand InstantCommand} with the given name.
+   * @param name the name for this command
+   */
+  public InstantCommand(String name) {
+    super(name);
+  }
+
+  protected boolean isFinished() {
+    return true;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/LinkedListElement.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/LinkedListElement.java
new file mode 100644
index 0000000..e717a47
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/LinkedListElement.java
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * An element that is in a LinkedList.
+ */
+class LinkedListElement {
+  private LinkedListElement m_next;
+  private LinkedListElement m_previous;
+  private Command m_data;
+
+  public void setData(Command newData) {
+    m_data = newData;
+  }
+
+  public Command getData() {
+    return m_data;
+  }
+
+  public LinkedListElement getNext() {
+    return m_next;
+  }
+
+  public LinkedListElement getPrevious() {
+    return m_previous;
+  }
+
+  public void add(LinkedListElement listElement) {
+    if (m_next == null) {
+      m_next = listElement;
+      m_next.m_previous = this;
+    } else {
+      m_next.m_previous = listElement;
+      listElement.m_next = m_next;
+      listElement.m_previous = this;
+      m_next = listElement;
+    }
+  }
+
+  @SuppressWarnings("PMD.EmptyIfStmt")
+  public LinkedListElement remove() {
+    if (m_previous == null && m_next == null) {
+      // no-op
+    } else if (m_next == null) {
+      m_previous.m_next = null;
+    } else if (m_previous == null) {
+      m_next.m_previous = null;
+    } else {
+      m_next.m_previous = m_previous;
+      m_previous.m_next = m_next;
+    }
+    LinkedListElement returnNext = m_next;
+    m_next = null;
+    m_previous = null;
+    return returnNext;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java
new file mode 100644
index 0000000..0569fa6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PIDCommand.java
@@ -0,0 +1,217 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import edu.wpi.first.wpilibj.PIDController;
+import edu.wpi.first.wpilibj.PIDOutput;
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.Sendable;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * This class defines a {@link Command} which interacts heavily with a PID loop.
+ *
+ * <p> It provides some convenience methods to run an internal {@link PIDController} . It will also
+ * start and stop said {@link PIDController} when the {@link PIDCommand} is first initialized and
+ * ended/interrupted. </p>
+ */
+public abstract class PIDCommand extends Command implements Sendable {
+  /**
+   * The internal {@link PIDController}.
+   */
+  private final PIDController m_controller;
+  /**
+   * An output which calls {@link PIDCommand#usePIDOutput(double)}.
+   */
+  private final PIDOutput m_output = this::usePIDOutput;
+  /**
+   * A source which calls {@link PIDCommand#returnPIDInput()}.
+   */
+  private final PIDSource m_source = new PIDSource() {
+    public void setPIDSourceType(PIDSourceType pidSource) {
+    }
+
+    public PIDSourceType getPIDSourceType() {
+      return PIDSourceType.kDisplacement;
+    }
+
+    public double pidGet() {
+      return returnPIDInput();
+    }
+  };
+
+  /**
+   * Instantiates a {@link PIDCommand} that will use the given p, i and d values.
+   *
+   * @param name the name of the command
+   * @param p    the proportional value
+   * @param i    the integral value
+   * @param d    the derivative value
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDCommand(String name, double p, double i, double d) {
+    super(name);
+    m_controller = new PIDController(p, i, d, m_source, m_output);
+  }
+
+  /**
+   * Instantiates a {@link PIDCommand} that will use the given p, i and d values. It will also space
+   * the time between PID loop calculations to be equal to the given period.
+   *
+   * @param name   the name
+   * @param p      the proportional value
+   * @param i      the integral value
+   * @param d      the derivative value
+   * @param period the time (in seconds) between calculations
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDCommand(String name, double p, double i, double d, double period) {
+    super(name);
+    m_controller = new PIDController(p, i, d, m_source, m_output, period);
+  }
+
+  /**
+   * Instantiates a {@link PIDCommand} that will use the given p, i and d values. It will use the
+   * class name as its name.
+   *
+   * @param p the proportional value
+   * @param i the integral value
+   * @param d the derivative value
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDCommand(double p, double i, double d) {
+    m_controller = new PIDController(p, i, d, m_source, m_output);
+  }
+
+  /**
+   * Instantiates a {@link PIDCommand} that will use the given p, i and d values. It will use the
+   * class name as its name.. It will also space the time between PID loop calculations to be equal
+   * to the given period.
+   *
+   * @param p      the proportional value
+   * @param i      the integral value
+   * @param d      the derivative value
+   * @param period the time (in seconds) between calculations
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDCommand(double p, double i, double d, double period) {
+    m_controller = new PIDController(p, i, d, m_source, m_output, period);
+  }
+
+  /**
+   * Returns the {@link PIDController} used by this {@link PIDCommand}. Use this if you would like
+   * to fine tune the pid loop.
+   *
+   * @return the {@link PIDController} used by this {@link PIDCommand}
+   */
+  protected PIDController getPIDController() {
+    return m_controller;
+  }
+
+  @Override
+  @SuppressWarnings("MethodName")
+  void _initialize() {
+    m_controller.enable();
+  }
+
+  @Override
+  @SuppressWarnings("MethodName")
+  void _end() {
+    m_controller.disable();
+  }
+
+  @Override
+  @SuppressWarnings("MethodName")
+  void _interrupted() {
+    _end();
+  }
+
+  /**
+   * Adds the given value to the setpoint. If {@link PIDCommand#setInputRange(double, double)
+   * setInputRange(...)} was used, then the bounds will still be honored by this method.
+   *
+   * @param deltaSetpoint the change in the setpoint
+   */
+  public void setSetpointRelative(double deltaSetpoint) {
+    setSetpoint(getSetpoint() + deltaSetpoint);
+  }
+
+  /**
+   * Sets the setpoint to the given value. If {@link PIDCommand#setInputRange(double, double)
+   * setInputRange(...)} was called, then the given setpoint will be trimmed to fit within the
+   * range.
+   *
+   * @param setpoint the new setpoint
+   */
+  protected void setSetpoint(double setpoint) {
+    m_controller.setSetpoint(setpoint);
+  }
+
+  /**
+   * Returns the setpoint.
+   *
+   * @return the setpoint
+   */
+  protected double getSetpoint() {
+    return m_controller.getSetpoint();
+  }
+
+  /**
+   * Returns the current position.
+   *
+   * @return the current position
+   */
+  protected double getPosition() {
+    return returnPIDInput();
+  }
+
+  /**
+   * Sets the maximum and minimum values expected from the input and setpoint.
+   *
+   * @param minimumInput the minimum value expected from the input and setpoint
+   * @param maximumInput the maximum value expected from the input and setpoint
+   */
+  protected void setInputRange(double minimumInput, double maximumInput) {
+    m_controller.setInputRange(minimumInput, maximumInput);
+  }
+
+  /**
+   * Returns the input for the pid loop.
+   *
+   * <p>It returns the input for the pid loop, so if this command was based off of a gyro, then it
+   * should return the angle of the gyro.
+   *
+   * <p>All subclasses of {@link PIDCommand} must override this method.
+   *
+   * <p>This method will be called in a different thread then the {@link Scheduler} thread.
+   *
+   * @return the value the pid loop should use as input
+   */
+  protected abstract double returnPIDInput();
+
+  /**
+   * Uses the value that the pid loop calculated. The calculated value is the "output" parameter.
+   * This method is a good time to set motor values, maybe something along the lines of
+   * <code>driveline.tankDrive(output, -output)</code>
+   *
+   * <p>All subclasses of {@link PIDCommand} must override this method.
+   *
+   * <p>This method will be called in a different thread then the {@link Scheduler} thread.
+   *
+   * @param output the value the pid loop calculated
+   */
+  protected abstract void usePIDOutput(double output);
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    m_controller.initSendable(builder);
+    super.initSendable(builder);
+    builder.setSmartDashboardType("PIDCommand");
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java
new file mode 100644
index 0000000..e2edfb9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PIDSubsystem.java
@@ -0,0 +1,284 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import edu.wpi.first.wpilibj.PIDController;
+import edu.wpi.first.wpilibj.PIDOutput;
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.Sendable;
+
+/**
+ * This class is designed to handle the case where there is a {@link Subsystem} which uses a single
+ * {@link PIDController} almost constantly (for instance, an elevator which attempts to stay at a
+ * constant height).
+ *
+ * <p>It provides some convenience methods to run an internal {@link PIDController} . It also
+ * allows access to the internal {@link PIDController} in order to give total control to the
+ * programmer.
+ */
+public abstract class PIDSubsystem extends Subsystem implements Sendable {
+  /**
+   * The internal {@link PIDController}.
+   */
+  private final PIDController m_controller;
+  /**
+   * An output which calls {@link PIDCommand#usePIDOutput(double)}.
+   */
+  private final PIDOutput m_output = this::usePIDOutput;
+
+  /**
+   * A source which calls {@link PIDCommand#returnPIDInput()}.
+   */
+  private final PIDSource m_source = new PIDSource() {
+    public void setPIDSourceType(PIDSourceType pidSource) {
+    }
+
+    public PIDSourceType getPIDSourceType() {
+      return PIDSourceType.kDisplacement;
+    }
+
+    public double pidGet() {
+      return returnPIDInput();
+    }
+  };
+
+  /**
+   * Instantiates a {@link PIDSubsystem} that will use the given p, i and d values.
+   *
+   * @param name the name
+   * @param p    the proportional value
+   * @param i    the integral value
+   * @param d    the derivative value
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDSubsystem(String name, double p, double i, double d) {
+    super(name);
+    m_controller = new PIDController(p, i, d, m_source, m_output);
+    addChild("PIDController", m_controller);
+  }
+
+  /**
+   * Instantiates a {@link PIDSubsystem} that will use the given p, i and d values.
+   *
+   * @param name the name
+   * @param p    the proportional value
+   * @param i    the integral value
+   * @param d    the derivative value
+   * @param f    the feed forward value
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDSubsystem(String name, double p, double i, double d, double f) {
+    super(name);
+    m_controller = new PIDController(p, i, d, f, m_source, m_output);
+    addChild("PIDController", m_controller);
+  }
+
+  /**
+   * Instantiates a {@link PIDSubsystem} that will use the given p, i and d values. It will also
+   * space the time between PID loop calculations to be equal to the given period.
+   *
+   * @param name   the name
+   * @param p      the proportional value
+   * @param i      the integral value
+   * @param d      the derivative value
+   * @param period the time (in seconds) between calculations
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDSubsystem(String name, double p, double i, double d, double f, double period) {
+    super(name);
+    m_controller = new PIDController(p, i, d, f, m_source, m_output, period);
+    addChild("PIDController", m_controller);
+  }
+
+  /**
+   * Instantiates a {@link PIDSubsystem} that will use the given p, i and d values. It will use the
+   * class name as its name.
+   *
+   * @param p the proportional value
+   * @param i the integral value
+   * @param d the derivative value
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDSubsystem(double p, double i, double d) {
+    m_controller = new PIDController(p, i, d, m_source, m_output);
+    addChild("PIDController", m_controller);
+  }
+
+  /**
+   * Instantiates a {@link PIDSubsystem} that will use the given p, i and d values. It will use the
+   * class name as its name. It will also space the time between PID loop calculations to be equal
+   * to the given period.
+   *
+   * @param p      the proportional value
+   * @param i      the integral value
+   * @param d      the derivative value
+   * @param f      the feed forward coefficient
+   * @param period the time (in seconds) between calculations
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDSubsystem(double p, double i, double d, double period, double f) {
+    m_controller = new PIDController(p, i, d, f, m_source, m_output, period);
+    addChild("PIDController", m_controller);
+  }
+
+  /**
+   * Instantiates a {@link PIDSubsystem} that will use the given p, i and d values. It will use the
+   * class name as its name. It will also space the time between PID loop calculations to be equal
+   * to the given period.
+   *
+   * @param p      the proportional value
+   * @param i      the integral value
+   * @param d      the derivative value
+   * @param period the time (in seconds) between calculations
+   */
+  @SuppressWarnings("ParameterName")
+  public PIDSubsystem(double p, double i, double d, double period) {
+    m_controller = new PIDController(p, i, d, m_source, m_output, period);
+    addChild("PIDController", m_controller);
+  }
+
+  /**
+   * Returns the {@link PIDController} used by this {@link PIDSubsystem}. Use this if you would like
+   * to fine tune the pid loop.
+   *
+   * @return the {@link PIDController} used by this {@link PIDSubsystem}
+   */
+  public PIDController getPIDController() {
+    return m_controller;
+  }
+
+
+  /**
+   * Adds the given value to the setpoint. If {@link PIDSubsystem#setInputRange(double, double)
+   * setInputRange(...)} was used, then the bounds will still be honored by this method.
+   *
+   * @param deltaSetpoint the change in the setpoint
+   */
+  public void setSetpointRelative(double deltaSetpoint) {
+    setSetpoint(getPosition() + deltaSetpoint);
+  }
+
+  /**
+   * Sets the setpoint to the given value. If {@link PIDSubsystem#setInputRange(double, double)
+   * setInputRange(...)} was called, then the given setpoint will be trimmed to fit within the
+   * range.
+   *
+   * @param setpoint the new setpoint
+   */
+  public void setSetpoint(double setpoint) {
+    m_controller.setSetpoint(setpoint);
+  }
+
+  /**
+   * Returns the setpoint.
+   *
+   * @return the setpoint
+   */
+  public double getSetpoint() {
+    return m_controller.getSetpoint();
+  }
+
+  /**
+   * Returns the current position.
+   *
+   * @return the current position
+   */
+  public double getPosition() {
+    return returnPIDInput();
+  }
+
+  /**
+   * Sets the maximum and minimum values expected from the input.
+   *
+   * @param minimumInput the minimum value expected from the input
+   * @param maximumInput the maximum value expected from the output
+   */
+  public void setInputRange(double minimumInput, double maximumInput) {
+    m_controller.setInputRange(minimumInput, maximumInput);
+  }
+
+  /**
+   * Sets the maximum and minimum values to write.
+   *
+   * @param minimumOutput the minimum value to write to the output
+   * @param maximumOutput the maximum value to write to the output
+   */
+  public void setOutputRange(double minimumOutput, double maximumOutput) {
+    m_controller.setOutputRange(minimumOutput, maximumOutput);
+  }
+
+  /**
+   * Set the absolute error which is considered tolerable for use with OnTarget. The value is in the
+   * same range as the PIDInput values.
+   *
+   * @param t the absolute tolerance
+   */
+  @SuppressWarnings("ParameterName")
+  public void setAbsoluteTolerance(double t) {
+    m_controller.setAbsoluteTolerance(t);
+  }
+
+  /**
+   * Set the percentage error which is considered tolerable for use with OnTarget. (Value of 15.0 ==
+   * 15 percent).
+   *
+   * @param p the percent tolerance
+   */
+  @SuppressWarnings("ParameterName")
+  public void setPercentTolerance(double p) {
+    m_controller.setPercentTolerance(p);
+  }
+
+  /**
+   * Return true if the error is within the percentage of the total input range, determined by
+   * setTolerance. This assumes that the maximum and minimum input were set using setInput.
+   *
+   * @return true if the error is less than the tolerance
+   */
+  public boolean onTarget() {
+    return m_controller.onTarget();
+  }
+
+  /**
+   * Returns the input for the pid loop.
+   *
+   * <p>It returns the input for the pid loop, so if this Subsystem was based off of a gyro, then
+   * it should return the angle of the gyro.
+   *
+   * <p>All subclasses of {@link PIDSubsystem} must override this method.
+   *
+   * @return the value the pid loop should use as input
+   */
+  protected abstract double returnPIDInput();
+
+  /**
+   * Uses the value that the pid loop calculated. The calculated value is the "output" parameter.
+   * This method is a good time to set motor values, maybe something along the lines of
+   * <code>driveline.tankDrive(output, -output)</code>.
+   *
+   * <p>All subclasses of {@link PIDSubsystem} must override this method.
+   *
+   * @param output the value the pid loop calculated
+   */
+  protected abstract void usePIDOutput(double output);
+
+  /**
+   * Enables the internal {@link PIDController}.
+   */
+  public void enable() {
+    m_controller.enable();
+  }
+
+  /**
+   * Disables the internal {@link PIDController}.
+   */
+  public void disable() {
+    m_controller.disable();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PrintCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PrintCommand.java
new file mode 100644
index 0000000..3582670
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/PrintCommand.java
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * A {@link PrintCommand} is a command which prints out a string when it is initialized, and then
+ * immediately finishes. It is useful if you want a {@link CommandGroup} to print out a string when
+ * it reaches a certain point.
+ */
+public class PrintCommand extends InstantCommand {
+  /**
+   * The message to print out.
+   */
+  private String m_message;
+
+  /**
+   * Instantiates a {@link PrintCommand} which will print the given message when it is run.
+   *
+   * @param message the message to print
+   */
+  public PrintCommand(String message) {
+    super("Print(\"" + message + "\"");
+    m_message = message;
+  }
+
+  protected void initialize() {
+    System.out.println(m_message);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Scheduler.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Scheduler.java
new file mode 100644
index 0000000..411d74a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Scheduler.java
@@ -0,0 +1,349 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.wpilibj.HLUsageReporting;
+import edu.wpi.first.wpilibj.Sendable;
+import edu.wpi.first.wpilibj.SendableBase;
+import edu.wpi.first.wpilibj.buttons.Trigger.ButtonScheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * The {@link Scheduler} is a singleton which holds the top-level running commands. It is in charge
+ * of both calling the command's {@link Command#run() run()} method and to make sure that there are
+ * no two commands with conflicting requirements running.
+ *
+ * <p> It is fine if teams wish to take control of the {@link Scheduler} themselves, all that needs
+ * to be done is to call {@link Scheduler#getInstance() Scheduler.getInstance()}.{@link
+ * Scheduler#run() run()} often to have {@link Command Commands} function correctly. However, this
+ * is already done for you if you use the CommandBased Robot template. </p>
+ *
+ * @see Command
+ */
+public class Scheduler extends SendableBase implements Sendable {
+  /**
+   * The Singleton Instance.
+   */
+  private static Scheduler instance;
+
+  /**
+   * Returns the {@link Scheduler}, creating it if one does not exist.
+   *
+   * @return the {@link Scheduler}
+   */
+  public static synchronized Scheduler getInstance() {
+    if (instance == null) {
+      instance = new Scheduler();
+    }
+    return instance;
+  }
+
+  /**
+   * A hashtable of active {@link Command Commands} to their {@link LinkedListElement}.
+   */
+  private Hashtable<Command, LinkedListElement> m_commandTable = new Hashtable<>();
+  /**
+   * The {@link Set} of all {@link Subsystem Subsystems}.
+   */
+  private Set m_subsystems = new Set();
+  /**
+   * The first {@link Command} in the list.
+   */
+  private LinkedListElement m_firstCommand;
+  /**
+   * The last {@link Command} in the list.
+   */
+  private LinkedListElement m_lastCommand;
+  /**
+   * Whether or not we are currently adding a command.
+   */
+  private boolean m_adding = false;
+  /**
+   * Whether or not we are currently disabled.
+   */
+  private boolean m_disabled = false;
+  /**
+   * A list of all {@link Command Commands} which need to be added.
+   */
+  private Vector<Command> m_additions = new Vector<>();
+  private NetworkTableEntry m_namesEntry;
+  private NetworkTableEntry m_idsEntry;
+  private NetworkTableEntry m_cancelEntry;
+  /**
+   * A list of all {@link edu.wpi.first.wpilibj.buttons.Trigger.ButtonScheduler Buttons}. It is
+   * created lazily.
+   */
+  private Vector<ButtonScheduler> m_buttons;
+  private boolean m_runningCommandsChanged;
+
+  /**
+   * Instantiates a {@link Scheduler}.
+   */
+  private Scheduler() {
+    HLUsageReporting.reportScheduler();
+    setName("Scheduler");
+  }
+
+  /**
+   * Adds the command to the {@link Scheduler}. This will not add the {@link Command} immediately,
+   * but will instead wait for the proper time in the {@link Scheduler#run()} loop before doing so.
+   * The command returns immediately and does nothing if given null.
+   *
+   * <p> Adding a {@link Command} to the {@link Scheduler} involves the {@link Scheduler} removing
+   * any {@link Command} which has shared requirements. </p>
+   *
+   * @param command the command to add
+   */
+  public void add(Command command) {
+    if (command != null) {
+      m_additions.addElement(command);
+    }
+  }
+
+  /**
+   * Adds a button to the {@link Scheduler}. The {@link Scheduler} will poll the button during its
+   * {@link Scheduler#run()}.
+   *
+   * @param button the button to add
+   */
+  public void addButton(ButtonScheduler button) {
+    if (m_buttons == null) {
+      m_buttons = new Vector<>();
+    }
+    m_buttons.addElement(button);
+  }
+
+  /**
+   * Adds a command immediately to the {@link Scheduler}. This should only be called in the {@link
+   * Scheduler#run()} loop. Any command with conflicting requirements will be removed, unless it is
+   * uninterruptable. Giving <code>null</code> does nothing.
+   *
+   * @param command the {@link Command} to add
+   */
+  @SuppressWarnings("MethodName")
+  private void _add(Command command) {
+    if (command == null) {
+      return;
+    }
+
+    // Check to make sure no adding during adding
+    if (m_adding) {
+      System.err.println("WARNING: Can not start command from cancel method.  Ignoring:" + command);
+      return;
+    }
+
+    // Only add if not already in
+    if (!m_commandTable.containsKey(command)) {
+
+      // Check that the requirements can be had
+      Enumeration requirements = command.getRequirements();
+      while (requirements.hasMoreElements()) {
+        Subsystem lock = (Subsystem) requirements.nextElement();
+        if (lock.getCurrentCommand() != null && !lock.getCurrentCommand().isInterruptible()) {
+          return;
+        }
+      }
+
+      // Give it the requirements
+      m_adding = true;
+      requirements = command.getRequirements();
+      while (requirements.hasMoreElements()) {
+        Subsystem lock = (Subsystem) requirements.nextElement();
+        if (lock.getCurrentCommand() != null) {
+          lock.getCurrentCommand().cancel();
+          remove(lock.getCurrentCommand());
+        }
+        lock.setCurrentCommand(command);
+      }
+      m_adding = false;
+
+      // Add it to the list
+      LinkedListElement element = new LinkedListElement();
+      element.setData(command);
+      if (m_firstCommand == null) {
+        m_firstCommand = m_lastCommand = element;
+      } else {
+        m_lastCommand.add(element);
+        m_lastCommand = element;
+      }
+      m_commandTable.put(command, element);
+
+      m_runningCommandsChanged = true;
+
+      command.startRunning();
+    }
+  }
+
+  /**
+   * Runs a single iteration of the loop. This method should be called often in order to have a
+   * functioning {@link Command} system. The loop has five stages:
+   *
+   * <ol> <li>Poll the Buttons</li> <li>Execute/Remove the Commands</li> <li>Send values to
+   * SmartDashboard</li> <li>Add Commands</li> <li>Add Defaults</li> </ol>
+   */
+  public void run() {
+
+    m_runningCommandsChanged = false;
+
+    if (m_disabled) {
+      return;
+    } // Don't run when m_disabled
+
+    // Get button input (going backwards preserves button priority)
+    if (m_buttons != null) {
+      for (int i = m_buttons.size() - 1; i >= 0; i--) {
+        m_buttons.elementAt(i).execute();
+      }
+    }
+
+    // Call every subsystem's periodic method
+    Enumeration subsystems = m_subsystems.getElements();
+    while (subsystems.hasMoreElements()) {
+      ((Subsystem) subsystems.nextElement()).periodic();
+    }
+
+    // Loop through the commands
+    LinkedListElement element = m_firstCommand;
+    while (element != null) {
+      Command command = element.getData();
+      element = element.getNext();
+      if (!command.run()) {
+        remove(command);
+        m_runningCommandsChanged = true;
+      }
+    }
+
+    // Add the new things
+    for (int i = 0; i < m_additions.size(); i++) {
+      _add(m_additions.elementAt(i));
+    }
+    m_additions.removeAllElements();
+
+    // Add in the defaults
+    Enumeration locks = m_subsystems.getElements();
+    while (locks.hasMoreElements()) {
+      Subsystem lock = (Subsystem) locks.nextElement();
+      if (lock.getCurrentCommand() == null) {
+        _add(lock.getDefaultCommand());
+      }
+      lock.confirmCommand();
+    }
+  }
+
+  /**
+   * Registers a {@link Subsystem} to this {@link Scheduler}, so that the {@link Scheduler} might
+   * know if a default {@link Command} needs to be run. All {@link Subsystem Subsystems} should call
+   * this.
+   *
+   * @param system the system
+   */
+  void registerSubsystem(Subsystem system) {
+    if (system != null) {
+      m_subsystems.add(system);
+    }
+  }
+
+  /**
+   * Removes the {@link Command} from the {@link Scheduler}.
+   *
+   * @param command the command to remove
+   */
+  void remove(Command command) {
+    if (command == null || !m_commandTable.containsKey(command)) {
+      return;
+    }
+    LinkedListElement element = m_commandTable.get(command);
+    m_commandTable.remove(command);
+
+    if (element.equals(m_lastCommand)) {
+      m_lastCommand = element.getPrevious();
+    }
+    if (element.equals(m_firstCommand)) {
+      m_firstCommand = element.getNext();
+    }
+    element.remove();
+
+    Enumeration requirements = command.getRequirements();
+    while (requirements.hasMoreElements()) {
+      ((Subsystem) requirements.nextElement()).setCurrentCommand(null);
+    }
+
+    command.removed();
+  }
+
+  /**
+   * Removes all commands.
+   */
+  public void removeAll() {
+    // TODO: Confirm that this works with "uninteruptible" commands
+    while (m_firstCommand != null) {
+      remove(m_firstCommand.getData());
+    }
+  }
+
+  /**
+   * Disable the command scheduler.
+   */
+  public void disable() {
+    m_disabled = true;
+  }
+
+  /**
+   * Enable the command scheduler.
+   */
+  public void enable() {
+    m_disabled = false;
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Scheduler");
+    m_namesEntry = builder.getEntry("Names");
+    m_idsEntry = builder.getEntry("Ids");
+    m_cancelEntry = builder.getEntry("Cancel");
+    builder.setUpdateTable(() -> {
+      if (m_namesEntry != null && m_idsEntry != null && m_cancelEntry != null) {
+        // Get the commands to cancel
+        double[] toCancel = m_cancelEntry.getDoubleArray(new double[0]);
+        if (toCancel.length > 0) {
+          for (LinkedListElement e = m_firstCommand; e != null; e = e.getNext()) {
+            for (double d : toCancel) {
+              if (e.getData().hashCode() == d) {
+                e.getData().cancel();
+              }
+            }
+          }
+          m_cancelEntry.setDoubleArray(new double[0]);
+        }
+
+        if (m_runningCommandsChanged) {
+          // Set the the running commands
+          int number = 0;
+          for (LinkedListElement e = m_firstCommand; e != null; e = e.getNext()) {
+            number++;
+          }
+          String[] commands = new String[number];
+          double[] ids = new double[number];
+          number = 0;
+          for (LinkedListElement e = m_firstCommand; e != null; e = e.getNext()) {
+            commands[number] = e.getData().getName();
+            ids[number] = e.getData().hashCode();
+            number++;
+          }
+          m_namesEntry.setStringArray(commands);
+          m_idsEntry.setDoubleArray(ids);
+        }
+      }
+    });
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Set.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Set.java
new file mode 100644
index 0000000..4b05467
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Set.java
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import java.util.Enumeration;
+import java.util.Vector;
+
+@SuppressWarnings("all")
+/**
+ * A set.
+ */
+class Set {
+  private Vector m_set = new Vector();
+
+  public Set() {
+  }
+
+  public void add(Object o) {
+    if (m_set.contains(o)) {
+      return;
+    }
+    m_set.addElement(o);
+  }
+
+  public void add(Set s) {
+    Enumeration stuff = s.getElements();
+    for (Enumeration e = stuff; e.hasMoreElements(); ) {
+      add(e.nextElement());
+    }
+  }
+
+  public void clear() {
+      m_set.clear();
+  }
+
+  public boolean contains(Object o) {
+    return m_set.contains(o);
+  }
+
+  public Enumeration getElements() {
+    return m_set.elements();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/StartCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/StartCommand.java
new file mode 100644
index 0000000..dcd7200
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/StartCommand.java
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * A {@link StartCommand} will call the {@link Command#start() start()} method of another command
+ * when it is initialized and will finish immediately.
+ */
+public class StartCommand extends InstantCommand {
+  /**
+   * The command to fork.
+   */
+  private Command m_commandToFork;
+
+  /**
+   * Instantiates a {@link StartCommand} which will start the given command whenever its {@link
+   * Command#initialize() initialize()} is called.
+   *
+   * @param commandToStart the {@link Command} to start
+   */
+  public StartCommand(Command commandToStart) {
+    super("Start(" + commandToStart + ")");
+    m_commandToFork = commandToStart;
+  }
+
+  protected void initialize() {
+    m_commandToFork.start();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Subsystem.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Subsystem.java
new file mode 100644
index 0000000..0af2ca7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/Subsystem.java
@@ -0,0 +1,220 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import java.util.Enumeration;
+
+import edu.wpi.first.wpilibj.Sendable;
+import edu.wpi.first.wpilibj.SendableBase;
+import edu.wpi.first.wpilibj.livewindow.LiveWindow;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * This class defines a major component of the robot.
+ *
+ * <p> A good example of a subsystem is the driveline, or a claw if the robot has one. </p>
+ *
+ * <p> All motors should be a part of a subsystem. For instance, all the wheel motors should be a
+ * part of some kind of "Driveline" subsystem. </p>
+ *
+ * <p> Subsystems are used within the command system as requirements for {@link Command}. Only one
+ * command which requires a subsystem can run at a time. Also, subsystems can have default commands
+ * which are started if there is no command running which requires this subsystem. </p>
+ *
+ * @see Command
+ */
+public abstract class Subsystem extends SendableBase implements Sendable {
+  /**
+   * Whether or not getDefaultCommand() was called.
+   */
+  private boolean m_initializedDefaultCommand = false;
+  /**
+   * The current command.
+   */
+  private Command m_currentCommand;
+  private boolean m_currentCommandChanged;
+
+  /**
+   * The default command.
+   */
+  private Command m_defaultCommand;
+
+  /**
+   * Creates a subsystem with the given name.
+   *
+   * @param name the name of the subsystem
+   */
+  public Subsystem(String name) {
+    setName(name, name);
+    Scheduler.getInstance().registerSubsystem(this);
+  }
+
+  /**
+   * Creates a subsystem. This will set the name to the name of the class.
+   */
+  public Subsystem() {
+    String name = getClass().getName();
+    name = name.substring(name.lastIndexOf('.') + 1);
+    setName(name, name);
+    Scheduler.getInstance().registerSubsystem(this);
+    m_currentCommandChanged = true;
+  }
+
+  /**
+   * Initialize the default command for a subsystem By default subsystems have no default command,
+   * but if they do, the default command is set with this method. It is called on all Subsystems by
+   * CommandBase in the users program after all the Subsystems are created.
+   */
+  protected abstract void initDefaultCommand();
+
+  /**
+   * When the run method of the scheduler is called this method will be called.
+   */
+  public void periodic() {
+    // Override me!
+  }
+
+  /**
+   * Sets the default command. If this is not called or is called with null, then there will be no
+   * default command for the subsystem.
+   *
+   * <p> <b>WARNING:</b> This should <b>NOT</b> be called in a constructor if the subsystem is a
+   * singleton. </p>
+   *
+   * @param command the default command (or null if there should be none)
+   * @throws IllegalUseOfCommandException if the command does not require the subsystem
+   */
+  public void setDefaultCommand(Command command) {
+    if (command == null) {
+      m_defaultCommand = null;
+    } else {
+      boolean found = false;
+      Enumeration requirements = command.getRequirements();
+      while (requirements.hasMoreElements()) {
+        if (requirements.nextElement().equals(this)) {
+          found = true;
+          // } else {
+          // throw new
+          // IllegalUseOfCommandException("A default command cannot require multiple subsystems");
+        }
+      }
+      if (!found) {
+        throw new IllegalUseOfCommandException("A default command must require the subsystem");
+      }
+      m_defaultCommand = command;
+    }
+  }
+
+  /**
+   * Returns the default command (or null if there is none).
+   *
+   * @return the default command
+   */
+  public Command getDefaultCommand() {
+    if (!m_initializedDefaultCommand) {
+      m_initializedDefaultCommand = true;
+      initDefaultCommand();
+    }
+    return m_defaultCommand;
+  }
+
+  /**
+   * Returns the default command name, or empty string is there is none.
+   *
+   * @return the default command name
+   */
+  public String getDefaultCommandName() {
+    Command defaultCommand = getDefaultCommand();
+    if (defaultCommand != null) {
+      return defaultCommand.getName();
+    } else {
+      return "";
+    }
+  }
+
+  /**
+   * Sets the current command.
+   *
+   * @param command the new current command
+   */
+  void setCurrentCommand(Command command) {
+    m_currentCommand = command;
+    m_currentCommandChanged = true;
+  }
+
+  /**
+   * Call this to alert Subsystem that the current command is actually the command. Sometimes, the
+   * {@link Subsystem} is told that it has no command while the {@link Scheduler} is going through
+   * the loop, only to be soon after given a new one. This will avoid that situation.
+   */
+  void confirmCommand() {
+    if (m_currentCommandChanged) {
+      m_currentCommandChanged = false;
+    }
+  }
+
+  /**
+   * Returns the command which currently claims this subsystem.
+   *
+   * @return the command which currently claims this subsystem
+   */
+  public Command getCurrentCommand() {
+    return m_currentCommand;
+  }
+
+  /**
+   * Returns the current command name, or empty string if no current command.
+   *
+   * @return the current command name
+   */
+  public String getCurrentCommandName() {
+    Command currentCommand = getCurrentCommand();
+    if (currentCommand != null) {
+      return currentCommand.getName();
+    } else {
+      return "";
+    }
+  }
+
+  /**
+   * Associate a {@link Sendable} with this Subsystem.
+   * Also update the child's name.
+   *
+   * @param name name to give child
+   * @param child sendable
+   */
+  public void addChild(String name, Sendable child) {
+    child.setName(getSubsystem(), name);
+    LiveWindow.add(child);
+  }
+
+  /**
+   * Associate a {@link Sendable} with this Subsystem.
+   *
+   * @param child sendable
+   */
+  public void addChild(Sendable child) {
+    child.setSubsystem(getSubsystem());
+    LiveWindow.add(child);
+  }
+
+  @Override
+  public String toString() {
+    return getSubsystem();
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("Subsystem");
+
+    builder.addBooleanProperty(".hasDefault", () -> m_defaultCommand != null, null);
+    builder.addStringProperty(".default", this::getDefaultCommandName, null);
+    builder.addBooleanProperty(".hasCommand", () -> m_currentCommand != null, null);
+    builder.addStringProperty(".command", this::getCurrentCommandName, null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/TimedCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/TimedCommand.java
new file mode 100644
index 0000000..abd3b91
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/TimedCommand.java
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * A {@link TimedCommand} will wait for a timeout before finishing.
+ * {@link TimedCommand} is used to execute a command for a given amount of time.
+ */
+public class TimedCommand extends Command {
+  /**
+   * Instantiates a TimedCommand with the given name and timeout.
+   *
+   * @param name the name of the command
+   * @param timeout the time the command takes to run (seconds)
+   */
+  public TimedCommand(String name, double timeout) {
+    super(name, timeout);
+  }
+
+  /**
+   * Instantiates a TimedCommand with the given timeout.
+   *
+   * @param timeout the time the command takes to run (seconds)
+   */
+  public TimedCommand(double timeout) {
+    super(timeout);
+  }
+
+  /**
+  * Ends command when timed out.
+  */
+  protected boolean isFinished() {
+    return isTimedOut();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitCommand.java
new file mode 100644
index 0000000..1af7c1f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitCommand.java
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * A {@link WaitCommand} will wait for a certain amount of time before finishing. It is useful if
+ * you want a {@link CommandGroup} to pause for a moment.
+ *
+ * @see CommandGroup
+ */
+public class WaitCommand extends TimedCommand {
+  /**
+   * Instantiates a {@link WaitCommand} with the given timeout.
+   *
+   * @param timeout the time the command takes to run (seconds)
+   */
+  public WaitCommand(double timeout) {
+    this("Wait(" + timeout + ")", timeout);
+  }
+
+  /**
+   * Instantiates a {@link WaitCommand} with the given timeout.
+   *
+   * @param name    the name of the command
+   * @param timeout the time the command takes to run (seconds)
+   */
+  public WaitCommand(String name, double timeout) {
+    super(name, timeout);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitForChildren.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitForChildren.java
new file mode 100644
index 0000000..3fc3da2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitForChildren.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * This command will only finish if whatever {@link CommandGroup} it is in has no active children.
+ * If it is not a part of a {@link CommandGroup}, then it will finish immediately. If it is itself
+ * an active child, then the {@link CommandGroup} will never end.
+ *
+ * <p>This class is useful for the situation where you want to allow anything running in parallel
+ * to finish, before continuing in the main {@link CommandGroup} sequence.
+ */
+public class WaitForChildren extends Command {
+  protected boolean isFinished() {
+    return getGroup() == null || getGroup().m_children.isEmpty();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitUntilCommand.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitUntilCommand.java
new file mode 100644
index 0000000..508b0e0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/command/WaitUntilCommand.java
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import edu.wpi.first.wpilibj.Timer;
+
+/**
+ * WaitUntilCommand - waits until an absolute game time. This will wait until the game clock reaches
+ * some value, then continue to the next command.
+ */
+public class WaitUntilCommand extends Command {
+  private double m_time;
+
+  public WaitUntilCommand(double time) {
+    super("WaitUntil(" + time + ")");
+    m_time = time;
+  }
+
+  /**
+   * Check if we've reached the actual finish time.
+   */
+  public boolean isFinished() {
+    return Timer.getMatchTime() >= m_time;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/communication/NIRioStatus.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/communication/NIRioStatus.java
new file mode 100644
index 0000000..071c1ae
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/communication/NIRioStatus.java
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.communication;
+
+public class NIRioStatus {
+  // TODO: Should this file be auto-generated?
+  public static final int kRioStatusOffset = -63000;
+
+  public static final int kRioStatusSuccess = 0;
+  public static final int kRIOStatusBufferInvalidSize = kRioStatusOffset - 80;
+  public static final int kRIOStatusOperationTimedOut = -52007;
+  public static final int kRIOStatusFeatureNotSupported = kRioStatusOffset - 193;
+  public static final int kRIOStatusResourceNotInitialized = -52010;
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java
new file mode 100644
index 0000000..74ff519
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/DifferentialDrive.java
@@ -0,0 +1,369 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.drive;
+
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * A class for driving differential drive/skid-steer drive platforms such as the Kit of Parts drive
+ * base, "tank drive", or West Coast Drive.
+ *
+ * <p>These drive bases typically have drop-center / skid-steer with two or more wheels per side
+ * (e.g., 6WD or 8WD). This class takes a SpeedController per side. For four and
+ * six motor drivetrains, construct and pass in {@link edu.wpi.first.wpilibj.SpeedControllerGroup}
+ * instances as follows.
+ *
+ * <p>Four motor drivetrain:
+ * <pre><code>
+ * public class Robot {
+ *   Spark m_frontLeft = new Spark(1);
+ *   Spark m_rearLeft = new Spark(2);
+ *   SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_rearLeft);
+ *
+ *   Spark m_frontRight = new Spark(3);
+ *   Spark m_rearRight = new Spark(4);
+ *   SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_rearRight);
+ *
+ *   DifferentialDrive m_drive = new DifferentialDrive(m_left, m_right);
+ * }
+ * </code></pre>
+ *
+ * <p>Six motor drivetrain:
+ * <pre><code>
+ * public class Robot {
+ *   Spark m_frontLeft = new Spark(1);
+ *   Spark m_midLeft = new Spark(2);
+ *   Spark m_rearLeft = new Spark(3);
+ *   SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_midLeft, m_rearLeft);
+ *
+ *   Spark m_frontRight = new Spark(4);
+ *   Spark m_midRight = new Spark(5);
+ *   Spark m_rearRight = new Spark(6);
+ *   SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_midRight, m_rearRight);
+ *
+ *   DifferentialDrive m_drive = new DifferentialDrive(m_left, m_right);
+ * }
+ * </code></pre>
+ *
+ * <p>A differential drive robot has left and right wheels separated by an arbitrary width.
+ *
+ * <p>Drive base diagram:
+ * <pre>
+ * |_______|
+ * | |   | |
+ *   |   |
+ * |_|___|_|
+ * |       |
+ * </pre>
+ *
+ * <p>Each drive() function provides different inverse kinematic relations for a differential drive
+ * robot. Motor outputs for the right side are negated, so motor direction inversion by the user is
+ * usually unnecessary.
+ *
+ * <p>This library uses the NED axes convention (North-East-Down as external reference in the world
+ * frame): http://www.nuclearprojects.com/ins/images/axis_big.png.
+ *
+ * <p>The positive X axis points ahead, the positive Y axis points right, and the positive Z axis
+ * points down. Rotations follow the right-hand rule, so clockwise rotation around the Z axis is
+ * positive.
+ *
+ * <p>Inputs smaller then {@value edu.wpi.first.wpilibj.drive.RobotDriveBase#kDefaultDeadband} will
+ * be set to 0, and larger values will be scaled so that the full range is still used. This
+ * deadband value can be changed with {@link #setDeadband}.
+ *
+ * <p>RobotDrive porting guide:
+ * <br>{@link #tankDrive(double, double)} is equivalent to
+ * {@link edu.wpi.first.wpilibj.RobotDrive#tankDrive(double, double)} if a deadband of 0 is used.
+ * <br>{@link #arcadeDrive(double, double)} is equivalent to
+ * {@link edu.wpi.first.wpilibj.RobotDrive#arcadeDrive(double, double)} if a deadband of 0 is used
+ * and the the rotation input is inverted eg arcadeDrive(y, -rotation)
+ * <br>{@link #curvatureDrive(double, double, boolean)} is similar in concept to
+ * {@link edu.wpi.first.wpilibj.RobotDrive#drive(double, double)} with the addition of a quick turn
+ * mode. However, it is not designed to give exactly the same response.
+ */
+public class DifferentialDrive extends RobotDriveBase {
+  public static final double kDefaultQuickStopThreshold = 0.2;
+  public static final double kDefaultQuickStopAlpha = 0.1;
+
+  private static int instances = 0;
+
+  private SpeedController m_leftMotor;
+  private SpeedController m_rightMotor;
+
+  private double m_quickStopThreshold = kDefaultQuickStopThreshold;
+  private double m_quickStopAlpha = kDefaultQuickStopAlpha;
+  private double m_quickStopAccumulator = 0.0;
+  private boolean m_reported = false;
+
+  /**
+   * Construct a DifferentialDrive.
+   *
+   * <p>To pass multiple motors per side, use a {@link SpeedControllerGroup}. If a motor needs to be
+   * inverted, do so before passing it in.
+   */
+  public DifferentialDrive(SpeedController leftMotor, SpeedController rightMotor) {
+    m_leftMotor = leftMotor;
+    m_rightMotor = rightMotor;
+    addChild(m_leftMotor);
+    addChild(m_rightMotor);
+    instances++;
+    setName("DifferentialDrive", instances);
+  }
+
+  /**
+   * Arcade drive method for differential drive platform.
+   * The calculated values will be squared to decrease sensitivity at low speeds.
+   *
+   * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   */
+  @SuppressWarnings("ParameterName")
+  public void arcadeDrive(double xSpeed, double zRotation) {
+    arcadeDrive(xSpeed, zRotation, true);
+  }
+
+  /**
+   * Arcade drive method for differential drive platform.
+   *
+   * @param xSpeed        The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation     The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                      positive.
+   * @param squaredInputs If set, decreases the input sensitivity at low speeds.
+   */
+  @SuppressWarnings("ParameterName")
+  public void arcadeDrive(double xSpeed, double zRotation, boolean squaredInputs) {
+    if (!m_reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, 2, tInstances.kRobotDrive_ArcadeStandard);
+      m_reported = true;
+    }
+
+    xSpeed = limit(xSpeed);
+    xSpeed = applyDeadband(xSpeed, m_deadband);
+
+    zRotation = limit(zRotation);
+    zRotation = applyDeadband(zRotation, m_deadband);
+
+    // Square the inputs (while preserving the sign) to increase fine control
+    // while permitting full power.
+    if (squaredInputs) {
+      xSpeed = Math.copySign(xSpeed * xSpeed, xSpeed);
+      zRotation = Math.copySign(zRotation * zRotation, zRotation);
+    }
+
+    double leftMotorOutput;
+    double rightMotorOutput;
+
+    double maxInput = Math.copySign(Math.max(Math.abs(xSpeed), Math.abs(zRotation)), xSpeed);
+
+    if (xSpeed >= 0.0) {
+      // First quadrant, else second quadrant
+      if (zRotation >= 0.0) {
+        leftMotorOutput = maxInput;
+        rightMotorOutput = xSpeed - zRotation;
+      } else {
+        leftMotorOutput = xSpeed + zRotation;
+        rightMotorOutput = maxInput;
+      }
+    } else {
+      // Third quadrant, else fourth quadrant
+      if (zRotation >= 0.0) {
+        leftMotorOutput = xSpeed + zRotation;
+        rightMotorOutput = maxInput;
+      } else {
+        leftMotorOutput = maxInput;
+        rightMotorOutput = xSpeed - zRotation;
+      }
+    }
+
+    m_leftMotor.set(limit(leftMotorOutput) * m_maxOutput);
+    m_rightMotor.set(-limit(rightMotorOutput) * m_maxOutput);
+
+    m_safetyHelper.feed();
+  }
+
+  /**
+   * Curvature drive method for differential drive platform.
+   *
+   * <p>The rotation argument controls the curvature of the robot's path rather than its rate of
+   * heading change. This makes the robot more controllable at high speeds. Also handles the
+   * robot's quick turn functionality - "quick turn" overrides constant-curvature turning for
+   * turn-in-place maneuvers.
+   *
+   * @param xSpeed      The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation   The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                    positive.
+   * @param isQuickTurn If set, overrides constant-curvature turning for
+   *                    turn-in-place maneuvers.
+   */
+  @SuppressWarnings("ParameterName")
+  public void curvatureDrive(double xSpeed, double zRotation, boolean isQuickTurn) {
+    if (!m_reported) {
+      // HAL.report(tResourceType.kResourceType_RobotDrive, 2, tInstances.kRobotDrive_Curvature);
+      m_reported = true;
+    }
+
+    xSpeed = limit(xSpeed);
+    xSpeed = applyDeadband(xSpeed, m_deadband);
+
+    zRotation = limit(zRotation);
+    zRotation = applyDeadband(zRotation, m_deadband);
+
+    double angularPower;
+    boolean overPower;
+
+    if (isQuickTurn) {
+      if (Math.abs(xSpeed) < m_quickStopThreshold) {
+        m_quickStopAccumulator = (1 - m_quickStopAlpha) * m_quickStopAccumulator
+            + m_quickStopAlpha * limit(zRotation) * 2;
+      }
+      overPower = true;
+      angularPower = zRotation;
+    } else {
+      overPower = false;
+      angularPower = Math.abs(xSpeed) * zRotation - m_quickStopAccumulator;
+
+      if (m_quickStopAccumulator > 1) {
+        m_quickStopAccumulator -= 1;
+      } else if (m_quickStopAccumulator < -1) {
+        m_quickStopAccumulator += 1;
+      } else {
+        m_quickStopAccumulator = 0.0;
+      }
+    }
+
+    double leftMotorOutput = xSpeed + angularPower;
+    double rightMotorOutput = xSpeed - angularPower;
+
+    // If rotation is overpowered, reduce both outputs to within acceptable range
+    if (overPower) {
+      if (leftMotorOutput > 1.0) {
+        rightMotorOutput -= leftMotorOutput - 1.0;
+        leftMotorOutput = 1.0;
+      } else if (rightMotorOutput > 1.0) {
+        leftMotorOutput -= rightMotorOutput - 1.0;
+        rightMotorOutput = 1.0;
+      } else if (leftMotorOutput < -1.0) {
+        rightMotorOutput -= leftMotorOutput + 1.0;
+        leftMotorOutput = -1.0;
+      } else if (rightMotorOutput < -1.0) {
+        leftMotorOutput -= rightMotorOutput + 1.0;
+        rightMotorOutput = -1.0;
+      }
+    }
+
+    m_leftMotor.set(leftMotorOutput * m_maxOutput);
+    m_rightMotor.set(-rightMotorOutput * m_maxOutput);
+
+    m_safetyHelper.feed();
+  }
+
+  /**
+   * Tank drive method for differential drive platform.
+   * The calculated values will be squared to decrease sensitivity at low speeds.
+   *
+   * @param leftSpeed  The robot's left side speed along the X axis [-1.0..1.0]. Forward is
+   *                   positive.
+   * @param rightSpeed The robot's right side speed along the X axis [-1.0..1.0]. Forward is
+   *                   positive.
+   */
+  public void tankDrive(double leftSpeed, double rightSpeed) {
+    tankDrive(leftSpeed, rightSpeed, true);
+  }
+
+  /**
+   * Tank drive method for differential drive platform.
+   *
+   * @param leftSpeed     The robot left side's speed along the X axis [-1.0..1.0]. Forward is
+   *                      positive.
+   * @param rightSpeed    The robot right side's speed along the X axis [-1.0..1.0]. Forward is
+   *                      positive.
+   * @param squaredInputs If set, decreases the input sensitivity at low speeds.
+   */
+  public void tankDrive(double leftSpeed, double rightSpeed, boolean squaredInputs) {
+    if (!m_reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, 2, tInstances.kRobotDrive_Tank);
+      m_reported = true;
+    }
+
+    leftSpeed = limit(leftSpeed);
+    leftSpeed = applyDeadband(leftSpeed, m_deadband);
+
+    rightSpeed = limit(rightSpeed);
+    rightSpeed = applyDeadband(rightSpeed, m_deadband);
+
+    // Square the inputs (while preserving the sign) to increase fine control
+    // while permitting full power.
+    if (squaredInputs) {
+      leftSpeed = Math.copySign(leftSpeed * leftSpeed, leftSpeed);
+      rightSpeed = Math.copySign(rightSpeed * rightSpeed, rightSpeed);
+    }
+
+    m_leftMotor.set(leftSpeed * m_maxOutput);
+    m_rightMotor.set(-rightSpeed * m_maxOutput);
+
+    m_safetyHelper.feed();
+  }
+
+  /**
+   * Sets the QuickStop speed threshold in curvature drive.
+   *
+   * <p>QuickStop compensates for the robot's moment of inertia when stopping after a QuickTurn.
+   *
+   * <p>While QuickTurn is enabled, the QuickStop accumulator takes on the rotation rate value
+   * outputted by the low-pass filter when the robot's speed along the X axis is below the
+   * threshold. When QuickTurn is disabled, the accumulator's value is applied against the computed
+   * angular power request to slow the robot's rotation.
+   *
+   * @param threshold X speed below which quick stop accumulator will receive rotation rate values
+   *                  [0..1.0].
+   */
+  public void setQuickStopThreshold(double threshold) {
+    m_quickStopThreshold = threshold;
+  }
+
+  /**
+   * Sets the low-pass filter gain for QuickStop in curvature drive.
+   *
+   * <p>The low-pass filter filters incoming rotation rate commands to smooth out high frequency
+   * changes.
+   *
+   * @param alpha Low-pass filter gain [0.0..2.0]. Smaller values result in slower output changes.
+   *              Values between 1.0 and 2.0 result in output oscillation. Values below 0.0 and
+   *              above 2.0 are unstable.
+   */
+  public void setQuickStopAlpha(double alpha) {
+    m_quickStopAlpha = alpha;
+  }
+
+  @Override
+  public void stopMotor() {
+    m_leftMotor.stopMotor();
+    m_rightMotor.stopMotor();
+    m_safetyHelper.feed();
+  }
+
+  @Override
+  public String getDescription() {
+    return "DifferentialDrive";
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("DifferentialDrive");
+    builder.addDoubleProperty("Left Motor Speed", m_leftMotor::get, m_leftMotor::set);
+    builder.addDoubleProperty(
+        "Right Motor Speed",
+        () -> -m_rightMotor.get(),
+        x -> m_rightMotor.set(-x));
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java
new file mode 100644
index 0000000..558e0e7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/KilloughDrive.java
@@ -0,0 +1,211 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.drive;
+
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+// import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+// import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+// import edu.wpi.first.wpilibj.hal.HAL;
+
+/**
+ * A class for driving Killough drive platforms.
+ *
+ * <p>Killough drives are triangular with one omni wheel on each corner.
+ *
+ * <p>Drive base diagram:
+ * <pre>
+ *  /_____\
+ * / \   / \
+ *    \ /
+ *    ---
+ * </pre>
+ *
+ * <p>Each drive() function provides different inverse kinematic relations for a Killough drive. The
+ * default wheel vectors are parallel to their respective opposite sides, but can be overridden. See
+ * the constructor for more information.
+ *
+ * <p>This library uses the NED axes convention (North-East-Down as external reference in the world
+ * frame): http://www.nuclearprojects.com/ins/images/axis_big.png.
+ *
+ * <p>The positive X axis points ahead, the positive Y axis points right, and the positive Z axis
+ * points down. Rotations follow the right-hand rule, so clockwise rotation around the Z axis is
+ * positive.
+ */
+public class KilloughDrive extends RobotDriveBase {
+  public static final double kDefaultLeftMotorAngle = 60.0;
+  public static final double kDefaultRightMotorAngle = 120.0;
+  public static final double kDefaultBackMotorAngle = 270.0;
+
+  private static int instances = 0;
+
+  private SpeedController m_leftMotor;
+  private SpeedController m_rightMotor;
+  private SpeedController m_backMotor;
+
+  private Vector2d m_leftVec;
+  private Vector2d m_rightVec;
+  private Vector2d m_backVec;
+
+  private boolean m_reported = false;
+
+  /**
+   * Construct a Killough drive with the given motors and default motor angles.
+   *
+   * <p>The default motor angles make the wheels on each corner parallel to their respective
+   * opposite sides.
+   *
+   * <p>If a motor needs to be inverted, do so before passing it in.
+   *
+   * @param leftMotor  The motor on the left corner.
+   * @param rightMotor The motor on the right corner.
+   * @param backMotor  The motor on the back corner.
+   */
+  public KilloughDrive(SpeedController leftMotor, SpeedController rightMotor,
+                       SpeedController backMotor) {
+    this(leftMotor, rightMotor, backMotor, kDefaultLeftMotorAngle, kDefaultRightMotorAngle,
+        kDefaultBackMotorAngle);
+  }
+
+  /**
+   * Construct a Killough drive with the given motors.
+   *
+   * <p>Angles are measured in degrees clockwise from the positive X axis.
+   *
+   * @param leftMotor       The motor on the left corner.
+   * @param rightMotor      The motor on the right corner.
+   * @param backMotor       The motor on the back corner.
+   * @param leftMotorAngle  The angle of the left wheel's forward direction of travel.
+   * @param rightMotorAngle The angle of the right wheel's forward direction of travel.
+   * @param backMotorAngle  The angle of the back wheel's forward direction of travel.
+   */
+  public KilloughDrive(SpeedController leftMotor, SpeedController rightMotor,
+                       SpeedController backMotor, double leftMotorAngle, double rightMotorAngle,
+                       double backMotorAngle) {
+    m_leftMotor = leftMotor;
+    m_rightMotor = rightMotor;
+    m_backMotor = backMotor;
+    m_leftVec = new Vector2d(Math.cos(leftMotorAngle * (Math.PI / 180.0)),
+                             Math.sin(leftMotorAngle * (Math.PI / 180.0)));
+    m_rightVec = new Vector2d(Math.cos(rightMotorAngle * (Math.PI / 180.0)),
+                              Math.sin(rightMotorAngle * (Math.PI / 180.0)));
+    m_backVec = new Vector2d(Math.cos(backMotorAngle * (Math.PI / 180.0)),
+                             Math.sin(backMotorAngle * (Math.PI / 180.0)));
+    addChild(m_leftMotor);
+    addChild(m_rightMotor);
+    addChild(m_backMotor);
+    instances++;
+    setName("KilloughDrive", instances);
+  }
+
+  /**
+   * Drive method for Killough platform.
+   *
+   * <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent
+   * from its angle or rotation rate.
+   *
+   * @param ySpeed    The robot's speed along the Y axis [-1.0..1.0]. Right is positive.
+   * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   */
+  @SuppressWarnings("ParameterName")
+  public void driveCartesian(double ySpeed, double xSpeed, double zRotation) {
+    driveCartesian(ySpeed, xSpeed, zRotation, 0.0);
+  }
+
+  /**
+   * Drive method for Killough platform.
+   *
+   * <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent
+   * from its angle or rotation rate.
+   *
+   * @param ySpeed    The robot's speed along the Y axis [-1.0..1.0]. Right is positive.
+   * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   * @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use
+   *                  this to implement field-oriented controls.
+   */
+  @SuppressWarnings("ParameterName")
+  public void driveCartesian(double ySpeed, double xSpeed, double zRotation,
+                             double gyroAngle) {
+    if (!m_reported) {
+      // HAL.report(tResourceType.kResourceType_RobotDrive, 3,
+      //            tInstances.kRobotDrive_KilloughCartesian);
+      m_reported = true;
+    }
+
+    ySpeed = limit(ySpeed);
+    ySpeed = applyDeadband(ySpeed, m_deadband);
+
+    xSpeed = limit(xSpeed);
+    xSpeed = applyDeadband(xSpeed, m_deadband);
+
+    // Compensate for gyro angle.
+    Vector2d input = new Vector2d(ySpeed, xSpeed);
+    input.rotate(-gyroAngle);
+
+    double[] wheelSpeeds = new double[3];
+    wheelSpeeds[MotorType.kLeft.value] = input.scalarProject(m_leftVec) + zRotation;
+    wheelSpeeds[MotorType.kRight.value] = input.scalarProject(m_rightVec) + zRotation;
+    wheelSpeeds[MotorType.kBack.value] = input.scalarProject(m_backVec) + zRotation;
+
+    normalize(wheelSpeeds);
+
+    m_leftMotor.set(wheelSpeeds[MotorType.kLeft.value] * m_maxOutput);
+    m_rightMotor.set(wheelSpeeds[MotorType.kRight.value] * m_maxOutput);
+    m_backMotor.set(wheelSpeeds[MotorType.kBack.value] * m_maxOutput);
+
+    m_safetyHelper.feed();
+  }
+
+  /**
+   * Drive method for Killough platform.
+   *
+   * <p>Angles are measured counter-clockwise from straight ahead. The speed at which the robot
+   * drives (translation) is independent from its angle or rotation rate.
+   *
+   * @param magnitude The robot's speed at a given angle [-1.0..1.0]. Forward is positive.
+   * @param angle     The angle around the Z axis at which the robot drives in degrees [-180..180].
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   */
+  @SuppressWarnings("ParameterName")
+  public void drivePolar(double magnitude, double angle, double zRotation) {
+    if (!m_reported) {
+      // HAL.report(tResourceType.kResourceType_RobotDrive, 3,
+      //            tInstances.kRobotDrive_KilloughPolar);
+      m_reported = true;
+    }
+
+    driveCartesian(magnitude * Math.sin(angle * (Math.PI / 180.0)),
+                   magnitude * Math.cos(angle * (Math.PI / 180.0)), zRotation, 0.0);
+  }
+
+  @Override
+  public void stopMotor() {
+    m_leftMotor.stopMotor();
+    m_rightMotor.stopMotor();
+    m_backMotor.stopMotor();
+    m_safetyHelper.feed();
+  }
+
+  @Override
+  public String getDescription() {
+    return "KilloughDrive";
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("KilloughDrive");
+    builder.addDoubleProperty("Left Motor Speed", m_leftMotor::get, m_leftMotor::set);
+    builder.addDoubleProperty("Right Motor Speed", m_rightMotor::get, m_rightMotor::set);
+    builder.addDoubleProperty("Back Motor Speed", m_backMotor::get, m_backMotor::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java
new file mode 100644
index 0000000..087a51c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/MecanumDrive.java
@@ -0,0 +1,199 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.drive;
+
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+
+/**
+ * A class for driving Mecanum drive platforms.
+ *
+ * <p>Mecanum drives are rectangular with one wheel on each corner. Each wheel has rollers toed in
+ * 45 degrees toward the front or back. When looking at the wheels from the top, the roller axles
+ * should form an X across the robot. Each drive() function provides different inverse kinematic
+ * relations for a Mecanum drive robot.
+ *
+ * <p>Drive base diagram:
+ * <pre>
+ * \\_______/
+ * \\ |   | /
+ *   |   |
+ * /_|___|_\\
+ * /       \\
+ * </pre>
+ *
+ * <p>Each drive() function provides different inverse kinematic relations for a Mecanum drive
+ * robot. Motor outputs for the right side are negated, so motor direction inversion by the user is
+ * usually unnecessary.
+ *
+ * <p>This library uses the NED axes convention (North-East-Down as external reference in the world
+ * frame): http://www.nuclearprojects.com/ins/images/axis_big.png.
+ *
+ * <p>The positive X axis points ahead, the positive Y axis points right, and the positive Z axis
+ * points down. Rotations follow the right-hand rule, so clockwise rotation around the Z axis is
+ * positive.
+ *
+ * <p>Inputs smaller then {@value edu.wpi.first.wpilibj.drive.RobotDriveBase#kDefaultDeadband} will
+ * be set to 0, and larger values will be scaled so that the full range is still used. This
+ * deadband value can be changed with {@link #setDeadband}.
+ *
+ * <p>RobotDrive porting guide:
+ * <br>In MecanumDrive, the right side speed controllers are automatically inverted, while in
+ * RobotDrive, no speed controllers are automatically inverted.
+ * <br>{@link #driveCartesian(double, double, double, double)} is equivalent to
+ * {@link edu.wpi.first.wpilibj.RobotDrive#mecanumDrive_Cartesian(double, double, double, double)}
+ * if a deadband of 0 is used, and the ySpeed and gyroAngle values are inverted compared to
+ * RobotDrive (eg driveCartesian(xSpeed, -ySpeed, zRotation, -gyroAngle).
+ * <br>{@link #drivePolar(double, double, double)} is equivalent to
+ * {@link edu.wpi.first.wpilibj.RobotDrive#mecanumDrive_Polar(double, double, double)} if a
+ * deadband of 0 is used.
+ */
+public class MecanumDrive extends RobotDriveBase {
+  private static int instances = 0;
+
+  private SpeedController m_frontLeftMotor;
+  private SpeedController m_rearLeftMotor;
+  private SpeedController m_frontRightMotor;
+  private SpeedController m_rearRightMotor;
+
+  private boolean m_reported = false;
+
+  /**
+   * Construct a MecanumDrive.
+   *
+   * <p>If a motor needs to be inverted, do so before passing it in.
+   */
+  public MecanumDrive(SpeedController frontLeftMotor, SpeedController rearLeftMotor,
+                      SpeedController frontRightMotor, SpeedController rearRightMotor) {
+    m_frontLeftMotor = frontLeftMotor;
+    m_rearLeftMotor = rearLeftMotor;
+    m_frontRightMotor = frontRightMotor;
+    m_rearRightMotor = rearRightMotor;
+    addChild(m_frontLeftMotor);
+    addChild(m_rearLeftMotor);
+    addChild(m_frontRightMotor);
+    addChild(m_rearRightMotor);
+    instances++;
+    setName("MecanumDrive", instances);
+  }
+
+  /**
+   * Drive method for Mecanum platform.
+   *
+   * <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent
+   * from its angle or rotation rate.
+   *
+   * @param ySpeed    The robot's speed along the Y axis [-1.0..1.0]. Right is positive.
+   * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   */
+  @SuppressWarnings("ParameterName")
+  public void driveCartesian(double ySpeed, double xSpeed, double zRotation) {
+    driveCartesian(ySpeed, xSpeed, zRotation, 0.0);
+  }
+
+  /**
+   * Drive method for Mecanum platform.
+   *
+   * <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent
+   * from its angle or rotation rate.
+   *
+   * @param ySpeed    The robot's speed along the Y axis [-1.0..1.0]. Right is positive.
+   * @param xSpeed    The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   * @param gyroAngle The current angle reading from the gyro in degrees around the Z axis. Use
+   *                  this to implement field-oriented controls.
+   */
+  @SuppressWarnings("ParameterName")
+  public void driveCartesian(double ySpeed, double xSpeed, double zRotation, double gyroAngle) {
+    if (!m_reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, 4,
+                 tInstances.kRobotDrive_MecanumCartesian);
+      m_reported = true;
+    }
+
+    ySpeed = limit(ySpeed);
+    ySpeed = applyDeadband(ySpeed, m_deadband);
+
+    xSpeed = limit(xSpeed);
+    xSpeed = applyDeadband(xSpeed, m_deadband);
+
+    // Compensate for gyro angle.
+    Vector2d input = new Vector2d(ySpeed, xSpeed);
+    input.rotate(-gyroAngle);
+
+    double[] wheelSpeeds = new double[4];
+    wheelSpeeds[MotorType.kFrontLeft.value] = input.x + input.y + zRotation;
+    wheelSpeeds[MotorType.kFrontRight.value] = input.x - input.y + zRotation;
+    wheelSpeeds[MotorType.kRearLeft.value] = -input.x + input.y + zRotation;
+    wheelSpeeds[MotorType.kRearRight.value] = -input.x - input.y + zRotation;
+
+    normalize(wheelSpeeds);
+
+    m_frontLeftMotor.set(wheelSpeeds[MotorType.kFrontLeft.value] * m_maxOutput);
+    m_frontRightMotor.set(wheelSpeeds[MotorType.kFrontRight.value] * m_maxOutput);
+    m_rearLeftMotor.set(wheelSpeeds[MotorType.kRearLeft.value] * m_maxOutput);
+    m_rearRightMotor.set(wheelSpeeds[MotorType.kRearRight.value] * m_maxOutput);
+
+    m_safetyHelper.feed();
+  }
+
+  /**
+   * Drive method for Mecanum platform.
+   *
+   * <p>Angles are measured counter-clockwise from straight ahead. The speed at which the robot
+   * drives (translation) is independent from its angle or rotation rate.
+   *
+   * @param magnitude The robot's speed at a given angle [-1.0..1.0]. Forward is positive.
+   * @param angle     The angle around the Z axis at which the robot drives in degrees [-180..180].
+   * @param zRotation The robot's rotation rate around the Z axis [-1.0..1.0]. Clockwise is
+   *                  positive.
+   */
+  @SuppressWarnings("ParameterName")
+  public void drivePolar(double magnitude, double angle, double zRotation) {
+    if (!m_reported) {
+      HAL.report(tResourceType.kResourceType_RobotDrive, 4, tInstances.kRobotDrive_MecanumPolar);
+      m_reported = true;
+    }
+
+    driveCartesian(magnitude * Math.sin(angle * (Math.PI / 180.0)),
+                   magnitude * Math.cos(angle * (Math.PI / 180.0)), zRotation, 0.0);
+  }
+
+  @Override
+  public void stopMotor() {
+    m_frontLeftMotor.stopMotor();
+    m_frontRightMotor.stopMotor();
+    m_rearLeftMotor.stopMotor();
+    m_rearRightMotor.stopMotor();
+    m_safetyHelper.feed();
+  }
+
+  @Override
+  public String getDescription() {
+    return "MecanumDrive";
+  }
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("MecanumDrive");
+    builder.addDoubleProperty("Front Left Motor Speed", m_frontLeftMotor::get,
+        m_frontLeftMotor::set);
+    builder.addDoubleProperty("Front Right Motor Speed", m_frontRightMotor::get,
+        m_frontRightMotor::set);
+    builder.addDoubleProperty("Rear Left Motor Speed", m_rearLeftMotor::get,
+        m_rearLeftMotor::set);
+    builder.addDoubleProperty("Rear Right Motor Speed", m_rearRightMotor::get,
+        m_rearRightMotor::set);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
new file mode 100644
index 0000000..1cc140c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/RobotDriveBase.java
@@ -0,0 +1,148 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.drive;
+
+import edu.wpi.first.wpilibj.MotorSafety;
+import edu.wpi.first.wpilibj.MotorSafetyHelper;
+import edu.wpi.first.wpilibj.SendableBase;
+
+/**
+ * Common base class for drive platforms.
+ */
+public abstract class RobotDriveBase extends SendableBase implements MotorSafety {
+  public static final double kDefaultDeadband = 0.02;
+  public static final double kDefaultMaxOutput = 1.0;
+
+  protected double m_deadband = kDefaultDeadband;
+  protected double m_maxOutput = kDefaultMaxOutput;
+  protected MotorSafetyHelper m_safetyHelper = new MotorSafetyHelper(this);
+
+  /**
+   * The location of a motor on the robot for the purpose of driving.
+   */
+  public enum MotorType {
+    kFrontLeft(0), kFrontRight(1), kRearLeft(2), kRearRight(3), kLeft(0),
+    kRight(1), kBack(2);
+
+    @SuppressWarnings("MemberName")
+    public final int value;
+
+    MotorType(int value) {
+      this.value = value;
+    }
+  }
+
+  public RobotDriveBase() {
+    m_safetyHelper.setSafetyEnabled(true);
+    setName("RobotDriveBase");
+  }
+
+  /**
+   * Change the default value for deadband scaling. The default value is
+   * {@value #kDefaultDeadband}. Values smaller then the deadband are set to 0, while values
+   * larger then the deadband are scaled from 0.0 to 1.0. See {@link #applyDeadband}.
+   *
+   * @param deadband The deadband to set.
+   */
+  public void setDeadband(double deadband) {
+    m_deadband = deadband;
+  }
+
+  /**
+   * Configure the scaling factor for using drive methods with motor controllers in a mode other
+   * than PercentVbus or to limit the maximum output.
+   *
+   * <p>The default value is {@value #kDefaultMaxOutput}.
+   *
+   * @param maxOutput Multiplied with the output percentage computed by the drive functions.
+   */
+  public void setMaxOutput(double maxOutput) {
+    m_maxOutput = maxOutput;
+  }
+
+  @Override
+  public void setExpiration(double timeout) {
+    m_safetyHelper.setExpiration(timeout);
+  }
+
+  @Override
+  public double getExpiration() {
+    return m_safetyHelper.getExpiration();
+  }
+
+  @Override
+  public boolean isAlive() {
+    return m_safetyHelper.isAlive();
+  }
+
+  @Override
+  public abstract void stopMotor();
+
+  @Override
+  public boolean isSafetyEnabled() {
+    return m_safetyHelper.isSafetyEnabled();
+  }
+
+  @Override
+  public void setSafetyEnabled(boolean enabled) {
+    m_safetyHelper.setSafetyEnabled(enabled);
+  }
+
+  @Override
+  public abstract String getDescription();
+
+  /**
+   * Limit motor values to the -1.0 to +1.0 range.
+   */
+  protected double limit(double value) {
+    if (value > 1.0) {
+      return 1.0;
+    }
+    if (value < -1.0) {
+      return -1.0;
+    }
+    return value;
+  }
+
+  /**
+   * Returns 0.0 if the given value is within the specified range around zero. The remaining range
+   * between the deadband and 1.0 is scaled from 0.0 to 1.0.
+   *
+   * @param value    value to clip
+   * @param deadband range around zero
+   */
+  protected double applyDeadband(double value, double deadband) {
+    if (Math.abs(value) > deadband) {
+      if (value > 0.0) {
+        return (value - deadband) / (1.0 - deadband);
+      } else {
+        return (value + deadband) / (1.0 - deadband);
+      }
+    } else {
+      return 0.0;
+    }
+  }
+
+  /**
+   * Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.
+   */
+  protected void normalize(double[] wheelSpeeds) {
+    double maxMagnitude = Math.abs(wheelSpeeds[0]);
+    for (int i = 1; i < wheelSpeeds.length; i++) {
+      double temp = Math.abs(wheelSpeeds[i]);
+      if (maxMagnitude < temp) {
+        maxMagnitude = temp;
+      }
+    }
+    if (maxMagnitude > 1.0) {
+      for (int i = 0; i < wheelSpeeds.length; i++) {
+        wheelSpeeds[i] = wheelSpeeds[i] / maxMagnitude;
+      }
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
new file mode 100644
index 0000000..fb27fb1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/drive/Vector2d.java
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.drive;
+
+/**
+ * This is a 2D vector struct that supports basic vector operations.
+ */
+@SuppressWarnings("MemberName")
+public class Vector2d {
+  public double x = 0.0;
+  public double y = 0.0;
+
+  public Vector2d() {}
+
+  @SuppressWarnings("ParameterName")
+  public Vector2d(double x, double y) {
+    this.x = x;
+    this.y = y;
+  }
+
+  /**
+   * Rotate a vector in Cartesian space.
+   *
+   * @param angle angle in degrees by which to rotate vector counter-clockwise.
+   */
+  public void rotate(double angle) {
+    double cosA = Math.cos(angle * (Math.PI / 180.0));
+    double sinA = Math.sin(angle * (Math.PI / 180.0));
+    double[] out = new double[2];
+    out[0] = x * cosA - y * sinA;
+    out[1] = x * sinA + y * cosA;
+    x = out[0];
+    y = out[1];
+  }
+
+  /**
+   * Returns dot product of this vector with argument.
+   *
+   * @param vec Vector with which to perform dot product.
+   */
+  public double dot(Vector2d vec) {
+    return x * vec.x + y * vec.y;
+  }
+
+  /**
+   * Returns magnitude of vector.
+   */
+  public double magnitude() {
+    return Math.sqrt(x * x + y * y);
+  }
+
+  /**
+   * Returns scalar projection of this vector onto argument.
+   *
+   * @param vec Vector onto which to project this vector.
+   */
+  public double scalarProject(Vector2d vec) {
+    return dot(vec) / vec.magnitude();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/filters/Filter.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/filters/Filter.java
new file mode 100644
index 0000000..9e174b5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/filters/Filter.java
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.filters;
+
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+
+/**
+ * Superclass for filters.
+ */
+public abstract class Filter implements PIDSource {
+  private PIDSource m_source;
+
+  public Filter(PIDSource source) {
+    m_source = source;
+  }
+
+  @Override
+  public void setPIDSourceType(PIDSourceType pidSource) {
+    m_source.setPIDSourceType(pidSource);
+  }
+
+  @Override
+  public PIDSourceType getPIDSourceType() {
+    return m_source.getPIDSourceType();
+  }
+
+  @Override
+  public abstract double pidGet();
+
+  /**
+   * Returns the current filter estimate without also inserting new data as pidGet() would do.
+   *
+   * @return The current filter estimate
+   */
+  public abstract double get();
+
+  /**
+   * Reset the filter state.
+   */
+  public abstract void reset();
+
+  /**
+   * Calls PIDGet() of source.
+   *
+   * @return Current value of source
+   */
+  protected double pidGetSource() {
+    return m_source.pidGet();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/filters/LinearDigitalFilter.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/filters/LinearDigitalFilter.java
new file mode 100644
index 0000000..b473a24
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/filters/LinearDigitalFilter.java
@@ -0,0 +1,183 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.filters;
+
+import edu.wpi.first.wpilibj.CircularBuffer;
+import edu.wpi.first.wpilibj.PIDSource;
+
+/**
+ * This class implements a linear, digital filter. All types of FIR and IIR filters are supported.
+ * Static factory methods are provided to create commonly used types of filters.
+ *
+ * <p>Filters are of the form: y[n] = (b0*x[n] + b1*x[n-1] + ... + bP*x[n-P]) - (a0*y[n-1] +
+ * a2*y[n-2] + ... + aQ*y[n-Q])
+ *
+ * <p>Where: y[n] is the output at time "n" x[n] is the input at time "n" y[n-1] is the output from
+ * the LAST time step ("n-1") x[n-1] is the input from the LAST time step ("n-1") b0...bP are the
+ * "feedforward" (FIR) gains a0...aQ are the "feedback" (IIR) gains IMPORTANT! Note the "-" sign in
+ * front of the feedback term! This is a common convention in signal processing.
+ *
+ * <p>What can linear filters do? Basically, they can filter, or diminish, the effects of
+ * undesirable input frequencies. High frequencies, or rapid changes, can be indicative of sensor
+ * noise or be otherwise undesirable. A "low pass" filter smooths out the signal, reducing the
+ * impact of these high frequency components.  Likewise, a "high pass" filter gets rid of
+ * slow-moving signal components, letting you detect large changes more easily.
+ *
+ * <p>Example FRC applications of filters: - Getting rid of noise from an analog sensor input (note:
+ * the roboRIO's FPGA can do this faster in hardware) - Smoothing out joystick input to prevent the
+ * wheels from slipping or the robot from tipping - Smoothing motor commands so that unnecessary
+ * strain isn't put on electrical or mechanical components - If you use clever gains, you can make a
+ * PID controller out of this class!
+ *
+ * <p>For more on filters, I highly recommend the following articles: http://en.wikipedia
+ * .org/wiki/Linear_filter http://en.wikipedia.org/wiki/Iir_filter http://en.wikipedia
+ * .org/wiki/Fir_filter
+ *
+ * <p>Note 1: PIDGet() should be called by the user on a known, regular period. You can set up a
+ * Notifier to do this (look at the WPILib PIDController class), or do it "inline" with code in a
+ * periodic function.
+ *
+ * <p>Note 2: For ALL filters, gains are necessarily a function of frequency. If you make a filter
+ * that works well for you at, say, 100Hz, you will most definitely need to adjust the gains if you
+ * then want to run it at 200Hz! Combining this with Note 1 - the impetus is on YOU as a developer
+ * to make sure PIDGet() gets called at the desired, constant frequency!
+ */
+public class LinearDigitalFilter extends Filter {
+  private CircularBuffer m_inputs;
+  private CircularBuffer m_outputs;
+  private double[] m_inputGains;
+  private double[] m_outputGains;
+
+  /**
+   * Create a linear FIR or IIR filter.
+   *
+   * @param source  The PIDSource object that is used to get values
+   * @param ffGains The "feed forward" or FIR gains
+   * @param fbGains The "feed back" or IIR gains
+   */
+  public LinearDigitalFilter(PIDSource source, double[] ffGains,
+                             double[] fbGains) {
+    super(source);
+    m_inputs = new CircularBuffer(ffGains.length);
+    m_outputs = new CircularBuffer(fbGains.length);
+    m_inputGains = ffGains;
+    m_outputGains = fbGains;
+  }
+
+  /**
+   * Creates a one-pole IIR low-pass filter of the form: y[n] = (1-gain)*x[n] + gain*y[n-1] where
+   * gain = e^(-dt / T), T is the time constant in seconds.
+   *
+   * <p>This filter is stable for time constants greater than zero.
+   *
+   * @param source       The PIDSource object that is used to get values
+   * @param timeConstant The discrete-time time constant in seconds
+   * @param period       The period in seconds between samples taken by the user
+   */
+  public static LinearDigitalFilter singlePoleIIR(PIDSource source,
+                                                  double timeConstant,
+                                                  double period) {
+    double gain = Math.exp(-period / timeConstant);
+    double[] ffGains = {1.0 - gain};
+    double[] fbGains = {-gain};
+
+    return new LinearDigitalFilter(source, ffGains, fbGains);
+  }
+
+  /**
+   * Creates a first-order high-pass filter of the form: y[n] = gain*x[n] + (-gain)*x[n-1] +
+   * gain*y[n-1] where gain = e^(-dt / T), T is the time constant in seconds.
+   *
+   * <p>This filter is stable for time constants greater than zero.
+   *
+   * @param source       The PIDSource object that is used to get values
+   * @param timeConstant The discrete-time time constant in seconds
+   * @param period       The period in seconds between samples taken by the user
+   */
+  public static LinearDigitalFilter highPass(PIDSource source,
+                                             double timeConstant,
+                                             double period) {
+    double gain = Math.exp(-period / timeConstant);
+    double[] ffGains = {gain, -gain};
+    double[] fbGains = {-gain};
+
+    return new LinearDigitalFilter(source, ffGains, fbGains);
+  }
+
+  /**
+   * Creates a K-tap FIR moving average filter of the form: y[n] = 1/k * (x[k] + x[k-1] + ... +
+   * x[0]).
+   *
+   * <p>This filter is always stable.
+   *
+   * @param source The PIDSource object that is used to get values
+   * @param taps   The number of samples to average over. Higher = smoother but slower
+   * @throws IllegalArgumentException if number of taps is less than 1
+   */
+  public static LinearDigitalFilter movingAverage(PIDSource source, int taps) {
+    if (taps <= 0) {
+      throw new IllegalArgumentException("Number of taps was not at least 1");
+    }
+
+    double[] ffGains = new double[taps];
+    for (int i = 0; i < ffGains.length; i++) {
+      ffGains[i] = 1.0 / taps;
+    }
+
+    double[] fbGains = new double[0];
+
+    return new LinearDigitalFilter(source, ffGains, fbGains);
+  }
+
+  @Override
+  public double get() {
+    double retVal = 0.0;
+
+    // Calculate the new value
+    for (int i = 0; i < m_inputGains.length; i++) {
+      retVal += m_inputs.get(i) * m_inputGains[i];
+    }
+    for (int i = 0; i < m_outputGains.length; i++) {
+      retVal -= m_outputs.get(i) * m_outputGains[i];
+    }
+
+    return retVal;
+  }
+
+  @Override
+  public void reset() {
+    m_inputs.clear();
+    m_outputs.clear();
+  }
+
+  /**
+   * Calculates the next value of the filter.
+   *
+   * @return The filtered value at this step
+   */
+  @Override
+  public double pidGet() {
+    double retVal = 0.0;
+
+    // Rotate the inputs
+    m_inputs.addFirst(pidGetSource());
+
+    // Calculate the new value
+    for (int i = 0; i < m_inputGains.length; i++) {
+      retVal += m_inputs.get(i) * m_inputGains[i];
+    }
+    for (int i = 0; i < m_outputGains.length; i++) {
+      retVal -= m_outputs.get(i) * m_outputGains[i];
+    }
+
+    // Rotate the outputs
+    m_outputs.addFirst(retVal);
+
+    return retVal;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AccelerometerJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AccelerometerJNI.java
new file mode 100644
index 0000000..763f26a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AccelerometerJNI.java
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class AccelerometerJNI extends JNIWrapper {
+  public static native void setAccelerometerActive(boolean active);
+
+  public static native void setAccelerometerRange(int range);
+
+  public static native double getAccelerometerX();
+
+  public static native double getAccelerometerY();
+
+  public static native double getAccelerometerZ();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AllianceStationID.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AllianceStationID.java
new file mode 100644
index 0000000..5f4bea9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AllianceStationID.java
@@ -0,0 +1,12 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public enum AllianceStationID {
+  Red1, Red2, Red3, Blue1, Blue2, Blue3
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AnalogGyroJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AnalogGyroJNI.java
new file mode 100644
index 0000000..df85536
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AnalogGyroJNI.java
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class AnalogGyroJNI extends JNIWrapper {
+  public static native int initializeAnalogGyro(int halAnalogInputHandle);
+
+  public static native void setupAnalogGyro(int handle);
+
+  public static native void freeAnalogGyro(int handle);
+
+  public static native void setAnalogGyroParameters(int handle,
+                                                    double voltsPerDegreePerSecond,
+                                                    double offset, int center);
+
+  public static native void setAnalogGyroVoltsPerDegreePerSecond(int handle,
+                                                                 double voltsPerDegreePerSecond);
+
+  public static native void resetAnalogGyro(int handle);
+
+  public static native void calibrateAnalogGyro(int handle);
+
+  public static native void setAnalogGyroDeadband(int handle, double volts);
+
+  public static native double getAnalogGyroAngle(int handle);
+
+  public static native double getAnalogGyroRate(int handle);
+
+  public static native double getAnalogGyroOffset(int handle);
+
+  public static native int getAnalogGyroCenter(int handle);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AnalogJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AnalogJNI.java
new file mode 100644
index 0000000..9745547
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/AnalogJNI.java
@@ -0,0 +1,117 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import edu.wpi.first.wpilibj.AccumulatorResult;
+import java.nio.IntBuffer;
+
+public class AnalogJNI extends JNIWrapper {
+  /**
+   * <i>native declaration : AthenaJava\target\native\include\HAL\Analog.h:58</i><br> enum values
+   */
+  public interface AnalogTriggerType {
+    /**
+     * <i>native declaration : AthenaJava\target\native\include\HAL\Analog.h:54</i>
+     */
+    int kInWindow = 0;
+    /**
+     * <i>native declaration : AthenaJava\target\native\include\HAL\Analog.h:55</i>
+     */
+    int kState = 1;
+    /**
+     * <i>native declaration : AthenaJava\target\native\include\HAL\Analog.h:56</i>
+     */
+    int kRisingPulse = 2;
+    /**
+     * <i>native declaration : AthenaJava\target\native\include\HAL\Analog.h:57</i>
+     */
+    int kFallingPulse = 3;
+  }
+
+  public static native int initializeAnalogInputPort(int halPortHandle);
+
+  public static native void freeAnalogInputPort(int portHandle);
+
+  public static native int initializeAnalogOutputPort(int halPortHandle);
+
+  public static native void freeAnalogOutputPort(int portHandle);
+
+  public static native boolean checkAnalogModule(byte module);
+
+  public static native boolean checkAnalogInputChannel(int channel);
+
+  public static native boolean checkAnalogOutputChannel(int channel);
+
+  public static native void setAnalogOutput(int portHandle, double voltage);
+
+  public static native double getAnalogOutput(int portHandle);
+
+  public static native void setAnalogSampleRate(double samplesPerSecond);
+
+  public static native double getAnalogSampleRate();
+
+  public static native void setAnalogAverageBits(int analogPortHandle, int bits);
+
+  public static native int getAnalogAverageBits(int analogPortHandle);
+
+  public static native void setAnalogOversampleBits(int analogPortHandle, int bits);
+
+  public static native int getAnalogOversampleBits(int analogPortHandle);
+
+  public static native short getAnalogValue(int analogPortHandle);
+
+  public static native int getAnalogAverageValue(int analogPortHandle);
+
+  public static native int getAnalogVoltsToValue(int analogPortHandle, double voltage);
+
+  public static native double getAnalogVoltage(int analogPortHandle);
+
+  public static native double getAnalogAverageVoltage(int analogPortHandle);
+
+  public static native int getAnalogLSBWeight(int analogPortHandle);
+
+  public static native int getAnalogOffset(int analogPortHandle);
+
+  public static native boolean isAccumulatorChannel(int analogPortHandle);
+
+  public static native void initAccumulator(int analogPortHandle);
+
+  public static native void resetAccumulator(int analogPortHandle);
+
+  public static native void setAccumulatorCenter(int analogPortHandle, int center);
+
+  public static native void setAccumulatorDeadband(int analogPortHandle, int deadband);
+
+  public static native long getAccumulatorValue(int analogPortHandle);
+
+  public static native int getAccumulatorCount(int analogPortHandle);
+
+  public static native void getAccumulatorOutput(int analogPortHandle, AccumulatorResult result);
+
+  public static native int initializeAnalogTrigger(int analogInputHandle, IntBuffer index);
+
+  public static native void cleanAnalogTrigger(int analogTriggerHandle);
+
+  public static native void setAnalogTriggerLimitsRaw(int analogTriggerHandle, int lower,
+                                                      int upper);
+
+  public static native void setAnalogTriggerLimitsVoltage(int analogTriggerHandle,
+                                                          double lower, double upper);
+
+  public static native void setAnalogTriggerAveraged(int analogTriggerHandle,
+                                                     boolean useAveragedValue);
+
+  public static native void setAnalogTriggerFiltered(int analogTriggerHandle,
+                                                     boolean useFilteredValue);
+
+  public static native boolean getAnalogTriggerInWindow(int analogTriggerHandle);
+
+  public static native boolean getAnalogTriggerTriggerState(int analogTriggerHandle);
+
+  public static native boolean getAnalogTriggerOutput(int analogTriggerHandle, int type);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/CompressorJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/CompressorJNI.java
new file mode 100644
index 0000000..756a23d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/CompressorJNI.java
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class CompressorJNI extends JNIWrapper {
+  public static native int initializeCompressor(byte module);
+
+  public static native boolean checkCompressorModule(byte module);
+
+  public static native boolean getCompressor(int compressorHandle);
+
+  public static native void setCompressorClosedLoopControl(int compressorHandle, boolean value);
+
+  public static native boolean getCompressorClosedLoopControl(int compressorHandle);
+
+  public static native boolean getCompressorPressureSwitch(int compressorHandle);
+
+  public static native double getCompressorCurrent(int compressorHandle);
+
+  public static native boolean getCompressorCurrentTooHighFault(int compressorHandle);
+
+  public static native boolean getCompressorCurrentTooHighStickyFault(int compressorHandle);
+
+  public static native boolean getCompressorShortedStickyFault(int compressorHandle);
+
+  public static native boolean getCompressorShortedFault(int compressorHandle);
+
+  public static native boolean getCompressorNotConnectedStickyFault(int compressorHandle);
+
+  public static native boolean getCompressorNotConnectedFault(int compressorHandle);
+
+  public static native void clearAllPCMStickyFaults(byte compressorModule);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ConstantsJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ConstantsJNI.java
new file mode 100644
index 0000000..44b86ec
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ConstantsJNI.java
@@ -0,0 +1,12 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class ConstantsJNI extends JNIWrapper {
+  public static native int getSystemClockTicksPerMicrosecond();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ControlWord.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ControlWord.java
new file mode 100644
index 0000000..a821ba4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ControlWord.java
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+/**
+ * A wrapper for the HALControlWord bitfield.
+ */
+public class ControlWord {
+  private boolean m_enabled;
+  private boolean m_autonomous;
+  private boolean m_test;
+  private boolean m_emergencyStop;
+  private boolean m_fmsAttached;
+  private boolean m_dsAttached;
+
+  void update(boolean enabled, boolean autonomous, boolean test, boolean emergencyStop,
+              boolean fmsAttached, boolean dsAttached) {
+    m_enabled = enabled;
+    m_autonomous = autonomous;
+    m_test = test;
+    m_emergencyStop = emergencyStop;
+    m_fmsAttached = fmsAttached;
+    m_dsAttached = dsAttached;
+  }
+
+  public boolean getEnabled() {
+    return m_enabled;
+  }
+
+  public boolean getAutonomous() {
+    return m_autonomous;
+  }
+
+  public boolean getTest() {
+    return m_test;
+  }
+
+  public boolean getEStop() {
+    return m_emergencyStop;
+  }
+
+  public boolean getFMSAttached() {
+    return m_fmsAttached;
+  }
+
+  public boolean getDSAttached() {
+    return m_dsAttached;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/CounterJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/CounterJNI.java
new file mode 100644
index 0000000..6f9faa8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/CounterJNI.java
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import java.nio.IntBuffer;
+
+public class CounterJNI extends JNIWrapper {
+  public static native int initializeCounter(int mode, IntBuffer index);
+
+  public static native void freeCounter(int counterHandle);
+
+  public static native void setCounterAverageSize(int counterHandle, int size);
+
+  public static native void setCounterUpSource(int counterHandle, int digitalSourceHandle,
+                                               int analogTriggerType);
+
+  public static native void setCounterUpSourceEdge(int counterHandle, boolean risingEdge,
+                                                   boolean fallingEdge);
+
+  public static native void clearCounterUpSource(int counterHandle);
+
+  public static native void setCounterDownSource(int counterHandle, int digitalSourceHandle,
+                                                 int analogTriggerType);
+
+  public static native void setCounterDownSourceEdge(int counterHandle, boolean risingEdge,
+                                                     boolean fallingEdge);
+
+  public static native void clearCounterDownSource(int counterHandle);
+
+  public static native void setCounterUpDownMode(int counterHandle);
+
+  public static native void setCounterExternalDirectionMode(int counterHandle);
+
+  public static native void setCounterSemiPeriodMode(int counterHandle,
+                                                     boolean highSemiPeriod);
+
+  public static native void setCounterPulseLengthMode(int counterHandle, double threshold);
+
+  public static native int getCounterSamplesToAverage(int counterHandle);
+
+  public static native void setCounterSamplesToAverage(int counterHandle,
+                                                       int samplesToAverage);
+
+  public static native void resetCounter(int counterHandle);
+
+  public static native int getCounter(int counterHandle);
+
+  public static native double getCounterPeriod(int counterHandle);
+
+  public static native void setCounterMaxPeriod(int counterHandle, double maxPeriod);
+
+  public static native void setCounterUpdateWhenEmpty(int counterHandle, boolean enabled);
+
+  public static native boolean getCounterStopped(int counterHandle);
+
+  public static native boolean getCounterDirection(int counterHandle);
+
+  public static native void setCounterReverseDirection(int counterHandle,
+                                                       boolean reverseDirection);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/DIOJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/DIOJNI.java
new file mode 100644
index 0000000..c861621
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/DIOJNI.java
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class DIOJNI extends JNIWrapper {
+  public static native int initializeDIOPort(int halPortHandle, boolean input);
+
+  public static native boolean checkDIOChannel(int channel);
+
+  public static native void freeDIOPort(int dioPortHandle);
+
+  public static native void setDIO(int dioPortHandle, short value);
+
+  public static native boolean getDIO(int dioPortHandle);
+
+  public static native boolean getDIODirection(int dioPortHandle);
+
+  public static native void pulse(int dioPortHandle, double pulseLength);
+
+  public static native boolean isPulsing(int dioPortHandle);
+
+  public static native boolean isAnyPulsing();
+
+  public static native short getLoopTiming();
+
+  public static native int allocateDigitalPWM();
+
+  public static native void freeDigitalPWM(int pwmGenerator);
+
+  public static native void setDigitalPWMRate(double rate);
+
+  public static native void setDigitalPWMDutyCycle(int pwmGenerator, double dutyCycle);
+
+  public static native void setDigitalPWMOutputChannel(int pwmGenerator, int channel);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/DigitalGlitchFilterJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/DigitalGlitchFilterJNI.java
new file mode 100644
index 0000000..83eedef
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/DigitalGlitchFilterJNI.java
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class DigitalGlitchFilterJNI extends JNIWrapper {
+  public static native void setFilterSelect(int digitalPortHandle, int filterIndex);
+
+  public static native int getFilterSelect(int digitalPortHandle);
+
+  public static native void setFilterPeriod(int filterIndex, int fpgaCycles);
+
+  public static native int getFilterPeriod(int filterIndex);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/EncoderJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/EncoderJNI.java
new file mode 100644
index 0000000..f8318b4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/EncoderJNI.java
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class EncoderJNI extends JNIWrapper {
+  public static native int initializeEncoder(int digitalSourceHandleA, int analogTriggerTypeA,
+                                             int digitalSourceHandleB, int analogTriggerTypeB,
+                                             boolean reverseDirection, int encodingType);
+
+  public static native void freeEncoder(int encoderHandle);
+
+  public static native int getEncoder(int encoderHandle);
+
+  public static native int getEncoderRaw(int encoderHandle);
+
+  public static native int getEncodingScaleFactor(int encoderHandle);
+
+  public static native void resetEncoder(int encoderHandle);
+
+  public static native double getEncoderPeriod(int encoderHandle);
+
+  public static native void setEncoderMaxPeriod(int encoderHandle, double maxPeriod);
+
+  public static native boolean getEncoderStopped(int encoderHandle);
+
+  public static native boolean getEncoderDirection(int encoderHandle);
+
+  public static native double getEncoderDistance(int encoderHandle);
+
+  public static native double getEncoderRate(int encoderHandle);
+
+  public static native void setEncoderMinRate(int encoderHandle, double minRate);
+
+  public static native void setEncoderDistancePerPulse(int encoderHandle, double distancePerPulse);
+
+  public static native void setEncoderReverseDirection(int encoderHandle,
+                                                       boolean reverseDirection);
+
+  public static native void setEncoderSamplesToAverage(int encoderHandle,
+                                                       int samplesToAverage);
+
+  public static native int getEncoderSamplesToAverage(int encoderHandle);
+
+  public static native void setEncoderIndexSource(int encoderHandle, int digitalSourceHandle,
+                                                  int analogTriggerType, int indexingType);
+
+  @SuppressWarnings("AbbreviationAsWordInName")
+  public static native int getEncoderFPGAIndex(int encoderHandle);
+
+  public static native int getEncoderEncodingScale(int encoderHandle);
+
+  public static native double getEncoderDecodingScaleFactor(int encoderHandle);
+
+  public static native double getEncoderDistancePerPulse(int encoderHandle);
+
+  public static native int getEncoderEncodingType(int encoderHandle);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/FRCNetComm.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/FRCNetComm.java
new file mode 100644
index 0000000..ebcd1fe
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/FRCNetComm.java
@@ -0,0 +1,160 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+/**
+ * JNI wrapper for library <b>FRC_NetworkCommunication</b><br>.
+ */
+@SuppressWarnings("MethodName")
+public class FRCNetComm extends JNIWrapper {
+  /**
+   * Module type from LoadOut.h
+   */
+  @SuppressWarnings("TypeName")
+  public interface tModuleType {
+    int kModuleType_Unknown = 0x00;
+    int kModuleType_Analog = 0x01;
+    int kModuleType_Digital = 0x02;
+    int kModuleType_Solenoid = 0x03;
+  }
+
+  /**
+   * Target class from LoadOut.h
+   */
+  @SuppressWarnings("TypeName")
+  public interface tTargetClass {
+    int kTargetClass_Unknown = 0x00;
+    int kTargetClass_FRC1 = 0x10;
+    int kTargetClass_FRC2 = 0x20;
+    int kTargetClass_FRC3 = 0x30;
+    int kTargetClass_RoboRIO = 0x40;
+    int kTargetClass_FRC2_Analog = kTargetClass_FRC2 | tModuleType.kModuleType_Analog;
+    int kTargetClass_FRC2_Digital = kTargetClass_FRC2 | tModuleType.kModuleType_Digital;
+    int kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | tModuleType.kModuleType_Solenoid;
+    int kTargetClass_FamilyMask = 0xF0;
+    int kTargetClass_ModuleMask = 0x0F;
+  }
+
+  /**
+   * Resource type from UsageReporting.h
+   */
+  @SuppressWarnings("TypeName")
+  public interface tResourceType {
+    int kResourceType_Controller = 0;
+    int kResourceType_Module = 1;
+    int kResourceType_Language = 2;
+    int kResourceType_CANPlugin = 3;
+    int kResourceType_Accelerometer = 4;
+    int kResourceType_ADXL345 = 5;
+    int kResourceType_AnalogChannel = 6;
+    int kResourceType_AnalogTrigger = 7;
+    int kResourceType_AnalogTriggerOutput = 8;
+    int kResourceType_CANJaguar = 9;
+    int kResourceType_Compressor = 10;
+    int kResourceType_Counter = 11;
+    int kResourceType_Dashboard = 12;
+    int kResourceType_DigitalInput = 13;
+    int kResourceType_DigitalOutput = 14;
+    int kResourceType_DriverStationCIO = 15;
+    int kResourceType_DriverStationEIO = 16;
+    int kResourceType_DriverStationLCD = 17;
+    int kResourceType_Encoder = 18;
+    int kResourceType_GearTooth = 19;
+    int kResourceType_Gyro = 20;
+    int kResourceType_I2C = 21;
+    int kResourceType_Framework = 22;
+    int kResourceType_Jaguar = 23;
+    int kResourceType_Joystick = 24;
+    int kResourceType_Kinect = 25;
+    int kResourceType_KinectStick = 26;
+    int kResourceType_PIDController = 27;
+    int kResourceType_Preferences = 28;
+    int kResourceType_PWM = 29;
+    int kResourceType_Relay = 30;
+    int kResourceType_RobotDrive = 31;
+    int kResourceType_SerialPort = 32;
+    int kResourceType_Servo = 33;
+    int kResourceType_Solenoid = 34;
+    int kResourceType_SPI = 35;
+    int kResourceType_Task = 36;
+    int kResourceType_Ultrasonic = 37;
+    int kResourceType_Victor = 38;
+    int kResourceType_Button = 39;
+    int kResourceType_Command = 40;
+    int kResourceType_AxisCamera = 41;
+    int kResourceType_PCVideoServer = 42;
+    int kResourceType_SmartDashboard = 43;
+    int kResourceType_Talon = 44;
+    int kResourceType_HiTechnicColorSensor = 45;
+    int kResourceType_HiTechnicAccel = 46;
+    int kResourceType_HiTechnicCompass = 47;
+    int kResourceType_SRF08 = 48;
+    int kResourceType_AnalogOutput = 49;
+    int kResourceType_VictorSP = 50;
+    int kResourceType_PWMTalonSRX = 51;
+    int kResourceType_CANTalonSRX = 52;
+    int kResourceType_ADXL362 = 53;
+    int kResourceType_ADXRS450 = 54;
+    int kResourceType_RevSPARK = 55;
+    int kResourceType_MindsensorsSD540 = 56;
+    int kResourceType_DigitalFilter = 57;
+    int kResourceType_ADIS16448 = 58;
+    int kResourceType_PDP = 59;
+    int kResourceType_PCM = 60;
+    int kResourceType_PigeonIMU = 61;
+    int kResourceType_NidecBrushless = 62;
+  }
+
+  /**
+   * Instances from UsageReporting.h
+   */
+  @SuppressWarnings("TypeName")
+  public interface tInstances {
+    int kLanguage_LabVIEW = 1;
+    int kLanguage_CPlusPlus = 2;
+    int kLanguage_Java = 3;
+    int kLanguage_Python = 4;
+
+    int kCANPlugin_BlackJagBridge = 1;
+    int kCANPlugin_2CAN = 2;
+
+    int kFramework_Iterative = 1;
+    int kFramework_Simple = 2;
+    int kFramework_CommandControl = 3;
+
+    int kRobotDrive_ArcadeStandard = 1;
+    int kRobotDrive_ArcadeButtonSpin = 2;
+    int kRobotDrive_ArcadeRatioCurve = 3;
+    int kRobotDrive_Tank = 4;
+    int kRobotDrive_MecanumPolar = 5;
+    int kRobotDrive_MecanumCartesian = 6;
+
+    int kDriverStationCIO_Analog = 1;
+    int kDriverStationCIO_DigitalIn = 2;
+    int kDriverStationCIO_DigitalOut = 3;
+
+    int kDriverStationEIO_Acceleration = 1;
+    int kDriverStationEIO_AnalogIn = 2;
+    int kDriverStationEIO_AnalogOut = 3;
+    int kDriverStationEIO_Button = 4;
+    int kDriverStationEIO_LED = 5;
+    int kDriverStationEIO_DigitalIn = 6;
+    int kDriverStationEIO_DigitalOut = 7;
+    int kDriverStationEIO_FixedDigitalOut = 8;
+    int kDriverStationEIO_PWM = 9;
+    int kDriverStationEIO_Encoder = 10;
+    int kDriverStationEIO_TouchSlider = 11;
+
+    int kADXL345_SPI = 1;
+    int kADXL345_I2C = 2;
+
+    int kCommand_Scheduler = 1;
+
+    int kSmartDashboard_Instance = 1;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/HAL.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/HAL.java
new file mode 100644
index 0000000..2516a40
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/HAL.java
@@ -0,0 +1,126 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import java.nio.ByteBuffer;
+
+/**
+ * JNI Wrapper for HAL<br>.
+ */
+@SuppressWarnings({"AbbreviationAsWordInName", "MethodName"})
+public class HAL extends JNIWrapper {
+  public static native void waitForDSData();
+
+  public static native boolean initialize(int timeout, int mode);
+
+  public static native void observeUserProgramStarting();
+
+  public static native void observeUserProgramDisabled();
+
+  public static native void observeUserProgramAutonomous();
+
+  public static native void observeUserProgramTeleop();
+
+  public static native void observeUserProgramTest();
+
+  public static void report(int resource, int instanceNumber) {
+    report(resource, instanceNumber, 0, "");
+  }
+
+  public static void report(int resource, int instanceNumber, int context) {
+    report(resource, instanceNumber, context, "");
+  }
+
+  /**
+   * Report the usage of a resource of interest. <br>
+   *
+   * <p>Original signature: <code>uint32_t report(tResourceType, uint8_t, uint8_t, const
+   * char*)</code>
+   *
+   * @param resource       one of the values in the tResourceType above (max value 51). <br>
+   * @param instanceNumber an index that identifies the resource instance. <br>
+   * @param context        an optional additional context number for some cases (such as module
+   *                       number). Set to 0 to omit. <br>
+   * @param feature        a string to be included describing features in use on a specific
+   *                       resource. Setting the same resource more than once allows you to change
+   *                       the feature string.
+   */
+  public static native int report(int resource, int instanceNumber, int context, String feature);
+
+  public static native int nativeGetControlWord();
+
+  @SuppressWarnings("JavadocMethod")
+  public static void getControlWord(ControlWord controlWord) {
+    int word = nativeGetControlWord();
+    controlWord.update((word & 1) != 0, ((word >> 1) & 1) != 0, ((word >> 2) & 1) != 0,
+        ((word >> 3) & 1) != 0, ((word >> 4) & 1) != 0, ((word >> 5) & 1) != 0);
+  }
+
+  private static native int nativeGetAllianceStation();
+
+  @SuppressWarnings("JavadocMethod")
+  public static AllianceStationID getAllianceStation() {
+    switch (nativeGetAllianceStation()) {
+      case 0:
+        return AllianceStationID.Red1;
+      case 1:
+        return AllianceStationID.Red2;
+      case 2:
+        return AllianceStationID.Red3;
+      case 3:
+        return AllianceStationID.Blue1;
+      case 4:
+        return AllianceStationID.Blue2;
+      case 5:
+        return AllianceStationID.Blue3;
+      default:
+        return null;
+    }
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  public static native boolean isNewControlData();
+
+  @SuppressWarnings("JavadocMethod")
+  public static native void releaseDSMutex();
+
+  @SuppressWarnings("JavadocMethod")
+  public static native boolean waitForDSDataTimeout(double timeout);
+
+  public static int kMaxJoystickAxes = 12;
+  public static int kMaxJoystickPOVs = 12;
+
+  public static native short getJoystickAxes(byte joystickNum, float[] axesArray);
+
+  public static native short getJoystickPOVs(byte joystickNum, short[] povsArray);
+
+  public static native int getJoystickButtons(byte joystickNum, ByteBuffer count);
+
+  public static native int setJoystickOutputs(byte joystickNum, int outputs, short leftRumble,
+                                              short rightRumble);
+
+  public static native int getJoystickIsXbox(byte joystickNum);
+
+  public static native int getJoystickType(byte joystickNum);
+
+  public static native String getJoystickName(byte joystickNum);
+
+  public static native int getJoystickAxisType(byte joystickNum, byte axis);
+
+  public static native double getMatchTime();
+
+  public static native boolean getSystemActive();
+
+  public static native boolean getBrownedOut();
+
+  public static native int getMatchInfo(MatchInfoData info);
+
+  public static native int sendError(boolean isError, int errorCode, boolean isLVCode,
+                                     String details, String location, String callStack,
+                                     boolean printMsg);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/HALUtil.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/HALUtil.java
new file mode 100644
index 0000000..a68255c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/HALUtil.java
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class HALUtil extends JNIWrapper {
+  public static final int NULL_PARAMETER = -1005;
+  public static final int SAMPLE_RATE_TOO_HIGH = 1001;
+  public static final int VOLTAGE_OUT_OF_RANGE = 1002;
+  public static final int LOOP_TIMING_ERROR = 1004;
+  public static final int INCOMPATIBLE_STATE = 1015;
+  public static final int ANALOG_TRIGGER_PULSE_OUTPUT_ERROR = -1011;
+  public static final int NO_AVAILABLE_RESOURCES = -104;
+  public static final int PARAMETER_OUT_OF_RANGE = -1028;
+
+  public static native short getFPGAVersion();
+
+  public static native int getFPGARevision();
+
+  public static native long getFPGATime();
+
+  public static native int getHALRuntimeType();
+
+  public static native boolean getFPGAButton();
+
+  public static native String getHALErrorMessage(int code);
+
+  public static native int getHALErrno();
+
+  public static native String getHALstrerror(int errno);
+
+  public static String getHALstrerror() {
+    return getHALstrerror(getHALErrno());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/I2CJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/I2CJNI.java
new file mode 100644
index 0000000..8aeac27
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/I2CJNI.java
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import java.nio.ByteBuffer;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class I2CJNI extends JNIWrapper {
+  public static native void i2CInitialize(int port);
+
+  public static native int i2CTransaction(int port, byte address, ByteBuffer dataToSend,
+                                          byte sendSize, ByteBuffer dataReceived, byte receiveSize);
+
+  public static native int i2CTransactionB(int port, byte address, byte[] dataToSend,
+                                           byte sendSize, byte[] dataReceived, byte receiveSize);
+
+  public static native int i2CWrite(int port, byte address, ByteBuffer dataToSend, byte sendSize);
+
+  public static native int i2CWriteB(int port, byte address, byte[] dataToSend, byte sendSize);
+
+  public static native int i2CRead(int port, byte address, ByteBuffer dataReceived,
+                                   byte receiveSize);
+
+  public static native int i2CReadB(int port, byte address, byte[] dataReceived,
+                                    byte receiveSize);
+
+  public static native void i2CClose(int port);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/InterruptJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/InterruptJNI.java
new file mode 100644
index 0000000..6973c63
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/InterruptJNI.java
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class InterruptJNI extends JNIWrapper {
+  public static final int HalInvalidHandle = 0;
+
+  public interface InterruptJNIHandlerFunction {
+    void apply(int interruptAssertedMask, Object param);
+  }
+
+  public static native int initializeInterrupts(boolean watcher);
+
+  public static native void cleanInterrupts(int interruptHandle);
+
+  public static native int waitForInterrupt(int interruptHandle, double timeout,
+                                            boolean ignorePrevious);
+
+  public static native void enableInterrupts(int interruptHandle);
+
+  public static native void disableInterrupts(int interruptHandle);
+
+  public static native double readInterruptRisingTimestamp(int interruptHandle);
+
+  public static native double readInterruptFallingTimestamp(int interruptHandle);
+
+  public static native void requestInterrupts(int interruptHandle, int digitalSourceHandle,
+                                              int analogTriggerType);
+
+  public static native void attachInterruptHandler(int interruptHandle,
+                                                   InterruptJNIHandlerFunction handler,
+                                                   Object param);
+
+  public static native void setInterruptUpSourceEdge(int interruptHandle, boolean risingEdge,
+                                                     boolean fallingEdge);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/JNIWrapper.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/JNIWrapper.java
new file mode 100644
index 0000000..e352382
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/JNIWrapper.java
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import edu.wpi.first.wpiutil.RuntimeDetector;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * Base class for all JNI wrappers.
+ */
+public class JNIWrapper {
+  static boolean libraryLoaded = false;
+  static File jniLibrary = null;
+
+  static {
+    if (!libraryLoaded) {
+      String jniFileName = "wpilibJNI";
+      try {
+        System.loadLibrary(jniFileName);
+      } catch (UnsatisfiedLinkError ule) {
+        try {
+          String resname = RuntimeDetector.getLibraryResource(jniFileName);
+          InputStream is = JNIWrapper.class.getResourceAsStream(resname);
+          if (is != null) {
+            // create temporary file
+            if (System.getProperty("os.name").startsWith("Windows")) {
+              jniLibrary = File.createTempFile(jniFileName, ".dll");
+            } else if (System.getProperty("os.name").startsWith("Mac")) {
+              jniLibrary = File.createTempFile(jniFileName, ".dylib");
+            } else {
+              jniLibrary = File.createTempFile(jniFileName, ".so");
+            }
+            // flag for delete on exit
+            jniLibrary.deleteOnExit();
+            OutputStream os = new FileOutputStream(jniLibrary);
+
+            byte[] buffer = new byte[1024];
+            int readBytes;
+            try {
+              while ((readBytes = is.read(buffer)) != -1) {
+                os.write(buffer, 0, readBytes);
+              }
+            } finally {
+              os.close();
+              is.close();
+            }
+            System.load(jniLibrary.getAbsolutePath());
+          } else {
+            System.loadLibrary(jniFileName);
+          }
+        } catch (IOException ex) {
+          ex.printStackTrace();
+          System.exit(1);
+        }
+      }
+      libraryLoaded = true;
+    }
+  }
+
+  public static native int getPortWithModule(byte module, byte channel);
+
+  public static native int getPort(byte channel);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/MatchInfoData.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/MatchInfoData.java
new file mode 100644
index 0000000..79a3cf9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/MatchInfoData.java
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+/**
+ * Structure for holding the match info data request.
+ */
+public class MatchInfoData {
+  /**
+   * Stores the event name.
+   */
+  @SuppressWarnings("MemberName")
+  public String eventName = "";
+
+  /**
+   * Stores the game specific message.
+   */
+  @SuppressWarnings("MemberName")
+  public String gameSpecificMessage = "";
+
+  /**
+   * Stores the match number.
+   */
+  @SuppressWarnings("MemberName")
+  public int matchNumber;
+
+  /**
+   * Stores the replay number.
+   */
+  @SuppressWarnings("MemberName")
+  public int replayNumber;
+
+  /**
+   * Stores the match type.
+   */
+  @SuppressWarnings("MemberName")
+  public int matchType;
+
+  /**
+   * Called from JNI to set the structure data.
+   */
+  @SuppressWarnings("JavadocMethod")
+  public void setData(String eventName, String gameSpecificMessage,
+                      int matchNumber, int replayNumber, int matchType) {
+    this.eventName = eventName;
+    this.gameSpecificMessage = gameSpecificMessage;
+    this.matchNumber = matchNumber;
+    this.replayNumber = replayNumber;
+    this.matchType = matchType;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/NotifierJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/NotifierJNI.java
new file mode 100644
index 0000000..43e218a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/NotifierJNI.java
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+/**
+ * The NotifierJNI class directly wraps the C++ HAL Notifier.
+ *
+ * <p>This class is not meant for direct use by teams. Instead, the edu.wpi.first.wpilibj.Notifier
+ * class, which corresponds to the C++ Notifier class, should be used.
+ */
+public class NotifierJNI extends JNIWrapper {
+  /**
+   * Initializes the notifier.
+   */
+  public static native int initializeNotifier();
+
+  /**
+   * Wakes up the waiter with time=0.  Note: after this function is called, all
+   * calls to waitForNotifierAlarm() will immediately start returning 0.
+   */
+  public static native void stopNotifier(int notifierHandle);
+
+  /**
+   * Deletes the notifier object when we are done with it.
+   */
+  public static native void cleanNotifier(int notifierHandle);
+
+  /**
+   * Sets the notifier to wakeup the waiter in another triggerTime microseconds.
+   */
+  public static native void updateNotifierAlarm(int notifierHandle, long triggerTime);
+
+  /**
+   * Cancels any pending wakeups set by updateNotifierAlarm().  Does NOT wake
+   * up any waiters.
+   */
+  public static native void cancelNotifierAlarm(int notifierHandle);
+
+  /**
+   * Block until woken up by an alarm (or stop).
+   * @return Time when woken up.
+   */
+  public static native long waitForNotifierAlarm(int notifierHandle);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/OSSerialPortJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/OSSerialPortJNI.java
new file mode 100644
index 0000000..b7b043b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/OSSerialPortJNI.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class OSSerialPortJNI extends JNIWrapper {
+  public static native void serialInitializePort(byte port);
+
+  public static native void serialSetBaudRate(byte port, int baud);
+
+  public static native void serialSetDataBits(byte port, byte bits);
+
+  public static native void serialSetParity(byte port, byte parity);
+
+  public static native void serialSetStopBits(byte port, byte stopBits);
+
+  public static native void serialSetWriteMode(byte port, byte mode);
+
+  public static native void serialSetFlowControl(byte port, byte flow);
+
+  public static native void serialSetTimeout(byte port, double timeout);
+
+  public static native void serialEnableTermination(byte port, char terminator);
+
+  public static native void serialDisableTermination(byte port);
+
+  public static native void serialSetReadBufferSize(byte port, int size);
+
+  public static native void serialSetWriteBufferSize(byte port, int size);
+
+  public static native int serialGetBytesReceived(byte port);
+
+  public static native int serialRead(byte port, byte[] buffer, int count);
+
+  public static native int serialWrite(byte port, byte[] buffer, int count);
+
+  public static native void serialFlush(byte port);
+
+  public static native void serialClear(byte port);
+
+  public static native void serialClose(byte port);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PDPJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PDPJNI.java
new file mode 100644
index 0000000..970168c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PDPJNI.java
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class PDPJNI extends JNIWrapper {
+  public static native void initializePDP(int module);
+
+  public static native boolean checkPDPModule(int module);
+
+  public static native boolean checkPDPChannel(int channel);
+
+  public static native double getPDPTemperature(int module);
+
+  public static native double getPDPVoltage(int module);
+
+  public static native double getPDPChannelCurrent(byte channel, int module);
+
+  public static native double getPDPTotalCurrent(int module);
+
+  public static native double getPDPTotalPower(int module);
+
+  public static native double getPDPTotalEnergy(int module);
+
+  public static native void resetPDPTotalEnergy(int module);
+
+  public static native void clearPDPStickyFaults(int module);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PWMJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PWMJNI.java
new file mode 100644
index 0000000..33eb91e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PWMJNI.java
@@ -0,0 +1,51 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import edu.wpi.first.wpilibj.PWMConfigDataResult;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class PWMJNI extends DIOJNI {
+  public static native int initializePWMPort(int halPortHandle);
+
+  public static native boolean checkPWMChannel(int channel);
+
+  public static native void freePWMPort(int pwmPortHandle);
+
+  public static native void setPWMConfigRaw(int pwmPortHandle, int maxPwm,
+                                            int deadbandMaxPwm, int centerPwm,
+                                            int deadbandMinPwm, int minPwm);
+
+  public static native void setPWMConfig(int pwmPortHandle, double maxPwm,
+                                         double deadbandMaxPwm, double centerPwm,
+                                         double deadbandMinPwm, double minPwm);
+
+  public static native PWMConfigDataResult getPWMConfigRaw(int pwmPortHandle);
+
+  public static native void setPWMEliminateDeadband(int pwmPortHandle, boolean eliminateDeadband);
+
+  public static native boolean getPWMEliminateDeadband(int pwmPortHandle);
+
+  public static native void setPWMRaw(int pwmPortHandle, short value);
+
+  public static native void setPWMSpeed(int pwmPortHandle, double speed);
+
+  public static native void setPWMPosition(int pwmPortHandle, double position);
+
+  public static native short getPWMRaw(int pwmPortHandle);
+
+  public static native double getPWMSpeed(int pwmPortHandle);
+
+  public static native double getPWMPosition(int pwmPortHandle);
+
+  public static native  void setPWMDisabled(int pwmPortHandle);
+
+  public static native void latchPWMZero(int pwmPortHandle);
+
+  public static native void setPWMPeriodScale(int pwmPortHandle, int squelchMask);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PortsJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PortsJNI.java
new file mode 100644
index 0000000..aadf3f3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PortsJNI.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class PortsJNI extends JNIWrapper {
+  public static native int getNumAccumulators();
+
+  public static native int getNumAnalogTriggers();
+
+  public static native int getNumAnalogInputs();
+
+  public static native int getNumAnalogOutputs();
+
+  public static native int getNumCounters();
+
+  public static native int getNumDigitalHeaders();
+
+  public static native int getNumPWMHeaders();
+
+  public static native int getNumDigitalChannels();
+
+  public static native int getNumPWMChannels();
+
+  public static native int getNumDigitalPWMOutputs();
+
+  public static native int getNumEncoders();
+
+  public static native int getNumInterrupts();
+
+  public static native int getNumRelayChannels();
+
+  public static native int getNumRelayHeaders();
+
+  public static native int getNumPCMModules();
+
+  public static native int getNumSolenoidChannels();
+
+  public static native int getNumPDPModules();
+
+  public static native int getNumPDPChannels();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PowerJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PowerJNI.java
new file mode 100644
index 0000000..887b914
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/PowerJNI.java
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class PowerJNI extends JNIWrapper {
+  public static native double getVinVoltage();
+
+  public static native double getVinCurrent();
+
+  public static native double getUserVoltage6V();
+
+  public static native double getUserCurrent6V();
+
+  public static native boolean getUserActive6V();
+
+  public static native int getUserCurrentFaults6V();
+
+  public static native double getUserVoltage5V();
+
+  public static native double getUserCurrent5V();
+
+  public static native boolean getUserActive5V();
+
+  public static native int getUserCurrentFaults5V();
+
+  public static native double getUserVoltage3V3();
+
+  public static native double getUserCurrent3V3();
+
+  public static native boolean getUserActive3V3();
+
+  public static native int getUserCurrentFaults3V3();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/RelayJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/RelayJNI.java
new file mode 100644
index 0000000..aa2bf7a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/RelayJNI.java
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class RelayJNI extends DIOJNI {
+  public static native int initializeRelayPort(int halPortHandle, boolean forward);
+
+  public static native void freeRelayPort(int relayPortHandle);
+
+  public static native boolean checkRelayChannel(int channel);
+
+  public static native void setRelay(int relayPortHandle, boolean on);
+
+  public static native boolean getRelay(int relayPortHandle);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SPIJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SPIJNI.java
new file mode 100644
index 0000000..9bcca72
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SPIJNI.java
@@ -0,0 +1,64 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import java.nio.ByteBuffer;
+
+@SuppressWarnings("AbbreviationAsWordInName")
+public class SPIJNI extends JNIWrapper {
+  public static native void spiInitialize(int port);
+
+  public static native int spiTransaction(int port, ByteBuffer dataToSend,
+                                          ByteBuffer dataReceived, byte size);
+
+  public static native int spiTransactionB(int port, byte[] dataToSend,
+                                           byte[] dataReceived, byte size);
+
+  public static native int spiWrite(int port, ByteBuffer dataToSend, byte sendSize);
+
+  public static native int spiWriteB(int port, byte[] dataToSend, byte sendSize);
+
+  public static native int spiRead(int port, boolean initiate, ByteBuffer dataReceived, byte size);
+
+  public static native int spiReadB(int port, boolean initiate, byte[] dataReceived, byte size);
+
+  public static native void spiClose(int port);
+
+  public static native void spiSetSpeed(int port, int speed);
+
+  public static native void spiSetOpts(int port, int msbFirst, int sampleOnTrailing,
+                                       int clkIdleHigh);
+
+  public static native void spiSetChipSelectActiveHigh(int port);
+
+  public static native void spiSetChipSelectActiveLow(int port);
+
+  public static native void spiInitAuto(int port, int bufferSize);
+
+  public static native void spiFreeAuto(int port);
+
+  public static native void spiStartAutoRate(int port, double period);
+
+  public static native void spiStartAutoTrigger(int port, int digitalSourceHandle,
+                                                int analogTriggerType, boolean triggerRising,
+                                                boolean triggerFalling);
+
+  public static native void spiStopAuto(int port);
+
+  public static native void spiSetAutoTransmitData(int port, byte[] dataToSend, int zeroSize);
+
+  public static native void spiForceAutoRead(int port);
+
+  public static native int spiReadAutoReceivedData(int port, ByteBuffer buffer, int numToRead,
+                                                   double timeout);
+
+  public static native int spiReadAutoReceivedData(int port, byte[] buffer, int numToRead,
+                                                   double timeout);
+
+  public static native int spiGetAutoDroppedCount(int port);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SerialPortJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SerialPortJNI.java
new file mode 100644
index 0000000..f626dc0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SerialPortJNI.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class SerialPortJNI extends JNIWrapper {
+  public static native void serialInitializePort(byte port);
+
+  public static native void serialSetBaudRate(byte port, int baud);
+
+  public static native void serialSetDataBits(byte port, byte bits);
+
+  public static native void serialSetParity(byte port, byte parity);
+
+  public static native void serialSetStopBits(byte port, byte stopBits);
+
+  public static native void serialSetWriteMode(byte port, byte mode);
+
+  public static native void serialSetFlowControl(byte port, byte flow);
+
+  public static native void serialSetTimeout(byte port, double timeout);
+
+  public static native void serialEnableTermination(byte port, char terminator);
+
+  public static native void serialDisableTermination(byte port);
+
+  public static native void serialSetReadBufferSize(byte port, int size);
+
+  public static native void serialSetWriteBufferSize(byte port, int size);
+
+  public static native int serialGetBytesReceived(byte port);
+
+  public static native int serialRead(byte port, byte[] buffer, int count);
+
+  public static native int serialWrite(byte port, byte[] buffer, int count);
+
+  public static native void serialFlush(byte port);
+
+  public static native void serialClear(byte port);
+
+  public static native void serialClose(byte port);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SolenoidJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SolenoidJNI.java
new file mode 100644
index 0000000..fcde112
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/SolenoidJNI.java
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class SolenoidJNI extends JNIWrapper {
+  public static native int initializeSolenoidPort(int halPortHandle);
+
+  public static native boolean checkSolenoidModule(int module);
+
+  public static native boolean checkSolenoidChannel(int channel);
+
+  public static native void freeSolenoidPort(int portHandle);
+
+  public static native void setSolenoid(int portHandle, boolean on);
+
+  public static native boolean getSolenoid(int portHandle);
+
+  public static native int getAllSolenoids(int module);
+
+  public static native int getPCMSolenoidBlackList(int module);
+
+  public static native boolean getPCMSolenoidVoltageStickyFault(int module);
+
+  public static native boolean getPCMSolenoidVoltageFault(int module);
+
+  public static native void clearAllPCMStickyFaults(int module);
+
+  public static native void setOneShotDuration(int portHandle, long durationMS);
+
+  public static native void fireOneShot(int portHandle);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ThreadsJNI.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ThreadsJNI.java
new file mode 100644
index 0000000..2667d3a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/hal/ThreadsJNI.java
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+public class ThreadsJNI extends JNIWrapper {
+  public static native int getCurrentThreadPriority();
+
+  public static native boolean getCurrentThreadIsRealTime();
+
+  public static native boolean setCurrentThreadPriority(boolean realTime, int priority);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Accelerometer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Accelerometer.java
new file mode 100644
index 0000000..81086d4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Accelerometer.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.interfaces;
+
+/**
+ * Interface for 3-axis accelerometers.
+ */
+public interface Accelerometer {
+  enum Range {
+    k2G, k4G, k8G, k16G
+  }
+
+  /**
+   * Common interface for setting the measuring range of an accelerometer.
+   *
+   * @param range The maximum acceleration, positive or negative, that the accelerometer will
+   *              measure. Not all accelerometers support all ranges.
+   */
+  void setRange(Range range);
+
+  /**
+   * Common interface for getting the x axis acceleration.
+   *
+   * @return The acceleration along the x axis in g-forces
+   */
+  double getX();
+
+  /**
+   * Common interface for getting the y axis acceleration.
+   *
+   * @return The acceleration along the y axis in g-forces
+   */
+  double getY();
+
+  /**
+   * Common interface for getting the z axis acceleration.
+   *
+   * @return The acceleration along the z axis in g-forces
+   */
+  double getZ();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Gyro.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Gyro.java
new file mode 100644
index 0000000..4277425
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Gyro.java
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.interfaces;
+
+/**
+ * Interface for yaw rate gyros.
+ */
+public interface Gyro {
+  /**
+   * Calibrate the gyro by running for a number of samples and computing the center value. Then use
+   * the center value as the Accumulator center value for subsequent measurements. It's important to
+   * make sure that the robot is not moving while the centering calculations are in progress, this
+   * is typically done when the robot is first turned on while it's sitting at rest before the
+   * competition starts.
+   */
+  void calibrate();
+
+  /**
+   * Reset the gyro. Resets the gyro to a heading of zero. This can be used if there is significant
+   * drift in the gyro and it needs to be recalibrated after it has been running.
+   */
+  void reset();
+
+  /**
+   * Return the actual angle in degrees that the robot is currently facing.
+   *
+   * <p>The angle is based on the current accumulator value corrected by the oversampling rate, the
+   * gyro type and the A/D calibration values. The angle is continuous, that is it will continue
+   * from 360 to 361 degrees. This allows algorithms that wouldn't want to see a discontinuity in
+   * the gyro output as it sweeps past from 360 to 0 on the second time around.
+   *
+   * <p>This heading is based on integration of the returned rate from the gyro.
+   *
+   * @return the current heading of the robot in degrees.
+   */
+  double getAngle();
+
+  /**
+   * Return the rate of rotation of the gyro.
+   *
+   * <p>The rate is based on the most recent reading of the gyro analog value
+   *
+   * @return the current rate in degrees per second
+   */
+  double getRate();
+
+  /**
+   * Free the resources used by the gyro.
+   */
+  void free();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Potentiometer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Potentiometer.java
new file mode 100644
index 0000000..ea5c1e6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/interfaces/Potentiometer.java
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.interfaces;
+
+import edu.wpi.first.wpilibj.PIDSource;
+
+/**
+ * Interface for a Potentiometer.
+ */
+public interface Potentiometer extends PIDSource {
+  double get();
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/HardwareHLUsageReporting.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/HardwareHLUsageReporting.java
new file mode 100644
index 0000000..c2865b3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/HardwareHLUsageReporting.java
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.internal;
+
+import edu.wpi.first.wpilibj.HLUsageReporting;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tInstances;
+import edu.wpi.first.wpilibj.hal.FRCNetComm.tResourceType;
+import edu.wpi.first.wpilibj.hal.HAL;
+
+public class HardwareHLUsageReporting implements HLUsageReporting.Interface {
+  @Override
+  public void reportScheduler() {
+    HAL.report(tResourceType.kResourceType_Command, tInstances.kCommand_Scheduler);
+  }
+
+  @Override
+  public void reportPIDController(int num) {
+    HAL.report(tResourceType.kResourceType_PIDController, num);
+  }
+
+  @Override
+  public void reportSmartDashboard() {
+    HAL.report(tResourceType.kResourceType_SmartDashboard, 0);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/HardwareTimer.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/HardwareTimer.java
new file mode 100644
index 0000000..19b09f4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/internal/HardwareTimer.java
@@ -0,0 +1,138 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.internal;
+
+import edu.wpi.first.wpilibj.DriverStation;
+import edu.wpi.first.wpilibj.RobotController;
+import edu.wpi.first.wpilibj.Timer;
+
+/**
+ * Timer objects measure accumulated time in milliseconds. The timer object functions like a
+ * stopwatch. It can be started, stopped, and cleared. When the timer is running its value counts
+ * up in milliseconds. When stopped, the timer holds the current value. The implementation simply
+ * records the time when started and subtracts the current time whenever the value is requested.
+ */
+public class HardwareTimer implements Timer.StaticInterface {
+  /**
+   * Pause the thread for a specified time. Pause the execution of the thread for a specified period
+   * of time given in seconds. Motors will continue to run at their last assigned values, and
+   * sensors will continue to update. Only the task containing the wait will pause until the wait
+   * time is expired.
+   *
+   * @param seconds Length of time to pause
+   */
+  @Override
+  public void delay(final double seconds) {
+    try {
+      Thread.sleep((long) (seconds * 1e3));
+    } catch (final InterruptedException ex) {
+      Thread.currentThread().interrupt();
+    }
+  }
+
+  /**
+   * Return the system clock time in seconds. Return the time from the FPGA hardware clock in
+   * seconds since the FPGA started.
+   *
+   * @return Robot running time in seconds.
+   */
+  @Override
+  public double getFPGATimestamp() {
+    return RobotController.getFPGATime() / 1000000.0;
+  }
+
+  @Override
+  public double getMatchTime() {
+    return DriverStation.getInstance().getMatchTime();
+  }
+
+  @Override
+  public Timer.Interface newTimer() {
+    return new TimerImpl();
+  }
+
+  class TimerImpl implements Timer.Interface {
+    private double m_startTime;
+    private double m_accumulatedTime;
+    private boolean m_running;
+
+    /**
+     * Create a new timer object. Create a new timer object and reset the time to zero. The timer is
+     * initially not running and must be started.
+     */
+    TimerImpl() {
+      reset();
+    }
+
+    private double getMsClock() {
+      return RobotController.getFPGATime() / 1000.0;
+    }
+
+    /**
+     * Get the current time from the timer. If the clock is running it is derived from the current
+     * system clock the start time stored in the timer class. If the clock is not running, then
+     * return the time when it was last stopped.
+     *
+     * @return Current time value for this timer in seconds
+     */
+    public synchronized double get() {
+      if (m_running) {
+        return ((getMsClock() - m_startTime) + m_accumulatedTime) / 1000.0;
+      } else {
+        return m_accumulatedTime;
+      }
+    }
+
+    /**
+     * Reset the timer by setting the time to 0. Make the timer start time the current time so new
+     * requests will be relative now
+     */
+    public synchronized void reset() {
+      m_accumulatedTime = 0;
+      m_startTime = getMsClock();
+    }
+
+    /**
+     * Start the timer running. Just set the running flag to true indicating that all time
+     * requests should be relative to the system clock.
+     */
+    public synchronized void start() {
+      m_startTime = getMsClock();
+      m_running = true;
+    }
+
+    /**
+     * Stop the timer. This computes the time as of now and clears the running flag, causing all
+     * subsequent time requests to be read from the accumulated time rather than looking at the
+     * system clock.
+     */
+    public synchronized void stop() {
+      final double temp = get();
+      m_accumulatedTime = temp;
+      m_running = false;
+    }
+
+    /**
+     * Check if the period specified has passed and if it has, advance the start time by that
+     * period. This is useful to decide if it's time to do periodic work without drifting later by
+     * the time it took to get around to checking.
+     *
+     * @param period The period to check for (in seconds).
+     * @return If the period has passed.
+     */
+    public synchronized boolean hasPeriodPassed(double period) {
+      if (get() > period) {
+        // Advance the start time by the period.
+        // Don't set it to the current time... we want to avoid drift.
+        m_startTime += period * 1000;
+        return true;
+      }
+      return false;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java
new file mode 100644
index 0000000..8a6410e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindow.java
@@ -0,0 +1,288 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.livewindow;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl;
+import edu.wpi.first.wpilibj.Sendable;
+
+
+/**
+ * The LiveWindow class is the public interface for putting sensors and actuators on the
+ * LiveWindow.
+ */
+public class LiveWindow {
+  private static class Component {
+    Component(Sendable sendable, Sendable parent) {
+      m_sendable = sendable;
+      m_parent = parent;
+    }
+
+    final Sendable m_sendable;
+    Sendable m_parent;
+    final SendableBuilderImpl m_builder = new SendableBuilderImpl();
+    boolean m_firstTime = true;
+    boolean m_telemetryEnabled = true;
+  }
+
+  private static final Map<Object, Component> components = new HashMap<>();
+  private static final NetworkTable liveWindowTable =
+      NetworkTableInstance.getDefault().getTable("LiveWindow");
+  private static final NetworkTable statusTable = liveWindowTable.getSubTable(".status");
+  private static final NetworkTableEntry enabledEntry = statusTable.getEntry("LW Enabled");
+  private static boolean startLiveWindow = false;
+  private static boolean liveWindowEnabled = false;
+  private static boolean telemetryEnabled = true;
+
+  public static synchronized boolean isEnabled() {
+    return liveWindowEnabled;
+  }
+
+  /**
+   * Set the enabled state of LiveWindow. If it's being enabled, turn off the scheduler and remove
+   * all the commands from the queue and enable all the components registered for LiveWindow. If
+   * it's being disabled, stop all the registered components and reenable the scheduler. TODO: add
+   * code to disable PID loops when enabling LiveWindow. The commands should reenable the PID loops
+   * themselves when they get rescheduled. This prevents arms from starting to move around, etc.
+   * after a period of adjusting them in LiveWindow mode.
+   */
+  public static synchronized void setEnabled(boolean enabled) {
+    if (liveWindowEnabled != enabled) {
+      Scheduler scheduler = Scheduler.getInstance();
+      if (enabled) {
+        System.out.println("Starting live window mode.");
+        scheduler.disable();
+        scheduler.removeAll();
+      } else {
+        System.out.println("stopping live window mode.");
+        for (Component component : components.values()) {
+          component.m_builder.stopLiveWindowMode();
+        }
+        scheduler.enable();
+      }
+      startLiveWindow = enabled;
+      liveWindowEnabled = enabled;
+      enabledEntry.setBoolean(enabled);
+    }
+  }
+
+  /**
+   * The run method is called repeatedly to keep the values refreshed on the screen in test mode.
+   * @deprecated No longer required
+   */
+  @Deprecated
+  public static void run() {
+    updateValues();
+  }
+
+  /**
+   * Add a Sensor associated with the subsystem and with call it by the given name.
+   *
+   * @param subsystem The subsystem this component is part of.
+   * @param name      The name of this component.
+   * @param component A LiveWindowSendable component that represents a sensor.
+   * @deprecated Use {@link Sendable#setName(String, String)} instead.
+   */
+  @Deprecated
+  public static synchronized void addSensor(String subsystem, String name, Sendable component) {
+    add(component);
+    component.setName(subsystem, name);
+  }
+
+  /**
+   * Add Sensor to LiveWindow. The components are shown with the type and channel like this: Gyro[1]
+   * for a gyro object connected to the first analog channel.
+   *
+   * @param moduleType A string indicating the type of the module used in the naming (above)
+   * @param channel    The channel number the device is connected to
+   * @param component  A reference to the object being added
+   * @deprecated Use {@link edu.wpi.first.wpilibj.SensorBase#setName(String, int)} instead.
+   */
+  @Deprecated
+  public static void addSensor(String moduleType, int channel, Sendable component) {
+    add(component);
+    component.setName("Ungrouped", moduleType + "[" + channel + "]");
+  }
+
+  /**
+   * Add an Actuator associated with the subsystem and with call it by the given name.
+   *
+   * @param subsystem The subsystem this component is part of.
+   * @param name      The name of this component.
+   * @param component A LiveWindowSendable component that represents a actuator.
+   * @deprecated Use {@link Sendable#setName(String, String)} instead.
+   */
+  @Deprecated
+  public static synchronized void addActuator(String subsystem, String name, Sendable component) {
+    add(component);
+    component.setName(subsystem, name);
+  }
+
+  /**
+   * Add Actuator to LiveWindow. The components are shown with the module type, slot and channel
+   * like this: Servo[1,2] for a servo object connected to the first digital module and PWM port 2.
+   *
+   * @param moduleType A string that defines the module name in the label for the value
+   * @param channel    The channel number the device is plugged into (usually PWM)
+   * @param component  The reference to the object being added
+   * @deprecated Use {@link edu.wpi.first.wpilibj.SensorBase#setName(String, int)} instead.
+   */
+  @Deprecated
+  public static void addActuator(String moduleType, int channel, Sendable component) {
+    add(component);
+    component.setName("Ungrouped", moduleType + "[" + channel + "]");
+  }
+
+  /**
+   * Add Actuator to LiveWindow. The components are shown with the module type, slot and channel
+   * like this: Servo[1,2] for a servo object connected to the first digital module and PWM port 2.
+   *
+   * @param moduleType   A string that defines the module name in the label for the value
+   * @param moduleNumber The number of the particular module type
+   * @param channel      The channel number the device is plugged into (usually PWM)
+   * @param component    The reference to the object being added
+   * @deprecated Use {@link edu.wpi.first.wpilibj.SensorBase#setName(String, int, int)} instead.
+   */
+  @Deprecated
+  public static void addActuator(String moduleType, int moduleNumber, int channel,
+                                 Sendable component) {
+    add(component);
+    component.setName("Ungrouped", moduleType + "[" + moduleNumber + "," + channel + "]");
+  }
+
+  /**
+   * Add a component to the LiveWindow.
+   *
+   * @param sendable component to add
+   */
+  public static synchronized void add(Sendable sendable) {
+    components.putIfAbsent(sendable, new Component(sendable, null));
+  }
+
+  /**
+   * Add a child component to a component.
+   *
+   * @param parent parent component
+   * @param child child component
+   */
+  public static synchronized void addChild(Sendable parent, Object child) {
+    Component component = components.get(child);
+    if (component == null) {
+      component = new Component(null, parent);
+      components.put(child, component);
+    } else {
+      component.m_parent = parent;
+    }
+    component.m_telemetryEnabled = false;
+  }
+
+  /**
+   * Remove a component from the LiveWindow.
+   *
+   * @param sendable component to remove
+   */
+  public static synchronized void remove(Sendable sendable) {
+    Component component = components.remove(sendable);
+    if (component != null && isEnabled()) {
+      component.m_builder.stopLiveWindowMode();
+    }
+  }
+
+  /**
+   * Enable telemetry for a single component.
+   *
+   * @param sendable component
+   */
+  public static synchronized void enableTelemetry(Sendable sendable) {
+    // Re-enable global setting in case disableAllTelemetry() was called.
+    telemetryEnabled = true;
+    Component component = components.get(sendable);
+    if (component != null) {
+      component.m_telemetryEnabled = true;
+    }
+  }
+
+  /**
+   * Disable telemetry for a single component.
+   *
+   * @param sendable component
+   */
+  public static synchronized void disableTelemetry(Sendable sendable) {
+    Component component = components.get(sendable);
+    if (component != null) {
+      component.m_telemetryEnabled = false;
+    }
+  }
+
+  /**
+   * Disable ALL telemetry.
+   */
+  public static synchronized void disableAllTelemetry() {
+    telemetryEnabled = false;
+    for (Component component : components.values()) {
+      component.m_telemetryEnabled = false;
+    }
+  }
+
+  /**
+   * Tell all the sensors to update (send) their values.
+   *
+   * <p>Actuators are handled through callbacks on their value changing from the
+   * SmartDashboard widgets.
+   */
+  public static synchronized void updateValues() {
+    // Only do this if either LiveWindow mode or telemetry is enabled.
+    if (!liveWindowEnabled && !telemetryEnabled) {
+      return;
+    }
+
+    for (Component component : components.values()) {
+      if (component.m_sendable != null && component.m_parent == null
+          && (liveWindowEnabled || component.m_telemetryEnabled)) {
+        if (component.m_firstTime) {
+          // By holding off creating the NetworkTable entries, it allows the
+          // components to be redefined. This allows default sensor and actuator
+          // values to be created that are replaced with the custom names from
+          // users calling setName.
+          String name = component.m_sendable.getName();
+          if (name.isEmpty()) {
+            continue;
+          }
+          String subsystem = component.m_sendable.getSubsystem();
+          NetworkTable ssTable = liveWindowTable.getSubTable(subsystem);
+          NetworkTable table;
+          // Treat name==subsystem as top level of subsystem
+          if (name.equals(subsystem)) {
+            table = ssTable;
+          } else {
+            table = ssTable.getSubTable(name);
+          }
+          table.getEntry(".name").setString(name);
+          component.m_builder.setTable(table);
+          component.m_sendable.initSendable(component.m_builder);
+          ssTable.getEntry(".type").setString("LW Subsystem");
+
+          component.m_firstTime = false;
+        }
+
+        if (startLiveWindow) {
+          component.m_builder.startLiveWindowMode();
+        }
+        component.m_builder.updateTable();
+      }
+    }
+
+    startLiveWindow = false;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindowSendable.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindowSendable.java
new file mode 100644
index 0000000..ecb45ba
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/livewindow/LiveWindowSendable.java
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.livewindow;
+
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
+import edu.wpi.first.wpilibj.Sendable;
+
+/**
+ * Live Window Sendable is a special type of object sendable to the live window.
+ * @deprecated Use Sendable directly instead
+ */
+@Deprecated
+public interface LiveWindowSendable extends Sendable {
+  /**
+   * Update the table for this sendable object with the latest values.
+   */
+  void updateTable();
+
+  /**
+   * Start having this sendable object automatically respond to value changes reflect the value on
+   * the table.
+   */
+  void startLiveWindowMode();
+
+  /**
+   * Stop having this sendable object automatically respond to value changes.
+   */
+  void stopLiveWindowMode();
+
+  @Override
+  default String getName() {
+    return "";
+  }
+
+  @Override
+  default void setName(String name) {
+  }
+
+  @Override
+  default String getSubsystem() {
+    return "";
+  }
+
+  @Override
+  default void setSubsystem(String subsystem) {
+  }
+
+  @Override
+  default void initSendable(SendableBuilder builder) {
+    builder.setUpdateTable(this::updateTable);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/package.html b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/package.html
new file mode 100644
index 0000000..c22bf27
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/package.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+    <title>WPI Robotics library</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=MacRoman">
+</head>
+<body>
+The WPI Robotics library (WPILibJ) is a set of Java classes that interfaces to the hardware in the
+FRC control system and your robot. There are classes to handle sensors, motors, the driver
+station, and a number of other utility functions like timing and field management.
+The library is designed to:
+<ul>
+    <li>Deal with all the low level interfacing to these components so you can concentrate on
+        solving this year's "robot problem". This is a philosophical decision to let you focus
+        on the higher-level design of your robot rather than deal with the details of the
+        processor and the operating system.
+    </li>
+    <li>Understand everything at all levels by making the full source code of the library
+        available. You can study (and modify) the algorithms used by the gyro class for
+        oversampling and integration of the input signal or just ask the class for the current
+        robot heading. You can work at any level.
+    </li>
+</ul>
+</body>
+</html>
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java
new file mode 100644
index 0000000..c9ef492
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilder.java
@@ -0,0 +1,143 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.smartdashboard;
+
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableValue;
+import java.util.function.BooleanSupplier;
+import java.util.function.Consumer;
+import java.util.function.DoubleConsumer;
+import java.util.function.DoubleSupplier;
+import java.util.function.Supplier;
+
+public interface SendableBuilder {
+  /**
+   * Set the string representation of the named data type that will be used
+   * by the smart dashboard for this sendable.
+   *
+   * @param type    data type
+   */
+  void setSmartDashboardType(String type);
+
+  /**
+   * Set the function that should be called to set the Sendable into a safe
+   * state.  This is called when entering and exiting Live Window mode.
+   *
+   * @param func    function
+   */
+  void setSafeState(Runnable func);
+
+  /**
+   * Set the function that should be called to update the network table
+   * for things other than properties.  Note this function is not passed
+   * the network table object; instead it should use the entry handles
+   * returned by getEntry().
+   *
+   * @param func    function
+   */
+  void setUpdateTable(Runnable func);
+
+  /**
+   * Add a property without getters or setters.  This can be used to get
+   * entry handles for the function called by setUpdateTable().
+   *
+   * @param key   property name
+   * @return Network table entry
+   */
+  NetworkTableEntry getEntry(String key);
+
+  /**
+   * Represents an operation that accepts a single boolean-valued argument and
+   * returns no result. This is the primitive type specialization of Consumer
+   * for boolean. Unlike most other functional interfaces, BooleanConsumer is
+   * expected to operate via side-effects.
+   *
+   * <p>This is a functional interface whose functional method is accept(boolean).
+   */
+  @FunctionalInterface
+  interface BooleanConsumer {
+    /**
+     * Performs the operation on the given value.
+     * @param value the value
+     */
+    void accept(boolean value);
+  }
+
+  /**
+   * Add a boolean property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addBooleanProperty(String key, BooleanSupplier getter, BooleanConsumer setter);
+
+  /**
+   * Add a double property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addDoubleProperty(String key, DoubleSupplier getter, DoubleConsumer setter);
+
+  /**
+   * Add a string property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addStringProperty(String key, Supplier<String> getter, Consumer<String> setter);
+
+  /**
+   * Add a boolean array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addBooleanArrayProperty(String key, Supplier<boolean[]> getter, Consumer<boolean[]> setter);
+
+  /**
+   * Add a double array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addDoubleArrayProperty(String key, Supplier<double[]> getter, Consumer<double[]> setter);
+
+  /**
+   * Add a string array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addStringArrayProperty(String key, Supplier<String[]> getter, Consumer<String[]> setter);
+
+  /**
+   * Add a raw property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addRawProperty(String key, Supplier<byte[]> getter, Consumer<byte[]> setter);
+
+  /**
+   * Add a NetworkTableValue property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  void addValueProperty(String key, Supplier<NetworkTableValue> getter,
+                        Consumer<NetworkTableValue> setter);
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java
new file mode 100644
index 0000000..95d2e6c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java
@@ -0,0 +1,362 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.smartdashboard;
+
+import edu.wpi.first.networktables.EntryListenerFlags;
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableValue;
+import java.util.function.BooleanSupplier;
+import java.util.function.Consumer;
+import java.util.function.DoubleConsumer;
+import java.util.function.DoubleSupplier;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import java.util.ArrayList;
+import java.util.List;
+
+public class SendableBuilderImpl implements SendableBuilder {
+  private static class Property {
+    Property(NetworkTable table, String key) {
+      m_entry = table.getEntry(key);
+    }
+
+    @Override
+    @SuppressWarnings("NoFinalizer")
+    public synchronized void finalize() {
+      stopListener();
+    }
+
+    void startListener() {
+      if (m_entry.isValid() && m_listener == 0 && m_createListener != null) {
+        m_listener = m_createListener.apply(m_entry);
+      }
+    }
+
+    void stopListener() {
+      if (m_entry.isValid() && m_listener != 0) {
+        m_entry.removeListener(m_listener);
+        m_listener = 0;
+      }
+    }
+
+    final NetworkTableEntry m_entry;
+    int m_listener = 0;
+    Consumer<NetworkTableEntry> m_update;
+    Function<NetworkTableEntry, Integer> m_createListener;
+  }
+
+  private final List<Property> m_properties = new ArrayList<>();
+  private Runnable m_safeState;
+  private Runnable m_updateTable;
+  private NetworkTable m_table;
+
+  /**
+   * Set the network table.  Must be called prior to any Add* functions being
+   * called.
+   * @param table Network table
+   */
+  public void setTable(NetworkTable table) {
+    m_table = table;
+  }
+
+  /**
+   * Get the network table.
+   * @return The network table
+   */
+  public NetworkTable getTable() {
+    return m_table;
+  }
+
+  /**
+   * Update the network table values by calling the getters for all properties.
+   */
+  public void updateTable() {
+    for (Property property : m_properties) {
+      if (property.m_update != null) {
+        property.m_update.accept(property.m_entry);
+      }
+    }
+    if (m_updateTable != null) {
+      m_updateTable.run();
+    }
+  }
+
+  /**
+   * Hook setters for all properties.
+   */
+  public void startListeners() {
+    for (Property property : m_properties) {
+      property.startListener();
+    }
+  }
+
+  /**
+   * Unhook setters for all properties.
+   */
+  public void stopListeners() {
+    for (Property property : m_properties) {
+      property.stopListener();
+    }
+  }
+
+  /**
+   * Start LiveWindow mode by hooking the setters for all properties.  Also
+   * calls the safeState function if one was provided.
+   */
+  public void startLiveWindowMode() {
+    if (m_safeState != null) {
+      m_safeState.run();
+    }
+    startListeners();
+  }
+
+  /**
+   * Stop LiveWindow mode by unhooking the setters for all properties.  Also
+   * calls the safeState function if one was provided.
+   */
+  public void stopLiveWindowMode() {
+    stopListeners();
+    if (m_safeState != null) {
+      m_safeState.run();
+    }
+  }
+
+  /**
+   * Set the string representation of the named data type that will be used
+   * by the smart dashboard for this sendable.
+   *
+   * @param type    data type
+   */
+  @Override
+  public void setSmartDashboardType(String type) {
+    m_table.getEntry(".type").setString(type);
+  }
+
+  /**
+   * Set the function that should be called to set the Sendable into a safe
+   * state.  This is called when entering and exiting Live Window mode.
+   *
+   * @param func    function
+   */
+  @Override
+  public void setSafeState(Runnable func) {
+    m_safeState = func;
+  }
+
+  /**
+   * Set the function that should be called to update the network table
+   * for things other than properties.  Note this function is not passed
+   * the network table object; instead it should use the entry handles
+   * returned by getEntry().
+   *
+   * @param func    function
+   */
+  @Override
+  public void setUpdateTable(Runnable func) {
+    m_updateTable = func;
+  }
+
+  /**
+   * Add a property without getters or setters.  This can be used to get
+   * entry handles for the function called by setUpdateTable().
+   *
+   * @param key   property name
+   * @return Network table entry
+   */
+  @Override
+  public NetworkTableEntry getEntry(String key) {
+    return m_table.getEntry(key);
+  }
+
+  /**
+   * Add a boolean property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addBooleanProperty(String key, BooleanSupplier getter, BooleanConsumer setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setBoolean(getter.getAsBoolean());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isBoolean()) {
+          setter.accept(event.value.getBoolean());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a double property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addDoubleProperty(String key, DoubleSupplier getter, DoubleConsumer setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setDouble(getter.getAsDouble());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isDouble()) {
+          setter.accept(event.value.getDouble());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a string property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addStringProperty(String key, Supplier<String> getter, Consumer<String> setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setString(getter.get());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isString()) {
+          setter.accept(event.value.getString());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a boolean array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addBooleanArrayProperty(String key, Supplier<boolean[]> getter,
+                                      Consumer<boolean[]> setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setBooleanArray(getter.get());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isBooleanArray()) {
+          setter.accept(event.value.getBooleanArray());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a double array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addDoubleArrayProperty(String key, Supplier<double[]> getter,
+                                     Consumer<double[]> setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setDoubleArray(getter.get());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isDoubleArray()) {
+          setter.accept(event.value.getDoubleArray());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a string array property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addStringArrayProperty(String key, Supplier<String[]> getter,
+                                     Consumer<String[]> setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setStringArray(getter.get());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isStringArray()) {
+          setter.accept(event.value.getStringArray());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a raw property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addRawProperty(String key, Supplier<byte[]> getter, Consumer<byte[]> setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setRaw(getter.get());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        if (event.value.isRaw()) {
+          setter.accept(event.value.getRaw());
+        }
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+
+  /**
+   * Add a NetworkTableValue property.
+   *
+   * @param key     property name
+   * @param getter  getter function (returns current value)
+   * @param setter  setter function (sets new value)
+   */
+  @Override
+  public void addValueProperty(String key, Supplier<NetworkTableValue> getter,
+                               Consumer<NetworkTableValue> setter) {
+    Property property = new Property(m_table, key);
+    if (getter != null) {
+      property.m_update = (entry) -> entry.setValue(getter.get());
+    }
+    if (setter != null) {
+      property.m_createListener = (entry) -> entry.addListener((event) -> {
+        setter.accept(event.value);
+      }, EntryListenerFlags.kImmediate | EntryListenerFlags.kNew | EntryListenerFlags.kUpdate);
+    }
+    m_properties.add(property);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableChooser.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableChooser.java
new file mode 100644
index 0000000..0a1b1bc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableChooser.java
@@ -0,0 +1,109 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.smartdashboard;
+
+import java.util.LinkedHashMap;
+
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.wpilibj.Sendable;
+import edu.wpi.first.wpilibj.SendableBase;
+import edu.wpi.first.wpilibj.command.Command;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * The {@link SendableChooser} class is a useful tool for presenting a selection of options to the
+ * {@link SmartDashboard}.
+ *
+ * <p>For instance, you may wish to be able to select between multiple autonomous modes. You can do
+ * this by putting every possible {@link Command} you want to run as an autonomous into a {@link
+ * SendableChooser} and then put it into the {@link SmartDashboard} to have a list of options appear
+ * on the laptop. Once autonomous starts, simply ask the {@link SendableChooser} what the selected
+ * value is.
+ *
+ * @param <V> The type of the values to be stored
+ */
+public class SendableChooser<V> extends SendableBase implements Sendable {
+  /**
+   * The key for the default value.
+   */
+  private static final String DEFAULT = "default";
+  /**
+   * The key for the selected option.
+   */
+  private static final String SELECTED = "selected";
+  /**
+   * The key for the option array.
+   */
+  private static final String OPTIONS = "options";
+  /**
+   * A map linking strings to the objects the represent.
+   */
+  private final LinkedHashMap<String, V> m_map = new LinkedHashMap<>();
+  private String m_defaultChoice = "";
+
+  /**
+   * Instantiates a {@link SendableChooser}.
+   */
+  public SendableChooser() {
+  }
+
+  /**
+   * Adds the given object to the list of options. On the {@link SmartDashboard} on the desktop, the
+   * object will appear as the given name.
+   *
+   * @param name   the name of the option
+   * @param object the option
+   */
+  public void addObject(String name, V object) {
+    m_map.put(name, object);
+  }
+
+  /**
+   * Add the given object to the list of options and marks it as the default. Functionally, this is
+   * very close to {@link #addObject(String, Object)} except that it will use this as the default
+   * option if none other is explicitly selected.
+   *
+   * @param name   the name of the option
+   * @param object the option
+   */
+  public void addDefault(String name, V object) {
+    requireNonNull(name, "Provided name was null");
+
+    m_defaultChoice = name;
+    addObject(name, object);
+  }
+
+  /**
+   * Returns the selected option. If there is none selected, it will return the default. If there is
+   * none selected and no default, then it will return {@code null}.
+   *
+   * @return the option selected
+   */
+  public V getSelected() {
+    String selected = m_defaultChoice;
+    if (m_tableSelected != null) {
+      selected = m_tableSelected.getString(m_defaultChoice);
+    }
+    return m_map.get(selected);
+  }
+
+  private NetworkTableEntry m_tableSelected;
+
+  @Override
+  public void initSendable(SendableBuilder builder) {
+    builder.setSmartDashboardType("String Chooser");
+    builder.addStringProperty(DEFAULT, () -> {
+      return m_defaultChoice;
+    }, null);
+    builder.addStringArrayProperty(OPTIONS, () -> {
+      return m_map.keySet().toArray(new String[0]);
+    }, null);
+    m_tableSelected = builder.getEntry(SELECTED);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java
new file mode 100644
index 0000000..e8ab5fd
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.java
@@ -0,0 +1,525 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.smartdashboard;
+
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.HLUsageReporting;
+import edu.wpi.first.wpilibj.Sendable;
+
+/**
+ * The {@link SmartDashboard} class is the bridge between robot programs and the SmartDashboard on
+ * the laptop.
+ *
+ * <p>When a value is put into the SmartDashboard here, it pops up on the SmartDashboard on the
+ * laptop. Users can put values into and get values from the SmartDashboard.
+ */
+public class SmartDashboard {
+  /**
+   * The {@link NetworkTable} used by {@link SmartDashboard}.
+   */
+  private static final NetworkTable table =
+      NetworkTableInstance.getDefault().getTable("SmartDashboard");
+
+  private static class Data {
+    Data(Sendable sendable) {
+      m_sendable = sendable;
+    }
+
+    final Sendable m_sendable;
+    final SendableBuilderImpl m_builder = new SendableBuilderImpl();
+  }
+
+  /**
+   * A table linking tables in the SmartDashboard to the {@link Sendable} objects they
+   * came from.
+   */
+  private static final Map<String, Data> tablesToData = new HashMap<>();
+
+  static {
+    HLUsageReporting.reportSmartDashboard();
+  }
+
+  /**
+   * Maps the specified key to the specified value in this table. The key can not be null. The value
+   * can be retrieved by calling the get method with a key that is equal to the original key.
+   *
+   * @param key  the key
+   * @param data the value
+   * @throws IllegalArgumentException If key is null
+   */
+  public static synchronized void putData(String key, Sendable data) {
+    Data sddata = tablesToData.get(key);
+    if (sddata == null || sddata.m_sendable != data) {
+      if (sddata != null) {
+        sddata.m_builder.stopListeners();
+      }
+      sddata = new Data(data);
+      tablesToData.put(key, sddata);
+      NetworkTable dataTable = table.getSubTable(key);
+      sddata.m_builder.setTable(dataTable);
+      data.initSendable(sddata.m_builder);
+      sddata.m_builder.updateTable();
+      sddata.m_builder.startListeners();
+      dataTable.getEntry(".name").setString(key);
+    }
+  }
+
+  /**
+   * Maps the specified key (where the key is the name of the {@link NamedSendable}
+   * to the specified value in this table. The value can be retrieved by
+   * calling the get method with a key that is equal to the original key.
+   *
+   * @param value the value
+   * @throws IllegalArgumentException If key is null
+   */
+  public static void putData(Sendable value) {
+    putData(value.getName(), value);
+  }
+
+  /**
+   * Returns the value at the specified key.
+   *
+   * @param key the key
+   * @return the value
+   * @throws IllegalArgumentException  if the key is null
+   */
+  public static synchronized Sendable getData(String key) {
+    Data data = tablesToData.get(key);
+    if (data == null) {
+      throw new IllegalArgumentException("SmartDashboard data does not exist: " + key);
+    } else {
+      return data.m_sendable;
+    }
+  }
+
+  /**
+   * Gets the entry for the specified key.
+   * @param key the key name
+   * @return Network table entry.
+   */
+  public static NetworkTableEntry getEntry(String key) {
+    return table.getEntry(key);
+  }
+
+  /**
+   * Checks the table and tells if it contains the specified key.
+   *
+   * @param key the key to search for
+   * @return true if the table as a value assigned to the given key
+   */
+  public static boolean containsKey(String key) {
+    return table.containsKey(key);
+  }
+
+  /**
+   * Get the keys stored in the SmartDashboard table of NetworkTables.
+   *
+   * @param types bitmask of types; 0 is treated as a "don't care".
+   * @return keys currently in the table
+   */
+  public static Set<String> getKeys(int types) {
+    return table.getKeys(types);
+  }
+
+  /**
+   * Get the keys stored in the SmartDashboard table of NetworkTables.
+   *
+   * @return keys currently in the table.
+   */
+  public static Set<String> getKeys() {
+    return table.getKeys();
+  }
+
+  /**
+   * Makes a key's value persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  public static void setPersistent(String key) {
+    getEntry(key).setPersistent();
+  }
+
+  /**
+   * Stop making a key's value persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  public static void clearPersistent(String key) {
+    getEntry(key).clearPersistent();
+  }
+
+  /**
+   * Returns whether the value is persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   * @return True if the value is persistent.
+   */
+  public static boolean isPersistent(String key) {
+    return getEntry(key).isPersistent();
+  }
+
+  /**
+   * Sets flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to set (bitmask)
+   */
+  public static void setFlags(String key, int flags) {
+    getEntry(key).setFlags(flags);
+  }
+
+  /**
+   * Clears flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to clear (bitmask)
+   */
+  public static void clearFlags(String key, int flags) {
+    getEntry(key).clearFlags(flags);
+  }
+
+  /**
+   * Returns the flags for the specified key.
+   *
+   * @param key the key name
+   * @return the flags, or 0 if the key is not defined
+   */
+  public static int getFlags(String key) {
+    return getEntry(key).getFlags();
+  }
+
+  /**
+   * Deletes the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   */
+  public static void delete(String key) {
+    table.delete(key);
+  }
+
+  /**
+   * Put a boolean in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putBoolean(String key, boolean value) {
+    return getEntry(key).setBoolean(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultBoolean(String key, boolean defaultValue) {
+    return getEntry(key).setDefaultBoolean(defaultValue);
+  }
+
+  /**
+   * Returns the boolean the key maps to. If the key does not exist or is of
+   *     different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static boolean getBoolean(String key, boolean defaultValue) {
+    return getEntry(key).getBoolean(defaultValue);
+  }
+
+  /**
+   * Put a number in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putNumber(String key, double value) {
+    return getEntry(key).setDouble(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultNumber(String key, double defaultValue) {
+    return getEntry(key).setDefaultDouble(defaultValue);
+  }
+
+  /**
+   * Returns the number the key maps to. If the key does not exist or is of
+   *     different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static double getNumber(String key, double defaultValue) {
+    return getEntry(key).getDouble(defaultValue);
+  }
+
+  /**
+   * Put a string in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putString(String key, String value) {
+    return getEntry(key).setString(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultString(String key, String defaultValue) {
+    return getEntry(key).setDefaultString(defaultValue);
+  }
+
+  /**
+   * Returns the string the key maps to. If the key does not exist or is of
+   *     different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static String getString(String key, String defaultValue) {
+    return getEntry(key).getString(defaultValue);
+  }
+
+  /**
+   * Put a boolean array in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putBooleanArray(String key, boolean[] value) {
+    return getEntry(key).setBooleanArray(value);
+  }
+
+  /**
+   * Put a boolean array in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putBooleanArray(String key, Boolean[] value) {
+    return getEntry(key).setBooleanArray(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultBooleanArray(String key, boolean[] defaultValue) {
+    return getEntry(key).setDefaultBooleanArray(defaultValue);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultBooleanArray(String key, Boolean[] defaultValue) {
+    return getEntry(key).setDefaultBooleanArray(defaultValue);
+  }
+
+  /**
+   * Returns the boolean array the key maps to. If the key does not exist or is
+   *     of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static boolean[] getBooleanArray(String key, boolean[] defaultValue) {
+    return getEntry(key).getBooleanArray(defaultValue);
+  }
+
+  /**
+   * Returns the boolean array the key maps to. If the key does not exist or is
+   *     of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static Boolean[] getBooleanArray(String key, Boolean[] defaultValue) {
+    return getEntry(key).getBooleanArray(defaultValue);
+  }
+
+  /**
+   * Put a number array in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putNumberArray(String key, double[] value) {
+    return getEntry(key).setDoubleArray(value);
+  }
+
+  /**
+   * Put a number array in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putNumberArray(String key, Double[] value) {
+    return getEntry(key).setNumberArray(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultNumberArray(String key, double[] defaultValue) {
+    return getEntry(key).setDefaultDoubleArray(defaultValue);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultNumberArray(String key, Double[] defaultValue) {
+    return getEntry(key).setDefaultNumberArray(defaultValue);
+  }
+
+  /**
+   * Returns the number array the key maps to. If the key does not exist or is
+   *     of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static double[] getNumberArray(String key, double[] defaultValue) {
+    return getEntry(key).getDoubleArray(defaultValue);
+  }
+
+  /**
+   * Returns the number array the key maps to. If the key does not exist or is
+   *     of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static Double[] getNumberArray(String key, Double[] defaultValue) {
+    return getEntry(key).getDoubleArray(defaultValue);
+  }
+
+  /**
+   * Put a string array in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putStringArray(String key, String[] value) {
+    return getEntry(key).setStringArray(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultStringArray(String key, String[] defaultValue) {
+    return getEntry(key).setDefaultStringArray(defaultValue);
+  }
+
+  /**
+   * Returns the string array the key maps to. If the key does not exist or is
+   *     of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static String[] getStringArray(String key, String[] defaultValue) {
+    return getEntry(key).getStringArray(defaultValue);
+  }
+
+  /**
+   * Put a raw value (byte array) in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putRaw(String key, byte[] value) {
+    return getEntry(key).setRaw(value);
+  }
+
+  /**
+   * Put a raw value (bytes from a byte buffer) in the table.
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @param len the length of the value
+   * @return False if the table key already exists with a different type
+   */
+  public static boolean putRaw(String key, ByteBuffer value, int len) {
+    return getEntry(key).setRaw(value, len);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key does not exist.
+   * @return False if the table key exists with a different type
+   */
+  public static boolean setDefaultRaw(String key, byte[] defaultValue) {
+    return getEntry(key).setDefaultRaw(defaultValue);
+  }
+
+  /**
+   * Returns the raw value (byte array) the key maps to. If the key does not
+   *     exist or is of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   *     if there is no value associated with the key
+   */
+  public static byte[] getRaw(String key, byte[] defaultValue) {
+    return getEntry(key).getRaw(defaultValue);
+  }
+
+  /**
+   * Puts all sendable data to the dashboard.
+   */
+  public static synchronized void updateValues() {
+    for (Data data : tablesToData.values()) {
+      data.m_builder.updateTable();
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/AllocationException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/AllocationException.java
new file mode 100644
index 0000000..54112a0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/AllocationException.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+/**
+ * Exception indicating that the resource is already allocated.
+ */
+public class AllocationException extends RuntimeException {
+  /**
+   * Create a new AllocationException.
+   *
+   * @param msg the message to attach to the exception
+   */
+  public AllocationException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/BaseSystemNotInitializedException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/BaseSystemNotInitializedException.java
new file mode 100644
index 0000000..5467782
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/BaseSystemNotInitializedException.java
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+
+/**
+ * Thrown if there is an error caused by a basic system or setting not being properly initialized
+ * before being used.
+ */
+public class BaseSystemNotInitializedException extends RuntimeException {
+  /**
+   * Create a new BaseSystemNotInitializedException.
+   *
+   * @param message the message to attach to the exception
+   */
+  public BaseSystemNotInitializedException(String message) {
+    super(message);
+  }
+
+  /**
+   * Create a new BaseSystemNotInitializedException using the offending class that was not set and
+   * the class that was affected.
+   *
+   * @param offender The class or interface that was not properly initialized.
+   * @param affected The class that was was affected by this missing initialization.
+   */
+  public BaseSystemNotInitializedException(Class<?> offender, Class<?> affected) {
+    super("The " + offender.getSimpleName() + " for the " + affected.getSimpleName()
+        + " was never set.");
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/BoundaryException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/BoundaryException.java
new file mode 100644
index 0000000..e348c28
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/BoundaryException.java
@@ -0,0 +1,50 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+/**
+ * This exception represents an error in which a lower limit was set as higher than an upper limit.
+ */
+public class BoundaryException extends RuntimeException {
+  /**
+   * Create a new exception with the given message.
+   *
+   * @param message the message to attach to the exception
+   */
+  public BoundaryException(String message) {
+    super(message);
+  }
+
+  /**
+   * Make sure that the given value is between the upper and lower bounds, and throw an exception if
+   * they are not.
+   *
+   * @param value The value to check.
+   * @param lower The minimum acceptable value.
+   * @param upper The maximum acceptable value.
+   */
+  public static void assertWithinBounds(double value, double lower, double upper) {
+    if (value < lower || value > upper) {
+      throw new BoundaryException("Value must be between " + lower + " and " + upper + ", " + value
+          + " given");
+    }
+  }
+
+  /**
+   * Returns the message for a boundary exception. Used to keep the message consistent across all
+   * boundary exceptions.
+   *
+   * @param value The given value
+   * @param lower The lower limit
+   * @param upper The upper limit
+   * @return the message for a boundary exception
+   */
+  public static String getMessage(double value, double lower, double upper) {
+    return "Value must be between " + lower + " and " + upper + ", " + value + " given";
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/CheckedAllocationException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/CheckedAllocationException.java
new file mode 100644
index 0000000..8f201ac
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/CheckedAllocationException.java
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+/**
+ * Exception indicating that the resource is already allocated This is meant to be thrown by the
+ * resource class.
+ */
+public class CheckedAllocationException extends Exception {
+  /**
+   * Create a new CheckedAllocationException.
+   *
+   * @param msg the message to attach to the exception
+   */
+  public CheckedAllocationException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/HalHandleException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/HalHandleException.java
new file mode 100644
index 0000000..12e5a70
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/HalHandleException.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+/**
+ * Exception indicating that an error has occured with a HAL Handle.
+ */
+public class HalHandleException extends RuntimeException {
+  /**
+   * Create a new HalHandleException.
+   *
+   * @param msg the message to attach to the exception
+   */
+  public HalHandleException(String msg) {
+    super(msg);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/SortedVector.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/SortedVector.java
new file mode 100644
index 0000000..999dd4f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/SortedVector.java
@@ -0,0 +1,81 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+import java.util.Vector;
+
+/**
+ * A vector that is sorted.
+ */
+public class SortedVector<E> extends Vector<E> {
+  /**
+   * Interface used to determine the order to place sorted objects.
+   */
+  public interface Comparator {
+
+    /**
+     * Compare the given two objects.
+     *
+     * <p>Should return -1, 0, or 1 if the first object is less than, equal to, or greater than the
+     * second, respectively.
+     *
+     * @param object1 First object to compare
+     * @param object2 Second object to compare
+     * @return -1, 0, or 1.
+     */
+    int compare(Object object1, Object object2);
+  }
+
+  private final Comparator m_comparator;
+
+  /**
+   * Create a new sorted vector and use the given comparator to determine order.
+   *
+   * @param comparator The comparator to use to determine what order to place the elements in this
+   *                   vector.
+   */
+  public SortedVector(Comparator comparator) {
+    m_comparator = comparator;
+  }
+
+  /**
+   * Adds an element in the Vector, sorted from greatest to least.
+   *
+   * @param element The element to add to the Vector
+   */
+  public void addElement(E element) {
+    int highBound = size();
+    int lowBound = 0;
+    while (highBound - lowBound > 0) {
+      int index = (highBound + lowBound) / 2;
+      int result = m_comparator.compare(element, elementAt(index));
+      if (result < 0) {
+        lowBound = index + 1;
+      } else if (result > 0) {
+        highBound = index;
+      } else {
+        lowBound = index;
+        highBound = index;
+      }
+    }
+    insertElementAt(element, lowBound);
+  }
+
+  /**
+   * Sort the vector.
+   */
+  @SuppressWarnings("unchecked")
+  public void sort() {
+    Object[] array = new Object[size()];
+    copyInto(array);
+    removeAllElements();
+    for (Object o : array) {
+      addElement((E) o);
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/UncleanStatusException.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/UncleanStatusException.java
new file mode 100644
index 0000000..1a91b82
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/util/UncleanStatusException.java
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.util;
+
+/**
+ * Exception for bad status codes from the chip object.
+ */
+public final class UncleanStatusException extends IllegalStateException {
+  private final int m_statusCode;
+
+  /**
+   * Create a new UncleanStatusException.
+   *
+   * @param status  the status code that caused the exception
+   * @param message A message describing the exception
+   */
+  public UncleanStatusException(int status, String message) {
+    super(message);
+    m_statusCode = status;
+  }
+
+  /**
+   * Create a new UncleanStatusException.
+   *
+   * @param status the status code that caused the exception
+   */
+  public UncleanStatusException(int status) {
+    this(status, "Status code was non-zero");
+  }
+
+  /**
+   * Create a new UncleanStatusException.
+   *
+   * @param message a message describing the exception
+   */
+  public UncleanStatusException(String message) {
+    this(-1, message);
+  }
+
+  /**
+   * Create a new UncleanStatusException.
+   */
+  public UncleanStatusException() {
+    this(-1, "Status code was non-zero");
+  }
+
+  /**
+   * Create a new UncleanStatusException.
+   *
+   * @return the status code that caused the exception
+   */
+  public int getStatus() {
+    return m_statusCode;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionPipeline.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionPipeline.java
new file mode 100644
index 0000000..2dda3f9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionPipeline.java
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.vision;
+
+import org.opencv.core.Mat;
+
+/**
+ * A vision pipeline is responsible for running a group of
+ * OpenCV algorithms to extract data from an image.
+ *
+ * @see VisionRunner
+ * @see VisionThread
+ */
+public interface VisionPipeline {
+
+  /**
+   * Processes the image input and sets the result objects.
+   * Implementations should make these objects accessible.
+   */
+  void process(Mat image);
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionRunner.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionRunner.java
new file mode 100644
index 0000000..be32db6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionRunner.java
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.vision;
+
+import edu.wpi.cscore.CvSink;
+import edu.wpi.cscore.VideoSource;
+import edu.wpi.first.wpilibj.DriverStation;
+import edu.wpi.first.wpilibj.RobotBase;
+import org.opencv.core.Mat;
+
+/**
+ * A vision runner is a convenient wrapper object to make it easy to run vision pipelines
+ * from robot code. The easiest  way to use this is to run it in a {@link VisionThread}
+ * and use the listener to take snapshots of the pipeline's outputs.
+ *
+ * @see VisionPipeline
+ * @see VisionThread
+ * @see edu.wpi.first.wpilibj.vision
+ */
+public class VisionRunner<P extends VisionPipeline> {
+  private final CvSink m_cvSink = new CvSink("VisionRunner CvSink");
+  private final P m_pipeline;
+  private final Mat m_image = new Mat();
+  private final Listener<? super P> m_listener;
+  private volatile boolean m_enabled = true;
+
+  /**
+   * Listener interface for a callback that should run after a pipeline has processed its input.
+   *
+   * @param <P> the type of the pipeline this listener is for
+   */
+  @FunctionalInterface
+  public interface Listener<P extends VisionPipeline> {
+
+    /**
+     * Called when the pipeline has run. This shouldn't take much time to run because it will delay
+     * later calls to the pipeline's {@link VisionPipeline#process process} method. Copying the
+     * outputs and code that uses the copies should be <i>synchronized</i> on the same mutex to
+     * prevent multiple threads from reading and writing to the same memory at the same time.
+     *
+     * @param pipeline the vision pipeline that ran
+     */
+    void copyPipelineOutputs(P pipeline);
+
+  }
+
+  /**
+   * Creates a new vision runner. It will take images from the {@code videoSource}, send them to
+   * the {@code pipeline}, and call the {@code listener} when the pipeline has finished to alert
+   * user code when it is safe to access the pipeline's outputs.
+   *
+   * @param videoSource the video source to use to supply images for the pipeline
+   * @param pipeline    the vision pipeline to run
+   * @param listener    a function to call after the pipeline has finished running
+   */
+  public VisionRunner(VideoSource videoSource, P pipeline, Listener<? super P> listener) {
+    this.m_pipeline = pipeline;
+    this.m_listener = listener;
+    m_cvSink.setSource(videoSource);
+  }
+
+  /**
+   * Runs the pipeline one time, giving it the next image from the video source specified
+   * in the constructor. This will block until the source either has an image or throws an error.
+   * If the source successfully supplied a frame, the pipeline's image input will be set,
+   * the pipeline will run, and the listener specified in the constructor will be called to notify
+   * it that the pipeline ran.
+   *
+   * <p>This method is exposed to allow teams to add additional functionality or have their own
+   * ways to run the pipeline. Most teams, however, should just use {@link #runForever} in its own
+   * thread using a {@link VisionThread}.</p>
+   */
+  public void runOnce() {
+    if (Thread.currentThread().getId() == RobotBase.MAIN_THREAD_ID) {
+      throw new IllegalStateException(
+          "VisionRunner.runOnce() cannot be called from the main robot thread");
+    }
+    long frameTime = m_cvSink.grabFrame(m_image);
+    if (frameTime == 0) {
+      // There was an error, report it
+      String error = m_cvSink.getError();
+      DriverStation.reportError(error, true);
+    } else {
+      // No errors, process the image
+      m_pipeline.process(m_image);
+      m_listener.copyPipelineOutputs(m_pipeline);
+    }
+  }
+
+  /**
+   * A convenience method that calls {@link #runOnce()} in an infinite loop. This must
+   * be run in a dedicated thread, and cannot be used in the main robot thread because
+   * it will freeze the robot program.
+   *
+   * <p><strong>Do not call this method directly from the main thread.</strong></p>
+   *
+   * @throws IllegalStateException if this is called from the main robot thread
+   * @see VisionThread
+   */
+  public void runForever() {
+    if (Thread.currentThread().getId() == RobotBase.MAIN_THREAD_ID) {
+      throw new IllegalStateException(
+          "VisionRunner.runForever() cannot be called from the main robot thread");
+    }
+    while (m_enabled && !Thread.interrupted()) {
+      runOnce();
+    }
+  }
+
+  /**
+   * Stop a RunForever() loop.
+   */
+  public void stop() {
+    m_enabled = false;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionThread.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionThread.java
new file mode 100644
index 0000000..5eeece8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/VisionThread.java
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.vision;
+
+import edu.wpi.cscore.VideoSource;
+
+/**
+ * A vision thread is a special thread that runs a vision pipeline. It is a <i>daemon</i> thread;
+ * it does not prevent the program from exiting when all other non-daemon threads
+ * have finished running.
+ *
+ * @see VisionPipeline
+ * @see VisionRunner
+ * @see Thread#setDaemon(boolean)
+ */
+public class VisionThread extends Thread {
+  /**
+   * Creates a vision thread that continuously runs a {@link VisionPipeline}.
+   *
+   * @param visionRunner the runner for a vision pipeline
+   */
+  public VisionThread(VisionRunner<?> visionRunner) {
+    super(visionRunner::runForever, "WPILib Vision Thread");
+    setDaemon(true);
+  }
+
+  /**
+   * Creates a new vision thread that continuously runs the given vision pipeline. This is
+   * equivalent to {@code new VisionThread(new VisionRunner<>(videoSource, pipeline, listener))}.
+   *
+   * @param videoSource the source for images the pipeline should process
+   * @param pipeline    the pipeline to run
+   * @param listener    the listener to copy outputs from the pipeline after it runs
+   * @param <P>         the type of the pipeline
+   */
+  public <P extends VisionPipeline> VisionThread(VideoSource videoSource,
+                                                 P pipeline,
+                                                 VisionRunner.Listener<? super P> listener) {
+    this(new VisionRunner<>(videoSource, pipeline, listener));
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/package-info.java b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/package-info.java
new file mode 100644
index 0000000..94d7101
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/java/edu/wpi/first/wpilibj/vision/package-info.java
@@ -0,0 +1,88 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Classes in the {@code edu.wpi.first.wpilibj.vision} package are designed to
+ * simplify using OpenCV vision processing code from a robot program.
+ *
+ * <p>An example use case for grabbing a yellow tote from 2015 in autonomous:
+ * <br>
+ * <pre><code>
+ * public class Robot extends IterativeRobot
+ *     implements VisionRunner.Listener&lt;MyFindTotePipeline&gt; {
+ *
+ *      // A USB camera connected to the roboRIO.
+ *      private {@link edu.wpi.cscore.VideoSource VideoSource} usbCamera;
+ *
+ *      // A vision pipeline. This could be handwritten or generated by GRIP.
+ *      // This has to implement {@link edu.wpi.first.wpilibj.vision.VisionPipeline}.
+ *      // For this example, assume that it's perfect and will always see the tote.
+ *      private MyFindTotePipeline findTotePipeline;
+ *      private {@link edu.wpi.first.wpilibj.vision.VisionThread} findToteThread;
+ *
+ *      // The object to synchronize on to make sure the vision thread doesn't
+ *      // write to variables the main thread is using.
+ *      private final Object visionLock = new Object();
+ *
+ *      // The pipeline outputs we want
+ *      private boolean pipelineRan = false; // lets us know when the pipeline has actually run
+ *      private double angleToTote = 0;
+ *      private double distanceToTote = 0;
+ *
+ *     {@literal @}Override
+ *      public void {@link edu.wpi.first.wpilibj.vision.VisionRunner.Listener#copyPipelineOutputs
+ *          copyPipelineOutputs(MyFindTotePipeline pipeline)} {
+ *          synchronized (visionLock) {
+ *              // Take a snapshot of the pipeline's output because
+ *              // it may have changed the next time this method is called!
+ *              this.pipelineRan = true;
+ *              this.angleToTote = pipeline.getAngleToTote();
+ *              this.distanceToTote = pipeline.getDistanceToTote();
+ *          }
+ *      }
+ *
+ *     {@literal @}Override
+ *      public void robotInit() {
+ *          usbCamera = CameraServer.getInstance().startAutomaticCapture(0);
+ *          findTotePipeline = new MyFindTotePipeline();
+ *          findToteThread = new VisionThread(usbCamera, findTotePipeline, this);
+ *      }
+ *
+ *     {@literal @}Override
+ *      public void autonomousInit() {
+ *          findToteThread.start();
+ *      }
+ *
+ *     {@literal @}Override
+ *      public void autonomousPeriodic() {
+ *          double angle;
+ *          double distance;
+ *          synchronized (visionLock) {
+ *              if (!pipelineRan) {
+ *                  // Wait until the pipeline has run
+ *                  return;
+ *              }
+ *              // Copy the outputs to make sure they're all from the same run
+ *              angle = this.angleToTote;
+ *              distance = this.distanceToTote;
+ *          }
+ *          if (!aimedAtTote()) {
+ *              turnToAngle(angle);
+ *          } else if (!droveToTote()) {
+ *              driveDistance(distance);
+ *          } else if (!grabbedTote()) {
+ *              grabTote();
+ *          } else {
+ *              // Tote was grabbed and we're done!
+ *              return;
+ *          }
+ *      }
+ *
+ * }
+ * </code></pre>
+ */
+package edu.wpi.first.wpilibj.vision;
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/.styleguide b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/.styleguide
new file mode 100644
index 0000000..44ae5fb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/.styleguide
@@ -0,0 +1,40 @@
+cppHeaderFileInclude {
+  \.h$
+  \.hpp$
+  \.inc$
+}
+
+cppSrcFileInclude {
+  \.cpp$
+}
+
+generatedFileExclude {
+  gmock/
+  ni-libraries/include/
+  ni-libraries/lib/
+  hal/src/main/native/athena/ctre/
+  hal/src/main/native/athena/frccansae/
+  hal/src/main/native/athena/visa/
+  hal/src/main/native/include/ctre/
+  UsageReporting\.h$
+}
+
+modifiableFileExclude {
+  wpilibj/src/arm-linux-jni/
+  wpilibj/src/main/native/cpp/
+  \.patch$
+  \.png$
+  \.py$
+  \.so$
+}
+
+includeOtherLibs {
+  ^HAL/
+  ^llvm/
+  ^opencv2/
+  ^support/
+}
+
+includeProject {
+  ^ctre/
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AccelerometerJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AccelerometerJNI.cpp
new file mode 100644
index 0000000..d67c084
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AccelerometerJNI.cpp
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Accelerometer.h"
+#include <jni.h>
+#include "edu_wpi_first_wpilibj_hal_AccelerometerJNI.h"
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AccelerometerJNI
+ * Method:    setAccelerometerActive
+ * Signature: (Z)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerActive(
+    JNIEnv *, jclass, jboolean active) {
+  HAL_SetAccelerometerActive(active);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AccelerometerJNI
+ * Method:    setAccelerometerRange
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_setAccelerometerRange(
+    JNIEnv *, jclass, jint range) {
+  HAL_SetAccelerometerRange((HAL_AccelerometerRange)range);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AccelerometerJNI
+ * Method:    getAccelerometerX
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerX(
+    JNIEnv *, jclass) {
+  return HAL_GetAccelerometerX();
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AccelerometerJNI
+ * Method:    getAccelerometerY
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerY(
+    JNIEnv *, jclass) {
+  return HAL_GetAccelerometerY();
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AccelerometerJNI
+ * Method:    getAccelerometerZ
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AccelerometerJNI_getAccelerometerZ(
+    JNIEnv *, jclass) {
+  return HAL_GetAccelerometerZ();
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AnalogGyroJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AnalogGyroJNI.cpp
new file mode 100644
index 0000000..f5e019f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AnalogGyroJNI.cpp
@@ -0,0 +1,219 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_AnalogGyroJNI.h"
+
+#include "HAL/AnalogGyro.h"
+#include "HALUtil.h"
+#include "HAL/handles/HandlesInternal.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel analogGyroJNILogLevel = logWARNING;
+
+#define ANALOGGYROJNI_LOG(level)     \
+  if (level > analogGyroJNILogLevel) \
+    ;                           \
+  else                          \
+  Log().Get(level)
+
+extern "C" {
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    initializeAnalogGyro
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_initializeAnalogGyro(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI initializeAnalogGyro";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Analog Input Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_GyroHandle handle = HAL_InitializeAnalogGyro((HAL_AnalogInputHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << handle;
+  // Analog input does range checking, so we don't need to do so.
+  CheckStatusForceThrow(env, status);
+  return (jint) handle;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    setupAnalogGyro
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setupAnalogGyro(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setupAnalogGyro";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  HAL_SetupAnalogGyro((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    freeAnalogGyro
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_freeAnalogGyro(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI freeAnalogGyro";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  HAL_FreeAnalogGyro((HAL_GyroHandle)id);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    setAnalogGyroParameters
+ * Signature: (IDDI)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroParameters(
+    JNIEnv* env, jclass, jint id, jdouble vPDPS, jdouble offset, jint center) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setAnalogGyroParameters";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogGyroParameters((HAL_GyroHandle)id, vPDPS, offset, center, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    setAnalogGyroVoltsPerDegreePerSecond
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroVoltsPerDegreePerSecond(
+    JNIEnv* env, jclass, jint id, jdouble vPDPS) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setAnalogGyroVoltsPerDegreePerSecond";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  ANALOGGYROJNI_LOG(logDEBUG) << "vPDPS = " << vPDPS;
+  int32_t status = 0;
+  HAL_SetAnalogGyroVoltsPerDegreePerSecond((HAL_GyroHandle)id, vPDPS, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    resetAnalogGyro
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_resetAnalogGyro(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI resetAnalogGyro";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  HAL_ResetAnalogGyro((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    calibrateAnalogGyro
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_calibrateAnalogGyro(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI calibrateAnalogGyro";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  HAL_CalibrateAnalogGyro((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    setAnalogGyroDeadband
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_setAnalogGyroDeadband(
+    JNIEnv* env, jclass, jint id, jdouble deadband) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI setAnalogGyroDeadband";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogGyroDeadband((HAL_GyroHandle)id, deadband, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    getAnalogGyroAngle
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroAngle(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroAngle";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  jdouble value = HAL_GetAnalogGyroAngle((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGGYROJNI_LOG(logDEBUG) << "Result = " << value;
+  CheckStatus(env, status);
+  return value;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    getAnalogGyroRate
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroRate(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroRate";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  jdouble value = HAL_GetAnalogGyroRate((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGGYROJNI_LOG(logDEBUG) << "Result = " << value;
+  CheckStatus(env, status);
+  return value;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    getAnalogGyroOffset
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroOffset(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroOffset";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  jdouble value = HAL_GetAnalogGyroOffset((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGGYROJNI_LOG(logDEBUG) << "Result = " << value;
+  CheckStatus(env, status);
+  return value;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogGyroJNI
+ * Method:    getAnalogGyroCenter
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogGyroJNI_getAnalogGyroCenter(
+    JNIEnv* env, jclass, jint id) {
+  ANALOGGYROJNI_LOG(logDEBUG) << "Calling ANALOGGYROJNI getAnalogGyroCenter";
+  ANALOGGYROJNI_LOG(logDEBUG) << "Gyro Handle = " << (HAL_GyroHandle)id;
+  int32_t status = 0;
+  jint value = HAL_GetAnalogGyroCenter((HAL_GyroHandle)id, &status);
+  ANALOGGYROJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGGYROJNI_LOG(logDEBUG) << "Result = " << value;
+  CheckStatus(env, status);
+  return value;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AnalogJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AnalogJNI.cpp
new file mode 100644
index 0000000..51a126e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/AnalogJNI.cpp
@@ -0,0 +1,656 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_AnalogJNI.h"
+
+#include "HAL/AnalogInput.h"
+#include "HAL/AnalogOutput.h"
+#include "HAL/AnalogAccumulator.h"
+#include "HAL/AnalogTrigger.h"
+#include "HAL/Ports.h"
+#include "HALUtil.h"
+#include "HAL/handles/HandlesInternal.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel analogJNILogLevel = logWARNING;
+
+#define ANALOGJNI_LOG(level)     \
+  if (level > analogJNILogLevel) \
+    ;                            \
+  else                           \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    initializeAnalogInputPort
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogInputPort(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
+  int32_t status = 0;
+  auto analog = HAL_InitializeAnalogInputPort((HAL_PortHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << analog;
+  CheckStatusRange(env, status, 0, HAL_GetNumAnalogInputs(), 
+                   hal::getPortHandleChannel((HAL_PortHandle)id));
+  return (jint)analog;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    freeAnalogInputPort
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogInputPort(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_AnalogInputHandle)id;
+  HAL_FreeAnalogInputPort((HAL_AnalogInputHandle)id);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    initializeAnalogOutputPort
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogOutputPort(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
+  int32_t status = 0;
+  HAL_AnalogOutputHandle analog = HAL_InitializeAnalogOutputPort((HAL_PortHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << analog;
+  CheckStatusRange(env, status, 0, HAL_GetNumAnalogOutputs(), 
+                   hal::getPortHandleChannel((HAL_PortHandle)id));
+  return (jlong)analog;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    freeAnalogOutputPort
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_freeAnalogOutputPort(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << id;
+  HAL_FreeAnalogOutputPort((HAL_AnalogOutputHandle)id);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    checkAnalogModule
+ * Signature: (B)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogModule(
+    JNIEnv *, jclass, jbyte value) {
+  // ANALOGJNI_LOG(logDEBUG) << "Module = " << (jint)value;
+  jboolean returnValue = HAL_CheckAnalogModule(value);
+  // ANALOGJNI_LOG(logDEBUG) << "checkAnalogModuleResult = " <<
+  // (jint)returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    checkAnalogInputChannel
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogInputChannel(
+    JNIEnv *, jclass, jint value) {
+  // ANALOGJNI_LOG(logDEBUG) << "Channel = " << value;
+  jboolean returnValue = HAL_CheckAnalogInputChannel(value);
+  // ANALOGJNI_LOG(logDEBUG) << "checkAnalogChannelResult = " <<
+  // (jint)returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    checkAnalogOutputChannel
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_checkAnalogOutputChannel(
+    JNIEnv *, jclass, jint value) {
+  // ANALOGJNI_LOG(logDEBUG) << "Channel = " << value;
+  jboolean returnValue = HAL_CheckAnalogOutputChannel(value);
+  // ANALOGJNI_LOG(logDEBUG) << "checkAnalogChannelResult = " <<
+  // (jint)returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogOutput
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOutput(
+    JNIEnv *env, jclass, jint id, jdouble voltage) {
+  ANALOGJNI_LOG(logDEBUG) << "Calling setAnalogOutput";
+  ANALOGJNI_LOG(logDEBUG) << "Voltage = " << voltage;
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << id;
+  int32_t status = 0;
+  HAL_SetAnalogOutput((HAL_AnalogOutputHandle)id, voltage, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogOutput
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOutput(
+    JNIEnv *env, jclass, jint id) {
+  int32_t status = 0;
+  double val = HAL_GetAnalogOutput((HAL_AnalogOutputHandle)id, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogSampleRate
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogSampleRate(
+    JNIEnv *env, jclass, jdouble value) {
+  ANALOGJNI_LOG(logDEBUG) << "SampleRate = " << value;
+  int32_t status = 0;
+  HAL_SetAnalogSampleRate(value, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogSampleRate
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogSampleRate(
+    JNIEnv *env, jclass) {
+  int32_t status = 0;
+  double returnValue = HAL_GetAnalogSampleRate(&status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "SampleRate = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogAverageBits
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogAverageBits(
+    JNIEnv *env, jclass, jint id, jint value) {
+  ANALOGJNI_LOG(logDEBUG) << "AverageBits = " << value;
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogAverageBits((HAL_AnalogInputHandle)id, value, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogAverageBits
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageBits(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetAnalogAverageBits((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AverageBits = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogOversampleBits
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogOversampleBits(
+    JNIEnv *env, jclass, jint id, jint value) {
+  ANALOGJNI_LOG(logDEBUG) << "OversampleBits = " << value;
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogOversampleBits((HAL_AnalogInputHandle)id, value, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogOversampleBits
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOversampleBits(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetAnalogOversampleBits((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "OversampleBits = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogValue
+ * Signature: (I)S
+ */
+JNIEXPORT jshort JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogValue(
+    JNIEnv *env, jclass, jint id) {
+  // ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (void*)id;
+  int32_t status = 0;
+  jshort returnValue = HAL_GetAnalogValue((HAL_AnalogInputHandle)id, &status);
+  // ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  // ANALOGJNI_LOG(logDEBUG) << "Value = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogAverageValue
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageValue(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetAnalogAverageValue((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AverageValue = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogVoltsToValue
+ * Signature: (ID)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltsToValue(
+    JNIEnv *env, jclass, jint id, jdouble voltageValue) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  ANALOGJNI_LOG(logDEBUG) << "VoltageValue = " << voltageValue;
+  int32_t status = 0;
+  jint returnValue = HAL_GetAnalogVoltsToValue((HAL_AnalogInputHandle)id, voltageValue, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "Value = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogVoltage
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogVoltage(
+    JNIEnv *env, jclass, jint id) {
+  // ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (void*)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetAnalogVoltage((HAL_AnalogInputHandle)id, &status);
+  // ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  // ANALOGJNI_LOG(logDEBUG) << "Voltage = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogAverageVoltage
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogAverageVoltage(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetAnalogAverageVoltage((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AverageVoltage = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogLSBWeight
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogLSBWeight(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+
+  jint returnValue = HAL_GetAnalogLSBWeight((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AnalogLSBWeight = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogOffset
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogOffset(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+
+  jint returnValue = HAL_GetAnalogOffset((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AnalogOffset = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    isAccumulatorChannel
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_isAccumulatorChannel(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "isAccumulatorChannel";
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+
+  jboolean returnValue = HAL_IsAccumulatorChannel((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AnalogOffset = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    initAccumulator
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initAccumulator(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_InitAccumulator((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    resetAccumulator
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_resetAccumulator(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_ResetAccumulator((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAccumulatorCenter
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorCenter(
+    JNIEnv *env, jclass, jint id, jint center) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_SetAccumulatorCenter((HAL_AnalogInputHandle)id, center, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAccumulatorDeadband
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAccumulatorDeadband(
+    JNIEnv *env, jclass, jint id, jint deadband) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  HAL_SetAccumulatorDeadband((HAL_AnalogInputHandle)id, deadband, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAccumulatorValue
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorValue(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  jlong returnValue = HAL_GetAccumulatorValue((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AccumulatorValue = " << returnValue;
+  CheckStatus(env, status);
+
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAccumulatorCount
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorCount(
+    JNIEnv *env, jclass, jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetAccumulatorCount((HAL_AnalogInputHandle)id, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AccumulatorCount = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAccumulatorOutput
+ * Signature: (ILedu/wpi/first/wpilibj/AccumulatorResult;)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAccumulatorOutput(
+    JNIEnv *env, jclass, jint id, jobject accumulatorResult) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Handle = " << (HAL_AnalogInputHandle)id;
+  int32_t status = 0;
+  int64_t value = 0;
+  int64_t count = 0;
+  HAL_GetAccumulatorOutput((HAL_AnalogInputHandle)id, &value, &count, &status);
+  SetAccumulatorResultObject(env, accumulatorResult, value, count);
+  ANALOGJNI_LOG(logDEBUG) << "Value = " << value;
+  ANALOGJNI_LOG(logDEBUG) << "Count = " << count;
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    initializeAnalogTrigger
+ * Signature: (ILjava/nio/IntBuffer;)J
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_initializeAnalogTrigger(
+    JNIEnv *env, jclass, jint id, jobject index) {
+  ANALOGJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_AnalogInputHandle)id;
+  jint *indexHandle = (jint *)env->GetDirectBufferAddress(index);
+  ANALOGJNI_LOG(logDEBUG) << "Index Ptr = " << indexHandle;
+  int32_t status = 0;
+  HAL_AnalogTriggerHandle analogTrigger =
+      HAL_InitializeAnalogTrigger((HAL_AnalogInputHandle)id, (int32_t *)indexHandle, &status);
+  ANALOGJNI_LOG(logDEBUG) << "Status = " << status;
+  ANALOGJNI_LOG(logDEBUG) << "AnalogTrigger Handle = " << analogTrigger;
+  CheckStatus(env, status);
+  return (jint)analogTrigger;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    cleanAnalogTrigger
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_cleanAnalogTrigger(
+    JNIEnv *env, jclass,jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  HAL_CleanAnalogTrigger((HAL_AnalogTriggerHandle)id, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogTriggerLimitsRaw
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsRaw(
+    JNIEnv *env, jclass,jint id, jint lower, jint upper) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerLimitsRaw((HAL_AnalogTriggerHandle)id, lower, upper, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogTriggerLimitsVoltage
+ * Signature: (IDD)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerLimitsVoltage(
+    JNIEnv *env, jclass,jint id, jdouble lower, jdouble upper) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerLimitsVoltage((HAL_AnalogTriggerHandle)id, lower, upper, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogTriggerAveraged
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerAveraged(
+    JNIEnv *env, jclass,jint id, jboolean averaged) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerAveraged((HAL_AnalogTriggerHandle)id, averaged, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    setAnalogTriggerFiltered
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_setAnalogTriggerFiltered(
+    JNIEnv *env, jclass,jint id, jboolean filtered) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  HAL_SetAnalogTriggerFiltered((HAL_AnalogTriggerHandle)id, filtered, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogTriggerInWindow
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerInWindow(
+    JNIEnv *env, jclass,jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  jboolean val = HAL_GetAnalogTriggerInWindow((HAL_AnalogTriggerHandle)id, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogTriggerTriggerState
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerTriggerState(
+    JNIEnv *env, jclass,jint id) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  jboolean val = HAL_GetAnalogTriggerTriggerState((HAL_AnalogTriggerHandle)id, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_AnalogJNI
+ * Method:    getAnalogTriggerOutput
+ * Signature: (II)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_AnalogJNI_getAnalogTriggerOutput(
+    JNIEnv *env, jclass,jint id, jint type) {
+  ANALOGJNI_LOG(logDEBUG) << "Analog Trigger Handle = " << (HAL_AnalogTriggerHandle)id;
+  int32_t status = 0;
+  jboolean val =
+      HAL_GetAnalogTriggerOutput((HAL_AnalogTriggerHandle)id, (HAL_AnalogTriggerType)type, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CANJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CANJNI.cpp
new file mode 100644
index 0000000..8b2ec9e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CANJNI.cpp
@@ -0,0 +1,153 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+
+#include "HAL/cpp/Log.h"
+#include "HAL/CAN.h"
+#include "HALUtil.h"
+#include "edu_wpi_first_wpilibj_can_CANJNI.h"
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+#include "support/jni_util.h"
+
+using namespace frc;
+using namespace wpi::java;
+
+// set the logging level
+// TLogLevel canJNILogLevel = logDEBUG;
+TLogLevel canJNILogLevel = logERROR;
+
+#define CANJNI_LOG(level)     \
+  if (level > canJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_can_CANJNI
+ * Method:    FRCNetCommCANSessionMuxSendMessage
+ * Signature: (I[BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxSendMessage(
+    JNIEnv *env, jclass, jint messageID, jbyteArray data, jint periodMs) {
+
+  CANJNI_LOG(logDEBUG)
+      << "Calling CANJNI FRCNetCommCANSessionMuxSendMessage";
+
+  JByteArrayRef dataArray{env, data};
+
+  const uint8_t *dataBuffer = reinterpret_cast<const uint8_t*>(dataArray.array().data());
+  uint8_t dataSize = dataArray.array().size();
+
+  CANJNI_LOG(logDEBUG) << "Message ID ";
+  CANJNI_LOG(logDEBUG).write_hex(messageID);
+
+  if (logDEBUG <= canJNILogLevel) {
+    if (dataBuffer) {
+      llvm::SmallString<128> buf;
+      llvm::raw_svector_ostream str(buf);
+      for (int32_t i = 0; i < dataSize; i++) {
+        str.write_hex(dataBuffer[i]) << ' ';
+      }
+
+      Log().Get(logDEBUG) << "Data: " << str.str();
+    } else {
+      CANJNI_LOG(logDEBUG) << "Data: null";
+    }
+  }
+
+  CANJNI_LOG(logDEBUG) << "Period: " << periodMs;
+
+  int32_t status = 0;
+  HAL_CAN_SendMessage(
+      messageID, dataBuffer, dataSize, periodMs, &status);
+
+  CANJNI_LOG(logDEBUG) << "Status: " << status;
+  CheckCANStatus(env, status, messageID);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_can_CANJNI
+ * Method:    FRCNetCommCANSessionMuxReceiveMessage
+ * Signature: (Ljava/nio/IntBuffer;ILjava/nio/ByteBuffer;)[B
+ */
+JNIEXPORT jbyteArray JNICALL
+Java_edu_wpi_first_wpilibj_can_CANJNI_FRCNetCommCANSessionMuxReceiveMessage(
+    JNIEnv *env, jclass, jobject messageID, jint messageIDMask,
+    jobject timeStamp) {
+
+  CANJNI_LOG(logDEBUG)
+      << "Calling CANJNI FRCNetCommCANSessionMuxReceiveMessage";
+
+  uint32_t *messageIDPtr = (uint32_t *)env->GetDirectBufferAddress(messageID);
+  uint32_t *timeStampPtr = (uint32_t *)env->GetDirectBufferAddress(timeStamp);
+
+  uint8_t dataSize = 0;
+  uint8_t buffer[8];
+
+  int32_t status = 0;
+  HAL_CAN_ReceiveMessage(
+      messageIDPtr, messageIDMask, buffer, &dataSize, timeStampPtr, &status);
+
+  CANJNI_LOG(logDEBUG) << "Message ID ";
+  CANJNI_LOG(logDEBUG).write_hex(*messageIDPtr);
+
+  if (logDEBUG <= canJNILogLevel) {
+    llvm::SmallString<128> buf;
+    llvm::raw_svector_ostream str(buf);
+
+    for (int32_t i = 0; i < dataSize; i++) {
+      // Pad one-digit data with a zero
+      if (buffer[i] <= 16) {
+        str << '0';
+      }
+
+      str.write_hex(buffer[i]) << ' ';
+    }
+
+    Log().Get(logDEBUG) << "Data: " << str.str();
+  }
+
+  CANJNI_LOG(logDEBUG) << "Timestamp: " << *timeStampPtr;
+  CANJNI_LOG(logDEBUG) << "Status: " << status;
+
+  if (!CheckCANStatus(env, status, *messageIDPtr)) return nullptr;
+  return MakeJByteArray(env, llvm::StringRef{reinterpret_cast<const char*>(buffer), 
+                        static_cast<size_t>(dataSize)});
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_can_CANJNI
+ * Method:    GetCANStatus
+ * Signature: (Ledu/wpi/first/wpilibj/can/CANStatus;)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_can_CANJNI_GetCANStatus
+(JNIEnv *env, jclass, jobject canStatus) {
+  CANJNI_LOG(logDEBUG)
+  << "Calling CANJNI HAL_CAN_GetCANStatus";
+
+  float percentBusUtilization = 0;
+  uint32_t busOffCount = 0;
+  uint32_t txFullCount = 0;
+  uint32_t receiveErrorCount = 0;
+  uint32_t transmitErrorCount = 0;
+  int32_t status = 0;
+  HAL_CAN_GetCANStatus(&percentBusUtilization, &busOffCount, &txFullCount,
+                       &receiveErrorCount, &transmitErrorCount, &status);
+  
+  if (!CheckStatus(env, status)) return;
+
+  SetCanStatusObject(env, canStatus, percentBusUtilization, busOffCount,
+                     txFullCount, receiveErrorCount, transmitErrorCount);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CompressorJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CompressorJNI.cpp
new file mode 100644
index 0000000..31cc8d8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CompressorJNI.cpp
@@ -0,0 +1,211 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Compressor.h"
+#include "HAL/Ports.h"
+#include "HAL/Solenoid.h"
+#include "HALUtil.h"
+#include "HAL/cpp/Log.h"
+#include "edu_wpi_first_wpilibj_hal_CompressorJNI.h"
+
+using namespace frc;
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    initializeCompressor
+ * Signature: (B)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_initializeCompressor(
+    JNIEnv *env, jclass, jbyte module) {
+  int32_t status = 0;
+  auto handle = HAL_InitializeCompressor(module, &status);
+  CheckStatusRange(env, status, 0, HAL_GetNumPCMModules(), module);
+  
+  return (jint)handle;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    checkCompressorModule
+ * Signature: (B)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_checkCompressorModule(
+    JNIEnv *env, jclass, jbyte module) {
+  return HAL_CheckCompressorModule(module);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressor
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressor(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressor((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    setCompressorClosedLoopControl
+ * Signature: (JZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_setCompressorClosedLoopControl(
+    JNIEnv *env, jclass, jint compressorHandle, jboolean value) {
+  int32_t status = 0;
+  HAL_SetCompressorClosedLoopControl((HAL_CompressorHandle)compressorHandle, value, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorClosedLoopControl
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorClosedLoopControl(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorClosedLoopControl((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorPressureSwitch
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorPressureSwitch(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorPressureSwitch((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorCurrent
+ * Signature: (J)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrent(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  double val = HAL_GetCompressorCurrent((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorCurrentTooHighFault
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighFault(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorCurrentTooHighFault((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorCurrentTooHighStickyFault
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorCurrentTooHighStickyFault(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val =
+      HAL_GetCompressorCurrentTooHighStickyFault((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorShortedStickyFault
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedStickyFault(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorShortedStickyFault((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorShortedFault
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorShortedFault(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorShortedFault((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorNotConnectedStickyFault
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedStickyFault(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorNotConnectedStickyFault((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    getCompressorNotConnectedFault
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_getCompressorNotConnectedFault(
+    JNIEnv *env, jclass, jint compressorHandle) {
+  int32_t status = 0;
+  bool val = HAL_GetCompressorNotConnectedFault((HAL_CompressorHandle)compressorHandle, &status);
+  CheckStatus(env, status);
+  return val;
+}
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CompressorJNI
+ * Method:    clearAllPCMStickyFaults
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CompressorJNI_clearAllPCMStickyFaults(
+    JNIEnv *env, jclass, jbyte module) {
+  int32_t status = 0;
+  HAL_ClearAllPCMStickyFaults((uint8_t)module, &status);
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/ConstantsJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/ConstantsJNI.cpp
new file mode 100644
index 0000000..e1eb416
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/ConstantsJNI.cpp
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_ConstantsJNI.h"
+
+#include "HAL/Constants.h"
+#include "HALUtil.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel constantsJNILogLevel = logWARNING;
+
+#define CONSTANTSJNI_LOG(level)     \
+  if (level > constantsJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_ConstantsJNI
+ * Method:    getSystemClockTicksPerMicrosecond
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_ConstantsJNI_getSystemClockTicksPerMicrosecond(
+    JNIEnv *env, jclass) {
+  CONSTANTSJNI_LOG(logDEBUG) << "Calling ConstantsJNI getSystemClockTicksPerMicrosecond";
+  jint value = HAL_GetSystemClockTicksPerMicrosecond();
+  CONSTANTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CounterJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CounterJNI.cpp
new file mode 100644
index 0000000..d43bb78
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/CounterJNI.cpp
@@ -0,0 +1,443 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_CounterJNI.h"
+
+#include "HAL/Counter.h"
+#include "HAL/Errors.h"
+#include "HALUtil.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel counterJNILogLevel = logWARNING;
+
+#define COUNTERJNI_LOG(level)     \
+  if (level > counterJNILogLevel) \
+    ;                             \
+  else                            \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    initializeCounter
+ * Signature: (ILjava/nio/IntBuffer;)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_initializeCounter(
+    JNIEnv* env, jclass, jint mode, jobject index) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI initializeCounter";
+  COUNTERJNI_LOG(logDEBUG) << "Mode = " << mode;
+  jint* indexPtr = (jint*)env->GetDirectBufferAddress(index);
+  COUNTERJNI_LOG(logDEBUG) << "Index Ptr = " << (int32_t*)indexPtr;
+  int32_t status = 0;
+  auto counter = HAL_InitializeCounter((HAL_Counter_Mode)mode, (int32_t*)indexPtr, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Index = " << *indexPtr;
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  COUNTERJNI_LOG(logDEBUG) << "COUNTER Handle = " << counter;
+  CheckStatusForceThrow(env, status);
+  return (jint)counter;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    freeCounter
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_freeCounter(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI freeCounter";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  HAL_FreeCounter((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterAverageSize
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterAverageSize(
+    JNIEnv* env, jclass, jint id, jint value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterAverageSize";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "AverageSize = " << value;
+  int32_t status = 0;
+  HAL_SetCounterAverageSize((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterUpSource
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSource(
+    JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
+    jint analogTriggerType) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpSource";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "digitalSourceHandle = " << digitalSourceHandle;
+  COUNTERJNI_LOG(logDEBUG) << "analogTriggerType = " << analogTriggerType;
+  int32_t status = 0;
+  HAL_SetCounterUpSource((HAL_CounterHandle)id, (HAL_Handle)digitalSourceHandle, 
+                     (HAL_AnalogTriggerType)analogTriggerType, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterUpSourceEdge
+ * Signature: (IZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpSourceEdge(
+    JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpSourceEdge";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "Rise = " << (jint)valueRise;
+  COUNTERJNI_LOG(logDEBUG) << "Fall = " << (jint)valueFall;
+  int32_t status = 0;
+  HAL_SetCounterUpSourceEdge((HAL_CounterHandle)id, valueRise, valueFall, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    clearCounterUpSource
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterUpSource(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI clearCounterUpSource";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  HAL_ClearCounterUpSource((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterDownSource
+ * Signature: (IIZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSource(
+    JNIEnv* env, jclass, jint id, jint digitalSourceHandle,
+    jint analogTriggerType) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterDownSource";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "digitalSourceHandle = " << digitalSourceHandle;
+  COUNTERJNI_LOG(logDEBUG) << "analogTriggerType = " << analogTriggerType;
+  int32_t status = 0;
+  HAL_SetCounterDownSource((HAL_CounterHandle)id, (HAL_Handle)digitalSourceHandle, 
+                       (HAL_AnalogTriggerType)analogTriggerType, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  if (status == PARAMETER_OUT_OF_RANGE) {
+    ThrowIllegalArgumentException(env,
+                                  "Counter only supports DownSource in "
+                                  "TwoPulse and ExternalDirection modes.");
+    return;
+  }
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterDownSourceEdge
+ * Signature: (IZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterDownSourceEdge(
+    JNIEnv* env, jclass, jint id, jboolean valueRise, jboolean valueFall) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterDownSourceEdge";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "Rise = " << (jint)valueRise;
+  COUNTERJNI_LOG(logDEBUG) << "Fall = " << (jint)valueFall;
+  int32_t status = 0;
+  HAL_SetCounterDownSourceEdge((HAL_CounterHandle)id, valueRise, valueFall, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    clearCounterDownSource
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_clearCounterDownSource(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI clearCounterDownSource";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  HAL_ClearCounterDownSource((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterUpDownMode
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpDownMode(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterUpDownMode";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  HAL_SetCounterUpDownMode((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterExternalDirectionMode
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterExternalDirectionMode(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG)
+      << "Calling COUNTERJNI setCounterExternalDirectionMode";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  HAL_SetCounterExternalDirectionMode((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterSemiPeriodMode
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSemiPeriodMode(
+    JNIEnv* env, jclass, jint id, jboolean value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterSemiPeriodMode";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "SemiPeriodMode = " << (jint)value;
+  int32_t status = 0;
+  HAL_SetCounterSemiPeriodMode((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterPulseLengthMode
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterPulseLengthMode(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterPulseLengthMode";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "PulseLengthMode = " << value;
+  int32_t status = 0;
+  HAL_SetCounterPulseLengthMode((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    getCounterSamplesToAverage
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterSamplesToAverage(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterSamplesToAverage";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetCounterSamplesToAverage((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  COUNTERJNI_LOG(logDEBUG) << "getCounterSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterSamplesToAverage
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterSamplesToAverage(
+    JNIEnv* env, jclass, jint id, jint value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterSamplesToAverage";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "SamplesToAverage = " << value;
+  int32_t status = 0;
+  HAL_SetCounterSamplesToAverage((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  if (status == PARAMETER_OUT_OF_RANGE) {
+    ThrowBoundaryException(env, value, 1, 127);
+    return;
+  }
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    resetCounter
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_resetCounter(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI resetCounter";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  HAL_ResetCounter((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    getCounter
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounter(
+    JNIEnv* env, jclass, jint id) {
+  // COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounter";
+  // COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetCounter((HAL_CounterHandle)id, &status);
+  // COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  // COUNTERJNI_LOG(logDEBUG) << "getCounterResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    getCounterPeriod
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterPeriod(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterPeriod";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetCounterPeriod((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  COUNTERJNI_LOG(logDEBUG) << "getCounterPeriodResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterMaxPeriod
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterMaxPeriod(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterMaxPeriod";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "MaxPeriod = " << value;
+  int32_t status = 0;
+  HAL_SetCounterMaxPeriod((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterUpdateWhenEmpty
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterUpdateWhenEmpty(
+    JNIEnv* env, jclass, jint id, jboolean value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterMaxPeriod";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "UpdateWhenEmpty = " << (jint)value;
+  int32_t status = 0;
+  HAL_SetCounterUpdateWhenEmpty((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    getCounterStopped
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterStopped(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterStopped";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetCounterStopped((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  COUNTERJNI_LOG(logDEBUG) << "getCounterStoppedResult = " << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    getCounterDirection
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_getCounterDirection(
+    JNIEnv* env, jclass, jint id) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI getCounterDirection";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetCounterDirection((HAL_CounterHandle)id, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  COUNTERJNI_LOG(logDEBUG) << "getCounterDirectionResult = "
+                           << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_CounterJNI
+ * Method:    setCounterReverseDirection
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_CounterJNI_setCounterReverseDirection(
+    JNIEnv* env, jclass, jint id, jboolean value) {
+  COUNTERJNI_LOG(logDEBUG) << "Calling COUNTERJNI setCounterReverseDirection";
+  COUNTERJNI_LOG(logDEBUG) << "Counter Handle = " << (HAL_CounterHandle)id;
+  COUNTERJNI_LOG(logDEBUG) << "ReverseDirection = " << (jint)value;
+  int32_t status = 0;
+  HAL_SetCounterReverseDirection((HAL_CounterHandle)id, value, &status);
+  COUNTERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/DIOJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/DIOJNI.cpp
new file mode 100644
index 0000000..16048df
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/DIOJNI.cpp
@@ -0,0 +1,273 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_DIOJNI.h"
+
+#include "HAL/DIO.h"
+#include "HAL/PWM.h"
+#include "HALUtil.h"
+#include "HAL/Ports.h"
+#include "HAL/handles/HandlesInternal.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel dioJNILogLevel = logWARNING;
+
+#define DIOJNI_LOG(level)     \
+  if (level > dioJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    initializeDIOPort
+ * Signature: (IZ)I;
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_initializeDIOPort(
+    JNIEnv *env, jclass, jint id, jboolean input) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI initializeDIOPort";
+  DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
+  DIOJNI_LOG(logDEBUG) << "Input = " << (jint)input;
+  int32_t status = 0;
+  auto dio = HAL_InitializeDIOPort((HAL_PortHandle)id, (uint8_t)input, &status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  DIOJNI_LOG(logDEBUG) << "DIO Handle = " << dio;
+  CheckStatusRange(env, status, 0, HAL_GetNumDigitalChannels(),
+                   hal::getPortHandleChannel((HAL_PortHandle)id));
+  return (jint)dio;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    checkDIOChannel
+ * Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_checkDIOChannel(
+    JNIEnv *env, jclass, jint channel) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI checkDIOChannel";
+  DIOJNI_LOG(logDEBUG) << "Channel = " << channel;
+  return HAL_CheckDIOChannel(channel);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    freeDIOPort
+ * Signature: (I)V;
+*/
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDIOPort(
+    JNIEnv *env, jclass, jint id) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI freeDIOPort";
+  DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  HAL_FreeDIOPort((HAL_DigitalHandle)id);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    setDIO
+ * Signature: (IS)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDIO(
+    JNIEnv *env, jclass, jint id, jshort value) {
+  // DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDIO";
+  // DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  // DIOJNI_LOG(logDEBUG) << "Value = " << value;
+  int32_t status = 0;
+  HAL_SetDIO((HAL_DigitalHandle)id, value, &status);
+  // DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    getDIO
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIO(JNIEnv *env, jclass, jint id) {
+  // DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getDIO";
+  // DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetDIO((HAL_DigitalHandle)id, &status);
+  // DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  // DIOJNI_LOG(logDEBUG) << "getDIOResult = " << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    getDIODirection
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_getDIODirection(
+    JNIEnv *env, jclass, jint id) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getDIODirection (RR upd)";
+  // DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetDIODirection((HAL_DigitalHandle)id, &status);
+  // DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  DIOJNI_LOG(logDEBUG) << "getDIODirectionResult = " << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    pulse
+ * Signature: (JD)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_pulse(
+    JNIEnv *env, jclass, jint id, jdouble value) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI pulse (RR upd)";
+  // DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  // DIOJNI_LOG(logDEBUG) << "Value = " << value;
+  int32_t status = 0;
+  HAL_Pulse((HAL_DigitalHandle)id, value, &status);
+  DIOJNI_LOG(logDEBUG) << "Did it work? Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    isPulsing
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_isPulsing(JNIEnv *env, jclass, jint id) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI isPulsing (RR upd)";
+  // DIOJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_IsPulsing((HAL_DigitalHandle)id, &status);
+  // DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  DIOJNI_LOG(logDEBUG) << "isPulsingResult = " << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    isAnyPulsing
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_isAnyPulsing(JNIEnv *env, jclass) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI isAnyPulsing (RR upd)";
+  int32_t status = 0;
+  jboolean returnValue = HAL_IsAnyPulsing(&status);
+  // DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  DIOJNI_LOG(logDEBUG) << "isAnyPulsingResult = " << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    getLoopTiming
+ * Signature: ()S
+ */
+JNIEXPORT jshort JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_getLoopTiming(JNIEnv *env, jclass) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI getLoopTimeing";
+  int32_t status = 0;
+  jshort returnValue = HAL_GetPWMLoopTiming(&status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  DIOJNI_LOG(logDEBUG) << "LoopTiming = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    allocateDigitalPWM
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_allocateDigitalPWM(JNIEnv* env, jclass) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI allocateDigitalPWM";
+  int32_t status = 0;
+  auto pwm = HAL_AllocateDigitalPWM(&status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  DIOJNI_LOG(logDEBUG) << "PWM Handle = " << pwm;
+  CheckStatus(env, status);
+  return (jint)pwm;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    freeDigitalPWM
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_freeDigitalPWM(JNIEnv* env, jclass, jint id) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI freeDigitalPWM";
+  DIOJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalPWMHandle)id;
+  int32_t status = 0;
+  HAL_FreeDigitalPWM((HAL_DigitalPWMHandle)id, &status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    setDigitalPWMRate
+ * Signature: (D)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMRate(
+    JNIEnv* env, jclass, jdouble value) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDigitalPWMRate";
+  DIOJNI_LOG(logDEBUG) << "Rate= " << value;
+  int32_t status = 0;
+  HAL_SetDigitalPWMRate(value, &status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    setDigitalPWMDutyCycle
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMDutyCycle(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDigitalPWMDutyCycle";
+  DIOJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalPWMHandle)id;
+  DIOJNI_LOG(logDEBUG) << "DutyCycle= " << value;
+  int32_t status = 0;
+  HAL_SetDigitalPWMDutyCycle((HAL_DigitalPWMHandle)id, value, &status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+ * Method:    setDigitalPWMOutputChannel
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_DIOJNI_setDigitalPWMOutputChannel(
+    JNIEnv* env, jclass, jint id, jint value) {
+  DIOJNI_LOG(logDEBUG) << "Calling DIOJNI setDigitalPWMOutputChannel";
+  DIOJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalPWMHandle)id;
+  DIOJNI_LOG(logDEBUG) << "Channel= " << value;
+  int32_t status = 0;
+  HAL_SetDigitalPWMOutputChannel((HAL_DigitalPWMHandle)id, (uint32_t)value, &status);
+  DIOJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/DigitalGlitchFilterJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/DigitalGlitchFilterJNI.cpp
new file mode 100644
index 0000000..8e5ed23
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/DigitalGlitchFilterJNI.cpp
@@ -0,0 +1,70 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <jni.h>
+#include "HAL/DIO.h"
+#include "HALUtil.h"
+
+#include "edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI.h"
+
+using namespace frc;
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
+ * Method:    setFilterSelect
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterSelect(
+    JNIEnv* env, jclass, jint id, jint filter_index) {
+  int32_t status = 0;
+
+  HAL_SetFilterSelect(static_cast<HAL_DigitalHandle>(id), filter_index,
+                      &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
+ * Method:    getFilterSelect
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterSelect(
+    JNIEnv* env, jclass, jint id) {
+  int32_t status = 0;
+
+  jint result =
+      HAL_GetFilterSelect(static_cast<HAL_DigitalHandle>(id), &status);
+  CheckStatus(env, status);
+  return result;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
+ * Method:    setFilterPeriod
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_setFilterPeriod(
+    JNIEnv* env, jclass, jint filter_index, jint fpga_cycles) {
+  int32_t status = 0;
+
+  HAL_SetFilterPeriod(filter_index, fpga_cycles, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI
+ * Method:    getFilterPeriod
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_DigitalGlitchFilterJNI_getFilterPeriod(
+    JNIEnv* env, jclass, jint filter_index) {
+  int32_t status = 0;
+
+  jint result = HAL_GetFilterPeriod(filter_index, &status);
+  CheckStatus(env, status);
+  return result;
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/EncoderJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/EncoderJNI.cpp
new file mode 100644
index 0000000..9a0791e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/EncoderJNI.cpp
@@ -0,0 +1,454 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_EncoderJNI.h"
+
+#include "HAL/Encoder.h"
+#include "HAL/Errors.h"
+#include "HALUtil.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel encoderJNILogLevel = logWARNING;
+
+#define ENCODERJNI_LOG(level)     \
+  if (level > encoderJNILogLevel) \
+    ;                             \
+  else                            \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    initializeEncoder
+ * Signature: (IIIIZI)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_initializeEncoder(
+    JNIEnv* env, jclass, jint digitalSourceHandleA, jint analogTriggerTypeA,
+    jint digitalSourceHandleB, jint analogTriggerTypeB, jboolean reverseDirection, 
+    jint encodingType) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI initializeEncoder";
+  ENCODERJNI_LOG(logDEBUG) << "Source Handle A = " << digitalSourceHandleA;
+  ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type A = "
+                           << analogTriggerTypeA;
+  ENCODERJNI_LOG(logDEBUG) << "Source Handle B = " << digitalSourceHandleB;
+  ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type B = "
+                           << analogTriggerTypeB;
+  ENCODERJNI_LOG(logDEBUG) << "Reverse direction = " << (jint)reverseDirection;
+  ENCODERJNI_LOG(logDEBUG) << "EncodingType = " << encodingType;
+  int32_t status = 0;
+  auto encoder = HAL_InitializeEncoder(
+      (HAL_Handle)digitalSourceHandleA, (HAL_AnalogTriggerType)analogTriggerTypeA, 
+      (HAL_Handle)digitalSourceHandleB, (HAL_AnalogTriggerType)analogTriggerTypeB,
+      reverseDirection, (HAL_EncoderEncodingType)encodingType, &status);
+      
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "ENCODER Handle = " << encoder;
+  CheckStatusForceThrow(env, status);
+  return (jint)encoder;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    freeEncoder
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_freeEncoder(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI freeEncoder";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_FreeEncoder((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoder
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoder(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoder";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoder((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderRaw
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRaw(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderRaw";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderRaw((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getRawEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncodingScaleFactor
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncodingScaleFactor(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncodingScaleFactor";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderEncodingScale((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncodingScaleFactorResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    resetEncoder
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_EncoderJNI_resetEncoder(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI resetEncoder";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_ResetEncoder((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderPeriod
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderPeriod(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderPeriod";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  double returnValue = HAL_GetEncoderPeriod((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderPeriodEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    setEncoderMaxPeriod
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMaxPeriod(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderMaxPeriod";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_SetEncoderMaxPeriod((HAL_EncoderHandle)id, value, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderStopped
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderStopped(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderStopped";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetEncoderStopped((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getStoppedEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderDirection
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDirection(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderDirection";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetEncoderDirection((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getDirectionEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderDistance
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistance(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderDistance";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetEncoderDistance((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getDistanceEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderRate
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderRate(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderRate";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetEncoderRate((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getRateEncoderResult = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    setEncoderMinRate
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderMinRate(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderMinRate";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_SetEncoderMinRate((HAL_EncoderHandle)id, value, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    setEncoderDistancePerPulse
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderDistancePerPulse(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderDistancePerPulse";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_SetEncoderDistancePerPulse((HAL_EncoderHandle)id, value, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    setEncoderReverseDirection
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderReverseDirection(
+    JNIEnv* env, jclass, jint id, jboolean value) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderReverseDirection";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_SetEncoderReverseDirection((HAL_EncoderHandle)id, value, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    setEncoderSamplesToAverage
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderSamplesToAverage(
+    JNIEnv* env, jclass, jint id, jint value) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  HAL_SetEncoderSamplesToAverage((HAL_EncoderHandle)id, value, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  if (status == PARAMETER_OUT_OF_RANGE) {
+    ThrowBoundaryException(env, value, 1, 127);
+    return;
+  }
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderSamplesToAverage
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderSamplesToAverage(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderSamplesToAverage((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    setEncoderIndexSource
+ * Signature: (IIII)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_setEncoderIndexSource(
+    JNIEnv* env, jclass, jint id, jint digitalSourceHandle, 
+    jint analogTriggerType, jint type) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI setEncoderIndexSource";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  ENCODERJNI_LOG(logDEBUG) << "Source Handle = " << digitalSourceHandle;
+  ENCODERJNI_LOG(logDEBUG) << "Analog Trigger Type = "
+                           << analogTriggerType;
+  ENCODERJNI_LOG(logDEBUG) << "IndexingType = " << type;
+  int32_t status = 0;
+  HAL_SetEncoderIndexSource((HAL_EncoderHandle)id, (HAL_Handle)digitalSourceHandle, 
+                            (HAL_AnalogTriggerType)analogTriggerType, 
+                            (HAL_EncoderIndexingType)type, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderFPGAIndex
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderFPGAIndex(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderFPGAIndex((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderEncodingScale
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingScale(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderEncodingScale((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderDecodingScaleFactor
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDecodingScaleFactor(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderDecodingScaleFactor((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderDistancePerPulse
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderDistancePerPulse(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderDistancePerPulse((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_EncoderJNI
+ * Method:    getEncoderEncodingType
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_EncoderJNI_getEncoderEncodingType(
+    JNIEnv* env, jclass, jint id) {
+  ENCODERJNI_LOG(logDEBUG) << "Calling ENCODERJNI getEncoderSamplesToAverage";
+  ENCODERJNI_LOG(logDEBUG) << "Encoder Handle = " << (HAL_EncoderHandle)id;
+  int32_t status = 0;
+  jint returnValue = HAL_GetEncoderEncodingType((HAL_EncoderHandle)id, &status);
+  ENCODERJNI_LOG(logDEBUG) << "Status = " << status;
+  ENCODERJNI_LOG(logDEBUG) << "getEncoderSamplesToAverageResult = "
+                           << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HAL.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HAL.cpp
new file mode 100644
index 0000000..6634e9e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HAL.cpp
@@ -0,0 +1,402 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cstring>
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "HAL/HAL.h"
+#include "HAL/DriverStation.h"
+#include "edu_wpi_first_wpilibj_hal_HAL.h"
+#include "HALUtil.h"
+#include "support/jni_util.h"
+
+using namespace frc;
+using namespace wpi::java;
+
+// set the logging level
+static TLogLevel netCommLogLevel = logWARNING;
+
+#define NETCOMM_LOG(level)     \
+  if (level > netCommLogLevel) \
+    ;                          \
+  else                         \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    Initialize
+ * Signature: (Z)II
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_initialize(JNIEnv*, jclass, jint timeout, jint mode) {
+  return HAL_Initialize(timeout, mode);
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    observeUserProgramStarting
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramStarting(JNIEnv*, jclass) {
+  HAL_ObserveUserProgramStarting();
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    observeUserProgramDisabled
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramDisabled(JNIEnv*, jclass) {
+  HAL_ObserveUserProgramDisabled();
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    observeUserProgramAutonomous
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramAutonomous(
+    JNIEnv*, jclass) {
+  HAL_ObserveUserProgramAutonomous();
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    observeUserProgramTeleop
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramTeleop(JNIEnv*, jclass) {
+  HAL_ObserveUserProgramTeleop();
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    observeUserProgramTest
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_observeUserProgramTest(JNIEnv*, jclass) {
+  HAL_ObserveUserProgramTest();
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_Report
+ * Signature: (IIILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_report(
+    JNIEnv* paramEnv, jclass, jint paramResource, jint paramInstanceNumber,
+    jint paramContext, jstring paramFeature) {
+  JStringRef featureStr{paramEnv, paramFeature};
+  NETCOMM_LOG(logDEBUG) << "Calling HAL report "
+                        << "res:" << paramResource
+                        << " instance:" << paramInstanceNumber
+                        << " context:" << paramContext
+                        << " feature:" << featureStr.c_str();
+  jint returnValue =
+      HAL_Report(paramResource, paramInstanceNumber, paramContext, featureStr.c_str());
+  return returnValue;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    NativeGetControlWord
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetControlWord(JNIEnv*, jclass) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL Control Word";
+  static_assert(sizeof(HAL_ControlWord) == sizeof(jint),
+      "Java int must match the size of control word");
+  HAL_ControlWord controlWord;
+  std::memset(&controlWord, 0, sizeof(HAL_ControlWord));
+  HAL_GetControlWord(&controlWord);
+  jint retVal = 0;
+  std::memcpy(&retVal, &controlWord, sizeof(HAL_ControlWord));
+  return retVal;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    NativeGetAllianceStation
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_nativeGetAllianceStation(JNIEnv*, jclass) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL Alliance Station";
+  int32_t status = 0;
+  auto allianceStation = HAL_GetAllianceStation(&status);
+  return static_cast<jint>(allianceStation);
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickAxes
+ * Signature: (B[F)S
+ */
+JNIEXPORT jshort JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxes(JNIEnv* env, jclass,
+                                                   jbyte joystickNum,
+                                                   jfloatArray axesArray) {
+  NETCOMM_LOG(logDEBUG) << "Calling HALJoystickAxes";
+  HAL_JoystickAxes axes;
+  HAL_GetJoystickAxes(joystickNum, &axes);
+
+  jsize javaSize = env->GetArrayLength(axesArray);
+  if (axes.count > javaSize)
+  {
+    ThrowIllegalArgumentException(env, "Native array size larger then passed in java array size");
+  }
+
+  env->SetFloatArrayRegion(axesArray, 0, axes.count, axes.axes);
+
+  return axes.count;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickPOVs
+ * Signature: (B[S)S
+ */
+JNIEXPORT jshort JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickPOVs(JNIEnv* env, jclass,
+                                                   jbyte joystickNum,
+                                                   jshortArray povsArray) {
+  NETCOMM_LOG(logDEBUG) << "Calling HALJoystickPOVs";
+  HAL_JoystickPOVs povs;
+  HAL_GetJoystickPOVs(joystickNum, &povs);
+
+  jsize javaSize = env->GetArrayLength(povsArray);
+  if (povs.count > javaSize)
+  {
+    ThrowIllegalArgumentException(env, "Native array size larger then passed in java array size");
+  }
+
+  env->SetShortArrayRegion(povsArray, 0, povs.count, povs.povs);
+
+  return povs.count;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickButtons
+ * Signature: (BL)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickButtons(JNIEnv* env, jclass,
+                                                      jbyte joystickNum,
+                                                      jobject count) {
+  NETCOMM_LOG(logDEBUG) << "Calling HALJoystickButtons";
+  HAL_JoystickButtons joystickButtons;
+  HAL_GetJoystickButtons(joystickNum, &joystickButtons);
+  jbyte *countPtr = (jbyte *)env->GetDirectBufferAddress(count);
+  NETCOMM_LOG(logDEBUG) << "Buttons = " << joystickButtons.buttons;
+  NETCOMM_LOG(logDEBUG) << "Count = " << (jint)joystickButtons.count;
+  *countPtr = joystickButtons.count;
+  NETCOMM_LOG(logDEBUG) << "CountBuffer = " << (jint)*countPtr;
+  return joystickButtons.buttons;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_SetJoystickOutputs
+ * Signature: (BISS)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_setJoystickOutputs(JNIEnv*, jclass,
+                                                      jbyte port, jint outputs,
+                                                      jshort leftRumble,
+                                                      jshort rightRumble) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL_SetJoystickOutputs on port " << port;
+  NETCOMM_LOG(logDEBUG) << "Outputs: " << outputs;
+  NETCOMM_LOG(logDEBUG) << "Left Rumble: " << leftRumble
+                        << " Right Rumble: " << rightRumble;
+  return HAL_SetJoystickOutputs(port, outputs, leftRumble, rightRumble);
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickIsXbox
+ * Signature: (B)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickIsXbox(JNIEnv*, jclass,
+                                                     jbyte port) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickIsXbox";
+  return HAL_GetJoystickIsXbox(port);
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickType
+ * Signature: (B)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickType(JNIEnv*, jclass,
+                                                   jbyte port) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickType";
+  return HAL_GetJoystickType(port);
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickName
+ * Signature: (B)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickName(JNIEnv* env, jclass,
+                                                   jbyte port) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickName";
+  char *joystickName = HAL_GetJoystickName(port);
+  jstring str = MakeJString(env, joystickName);
+  HAL_FreeJoystickName(joystickName);
+  return str;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetJoystickAxisType
+ * Signature: (BB)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getJoystickAxisType(JNIEnv*, jclass,
+                                                       jbyte joystickNum,
+                                                       jbyte axis) {
+  NETCOMM_LOG(logDEBUG) << "Calling HAL_GetJoystickAxisType";
+  return HAL_GetJoystickAxisType(joystickNum, axis);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HAL
+ * Method:    isNewControlData
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_isNewControlData(JNIEnv *, jclass) {
+  return static_cast<jboolean>(HAL_IsNewControlData());
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    waitForDSData
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_waitForDSData(JNIEnv* env, jclass) {
+  HAL_WaitForDSData();
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    releaseDSMutex
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_releaseDSMutex(JNIEnv* env, jclass) {
+  HAL_ReleaseDSMutex();
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HAL
+ * Method:    waitForDSDataTimeout
+ * Signature: (D)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_waitForDSDataTimeout(JNIEnv *, jclass,
+                                                        jdouble timeout) {
+  return static_cast<jboolean>(HAL_WaitForDSDataTimeout(timeout));
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetMatchTime
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getMatchTime(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  return HAL_GetMatchTime(&status);
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetSystemActive
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getSystemActive(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  bool val = HAL_GetSystemActive(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_GetBrownedOut
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getBrownedOut(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  bool val = HAL_GetBrownedOut(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HAL
+ * Method:    getMatchInfo
+ * Signature: (Ledu/wpi/first/wpilibj/hal/MatchInfoData;)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_getMatchInfo
+(JNIEnv * env, jclass, jobject info) {
+  HAL_MatchInfo matchInfo;
+  auto status = HAL_GetMatchInfo(&matchInfo);
+  if (status == 0) {
+    SetMatchInfoObject(env, info, matchInfo);
+  }
+  HAL_FreeMatchInfo(&matchInfo);
+  return status;
+}
+
+/*
+ * Class: edu_wpi_first_wpilibj_hal_HAL
+ * Method:    HAL_SendError
+ * Signature: (ZIZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HAL_sendError(JNIEnv* env, jclass,
+                                             jboolean isError, jint errorCode,
+                                             jboolean isLVCode, jstring details,
+                                             jstring location,
+                                             jstring callStack,
+                                             jboolean printMsg) {
+  JStringRef detailsStr{env, details};
+  JStringRef locationStr{env, location};
+  JStringRef callStackStr{env, callStack};
+
+  NETCOMM_LOG(logDEBUG) << "Send Error: " << detailsStr.c_str();
+  NETCOMM_LOG(logDEBUG) << "Location: " << locationStr.c_str();
+  NETCOMM_LOG(logDEBUG) << "Call Stack: " << callStackStr.c_str();
+  jint returnValue = HAL_SendError(isError, errorCode, isLVCode, detailsStr.c_str(),
+                                  locationStr.c_str(), callStackStr.c_str(), printMsg);
+  return returnValue;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HALUtil.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HALUtil.cpp
new file mode 100644
index 0000000..2680422
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HALUtil.cpp
@@ -0,0 +1,445 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HALUtil.h"
+
+#include <assert.h>
+#include <errno.h>
+#include <jni.h>
+
+#include <cstdio>
+#include <cstring>
+#include <string>
+
+#include "HAL/CAN.h"
+#include "HAL/HAL.h"
+#include "HAL/DriverStation.h"
+#include "HAL/Errors.h"
+#include "HAL/cpp/Log.h"
+#include "edu_wpi_first_wpilibj_hal_HALUtil.h"
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+#include "support/jni_util.h"
+
+using namespace wpi::java;
+
+// set the logging level
+TLogLevel halUtilLogLevel = logWARNING;
+
+#define HALUTIL_LOG(level)     \
+  if (level > halUtilLogLevel) \
+    ;                          \
+  else                         \
+  Log().Get(level)
+
+#define kRioStatusOffset -63000
+#define kRioStatusSuccess 0
+#define kRIOStatusBufferInvalidSize (kRioStatusOffset - 80)
+#define kRIOStatusOperationTimedOut -52007
+#define kRIOStatusFeatureNotSupported (kRioStatusOffset - 193)
+#define kRIOStatusResourceNotInitialized -52010
+
+JavaVM *jvm = nullptr;
+static JException runtimeExCls;
+static JException illegalArgExCls;
+static JException boundaryExCls;
+static JException allocationExCls;
+static JException halHandleExCls;
+static JException canInvalidBufferExCls;
+static JException canMessageNotFoundExCls;
+static JException canMessageNotAllowedExCls;
+static JException canNotInitializedExCls;
+static JException uncleanStatusExCls;
+static JClass pwmConfigDataResultCls;
+static JClass canStatusCls;
+static JClass matchInfoDataCls;
+static JClass accumulatorResultCls;
+
+namespace frc {
+
+void ThrowAllocationException(JNIEnv *env, int32_t minRange, int32_t maxRange,
+    int32_t requestedValue, int32_t status) {
+  const char *message = HAL_GetErrorMessage(status);
+  llvm::SmallString<1024> buf;
+  llvm::raw_svector_ostream oss(buf);
+  oss << " Code: " << status << ". " << message << ", Minimum Value: "
+      << minRange << ", Maximum Value: " << maxRange << ", Requested Value: "
+      << requestedValue;
+  env->ThrowNew(allocationExCls, buf.c_str());
+  allocationExCls.Throw(env, buf.c_str());
+}
+
+void ThrowHalHandleException(JNIEnv *env, int32_t status) {
+  const char *message = HAL_GetErrorMessage(status);
+  llvm::SmallString<1024> buf;
+  llvm::raw_svector_ostream oss(buf);
+  oss << " Code: " << status << ". " << message;
+  halHandleExCls.Throw(env, buf.c_str());
+}
+
+void ReportError(JNIEnv *env, int32_t status, bool doThrow) {
+  if (status == 0) return;
+  if (status == HAL_HANDLE_ERROR) {
+    ThrowHalHandleException(env, status);
+  }
+  const char *message = HAL_GetErrorMessage(status);
+  if (doThrow && status < 0) {
+    llvm::SmallString<1024> buf;
+    llvm::raw_svector_ostream oss(buf);
+    oss << " Code: " << status << ". " << message;
+    runtimeExCls.Throw(env, buf.c_str());
+  } else {
+    std::string func;
+    auto stack = GetJavaStackTrace(env, &func, "edu.wpi.first.wpilibj");
+    HAL_SendError(1, status, 0, message, func.c_str(), stack.c_str(), 1);
+  }
+}
+
+void ThrowError(JNIEnv *env, int32_t status, int32_t minRange, int32_t maxRange,
+                int32_t requestedValue) {
+  if (status == 0) return;
+  if (status == NO_AVAILABLE_RESOURCES ||
+      status == RESOURCE_IS_ALLOCATED ||
+      status == RESOURCE_OUT_OF_RANGE) {
+    ThrowAllocationException(env, minRange, maxRange, requestedValue, status);
+  }
+  if (status == HAL_HANDLE_ERROR) {
+    ThrowHalHandleException(env, status);
+  }
+  const char *message = HAL_GetErrorMessage(status);
+  llvm::SmallString<1024> buf;
+  llvm::raw_svector_ostream oss(buf);
+  oss << " Code: " << status << ". " << message;
+  runtimeExCls.Throw(env, buf.c_str());
+}
+
+void ReportCANError(JNIEnv *env, int32_t status, int message_id) {
+  if (status >= 0) return;
+  switch (status) {
+    case kRioStatusSuccess:
+      // Everything is ok... don't throw.
+      break;
+    case HAL_ERR_CANSessionMux_InvalidBuffer:
+    case kRIOStatusBufferInvalidSize: {
+      static jmethodID invalidBufConstruct = nullptr;
+      if (!invalidBufConstruct)
+        invalidBufConstruct =
+            env->GetMethodID(canInvalidBufferExCls, "<init>", "()V");
+      jobject exception =
+          env->NewObject(canInvalidBufferExCls, invalidBufConstruct);
+      env->Throw(static_cast<jthrowable>(exception));
+      break;
+    }
+    case HAL_ERR_CANSessionMux_MessageNotFound:
+    case kRIOStatusOperationTimedOut: {
+      static jmethodID messageNotFoundConstruct = nullptr;
+      if (!messageNotFoundConstruct)
+        messageNotFoundConstruct =
+            env->GetMethodID(canMessageNotFoundExCls, "<init>", "()V");
+      jobject exception =
+          env->NewObject(canMessageNotFoundExCls, messageNotFoundConstruct);
+      env->Throw(static_cast<jthrowable>(exception));
+      break;
+    }
+    case HAL_ERR_CANSessionMux_NotAllowed:
+    case kRIOStatusFeatureNotSupported: {
+      llvm::SmallString<100> buf;
+      llvm::raw_svector_ostream oss(buf);
+      oss << "MessageID = " << message_id;
+      canMessageNotAllowedExCls.Throw(env, buf.c_str());
+      break;
+    }
+    case HAL_ERR_CANSessionMux_NotInitialized:
+    case kRIOStatusResourceNotInitialized: {
+      static jmethodID notInitConstruct = nullptr;
+      if (!notInitConstruct)
+        notInitConstruct =
+            env->GetMethodID(canNotInitializedExCls, "<init>", "()V");
+      jobject exception =
+          env->NewObject(canNotInitializedExCls, notInitConstruct);
+      env->Throw(static_cast<jthrowable>(exception));
+      break;
+    }
+    default: {
+      llvm::SmallString<100> buf;
+      llvm::raw_svector_ostream oss(buf);
+      oss << "Fatal status code detected: " << status;
+      uncleanStatusExCls.Throw(env, buf.c_str());
+      break;
+    }
+  }
+}
+
+void ThrowIllegalArgumentException(JNIEnv *env, const char *msg) {
+  illegalArgExCls.Throw(env, msg);
+}
+
+void ThrowBoundaryException(JNIEnv *env, double value, double lower,
+                            double upper) {
+  static jmethodID getMessage = nullptr;
+  if (!getMessage)
+    getMessage = env->GetStaticMethodID(boundaryExCls, "getMessage",
+                                        "(DDD)Ljava/lang/String;");
+
+  static jmethodID constructor = nullptr;
+  if (!constructor)
+    constructor =
+        env->GetMethodID(boundaryExCls, "<init>", "(Ljava/lang/String;)V");
+
+  jobject msg =
+      env->CallStaticObjectMethod(boundaryExCls, getMessage,
+                                  static_cast<jdouble>(value),
+                                  static_cast<jdouble>(lower),
+                                  static_cast<jdouble>(upper));
+  jobject ex = env->NewObject(boundaryExCls, constructor, msg);
+  env->Throw(static_cast<jthrowable>(ex));
+}
+
+jobject CreatePWMConfigDataResult(JNIEnv *env, int32_t maxPwm,
+                  int32_t deadbandMaxPwm, int32_t centerPwm,
+                  int32_t deadbandMinPwm, int32_t minPwm) {
+  static jmethodID constructor =
+      env->GetMethodID(pwmConfigDataResultCls, "<init>",
+                       "(IIIII)V");
+  return env->NewObject(pwmConfigDataResultCls, constructor, maxPwm,
+                        deadbandMaxPwm, centerPwm, deadbandMinPwm,
+                        minPwm);
+}
+
+void SetCanStatusObject(JNIEnv *env, jobject canStatus,
+                        float percentBusUtilization,
+                        uint32_t busOffCount, uint32_t txFullCount,
+                        uint32_t receiveErrorCount,
+                        uint32_t transmitErrorCount) {
+  static jmethodID func = env->GetMethodID(canStatusCls, "setStatus",
+                                           "(DIIII)V");
+  env->CallObjectMethod(canStatus, func, (jdouble)percentBusUtilization,
+                        (jint)busOffCount, (jint)txFullCount,
+                        (jint)receiveErrorCount, (jint)transmitErrorCount);
+}
+
+void SetMatchInfoObject(JNIEnv* env, jobject matchStatus,
+                        const HAL_MatchInfo& matchInfo) {
+  static jmethodID func = env->GetMethodID(matchInfoDataCls, "setData",
+      "(Ljava/lang/String;Ljava/lang/String;III)V");
+
+  env->CallObjectMethod(matchStatus, func,
+      MakeJString(env, matchInfo.eventName),
+      MakeJString(env, matchInfo.gameSpecificMessage),
+      (jint)matchInfo.matchNumber,
+      (jint)matchInfo.replayNumber,
+      (jint)matchInfo.matchType);
+}
+
+void SetAccumulatorResultObject(JNIEnv* env, jobject accumulatorResult,
+                                int64_t value, int64_t count) {
+  static jmethodID func = env->GetMethodID(accumulatorResultCls, "set",
+      "(JJ)V");
+
+  env->CallObjectMethod(accumulatorResult, func, (jlong)value, (jlong)count);
+}
+
+}  // namespace frc
+
+using namespace frc;
+
+extern "C" {
+
+//
+// indicate JNI version support desired and load classes
+//
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
+  jvm = vm;
+
+  // set our logging level
+  Log::ReportingLevel() = logDEBUG;
+
+  JNIEnv *env;
+  if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
+    return JNI_ERR;
+
+  runtimeExCls = JException(env, "java/lang/RuntimeException");
+  if (!runtimeExCls) return JNI_ERR;
+
+  illegalArgExCls = JException(env, "java/lang/IllegalArgumentException");
+  if (!illegalArgExCls) return JNI_ERR;
+
+  boundaryExCls = JException(env, "edu/wpi/first/wpilibj/util/BoundaryException");
+  if (!boundaryExCls) return JNI_ERR;
+
+  allocationExCls = JException(env, "edu/wpi/first/wpilibj/util/AllocationException");
+  if (!allocationExCls) return JNI_ERR;
+
+  halHandleExCls = JException(env, "edu/wpi/first/wpilibj/util/HalHandleException");
+  if (!halHandleExCls) return JNI_ERR;
+
+  canInvalidBufferExCls = JException(env, "edu/wpi/first/wpilibj/can/CANInvalidBufferException");
+  if (!canInvalidBufferExCls) return JNI_ERR;
+
+  canMessageNotFoundExCls = JException(env, "edu/wpi/first/wpilibj/can/CANMessageNotFoundException");
+  if (!canMessageNotFoundExCls) return JNI_ERR;
+
+  canMessageNotAllowedExCls = JException(env, "edu/wpi/first/wpilibj/can/CANMessageNotAllowedException");
+  if (!canMessageNotAllowedExCls) return JNI_ERR;
+
+  canNotInitializedExCls = JException(env, "edu/wpi/first/wpilibj/can/CANNotInitializedException");
+  if (!canNotInitializedExCls) return JNI_ERR;
+
+  uncleanStatusExCls = JException(env,"edu/wpi/first/wpilibj/util/UncleanStatusException");
+  if (!uncleanStatusExCls) return JNI_ERR;
+
+  pwmConfigDataResultCls = JClass(env, "edu/wpi/first/wpilibj/PWMConfigDataResult");
+  if (!pwmConfigDataResultCls) return JNI_ERR;
+
+  canStatusCls = JClass(env, "edu/wpi/first/wpilibj/can/CANStatus");
+  if (!canStatusCls) return JNI_ERR;
+
+  matchInfoDataCls = JClass(env, "edu/wpi/first/wpilibj/hal/MatchInfoData");
+  if (!matchInfoDataCls) return JNI_ERR;
+
+  accumulatorResultCls = JClass(env, "edu/wpi/first/wpilibj/AccumulatorResult");
+  if (!accumulatorResultCls) return JNI_ERR;
+
+  return JNI_VERSION_1_6;
+}
+
+JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
+  JNIEnv *env;
+  if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
+    return;
+  // Delete global references
+  runtimeExCls.free(env);
+  illegalArgExCls.free(env);
+  boundaryExCls.free(env);
+  allocationExCls.free(env);
+  halHandleExCls.free(env);
+  canInvalidBufferExCls.free(env);
+  canMessageNotFoundExCls.free(env);
+  canMessageNotAllowedExCls.free(env);
+  canNotInitializedExCls.free(env);
+  uncleanStatusExCls.free(env);
+  pwmConfigDataResultCls.free(env);
+  canStatusCls.free(env);
+  matchInfoDataCls.free(env);
+  jvm = nullptr;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getFPGAVersion
+ * Signature: ()S
+ */
+JNIEXPORT jshort JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAVersion(JNIEnv *env, jclass) {
+  HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGAVersion";
+  int32_t status = 0;
+  jshort returnValue = HAL_GetFPGAVersion(&status);
+  HALUTIL_LOG(logDEBUG) << "Status = " << status;
+  HALUTIL_LOG(logDEBUG) << "FPGAVersion = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getFPGARevision
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGARevision(JNIEnv *env, jclass) {
+  HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGARevision";
+  int32_t status = 0;
+  jint returnValue = HAL_GetFPGARevision(&status);
+  HALUTIL_LOG(logDEBUG) << "Status = " << status;
+  HALUTIL_LOG(logDEBUG) << "FPGARevision = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getFPGATime
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGATime(JNIEnv *env, jclass) {
+  // HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGATime";
+  int32_t status = 0;
+  jlong returnValue = HAL_GetFPGATime(&status);
+  // HALUTIL_LOG(logDEBUG) << "Status = " << status;
+  // HALUTIL_LOG(logDEBUG) << "FPGATime = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getHALRuntimeType
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALRuntimeType(JNIEnv *env, jclass) {
+  // HALUTIL_LOG(logDEBUG) << "Calling HALUtil getHALRuntimeType";
+  jint returnValue = HAL_GetRuntimeType();
+  // HALUTIL_LOG(logDEBUG) << "RuntimeType = " << returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getFPGAButton
+ * Signature: ()I
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getFPGAButton(JNIEnv *env, jclass) {
+  // HALUTIL_LOG(logDEBUG) << "Calling HALUtil getFPGATime";
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetFPGAButton(&status);
+  // HALUTIL_LOG(logDEBUG) << "Status = " << status;
+  // HALUTIL_LOG(logDEBUG) << "FPGATime = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getHALErrorMessage
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrorMessage(
+    JNIEnv *paramEnv, jclass, jint paramId) {
+  const char *msg = HAL_GetErrorMessage(paramId);
+  HALUTIL_LOG(logDEBUG) << "Calling HALUtil HAL_GetErrorMessage id=" << paramId
+                        << " msg=" << msg;
+  return MakeJString(paramEnv, msg);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getHALErrno
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALErrno(JNIEnv *, jclass) {
+  return errno;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_HALUtil
+ * Method:    getHALstrerror
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_edu_wpi_first_wpilibj_hal_HALUtil_getHALstrerror(
+    JNIEnv *env, jclass, jint errorCode) {
+  const char *msg = strerror(errno);
+  HALUTIL_LOG(logDEBUG) << "Calling HALUtil getHALstrerror errorCode="
+                        << errorCode << " msg=" << msg;
+  return MakeJString(env, msg);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HALUtil.h b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HALUtil.h
new file mode 100644
index 0000000..9feed50
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/HALUtil.h
@@ -0,0 +1,71 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef HALUTIL_H
+#define HALUTIL_H
+
+#include <stdint.h>
+
+#include <jni.h>
+
+extern JavaVM *jvm;
+
+struct HAL_MatchInfo;
+
+namespace frc {
+
+void ReportError(JNIEnv *env, int32_t status, bool doThrow = true);
+
+void ThrowError(JNIEnv *env, int32_t status, int32_t minRange, int32_t maxRange,
+                int32_t requestedValue);
+
+inline bool CheckStatus(JNIEnv *env, int32_t status, bool doThrow = true) {
+  if (status != 0) ReportError(env, status, doThrow);
+  return status == 0;
+}
+
+inline bool CheckStatusRange(JNIEnv *env, int32_t status, int32_t minRange,
+                             int32_t maxRange, int32_t requestedValue) {
+  if (status != 0) ThrowError(env, status, minRange, maxRange, requestedValue);
+  return status == 0;
+}
+
+inline bool CheckStatusForceThrow(JNIEnv *env, int32_t status) {
+  if (status != 0) ThrowError(env, status, 0, 0, 0);
+  return status == 0;
+}
+
+void ReportCANError(JNIEnv *env, int32_t status, int32_t message_id);
+
+inline bool CheckCANStatus(JNIEnv *env, int32_t status, int32_t message_id) {
+  if (status != 0) ReportCANError(env, status, message_id);
+  return status == 0;
+}
+
+void ThrowIllegalArgumentException(JNIEnv *env, const char *msg);
+void ThrowBoundaryException(JNIEnv *env, double value, double lower,
+                            double upper);
+
+jobject CreatePWMConfigDataResult(JNIEnv *env, int32_t maxPwm,
+                  int32_t deadbandMaxPwm, int32_t centerPwm,
+                  int32_t deadbandMinPwm, int32_t minPwm);
+
+void SetCanStatusObject(JNIEnv *env, jobject canStatus,
+                        float percentBusUtilization,
+                        uint32_t busOffCount, uint32_t txFullCount,
+                        uint32_t receiveErrorCount,
+                        uint32_t transmitErrorCount);
+
+void SetMatchInfoObject(JNIEnv* env, jobject matchStatus,
+                        const HAL_MatchInfo& matchInfo);
+
+void SetAccumulatorResultObject(JNIEnv* env, jobject accumulatorResult,
+                                int64_t value, int64_t count);
+
+}  // namespace frc
+
+#endif  // HALUTIL_H
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/I2CJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/I2CJNI.cpp
new file mode 100644
index 0000000..771f9e4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/I2CJNI.cpp
@@ -0,0 +1,196 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_I2CJNI.h"
+
+#include "HAL/I2C.h"
+#include "HALUtil.h"
+#include "support/jni_util.h"
+
+using namespace frc;
+using namespace wpi::java;
+
+// set the logging level
+TLogLevel i2cJNILogLevel = logWARNING;
+
+#define I2CJNI_LOG(level)     \
+  if (level > i2cJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2cInitialize
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CInitialize(
+    JNIEnv* env, jclass, jint port) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CInititalize";
+  I2CJNI_LOG(logDEBUG) << "Port: " << port;
+  int32_t status = 0;
+  HAL_InitializeI2C(static_cast<HAL_I2CPort>(port), &status);
+  I2CJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatusForceThrow(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CTransaction
+ * Signature: (IBLjava/nio/ByteBuffer;BLjava/nio/ByteBuffer;B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransaction(
+    JNIEnv* env, jclass, jint port, jbyte address, jobject dataToSend,
+    jbyte sendSize, jobject dataReceived, jbyte receiveSize) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CTransaction";
+  I2CJNI_LOG(logDEBUG) << "Port = " << port;
+  I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
+  uint8_t* dataToSendPtr = nullptr;
+  if (dataToSend != 0) {
+    dataToSendPtr = (uint8_t*)env->GetDirectBufferAddress(dataToSend);
+  }
+  I2CJNI_LOG(logDEBUG) << "DataToSendPtr = " << (jint*)dataToSendPtr;
+  I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
+  uint8_t* dataReceivedPtr =
+      (uint8_t*)env->GetDirectBufferAddress(dataReceived);
+  I2CJNI_LOG(logDEBUG) << "DataReceivedPtr = " << (jint*)dataReceivedPtr;
+  I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << (jint)receiveSize;
+  jint returnValue = HAL_TransactionI2C(static_cast<HAL_I2CPort>(port), address, dataToSendPtr, sendSize,
+                                    dataReceivedPtr, receiveSize);
+  I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CTransactionB
+ * Signature: (IB[BB[BB)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CTransactionB(
+    JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataToSend,
+    jbyte sendSize, jbyteArray dataReceived, jbyte receiveSize) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CTransactionB";
+  I2CJNI_LOG(logDEBUG) << "Port = " << port;
+  I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
+  I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
+  llvm::SmallVector<uint8_t, 128> recvBuf;
+  recvBuf.resize(receiveSize);
+  I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << (jint)receiveSize;
+  jint returnValue =
+      HAL_TransactionI2C(static_cast<HAL_I2CPort>(port), address,
+                         reinterpret_cast<const uint8_t *>(
+                             JByteArrayRef(env, dataToSend).array().data()),
+                         sendSize, recvBuf.data(), receiveSize);
+  env->SetByteArrayRegion(dataReceived, 0, receiveSize,
+                          reinterpret_cast<const jbyte *>(recvBuf.data()));
+  I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CWrite
+ * Signature: (IBLjava/nio/ByteBuffer;B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWrite(
+    JNIEnv* env, jclass, jint port, jbyte address, jobject dataToSend,
+    jbyte sendSize) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CWrite";
+  I2CJNI_LOG(logDEBUG) << "Port = " << port;
+  I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
+  uint8_t* dataToSendPtr = nullptr;
+
+  if (dataToSend != 0) {
+    dataToSendPtr = (uint8_t*)env->GetDirectBufferAddress(dataToSend);
+  }
+  I2CJNI_LOG(logDEBUG) << "DataToSendPtr = " << dataToSendPtr;
+  I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
+  jint returnValue = HAL_WriteI2C(static_cast<HAL_I2CPort>(port), address, dataToSendPtr, sendSize);
+  I2CJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CWriteB
+ * Signature: (IB[BB)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CWriteB(
+    JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataToSend,
+    jbyte sendSize) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CWrite";
+  I2CJNI_LOG(logDEBUG) << "Port = " << port;
+  I2CJNI_LOG(logDEBUG) << "Address = " << (jint)address;
+  I2CJNI_LOG(logDEBUG) << "SendSize = " << (jint)sendSize;
+  jint returnValue =
+      HAL_WriteI2C(static_cast<HAL_I2CPort>(port), address,
+                   reinterpret_cast<const uint8_t *>(
+                       JByteArrayRef(env, dataToSend).array().data()),
+                   sendSize);
+  I2CJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CRead
+ * Signature: (IBLjava/nio/ByteBuffer;B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CRead(
+    JNIEnv* env, jclass, jint port, jbyte address, jobject dataReceived,
+    jbyte receiveSize) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CRead";
+  I2CJNI_LOG(logDEBUG) << "Port = " << port;
+  I2CJNI_LOG(logDEBUG) << "Address = " << address;
+  uint8_t* dataReceivedPtr =
+      (uint8_t*)env->GetDirectBufferAddress(dataReceived);
+  I2CJNI_LOG(logDEBUG) << "DataReceivedPtr = " << dataReceivedPtr;
+  I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << receiveSize;
+  jint returnValue = HAL_ReadI2C(static_cast<HAL_I2CPort>(port), address, dataReceivedPtr, receiveSize);
+  I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CReadB
+ * Signature: (IB[BB)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CReadB(
+    JNIEnv* env, jclass, jint port, jbyte address, jbyteArray dataReceived,
+    jbyte receiveSize) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CRead";
+  I2CJNI_LOG(logDEBUG) << "Port = " << port;
+  I2CJNI_LOG(logDEBUG) << "Address = " << address;
+  I2CJNI_LOG(logDEBUG) << "ReceiveSize = " << receiveSize;
+  llvm::SmallVector<uint8_t, 128> recvBuf;
+  recvBuf.resize(receiveSize);
+  jint returnValue = HAL_ReadI2C(static_cast<HAL_I2CPort>(port), address, recvBuf.data(), receiveSize);
+  env->SetByteArrayRegion(dataReceived, 0, receiveSize,
+                          reinterpret_cast<const jbyte *>(recvBuf.data()));
+  I2CJNI_LOG(logDEBUG) << "ReturnValue = " << returnValue;
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_I2CJNI
+ * Method:    i2CClose
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_I2CJNI_i2CClose(JNIEnv*, jclass, jint port) {
+  I2CJNI_LOG(logDEBUG) << "Calling I2CJNI i2CClose";
+  HAL_CloseI2C(static_cast<HAL_I2CPort>(port));
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/InterruptJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/InterruptJNI.cpp
new file mode 100644
index 0000000..6150116
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/InterruptJNI.cpp
@@ -0,0 +1,347 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include <atomic>
+#include <thread>
+
+#include <support/mutex.h>
+
+#include "HAL/cpp/Log.h"
+
+#include "HAL/Interrupts.h"
+#include "HALUtil.h"
+#include "edu_wpi_first_wpilibj_hal_InterruptJNI.h"
+#include "support/SafeThread.h"
+
+using namespace frc;
+
+TLogLevel interruptJNILogLevel = logERROR;
+
+#define INTERRUPTJNI_LOG(level)     \
+  if (level > interruptJNILogLevel) \
+    ;                               \
+  else                              \
+  Log().Get(level)
+
+// Thread where callbacks are actually performed.
+//
+// JNI's AttachCurrentThread() creates a Java Thread object on every
+// invocation, which is both time inefficient and causes issues with Eclipse
+// (which tries to keep a thread list up-to-date and thus gets swamped).
+//
+// Instead, this class attaches just once.  When a hardware notification
+// occurs, a condition variable wakes up this thread and this thread actually
+// makes the call into Java.
+//
+// We don't want to use a FIFO here. If the user code takes too long to
+// process, we will just ignore the redundant wakeup.
+class InterruptThreadJNI : public wpi::SafeThread {
+ public:
+  void Main();
+
+  bool m_notify = false;
+  uint32_t m_mask = 0;
+  jobject m_func = nullptr;
+  jmethodID m_mid;
+  jobject m_param = nullptr;
+};
+
+class InterruptJNI : public wpi::SafeThreadOwner<InterruptThreadJNI> {
+ public:
+  void SetFunc(JNIEnv* env, jobject func, jmethodID mid, jobject param);
+
+  void Notify(uint32_t mask) {
+    auto thr = GetThread();
+    if (!thr) return;
+    thr->m_notify = true;
+    thr->m_mask = mask;
+    thr->m_cond.notify_one();
+  }
+};
+
+void InterruptJNI::SetFunc(JNIEnv* env, jobject func, jmethodID mid,
+                           jobject param) {
+  auto thr = GetThread();
+  if (!thr) return;
+  // free global references
+  if (thr->m_func) env->DeleteGlobalRef(thr->m_func);
+  if (thr->m_param) env->DeleteGlobalRef(thr->m_param);
+  // create global references
+  thr->m_func = env->NewGlobalRef(func);
+  thr->m_param = param ? env->NewGlobalRef(param) : nullptr;
+  thr->m_mid = mid;
+}
+
+void InterruptThreadJNI::Main() {
+  JNIEnv* env;
+  JavaVMAttachArgs args;
+  args.version = JNI_VERSION_1_2;
+  args.name = const_cast<char*>("Interrupt");
+  args.group = nullptr;
+  jint rs = jvm->AttachCurrentThreadAsDaemon(reinterpret_cast<void**>(&env),
+                                             &args);
+  if (rs != JNI_OK) return;
+
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  while (m_active) {
+    m_cond.wait(lock, [&] { return !m_active || m_notify; });
+    if (!m_active) break;
+    m_notify = false;
+    if (!m_func) continue;
+    jobject func = m_func;
+    jmethodID mid = m_mid;
+    uint32_t mask = m_mask;
+    jobject param = m_param;
+    lock.unlock();  // don't hold mutex during callback execution
+    env->CallVoidMethod(func, mid, static_cast<jint>(mask), param);
+    if (env->ExceptionCheck()) {
+      env->ExceptionDescribe();
+      env->ExceptionClear();
+    }
+    lock.lock();
+  }
+
+  // free global references
+  if (m_func) env->DeleteGlobalRef(m_func);
+  if (m_param) env->DeleteGlobalRef(m_param);
+
+  jvm->DetachCurrentThread();
+}
+
+void interruptHandler(uint32_t mask, void* param) {
+  static_cast<InterruptJNI*>(param)->Notify(mask);
+}
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    initializeInterrupts
+ * Signature: (Z)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_initializeInterrupts(
+    JNIEnv* env, jclass, jboolean watcher) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI initializeInterrupts";
+  INTERRUPTJNI_LOG(logDEBUG) << "watcher = " << (bool)watcher;
+
+  int32_t status = 0;
+  HAL_InterruptHandle interrupt = HAL_InitializeInterrupts(watcher, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << interrupt;
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+
+  CheckStatusForceThrow(env, status);
+  return (jint)interrupt;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    cleanInterrupts
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_cleanInterrupts(
+    JNIEnv* env, jclass, jint interruptHandle) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI cleanInterrupts";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  int32_t status = 0;
+  HAL_CleanInterrupts((HAL_InterruptHandle)interruptHandle, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+
+  // ignore status, as an invalid handle just needs to be ignored.
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    waitForInterrupt
+ * Signature: (JD)V
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_waitForInterrupt(
+    JNIEnv* env, jclass, jint interruptHandle, jdouble timeout,
+    jboolean ignorePrevious) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI waitForInterrupt";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  int32_t status = 0;
+  int32_t result = HAL_WaitForInterrupt((HAL_InterruptHandle)interruptHandle,
+                                        timeout, ignorePrevious, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+
+  CheckStatus(env, status);
+  return result;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    enableInterrupts
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_enableInterrupts(
+    JNIEnv* env, jclass, jint interruptHandle) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI enableInterrupts";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  int32_t status = 0;
+  HAL_EnableInterrupts((HAL_InterruptHandle)interruptHandle, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    disableInterrupts
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_disableInterrupts(
+    JNIEnv* env, jclass, jint interruptHandle) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI disableInterrupts";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  int32_t status = 0;
+  HAL_DisableInterrupts((HAL_InterruptHandle)interruptHandle, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    readInterruptRisingTimestamp
+ * Signature: (J)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptRisingTimestamp(
+    JNIEnv* env, jclass, jint interruptHandle) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI readInterruptRisingTimestamp";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  int32_t status = 0;
+  jdouble timeStamp = HAL_ReadInterruptRisingTimestamp((HAL_InterruptHandle)interruptHandle, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return timeStamp;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    readInterruptFallingTimestamp
+ * Signature: (J)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_readInterruptFallingTimestamp(
+    JNIEnv* env, jclass, jint interruptHandle) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI readInterruptFallingTimestamp";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  int32_t status = 0;
+  jdouble timeStamp = HAL_ReadInterruptFallingTimestamp((HAL_InterruptHandle)interruptHandle, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return timeStamp;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    requestInterrupts
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_requestInterrupts(
+    JNIEnv* env, jclass, jint interruptHandle, jint digitalSourceHandle,
+    jint analogTriggerType) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI requestInterrupts";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+  INTERRUPTJNI_LOG(logDEBUG) << "digitalSourceHandle = " << digitalSourceHandle;
+  INTERRUPTJNI_LOG(logDEBUG) << "analogTriggerType = " << analogTriggerType;
+
+  int32_t status = 0;
+  HAL_RequestInterrupts((HAL_InterruptHandle)interruptHandle, (HAL_Handle)digitalSourceHandle,
+                    (HAL_AnalogTriggerType)analogTriggerType, &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    attachInterruptHandler
+ * Signature:
+ * (JLedu/wpi/first/wpilibj/hal/InterruptJNI/InterruptHandlerFunction;Ljava/nio/ByteBuffer;)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_attachInterruptHandler(
+    JNIEnv* env, jclass, jint interruptHandle, jobject handler,
+    jobject param) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI attachInterruptHandler";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+
+  jclass cls = env->GetObjectClass(handler);
+  INTERRUPTJNI_LOG(logDEBUG) << "class = " << cls;
+  if (cls == 0) {
+    INTERRUPTJNI_LOG(logERROR) << "Error getting java class";
+    assert(false);
+    return;
+  }
+  jmethodID mid = env->GetMethodID(cls, "apply", "(ILjava/lang/Object;)V");
+  INTERRUPTJNI_LOG(logDEBUG) << "method = " << mid;
+  if (mid == 0) {
+    INTERRUPTJNI_LOG(logERROR) << "Error getting java method ID";
+    assert(false);
+    return;
+  }
+
+  InterruptJNI* intr = new InterruptJNI;
+  intr->Start();
+  intr->SetFunc(env, handler, mid, param);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "InterruptThreadJNI Ptr = " << intr;
+
+  int32_t status = 0;
+  HAL_AttachInterruptHandler((HAL_InterruptHandle)interruptHandle, interruptHandler, intr,
+                         &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_InterruptJNI
+ * Method:    setInterruptUpSourceEdge
+ * Signature: (JZZ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_InterruptJNI_setInterruptUpSourceEdge(
+    JNIEnv* env, jclass, jint interruptHandle, jboolean risingEdge,
+    jboolean fallingEdge) {
+  INTERRUPTJNI_LOG(logDEBUG) << "Calling INTERRUPTJNI setInterruptUpSourceEdge";
+  INTERRUPTJNI_LOG(logDEBUG) << "Interrupt Handle = " << (HAL_InterruptHandle)interruptHandle;
+  INTERRUPTJNI_LOG(logDEBUG) << "Rising Edge = " << (bool)risingEdge;
+  INTERRUPTJNI_LOG(logDEBUG) << "Falling Edge = " << (bool)fallingEdge;
+
+  int32_t status = 0;
+  HAL_SetInterruptUpSourceEdge((HAL_InterruptHandle)interruptHandle, risingEdge, fallingEdge,
+                           &status);
+
+  INTERRUPTJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/JNIWrapper.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/JNIWrapper.cpp
new file mode 100644
index 0000000..bf3e717
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/JNIWrapper.cpp
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_JNIWrapper.h"
+
+#include "HAL/HAL.h"
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_JNIWrapper
+ * Method:    getPortWithModule
+ * Signature: (BB)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_JNIWrapper_getPortWithModule(
+    JNIEnv* env, jclass, jbyte module, jbyte channel) {
+  // FILE_LOG(logDEBUG) << "Calling JNIWrapper getPortWithModlue";
+  // FILE_LOG(logDEBUG) << "Module = " << (jint)module;
+  // FILE_LOG(logDEBUG) << "Channel = " << (jint)channel;
+  HAL_PortHandle port = HAL_GetPortWithModule(module, channel);
+  // FILE_LOG(logDEBUG) << "Port Handle = " << port;
+  return (jint)port;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_JNIWrapper
+ * Method:    getPort
+ * Signature: (B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_JNIWrapper_getPort(
+    JNIEnv* env, jclass, jbyte channel) {
+  // FILE_LOG(logDEBUG) << "Calling JNIWrapper getPortWithModlue";
+  // FILE_LOG(logDEBUG) << "Module = " << (jint)module;
+  // FILE_LOG(logDEBUG) << "Channel = " << (jint)channel;
+  HAL_PortHandle port = HAL_GetPort(channel);
+  // FILE_LOG(logDEBUG) << "Port Handle = " << port;
+  return (jint)port;
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/NotifierJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/NotifierJNI.cpp
new file mode 100644
index 0000000..b55bddc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/NotifierJNI.cpp
@@ -0,0 +1,147 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Notifier.h"
+#include <assert.h>
+#include <jni.h>
+#include <stdio.h>
+#include "HALUtil.h"
+#include "HAL/cpp/Log.h"
+#include "edu_wpi_first_wpilibj_hal_NotifierJNI.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel notifierJNILogLevel = logWARNING;
+
+#define NOTIFIERJNI_LOG(level)     \
+  if (level > notifierJNILogLevel) \
+    ;                              \
+  else                             \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_NotifierJNI
+ * Method:    initializeNotifier
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_NotifierJNI_initializeNotifier(
+    JNIEnv *env, jclass) {
+  NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI initializeNotifier";
+
+  int32_t status = 0;
+  HAL_NotifierHandle notifierHandle = HAL_InitializeNotifier(&status);
+
+  NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
+  NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
+
+  if (notifierHandle <= 0 || !CheckStatusForceThrow(env, status)) {
+    return 0; // something went wrong in HAL
+  }
+
+  return (jint)notifierHandle;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_NotifierJNI
+ * Method:    stopNotifier
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_NotifierJNI_stopNotifier(
+    JNIEnv *env, jclass cls, jint notifierHandle) {
+  NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI stopNotifier";
+
+  NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
+
+  int32_t status = 0;
+  HAL_StopNotifier((HAL_NotifierHandle)notifierHandle, &status);
+  NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_NotifierJNI
+ * Method:    cleanNotifier
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cleanNotifier(
+    JNIEnv *env, jclass, jint notifierHandle) {
+  NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI cleanNotifier";
+
+  NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
+
+  int32_t status = 0;
+  HAL_CleanNotifier((HAL_NotifierHandle)notifierHandle, &status);
+  NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_NotifierJNI
+ * Method:    updateNotifierAlarm
+ * Signature: (IJ)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_NotifierJNI_updateNotifierAlarm(
+    JNIEnv *env, jclass cls, jint notifierHandle, jlong triggerTime) {
+  NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI updateNotifierAlarm";
+
+  NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
+
+  NOTIFIERJNI_LOG(logDEBUG) << "triggerTime = " << triggerTime;
+
+  int32_t status = 0;
+  HAL_UpdateNotifierAlarm((HAL_NotifierHandle)notifierHandle, (uint64_t)triggerTime, &status);
+  NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_NotifierJNI
+ * Method:    cancelNotifierAlarm
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_NotifierJNI_cancelNotifierAlarm(
+    JNIEnv *env, jclass cls, jint notifierHandle) {
+  NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI cancelNotifierAlarm";
+
+  NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
+
+  int32_t status = 0;
+  HAL_CancelNotifierAlarm((HAL_NotifierHandle)notifierHandle, &status);
+  NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_NotifierJNI
+ * Method:    waitForNotifierAlarm
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL
+Java_edu_wpi_first_wpilibj_hal_NotifierJNI_waitForNotifierAlarm(
+    JNIEnv *env, jclass cls, jint notifierHandle) {
+  NOTIFIERJNI_LOG(logDEBUG) << "Calling NOTIFIERJNI waitForNotifierAlarm";
+
+  NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
+
+  int32_t status = 0;
+  uint64_t time =
+      HAL_WaitForNotifierAlarm((HAL_NotifierHandle)notifierHandle, &status);
+  NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;
+  NOTIFIERJNI_LOG(logDEBUG) << "Time = " << time;
+  CheckStatus(env, status);
+
+  return (jlong)time;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/OSSerialPortJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/OSSerialPortJNI.cpp
new file mode 100644
index 0000000..375e5bc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/OSSerialPortJNI.cpp
@@ -0,0 +1,322 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_OSSerialPortJNI.h"
+
+#include "HAL/OSSerialPort.h"
+#include "HALUtil.h"
+#include "support/jni_util.h"
+
+using namespace frc;
+using namespace wpi::java;
+
+// set the logging level
+TLogLevel osserialJNILogLevel = logWARNING;
+
+#define SERIALJNI_LOG(level)       \
+  if (level > osserialJNILogLevel) \
+    ;                              \
+  else                             \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialInitializePort
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialInitializePort(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Calling Serial Initialize";
+  SERIALJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  int32_t status = 0;
+  HAL_InitializeOSSerialPort(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatusForceThrow(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetBaudRate
+ * Signature: (BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetBaudRate(
+    JNIEnv* env, jclass, jbyte port, jint rate) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Baud Rate";
+  SERIALJNI_LOG(logDEBUG) << "Baud: " << rate;
+  int32_t status = 0;
+  HAL_SetOSSerialBaudRate(static_cast<HAL_SerialPort>(port), rate, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetDataBits
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetDataBits(
+    JNIEnv* env, jclass, jbyte port, jbyte bits) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Data Bits";
+  SERIALJNI_LOG(logDEBUG) << "Data Bits: " << bits;
+  int32_t status = 0;
+  HAL_SetOSSerialDataBits(static_cast<HAL_SerialPort>(port), bits, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetParity
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetParity(
+    JNIEnv* env, jclass, jbyte port, jbyte parity) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Parity";
+  SERIALJNI_LOG(logDEBUG) << "Parity: " << parity;
+  int32_t status = 0;
+  HAL_SetOSSerialParity(static_cast<HAL_SerialPort>(port), parity, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetStopBits
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetStopBits(
+    JNIEnv* env, jclass, jbyte port, jbyte bits) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Stop Bits";
+  SERIALJNI_LOG(logDEBUG) << "Stop Bits: " << bits;
+  int32_t status = 0;
+  HAL_SetOSSerialStopBits(static_cast<HAL_SerialPort>(port), bits, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetWriteMode
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteMode(
+    JNIEnv* env, jclass, jbyte port, jbyte mode) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Mode";
+  SERIALJNI_LOG(logDEBUG) << "Write mode: " << mode;
+  int32_t status = 0;
+  HAL_SetOSSerialWriteMode(static_cast<HAL_SerialPort>(port), mode, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetFlowControl
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetFlowControl(
+    JNIEnv* env, jclass, jbyte port, jbyte flow) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Flow Control";
+  SERIALJNI_LOG(logDEBUG) << "Flow Control: " << flow;
+  int32_t status = 0;
+  HAL_SetOSSerialFlowControl(static_cast<HAL_SerialPort>(port), flow, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetTimeout
+ * Signature: (BD)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetTimeout(
+    JNIEnv* env, jclass, jbyte port, jdouble timeout) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Timeout";
+  SERIALJNI_LOG(logDEBUG) << "Timeout: " << timeout;
+  int32_t status = 0;
+  HAL_SetOSSerialTimeout(static_cast<HAL_SerialPort>(port), timeout, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialEnableTermination
+ * Signature: (BC)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialEnableTermination(
+    JNIEnv* env, jclass, jbyte port, jchar terminator) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Enable Termination";
+  SERIALJNI_LOG(logDEBUG) << "Terminator: " << terminator;
+  int32_t status = 0;
+  HAL_EnableOSSerialTermination(static_cast<HAL_SerialPort>(port), terminator, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialDisableTermination
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialDisableTermination(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Disable termination";
+  int32_t status = 0;
+  HAL_DisableOSSerialTermination(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetReadBufferSize
+ * Signature: (BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetReadBufferSize(
+    JNIEnv* env, jclass, jbyte port, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Read Buffer Size";
+  SERIALJNI_LOG(logDEBUG) << "Size: " << size;
+  int32_t status = 0;
+  HAL_SetOSSerialReadBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialSetWriteBufferSize
+ * Signature: (BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialSetWriteBufferSize(
+    JNIEnv* env, jclass, jbyte port, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Buffer Size";
+  SERIALJNI_LOG(logDEBUG) << "Size: " << size;
+  int32_t status = 0;
+  HAL_SetOSSerialWriteBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialGetBytesReceived
+ * Signature: (B)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialGetBytesReceived(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Get Bytes Received";
+  int32_t status = 0;
+  jint retVal = HAL_GetOSSerialBytesReceived(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialRead
+ * Signature: (B[BI)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialRead(
+    JNIEnv* env, jclass, jbyte port, jbyteArray dataReceived, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Read";
+  llvm::SmallVector<char, 128> recvBuf;
+  recvBuf.resize(size);
+  int32_t status = 0;
+  jint retVal = HAL_ReadOSSerial(static_cast<HAL_SerialPort>(port), recvBuf.data(), 
+                                 size, &status);
+  env->SetByteArrayRegion(dataReceived, 0, size,
+                          reinterpret_cast<const jbyte *>(recvBuf.data()));
+  SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialWrite
+ * Signature: (B[BI)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialWrite(
+    JNIEnv* env, jclass, jbyte port, jbyteArray dataToSend, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Write";
+  int32_t status = 0;
+  jint retVal =
+      HAL_WriteOSSerial(static_cast<HAL_SerialPort>(port),
+                        reinterpret_cast<const char *>(
+                            JByteArrayRef(env, dataToSend).array().data()),
+                        size, &status);
+  SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialFlush
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialFlush(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Flush";
+  int32_t status = 0;
+  HAL_FlushOSSerial(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialClear
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClear(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Clear";
+  int32_t status = 0;
+  HAL_ClearOSSerial(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_OSSerialPortJNI
+ * Method:    serialClose
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_OSSerialPortJNI_serialClose(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Close";
+  int32_t status = 0;
+  HAL_CloseOSSerial(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PDPJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PDPJNI.cpp
new file mode 100644
index 0000000..54ea857
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PDPJNI.cpp
@@ -0,0 +1,158 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/PDP.h"
+#include "HAL/Ports.h"
+#include "HALUtil.h"
+#include "edu_wpi_first_wpilibj_hal_PDPJNI.h"
+
+using namespace frc;
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    getPDPTemperature
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_initializePDP(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  HAL_InitializePDP(module, &status);
+  CheckStatusRange(env, status, 0, HAL_GetNumPDPModules(), module);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    checkPDPChannel
+ * Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPChannel(
+    JNIEnv *env, jclass, jint channel) {
+  return HAL_CheckPDPChannel(channel);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    checkPDPModule
+ * Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_checkPDPModule(
+    JNIEnv *env, jclass, jint module) {
+  return HAL_CheckPDPModule(module);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    getPDPTemperature
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTemperature(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  double temperature = HAL_GetPDPTemperature(module, &status);
+  CheckStatus(env, status, false);
+  return temperature;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    getPDPVoltage
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPVoltage(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  double voltage = HAL_GetPDPVoltage(module, &status);
+  CheckStatus(env, status, false);
+  return voltage;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    getPDPChannelCurrent
+ * Signature: (BI)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPChannelCurrent(
+    JNIEnv *env, jclass, jbyte channel, jint module) {
+  int32_t status = 0;
+  double current = HAL_GetPDPChannelCurrent(module, channel, &status);
+  CheckStatus(env, status, false);
+  return current;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    getPDPTotalCurrent
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalCurrent(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  double current = HAL_GetPDPTotalCurrent(module, &status);
+  CheckStatus(env, status, false);
+  return current;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    getPDPTotalPower
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalPower(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  double power = HAL_GetPDPTotalPower(module, &status);
+  CheckStatus(env, status, false);
+  return power;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    resetPDPTotalEnergy
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_getPDPTotalEnergy(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  double energy = HAL_GetPDPTotalEnergy(module, &status);
+  CheckStatus(env, status, false);
+  return energy;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    resetPDPTotalEnergy
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_resetPDPTotalEnergy(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  HAL_ResetPDPTotalEnergy(module, &status);
+  CheckStatus(env, status, false);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PDPJNI
+ * Method:    clearStickyFaults
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_PDPJNI_clearPDPStickyFaults(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  HAL_ClearPDPStickyFaults(module, &status);
+  CheckStatus(env, status, false);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PWMJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PWMJNI.cpp
new file mode 100644
index 0000000..3869176
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PWMJNI.cpp
@@ -0,0 +1,300 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_PWMJNI.h"
+
+#include "HAL/DIO.h"
+#include "HAL/PWM.h"
+#include "HAL/Ports.h"
+#include "HALUtil.h"
+#include "HAL/handles/HandlesInternal.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel pwmJNILogLevel = logWARNING;
+
+#define PWMJNI_LOG(level)     \
+  if (level > pwmJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    initializePWMPort
+ * Signature: (I)I;
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PWMJNI_initializePWMPort(
+    JNIEnv *env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "Calling PWMJNI initializePWMPort";
+  PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
+  int32_t status = 0;
+  auto pwm = HAL_InitializePWMPort((HAL_PortHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << pwm;
+  CheckStatusRange(env, status, 0, HAL_GetNumPWMChannels(),
+                   hal::getPortHandleChannel((HAL_PortHandle)id));
+  return (jint)pwm;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    checkPWMChannel
+ * Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_checkPWMChannel(
+    JNIEnv *env, jclass, jint channel) {
+  PWMJNI_LOG(logDEBUG) << "Calling PWMJNI checkPWMChannel";
+  PWMJNI_LOG(logDEBUG) << "Channel = " << channel;
+  return HAL_CheckPWMChannel(channel);
+}
+
+/*
+* Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+* Method:    freeDIOPort
+* Signature: (I)V;
+*/
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_freePWMPort(
+    JNIEnv *env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "Calling PWMJNI freePWMPort";
+  PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  HAL_FreePWMPort((HAL_DigitalHandle)id, &status);
+  CheckStatus(env, status);
+}
+
+/*
+* Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+* Method:    setPWMConfigRaw
+* Signature: (IIIIII)V;
+*/
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMConfigRaw(
+    JNIEnv *env, jclass, jint id, jint maxPwm, jint deadbandMaxPwm, 
+    jint centerPwm, jint deadbandMinPwm, jint minPwm) {
+  PWMJNI_LOG(logDEBUG) << "Calling PWMJNI setPWMConfigRaw";
+  PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  HAL_SetPWMConfigRaw((HAL_DigitalHandle)id, maxPwm, deadbandMaxPwm, centerPwm, 
+               deadbandMinPwm, minPwm, &status);
+  CheckStatus(env, status);
+}
+
+/*
+* Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+* Method:    setPWMConfig
+* Signature: (IDDDDD)V;
+*/
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMConfig(
+    JNIEnv *env, jclass, jint id, jdouble maxPwm, jdouble deadbandMaxPwm, 
+    jdouble centerPwm, jdouble deadbandMinPwm, jdouble minPwm) {
+  PWMJNI_LOG(logDEBUG) << "Calling PWMJNI setPWMConfig";
+  PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  HAL_SetPWMConfig((HAL_DigitalHandle)id, maxPwm, deadbandMaxPwm, centerPwm, 
+               deadbandMinPwm, minPwm, &status);
+  CheckStatus(env, status);
+}
+
+/*
+* Class:     edu_wpi_first_wpilibj_hal_DIOJNI
+* Method:    getPWMConfigRaw
+* Signature: (I)Ledu/wpi/first/wpilibj/PWMConfigDataResult;
+*/
+JNIEXPORT jobject JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMConfigRaw(
+    JNIEnv *env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "Calling PWMJNI getPWMConfigRaw";
+  PWMJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  int32_t maxPwm = 0;
+  int32_t deadbandMaxPwm = 0;
+  int32_t centerPwm = 0;
+  int32_t deadbandMinPwm = 0;
+  int32_t minPwm = 0;
+  HAL_GetPWMConfigRaw((HAL_DigitalHandle)id, &maxPwm, &deadbandMaxPwm, &centerPwm, 
+               &deadbandMinPwm, &minPwm, &status);
+  CheckStatus(env, status);
+  return CreatePWMConfigDataResult(env, maxPwm, deadbandMaxPwm, centerPwm,
+                                   deadbandMinPwm, minPwm);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    setPWMEliminateDeadband
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMEliminateDeadband(
+    JNIEnv* env, jclass, jint id, jboolean value) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  HAL_SetPWMEliminateDeadband((HAL_DigitalHandle)id, value, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    getPWMEliminateDeadband
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMEliminateDeadband(
+    JNIEnv* env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  auto val = HAL_GetPWMEliminateDeadband((HAL_DigitalHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return (jboolean)val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    setPWMRaw
+ * Signature: (IS)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMRaw(
+    JNIEnv* env, jclass, jint id, jshort value) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  PWMJNI_LOG(logDEBUG) << "PWM Value = " << value;
+  int32_t status = 0;
+  HAL_SetPWMRaw((HAL_DigitalHandle)id, value, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    setPWMSpeed
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMSpeed(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  PWMJNI_LOG(logDEBUG) << "PWM Value = " << value;
+  int32_t status = 0;
+  HAL_SetPWMSpeed((HAL_DigitalHandle)id, value, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    setPWMPosition
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPosition(
+    JNIEnv* env, jclass, jint id, jdouble value) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  PWMJNI_LOG(logDEBUG) << "PWM Value = " << value;
+  int32_t status = 0;
+  HAL_SetPWMPosition((HAL_DigitalHandle)id, value, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    getPWMRaw
+ * Signature: (I)S
+ */
+JNIEXPORT jshort JNICALL
+Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMRaw(
+    JNIEnv* env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  jshort returnValue = HAL_GetPWMRaw((HAL_DigitalHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  PWMJNI_LOG(logDEBUG) << "Value = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    getPWMSpeed
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMSpeed(
+    JNIEnv* env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetPWMSpeed((HAL_DigitalHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  PWMJNI_LOG(logDEBUG) << "Value = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    getPWMPosition
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PWMJNI_getPWMPosition(
+    JNIEnv* env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  jdouble returnValue = HAL_GetPWMPosition((HAL_DigitalHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  PWMJNI_LOG(logDEBUG) << "Value = " << returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    setPWMDisabled
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMDisabled(
+    JNIEnv* env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  HAL_SetPWMDisabled((HAL_DigitalHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    latchPWMZero
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_latchPWMZero(
+    JNIEnv* env, jclass, jint id) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  int32_t status = 0;
+  HAL_LatchPWMZero((HAL_DigitalHandle)id, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PWMJNI
+ * Method:    setPWMPeriodScale
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_PWMJNI_setPWMPeriodScale(
+    JNIEnv* env, jclass, jint id, jint value) {
+  PWMJNI_LOG(logDEBUG) << "PWM Handle = " << (HAL_DigitalHandle)id;
+  PWMJNI_LOG(logDEBUG) << "PeriodScale Value = " << value;
+  int32_t status = 0;
+  HAL_SetPWMPeriodScale((HAL_DigitalHandle)id, value, &status);
+  PWMJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PortsJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PortsJNI.cpp
new file mode 100644
index 0000000..89c63a3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PortsJNI.cpp
@@ -0,0 +1,297 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_PortsJNI.h"
+
+#include "HAL/Ports.h"
+#include "HALUtil.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel portsJNILogLevel = logWARNING;
+
+#define PORTSJNI_LOG(level)     \
+  if (level > portsJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumAccumulators
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAccumulators(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAccumulators";
+  jint value = HAL_GetNumAccumulators();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumAnalogTriggers
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogTriggers(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAnalogTriggers";
+  jint value = HAL_GetNumAnalogTriggers();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumAnalogInputs
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogInputs(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAnalogInputs";
+  jint value = HAL_GetNumAnalogInputs();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumAnalogOutputs
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumAnalogOutputs(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumAnalogOutputs";
+  jint value = HAL_GetNumAnalogOutputs();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumCounters
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumCounters(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumCounters";
+  jint value = HAL_GetNumCounters();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumDigitalHeaders
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalHeaders(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumDigitalHeaders";
+  jint value = HAL_GetNumDigitalHeaders();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumPWMHeaders
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPWMHeaders(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPWMHeaders";
+  jint value = HAL_GetNumPWMHeaders();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumDigitalChannels
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalChannels(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumDigitalChannels";
+  jint value = HAL_GetNumDigitalChannels();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumPWMChannels
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPWMChannels(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPWMChannels";
+  jint value = HAL_GetNumPWMChannels();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumDigitalPWMOutputs
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumDigitalPWMOutputs(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumDigitalPWMOutputs";
+  jint value = HAL_GetNumDigitalPWMOutputs();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumEncoders
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumEncoders(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumEncoders";
+  jint value = HAL_GetNumEncoders();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumInterrupts
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumInterrupts(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumInterrupts";
+  jint value = HAL_GetNumInterrupts();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumRelayChannels
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumRelayChannels(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumRelayChannels";
+  jint value = HAL_GetNumRelayChannels();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumRelayHeaders
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumRelayHeaders(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumRelayHeaders";
+  jint value = HAL_GetNumRelayHeaders();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumPCMModules
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPCMModules(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPCMModules";
+  jint value = HAL_GetNumPCMModules();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumSolenoidChannels
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumSolenoidChannels(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumSolenoidChannels";
+  jint value = HAL_GetNumSolenoidChannels();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumPDPModules
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPDPModules(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPDPModules";
+  jint value = HAL_GetNumPDPModules();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PortsJNI
+ * Method:    getNumPDPChannels
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PortsJNI_getNumPDPChannels(
+    JNIEnv *env, jclass) {
+  PORTSJNI_LOG(logDEBUG) << "Calling PortsJNI getNumPDPChannels";
+  jint value = HAL_GetNumPDPChannels();
+  PORTSJNI_LOG(logDEBUG) << "Value = " << value;
+  return value;
+}
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PowerJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PowerJNI.cpp
new file mode 100644
index 0000000..85f6c16
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/PowerJNI.cpp
@@ -0,0 +1,202 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "HAL/Power.h"
+#include <jni.h>
+#include "HALUtil.h"
+#include "edu_wpi_first_wpilibj_hal_PowerJNI.h"
+
+using namespace frc;
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getVinVoltage
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinVoltage(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetVinVoltage(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getVinCurrent
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getVinCurrent(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetVinCurrent(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserVoltage6V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage6V(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetUserVoltage6V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserCurrent6V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent6V(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetUserCurrent6V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserActive6V
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive6V(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  bool val = HAL_GetUserActive6V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserCurrentFaults6V
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults6V(
+    JNIEnv* env, jclass) {
+  int32_t status = 0;
+  int32_t val = HAL_GetUserCurrentFaults6V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserVoltage5V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage5V(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetUserVoltage5V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserCurrent5V
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent5V(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetUserCurrent5V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserActive5V
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive5V(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  bool val = HAL_GetUserActive5V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserCurrentFaults5V
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults5V(
+    JNIEnv* env, jclass) {
+  int32_t status = 0;
+  int32_t val = HAL_GetUserCurrentFaults5V(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserVoltage3V3
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserVoltage3V3(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetUserVoltage3V3(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserCurrent3V3
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrent3V3(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  double val = HAL_GetUserCurrent3V3(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserActive3V3
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserActive3V3(JNIEnv* env, jclass) {
+  int32_t status = 0;
+  bool val = HAL_GetUserActive3V3(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_PowerJNI
+ * Method:    getUserCurrentFaults3V3
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_PowerJNI_getUserCurrentFaults3V3(
+    JNIEnv* env, jclass) {
+  int32_t status = 0;
+  int32_t val = HAL_GetUserCurrentFaults3V3(&status);
+  CheckStatus(env, status);
+  return val;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/RelayJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/RelayJNI.cpp
new file mode 100644
index 0000000..7522f97
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/RelayJNI.cpp
@@ -0,0 +1,109 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_RelayJNI.h"
+
+#include "HAL/Relay.h"
+#include "HAL/Ports.h"
+#include "HALUtil.h"
+#include "HAL/handles/HandlesInternal.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel relayJNILogLevel = logWARNING;
+
+#define RELAYJNI_LOG(level)     \
+  if (level > relayJNILogLevel) \
+    ;                           \
+  else                          \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_RelayJNI
+ * Method:    initializeRelayPort
+ * Signature: (IZ)I;
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_initializeRelayPort(
+    JNIEnv* env, jclass, jint id, jboolean fwd) {
+  RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI initializeRelayPort";
+  RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
+  RELAYJNI_LOG(logDEBUG) << "Forward = " << (jint)fwd;
+  int32_t status = 0;
+  HAL_RelayHandle handle = HAL_InitializeRelayPort((HAL_PortHandle)id, (uint8_t) fwd, &status);
+  RELAYJNI_LOG(logDEBUG) << "Status = " << status;
+  RELAYJNI_LOG(logDEBUG) << "Relay Handle = " << handle;
+  CheckStatusRange(env, status, 0, HAL_GetNumRelayChannels(),
+                   hal::getPortHandleChannel((HAL_PortHandle)id));
+  return (jint) handle;
+}
+
+/*
+* Class:     edu_wpi_first_wpilibj_hal_RelayJNI
+* Method:    freeRelayPort
+* Signature: (I)V;
+*/
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_freeRelayPort(
+    JNIEnv *env, jclass, jint id) {
+  RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI freeRelayPort";
+  RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_RelayHandle)id;
+  HAL_FreeRelayPort((HAL_RelayHandle)id);
+}
+
+/*
+* Class:     edu_wpi_first_wpilibj_hal_RelayJNI
+* Method:    checkRelayChannel
+* Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_checkRelayChannel(
+    JNIEnv *env, jclass, jint channel) {
+  RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI checkRelayChannel";
+  RELAYJNI_LOG(logDEBUG) << "Channel = " << channel;
+  return (jboolean)HAL_CheckRelayChannel((uint8_t) channel);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_RelayJNI
+ * Method:    setRelay
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_RelayJNI_setRelay(
+    JNIEnv* env, jclass, jint id, jboolean value) {
+  RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI setRelay";
+  RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_RelayHandle)id;
+  RELAYJNI_LOG(logDEBUG) << "Flag = " << (jint)value;
+  int32_t status = 0;
+  HAL_SetRelay((HAL_RelayHandle)id, value, &status);
+  RELAYJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_RelayJNI
+ * Method:    getRelay
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_RelayJNI_getRelay(
+    JNIEnv* env, jclass, jint id) {
+  RELAYJNI_LOG(logDEBUG) << "Calling RELAYJNI getRelay";
+  RELAYJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_RelayHandle)id;
+  int32_t status = 0;
+  jboolean returnValue = HAL_GetRelay((HAL_RelayHandle)id, &status);
+  RELAYJNI_LOG(logDEBUG) << "Status = " << status;
+  RELAYJNI_LOG(logDEBUG) << "getRelayResult = " << (jint)returnValue;
+  CheckStatus(env, status);
+  return returnValue;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SPIJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SPIJNI.cpp
new file mode 100644
index 0000000..e9d21e4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SPIJNI.cpp
@@ -0,0 +1,438 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_SPIJNI.h"
+
+#include "HAL/SPI.h"
+#include "HALUtil.h"
+#include "support/jni_util.h"
+
+using namespace frc;
+using namespace wpi::java;
+
+// set the logging level
+TLogLevel spiJNILogLevel = logWARNING;
+
+#define SPIJNI_LOG(level)     \
+  if (level > spiJNILogLevel) \
+    ;                         \
+  else                        \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiInitialize
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitialize(
+    JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiInitialize";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  int32_t status = 0;
+  HAL_InitializeSPI(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatusForceThrow(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiTransaction
+ * Signature: (ILjava/nio/ByteBuffer;Ljava/nio/ByteBuffer;B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransaction(
+    JNIEnv *env, jclass, jint port, jobject dataToSend, jobject dataReceived,
+    jbyte size) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiTransaction";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  uint8_t *dataToSendPtr = nullptr;
+  if (dataToSend != 0) {
+    dataToSendPtr = (uint8_t *)env->GetDirectBufferAddress(dataToSend);
+  }
+  uint8_t *dataReceivedPtr =
+      (uint8_t *)env->GetDirectBufferAddress(dataReceived);
+  SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
+  SPIJNI_LOG(logDEBUG) << "DataToSendPtr = " << dataToSendPtr;
+  SPIJNI_LOG(logDEBUG) << "DataReceivedPtr = " << dataReceivedPtr;
+  jint retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), dataToSendPtr, dataReceivedPtr, size);
+  SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiTransactionB
+ * Signature: (I[B[BB)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiTransactionB(
+    JNIEnv *env, jclass, jint port, jbyteArray dataToSend, jbyteArray dataReceived,
+    jbyte size) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiTransactionB";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
+  llvm::SmallVector<uint8_t, 128> recvBuf;
+  recvBuf.resize(size);
+  jint retVal =
+      HAL_TransactionSPI(static_cast<HAL_SPIPort>(port),
+                         reinterpret_cast<const uint8_t *>(
+                             JByteArrayRef(env, dataToSend).array().data()),
+                         recvBuf.data(), size);
+  env->SetByteArrayRegion(dataReceived, 0, size,
+                          reinterpret_cast<const jbyte *>(recvBuf.data()));
+  SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiWrite
+ * Signature: (ILjava/nio/ByteBuffer;B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWrite(
+    JNIEnv *env, jclass, jint port, jobject dataToSend, jbyte size) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiWrite";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  uint8_t *dataToSendPtr = nullptr;
+  if (dataToSend != 0) {
+    dataToSendPtr = (uint8_t *)env->GetDirectBufferAddress(dataToSend);
+  }
+  SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
+  SPIJNI_LOG(logDEBUG) << "DataToSendPtr = " << dataToSendPtr;
+  jint retVal = HAL_WriteSPI(static_cast<HAL_SPIPort>(port), dataToSendPtr, size);
+  SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiWriteB
+ * Signature: (I[BB)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiWriteB(
+    JNIEnv *env, jclass, jint port, jbyteArray dataToSend, jbyte size) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiWriteB";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
+  jint retVal = HAL_WriteSPI(static_cast<HAL_SPIPort>(port),
+                             reinterpret_cast<const uint8_t *>(
+                                 JByteArrayRef(env, dataToSend).array().data()),
+                             size);
+  SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiRead
+ * Signature: (IZLjava/nio/ByteBuffer;B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiRead(
+    JNIEnv *env, jclass, jint port, jboolean initiate, jobject dataReceived, jbyte size) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiRead";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  SPIJNI_LOG(logDEBUG) << "Initiate = " << (jboolean)initiate;
+  uint8_t *dataReceivedPtr =
+      (uint8_t *)env->GetDirectBufferAddress(dataReceived);
+  SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
+  SPIJNI_LOG(logDEBUG) << "DataReceivedPtr = " << dataReceivedPtr;
+  jint retVal;
+  if (initiate) {
+    llvm::SmallVector<uint8_t, 128> sendBuf;
+    sendBuf.resize(size);
+    retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), sendBuf.data(), dataReceivedPtr, size);
+  } else {
+    retVal = HAL_ReadSPI(static_cast<HAL_SPIPort>(port), (uint8_t *)dataReceivedPtr, size);
+  }
+  SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiReadB
+ * Signature: (IZ[BB)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadB(
+    JNIEnv *env, jclass, jint port, jboolean initiate, jbyteArray dataReceived, jbyte size) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiReadB";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  SPIJNI_LOG(logDEBUG) << "Initiate = " << (jboolean)initiate;
+  SPIJNI_LOG(logDEBUG) << "Size = " << (jint)size;
+  jint retVal;
+  llvm::SmallVector<uint8_t, 128> recvBuf;
+  recvBuf.resize(size);
+  if (initiate) {
+    llvm::SmallVector<uint8_t, 128> sendBuf;
+    sendBuf.resize(size);
+    retVal = HAL_TransactionSPI(static_cast<HAL_SPIPort>(port), sendBuf.data(), recvBuf.data(), size);
+  } else {
+    retVal = HAL_ReadSPI(static_cast<HAL_SPIPort>(port), recvBuf.data(), size);
+  }
+  env->SetByteArrayRegion(dataReceived, 0, size,
+                          reinterpret_cast<const jbyte *>(recvBuf.data()));
+  SPIJNI_LOG(logDEBUG) << "ReturnValue = " << (jint)retVal;
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiClose
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiClose(JNIEnv *, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiClose";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  HAL_CloseSPI(static_cast<HAL_SPIPort>(port));
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiSetSpeed
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetSpeed(
+    JNIEnv *, jclass, jint port, jint speed) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetSpeed";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  SPIJNI_LOG(logDEBUG) << "Speed = " << (jint)speed;
+  HAL_SetSPISpeed(static_cast<HAL_SPIPort>(port), speed);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiSetOpts
+ * Signature: (IIII)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetOpts(
+    JNIEnv *, jclass, jint port, jint msb_first, jint sample_on_trailing,
+    jint clk_idle_high) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetOpts";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  SPIJNI_LOG(logDEBUG) << "msb_first = " << msb_first;
+  SPIJNI_LOG(logDEBUG) << "sample_on_trailing = " << sample_on_trailing;
+  SPIJNI_LOG(logDEBUG) << "clk_idle_high = " << clk_idle_high;
+  HAL_SetSPIOpts(static_cast<HAL_SPIPort>(port), msb_first, sample_on_trailing, clk_idle_high);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiSetChipSelectActiveHigh
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveHigh(
+    JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetCSActiveHigh";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  int32_t status = 0;
+  HAL_SetSPIChipSelectActiveHigh(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiSetChipSelectActiveLow
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetChipSelectActiveLow(
+    JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetCSActiveLow";
+  SPIJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  int32_t status = 0;
+  HAL_SetSPIChipSelectActiveLow(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiInitAuto
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiInitAuto
+  (JNIEnv *env, jclass, jint port, jint bufferSize) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiInitAuto";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  SPIJNI_LOG(logDEBUG) << "BufferSize = " << bufferSize;
+  int32_t status = 0;
+  HAL_InitSPIAuto(static_cast<HAL_SPIPort>(port), bufferSize, &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiFreeAuto
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiFreeAuto
+  (JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiFreeAuto";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  int32_t status = 0;
+  HAL_FreeSPIAuto(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiStartAutoRate
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoRate
+  (JNIEnv *env, jclass, jint port, jdouble period) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiStartAutoRate";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  SPIJNI_LOG(logDEBUG) << "Period = " << period;
+  int32_t status = 0;
+  HAL_StartSPIAutoRate(static_cast<HAL_SPIPort>(port), period, &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiStartAutoTrigger
+ * Signature: (IIIZZ)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStartAutoTrigger
+  (JNIEnv *env, jclass, jint port, jint digitalSourceHandle, jint analogTriggerType, jboolean triggerRising, jboolean triggerFalling) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiStartAutoTrigger";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  SPIJNI_LOG(logDEBUG) << "DigitalSourceHandle = " << digitalSourceHandle;
+  SPIJNI_LOG(logDEBUG) << "AnalogTriggerType = " << analogTriggerType;
+  SPIJNI_LOG(logDEBUG) << "TriggerRising = " << (jint)triggerRising;
+  SPIJNI_LOG(logDEBUG) << "TriggerFalling = " << (jint)triggerFalling;
+  int32_t status = 0;
+  HAL_StartSPIAutoTrigger(static_cast<HAL_SPIPort>(port), digitalSourceHandle,
+      static_cast<HAL_AnalogTriggerType>(analogTriggerType), triggerRising,
+      triggerFalling, &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiStopAuto
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiStopAuto
+  (JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiStopAuto";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  int32_t status = 0;
+  HAL_StopSPIAuto(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiSetAutoTransmitData
+ * Signature: (I[BI)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiSetAutoTransmitData
+  (JNIEnv *env, jclass, jint port, jbyteArray dataToSend, jint zeroSize) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiSetAutoTransmitData";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  SPIJNI_LOG(logDEBUG) << "ZeroSize = " << zeroSize;
+  JByteArrayRef jarr(env, dataToSend);
+  int32_t status = 0;
+  HAL_SetSPIAutoTransmitData(static_cast<HAL_SPIPort>(port),
+      reinterpret_cast<const uint8_t*>(jarr.array().data()),
+      jarr.array().size(), zeroSize, &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiForceAutoRead
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiForceAutoRead
+  (JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiForceAutoRead";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  int32_t status = 0;
+  HAL_ForceSPIAutoRead(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiReadAutoReceivedData
+ * Signature: (ILjava/nio/ByteBuffer;ID)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceivedData__ILjava_nio_ByteBuffer_2ID
+  (JNIEnv *env, jclass, jint port, jobject buffer, jint numToRead, jdouble timeout) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiReadAutoReceivedData";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  SPIJNI_LOG(logDEBUG) << "NumToRead = " << numToRead;
+  SPIJNI_LOG(logDEBUG) << "Timeout = " << timeout;
+  uint8_t *recvBuf = (uint8_t *)env->GetDirectBufferAddress(buffer);
+  int32_t status = 0;
+  jint retval = HAL_ReadSPIAutoReceivedData(static_cast<HAL_SPIPort>(port), recvBuf, numToRead, timeout, &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  SPIJNI_LOG(logDEBUG) << "Return = " << retval;
+  CheckStatus(env, status);
+  return retval;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiReadAutoReceivedData
+ * Signature: (I[BID)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiReadAutoReceivedData__I_3BID
+  (JNIEnv *env, jclass, jint port, jbyteArray buffer, jint numToRead, jdouble timeout) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiReadAutoReceivedData";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  SPIJNI_LOG(logDEBUG) << "NumToRead = " << numToRead;
+  SPIJNI_LOG(logDEBUG) << "Timeout = " << timeout;
+  llvm::SmallVector<uint8_t, 128> recvBuf;
+  recvBuf.resize(numToRead);
+  int32_t status = 0;
+  jint retval = HAL_ReadSPIAutoReceivedData(static_cast<HAL_SPIPort>(port), recvBuf.data(), numToRead, timeout, &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  SPIJNI_LOG(logDEBUG) << "Return = " << retval;
+  if (!CheckStatus(env, status)) return retval;
+  if (numToRead > 0) {
+    env->SetByteArrayRegion(buffer, 0, numToRead,
+                            reinterpret_cast<const jbyte *>(recvBuf.data()));
+  }
+  return retval;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SPIJNI
+ * Method:    spiGetAutoDroppedCount
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SPIJNI_spiGetAutoDroppedCount
+  (JNIEnv *env, jclass, jint port) {
+  SPIJNI_LOG(logDEBUG) << "Calling SPIJNI spiGetAutoDroppedCount";
+  SPIJNI_LOG(logDEBUG) << "Port = " << port;
+  int32_t status = 0;
+  auto retval = HAL_GetSPIAutoDroppedCount(static_cast<HAL_SPIPort>(port), &status);
+  SPIJNI_LOG(logDEBUG) << "Status = " << status;
+  SPIJNI_LOG(logDEBUG) << "Return = " << retval;
+  CheckStatus(env, status);
+  return retval;
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SerialPortJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SerialPortJNI.cpp
new file mode 100644
index 0000000..2d72505
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SerialPortJNI.cpp
@@ -0,0 +1,322 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_SerialPortJNI.h"
+
+#include "HAL/SerialPort.h"
+#include "HALUtil.h"
+#include "support/jni_util.h"
+
+using namespace frc;
+using namespace wpi::java;
+
+// set the logging level
+TLogLevel serialJNILogLevel = logWARNING;
+
+#define SERIALJNI_LOG(level)     \
+  if (level > serialJNILogLevel) \
+    ;                            \
+  else                           \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialInitializePort
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialInitializePort(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Calling Serial Initialize";
+  SERIALJNI_LOG(logDEBUG) << "Port = " << (jint)port;
+  int32_t status = 0;
+  HAL_InitializeSerialPort(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatusForceThrow(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetBaudRate
+ * Signature: (BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetBaudRate(
+    JNIEnv* env, jclass, jbyte port, jint rate) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Baud Rate";
+  SERIALJNI_LOG(logDEBUG) << "Baud: " << rate;
+  int32_t status = 0;
+  HAL_SetSerialBaudRate(static_cast<HAL_SerialPort>(port), rate, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetDataBits
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetDataBits(
+    JNIEnv* env, jclass, jbyte port, jbyte bits) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Data Bits";
+  SERIALJNI_LOG(logDEBUG) << "Data Bits: " << bits;
+  int32_t status = 0;
+  HAL_SetSerialDataBits(static_cast<HAL_SerialPort>(port), bits, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetParity
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetParity(
+    JNIEnv* env, jclass, jbyte port, jbyte parity) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Parity";
+  SERIALJNI_LOG(logDEBUG) << "Parity: " << parity;
+  int32_t status = 0;
+  HAL_SetSerialParity(static_cast<HAL_SerialPort>(port), parity, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetStopBits
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetStopBits(
+    JNIEnv* env, jclass, jbyte port, jbyte bits) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Stop Bits";
+  SERIALJNI_LOG(logDEBUG) << "Stop Bits: " << bits;
+  int32_t status = 0;
+  HAL_SetSerialStopBits(static_cast<HAL_SerialPort>(port), bits, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetWriteMode
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteMode(
+    JNIEnv* env, jclass, jbyte port, jbyte mode) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Mode";
+  SERIALJNI_LOG(logDEBUG) << "Write mode: " << mode;
+  int32_t status = 0;
+  HAL_SetSerialWriteMode(static_cast<HAL_SerialPort>(port), mode, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetFlowControl
+ * Signature: (BB)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetFlowControl(
+    JNIEnv* env, jclass, jbyte port, jbyte flow) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Flow Control";
+  SERIALJNI_LOG(logDEBUG) << "Flow Control: " << flow;
+  int32_t status = 0;
+  HAL_SetSerialFlowControl(static_cast<HAL_SerialPort>(port), flow, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetTimeout
+ * Signature: (BD)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetTimeout(
+    JNIEnv* env, jclass, jbyte port, jdouble timeout) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Timeout";
+  SERIALJNI_LOG(logDEBUG) << "Timeout: " << timeout;
+  int32_t status = 0;
+  HAL_SetSerialTimeout(static_cast<HAL_SerialPort>(port), timeout, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialEnableTermination
+ * Signature: (BC)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialEnableTermination(
+    JNIEnv* env, jclass, jbyte port, jchar terminator) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Enable Termination";
+  SERIALJNI_LOG(logDEBUG) << "Terminator: " << terminator;
+  int32_t status = 0;
+  HAL_EnableSerialTermination(static_cast<HAL_SerialPort>(port), terminator, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialDisableTermination
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialDisableTermination(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Disable termination";
+  int32_t status = 0;
+  HAL_DisableSerialTermination(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetReadBufferSize
+ * Signature: (BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetReadBufferSize(
+    JNIEnv* env, jclass, jbyte port, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Read Buffer Size";
+  SERIALJNI_LOG(logDEBUG) << "Size: " << size;
+  int32_t status = 0;
+  HAL_SetSerialReadBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialSetWriteBufferSize
+ * Signature: (BI)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialSetWriteBufferSize(
+    JNIEnv* env, jclass, jbyte port, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Setting Serial Write Buffer Size";
+  SERIALJNI_LOG(logDEBUG) << "Size: " << size;
+  int32_t status = 0;
+  HAL_SetSerialWriteBufferSize(static_cast<HAL_SerialPort>(port), size, &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialGetBytesReceived
+ * Signature: (B)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialGetBytesReceived(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Get Bytes Received";
+  int32_t status = 0;
+  jint retVal = HAL_GetSerialBytesReceived(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialRead
+ * Signature: (B[BI)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialRead(
+    JNIEnv* env, jclass, jbyte port, jbyteArray dataReceived, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Read";
+  llvm::SmallVector<char, 128> recvBuf;
+  recvBuf.resize(size);
+  int32_t status = 0;
+  jint retVal = HAL_ReadSerial(static_cast<HAL_SerialPort>(port), recvBuf.data(), 
+                               size, &status);
+  env->SetByteArrayRegion(dataReceived, 0, size,
+                          reinterpret_cast<const jbyte *>(recvBuf.data()));
+  SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialWrite
+ * Signature: (B[BI)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialWrite(
+    JNIEnv* env, jclass, jbyte port, jbyteArray dataToSend, jint size) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Write";
+  int32_t status = 0;
+  jint retVal =
+      HAL_WriteSerial(static_cast<HAL_SerialPort>(port),
+                      reinterpret_cast<const char *>(
+                          JByteArrayRef(env, dataToSend).array().data()),
+                      size, &status);
+  SERIALJNI_LOG(logDEBUG) << "ReturnValue = " << retVal;
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+  return retVal;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialFlush
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialFlush(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Flush";
+  int32_t status = 0;
+  HAL_FlushSerial(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialClear
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClear(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Clear";
+  int32_t status = 0;
+  HAL_ClearSerial(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SerialPortJNI
+ * Method:    serialClose
+ * Signature: (B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SerialPortJNI_serialClose(
+    JNIEnv* env, jclass, jbyte port) {
+  SERIALJNI_LOG(logDEBUG) << "Serial Close";
+  int32_t status = 0;
+  HAL_CloseSerial(static_cast<HAL_SerialPort>(port), &status);
+  SERIALJNI_LOG(logDEBUG) << "Status = " << status;
+  CheckStatus(env, status);
+}
+
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SolenoidJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SolenoidJNI.cpp
new file mode 100644
index 0000000..63c805e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/SolenoidJNI.cpp
@@ -0,0 +1,226 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <jni.h>
+#include "HAL/Solenoid.h"
+#include "HAL/Ports.h"
+#include "HAL/handles/HandlesInternal.h"
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_SolenoidJNI.h"
+
+#include "HALUtil.h"
+
+using namespace frc;
+
+TLogLevel solenoidJNILogLevel = logERROR;
+
+#define SOLENOIDJNI_LOG(level)     \
+  if (level > solenoidJNILogLevel) \
+    ;                              \
+  else                             \
+  Log().Get(level)
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    initializeSolenoidPort
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_initializeSolenoidPort(
+    JNIEnv *env, jclass, jint id) {
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI initializeSolenoidPort";
+
+  SOLENOIDJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_PortHandle)id;
+
+  int32_t status = 0;
+  HAL_SolenoidHandle handle =
+      HAL_InitializeSolenoidPort((HAL_PortHandle)id, &status);
+
+  SOLENOIDJNI_LOG(logDEBUG) << "Status = " << status;
+  SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = " << handle;
+
+  // Use solenoid channels, as we have to pick one.
+  CheckStatusRange(env, status, 0, HAL_GetNumSolenoidChannels(),
+                   hal::getPortHandleChannel((HAL_PortHandle)id));
+  return (jint)handle;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    checkSolenoidChannel
+ * Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolenoidChannel(
+    JNIEnv *env, jclass, jint channel) {
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI checkSolenoidChannel";
+  SOLENOIDJNI_LOG(logDEBUG) << "Channel = " << channel;
+  return HAL_CheckSolenoidChannel(channel);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    checkSolenoidModule
+ * Signature: (I)Z;
+*/
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_checkSolenoidModule(
+    JNIEnv *env, jclass, jint module) {
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI checkSolenoidModule";
+  SOLENOIDJNI_LOG(logDEBUG) << "Module = " << module;
+  return HAL_CheckSolenoidModule(module);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    freeSolenoidPort
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_freeSolenoidPort(
+    JNIEnv *env, jclass, jint id) {
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI initializeSolenoidPort";
+
+  SOLENOIDJNI_LOG(logDEBUG) << "Port Handle = " << (HAL_SolenoidHandle)id;
+  HAL_FreeSolenoidPort((HAL_SolenoidHandle)id);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    setSolenoid
+ * Signature: (IZ)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setSolenoid(
+    JNIEnv *env, jclass, jint solenoid_port, jboolean value) {
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI SetSolenoid";
+
+  SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = "
+                            << (HAL_SolenoidHandle)solenoid_port;
+
+  int32_t status = 0;
+  HAL_SetSolenoid((HAL_SolenoidHandle)solenoid_port, value, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    getSolenoid
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getSolenoid(
+    JNIEnv *env, jclass, jint solenoid_port) {
+  int32_t status = 0;
+  jboolean val = HAL_GetSolenoid((HAL_SolenoidHandle)solenoid_port, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    getAllSolenoids
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getAllSolenoids(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  jint val = HAL_GetAllSolenoids(module, &status);
+  CheckStatus(env, status);
+  return val;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    getPCMSolenoidBlackList
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidBlackList(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  jint val = HAL_GetPCMSolenoidBlackList(module, &status);
+  CheckStatus(env, status);
+  return val;
+}
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    getPCMSolenoidVoltageStickyFault
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageStickyFault(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  bool val = HAL_GetPCMSolenoidVoltageStickyFault(module, &status);
+  CheckStatus(env, status);
+  return val;
+}
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    getPCMSolenoidVoltageFault
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_getPCMSolenoidVoltageFault(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  bool val = HAL_GetPCMSolenoidVoltageFault(module, &status);
+  CheckStatus(env, status);
+  return val;
+}
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    clearAllPCMStickyFaults
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_clearAllPCMStickyFaults(
+    JNIEnv *env, jclass, jint module) {
+  int32_t status = 0;
+  HAL_ClearAllPCMStickyFaults(module, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    setOneShotDuration
+ * Signature: (IJ)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_setOneShotDuration
+  (JNIEnv *env, jclass, jint solenoid_port, jlong durationMS)
+{
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI SetOneShotDuration";
+
+  SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = "
+                            << (HAL_SolenoidHandle)solenoid_port;
+  SOLENOIDJNI_LOG(logDEBUG) << "Duration (MS) = " << durationMS;
+
+  int32_t status = 0;
+  HAL_SetOneShotDuration((HAL_SolenoidHandle)solenoid_port, durationMS, &status);
+  CheckStatus(env, status);
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_SolenoidJNI
+ * Method:    fireOneShot
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_SolenoidJNI_fireOneShot
+  (JNIEnv *env, jclass, jint solenoid_port)
+{
+  SOLENOIDJNI_LOG(logDEBUG) << "Calling SolenoidJNI fireOneShot";
+
+  SOLENOIDJNI_LOG(logDEBUG) << "Solenoid Port Handle = "
+                            << (HAL_SolenoidHandle)solenoid_port;
+
+  int32_t status = 0;
+  HAL_FireOneShot((HAL_SolenoidHandle)solenoid_port, &status);
+  CheckStatus(env, status);
+}
+}  // extern "C"
diff --git a/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/ThreadsJNI.cpp b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/ThreadsJNI.cpp
new file mode 100644
index 0000000..7121b8d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/main/native/cpp/ThreadsJNI.cpp
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <assert.h>
+#include <jni.h>
+#include "HAL/cpp/Log.h"
+
+#include "edu_wpi_first_wpilibj_hal_ThreadsJNI.h"
+
+#include "HAL/Threads.h"
+#include "HALUtil.h"
+
+using namespace frc;
+
+// set the logging level
+TLogLevel threadsJNILogLevel = logWARNING;
+
+#define THREADSJNI_LOG(level)     \
+  if (level > threadsJNILogLevel) \
+    ;                            \
+  else                           \
+  Log().Get(level)
+
+extern "C" {
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_ThreadsJNI
+ * Method:    GetCurrentThreadPriority
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadPriority
+  (JNIEnv *env, jclass) {
+  THREADSJNI_LOG(logDEBUG) << "Callling GetCurrentThreadPriority";
+  int32_t status = 0;
+  HAL_Bool isRT = false;
+  auto ret = HAL_GetCurrentThreadPriority(&isRT, &status);
+  CheckStatus(env, status);
+  return (jint)ret;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_ThreadsJNI
+ * Method:    GetCurrentThreadIsRealTime
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_getCurrentThreadIsRealTime
+  (JNIEnv *env, jclass) {
+  THREADSJNI_LOG(logDEBUG) << "Callling GetCurrentThreadIsRealTime";
+  int32_t status = 0;
+  HAL_Bool isRT = false;
+  HAL_GetCurrentThreadPriority(&isRT, &status);
+  CheckStatus(env, status);
+  return (jboolean)isRT;
+}
+
+/*
+ * Class:     edu_wpi_first_wpilibj_hal_ThreadsJNI
+ * Method:    SetCurrentThreadPriority
+ * Signature: (ZI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_wpilibj_hal_ThreadsJNI_setCurrentThreadPriority
+  (JNIEnv *env, jclass, jboolean realTime, jint priority) {
+  THREADSJNI_LOG(logDEBUG) << "Callling SetCurrentThreadPriority";
+  int32_t status = 0;
+  auto ret = HAL_SetCurrentThreadPriority((HAL_Bool)realTime, (int32_t)priority, &status);
+  CheckStatus(env, status);
+  return (jboolean)ret;
+}
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/CircularBufferTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/CircularBufferTest.java
new file mode 100644
index 0000000..407a405
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/CircularBufferTest.java
@@ -0,0 +1,219 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class CircularBufferTest {
+  private double[] m_values = {751.848, 766.366, 342.657, 234.252, 716.126,
+      132.344, 445.697, 22.727, 421.125, 799.913};
+  private double[] m_addFirstOut = {799.913, 421.125, 22.727, 445.697, 132.344,
+      716.126, 234.252, 342.657};
+  private double[] m_addLastOut = {342.657, 234.252, 716.126, 132.344, 445.697,
+      22.727, 421.125, 799.913};
+
+  @BeforeClass
+  public static void before() {
+    UnitTestUtility.setupMockBase();
+  }
+
+  @Test
+  public void addFirstTest() {
+    CircularBuffer queue = new CircularBuffer(8);
+
+    for (double value : m_values) {
+      queue.addFirst(value);
+    }
+
+    for (int i = 0; i < m_addFirstOut.length; i++) {
+      assertEquals(m_addFirstOut[i], queue.get(i), 0.00005);
+    }
+  }
+
+  @Test
+  public void addLastTest() {
+    CircularBuffer queue = new CircularBuffer(8);
+
+    for (double value : m_values) {
+      queue.addLast(value);
+    }
+
+    for (int i = 0; i < m_addLastOut.length; i++) {
+      assertEquals(m_addLastOut[i], queue.get(i), 0.00005);
+    }
+  }
+
+  @Test
+  public void pushPopTest() {
+    CircularBuffer queue = new CircularBuffer(3);
+
+    // Insert three elements into the buffer
+    queue.addLast(1.0);
+    queue.addLast(2.0);
+    queue.addLast(3.0);
+
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+    assertEquals(3.0, queue.get(2), 0.00005);
+
+    /*
+     * The buffer is full now, so pushing subsequent elements will overwrite the
+     * front-most elements.
+     */
+
+    queue.addLast(4.0); // Overwrite 1 with 4
+
+    // The buffer now contains 2, 3, and 4
+    assertEquals(2.0, queue.get(0), 0.00005);
+    assertEquals(3.0, queue.get(1), 0.00005);
+    assertEquals(4.0, queue.get(2), 0.00005);
+
+    queue.addLast(5.0); // Overwrite 2 with 5
+
+    // The buffer now contains 3, 4, and 5
+    assertEquals(3.0, queue.get(0), 0.00005);
+    assertEquals(4.0, queue.get(1), 0.00005);
+    assertEquals(5.0, queue.get(2), 0.00005);
+
+    assertEquals(5.0, queue.removeLast(), 0.00005); // 5 is removed
+
+    // The buffer now contains 3 and 4
+    assertEquals(3.0, queue.get(0), 0.00005);
+    assertEquals(4.0, queue.get(1), 0.00005);
+
+    assertEquals(3.0, queue.removeFirst(), 0.00005); // 3 is removed
+
+    // Leaving only one element with value == 4
+    assertEquals(4.0, queue.get(0), 0.00005);
+  }
+
+  @Test
+  public void resetTest() {
+    CircularBuffer queue = new CircularBuffer(5);
+
+    for (int i = 0; i < 6; i++) {
+      queue.addLast(i);
+    }
+
+    queue.clear();
+
+    for (int i = 0; i < 5; i++) {
+      assertEquals(0.0, queue.get(i), 0.00005);
+    }
+  }
+
+  @Test
+  public void resizeTest() {
+    CircularBuffer queue = new CircularBuffer(5);
+
+    /* Buffer contains {1, 2, 3, _, _}
+     *                  ^ front
+     */
+    queue.addLast(1.0);
+    queue.addLast(2.0);
+    queue.addLast(3.0);
+
+    queue.resize(2);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.resize(5);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.clear();
+
+    /* Buffer contains {_, 1, 2, 3, _}
+     *                     ^ front
+     */
+    queue.addLast(0.0);
+    queue.addLast(1.0);
+    queue.addLast(2.0);
+    queue.addLast(3.0);
+    queue.removeFirst();
+
+    queue.resize(2);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.resize(5);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.clear();
+
+    /* Buffer contains {_, _, 1, 2, 3}
+     *                        ^ front
+     */
+    queue.addLast(0.0);
+    queue.addLast(0.0);
+    queue.addLast(1.0);
+    queue.addLast(2.0);
+    queue.addLast(3.0);
+    queue.removeFirst();
+    queue.removeFirst();
+
+    queue.resize(2);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.resize(5);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.clear();
+
+    /* Buffer contains {3, _, _, 1, 2}
+     *                           ^ front
+     */
+    queue.addLast(3.0);
+    queue.addFirst(2.0);
+    queue.addFirst(1.0);
+
+    queue.resize(2);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.resize(5);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.clear();
+
+    /* Buffer contains {2, 3, _, _, 1}
+     *                              ^ front
+     */
+    queue.addLast(2.0);
+    queue.addLast(3.0);
+    queue.addFirst(1.0);
+
+    queue.resize(2);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    queue.resize(5);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+
+    // Test addLast() after resize
+    queue.addLast(3.0);
+    assertEquals(1.0, queue.get(0), 0.00005);
+    assertEquals(2.0, queue.get(1), 0.00005);
+    assertEquals(3.0, queue.get(2), 0.00005);
+
+    // Test addFirst() after resize
+    queue.addFirst(4.0);
+    assertEquals(4.0, queue.get(0), 0.00005);
+    assertEquals(1.0, queue.get(1), 0.00005);
+    assertEquals(2.0, queue.get(2), 0.00005);
+    assertEquals(3.0, queue.get(3), 0.00005);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/MockRobotStateInterface.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/MockRobotStateInterface.java
new file mode 100644
index 0000000..7c3ab10
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/MockRobotStateInterface.java
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+/**
+ * A concrete implementation of the robot state interface that can be used in UnitTests.
+ */
+public class MockRobotStateInterface implements RobotState.Interface {
+  @Override
+  public boolean isDisabled() {
+    return false;
+  }
+
+  @Override
+  public boolean isEnabled() {
+    return true;
+  }
+
+  @Override
+  public boolean isOperatorControl() {
+    return false;
+  }
+
+  @Override
+  public boolean isAutonomous() {
+    return false;
+  }
+
+  @Override
+  public boolean isTest() {
+    return true;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/MockSpeedController.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/MockSpeedController.java
new file mode 100644
index 0000000..cbb5c61
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/MockSpeedController.java
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+public class MockSpeedController implements SpeedController {
+  private double m_speed = 0.0;
+  private boolean m_isInverted = false;
+
+  @Override
+  public void set(double speed) {
+    m_speed = m_isInverted ? -speed : speed;
+  }
+
+  @Override
+  public double get() {
+    return m_speed;
+  }
+
+  @Override
+  public void setInverted(boolean isInverted) {
+    m_isInverted = isInverted;
+  }
+
+  @Override
+  public boolean getInverted() {
+    return m_isInverted;
+  }
+
+  @Override
+  public void disable() {
+    m_speed = 0;
+  }
+
+  @Override
+  public void stopMotor() {
+    disable();
+  }
+
+  @Override
+  public void pidWrite(double output) {
+    set(output);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/PIDToleranceTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/PIDToleranceTest.java
new file mode 100644
index 0000000..1da0c9f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/PIDToleranceTest.java
@@ -0,0 +1,109 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class PIDToleranceTest {
+  private PIDController m_pid;
+  private final double m_setPoint = 50.0;
+  private final double m_tolerance = 10.0;
+  private final double m_range = 200;
+
+  @BeforeClass
+  public static void setupClass() {
+    UnitTestUtility.setupMockBase();
+  }
+
+  private class FakeInput implements PIDSource {
+    public double m_val;
+
+    FakeInput() {
+      m_val = 0;
+    }
+
+    @Override
+    public PIDSourceType getPIDSourceType() {
+      return PIDSourceType.kDisplacement;
+    }
+
+    @Override
+    public double pidGet() {
+      return m_val;
+    }
+
+    @Override
+    public void setPIDSourceType(PIDSourceType arg0) {
+    }
+  }
+
+  private FakeInput m_inp;
+  private PIDOutput m_out = new PIDOutput() {
+    @Override
+    public void pidWrite(double out) {
+    }
+
+  };
+
+
+  @Before
+  public void setUp() throws Exception {
+    m_inp = new FakeInput();
+    m_pid = new PIDController(0.05, 0.0, 0.0, m_inp, m_out);
+    m_pid.setInputRange(-m_range / 2, m_range / 2);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    m_pid.free();
+    m_pid = null;
+  }
+
+  @Test
+  public void testAbsoluteTolerance() {
+    m_pid.setAbsoluteTolerance(m_tolerance);
+    m_pid.setSetpoint(m_setPoint);
+    m_pid.enable();
+    Timer.delay(1);
+    assertFalse("Error was in tolerance when it should not have been. Error was "
+        + m_pid.getError(), m_pid.onTarget());
+    m_inp.m_val = m_setPoint + m_tolerance / 2;
+    Timer.delay(1.0);
+    assertTrue("Error was not in tolerance when it should have been. Error was "
+        + m_pid.getError(), m_pid.onTarget());
+    m_inp.m_val = m_setPoint + 10 * m_tolerance;
+    Timer.delay(1.0);
+    assertFalse("Error was in tolerance when it should not have been. Error was "
+        + m_pid.getError(), m_pid.onTarget());
+  }
+
+  @Test
+  public void testPercentTolerance() {
+    m_pid.setPercentTolerance(m_tolerance);
+    m_pid.setSetpoint(m_setPoint);
+    m_pid.enable();
+    assertFalse("Error was in tolerance when it should not have been. Error was "
+        + m_pid.getError(), m_pid.onTarget());
+    //half of percent tolerance away from setPoint
+    m_inp.m_val = m_setPoint + m_tolerance / 200 * m_range;
+    Timer.delay(1.0);
+    assertTrue("Error was not in tolerance when it should have been. Error was "
+        + m_pid.getError(), m_pid.onTarget());
+    //double percent tolerance away from setPoint
+    m_inp.m_val = m_setPoint + m_tolerance / 50 * m_range;
+    Timer.delay(1.0);
+    assertFalse("Error was in tolerance when it should not have been. Error was "
+        + m_pid.getError(), m_pid.onTarget());
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/SpeedControllerGroupTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/SpeedControllerGroupTest.java
new file mode 100644
index 0000000..3af8a66
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/SpeedControllerGroupTest.java
@@ -0,0 +1,114 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(Parameterized.class)
+public class SpeedControllerGroupTest {
+  private final SpeedController[] m_speedControllers;
+  private final SpeedControllerGroup m_group;
+
+  /**
+   * Returns a Collection of ArrayLists with various MockSpeedController configurations.
+   */
+  @Parameterized.Parameters
+  public static Collection<Object[][]> data() {
+    return Arrays.asList((Object[][][]) new SpeedController[][][] {
+        {{new MockSpeedController()}},
+        {{new MockSpeedController(),
+            new MockSpeedController()}},
+        {{new MockSpeedController(),
+            new MockSpeedController(),
+            new MockSpeedController()}}
+    });
+  }
+
+  /**
+   * Construct SpeedControllerGroupTest.
+   */
+  public SpeedControllerGroupTest(SpeedController[] speedControllers) {
+    m_group = new SpeedControllerGroup(speedControllers[0],
+        Arrays.copyOfRange(speedControllers, 1, speedControllers.length));
+    m_speedControllers = speedControllers;
+  }
+
+  @Test
+  public void testSet() {
+    m_group.set(1.0);
+
+    assertArrayEquals(Arrays.stream(m_speedControllers).mapToDouble(__ -> 1.0).toArray(),
+        Arrays.stream(m_speedControllers).mapToDouble(SpeedController::get).toArray(),
+        0.0);
+  }
+
+  @Test
+  public void testGetInverted() {
+    m_group.setInverted(true);
+
+    assertTrue(m_group.getInverted());
+  }
+
+  @Test
+  public void testSetInvertedDoesNotModifySpeedControllers() {
+    for (SpeedController speedController : m_speedControllers) {
+      speedController.setInverted(false);
+    }
+    m_group.setInverted(true);
+
+    assertArrayEquals(Arrays.stream(m_speedControllers).map(__ -> false).toArray(),
+        Arrays.stream(m_speedControllers).map(SpeedController::getInverted).toArray());
+  }
+
+  @Test
+  public void testSetInvertedDoesInvert() {
+    m_group.setInverted(true);
+    m_group.set(1.0);
+
+    assertArrayEquals(Arrays.stream(m_speedControllers).mapToDouble(__ -> -1.0).toArray(),
+        Arrays.stream(m_speedControllers).mapToDouble(SpeedController::get).toArray(),
+        0.0);
+  }
+
+  @Test
+  public void testDisable() {
+    m_group.set(1.0);
+    m_group.disable();
+
+    assertArrayEquals(Arrays.stream(m_speedControllers).mapToDouble(__ -> 0.0).toArray(),
+        Arrays.stream(m_speedControllers).mapToDouble(SpeedController::get).toArray(),
+        0.0);
+  }
+
+  @Test
+  public void testStopMotor() {
+    m_group.set(1.0);
+    m_group.stopMotor();
+
+    assertArrayEquals(Arrays.stream(m_speedControllers).mapToDouble(__ -> 0.0).toArray(),
+        Arrays.stream(m_speedControllers).mapToDouble(SpeedController::get).toArray(),
+        0.0);
+  }
+
+  @Test
+  public void testPidWrite() {
+    m_group.pidWrite(1.0);
+
+    assertArrayEquals(Arrays.stream(m_speedControllers).mapToDouble(__ -> 1.0).toArray(),
+        Arrays.stream(m_speedControllers).mapToDouble(SpeedController::get).toArray(),
+        0.0);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/UnitTestUtility.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/UnitTestUtility.java
new file mode 100644
index 0000000..b4bdfcb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/UnitTestUtility.java
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import com.google.common.base.Stopwatch;
+
+import java.util.concurrent.TimeUnit;
+
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.util.BaseSystemNotInitializedException;
+
+/**
+ * Utility class for configuring unit tests.
+ */
+public final class UnitTestUtility {
+  private UnitTestUtility() {
+        /* no-op */
+  }
+
+  /**
+   * Sets up the base system WPILib so that it does not rely on hardware.
+   */
+  public static void setupMockBase() {
+    HAL.initialize(500, 0);
+    try {
+      // Check to see if this has been setup
+      Timer.getFPGATimestamp();
+    } catch (BaseSystemNotInitializedException ex) {
+      // If it hasn't been then do this setup
+
+      HLUsageReporting.SetImplementation(new HLUsageReporting.Null());
+      RobotState.SetImplementation(new MockRobotStateInterface());
+      Timer.SetImplementation(new Timer.StaticInterface() {
+
+        @Override
+        public double getFPGATimestamp() {
+          return System.currentTimeMillis() / 1000.0;
+        }
+
+        @Override
+        public double getMatchTime() {
+          return 0;
+        }
+
+        @Override
+        public void delay(double seconds) {
+          try {
+            Thread.sleep((long) (seconds * 1e3));
+          } catch (InterruptedException ex) {
+            Thread.currentThread().interrupt();
+            throw new RuntimeException("Thread was interrupted", ex);
+          }
+        }
+
+        @Override
+        public Timer.Interface newTimer() {
+          return new Timer.Interface() {
+            private final Stopwatch m_stopwatch = Stopwatch.createUnstarted();
+
+            @Override
+            public double get() {
+              return m_stopwatch.elapsed(TimeUnit.SECONDS);
+            }
+
+            @Override
+            public void reset() {
+              m_stopwatch.reset();
+            }
+
+            @Override
+            public void start() {
+              m_stopwatch.start();
+            }
+
+            @Override
+            public void stop() {
+              m_stopwatch.stop();
+            }
+
+            @Override
+            public boolean hasPeriodPassed(double period) {
+              if (get() > period) {
+                // Advance the start time by the period.
+                // Don't set it to the current time... we want to avoid drift.
+                m_stopwatch.reset().start();
+                return true;
+              }
+              return false;
+            }
+          };
+        }
+      });
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/can/CANStatusTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/can/CANStatusTest.java
new file mode 100644
index 0000000..97b06a1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/can/CANStatusTest.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+import org.junit.Test;
+
+import edu.wpi.first.wpilibj.hal.HAL;
+
+public class CANStatusTest {
+  @Test
+  public void canStatusGetDoesntThrow() {
+    HAL.initialize(500, 0);
+    CANStatus status = new CANStatus();
+    CANJNI.GetCANStatus(status);
+    // Nothing we can assert, so just make sure it didn't throw.
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/AbstractCommandTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/AbstractCommandTest.java
new file mode 100644
index 0000000..3485784
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/AbstractCommandTest.java
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Before;
+
+import edu.wpi.first.wpilibj.UnitTestUtility;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+/**
+ * The basic test for all {@link Command} tests.
+ */
+public abstract class AbstractCommandTest {
+  @Before
+  public void commandSetup() {
+    UnitTestUtility.setupMockBase();
+    Scheduler.getInstance().removeAll();
+    Scheduler.getInstance().enable();
+  }
+
+  public class ASubsystem extends Subsystem {
+    Command m_command;
+
+    protected void initDefaultCommand() {
+      if (m_command != null) {
+        setDefaultCommand(m_command);
+      }
+    }
+
+    public void init(Command command) {
+      m_command = command;
+    }
+  }
+
+
+  protected void assertCommandState(MockCommand command, int initialize, int execute,
+                                    int isFinished, int end, int interrupted) {
+    assertEquals(initialize, command.getInitializeCount());
+    assertEquals(execute, command.getExecuteCount());
+    assertEquals(isFinished, command.getIsFinishedCount());
+    assertEquals(end, command.getEndCount());
+    assertEquals(interrupted, command.getInterruptedCount());
+  }
+
+  protected void sleep(int time) {
+    try {
+      Thread.sleep(time);
+    } catch (InterruptedException ex) {
+      fail("Sleep Interrupted!?!?!?!?");
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/ButtonTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/ButtonTest.java
new file mode 100644
index 0000000..64fb060
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/ButtonTest.java
@@ -0,0 +1,116 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import edu.wpi.first.wpilibj.buttons.InternalButton;
+
+
+/**
+ * Test that covers the {@link edu.wpi.first.wpilibj.buttons.Button} with the {@link Command}
+ * library.
+ */
+public class ButtonTest extends AbstractCommandTest {
+  private InternalButton m_button1;
+  private InternalButton m_button2;
+
+  @Before
+  public void setUp() throws Exception {
+    m_button1 = new InternalButton();
+    m_button2 = new InternalButton();
+  }
+
+  /**
+   * Simple Button Test.
+   */
+  @Test
+  public void test() {
+    final MockCommand command1 = new MockCommand();
+    final MockCommand command2 = new MockCommand();
+    final MockCommand command3 = new MockCommand();
+    final MockCommand command4 = new MockCommand();
+
+    m_button1.whenPressed(command1);
+    m_button1.whenReleased(command2);
+    m_button1.whileHeld(command3);
+    m_button2.whileHeld(command4);
+
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    assertCommandState(command4, 0, 0, 0, 0, 0);
+    m_button1.setPressed(true);
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    assertCommandState(command4, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    assertCommandState(command4, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 1, 1, 1, 0, 0);
+    assertCommandState(command4, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 2, 2, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 1, 2, 2, 0, 0);
+    assertCommandState(command4, 0, 0, 0, 0, 0);
+    m_button2.setPressed(true);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 3, 3, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 1, 3, 3, 0, 0);
+    assertCommandState(command4, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 4, 4, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 0);
+    assertCommandState(command4, 1, 1, 1, 0, 0);
+    m_button1.setPressed(false);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 5, 5, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 1);
+    assertCommandState(command4, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 6, 6, 0, 0);
+    assertCommandState(command2, 1, 1, 1, 0, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 1);
+    assertCommandState(command4, 1, 3, 3, 0, 0);
+    m_button2.setPressed(false);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 7, 7, 0, 0);
+    assertCommandState(command2, 1, 2, 2, 0, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 1);
+    assertCommandState(command4, 1, 3, 3, 0, 1);
+    command1.cancel();
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 7, 7, 0, 1);
+    assertCommandState(command2, 1, 3, 3, 0, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 1);
+    assertCommandState(command4, 1, 3, 3, 0, 1);
+    command2.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 7, 7, 0, 1);
+    assertCommandState(command2, 1, 4, 4, 1, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 1);
+    assertCommandState(command4, 1, 3, 3, 0, 1);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 7, 7, 0, 1);
+    assertCommandState(command2, 1, 4, 4, 1, 0);
+    assertCommandState(command3, 1, 4, 4, 0, 1);
+    assertCommandState(command4, 1, 3, 3, 0, 1);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandParallelGroupTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandParallelGroupTest.java
new file mode 100644
index 0000000..8291f3e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandParallelGroupTest.java
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Test;
+
+/**
+ * Ported from the old CrioTest Classes.
+ */
+public class CommandParallelGroupTest extends AbstractCommandTest {
+  /**
+   * Simple Parallel Command Group With 2 commands one command terminates first.
+   */
+  @Test
+  public void testParallelCommandGroupWithTwoCommands() {
+    final MockCommand command1 = new MockCommand();
+    final MockCommand command2 = new MockCommand();
+
+    final CommandGroup commandGroup = new CommandGroup();
+    commandGroup.addParallel(command1);
+    commandGroup.addParallel(command2);
+
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    commandGroup.start();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 0);
+    assertCommandState(command2, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 2, 2, 0, 0);
+    assertCommandState(command2, 1, 2, 2, 0, 0);
+    command1.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 3, 3, 1, 0);
+    assertCommandState(command2, 1, 3, 3, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 3, 3, 1, 0);
+    assertCommandState(command2, 1, 4, 4, 0, 0);
+    command2.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 3, 3, 1, 0);
+    assertCommandState(command2, 1, 5, 5, 1, 0);
+
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandScheduleTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandScheduleTest.java
new file mode 100644
index 0000000..d324f31
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandScheduleTest.java
@@ -0,0 +1,61 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Test;
+
+/**
+ * Ported from the old CrioTest Classes.
+ */
+public class CommandScheduleTest extends AbstractCommandTest {
+  /**
+   * Simple scheduling of a command and making sure the command is run and successfully terminates.
+   */
+  @Test
+  public void testRunAndTerminate() {
+    final MockCommand command = new MockCommand();
+    command.start();
+    assertCommandState(command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 2, 2, 0, 0);
+    command.setHasFinished(true);
+    assertCommandState(command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 3, 3, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 3, 3, 1, 0);
+  }
+
+  /**
+   * Simple scheduling of a command and making sure the command is run and cancels correctly.
+   */
+  @Test
+  public void testRunAndCancel() {
+    final MockCommand command = new MockCommand();
+    command.start();
+    assertCommandState(command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 3, 3, 0, 0);
+    command.cancel();
+    assertCommandState(command, 1, 3, 3, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 3, 3, 0, 1);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 3, 3, 0, 1);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandSequentialGroupTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandSequentialGroupTest.java
new file mode 100644
index 0000000..5d41b92
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandSequentialGroupTest.java
@@ -0,0 +1,105 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+/**
+ * Ported from the old CrioTest Classes.
+ */
+public class CommandSequentialGroupTest extends AbstractCommandTest {
+  private static Logger logger = Logger.getLogger(CommandSequentialGroupTest.class.getName());
+
+  /**
+   * Simple Command Group With 3 commands that all depend on a subsystem. Some commands have a
+   * timeout.
+   */
+  @Test(timeout = 20000)
+  public void testThreeCommandOnSubSystem() {
+    logger.fine("Begining Test");
+    final ASubsystem subsystem = new ASubsystem();
+
+    logger.finest("Creating Mock Command1");
+    final MockCommand command1 = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+    logger.finest("Creating Mock Command2");
+    final MockCommand command2 = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+    logger.finest("Creating Mock Command3");
+    final MockCommand command3 = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+
+    logger.finest("Creating Command Group");
+    final CommandGroup commandGroup = new CommandGroup();
+    commandGroup.addSequential(command1, 1.0);
+    commandGroup.addSequential(command2, 2.0);
+    commandGroup.addSequential(command3);
+
+
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    logger.finest("Starting Command group");
+    commandGroup.start();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    sleep(1000); // command 1 timeout
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 1, 1, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 0);
+    assertCommandState(command3, 0, 0, 0, 0, 0);
+    sleep(2000); // command 2 timeout
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 1);
+    assertCommandState(command3, 1, 1, 1, 0, 0);
+
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 1);
+    assertCommandState(command3, 1, 2, 2, 0, 0);
+    command3.setHasFinished(true);
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 1);
+    assertCommandState(command3, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 1);
+    assertCommandState(command3, 1, 3, 3, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 1);
+    assertCommandState(command3, 1, 3, 3, 1, 0);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandSupersedeTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandSupersedeTest.java
new file mode 100644
index 0000000..7c09a57
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandSupersedeTest.java
@@ -0,0 +1,120 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+/**
+ * Ported from the old CrioTest Classes.
+ */
+public class CommandSupersedeTest extends AbstractCommandTest {
+  private static final Logger logger = Logger.getLogger(CommandSupersedeTest.class.getName());
+
+
+  /**
+   * Testing one command superseding another because of dependencies.
+   */
+  @Test
+  public void testOneCommandSupersedingAnotherBecauseOfDependencies() {
+    final ASubsystem subsystem = new ASubsystem();
+
+    final MockCommand command1 = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+
+    final MockCommand command2 = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    command1.start();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 2, 2, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 3, 3, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    command2.start();
+    assertCommandState(command1, 1, 3, 3, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 4, 4, 0, 1);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 4, 4, 0, 1);
+    assertCommandState(command2, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 4, 4, 0, 1);
+    assertCommandState(command2, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 4, 4, 0, 1);
+    assertCommandState(command2, 1, 3, 3, 0, 0);
+  }
+
+  /**
+   * Testing one command failing superseding another because of dependencies because the first
+   * command cannot be interrupted.
+   */
+  @Test
+  public void testCommandFailingSupersedingBecauseFirstCanNotBeInterrupted() {
+    final ASubsystem subsystem = new ASubsystem();
+
+    final MockCommand command1 = new MockCommand() {
+      {
+        requires(subsystem);
+        setInterruptible(false);
+      }
+    };
+
+    final MockCommand command2 = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    command1.start();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 0, 0, 0, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 1, 1, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 2, 2, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 3, 3, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    command2.start();
+    assertCommandState(command1, 1, 3, 3, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command1, 1, 4, 4, 0, 0);
+    assertCommandState(command2, 0, 0, 0, 0, 0);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandTimeoutTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandTimeoutTest.java
new file mode 100644
index 0000000..fe191b1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/CommandTimeoutTest.java
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Test;
+
+/**
+ * Test a {@link Command} that times out.
+ */
+public class CommandTimeoutTest extends AbstractCommandTest {
+  /**
+   * Command 2 second Timeout Test.
+   */
+  @Test
+  public void testTwoSecondTimeout() {
+    final ASubsystem subsystem = new ASubsystem();
+
+
+    final MockCommand command = new MockCommand() {
+      {
+        requires(subsystem);
+        setTimeout(2);
+      }
+
+      @Override
+      public boolean isFinished() {
+        return super.isFinished() || isTimedOut();
+      }
+    };
+
+    command.start();
+    assertCommandState(command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 3, 3, 0, 0);
+    sleep(2000);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 4, 4, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(command, 1, 4, 4, 1, 0);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/ConditionalCommandTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/ConditionalCommandTest.java
new file mode 100644
index 0000000..878854b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/ConditionalCommandTest.java
@@ -0,0 +1,345 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+//import org.junit.Ignore;
+import org.junit.Test;
+
+public class ConditionalCommandTest extends AbstractCommandTest {
+  MockConditionalCommand m_command;
+  MockConditionalCommand m_commandNull;
+  MockCommand m_onTrue;
+  MockCommand m_onFalse;
+  MockSubsystem m_subsys;
+  Boolean m_condition;
+
+  @Before
+  public void initCommands() {
+    m_subsys = new MockSubsystem();
+    m_onTrue = new MockCommand(m_subsys);
+    m_onFalse = new MockCommand(m_subsys);
+    m_command = new MockConditionalCommand(m_onTrue, m_onFalse);
+    m_commandNull = new MockConditionalCommand(m_onTrue, null);
+  }
+
+  protected void assertConditionalCommandState(MockConditionalCommand command, int initialize,
+                                               int execute, int isFinished, int end,
+                                               int interrupted) {
+    assertEquals(initialize, command.getInitializeCount());
+    assertEquals(execute, command.getExecuteCount());
+    assertEquals(isFinished, command.getIsFinishedCount());
+    assertEquals(end, command.getEndCount());
+    assertEquals(interrupted, command.getInterruptedCount());
+  }
+
+  @Test
+  public void testOnTrue() {
+    m_command.setCondition(true);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_onTrue.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 5, 5, 1, 0);
+
+    assertTrue("Did not initialize the true command", m_onTrue.getInitializeCount() > 0);
+    assertTrue("Initialized the false command", m_onFalse.getInitializeCount() == 0);
+  }
+
+  @Test
+  public void testOnFalse() {
+    m_command.setCondition(false);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onFalse
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onFalse
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onFalse, 1, 1, 1, 0, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onFalse, 1, 2, 2, 0, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_onFalse.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onFalse, 1, 3, 3, 1, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onFalse, 1, 3, 3, 1, 0);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 5, 5, 1, 0);
+
+    assertTrue("Did not initialize the false command", m_onFalse.getInitializeCount() > 0);
+    assertTrue("Initialized the true command", m_onTrue.getInitializeCount() == 0);
+  }
+
+  @Test
+  public void testCancelSubCommand() {
+    m_command.setCondition(true);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_onTrue.cancel();
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 1);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 1);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 5, 5, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 1);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 5, 5, 1, 0);
+  }
+
+  @Test
+  public void testCancelRequires() {
+    m_command.setCondition(true);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_onFalse.start();
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 1);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 0, 1);
+    assertCommandState(m_onFalse, 1, 1, 1, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 1);
+  }
+
+  @Test
+  public void testCancelCondCommand() {
+    m_command.setCondition(true);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_command.cancel();
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 1);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 1);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 1);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 1);
+  }
+
+  @Test
+  public void testOnTrueTwice() {
+    m_command.setCondition(true);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_onTrue.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 5, 5, 1, 0);
+
+    m_onTrue.resetCounters();
+    m_command.resetCounters();
+    m_command.setCondition(true);
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 2, 2, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 0, 0);
+    m_onTrue.setHasFinished(true);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 4, 4, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 3, 3, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 5, 5, 1, 0);
+  }
+
+  @Test
+  public void testOnTrueInstant() {
+    m_command.setCondition(true);
+    m_onTrue.setHasFinished(true);
+
+    Scheduler.getInstance().add(m_command);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onTrue
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 1, 1, 1, 1, 0);
+    assertCommandState(m_onFalse, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_command, 1, 3, 3, 1, 0);
+  }
+
+  @Test
+  public void testOnFalseNull() {
+    m_commandNull.setCondition(false);
+
+    Scheduler.getInstance().add(m_commandNull);
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_commandNull, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init command and select m_onFalse
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_commandNull, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();  // init m_onFalse
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_commandNull, 1, 1, 1, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(m_onTrue, 0, 0, 0, 0, 0);
+    assertConditionalCommandState(m_commandNull, 1, 1, 1, 1, 0);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/DefaultCommandTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/DefaultCommandTest.java
new file mode 100644
index 0000000..5c041db
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/DefaultCommandTest.java
@@ -0,0 +1,129 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.Test;
+
+/**
+ * Tests the {@link Command} library.
+ */
+public class DefaultCommandTest extends AbstractCommandTest {
+  /**
+   * Testing of default commands where the interrupting command ends itself.
+   */
+  @Test
+  public void testDefaultCommandWhereTheInteruptingCommandEndsItself() {
+    final ASubsystem subsystem = new ASubsystem();
+
+
+    final MockCommand defaultCommand = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+
+    final MockCommand anotherCommand = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+    assertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+    subsystem.init(defaultCommand);
+
+    assertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+
+    anotherCommand.start();
+    assertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+    assertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+    anotherCommand.setHasFinished(true);
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 3, 3, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 2, 4, 4, 0, 1);
+    assertCommandState(anotherCommand, 1, 3, 3, 1, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 2, 5, 5, 0, 1);
+    assertCommandState(anotherCommand, 1, 3, 3, 1, 0);
+  }
+
+
+  /**
+   * Testing of default commands where the interrupting command is canceled.
+   */
+  @Test
+  public void testDefaultCommandsInterruptingCommandCanceled() {
+    final ASubsystem subsystem = new ASubsystem();
+
+
+    final MockCommand defaultCommand = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+
+    final MockCommand anotherCommand = new MockCommand() {
+      {
+        requires(subsystem);
+      }
+    };
+    assertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+    subsystem.init(defaultCommand);
+    subsystem.initDefaultCommand();
+    assertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+
+    anotherCommand.start();
+    assertCommandState(defaultCommand, 1, 2, 2, 0, 0);
+    assertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 0, 0, 0, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 1, 1, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+    anotherCommand.cancel();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 0);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 1, 3, 3, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 1);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 2, 4, 4, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 1);
+    Scheduler.getInstance().run();
+    assertCommandState(defaultCommand, 2, 5, 5, 0, 1);
+    assertCommandState(anotherCommand, 1, 2, 2, 0, 1);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockCommand.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockCommand.java
new file mode 100644
index 0000000..1b7b7c5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockCommand.java
@@ -0,0 +1,139 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * A class to simulate a simple command. The command keeps track of how many times each method was
+ * called.
+ */
+public class MockCommand extends Command {
+  private int m_initializeCount = 0;
+  private int m_executeCount = 0;
+  private int m_isFinishedCount = 0;
+  private boolean m_hasFinished = false;
+  private int m_endCount = 0;
+  private int m_interruptedCount = 0;
+
+  public MockCommand(Subsystem subsys) {
+    super();
+    requires(subsys);
+  }
+
+  public MockCommand() {
+    super();
+  }
+
+  protected void initialize() {
+    ++m_initializeCount;
+  }
+
+  protected void execute() {
+    ++m_executeCount;
+  }
+
+  protected boolean isFinished() {
+    ++m_isFinishedCount;
+    return isHasFinished();
+  }
+
+  protected void end() {
+    ++m_endCount;
+  }
+
+  protected void interrupted() {
+    ++m_interruptedCount;
+  }
+
+
+  /**
+   * How many times the initialize method has been called.
+   */
+  public int getInitializeCount() {
+    return m_initializeCount;
+  }
+
+  /**
+   * If the initialize method has been called at least once.
+   */
+  public boolean hasInitialized() {
+    return getInitializeCount() > 0;
+  }
+
+  /**
+   * How many time the execute method has been called.
+   */
+  public int getExecuteCount() {
+    return m_executeCount;
+  }
+
+  /**
+   * How many times the isFinished method has been called.
+   */
+  public int getIsFinishedCount() {
+    return m_isFinishedCount;
+  }
+
+  /**
+   * Get what value the isFinished method will return.
+   *
+   * @return what value the isFinished method will return.
+   */
+  public boolean isHasFinished() {
+    return m_hasFinished;
+  }
+
+  /**
+   * Set what value the isFinished method will return.
+   *
+   * @param hasFinished set what value the isFinished method will return.
+   */
+  public void setHasFinished(boolean hasFinished) {
+    m_hasFinished = hasFinished;
+  }
+
+  /**
+   * How many times the end method has been called.
+   */
+  public int getEndCount() {
+    return m_endCount;
+  }
+
+  /**
+   * If the end method has been called at least once.
+   */
+  public boolean hasEnd() {
+    return getEndCount() > 0;
+  }
+
+  /**
+   * How many times the interrupted method has been called.
+   */
+  public int getInterruptedCount() {
+    return m_interruptedCount;
+  }
+
+  /**
+   * If the interrupted method has been called at least once.
+   */
+  public boolean hasInterrupted() {
+    return getInterruptedCount() > 0;
+  }
+
+  /**
+   * Reset internal counters.
+   */
+  public void resetCounters() {
+    m_initializeCount = 0;
+    m_executeCount = 0;
+    m_isFinishedCount = 0;
+    m_hasFinished = false;
+    m_endCount = 0;
+    m_interruptedCount = 0;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockConditionalCommand.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockConditionalCommand.java
new file mode 100644
index 0000000..ebb6340
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockConditionalCommand.java
@@ -0,0 +1,120 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+public class MockConditionalCommand extends ConditionalCommand {
+  private boolean m_condition = false;
+  private int m_initializeCount = 0;
+  private int m_executeCount = 0;
+  private int m_isFinishedCount = 0;
+  private int m_endCount = 0;
+  private int m_interruptedCount = 0;
+
+  public MockConditionalCommand(MockCommand onTrue, MockCommand onFalse) {
+    super(onTrue, onFalse);
+  }
+
+  @Override
+  protected boolean condition() {
+    return m_condition;
+  }
+
+  public void setCondition(boolean condition) {
+    this.m_condition = condition;
+  }
+
+  protected void initialize() {
+    ++m_initializeCount;
+  }
+
+  protected void execute() {
+    ++m_executeCount;
+  }
+
+  protected boolean isFinished() {
+    ++m_isFinishedCount;
+    return super.isFinished();
+  }
+
+  protected void end() {
+    ++m_endCount;
+  }
+
+  protected void interrupted() {
+    ++m_interruptedCount;
+  }
+
+
+  /**
+   * How many times the initialize method has been called.
+   */
+  public int getInitializeCount() {
+    return m_initializeCount;
+  }
+
+  /**
+   * If the initialize method has been called at least once.
+   */
+  public boolean hasInitialized() {
+    return getInitializeCount() > 0;
+  }
+
+  /**
+   * How many time the execute method has been called.
+   */
+  public int getExecuteCount() {
+    return m_executeCount;
+  }
+
+  /**
+   * How many times the isFinished method has been called.
+   */
+  public int getIsFinishedCount() {
+    return m_isFinishedCount;
+  }
+
+  /**
+   * How many times the end method has been called.
+   */
+  public int getEndCount() {
+    return m_endCount;
+  }
+
+  /**
+   * If the end method has been called at least once.
+   */
+  public boolean hasEnd() {
+    return getEndCount() > 0;
+  }
+
+  /**
+   * How many times the interrupted method has been called.
+   */
+  public int getInterruptedCount() {
+    return m_interruptedCount;
+  }
+
+  /**
+   * If the interrupted method has been called at least once.
+   */
+  public boolean hasInterrupted() {
+    return getInterruptedCount() > 0;
+  }
+
+  /**
+   * Reset internal counters.
+   */
+  public void resetCounters() {
+    m_condition = false;
+    m_initializeCount = 0;
+    m_executeCount = 0;
+    m_isFinishedCount = 0;
+    m_endCount = 0;
+    m_interruptedCount = 0;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockSubsystem.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockSubsystem.java
new file mode 100644
index 0000000..f20be37
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/command/MockSubsystem.java
@@ -0,0 +1,15 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+/**
+ * A class to simulate a simple subsystem.
+ */
+public class MockSubsystem extends Subsystem {
+  protected void initDefaultCommand() {}
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/hal/JNITest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/hal/JNITest.java
new file mode 100644
index 0000000..89a8bd3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/hal/JNITest.java
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import edu.wpi.first.networktables.NetworkTablesJNI;
+import org.junit.Test;
+
+public class JNITest {
+  @Test
+  public void jniNtcoreLinkTest() {
+    // Test to verify that the JNI test link works correctly.
+    NetworkTablesJNI.flush(NetworkTablesJNI.getDefaultInstance());
+  }
+
+  @Test
+  public void jniHalLinkTest() {
+    HAL.initialize(500, 0);
+    // Test to verify that the JNI test link works correctly.
+    HALUtil.getHALRuntimeType();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/hal/MatchInfoDataTest.java b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/hal/MatchInfoDataTest.java
new file mode 100644
index 0000000..4c06fb2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibj/src/test/java/edu/wpi/first/wpilibj/hal/MatchInfoDataTest.java
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.hal;
+
+import org.junit.Test;
+
+public class MatchInfoDataTest {
+  @Test
+  public void matchInfoDataDoesNotThrow() {
+    HAL.initialize(500, 0);
+    MatchInfoData data = new MatchInfoData();
+    HAL.getMatchInfo(data);
+    // Nothing we can assert, so just make sure it didn't throw.
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/build.gradle b/third_party/allwpilib_2018/wpilibjExamples/build.gradle
new file mode 100644
index 0000000..889d4a0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/build.gradle
@@ -0,0 +1,30 @@
+apply plugin: 'java'
+apply plugin: 'pmd'
+
+dependencies {
+    compile project(':wpilibj')
+
+    compile 'edu.wpi.first.wpiutil:wpiutil-java:3.+'
+    compile 'edu.wpi.first.ntcore:ntcore-java:4.+'
+    compile 'org.opencv:opencv-java:3.2.0'
+    compile 'edu.wpi.first.cscore:cscore-java:1.+'
+}
+
+checkstyle {
+    configFile = new File(rootDir, "styleguide/checkstyleEclipse.xml")
+}
+
+pmd {
+    consoleOutput = true
+    reportsDir = file("$project.buildDir/reports/pmd")
+    ruleSetFiles = files(new File(rootDir, "styleguide/pmd-ruleset.xml"))
+    ruleSets = []
+}
+
+gradle.projectsEvaluated {
+    tasks.withType(JavaCompile) {
+        options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
+    }
+}
+
+apply from: 'publish.gradle'
diff --git a/third_party/allwpilib_2018/wpilibjExamples/examples.xml b/third_party/allwpilib_2018/wpilibjExamples/examples.xml
new file mode 100755
index 0000000..d8988ad
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/examples.xml
@@ -0,0 +1,340 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<examples>
+    <!-- Tags -->
+    <!-- Getting Started should be first and then alphabetical.  Complete Example should be last -->
+    <tagDescription>
+        <name>Getting Started with Java</name>
+        <description>Examples for getting started with FRC Java</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Actuators</name>
+        <description>Example programs that demonstrate the use of various actuators</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Analog</name>
+        <description>Examples programs that show different uses of analog inputs,
+            outputs and various analog sensors</description>
+    </tagDescription>
+    <tagDescription>
+        <name>CAN</name>
+        <description>Example programs that demonstrate the use of the CAN components in the control
+            system</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Digital</name>
+        <description>Example programs that demonstrate the sensors that use the digital I/O ports</description>
+    </tagDescription>
+    <tagDescription>
+        <name>I2C</name>
+        <description>Example programs that demonstrate the use of I2C and various sensors that use
+            it</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Joystick</name>
+        <description>Example programs that demonstate different uses of joysticks for robot
+            driving</description>
+    </tagDescription>
+    <tagDescription>
+        <name>NetworkTables</name>
+        <description>Examples of how to use NetworkTables to accomplish a
+            variety of tasks such as sending and receiving values to both
+            dashboards and co-processors.</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Pneumatics</name>
+        <description>Example programs that demonstrate the use of the compressor and solenoids</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Robot and Motor</name>
+        <description>Example programs that demonstrate driving a robot and motors including safety,
+            servos, etc.</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Safety</name>
+        <description>Example programs that demonstate the motor safety classes and how to use them
+            with your programs</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Sensors</name>
+        <description>Example programs that demonstrate the use of the various commonly used sensors
+            on FRC robots</description>
+    </tagDescription>
+    <tagDescription>
+        <name>SPI</name>
+        <description>Example programs that demonstrate the use of the SPI bus and sensors that
+            connect to it</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Vision</name>
+        <description>Example programs that demonstrate the use of cameras and image processing</description>
+    </tagDescription>
+    <tagDescription>
+        <name>Complete Robot</name>
+        <description>Complete Robot example programs</description>
+    </tagDescription>
+
+    <!-- Examples -->
+    <example>
+        <name>Getting Started</name>
+        <description>An example program which demonstrates the simplest autonomous and
+            teleoperated routines.</description>
+        <tags>
+            <tag>Getting Started with Java</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/gettingstarted/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Tank Drive</name>
+        <description>Demonstrate the use of the RobotDrive class doing teleop driving with tank
+            steering</description>
+        <tags>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Safety</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/tankdrive/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Mecanum Drive</name>
+        <description>Demonstrate the use of the RobotDrive class doing teleop driving with Mecanum
+            steering</description>
+        <tags>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Safety</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/mecanumdrive/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Ultrasonic</name>
+        <description>Demonstrate maintaining a set distance using an ultrasonic sensor.</description>
+        <tags>
+            <tag>Sensors</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Analog</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/ultrasonic/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Ultrasonic PID</name>
+        <description>Demonstrate maintaining a set distance using an ultrasonic sensor and PID
+            Control.</description>
+        <tags>
+            <tag>Sensors</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Analog</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/ultrasonicpid/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Potentiometer PID</name>
+        <description>An example to demonstrate the use of a potentiometer and PID control to reach
+            elevator position setpoints.</description>
+        <tags>
+            <tag>Sensors</tag>
+            <tag>Actuators</tag>
+            <tag>Analog</tag>
+            <tag>Joystick</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/potentiometerpid/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Gyro</name>
+        <description>An example program showing how to drive straight with using a gyro sensor.</description>
+        <tags>
+            <tag>Sensors</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Analog</tag>
+            <tag>Joystick</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/gyro/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Gyro Mecanum</name>
+        <description>An example program showing how to perform mecanum drive with field oriented
+            controls.</description>
+        <tags>
+            <tag>Sensors</tag>
+            <tag>Robot and Motor</tag>
+            <tag>Analog</tag>
+            <tag>Joystick</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/gyromecanum/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Motor Controller</name>
+        <description>Demonstrate controlling a single motor with a joystick</description>
+        <tags>
+            <tag>Actuators</tag>
+            <tag>Joystick</tag>
+            <tag>Robot and Motor</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/motorcontrol/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>GearsBot</name>
+        <description>A fully functional example CommandBased program for WPIs GearsBot robot. This
+            code can run on your computer if it supports simulation.</description>
+        <tags>
+            <tag>Complete Robot</tag>
+        </tags>
+        <world>/usr/share/frcsim/worlds/GearsBotDemo.world</world>
+        <packages>
+            <package>src/$package-dir</package>
+            <package>src/$package-dir/commands</package>
+            <package>src/$package-dir/subsystems</package>
+        </packages>
+        <files>
+            <file source="examples/gearsbot/OI.java" destination="src/$package-dir/OI.java" />
+            <file source="examples/gearsbot/Robot.java" destination="src/$package-dir/Robot.java" />
+            <file source="examples/gearsbot/commands/Autonomous.java" destination="src/$package-dir/commands/Autonomous.java" />
+            <file source="examples/gearsbot/commands/CloseClaw.java" destination="src/$package-dir/commands/CloseClaw.java" />
+            <file source="examples/gearsbot/commands/DriveStraight.java" destination="src/$package-dir/commands/DriveStraight.java" />
+            <file source="examples/gearsbot/commands/OpenClaw.java" destination="src/$package-dir/commands/OpenClaw.java" />
+            <file source="examples/gearsbot/commands/Pickup.java" destination="src/$package-dir/commands/Pickup.java" />
+            <file source="examples/gearsbot/commands/Place.java" destination="src/$package-dir/commands/Place.java" />
+            <file source="examples/gearsbot/commands/PrepareToPickup.java" destination="src/$package-dir/commands/PrepareToPickup.java" />
+            <file source="examples/gearsbot/commands/SetDistanceToBox.java" destination="src/$package-dir/commands/SetDistanceToBox.java" />
+            <file source="examples/gearsbot/commands/SetElevatorSetpoint.java" destination="src/$package-dir/commands/SetElevatorSetpoint.java" />
+            <file source="examples/gearsbot/commands/SetWristSetpoint.java" destination="src/$package-dir/commands/SetWristSetpoint.java" />
+            <file source="examples/gearsbot/commands/TankDriveWithJoystick.java" destination="src/$package-dir/commands/TankDriveWithJoystick.java" />
+            <file source="examples/gearsbot/subsystems/Claw.java" destination="src/$package-dir/subsystems/Claw.java" />
+            <file source="examples/gearsbot/subsystems/DriveTrain.java" destination="src/$package-dir/subsystems/DriveTrain.java" />
+            <file source="examples/gearsbot/subsystems/Elevator.java" destination="src/$package-dir/subsystems/Elevator.java" />
+            <file source="examples/gearsbot/subsystems/Wrist.java" destination="src/$package-dir/subsystems/Wrist.java" />
+        </files>
+    </example>
+    <example>
+        <name>PacGoat</name>
+        <description>A fully functional example CommandBased program for FRC Team 190's 2014
+            robot. This code can run on your computer if it supports simulation.</description>
+        <tags>
+            <tag>Complete Robot</tag>
+        </tags>
+        <world>/usr/share/frcsim/worlds/PacGoat2014.world</world>
+        <packages>
+            <package>src/$package-dir</package>
+            <package>src/$package-dir/commands</package>
+            <package>src/$package-dir/subsystems</package>
+            <package>src/$package-dir/triggers</package>
+        </packages>
+        <files>
+            <file source="examples/pacgoat/OI.java" destination="src/$package-dir/OI.java" />
+            <file source="examples/pacgoat/Robot.java" destination="src/$package-dir/Robot.java" />
+            <file source="examples/pacgoat/commands/CheckForHotGoal.java" destination="src/$package-dir/commands/CheckForHotGoal.java" />
+            <file source="examples/pacgoat/commands/CloseClaw.java" destination="src/$package-dir/commands/CloseClaw.java" />
+            <file source="examples/pacgoat/commands/Collect.java" destination="src/$package-dir/commands/Collect.java" />
+            <file source="examples/pacgoat/commands/DriveAndShootAutonomous.java" destination="src/$package-dir/commands/DriveAndShootAutonomous.java" />
+            <file source="examples/pacgoat/commands/DriveForward.java" destination="src/$package-dir/commands/DriveForward.java" />
+            <file source="examples/pacgoat/commands/DriveWithJoystick.java" destination="src/$package-dir/commands/DriveWithJoystick.java" />
+            <file source="examples/pacgoat/commands/ExtendShooter.java" destination="src/$package-dir/commands/ExtendShooter.java" />
+            <file source="examples/pacgoat/commands/LowGoal.java" destination="src/$package-dir/commands/LowGoal.java" />
+            <file source="examples/pacgoat/commands/OpenClaw.java" destination="src/$package-dir/commands/OpenClaw.java" />
+            <file source="examples/pacgoat/commands/SetCollectionSpeed.java" destination="src/$package-dir/commands/SetCollectionSpeed.java" />
+            <file source="examples/pacgoat/commands/SetPivotSetpoint.java" destination="src/$package-dir/commands/SetPivotSetpoint.java" />
+            <file source="examples/pacgoat/commands/Shoot.java" destination="src/$package-dir/commands/Shoot.java" />
+            <file source="examples/pacgoat/commands/WaitForBall.java" destination="src/$package-dir/commands/WaitForBall.java" />
+            <file source="examples/pacgoat/commands/WaitForPressure.java" destination="src/$package-dir/commands/WaitForPressure.java" />
+            <file source="examples/pacgoat/subsystems/Collector.java" destination="src/$package-dir/subsystems/Collector.java" />
+            <file source="examples/pacgoat/subsystems/DriveTrain.java" destination="src/$package-dir/subsystems/DriveTrain.java" />
+            <file source="examples/pacgoat/subsystems/Pivot.java" destination="src/$package-dir/subsystems/Pivot.java" />
+            <file source="examples/pacgoat/subsystems/Pneumatics.java" destination="src/$package-dir/subsystems/Pneumatics.java" />
+            <file source="examples/pacgoat/subsystems/Shooter.java" destination="src/$package-dir/subsystems/Shooter.java" />
+            <file source="examples/pacgoat/triggers/DoubleButton.java" destination="src/$package-dir/triggers/DoubleButton.java" />
+        </files>
+    </example>
+    <example>
+        <name>Simple Vision</name>
+        <description>Demonstrate the use of the CameraServer class to stream from a USB Webcam
+            without processing the images.</description>
+        <tags>
+            <tag>Vision</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/quickvision/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Intermediate Vision</name>
+        <description>Demonstrate the use of the NIVision class to capture image from a Webcam,
+            process them, and then send them to the dashboard.</description>
+        <tags>
+            <tag>Vision</tag>
+            <tag>Complete List</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/intermediatevision/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+    <example>
+        <name>Axis Camera Sample</name>
+        <description>An example program that acquires images from an Axis network camera and adds
+            some
+            annotation to the image as you might do for showing operators the result of some image
+            recognition, and sends it to the dashboard for display. This demonstrates the use of the
+            AxisCamera class.</description>
+        <tags>
+            <tag>Vision</tag>
+        </tags>
+        <packages>
+            <package>src/$package-dir</package>
+        </packages>
+        <files>
+            <file source="examples/axiscamera/Robot.java" destination="src/$package-dir/Robot.java" />
+        </files>
+    </example>
+</examples>
diff --git a/third_party/allwpilib_2018/wpilibjExamples/publish.gradle b/third_party/allwpilib_2018/wpilibjExamples/publish.gradle
new file mode 100644
index 0000000..81863c2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/publish.gradle
@@ -0,0 +1,74 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def baseExamplesArtifactId = 'examples'
+def baseTemplatesArtifactId = 'templates'
+def artifactGroupId = 'edu.wpi.first.wpilibj'
+
+def outputsFolder = file("$project.buildDir/outputs")
+
+task javaExamplesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibj-examples'
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/java/edu/wpi/first/wpilibj/examples') {
+        into 'examples'
+    }
+
+    from ('examples.xml') {
+        into 'examples'
+    }
+}
+
+task javaTemplatesZip(type: Zip) {
+    destinationDir = outputsFolder
+    baseName = 'wpilibj-templates'
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/java/edu/wpi/first/wpilibj/templates') {
+        into 'templates'
+    }
+}
+
+build.dependsOn javaTemplatesZip
+build.dependsOn javaExamplesZip
+
+publishing {
+    publications {
+        examples(MavenPublication) {
+            artifact javaExamplesZip
+
+            artifactId = baseExamplesArtifactId
+            groupId artifactGroupId
+            version pubVersion
+        }
+
+        templates(MavenPublication) {
+            artifact javaTemplatesZip
+
+            artifactId = baseTemplatesArtifactId
+            groupId artifactGroupId
+            version pubVersion
+        }
+    }
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/axiscamera/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/axiscamera/Robot.java
new file mode 100644
index 0000000..952823d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/axiscamera/Robot.java
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.axiscamera;
+
+import edu.wpi.cscore.AxisCamera;
+import edu.wpi.cscore.CvSink;
+import edu.wpi.cscore.CvSource;
+import edu.wpi.first.wpilibj.CameraServer;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import org.opencv.core.Mat;
+import org.opencv.core.Point;
+import org.opencv.core.Scalar;
+import org.opencv.imgproc.Imgproc;
+
+/**
+ * This is a demo program showing the use of OpenCV to do vision processing. The
+ * image is acquired from the Axis camera, then a rectangle is put on the image
+ * and sent to the dashboard. OpenCV has many methods for different types of
+ * processing.
+ */
+public class Robot extends IterativeRobot {
+	Thread m_visionThread;
+
+	@Override
+	public void robotInit() {
+		m_visionThread = new Thread(() -> {
+			// Get the Axis camera from CameraServer
+			AxisCamera camera
+					= CameraServer.getInstance().addAxisCamera("axis-camera.local");
+			// Set the resolution
+			camera.setResolution(640, 480);
+
+			// Get a CvSink. This will capture Mats from the camera
+			CvSink cvSink = CameraServer.getInstance().getVideo();
+			// Setup a CvSource. This will send images back to the Dashboard
+			CvSource outputStream
+					= CameraServer.getInstance().putVideo("Rectangle", 640, 480);
+
+			// Mats are very memory expensive. Lets reuse this Mat.
+			Mat mat = new Mat();
+
+			// This cannot be 'true'. The program will never exit if it is. This
+			// lets the robot stop this thread when restarting robot code or
+			// deploying.
+			while (!Thread.interrupted()) {
+				// Tell the CvSink to grab a frame from the camera and put it
+				// in the source mat.  If there is an error notify the output.
+				if (cvSink.grabFrame(mat) == 0) {
+					// Send the output the error.
+					outputStream.notifyError(cvSink.getError());
+					// skip the rest of the current iteration
+					continue;
+				}
+				// Put a rectangle on the image
+				Imgproc.rectangle(mat, new Point(100, 100), new Point(400, 400),
+						new Scalar(255, 255, 255), 5);
+				// Give the output stream a new image to display
+				outputStream.putFrame(mat);
+			}
+		});
+		m_visionThread.setDaemon(true);
+		m_visionThread.start();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/OI.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/OI.java
new file mode 100644
index 0000000..1f664fe
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/OI.java
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot;
+
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.Autonomous;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.CloseClaw;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.OpenClaw;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.Pickup;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.Place;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.PrepareToPickup;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.SetElevatorSetpoint;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.SetWristSetpoint;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * This class is the glue that binds the controls on the physical operator
+ * interface to the commands and command groups that allow control of the robot.
+ */
+public class OI {
+	private Joystick m_joystick = new Joystick(0);
+
+	public OI() {
+		// Put Some buttons on the SmartDashboard
+		SmartDashboard.putData("Elevator Bottom", new SetElevatorSetpoint(0));
+		SmartDashboard.putData("Elevator Platform", new SetElevatorSetpoint(0.2));
+		SmartDashboard.putData("Elevator Top", new SetElevatorSetpoint(0.3));
+
+		SmartDashboard.putData("Wrist Horizontal", new SetWristSetpoint(0));
+		SmartDashboard.putData("Raise Wrist", new SetWristSetpoint(-45));
+
+		SmartDashboard.putData("Open Claw", new OpenClaw());
+		SmartDashboard.putData("Close Claw", new CloseClaw());
+
+		SmartDashboard.putData("Deliver Soda", new Autonomous());
+
+		// Create some buttons
+		JoystickButton dpadUp = new JoystickButton(m_joystick, 5);
+		JoystickButton dpadRight = new JoystickButton(m_joystick, 6);
+		JoystickButton dpadDown = new JoystickButton(m_joystick, 7);
+		JoystickButton dpadLeft = new JoystickButton(m_joystick, 8);
+		JoystickButton l2 = new JoystickButton(m_joystick, 9);
+		JoystickButton r2 = new JoystickButton(m_joystick, 10);
+		JoystickButton l1 = new JoystickButton(m_joystick, 11);
+		JoystickButton r1 = new JoystickButton(m_joystick, 12);
+
+		// Connect the buttons to commands
+		dpadUp.whenPressed(new SetElevatorSetpoint(0.2));
+		dpadDown.whenPressed(new SetElevatorSetpoint(-0.2));
+		dpadRight.whenPressed(new CloseClaw());
+		dpadLeft.whenPressed(new OpenClaw());
+
+		r1.whenPressed(new PrepareToPickup());
+		r2.whenPressed(new Pickup());
+		l1.whenPressed(new Place());
+		l2.whenPressed(new Autonomous());
+	}
+
+	public Joystick getJoystick() {
+		return m_joystick;
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/Robot.java
new file mode 100644
index 0000000..7ecc808
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/Robot.java
@@ -0,0 +1,108 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.Autonomous;
+import edu.wpi.first.wpilibj.examples.gearsbot.subsystems.Claw;
+import edu.wpi.first.wpilibj.examples.gearsbot.subsystems.DriveTrain;
+import edu.wpi.first.wpilibj.examples.gearsbot.subsystems.Elevator;
+import edu.wpi.first.wpilibj.examples.gearsbot.subsystems.Wrist;
+
+/**
+ * The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the IterativeRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the manifest file in the resource
+ * directory.
+ */
+public class Robot extends IterativeRobot {
+	Command m_autonomousCommand;
+
+	public static DriveTrain m_drivetrain;
+	public static Elevator m_elevator;
+	public static Wrist m_wrist;
+	public static Claw m_claw;
+	public static OI m_oi;
+
+	/**
+	 * This function is run when the robot is first started up and should be
+	 * used for any initialization code.
+	 */
+	@Override
+	public void robotInit() {
+		// Initialize all subsystems
+		m_drivetrain = new DriveTrain();
+		m_elevator = new Elevator();
+		m_wrist = new Wrist();
+		m_claw = new Claw();
+		m_oi = new OI();
+
+		// instantiate the command used for the autonomous period
+		m_autonomousCommand = new Autonomous();
+
+		// Show what command your subsystem is running on the SmartDashboard
+		SmartDashboard.putData(m_drivetrain);
+		SmartDashboard.putData(m_elevator);
+		SmartDashboard.putData(m_wrist);
+		SmartDashboard.putData(m_claw);
+	}
+
+	@Override
+	public void autonomousInit() {
+		m_autonomousCommand.start(); // schedule the autonomous command (example)
+	}
+
+	/**
+	 * This function is called periodically during autonomous.
+	 */
+	@Override
+	public void autonomousPeriodic() {
+		Scheduler.getInstance().run();
+		log();
+	}
+
+	@Override
+	public void teleopInit() {
+		// This makes sure that the autonomous stops running when
+		// teleop starts running. If you want the autonomous to
+		// continue until interrupted by another command, remove
+		// this line or comment it out.
+		m_autonomousCommand.cancel();
+	}
+
+	/**
+	 * This function is called periodically during teleoperated mode.
+	 */
+	@Override
+	public void teleopPeriodic() {
+		Scheduler.getInstance().run();
+		log();
+	}
+
+	/**
+	 * This function is called periodically during test mode.
+	 */
+	@Override
+	public void testPeriodic() {
+	}
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	private void log() {
+		m_wrist.log();
+		m_elevator.log();
+		m_drivetrain.log();
+		m_claw.log();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Autonomous.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Autonomous.java
new file mode 100644
index 0000000..5c3663c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Autonomous.java
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+/**
+ * The main autonomous command to pickup and deliver the soda to the box.
+ */
+public class Autonomous extends CommandGroup {
+	public Autonomous() {
+		addSequential(new PrepareToPickup());
+		addSequential(new Pickup());
+		addSequential(new SetDistanceToBox(0.10));
+		// addSequential(new DriveStraight(4)); // Use Encoders if ultrasonic is
+		// broken
+		addSequential(new Place());
+		addSequential(new SetDistanceToBox(0.60));
+		// addSequential(new DriveStraight(-2)); // Use Encoders if ultrasonic
+		// is broken
+		addParallel(new SetWristSetpoint(-45));
+		addSequential(new CloseClaw());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/CloseClaw.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/CloseClaw.java
new file mode 100644
index 0000000..7b37c9e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/CloseClaw.java
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Closes the claw for one second. Real robots should use sensors, stalling
+ * motors is BAD!
+ */
+public class CloseClaw extends Command {
+	public CloseClaw() {
+		requires(Robot.m_claw);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.m_claw.close();
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.m_claw.isGrabbing();
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+		// NOTE: Doesn't stop in simulation due to lower friction causing the
+		// can to fall out
+		// + there is no need to worry about stalling the motor or crushing the
+		// can.
+		if (!Robot.isSimulation()) {
+			Robot.m_claw.stop();
+		}
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/DriveStraight.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/DriveStraight.java
new file mode 100644
index 0000000..5f16990
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/DriveStraight.java
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.PIDController;
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Drive the given distance straight (negative values go backwards). Uses a
+ * local PID controller to run a simple PID loop that is only enabled while this
+ * command is running. The input is the averaged values of the left and right
+ * encoders.
+ */
+public class DriveStraight extends Command {
+	private PIDController m_pid;
+
+	public DriveStraight(double distance) {
+		requires(Robot.m_drivetrain);
+		m_pid = new PIDController(4, 0, 0, new PIDSource() {
+			PIDSourceType m_sourceType = PIDSourceType.kDisplacement;
+
+			@Override
+			public double pidGet() {
+				return Robot.m_drivetrain.getDistance();
+			}
+
+			@Override
+			public void setPIDSourceType(PIDSourceType pidSource) {
+				m_sourceType = pidSource;
+			}
+
+			@Override
+			public PIDSourceType getPIDSourceType() {
+				return m_sourceType;
+			}
+		}, d -> Robot.m_drivetrain.drive(d, d));
+
+		m_pid.setAbsoluteTolerance(0.01);
+		m_pid.setSetpoint(distance);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		// Get everything in a safe starting state.
+		Robot.m_drivetrain.reset();
+		m_pid.reset();
+		m_pid.enable();
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return m_pid.onTarget();
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+		// Stop PID and the wheels
+		m_pid.disable();
+		Robot.m_drivetrain.drive(0, 0);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/OpenClaw.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/OpenClaw.java
new file mode 100644
index 0000000..e2a6963
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/OpenClaw.java
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.TimedCommand;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Opens the claw for one second. Real robots should use sensors, stalling
+ * motors is BAD!
+ */
+public class OpenClaw extends TimedCommand {
+	public OpenClaw() {
+		super(1);
+		requires(Robot.m_claw);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.m_claw.open();
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+		Robot.m_claw.stop();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Pickup.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Pickup.java
new file mode 100644
index 0000000..e017b20
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Pickup.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+/**
+ * Pickup a soda can (if one is between the open claws) and get it in a safe
+ * state to drive around.
+ */
+public class Pickup extends CommandGroup {
+	public Pickup() {
+		addSequential(new CloseClaw());
+		addParallel(new SetWristSetpoint(-45));
+		addSequential(new SetElevatorSetpoint(0.25));
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Place.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Place.java
new file mode 100644
index 0000000..0b4780c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/Place.java
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+/**
+ * Place a held soda can onto the platform.
+ */
+public class Place extends CommandGroup {
+	public Place() {
+		addSequential(new SetElevatorSetpoint(0.25));
+		addSequential(new SetWristSetpoint(0));
+		addSequential(new OpenClaw());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/PrepareToPickup.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/PrepareToPickup.java
new file mode 100644
index 0000000..94a8742
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/PrepareToPickup.java
@@ -0,0 +1,21 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+/**
+ * Make sure the robot is in a state to pickup soda cans.
+ */
+public class PrepareToPickup extends CommandGroup {
+	public PrepareToPickup() {
+		addParallel(new OpenClaw());
+		addParallel(new SetWristSetpoint(0));
+		addSequential(new SetElevatorSetpoint(0));
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetDistanceToBox.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetDistanceToBox.java
new file mode 100644
index 0000000..944ea56
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetDistanceToBox.java
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.PIDController;
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Drive until the robot is the given distance away from the box. Uses a local
+ * PID controller to run a simple PID loop that is only enabled while this
+ * command is running. The input is the averaged values of the left and right
+ * encoders.
+ */
+public class SetDistanceToBox extends Command {
+	private PIDController m_pid;
+
+	public SetDistanceToBox(double distance) {
+		requires(Robot.m_drivetrain);
+		m_pid = new PIDController(-2, 0, 0, new PIDSource() {
+			PIDSourceType m_sourceType = PIDSourceType.kDisplacement;
+
+			@Override
+			public double pidGet() {
+				return Robot.m_drivetrain.getDistanceToObstacle();
+			}
+
+			@Override
+			public void setPIDSourceType(PIDSourceType pidSource) {
+				m_sourceType = pidSource;
+			}
+
+			@Override
+			public PIDSourceType getPIDSourceType() {
+				return m_sourceType;
+			}
+		}, d -> Robot.m_drivetrain.drive(d, d));
+
+		m_pid.setAbsoluteTolerance(0.01);
+		m_pid.setSetpoint(distance);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		// Get everything in a safe starting state.
+		Robot.m_drivetrain.reset();
+		m_pid.reset();
+		m_pid.enable();
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return m_pid.onTarget();
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+		// Stop PID and the wheels
+		m_pid.disable();
+		Robot.m_drivetrain.drive(0, 0);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetElevatorSetpoint.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetElevatorSetpoint.java
new file mode 100644
index 0000000..7de4ab1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetElevatorSetpoint.java
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Move the elevator to a given location. This command finishes when it is
+ * within the tolerance, but leaves the PID loop running to maintain the
+ * position. Other commands using the elevator should make sure they disable
+ * PID!
+ */
+public class SetElevatorSetpoint extends Command {
+	private double m_setpoint;
+
+	public SetElevatorSetpoint(double setpoint) {
+		m_setpoint = setpoint;
+		requires(Robot.m_elevator);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.m_elevator.enable();
+		Robot.m_elevator.setSetpoint(m_setpoint);
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.m_elevator.onTarget();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetWristSetpoint.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetWristSetpoint.java
new file mode 100644
index 0000000..7c8a744
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/SetWristSetpoint.java
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Move the wrist to a given angle. This command finishes when it is within the
+ * tolerance, but leaves the PID loop running to maintain the position. Other
+ * commands using the wrist should make sure they disable PID!
+ */
+public class SetWristSetpoint extends Command {
+	private double m_setpoint;
+
+	public SetWristSetpoint(double setpoint) {
+		m_setpoint = setpoint;
+		requires(Robot.m_wrist);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.m_wrist.enable();
+		Robot.m_wrist.setSetpoint(m_setpoint);
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.m_wrist.onTarget();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/TankDriveWithJoystick.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/TankDriveWithJoystick.java
new file mode 100644
index 0000000..05d3bd5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/commands/TankDriveWithJoystick.java
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+
+/**
+ * Have the robot drive tank style using the PS3 Joystick until interrupted.
+ */
+public class TankDriveWithJoystick extends Command {
+	public TankDriveWithJoystick() {
+		requires(Robot.m_drivetrain);
+	}
+
+	// Called repeatedly when this Command is scheduled to run
+	@Override
+	protected void execute() {
+		Robot.m_drivetrain.drive(Robot.m_oi.getJoystick());
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return false; // Runs until interrupted
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+		Robot.m_drivetrain.drive(0, 0);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Claw.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Claw.java
new file mode 100644
index 0000000..1618016
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Claw.java
@@ -0,0 +1,66 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.subsystems;
+
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+/**
+ * The claw subsystem is a simple system with a motor for opening and closing.
+ * If using stronger motors, you should probably use a sensor so that the motors
+ * don't stall.
+ */
+public class Claw extends Subsystem {
+	private Victor m_motor = new Victor(7);
+	private DigitalInput m_contact = new DigitalInput(5);
+
+	public Claw() {
+		super();
+
+		// Let's name everything on the LiveWindow
+		addChild("Motor", m_motor);
+		addChild("Limit Switch", m_contact);
+	}
+
+	@Override
+	public void initDefaultCommand() {
+	}
+
+	public void log() {
+	}
+
+	/**
+	 * Set the claw motor to move in the open direction.
+	 */
+	public void open() {
+		m_motor.set(-1);
+	}
+
+	/**
+	 * Set the claw motor to move in the close direction.
+	 */
+	public void close() {
+		m_motor.set(1);
+	}
+
+	/**
+	 * Stops the claw motor from moving.
+	 */
+	public void stop() {
+		m_motor.set(0);
+	}
+
+	/**
+	 * Return true when the robot is grabbing an object hard enough to trigger
+	 * the limit switch.
+	 */
+	public boolean isGrabbing() {
+		return m_contact.get();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/DriveTrain.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/DriveTrain.java
new file mode 100644
index 0000000..022b940
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/DriveTrain.java
@@ -0,0 +1,144 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.subsystems;
+
+import edu.wpi.first.wpilibj.AnalogGyro;
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.Encoder;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.SpeedControllerGroup;
+import edu.wpi.first.wpilibj.command.Subsystem;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+import edu.wpi.first.wpilibj.examples.gearsbot.commands.TankDriveWithJoystick;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * The DriveTrain subsystem incorporates the sensors and actuators attached to
+ * the robots chassis. These include four drive motors, a left and right encoder
+ * and a gyro.
+ */
+public class DriveTrain extends Subsystem {
+	private SpeedController m_leftMotor
+			= new SpeedControllerGroup(new Spark(0), new Spark(1));
+	private SpeedController m_rightMotor
+			= new SpeedControllerGroup(new Spark(2), new Spark(3));
+
+	private DifferentialDrive m_drive
+			= new DifferentialDrive(m_leftMotor, m_rightMotor);
+
+	private Encoder m_leftEncoder = new Encoder(1, 2);
+	private Encoder m_rightEncoder = new Encoder(3, 4);
+	private AnalogInput m_rangefinder = new AnalogInput(6);
+	private AnalogGyro m_gyro = new AnalogGyro(1);
+
+	public DriveTrain() {
+		super();
+
+		// Encoders may measure differently in the real world and in
+		// simulation. In this example the robot moves 0.042 barleycorns
+		// per tick in the real world, but the simulated encoders
+		// simulate 360 tick encoders. This if statement allows for the
+		// real robot to handle this difference in devices.
+		if (Robot.isReal()) {
+			m_leftEncoder.setDistancePerPulse(0.042);
+			m_rightEncoder.setDistancePerPulse(0.042);
+		} else {
+			// Circumference in ft = 4in/12(in/ft)*PI
+			m_leftEncoder.setDistancePerPulse((4.0 / 12.0 * Math.PI) / 360.0);
+			m_rightEncoder.setDistancePerPulse((4.0 / 12.0 * Math.PI) / 360.0);
+		}
+
+		// Let's name the sensors on the LiveWindow
+		addChild("Drive", m_drive);
+		addChild("Left Encoder", m_leftEncoder);
+		addChild("Right Encoder", m_rightEncoder);
+		addChild("Rangefinder", m_rangefinder);
+		addChild("Gyro", m_gyro);
+	}
+
+	/**
+	 * When no other command is running let the operator drive around using the
+	 * PS3 joystick.
+	 */
+	@Override
+	public void initDefaultCommand() {
+		setDefaultCommand(new TankDriveWithJoystick());
+	}
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	public void log() {
+		SmartDashboard.putNumber("Left Distance", m_leftEncoder.getDistance());
+		SmartDashboard.putNumber("Right Distance", m_rightEncoder.getDistance());
+		SmartDashboard.putNumber("Left Speed", m_leftEncoder.getRate());
+		SmartDashboard.putNumber("Right Speed", m_rightEncoder.getRate());
+		SmartDashboard.putNumber("Gyro", m_gyro.getAngle());
+	}
+
+	/**
+	 * Tank style driving for the DriveTrain.
+	 *
+	 * @param left
+	 *            Speed in range [-1,1]
+	 * @param right
+	 *            Speed in range [-1,1]
+	 */
+	public void drive(double left, double right) {
+		m_drive.tankDrive(left, right);
+	}
+
+	/**
+	 * Tank style driving for the DriveTrain.
+	 *
+	 * @param joy The ps3 style joystick to use to drive tank style.
+	 */
+	public void drive(Joystick joy) {
+		drive(-joy.getY(), -joy.getThrottle());
+	}
+
+	/**
+	 * Get the robot's heading.
+	 *
+	 * @return The robots heading in degrees.
+	 */
+	public double getHeading() {
+		return m_gyro.getAngle();
+	}
+
+	/**
+	 * Reset the robots sensors to the zero states.
+	 */
+	public void reset() {
+		m_gyro.reset();
+		m_leftEncoder.reset();
+		m_rightEncoder.reset();
+	}
+
+	/**
+	 * Get the average distance of the encoders since the last reset.
+	 *
+	 * @return The distance driven (average of left and right encoders).
+	 */
+	public double getDistance() {
+		return (m_leftEncoder.getDistance() + m_rightEncoder.getDistance()) / 2;
+	}
+
+	/**
+	 * Get the distance to the obstacle.
+	 *
+	 * @return The distance to the obstacle detected by the rangefinder.
+	 */
+	public double getDistanceToObstacle() {
+		// Really meters in simulation since it's a rangefinder...
+		return m_rangefinder.getAverageVoltage();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Elevator.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Elevator.java
new file mode 100644
index 0000000..a262643
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Elevator.java
@@ -0,0 +1,80 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.subsystems;
+
+import edu.wpi.first.wpilibj.AnalogPotentiometer;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.command.PIDSubsystem;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * The elevator subsystem uses PID to go to a given height. Unfortunately, in
+ * it's current state PID values for simulation are different than in the real
+ * world do to minor differences.
+ */
+public class Elevator extends PIDSubsystem {
+	private Victor m_motor;
+	private AnalogPotentiometer m_pot;
+
+	private static final double kP_real = 4;
+	private static final double kI_real = 0.07;
+	private static final double kP_simulation = 18;
+	private static final double kI_simulation = 0.2;
+
+	public Elevator() {
+		super(kP_real, kI_real, 0);
+		if (Robot.isSimulation()) { // Check for simulation and update PID values
+			getPIDController().setPID(kP_simulation, kI_simulation, 0, 0);
+		}
+		setAbsoluteTolerance(0.005);
+
+		m_motor = new Victor(5);
+
+		// Conversion value of potentiometer varies between the real world and
+		// simulation
+		if (Robot.isReal()) {
+			m_pot = new AnalogPotentiometer(2, -2.0 / 5);
+		} else {
+			m_pot = new AnalogPotentiometer(2); // Defaults to meters
+		}
+
+		// Let's name everything on the LiveWindow
+		addChild("Motor", m_motor);
+		addChild("Pot", m_pot);
+	}
+
+	@Override
+	public void initDefaultCommand() {
+	}
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	public void log() {
+		SmartDashboard.putData("Elevator Pot", (AnalogPotentiometer) m_pot);
+	}
+
+	/**
+	 * Use the potentiometer as the PID sensor. This method is automatically
+	 * called by the subsystem.
+	 */
+	@Override
+	protected double returnPIDInput() {
+		return m_pot.get();
+	}
+
+	/**
+	 * Use the motor as the PID output. This method is automatically called by
+	 * the subsystem.
+	 */
+	@Override
+	protected void usePIDOutput(double power) {
+		m_motor.set(power);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Wrist.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Wrist.java
new file mode 100644
index 0000000..96cc5ed
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gearsbot/subsystems/Wrist.java
@@ -0,0 +1,77 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gearsbot.subsystems;
+
+import edu.wpi.first.wpilibj.AnalogPotentiometer;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.command.PIDSubsystem;
+import edu.wpi.first.wpilibj.examples.gearsbot.Robot;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * The wrist subsystem is like the elevator, but with a rotational joint instead
+ * of a linear joint.
+ */
+public class Wrist extends PIDSubsystem {
+	private Victor m_motor;
+	private AnalogPotentiometer m_pot;
+
+	private static final double kP_real = 1;
+	private static final double kP_simulation = 0.05;
+
+	public Wrist() {
+		super(kP_real, 0, 0);
+		if (Robot.isSimulation()) { // Check for simulation and update PID values
+			getPIDController().setPID(kP_simulation, 0, 0, 0);
+		}
+		setAbsoluteTolerance(2.5);
+
+		m_motor = new Victor(6);
+
+		// Conversion value of potentiometer varies between the real world and
+		// simulation
+		if (Robot.isReal()) {
+			m_pot = new AnalogPotentiometer(3, -270.0 / 5);
+		} else {
+			m_pot = new AnalogPotentiometer(3); // Defaults to degrees
+		}
+
+		// Let's name everything on the LiveWindow
+		addChild("Motor", m_motor);
+		addChild("Pot", m_pot);
+	}
+
+	@Override
+	public void initDefaultCommand() {
+	}
+
+	/**
+	 * The log method puts interesting information to the SmartDashboard.
+	 */
+	public void log() {
+		SmartDashboard.putData("Wrist Angle", (AnalogPotentiometer) m_pot);
+	}
+
+	/**
+	 * Use the potentiometer as the PID sensor. This method is automatically
+	 * called by the subsystem.
+	 */
+	@Override
+	protected double returnPIDInput() {
+		return m_pot.get();
+	}
+
+	/**
+	 * Use the motor as the PID output. This method is automatically called by
+	 * the subsystem.
+	 */
+	@Override
+	protected void usePIDOutput(double power) {
+		m_motor.set(power);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gettingstarted/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gettingstarted/Robot.java
new file mode 100644
index 0000000..3ddb6e5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gettingstarted/Robot.java
@@ -0,0 +1,80 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gettingstarted;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+
+/**
+ * The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the IterativeRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the manifest file in the resource
+ * directory.
+ */
+public class Robot extends IterativeRobot {
+	private DifferentialDrive m_robotDrive
+			= new DifferentialDrive(new Spark(0), new Spark(1));
+	private Joystick m_stick = new Joystick(0);
+	private Timer m_timer = new Timer();
+
+	/**
+	 * This function is run when the robot is first started up and should be
+	 * used for any initialization code.
+	 */
+	@Override
+	public void robotInit() {
+	}
+
+	/**
+	 * This function is run once each time the robot enters autonomous mode.
+	 */
+	@Override
+	public void autonomousInit() {
+		m_timer.reset();
+		m_timer.start();
+	}
+
+	/**
+	 * This function is called periodically during autonomous.
+	 */
+	@Override
+	public void autonomousPeriodic() {
+		// Drive for 2 seconds
+		if (m_timer.get() < 2.0) {
+			m_robotDrive.arcadeDrive(0.5, 0.0); // drive forwards half speed
+		} else {
+			m_robotDrive.stopMotor(); // stop robot
+		}
+	}
+
+	/**
+	 * This function is called once each time the robot enters teleoperated mode.
+	 */
+	@Override
+	public void teleopInit() {
+	}
+
+	/**
+	 * This function is called periodically during teleoperated mode.
+	 */
+	@Override
+	public void teleopPeriodic() {
+		m_robotDrive.arcadeDrive(m_stick.getY(), m_stick.getX());
+	}
+
+	/**
+	 * This function is called periodically during test mode.
+	 */
+	@Override
+	public void testPeriodic() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java
new file mode 100644
index 0000000..f22264b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyro/Robot.java
@@ -0,0 +1,56 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gyro;
+
+import edu.wpi.first.wpilibj.AnalogGyro;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+
+/**
+ * This is a sample program to demonstrate how to use a gyro sensor to make a
+ * robot drive straight. This program uses a joystick to drive forwards and
+ * backwards while the gyro is used for direction keeping.
+ */
+public class Robot extends IterativeRobot {
+	private static final double kAngleSetpoint = 0.0;
+	private static final double kP = 0.005; // propotional turning constant
+
+	// gyro calibration constant, may need to be adjusted;
+	// gyro value of 360 is set to correspond to one full revolution
+	private static final double kVoltsPerDegreePerSecond = 0.0128;
+
+	private static final int kLeftMotorPort = 0;
+	private static final int kRightMotorPort = 1;
+	private static final int kGyroPort = 0;
+	private static final int kJoystickPort = 0;
+
+	private DifferentialDrive m_myRobot
+			= new DifferentialDrive(new Spark(kLeftMotorPort),
+			new Spark(kRightMotorPort));
+	private AnalogGyro m_gyro = new AnalogGyro(kGyroPort);
+	private Joystick m_joystick = new Joystick(kJoystickPort);
+
+	@Override
+	public void robotInit() {
+		m_gyro.setSensitivity(kVoltsPerDegreePerSecond);
+	}
+
+	/**
+	 * The motor speed is set from the joystick while the RobotDrive turning
+	 * value is assigned from the error between the setpoint and the gyro angle.
+	 */
+	@Override
+	public void teleopPeriodic() {
+		double turningValue = (kAngleSetpoint - m_gyro.getAngle()) * kP;
+		// Invert the direction of the turn if we are going backwards
+		turningValue = Math.copySign(turningValue, m_joystick.getY());
+		m_myRobot.arcadeDrive(m_joystick.getY(), turningValue);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyromecanum/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyromecanum/Robot.java
new file mode 100644
index 0000000..7cc115f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/gyromecanum/Robot.java
@@ -0,0 +1,62 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.gyromecanum;
+
+import edu.wpi.first.wpilibj.AnalogGyro;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.drive.MecanumDrive;
+
+/**
+ * This is a sample program that uses mecanum drive with a gyro sensor to
+ * maintian rotation vectorsin relation to the starting orientation of the robot
+ * (field-oriented controls).
+ */
+public class Robot extends IterativeRobot {
+	// gyro calibration constant, may need to be adjusted;
+	// gyro value of 360 is set to correspond to one full revolution
+	private static final double kVoltsPerDegreePerSecond = 0.0128;
+
+	private static final int kFrontLeftChannel = 0;
+	private static final int kRearLeftChannel = 1;
+	private static final int kFrontRightChannel = 2;
+	private static final int kRearRightChannel = 3;
+	private static final int kGyroPort = 0;
+	private static final int kJoystickPort = 0;
+
+	private MecanumDrive m_robotDrive;
+	private AnalogGyro m_gyro = new AnalogGyro(kGyroPort);
+	private Joystick m_joystick = new Joystick(kJoystickPort);
+
+	@Override
+	public void robotInit() {
+		Spark frontLeft = new Spark(kFrontLeftChannel);
+		Spark rearLeft = new Spark(kRearLeftChannel);
+		Spark frontRight = new Spark(kFrontRightChannel);
+		Spark rearRight = new Spark(kRearRightChannel);
+
+		// Invert the left side motors.
+		// You may need to change or remove this to match your robot.
+		frontLeft.setInverted(true);
+		rearLeft.setInverted(true);
+
+		m_robotDrive = new MecanumDrive(frontLeft, rearLeft, frontRight, rearRight);
+
+		m_gyro.setSensitivity(kVoltsPerDegreePerSecond);
+	}
+
+	/**
+	 * Mecanum drive is used with the gyro angle as an input.
+	 */
+	@Override
+	public void teleopPeriodic() {
+		m_robotDrive.driveCartesian(m_joystick.getX(), m_joystick.getY(),
+				m_joystick.getZ(), m_gyro.getAngle());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/intermediatevision/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/intermediatevision/Robot.java
new file mode 100644
index 0000000..738a3ea
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/intermediatevision/Robot.java
@@ -0,0 +1,68 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.intermediatevision;
+
+import edu.wpi.cscore.CvSink;
+import edu.wpi.cscore.CvSource;
+import edu.wpi.cscore.UsbCamera;
+import edu.wpi.first.wpilibj.CameraServer;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import org.opencv.core.Mat;
+import org.opencv.core.Point;
+import org.opencv.core.Scalar;
+import org.opencv.imgproc.Imgproc;
+
+/**
+ * This is a demo program showing the use of OpenCV to do vision processing. The
+ * image is acquired from the USB camera, then a rectangle is put on the image
+ * and sent to the dashboard. OpenCV has many methods for different types of
+ * processing.
+ */
+public class Robot extends IterativeRobot {
+	Thread m_visionThread;
+
+	@Override
+	public void robotInit() {
+		m_visionThread = new Thread(() -> {
+			// Get the UsbCamera from CameraServer
+			UsbCamera camera = CameraServer.getInstance().startAutomaticCapture();
+			// Set the resolution
+			camera.setResolution(640, 480);
+
+			// Get a CvSink. This will capture Mats from the camera
+			CvSink cvSink = CameraServer.getInstance().getVideo();
+			// Setup a CvSource. This will send images back to the Dashboard
+			CvSource outputStream
+					= CameraServer.getInstance().putVideo("Rectangle", 640, 480);
+
+			// Mats are very memory expensive. Lets reuse this Mat.
+			Mat mat = new Mat();
+
+			// This cannot be 'true'. The program will never exit if it is. This
+			// lets the robot stop this thread when restarting robot code or
+			// deploying.
+			while (!Thread.interrupted()) {
+				// Tell the CvSink to grab a frame from the camera and put it
+				// in the source mat.  If there is an error notify the output.
+				if (cvSink.grabFrame(mat) == 0) {
+					// Send the output the error.
+					outputStream.notifyError(cvSink.getError());
+					// skip the rest of the current iteration
+					continue;
+				}
+				// Put a rectangle on the image
+				Imgproc.rectangle(mat, new Point(100, 100), new Point(400, 400),
+						new Scalar(255, 255, 255), 5);
+				// Give the output stream a new image to display
+				outputStream.putFrame(mat);
+			}
+		});
+		m_visionThread.setDaemon(true);
+		m_visionThread.start();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumdrive/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumdrive/Robot.java
new file mode 100755
index 0000000..20076ae
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumdrive/Robot.java
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.mecanumdrive;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.drive.MecanumDrive;
+
+/**
+ * This is a demo program showing how to use Mecanum control with the RobotDrive
+ * class.
+ */
+public class Robot extends IterativeRobot {
+	private static final int kFrontLeftChannel = 2;
+	private static final int kRearLeftChannel = 3;
+	private static final int kFrontRightChannel = 1;
+	private static final int kRearRightChannel = 0;
+
+	private static final int kJoystickChannel = 0;
+
+	private MecanumDrive m_robotDrive;
+	private Joystick m_stick;
+
+	@Override
+	public void robotInit() {
+		Spark frontLeft = new Spark(kFrontLeftChannel);
+		Spark rearLeft = new Spark(kRearLeftChannel);
+		Spark frontRight = new Spark(kFrontRightChannel);
+		Spark rearRight = new Spark(kRearRightChannel);
+
+		// Invert the left side motors.
+		// You may need to change or remove this to match your robot.
+		frontLeft.setInverted(true);
+		rearLeft.setInverted(true);
+
+		m_robotDrive = new MecanumDrive(frontLeft, rearLeft, frontRight, rearRight);
+
+		m_stick = new Joystick(kJoystickChannel);
+	}
+
+	@Override
+	public void teleopPeriodic() {
+		// Use the joystick X axis for lateral movement, Y axis for forward
+		// movement, and Z axis for rotation.
+		m_robotDrive.driveCartesian(m_stick.getX(), m_stick.getY(),
+				m_stick.getZ(), 0.0);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/motorcontrol/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/motorcontrol/Robot.java
new file mode 100755
index 0000000..9811eab
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/motorcontrol/Robot.java
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.motorcontrol;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.Spark;
+
+/**
+ * This sample program shows how to control a motor using a joystick. In the
+ * operator control part of the program, the joystick is read and the value is
+ * written to the motor.
+ *
+ * <p>Joystick analog values range from -1 to 1 and speed controller inputs also
+ * range from -1 to 1 making it easy to work together.
+ */
+public class Robot extends IterativeRobot {
+	private static final int kMotorPort = 0;
+	private static final int kJoystickPort = 0;
+
+	private SpeedController m_motor;
+	private Joystick m_joystick;
+
+	@Override
+	public void robotInit() {
+		m_motor = new Spark(kMotorPort);
+		m_joystick = new Joystick(kJoystickPort);
+	}
+
+	@Override
+	public void teleopPeriodic() {
+		m_motor.set(m_joystick.getY());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/OI.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/OI.java
new file mode 100644
index 0000000..d66e012
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/OI.java
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.Collect;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.DriveForward;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.LowGoal;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.SetCollectionSpeed;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.SetPivotSetpoint;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.Shoot;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
+import edu.wpi.first.wpilibj.examples.pacgoat.triggers.DoubleButton;
+
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * The operator interface of the robot, it has been simplified from the real
+ * robot to allow control with a single PS3 joystick. As a result, not all
+ * functionality from the real robot is available.
+ */
+public class OI {
+	public Joystick m_joystick = new Joystick(0);
+
+	public OI() {
+		new JoystickButton(m_joystick, 12).whenPressed(new LowGoal());
+		new JoystickButton(m_joystick, 10).whenPressed(new Collect());
+
+		new JoystickButton(m_joystick, 11).whenPressed(
+				new SetPivotSetpoint(Pivot.kShoot));
+		new JoystickButton(m_joystick, 9).whenPressed(
+				new SetPivotSetpoint(Pivot.kShootNear));
+
+		new DoubleButton(m_joystick, 2, 3).whenActive(new Shoot());
+
+		// SmartDashboard Buttons
+		SmartDashboard.putData("Drive Forward", new DriveForward(2.25));
+		SmartDashboard.putData("Drive Backward", new DriveForward(-2.25));
+		SmartDashboard.putData("Start Rollers",
+				new SetCollectionSpeed(Collector.kForward));
+		SmartDashboard.putData("Stop Rollers",
+				new SetCollectionSpeed(Collector.kStop));
+		SmartDashboard.putData("Reverse Rollers",
+				new SetCollectionSpeed(Collector.kReverse));
+	}
+
+	public Joystick getJoystick() {
+		return m_joystick;
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/Robot.java
new file mode 100644
index 0000000..6de3eb3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/Robot.java
@@ -0,0 +1,128 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.DriveAndShootAutonomous;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.DriveForward;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.DriveTrain;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pneumatics;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Shooter;
+
+/**
+ * This is the main class for running the PacGoat code.
+ *
+ * <p>The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the IterativeRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the manifest file in the resource
+ * directory.
+ */
+public class Robot extends IterativeRobot {
+	Command m_autonomousCommand;
+	public static OI oi;
+
+	// Initialize the subsystems
+	public static DriveTrain drivetrain = new DriveTrain();
+	public static Collector collector = new Collector();
+	public static Shooter shooter = new Shooter();
+	public static Pneumatics pneumatics = new Pneumatics();
+	public static Pivot pivot = new Pivot();
+
+	public SendableChooser<Command> m_autoChooser;
+
+	// This function is run when the robot is first started up and should be
+	// used for any initialization code.
+	@Override
+	public void robotInit() {
+		SmartDashboard.putData(drivetrain);
+		SmartDashboard.putData(collector);
+		SmartDashboard.putData(shooter);
+		SmartDashboard.putData(pneumatics);
+		SmartDashboard.putData(pivot);
+
+		// This MUST be here. If the OI creates Commands (which it very likely
+		// will), constructing it during the construction of CommandBase (from
+		// which commands extend), subsystems are not guaranteed to be
+		// yet. Thus, their requires() statements may grab null pointers. Bad
+		// news. Don't move it.
+		oi = new OI();
+
+		// instantiate the command used for the autonomous period
+		m_autoChooser = new SendableChooser<Command>();
+		m_autoChooser.addDefault("Drive and Shoot", new DriveAndShootAutonomous());
+		m_autoChooser.addObject("Drive Forward", new DriveForward());
+		SmartDashboard.putData("Auto Mode", m_autoChooser);
+	}
+
+	@Override
+	public void autonomousInit() {
+		m_autonomousCommand = (Command) m_autoChooser.getSelected();
+		m_autonomousCommand.start();
+	}
+
+	// This function is called periodically during autonomous
+	@Override
+	public void autonomousPeriodic() {
+		Scheduler.getInstance().run();
+		log();
+	}
+
+	@Override
+	public void teleopInit() {
+		// This makes sure that the autonomous stops running when
+		// teleop starts running. If you want the autonomous to
+		// continue until interrupted by another command, remove
+		// this line or comment it out.
+		if (m_autonomousCommand != null) {
+			m_autonomousCommand.cancel();
+		}
+	}
+
+	// This function is called periodically during operator control
+	@Override
+	public void teleopPeriodic() {
+		Scheduler.getInstance().run();
+		log();
+	}
+
+	// This function called periodically during test mode
+	@Override
+	public void testPeriodic() {
+	}
+
+	@Override
+	public void disabledInit() {
+		Robot.shooter.unlatch();
+	}
+
+	// This function is called periodically while disabled
+	@Override
+	public void disabledPeriodic() {
+		log();
+	}
+
+	/**
+	 * Log interesting values to the SmartDashboard.
+	 */
+	private void log() {
+		Robot.pneumatics.writePressure();
+		SmartDashboard.putNumber("Pivot Pot Value", Robot.pivot.getAngle());
+		SmartDashboard.putNumber("Left Distance",
+				drivetrain.getLeftEncoder().getDistance());
+		SmartDashboard.putNumber("Right Distance",
+				drivetrain.getRightEncoder().getDistance());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/CheckForHotGoal.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/CheckForHotGoal.java
new file mode 100644
index 0000000..16d4c8b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/CheckForHotGoal.java
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * This command looks for the hot goal and waits until it's detected or timed
+ * out. The timeout is because it's better to shoot and get some autonomous
+ * points than get none. When called sequentially, this command will block until
+ * the hot goal is detected or until it is timed out.
+ */
+public class CheckForHotGoal extends Command {
+	public CheckForHotGoal(double time) {
+		setTimeout(time);
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return isTimedOut() || Robot.shooter.goalIsHot();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/CloseClaw.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/CloseClaw.java
new file mode 100644
index 0000000..251e756
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/CloseClaw.java
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.InstantCommand;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Close the claw.
+ *
+ * <p>NOTE: It doesn't wait for the claw to close since there is no sensor to
+ * detect that.
+ */
+public class CloseClaw extends InstantCommand {
+	public CloseClaw() {
+		requires(Robot.collector);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.collector.close();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/Collect.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/Collect.java
new file mode 100644
index 0000000..21d9f35
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/Collect.java
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
+
+/**
+ * Get the robot set to collect balls.
+ */
+public class Collect extends CommandGroup {
+	public Collect() {
+		addSequential(new SetCollectionSpeed(Collector.kForward));
+		addParallel(new CloseClaw());
+		addSequential(new SetPivotSetpoint(Pivot.kCollect));
+		addSequential(new WaitForBall());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveAndShootAutonomous.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveAndShootAutonomous.java
new file mode 100644
index 0000000..fcce7ed
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveAndShootAutonomous.java
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Drive over the line and then shoot the ball. If the hot goal is not detected,
+ * it will wait briefly.
+ */
+public class DriveAndShootAutonomous extends CommandGroup {
+	public DriveAndShootAutonomous() {
+		addSequential(new CloseClaw());
+		addSequential(new WaitForPressure(), 2);
+		if (Robot.isReal()) {
+			// NOTE: Simulation doesn't currently have the concept of hot.
+			addSequential(new CheckForHotGoal(2));
+		}
+		addSequential(new SetPivotSetpoint(45));
+		addSequential(new DriveForward(8, 0.3));
+		addSequential(new Shoot());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveForward.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveForward.java
new file mode 100644
index 0000000..8562607
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveForward.java
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * This command drives the robot over a given distance with simple proportional
+ * control This command will drive a given distance limiting to a maximum speed.
+ */
+public class DriveForward extends Command {
+	private double m_driveForwardSpeed;
+	private double m_distance;
+	private double m_error;
+	private static final double kTolerance = 0.1;
+	private static final double kP = -1.0 / 5.0;
+
+	public DriveForward() {
+		this(10, 0.5);
+	}
+
+	public DriveForward(double dist) {
+		this(dist, 0.5);
+	}
+
+	public DriveForward(double dist, double maxSpeed) {
+		requires(Robot.drivetrain);
+		m_distance = dist;
+		m_driveForwardSpeed = maxSpeed;
+	}
+
+	@Override
+	protected void initialize() {
+		Robot.drivetrain.getRightEncoder().reset();
+		setTimeout(2);
+	}
+
+	@Override
+	protected void execute() {
+		m_error = m_distance - Robot.drivetrain.getRightEncoder().getDistance();
+		if (m_driveForwardSpeed * kP * m_error >= m_driveForwardSpeed) {
+			Robot.drivetrain.tankDrive(m_driveForwardSpeed, m_driveForwardSpeed);
+		} else {
+			Robot.drivetrain.tankDrive(m_driveForwardSpeed * kP * m_error,
+					m_driveForwardSpeed * kP * m_error);
+		}
+	}
+
+	@Override
+	protected boolean isFinished() {
+		return Math.abs(m_error) <= kTolerance || isTimedOut();
+	}
+
+	@Override
+	protected void end() {
+		Robot.drivetrain.stop();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveWithJoystick.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveWithJoystick.java
new file mode 100644
index 0000000..580fc8a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/DriveWithJoystick.java
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * This command allows PS3 joystick to drive the robot. It is always running
+ * except when interrupted by another command.
+ */
+public class DriveWithJoystick extends Command {
+	public DriveWithJoystick() {
+		requires(Robot.drivetrain);
+	}
+
+	@Override
+	protected void execute() {
+		Robot.drivetrain.tankDrive(Robot.oi.getJoystick());
+	}
+
+	@Override
+	protected boolean isFinished() {
+		return false;
+	}
+
+	@Override
+	protected void end() {
+		Robot.drivetrain.stop();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/ExtendShooter.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/ExtendShooter.java
new file mode 100644
index 0000000..07857ce
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/ExtendShooter.java
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.TimedCommand;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Extend the shooter and then retract it after a second.
+ */
+public class ExtendShooter extends TimedCommand {
+	public ExtendShooter() {
+		super(1);
+		requires(Robot.shooter);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.shooter.extendBoth();
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+		Robot.shooter.retractBoth();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/LowGoal.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/LowGoal.java
new file mode 100644
index 0000000..bb5247c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/LowGoal.java
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Pivot;
+
+/**
+ * Spit the ball out into the low goal assuming that the robot is in front of
+ * it.
+ */
+public class LowGoal extends CommandGroup {
+	public LowGoal() {
+		addSequential(new SetPivotSetpoint(Pivot.kLowGoal));
+		addSequential(new SetCollectionSpeed(Collector.kReverse));
+		addSequential(new ExtendShooter());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/OpenClaw.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/OpenClaw.java
new file mode 100644
index 0000000..ef9e72a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/OpenClaw.java
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Opens the claw.
+ */
+public class OpenClaw extends Command {
+	public OpenClaw() {
+		requires(Robot.collector);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.collector.open();
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.collector.isOpen();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/SetCollectionSpeed.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/SetCollectionSpeed.java
new file mode 100644
index 0000000..28a6986
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/SetCollectionSpeed.java
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.InstantCommand;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * This command sets the collector rollers spinning at the given speed. Since
+ * there is no sensor for detecting speed, it finishes immediately. As a result,
+ * the spinners may still be adjusting their speed.
+ */
+public class SetCollectionSpeed extends InstantCommand {
+	private double m_speed;
+
+	public SetCollectionSpeed(double speed) {
+		requires(Robot.collector);
+		this.m_speed = speed;
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.collector.setSpeed(m_speed);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/SetPivotSetpoint.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/SetPivotSetpoint.java
new file mode 100644
index 0000000..5873eb1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/SetPivotSetpoint.java
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Moves the pivot to a given angle. This command finishes when it is within the
+ * tolerance, but leaves the PID loop running to maintain the position. Other
+ * commands using the pivot should make sure they disable PID!
+ */
+public class SetPivotSetpoint extends Command {
+	private double m_setpoint;
+
+	public SetPivotSetpoint(double setpoint) {
+		this.m_setpoint = setpoint;
+		requires(Robot.pivot);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+		Robot.pivot.enable();
+		Robot.pivot.setSetpoint(m_setpoint);
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.pivot.onTarget();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/Shoot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/Shoot.java
new file mode 100644
index 0000000..ba7477f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/Shoot.java
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.subsystems.Collector;
+
+/**
+ * Shoot the ball at the current angle.
+ */
+public class Shoot extends CommandGroup {
+	public Shoot() {
+		addSequential(new WaitForPressure());
+		addSequential(new SetCollectionSpeed(Collector.kStop));
+		addSequential(new OpenClaw());
+		addSequential(new ExtendShooter());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/WaitForBall.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/WaitForBall.java
new file mode 100644
index 0000000..4a27abb
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/WaitForBall.java
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Wait until the collector senses that it has the ball. This command does
+ * nothing and is intended to be used in command groups to wait for this
+ * condition.
+ */
+public class WaitForBall extends Command {
+	public WaitForBall() {
+		requires(Robot.collector);
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.collector.hasBall();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/WaitForPressure.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/WaitForPressure.java
new file mode 100644
index 0000000..14d03a4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/commands/WaitForPressure.java
@@ -0,0 +1,28 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * Wait until the pneumatics are fully pressurized. This command does nothing
+ * and is intended to be used in command groups to wait for this condition.
+ */
+public class WaitForPressure extends Command {
+	public WaitForPressure() {
+		requires(Robot.pneumatics);
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return Robot.pneumatics.isPressurized();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Collector.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Collector.java
new file mode 100644
index 0000000..70b2827
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Collector.java
@@ -0,0 +1,99 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.subsystems;
+
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.Solenoid;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+/**
+ * The Collector subsystem has one motor for the rollers, a limit switch for
+ * ball detection, a piston for opening and closing the claw, and a reed switch
+ * to check if the piston is open.
+ */
+public class Collector extends Subsystem {
+	// Constants for some useful speeds
+	public static final double kForward = 1;
+	public static final double kStop = 0;
+	public static final double kReverse = -1;
+
+	// Subsystem devices
+	private SpeedController m_rollerMotor = new Victor(6);
+	private DigitalInput m_ballDetector = new DigitalInput(10);
+	private DigitalInput m_openDetector = new DigitalInput(6);
+	private Solenoid m_piston = new Solenoid(1, 1);
+
+	public Collector() {
+		// Put everything to the LiveWindow for testing.
+		addChild("Roller Motor", (Victor) m_rollerMotor);
+		addChild("Ball Detector", m_ballDetector);
+		addChild("Claw Open Detector", m_openDetector);
+		addChild("Piston", m_piston);
+	}
+
+	/**
+	 * Whether or not the robot has the ball.
+	 *
+	 * <p>NOTE: The current simulation model uses the the lower part of the claw
+	 * since the limit switch wasn't exported. At some point, this will be
+	 * updated.
+	 *
+	 * @return Whether or not the robot has the ball.
+	 */
+	public boolean hasBall() {
+		return m_ballDetector.get(); // TODO: prepend ! to reflect real robot
+	}
+
+	/**
+	 * Set the speed to spin the collector rollers.
+	 *
+	 * @param speed The speed to spin the rollers.
+	 */
+	public void setSpeed(double speed) {
+		m_rollerMotor.set(-speed);
+	}
+
+	/**
+	 * Stop the rollers from spinning.
+	 */
+	public void stop() {
+		m_rollerMotor.set(0);
+	}
+
+	/**
+	 * Wether or not the claw is open.
+	 *
+	 * @return Whether or not the claw is open.
+	 */
+	public boolean isOpen() {
+		return m_openDetector.get(); // TODO: prepend ! to reflect real robot
+	}
+
+	/**
+	 * Open the claw up (For shooting).
+	 */
+	public void open() {
+		m_piston.set(true);
+	}
+
+	/**
+	 * Close the claw (For collecting and driving).
+	 */
+	public void close() {
+		m_piston.set(false);
+	}
+
+	/**
+	 * No default command.
+	 */
+	@Override
+	protected void initDefaultCommand() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/DriveTrain.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/DriveTrain.java
new file mode 100644
index 0000000..9b34267
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/DriveTrain.java
@@ -0,0 +1,140 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.subsystems;
+
+import edu.wpi.first.wpilibj.AnalogGyro;
+import edu.wpi.first.wpilibj.CounterBase.EncodingType;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+import edu.wpi.first.wpilibj.Encoder;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.SpeedControllerGroup;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+import edu.wpi.first.wpilibj.examples.pacgoat.commands.DriveWithJoystick;
+
+/**
+ * The DriveTrain subsystem controls the robot's chassis and reads in
+ * information about it's speed and position.
+ */
+public class DriveTrain extends Subsystem {
+	// Subsystem devices
+	private SpeedController m_frontLeftCIM = new Victor(1);
+	private SpeedController m_frontRightCIM = new Victor(2);
+	private SpeedController m_rearLeftCIM = new Victor(3);
+	private SpeedController m_rearRightCIM = new Victor(4);
+	private SpeedControllerGroup m_leftCIMs = new SpeedControllerGroup(
+			m_frontLeftCIM, m_rearLeftCIM);
+	private SpeedControllerGroup m_rightCIMs = new SpeedControllerGroup(
+			m_frontRightCIM, m_rearRightCIM);
+	private DifferentialDrive m_drive;
+	private Encoder m_rightEncoder = new Encoder(1, 2, true, EncodingType.k4X);
+	private Encoder m_leftEncoder = new Encoder(3, 4, false, EncodingType.k4X);
+	private AnalogGyro m_gyro = new AnalogGyro(2);
+
+	public DriveTrain() {
+		// Configure drive motors
+		addChild("Front Left CIM", (Victor) m_frontLeftCIM);
+		addChild("Front Right CIM", (Victor) m_frontRightCIM);
+		addChild("Back Left CIM", (Victor) m_rearLeftCIM);
+		addChild("Back Right CIM", (Victor) m_rearRightCIM);
+
+		// Configure the DifferentialDrive to reflect the fact that all motors
+		// are wired backwards (right is inverted in DifferentialDrive).
+		m_leftCIMs.setInverted(true);
+		m_drive = new DifferentialDrive(m_leftCIMs, m_rightCIMs);
+		m_drive.setSafetyEnabled(true);
+		m_drive.setExpiration(0.1);
+		m_drive.setMaxOutput(1.0);
+
+		// Configure encoders
+		m_rightEncoder.setPIDSourceType(PIDSourceType.kDisplacement);
+		m_leftEncoder.setPIDSourceType(PIDSourceType.kDisplacement);
+
+		if (Robot.isReal()) { // Converts to feet
+			m_rightEncoder.setDistancePerPulse(0.0785398);
+			m_leftEncoder.setDistancePerPulse(0.0785398);
+		} else {
+			// Convert to feet 4in diameter wheels with 360 tick sim encoders
+			m_rightEncoder.setDistancePerPulse(
+					(4.0/* in */ * Math.PI) / (360.0 * 12.0/* in/ft */));
+			m_leftEncoder.setDistancePerPulse(
+					(4.0/* in */ * Math.PI) / (360.0 * 12.0/* in/ft */));
+		}
+
+		addChild("Right Encoder", m_rightEncoder);
+		addChild("Left Encoder", m_leftEncoder);
+
+		// Configure gyro
+		if (Robot.isReal()) {
+			m_gyro.setSensitivity(0.007); // TODO: Handle more gracefully?
+		}
+		addChild("Gyro", m_gyro);
+	}
+
+	/**
+	 * When other commands aren't using the drivetrain, allow tank drive with
+	 * the joystick.
+	 */
+	@Override
+	public void initDefaultCommand() {
+		setDefaultCommand(new DriveWithJoystick());
+	}
+
+	/**
+	 * Tank drive using a PS3 joystick.
+	 *
+	 * @param joy PS3 style joystick to use as the input for tank drive.
+	 */
+	public void tankDrive(Joystick joy) {
+		m_drive.tankDrive(joy.getY(), joy.getRawAxis(4));
+	}
+
+	/**
+	 * Tank drive using individual joystick axes.
+	 *
+	 * @param leftAxis Left sides value
+	 * @param rightAxis Right sides value
+	 */
+	public void tankDrive(double leftAxis, double rightAxis) {
+		m_drive.tankDrive(leftAxis, rightAxis);
+	}
+
+	/**
+	 * Stop the drivetrain from moving.
+	 */
+	public void stop() {
+		m_drive.tankDrive(0, 0);
+	}
+
+	/**
+	 * The encoder getting the distance and speed of left side of the
+	 * drivetrain.
+	 */
+	public Encoder getLeftEncoder() {
+		return m_leftEncoder;
+	}
+
+	/**
+	 * The encoder getting the distance and speed of right side of the
+	 * drivetrain.
+	 */
+	public Encoder getRightEncoder() {
+		return m_rightEncoder;
+	}
+
+	/**
+	 * The current angle of the drivetrain as measured by the Gyro.
+	 */
+	public double getAngle() {
+		return m_gyro.getAngle();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Pivot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Pivot.java
new file mode 100644
index 0000000..be2199d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Pivot.java
@@ -0,0 +1,104 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.subsystems;
+
+import edu.wpi.first.wpilibj.AnalogPotentiometer;
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.command.PIDSubsystem;
+import edu.wpi.first.wpilibj.interfaces.Potentiometer;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * The Pivot subsystem contains the Van-door motor and the pot for PID control
+ * of angle of the pivot and claw.
+ */
+public class Pivot extends PIDSubsystem {
+	// Constants for some useful angles
+	public static final double kCollect = 105;
+	public static final double kLowGoal = 90;
+	public static final double kShoot = 45;
+	public static final double kShootNear = 30;
+
+	// Sensors for measuring the position of the pivot.
+	private DigitalInput m_upperLimitSwitch = new DigitalInput(13);
+	private DigitalInput m_lowerLimitSwitch = new DigitalInput(12);
+
+	// 0 degrees is vertical facing up.
+	// Angle increases the more forward the pivot goes.
+	private Potentiometer m_pot = new AnalogPotentiometer(1);
+
+	// Motor to move the pivot.
+	private SpeedController m_motor = new Victor(5);
+
+	public Pivot() {
+		super("Pivot", 7.0, 0.0, 8.0);
+		setAbsoluteTolerance(0.005);
+		getPIDController().setContinuous(false);
+		if (Robot.isSimulation()) { // PID is different in simulation.
+			getPIDController().setPID(0.5, 0.001, 2);
+			setAbsoluteTolerance(5);
+		}
+
+		// Put everything to the LiveWindow for testing.
+		addChild("Upper Limit Switch", m_upperLimitSwitch);
+		addChild("Lower Limit Switch", m_lowerLimitSwitch);
+		addChild("Pot", (AnalogPotentiometer) m_pot);
+		addChild("Motor", (Victor) m_motor);
+		addChild("PIDSubsystem Controller", getPIDController());
+	}
+
+	/**
+	 * No default command, if PID is enabled, the current setpoint will be
+	 * maintained.
+	 */
+	@Override
+	public void initDefaultCommand() {
+	}
+
+	/**
+	 * The angle read in by the potentiometer.
+	 */
+	@Override
+	protected double returnPIDInput() {
+		return m_pot.get();
+	}
+
+	/**
+	 * Set the motor speed based off of the PID output.
+	 */
+	@Override
+	protected void usePIDOutput(double output) {
+		m_motor.pidWrite(output);
+	}
+
+	/**
+	 * If the pivot is at its upper limit.
+	 */
+	public boolean isAtUpperLimit() {
+		// TODO: inverted from real robot (prefix with !)
+		return m_upperLimitSwitch.get();
+	}
+
+	/**
+	 * If the pivot is at its lower limit.
+	 */
+	public boolean isAtLowerLimit() {
+		// TODO: inverted from real robot (prefix with !)
+		return m_lowerLimitSwitch.get();
+	}
+
+	/**
+	 * The current angle of the pivot.
+	 */
+	public double getAngle() {
+		return m_pot.get();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Pneumatics.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Pneumatics.java
new file mode 100644
index 0000000..61fc155
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Pneumatics.java
@@ -0,0 +1,55 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.subsystems;
+
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.command.Subsystem;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+import edu.wpi.first.wpilibj.examples.pacgoat.Robot;
+
+/**
+ * The Pneumatics subsystem contains a pressure sensor.
+ *
+ * <p>NOTE: The simulator currently doesn't support the compressor or pressure
+ * sensors.
+ */
+public class Pneumatics extends Subsystem {
+	AnalogInput m_pressureSensor = new AnalogInput(3);
+
+	private static final double kMaxPressure = 2.55;
+
+	public Pneumatics() {
+		addChild("Pressure Sensor", m_pressureSensor);
+	}
+
+	/**
+	 * No default command.
+	 */
+	@Override
+	public void initDefaultCommand() {
+	}
+
+	/**
+	 * Whether or not the system is fully pressurized.
+	 */
+	public boolean isPressurized() {
+		if (Robot.isReal()) {
+			return kMaxPressure <= m_pressureSensor.getVoltage();
+		} else {
+			return true; // NOTE: Simulation always has full pressure
+		}
+	}
+
+	/**
+	 * Puts the pressure on the SmartDashboard.
+	 */
+	public void writePressure() {
+		SmartDashboard.putNumber("Pressure", m_pressureSensor.getVoltage());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Shooter.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Shooter.java
new file mode 100644
index 0000000..57b5ab2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/subsystems/Shooter.java
@@ -0,0 +1,173 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.subsystems;
+
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.DoubleSolenoid;
+import edu.wpi.first.wpilibj.Solenoid;
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+/**
+ * The Shooter subsystem handles shooting. The mechanism for shooting is
+ * slightly complicated because it has to pneumatic cylinders for shooting, and
+ * a third latch to allow the pressure to partially build up and reduce the
+ * effect of the airflow. For shorter shots, when full power isn't needed, only
+ * one cylinder fires.
+ *
+ * <p>NOTE: Simulation currently approximates this as as single pneumatic
+ * cylinder and ignores the latch.
+ */
+public class Shooter extends Subsystem {
+	// Devices
+	DoubleSolenoid m_piston1 = new DoubleSolenoid(1, 3, 4);
+	DoubleSolenoid m_piston2 = new DoubleSolenoid(1, 5, 6);
+	Solenoid m_latchPiston = new Solenoid(1, 2);
+	DigitalInput m_piston1ReedSwitchFront = new DigitalInput(9);
+	DigitalInput m_piston1ReedSwitchBack = new DigitalInput(11);
+	//NOTE: currently ignored in simulation
+	DigitalInput m_hotGoalSensor = new DigitalInput(3);
+
+	public Shooter() {
+		// Put everything to the LiveWindow for testing.
+		addChild("Hot Goal Sensor", m_hotGoalSensor);
+		addChild("Piston1 Reed Switch Front ", m_piston1ReedSwitchFront);
+		addChild("Piston1 Reed Switch Back ", m_piston1ReedSwitchBack);
+		addChild("Latch Piston", m_latchPiston);
+	}
+
+	/**
+	 * No default command.
+	 */
+	@Override
+	public void initDefaultCommand() {
+	}
+
+	/**
+	 * Extend both solenoids to shoot.
+	 */
+	public void extendBoth() {
+		m_piston1.set(DoubleSolenoid.Value.kForward);
+		m_piston2.set(DoubleSolenoid.Value.kForward);
+	}
+
+	/**
+	 * Retract both solenoids to prepare to shoot.
+	 */
+	public void retractBoth() {
+		m_piston1.set(DoubleSolenoid.Value.kReverse);
+		m_piston2.set(DoubleSolenoid.Value.kReverse);
+	}
+
+	/**
+	 * Extend solenoid 1 to shoot.
+	 */
+	public void extend1() {
+		m_piston1.set(DoubleSolenoid.Value.kForward);
+	}
+
+	/**
+	 * Retract solenoid 1 to prepare to shoot.
+	 */
+	public void retract1() {
+		m_piston1.set(DoubleSolenoid.Value.kReverse);
+	}
+
+	/**
+	 * Extend solenoid 2 to shoot.
+	 */
+	public void extend2() {
+		m_piston2.set(DoubleSolenoid.Value.kReverse);
+	}
+
+	/**
+	 * Retract solenoid 2 to prepare to shoot.
+	 */
+	public void retract2() {
+		m_piston2.set(DoubleSolenoid.Value.kForward);
+	}
+
+	/**
+	 * Turns off the piston1 double solenoid. This won't actuate anything
+	 * because double solenoids preserve their state when turned off. This
+	 * should be called in order to reduce the amount of time that the coils
+	 * are powered.
+	 */
+	public void off1() {
+		m_piston1.set(DoubleSolenoid.Value.kOff);
+	}
+
+	/**
+	 * Turns off the piston2 double solenoid. This won't actuate anything
+	 * because double solenoids preserve their state when turned off. This
+	 * should be called in order to reduce the amount of time that the coils
+	 * are powered.
+	 */
+	public void off2() {
+		m_piston2.set(DoubleSolenoid.Value.kOff);
+	}
+
+	/**
+	 * Release the latch so that we can shoot.
+	 */
+	public void unlatch() {
+		m_latchPiston.set(true);
+	}
+
+	/**
+	 * Latch so that pressure can build up and we aren't limited by air flow.
+	 */
+	public void latch() {
+		m_latchPiston.set(false);
+	}
+
+	/**
+	 * Toggles the latch postions.
+	 */
+	public void toggleLatchPosition() {
+		m_latchPiston.set(!m_latchPiston.get());
+	}
+
+	/**
+	 * Is Piston 1 extended (after shooting).
+	 *
+	 * @return Whether or not piston 1 is fully extended.
+	 */
+	public boolean piston1IsExtended() {
+		return !m_piston1ReedSwitchFront.get();
+	}
+
+	/**
+	 * Is Piston 1 retracted (before shooting).
+	 *
+	 * @return Whether or not piston 1 is fully retracted.
+	 */
+	public boolean piston1IsRetracted() {
+		return !m_piston1ReedSwitchBack.get();
+	}
+
+	/**
+	 * Turns off all double solenoids. Double solenoids hold their position when
+	 * they are turned off. We should turn them off whenever possible to extend
+	 * the life of the coils.
+	 */
+	public void offBoth() {
+		m_piston1.set(DoubleSolenoid.Value.kOff);
+		m_piston2.set(DoubleSolenoid.Value.kOff);
+	}
+
+	/**
+	 * Return whether the goal is hot as read by the banner sensor.
+	 *
+	 * <p>NOTE: doesn't work in simulation.
+	 *
+	 * @return Whether or not the goal is hot
+	 */
+	public boolean goalIsHot() {
+		return m_hotGoalSensor.get();
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/triggers/DoubleButton.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/triggers/DoubleButton.java
new file mode 100644
index 0000000..c20cc47
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/pacgoat/triggers/DoubleButton.java
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.pacgoat.triggers;
+
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.Trigger;
+
+/**
+ * A custom button that is triggered when two buttons on a Joystick are
+ * simultaneously pressed.
+ */
+public class DoubleButton extends Trigger {
+	private Joystick m_joy;
+	private int m_button1;
+	private int m_button2;
+
+	public DoubleButton(Joystick joy, int button1, int button2) {
+		this.m_joy = joy;
+		this.m_button1 = button1;
+		this.m_button2 = button2;
+	}
+
+	@Override
+	public boolean get() {
+		return m_joy.getRawButton(m_button1) && m_joy.getRawButton(m_button2);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/potentiometerpid/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/potentiometerpid/Robot.java
new file mode 100644
index 0000000..0af1885
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/potentiometerpid/Robot.java
@@ -0,0 +1,75 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.potentiometerpid;
+
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.PIDController;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.Joystick;
+
+/**
+ * This is a sample program to demonstrate how to use a soft potentiometer and a
+ * PID controller to reach and maintain position setpoints on an elevator
+ * mechanism.
+ */
+public class Robot extends IterativeRobot {
+	private static final int kPotChannel = 1;
+	private static final int kMotorChannel = 7;
+	private static final int kJoystickChannel = 0;
+
+	// bottom, middle, and top elevator setpoints
+	private static final double[] kSetPoints = {1.0, 2.6, 4.3};
+
+	// proportional, integral, and derivative speed constants; motor inverted
+	// DANGER: when tuning PID constants, high/inappropriate values for kP, kI,
+	// and kD may cause dangerous, uncontrollable, or undesired behavior!
+	// these may need to be positive for a non-inverted motor
+	private static final double kP = -5.0;
+	private static final double kI = -0.02;
+	private static final double kD = -2.0;
+
+	private PIDController m_pidController;
+	private AnalogInput m_potentiometer;
+	private SpeedController m_elevatorMotor;
+	private Joystick m_joystick;
+
+	private int m_index = 0;
+	private boolean m_previousButtonValue = false;
+
+	@Override
+	public void robotInit() {
+		m_potentiometer = new AnalogInput(kPotChannel);
+		m_elevatorMotor = new Spark(kMotorChannel);
+		m_joystick = new Joystick(kJoystickChannel);
+
+		m_pidController
+				= new PIDController(kP, kI, kD, m_potentiometer, m_elevatorMotor);
+		m_pidController.setInputRange(0, 5);
+	}
+
+	@Override
+	public void teleopInit() {
+		m_pidController.enable();
+	}
+
+	@Override
+	public void teleopPeriodic() {
+		// when the button is pressed once, the selected elevator setpoint
+		// is incremented
+		boolean currentButtonValue = m_joystick.getTrigger();
+		if (currentButtonValue && !m_previousButtonValue) {
+			// index of the elevator setpoint wraps around.
+			m_index = (m_index + 1) % kSetPoints.length;
+		}
+		m_previousButtonValue = currentButtonValue;
+
+		m_pidController.setSetpoint(kSetPoints[m_index]);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/quickvision/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/quickvision/Robot.java
new file mode 100644
index 0000000..db649ec
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/quickvision/Robot.java
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.quickvision;
+
+import edu.wpi.first.wpilibj.CameraServer;
+import edu.wpi.first.wpilibj.IterativeRobot;
+
+/**
+ * Uses the CameraServer class to automatically capture video from a USB webcam
+ * and send it to the FRC dashboard without doing any vision processing. This
+ * is the easiest way to get camera images to the dashboard. Just add this to
+ * the robotInit() method in your program.
+ */
+public class Robot extends IterativeRobot {
+	@Override
+	public void robotInit() {
+		CameraServer.getInstance().startAutomaticCapture();
+	}
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/tankdrive/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/tankdrive/Robot.java
new file mode 100755
index 0000000..9808992
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/tankdrive/Robot.java
@@ -0,0 +1,35 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.tankdrive;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+
+/**
+ * This is a demo program showing the use of the RobotDrive class, specifically
+ * it contains the code necessary to operate a robot with tank drive.
+ */
+public class Robot extends IterativeRobot {
+	private DifferentialDrive m_myRobot;
+	private Joystick m_leftStick;
+	private Joystick m_rightStick;
+
+	@Override
+	public void robotInit() {
+		m_myRobot = new DifferentialDrive(new Spark(0), new Spark(1));
+		m_leftStick = new Joystick(0);
+		m_rightStick = new Joystick(1);
+	}
+
+	@Override
+	public void teleopPeriodic() {
+		m_myRobot.tankDrive(m_leftStick.getY(), m_rightStick.getY());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java
new file mode 100644
index 0000000..5ac6341
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonic/Robot.java
@@ -0,0 +1,53 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.ultrasonic;
+
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+
+/**
+ * This is a sample program demonstrating how to use an ultrasonic sensor and
+ * proportional control to maintain a set distance from an object.
+ */
+
+public class Robot extends IterativeRobot {
+	// distance in inches the robot wants to stay from an object
+	private static final double kHoldDistance = 12.0;
+
+	// factor to convert sensor values to a distance in inches
+	private static final double kValueToInches = 0.125;
+
+	// proportional speed constant
+	private static final double kP = 0.05;
+
+	private static final int kLeftMotorPort = 0;
+	private static final int kRightMotorPort = 1;
+	private static final int kUltrasonicPort = 0;
+
+	private AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
+	private DifferentialDrive m_robotDrive
+			= new DifferentialDrive(new Spark(kLeftMotorPort),
+			new Spark(kRightMotorPort));
+
+	/**
+	 * Tells the robot to drive to a set distance (in inches) from an object
+	 * using proportional control.
+	 */
+	public void teleopPeriodic() {
+		// sensor returns a value from 0-4095 that is scaled to inches
+		double currentDistance = m_ultrasonic.getValue() * kValueToInches;
+
+		// convert distance error to a motor speed
+		double currentSpeed = (kHoldDistance - currentDistance) * kP;
+
+		// drive robot
+		m_robotDrive.arcadeDrive(currentSpeed, 0);
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java
new file mode 100644
index 0000000..066150b
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ultrasonicpid/Robot.java
@@ -0,0 +1,71 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.examples.ultrasonicpid;
+
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.PIDController;
+import edu.wpi.first.wpilibj.PIDOutput;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+
+/**
+ * This is a sample program to demonstrate the use of a PIDController with an
+ * ultrasonic sensor to reach and maintain a set distance from an object.
+ */
+public class Robot extends IterativeRobot {
+	// distance in inches the robot wants to stay from an object
+	private static final double kHoldDistance = 12.0;
+
+	// maximum distance in inches we expect the robot to see
+	private static final double kMaxDistance = 24.0;
+
+	// factor to convert sensor values to a distance in inches
+	private static final double kValueToInches = 0.125;
+
+	// proportional speed constant
+	private static final double kP = 7.0;
+
+	// integral speed constant
+	private static final double kI = 0.018;
+
+	// derivative speed constant
+	private static final double kD = 1.5;
+
+	private static final int kLeftMotorPort = 0;
+	private static final int kRightMotorPort = 1;
+	private static final int kUltrasonicPort = 0;
+
+	private AnalogInput m_ultrasonic = new AnalogInput(kUltrasonicPort);
+	private DifferentialDrive m_robotDrive
+			= new DifferentialDrive(new Spark(kLeftMotorPort),
+			new Spark(kRightMotorPort));
+	private PIDController m_pidController
+			= new PIDController(kP, kI, kD, m_ultrasonic, new MyPidOutput());
+
+	/**
+	 * Drives the robot a set distance from an object using PID control and the
+	 * ultrasonic sensor.
+	 */
+	@Override
+	public void teleopInit() {
+		// Set expected range to 0-24 inches; e.g. at 24 inches from object go
+		// full forward, at 0 inches from object go full backward.
+		m_pidController.setInputRange(0, kMaxDistance * kValueToInches);
+		// Set setpoint of the pid controller
+		m_pidController.setSetpoint(kHoldDistance * kValueToInches);
+		m_pidController.enable(); // begin PID control
+	}
+
+	private class MyPidOutput implements PIDOutput {
+		@Override
+		public void pidWrite(double output) {
+			m_robotDrive.arcadeDrive(output, 0);
+		}
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/OI.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/OI.java
new file mode 100644
index 0000000..b1833f2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/OI.java
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.commandbased;
+
+/**
+ * This class is the glue that binds the controls on the physical operator
+ * interface to the commands and command groups that allow control of the robot.
+ */
+public class OI {
+	//// CREATING BUTTONS
+	// One type of button is a joystick button which is any button on a
+	//// joystick.
+	// You create one by telling it which joystick it's on and which button
+	// number it is.
+	// Joystick stick = new Joystick(port);
+	// Button button = new JoystickButton(stick, buttonNumber);
+
+	// There are a few additional built in buttons you can use. Additionally,
+	// by subclassing Button you can create custom triggers and bind those to
+	// commands the same as any other Button.
+
+	//// TRIGGERING COMMANDS WITH BUTTONS
+	// Once you have a button, it's trivial to bind it to a button in one of
+	// three ways:
+
+	// Start the command when the button is pressed and let it run the command
+	// until it is finished as determined by it's isFinished method.
+	// button.whenPressed(new ExampleCommand());
+
+	// Run the command while the button is being held down and interrupt it once
+	// the button is released.
+	// button.whileHeld(new ExampleCommand());
+
+	// Start the command when the button is released and let it run the command
+	// until it is finished as determined by it's isFinished method.
+	// button.whenReleased(new ExampleCommand());
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java
new file mode 100644
index 0000000..8c69039
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.commandbased;
+
+import edu.wpi.first.wpilibj.TimedRobot;
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+import edu.wpi.first.wpilibj.templates.commandbased.commands.ExampleCommand;
+import edu.wpi.first.wpilibj.templates.commandbased.subsystems.ExampleSubsystem;
+
+/**
+ * The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the TimedRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the build.properties file in the
+ * project.
+ */
+public class Robot extends TimedRobot {
+	public static final ExampleSubsystem kExampleSubsystem
+			= new ExampleSubsystem();
+	public static OI m_oi;
+
+	Command m_autonomousCommand;
+	SendableChooser<Command> m_chooser = new SendableChooser<>();
+
+	/**
+	 * This function is run when the robot is first started up and should be
+	 * used for any initialization code.
+	 */
+	@Override
+	public void robotInit() {
+		m_oi = new OI();
+		m_chooser.addDefault("Default Auto", new ExampleCommand());
+		// chooser.addObject("My Auto", new MyAutoCommand());
+		SmartDashboard.putData("Auto mode", m_chooser);
+	}
+
+	/**
+	 * This function is called once each time the robot enters Disabled mode.
+	 * You can use it to reset any subsystem information you want to clear when
+	 * the robot is disabled.
+	 */
+	@Override
+	public void disabledInit() {
+
+	}
+
+	@Override
+	public void disabledPeriodic() {
+		Scheduler.getInstance().run();
+	}
+
+	/**
+	 * This autonomous (along with the chooser code above) shows how to select
+	 * between different autonomous modes using the dashboard. The sendable
+	 * chooser code works with the Java SmartDashboard. If you prefer the
+	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
+	 * getString code to get the auto name from the text box below the Gyro
+	 *
+	 * <p>You can add additional auto modes by adding additional commands to the
+	 * chooser code above (like the commented example) or additional comparisons
+	 * to the switch structure below with additional strings & commands.
+	 */
+	@Override
+	public void autonomousInit() {
+		m_autonomousCommand = m_chooser.getSelected();
+
+		/*
+		 * String autoSelected = SmartDashboard.getString("Auto Selector",
+		 * "Default"); switch(autoSelected) { case "My Auto": autonomousCommand
+		 * = new MyAutoCommand(); break; case "Default Auto": default:
+		 * autonomousCommand = new ExampleCommand(); break; }
+		 */
+
+		// schedule the autonomous command (example)
+		if (m_autonomousCommand != null) {
+			m_autonomousCommand.start();
+		}
+	}
+
+	/**
+	 * This function is called periodically during autonomous.
+	 */
+	@Override
+	public void autonomousPeriodic() {
+		Scheduler.getInstance().run();
+	}
+
+	@Override
+	public void teleopInit() {
+		// This makes sure that the autonomous stops running when
+		// teleop starts running. If you want the autonomous to
+		// continue until interrupted by another command, remove
+		// this line or comment it out.
+		if (m_autonomousCommand != null) {
+			m_autonomousCommand.cancel();
+		}
+	}
+
+	/**
+	 * This function is called periodically during operator control.
+	 */
+	@Override
+	public void teleopPeriodic() {
+		Scheduler.getInstance().run();
+	}
+
+	/**
+	 * This function is called periodically during test mode.
+	 */
+	@Override
+	public void testPeriodic() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/RobotMap.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/RobotMap.java
new file mode 100644
index 0000000..709e7b2
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/RobotMap.java
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.commandbased;
+
+/**
+ * The RobotMap is a mapping from the ports sensors and actuators are wired into
+ * to a variable name. This provides flexibility changing wiring, makes checking
+ * the wiring easier and significantly reduces the number of magic numbers
+ * floating around.
+ */
+public class RobotMap {
+	// For example to map the left and right motors, you could define the
+	// following variables to use with your drivetrain subsystem.
+	// public static int leftMotor = 1;
+	// public static int rightMotor = 2;
+
+	// If you are using multiple modules, make sure to define both the port
+	// number and the module. For example you with a rangefinder:
+	// public static int rangefinderPort = 1;
+	// public static int rangefinderModule = 1;
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/commands/ExampleCommand.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/commands/ExampleCommand.java
new file mode 100644
index 0000000..115d686
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/commands/ExampleCommand.java
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.commandbased.commands;
+
+import edu.wpi.first.wpilibj.command.Command;
+import edu.wpi.first.wpilibj.templates.commandbased.Robot;
+
+/**
+ * An example command.  You can replace me with your own command.
+ */
+public class ExampleCommand extends Command {
+	public ExampleCommand() {
+		// Use requires() here to declare subsystem dependencies
+		requires(Robot.kExampleSubsystem);
+	}
+
+	// Called just before this Command runs the first time
+	@Override
+	protected void initialize() {
+	}
+
+	// Called repeatedly when this Command is scheduled to run
+	@Override
+	protected void execute() {
+	}
+
+	// Make this return true when this Command no longer needs to run execute()
+	@Override
+	protected boolean isFinished() {
+		return false;
+	}
+
+	// Called once after isFinished returns true
+	@Override
+	protected void end() {
+	}
+
+	// Called when another command which requires one or more of the same
+	// subsystems is scheduled to run
+	@Override
+	protected void interrupted() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/subsystems/ExampleSubsystem.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/subsystems/ExampleSubsystem.java
new file mode 100644
index 0000000..7dcafbe
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/subsystems/ExampleSubsystem.java
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.commandbased.subsystems;
+
+import edu.wpi.first.wpilibj.command.Subsystem;
+
+/**
+ * An example subsystem.  You can replace me with your own Subsystem.
+ */
+public class ExampleSubsystem extends Subsystem {
+	// Put methods for controlling this subsystem
+	// here. Call these from Commands.
+
+	public void initDefaultCommand() {
+		// Set the default command for a subsystem here.
+		// setDefaultCommand(new MySpecialCommand());
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java
new file mode 100644
index 0000000..e6e1027
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/iterative/Robot.java
@@ -0,0 +1,86 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.iterative;
+
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the IterativeRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the build.properties file in the
+ * project.
+ */
+public class Robot extends IterativeRobot {
+	private static final String kDefaultAuto = "Default";
+	private static final String kCustomAuto = "My Auto";
+	private String m_autoSelected;
+	private SendableChooser<String> m_chooser = new SendableChooser<>();
+
+	/**
+	 * This function is run when the robot is first started up and should be
+	 * used for any initialization code.
+	 */
+	@Override
+	public void robotInit() {
+		m_chooser.addDefault("Default Auto", kDefaultAuto);
+		m_chooser.addObject("My Auto", kCustomAuto);
+		SmartDashboard.putData("Auto choices", m_chooser);
+	}
+
+	/**
+	 * This autonomous (along with the chooser code above) shows how to select
+	 * between different autonomous modes using the dashboard. The sendable
+	 * chooser code works with the Java SmartDashboard. If you prefer the
+	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
+	 * getString line to get the auto name from the text box below the Gyro
+	 *
+	 * <p>You can add additional auto modes by adding additional comparisons to
+	 * the switch structure below with additional strings. If using the
+	 * SendableChooser make sure to add them to the chooser code above as well.
+	 */
+	@Override
+	public void autonomousInit() {
+		m_autoSelected = m_chooser.getSelected();
+		// autoSelected = SmartDashboard.getString("Auto Selector",
+		// defaultAuto);
+		System.out.println("Auto selected: " + m_autoSelected);
+	}
+
+	/**
+	 * This function is called periodically during autonomous.
+	 */
+	@Override
+	public void autonomousPeriodic() {
+		switch (m_autoSelected) {
+			case kCustomAuto:
+				// Put custom auto code here
+				break;
+			case kDefaultAuto:
+			default:
+				// Put default auto code here
+				break;
+		}
+	}
+
+	/**
+	 * This function is called periodically during operator control.
+	 */
+	@Override
+	public void teleopPeriodic() {
+	}
+
+	/**
+	 * This function is called periodically during test mode.
+	 */
+	@Override
+	public void testPeriodic() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/sample/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/sample/Robot.java
new file mode 100644
index 0000000..fc9f167
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/sample/Robot.java
@@ -0,0 +1,155 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.sample;
+
+import edu.wpi.first.wpilibj.SampleRobot;
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.Spark;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * This is a demo program showing the use of the RobotDrive class. The
+ * SampleRobot class is the base of a robot application that will automatically
+ * call your Autonomous and OperatorControl methods at the right time as
+ * controlled by the switches on the driver station or the field controls.
+ *
+ * <p>The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the SampleRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the build.properties file in the
+ * project.
+ *
+ * <p>WARNING: While it may look like a good choice to use for your code if
+ * you're inexperienced, don't. Unless you know what you are doing, complex code
+ * will be much more difficult under this system. Use IterativeRobot or
+ * Command-Based instead if you're new.
+ */
+public class Robot extends SampleRobot {
+	private static final String kDefaultAuto = "Default";
+	private static final String kCustomAuto = "My Auto";
+
+	private DifferentialDrive m_robotDrive
+			= new DifferentialDrive(new Spark(0), new Spark(1));
+	private Joystick m_stick = new Joystick(0);
+	private SendableChooser<String> m_chooser = new SendableChooser<>();
+
+	public Robot() {
+		m_robotDrive.setExpiration(0.1);
+	}
+
+	@Override
+	public void robotInit() {
+		m_chooser.addDefault("Default Auto", kDefaultAuto);
+		m_chooser.addObject("My Auto", kCustomAuto);
+		SmartDashboard.putData("Auto modes", m_chooser);
+	}
+
+	/**
+	 * This autonomous (along with the chooser code above) shows how to select
+	 * between different autonomous modes using the dashboard. The sendable
+	 * chooser code works with the Java SmartDashboard. If you prefer the
+	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
+	 * getString line to get the auto name from the text box below the Gyro
+	 *
+	 * <p>You can add additional auto modes by adding additional comparisons to
+	 * the if-else structure below with additional strings. If using the
+	 * SendableChooser make sure to add them to the chooser code above as well.
+	 *
+	 * <p>If you wanted to run a similar autonomous mode with an IterativeRobot
+	 * you would write:
+	 *
+	 * <blockquote><pre>{@code
+	 * Timer timer = new Timer();
+	 *
+	 * // This function is run once each time the robot enters autonomous mode
+	 * public void autonomousInit() {
+	 *     timer.reset();
+	 *     timer.start();
+	 * }
+	 *
+	 * // This function is called periodically during autonomous
+	 * public void autonomousPeriodic() {
+	 * // Drive for 2 seconds
+	 *     if (timer.get() < 2.0) {
+	 *         myRobot.drive(-0.5, 0.0); // drive forwards half speed
+	 *     } else if (timer.get() < 5.0) {
+	 *         myRobot.drive(-1.0, 0.0); // drive forwards full speed
+	 *     } else {
+	 *         myRobot.drive(0.0, 0.0); // stop robot
+	 *     }
+	 * }
+	 * }</pre></blockquote>
+	 */
+	@Override
+	public void autonomous() {
+		String autoSelected = m_chooser.getSelected();
+		// String autoSelected = SmartDashboard.getString("Auto Selector",
+		// defaultAuto);
+		System.out.println("Auto selected: " + autoSelected);
+
+		// MotorSafety improves safety when motors are updated in loops
+		// but is disabled here because motor updates are not looped in
+		// this autonomous mode.
+		m_robotDrive.setSafetyEnabled(false);
+
+		switch (autoSelected) {
+			case kCustomAuto:
+				// Spin at half speed for two seconds
+				m_robotDrive.arcadeDrive(0.0, 0.5);
+				Timer.delay(2.0);
+
+				// Stop robot
+				m_robotDrive.arcadeDrive(0.0, 0.0);
+				break;
+			case kDefaultAuto:
+			default:
+				// Drive forwards for two seconds
+				m_robotDrive.arcadeDrive(-0.5, 0.0);
+				Timer.delay(2.0);
+
+				// Stop robot
+				m_robotDrive.arcadeDrive(0.0, 0.0);
+				break;
+		}
+	}
+
+	/**
+	 * Runs the motors with arcade steering.
+	 *
+	 * <p>If you wanted to run a similar teleoperated mode with an IterativeRobot
+	 * you would write:
+	 *
+	 * <blockquote><pre>{@code
+	 * // This function is called periodically during operator control
+	 * public void teleopPeriodic() {
+	 *     myRobot.arcadeDrive(stick);
+	 * }
+	 * }</pre></blockquote>
+	 */
+	@Override
+	public void operatorControl() {
+		m_robotDrive.setSafetyEnabled(true);
+		while (isOperatorControl() && isEnabled()) {
+			// Drive arcade style
+			m_robotDrive.arcadeDrive(-m_stick.getY(), m_stick.getX());
+
+			// The motors will be updated every 5ms
+			Timer.delay(0.005);
+		}
+	}
+
+	/**
+	 * Runs during test mode.
+	 */
+	@Override
+	public void test() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java
new file mode 100644
index 0000000..ff869fd
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/timed/Robot.java
@@ -0,0 +1,86 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.templates.timed;
+
+import edu.wpi.first.wpilibj.TimedRobot;
+import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
+
+/**
+ * The VM is configured to automatically run this class, and to call the
+ * functions corresponding to each mode, as described in the IterativeRobot
+ * documentation. If you change the name of this class or the package after
+ * creating this project, you must also update the build.properties file in the
+ * project.
+ */
+public class Robot extends TimedRobot {
+	private static final String kDefaultAuto = "Default";
+	private static final String kCustomAuto = "My Auto";
+	private String m_autoSelected;
+	private SendableChooser<String> m_chooser = new SendableChooser<>();
+
+	/**
+	 * This function is run when the robot is first started up and should be
+	 * used for any initialization code.
+	 */
+	@Override
+	public void robotInit() {
+		m_chooser.addDefault("Default Auto", kDefaultAuto);
+		m_chooser.addObject("My Auto", kCustomAuto);
+		SmartDashboard.putData("Auto choices", m_chooser);
+	}
+
+	/**
+	 * This autonomous (along with the chooser code above) shows how to select
+	 * between different autonomous modes using the dashboard. The sendable
+	 * chooser code works with the Java SmartDashboard. If you prefer the
+	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
+	 * getString line to get the auto name from the text box below the Gyro
+	 *
+	 * <p>You can add additional auto modes by adding additional comparisons to
+	 * the switch structure below with additional strings. If using the
+	 * SendableChooser make sure to add them to the chooser code above as well.
+	 */
+	@Override
+	public void autonomousInit() {
+		m_autoSelected = m_chooser.getSelected();
+		// m_autoSelected = SmartDashboard.getString("Auto Selector",
+		// 		kDefaultAuto);
+		System.out.println("Auto selected: " + m_autoSelected);
+	}
+
+	/**
+	 * This function is called periodically during autonomous.
+	 */
+	@Override
+	public void autonomousPeriodic() {
+		switch (m_autoSelected) {
+			case kCustomAuto:
+				// Put custom auto code here
+				break;
+			case kDefaultAuto:
+			default:
+				// Put default auto code here
+				break;
+		}
+	}
+
+	/**
+	 * This function is called periodically during operator control.
+	 */
+	@Override
+	public void teleopPeriodic() {
+	}
+
+	/**
+	 * This function is called periodically during test mode.
+	 */
+	@Override
+	public void testPeriodic() {
+	}
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/README.html b/third_party/allwpilib_2018/wpilibjIntegrationTests/README.html
new file mode 100644
index 0000000..dc9d154
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/README.html
@@ -0,0 +1,389 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <style>/* Fonts */
+@font-face{
+  font-family: octicons-anchor;
+  src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
+}
+
+@font-face{
+  font-family: fontawesome-mini;
+  src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAzUABAAAAAAFNgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcZMzaOEdERUYAAAGIAAAAHQAAACAAOQAET1MvMgAAAagAAAA+AAAAYHqhde9jbWFwAAAB6AAAAFIAAAFa4azkLWN2dCAAAAI8AAAAKAAAACgFgwioZnBnbQAAAmQAAAGxAAACZVO0L6dnYXNwAAAEGAAAAAgAAAAIAAAAEGdseWYAAAQgAAAFDgAACMz7eroHaGVhZAAACTAAAAAwAAAANgWEOEloaGVhAAAJYAAAAB0AAAAkDGEGa2htdHgAAAmAAAAAEwAAADBEgAAQbG9jYQAACZQAAAAaAAAAGgsICJBtYXhwAAAJsAAAACAAAAAgASgBD25hbWUAAAnQAAACZwAABOD4no+3cG9zdAAADDgAAABsAAAAmF+yXM9wcmVwAAAMpAAAAC4AAAAusPIrFAAAAAEAAAAAyYlvMQAAAADLVHQgAAAAAM/u9uZ4nGNgZGBg4ANiCQYQYGJgBEJuIGYB8xgABMMAPgAAAHicY2Bm42OcwMDKwMLSw2LMwMDQBqGZihmiwHycoKCyqJjB4YPDh4NsDP+BfNb3DIuAFCOSEgUGRgAKDgt4AAB4nGNgYGBmgGAZBkYGEAgB8hjBfBYGCyDNxcDBwMTA9MHhQ9SHrA8H//9nYACyQyFs/sP86/kX8HtB9UIBIxsDXICRCUgwMaACRoZhDwA3fxKSAAAAAAHyAHABJQB/AIEAdAFGAOsBIwC/ALgAxACGAGYAugBNACcA/wCIeJxdUbtOW0EQ3Q0PA4HE2CA52hSzmZDGe6EFCcTVjWJkO4XlCGk3cpGLcQEfQIFEDdqvGaChpEibBiEXSHxCPiESM2uIojQ7O7NzzpkzS8qRqnfpa89T5ySQwt0GzTb9Tki1swD3pOvrjYy0gwdabGb0ynX7/gsGm9GUO2oA5T1vKQ8ZTTuBWrSn/tH8Cob7/B/zOxi0NNP01DoJ6SEE5ptxS4PvGc26yw/6gtXhYjAwpJim4i4/plL+tzTnasuwtZHRvIMzEfnJNEBTa20Emv7UIdXzcRRLkMumsTaYmLL+JBPBhcl0VVO1zPjawV2ys+hggyrNgQfYw1Z5DB4ODyYU0rckyiwNEfZiq8QIEZMcCjnl3Mn+pED5SBLGvElKO+OGtQbGkdfAoDZPs/88m01tbx3C+FkcwXe/GUs6+MiG2hgRYjtiKYAJREJGVfmGGs+9LAbkUvvPQJSA5fGPf50ItO7YRDyXtXUOMVYIen7b3PLLirtWuc6LQndvqmqo0inN+17OvscDnh4Lw0FjwZvP+/5Kgfo8LK40aA4EQ3o3ev+iteqIq7wXPrIn07+xWgAAAAABAAH//wAPeJyFlctvG1UUh+/12DPN1B7P3JnYjj2Ox4/MuDHxJH5N3UdaEUQLqBIkfQQioJWQ6AMEQkIqsPGCPwA1otuWSmTBhjtps2ADWbJg3EpIXbGouqSbCraJw7kzNo2dRN1cnXN1ZvT7zuuiMEI7ncizyA0URofRBJpCdbQuIFShYY+GZRrxMDVtih5TwQPHtXDFFSIKoWIbuREBjLH27Ny4MsbVx+uOJThavebgVrNRLAiYx06rXsvhxLgWx9xpfHdrs/ekc2Pl2cpPCVEITQpwbj8VQhfXSq2m+Wxqaq2D73Kne5e3NjHqQNj3CRYlJlgUl/jRNP+2Gs2pNYRQiOnmUaQDqm30KqKiTTWPWjboxnTWpvgxjXo0KrtZXAHt7hwIz0YVcj88JnKlJKi3NPAwLyDwZudSmJSMMJFDYaOkaol6XtESx3Gt1VTytdZJ3DCLeaVhVnCBH1fycHTxFXwPX+l2e3d6H/TufGGmMTLTnbSJUdo00zuBswMO/nl3YLeL/wnu9/limCuD3vC54h5NBVz6Li414AI8Vx3iiosKcQXUbrvhFFiYb++HN4DaF4XzFW0fIN4XDWJ3a3XQoq9V8WiyRmdsatV9xUcHims1JloH0YUa090G3Tro3mC6c01f+YwCPquINr1PTaCP6rVTOOmf0GE2dBc7zWIhji3/5MchSuBHgDbU99RMWt3YUNMZMJmx92YP6NsHx/5/M1yvInpnkIOM3Z8fA3JQ2lW1RFC1KaBPDFXNAHYYvGy73aYZZZ3HifbeuiVZCpwA3oQBs0wGPYJbJfg60xrKEbKiNtTe1adwrpBRwlAuQ3q3VRaX0QmQ9a49BTSCuF1MLfQ6+tinOubRBZuWPNoMevGMT+V41KitO1is3D/tpMcq1JHZqDHGs8DoYGDkxJgKjHROeTCmhZvzPm9pod+ltKm4PN7Dyvvldlpsg8D+4AUJZ3F/JBstZz7cbFRxsaAGV6yX/dkcycWf8eS3QlQea+YLjdm3yrOnrhFpUyKVvFE4lpv4bO3Svx/6F/4xmiDu/RT5iI++lko18mY1oX+5UGKR6kmVjM/Zb76yfHtxy+h/SyQ0lLdpdKy/lWB6szatetQJ8nZ80A2Qt6ift6gJeavU3BO4gtxs/KCtNPVibCtYCWY3SIlSBPKXZALXiIR9oZeJ1AuMyxLpHIy/yO7vSiSE+kZvk0ihJ30HgHfzZtEMmvV58x6dtqns0XTAW7Vdm4HJ04OCp/crOO7rd9SGxQAE/mVA9xRN+kVSMRFF6S9JFGUtthkjBA5tFCWc2l4V43Ex9GmUP3SI37Jjmir9KqlaDJ4S4JB3vuM/jzyH1+8MuoZ+QGzfnvPoJb96cZlWjMcKLfgDwB7E634JTY+asjsPzS5CiVnEWY+KsrsIN5rn3mAPjqmQBxGjcGKB9f9ZxY3mYC2L85CJ2FXIxKKyHk+dg0FHbuEc7D5NzWUX32WxFcWNGRAbvwSx0RmIXVDuYySafluQBmzA/ssqJAMLnli+WIC90Gw4lm85wcp0qjArEDPJJV/sSx4P9ungTpgMw5gVC1XO4uULq0s3v1rqLi0vX/z65vlH50f8T/RHmSPTk5xxWBWOluMT6WiOy+tdvWxlV/XQb3o3c6Ssr+r6I708GsX9/nzp1tKFh0s3v7m4vAy/Hnb/KMOvc1wump6Il48K6mGDy02X9Yd65pa+nQIjk76lWxCkG8NBCP0HQS9IpAAAeJxjYGRgYGBhcCrq214Qz2/zlUGenQEEzr/77oug/zewFbB+AHI5GJhAogBwKQ0qeJxjYGRgYH3/P46BgZ0BBNgKGBgZUAEPAE/7At0AAAB4nGNngAB2IGYjhBsYBAAIYADVAAAAAAAAAAAAAFwAyAEeAaACCgKmAx4DggRmAAAAAQAAAAwAagAEAAAAAAACAAEAAgAWAAABAAChAAAAAHiclZI7bxQxFIWPd/JkUYQChEhIyAVKgdBMskm1QkKrRETpQiLRUczueB/K7HhlOxttg8LvoKPgP9DxFxANDR0tHRWi4NjrPIBEgh1p/dm+vufcawNYFWsQmP6e4jSyQB2fI9cwj++RE9wTjyPP4LYoI89iWbyLPIe6+Bh5Hs9rryMv4GbtW+RF3EhuRa7jbrIbeQkPkjdUETOLnL0Kip4FVvAhco1RXyMnSPEz8gzWxE7kWTwUp5HnsCLeR57HW/El8gJWa58iL+JO7UfkOh4l9yMv4UnyEtvQGGECgwF66MNBooF1bGCL1ELB/TYU+ZBRlvsKQ44Se6jQ4a7hef+fh72Crv25kp+8lNWGmeKoOI5jJLb1aGIGvb6TjfWNLdkqdFvJw4l1amjlXtXRZqRN7lSRylZZyhBqpVFWmTEXgWfUrpi/hZOQXdOd4rKuXOtEWT3k5IArPRzTUU5tHKjecZkTpnVbNOnt6jzN8240GD4xtikvZW56043rPMg/dS+dlOceXoR+WPbJ55Dsekq1lJpnypsMUsYOdCW30o103Ytu/lvh+5RWFLfBjm9/N8hJntPhvx92rnoE/kyHdGasGy754kw36vsVf/lFeBi+0COu+cfgQr42G3CRpeLoZ53gmfe3X6rcKt5oVxnptHR9JS8ehVUd5wvvahN2uqxOOpMXapibI5k7Zwbt4xBSaTfoKBufhAnO/uqNcfK8OTs0OQ6l7JIqFjDhYj5WcjevCnI/1DDiI8j4ndWb/5YzDZWh79yomWXeXj7Nnw70/2TIeFPTrlSh89k1ObOSRVZWZfgF0r/zJQB4nG2JUQuCQBCEd07TTg36fb2IyBaLd3vWaUh/vmSJnvpgmG8YcmS8X3Shf3R7QA4OBUocUKHGER5NNbOOEvwc1txnuWkTRb/aPjimJ5vXabI+3VfOiyS15UWvyezM2xiGOPyuMohOH8O8JiO4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAA=) format('woff');
+}
+
+/* Body */
+html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
+
+body{
+  color:#4d4d4c;
+  font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman',
+              "Hiragino Sans GB", "STXihei", "微软雅黑", serif;
+  font-size:12px;
+  line-height:1.5em;
+  background:#fefefe;
+  width: 45em;
+  margin: 10px auto;
+  padding: 30px;
+  border: 1px solid #ddd;
+  outline: 1300px solid #f8f8f8;
+}
+
+/* Links */
+a{ color: #06d; text-decoration:none; }
+a:hover{ color: #06e; text-decoration: underline; }
+a:active{ color:#faa700; }
+a:focus{ outline: thin dotted; }
+a:hover, a:active{ outline: 0; }
+
+::-moz-selection { background:#a8d1ff; color:#000 }
+::selection { background:#a8d1ff; color:#000 }
+
+a::-moz-selection { background:#a8d1ff; color:#0645ad }
+a::selection { background:#a8d1ff; color:#0645ad }
+
+/* Header Anchor Links*/
+.headeranchor-link {
+  color:#111;
+  border: 0;
+  margin-left: -20px;
+  padding-right: 6px;
+  cursor: pointer;
+  position: absolute;
+  display: block;
+  top: 0;
+  left: 0;
+  bottom: 0;
+}
+
+.headeranchor {
+  font: normal normal 16px octicons-anchor;
+  line-height: 1;
+  -moz-osx-font-smoothing: grayscale;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+.headeranchor-link:hover,
+.headeranchor-link:visited,
+.headeranchor-link:active
+{ text-decoration: none; color:#4d4d4c; }
+.headeranchor-link:hover .headeranchor:before,
+h1:hover .headeranchor:before,
+h2:hover .headeranchor:before,
+h3:hover .headeranchor:before,
+h4:hover .headeranchor:before,
+h5:hover .headeranchor:before,
+h6:hover .headeranchor:before
+{ content: '\f05c'; }
+
+abbr { cursor: pointer; }
+
+/* Paragraphs */
+p { margin:1em 0; }
+
+/* Images */
+img {
+  max-width:100%;
+  border: 0;
+  -ms-interpolation-mode: bicubic;
+  vertical-align: middle;
+}
+
+/* Headers */
+h1,h2,h3,h4,h5,h6 {
+  font-weight:normal;
+  color:#111;
+  line-height: 1.7;
+  position: relative;
+}
+h4,h5,h6{ font-weight: bold; }
+h1 { font-size:2.5em; border-bottom: 1px solid #ddd;}
+h2 { font-size:2em; border-bottom:1px solid #eee; padding-bottom: 5px; }
+h3 { font-size:1.5em; }
+h4 { font-size:1.2em; }
+h5 { font-size:1em; }
+h6 { font-size:0.9em; }
+
+/* Block Quotes */
+blockquote {
+  color:#666666;
+  margin:0;
+  padding-left: 3em;
+  border-left: 0.5em #EEE solid;
+}
+hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; }
+
+/* Raw Blocks */
+pre, code, kbd, samp {
+  color: #000;
+  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  font-size: 0.88em;
+  background-color: #F8F8F8;
+  border: 1px solid #CCC;
+}
+
+pre {
+  padding: 10px;
+  overflow: auto;
+}
+
+code { padding: 0 3px 0 3px; }
+pre code { border: 0; padding: 0; }
+
+/* Admonition */
+.admonition {
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  font-size: 0.88em;
+  padding: 0.5em 1em 0.5em 1em;
+  margin: 10px auto;
+  color: #888888;
+  background-color: #F8F8F8;
+  border: 1px solid #888888;
+}
+
+.admonition p { padding: 0; margin: 0; }
+.admonition-title { font-weight: bold; margin: 0; }
+
+.admonition-icon {
+  font: normal normal 16px fontawesome-mini;
+  line-height: 1.5;
+  -moz-osx-font-smoothing: grayscale;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+  float: left;
+}
+
+.admonition.attention { color: #4F8A10; background-color: #DFF2BF; border: 1px solid #4F8A10; }
+.admonition.caution { color: #D63301; background-color: #FFCCBA; border: 1px solid #D63301; }
+.admonition.hint { color: #00529B; background-color: #BDE5F8; border: 1px solid #00529B; }
+.admonition.danger { color: #D8000C; background-color: #FFBABA; border: 1px solid #D8000C; }
+.admonition.question { color: #00049b; background-color: #BDC8F8; border: 1px solid #00049b; }
+.admonition.note { color: #9F6000; background-color: #FEEFB3; border: 1px solid #9F6000; }
+
+.attention > .admonition-icon:before { content: "\f058\00a0"; }
+.caution > .admonition-icon:before { content: "\f06a\00a0"; }
+.hint > .admonition-icon:before { content: "\f05a\00a0"; }
+.danger > .admonition-icon:before { content: "\f056\00a0"; }
+.question > .admonition-icon:before { content: "\f059\00a0"; }
+.note > .admonition-icon:before { content: "\f040\00a0"; }
+
+/* progress bar*/
+.progress {
+  display: block;
+  width: 300px;
+  margin: 10px 0;
+  height: 24px;
+  border: 1px solid #ccc;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  background-color: #F8F8F8;
+  position: relative;
+  box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1);
+}
+
+.progress-label {
+  position: absolute;
+  text-align: center;
+  font-weight: bold;
+  width: 100%; margin: 0;
+  line-height: 24px;
+  color: #333;
+  text-shadow:
+    1px 1px 0px #fefefe,
+    -1px -1px 0px #fefefe,
+    -1px 1px 0px #fefefe,
+    1px -1px 0px #fefefe,
+    0px 1px 0px #fefefe,
+    0px -1px 0px #fefefe,
+    1px 0px 0px #fefefe,
+    -1px 0px 0px #fefefe,
+    1px 1px 2px #000;
+  -webkit-font-smoothing: antialiased !important;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.progress-bar {
+  height: 24px;
+  float: left;
+  border-right: 1px solid #ccc;
+  -webkit-border-radius: 3px;
+  -moz-border-radius: 3px;
+  border-radius: 3px;
+  background-color: #34c2e3;
+  box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5);
+  background-size: 30px 30px;
+  background-image: -webkit-linear-gradient(
+    135deg,
+    rgba(255, 255, 255, .4) 27%, transparent 27%,
+    transparent 53%, rgba(255, 255, 255, .4) 53%,
+    rgba(255, 255, 255, .4) 77%, transparent 77%,
+    transparent
+  );
+  background-image: -moz-linear-gradient(
+    135deg,
+    rgba(255, 255, 255, .4) 27%, transparent 27%,
+    transparent 53%, rgba(255, 255, 255, .4) 53%,
+    rgba(255, 255, 255, .4) 77%, transparent 77%,
+    transparent
+  );
+  background-image: -ms-linear-gradient(
+    135deg,
+    rgba(255, 255, 255, .4) 27%, transparent 27%,
+    transparent 53%, rgba(255, 255, 255, .4) 53%,
+    rgba(255, 255, 255, .4) 77%, transparent 77%,
+    transparent
+  );
+  background-image: -o-linear-gradient(
+    135deg,
+    rgba(255, 255, 255, .4) 27%, transparent 27%,
+    transparent 53%, rgba(255, 255, 255, .4) 53%,
+    rgba(255, 255, 255, .4) 77%, transparent 77%,
+    transparent
+  );
+  background-image: linear-gradient(
+    135deg,
+    rgba(255, 255, 255, .4) 27%, transparent 27%,
+    transparent 53%, rgba(255, 255, 255, .4) 53%,
+    rgba(255, 255, 255, .4) 77%, transparent 77%,
+    transparent
+  );
+}
+
+.progress-100plus .progress-bar { background-color: #1ee038; }
+.progress-80plus .progress-bar { background-color: #86e01e; }
+.progress-60plus .progress-bar { background-color: #f2d31b; }
+.progress-40plus .progress-bar { background-color: #f2b01e; }
+.progress-20plus .progress-bar { background-color: #f27011; }
+.progress-0plus .progress-bar { background-color: #f63a0f; }
+
+.gloss .progress-bar {
+  box-shadow:
+    inset -1px 1px 0px rgba(255, 255, 255, .5),
+    inset 0 -4px 12px rgba(255, 255, 255, .7),
+    inset 0 4px 12px rgba(255, 255, 255, .7),
+    inset 0 -12px 0px rgba(0, 0, 0, .05),
+    inset 1px -1px 0px rgba(255, 255, 255, .2);
+}
+
+.candystripe-animate .progress-bar{
+  -webkit-animation: animate-stripes 3s linear infinite;
+  -moz-animation: animate-stripes 3s linear infinite;
+  animation: animate-stripes 3s linear infinite;
+}
+
+@-webkit-keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
+@-moz-keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
+@keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
+
+/* Inlines */
+b, strong { font-weight: bold; }
+
+mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
+
+sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
+sup { top: -0.5em; }
+sub { bottom: -0.25em; }
+
+dfn { font-style: italic; }
+
+/* Lists */
+ul, ol { padding-left: 30px; }
+li p:last-child { margin:0 }
+.task-list-item { list-style-type: none; }
+.task-list-item input { float:left; margin-left: -20px; margin-top: 6px; }
+dt { font-weight: bold; font-style: italic;}
+dd { margin: 0 0 0 2em; }
+
+/* Tables */
+table { width: 100%; border-collapse: collapse; overflow-x: auto; overflow-y: hidden; display: block;}
+table tr { background-color: #fefefe; }
+table tr:nth-child(2n) { background-color: #f8f8f8; }
+td, th { border: 1px solid #ddd; padding: 6px 13px; }
+
+/* Codehilite Tables */
+.codehilitetable { border: 0; border-spacing: 0; }
+.linenos, .code, .codehilitetable td { border: 0; padding: 0; }
+td:not(.linenos) .linenodiv { padding: 0 !important; }
+.code { width: 100%; }
+.linenos div pre, .linenodiv pre {
+  border: 0;
+  border-top: 1px solid #CCC;
+  border-left: 1px solid #CCC;
+  border-right: 1px solid #CCC;
+  border-bottom: 1px solid #CCC;
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+  -webkit-border-top-left-radius: 3px;
+  -webkit-border-bottom-left-radius: 3px;
+  -moz-border-radius-topleft: 3px;
+  -moz-border-radius-bottomleft: 3px;
+  border-top-left-radius: 3px;
+  border-bottom-left-radius: 3px;
+}
+
+.code div pre {
+  border: 0;
+  border-top: 1px solid #CCC;
+  border-right: 1px solid #CCC;
+  border-bottom: 1px solid #CCC;
+  -webkit-border-radius: 0;
+  -moz-border-radius: 0;
+  border-radius: 0;
+  -webkit-border-top-right-radius: 3px;
+  -webkit-border-bottom-right-radius: 3px;
+  -moz-border-radius-topright: 3px;
+  -moz-border-radius-bottomright: 3px;
+  border-top-right-radius: 3px;
+  border-bottom-right-radius: 3px;
+}
+
+/* Media */
+@media only screen and (min-width: 480px) {
+  body{ font-size:14px; }
+}
+
+@media only screen and (min-width: 768px) {
+  body{ font-size:16px; }
+}
+
+@media print {
+  * { background: transparent !important; color: black !important; filter:none !important; -ms-filter: none !important; }
+  body{ font-size:12pt; max-width:100%; outline:none; border: 0;}
+  a, a:visited { text-decoration: underline; }
+  .headeranchor-link { display: none; }
+  hr { height: 1px; border:0; border-bottom:1px solid black; }
+  a[href]:after { content: " (" attr(href) ")"; }
+  abbr[title]:after { content: " (" attr(title) ")"; }
+  .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
+  pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
+  pre, blockquote { border: 1px solid #999; padding-right: 1em; page-break-inside: avoid; }
+  .progress, .progress-bar { box-shadow: none; }
+  tr, img { page-break-inside: avoid; }
+  img { max-width: 100% !important; }
+  p, h2, h3 { orphans: 3; widows: 3; }
+  h2, h3 { page-break-after: avoid; }
+}
+
+
+    </style>
+    <title>README</title></head>
+<body><h2 id="to-load-run-integration-tests"><a name="user-content-to-load-run-integration-tests"
+                                                href="#to-load-run-integration-tests"
+                                                class="headeranchor-link" aria-hidden="true"><span
+        class="headeranchor"></span></a>TO LOAD &amp; RUN INTEGRATION TESTS</h2>
+<p>See: allwpilib/test-scripts</p></body>
+</html>
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/README.md b/third_party/allwpilib_2018/wpilibjIntegrationTests/README.md
new file mode 100644
index 0000000..5aa567a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/README.md
@@ -0,0 +1,3 @@
+## TO LOAD & RUN INTEGRATION TESTS
+
+See: allwpilib/test-scripts
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/build.gradle b/third_party/allwpilib_2018/wpilibjIntegrationTests/build.gradle
new file mode 100644
index 0000000..865b801
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/build.gradle
@@ -0,0 +1,39 @@
+plugins {
+    id 'java'
+    id 'application'
+    id 'com.github.johnrengelman.shadow' version '1.2.3'
+}
+
+repositories {
+    mavenCentral()
+}
+
+mainClassName = 'edu.wpi.first.wpilibj.test.AntJunitLanucher'
+
+dependencies {
+    compile project(':wpilibj')
+    compile files(project(':wpilibj').sourceSets.test.output)
+    compile 'edu.wpi.first.wpiutil:wpiutil-java:3.+'
+    compile 'edu.wpi.first.ntcore:ntcore-java:4.+'
+    compile 'org.opencv:opencv-java:3.2.0'
+    compile 'edu.wpi.first.cscore:cscore-java:1.+'
+    compile 'junit:junit:4.11'
+    compile 'com.googlecode.junit-toolbox:junit-toolbox:2.0'
+    compile 'org.apache.ant:ant:1.9.4'
+    compile 'org.apache.ant:ant-junit:1.9.4'
+}
+
+build.dependsOn shadowJar
+
+def testOutputFolder = file("${project(':').buildDir}/integrationTestFiles")
+
+task copyWpilibJIntegrationTestJarToOutput(type: Copy) {
+    destinationDir testOutputFolder
+    dependsOn shadowJar
+    inputs.file shadowJar
+    from (shadowJar) {
+        into 'java'
+    }
+}
+
+build.dependsOn copyWpilibJIntegrationTestJarToOutput
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/runintegrationjavaprogram b/third_party/allwpilib_2018/wpilibjIntegrationTests/runintegrationjavaprogram
new file mode 100644
index 0000000..dc80c8d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/runintegrationjavaprogram
@@ -0,0 +1,5 @@
+#. ./.profile
+killall java
+killall FRCUserProgram
+sleep 1
+/usr/local/frc/JRE/bin/java -ea -jar wpilibJavaIntegrationTests-0.1.0-SNAPSHOT.jar $@
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java
new file mode 100644
index 0000000..a53bd21
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AbstractInterruptTest.java
@@ -0,0 +1,311 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.Test;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.hamcrest.Matchers.both;
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.lessThan;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertThat;
+
+/**
+ * This class should not be run as a test explicitly. Instead it should be extended by tests that
+ * use the InterruptableSensorBase.
+ */
+public abstract class AbstractInterruptTest extends AbstractComsSetup {
+  private InterruptableSensorBase m_interruptable = null;
+
+  private InterruptableSensorBase getInterruptable() {
+    if (m_interruptable == null) {
+      m_interruptable = giveInterruptableSensorBase();
+    }
+    return m_interruptable;
+  }
+
+
+  @After
+  public void interruptTeardown() {
+    if (m_interruptable != null) {
+      freeInterruptableSensorBase();
+      m_interruptable = null;
+    }
+  }
+
+  /**
+   * Give the interruptable sensor base that interrupts can be attached to.
+   */
+  abstract InterruptableSensorBase giveInterruptableSensorBase();
+
+  /**
+   * Cleans up the interruptable sensor base. This is only called if {@link
+   * #giveInterruptableSensorBase()} is called.
+   */
+  abstract void freeInterruptableSensorBase();
+
+  /**
+   * Perform whatever action is required to set the interrupt high.
+   */
+  abstract void setInterruptHigh();
+
+  /**
+   * Perform whatever action is required to set the interrupt low.
+   */
+  abstract void setInterruptLow();
+
+
+  private class InterruptCounter {
+    private final AtomicInteger m_count = new AtomicInteger();
+
+    void increment() {
+      m_count.addAndGet(1);
+    }
+
+    int getCount() {
+      return m_count.get();
+    }
+  }
+
+  private class TestInterruptHandlerFunction extends InterruptHandlerFunction<InterruptCounter> {
+    protected final AtomicBoolean m_exceptionThrown = new AtomicBoolean(false);
+    /**
+     * Stores the time that the interrupt fires.
+     */
+    final AtomicLong m_interruptFireTime = new AtomicLong();
+    /**
+     * Stores if the interrupt has completed at least once.
+     */
+    final AtomicBoolean m_interruptComplete = new AtomicBoolean(false);
+    protected Exception m_ex;
+    final InterruptCounter m_counter;
+
+    TestInterruptHandlerFunction(InterruptCounter counter) {
+      m_counter = counter;
+    }
+
+    @Override
+    public void interruptFired(int interruptAssertedMask, InterruptCounter param) {
+      m_interruptFireTime.set(RobotController.getFPGATime());
+      m_counter.increment();
+      try {
+        // This won't cause the test to fail
+        assertSame(m_counter, param);
+      } catch (Exception ex) {
+        // So we must throw the exception within the test
+        m_exceptionThrown.set(true);
+        m_ex = ex;
+      }
+      m_interruptComplete.set(true);
+    }
+
+    @Override
+    public InterruptCounter overridableParameter() {
+      return m_counter;
+    }
+  }
+
+  @Test(timeout = 1000)
+  public void testSingleInterruptsTriggering() throws Exception {
+    // Given
+    final InterruptCounter counter = new InterruptCounter();
+    TestInterruptHandlerFunction function = new TestInterruptHandlerFunction(counter);
+
+    // When
+    getInterruptable().requestInterrupts(function);
+    getInterruptable().enableInterrupts();
+
+    setInterruptLow();
+    Timer.delay(0.01);
+    // Note: Utility.getFPGATime() is used because double values can turn over
+    // after the robot has been running for a long time
+    final long interruptTriggerTime = RobotController.getFPGATime();
+    setInterruptHigh();
+
+    // Delay until the interrupt is complete
+    while (!function.m_interruptComplete.get()) {
+      Timer.delay(.005);
+    }
+
+
+    // Then
+    assertEquals("The interrupt did not fire the expected number of times", 1, counter.getCount());
+    // If the test within the interrupt failed
+    if (function.m_exceptionThrown.get()) {
+      throw function.m_ex;
+    }
+    final long range = 10000; // in microseconds
+    assertThat(
+        "The interrupt did not fire within the expected time period (values in milliseconds)",
+        function.m_interruptFireTime.get(),
+        both(greaterThan(interruptTriggerTime - range)).and(lessThan(interruptTriggerTime
+            + range)));
+    assertThat(
+        "The readRisingTimestamp() did not return the correct value (values in seconds)",
+        getInterruptable().readRisingTimestamp(),
+        both(greaterThan((interruptTriggerTime - range) / 1e6)).and(
+            lessThan((interruptTriggerTime + range) / 1e6)));
+  }
+
+  @Test(timeout = 2000)
+  public void testMultipleInterruptsTriggering() throws Exception {
+    // Given
+    final InterruptCounter counter = new InterruptCounter();
+    TestInterruptHandlerFunction function = new TestInterruptHandlerFunction(counter);
+
+    // When
+    getInterruptable().requestInterrupts(function);
+    getInterruptable().enableInterrupts();
+
+    final int fireCount = 50;
+    for (int i = 0; i < fireCount; i++) {
+      setInterruptLow();
+      setInterruptHigh();
+      // Wait for the interrupt to complete before moving on
+      while (!function.m_interruptComplete.getAndSet(false)) {
+        Timer.delay(.005);
+      }
+    }
+    // Then
+    assertEquals("The interrupt did not fire the expected number of times", fireCount,
+        counter.getCount());
+  }
+
+  /**
+   * The timeout length for this test in seconds.
+   */
+  private static final int synchronousTimeout = 5;
+
+  @Test(timeout = (long) (synchronousTimeout * 1e3))
+  public void testSynchronousInterruptsTriggering() {
+    // Given
+    getInterruptable().requestInterrupts();
+
+    final double synchronousDelay = synchronousTimeout / 2.;
+    final Runnable runnable = () -> {
+      Timer.delay(synchronousDelay);
+      setInterruptLow();
+      setInterruptHigh();
+    };
+
+    // When
+
+    // Note: the long time value is used because doubles can flip if the robot
+    // is left running for long enough
+    final long startTimeStamp = RobotController.getFPGATime();
+    new Thread(runnable).start();
+    // Delay for twice as long as the timeout so the test should fail first
+    getInterruptable().waitForInterrupt(synchronousTimeout * 2);
+    final long stopTimeStamp = RobotController.getFPGATime();
+
+    // Then
+    // The test will not have timed out and:
+    final double interruptRunTime = (stopTimeStamp - startTimeStamp) * 1e-6;
+    assertEquals("The interrupt did not run for the expected amount of time (units in seconds)",
+        synchronousDelay, interruptRunTime, .1);
+  }
+
+  @Test(timeout = (long) (synchronousTimeout * 1e3))
+  public void testSynchronousInterruptsWaitResultTimeout() {
+    // Given
+    getInterruptable().requestInterrupts();
+
+    //Don't fire interrupt. Expect it to timeout.
+    InterruptableSensorBase.WaitResult result = getInterruptable()
+        .waitForInterrupt(synchronousTimeout / 2);
+
+    assertEquals("The interrupt did not time out correctly.", result, InterruptableSensorBase
+        .WaitResult.kTimeout);
+  }
+
+  @Test(timeout = (long) (synchronousTimeout * 1e3))
+  public void testSynchronousInterruptsWaitResultRisingEdge() {
+    // Given
+    getInterruptable().requestInterrupts();
+
+    final double synchronousDelay = synchronousTimeout / 2.;
+    final Runnable runnable = () -> {
+      Timer.delay(synchronousDelay);
+      setInterruptLow();
+      setInterruptHigh();
+    };
+
+    new Thread(runnable).start();
+    // Delay for twice as long as the timeout so the test should fail first
+    InterruptableSensorBase.WaitResult result = getInterruptable()
+        .waitForInterrupt(synchronousTimeout * 2);
+
+    assertEquals("The interrupt did not fire on the rising edge.", result,
+        InterruptableSensorBase.WaitResult.kRisingEdge);
+  }
+
+  @Test(timeout = (long) (synchronousTimeout * 1e3))
+  public void testSynchronousInterruptsWaitResultFallingEdge() {
+    // Given
+    getInterruptable().requestInterrupts();
+    getInterruptable().setUpSourceEdge(false, true);
+
+    final double synchronousDelay = synchronousTimeout / 2.;
+    final Runnable runnable = () -> {
+      Timer.delay(synchronousDelay);
+      setInterruptHigh();
+      setInterruptLow();
+    };
+
+    new Thread(runnable).start();
+    // Delay for twice as long as the timeout so the test should fail first
+    InterruptableSensorBase.WaitResult result = getInterruptable()
+        .waitForInterrupt(synchronousTimeout * 2);
+
+    assertEquals("The interrupt did not fire on the falling edge.", result,
+        InterruptableSensorBase.WaitResult.kFallingEdge);
+  }
+
+
+  @Test(timeout = 4000)
+  public void testDisableStopsInterruptFiring() {
+    final InterruptCounter counter = new InterruptCounter();
+    TestInterruptHandlerFunction function = new TestInterruptHandlerFunction(counter);
+
+    // When
+    getInterruptable().requestInterrupts(function);
+    getInterruptable().enableInterrupts();
+
+    final int fireCount = 50;
+    for (int i = 0; i < fireCount; i++) {
+      setInterruptLow();
+      setInterruptHigh();
+      // Wait for the interrupt to complete before moving on
+      while (!function.m_interruptComplete.getAndSet(false)) {
+        Timer.delay(.005);
+      }
+    }
+    getInterruptable().disableInterrupts();
+    // TestBench.out().println("Finished disabling the robot");
+
+    for (int i = 0; i < fireCount; i++) {
+      setInterruptLow();
+      setInterruptHigh();
+      // Just wait because the interrupt should not fire
+      Timer.delay(.005);
+    }
+
+    // Then
+    assertEquals("The interrupt did not fire the expected number of times", fireCount,
+        counter.getCount());
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AnalogCrossConnectTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AnalogCrossConnectTest.java
new file mode 100644
index 0000000..6ccff8c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AnalogCrossConnectTest.java
@@ -0,0 +1,198 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.AnalogTriggerOutput.AnalogTriggerType;
+import edu.wpi.first.wpilibj.fixtures.AnalogCrossConnectFixture;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Test that covers the {@link AnalogCrossConnectFixture}.
+ */
+public class AnalogCrossConnectTest extends AbstractInterruptTest {
+  private static final Logger logger = Logger.getLogger(AnalogCrossConnectTest.class.getName());
+
+  private static AnalogCrossConnectFixture analogIO;
+
+  static final double kDelayTime = 0.01;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+    analogIO = TestBench.getAnalogCrossConnectFixture();
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    analogIO.teardown();
+    analogIO = null;
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    analogIO.setup();
+  }
+
+
+  @Test
+  public void testAnalogOuput() {
+    for (int i = 0; i < 50; i++) {
+      analogIO.getOutput().setVoltage(i / 10.0);
+      Timer.delay(kDelayTime);
+      assertEquals(analogIO.getOutput().getVoltage(), analogIO.getInput().getVoltage(), 0.01);
+    }
+  }
+
+  @Test
+  public void testAnalogTriggerBelowWindow() {
+    // Given
+    AnalogTrigger trigger = new AnalogTrigger(analogIO.getInput());
+    trigger.setLimitsVoltage(2.0, 3.0);
+
+    // When the output voltage is than less the lower limit
+    analogIO.getOutput().setVoltage(1.0);
+    Timer.delay(kDelayTime);
+
+    // Then the analog trigger is not in the window and the trigger state is off
+    assertFalse("Analog trigger is in the window (2V, 3V)", trigger.getInWindow());
+    assertFalse("Analog trigger is on", trigger.getTriggerState());
+
+    trigger.free();
+  }
+
+  @Test
+  public void testAnalogTriggerInWindow() {
+    // Given
+    AnalogTrigger trigger = new AnalogTrigger(analogIO.getInput());
+    trigger.setLimitsVoltage(2.0, 3.0);
+
+    // When the output voltage is within the lower and upper limits
+    analogIO.getOutput().setVoltage(2.5f);
+    Timer.delay(kDelayTime);
+
+    // Then the analog trigger is in the window and the trigger state is off
+    assertTrue("Analog trigger is not in the window (2V, 3V)", trigger.getInWindow());
+    assertFalse("Analog trigger is on", trigger.getTriggerState());
+
+    trigger.free();
+  }
+
+  @Test
+  public void testAnalogTriggerAboveWindow() {
+    // Given
+    AnalogTrigger trigger = new AnalogTrigger(analogIO.getInput());
+    trigger.setLimitsVoltage(2.0, 3.0);
+
+    // When the output voltage is greater than the upper limit
+    analogIO.getOutput().setVoltage(4.0);
+    Timer.delay(kDelayTime);
+
+    // Then the analog trigger is not in the window and the trigger state is on
+    assertFalse("Analog trigger is in the window (2V, 3V)", trigger.getInWindow());
+    assertTrue("Analog trigger is not on", trigger.getTriggerState());
+
+    trigger.free();
+  }
+
+  @Test
+  public void testAnalogTriggerCounter() {
+    // Given
+    AnalogTrigger trigger = new AnalogTrigger(analogIO.getInput());
+    trigger.setLimitsVoltage(2.0, 3.0);
+    Counter counter = new Counter(trigger);
+
+    // When the analog output is turned low and high 50 times
+    for (int i = 0; i < 50; i++) {
+      analogIO.getOutput().setVoltage(1.0);
+      Timer.delay(kDelayTime);
+      analogIO.getOutput().setVoltage(4.0);
+      Timer.delay(kDelayTime);
+    }
+
+    // Then the counter should be at 50
+    assertEquals("Analog trigger counter did not count 50 ticks", 50, counter.get());
+  }
+
+  @Test(expected = RuntimeException.class)
+  public void testRuntimeExceptionOnInvalidAccumulatorPort() {
+    analogIO.getInput().getAccumulatorCount();
+  }
+
+  private AnalogTrigger m_interruptTrigger;
+  private AnalogTriggerOutput m_interruptTriggerOutput;
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see
+   * edu.wpi.first.wpilibj.AbstractInterruptTest#giveInterruptableSensorBase()
+   */
+  @Override
+  InterruptableSensorBase giveInterruptableSensorBase() {
+    m_interruptTrigger = new AnalogTrigger(analogIO.getInput());
+    m_interruptTrigger.setLimitsVoltage(2.0, 3.0);
+    m_interruptTriggerOutput = new AnalogTriggerOutput(m_interruptTrigger,
+        AnalogTriggerType.kState);
+    return m_interruptTriggerOutput;
+  }
+
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see
+   * edu.wpi.first.wpilibj.AbstractInterruptTest#freeInterruptableSensorBase()
+   */
+  @Override
+  void freeInterruptableSensorBase() {
+    m_interruptTriggerOutput.cancelInterrupts();
+    m_interruptTriggerOutput.free();
+    m_interruptTriggerOutput = null;
+    m_interruptTrigger.free();
+    m_interruptTrigger = null;
+  }
+
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.AbstractInterruptTest#setInterruptHigh()
+   */
+  @Override
+  void setInterruptHigh() {
+    analogIO.getOutput().setVoltage(4.0);
+    Timer.delay(kDelayTime);
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.AbstractInterruptTest#setInterruptLow()
+   */
+  @Override
+  void setInterruptLow() {
+    analogIO.getOutput().setVoltage(1.0);
+    Timer.delay(kDelayTime);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AnalogPotentiometerTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AnalogPotentiometerTest.java
new file mode 100644
index 0000000..dce2ac8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/AnalogPotentiometerTest.java
@@ -0,0 +1,70 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.AnalogCrossConnectFixture;
+import edu.wpi.first.wpilibj.mockhardware.FakePotentiometerSource;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests the {@link AnalogPotentiometer}.
+ */
+public class AnalogPotentiometerTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(AnalogPotentiometerTest.class.getName());
+  private AnalogCrossConnectFixture m_analogIO;
+  private FakePotentiometerSource m_potSource;
+  private AnalogPotentiometer m_pot;
+
+  private static final double DOUBLE_COMPARISON_DELTA = 2.0;
+
+  @Before
+  public void setUp() throws Exception {
+    m_analogIO = TestBench.getAnalogCrossConnectFixture();
+    m_potSource = new FakePotentiometerSource(m_analogIO.getOutput(), 360);
+    m_pot = new AnalogPotentiometer(m_analogIO.getInput(), 360.0, 0);
+
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    m_potSource.reset();
+    m_pot.free();
+    m_analogIO.teardown();
+  }
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @Test
+  public void testInitialSettings() {
+    assertEquals(0, m_pot.get(), DOUBLE_COMPARISON_DELTA);
+  }
+
+  @Test
+  public void testRangeValues() {
+    for (double i = 0.0; i < 360.0; i = i + 1.0) {
+      m_potSource.setAngle(i);
+      m_potSource.setMaxVoltage(ControllerPower.getVoltage5V());
+      Timer.delay(.02);
+      assertEquals(i, m_pot.get(), DOUBLE_COMPARISON_DELTA);
+    }
+  }
+
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/BuiltInAccelerometerTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/BuiltInAccelerometerTest.java
new file mode 100644
index 0000000..8256444
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/BuiltInAccelerometerTest.java
@@ -0,0 +1,69 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.interfaces.Accelerometer;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(Parameterized.class)
+public class BuiltInAccelerometerTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(BuiltInAccelerometerTest.class.getName());
+  private static final double kAccelerationTolerance = 0.1;
+  private final BuiltInAccelerometer m_accelerometer;
+
+  public BuiltInAccelerometerTest(Accelerometer.Range range) {
+    m_accelerometer = new BuiltInAccelerometer(range);
+  }
+
+  @BeforeClass
+  public static void waitASecond() {
+    /*
+     * The testbench sometimes shakes a little from a previous test. Give it
+     * some time.
+     */
+    Timer.delay(1.0);
+  }
+
+  /**
+   * Test with all valid ranges to make sure unpacking is always done correctly.
+   */
+  @Parameters
+  public static Collection<Accelerometer.Range[]> generateData() {
+    return Arrays.asList(new Accelerometer.Range[][]{{Accelerometer.Range.k2G},
+        {Accelerometer.Range.k4G}, {Accelerometer.Range.k8G}});
+  }
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * There's not much we can automatically test with the on-board accelerometer, but checking for
+   * gravity is probably good enough to tell that it's working.
+   */
+  @Test
+  public void testAccelerometer() {
+    assertEquals(0.0, m_accelerometer.getX(), kAccelerationTolerance);
+    assertEquals(1.0, m_accelerometer.getY(), kAccelerationTolerance);
+    assertEquals(0.0, m_accelerometer.getZ(), kAccelerationTolerance);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/ConstantsPortsTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/ConstantsPortsTest.java
new file mode 100644
index 0000000..c181e8d
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/ConstantsPortsTest.java
@@ -0,0 +1,99 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests for checking our constant and port values.
+ */
+public class ConstantsPortsTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(ConstantsPortsTest.class.getName());
+
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * kDigitalChannels.
+   */
+  @Test
+  public void testDigitalChannels() {
+    assertEquals(31, SensorBase.kDigitalChannels);
+  }
+
+  /**
+   * kAnalogInputChannels.
+   */
+  @Test
+  public void testAnalogInputChannels() {
+    assertEquals(8, SensorBase.kAnalogInputChannels);
+  }
+
+  /**
+   * kAnalogOutputChannels.
+   */
+  @Test
+  public void testAnalogOutputChannels() {
+    assertEquals(2, SensorBase.kAnalogOutputChannels);
+  }
+
+  /**
+   * kSolenoidChannels.
+   */
+  @Test
+  public void testSolenoidChannels() {
+    assertEquals(8, SensorBase.kSolenoidChannels);
+  }
+
+  /**
+   * kPwmChannels.
+   */
+  @Test
+  public void testPwmChannels() {
+    assertEquals(20, SensorBase.kPwmChannels);
+  }
+
+  /**
+   * kRelayChannels.
+   */
+  @Test
+  public void testRelayChannels() {
+    assertEquals(4, SensorBase.kRelayChannels);
+  }
+
+  /**
+   * kPDPChannels.
+   */
+  @Test
+  public void testPDPChannels() {
+    assertEquals(16, SensorBase.kPDPChannels);
+  }
+
+  /**
+   * kPDPModules.
+   */
+  @Test
+  public void testPDPModules() {
+    assertEquals(63, SensorBase.kPDPModules);
+  }
+
+  /**
+   * kPCMModules.
+   */
+  @Test
+  public void testPCMModules() {
+    assertEquals(63, SensorBase.kPCMModules);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/CounterTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/CounterTest.java
new file mode 100644
index 0000000..4ad00d7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/CounterTest.java
@@ -0,0 +1,115 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.FakeCounterFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests to see if the Counter is working properly.
+ */
+@RunWith(Parameterized.class)
+public class CounterTest extends AbstractComsSetup {
+  private static FakeCounterFixture counter = null;
+  private static final Logger logger = Logger.getLogger(CounterTest.class.getName());
+
+  Integer m_input;
+  Integer m_output;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * Constructs a Counter Test with the given inputs.
+   *
+   * @param input  The input Port
+   * @param output The output Port
+   */
+  public CounterTest(Integer input, Integer output) {
+    assert input != null;
+    assert output != null;
+
+    m_input = input;
+    m_output = output;
+    // System.out.println("Counter Test: Input: " + input + " Output: " +
+    // output);
+    if (counter != null) {
+      counter.teardown();
+    }
+    counter = new FakeCounterFixture(input, output);
+  }
+
+  /**
+   * Test data generator. This method is called the the JUnit parameterized test runner and returns
+   * a Collection of Arrays. For each Array in the Collection, each array element corresponds to a
+   * parameter in the constructor.
+   */
+  @Parameters
+  public static Collection<Integer[]> generateData() {
+    // In this example, the parameter generator returns a List of
+    // arrays. Each array has two elements: { Digital input port, Digital output
+    // port}.
+    // These data are hard-coded into the class, but they could be
+    // generated or loaded in any way you like.
+    return TestBench.getInstance().getDIOCrossConnectCollection();
+  }
+
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    counter.teardown();
+    counter = null;
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    counter.setup();
+  }
+
+  /**
+   * Tests the default state of the counter immediately after reset.
+   */
+  @Test
+  public void testDefault() {
+    assertEquals("Counter did not reset to 0", 0, counter.getCounter().get());
+  }
+
+  @Test(timeout = 5000)
+  public void testCount() {
+    final int goal = 100;
+    counter.getFakeCounterSource().setCount(goal);
+    counter.getFakeCounterSource().execute();
+
+    final int count = counter.getCounter().get();
+
+    assertTrue("Fake Counter, Input: " + m_input + ", Output: " + m_output + ", did not return "
+        + goal + " instead got: " + count, count == goal);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DIOCrossConnectTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DIOCrossConnectTest.java
new file mode 100644
index 0000000..ff776a0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DIOCrossConnectTest.java
@@ -0,0 +1,196 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.DIOCrossConnectFixture;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests to see if the Digital ports are working properly.
+ */
+@RunWith(Parameterized.class)
+public class DIOCrossConnectTest extends AbstractInterruptTest {
+  private static final Logger logger = Logger.getLogger(DIOCrossConnectTest.class.getName());
+
+  private static DIOCrossConnectFixture dio = null;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * Default constructor for the DIOCrossConnectTest This test is parameterized in order to allow it
+   * to be tested using a variety of different input/output pairs without duplicate code.<br> This
+   * class takes Integer port values instead of DigitalClasses because it would force them to be
+   * instantiated at the same time which could (untested) cause port binding errors.
+   *
+   * @param input  The port for the input wire
+   * @param output The port for the output wire
+   */
+  public DIOCrossConnectTest(Integer input, Integer output) {
+    if (dio != null) {
+      dio.teardown();
+    }
+    dio = new DIOCrossConnectFixture(input, output);
+  }
+
+
+  /**
+   * Test data generator. This method is called the the JUnit parameterized test runner and returns
+   * a Collection of Arrays. For each Array in the Collection, each array element corresponds to a
+   * parameter in the constructor.
+   */
+  @Parameters(name = "{index}: Input Port: {0} Output Port: {1}")
+  public static Collection<Integer[]> generateData() {
+    // In this example, the parameter generator returns a List of
+    // arrays. Each array has two elements: { Digital input port, Digital output
+    // port}.
+    // These data are hard-coded into the class, but they could be
+    // generated or loaded in any way you like.
+    return TestBench.getInstance().getDIOCrossConnectCollection();
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    dio.teardown();
+    dio = null;
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    dio.reset();
+  }
+
+  /**
+   * Tests to see if the DIO can create and recognize a high value.
+   */
+  @Test
+  public void testSetHigh() {
+    dio.getOutput().set(true);
+    assertTrue("DIO Not High after no delay", dio.getInput().get());
+    Timer.delay(.02);
+    assertTrue("DIO Not High after .05s delay", dio.getInput().get());
+  }
+
+  /**
+   * Tests to see if the DIO can create and recognize a low value.
+   */
+  @Test
+  public void testSetLow() {
+    dio.getOutput().set(false);
+    assertFalse("DIO Not Low after no delay", dio.getInput().get());
+    Timer.delay(.02);
+    assertFalse("DIO Not Low after .05s delay", dio.getInput().get());
+  }
+
+  /**
+   * Tests to see if the DIO PWM functionality works.
+   */
+  @Test
+  public void testDIOpulseWidthModulation() {
+    dio.getOutput().set(false);
+    assertFalse("DIO Not Low after no delay", dio.getInput().get());
+    //Set frequency to 2.0 Hz
+    dio.getOutput().setPWMRate(2.0);
+    //Enable PWM, but leave it off.
+    dio.getOutput().enablePWM(0.0);
+    Timer.delay(0.5);
+    dio.getOutput().updateDutyCycle(0.5);
+    dio.getInput().requestInterrupts();
+    dio.getInput().setUpSourceEdge(false, true);
+    //TODO: Add return value from WaitForInterrupt
+    dio.getInput().waitForInterrupt(3.0, true);
+    Timer.delay(0.5);
+    final boolean firstCycle = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean secondCycle = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean thirdCycle = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean forthCycle = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean fifthCycle = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean sixthCycle = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean seventhCycle = dio.getInput().get();
+    dio.getOutput().disablePWM();
+    Timer.delay(0.5);
+    final boolean firstAfterStop = dio.getInput().get();
+    Timer.delay(0.5);
+    final boolean secondAfterStop = dio.getInput().get();
+
+    assertFalse("DIO Not Low after first delay", firstCycle);
+    assertTrue("DIO Not High after second delay", secondCycle);
+    assertFalse("DIO Not Low after third delay", thirdCycle);
+    assertTrue("DIO Not High after forth delay", forthCycle);
+    assertFalse("DIO Not Low after fifth delay", fifthCycle);
+    assertTrue("DIO Not High after sixth delay", sixthCycle);
+    assertFalse("DIO Not Low after seventh delay", seventhCycle);
+    assertFalse("DIO Not Low after stopping first read", firstAfterStop);
+    assertFalse("DIO Not Low after stopping second read", secondAfterStop);
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see
+   * edu.wpi.first.wpilibj.AbstractInterruptTest#giveInterruptableSensorBase()
+   */
+  @Override
+  InterruptableSensorBase giveInterruptableSensorBase() {
+    return dio.getInput();
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see
+   * edu.wpi.first.wpilibj.AbstractInterruptTest#freeInterruptableSensorBase()
+   */
+  @Override
+  void freeInterruptableSensorBase() {
+    // Handled in the fixture
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.AbstractInterruptTest#setInterruptHigh()
+   */
+  @Override
+  void setInterruptHigh() {
+    dio.getOutput().set(true);
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.AbstractInterruptTest#setInterruptLow()
+   */
+  @Override
+  void setInterruptLow() {
+    dio.getOutput().set(false);
+
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DigitalGlitchFilterTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DigitalGlitchFilterTest.java
new file mode 100644
index 0000000..e3e1569
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DigitalGlitchFilterTest.java
@@ -0,0 +1,82 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Test for the DigitalGlitchFilter class.
+ */
+public class DigitalGlitchFilterTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(
+      DigitalGlitchFilterTest.class.getName());
+
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * This is a test to make sure that filters can be created and are consistent. This assumes that
+   * the FPGA implementation to actually implement the filter has been tested.  It does validate
+   * that we are successfully able to set and get the active filters for ports and makes sure that
+   * the FPGA filter is changed correctly, and does the same for the period.
+   */
+  @Test
+  public void testDigitalGlitchFilterBasic() {
+    final DigitalInput input1 = new DigitalInput(1);
+    final DigitalInput input2 = new DigitalInput(2);
+    final DigitalInput input3 = new DigitalInput(3);
+    final DigitalInput input4 = new DigitalInput(4);
+    final Encoder encoder5 = new Encoder(5, 6);
+    final Counter counter7 = new Counter(7);
+
+    final DigitalGlitchFilter filter1 = new DigitalGlitchFilter();
+    filter1.add(input1);
+    filter1.setPeriodNanoSeconds(4200);
+
+    final DigitalGlitchFilter filter2 = new DigitalGlitchFilter();
+    filter2.add(input2);
+    filter2.add(input3);
+    filter2.setPeriodNanoSeconds(97100);
+
+    final DigitalGlitchFilter filter3 = new DigitalGlitchFilter();
+    filter3.add(input4);
+    filter3.add(encoder5);
+    filter3.add(counter7);
+    filter3.setPeriodNanoSeconds(167800);
+
+    assertEquals(4200, filter1.getPeriodNanoSeconds());
+    assertEquals(97100, filter2.getPeriodNanoSeconds());
+    assertEquals(167800, filter3.getPeriodNanoSeconds());
+
+    filter1.remove(input1);
+
+    filter2.remove(input2);
+    filter2.remove(input3);
+
+    filter3.remove(input4);
+    filter3.remove(encoder5);
+    filter3.remove(counter7);
+
+    input1.free();
+    input2.free();
+    input3.free();
+    input4.free();
+    encoder5.free();
+    counter7.free();
+    filter1.free();
+    filter2.free();
+    filter3.free();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java
new file mode 100644
index 0000000..094b3a3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/DriverStationTest.java
@@ -0,0 +1,44 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class DriverStationTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(TimerTest.class.getName());
+  private static final double TIMER_TOLERANCE = 0.2;
+  private static final long TIMER_RUNTIME = 1000000; // 1 second
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @Test
+  public void waitForDataTest() {
+    long startTime = RobotController.getFPGATime();
+
+    // Wait for data 50 times
+    for (int i = 0; i < 50; i++) {
+      DriverStation.getInstance().waitForData();
+    }
+    long endTime = RobotController.getFPGATime();
+    long difference = endTime - startTime;
+
+    assertEquals("DriverStation waitForData did not wait long enough", TIMER_RUNTIME, difference,
+        TIMER_TOLERANCE * TIMER_RUNTIME);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/EncoderTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/EncoderTest.java
new file mode 100644
index 0000000..cb78b99
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/EncoderTest.java
@@ -0,0 +1,149 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.FakeEncoderFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertTrue;
+
+
+/**
+ * Test to see if the FPGA properly recognizes a mock Encoder input.
+ */
+@RunWith(Parameterized.class)
+public class EncoderTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(EncoderTest.class.getName());
+  private static FakeEncoderFixture encoder = null;
+
+  private final boolean m_flip; // Does this test need to flip the inputs
+  private final int m_inputA;
+  private final int m_inputB;
+  private final int m_outputA;
+  private final int m_outputB;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * Test data generator. This method is called the the JUnit parametrized test runner and returns
+   * a Collection of Arrays. For each Array in the Collection, each array element corresponds to a
+   * parameter in the constructor.
+   */
+  @Parameters
+  public static Collection<Integer[]> generateData() {
+    return TestBench.getInstance().getEncoderDIOCrossConnectCollection();
+  }
+
+  /**
+   * Constructs a parametrized Encoder Test.
+   *
+   * @param inputA  The port number for inputA
+   * @param outputA The port number for outputA
+   * @param inputB  The port number for inputB
+   * @param outputB The port number for outputB
+   * @param flip    whether or not these set of values require the encoder to be reversed (0 or 1)
+   */
+  public EncoderTest(int inputA, int outputA, int inputB, int outputB, int flip) {
+    m_inputA = inputA;
+    m_inputB = inputB;
+    m_outputA = outputA;
+    m_outputB = outputB;
+
+    // If the encoder from a previous test is allocated then we must free its
+    // members
+    if (encoder != null) {
+      encoder.teardown();
+    }
+    m_flip = flip == 0;
+    encoder = new FakeEncoderFixture(inputA, outputA, inputB, outputB);
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    encoder.teardown();
+    encoder = null;
+  }
+
+  /**
+   * Sets up the test and verifies that the test was reset to the default state.
+   */
+  @Before
+  public void setUp() throws Exception {
+    encoder.setup();
+    testDefaultState();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    encoder.reset();
+  }
+
+  /**
+   * Tests to see if Encoders initialize to zero.
+   */
+  @Test
+  public void testDefaultState() {
+    int value = encoder.getEncoder().get();
+    assertTrue(errorMessage(0, value), value == 0);
+  }
+
+  /**
+   * Tests to see if Encoders can count up successfully.
+   */
+  @Test
+  public void testCountUp() {
+    int goal = 100;
+    encoder.getFakeEncoderSource().setCount(goal);
+    encoder.getFakeEncoderSource().setForward(m_flip);
+    encoder.getFakeEncoderSource().execute();
+    int value = encoder.getEncoder().get();
+    assertTrue(errorMessage(goal, value), value == goal);
+
+  }
+
+  /**
+   * Tests to see if Encoders can count down successfully.
+   */
+  @Test
+  public void testCountDown() {
+    int goal = -100;
+    encoder.getFakeEncoderSource().setCount(goal); // Goal has to be positive
+    encoder.getFakeEncoderSource().setForward(!m_flip);
+    encoder.getFakeEncoderSource().execute();
+    int value = encoder.getEncoder().get();
+    assertTrue(errorMessage(goal, value), value == goal);
+
+  }
+
+  /**
+   * Creates a simple message with the error that was encountered for the Encoders.
+   *
+   * @param goal      The goal that was trying to be reached
+   * @param trueValue The actual value that was reached by the test
+   * @return A fully constructed message with data about where and why the the test failed.
+   */
+  private String errorMessage(int goal, int trueValue) {
+    return "Encoder ({In,Out}): {" + m_inputA + ", " + m_outputA + "},{" + m_inputB + ", "
+        + m_outputB + "} Returned: " + trueValue + ", Wanted: " + goal;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/FilterNoiseTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/FilterNoiseTest.java
new file mode 100644
index 0000000..14a6bc9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/FilterNoiseTest.java
@@ -0,0 +1,97 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.FilterNoiseFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertTrue;
+
+
+@RunWith(Parameterized.class)
+public class FilterNoiseTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(FilterNoiseTest.class.getName());
+
+  private static FilterNoiseFixture<?> me = null;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * Constructs the FilterNoiseTest.
+   *
+   * @param mef The fixture under test.
+   */
+  public FilterNoiseTest(FilterNoiseFixture<?> mef) {
+    logger.fine("Constructor with: " + mef.getType());
+    if (me != null && !me.equals(mef)) {
+      me.teardown();
+    }
+    me = mef;
+  }
+
+  @Parameters(name = "{index}: {0}")
+  public static Collection<FilterNoiseFixture<?>[]> generateData() {
+    return Arrays.asList(new FilterNoiseFixture<?>[][]{
+        {TestBench.getInstance().getSinglePoleIIRNoiseFixture()},
+        {TestBench.getInstance().getMovAvgNoiseFixture()}});
+  }
+
+  @Before
+  public void setUp() {
+    me.setup();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    me.reset();
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() {
+    // Clean up the fixture after the test
+    me.teardown();
+    me = null;
+  }
+
+  /**
+   * Test if the filter reduces the noise produced by a signal generator.
+   */
+  @Test
+  public void testNoiseReduce() {
+    double noiseGenError = 0.0;
+    double filterError = 0.0;
+
+    FilterNoiseFixture.NoiseGenerator noise = me.getNoiseGenerator();
+
+    noise.reset();
+    for (double t = 0; t < TestBench.kFilterTime; t += TestBench.kFilterStep) {
+      final double theoryData = noise.getData(t);
+      filterError += Math.abs(me.getFilter().pidGet() - theoryData);
+      noiseGenError += Math.abs(noise.get() - theoryData);
+    }
+
+    assertTrue(me.getType() + " should have reduced noise accumulation from " + noiseGenError
+        + " but failed. The filter error was " + filterError, noiseGenError > filterError);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/FilterOutputTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/FilterOutputTest.java
new file mode 100644
index 0000000..30a46f1
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/FilterOutputTest.java
@@ -0,0 +1,96 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.FilterOutputFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+
+
+@RunWith(Parameterized.class)
+public class FilterOutputTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(FilterOutputTest.class.getName());
+
+  private double m_expectedOutput;
+
+  private static FilterOutputFixture<?> me = null;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * Constructs a filter output test.
+   *
+   * @param mef The fixture under test.
+   */
+  public FilterOutputTest(FilterOutputFixture<?> mef) {
+    logger.fine("Constructor with: " + mef.getType());
+    if (me != null && !me.equals(mef)) {
+      me.teardown();
+    }
+    me = mef;
+    m_expectedOutput = me.getExpectedOutput();
+  }
+
+  @Parameters(name = "{index}: {0}")
+  public static Collection<FilterOutputFixture<?>[]> generateData() {
+    return Arrays.asList(new FilterOutputFixture<?>[][]{
+        {TestBench.getInstance().getSinglePoleIIROutputFixture()},
+        {TestBench.getInstance().getHighPassOutputFixture()},
+        {TestBench.getInstance().getMovAvgOutputFixture()},
+        {TestBench.getInstance().getPulseFixture()}});
+  }
+
+  @Before
+  public void setUp() {
+    me.setup();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    me.reset();
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() {
+    // Clean up the fixture after the test
+    me.teardown();
+    me = null;
+  }
+
+  /**
+   * Test if the filter produces consistent output for a given data set.
+   */
+  @Test
+  public void testOutput() {
+    me.reset();
+
+    double filterOutput = 0.0;
+    for (double t = 0.0; t < TestBench.kFilterTime; t += TestBench.kFilterStep) {
+      filterOutput = me.getFilter().pidGet();
+    }
+
+    assertEquals(me.getType() + " output was incorrect.", m_expectedOutput, filterOutput, 0.00005);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/GyroTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/GyroTest.java
new file mode 100644
index 0000000..fad1155
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/GyroTest.java
@@ -0,0 +1,129 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.TiltPanCameraFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests that the {@link TiltPanCameraFixture}.
+ */
+public class GyroTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(GyroTest.class.getName());
+
+  public static final double TEST_ANGLE = 90.0;
+
+  private TiltPanCameraFixture m_tpcam;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    logger.fine("Setup: TiltPan camera");
+    m_tpcam = TestBench.getInstance().getTiltPanCam();
+    m_tpcam.setup();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    m_tpcam.teardown();
+  }
+
+  @Test
+  public void testAllGyroTests() {
+    testInitial(m_tpcam.getGyro());
+    testDeviationOverTime(m_tpcam.getGyro());
+    testGyroAngle(m_tpcam.getGyro());
+    testGyroAngleCalibratedParameters();
+  }
+
+  public void testInitial(AnalogGyro gyro) {
+    double angle = gyro.getAngle();
+    assertEquals(errorMessage(angle, 0), 0, angle, .5);
+  }
+
+  /**
+   * Test to see if the Servo and the gyroscope is turning 90 degrees Note servo on TestBench is not
+   * the same type of servo that servo class was designed for so setAngle is significantly off. This
+   * has been calibrated for the servo on the rig.
+   */
+  public void testGyroAngle(AnalogGyro gyro) {
+    // Set angle
+    for (int i = 0; i < 5; i++) {
+      m_tpcam.getPan().set(0);
+      Timer.delay(.1);
+    }
+
+    Timer.delay(0.5);
+    // Reset for setup
+    gyro.reset();
+    Timer.delay(0.5);
+
+    // Perform test
+    for (int i = 0; i < 53; i++) {
+      m_tpcam.getPan().set(i / 100.0);
+      Timer.delay(0.05);
+    }
+    Timer.delay(1.2);
+
+    double angle = gyro.getAngle();
+
+    double difference = TEST_ANGLE - angle;
+
+    double diff = Math.abs(difference);
+
+    assertEquals(errorMessage(diff, TEST_ANGLE), TEST_ANGLE, angle, 10);
+  }
+
+
+  protected void testDeviationOverTime(AnalogGyro gyro) {
+    // Make sure that the test isn't influenced by any previous motions.
+    Timer.delay(0.5);
+    gyro.reset();
+    Timer.delay(0.25);
+    double angle = gyro.getAngle();
+    assertEquals(errorMessage(angle, 0), 0, angle, .5);
+    Timer.delay(5);
+    angle = gyro.getAngle();
+    assertEquals("After 5 seconds " + errorMessage(angle, 0), 0, angle, 2.0);
+  }
+
+  /**
+   * Gets calibrated parameters from already calibrated gyro, allocates a new gyro with the center
+   * and offset parameters, and re-runs the test.
+   */
+  public void testGyroAngleCalibratedParameters() {
+    // Get calibrated parameters to make new Gyro with parameters
+    final double calibratedOffset = m_tpcam.getGyro().getOffset();
+    final int calibratedCenter = m_tpcam.getGyro().getCenter();
+    m_tpcam.freeGyro();
+    m_tpcam.setupGyroParam(calibratedCenter, calibratedOffset);
+    Timer.delay(TiltPanCameraFixture.RESET_TIME);
+    // Repeat tests
+    testInitial(m_tpcam.getGyroParam());
+    testDeviationOverTime(m_tpcam.getGyroParam());
+    testGyroAngle(m_tpcam.getGyroParam());
+  }
+
+  private String errorMessage(double difference, double target) {
+    return "Gyro angle skewed " + difference + " deg away from target " + target;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
new file mode 100644
index 0000000..155b5d7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MockDS.java
@@ -0,0 +1,85 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetSocketAddress;
+import java.net.SocketException;
+
+public class MockDS {
+  private Thread m_thread;
+
+  private void generateEnabledDsPacket(byte[] data, short sendCount) {
+    data[0] = (byte) (sendCount >> 8);
+    data[1] = (byte) sendCount;
+    data[2] = 0x01; // general data tag
+    data[3] = 0x04; // teleop enabled
+    data[4] = 0x10; // normal data request
+    data[5] = 0x00; // red 1 station
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  public void start() {
+
+    m_thread = new Thread(() -> {
+      DatagramSocket socket;
+      try {
+        socket = new DatagramSocket();
+      } catch (SocketException e1) {
+        // TODO Auto-generated catch block
+        e1.printStackTrace();
+        return;
+      }
+      InetSocketAddress addr = new InetSocketAddress("127.0.0.1", 1110);
+      byte[] sendData = new byte[6];
+      DatagramPacket packet = new DatagramPacket(sendData, 0, 6, addr);
+      short sendCount = 0;
+      int initCount = 0;
+      while (!Thread.currentThread().isInterrupted()) {
+        try {
+          Thread.sleep(20);
+          generateEnabledDsPacket(sendData, sendCount++);
+          // ~50 disabled packets are required to make the robot actually enable
+          // 1 is definitely not enough.
+          if (initCount < 50) {
+            initCount++;
+            sendData[3] = 0;
+          }
+          packet.setData(sendData);
+          socket.send(packet);
+        } catch (InterruptedException ex) {
+          Thread.currentThread().interrupt();
+        } catch (IOException ex) {
+          // TODO Auto-generated catch block
+          ex.printStackTrace();
+        }
+      }
+      socket.close();
+    });
+    // Because of the test setup in Java, this thread will not be stopped
+    // So it must be a daemon thread
+    m_thread.setDaemon(true);
+    m_thread.start();
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  public void stop() {
+    if (m_thread == null) {
+      return;
+    }
+    m_thread.interrupt();
+    try {
+      m_thread.join(1000);
+    } catch (InterruptedException ex) {
+      // TODO Auto-generated catch block
+      ex.printStackTrace();
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MotorEncoderTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MotorEncoderTest.java
new file mode 100644
index 0000000..fa1b586
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MotorEncoderTest.java
@@ -0,0 +1,236 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.filters.LinearDigitalFilter;
+import edu.wpi.first.wpilibj.fixtures.MotorEncoderFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+
+@RunWith(Parameterized.class)
+public class MotorEncoderTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(MotorEncoderTest.class.getName());
+
+  private static final double MOTOR_RUNTIME = .25;
+
+  // private static final List<MotorEncoderFixture> pairs = new
+  // ArrayList<MotorEncoderFixture>();
+  private static MotorEncoderFixture<?> me = null;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  /**
+   * Constructs the test.
+   *
+   * @param mef The fixture under test.
+   */
+  public MotorEncoderTest(MotorEncoderFixture<?> mef) {
+    logger.fine("Constructor with: " + mef.getType());
+    if (me != null && !me.equals(mef)) {
+      me.teardown();
+    }
+    me = mef;
+  }
+
+  @Parameters(name = "{index}: {0}")
+  public static Collection<MotorEncoderFixture<?>[]> generateData() {
+    // logger.fine("Loading the MotorList");
+    return Arrays.asList(new MotorEncoderFixture<?>[][]{{TestBench.getInstance().getTalonPair()},
+        {TestBench.getInstance().getVictorPair()}, {TestBench.getInstance().getJaguarPair()}});
+  }
+
+  @Before
+  public void setUp() {
+    double initialSpeed = me.getMotor().get();
+    assertTrue(me.getType() + " Did not start with an initial speed of 0 instead got: "
+        + initialSpeed, Math.abs(initialSpeed) < 0.001);
+    me.setup();
+
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    me.reset();
+    encodersResetCheck(me);
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() {
+    // Clean up the fixture after the test
+    me.teardown();
+    me = null;
+  }
+
+  /**
+   * Test to ensure that the isMotorWithinRange method is functioning properly. Really only needs to
+   * run on one MotorEncoderFixture to ensure that it is working correctly.
+   */
+  @Test
+  public void testIsMotorWithinRange() {
+    double range = 0.01;
+    assertTrue(me.getType() + " 1", me.isMotorSpeedWithinRange(0.0, range));
+    assertTrue(me.getType() + " 2", me.isMotorSpeedWithinRange(0.0, -range));
+    assertFalse(me.getType() + " 3", me.isMotorSpeedWithinRange(1.0, range));
+    assertFalse(me.getType() + " 4", me.isMotorSpeedWithinRange(-1.0, range));
+  }
+
+  /**
+   * This test is designed to see if the values of different motors will increment when spun
+   * forward.
+   */
+  @Test
+  public void testIncrement() {
+    int startValue = me.getEncoder().get();
+
+    me.getMotor().set(.2);
+    Timer.delay(MOTOR_RUNTIME);
+    int currentValue = me.getEncoder().get();
+    assertTrue(me.getType() + " Encoder not incremented: start: " + startValue + "; current: "
+        + currentValue, startValue < currentValue);
+
+  }
+
+  /**
+   * This test is designed to see if the values of different motors will decrement when spun in
+   * reverse.
+   */
+  @Test
+  public void testDecrement() {
+    int startValue = me.getEncoder().get();
+
+    me.getMotor().set(-.2);
+    Timer.delay(MOTOR_RUNTIME);
+    int currentValue = me.getEncoder().get();
+    assertTrue(me.getType() + " Encoder not decremented: start: " + startValue + "; current: "
+        + currentValue, startValue > currentValue);
+  }
+
+  /**
+   * This method test if the counters count when the motors rotate.
+   */
+  @Test
+  public void testCounter() {
+    final int counter1Start = me.getCounters()[0].get();
+    final int counter2Start = me.getCounters()[1].get();
+
+    me.getMotor().set(.75);
+    Timer.delay(MOTOR_RUNTIME);
+    int counter1End = me.getCounters()[0].get();
+    int counter2End = me.getCounters()[1].get();
+    assertTrue(me.getType() + " Counter not incremented: start: " + counter1Start + "; current: "
+        + counter1End, counter1Start < counter1End);
+    assertTrue(me.getType() + " Counter not incremented: start: " + counter1Start + "; current: "
+        + counter2End, counter2Start < counter2End);
+    me.reset();
+    encodersResetCheck(me);
+  }
+
+  /**
+   * Tests to see if you set the speed to something not {@literal <=} 1.0 if the code appropriately
+   * throttles the value.
+   */
+  @Test
+  public void testSetHighForwardSpeed() {
+    me.getMotor().set(15);
+    assertTrue(me.getType() + " Motor speed was not close to 1.0, was: " + me.getMotor().get(),
+        me.isMotorSpeedWithinRange(1.0, 0.001));
+  }
+
+  /**
+   * Tests to see if you set the speed to something not {@literal >=} -1.0 if the code appropriately
+   * throttles the value.
+   */
+  @Test
+  public void testSetHighReverseSpeed() {
+    me.getMotor().set(-15);
+    assertTrue(me.getType() + " Motor speed was not close to 1.0, was: " + me.getMotor().get(),
+        me.isMotorSpeedWithinRange(-1.0, 0.001));
+  }
+
+
+  @Test
+  public void testPositionPIDController() {
+    me.getEncoder().setPIDSourceType(PIDSourceType.kDisplacement);
+    PIDController pid = new PIDController(0.001, 0.0005, 0, me.getEncoder(), me.getMotor());
+    pid.setAbsoluteTolerance(50.0);
+    pid.setOutputRange(-0.2, 0.2);
+    pid.setSetpoint(1000);
+
+    pid.enable();
+    Timer.delay(10.0);
+    pid.disable();
+
+    assertTrue(
+        "PID loop did not reach setpoint within 10 seconds. The current error was" + pid
+            .getError(), pid.onTarget());
+
+    pid.free();
+  }
+
+  @Test
+  public void testVelocityPIDController() {
+    me.getEncoder().setPIDSourceType(PIDSourceType.kRate);
+    LinearDigitalFilter filter = LinearDigitalFilter.movingAverage(me.getEncoder(), 50);
+    PIDController pid =
+        new PIDController(1e-5, 0.0, 3e-5, 8e-5, filter, me.getMotor());
+    pid.setAbsoluteTolerance(200);
+    pid.setOutputRange(-0.3, 0.3);
+    pid.setSetpoint(600);
+
+    pid.enable();
+    Timer.delay(10.0);
+    pid.disable();
+
+    assertTrue(
+        "PID loop did not reach setpoint within 10 seconds. The error was: " + pid.getError(),
+        pid.onTarget());
+
+    pid.free();
+  }
+
+  /**
+   * Checks to see if the encoders and counters are appropriately reset to zero when reset.
+   *
+   * @param me The MotorEncoderFixture under test
+   */
+  private void encodersResetCheck(MotorEncoderFixture<?> me) {
+    assertEquals(me.getType() + " Encoder value was incorrect after reset.", me.getEncoder().get(),
+        0);
+    assertEquals(me.getType() + " Motor value was incorrect after reset.", me.getMotor().get(), 0,
+        0);
+    assertEquals(me.getType() + " Counter1 value was incorrect after reset.",
+        me.getCounters()[0].get(), 0);
+    assertEquals(me.getType() + " Counter2 value was incorrect after reset.",
+        me.getCounters()[1].get(), 0);
+    Timer.delay(0.5); // so this doesn't fail with the 0.5 second default
+    // timeout on the encoders
+    assertTrue(me.getType() + " Encoder.getStopped() returned false after the motor was reset.", me
+        .getEncoder().getStopped());
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MotorInvertingTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MotorInvertingTest.java
new file mode 100644
index 0000000..13daf64
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/MotorInvertingTest.java
@@ -0,0 +1,134 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.MotorEncoderFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests Inversion of motors using the SpeedController setInverted.
+ */
+@RunWith(Parameterized.class)
+public class MotorInvertingTest extends AbstractComsSetup {
+  static MotorEncoderFixture<?> fixture = null;
+  private static final double motorspeed = 0.2;
+  private static final double delaytime = 0.3;
+
+
+  /**
+   * Constructs the test.
+   *
+   * @param afixture The fixture under test.
+   */
+  public MotorInvertingTest(MotorEncoderFixture<?> afixture) {
+    logger.fine("Constructor with: " + afixture.getType());
+    if (fixture != null && !fixture.equals(afixture)) {
+      fixture.teardown();
+    }
+    fixture = afixture;
+    fixture.setup();
+  }
+
+  @Parameters(name = "{index}: {0}")
+  public static Collection<MotorEncoderFixture<?>[]> generateData() {
+    // logger.fine("Loading the MotorList");
+    return Arrays.asList(new MotorEncoderFixture<?>[][]{{TestBench.getInstance().getTalonPair()},
+        {TestBench.getInstance().getVictorPair()}, {TestBench.getInstance().getJaguarPair()}});
+  }
+
+  private static final Logger logger = Logger.getLogger(MotorInvertingTest.class.getName());
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @Before
+  public void setUp() {
+    // Reset the fixture elements before every test
+    fixture.reset();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    fixture.getMotor().setInverted(false);
+    // Clean up the fixture after the test
+    fixture.teardown();
+  }
+
+  @Test
+  public void testInvertingPositive() {
+    fixture.getMotor().setInverted(false);
+    fixture.getMotor().set(motorspeed);
+    Timer.delay(delaytime);
+    final boolean initDirection = fixture.getEncoder().getDirection();
+    fixture.getMotor().setInverted(true);
+    fixture.getMotor().set(motorspeed);
+    Timer.delay(delaytime);
+    assertFalse("Inverting with Positive value does not change direction", fixture.getEncoder()
+        .getDirection() == initDirection);
+    fixture.getMotor().set(0);
+  }
+
+  @Test
+  public void testInvertingNegative() {
+    fixture.getMotor().setInverted(false);
+    fixture.getMotor().set(-motorspeed);
+    Timer.delay(delaytime);
+    final boolean initDirection = fixture.getEncoder().getDirection();
+    fixture.getMotor().setInverted(true);
+    fixture.getMotor().set(-motorspeed);
+    Timer.delay(delaytime);
+    assertFalse("Inverting with Negative value does not change direction", fixture.getEncoder()
+        .getDirection() == initDirection);
+    fixture.getMotor().set(0);
+  }
+
+  @Test
+  public void testInvertingSwitchingPosToNeg() {
+    fixture.getMotor().setInverted(false);
+    fixture.getMotor().set(motorspeed);
+    Timer.delay(delaytime);
+    final boolean initDirection = fixture.getEncoder().getDirection();
+    fixture.getMotor().setInverted(true);
+    fixture.getMotor().set(-motorspeed);
+    Timer.delay(delaytime);
+    assertTrue("Inverting with Switching value does change direction", fixture.getEncoder()
+        .getDirection() == initDirection);
+    fixture.getMotor().set(0);
+  }
+
+  @Test
+  public void testInvertingSwitchingNegToPos() {
+    fixture.getMotor().setInverted(false);
+    fixture.getMotor().set(-motorspeed);
+    Timer.delay(delaytime);
+    final boolean initDirection = fixture.getEncoder().getDirection();
+    fixture.getMotor().setInverted(true);
+    fixture.getMotor().set(motorspeed);
+    Timer.delay(delaytime);
+    assertTrue("Inverting with Switching value does change direction", fixture.getEncoder()
+        .getDirection() == initDirection);
+    fixture.getMotor().set(0);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java
new file mode 100644
index 0000000..4a0eae0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PCMTest.java
@@ -0,0 +1,275 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Test that covers the {@link Compressor}.
+ */
+
+public class PCMTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(PCMTest.class.getName());
+  /*
+   * The PCM switches the compressor up to 2 seconds after the pressure switch
+   * changes.
+   */
+  protected static final double kCompressorDelayTime = 2.0;
+
+  /* Solenoids should change much more quickly */
+  protected static final double kSolenoidDelayTime = 1.0;
+
+  /*
+   * The voltage divider on the test bench should bring the compressor output to
+   * around these values.
+   */
+  protected static final double kCompressorOnVoltage = 5.00;
+  protected static final double kCompressorOffVoltage = 1.68;
+
+  private static Compressor compressor;
+
+  private static DigitalOutput fakePressureSwitch;
+  private static AnalogInput fakeCompressor;
+
+  private static DigitalInput fakeSolenoid1;
+  private static DigitalInput fakeSolenoid2;
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+    compressor = new Compressor();
+
+    fakePressureSwitch = new DigitalOutput(11);
+    fakeCompressor = new AnalogInput(1);
+
+    fakeSolenoid1 = new DigitalInput(12);
+    fakeSolenoid2 = new DigitalInput(13);
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    compressor.free();
+
+    fakePressureSwitch.free();
+    fakeCompressor.free();
+
+    fakeSolenoid1.free();
+    fakeSolenoid2.free();
+  }
+
+  @Before
+  public void reset() throws Exception {
+    compressor.stop();
+    fakePressureSwitch.set(false);
+  }
+
+  /**
+   * Test if the compressor turns on and off when the pressure switch is toggled.
+   */
+  @Test
+  public void testPressureSwitch() throws Exception {
+    final double range = 0.5;
+    reset();
+    compressor.setClosedLoopControl(true);
+
+    // Turn on the compressor
+    fakePressureSwitch.set(true);
+    Timer.delay(kCompressorDelayTime);
+    assertEquals("Compressor did not turn on when the pressure switch turned on.",
+        kCompressorOnVoltage, fakeCompressor.getVoltage(), range);
+
+    // Turn off the compressor
+    fakePressureSwitch.set(false);
+    Timer.delay(kCompressorDelayTime);
+    assertEquals("Compressor did not turn off when the pressure switch turned off.",
+        kCompressorOffVoltage, fakeCompressor.getVoltage(), range);
+  }
+
+  /**
+   * Test if the correct solenoids turn on and off when they should.
+   */
+  @Test
+  public void testSolenoid() throws Exception {
+    reset();
+
+    Solenoid solenoid1 = new Solenoid(0);
+    Solenoid solenoid2 = new Solenoid(1);
+
+    solenoid1.set(false);
+    solenoid2.set(false);
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    // Turn Solenoid #1 on, and turn Solenoid #2 off
+    solenoid1.set(true);
+    solenoid2.set(false);
+    Timer.delay(kSolenoidDelayTime);
+    assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertTrue("Solenoid #1 did not report on", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    // Turn Solenoid #1 off, and turn Solenoid #2 on
+    solenoid1.set(false);
+    solenoid2.set(true);
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertTrue("Solenoid #2 did not report on", solenoid2.get());
+
+    // Turn both Solenoids on
+    solenoid1.set(true);
+    solenoid2.set(true);
+    Timer.delay(kSolenoidDelayTime);
+    assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertTrue("Solenoid #1 did not report on", solenoid1.get());
+    assertTrue("Solenoid #2 did not report on", solenoid2.get());
+
+    solenoid1.free();
+    solenoid2.free();
+  }
+
+  /**
+   * Test if the correct solenoids turn on and off when they should when used with the
+   * DoubleSolenoid class.
+   */
+  @Test
+  public void doubleSolenoid() {
+    DoubleSolenoid solenoid = new DoubleSolenoid(0, 1);
+
+    solenoid.set(DoubleSolenoid.Value.kOff);
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertTrue("DoubleSolenoid did not report off", solenoid.get() == DoubleSolenoid.Value.kOff);
+
+    solenoid.set(DoubleSolenoid.Value.kForward);
+    Timer.delay(kSolenoidDelayTime);
+    assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertTrue("DoubleSolenoid did not report Forward", solenoid.get() == DoubleSolenoid.Value
+        .kForward);
+
+    solenoid.set(DoubleSolenoid.Value.kReverse);
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertTrue("DoubleSolenoid did not report Reverse", solenoid.get() == DoubleSolenoid.Value
+        .kReverse);
+
+    solenoid.free();
+  }
+
+  /**
+   * Test if the correct solenoids turn on and off when they should.
+   */
+  @Test
+  public void testOneShot() throws Exception {
+    reset();
+
+    Solenoid solenoid1 = new Solenoid(0);
+    Solenoid solenoid2 = new Solenoid(1);
+
+    solenoid1.set(false);
+    solenoid2.set(false);
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    // Pulse Solenoid #1 on, and turn Solenoid #2 off
+    solenoid1.setPulseDuration(2 * kSolenoidDelayTime);
+    solenoid1.startPulse();
+    solenoid2.set(false);
+    Timer.delay(kSolenoidDelayTime);
+    assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertTrue("Solenoid #1 did not report on", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+    Timer.delay(2 * kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    // Turn Solenoid #1 off, and pulse Solenoid #2 on
+    solenoid1.set(false);
+    solenoid2.setPulseDuration(2 * kSolenoidDelayTime);
+    solenoid2.startPulse();
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertTrue("Solenoid #2 did not report on", solenoid2.get());
+    Timer.delay(2 * kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    // Pulse both Solenoids on
+    solenoid1.setPulseDuration(2 * kSolenoidDelayTime);
+    solenoid2.setPulseDuration(2 * kSolenoidDelayTime);
+    solenoid1.startPulse();
+    solenoid2.startPulse();
+    Timer.delay(kSolenoidDelayTime);
+    assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertTrue("Solenoid #1 did not report on", solenoid1.get());
+    assertTrue("Solenoid #2 did not report on", solenoid2.get());
+    Timer.delay(2 * kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    // Pulse both Solenoids on with different durations
+    solenoid1.setPulseDuration(1.5 * kSolenoidDelayTime);
+    solenoid2.setPulseDuration(2.5 * kSolenoidDelayTime);
+    solenoid1.startPulse();
+    solenoid2.startPulse();
+    Timer.delay(kSolenoidDelayTime);
+    assertFalse("Solenoid #1 did not turn on", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertTrue("Solenoid #1 did not report on", solenoid1.get());
+    assertTrue("Solenoid #2 did not report on", solenoid2.get());
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertFalse("Solenoid #2 did not turn on", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertTrue("Solenoid #2 did not report on", solenoid2.get());
+    Timer.delay(kSolenoidDelayTime);
+    assertTrue("Solenoid #1 did not turn off", fakeSolenoid1.get());
+    assertTrue("Solenoid #2 did not turn off", fakeSolenoid2.get());
+    assertFalse("Solenoid #1 did not report off", solenoid1.get());
+    assertFalse("Solenoid #2 did not report off", solenoid2.get());
+
+    solenoid1.free();
+    solenoid2.free();
+  }
+
+  protected Logger getClassLogger() {
+    return logger;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
new file mode 100644
index 0000000..d7acb94
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PDPTest.java
@@ -0,0 +1,113 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.can.CANMessageNotFoundException;
+import edu.wpi.first.wpilibj.fixtures.MotorEncoderFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.hamcrest.Matchers.greaterThan;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test that covers the {@link PowerDistributionPanel}.
+ */
+@RunWith(Parameterized.class)
+public class PDPTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(PCMTest.class.getName());
+
+  private static PowerDistributionPanel pdp;
+  private static MotorEncoderFixture<?> me;
+  private final double m_expectedStoppedCurrentDraw;
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+    pdp = new PowerDistributionPanel();
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    pdp.free();
+    pdp = null;
+    me.teardown();
+    me = null;
+  }
+
+
+  @SuppressWarnings("JavadocMethod")
+  public PDPTest(MotorEncoderFixture<?> mef, Double expectedCurrentDraw) {
+    logger.fine("Constructor with: " + mef.getType());
+    if (me != null && !me.equals(mef)) {
+      me.teardown();
+    }
+    me = mef;
+    me.setup();
+
+    m_expectedStoppedCurrentDraw = expectedCurrentDraw;
+  }
+
+  @Parameters(name = "{index}: {0}, Expected Stopped Current Draw: {1}")
+  public static Collection<Object[]> generateData() {
+    // logger.fine("Loading the MotorList");
+    return Arrays.asList(new Object[][]{
+        {TestBench.getInstance().getTalonPair(), new Double(0.0)}});
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    me.reset();
+  }
+
+
+  /**
+   * Test if the current changes when the motor is driven using a talon.
+   */
+  @Test
+  public void checkStoppedCurrentForSpeedController() throws CANMessageNotFoundException {
+    Timer.delay(0.25);
+
+    /* The Current should be 0 */
+    assertEquals("The low current was not within the expected range.", m_expectedStoppedCurrentDraw,
+        pdp.getCurrent(me.getPDPChannel()), 0.001);
+  }
+
+  /**
+   * Test if the current changes when the motor is driven using a talon.
+   */
+  @Test
+  public void checkRunningCurrentForSpeedController() throws CANMessageNotFoundException {
+
+    /* Set the motor to full forward */
+    me.getMotor().set(1.0);
+    Timer.delay(2);
+
+    /* The current should now be greater than the low current */
+    assertThat("The driven current is not greater than the resting current.",
+        pdp.getCurrent(me.getPDPChannel()), is(greaterThan(m_expectedStoppedCurrentDraw)));
+  }
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
new file mode 100644
index 0000000..f9120b4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PIDTest.java
@@ -0,0 +1,206 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Logger;
+
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.fixtures.MotorEncoderFixture;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+
+/**
+ * Test that covers the {@link PIDController}.
+ */
+
+@RunWith(Parameterized.class)
+public class PIDTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(PIDTest.class.getName());
+  private NetworkTable m_table;
+  private SendableBuilderImpl m_builder;
+
+  private static final double absoluteTolerance = 50;
+  private static final double outputRange = 0.25;
+
+  private PIDController m_controller = null;
+  private static MotorEncoderFixture me = null;
+
+  @SuppressWarnings({"MemberName", "EmptyLineSeparator", "MultipleVariableDeclarations"})
+  private final Double k_p, k_i, k_d;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+
+  @SuppressWarnings({"ParameterName", "JavadocMethod"})
+  public PIDTest(Double p, Double i, Double d, MotorEncoderFixture mef) {
+    logger.fine("Constructor with: " + mef.getType());
+    if (PIDTest.me != null && !PIDTest.me.equals(mef)) {
+      PIDTest.me.teardown();
+    }
+    PIDTest.me = mef;
+    this.k_p = p;
+    this.k_i = i;
+    this.k_d = d;
+  }
+
+
+  @Parameters
+  public static Collection<Object[]> generateData() {
+    // logger.fine("Loading the MotorList");
+    Collection<Object[]> data = new ArrayList<Object[]>();
+    double kp = 0.001;
+    double ki = 0.0005;
+    double kd = 0.0;
+    for (int i = 0; i < 1; i++) {
+      data.addAll(Arrays.asList(new Object[][]{
+          {kp, ki, kd, TestBench.getInstance().getTalonPair()},
+          {kp, ki, kd, TestBench.getInstance().getVictorPair()},
+          {kp, ki, kd, TestBench.getInstance().getJaguarPair()}}));
+    }
+    return data;
+  }
+
+  @BeforeClass
+  public static void setUpBeforeClass() throws Exception {
+  }
+
+  @AfterClass
+  public static void tearDownAfterClass() throws Exception {
+    logger.fine("TearDownAfterClass: " + me.getType());
+    me.teardown();
+    me = null;
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    logger.fine("Setup: " + me.getType());
+    me.setup();
+    m_table = NetworkTableInstance.getDefault().getTable("TEST_PID");
+    m_builder = new SendableBuilderImpl();
+    m_builder.setTable(m_table);
+    m_controller = new PIDController(k_p, k_i, k_d, me.getEncoder(), me.getMotor());
+    m_controller.initSendable(m_builder);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    logger.fine("Teardown: " + me.getType());
+    m_controller.disable();
+    m_controller.free();
+    m_controller = null;
+    me.reset();
+  }
+
+  private void setupAbsoluteTolerance() {
+    m_controller.setAbsoluteTolerance(absoluteTolerance);
+  }
+
+  private void setupOutputRange() {
+    m_controller.setOutputRange(-outputRange, outputRange);
+  }
+
+  @Test
+  public void testInitialSettings() {
+    setupAbsoluteTolerance();
+    setupOutputRange();
+    double setpoint = 2500.0;
+    m_controller.setSetpoint(setpoint);
+    assertFalse("PID did not begin disabled", m_controller.isEnabled());
+    assertEquals("PID.getError() did not start at " + setpoint, setpoint,
+        m_controller.getError(), 0);
+    m_builder.updateTable();
+    assertEquals(k_p, m_table.getEntry("p").getDouble(9999999), 0);
+    assertEquals(k_i, m_table.getEntry("i").getDouble(9999999), 0);
+    assertEquals(k_d, m_table.getEntry("d").getDouble(9999999), 0);
+    assertEquals(setpoint, m_table.getEntry("setpoint").getDouble(9999999), 0);
+    assertFalse(m_table.getEntry("enabled").getBoolean(true));
+  }
+
+  @Test
+  public void testRestartAfterEnable() {
+    setupAbsoluteTolerance();
+    setupOutputRange();
+    double setpoint = 2500.0;
+    m_controller.setSetpoint(setpoint);
+    m_controller.enable();
+    m_builder.updateTable();
+    assertTrue(m_table.getEntry("enabled").getBoolean(false));
+    assertTrue(m_controller.isEnabled());
+    assertThat(0.0, is(not(me.getMotor().get())));
+    m_controller.reset();
+    m_builder.updateTable();
+    assertFalse(m_table.getEntry("enabled").getBoolean(true));
+    assertFalse(m_controller.isEnabled());
+    assertEquals(0, me.getMotor().get(), 0);
+  }
+
+  @Test
+  public void testSetSetpoint() {
+    setupAbsoluteTolerance();
+    setupOutputRange();
+    Double setpoint = 2500.0;
+    m_controller.disable();
+    m_controller.setSetpoint(setpoint);
+    m_controller.enable();
+    assertEquals("Did not correctly set set-point", setpoint, new Double(m_controller
+        .getSetpoint()));
+  }
+
+  @Test(timeout = 10000)
+  public void testRotateToTarget() {
+    setupAbsoluteTolerance();
+    setupOutputRange();
+    double setpoint = 1000.0;
+    assertEquals(pidData() + "did not start at 0", 0, m_controller.get(), 0);
+    m_controller.setSetpoint(setpoint);
+    assertEquals(pidData() + "did not have an error of " + setpoint, setpoint,
+        m_controller.getError(), 0);
+    m_controller.enable();
+    Timer.delay(5);
+    m_controller.disable();
+    assertTrue(pidData() + "Was not on Target. Controller Error: " + m_controller.getError(),
+        m_controller.onTarget());
+  }
+
+  private String pidData() {
+    return me.getType() + " PID {P:" + m_controller.getP() + " I:" + m_controller.getI() + " D:"
+        + m_controller.getD() + "} ";
+  }
+
+
+  @Test(expected = RuntimeException.class)
+  public void testOnTargetNoToleranceSet() {
+    setupOutputRange();
+    m_controller.onTarget();
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PreferencesTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PreferencesTest.java
new file mode 100644
index 0000000..c63f4b3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/PreferencesTest.java
@@ -0,0 +1,124 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.networktables.NetworkTable;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests the {@link Preferences}.
+ */
+public class PreferencesTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(PreferencesTest.class.getName());
+
+  private NetworkTable m_prefTable;
+  private Preferences m_pref;
+  private long m_check;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+
+  @Before
+  public void setUp() throws Exception {
+    NetworkTable.shutdown();
+    try {
+      File file = new File("networktables.ini");
+      file.mkdirs();
+      if (file.exists()) {
+        file.delete();
+      }
+      file.createNewFile();
+      OutputStream output = new FileOutputStream(file);
+      output
+          .write(("[NetworkTables Storage 3.0]\ndouble \"/Preferences/checkedValueInt\"=2\ndouble "
+              + "\"/Preferences/checkedValueDouble\"=.2\ndouble "
+              + "\"/Preferences/checkedValueFloat\"=3.14\ndouble "
+              + "\"/Preferences/checkedValueLong\"=172\nstring "
+              + "\"/Preferences/checkedValueString\"=\"hello \\nHow are you ?\"\nboolean "
+              + "\"/Preferences/checkedValueBoolean\"=false\n")
+              .getBytes());
+
+    } catch (IOException ex) {
+      ex.printStackTrace();
+    }
+    NetworkTable.initialize();
+
+    m_pref = Preferences.getInstance();
+    m_prefTable = NetworkTable.getTable("Preferences");
+    m_check = System.currentTimeMillis();
+  }
+
+
+  protected void remove() {
+    m_pref.remove("checkedValueLong");
+    m_pref.remove("checkedValueDouble");
+    m_pref.remove("checkedValueString");
+    m_pref.remove("checkedValueInt");
+    m_pref.remove("checkedValueFloat");
+    m_pref.remove("checkedValueBoolean");
+  }
+
+  protected void addCheckedValue() {
+    m_pref.putLong("checkedValueLong", m_check);
+    m_pref.putDouble("checkedValueDouble", 1);
+    m_pref.putString("checkedValueString", "checked");
+    m_pref.putInt("checkedValueInt", 1);
+    m_pref.putFloat("checkedValueFloat", 1);
+    m_pref.putBoolean("checkedValueBoolean", true);
+  }
+
+  @Test
+  public void testAddRemoveSave() {
+    assertEquals(m_pref.getLong("checkedValueLong", 0), 172L);
+    assertEquals(m_pref.getDouble("checkedValueDouble", 0), .2, 0);
+    assertEquals(m_pref.getString("checkedValueString", ""), "hello \nHow are you ?");
+    assertEquals(m_pref.getInt("checkedValueInt", 0), 2);
+    assertEquals(m_pref.getFloat("checkedValueFloat", 0), 3.14, .001);
+    assertFalse(m_pref.getBoolean("checkedValueBoolean", true));
+    remove();
+    assertEquals(m_pref.getLong("checkedValueLong", 0), 0);
+    assertEquals(m_pref.getDouble("checkedValueDouble", 0), 0, 0);
+    assertEquals(m_pref.getString("checkedValueString", ""), "");
+    assertEquals(m_pref.getInt("checkedValueInt", 0), 0);
+    assertEquals(m_pref.getFloat("checkedValueFloat", 0), 0, 0);
+    assertFalse(m_pref.getBoolean("checkedValueBoolean", false));
+    addCheckedValue();
+    assertEquals(m_check, m_pref.getLong("checkedValueLong", 0));
+    assertEquals(m_pref.getDouble("checkedValueDouble", 0), 1, 0);
+    assertEquals(m_pref.getString("checkedValueString", ""), "checked");
+    assertEquals(m_pref.getInt("checkedValueInt", 0), 1);
+    assertEquals(m_pref.getFloat("checkedValueFloat", 0), 1, 0);
+    assertTrue(m_pref.getBoolean("checkedValueBoolean", false));
+  }
+
+  @Test
+  public void testPreferencesToNetworkTables() {
+    String networkedNumber = "networkCheckedValue";
+    int networkNumberValue = 100;
+    m_pref.putInt(networkedNumber, networkNumberValue);
+    assertEquals(networkNumberValue, (int) (m_prefTable.getNumber(networkedNumber, 9999999)));
+    m_pref.remove(networkedNumber);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/RelayCrossConnectTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/RelayCrossConnectTest.java
new file mode 100644
index 0000000..0cec277
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/RelayCrossConnectTest.java
@@ -0,0 +1,150 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.networktables.NetworkTable;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.wpilibj.Relay.Direction;
+import edu.wpi.first.wpilibj.Relay.InvalidValueException;
+import edu.wpi.first.wpilibj.Relay.Value;
+import edu.wpi.first.wpilibj.fixtures.RelayCrossConnectFixture;
+import edu.wpi.first.wpilibj.smartdashboard.SendableBuilderImpl;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests the {@link RelayCrossConnectFixture}.
+ */
+public class RelayCrossConnectTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(RelayCrossConnectTest.class.getName());
+  private static final NetworkTable table =
+      NetworkTableInstance.getDefault().getTable("_RELAY_CROSS_CONNECT_TEST_");
+  private RelayCrossConnectFixture m_relayFixture;
+  private SendableBuilderImpl m_builder;
+
+
+  @Before
+  public void setUp() throws Exception {
+    m_relayFixture = TestBench.getRelayCrossConnectFixture();
+    m_relayFixture.setup();
+    m_builder = new SendableBuilderImpl();
+    m_builder.setTable(table);
+    m_relayFixture.getRelay().initSendable(m_builder);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    m_relayFixture.reset();
+    m_relayFixture.teardown();
+  }
+
+  @Test
+  public void testBothHigh() {
+    m_relayFixture.getRelay().setDirection(Direction.kBoth);
+    m_relayFixture.getRelay().set(Value.kOn);
+    m_builder.updateTable();
+    assertTrue("Input one was not high when relay set both high", m_relayFixture.getInputOne()
+        .get());
+    assertTrue("Input two was not high when relay set both high", m_relayFixture.getInputTwo()
+        .get());
+    assertEquals(Value.kOn, m_relayFixture.getRelay().get());
+    assertEquals("On", table.getEntry("Value").getString(""));
+  }
+
+  @Test
+  public void testFirstHigh() {
+    m_relayFixture.getRelay().setDirection(Direction.kBoth);
+    m_relayFixture.getRelay().set(Value.kForward);
+    m_builder.updateTable();
+    assertFalse("Input one was not low when relay set Value.kForward", m_relayFixture.getInputOne()
+        .get());
+    assertTrue("Input two was not high when relay set Value.kForward", m_relayFixture
+        .getInputTwo()
+        .get());
+    assertEquals(Value.kForward, m_relayFixture.getRelay().get());
+    assertEquals("Forward", table.getEntry("Value").getString(""));
+  }
+
+  @Test
+  public void testSecondHigh() {
+    m_relayFixture.getRelay().setDirection(Direction.kBoth);
+    m_relayFixture.getRelay().set(Value.kReverse);
+    m_builder.updateTable();
+    assertTrue("Input one was not high when relay set Value.kReverse", m_relayFixture.getInputOne()
+        .get());
+    assertFalse("Input two was not low when relay set Value.kReverse", m_relayFixture
+        .getInputTwo()
+        .get());
+    assertEquals(Value.kReverse, m_relayFixture.getRelay().get());
+    assertEquals("Reverse", table.getEntry("Value").getString(""));
+  }
+
+  @Test
+  public void testForwardDirection() {
+    m_relayFixture.getRelay().setDirection(Direction.kForward);
+    m_relayFixture.getRelay().set(Value.kOn);
+    m_builder.updateTable();
+    assertFalse("Input one was not low when relay set Value.kOn in kForward Direction",
+        m_relayFixture.getInputOne().get());
+    assertTrue("Input two was not high when relay set Value.kOn in kForward Direction",
+        m_relayFixture.getInputTwo().get());
+    assertEquals(Value.kOn, m_relayFixture.getRelay().get());
+    assertEquals("On", table.getEntry("Value").getString(""));
+  }
+
+  @Test
+  public void testReverseDirection() {
+    m_relayFixture.getRelay().setDirection(Direction.kReverse);
+    m_relayFixture.getRelay().set(Value.kOn);
+    m_builder.updateTable();
+    assertTrue("Input one was not high when relay set Value.kOn in kReverse Direction",
+        m_relayFixture.getInputOne().get());
+    assertFalse("Input two was not low when relay set Value.kOn in kReverse Direction",
+        m_relayFixture.getInputTwo().get());
+    assertEquals(Value.kOn, m_relayFixture.getRelay().get());
+    assertEquals("On", table.getEntry("Value").getString(""));
+  }
+
+  @Test(expected = InvalidValueException.class)
+  public void testSetValueForwardWithDirectionReverseThrowingException() {
+    m_relayFixture.getRelay().setDirection(Direction.kForward);
+    m_relayFixture.getRelay().set(Value.kReverse);
+  }
+
+  @Test(expected = InvalidValueException.class)
+  public void testSetValueReverseWithDirectionForwardThrowingException() {
+    m_relayFixture.getRelay().setDirection(Direction.kReverse);
+    m_relayFixture.getRelay().set(Value.kForward);
+  }
+
+  @Test
+  public void testInitialSettings() {
+    m_builder.updateTable();
+    assertEquals(Value.kOff, m_relayFixture.getRelay().get());
+    // Initially both outputs should be off
+    assertFalse(m_relayFixture.getInputOne().get());
+    assertFalse(m_relayFixture.getInputTwo().get());
+    assertEquals("Off", table.getEntry("Value").getString(""));
+  }
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/RobotDriveTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/RobotDriveTest.java
new file mode 100644
index 0000000..e0715d5
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/RobotDriveTest.java
@@ -0,0 +1,183 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import edu.wpi.first.wpilibj.drive.DifferentialDrive;
+import edu.wpi.first.wpilibj.drive.MecanumDrive;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import java.util.logging.Logger;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests the eqivilance of RobotDrive and DifferentialDrive/MecanumDrive.
+ */
+public class RobotDriveTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(RobotDriveTest.class.getName());
+
+  private static MockSpeedController m_rdFrontLeft = new MockSpeedController();
+  private static MockSpeedController m_rdRearLeft = new MockSpeedController();
+  private static MockSpeedController m_rdFrontRight = new MockSpeedController();
+  private static MockSpeedController m_rdRearRight = new MockSpeedController();
+  private static MockSpeedController m_frontLeft = new MockSpeedController();
+  private static MockSpeedController m_rearLeft = new MockSpeedController();
+  private static MockSpeedController m_frontRight = new MockSpeedController();
+  private static MockSpeedController m_rearRight = new MockSpeedController();
+  private static RobotDrive m_robotDrive =
+      new RobotDrive(m_rdFrontLeft, m_rdRearLeft, m_rdFrontRight, m_rdRearRight);
+  private static DifferentialDrive m_differentialDrive =
+      new DifferentialDrive(m_frontLeft, m_frontRight);
+  private static MecanumDrive m_mecanumDrive =
+      new MecanumDrive(m_frontLeft, m_rearLeft, m_frontRight, m_rearRight);
+
+  private final double[] m_testJoystickValues = {1.0, 0.9, 0.5, 0.01, 0.0, -0.01, -0.5, -0.9,
+                                                 -1.0};
+  private final double[] m_testGyroValues = {0, 30, 45, 90, 135, 180, 225, 270, 305, 360, 540,
+                                             -45, -90, -135, -180, -225, -270, -305, -360, -540};
+
+  @BeforeClass
+  public static void before() {
+    m_differentialDrive.setDeadband(0.0);
+    m_differentialDrive.setSafetyEnabled(false);
+    m_mecanumDrive.setDeadband(0.0);
+    m_mecanumDrive.setSafetyEnabled(false);
+    m_robotDrive.setSafetyEnabled(false);
+  }
+
+  @Test
+  public void testTankDriveSquared() {
+    for (double leftJoystick : m_testJoystickValues) {
+      for (double rightJoystick : m_testJoystickValues) {
+        m_robotDrive.tankDrive(leftJoystick, rightJoystick);
+        m_differentialDrive.tankDrive(leftJoystick, rightJoystick);
+        assertEquals("Left Motor squared didn't match. Left Joystick: " + leftJoystick
+            + " Right Joystick: " + rightJoystick + " ", m_rdFrontLeft.get(), m_frontLeft.get(),
+            0.01);
+        assertEquals("Right Motor squared didn't match. Left Joystick: " + leftJoystick
+            + " Right Joystick: " + rightJoystick + " ", m_rdFrontRight.get(), m_frontRight.get(),
+            0.01);
+      }
+    }
+  }
+
+  @Test
+  public void testTankDrive() {
+    for (double leftJoystick : m_testJoystickValues) {
+      for (double rightJoystick : m_testJoystickValues) {
+        m_robotDrive.tankDrive(leftJoystick, rightJoystick, false);
+        m_differentialDrive.tankDrive(leftJoystick, rightJoystick, false);
+        assertEquals("Left Motor didn't match. Left Joystick: " + leftJoystick
+            + " Right Joystick: " + rightJoystick + " ", m_rdFrontLeft.get(), m_frontLeft.get(),
+            0.01);
+        assertEquals("Right Motor didn't match. Left Joystick: " + leftJoystick
+            + " Right Joystick: " + rightJoystick + " ", m_rdFrontRight.get(), m_frontRight.get(),
+            0.01);
+      }
+    }
+  }
+
+  @Test
+  public void testArcadeDriveSquared() {
+    for (double moveJoystick : m_testJoystickValues) {
+      for (double rotateJoystick : m_testJoystickValues) {
+        m_robotDrive.arcadeDrive(moveJoystick, rotateJoystick);
+        m_differentialDrive.arcadeDrive(moveJoystick, -rotateJoystick);
+        assertEquals("Left Motor squared didn't match. Move Joystick: " + moveJoystick
+            + " Rotate Joystick: " + rotateJoystick + " ", m_rdFrontLeft.get(), m_frontLeft.get(),
+            0.01);
+        assertEquals("Right Motor squared didn't match. Move Joystick: " + moveJoystick
+            + " Rotate Joystick: " + rotateJoystick + " ", m_rdFrontRight.get(),
+            m_frontRight.get(), 0.01);
+      }
+    }
+  }
+
+  @Test
+  public void testArcadeDrive() {
+    for (double moveJoystick : m_testJoystickValues) {
+      for (double rotateJoystick : m_testJoystickValues) {
+        m_robotDrive.arcadeDrive(moveJoystick, rotateJoystick, false);
+        m_differentialDrive.arcadeDrive(moveJoystick, -rotateJoystick, false);
+        assertEquals("Left Motor didn't match. Move Joystick: " + moveJoystick
+            + " Rotate Joystick: " + rotateJoystick + " ", m_rdFrontLeft.get(), m_frontLeft.get(),
+            0.01);
+        assertEquals("Right Motor didn't match. Move Joystick: " + moveJoystick
+            + " Rotate Joystick: " + rotateJoystick + " ", m_rdFrontRight.get(),
+            m_frontRight.get(), 0.01);
+      }
+    }
+  }
+
+  @Test
+  public void testMecanumPolar() {
+    System.out.println("magnitudeJoystick, directionJoystick , rotationJoystick, "
+        + "m_rdFrontLeft, m_frontLeft, m_rdFrontRight, m_frontRight, m_rdRearLeft, "
+        + "m_rearLeft, m_rdRearRight, m_rearRight");
+    for (double magnitudeJoystick : m_testJoystickValues) {
+      for (double directionJoystick : m_testGyroValues) {
+        for (double rotationJoystick : m_testJoystickValues) {
+          m_robotDrive.mecanumDrive_Polar(magnitudeJoystick, directionJoystick, rotationJoystick);
+          m_mecanumDrive.drivePolar(magnitudeJoystick, directionJoystick, rotationJoystick);
+          assertEquals("Left Front Motor didn't match. Magnitude Joystick: " + magnitudeJoystick
+              + " Direction Joystick: " + directionJoystick + " RotationJoystick: "
+              + rotationJoystick, m_rdFrontLeft.get(), m_frontLeft.get(), 0.01);
+          assertEquals("Right Front Motor didn't match. Magnitude Joystick: " + magnitudeJoystick
+              + " Direction Joystick: " + directionJoystick + " RotationJoystick: "
+              + rotationJoystick, m_rdFrontRight.get(), -m_frontRight.get(), 0.01);
+          assertEquals("Left Rear Motor didn't match. Magnitude Joystick: " + magnitudeJoystick
+              + " Direction Joystick: " + directionJoystick + " RotationJoystick: "
+              + rotationJoystick, m_rdRearLeft.get(), m_rearLeft.get(), 0.01);
+          assertEquals("Right Rear Motor didn't match. Magnitude Joystick: " + magnitudeJoystick
+              + " Direction Joystick: " + directionJoystick + " RotationJoystick: "
+              + rotationJoystick, m_rdRearRight.get(), -m_rearRight.get(), 0.01);
+        }
+      }
+    }
+  }
+
+  @Test
+  @SuppressWarnings("checkstyle:LocalVariableName")
+  public void testMecanumCartesian() {
+    for (double x_Joystick : m_testJoystickValues) {
+      for (double y_Joystick : m_testJoystickValues) {
+        for (double rotationJoystick : m_testJoystickValues) {
+          for (double gyroValue : m_testGyroValues) {
+            m_robotDrive.mecanumDrive_Cartesian(x_Joystick, y_Joystick, rotationJoystick,
+                                                gyroValue);
+            m_mecanumDrive.driveCartesian(x_Joystick, -y_Joystick, rotationJoystick, -gyroValue);
+            assertEquals("Left Front Motor didn't match. X Joystick: " + x_Joystick
+                + " Y Joystick: " + y_Joystick + " RotationJoystick: "
+                + rotationJoystick + " Gyro: " + gyroValue, m_rdFrontLeft.get(),
+                m_frontLeft.get(), 0.01);
+            assertEquals("Right Front Motor didn't match. X Joystick: " + x_Joystick
+                + " Y Joystick: " + y_Joystick + " RotationJoystick: "
+                + rotationJoystick + " Gyro: " + gyroValue, m_rdFrontRight.get(),
+                -m_frontRight.get(), 0.01);
+            assertEquals("Left Rear Motor didn't match. X Joystick: " + x_Joystick
+                + " Y Joystick: " + y_Joystick + " RotationJoystick: "
+                + rotationJoystick + " Gyro: " + gyroValue, m_rdRearLeft.get(),
+                m_rearLeft.get(), 0.01);
+            assertEquals("Right Rear Motor didn't match. X Joystick: " + x_Joystick
+                + " Y Joystick: " + y_Joystick + " RotationJoystick: "
+                + rotationJoystick + " Gyro: " + gyroValue, m_rdRearRight.get(),
+                -m_rearRight.get(), 0.01);
+          }
+        }
+      }
+    }
+  }
+
+  protected Logger getClassLogger() {
+    return logger;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/SampleTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/SampleTest.java
new file mode 100644
index 0000000..e98575f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/SampleTest.java
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.fixtures.SampleFixture;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Sample test for a sample PID controller. This demonstrates the general pattern of how to create a
+ * test and use testing fixtures and categories. All tests must extend from {@link
+ * AbstractComsSetup} in order to ensure that Network Communications are set up before the tests are
+ * run.
+ */
+public class SampleTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(SampleTest.class.getName());
+
+  static SampleFixture fixture = new SampleFixture();
+
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @BeforeClass
+  public static void classSetup() {
+    // Set up the fixture before the test is created
+    fixture.setup();
+  }
+
+  @Before
+  public void setUp() {
+    // Reset the fixture elements before every test
+    fixture.reset();
+  }
+
+  @AfterClass
+  public static void tearDown() {
+    // Clean up the fixture after the test
+    fixture.teardown();
+  }
+
+  /**
+   * This is just a sample test that asserts true. Any traditional junit code can be used, these are
+   * ordinary junit tests!
+   */
+  @Test
+  public void test() {
+    Timer.delay(0.5);
+    assertTrue(true);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/TimerTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/TimerTest.java
new file mode 100644
index 0000000..745daaf
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/TimerTest.java
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+
+
+public class TimerTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(TimerTest.class.getName());
+  private static final long TIMER_TOLERANCE = (long) (2.5 * 1000);
+  private static final long TIMER_RUNTIME = 5 * 1000000;
+
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @Test
+  public void delayTest() {
+    // Given
+    long startTime = RobotController.getFPGATime();
+
+    // When
+    Timer.delay(TIMER_RUNTIME / 1000000);
+    long endTime = RobotController.getFPGATime();
+    long difference = endTime - startTime;
+
+    // Then
+    long offset = difference - TIMER_RUNTIME;
+    assertEquals("Timer.delay ran " + offset + " microseconds too long", TIMER_RUNTIME, difference,
+        TIMER_TOLERANCE);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/WpiLibJTestSuite.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/WpiLibJTestSuite.java
new file mode 100644
index 0000000..6d5fff0
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/WpiLibJTestSuite.java
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import edu.wpi.first.wpilibj.test.AbstractTestSuite;
+
+/**
+ * Holds all of the tests in the root wpilibj directory. Please list alphabetically so that it is
+ * easy to determine if a test is missing from the list.
+ */
+@RunWith(Suite.class)
+@SuiteClasses({AnalogCrossConnectTest.class, AnalogPotentiometerTest.class,
+    BuiltInAccelerometerTest.class,
+    CircularBufferTest.class, ConstantsPortsTest.class, CounterTest.class,
+    DigitalGlitchFilterTest.class, DIOCrossConnectTest.class, DriverStationTest.class,
+    EncoderTest.class, FilterNoiseTest.class, FilterOutputTest.class, GyroTest.class,
+    MotorEncoderTest.class, MotorInvertingTest.class, PCMTest.class, PDPTest.class,
+    PIDTest.class, PIDToleranceTest.class, PreferencesTest.class, RelayCrossConnectTest.class,
+    RobotDriveTest.class, SampleTest.class, TimerTest.class})
+public class WpiLibJTestSuite extends AbstractTestSuite {
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/can/CANStatusTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/can/CANStatusTest.java
new file mode 100644
index 0000000..c501ebc
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/can/CANStatusTest.java
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.can;
+
+import org.junit.Test;
+
+public class CANStatusTest {
+  @Test
+  public void canStatusGetDoesntThrow() {
+    CANStatus status = new CANStatus();
+    CANJNI.GetCANStatus(status);
+    // Nothing we can assert, so just make sure it didn't throw.
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/command/CommandTestSuite.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/command/CommandTestSuite.java
new file mode 100644
index 0000000..ea34c69
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/command/CommandTestSuite.java
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.command;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import edu.wpi.first.wpilibj.test.AbstractTestSuite;
+
+/**
+ * Contains a listing of all of the {@link Command} tests.
+ */
+@RunWith(Suite.class)
+@SuiteClasses({ButtonTest.class, CommandParallelGroupTest.class, CommandScheduleTest.class,
+    CommandSequentialGroupTest.class, CommandSupersedeTest.class, CommandTimeoutTest.class,
+    ConditionalCommandTest.class, DefaultCommandTest.class})
+public class CommandTestSuite extends AbstractTestSuite {
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/AnalogCrossConnectFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/AnalogCrossConnectFixture.java
new file mode 100644
index 0000000..f14ceaa
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/AnalogCrossConnectFixture.java
@@ -0,0 +1,86 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.AnalogOutput;
+
+/**
+ * A fixture that connects an {@link AnalogInput} and an {@link AnalogOutput}.
+ */
+public abstract class AnalogCrossConnectFixture implements ITestFixture {
+  private boolean m_initialized = false;
+
+  private AnalogInput m_input;
+  private AnalogOutput m_output;
+
+  protected abstract AnalogInput giveAnalogInput();
+
+  protected abstract AnalogOutput giveAnalogOutput();
+
+
+  private void initialize() {
+    synchronized (this) {
+      if (!m_initialized) {
+        m_input = giveAnalogInput();
+        m_output = giveAnalogOutput();
+        m_initialized = true;
+      }
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#setup()
+   */
+  @Override
+  public boolean setup() {
+    initialize();
+    m_output.setVoltage(0);
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#reset()
+   */
+  @Override
+  public boolean reset() {
+    initialize();
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#teardown()
+   */
+  @Override
+  public boolean teardown() {
+    m_input.free();
+    m_output.free();
+    return true;
+  }
+
+  /**
+   * Analog Output.
+   */
+  public final AnalogOutput getOutput() {
+    initialize();
+    return m_output;
+  }
+
+  public final AnalogInput getInput() {
+    initialize();
+    return m_input;
+  }
+
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/DIOCrossConnectFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/DIOCrossConnectFixture.java
new file mode 100644
index 0000000..de77fb9
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/DIOCrossConnectFixture.java
@@ -0,0 +1,90 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.DigitalOutput;
+
+/**
+ * Connects a digital input to a digital output.
+ */
+public class DIOCrossConnectFixture implements ITestFixture {
+  private static final Logger logger = Logger.getLogger(DIOCrossConnectFixture.class.getName());
+
+  private final DigitalInput m_input;
+  private final DigitalOutput m_output;
+  private boolean m_allocated;
+
+  /**
+   * Constructs using two pre-allocated digital objects.
+   *
+   * @param input  The input
+   * @param output The output.
+   */
+  public DIOCrossConnectFixture(DigitalInput input, DigitalOutput output) {
+    assert input != null;
+    assert output != null;
+    m_input = input;
+    m_output = output;
+    m_allocated = false;
+  }
+
+  /**
+   * Constructs a {@link DIOCrossConnectFixture} using the ports of the digital objects.
+   *
+   * @param input  The port of the {@link DigitalInput}
+   * @param output The port of the {@link DigitalOutput}
+   */
+  public DIOCrossConnectFixture(Integer input, Integer output) {
+    assert input != null;
+    assert output != null;
+    assert !input.equals(output);
+    m_input = new DigitalInput(input);
+    m_output = new DigitalOutput(output);
+    m_allocated = true;
+  }
+
+  public DigitalInput getInput() {
+    return m_input;
+  }
+
+  public DigitalOutput getOutput() {
+    return m_output;
+  }
+
+  @Override
+  public boolean setup() {
+    return true;
+  }
+
+  @Override
+  public boolean reset() {
+    try {
+      m_input.cancelInterrupts();
+    } catch (IllegalStateException ex) {
+      // This will happen if the interrupt has not been allocated for this test.
+    }
+    m_output.set(false);
+    return true;
+  }
+
+  @Override
+  public boolean teardown() {
+    logger.log(Level.FINE, "Begining teardown");
+    if (m_allocated) {
+      m_input.free();
+      m_output.free();
+      m_allocated = false;
+    }
+    return true;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FakeCounterFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FakeCounterFixture.java
new file mode 100644
index 0000000..bff0e4c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FakeCounterFixture.java
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.Counter;
+import edu.wpi.first.wpilibj.mockhardware.FakeCounterSource;
+
+/**
+ * A fixture that can test the {@link Counter} using a {@link DIOCrossConnectFixture}.
+ */
+public class FakeCounterFixture implements ITestFixture {
+  private static final Logger logger = Logger.getLogger(FakeEncoderFixture.class.getName());
+
+  private final DIOCrossConnectFixture m_dio;
+  private boolean m_allocated;
+  private final FakeCounterSource m_source;
+  private final Counter m_counter;
+
+  /**
+   * Constructs a FakeCounterFixture.
+   *
+   * @param dio A previously allocated DIOCrossConnectFixture (must be freed outside this class)
+   */
+  public FakeCounterFixture(DIOCrossConnectFixture dio) {
+    m_dio = dio;
+    m_allocated = false;
+    m_source = new FakeCounterSource(dio.getOutput());
+    m_counter = new Counter(dio.getInput());
+  }
+
+
+  /**
+   * Constructs a FakeCounterFixture using two port numbers.
+   *
+   * @param input  the input port
+   * @param output the output port
+   */
+  public FakeCounterFixture(int input, int output) {
+    m_dio = new DIOCrossConnectFixture(input, output);
+    m_allocated = true;
+    m_source = new FakeCounterSource(m_dio.getOutput());
+    m_counter = new Counter(m_dio.getInput());
+  }
+
+  /**
+   * Retrieves the FakeCouterSource for use.
+   *
+   * @return the FakeCounterSource
+   */
+  public FakeCounterSource getFakeCounterSource() {
+    return m_source;
+  }
+
+  /**
+   * Gets the Counter for use.
+   *
+   * @return the Counter
+   */
+  public Counter getCounter() {
+    return m_counter;
+  }
+
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#setup()
+   */
+  @Override
+  public boolean setup() {
+    return true;
+
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#reset()
+   */
+  @Override
+  public boolean reset() {
+    m_counter.reset();
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#teardown()
+   */
+  @Override
+  public boolean teardown() {
+    logger.log(Level.FINE, "Begining teardown");
+    m_counter.free();
+    m_source.free();
+    if (m_allocated) { // Only tear down the dio if this class allocated it
+      m_dio.teardown();
+      m_allocated = false;
+    }
+    return true;
+  }
+
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FakeEncoderFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FakeEncoderFixture.java
new file mode 100644
index 0000000..372b2d8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FakeEncoderFixture.java
@@ -0,0 +1,116 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.Encoder;
+import edu.wpi.first.wpilibj.mockhardware.FakeEncoderSource;
+
+/**
+ * An encoder that uses two {@link DIOCrossConnectFixture DIOCrossConnectFixtures} to test the
+ * {@link Encoder}.
+ */
+public class FakeEncoderFixture implements ITestFixture {
+  private static final Logger logger = Logger.getLogger(FakeEncoderFixture.class.getName());
+
+  private final DIOCrossConnectFixture m_dio1;
+  private final DIOCrossConnectFixture m_dio2;
+  private boolean m_allocated;
+
+  private final FakeEncoderSource m_source;
+  private int[] m_sourcePort = new int[2];
+  private final Encoder m_encoder;
+  private int[] m_encoderPort = new int[2];
+
+  /**
+   * Constructs a FakeEncoderFixture from two DIOCrossConnectFixture.
+   */
+  public FakeEncoderFixture(DIOCrossConnectFixture dio1, DIOCrossConnectFixture dio2) {
+    assert dio1 != null;
+    assert dio2 != null;
+    m_dio1 = dio1;
+    m_dio2 = dio2;
+    m_allocated = false;
+    m_source = new FakeEncoderSource(dio1.getOutput(), dio2.getOutput());
+    m_encoder = new Encoder(dio1.getInput(), dio2.getInput());
+  }
+
+  /**
+   * Construcst a FakeEncoderFixture from a set of Digital I/O ports.
+   */
+  public FakeEncoderFixture(int inputA, int outputA, int inputB, int outputB) {
+    assert outputA != outputB;
+    assert outputA != inputA;
+    assert outputA != inputB;
+    assert outputB != inputA;
+    assert outputB != inputB;
+    assert inputA != inputB;
+    m_dio1 = new DIOCrossConnectFixture(inputA, outputA);
+    m_dio2 = new DIOCrossConnectFixture(inputB, outputB);
+    m_allocated = true;
+    m_sourcePort[0] = outputA;
+    m_sourcePort[1] = outputB;
+    m_encoderPort[0] = inputA;
+    m_encoderPort[1] = inputB;
+    m_source = new FakeEncoderSource(m_dio1.getOutput(), m_dio2.getOutput());
+    m_encoder = new Encoder(m_dio1.getInput(), m_dio2.getInput());
+  }
+
+  public FakeEncoderSource getFakeEncoderSource() {
+    return m_source;
+  }
+
+  public Encoder getEncoder() {
+    return m_encoder;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#setup()
+   */
+  @Override
+  public boolean setup() {
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#reset()
+   */
+  @Override
+  public boolean reset() {
+    m_dio1.reset();
+    m_dio2.reset();
+    m_encoder.reset();
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#teardown()
+   */
+  @Override
+  public boolean teardown() {
+    logger.fine("Begining teardown");
+    m_source.free();
+    logger.finer("Source freed " + m_sourcePort[0] + ",  " + m_sourcePort[1]);
+    m_encoder.free();
+    logger.finer("Encoder freed " + m_encoderPort[0] + ", " + m_encoderPort[1]);
+    if (m_allocated) {
+      m_dio1.teardown();
+      m_dio2.teardown();
+    }
+    return true;
+  }
+
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FilterNoiseFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FilterNoiseFixture.java
new file mode 100644
index 0000000..ee899b3
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FilterNoiseFixture.java
@@ -0,0 +1,159 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.lang.reflect.ParameterizedType;
+import java.util.Random;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+/**
+ * Represents a physically connected Motor and Encoder to allow for unit tests on these different
+ * pairs<br> Designed to allow the user to easily setup and tear down the fixture to allow for
+ * reuse. This class should be explicitly instantiated in the TestBed class to allow any test to
+ * access this fixture. This allows tests to be mailable so that you can easily reconfigure the
+ * physical testbed without breaking the tests.
+ */
+public abstract class FilterNoiseFixture<T extends PIDSource> implements ITestFixture {
+  private static final Logger logger = Logger.getLogger(FilterNoiseFixture.class.getName());
+  private boolean m_initialized = false;
+  private boolean m_tornDown = false;
+  protected T m_filter;
+  private NoiseGenerator m_data;
+
+  /**
+   * Where the implementer of this class should pass the filter constructor.
+   */
+  protected abstract T giveFilter(PIDSource source);
+
+  private void initialize() {
+    synchronized (this) {
+      if (!m_initialized) {
+        m_initialized = true; // This ensures it is only initialized once
+
+        m_data = new NoiseGenerator(TestBench.kStdDev) {
+          @Override
+          @SuppressWarnings("ParameterName")
+          public double getData(double t) {
+            return 100.0 * Math.sin(2.0 * Math.PI * t);
+          }
+        };
+        m_filter = giveFilter(m_data);
+      }
+    }
+  }
+
+  @Override
+  public boolean setup() {
+    initialize();
+    return true;
+  }
+
+  /**
+   * Gets the filter for this Object.
+   *
+   * @return the filter this object refers too
+   */
+  public T getFilter() {
+    initialize();
+    return m_filter;
+  }
+
+  /**
+   * Gets the noise generator for this object.
+   *
+   * @return the noise generator that this object refers too
+   */
+  public NoiseGenerator getNoiseGenerator() {
+    initialize();
+    return m_data;
+  }
+
+  /**
+   * Retrieves the name of the filter that this object refers to.
+   *
+   * @return The simple name of the filter {@link Class#getSimpleName()}
+   */
+  public String getType() {
+    initialize();
+    return m_filter.getClass().getSimpleName();
+  }
+
+  // test here?
+
+  @Override
+  public boolean reset() {
+    return true;
+  }
+
+  @Override
+  public boolean teardown() {
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder string = new StringBuilder("FilterNoiseFixture<");
+    // Get the generic type as a class
+    @SuppressWarnings("unchecked")
+    Class<T> class1 =
+        (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass())
+            .getActualTypeArguments()[0];
+    string.append(class1.getSimpleName());
+    string.append(">");
+    return string.toString();
+  }
+
+  /**
+   * Adds Gaussian white noise to a function returning data. The noise will have the standard
+   * deviation provided in the constructor.
+   */
+  public abstract class NoiseGenerator implements PIDSource {
+    private double m_noise = 0.0;
+
+    // Make sure first call to pidGet() uses count == 0
+    private double m_count = -TestBench.kFilterStep;
+
+    private double m_stdDev;
+    private Random m_gen = new Random();
+
+    NoiseGenerator(double stdDev) {
+      m_stdDev = stdDev;
+    }
+
+    @SuppressWarnings("ParameterName")
+    public abstract double getData(double t);
+
+    @Override
+    public void setPIDSourceType(PIDSourceType pidSource) {
+    }
+
+    @Override
+    public PIDSourceType getPIDSourceType() {
+      return PIDSourceType.kDisplacement;
+    }
+
+    public double get() {
+      return getData(m_count) + m_noise;
+    }
+
+    @Override
+    public double pidGet() {
+      m_noise = m_gen.nextGaussian() * m_stdDev;
+      m_count += TestBench.kFilterStep;
+      return getData(m_count) + m_noise;
+    }
+
+    public void reset() {
+      m_count = -TestBench.kFilterStep;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FilterOutputFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FilterOutputFixture.java
new file mode 100644
index 0000000..3c31982
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/FilterOutputFixture.java
@@ -0,0 +1,159 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.lang.reflect.ParameterizedType;
+import java.util.function.DoubleFunction;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.PIDSourceType;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+/**
+ * Represents a filter to allow for unit tests on them<br> Designed to allow the user to easily
+ * setup and tear down the fixture to allow for reuse. This class should be explicitly instantiated
+ * in the TestBed class to allow any test to access this fixture. This allows tests to be mailable
+ * so that you can easily reconfigure the physical testbed without breaking the tests.
+ */
+public abstract class FilterOutputFixture<T extends PIDSource> implements ITestFixture {
+  private static final Logger logger = Logger.getLogger(FilterOutputFixture.class.getName());
+  private boolean m_initialized = false;
+  private boolean m_tornDown = false;
+  protected T m_filter;
+  protected DataWrapper m_data;
+  private double m_expectedOutput;
+
+  public FilterOutputFixture(double expectedOutput) {
+    m_expectedOutput = expectedOutput;
+  }
+
+  /**
+   * Get expected output of fixture.
+   */
+  public double getExpectedOutput() {
+    return m_expectedOutput;
+  }
+
+  public static DoubleFunction<Double> getData = new DoubleFunction<Double>() {
+    @Override
+    @SuppressWarnings("ParameterName")
+    public Double apply(double t) {
+      return 100.0 * Math.sin(2.0 * Math.PI * t) + 20.0 * Math.cos(50.0 * Math.PI * t);
+    }
+  };
+
+  public static DoubleFunction<Double> getPulseData = new DoubleFunction<Double>() {
+    @Override
+    @SuppressWarnings("ParameterName")
+    public Double apply(double t) {
+      if (Math.abs(t - 1.0) < 0.001) {
+        return 1.0;
+      } else {
+        return 0.0;
+      }
+    }
+  };
+
+  /**
+   * Where the implementer of this class should pass the filter constructor.
+   */
+  protected abstract T giveFilter();
+
+  private void initialize() {
+    synchronized (this) {
+      if (!m_initialized) {
+        m_initialized = true; // This ensures it is only initialized once
+
+        m_filter = giveFilter();
+      }
+    }
+  }
+
+  @Override
+  public boolean setup() {
+    initialize();
+    return true;
+  }
+
+  /**
+   * Gets the filter for this Object.
+   *
+   * @return the filter this object refers too
+   */
+  public T getFilter() {
+    initialize();
+    return m_filter;
+  }
+
+  /**
+   * Retrieves the name of the filter that this object refers to.
+   *
+   * @return The simple name of the filter {@link Class#getSimpleName()}
+   */
+  public String getType() {
+    initialize();
+    return m_filter.getClass().getSimpleName();
+  }
+
+  @Override
+  public boolean reset() {
+    m_data.reset();
+    return true;
+  }
+
+  @Override
+  public boolean teardown() {
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder string = new StringBuilder("FilterOutputFixture<");
+    // Get the generic type as a class
+    @SuppressWarnings("unchecked")
+    Class<T> class1 =
+        (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass())
+            .getActualTypeArguments()[0];
+    string.append(class1.getSimpleName());
+    string.append(">");
+    return string.toString();
+  }
+
+  public class DataWrapper implements PIDSource {
+    // Make sure first call to pidGet() uses count == 0
+    private double m_count = -TestBench.kFilterStep;
+
+    private DoubleFunction<Double> m_func;
+
+    public DataWrapper(DoubleFunction<Double> func) {
+      m_func = func;
+    }
+
+    @Override
+    public void setPIDSourceType(PIDSourceType pidSource) {
+    }
+
+
+    @Override
+    public PIDSourceType getPIDSourceType() {
+      return PIDSourceType.kDisplacement;
+    }
+
+
+    @Override
+    public double pidGet() {
+      m_count += TestBench.kFilterStep;
+      return m_func.apply(m_count);
+    }
+
+    public void reset() {
+      m_count = -TestBench.kFilterStep;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/ITestFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/ITestFixture.java
new file mode 100644
index 0000000..ea2b91f
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/ITestFixture.java
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import edu.wpi.first.wpilibj.test.TestBench;
+
+/**
+ * Master interface for all test fixtures. This ensures that all test fixtures have setup and
+ * teardown methods, to ensure that the tests run properly. Test fixtures should be modeled around
+ * the content of a test, rather than the actual physical layout of the testing board. They should
+ * obtain references to hardware from the {@link TestBench} class, which is a singleton. Testing
+ * Fixtures are responsible for ensuring that the hardware is in an appropriate state for the start
+ * of a test, and ensuring that future tests will not be affected by the results of a test.
+ */
+public interface ITestFixture {
+
+  /**
+   * Performs any required setup for this fixture, ensuring that all fixture elements are ready for
+   * testing.
+   *
+   * @return True if the fixture is ready for testing
+   */
+  boolean setup();
+
+  /**
+   * Resets the fixture back to test start state. This should be called by the test class in the
+   * test setup method to ensure that the hardware is in the default state. This differs from {@link
+   * ITestFixture#setup()} as that is called once, before the class is constructed, so it may need
+   * to start sensors. This method should not have to start anything, just reset sensors and ensure
+   * that motors are stopped.
+   *
+   * @return True if the fixture is ready for testing
+   */
+  boolean reset();
+
+  /**
+   * Performs any required teardown after use of the fixture, ensuring that future tests will not
+   * run into conflicts.
+   *
+   * @return True if the teardown succeeded
+   */
+  boolean teardown();
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java
new file mode 100644
index 0000000..0a78583
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/MotorEncoderFixture.java
@@ -0,0 +1,245 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.lang.reflect.ParameterizedType;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.Counter;
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.Encoder;
+import edu.wpi.first.wpilibj.PWM;
+import edu.wpi.first.wpilibj.SpeedController;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.test.TestBench;
+
+/**
+ * Represents a physically connected Motor and Encoder to allow for unit tests on these different
+ * pairs<br> Designed to allow the user to easily setup and tear down the fixture to allow for
+ * reuse. This class should be explicitly instantiated in the TestBed class to allow any test to
+ * access this fixture. This allows tests to be mailable so that you can easily reconfigure the
+ * physical testbed without breaking the tests.
+ */
+public abstract class MotorEncoderFixture<T extends SpeedController> implements ITestFixture {
+  private static final Logger logger = Logger.getLogger(MotorEncoderFixture.class.getName());
+  private boolean m_initialized = false;
+  private boolean m_tornDown = false;
+  protected T m_motor;
+  private Encoder m_encoder;
+  private final Counter[] m_counters = new Counter[2];
+  protected DigitalInput m_alphaSource; // Stored so it can be freed at tear down
+  protected DigitalInput m_betaSource;
+
+  /**
+   * Default constructor for a MotorEncoderFixture.
+   */
+  public MotorEncoderFixture() {
+  }
+
+  public abstract int getPDPChannel();
+
+  /**
+   * Where the implementer of this class should pass the speed controller Constructor should only be
+   * called from outside this class if the Speed controller is not also an implementation of PWM
+   * interface.
+   *
+   * @return SpeedController
+   */
+  protected abstract T giveSpeedController();
+
+  /**
+   * Where the implementer of this class should pass one of the digital inputs.
+   *
+   * <p>CONSTRUCTOR SHOULD NOT BE CALLED FROM OUTSIDE THIS CLASS!
+   *
+   * @return DigitalInput
+   */
+  protected abstract DigitalInput giveDigitalInputA();
+
+  /**
+   * Where the implementer fo this class should pass the other digital input.
+   *
+   * <p>CONSTRUCTOR SHOULD NOT BE CALLED FROM OUTSIDE THIS CLASS!
+   *
+   * @return Input B to be used when this class is instantiated
+   */
+  protected abstract DigitalInput giveDigitalInputB();
+
+  private void initialize() {
+    synchronized (this) {
+      if (!m_initialized) {
+        m_initialized = true; // This ensures it is only initialized once
+
+        m_alphaSource = giveDigitalInputA();
+        m_betaSource = giveDigitalInputB();
+
+
+        m_encoder = new Encoder(m_alphaSource, m_betaSource);
+        m_counters[0] = new Counter(m_alphaSource);
+        m_counters[1] = new Counter(m_betaSource);
+        logger.fine("Creating the speed controller!");
+        m_motor = giveSpeedController();
+      }
+    }
+  }
+
+  @Override
+  public boolean setup() {
+    initialize();
+    return true;
+  }
+
+  /**
+   * Gets the motor for this Object.
+   *
+   * @return the motor this object refers too
+   */
+  public T getMotor() {
+    initialize();
+    return m_motor;
+  }
+
+  /**
+   * Gets the encoder for this object.
+   *
+   * @return the encoder that this object refers too
+   */
+  public Encoder getEncoder() {
+    initialize();
+    return m_encoder;
+  }
+
+  public Counter[] getCounters() {
+    initialize();
+    return m_counters;
+  }
+
+  /**
+   * Retrieves the name of the motor that this object refers to.
+   *
+   * @return The simple name of the motor {@link Class#getSimpleName()}
+   */
+  public String getType() {
+    initialize();
+    return m_motor.getClass().getSimpleName();
+  }
+
+  /**
+   * Checks to see if the speed of the motor is within some range of a given value. This is used
+   * instead of equals() because doubles can have inaccuracies.
+   *
+   * @param value    The value to compare against
+   * @param accuracy The accuracy range to check against to see if the
+   * @return true if the range of values between motors speed accuracy contains the 'value'.
+   */
+  public boolean isMotorSpeedWithinRange(double value, double accuracy) {
+    initialize();
+    return Math.abs(Math.abs(m_motor.get()) - Math.abs(value)) < Math.abs(accuracy);
+  }
+
+  @Override
+  public boolean reset() {
+    initialize();
+    m_motor.setInverted(false);
+    m_motor.set(0);
+    Timer.delay(TestBench.MOTOR_STOP_TIME); // DEFINED IN THE TestBench
+    m_encoder.reset();
+    for (Counter c : m_counters) {
+      c.reset();
+    }
+
+    boolean wasReset = true;
+    wasReset = wasReset && m_motor.get() == 0;
+    wasReset = wasReset && m_encoder.get() == 0;
+    for (Counter c : m_counters) {
+      wasReset = wasReset && c.get() == 0;
+    }
+
+    return wasReset;
+  }
+
+
+  /**
+   * Safely tears down the MotorEncoder Fixture in a way that makes sure that even if an object
+   * fails to initialize the rest of the fixture can still be torn down and the resources
+   * deallocated.
+   */
+  @Override
+  @SuppressWarnings("Regexp")
+  public boolean teardown() {
+    String type;
+    if (m_motor != null) {
+      type = getType();
+    } else {
+      type = "null";
+    }
+    if (!m_tornDown) {
+      boolean wasNull = false;
+      if (m_motor instanceof PWM && m_motor != null) {
+        ((PWM) m_motor).free();
+        m_motor = null;
+      } else if (m_motor == null) {
+        wasNull = true;
+      }
+      if (m_encoder != null) {
+        m_encoder.free();
+        m_encoder = null;
+      } else {
+        wasNull = true;
+      }
+      if (m_counters[0] != null) {
+        m_counters[0].free();
+        m_counters[0] = null;
+      } else {
+        wasNull = true;
+      }
+      if (m_counters[1] != null) {
+        m_counters[1].free();
+        m_counters[1] = null;
+      } else {
+        wasNull = true;
+      }
+      if (m_alphaSource != null) {
+        m_alphaSource.free();
+        m_alphaSource = null;
+      } else {
+        wasNull = true;
+      }
+      if (m_betaSource != null) {
+        m_betaSource.free();
+        m_betaSource = null;
+      } else {
+        wasNull = true;
+      }
+
+      m_tornDown = true;
+
+      if (wasNull) {
+        throw new NullPointerException("MotorEncoderFixture had null params at teardown");
+      }
+    } else {
+      throw new RuntimeException(type + " Motor Encoder torn down multiple times");
+    }
+
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder string = new StringBuilder("MotorEncoderFixture<");
+    // Get the generic type as a class
+    @SuppressWarnings("unchecked")
+    Class<T> class1 =
+        (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass())
+            .getActualTypeArguments()[0];
+    string.append(class1.getSimpleName());
+    string.append(">");
+    return string.toString();
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/RelayCrossConnectFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/RelayCrossConnectFixture.java
new file mode 100644
index 0000000..ee19c9a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/RelayCrossConnectFixture.java
@@ -0,0 +1,97 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.Relay;
+
+/**
+ * A connection between a {@link Relay} and two {@link DigitalInput DigitalInputs}.
+ */
+public abstract class RelayCrossConnectFixture implements ITestFixture {
+  private DigitalInput m_inputOne;
+  private DigitalInput m_inputTwo;
+  private Relay m_relay;
+
+  private boolean m_initialized = false;
+  private boolean m_freed = false;
+
+
+  protected abstract Relay giveRelay();
+
+  protected abstract DigitalInput giveInputOne();
+
+  protected abstract DigitalInput giveInputTwo();
+
+  private void initialize() {
+    synchronized (this) {
+      if (!m_initialized) {
+        m_relay = giveRelay();
+        m_inputOne = giveInputOne();
+        m_inputTwo = giveInputTwo();
+        m_initialized = true;
+      }
+    }
+  }
+
+  public Relay getRelay() {
+    initialize();
+    return m_relay;
+  }
+
+  public DigitalInput getInputOne() {
+    initialize();
+    return m_inputOne;
+  }
+
+  public DigitalInput getInputTwo() {
+    initialize();
+    return m_inputTwo;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#setup()
+   */
+  @Override
+  public boolean setup() {
+    initialize();
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#reset()
+   */
+  @Override
+  public boolean reset() {
+    initialize();
+    return true;
+  }
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.fixtures.ITestFixture#teardown()
+   */
+  @Override
+  public boolean teardown() {
+    if (!m_freed) {
+      m_relay.free();
+      m_inputOne.free();
+      m_inputTwo.free();
+      m_freed = true;
+    } else {
+      throw new RuntimeException("You attempted to free the "
+          + RelayCrossConnectFixture.class.getSimpleName() + " multiple times");
+    }
+    return true;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/SampleFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/SampleFixture.java
new file mode 100644
index 0000000..994c6ee
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/SampleFixture.java
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+
+/**
+ * This is an example of how to use the {@link ITestFixture} interface to create test fixtures for a
+ * test.
+ */
+public class SampleFixture implements ITestFixture {
+  @Override
+  public boolean setup() {
+    /*
+     * If this fixture actually accessed the hardware, here is where it would
+     * set up the starting state of the test bench. For example, reseting
+     * encoders, ensuring motors are stopped, reseting any serial communication
+     * if necessary, etc.
+     */
+    return true;
+  }
+
+  @Override
+  public boolean reset() {
+    /*
+     * This is where the fixture would reset any sensors or motors used by the
+     * fixture to test default state. This method should not worry about whether
+     * or not the sensors have been allocated correctly, that is the job of the
+     * setup function.
+     */
+    return false;
+  }
+
+  @Override
+  public boolean teardown() {
+    /*
+     * This is where the fixture would deallocate and reset back to normal
+     * conditions any necessary hardware. This includes ensuring motors are
+     * stopped, stoppable sensors are actually stopped, ensuring serial
+     * communications are ready for the next test, etc.
+     */
+    return true;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/TiltPanCameraFixture.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/TiltPanCameraFixture.java
new file mode 100644
index 0000000..096c559
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/fixtures/TiltPanCameraFixture.java
@@ -0,0 +1,116 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.fixtures;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.AnalogGyro;
+import edu.wpi.first.wpilibj.Servo;
+import edu.wpi.first.wpilibj.Timer;
+
+/**
+ * A class to represent the a physical Camera with two servos (tilt and pan) designed to test to see
+ * if the gyroscope is operating normally.
+ */
+public abstract class TiltPanCameraFixture implements ITestFixture {
+  public static final Logger logger = Logger.getLogger(TiltPanCameraFixture.class.getName());
+
+  public static final double RESET_TIME = 2.0;
+  private AnalogGyro m_gyro;
+  private AnalogGyro m_gyroParam;
+  private Servo m_tilt;
+  private Servo m_pan;
+  private boolean m_initialized = false;
+
+
+  protected abstract AnalogGyro giveGyro();
+
+  protected abstract AnalogGyro giveGyroParam(int center, double offset);
+
+  protected abstract Servo giveTilt();
+
+  protected abstract Servo givePan();
+
+  /**
+   * Constructs the TiltPanCamera.
+   */
+  public TiltPanCameraFixture() {
+  }
+
+  @Override
+  public boolean setup() {
+    boolean wasSetup = false;
+    if (!m_initialized) {
+      m_initialized = true;
+      m_tilt = giveTilt();
+      m_tilt.set(0);
+      m_pan = givePan();
+      m_pan.set(0);
+      Timer.delay(RESET_TIME);
+
+      logger.fine("Initializing the gyro");
+      m_gyro = giveGyro();
+      m_gyro.reset();
+      wasSetup = true;
+    }
+    return wasSetup;
+  }
+
+  @Override
+  public boolean reset() {
+    if (m_gyro != null) {
+      m_gyro.reset();
+    }
+    return true;
+  }
+
+  public Servo getTilt() {
+    return m_tilt;
+  }
+
+  public Servo getPan() {
+    return m_pan;
+  }
+
+  public AnalogGyro getGyro() {
+    return m_gyro;
+  }
+
+  public AnalogGyro getGyroParam() {
+    return m_gyroParam;
+  }
+
+  // Do not call unless all other instances of Gyro have been deallocated
+  public void setupGyroParam(int center, double offset) {
+    m_gyroParam = giveGyroParam(center, offset);
+    m_gyroParam.reset();
+  }
+
+  public void freeGyro() {
+    m_gyro.free();
+    m_gyro = null;
+  }
+
+  @Override
+  public boolean teardown() {
+    m_tilt.free();
+    m_tilt = null;
+    m_pan.free();
+    m_pan = null;
+    if (m_gyro != null) { //in case not freed during gyro tests
+      m_gyro.free();
+      m_gyro = null;
+    }
+    if (m_gyroParam != null) { //in case gyro tests failed before getting to this point
+      m_gyroParam.free();
+      m_gyroParam = null;
+    }
+    return true;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakeCounterSource.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakeCounterSource.java
new file mode 100644
index 0000000..a3fc938
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakeCounterSource.java
@@ -0,0 +1,136 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.mockhardware;
+
+import edu.wpi.first.wpilibj.DigitalOutput;
+import edu.wpi.first.wpilibj.Timer;
+
+/**
+ * Simulates an encoder for testing purposes.
+ */
+public class FakeCounterSource {
+  private Thread m_task;
+  private int m_count;
+  private int m_milliSec;
+  private DigitalOutput m_output;
+  private boolean m_allocated;
+
+  /**
+   * Thread object that allows emulation of an encoder.
+   */
+  private class EncoderThread extends Thread {
+    FakeCounterSource m_encoder;
+
+    EncoderThread(FakeCounterSource encode) {
+      m_encoder = encode;
+    }
+
+    public void run() {
+      m_encoder.m_output.set(false);
+      try {
+        for (int i = 0; i < m_encoder.m_count; i++) {
+          Thread.sleep(m_encoder.m_milliSec);
+          m_encoder.m_output.set(true);
+          Thread.sleep(m_encoder.m_milliSec);
+          m_encoder.m_output.set(false);
+        }
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+      }
+    }
+  }
+
+  /**
+   * Create a fake encoder on a given port.
+   *
+   * @param output the port to output the given signal to
+   */
+  public FakeCounterSource(DigitalOutput output) {
+    m_output = output;
+    m_allocated = false;
+    initEncoder();
+  }
+
+  /**
+   * Create a fake encoder on a given port.
+   *
+   * @param port The port the encoder is supposed to be on
+   */
+  public FakeCounterSource(int port) {
+    m_output = new DigitalOutput(port);
+    m_allocated = true;
+    initEncoder();
+  }
+
+  /**
+   * Destroy Object with minimum memory leak.
+   */
+  public void free() {
+    m_task = null;
+    if (m_allocated) {
+      m_output.free();
+      m_output = null;
+      m_allocated = false;
+    }
+  }
+
+  /**
+   * Common initailization code.
+   */
+  private void initEncoder() {
+    m_milliSec = 1;
+    m_task = new EncoderThread(this);
+    m_output.set(false);
+  }
+
+  /**
+   * Starts the thread execution task.
+   */
+  public void start() {
+    m_task.start();
+  }
+
+  /**
+   * Waits for the thread to complete.
+   */
+  public void complete() {
+    try {
+      m_task.join();
+    } catch (InterruptedException ex) {
+      Thread.currentThread().interrupt();
+    }
+    m_task = new EncoderThread(this);
+    Timer.delay(.01);
+  }
+
+  /**
+   * Starts and completes a task set - does not return until thred has finished its operations.
+   */
+  public void execute() {
+    start();
+    complete();
+  }
+
+  /**
+   * Sets the count to run encoder.
+   *
+   * @param count The count to emulate to the controller
+   */
+  public void setCount(int count) {
+    m_count = count;
+  }
+
+  /**
+   * Specify the rate to send pulses.
+   *
+   * @param milliSec The rate to send out pulses at
+   */
+  public void setRate(int milliSec) {
+    m_milliSec = milliSec;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakeEncoderSource.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakeEncoderSource.java
new file mode 100644
index 0000000..742bdac
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakeEncoderSource.java
@@ -0,0 +1,179 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2014-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.mockhardware;
+
+import edu.wpi.first.wpilibj.DigitalOutput;
+import edu.wpi.first.wpilibj.Timer;
+
+/**
+ * Emulates a quadrature encoder.
+ */
+public class FakeEncoderSource {
+  private Thread m_task;
+  private int m_count;
+  private int m_milliSec;
+  private boolean m_forward;
+  private final DigitalOutput m_outputA;
+  private final DigitalOutput m_outputB;
+  private final boolean m_allocatedOutputs;
+
+  /**
+   * Thread object that allows emulation of a quadrature encoder.
+   */
+  private class QuadEncoderThread extends Thread {
+    FakeEncoderSource m_encoder;
+
+    QuadEncoderThread(FakeEncoderSource encode) {
+      m_encoder = encode;
+    }
+
+    public void run() {
+
+      final DigitalOutput lead;
+      final DigitalOutput lag;
+
+      m_encoder.m_outputA.set(false);
+      m_encoder.m_outputB.set(false);
+
+      if (m_encoder.isForward()) {
+        lead = m_encoder.m_outputA;
+        lag = m_encoder.m_outputB;
+      } else {
+        lead = m_encoder.m_outputB;
+        lag = m_encoder.m_outputA;
+      }
+
+      try {
+        for (int i = 0; i < m_encoder.m_count; i++) {
+          lead.set(true);
+          Thread.sleep(m_encoder.m_milliSec);
+          lag.set(true);
+          Thread.sleep(m_encoder.m_milliSec);
+          lead.set(false);
+          Thread.sleep(m_encoder.m_milliSec);
+          lag.set(false);
+          Thread.sleep(m_encoder.m_milliSec);
+        }
+      } catch (InterruptedException ex) {
+        Thread.currentThread().interrupt();
+      }
+    }
+  }
+
+  /**
+   * Creates an encoder source using two ports.
+   *
+   * @param portA The A port
+   * @param portB The B port
+   */
+  public FakeEncoderSource(int portA, int portB) {
+    m_outputA = new DigitalOutput(portA);
+    m_outputB = new DigitalOutput(portB);
+    m_allocatedOutputs = true;
+    initQuadEncoder();
+  }
+
+  /**
+   * Creates the fake encoder using two digital outputs.
+   *
+   * @param outputA The A digital output
+   * @param outputB The B digital output
+   */
+  public FakeEncoderSource(DigitalOutput outputA, DigitalOutput outputB) {
+    m_outputA = outputA;
+    m_outputB = outputB;
+    m_allocatedOutputs = false;
+    initQuadEncoder();
+  }
+
+  /**
+   * Frees the resource.
+   */
+  public void free() {
+    m_task = null;
+    if (m_allocatedOutputs) {
+      m_outputA.free();
+      m_outputB.free();
+    }
+  }
+
+  /**
+   * Common initialization code.
+   */
+  private void initQuadEncoder() {
+    m_milliSec = 1;
+    m_forward = true;
+    m_task = new QuadEncoderThread(this);
+    m_outputA.set(false);
+    m_outputB.set(false);
+  }
+
+  /**
+   * Starts the thread.
+   */
+  public void start() {
+    m_task.start();
+  }
+
+  /**
+   * Waits for thread to end.
+   */
+  public void complete() {
+    try {
+      m_task.join();
+    } catch (InterruptedException ex) {
+      Thread.currentThread().interrupt();
+    }
+    m_task = new QuadEncoderThread(this);
+    Timer.delay(.01);
+  }
+
+  /**
+   * Runs and waits for thread to end before returning.
+   */
+  public void execute() {
+    start();
+    complete();
+  }
+
+  /**
+   * Rate of pulses to send.
+   *
+   * @param milliSec Pulse Rate
+   */
+  public void setRate(int milliSec) {
+    m_milliSec = milliSec;
+  }
+
+  /**
+   * Set the number of pulses to simulate.
+   *
+   * @param count Pulse count
+   */
+  public void setCount(int count) {
+    m_count = Math.abs(count);
+  }
+
+  /**
+   * Set which direction the encoder simulates motion in.
+   *
+   * @param isForward Whether to simulate forward motion
+   */
+  public void setForward(boolean isForward) {
+    m_forward = isForward;
+  }
+
+  /**
+   * Accesses whether the encoder is simulating forward motion.
+   *
+   * @return Whether the simulated motion is in the forward direction
+   */
+  public boolean isForward() {
+    return m_forward;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakePotentiometerSource.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakePotentiometerSource.java
new file mode 100644
index 0000000..397baa8
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/mockhardware/FakePotentiometerSource.java
@@ -0,0 +1,93 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.mockhardware;
+
+import edu.wpi.first.wpilibj.AnalogOutput;
+
+/**
+ * A fake source to provide output to a {@link edu.wpi.first.wpilibj.interfaces.Potentiometer}.
+ */
+public class FakePotentiometerSource {
+  private AnalogOutput m_output;
+  private boolean m_initOutput;
+  private double m_potMaxAngle;
+  private double m_potMaxVoltage = 5.0;
+  private final double m_defaultPotMaxAngle;
+
+  /**
+   * Constructs the fake source.
+   *
+   * @param output             The analog port to output the signal on
+   * @param defaultPotMaxAngle The default maximum angle the pot supports.
+   */
+  public FakePotentiometerSource(AnalogOutput output, double defaultPotMaxAngle) {
+    m_defaultPotMaxAngle = defaultPotMaxAngle;
+    m_potMaxAngle = defaultPotMaxAngle;
+    m_output = output;
+    m_initOutput = false;
+  }
+
+  public FakePotentiometerSource(int port, double defaultPotMaxAngle) {
+    this(new AnalogOutput(port), defaultPotMaxAngle);
+    m_initOutput = true;
+  }
+
+  /**
+   * Sets the maximum voltage output. If not the default is 5.0V.
+   *
+   * @param voltage The voltage that indicates that the pot is at the max value.
+   */
+  public void setMaxVoltage(double voltage) {
+    m_potMaxVoltage = voltage;
+  }
+
+  public void setRange(double range) {
+    m_potMaxAngle = range;
+  }
+
+  public void reset() {
+    m_potMaxAngle = m_defaultPotMaxAngle;
+    m_output.setVoltage(0.0);
+  }
+
+  public void setAngle(double angle) {
+    m_output.setVoltage((m_potMaxVoltage / m_potMaxAngle) * angle);
+  }
+
+  public void setVoltage(double voltage) {
+    m_output.setVoltage(voltage);
+  }
+
+  public double getVoltage() {
+    return m_output.getVoltage();
+  }
+
+  /**
+   * Returns the currently set angle.
+   *
+   * @return the current angle
+   */
+  public double getAngle() {
+    double voltage = m_output.getVoltage();
+    if (voltage == 0) { // Removes divide by zero error
+      return 0;
+    }
+    return voltage * (m_potMaxAngle / m_potMaxVoltage);
+  }
+
+  /**
+   * Frees the resouce.
+   */
+  public void free() {
+    if (m_initOutput) {
+      m_output.free();
+      m_output = null;
+      m_initOutput = false;
+    }
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboardTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboardTest.java
new file mode 100644
index 0000000..af58e6a
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboardTest.java
@@ -0,0 +1,88 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.smartdashboard;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.networktables.NetworkTable;
+import edu.wpi.first.wpilibj.test.AbstractComsSetup;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Test that covers {@link SmartDashboard}.
+ */
+public class SmartDashboardTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(SmartDashboardTest.class.getName());
+  private static final NetworkTable table = NetworkTable.getTable("SmartDashboard");
+
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+  @Test
+  public void testGetBadValue() {
+    assertEquals("", SmartDashboard.getString("_404_STRING_KEY_SHOULD_NOT_BE_FOUND_", ""));
+  }
+
+  @Test
+  public void testPutString() {
+    String key = "testPutString";
+    String value = "thisIsAValue";
+    SmartDashboard.putString(key, value);
+    assertEquals(value, SmartDashboard.getString(key, ""));
+    assertEquals(value, table.getString(key, ""));
+  }
+
+  @Test
+  public void testPutNumber() {
+    String key = "testPutNumber";
+    int value = 2147483647;
+    SmartDashboard.putNumber(key, value);
+    assertEquals(value, SmartDashboard.getNumber(key, 0), 0.01);
+    assertEquals(value, table.getNumber(key, 0), 0.01);
+  }
+
+  @Test
+  public void testPutBoolean() {
+    String key = "testPutBoolean";
+    boolean value = true;
+    SmartDashboard.putBoolean(key, value);
+    assertEquals(value, SmartDashboard.getBoolean(key, !value));
+    assertEquals(value, table.getBoolean(key, false));
+  }
+
+  @Test
+  public void testReplaceString() {
+    String key = "testReplaceString";
+    String valueOld = "oldValue";
+    SmartDashboard.putString(key, valueOld);
+    assertEquals(valueOld, SmartDashboard.getString(key, ""));
+    assertEquals(valueOld, table.getString(key, ""));
+
+    String valueNew = "newValue";
+    SmartDashboard.putString(key, valueNew);
+    assertEquals(valueNew, SmartDashboard.getString(key, ""));
+    assertEquals(valueNew, table.getString(key, ""));
+  }
+
+  @Ignore
+  @Test(expected = IllegalArgumentException.class)
+  public void testPutStringNullKey() {
+    SmartDashboard.putString(null, "This should not work");
+  }
+
+  @Ignore
+  @Test(expected = IllegalArgumentException.class)
+  public void testPutStringNullValue() {
+    SmartDashboard.putString("KEY_SHOULD_NOT_BE_STORED", null);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboardTestSuite.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboardTestSuite.java
new file mode 100644
index 0000000..d3e475e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SmartDashboardTestSuite.java
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.smartdashboard;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import edu.wpi.first.wpilibj.test.AbstractTestSuite;
+
+/**
+ * All tests pertaining to {@link SmartDashboard}.
+ */
+@RunWith(Suite.class)
+@SuiteClasses({SmartDashboardTest.class})
+public class SmartDashboardTestSuite extends AbstractTestSuite {
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java
new file mode 100644
index 0000000..d999df7
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractComsSetup.java
@@ -0,0 +1,246 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.junit.runners.model.MultipleFailureException;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import edu.wpi.first.wpilibj.DriverStation;
+import edu.wpi.first.wpilibj.MockDS;
+import edu.wpi.first.wpilibj.RobotBase;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.hal.HAL;
+import edu.wpi.first.wpilibj.livewindow.LiveWindow;
+
+/**
+ * This class serves as a superclass for all tests that involve the hardware on the roboRIO. It uses
+ * an {@link BeforeClass} statement to initialize network communications. Any test that needs to use
+ * the hardware <b>MUST</b> extend from this class, to ensure that all of the hardware will be able
+ * to run.
+ */
+public abstract class AbstractComsSetup {
+  /**
+   * Stores whether network coms have been initialized.
+   */
+  private static boolean initialized = false;
+
+  // We have no way to stop the MockDS, so its thread is daemon.
+  private static  MockDS ds;
+
+  /**
+   * This sets up the network communications library to enable the driver
+   * station. After starting network coms, it will loop until the driver station
+   * returns that the robot is enabled, to ensure that tests will be able to run
+   * on the hardware.
+   */
+  static {
+    if (!initialized) {
+      try {
+        // Set some implementations so that the static methods work properly
+        RobotBase.initializeHardwareConfiguration();
+        HAL.observeUserProgramStarting();
+        DriverStation.getInstance().getAlliance();
+
+        ds = new MockDS();
+        ds.start();
+
+        LiveWindow.setEnabled(false);
+        TestBench.out().println("Started coms");
+      } catch (Exception ex) {
+        TestBench.out().println("Exception during AbstractComsSetup initialization: " + ex);
+        ex.printStackTrace(TestBench.out());
+        throw ex;
+      }
+
+      // Wait until the robot is enabled before starting the tests
+      int enableCounter = 0;
+      while (!DriverStation.getInstance().isEnabled()) {
+        if (enableCounter > 50) {
+          // Robot did not enable properly after 5 seconds.
+          // Force exit
+          TestBench.err().println("Failed to enable. Aborting");
+          System.exit(1);
+        }
+        try {
+          Thread.sleep(100);
+        } catch (InterruptedException ex) {
+          ex.printStackTrace();
+        }
+        TestBench.out().println("Waiting for enable: " + enableCounter++);
+      }
+      TestBench.out().println();
+
+      // Ready to go!
+      initialized = true;
+      TestBench.out().println("Running!");
+    }
+  }
+
+
+  protected abstract Logger getClassLogger();
+
+  /**
+   * This causes a stack trace to be printed as the test is running as well as at the end.
+   */
+  @Rule
+  public final TestWatcher getTestWatcher() {
+    return getOverridenTestWatcher();
+  }
+
+  /**
+   * Given as a way to provide a custom test watcher for a test or set of tests.
+   *
+   * @return the test watcher to use
+   */
+  protected TestWatcher getOverridenTestWatcher() {
+    return new DefaultTestWatcher();
+  }
+
+  protected class DefaultTestWatcher extends TestWatcher {
+    /**
+     * Allows a failure to supply a custom status message to be displayed along with the stack
+     * trace.
+     */
+    protected void failed(Throwable throwable, Description description, String status) {
+      TestBench.out().println();
+      // Instance of is the best way I know to retrieve this data.
+      if (throwable instanceof MultipleFailureException) {
+        /*
+         * MultipleFailureExceptions hold multiple exceptions in one exception.
+         * In order to properly display these stack traces we have to cast the
+         * throwable and work with the list of thrown exceptions stored within
+         * it.
+         */
+        int exceptionCount = 1; // Running exception count
+        int failureCount = ((MultipleFailureException) throwable).getFailures().size();
+        for (Throwable singleThrown : ((MultipleFailureException) throwable).getFailures()) {
+          getClassLogger().logp(
+              Level.SEVERE,
+              description.getClassName(),
+              description.getMethodName(),
+              (exceptionCount++) + "/" + failureCount + " " + description.getDisplayName() + " "
+                  + "failed " + singleThrown.getMessage() + "\n" + status, singleThrown);
+        }
+
+      } else {
+        getClassLogger().logp(Level.SEVERE, description.getClassName(),
+            description.getMethodName(),
+            description.getDisplayName() + " failed " + throwable.getMessage() + "\n" + status,
+            throwable);
+      }
+      super.failed(throwable, description);
+    }
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.junit.rules.TestWatcher#failed(java.lang.Throwable,
+     * org.junit.runner.Description)
+     */
+    @Override
+    protected void failed(Throwable exception, Description description) {
+      failed(exception, description, "");
+    }
+
+
+    /*
+     * (non-Javadoc)
+     *
+     * @see org.junit.rules.TestWatcher#starting(org.junit.runner.Description)
+     */
+    @Override
+    protected void starting(Description description) {
+      TestBench.out().println();
+      // Wait until the robot is enabled before starting the next tests
+      int enableCounter = 0;
+      while (!DriverStation.getInstance().isEnabled()) {
+        try {
+          Thread.sleep(100);
+        } catch (InterruptedException ex) {
+          ex.printStackTrace();
+        }
+        // Prints the message on one line overwriting itself each time
+        TestBench.out().print("\rWaiting for enable: " + enableCounter++);
+      }
+      getClassLogger().logp(Level.INFO, description.getClassName(), description.getMethodName(),
+          "Starting");
+      super.starting(description);
+    }
+
+    @Override
+    protected void succeeded(Description description) {
+      simpleLog(Level.INFO, "TEST PASSED!");
+      super.succeeded(description);
+    }
+
+  }
+
+  /**
+   * Logs a simple message without the logger formatting associated with it.
+   *
+   * @param level   The level to log the message at
+   * @param message The message to log
+   */
+  protected void simpleLog(Level level, String message) {
+    if (getClassLogger().isLoggable(level)) {
+      TestBench.out().println(message);
+    }
+  }
+
+  /**
+   * Provided as a replacement to lambda functions to allow for repeatable checks to see if a
+   * correct state is reached.
+   */
+  public abstract class BooleanCheck {
+    public BooleanCheck() {
+    }
+
+    /**
+     * Runs the enclosed code and evaluates it to determine what state it should return.
+     *
+     * @return true if the code provided within the method returns true
+     */
+    public abstract boolean getAsBoolean();
+  }
+
+  /**
+   * Delays until either the correct state is reached or we reach the timeout.
+   *
+   * @param level        The level to log the message at.
+   * @param timeout      How long the delay should run before it should timeout and allow the test
+   *                     to continue
+   * @param message      The message to accompany the delay. The message will display 'message' took
+   *                     'timeout' seconds if it passed.
+   * @param correctState A method to determine if the test has reached a state where it is valid to
+   *                     continue
+   * @return a double representing how long the delay took to run in seconds.
+   */
+  public double delayTillInCorrectStateWithMessage(Level level, double timeout, String message,
+                                                   BooleanCheck correctState) {
+    int timeoutIndex;
+    // As long as we are not in the correct state and the timeout has not been
+    // reached then continue to run this loop
+    for (timeoutIndex = 0; timeoutIndex < (timeout * 100) && !correctState.getAsBoolean();
+         timeoutIndex++) {
+      Timer.delay(.01);
+    }
+    if (correctState.getAsBoolean()) {
+      simpleLog(level, message + " took " + (timeoutIndex * .01) + " seconds");
+    } else {
+      simpleLog(level, message + " timed out after " + (timeoutIndex * .01) + " seconds");
+    }
+    return timeoutIndex * .01;
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuite.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuite.java
new file mode 100644
index 0000000..794d0e4
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuite.java
@@ -0,0 +1,257 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.Request;
+import org.junit.runners.Suite.SuiteClasses;
+
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+/**
+ * Allows tests suites and tests to be run selectively from the command line using a regex text
+ * pattern.
+ */
+public abstract class AbstractTestSuite {
+  private static final Logger logger = Logger.getLogger(AbstractTestSuite.class.getName());
+
+  /**
+   * Gets all of the classes listed within the SuiteClasses annotation. To use it, annotate a class
+   * with <code>@RunWith(Suite.class)</code> and <code>@SuiteClasses({TestClass1.class,
+   * ...})</code>. When you run this class, it will run all the tests in all the suite classes. When
+   * loading the tests using regex the test list will be generated from this annotation.
+   *
+   * @return the list of classes listed in the <code>@SuiteClasses({TestClass1.class, ...})</code>.
+   * @throws RuntimeException If the <code>@SuiteClasses</code> annotation is missing.
+   */
+  protected List<Class<?>> getAnnotatedTestClasses() {
+    SuiteClasses annotation = getClass().getAnnotation(SuiteClasses.class);
+    List<Class<?>> classes = new Vector<Class<?>>();
+    if (annotation == null) {
+      throw new RuntimeException(String.format("class '%s' must have a SuiteClasses annotation",
+          getClass().getName()));
+    }
+    for (Class<?> c : annotation.value()) {
+      classes.add(c);
+    }
+    return classes;
+  }
+
+  private boolean areAnySuperClassesOfTypeAbstractTestSuite(Class<?> check) {
+    while (check != null) {
+      if (check.equals(AbstractTestSuite.class)) {
+        return true;
+      }
+      check = check.getSuperclass();
+    }
+    return false;
+  }
+
+  /**
+   * Stores a method name and method class pair. Used when searching for methods matching a given
+   * regex text.
+   */
+  protected class ClassMethodPair {
+    public final Class<?> m_methodClass;
+    public final String m_methodName;
+
+    public ClassMethodPair(Class<?> klass, Method method) {
+      m_methodClass = klass;
+      m_methodName = method.getName();
+    }
+
+    public Request getMethodRunRequest() {
+      return Request.method(m_methodClass, m_methodName);
+    }
+  }
+
+  protected List<ClassMethodPair> getMethodMatching(final String regex) {
+    List<ClassMethodPair> classMethodPairs = new Vector<ClassMethodPair>();
+    // Get all of the test classes
+    for (Class<?> c : getAllContainedBaseTests()) {
+      for (Method m : c.getMethods()) {
+        // If this is a test method that is not trying to be ignored and it
+        // matches the regex
+        if (m.getAnnotation(Test.class) != null && m.getAnnotation(Ignore.class) == null
+            && Pattern.matches(regex, m.getName())) {
+          ClassMethodPair pair = new ClassMethodPair(c, m);
+          classMethodPairs.add(pair);
+        }
+      }
+    }
+    return classMethodPairs;
+  }
+
+
+  /**
+   * Gets all of the test classes listed in this suite. Does not include any of the test suites. All
+   * of these classes contain tests.
+   *
+   * @param runningList the running list of classes to prevent recursion.
+   * @return The list of base test classes.
+   */
+  private List<Class<?>> getAllContainedBaseTests(List<Class<?>> runningList) {
+    for (Class<?> c : getAnnotatedTestClasses()) {
+      // Check to see if this is a test class or a suite
+      if (areAnySuperClassesOfTypeAbstractTestSuite(c)) {
+        // Create a new instance of this class so that we can retrieve its data
+        try {
+          AbstractTestSuite suite = (AbstractTestSuite) c.newInstance();
+          // Add the tests from this suite that match the regex to the list of
+          // tests to run
+          runningList = suite.getAllContainedBaseTests(runningList);
+        } catch (InstantiationException | IllegalAccessException ex) {
+          // This shouldn't happen unless the constructor is changed in some
+          // way.
+          logger.log(Level.SEVERE, "Test suites can not take paramaters in their constructors.",
+              ex);
+        }
+      } else if (c.getAnnotation(SuiteClasses.class) != null) {
+        logger.log(Level.SEVERE,
+            String.format("class '%s' must extend %s to be searchable using regex.",
+                c.getName(), AbstractTestSuite.class.getName()));
+      } else { // This is a class containing tests
+        // so add it to the list
+        runningList.add(c);
+      }
+    }
+    return runningList;
+  }
+
+  /**
+   * Gets all of the test classes listed in this suite. Does not include any of the test suites. All
+   * of these classes contain tests.
+   *
+   * @return The list of base test classes.
+   */
+  public List<Class<?>> getAllContainedBaseTests() {
+    List<Class<?>> runningBaseTests = new Vector<Class<?>>();
+    return getAllContainedBaseTests(runningBaseTests);
+  }
+
+
+  /**
+   * Retrieves all of the classes listed in the <code>@SuiteClasses</code> annotation that match the
+   * given regex text.
+   *
+   * @param regex       the text pattern to retrieve.
+   * @param runningList the running list of classes to prevent recursion
+   * @return The list of classes matching the regex pattern
+   */
+  private List<Class<?>> getAllClassMatching(final String regex, final List<Class<?>> runningList) {
+    for (Class<?> c : getAnnotatedTestClasses()) {
+      // Compare the regex against the simple name of the class
+      if (Pattern.matches(regex, c.getName()) && !runningList.contains(c)) {
+        runningList.add(c);
+      }
+    }
+    return runningList;
+  }
+
+  /**
+   * Retrieves all of the classes listed in the <code>@SuiteClasses</code> annotation that match the
+   * given regex text.
+   *
+   * @param regex the text pattern to retrieve.
+   * @return The list of classes matching the regex pattern
+   */
+  public List<Class<?>> getAllClassMatching(final String regex) {
+    final List<Class<?>> matchingClasses = new Vector<Class<?>>();
+    return getAllClassMatching(regex, matchingClasses);
+  }
+
+  /**
+   * Searches through all of the suites and tests and loads only the test or test suites matching
+   * the regex text. This method also prevents a single test from being loaded multiple times by
+   * loading the suite first then loading tests from all non loaded suites.
+   *
+   * @param regex the regex text to search for
+   * @return the list of suite and/or test classes matching the regex.
+   */
+  private List<Class<?>> getSuiteOrTestMatchingRegex(final String regex, List<Class<?>>
+      runningList) {
+    // Get any test suites matching the regex using the superclass methods
+    runningList = getAllClassMatching(regex, runningList);
+
+
+    // Then search any test suites not retrieved already for test classes
+    // matching the regex.
+    List<Class<?>> unCollectedSuites = getAllClasses();
+    // If we already have a test suite then we don't want to load the test twice
+    // so remove the suite from the list
+    unCollectedSuites.removeAll(runningList);
+    for (Class<?> c : unCollectedSuites) {
+      // Prevents recursively adding tests/suites that have already been added
+      if (!runningList.contains(c)) {
+        try {
+          final AbstractTestSuite suite;
+          // Check the class to make sure that it is not a test class
+          if (areAnySuperClassesOfTypeAbstractTestSuite(c)) {
+            // Create a new instance of this class so that we can retrieve its
+            // data.
+            suite = (AbstractTestSuite) c.newInstance();
+            // Add the tests from this suite that match the regex to the list of
+            // tests to run
+            runningList = suite.getSuiteOrTestMatchingRegex(regex, runningList);
+          }
+
+        } catch (InstantiationException | IllegalAccessException ex) {
+          // This shouldn't happen unless the constructor is changed in some
+          // way.
+          logger.log(Level.SEVERE, "Test suites can not take paramaters in their constructors.",
+              ex);
+        }
+      }
+    }
+    return runningList;
+  }
+
+  /**
+   * Searches through all of the suites and tests and loads only the test or test suites matching
+   * the regex text. This method also prevents a single test from being loaded multiple times by
+   * loading the suite first then loading tests from all non loaded suites.
+   *
+   * @param regex the regex text to search for
+   * @return the list of suite and/or test classes matching the regex.
+   */
+  protected List<Class<?>> getSuiteOrTestMatchingRegex(final String regex) {
+    final List<Class<?>> matchingClasses = new Vector<Class<?>>();
+    return getSuiteOrTestMatchingRegex(regex, matchingClasses);
+  }
+
+
+  /**
+   * Retrieves all of the classes listed in the <code>@SuiteClasses</code> annotation.
+   *
+   * @return List of SuiteClasses
+   * @throws RuntimeException If the <code>@SuiteClasses</code> annotation is missing.
+   */
+  public List<Class<?>> getAllClasses() {
+    return getAnnotatedTestClasses();
+  }
+
+  /**
+   * Gets the name of all of the classes listed within the <code>@SuiteClasses</code> annotation.
+   *
+   * @return the list of classes.
+   * @throws RuntimeException If the <code>@SuiteClasses</code> annotation is missing.
+   */
+  public List<String> getAllClassName() {
+    List<String> classNames = new Vector<String>();
+    for (Class<?> c : getAnnotatedTestClasses()) {
+      classNames.add(c.getName());
+    }
+    return classNames;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java
new file mode 100644
index 0000000..d3ece6e
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AbstractTestSuiteTest.java
@@ -0,0 +1,155 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+import org.junit.runners.model.InitializationError;
+
+import java.util.List;
+
+import edu.wpi.first.wpilibj.test.AbstractTestSuite.ClassMethodPair;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasItems;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Yes, this is the test system testing itself. Functionally, this is making sure that all tests get
+ * run correctly when you use parametrized arguments.
+ */
+@SuppressWarnings("MultipleTopLevelClasses")
+public class AbstractTestSuiteTest {
+  @Ignore("Prevents ANT from trying to run these as tests")
+  @RunWith(Suite.class)
+  @SuiteClasses({FirstSampleTest.class, SecondSampleTest.class, ThirdSampleTest.class,
+      FourthSampleTest.class, UnusualTest.class, ExampleSubSuite.class, EmptySuite.class})
+  class TestForAbstractTestSuite extends AbstractTestSuite {
+  }
+
+  TestForAbstractTestSuite m_testSuite;
+
+  @Before
+  public void setUp() throws Exception {
+    m_testSuite = new TestForAbstractTestSuite();
+  }
+
+  @Test
+  public void testGetTestsMatchingAll() throws InitializationError {
+    // when
+    List<Class<?>> collectedTests = m_testSuite.getAllClassMatching(".*");
+    // then
+    assertEquals(7, collectedTests.size());
+  }
+
+  @Test
+  public void testGetTestsMatchingSample() throws InitializationError {
+    // when
+    List<Class<?>> collectedTests = m_testSuite.getAllClassMatching(".*Sample.*");
+    // then
+    assertEquals(4, collectedTests.size());
+  }
+
+  @Test
+  public void testGetTestsMatchingUnusual() throws InitializationError {
+    // when
+    List<Class<?>> collectedTests = m_testSuite.getAllClassMatching(".*Unusual.*");
+    // then
+    assertEquals(1, collectedTests.size());
+    assertEquals(UnusualTest.class, collectedTests.get(0));
+  }
+
+  @Test
+  public void testGetTestsFromSuiteMatchingAll() throws InitializationError {
+    // when
+    List<Class<?>> collectedTests = m_testSuite.getSuiteOrTestMatchingRegex(".*");
+    // then
+    assertEquals(7, collectedTests.size());
+  }
+
+  @Test
+  public void testGetTestsFromSuiteMatchingTest() throws InitializationError {
+    // when
+    List<Class<?>> collectedTests = m_testSuite.getSuiteOrTestMatchingRegex(".*Test.*");
+    // then
+    assertEquals(7, collectedTests.size());
+    assertThat(collectedTests, hasItems(FirstSubSuiteTest.class,
+        SecondSubSuiteTest.class, UnusualTest.class));
+    assertThat(collectedTests,
+        not(hasItems(new Class<?>[]{ExampleSubSuite.class, EmptySuite.class})));
+  }
+
+  @Test
+  public void testGetMethodFromTest() {
+    // when
+    List<ClassMethodPair> pairs = m_testSuite.getMethodMatching(".*Method.*");
+    // then
+    assertEquals(1, pairs.size());
+    assertEquals(FirstSubSuiteTest.class, pairs.get(0).m_methodClass);
+    assertEquals(FirstSubSuiteTest.METHODNAME, pairs.get(0).m_methodName);
+
+  }
+
+}
+
+@SuppressWarnings("OneTopLevelClass")
+class FirstSampleTest {
+}
+
+@SuppressWarnings("OneTopLevelClass")
+class SecondSampleTest {
+}
+
+@SuppressWarnings("OneTopLevelClass")
+class ThirdSampleTest {
+}
+
+@SuppressWarnings("OneTopLevelClass")
+class FourthSampleTest {
+}
+
+@SuppressWarnings("OneTopLevelClass")
+class UnusualTest {
+} // This is a member of both suites
+
+
+@Ignore("Prevents ANT from trying to run these as tests")
+@SuppressWarnings("OneTopLevelClass")
+class FirstSubSuiteTest {
+  public static final String METHODNAME = "aTestMethod";
+
+  @Test
+  @SuppressWarnings("MethodName")
+  public void aTestMethod() {
+  }
+}
+
+@SuppressWarnings("OneTopLevelClass")
+class SecondSubSuiteTest {
+}
+
+
+@RunWith(Suite.class)
+@SuiteClasses({FirstSubSuiteTest.class, SecondSubSuiteTest.class, UnusualTest.class})
+@Ignore("Prevents ANT from trying to run these as tests")
+@SuppressWarnings("OneTopLevelClass")
+class ExampleSubSuite extends AbstractTestSuite {
+}
+
+
+@Ignore("Prevents ANT from trying to run these as tests")
+@RunWith(Suite.class)
+@SuiteClasses({})
+@SuppressWarnings("OneTopLevelClass")
+class EmptySuite extends AbstractTestSuite {
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AntJunitLanucher.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AntJunitLanucher.java
new file mode 100644
index 0000000..77ed801
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/AntJunitLanucher.java
@@ -0,0 +1,91 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import org.apache.tools.ant.BuildLogger;
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.optional.junit.FormatterElement;
+import org.apache.tools.ant.taskdefs.optional.junit.JUnitTask;
+import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest;
+
+import java.io.File;
+
+/**
+ * Provides an entry point for tests to run with ANT. This allows ant to output JUnit XML test
+ * results for Jenkins.
+ */
+public class AntJunitLanucher {
+  /**
+   * Main entry point for jenkins.
+   *
+   * @param args Arguments passed to java.
+   */
+  public static void main(String... args) {
+    if (args.length == 0) {
+      String path =
+          String.format("%s/%s", System.getProperty("user.dir"), "/testResults/AntReports");
+      String pathToReports = path;
+      Project project = new Project();
+
+      try {
+        // Create the file to store the test output
+        new File(pathToReports).mkdirs();
+
+        project.setProperty("java.io.tmpdir", pathToReports);
+
+        /* Output to screen */
+        FormatterElement.TypeAttribute typeScreen = new FormatterElement.TypeAttribute();
+        typeScreen.setValue("plain");
+        FormatterElement formatToScreen = new FormatterElement();
+        formatToScreen.setType(typeScreen);
+        formatToScreen.setUseFile(false);
+        formatToScreen.setOutput(System.out);
+
+        JUnitTask task = new JUnitTask();
+        task.addFormatter(formatToScreen);
+
+        // add a build listener to the project
+        BuildLogger logger = new DefaultLogger();
+        logger.setOutputPrintStream(System.out);
+        logger.setErrorPrintStream(System.err);
+        logger.setMessageOutputLevel(Project.MSG_INFO);
+        logger.setEmacsMode(true);
+        project.addBuildListener(logger);
+
+        task.setProject(project);
+
+        // Set the output to the XML file
+        FormatterElement.TypeAttribute type = new FormatterElement.TypeAttribute();
+        type.setValue("xml");
+
+        FormatterElement formater = new FormatterElement();
+        formater.setType(type);
+        task.addFormatter(formater);
+
+        // Create the JUnitTest
+        JUnitTest test = new JUnitTest(TestSuite.class.getName());
+        test.setTodir(new File(pathToReports));
+        task.addTest(test);
+
+        TestBench.out().println("Beginning Test Execution With ANT");
+        task.execute();
+      } catch (Exception ex) {
+        ex.printStackTrace();
+      }
+    } else {
+      TestBench.out().println(
+          "Run will not output XML for Jenkins because " + "tests are not being run with ANT");
+      // This should never return as it makes its own call to
+      // System.exit();
+      TestSuite.main(args);
+    }
+    System.exit(0);
+  }
+
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/QuickTest.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/QuickTest.java
new file mode 100644
index 0000000..05953be
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/QuickTest.java
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import org.junit.Test;
+
+import java.util.logging.Logger;
+
+/**
+ * This class is designated to allow for simple testing of the library without the overlying testing
+ * framework. This test is NOT run as a normal part of the testing process and must be explicitly
+ * selected at runtime by using the 'quick' argument. This test should never be committed with
+ * changes to it but can be used during development to aid in feature testing.
+ */
+public class QuickTest extends AbstractComsSetup {
+  private static final Logger logger = Logger.getLogger(QuickTest.class.getName());
+
+  /*
+   * (non-Javadoc)
+   *
+   * @see edu.wpi.first.wpilibj.test.AbstractComsSetup#getClassLogger()
+   */
+  @Override
+  protected Logger getClassLogger() {
+    return logger;
+  }
+
+
+  @Test
+  public void test() {
+
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/RepeatRule.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/RepeatRule.java
new file mode 100644
index 0000000..5e987d6
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/RepeatRule.java
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import org.junit.rules.TestRule;
+import org.junit.runner.Description;
+import org.junit.runners.model.Statement;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This JUnit Rule allows you to apply this rule to any test to allow it to run multiple times. This
+ * is important if you have a test that fails only "sometimes" and needs to be rerun to find the
+ * issue.
+ *
+ * <p>This code was originally found here:
+ * <a href="http://www.codeaffine.com/2013/04/10/running-junit-tests-repeatedly-without-loops/">
+ * Running JUnit Tests Repeatedly Without Loops</a>
+ */
+public class RepeatRule implements TestRule {
+  @Retention(RetentionPolicy.RUNTIME)
+  @Target({java.lang.annotation.ElementType.METHOD})
+  public @interface Repeat {
+    /**
+     * The number of times to repeat the test.
+     */
+    int times();
+  }
+
+
+  private static class RepeatStatement extends Statement {
+    private final int m_times;
+    private final Statement m_statement;
+
+    private RepeatStatement(int times, Statement statement) {
+      m_times = times;
+      m_statement = statement;
+    }
+
+    @Override
+    public void evaluate() throws Throwable {
+      for (int i = 0; i < m_times; i++) {
+        m_statement.evaluate();
+      }
+    }
+  }
+
+  @Override
+  public Statement apply(Statement statement, Description description) {
+    Statement result = statement;
+    Repeat repeat = description.getAnnotation(Repeat.class);
+    if (repeat != null) {
+      int times = repeat.times();
+      result = new RepeatStatement(times, statement);
+    }
+    return result;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
new file mode 100644
index 0000000..0f63b0c
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestBench.java
@@ -0,0 +1,480 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+
+import edu.wpi.first.wpilibj.AnalogGyro;
+import edu.wpi.first.wpilibj.AnalogInput;
+import edu.wpi.first.wpilibj.AnalogOutput;
+import edu.wpi.first.wpilibj.DigitalInput;
+import edu.wpi.first.wpilibj.Jaguar;
+import edu.wpi.first.wpilibj.PIDSource;
+import edu.wpi.first.wpilibj.Relay;
+import edu.wpi.first.wpilibj.Servo;
+import edu.wpi.first.wpilibj.Talon;
+import edu.wpi.first.wpilibj.Victor;
+import edu.wpi.first.wpilibj.filters.LinearDigitalFilter;
+import edu.wpi.first.wpilibj.fixtures.AnalogCrossConnectFixture;
+import edu.wpi.first.wpilibj.fixtures.DIOCrossConnectFixture;
+import edu.wpi.first.wpilibj.fixtures.FilterNoiseFixture;
+import edu.wpi.first.wpilibj.fixtures.FilterOutputFixture;
+import edu.wpi.first.wpilibj.fixtures.MotorEncoderFixture;
+import edu.wpi.first.wpilibj.fixtures.RelayCrossConnectFixture;
+import edu.wpi.first.wpilibj.fixtures.TiltPanCameraFixture;
+
+/**
+ * This class provides access to all of the elements on the test bench, for use in fixtures. This
+ * class is a singleton, you should use {@link #getInstance()} to obtain a reference to the {@code
+ * TestBench}.
+ */
+public final class TestBench {
+  /**
+   * The time that it takes to have a motor go from rotating at full speed to completely stopped.
+   */
+  public static final double MOTOR_STOP_TIME = 0.25;
+
+  public static final int kTalonChannel = 10;
+  public static final int kVictorChannel = 1;
+  public static final int kJaguarChannel = 2;
+
+  /* TiltPanCamera Channels */
+  public static final int kGyroChannel = 0;
+  public static final double kGyroSensitivity = 0.013;
+  public static final int kTiltServoChannel = 9;
+  public static final int kPanServoChannel = 8;
+
+
+  /* PowerDistributionPanel channels */
+  public static final int kJaguarPDPChannel = 6;
+  public static final int kVictorPDPChannel = 8;
+  public static final int kTalonPDPChannel = 10;
+
+  // THESE MUST BE IN INCREMENTING ORDER
+  public static final int DIOCrossConnectB2 = 9;
+  public static final int DIOCrossConnectB1 = 8;
+  public static final int DIOCrossConnectA2 = 7;
+  public static final int DIOCrossConnectA1 = 6;
+
+  // Filter constants
+  public static final double kStdDev = 10.0;
+  public static final double kFilterStep = 0.005;
+  public static final double kFilterTime = 2.0;
+  public static final double kSinglePoleIIRTimeConstant = 0.015915;
+  public static final double kSinglePoleIIRExpectedOutput = -3.2172003;
+  public static final double kHighPassTimeConstant = 0.006631;
+  public static final double kHighPassExpectedOutput = 10.074717;
+  public static final int kMovAvgTaps = 6;
+  public static final double kMovAvgExpectedOutput = -10.191644;
+
+  /**
+   * The Singleton instance of the Test Bench.
+   */
+  private static TestBench instance = null;
+
+  /**
+   * The single constructor for the TestBench. This method is private in order to prevent multiple
+   * TestBench objects from being allocated.
+   */
+  protected TestBench() {
+  }
+
+  /**
+   * Constructs a new set of objects representing a connected set of Talon controlled Motors and an
+   * encoder.
+   *
+   * @return a freshly allocated Talon, Encoder pair
+   */
+  public MotorEncoderFixture<Talon> getTalonPair() {
+
+    MotorEncoderFixture<Talon> talonPair = new MotorEncoderFixture<Talon>() {
+      @Override
+      protected Talon giveSpeedController() {
+        return new Talon(kTalonChannel);
+      }
+
+      @Override
+      protected DigitalInput giveDigitalInputA() {
+        return new DigitalInput(0);
+      }
+
+      @Override
+      protected DigitalInput giveDigitalInputB() {
+        return new DigitalInput(1);
+      }
+
+      @Override
+      public int getPDPChannel() {
+        return kTalonPDPChannel;
+      }
+    };
+    return talonPair;
+  }
+
+  /**
+   * Constructs a new set of objects representing a connected set of Victor controlled Motors and an
+   * encoder.
+   *
+   * @return a freshly allocated Victor, Encoder pair
+   */
+  public MotorEncoderFixture<Victor> getVictorPair() {
+
+    MotorEncoderFixture<Victor> vicPair = new MotorEncoderFixture<Victor>() {
+      @Override
+      protected Victor giveSpeedController() {
+        return new Victor(kVictorChannel);
+      }
+
+      @Override
+      protected DigitalInput giveDigitalInputA() {
+        return new DigitalInput(2);
+      }
+
+      @Override
+      protected DigitalInput giveDigitalInputB() {
+        return new DigitalInput(3);
+      }
+
+      @Override
+      public int getPDPChannel() {
+        return kVictorPDPChannel;
+      }
+    };
+    return vicPair;
+  }
+
+  /**
+   * Constructs a new set of objects representing a connected set of Jaguar controlled Motors and an
+   * encoder.
+   *
+   * @return a freshly allocated Jaguar, Encoder pair
+   */
+  public MotorEncoderFixture<Jaguar> getJaguarPair() {
+    MotorEncoderFixture<Jaguar> jagPair = new MotorEncoderFixture<Jaguar>() {
+      @Override
+      protected Jaguar giveSpeedController() {
+        return new Jaguar(kJaguarChannel);
+      }
+
+      @Override
+      protected DigitalInput giveDigitalInputA() {
+        return new DigitalInput(4);
+      }
+
+      @Override
+      protected DigitalInput giveDigitalInputB() {
+        return new DigitalInput(5);
+      }
+
+      @Override
+      public int getPDPChannel() {
+        return kJaguarPDPChannel;
+      }
+    };
+    return jagPair;
+  }
+
+  /**
+   * Constructs a new set of two Servo's and a Gyroscope.
+   *
+   * @return a freshly allocated Servo's and a freshly allocated Gyroscope
+   */
+  public TiltPanCameraFixture getTiltPanCam() {
+    TiltPanCameraFixture tpcam = new TiltPanCameraFixture() {
+      @Override
+      protected AnalogGyro giveGyro() {
+        AnalogGyro gyro = new AnalogGyro(kGyroChannel);
+        gyro.setSensitivity(kGyroSensitivity);
+        return gyro;
+      }
+
+      @Override
+      protected AnalogGyro giveGyroParam(int center, double offset) {
+        AnalogGyro gyro = new AnalogGyro(kGyroChannel, center, offset);
+        gyro.setSensitivity(kGyroSensitivity);
+        return gyro;
+      }
+
+      @Override
+      protected Servo giveTilt() {
+        return new Servo(kTiltServoChannel);
+      }
+
+      @Override
+      protected Servo givePan() {
+        return new Servo(kPanServoChannel);
+      }
+    };
+
+    return tpcam;
+  }
+
+  public DIOCrossConnectFixture getDIOCrossConnectFixture(int inputPort, int outputPort) {
+    DIOCrossConnectFixture dio = new DIOCrossConnectFixture(inputPort, outputPort);
+    return dio;
+  }
+
+  /**
+   * Gets two lists of possible DIO pairs for the two pairs.
+   */
+  private List<List<Integer[]>> getDIOCrossConnect() {
+    List<List<Integer[]>> pairs = new ArrayList<List<Integer[]>>();
+    List<Integer[]> setA =
+        Arrays.asList(new Integer[][]{
+            {new Integer(DIOCrossConnectA1), new Integer(DIOCrossConnectA2)},
+            {new Integer(DIOCrossConnectA2), new Integer(DIOCrossConnectA1)}});
+    pairs.add(setA);
+
+    List<Integer[]> setB =
+        Arrays.asList(new Integer[][]{
+            {new Integer(DIOCrossConnectB1), new Integer(DIOCrossConnectB2)},
+            {new Integer(DIOCrossConnectB2), new Integer(DIOCrossConnectB1)}});
+    pairs.add(setB);
+    // NOTE: IF MORE DIOCROSSCONNECT PAIRS ARE ADDED ADD THEM HERE
+    return pairs;
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  public static AnalogCrossConnectFixture getAnalogCrossConnectFixture() {
+    AnalogCrossConnectFixture analogIO = new AnalogCrossConnectFixture() {
+      @Override
+      protected AnalogOutput giveAnalogOutput() {
+        return new AnalogOutput(0);
+      }
+
+      @Override
+      protected AnalogInput giveAnalogInput() {
+        return new AnalogInput(2);
+      }
+    };
+    return analogIO;
+  }
+
+  @SuppressWarnings("JavadocMethod")
+  public static RelayCrossConnectFixture getRelayCrossConnectFixture() {
+    RelayCrossConnectFixture relay = new RelayCrossConnectFixture() {
+
+      @Override
+      protected Relay giveRelay() {
+        return new Relay(0);
+      }
+
+      @Override
+      protected DigitalInput giveInputTwo() {
+        return new DigitalInput(18);
+      }
+
+      @Override
+      protected DigitalInput giveInputOne() {
+        return new DigitalInput(19);
+      }
+    };
+    return relay;
+  }
+
+  /**
+   * Return a single Collection containing all of the DIOCrossConnectFixtures in all two pair
+   * combinations.
+   *
+   * @return pairs of DIOCrossConnectFixtures
+   */
+  public Collection<Integer[]> getDIOCrossConnectCollection() {
+    Collection<Integer[]> pairs = new ArrayList<Integer[]>();
+    for (Collection<Integer[]> collection : getDIOCrossConnect()) {
+      pairs.addAll(collection);
+    }
+    return pairs;
+  }
+
+  /**
+   * Gets an array of pairs for the encoder to use using two different lists.
+   *
+   * @param flip whether this encoder needs to be flipped
+   * @return A list of different inputs to use for the tests
+   */
+  private Collection<Integer[]> getPairArray(List<Integer[]> listA, List<Integer[]> listB,
+                                             boolean flip) {
+    Collection<Integer[]> encoderPortPairs = new ArrayList<Integer[]>();
+    for (Integer[] portPairsA : listA) {
+      Integer[] inputs = new Integer[5];
+      inputs[0] = portPairsA[0]; // InputA
+      inputs[1] = portPairsA[1]; // InputB
+
+      for (Integer[] portPairsB : listB) {
+        inputs[2] = portPairsB[0]; // OutputA
+        inputs[3] = portPairsB[1]; // OutputB
+        inputs[4] = flip ? 0 : 1; // The flip bit
+      }
+
+      ArrayList<Integer[]> construtorInput = new ArrayList<Integer[]>();
+      construtorInput.add(inputs);
+
+      inputs = inputs.clone();
+      for (Integer[] portPairsB : listB) {
+        inputs[2] = portPairsB[1]; // OutputA
+        inputs[3] = portPairsB[0]; // OutputB
+        inputs[4] = flip ? 0 : 1; // The flip bit
+      }
+      construtorInput.add(inputs);
+      encoderPortPairs.addAll(construtorInput);
+    }
+    return encoderPortPairs;
+  }
+
+  /**
+   * Constructs the list of inputs to be used for the encoder test.
+   *
+   * @return A collection of different input pairs to use for the encoder
+   */
+  public Collection<Integer[]> getEncoderDIOCrossConnectCollection() {
+    Collection<Integer[]> encoderPortPairs = new ArrayList<Integer[]>();
+    assert getDIOCrossConnect().size() == 2;
+    encoderPortPairs.addAll(getPairArray(getDIOCrossConnect().get(0), getDIOCrossConnect().get(1),
+        false));
+    encoderPortPairs.addAll(getPairArray(getDIOCrossConnect().get(1), getDIOCrossConnect().get(0),
+        false));
+    assert encoderPortPairs.size() == 8;
+    return encoderPortPairs;
+  }
+
+  /**
+   * Constructs a new set of objects representing a single-pole IIR filter with a noisy data source.
+   *
+   * @return a single-pole IIR filter with a noisy data source
+   */
+  public FilterNoiseFixture<LinearDigitalFilter> getSinglePoleIIRNoiseFixture() {
+    return new FilterNoiseFixture<LinearDigitalFilter>() {
+      @Override
+      protected LinearDigitalFilter giveFilter(PIDSource source) {
+        return LinearDigitalFilter.singlePoleIIR(source,
+            kSinglePoleIIRTimeConstant,
+            kFilterStep);
+      }
+    };
+  }
+
+  /**
+   * Constructs a new set of objects representing a moving average filter with a noisy data source
+   * using a linear digital filter.
+   *
+   * @return a moving average filter with a noisy data source
+   */
+  public FilterNoiseFixture<LinearDigitalFilter> getMovAvgNoiseFixture() {
+    return new FilterNoiseFixture<LinearDigitalFilter>() {
+      @Override
+      protected LinearDigitalFilter giveFilter(PIDSource source) {
+        return LinearDigitalFilter.movingAverage(source, kMovAvgTaps);
+      }
+    };
+  }
+
+  /**
+   * Constructs a new set of objects representing a single-pole IIR filter with a repeatable data
+   * source.
+   *
+   * @return a single-pole IIR filter with a repeatable data source
+   */
+  public FilterOutputFixture<LinearDigitalFilter> getSinglePoleIIROutputFixture() {
+    return new FilterOutputFixture<LinearDigitalFilter>(kSinglePoleIIRExpectedOutput) {
+      @Override
+      protected LinearDigitalFilter giveFilter() {
+        m_data = new DataWrapper(getData);
+        return LinearDigitalFilter.singlePoleIIR(m_data,
+            kSinglePoleIIRTimeConstant,
+            kFilterStep);
+      }
+    };
+  }
+
+  /**
+   * Constructs a new set of objects representing a high-pass filter with a repeatable data source.
+   *
+   * @return a high-pass filter with a repeatable data source
+   */
+  public FilterOutputFixture<LinearDigitalFilter> getHighPassOutputFixture() {
+    return new FilterOutputFixture<LinearDigitalFilter>(kHighPassExpectedOutput) {
+      @Override
+      protected LinearDigitalFilter giveFilter() {
+        m_data = new DataWrapper(getData);
+        return LinearDigitalFilter.highPass(m_data, kHighPassTimeConstant,
+            kFilterStep);
+      }
+    };
+  }
+
+  /**
+   * Constructs a new set of objects representing a moving average filter with a repeatable data
+   * source using a linear digital filter.
+   *
+   * @return a moving average filter with a repeatable data source
+   */
+  public FilterOutputFixture<LinearDigitalFilter> getMovAvgOutputFixture() {
+    return new FilterOutputFixture<LinearDigitalFilter>(kMovAvgExpectedOutput) {
+      @Override
+      protected LinearDigitalFilter giveFilter() {
+        m_data = new DataWrapper(getData);
+        return LinearDigitalFilter.movingAverage(m_data, kMovAvgTaps);
+      }
+    };
+  }
+
+  /**
+   * Constructs a new set of objects representing a moving average filter with a repeatable data
+   * source using a linear digital filter.
+   *
+   * @return a moving average filter with a repeatable data source
+   */
+  public FilterOutputFixture<LinearDigitalFilter> getPulseFixture() {
+    return new FilterOutputFixture<LinearDigitalFilter>(0.0) {
+      @Override
+      protected LinearDigitalFilter giveFilter() {
+        m_data = new DataWrapper(getPulseData);
+        return LinearDigitalFilter.movingAverage(m_data, kMovAvgTaps);
+      }
+    };
+  }
+
+  /**
+   * Gets the singleton of the TestBench. If the TestBench is not already allocated in constructs an
+   * new instance of it. Otherwise it returns the existing instance.
+   *
+   * @return The Singleton instance of the TestBench
+   */
+  public static TestBench getInstance() {
+    if (instance == null) {
+      instance = new TestBench();
+    }
+    return instance;
+  }
+
+  /**
+   * Provides access to the output stream for the test system. This should be used instead of
+   * System.out This is gives us a way to implement changes to where the output text of this test
+   * system is sent.
+   *
+   * @return The test bench global print stream.
+   */
+  public static PrintStream out() {
+    return System.out;
+  }
+
+  /**
+   * Provides access to the error stream for the test system. This should be used instead of
+   * System.err This is gives us a way to implement changes to where the output text of this test
+   * system is sent.
+   *
+   * @return The test bench global print stream.
+   */
+  public static PrintStream err() {
+    return System.err;
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestSuite.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestSuite.java
new file mode 100644
index 0000000..72f6703
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/TestSuite.java
@@ -0,0 +1,381 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.test;
+
+import junit.framework.JUnit4TestAdapter;
+import junit.runner.Version;
+
+import org.junit.runner.JUnitCore;
+import org.junit.runner.Result;
+import org.junit.runner.RunWith;
+import org.junit.runner.notification.Failure;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+import java.util.logging.LogManager;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
+import edu.wpi.first.wpilibj.WpiLibJTestSuite;
+import edu.wpi.first.wpilibj.command.CommandTestSuite;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboardTestSuite;
+
+/**
+ * The WPILibJ Integeration Test Suite collects all of the tests to be run by junit. In order for a
+ * test to be run, it must be added the list of suite classes below. The tests will be run in the
+ * order they are listed in the suite classes annotation.
+ */
+@RunWith(Suite.class)
+// These are listed on separate lines to prevent merge conflicts
+@SuiteClasses({WpiLibJTestSuite.class, CommandTestSuite.class, SmartDashboardTestSuite.class})
+public class TestSuite extends AbstractTestSuite {
+  static {
+    // Sets up the logging output
+    final InputStream inputStream = TestSuite.class.getResourceAsStream("/logging.properties");
+    try {
+      Objects.requireNonNull(inputStream, "./logging.properties was not loaded");
+      LogManager.getLogManager().readConfiguration(inputStream);
+      Logger.getAnonymousLogger().info("Loaded");
+    } catch (final IOException | NullPointerException ex) {
+      Logger.getAnonymousLogger().severe("Could not load default logging.properties file");
+      Logger.getAnonymousLogger().severe(ex.getMessage());
+    }
+
+    TestBench.out().println("Starting Tests");
+  }
+
+  private static final Logger WPILIBJ_ROOT_LOGGER = Logger.getLogger("edu.wpi.first.wpilibj");
+  private static final Logger WPILIBJ_COMMAND_ROOT_LOGGER = Logger
+      .getLogger("edu.wpi.first.wpilibj.command");
+
+
+  private static final Class<?> QUICK_TEST = QuickTest.class;
+  private static final String QUICK_TEST_FLAG = "--quick";
+  private static final String HELP_FLAG = "--help";
+  private static final String METHOD_NAME_FILTER = "--methodFilter=";
+  private static final String METHOD_REPEAT_FILTER = "--repeat=";
+  private static final String CLASS_NAME_FILTER = "--filter=";
+
+  private static TestSuite instance = null;
+
+  /**
+   * Get the singleton instance of the test suite.
+   */
+  public static TestSuite getInstance() {
+    if (instance == null) {
+      instance = new TestSuite();
+    }
+    return instance;
+  }
+
+  /**
+   * This has to be public so that the JUnit4.
+   */
+  public TestSuite() {
+  }
+
+  /**
+   * Displays a help message for the user when they use the --help flag at runtime.
+   */
+  protected static void displayHelp() {
+    StringBuilder helpMessage = new StringBuilder("Test Parameters help: \n");
+    helpMessage.append("\t" + QUICK_TEST_FLAG
+        + " will cause the quick test to be run. Ignores other flags except for "
+        + METHOD_REPEAT_FILTER + "\n");
+    helpMessage.append("\t" + CLASS_NAME_FILTER
+        + " will use the supplied regex text to search for suite/test class names "
+        + "matching the regex and run them.\n");
+    helpMessage.append("\t" + METHOD_NAME_FILTER
+        + " will use the supplied regex text to search for test methods (excluding methods "
+        + "with the @Ignore annotation) and run only those methods. Can be paired with "
+        + METHOD_REPEAT_FILTER + " to " + "repeat the selected tests multiple times.\n");
+    helpMessage.append("\t" + METHOD_REPEAT_FILTER + " will repeat the tests selected with either "
+        + QUICK_TEST_FLAG + " or " + CLASS_NAME_FILTER
+        + " and run them the given number of times.\n");
+    helpMessage
+        .append("[NOTE] All regex uses the syntax defined by java.util.regex.Pattern. This "
+            + "documentation can be found at "
+            + "http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html\n");
+    helpMessage.append("\n");
+    helpMessage.append("\n");
+
+    TestBench.out().println(helpMessage);
+  }
+
+  /**
+   * Lets the user know that they used the TestSuite improperly and gives details about how to use
+   * it correctly in the future.
+   */
+  protected static void displayInvalidUsage(String message, String... args) {
+    StringBuilder invalidMessage = new StringBuilder("Invalid Usage: " + message + "\n");
+    invalidMessage.append("Params received: ");
+    for (String a : args) {
+      invalidMessage.append(a + " ");
+    }
+    invalidMessage.append("\n");
+    invalidMessage
+        .append("For details on proper usage of the runtime flags please run again with the "
+            + HELP_FLAG + " flag.\n\n");
+
+    TestBench.out().println(invalidMessage);
+
+  }
+
+  /**
+   * Prints the loaded tests before they are run.
+   *
+   * @param classes the classes that were loaded.
+   */
+  protected static void printLoadedTests(final Class<?>... classes) {
+    StringBuilder loadedTestsMessage = new StringBuilder("The following tests were loaded:\n");
+    Package packagE = null;
+    for (Class<?> c : classes) {
+      if (c.getPackage().equals(packagE)) {
+        packagE = c.getPackage();
+        loadedTestsMessage.append(packagE.getName() + "\n");
+      }
+      loadedTestsMessage.append("\t" + c.getSimpleName() + "\n");
+    }
+    TestBench.out().println(loadedTestsMessage);
+  }
+
+
+  /**
+   * Parses the arguments passed at runtime and runs the appropriate tests based upon these
+   * arguments.
+   *
+   * @param args the args passed into the program at runtime
+   * @return the restults of the tests that have run. If no tests were run then null is returned.
+   */
+  protected static Result parseArgsRunAndGetResult(final String[] args) {
+    if (args.length == 0) { // If there are no args passed at runtime then just
+      // run all of the tests.
+      printLoadedTests(TestSuite.class);
+      return JUnitCore.runClasses(TestSuite.class);
+    }
+
+    // The method filter was passed
+    boolean methodFilter = false;
+    String methodRegex = "";
+    // The class filter was passed
+    boolean classFilter = false;
+    String classRegex = "";
+    int repeatCount = 1;
+
+    for (String s : args) {
+      if (Pattern.matches(METHOD_NAME_FILTER + ".*", s)) {
+        methodFilter = true;
+        methodRegex = new String(s).replace(METHOD_NAME_FILTER, "");
+      }
+      if (Pattern.matches(METHOD_REPEAT_FILTER + ".*", s)) {
+        try {
+          repeatCount = Integer.parseInt(new String(s).replace(METHOD_REPEAT_FILTER, ""));
+        } catch (NumberFormatException ex) {
+          displayInvalidUsage("The argument passed to the repeat rule was not a valid integer.",
+              args);
+        }
+      }
+      if (Pattern.matches(CLASS_NAME_FILTER + ".*", s)) {
+        classFilter = true;
+        classRegex = s.replace(CLASS_NAME_FILTER, "");
+      }
+    }
+
+
+    ArrayList<String> argsParsed = new ArrayList<String>(Arrays.asList(args));
+    if (argsParsed.contains(HELP_FLAG)) {
+      // If the user inputs the help flag then return the help message and exit
+      // without running any tests
+      displayHelp();
+      return null;
+    }
+    if (argsParsed.contains(QUICK_TEST_FLAG)) {
+      printLoadedTests(QUICK_TEST);
+      return JUnitCore.runClasses(QUICK_TEST);
+    }
+
+    /**
+     * Stores the data from multiple {@link Result}s in one class that can be
+     * returned to display the results.
+     */
+    class MultipleResult extends Result {
+      private static final long serialVersionUID = 1L;
+      private final List<Failure> m_failures = new ArrayList<>();
+      private int m_runCount = 0;
+      private int m_ignoreCount = 0;
+      private long m_runTime = 0;
+
+      @Override
+      public int getRunCount() {
+        return m_runCount;
+      }
+
+      @Override
+      public int getFailureCount() {
+        return m_failures.size();
+      }
+
+      @Override
+      public long getRunTime() {
+        return m_runTime;
+      }
+
+      @Override
+      public List<Failure> getFailures() {
+        return m_failures;
+      }
+
+      @Override
+      public int getIgnoreCount() {
+        return m_ignoreCount;
+      }
+
+      /**
+       * Adds the given result's data to this result.
+       *
+       * @param result the result to add to this result
+       */
+      void addResult(Result result) {
+        m_failures.addAll(result.getFailures());
+        m_runCount += result.getRunCount();
+        m_ignoreCount += result.getIgnoreCount();
+        m_runTime += result.getRunTime();
+      }
+    }
+
+    // If a specific method has been requested
+    if (methodFilter) {
+      List<ClassMethodPair> pairs = (new TestSuite()).getMethodMatching(methodRegex);
+      if (pairs.size() == 0) {
+        displayInvalidUsage("None of the arguments passed to the method name filter matched.",
+            args);
+        return null;
+      }
+      // Print out the list of tests before we run them
+      TestBench.out().println("Running the following tests:");
+      Class<?> classListing = null;
+      for (ClassMethodPair p : pairs) {
+        if (!p.m_methodClass.equals(classListing)) {
+          // Only display the class name every time it changes
+          classListing = p.m_methodClass;
+          TestBench.out().println(classListing);
+        }
+        TestBench.out().println("\t" + p.m_methodName);
+      }
+
+
+      // The test results will be saved here
+      MultipleResult results = new MultipleResult();
+      // Runs tests multiple times if the repeat rule is used
+      for (int i = 0; i < repeatCount; i++) {
+        // Now run all of the tests
+        for (ClassMethodPair p : pairs) {
+          Result result = (new JUnitCore()).run(p.getMethodRunRequest());
+          // Store the given results in one cohesive result
+          results.addResult(result);
+        }
+      }
+
+      return results;
+    }
+
+    // If a specific class has been requested
+    if (classFilter) {
+      List<Class<?>> testClasses = (new TestSuite()).getSuiteOrTestMatchingRegex(classRegex);
+      if (testClasses.size() == 0) {
+        displayInvalidUsage("None of the arguments passed to the filter matched.", args);
+        return null;
+      }
+      printLoadedTests(testClasses.toArray(new Class[0]));
+      MultipleResult results = new MultipleResult();
+      // Runs tests multiple times if the repeat rule is used
+      for (int i = 0; i < repeatCount; i++) {
+        Result result = (new JUnitCore()).run(testClasses.toArray(new Class[0]));
+        // Store the given results in one cohesive result
+        results.addResult(result);
+      }
+      return results;
+    }
+    displayInvalidUsage(
+        "None of the parameters that you passed matched any of the accepted flags.", args);
+
+    return null;
+  }
+
+  protected static void displayResults(Result result) {
+    // Results are collected and displayed here
+    TestBench.out().println("\n");
+    if (!result.wasSuccessful()) {
+      // Prints out a list of stack traces for the failed tests
+      TestBench.out().println("Failure List: ");
+      for (Failure f : result.getFailures()) {
+        TestBench.out().println(f.getDescription());
+        TestBench.out().println(f.getTrace());
+      }
+      TestBench.out().println();
+      TestBench.out().println("FAILURES!!!");
+      // Print the test statistics
+      TestBench.out().println(
+          "Tests run: " + result.getRunCount() + ", Failures: " + result.getFailureCount()
+              + ", Ignored: " + result.getIgnoreCount() + ", In " + result.getRunTime() + "ms");
+
+      // Prints out a list of test that failed
+      TestBench.out().println("Failure List (short):");
+      String failureClass = result.getFailures().get(0).getDescription().getClassName();
+      TestBench.out().println(failureClass);
+      for (Failure f : result.getFailures()) {
+        if (!failureClass.equals(f.getDescription().getClassName())) {
+          failureClass = f.getDescription().getClassName();
+          TestBench.out().println(failureClass);
+        }
+        TestBench.err().println("\t" + f.getDescription());
+      }
+    } else {
+      TestBench.out().println("SUCCESS!");
+      TestBench.out().println(
+          "Tests run: " + result.getRunCount() + ", Ignored: " + result.getIgnoreCount() + ", In "
+              + result.getRunTime() + "ms");
+    }
+    TestBench.out().println();
+  }
+
+  /**
+   * This is used by ant to get the Junit tests. This is required because the tests try to load
+   * using a JUnit 3 framework. JUnit4 uses annotations to load tests. This method allows JUnit3 to
+   * load JUnit4 tests.
+   */
+  public static junit.framework.Test suite() {
+    return new JUnit4TestAdapter(TestSuite.class);
+  }
+
+
+  /**
+   * The method called at runtime.
+   *
+   * @param args The test suites to run
+   */
+  public static void main(String[] args) {
+    TestBench.out().println("JUnit version " + Version.id());
+
+    // Tests are run here
+    Result result = parseArgsRunAndGetResult(args);
+    if (result != null) {
+      // Results are collected and displayed here
+      displayResults(result);
+
+      System.exit(result.wasSuccessful() ? 0 : 1);
+    }
+    System.exit(1);
+  }
+}
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/package-info.java b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/package-info.java
new file mode 100644
index 0000000..481cb08
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/java/edu/wpi/first/wpilibj/test/package-info.java
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+/**
+ * This is the starting point for the integration testing framework. This package should contain
+ * classes that are not explicitly for testing the library but instead provide the framework that
+ * the tests can extend from. Every test should extend from
+ * {@link edu.wpi.first.wpilibj.test.AbstractComsSetup}
+ * to ensure that Network Communications is properly instantiated before the test is run. The
+ * {@link edu.wpi.first.wpilibj.test.TestBench} should contain the port numbers for all of the
+ * hardware and these values should not be explicitly defined anywhere else in the testing
+ * framework.
+ */
+package edu.wpi.first.wpilibj.test;
diff --git a/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/resources/logging.properties b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/resources/logging.properties
new file mode 100644
index 0000000..b15c534
--- /dev/null
+++ b/third_party/allwpilib_2018/wpilibjIntegrationTests/src/main/resources/logging.properties
@@ -0,0 +1,25 @@
+# "handlers" specifies a comma separated list of log Handler
+# classes.  These handlers will be installed during VM startup.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+handlers=java.util.logging.ConsoleHandler
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+#.level= INFO
+.level=INFO
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+java.util.logging.ConsoleHandler.level=FINER
+java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+edu.wpi.first.wpilibj.level=INFO
+edu.wpi.first.wpilibj.command.level=INFO
diff --git a/third_party/ntcore_2018/.clang-format b/third_party/ntcore_2018/.clang-format
new file mode 100644
index 0000000..92b4049
--- /dev/null
+++ b/third_party/ntcore_2018/.clang-format
@@ -0,0 +1,107 @@
+---
+Language:        Cpp
+BasedOnStyle:  Google
+AccessModifierOffset: -1
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IncludeCategories:
+  - Regex:           '^<.*\.h>'
+    Priority:        1
+  - Regex:           '^<.*'
+    Priority:        2
+  - Regex:           '.*'
+    Priority:        3
+IncludeIsMainRegex: '([-_](test|unittest))?$'
+IndentCaseLabels: true
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments:  true
+SortIncludes:    false
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 2
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Auto
+TabWidth:        8
+UseTab:          Never
+...
diff --git a/third_party/ntcore_2018/.gitattributes b/third_party/ntcore_2018/.gitattributes
new file mode 100644
index 0000000..55f724df
--- /dev/null
+++ b/third_party/ntcore_2018/.gitattributes
@@ -0,0 +1 @@
+gradlew.bat eol=crlf
diff --git a/third_party/ntcore_2018/.gitignore b/third_party/ntcore_2018/.gitignore
new file mode 100644
index 0000000..8fd1dc7
--- /dev/null
+++ b/third_party/ntcore_2018/.gitignore
@@ -0,0 +1,223 @@
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+.vs/
+*.def
+!ntcore.def
+!ntcore-jni.def
+*.opensdf
+*.vcxproj
+*.vcxproj.user
+*.sdf
+*.sublime-project
+*.sublime-workspace
+
+# Compiled Java files
+*.class
+
+# Build directories
+/.gradle
+/build/
+!build.gradle
+/native
+/arm
+/gmock/build
+
+
+# Created by https://www.gitignore.io/api/intellij,eclipse,netbeans,java,gradle,c++,cmake
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff:
+.idea/*
+
+## File-based project format:
+*.iws
+
+## Plugin-specific files:
+
+# IntelliJ
+/out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+### Intellij Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+
+
+### Eclipse ###
+
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+# Eclipse Core
+.project
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# JDT-specific (Eclipse Java Development Tools)
+.classpath
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+
+### NetBeans ###
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+nbactions.xml
+.nb-gradle/
+
+
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
+### CMake ###
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Makefile
+cmake_install.cmake
+install_manifest.txt
+
+
+### Java ###
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+
+### Gradle ###
+.gradle
+build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+# Cache of project
+.gradletasknamecache
+
+# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
+# gradle/wrapper/gradle-wrapper.properties
+
+#VSCode
+.vscode/
diff --git a/third_party/ntcore_2018/.styleguide b/third_party/ntcore_2018/.styleguide
new file mode 100644
index 0000000..9f55f35
--- /dev/null
+++ b/third_party/ntcore_2018/.styleguide
@@ -0,0 +1,26 @@
+cppHeaderFileInclude {
+  \.h$
+  \.inc$
+}
+
+cppSrcFileInclude {
+  \.cpp$
+}
+
+generatedFileExclude {
+  gmock/
+  llvm/
+  src/arm-linux-jni/
+  src/main/native/cpp/jni/
+}
+
+includeGuardRoots {
+  src/main/native/cpp/
+  src/main/native/include/
+  src/test/native/cpp/
+}
+
+includeOtherLibs {
+  ^llvm/
+  ^support/
+}
diff --git a/third_party/ntcore_2018/.styleguide-license b/third_party/ntcore_2018/.styleguide-license
new file mode 100644
index 0000000..0bb7710
--- /dev/null
+++ b/third_party/ntcore_2018/.styleguide-license
@@ -0,0 +1,6 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST {year}. All Rights Reserved.{padding}*/
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
diff --git a/third_party/ntcore_2018/.travis-scripts/install.sh b/third_party/ntcore_2018/.travis-scripts/install.sh
new file mode 100755
index 0000000..ff02ce4
--- /dev/null
+++ b/third_party/ntcore_2018/.travis-scripts/install.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
+    # Install custom requirements on Linux
+    sudo sh -c 'echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /etc/apt/sources.list.d/llvm.list'
+    wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
+    sudo add-apt-repository ppa:wpilib/toolchain -y
+    sudo apt-get update -q
+    sudo apt-get install frc-toolchain -y
+
+    wget https://bootstrap.pypa.io/get-pip.py
+    sudo python3.5 get-pip.py
+    python3.5 -m pip install --user wpiformat
+else
+    brew update
+    brew install python3 clang-format
+
+    pip3 install --user wpiformat
+fi
diff --git a/third_party/ntcore_2018/.travis-scripts/wpiformat.sh b/third_party/ntcore_2018/.travis-scripts/wpiformat.sh
new file mode 100755
index 0000000..84aee9c
--- /dev/null
+++ b/third_party/ntcore_2018/.travis-scripts/wpiformat.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
+    python3.5 -m wpiformat -y 2018 -clang 5.0
+else
+    python3 -m wpiformat -y 2018
+fi
+
+git --no-pager diff --exit-code HEAD  # Ensure formatter made no changes
diff --git a/third_party/ntcore_2018/.travis.yml b/third_party/ntcore_2018/.travis.yml
new file mode 100644
index 0000000..f84b50c
--- /dev/null
+++ b/third_party/ntcore_2018/.travis.yml
@@ -0,0 +1,36 @@
+sudo: true
+language: java
+
+matrix:
+  include:
+    - os: linux
+      dist: trusty
+      sudo: required
+    - os: osx
+      osx_image: xcode8
+
+addons:
+  apt:
+    sources:
+      - deadsnakes
+    packages:
+      - g++-multilib
+      - lib32stdc++6
+      - python3.5
+
+before_install:
+  - .travis-scripts/install.sh
+
+install:
+  - ./gradlew build -PbuildAll
+
+script:
+  - .travis-scripts/wpiformat.sh
+  - ./gradlew build -PbuildAll
+
+before_cache:
+  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+cache:
+  directories:
+    - $HOME/.gradle/caches/
+    - $HOME/.gradle/wrapper/
diff --git a/third_party/ntcore_2018/CONTRIBUTING.md b/third_party/ntcore_2018/CONTRIBUTING.md
new file mode 100644
index 0000000..12aff9e
--- /dev/null
+++ b/third_party/ntcore_2018/CONTRIBUTING.md
@@ -0,0 +1,53 @@
+# Contributing to ntcore
+
+So you want to contribute your changes back to ntcore. Great! We have a few contributing rules that will help you make sure your changes will be accepted into the project. Please remember to follow the rules written here, and behave with Gracious Professionalism.
+
+- [General Contribution Rules](#general-contribution-rules)
+- [What to Contribute](#what-to-contribute)
+- [Coding Guidelines](#coding-guidelines)
+- [Submitting Changes](#submitting-changes)
+    - [Pull Request Format](#pull-request-format)
+    - [Merge Process](#merge-process)
+- [Licensing](#licensing)
+
+## General Contribution Rules
+
+- Everything in the library must work for the 3000+ teams that will be using it.
+- We need to be able to maintain submitted changes, even if you are no longer working on the project.
+- Excluding bug fixes, changes in one language generally need to have corresponding changes in other languages.
+    - Substantial changes often need to have corresponding LabVIEW changes. To do this, we will work with NI on these large changes.
+    - Protocol changes must be carefully considered. Please open issues for protocol enhancements so we can discuss first.
+- Changes should have tests.
+- Code should be well documented.
+    - This often involves ScreenSteps. To add content to ScreenSteps, we will work with you to get the appropriate articles written.
+
+## What to Contribute
+
+- Bug reports and fixes
+    - We will generally accept bug fixes without too much question. If they are only implemented for one language, we will implement them for any other necessary languages. Bug reports are also welcome, please submit them to our GitHub issue tracker.
+- While we do welcome improvements to the API, there are a few important rules to consider:
+    - Features must be added to both the C++ API and the Java API, with rare exceptions.
+    - During competition season, we will not merge any new feature additions. We want to ensure that the API is stable during the season to help minimize issues for teams.
+    - Ask about large changes before spending a bunch of time on them! You can create a new issue on our GitHub tracker for feature request/discussion and talk about it with us there.
+    - Features that make it easier for teams with less experience to be more successful are more likely to be accepted.
+    - Features in ntcore should be broadly applicable to all teams. Anything that is team specific should not be submitted.
+
+## Coding Guidelines
+
+ntcore uses Google style guides for both C++ and Java. Autoformatters are available for many popular editors at [https://github.com/google/styleguide]. An online version of the styleguide for [C++](https://google.github.io/styleguide/cppguide.html) and [Java](https://google.github.io/styleguide/javaguide.html) are also available.  Additionally, offline copies of the style guide can be found in the style guide directory of the repository.
+
+While the library should be fully formatted according to the styles, additional elements of the style guide were not followed when the library was initially created. All new code should follow the guidelines. If you are looking for some easy ramp-up tasks, finding areas that don't follow the style guide and fixing them is very welcome.
+
+## Submitting Changes
+
+### Pull Request Format
+
+Changes should be submitted as a Pull Request against the master branch of ntcore. For most changes, we ask that you squash your changes down to a single commit. For particularly large changes, multiple commits are ok, but assume one commit unless asked otherwise. No change will be merged unless it is up to date with the current master. We will also not merge any changes with merge commits in them; please rebase off of master before submitting a pull request. We do this to make sure that the git history isn't too cluttered.
+
+### Merge Process
+
+When you first submit changes, Travis-CI will attempt to run `./gradlew check` on your change. If this fails, you will need to fix any issues that it sees. Once Travis passes, we will begin the review process in more earnest. One or more WPILib team members will review your change. This will be a back-and-forth process with the WPILib team and the greater community. Once we are satisfied that your change is ready, we will allow our Jenkins instance to test it. This will run the full gamut of checks, including integration tests on actual hardware. Once all tests have passed and the team is satisfied, we will merge your change into the WPILib repository.
+
+## Licensing
+
+By contributing to ntcore, you agree that your code will be distributed with ntcore, and licensed under the license for the ntcore project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as ntcore is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](license.txt).
diff --git a/third_party/ntcore_2018/README.md b/third_party/ntcore_2018/README.md
new file mode 100644
index 0000000..0f45826
--- /dev/null
+++ b/third_party/ntcore_2018/README.md
@@ -0,0 +1,78 @@
+# ntcore
+
+[![Travis CI Build Status](https://travis-ci.org/wpilibsuite/ntcore.svg?branch=master)](https://travis-ci.org/wpilibsuite/ntcore)
+[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/j6k1apuix04m41ch?svg=true)](https://ci.appveyor.com/project/frcjenkins/ntcore)
+
+
+ntcore is the reimplementation of the NetworkTables protocol for both Java and C++, communicating with the former by way of a JNI interface. ntcore implements v3 of the NetworkTables spec.
+
+## Build Requirements
+To build ntcore, a few requirements must be met:
+
+- Platform Native Toolchain - You must have a toolchain for your native platform installed if you wish to build ntcore for your machine. On Windows, this is Visual Studio. On Mac, this is Clang, and on Linux, this is GCC. Your toolchain must support the `-std=c++11` language flag.
+- Platform Native JDK - In order to compile ntcore your native platform, you must have the JDK for your platform installed, so that the correct JNI headers can be included.
+- ARM Toolchain - To crosscompile ntcore for the roboRIO, you must have the FRC ARM toolchain installed, which can be found [here](http://first.wpi.edu/FRC/roborio/toolchains/).
+- Cross Toolchains (coming soon)
+
+## Building
+Gradle is the main build system used by ntcore. All tasks are run with the `gradlew` wrapper, which is included in the root of the repository. All targets that can be accomplished by Gradle are referred to as tasks. The main task available is `build`. To run Gradle, cd into the build directory and run:
+
+```bash
+./gradlew build
+```
+
+This will build the roboRIO ntcore library, in addition to the library for your native platform. Note if the roboRIO compiler cannot be found, the build will skip the roboRIO build. To build for either only the roboRIO, or every platform except the roboRIO, use the following flags:
+
+```bash
+-PskipAthena
+-PonlyAthena
+```
+
+Note if you choose the `onlyAthena` flag, tests will not be ran, as they depend on the current platform being built.
+
+In addition, more platforms can be built. For instance, with additional cross compilers more Arm binaries can be built. In addition, the second bitness for your current platform can be built with an additional flag. To enable every possible platform, use the following flag.
+
+```bash
+-PbuildAll
+```
+
+If you are building the native version on a 64 bit Linux computer, use a GCC installation which has multilib support enabled (it can compile both 32 and 64 bit programs). The package providing that support on most Linux distributions is called `gcc-multilib`.
+
+By default, debug binaries of the libraries will be built. To switch to instead build release binaries, use the following flag
+
+```bash
+-PreleaseBuild
+```
+
+### Custom Cross Compilers
+Coming soon
+
+## Testing
+By default, tests will be built for any native platform, and will be run during any execution of the `build` or `publish` tasks. To skip building and running the tests, use the `-PskipAllTests` command line flag.
+
+## Publishing
+to use ntcore in downstream projects as a Maven-style dependency, use the `publish` command. This will publish the following artifact id's:
+
+- edu.wpi.first.ntcore:ntcore-cpp
+- edu.wpi.first.ntcore:ntcore-java
+
+The `ntcore-cpp` artifact will contain the following 2 classifiers:
+
+- `headers` (contains C++ headers)
+- `sources` (contains C++ sources)
+
+In addition, a classifier will be created for each binary built by the current build. The internal layout of the artifacts will be as follows.
+
+- `/os/arch/shared/` (shared binaries located here)
+- `/os/arch/static/` (static binaries located here)
+
+The `ntcore-java` artifact will contain a jar with no classifiers. This is the java jar file. In addition, the following 2 classifiers will be contained
+
+- `sources` (contains Java sources)
+- `javadoc` (contains Javadoc sources)
+
+All of these artifacts by default are published to `~/releases/maven/development`. To switch to the release repository (`~/release/maven/release`), use the flag `-PreleaseType=OFFICIAL`.
+
+All downstream projects are configured to use the individual classifier artifacts. The previouse `desktop` classifier does not exist anymore.
+
+When you do a publish of ntcore locally, the locally built copy will override all references to networktables dependencies from the FRC Maven server. To undo this, you must delete `~/releases/maven/<repo>/edu/wpi/first/ntcore`.
diff --git a/third_party/ntcore_2018/TODO.md b/third_party/ntcore_2018/TODO.md
new file mode 100644
index 0000000..864c5af
--- /dev/null
+++ b/third_party/ntcore_2018/TODO.md
@@ -0,0 +1,21 @@
+# ntcore TODO
+
+## Functionality
+
+* Initial connection flag
+
+## Unit Test Coverage
+
+* Message class
+* SequenceNumber class
+* NetworkCommunication class
+* Dispatcher class
+* Storage incoming processing
+* Keepalives
+* Notifiers
+* RPC
+* C++ API
+* C API
+* SavePersistent safe file handling (part of C++ API)
+* More LoadPersistent warning cases
+* Automatic persistent saves
diff --git a/third_party/ntcore_2018/appveyor.yml b/third_party/ntcore_2018/appveyor.yml
new file mode 100644
index 0000000..3992be1
--- /dev/null
+++ b/third_party/ntcore_2018/appveyor.yml
@@ -0,0 +1,30 @@
+version: "{branch} {build}"

+

+image:

+- Visual Studio 2015

+

+build:

+  verbosity: detailed

+

+build_script:

+  - gradlew.bat tasks

+

+test_script:

+- cmd: >-

+    SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0

+

+    gradlew.bat clean

+

+    gradlew.bat check --info

+

+    SET JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0

+

+    gradlew.bat clean

+

+    gradlew.bat check --info

+

+cache:

+  - C:\Users\appveyor\.gradle

+

+matrix:

+  fast_finish: true

diff --git a/third_party/ntcore_2018/build.gradle b/third_party/ntcore_2018/build.gradle
new file mode 100644
index 0000000..7c8e441
--- /dev/null
+++ b/third_party/ntcore_2018/build.gradle
@@ -0,0 +1,250 @@
+import edu.wpi.first.nativeutils.NativeUtils
+import org.gradle.api.file.FileCollection
+import org.gradle.internal.os.OperatingSystem
+import edu.wpi.first.nativeutils.tasks.JNIHeaders
+
+buildscript {
+    repositories {
+        mavenLocal()
+        maven {
+            url "https://plugins.gradle.org/m2/"
+        }
+    }
+    dependencies {
+        classpath 'gradle.plugin.edu.wpi.first:native-utils:1.5.1'
+        classpath 'gradle.plugin.edu.wpi.first.wpilib.versioning:wpilib-version-plugin:2.0'
+    }
+}
+
+repositories {
+    mavenCentral()
+}
+
+ext.getClassifier = { binary->
+    return NativeUtils.getClassifier(binary)
+}
+
+ext.getPlatformPath = { binary->
+    return NativeUtils.getPlatformPath(binary)
+}
+
+ext.getJNIHeadersClass = {
+    return JNIHeaders
+}
+
+apply plugin: 'cpp'
+apply plugin: 'google-test'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'java'
+
+apply from: 'config.gradle'
+
+if (project.hasProperty('onlyAthena')) {
+    test.enabled = false
+}
+
+sourceSets {
+    dev
+}
+
+task nativeTestFilesJar(type: Jar) {
+    destinationDir = project.buildDir
+    classifier = "nativeTestFiles"
+
+    project.model {
+        binaries {
+            withType(SharedLibraryBinarySpec) { binary ->
+                if (binary.component.name == 'ntcoreJNI') {
+                    from(binary.sharedLibraryFile) {
+                        into NativeUtils.getPlatformPath(binary)
+                    }
+                    dependsOn binary.buildTask
+                }
+            }
+        }
+    }
+}
+
+task run(type: JavaExec) {
+    classpath = sourceSets.dev.runtimeClasspath
+
+    main = 'edu.wpi.first.ntcore.DevMain'
+}
+
+test.dependsOn nativeTestFilesJar
+run.dependsOn nativeTestFilesJar
+build.dependsOn devClasses
+
+
+dependencies {
+    compile 'edu.wpi.first.wpiutil:wpiutil-java:3.+'
+    testCompile 'junit:junit:4.12'
+    testRuntime files(project(':').nativeTestFilesJar.archivePath)
+    devCompile 'edu.wpi.first.wpiutil:wpiutil-java:3.+'
+    devCompile sourceSets.main.output
+    devRuntime files(project(':').nativeTestFilesJar.archivePath)
+}
+
+
+model {
+    jniConfigs {
+        ntcore(JNIConfig) {
+            jniDefinitionClasses = [ "edu.wpi.first.networktables.NetworkTablesJNI" ]
+            jniArmHeaderLocations = [ all: file("${rootDir}/src/arm-linux-jni") ]
+            sourceSets = [ project.sourceSets.main ]
+        }
+        ntcoreJNI(JNIConfig) {
+            jniDefinitionClasses = [ "edu.wpi.first.networktables.NetworkTablesJNI" ]
+            jniArmHeaderLocations = [ all: file("${rootDir}/src/arm-linux-jni") ]
+            sourceSets = [ project.sourceSets.main ]
+        }
+    }
+    exportsConfigs {
+        ntcore(ExportsConfig) {
+            x86ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVbad_cast',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure' ]
+            x64ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVbad_cast',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure' ]
+        }
+        ntcoreJNI(ExportsConfig) {
+            x86SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('NT_') || symbol.startsWith('Java_') || symbol.startsWith('JNI_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+            x64SymbolFilter = { symbols->
+                def retList = []
+                symbols.each { symbol->
+                    if (symbol.startsWith('NT_') || symbol.startsWith('Java_') || symbol.startsWith('JNI_')) {
+                        retList << symbol
+                    }
+                }
+                return retList
+            }
+        }
+    }
+    dependencyConfigs {
+        wpiutil(DependencyConfig) {
+            groupId = 'edu.wpi.first.wpiutil'
+            artifactId = 'wpiutil-cpp'
+            headerClassifier = 'headers'
+            ext = 'zip'
+            version = '3.+'
+            sharedConfigs = [ ntcore: [],
+                              ntcoreDev: [],
+                              ntcoreTestingBaseTest: [] ]
+            staticConfigs = [ ntcoreJNI: [] ]
+        }
+    }
+    components {
+        ntcore(NativeLibrarySpec) {
+            sources {
+                cpp {
+                    source {
+                        srcDirs 'src/main/native/cpp'
+                        include '**/*.cpp'
+                    }
+                    exportedHeaders {
+                        srcDirs 'src/main/native/include'
+                    }
+                }
+            }
+        }
+        ntcoreJNI(NativeLibrarySpec) {
+            baseName = 'ntcore'
+            sources {
+                cpp {
+                    source {
+                        srcDirs 'src/main/native/cpp'
+                        include '**/*.cpp'
+                    }
+                    exportedHeaders {
+                        srcDirs 'src/main/native/include'
+                    }
+                }
+            }
+        }
+        if (!project.hasProperty('skipTestExe')) {
+            ntcoreDev(NativeExecutableSpec) {
+                sources {
+                    cpp {
+                        lib library: "ntcore"
+                        source {
+                            srcDirs 'src/dev/native/cpp'
+                            include '**/*.cpp'
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/dev/native/include'
+                        }
+                    }
+                }
+            }
+        }
+        ntcoreTestingBase(NativeLibrarySpec) { }
+    }
+    testSuites {
+        ntcoreTestingBaseTest {
+            sources {
+                cpp {
+                    source {
+                        srcDirs 'src/test/native/cpp'
+                        include '**/*.cpp'
+                    }
+                    exportedHeaders {
+                        srcDirs 'src/test/native/include', 'src/main/native/cpp'
+                    }
+                }
+            }
+        }
+    }
+    binaries {
+        withType(StaticLibraryBinarySpec) {
+            if (it.component.name == 'ntcoreJNI') {
+                it.buildable = false
+            }
+        }
+        withType(GoogleTestTestSuiteBinarySpec) {
+            if (it.component.testedComponent.name.contains('TestingBase') && !project.hasProperty('onlyAthena')) {
+                lib project: ':gmock', library: 'gmock', linkage: 'static'
+                lib library: 'ntcore', linkage: 'shared'
+            } else {
+                it.buildable = false
+            }
+        }
+    }
+    tasks {
+        def c = $.components
+        project.tasks.create('runCpp', Exec) {
+            def found = false
+            c.each {
+                if (it in NativeExecutableSpec && it.name == 'ntcoreDev') {
+                    it.binaries.each {
+                        if (!found) {
+                            def arch = it.targetPlatform.architecture.name
+                            if (arch == 'x86-64' || arch == 'x86') {
+                                dependsOn it.tasks.install
+                                commandLine it.tasks.install.runScript
+                                found = true
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+apply from: 'publish.gradle'
+
+task wrapper(type: Wrapper) {
+    gradleVersion = '4.1'
+}
diff --git a/third_party/ntcore_2018/config.gradle b/third_party/ntcore_2018/config.gradle
new file mode 100644
index 0000000..2325819
--- /dev/null
+++ b/third_party/ntcore_2018/config.gradle
@@ -0,0 +1,219 @@
+import edu.wpi.first.nativeutils.*
+import org.gradle.internal.os.OperatingSystem
+
+def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/Zi', '/FS', '/Zc:inline', '/MT']
+def windowsReleaseCompilerArgs = ['/O2']
+def windowsLinkerArgs = [ '/DEBUG:FULL' ]
+def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ]
+
+def linuxCompilerArgs = ['-std=c++11', '-Wformat=2', '-Wall', '-Wextra', '-Werror', '-pedantic', '-Wno-psabi', '-g',
+                         '-Wno-unused-parameter', '-fPIC', '-rdynamic', '-Wno-error=deprecated-declarations', '-pthread']
+def linuxLinkerArgs = ['-rdynamic', '-pthread']
+def linuxReleaseCompilerArgs = ['-Og']
+def linuxDebugCompilerArgs = ['-O0']
+def linux32BitArg = '-m32'
+
+def macCompilerArgs =  ['-std=c++11', '-Wall', '-Wextra', '-Werror', '-pedantic-errors', '-fPIC', '-g',
+                            '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-unused-private-field']
+def macReleaseCompilerArgs = ['-O2']
+def macDebugCompilerArgs = ['-O0']
+def mac32BitArg = '-m32'
+
+def buildAll = project.hasProperty('buildAll')
+
+def windows64PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isWin = OperatingSystem.current().isWindows()
+    if (buildAll) {
+        return isWin
+    } else {
+        return isWin && arch == 'amd64'
+    }
+}
+
+def windows32PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isWin = OperatingSystem.current().isWindows()
+    if (buildAll) {
+        return isWin
+    } else {
+        return isWin && arch == 'x86'
+    }
+}
+
+def linux32IntelPlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isLinux = OperatingSystem.current().isLinux()
+    def isIntel = (arch == 'amd64' || arch == 'i386')
+    if (buildAll) {
+        return isLinux && isIntel
+    } else {
+        return isLinux && arch == 'i386'
+    }
+}
+
+def linux64IntelPlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isLinux = OperatingSystem.current().isLinux()
+    def isIntel = (arch == 'amd64' || arch == 'i386')
+    if (buildAll) {
+        return isLinux && isIntel
+    } else {
+        return isLinux && arch == 'amd64'
+    }
+}
+
+def linuxArmPlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isIntel = (arch == 'amd64' || arch == 'i386')
+    return OperatingSystem.current().isLinux() && !isIntel
+}
+
+def mac64PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isMac = OperatingSystem.current().isMacOsX()
+    if (buildAll) {
+        return isMac
+    } else {
+        return isMac && arch == 'x86_64'
+    }
+}
+
+def mac32PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isMac = OperatingSystem.current().isMacOsX()
+    if (buildAll) {
+        return isMac
+    } else {
+        return isMac && arch == 'x86'
+    }
+}
+
+if (!project.hasProperty('skipAthena')) {
+    model {
+        buildConfigs {
+                roboRio(CrossBuildConfig) {
+                architecture = 'athena'
+                operatingSystem = 'linux'
+                toolChainPrefix = 'arm-frc-linux-gnueabi-'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                exclude << 'gmock'
+                exclude << 'wpiutilTestingBase'
+            }
+        }
+    }
+}
+
+if (!project.hasProperty('onlyAthena')) {
+    model {
+        buildConfigs {
+            winX86(BuildConfig) {
+                architecture = 'x86'
+                operatingSystem = 'windows'
+                compilerArgs = windowsCompilerArgs
+                linkerArgs = windowsLinkerArgs
+                releaseCompilerArgs = windowsReleaseCompilerArgs
+                releaseLinkerArgs = windowsReleaseLinkerArgs
+                compilerFamily = 'VisualCpp'
+                detectPlatform = windows32PlatformDetect
+            }
+            winX64(BuildConfig) {
+                architecture = 'x86-64'
+                operatingSystem = 'windows'
+                compilerArgs = windowsCompilerArgs
+                linkerArgs = windowsLinkerArgs
+                releaseCompilerArgs = windowsReleaseCompilerArgs
+                releaseLinkerArgs = windowsReleaseLinkerArgs
+                compilerFamily = 'VisualCpp'
+                detectPlatform = windows64PlatformDetect
+            }
+            linuxX86(BuildConfig) {
+                architecture = 'x86'
+                operatingSystem = 'linux'
+                compilerArgs = linuxCompilerArgs
+                compilerArgs << linux32BitArg
+                linkerArgs = linuxLinkerArgs
+                linkerArgs << linux32BitArg
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                detectPlatform = linux32IntelPlatformDetect
+            }
+            linuxX64(BuildConfig) {
+                architecture = 'x86-64'
+                operatingSystem = 'linux'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                detectPlatform = linux64IntelPlatformDetect
+            }
+            macX86(BuildConfig) {
+                architecture = 'x86'
+                operatingSystem = 'osx'
+                compilerArgs = macCompilerArgs
+                compilerArgs << mac32BitArg
+                linkerArgs << mac32BitArg
+                debugCompilerArgs = macDebugCompilerArgs
+                releaseCompilerArgs = macReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Clang'
+                detectPlatform = mac32PlatformDetect
+            }
+            macX64(BuildConfig) {
+                architecture = 'x86-64'
+                operatingSystem = 'osx'
+                compilerArgs = macCompilerArgs
+                debugCompilerArgs = macDebugCompilerArgs
+                releaseCompilerArgs = macReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Clang'
+                detectPlatform = mac64PlatformDetect
+            }
+        }
+    }
+}
+
+if (project.hasProperty('linuxCross')) {
+    model {
+        buildConfigs {
+            linuxArm(CrossBuildConfig) {
+                architecture = 'nativearm'
+                operatingSystem = 'linux'
+                toolChainPrefix = 'PLEASE_PROVIDE_A_COMPILER_NAME'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                skipByDefault = true
+                compilerFamily = 'Gcc'
+                exclude << 'gmock'
+            }
+        }
+    }
+} else {
+    model {
+        buildConfigs {
+            linuxArm(BuildConfig) {
+                architecture = 'nativearm'
+                operatingSystem = 'linux'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                detectPlatform = linuxArmPlatformDetect
+            }
+        }
+    }
+}
diff --git a/third_party/ntcore_2018/doc/alloy-model.adoc b/third_party/ntcore_2018/doc/alloy-model.adoc
new file mode 100644
index 0000000..35ca7d8
--- /dev/null
+++ b/third_party/ntcore_2018/doc/alloy-model.adoc
@@ -0,0 +1,198 @@
+= Network Tables Alloy Model
+
+Alloy (http://alloy.mit.edu/alloy/) is a formal logic tool that can analyze
+first-order logic expressions. Under the proposed sequence number -based
+protocol, assuming that all nodes start from the same state, Alloy is unable to
+find a way where two nodes with the same sequence number have different state
+when activity ceases.
+
+The model used is included below. Although Alloy cannot test all cases, since
+such an exhaustive search is intractable, it provides a high level of
+confidence in the proposed protocol.
+
+----
+--- Models a distributed, centralized hash table system called NetworkTables
+--- System state is protected by sequence numbers; the server's value for a certain sequence number always wins
+--- Paul Malmsten, 2012 pmalmsten@gmail.com
+
+open util/ordering[Time] as TO
+open util/natural as natural
+
+sig Time {}
+sig State {}
+
+--- Define nodes and server
+sig Node {
+    state: State -> Time,
+    sequenceNumber: Natural -> Time
+}
+
+--- Only one server
+one sig Server extends Node {
+}
+
+--- Define possible events
+abstract sig Event {
+    pre,post: Time,
+    receiver: one Node
+}
+
+// For all events, event.post is the time directly following event.pre
+fact {
+    all e:Event {
+        e.post = e.pre.next
+    }
+}
+
+// Represents that state has changed on a node
+sig StateChangeEvent extends Event {
+}
+
+// Represents that state has been transferred from one node to another
+sig StateTransferEvent extends Event {
+    sender: one Node
+}
+
+fact {
+    --- Every node must assume at most one state
+    all t:Time, n:Node | #n.state.t = 1
+
+    --- Every node must assume one sequence number
+    all t:Time, n:Node | #n.sequenceNumber.t = 1
+
+    --- Sequence numbers may only increment
+    all t:Time - last, n:Node | let t' = t.next | natural/gte[n.sequenceNumber.t', n.sequenceNumber.t]
+}
+
+
+fact stateChangedImpliesAStateTransfer {
+    all sce:StateChangeEvent {
+        // A StateChange on a client causes a transfer to the Server if its sequence number is greater than the server's
+        sce.receiver in Node - Server and natural/gt[sce.receiver.sequenceNumber.(sce.post), Server.sequenceNumber.(sce.post)]
+         implies
+            some ste:StateTransferEvent {
+                ste.pre = sce.post and ste.sender = sce.receiver and ste.receiver = Server
+            }
+    }
+
+    all sce:StateChangeEvent {
+        // A StateChange on the server causes a transfer to all clients
+        sce.receiver = Server implies
+            all n:Node - Server {
+                some ste:StateTransferEvent {
+                     ste.pre = sce.post and ste.sender = Server and ste.receiver = n
+                }
+            }
+    }
+
+    all sce:StateTransferEvent {
+        // A StateTransfer to the server causes a transfer to all clients
+        sce.receiver = Server implies
+            all n:Node - Server {
+                some ste:StateTransferEvent {
+                     ste.pre = sce.post and ste.sender = Server and ste.receiver = n
+                }
+            }
+    }
+}
+
+fact stateTransferEventsMoveState {
+    all ste:StateTransferEvent {
+        ste.sender = Server and not ste.receiver = Server or ste.receiver = Server and not ste.sender = Server
+
+        // Nodes can only post to the server if their sequence number is greater than the servers
+        ste.receiver = Server implies natural/gt[ste.sender.sequenceNumber.(ste.pre), ste.receiver.sequenceNumber.(ste.pre)]
+
+        // Server can only post to clients if its sequence number is greater than or equal to the client
+        ste.sender = Server implies natural/gte[ste.sender.sequenceNumber.(ste.pre), ste.receiver.sequenceNumber.(ste.pre)]
+
+        // Actual transfer
+        (ste.receiver.state.(ste.post) = ste.sender.state.(ste.pre) and
+          ste.receiver.sequenceNumber.(ste.post) = ste.sender.sequenceNumber.(ste.pre))
+    }
+}
+
+
+fact noEventsPendingAtEnd {
+    no e:Event {
+        e.pre = last
+    }
+}
+
+fact noDuplicateEvents {
+    all e,e2:Event {
+        // Two different events with the same receiver imply they occurred at different times
+        e.receiver = e2.receiver and e != e2 implies e.pre != e2.pre
+    }
+}
+
+fact noStateTransfersToSelf {
+    all ste:StateTransferEvent {
+        ste.sender != ste.receiver
+    }
+}
+
+fact noDuplicateStateTransferEvents {
+    all ste,ste2:StateTransferEvent {
+        // Two state transfer events with the same nodes imply that they occurred at different times
+        ste.sender = ste2.sender and ste.receiver = ste2.receiver and ste != ste2 implies ste.pre != ste2.pre
+    }
+}
+
+--- Trace (time invariant)
+fact trace {
+    all t:Time - last | let t' = t.next {
+        all n:Node {
+                // A node in (pre.t).receiver means it is being pointed to by some event that will happen over the next time step
+                n in (pre.t).receiver implies n.state.t' != n.state.t and n.sequenceNumber.t' != n.sequenceNumber.t    // A node which receives some sort of event at time t causes it to change state
+                                                       else n.state.t' = n.state.t and n.sequenceNumber.t' = n.sequenceNumber.t     // Otherwise, it does not change state
+        }
+    }
+}
+
+--- Things we might like to be true, but are not always true
+
+pred atLeastOneEvent {
+    #Event >= 1
+}
+
+pred allNodesStartAtSameStateAndSequenceNumber {
+    all n,n2:Node {
+        n.state.first = n2.state.first and n.sequenceNumber.first = n2.sequenceNumber.first
+    }
+}
+
+pred noStateChangeEventsAtEnd {
+    no e:StateChangeEvent {
+        e.post = last
+    }
+}
+
+--- Demonstration (Alloy will try to satisfy this)
+
+pred show {
+    atLeastOneEvent
+}
+run show
+
+--- Assertions (Alloy will try to break these)
+
+assert allNodesConsistentAtEnd {
+    allNodesStartAtSameStateAndSequenceNumber implies
+        all n,n2:Node {
+            // At the end of a sequence (last) all nodes with the same sequence number have the same state
+            n.sequenceNumber.last = n2.sequenceNumber.last implies n.state.last = n2.state.last
+        }
+}
+check allNodesConsistentAtEnd for 3 Event, 10 Node, 3 State, 5 Time, 5 Natural
+check allNodesConsistentAtEnd for 8 Event, 2 Node, 5 State, 9 Time, 9 Natural
+
+assert serverHasHighestSeqNumAtEnd {
+    allNodesStartAtSameStateAndSequenceNumber implies
+        all n:Node - Server{
+            // At the end of a sequence (last) all nodes with the same sequence number have the same state
+            natural/gte[Server.sequenceNumber.last, n.sequenceNumber.last]
+        }
+}
+check serverHasHighestSeqNumAtEnd for 3 Event, 10 Node, 3 State, 5 Time, 5 Natural
+----
diff --git a/third_party/ntcore_2018/doc/networktables2.adoc b/third_party/ntcore_2018/doc/networktables2.adoc
new file mode 100644
index 0000000..579403d
--- /dev/null
+++ b/third_party/ntcore_2018/doc/networktables2.adoc
@@ -0,0 +1,454 @@
+= Network Tables Protocol Specification, Version 2.0
+Protocol Revision 2.0 (0x0200), 1/8/2013
+:toc:
+:toc-placement: preamble
+:sectanchors:
+
+This document defines a network protocol for a key-value store that may be read
+from and written to by multiple remote clients. A central server, most often
+running on a FIRST FRC robot controller, is responsible for providing
+information consistency and for facilitating communication between clients.
+
+Information consistency is guaranteed through the use of a sequence number
+associated with each key-value pair. An update of a key-value pair increments
+the associated sequence number, and this update information is shared with all
+participating clients. The central server only applies and redistributes
+updates which have a larger sequence number than its own, which guarantees that
+a client must have received a server's most recent state before it can replace
+it with a new value.
+
+This is a backwards-incompatible rework of the Network Tables network protocol
+originally introduced for the 2012 FIRST Robotics Competition. Note that this
+revision of the Network Tables protocol no longer includes the concept of
+sub-tables. We suggest that instead of representing sub-tables as first-class
+data types in the network protocol, it would be easy for an implementation to
+provide a similar API abstraction by adding prefixes to keys. For example, we
+suggest using Unix-style path strings to define sub-table hierarchies. The
+prefix ensures that sub-table namespaces do not collide in a global hashtable
+without requiring an explicit sub-table representation.
+
+In addition, the explicit concept of grouping multiple updates such that they
+are all visible at the same time to user code on a remote device was discarded.
+Instead, array types for all common elements are provided. By using an array
+data type, users may achieve the same level of atomicity for common operations
+(e.g. sending a cartesian coordinate pair) without requiring the complexity of
+arbitrarily grouped updates.
+
+This document conforms to <<rfc2119>> - Key words for use in RFCs to Indicate
+Requirement Levels.
+
+[[references]]
+== References
+
+[[rfc1982,RFC 1982]]
+* RFC 1982, Serial Number Arithmetic, http://tools.ietf.org/html/rfc1982
+
+[[rfc2119,RFC 2119]]
+* RFC 2119, Key words for use in RFCs to Indicate Requirement Levels,
+http://tools.ietf.org/html/rfc2119
+
+[[definitions]]
+== Definitions
+
+[[def-client]]
+Client:: An implementation of this protocol running in client configuration.
+Any number of Clients may exist for a given Network.
+
+[[def-entry]]
+Entry:: A data value identified by a string name.
+
+[[def-entry-id]]
+Entry ID:: An unsigned 2-byte ID by which the Server and Clients refer to an
+Entry across the network instead of using the full string key for the Entry.
+Entry IDs range from 0x0000 to 0xFFFE (0xFFFF is reserved for an Entry
+Assignment issued by a Client).
+
+[[def-server]]
+Server:: An implementation of this protocol running in server configuration.
+One and only one Server must exist for a given Network.
+
+[[def-network]]
+Network:: One or more Client nodes connected to a Server.
+
+[[def-user-code]]
+User Code:: User-supplied code which may interact with a Client or Server. User
+Code should be executed on the same computer as the Client or Server instance
+it interacts with.
+
+[[def-sequence-number]]
+Sequence Number:: An unsigned number which allows the Server to resolve update
+conflicts between Clients and/or the Server. Sequence numbers may overflow.
+Sequential arithmetic comparisons, which must be used with Sequence Numbers,
+are defined by RFC 1982.
+
+[[def-protocol-revision]]
+Protocol Revision:: A 16-bit unsigned integer which indicates the version of
+the network tables protocol that a client wishes to use. The protocol revision
+assigned to this version of the network tables specification is listed at the
+top of this document. This number is listed in dot-decimal notation as well as
+its equivalent hexadecimal value.
+
+== Transport Layer
+
+Conventional implementations of this protocol should use TCP for reliable
+communication; the Server should listen on TCP port 1735 for incoming
+connections.
+
+== Example Exchanges
+
+[[exchange-connect]]
+=== Client Connects to the Server
+
+Directly after client establishes a connection with the Server, the following
+procedure must be followed:
+
+. The Client sends a <<msg-client-hello>> message to the Server
+
+. The Server sends one <<msg-assign>> for every field it currently recognizes.
+
+. The Server sends a <<msg-server-hello-complete>> message.
+
+. For all Entries the Client recognizes that the Server did not identify with a
+Entry Assignment, the client follows the <<exchange-client-creates-entry>>
+protocol.
+
+In the event that the Server does not support the protocol revision that the
+Client has requested in a Client Hello message, the Server must instead issue a
+<<msg-protocol-unsupported>> message to the joining client and close the
+connection.
+
+[[exchange-client-creates-entry]]
+=== Client Creates an Entry
+
+When User Code on a Client assigns a value to an Entry that the Server has not
+yet issued a Entry Assignment for, the following procedure must be followed:
+
+. The Client sends an <<msg-assign>> with an Entry ID of 0xFFFF.
+
+. The Server issues an <<msg-assign>> to all Clients (including the sender) for
+the new field containing a real Entry ID and Sequence Number for the new field.
+
+In the event that User Code on the Client updates the value of the
+to-be-announced field again before the expected Entry Assignment is received,
+then the Client must save the new value and take no other action (the most
+recent value of the field should be issued when the Entry Assignment arrives,
+if it differs from the value contained in the received Entry Assignment).
+
+In the event that the Client receives a Entry Assignment from the Server for
+the Entry that it intended to issue an Entry Assignment for, before it issued
+its own Entry Assignment, the procedure may end early.
+
+In the event that the Server receives a duplicate Entry Assignment from a
+Client (likely due to the client having not yet received the Server's Entry
+Assignment), the Server should ignore the duplicate Entry Assignment.
+
+[[exchange-client-updates-entry]]
+=== Client Updates an Entry
+
+When User Code on a Client updates the value of an Entry, the Client must send
+an <<msg-update>> message to the Server. The Sequence Number included in the
+Entry Update message must be the most recently received Sequence Number for the
+Entry to be updated incremented by one.
+
+.Example:
+
+. Client receives Entry Assignment message for Entry "a" with integer value 1,
+Entry ID of 0, and Sequence Number 1.
+
+. User Code on Client updates value of Entry "a" to 16 (arbitrary).
+
+. Client sends Entry Update message to Server for Entry 0 with a Sequence
+Number of 2 and a value of 16.
+
+When the Server receives an Entry Update message, it first checks the Sequence
+Number in the message against the Server's value for the Sequence Number
+associated with the Entry to be updated. If the received Sequence Number is
+strictly greater than (aside: see definition of "greater than" under the
+definition of Sequence Number) the Server's Sequence Number for the Entry to be
+updated, the Server must apply the new value for the indicated Entry and repeat
+the Entry Update message to all other connected Clients.
+
+If the received Sequence Number is less than or equal (see definition of "less
+than or equal" in RFC 1982) to the Server's Sequence Number for the Entry to be
+updated, this implies that the Client which issued the Entry Update message has
+not yet received one or more Entry Update message(s) that the Server recently
+sent to it; therefore, the Server must ignore the received Entry Update
+message. In the event that comparison between two Sequence Numbers is undefined
+(see RFC 1982), then the Server must always win (it ignores the Entry Update
+message under consideration).
+
+[[update-rate]]
+NOTE: If User Code modifies the value of an Entry too quickly, 1) users may not
+see every value appear on remote machines, and 2) the consistency protection
+offered by the Entry's Sequence Number may be lost (by overflowing before
+remote devices hear recent values). It is recommended that implementations
+detect when user code updates an Entry more frequently than once every 5
+milliseconds and print a warning message to the user (and/or offer some other
+means of informing User Code of this condition).
+
+[[exchange-server-creates-entry]]
+=== Server Creates an Entry
+
+When User Code on the Server assigns a value to a Entry which does not exist,
+the Server must issue an <<msg-assign>> message to all connected clients.
+
+[[exchange-server-updates-entry]]
+=== Server Updates an Entry
+
+When User Code on the Server updates the value of an Entry, the Server must
+apply the new value to the Entry immediately, increment the associated Entry's
+Sequence Number, and issue a <<msg-update>> message containing the new value
+and Sequence Number of the associated Entry to all connected Clients.
+
+NOTE: See <<update-rate,Note>> under <<exchange-client-updates-entry>>.
+
+[[exchange-keep-alive]]
+=== Keep Alive
+
+To maintain a connection and prove a socket is still open, a Client or Server
+may issue <<msg-keep-alive>> messages. Clients and the Server should ignore
+incoming Keep Alive messages.
+
+The intent is that by writing a Keep Alive to a socket, a Client forces its
+network layer (TCP) to reevaluate the state of the network connection as it
+attempts to deliver the Keep Alive message. In the event that a connection is
+no longer usable, a Client's network layer should inform the Client that it is
+no longer usable within a few attempts to send a Keep Alive message.
+
+To provide timely connection status information, Clients should send a Keep
+Alive message to the Server after every 1 second period of connection
+inactivity (i.e. no information is being sent to the Server). Clients should
+not send Keep Alive messages more frequently than once every 100 milliseconds.
+
+Since the Server does not require as timely information about the status of a
+connection, it is not required to send Keep Alive messages during a period of
+inactivity.
+
+[[bandwidth]]
+== Bandwidth and Latency Considerations
+
+To reduce unnecessary bandwidth usage, implementations of this protocol should:
+
+* Send an Entry Update if and only if the value of an Entry is changed to a
+value that is different from its prior value.
+
+* Buffer messages and transmit them in groups, when possible, to reduce
+transport protocol overhead.
+
+* Only send the most recent value of an Entry. When User Code updates the value
+of an Entry more than once before the new value is transmitted, only the latest
+value of the Entry should be sent.
+
+It is important to note that these behaviors will increase the latency between
+when a Client or Server updates the value of an Entry and when all Clients
+reflect the new value. The exact behavior of this buffering is left to
+implementations to determine, although the chosen scheme should reflect the
+needs of User Code. Implementations may include a method by which User Code can
+specify the maximum tolerable send latency.
+
+[[entry-types]]
+== Entry Types
+
+Entry Type must assume one the following values:
+
+[cols="1,3"]
+|===
+|Numeric Value |Type
+
+|0x00
+|Boolean
+
+|0x01
+|Double
+
+|0x02
+|String
+
+|0x10
+|Boolean Array
+
+|0x11
+|Double Array
+
+|0x12
+|String Array
+|===
+
+[[entry-values]]
+== Entry Values
+
+Entry Value must assume the following structure as indicated by Entry Type:
+
+[cols="1,3"]
+|===
+|Entry Type |Entry Value Format
+
+|[[entry-value-boolean]]Boolean
+|1 byte, unsigned; True = 0x01, False = 0x00
+
+|[[entry-value-double]]Double
+|8 bytes, IEEE 754 floating-point "double format" bit layout; (big endian)
+
+|[[entry-value-string]]String
+|2 byte, unsigned length prefix (big endian) of the number of raw bytes to
+follow, followed by the string encoded in UTF-8
+
+|[[entry-value-boolean-array]]Boolean Array
+|1 byte, unsigned, number of elements within the array to follow
+
+N bytes - The raw bytes representing each Boolean element contained within the
+array, beginning with the item at index 0 within the array.
+
+|[[entry-value-double-array]]Double Array
+|1 byte, unsigned, number of elements within the array to follow
+
+N bytes - The raw bytes representing each Double element contained within the
+array, beginning with the item at index 0 within the array.
+
+|[[entry-value-string-array]]String Array
+|1 byte, unsigned, number of elements within the array to follow
+
+N bytes - The raw bytes representing each String element contained within the
+array, beginning with the item at index 0 within the array.
+|===
+
+== Message Structures
+
+All messages are of the following format:
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|Message Type
+|1 byte, unsigned
+
+|Message Data
+|N bytes (length determined by Message Type)
+|===
+
+[[msg-keep-alive]]
+=== Keep Alive
+
+Indicates that the remote party is checking the status of a network connection.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x00 - Keep Alive
+|1 byte, unsigned; Message Type
+|===
+
+[[msg-client-hello]]
+=== Client Hello
+
+A Client issues a Client Hello message when first establishing a connection.
+The Client Protocol Revision field specifies the Network Table protocol
+revision that the Client would like to use.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x01 - Client Hello
+|1 byte, unsigned; Message Type
+
+|Client Protocol Revision
+|2 bytes, Unsigned 16-bit integer (big-endian).
+
+See <<def-protocol-revision,Protocol Revision>>
+|===
+
+[[msg-protocol-unsupported]]
+=== Protocol Version Unsupported
+
+A Server issues a Protocol Version Unsupported message to a Client to inform it
+that the requested protocol revision is not supported. It also includes the
+most recent protocol revision which it supports, such that a Client may
+reconnect under a prior protocol revision if able.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x02 - Protocol Version Unsupported
+|1 byte, unsigned; Message Type
+
+|Server Supported Protocol Revision
+|2 bytes, Unsigned 16-bit integer (big-endian).
+
+See <<def-protocol-revision,Protocol Revision>>
+|===
+
+[[msg-server-hello-complete]]
+=== Server Hello Complete
+
+A Server issues a Server Hello Complete message when it has finished informing
+a newly-connected client of all of the fields it currently recognizes.
+Following the receipt of this message, a Client should inform the Server of
+any/all additional fields that it recognizes that the Server did not announce.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x03 - Server Hello Complete
+|1 byte, unsigned; Message Type
+|===
+
+[[msg-assign]]
+=== Entry Assignment
+
+A Entry Assignment message informs the remote party of a new Entry. An Entry
+Assignment's value field must be the most recent value of the field being
+assigned at the time that the Entry Assignment is sent.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x10 - Entry Assignment
+|1 byte, unsigned; Message Type
+
+|Entry Name
+|<<entry-value-string,String>>
+
+|Entry Type
+|1 byte, unsigned; see <<entry-types,Entry Types>>
+
+|Entry ID
+|2 bytes, unsigned
+
+|Entry Sequence Number
+|2 bytes, unsigned
+
+|Entry Value
+|N bytes, length depends on Entry Type
+|===
+
+If the Entry ID is 0xFFFF, then this assignment represents a request from a
+Client to the Server. In this event, the Entry ID field and the Entry Sequence
+Number field must not be stored or relied upon as they otherwise would be.
+
+[[msg-update]]
+=== Entry Update
+
+An Entry Update message informs a remote party of a new value for an Entry.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x11 - Entry Update
+|1 byte, unsigned; Message Type
+
+|Entry ID
+|2 bytes, unsigned
+
+|Entry Sequence Number
+|2 bytes, unsigned
+
+|Entry Value
+|N bytes, length dependent on value type
+|===
diff --git a/third_party/ntcore_2018/doc/networktables3.adoc b/third_party/ntcore_2018/doc/networktables3.adoc
new file mode 100644
index 0000000..a4cc506
--- /dev/null
+++ b/third_party/ntcore_2018/doc/networktables3.adoc
@@ -0,0 +1,838 @@
+= Network Tables Protocol Specification, Version 3.0
+Protocol Revision 3.0 (0x0300), 6/12/2015
+:toc:
+:toc-placement: preamble
+:sectanchors:
+
+This document defines a network protocol for a key-value store that may be read
+from and written to by multiple remote clients. A central server, most often
+running on a FIRST FRC robot controller, is responsible for providing
+information consistency and for facilitating communication between clients.
+
+Information consistency is guaranteed through the use of a sequence number
+associated with each key-value pair. An update of a key-value pair increments
+the associated sequence number, and this update information is shared with all
+participating clients. The central server only applies and redistributes
+updates which have a larger sequence number than its own, which guarantees that
+a client must have received a server's most recent state before it can replace
+it with a new value.
+
+This is a backwards-compatible update of <<networktables2,version 2.0>> of the
+Network Tables network protocol. The protocol is designed such that 3.0 clients
+and servers can interoperate with 2.0 clients and servers with the only loss of
+functionality being the extended features introduced in 3.0.
+
+This document conforms to <<rfc2119>> - Key words for use in RFCs to Indicate
+Requirement Levels.
+
+== Summary of Changes from 2.0 to 3.0
+
+3 way connection handshake:: When a Client establishes a connection, after
+receiving the <<msg-server-hello-complete>> message and sending its local
+entries, it finishes with a <<msg-client-hello-complete>> message to the
+server. This enables the Server to be aware of when the Client is fully
+synchronized.
+
+String length encoding:: String length is now encoded as unsigned <<leb128>>
+rather than as a 2-byte unsigned integer. This both allows string lengths
+longer than 64K and is more space efficient for the common case of short
+strings (<128 byte strings only require a single byte for length).
+
+Entry deletion:: Entries may now be deleted by any member of the Network using
+the <<msg-delete>> and <<msg-clear-all>> messages. Note that in a Network
+consisting of mixed 2.0 and 3.0 Clients, deletion may be ineffective because
+the deletion message will not be propagated to the 2.0 Clients.
+
+// TODO: needs more description in the text of how these messages are
+// propagated
+
+Remote procedure call:: The Server may create specially-typed entries that
+inform Clients of remotely callable functions on the Server. Clients can then
+execute these functions via the Network Tables protocol. See <<rpc-operation>>.
+
+Raw data type:: An arbitrary data type has been added. While string could be
+used to encode raw data, the reason for a different data type is so that
+dashboards can choose not to display the raw data (or display it in a different
+format).
+
+Client and server self-identification:: Clients self-identify with a
+user-defined string name when connecting to the Server (this is part of the new
+<<msg-client-hello-complete>> message). This provides a more reliable method
+than simply the remote IP address for determining on the Server side whether or
+not a particular Client is connected.  While Clients are less likely to care
+what Server they are connected to, for completeness a similar Server
+self-identification string has been added to the Server Hello Complete message.
+Note that Server connection information is not provided from the Server to
+Clients (at least in a way built into the protocol), so it is not possible for
+a Client to determine what other Clients are connected to the Server.
+
+Server reboot detection:: The Server keeps an internal list of all Client
+identity strings that have ever connected to it (this list is always empty at
+Server start). During the initial connection process, the Server sends the
+Client a flag (as part of the new <<msg-server-hello>> message) that indicates
+whether or not the Client was already on this list. Clients use this flag to
+determine whether the Server has rebooted since the previous connection.
+
+Entry flags:: Each Entry now has an 8-bit flags value associated with it (see
+<<entry-flags>>). The initial value of the flags are provided as part of the
+<<msg-assign>> message. The value of the flags may be updated by any member of
+the Network via use of the <<msg-flags-update>> message.
+
+Entry persistence:: The Server is required to provide a feature to
+automatically save entries (including their last known values) across Server
+restarts. By default, no values are automatically saved in this manner, but
+any member of the Network may set the “Persistent” Entry Flag on an Entry to
+indicate to the server that the Entry must be persisted by the Server. The
+Server must periodically save such flagged Entries to a file; on Server start,
+the Server reads the file to create the initial set of Server Entries.
+
+More robust Entry Update message encoding:: The entry type has been added to
+the <<msg-update>> message. This is used only to specify the length of value
+encoded in the Entry Update message, and has no effect on the Client or Server
+handling of Entry Updates. Clients and Servers must ignore Entry Update
+messages with mismatching type to their currently stored value. This increases
+robustness of Entry Updates in the presence of Entry Assignments with varying
+type (which should be uncommon, but this fixes a weakness in the 2.0 protocol).
+
+////
+TODO
+
+Synchronization on reconnect:: The approach to how Clients should handle
+conflicting values when reconnecting to a Server has been clarified.
+
+////
+
+[[references]]
+== References
+
+[[networktables2]]
+* <<networktables2.adoc#,Network Tables Protocol Specification, Protocol
+Revision 2.0 (0x0200)>>, dated 1/8/2013.
+
+[[leb128,LEB128]]
+* LEB128 definition in DWARF Specification 3.0
+(http://dwarfstd.org/doc/Dwarf3.pdf, section 7.6 and Appendix C, also explained
+in http://en.wikipedia.org/wiki/LEB128)
+
+[[rfc1982,RFC1982]]
+* RFC 1982, Serial Number Arithmetic, http://tools.ietf.org/html/rfc1982
+
+[[rfc2119,RFC2119]]
+* RFC 2119, Key words for use in RFCs to Indicate Requirement Levels,
+http://tools.ietf.org/html/rfc2119
+
+[[definitions]]
+== Definitions
+
+[[def-client]]
+Client:: An implementation of this protocol running in client configuration.
+Any number of Clients may exist for a given Network.
+
+[[def-entry]]
+Entry:: A data value identified by a string name.
+
+[[def-entry-id]]
+Entry ID:: An unsigned 2-byte ID by which the Server and Clients refer to an
+Entry across the network instead of using the full string key for the Entry.
+Entry IDs range from 0x0000 to 0xFFFE (0xFFFF is reserved for an Entry
+Assignment issued by a Client).
+
+[[def-server]]
+Server:: An implementation of this protocol running in server configuration.
+One and only one Server must exist for a given Network.
+
+[[def-network]]
+Network:: One or more Client nodes connected to a Server.
+
+[[def-user-code]]
+User Code:: User-supplied code which may interact with a Client or Server. User
+Code should be executed on the same computer as the Client or Server instance
+it interacts with.
+
+[[def-sequence-number]]
+Sequence Number:: An unsigned number which allows the Server to resolve update
+conflicts between Clients and/or the Server. Sequence numbers may overflow.
+Sequential arithmetic comparisons, which must be used with Sequence Numbers,
+are defined by <<rfc1982>>.
+
+[[def-protocol-revision]]
+Protocol Revision:: A 16-bit unsigned integer which indicates the version of
+the network tables protocol that a client wishes to use. The protocol revision
+assigned to this version of the network tables specification is listed at the
+top of this document. This number is listed in dot-decimal notation as well as
+its equivalent hexadecimal value.
+
+== Transport Layer
+
+Conventional implementations of this protocol should use TCP for reliable
+communication; the Server should listen on TCP port 1735 for incoming
+connections.
+
+== Example Exchanges
+
+[[exchange-connect]]
+=== Client Connects to the Server
+
+Directly after client establishes a connection with the Server, the following
+procedure must be followed:
+
+. The Client sends a <<msg-client-hello>> message to the Server
+
+. The Server sends a <<msg-server-hello>> message.
+
+. The Server sends one <<msg-assign>> for every field it currently recognizes.
+
+. The Server sends a <<msg-server-hello-complete>> message.
+
+. For all Entries the Client recognizes that the Server did not identify with a
+Entry Assignment, the client follows the <<exchange-client-creates-entry>>
+protocol.
+
+. The Client sends a <<msg-client-hello-complete>> message.
+
+In the event that the Server does not support the protocol revision that the
+Client has requested in a Client Hello message, the Server must instead issue a
+<<msg-protocol-unsupported>> message to the joining client and close the
+connection.
+
+[[exchange-client-creates-entry]]
+=== Client Creates an Entry
+
+When User Code on a Client assigns a value to an Entry that the Server has not
+yet issued a Entry Assignment for, the following procedure must be followed:
+
+. The Client sends an <<msg-assign>> with an Entry ID of 0xFFFF.
+
+. The Server issues an <<msg-assign>> to all Clients (including the sender) for
+the new field containing a real Entry ID and Sequence Number for the new field.
+
+In the event that User Code on the Client updates the value of the
+to-be-announced field again before the expected Entry Assignment is received,
+then the Client must save the new value and take no other action (the most
+recent value of the field should be issued when the Entry Assignment arrives,
+if it differs from the value contained in the received Entry Assignment).
+
+In the event that the Client receives a Entry Assignment from the Server for
+the Entry that it intended to issue an Entry Assignment for, before it issued
+its own Entry Assignment, the procedure may end early.
+
+In the event that the Server receives a duplicate Entry Assignment from a
+Client (likely due to the client having not yet received the Server's Entry
+Assignment), the Server should ignore the duplicate Entry Assignment.
+
+[[exchange-client-updates-entry]]
+=== Client Updates an Entry
+
+When User Code on a Client updates the value of an Entry, the Client must send
+an <<msg-update>> message to the Server. The Sequence Number included in the
+Entry Update message must be the most recently received Sequence Number for the
+Entry to be updated incremented by one.
+
+.Example:
+
+. Client receives Entry Assignment message for Entry "a" with integer value 1,
+Entry ID of 0, and Sequence Number 1.
+
+. User Code on Client updates value of Entry "a" to 16 (arbitrary).
+
+. Client sends Entry Update message to Server for Entry 0 with a Sequence
+Number of 2 and a value of 16.
+
+When the Server receives an Entry Update message, it first checks the Sequence
+Number in the message against the Server's value for the Sequence Number
+associated with the Entry to be updated. If the received Sequence Number is
+strictly greater than (aside: see definition of "greater than" under the
+definition of Sequence Number) the Server's Sequence Number for the Entry to be
+updated, the Server must apply the new value for the indicated Entry and repeat
+the Entry Update message to all other connected Clients.
+
+If the received Sequence Number is less than or equal (see definition of "less
+than or equal" in RFC 1982) to the Server's Sequence Number for the Entry to be
+updated, this implies that the Client which issued the Entry Update message has
+not yet received one or more Entry Update message(s) that the Server recently
+sent to it; therefore, the Server must ignore the received Entry Update
+message. In the event that comparison between two Sequence Numbers is undefined
+(see RFC 1982), then the Server must always win (it ignores the Entry Update
+message under consideration).
+
+[[update-rate]]
+NOTE: If User Code modifies the value of an Entry too quickly, 1) users may not
+see every value appear on remote machines, and 2) the consistency protection
+offered by the Entry's Sequence Number may be lost (by overflowing before
+remote devices hear recent values). It is recommended that implementations
+detect when user code updates an Entry more frequently than once every 5
+milliseconds and print a warning message to the user (and/or offer some other
+means of informing User Code of this condition).
+
+[[exchange-client-updates-flags]]
+=== Client Updates an Entry's Flags
+
+When User Code on a Client updates an Entry's flags, the Client must apply the
+new flags to the Entry immediately, and send an <<msg-flags-update>> message to
+the Server.
+
+When the Server receives an Entry Flags Update message, it must apply the new
+flags to the indicated Entry and repeat the Entry Flags Update message to all
+other connected Clients.
+
+[[exchange-client-deletes-entry]]
+=== Client Deletes an Entry
+
+When User Code on a Client deletes an Entry, the Client must immediately delete
+the Entry, and send an <<msg-delete>> message to the Server.
+
+When the Server receives an Entry Delete message, it must delete the indicated
+Entry and repeat the Entry Delete message to all other connected Clients.
+
+[[exchange-server-creates-entry]]
+=== Server Creates an Entry
+
+When User Code on the Server assigns a value to a Entry which does not exist,
+the Server must issue an <<msg-assign>> message to all connected clients.
+
+[[exchange-server-updates-entry]]
+=== Server Updates an Entry
+
+When User Code on the Server updates the value of an Entry, the Server must
+apply the new value to the Entry immediately, increment the associated Entry's
+Sequence Number, and issue a <<msg-update>> message containing the new value
+and Sequence Number of the associated Entry to all connected Clients.
+
+NOTE: See <<update-rate,Note>> under <<exchange-client-updates-entry>>.
+
+[[exchange-server-updates-flags]]
+=== Server Updates an Entry's Flags
+
+When User Code on the Server updates an Entry's flags, the Server must apply
+the new flags to the Entry immediately, and issue a <<msg-flags-update>>
+message containing the new flags value to all connected Clients.
+
+[[exchange-server-deletes-entry]]
+=== Server Deletes an Entry
+
+When User Code on the Server deletes an Entry, the Server must immediately
+delete the Entry, and issue a <<msg-delete>> message to all connected Clients.
+
+[[exchange-keep-alive]]
+=== Keep Alive
+
+To maintain a connection and prove a socket is still open, a Client or Server
+may issue <<msg-keep-alive>> messages. Clients and the Server should ignore
+incoming Keep Alive messages.
+
+The intent is that by writing a Keep Alive to a socket, a Client forces its
+network layer (TCP) to reevaluate the state of the network connection as it
+attempts to deliver the Keep Alive message. In the event that a connection is
+no longer usable, a Client's network layer should inform the Client that it is
+no longer usable within a few attempts to send a Keep Alive message.
+
+To provide timely connection status information, Clients should send a Keep
+Alive message to the Server after every 1 second period of connection
+inactivity (i.e. no information is being sent to the Server). Clients should
+not send Keep Alive messages more frequently than once every 100 milliseconds.
+
+Since the Server does not require as timely information about the status of a
+connection, it is not required to send Keep Alive messages during a period of
+inactivity.
+
+[[bandwidth]]
+== Bandwidth and Latency Considerations
+
+To reduce unnecessary bandwidth usage, implementations of this protocol should:
+
+* Send an Entry Update if and only if the value of an Entry is changed to a
+value that is different from its prior value.
+
+* Buffer messages and transmit them in groups, when possible, to reduce
+transport protocol overhead.
+
+* Only send the most recent value of an Entry. When User Code updates the value
+of an Entry more than once before the new value is transmitted, only the latest
+value of the Entry should be sent.
+
+It is important to note that these behaviors will increase the latency between
+when a Client or Server updates the value of an Entry and when all Clients
+reflect the new value. The exact behavior of this buffering is left to
+implementations to determine, although the chosen scheme should reflect the
+needs of User Code. Implementations may include a method by which User Code can
+specify the maximum tolerable send latency.
+
+[[entry-types]]
+== Entry Types
+
+Entry Type must assume one the following values:
+
+[cols="1,3"]
+|===
+|Numeric Value |Type
+
+|0x00
+|Boolean
+
+|0x01
+|Double
+
+|0x02
+|String
+
+|0x03
+|Raw Data
+
+|0x10
+|Boolean Array
+
+|0x11
+|Double Array
+
+|0x12
+|String Array
+
+|0x20
+|Remote Procedure Call Definition
+|===
+
+[[entry-values]]
+== Entry Values
+
+Entry Value must assume the following structure as indicated by Entry Type:
+
+[cols="1,3"]
+|===
+|Entry Type |Entry Value Format
+
+|[[entry-value-boolean]]Boolean
+|1 byte, unsigned; True = 0x01, False = 0x00
+
+|[[entry-value-double]]Double
+|8 bytes, IEEE 754 floating-point "double format" bit layout; (big endian)
+
+|[[entry-value-string]]String
+|N bytes, unsigned <<leb128>> encoded length of the number of raw bytes to
+follow, followed by the string encoded in UTF-8
+
+|[[entry-value-raw]]Raw Data
+|N bytes, unsigned LEB128 encoded length of the number of raw bytes to follow,
+followed by the raw bytes.
+
+While the raw data definition is unspecified, it's recommended that users use
+the first byte of the raw data to "tag" the type of data actually being stored.
+
+|[[entry-value-boolean-array]]Boolean Array
+|1 byte, unsigned, number of elements within the array to follow
+
+N bytes - The raw bytes representing each Boolean element contained within the
+array, beginning with the item at index 0 within the array.
+
+|[[entry-value-double-array]]Double Array
+|1 byte, unsigned, number of elements within the array to follow
+
+N bytes - The raw bytes representing each Double element contained within the
+array, beginning with the item at index 0 within the array.
+
+|[[entry-value-string-array]]String Array
+|1 byte, unsigned, number of elements within the array to follow
+
+N bytes - The raw bytes representing each String element contained within the
+array, beginning with the item at index 0 within the array.
+
+|[[entry-value-rpc]]Remote Procedure Call Definition
+|N bytes, unsigned LEB128 encoded length of the number of raw bytes to follow.
+
+N bytes - data as defined in Remote Procedure Call Definition Data
+|===
+
+[[entry-flags]]
+== Entry Flags
+
+Entry Flags are as follows:
+
+[cols="1,3"]
+|===
+|Bit Mask |Bit Value Meaning
+
+|[[entry-flag-persistent]]0x01 (least significant bit) - Persistent
+
+|0x00: Entry is not persistent. The entry and its value will not be retained
+across a server restart.
+
+0x01: Entry is persistent. Updates to the value are automatically saved and
+the entry will be automatically created and the last known value restored when
+the server starts.
+
+|0xFE
+|Reserved
+|===
+
+== Message Structures
+
+All messages are of the following format:
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|Message Type
+|1 byte, unsigned
+
+|Message Data
+|N bytes (length determined by Message Type)
+|===
+
+[[msg-keep-alive]]
+=== Keep Alive
+
+Indicates that the remote party is checking the status of a network connection.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x00 - Keep Alive
+|1 byte, unsigned; Message Type
+|===
+
+[[msg-client-hello]]
+=== Client Hello
+
+A Client issues a Client Hello message when first establishing a connection.
+The Client Protocol Revision field specifies the Network Table protocol
+revision that the Client would like to use.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x01 - Client Hello
+|1 byte, unsigned; Message Type
+
+|Client Protocol Revision
+|2 bytes, Unsigned 16-bit integer (big-endian). See
+<<def-protocol-revision,Protocol Revision>>.
+
+|Client identity (name)
+|<<entry-value-string,String>>
+|===
+
+[[msg-protocol-unsupported]]
+=== Protocol Version Unsupported
+
+A Server issues a Protocol Version Unsupported message to a Client to inform it
+that the requested protocol revision is not supported. It also includes the
+most recent protocol revision which it supports, such that a Client may
+reconnect under a prior protocol revision if able.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x02 - Protocol Version Unsupported
+|1 byte, unsigned; Message Type
+
+|Server Supported Protocol Revision
+|2 bytes, Unsigned 16-bit integer (big-endian). See
+<<def-protocol-revision,Protocol Revision>>.
+|===
+
+[[msg-server-hello-complete]]
+=== Server Hello Complete
+
+A Server issues a Server Hello Complete message when it has finished informing
+a newly-connected client of all of the fields it currently recognizes.
+Following the receipt of this message, a Client should inform the Server of
+any/all additional fields that it recognizes that the Server did not announce.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x03 - Server Hello Complete
+|1 byte, unsigned; Message Type
+|===
+
+[[msg-server-hello]]
+=== Server Hello
+
+A Server issues a Server Hello message in response to a Client Hello message,
+immediately prior to informing a newly-connected client of all of the fields it
+currently recognizes.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x04 - Server Hello
+|1 byte, unsigned; Message Type
+
+|Flags
+a|1 byte, unsigned.
+
+Least Significant Bit (bit 0): reconnect flag
+
+* 0 if this is the first time (since server start) the server has seen the
+client
+
+* 1 if the server has previously seen (since server start) the client (as
+identified in the <<msg-client-hello,Client Hello>> message)
+
+Bits 1-7: Reserved, set to 0.
+
+|Server identity (name)
+|<<entry-value-string,String>>
+|===
+
+[[msg-client-hello-complete]]
+=== Client Hello Complete
+
+A Client issues a Client Hello Complete message when it has finished informing
+the Server of any/all of the additional fields it recognizes that the Server
+did not announce.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x05 - Client Hello Complete
+|1 byte, unsigned; Message Type
+|===
+
+[[msg-assign]]
+=== Entry Assignment
+
+A Entry Assignment message informs the remote party of a new Entry. An Entry
+Assignment's value field must be the most recent value of the field being
+assigned at the time that the Entry Assignment is sent.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x10 - Entry Assignment
+|1 byte, unsigned; Message Type
+
+|Entry Name
+|<<entry-value-string,String>>
+
+|Entry Type
+|1 byte, unsigned; see <<entry-types,Entry Types>>
+
+|Entry ID
+|2 bytes, unsigned
+
+|Entry Sequence Number
+|2 bytes, unsigned
+
+|Entry Flags
+|1 byte, unsigned; see <<entry-flags,Entry Flags>>
+
+|Entry Value
+|N bytes, length depends on Entry Type
+|===
+
+If the Entry ID is 0xFFFF, then this assignment represents a request from a
+Client to the Server. In this event, the Entry ID field and the Entry Sequence
+Number field must not be stored or relied upon as they otherwise would be.
+
+[[msg-update]]
+=== Entry Update
+
+An Entry Update message informs a remote party of a new value for an Entry.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x11 - Entry Update
+|1 byte, unsigned; Message Type
+
+|Entry ID
+|2 bytes, unsigned
+
+|Entry Sequence Number
+|2 bytes, unsigned
+
+|Entry Type
+|1 byte, unsigned; see <<entry-types,Entry Types>>.
+
+Note this type is only used to determine the length of the entry value, and
+does NOT change the stored entry type if it is different (due to an intervening
+Entry Assignment); Clients and Servers must ignore Entry Update messages with
+mismatching entry type.
+
+|Entry Value
+|N bytes, length dependent on value type
+|===
+
+[[msg-flags-update]]
+=== Entry Flags Update
+
+An Entry Flags Update message informs a remote party of new flags for an Entry.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x12 - Entry Flags Update
+|1 byte, unsigned; Message Type
+
+|Entry ID
+|2 bytes, unsigned
+
+|Entry Flags
+|1 byte, unsigned; see <<entry-flags,Entry Flags>>
+|===
+
+Entries may be globally deleted using the following messages. These messages
+must be rebroadcast by the server in the same fashion as the Entry Update
+message. Clients and servers must remove the requested entry/entries from
+their local tables. Update messages received after the Entry Delete message
+for the deleted Entry ID must be ignored by Clients and Servers until a new
+Assignment message for that Entry ID is issued.
+
+[[msg-delete]]
+=== Entry Delete
+
+Deletes a single entry or procedure.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x13 - Entry Delete
+|1 byte, unsigned; message type
+
+|Entry ID
+|2 bytes, unsigned
+|===
+
+[[msg-clear-all]]
+=== Clear All Entries
+
+Deletes all entries. The magic value is required to be exactly this value
+(this is to avoid accidental misinterpretation of the message).
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x14 - Clear All Entries
+|1 byte, unsigned; message type
+
+|Magic Value (0xD06CB27A)
+|4 bytes; exact value required (big endian)
+|===
+
+[[msg-rpc-execute]]
+=== Remote Procedure Call (RPC) Execute
+
+Executes a remote procedure. Intended for client to server use only.
+
+The client shall provide a value for every RPC parameter specified in the
+corresponding RPC entry definition.
+
+The server shall ignore any Execute RPC message whose decoding does not match
+the parameters defined in the corresponding RPC entry definition.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x20 - Execute RPC
+|1 byte, unsigned; message type
+
+|RPC Definition Entry ID
+|2 bytes, unsigned
+
+|Unique ID
+|2 bytes, unsigned; incremented value for matching return values to call.
+
+|Parameter Value Length
+|N bytes, unsigned <<leb128>> encoded length of total number of bytes of
+parameter values in this message
+
+|Parameter Value(s)
+|Array of values; N bytes for each parameter (length dependent on the parameter
+type defined in the <<rpc-definition,RPC entry definition>>)
+|===
+
+[[msg-rpc-response]]
+=== RPC Response
+
+Return responses from a remote procedure call. Even calls with zero outputs
+will respond.
+
+[cols="1,3"]
+|===
+|Field Name |Field Type
+
+|0x21 - RPC Response
+|1 byte, unsigned; message type
+
+|RPC Definition Entry ID
+|2 bytes, unsigned
+
+|Unique ID
+|2 bytes, unsigned; matching ID from <<msg-rpc-execute,RPC Execute>> message
+
+|Result Value Length
+|N bytes, unsigned <<leb128>> encoded length of total number of bytes of result
+values in this message
+
+|Result Value(s)
+|Array of values; N bytes for each result (length dependent on the result type
+defined in the <<rpc-definition,RPC entry definition>>)
+|===
+
+[[rpc-operation]]
+== Remote Procedure Call (RPC) Operation
+
+Remote procedure call entries shall only be assigned by the server.
+
+Remote procedure call execute messages will result in asynchronous execution of
+the corresponding function on the server.
+
+Client implementations shall not transmit an Execute RPC message and return an
+error to user code that attempts to call an undefined RPC, call one with
+incorrectly typed parameters, or attempts to make a call when the Client is not
+connected to a Server.
+
+Remote procedure calls cannot be persisted.
+
+[[rpc-definition]]
+=== Remote Procedure Call Definition Data
+
+The data provided in the RPC definition entry consists of:
+
+[cols="1,3"]
+|===
+|RPC Definition Version
+|1 byte, unsigned; always set to 1 for this version of the protocol.
+
+|Procedure (Entry) Name
+|<<entry-value-string,String>>
+
+|Number of Parameters
+|1 byte, unsigned (may be 0)
+
+2+s|Parameter Specification (one set per input parameter)
+
+|Parameter Type
+|1 byte, unsigned; <<entry-types,Entry Type>> for parameter value
+
+|Parameter Name
+|<<entry-value-string,String>>
+
+|Parameter Default Value
+|N bytes; length based on parameter type (encoded consistent with corresponding
+<<entry-values,Entry Value>> definition)
+
+|Number of Output Results
+|1 byte, unsigned (may be 0)
+
+2+s|Result Specification (one set per output)
+
+|Result Type
+|1 byte, unsigned; <<entry-types,Entry Type>> for value
+
+|Result Name
+|<<entry-value-string,String>>
+|===
diff --git a/third_party/ntcore_2018/gmock/CMakeLists.txt b/third_party/ntcore_2018/gmock/CMakeLists.txt
new file mode 100644
index 0000000..e1af629
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/CMakeLists.txt
@@ -0,0 +1,86 @@
+########################################################################
+# CMake build script for Google Mock.
+#
+# To run the tests for Google Mock itself on Linux, use 'make test' or
+# ctest.  You can select which tests to run using 'ctest -R regex'.
+# For more options, run 'ctest --help'.
+
+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+# make it prominent in the GUI.
+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+
+# A directory to find Google Test sources.
+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")
+  set(gtest_dir gtest)
+else()
+  set(gtest_dir ../gtest)
+endif()
+
+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
+include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL)
+
+if (COMMAND pre_project_set_up_hermetic_build)
+  # Google Test also calls hermetic setup functions from add_subdirectory,
+  # although its changes will not affect things at the current scope.
+  pre_project_set_up_hermetic_build()
+endif()
+
+########################################################################
+#
+# Project-wide settings
+
+# Name of the project.
+#
+# CMake files in this project can refer to the root source directory
+# as ${gmock_SOURCE_DIR} and to the root binary directory as
+# ${gmock_BINARY_DIR}.
+# Language "C" is required for find_package(Threads).
+project(gmock CXX C)
+cmake_minimum_required(VERSION 2.6.2)
+
+if (COMMAND set_up_hermetic_build)
+  set_up_hermetic_build()
+endif()
+
+if (NOT MSVC)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers -Wno-format-nonliteral")
+endif()
+
+# Instructs CMake to process Google Test's CMakeLists.txt and add its
+# targets to the current scope.  We are placing Google Test's binary
+# directory in a subdirectory of our own as VC compilation may break
+# if they are the same (the default).
+add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest")
+
+# Although Google Test's CMakeLists.txt calls this function, the
+# changes there don't affect the current scope.  Therefore we have to
+# call it again here.
+config_compiler_and_linker()  # from ${gtest_dir}/cmake/internal_utils.cmake
+
+# Adds Google Mock's and Google Test's header directories to the search path.
+include_directories("${gmock_SOURCE_DIR}/include"
+                    "${gmock_SOURCE_DIR}"
+                    "${gtest_SOURCE_DIR}/include"
+                    # This directory is needed to build directly from Google
+                    # Test sources.
+                    "${gtest_SOURCE_DIR}")
+
+########################################################################
+#
+# Defines the gmock & gmock_main libraries.  User tests should link
+# with one of them.
+
+# Google Mock libraries.  We build them using more strict warnings than what
+# are used for other targets, to ensure that Google Mock can be compiled by
+# a user aggressive about warnings.
+cxx_library(gmock
+            "${cxx_strict}"
+            "${gtest_dir}/src/gtest-all.cc"
+            src/gmock-all.cc)
+
+cxx_library(gmock_main
+            "${cxx_strict}"
+            "${gtest_dir}/src/gtest-all.cc"
+            src/gmock-all.cc
+            src/gmock_main.cc)
+
diff --git a/third_party/ntcore_2018/gmock/LICENSE b/third_party/ntcore_2018/gmock/LICENSE
new file mode 100644
index 0000000..1941a11
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/LICENSE
@@ -0,0 +1,28 @@
+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.
diff --git a/third_party/ntcore_2018/gmock/build.gradle b/third_party/ntcore_2018/gmock/build.gradle
new file mode 100644
index 0000000..51ff139
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/build.gradle
@@ -0,0 +1,40 @@
+import org.gradle.internal.os.OperatingSystem
+
+if (!project.hasProperty('onlyAthena')) {
+    apply plugin: 'cpp'
+    apply plugin: 'visual-studio'
+    apply plugin: 'edu.wpi.first.NativeUtils'
+
+    ext.gmockProject = true
+
+    apply from: '../config.gradle'
+
+    model {
+        components {
+            gmock(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = ['src', 'gtest/src']
+                            includes = ['*-all.cc']
+                        }
+                        exportedHeaders {
+                            srcDirs = ['include', 'gtest/include', '.', 'gtest']
+                            includes = ['**/*.h', '**/*.cc']
+                        }
+                    }
+                }
+                binaries.all {
+                    if (toolChain in VisualCpp) {
+                        cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32',  '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1'
+                    } else {
+                        cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC'
+                    }
+                }
+                binaries.withType(SharedLibraryBinarySpec) {
+                    buildable = false
+                }
+            }
+        }
+    }
+}
diff --git a/third_party/ntcore_2018/gmock/gtest/CMakeLists.txt b/third_party/ntcore_2018/gmock/gtest/CMakeLists.txt
new file mode 100644
index 0000000..b9498cd
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/CMakeLists.txt
@@ -0,0 +1,69 @@
+########################################################################
+# CMake build script for Google Test.
+#
+# To run the tests for Google Test itself on Linux, use 'make test' or
+# ctest.  You can select which tests to run using 'ctest -R regex'.
+# For more options, run 'ctest --help'.
+
+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+# make it prominent in the GUI.
+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+
+# When other libraries are using a shared version of runtime libraries,
+# Google Test also has to use one.
+option(
+  gtest_force_shared_crt
+  "Use shared (DLL) run-time lib even when Google Test is built as static lib."
+  OFF)
+
+option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
+
+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
+include(cmake/hermetic_build.cmake OPTIONAL)
+
+if (COMMAND pre_project_set_up_hermetic_build)
+  pre_project_set_up_hermetic_build()
+endif()
+
+########################################################################
+#
+# Project-wide settings
+
+# Name of the project.
+#
+# CMake files in this project can refer to the root source directory
+# as ${gtest_SOURCE_DIR} and to the root binary directory as
+# ${gtest_BINARY_DIR}.
+# Language "C" is required for find_package(Threads).
+project(gtest CXX C)
+cmake_minimum_required(VERSION 2.6.2)
+
+if (COMMAND set_up_hermetic_build)
+  set_up_hermetic_build()
+endif()
+
+# Define helper functions and macros used by Google Test.
+include(cmake/internal_utils.cmake)
+
+config_compiler_and_linker()  # Defined in internal_utils.cmake.
+
+# Where Google Test's .h files can be found.
+include_directories(
+  ${gtest_SOURCE_DIR}/include
+  ${gtest_SOURCE_DIR})
+
+# Where Google Test's libraries can be found.
+link_directories(${gtest_BINARY_DIR}/src)
+
+########################################################################
+#
+# Defines the gtest & gtest_main libraries.  User tests should link
+# with one of them.
+
+# Google Test libraries.  We build them using more strict warnings than what
+# are used for other targets, to ensure that gtest can be compiled by a user
+# aggressive about warnings.
+cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
+cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
+target_link_libraries(gtest_main gtest)
+
diff --git a/third_party/ntcore_2018/gmock/gtest/LICENSE b/third_party/ntcore_2018/gmock/gtest/LICENSE
new file mode 100644
index 0000000..1941a11
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/LICENSE
@@ -0,0 +1,28 @@
+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.
diff --git a/third_party/ntcore_2018/gmock/gtest/cmake/internal_utils.cmake b/third_party/ntcore_2018/gmock/gtest/cmake/internal_utils.cmake
new file mode 100644
index 0000000..075410a
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/cmake/internal_utils.cmake
@@ -0,0 +1,206 @@
+# Defines functions and macros useful for building Google Test and
+# Google Mock.
+#
+# Note:
+#
+# - This file will be run twice when building Google Mock (once via
+#   Google Test's CMakeLists.txt, and once via Google Mock's).
+#   Therefore it shouldn't have any side effects other than defining
+#   the functions and macros.
+#
+# - The functions/macros defined in this file may depend on Google
+#   Test and Google Mock's option() definitions, and thus must be
+#   called *after* the options have been defined.
+
+# Tweaks CMake's default compiler/linker settings to suit Google Test's needs.
+#
+# This must be a macro(), as inside a function string() can only
+# update variables in the function scope.
+macro(fix_default_compiler_settings_)
+  if (MSVC)
+    # For MSVC, CMake sets certain flags to defaults we want to override.
+    # This replacement code is taken from sample in the CMake Wiki at
+    # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.
+    foreach (flag_var
+             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+      if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
+        # When Google Test is built as a shared library, it should also use
+        # shared runtime libraries.  Otherwise, it may end up with multiple
+        # copies of runtime library data in different modules, resulting in
+        # hard-to-find crashes. When it is built as a static library, it is
+        # preferable to use CRT as static libraries, as we don't have to rely
+        # on CRT DLLs being available. CMake always defaults to using shared
+        # CRT libraries, so we override that default here.
+        string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
+      endif()
+
+      # We prefer more strict warning checking for building Google Test.
+      # Replaces /W3 with /W4 in defaults.
+      string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}")
+    endforeach()
+  endif()
+endmacro()
+
+# Defines the compiler/linker flags used to build Google Test and
+# Google Mock.  You can tweak these definitions to suit your need.  A
+# variable's value is empty before it's explicitly assigned to.
+macro(config_compiler_and_linker)
+  if (NOT gtest_disable_pthreads)
+    # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
+    find_package(Threads)
+  endif()
+
+  fix_default_compiler_settings_()
+  if (MSVC)
+    # Newlines inside flags variables break CMake's NMake generator.
+    # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
+    set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi")
+    if (MSVC_VERSION LESS 1400)
+      # Suppress spurious warnings MSVC 7.1 sometimes issues.
+      # Forcing value to bool.
+      set(cxx_base_flags "${cxx_base_flags} -wd4800")
+      # Copy constructor and assignment operator could not be generated.
+      set(cxx_base_flags "${cxx_base_flags} -wd4511 -wd4512")
+      # Compatibility warnings not applicable to Google Test.
+      # Resolved overload was found by argument-dependent lookup.
+      set(cxx_base_flags "${cxx_base_flags} -wd4675")
+    endif()
+    set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32")
+    set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN")
+    set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
+    set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")
+    set(cxx_no_rtti_flags "-GR-")
+  elseif (CMAKE_COMPILER_IS_GNUCXX)
+    set(cxx_base_flags "-Wall -Wshadow")
+    set(cxx_exception_flags "-fexceptions")
+    set(cxx_no_exception_flags "-fno-exceptions")
+    # Until version 4.3.2, GCC doesn't define a macro to indicate
+    # whether RTTI is enabled.  Therefore we define GTEST_HAS_RTTI
+    # explicitly.
+    set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
+    set(cxx_strict_flags
+      "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
+    set(cxx_exception_flags "-features=except")
+    # Sun Pro doesn't provide macros to indicate whether exceptions and
+    # RTTI are enabled, so we define GTEST_HAS_* explicitly.
+    set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0")
+    set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0")
+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR
+      CMAKE_CXX_COMPILER_ID STREQUAL "XL")
+    # CMake 2.8 changes Visual Age's compiler ID to "XL".
+    set(cxx_exception_flags "-qeh")
+    set(cxx_no_exception_flags "-qnoeh")
+    # Until version 9.0, Visual Age doesn't define a macro to indicate
+    # whether RTTI is enabled.  Therefore we define GTEST_HAS_RTTI
+    # explicitly.
+    set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
+    set(cxx_base_flags "-AA -mt")
+    set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1")
+    set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0")
+    # RTTI can not be disabled in HP aCC compiler.
+    set(cxx_no_rtti_flags "")
+  endif()
+
+  if (CMAKE_USE_PTHREADS_INIT)  # The pthreads library is available and allowed.
+    set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1")
+  else()
+    set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0")
+  endif()
+
+  # For building gtest's own tests and samples.
+  set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}")
+  set(cxx_no_exception
+    "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
+  set(cxx_default "${cxx_exception}")
+  set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")
+  set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1")
+
+  # For building the gtest libraries.
+  set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
+endmacro()
+
+# Defines the gtest & gtest_main libraries.  User tests should link
+# with one of them.
+function(cxx_library_with_type name type cxx_flags)
+  # type can be either STATIC or SHARED to denote a static or shared library.
+  # ARGN refers to additional arguments after 'cxx_flags'.
+  add_library(${name} ${type} ${ARGN})
+  set_target_properties(${name}
+    PROPERTIES
+    COMPILE_FLAGS "${cxx_flags}")
+  if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
+    set_target_properties(${name}
+      PROPERTIES
+      COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
+  endif()
+  if (CMAKE_USE_PTHREADS_INIT)
+    target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
+  endif()
+endfunction()
+
+########################################################################
+#
+# Helper functions for creating build targets.
+
+function(cxx_shared_library name cxx_flags)
+  cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN})
+endfunction()
+
+function(cxx_library name cxx_flags)
+  cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN})
+endfunction()
+
+# cxx_executable_with_flags(name cxx_flags libs srcs...)
+#
+# creates a named C++ executable that depends on the given libraries and
+# is built from the given source files with the given compiler flags.
+function(cxx_executable_with_flags name cxx_flags libs)
+  add_executable(${name} ${ARGN})
+  if (cxx_flags)
+    set_target_properties(${name}
+      PROPERTIES
+      COMPILE_FLAGS "${cxx_flags}")
+  endif()
+  if (BUILD_SHARED_LIBS)
+    set_target_properties(${name}
+      PROPERTIES
+      COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
+  endif()
+  # To support mixing linking in static and dynamic libraries, link each
+  # library in with an extra call to target_link_libraries.
+  foreach (lib "${libs}")
+    target_link_libraries(${name} ${lib})
+  endforeach()
+endfunction()
+
+# cxx_executable(name dir lib srcs...)
+#
+# creates a named target that depends on the given libs and is built
+# from the given source files.  dir/name.cc is implicitly included in
+# the source file list.
+function(cxx_executable name dir libs)
+  cxx_executable_with_flags(
+    ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})
+endfunction()
+
+# cxx_test_with_flags(name cxx_flags libs srcs...)
+#
+# creates a named C++ test that depends on the given libs and is built
+# from the given source files with the given compiler flags.
+function(cxx_test_with_flags name cxx_flags libs)
+  cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
+  add_test(${name} ${name})
+endfunction()
+
+# cxx_test(name libs srcs...)
+#
+# creates a named test target that depends on the given libs and is
+# built from the given source files.  Unlike cxx_test_with_flags,
+# test/name.cc is already implicitly included in the source file list.
+function(cxx_test name libs)
+  cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
+    "test/${name}.cc" ${ARGN})
+endfunction()
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-death-test.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-death-test.h
new file mode 100644
index 0000000..957a69c
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-death-test.h
@@ -0,0 +1,294 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the public API for death tests.  It is
+// #included by gtest.h so a user doesn't need to include this
+// directly.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
+
+#include "gtest/internal/gtest-death-test-internal.h"
+
+namespace testing {
+
+// This flag controls the style of death tests.  Valid values are "threadsafe",
+// meaning that the death test child process will re-execute the test binary
+// from the start, running only a single death test, or "fast",
+// meaning that the child process will execute the test logic immediately
+// after forking.
+GTEST_DECLARE_string_(death_test_style);
+
+#if GTEST_HAS_DEATH_TEST
+
+namespace internal {
+
+// Returns a Boolean value indicating whether the caller is currently
+// executing in the context of the death test child process.  Tools such as
+// Valgrind heap checkers may need this to modify their behavior in death
+// tests.  IMPORTANT: This is an internal utility.  Using it may break the
+// implementation of death tests.  User code MUST NOT use it.
+GTEST_API_ bool InDeathTestChild();
+
+}  // namespace internal
+
+// The following macros are useful for writing death tests.
+
+// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
+// executed:
+//
+//   1. It generates a warning if there is more than one active
+//   thread.  This is because it's safe to fork() or clone() only
+//   when there is a single thread.
+//
+//   2. The parent process clone()s a sub-process and runs the death
+//   test in it; the sub-process exits with code 0 at the end of the
+//   death test, if it hasn't exited already.
+//
+//   3. The parent process waits for the sub-process to terminate.
+//
+//   4. The parent process checks the exit code and error message of
+//   the sub-process.
+//
+// Examples:
+//
+//   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
+//   for (int i = 0; i < 5; i++) {
+//     EXPECT_DEATH(server.ProcessRequest(i),
+//                  "Invalid request .* in ProcessRequest()")
+//                  << "Failed to die on request " << i;
+//   }
+//
+//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
+//
+//   bool KilledBySIGHUP(int exit_code) {
+//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
+//   }
+//
+//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
+//
+// On the regular expressions used in death tests:
+//
+//   On POSIX-compliant systems (*nix), we use the <regex.h> library,
+//   which uses the POSIX extended regex syntax.
+//
+//   On other platforms (e.g. Windows), we only support a simple regex
+//   syntax implemented as part of Google Test.  This limited
+//   implementation should be enough most of the time when writing
+//   death tests; though it lacks many features you can find in PCRE
+//   or POSIX extended regex syntax.  For example, we don't support
+//   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
+//   repetition count ("x{5,7}"), among others.
+//
+//   Below is the syntax that we do support.  We chose it to be a
+//   subset of both PCRE and POSIX extended regex, so it's easy to
+//   learn wherever you come from.  In the following: 'A' denotes a
+//   literal character, period (.), or a single \\ escape sequence;
+//   'x' and 'y' denote regular expressions; 'm' and 'n' are for
+//   natural numbers.
+//
+//     c     matches any literal character c
+//     \\d   matches any decimal digit
+//     \\D   matches any character that's not a decimal digit
+//     \\f   matches \f
+//     \\n   matches \n
+//     \\r   matches \r
+//     \\s   matches any ASCII whitespace, including \n
+//     \\S   matches any character that's not a whitespace
+//     \\t   matches \t
+//     \\v   matches \v
+//     \\w   matches any letter, _, or decimal digit
+//     \\W   matches any character that \\w doesn't match
+//     \\c   matches any literal character c, which must be a punctuation
+//     .     matches any single character except \n
+//     A?    matches 0 or 1 occurrences of A
+//     A*    matches 0 or many occurrences of A
+//     A+    matches 1 or many occurrences of A
+//     ^     matches the beginning of a string (not that of each line)
+//     $     matches the end of a string (not that of each line)
+//     xy    matches x followed by y
+//
+//   If you accidentally use PCRE or POSIX extended regex features
+//   not implemented by us, you will get a run-time failure.  In that
+//   case, please try to rewrite your regular expression within the
+//   above syntax.
+//
+//   This implementation is *not* meant to be as highly tuned or robust
+//   as a compiled regex library, but should perform well enough for a
+//   death test, which already incurs significant overhead by launching
+//   a child process.
+//
+// Known caveats:
+//
+//   A "threadsafe" style death test obtains the path to the test
+//   program from argv[0] and re-executes it in the sub-process.  For
+//   simplicity, the current implementation doesn't search the PATH
+//   when launching the sub-process.  This means that the user must
+//   invoke the test program via a path that contains at least one
+//   path separator (e.g. path/to/foo_test and
+//   /absolute/path/to/bar_test are fine, but foo_test is not).  This
+//   is rarely a problem as people usually don't put the test binary
+//   directory in PATH.
+//
+// TODO(wan@google.com): make thread-safe death tests search the PATH.
+
+// Asserts that a given statement causes the program to exit, with an
+// integer exit status that satisfies predicate, and emitting error output
+// that matches regex.
+# define ASSERT_EXIT(statement, predicate, regex) \
+    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
+
+// Like ASSERT_EXIT, but continues on to successive tests in the
+// test case, if any:
+# define EXPECT_EXIT(statement, predicate, regex) \
+    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
+
+// Asserts that a given statement causes the program to exit, either by
+// explicitly exiting with a nonzero exit code or being killed by a
+// signal, and emitting error output that matches regex.
+# define ASSERT_DEATH(statement, regex) \
+    ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+
+// Like ASSERT_DEATH, but continues on to successive tests in the
+// test case, if any:
+# define EXPECT_DEATH(statement, regex) \
+    EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+
+// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
+
+// Tests that an exit code describes a normal exit with a given exit code.
+class GTEST_API_ ExitedWithCode {
+ public:
+  explicit ExitedWithCode(int exit_code);
+  bool operator()(int exit_status) const;
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ExitedWithCode& other);
+
+  const int exit_code_;
+};
+
+# if !GTEST_OS_WINDOWS
+// Tests that an exit code describes an exit due to termination by a
+// given signal.
+class GTEST_API_ KilledBySignal {
+ public:
+  explicit KilledBySignal(int signum);
+  bool operator()(int exit_status) const;
+ private:
+  const int signum_;
+};
+# endif  // !GTEST_OS_WINDOWS
+
+// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
+// The death testing framework causes this to have interesting semantics,
+// since the sideeffects of the call are only visible in opt mode, and not
+// in debug mode.
+//
+// In practice, this can be used to test functions that utilize the
+// LOG(DFATAL) macro using the following style:
+//
+// int DieInDebugOr12(int* sideeffect) {
+//   if (sideeffect) {
+//     *sideeffect = 12;
+//   }
+//   LOG(DFATAL) << "death";
+//   return 12;
+// }
+//
+// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
+//   int sideeffect = 0;
+//   // Only asserts in dbg.
+//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
+//
+// #ifdef NDEBUG
+//   // opt-mode has sideeffect visible.
+//   EXPECT_EQ(12, sideeffect);
+// #else
+//   // dbg-mode no visible sideeffect.
+//   EXPECT_EQ(0, sideeffect);
+// #endif
+// }
+//
+// This will assert that DieInDebugReturn12InOpt() crashes in debug
+// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
+// appropriate fallback value (12 in this case) in opt mode. If you
+// need to test that a function has appropriate side-effects in opt
+// mode, include assertions against the side-effects.  A general
+// pattern for this is:
+//
+// EXPECT_DEBUG_DEATH({
+//   // Side-effects here will have an effect after this statement in
+//   // opt mode, but none in debug mode.
+//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
+// }, "death");
+//
+# ifdef NDEBUG
+
+#  define EXPECT_DEBUG_DEATH(statement, regex) \
+  GTEST_EXECUTE_STATEMENT_(statement, regex)
+
+#  define ASSERT_DEBUG_DEATH(statement, regex) \
+  GTEST_EXECUTE_STATEMENT_(statement, regex)
+
+# else
+
+#  define EXPECT_DEBUG_DEATH(statement, regex) \
+  EXPECT_DEATH(statement, regex)
+
+#  define ASSERT_DEBUG_DEATH(statement, regex) \
+  ASSERT_DEATH(statement, regex)
+
+# endif  // NDEBUG for EXPECT_DEBUG_DEATH
+#endif  // GTEST_HAS_DEATH_TEST
+
+// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
+// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
+// death tests are supported; otherwise they just issue a warning.  This is
+// useful when you are combining death test assertions with normal test
+// assertions in one test.
+#if GTEST_HAS_DEATH_TEST
+# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
+    EXPECT_DEATH(statement, regex)
+# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
+    ASSERT_DEATH(statement, regex)
+#else
+# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
+    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
+# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
+    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
+#endif
+
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-message.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-message.h
new file mode 100644
index 0000000..fe879bc
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-message.h
@@ -0,0 +1,250 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the Message class.
+//
+// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
+// leave some internal implementation details in this header file.
+// They are clearly marked by comments like this:
+//
+//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+//
+// Such code is NOT meant to be used by a user directly, and is subject
+// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
+// program!
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
+#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
+
+#include <limits>
+
+#include "gtest/internal/gtest-port.h"
+
+// Ensures that there is at least one operator<< in the global namespace.
+// See Message& operator<<(...) below for why.
+void operator<<(const testing::internal::Secret&, int);
+
+namespace testing {
+
+// The Message class works like an ostream repeater.
+//
+// Typical usage:
+//
+//   1. You stream a bunch of values to a Message object.
+//      It will remember the text in a stringstream.
+//   2. Then you stream the Message object to an ostream.
+//      This causes the text in the Message to be streamed
+//      to the ostream.
+//
+// For example;
+//
+//   testing::Message foo;
+//   foo << 1 << " != " << 2;
+//   std::cout << foo;
+//
+// will print "1 != 2".
+//
+// Message is not intended to be inherited from.  In particular, its
+// destructor is not virtual.
+//
+// Note that stringstream behaves differently in gcc and in MSVC.  You
+// can stream a NULL char pointer to it in the former, but not in the
+// latter (it causes an access violation if you do).  The Message
+// class hides this difference by treating a NULL char pointer as
+// "(null)".
+class GTEST_API_ Message {
+ private:
+  // The type of basic IO manipulators (endl, ends, and flush) for
+  // narrow streams.
+  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
+
+ public:
+  // Constructs an empty Message.
+  Message();
+
+  // Copy constructor.
+  Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
+    *ss_ << msg.GetString();
+  }
+
+  // Constructs a Message from a C-string.
+  explicit Message(const char* str) : ss_(new ::std::stringstream) {
+    *ss_ << str;
+  }
+
+#if GTEST_OS_SYMBIAN
+  // Streams a value (either a pointer or not) to this object.
+  template <typename T>
+  inline Message& operator <<(const T& value) {
+    StreamHelper(typename internal::is_pointer<T>::type(), value);
+    return *this;
+  }
+#else
+  // Streams a non-pointer value to this object.
+  template <typename T>
+  inline Message& operator <<(const T& val) {
+    // Some libraries overload << for STL containers.  These
+    // overloads are defined in the global namespace instead of ::std.
+    //
+    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
+    // overloads are visible in either the std namespace or the global
+    // namespace, but not other namespaces, including the testing
+    // namespace which Google Test's Message class is in.
+    //
+    // To allow STL containers (and other types that has a << operator
+    // defined in the global namespace) to be used in Google Test
+    // assertions, testing::Message must access the custom << operator
+    // from the global namespace.  With this using declaration,
+    // overloads of << defined in the global namespace and those
+    // visible via Koenig lookup are both exposed in this function.
+    using ::operator <<;
+    *ss_ << val;
+    return *this;
+  }
+
+  // Streams a pointer value to this object.
+  //
+  // This function is an overload of the previous one.  When you
+  // stream a pointer to a Message, this definition will be used as it
+  // is more specialized.  (The C++ Standard, section
+  // [temp.func.order].)  If you stream a non-pointer, then the
+  // previous definition will be used.
+  //
+  // The reason for this overload is that streaming a NULL pointer to
+  // ostream is undefined behavior.  Depending on the compiler, you
+  // may get "0", "(nil)", "(null)", or an access violation.  To
+  // ensure consistent result across compilers, we always treat NULL
+  // as "(null)".
+  template <typename T>
+  inline Message& operator <<(T* const& pointer) {  // NOLINT
+    if (pointer == NULL) {
+      *ss_ << "(null)";
+    } else {
+      *ss_ << pointer;
+    }
+    return *this;
+  }
+#endif  // GTEST_OS_SYMBIAN
+
+  // Since the basic IO manipulators are overloaded for both narrow
+  // and wide streams, we have to provide this specialized definition
+  // of operator <<, even though its body is the same as the
+  // templatized version above.  Without this definition, streaming
+  // endl or other basic IO manipulators to Message will confuse the
+  // compiler.
+  Message& operator <<(BasicNarrowIoManip val) {
+    *ss_ << val;
+    return *this;
+  }
+
+  // Instead of 1/0, we want to see true/false for bool values.
+  Message& operator <<(bool b) {
+    return *this << (b ? "true" : "false");
+  }
+
+  // These two overloads allow streaming a wide C string to a Message
+  // using the UTF-8 encoding.
+  Message& operator <<(const wchar_t* wide_c_str);
+  Message& operator <<(wchar_t* wide_c_str);
+
+#if GTEST_HAS_STD_WSTRING
+  // Converts the given wide string to a narrow string using the UTF-8
+  // encoding, and streams the result to this Message object.
+  Message& operator <<(const ::std::wstring& wstr);
+#endif  // GTEST_HAS_STD_WSTRING
+
+#if GTEST_HAS_GLOBAL_WSTRING
+  // Converts the given wide string to a narrow string using the UTF-8
+  // encoding, and streams the result to this Message object.
+  Message& operator <<(const ::wstring& wstr);
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+  // Gets the text streamed to this object so far as an std::string.
+  // Each '\0' character in the buffer is replaced with "\\0".
+  //
+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+  std::string GetString() const;
+
+ private:
+
+#if GTEST_OS_SYMBIAN
+  // These are needed as the Nokia Symbian Compiler cannot decide between
+  // const T& and const T* in a function template. The Nokia compiler _can_
+  // decide between class template specializations for T and T*, so a
+  // tr1::type_traits-like is_pointer works, and we can overload on that.
+  template <typename T>
+  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
+    if (pointer == NULL) {
+      *ss_ << "(null)";
+    } else {
+      *ss_ << pointer;
+    }
+  }
+  template <typename T>
+  inline void StreamHelper(internal::false_type /*is_pointer*/,
+                           const T& value) {
+    // See the comments in Message& operator <<(const T&) above for why
+    // we need this using statement.
+    using ::operator <<;
+    *ss_ << value;
+  }
+#endif  // GTEST_OS_SYMBIAN
+
+  // We'll hold the text streamed to this object here.
+  const internal::scoped_ptr< ::std::stringstream> ss_;
+
+  // We declare (but don't implement) this to prevent the compiler
+  // from implementing the assignment operator.
+  void operator=(const Message&);
+};
+
+// Streams a Message to an ostream.
+inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
+  return os << sb.GetString();
+}
+
+namespace internal {
+
+// Converts a streamable value to an std::string.  A NULL pointer is
+// converted to "(null)".  When the input value is a ::string,
+// ::std::string, ::wstring, or ::std::wstring object, each NUL
+// character in it is replaced with "\\0".
+template <typename T>
+std::string StreamableToString(const T& streamable) {
+  return (Message() << streamable).GetString();
+}
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-param-test.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-param-test.h
new file mode 100644
index 0000000..038f9ba
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-param-test.h
@@ -0,0 +1,1444 @@
+// This file was GENERATED by command:
+//     pump.py gtest-param-test.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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.
+//
+// Authors: vladl@google.com (Vlad Losev)
+//
+// Macros and functions for implementing parameterized tests
+// in Google C++ Testing Framework (Google Test)
+//
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+
+
+// Value-parameterized tests allow you to test your code with different
+// parameters without writing multiple copies of the same test.
+//
+// Here is how you use value-parameterized tests:
+
+#if 0
+
+// To write value-parameterized tests, first you should define a fixture
+// class. It is usually derived from testing::TestWithParam<T> (see below for
+// another inheritance scheme that's sometimes useful in more complicated
+// class hierarchies), where the type of your parameter values.
+// TestWithParam<T> is itself derived from testing::Test. T can be any
+// copyable type. If it's a raw pointer, you are responsible for managing the
+// lifespan of the pointed values.
+
+class FooTest : public ::testing::TestWithParam<const char*> {
+  // You can implement all the usual class fixture members here.
+};
+
+// Then, use the TEST_P macro to define as many parameterized tests
+// for this fixture as you want. The _P suffix is for "parameterized"
+// or "pattern", whichever you prefer to think.
+
+TEST_P(FooTest, DoesBlah) {
+  // Inside a test, access the test parameter with the GetParam() method
+  // of the TestWithParam<T> class:
+  EXPECT_TRUE(foo.Blah(GetParam()));
+  ...
+}
+
+TEST_P(FooTest, HasBlahBlah) {
+  ...
+}
+
+// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
+// case with any set of parameters you want. Google Test defines a number
+// of functions for generating test parameters. They return what we call
+// (surprise!) parameter generators. Here is a  summary of them, which
+// are all in the testing namespace:
+//
+//
+//  Range(begin, end [, step]) - Yields values {begin, begin+step,
+//                               begin+step+step, ...}. The values do not
+//                               include end. step defaults to 1.
+//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
+//  ValuesIn(container)        - Yields values from a C-style array, an STL
+//  ValuesIn(begin,end)          container, or an iterator range [begin, end).
+//  Bool()                     - Yields sequence {false, true}.
+//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
+//                               for the math savvy) of the values generated
+//                               by the N generators.
+//
+// For more details, see comments at the definitions of these functions below
+// in this file.
+//
+// The following statement will instantiate tests from the FooTest test case
+// each with parameter values "meeny", "miny", and "moe".
+
+INSTANTIATE_TEST_CASE_P(InstantiationName,
+                        FooTest,
+                        Values("meeny", "miny", "moe"));
+
+// To distinguish different instances of the pattern, (yes, you
+// can instantiate it more then once) the first argument to the
+// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
+// actual test case name. Remember to pick unique prefixes for different
+// instantiations. The tests from the instantiation above will have
+// these names:
+//
+//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
+//    * InstantiationName/FooTest.DoesBlah/1 for "miny"
+//    * InstantiationName/FooTest.DoesBlah/2 for "moe"
+//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
+//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
+//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
+//
+// You can use these names in --gtest_filter.
+//
+// This statement will instantiate all tests from FooTest again, each
+// with parameter values "cat" and "dog":
+
+const char* pets[] = {"cat", "dog"};
+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
+
+// The tests from the instantiation above will have these names:
+//
+//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
+//
+// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
+// in the given test case, whether their definitions come before or
+// AFTER the INSTANTIATE_TEST_CASE_P statement.
+//
+// Please also note that generator expressions (including parameters to the
+// generators) are evaluated in InitGoogleTest(), after main() has started.
+// This allows the user on one hand, to adjust generator parameters in order
+// to dynamically determine a set of tests to run and on the other hand,
+// give the user a chance to inspect the generated tests with Google Test
+// reflection API before RUN_ALL_TESTS() is executed.
+//
+// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
+// for more examples.
+//
+// In the future, we plan to publish the API for defining new parameter
+// generators. But for now this interface remains part of the internal
+// implementation and is subject to change.
+//
+//
+// A parameterized test fixture must be derived from testing::Test and from
+// testing::WithParamInterface<T>, where T is the type of the parameter
+// values. Inheriting from TestWithParam<T> satisfies that requirement because
+// TestWithParam<T> inherits from both Test and WithParamInterface. In more
+// complicated hierarchies, however, it is occasionally useful to inherit
+// separately from Test and WithParamInterface. For example:
+
+class BaseTest : public ::testing::Test {
+  // You can inherit all the usual members for a non-parameterized test
+  // fixture here.
+};
+
+class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
+  // The usual test fixture members go here too.
+};
+
+TEST_F(BaseTest, HasFoo) {
+  // This is an ordinary non-parameterized test.
+}
+
+TEST_P(DerivedTest, DoesBlah) {
+  // GetParam works just the same here as if you inherit from TestWithParam.
+  EXPECT_TRUE(foo.Blah(GetParam()));
+}
+
+#endif  // 0
+
+#include "gtest/internal/gtest-port.h"
+
+#if !GTEST_OS_SYMBIAN
+# include <utility>
+#endif
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-param-util-generated.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Functions producing parameter generators.
+//
+// Google Test uses these generators to produce parameters for value-
+// parameterized tests. When a parameterized test case is instantiated
+// with a particular generator, Google Test creates and runs tests
+// for each element in the sequence produced by the generator.
+//
+// In the following sample, tests from test case FooTest are instantiated
+// each three times with parameter values 3, 5, and 8:
+//
+// class FooTest : public TestWithParam<int> { ... };
+//
+// TEST_P(FooTest, TestThis) {
+// }
+// TEST_P(FooTest, TestThat) {
+// }
+// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
+//
+
+// Range() returns generators providing sequences of values in a range.
+//
+// Synopsis:
+// Range(start, end)
+//   - returns a generator producing a sequence of values {start, start+1,
+//     start+2, ..., }.
+// Range(start, end, step)
+//   - returns a generator producing a sequence of values {start, start+step,
+//     start+step+step, ..., }.
+// Notes:
+//   * The generated sequences never include end. For example, Range(1, 5)
+//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
+//     returns a generator producing {1, 3, 5, 7}.
+//   * start and end must have the same type. That type may be any integral or
+//     floating-point type or a user defined type satisfying these conditions:
+//     * It must be assignable (have operator=() defined).
+//     * It must have operator+() (operator+(int-compatible type) for
+//       two-operand version).
+//     * It must have operator<() defined.
+//     Elements in the resulting sequences will also have that type.
+//   * Condition start < end must be satisfied in order for resulting sequences
+//     to contain any elements.
+//
+template <typename T, typename IncrementT>
+internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
+  return internal::ParamGenerator<T>(
+      new internal::RangeGenerator<T, IncrementT>(start, end, step));
+}
+
+template <typename T>
+internal::ParamGenerator<T> Range(T start, T end) {
+  return Range(start, end, 1);
+}
+
+// ValuesIn() function allows generation of tests with parameters coming from
+// a container.
+//
+// Synopsis:
+// ValuesIn(const T (&array)[N])
+//   - returns a generator producing sequences with elements from
+//     a C-style array.
+// ValuesIn(const Container& container)
+//   - returns a generator producing sequences with elements from
+//     an STL-style container.
+// ValuesIn(Iterator begin, Iterator end)
+//   - returns a generator producing sequences with elements from
+//     a range [begin, end) defined by a pair of STL-style iterators. These
+//     iterators can also be plain C pointers.
+//
+// Please note that ValuesIn copies the values from the containers
+// passed in and keeps them to generate tests in RUN_ALL_TESTS().
+//
+// Examples:
+//
+// This instantiates tests from test case StringTest
+// each with C-string values of "foo", "bar", and "baz":
+//
+// const char* strings[] = {"foo", "bar", "baz"};
+// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
+//
+// This instantiates tests from test case StlStringTest
+// each with STL strings with values "a" and "b":
+//
+// ::std::vector< ::std::string> GetParameterStrings() {
+//   ::std::vector< ::std::string> v;
+//   v.push_back("a");
+//   v.push_back("b");
+//   return v;
+// }
+//
+// INSTANTIATE_TEST_CASE_P(CharSequence,
+//                         StlStringTest,
+//                         ValuesIn(GetParameterStrings()));
+//
+//
+// This will also instantiate tests from CharTest
+// each with parameter values 'a' and 'b':
+//
+// ::std::list<char> GetParameterChars() {
+//   ::std::list<char> list;
+//   list.push_back('a');
+//   list.push_back('b');
+//   return list;
+// }
+// ::std::list<char> l = GetParameterChars();
+// INSTANTIATE_TEST_CASE_P(CharSequence2,
+//                         CharTest,
+//                         ValuesIn(l.begin(), l.end()));
+//
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end) {
+  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
+      ::value_type ParamType;
+  return internal::ParamGenerator<ParamType>(
+      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
+}
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
+  return ValuesIn(array, array + N);
+}
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container) {
+  return ValuesIn(container.begin(), container.end());
+}
+
+// Values() allows generating tests from explicitly specified list of
+// parameters.
+//
+// Synopsis:
+// Values(T v1, T v2, ..., T vN)
+//   - returns a generator producing sequences with elements v1, v2, ..., vN.
+//
+// For example, this instantiates tests from test case BarTest each
+// with values "one", "two", and "three":
+//
+// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
+//
+// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
+// The exact type of values will depend on the type of parameter in BazTest.
+//
+// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
+//
+// Currently, Values() supports from 1 to 50 parameters.
+//
+template <typename T1>
+internal::ValueArray1<T1> Values(T1 v1) {
+  return internal::ValueArray1<T1>(v1);
+}
+
+template <typename T1, typename T2>
+internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
+  return internal::ValueArray2<T1, T2>(v1, v2);
+}
+
+template <typename T1, typename T2, typename T3>
+internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
+  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
+  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5) {
+  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6) {
+  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6, T7 v7) {
+  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
+      v6, v7);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
+  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
+      v5, v6, v7, v8);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
+  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
+      v4, v5, v6, v7, v8, v9);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
+  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
+      v2, v3, v4, v5, v6, v7, v8, v9, v10);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
+    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11) {
+  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
+      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12) {
+  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13) {
+  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
+  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
+      v14);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
+  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
+      v13, v14, v15);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16) {
+  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
+      v12, v13, v14, v15, v16);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17) {
+  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
+      v11, v12, v13, v14, v15, v16, v17);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18) {
+  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
+      v10, v11, v12, v13, v14, v15, v16, v17, v18);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
+  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
+  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
+  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22) {
+  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23) {
+  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
+      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24) {
+  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
+      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
+      v19, v20, v21, v22, v23, v24);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
+    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
+    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
+  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
+      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
+      v18, v19, v20, v21, v22, v23, v24, v25);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26) {
+  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
+      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27) {
+  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
+      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28) {
+  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
+      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
+      v28);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29) {
+  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
+      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
+      v27, v28, v29);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
+    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
+    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
+  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
+      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
+      v26, v27, v28, v29, v30);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
+  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
+      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
+      v25, v26, v27, v28, v29, v30, v31);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32) {
+  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
+      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33) {
+  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
+    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
+    T31 v31, T32 v32, T33 v33, T34 v34) {
+  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
+      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
+  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
+      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
+  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
+      v34, v35, v36);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
+    T37 v37) {
+  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
+      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
+      v34, v35, v36, v37);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
+    T37 v37, T38 v38) {
+  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
+      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
+      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
+      v33, v34, v35, v36, v37, v38);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
+    T37 v37, T38 v38, T39 v39) {
+  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
+      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
+      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
+      v32, v33, v34, v35, v36, v37, v38, v39);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
+    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
+    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
+    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
+    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
+  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
+      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
+      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
+  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
+      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
+      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+    T42 v42) {
+  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
+      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
+      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
+      v42);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+    T42 v42, T43 v43) {
+  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
+      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
+      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
+      v41, v42, v43);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+    T42 v42, T43 v43, T44 v44) {
+  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
+      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
+      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
+      v40, v41, v42, v43, v44);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
+    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
+    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
+    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
+    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
+  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
+      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
+      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
+      v39, v40, v41, v42, v43, v44, v45);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
+  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
+      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
+      v38, v39, v40, v41, v42, v43, v44, v45, v46);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
+  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
+      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
+    T48 v48) {
+  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
+      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
+      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
+    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
+    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
+    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
+    T47 v47, T48 v48, T49 v49) {
+  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
+      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
+      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
+    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
+    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
+  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
+      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
+      v48, v49, v50);
+}
+
+// Bool() allows generating tests with parameters in a set of (false, true).
+//
+// Synopsis:
+// Bool()
+//   - returns a generator producing sequences with elements {false, true}.
+//
+// It is useful when testing code that depends on Boolean flags. Combinations
+// of multiple flags can be tested when several Bool()'s are combined using
+// Combine() function.
+//
+// In the following example all tests in the test case FlagDependentTest
+// will be instantiated twice with parameters false and true.
+//
+// class FlagDependentTest : public testing::TestWithParam<bool> {
+//   virtual void SetUp() {
+//     external_flag = GetParam();
+//   }
+// }
+// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
+//
+inline internal::ParamGenerator<bool> Bool() {
+  return Values(false, true);
+}
+
+# if GTEST_HAS_COMBINE
+// Combine() allows the user to combine two or more sequences to produce
+// values of a Cartesian product of those sequences' elements.
+//
+// Synopsis:
+// Combine(gen1, gen2, ..., genN)
+//   - returns a generator producing sequences with elements coming from
+//     the Cartesian product of elements from the sequences generated by
+//     gen1, gen2, ..., genN. The sequence elements will have a type of
+//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
+//     of elements from sequences produces by gen1, gen2, ..., genN.
+//
+// Combine can have up to 10 arguments. This number is currently limited
+// by the maximum number of elements in the tuple implementation used by Google
+// Test.
+//
+// Example:
+//
+// This will instantiate tests in test case AnimalTest each one with
+// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
+// tuple("dog", BLACK), and tuple("dog", WHITE):
+//
+// enum Color { BLACK, GRAY, WHITE };
+// class AnimalTest
+//     : public testing::TestWithParam<tuple<const char*, Color> > {...};
+//
+// TEST_P(AnimalTest, AnimalLooksNice) {...}
+//
+// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
+//                         Combine(Values("cat", "dog"),
+//                                 Values(BLACK, WHITE)));
+//
+// This will instantiate tests in FlagDependentTest with all variations of two
+// Boolean flags:
+//
+// class FlagDependentTest
+//     : public testing::TestWithParam<tuple<bool, bool> > {
+//   virtual void SetUp() {
+//     // Assigns external_flag_1 and external_flag_2 values from the tuple.
+//     tie(external_flag_1, external_flag_2) = GetParam();
+//   }
+// };
+//
+// TEST_P(FlagDependentTest, TestFeature1) {
+//   // Test your code using external_flag_1 and external_flag_2 here.
+// }
+// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
+//                         Combine(Bool(), Bool()));
+//
+template <typename Generator1, typename Generator2>
+internal::CartesianProductHolder2<Generator1, Generator2> Combine(
+    const Generator1& g1, const Generator2& g2) {
+  return internal::CartesianProductHolder2<Generator1, Generator2>(
+      g1, g2);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3>
+internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3) {
+  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
+      g1, g2, g3);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4>
+internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
+    Generator4> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4) {
+  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
+      Generator4>(
+      g1, g2, g3, g4);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5>
+internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
+    Generator4, Generator5> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5) {
+  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
+      Generator4, Generator5>(
+      g1, g2, g3, g4, g5);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6>
+internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6) {
+  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6>(
+      g1, g2, g3, g4, g5, g6);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7>
+internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7) {
+  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7>(
+      g1, g2, g3, g4, g5, g6, g7);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7, typename Generator8>
+internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7, const Generator8& g8) {
+  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7, Generator8>(
+      g1, g2, g3, g4, g5, g6, g7, g8);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7, typename Generator8, typename Generator9>
+internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7, Generator8,
+    Generator9> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7, const Generator8& g8, const Generator9& g9) {
+  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
+      g1, g2, g3, g4, g5, g6, g7, g8, g9);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7, typename Generator8, typename Generator9,
+    typename Generator10>
+internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
+    Generator10> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7, const Generator8& g8, const Generator9& g9,
+        const Generator10& g10) {
+  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
+      Generator10>(
+      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
+}
+# endif  // GTEST_HAS_COMBINE
+
+
+
+# define TEST_P(test_case_name, test_name) \
+  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
+      : public test_case_name { \
+   public: \
+    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
+    virtual void TestBody(); \
+   private: \
+    static int AddToRegistry() { \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestPattern(\
+                      #test_case_name, \
+                      #test_name, \
+                      new ::testing::internal::TestMetaFactory< \
+                          GTEST_TEST_CLASS_NAME_(\
+                              test_case_name, test_name)>()); \
+      return 0; \
+    } \
+    static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(\
+        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
+  }; \
+  int GTEST_TEST_CLASS_NAME_(test_case_name, \
+                             test_name)::gtest_registering_dummy_ = \
+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
+  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
+
+// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
+// to specify a function or functor that generates custom test name suffixes
+// based on the test parameters. The function should accept one argument of
+// type testing::TestParamInfo<class ParamType>, and return std::string.
+//
+// testing::PrintToStringParamName is a builtin test suffix generator that
+// returns the value of testing::PrintToString(GetParam()). It does not work
+// for std::string or C strings.
+//
+// Note: test names must be non-empty, unique, and may only contain ASCII
+// alphanumeric characters or underscore.
+
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
+  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
+  ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+      const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+    return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+        (__VA_ARGS__)(info); \
+  } \
+  int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestCaseInstantiation(\
+                      #prefix, \
+                      &gtest_##prefix##test_case_name##_EvalGenerator_, \
+                      &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+                      __FILE__, __LINE__)
+
+}  // namespace testing
+
+#endif  // GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump
new file mode 100644
index 0000000..3078d6d
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump
@@ -0,0 +1,510 @@
+$$ -*- mode: c++; -*-
+$var n = 50  $$ Maximum length of Values arguments we want to support.
+$var maxtuple = 10  $$ Maximum number of Combine arguments we want to support.
+// 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.
+//
+// Authors: vladl@google.com (Vlad Losev)
+//
+// Macros and functions for implementing parameterized tests
+// in Google C++ Testing Framework (Google Test)
+//
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+
+
+// Value-parameterized tests allow you to test your code with different
+// parameters without writing multiple copies of the same test.
+//
+// Here is how you use value-parameterized tests:
+
+#if 0
+
+// To write value-parameterized tests, first you should define a fixture
+// class. It is usually derived from testing::TestWithParam<T> (see below for
+// another inheritance scheme that's sometimes useful in more complicated
+// class hierarchies), where the type of your parameter values.
+// TestWithParam<T> is itself derived from testing::Test. T can be any
+// copyable type. If it's a raw pointer, you are responsible for managing the
+// lifespan of the pointed values.
+
+class FooTest : public ::testing::TestWithParam<const char*> {
+  // You can implement all the usual class fixture members here.
+};
+
+// Then, use the TEST_P macro to define as many parameterized tests
+// for this fixture as you want. The _P suffix is for "parameterized"
+// or "pattern", whichever you prefer to think.
+
+TEST_P(FooTest, DoesBlah) {
+  // Inside a test, access the test parameter with the GetParam() method
+  // of the TestWithParam<T> class:
+  EXPECT_TRUE(foo.Blah(GetParam()));
+  ...
+}
+
+TEST_P(FooTest, HasBlahBlah) {
+  ...
+}
+
+// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
+// case with any set of parameters you want. Google Test defines a number
+// of functions for generating test parameters. They return what we call
+// (surprise!) parameter generators. Here is a  summary of them, which
+// are all in the testing namespace:
+//
+//
+//  Range(begin, end [, step]) - Yields values {begin, begin+step,
+//                               begin+step+step, ...}. The values do not
+//                               include end. step defaults to 1.
+//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
+//  ValuesIn(container)        - Yields values from a C-style array, an STL
+//  ValuesIn(begin,end)          container, or an iterator range [begin, end).
+//  Bool()                     - Yields sequence {false, true}.
+//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
+//                               for the math savvy) of the values generated
+//                               by the N generators.
+//
+// For more details, see comments at the definitions of these functions below
+// in this file.
+//
+// The following statement will instantiate tests from the FooTest test case
+// each with parameter values "meeny", "miny", and "moe".
+
+INSTANTIATE_TEST_CASE_P(InstantiationName,
+                        FooTest,
+                        Values("meeny", "miny", "moe"));
+
+// To distinguish different instances of the pattern, (yes, you
+// can instantiate it more then once) the first argument to the
+// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
+// actual test case name. Remember to pick unique prefixes for different
+// instantiations. The tests from the instantiation above will have
+// these names:
+//
+//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
+//    * InstantiationName/FooTest.DoesBlah/1 for "miny"
+//    * InstantiationName/FooTest.DoesBlah/2 for "moe"
+//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
+//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
+//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
+//
+// You can use these names in --gtest_filter.
+//
+// This statement will instantiate all tests from FooTest again, each
+// with parameter values "cat" and "dog":
+
+const char* pets[] = {"cat", "dog"};
+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
+
+// The tests from the instantiation above will have these names:
+//
+//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
+//
+// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
+// in the given test case, whether their definitions come before or
+// AFTER the INSTANTIATE_TEST_CASE_P statement.
+//
+// Please also note that generator expressions (including parameters to the
+// generators) are evaluated in InitGoogleTest(), after main() has started.
+// This allows the user on one hand, to adjust generator parameters in order
+// to dynamically determine a set of tests to run and on the other hand,
+// give the user a chance to inspect the generated tests with Google Test
+// reflection API before RUN_ALL_TESTS() is executed.
+//
+// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
+// for more examples.
+//
+// In the future, we plan to publish the API for defining new parameter
+// generators. But for now this interface remains part of the internal
+// implementation and is subject to change.
+//
+//
+// A parameterized test fixture must be derived from testing::Test and from
+// testing::WithParamInterface<T>, where T is the type of the parameter
+// values. Inheriting from TestWithParam<T> satisfies that requirement because
+// TestWithParam<T> inherits from both Test and WithParamInterface. In more
+// complicated hierarchies, however, it is occasionally useful to inherit
+// separately from Test and WithParamInterface. For example:
+
+class BaseTest : public ::testing::Test {
+  // You can inherit all the usual members for a non-parameterized test
+  // fixture here.
+};
+
+class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
+  // The usual test fixture members go here too.
+};
+
+TEST_F(BaseTest, HasFoo) {
+  // This is an ordinary non-parameterized test.
+}
+
+TEST_P(DerivedTest, DoesBlah) {
+  // GetParam works just the same here as if you inherit from TestWithParam.
+  EXPECT_TRUE(foo.Blah(GetParam()));
+}
+
+#endif  // 0
+
+#include "gtest/internal/gtest-port.h"
+
+#if !GTEST_OS_SYMBIAN
+# include <utility>
+#endif
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-param-util-generated.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Functions producing parameter generators.
+//
+// Google Test uses these generators to produce parameters for value-
+// parameterized tests. When a parameterized test case is instantiated
+// with a particular generator, Google Test creates and runs tests
+// for each element in the sequence produced by the generator.
+//
+// In the following sample, tests from test case FooTest are instantiated
+// each three times with parameter values 3, 5, and 8:
+//
+// class FooTest : public TestWithParam<int> { ... };
+//
+// TEST_P(FooTest, TestThis) {
+// }
+// TEST_P(FooTest, TestThat) {
+// }
+// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
+//
+
+// Range() returns generators providing sequences of values in a range.
+//
+// Synopsis:
+// Range(start, end)
+//   - returns a generator producing a sequence of values {start, start+1,
+//     start+2, ..., }.
+// Range(start, end, step)
+//   - returns a generator producing a sequence of values {start, start+step,
+//     start+step+step, ..., }.
+// Notes:
+//   * The generated sequences never include end. For example, Range(1, 5)
+//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
+//     returns a generator producing {1, 3, 5, 7}.
+//   * start and end must have the same type. That type may be any integral or
+//     floating-point type or a user defined type satisfying these conditions:
+//     * It must be assignable (have operator=() defined).
+//     * It must have operator+() (operator+(int-compatible type) for
+//       two-operand version).
+//     * It must have operator<() defined.
+//     Elements in the resulting sequences will also have that type.
+//   * Condition start < end must be satisfied in order for resulting sequences
+//     to contain any elements.
+//
+template <typename T, typename IncrementT>
+internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
+  return internal::ParamGenerator<T>(
+      new internal::RangeGenerator<T, IncrementT>(start, end, step));
+}
+
+template <typename T>
+internal::ParamGenerator<T> Range(T start, T end) {
+  return Range(start, end, 1);
+}
+
+// ValuesIn() function allows generation of tests with parameters coming from
+// a container.
+//
+// Synopsis:
+// ValuesIn(const T (&array)[N])
+//   - returns a generator producing sequences with elements from
+//     a C-style array.
+// ValuesIn(const Container& container)
+//   - returns a generator producing sequences with elements from
+//     an STL-style container.
+// ValuesIn(Iterator begin, Iterator end)
+//   - returns a generator producing sequences with elements from
+//     a range [begin, end) defined by a pair of STL-style iterators. These
+//     iterators can also be plain C pointers.
+//
+// Please note that ValuesIn copies the values from the containers
+// passed in and keeps them to generate tests in RUN_ALL_TESTS().
+//
+// Examples:
+//
+// This instantiates tests from test case StringTest
+// each with C-string values of "foo", "bar", and "baz":
+//
+// const char* strings[] = {"foo", "bar", "baz"};
+// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
+//
+// This instantiates tests from test case StlStringTest
+// each with STL strings with values "a" and "b":
+//
+// ::std::vector< ::std::string> GetParameterStrings() {
+//   ::std::vector< ::std::string> v;
+//   v.push_back("a");
+//   v.push_back("b");
+//   return v;
+// }
+//
+// INSTANTIATE_TEST_CASE_P(CharSequence,
+//                         StlStringTest,
+//                         ValuesIn(GetParameterStrings()));
+//
+//
+// This will also instantiate tests from CharTest
+// each with parameter values 'a' and 'b':
+//
+// ::std::list<char> GetParameterChars() {
+//   ::std::list<char> list;
+//   list.push_back('a');
+//   list.push_back('b');
+//   return list;
+// }
+// ::std::list<char> l = GetParameterChars();
+// INSTANTIATE_TEST_CASE_P(CharSequence2,
+//                         CharTest,
+//                         ValuesIn(l.begin(), l.end()));
+//
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end) {
+  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
+      ::value_type ParamType;
+  return internal::ParamGenerator<ParamType>(
+      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
+}
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
+  return ValuesIn(array, array + N);
+}
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container) {
+  return ValuesIn(container.begin(), container.end());
+}
+
+// Values() allows generating tests from explicitly specified list of
+// parameters.
+//
+// Synopsis:
+// Values(T v1, T v2, ..., T vN)
+//   - returns a generator producing sequences with elements v1, v2, ..., vN.
+//
+// For example, this instantiates tests from test case BarTest each
+// with values "one", "two", and "three":
+//
+// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
+//
+// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
+// The exact type of values will depend on the type of parameter in BazTest.
+//
+// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
+//
+// Currently, Values() supports from 1 to $n parameters.
+//
+$range i 1..n
+$for i [[
+$range j 1..i
+
+template <$for j, [[typename T$j]]>
+internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) {
+  return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]);
+}
+
+]]
+
+// Bool() allows generating tests with parameters in a set of (false, true).
+//
+// Synopsis:
+// Bool()
+//   - returns a generator producing sequences with elements {false, true}.
+//
+// It is useful when testing code that depends on Boolean flags. Combinations
+// of multiple flags can be tested when several Bool()'s are combined using
+// Combine() function.
+//
+// In the following example all tests in the test case FlagDependentTest
+// will be instantiated twice with parameters false and true.
+//
+// class FlagDependentTest : public testing::TestWithParam<bool> {
+//   virtual void SetUp() {
+//     external_flag = GetParam();
+//   }
+// }
+// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
+//
+inline internal::ParamGenerator<bool> Bool() {
+  return Values(false, true);
+}
+
+# if GTEST_HAS_COMBINE
+// Combine() allows the user to combine two or more sequences to produce
+// values of a Cartesian product of those sequences' elements.
+//
+// Synopsis:
+// Combine(gen1, gen2, ..., genN)
+//   - returns a generator producing sequences with elements coming from
+//     the Cartesian product of elements from the sequences generated by
+//     gen1, gen2, ..., genN. The sequence elements will have a type of
+//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
+//     of elements from sequences produces by gen1, gen2, ..., genN.
+//
+// Combine can have up to $maxtuple arguments. This number is currently limited
+// by the maximum number of elements in the tuple implementation used by Google
+// Test.
+//
+// Example:
+//
+// This will instantiate tests in test case AnimalTest each one with
+// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
+// tuple("dog", BLACK), and tuple("dog", WHITE):
+//
+// enum Color { BLACK, GRAY, WHITE };
+// class AnimalTest
+//     : public testing::TestWithParam<tuple<const char*, Color> > {...};
+//
+// TEST_P(AnimalTest, AnimalLooksNice) {...}
+//
+// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
+//                         Combine(Values("cat", "dog"),
+//                                 Values(BLACK, WHITE)));
+//
+// This will instantiate tests in FlagDependentTest with all variations of two
+// Boolean flags:
+//
+// class FlagDependentTest
+//     : public testing::TestWithParam<tuple<bool, bool> > {
+//   virtual void SetUp() {
+//     // Assigns external_flag_1 and external_flag_2 values from the tuple.
+//     tie(external_flag_1, external_flag_2) = GetParam();
+//   }
+// };
+//
+// TEST_P(FlagDependentTest, TestFeature1) {
+//   // Test your code using external_flag_1 and external_flag_2 here.
+// }
+// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
+//                         Combine(Bool(), Bool()));
+//
+$range i 2..maxtuple
+$for i [[
+$range j 1..i
+
+template <$for j, [[typename Generator$j]]>
+internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine(
+    $for j, [[const Generator$j& g$j]]) {
+  return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>(
+      $for j, [[g$j]]);
+}
+
+]]
+# endif  // GTEST_HAS_COMBINE
+
+
+
+# define TEST_P(test_case_name, test_name) \
+  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
+      : public test_case_name { \
+   public: \
+    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
+    virtual void TestBody(); \
+   private: \
+    static int AddToRegistry() { \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestPattern(\
+                      #test_case_name, \
+                      #test_name, \
+                      new ::testing::internal::TestMetaFactory< \
+                          GTEST_TEST_CLASS_NAME_(\
+                              test_case_name, test_name)>()); \
+      return 0; \
+    } \
+    static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(\
+        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
+  }; \
+  int GTEST_TEST_CLASS_NAME_(test_case_name, \
+                             test_name)::gtest_registering_dummy_ = \
+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
+  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
+
+// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
+// to specify a function or functor that generates custom test name suffixes
+// based on the test parameters. The function should accept one argument of
+// type testing::TestParamInfo<class ParamType>, and return std::string.
+//
+// testing::PrintToStringParamName is a builtin test suffix generator that
+// returns the value of testing::PrintToString(GetParam()).
+//
+// Note: test names must be non-empty, unique, and may only contain ASCII
+// alphanumeric characters or underscore. Because PrintToString adds quotes
+// to std::string and C strings, it won't work for these types.
+
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
+  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
+  ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+      const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+    return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+        (__VA_ARGS__)(info); \
+  } \
+  int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestCaseInstantiation(\
+                      #prefix, \
+                      &gtest_##prefix##test_case_name##_EvalGenerator_, \
+                      &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+                      __FILE__, __LINE__)
+
+}  // namespace testing
+
+#endif  // GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-printers.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-printers.h
new file mode 100644
index 0000000..8a33164
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-printers.h
@@ -0,0 +1,993 @@
+// 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 Test - The Google C++ Testing Framework
+//
+// This file implements a universal value printer that can print a
+// value of any type T:
+//
+//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
+//
+// A user can teach this function how to print a class type T by
+// defining either operator<<() or PrintTo() in the namespace that
+// defines T.  More specifically, the FIRST defined function in the
+// following list will be used (assuming T is defined in namespace
+// foo):
+//
+//   1. foo::PrintTo(const T&, ostream*)
+//   2. operator<<(ostream&, const T&) defined in either foo or the
+//      global namespace.
+//
+// If none of the above is defined, it will print the debug string of
+// the value if it is a protocol buffer, or print the raw bytes in the
+// value otherwise.
+//
+// To aid debugging: when T is a reference type, the address of the
+// value is also printed; when T is a (const) char pointer, both the
+// pointer value and the NUL-terminated string it points to are
+// printed.
+//
+// We also provide some convenient wrappers:
+//
+//   // Prints a value to a string.  For a (const or not) char
+//   // pointer, the NUL-terminated string (but not the pointer) is
+//   // printed.
+//   std::string ::testing::PrintToString(const T& value);
+//
+//   // Prints a value tersely: for a reference type, the referenced
+//   // value (but not the address) is printed; for a (const or not) char
+//   // pointer, the NUL-terminated string (but not the pointer) is
+//   // printed.
+//   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
+//
+//   // Prints value using the type inferred by the compiler.  The difference
+//   // from UniversalTersePrint() is that this function prints both the
+//   // pointer and the NUL-terminated string for a (const or not) char pointer.
+//   void ::testing::internal::UniversalPrint(const T& value, ostream*);
+//
+//   // Prints the fields of a tuple tersely to a string vector, one
+//   // element for each field. Tuple support must be enabled in
+//   // gtest-port.h.
+//   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
+//       const Tuple& value);
+//
+// Known limitation:
+//
+// The print primitives print the elements of an STL-style container
+// using the compiler-inferred type of *iter where iter is a
+// const_iterator of the container.  When const_iterator is an input
+// iterator but not a forward iterator, this inferred type may not
+// match value_type, and the print output may be incorrect.  In
+// practice, this is rarely a problem as for most containers
+// const_iterator is a forward iterator.  We'll fix this if there's an
+// actual need for it.  Note that this fix cannot rely on value_type
+// being defined as many user-defined container types don't have
+// value_type.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
+
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
+#include "gtest/internal/gtest-port.h"
+#include "gtest/internal/gtest-internal.h"
+
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>
+#endif
+
+namespace testing {
+
+// Definitions in the 'internal' and 'internal2' name spaces are
+// subject to change without notice.  DO NOT USE THEM IN USER CODE!
+namespace internal2 {
+
+// Prints the given number of bytes in the given object to the given
+// ostream.
+GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
+                                     size_t count,
+                                     ::std::ostream* os);
+
+// For selecting which printer to use when a given type has neither <<
+// nor PrintTo().
+enum TypeKind {
+  kProtobuf,              // a protobuf type
+  kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
+                          // (e.g. a named or unnamed enum type)
+  kOtherType              // anything else
+};
+
+// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
+// by the universal printer to print a value of type T when neither
+// operator<< nor PrintTo() is defined for T, where kTypeKind is the
+// "kind" of T as defined by enum TypeKind.
+template <typename T, TypeKind kTypeKind>
+class TypeWithoutFormatter {
+ public:
+  // This default version is called when kTypeKind is kOtherType.
+  static void PrintValue(const T& value, ::std::ostream* os) {
+    PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
+                         sizeof(value), os);
+  }
+};
+
+// We print a protobuf using its ShortDebugString() when the string
+// doesn't exceed this many characters; otherwise we print it using
+// DebugString() for better readability.
+const size_t kProtobufOneLinerMaxLength = 50;
+
+template <typename T>
+class TypeWithoutFormatter<T, kProtobuf> {
+ public:
+  static void PrintValue(const T& value, ::std::ostream* os) {
+    const ::testing::internal::string short_str = value.ShortDebugString();
+    const ::testing::internal::string pretty_str =
+        short_str.length() <= kProtobufOneLinerMaxLength ?
+        short_str : ("\n" + value.DebugString());
+    *os << ("<" + pretty_str + ">");
+  }
+};
+
+template <typename T>
+class TypeWithoutFormatter<T, kConvertibleToInteger> {
+ public:
+  // Since T has no << operator or PrintTo() but can be implicitly
+  // converted to BiggestInt, we print it as a BiggestInt.
+  //
+  // Most likely T is an enum type (either named or unnamed), in which
+  // case printing it as an integer is the desired behavior.  In case
+  // T is not an enum, printing it as an integer is the best we can do
+  // given that it has no user-defined printer.
+  static void PrintValue(const T& value, ::std::ostream* os) {
+    const internal::BiggestInt kBigInt = value;
+    *os << kBigInt;
+  }
+};
+
+// Prints the given value to the given ostream.  If the value is a
+// protocol message, its debug string is printed; if it's an enum or
+// of a type implicitly convertible to BiggestInt, it's printed as an
+// integer; otherwise the bytes in the value are printed.  This is
+// what UniversalPrinter<T>::Print() does when it knows nothing about
+// type T and T has neither << operator nor PrintTo().
+//
+// A user can override this behavior for a class type Foo by defining
+// a << operator in the namespace where Foo is defined.
+//
+// We put this operator in namespace 'internal2' instead of 'internal'
+// to simplify the implementation, as much code in 'internal' needs to
+// use << in STL, which would conflict with our own << were it defined
+// in 'internal'.
+//
+// Note that this operator<< takes a generic std::basic_ostream<Char,
+// CharTraits> type instead of the more restricted std::ostream.  If
+// we define it to take an std::ostream instead, we'll get an
+// "ambiguous overloads" compiler error when trying to print a type
+// Foo that supports streaming to std::basic_ostream<Char,
+// CharTraits>, as the compiler cannot tell whether
+// operator<<(std::ostream&, const T&) or
+// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
+// specific.
+template <typename Char, typename CharTraits, typename T>
+::std::basic_ostream<Char, CharTraits>& operator<<(
+    ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
+  TypeWithoutFormatter<T,
+      (internal::IsAProtocolMessage<T>::value ? kProtobuf :
+       internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
+       kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+  return os;
+}
+
+}  // namespace internal2
+}  // namespace testing
+
+// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
+// magic needed for implementing UniversalPrinter won't work.
+namespace testing_internal {
+
+// Used to print a value that is not an STL-style container when the
+// user doesn't define PrintTo() for it.
+template <typename T>
+void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
+  // With the following statement, during unqualified name lookup,
+  // testing::internal2::operator<< appears as if it was declared in
+  // the nearest enclosing namespace that contains both
+  // ::testing_internal and ::testing::internal2, i.e. the global
+  // namespace.  For more details, refer to the C++ Standard section
+  // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
+  // testing::internal2::operator<< in case T doesn't come with a <<
+  // operator.
+  //
+  // We cannot write 'using ::testing::internal2::operator<<;', which
+  // gcc 3.3 fails to compile due to a compiler bug.
+  using namespace ::testing::internal2;  // NOLINT
+
+  // Assuming T is defined in namespace foo, in the next statement,
+  // the compiler will consider all of:
+  //
+  //   1. foo::operator<< (thanks to Koenig look-up),
+  //   2. ::operator<< (as the current namespace is enclosed in ::),
+  //   3. testing::internal2::operator<< (thanks to the using statement above).
+  //
+  // The operator<< whose type matches T best will be picked.
+  //
+  // We deliberately allow #2 to be a candidate, as sometimes it's
+  // impossible to define #1 (e.g. when foo is ::std, defining
+  // anything in it is undefined behavior unless you are a compiler
+  // vendor.).
+  *os << value;
+}
+
+}  // namespace testing_internal
+
+namespace testing {
+namespace internal {
+
+// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
+// value of type ToPrint that is an operand of a comparison assertion
+// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
+// the comparison, and is used to help determine the best way to
+// format the value.  In particular, when the value is a C string
+// (char pointer) and the other operand is an STL string object, we
+// want to format the C string as a string, since we know it is
+// compared by value with the string object.  If the value is a char
+// pointer but the other operand is not an STL string object, we don't
+// know whether the pointer is supposed to point to a NUL-terminated
+// string, and thus want to print it as a pointer to be safe.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+// The default case.
+template <typename ToPrint, typename OtherOperand>
+class FormatForComparison {
+ public:
+  static ::std::string Format(const ToPrint& value) {
+    return ::testing::PrintToString(value);
+  }
+};
+
+// Array.
+template <typename ToPrint, size_t N, typename OtherOperand>
+class FormatForComparison<ToPrint[N], OtherOperand> {
+ public:
+  static ::std::string Format(const ToPrint* value) {
+    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
+  }
+};
+
+// By default, print C string as pointers to be safe, as we don't know
+// whether they actually point to a NUL-terminated string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
+  template <typename OtherOperand>                                      \
+  class FormatForComparison<CharType*, OtherOperand> {                  \
+   public:                                                              \
+    static ::std::string Format(CharType* value) {                      \
+      return ::testing::PrintToString(static_cast<const void*>(value)); \
+    }                                                                   \
+  }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
+
+// If a C string is compared with an STL string object, we know it's meant
+// to point to a NUL-terminated string, and thus can print it as a string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
+  template <>                                                           \
+  class FormatForComparison<CharType*, OtherStringType> {               \
+   public:                                                              \
+    static ::std::string Format(CharType* value) {                      \
+      return ::testing::PrintToString(value);                           \
+    }                                                                   \
+  }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
+
+#if GTEST_HAS_GLOBAL_STRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
+#endif
+
+#if GTEST_HAS_GLOBAL_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
+#endif
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
+#endif
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
+
+// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
+// operand to be used in a failure message.  The type (but not value)
+// of the other operand may affect the format.  This allows us to
+// print a char* as a raw pointer when it is compared against another
+// char* or void*, and print it as a C string when it is compared
+// against an std::string object, for example.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+template <typename T1, typename T2>
+std::string FormatForComparisonFailureMessage(
+    const T1& value, const T2& /* other_operand */) {
+  return FormatForComparison<T1, T2>::Format(value);
+}
+
+// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
+// value to the given ostream.  The caller must ensure that
+// 'ostream_ptr' is not NULL, or the behavior is undefined.
+//
+// We define UniversalPrinter as a class template (as opposed to a
+// function template), as we need to partially specialize it for
+// reference types, which cannot be done with function templates.
+template <typename T>
+class UniversalPrinter;
+
+template <typename T>
+void UniversalPrint(const T& value, ::std::ostream* os);
+
+// Used to print an STL-style container when the user doesn't define
+// a PrintTo() for it.
+template <typename C>
+void DefaultPrintTo(IsContainer /* dummy */,
+                    false_type /* is not a pointer */,
+                    const C& container, ::std::ostream* os) {
+  const size_t kMaxCount = 32;  // The maximum number of elements to print.
+  *os << '{';
+  size_t count = 0;
+  for (typename C::const_iterator it = container.begin();
+       it != container.end(); ++it, ++count) {
+    if (count > 0) {
+      *os << ',';
+      if (count == kMaxCount) {  // Enough has been printed.
+        *os << " ...";
+        break;
+      }
+    }
+    *os << ' ';
+    // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
+    // handle *it being a native array.
+    internal::UniversalPrint(*it, os);
+  }
+
+  if (count > 0) {
+    *os << ' ';
+  }
+  *os << '}';
+}
+
+// Used to print a pointer that is neither a char pointer nor a member
+// pointer, when the user doesn't define PrintTo() for it.  (A member
+// variable pointer or member function pointer doesn't really point to
+// a location in the address space.  Their representation is
+// implementation-defined.  Therefore they will be printed as raw
+// bytes.)
+template <typename T>
+void DefaultPrintTo(IsNotContainer /* dummy */,
+                    true_type /* is a pointer */,
+                    T* p, ::std::ostream* os) {
+  if (p == NULL) {
+    *os << "NULL";
+  } else {
+    // C++ doesn't allow casting from a function pointer to any object
+    // pointer.
+    //
+    // IsTrue() silences warnings: "Condition is always true",
+    // "unreachable code".
+    if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
+      // T is not a function type.  We just call << to print p,
+      // relying on ADL to pick up user-defined << for their pointer
+      // types, if any.
+      *os << p;
+    } else {
+      // T is a function type, so '*os << p' doesn't do what we want
+      // (it just prints p as bool).  We want to print p as a const
+      // void*.  However, we cannot cast it to const void* directly,
+      // even using reinterpret_cast, as earlier versions of gcc
+      // (e.g. 3.4.5) cannot compile the cast when p is a function
+      // pointer.  Casting to UInt64 first solves the problem.
+      *os << reinterpret_cast<const void*>(
+          reinterpret_cast<internal::UInt64>(p));
+    }
+  }
+}
+
+// Used to print a non-container, non-pointer value when the user
+// doesn't define PrintTo() for it.
+template <typename T>
+void DefaultPrintTo(IsNotContainer /* dummy */,
+                    false_type /* is not a pointer */,
+                    const T& value, ::std::ostream* os) {
+  ::testing_internal::DefaultPrintNonContainerTo(value, os);
+}
+
+// Prints the given value using the << operator if it has one;
+// otherwise prints the bytes in it.  This is what
+// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
+// or overloaded for type T.
+//
+// A user can override this behavior for a class type Foo by defining
+// an overload of PrintTo() in the namespace where Foo is defined.  We
+// give the user this option as sometimes defining a << operator for
+// Foo is not desirable (e.g. the coding style may prevent doing it,
+// or there is already a << operator but it doesn't do what the user
+// wants).
+template <typename T>
+void PrintTo(const T& value, ::std::ostream* os) {
+  // DefaultPrintTo() is overloaded.  The type of its first two
+  // arguments determine which version will be picked.  If T is an
+  // STL-style container, the version for container will be called; if
+  // T is a pointer, the pointer version will be called; otherwise the
+  // generic version will be called.
+  //
+  // Note that we check for container types here, prior to we check
+  // for protocol message types in our operator<<.  The rationale is:
+  //
+  // For protocol messages, we want to give people a chance to
+  // override Google Mock's format by defining a PrintTo() or
+  // operator<<.  For STL containers, other formats can be
+  // incompatible with Google Mock's format for the container
+  // elements; therefore we check for container types here to ensure
+  // that our format is used.
+  //
+  // The second argument of DefaultPrintTo() is needed to bypass a bug
+  // in Symbian's C++ compiler that prevents it from picking the right
+  // overload between:
+  //
+  //   PrintTo(const T& x, ...);
+  //   PrintTo(T* x, ...);
+  DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
+}
+
+// The following list of PrintTo() overloads tells
+// UniversalPrinter<T>::Print() how to print standard types (built-in
+// types, strings, plain arrays, and pointers).
+
+// Overloads for various char types.
+GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
+GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
+inline void PrintTo(char c, ::std::ostream* os) {
+  // When printing a plain char, we always treat it as unsigned.  This
+  // way, the output won't be affected by whether the compiler thinks
+  // char is signed or not.
+  PrintTo(static_cast<unsigned char>(c), os);
+}
+
+// Overloads for other simple built-in types.
+inline void PrintTo(bool x, ::std::ostream* os) {
+  *os << (x ? "true" : "false");
+}
+
+// Overload for wchar_t type.
+// Prints a wchar_t as a symbol if it is printable or as its internal
+// code otherwise and also as its decimal code (except for L'\0').
+// The L'\0' char is printed as "L'\\0'". The decimal code is printed
+// as signed integer when wchar_t is implemented by the compiler
+// as a signed type and is printed as an unsigned integer when wchar_t
+// is implemented as an unsigned type.
+GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
+
+// Overloads for C strings.
+GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
+inline void PrintTo(char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const char*>(s), os);
+}
+
+// signed/unsigned char is often used for representing binary data, so
+// we print pointers to it as void* to be safe.
+inline void PrintTo(const signed char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+inline void PrintTo(signed char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+inline void PrintTo(unsigned char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+
+// MSVC can be configured to define wchar_t as a typedef of unsigned
+// short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
+// type.  When wchar_t is a typedef, defining an overload for const
+// wchar_t* would cause unsigned short* be printed as a wide string,
+// possibly causing invalid memory accesses.
+#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
+// Overloads for wide C strings
+GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
+inline void PrintTo(wchar_t* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const wchar_t*>(s), os);
+}
+#endif
+
+// Overload for C arrays.  Multi-dimensional arrays are printed
+// properly.
+
+// Prints the given number of elements in an array, without printing
+// the curly braces.
+template <typename T>
+void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
+  UniversalPrint(a[0], os);
+  for (size_t i = 1; i != count; i++) {
+    *os << ", ";
+    UniversalPrint(a[i], os);
+  }
+}
+
+// Overloads for ::string and ::std::string.
+#if GTEST_HAS_GLOBAL_STRING
+GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
+inline void PrintTo(const ::string& s, ::std::ostream* os) {
+  PrintStringTo(s, os);
+}
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
+inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
+  PrintStringTo(s, os);
+}
+
+// Overloads for ::wstring and ::std::wstring.
+#if GTEST_HAS_GLOBAL_WSTRING
+GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
+inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
+  PrintWideStringTo(s, os);
+}
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
+inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
+  PrintWideStringTo(s, os);
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+// Helper function for printing a tuple.  T must be instantiated with
+// a tuple type.
+template <typename T>
+void PrintTupleTo(const T& t, ::std::ostream* os);
+#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE
+// Overload for ::std::tr1::tuple.  Needed for printing function arguments,
+// which are packed as tuples.
+
+// Overloaded PrintTo() for tuples of various arities.  We support
+// tuples of up-to 10 fields.  The following implementation works
+// regardless of whether tr1::tuple is implemented using the
+// non-standard variadic template feature or not.
+
+inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1>
+void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2>
+void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7, typename T8>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7, typename T8, typename T9>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7, typename T8, typename T9, typename T10>
+void PrintTo(
+    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
+    ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+#endif  // GTEST_HAS_TR1_TUPLE
+
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+#endif  // GTEST_HAS_STD_TUPLE_
+
+// Overload for std::pair.
+template <typename T1, typename T2>
+void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
+  *os << '(';
+  // We cannot use UniversalPrint(value.first, os) here, as T1 may be
+  // a reference type.  The same for printing value.second.
+  UniversalPrinter<T1>::Print(value.first, os);
+  *os << ", ";
+  UniversalPrinter<T2>::Print(value.second, os);
+  *os << ')';
+}
+
+// Implements printing a non-reference type T by letting the compiler
+// pick the right overload of PrintTo() for T.
+template <typename T>
+class UniversalPrinter {
+ public:
+  // MSVC warns about adding const to a function type, so we want to
+  // disable the warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
+
+  // Note: we deliberately don't call this PrintTo(), as that name
+  // conflicts with ::testing::internal::PrintTo in the body of the
+  // function.
+  static void Print(const T& value, ::std::ostream* os) {
+    // By default, ::testing::internal::PrintTo() is used for printing
+    // the value.
+    //
+    // Thanks to Koenig look-up, if T is a class and has its own
+    // PrintTo() function defined in its namespace, that function will
+    // be visible here.  Since it is more specific than the generic ones
+    // in ::testing::internal, it will be picked by the compiler in the
+    // following statement - exactly what we want.
+    PrintTo(value, os);
+  }
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+};
+
+// UniversalPrintArray(begin, len, os) prints an array of 'len'
+// elements, starting at address 'begin'.
+template <typename T>
+void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
+  if (len == 0) {
+    *os << "{}";
+  } else {
+    *os << "{ ";
+    const size_t kThreshold = 18;
+    const size_t kChunkSize = 8;
+    // If the array has more than kThreshold elements, we'll have to
+    // omit some details by printing only the first and the last
+    // kChunkSize elements.
+    // TODO(wan@google.com): let the user control the threshold using a flag.
+    if (len <= kThreshold) {
+      PrintRawArrayTo(begin, len, os);
+    } else {
+      PrintRawArrayTo(begin, kChunkSize, os);
+      *os << ", ..., ";
+      PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
+    }
+    *os << " }";
+  }
+}
+// This overload prints a (const) char array compactly.
+GTEST_API_ void UniversalPrintArray(
+    const char* begin, size_t len, ::std::ostream* os);
+
+// This overload prints a (const) wchar_t array compactly.
+GTEST_API_ void UniversalPrintArray(
+    const wchar_t* begin, size_t len, ::std::ostream* os);
+
+// Implements printing an array type T[N].
+template <typename T, size_t N>
+class UniversalPrinter<T[N]> {
+ public:
+  // Prints the given array, omitting some elements when there are too
+  // many.
+  static void Print(const T (&a)[N], ::std::ostream* os) {
+    UniversalPrintArray(a, N, os);
+  }
+};
+
+// Implements printing a reference type T&.
+template <typename T>
+class UniversalPrinter<T&> {
+ public:
+  // MSVC warns about adding const to a function type, so we want to
+  // disable the warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
+
+  static void Print(const T& value, ::std::ostream* os) {
+    // Prints the address of the value.  We use reinterpret_cast here
+    // as static_cast doesn't compile when T is a function type.
+    *os << "@" << reinterpret_cast<const void*>(&value) << " ";
+
+    // Then prints the value itself.
+    UniversalPrint(value, os);
+  }
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+};
+
+// Prints a value tersely: for a reference type, the referenced value
+// (but not the address) is printed; for a (const) char pointer, the
+// NUL-terminated string (but not the pointer) is printed.
+
+template <typename T>
+class UniversalTersePrinter {
+ public:
+  static void Print(const T& value, ::std::ostream* os) {
+    UniversalPrint(value, os);
+  }
+};
+template <typename T>
+class UniversalTersePrinter<T&> {
+ public:
+  static void Print(const T& value, ::std::ostream* os) {
+    UniversalPrint(value, os);
+  }
+};
+template <typename T, size_t N>
+class UniversalTersePrinter<T[N]> {
+ public:
+  static void Print(const T (&value)[N], ::std::ostream* os) {
+    UniversalPrinter<T[N]>::Print(value, os);
+  }
+};
+template <>
+class UniversalTersePrinter<const char*> {
+ public:
+  static void Print(const char* str, ::std::ostream* os) {
+    if (str == NULL) {
+      *os << "NULL";
+    } else {
+      UniversalPrint(string(str), os);
+    }
+  }
+};
+template <>
+class UniversalTersePrinter<char*> {
+ public:
+  static void Print(char* str, ::std::ostream* os) {
+    UniversalTersePrinter<const char*>::Print(str, os);
+  }
+};
+
+#if GTEST_HAS_STD_WSTRING
+template <>
+class UniversalTersePrinter<const wchar_t*> {
+ public:
+  static void Print(const wchar_t* str, ::std::ostream* os) {
+    if (str == NULL) {
+      *os << "NULL";
+    } else {
+      UniversalPrint(::std::wstring(str), os);
+    }
+  }
+};
+#endif
+
+template <>
+class UniversalTersePrinter<wchar_t*> {
+ public:
+  static void Print(wchar_t* str, ::std::ostream* os) {
+    UniversalTersePrinter<const wchar_t*>::Print(str, os);
+  }
+};
+
+template <typename T>
+void UniversalTersePrint(const T& value, ::std::ostream* os) {
+  UniversalTersePrinter<T>::Print(value, os);
+}
+
+// Prints a value using the type inferred by the compiler.  The
+// difference between this and UniversalTersePrint() is that for a
+// (const) char pointer, this prints both the pointer and the
+// NUL-terminated string.
+template <typename T>
+void UniversalPrint(const T& value, ::std::ostream* os) {
+  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
+  // UniversalPrinter with T directly.
+  typedef T T1;
+  UniversalPrinter<T1>::Print(value, os);
+}
+
+typedef ::std::vector<string> Strings;
+
+// TuplePolicy<TupleT> must provide:
+// - tuple_size
+//     size of tuple TupleT.
+// - get<size_t I>(const TupleT& t)
+//     static function extracting element I of tuple TupleT.
+// - tuple_element<size_t I>::type
+//     type of element I of tuple TupleT.
+template <typename TupleT>
+struct TuplePolicy;
+
+#if GTEST_HAS_TR1_TUPLE
+template <typename TupleT>
+struct TuplePolicy {
+  typedef TupleT Tuple;
+  static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
+
+  template <size_t I>
+  struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
+
+  template <size_t I>
+  static typename AddReference<
+      const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
+      const Tuple& tuple) {
+    return ::std::tr1::get<I>(tuple);
+  }
+};
+template <typename TupleT>
+const size_t TuplePolicy<TupleT>::tuple_size;
+#endif  // GTEST_HAS_TR1_TUPLE
+
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+struct TuplePolicy< ::std::tuple<Types...> > {
+  typedef ::std::tuple<Types...> Tuple;
+  static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
+
+  template <size_t I>
+  struct tuple_element : ::std::tuple_element<I, Tuple> {};
+
+  template <size_t I>
+  static const typename ::std::tuple_element<I, Tuple>::type& get(
+      const Tuple& tuple) {
+    return ::std::get<I>(tuple);
+  }
+};
+template <typename... Types>
+const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
+#endif  // GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+// This helper template allows PrintTo() for tuples and
+// UniversalTersePrintTupleFieldsToStrings() to be defined by
+// induction on the number of tuple fields.  The idea is that
+// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
+// fields in tuple t, and can be defined in terms of
+// TuplePrefixPrinter<N - 1>.
+//
+// The inductive case.
+template <size_t N>
+struct TuplePrefixPrinter {
+  // Prints the first N fields of a tuple.
+  template <typename Tuple>
+  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
+    TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
+    GTEST_INTENTIONAL_CONST_COND_PUSH_()
+    if (N > 1) {
+    GTEST_INTENTIONAL_CONST_COND_POP_()
+      *os << ", ";
+    }
+    UniversalPrinter<
+        typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
+        ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
+  }
+
+  // Tersely prints the first N fields of a tuple to a string vector,
+  // one element for each field.
+  template <typename Tuple>
+  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
+    TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
+    ::std::stringstream ss;
+    UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
+    strings->push_back(ss.str());
+  }
+};
+
+// Base case.
+template <>
+struct TuplePrefixPrinter<0> {
+  template <typename Tuple>
+  static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
+
+  template <typename Tuple>
+  static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
+};
+
+// Helper function for printing a tuple.
+// Tuple must be either std::tr1::tuple or std::tuple type.
+template <typename Tuple>
+void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
+  *os << "(";
+  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
+  *os << ")";
+}
+
+// Prints the fields of a tuple tersely to a string vector, one
+// element for each field.  See the comment before
+// UniversalTersePrint() for how we define "tersely".
+template <typename Tuple>
+Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
+  Strings result;
+  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
+      TersePrintPrefixToStrings(value, &result);
+  return result;
+}
+#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+
+}  // namespace internal
+
+template <typename T>
+::std::string PrintToString(const T& value) {
+  ::std::stringstream ss;
+  internal::UniversalTersePrinter<T>::Print(value, &ss);
+  return ss.str();
+}
+
+}  // namespace testing
+
+// Include any custom printer added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gtest/internal/custom/gtest-printers.h"
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-spi.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-spi.h
new file mode 100644
index 0000000..f63fa9a
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-spi.h
@@ -0,0 +1,232 @@
+// 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)
+//
+// Utilities for testing Google Test itself and code that uses Google Test
+// (e.g. frameworks built on top of Google Test).
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_
+#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_
+
+#include "gtest/gtest.h"
+
+namespace testing {
+
+// This helper class can be used to mock out Google Test failure reporting
+// so that we can test Google Test or code that builds on Google Test.
+//
+// An object of this class appends a TestPartResult object to the
+// TestPartResultArray object given in the constructor whenever a Google Test
+// failure is reported. It can either intercept only failures that are
+// generated in the same thread that created this object or it can intercept
+// all generated failures. The scope of this mock object can be controlled with
+// the second argument to the two arguments constructor.
+class GTEST_API_ ScopedFakeTestPartResultReporter
+    : public TestPartResultReporterInterface {
+ public:
+  // The two possible mocking modes of this object.
+  enum InterceptMode {
+    INTERCEPT_ONLY_CURRENT_THREAD,  // Intercepts only thread local failures.
+    INTERCEPT_ALL_THREADS           // Intercepts all failures.
+  };
+
+  // The c'tor sets this object as the test part result reporter used
+  // by Google Test.  The 'result' parameter specifies where to report the
+  // results. This reporter will only catch failures generated in the current
+  // thread. DEPRECATED
+  explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);
+
+  // Same as above, but you can choose the interception scope of this object.
+  ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
+                                   TestPartResultArray* result);
+
+  // The d'tor restores the previous test part result reporter.
+  virtual ~ScopedFakeTestPartResultReporter();
+
+  // Appends the TestPartResult object to the TestPartResultArray
+  // received in the constructor.
+  //
+  // This method is from the TestPartResultReporterInterface
+  // interface.
+  virtual void ReportTestPartResult(const TestPartResult& result);
+ private:
+  void Init();
+
+  const InterceptMode intercept_mode_;
+  TestPartResultReporterInterface* old_reporter_;
+  TestPartResultArray* const result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
+};
+
+namespace internal {
+
+// A helper class for implementing EXPECT_FATAL_FAILURE() and
+// EXPECT_NONFATAL_FAILURE().  Its destructor verifies that the given
+// TestPartResultArray contains exactly one failure that has the given
+// type and contains the given substring.  If that's not the case, a
+// non-fatal failure will be generated.
+class GTEST_API_ SingleFailureChecker {
+ public:
+  // The constructor remembers the arguments.
+  SingleFailureChecker(const TestPartResultArray* results,
+                       TestPartResult::Type type,
+                       const string& substr);
+  ~SingleFailureChecker();
+ private:
+  const TestPartResultArray* const results_;
+  const TestPartResult::Type type_;
+  const string substr_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);
+};
+
+}  // namespace internal
+
+}  // namespace testing
+
+// A set of macros for testing Google Test assertions or code that's expected
+// to generate Google Test fatal failures.  It verifies that the given
+// statement will cause exactly one fatal Google Test failure with 'substr'
+// being part of the failure message.
+//
+// There are two different versions of this macro. EXPECT_FATAL_FAILURE only
+// affects and considers failures generated in the current thread and
+// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
+//
+// The verification of the assertion is done correctly even when the statement
+// throws an exception or aborts the current function.
+//
+// Known restrictions:
+//   - 'statement' cannot reference local non-static variables or
+//     non-static members of the current object.
+//   - 'statement' cannot return a value.
+//   - You cannot stream a failure message to this macro.
+//
+// Note that even though the implementations of the following two
+// macros are much alike, we cannot refactor them to use a common
+// helper macro, due to some peculiarity in how the preprocessor
+// works.  The AcceptsMacroThatExpandsToUnprotectedComma test in
+// gtest_unittest.cc will fail to compile if we do that.
+#define EXPECT_FATAL_FAILURE(statement, substr) \
+  do { \
+    class GTestExpectFatalFailureHelper {\
+     public:\
+      static void Execute() { statement; }\
+    };\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter:: \
+          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
+      GTestExpectFatalFailureHelper::Execute();\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
+  do { \
+    class GTestExpectFatalFailureHelper {\
+     public:\
+      static void Execute() { statement; }\
+    };\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter:: \
+          INTERCEPT_ALL_THREADS, &gtest_failures);\
+      GTestExpectFatalFailureHelper::Execute();\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+// A macro for testing Google Test assertions or code that's expected to
+// generate Google Test non-fatal failures.  It asserts that the given
+// statement will cause exactly one non-fatal Google Test failure with 'substr'
+// being part of the failure message.
+//
+// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
+// affects and considers failures generated in the current thread and
+// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
+//
+// 'statement' is allowed to reference local variables and members of
+// the current object.
+//
+// The verification of the assertion is done correctly even when the statement
+// throws an exception or aborts the current function.
+//
+// Known restrictions:
+//   - You cannot stream a failure message to this macro.
+//
+// Note that even though the implementations of the following two
+// macros are much alike, we cannot refactor them to use a common
+// helper macro, due to some peculiarity in how the preprocessor
+// works.  If we do that, the code won't compile when the user gives
+// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that
+// expands to code containing an unprotected comma.  The
+// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
+// catches that.
+//
+// For the same reason, we have to write
+//   if (::testing::internal::AlwaysTrue()) { statement; }
+// instead of
+//   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
+// to avoid an MSVC warning on unreachable code.
+#define EXPECT_NONFATAL_FAILURE(statement, substr) \
+  do {\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
+        (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter:: \
+          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
+      if (::testing::internal::AlwaysTrue()) { statement; }\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
+  do {\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
+        (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \
+          &gtest_failures);\
+      if (::testing::internal::AlwaysTrue()) { statement; }\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_SPI_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-test-part.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-test-part.h
new file mode 100644
index 0000000..77eb844
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-test-part.h
@@ -0,0 +1,179 @@
+// 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: mheule@google.com (Markus Heule)
+//
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
+#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
+
+#include <iosfwd>
+#include <vector>
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-string.h"
+
+namespace testing {
+
+// A copyable object representing the result of a test part (i.e. an
+// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
+//
+// Don't inherit from TestPartResult as its destructor is not virtual.
+class GTEST_API_ TestPartResult {
+ public:
+  // The possible outcomes of a test part (i.e. an assertion or an
+  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
+  enum Type {
+    kSuccess,          // Succeeded.
+    kNonFatalFailure,  // Failed but the test can continue.
+    kFatalFailure      // Failed and the test should be terminated.
+  };
+
+  // C'tor.  TestPartResult does NOT have a default constructor.
+  // Always use this constructor (with parameters) to create a
+  // TestPartResult object.
+  TestPartResult(Type a_type,
+                 const char* a_file_name,
+                 int a_line_number,
+                 const char* a_message)
+      : type_(a_type),
+        file_name_(a_file_name == NULL ? "" : a_file_name),
+        line_number_(a_line_number),
+        summary_(ExtractSummary(a_message)),
+        message_(a_message) {
+  }
+
+  // Gets the outcome of the test part.
+  Type type() const { return type_; }
+
+  // Gets the name of the source file where the test part took place, or
+  // NULL if it's unknown.
+  const char* file_name() const {
+    return file_name_.empty() ? NULL : file_name_.c_str();
+  }
+
+  // Gets the line in the source file where the test part took place,
+  // or -1 if it's unknown.
+  int line_number() const { return line_number_; }
+
+  // Gets the summary of the failure message.
+  const char* summary() const { return summary_.c_str(); }
+
+  // Gets the message associated with the test part.
+  const char* message() const { return message_.c_str(); }
+
+  // Returns true iff the test part passed.
+  bool passed() const { return type_ == kSuccess; }
+
+  // Returns true iff the test part failed.
+  bool failed() const { return type_ != kSuccess; }
+
+  // Returns true iff the test part non-fatally failed.
+  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
+
+  // Returns true iff the test part fatally failed.
+  bool fatally_failed() const { return type_ == kFatalFailure; }
+
+ private:
+  Type type_;
+
+  // Gets the summary of the failure message by omitting the stack
+  // trace in it.
+  static std::string ExtractSummary(const char* message);
+
+  // The name of the source file where the test part took place, or
+  // "" if the source file is unknown.
+  std::string file_name_;
+  // The line in the source file where the test part took place, or -1
+  // if the line number is unknown.
+  int line_number_;
+  std::string summary_;  // The test failure summary.
+  std::string message_;  // The test failure message.
+};
+
+// Prints a TestPartResult object.
+std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
+
+// An array of TestPartResult objects.
+//
+// Don't inherit from TestPartResultArray as its destructor is not
+// virtual.
+class GTEST_API_ TestPartResultArray {
+ public:
+  TestPartResultArray() {}
+
+  // Appends the given TestPartResult to the array.
+  void Append(const TestPartResult& result);
+
+  // Returns the TestPartResult at the given index (0-based).
+  const TestPartResult& GetTestPartResult(int index) const;
+
+  // Returns the number of TestPartResult objects in the array.
+  int size() const;
+
+ private:
+  std::vector<TestPartResult> array_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
+};
+
+// This interface knows how to report a test part result.
+class TestPartResultReporterInterface {
+ public:
+  virtual ~TestPartResultReporterInterface() {}
+
+  virtual void ReportTestPartResult(const TestPartResult& result) = 0;
+};
+
+namespace internal {
+
+// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
+// statement generates new fatal failures. To do so it registers itself as the
+// current test part result reporter. Besides checking if fatal failures were
+// reported, it only delegates the reporting to the former result reporter.
+// The original result reporter is restored in the destructor.
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+class GTEST_API_ HasNewFatalFailureHelper
+    : public TestPartResultReporterInterface {
+ public:
+  HasNewFatalFailureHelper();
+  virtual ~HasNewFatalFailureHelper();
+  virtual void ReportTestPartResult(const TestPartResult& result);
+  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
+ private:
+  bool has_new_fatal_failure_;
+  TestPartResultReporterInterface* original_reporter_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
+};
+
+}  // namespace internal
+
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-typed-test.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-typed-test.h
new file mode 100644
index 0000000..5f69d56
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest-typed-test.h
@@ -0,0 +1,263 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
+
+// This header implements typed tests and type-parameterized tests.
+
+// Typed (aka type-driven) tests repeat the same test for types in a
+// list.  You must know which types you want to test with when writing
+// typed tests. Here's how you do it:
+
+#if 0
+
+// First, define a fixture class template.  It should be parameterized
+// by a type.  Remember to derive it from testing::Test.
+template <typename T>
+class FooTest : public testing::Test {
+ public:
+  ...
+  typedef std::list<T> List;
+  static T shared_;
+  T value_;
+};
+
+// Next, associate a list of types with the test case, which will be
+// repeated for each type in the list.  The typedef is necessary for
+// the macro to parse correctly.
+typedef testing::Types<char, int, unsigned int> MyTypes;
+TYPED_TEST_CASE(FooTest, MyTypes);
+
+// If the type list contains only one type, you can write that type
+// directly without Types<...>:
+//   TYPED_TEST_CASE(FooTest, int);
+
+// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
+// tests for this test case as you want.
+TYPED_TEST(FooTest, DoesBlah) {
+  // Inside a test, refer to TypeParam to get the type parameter.
+  // Since we are inside a derived class template, C++ requires use to
+  // visit the members of FooTest via 'this'.
+  TypeParam n = this->value_;
+
+  // To visit static members of the fixture, add the TestFixture::
+  // prefix.
+  n += TestFixture::shared_;
+
+  // To refer to typedefs in the fixture, add the "typename
+  // TestFixture::" prefix.
+  typename TestFixture::List values;
+  values.push_back(n);
+  ...
+}
+
+TYPED_TEST(FooTest, HasPropertyA) { ... }
+
+#endif  // 0
+
+// Type-parameterized tests are abstract test patterns parameterized
+// by a type.  Compared with typed tests, type-parameterized tests
+// allow you to define the test pattern without knowing what the type
+// parameters are.  The defined pattern can be instantiated with
+// different types any number of times, in any number of translation
+// units.
+//
+// If you are designing an interface or concept, you can define a
+// suite of type-parameterized tests to verify properties that any
+// valid implementation of the interface/concept should have.  Then,
+// each implementation can easily instantiate the test suite to verify
+// that it conforms to the requirements, without having to write
+// similar tests repeatedly.  Here's an example:
+
+#if 0
+
+// First, define a fixture class template.  It should be parameterized
+// by a type.  Remember to derive it from testing::Test.
+template <typename T>
+class FooTest : public testing::Test {
+  ...
+};
+
+// Next, declare that you will define a type-parameterized test case
+// (the _P suffix is for "parameterized" or "pattern", whichever you
+// prefer):
+TYPED_TEST_CASE_P(FooTest);
+
+// Then, use TYPED_TEST_P() to define as many type-parameterized tests
+// for this type-parameterized test case as you want.
+TYPED_TEST_P(FooTest, DoesBlah) {
+  // Inside a test, refer to TypeParam to get the type parameter.
+  TypeParam n = 0;
+  ...
+}
+
+TYPED_TEST_P(FooTest, HasPropertyA) { ... }
+
+// Now the tricky part: you need to register all test patterns before
+// you can instantiate them.  The first argument of the macro is the
+// test case name; the rest are the names of the tests in this test
+// case.
+REGISTER_TYPED_TEST_CASE_P(FooTest,
+                           DoesBlah, HasPropertyA);
+
+// Finally, you are free to instantiate the pattern with the types you
+// want.  If you put the above code in a header file, you can #include
+// it in multiple C++ source files and instantiate it multiple times.
+//
+// To distinguish different instances of the pattern, the first
+// argument to the INSTANTIATE_* macro is a prefix that will be added
+// to the actual test case name.  Remember to pick unique prefixes for
+// different instances.
+typedef testing::Types<char, int, unsigned int> MyTypes;
+INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
+
+// If the type list contains only one type, you can write that type
+// directly without Types<...>:
+//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
+
+#endif  // 0
+
+#include "gtest/internal/gtest-port.h"
+#include "gtest/internal/gtest-type-util.h"
+
+// Implements typed tests.
+
+#if GTEST_HAS_TYPED_TEST
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Expands to the name of the typedef for the type parameters of the
+// given test case.
+# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
+
+// The 'Types' template argument below must have spaces around it
+// since some compilers may choke on '>>' when passing a template
+// instance (e.g. Types<int>)
+# define TYPED_TEST_CASE(CaseName, Types) \
+  typedef ::testing::internal::TypeList< Types >::type \
+      GTEST_TYPE_PARAMS_(CaseName)
+
+# define TYPED_TEST(CaseName, TestName) \
+  template <typename gtest_TypeParam_> \
+  class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
+      : public CaseName<gtest_TypeParam_> { \
+   private: \
+    typedef CaseName<gtest_TypeParam_> TestFixture; \
+    typedef gtest_TypeParam_ TypeParam; \
+    virtual void TestBody(); \
+  }; \
+  bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::internal::TypeParameterizedTest< \
+          CaseName, \
+          ::testing::internal::TemplateSel< \
+              GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
+          GTEST_TYPE_PARAMS_(CaseName)>::Register(\
+              "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+              #CaseName, #TestName, 0); \
+  template <typename gtest_TypeParam_> \
+  void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+
+#endif  // GTEST_HAS_TYPED_TEST
+
+// Implements type-parameterized tests.
+
+#if GTEST_HAS_TYPED_TEST_P
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Expands to the namespace name that the type-parameterized tests for
+// the given type-parameterized test case are defined in.  The exact
+// name of the namespace is subject to change without notice.
+# define GTEST_CASE_NAMESPACE_(TestCaseName) \
+  gtest_case_##TestCaseName##_
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Expands to the name of the variable used to remember the names of
+// the defined tests in the given test case.
+# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
+  gtest_typed_test_case_p_state_##TestCaseName##_
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
+//
+// Expands to the name of the variable used to remember the names of
+// the registered tests in the given test case.
+# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
+  gtest_registered_test_names_##TestCaseName##_
+
+// The variables defined in the type-parameterized test macros are
+// static as typically these macros are used in a .h file that can be
+// #included in multiple translation units linked together.
+# define TYPED_TEST_CASE_P(CaseName) \
+  static ::testing::internal::TypedTestCasePState \
+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
+
+# define TYPED_TEST_P(CaseName, TestName) \
+  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
+  template <typename gtest_TypeParam_> \
+  class TestName : public CaseName<gtest_TypeParam_> { \
+   private: \
+    typedef CaseName<gtest_TypeParam_> TestFixture; \
+    typedef gtest_TypeParam_ TypeParam; \
+    virtual void TestBody(); \
+  }; \
+  static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
+          __FILE__, __LINE__, #CaseName, #TestName); \
+  } \
+  template <typename gtest_TypeParam_> \
+  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
+
+# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
+  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
+  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
+  } \
+  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
+          __FILE__, __LINE__, #__VA_ARGS__)
+
+// The 'Types' template argument below must have spaces around it
+// since some compilers may choke on '>>' when passing a template
+// instance (e.g. Types<int>)
+# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
+  bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::internal::TypeParameterizedTestCase<CaseName, \
+          GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
+          ::testing::internal::TypeList< Types >::type>::Register(\
+              #Prefix, \
+              ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+              &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \
+              #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+
+#endif  // GTEST_HAS_TYPED_TEST_P
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest.h
new file mode 100644
index 0000000..f846c5b
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest.h
@@ -0,0 +1,2236 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the public API for Google Test.  It should be
+// included by any test program that uses Google Test.
+//
+// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
+// leave some internal implementation details in this header file.
+// They are clearly marked by comments like this:
+//
+//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+//
+// Such code is NOT meant to be used by a user directly, and is subject
+// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
+// program!
+//
+// Acknowledgment: Google Test borrowed the idea of automatic test
+// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
+// easyUnit framework.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_H_
+
+#include <limits>
+#include <ostream>
+#include <vector>
+
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-string.h"
+#include "gtest/gtest-death-test.h"
+#include "gtest/gtest-message.h"
+#include "gtest/gtest-param-test.h"
+#include "gtest/gtest-printers.h"
+#include "gtest/gtest_prod.h"
+#include "gtest/gtest-test-part.h"
+#include "gtest/gtest-typed-test.h"
+
+// Depending on the platform, different string classes are available.
+// On Linux, in addition to ::std::string, Google also makes use of
+// class ::string, which has the same interface as ::std::string, but
+// has a different implementation.
+//
+// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
+// ::string is available AND is a distinct type to ::std::string, or
+// define it to 0 to indicate otherwise.
+//
+// If ::std::string and ::string are the same class on your platform
+// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
+//
+// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
+// heuristically.
+
+namespace testing {
+
+// Declares the flags.
+
+// This flag temporary enables the disabled tests.
+GTEST_DECLARE_bool_(also_run_disabled_tests);
+
+// This flag brings the debugger on an assertion failure.
+GTEST_DECLARE_bool_(break_on_failure);
+
+// This flag controls whether Google Test catches all test-thrown exceptions
+// and logs them as failures.
+GTEST_DECLARE_bool_(catch_exceptions);
+
+// This flag enables using colors in terminal output. Available values are
+// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
+// to let Google Test decide.
+GTEST_DECLARE_string_(color);
+
+// This flag sets up the filter to select by name using a glob pattern
+// the tests to run. If the filter is not given all tests are executed.
+GTEST_DECLARE_string_(filter);
+
+// This flag causes the Google Test to list tests. None of the tests listed
+// are actually run if the flag is provided.
+GTEST_DECLARE_bool_(list_tests);
+
+// This flag controls whether Google Test emits a detailed XML report to a file
+// in addition to its normal textual output.
+GTEST_DECLARE_string_(output);
+
+// This flags control whether Google Test prints the elapsed time for each
+// test.
+GTEST_DECLARE_bool_(print_time);
+
+// This flag specifies the random number seed.
+GTEST_DECLARE_int32_(random_seed);
+
+// This flag sets how many times the tests are repeated. The default value
+// is 1. If the value is -1 the tests are repeating forever.
+GTEST_DECLARE_int32_(repeat);
+
+// This flag controls whether Google Test includes Google Test internal
+// stack frames in failure stack traces.
+GTEST_DECLARE_bool_(show_internal_stack_frames);
+
+// When this flag is specified, tests' order is randomized on every iteration.
+GTEST_DECLARE_bool_(shuffle);
+
+// This flag specifies the maximum number of stack frames to be
+// printed in a failure message.
+GTEST_DECLARE_int32_(stack_trace_depth);
+
+// When this flag is specified, a failed assertion will throw an
+// exception if exceptions are enabled, or exit the program with a
+// non-zero code otherwise.
+GTEST_DECLARE_bool_(throw_on_failure);
+
+// When this flag is set with a "host:port" string, on supported
+// platforms test results are streamed to the specified port on
+// the specified host machine.
+GTEST_DECLARE_string_(stream_result_to);
+
+// The upper limit for valid stack trace depths.
+const int kMaxStackTraceDepth = 100;
+
+namespace internal {
+
+class AssertHelper;
+class DefaultGlobalTestPartResultReporter;
+class ExecDeathTest;
+class NoExecDeathTest;
+class FinalSuccessChecker;
+class GTestFlagSaver;
+class StreamingListenerTest;
+class TestResultAccessor;
+class TestEventListenersAccessor;
+class TestEventRepeater;
+class UnitTestRecordPropertyTestHelper;
+class WindowsDeathTest;
+class UnitTestImpl* GetUnitTestImpl();
+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
+                                    const std::string& message);
+
+}  // namespace internal
+
+// The friend relationship of some of these classes is cyclic.
+// If we don't forward declare them the compiler might confuse the classes
+// in friendship clauses with same named classes on the scope.
+class Test;
+class TestCase;
+class TestInfo;
+class UnitTest;
+
+// A class for indicating whether an assertion was successful.  When
+// the assertion wasn't successful, the AssertionResult object
+// remembers a non-empty message that describes how it failed.
+//
+// To create an instance of this class, use one of the factory functions
+// (AssertionSuccess() and AssertionFailure()).
+//
+// This class is useful for two purposes:
+//   1. Defining predicate functions to be used with Boolean test assertions
+//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
+//   2. Defining predicate-format functions to be
+//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
+//
+// For example, if you define IsEven predicate:
+//
+//   testing::AssertionResult IsEven(int n) {
+//     if ((n % 2) == 0)
+//       return testing::AssertionSuccess();
+//     else
+//       return testing::AssertionFailure() << n << " is odd";
+//   }
+//
+// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
+// will print the message
+//
+//   Value of: IsEven(Fib(5))
+//     Actual: false (5 is odd)
+//   Expected: true
+//
+// instead of a more opaque
+//
+//   Value of: IsEven(Fib(5))
+//     Actual: false
+//   Expected: true
+//
+// in case IsEven is a simple Boolean predicate.
+//
+// If you expect your predicate to be reused and want to support informative
+// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
+// about half as often as positive ones in our tests), supply messages for
+// both success and failure cases:
+//
+//   testing::AssertionResult IsEven(int n) {
+//     if ((n % 2) == 0)
+//       return testing::AssertionSuccess() << n << " is even";
+//     else
+//       return testing::AssertionFailure() << n << " is odd";
+//   }
+//
+// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
+//
+//   Value of: IsEven(Fib(6))
+//     Actual: true (8 is even)
+//   Expected: false
+//
+// NB: Predicates that support negative Boolean assertions have reduced
+// performance in positive ones so be careful not to use them in tests
+// that have lots (tens of thousands) of positive Boolean assertions.
+//
+// To use this class with EXPECT_PRED_FORMAT assertions such as:
+//
+//   // Verifies that Foo() returns an even number.
+//   EXPECT_PRED_FORMAT1(IsEven, Foo());
+//
+// you need to define:
+//
+//   testing::AssertionResult IsEven(const char* expr, int n) {
+//     if ((n % 2) == 0)
+//       return testing::AssertionSuccess();
+//     else
+//       return testing::AssertionFailure()
+//         << "Expected: " << expr << " is even\n  Actual: it's " << n;
+//   }
+//
+// If Foo() returns 5, you will see the following message:
+//
+//   Expected: Foo() is even
+//     Actual: it's 5
+//
+class GTEST_API_ AssertionResult {
+ public:
+  // Copy constructor.
+  // Used in EXPECT_TRUE/FALSE(assertion_result).
+  AssertionResult(const AssertionResult& other);
+
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
+
+  // Used in the EXPECT_TRUE/FALSE(bool_expression).
+  //
+  // T must be contextually convertible to bool.
+  //
+  // The second parameter prevents this overload from being considered if
+  // the argument is implicitly convertible to AssertionResult. In that case
+  // we want AssertionResult's copy constructor to be used.
+  template <typename T>
+  explicit AssertionResult(
+      const T& success,
+      typename internal::EnableIf<
+          !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
+          /*enabler*/ = NULL)
+      : success_(success) {}
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  // Assignment operator.
+  AssertionResult& operator=(AssertionResult other) {
+    swap(other);
+    return *this;
+  }
+
+  // Returns true iff the assertion succeeded.
+  operator bool() const { return success_; }  // NOLINT
+
+  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
+  AssertionResult operator!() const;
+
+  // Returns the text streamed into this AssertionResult. Test assertions
+  // use it when they fail (i.e., the predicate's outcome doesn't match the
+  // assertion's expectation). When nothing has been streamed into the
+  // object, returns an empty string.
+  const char* message() const {
+    return message_.get() != NULL ?  message_->c_str() : "";
+  }
+  // TODO(vladl@google.com): Remove this after making sure no clients use it.
+  // Deprecated; please use message() instead.
+  const char* failure_message() const { return message(); }
+
+  // Streams a custom failure message into this object.
+  template <typename T> AssertionResult& operator<<(const T& value) {
+    AppendMessage(Message() << value);
+    return *this;
+  }
+
+  // Allows streaming basic output manipulators such as endl or flush into
+  // this object.
+  AssertionResult& operator<<(
+      ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
+    AppendMessage(Message() << basic_manipulator);
+    return *this;
+  }
+
+ private:
+  // Appends the contents of message to message_.
+  void AppendMessage(const Message& a_message) {
+    if (message_.get() == NULL)
+      message_.reset(new ::std::string);
+    message_->append(a_message.GetString().c_str());
+  }
+
+  // Swap the contents of this AssertionResult with other.
+  void swap(AssertionResult& other);
+
+  // Stores result of the assertion predicate.
+  bool success_;
+  // Stores the message describing the condition in case the expectation
+  // construct is not satisfied with the predicate's outcome.
+  // Referenced via a pointer to avoid taking too much stack frame space
+  // with test assertions.
+  internal::scoped_ptr< ::std::string> message_;
+};
+
+// Makes a successful assertion result.
+GTEST_API_ AssertionResult AssertionSuccess();
+
+// Makes a failed assertion result.
+GTEST_API_ AssertionResult AssertionFailure();
+
+// Makes a failed assertion result with the given failure message.
+// Deprecated; use AssertionFailure() << msg.
+GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
+
+// The abstract class that all tests inherit from.
+//
+// In Google Test, a unit test program contains one or many TestCases, and
+// each TestCase contains one or many Tests.
+//
+// When you define a test using the TEST macro, you don't need to
+// explicitly derive from Test - the TEST macro automatically does
+// this for you.
+//
+// The only time you derive from Test is when defining a test fixture
+// to be used a TEST_F.  For example:
+//
+//   class FooTest : public testing::Test {
+//    protected:
+//     void SetUp() override { ... }
+//     void TearDown() override { ... }
+//     ...
+//   };
+//
+//   TEST_F(FooTest, Bar) { ... }
+//   TEST_F(FooTest, Baz) { ... }
+//
+// Test is not copyable.
+class GTEST_API_ Test {
+ public:
+  friend class TestInfo;
+
+  // Defines types for pointers to functions that set up and tear down
+  // a test case.
+  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
+  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
+
+  // The d'tor is virtual as we intend to inherit from Test.
+  virtual ~Test();
+
+  // Sets up the stuff shared by all tests in this test case.
+  //
+  // Google Test will call Foo::SetUpTestCase() before running the first
+  // test in test case Foo.  Hence a sub-class can define its own
+  // SetUpTestCase() method to shadow the one defined in the super
+  // class.
+  static void SetUpTestCase() {}
+
+  // Tears down the stuff shared by all tests in this test case.
+  //
+  // Google Test will call Foo::TearDownTestCase() after running the last
+  // test in test case Foo.  Hence a sub-class can define its own
+  // TearDownTestCase() method to shadow the one defined in the super
+  // class.
+  static void TearDownTestCase() {}
+
+  // Returns true iff the current test has a fatal failure.
+  static bool HasFatalFailure();
+
+  // Returns true iff the current test has a non-fatal failure.
+  static bool HasNonfatalFailure();
+
+  // Returns true iff the current test has a (either fatal or
+  // non-fatal) failure.
+  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
+
+  // Logs a property for the current test, test case, or for the entire
+  // invocation of the test program when used outside of the context of a
+  // test case.  Only the last value for a given key is remembered.  These
+  // are public static so they can be called from utility functions that are
+  // not members of the test fixture.  Calls to RecordProperty made during
+  // lifespan of the test (from the moment its constructor starts to the
+  // moment its destructor finishes) will be output in XML as attributes of
+  // the <testcase> element.  Properties recorded from fixture's
+  // SetUpTestCase or TearDownTestCase are logged as attributes of the
+  // corresponding <testsuite> element.  Calls to RecordProperty made in the
+  // global context (before or after invocation of RUN_ALL_TESTS and from
+  // SetUp/TearDown method of Environment objects registered with Google
+  // Test) will be output as attributes of the <testsuites> element.
+  static void RecordProperty(const std::string& key, const std::string& value);
+  static void RecordProperty(const std::string& key, int value);
+
+ protected:
+  // Creates a Test object.
+  Test();
+
+  // Sets up the test fixture.
+  virtual void SetUp();
+
+  // Tears down the test fixture.
+  virtual void TearDown();
+
+ private:
+  // Returns true iff the current test has the same fixture class as
+  // the first test in the current test case.
+  static bool HasSameFixtureClass();
+
+  // Runs the test after the test fixture has been set up.
+  //
+  // A sub-class must implement this to define the test logic.
+  //
+  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
+  // Instead, use the TEST or TEST_F macro.
+  virtual void TestBody() = 0;
+
+  // Sets up, executes, and tears down the test.
+  void Run();
+
+  // Deletes self.  We deliberately pick an unusual name for this
+  // internal method to avoid clashing with names used in user TESTs.
+  void DeleteSelf_() { delete this; }
+
+  const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
+
+  // Often a user misspells SetUp() as Setup() and spends a long time
+  // wondering why it is never called by Google Test.  The declaration of
+  // the following method is solely for catching such an error at
+  // compile time:
+  //
+  //   - The return type is deliberately chosen to be not void, so it
+  //   will be a conflict if void Setup() is declared in the user's
+  //   test fixture.
+  //
+  //   - This method is private, so it will be another compiler error
+  //   if the method is called from the user's test fixture.
+  //
+  // DO NOT OVERRIDE THIS FUNCTION.
+  //
+  // If you see an error about overriding the following function or
+  // about it being private, you have mis-spelled SetUp() as Setup().
+  struct Setup_should_be_spelled_SetUp {};
+  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
+
+  // We disallow copying Tests.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
+};
+
+typedef internal::TimeInMillis TimeInMillis;
+
+// A copyable object representing a user specified test property which can be
+// output as a key/value string pair.
+//
+// Don't inherit from TestProperty as its destructor is not virtual.
+class TestProperty {
+ public:
+  // C'tor.  TestProperty does NOT have a default constructor.
+  // Always use this constructor (with parameters) to create a
+  // TestProperty object.
+  TestProperty(const std::string& a_key, const std::string& a_value) :
+    key_(a_key), value_(a_value) {
+  }
+
+  // Gets the user supplied key.
+  const char* key() const {
+    return key_.c_str();
+  }
+
+  // Gets the user supplied value.
+  const char* value() const {
+    return value_.c_str();
+  }
+
+  // Sets a new value, overriding the one supplied in the constructor.
+  void SetValue(const std::string& new_value) {
+    value_ = new_value;
+  }
+
+ private:
+  // The key supplied by the user.
+  std::string key_;
+  // The value supplied by the user.
+  std::string value_;
+};
+
+// The result of a single Test.  This includes a list of
+// TestPartResults, a list of TestProperties, a count of how many
+// death tests there are in the Test, and how much time it took to run
+// the Test.
+//
+// TestResult is not copyable.
+class GTEST_API_ TestResult {
+ public:
+  // Creates an empty TestResult.
+  TestResult();
+
+  // D'tor.  Do not inherit from TestResult.
+  ~TestResult();
+
+  // Gets the number of all test parts.  This is the sum of the number
+  // of successful test parts and the number of failed test parts.
+  int total_part_count() const;
+
+  // Returns the number of the test properties.
+  int test_property_count() const;
+
+  // Returns true iff the test passed (i.e. no test part failed).
+  bool Passed() const { return !Failed(); }
+
+  // Returns true iff the test failed.
+  bool Failed() const;
+
+  // Returns true iff the test fatally failed.
+  bool HasFatalFailure() const;
+
+  // Returns true iff the test has a non-fatal failure.
+  bool HasNonfatalFailure() const;
+
+  // Returns the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const { return elapsed_time_; }
+
+  // Returns the i-th test part result among all the results. i can range
+  // from 0 to test_property_count() - 1. If i is not in that range, aborts
+  // the program.
+  const TestPartResult& GetTestPartResult(int i) const;
+
+  // Returns the i-th test property. i can range from 0 to
+  // test_property_count() - 1. If i is not in that range, aborts the
+  // program.
+  const TestProperty& GetTestProperty(int i) const;
+
+ private:
+  friend class TestInfo;
+  friend class TestCase;
+  friend class UnitTest;
+  friend class internal::DefaultGlobalTestPartResultReporter;
+  friend class internal::ExecDeathTest;
+  friend class internal::TestResultAccessor;
+  friend class internal::UnitTestImpl;
+  friend class internal::WindowsDeathTest;
+
+  // Gets the vector of TestPartResults.
+  const std::vector<TestPartResult>& test_part_results() const {
+    return test_part_results_;
+  }
+
+  // Gets the vector of TestProperties.
+  const std::vector<TestProperty>& test_properties() const {
+    return test_properties_;
+  }
+
+  // Sets the elapsed time.
+  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
+
+  // Adds a test property to the list. The property is validated and may add
+  // a non-fatal failure if invalid (e.g., if it conflicts with reserved
+  // key names). If a property is already recorded for the same key, the
+  // value will be updated, rather than storing multiple values for the same
+  // key.  xml_element specifies the element for which the property is being
+  // recorded and is used for validation.
+  void RecordProperty(const std::string& xml_element,
+                      const TestProperty& test_property);
+
+  // Adds a failure if the key is a reserved attribute of Google Test
+  // testcase tags.  Returns true if the property is valid.
+  // TODO(russr): Validate attribute names are legal and human readable.
+  static bool ValidateTestProperty(const std::string& xml_element,
+                                   const TestProperty& test_property);
+
+  // Adds a test part result to the list.
+  void AddTestPartResult(const TestPartResult& test_part_result);
+
+  // Returns the death test count.
+  int death_test_count() const { return death_test_count_; }
+
+  // Increments the death test count, returning the new count.
+  int increment_death_test_count() { return ++death_test_count_; }
+
+  // Clears the test part results.
+  void ClearTestPartResults();
+
+  // Clears the object.
+  void Clear();
+
+  // Protects mutable state of the property vector and of owned
+  // properties, whose values may be updated.
+  internal::Mutex test_properites_mutex_;
+
+  // The vector of TestPartResults
+  std::vector<TestPartResult> test_part_results_;
+  // The vector of TestProperties
+  std::vector<TestProperty> test_properties_;
+  // Running count of death tests.
+  int death_test_count_;
+  // The elapsed time, in milliseconds.
+  TimeInMillis elapsed_time_;
+
+  // We disallow copying TestResult.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
+};  // class TestResult
+
+// A TestInfo object stores the following information about a test:
+//
+//   Test case name
+//   Test name
+//   Whether the test should be run
+//   A function pointer that creates the test object when invoked
+//   Test result
+//
+// The constructor of TestInfo registers itself with the UnitTest
+// singleton such that the RUN_ALL_TESTS() macro knows which tests to
+// run.
+class GTEST_API_ TestInfo {
+ public:
+  // Destructs a TestInfo object.  This function is not virtual, so
+  // don't inherit from TestInfo.
+  ~TestInfo();
+
+  // Returns the test case name.
+  const char* test_case_name() const { return test_case_name_.c_str(); }
+
+  // Returns the test name.
+  const char* name() const { return name_.c_str(); }
+
+  // Returns the name of the parameter type, or NULL if this is not a typed
+  // or a type-parameterized test.
+  const char* type_param() const {
+    if (type_param_.get() != NULL)
+      return type_param_->c_str();
+    return NULL;
+  }
+
+  // Returns the text representation of the value parameter, or NULL if this
+  // is not a value-parameterized test.
+  const char* value_param() const {
+    if (value_param_.get() != NULL)
+      return value_param_->c_str();
+    return NULL;
+  }
+
+  // Returns the file name where this test is defined.
+  const char* file() const { return location_.file.c_str(); }
+
+  // Returns the line where this test is defined.
+  int line() const { return location_.line; }
+
+  // Returns true if this test should run, that is if the test is not
+  // disabled (or it is disabled but the also_run_disabled_tests flag has
+  // been specified) and its full name matches the user-specified filter.
+  //
+  // Google Test allows the user to filter the tests by their full names.
+  // The full name of a test Bar in test case Foo is defined as
+  // "Foo.Bar".  Only the tests that match the filter will run.
+  //
+  // A filter is a colon-separated list of glob (not regex) patterns,
+  // optionally followed by a '-' and a colon-separated list of
+  // negative patterns (tests to exclude).  A test is run if it
+  // matches one of the positive patterns and does not match any of
+  // the negative patterns.
+  //
+  // For example, *A*:Foo.* is a filter that matches any string that
+  // contains the character 'A' or starts with "Foo.".
+  bool should_run() const { return should_run_; }
+
+  // Returns true iff this test will appear in the XML report.
+  bool is_reportable() const {
+    // For now, the XML report includes all tests matching the filter.
+    // In the future, we may trim tests that are excluded because of
+    // sharding.
+    return matches_filter_;
+  }
+
+  // Returns the result of the test.
+  const TestResult* result() const { return &result_; }
+
+ private:
+#if GTEST_HAS_DEATH_TEST
+  friend class internal::DefaultDeathTestFactory;
+#endif  // GTEST_HAS_DEATH_TEST
+  friend class Test;
+  friend class TestCase;
+  friend class internal::UnitTestImpl;
+  friend class internal::StreamingListenerTest;
+  friend TestInfo* internal::MakeAndRegisterTestInfo(
+      const char* test_case_name,
+      const char* name,
+      const char* type_param,
+      const char* value_param,
+      internal::CodeLocation code_location,
+      internal::TypeId fixture_class_id,
+      Test::SetUpTestCaseFunc set_up_tc,
+      Test::TearDownTestCaseFunc tear_down_tc,
+      internal::TestFactoryBase* factory);
+
+  // Constructs a TestInfo object. The newly constructed instance assumes
+  // ownership of the factory object.
+  TestInfo(const std::string& test_case_name,
+           const std::string& name,
+           const char* a_type_param,   // NULL if not a type-parameterized test
+           const char* a_value_param,  // NULL if not a value-parameterized test
+           internal::CodeLocation a_code_location,
+           internal::TypeId fixture_class_id,
+           internal::TestFactoryBase* factory);
+
+  // Increments the number of death tests encountered in this test so
+  // far.
+  int increment_death_test_count() {
+    return result_.increment_death_test_count();
+  }
+
+  // Creates the test object, runs it, records its result, and then
+  // deletes it.
+  void Run();
+
+  static void ClearTestResult(TestInfo* test_info) {
+    test_info->result_.Clear();
+  }
+
+  // These fields are immutable properties of the test.
+  const std::string test_case_name_;     // Test case name
+  const std::string name_;               // Test name
+  // Name of the parameter type, or NULL if this is not a typed or a
+  // type-parameterized test.
+  const internal::scoped_ptr<const ::std::string> type_param_;
+  // Text representation of the value parameter, or NULL if this is not a
+  // value-parameterized test.
+  const internal::scoped_ptr<const ::std::string> value_param_;
+  internal::CodeLocation location_;
+  const internal::TypeId fixture_class_id_;   // ID of the test fixture class
+  bool should_run_;                 // True iff this test should run
+  bool is_disabled_;                // True iff this test is disabled
+  bool matches_filter_;             // True if this test matches the
+                                    // user-specified filter.
+  internal::TestFactoryBase* const factory_;  // The factory that creates
+                                              // the test object
+
+  // This field is mutable and needs to be reset before running the
+  // test for the second time.
+  TestResult result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
+};
+
+// A test case, which consists of a vector of TestInfos.
+//
+// TestCase is not copyable.
+class GTEST_API_ TestCase {
+ public:
+  // Creates a TestCase with the given name.
+  //
+  // TestCase does NOT have a default constructor.  Always use this
+  // constructor to create a TestCase object.
+  //
+  // Arguments:
+  //
+  //   name:         name of the test case
+  //   a_type_param: the name of the test's type parameter, or NULL if
+  //                 this is not a type-parameterized test.
+  //   set_up_tc:    pointer to the function that sets up the test case
+  //   tear_down_tc: pointer to the function that tears down the test case
+  TestCase(const char* name, const char* a_type_param,
+           Test::SetUpTestCaseFunc set_up_tc,
+           Test::TearDownTestCaseFunc tear_down_tc);
+
+  // Destructor of TestCase.
+  virtual ~TestCase();
+
+  // Gets the name of the TestCase.
+  const char* name() const { return name_.c_str(); }
+
+  // Returns the name of the parameter type, or NULL if this is not a
+  // type-parameterized test case.
+  const char* type_param() const {
+    if (type_param_.get() != NULL)
+      return type_param_->c_str();
+    return NULL;
+  }
+
+  // Returns true if any test in this test case should run.
+  bool should_run() const { return should_run_; }
+
+  // Gets the number of successful tests in this test case.
+  int successful_test_count() const;
+
+  // Gets the number of failed tests in this test case.
+  int failed_test_count() const;
+
+  // Gets the number of disabled tests that will be reported in the XML report.
+  int reportable_disabled_test_count() const;
+
+  // Gets the number of disabled tests in this test case.
+  int disabled_test_count() const;
+
+  // Gets the number of tests to be printed in the XML report.
+  int reportable_test_count() const;
+
+  // Get the number of tests in this test case that should run.
+  int test_to_run_count() const;
+
+  // Gets the number of all tests in this test case.
+  int total_test_count() const;
+
+  // Returns true iff the test case passed.
+  bool Passed() const { return !Failed(); }
+
+  // Returns true iff the test case failed.
+  bool Failed() const { return failed_test_count() > 0; }
+
+  // Returns the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const { return elapsed_time_; }
+
+  // Returns the i-th test among all the tests. i can range from 0 to
+  // total_test_count() - 1. If i is not in that range, returns NULL.
+  const TestInfo* GetTestInfo(int i) const;
+
+  // Returns the TestResult that holds test properties recorded during
+  // execution of SetUpTestCase and TearDownTestCase.
+  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
+
+ private:
+  friend class Test;
+  friend class internal::UnitTestImpl;
+
+  // Gets the (mutable) vector of TestInfos in this TestCase.
+  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
+
+  // Gets the (immutable) vector of TestInfos in this TestCase.
+  const std::vector<TestInfo*>& test_info_list() const {
+    return test_info_list_;
+  }
+
+  // Returns the i-th test among all the tests. i can range from 0 to
+  // total_test_count() - 1. If i is not in that range, returns NULL.
+  TestInfo* GetMutableTestInfo(int i);
+
+  // Sets the should_run member.
+  void set_should_run(bool should) { should_run_ = should; }
+
+  // Adds a TestInfo to this test case.  Will delete the TestInfo upon
+  // destruction of the TestCase object.
+  void AddTestInfo(TestInfo * test_info);
+
+  // Clears the results of all tests in this test case.
+  void ClearResult();
+
+  // Clears the results of all tests in the given test case.
+  static void ClearTestCaseResult(TestCase* test_case) {
+    test_case->ClearResult();
+  }
+
+  // Runs every test in this TestCase.
+  void Run();
+
+  // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
+  // for catching exceptions thrown from SetUpTestCase().
+  void RunSetUpTestCase() { (*set_up_tc_)(); }
+
+  // Runs TearDownTestCase() for this TestCase.  This wrapper is
+  // needed for catching exceptions thrown from TearDownTestCase().
+  void RunTearDownTestCase() { (*tear_down_tc_)(); }
+
+  // Returns true iff test passed.
+  static bool TestPassed(const TestInfo* test_info) {
+    return test_info->should_run() && test_info->result()->Passed();
+  }
+
+  // Returns true iff test failed.
+  static bool TestFailed(const TestInfo* test_info) {
+    return test_info->should_run() && test_info->result()->Failed();
+  }
+
+  // Returns true iff the test is disabled and will be reported in the XML
+  // report.
+  static bool TestReportableDisabled(const TestInfo* test_info) {
+    return test_info->is_reportable() && test_info->is_disabled_;
+  }
+
+  // Returns true iff test is disabled.
+  static bool TestDisabled(const TestInfo* test_info) {
+    return test_info->is_disabled_;
+  }
+
+  // Returns true iff this test will appear in the XML report.
+  static bool TestReportable(const TestInfo* test_info) {
+    return test_info->is_reportable();
+  }
+
+  // Returns true if the given test should run.
+  static bool ShouldRunTest(const TestInfo* test_info) {
+    return test_info->should_run();
+  }
+
+  // Shuffles the tests in this test case.
+  void ShuffleTests(internal::Random* random);
+
+  // Restores the test order to before the first shuffle.
+  void UnshuffleTests();
+
+  // Name of the test case.
+  std::string name_;
+  // Name of the parameter type, or NULL if this is not a typed or a
+  // type-parameterized test.
+  const internal::scoped_ptr<const ::std::string> type_param_;
+  // The vector of TestInfos in their original order.  It owns the
+  // elements in the vector.
+  std::vector<TestInfo*> test_info_list_;
+  // Provides a level of indirection for the test list to allow easy
+  // shuffling and restoring the test order.  The i-th element in this
+  // vector is the index of the i-th test in the shuffled test list.
+  std::vector<int> test_indices_;
+  // Pointer to the function that sets up the test case.
+  Test::SetUpTestCaseFunc set_up_tc_;
+  // Pointer to the function that tears down the test case.
+  Test::TearDownTestCaseFunc tear_down_tc_;
+  // True iff any test in this test case should run.
+  bool should_run_;
+  // Elapsed time, in milliseconds.
+  TimeInMillis elapsed_time_;
+  // Holds test properties recorded during execution of SetUpTestCase and
+  // TearDownTestCase.
+  TestResult ad_hoc_test_result_;
+
+  // We disallow copying TestCases.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
+};
+
+// An Environment object is capable of setting up and tearing down an
+// environment.  You should subclass this to define your own
+// environment(s).
+//
+// An Environment object does the set-up and tear-down in virtual
+// methods SetUp() and TearDown() instead of the constructor and the
+// destructor, as:
+//
+//   1. You cannot safely throw from a destructor.  This is a problem
+//      as in some cases Google Test is used where exceptions are enabled, and
+//      we may want to implement ASSERT_* using exceptions where they are
+//      available.
+//   2. You cannot use ASSERT_* directly in a constructor or
+//      destructor.
+class Environment {
+ public:
+  // The d'tor is virtual as we need to subclass Environment.
+  virtual ~Environment() {}
+
+  // Override this to define how to set up the environment.
+  virtual void SetUp() {}
+
+  // Override this to define how to tear down the environment.
+  virtual void TearDown() {}
+ private:
+  // If you see an error about overriding the following function or
+  // about it being private, you have mis-spelled SetUp() as Setup().
+  struct Setup_should_be_spelled_SetUp {};
+  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
+};
+
+// The interface for tracing execution of tests. The methods are organized in
+// the order the corresponding events are fired.
+class TestEventListener {
+ public:
+  virtual ~TestEventListener() {}
+
+  // Fired before any test activity starts.
+  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
+
+  // Fired before each iteration of tests starts.  There may be more than
+  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
+  // index, starting from 0.
+  virtual void OnTestIterationStart(const UnitTest& unit_test,
+                                    int iteration) = 0;
+
+  // Fired before environment set-up for each iteration of tests starts.
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
+
+  // Fired after environment set-up for each iteration of tests ends.
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
+
+  // Fired before the test case starts.
+  virtual void OnTestCaseStart(const TestCase& test_case) = 0;
+
+  // Fired before the test starts.
+  virtual void OnTestStart(const TestInfo& test_info) = 0;
+
+  // Fired after a failed assertion or a SUCCEED() invocation.
+  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
+
+  // Fired after the test ends.
+  virtual void OnTestEnd(const TestInfo& test_info) = 0;
+
+  // Fired after the test case ends.
+  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
+
+  // Fired before environment tear-down for each iteration of tests starts.
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
+
+  // Fired after environment tear-down for each iteration of tests ends.
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
+
+  // Fired after each iteration of tests finishes.
+  virtual void OnTestIterationEnd(const UnitTest& unit_test,
+                                  int iteration) = 0;
+
+  // Fired after all test activities have ended.
+  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
+};
+
+// The convenience class for users who need to override just one or two
+// methods and are not concerned that a possible change to a signature of
+// the methods they override will not be caught during the build.  For
+// comments about each method please see the definition of TestEventListener
+// above.
+class EmptyTestEventListener : public TestEventListener {
+ public:
+  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
+                                    int /*iteration*/) {}
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
+  virtual void OnTestStart(const TestInfo& /*test_info*/) {}
+  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
+  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
+  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
+                                  int /*iteration*/) {}
+  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+};
+
+// TestEventListeners lets users add listeners to track events in Google Test.
+class GTEST_API_ TestEventListeners {
+ public:
+  TestEventListeners();
+  ~TestEventListeners();
+
+  // Appends an event listener to the end of the list. Google Test assumes
+  // the ownership of the listener (i.e. it will delete the listener when
+  // the test program finishes).
+  void Append(TestEventListener* listener);
+
+  // Removes the given event listener from the list and returns it.  It then
+  // becomes the caller's responsibility to delete the listener. Returns
+  // NULL if the listener is not found in the list.
+  TestEventListener* Release(TestEventListener* listener);
+
+  // Returns the standard listener responsible for the default console
+  // output.  Can be removed from the listeners list to shut down default
+  // console output.  Note that removing this object from the listener list
+  // with Release transfers its ownership to the caller and makes this
+  // function return NULL the next time.
+  TestEventListener* default_result_printer() const {
+    return default_result_printer_;
+  }
+
+  // Returns the standard listener responsible for the default XML output
+  // controlled by the --gtest_output=xml flag.  Can be removed from the
+  // listeners list by users who want to shut down the default XML output
+  // controlled by this flag and substitute it with custom one.  Note that
+  // removing this object from the listener list with Release transfers its
+  // ownership to the caller and makes this function return NULL the next
+  // time.
+  TestEventListener* default_xml_generator() const {
+    return default_xml_generator_;
+  }
+
+ private:
+  friend class TestCase;
+  friend class TestInfo;
+  friend class internal::DefaultGlobalTestPartResultReporter;
+  friend class internal::NoExecDeathTest;
+  friend class internal::TestEventListenersAccessor;
+  friend class internal::UnitTestImpl;
+
+  // Returns repeater that broadcasts the TestEventListener events to all
+  // subscribers.
+  TestEventListener* repeater();
+
+  // Sets the default_result_printer attribute to the provided listener.
+  // The listener is also added to the listener list and previous
+  // default_result_printer is removed from it and deleted. The listener can
+  // also be NULL in which case it will not be added to the list. Does
+  // nothing if the previous and the current listener objects are the same.
+  void SetDefaultResultPrinter(TestEventListener* listener);
+
+  // Sets the default_xml_generator attribute to the provided listener.  The
+  // listener is also added to the listener list and previous
+  // default_xml_generator is removed from it and deleted. The listener can
+  // also be NULL in which case it will not be added to the list. Does
+  // nothing if the previous and the current listener objects are the same.
+  void SetDefaultXmlGenerator(TestEventListener* listener);
+
+  // Controls whether events will be forwarded by the repeater to the
+  // listeners in the list.
+  bool EventForwardingEnabled() const;
+  void SuppressEventForwarding();
+
+  // The actual list of listeners.
+  internal::TestEventRepeater* repeater_;
+  // Listener responsible for the standard result output.
+  TestEventListener* default_result_printer_;
+  // Listener responsible for the creation of the XML output file.
+  TestEventListener* default_xml_generator_;
+
+  // We disallow copying TestEventListeners.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
+};
+
+// A UnitTest consists of a vector of TestCases.
+//
+// This is a singleton class.  The only instance of UnitTest is
+// created when UnitTest::GetInstance() is first called.  This
+// instance is never deleted.
+//
+// UnitTest is not copyable.
+//
+// This class is thread-safe as long as the methods are called
+// according to their specification.
+class GTEST_API_ UnitTest {
+ public:
+  // Gets the singleton UnitTest object.  The first time this method
+  // is called, a UnitTest object is constructed and returned.
+  // Consecutive calls will return the same object.
+  static UnitTest* GetInstance();
+
+  // Runs all tests in this UnitTest object and prints the result.
+  // Returns 0 if successful, or 1 otherwise.
+  //
+  // This method can only be called from the main thread.
+  //
+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+  int Run() GTEST_MUST_USE_RESULT_;
+
+  // Returns the working directory when the first TEST() or TEST_F()
+  // was executed.  The UnitTest object owns the string.
+  const char* original_working_dir() const;
+
+  // Returns the TestCase object for the test that's currently running,
+  // or NULL if no test is running.
+  const TestCase* current_test_case() const
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Returns the TestInfo object for the test that's currently running,
+  // or NULL if no test is running.
+  const TestInfo* current_test_info() const
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Returns the random seed used at the start of the current test run.
+  int random_seed() const;
+
+#if GTEST_HAS_PARAM_TEST
+  // Returns the ParameterizedTestCaseRegistry object used to keep track of
+  // value-parameterized tests and instantiate and register them.
+  //
+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+  internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
+      GTEST_LOCK_EXCLUDED_(mutex_);
+#endif  // GTEST_HAS_PARAM_TEST
+
+  // Gets the number of successful test cases.
+  int successful_test_case_count() const;
+
+  // Gets the number of failed test cases.
+  int failed_test_case_count() const;
+
+  // Gets the number of all test cases.
+  int total_test_case_count() const;
+
+  // Gets the number of all test cases that contain at least one test
+  // that should run.
+  int test_case_to_run_count() const;
+
+  // Gets the number of successful tests.
+  int successful_test_count() const;
+
+  // Gets the number of failed tests.
+  int failed_test_count() const;
+
+  // Gets the number of disabled tests that will be reported in the XML report.
+  int reportable_disabled_test_count() const;
+
+  // Gets the number of disabled tests.
+  int disabled_test_count() const;
+
+  // Gets the number of tests to be printed in the XML report.
+  int reportable_test_count() const;
+
+  // Gets the number of all tests.
+  int total_test_count() const;
+
+  // Gets the number of tests that should run.
+  int test_to_run_count() const;
+
+  // Gets the time of the test program start, in ms from the start of the
+  // UNIX epoch.
+  TimeInMillis start_timestamp() const;
+
+  // Gets the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const;
+
+  // Returns true iff the unit test passed (i.e. all test cases passed).
+  bool Passed() const;
+
+  // Returns true iff the unit test failed (i.e. some test case failed
+  // or something outside of all tests failed).
+  bool Failed() const;
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  const TestCase* GetTestCase(int i) const;
+
+  // Returns the TestResult containing information on test failures and
+  // properties logged outside of individual test cases.
+  const TestResult& ad_hoc_test_result() const;
+
+  // Returns the list of event listeners that can be used to track events
+  // inside Google Test.
+  TestEventListeners& listeners();
+
+ private:
+  // Registers and returns a global test environment.  When a test
+  // program is run, all global test environments will be set-up in
+  // the order they were registered.  After all tests in the program
+  // have finished, all global test environments will be torn-down in
+  // the *reverse* order they were registered.
+  //
+  // The UnitTest object takes ownership of the given environment.
+  //
+  // This method can only be called from the main thread.
+  Environment* AddEnvironment(Environment* env);
+
+  // Adds a TestPartResult to the current TestResult object.  All
+  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
+  // eventually call this to report their results.  The user code
+  // should use the assertion macros instead of calling this directly.
+  void AddTestPartResult(TestPartResult::Type result_type,
+                         const char* file_name,
+                         int line_number,
+                         const std::string& message,
+                         const std::string& os_stack_trace)
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Adds a TestProperty to the current TestResult object when invoked from
+  // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
+  // from SetUpTestCase or TearDownTestCase, or to the global property set
+  // when invoked elsewhere.  If the result already contains a property with
+  // the same key, the value will be updated.
+  void RecordProperty(const std::string& key, const std::string& value);
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  TestCase* GetMutableTestCase(int i);
+
+  // Accessors for the implementation object.
+  internal::UnitTestImpl* impl() { return impl_; }
+  const internal::UnitTestImpl* impl() const { return impl_; }
+
+  // These classes and funcions are friends as they need to access private
+  // members of UnitTest.
+  friend class Test;
+  friend class internal::AssertHelper;
+  friend class internal::ScopedTrace;
+  friend class internal::StreamingListenerTest;
+  friend class internal::UnitTestRecordPropertyTestHelper;
+  friend Environment* AddGlobalTestEnvironment(Environment* env);
+  friend internal::UnitTestImpl* internal::GetUnitTestImpl();
+  friend void internal::ReportFailureInUnknownLocation(
+      TestPartResult::Type result_type,
+      const std::string& message);
+
+  // Creates an empty UnitTest.
+  UnitTest();
+
+  // D'tor
+  virtual ~UnitTest();
+
+  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
+  // Google Test trace stack.
+  void PushGTestTrace(const internal::TraceInfo& trace)
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Pops a trace from the per-thread Google Test trace stack.
+  void PopGTestTrace()
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Protects mutable state in *impl_.  This is mutable as some const
+  // methods need to lock it too.
+  mutable internal::Mutex mutex_;
+
+  // Opaque implementation object.  This field is never changed once
+  // the object is constructed.  We don't mark it as const here, as
+  // doing so will cause a warning in the constructor of UnitTest.
+  // Mutable state in *impl_ is protected by mutex_.
+  internal::UnitTestImpl* impl_;
+
+  // We disallow copying UnitTest.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
+};
+
+// A convenient wrapper for adding an environment for the test
+// program.
+//
+// You should call this before RUN_ALL_TESTS() is called, probably in
+// main().  If you use gtest_main, you need to call this before main()
+// starts for it to take effect.  For example, you can define a global
+// variable like this:
+//
+//   testing::Environment* const foo_env =
+//       testing::AddGlobalTestEnvironment(new FooEnvironment);
+//
+// However, we strongly recommend you to write your own main() and
+// call AddGlobalTestEnvironment() there, as relying on initialization
+// of global variables makes the code harder to read and may cause
+// problems when you register multiple environments from different
+// translation units and the environments have dependencies among them
+// (remember that the compiler doesn't guarantee the order in which
+// global variables from different translation units are initialized).
+inline Environment* AddGlobalTestEnvironment(Environment* env) {
+  return UnitTest::GetInstance()->AddEnvironment(env);
+}
+
+// Initializes Google Test.  This must be called before calling
+// RUN_ALL_TESTS().  In particular, it parses a command line for the
+// flags that Google Test recognizes.  Whenever a Google Test flag is
+// seen, it is removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Test flag variables are
+// updated.
+//
+// Calling the function for the second time has no user-visible effect.
+GTEST_API_ void InitGoogleTest(int* argc, char** argv);
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
+
+namespace internal {
+
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_* in a tight loop.
+template <typename T1, typename T2>
+AssertionResult CmpHelperEQFailure(const char* lhs_expression,
+                                   const char* rhs_expression,
+                                   const T1& lhs, const T2& rhs) {
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   FormatForComparisonFailureMessage(lhs, rhs),
+                   FormatForComparisonFailureMessage(rhs, lhs),
+                   false);
+}
+
+// The helper function for {ASSERT|EXPECT}_EQ.
+template <typename T1, typename T2>
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+                            const char* rhs_expression,
+                            const T1& lhs,
+                            const T2& rhs) {
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
+  if (lhs == rhs) {
+    return AssertionSuccess();
+  }
+GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
+}
+
+// With this overloaded version, we allow anonymous enums to be used
+// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
+// can be implicitly cast to BiggestInt.
+GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
+                                       const char* rhs_expression,
+                                       BiggestInt lhs,
+                                       BiggestInt rhs);
+
+// The helper class for {ASSERT|EXPECT}_EQ.  The template argument
+// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
+// is a null pointer literal.  The following default implementation is
+// for lhs_is_null_literal being false.
+template <bool lhs_is_null_literal>
+class EqHelper {
+ public:
+  // This templatized version is for the general case.
+  template <typename T1, typename T2>
+  static AssertionResult Compare(const char* lhs_expression,
+                                 const char* rhs_expression,
+                                 const T1& lhs,
+                                 const T2& rhs) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
+  }
+
+  // With this overloaded version, we allow anonymous enums to be used
+  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
+  // enums can be implicitly cast to BiggestInt.
+  //
+  // Even though its body looks the same as the above version, we
+  // cannot merge the two, as it will make anonymous enums unhappy.
+  static AssertionResult Compare(const char* lhs_expression,
+                                 const char* rhs_expression,
+                                 BiggestInt lhs,
+                                 BiggestInt rhs) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
+  }
+};
+
+// This specialization is used when the first argument to ASSERT_EQ()
+// is a null pointer literal, like NULL, false, or 0.
+template <>
+class EqHelper<true> {
+ public:
+  // We define two overloaded versions of Compare().  The first
+  // version will be picked when the second argument to ASSERT_EQ() is
+  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
+  // EXPECT_EQ(false, a_bool).
+  template <typename T1, typename T2>
+  static AssertionResult Compare(
+      const char* lhs_expression,
+      const char* rhs_expression,
+      const T1& lhs,
+      const T2& rhs,
+      // The following line prevents this overload from being considered if T2
+      // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
+      // expands to Compare("", "", NULL, my_ptr), which requires a conversion
+      // to match the Secret* in the other overload, which would otherwise make
+      // this template match better.
+      typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
+  }
+
+  // This version will be picked when the second argument to ASSERT_EQ() is a
+  // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
+  template <typename T>
+  static AssertionResult Compare(
+      const char* lhs_expression,
+      const char* rhs_expression,
+      // We used to have a second template parameter instead of Secret*.  That
+      // template parameter would deduce to 'long', making this a better match
+      // than the first overload even without the first overload's EnableIf.
+      // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
+      // non-pointer argument" (even a deduced integral argument), so the old
+      // implementation caused warnings in user code.
+      Secret* /* lhs (NULL) */,
+      T* rhs) {
+    // We already know that 'lhs' is a null pointer.
+    return CmpHelperEQ(lhs_expression, rhs_expression,
+                       static_cast<T*>(NULL), rhs);
+  }
+};
+
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_OP in a tight loop.
+template <typename T1, typename T2>
+AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
+                                   const T1& val1, const T2& val2,
+                                   const char* op) {
+  return AssertionFailure()
+         << "Expected: (" << expr1 << ") " << op << " (" << expr2
+         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
+         << " vs " << FormatForComparisonFailureMessage(val2, val1);
+}
+
+// A macro for implementing the helper functions needed to implement
+// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
+// of similar code.
+//
+// For each templatized helper function, we also define an overloaded
+// version for BiggestInt in order to reduce code bloat and allow
+// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
+// with gcc 4.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
+template <typename T1, typename T2>\
+AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
+                                   const T1& val1, const T2& val2) {\
+  if (val1 op val2) {\
+    return AssertionSuccess();\
+  } else {\
+    return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
+  }\
+}\
+GTEST_API_ AssertionResult CmpHelper##op_name(\
+    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+// Implements the helper function for {ASSERT|EXPECT}_NE
+GTEST_IMPL_CMP_HELPER_(NE, !=);
+// Implements the helper function for {ASSERT|EXPECT}_LE
+GTEST_IMPL_CMP_HELPER_(LE, <=);
+// Implements the helper function for {ASSERT|EXPECT}_LT
+GTEST_IMPL_CMP_HELPER_(LT, <);
+// Implements the helper function for {ASSERT|EXPECT}_GE
+GTEST_IMPL_CMP_HELPER_(GE, >=);
+// Implements the helper function for {ASSERT|EXPECT}_GT
+GTEST_IMPL_CMP_HELPER_(GT, >);
+
+#undef GTEST_IMPL_CMP_HELPER_
+
+// The helper function for {ASSERT|EXPECT}_STREQ.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const char* s1,
+                                          const char* s2);
+
+// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
+                                              const char* s2_expression,
+                                              const char* s1,
+                                              const char* s2);
+
+// The helper function for {ASSERT|EXPECT}_STRNE.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const char* s1,
+                                          const char* s2);
+
+// The helper function for {ASSERT|EXPECT}_STRCASENE.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
+                                              const char* s2_expression,
+                                              const char* s1,
+                                              const char* s2);
+
+
+// Helper function for *_STREQ on wide strings.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const wchar_t* s1,
+                                          const wchar_t* s2);
+
+// Helper function for *_STRNE on wide strings.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const wchar_t* s1,
+                                          const wchar_t* s2);
+
+}  // namespace internal
+
+// IsSubstring() and IsNotSubstring() are intended to be used as the
+// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
+// themselves.  They check whether needle is a substring of haystack
+// (NULL is considered a substring of itself only), and return an
+// appropriate error message when they fail.
+//
+// The {needle,haystack}_expr arguments are the stringified
+// expressions that generated the two real arguments.
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack);
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack);
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack);
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack);
+#endif  // GTEST_HAS_STD_WSTRING
+
+namespace internal {
+
+// Helper template function for comparing floating-points.
+//
+// Template parameter:
+//
+//   RawType: the raw floating-point type (either float or double)
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+template <typename RawType>
+AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
+                                         const char* rhs_expression,
+                                         RawType lhs_value,
+                                         RawType rhs_value) {
+  const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
+
+  if (lhs.AlmostEquals(rhs)) {
+    return AssertionSuccess();
+  }
+
+  ::std::stringstream lhs_ss;
+  lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+         << lhs_value;
+
+  ::std::stringstream rhs_ss;
+  rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+         << rhs_value;
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   StringStreamToString(&lhs_ss),
+                   StringStreamToString(&rhs_ss),
+                   false);
+}
+
+// Helper function for implementing ASSERT_NEAR.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
+                                                const char* expr2,
+                                                const char* abs_error_expr,
+                                                double val1,
+                                                double val2,
+                                                double abs_error);
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+// A class that enables one to stream messages to assertion macros
+class GTEST_API_ AssertHelper {
+ public:
+  // Constructor.
+  AssertHelper(TestPartResult::Type type,
+               const char* file,
+               int line,
+               const char* message);
+  ~AssertHelper();
+
+  // Message assignment is a semantic trick to enable assertion
+  // streaming; see the GTEST_MESSAGE_ macro below.
+  void operator=(const Message& message) const;
+
+ private:
+  // We put our data in a struct so that the size of the AssertHelper class can
+  // be as small as possible.  This is important because gcc is incapable of
+  // re-using stack space even for temporary variables, so every EXPECT_EQ
+  // reserves stack space for another AssertHelper.
+  struct AssertHelperData {
+    AssertHelperData(TestPartResult::Type t,
+                     const char* srcfile,
+                     int line_num,
+                     const char* msg)
+        : type(t), file(srcfile), line(line_num), message(msg) { }
+
+    TestPartResult::Type const type;
+    const char* const file;
+    int const line;
+    std::string const message;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
+  };
+
+  AssertHelperData* const data_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
+};
+
+}  // namespace internal
+
+#if GTEST_HAS_PARAM_TEST
+// The pure interface class that all value-parameterized tests inherit from.
+// A value-parameterized class must inherit from both ::testing::Test and
+// ::testing::WithParamInterface. In most cases that just means inheriting
+// from ::testing::TestWithParam, but more complicated test hierarchies
+// may need to inherit from Test and WithParamInterface at different levels.
+//
+// This interface has support for accessing the test parameter value via
+// the GetParam() method.
+//
+// Use it with one of the parameter generator defining functions, like Range(),
+// Values(), ValuesIn(), Bool(), and Combine().
+//
+// class FooTest : public ::testing::TestWithParam<int> {
+//  protected:
+//   FooTest() {
+//     // Can use GetParam() here.
+//   }
+//   virtual ~FooTest() {
+//     // Can use GetParam() here.
+//   }
+//   virtual void SetUp() {
+//     // Can use GetParam() here.
+//   }
+//   virtual void TearDown {
+//     // Can use GetParam() here.
+//   }
+// };
+// TEST_P(FooTest, DoesBar) {
+//   // Can use GetParam() method here.
+//   Foo foo;
+//   ASSERT_TRUE(foo.DoesBar(GetParam()));
+// }
+// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
+
+template <typename T>
+class WithParamInterface {
+ public:
+  typedef T ParamType;
+  virtual ~WithParamInterface() {}
+
+  // The current parameter value. Is also available in the test fixture's
+  // constructor. This member function is non-static, even though it only
+  // references static data, to reduce the opportunity for incorrect uses
+  // like writing 'WithParamInterface<bool>::GetParam()' for a test that
+  // uses a fixture whose parameter type is int.
+  const ParamType& GetParam() const {
+    GTEST_CHECK_(parameter_ != NULL)
+        << "GetParam() can only be called inside a value-parameterized test "
+        << "-- did you intend to write TEST_P instead of TEST_F?";
+    return *parameter_;
+  }
+
+ private:
+  // Sets parameter value. The caller is responsible for making sure the value
+  // remains alive and unchanged throughout the current test.
+  static void SetParam(const ParamType* parameter) {
+    parameter_ = parameter;
+  }
+
+  // Static value used for accessing parameter during a test lifetime.
+  static const ParamType* parameter_;
+
+  // TestClass must be a subclass of WithParamInterface<T> and Test.
+  template <class TestClass> friend class internal::ParameterizedTestFactory;
+};
+
+template <typename T>
+const T* WithParamInterface<T>::parameter_ = NULL;
+
+// Most value-parameterized classes can ignore the existence of
+// WithParamInterface, and can just inherit from ::testing::TestWithParam.
+
+template <typename T>
+class TestWithParam : public Test, public WithParamInterface<T> {
+};
+
+#endif  // GTEST_HAS_PARAM_TEST
+
+// Macros for indicating success/failure in test code.
+
+// ADD_FAILURE unconditionally adds a failure to the current test.
+// SUCCEED generates a success - it doesn't automatically make the
+// current test successful, as a test is only successful when it has
+// no failure.
+//
+// EXPECT_* verifies that a certain condition is satisfied.  If not,
+// it behaves like ADD_FAILURE.  In particular:
+//
+//   EXPECT_TRUE  verifies that a Boolean condition is true.
+//   EXPECT_FALSE verifies that a Boolean condition is false.
+//
+// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
+// that they will also abort the current function on failure.  People
+// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
+// writing data-driven tests often find themselves using ADD_FAILURE
+// and EXPECT_* more.
+
+// Generates a nonfatal failure with a generic message.
+#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
+
+// Generates a nonfatal failure at the given source file location with
+// a generic message.
+#define ADD_FAILURE_AT(file, line) \
+  GTEST_MESSAGE_AT_(file, line, "Failed", \
+                    ::testing::TestPartResult::kNonFatalFailure)
+
+// Generates a fatal failure with a generic message.
+#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
+
+// Define this macro to 1 to omit the definition of FAIL(), which is a
+// generic name and clashes with some other libraries.
+#if !GTEST_DONT_DEFINE_FAIL
+# define FAIL() GTEST_FAIL()
+#endif
+
+// Generates a success with a generic message.
+#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
+
+// Define this macro to 1 to omit the definition of SUCCEED(), which
+// is a generic name and clashes with some other libraries.
+#if !GTEST_DONT_DEFINE_SUCCEED
+# define SUCCEED() GTEST_SUCCEED()
+#endif
+
+// Macros for testing exceptions.
+//
+//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
+//         Tests that the statement throws the expected exception.
+//    * {ASSERT|EXPECT}_NO_THROW(statement):
+//         Tests that the statement doesn't throw any exception.
+//    * {ASSERT|EXPECT}_ANY_THROW(statement):
+//         Tests that the statement throws an exception.
+
+#define EXPECT_THROW(statement, expected_exception) \
+  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_NO_THROW(statement) \
+  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_ANY_THROW(statement) \
+  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_THROW(statement, expected_exception) \
+  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
+#define ASSERT_NO_THROW(statement) \
+  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
+#define ASSERT_ANY_THROW(statement) \
+  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
+
+// Boolean assertions. Condition can be either a Boolean expression or an
+// AssertionResult. For more information on how to use AssertionResult with
+// these macros see comments on that class.
+#define EXPECT_TRUE(condition) \
+  GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
+                      GTEST_NONFATAL_FAILURE_)
+#define EXPECT_FALSE(condition) \
+  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
+                      GTEST_NONFATAL_FAILURE_)
+#define ASSERT_TRUE(condition) \
+  GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
+                      GTEST_FATAL_FAILURE_)
+#define ASSERT_FALSE(condition) \
+  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
+                      GTEST_FATAL_FAILURE_)
+
+// Includes the auto-generated header that implements a family of
+// generic predicate assertion macros.
+#include "gtest/gtest_pred_impl.h"
+
+// Macros for testing equalities and inequalities.
+//
+//    * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
+//    * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
+//    * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
+//    * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
+//    * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
+//    * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
+//
+// When they are not, Google Test prints both the tested expressions and
+// their actual values.  The values must be compatible built-in types,
+// or you will get a compiler error.  By "compatible" we mean that the
+// values can be compared by the respective operator.
+//
+// Note:
+//
+//   1. It is possible to make a user-defined type work with
+//   {ASSERT|EXPECT}_??(), but that requires overloading the
+//   comparison operators and is thus discouraged by the Google C++
+//   Usage Guide.  Therefore, you are advised to use the
+//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
+//   equal.
+//
+//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
+//   pointers (in particular, C strings).  Therefore, if you use it
+//   with two C strings, you are testing how their locations in memory
+//   are related, not how their content is related.  To compare two C
+//   strings by content, use {ASSERT|EXPECT}_STR*().
+//
+//   3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
+//   {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
+//   what the actual value is when it fails, and similarly for the
+//   other comparisons.
+//
+//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
+//   evaluate their arguments, which is undefined.
+//
+//   5. These macros evaluate their arguments exactly once.
+//
+// Examples:
+//
+//   EXPECT_NE(5, Foo());
+//   EXPECT_EQ(NULL, a_pointer);
+//   ASSERT_LT(i, array_size);
+//   ASSERT_GT(records.size(), 0) << "There is no record left.";
+
+#define EXPECT_EQ(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal:: \
+                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+                      val1, val2)
+#define EXPECT_NE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
+#define EXPECT_LE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
+#define EXPECT_LT(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
+#define EXPECT_GE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
+#define EXPECT_GT(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
+
+#define GTEST_ASSERT_EQ(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal:: \
+                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+                      val1, val2)
+#define GTEST_ASSERT_NE(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
+#define GTEST_ASSERT_LE(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
+#define GTEST_ASSERT_LT(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
+#define GTEST_ASSERT_GE(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
+#define GTEST_ASSERT_GT(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
+
+// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
+// ASSERT_XY(), which clashes with some users' own code.
+
+#if !GTEST_DONT_DEFINE_ASSERT_EQ
+# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_NE
+# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_LE
+# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_LT
+# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_GE
+# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_GT
+# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
+#endif
+
+// C-string Comparisons.  All tests treat NULL and any non-NULL string
+// as different.  Two NULLs are equal.
+//
+//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
+//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
+//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
+//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
+//
+// For wide or narrow string objects, you can use the
+// {ASSERT|EXPECT}_??() macros.
+//
+// Don't depend on the order in which the arguments are evaluated,
+// which is undefined.
+//
+// These macros evaluate their arguments exactly once.
+
+#define EXPECT_STREQ(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
+#define EXPECT_STRNE(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
+#define EXPECT_STRCASEEQ(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
+#define EXPECT_STRCASENE(s1, s2)\
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
+
+#define ASSERT_STREQ(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
+#define ASSERT_STRNE(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
+#define ASSERT_STRCASEEQ(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
+#define ASSERT_STRCASENE(s1, s2)\
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
+
+// Macros for comparing floating-point numbers.
+//
+//    * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
+//         Tests that two float values are almost equal.
+//    * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
+//         Tests that two double values are almost equal.
+//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
+//         Tests that v1 and v2 are within the given distance to each other.
+//
+// Google Test uses ULP-based comparison to automatically pick a default
+// error bound that is appropriate for the operands.  See the
+// FloatingPoint template class in gtest-internal.h if you are
+// interested in the implementation details.
+
+#define EXPECT_FLOAT_EQ(val1, val2)\
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
+                      val1, val2)
+
+#define EXPECT_DOUBLE_EQ(val1, val2)\
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
+                      val1, val2)
+
+#define ASSERT_FLOAT_EQ(val1, val2)\
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
+                      val1, val2)
+
+#define ASSERT_DOUBLE_EQ(val1, val2)\
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
+                      val1, val2)
+
+#define EXPECT_NEAR(val1, val2, abs_error)\
+  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
+                      val1, val2, abs_error)
+
+#define ASSERT_NEAR(val1, val2, abs_error)\
+  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
+                      val1, val2, abs_error)
+
+// These predicate format functions work on floating-point values, and
+// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
+//
+//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
+
+// Asserts that val1 is less than, or almost equal to, val2.  Fails
+// otherwise.  In particular, it fails if either val1 or val2 is NaN.
+GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
+                                   float val1, float val2);
+GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
+                                    double val1, double val2);
+
+
+#if GTEST_OS_WINDOWS
+
+// Macros that test for HRESULT failure and success, these are only useful
+// on Windows, and rely on Windows SDK macros and APIs to compile.
+//
+//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
+//
+// When expr unexpectedly fails or succeeds, Google Test prints the
+// expected result and the actual result with both a human-readable
+// string representation of the error, if available, as well as the
+// hex result code.
+# define EXPECT_HRESULT_SUCCEEDED(expr) \
+    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
+
+# define ASSERT_HRESULT_SUCCEEDED(expr) \
+    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
+
+# define EXPECT_HRESULT_FAILED(expr) \
+    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+
+# define ASSERT_HRESULT_FAILED(expr) \
+    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+
+#endif  // GTEST_OS_WINDOWS
+
+// Macros that execute statement and check that it doesn't generate new fatal
+// failures in the current thread.
+//
+//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
+//
+// Examples:
+//
+//   EXPECT_NO_FATAL_FAILURE(Process());
+//   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
+//
+#define ASSERT_NO_FATAL_FAILURE(statement) \
+    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
+#define EXPECT_NO_FATAL_FAILURE(statement) \
+    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
+
+// Causes a trace (including the source file path, the current line
+// number, and the given message) to be included in every test failure
+// message generated by code in the current scope.  The effect is
+// undone when the control leaves the current scope.
+//
+// The message argument can be anything streamable to std::ostream.
+//
+// In the implementation, we include the current line number as part
+// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
+// to appear in the same block - as long as they are on different
+// lines.
+#define SCOPED_TRACE(message) \
+  ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
+    __FILE__, __LINE__, ::testing::Message() << (message))
+
+// Compile-time assertion for type equality.
+// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
+// the same type.  The value it returns is not interesting.
+//
+// Instead of making StaticAssertTypeEq a class template, we make it a
+// function template that invokes a helper class template.  This
+// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
+// defining objects of that type.
+//
+// CAVEAT:
+//
+// When used inside a method of a class template,
+// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
+// instantiated.  For example, given:
+//
+//   template <typename T> class Foo {
+//    public:
+//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
+//   };
+//
+// the code:
+//
+//   void Test1() { Foo<bool> foo; }
+//
+// will NOT generate a compiler error, as Foo<bool>::Bar() is never
+// actually instantiated.  Instead, you need:
+//
+//   void Test2() { Foo<bool> foo; foo.Bar(); }
+//
+// to cause a compiler error.
+template <typename T1, typename T2>
+bool StaticAssertTypeEq() {
+  (void)internal::StaticAssertTypeEqHelper<T1, T2>();
+  return true;
+}
+
+// Defines a test.
+//
+// The first parameter is the name of the test case, and the second
+// parameter is the name of the test within the test case.
+//
+// The convention is to end the test case name with "Test".  For
+// example, a test case for the Foo class can be named FooTest.
+//
+// Test code should appear between braces after an invocation of
+// this macro.  Example:
+//
+//   TEST(FooTest, InitializesCorrectly) {
+//     Foo foo;
+//     EXPECT_TRUE(foo.StatusIsOK());
+//   }
+
+// Note that we call GetTestTypeId() instead of GetTypeId<
+// ::testing::Test>() here to get the type ID of testing::Test.  This
+// is to work around a suspected linker bug when using Google Test as
+// a framework on Mac OS X.  The bug causes GetTypeId<
+// ::testing::Test>() to return different values depending on whether
+// the call is from the Google Test framework itself or from user test
+// code.  GetTestTypeId() is guaranteed to always return the same
+// value, as it always calls GetTypeId<>() from the Google Test
+// framework.
+#define GTEST_TEST(test_case_name, test_name)\
+  GTEST_TEST_(test_case_name, test_name, \
+              ::testing::Test, ::testing::internal::GetTestTypeId())
+
+// Define this macro to 1 to omit the definition of TEST(), which
+// is a generic name and clashes with some other libraries.
+#if !GTEST_DONT_DEFINE_TEST
+# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
+#endif
+
+// Defines a test that uses a test fixture.
+//
+// The first parameter is the name of the test fixture class, which
+// also doubles as the test case name.  The second parameter is the
+// name of the test within the test case.
+//
+// A test fixture class must be declared earlier.  The user should put
+// his test code between braces after using this macro.  Example:
+//
+//   class FooTest : public testing::Test {
+//    protected:
+//     virtual void SetUp() { b_.AddElement(3); }
+//
+//     Foo a_;
+//     Foo b_;
+//   };
+//
+//   TEST_F(FooTest, InitializesCorrectly) {
+//     EXPECT_TRUE(a_.StatusIsOK());
+//   }
+//
+//   TEST_F(FooTest, ReturnsElementCountCorrectly) {
+//     EXPECT_EQ(0, a_.size());
+//     EXPECT_EQ(1, b_.size());
+//   }
+
+#define TEST_F(test_fixture, test_name)\
+  GTEST_TEST_(test_fixture, test_name, test_fixture, \
+              ::testing::internal::GetTypeId<test_fixture>())
+
+}  // namespace testing
+
+// Use this function in main() to run all tests.  It returns 0 if all
+// tests are successful, or 1 otherwise.
+//
+// RUN_ALL_TESTS() should be invoked after the command line has been
+// parsed by InitGoogleTest().
+//
+// This function was formerly a macro; thus, it is in the global
+// namespace and has an all-caps name.
+int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
+
+inline int RUN_ALL_TESTS() {
+  return ::testing::UnitTest::GetInstance()->Run();
+}
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest_pred_impl.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest_pred_impl.h
new file mode 100644
index 0000000..30ae712
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest_pred_impl.h
@@ -0,0 +1,358 @@
+// Copyright 2006, 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.
+
+// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
+// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
+//
+// Implements a family of generic predicate assertion macros.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
+
+// Makes sure this header is not included before gtest.h.
+#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
+# error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
+#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
+
+// This header implements a family of generic predicate assertion
+// macros:
+//
+//   ASSERT_PRED_FORMAT1(pred_format, v1)
+//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
+//   ...
+//
+// where pred_format is a function or functor that takes n (in the
+// case of ASSERT_PRED_FORMATn) values and their source expression
+// text, and returns a testing::AssertionResult.  See the definition
+// of ASSERT_EQ in gtest.h for an example.
+//
+// If you don't care about formatting, you can use the more
+// restrictive version:
+//
+//   ASSERT_PRED1(pred, v1)
+//   ASSERT_PRED2(pred, v1, v2)
+//   ...
+//
+// where pred is an n-ary function or functor that returns bool,
+// and the values v1, v2, ..., must support the << operator for
+// streaming to std::ostream.
+//
+// We also define the EXPECT_* variations.
+//
+// For now we only support predicates whose arity is at most 5.
+// Please email googletestframework@googlegroups.com if you need
+// support for higher arities.
+
+// GTEST_ASSERT_ is the basic statement to which all of the assertions
+// in this file reduce.  Don't use this in your code.
+
+#define GTEST_ASSERT_(expression, on_failure) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (const ::testing::AssertionResult gtest_ar = (expression)) \
+    ; \
+  else \
+    on_failure(gtest_ar.failure_message())
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1>
+AssertionResult AssertPred1Helper(const char* pred_text,
+                                  const char* e1,
+                                  Pred pred,
+                                  const T1& v1) {
+  if (pred(v1)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, v1), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
+// this in your code.
+#define GTEST_PRED1_(pred, v1, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
+                                             #v1, \
+                                             pred, \
+                                             v1), on_failure)
+
+// Unary predicate assertion macros.
+#define EXPECT_PRED_FORMAT1(pred_format, v1) \
+  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED1(pred, v1) \
+  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT1(pred_format, v1) \
+  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED1(pred, v1) \
+  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2>
+AssertionResult AssertPred2Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2) {
+  if (pred(v1, v2)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
+// this in your code.
+#define GTEST_PRED2_(pred, v1, v2, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             pred, \
+                                             v1, \
+                                             v2), on_failure)
+
+// Binary predicate assertion macros.
+#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
+  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED2(pred, v1, v2) \
+  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
+  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED2(pred, v1, v2) \
+  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2,
+          typename T3>
+AssertionResult AssertPred3Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  const char* e3,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2,
+                                  const T3& v3) {
+  if (pred(v1, v2, v3)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ", "
+                            << e3 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2
+                            << "\n" << e3 << " evaluates to " << v3;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
+// this in your code.
+#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             #v3, \
+                                             pred, \
+                                             v1, \
+                                             v2, \
+                                             v3), on_failure)
+
+// Ternary predicate assertion macros.
+#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
+  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED3(pred, v1, v2, v3) \
+  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
+  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED3(pred, v1, v2, v3) \
+  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4>
+AssertionResult AssertPred4Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  const char* e3,
+                                  const char* e4,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2,
+                                  const T3& v3,
+                                  const T4& v4) {
+  if (pred(v1, v2, v3, v4)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ", "
+                            << e3 << ", "
+                            << e4 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2
+                            << "\n" << e3 << " evaluates to " << v3
+                            << "\n" << e4 << " evaluates to " << v4;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
+// this in your code.
+#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             #v3, \
+                                             #v4, \
+                                             pred, \
+                                             v1, \
+                                             v2, \
+                                             v3, \
+                                             v4), on_failure)
+
+// 4-ary predicate assertion macros.
+#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
+  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
+  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
+  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
+  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5>
+AssertionResult AssertPred5Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  const char* e3,
+                                  const char* e4,
+                                  const char* e5,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2,
+                                  const T3& v3,
+                                  const T4& v4,
+                                  const T5& v5) {
+  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ", "
+                            << e3 << ", "
+                            << e4 << ", "
+                            << e5 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2
+                            << "\n" << e3 << " evaluates to " << v3
+                            << "\n" << e4 << " evaluates to " << v4
+                            << "\n" << e5 << " evaluates to " << v5;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
+// this in your code.
+#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             #v3, \
+                                             #v4, \
+                                             #v5, \
+                                             pred, \
+                                             v1, \
+                                             v2, \
+                                             v3, \
+                                             v4, \
+                                             v5), on_failure)
+
+// 5-ary predicate assertion macros.
+#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
+  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
+  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
+  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
+  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
+
+
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest_prod.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest_prod.h
new file mode 100644
index 0000000..da80ddc
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/gtest_prod.h
@@ -0,0 +1,58 @@
+// Copyright 2006, 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 C++ Testing Framework definitions useful in production code.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
+
+// When you need to test the private or protected members of a class,
+// use the FRIEND_TEST macro to declare your tests as friends of the
+// class.  For example:
+//
+// class MyClass {
+//  private:
+//   void MyMethod();
+//   FRIEND_TEST(MyClassTest, MyMethod);
+// };
+//
+// class MyClassTest : public testing::Test {
+//   // ...
+// };
+//
+// TEST_F(MyClassTest, MyMethod) {
+//   // Can call MyClass::MyMethod() here.
+// }
+
+#define FRIEND_TEST(test_case_name, test_name)\
+friend class test_case_name##_##test_name##_Test
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest-port.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest-port.h
new file mode 100644
index 0000000..7e744bd
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest-port.h
@@ -0,0 +1,69 @@
+// Copyright 2015, 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.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+//   Flag related macros:
+//     GTEST_FLAG(flag_name)
+//     GTEST_USE_OWN_FLAGFILE_FLAG_  - Define to 0 when the system provides its
+//                                     own flagfile flag parsing.
+//     GTEST_DECLARE_bool_(name)
+//     GTEST_DECLARE_int32_(name)
+//     GTEST_DECLARE_string_(name)
+//     GTEST_DEFINE_bool_(name, default_val, doc)
+//     GTEST_DEFINE_int32_(name, default_val, doc)
+//     GTEST_DEFINE_string_(name, default_val, doc)
+//
+//   Test filtering:
+//     GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
+//                                  will be used if --GTEST_FLAG(test_filter)
+//                                  is not provided.
+//
+//   Logging:
+//     GTEST_LOG_(severity)
+//     GTEST_CHECK_(condition)
+//     Functions LogToStderr() and FlushInfoLog() have to be provided too.
+//
+//   Threading:
+//     GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
+//     GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
+//                                         already provided.
+//     Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
+//     GTEST_DEFINE_STATIC_MUTEX_(mutex)
+//
+//     GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+//     GTEST_LOCK_EXCLUDED_(locks)
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest-printers.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest-printers.h
new file mode 100644
index 0000000..60c1ea0
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest-printers.h
@@ -0,0 +1,42 @@
+// Copyright 2015, 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.
+//
+// This file provides an injection point for custom printers in a local
+// installation of gTest.
+// It will be included from gtest-printers.h and the overrides in this file
+// will be visible to everyone.
+// See documentation at gtest/gtest-printers.h for details on how to define a
+// custom printer.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest.h
new file mode 100644
index 0000000..c27412a
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/custom/gtest.h
@@ -0,0 +1,41 @@
+// Copyright 2015, 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.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+// GTEST_OS_STACK_TRACE_GETTER_  - The name of an implementation of
+//                                 OsStackTraceGetterInterface.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h
new file mode 100644
index 0000000..2b3a78f
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h
@@ -0,0 +1,319 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines internal utilities needed for implementing
+// death tests.  They are subject to change without notice.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
+
+#include "gtest/internal/gtest-internal.h"
+
+#include <stdio.h>
+
+namespace testing {
+namespace internal {
+
+GTEST_DECLARE_string_(internal_run_death_test);
+
+// Names of the flags (needed for parsing Google Test flags).
+const char kDeathTestStyleFlag[] = "death_test_style";
+const char kDeathTestUseFork[] = "death_test_use_fork";
+const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
+
+#if GTEST_HAS_DEATH_TEST
+
+// DeathTest is a class that hides much of the complexity of the
+// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
+// returns a concrete class that depends on the prevailing death test
+// style, as defined by the --gtest_death_test_style and/or
+// --gtest_internal_run_death_test flags.
+
+// In describing the results of death tests, these terms are used with
+// the corresponding definitions:
+//
+// exit status:  The integer exit information in the format specified
+//               by wait(2)
+// exit code:    The integer code passed to exit(3), _exit(2), or
+//               returned from main()
+class GTEST_API_ DeathTest {
+ public:
+  // Create returns false if there was an error determining the
+  // appropriate action to take for the current death test; for example,
+  // if the gtest_death_test_style flag is set to an invalid value.
+  // The LastMessage method will return a more detailed message in that
+  // case.  Otherwise, the DeathTest pointer pointed to by the "test"
+  // argument is set.  If the death test should be skipped, the pointer
+  // is set to NULL; otherwise, it is set to the address of a new concrete
+  // DeathTest object that controls the execution of the current test.
+  static bool Create(const char* statement, const RE* regex,
+                     const char* file, int line, DeathTest** test);
+  DeathTest();
+  virtual ~DeathTest() { }
+
+  // A helper class that aborts a death test when it's deleted.
+  class ReturnSentinel {
+   public:
+    explicit ReturnSentinel(DeathTest* test) : test_(test) { }
+    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
+   private:
+    DeathTest* const test_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
+  } GTEST_ATTRIBUTE_UNUSED_;
+
+  // An enumeration of possible roles that may be taken when a death
+  // test is encountered.  EXECUTE means that the death test logic should
+  // be executed immediately.  OVERSEE means that the program should prepare
+  // the appropriate environment for a child process to execute the death
+  // test, then wait for it to complete.
+  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
+
+  // An enumeration of the three reasons that a test might be aborted.
+  enum AbortReason {
+    TEST_ENCOUNTERED_RETURN_STATEMENT,
+    TEST_THREW_EXCEPTION,
+    TEST_DID_NOT_DIE
+  };
+
+  // Assumes one of the above roles.
+  virtual TestRole AssumeRole() = 0;
+
+  // Waits for the death test to finish and returns its status.
+  virtual int Wait() = 0;
+
+  // Returns true if the death test passed; that is, the test process
+  // exited during the test, its exit status matches a user-supplied
+  // predicate, and its stderr output matches a user-supplied regular
+  // expression.
+  // The user-supplied predicate may be a macro expression rather
+  // than a function pointer or functor, or else Wait and Passed could
+  // be combined.
+  virtual bool Passed(bool exit_status_ok) = 0;
+
+  // Signals that the death test did not die as expected.
+  virtual void Abort(AbortReason reason) = 0;
+
+  // Returns a human-readable outcome message regarding the outcome of
+  // the last death test.
+  static const char* LastMessage();
+
+  static void set_last_death_test_message(const std::string& message);
+
+ private:
+  // A string containing a description of the outcome of the last death test.
+  static std::string last_death_test_message_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
+};
+
+// Factory interface for death tests.  May be mocked out for testing.
+class DeathTestFactory {
+ public:
+  virtual ~DeathTestFactory() { }
+  virtual bool Create(const char* statement, const RE* regex,
+                      const char* file, int line, DeathTest** test) = 0;
+};
+
+// A concrete DeathTestFactory implementation for normal use.
+class DefaultDeathTestFactory : public DeathTestFactory {
+ public:
+  virtual bool Create(const char* statement, const RE* regex,
+                      const char* file, int line, DeathTest** test);
+};
+
+// Returns true if exit_status describes a process that was terminated
+// by a signal, or exited normally with a nonzero exit code.
+GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
+
+// Traps C++ exceptions escaping statement and reports them as test
+// failures. Note that trapping SEH exceptions is not implemented here.
+# if GTEST_HAS_EXCEPTIONS
+#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
+  try { \
+    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+  } catch (const ::std::exception& gtest_exception) { \
+    fprintf(\
+        stderr, \
+        "\n%s: Caught std::exception-derived exception escaping the " \
+        "death test statement. Exception message: %s\n", \
+        ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
+        gtest_exception.what()); \
+    fflush(stderr); \
+    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
+  } catch (...) { \
+    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
+  }
+
+# else
+#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
+  GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
+
+# endif
+
+// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
+// ASSERT_EXIT*, and EXPECT_EXIT*.
+# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    const ::testing::internal::RE& gtest_regex = (regex); \
+    ::testing::internal::DeathTest* gtest_dt; \
+    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
+        __FILE__, __LINE__, &gtest_dt)) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
+    } \
+    if (gtest_dt != NULL) { \
+      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
+          gtest_dt_ptr(gtest_dt); \
+      switch (gtest_dt->AssumeRole()) { \
+        case ::testing::internal::DeathTest::OVERSEE_TEST: \
+          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
+            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
+          } \
+          break; \
+        case ::testing::internal::DeathTest::EXECUTE_TEST: { \
+          ::testing::internal::DeathTest::ReturnSentinel \
+              gtest_sentinel(gtest_dt); \
+          GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
+          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
+          break; \
+        } \
+        default: \
+          break; \
+      } \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
+      fail(::testing::internal::DeathTest::LastMessage())
+// The symbol "fail" here expands to something into which a message
+// can be streamed.
+
+// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
+// NDEBUG mode. In this case we need the statements to be executed, the regex is
+// ignored, and the macro must accept a streamed message even though the message
+// is never printed.
+# define GTEST_EXECUTE_STATEMENT_(statement, regex) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+  } else \
+    ::testing::Message()
+
+// A class representing the parsed contents of the
+// --gtest_internal_run_death_test flag, as it existed when
+// RUN_ALL_TESTS was called.
+class InternalRunDeathTestFlag {
+ public:
+  InternalRunDeathTestFlag(const std::string& a_file,
+                           int a_line,
+                           int an_index,
+                           int a_write_fd)
+      : file_(a_file), line_(a_line), index_(an_index),
+        write_fd_(a_write_fd) {}
+
+  ~InternalRunDeathTestFlag() {
+    if (write_fd_ >= 0)
+      posix::Close(write_fd_);
+  }
+
+  const std::string& file() const { return file_; }
+  int line() const { return line_; }
+  int index() const { return index_; }
+  int write_fd() const { return write_fd_; }
+
+ private:
+  std::string file_;
+  int line_;
+  int index_;
+  int write_fd_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
+};
+
+// Returns a newly created InternalRunDeathTestFlag object with fields
+// initialized from the GTEST_FLAG(internal_run_death_test) flag if
+// the flag is specified; otherwise returns NULL.
+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
+
+#else  // GTEST_HAS_DEATH_TEST
+
+// This macro is used for implementing macros such as
+// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
+// death tests are not supported. Those macros must compile on such systems
+// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
+// systems that support death tests. This allows one to write such a macro
+// on a system that does not support death tests and be sure that it will
+// compile on a death-test supporting system.
+//
+// Parameters:
+//   statement -  A statement that a macro such as EXPECT_DEATH would test
+//                for program termination. This macro has to make sure this
+//                statement is compiled but not executed, to ensure that
+//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
+//                parameter iff EXPECT_DEATH compiles with it.
+//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
+//                the output of statement.  This parameter has to be
+//                compiled but not evaluated by this macro, to ensure that
+//                this macro only accepts expressions that a macro such as
+//                EXPECT_DEATH would accept.
+//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
+//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
+//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
+//                compile inside functions where ASSERT_DEATH doesn't
+//                compile.
+//
+//  The branch that has an always false condition is used to ensure that
+//  statement and regex are compiled (and thus syntactically correct) but
+//  never executed. The unreachable code macro protects the terminator
+//  statement from generating an 'unreachable code' warning in case
+//  statement unconditionally returns or throws. The Message constructor at
+//  the end allows the syntax of streaming additional messages into the
+//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
+# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
+    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+    if (::testing::internal::AlwaysTrue()) { \
+      GTEST_LOG_(WARNING) \
+          << "Death tests are not supported on this platform.\n" \
+          << "Statement '" #statement "' cannot be verified."; \
+    } else if (::testing::internal::AlwaysFalse()) { \
+      ::testing::internal::RE::PartialMatch(".*", (regex)); \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+      terminator; \
+    } else \
+      ::testing::Message()
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h
new file mode 100644
index 0000000..7a13b4b
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h
@@ -0,0 +1,206 @@
+// 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: keith.ray@gmail.com (Keith Ray)
+//
+// Google Test filepath utilities
+//
+// This header file declares classes and functions used internally by
+// Google Test.  They are subject to change without notice.
+//
+// This file is #included in <gtest/internal/gtest-internal.h>.
+// Do not include this header file separately!
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
+
+#include "gtest/internal/gtest-string.h"
+
+namespace testing {
+namespace internal {
+
+// FilePath - a class for file and directory pathname manipulation which
+// handles platform-specific conventions (like the pathname separator).
+// Used for helper functions for naming files in a directory for xml output.
+// Except for Set methods, all methods are const or static, which provides an
+// "immutable value object" -- useful for peace of mind.
+// A FilePath with a value ending in a path separator ("like/this/") represents
+// a directory, otherwise it is assumed to represent a file. In either case,
+// it may or may not represent an actual file or directory in the file system.
+// Names are NOT checked for syntax correctness -- no checking for illegal
+// characters, malformed paths, etc.
+
+class GTEST_API_ FilePath {
+ public:
+  FilePath() : pathname_("") { }
+  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
+
+  explicit FilePath(const std::string& pathname) : pathname_(pathname) {
+    Normalize();
+  }
+
+  FilePath& operator=(const FilePath& rhs) {
+    Set(rhs);
+    return *this;
+  }
+
+  void Set(const FilePath& rhs) {
+    pathname_ = rhs.pathname_;
+  }
+
+  const std::string& string() const { return pathname_; }
+  const char* c_str() const { return pathname_.c_str(); }
+
+  // Returns the current working directory, or "" if unsuccessful.
+  static FilePath GetCurrentDir();
+
+  // Given directory = "dir", base_name = "test", number = 0,
+  // extension = "xml", returns "dir/test.xml". If number is greater
+  // than zero (e.g., 12), returns "dir/test_12.xml".
+  // On Windows platform, uses \ as the separator rather than /.
+  static FilePath MakeFileName(const FilePath& directory,
+                               const FilePath& base_name,
+                               int number,
+                               const char* extension);
+
+  // Given directory = "dir", relative_path = "test.xml",
+  // returns "dir/test.xml".
+  // On Windows, uses \ as the separator rather than /.
+  static FilePath ConcatPaths(const FilePath& directory,
+                              const FilePath& relative_path);
+
+  // Returns a pathname for a file that does not currently exist. The pathname
+  // will be directory/base_name.extension or
+  // directory/base_name_<number>.extension if directory/base_name.extension
+  // already exists. The number will be incremented until a pathname is found
+  // that does not already exist.
+  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
+  // There could be a race condition if two or more processes are calling this
+  // function at the same time -- they could both pick the same filename.
+  static FilePath GenerateUniqueFileName(const FilePath& directory,
+                                         const FilePath& base_name,
+                                         const char* extension);
+
+  // Returns true iff the path is "".
+  bool IsEmpty() const { return pathname_.empty(); }
+
+  // If input name has a trailing separator character, removes it and returns
+  // the name, otherwise return the name string unmodified.
+  // On Windows platform, uses \ as the separator, other platforms use /.
+  FilePath RemoveTrailingPathSeparator() const;
+
+  // Returns a copy of the FilePath with the directory part removed.
+  // Example: FilePath("path/to/file").RemoveDirectoryName() returns
+  // FilePath("file"). If there is no directory part ("just_a_file"), it returns
+  // the FilePath unmodified. If there is no file part ("just_a_dir/") it
+  // returns an empty FilePath ("").
+  // On Windows platform, '\' is the path separator, otherwise it is '/'.
+  FilePath RemoveDirectoryName() const;
+
+  // RemoveFileName returns the directory path with the filename removed.
+  // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
+  // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
+  // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
+  // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
+  // On Windows platform, '\' is the path separator, otherwise it is '/'.
+  FilePath RemoveFileName() const;
+
+  // Returns a copy of the FilePath with the case-insensitive extension removed.
+  // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
+  // FilePath("dir/file"). If a case-insensitive extension is not
+  // found, returns a copy of the original FilePath.
+  FilePath RemoveExtension(const char* extension) const;
+
+  // Creates directories so that path exists. Returns true if successful or if
+  // the directories already exist; returns false if unable to create
+  // directories for any reason. Will also return false if the FilePath does
+  // not represent a directory (that is, it doesn't end with a path separator).
+  bool CreateDirectoriesRecursively() const;
+
+  // Create the directory so that path exists. Returns true if successful or
+  // if the directory already exists; returns false if unable to create the
+  // directory for any reason, including if the parent directory does not
+  // exist. Not named "CreateDirectory" because that's a macro on Windows.
+  bool CreateFolder() const;
+
+  // Returns true if FilePath describes something in the file-system,
+  // either a file, directory, or whatever, and that something exists.
+  bool FileOrDirectoryExists() const;
+
+  // Returns true if pathname describes a directory in the file-system
+  // that exists.
+  bool DirectoryExists() const;
+
+  // Returns true if FilePath ends with a path separator, which indicates that
+  // it is intended to represent a directory. Returns false otherwise.
+  // This does NOT check that a directory (or file) actually exists.
+  bool IsDirectory() const;
+
+  // Returns true if pathname describes a root directory. (Windows has one
+  // root directory per disk drive.)
+  bool IsRootDirectory() const;
+
+  // Returns true if pathname describes an absolute path.
+  bool IsAbsolutePath() const;
+
+ private:
+  // Replaces multiple consecutive separators with a single separator.
+  // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
+  // redundancies that might be in a pathname involving "." or "..".
+  //
+  // A pathname with multiple consecutive separators may occur either through
+  // user error or as a result of some scripts or APIs that generate a pathname
+  // with a trailing separator. On other platforms the same API or script
+  // may NOT generate a pathname with a trailing "/". Then elsewhere that
+  // pathname may have another "/" and pathname components added to it,
+  // without checking for the separator already being there.
+  // The script language and operating system may allow paths like "foo//bar"
+  // but some of the functions in FilePath will not handle that correctly. In
+  // particular, RemoveTrailingPathSeparator() only removes one separator, and
+  // it is called in CreateDirectoriesRecursively() assuming that it will change
+  // a pathname from directory syntax (trailing separator) to filename syntax.
+  //
+  // On Windows this method also replaces the alternate path separator '/' with
+  // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
+  // "bar\\foo".
+
+  void Normalize();
+
+  // Returns a pointer to the last occurence of a valid path separator in
+  // the FilePath. On Windows, for example, both '/' and '\' are valid path
+  // separators. Returns NULL if no path separator was found.
+  const char* FindLastPathSeparator() const;
+
+  std::string pathname_;
+};  // class FilePath
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-internal.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-internal.h
new file mode 100644
index 0000000..ebd1cf6
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-internal.h
@@ -0,0 +1,1238 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file declares functions and macros used internally by
+// Google Test.  They are subject to change without notice.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_OS_LINUX
+# include <stdlib.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <unistd.h>
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_HAS_EXCEPTIONS
+# include <stdexcept>
+#endif
+
+#include <ctype.h>
+#include <float.h>
+#include <string.h>
+#include <iomanip>
+#include <limits>
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-string.h"
+#include "gtest/internal/gtest-filepath.h"
+#include "gtest/internal/gtest-type-util.h"
+
+// Due to C++ preprocessor weirdness, we need double indirection to
+// concatenate two tokens when one of them is __LINE__.  Writing
+//
+//   foo ## __LINE__
+//
+// will result in the token foo__LINE__, instead of foo followed by
+// the current line number.  For more details, see
+// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
+#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
+#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
+
+class ProtocolMessage;
+namespace proto2 { class Message; }
+
+namespace testing {
+
+// Forward declarations.
+
+class AssertionResult;                 // Result of an assertion.
+class Message;                         // Represents a failure message.
+class Test;                            // Represents a test.
+class TestInfo;                        // Information about a test.
+class TestPartResult;                  // Result of a test part.
+class UnitTest;                        // A collection of test cases.
+
+template <typename T>
+::std::string PrintToString(const T& value);
+
+namespace internal {
+
+struct TraceInfo;                      // Information about a trace point.
+class ScopedTrace;                     // Implements scoped trace.
+class TestInfoImpl;                    // Opaque implementation of TestInfo
+class UnitTestImpl;                    // Opaque implementation of UnitTest
+
+// The text used in failure messages to indicate the start of the
+// stack trace.
+GTEST_API_ extern const char kStackTraceMarker[];
+
+// Two overloaded helpers for checking at compile time whether an
+// expression is a null pointer literal (i.e. NULL or any 0-valued
+// compile-time integral constant).  Their return values have
+// different sizes, so we can use sizeof() to test which version is
+// picked by the compiler.  These helpers have no implementations, as
+// we only need their signatures.
+//
+// Given IsNullLiteralHelper(x), the compiler will pick the first
+// version if x can be implicitly converted to Secret*, and pick the
+// second version otherwise.  Since Secret is a secret and incomplete
+// type, the only expression a user can write that has type Secret* is
+// a null pointer literal.  Therefore, we know that x is a null
+// pointer literal if and only if the first version is picked by the
+// compiler.
+char IsNullLiteralHelper(Secret* p);
+char (&IsNullLiteralHelper(...))[2];  // NOLINT
+
+// A compile-time bool constant that is true if and only if x is a
+// null pointer literal (i.e. NULL or any 0-valued compile-time
+// integral constant).
+#ifdef GTEST_ELLIPSIS_NEEDS_POD_
+// We lose support for NULL detection where the compiler doesn't like
+// passing non-POD classes through ellipsis (...).
+# define GTEST_IS_NULL_LITERAL_(x) false
+#else
+# define GTEST_IS_NULL_LITERAL_(x) \
+    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
+#endif  // GTEST_ELLIPSIS_NEEDS_POD_
+
+// Appends the user-supplied message to the Google-Test-generated message.
+GTEST_API_ std::string AppendUserMessage(
+    const std::string& gtest_msg, const Message& user_msg);
+
+#if GTEST_HAS_EXCEPTIONS
+
+// This exception is thrown by (and only by) a failed Google Test
+// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
+// are enabled).  We derive it from std::runtime_error, which is for
+// errors presumably detectable only at run time.  Since
+// std::runtime_error inherits from std::exception, many testing
+// frameworks know how to extract and print the message inside it.
+class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
+ public:
+  explicit GoogleTestFailureException(const TestPartResult& failure);
+};
+
+#endif  // GTEST_HAS_EXCEPTIONS
+
+// A helper class for creating scoped traces in user programs.
+class GTEST_API_ ScopedTrace {
+ public:
+  // The c'tor pushes the given source file location and message onto
+  // a trace stack maintained by Google Test.
+  ScopedTrace(const char* file, int line, const Message& message);
+
+  // The d'tor pops the info pushed by the c'tor.
+  //
+  // Note that the d'tor is not virtual in order to be efficient.
+  // Don't inherit from ScopedTrace!
+  ~ScopedTrace();
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
+} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
+                            // c'tor and d'tor.  Therefore it doesn't
+                            // need to be used otherwise.
+
+namespace edit_distance {
+// Returns the optimal edits to go from 'left' to 'right'.
+// All edits cost the same, with replace having lower priority than
+// add/remove.
+// Simple implementation of the Wagner–Fischer algorithm.
+// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
+enum EditType { kMatch, kAdd, kRemove, kReplace };
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<size_t>& left, const std::vector<size_t>& right);
+
+// Same as above, but the input is represented as strings.
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<std::string>& left,
+    const std::vector<std::string>& right);
+
+// Create a diff of the input strings in Unified diff format.
+GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+                                         const std::vector<std::string>& right,
+                                         size_t context = 2);
+
+}  // namespace edit_distance
+
+// Calculate the diff between 'left' and 'right' and return it in unified diff
+// format.
+// If not null, stores in 'total_line_count' the total number of lines found
+// in left + right.
+GTEST_API_ std::string DiffStrings(const std::string& left,
+                                   const std::string& right,
+                                   size_t* total_line_count);
+
+// Constructs and returns the message for an equality assertion
+// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
+//
+// The first four parameters are the expressions used in the assertion
+// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
+// where foo is 5 and bar is 6, we have:
+//
+//   expected_expression: "foo"
+//   actual_expression:   "bar"
+//   expected_value:      "5"
+//   actual_value:        "6"
+//
+// The ignoring_case parameter is true iff the assertion is a
+// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
+// be inserted into the message.
+GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
+                                     const char* actual_expression,
+                                     const std::string& expected_value,
+                                     const std::string& actual_value,
+                                     bool ignoring_case);
+
+// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
+GTEST_API_ std::string GetBoolAssertionFailureMessage(
+    const AssertionResult& assertion_result,
+    const char* expression_text,
+    const char* actual_predicate_value,
+    const char* expected_predicate_value);
+
+// This template class represents an IEEE floating-point number
+// (either single-precision or double-precision, depending on the
+// template parameters).
+//
+// The purpose of this class is to do more sophisticated number
+// comparison.  (Due to round-off error, etc, it's very unlikely that
+// two floating-points will be equal exactly.  Hence a naive
+// comparison by the == operation often doesn't work.)
+//
+// Format of IEEE floating-point:
+//
+//   The most-significant bit being the leftmost, an IEEE
+//   floating-point looks like
+//
+//     sign_bit exponent_bits fraction_bits
+//
+//   Here, sign_bit is a single bit that designates the sign of the
+//   number.
+//
+//   For float, there are 8 exponent bits and 23 fraction bits.
+//
+//   For double, there are 11 exponent bits and 52 fraction bits.
+//
+//   More details can be found at
+//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
+//
+// Template parameter:
+//
+//   RawType: the raw floating-point type (either float or double)
+template <typename RawType>
+class FloatingPoint {
+ public:
+  // Defines the unsigned integer type that has the same size as the
+  // floating point number.
+  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
+
+  // Constants.
+
+  // # of bits in a number.
+  static const size_t kBitCount = 8*sizeof(RawType);
+
+  // # of fraction bits in a number.
+  static const size_t kFractionBitCount =
+    std::numeric_limits<RawType>::digits - 1;
+
+  // # of exponent bits in a number.
+  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
+
+  // The mask for the sign bit.
+  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
+
+  // The mask for the fraction bits.
+  static const Bits kFractionBitMask =
+    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
+
+  // The mask for the exponent bits.
+  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
+
+  // How many ULP's (Units in the Last Place) we want to tolerate when
+  // comparing two numbers.  The larger the value, the more error we
+  // allow.  A 0 value means that two numbers must be exactly the same
+  // to be considered equal.
+  //
+  // The maximum error of a single floating-point operation is 0.5
+  // units in the last place.  On Intel CPU's, all floating-point
+  // calculations are done with 80-bit precision, while double has 64
+  // bits.  Therefore, 4 should be enough for ordinary use.
+  //
+  // See the following article for more details on ULP:
+  // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
+  static const size_t kMaxUlps = 4;
+
+  // Constructs a FloatingPoint from a raw floating-point number.
+  //
+  // On an Intel CPU, passing a non-normalized NAN (Not a Number)
+  // around may change its bits, although the new value is guaranteed
+  // to be also a NAN.  Therefore, don't expect this constructor to
+  // preserve the bits in x when x is a NAN.
+  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
+
+  // Static methods
+
+  // Reinterprets a bit pattern as a floating-point number.
+  //
+  // This function is needed to test the AlmostEquals() method.
+  static RawType ReinterpretBits(const Bits bits) {
+    FloatingPoint fp(0);
+    fp.u_.bits_ = bits;
+    return fp.u_.value_;
+  }
+
+  // Returns the floating-point number that represent positive infinity.
+  static RawType Infinity() {
+    return ReinterpretBits(kExponentBitMask);
+  }
+
+  // Returns the maximum representable finite floating-point number.
+  static RawType Max();
+
+  // Non-static methods
+
+  // Returns the bits that represents this number.
+  const Bits &bits() const { return u_.bits_; }
+
+  // Returns the exponent bits of this number.
+  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
+
+  // Returns the fraction bits of this number.
+  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
+
+  // Returns the sign bit of this number.
+  Bits sign_bit() const { return kSignBitMask & u_.bits_; }
+
+  // Returns true iff this is NAN (not a number).
+  bool is_nan() const {
+    // It's a NAN if the exponent bits are all ones and the fraction
+    // bits are not entirely zeros.
+    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
+  }
+
+  // Returns true iff this number is at most kMaxUlps ULP's away from
+  // rhs.  In particular, this function:
+  //
+  //   - returns false if either number is (or both are) NAN.
+  //   - treats really large numbers as almost equal to infinity.
+  //   - thinks +0.0 and -0.0 are 0 DLP's apart.
+  bool AlmostEquals(const FloatingPoint& rhs) const {
+    // The IEEE standard says that any comparison operation involving
+    // a NAN must return false.
+    if (is_nan() || rhs.is_nan()) return false;
+
+    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
+        <= kMaxUlps;
+  }
+
+ private:
+  // The data type used to store the actual floating-point number.
+  union FloatingPointUnion {
+    RawType value_;  // The raw floating-point number.
+    Bits bits_;      // The bits that represent the number.
+  };
+
+  // Converts an integer from the sign-and-magnitude representation to
+  // the biased representation.  More precisely, let N be 2 to the
+  // power of (kBitCount - 1), an integer x is represented by the
+  // unsigned number x + N.
+  //
+  // For instance,
+  //
+  //   -N + 1 (the most negative number representable using
+  //          sign-and-magnitude) is represented by 1;
+  //   0      is represented by N; and
+  //   N - 1  (the biggest number representable using
+  //          sign-and-magnitude) is represented by 2N - 1.
+  //
+  // Read http://en.wikipedia.org/wiki/Signed_number_representations
+  // for more details on signed number representations.
+  static Bits SignAndMagnitudeToBiased(const Bits &sam) {
+    if (kSignBitMask & sam) {
+      // sam represents a negative number.
+      return ~sam + 1;
+    } else {
+      // sam represents a positive number.
+      return kSignBitMask | sam;
+    }
+  }
+
+  // Given two numbers in the sign-and-magnitude representation,
+  // returns the distance between them as an unsigned number.
+  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
+                                                     const Bits &sam2) {
+    const Bits biased1 = SignAndMagnitudeToBiased(sam1);
+    const Bits biased2 = SignAndMagnitudeToBiased(sam2);
+    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
+  }
+
+  FloatingPointUnion u_;
+};
+
+// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
+// macro defined by <windows.h>.
+template <>
+inline float FloatingPoint<float>::Max() { return FLT_MAX; }
+template <>
+inline double FloatingPoint<double>::Max() { return DBL_MAX; }
+
+// Typedefs the instances of the FloatingPoint template class that we
+// care to use.
+typedef FloatingPoint<float> Float;
+typedef FloatingPoint<double> Double;
+
+// In order to catch the mistake of putting tests that use different
+// test fixture classes in the same test case, we need to assign
+// unique IDs to fixture classes and compare them.  The TypeId type is
+// used to hold such IDs.  The user should treat TypeId as an opaque
+// type: the only operation allowed on TypeId values is to compare
+// them for equality using the == operator.
+typedef const void* TypeId;
+
+template <typename T>
+class TypeIdHelper {
+ public:
+  // dummy_ must not have a const type.  Otherwise an overly eager
+  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
+  // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
+  static bool dummy_;
+};
+
+template <typename T>
+bool TypeIdHelper<T>::dummy_ = false;
+
+// GetTypeId<T>() returns the ID of type T.  Different values will be
+// returned for different types.  Calling the function twice with the
+// same type argument is guaranteed to return the same ID.
+template <typename T>
+TypeId GetTypeId() {
+  // The compiler is required to allocate a different
+  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
+  // the template.  Therefore, the address of dummy_ is guaranteed to
+  // be unique.
+  return &(TypeIdHelper<T>::dummy_);
+}
+
+// Returns the type ID of ::testing::Test.  Always call this instead
+// of GetTypeId< ::testing::Test>() to get the type ID of
+// ::testing::Test, as the latter may give the wrong result due to a
+// suspected linker bug when compiling Google Test as a Mac OS X
+// framework.
+GTEST_API_ TypeId GetTestTypeId();
+
+// Defines the abstract factory interface that creates instances
+// of a Test object.
+class TestFactoryBase {
+ public:
+  virtual ~TestFactoryBase() {}
+
+  // Creates a test instance to run. The instance is both created and destroyed
+  // within TestInfoImpl::Run()
+  virtual Test* CreateTest() = 0;
+
+ protected:
+  TestFactoryBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
+};
+
+// This class provides implementation of TeastFactoryBase interface.
+// It is used in TEST and TEST_F macros.
+template <class TestClass>
+class TestFactoryImpl : public TestFactoryBase {
+ public:
+  virtual Test* CreateTest() { return new TestClass; }
+};
+
+#if GTEST_OS_WINDOWS
+
+// Predicate-formatters for implementing the HRESULT checking macros
+// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
+// We pass a long instead of HRESULT to avoid causing an
+// include dependency for the HRESULT type.
+GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
+                                            long hr);  // NOLINT
+GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
+                                            long hr);  // NOLINT
+
+#endif  // GTEST_OS_WINDOWS
+
+// Types of SetUpTestCase() and TearDownTestCase() functions.
+typedef void (*SetUpTestCaseFunc)();
+typedef void (*TearDownTestCaseFunc)();
+
+struct CodeLocation {
+  CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {}
+
+  string file;
+  int line;
+};
+
+// Creates a new TestInfo object and registers it with Google Test;
+// returns the created object.
+//
+// Arguments:
+//
+//   test_case_name:   name of the test case
+//   name:             name of the test
+//   type_param        the name of the test's type parameter, or NULL if
+//                     this is not a typed or a type-parameterized test.
+//   value_param       text representation of the test's value parameter,
+//                     or NULL if this is not a type-parameterized test.
+//   code_location:    code location where the test is defined
+//   fixture_class_id: ID of the test fixture class
+//   set_up_tc:        pointer to the function that sets up the test case
+//   tear_down_tc:     pointer to the function that tears down the test case
+//   factory:          pointer to the factory that creates a test object.
+//                     The newly created TestInfo instance will assume
+//                     ownership of the factory object.
+GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
+    const char* test_case_name,
+    const char* name,
+    const char* type_param,
+    const char* value_param,
+    CodeLocation code_location,
+    TypeId fixture_class_id,
+    SetUpTestCaseFunc set_up_tc,
+    TearDownTestCaseFunc tear_down_tc,
+    TestFactoryBase* factory);
+
+// If *pstr starts with the given prefix, modifies *pstr to be right
+// past the prefix and returns true; otherwise leaves *pstr unchanged
+// and returns false.  None of pstr, *pstr, and prefix can be NULL.
+GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
+
+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// State of the definition of a type-parameterized test case.
+class GTEST_API_ TypedTestCasePState {
+ public:
+  TypedTestCasePState() : registered_(false) {}
+
+  // Adds the given test name to defined_test_names_ and return true
+  // if the test case hasn't been registered; otherwise aborts the
+  // program.
+  bool AddTestName(const char* file, int line, const char* case_name,
+                   const char* test_name) {
+    if (registered_) {
+      fprintf(stderr, "%s Test %s must be defined before "
+              "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
+              FormatFileLocation(file, line).c_str(), test_name, case_name);
+      fflush(stderr);
+      posix::Abort();
+    }
+    registered_tests_.insert(
+        ::std::make_pair(test_name, CodeLocation(file, line)));
+    return true;
+  }
+
+  bool TestExists(const std::string& test_name) const {
+    return registered_tests_.count(test_name) > 0;
+  }
+
+  const CodeLocation& GetCodeLocation(const std::string& test_name) const {
+    RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
+    GTEST_CHECK_(it != registered_tests_.end());
+    return it->second;
+  }
+
+  // Verifies that registered_tests match the test names in
+  // defined_test_names_; returns registered_tests if successful, or
+  // aborts the program otherwise.
+  const char* VerifyRegisteredTestNames(
+      const char* file, int line, const char* registered_tests);
+
+ private:
+  typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
+
+  bool registered_;
+  RegisteredTestsMap registered_tests_;
+};
+
+// Skips to the first non-space char after the first comma in 'str';
+// returns NULL if no comma is found in 'str'.
+inline const char* SkipComma(const char* str) {
+  const char* comma = strchr(str, ',');
+  if (comma == NULL) {
+    return NULL;
+  }
+  while (IsSpace(*(++comma))) {}
+  return comma;
+}
+
+// Returns the prefix of 'str' before the first comma in it; returns
+// the entire string if it contains no comma.
+inline std::string GetPrefixUntilComma(const char* str) {
+  const char* comma = strchr(str, ',');
+  return comma == NULL ? str : std::string(str, comma);
+}
+
+// Splits a given string on a given delimiter, populating a given
+// vector with the fields.
+void SplitString(const ::std::string& str, char delimiter,
+                 ::std::vector< ::std::string>* dest);
+
+// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
+// registers a list of type-parameterized tests with Google Test.  The
+// return value is insignificant - we just need to return something
+// such that we can call this function in a namespace scope.
+//
+// Implementation note: The GTEST_TEMPLATE_ macro declares a template
+// template parameter.  It's defined in gtest-type-util.h.
+template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
+class TypeParameterizedTest {
+ public:
+  // 'index' is the index of the test in the type list 'Types'
+  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
+  // Types).  Valid values for 'index' are [0, N - 1] where N is the
+  // length of Types.
+  static bool Register(const char* prefix,
+                       CodeLocation code_location,
+                       const char* case_name, const char* test_names,
+                       int index) {
+    typedef typename Types::Head Type;
+    typedef Fixture<Type> FixtureClass;
+    typedef typename GTEST_BIND_(TestSel, Type) TestClass;
+
+    // First, registers the first type-parameterized test in the type
+    // list.
+    MakeAndRegisterTestInfo(
+        (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
+         + StreamableToString(index)).c_str(),
+        StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
+        GetTypeName<Type>().c_str(),
+        NULL,  // No value parameter.
+        code_location,
+        GetTypeId<FixtureClass>(),
+        TestClass::SetUpTestCase,
+        TestClass::TearDownTestCase,
+        new TestFactoryImpl<TestClass>);
+
+    // Next, recurses (at compile time) with the tail of the type list.
+    return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
+        ::Register(prefix, code_location, case_name, test_names, index + 1);
+  }
+};
+
+// The base case for the compile time recursion.
+template <GTEST_TEMPLATE_ Fixture, class TestSel>
+class TypeParameterizedTest<Fixture, TestSel, Types0> {
+ public:
+  static bool Register(const char* /*prefix*/, CodeLocation,
+                       const char* /*case_name*/, const char* /*test_names*/,
+                       int /*index*/) {
+    return true;
+  }
+};
+
+// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
+// registers *all combinations* of 'Tests' and 'Types' with Google
+// Test.  The return value is insignificant - we just need to return
+// something such that we can call this function in a namespace scope.
+template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
+class TypeParameterizedTestCase {
+ public:
+  static bool Register(const char* prefix, CodeLocation code_location,
+                       const TypedTestCasePState* state,
+                       const char* case_name, const char* test_names) {
+    std::string test_name = StripTrailingSpaces(
+        GetPrefixUntilComma(test_names));
+    if (!state->TestExists(test_name)) {
+      fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
+              case_name, test_name.c_str(),
+              FormatFileLocation(code_location.file.c_str(),
+                                 code_location.line).c_str());
+      fflush(stderr);
+      posix::Abort();
+    }
+    const CodeLocation& test_location = state->GetCodeLocation(test_name);
+
+    typedef typename Tests::Head Head;
+
+    // First, register the first test in 'Test' for each type in 'Types'.
+    TypeParameterizedTest<Fixture, Head, Types>::Register(
+        prefix, test_location, case_name, test_names, 0);
+
+    // Next, recurses (at compile time) with the tail of the test list.
+    return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
+        ::Register(prefix, code_location, state,
+                   case_name, SkipComma(test_names));
+  }
+};
+
+// The base case for the compile time recursion.
+template <GTEST_TEMPLATE_ Fixture, typename Types>
+class TypeParameterizedTestCase<Fixture, Templates0, Types> {
+ public:
+  static bool Register(const char* /*prefix*/, CodeLocation,
+                       const TypedTestCasePState* /*state*/,
+                       const char* /*case_name*/, const char* /*test_names*/) {
+    return true;
+  }
+};
+
+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// Returns the current OS stack trace as an std::string.
+//
+// The maximum number of stack frames to be included is specified by
+// the gtest_stack_trace_depth flag.  The skip_count parameter
+// specifies the number of top frames to be skipped, which doesn't
+// count against the number of frames to be included.
+//
+// For example, if Foo() calls Bar(), which in turn calls
+// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
+// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
+GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
+    UnitTest* unit_test, int skip_count);
+
+// Helpers for suppressing warnings on unreachable code or constant
+// condition.
+
+// Always returns true.
+GTEST_API_ bool AlwaysTrue();
+
+// Always returns false.
+inline bool AlwaysFalse() { return !AlwaysTrue(); }
+
+// Helper for suppressing false warning from Clang on a const char*
+// variable declared in a conditional expression always being NULL in
+// the else branch.
+struct GTEST_API_ ConstCharPtr {
+  ConstCharPtr(const char* str) : value(str) {}
+  operator bool() const { return true; }
+  const char* value;
+};
+
+// A simple Linear Congruential Generator for generating random
+// numbers with a uniform distribution.  Unlike rand() and srand(), it
+// doesn't use global state (and therefore can't interfere with user
+// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
+// but it's good enough for our purposes.
+class GTEST_API_ Random {
+ public:
+  static const UInt32 kMaxRange = 1u << 31;
+
+  explicit Random(UInt32 seed) : state_(seed) {}
+
+  void Reseed(UInt32 seed) { state_ = seed; }
+
+  // Generates a random number from [0, range).  Crashes if 'range' is
+  // 0 or greater than kMaxRange.
+  UInt32 Generate(UInt32 range);
+
+ private:
+  UInt32 state_;
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
+};
+
+// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
+// compiler error iff T1 and T2 are different types.
+template <typename T1, typename T2>
+struct CompileAssertTypesEqual;
+
+template <typename T>
+struct CompileAssertTypesEqual<T, T> {
+};
+
+// Removes the reference from a type if it is a reference type,
+// otherwise leaves it unchanged.  This is the same as
+// tr1::remove_reference, which is not widely available yet.
+template <typename T>
+struct RemoveReference { typedef T type; };  // NOLINT
+template <typename T>
+struct RemoveReference<T&> { typedef T type; };  // NOLINT
+
+// A handy wrapper around RemoveReference that works when the argument
+// T depends on template parameters.
+#define GTEST_REMOVE_REFERENCE_(T) \
+    typename ::testing::internal::RemoveReference<T>::type
+
+// Removes const from a type if it is a const type, otherwise leaves
+// it unchanged.  This is the same as tr1::remove_const, which is not
+// widely available yet.
+template <typename T>
+struct RemoveConst { typedef T type; };  // NOLINT
+template <typename T>
+struct RemoveConst<const T> { typedef T type; };  // NOLINT
+
+// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
+// definition to fail to remove the const in 'const int[3]' and 'const
+// char[3][4]'.  The following specialization works around the bug.
+template <typename T, size_t N>
+struct RemoveConst<const T[N]> {
+  typedef typename RemoveConst<T>::type type[N];
+};
+
+#if defined(_MSC_VER) && _MSC_VER < 1400
+// This is the only specialization that allows VC++ 7.1 to remove const in
+// 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
+// and thus needs to be conditionally compiled.
+template <typename T, size_t N>
+struct RemoveConst<T[N]> {
+  typedef typename RemoveConst<T>::type type[N];
+};
+#endif
+
+// A handy wrapper around RemoveConst that works when the argument
+// T depends on template parameters.
+#define GTEST_REMOVE_CONST_(T) \
+    typename ::testing::internal::RemoveConst<T>::type
+
+// Turns const U&, U&, const U, and U all into U.
+#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
+    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
+
+// Adds reference to a type if it is not a reference type,
+// otherwise leaves it unchanged.  This is the same as
+// tr1::add_reference, which is not widely available yet.
+template <typename T>
+struct AddReference { typedef T& type; };  // NOLINT
+template <typename T>
+struct AddReference<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper around AddReference that works when the argument T
+// depends on template parameters.
+#define GTEST_ADD_REFERENCE_(T) \
+    typename ::testing::internal::AddReference<T>::type
+
+// Adds a reference to const on top of T as necessary.  For example,
+// it transforms
+//
+//   char         ==> const char&
+//   const char   ==> const char&
+//   char&        ==> const char&
+//   const char&  ==> const char&
+//
+// The argument T must depend on some template parameters.
+#define GTEST_REFERENCE_TO_CONST_(T) \
+    GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
+
+// ImplicitlyConvertible<From, To>::value is a compile-time bool
+// constant that's true iff type From can be implicitly converted to
+// type To.
+template <typename From, typename To>
+class ImplicitlyConvertible {
+ private:
+  // We need the following helper functions only for their types.
+  // They have no implementations.
+
+  // MakeFrom() is an expression whose type is From.  We cannot simply
+  // use From(), as the type From may not have a public default
+  // constructor.
+  static typename AddReference<From>::type MakeFrom();
+
+  // These two functions are overloaded.  Given an expression
+  // Helper(x), the compiler will pick the first version if x can be
+  // implicitly converted to type To; otherwise it will pick the
+  // second version.
+  //
+  // The first version returns a value of size 1, and the second
+  // version returns a value of size 2.  Therefore, by checking the
+  // size of Helper(x), which can be done at compile time, we can tell
+  // which version of Helper() is used, and hence whether x can be
+  // implicitly converted to type To.
+  static char Helper(To);
+  static char (&Helper(...))[2];  // NOLINT
+
+  // We have to put the 'public' section after the 'private' section,
+  // or MSVC refuses to compile the code.
+ public:
+#if defined(__BORLANDC__)
+  // C++Builder cannot use member overload resolution during template
+  // instantiation.  The simplest workaround is to use its C++0x type traits
+  // functions (C++Builder 2009 and above only).
+  static const bool value = __is_convertible(From, To);
+#else
+  // MSVC warns about implicitly converting from double to int for
+  // possible loss of data, so we need to temporarily disable the
+  // warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
+  static const bool value =
+      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif  // __BORLANDC__
+};
+template <typename From, typename To>
+const bool ImplicitlyConvertible<From, To>::value;
+
+// IsAProtocolMessage<T>::value is a compile-time bool constant that's
+// true iff T is type ProtocolMessage, proto2::Message, or a subclass
+// of those.
+template <typename T>
+struct IsAProtocolMessage
+    : public bool_constant<
+  ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
+  ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
+};
+
+// When the compiler sees expression IsContainerTest<C>(0), if C is an
+// STL-style container class, the first overload of IsContainerTest
+// will be viable (since both C::iterator* and C::const_iterator* are
+// valid types and NULL can be implicitly converted to them).  It will
+// be picked over the second overload as 'int' is a perfect match for
+// the type of argument 0.  If C::iterator or C::const_iterator is not
+// a valid type, the first overload is not viable, and the second
+// overload will be picked.  Therefore, we can determine whether C is
+// a container class by checking the type of IsContainerTest<C>(0).
+// The value of the expression is insignificant.
+//
+// Note that we look for both C::iterator and C::const_iterator.  The
+// reason is that C++ injects the name of a class as a member of the
+// class itself (e.g. you can refer to class iterator as either
+// 'iterator' or 'iterator::iterator').  If we look for C::iterator
+// only, for example, we would mistakenly think that a class named
+// iterator is an STL container.
+//
+// Also note that the simpler approach of overloading
+// IsContainerTest(typename C::const_iterator*) and
+// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
+typedef int IsContainer;
+template <class C>
+IsContainer IsContainerTest(int /* dummy */,
+                            typename C::iterator* /* it */ = NULL,
+                            typename C::const_iterator* /* const_it */ = NULL) {
+  return 0;
+}
+
+typedef char IsNotContainer;
+template <class C>
+IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
+
+// EnableIf<condition>::type is void when 'Cond' is true, and
+// undefined when 'Cond' is false.  To use SFINAE to make a function
+// overload only apply when a particular expression is true, add
+// "typename EnableIf<expression>::type* = 0" as the last parameter.
+template<bool> struct EnableIf;
+template<> struct EnableIf<true> { typedef void type; };  // NOLINT
+
+// Utilities for native arrays.
+
+// ArrayEq() compares two k-dimensional native arrays using the
+// elements' operator==, where k can be any integer >= 0.  When k is
+// 0, ArrayEq() degenerates into comparing a single pair of values.
+
+template <typename T, typename U>
+bool ArrayEq(const T* lhs, size_t size, const U* rhs);
+
+// This generic version is used when k is 0.
+template <typename T, typename U>
+inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
+
+// This overload is used when k >= 1.
+template <typename T, typename U, size_t N>
+inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
+  return internal::ArrayEq(lhs, N, rhs);
+}
+
+// This helper reduces code bloat.  If we instead put its logic inside
+// the previous ArrayEq() function, arrays with different sizes would
+// lead to different copies of the template code.
+template <typename T, typename U>
+bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
+  for (size_t i = 0; i != size; i++) {
+    if (!internal::ArrayEq(lhs[i], rhs[i]))
+      return false;
+  }
+  return true;
+}
+
+// Finds the first element in the iterator range [begin, end) that
+// equals elem.  Element may be a native array type itself.
+template <typename Iter, typename Element>
+Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
+  for (Iter it = begin; it != end; ++it) {
+    if (internal::ArrayEq(*it, elem))
+      return it;
+  }
+  return end;
+}
+
+// CopyArray() copies a k-dimensional native array using the elements'
+// operator=, where k can be any integer >= 0.  When k is 0,
+// CopyArray() degenerates into copying a single value.
+
+template <typename T, typename U>
+void CopyArray(const T* from, size_t size, U* to);
+
+// This generic version is used when k is 0.
+template <typename T, typename U>
+inline void CopyArray(const T& from, U* to) { *to = from; }
+
+// This overload is used when k >= 1.
+template <typename T, typename U, size_t N>
+inline void CopyArray(const T(&from)[N], U(*to)[N]) {
+  internal::CopyArray(from, N, *to);
+}
+
+// This helper reduces code bloat.  If we instead put its logic inside
+// the previous CopyArray() function, arrays with different sizes
+// would lead to different copies of the template code.
+template <typename T, typename U>
+void CopyArray(const T* from, size_t size, U* to) {
+  for (size_t i = 0; i != size; i++) {
+    internal::CopyArray(from[i], to + i);
+  }
+}
+
+// The relation between an NativeArray object (see below) and the
+// native array it represents.
+// We use 2 different structs to allow non-copyable types to be used, as long
+// as RelationToSourceReference() is passed.
+struct RelationToSourceReference {};
+struct RelationToSourceCopy {};
+
+// Adapts a native array to a read-only STL-style container.  Instead
+// of the complete STL container concept, this adaptor only implements
+// members useful for Google Mock's container matchers.  New members
+// should be added as needed.  To simplify the implementation, we only
+// support Element being a raw type (i.e. having no top-level const or
+// reference modifier).  It's the client's responsibility to satisfy
+// this requirement.  Element can be an array type itself (hence
+// multi-dimensional arrays are supported).
+template <typename Element>
+class NativeArray {
+ public:
+  // STL-style container typedefs.
+  typedef Element value_type;
+  typedef Element* iterator;
+  typedef const Element* const_iterator;
+
+  // Constructs from a native array. References the source.
+  NativeArray(const Element* array, size_t count, RelationToSourceReference) {
+    InitRef(array, count);
+  }
+
+  // Constructs from a native array. Copies the source.
+  NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
+    InitCopy(array, count);
+  }
+
+  // Copy constructor.
+  NativeArray(const NativeArray& rhs) {
+    (this->*rhs.clone_)(rhs.array_, rhs.size_);
+  }
+
+  ~NativeArray() {
+    if (clone_ != &NativeArray::InitRef)
+      delete[] array_;
+  }
+
+  // STL-style container methods.
+  size_t size() const { return size_; }
+  const_iterator begin() const { return array_; }
+  const_iterator end() const { return array_ + size_; }
+  bool operator==(const NativeArray& rhs) const {
+    return size() == rhs.size() &&
+        ArrayEq(begin(), size(), rhs.begin());
+  }
+
+ private:
+  enum {
+    kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
+        Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
+  };
+
+  // Initializes this object with a copy of the input.
+  void InitCopy(const Element* array, size_t a_size) {
+    Element* const copy = new Element[a_size];
+    CopyArray(array, a_size, copy);
+    array_ = copy;
+    size_ = a_size;
+    clone_ = &NativeArray::InitCopy;
+  }
+
+  // Initializes this object with a reference of the input.
+  void InitRef(const Element* array, size_t a_size) {
+    array_ = array;
+    size_ = a_size;
+    clone_ = &NativeArray::InitRef;
+  }
+
+  const Element* array_;
+  size_t size_;
+  void (NativeArray::*clone_)(const Element*, size_t);
+
+  GTEST_DISALLOW_ASSIGN_(NativeArray);
+};
+
+}  // namespace internal
+}  // namespace testing
+
+#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
+  ::testing::internal::AssertHelper(result_type, file, line, message) \
+    = ::testing::Message()
+
+#define GTEST_MESSAGE_(message, result_type) \
+  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
+
+#define GTEST_FATAL_FAILURE_(message) \
+  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
+
+#define GTEST_NONFATAL_FAILURE_(message) \
+  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
+
+#define GTEST_SUCCESS_(message) \
+  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
+
+// Suppresses MSVC warnings 4072 (unreachable code) for the code following
+// statement if it returns or throws (or doesn't return or throw in some
+// situations).
+#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
+  if (::testing::internal::AlwaysTrue()) { statement; }
+
+#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::ConstCharPtr gtest_msg = "") { \
+    bool gtest_caught_expected = false; \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (expected_exception const&) { \
+      gtest_caught_expected = true; \
+    } \
+    catch (...) { \
+      gtest_msg.value = \
+          "Expected: " #statement " throws an exception of type " \
+          #expected_exception ".\n  Actual: it throws a different type."; \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
+    } \
+    if (!gtest_caught_expected) { \
+      gtest_msg.value = \
+          "Expected: " #statement " throws an exception of type " \
+          #expected_exception ".\n  Actual: it throws nothing."; \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
+      fail(gtest_msg.value)
+
+#define GTEST_TEST_NO_THROW_(statement, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (...) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
+      fail("Expected: " #statement " doesn't throw an exception.\n" \
+           "  Actual: it throws.")
+
+#define GTEST_TEST_ANY_THROW_(statement, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    bool gtest_caught_any = false; \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (...) { \
+      gtest_caught_any = true; \
+    } \
+    if (!gtest_caught_any) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
+      fail("Expected: " #statement " throws an exception.\n" \
+           "  Actual: it doesn't.")
+
+
+// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
+// either a boolean expression or an AssertionResult. text is a textual
+// represenation of expression as it was passed into the EXPECT_TRUE.
+#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (const ::testing::AssertionResult gtest_ar_ = \
+      ::testing::AssertionResult(expression)) \
+    ; \
+  else \
+    fail(::testing::internal::GetBoolAssertionFailureMessage(\
+        gtest_ar_, text, #actual, #expected).c_str())
+
+#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
+    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
+      fail("Expected: " #statement " doesn't generate new fatal " \
+           "failures in the current thread.\n" \
+           "  Actual: it does.")
+
+// Expands to the name of the class that implements the given test.
+#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
+  test_case_name##_##test_name##_Test
+
+// Helper macro for defining tests.
+#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
+class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
+ public:\
+  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
+ private:\
+  virtual void TestBody();\
+  static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(\
+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
+};\
+\
+::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
+  ::test_info_ =\
+    ::testing::internal::MakeAndRegisterTestInfo(\
+        #test_case_name, #test_name, NULL, NULL, \
+        ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+        (parent_id), \
+        parent_class::SetUpTestCase, \
+        parent_class::TearDownTestCase, \
+        new ::testing::internal::TestFactoryImpl<\
+            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
+void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h
new file mode 100644
index 0000000..3602942
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h
@@ -0,0 +1,243 @@
+// Copyright 2003 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.
+//
+// Authors: Dan Egnor (egnor@google.com)
+//
+// A "smart" pointer type with reference tracking.  Every pointer to a
+// particular object is kept on a circular linked list.  When the last pointer
+// to an object is destroyed or reassigned, the object is deleted.
+//
+// Used properly, this deletes the object when the last reference goes away.
+// There are several caveats:
+// - Like all reference counting schemes, cycles lead to leaks.
+// - Each smart pointer is actually two pointers (8 bytes instead of 4).
+// - Every time a pointer is assigned, the entire list of pointers to that
+//   object is traversed.  This class is therefore NOT SUITABLE when there
+//   will often be more than two or three pointers to a particular object.
+// - References are only tracked as long as linked_ptr<> objects are copied.
+//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
+//   will happen (double deletion).
+//
+// A good use of this class is storing object references in STL containers.
+// You can safely put linked_ptr<> in a vector<>.
+// Other uses may not be as good.
+//
+// Note: If you use an incomplete type with linked_ptr<>, the class
+// *containing* linked_ptr<> must have a constructor and destructor (even
+// if they do nothing!).
+//
+// Bill Gibbons suggested we use something like this.
+//
+// Thread Safety:
+//   Unlike other linked_ptr implementations, in this implementation
+//   a linked_ptr object is thread-safe in the sense that:
+//     - it's safe to copy linked_ptr objects concurrently,
+//     - it's safe to copy *from* a linked_ptr and read its underlying
+//       raw pointer (e.g. via get()) concurrently, and
+//     - it's safe to write to two linked_ptrs that point to the same
+//       shared object concurrently.
+// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
+// confusion with normal linked_ptr.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
+
+#include <stdlib.h>
+#include <assert.h>
+
+#include "gtest/internal/gtest-port.h"
+
+namespace testing {
+namespace internal {
+
+// Protects copying of all linked_ptr objects.
+GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
+
+// This is used internally by all instances of linked_ptr<>.  It needs to be
+// a non-template class because different types of linked_ptr<> can refer to
+// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
+// So, it needs to be possible for different types of linked_ptr to participate
+// in the same circular linked list, so we need a single class type here.
+//
+// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
+class linked_ptr_internal {
+ public:
+  // Create a new circle that includes only this instance.
+  void join_new() {
+    next_ = this;
+  }
+
+  // Many linked_ptr operations may change p.link_ for some linked_ptr
+  // variable p in the same circle as this object.  Therefore we need
+  // to prevent two such operations from occurring concurrently.
+  //
+  // Note that different types of linked_ptr objects can coexist in a
+  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
+  // linked_ptr<Derived2>).  Therefore we must use a single mutex to
+  // protect all linked_ptr objects.  This can create serious
+  // contention in production code, but is acceptable in a testing
+  // framework.
+
+  // Join an existing circle.
+  void join(linked_ptr_internal const* ptr)
+      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
+    MutexLock lock(&g_linked_ptr_mutex);
+
+    linked_ptr_internal const* p = ptr;
+    while (p->next_ != ptr) {
+      assert(p->next_ != this &&
+             "Trying to join() a linked ring we are already in. "
+             "Is GMock thread safety enabled?");
+      p = p->next_;
+    }
+    p->next_ = this;
+    next_ = ptr;
+  }
+
+  // Leave whatever circle we're part of.  Returns true if we were the
+  // last member of the circle.  Once this is done, you can join() another.
+  bool depart()
+      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
+    MutexLock lock(&g_linked_ptr_mutex);
+
+    if (next_ == this) return true;
+    linked_ptr_internal const* p = next_;
+    while (p->next_ != this) {
+      assert(p->next_ != next_ &&
+             "Trying to depart() a linked ring we are not in. "
+             "Is GMock thread safety enabled?");
+      p = p->next_;
+    }
+    p->next_ = next_;
+    return false;
+  }
+
+ private:
+  mutable linked_ptr_internal const* next_;
+};
+
+template <typename T>
+class linked_ptr {
+ public:
+  typedef T element_type;
+
+  // Take over ownership of a raw pointer.  This should happen as soon as
+  // possible after the object is created.
+  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
+  ~linked_ptr() { depart(); }
+
+  // Copy an existing linked_ptr<>, adding ourselves to the list of references.
+  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
+  linked_ptr(linked_ptr const& ptr) {  // NOLINT
+    assert(&ptr != this);
+    copy(&ptr);
+  }
+
+  // Assignment releases the old value and acquires the new.
+  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
+    depart();
+    copy(&ptr);
+    return *this;
+  }
+
+  linked_ptr& operator=(linked_ptr const& ptr) {
+    if (&ptr != this) {
+      depart();
+      copy(&ptr);
+    }
+    return *this;
+  }
+
+  // Smart pointer members.
+  void reset(T* ptr = NULL) {
+    depart();
+    capture(ptr);
+  }
+  T* get() const { return value_; }
+  T* operator->() const { return value_; }
+  T& operator*() const { return *value_; }
+
+  bool operator==(T* p) const { return value_ == p; }
+  bool operator!=(T* p) const { return value_ != p; }
+  template <typename U>
+  bool operator==(linked_ptr<U> const& ptr) const {
+    return value_ == ptr.get();
+  }
+  template <typename U>
+  bool operator!=(linked_ptr<U> const& ptr) const {
+    return value_ != ptr.get();
+  }
+
+ private:
+  template <typename U>
+  friend class linked_ptr;
+
+  T* value_;
+  linked_ptr_internal link_;
+
+  void depart() {
+    if (link_.depart()) delete value_;
+  }
+
+  void capture(T* ptr) {
+    value_ = ptr;
+    link_.join_new();
+  }
+
+  template <typename U> void copy(linked_ptr<U> const* ptr) {
+    value_ = ptr->get();
+    if (value_)
+      link_.join(&ptr->link_);
+    else
+      link_.join_new();
+  }
+};
+
+template<typename T> inline
+bool operator==(T* ptr, const linked_ptr<T>& x) {
+  return ptr == x.get();
+}
+
+template<typename T> inline
+bool operator!=(T* ptr, const linked_ptr<T>& x) {
+  return ptr != x.get();
+}
+
+// A function to convert T* into linked_ptr<T>
+// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
+// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
+template <typename T>
+linked_ptr<T> make_linked_ptr(T* ptr) {
+  return linked_ptr<T>(ptr);
+}
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h
new file mode 100644
index 0000000..4d1d81d
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h
@@ -0,0 +1,5146 @@
+// This file was GENERATED by command:
+//     pump.py gtest-param-util-generated.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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: vladl@google.com (Vlad Losev)
+
+// Type and function utilities for implementing parameterized tests.
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently Google Test supports at most 50 arguments in Values,
+// and at most 10 arguments in Combine. Please contact
+// googletestframework@googlegroups.com if you need more.
+// Please note that the number of arguments to Combine is limited
+// by the maximum arity of the implementation of tuple which is
+// currently set at 10.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Forward declarations of ValuesIn(), which is implemented in
+// include/gtest/gtest-param-test.h.
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end);
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container);
+
+namespace internal {
+
+// Used in the Values() function to provide polymorphic capabilities.
+template <typename T1>
+class ValueArray1 {
+ public:
+  explicit ValueArray1(T1 v1) : v1_(v1) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray1& other);
+
+  const T1 v1_;
+};
+
+template <typename T1, typename T2>
+class ValueArray2 {
+ public:
+  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray2& other);
+
+  const T1 v1_;
+  const T2 v2_;
+};
+
+template <typename T1, typename T2, typename T3>
+class ValueArray3 {
+ public:
+  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray3& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4>
+class ValueArray4 {
+ public:
+  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray4& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+class ValueArray5 {
+ public:
+  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray5& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+class ValueArray6 {
+ public:
+  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray6& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+class ValueArray7 {
+ public:
+  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray7& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+class ValueArray8 {
+ public:
+  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray8& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+class ValueArray9 {
+ public:
+  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray9& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+class ValueArray10 {
+ public:
+  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray10& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+class ValueArray11 {
+ public:
+  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray11& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+class ValueArray12 {
+ public:
+  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray12& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+class ValueArray13 {
+ public:
+  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray13& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+class ValueArray14 {
+ public:
+  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray14& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+class ValueArray15 {
+ public:
+  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray15& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+class ValueArray16 {
+ public:
+  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray16& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+class ValueArray17 {
+ public:
+  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
+      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray17& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+class ValueArray18 {
+ public:
+  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray18& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+class ValueArray19 {
+ public:
+  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray19& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+class ValueArray20 {
+ public:
+  ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray20& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+class ValueArray21 {
+ public:
+  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray21& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+class ValueArray22 {
+ public:
+  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray22& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+class ValueArray23 {
+ public:
+  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray23& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+class ValueArray24 {
+ public:
+  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray24& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+class ValueArray25 {
+ public:
+  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
+      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray25& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+class ValueArray26 {
+ public:
+  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray26& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+class ValueArray27 {
+ public:
+  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
+      v26_(v26), v27_(v27) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray27& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+class ValueArray28 {
+ public:
+  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
+      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray28& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+class ValueArray29 {
+ public:
+  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray29& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+class ValueArray30 {
+ public:
+  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray30& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+class ValueArray31 {
+ public:
+  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray31& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+class ValueArray32 {
+ public:
+  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray32& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+class ValueArray33 {
+ public:
+  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
+      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray33& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+class ValueArray34 {
+ public:
+  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray34& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+class ValueArray35 {
+ public:
+  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
+      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
+      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray35& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+class ValueArray36 {
+ public:
+  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
+      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
+      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray36& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+class ValueArray37 {
+ public:
+  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
+      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
+      v36_(v36), v37_(v37) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray37& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+class ValueArray38 {
+ public:
+  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray38& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+class ValueArray39 {
+ public:
+  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray39& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+class ValueArray40 {
+ public:
+  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
+      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
+      v40_(v40) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray40& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+class ValueArray41 {
+ public:
+  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
+      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray41& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+class ValueArray42 {
+ public:
+  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray42& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+class ValueArray43 {
+ public:
+  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
+      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
+      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
+      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray43& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+class ValueArray44 {
+ public:
+  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
+      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
+      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
+      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
+      v43_(v43), v44_(v44) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray44& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+class ValueArray45 {
+ public:
+  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
+      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
+      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
+      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray45& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+class ValueArray46 {
+ public:
+  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
+      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray46& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+class ValueArray47 {
+ public:
+  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
+      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
+      v47_(v47) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray47& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+class ValueArray48 {
+ public:
+  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
+      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
+      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
+      v46_(v46), v47_(v47), v48_(v48) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
+        static_cast<T>(v48_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray48& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+  const T48 v48_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+class ValueArray49 {
+ public:
+  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
+      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
+      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
+        static_cast<T>(v48_), static_cast<T>(v49_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray49& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+  const T48 v48_;
+  const T49 v49_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+class ValueArray50 {
+ public:
+  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
+      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
+      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
+        static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray50& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+  const T48 v48_;
+  const T49 v49_;
+  const T50 v50_;
+};
+
+# if GTEST_HAS_COMBINE
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Generates values from the Cartesian product of values produced
+// by the argument generators.
+//
+template <typename T1, typename T2>
+class CartesianProductGenerator2
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
+ public:
+  typedef ::testing::tuple<T1, T2> ParamType;
+
+  CartesianProductGenerator2(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2)
+      : g1_(g1), g2_(g2) {}
+  virtual ~CartesianProductGenerator2() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current2_;
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator2::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator2& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+};  // class CartesianProductGenerator2
+
+
+template <typename T1, typename T2, typename T3>
+class CartesianProductGenerator3
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3> ParamType;
+
+  CartesianProductGenerator3(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
+      : g1_(g1), g2_(g2), g3_(g3) {}
+  virtual ~CartesianProductGenerator3() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current3_;
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator3::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator3& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+};  // class CartesianProductGenerator3
+
+
+template <typename T1, typename T2, typename T3, typename T4>
+class CartesianProductGenerator4
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
+
+  CartesianProductGenerator4(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
+  virtual ~CartesianProductGenerator4() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current4_;
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator4::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator4& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+};  // class CartesianProductGenerator4
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+class CartesianProductGenerator5
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
+
+  CartesianProductGenerator5(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
+  virtual ~CartesianProductGenerator5() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current5_;
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator5::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator5& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+};  // class CartesianProductGenerator5
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+class CartesianProductGenerator6
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
+        T6> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
+
+  CartesianProductGenerator6(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
+  virtual ~CartesianProductGenerator6() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current6_;
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator6::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator6& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+};  // class CartesianProductGenerator6
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+class CartesianProductGenerator7
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
+
+  CartesianProductGenerator7(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
+  virtual ~CartesianProductGenerator7() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current7_;
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator7::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator7& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+};  // class CartesianProductGenerator7
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+class CartesianProductGenerator8
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7, T8> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
+
+  CartesianProductGenerator8(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
+      const ParamGenerator<T8>& g8)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
+          g8_(g8) {}
+  virtual ~CartesianProductGenerator8() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin(), g8_, g8_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
+        g8_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7,
+      const ParamGenerator<T8>& g8,
+      const typename ParamGenerator<T8>::iterator& current8)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current8_;
+      if (current8_ == end8_) {
+        current8_ = begin8_;
+        ++current7_;
+      }
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_ &&
+          current8_ == typed_other->current8_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_),
+        begin8_(other.begin8_),
+        end8_(other.end8_),
+        current8_(other.current8_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_, *current8_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_ ||
+          current8_ == end8_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    const typename ParamGenerator<T8>::iterator begin8_;
+    const typename ParamGenerator<T8>::iterator end8_;
+    typename ParamGenerator<T8>::iterator current8_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator8::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator8& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+  const ParamGenerator<T8> g8_;
+};  // class CartesianProductGenerator8
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+class CartesianProductGenerator9
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7, T8, T9> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
+
+  CartesianProductGenerator9(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
+      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9) {}
+  virtual ~CartesianProductGenerator9() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
+        g8_.end(), g9_, g9_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7,
+      const ParamGenerator<T8>& g8,
+      const typename ParamGenerator<T8>::iterator& current8,
+      const ParamGenerator<T9>& g9,
+      const typename ParamGenerator<T9>::iterator& current9)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
+          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current9_;
+      if (current9_ == end9_) {
+        current9_ = begin9_;
+        ++current8_;
+      }
+      if (current8_ == end8_) {
+        current8_ = begin8_;
+        ++current7_;
+      }
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_ &&
+          current8_ == typed_other->current8_ &&
+          current9_ == typed_other->current9_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_),
+        begin8_(other.begin8_),
+        end8_(other.end8_),
+        current8_(other.current8_),
+        begin9_(other.begin9_),
+        end9_(other.end9_),
+        current9_(other.current9_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_, *current8_,
+            *current9_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_ ||
+          current8_ == end8_ ||
+          current9_ == end9_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    const typename ParamGenerator<T8>::iterator begin8_;
+    const typename ParamGenerator<T8>::iterator end8_;
+    typename ParamGenerator<T8>::iterator current8_;
+    const typename ParamGenerator<T9>::iterator begin9_;
+    const typename ParamGenerator<T9>::iterator end9_;
+    typename ParamGenerator<T9>::iterator current9_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator9::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator9& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+  const ParamGenerator<T8> g8_;
+  const ParamGenerator<T9> g9_;
+};  // class CartesianProductGenerator9
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+class CartesianProductGenerator10
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7, T8, T9, T10> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
+
+  CartesianProductGenerator10(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
+      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
+      const ParamGenerator<T10>& g10)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9), g10_(g10) {}
+  virtual ~CartesianProductGenerator10() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
+        g8_.end(), g9_, g9_.end(), g10_, g10_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7,
+      const ParamGenerator<T8>& g8,
+      const typename ParamGenerator<T8>::iterator& current8,
+      const ParamGenerator<T9>& g9,
+      const typename ParamGenerator<T9>::iterator& current9,
+      const ParamGenerator<T10>& g10,
+      const typename ParamGenerator<T10>::iterator& current10)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
+          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
+          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current10_;
+      if (current10_ == end10_) {
+        current10_ = begin10_;
+        ++current9_;
+      }
+      if (current9_ == end9_) {
+        current9_ = begin9_;
+        ++current8_;
+      }
+      if (current8_ == end8_) {
+        current8_ = begin8_;
+        ++current7_;
+      }
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_ &&
+          current8_ == typed_other->current8_ &&
+          current9_ == typed_other->current9_ &&
+          current10_ == typed_other->current10_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_),
+        begin8_(other.begin8_),
+        end8_(other.end8_),
+        current8_(other.current8_),
+        begin9_(other.begin9_),
+        end9_(other.end9_),
+        current9_(other.current9_),
+        begin10_(other.begin10_),
+        end10_(other.end10_),
+        current10_(other.current10_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_, *current8_,
+            *current9_, *current10_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_ ||
+          current8_ == end8_ ||
+          current9_ == end9_ ||
+          current10_ == end10_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    const typename ParamGenerator<T8>::iterator begin8_;
+    const typename ParamGenerator<T8>::iterator end8_;
+    typename ParamGenerator<T8>::iterator current8_;
+    const typename ParamGenerator<T9>::iterator begin9_;
+    const typename ParamGenerator<T9>::iterator end9_;
+    typename ParamGenerator<T9>::iterator current9_;
+    const typename ParamGenerator<T10>::iterator begin10_;
+    const typename ParamGenerator<T10>::iterator end10_;
+    typename ParamGenerator<T10>::iterator current10_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator10::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator10& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+  const ParamGenerator<T8> g8_;
+  const ParamGenerator<T9> g9_;
+  const ParamGenerator<T10> g10_;
+};  // class CartesianProductGenerator10
+
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Helper classes providing Combine() with polymorphic features. They allow
+// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
+// convertible to U.
+//
+template <class Generator1, class Generator2>
+class CartesianProductHolder2 {
+ public:
+CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
+      : g1_(g1), g2_(g2) {}
+  template <typename T1, typename T2>
+  operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2> >(
+        new CartesianProductGenerator2<T1, T2>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder2& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+};  // class CartesianProductHolder2
+
+template <class Generator1, class Generator2, class Generator3>
+class CartesianProductHolder3 {
+ public:
+CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3)
+      : g1_(g1), g2_(g2), g3_(g3) {}
+  template <typename T1, typename T2, typename T3>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
+        new CartesianProductGenerator3<T1, T2, T3>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder3& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+};  // class CartesianProductHolder3
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4>
+class CartesianProductHolder4 {
+ public:
+CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
+  template <typename T1, typename T2, typename T3, typename T4>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
+        new CartesianProductGenerator4<T1, T2, T3, T4>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder4& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+};  // class CartesianProductHolder4
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5>
+class CartesianProductHolder5 {
+ public:
+CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
+        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder5& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+};  // class CartesianProductHolder5
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6>
+class CartesianProductHolder6 {
+ public:
+CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
+        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder6& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+};  // class CartesianProductHolder6
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7>
+class CartesianProductHolder7 {
+ public:
+CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+      T7> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
+        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder7& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+};  // class CartesianProductHolder7
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7,
+    class Generator8>
+class CartesianProductHolder8 {
+ public:
+CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7, const Generator8& g8)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
+          g8_(g8) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7, typename T8>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
+      T8> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
+        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_),
+        static_cast<ParamGenerator<T8> >(g8_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder8& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+  const Generator8 g8_;
+};  // class CartesianProductHolder8
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7,
+    class Generator8, class Generator9>
+class CartesianProductHolder9 {
+ public:
+CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7, const Generator8& g8,
+    const Generator9& g9)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7, typename T8, typename T9>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+      T9> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+        T9> >(
+        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_),
+        static_cast<ParamGenerator<T8> >(g8_),
+        static_cast<ParamGenerator<T9> >(g9_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder9& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+  const Generator8 g8_;
+  const Generator9 g9_;
+};  // class CartesianProductHolder9
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7,
+    class Generator8, class Generator9, class Generator10>
+class CartesianProductHolder10 {
+ public:
+CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7, const Generator8& g8,
+    const Generator9& g9, const Generator10& g10)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9), g10_(g10) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7, typename T8, typename T9, typename T10>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+      T10> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+        T10> >(
+        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+            T10>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_),
+        static_cast<ParamGenerator<T8> >(g8_),
+        static_cast<ParamGenerator<T9> >(g9_),
+        static_cast<ParamGenerator<T10> >(g10_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder10& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+  const Generator8 g8_;
+  const Generator9 g9_;
+  const Generator10 g10_;
+};  // class CartesianProductHolder10
+
+# endif  // GTEST_HAS_COMBINE
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  //  GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
new file mode 100644
index 0000000..5c7c47a
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
@@ -0,0 +1,286 @@
+$$ -*- mode: c++; -*-
+$var n = 50  $$ Maximum length of Values arguments we want to support.
+$var maxtuple = 10  $$ Maximum number of Combine arguments we want to support.
+// 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: vladl@google.com (Vlad Losev)
+
+// Type and function utilities for implementing parameterized tests.
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently Google Test supports at most $n arguments in Values,
+// and at most $maxtuple arguments in Combine. Please contact
+// googletestframework@googlegroups.com if you need more.
+// Please note that the number of arguments to Combine is limited
+// by the maximum arity of the implementation of tuple which is
+// currently set at $maxtuple.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Forward declarations of ValuesIn(), which is implemented in
+// include/gtest/gtest-param-test.h.
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end);
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container);
+
+namespace internal {
+
+// Used in the Values() function to provide polymorphic capabilities.
+$range i 1..n
+$for i [[
+$range j 1..i
+
+template <$for j, [[typename T$j]]>
+class ValueArray$i {
+ public:
+  $if i==1 [[explicit ]]ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {$for j, [[static_cast<T>(v$(j)_)]]};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray$i& other);
+
+$for j [[
+
+  const T$j v$(j)_;
+]]
+
+};
+
+]]
+
+# if GTEST_HAS_COMBINE
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Generates values from the Cartesian product of values produced
+// by the argument generators.
+//
+$range i 2..maxtuple
+$for i [[
+$range j 1..i
+$range k 2..i
+
+template <$for j, [[typename T$j]]>
+class CartesianProductGenerator$i
+    : public ParamGeneratorInterface< ::testing::tuple<$for j, [[T$j]]> > {
+ public:
+  typedef ::testing::tuple<$for j, [[T$j]]> ParamType;
+
+  CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])
+      : $for j, [[g$(j)_(g$j)]] {}
+  virtual ~CartesianProductGenerator$i() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]);
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]);
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base, $for j, [[
+
+      const ParamGenerator<T$j>& g$j,
+      const typename ParamGenerator<T$j>::iterator& current$(j)]])
+        : base_(base),
+$for j, [[
+
+          begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j)
+]]    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current$(i)_;
+
+$for k [[
+      if (current$(i+2-k)_ == end$(i+2-k)_) {
+        current$(i+2-k)_ = begin$(i+2-k)_;
+        ++current$(i+2-k-1)_;
+      }
+
+]]
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         ($for j  && [[
+
+          current$(j)_ == typed_other->current$(j)_
+]]);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_), $for j, [[
+
+        begin$(j)_(other.begin$(j)_),
+        end$(j)_(other.end$(j)_),
+        current$(j)_(other.current$(j)_)
+]] {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType($for j, [[*current$(j)_]]);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+$for j  || [[
+
+          current$(j)_ == end$(j)_
+]];
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+$for j [[
+
+    const typename ParamGenerator<T$j>::iterator begin$(j)_;
+    const typename ParamGenerator<T$j>::iterator end$(j)_;
+    typename ParamGenerator<T$j>::iterator current$(j)_;
+]]
+
+    ParamType current_value_;
+  };  // class CartesianProductGenerator$i::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator$i& other);
+
+
+$for j [[
+  const ParamGenerator<T$j> g$(j)_;
+
+]]
+};  // class CartesianProductGenerator$i
+
+
+]]
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Helper classes providing Combine() with polymorphic features. They allow
+// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
+// convertible to U.
+//
+$range i 2..maxtuple
+$for i [[
+$range j 1..i
+
+template <$for j, [[class Generator$j]]>
+class CartesianProductHolder$i {
+ public:
+CartesianProductHolder$i($for j, [[const Generator$j& g$j]])
+      : $for j, [[g$(j)_(g$j)]] {}
+  template <$for j, [[typename T$j]]>
+  operator ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >() const {
+    return ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >(
+        new CartesianProductGenerator$i<$for j, [[T$j]]>(
+$for j,[[
+
+        static_cast<ParamGenerator<T$j> >(g$(j)_)
+]]));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder$i& other);
+
+
+$for j [[
+  const Generator$j g$(j)_;
+
+]]
+};  // class CartesianProductHolder$i
+
+]]
+
+# endif  // GTEST_HAS_COMBINE
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  //  GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h
new file mode 100644
index 0000000..82cab9b
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h
@@ -0,0 +1,731 @@
+// 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: vladl@google.com (Vlad Losev)
+
+// Type and function utilities for implementing parameterized tests.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
+
+#include <ctype.h>
+
+#include <iterator>
+#include <set>
+#include <utility>
+#include <vector>
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-linked_ptr.h"
+#include "gtest/internal/gtest-port.h"
+#include "gtest/gtest-printers.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Input to a parameterized test name generator, describing a test parameter.
+// Consists of the parameter value and the integer parameter index.
+template <class ParamType>
+struct TestParamInfo {
+  TestParamInfo(const ParamType& a_param, size_t an_index) :
+    param(a_param),
+    index(an_index) {}
+  ParamType param;
+  size_t index;
+};
+
+// A builtin parameterized test name generator which returns the result of
+// testing::PrintToString.
+struct PrintToStringParamName {
+  template <class ParamType>
+  std::string operator()(const TestParamInfo<ParamType>& info) const {
+    return PrintToString(info.param);
+  }
+};
+
+namespace internal {
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Outputs a message explaining invalid registration of different
+// fixture class for the same test case. This may happen when
+// TEST_P macro is used to define two tests with the same name
+// but in different namespaces.
+GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
+                                          CodeLocation code_location);
+
+template <typename> class ParamGeneratorInterface;
+template <typename> class ParamGenerator;
+
+// Interface for iterating over elements provided by an implementation
+// of ParamGeneratorInterface<T>.
+template <typename T>
+class ParamIteratorInterface {
+ public:
+  virtual ~ParamIteratorInterface() {}
+  // A pointer to the base generator instance.
+  // Used only for the purposes of iterator comparison
+  // to make sure that two iterators belong to the same generator.
+  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
+  // Advances iterator to point to the next element
+  // provided by the generator. The caller is responsible
+  // for not calling Advance() on an iterator equal to
+  // BaseGenerator()->End().
+  virtual void Advance() = 0;
+  // Clones the iterator object. Used for implementing copy semantics
+  // of ParamIterator<T>.
+  virtual ParamIteratorInterface* Clone() const = 0;
+  // Dereferences the current iterator and provides (read-only) access
+  // to the pointed value. It is the caller's responsibility not to call
+  // Current() on an iterator equal to BaseGenerator()->End().
+  // Used for implementing ParamGenerator<T>::operator*().
+  virtual const T* Current() const = 0;
+  // Determines whether the given iterator and other point to the same
+  // element in the sequence generated by the generator.
+  // Used for implementing ParamGenerator<T>::operator==().
+  virtual bool Equals(const ParamIteratorInterface& other) const = 0;
+};
+
+// Class iterating over elements provided by an implementation of
+// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
+// and implements the const forward iterator concept.
+template <typename T>
+class ParamIterator {
+ public:
+  typedef T value_type;
+  typedef const T& reference;
+  typedef ptrdiff_t difference_type;
+
+  // ParamIterator assumes ownership of the impl_ pointer.
+  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
+  ParamIterator& operator=(const ParamIterator& other) {
+    if (this != &other)
+      impl_.reset(other.impl_->Clone());
+    return *this;
+  }
+
+  const T& operator*() const { return *impl_->Current(); }
+  const T* operator->() const { return impl_->Current(); }
+  // Prefix version of operator++.
+  ParamIterator& operator++() {
+    impl_->Advance();
+    return *this;
+  }
+  // Postfix version of operator++.
+  ParamIterator operator++(int /*unused*/) {
+    ParamIteratorInterface<T>* clone = impl_->Clone();
+    impl_->Advance();
+    return ParamIterator(clone);
+  }
+  bool operator==(const ParamIterator& other) const {
+    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
+  }
+  bool operator!=(const ParamIterator& other) const {
+    return !(*this == other);
+  }
+
+ private:
+  friend class ParamGenerator<T>;
+  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
+  scoped_ptr<ParamIteratorInterface<T> > impl_;
+};
+
+// ParamGeneratorInterface<T> is the binary interface to access generators
+// defined in other translation units.
+template <typename T>
+class ParamGeneratorInterface {
+ public:
+  typedef T ParamType;
+
+  virtual ~ParamGeneratorInterface() {}
+
+  // Generator interface definition
+  virtual ParamIteratorInterface<T>* Begin() const = 0;
+  virtual ParamIteratorInterface<T>* End() const = 0;
+};
+
+// Wraps ParamGeneratorInterface<T> and provides general generator syntax
+// compatible with the STL Container concept.
+// This class implements copy initialization semantics and the contained
+// ParamGeneratorInterface<T> instance is shared among all copies
+// of the original object. This is possible because that instance is immutable.
+template<typename T>
+class ParamGenerator {
+ public:
+  typedef ParamIterator<T> iterator;
+
+  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
+  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
+
+  ParamGenerator& operator=(const ParamGenerator& other) {
+    impl_ = other.impl_;
+    return *this;
+  }
+
+  iterator begin() const { return iterator(impl_->Begin()); }
+  iterator end() const { return iterator(impl_->End()); }
+
+ private:
+  linked_ptr<const ParamGeneratorInterface<T> > impl_;
+};
+
+// Generates values from a range of two comparable values. Can be used to
+// generate sequences of user-defined types that implement operator+() and
+// operator<().
+// This class is used in the Range() function.
+template <typename T, typename IncrementT>
+class RangeGenerator : public ParamGeneratorInterface<T> {
+ public:
+  RangeGenerator(T begin, T end, IncrementT step)
+      : begin_(begin), end_(end),
+        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
+  virtual ~RangeGenerator() {}
+
+  virtual ParamIteratorInterface<T>* Begin() const {
+    return new Iterator(this, begin_, 0, step_);
+  }
+  virtual ParamIteratorInterface<T>* End() const {
+    return new Iterator(this, end_, end_index_, step_);
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<T> {
+   public:
+    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
+             IncrementT step)
+        : base_(base), value_(value), index_(index), step_(step) {}
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
+      return base_;
+    }
+    virtual void Advance() {
+      value_ = static_cast<T>(value_ + step_);
+      index_++;
+    }
+    virtual ParamIteratorInterface<T>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const T* Current() const { return &value_; }
+    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const int other_index =
+          CheckedDowncastToActualType<const Iterator>(&other)->index_;
+      return index_ == other_index;
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : ParamIteratorInterface<T>(),
+          base_(other.base_), value_(other.value_), index_(other.index_),
+          step_(other.step_) {}
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<T>* const base_;
+    T value_;
+    int index_;
+    const IncrementT step_;
+  };  // class RangeGenerator::Iterator
+
+  static int CalculateEndIndex(const T& begin,
+                               const T& end,
+                               const IncrementT& step) {
+    int end_index = 0;
+    for (T i = begin; i < end; i = static_cast<T>(i + step))
+      end_index++;
+    return end_index;
+  }
+
+  // No implementation - assignment is unsupported.
+  void operator=(const RangeGenerator& other);
+
+  const T begin_;
+  const T end_;
+  const IncrementT step_;
+  // The index for the end() iterator. All the elements in the generated
+  // sequence are indexed (0-based) to aid iterator comparison.
+  const int end_index_;
+};  // class RangeGenerator
+
+
+// Generates values from a pair of STL-style iterators. Used in the
+// ValuesIn() function. The elements are copied from the source range
+// since the source can be located on the stack, and the generator
+// is likely to persist beyond that stack frame.
+template <typename T>
+class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
+ public:
+  template <typename ForwardIterator>
+  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
+      : container_(begin, end) {}
+  virtual ~ValuesInIteratorRangeGenerator() {}
+
+  virtual ParamIteratorInterface<T>* Begin() const {
+    return new Iterator(this, container_.begin());
+  }
+  virtual ParamIteratorInterface<T>* End() const {
+    return new Iterator(this, container_.end());
+  }
+
+ private:
+  typedef typename ::std::vector<T> ContainerType;
+
+  class Iterator : public ParamIteratorInterface<T> {
+   public:
+    Iterator(const ParamGeneratorInterface<T>* base,
+             typename ContainerType::const_iterator iterator)
+        : base_(base), iterator_(iterator) {}
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
+      return base_;
+    }
+    virtual void Advance() {
+      ++iterator_;
+      value_.reset();
+    }
+    virtual ParamIteratorInterface<T>* Clone() const {
+      return new Iterator(*this);
+    }
+    // We need to use cached value referenced by iterator_ because *iterator_
+    // can return a temporary object (and of type other then T), so just
+    // having "return &*iterator_;" doesn't work.
+    // value_ is updated here and not in Advance() because Advance()
+    // can advance iterator_ beyond the end of the range, and we cannot
+    // detect that fact. The client code, on the other hand, is
+    // responsible for not calling Current() on an out-of-range iterator.
+    virtual const T* Current() const {
+      if (value_.get() == NULL)
+        value_.reset(new T(*iterator_));
+      return value_.get();
+    }
+    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      return iterator_ ==
+          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
+    }
+
+   private:
+    Iterator(const Iterator& other)
+          // The explicit constructor call suppresses a false warning
+          // emitted by gcc when supplied with the -Wextra option.
+        : ParamIteratorInterface<T>(),
+          base_(other.base_),
+          iterator_(other.iterator_) {}
+
+    const ParamGeneratorInterface<T>* const base_;
+    typename ContainerType::const_iterator iterator_;
+    // A cached value of *iterator_. We keep it here to allow access by
+    // pointer in the wrapping iterator's operator->().
+    // value_ needs to be mutable to be accessed in Current().
+    // Use of scoped_ptr helps manage cached value's lifetime,
+    // which is bound by the lifespan of the iterator itself.
+    mutable scoped_ptr<const T> value_;
+  };  // class ValuesInIteratorRangeGenerator::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const ValuesInIteratorRangeGenerator& other);
+
+  const ContainerType container_;
+};  // class ValuesInIteratorRangeGenerator
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Default parameterized test name generator, returns a string containing the
+// integer test parameter index.
+template <class ParamType>
+std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
+  Message name_stream;
+  name_stream << info.index;
+  return name_stream.GetString();
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Parameterized test name overload helpers, which help the
+// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
+// test name generator and user param name generator.
+template <class ParamType, class ParamNameGenFunctor>
+ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
+  return func;
+}
+
+template <class ParamType>
+struct ParamNameGenFunc {
+  typedef std::string Type(const TestParamInfo<ParamType>&);
+};
+
+template <class ParamType>
+typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
+  return DefaultParamName;
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Stores a parameter value and later creates tests parameterized with that
+// value.
+template <class TestClass>
+class ParameterizedTestFactory : public TestFactoryBase {
+ public:
+  typedef typename TestClass::ParamType ParamType;
+  explicit ParameterizedTestFactory(ParamType parameter) :
+      parameter_(parameter) {}
+  virtual Test* CreateTest() {
+    TestClass::SetParam(&parameter_);
+    return new TestClass();
+  }
+
+ private:
+  const ParamType parameter_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// TestMetaFactoryBase is a base class for meta-factories that create
+// test factories for passing into MakeAndRegisterTestInfo function.
+template <class ParamType>
+class TestMetaFactoryBase {
+ public:
+  virtual ~TestMetaFactoryBase() {}
+
+  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// TestMetaFactory creates test factories for passing into
+// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
+// ownership of test factory pointer, same factory object cannot be passed
+// into that method twice. But ParameterizedTestCaseInfo is going to call
+// it for each Test/Parameter value combination. Thus it needs meta factory
+// creator class.
+template <class TestCase>
+class TestMetaFactory
+    : public TestMetaFactoryBase<typename TestCase::ParamType> {
+ public:
+  typedef typename TestCase::ParamType ParamType;
+
+  TestMetaFactory() {}
+
+  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
+    return new ParameterizedTestFactory<TestCase>(parameter);
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// ParameterizedTestCaseInfoBase is a generic interface
+// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
+// accumulates test information provided by TEST_P macro invocations
+// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
+// and uses that information to register all resulting test instances
+// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
+// a collection of pointers to the ParameterizedTestCaseInfo objects
+// and calls RegisterTests() on each of them when asked.
+class ParameterizedTestCaseInfoBase {
+ public:
+  virtual ~ParameterizedTestCaseInfoBase() {}
+
+  // Base part of test case name for display purposes.
+  virtual const string& GetTestCaseName() const = 0;
+  // Test case id to verify identity.
+  virtual TypeId GetTestCaseTypeId() const = 0;
+  // UnitTest class invokes this method to register tests in this
+  // test case right before running them in RUN_ALL_TESTS macro.
+  // This method should not be called more then once on any single
+  // instance of a ParameterizedTestCaseInfoBase derived class.
+  virtual void RegisterTests() = 0;
+
+ protected:
+  ParameterizedTestCaseInfoBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
+// macro invocations for a particular test case and generators
+// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
+// test case. It registers tests with all values generated by all
+// generators when asked.
+template <class TestCase>
+class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
+ public:
+  // ParamType and GeneratorCreationFunc are private types but are required
+  // for declarations of public methods AddTestPattern() and
+  // AddTestCaseInstantiation().
+  typedef typename TestCase::ParamType ParamType;
+  // A function that returns an instance of appropriate generator type.
+  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
+  typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
+
+  explicit ParameterizedTestCaseInfo(
+      const char* name, CodeLocation code_location)
+      : test_case_name_(name), code_location_(code_location) {}
+
+  // Test case base name for display purposes.
+  virtual const string& GetTestCaseName() const { return test_case_name_; }
+  // Test case id to verify identity.
+  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
+  // TEST_P macro uses AddTestPattern() to record information
+  // about a single test in a LocalTestInfo structure.
+  // test_case_name is the base name of the test case (without invocation
+  // prefix). test_base_name is the name of an individual test without
+  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
+  // test case base name and DoBar is test base name.
+  void AddTestPattern(const char* test_case_name,
+                      const char* test_base_name,
+                      TestMetaFactoryBase<ParamType>* meta_factory) {
+    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
+                                                       test_base_name,
+                                                       meta_factory)));
+  }
+  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
+  // about a generator.
+  int AddTestCaseInstantiation(const string& instantiation_name,
+                               GeneratorCreationFunc* func,
+                               ParamNameGeneratorFunc* name_func,
+                               const char* file,
+                               int line) {
+    instantiations_.push_back(
+        InstantiationInfo(instantiation_name, func, name_func, file, line));
+    return 0;  // Return value used only to run this method in namespace scope.
+  }
+  // UnitTest class invokes this method to register tests in this test case
+  // test cases right before running tests in RUN_ALL_TESTS macro.
+  // This method should not be called more then once on any single
+  // instance of a ParameterizedTestCaseInfoBase derived class.
+  // UnitTest has a guard to prevent from calling this method more then once.
+  virtual void RegisterTests() {
+    for (typename TestInfoContainer::iterator test_it = tests_.begin();
+         test_it != tests_.end(); ++test_it) {
+      linked_ptr<TestInfo> test_info = *test_it;
+      for (typename InstantiationContainer::iterator gen_it =
+               instantiations_.begin(); gen_it != instantiations_.end();
+               ++gen_it) {
+        const string& instantiation_name = gen_it->name;
+        ParamGenerator<ParamType> generator((*gen_it->generator)());
+        ParamNameGeneratorFunc* name_func = gen_it->name_func;
+        const char* file = gen_it->file;
+        int line = gen_it->line;
+
+        string test_case_name;
+        if ( !instantiation_name.empty() )
+          test_case_name = instantiation_name + "/";
+        test_case_name += test_info->test_case_base_name;
+
+        size_t i = 0;
+        std::set<std::string> test_param_names;
+        for (typename ParamGenerator<ParamType>::iterator param_it =
+                 generator.begin();
+             param_it != generator.end(); ++param_it, ++i) {
+          Message test_name_stream;
+
+          std::string param_name = name_func(
+              TestParamInfo<ParamType>(*param_it, i));
+
+          GTEST_CHECK_(IsValidParamName(param_name))
+              << "Parameterized test name '" << param_name
+              << "' is invalid, in " << file
+              << " line " << line << std::endl;
+
+          GTEST_CHECK_(test_param_names.count(param_name) == 0)
+              << "Duplicate parameterized test name '" << param_name
+              << "', in " << file << " line " << line << std::endl;
+
+          test_param_names.insert(param_name);
+
+          test_name_stream << test_info->test_base_name << "/" << param_name;
+          MakeAndRegisterTestInfo(
+              test_case_name.c_str(),
+              test_name_stream.GetString().c_str(),
+              NULL,  // No type parameter.
+              PrintToString(*param_it).c_str(),
+              code_location_,
+              GetTestCaseTypeId(),
+              TestCase::SetUpTestCase,
+              TestCase::TearDownTestCase,
+              test_info->test_meta_factory->CreateTestFactory(*param_it));
+        }  // for param_it
+      }  // for gen_it
+    }  // for test_it
+  }  // RegisterTests
+
+ private:
+  // LocalTestInfo structure keeps information about a single test registered
+  // with TEST_P macro.
+  struct TestInfo {
+    TestInfo(const char* a_test_case_base_name,
+             const char* a_test_base_name,
+             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
+        test_case_base_name(a_test_case_base_name),
+        test_base_name(a_test_base_name),
+        test_meta_factory(a_test_meta_factory) {}
+
+    const string test_case_base_name;
+    const string test_base_name;
+    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
+  };
+  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
+  // Records data received from INSTANTIATE_TEST_CASE_P macros:
+  //  <Instantiation name, Sequence generator creation function,
+  //     Name generator function, Source file, Source line>
+  struct InstantiationInfo {
+      InstantiationInfo(const std::string &name_in,
+                        GeneratorCreationFunc* generator_in,
+                        ParamNameGeneratorFunc* name_func_in,
+                        const char* file_in,
+                        int line_in)
+          : name(name_in),
+            generator(generator_in),
+            name_func(name_func_in),
+            file(file_in),
+            line(line_in) {}
+
+      std::string name;
+      GeneratorCreationFunc* generator;
+      ParamNameGeneratorFunc* name_func;
+      const char* file;
+      int line;
+  };
+  typedef ::std::vector<InstantiationInfo> InstantiationContainer;
+
+  static bool IsValidParamName(const std::string& name) {
+    // Check for empty string
+    if (name.empty())
+      return false;
+
+    // Check for invalid characters
+    for (std::string::size_type index = 0; index < name.size(); ++index) {
+      if (!isalnum(name[index]) && name[index] != '_')
+        return false;
+    }
+
+    return true;
+  }
+
+  const string test_case_name_;
+  CodeLocation code_location_;
+  TestInfoContainer tests_;
+  InstantiationContainer instantiations_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
+};  // class ParameterizedTestCaseInfo
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
+// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
+// macros use it to locate their corresponding ParameterizedTestCaseInfo
+// descriptors.
+class ParameterizedTestCaseRegistry {
+ public:
+  ParameterizedTestCaseRegistry() {}
+  ~ParameterizedTestCaseRegistry() {
+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
+         it != test_case_infos_.end(); ++it) {
+      delete *it;
+    }
+  }
+
+  // Looks up or creates and returns a structure containing information about
+  // tests and instantiations of a particular test case.
+  template <class TestCase>
+  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
+      const char* test_case_name,
+      CodeLocation code_location) {
+    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
+         it != test_case_infos_.end(); ++it) {
+      if ((*it)->GetTestCaseName() == test_case_name) {
+        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
+          // Complain about incorrect usage of Google Test facilities
+          // and terminate the program since we cannot guaranty correct
+          // test case setup and tear-down in this case.
+          ReportInvalidTestCaseType(test_case_name, code_location);
+          posix::Abort();
+        } else {
+          // At this point we are sure that the object we found is of the same
+          // type we are looking for, so we downcast it to that type
+          // without further checks.
+          typed_test_info = CheckedDowncastToActualType<
+              ParameterizedTestCaseInfo<TestCase> >(*it);
+        }
+        break;
+      }
+    }
+    if (typed_test_info == NULL) {
+      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
+          test_case_name, code_location);
+      test_case_infos_.push_back(typed_test_info);
+    }
+    return typed_test_info;
+  }
+  void RegisterTests() {
+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
+         it != test_case_infos_.end(); ++it) {
+      (*it)->RegisterTests();
+    }
+  }
+
+ private:
+  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
+
+  TestCaseInfoContainer test_case_infos_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
+};
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  //  GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-port-arch.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-port-arch.h
new file mode 100644
index 0000000..74ab949
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-port-arch.h
@@ -0,0 +1,93 @@
+// Copyright 2015, 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.
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the GTEST_OS_* macro.
+// It is separate from gtest-port.h so that custom/gtest-port.h can include it.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+
+// Determines the platform on which Google Test is compiled.
+#ifdef __CYGWIN__
+# define GTEST_OS_CYGWIN 1
+#elif defined __SYMBIAN32__
+# define GTEST_OS_SYMBIAN 1
+#elif defined _WIN32
+# define GTEST_OS_WINDOWS 1
+# ifdef _WIN32_WCE
+#  define GTEST_OS_WINDOWS_MOBILE 1
+# elif defined(__MINGW__) || defined(__MINGW32__)
+#  define GTEST_OS_WINDOWS_MINGW 1
+# elif defined(WINAPI_FAMILY)
+#  include <winapifamily.h>
+#  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#   define GTEST_OS_WINDOWS_DESKTOP 1
+#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+#   define GTEST_OS_WINDOWS_PHONE 1
+#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+#   define GTEST_OS_WINDOWS_RT 1
+#  else
+    // WINAPI_FAMILY defined but no known partition matched.
+    // Default to desktop.
+#   define GTEST_OS_WINDOWS_DESKTOP 1
+#  endif
+# else
+#  define GTEST_OS_WINDOWS_DESKTOP 1
+# endif  // _WIN32_WCE
+#elif defined __APPLE__
+# define GTEST_OS_MAC 1
+# if TARGET_OS_IPHONE
+#  define GTEST_OS_IOS 1
+# endif
+#elif defined __FreeBSD__
+# define GTEST_OS_FREEBSD 1
+#elif defined __linux__
+# define GTEST_OS_LINUX 1
+# if defined __ANDROID__
+#  define GTEST_OS_LINUX_ANDROID 1
+# endif
+#elif defined __MVS__
+# define GTEST_OS_ZOS 1
+#elif defined(__sun) && defined(__SVR4)
+# define GTEST_OS_SOLARIS 1
+#elif defined(_AIX)
+# define GTEST_OS_AIX 1
+#elif defined(__hpux)
+# define GTEST_OS_HPUX 1
+#elif defined __native_client__
+# define GTEST_OS_NACL 1
+#elif defined __OpenBSD__
+# define GTEST_OS_OPENBSD 1
+#elif defined __QNX__
+# define GTEST_OS_QNX 1
+#endif  // __CYGWIN__
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-port.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-port.h
new file mode 100644
index 0000000..0094ed5
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-port.h
@@ -0,0 +1,2554 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan)
+//
+// Low-level types and utilities for porting Google Test to various
+// platforms.  All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice.  Code
+// outside Google Test MUST NOT USE THEM DIRECTLY.  Macros that don't
+// end with _ are part of Google Test's public API and can be used by
+// code outside Google Test.
+//
+// This file is fundamental to Google Test.  All other Google Test source
+// files are expected to #include this.  Therefore, it cannot #include
+// any other Google Test header.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
+
+// Environment-describing macros
+// -----------------------------
+//
+// Google Test can be used in many different environments.  Macros in
+// this section tell Google Test what kind of environment it is being
+// used in, such that Google Test can provide environment-specific
+// features and implementations.
+//
+// Google Test tries to automatically detect the properties of its
+// environment, so users usually don't need to worry about these
+// macros.  However, the automatic detection is not perfect.
+// Sometimes it's necessary for a user to define some of the following
+// macros in the build script to override Google Test's decisions.
+//
+// If the user doesn't define a macro in the list, Google Test will
+// provide a default definition.  After this header is #included, all
+// macros in this list will be defined to either 1 or 0.
+//
+// Notes to maintainers:
+//   - Each macro here is a user-tweakable knob; do not grow the list
+//     lightly.
+//   - Use #if to key off these macros.  Don't use #ifdef or "#if
+//     defined(...)", which will not work as these macros are ALWAYS
+//     defined.
+//
+//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
+//                              is/isn't available.
+//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
+//                              are enabled.
+//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
+//                              is/isn't available (some systems define
+//                              ::string, which is different to std::string).
+//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
+//                              is/isn't available (some systems define
+//                              ::wstring, which is different to std::wstring).
+//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
+//                              expressions are/aren't available.
+//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
+//                              is/isn't available.
+//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
+//                              enabled.
+//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
+//                              std::wstring does/doesn't work (Google Test can
+//                              be used where std::wstring is unavailable).
+//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
+//                              is/isn't available.
+//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
+//                              compiler supports Microsoft's "Structured
+//                              Exception Handling".
+//   GTEST_HAS_STREAM_REDIRECTION
+//                            - Define it to 1/0 to indicate whether the
+//                              platform supports I/O stream redirection using
+//                              dup() and dup2().
+//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
+//                              Test's own tr1 tuple implementation should be
+//                              used.  Unused when the user sets
+//                              GTEST_HAS_TR1_TUPLE to 0.
+//   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
+//                              is building in C++11/C++98 mode.
+//   GTEST_LINKED_AS_SHARED_LIBRARY
+//                            - Define to 1 when compiling tests that use
+//                              Google Test as a shared library (known as
+//                              DLL on Windows).
+//   GTEST_CREATE_SHARED_LIBRARY
+//                            - Define to 1 when compiling Google Test itself
+//                              as a shared library.
+
+// Platform-indicating macros
+// --------------------------
+//
+// Macros indicating the platform on which Google Test is being used
+// (a macro is defined to 1 if compiled on the given platform;
+// otherwise UNDEFINED -- it's never defined to 0.).  Google Test
+// defines these macros automatically.  Code outside Google Test MUST
+// NOT define them.
+//
+//   GTEST_OS_AIX      - IBM AIX
+//   GTEST_OS_CYGWIN   - Cygwin
+//   GTEST_OS_FREEBSD  - FreeBSD
+//   GTEST_OS_HPUX     - HP-UX
+//   GTEST_OS_LINUX    - Linux
+//     GTEST_OS_LINUX_ANDROID - Google Android
+//   GTEST_OS_MAC      - Mac OS X
+//     GTEST_OS_IOS    - iOS
+//   GTEST_OS_NACL     - Google Native Client (NaCl)
+//   GTEST_OS_OPENBSD  - OpenBSD
+//   GTEST_OS_QNX      - QNX
+//   GTEST_OS_SOLARIS  - Sun Solaris
+//   GTEST_OS_SYMBIAN  - Symbian
+//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
+//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
+//     GTEST_OS_WINDOWS_MINGW    - MinGW
+//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
+//     GTEST_OS_WINDOWS_PHONE    - Windows Phone
+//     GTEST_OS_WINDOWS_RT       - Windows Store App/WinRT
+//   GTEST_OS_ZOS      - z/OS
+//
+// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
+// most stable support.  Since core members of the Google Test project
+// don't have access to other platforms, support for them may be less
+// stable.  If you notice any problems on your platform, please notify
+// googletestframework@googlegroups.com (patches for fixing them are
+// even more welcome!).
+//
+// It is possible that none of the GTEST_OS_* macros are defined.
+
+// Feature-indicating macros
+// -------------------------
+//
+// Macros indicating which Google Test features are available (a macro
+// is defined to 1 if the corresponding feature is supported;
+// otherwise UNDEFINED -- it's never defined to 0.).  Google Test
+// defines these macros automatically.  Code outside Google Test MUST
+// NOT define them.
+//
+// These macros are public so that portable tests can be written.
+// Such tests typically surround code using a feature with an #if
+// which controls that code.  For example:
+//
+// #if GTEST_HAS_DEATH_TEST
+//   EXPECT_DEATH(DoSomethingDeadly());
+// #endif
+//
+//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
+//                            tests)
+//   GTEST_HAS_DEATH_TEST   - death tests
+//   GTEST_HAS_PARAM_TEST   - value-parameterized tests
+//   GTEST_HAS_TYPED_TEST   - typed tests
+//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
+//   GTEST_IS_THREADSAFE    - Google Test is thread-safe.
+//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
+//                            GTEST_HAS_POSIX_RE (see above) which users can
+//                            define themselves.
+//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
+//                            the above two are mutually exclusive.
+//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
+
+// Misc public macros
+// ------------------
+//
+//   GTEST_FLAG(flag_name)  - references the variable corresponding to
+//                            the given Google Test flag.
+
+// Internal utilities
+// ------------------
+//
+// The following macros and utilities are for Google Test's INTERNAL
+// use only.  Code outside Google Test MUST NOT USE THEM DIRECTLY.
+//
+// Macros for basic C++ coding:
+//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
+//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
+//                              variable don't have to be used.
+//   GTEST_DISALLOW_ASSIGN_   - disables operator=.
+//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
+//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
+//   GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
+//                                        suppressed (constant conditional).
+//   GTEST_INTENTIONAL_CONST_COND_POP_  - finish code section where MSVC C4127
+//                                        is suppressed.
+//
+// C++11 feature wrappers:
+//
+//   testing::internal::move  - portability wrapper for std::move.
+//
+// Synchronization:
+//   Mutex, MutexLock, ThreadLocal, GetThreadCount()
+//                            - synchronization primitives.
+//
+// Template meta programming:
+//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
+//   IteratorTraits - partial implementation of std::iterator_traits, which
+//                    is not available in libCstd when compiled with Sun C++.
+//
+// Smart pointers:
+//   scoped_ptr     - as in TR2.
+//
+// Regular expressions:
+//   RE             - a simple regular expression class using the POSIX
+//                    Extended Regular Expression syntax on UNIX-like
+//                    platforms, or a reduced regular exception syntax on
+//                    other platforms, including Windows.
+//
+// Logging:
+//   GTEST_LOG_()   - logs messages at the specified severity level.
+//   LogToStderr()  - directs all log messages to stderr.
+//   FlushInfoLog() - flushes informational log messages.
+//
+// Stdout and stderr capturing:
+//   CaptureStdout()     - starts capturing stdout.
+//   GetCapturedStdout() - stops capturing stdout and returns the captured
+//                         string.
+//   CaptureStderr()     - starts capturing stderr.
+//   GetCapturedStderr() - stops capturing stderr and returns the captured
+//                         string.
+//
+// Integer types:
+//   TypeWithSize   - maps an integer to a int type.
+//   Int32, UInt32, Int64, UInt64, TimeInMillis
+//                  - integers of known sizes.
+//   BiggestInt     - the biggest signed integer type.
+//
+// Command-line utilities:
+//   GTEST_DECLARE_*()  - declares a flag.
+//   GTEST_DEFINE_*()   - defines a flag.
+//   GetInjectableArgvs() - returns the command line as a vector of strings.
+//
+// Environment variable utilities:
+//   GetEnv()             - gets the value of an environment variable.
+//   BoolFromGTestEnv()   - parses a bool environment variable.
+//   Int32FromGTestEnv()  - parses an Int32 environment variable.
+//   StringFromGTestEnv() - parses a string environment variable.
+
+#include <ctype.h>   // for isspace, etc
+#include <stddef.h>  // for ptrdiff_t
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32_WCE
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif  // !_WIN32_WCE
+
+#if defined __APPLE__
+# include <AvailabilityMacros.h>
+# include <TargetConditionals.h>
+#endif
+
+#include <algorithm>  // NOLINT
+#include <iostream>  // NOLINT
+#include <sstream>  // NOLINT
+#include <string>  // NOLINT
+#include <utility>
+#include <vector>  // NOLINT
+
+#include "gtest/internal/gtest-port-arch.h"
+#include "gtest/internal/custom/gtest-port.h"
+
+#if !defined(GTEST_DEV_EMAIL_)
+# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
+# define GTEST_FLAG_PREFIX_ "gtest_"
+# define GTEST_FLAG_PREFIX_DASH_ "gtest-"
+# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
+# define GTEST_NAME_ "Google Test"
+# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
+#endif  // !defined(GTEST_DEV_EMAIL_)
+
+#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
+#endif  // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+
+// Determines the version of gcc that is used to compile this.
+#ifdef __GNUC__
+// 40302 means version 4.3.2.
+# define GTEST_GCC_VER_ \
+    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
+#endif  // __GNUC__
+
+// Macros for disabling Microsoft Visual C++ warnings.
+//
+//   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
+//   /* code that triggers warnings C4800 and C4385 */
+//   GTEST_DISABLE_MSC_WARNINGS_POP_()
+#if _MSC_VER >= 1500
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
+    __pragma(warning(push))                        \
+    __pragma(warning(disable: warnings))
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()          \
+    __pragma(warning(pop))
+#else
+// Older versions of MSVC don't have __pragma.
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif
+
+#ifndef GTEST_LANG_CXX11
+// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
+// -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
+// value for __cplusplus, and recent versions of clang, gcc, and
+// probably other compilers set that too in C++11 mode.
+# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
+// Compiling in at least C++11 mode.
+#  define GTEST_LANG_CXX11 1
+# else
+#  define GTEST_LANG_CXX11 0
+# endif
+#endif
+
+// Distinct from C++11 language support, some environments don't provide
+// proper C++11 library support. Notably, it's possible to build in
+// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
+// with no C++11 support.
+//
+// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
+// 20110325, but maintenance releases in the 4.4 and 4.5 series followed
+// this date, so check for those versions by their date stamps.
+// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
+#if GTEST_LANG_CXX11 && \
+    (!defined(__GLIBCXX__) || ( \
+        __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \
+        /* Blacklist of patch releases of older branches: */ \
+        __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \
+        __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \
+        __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \
+        __GLIBCXX__ != 20120702ul))   /* GCC 4.5.4 */
+# define GTEST_STDLIB_CXX11 1
+#endif
+
+// Only use C++11 library features if the library provides them.
+#if GTEST_STDLIB_CXX11
+# define GTEST_HAS_STD_BEGIN_AND_END_ 1
+# define GTEST_HAS_STD_FORWARD_LIST_ 1
+# define GTEST_HAS_STD_FUNCTION_ 1
+# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
+# define GTEST_HAS_STD_MOVE_ 1
+# define GTEST_HAS_STD_SHARED_PTR_ 1
+# define GTEST_HAS_STD_TYPE_TRAITS_ 1
+# define GTEST_HAS_STD_UNIQUE_PTR_ 1
+#endif
+
+// C++11 specifies that <tuple> provides std::tuple.
+// Some platforms still might not have it, however.
+#if GTEST_LANG_CXX11
+# define GTEST_HAS_STD_TUPLE_ 1
+# if defined(__clang__)
+// Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
+#  if defined(__has_include) && !__has_include(<tuple>)
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# elif defined(_MSC_VER)
+// Inspired by boost/config/stdlib/dinkumware.hpp
+#  if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# elif defined(__GLIBCXX__)
+// Inspired by boost/config/stdlib/libstdcpp3.hpp,
+// http://gcc.gnu.org/gcc-4.2/changes.html and
+// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
+#  if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# endif
+#endif
+
+// Brings in definitions for functions used in the testing::internal::posix
+// namespace (read, write, close, chdir, isatty, stat). We do not currently
+// use them on Windows Mobile.
+#if GTEST_OS_WINDOWS
+# if !GTEST_OS_WINDOWS_MOBILE
+#  include <direct.h>
+#  include <io.h>
+# endif
+// In order to avoid having to include <windows.h>, use forward declaration
+// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
+// This assumption is verified by
+// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
+struct _RTL_CRITICAL_SECTION;
+#else
+// This assumes that non-Windows OSes provide unistd.h. For OSes where this
+// is not the case, we need to include headers that provide the functions
+// mentioned above.
+# include <unistd.h>
+# include <strings.h>
+#endif  // GTEST_OS_WINDOWS
+
+#if GTEST_OS_LINUX_ANDROID
+// Used to define __ANDROID_API__ matching the target NDK API level.
+#  include <android/api-level.h>  // NOLINT
+#endif
+
+// Defines this to true iff Google Test can use POSIX regular expressions.
+#ifndef GTEST_HAS_POSIX_RE
+# if GTEST_OS_LINUX_ANDROID
+// On Android, <regex.h> is only available starting with Gingerbread.
+#  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
+# else
+#  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
+# endif
+#endif
+
+#if GTEST_USES_PCRE
+// The appropriate headers have already been included.
+
+#elif GTEST_HAS_POSIX_RE
+
+// On some platforms, <regex.h> needs someone to define size_t, and
+// won't compile otherwise.  We can #include it here as we already
+// included <stdlib.h>, which is guaranteed to define size_t through
+// <stddef.h>.
+# include <regex.h>  // NOLINT
+
+# define GTEST_USES_POSIX_RE 1
+
+#elif GTEST_OS_WINDOWS
+
+// <regex.h> is not available on Windows.  Use our own simple regex
+// implementation instead.
+# define GTEST_USES_SIMPLE_RE 1
+
+#else
+
+// <regex.h> may not be available on this platform.  Use our own
+// simple regex implementation instead.
+# define GTEST_USES_SIMPLE_RE 1
+
+#endif  // GTEST_USES_PCRE
+
+#ifndef GTEST_HAS_EXCEPTIONS
+// The user didn't tell us whether exceptions are enabled, so we need
+// to figure it out.
+# if defined(_MSC_VER) || defined(__BORLANDC__)
+// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
+// macro to enable exceptions, so we'll do the same.
+// Assumes that exceptions are enabled by default.
+#  ifndef _HAS_EXCEPTIONS
+#   define _HAS_EXCEPTIONS 1
+#  endif  // _HAS_EXCEPTIONS
+#  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
+# elif defined(__clang__)
+// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
+// but iff cleanups are enabled after that. In Obj-C++ files, there can be
+// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
+// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
+// exceptions starting at clang r206352, but which checked for cleanups prior to
+// that. To reliably check for C++ exception availability with clang, check for
+// __EXCEPTIONS && __has_feature(cxx_exceptions).
+#  define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
+# elif defined(__GNUC__) && __EXCEPTIONS
+// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
+#  define GTEST_HAS_EXCEPTIONS 1
+# elif defined(__SUNPRO_CC)
+// Sun Pro CC supports exceptions.  However, there is no compile-time way of
+// detecting whether they are enabled or not.  Therefore, we assume that
+// they are enabled unless the user tells us otherwise.
+#  define GTEST_HAS_EXCEPTIONS 1
+# elif defined(__IBMCPP__) && __EXCEPTIONS
+// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
+#  define GTEST_HAS_EXCEPTIONS 1
+# elif defined(__HP_aCC)
+// Exception handling is in effect by default in HP aCC compiler. It has to
+// be turned of by +noeh compiler option if desired.
+#  define GTEST_HAS_EXCEPTIONS 1
+# else
+// For other compilers, we assume exceptions are disabled to be
+// conservative.
+#  define GTEST_HAS_EXCEPTIONS 0
+# endif  // defined(_MSC_VER) || defined(__BORLANDC__)
+#endif  // GTEST_HAS_EXCEPTIONS
+
+#if !defined(GTEST_HAS_STD_STRING)
+// Even though we don't use this macro any longer, we keep it in case
+// some clients still depend on it.
+# define GTEST_HAS_STD_STRING 1
+#elif !GTEST_HAS_STD_STRING
+// The user told us that ::std::string isn't available.
+# error "Google Test cannot be used where ::std::string isn't available."
+#endif  // !defined(GTEST_HAS_STD_STRING)
+
+#ifndef GTEST_HAS_GLOBAL_STRING
+// The user didn't tell us whether ::string is available, so we need
+// to figure it out.
+
+# define GTEST_HAS_GLOBAL_STRING 0
+
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+#ifndef GTEST_HAS_STD_WSTRING
+// The user didn't tell us whether ::std::wstring is available, so we need
+// to figure it out.
+// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
+//   is available.
+
+// Cygwin 1.7 and below doesn't support ::std::wstring.
+// Solaris' libc++ doesn't support it either.  Android has
+// no support for it at least as recent as Froyo (2.2).
+# define GTEST_HAS_STD_WSTRING \
+    (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
+
+#endif  // GTEST_HAS_STD_WSTRING
+
+#ifndef GTEST_HAS_GLOBAL_WSTRING
+// The user didn't tell us whether ::wstring is available, so we need
+// to figure it out.
+# define GTEST_HAS_GLOBAL_WSTRING \
+    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+// Determines whether RTTI is available.
+#ifndef GTEST_HAS_RTTI
+// The user didn't tell us whether RTTI is enabled, so we need to
+// figure it out.
+
+# ifdef _MSC_VER
+
+#  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
+#   define GTEST_HAS_RTTI 1
+#  else
+#   define GTEST_HAS_RTTI 0
+#  endif
+
+// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
+# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
+
+#  ifdef __GXX_RTTI
+// When building against STLport with the Android NDK and with
+// -frtti -fno-exceptions, the build fails at link time with undefined
+// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
+// so disable RTTI when detected.
+#   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
+       !defined(__EXCEPTIONS)
+#    define GTEST_HAS_RTTI 0
+#   else
+#    define GTEST_HAS_RTTI 1
+#   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
+#  else
+#   define GTEST_HAS_RTTI 0
+#  endif  // __GXX_RTTI
+
+// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
+// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
+// first version with C++ support.
+# elif defined(__clang__)
+
+#  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
+
+// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
+// both the typeid and dynamic_cast features are present.
+# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
+
+#  ifdef __RTTI_ALL__
+#   define GTEST_HAS_RTTI 1
+#  else
+#   define GTEST_HAS_RTTI 0
+#  endif
+
+# else
+
+// For all other compilers, we assume RTTI is enabled.
+#  define GTEST_HAS_RTTI 1
+
+# endif  // _MSC_VER
+
+#endif  // GTEST_HAS_RTTI
+
+// It's this header's responsibility to #include <typeinfo> when RTTI
+// is enabled.
+#if GTEST_HAS_RTTI
+# include <typeinfo>
+#endif
+
+// Determines whether Google Test can use the pthreads library.
+#ifndef GTEST_HAS_PTHREAD
+// The user didn't tell us explicitly, so we make reasonable assumptions about
+// which platforms have pthreads support.
+//
+// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
+// to your compiler flags.
+# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
+    || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL)
+#endif  // GTEST_HAS_PTHREAD
+
+#if GTEST_HAS_PTHREAD
+// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
+// true.
+# include <pthread.h>  // NOLINT
+
+// For timespec and nanosleep, used below.
+# include <time.h>  // NOLINT
+#endif
+
+// Determines if hash_map/hash_set are available.
+// Only used for testing against those containers.
+#if !defined(GTEST_HAS_HASH_MAP_)
+# if _MSC_VER
+#  define GTEST_HAS_HASH_MAP_ 1  // Indicates that hash_map is available.
+#  define GTEST_HAS_HASH_SET_ 1  // Indicates that hash_set is available.
+# endif  // _MSC_VER
+#endif  // !defined(GTEST_HAS_HASH_MAP_)
+
+// Determines whether Google Test can use tr1/tuple.  You can define
+// this macro to 0 to prevent Google Test from using tuple (any
+// feature depending on tuple with be disabled in this mode).
+#ifndef GTEST_HAS_TR1_TUPLE
+# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
+// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
+#  define GTEST_HAS_TR1_TUPLE 0
+# else
+// The user didn't tell us not to do it, so we assume it's OK.
+#  define GTEST_HAS_TR1_TUPLE 1
+# endif
+#endif  // GTEST_HAS_TR1_TUPLE
+
+// Determines whether Google Test's own tr1 tuple implementation
+// should be used.
+#ifndef GTEST_USE_OWN_TR1_TUPLE
+// The user didn't tell us, so we need to figure it out.
+
+// We use our own TR1 tuple if we aren't sure the user has an
+// implementation of it already.  At this time, libstdc++ 4.0.0+ and
+// MSVC 2010 are the only mainstream standard libraries that come
+// with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
+// pretends to be GCC by defining __GNUC__ and friends, but cannot
+// compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
+// tuple in a 323 MB Feature Pack download, which we cannot assume the
+// user has.  QNX's QCC compiler is a modified GCC but it doesn't
+// support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
+// and it can be used with some compilers that define __GNUC__.
+# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
+      && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
+#  define GTEST_ENV_HAS_TR1_TUPLE_ 1
+# endif
+
+// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
+// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
+// can build with clang but need to use gcc4.2's libstdc++).
+# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
+#  define GTEST_ENV_HAS_STD_TUPLE_ 1
+# endif
+
+# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
+#  define GTEST_USE_OWN_TR1_TUPLE 0
+# else
+#  define GTEST_USE_OWN_TR1_TUPLE 1
+# endif
+
+#endif  // GTEST_USE_OWN_TR1_TUPLE
+
+// To avoid conditional compilation everywhere, we make it
+// gtest-port.h's responsibility to #include the header implementing
+// tuple.
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>  // IWYU pragma: export
+# define GTEST_TUPLE_NAMESPACE_ ::std
+#endif  // GTEST_HAS_STD_TUPLE_
+
+// We include tr1::tuple even if std::tuple is available to define printers for
+// them.
+#if GTEST_HAS_TR1_TUPLE
+# ifndef GTEST_TUPLE_NAMESPACE_
+#  define GTEST_TUPLE_NAMESPACE_ ::std::tr1
+# endif  // GTEST_TUPLE_NAMESPACE_
+
+# if GTEST_USE_OWN_TR1_TUPLE
+#  include "gtest/internal/gtest-tuple.h"  // IWYU pragma: export  // NOLINT
+# elif GTEST_ENV_HAS_STD_TUPLE_
+#  include <tuple>
+// C++11 puts its tuple into the ::std namespace rather than
+// ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
+// This causes undefined behavior, but supported compilers react in
+// the way we intend.
+namespace std {
+namespace tr1 {
+using ::std::get;
+using ::std::make_tuple;
+using ::std::tuple;
+using ::std::tuple_element;
+using ::std::tuple_size;
+}
+}
+
+# elif GTEST_OS_SYMBIAN
+
+// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
+// use STLport's tuple implementation, which unfortunately doesn't
+// work as the copy of STLport distributed with Symbian is incomplete.
+// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
+// use its own tuple implementation.
+#  ifdef BOOST_HAS_TR1_TUPLE
+#   undef BOOST_HAS_TR1_TUPLE
+#  endif  // BOOST_HAS_TR1_TUPLE
+
+// This prevents <boost/tr1/detail/config.hpp>, which defines
+// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
+#  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
+#  include <tuple>  // IWYU pragma: export  // NOLINT
+
+# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
+// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
+// not conform to the TR1 spec, which requires the header to be <tuple>.
+
+#  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
+// which is #included by <tr1/tuple>, to not compile when RTTI is
+// disabled.  _TR1_FUNCTIONAL is the header guard for
+// <tr1/functional>.  Hence the following #define is a hack to prevent
+// <tr1/functional> from being included.
+#   define _TR1_FUNCTIONAL 1
+#   include <tr1/tuple>
+#   undef _TR1_FUNCTIONAL  // Allows the user to #include
+                        // <tr1/functional> if he chooses to.
+#  else
+#   include <tr1/tuple>  // NOLINT
+#  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+
+# else
+// If the compiler is not GCC 4.0+, we assume the user is using a
+// spec-conforming TR1 implementation.
+#  include <tuple>  // IWYU pragma: export  // NOLINT
+# endif  // GTEST_USE_OWN_TR1_TUPLE
+
+#endif  // GTEST_HAS_TR1_TUPLE
+
+// Determines whether clone(2) is supported.
+// Usually it will only be available on Linux, excluding
+// Linux on the Itanium architecture.
+// Also see http://linux.die.net/man/2/clone.
+#ifndef GTEST_HAS_CLONE
+// The user didn't tell us, so we need to figure it out.
+
+# if GTEST_OS_LINUX && !defined(__ia64__)
+#  if GTEST_OS_LINUX_ANDROID
+// On Android, clone() is only available on ARM starting with Gingerbread.
+#    if defined(__arm__) && __ANDROID_API__ >= 9
+#     define GTEST_HAS_CLONE 1
+#    else
+#     define GTEST_HAS_CLONE 0
+#    endif
+#  else
+#   define GTEST_HAS_CLONE 1
+#  endif
+# else
+#  define GTEST_HAS_CLONE 0
+# endif  // GTEST_OS_LINUX && !defined(__ia64__)
+
+#endif  // GTEST_HAS_CLONE
+
+// Determines whether to support stream redirection. This is used to test
+// output correctness and to implement death tests.
+#ifndef GTEST_HAS_STREAM_REDIRECTION
+// By default, we assume that stream redirection is supported on all
+// platforms except known mobile ones.
+# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
+    GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+#  define GTEST_HAS_STREAM_REDIRECTION 0
+# else
+#  define GTEST_HAS_STREAM_REDIRECTION 1
+# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
+#endif  // GTEST_HAS_STREAM_REDIRECTION
+
+// Determines whether to support death tests.
+// Google Test does not support death tests for VC 7.1 and earlier as
+// abort() in a VC 7.1 application compiled as GUI in debug config
+// pops up a dialog window that cannot be suppressed programmatically.
+#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
+     (GTEST_OS_MAC && !GTEST_OS_IOS) || \
+     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
+     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
+     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
+# define GTEST_HAS_DEATH_TEST 1
+#endif
+
+// We don't support MSVC 7.1 with exceptions disabled now.  Therefore
+// all the compilers we care about are adequate for supporting
+// value-parameterized tests.
+#define GTEST_HAS_PARAM_TEST 1
+
+// Determines whether to support type-driven tests.
+
+// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
+// Sun Pro CC, IBM Visual Age, and HP aCC support.
+#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
+    defined(__IBMCPP__) || defined(__HP_aCC)
+# define GTEST_HAS_TYPED_TEST 1
+# define GTEST_HAS_TYPED_TEST_P 1
+#endif
+
+// Determines whether to support Combine(). This only makes sense when
+// value-parameterized tests are enabled.  The implementation doesn't
+// work on Sun Studio since it doesn't understand templated conversion
+// operators.
+#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
+# define GTEST_HAS_COMBINE 1
+#endif
+
+// Determines whether the system compiler uses UTF-16 for encoding wide strings.
+#define GTEST_WIDE_STRING_USES_UTF16_ \
+    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
+
+// Determines whether test results can be streamed to a socket.
+#if GTEST_OS_LINUX
+# define GTEST_CAN_STREAM_RESULTS_ 1
+#endif
+
+// Defines some utility macros.
+
+// The GNU compiler emits a warning if nested "if" statements are followed by
+// an "else" statement and braces are not used to explicitly disambiguate the
+// "else" binding.  This leads to problems with code like:
+//
+//   if (gate)
+//     ASSERT_*(condition) << "Some message";
+//
+// The "switch (0) case 0:" idiom is used to suppress this.
+#ifdef __INTEL_COMPILER
+# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
+#else
+# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
+#endif
+
+// Use this annotation at the end of a struct/class definition to
+// prevent the compiler from optimizing away instances that are never
+// used.  This is useful when all interesting logic happens inside the
+// c'tor and / or d'tor.  Example:
+//
+//   struct Foo {
+//     Foo() { ... }
+//   } GTEST_ATTRIBUTE_UNUSED_;
+//
+// Also use it after a variable or parameter declaration to tell the
+// compiler the variable/parameter does not have to be used.
+#if defined(__GNUC__) && !defined(COMPILER_ICC)
+# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
+#elif defined(__clang__)
+# if __has_attribute(unused)
+#  define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
+# endif
+#endif
+#ifndef GTEST_ATTRIBUTE_UNUSED_
+# define GTEST_ATTRIBUTE_UNUSED_
+#endif
+
+// A macro to disallow operator=
+// This should be used in the private: declarations for a class.
+#define GTEST_DISALLOW_ASSIGN_(type)\
+  void operator=(type const &)
+
+// A macro to disallow copy constructor and operator=
+// This should be used in the private: declarations for a class.
+#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
+  type(type const &);\
+  GTEST_DISALLOW_ASSIGN_(type)
+
+// Tell the compiler to warn about unused return values for functions declared
+// with this macro.  The macro should be used on function declarations
+// following the argument list:
+//
+//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
+#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
+# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
+#else
+# define GTEST_MUST_USE_RESULT_
+#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
+
+// MS C++ compiler emits warning when a conditional expression is compile time
+// constant. In some contexts this warning is false positive and needs to be
+// suppressed. Use the following two macros in such cases:
+//
+// GTEST_INTENTIONAL_CONST_COND_PUSH_()
+// while (true) {
+// GTEST_INTENTIONAL_CONST_COND_POP_()
+// }
+# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
+    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
+# define GTEST_INTENTIONAL_CONST_COND_POP_() \
+    GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+// Determine whether the compiler supports Microsoft's Structured Exception
+// Handling.  This is supported by several Windows compilers but generally
+// does not exist on any other system.
+#ifndef GTEST_HAS_SEH
+// The user didn't tell us, so we need to figure it out.
+
+# if defined(_MSC_VER) || defined(__BORLANDC__)
+// These two compilers are known to support SEH.
+#  define GTEST_HAS_SEH 1
+# else
+// Assume no SEH.
+#  define GTEST_HAS_SEH 0
+# endif
+
+#define GTEST_IS_THREADSAFE \
+    (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
+     || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
+     || GTEST_HAS_PTHREAD)
+
+#endif  // GTEST_HAS_SEH
+
+#ifdef _MSC_VER
+# if GTEST_LINKED_AS_SHARED_LIBRARY
+#  define GTEST_API_ __declspec(dllimport)
+# elif GTEST_CREATE_SHARED_LIBRARY
+#  define GTEST_API_ __declspec(dllexport)
+# endif
+#elif __GNUC__ >= 4 || defined(__clang__)
+# define GTEST_API_ __attribute__((visibility ("default")))
+#endif // _MSC_VER
+
+#ifndef GTEST_API_
+# define GTEST_API_
+#endif
+
+#ifdef __GNUC__
+// Ask the compiler to never inline a given function.
+# define GTEST_NO_INLINE_ __attribute__((noinline))
+#else
+# define GTEST_NO_INLINE_
+#endif
+
+// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
+#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
+# define GTEST_HAS_CXXABI_H_ 1
+#else
+# define GTEST_HAS_CXXABI_H_ 0
+#endif
+
+// A function level attribute to disable checking for use of uninitialized
+// memory when built with MemorySanitizer.
+#if defined(__clang__)
+# if __has_feature(memory_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
+       __attribute__((no_sanitize_memory))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+# endif  // __has_feature(memory_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+#endif  // __clang__
+
+// A function level attribute to disable AddressSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(address_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
+       __attribute__((no_sanitize_address))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+# endif  // __has_feature(address_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+#endif  // __clang__
+
+// A function level attribute to disable ThreadSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(thread_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
+       __attribute__((no_sanitize_thread))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+# endif  // __has_feature(thread_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+#endif  // __clang__
+
+namespace testing {
+
+class Message;
+
+#if defined(GTEST_TUPLE_NAMESPACE_)
+// Import tuple and friends into the ::testing namespace.
+// It is part of our interface, having them in ::testing allows us to change
+// their types as needed.
+using GTEST_TUPLE_NAMESPACE_::get;
+using GTEST_TUPLE_NAMESPACE_::make_tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple_size;
+using GTEST_TUPLE_NAMESPACE_::tuple_element;
+#endif  // defined(GTEST_TUPLE_NAMESPACE_)
+
+namespace internal {
+
+// A secret type that Google Test users don't know about.  It has no
+// definition on purpose.  Therefore it's impossible to create a
+// Secret object, which is what we want.
+class Secret;
+
+// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
+// expression is true. For example, you could use it to verify the
+// size of a static array:
+//
+//   GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
+//                         names_incorrect_size);
+//
+// or to make sure a struct is smaller than a certain size:
+//
+//   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
+//
+// The second argument to the macro is the name of the variable. If
+// the expression is false, most compilers will issue a warning/error
+// containing the name of the variable.
+
+#if GTEST_LANG_CXX11
+# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
+#else  // !GTEST_LANG_CXX11
+template <bool>
+  struct CompileAssert {
+};
+
+# define GTEST_COMPILE_ASSERT_(expr, msg) \
+  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
+      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
+#endif  // !GTEST_LANG_CXX11
+
+// Implementation details of GTEST_COMPILE_ASSERT_:
+//
+// (In C++11, we simply use static_assert instead of the following)
+//
+// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
+//   elements (and thus is invalid) when the expression is false.
+//
+// - The simpler definition
+//
+//    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
+//
+//   does not work, as gcc supports variable-length arrays whose sizes
+//   are determined at run-time (this is gcc's extension and not part
+//   of the C++ standard).  As a result, gcc fails to reject the
+//   following code with the simple definition:
+//
+//     int foo;
+//     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
+//                                      // not a compile-time constant.
+//
+// - By using the type CompileAssert<(bool(expr))>, we ensures that
+//   expr is a compile-time constant.  (Template arguments must be
+//   determined at compile-time.)
+//
+// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
+//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
+//
+//     CompileAssert<bool(expr)>
+//
+//   instead, these compilers will refuse to compile
+//
+//     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
+//
+//   (They seem to think the ">" in "5 > 0" marks the end of the
+//   template argument list.)
+//
+// - The array size is (bool(expr) ? 1 : -1), instead of simply
+//
+//     ((expr) ? 1 : -1).
+//
+//   This is to avoid running into a bug in MS VC 7.1, which
+//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
+
+// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
+//
+// This template is declared, but intentionally undefined.
+template <typename T1, typename T2>
+struct StaticAssertTypeEqHelper;
+
+template <typename T>
+struct StaticAssertTypeEqHelper<T, T> {
+  enum { value = true };
+};
+
+// Evaluates to the number of elements in 'array'.
+#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
+
+#if GTEST_HAS_GLOBAL_STRING
+typedef ::string string;
+#else
+typedef ::std::string string;
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+#if GTEST_HAS_GLOBAL_WSTRING
+typedef ::wstring wstring;
+#elif GTEST_HAS_STD_WSTRING
+typedef ::std::wstring wstring;
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+// A helper for suppressing warnings on constant condition.  It just
+// returns 'condition'.
+GTEST_API_ bool IsTrue(bool condition);
+
+// Defines scoped_ptr.
+
+// This implementation of scoped_ptr is PARTIAL - it only contains
+// enough stuff to satisfy Google Test's need.
+template <typename T>
+class scoped_ptr {
+ public:
+  typedef T element_type;
+
+  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
+  ~scoped_ptr() { reset(); }
+
+  T& operator*() const { return *ptr_; }
+  T* operator->() const { return ptr_; }
+  T* get() const { return ptr_; }
+
+  T* release() {
+    T* const ptr = ptr_;
+    ptr_ = NULL;
+    return ptr;
+  }
+
+  void reset(T* p = NULL) {
+    if (p != ptr_) {
+      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
+        delete ptr_;
+      }
+      ptr_ = p;
+    }
+  }
+
+  friend void swap(scoped_ptr& a, scoped_ptr& b) {
+    using std::swap;
+    swap(a.ptr_, b.ptr_);
+  }
+
+ private:
+  T* ptr_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
+};
+
+// Defines RE.
+
+// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
+// Regular Expression syntax.
+class GTEST_API_ RE {
+ public:
+  // A copy constructor is required by the Standard to initialize object
+  // references from r-values.
+  RE(const RE& other) { Init(other.pattern()); }
+
+  // Constructs an RE from a string.
+  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
+
+#if GTEST_HAS_GLOBAL_STRING
+
+  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
+
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+  RE(const char* regex) { Init(regex); }  // NOLINT
+  ~RE();
+
+  // Returns the string representation of the regex.
+  const char* pattern() const { return pattern_; }
+
+  // FullMatch(str, re) returns true iff regular expression re matches
+  // the entire str.
+  // PartialMatch(str, re) returns true iff regular expression re
+  // matches a substring of str (including str itself).
+  //
+  // TODO(wan@google.com): make FullMatch() and PartialMatch() work
+  // when str contains NUL characters.
+  static bool FullMatch(const ::std::string& str, const RE& re) {
+    return FullMatch(str.c_str(), re);
+  }
+  static bool PartialMatch(const ::std::string& str, const RE& re) {
+    return PartialMatch(str.c_str(), re);
+  }
+
+#if GTEST_HAS_GLOBAL_STRING
+
+  static bool FullMatch(const ::string& str, const RE& re) {
+    return FullMatch(str.c_str(), re);
+  }
+  static bool PartialMatch(const ::string& str, const RE& re) {
+    return PartialMatch(str.c_str(), re);
+  }
+
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+  static bool FullMatch(const char* str, const RE& re);
+  static bool PartialMatch(const char* str, const RE& re);
+
+ private:
+  void Init(const char* regex);
+
+  // We use a const char* instead of an std::string, as Google Test used to be
+  // used where std::string is not available.  TODO(wan@google.com): change to
+  // std::string.
+  const char* pattern_;
+  bool is_valid_;
+
+#if GTEST_USES_POSIX_RE
+
+  regex_t full_regex_;     // For FullMatch().
+  regex_t partial_regex_;  // For PartialMatch().
+
+#else  // GTEST_USES_SIMPLE_RE
+
+  const char* full_pattern_;  // For FullMatch();
+
+#endif
+
+  GTEST_DISALLOW_ASSIGN_(RE);
+};
+
+// Formats a source file path and a line number as they would appear
+// in an error message from the compiler used to compile this code.
+GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
+
+// Formats a file location for compiler-independent XML output.
+// Although this function is not platform dependent, we put it next to
+// FormatFileLocation in order to contrast the two functions.
+GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
+                                                               int line);
+
+// Defines logging utilities:
+//   GTEST_LOG_(severity) - logs messages at the specified severity level. The
+//                          message itself is streamed into the macro.
+//   LogToStderr()  - directs all log messages to stderr.
+//   FlushInfoLog() - flushes informational log messages.
+
+enum GTestLogSeverity {
+  GTEST_INFO,
+  GTEST_WARNING,
+  GTEST_ERROR,
+  GTEST_FATAL
+};
+
+// Formats log entry severity, provides a stream object for streaming the
+// log message, and terminates the message with a newline when going out of
+// scope.
+class GTEST_API_ GTestLog {
+ public:
+  GTestLog(GTestLogSeverity severity, const char* file, int line);
+
+  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
+  ~GTestLog();
+
+  ::std::ostream& GetStream() { return ::std::cerr; }
+
+ private:
+  const GTestLogSeverity severity_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
+};
+
+#if !defined(GTEST_LOG_)
+
+# define GTEST_LOG_(severity) \
+    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
+                                  __FILE__, __LINE__).GetStream()
+
+inline void LogToStderr() {}
+inline void FlushInfoLog() { fflush(NULL); }
+
+#endif  // !defined(GTEST_LOG_)
+
+#if !defined(GTEST_CHECK_)
+// INTERNAL IMPLEMENTATION - DO NOT USE.
+//
+// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
+// is not satisfied.
+//  Synopsys:
+//    GTEST_CHECK_(boolean_condition);
+//     or
+//    GTEST_CHECK_(boolean_condition) << "Additional message";
+//
+//    This checks the condition and if the condition is not satisfied
+//    it prints message about the condition violation, including the
+//    condition itself, plus additional message streamed into it, if any,
+//    and then it aborts the program. It aborts the program irrespective of
+//    whether it is built in the debug mode or not.
+# define GTEST_CHECK_(condition) \
+    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+    if (::testing::internal::IsTrue(condition)) \
+      ; \
+    else \
+      GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+#endif  // !defined(GTEST_CHECK_)
+
+// An all-mode assert to verify that the given POSIX-style function
+// call returns 0 (indicating success).  Known limitation: this
+// doesn't expand to a balanced 'if' statement, so enclose the macro
+// in {} if you need to use it as the only statement in an 'if'
+// branch.
+#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
+  if (const int gtest_error = (posix_call)) \
+    GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
+                      << gtest_error
+
+#if GTEST_HAS_STD_MOVE_
+using std::move;
+#else  // GTEST_HAS_STD_MOVE_
+template <typename T>
+const T& move(const T& t) {
+  return t;
+}
+#endif  // GTEST_HAS_STD_MOVE_
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Use ImplicitCast_ as a safe version of static_cast for upcasting in
+// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
+// const Foo*).  When you use ImplicitCast_, the compiler checks that
+// the cast is safe.  Such explicit ImplicitCast_s are necessary in
+// surprisingly many situations where C++ demands an exact type match
+// instead of an argument type convertable to a target type.
+//
+// The syntax for using ImplicitCast_ is the same as for static_cast:
+//
+//   ImplicitCast_<ToType>(expr)
+//
+// ImplicitCast_ would have been part of the C++ standard library,
+// but the proposal was submitted too late.  It will probably make
+// its way into the language in the future.
+//
+// This relatively ugly name is intentional. It prevents clashes with
+// similar functions users may have (e.g., implicit_cast). The internal
+// namespace alone is not enough because the function can be found by ADL.
+template<typename To>
+inline To ImplicitCast_(To x) { return x; }
+
+// When you upcast (that is, cast a pointer from type Foo to type
+// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
+// always succeed.  When you downcast (that is, cast a pointer from
+// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
+// how do you know the pointer is really of type SubclassOfFoo?  It
+// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
+// when you downcast, you should use this macro.  In debug mode, we
+// use dynamic_cast<> to double-check the downcast is legal (we die
+// if it's not).  In normal mode, we do the efficient static_cast<>
+// instead.  Thus, it's important to test in debug mode to make sure
+// the cast is legal!
+//    This is the only place in the code we should use dynamic_cast<>.
+// In particular, you SHOULDN'T be using dynamic_cast<> in order to
+// do RTTI (eg code like this:
+//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
+//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
+// You should design the code some other way not to need this.
+//
+// This relatively ugly name is intentional. It prevents clashes with
+// similar functions users may have (e.g., down_cast). The internal
+// namespace alone is not enough because the function can be found by ADL.
+template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
+inline To DownCast_(From* f) {  // so we only accept pointers
+  // Ensures that To is a sub-type of From *.  This test is here only
+  // for compile-time type checking, and has no overhead in an
+  // optimized build at run-time, as it will be optimized away
+  // completely.
+  GTEST_INTENTIONAL_CONST_COND_PUSH_()
+  if (false) {
+  GTEST_INTENTIONAL_CONST_COND_POP_()
+    const To to = NULL;
+    ::testing::internal::ImplicitCast_<From*>(to);
+  }
+
+#if GTEST_HAS_RTTI
+  // RTTI: debug mode only!
+  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
+#endif
+  return static_cast<To>(f);
+}
+
+// Downcasts the pointer of type Base to Derived.
+// Derived must be a subclass of Base. The parameter MUST
+// point to a class of type Derived, not any subclass of it.
+// When RTTI is available, the function performs a runtime
+// check to enforce this.
+template <class Derived, class Base>
+Derived* CheckedDowncastToActualType(Base* base) {
+#if GTEST_HAS_RTTI
+  GTEST_CHECK_(typeid(*base) == typeid(Derived));
+#endif
+
+#if GTEST_HAS_DOWNCAST_
+  return ::down_cast<Derived*>(base);
+#elif GTEST_HAS_RTTI
+  return dynamic_cast<Derived*>(base);  // NOLINT
+#else
+  return static_cast<Derived*>(base);  // Poor man's downcast.
+#endif
+}
+
+#if GTEST_HAS_STREAM_REDIRECTION
+
+// Defines the stderr capturer:
+//   CaptureStdout     - starts capturing stdout.
+//   GetCapturedStdout - stops capturing stdout and returns the captured string.
+//   CaptureStderr     - starts capturing stderr.
+//   GetCapturedStderr - stops capturing stderr and returns the captured string.
+//
+GTEST_API_ void CaptureStdout();
+GTEST_API_ std::string GetCapturedStdout();
+GTEST_API_ void CaptureStderr();
+GTEST_API_ std::string GetCapturedStderr();
+
+#endif  // GTEST_HAS_STREAM_REDIRECTION
+
+// Returns a path to temporary directory.
+GTEST_API_ std::string TempDir();
+
+// Returns the size (in bytes) of a file.
+GTEST_API_ size_t GetFileSize(FILE* file);
+
+// Reads the entire content of a file as a string.
+GTEST_API_ std::string ReadEntireFile(FILE* file);
+
+// All command line arguments.
+GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
+
+#if GTEST_HAS_DEATH_TEST
+
+const ::std::vector<testing::internal::string>& GetInjectableArgvs();
+void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
+                             new_argvs);
+
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+// Defines synchronization primitives.
+#if GTEST_IS_THREADSAFE
+# if GTEST_HAS_PTHREAD
+// Sleeps for (roughly) n milliseconds.  This function is only for testing
+// Google Test's own constructs.  Don't use it in user tests, either
+// directly or indirectly.
+inline void SleepMilliseconds(int n) {
+  const timespec time = {
+    0,                  // 0 seconds.
+    n * 1000L * 1000L,  // And n ms.
+  };
+  nanosleep(&time, NULL);
+}
+# endif  // GTEST_HAS_PTHREAD
+
+# if GTEST_HAS_NOTIFICATION_
+// Notification has already been imported into the namespace.
+// Nothing to do here.
+
+# elif GTEST_HAS_PTHREAD
+// Allows a controller thread to pause execution of newly created
+// threads until notified.  Instances of this class must be created
+// and destroyed in the controller thread.
+//
+// This class is only for testing Google Test's own constructs. Do not
+// use it in user tests, either directly or indirectly.
+class Notification {
+ public:
+  Notification() : notified_(false) {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
+  }
+  ~Notification() {
+    pthread_mutex_destroy(&mutex_);
+  }
+
+  // Notifies all threads created with this notification to start. Must
+  // be called from the controller thread.
+  void Notify() {
+    pthread_mutex_lock(&mutex_);
+    notified_ = true;
+    pthread_mutex_unlock(&mutex_);
+  }
+
+  // Blocks until the controller thread notifies. Must be called from a test
+  // thread.
+  void WaitForNotification() {
+    for (;;) {
+      pthread_mutex_lock(&mutex_);
+      const bool notified = notified_;
+      pthread_mutex_unlock(&mutex_);
+      if (notified)
+        break;
+      SleepMilliseconds(10);
+    }
+  }
+
+ private:
+  pthread_mutex_t mutex_;
+  bool notified_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
+};
+
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+GTEST_API_ void SleepMilliseconds(int n);
+
+// Provides leak-safe Windows kernel handle ownership.
+// Used in death tests and in threading support.
+class GTEST_API_ AutoHandle {
+ public:
+  // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
+  // avoid including <windows.h> in this header file. Including <windows.h> is
+  // undesirable because it defines a lot of symbols and macros that tend to
+  // conflict with client code. This assumption is verified by
+  // WindowsTypesTest.HANDLEIsVoidStar.
+  typedef void* Handle;
+  AutoHandle();
+  explicit AutoHandle(Handle handle);
+
+  ~AutoHandle();
+
+  Handle Get() const;
+  void Reset();
+  void Reset(Handle handle);
+
+ private:
+  // Returns true iff the handle is a valid handle object that can be closed.
+  bool IsCloseable() const;
+
+  Handle handle_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
+};
+
+// Allows a controller thread to pause execution of newly created
+// threads until notified.  Instances of this class must be created
+// and destroyed in the controller thread.
+//
+// This class is only for testing Google Test's own constructs. Do not
+// use it in user tests, either directly or indirectly.
+class GTEST_API_ Notification {
+ public:
+  Notification();
+  void Notify();
+  void WaitForNotification();
+
+ private:
+  AutoHandle event_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
+};
+# endif  // GTEST_HAS_NOTIFICATION_
+
+// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
+// defined, but we don't want to use MinGW's pthreads implementation, which
+// has conformance problems with some versions of the POSIX standard.
+# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
+
+// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
+// Consequently, it cannot select a correct instantiation of ThreadWithParam
+// in order to call its Run(). Introducing ThreadWithParamBase as a
+// non-templated base class for ThreadWithParam allows us to bypass this
+// problem.
+class ThreadWithParamBase {
+ public:
+  virtual ~ThreadWithParamBase() {}
+  virtual void Run() = 0;
+};
+
+// pthread_create() accepts a pointer to a function type with the C linkage.
+// According to the Standard (7.5/1), function types with different linkages
+// are different even if they are otherwise identical.  Some compilers (for
+// example, SunStudio) treat them as different types.  Since class methods
+// cannot be defined with C-linkage we need to define a free C-function to
+// pass into pthread_create().
+extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
+  static_cast<ThreadWithParamBase*>(thread)->Run();
+  return NULL;
+}
+
+// Helper class for testing Google Test's multi-threading constructs.
+// To use it, write:
+//
+//   void ThreadFunc(int param) { /* Do things with param */ }
+//   Notification thread_can_start;
+//   ...
+//   // The thread_can_start parameter is optional; you can supply NULL.
+//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
+//   thread_can_start.Notify();
+//
+// These classes are only for testing Google Test's own constructs. Do
+// not use them in user tests, either directly or indirectly.
+template <typename T>
+class ThreadWithParam : public ThreadWithParamBase {
+ public:
+  typedef void UserThreadFunc(T);
+
+  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
+      : func_(func),
+        param_(param),
+        thread_can_start_(thread_can_start),
+        finished_(false) {
+    ThreadWithParamBase* const base = this;
+    // The thread can be created only after all fields except thread_
+    // have been initialized.
+    GTEST_CHECK_POSIX_SUCCESS_(
+        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
+  }
+  ~ThreadWithParam() { Join(); }
+
+  void Join() {
+    if (!finished_) {
+      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
+      finished_ = true;
+    }
+  }
+
+  virtual void Run() {
+    if (thread_can_start_ != NULL)
+      thread_can_start_->WaitForNotification();
+    func_(param_);
+  }
+
+ private:
+  UserThreadFunc* const func_;  // User-supplied thread function.
+  const T param_;  // User-supplied parameter to the thread function.
+  // When non-NULL, used to block execution until the controller thread
+  // notifies.
+  Notification* const thread_can_start_;
+  bool finished_;  // true iff we know that the thread function has finished.
+  pthread_t thread_;  // The native thread object.
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
+};
+# endif  // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
+         // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+
+# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+// Mutex and ThreadLocal have already been imported into the namespace.
+// Nothing to do here.
+
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+// Mutex implements mutex on Windows platforms.  It is used in conjunction
+// with class MutexLock:
+//
+//   Mutex mutex;
+//   ...
+//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the
+//                            // end of the current scope.
+//
+// A static Mutex *must* be defined or declared using one of the following
+// macros:
+//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
+//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
+//
+// (A non-static Mutex is defined/declared in the usual way).
+class GTEST_API_ Mutex {
+ public:
+  enum MutexType { kStatic = 0, kDynamic = 1 };
+  // We rely on kStaticMutex being 0 as it is to what the linker initializes
+  // type_ in static mutexes.  critical_section_ will be initialized lazily
+  // in ThreadSafeLazyInit().
+  enum StaticConstructorSelector { kStaticMutex = 0 };
+
+  // This constructor intentionally does nothing.  It relies on type_ being
+  // statically initialized to 0 (effectively setting it to kStatic) and on
+  // ThreadSafeLazyInit() to lazily initialize the rest of the members.
+  explicit Mutex(StaticConstructorSelector /*dummy*/) {}
+
+  Mutex();
+  ~Mutex();
+
+  void Lock();
+
+  void Unlock();
+
+  // Does nothing if the current thread holds the mutex. Otherwise, crashes
+  // with high probability.
+  void AssertHeld();
+
+ private:
+  // Initializes owner_thread_id_ and critical_section_ in static mutexes.
+  void ThreadSafeLazyInit();
+
+  // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
+  // we assume that 0 is an invalid value for thread IDs.
+  unsigned int owner_thread_id_;
+
+  // For static mutexes, we rely on these members being initialized to zeros
+  // by the linker.
+  MutexType type_;
+  long critical_section_init_phase_;  // NOLINT
+  _RTL_CRITICAL_SECTION* critical_section_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
+};
+
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+    extern ::testing::internal::Mutex mutex
+
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+    ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(Mutex* mutex)
+      : mutex_(mutex) { mutex_->Lock(); }
+
+  ~GTestMutexLock() { mutex_->Unlock(); }
+
+ private:
+  Mutex* const mutex_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
+};
+
+typedef GTestMutexLock MutexLock;
+
+// Base class for ValueHolder<T>.  Allows a caller to hold and delete a value
+// without knowing its type.
+class ThreadLocalValueHolderBase {
+ public:
+  virtual ~ThreadLocalValueHolderBase() {}
+};
+
+// Provides a way for a thread to send notifications to a ThreadLocal
+// regardless of its parameter type.
+class ThreadLocalBase {
+ public:
+  // Creates a new ValueHolder<T> object holding a default value passed to
+  // this ThreadLocal<T>'s constructor and returns it.  It is the caller's
+  // responsibility not to call this when the ThreadLocal<T> instance already
+  // has a value on the current thread.
+  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
+
+ protected:
+  ThreadLocalBase() {}
+  virtual ~ThreadLocalBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
+};
+
+// Maps a thread to a set of ThreadLocals that have values instantiated on that
+// thread and notifies them when the thread exits.  A ThreadLocal instance is
+// expected to persist until all threads it has values on have terminated.
+class GTEST_API_ ThreadLocalRegistry {
+ public:
+  // Registers thread_local_instance as having value on the current thread.
+  // Returns a value that can be used to identify the thread from other threads.
+  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance);
+
+  // Invoked when a ThreadLocal instance is destroyed.
+  static void OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance);
+};
+
+class GTEST_API_ ThreadWithParamBase {
+ public:
+  void Join();
+
+ protected:
+  class Runnable {
+   public:
+    virtual ~Runnable() {}
+    virtual void Run() = 0;
+  };
+
+  ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
+  virtual ~ThreadWithParamBase();
+
+ private:
+  AutoHandle thread_;
+};
+
+// Helper class for testing Google Test's multi-threading constructs.
+template <typename T>
+class ThreadWithParam : public ThreadWithParamBase {
+ public:
+  typedef void UserThreadFunc(T);
+
+  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
+      : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
+  }
+  virtual ~ThreadWithParam() {}
+
+ private:
+  class RunnableImpl : public Runnable {
+   public:
+    RunnableImpl(UserThreadFunc* func, T param)
+        : func_(func),
+          param_(param) {
+    }
+    virtual ~RunnableImpl() {}
+    virtual void Run() {
+      func_(param_);
+    }
+
+   private:
+    UserThreadFunc* const func_;
+    const T param_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
+  };
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
+};
+
+// Implements thread-local storage on Windows systems.
+//
+//   // Thread 1
+//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
+//
+//   // Thread 2
+//   tl.set(150);  // Changes the value for thread 2 only.
+//   EXPECT_EQ(150, tl.get());
+//
+//   // Thread 1
+//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
+//   tl.set(200);
+//   EXPECT_EQ(200, tl.get());
+//
+// The template type argument T must have a public copy constructor.
+// In addition, the default ThreadLocal constructor requires T to have
+// a public default constructor.
+//
+// The users of a TheadLocal instance have to make sure that all but one
+// threads (including the main one) using that instance have exited before
+// destroying it. Otherwise, the per-thread objects managed for them by the
+// ThreadLocal instance are not guaranteed to be destroyed on all platforms.
+//
+// Google Test only uses global ThreadLocal objects.  That means they
+// will die after main() has returned.  Therefore, no per-thread
+// object managed by Google Test will be leaked as long as all threads
+// using Google Test have exited when main() returns.
+template <typename T>
+class ThreadLocal : public ThreadLocalBase {
+ public:
+  ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
+  explicit ThreadLocal(const T& value)
+      : default_factory_(new InstanceValueHolderFactory(value)) {}
+
+  ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
+
+  T* pointer() { return GetOrCreateValue(); }
+  const T* pointer() const { return GetOrCreateValue(); }
+  const T& get() const { return *pointer(); }
+  void set(const T& value) { *pointer() = value; }
+
+ private:
+  // Holds a value of T.  Can be deleted via its base class without the caller
+  // knowing the type of T.
+  class ValueHolder : public ThreadLocalValueHolderBase {
+   public:
+    ValueHolder() : value_() {}
+    explicit ValueHolder(const T& value) : value_(value) {}
+
+    T* pointer() { return &value_; }
+
+   private:
+    T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
+  };
+
+
+  T* GetOrCreateValue() const {
+    return static_cast<ValueHolder*>(
+        ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
+  }
+
+  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
+    return default_factory_->MakeNewHolder();
+  }
+
+  class ValueHolderFactory {
+   public:
+    ValueHolderFactory() {}
+    virtual ~ValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const = 0;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+  };
+
+  class DefaultValueHolderFactory : public ValueHolderFactory {
+   public:
+    DefaultValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+  };
+
+  class InstanceValueHolderFactory : public ValueHolderFactory {
+   public:
+    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+    virtual ValueHolder* MakeNewHolder() const {
+      return new ValueHolder(value_);
+    }
+
+   private:
+    const T value_;  // The value for each thread.
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+  };
+
+  scoped_ptr<ValueHolderFactory> default_factory_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
+};
+
+# elif GTEST_HAS_PTHREAD
+
+// MutexBase and Mutex implement mutex on pthreads-based platforms.
+class MutexBase {
+ public:
+  // Acquires this mutex.
+  void Lock() {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
+    owner_ = pthread_self();
+    has_owner_ = true;
+  }
+
+  // Releases this mutex.
+  void Unlock() {
+    // Since the lock is being released the owner_ field should no longer be
+    // considered valid. We don't protect writing to has_owner_ here, as it's
+    // the caller's responsibility to ensure that the current thread holds the
+    // mutex when this is called.
+    has_owner_ = false;
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
+  }
+
+  // Does nothing if the current thread holds the mutex. Otherwise, crashes
+  // with high probability.
+  void AssertHeld() const {
+    GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
+        << "The current thread is not holding the mutex @" << this;
+  }
+
+  // A static mutex may be used before main() is entered.  It may even
+  // be used before the dynamic initialization stage.  Therefore we
+  // must be able to initialize a static mutex object at link time.
+  // This means MutexBase has to be a POD and its member variables
+  // have to be public.
+ public:
+  pthread_mutex_t mutex_;  // The underlying pthread mutex.
+  // has_owner_ indicates whether the owner_ field below contains a valid thread
+  // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
+  // accesses to the owner_ field should be protected by a check of this field.
+  // An alternative might be to memset() owner_ to all zeros, but there's no
+  // guarantee that a zero'd pthread_t is necessarily invalid or even different
+  // from pthread_self().
+  bool has_owner_;
+  pthread_t owner_;  // The thread holding the mutex.
+};
+
+// Forward-declares a static mutex.
+#  define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+     extern ::testing::internal::MutexBase mutex
+
+// Defines and statically (i.e. at link time) initializes a static mutex.
+#  define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
+
+// The Mutex class can only be used for mutexes created at runtime. It
+// shares its API with MutexBase otherwise.
+class Mutex : public MutexBase {
+ public:
+  Mutex() {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
+    has_owner_ = false;
+  }
+  ~Mutex() {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
+};
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(MutexBase* mutex)
+      : mutex_(mutex) { mutex_->Lock(); }
+
+  ~GTestMutexLock() { mutex_->Unlock(); }
+
+ private:
+  MutexBase* const mutex_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
+};
+
+typedef GTestMutexLock MutexLock;
+
+// Helpers for ThreadLocal.
+
+// pthread_key_create() requires DeleteThreadLocalValue() to have
+// C-linkage.  Therefore it cannot be templatized to access
+// ThreadLocal<T>.  Hence the need for class
+// ThreadLocalValueHolderBase.
+class ThreadLocalValueHolderBase {
+ public:
+  virtual ~ThreadLocalValueHolderBase() {}
+};
+
+// Called by pthread to delete thread-local data stored by
+// pthread_setspecific().
+extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
+  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
+}
+
+// Implements thread-local storage on pthreads-based systems.
+template <typename T>
+class ThreadLocal {
+ public:
+  ThreadLocal()
+      : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
+  explicit ThreadLocal(const T& value)
+      : key_(CreateKey()),
+        default_factory_(new InstanceValueHolderFactory(value)) {}
+
+  ~ThreadLocal() {
+    // Destroys the managed object for the current thread, if any.
+    DeleteThreadLocalValue(pthread_getspecific(key_));
+
+    // Releases resources associated with the key.  This will *not*
+    // delete managed objects for other threads.
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
+  }
+
+  T* pointer() { return GetOrCreateValue(); }
+  const T* pointer() const { return GetOrCreateValue(); }
+  const T& get() const { return *pointer(); }
+  void set(const T& value) { *pointer() = value; }
+
+ private:
+  // Holds a value of type T.
+  class ValueHolder : public ThreadLocalValueHolderBase {
+   public:
+    ValueHolder() : value_() {}
+    explicit ValueHolder(const T& value) : value_(value) {}
+
+    T* pointer() { return &value_; }
+
+   private:
+    T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
+  };
+
+  static pthread_key_t CreateKey() {
+    pthread_key_t key;
+    // When a thread exits, DeleteThreadLocalValue() will be called on
+    // the object managed for that thread.
+    GTEST_CHECK_POSIX_SUCCESS_(
+        pthread_key_create(&key, &DeleteThreadLocalValue));
+    return key;
+  }
+
+  T* GetOrCreateValue() const {
+    ThreadLocalValueHolderBase* const holder =
+        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
+    if (holder != NULL) {
+      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
+    }
+
+    ValueHolder* const new_holder = default_factory_->MakeNewHolder();
+    ThreadLocalValueHolderBase* const holder_base = new_holder;
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
+    return new_holder->pointer();
+  }
+
+  class ValueHolderFactory {
+   public:
+    ValueHolderFactory() {}
+    virtual ~ValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const = 0;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+  };
+
+  class DefaultValueHolderFactory : public ValueHolderFactory {
+   public:
+    DefaultValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+  };
+
+  class InstanceValueHolderFactory : public ValueHolderFactory {
+   public:
+    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+    virtual ValueHolder* MakeNewHolder() const {
+      return new ValueHolder(value_);
+    }
+
+   private:
+    const T value_;  // The value for each thread.
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+  };
+
+  // A key pthreads uses for looking up per-thread values.
+  const pthread_key_t key_;
+  scoped_ptr<ValueHolderFactory> default_factory_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
+};
+
+# endif  // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+
+#else  // GTEST_IS_THREADSAFE
+
+// A dummy implementation of synchronization primitives (mutex, lock,
+// and thread-local variable).  Necessary for compiling Google Test where
+// mutex is not supported - using Google Test in multiple threads is not
+// supported on such platforms.
+
+class Mutex {
+ public:
+  Mutex() {}
+  void Lock() {}
+  void Unlock() {}
+  void AssertHeld() const {}
+};
+
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+  extern ::testing::internal::Mutex mutex
+
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(Mutex*) {}  // NOLINT
+};
+
+typedef GTestMutexLock MutexLock;
+
+template <typename T>
+class ThreadLocal {
+ public:
+  ThreadLocal() : value_() {}
+  explicit ThreadLocal(const T& value) : value_(value) {}
+  T* pointer() { return &value_; }
+  const T* pointer() const { return &value_; }
+  const T& get() const { return value_; }
+  void set(const T& value) { value_ = value; }
+ private:
+  T value_;
+};
+
+#endif  // GTEST_IS_THREADSAFE
+
+// Returns the number of threads running in the process, or 0 to indicate that
+// we cannot detect it.
+GTEST_API_ size_t GetThreadCount();
+
+// Passing non-POD classes through ellipsis (...) crashes the ARM
+// compiler and generates a warning in Sun Studio.  The Nokia Symbian
+// and the IBM XL C/C++ compiler try to instantiate a copy constructor
+// for objects passed through ellipsis (...), failing for uncopyable
+// objects.  We define this to ensure that only POD is passed through
+// ellipsis on these systems.
+#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
+// We lose support for NULL detection where the compiler doesn't like
+// passing non-POD classes through ellipsis (...).
+# define GTEST_ELLIPSIS_NEEDS_POD_ 1
+#else
+# define GTEST_CAN_COMPARE_NULL 1
+#endif
+
+// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
+// const T& and const T* in a function template.  These compilers
+// _can_ decide between class template specializations for T and T*,
+// so a tr1::type_traits-like is_pointer works.
+#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
+# define GTEST_NEEDS_IS_POINTER_ 1
+#endif
+
+template <bool bool_value>
+struct bool_constant {
+  typedef bool_constant<bool_value> type;
+  static const bool value = bool_value;
+};
+template <bool bool_value> const bool bool_constant<bool_value>::value;
+
+typedef bool_constant<false> false_type;
+typedef bool_constant<true> true_type;
+
+template <typename T>
+struct is_pointer : public false_type {};
+
+template <typename T>
+struct is_pointer<T*> : public true_type {};
+
+template <typename Iterator>
+struct IteratorTraits {
+  typedef typename Iterator::value_type value_type;
+};
+
+template <typename T>
+struct IteratorTraits<T*> {
+  typedef T value_type;
+};
+
+template <typename T>
+struct IteratorTraits<const T*> {
+  typedef T value_type;
+};
+
+#if GTEST_OS_WINDOWS
+# define GTEST_PATH_SEP_ "\\"
+# define GTEST_HAS_ALT_PATH_SEP_ 1
+// The biggest signed integer type the compiler supports.
+typedef __int64 BiggestInt;
+#else
+# define GTEST_PATH_SEP_ "/"
+# define GTEST_HAS_ALT_PATH_SEP_ 0
+typedef long long BiggestInt;  // NOLINT
+#endif  // GTEST_OS_WINDOWS
+
+// Utilities for char.
+
+// isspace(int ch) and friends accept an unsigned char or EOF.  char
+// may be signed, depending on the compiler (or compiler flags).
+// Therefore we need to cast a char to unsigned char before calling
+// isspace(), etc.
+
+inline bool IsAlpha(char ch) {
+  return isalpha(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsAlNum(char ch) {
+  return isalnum(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsDigit(char ch) {
+  return isdigit(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsLower(char ch) {
+  return islower(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsSpace(char ch) {
+  return isspace(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsUpper(char ch) {
+  return isupper(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsXDigit(char ch) {
+  return isxdigit(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsXDigit(wchar_t ch) {
+  const unsigned char low_byte = static_cast<unsigned char>(ch);
+  return ch == low_byte && isxdigit(low_byte) != 0;
+}
+
+inline char ToLower(char ch) {
+  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
+}
+inline char ToUpper(char ch) {
+  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
+}
+
+inline std::string StripTrailingSpaces(std::string str) {
+  std::string::iterator it = str.end();
+  while (it != str.begin() && IsSpace(*--it))
+    it = str.erase(it);
+  return str;
+}
+
+// The testing::internal::posix namespace holds wrappers for common
+// POSIX functions.  These wrappers hide the differences between
+// Windows/MSVC and POSIX systems.  Since some compilers define these
+// standard functions as macros, the wrapper cannot have the same name
+// as the wrapped function.
+
+namespace posix {
+
+// Functions with a different name on Windows.
+
+#if GTEST_OS_WINDOWS
+
+typedef struct _stat StatStruct;
+
+# ifdef __BORLANDC__
+inline int IsATTY(int fd) { return isatty(fd); }
+inline int StrCaseCmp(const char* s1, const char* s2) {
+  return stricmp(s1, s2);
+}
+inline char* StrDup(const char* src) { return strdup(src); }
+# else  // !__BORLANDC__
+#  if GTEST_OS_WINDOWS_MOBILE
+inline int IsATTY(int /* fd */) { return 0; }
+#  else
+inline int IsATTY(int fd) { return _isatty(fd); }
+#  endif  // GTEST_OS_WINDOWS_MOBILE
+inline int StrCaseCmp(const char* s1, const char* s2) {
+  return _stricmp(s1, s2);
+}
+inline char* StrDup(const char* src) { return _strdup(src); }
+# endif  // __BORLANDC__
+
+# if GTEST_OS_WINDOWS_MOBILE
+inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
+// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
+// time and thus not defined there.
+# else
+inline int FileNo(FILE* file) { return _fileno(file); }
+inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
+inline int RmDir(const char* dir) { return _rmdir(dir); }
+inline bool IsDir(const StatStruct& st) {
+  return (_S_IFDIR & st.st_mode) != 0;
+}
+# endif  // GTEST_OS_WINDOWS_MOBILE
+
+#else
+
+typedef struct stat StatStruct;
+
+inline int FileNo(FILE* file) { return fileno(file); }
+inline int IsATTY(int fd) { return isatty(fd); }
+inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
+inline int StrCaseCmp(const char* s1, const char* s2) {
+  return strcasecmp(s1, s2);
+}
+inline char* StrDup(const char* src) { return strdup(src); }
+inline int RmDir(const char* dir) { return rmdir(dir); }
+inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
+
+#endif  // GTEST_OS_WINDOWS
+
+// Functions deprecated by MSVC 8.0.
+
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
+
+inline const char* StrNCpy(char* dest, const char* src, size_t n) {
+  return strncpy(dest, src, n);
+}
+
+// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
+// StrError() aren't needed on Windows CE at this time and thus not
+// defined there.
+
+#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+inline int ChDir(const char* dir) { return chdir(dir); }
+#endif
+inline FILE* FOpen(const char* path, const char* mode) {
+  return fopen(path, mode);
+}
+#if !GTEST_OS_WINDOWS_MOBILE
+inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
+  return freopen(path, mode, stream);
+}
+inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
+#endif
+inline int FClose(FILE* fp) { return fclose(fp); }
+#if !GTEST_OS_WINDOWS_MOBILE
+inline int Read(int fd, void* buf, unsigned int count) {
+  return static_cast<int>(read(fd, buf, count));
+}
+inline int Write(int fd, const void* buf, unsigned int count) {
+  return static_cast<int>(write(fd, buf, count));
+}
+inline int Close(int fd) { return close(fd); }
+inline const char* StrError(int errnum) { return strerror(errnum); }
+#endif
+inline const char* GetEnv(const char* name) {
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
+  // We are on Windows CE, which has no environment variables.
+  static_cast<void>(name);  // To prevent 'unused argument' warning.
+  return NULL;
+#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
+  // Environment variables which we programmatically clear will be set to the
+  // empty string rather than unset (NULL).  Handle that case.
+  const char* const env = getenv(name);
+  return (env != NULL && env[0] != '\0') ? env : NULL;
+#else
+  return getenv(name);
+#endif
+}
+
+GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+#if GTEST_OS_WINDOWS_MOBILE
+// Windows CE has no C library. The abort() function is used in
+// several places in Google Test. This implementation provides a reasonable
+// imitation of standard behaviour.
+void Abort();
+#else
+inline void Abort() { abort(); }
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+}  // namespace posix
+
+// MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
+// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
+// MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
+// function in order to achieve that.  We use macro definition here because
+// snprintf is a variadic function.
+#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
+// MSVC 2005 and above support variadic macros.
+# define GTEST_SNPRINTF_(buffer, size, format, ...) \
+     _snprintf_s(buffer, size, size, format, __VA_ARGS__)
+#elif defined(_MSC_VER)
+// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
+// complain about _snprintf.
+# define GTEST_SNPRINTF_ _snprintf
+#else
+# define GTEST_SNPRINTF_ snprintf
+#endif
+
+// The maximum number a BiggestInt can represent.  This definition
+// works no matter BiggestInt is represented in one's complement or
+// two's complement.
+//
+// We cannot rely on numeric_limits in STL, as __int64 and long long
+// are not part of standard C++ and numeric_limits doesn't need to be
+// defined for them.
+const BiggestInt kMaxBiggestInt =
+    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
+
+// This template class serves as a compile-time function from size to
+// type.  It maps a size in bytes to a primitive type with that
+// size. e.g.
+//
+//   TypeWithSize<4>::UInt
+//
+// is typedef-ed to be unsigned int (unsigned integer made up of 4
+// bytes).
+//
+// Such functionality should belong to STL, but I cannot find it
+// there.
+//
+// Google Test uses this class in the implementation of floating-point
+// comparison.
+//
+// For now it only handles UInt (unsigned int) as that's all Google Test
+// needs.  Other types can be easily added in the future if need
+// arises.
+template <size_t size>
+class TypeWithSize {
+ public:
+  // This prevents the user from using TypeWithSize<N> with incorrect
+  // values of N.
+  typedef void UInt;
+};
+
+// The specialization for size 4.
+template <>
+class TypeWithSize<4> {
+ public:
+  // unsigned int has size 4 in both gcc and MSVC.
+  //
+  // As base/basictypes.h doesn't compile on Windows, we cannot use
+  // uint32, uint64, and etc here.
+  typedef int Int;
+  typedef unsigned int UInt;
+};
+
+// The specialization for size 8.
+template <>
+class TypeWithSize<8> {
+ public:
+#if GTEST_OS_WINDOWS
+  typedef __int64 Int;
+  typedef unsigned __int64 UInt;
+#else
+  typedef long long Int;  // NOLINT
+  typedef unsigned long long UInt;  // NOLINT
+#endif  // GTEST_OS_WINDOWS
+};
+
+// Integer types of known sizes.
+typedef TypeWithSize<4>::Int Int32;
+typedef TypeWithSize<4>::UInt UInt32;
+typedef TypeWithSize<8>::Int Int64;
+typedef TypeWithSize<8>::UInt UInt64;
+typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
+
+// Utilities for command line flags and environment variables.
+
+// Macro for referencing flags.
+#if !defined(GTEST_FLAG)
+# define GTEST_FLAG(name) FLAGS_gtest_##name
+#endif  // !defined(GTEST_FLAG)
+
+#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
+#endif  // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+
+#if !defined(GTEST_DECLARE_bool_)
+# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
+
+// Macros for declaring flags.
+# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
+# define GTEST_DECLARE_int32_(name) \
+    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
+#define GTEST_DECLARE_string_(name) \
+    GTEST_API_ extern ::std::string GTEST_FLAG(name)
+
+// Macros for defining flags.
+#define GTEST_DEFINE_bool_(name, default_val, doc) \
+    GTEST_API_ bool GTEST_FLAG(name) = (default_val)
+#define GTEST_DEFINE_int32_(name, default_val, doc) \
+    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
+#define GTEST_DEFINE_string_(name, default_val, doc) \
+    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
+
+#endif  // !defined(GTEST_DECLARE_bool_)
+
+// Thread annotations
+#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
+# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+# define GTEST_LOCK_EXCLUDED_(locks)
+#endif  // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
+
+// Parses 'str' for a 32-bit signed integer.  If successful, writes the result
+// to *value and returns true; otherwise leaves *value unchanged and returns
+// false.
+// TODO(chandlerc): Find a better way to refactor flag and environment parsing
+// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
+// function.
+bool ParseInt32(const Message& src_text, const char* str, Int32* value);
+
+// Parses a bool/Int32/string from the environment variable
+// corresponding to the given Google Test flag.
+bool BoolFromGTestEnv(const char* flag, bool default_val);
+GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
+std::string StringFromGTestEnv(const char* flag, const char* default_val);
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-string.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-string.h
new file mode 100644
index 0000000..97f1a7f
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-string.h
@@ -0,0 +1,167 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file declares the String class and functions used internally by
+// Google Test.  They are subject to change without notice. They should not used
+// by code external to Google Test.
+//
+// This header file is #included by <gtest/internal/gtest-internal.h>.
+// It should not be #included by other files.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
+
+#ifdef __BORLANDC__
+// string.h is not guaranteed to provide strcpy on C++ Builder.
+# include <mem.h>
+#endif
+
+#include <string.h>
+#include <string>
+
+#include "gtest/internal/gtest-port.h"
+
+namespace testing {
+namespace internal {
+
+// String - an abstract class holding static string utilities.
+class GTEST_API_ String {
+ public:
+  // Static utility methods
+
+  // Clones a 0-terminated C string, allocating memory using new.  The
+  // caller is responsible for deleting the return value using
+  // delete[].  Returns the cloned string, or NULL if the input is
+  // NULL.
+  //
+  // This is different from strdup() in string.h, which allocates
+  // memory using malloc().
+  static const char* CloneCString(const char* c_str);
+
+#if GTEST_OS_WINDOWS_MOBILE
+  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
+  // able to pass strings to Win32 APIs on CE we need to convert them
+  // to 'Unicode', UTF-16.
+
+  // Creates a UTF-16 wide string from the given ANSI string, allocating
+  // memory using new. The caller is responsible for deleting the return
+  // value using delete[]. Returns the wide string, or NULL if the
+  // input is NULL.
+  //
+  // The wide string is created using the ANSI codepage (CP_ACP) to
+  // match the behaviour of the ANSI versions of Win32 calls and the
+  // C runtime.
+  static LPCWSTR AnsiToUtf16(const char* c_str);
+
+  // Creates an ANSI string from the given wide string, allocating
+  // memory using new. The caller is responsible for deleting the return
+  // value using delete[]. Returns the ANSI string, or NULL if the
+  // input is NULL.
+  //
+  // The returned string is created using the ANSI codepage (CP_ACP) to
+  // match the behaviour of the ANSI versions of Win32 calls and the
+  // C runtime.
+  static const char* Utf16ToAnsi(LPCWSTR utf16_str);
+#endif
+
+  // Compares two C strings.  Returns true iff they have the same content.
+  //
+  // Unlike strcmp(), this function can handle NULL argument(s).  A
+  // NULL C string is considered different to any non-NULL C string,
+  // including the empty string.
+  static bool CStringEquals(const char* lhs, const char* rhs);
+
+  // Converts a wide C string to a String using the UTF-8 encoding.
+  // NULL will be converted to "(null)".  If an error occurred during
+  // the conversion, "(failed to convert from wide string)" is
+  // returned.
+  static std::string ShowWideCString(const wchar_t* wide_c_str);
+
+  // Compares two wide C strings.  Returns true iff they have the same
+  // content.
+  //
+  // Unlike wcscmp(), this function can handle NULL argument(s).  A
+  // NULL C string is considered different to any non-NULL C string,
+  // including the empty string.
+  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
+
+  // Compares two C strings, ignoring case.  Returns true iff they
+  // have the same content.
+  //
+  // Unlike strcasecmp(), this function can handle NULL argument(s).
+  // A NULL C string is considered different to any non-NULL C string,
+  // including the empty string.
+  static bool CaseInsensitiveCStringEquals(const char* lhs,
+                                           const char* rhs);
+
+  // Compares two wide C strings, ignoring case.  Returns true iff they
+  // have the same content.
+  //
+  // Unlike wcscasecmp(), this function can handle NULL argument(s).
+  // A NULL C string is considered different to any non-NULL wide C string,
+  // including the empty string.
+  // NB: The implementations on different platforms slightly differ.
+  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
+  // environment variable. On GNU platform this method uses wcscasecmp
+  // which compares according to LC_CTYPE category of the current locale.
+  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
+  // current locale.
+  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
+                                               const wchar_t* rhs);
+
+  // Returns true iff the given string ends with the given suffix, ignoring
+  // case. Any string is considered to end with an empty suffix.
+  static bool EndsWithCaseInsensitive(
+      const std::string& str, const std::string& suffix);
+
+  // Formats an int value as "%02d".
+  static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
+
+  // Formats an int value as "%X".
+  static std::string FormatHexInt(int value);
+
+  // Formats a byte as "%02X".
+  static std::string FormatByte(unsigned char value);
+
+ private:
+  String();  // Not meant to be instantiated.
+};  // class String
+
+// Gets the content of the stringstream's buffer as an std::string.  Each '\0'
+// character in the buffer is replaced with "\\0".
+GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h
new file mode 100644
index 0000000..e9b4053
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h
@@ -0,0 +1,1020 @@
+// This file was GENERATED by command:
+//     pump.py gtest-tuple.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// Copyright 2009 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)
+
+// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+
+#include <utility>  // For ::std::pair.
+
+// The compiler used in Symbian has a bug that prevents us from declaring the
+// tuple template as a friend (it complains that tuple is redefined).  This
+// hack bypasses the bug by declaring the members that should otherwise be
+// private as public.
+// Sun Studio versions < 12 also have the above bug.
+#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
+#else
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
+    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
+   private:
+#endif
+
+// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
+// with our own definitions. Therefore using our own tuple does not work on
+// those compilers.
+#if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */
+# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
+GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
+#endif
+
+// GTEST_n_TUPLE_(T) is the type of an n-tuple.
+#define GTEST_0_TUPLE_(T) tuple<>
+#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
+    void, void, void>
+#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
+    void, void, void>
+#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
+    void, void, void>
+#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
+    void, void, void>
+#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
+    void, void, void>
+#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
+    void, void, void>
+#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    void, void, void>
+#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    T##7, void, void>
+#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    T##7, T##8, void>
+#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    T##7, T##8, T##9>
+
+// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
+#define GTEST_0_TYPENAMES_(T)
+#define GTEST_1_TYPENAMES_(T) typename T##0
+#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
+#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
+#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3
+#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4
+#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5
+#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6
+#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
+#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6, \
+    typename T##7, typename T##8
+#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6, \
+    typename T##7, typename T##8, typename T##9
+
+// In theory, defining stuff in the ::std namespace is undefined
+// behavior.  We can do this as we are playing the role of a standard
+// library vendor.
+namespace std {
+namespace tr1 {
+
+template <typename T0 = void, typename T1 = void, typename T2 = void,
+    typename T3 = void, typename T4 = void, typename T5 = void,
+    typename T6 = void, typename T7 = void, typename T8 = void,
+    typename T9 = void>
+class tuple;
+
+// Anything in namespace gtest_internal is Google Test's INTERNAL
+// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
+namespace gtest_internal {
+
+// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
+template <typename T>
+struct ByRef { typedef const T& type; };  // NOLINT
+template <typename T>
+struct ByRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for ByRef.
+#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
+
+// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
+// is the same as tr1::add_reference<T>::type.
+template <typename T>
+struct AddRef { typedef T& type; };  // NOLINT
+template <typename T>
+struct AddRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for AddRef.
+#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
+
+// A helper for implementing get<k>().
+template <int k> class Get;
+
+// A helper for implementing tuple_element<k, T>.  kIndexValid is true
+// iff k < the number of fields in tuple type T.
+template <bool kIndexValid, int kIndex, class Tuple>
+struct TupleElement;
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
+  typedef T0 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
+  typedef T1 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
+  typedef T2 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
+  typedef T3 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
+  typedef T4 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
+  typedef T5 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
+  typedef T6 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
+  typedef T7 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
+  typedef T8 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
+  typedef T9 type;
+};
+
+}  // namespace gtest_internal
+
+template <>
+class tuple<> {
+ public:
+  tuple() {}
+  tuple(const tuple& /* t */)  {}
+  tuple& operator=(const tuple& /* t */) { return *this; }
+};
+
+template <GTEST_1_TYPENAMES_(T)>
+class GTEST_1_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
+
+  tuple(const tuple& t) : f0_(t.f0_) {}
+
+  template <GTEST_1_TYPENAMES_(U)>
+  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_1_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_1_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    return *this;
+  }
+
+  T0 f0_;
+};
+
+template <GTEST_2_TYPENAMES_(T)>
+class GTEST_2_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
+      f1_(f1) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
+
+  template <GTEST_2_TYPENAMES_(U)>
+  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
+  template <typename U0, typename U1>
+  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_2_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+  template <typename U0, typename U1>
+  tuple& operator=(const ::std::pair<U0, U1>& p) {
+    f0_ = p.first;
+    f1_ = p.second;
+    return *this;
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_2_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+};
+
+template <GTEST_3_TYPENAMES_(T)>
+class GTEST_3_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
+
+  template <GTEST_3_TYPENAMES_(U)>
+  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_3_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_3_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+};
+
+template <GTEST_4_TYPENAMES_(T)>
+class GTEST_4_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
+      f3_(f3) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
+
+  template <GTEST_4_TYPENAMES_(U)>
+  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_4_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_4_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+};
+
+template <GTEST_5_TYPENAMES_(T)>
+class GTEST_5_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
+      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_) {}
+
+  template <GTEST_5_TYPENAMES_(U)>
+  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_5_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_5_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+};
+
+template <GTEST_6_TYPENAMES_(T)>
+class GTEST_6_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
+      f5_(f5) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_) {}
+
+  template <GTEST_6_TYPENAMES_(U)>
+  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_6_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_6_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+};
+
+template <GTEST_7_TYPENAMES_(T)>
+class GTEST_7_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
+      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
+
+  template <GTEST_7_TYPENAMES_(U)>
+  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_7_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_7_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+};
+
+template <GTEST_8_TYPENAMES_(T)>
+class GTEST_8_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
+      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
+      f5_(f5), f6_(f6), f7_(f7) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
+
+  template <GTEST_8_TYPENAMES_(U)>
+  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_8_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_8_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    f7_ = t.f7_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+  T7 f7_;
+};
+
+template <GTEST_9_TYPENAMES_(T)>
+class GTEST_9_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
+      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
+      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
+
+  template <GTEST_9_TYPENAMES_(U)>
+  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_9_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_9_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    f7_ = t.f7_;
+    f8_ = t.f8_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+  T7 f7_;
+  T8 f8_;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+class tuple {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
+      f9_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
+      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
+      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
+
+  template <GTEST_10_TYPENAMES_(U)>
+  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
+      f9_(t.f9_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_10_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_10_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    f7_ = t.f7_;
+    f8_ = t.f8_;
+    f9_ = t.f9_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+  T7 f7_;
+  T8 f8_;
+  T9 f9_;
+};
+
+// 6.1.3.2 Tuple creation functions.
+
+// Known limitations: we don't support passing an
+// std::tr1::reference_wrapper<T> to make_tuple().  And we don't
+// implement tie().
+
+inline tuple<> make_tuple() { return tuple<>(); }
+
+template <GTEST_1_TYPENAMES_(T)>
+inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
+  return GTEST_1_TUPLE_(T)(f0);
+}
+
+template <GTEST_2_TYPENAMES_(T)>
+inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
+  return GTEST_2_TUPLE_(T)(f0, f1);
+}
+
+template <GTEST_3_TYPENAMES_(T)>
+inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
+  return GTEST_3_TUPLE_(T)(f0, f1, f2);
+}
+
+template <GTEST_4_TYPENAMES_(T)>
+inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3) {
+  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
+}
+
+template <GTEST_5_TYPENAMES_(T)>
+inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4) {
+  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
+}
+
+template <GTEST_6_TYPENAMES_(T)>
+inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5) {
+  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
+}
+
+template <GTEST_7_TYPENAMES_(T)>
+inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
+  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
+}
+
+template <GTEST_8_TYPENAMES_(T)>
+inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
+  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
+}
+
+template <GTEST_9_TYPENAMES_(T)>
+inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
+    const T8& f8) {
+  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
+}
+
+template <GTEST_10_TYPENAMES_(T)>
+inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
+    const T8& f8, const T9& f9) {
+  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
+}
+
+// 6.1.3.3 Tuple helper classes.
+
+template <typename Tuple> struct tuple_size;
+
+template <GTEST_0_TYPENAMES_(T)>
+struct tuple_size<GTEST_0_TUPLE_(T) > {
+  static const int value = 0;
+};
+
+template <GTEST_1_TYPENAMES_(T)>
+struct tuple_size<GTEST_1_TUPLE_(T) > {
+  static const int value = 1;
+};
+
+template <GTEST_2_TYPENAMES_(T)>
+struct tuple_size<GTEST_2_TUPLE_(T) > {
+  static const int value = 2;
+};
+
+template <GTEST_3_TYPENAMES_(T)>
+struct tuple_size<GTEST_3_TUPLE_(T) > {
+  static const int value = 3;
+};
+
+template <GTEST_4_TYPENAMES_(T)>
+struct tuple_size<GTEST_4_TUPLE_(T) > {
+  static const int value = 4;
+};
+
+template <GTEST_5_TYPENAMES_(T)>
+struct tuple_size<GTEST_5_TUPLE_(T) > {
+  static const int value = 5;
+};
+
+template <GTEST_6_TYPENAMES_(T)>
+struct tuple_size<GTEST_6_TUPLE_(T) > {
+  static const int value = 6;
+};
+
+template <GTEST_7_TYPENAMES_(T)>
+struct tuple_size<GTEST_7_TUPLE_(T) > {
+  static const int value = 7;
+};
+
+template <GTEST_8_TYPENAMES_(T)>
+struct tuple_size<GTEST_8_TUPLE_(T) > {
+  static const int value = 8;
+};
+
+template <GTEST_9_TYPENAMES_(T)>
+struct tuple_size<GTEST_9_TUPLE_(T) > {
+  static const int value = 9;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct tuple_size<GTEST_10_TUPLE_(T) > {
+  static const int value = 10;
+};
+
+template <int k, class Tuple>
+struct tuple_element {
+  typedef typename gtest_internal::TupleElement<
+      k < (tuple_size<Tuple>::value), k, Tuple>::type type;
+};
+
+#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
+
+// 6.1.3.4 Element access.
+
+namespace gtest_internal {
+
+template <>
+class Get<0> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
+  Field(Tuple& t) { return t.f0_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
+  ConstField(const Tuple& t) { return t.f0_; }
+};
+
+template <>
+class Get<1> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
+  Field(Tuple& t) { return t.f1_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
+  ConstField(const Tuple& t) { return t.f1_; }
+};
+
+template <>
+class Get<2> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
+  Field(Tuple& t) { return t.f2_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
+  ConstField(const Tuple& t) { return t.f2_; }
+};
+
+template <>
+class Get<3> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
+  Field(Tuple& t) { return t.f3_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
+  ConstField(const Tuple& t) { return t.f3_; }
+};
+
+template <>
+class Get<4> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
+  Field(Tuple& t) { return t.f4_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
+  ConstField(const Tuple& t) { return t.f4_; }
+};
+
+template <>
+class Get<5> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
+  Field(Tuple& t) { return t.f5_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
+  ConstField(const Tuple& t) { return t.f5_; }
+};
+
+template <>
+class Get<6> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
+  Field(Tuple& t) { return t.f6_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
+  ConstField(const Tuple& t) { return t.f6_; }
+};
+
+template <>
+class Get<7> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
+  Field(Tuple& t) { return t.f7_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
+  ConstField(const Tuple& t) { return t.f7_; }
+};
+
+template <>
+class Get<8> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
+  Field(Tuple& t) { return t.f8_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
+  ConstField(const Tuple& t) { return t.f8_; }
+};
+
+template <>
+class Get<9> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
+  Field(Tuple& t) { return t.f9_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
+  ConstField(const Tuple& t) { return t.f9_; }
+};
+
+}  // namespace gtest_internal
+
+template <int k, GTEST_10_TYPENAMES_(T)>
+GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
+get(GTEST_10_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::Field(t);
+}
+
+template <int k, GTEST_10_TYPENAMES_(T)>
+GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
+get(const GTEST_10_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::ConstField(t);
+}
+
+// 6.1.3.5 Relational operators
+
+// We only implement == and !=, as we don't have a need for the rest yet.
+
+namespace gtest_internal {
+
+// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
+// first k fields of t1 equals the first k fields of t2.
+// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
+// k1 != k2.
+template <int kSize1, int kSize2>
+struct SameSizeTuplePrefixComparator;
+
+template <>
+struct SameSizeTuplePrefixComparator<0, 0> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
+    return true;
+  }
+};
+
+template <int k>
+struct SameSizeTuplePrefixComparator<k, k> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& t1, const Tuple2& t2) {
+    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
+        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
+  }
+};
+
+}  // namespace gtest_internal
+
+template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
+inline bool operator==(const GTEST_10_TUPLE_(T)& t,
+                       const GTEST_10_TUPLE_(U)& u) {
+  return gtest_internal::SameSizeTuplePrefixComparator<
+      tuple_size<GTEST_10_TUPLE_(T) >::value,
+      tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
+}
+
+template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
+inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
+                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
+
+// 6.1.4 Pairs.
+// Unimplemented.
+
+}  // namespace tr1
+}  // namespace std
+
+#undef GTEST_0_TUPLE_
+#undef GTEST_1_TUPLE_
+#undef GTEST_2_TUPLE_
+#undef GTEST_3_TUPLE_
+#undef GTEST_4_TUPLE_
+#undef GTEST_5_TUPLE_
+#undef GTEST_6_TUPLE_
+#undef GTEST_7_TUPLE_
+#undef GTEST_8_TUPLE_
+#undef GTEST_9_TUPLE_
+#undef GTEST_10_TUPLE_
+
+#undef GTEST_0_TYPENAMES_
+#undef GTEST_1_TYPENAMES_
+#undef GTEST_2_TYPENAMES_
+#undef GTEST_3_TYPENAMES_
+#undef GTEST_4_TYPENAMES_
+#undef GTEST_5_TYPENAMES_
+#undef GTEST_6_TYPENAMES_
+#undef GTEST_7_TYPENAMES_
+#undef GTEST_8_TYPENAMES_
+#undef GTEST_9_TYPENAMES_
+#undef GTEST_10_TYPENAMES_
+
+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
+#undef GTEST_BY_REF_
+#undef GTEST_ADD_REF_
+#undef GTEST_TUPLE_ELEMENT_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump
new file mode 100644
index 0000000..429ddfe
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump
@@ -0,0 +1,347 @@
+$$ -*- mode: c++; -*-
+$var n = 10  $$ Maximum number of tuple fields we want to support.
+$$ This meta comment fixes auto-indentation in Emacs. }}
+// Copyright 2009 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)
+
+// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+
+#include <utility>  // For ::std::pair.
+
+// The compiler used in Symbian has a bug that prevents us from declaring the
+// tuple template as a friend (it complains that tuple is redefined).  This
+// hack bypasses the bug by declaring the members that should otherwise be
+// private as public.
+// Sun Studio versions < 12 also have the above bug.
+#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
+#else
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
+    template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple; \
+   private:
+#endif
+
+// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
+// with our own definitions. Therefore using our own tuple does not work on
+// those compilers.
+#if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */
+# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
+GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
+#endif
+
+
+$range i 0..n-1
+$range j 0..n
+$range k 1..n
+// GTEST_n_TUPLE_(T) is the type of an n-tuple.
+#define GTEST_0_TUPLE_(T) tuple<>
+
+$for k [[
+$range m 0..k-1
+$range m2 k..n-1
+#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]>
+
+]]
+
+// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
+
+$for j [[
+$range m 0..j-1
+#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]]
+
+
+]]
+
+// In theory, defining stuff in the ::std namespace is undefined
+// behavior.  We can do this as we are playing the role of a standard
+// library vendor.
+namespace std {
+namespace tr1 {
+
+template <$for i, [[typename T$i = void]]>
+class tuple;
+
+// Anything in namespace gtest_internal is Google Test's INTERNAL
+// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
+namespace gtest_internal {
+
+// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
+template <typename T>
+struct ByRef { typedef const T& type; };  // NOLINT
+template <typename T>
+struct ByRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for ByRef.
+#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
+
+// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
+// is the same as tr1::add_reference<T>::type.
+template <typename T>
+struct AddRef { typedef T& type; };  // NOLINT
+template <typename T>
+struct AddRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for AddRef.
+#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
+
+// A helper for implementing get<k>().
+template <int k> class Get;
+
+// A helper for implementing tuple_element<k, T>.  kIndexValid is true
+// iff k < the number of fields in tuple type T.
+template <bool kIndexValid, int kIndex, class Tuple>
+struct TupleElement;
+
+
+$for i [[
+template <GTEST_$(n)_TYPENAMES_(T)>
+struct TupleElement<true, $i, GTEST_$(n)_TUPLE_(T) > {
+  typedef T$i type;
+};
+
+
+]]
+}  // namespace gtest_internal
+
+template <>
+class tuple<> {
+ public:
+  tuple() {}
+  tuple(const tuple& /* t */)  {}
+  tuple& operator=(const tuple& /* t */) { return *this; }
+};
+
+
+$for k [[
+$range m 0..k-1
+template <GTEST_$(k)_TYPENAMES_(T)>
+class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : $for m, [[f$(m)_()]] {}
+
+  explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]]
+$for m, [[f$(m)_(f$m)]] {}
+
+  tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
+
+  template <GTEST_$(k)_TYPENAMES_(U)>
+  tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
+
+$if k == 2 [[
+  template <typename U0, typename U1>
+  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
+
+]]
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_$(k)_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+$if k == 2 [[
+  template <typename U0, typename U1>
+  tuple& operator=(const ::std::pair<U0, U1>& p) {
+    f0_ = p.first;
+    f1_ = p.second;
+    return *this;
+  }
+
+]]
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_$(k)_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) {
+
+$for m [[
+    f$(m)_ = t.f$(m)_;
+
+]]
+    return *this;
+  }
+
+
+$for m [[
+  T$m f$(m)_;
+
+]]
+};
+
+
+]]
+// 6.1.3.2 Tuple creation functions.
+
+// Known limitations: we don't support passing an
+// std::tr1::reference_wrapper<T> to make_tuple().  And we don't
+// implement tie().
+
+inline tuple<> make_tuple() { return tuple<>(); }
+
+$for k [[
+$range m 0..k-1
+
+template <GTEST_$(k)_TYPENAMES_(T)>
+inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) {
+  return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]);
+}
+
+]]
+
+// 6.1.3.3 Tuple helper classes.
+
+template <typename Tuple> struct tuple_size;
+
+
+$for j [[
+template <GTEST_$(j)_TYPENAMES_(T)>
+struct tuple_size<GTEST_$(j)_TUPLE_(T) > {
+  static const int value = $j;
+};
+
+
+]]
+template <int k, class Tuple>
+struct tuple_element {
+  typedef typename gtest_internal::TupleElement<
+      k < (tuple_size<Tuple>::value), k, Tuple>::type type;
+};
+
+#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
+
+// 6.1.3.4 Element access.
+
+namespace gtest_internal {
+
+
+$for i [[
+template <>
+class Get<$i> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
+  Field(Tuple& t) { return t.f$(i)_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
+  ConstField(const Tuple& t) { return t.f$(i)_; }
+};
+
+
+]]
+}  // namespace gtest_internal
+
+template <int k, GTEST_$(n)_TYPENAMES_(T)>
+GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T)))
+get(GTEST_$(n)_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::Field(t);
+}
+
+template <int k, GTEST_$(n)_TYPENAMES_(T)>
+GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_$(n)_TUPLE_(T)))
+get(const GTEST_$(n)_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::ConstField(t);
+}
+
+// 6.1.3.5 Relational operators
+
+// We only implement == and !=, as we don't have a need for the rest yet.
+
+namespace gtest_internal {
+
+// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
+// first k fields of t1 equals the first k fields of t2.
+// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
+// k1 != k2.
+template <int kSize1, int kSize2>
+struct SameSizeTuplePrefixComparator;
+
+template <>
+struct SameSizeTuplePrefixComparator<0, 0> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
+    return true;
+  }
+};
+
+template <int k>
+struct SameSizeTuplePrefixComparator<k, k> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& t1, const Tuple2& t2) {
+    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
+        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
+  }
+};
+
+}  // namespace gtest_internal
+
+template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>
+inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t,
+                       const GTEST_$(n)_TUPLE_(U)& u) {
+  return gtest_internal::SameSizeTuplePrefixComparator<
+      tuple_size<GTEST_$(n)_TUPLE_(T) >::value,
+      tuple_size<GTEST_$(n)_TUPLE_(U) >::value>::Eq(t, u);
+}
+
+template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>
+inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t,
+                       const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); }
+
+// 6.1.4 Pairs.
+// Unimplemented.
+
+}  // namespace tr1
+}  // namespace std
+
+
+$for j [[
+#undef GTEST_$(j)_TUPLE_
+
+]]
+
+
+$for j [[
+#undef GTEST_$(j)_TYPENAMES_
+
+]]
+
+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
+#undef GTEST_BY_REF_
+#undef GTEST_ADD_REF_
+#undef GTEST_TUPLE_ELEMENT_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h
new file mode 100644
index 0000000..e46f7cf
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h
@@ -0,0 +1,3331 @@
+// This file was GENERATED by command:
+//     pump.py gtest-type-util.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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: wan@google.com (Zhanyong Wan)
+
+// Type utilities needed for implementing typed and type-parameterized
+// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently we support at most 50 types in a list, and at most 50
+// type-parameterized tests in one type-parameterized test case.
+// Please contact googletestframework@googlegroups.com if you need
+// more.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+
+#include "gtest/internal/gtest-port.h"
+
+// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
+// libstdc++ (which is where cxxabi.h comes from).
+# if GTEST_HAS_CXXABI_H_
+#  include <cxxabi.h>
+# elif defined(__HP_aCC)
+#  include <acxx_demangle.h>
+# endif  // GTEST_HASH_CXXABI_H_
+
+namespace testing {
+namespace internal {
+
+// GetTypeName<T>() returns a human-readable name of type T.
+// NB: This function is also used in Google Mock, so don't move it inside of
+// the typed-test-only section below.
+template <typename T>
+std::string GetTypeName() {
+# if GTEST_HAS_RTTI
+
+  const char* const name = typeid(T).name();
+#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
+  int status = 0;
+  // gcc's implementation of typeid(T).name() mangles the type name,
+  // so we have to demangle it.
+#   if GTEST_HAS_CXXABI_H_
+  using abi::__cxa_demangle;
+#   endif  // GTEST_HAS_CXXABI_H_
+  char* const readable_name = __cxa_demangle(name, 0, 0, &status);
+  const std::string name_str(status == 0 ? readable_name : name);
+  free(readable_name);
+  return name_str;
+#  else
+  return name;
+#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
+
+# else
+
+  return "<type>";
+
+# endif  // GTEST_HAS_RTTI
+}
+
+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
+// type.  This can be used as a compile-time assertion to ensure that
+// two types are equal.
+
+template <typename T1, typename T2>
+struct AssertTypeEq;
+
+template <typename T>
+struct AssertTypeEq<T, T> {
+  typedef bool type;
+};
+
+// A unique type used as the default value for the arguments of class
+// template Types.  This allows us to simulate variadic templates
+// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
+// support directly.
+struct None {};
+
+// The following family of struct and struct templates are used to
+// represent type lists.  In particular, TypesN<T1, T2, ..., TN>
+// represents a type list with N types (T1, T2, ..., and TN) in it.
+// Except for Types0, every struct in the family has two member types:
+// Head for the first type in the list, and Tail for the rest of the
+// list.
+
+// The empty type list.
+struct Types0 {};
+
+// Type lists of length 1, 2, 3, and so on.
+
+template <typename T1>
+struct Types1 {
+  typedef T1 Head;
+  typedef Types0 Tail;
+};
+template <typename T1, typename T2>
+struct Types2 {
+  typedef T1 Head;
+  typedef Types1<T2> Tail;
+};
+
+template <typename T1, typename T2, typename T3>
+struct Types3 {
+  typedef T1 Head;
+  typedef Types2<T2, T3> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4>
+struct Types4 {
+  typedef T1 Head;
+  typedef Types3<T2, T3, T4> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+struct Types5 {
+  typedef T1 Head;
+  typedef Types4<T2, T3, T4, T5> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+struct Types6 {
+  typedef T1 Head;
+  typedef Types5<T2, T3, T4, T5, T6> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+struct Types7 {
+  typedef T1 Head;
+  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+struct Types8 {
+  typedef T1 Head;
+  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+struct Types9 {
+  typedef T1 Head;
+  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+struct Types10 {
+  typedef T1 Head;
+  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+struct Types11 {
+  typedef T1 Head;
+  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+struct Types12 {
+  typedef T1 Head;
+  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+struct Types13 {
+  typedef T1 Head;
+  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+struct Types14 {
+  typedef T1 Head;
+  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+struct Types15 {
+  typedef T1 Head;
+  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+struct Types16 {
+  typedef T1 Head;
+  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+struct Types17 {
+  typedef T1 Head;
+  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+struct Types18 {
+  typedef T1 Head;
+  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+struct Types19 {
+  typedef T1 Head;
+  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+struct Types20 {
+  typedef T1 Head;
+  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+struct Types21 {
+  typedef T1 Head;
+  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+struct Types22 {
+  typedef T1 Head;
+  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+struct Types23 {
+  typedef T1 Head;
+  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+struct Types24 {
+  typedef T1 Head;
+  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+struct Types25 {
+  typedef T1 Head;
+  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+struct Types26 {
+  typedef T1 Head;
+  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+struct Types27 {
+  typedef T1 Head;
+  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+struct Types28 {
+  typedef T1 Head;
+  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+struct Types29 {
+  typedef T1 Head;
+  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+struct Types30 {
+  typedef T1 Head;
+  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+struct Types31 {
+  typedef T1 Head;
+  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+struct Types32 {
+  typedef T1 Head;
+  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+struct Types33 {
+  typedef T1 Head;
+  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+struct Types34 {
+  typedef T1 Head;
+  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+struct Types35 {
+  typedef T1 Head;
+  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+struct Types36 {
+  typedef T1 Head;
+  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+struct Types37 {
+  typedef T1 Head;
+  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+struct Types38 {
+  typedef T1 Head;
+  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+struct Types39 {
+  typedef T1 Head;
+  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+struct Types40 {
+  typedef T1 Head;
+  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+struct Types41 {
+  typedef T1 Head;
+  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+struct Types42 {
+  typedef T1 Head;
+  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+struct Types43 {
+  typedef T1 Head;
+  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+struct Types44 {
+  typedef T1 Head;
+  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+struct Types45 {
+  typedef T1 Head;
+  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+struct Types46 {
+  typedef T1 Head;
+  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+struct Types47 {
+  typedef T1 Head;
+  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+struct Types48 {
+  typedef T1 Head;
+  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47, T48> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+struct Types49 {
+  typedef T1 Head;
+  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47, T48, T49> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+struct Types50 {
+  typedef T1 Head;
+  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47, T48, T49, T50> Tail;
+};
+
+
+}  // namespace internal
+
+// We don't want to require the users to write TypesN<...> directly,
+// as that would require them to count the length.  Types<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Types<int>
+// will appear as Types<int, None, None, ..., None> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Types<T1, ..., TN>, and Google Test will translate
+// that to TypesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Types template.
+template <typename T1 = internal::None, typename T2 = internal::None,
+    typename T3 = internal::None, typename T4 = internal::None,
+    typename T5 = internal::None, typename T6 = internal::None,
+    typename T7 = internal::None, typename T8 = internal::None,
+    typename T9 = internal::None, typename T10 = internal::None,
+    typename T11 = internal::None, typename T12 = internal::None,
+    typename T13 = internal::None, typename T14 = internal::None,
+    typename T15 = internal::None, typename T16 = internal::None,
+    typename T17 = internal::None, typename T18 = internal::None,
+    typename T19 = internal::None, typename T20 = internal::None,
+    typename T21 = internal::None, typename T22 = internal::None,
+    typename T23 = internal::None, typename T24 = internal::None,
+    typename T25 = internal::None, typename T26 = internal::None,
+    typename T27 = internal::None, typename T28 = internal::None,
+    typename T29 = internal::None, typename T30 = internal::None,
+    typename T31 = internal::None, typename T32 = internal::None,
+    typename T33 = internal::None, typename T34 = internal::None,
+    typename T35 = internal::None, typename T36 = internal::None,
+    typename T37 = internal::None, typename T38 = internal::None,
+    typename T39 = internal::None, typename T40 = internal::None,
+    typename T41 = internal::None, typename T42 = internal::None,
+    typename T43 = internal::None, typename T44 = internal::None,
+    typename T45 = internal::None, typename T46 = internal::None,
+    typename T47 = internal::None, typename T48 = internal::None,
+    typename T49 = internal::None, typename T50 = internal::None>
+struct Types {
+  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
+};
+
+template <>
+struct Types<internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types0 type;
+};
+template <typename T1>
+struct Types<T1, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types1<T1> type;
+};
+template <typename T1, typename T2>
+struct Types<T1, T2, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types2<T1, T2> type;
+};
+template <typename T1, typename T2, typename T3>
+struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types3<T1, T2, T3> type;
+};
+template <typename T1, typename T2, typename T3, typename T4>
+struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types4<T1, T2, T3, T4> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types5<T1, T2, T3, T4, T5> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, T47, internal::None, internal::None, internal::None> {
+  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, T47, T48, internal::None, internal::None> {
+  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, T47, T48, T49, internal::None> {
+  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
+};
+
+namespace internal {
+
+# define GTEST_TEMPLATE_ template <typename T> class
+
+// The template "selector" struct TemplateSel<Tmpl> is used to
+// represent Tmpl, which must be a class template with one type
+// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
+// as the type Tmpl<T>.  This allows us to actually instantiate the
+// template "selected" by TemplateSel<Tmpl>.
+//
+// This trick is necessary for simulating typedef for class templates,
+// which C++ doesn't support directly.
+template <GTEST_TEMPLATE_ Tmpl>
+struct TemplateSel {
+  template <typename T>
+  struct Bind {
+    typedef Tmpl<T> type;
+  };
+};
+
+# define GTEST_BIND_(TmplSel, T) \
+  TmplSel::template Bind<T>::type
+
+// A unique struct template used as the default value for the
+// arguments of class template Templates.  This allows us to simulate
+// variadic templates (e.g. Templates<int>, Templates<int, double>,
+// and etc), which C++ doesn't support directly.
+template <typename T>
+struct NoneT {};
+
+// The following family of struct and struct templates are used to
+// represent template lists.  In particular, TemplatesN<T1, T2, ...,
+// TN> represents a list of N templates (T1, T2, ..., and TN).  Except
+// for Templates0, every struct in the family has two member types:
+// Head for the selector of the first template in the list, and Tail
+// for the rest of the list.
+
+// The empty template list.
+struct Templates0 {};
+
+// Template lists of length 1, 2, 3, and so on.
+
+template <GTEST_TEMPLATE_ T1>
+struct Templates1 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates0 Tail;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
+struct Templates2 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates1<T2> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
+struct Templates3 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates2<T2, T3> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4>
+struct Templates4 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates3<T2, T3, T4> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
+struct Templates5 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates4<T2, T3, T4, T5> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
+struct Templates6 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates5<T2, T3, T4, T5, T6> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7>
+struct Templates7 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
+struct Templates8 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
+struct Templates9 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10>
+struct Templates10 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
+struct Templates11 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
+struct Templates12 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13>
+struct Templates13 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
+struct Templates14 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
+struct Templates15 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16>
+struct Templates16 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
+struct Templates17 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
+struct Templates18 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19>
+struct Templates19 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
+struct Templates20 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
+struct Templates21 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22>
+struct Templates22 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
+struct Templates23 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
+struct Templates24 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25>
+struct Templates25 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
+struct Templates26 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
+struct Templates27 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28>
+struct Templates28 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
+struct Templates29 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
+struct Templates30 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31>
+struct Templates31 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
+struct Templates32 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
+struct Templates33 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34>
+struct Templates34 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
+struct Templates35 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
+struct Templates36 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37>
+struct Templates37 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
+struct Templates38 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
+struct Templates39 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40>
+struct Templates40 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
+struct Templates41 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
+struct Templates42 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43>
+struct Templates43 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
+struct Templates44 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
+struct Templates45 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46>
+struct Templates46 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
+struct Templates47 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
+struct Templates48 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47, T48> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
+    GTEST_TEMPLATE_ T49>
+struct Templates49 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47, T48, T49> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
+    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
+struct Templates50 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47, T48, T49, T50> Tail;
+};
+
+
+// We don't want to require the users to write TemplatesN<...> directly,
+// as that would require them to count the length.  Templates<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Templates<list>
+// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Templates<T1, ..., TN>, and Google Test will translate
+// that to TemplatesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Templates template.
+template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
+    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
+    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
+    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
+    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
+    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
+    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
+    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
+    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
+    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
+    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
+    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
+    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
+    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
+    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
+    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
+    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
+    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
+    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
+    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
+    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
+    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
+    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
+    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
+    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
+struct Templates {
+  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
+};
+
+template <>
+struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates0 type;
+};
+template <GTEST_TEMPLATE_ T1>
+struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates1<T1> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
+struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates2<T1, T2> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
+struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates3<T1, T2, T3> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4>
+struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates4<T1, T2, T3, T4> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
+struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates5<T1, T2, T3, T4, T5> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
+struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates6<T1, T2, T3, T4, T5, T6> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT> {
+  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT> {
+  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT> {
+  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, T47, NoneT, NoneT, NoneT> {
+  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, T47, T48, NoneT, NoneT> {
+  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47, T48> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
+    GTEST_TEMPLATE_ T49>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, T47, T48, T49, NoneT> {
+  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47, T48, T49> type;
+};
+
+// The TypeList template makes it possible to use either a single type
+// or a Types<...> list in TYPED_TEST_CASE() and
+// INSTANTIATE_TYPED_TEST_CASE_P().
+
+template <typename T>
+struct TypeList {
+  typedef Types1<T> type;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48, T49, T50> > {
+  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
+};
+
+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump
new file mode 100644
index 0000000..251fdf0
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump
@@ -0,0 +1,297 @@
+$$ -*- mode: c++; -*-
+$var n = 50  $$ Maximum length of type lists we want to support.
+// 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: wan@google.com (Zhanyong Wan)
+
+// Type utilities needed for implementing typed and type-parameterized
+// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently we support at most $n types in a list, and at most $n
+// type-parameterized tests in one type-parameterized test case.
+// Please contact googletestframework@googlegroups.com if you need
+// more.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+
+#include "gtest/internal/gtest-port.h"
+
+// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
+// libstdc++ (which is where cxxabi.h comes from).
+# if GTEST_HAS_CXXABI_H_
+#  include <cxxabi.h>
+# elif defined(__HP_aCC)
+#  include <acxx_demangle.h>
+# endif  // GTEST_HASH_CXXABI_H_
+
+namespace testing {
+namespace internal {
+
+// GetTypeName<T>() returns a human-readable name of type T.
+// NB: This function is also used in Google Mock, so don't move it inside of
+// the typed-test-only section below.
+template <typename T>
+std::string GetTypeName() {
+# if GTEST_HAS_RTTI
+
+  const char* const name = typeid(T).name();
+#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
+  int status = 0;
+  // gcc's implementation of typeid(T).name() mangles the type name,
+  // so we have to demangle it.
+#   if GTEST_HAS_CXXABI_H_
+  using abi::__cxa_demangle;
+#   endif  // GTEST_HAS_CXXABI_H_
+  char* const readable_name = __cxa_demangle(name, 0, 0, &status);
+  const std::string name_str(status == 0 ? readable_name : name);
+  free(readable_name);
+  return name_str;
+#  else
+  return name;
+#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
+
+# else
+
+  return "<type>";
+
+# endif  // GTEST_HAS_RTTI
+}
+
+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
+// type.  This can be used as a compile-time assertion to ensure that
+// two types are equal.
+
+template <typename T1, typename T2>
+struct AssertTypeEq;
+
+template <typename T>
+struct AssertTypeEq<T, T> {
+  typedef bool type;
+};
+
+// A unique type used as the default value for the arguments of class
+// template Types.  This allows us to simulate variadic templates
+// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
+// support directly.
+struct None {};
+
+// The following family of struct and struct templates are used to
+// represent type lists.  In particular, TypesN<T1, T2, ..., TN>
+// represents a type list with N types (T1, T2, ..., and TN) in it.
+// Except for Types0, every struct in the family has two member types:
+// Head for the first type in the list, and Tail for the rest of the
+// list.
+
+// The empty type list.
+struct Types0 {};
+
+// Type lists of length 1, 2, 3, and so on.
+
+template <typename T1>
+struct Types1 {
+  typedef T1 Head;
+  typedef Types0 Tail;
+};
+
+$range i 2..n
+
+$for i [[
+$range j 1..i
+$range k 2..i
+template <$for j, [[typename T$j]]>
+struct Types$i {
+  typedef T1 Head;
+  typedef Types$(i-1)<$for k, [[T$k]]> Tail;
+};
+
+
+]]
+
+}  // namespace internal
+
+// We don't want to require the users to write TypesN<...> directly,
+// as that would require them to count the length.  Types<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Types<int>
+// will appear as Types<int, None, None, ..., None> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Types<T1, ..., TN>, and Google Test will translate
+// that to TypesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Types template.
+
+$range i 1..n
+template <$for i, [[typename T$i = internal::None]]>
+struct Types {
+  typedef internal::Types$n<$for i, [[T$i]]> type;
+};
+
+template <>
+struct Types<$for i, [[internal::None]]> {
+  typedef internal::Types0 type;
+};
+
+$range i 1..n-1
+$for i [[
+$range j 1..i
+$range k i+1..n
+template <$for j, [[typename T$j]]>
+struct Types<$for j, [[T$j]]$for k[[, internal::None]]> {
+  typedef internal::Types$i<$for j, [[T$j]]> type;
+};
+
+]]
+
+namespace internal {
+
+# define GTEST_TEMPLATE_ template <typename T> class
+
+// The template "selector" struct TemplateSel<Tmpl> is used to
+// represent Tmpl, which must be a class template with one type
+// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
+// as the type Tmpl<T>.  This allows us to actually instantiate the
+// template "selected" by TemplateSel<Tmpl>.
+//
+// This trick is necessary for simulating typedef for class templates,
+// which C++ doesn't support directly.
+template <GTEST_TEMPLATE_ Tmpl>
+struct TemplateSel {
+  template <typename T>
+  struct Bind {
+    typedef Tmpl<T> type;
+  };
+};
+
+# define GTEST_BIND_(TmplSel, T) \
+  TmplSel::template Bind<T>::type
+
+// A unique struct template used as the default value for the
+// arguments of class template Templates.  This allows us to simulate
+// variadic templates (e.g. Templates<int>, Templates<int, double>,
+// and etc), which C++ doesn't support directly.
+template <typename T>
+struct NoneT {};
+
+// The following family of struct and struct templates are used to
+// represent template lists.  In particular, TemplatesN<T1, T2, ...,
+// TN> represents a list of N templates (T1, T2, ..., and TN).  Except
+// for Templates0, every struct in the family has two member types:
+// Head for the selector of the first template in the list, and Tail
+// for the rest of the list.
+
+// The empty template list.
+struct Templates0 {};
+
+// Template lists of length 1, 2, 3, and so on.
+
+template <GTEST_TEMPLATE_ T1>
+struct Templates1 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates0 Tail;
+};
+
+$range i 2..n
+
+$for i [[
+$range j 1..i
+$range k 2..i
+template <$for j, [[GTEST_TEMPLATE_ T$j]]>
+struct Templates$i {
+  typedef TemplateSel<T1> Head;
+  typedef Templates$(i-1)<$for k, [[T$k]]> Tail;
+};
+
+
+]]
+
+// We don't want to require the users to write TemplatesN<...> directly,
+// as that would require them to count the length.  Templates<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Templates<list>
+// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Templates<T1, ..., TN>, and Google Test will translate
+// that to TemplatesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Templates template.
+
+$range i 1..n
+template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]>
+struct Templates {
+  typedef Templates$n<$for i, [[T$i]]> type;
+};
+
+template <>
+struct Templates<$for i, [[NoneT]]> {
+  typedef Templates0 type;
+};
+
+$range i 1..n-1
+$for i [[
+$range j 1..i
+$range k i+1..n
+template <$for j, [[GTEST_TEMPLATE_ T$j]]>
+struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> {
+  typedef Templates$i<$for j, [[T$j]]> type;
+};
+
+]]
+
+// The TypeList template makes it possible to use either a single type
+// or a Types<...> list in TYPED_TEST_CASE() and
+// INSTANTIATE_TYPED_TEST_CASE_P().
+
+template <typename T>
+struct TypeList {
+  typedef Types1<T> type;
+};
+
+
+$range i 1..n
+template <$for i, [[typename T$i]]>
+struct TypeList<Types<$for i, [[T$i]]> > {
+  typedef typename Types<$for i, [[T$i]]>::type type;
+};
+
+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-all.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-all.cc
new file mode 100644
index 0000000..0a9cee5
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-all.cc
@@ -0,0 +1,48 @@
+// 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: mheule@google.com (Markus Heule)
+//
+// Google C++ Testing Framework (Google Test)
+//
+// Sometimes it's desirable to build Google Test by compiling a single file.
+// This file serves this purpose.
+
+// This line ensures that gtest.h can be compiled on its own, even
+// when it's fused.
+#include "gtest/gtest.h"
+
+// The following lines pull in the real gtest *.cc files.
+#include "src/gtest.cc"
+#include "src/gtest-death-test.cc"
+#include "src/gtest-filepath.cc"
+#include "src/gtest-port.cc"
+#include "src/gtest-printers.cc"
+#include "src/gtest-test-part.cc"
+#include "src/gtest-typed-test.cc"
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-death-test.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-death-test.cc
new file mode 100644
index 0000000..a01a369
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-death-test.cc
@@ -0,0 +1,1342 @@
+// Copyright 2005, 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), vladl@google.com (Vlad Losev)
+//
+// This file implements death tests.
+
+#include "gtest/gtest-death-test.h"
+#include "gtest/internal/gtest-port.h"
+#include "gtest/internal/custom/gtest.h"
+
+#if GTEST_HAS_DEATH_TEST
+
+# if GTEST_OS_MAC
+#  include <crt_externs.h>
+# endif  // GTEST_OS_MAC
+
+# include <errno.h>
+# include <fcntl.h>
+# include <limits.h>
+
+# if GTEST_OS_LINUX
+#  include <signal.h>
+# endif  // GTEST_OS_LINUX
+
+# include <stdarg.h>
+
+# if GTEST_OS_WINDOWS
+#  include <windows.h>
+# else
+#  include <sys/mman.h>
+#  include <sys/wait.h>
+# endif  // GTEST_OS_WINDOWS
+
+# if GTEST_OS_QNX
+#  include <spawn.h>
+# endif  // GTEST_OS_QNX
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-string.h"
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+namespace testing {
+
+// Constants.
+
+// The default death test style.
+static const char kDefaultDeathTestStyle[] = "fast";
+
+GTEST_DEFINE_string_(
+    death_test_style,
+    internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle),
+    "Indicates how to run a death test in a forked child process: "
+    "\"threadsafe\" (child process re-executes the test binary "
+    "from the beginning, running only the specific death test) or "
+    "\"fast\" (child process runs the death test immediately "
+    "after forking).");
+
+GTEST_DEFINE_bool_(
+    death_test_use_fork,
+    internal::BoolFromGTestEnv("death_test_use_fork", false),
+    "Instructs to use fork()/_exit() instead of clone() in death tests. "
+    "Ignored and always uses fork() on POSIX systems where clone() is not "
+    "implemented. Useful when running under valgrind or similar tools if "
+    "those do not support clone(). Valgrind 3.3.1 will just fail if "
+    "it sees an unsupported combination of clone() flags. "
+    "It is not recommended to use this flag w/o valgrind though it will "
+    "work in 99% of the cases. Once valgrind is fixed, this flag will "
+    "most likely be removed.");
+
+namespace internal {
+GTEST_DEFINE_string_(
+    internal_run_death_test, "",
+    "Indicates the file, line number, temporal index of "
+    "the single death test to run, and a file descriptor to "
+    "which a success code may be sent, all separated by "
+    "the '|' characters.  This flag is specified if and only if the current "
+    "process is a sub-process launched for running a thread-safe "
+    "death test.  FOR INTERNAL USE ONLY.");
+}  // namespace internal
+
+#if GTEST_HAS_DEATH_TEST
+
+namespace internal {
+
+// Valid only for fast death tests. Indicates the code is running in the
+// child process of a fast style death test.
+# if !GTEST_OS_WINDOWS
+static bool g_in_fast_death_test_child = false;
+# endif
+
+// Returns a Boolean value indicating whether the caller is currently
+// executing in the context of the death test child process.  Tools such as
+// Valgrind heap checkers may need this to modify their behavior in death
+// tests.  IMPORTANT: This is an internal utility.  Using it may break the
+// implementation of death tests.  User code MUST NOT use it.
+bool InDeathTestChild() {
+# if GTEST_OS_WINDOWS
+
+  // On Windows, death tests are thread-safe regardless of the value of the
+  // death_test_style flag.
+  return !GTEST_FLAG(internal_run_death_test).empty();
+
+# else
+
+  if (GTEST_FLAG(death_test_style) == "threadsafe")
+    return !GTEST_FLAG(internal_run_death_test).empty();
+  else
+    return g_in_fast_death_test_child;
+#endif
+}
+
+}  // namespace internal
+
+// ExitedWithCode constructor.
+ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {
+}
+
+// ExitedWithCode function-call operator.
+bool ExitedWithCode::operator()(int exit_status) const {
+# if GTEST_OS_WINDOWS
+
+  return exit_status == exit_code_;
+
+# else
+
+  return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;
+
+# endif  // GTEST_OS_WINDOWS
+}
+
+# if !GTEST_OS_WINDOWS
+// KilledBySignal constructor.
+KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
+}
+
+// KilledBySignal function-call operator.
+bool KilledBySignal::operator()(int exit_status) const {
+#  if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
+  {
+    bool result;
+    if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {
+      return result;
+    }
+  }
+#  endif  // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
+  return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
+}
+# endif  // !GTEST_OS_WINDOWS
+
+namespace internal {
+
+// Utilities needed for death tests.
+
+// Generates a textual description of a given exit code, in the format
+// specified by wait(2).
+static std::string ExitSummary(int exit_code) {
+  Message m;
+
+# if GTEST_OS_WINDOWS
+
+  m << "Exited with exit status " << exit_code;
+
+# else
+
+  if (WIFEXITED(exit_code)) {
+    m << "Exited with exit status " << WEXITSTATUS(exit_code);
+  } else if (WIFSIGNALED(exit_code)) {
+    m << "Terminated by signal " << WTERMSIG(exit_code);
+  }
+#  ifdef WCOREDUMP
+  if (WCOREDUMP(exit_code)) {
+    m << " (core dumped)";
+  }
+#  endif
+# endif  // GTEST_OS_WINDOWS
+
+  return m.GetString();
+}
+
+// Returns true if exit_status describes a process that was terminated
+// by a signal, or exited normally with a nonzero exit code.
+bool ExitedUnsuccessfully(int exit_status) {
+  return !ExitedWithCode(0)(exit_status);
+}
+
+# if !GTEST_OS_WINDOWS
+// Generates a textual failure message when a death test finds more than
+// one thread running, or cannot determine the number of threads, prior
+// to executing the given statement.  It is the responsibility of the
+// caller not to pass a thread_count of 1.
+static std::string DeathTestThreadWarning(size_t thread_count) {
+  Message msg;
+  msg << "Death tests use fork(), which is unsafe particularly"
+      << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
+  if (thread_count == 0)
+    msg << "couldn't detect the number of threads.";
+  else
+    msg << "detected " << thread_count << " threads.";
+  return msg.GetString();
+}
+# endif  // !GTEST_OS_WINDOWS
+
+// Flag characters for reporting a death test that did not die.
+static const char kDeathTestLived = 'L';
+static const char kDeathTestReturned = 'R';
+static const char kDeathTestThrew = 'T';
+static const char kDeathTestInternalError = 'I';
+
+// An enumeration describing all of the possible ways that a death test can
+// conclude.  DIED means that the process died while executing the test
+// code; LIVED means that process lived beyond the end of the test code;
+// RETURNED means that the test statement attempted to execute a return
+// statement, which is not allowed; THREW means that the test statement
+// returned control by throwing an exception.  IN_PROGRESS means the test
+// has not yet concluded.
+// TODO(vladl@google.com): Unify names and possibly values for
+// AbortReason, DeathTestOutcome, and flag characters above.
+enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
+
+// Routine for aborting the program which is safe to call from an
+// exec-style death test child process, in which case the error
+// message is propagated back to the parent process.  Otherwise, the
+// message is simply printed to stderr.  In either case, the program
+// then exits with status 1.
+void DeathTestAbort(const std::string& message) {
+  // On a POSIX system, this function may be called from a threadsafe-style
+  // death test child process, which operates on a very small stack.  Use
+  // the heap for any additional non-minuscule memory requirements.
+  const InternalRunDeathTestFlag* const flag =
+      GetUnitTestImpl()->internal_run_death_test_flag();
+  if (flag != NULL) {
+    FILE* parent = posix::FDOpen(flag->write_fd(), "w");
+    fputc(kDeathTestInternalError, parent);
+    fprintf(parent, "%s", message.c_str());
+    fflush(parent);
+    _exit(1);
+  } else {
+    fprintf(stderr, "%s", message.c_str());
+    fflush(stderr);
+    posix::Abort();
+  }
+}
+
+// A replacement for CHECK that calls DeathTestAbort if the assertion
+// fails.
+# define GTEST_DEATH_TEST_CHECK_(expression) \
+  do { \
+    if (!::testing::internal::IsTrue(expression)) { \
+      DeathTestAbort( \
+          ::std::string("CHECK failed: File ") + __FILE__ +  ", line " \
+          + ::testing::internal::StreamableToString(__LINE__) + ": " \
+          + #expression); \
+    } \
+  } while (::testing::internal::AlwaysFalse())
+
+// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for
+// evaluating any system call that fulfills two conditions: it must return
+// -1 on failure, and set errno to EINTR when it is interrupted and
+// should be tried again.  The macro expands to a loop that repeatedly
+// evaluates the expression as long as it evaluates to -1 and sets
+// errno to EINTR.  If the expression evaluates to -1 but errno is
+// something other than EINTR, DeathTestAbort is called.
+# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
+  do { \
+    int gtest_retval; \
+    do { \
+      gtest_retval = (expression); \
+    } while (gtest_retval == -1 && errno == EINTR); \
+    if (gtest_retval == -1) { \
+      DeathTestAbort( \
+          ::std::string("CHECK failed: File ") + __FILE__ + ", line " \
+          + ::testing::internal::StreamableToString(__LINE__) + ": " \
+          + #expression + " != -1"); \
+    } \
+  } while (::testing::internal::AlwaysFalse())
+
+// Returns the message describing the last system error in errno.
+std::string GetLastErrnoDescription() {
+    return errno == 0 ? "" : posix::StrError(errno);
+}
+
+// This is called from a death test parent process to read a failure
+// message from the death test child process and log it with the FATAL
+// severity. On Windows, the message is read from a pipe handle. On other
+// platforms, it is read from a file descriptor.
+static void FailFromInternalError(int fd) {
+  Message error;
+  char buffer[256];
+  int num_read;
+
+  do {
+    while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
+      buffer[num_read] = '\0';
+      error << buffer;
+    }
+  } while (num_read == -1 && errno == EINTR);
+
+  if (num_read == 0) {
+    GTEST_LOG_(FATAL) << error.GetString();
+  } else {
+    const int last_error = errno;
+    GTEST_LOG_(FATAL) << "Error while reading death test internal: "
+                      << GetLastErrnoDescription() << " [" << last_error << "]";
+  }
+}
+
+// Death test constructor.  Increments the running death test count
+// for the current test.
+DeathTest::DeathTest() {
+  TestInfo* const info = GetUnitTestImpl()->current_test_info();
+  if (info == NULL) {
+    DeathTestAbort("Cannot run a death test outside of a TEST or "
+                   "TEST_F construct");
+  }
+}
+
+// Creates and returns a death test by dispatching to the current
+// death test factory.
+bool DeathTest::Create(const char* statement, const RE* regex,
+                       const char* file, int line, DeathTest** test) {
+  return GetUnitTestImpl()->death_test_factory()->Create(
+      statement, regex, file, line, test);
+}
+
+const char* DeathTest::LastMessage() {
+  return last_death_test_message_.c_str();
+}
+
+void DeathTest::set_last_death_test_message(const std::string& message) {
+  last_death_test_message_ = message;
+}
+
+std::string DeathTest::last_death_test_message_;
+
+// Provides cross platform implementation for some death functionality.
+class DeathTestImpl : public DeathTest {
+ protected:
+  DeathTestImpl(const char* a_statement, const RE* a_regex)
+      : statement_(a_statement),
+        regex_(a_regex),
+        spawned_(false),
+        status_(-1),
+        outcome_(IN_PROGRESS),
+        read_fd_(-1),
+        write_fd_(-1) {}
+
+  // read_fd_ is expected to be closed and cleared by a derived class.
+  ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
+
+  void Abort(AbortReason reason);
+  virtual bool Passed(bool status_ok);
+
+  const char* statement() const { return statement_; }
+  const RE* regex() const { return regex_; }
+  bool spawned() const { return spawned_; }
+  void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
+  int status() const { return status_; }
+  void set_status(int a_status) { status_ = a_status; }
+  DeathTestOutcome outcome() const { return outcome_; }
+  void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
+  int read_fd() const { return read_fd_; }
+  void set_read_fd(int fd) { read_fd_ = fd; }
+  int write_fd() const { return write_fd_; }
+  void set_write_fd(int fd) { write_fd_ = fd; }
+
+  // Called in the parent process only. Reads the result code of the death
+  // test child process via a pipe, interprets it to set the outcome_
+  // member, and closes read_fd_.  Outputs diagnostics and terminates in
+  // case of unexpected codes.
+  void ReadAndInterpretStatusByte();
+
+ private:
+  // The textual content of the code this object is testing.  This class
+  // doesn't own this string and should not attempt to delete it.
+  const char* const statement_;
+  // The regular expression which test output must match.  DeathTestImpl
+  // doesn't own this object and should not attempt to delete it.
+  const RE* const regex_;
+  // True if the death test child process has been successfully spawned.
+  bool spawned_;
+  // The exit status of the child process.
+  int status_;
+  // How the death test concluded.
+  DeathTestOutcome outcome_;
+  // Descriptor to the read end of the pipe to the child process.  It is
+  // always -1 in the child process.  The child keeps its write end of the
+  // pipe in write_fd_.
+  int read_fd_;
+  // Descriptor to the child's write end of the pipe to the parent process.
+  // It is always -1 in the parent process.  The parent keeps its end of the
+  // pipe in read_fd_.
+  int write_fd_;
+};
+
+// Called in the parent process only. Reads the result code of the death
+// test child process via a pipe, interprets it to set the outcome_
+// member, and closes read_fd_.  Outputs diagnostics and terminates in
+// case of unexpected codes.
+void DeathTestImpl::ReadAndInterpretStatusByte() {
+  char flag;
+  int bytes_read;
+
+  // The read() here blocks until data is available (signifying the
+  // failure of the death test) or until the pipe is closed (signifying
+  // its success), so it's okay to call this in the parent before
+  // the child process has exited.
+  do {
+    bytes_read = posix::Read(read_fd(), &flag, 1);
+  } while (bytes_read == -1 && errno == EINTR);
+
+  if (bytes_read == 0) {
+    set_outcome(DIED);
+  } else if (bytes_read == 1) {
+    switch (flag) {
+      case kDeathTestReturned:
+        set_outcome(RETURNED);
+        break;
+      case kDeathTestThrew:
+        set_outcome(THREW);
+        break;
+      case kDeathTestLived:
+        set_outcome(LIVED);
+        break;
+      case kDeathTestInternalError:
+        FailFromInternalError(read_fd());  // Does not return.
+        break;
+      default:
+        GTEST_LOG_(FATAL) << "Death test child process reported "
+                          << "unexpected status byte ("
+                          << static_cast<unsigned int>(flag) << ")";
+    }
+  } else {
+    GTEST_LOG_(FATAL) << "Read from death test child process failed: "
+                      << GetLastErrnoDescription();
+  }
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
+  set_read_fd(-1);
+}
+
+// Signals that the death test code which should have exited, didn't.
+// Should be called only in a death test child process.
+// Writes a status byte to the child's status file descriptor, then
+// calls _exit(1).
+void DeathTestImpl::Abort(AbortReason reason) {
+  // The parent process considers the death test to be a failure if
+  // it finds any data in our pipe.  So, here we write a single flag byte
+  // to the pipe, then exit.
+  const char status_ch =
+      reason == TEST_DID_NOT_DIE ? kDeathTestLived :
+      reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;
+
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
+  // We are leaking the descriptor here because on some platforms (i.e.,
+  // when built as Windows DLL), destructors of global objects will still
+  // run after calling _exit(). On such systems, write_fd_ will be
+  // indirectly closed from the destructor of UnitTestImpl, causing double
+  // close if it is also closed here. On debug configurations, double close
+  // may assert. As there are no in-process buffers to flush here, we are
+  // relying on the OS to close the descriptor after the process terminates
+  // when the destructors are not run.
+  _exit(1);  // Exits w/o any normal exit hooks (we were supposed to crash)
+}
+
+// Returns an indented copy of stderr output for a death test.
+// This makes distinguishing death test output lines from regular log lines
+// much easier.
+static ::std::string FormatDeathTestOutput(const ::std::string& output) {
+  ::std::string ret;
+  for (size_t at = 0; ; ) {
+    const size_t line_end = output.find('\n', at);
+    ret += "[  DEATH   ] ";
+    if (line_end == ::std::string::npos) {
+      ret += output.substr(at);
+      break;
+    }
+    ret += output.substr(at, line_end + 1 - at);
+    at = line_end + 1;
+  }
+  return ret;
+}
+
+// Assesses the success or failure of a death test, using both private
+// members which have previously been set, and one argument:
+//
+// Private data members:
+//   outcome:  An enumeration describing how the death test
+//             concluded: DIED, LIVED, THREW, or RETURNED.  The death test
+//             fails in the latter three cases.
+//   status:   The exit status of the child process. On *nix, it is in the
+//             in the format specified by wait(2). On Windows, this is the
+//             value supplied to the ExitProcess() API or a numeric code
+//             of the exception that terminated the program.
+//   regex:    A regular expression object to be applied to
+//             the test's captured standard error output; the death test
+//             fails if it does not match.
+//
+// Argument:
+//   status_ok: true if exit_status is acceptable in the context of
+//              this particular death test, which fails if it is false
+//
+// Returns true iff all of the above conditions are met.  Otherwise, the
+// first failing condition, in the order given above, is the one that is
+// reported. Also sets the last death test message string.
+bool DeathTestImpl::Passed(bool status_ok) {
+  if (!spawned())
+    return false;
+
+  const std::string error_message = GetCapturedStderr();
+
+  bool success = false;
+  Message buffer;
+
+  buffer << "Death test: " << statement() << "\n";
+  switch (outcome()) {
+    case LIVED:
+      buffer << "    Result: failed to die.\n"
+             << " Error msg:\n" << FormatDeathTestOutput(error_message);
+      break;
+    case THREW:
+      buffer << "    Result: threw an exception.\n"
+             << " Error msg:\n" << FormatDeathTestOutput(error_message);
+      break;
+    case RETURNED:
+      buffer << "    Result: illegal return in test statement.\n"
+             << " Error msg:\n" << FormatDeathTestOutput(error_message);
+      break;
+    case DIED:
+      if (status_ok) {
+        const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
+        if (matched) {
+          success = true;
+        } else {
+          buffer << "    Result: died but not with expected error.\n"
+                 << "  Expected: " << regex()->pattern() << "\n"
+                 << "Actual msg:\n" << FormatDeathTestOutput(error_message);
+        }
+      } else {
+        buffer << "    Result: died but not with expected exit code:\n"
+               << "            " << ExitSummary(status()) << "\n"
+               << "Actual msg:\n" << FormatDeathTestOutput(error_message);
+      }
+      break;
+    case IN_PROGRESS:
+    default:
+      GTEST_LOG_(FATAL)
+          << "DeathTest::Passed somehow called before conclusion of test";
+  }
+
+  DeathTest::set_last_death_test_message(buffer.GetString());
+  return success;
+}
+
+# if GTEST_OS_WINDOWS
+// WindowsDeathTest implements death tests on Windows. Due to the
+// specifics of starting new processes on Windows, death tests there are
+// always threadsafe, and Google Test considers the
+// --gtest_death_test_style=fast setting to be equivalent to
+// --gtest_death_test_style=threadsafe there.
+//
+// A few implementation notes:  Like the Linux version, the Windows
+// implementation uses pipes for child-to-parent communication. But due to
+// the specifics of pipes on Windows, some extra steps are required:
+//
+// 1. The parent creates a communication pipe and stores handles to both
+//    ends of it.
+// 2. The parent starts the child and provides it with the information
+//    necessary to acquire the handle to the write end of the pipe.
+// 3. The child acquires the write end of the pipe and signals the parent
+//    using a Windows event.
+// 4. Now the parent can release the write end of the pipe on its side. If
+//    this is done before step 3, the object's reference count goes down to
+//    0 and it is destroyed, preventing the child from acquiring it. The
+//    parent now has to release it, or read operations on the read end of
+//    the pipe will not return when the child terminates.
+// 5. The parent reads child's output through the pipe (outcome code and
+//    any possible error messages) from the pipe, and its stderr and then
+//    determines whether to fail the test.
+//
+// Note: to distinguish Win32 API calls from the local method and function
+// calls, the former are explicitly resolved in the global namespace.
+//
+class WindowsDeathTest : public DeathTestImpl {
+ public:
+  WindowsDeathTest(const char* a_statement,
+                   const RE* a_regex,
+                   const char* file,
+                   int line)
+      : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
+
+  // All of these virtual functions are inherited from DeathTest.
+  virtual int Wait();
+  virtual TestRole AssumeRole();
+
+ private:
+  // The name of the file in which the death test is located.
+  const char* const file_;
+  // The line number on which the death test is located.
+  const int line_;
+  // Handle to the write end of the pipe to the child process.
+  AutoHandle write_handle_;
+  // Child process handle.
+  AutoHandle child_handle_;
+  // Event the child process uses to signal the parent that it has
+  // acquired the handle to the write end of the pipe. After seeing this
+  // event the parent can release its own handles to make sure its
+  // ReadFile() calls return when the child terminates.
+  AutoHandle event_handle_;
+};
+
+// Waits for the child in a death test to exit, returning its exit
+// status, or 0 if no child process exists.  As a side effect, sets the
+// outcome data member.
+int WindowsDeathTest::Wait() {
+  if (!spawned())
+    return 0;
+
+  // Wait until the child either signals that it has acquired the write end
+  // of the pipe or it dies.
+  const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
+  switch (::WaitForMultipleObjects(2,
+                                   wait_handles,
+                                   FALSE,  // Waits for any of the handles.
+                                   INFINITE)) {
+    case WAIT_OBJECT_0:
+    case WAIT_OBJECT_0 + 1:
+      break;
+    default:
+      GTEST_DEATH_TEST_CHECK_(false);  // Should not get here.
+  }
+
+  // The child has acquired the write end of the pipe or exited.
+  // We release the handle on our side and continue.
+  write_handle_.Reset();
+  event_handle_.Reset();
+
+  ReadAndInterpretStatusByte();
+
+  // Waits for the child process to exit if it haven't already. This
+  // returns immediately if the child has already exited, regardless of
+  // whether previous calls to WaitForMultipleObjects synchronized on this
+  // handle or not.
+  GTEST_DEATH_TEST_CHECK_(
+      WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),
+                                             INFINITE));
+  DWORD status_code;
+  GTEST_DEATH_TEST_CHECK_(
+      ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);
+  child_handle_.Reset();
+  set_status(static_cast<int>(status_code));
+  return status();
+}
+
+// The AssumeRole process for a Windows death test.  It creates a child
+// process with the same executable as the current process to run the
+// death test.  The child process is given the --gtest_filter and
+// --gtest_internal_run_death_test flags such that it knows to run the
+// current death test only.
+DeathTest::TestRole WindowsDeathTest::AssumeRole() {
+  const UnitTestImpl* const impl = GetUnitTestImpl();
+  const InternalRunDeathTestFlag* const flag =
+      impl->internal_run_death_test_flag();
+  const TestInfo* const info = impl->current_test_info();
+  const int death_test_index = info->result()->death_test_count();
+
+  if (flag != NULL) {
+    // ParseInternalRunDeathTestFlag() has performed all the necessary
+    // processing.
+    set_write_fd(flag->write_fd());
+    return EXECUTE_TEST;
+  }
+
+  // WindowsDeathTest uses an anonymous pipe to communicate results of
+  // a death test.
+  SECURITY_ATTRIBUTES handles_are_inheritable = {
+    sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
+  HANDLE read_handle, write_handle;
+  GTEST_DEATH_TEST_CHECK_(
+      ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
+                   0)  // Default buffer size.
+      != FALSE);
+  set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),
+                                O_RDONLY));
+  write_handle_.Reset(write_handle);
+  event_handle_.Reset(::CreateEvent(
+      &handles_are_inheritable,
+      TRUE,    // The event will automatically reset to non-signaled state.
+      FALSE,   // The initial state is non-signalled.
+      NULL));  // The even is unnamed.
+  GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);
+  const std::string filter_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" +
+      info->test_case_name() + "." + info->name();
+  const std::string internal_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag +
+      "=" + file_ + "|" + StreamableToString(line_) + "|" +
+      StreamableToString(death_test_index) + "|" +
+      StreamableToString(static_cast<unsigned int>(::GetCurrentProcessId())) +
+      // size_t has the same width as pointers on both 32-bit and 64-bit
+      // Windows platforms.
+      // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
+      "|" + StreamableToString(reinterpret_cast<size_t>(write_handle)) +
+      "|" + StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));
+
+  char executable_path[_MAX_PATH + 1];  // NOLINT
+  GTEST_DEATH_TEST_CHECK_(
+      _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,
+                                            executable_path,
+                                            _MAX_PATH));
+
+  std::string command_line =
+      std::string(::GetCommandLineA()) + " " + filter_flag + " \"" +
+      internal_flag + "\"";
+
+  DeathTest::set_last_death_test_message("");
+
+  CaptureStderr();
+  // Flush the log buffers since the log streams are shared with the child.
+  FlushInfoLog();
+
+  // The child process will share the standard handles with the parent.
+  STARTUPINFOA startup_info;
+  memset(&startup_info, 0, sizeof(STARTUPINFO));
+  startup_info.dwFlags = STARTF_USESTDHANDLES;
+  startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);
+  startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
+  startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
+
+  PROCESS_INFORMATION process_info;
+  GTEST_DEATH_TEST_CHECK_(::CreateProcessA(
+      executable_path,
+      const_cast<char*>(command_line.c_str()),
+      NULL,   // Retuned process handle is not inheritable.
+      NULL,   // Retuned thread handle is not inheritable.
+      TRUE,   // Child inherits all inheritable handles (for write_handle_).
+      0x0,    // Default creation flags.
+      NULL,   // Inherit the parent's environment.
+      UnitTest::GetInstance()->original_working_dir(),
+      &startup_info,
+      &process_info) != FALSE);
+  child_handle_.Reset(process_info.hProcess);
+  ::CloseHandle(process_info.hThread);
+  set_spawned(true);
+  return OVERSEE_TEST;
+}
+# else  // We are not on Windows.
+
+// ForkingDeathTest provides implementations for most of the abstract
+// methods of the DeathTest interface.  Only the AssumeRole method is
+// left undefined.
+class ForkingDeathTest : public DeathTestImpl {
+ public:
+  ForkingDeathTest(const char* statement, const RE* regex);
+
+  // All of these virtual functions are inherited from DeathTest.
+  virtual int Wait();
+
+ protected:
+  void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
+
+ private:
+  // PID of child process during death test; 0 in the child process itself.
+  pid_t child_pid_;
+};
+
+// Constructs a ForkingDeathTest.
+ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
+    : DeathTestImpl(a_statement, a_regex),
+      child_pid_(-1) {}
+
+// Waits for the child in a death test to exit, returning its exit
+// status, or 0 if no child process exists.  As a side effect, sets the
+// outcome data member.
+int ForkingDeathTest::Wait() {
+  if (!spawned())
+    return 0;
+
+  ReadAndInterpretStatusByte();
+
+  int status_value;
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
+  set_status(status_value);
+  return status_value;
+}
+
+// A concrete death test class that forks, then immediately runs the test
+// in the child process.
+class NoExecDeathTest : public ForkingDeathTest {
+ public:
+  NoExecDeathTest(const char* a_statement, const RE* a_regex) :
+      ForkingDeathTest(a_statement, a_regex) { }
+  virtual TestRole AssumeRole();
+};
+
+// The AssumeRole process for a fork-and-run death test.  It implements a
+// straightforward fork, with a simple pipe to transmit the status byte.
+DeathTest::TestRole NoExecDeathTest::AssumeRole() {
+  const size_t thread_count = GetThreadCount();
+  if (thread_count != 1) {
+    GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
+  }
+
+  int pipe_fd[2];
+  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
+
+  DeathTest::set_last_death_test_message("");
+  CaptureStderr();
+  // When we fork the process below, the log file buffers are copied, but the
+  // file descriptors are shared.  We flush all log files here so that closing
+  // the file descriptors in the child process doesn't throw off the
+  // synchronization between descriptors and buffers in the parent process.
+  // This is as close to the fork as possible to avoid a race condition in case
+  // there are multiple threads running before the death test, and another
+  // thread writes to the log file.
+  FlushInfoLog();
+
+  const pid_t child_pid = fork();
+  GTEST_DEATH_TEST_CHECK_(child_pid != -1);
+  set_child_pid(child_pid);
+  if (child_pid == 0) {
+    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
+    set_write_fd(pipe_fd[1]);
+    // Redirects all logging to stderr in the child process to prevent
+    // concurrent writes to the log files.  We capture stderr in the parent
+    // process and append the child process' output to a log.
+    LogToStderr();
+    // Event forwarding to the listeners of event listener API mush be shut
+    // down in death test subprocesses.
+    GetUnitTestImpl()->listeners()->SuppressEventForwarding();
+    g_in_fast_death_test_child = true;
+    return EXECUTE_TEST;
+  } else {
+    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
+    set_read_fd(pipe_fd[0]);
+    set_spawned(true);
+    return OVERSEE_TEST;
+  }
+}
+
+// A concrete death test class that forks and re-executes the main
+// program from the beginning, with command-line flags set that cause
+// only this specific death test to be run.
+class ExecDeathTest : public ForkingDeathTest {
+ public:
+  ExecDeathTest(const char* a_statement, const RE* a_regex,
+                const char* file, int line) :
+      ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
+  virtual TestRole AssumeRole();
+ private:
+  static ::std::vector<testing::internal::string>
+  GetArgvsForDeathTestChildProcess() {
+    ::std::vector<testing::internal::string> args = GetInjectableArgvs();
+#  if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
+    ::std::vector<testing::internal::string> extra_args =
+        GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();
+    args.insert(args.end(), extra_args.begin(), extra_args.end());
+#  endif  // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
+    return args;
+  }
+  // The name of the file in which the death test is located.
+  const char* const file_;
+  // The line number on which the death test is located.
+  const int line_;
+};
+
+// Utility class for accumulating command-line arguments.
+class Arguments {
+ public:
+  Arguments() {
+    args_.push_back(NULL);
+  }
+
+  ~Arguments() {
+    for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
+         ++i) {
+      free(*i);
+    }
+  }
+  void AddArgument(const char* argument) {
+    args_.insert(args_.end() - 1, posix::StrDup(argument));
+  }
+
+  template <typename Str>
+  void AddArguments(const ::std::vector<Str>& arguments) {
+    for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
+         i != arguments.end();
+         ++i) {
+      args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
+    }
+  }
+  char* const* Argv() {
+    return &args_[0];
+  }
+
+ private:
+  std::vector<char*> args_;
+};
+
+// A struct that encompasses the arguments to the child process of a
+// threadsafe-style death test process.
+struct ExecDeathTestArgs {
+  char* const* argv;  // Command-line arguments for the child's call to exec
+  int close_fd;       // File descriptor to close; the read end of a pipe
+};
+
+#  if GTEST_OS_MAC
+inline char** GetEnviron() {
+  // When Google Test is built as a framework on MacOS X, the environ variable
+  // is unavailable. Apple's documentation (man environ) recommends using
+  // _NSGetEnviron() instead.
+  return *_NSGetEnviron();
+}
+#  else
+// Some POSIX platforms expect you to declare environ. extern "C" makes
+// it reside in the global namespace.
+extern "C" char** environ;
+inline char** GetEnviron() { return environ; }
+#  endif  // GTEST_OS_MAC
+
+#  if !GTEST_OS_QNX
+// The main function for a threadsafe-style death test child process.
+// This function is called in a clone()-ed process and thus must avoid
+// any potentially unsafe operations like malloc or libc functions.
+static int ExecDeathTestChildMain(void* child_arg) {
+  ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
+
+  // We need to execute the test program in the same environment where
+  // it was originally invoked.  Therefore we change to the original
+  // working directory first.
+  const char* const original_dir =
+      UnitTest::GetInstance()->original_working_dir();
+  // We can safely call chdir() as it's a direct system call.
+  if (chdir(original_dir) != 0) {
+    DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
+                   GetLastErrnoDescription());
+    return EXIT_FAILURE;
+  }
+
+  // We can safely call execve() as it's a direct system call.  We
+  // cannot use execvp() as it's a libc function and thus potentially
+  // unsafe.  Since execve() doesn't search the PATH, the user must
+  // invoke the test program via a valid path that contains at least
+  // one path separator.
+  execve(args->argv[0], args->argv, GetEnviron());
+  DeathTestAbort(std::string("execve(") + args->argv[0] + ", ...) in " +
+                 original_dir + " failed: " +
+                 GetLastErrnoDescription());
+  return EXIT_FAILURE;
+}
+#  endif  // !GTEST_OS_QNX
+
+// Two utility routines that together determine the direction the stack
+// grows.
+// This could be accomplished more elegantly by a single recursive
+// function, but we want to guard against the unlikely possibility of
+// a smart compiler optimizing the recursion away.
+//
+// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
+// StackLowerThanAddress into StackGrowsDown, which then doesn't give
+// correct answer.
+void StackLowerThanAddress(const void* ptr, bool* result) GTEST_NO_INLINE_;
+void StackLowerThanAddress(const void* ptr, bool* result) {
+  int dummy;
+  *result = (&dummy < ptr);
+}
+
+// Make sure AddressSanitizer does not tamper with the stack here.
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+bool StackGrowsDown() {
+  int dummy;
+  bool result;
+  StackLowerThanAddress(&dummy, &result);
+  return result;
+}
+
+// Spawns a child process with the same executable as the current process in
+// a thread-safe manner and instructs it to run the death test.  The
+// implementation uses fork(2) + exec.  On systems where clone(2) is
+// available, it is used instead, being slightly more thread-safe.  On QNX,
+// fork supports only single-threaded environments, so this function uses
+// spawn(2) there instead.  The function dies with an error message if
+// anything goes wrong.
+static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
+  ExecDeathTestArgs args = { argv, close_fd };
+  pid_t child_pid = -1;
+
+#  if GTEST_OS_QNX
+  // Obtains the current directory and sets it to be closed in the child
+  // process.
+  const int cwd_fd = open(".", O_RDONLY);
+  GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));
+  // We need to execute the test program in the same environment where
+  // it was originally invoked.  Therefore we change to the original
+  // working directory first.
+  const char* const original_dir =
+      UnitTest::GetInstance()->original_working_dir();
+  // We can safely call chdir() as it's a direct system call.
+  if (chdir(original_dir) != 0) {
+    DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
+                   GetLastErrnoDescription());
+    return EXIT_FAILURE;
+  }
+
+  int fd_flags;
+  // Set close_fd to be closed after spawn.
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,
+                                        fd_flags | FD_CLOEXEC));
+  struct inheritance inherit = {0};
+  // spawn is a system call.
+  child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());
+  // Restores the current working directory.
+  GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
+
+#  else   // GTEST_OS_QNX
+#   if GTEST_OS_LINUX
+  // When a SIGPROF signal is received while fork() or clone() are executing,
+  // the process may hang. To avoid this, we ignore SIGPROF here and re-enable
+  // it after the call to fork()/clone() is complete.
+  struct sigaction saved_sigprof_action;
+  struct sigaction ignore_sigprof_action;
+  memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));
+  sigemptyset(&ignore_sigprof_action.sa_mask);
+  ignore_sigprof_action.sa_handler = SIG_IGN;
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(
+      SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));
+#   endif  // GTEST_OS_LINUX
+
+#   if GTEST_HAS_CLONE
+  const bool use_fork = GTEST_FLAG(death_test_use_fork);
+
+  if (!use_fork) {
+    static const bool stack_grows_down = StackGrowsDown();
+    const size_t stack_size = getpagesize();
+    // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
+    void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
+                             MAP_ANON | MAP_PRIVATE, -1, 0);
+    GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
+
+    // Maximum stack alignment in bytes:  For a downward-growing stack, this
+    // amount is subtracted from size of the stack space to get an address
+    // that is within the stack space and is aligned on all systems we care
+    // about.  As far as I know there is no ABI with stack alignment greater
+    // than 64.  We assume stack and stack_size already have alignment of
+    // kMaxStackAlignment.
+    const size_t kMaxStackAlignment = 64;
+    void* const stack_top =
+        static_cast<char*>(stack) +
+            (stack_grows_down ? stack_size - kMaxStackAlignment : 0);
+    GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment &&
+        reinterpret_cast<intptr_t>(stack_top) % kMaxStackAlignment == 0);
+
+    child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
+
+    GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
+  }
+#   else
+  const bool use_fork = true;
+#   endif  // GTEST_HAS_CLONE
+
+  if (use_fork && (child_pid = fork()) == 0) {
+      ExecDeathTestChildMain(&args);
+      _exit(0);
+  }
+#  endif  // GTEST_OS_QNX
+#  if GTEST_OS_LINUX
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(
+      sigaction(SIGPROF, &saved_sigprof_action, NULL));
+#  endif  // GTEST_OS_LINUX
+
+  GTEST_DEATH_TEST_CHECK_(child_pid != -1);
+  return child_pid;
+}
+
+// The AssumeRole process for a fork-and-exec death test.  It re-executes the
+// main program from the beginning, setting the --gtest_filter
+// and --gtest_internal_run_death_test flags to cause only the current
+// death test to be re-run.
+DeathTest::TestRole ExecDeathTest::AssumeRole() {
+  const UnitTestImpl* const impl = GetUnitTestImpl();
+  const InternalRunDeathTestFlag* const flag =
+      impl->internal_run_death_test_flag();
+  const TestInfo* const info = impl->current_test_info();
+  const int death_test_index = info->result()->death_test_count();
+
+  if (flag != NULL) {
+    set_write_fd(flag->write_fd());
+    return EXECUTE_TEST;
+  }
+
+  int pipe_fd[2];
+  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
+  // Clear the close-on-exec flag on the write end of the pipe, lest
+  // it be closed when the child process does an exec:
+  GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+
+  const std::string filter_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="
+      + info->test_case_name() + "." + info->name();
+  const std::string internal_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
+      + file_ + "|" + StreamableToString(line_) + "|"
+      + StreamableToString(death_test_index) + "|"
+      + StreamableToString(pipe_fd[1]);
+  Arguments args;
+  args.AddArguments(GetArgvsForDeathTestChildProcess());
+  args.AddArgument(filter_flag.c_str());
+  args.AddArgument(internal_flag.c_str());
+
+  DeathTest::set_last_death_test_message("");
+
+  CaptureStderr();
+  // See the comment in NoExecDeathTest::AssumeRole for why the next line
+  // is necessary.
+  FlushInfoLog();
+
+  const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
+  set_child_pid(child_pid);
+  set_read_fd(pipe_fd[0]);
+  set_spawned(true);
+  return OVERSEE_TEST;
+}
+
+# endif  // !GTEST_OS_WINDOWS
+
+// Creates a concrete DeathTest-derived class that depends on the
+// --gtest_death_test_style flag, and sets the pointer pointed to
+// by the "test" argument to its address.  If the test should be
+// skipped, sets that pointer to NULL.  Returns true, unless the
+// flag is set to an invalid value.
+bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
+                                     const char* file, int line,
+                                     DeathTest** test) {
+  UnitTestImpl* const impl = GetUnitTestImpl();
+  const InternalRunDeathTestFlag* const flag =
+      impl->internal_run_death_test_flag();
+  const int death_test_index = impl->current_test_info()
+      ->increment_death_test_count();
+
+  if (flag != NULL) {
+    if (death_test_index > flag->index()) {
+      DeathTest::set_last_death_test_message(
+          "Death test count (" + StreamableToString(death_test_index)
+          + ") somehow exceeded expected maximum ("
+          + StreamableToString(flag->index()) + ")");
+      return false;
+    }
+
+    if (!(flag->file() == file && flag->line() == line &&
+          flag->index() == death_test_index)) {
+      *test = NULL;
+      return true;
+    }
+  }
+
+# if GTEST_OS_WINDOWS
+
+  if (GTEST_FLAG(death_test_style) == "threadsafe" ||
+      GTEST_FLAG(death_test_style) == "fast") {
+    *test = new WindowsDeathTest(statement, regex, file, line);
+  }
+
+# else
+
+  if (GTEST_FLAG(death_test_style) == "threadsafe") {
+    *test = new ExecDeathTest(statement, regex, file, line);
+  } else if (GTEST_FLAG(death_test_style) == "fast") {
+    *test = new NoExecDeathTest(statement, regex);
+  }
+
+# endif  // GTEST_OS_WINDOWS
+
+  else {  // NOLINT - this is more readable than unbalanced brackets inside #if.
+    DeathTest::set_last_death_test_message(
+        "Unknown death test style \"" + GTEST_FLAG(death_test_style)
+        + "\" encountered");
+    return false;
+  }
+
+  return true;
+}
+
+# if GTEST_OS_WINDOWS
+// Recreates the pipe and event handles from the provided parameters,
+// signals the event, and returns a file descriptor wrapped around the pipe
+// handle. This function is called in the child process only.
+int GetStatusFileDescriptor(unsigned int parent_process_id,
+                            size_t write_handle_as_size_t,
+                            size_t event_handle_as_size_t) {
+  AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
+                                                   FALSE,  // Non-inheritable.
+                                                   parent_process_id));
+  if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
+    DeathTestAbort("Unable to open parent process " +
+                   StreamableToString(parent_process_id));
+  }
+
+  // TODO(vladl@google.com): Replace the following check with a
+  // compile-time assertion when available.
+  GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
+
+  const HANDLE write_handle =
+      reinterpret_cast<HANDLE>(write_handle_as_size_t);
+  HANDLE dup_write_handle;
+
+  // The newly initialized handle is accessible only in in the parent
+  // process. To obtain one accessible within the child, we need to use
+  // DuplicateHandle.
+  if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
+                         ::GetCurrentProcess(), &dup_write_handle,
+                         0x0,    // Requested privileges ignored since
+                                 // DUPLICATE_SAME_ACCESS is used.
+                         FALSE,  // Request non-inheritable handler.
+                         DUPLICATE_SAME_ACCESS)) {
+    DeathTestAbort("Unable to duplicate the pipe handle " +
+                   StreamableToString(write_handle_as_size_t) +
+                   " from the parent process " +
+                   StreamableToString(parent_process_id));
+  }
+
+  const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);
+  HANDLE dup_event_handle;
+
+  if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
+                         ::GetCurrentProcess(), &dup_event_handle,
+                         0x0,
+                         FALSE,
+                         DUPLICATE_SAME_ACCESS)) {
+    DeathTestAbort("Unable to duplicate the event handle " +
+                   StreamableToString(event_handle_as_size_t) +
+                   " from the parent process " +
+                   StreamableToString(parent_process_id));
+  }
+
+  const int write_fd =
+      ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);
+  if (write_fd == -1) {
+    DeathTestAbort("Unable to convert pipe handle " +
+                   StreamableToString(write_handle_as_size_t) +
+                   " to a file descriptor");
+  }
+
+  // Signals the parent that the write end of the pipe has been acquired
+  // so the parent can release its own write end.
+  ::SetEvent(dup_event_handle);
+
+  return write_fd;
+}
+# endif  // GTEST_OS_WINDOWS
+
+// Returns a newly created InternalRunDeathTestFlag object with fields
+// initialized from the GTEST_FLAG(internal_run_death_test) flag if
+// the flag is specified; otherwise returns NULL.
+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
+  if (GTEST_FLAG(internal_run_death_test) == "") return NULL;
+
+  // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
+  // can use it here.
+  int line = -1;
+  int index = -1;
+  ::std::vector< ::std::string> fields;
+  SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);
+  int write_fd = -1;
+
+# if GTEST_OS_WINDOWS
+
+  unsigned int parent_process_id = 0;
+  size_t write_handle_as_size_t = 0;
+  size_t event_handle_as_size_t = 0;
+
+  if (fields.size() != 6
+      || !ParseNaturalNumber(fields[1], &line)
+      || !ParseNaturalNumber(fields[2], &index)
+      || !ParseNaturalNumber(fields[3], &parent_process_id)
+      || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)
+      || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
+    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
+                   GTEST_FLAG(internal_run_death_test));
+  }
+  write_fd = GetStatusFileDescriptor(parent_process_id,
+                                     write_handle_as_size_t,
+                                     event_handle_as_size_t);
+# else
+
+  if (fields.size() != 4
+      || !ParseNaturalNumber(fields[1], &line)
+      || !ParseNaturalNumber(fields[2], &index)
+      || !ParseNaturalNumber(fields[3], &write_fd)) {
+    DeathTestAbort("Bad --gtest_internal_run_death_test flag: "
+        + GTEST_FLAG(internal_run_death_test));
+  }
+
+# endif  // GTEST_OS_WINDOWS
+
+  return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
+}
+
+}  // namespace internal
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-filepath.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-filepath.cc
new file mode 100644
index 0000000..0292dc1
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-filepath.cc
@@ -0,0 +1,387 @@
+// 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.
+//
+// Authors: keith.ray@gmail.com (Keith Ray)
+
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-filepath.h"
+#include "gtest/internal/gtest-port.h"
+
+#include <stdlib.h>
+
+#if GTEST_OS_WINDOWS_MOBILE
+# include <windows.h>
+#elif GTEST_OS_WINDOWS
+# include <direct.h>
+# include <io.h>
+#elif GTEST_OS_SYMBIAN
+// Symbian OpenC has PATH_MAX in sys/syslimits.h
+# include <sys/syslimits.h>
+#else
+# include <limits.h>
+# include <climits>  // Some Linux distributions define PATH_MAX here.
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+#if GTEST_OS_WINDOWS
+# define GTEST_PATH_MAX_ _MAX_PATH
+#elif defined(PATH_MAX)
+# define GTEST_PATH_MAX_ PATH_MAX
+#elif defined(_XOPEN_PATH_MAX)
+# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
+#else
+# define GTEST_PATH_MAX_ _POSIX_PATH_MAX
+#endif  // GTEST_OS_WINDOWS
+
+#include "gtest/internal/gtest-string.h"
+
+namespace testing {
+namespace internal {
+
+#if GTEST_OS_WINDOWS
+// On Windows, '\\' is the standard path separator, but many tools and the
+// Windows API also accept '/' as an alternate path separator. Unless otherwise
+// noted, a file path can contain either kind of path separators, or a mixture
+// of them.
+const char kPathSeparator = '\\';
+const char kAlternatePathSeparator = '/';
+const char kAlternatePathSeparatorString[] = "/";
+# if GTEST_OS_WINDOWS_MOBILE
+// Windows CE doesn't have a current directory. You should not use
+// the current directory in tests on Windows CE, but this at least
+// provides a reasonable fallback.
+const char kCurrentDirectoryString[] = "\\";
+// Windows CE doesn't define INVALID_FILE_ATTRIBUTES
+const DWORD kInvalidFileAttributes = 0xffffffff;
+# else
+const char kCurrentDirectoryString[] = ".\\";
+# endif  // GTEST_OS_WINDOWS_MOBILE
+#else
+const char kPathSeparator = '/';
+const char kCurrentDirectoryString[] = "./";
+#endif  // GTEST_OS_WINDOWS
+
+// Returns whether the given character is a valid path separator.
+static bool IsPathSeparator(char c) {
+#if GTEST_HAS_ALT_PATH_SEP_
+  return (c == kPathSeparator) || (c == kAlternatePathSeparator);
+#else
+  return c == kPathSeparator;
+#endif
+}
+
+// Returns the current working directory, or "" if unsuccessful.
+FilePath FilePath::GetCurrentDir() {
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+  // Windows CE doesn't have a current directory, so we just return
+  // something reasonable.
+  return FilePath(kCurrentDirectoryString);
+#elif GTEST_OS_WINDOWS
+  char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
+  return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
+#else
+  char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
+  char* result = getcwd(cwd, sizeof(cwd));
+# if GTEST_OS_NACL
+  // getcwd will likely fail in NaCl due to the sandbox, so return something
+  // reasonable. The user may have provided a shim implementation for getcwd,
+  // however, so fallback only when failure is detected.
+  return FilePath(result == NULL ? kCurrentDirectoryString : cwd);
+# endif  // GTEST_OS_NACL
+  return FilePath(result == NULL ? "" : cwd);
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+// Returns a copy of the FilePath with the case-insensitive extension removed.
+// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
+// FilePath("dir/file"). If a case-insensitive extension is not
+// found, returns a copy of the original FilePath.
+FilePath FilePath::RemoveExtension(const char* extension) const {
+  const std::string dot_extension = std::string(".") + extension;
+  if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {
+    return FilePath(pathname_.substr(
+        0, pathname_.length() - dot_extension.length()));
+  }
+  return *this;
+}
+
+// Returns a pointer to the last occurence of a valid path separator in
+// the FilePath. On Windows, for example, both '/' and '\' are valid path
+// separators. Returns NULL if no path separator was found.
+const char* FilePath::FindLastPathSeparator() const {
+  const char* const last_sep = strrchr(c_str(), kPathSeparator);
+#if GTEST_HAS_ALT_PATH_SEP_
+  const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
+  // Comparing two pointers of which only one is NULL is undefined.
+  if (last_alt_sep != NULL &&
+      (last_sep == NULL || last_alt_sep > last_sep)) {
+    return last_alt_sep;
+  }
+#endif
+  return last_sep;
+}
+
+// Returns a copy of the FilePath with the directory part removed.
+// Example: FilePath("path/to/file").RemoveDirectoryName() returns
+// FilePath("file"). If there is no directory part ("just_a_file"), it returns
+// the FilePath unmodified. If there is no file part ("just_a_dir/") it
+// returns an empty FilePath ("").
+// On Windows platform, '\' is the path separator, otherwise it is '/'.
+FilePath FilePath::RemoveDirectoryName() const {
+  const char* const last_sep = FindLastPathSeparator();
+  return last_sep ? FilePath(last_sep + 1) : *this;
+}
+
+// RemoveFileName returns the directory path with the filename removed.
+// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
+// If the FilePath is "a_file" or "/a_file", RemoveFileName returns
+// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
+// not have a file, like "just/a/dir/", it returns the FilePath unmodified.
+// On Windows platform, '\' is the path separator, otherwise it is '/'.
+FilePath FilePath::RemoveFileName() const {
+  const char* const last_sep = FindLastPathSeparator();
+  std::string dir;
+  if (last_sep) {
+    dir = std::string(c_str(), last_sep + 1 - c_str());
+  } else {
+    dir = kCurrentDirectoryString;
+  }
+  return FilePath(dir);
+}
+
+// Helper functions for naming files in a directory for xml output.
+
+// Given directory = "dir", base_name = "test", number = 0,
+// extension = "xml", returns "dir/test.xml". If number is greater
+// than zero (e.g., 12), returns "dir/test_12.xml".
+// On Windows platform, uses \ as the separator rather than /.
+FilePath FilePath::MakeFileName(const FilePath& directory,
+                                const FilePath& base_name,
+                                int number,
+                                const char* extension) {
+  std::string file;
+  if (number == 0) {
+    file = base_name.string() + "." + extension;
+  } else {
+    file = base_name.string() + "_" + StreamableToString(number)
+        + "." + extension;
+  }
+  return ConcatPaths(directory, FilePath(file));
+}
+
+// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
+// On Windows, uses \ as the separator rather than /.
+FilePath FilePath::ConcatPaths(const FilePath& directory,
+                               const FilePath& relative_path) {
+  if (directory.IsEmpty())
+    return relative_path;
+  const FilePath dir(directory.RemoveTrailingPathSeparator());
+  return FilePath(dir.string() + kPathSeparator + relative_path.string());
+}
+
+// Returns true if pathname describes something findable in the file-system,
+// either a file, directory, or whatever.
+bool FilePath::FileOrDirectoryExists() const {
+#if GTEST_OS_WINDOWS_MOBILE
+  LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
+  const DWORD attributes = GetFileAttributes(unicode);
+  delete [] unicode;
+  return attributes != kInvalidFileAttributes;
+#else
+  posix::StatStruct file_stat;
+  return posix::Stat(pathname_.c_str(), &file_stat) == 0;
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+// Returns true if pathname describes a directory in the file-system
+// that exists.
+bool FilePath::DirectoryExists() const {
+  bool result = false;
+#if GTEST_OS_WINDOWS
+  // Don't strip off trailing separator if path is a root directory on
+  // Windows (like "C:\\").
+  const FilePath& path(IsRootDirectory() ? *this :
+                                           RemoveTrailingPathSeparator());
+#else
+  const FilePath& path(*this);
+#endif
+
+#if GTEST_OS_WINDOWS_MOBILE
+  LPCWSTR unicode = String::AnsiToUtf16(path.c_str());
+  const DWORD attributes = GetFileAttributes(unicode);
+  delete [] unicode;
+  if ((attributes != kInvalidFileAttributes) &&
+      (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
+    result = true;
+  }
+#else
+  posix::StatStruct file_stat;
+  result = posix::Stat(path.c_str(), &file_stat) == 0 &&
+      posix::IsDir(file_stat);
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+  return result;
+}
+
+// Returns true if pathname describes a root directory. (Windows has one
+// root directory per disk drive.)
+bool FilePath::IsRootDirectory() const {
+#if GTEST_OS_WINDOWS
+  // TODO(wan@google.com): on Windows a network share like
+  // \\server\share can be a root directory, although it cannot be the
+  // current directory.  Handle this properly.
+  return pathname_.length() == 3 && IsAbsolutePath();
+#else
+  return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
+#endif
+}
+
+// Returns true if pathname describes an absolute path.
+bool FilePath::IsAbsolutePath() const {
+  const char* const name = pathname_.c_str();
+#if GTEST_OS_WINDOWS
+  return pathname_.length() >= 3 &&
+     ((name[0] >= 'a' && name[0] <= 'z') ||
+      (name[0] >= 'A' && name[0] <= 'Z')) &&
+     name[1] == ':' &&
+     IsPathSeparator(name[2]);
+#else
+  return IsPathSeparator(name[0]);
+#endif
+}
+
+// Returns a pathname for a file that does not currently exist. The pathname
+// will be directory/base_name.extension or
+// directory/base_name_<number>.extension if directory/base_name.extension
+// already exists. The number will be incremented until a pathname is found
+// that does not already exist.
+// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
+// There could be a race condition if two or more processes are calling this
+// function at the same time -- they could both pick the same filename.
+FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
+                                          const FilePath& base_name,
+                                          const char* extension) {
+  FilePath full_pathname;
+  int number = 0;
+  do {
+    full_pathname.Set(MakeFileName(directory, base_name, number++, extension));
+  } while (full_pathname.FileOrDirectoryExists());
+  return full_pathname;
+}
+
+// Returns true if FilePath ends with a path separator, which indicates that
+// it is intended to represent a directory. Returns false otherwise.
+// This does NOT check that a directory (or file) actually exists.
+bool FilePath::IsDirectory() const {
+  return !pathname_.empty() &&
+         IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);
+}
+
+// Create directories so that path exists. Returns true if successful or if
+// the directories already exist; returns false if unable to create directories
+// for any reason.
+bool FilePath::CreateDirectoriesRecursively() const {
+  if (!this->IsDirectory()) {
+    return false;
+  }
+
+  if (pathname_.length() == 0 || this->DirectoryExists()) {
+    return true;
+  }
+
+  const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
+  return parent.CreateDirectoriesRecursively() && this->CreateFolder();
+}
+
+// Create the directory so that path exists. Returns true if successful or
+// if the directory already exists; returns false if unable to create the
+// directory for any reason, including if the parent directory does not
+// exist. Not named "CreateDirectory" because that's a macro on Windows.
+bool FilePath::CreateFolder() const {
+#if GTEST_OS_WINDOWS_MOBILE
+  FilePath removed_sep(this->RemoveTrailingPathSeparator());
+  LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
+  int result = CreateDirectory(unicode, NULL) ? 0 : -1;
+  delete [] unicode;
+#elif GTEST_OS_WINDOWS
+  int result = _mkdir(pathname_.c_str());
+#else
+  int result = mkdir(pathname_.c_str(), 0777);
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+  if (result == -1) {
+    return this->DirectoryExists();  // An error is OK if the directory exists.
+  }
+  return true;  // No error.
+}
+
+// If input name has a trailing separator character, remove it and return the
+// name, otherwise return the name string unmodified.
+// On Windows platform, uses \ as the separator, other platforms use /.
+FilePath FilePath::RemoveTrailingPathSeparator() const {
+  return IsDirectory()
+      ? FilePath(pathname_.substr(0, pathname_.length() - 1))
+      : *this;
+}
+
+// Removes any redundant separators that might be in the pathname.
+// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
+// redundancies that might be in a pathname involving "." or "..".
+// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
+void FilePath::Normalize() {
+  if (pathname_.c_str() == NULL) {
+    pathname_ = "";
+    return;
+  }
+  const char* src = pathname_.c_str();
+  char* const dest = new char[pathname_.length() + 1];
+  char* dest_ptr = dest;
+  memset(dest_ptr, 0, pathname_.length() + 1);
+
+  while (*src != '\0') {
+    *dest_ptr = *src;
+    if (!IsPathSeparator(*src)) {
+      src++;
+    } else {
+#if GTEST_HAS_ALT_PATH_SEP_
+      if (*dest_ptr == kAlternatePathSeparator) {
+        *dest_ptr = kPathSeparator;
+      }
+#endif
+      while (IsPathSeparator(*src))
+        src++;
+    }
+    dest_ptr++;
+  }
+  *dest_ptr = '\0';
+  pathname_ = dest;
+  delete[] dest;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-internal-inl.h b/third_party/ntcore_2018/gmock/gtest/src/gtest-internal-inl.h
new file mode 100644
index 0000000..ed8a682
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-internal-inl.h
@@ -0,0 +1,1183 @@
+// Copyright 2005, 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.
+
+// Utility functions and classes used by the Google C++ testing framework.
+//
+// Author: wan@google.com (Zhanyong Wan)
+//
+// This file contains purely Google Test's internal implementation.  Please
+// DO NOT #INCLUDE IT IN A USER PROGRAM.
+
+#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
+#define GTEST_SRC_GTEST_INTERNAL_INL_H_
+
+// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
+// part of Google Test's implementation; otherwise it's undefined.
+#if !GTEST_IMPLEMENTATION_
+// If this file is included from the user's code, just say no.
+# error "gtest-internal-inl.h is part of Google Test's internal implementation."
+# error "It must not be included except by Google Test itself."
+#endif  // GTEST_IMPLEMENTATION_
+
+#ifndef _WIN32_WCE
+# include <errno.h>
+#endif  // !_WIN32_WCE
+#include <stddef.h>
+#include <stdlib.h>  // For strtoll/_strtoul64/malloc/free.
+#include <string.h>  // For memmove.
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_CAN_STREAM_RESULTS_
+# include <arpa/inet.h>  // NOLINT
+# include <netdb.h>  // NOLINT
+#endif
+
+#if GTEST_OS_WINDOWS
+# include <windows.h>  // NOLINT
+#endif  // GTEST_OS_WINDOWS
+
+#include "gtest/gtest.h"  // NOLINT
+#include "gtest/gtest-spi.h"
+
+namespace testing {
+
+// Declares the flags.
+//
+// We don't want the users to modify this flag in the code, but want
+// Google Test's own unit tests to be able to access it. Therefore we
+// declare it here as opposed to in gtest.h.
+GTEST_DECLARE_bool_(death_test_use_fork);
+
+namespace internal {
+
+// The value of GetTestTypeId() as seen from within the Google Test
+// library.  This is solely for testing GetTestTypeId().
+GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;
+
+// Names of the flags (needed for parsing Google Test flags).
+const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests";
+const char kBreakOnFailureFlag[] = "break_on_failure";
+const char kCatchExceptionsFlag[] = "catch_exceptions";
+const char kColorFlag[] = "color";
+const char kFilterFlag[] = "filter";
+const char kListTestsFlag[] = "list_tests";
+const char kOutputFlag[] = "output";
+const char kPrintTimeFlag[] = "print_time";
+const char kRandomSeedFlag[] = "random_seed";
+const char kRepeatFlag[] = "repeat";
+const char kShuffleFlag[] = "shuffle";
+const char kStackTraceDepthFlag[] = "stack_trace_depth";
+const char kStreamResultToFlag[] = "stream_result_to";
+const char kThrowOnFailureFlag[] = "throw_on_failure";
+const char kFlagfileFlag[] = "flagfile";
+
+// A valid random seed must be in [1, kMaxRandomSeed].
+const int kMaxRandomSeed = 99999;
+
+// g_help_flag is true iff the --help flag or an equivalent form is
+// specified on the command line.
+GTEST_API_ extern bool g_help_flag;
+
+// Returns the current time in milliseconds.
+GTEST_API_ TimeInMillis GetTimeInMillis();
+
+// Returns true iff Google Test should use colors in the output.
+GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
+
+// Formats the given time in milliseconds as seconds.
+GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
+
+// Converts the given time in milliseconds to a date string in the ISO 8601
+// format, without the timezone information.  N.B.: due to the use the
+// non-reentrant localtime() function, this function is not thread safe.  Do
+// not use it in any code that can be called from multiple threads.
+GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
+
+// Parses a string for an Int32 flag, in the form of "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+GTEST_API_ bool ParseInt32Flag(
+    const char* str, const char* flag, Int32* value);
+
+// Returns a random seed in range [1, kMaxRandomSeed] based on the
+// given --gtest_random_seed flag value.
+inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
+  const unsigned int raw_seed = (random_seed_flag == 0) ?
+      static_cast<unsigned int>(GetTimeInMillis()) :
+      static_cast<unsigned int>(random_seed_flag);
+
+  // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
+  // it's easy to type.
+  const int normalized_seed =
+      static_cast<int>((raw_seed - 1U) %
+                       static_cast<unsigned int>(kMaxRandomSeed)) + 1;
+  return normalized_seed;
+}
+
+// Returns the first valid random seed after 'seed'.  The behavior is
+// undefined if 'seed' is invalid.  The seed after kMaxRandomSeed is
+// considered to be 1.
+inline int GetNextRandomSeed(int seed) {
+  GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
+      << "Invalid random seed " << seed << " - must be in [1, "
+      << kMaxRandomSeed << "].";
+  const int next_seed = seed + 1;
+  return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
+}
+
+// This class saves the values of all Google Test flags in its c'tor, and
+// restores them in its d'tor.
+class GTestFlagSaver {
+ public:
+  // The c'tor.
+  GTestFlagSaver() {
+    also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
+    break_on_failure_ = GTEST_FLAG(break_on_failure);
+    catch_exceptions_ = GTEST_FLAG(catch_exceptions);
+    color_ = GTEST_FLAG(color);
+    death_test_style_ = GTEST_FLAG(death_test_style);
+    death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
+    filter_ = GTEST_FLAG(filter);
+    internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
+    list_tests_ = GTEST_FLAG(list_tests);
+    output_ = GTEST_FLAG(output);
+    print_time_ = GTEST_FLAG(print_time);
+    random_seed_ = GTEST_FLAG(random_seed);
+    repeat_ = GTEST_FLAG(repeat);
+    shuffle_ = GTEST_FLAG(shuffle);
+    stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
+    stream_result_to_ = GTEST_FLAG(stream_result_to);
+    throw_on_failure_ = GTEST_FLAG(throw_on_failure);
+  }
+
+  // The d'tor is not virtual.  DO NOT INHERIT FROM THIS CLASS.
+  ~GTestFlagSaver() {
+    GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
+    GTEST_FLAG(break_on_failure) = break_on_failure_;
+    GTEST_FLAG(catch_exceptions) = catch_exceptions_;
+    GTEST_FLAG(color) = color_;
+    GTEST_FLAG(death_test_style) = death_test_style_;
+    GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
+    GTEST_FLAG(filter) = filter_;
+    GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
+    GTEST_FLAG(list_tests) = list_tests_;
+    GTEST_FLAG(output) = output_;
+    GTEST_FLAG(print_time) = print_time_;
+    GTEST_FLAG(random_seed) = random_seed_;
+    GTEST_FLAG(repeat) = repeat_;
+    GTEST_FLAG(shuffle) = shuffle_;
+    GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
+    GTEST_FLAG(stream_result_to) = stream_result_to_;
+    GTEST_FLAG(throw_on_failure) = throw_on_failure_;
+  }
+
+ private:
+  // Fields for saving the original values of flags.
+  bool also_run_disabled_tests_;
+  bool break_on_failure_;
+  bool catch_exceptions_;
+  std::string color_;
+  std::string death_test_style_;
+  bool death_test_use_fork_;
+  std::string filter_;
+  std::string internal_run_death_test_;
+  bool list_tests_;
+  std::string output_;
+  bool print_time_;
+  internal::Int32 random_seed_;
+  internal::Int32 repeat_;
+  bool shuffle_;
+  internal::Int32 stack_trace_depth_;
+  std::string stream_result_to_;
+  bool throw_on_failure_;
+} GTEST_ATTRIBUTE_UNUSED_;
+
+// Converts a Unicode code point to a narrow string in UTF-8 encoding.
+// code_point parameter is of type UInt32 because wchar_t may not be
+// wide enough to contain a code point.
+// If the code_point is not a valid Unicode code point
+// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
+// to "(Invalid Unicode 0xXXXXXXXX)".
+GTEST_API_ std::string CodePointToUtf8(UInt32 code_point);
+
+// Converts a wide string to a narrow string in UTF-8 encoding.
+// The wide string is assumed to have the following encoding:
+//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
+//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
+// Parameter str points to a null-terminated wide string.
+// Parameter num_chars may additionally limit the number
+// of wchar_t characters processed. -1 is used when the entire string
+// should be processed.
+// If the string contains code points that are not valid Unicode code points
+// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
+// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
+// and contains invalid UTF-16 surrogate pairs, values in those pairs
+// will be encoded as individual Unicode characters from Basic Normal Plane.
+GTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars);
+
+// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
+// if the variable is present. If a file already exists at this location, this
+// function will write over it. If the variable is present, but the file cannot
+// be created, prints an error and exits.
+void WriteToShardStatusFileIfNeeded();
+
+// Checks whether sharding is enabled by examining the relevant
+// environment variable values. If the variables are present,
+// but inconsistent (e.g., shard_index >= total_shards), prints
+// an error and exits. If in_subprocess_for_death_test, sharding is
+// disabled because it must only be applied to the original test
+// process. Otherwise, we could filter out death tests we intended to execute.
+GTEST_API_ bool ShouldShard(const char* total_shards_str,
+                            const char* shard_index_str,
+                            bool in_subprocess_for_death_test);
+
+// Parses the environment variable var as an Int32. If it is unset,
+// returns default_val. If it is not an Int32, prints an error and
+// and aborts.
+GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);
+
+// Given the total number of shards, the shard index, and the test id,
+// returns true iff the test should be run on this shard. The test id is
+// some arbitrary but unique non-negative integer assigned to each test
+// method. Assumes that 0 <= shard_index < total_shards.
+GTEST_API_ bool ShouldRunTestOnShard(
+    int total_shards, int shard_index, int test_id);
+
+// STL container utilities.
+
+// Returns the number of elements in the given container that satisfy
+// the given predicate.
+template <class Container, typename Predicate>
+inline int CountIf(const Container& c, Predicate predicate) {
+  // Implemented as an explicit loop since std::count_if() in libCstd on
+  // Solaris has a non-standard signature.
+  int count = 0;
+  for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {
+    if (predicate(*it))
+      ++count;
+  }
+  return count;
+}
+
+// Applies a function/functor to each element in the container.
+template <class Container, typename Functor>
+void ForEach(const Container& c, Functor functor) {
+  std::for_each(c.begin(), c.end(), functor);
+}
+
+// Returns the i-th element of the vector, or default_value if i is not
+// in range [0, v.size()).
+template <typename E>
+inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
+  return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
+}
+
+// Performs an in-place shuffle of a range of the vector's elements.
+// 'begin' and 'end' are element indices as an STL-style range;
+// i.e. [begin, end) are shuffled, where 'end' == size() means to
+// shuffle to the end of the vector.
+template <typename E>
+void ShuffleRange(internal::Random* random, int begin, int end,
+                  std::vector<E>* v) {
+  const int size = static_cast<int>(v->size());
+  GTEST_CHECK_(0 <= begin && begin <= size)
+      << "Invalid shuffle range start " << begin << ": must be in range [0, "
+      << size << "].";
+  GTEST_CHECK_(begin <= end && end <= size)
+      << "Invalid shuffle range finish " << end << ": must be in range ["
+      << begin << ", " << size << "].";
+
+  // Fisher-Yates shuffle, from
+  // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
+  for (int range_width = end - begin; range_width >= 2; range_width--) {
+    const int last_in_range = begin + range_width - 1;
+    const int selected = begin + random->Generate(range_width);
+    std::swap((*v)[selected], (*v)[last_in_range]);
+  }
+}
+
+// Performs an in-place shuffle of the vector's elements.
+template <typename E>
+inline void Shuffle(internal::Random* random, std::vector<E>* v) {
+  ShuffleRange(random, 0, static_cast<int>(v->size()), v);
+}
+
+// A function for deleting an object.  Handy for being used as a
+// functor.
+template <typename T>
+static void Delete(T* x) {
+  delete x;
+}
+
+// A predicate that checks the key of a TestProperty against a known key.
+//
+// TestPropertyKeyIs is copyable.
+class TestPropertyKeyIs {
+ public:
+  // Constructor.
+  //
+  // TestPropertyKeyIs has NO default constructor.
+  explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
+
+  // Returns true iff the test name of test property matches on key_.
+  bool operator()(const TestProperty& test_property) const {
+    return test_property.key() == key_;
+  }
+
+ private:
+  std::string key_;
+};
+
+// Class UnitTestOptions.
+//
+// This class contains functions for processing options the user
+// specifies when running the tests.  It has only static members.
+//
+// In most cases, the user can specify an option using either an
+// environment variable or a command line flag.  E.g. you can set the
+// test filter using either GTEST_FILTER or --gtest_filter.  If both
+// the variable and the flag are present, the latter overrides the
+// former.
+class GTEST_API_ UnitTestOptions {
+ public:
+  // Functions for processing the gtest_output flag.
+
+  // Returns the output format, or "" for normal printed output.
+  static std::string GetOutputFormat();
+
+  // Returns the absolute path of the requested output file, or the
+  // default (test_detail.xml in the original working directory) if
+  // none was explicitly specified.
+  static std::string GetAbsolutePathToOutputFile();
+
+  // Functions for processing the gtest_filter flag.
+
+  // Returns true iff the wildcard pattern matches the string.  The
+  // first ':' or '\0' character in pattern marks the end of it.
+  //
+  // This recursive algorithm isn't very efficient, but is clear and
+  // works well enough for matching test names, which are short.
+  static bool PatternMatchesString(const char *pattern, const char *str);
+
+  // Returns true iff the user-specified filter matches the test case
+  // name and the test name.
+  static bool FilterMatchesTest(const std::string &test_case_name,
+                                const std::string &test_name);
+
+#if GTEST_OS_WINDOWS
+  // Function for supporting the gtest_catch_exception flag.
+
+  // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
+  // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
+  // This function is useful as an __except condition.
+  static int GTestShouldProcessSEH(DWORD exception_code);
+#endif  // GTEST_OS_WINDOWS
+
+  // Returns true if "name" matches the ':' separated list of glob-style
+  // filters in "filter".
+  static bool MatchesFilter(const std::string& name, const char* filter);
+};
+
+// Returns the current application's name, removing directory path if that
+// is present.  Used by UnitTestOptions::GetOutputFile.
+GTEST_API_ FilePath GetCurrentExecutableName();
+
+// The role interface for getting the OS stack trace as a string.
+class OsStackTraceGetterInterface {
+ public:
+  OsStackTraceGetterInterface() {}
+  virtual ~OsStackTraceGetterInterface() {}
+
+  // Returns the current OS stack trace as an std::string.  Parameters:
+  //
+  //   max_depth  - the maximum number of stack frames to be included
+  //                in the trace.
+  //   skip_count - the number of top frames to be skipped; doesn't count
+  //                against max_depth.
+  virtual string CurrentStackTrace(int max_depth, int skip_count) = 0;
+
+  // UponLeavingGTest() should be called immediately before Google Test calls
+  // user code. It saves some information about the current stack that
+  // CurrentStackTrace() will use to find and hide Google Test stack frames.
+  virtual void UponLeavingGTest() = 0;
+
+  // This string is inserted in place of stack frames that are part of
+  // Google Test's implementation.
+  static const char* const kElidedFramesMarker;
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
+};
+
+// A working implementation of the OsStackTraceGetterInterface interface.
+class OsStackTraceGetter : public OsStackTraceGetterInterface {
+ public:
+  OsStackTraceGetter() {}
+
+  virtual string CurrentStackTrace(int max_depth, int skip_count);
+  virtual void UponLeavingGTest();
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
+};
+
+// Information about a Google Test trace point.
+struct TraceInfo {
+  const char* file;
+  int line;
+  std::string message;
+};
+
+// This is the default global test part result reporter used in UnitTestImpl.
+// This class should only be used by UnitTestImpl.
+class DefaultGlobalTestPartResultReporter
+  : public TestPartResultReporterInterface {
+ public:
+  explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
+  // Implements the TestPartResultReporterInterface. Reports the test part
+  // result in the current test.
+  virtual void ReportTestPartResult(const TestPartResult& result);
+
+ private:
+  UnitTestImpl* const unit_test_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
+};
+
+// This is the default per thread test part result reporter used in
+// UnitTestImpl. This class should only be used by UnitTestImpl.
+class DefaultPerThreadTestPartResultReporter
+    : public TestPartResultReporterInterface {
+ public:
+  explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
+  // Implements the TestPartResultReporterInterface. The implementation just
+  // delegates to the current global test part result reporter of *unit_test_.
+  virtual void ReportTestPartResult(const TestPartResult& result);
+
+ private:
+  UnitTestImpl* const unit_test_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
+};
+
+// The private implementation of the UnitTest class.  We don't protect
+// the methods under a mutex, as this class is not accessible by a
+// user and the UnitTest class that delegates work to this class does
+// proper locking.
+class GTEST_API_ UnitTestImpl {
+ public:
+  explicit UnitTestImpl(UnitTest* parent);
+  virtual ~UnitTestImpl();
+
+  // There are two different ways to register your own TestPartResultReporter.
+  // You can register your own repoter to listen either only for test results
+  // from the current thread or for results from all threads.
+  // By default, each per-thread test result repoter just passes a new
+  // TestPartResult to the global test result reporter, which registers the
+  // test part result for the currently running test.
+
+  // Returns the global test part result reporter.
+  TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
+
+  // Sets the global test part result reporter.
+  void SetGlobalTestPartResultReporter(
+      TestPartResultReporterInterface* reporter);
+
+  // Returns the test part result reporter for the current thread.
+  TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
+
+  // Sets the test part result reporter for the current thread.
+  void SetTestPartResultReporterForCurrentThread(
+      TestPartResultReporterInterface* reporter);
+
+  // Gets the number of successful test cases.
+  int successful_test_case_count() const;
+
+  // Gets the number of failed test cases.
+  int failed_test_case_count() const;
+
+  // Gets the number of all test cases.
+  int total_test_case_count() const;
+
+  // Gets the number of all test cases that contain at least one test
+  // that should run.
+  int test_case_to_run_count() const;
+
+  // Gets the number of successful tests.
+  int successful_test_count() const;
+
+  // Gets the number of failed tests.
+  int failed_test_count() const;
+
+  // Gets the number of disabled tests that will be reported in the XML report.
+  int reportable_disabled_test_count() const;
+
+  // Gets the number of disabled tests.
+  int disabled_test_count() const;
+
+  // Gets the number of tests to be printed in the XML report.
+  int reportable_test_count() const;
+
+  // Gets the number of all tests.
+  int total_test_count() const;
+
+  // Gets the number of tests that should run.
+  int test_to_run_count() const;
+
+  // Gets the time of the test program start, in ms from the start of the
+  // UNIX epoch.
+  TimeInMillis start_timestamp() const { return start_timestamp_; }
+
+  // Gets the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const { return elapsed_time_; }
+
+  // Returns true iff the unit test passed (i.e. all test cases passed).
+  bool Passed() const { return !Failed(); }
+
+  // Returns true iff the unit test failed (i.e. some test case failed
+  // or something outside of all tests failed).
+  bool Failed() const {
+    return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
+  }
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  const TestCase* GetTestCase(int i) const {
+    const int index = GetElementOr(test_case_indices_, i, -1);
+    return index < 0 ? NULL : test_cases_[i];
+  }
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  TestCase* GetMutableTestCase(int i) {
+    const int index = GetElementOr(test_case_indices_, i, -1);
+    return index < 0 ? NULL : test_cases_[index];
+  }
+
+  // Provides access to the event listener list.
+  TestEventListeners* listeners() { return &listeners_; }
+
+  // Returns the TestResult for the test that's currently running, or
+  // the TestResult for the ad hoc test if no test is running.
+  TestResult* current_test_result();
+
+  // Returns the TestResult for the ad hoc test.
+  const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }
+
+  // Sets the OS stack trace getter.
+  //
+  // Does nothing if the input and the current OS stack trace getter
+  // are the same; otherwise, deletes the old getter and makes the
+  // input the current getter.
+  void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
+
+  // Returns the current OS stack trace getter if it is not NULL;
+  // otherwise, creates an OsStackTraceGetter, makes it the current
+  // getter, and returns it.
+  OsStackTraceGetterInterface* os_stack_trace_getter();
+
+  // Returns the current OS stack trace as an std::string.
+  //
+  // The maximum number of stack frames to be included is specified by
+  // the gtest_stack_trace_depth flag.  The skip_count parameter
+  // specifies the number of top frames to be skipped, which doesn't
+  // count against the number of frames to be included.
+  //
+  // For example, if Foo() calls Bar(), which in turn calls
+  // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
+  // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
+  std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
+
+  // Finds and returns a TestCase with the given name.  If one doesn't
+  // exist, creates one and returns it.
+  //
+  // Arguments:
+  //
+  //   test_case_name: name of the test case
+  //   type_param:     the name of the test's type parameter, or NULL if
+  //                   this is not a typed or a type-parameterized test.
+  //   set_up_tc:      pointer to the function that sets up the test case
+  //   tear_down_tc:   pointer to the function that tears down the test case
+  TestCase* GetTestCase(const char* test_case_name,
+                        const char* type_param,
+                        Test::SetUpTestCaseFunc set_up_tc,
+                        Test::TearDownTestCaseFunc tear_down_tc);
+
+  // Adds a TestInfo to the unit test.
+  //
+  // Arguments:
+  //
+  //   set_up_tc:    pointer to the function that sets up the test case
+  //   tear_down_tc: pointer to the function that tears down the test case
+  //   test_info:    the TestInfo object
+  void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
+                   Test::TearDownTestCaseFunc tear_down_tc,
+                   TestInfo* test_info) {
+    // In order to support thread-safe death tests, we need to
+    // remember the original working directory when the test program
+    // was first invoked.  We cannot do this in RUN_ALL_TESTS(), as
+    // the user may have changed the current directory before calling
+    // RUN_ALL_TESTS().  Therefore we capture the current directory in
+    // AddTestInfo(), which is called to register a TEST or TEST_F
+    // before main() is reached.
+    if (original_working_dir_.IsEmpty()) {
+      original_working_dir_.Set(FilePath::GetCurrentDir());
+      GTEST_CHECK_(!original_working_dir_.IsEmpty())
+          << "Failed to get the current working directory.";
+    }
+
+    GetTestCase(test_info->test_case_name(),
+                test_info->type_param(),
+                set_up_tc,
+                tear_down_tc)->AddTestInfo(test_info);
+  }
+
+#if GTEST_HAS_PARAM_TEST
+  // Returns ParameterizedTestCaseRegistry object used to keep track of
+  // value-parameterized tests and instantiate and register them.
+  internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
+    return parameterized_test_registry_;
+  }
+#endif  // GTEST_HAS_PARAM_TEST
+
+  // Sets the TestCase object for the test that's currently running.
+  void set_current_test_case(TestCase* a_current_test_case) {
+    current_test_case_ = a_current_test_case;
+  }
+
+  // Sets the TestInfo object for the test that's currently running.  If
+  // current_test_info is NULL, the assertion results will be stored in
+  // ad_hoc_test_result_.
+  void set_current_test_info(TestInfo* a_current_test_info) {
+    current_test_info_ = a_current_test_info;
+  }
+
+  // Registers all parameterized tests defined using TEST_P and
+  // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
+  // combination. This method can be called more then once; it has guards
+  // protecting from registering the tests more then once.  If
+  // value-parameterized tests are disabled, RegisterParameterizedTests is
+  // present but does nothing.
+  void RegisterParameterizedTests();
+
+  // Runs all tests in this UnitTest object, prints the result, and
+  // returns true if all tests are successful.  If any exception is
+  // thrown during a test, this test is considered to be failed, but
+  // the rest of the tests will still be run.
+  bool RunAllTests();
+
+  // Clears the results of all tests, except the ad hoc tests.
+  void ClearNonAdHocTestResult() {
+    ForEach(test_cases_, TestCase::ClearTestCaseResult);
+  }
+
+  // Clears the results of ad-hoc test assertions.
+  void ClearAdHocTestResult() {
+    ad_hoc_test_result_.Clear();
+  }
+
+  // Adds a TestProperty to the current TestResult object when invoked in a
+  // context of a test or a test case, or to the global property set. If the
+  // result already contains a property with the same key, the value will be
+  // updated.
+  void RecordProperty(const TestProperty& test_property);
+
+  enum ReactionToSharding {
+    HONOR_SHARDING_PROTOCOL,
+    IGNORE_SHARDING_PROTOCOL
+  };
+
+  // Matches the full name of each test against the user-specified
+  // filter to decide whether the test should run, then records the
+  // result in each TestCase and TestInfo object.
+  // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
+  // based on sharding variables in the environment.
+  // Returns the number of tests that should run.
+  int FilterTests(ReactionToSharding shard_tests);
+
+  // Prints the names of the tests matching the user-specified filter flag.
+  void ListTestsMatchingFilter();
+
+  const TestCase* current_test_case() const { return current_test_case_; }
+  TestInfo* current_test_info() { return current_test_info_; }
+  const TestInfo* current_test_info() const { return current_test_info_; }
+
+  // Returns the vector of environments that need to be set-up/torn-down
+  // before/after the tests are run.
+  std::vector<Environment*>& environments() { return environments_; }
+
+  // Getters for the per-thread Google Test trace stack.
+  std::vector<TraceInfo>& gtest_trace_stack() {
+    return *(gtest_trace_stack_.pointer());
+  }
+  const std::vector<TraceInfo>& gtest_trace_stack() const {
+    return gtest_trace_stack_.get();
+  }
+
+#if GTEST_HAS_DEATH_TEST
+  void InitDeathTestSubprocessControlInfo() {
+    internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
+  }
+  // Returns a pointer to the parsed --gtest_internal_run_death_test
+  // flag, or NULL if that flag was not specified.
+  // This information is useful only in a death test child process.
+  // Must not be called before a call to InitGoogleTest.
+  const InternalRunDeathTestFlag* internal_run_death_test_flag() const {
+    return internal_run_death_test_flag_.get();
+  }
+
+  // Returns a pointer to the current death test factory.
+  internal::DeathTestFactory* death_test_factory() {
+    return death_test_factory_.get();
+  }
+
+  void SuppressTestEventsIfInSubprocess();
+
+  friend class ReplaceDeathTestFactory;
+#endif  // GTEST_HAS_DEATH_TEST
+
+  // Initializes the event listener performing XML output as specified by
+  // UnitTestOptions. Must not be called before InitGoogleTest.
+  void ConfigureXmlOutput();
+
+#if GTEST_CAN_STREAM_RESULTS_
+  // Initializes the event listener for streaming test results to a socket.
+  // Must not be called before InitGoogleTest.
+  void ConfigureStreamingOutput();
+#endif
+
+  // Performs initialization dependent upon flag values obtained in
+  // ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to
+  // ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest
+  // this function is also called from RunAllTests.  Since this function can be
+  // called more than once, it has to be idempotent.
+  void PostFlagParsingInit();
+
+  // Gets the random seed used at the start of the current test iteration.
+  int random_seed() const { return random_seed_; }
+
+  // Gets the random number generator.
+  internal::Random* random() { return &random_; }
+
+  // Shuffles all test cases, and the tests within each test case,
+  // making sure that death tests are still run first.
+  void ShuffleTests();
+
+  // Restores the test cases and tests to their order before the first shuffle.
+  void UnshuffleTests();
+
+  // Returns the value of GTEST_FLAG(catch_exceptions) at the moment
+  // UnitTest::Run() starts.
+  bool catch_exceptions() const { return catch_exceptions_; }
+
+ private:
+  friend class ::testing::UnitTest;
+
+  // Used by UnitTest::Run() to capture the state of
+  // GTEST_FLAG(catch_exceptions) at the moment it starts.
+  void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
+
+  // The UnitTest object that owns this implementation object.
+  UnitTest* const parent_;
+
+  // The working directory when the first TEST() or TEST_F() was
+  // executed.
+  internal::FilePath original_working_dir_;
+
+  // The default test part result reporters.
+  DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
+  DefaultPerThreadTestPartResultReporter
+      default_per_thread_test_part_result_reporter_;
+
+  // Points to (but doesn't own) the global test part result reporter.
+  TestPartResultReporterInterface* global_test_part_result_repoter_;
+
+  // Protects read and write access to global_test_part_result_reporter_.
+  internal::Mutex global_test_part_result_reporter_mutex_;
+
+  // Points to (but doesn't own) the per-thread test part result reporter.
+  internal::ThreadLocal<TestPartResultReporterInterface*>
+      per_thread_test_part_result_reporter_;
+
+  // The vector of environments that need to be set-up/torn-down
+  // before/after the tests are run.
+  std::vector<Environment*> environments_;
+
+  // The vector of TestCases in their original order.  It owns the
+  // elements in the vector.
+  std::vector<TestCase*> test_cases_;
+
+  // Provides a level of indirection for the test case list to allow
+  // easy shuffling and restoring the test case order.  The i-th
+  // element of this vector is the index of the i-th test case in the
+  // shuffled order.
+  std::vector<int> test_case_indices_;
+
+#if GTEST_HAS_PARAM_TEST
+  // ParameterizedTestRegistry object used to register value-parameterized
+  // tests.
+  internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
+
+  // Indicates whether RegisterParameterizedTests() has been called already.
+  bool parameterized_tests_registered_;
+#endif  // GTEST_HAS_PARAM_TEST
+
+  // Index of the last death test case registered.  Initially -1.
+  int last_death_test_case_;
+
+  // This points to the TestCase for the currently running test.  It
+  // changes as Google Test goes through one test case after another.
+  // When no test is running, this is set to NULL and Google Test
+  // stores assertion results in ad_hoc_test_result_.  Initially NULL.
+  TestCase* current_test_case_;
+
+  // This points to the TestInfo for the currently running test.  It
+  // changes as Google Test goes through one test after another.  When
+  // no test is running, this is set to NULL and Google Test stores
+  // assertion results in ad_hoc_test_result_.  Initially NULL.
+  TestInfo* current_test_info_;
+
+  // Normally, a user only writes assertions inside a TEST or TEST_F,
+  // or inside a function called by a TEST or TEST_F.  Since Google
+  // Test keeps track of which test is current running, it can
+  // associate such an assertion with the test it belongs to.
+  //
+  // If an assertion is encountered when no TEST or TEST_F is running,
+  // Google Test attributes the assertion result to an imaginary "ad hoc"
+  // test, and records the result in ad_hoc_test_result_.
+  TestResult ad_hoc_test_result_;
+
+  // The list of event listeners that can be used to track events inside
+  // Google Test.
+  TestEventListeners listeners_;
+
+  // The OS stack trace getter.  Will be deleted when the UnitTest
+  // object is destructed.  By default, an OsStackTraceGetter is used,
+  // but the user can set this field to use a custom getter if that is
+  // desired.
+  OsStackTraceGetterInterface* os_stack_trace_getter_;
+
+  // True iff PostFlagParsingInit() has been called.
+  bool post_flag_parse_init_performed_;
+
+  // The random number seed used at the beginning of the test run.
+  int random_seed_;
+
+  // Our random number generator.
+  internal::Random random_;
+
+  // The time of the test program start, in ms from the start of the
+  // UNIX epoch.
+  TimeInMillis start_timestamp_;
+
+  // How long the test took to run, in milliseconds.
+  TimeInMillis elapsed_time_;
+
+#if GTEST_HAS_DEATH_TEST
+  // The decomposed components of the gtest_internal_run_death_test flag,
+  // parsed when RUN_ALL_TESTS is called.
+  internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
+  internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
+#endif  // GTEST_HAS_DEATH_TEST
+
+  // A per-thread stack of traces created by the SCOPED_TRACE() macro.
+  internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
+
+  // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()
+  // starts.
+  bool catch_exceptions_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
+};  // class UnitTestImpl
+
+// Convenience function for accessing the global UnitTest
+// implementation object.
+inline UnitTestImpl* GetUnitTestImpl() {
+  return UnitTest::GetInstance()->impl();
+}
+
+#if GTEST_USES_SIMPLE_RE
+
+// Internal helper functions for implementing the simple regular
+// expression matcher.
+GTEST_API_ bool IsInSet(char ch, const char* str);
+GTEST_API_ bool IsAsciiDigit(char ch);
+GTEST_API_ bool IsAsciiPunct(char ch);
+GTEST_API_ bool IsRepeat(char ch);
+GTEST_API_ bool IsAsciiWhiteSpace(char ch);
+GTEST_API_ bool IsAsciiWordChar(char ch);
+GTEST_API_ bool IsValidEscape(char ch);
+GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);
+GTEST_API_ bool ValidateRegex(const char* regex);
+GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);
+GTEST_API_ bool MatchRepetitionAndRegexAtHead(
+    bool escaped, char ch, char repeat, const char* regex, const char* str);
+GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);
+
+#endif  // GTEST_USES_SIMPLE_RE
+
+// Parses the command line for Google Test flags, without initializing
+// other parts of Google Test.
+GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);
+GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
+
+#if GTEST_HAS_DEATH_TEST
+
+// Returns the message describing the last system error, regardless of the
+// platform.
+GTEST_API_ std::string GetLastErrnoDescription();
+
+// Attempts to parse a string into a positive integer pointed to by the
+// number parameter.  Returns true if that is possible.
+// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
+// it here.
+template <typename Integer>
+bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
+  // Fail fast if the given string does not begin with a digit;
+  // this bypasses strtoXXX's "optional leading whitespace and plus
+  // or minus sign" semantics, which are undesirable here.
+  if (str.empty() || !IsDigit(str[0])) {
+    return false;
+  }
+  errno = 0;
+
+  char* end;
+  // BiggestConvertible is the largest integer type that system-provided
+  // string-to-number conversion routines can return.
+
+# if GTEST_OS_WINDOWS && !defined(__GNUC__)
+
+  // MSVC and C++ Builder define __int64 instead of the standard long long.
+  typedef unsigned __int64 BiggestConvertible;
+  const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);
+
+# else
+
+  typedef unsigned long long BiggestConvertible;  // NOLINT
+  const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);
+
+# endif  // GTEST_OS_WINDOWS && !defined(__GNUC__)
+
+  const bool parse_success = *end == '\0' && errno == 0;
+
+  // TODO(vladl@google.com): Convert this to compile time assertion when it is
+  // available.
+  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
+
+  const Integer result = static_cast<Integer>(parsed);
+  if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
+    *number = result;
+    return true;
+  }
+  return false;
+}
+#endif  // GTEST_HAS_DEATH_TEST
+
+// TestResult contains some private methods that should be hidden from
+// Google Test user but are required for testing. This class allow our tests
+// to access them.
+//
+// This class is supplied only for the purpose of testing Google Test's own
+// constructs. Do not use it in user tests, either directly or indirectly.
+class TestResultAccessor {
+ public:
+  static void RecordProperty(TestResult* test_result,
+                             const std::string& xml_element,
+                             const TestProperty& property) {
+    test_result->RecordProperty(xml_element, property);
+  }
+
+  static void ClearTestPartResults(TestResult* test_result) {
+    test_result->ClearTestPartResults();
+  }
+
+  static const std::vector<testing::TestPartResult>& test_part_results(
+      const TestResult& test_result) {
+    return test_result.test_part_results();
+  }
+};
+
+#if GTEST_CAN_STREAM_RESULTS_
+
+// Streams test results to the given port on the given host machine.
+class GTEST_API_ StreamingListener : public EmptyTestEventListener {
+ public:
+  // Abstract base class for writing strings to a socket.
+  class AbstractSocketWriter {
+   public:
+    virtual ~AbstractSocketWriter() {}
+
+    // Sends a string to the socket.
+    virtual void Send(const string& message) = 0;
+
+    // Closes the socket.
+    virtual void CloseConnection() {}
+
+    // Sends a string and a newline to the socket.
+    void SendLn(const string& message) {
+      Send(message + "\n");
+    }
+  };
+
+  // Concrete class for actually writing strings to a socket.
+  class SocketWriter : public AbstractSocketWriter {
+   public:
+    SocketWriter(const string& host, const string& port)
+        : sockfd_(-1), host_name_(host), port_num_(port) {
+      MakeConnection();
+    }
+
+    virtual ~SocketWriter() {
+      if (sockfd_ != -1)
+        CloseConnection();
+    }
+
+    // Sends a string to the socket.
+    virtual void Send(const string& message) {
+      GTEST_CHECK_(sockfd_ != -1)
+          << "Send() can be called only when there is a connection.";
+
+      const int len = static_cast<int>(message.length());
+      if (write(sockfd_, message.c_str(), len) != len) {
+        GTEST_LOG_(WARNING)
+            << "stream_result_to: failed to stream to "
+            << host_name_ << ":" << port_num_;
+      }
+    }
+
+   private:
+    // Creates a client socket and connects to the server.
+    void MakeConnection();
+
+    // Closes the socket.
+    void CloseConnection() {
+      GTEST_CHECK_(sockfd_ != -1)
+          << "CloseConnection() can be called only when there is a connection.";
+
+      close(sockfd_);
+      sockfd_ = -1;
+    }
+
+    int sockfd_;  // socket file descriptor
+    const string host_name_;
+    const string port_num_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);
+  };  // class SocketWriter
+
+  // Escapes '=', '&', '%', and '\n' characters in str as "%xx".
+  static string UrlEncode(const char* str);
+
+  StreamingListener(const string& host, const string& port)
+      : socket_writer_(new SocketWriter(host, port)) { Start(); }
+
+  explicit StreamingListener(AbstractSocketWriter* socket_writer)
+      : socket_writer_(socket_writer) { Start(); }
+
+  void OnTestProgramStart(const UnitTest& /* unit_test */) {
+    SendLn("event=TestProgramStart");
+  }
+
+  void OnTestProgramEnd(const UnitTest& unit_test) {
+    // Note that Google Test current only report elapsed time for each
+    // test iteration, not for the entire test program.
+    SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
+
+    // Notify the streaming server to stop.
+    socket_writer_->CloseConnection();
+  }
+
+  void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
+    SendLn("event=TestIterationStart&iteration=" +
+           StreamableToString(iteration));
+  }
+
+  void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
+    SendLn("event=TestIterationEnd&passed=" +
+           FormatBool(unit_test.Passed()) + "&elapsed_time=" +
+           StreamableToString(unit_test.elapsed_time()) + "ms");
+  }
+
+  void OnTestCaseStart(const TestCase& test_case) {
+    SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
+  }
+
+  void OnTestCaseEnd(const TestCase& test_case) {
+    SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
+           + "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
+           + "ms");
+  }
+
+  void OnTestStart(const TestInfo& test_info) {
+    SendLn(std::string("event=TestStart&name=") + test_info.name());
+  }
+
+  void OnTestEnd(const TestInfo& test_info) {
+    SendLn("event=TestEnd&passed=" +
+           FormatBool((test_info.result())->Passed()) +
+           "&elapsed_time=" +
+           StreamableToString((test_info.result())->elapsed_time()) + "ms");
+  }
+
+  void OnTestPartResult(const TestPartResult& test_part_result) {
+    const char* file_name = test_part_result.file_name();
+    if (file_name == NULL)
+      file_name = "";
+    SendLn("event=TestPartResult&file=" + UrlEncode(file_name) +
+           "&line=" + StreamableToString(test_part_result.line_number()) +
+           "&message=" + UrlEncode(test_part_result.message()));
+  }
+
+ private:
+  // Sends the given message and a newline to the socket.
+  void SendLn(const string& message) { socket_writer_->SendLn(message); }
+
+  // Called at the start of streaming to notify the receiver what
+  // protocol we are using.
+  void Start() { SendLn("gtest_streaming_protocol_version=1.0"); }
+
+  string FormatBool(bool value) { return value ? "1" : "0"; }
+
+  const scoped_ptr<AbstractSocketWriter> socket_writer_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
+};  // class StreamingListener
+
+#endif  // GTEST_CAN_STREAM_RESULTS_
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_SRC_GTEST_INTERNAL_INL_H_
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-port.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-port.cc
new file mode 100644
index 0000000..e5bf3dd
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-port.cc
@@ -0,0 +1,1259 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include "gtest/internal/gtest-port.h"
+
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fstream>
+
+#if GTEST_OS_WINDOWS
+# include <windows.h>
+# include <io.h>
+# include <sys/stat.h>
+# include <map>  // Used in ThreadLocal.
+#else
+# include <unistd.h>
+#endif  // GTEST_OS_WINDOWS
+
+#if GTEST_OS_MAC
+# include <mach/mach_init.h>
+# include <mach/task.h>
+# include <mach/vm_map.h>
+#endif  // GTEST_OS_MAC
+
+#if GTEST_OS_QNX
+# include <devctl.h>
+# include <fcntl.h>
+# include <sys/procfs.h>
+#endif  // GTEST_OS_QNX
+
+#if GTEST_OS_AIX
+# include <procinfo.h>
+# include <sys/types.h>
+#endif  // GTEST_OS_AIX
+
+#include "gtest/gtest-spi.h"
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-string.h"
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+namespace testing {
+namespace internal {
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
+const int kStdOutFileno = 1;
+const int kStdErrFileno = 2;
+#else
+const int kStdOutFileno = STDOUT_FILENO;
+const int kStdErrFileno = STDERR_FILENO;
+#endif  // _MSC_VER
+
+#if GTEST_OS_LINUX
+
+namespace {
+template <typename T>
+T ReadProcFileField(const string& filename, int field) {
+  std::string dummy;
+  std::ifstream file(filename.c_str());
+  while (field-- > 0) {
+    file >> dummy;
+  }
+  T output = 0;
+  file >> output;
+  return output;
+}
+}  // namespace
+
+// Returns the number of active threads, or 0 when there is an error.
+size_t GetThreadCount() {
+  const string filename =
+      (Message() << "/proc/" << getpid() << "/stat").GetString();
+  return ReadProcFileField<int>(filename, 19);
+}
+
+#elif GTEST_OS_MAC
+
+size_t GetThreadCount() {
+  const task_t task = mach_task_self();
+  mach_msg_type_number_t thread_count;
+  thread_act_array_t thread_list;
+  const kern_return_t status = task_threads(task, &thread_list, &thread_count);
+  if (status == KERN_SUCCESS) {
+    // task_threads allocates resources in thread_list and we need to free them
+    // to avoid leaks.
+    vm_deallocate(task,
+                  reinterpret_cast<vm_address_t>(thread_list),
+                  sizeof(thread_t) * thread_count);
+    return static_cast<size_t>(thread_count);
+  } else {
+    return 0;
+  }
+}
+
+#elif GTEST_OS_QNX
+
+// Returns the number of threads running in the process, or 0 to indicate that
+// we cannot detect it.
+size_t GetThreadCount() {
+  const int fd = open("/proc/self/as", O_RDONLY);
+  if (fd < 0) {
+    return 0;
+  }
+  procfs_info process_info;
+  const int status =
+      devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);
+  close(fd);
+  if (status == EOK) {
+    return static_cast<size_t>(process_info.num_threads);
+  } else {
+    return 0;
+  }
+}
+
+#elif GTEST_OS_AIX
+
+size_t GetThreadCount() {
+  struct procentry64 entry;
+  pid_t pid = getpid();
+  int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
+  if (status == 1) {
+    return entry.pi_thcount;
+  } else {
+    return 0;
+  }
+}
+
+#else
+
+size_t GetThreadCount() {
+  // There's no portable way to detect the number of threads, so we just
+  // return 0 to indicate that we cannot detect it.
+  return 0;
+}
+
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+
+void SleepMilliseconds(int n) {
+  ::Sleep(n);
+}
+
+AutoHandle::AutoHandle()
+    : handle_(INVALID_HANDLE_VALUE) {}
+
+AutoHandle::AutoHandle(Handle handle)
+    : handle_(handle) {}
+
+AutoHandle::~AutoHandle() {
+  Reset();
+}
+
+AutoHandle::Handle AutoHandle::Get() const {
+  return handle_;
+}
+
+void AutoHandle::Reset() {
+  Reset(INVALID_HANDLE_VALUE);
+}
+
+void AutoHandle::Reset(HANDLE handle) {
+  // Resetting with the same handle we already own is invalid.
+  if (handle_ != handle) {
+    if (IsCloseable()) {
+      ::CloseHandle(handle_);
+    }
+    handle_ = handle;
+  } else {
+    GTEST_CHECK_(!IsCloseable())
+        << "Resetting a valid handle to itself is likely a programmer error "
+            "and thus not allowed.";
+  }
+}
+
+bool AutoHandle::IsCloseable() const {
+  // Different Windows APIs may use either of these values to represent an
+  // invalid handle.
+  return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
+}
+
+Notification::Notification()
+    : event_(::CreateEvent(NULL,   // Default security attributes.
+                           TRUE,   // Do not reset automatically.
+                           FALSE,  // Initially unset.
+                           NULL)) {  // Anonymous event.
+  GTEST_CHECK_(event_.Get() != NULL);
+}
+
+void Notification::Notify() {
+  GTEST_CHECK_(::SetEvent(event_.Get()) != FALSE);
+}
+
+void Notification::WaitForNotification() {
+  GTEST_CHECK_(
+      ::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);
+}
+
+Mutex::Mutex()
+    : owner_thread_id_(0),
+      type_(kDynamic),
+      critical_section_init_phase_(0),
+      critical_section_(new CRITICAL_SECTION) {
+  ::InitializeCriticalSection(critical_section_);
+}
+
+Mutex::~Mutex() {
+  // Static mutexes are leaked intentionally. It is not thread-safe to try
+  // to clean them up.
+  // TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
+  // nothing to clean it up but is available only on Vista and later.
+  // http://msdn.microsoft.com/en-us/library/windows/desktop/aa904937.aspx
+  if (type_ == kDynamic) {
+    ::DeleteCriticalSection(critical_section_);
+    delete critical_section_;
+    critical_section_ = NULL;
+  }
+}
+
+void Mutex::Lock() {
+  ThreadSafeLazyInit();
+  ::EnterCriticalSection(critical_section_);
+  owner_thread_id_ = ::GetCurrentThreadId();
+}
+
+void Mutex::Unlock() {
+  ThreadSafeLazyInit();
+  // We don't protect writing to owner_thread_id_ here, as it's the
+  // caller's responsibility to ensure that the current thread holds the
+  // mutex when this is called.
+  owner_thread_id_ = 0;
+  ::LeaveCriticalSection(critical_section_);
+}
+
+// Does nothing if the current thread holds the mutex. Otherwise, crashes
+// with high probability.
+void Mutex::AssertHeld() {
+  ThreadSafeLazyInit();
+  GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
+      << "The current thread is not holding the mutex @" << this;
+}
+
+// Initializes owner_thread_id_ and critical_section_ in static mutexes.
+void Mutex::ThreadSafeLazyInit() {
+  // Dynamic mutexes are initialized in the constructor.
+  if (type_ == kStatic) {
+    switch (
+        ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
+      case 0:
+        // If critical_section_init_phase_ was 0 before the exchange, we
+        // are the first to test it and need to perform the initialization.
+        owner_thread_id_ = 0;
+        critical_section_ = new CRITICAL_SECTION;
+        ::InitializeCriticalSection(critical_section_);
+        // Updates the critical_section_init_phase_ to 2 to signal
+        // initialization complete.
+        GTEST_CHECK_(::InterlockedCompareExchange(
+                          &critical_section_init_phase_, 2L, 1L) ==
+                      1L);
+        break;
+      case 1:
+        // Somebody else is already initializing the mutex; spin until they
+        // are done.
+        while (::InterlockedCompareExchange(&critical_section_init_phase_,
+                                            2L,
+                                            2L) != 2L) {
+          // Possibly yields the rest of the thread's time slice to other
+          // threads.
+          ::Sleep(0);
+        }
+        break;
+
+      case 2:
+        break;  // The mutex is already initialized and ready for use.
+
+      default:
+        GTEST_CHECK_(false)
+            << "Unexpected value of critical_section_init_phase_ "
+            << "while initializing a static mutex.";
+    }
+  }
+}
+
+namespace {
+
+class ThreadWithParamSupport : public ThreadWithParamBase {
+ public:
+  static HANDLE CreateThread(Runnable* runnable,
+                             Notification* thread_can_start) {
+    ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
+    DWORD thread_id;
+    // TODO(yukawa): Consider to use _beginthreadex instead.
+    HANDLE thread_handle = ::CreateThread(
+        NULL,    // Default security.
+        0,       // Default stack size.
+        &ThreadWithParamSupport::ThreadMain,
+        param,   // Parameter to ThreadMainStatic
+        0x0,     // Default creation flags.
+        &thread_id);  // Need a valid pointer for the call to work under Win98.
+    GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
+                                        << ::GetLastError() << ".";
+    if (thread_handle == NULL) {
+      delete param;
+    }
+    return thread_handle;
+  }
+
+ private:
+  struct ThreadMainParam {
+    ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
+        : runnable_(runnable),
+          thread_can_start_(thread_can_start) {
+    }
+    scoped_ptr<Runnable> runnable_;
+    // Does not own.
+    Notification* thread_can_start_;
+  };
+
+  static DWORD WINAPI ThreadMain(void* ptr) {
+    // Transfers ownership.
+    scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
+    if (param->thread_can_start_ != NULL)
+      param->thread_can_start_->WaitForNotification();
+    param->runnable_->Run();
+    return 0;
+  }
+
+  // Prohibit instantiation.
+  ThreadWithParamSupport();
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);
+};
+
+}  // namespace
+
+ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+                                         Notification* thread_can_start)
+      : thread_(ThreadWithParamSupport::CreateThread(runnable,
+                                                     thread_can_start)) {
+}
+
+ThreadWithParamBase::~ThreadWithParamBase() {
+  Join();
+}
+
+void ThreadWithParamBase::Join() {
+  GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
+      << "Failed to join the thread with error " << ::GetLastError() << ".";
+}
+
+// Maps a thread to a set of ThreadIdToThreadLocals that have values
+// instantiated on that thread and notifies them when the thread exits.  A
+// ThreadLocal instance is expected to persist until all threads it has
+// values on have terminated.
+class ThreadLocalRegistryImpl {
+ public:
+  // Registers thread_local_instance as having value on the current thread.
+  // Returns a value that can be used to identify the thread from other threads.
+  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance) {
+    DWORD current_thread = ::GetCurrentThreadId();
+    MutexLock lock(&mutex_);
+    ThreadIdToThreadLocals* const thread_to_thread_locals =
+        GetThreadLocalsMapLocked();
+    ThreadIdToThreadLocals::iterator thread_local_pos =
+        thread_to_thread_locals->find(current_thread);
+    if (thread_local_pos == thread_to_thread_locals->end()) {
+      thread_local_pos = thread_to_thread_locals->insert(
+          std::make_pair(current_thread, ThreadLocalValues())).first;
+      StartWatcherThreadFor(current_thread);
+    }
+    ThreadLocalValues& thread_local_values = thread_local_pos->second;
+    ThreadLocalValues::iterator value_pos =
+        thread_local_values.find(thread_local_instance);
+    if (value_pos == thread_local_values.end()) {
+      value_pos =
+          thread_local_values
+              .insert(std::make_pair(
+                  thread_local_instance,
+                  linked_ptr<ThreadLocalValueHolderBase>(
+                      thread_local_instance->NewValueForCurrentThread())))
+              .first;
+    }
+    return value_pos->second.get();
+  }
+
+  static void OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance) {
+    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+    // Clean up the ThreadLocalValues data structure while holding the lock, but
+    // defer the destruction of the ThreadLocalValueHolderBases.
+    {
+      MutexLock lock(&mutex_);
+      ThreadIdToThreadLocals* const thread_to_thread_locals =
+          GetThreadLocalsMapLocked();
+      for (ThreadIdToThreadLocals::iterator it =
+          thread_to_thread_locals->begin();
+          it != thread_to_thread_locals->end();
+          ++it) {
+        ThreadLocalValues& thread_local_values = it->second;
+        ThreadLocalValues::iterator value_pos =
+            thread_local_values.find(thread_local_instance);
+        if (value_pos != thread_local_values.end()) {
+          value_holders.push_back(value_pos->second);
+          thread_local_values.erase(value_pos);
+          // This 'if' can only be successful at most once, so theoretically we
+          // could break out of the loop here, but we don't bother doing so.
+        }
+      }
+    }
+    // Outside the lock, let the destructor for 'value_holders' deallocate the
+    // ThreadLocalValueHolderBases.
+  }
+
+  static void OnThreadExit(DWORD thread_id) {
+    GTEST_CHECK_(thread_id != 0) << ::GetLastError();
+    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+    // Clean up the ThreadIdToThreadLocals data structure while holding the
+    // lock, but defer the destruction of the ThreadLocalValueHolderBases.
+    {
+      MutexLock lock(&mutex_);
+      ThreadIdToThreadLocals* const thread_to_thread_locals =
+          GetThreadLocalsMapLocked();
+      ThreadIdToThreadLocals::iterator thread_local_pos =
+          thread_to_thread_locals->find(thread_id);
+      if (thread_local_pos != thread_to_thread_locals->end()) {
+        ThreadLocalValues& thread_local_values = thread_local_pos->second;
+        for (ThreadLocalValues::iterator value_pos =
+            thread_local_values.begin();
+            value_pos != thread_local_values.end();
+            ++value_pos) {
+          value_holders.push_back(value_pos->second);
+        }
+        thread_to_thread_locals->erase(thread_local_pos);
+      }
+    }
+    // Outside the lock, let the destructor for 'value_holders' deallocate the
+    // ThreadLocalValueHolderBases.
+  }
+
+ private:
+  // In a particular thread, maps a ThreadLocal object to its value.
+  typedef std::map<const ThreadLocalBase*,
+                   linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
+  // Stores all ThreadIdToThreadLocals having values in a thread, indexed by
+  // thread's ID.
+  typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
+
+  // Holds the thread id and thread handle that we pass from
+  // StartWatcherThreadFor to WatcherThreadFunc.
+  typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
+
+  static void StartWatcherThreadFor(DWORD thread_id) {
+    // The returned handle will be kept in thread_map and closed by
+    // watcher_thread in WatcherThreadFunc.
+    HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
+                                 FALSE,
+                                 thread_id);
+    GTEST_CHECK_(thread != NULL);
+    // We need to to pass a valid thread ID pointer into CreateThread for it
+    // to work correctly under Win98.
+    DWORD watcher_thread_id;
+    HANDLE watcher_thread = ::CreateThread(
+        NULL,   // Default security.
+        0,      // Default stack size
+        &ThreadLocalRegistryImpl::WatcherThreadFunc,
+        reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
+        CREATE_SUSPENDED,
+        &watcher_thread_id);
+    GTEST_CHECK_(watcher_thread != NULL);
+    // Give the watcher thread the same priority as ours to avoid being
+    // blocked by it.
+    ::SetThreadPriority(watcher_thread,
+                        ::GetThreadPriority(::GetCurrentThread()));
+    ::ResumeThread(watcher_thread);
+    ::CloseHandle(watcher_thread);
+  }
+
+  // Monitors exit from a given thread and notifies those
+  // ThreadIdToThreadLocals about thread termination.
+  static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+    const ThreadIdAndHandle* tah =
+        reinterpret_cast<const ThreadIdAndHandle*>(param);
+    GTEST_CHECK_(
+        ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+    OnThreadExit(tah->first);
+    ::CloseHandle(tah->second);
+    delete tah;
+    return 0;
+  }
+
+  // Returns map of thread local instances.
+  static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
+    mutex_.AssertHeld();
+    static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
+    return map;
+  }
+
+  // Protects access to GetThreadLocalsMapLocked() and its return value.
+  static Mutex mutex_;
+  // Protects access to GetThreadMapLocked() and its return value.
+  static Mutex thread_map_mutex_;
+};
+
+Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);
+Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);
+
+ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance) {
+  return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
+      thread_local_instance);
+}
+
+void ThreadLocalRegistry::OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance) {
+  ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
+}
+
+#endif  // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+
+#if GTEST_USES_POSIX_RE
+
+// Implements RE.  Currently only needed for death tests.
+
+RE::~RE() {
+  if (is_valid_) {
+    // regfree'ing an invalid regex might crash because the content
+    // of the regex is undefined. Since the regex's are essentially
+    // the same, one cannot be valid (or invalid) without the other
+    // being so too.
+    regfree(&partial_regex_);
+    regfree(&full_regex_);
+  }
+  free(const_cast<char*>(pattern_));
+}
+
+// Returns true iff regular expression re matches the entire str.
+bool RE::FullMatch(const char* str, const RE& re) {
+  if (!re.is_valid_) return false;
+
+  regmatch_t match;
+  return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
+}
+
+// Returns true iff regular expression re matches a substring of str
+// (including str itself).
+bool RE::PartialMatch(const char* str, const RE& re) {
+  if (!re.is_valid_) return false;
+
+  regmatch_t match;
+  return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
+}
+
+// Initializes an RE from its string representation.
+void RE::Init(const char* regex) {
+  pattern_ = posix::StrDup(regex);
+
+  // Reserves enough bytes to hold the regular expression used for a
+  // full match.
+  const size_t full_regex_len = strlen(regex) + 10;
+  char* const full_pattern = new char[full_regex_len];
+
+  snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
+  is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
+  // We want to call regcomp(&partial_regex_, ...) even if the
+  // previous expression returns false.  Otherwise partial_regex_ may
+  // not be properly initialized can may cause trouble when it's
+  // freed.
+  //
+  // Some implementation of POSIX regex (e.g. on at least some
+  // versions of Cygwin) doesn't accept the empty string as a valid
+  // regex.  We change it to an equivalent form "()" to be safe.
+  if (is_valid_) {
+    const char* const partial_regex = (*regex == '\0') ? "()" : regex;
+    is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
+  }
+  EXPECT_TRUE(is_valid_)
+      << "Regular expression \"" << regex
+      << "\" is not a valid POSIX Extended regular expression.";
+
+  delete[] full_pattern;
+}
+
+#elif GTEST_USES_SIMPLE_RE
+
+// Returns true iff ch appears anywhere in str (excluding the
+// terminating '\0' character).
+bool IsInSet(char ch, const char* str) {
+  return ch != '\0' && strchr(str, ch) != NULL;
+}
+
+// Returns true iff ch belongs to the given classification.  Unlike
+// similar functions in <ctype.h>, these aren't affected by the
+// current locale.
+bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }
+bool IsAsciiPunct(char ch) {
+  return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
+}
+bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }
+bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }
+bool IsAsciiWordChar(char ch) {
+  return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||
+      ('0' <= ch && ch <= '9') || ch == '_';
+}
+
+// Returns true iff "\\c" is a supported escape sequence.
+bool IsValidEscape(char c) {
+  return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));
+}
+
+// Returns true iff the given atom (specified by escaped and pattern)
+// matches ch.  The result is undefined if the atom is invalid.
+bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
+  if (escaped) {  // "\\p" where p is pattern_char.
+    switch (pattern_char) {
+      case 'd': return IsAsciiDigit(ch);
+      case 'D': return !IsAsciiDigit(ch);
+      case 'f': return ch == '\f';
+      case 'n': return ch == '\n';
+      case 'r': return ch == '\r';
+      case 's': return IsAsciiWhiteSpace(ch);
+      case 'S': return !IsAsciiWhiteSpace(ch);
+      case 't': return ch == '\t';
+      case 'v': return ch == '\v';
+      case 'w': return IsAsciiWordChar(ch);
+      case 'W': return !IsAsciiWordChar(ch);
+    }
+    return IsAsciiPunct(pattern_char) && pattern_char == ch;
+  }
+
+  return (pattern_char == '.' && ch != '\n') || pattern_char == ch;
+}
+
+// Helper function used by ValidateRegex() to format error messages.
+std::string FormatRegexSyntaxError(const char* regex, int index) {
+  return (Message() << "Syntax error at index " << index
+          << " in simple regular expression \"" << regex << "\": ").GetString();
+}
+
+// Generates non-fatal failures and returns false if regex is invalid;
+// otherwise returns true.
+bool ValidateRegex(const char* regex) {
+  if (regex == NULL) {
+    // TODO(wan@google.com): fix the source file location in the
+    // assertion failures to match where the regex is used in user
+    // code.
+    ADD_FAILURE() << "NULL is not a valid simple regular expression.";
+    return false;
+  }
+
+  bool is_valid = true;
+
+  // True iff ?, *, or + can follow the previous atom.
+  bool prev_repeatable = false;
+  for (int i = 0; regex[i]; i++) {
+    if (regex[i] == '\\') {  // An escape sequence
+      i++;
+      if (regex[i] == '\0') {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
+                      << "'\\' cannot appear at the end.";
+        return false;
+      }
+
+      if (!IsValidEscape(regex[i])) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
+                      << "invalid escape sequence \"\\" << regex[i] << "\".";
+        is_valid = false;
+      }
+      prev_repeatable = true;
+    } else {  // Not an escape sequence.
+      const char ch = regex[i];
+
+      if (ch == '^' && i > 0) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'^' can only appear at the beginning.";
+        is_valid = false;
+      } else if (ch == '$' && regex[i + 1] != '\0') {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'$' can only appear at the end.";
+        is_valid = false;
+      } else if (IsInSet(ch, "()[]{}|")) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'" << ch << "' is unsupported.";
+        is_valid = false;
+      } else if (IsRepeat(ch) && !prev_repeatable) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'" << ch << "' can only follow a repeatable token.";
+        is_valid = false;
+      }
+
+      prev_repeatable = !IsInSet(ch, "^$?*+");
+    }
+  }
+
+  return is_valid;
+}
+
+// Matches a repeated regex atom followed by a valid simple regular
+// expression.  The regex atom is defined as c if escaped is false,
+// or \c otherwise.  repeat is the repetition meta character (?, *,
+// or +).  The behavior is undefined if str contains too many
+// characters to be indexable by size_t, in which case the test will
+// probably time out anyway.  We are fine with this limitation as
+// std::string has it too.
+bool MatchRepetitionAndRegexAtHead(
+    bool escaped, char c, char repeat, const char* regex,
+    const char* str) {
+  const size_t min_count = (repeat == '+') ? 1 : 0;
+  const size_t max_count = (repeat == '?') ? 1 :
+      static_cast<size_t>(-1) - 1;
+  // We cannot call numeric_limits::max() as it conflicts with the
+  // max() macro on Windows.
+
+  for (size_t i = 0; i <= max_count; ++i) {
+    // We know that the atom matches each of the first i characters in str.
+    if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
+      // We have enough matches at the head, and the tail matches too.
+      // Since we only care about *whether* the pattern matches str
+      // (as opposed to *how* it matches), there is no need to find a
+      // greedy match.
+      return true;
+    }
+    if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
+      return false;
+  }
+  return false;
+}
+
+// Returns true iff regex matches a prefix of str.  regex must be a
+// valid simple regular expression and not start with "^", or the
+// result is undefined.
+bool MatchRegexAtHead(const char* regex, const char* str) {
+  if (*regex == '\0')  // An empty regex matches a prefix of anything.
+    return true;
+
+  // "$" only matches the end of a string.  Note that regex being
+  // valid guarantees that there's nothing after "$" in it.
+  if (*regex == '$')
+    return *str == '\0';
+
+  // Is the first thing in regex an escape sequence?
+  const bool escaped = *regex == '\\';
+  if (escaped)
+    ++regex;
+  if (IsRepeat(regex[1])) {
+    // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so
+    // here's an indirect recursion.  It terminates as the regex gets
+    // shorter in each recursion.
+    return MatchRepetitionAndRegexAtHead(
+        escaped, regex[0], regex[1], regex + 2, str);
+  } else {
+    // regex isn't empty, isn't "$", and doesn't start with a
+    // repetition.  We match the first atom of regex with the first
+    // character of str and recurse.
+    return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
+        MatchRegexAtHead(regex + 1, str + 1);
+  }
+}
+
+// Returns true iff regex matches any substring of str.  regex must be
+// a valid simple regular expression, or the result is undefined.
+//
+// The algorithm is recursive, but the recursion depth doesn't exceed
+// the regex length, so we won't need to worry about running out of
+// stack space normally.  In rare cases the time complexity can be
+// exponential with respect to the regex length + the string length,
+// but usually it's must faster (often close to linear).
+bool MatchRegexAnywhere(const char* regex, const char* str) {
+  if (regex == NULL || str == NULL)
+    return false;
+
+  if (*regex == '^')
+    return MatchRegexAtHead(regex + 1, str);
+
+  // A successful match can be anywhere in str.
+  do {
+    if (MatchRegexAtHead(regex, str))
+      return true;
+  } while (*str++ != '\0');
+  return false;
+}
+
+// Implements the RE class.
+
+RE::~RE() {
+  free(const_cast<char*>(pattern_));
+  free(const_cast<char*>(full_pattern_));
+}
+
+// Returns true iff regular expression re matches the entire str.
+bool RE::FullMatch(const char* str, const RE& re) {
+  return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
+}
+
+// Returns true iff regular expression re matches a substring of str
+// (including str itself).
+bool RE::PartialMatch(const char* str, const RE& re) {
+  return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
+}
+
+// Initializes an RE from its string representation.
+void RE::Init(const char* regex) {
+  pattern_ = full_pattern_ = NULL;
+  if (regex != NULL) {
+    pattern_ = posix::StrDup(regex);
+  }
+
+  is_valid_ = ValidateRegex(regex);
+  if (!is_valid_) {
+    // No need to calculate the full pattern when the regex is invalid.
+    return;
+  }
+
+  const size_t len = strlen(regex);
+  // Reserves enough bytes to hold the regular expression used for a
+  // full match: we need space to prepend a '^', append a '$', and
+  // terminate the string with '\0'.
+  char* buffer = static_cast<char*>(malloc(len + 3));
+  full_pattern_ = buffer;
+
+  if (*regex != '^')
+    *buffer++ = '^';  // Makes sure full_pattern_ starts with '^'.
+
+  // We don't use snprintf or strncpy, as they trigger a warning when
+  // compiled with VC++ 8.0.
+  memcpy(buffer, regex, len);
+  buffer += len;
+
+  if (len == 0 || regex[len - 1] != '$')
+    *buffer++ = '$';  // Makes sure full_pattern_ ends with '$'.
+
+  *buffer = '\0';
+}
+
+#endif  // GTEST_USES_POSIX_RE
+
+const char kUnknownFile[] = "unknown file";
+
+// Formats a source file path and a line number as they would appear
+// in an error message from the compiler used to compile this code.
+GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
+  const std::string file_name(file == NULL ? kUnknownFile : file);
+
+  if (line < 0) {
+    return file_name + ":";
+  }
+#ifdef _MSC_VER
+  return file_name + "(" + StreamableToString(line) + "):";
+#else
+  return file_name + ":" + StreamableToString(line) + ":";
+#endif  // _MSC_VER
+}
+
+// Formats a file location for compiler-independent XML output.
+// Although this function is not platform dependent, we put it next to
+// FormatFileLocation in order to contrast the two functions.
+// Note that FormatCompilerIndependentFileLocation() does NOT append colon
+// to the file location it produces, unlike FormatFileLocation().
+GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
+    const char* file, int line) {
+  const std::string file_name(file == NULL ? kUnknownFile : file);
+
+  if (line < 0)
+    return file_name;
+  else
+    return file_name + ":" + StreamableToString(line);
+}
+
+GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
+    : severity_(severity) {
+  const char* const marker =
+      severity == GTEST_INFO ?    "[  INFO ]" :
+      severity == GTEST_WARNING ? "[WARNING]" :
+      severity == GTEST_ERROR ?   "[ ERROR ]" : "[ FATAL ]";
+  GetStream() << ::std::endl << marker << " "
+              << FormatFileLocation(file, line).c_str() << ": ";
+}
+
+// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
+GTestLog::~GTestLog() {
+  GetStream() << ::std::endl;
+  if (severity_ == GTEST_FATAL) {
+    fflush(stderr);
+    posix::Abort();
+  }
+}
+// Disable Microsoft deprecation warnings for POSIX functions called from
+// this class (creat, dup, dup2, and close)
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+
+#if GTEST_HAS_STREAM_REDIRECTION
+
+// Object that captures an output stream (stdout/stderr).
+class CapturedStream {
+ public:
+  // The ctor redirects the stream to a temporary file.
+  explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
+# if GTEST_OS_WINDOWS
+    char temp_dir_path[MAX_PATH + 1] = { '\0' };  // NOLINT
+    char temp_file_path[MAX_PATH + 1] = { '\0' };  // NOLINT
+
+    ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
+    const UINT success = ::GetTempFileNameA(temp_dir_path,
+                                            "gtest_redir",
+                                            0,  // Generate unique file name.
+                                            temp_file_path);
+    GTEST_CHECK_(success != 0)
+        << "Unable to create a temporary file in " << temp_dir_path;
+    const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
+    GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
+                                    << temp_file_path;
+    filename_ = temp_file_path;
+# else
+    // There's no guarantee that a test has write access to the current
+    // directory, so we create the temporary file in the /tmp directory
+    // instead. We use /tmp on most systems, and /sdcard on Android.
+    // That's because Android doesn't have /tmp.
+#  if GTEST_OS_LINUX_ANDROID
+    // Note: Android applications are expected to call the framework's
+    // Context.getExternalStorageDirectory() method through JNI to get
+    // the location of the world-writable SD Card directory. However,
+    // this requires a Context handle, which cannot be retrieved
+    // globally from native code. Doing so also precludes running the
+    // code as part of a regular standalone executable, which doesn't
+    // run in a Dalvik process (e.g. when running it through 'adb shell').
+    //
+    // The location /sdcard is directly accessible from native code
+    // and is the only location (unofficially) supported by the Android
+    // team. It's generally a symlink to the real SD Card mount point
+    // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or
+    // other OEM-customized locations. Never rely on these, and always
+    // use /sdcard.
+    char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX";
+#  else
+    char name_template[] = "/tmp/captured_stream.XXXXXX";
+#  endif  // GTEST_OS_LINUX_ANDROID
+    const int captured_fd = mkstemp(name_template);
+    filename_ = name_template;
+# endif  // GTEST_OS_WINDOWS
+    fflush(NULL);
+    dup2(captured_fd, fd_);
+    close(captured_fd);
+  }
+
+  ~CapturedStream() {
+    remove(filename_.c_str());
+  }
+
+  std::string GetCapturedString() {
+    if (uncaptured_fd_ != -1) {
+      // Restores the original stream.
+      fflush(NULL);
+      dup2(uncaptured_fd_, fd_);
+      close(uncaptured_fd_);
+      uncaptured_fd_ = -1;
+    }
+
+    FILE* const file = posix::FOpen(filename_.c_str(), "r");
+    const std::string content = ReadEntireFile(file);
+    posix::FClose(file);
+    return content;
+  }
+
+ private:
+  const int fd_;  // A stream to capture.
+  int uncaptured_fd_;
+  // Name of the temporary file holding the stderr output.
+  ::std::string filename_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
+};
+
+GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+static CapturedStream* g_captured_stderr = NULL;
+static CapturedStream* g_captured_stdout = NULL;
+
+// Starts capturing an output stream (stdout/stderr).
+void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) {
+  if (*stream != NULL) {
+    GTEST_LOG_(FATAL) << "Only one " << stream_name
+                      << " capturer can exist at a time.";
+  }
+  *stream = new CapturedStream(fd);
+}
+
+// Stops capturing the output stream and returns the captured string.
+std::string GetCapturedStream(CapturedStream** captured_stream) {
+  const std::string content = (*captured_stream)->GetCapturedString();
+
+  delete *captured_stream;
+  *captured_stream = NULL;
+
+  return content;
+}
+
+// Starts capturing stdout.
+void CaptureStdout() {
+  CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
+}
+
+// Starts capturing stderr.
+void CaptureStderr() {
+  CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
+}
+
+// Stops capturing stdout and returns the captured string.
+std::string GetCapturedStdout() {
+  return GetCapturedStream(&g_captured_stdout);
+}
+
+// Stops capturing stderr and returns the captured string.
+std::string GetCapturedStderr() {
+  return GetCapturedStream(&g_captured_stderr);
+}
+
+#endif  // GTEST_HAS_STREAM_REDIRECTION
+
+std::string TempDir() {
+#if GTEST_OS_WINDOWS_MOBILE
+  return "\\temp\\";
+#elif GTEST_OS_WINDOWS
+  const char* temp_dir = posix::GetEnv("TEMP");
+  if (temp_dir == NULL || temp_dir[0] == '\0')
+    return "\\temp\\";
+  else if (temp_dir[strlen(temp_dir) - 1] == '\\')
+    return temp_dir;
+  else
+    return std::string(temp_dir) + "\\";
+#elif GTEST_OS_LINUX_ANDROID
+  return "/sdcard/";
+#else
+  return "/tmp/";
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+size_t GetFileSize(FILE* file) {
+  fseek(file, 0, SEEK_END);
+  return static_cast<size_t>(ftell(file));
+}
+
+std::string ReadEntireFile(FILE* file) {
+  const size_t file_size = GetFileSize(file);
+  char* const buffer = new char[file_size];
+
+  size_t bytes_last_read = 0;  // # of bytes read in the last fread()
+  size_t bytes_read = 0;       // # of bytes read so far
+
+  fseek(file, 0, SEEK_SET);
+
+  // Keeps reading the file until we cannot read further or the
+  // pre-determined file size is reached.
+  do {
+    bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
+    bytes_read += bytes_last_read;
+  } while (bytes_last_read > 0 && bytes_read < file_size);
+
+  const std::string content(buffer, bytes_read);
+  delete[] buffer;
+
+  return content;
+}
+
+#if GTEST_HAS_DEATH_TEST
+
+static const ::std::vector<testing::internal::string>* g_injected_test_argvs =
+                                        NULL;  // Owned.
+
+void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) {
+  if (g_injected_test_argvs != argvs)
+    delete g_injected_test_argvs;
+  g_injected_test_argvs = argvs;
+}
+
+const ::std::vector<testing::internal::string>& GetInjectableArgvs() {
+  if (g_injected_test_argvs != NULL) {
+    return *g_injected_test_argvs;
+  }
+  return GetArgvs();
+}
+#endif  // GTEST_HAS_DEATH_TEST
+
+#if GTEST_OS_WINDOWS_MOBILE
+namespace posix {
+void Abort() {
+  DebugBreak();
+  TerminateProcess(GetCurrentProcess(), 1);
+}
+}  // namespace posix
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+// Returns the name of the environment variable corresponding to the
+// given flag.  For example, FlagToEnvVar("foo") will return
+// "GTEST_FOO" in the open-source version.
+static std::string FlagToEnvVar(const char* flag) {
+  const std::string full_flag =
+      (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
+
+  Message env_var;
+  for (size_t i = 0; i != full_flag.length(); i++) {
+    env_var << ToUpper(full_flag.c_str()[i]);
+  }
+
+  return env_var.GetString();
+}
+
+// Parses 'str' for a 32-bit signed integer.  If successful, writes
+// the result to *value and returns true; otherwise leaves *value
+// unchanged and returns false.
+bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
+  // Parses the environment variable as a decimal integer.
+  char* end = NULL;
+  const long long_value = strtol(str, &end, 10);  // NOLINT
+
+  // Has strtol() consumed all characters in the string?
+  if (*end != '\0') {
+    // No - an invalid character was encountered.
+    Message msg;
+    msg << "WARNING: " << src_text
+        << " is expected to be a 32-bit integer, but actually"
+        << " has value \"" << str << "\".\n";
+    printf("%s", msg.GetString().c_str());
+    fflush(stdout);
+    return false;
+  }
+
+  // Is the parsed value in the range of an Int32?
+  const Int32 result = static_cast<Int32>(long_value);
+  if (long_value == LONG_MAX || long_value == LONG_MIN ||
+      // The parsed value overflows as a long.  (strtol() returns
+      // LONG_MAX or LONG_MIN when the input overflows.)
+      result != long_value
+      // The parsed value overflows as an Int32.
+      ) {
+    Message msg;
+    msg << "WARNING: " << src_text
+        << " is expected to be a 32-bit integer, but actually"
+        << " has value " << str << ", which overflows.\n";
+    printf("%s", msg.GetString().c_str());
+    fflush(stdout);
+    return false;
+  }
+
+  *value = result;
+  return true;
+}
+
+// Reads and returns the Boolean environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+//
+// The value is considered true iff it's not "0".
+bool BoolFromGTestEnv(const char* flag, bool default_value) {
+#if defined(GTEST_GET_BOOL_FROM_ENV_)
+  return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_BOOL_FROM_ENV_)
+  const std::string env_var = FlagToEnvVar(flag);
+  const char* const string_value = posix::GetEnv(env_var.c_str());
+  return string_value == NULL ?
+      default_value : strcmp(string_value, "0") != 0;
+}
+
+// Reads and returns a 32-bit integer stored in the environment
+// variable corresponding to the given flag; if it isn't set or
+// doesn't represent a valid 32-bit integer, returns default_value.
+Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
+#if defined(GTEST_GET_INT32_FROM_ENV_)
+  return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_INT32_FROM_ENV_)
+  const std::string env_var = FlagToEnvVar(flag);
+  const char* const string_value = posix::GetEnv(env_var.c_str());
+  if (string_value == NULL) {
+    // The environment variable is not set.
+    return default_value;
+  }
+
+  Int32 result = default_value;
+  if (!ParseInt32(Message() << "Environment variable " << env_var,
+                  string_value, &result)) {
+    printf("The default value %s is used.\n",
+           (Message() << default_value).GetString().c_str());
+    fflush(stdout);
+    return default_value;
+  }
+
+  return result;
+}
+
+// Reads and returns the string environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+std::string StringFromGTestEnv(const char* flag, const char* default_value) {
+#if defined(GTEST_GET_STRING_FROM_ENV_)
+  return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_STRING_FROM_ENV_)
+  const std::string env_var = FlagToEnvVar(flag);
+  const char* value = posix::GetEnv(env_var.c_str());
+  if (value != NULL) {
+    return value;
+  }
+
+  // As a special case for the 'output' flag, if GTEST_OUTPUT is not
+  // set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
+  // system.  The value of XML_OUTPUT_FILE is a filename without the
+  // "xml:" prefix of GTEST_OUTPUT.
+  //
+  // The net priority order after flag processing is thus:
+  //   --gtest_output command line flag
+  //   GTEST_OUTPUT environment variable
+  //   XML_OUTPUT_FILE environment variable
+  //   'default_value'
+  if (strcmp(flag, "output") == 0) {
+    value = posix::GetEnv("XML_OUTPUT_FILE");
+    if (value != NULL) {
+      return std::string("xml:") + value;
+    }
+  }
+  return default_value;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-printers.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-printers.cc
new file mode 100644
index 0000000..a2df412
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-printers.cc
@@ -0,0 +1,373 @@
+// 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 Test - The Google C++ Testing Framework
+//
+// This file implements a universal value printer that can print a
+// value of any type T:
+//
+//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
+//
+// It uses the << operator when possible, and prints the bytes in the
+// object otherwise.  A user can override its behavior for a class
+// type Foo by defining either operator<<(::std::ostream&, const Foo&)
+// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that
+// defines Foo.
+
+#include "gtest/gtest-printers.h"
+#include <ctype.h>
+#include <stdio.h>
+#include <cwchar>
+#include <ostream>  // NOLINT
+#include <string>
+#include "gtest/internal/gtest-port.h"
+
+namespace testing {
+
+namespace {
+
+using ::std::ostream;
+
+// Prints a segment of bytes in the given object.
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
+                                size_t count, ostream* os) {
+  char text[5] = "";
+  for (size_t i = 0; i != count; i++) {
+    const size_t j = start + i;
+    if (i != 0) {
+      // Organizes the bytes into groups of 2 for easy parsing by
+      // human.
+      if ((j % 2) == 0)
+        *os << ' ';
+      else
+        *os << '-';
+    }
+    GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]);
+    *os << text;
+  }
+}
+
+// Prints the bytes in the given value to the given ostream.
+void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
+                              ostream* os) {
+  // Tells the user how big the object is.
+  *os << count << "-byte object <";
+
+  const size_t kThreshold = 132;
+  const size_t kChunkSize = 64;
+  // If the object size is bigger than kThreshold, we'll have to omit
+  // some details by printing only the first and the last kChunkSize
+  // bytes.
+  // TODO(wan): let the user control the threshold using a flag.
+  if (count < kThreshold) {
+    PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
+  } else {
+    PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os);
+    *os << " ... ";
+    // Rounds up to 2-byte boundary.
+    const size_t resume_pos = (count - kChunkSize + 1)/2*2;
+    PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os);
+  }
+  *os << ">";
+}
+
+}  // namespace
+
+namespace internal2 {
+
+// Delegates to PrintBytesInObjectToImpl() to print the bytes in the
+// given object.  The delegation simplifies the implementation, which
+// uses the << operator and thus is easier done outside of the
+// ::testing::internal namespace, which contains a << operator that
+// sometimes conflicts with the one in STL.
+void PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count,
+                          ostream* os) {
+  PrintBytesInObjectToImpl(obj_bytes, count, os);
+}
+
+}  // namespace internal2
+
+namespace internal {
+
+// Depending on the value of a char (or wchar_t), we print it in one
+// of three formats:
+//   - as is if it's a printable ASCII (e.g. 'a', '2', ' '),
+//   - as a hexidecimal escape sequence (e.g. '\x7F'), or
+//   - as a special escape sequence (e.g. '\r', '\n').
+enum CharFormat {
+  kAsIs,
+  kHexEscape,
+  kSpecialEscape
+};
+
+// Returns true if c is a printable ASCII character.  We test the
+// value of c directly instead of calling isprint(), which is buggy on
+// Windows Mobile.
+inline bool IsPrintableAscii(wchar_t c) {
+  return 0x20 <= c && c <= 0x7E;
+}
+
+// Prints a wide or narrow char c as a character literal without the
+// quotes, escaping it when necessary; returns how c was formatted.
+// The template argument UnsignedChar is the unsigned version of Char,
+// which is the type of c.
+template <typename UnsignedChar, typename Char>
+static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
+  switch (static_cast<wchar_t>(c)) {
+    case L'\0':
+      *os << "\\0";
+      break;
+    case L'\'':
+      *os << "\\'";
+      break;
+    case L'\\':
+      *os << "\\\\";
+      break;
+    case L'\a':
+      *os << "\\a";
+      break;
+    case L'\b':
+      *os << "\\b";
+      break;
+    case L'\f':
+      *os << "\\f";
+      break;
+    case L'\n':
+      *os << "\\n";
+      break;
+    case L'\r':
+      *os << "\\r";
+      break;
+    case L'\t':
+      *os << "\\t";
+      break;
+    case L'\v':
+      *os << "\\v";
+      break;
+    default:
+      if (IsPrintableAscii(c)) {
+        *os << static_cast<char>(c);
+        return kAsIs;
+      } else {
+        *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));
+        return kHexEscape;
+      }
+  }
+  return kSpecialEscape;
+}
+
+// Prints a wchar_t c as if it's part of a string literal, escaping it when
+// necessary; returns how c was formatted.
+static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {
+  switch (c) {
+    case L'\'':
+      *os << "'";
+      return kAsIs;
+    case L'"':
+      *os << "\\\"";
+      return kSpecialEscape;
+    default:
+      return PrintAsCharLiteralTo<wchar_t>(c, os);
+  }
+}
+
+// Prints a char c as if it's part of a string literal, escaping it when
+// necessary; returns how c was formatted.
+static CharFormat PrintAsStringLiteralTo(char c, ostream* os) {
+  return PrintAsStringLiteralTo(
+      static_cast<wchar_t>(static_cast<unsigned char>(c)), os);
+}
+
+// Prints a wide or narrow character c and its code.  '\0' is printed
+// as "'\\0'", other unprintable characters are also properly escaped
+// using the standard C++ escape sequence.  The template argument
+// UnsignedChar is the unsigned version of Char, which is the type of c.
+template <typename UnsignedChar, typename Char>
+void PrintCharAndCodeTo(Char c, ostream* os) {
+  // First, print c as a literal in the most readable form we can find.
+  *os << ((sizeof(c) > 1) ? "L'" : "'");
+  const CharFormat format = PrintAsCharLiteralTo<UnsignedChar>(c, os);
+  *os << "'";
+
+  // To aid user debugging, we also print c's code in decimal, unless
+  // it's 0 (in which case c was printed as '\\0', making the code
+  // obvious).
+  if (c == 0)
+    return;
+  *os << " (" << static_cast<int>(c);
+
+  // For more convenience, we print c's code again in hexidecimal,
+  // unless c was already printed in the form '\x##' or the code is in
+  // [1, 9].
+  if (format == kHexEscape || (1 <= c && c <= 9)) {
+    // Do nothing.
+  } else {
+    *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c));
+  }
+  *os << ")";
+}
+
+void PrintTo(unsigned char c, ::std::ostream* os) {
+  PrintCharAndCodeTo<unsigned char>(c, os);
+}
+void PrintTo(signed char c, ::std::ostream* os) {
+  PrintCharAndCodeTo<unsigned char>(c, os);
+}
+
+// Prints a wchar_t as a symbol if it is printable or as its internal
+// code otherwise and also as its code.  L'\0' is printed as "L'\\0'".
+void PrintTo(wchar_t wc, ostream* os) {
+  PrintCharAndCodeTo<wchar_t>(wc, os);
+}
+
+// Prints the given array of characters to the ostream.  CharType must be either
+// char or wchar_t.
+// The array starts at begin, the length is len, it may include '\0' characters
+// and may not be NUL-terminated.
+template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+static void PrintCharsAsStringTo(
+    const CharType* begin, size_t len, ostream* os) {
+  const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
+  *os << kQuoteBegin;
+  bool is_previous_hex = false;
+  for (size_t index = 0; index < len; ++index) {
+    const CharType cur = begin[index];
+    if (is_previous_hex && IsXDigit(cur)) {
+      // Previous character is of '\x..' form and this character can be
+      // interpreted as another hexadecimal digit in its number. Break string to
+      // disambiguate.
+      *os << "\" " << kQuoteBegin;
+    }
+    is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;
+  }
+  *os << "\"";
+}
+
+// Prints a (const) char/wchar_t array of 'len' elements, starting at address
+// 'begin'.  CharType must be either char or wchar_t.
+template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+static void UniversalPrintCharArray(
+    const CharType* begin, size_t len, ostream* os) {
+  // The code
+  //   const char kFoo[] = "foo";
+  // generates an array of 4, not 3, elements, with the last one being '\0'.
+  //
+  // Therefore when printing a char array, we don't print the last element if
+  // it's '\0', such that the output matches the string literal as it's
+  // written in the source code.
+  if (len > 0 && begin[len - 1] == '\0') {
+    PrintCharsAsStringTo(begin, len - 1, os);
+    return;
+  }
+
+  // If, however, the last element in the array is not '\0', e.g.
+  //    const char kFoo[] = { 'f', 'o', 'o' };
+  // we must print the entire array.  We also print a message to indicate
+  // that the array is not NUL-terminated.
+  PrintCharsAsStringTo(begin, len, os);
+  *os << " (no terminating NUL)";
+}
+
+// Prints a (const) char array of 'len' elements, starting at address 'begin'.
+void UniversalPrintArray(const char* begin, size_t len, ostream* os) {
+  UniversalPrintCharArray(begin, len, os);
+}
+
+// Prints a (const) wchar_t array of 'len' elements, starting at address
+// 'begin'.
+void UniversalPrintArray(const wchar_t* begin, size_t len, ostream* os) {
+  UniversalPrintCharArray(begin, len, os);
+}
+
+// Prints the given C string to the ostream.
+void PrintTo(const char* s, ostream* os) {
+  if (s == NULL) {
+    *os << "NULL";
+  } else {
+    *os << ImplicitCast_<const void*>(s) << " pointing to ";
+    PrintCharsAsStringTo(s, strlen(s), os);
+  }
+}
+
+// MSVC compiler can be configured to define whar_t as a typedef
+// of unsigned short. Defining an overload for const wchar_t* in that case
+// would cause pointers to unsigned shorts be printed as wide strings,
+// possibly accessing more memory than intended and causing invalid
+// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when
+// wchar_t is implemented as a native type.
+#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
+// Prints the given wide C string to the ostream.
+void PrintTo(const wchar_t* s, ostream* os) {
+  if (s == NULL) {
+    *os << "NULL";
+  } else {
+    *os << ImplicitCast_<const void*>(s) << " pointing to ";
+    PrintCharsAsStringTo(s, std::wcslen(s), os);
+  }
+}
+#endif  // wchar_t is native
+
+// Prints a ::string object.
+#if GTEST_HAS_GLOBAL_STRING
+void PrintStringTo(const ::string& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+void PrintStringTo(const ::std::string& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+
+// Prints a ::wstring object.
+#if GTEST_HAS_GLOBAL_WSTRING
+void PrintWideStringTo(const ::wstring& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+#if GTEST_HAS_STD_WSTRING
+void PrintWideStringTo(const ::std::wstring& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+}  // namespace internal
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-test-part.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-test-part.cc
new file mode 100644
index 0000000..fb0e354
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-test-part.cc
@@ -0,0 +1,110 @@
+// 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: mheule@google.com (Markus Heule)
+//
+// The Google C++ Testing Framework (Google Test)
+
+#include "gtest/gtest-test-part.h"
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+namespace testing {
+
+using internal::GetUnitTestImpl;
+
+// Gets the summary of the failure message by omitting the stack trace
+// in it.
+std::string TestPartResult::ExtractSummary(const char* message) {
+  const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
+  return stack_trace == NULL ? message :
+      std::string(message, stack_trace);
+}
+
+// Prints a TestPartResult object.
+std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
+  return os
+      << result.file_name() << ":" << result.line_number() << ": "
+      << (result.type() == TestPartResult::kSuccess ? "Success" :
+          result.type() == TestPartResult::kFatalFailure ? "Fatal failure" :
+          "Non-fatal failure") << ":\n"
+      << result.message() << std::endl;
+}
+
+// Appends a TestPartResult to the array.
+void TestPartResultArray::Append(const TestPartResult& result) {
+  array_.push_back(result);
+}
+
+// Returns the TestPartResult at the given index (0-based).
+const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
+  if (index < 0 || index >= size()) {
+    printf("\nInvalid index (%d) into TestPartResultArray.\n", index);
+    internal::posix::Abort();
+  }
+
+  return array_[index];
+}
+
+// Returns the number of TestPartResult objects in the array.
+int TestPartResultArray::size() const {
+  return static_cast<int>(array_.size());
+}
+
+namespace internal {
+
+HasNewFatalFailureHelper::HasNewFatalFailureHelper()
+    : has_new_fatal_failure_(false),
+      original_reporter_(GetUnitTestImpl()->
+                         GetTestPartResultReporterForCurrentThread()) {
+  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
+}
+
+HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
+  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
+      original_reporter_);
+}
+
+void HasNewFatalFailureHelper::ReportTestPartResult(
+    const TestPartResult& result) {
+  if (result.fatally_failed())
+    has_new_fatal_failure_ = true;
+  original_reporter_->ReportTestPartResult(result);
+}
+
+}  // namespace internal
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest-typed-test.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest-typed-test.cc
new file mode 100644
index 0000000..df1eef4
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest-typed-test.cc
@@ -0,0 +1,118 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include "gtest/gtest-typed-test.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+namespace internal {
+
+#if GTEST_HAS_TYPED_TEST_P
+
+// Skips to the first non-space char in str. Returns an empty string if str
+// contains only whitespace characters.
+static const char* SkipSpaces(const char* str) {
+  while (IsSpace(*str))
+    str++;
+  return str;
+}
+
+static std::vector<std::string> SplitIntoTestNames(const char* src) {
+  std::vector<std::string> name_vec;
+  src = SkipSpaces(src);
+  for (; src != NULL; src = SkipComma(src)) {
+    name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
+  }
+  return name_vec;
+}
+
+// Verifies that registered_tests match the test names in
+// registered_tests_; returns registered_tests if successful, or
+// aborts the program otherwise.
+const char* TypedTestCasePState::VerifyRegisteredTestNames(
+    const char* file, int line, const char* registered_tests) {
+  typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
+  registered_ = true;
+
+  std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
+
+  Message errors;
+
+  std::set<std::string> tests;
+  for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
+       name_it != name_vec.end(); ++name_it) {
+    const std::string& name = *name_it;
+    if (tests.count(name) != 0) {
+      errors << "Test " << name << " is listed more than once.\n";
+      continue;
+    }
+
+    bool found = false;
+    for (RegisteredTestIter it = registered_tests_.begin();
+         it != registered_tests_.end();
+         ++it) {
+      if (name == it->first) {
+        found = true;
+        break;
+      }
+    }
+
+    if (found) {
+      tests.insert(name);
+    } else {
+      errors << "No test named " << name
+             << " can be found in this test case.\n";
+    }
+  }
+
+  for (RegisteredTestIter it = registered_tests_.begin();
+       it != registered_tests_.end();
+       ++it) {
+    if (tests.count(it->first) == 0) {
+      errors << "You forgot to list test " << it->first << ".\n";
+    }
+  }
+
+  const std::string& errors_str = errors.GetString();
+  if (errors_str != "") {
+    fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
+            errors_str.c_str());
+    fflush(stderr);
+    posix::Abort();
+  }
+
+  return registered_tests;
+}
+
+#endif  // GTEST_HAS_TYPED_TEST_P
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest.cc
new file mode 100644
index 0000000..d882ab2
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest.cc
@@ -0,0 +1,5388 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+
+#include "gtest/gtest.h"
+#include "gtest/internal/custom/gtest.h"
+#include "gtest/gtest-spi.h"
+
+#include <ctype.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#include <algorithm>
+#include <iomanip>
+#include <limits>
+#include <list>
+#include <map>
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <vector>
+
+#if GTEST_OS_LINUX
+
+// TODO(kenton@google.com): Use autoconf to detect availability of
+// gettimeofday().
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+
+# include <fcntl.h>  // NOLINT
+# include <limits.h>  // NOLINT
+# include <sched.h>  // NOLINT
+// Declares vsnprintf().  This header is not available on Windows.
+# include <strings.h>  // NOLINT
+# include <sys/mman.h>  // NOLINT
+# include <sys/time.h>  // NOLINT
+# include <unistd.h>  // NOLINT
+# include <string>
+
+#elif GTEST_OS_SYMBIAN
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+# include <sys/time.h>  // NOLINT
+
+#elif GTEST_OS_ZOS
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+# include <sys/time.h>  // NOLINT
+
+// On z/OS we additionally need strings.h for strcasecmp.
+# include <strings.h>  // NOLINT
+
+#elif GTEST_OS_WINDOWS_MOBILE  // We are on Windows CE.
+
+# include <windows.h>  // NOLINT
+# undef min
+
+#elif GTEST_OS_WINDOWS  // We are on Windows proper.
+
+# include <io.h>  // NOLINT
+# include <sys/timeb.h>  // NOLINT
+# include <sys/types.h>  // NOLINT
+# include <sys/stat.h>  // NOLINT
+
+# if GTEST_OS_WINDOWS_MINGW
+// MinGW has gettimeofday() but not _ftime64().
+// TODO(kenton@google.com): Use autoconf to detect availability of
+//   gettimeofday().
+// TODO(kenton@google.com): There are other ways to get the time on
+//   Windows, like GetTickCount() or GetSystemTimeAsFileTime().  MinGW
+//   supports these.  consider using them instead.
+#  define GTEST_HAS_GETTIMEOFDAY_ 1
+#  include <sys/time.h>  // NOLINT
+# endif  // GTEST_OS_WINDOWS_MINGW
+
+// cpplint thinks that the header is already included, so we want to
+// silence it.
+# include <windows.h>  // NOLINT
+# undef min
+
+#else
+
+// Assume other platforms have gettimeofday().
+// TODO(kenton@google.com): Use autoconf to detect availability of
+//   gettimeofday().
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+
+// cpplint thinks that the header is already included, so we want to
+// silence it.
+# include <sys/time.h>  // NOLINT
+# include <unistd.h>  // NOLINT
+
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_HAS_EXCEPTIONS
+# include <stdexcept>
+#endif
+
+#if GTEST_CAN_STREAM_RESULTS_
+# include <arpa/inet.h>  // NOLINT
+# include <netdb.h>  // NOLINT
+# include <sys/socket.h>  // NOLINT
+# include <sys/types.h>  // NOLINT
+#endif
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick is to
+// prevent a user from accidentally including gtest-internal-inl.h in
+// his code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+#if GTEST_OS_WINDOWS
+# define vsnprintf _vsnprintf
+#endif  // GTEST_OS_WINDOWS
+
+namespace testing {
+
+using internal::CountIf;
+using internal::ForEach;
+using internal::GetElementOr;
+using internal::Shuffle;
+
+// Constants.
+
+// A test whose test case name or test name matches this filter is
+// disabled and not run.
+static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
+
+// A test case whose name matches this filter is considered a death
+// test case and will be run before test cases whose name doesn't
+// match this filter.
+static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";
+
+// A test filter that matches everything.
+static const char kUniversalFilter[] = "*";
+
+// The default output file for XML output.
+static const char kDefaultOutputFile[] = "test_detail.xml";
+
+// The environment variable name for the test shard index.
+static const char kTestShardIndex[] = "GTEST_SHARD_INDEX";
+// The environment variable name for the total number of test shards.
+static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS";
+// The environment variable name for the test shard status file.
+static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE";
+
+namespace internal {
+
+// The text used in failure messages to indicate the start of the
+// stack trace.
+const char kStackTraceMarker[] = "\nStack trace:\n";
+
+// g_help_flag is true iff the --help flag or an equivalent form is
+// specified on the command line.
+bool g_help_flag = false;
+
+}  // namespace internal
+
+static const char* GetDefaultFilter() {
+#ifdef GTEST_TEST_FILTER_ENV_VAR_
+  const char* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_);
+  if (testbridge_test_only != NULL) {
+    return testbridge_test_only;
+  }
+#endif  // GTEST_TEST_FILTER_ENV_VAR_
+  return kUniversalFilter;
+}
+
+GTEST_DEFINE_bool_(
+    also_run_disabled_tests,
+    internal::BoolFromGTestEnv("also_run_disabled_tests", false),
+    "Run disabled tests too, in addition to the tests normally being run.");
+
+GTEST_DEFINE_bool_(
+    break_on_failure,
+    internal::BoolFromGTestEnv("break_on_failure", false),
+    "True iff a failed assertion should be a debugger break-point.");
+
+GTEST_DEFINE_bool_(
+    catch_exceptions,
+    internal::BoolFromGTestEnv("catch_exceptions", true),
+    "True iff " GTEST_NAME_
+    " should catch exceptions and treat them as test failures.");
+
+GTEST_DEFINE_string_(
+    color,
+    internal::StringFromGTestEnv("color", "auto"),
+    "Whether to use colors in the output.  Valid values: yes, no, "
+    "and auto.  'auto' means to use colors if the output is "
+    "being sent to a terminal and the TERM environment variable "
+    "is set to a terminal type that supports colors.");
+
+GTEST_DEFINE_string_(
+    filter,
+    internal::StringFromGTestEnv("filter", GetDefaultFilter()),
+    "A colon-separated list of glob (not regex) patterns "
+    "for filtering the tests to run, optionally followed by a "
+    "'-' and a : separated list of negative patterns (tests to "
+    "exclude).  A test is run if it matches one of the positive "
+    "patterns and does not match any of the negative patterns.");
+
+GTEST_DEFINE_bool_(list_tests, false,
+                   "List all tests without running them.");
+
+GTEST_DEFINE_string_(
+    output,
+    internal::StringFromGTestEnv("output", ""),
+    "A format (currently must be \"xml\"), optionally followed "
+    "by a colon and an output file name or directory. A directory "
+    "is indicated by a trailing pathname separator. "
+    "Examples: \"xml:filename.xml\", \"xml::directoryname/\". "
+    "If a directory is specified, output files will be created "
+    "within that directory, with file-names based on the test "
+    "executable's name and, if necessary, made unique by adding "
+    "digits.");
+
+GTEST_DEFINE_bool_(
+    print_time,
+    internal::BoolFromGTestEnv("print_time", true),
+    "True iff " GTEST_NAME_
+    " should display elapsed time in text output.");
+
+GTEST_DEFINE_int32_(
+    random_seed,
+    internal::Int32FromGTestEnv("random_seed", 0),
+    "Random number seed to use when shuffling test orders.  Must be in range "
+    "[1, 99999], or 0 to use a seed based on the current time.");
+
+GTEST_DEFINE_int32_(
+    repeat,
+    internal::Int32FromGTestEnv("repeat", 1),
+    "How many times to repeat each test.  Specify a negative number "
+    "for repeating forever.  Useful for shaking out flaky tests.");
+
+GTEST_DEFINE_bool_(
+    show_internal_stack_frames, false,
+    "True iff " GTEST_NAME_ " should include internal stack frames when "
+    "printing test failure stack traces.");
+
+GTEST_DEFINE_bool_(
+    shuffle,
+    internal::BoolFromGTestEnv("shuffle", false),
+    "True iff " GTEST_NAME_
+    " should randomize tests' order on every run.");
+
+GTEST_DEFINE_int32_(
+    stack_trace_depth,
+    internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth),
+    "The maximum number of stack frames to print when an "
+    "assertion fails.  The valid range is 0 through 100, inclusive.");
+
+GTEST_DEFINE_string_(
+    stream_result_to,
+    internal::StringFromGTestEnv("stream_result_to", ""),
+    "This flag specifies the host name and the port number on which to stream "
+    "test results. Example: \"localhost:555\". The flag is effective only on "
+    "Linux.");
+
+GTEST_DEFINE_bool_(
+    throw_on_failure,
+    internal::BoolFromGTestEnv("throw_on_failure", false),
+    "When this flag is specified, a failed assertion will throw an exception "
+    "if exceptions are enabled or exit the program with a non-zero code "
+    "otherwise.");
+
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+GTEST_DEFINE_string_(
+    flagfile,
+    internal::StringFromGTestEnv("flagfile", ""),
+    "This flag specifies the flagfile to read command-line flags from.");
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+
+namespace internal {
+
+// Generates a random number from [0, range), using a Linear
+// Congruential Generator (LCG).  Crashes if 'range' is 0 or greater
+// than kMaxRange.
+UInt32 Random::Generate(UInt32 range) {
+  // These constants are the same as are used in glibc's rand(3).
+  state_ = (1103515245U*state_ + 12345U) % kMaxRange;
+
+  GTEST_CHECK_(range > 0)
+      << "Cannot generate a number in the range [0, 0).";
+  GTEST_CHECK_(range <= kMaxRange)
+      << "Generation of a number in [0, " << range << ") was requested, "
+      << "but this can only generate numbers in [0, " << kMaxRange << ").";
+
+  // Converting via modulus introduces a bit of downward bias, but
+  // it's simple, and a linear congruential generator isn't too good
+  // to begin with.
+  return state_ % range;
+}
+
+// GTestIsInitialized() returns true iff the user has initialized
+// Google Test.  Useful for catching the user mistake of not initializing
+// Google Test before calling RUN_ALL_TESTS().
+static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
+
+// Iterates over a vector of TestCases, keeping a running sum of the
+// results of calling a given int-returning method on each.
+// Returns the sum.
+static int SumOverTestCaseList(const std::vector<TestCase*>& case_list,
+                               int (TestCase::*method)() const) {
+  int sum = 0;
+  for (size_t i = 0; i < case_list.size(); i++) {
+    sum += (case_list[i]->*method)();
+  }
+  return sum;
+}
+
+// Returns true iff the test case passed.
+static bool TestCasePassed(const TestCase* test_case) {
+  return test_case->should_run() && test_case->Passed();
+}
+
+// Returns true iff the test case failed.
+static bool TestCaseFailed(const TestCase* test_case) {
+  return test_case->should_run() && test_case->Failed();
+}
+
+// Returns true iff test_case contains at least one test that should
+// run.
+static bool ShouldRunTestCase(const TestCase* test_case) {
+  return test_case->should_run();
+}
+
+// AssertHelper constructor.
+AssertHelper::AssertHelper(TestPartResult::Type type,
+                           const char* file,
+                           int line,
+                           const char* message)
+    : data_(new AssertHelperData(type, file, line, message)) {
+}
+
+AssertHelper::~AssertHelper() {
+  delete data_;
+}
+
+// Message assignment, for assertion streaming support.
+void AssertHelper::operator=(const Message& message) const {
+  UnitTest::GetInstance()->
+    AddTestPartResult(data_->type, data_->file, data_->line,
+                      AppendUserMessage(data_->message, message),
+                      UnitTest::GetInstance()->impl()
+                      ->CurrentOsStackTraceExceptTop(1)
+                      // Skips the stack frame for this function itself.
+                      );  // NOLINT
+}
+
+// Mutex for linked pointers.
+GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
+
+// A copy of all command line arguments.  Set by InitGoogleTest().
+::std::vector<testing::internal::string> g_argvs;
+
+const ::std::vector<testing::internal::string>& GetArgvs() {
+#if defined(GTEST_CUSTOM_GET_ARGVS_)
+  return GTEST_CUSTOM_GET_ARGVS_();
+#else  // defined(GTEST_CUSTOM_GET_ARGVS_)
+  return g_argvs;
+#endif  // defined(GTEST_CUSTOM_GET_ARGVS_)
+}
+
+// Returns the current application's name, removing directory path if that
+// is present.
+FilePath GetCurrentExecutableName() {
+  FilePath result;
+
+#if GTEST_OS_WINDOWS
+  result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
+#else
+  result.Set(FilePath(GetArgvs()[0]));
+#endif  // GTEST_OS_WINDOWS
+
+  return result.RemoveDirectoryName();
+}
+
+// Functions for processing the gtest_output flag.
+
+// Returns the output format, or "" for normal printed output.
+std::string UnitTestOptions::GetOutputFormat() {
+  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
+  if (gtest_output_flag == NULL) return std::string("");
+
+  const char* const colon = strchr(gtest_output_flag, ':');
+  return (colon == NULL) ?
+      std::string(gtest_output_flag) :
+      std::string(gtest_output_flag, colon - gtest_output_flag);
+}
+
+// Returns the name of the requested output file, or the default if none
+// was explicitly specified.
+std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
+  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
+  if (gtest_output_flag == NULL)
+    return "";
+
+  const char* const colon = strchr(gtest_output_flag, ':');
+  if (colon == NULL)
+    return internal::FilePath::ConcatPaths(
+        internal::FilePath(
+            UnitTest::GetInstance()->original_working_dir()),
+        internal::FilePath(kDefaultOutputFile)).string();
+
+  internal::FilePath output_name(colon + 1);
+  if (!output_name.IsAbsolutePath())
+    // TODO(wan@google.com): on Windows \some\path is not an absolute
+    // path (as its meaning depends on the current drive), yet the
+    // following logic for turning it into an absolute path is wrong.
+    // Fix it.
+    output_name = internal::FilePath::ConcatPaths(
+        internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
+        internal::FilePath(colon + 1));
+
+  if (!output_name.IsDirectory())
+    return output_name.string();
+
+  internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
+      output_name, internal::GetCurrentExecutableName(),
+      GetOutputFormat().c_str()));
+  return result.string();
+}
+
+// Returns true iff the wildcard pattern matches the string.  The
+// first ':' or '\0' character in pattern marks the end of it.
+//
+// This recursive algorithm isn't very efficient, but is clear and
+// works well enough for matching test names, which are short.
+bool UnitTestOptions::PatternMatchesString(const char *pattern,
+                                           const char *str) {
+  switch (*pattern) {
+    case '\0':
+    case ':':  // Either ':' or '\0' marks the end of the pattern.
+      return *str == '\0';
+    case '?':  // Matches any single character.
+      return *str != '\0' && PatternMatchesString(pattern + 1, str + 1);
+    case '*':  // Matches any string (possibly empty) of characters.
+      return (*str != '\0' && PatternMatchesString(pattern, str + 1)) ||
+          PatternMatchesString(pattern + 1, str);
+    default:  // Non-special character.  Matches itself.
+      return *pattern == *str &&
+          PatternMatchesString(pattern + 1, str + 1);
+  }
+}
+
+bool UnitTestOptions::MatchesFilter(
+    const std::string& name, const char* filter) {
+  const char *cur_pattern = filter;
+  for (;;) {
+    if (PatternMatchesString(cur_pattern, name.c_str())) {
+      return true;
+    }
+
+    // Finds the next pattern in the filter.
+    cur_pattern = strchr(cur_pattern, ':');
+
+    // Returns if no more pattern can be found.
+    if (cur_pattern == NULL) {
+      return false;
+    }
+
+    // Skips the pattern separater (the ':' character).
+    cur_pattern++;
+  }
+}
+
+// Returns true iff the user-specified filter matches the test case
+// name and the test name.
+bool UnitTestOptions::FilterMatchesTest(const std::string &test_case_name,
+                                        const std::string &test_name) {
+  const std::string& full_name = test_case_name + "." + test_name.c_str();
+
+  // Split --gtest_filter at '-', if there is one, to separate into
+  // positive filter and negative filter portions
+  const char* const p = GTEST_FLAG(filter).c_str();
+  const char* const dash = strchr(p, '-');
+  std::string positive;
+  std::string negative;
+  if (dash == NULL) {
+    positive = GTEST_FLAG(filter).c_str();  // Whole string is a positive filter
+    negative = "";
+  } else {
+    positive = std::string(p, dash);   // Everything up to the dash
+    negative = std::string(dash + 1);  // Everything after the dash
+    if (positive.empty()) {
+      // Treat '-test1' as the same as '*-test1'
+      positive = kUniversalFilter;
+    }
+  }
+
+  // A filter is a colon-separated list of patterns.  It matches a
+  // test if any pattern in it matches the test.
+  return (MatchesFilter(full_name, positive.c_str()) &&
+          !MatchesFilter(full_name, negative.c_str()));
+}
+
+#if GTEST_HAS_SEH
+// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
+// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
+// This function is useful as an __except condition.
+int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {
+  // Google Test should handle a SEH exception if:
+  //   1. the user wants it to, AND
+  //   2. this is not a breakpoint exception, AND
+  //   3. this is not a C++ exception (VC++ implements them via SEH,
+  //      apparently).
+  //
+  // SEH exception code for C++ exceptions.
+  // (see http://support.microsoft.com/kb/185294 for more information).
+  const DWORD kCxxExceptionCode = 0xe06d7363;
+
+  bool should_handle = true;
+
+  if (!GTEST_FLAG(catch_exceptions))
+    should_handle = false;
+  else if (exception_code == EXCEPTION_BREAKPOINT)
+    should_handle = false;
+  else if (exception_code == kCxxExceptionCode)
+    should_handle = false;
+
+  return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
+}
+#endif  // GTEST_HAS_SEH
+
+}  // namespace internal
+
+// The c'tor sets this object as the test part result reporter used by
+// Google Test.  The 'result' parameter specifies where to report the
+// results. Intercepts only failures from the current thread.
+ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
+    TestPartResultArray* result)
+    : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),
+      result_(result) {
+  Init();
+}
+
+// The c'tor sets this object as the test part result reporter used by
+// Google Test.  The 'result' parameter specifies where to report the
+// results.
+ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
+    InterceptMode intercept_mode, TestPartResultArray* result)
+    : intercept_mode_(intercept_mode),
+      result_(result) {
+  Init();
+}
+
+void ScopedFakeTestPartResultReporter::Init() {
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
+    old_reporter_ = impl->GetGlobalTestPartResultReporter();
+    impl->SetGlobalTestPartResultReporter(this);
+  } else {
+    old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();
+    impl->SetTestPartResultReporterForCurrentThread(this);
+  }
+}
+
+// The d'tor restores the test part result reporter used by Google Test
+// before.
+ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
+    impl->SetGlobalTestPartResultReporter(old_reporter_);
+  } else {
+    impl->SetTestPartResultReporterForCurrentThread(old_reporter_);
+  }
+}
+
+// Increments the test part result count and remembers the result.
+// This method is from the TestPartResultReporterInterface interface.
+void ScopedFakeTestPartResultReporter::ReportTestPartResult(
+    const TestPartResult& result) {
+  result_->Append(result);
+}
+
+namespace internal {
+
+// Returns the type ID of ::testing::Test.  We should always call this
+// instead of GetTypeId< ::testing::Test>() to get the type ID of
+// testing::Test.  This is to work around a suspected linker bug when
+// using Google Test as a framework on Mac OS X.  The bug causes
+// GetTypeId< ::testing::Test>() to return different values depending
+// on whether the call is from the Google Test framework itself or
+// from user test code.  GetTestTypeId() is guaranteed to always
+// return the same value, as it always calls GetTypeId<>() from the
+// gtest.cc, which is within the Google Test framework.
+TypeId GetTestTypeId() {
+  return GetTypeId<Test>();
+}
+
+// The value of GetTestTypeId() as seen from within the Google Test
+// library.  This is solely for testing GetTestTypeId().
+extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();
+
+// This predicate-formatter checks that 'results' contains a test part
+// failure of the given type and that the failure message contains the
+// given substring.
+AssertionResult HasOneFailure(const char* /* results_expr */,
+                              const char* /* type_expr */,
+                              const char* /* substr_expr */,
+                              const TestPartResultArray& results,
+                              TestPartResult::Type type,
+                              const string& substr) {
+  const std::string expected(type == TestPartResult::kFatalFailure ?
+                        "1 fatal failure" :
+                        "1 non-fatal failure");
+  Message msg;
+  if (results.size() != 1) {
+    msg << "Expected: " << expected << "\n"
+        << "  Actual: " << results.size() << " failures";
+    for (int i = 0; i < results.size(); i++) {
+      msg << "\n" << results.GetTestPartResult(i);
+    }
+    return AssertionFailure() << msg;
+  }
+
+  const TestPartResult& r = results.GetTestPartResult(0);
+  if (r.type() != type) {
+    return AssertionFailure() << "Expected: " << expected << "\n"
+                              << "  Actual:\n"
+                              << r;
+  }
+
+  if (strstr(r.message(), substr.c_str()) == NULL) {
+    return AssertionFailure() << "Expected: " << expected << " containing \""
+                              << substr << "\"\n"
+                              << "  Actual:\n"
+                              << r;
+  }
+
+  return AssertionSuccess();
+}
+
+// The constructor of SingleFailureChecker remembers where to look up
+// test part results, what type of failure we expect, and what
+// substring the failure message should contain.
+SingleFailureChecker:: SingleFailureChecker(
+    const TestPartResultArray* results,
+    TestPartResult::Type type,
+    const string& substr)
+    : results_(results),
+      type_(type),
+      substr_(substr) {}
+
+// The destructor of SingleFailureChecker verifies that the given
+// TestPartResultArray contains exactly one failure that has the given
+// type and contains the given substring.  If that's not the case, a
+// non-fatal failure will be generated.
+SingleFailureChecker::~SingleFailureChecker() {
+  EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);
+}
+
+DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
+    UnitTestImpl* unit_test) : unit_test_(unit_test) {}
+
+void DefaultGlobalTestPartResultReporter::ReportTestPartResult(
+    const TestPartResult& result) {
+  unit_test_->current_test_result()->AddTestPartResult(result);
+  unit_test_->listeners()->repeater()->OnTestPartResult(result);
+}
+
+DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(
+    UnitTestImpl* unit_test) : unit_test_(unit_test) {}
+
+void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
+    const TestPartResult& result) {
+  unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);
+}
+
+// Returns the global test part result reporter.
+TestPartResultReporterInterface*
+UnitTestImpl::GetGlobalTestPartResultReporter() {
+  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
+  return global_test_part_result_repoter_;
+}
+
+// Sets the global test part result reporter.
+void UnitTestImpl::SetGlobalTestPartResultReporter(
+    TestPartResultReporterInterface* reporter) {
+  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
+  global_test_part_result_repoter_ = reporter;
+}
+
+// Returns the test part result reporter for the current thread.
+TestPartResultReporterInterface*
+UnitTestImpl::GetTestPartResultReporterForCurrentThread() {
+  return per_thread_test_part_result_reporter_.get();
+}
+
+// Sets the test part result reporter for the current thread.
+void UnitTestImpl::SetTestPartResultReporterForCurrentThread(
+    TestPartResultReporterInterface* reporter) {
+  per_thread_test_part_result_reporter_.set(reporter);
+}
+
+// Gets the number of successful test cases.
+int UnitTestImpl::successful_test_case_count() const {
+  return CountIf(test_cases_, TestCasePassed);
+}
+
+// Gets the number of failed test cases.
+int UnitTestImpl::failed_test_case_count() const {
+  return CountIf(test_cases_, TestCaseFailed);
+}
+
+// Gets the number of all test cases.
+int UnitTestImpl::total_test_case_count() const {
+  return static_cast<int>(test_cases_.size());
+}
+
+// Gets the number of all test cases that contain at least one test
+// that should run.
+int UnitTestImpl::test_case_to_run_count() const {
+  return CountIf(test_cases_, ShouldRunTestCase);
+}
+
+// Gets the number of successful tests.
+int UnitTestImpl::successful_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);
+}
+
+// Gets the number of failed tests.
+int UnitTestImpl::failed_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);
+}
+
+// Gets the number of disabled tests that will be reported in the XML report.
+int UnitTestImpl::reportable_disabled_test_count() const {
+  return SumOverTestCaseList(test_cases_,
+                             &TestCase::reportable_disabled_test_count);
+}
+
+// Gets the number of disabled tests.
+int UnitTestImpl::disabled_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);
+}
+
+// Gets the number of tests to be printed in the XML report.
+int UnitTestImpl::reportable_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::reportable_test_count);
+}
+
+// Gets the number of all tests.
+int UnitTestImpl::total_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);
+}
+
+// Gets the number of tests that should run.
+int UnitTestImpl::test_to_run_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);
+}
+
+// Returns the current OS stack trace as an std::string.
+//
+// The maximum number of stack frames to be included is specified by
+// the gtest_stack_trace_depth flag.  The skip_count parameter
+// specifies the number of top frames to be skipped, which doesn't
+// count against the number of frames to be included.
+//
+// For example, if Foo() calls Bar(), which in turn calls
+// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
+// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
+std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
+  return os_stack_trace_getter()->CurrentStackTrace(
+      static_cast<int>(GTEST_FLAG(stack_trace_depth)),
+      skip_count + 1
+      // Skips the user-specified number of frames plus this function
+      // itself.
+      );  // NOLINT
+}
+
+// Returns the current time in milliseconds.
+TimeInMillis GetTimeInMillis() {
+#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)
+  // Difference between 1970-01-01 and 1601-01-01 in milliseconds.
+  // http://analogous.blogspot.com/2005/04/epoch.html
+  const TimeInMillis kJavaEpochToWinFileTimeDelta =
+    static_cast<TimeInMillis>(116444736UL) * 100000UL;
+  const DWORD kTenthMicrosInMilliSecond = 10000;
+
+  SYSTEMTIME now_systime;
+  FILETIME now_filetime;
+  ULARGE_INTEGER now_int64;
+  // TODO(kenton@google.com): Shouldn't this just use
+  //   GetSystemTimeAsFileTime()?
+  GetSystemTime(&now_systime);
+  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
+    now_int64.LowPart = now_filetime.dwLowDateTime;
+    now_int64.HighPart = now_filetime.dwHighDateTime;
+    now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -
+      kJavaEpochToWinFileTimeDelta;
+    return now_int64.QuadPart;
+  }
+  return 0;
+#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
+  __timeb64 now;
+
+  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
+  // (deprecated function) there.
+  // TODO(kenton@google.com): Use GetTickCount()?  Or use
+  //   SystemTimeToFileTime()
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+  _ftime64(&now);
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
+#elif GTEST_HAS_GETTIMEOFDAY_
+  struct timeval now;
+  gettimeofday(&now, NULL);
+  return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;
+#else
+# error "Don't know how to get the current time on your system."
+#endif
+}
+
+// Utilities
+
+// class String.
+
+#if GTEST_OS_WINDOWS_MOBILE
+// Creates a UTF-16 wide string from the given ANSI string, allocating
+// memory using new. The caller is responsible for deleting the return
+// value using delete[]. Returns the wide string, or NULL if the
+// input is NULL.
+LPCWSTR String::AnsiToUtf16(const char* ansi) {
+  if (!ansi) return NULL;
+  const int length = strlen(ansi);
+  const int unicode_length =
+      MultiByteToWideChar(CP_ACP, 0, ansi, length,
+                          NULL, 0);
+  WCHAR* unicode = new WCHAR[unicode_length + 1];
+  MultiByteToWideChar(CP_ACP, 0, ansi, length,
+                      unicode, unicode_length);
+  unicode[unicode_length] = 0;
+  return unicode;
+}
+
+// Creates an ANSI string from the given wide string, allocating
+// memory using new. The caller is responsible for deleting the return
+// value using delete[]. Returns the ANSI string, or NULL if the
+// input is NULL.
+const char* String::Utf16ToAnsi(LPCWSTR utf16_str)  {
+  if (!utf16_str) return NULL;
+  const int ansi_length =
+      WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
+                          NULL, 0, NULL, NULL);
+  char* ansi = new char[ansi_length + 1];
+  WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
+                      ansi, ansi_length, NULL, NULL);
+  ansi[ansi_length] = 0;
+  return ansi;
+}
+
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+// Compares two C strings.  Returns true iff they have the same content.
+//
+// Unlike strcmp(), this function can handle NULL argument(s).  A NULL
+// C string is considered different to any non-NULL C string,
+// including the empty string.
+bool String::CStringEquals(const char * lhs, const char * rhs) {
+  if ( lhs == NULL ) return rhs == NULL;
+
+  if ( rhs == NULL ) return false;
+
+  return strcmp(lhs, rhs) == 0;
+}
+
+#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
+
+// Converts an array of wide chars to a narrow string using the UTF-8
+// encoding, and streams the result to the given Message object.
+static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
+                                     Message* msg) {
+  for (size_t i = 0; i != length; ) {  // NOLINT
+    if (wstr[i] != L'\0') {
+      *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
+      while (i != length && wstr[i] != L'\0')
+        i++;
+    } else {
+      *msg << '\0';
+      i++;
+    }
+  }
+}
+
+#endif  // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
+
+void SplitString(const ::std::string& str, char delimiter,
+                 ::std::vector< ::std::string>* dest) {
+  ::std::vector< ::std::string> parsed;
+  ::std::string::size_type pos = 0;
+  while (::testing::internal::AlwaysTrue()) {
+    const ::std::string::size_type colon = str.find(delimiter, pos);
+    if (colon == ::std::string::npos) {
+      parsed.push_back(str.substr(pos));
+      break;
+    } else {
+      parsed.push_back(str.substr(pos, colon - pos));
+      pos = colon + 1;
+    }
+  }
+  dest->swap(parsed);
+}
+
+}  // namespace internal
+
+// Constructs an empty Message.
+// We allocate the stringstream separately because otherwise each use of
+// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
+// stack frame leading to huge stack frames in some cases; gcc does not reuse
+// the stack space.
+Message::Message() : ss_(new ::std::stringstream) {
+  // By default, we want there to be enough precision when printing
+  // a double to a Message.
+  *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
+}
+
+// These two overloads allow streaming a wide C string to a Message
+// using the UTF-8 encoding.
+Message& Message::operator <<(const wchar_t* wide_c_str) {
+  return *this << internal::String::ShowWideCString(wide_c_str);
+}
+Message& Message::operator <<(wchar_t* wide_c_str) {
+  return *this << internal::String::ShowWideCString(wide_c_str);
+}
+
+#if GTEST_HAS_STD_WSTRING
+// Converts the given wide string to a narrow string using the UTF-8
+// encoding, and streams the result to this Message object.
+Message& Message::operator <<(const ::std::wstring& wstr) {
+  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
+  return *this;
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+#if GTEST_HAS_GLOBAL_WSTRING
+// Converts the given wide string to a narrow string using the UTF-8
+// encoding, and streams the result to this Message object.
+Message& Message::operator <<(const ::wstring& wstr) {
+  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
+  return *this;
+}
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+// Gets the text streamed to this object so far as an std::string.
+// Each '\0' character in the buffer is replaced with "\\0".
+std::string Message::GetString() const {
+  return internal::StringStreamToString(ss_.get());
+}
+
+// AssertionResult constructors.
+// Used in EXPECT_TRUE/FALSE(assertion_result).
+AssertionResult::AssertionResult(const AssertionResult& other)
+    : success_(other.success_),
+      message_(other.message_.get() != NULL ?
+               new ::std::string(*other.message_) :
+               static_cast< ::std::string*>(NULL)) {
+}
+
+// Swaps two AssertionResults.
+void AssertionResult::swap(AssertionResult& other) {
+  using std::swap;
+  swap(success_, other.success_);
+  swap(message_, other.message_);
+}
+
+// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
+AssertionResult AssertionResult::operator!() const {
+  AssertionResult negation(!success_);
+  if (message_.get() != NULL)
+    negation << *message_;
+  return negation;
+}
+
+// Makes a successful assertion result.
+AssertionResult AssertionSuccess() {
+  return AssertionResult(true);
+}
+
+// Makes a failed assertion result.
+AssertionResult AssertionFailure() {
+  return AssertionResult(false);
+}
+
+// Makes a failed assertion result with the given failure message.
+// Deprecated; use AssertionFailure() << message.
+AssertionResult AssertionFailure(const Message& message) {
+  return AssertionFailure() << message;
+}
+
+namespace internal {
+
+namespace edit_distance {
+std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
+                                            const std::vector<size_t>& right) {
+  std::vector<std::vector<double> > costs(
+      left.size() + 1, std::vector<double>(right.size() + 1));
+  std::vector<std::vector<EditType> > best_move(
+      left.size() + 1, std::vector<EditType>(right.size() + 1));
+
+  // Populate for empty right.
+  for (size_t l_i = 0; l_i < costs.size(); ++l_i) {
+    costs[l_i][0] = static_cast<double>(l_i);
+    best_move[l_i][0] = kRemove;
+  }
+  // Populate for empty left.
+  for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {
+    costs[0][r_i] = static_cast<double>(r_i);
+    best_move[0][r_i] = kAdd;
+  }
+
+  for (size_t l_i = 0; l_i < left.size(); ++l_i) {
+    for (size_t r_i = 0; r_i < right.size(); ++r_i) {
+      if (left[l_i] == right[r_i]) {
+        // Found a match. Consume it.
+        costs[l_i + 1][r_i + 1] = costs[l_i][r_i];
+        best_move[l_i + 1][r_i + 1] = kMatch;
+        continue;
+      }
+
+      const double add = costs[l_i + 1][r_i];
+      const double remove = costs[l_i][r_i + 1];
+      const double replace = costs[l_i][r_i];
+      if (add < remove && add < replace) {
+        costs[l_i + 1][r_i + 1] = add + 1;
+        best_move[l_i + 1][r_i + 1] = kAdd;
+      } else if (remove < add && remove < replace) {
+        costs[l_i + 1][r_i + 1] = remove + 1;
+        best_move[l_i + 1][r_i + 1] = kRemove;
+      } else {
+        // We make replace a little more expensive than add/remove to lower
+        // their priority.
+        costs[l_i + 1][r_i + 1] = replace + 1.00001;
+        best_move[l_i + 1][r_i + 1] = kReplace;
+      }
+    }
+  }
+
+  // Reconstruct the best path. We do it in reverse order.
+  std::vector<EditType> best_path;
+  for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {
+    EditType move = best_move[l_i][r_i];
+    best_path.push_back(move);
+    l_i -= move != kAdd;
+    r_i -= move != kRemove;
+  }
+  std::reverse(best_path.begin(), best_path.end());
+  return best_path;
+}
+
+namespace {
+
+// Helper class to convert string into ids with deduplication.
+class InternalStrings {
+ public:
+  size_t GetId(const std::string& str) {
+    IdMap::iterator it = ids_.find(str);
+    if (it != ids_.end()) return it->second;
+    size_t id = ids_.size();
+    return ids_[str] = id;
+  }
+
+ private:
+  typedef std::map<std::string, size_t> IdMap;
+  IdMap ids_;
+};
+
+}  // namespace
+
+std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<std::string>& left,
+    const std::vector<std::string>& right) {
+  std::vector<size_t> left_ids, right_ids;
+  {
+    InternalStrings intern_table;
+    for (size_t i = 0; i < left.size(); ++i) {
+      left_ids.push_back(intern_table.GetId(left[i]));
+    }
+    for (size_t i = 0; i < right.size(); ++i) {
+      right_ids.push_back(intern_table.GetId(right[i]));
+    }
+  }
+  return CalculateOptimalEdits(left_ids, right_ids);
+}
+
+namespace {
+
+// Helper class that holds the state for one hunk and prints it out to the
+// stream.
+// It reorders adds/removes when possible to group all removes before all
+// adds. It also adds the hunk header before printint into the stream.
+class Hunk {
+ public:
+  Hunk(size_t left_start, size_t right_start)
+      : left_start_(left_start),
+        right_start_(right_start),
+        adds_(),
+        removes_(),
+        common_() {}
+
+  void PushLine(char edit, const char* line) {
+    switch (edit) {
+      case ' ':
+        ++common_;
+        FlushEdits();
+        hunk_.push_back(std::make_pair(' ', line));
+        break;
+      case '-':
+        ++removes_;
+        hunk_removes_.push_back(std::make_pair('-', line));
+        break;
+      case '+':
+        ++adds_;
+        hunk_adds_.push_back(std::make_pair('+', line));
+        break;
+    }
+  }
+
+  void PrintTo(std::ostream* os) {
+    PrintHeader(os);
+    FlushEdits();
+    for (std::list<std::pair<char, const char*> >::const_iterator it =
+             hunk_.begin();
+         it != hunk_.end(); ++it) {
+      *os << it->first << it->second << "\n";
+    }
+  }
+
+  bool has_edits() const { return adds_ || removes_; }
+
+ private:
+  void FlushEdits() {
+    hunk_.splice(hunk_.end(), hunk_removes_);
+    hunk_.splice(hunk_.end(), hunk_adds_);
+  }
+
+  // Print a unified diff header for one hunk.
+  // The format is
+  //   "@@ -<left_start>,<left_length> +<right_start>,<right_length> @@"
+  // where the left/right parts are ommitted if unnecessary.
+  void PrintHeader(std::ostream* ss) const {
+    *ss << "@@ ";
+    if (removes_) {
+      *ss << "-" << left_start_ << "," << (removes_ + common_);
+    }
+    if (removes_ && adds_) {
+      *ss << " ";
+    }
+    if (adds_) {
+      *ss << "+" << right_start_ << "," << (adds_ + common_);
+    }
+    *ss << " @@\n";
+  }
+
+  size_t left_start_, right_start_;
+  size_t adds_, removes_, common_;
+  std::list<std::pair<char, const char*> > hunk_, hunk_adds_, hunk_removes_;
+};
+
+}  // namespace
+
+// Create a list of diff hunks in Unified diff format.
+// Each hunk has a header generated by PrintHeader above plus a body with
+// lines prefixed with ' ' for no change, '-' for deletion and '+' for
+// addition.
+// 'context' represents the desired unchanged prefix/suffix around the diff.
+// If two hunks are close enough that their contexts overlap, then they are
+// joined into one hunk.
+std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+                              const std::vector<std::string>& right,
+                              size_t context) {
+  const std::vector<EditType> edits = CalculateOptimalEdits(left, right);
+
+  size_t l_i = 0, r_i = 0, edit_i = 0;
+  std::stringstream ss;
+  while (edit_i < edits.size()) {
+    // Find first edit.
+    while (edit_i < edits.size() && edits[edit_i] == kMatch) {
+      ++l_i;
+      ++r_i;
+      ++edit_i;
+    }
+
+    // Find the first line to include in the hunk.
+    const size_t prefix_context = std::min(l_i, context);
+    Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);
+    for (size_t i = prefix_context; i > 0; --i) {
+      hunk.PushLine(' ', left[l_i - i].c_str());
+    }
+
+    // Iterate the edits until we found enough suffix for the hunk or the input
+    // is over.
+    size_t n_suffix = 0;
+    for (; edit_i < edits.size(); ++edit_i) {
+      if (n_suffix >= context) {
+        // Continue only if the next hunk is very close.
+        std::vector<EditType>::const_iterator it = edits.begin() + edit_i;
+        while (it != edits.end() && *it == kMatch) ++it;
+        if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {
+          // There is no next edit or it is too far away.
+          break;
+        }
+      }
+
+      EditType edit = edits[edit_i];
+      // Reset count when a non match is found.
+      n_suffix = edit == kMatch ? n_suffix + 1 : 0;
+
+      if (edit == kMatch || edit == kRemove || edit == kReplace) {
+        hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());
+      }
+      if (edit == kAdd || edit == kReplace) {
+        hunk.PushLine('+', right[r_i].c_str());
+      }
+
+      // Advance indices, depending on edit type.
+      l_i += edit != kAdd;
+      r_i += edit != kRemove;
+    }
+
+    if (!hunk.has_edits()) {
+      // We are done. We don't want this hunk.
+      break;
+    }
+
+    hunk.PrintTo(&ss);
+  }
+  return ss.str();
+}
+
+}  // namespace edit_distance
+
+namespace {
+
+// The string representation of the values received in EqFailure() are already
+// escaped. Split them on escaped '\n' boundaries. Leave all other escaped
+// characters the same.
+std::vector<std::string> SplitEscapedString(const std::string& str) {
+  std::vector<std::string> lines;
+  size_t start = 0, end = str.size();
+  if (end > 2 && str[0] == '"' && str[end - 1] == '"') {
+    ++start;
+    --end;
+  }
+  bool escaped = false;
+  for (size_t i = start; i + 1 < end; ++i) {
+    if (escaped) {
+      escaped = false;
+      if (str[i] == 'n') {
+        lines.push_back(str.substr(start, i - start - 1));
+        start = i + 1;
+      }
+    } else {
+      escaped = str[i] == '\\';
+    }
+  }
+  lines.push_back(str.substr(start, end - start));
+  return lines;
+}
+
+}  // namespace
+
+// Constructs and returns the message for an equality assertion
+// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
+//
+// The first four parameters are the expressions used in the assertion
+// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
+// where foo is 5 and bar is 6, we have:
+//
+//   lhs_expression: "foo"
+//   rhs_expression: "bar"
+//   lhs_value:      "5"
+//   rhs_value:      "6"
+//
+// The ignoring_case parameter is true iff the assertion is a
+// *_STRCASEEQ*.  When it's true, the string "Ignoring case" will
+// be inserted into the message.
+AssertionResult EqFailure(const char* lhs_expression,
+                          const char* rhs_expression,
+                          const std::string& lhs_value,
+                          const std::string& rhs_value,
+                          bool ignoring_case) {
+  Message msg;
+  msg << "      Expected: " << lhs_expression;
+  if (lhs_value != lhs_expression) {
+    msg << "\n      Which is: " << lhs_value;
+  }
+  msg << "\nTo be equal to: " << rhs_expression;
+  if (rhs_value != rhs_expression) {
+    msg << "\n      Which is: " << rhs_value;
+  }
+
+  if (ignoring_case) {
+    msg << "\nIgnoring case";
+  }
+
+  if (!lhs_value.empty() && !rhs_value.empty()) {
+    const std::vector<std::string> lhs_lines =
+        SplitEscapedString(lhs_value);
+    const std::vector<std::string> rhs_lines =
+        SplitEscapedString(rhs_value);
+    if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {
+      msg << "\nWith diff:\n"
+          << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);
+    }
+  }
+
+  return AssertionFailure() << msg;
+}
+
+// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
+std::string GetBoolAssertionFailureMessage(
+    const AssertionResult& assertion_result,
+    const char* expression_text,
+    const char* actual_predicate_value,
+    const char* expected_predicate_value) {
+  const char* actual_message = assertion_result.message();
+  Message msg;
+  msg << "Value of: " << expression_text
+      << "\n  Actual: " << actual_predicate_value;
+  if (actual_message[0] != '\0')
+    msg << " (" << actual_message << ")";
+  msg << "\nExpected: " << expected_predicate_value;
+  return msg.GetString();
+}
+
+// Helper function for implementing ASSERT_NEAR.
+AssertionResult DoubleNearPredFormat(const char* expr1,
+                                     const char* expr2,
+                                     const char* abs_error_expr,
+                                     double val1,
+                                     double val2,
+                                     double abs_error) {
+  const double diff = fabs(val1 - val2);
+  if (diff <= abs_error) return AssertionSuccess();
+
+  // TODO(wan): do not print the value of an expression if it's
+  // already a literal.
+  return AssertionFailure()
+      << "The difference between " << expr1 << " and " << expr2
+      << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
+      << expr1 << " evaluates to " << val1 << ",\n"
+      << expr2 << " evaluates to " << val2 << ", and\n"
+      << abs_error_expr << " evaluates to " << abs_error << ".";
+}
+
+
+// Helper template for implementing FloatLE() and DoubleLE().
+template <typename RawType>
+AssertionResult FloatingPointLE(const char* expr1,
+                                const char* expr2,
+                                RawType val1,
+                                RawType val2) {
+  // Returns success if val1 is less than val2,
+  if (val1 < val2) {
+    return AssertionSuccess();
+  }
+
+  // or if val1 is almost equal to val2.
+  const FloatingPoint<RawType> lhs(val1), rhs(val2);
+  if (lhs.AlmostEquals(rhs)) {
+    return AssertionSuccess();
+  }
+
+  // Note that the above two checks will both fail if either val1 or
+  // val2 is NaN, as the IEEE floating-point standard requires that
+  // any predicate involving a NaN must return false.
+
+  ::std::stringstream val1_ss;
+  val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+          << val1;
+
+  ::std::stringstream val2_ss;
+  val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+          << val2;
+
+  return AssertionFailure()
+      << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"
+      << "  Actual: " << StringStreamToString(&val1_ss) << " vs "
+      << StringStreamToString(&val2_ss);
+}
+
+}  // namespace internal
+
+// Asserts that val1 is less than, or almost equal to, val2.  Fails
+// otherwise.  In particular, it fails if either val1 or val2 is NaN.
+AssertionResult FloatLE(const char* expr1, const char* expr2,
+                        float val1, float val2) {
+  return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);
+}
+
+// Asserts that val1 is less than, or almost equal to, val2.  Fails
+// otherwise.  In particular, it fails if either val1 or val2 is NaN.
+AssertionResult DoubleLE(const char* expr1, const char* expr2,
+                         double val1, double val2) {
+  return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);
+}
+
+namespace internal {
+
+// The helper function for {ASSERT|EXPECT}_EQ with int or enum
+// arguments.
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+                            const char* rhs_expression,
+                            BiggestInt lhs,
+                            BiggestInt rhs) {
+  if (lhs == rhs) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   FormatForComparisonFailureMessage(lhs, rhs),
+                   FormatForComparisonFailureMessage(rhs, lhs),
+                   false);
+}
+
+// A macro for implementing the helper functions needed to implement
+// ASSERT_?? and EXPECT_?? with integer or enum arguments.  It is here
+// just to avoid copy-and-paste of similar code.
+#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
+AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
+                                   BiggestInt val1, BiggestInt val2) {\
+  if (val1 op val2) {\
+    return AssertionSuccess();\
+  } else {\
+    return AssertionFailure() \
+        << "Expected: (" << expr1 << ") " #op " (" << expr2\
+        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
+        << " vs " << FormatForComparisonFailureMessage(val2, val1);\
+  }\
+}
+
+// Implements the helper function for {ASSERT|EXPECT}_NE with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(NE, !=)
+// Implements the helper function for {ASSERT|EXPECT}_LE with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(LE, <=)
+// Implements the helper function for {ASSERT|EXPECT}_LT with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(LT, < )
+// Implements the helper function for {ASSERT|EXPECT}_GE with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(GE, >=)
+// Implements the helper function for {ASSERT|EXPECT}_GT with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(GT, > )
+
+#undef GTEST_IMPL_CMP_HELPER_
+
+// The helper function for {ASSERT|EXPECT}_STREQ.
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+                               const char* rhs_expression,
+                               const char* lhs,
+                               const char* rhs) {
+  if (String::CStringEquals(lhs, rhs)) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
+                   false);
+}
+
+// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
+AssertionResult CmpHelperSTRCASEEQ(const char* lhs_expression,
+                                   const char* rhs_expression,
+                                   const char* lhs,
+                                   const char* rhs) {
+  if (String::CaseInsensitiveCStringEquals(lhs, rhs)) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
+                   true);
+}
+
+// The helper function for {ASSERT|EXPECT}_STRNE.
+AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                               const char* s2_expression,
+                               const char* s1,
+                               const char* s2) {
+  if (!String::CStringEquals(s1, s2)) {
+    return AssertionSuccess();
+  } else {
+    return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
+                              << s2_expression << "), actual: \""
+                              << s1 << "\" vs \"" << s2 << "\"";
+  }
+}
+
+// The helper function for {ASSERT|EXPECT}_STRCASENE.
+AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
+                                   const char* s2_expression,
+                                   const char* s1,
+                                   const char* s2) {
+  if (!String::CaseInsensitiveCStringEquals(s1, s2)) {
+    return AssertionSuccess();
+  } else {
+    return AssertionFailure()
+        << "Expected: (" << s1_expression << ") != ("
+        << s2_expression << ") (ignoring case), actual: \""
+        << s1 << "\" vs \"" << s2 << "\"";
+  }
+}
+
+}  // namespace internal
+
+namespace {
+
+// Helper functions for implementing IsSubString() and IsNotSubstring().
+
+// This group of overloaded functions return true iff needle is a
+// substring of haystack.  NULL is considered a substring of itself
+// only.
+
+bool IsSubstringPred(const char* needle, const char* haystack) {
+  if (needle == NULL || haystack == NULL)
+    return needle == haystack;
+
+  return strstr(haystack, needle) != NULL;
+}
+
+bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {
+  if (needle == NULL || haystack == NULL)
+    return needle == haystack;
+
+  return wcsstr(haystack, needle) != NULL;
+}
+
+// StringType here can be either ::std::string or ::std::wstring.
+template <typename StringType>
+bool IsSubstringPred(const StringType& needle,
+                     const StringType& haystack) {
+  return haystack.find(needle) != StringType::npos;
+}
+
+// This function implements either IsSubstring() or IsNotSubstring(),
+// depending on the value of the expected_to_be_substring parameter.
+// StringType here can be const char*, const wchar_t*, ::std::string,
+// or ::std::wstring.
+template <typename StringType>
+AssertionResult IsSubstringImpl(
+    bool expected_to_be_substring,
+    const char* needle_expr, const char* haystack_expr,
+    const StringType& needle, const StringType& haystack) {
+  if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
+    return AssertionSuccess();
+
+  const bool is_wide_string = sizeof(needle[0]) > 1;
+  const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
+  return AssertionFailure()
+      << "Value of: " << needle_expr << "\n"
+      << "  Actual: " << begin_string_quote << needle << "\"\n"
+      << "Expected: " << (expected_to_be_substring ? "" : "not ")
+      << "a substring of " << haystack_expr << "\n"
+      << "Which is: " << begin_string_quote << haystack << "\"";
+}
+
+}  // namespace
+
+// IsSubstring() and IsNotSubstring() check whether needle is a
+// substring of haystack (NULL is considered a substring of itself
+// only), and return an appropriate error message when they fail.
+
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+
+#if GTEST_HAS_STD_WSTRING
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+namespace internal {
+
+#if GTEST_OS_WINDOWS
+
+namespace {
+
+// Helper function for IsHRESULT{SuccessFailure} predicates
+AssertionResult HRESULTFailureHelper(const char* expr,
+                                     const char* expected,
+                                     long hr) {  // NOLINT
+# if GTEST_OS_WINDOWS_MOBILE
+
+  // Windows CE doesn't support FormatMessage.
+  const char error_text[] = "";
+
+# else
+
+  // Looks up the human-readable system message for the HRESULT code
+  // and since we're not passing any params to FormatMessage, we don't
+  // want inserts expanded.
+  const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS;
+  const DWORD kBufSize = 4096;
+  // Gets the system's human readable message string for this HRESULT.
+  char error_text[kBufSize] = { '\0' };
+  DWORD message_length = ::FormatMessageA(kFlags,
+                                          0,  // no source, we're asking system
+                                          hr,  // the error
+                                          0,  // no line width restrictions
+                                          error_text,  // output buffer
+                                          kBufSize,  // buf size
+                                          NULL);  // no arguments for inserts
+  // Trims tailing white space (FormatMessage leaves a trailing CR-LF)
+  for (; message_length && IsSpace(error_text[message_length - 1]);
+          --message_length) {
+    error_text[message_length - 1] = '\0';
+  }
+
+# endif  // GTEST_OS_WINDOWS_MOBILE
+
+  const std::string error_hex("0x" + String::FormatHexInt(hr));
+  return ::testing::AssertionFailure()
+      << "Expected: " << expr << " " << expected << ".\n"
+      << "  Actual: " << error_hex << " " << error_text << "\n";
+}
+
+}  // namespace
+
+AssertionResult IsHRESULTSuccess(const char* expr, long hr) {  // NOLINT
+  if (SUCCEEDED(hr)) {
+    return AssertionSuccess();
+  }
+  return HRESULTFailureHelper(expr, "succeeds", hr);
+}
+
+AssertionResult IsHRESULTFailure(const char* expr, long hr) {  // NOLINT
+  if (FAILED(hr)) {
+    return AssertionSuccess();
+  }
+  return HRESULTFailureHelper(expr, "fails", hr);
+}
+
+#endif  // GTEST_OS_WINDOWS
+
+// Utility functions for encoding Unicode text (wide strings) in
+// UTF-8.
+
+// A Unicode code-point can have upto 21 bits, and is encoded in UTF-8
+// like this:
+//
+// Code-point length   Encoding
+//   0 -  7 bits       0xxxxxxx
+//   8 - 11 bits       110xxxxx 10xxxxxx
+//  12 - 16 bits       1110xxxx 10xxxxxx 10xxxxxx
+//  17 - 21 bits       11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+
+// The maximum code-point a one-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) <<  7) - 1;
+
+// The maximum code-point a two-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1;
+
+// The maximum code-point a three-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1;
+
+// The maximum code-point a four-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1;
+
+// Chops off the n lowest bits from a bit pattern.  Returns the n
+// lowest bits.  As a side effect, the original bit pattern will be
+// shifted to the right by n bits.
+inline UInt32 ChopLowBits(UInt32* bits, int n) {
+  const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);
+  *bits >>= n;
+  return low_bits;
+}
+
+// Converts a Unicode code point to a narrow string in UTF-8 encoding.
+// code_point parameter is of type UInt32 because wchar_t may not be
+// wide enough to contain a code point.
+// If the code_point is not a valid Unicode code point
+// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
+// to "(Invalid Unicode 0xXXXXXXXX)".
+std::string CodePointToUtf8(UInt32 code_point) {
+  if (code_point > kMaxCodePoint4) {
+    return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";
+  }
+
+  char str[5];  // Big enough for the largest valid code point.
+  if (code_point <= kMaxCodePoint1) {
+    str[1] = '\0';
+    str[0] = static_cast<char>(code_point);                          // 0xxxxxxx
+  } else if (code_point <= kMaxCodePoint2) {
+    str[2] = '\0';
+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[0] = static_cast<char>(0xC0 | code_point);                   // 110xxxxx
+  } else if (code_point <= kMaxCodePoint3) {
+    str[3] = '\0';
+    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[0] = static_cast<char>(0xE0 | code_point);                   // 1110xxxx
+  } else {  // code_point <= kMaxCodePoint4
+    str[4] = '\0';
+    str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[0] = static_cast<char>(0xF0 | code_point);                   // 11110xxx
+  }
+  return str;
+}
+
+// The following two functions only make sense if the the system
+// uses UTF-16 for wide string encoding. All supported systems
+// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
+
+// Determines if the arguments constitute UTF-16 surrogate pair
+// and thus should be combined into a single Unicode code point
+// using CreateCodePointFromUtf16SurrogatePair.
+inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+  return sizeof(wchar_t) == 2 &&
+      (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
+}
+
+// Creates a Unicode code point from UTF16 surrogate pair.
+inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
+                                                    wchar_t second) {
+  const UInt32 mask = (1 << 10) - 1;
+  return (sizeof(wchar_t) == 2) ?
+      (((first & mask) << 10) | (second & mask)) + 0x10000 :
+      // This function should not be called when the condition is
+      // false, but we provide a sensible default in case it is.
+      static_cast<UInt32>(first);
+}
+
+// Converts a wide string to a narrow string in UTF-8 encoding.
+// The wide string is assumed to have the following encoding:
+//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
+//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
+// Parameter str points to a null-terminated wide string.
+// Parameter num_chars may additionally limit the number
+// of wchar_t characters processed. -1 is used when the entire string
+// should be processed.
+// If the string contains code points that are not valid Unicode code points
+// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
+// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
+// and contains invalid UTF-16 surrogate pairs, values in those pairs
+// will be encoded as individual Unicode characters from Basic Normal Plane.
+std::string WideStringToUtf8(const wchar_t* str, int num_chars) {
+  if (num_chars == -1)
+    num_chars = static_cast<int>(wcslen(str));
+
+  ::std::stringstream stream;
+  for (int i = 0; i < num_chars; ++i) {
+    UInt32 unicode_code_point;
+
+    if (str[i] == L'\0') {
+      break;
+    } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
+      unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
+                                                                 str[i + 1]);
+      i++;
+    } else {
+      unicode_code_point = static_cast<UInt32>(str[i]);
+    }
+
+    stream << CodePointToUtf8(unicode_code_point);
+  }
+  return StringStreamToString(&stream);
+}
+
+// Converts a wide C string to an std::string using the UTF-8 encoding.
+// NULL will be converted to "(null)".
+std::string String::ShowWideCString(const wchar_t * wide_c_str) {
+  if (wide_c_str == NULL)  return "(null)";
+
+  return internal::WideStringToUtf8(wide_c_str, -1);
+}
+
+// Compares two wide C strings.  Returns true iff they have the same
+// content.
+//
+// Unlike wcscmp(), this function can handle NULL argument(s).  A NULL
+// C string is considered different to any non-NULL C string,
+// including the empty string.
+bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
+  if (lhs == NULL) return rhs == NULL;
+
+  if (rhs == NULL) return false;
+
+  return wcscmp(lhs, rhs) == 0;
+}
+
+// Helper function for *_STREQ on wide strings.
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+                               const char* rhs_expression,
+                               const wchar_t* lhs,
+                               const wchar_t* rhs) {
+  if (String::WideCStringEquals(lhs, rhs)) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
+                   false);
+}
+
+// Helper function for *_STRNE on wide strings.
+AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                               const char* s2_expression,
+                               const wchar_t* s1,
+                               const wchar_t* s2) {
+  if (!String::WideCStringEquals(s1, s2)) {
+    return AssertionSuccess();
+  }
+
+  return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
+                            << s2_expression << "), actual: "
+                            << PrintToString(s1)
+                            << " vs " << PrintToString(s2);
+}
+
+// Compares two C strings, ignoring case.  Returns true iff they have
+// the same content.
+//
+// Unlike strcasecmp(), this function can handle NULL argument(s).  A
+// NULL C string is considered different to any non-NULL C string,
+// including the empty string.
+bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
+  if (lhs == NULL)
+    return rhs == NULL;
+  if (rhs == NULL)
+    return false;
+  return posix::StrCaseCmp(lhs, rhs) == 0;
+}
+
+  // Compares two wide C strings, ignoring case.  Returns true iff they
+  // have the same content.
+  //
+  // Unlike wcscasecmp(), this function can handle NULL argument(s).
+  // A NULL C string is considered different to any non-NULL wide C string,
+  // including the empty string.
+  // NB: The implementations on different platforms slightly differ.
+  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
+  // environment variable. On GNU platform this method uses wcscasecmp
+  // which compares according to LC_CTYPE category of the current locale.
+  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
+  // current locale.
+bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
+                                              const wchar_t* rhs) {
+  if (lhs == NULL) return rhs == NULL;
+
+  if (rhs == NULL) return false;
+
+#if GTEST_OS_WINDOWS
+  return _wcsicmp(lhs, rhs) == 0;
+#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
+  return wcscasecmp(lhs, rhs) == 0;
+#else
+  // Android, Mac OS X and Cygwin don't define wcscasecmp.
+  // Other unknown OSes may not define it either.
+  wint_t left, right;
+  do {
+    left = towlower(*lhs++);
+    right = towlower(*rhs++);
+  } while (left && left == right);
+  return left == right;
+#endif  // OS selector
+}
+
+// Returns true iff str ends with the given suffix, ignoring case.
+// Any string is considered to end with an empty suffix.
+bool String::EndsWithCaseInsensitive(
+    const std::string& str, const std::string& suffix) {
+  const size_t str_len = str.length();
+  const size_t suffix_len = suffix.length();
+  return (str_len >= suffix_len) &&
+         CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len,
+                                      suffix.c_str());
+}
+
+// Formats an int value as "%02d".
+std::string String::FormatIntWidth2(int value) {
+  std::stringstream ss;
+  ss << std::setfill('0') << std::setw(2) << value;
+  return ss.str();
+}
+
+// Formats an int value as "%X".
+std::string String::FormatHexInt(int value) {
+  std::stringstream ss;
+  ss << std::hex << std::uppercase << value;
+  return ss.str();
+}
+
+// Formats a byte as "%02X".
+std::string String::FormatByte(unsigned char value) {
+  std::stringstream ss;
+  ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase
+     << static_cast<unsigned int>(value);
+  return ss.str();
+}
+
+// Converts the buffer in a stringstream to an std::string, converting NUL
+// bytes to "\\0" along the way.
+std::string StringStreamToString(::std::stringstream* ss) {
+  const ::std::string& str = ss->str();
+  const char* const start = str.c_str();
+  const char* const end = start + str.length();
+
+  std::string result;
+  result.reserve(2 * (end - start));
+  for (const char* ch = start; ch != end; ++ch) {
+    if (*ch == '\0') {
+      result += "\\0";  // Replaces NUL with "\\0";
+    } else {
+      result += *ch;
+    }
+  }
+
+  return result;
+}
+
+// Appends the user-supplied message to the Google-Test-generated message.
+std::string AppendUserMessage(const std::string& gtest_msg,
+                              const Message& user_msg) {
+  // Appends the user message if it's non-empty.
+  const std::string user_msg_string = user_msg.GetString();
+  if (user_msg_string.empty()) {
+    return gtest_msg;
+  }
+
+  return gtest_msg + "\n" + user_msg_string;
+}
+
+}  // namespace internal
+
+// class TestResult
+
+// Creates an empty TestResult.
+TestResult::TestResult()
+    : death_test_count_(0),
+      elapsed_time_(0) {
+}
+
+// D'tor.
+TestResult::~TestResult() {
+}
+
+// Returns the i-th test part result among all the results. i can
+// range from 0 to total_part_count() - 1. If i is not in that range,
+// aborts the program.
+const TestPartResult& TestResult::GetTestPartResult(int i) const {
+  if (i < 0 || i >= total_part_count())
+    internal::posix::Abort();
+  return test_part_results_.at(i);
+}
+
+// Returns the i-th test property. i can range from 0 to
+// test_property_count() - 1. If i is not in that range, aborts the
+// program.
+const TestProperty& TestResult::GetTestProperty(int i) const {
+  if (i < 0 || i >= test_property_count())
+    internal::posix::Abort();
+  return test_properties_.at(i);
+}
+
+// Clears the test part results.
+void TestResult::ClearTestPartResults() {
+  test_part_results_.clear();
+}
+
+// Adds a test part result to the list.
+void TestResult::AddTestPartResult(const TestPartResult& test_part_result) {
+  test_part_results_.push_back(test_part_result);
+}
+
+// Adds a test property to the list. If a property with the same key as the
+// supplied property is already represented, the value of this test_property
+// replaces the old value for that key.
+void TestResult::RecordProperty(const std::string& xml_element,
+                                const TestProperty& test_property) {
+  if (!ValidateTestProperty(xml_element, test_property)) {
+    return;
+  }
+  internal::MutexLock lock(&test_properites_mutex_);
+  const std::vector<TestProperty>::iterator property_with_matching_key =
+      std::find_if(test_properties_.begin(), test_properties_.end(),
+                   internal::TestPropertyKeyIs(test_property.key()));
+  if (property_with_matching_key == test_properties_.end()) {
+    test_properties_.push_back(test_property);
+    return;
+  }
+  property_with_matching_key->SetValue(test_property.value());
+}
+
+// The list of reserved attributes used in the <testsuites> element of XML
+// output.
+static const char* const kReservedTestSuitesAttributes[] = {
+  "disabled",
+  "errors",
+  "failures",
+  "name",
+  "random_seed",
+  "tests",
+  "time",
+  "timestamp"
+};
+
+// The list of reserved attributes used in the <testsuite> element of XML
+// output.
+static const char* const kReservedTestSuiteAttributes[] = {
+  "disabled",
+  "errors",
+  "failures",
+  "name",
+  "tests",
+  "time"
+};
+
+// The list of reserved attributes used in the <testcase> element of XML output.
+static const char* const kReservedTestCaseAttributes[] = {
+  "classname",
+  "name",
+  "status",
+  "time",
+  "type_param",
+  "value_param"
+};
+
+template <int kSize>
+std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {
+  return std::vector<std::string>(array, array + kSize);
+}
+
+static std::vector<std::string> GetReservedAttributesForElement(
+    const std::string& xml_element) {
+  if (xml_element == "testsuites") {
+    return ArrayAsVector(kReservedTestSuitesAttributes);
+  } else if (xml_element == "testsuite") {
+    return ArrayAsVector(kReservedTestSuiteAttributes);
+  } else if (xml_element == "testcase") {
+    return ArrayAsVector(kReservedTestCaseAttributes);
+  } else {
+    GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;
+  }
+  // This code is unreachable but some compilers may not realizes that.
+  return std::vector<std::string>();
+}
+
+static std::string FormatWordList(const std::vector<std::string>& words) {
+  Message word_list;
+  for (size_t i = 0; i < words.size(); ++i) {
+    if (i > 0 && words.size() > 2) {
+      word_list << ", ";
+    }
+    if (i == words.size() - 1) {
+      word_list << "and ";
+    }
+    word_list << "'" << words[i] << "'";
+  }
+  return word_list.GetString();
+}
+
+bool ValidateTestPropertyName(const std::string& property_name,
+                              const std::vector<std::string>& reserved_names) {
+  if (std::find(reserved_names.begin(), reserved_names.end(), property_name) !=
+          reserved_names.end()) {
+    ADD_FAILURE() << "Reserved key used in RecordProperty(): " << property_name
+                  << " (" << FormatWordList(reserved_names)
+                  << " are reserved by " << GTEST_NAME_ << ")";
+    return false;
+  }
+  return true;
+}
+
+// Adds a failure if the key is a reserved attribute of the element named
+// xml_element.  Returns true if the property is valid.
+bool TestResult::ValidateTestProperty(const std::string& xml_element,
+                                      const TestProperty& test_property) {
+  return ValidateTestPropertyName(test_property.key(),
+                                  GetReservedAttributesForElement(xml_element));
+}
+
+// Clears the object.
+void TestResult::Clear() {
+  test_part_results_.clear();
+  test_properties_.clear();
+  death_test_count_ = 0;
+  elapsed_time_ = 0;
+}
+
+// Returns true iff the test failed.
+bool TestResult::Failed() const {
+  for (int i = 0; i < total_part_count(); ++i) {
+    if (GetTestPartResult(i).failed())
+      return true;
+  }
+  return false;
+}
+
+// Returns true iff the test part fatally failed.
+static bool TestPartFatallyFailed(const TestPartResult& result) {
+  return result.fatally_failed();
+}
+
+// Returns true iff the test fatally failed.
+bool TestResult::HasFatalFailure() const {
+  return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
+}
+
+// Returns true iff the test part non-fatally failed.
+static bool TestPartNonfatallyFailed(const TestPartResult& result) {
+  return result.nonfatally_failed();
+}
+
+// Returns true iff the test has a non-fatal failure.
+bool TestResult::HasNonfatalFailure() const {
+  return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;
+}
+
+// Gets the number of all test parts.  This is the sum of the number
+// of successful test parts and the number of failed test parts.
+int TestResult::total_part_count() const {
+  return static_cast<int>(test_part_results_.size());
+}
+
+// Returns the number of the test properties.
+int TestResult::test_property_count() const {
+  return static_cast<int>(test_properties_.size());
+}
+
+// class Test
+
+// Creates a Test object.
+
+// The c'tor saves the states of all flags.
+Test::Test()
+    : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {
+}
+
+// The d'tor restores the states of all flags.  The actual work is
+// done by the d'tor of the gtest_flag_saver_ field, and thus not
+// visible here.
+Test::~Test() {
+}
+
+// Sets up the test fixture.
+//
+// A sub-class may override this.
+void Test::SetUp() {
+}
+
+// Tears down the test fixture.
+//
+// A sub-class may override this.
+void Test::TearDown() {
+}
+
+// Allows user supplied key value pairs to be recorded for later output.
+void Test::RecordProperty(const std::string& key, const std::string& value) {
+  UnitTest::GetInstance()->RecordProperty(key, value);
+}
+
+// Allows user supplied key value pairs to be recorded for later output.
+void Test::RecordProperty(const std::string& key, int value) {
+  Message value_message;
+  value_message << value;
+  RecordProperty(key, value_message.GetString().c_str());
+}
+
+namespace internal {
+
+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
+                                    const std::string& message) {
+  // This function is a friend of UnitTest and as such has access to
+  // AddTestPartResult.
+  UnitTest::GetInstance()->AddTestPartResult(
+      result_type,
+      NULL,  // No info about the source file where the exception occurred.
+      -1,    // We have no info on which line caused the exception.
+      message,
+      "");   // No stack trace, either.
+}
+
+}  // namespace internal
+
+// Google Test requires all tests in the same test case to use the same test
+// fixture class.  This function checks if the current test has the
+// same fixture class as the first test in the current test case.  If
+// yes, it returns true; otherwise it generates a Google Test failure and
+// returns false.
+bool Test::HasSameFixtureClass() {
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  const TestCase* const test_case = impl->current_test_case();
+
+  // Info about the first test in the current test case.
+  const TestInfo* const first_test_info = test_case->test_info_list()[0];
+  const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;
+  const char* const first_test_name = first_test_info->name();
+
+  // Info about the current test.
+  const TestInfo* const this_test_info = impl->current_test_info();
+  const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;
+  const char* const this_test_name = this_test_info->name();
+
+  if (this_fixture_id != first_fixture_id) {
+    // Is the first test defined using TEST?
+    const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();
+    // Is this test defined using TEST?
+    const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
+
+    if (first_is_TEST || this_is_TEST) {
+      // Both TEST and TEST_F appear in same test case, which is incorrect.
+      // Tell the user how to fix this.
+
+      // Gets the name of the TEST and the name of the TEST_F.  Note
+      // that first_is_TEST and this_is_TEST cannot both be true, as
+      // the fixture IDs are different for the two tests.
+      const char* const TEST_name =
+          first_is_TEST ? first_test_name : this_test_name;
+      const char* const TEST_F_name =
+          first_is_TEST ? this_test_name : first_test_name;
+
+      ADD_FAILURE()
+          << "All tests in the same test case must use the same test fixture\n"
+          << "class, so mixing TEST_F and TEST in the same test case is\n"
+          << "illegal.  In test case " << this_test_info->test_case_name()
+          << ",\n"
+          << "test " << TEST_F_name << " is defined using TEST_F but\n"
+          << "test " << TEST_name << " is defined using TEST.  You probably\n"
+          << "want to change the TEST to TEST_F or move it to another test\n"
+          << "case.";
+    } else {
+      // Two fixture classes with the same name appear in two different
+      // namespaces, which is not allowed. Tell the user how to fix this.
+      ADD_FAILURE()
+          << "All tests in the same test case must use the same test fixture\n"
+          << "class.  However, in test case "
+          << this_test_info->test_case_name() << ",\n"
+          << "you defined test " << first_test_name
+          << " and test " << this_test_name << "\n"
+          << "using two different test fixture classes.  This can happen if\n"
+          << "the two classes are from different namespaces or translation\n"
+          << "units and have the same name.  You should probably rename one\n"
+          << "of the classes to put the tests into different test cases.";
+    }
+    return false;
+  }
+
+  return true;
+}
+
+#if GTEST_HAS_SEH
+
+// Adds an "exception thrown" fatal failure to the current test.  This
+// function returns its result via an output parameter pointer because VC++
+// prohibits creation of objects with destructors on stack in functions
+// using __try (see error C2712).
+static std::string* FormatSehExceptionMessage(DWORD exception_code,
+                                              const char* location) {
+  Message message;
+  message << "SEH exception with code 0x" << std::setbase(16) <<
+    exception_code << std::setbase(10) << " thrown in " << location << ".";
+
+  return new std::string(message.GetString());
+}
+
+#endif  // GTEST_HAS_SEH
+
+namespace internal {
+
+#if GTEST_HAS_EXCEPTIONS
+
+// Adds an "exception thrown" fatal failure to the current test.
+static std::string FormatCxxExceptionMessage(const char* description,
+                                             const char* location) {
+  Message message;
+  if (description != NULL) {
+    message << "C++ exception with description \"" << description << "\"";
+  } else {
+    message << "Unknown C++ exception";
+  }
+  message << " thrown in " << location << ".";
+
+  return message.GetString();
+}
+
+static std::string PrintTestPartResultToString(
+    const TestPartResult& test_part_result);
+
+GoogleTestFailureException::GoogleTestFailureException(
+    const TestPartResult& failure)
+    : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}
+
+#endif  // GTEST_HAS_EXCEPTIONS
+
+// We put these helper functions in the internal namespace as IBM's xlC
+// compiler rejects the code if they were declared static.
+
+// Runs the given method and handles SEH exceptions it throws, when
+// SEH is supported; returns the 0-value for type Result in case of an
+// SEH exception.  (Microsoft compilers cannot handle SEH and C++
+// exceptions in the same function.  Therefore, we provide a separate
+// wrapper function for handling SEH exceptions.)
+template <class T, typename Result>
+Result HandleSehExceptionsInMethodIfSupported(
+    T* object, Result (T::*method)(), const char* location) {
+#if GTEST_HAS_SEH
+  __try {
+    return (object->*method)();
+  } __except (internal::UnitTestOptions::GTestShouldProcessSEH(  // NOLINT
+      GetExceptionCode())) {
+    // We create the exception message on the heap because VC++ prohibits
+    // creation of objects with destructors on stack in functions using __try
+    // (see error C2712).
+    std::string* exception_message = FormatSehExceptionMessage(
+        GetExceptionCode(), location);
+    internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
+                                             *exception_message);
+    delete exception_message;
+    return static_cast<Result>(0);
+  }
+#else
+  (void)location;
+  return (object->*method)();
+#endif  // GTEST_HAS_SEH
+}
+
+// Runs the given method and catches and reports C++ and/or SEH-style
+// exceptions, if they are supported; returns the 0-value for type
+// Result in case of an SEH exception.
+template <class T, typename Result>
+Result HandleExceptionsInMethodIfSupported(
+    T* object, Result (T::*method)(), const char* location) {
+  // NOTE: The user code can affect the way in which Google Test handles
+  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
+  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
+  // after the exception is caught and either report or re-throw the
+  // exception based on the flag's value:
+  //
+  // try {
+  //   // Perform the test method.
+  // } catch (...) {
+  //   if (GTEST_FLAG(catch_exceptions))
+  //     // Report the exception as failure.
+  //   else
+  //     throw;  // Re-throws the original exception.
+  // }
+  //
+  // However, the purpose of this flag is to allow the program to drop into
+  // the debugger when the exception is thrown. On most platforms, once the
+  // control enters the catch block, the exception origin information is
+  // lost and the debugger will stop the program at the point of the
+  // re-throw in this function -- instead of at the point of the original
+  // throw statement in the code under test.  For this reason, we perform
+  // the check early, sacrificing the ability to affect Google Test's
+  // exception handling in the method where the exception is thrown.
+  if (internal::GetUnitTestImpl()->catch_exceptions()) {
+#if GTEST_HAS_EXCEPTIONS
+    try {
+      return HandleSehExceptionsInMethodIfSupported(object, method, location);
+    } catch (const internal::GoogleTestFailureException&) {  // NOLINT
+      // This exception type can only be thrown by a failed Google
+      // Test assertion with the intention of letting another testing
+      // framework catch it.  Therefore we just re-throw it.
+      throw;
+    } catch (const std::exception& e) {  // NOLINT
+      internal::ReportFailureInUnknownLocation(
+          TestPartResult::kFatalFailure,
+          FormatCxxExceptionMessage(e.what(), location));
+    } catch (...) {  // NOLINT
+      internal::ReportFailureInUnknownLocation(
+          TestPartResult::kFatalFailure,
+          FormatCxxExceptionMessage(NULL, location));
+    }
+    return static_cast<Result>(0);
+#else
+    return HandleSehExceptionsInMethodIfSupported(object, method, location);
+#endif  // GTEST_HAS_EXCEPTIONS
+  } else {
+    return (object->*method)();
+  }
+}
+
+}  // namespace internal
+
+// Runs the test and updates the test result.
+void Test::Run() {
+  if (!HasSameFixtureClass()) return;
+
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
+  // We will run the test only if SetUp() was successful.
+  if (!HasFatalFailure()) {
+    impl->os_stack_trace_getter()->UponLeavingGTest();
+    internal::HandleExceptionsInMethodIfSupported(
+        this, &Test::TestBody, "the test body");
+  }
+
+  // However, we want to clean up as much as possible.  Hence we will
+  // always call TearDown(), even if SetUp() or the test body has
+  // failed.
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      this, &Test::TearDown, "TearDown()");
+}
+
+// Returns true iff the current test has a fatal failure.
+bool Test::HasFatalFailure() {
+  return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
+}
+
+// Returns true iff the current test has a non-fatal failure.
+bool Test::HasNonfatalFailure() {
+  return internal::GetUnitTestImpl()->current_test_result()->
+      HasNonfatalFailure();
+}
+
+// class TestInfo
+
+// Constructs a TestInfo object. It assumes ownership of the test factory
+// object.
+TestInfo::TestInfo(const std::string& a_test_case_name,
+                   const std::string& a_name,
+                   const char* a_type_param,
+                   const char* a_value_param,
+                   internal::CodeLocation a_code_location,
+                   internal::TypeId fixture_class_id,
+                   internal::TestFactoryBase* factory)
+    : test_case_name_(a_test_case_name),
+      name_(a_name),
+      type_param_(a_type_param ? new std::string(a_type_param) : NULL),
+      value_param_(a_value_param ? new std::string(a_value_param) : NULL),
+      location_(a_code_location),
+      fixture_class_id_(fixture_class_id),
+      should_run_(false),
+      is_disabled_(false),
+      matches_filter_(false),
+      factory_(factory),
+      result_() {}
+
+// Destructs a TestInfo object.
+TestInfo::~TestInfo() { delete factory_; }
+
+namespace internal {
+
+// Creates a new TestInfo object and registers it with Google Test;
+// returns the created object.
+//
+// Arguments:
+//
+//   test_case_name:   name of the test case
+//   name:             name of the test
+//   type_param:       the name of the test's type parameter, or NULL if
+//                     this is not a typed or a type-parameterized test.
+//   value_param:      text representation of the test's value parameter,
+//                     or NULL if this is not a value-parameterized test.
+//   code_location:    code location where the test is defined
+//   fixture_class_id: ID of the test fixture class
+//   set_up_tc:        pointer to the function that sets up the test case
+//   tear_down_tc:     pointer to the function that tears down the test case
+//   factory:          pointer to the factory that creates a test object.
+//                     The newly created TestInfo instance will assume
+//                     ownership of the factory object.
+TestInfo* MakeAndRegisterTestInfo(
+    const char* test_case_name,
+    const char* name,
+    const char* type_param,
+    const char* value_param,
+    CodeLocation code_location,
+    TypeId fixture_class_id,
+    SetUpTestCaseFunc set_up_tc,
+    TearDownTestCaseFunc tear_down_tc,
+    TestFactoryBase* factory) {
+  TestInfo* const test_info =
+      new TestInfo(test_case_name, name, type_param, value_param,
+                   code_location, fixture_class_id, factory);
+  GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
+  return test_info;
+}
+
+#if GTEST_HAS_PARAM_TEST
+void ReportInvalidTestCaseType(const char* test_case_name,
+                               CodeLocation code_location) {
+  Message errors;
+  errors
+      << "Attempted redefinition of test case " << test_case_name << ".\n"
+      << "All tests in the same test case must use the same test fixture\n"
+      << "class.  However, in test case " << test_case_name << ", you tried\n"
+      << "to define a test using a fixture class different from the one\n"
+      << "used earlier. This can happen if the two fixture classes are\n"
+      << "from different namespaces and have the same name. You should\n"
+      << "probably rename one of the classes to put the tests into different\n"
+      << "test cases.";
+
+  fprintf(stderr, "%s %s",
+          FormatFileLocation(code_location.file.c_str(),
+                             code_location.line).c_str(),
+          errors.GetString().c_str());
+}
+#endif  // GTEST_HAS_PARAM_TEST
+
+}  // namespace internal
+
+namespace {
+
+// A predicate that checks the test name of a TestInfo against a known
+// value.
+//
+// This is used for implementation of the TestCase class only.  We put
+// it in the anonymous namespace to prevent polluting the outer
+// namespace.
+//
+// TestNameIs is copyable.
+class TestNameIs {
+ public:
+  // Constructor.
+  //
+  // TestNameIs has NO default constructor.
+  explicit TestNameIs(const char* name)
+      : name_(name) {}
+
+  // Returns true iff the test name of test_info matches name_.
+  bool operator()(const TestInfo * test_info) const {
+    return test_info && test_info->name() == name_;
+  }
+
+ private:
+  std::string name_;
+};
+
+}  // namespace
+
+namespace internal {
+
+// This method expands all parameterized tests registered with macros TEST_P
+// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
+// This will be done just once during the program runtime.
+void UnitTestImpl::RegisterParameterizedTests() {
+#if GTEST_HAS_PARAM_TEST
+  if (!parameterized_tests_registered_) {
+    parameterized_test_registry_.RegisterTests();
+    parameterized_tests_registered_ = true;
+  }
+#endif
+}
+
+}  // namespace internal
+
+// Creates the test object, runs it, records its result, and then
+// deletes it.
+void TestInfo::Run() {
+  if (!should_run_) return;
+
+  // Tells UnitTest where to store test result.
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  impl->set_current_test_info(this);
+
+  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
+
+  // Notifies the unit test event listeners that a test is about to start.
+  repeater->OnTestStart(*this);
+
+  const TimeInMillis start = internal::GetTimeInMillis();
+
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+
+  // Creates the test object.
+  Test* const test = internal::HandleExceptionsInMethodIfSupported(
+      factory_, &internal::TestFactoryBase::CreateTest,
+      "the test fixture's constructor");
+
+  // Runs the test only if the test object was created and its
+  // constructor didn't generate a fatal failure.
+  if ((test != NULL) && !Test::HasFatalFailure()) {
+    // This doesn't throw as all user code that can throw are wrapped into
+    // exception handling code.
+    test->Run();
+  }
+
+  // Deletes the test object.
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      test, &Test::DeleteSelf_, "the test fixture's destructor");
+
+  result_.set_elapsed_time(internal::GetTimeInMillis() - start);
+
+  // Notifies the unit test event listener that a test has just finished.
+  repeater->OnTestEnd(*this);
+
+  // Tells UnitTest to stop associating assertion results to this
+  // test.
+  impl->set_current_test_info(NULL);
+}
+
+// class TestCase
+
+// Gets the number of successful tests in this test case.
+int TestCase::successful_test_count() const {
+  return CountIf(test_info_list_, TestPassed);
+}
+
+// Gets the number of failed tests in this test case.
+int TestCase::failed_test_count() const {
+  return CountIf(test_info_list_, TestFailed);
+}
+
+// Gets the number of disabled tests that will be reported in the XML report.
+int TestCase::reportable_disabled_test_count() const {
+  return CountIf(test_info_list_, TestReportableDisabled);
+}
+
+// Gets the number of disabled tests in this test case.
+int TestCase::disabled_test_count() const {
+  return CountIf(test_info_list_, TestDisabled);
+}
+
+// Gets the number of tests to be printed in the XML report.
+int TestCase::reportable_test_count() const {
+  return CountIf(test_info_list_, TestReportable);
+}
+
+// Get the number of tests in this test case that should run.
+int TestCase::test_to_run_count() const {
+  return CountIf(test_info_list_, ShouldRunTest);
+}
+
+// Gets the number of all tests.
+int TestCase::total_test_count() const {
+  return static_cast<int>(test_info_list_.size());
+}
+
+// Creates a TestCase with the given name.
+//
+// Arguments:
+//
+//   name:         name of the test case
+//   a_type_param: the name of the test case's type parameter, or NULL if
+//                 this is not a typed or a type-parameterized test case.
+//   set_up_tc:    pointer to the function that sets up the test case
+//   tear_down_tc: pointer to the function that tears down the test case
+TestCase::TestCase(const char* a_name, const char* a_type_param,
+                   Test::SetUpTestCaseFunc set_up_tc,
+                   Test::TearDownTestCaseFunc tear_down_tc)
+    : name_(a_name),
+      type_param_(a_type_param ? new std::string(a_type_param) : NULL),
+      set_up_tc_(set_up_tc),
+      tear_down_tc_(tear_down_tc),
+      should_run_(false),
+      elapsed_time_(0) {
+}
+
+// Destructor of TestCase.
+TestCase::~TestCase() {
+  // Deletes every Test in the collection.
+  ForEach(test_info_list_, internal::Delete<TestInfo>);
+}
+
+// Returns the i-th test among all the tests. i can range from 0 to
+// total_test_count() - 1. If i is not in that range, returns NULL.
+const TestInfo* TestCase::GetTestInfo(int i) const {
+  const int index = GetElementOr(test_indices_, i, -1);
+  return index < 0 ? NULL : test_info_list_[index];
+}
+
+// Returns the i-th test among all the tests. i can range from 0 to
+// total_test_count() - 1. If i is not in that range, returns NULL.
+TestInfo* TestCase::GetMutableTestInfo(int i) {
+  const int index = GetElementOr(test_indices_, i, -1);
+  return index < 0 ? NULL : test_info_list_[index];
+}
+
+// Adds a test to this test case.  Will delete the test upon
+// destruction of the TestCase object.
+void TestCase::AddTestInfo(TestInfo * test_info) {
+  test_info_list_.push_back(test_info);
+  test_indices_.push_back(static_cast<int>(test_indices_.size()));
+}
+
+// Runs every test in this TestCase.
+void TestCase::Run() {
+  if (!should_run_) return;
+
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  impl->set_current_test_case(this);
+
+  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
+
+  repeater->OnTestCaseStart(*this);
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      this, &TestCase::RunSetUpTestCase, "SetUpTestCase()");
+
+  const internal::TimeInMillis start = internal::GetTimeInMillis();
+  for (int i = 0; i < total_test_count(); i++) {
+    GetMutableTestInfo(i)->Run();
+  }
+  elapsed_time_ = internal::GetTimeInMillis() - start;
+
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      this, &TestCase::RunTearDownTestCase, "TearDownTestCase()");
+
+  repeater->OnTestCaseEnd(*this);
+  impl->set_current_test_case(NULL);
+}
+
+// Clears the results of all tests in this test case.
+void TestCase::ClearResult() {
+  ad_hoc_test_result_.Clear();
+  ForEach(test_info_list_, TestInfo::ClearTestResult);
+}
+
+// Shuffles the tests in this test case.
+void TestCase::ShuffleTests(internal::Random* random) {
+  Shuffle(random, &test_indices_);
+}
+
+// Restores the test order to before the first shuffle.
+void TestCase::UnshuffleTests() {
+  for (size_t i = 0; i < test_indices_.size(); i++) {
+    test_indices_[i] = static_cast<int>(i);
+  }
+}
+
+// Formats a countable noun.  Depending on its quantity, either the
+// singular form or the plural form is used. e.g.
+//
+// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
+// FormatCountableNoun(5, "book", "books") returns "5 books".
+static std::string FormatCountableNoun(int count,
+                                       const char * singular_form,
+                                       const char * plural_form) {
+  return internal::StreamableToString(count) + " " +
+      (count == 1 ? singular_form : plural_form);
+}
+
+// Formats the count of tests.
+static std::string FormatTestCount(int test_count) {
+  return FormatCountableNoun(test_count, "test", "tests");
+}
+
+// Formats the count of test cases.
+static std::string FormatTestCaseCount(int test_case_count) {
+  return FormatCountableNoun(test_case_count, "test case", "test cases");
+}
+
+// Converts a TestPartResult::Type enum to human-friendly string
+// representation.  Both kNonFatalFailure and kFatalFailure are translated
+// to "Failure", as the user usually doesn't care about the difference
+// between the two when viewing the test result.
+static const char * TestPartResultTypeToString(TestPartResult::Type type) {
+  switch (type) {
+    case TestPartResult::kSuccess:
+      return "Success";
+
+    case TestPartResult::kNonFatalFailure:
+    case TestPartResult::kFatalFailure:
+#ifdef _MSC_VER
+      return "error: ";
+#else
+      return "Failure\n";
+#endif
+    default:
+      return "Unknown result type";
+  }
+}
+
+namespace internal {
+
+// Prints a TestPartResult to an std::string.
+static std::string PrintTestPartResultToString(
+    const TestPartResult& test_part_result) {
+  return (Message()
+          << internal::FormatFileLocation(test_part_result.file_name(),
+                                          test_part_result.line_number())
+          << " " << TestPartResultTypeToString(test_part_result.type())
+          << test_part_result.message()).GetString();
+}
+
+// Prints a TestPartResult.
+static void PrintTestPartResult(const TestPartResult& test_part_result) {
+  const std::string& result =
+      PrintTestPartResultToString(test_part_result);
+  printf("%s\n", result.c_str());
+  fflush(stdout);
+  // If the test program runs in Visual Studio or a debugger, the
+  // following statements add the test part result message to the Output
+  // window such that the user can double-click on it to jump to the
+  // corresponding source code location; otherwise they do nothing.
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+  // We don't call OutputDebugString*() on Windows Mobile, as printing
+  // to stdout is done by OutputDebugString() there already - we don't
+  // want the same message printed twice.
+  ::OutputDebugStringA(result.c_str());
+  ::OutputDebugStringA("\n");
+#endif
+}
+
+// class PrettyUnitTestResultPrinter
+
+enum GTestColor {
+  COLOR_DEFAULT,
+  COLOR_RED,
+  COLOR_GREEN,
+  COLOR_YELLOW
+};
+
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+// Returns the character attribute for the given color.
+WORD GetColorAttribute(GTestColor color) {
+  switch (color) {
+    case COLOR_RED:    return FOREGROUND_RED;
+    case COLOR_GREEN:  return FOREGROUND_GREEN;
+    case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN;
+    default:           return 0;
+  }
+}
+
+#else
+
+// Returns the ANSI color code for the given color.  COLOR_DEFAULT is
+// an invalid input.
+const char* GetAnsiColorCode(GTestColor color) {
+  switch (color) {
+    case COLOR_RED:     return "1";
+    case COLOR_GREEN:   return "2";
+    case COLOR_YELLOW:  return "3";
+    default:            return NULL;
+  };
+}
+
+#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+
+// Returns true iff Google Test should use colors in the output.
+bool ShouldUseColor(bool stdout_is_tty) {
+  const char* const gtest_color = GTEST_FLAG(color).c_str();
+
+  if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
+#if GTEST_OS_WINDOWS
+    // On Windows the TERM variable is usually not set, but the
+    // console there does support colors.
+    return stdout_is_tty;
+#else
+    // On non-Windows platforms, we rely on the TERM variable.
+    const char* const term = posix::GetEnv("TERM");
+    const bool term_supports_color =
+        String::CStringEquals(term, "xterm") ||
+        String::CStringEquals(term, "xterm-color") ||
+        String::CStringEquals(term, "xterm-256color") ||
+        String::CStringEquals(term, "screen") ||
+        String::CStringEquals(term, "screen-256color") ||
+        String::CStringEquals(term, "tmux") ||
+        String::CStringEquals(term, "tmux-256color") ||
+        String::CStringEquals(term, "rxvt-unicode") ||
+        String::CStringEquals(term, "rxvt-unicode-256color") ||
+        String::CStringEquals(term, "linux") ||
+        String::CStringEquals(term, "cygwin");
+    return stdout_is_tty && term_supports_color;
+#endif  // GTEST_OS_WINDOWS
+  }
+
+  return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
+      String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
+      String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
+      String::CStringEquals(gtest_color, "1");
+  // We take "yes", "true", "t", and "1" as meaning "yes".  If the
+  // value is neither one of these nor "auto", we treat it as "no" to
+  // be conservative.
+}
+
+// Helpers for printing colored strings to stdout. Note that on Windows, we
+// cannot simply emit special characters and have the terminal change colors.
+// This routine must actually emit the characters rather than return a string
+// that would be colored when printed, as can be done on Linux.
+void ColoredPrintf(GTestColor color, const char* fmt, ...) {
+  va_list args;
+  va_start(args, fmt);
+
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
+    GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+  const bool use_color = AlwaysFalse();
+#else
+  static const bool in_color_mode =
+      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
+  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
+#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
+  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
+
+  if (!use_color) {
+    vprintf(fmt, args);
+    va_end(args);
+    return;
+  }
+
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
+
+  // Gets the current text color.
+  CONSOLE_SCREEN_BUFFER_INFO buffer_info;
+  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
+  const WORD old_color_attrs = buffer_info.wAttributes;
+
+  // We need to flush the stream buffers into the console before each
+  // SetConsoleTextAttribute call lest it affect the text that is already
+  // printed but has not yet reached the console.
+  fflush(stdout);
+  SetConsoleTextAttribute(stdout_handle,
+                          GetColorAttribute(color) | FOREGROUND_INTENSITY);
+  vprintf(fmt, args);
+
+  fflush(stdout);
+  // Restores the text color.
+  SetConsoleTextAttribute(stdout_handle, old_color_attrs);
+#else
+  printf("\033[0;3%sm", GetAnsiColorCode(color));
+  vprintf(fmt, args);
+  printf("\033[m");  // Resets the terminal to default.
+#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+  va_end(args);
+}
+
+// Text printed in Google Test's text output and --gunit_list_tests
+// output to label the type parameter and value parameter for a test.
+static const char kTypeParamLabel[] = "TypeParam";
+static const char kValueParamLabel[] = "GetParam()";
+
+void PrintFullTestCommentIfPresent(const TestInfo& test_info) {
+  const char* const type_param = test_info.type_param();
+  const char* const value_param = test_info.value_param();
+
+  if (type_param != NULL || value_param != NULL) {
+    printf(", where ");
+    if (type_param != NULL) {
+      printf("%s = %s", kTypeParamLabel, type_param);
+      if (value_param != NULL)
+        printf(" and ");
+    }
+    if (value_param != NULL) {
+      printf("%s = %s", kValueParamLabel, value_param);
+    }
+  }
+}
+
+// This class implements the TestEventListener interface.
+//
+// Class PrettyUnitTestResultPrinter is copyable.
+class PrettyUnitTestResultPrinter : public TestEventListener {
+ public:
+  PrettyUnitTestResultPrinter() {}
+  static void PrintTestName(const char * test_case, const char * test) {
+    printf("%s.%s", test_case, test);
+  }
+
+  // The following methods override what's in the TestEventListener class.
+  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestCaseStart(const TestCase& test_case);
+  virtual void OnTestStart(const TestInfo& test_info);
+  virtual void OnTestPartResult(const TestPartResult& result);
+  virtual void OnTestEnd(const TestInfo& test_info);
+  virtual void OnTestCaseEnd(const TestCase& test_case);
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+
+ private:
+  static void PrintFailedTests(const UnitTest& unit_test);
+};
+
+  // Fired before each iteration of tests starts.
+void PrettyUnitTestResultPrinter::OnTestIterationStart(
+    const UnitTest& unit_test, int iteration) {
+  if (GTEST_FLAG(repeat) != 1)
+    printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
+
+  const char* const filter = GTEST_FLAG(filter).c_str();
+
+  // Prints the filter if it's not *.  This reminds the user that some
+  // tests may be skipped.
+  if (!String::CStringEquals(filter, kUniversalFilter)) {
+    ColoredPrintf(COLOR_YELLOW,
+                  "Note: %s filter = %s\n", GTEST_NAME_, filter);
+  }
+
+  if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
+    const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
+    ColoredPrintf(COLOR_YELLOW,
+                  "Note: This is test shard %d of %s.\n",
+                  static_cast<int>(shard_index) + 1,
+                  internal::posix::GetEnv(kTestTotalShards));
+  }
+
+  if (GTEST_FLAG(shuffle)) {
+    ColoredPrintf(COLOR_YELLOW,
+                  "Note: Randomizing tests' orders with a seed of %d .\n",
+                  unit_test.random_seed());
+  }
+
+  ColoredPrintf(COLOR_GREEN,  "[==========] ");
+  printf("Running %s from %s.\n",
+         FormatTestCount(unit_test.test_to_run_count()).c_str(),
+         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(
+    const UnitTest& /*unit_test*/) {
+  ColoredPrintf(COLOR_GREEN,  "[----------] ");
+  printf("Global test environment set-up.\n");
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
+  const std::string counts =
+      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
+  ColoredPrintf(COLOR_GREEN, "[----------] ");
+  printf("%s from %s", counts.c_str(), test_case.name());
+  if (test_case.type_param() == NULL) {
+    printf("\n");
+  } else {
+    printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());
+  }
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
+  ColoredPrintf(COLOR_GREEN,  "[ RUN      ] ");
+  PrintTestName(test_info.test_case_name(), test_info.name());
+  printf("\n");
+  fflush(stdout);
+}
+
+// Called after an assertion failure.
+void PrettyUnitTestResultPrinter::OnTestPartResult(
+    const TestPartResult& result) {
+  // If the test part succeeded, we don't need to do anything.
+  if (result.type() == TestPartResult::kSuccess)
+    return;
+
+  // Print failure message from the assertion (e.g. expected this and got that).
+  PrintTestPartResult(result);
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
+  if (test_info.result()->Passed()) {
+    ColoredPrintf(COLOR_GREEN, "[       OK ] ");
+  } else {
+    ColoredPrintf(COLOR_RED, "[  FAILED  ] ");
+  }
+  PrintTestName(test_info.test_case_name(), test_info.name());
+  if (test_info.result()->Failed())
+    PrintFullTestCommentIfPresent(test_info);
+
+  if (GTEST_FLAG(print_time)) {
+    printf(" (%s ms)\n", internal::StreamableToString(
+           test_info.result()->elapsed_time()).c_str());
+  } else {
+    printf("\n");
+  }
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
+  if (!GTEST_FLAG(print_time)) return;
+
+  const std::string counts =
+      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
+  ColoredPrintf(COLOR_GREEN, "[----------] ");
+  printf("%s from %s (%s ms total)\n\n",
+         counts.c_str(), test_case.name(),
+         internal::StreamableToString(test_case.elapsed_time()).c_str());
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
+    const UnitTest& /*unit_test*/) {
+  ColoredPrintf(COLOR_GREEN,  "[----------] ");
+  printf("Global test environment tear-down\n");
+  fflush(stdout);
+}
+
+// Internal helper for printing the list of failed tests.
+void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
+  const int failed_test_count = unit_test.failed_test_count();
+  if (failed_test_count == 0) {
+    return;
+  }
+
+  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
+    const TestCase& test_case = *unit_test.GetTestCase(i);
+    if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
+      continue;
+    }
+    for (int j = 0; j < test_case.total_test_count(); ++j) {
+      const TestInfo& test_info = *test_case.GetTestInfo(j);
+      if (!test_info.should_run() || test_info.result()->Passed()) {
+        continue;
+      }
+      ColoredPrintf(COLOR_RED, "[  FAILED  ] ");
+      printf("%s.%s", test_case.name(), test_info.name());
+      PrintFullTestCommentIfPresent(test_info);
+      printf("\n");
+    }
+  }
+}
+
+void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
+                                                     int /*iteration*/) {
+  ColoredPrintf(COLOR_GREEN,  "[==========] ");
+  printf("%s from %s ran.",
+         FormatTestCount(unit_test.test_to_run_count()).c_str(),
+         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
+  if (GTEST_FLAG(print_time)) {
+    printf(" (%s ms total)",
+           internal::StreamableToString(unit_test.elapsed_time()).c_str());
+  }
+  printf("\n");
+  ColoredPrintf(COLOR_GREEN,  "[  PASSED  ] ");
+  printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
+
+  int num_failures = unit_test.failed_test_count();
+  if (!unit_test.Passed()) {
+    const int failed_test_count = unit_test.failed_test_count();
+    ColoredPrintf(COLOR_RED,  "[  FAILED  ] ");
+    printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
+    PrintFailedTests(unit_test);
+    printf("\n%2d FAILED %s\n", num_failures,
+                        num_failures == 1 ? "TEST" : "TESTS");
+  }
+
+  int num_disabled = unit_test.reportable_disabled_test_count();
+  if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {
+    if (!num_failures) {
+      printf("\n");  // Add a spacer if no FAILURE banner is displayed.
+    }
+    ColoredPrintf(COLOR_YELLOW,
+                  "  YOU HAVE %d DISABLED %s\n\n",
+                  num_disabled,
+                  num_disabled == 1 ? "TEST" : "TESTS");
+  }
+  // Ensure that Google Test output is printed before, e.g., heapchecker output.
+  fflush(stdout);
+}
+
+// End PrettyUnitTestResultPrinter
+
+// class TestEventRepeater
+//
+// This class forwards events to other event listeners.
+class TestEventRepeater : public TestEventListener {
+ public:
+  TestEventRepeater() : forwarding_enabled_(true) {}
+  virtual ~TestEventRepeater();
+  void Append(TestEventListener *listener);
+  TestEventListener* Release(TestEventListener* listener);
+
+  // Controls whether events will be forwarded to listeners_. Set to false
+  // in death test child processes.
+  bool forwarding_enabled() const { return forwarding_enabled_; }
+  void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
+
+  virtual void OnTestProgramStart(const UnitTest& unit_test);
+  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
+  virtual void OnTestCaseStart(const TestCase& test_case);
+  virtual void OnTestStart(const TestInfo& test_info);
+  virtual void OnTestPartResult(const TestPartResult& result);
+  virtual void OnTestEnd(const TestInfo& test_info);
+  virtual void OnTestCaseEnd(const TestCase& test_case);
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+  virtual void OnTestProgramEnd(const UnitTest& unit_test);
+
+ private:
+  // Controls whether events will be forwarded to listeners_. Set to false
+  // in death test child processes.
+  bool forwarding_enabled_;
+  // The list of listeners that receive events.
+  std::vector<TestEventListener*> listeners_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);
+};
+
+TestEventRepeater::~TestEventRepeater() {
+  ForEach(listeners_, Delete<TestEventListener>);
+}
+
+void TestEventRepeater::Append(TestEventListener *listener) {
+  listeners_.push_back(listener);
+}
+
+// TODO(vladl@google.com): Factor the search functionality into Vector::Find.
+TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
+  for (size_t i = 0; i < listeners_.size(); ++i) {
+    if (listeners_[i] == listener) {
+      listeners_.erase(listeners_.begin() + i);
+      return listener;
+    }
+  }
+
+  return NULL;
+}
+
+// Since most methods are very similar, use macros to reduce boilerplate.
+// This defines a member that forwards the call to all listeners.
+#define GTEST_REPEATER_METHOD_(Name, Type) \
+void TestEventRepeater::Name(const Type& parameter) { \
+  if (forwarding_enabled_) { \
+    for (size_t i = 0; i < listeners_.size(); i++) { \
+      listeners_[i]->Name(parameter); \
+    } \
+  } \
+}
+// This defines a member that forwards the call to all listeners in reverse
+// order.
+#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
+void TestEventRepeater::Name(const Type& parameter) { \
+  if (forwarding_enabled_) { \
+    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \
+      listeners_[i]->Name(parameter); \
+    } \
+  } \
+}
+
+GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)
+GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)
+GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)
+GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)
+GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)
+GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)
+GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)
+GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)
+GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)
+GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)
+GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)
+
+#undef GTEST_REPEATER_METHOD_
+#undef GTEST_REVERSE_REPEATER_METHOD_
+
+void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,
+                                             int iteration) {
+  if (forwarding_enabled_) {
+    for (size_t i = 0; i < listeners_.size(); i++) {
+      listeners_[i]->OnTestIterationStart(unit_test, iteration);
+    }
+  }
+}
+
+void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,
+                                           int iteration) {
+  if (forwarding_enabled_) {
+    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {
+      listeners_[i]->OnTestIterationEnd(unit_test, iteration);
+    }
+  }
+}
+
+// End TestEventRepeater
+
+// This class generates an XML output file.
+class XmlUnitTestResultPrinter : public EmptyTestEventListener {
+ public:
+  explicit XmlUnitTestResultPrinter(const char* output_file);
+
+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+
+ private:
+  // Is c a whitespace character that is normalized to a space character
+  // when it appears in an XML attribute value?
+  static bool IsNormalizableWhitespace(char c) {
+    return c == 0x9 || c == 0xA || c == 0xD;
+  }
+
+  // May c appear in a well-formed XML document?
+  static bool IsValidXmlCharacter(char c) {
+    return IsNormalizableWhitespace(c) || c >= 0x20;
+  }
+
+  // Returns an XML-escaped copy of the input string str.  If
+  // is_attribute is true, the text is meant to appear as an attribute
+  // value, and normalizable whitespace is preserved by replacing it
+  // with character references.
+  static std::string EscapeXml(const std::string& str, bool is_attribute);
+
+  // Returns the given string with all characters invalid in XML removed.
+  static std::string RemoveInvalidXmlCharacters(const std::string& str);
+
+  // Convenience wrapper around EscapeXml when str is an attribute value.
+  static std::string EscapeXmlAttribute(const std::string& str) {
+    return EscapeXml(str, true);
+  }
+
+  // Convenience wrapper around EscapeXml when str is not an attribute value.
+  static std::string EscapeXmlText(const char* str) {
+    return EscapeXml(str, false);
+  }
+
+  // Verifies that the given attribute belongs to the given element and
+  // streams the attribute as XML.
+  static void OutputXmlAttribute(std::ostream* stream,
+                                 const std::string& element_name,
+                                 const std::string& name,
+                                 const std::string& value);
+
+  // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
+  static void OutputXmlCDataSection(::std::ostream* stream, const char* data);
+
+  // Streams an XML representation of a TestInfo object.
+  static void OutputXmlTestInfo(::std::ostream* stream,
+                                const char* test_case_name,
+                                const TestInfo& test_info);
+
+  // Prints an XML representation of a TestCase object
+  static void PrintXmlTestCase(::std::ostream* stream,
+                               const TestCase& test_case);
+
+  // Prints an XML summary of unit_test to output stream out.
+  static void PrintXmlUnitTest(::std::ostream* stream,
+                               const UnitTest& unit_test);
+
+  // Produces a string representing the test properties in a result as space
+  // delimited XML attributes based on the property key="value" pairs.
+  // When the std::string is not empty, it includes a space at the beginning,
+  // to delimit this attribute from prior attributes.
+  static std::string TestPropertiesAsXmlAttributes(const TestResult& result);
+
+  // The output file.
+  const std::string output_file_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);
+};
+
+// Creates a new XmlUnitTestResultPrinter.
+XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
+    : output_file_(output_file) {
+  if (output_file_.c_str() == NULL || output_file_.empty()) {
+    fprintf(stderr, "XML output file may not be null\n");
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+}
+
+// Called after the unit test ends.
+void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
+                                                  int /*iteration*/) {
+  FILE* xmlout = NULL;
+  FilePath output_file(output_file_);
+  FilePath output_dir(output_file.RemoveFileName());
+
+  if (output_dir.CreateDirectoriesRecursively()) {
+    xmlout = posix::FOpen(output_file_.c_str(), "w");
+  }
+  if (xmlout == NULL) {
+    // TODO(wan): report the reason of the failure.
+    //
+    // We don't do it for now as:
+    //
+    //   1. There is no urgent need for it.
+    //   2. It's a bit involved to make the errno variable thread-safe on
+    //      all three operating systems (Linux, Windows, and Mac OS).
+    //   3. To interpret the meaning of errno in a thread-safe way,
+    //      we need the strerror_r() function, which is not available on
+    //      Windows.
+    fprintf(stderr,
+            "Unable to open file \"%s\"\n",
+            output_file_.c_str());
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+  std::stringstream stream;
+  PrintXmlUnitTest(&stream, unit_test);
+  fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
+  fclose(xmlout);
+}
+
+// Returns an XML-escaped copy of the input string str.  If is_attribute
+// is true, the text is meant to appear as an attribute value, and
+// normalizable whitespace is preserved by replacing it with character
+// references.
+//
+// Invalid XML characters in str, if any, are stripped from the output.
+// It is expected that most, if not all, of the text processed by this
+// module will consist of ordinary English text.
+// If this module is ever modified to produce version 1.1 XML output,
+// most invalid characters can be retained using character references.
+// TODO(wan): It might be nice to have a minimally invasive, human-readable
+// escaping scheme for invalid characters, rather than dropping them.
+std::string XmlUnitTestResultPrinter::EscapeXml(
+    const std::string& str, bool is_attribute) {
+  Message m;
+
+  for (size_t i = 0; i < str.size(); ++i) {
+    const char ch = str[i];
+    switch (ch) {
+      case '<':
+        m << "&lt;";
+        break;
+      case '>':
+        m << "&gt;";
+        break;
+      case '&':
+        m << "&amp;";
+        break;
+      case '\'':
+        if (is_attribute)
+          m << "&apos;";
+        else
+          m << '\'';
+        break;
+      case '"':
+        if (is_attribute)
+          m << "&quot;";
+        else
+          m << '"';
+        break;
+      default:
+        if (IsValidXmlCharacter(ch)) {
+          if (is_attribute && IsNormalizableWhitespace(ch))
+            m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
+              << ";";
+          else
+            m << ch;
+        }
+        break;
+    }
+  }
+
+  return m.GetString();
+}
+
+// Returns the given string with all characters invalid in XML removed.
+// Currently invalid characters are dropped from the string. An
+// alternative is to replace them with certain characters such as . or ?.
+std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
+    const std::string& str) {
+  std::string output;
+  output.reserve(str.size());
+  for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
+    if (IsValidXmlCharacter(*it))
+      output.push_back(*it);
+
+  return output;
+}
+
+// The following routines generate an XML representation of a UnitTest
+// object.
+//
+// This is how Google Test concepts map to the DTD:
+//
+// <testsuites name="AllTests">        <-- corresponds to a UnitTest object
+//   <testsuite name="testcase-name">  <-- corresponds to a TestCase object
+//     <testcase name="test-name">     <-- corresponds to a TestInfo object
+//       <failure message="...">...</failure>
+//       <failure message="...">...</failure>
+//       <failure message="...">...</failure>
+//                                     <-- individual assertion failures
+//     </testcase>
+//   </testsuite>
+// </testsuites>
+
+// Formats the given time in milliseconds as seconds.
+std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
+  ::std::stringstream ss;
+  ss << (static_cast<double>(ms) * 1e-3);
+  return ss.str();
+}
+
+static bool PortableLocaltime(time_t seconds, struct tm* out) {
+#if defined(_MSC_VER)
+  return localtime_s(out, &seconds) == 0;
+#elif defined(__MINGW32__) || defined(__MINGW64__)
+  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
+  // Windows' localtime(), which has a thread-local tm buffer.
+  struct tm* tm_ptr = localtime(&seconds);  // NOLINT
+  if (tm_ptr == NULL)
+    return false;
+  *out = *tm_ptr;
+  return true;
+#else
+  return localtime_r(&seconds, out) != NULL;
+#endif
+}
+
+// Converts the given epoch time in milliseconds to a date string in the ISO
+// 8601 format, without the timezone information.
+std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
+  struct tm time_struct;
+  if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
+    return "";
+  // YYYY-MM-DDThh:mm:ss
+  return StreamableToString(time_struct.tm_year + 1900) + "-" +
+      String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
+      String::FormatIntWidth2(time_struct.tm_mday) + "T" +
+      String::FormatIntWidth2(time_struct.tm_hour) + ":" +
+      String::FormatIntWidth2(time_struct.tm_min) + ":" +
+      String::FormatIntWidth2(time_struct.tm_sec);
+}
+
+// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
+void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,
+                                                     const char* data) {
+  const char* segment = data;
+  *stream << "<![CDATA[";
+  for (;;) {
+    const char* const next_segment = strstr(segment, "]]>");
+    if (next_segment != NULL) {
+      stream->write(
+          segment, static_cast<std::streamsize>(next_segment - segment));
+      *stream << "]]>]]&gt;<![CDATA[";
+      segment = next_segment + strlen("]]>");
+    } else {
+      *stream << segment;
+      break;
+    }
+  }
+  *stream << "]]>";
+}
+
+void XmlUnitTestResultPrinter::OutputXmlAttribute(
+    std::ostream* stream,
+    const std::string& element_name,
+    const std::string& name,
+    const std::string& value) {
+  const std::vector<std::string>& allowed_names =
+      GetReservedAttributesForElement(element_name);
+
+  GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
+                   allowed_names.end())
+      << "Attribute " << name << " is not allowed for element <" << element_name
+      << ">.";
+
+  *stream << " " << name << "=\"" << EscapeXmlAttribute(value) << "\"";
+}
+
+// Prints an XML representation of a TestInfo object.
+// TODO(wan): There is also value in printing properties with the plain printer.
+void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
+                                                 const char* test_case_name,
+                                                 const TestInfo& test_info) {
+  const TestResult& result = *test_info.result();
+  const std::string kTestcase = "testcase";
+
+  *stream << "    <testcase";
+  OutputXmlAttribute(stream, kTestcase, "name", test_info.name());
+
+  if (test_info.value_param() != NULL) {
+    OutputXmlAttribute(stream, kTestcase, "value_param",
+                       test_info.value_param());
+  }
+  if (test_info.type_param() != NULL) {
+    OutputXmlAttribute(stream, kTestcase, "type_param", test_info.type_param());
+  }
+
+  OutputXmlAttribute(stream, kTestcase, "status",
+                     test_info.should_run() ? "run" : "notrun");
+  OutputXmlAttribute(stream, kTestcase, "time",
+                     FormatTimeInMillisAsSeconds(result.elapsed_time()));
+  OutputXmlAttribute(stream, kTestcase, "classname", test_case_name);
+  *stream << TestPropertiesAsXmlAttributes(result);
+
+  int failures = 0;
+  for (int i = 0; i < result.total_part_count(); ++i) {
+    const TestPartResult& part = result.GetTestPartResult(i);
+    if (part.failed()) {
+      if (++failures == 1) {
+        *stream << ">\n";
+      }
+      const string location = internal::FormatCompilerIndependentFileLocation(
+          part.file_name(), part.line_number());
+      const string summary = location + "\n" + part.summary();
+      *stream << "      <failure message=\""
+              << EscapeXmlAttribute(summary.c_str())
+              << "\" type=\"\">";
+      const string detail = location + "\n" + part.message();
+      OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
+      *stream << "</failure>\n";
+    }
+  }
+
+  if (failures == 0)
+    *stream << " />\n";
+  else
+    *stream << "    </testcase>\n";
+}
+
+// Prints an XML representation of a TestCase object
+void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,
+                                                const TestCase& test_case) {
+  const std::string kTestsuite = "testsuite";
+  *stream << "  <" << kTestsuite;
+  OutputXmlAttribute(stream, kTestsuite, "name", test_case.name());
+  OutputXmlAttribute(stream, kTestsuite, "tests",
+                     StreamableToString(test_case.reportable_test_count()));
+  OutputXmlAttribute(stream, kTestsuite, "failures",
+                     StreamableToString(test_case.failed_test_count()));
+  OutputXmlAttribute(
+      stream, kTestsuite, "disabled",
+      StreamableToString(test_case.reportable_disabled_test_count()));
+  OutputXmlAttribute(stream, kTestsuite, "errors", "0");
+  OutputXmlAttribute(stream, kTestsuite, "time",
+                     FormatTimeInMillisAsSeconds(test_case.elapsed_time()));
+  *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result())
+          << ">\n";
+
+  for (int i = 0; i < test_case.total_test_count(); ++i) {
+    if (test_case.GetTestInfo(i)->is_reportable())
+      OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));
+  }
+  *stream << "  </" << kTestsuite << ">\n";
+}
+
+// Prints an XML summary of unit_test to output stream out.
+void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,
+                                                const UnitTest& unit_test) {
+  const std::string kTestsuites = "testsuites";
+
+  *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+  *stream << "<" << kTestsuites;
+
+  OutputXmlAttribute(stream, kTestsuites, "tests",
+                     StreamableToString(unit_test.reportable_test_count()));
+  OutputXmlAttribute(stream, kTestsuites, "failures",
+                     StreamableToString(unit_test.failed_test_count()));
+  OutputXmlAttribute(
+      stream, kTestsuites, "disabled",
+      StreamableToString(unit_test.reportable_disabled_test_count()));
+  OutputXmlAttribute(stream, kTestsuites, "errors", "0");
+  OutputXmlAttribute(
+      stream, kTestsuites, "timestamp",
+      FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()));
+  OutputXmlAttribute(stream, kTestsuites, "time",
+                     FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));
+
+  if (GTEST_FLAG(shuffle)) {
+    OutputXmlAttribute(stream, kTestsuites, "random_seed",
+                       StreamableToString(unit_test.random_seed()));
+  }
+
+  *stream << TestPropertiesAsXmlAttributes(unit_test.ad_hoc_test_result());
+
+  OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
+  *stream << ">\n";
+
+  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
+    if (unit_test.GetTestCase(i)->reportable_test_count() > 0)
+      PrintXmlTestCase(stream, *unit_test.GetTestCase(i));
+  }
+  *stream << "</" << kTestsuites << ">\n";
+}
+
+// Produces a string representing the test properties in a result as space
+// delimited XML attributes based on the property key="value" pairs.
+std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(
+    const TestResult& result) {
+  Message attributes;
+  for (int i = 0; i < result.test_property_count(); ++i) {
+    const TestProperty& property = result.GetTestProperty(i);
+    attributes << " " << property.key() << "="
+        << "\"" << EscapeXmlAttribute(property.value()) << "\"";
+  }
+  return attributes.GetString();
+}
+
+// End XmlUnitTestResultPrinter
+
+#if GTEST_CAN_STREAM_RESULTS_
+
+// Checks if str contains '=', '&', '%' or '\n' characters. If yes,
+// replaces them by "%xx" where xx is their hexadecimal value. For
+// example, replaces "=" with "%3D".  This algorithm is O(strlen(str))
+// in both time and space -- important as the input str may contain an
+// arbitrarily long test failure message and stack trace.
+string StreamingListener::UrlEncode(const char* str) {
+  string result;
+  result.reserve(strlen(str) + 1);
+  for (char ch = *str; ch != '\0'; ch = *++str) {
+    switch (ch) {
+      case '%':
+      case '=':
+      case '&':
+      case '\n':
+        result.append("%" + String::FormatByte(static_cast<unsigned char>(ch)));
+        break;
+      default:
+        result.push_back(ch);
+        break;
+    }
+  }
+  return result;
+}
+
+void StreamingListener::SocketWriter::MakeConnection() {
+  GTEST_CHECK_(sockfd_ == -1)
+      << "MakeConnection() can't be called when there is already a connection.";
+
+  addrinfo hints;
+  memset(&hints, 0, sizeof(hints));
+  hints.ai_family = AF_UNSPEC;    // To allow both IPv4 and IPv6 addresses.
+  hints.ai_socktype = SOCK_STREAM;
+  addrinfo* servinfo = NULL;
+
+  // Use the getaddrinfo() to get a linked list of IP addresses for
+  // the given host name.
+  const int error_num = getaddrinfo(
+      host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);
+  if (error_num != 0) {
+    GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: "
+                        << gai_strerror(error_num);
+  }
+
+  // Loop through all the results and connect to the first we can.
+  for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;
+       cur_addr = cur_addr->ai_next) {
+    sockfd_ = socket(
+        cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);
+    if (sockfd_ != -1) {
+      // Connect the client socket to the server socket.
+      if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {
+        close(sockfd_);
+        sockfd_ = -1;
+      }
+    }
+  }
+
+  freeaddrinfo(servinfo);  // all done with this structure
+
+  if (sockfd_ == -1) {
+    GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to "
+                        << host_name_ << ":" << port_num_;
+  }
+}
+
+// End of class Streaming Listener
+#endif  // GTEST_CAN_STREAM_RESULTS__
+
+// Class ScopedTrace
+
+// Pushes the given source file location and message onto a per-thread
+// trace stack maintained by Google Test.
+ScopedTrace::ScopedTrace(const char* file, int line, const Message& message)
+    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
+  TraceInfo trace;
+  trace.file = file;
+  trace.line = line;
+  trace.message = message.GetString();
+
+  UnitTest::GetInstance()->PushGTestTrace(trace);
+}
+
+// Pops the info pushed by the c'tor.
+ScopedTrace::~ScopedTrace()
+    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
+  UnitTest::GetInstance()->PopGTestTrace();
+}
+
+
+// class OsStackTraceGetter
+
+const char* const OsStackTraceGetterInterface::kElidedFramesMarker =
+    "... " GTEST_NAME_ " internal frames ...";
+
+string OsStackTraceGetter::CurrentStackTrace(int /*max_depth*/,
+                                             int /*skip_count*/) {
+  return "";
+}
+
+void OsStackTraceGetter::UponLeavingGTest() {}
+
+// A helper class that creates the premature-exit file in its
+// constructor and deletes the file in its destructor.
+class ScopedPrematureExitFile {
+ public:
+  explicit ScopedPrematureExitFile(const char* premature_exit_filepath)
+      : premature_exit_filepath_(premature_exit_filepath) {
+    // If a path to the premature-exit file is specified...
+    if (premature_exit_filepath != NULL && *premature_exit_filepath != '\0') {
+      // create the file with a single "0" character in it.  I/O
+      // errors are ignored as there's nothing better we can do and we
+      // don't want to fail the test because of this.
+      FILE* pfile = posix::FOpen(premature_exit_filepath, "w");
+      fwrite("0", 1, 1, pfile);
+      fclose(pfile);
+    }
+  }
+
+  ~ScopedPrematureExitFile() {
+    if (premature_exit_filepath_ != NULL && *premature_exit_filepath_ != '\0') {
+      remove(premature_exit_filepath_);
+    }
+  }
+
+ private:
+  const char* const premature_exit_filepath_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile);
+};
+
+}  // namespace internal
+
+// class TestEventListeners
+
+TestEventListeners::TestEventListeners()
+    : repeater_(new internal::TestEventRepeater()),
+      default_result_printer_(NULL),
+      default_xml_generator_(NULL) {
+}
+
+TestEventListeners::~TestEventListeners() { delete repeater_; }
+
+// Returns the standard listener responsible for the default console
+// output.  Can be removed from the listeners list to shut down default
+// console output.  Note that removing this object from the listener list
+// with Release transfers its ownership to the user.
+void TestEventListeners::Append(TestEventListener* listener) {
+  repeater_->Append(listener);
+}
+
+// Removes the given event listener from the list and returns it.  It then
+// becomes the caller's responsibility to delete the listener. Returns
+// NULL if the listener is not found in the list.
+TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
+  if (listener == default_result_printer_)
+    default_result_printer_ = NULL;
+  else if (listener == default_xml_generator_)
+    default_xml_generator_ = NULL;
+  return repeater_->Release(listener);
+}
+
+// Returns repeater that broadcasts the TestEventListener events to all
+// subscribers.
+TestEventListener* TestEventListeners::repeater() { return repeater_; }
+
+// Sets the default_result_printer attribute to the provided listener.
+// The listener is also added to the listener list and previous
+// default_result_printer is removed from it and deleted. The listener can
+// also be NULL in which case it will not be added to the list. Does
+// nothing if the previous and the current listener objects are the same.
+void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {
+  if (default_result_printer_ != listener) {
+    // It is an error to pass this method a listener that is already in the
+    // list.
+    delete Release(default_result_printer_);
+    default_result_printer_ = listener;
+    if (listener != NULL)
+      Append(listener);
+  }
+}
+
+// Sets the default_xml_generator attribute to the provided listener.  The
+// listener is also added to the listener list and previous
+// default_xml_generator is removed from it and deleted. The listener can
+// also be NULL in which case it will not be added to the list. Does
+// nothing if the previous and the current listener objects are the same.
+void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {
+  if (default_xml_generator_ != listener) {
+    // It is an error to pass this method a listener that is already in the
+    // list.
+    delete Release(default_xml_generator_);
+    default_xml_generator_ = listener;
+    if (listener != NULL)
+      Append(listener);
+  }
+}
+
+// Controls whether events will be forwarded by the repeater to the
+// listeners in the list.
+bool TestEventListeners::EventForwardingEnabled() const {
+  return repeater_->forwarding_enabled();
+}
+
+void TestEventListeners::SuppressEventForwarding() {
+  repeater_->set_forwarding_enabled(false);
+}
+
+// class UnitTest
+
+// Gets the singleton UnitTest object.  The first time this method is
+// called, a UnitTest object is constructed and returned.  Consecutive
+// calls will return the same object.
+//
+// We don't protect this under mutex_ as a user is not supposed to
+// call this before main() starts, from which point on the return
+// value will never change.
+UnitTest* UnitTest::GetInstance() {
+  // When compiled with MSVC 7.1 in optimized mode, destroying the
+  // UnitTest object upon exiting the program messes up the exit code,
+  // causing successful tests to appear failed.  We have to use a
+  // different implementation in this case to bypass the compiler bug.
+  // This implementation makes the compiler happy, at the cost of
+  // leaking the UnitTest object.
+
+  // CodeGear C++Builder insists on a public destructor for the
+  // default implementation.  Use this implementation to keep good OO
+  // design with private destructor.
+
+#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
+  static UnitTest* const instance = new UnitTest;
+  return instance;
+#else
+  static UnitTest instance;
+  return &instance;
+#endif  // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
+}
+
+// Gets the number of successful test cases.
+int UnitTest::successful_test_case_count() const {
+  return impl()->successful_test_case_count();
+}
+
+// Gets the number of failed test cases.
+int UnitTest::failed_test_case_count() const {
+  return impl()->failed_test_case_count();
+}
+
+// Gets the number of all test cases.
+int UnitTest::total_test_case_count() const {
+  return impl()->total_test_case_count();
+}
+
+// Gets the number of all test cases that contain at least one test
+// that should run.
+int UnitTest::test_case_to_run_count() const {
+  return impl()->test_case_to_run_count();
+}
+
+// Gets the number of successful tests.
+int UnitTest::successful_test_count() const {
+  return impl()->successful_test_count();
+}
+
+// Gets the number of failed tests.
+int UnitTest::failed_test_count() const { return impl()->failed_test_count(); }
+
+// Gets the number of disabled tests that will be reported in the XML report.
+int UnitTest::reportable_disabled_test_count() const {
+  return impl()->reportable_disabled_test_count();
+}
+
+// Gets the number of disabled tests.
+int UnitTest::disabled_test_count() const {
+  return impl()->disabled_test_count();
+}
+
+// Gets the number of tests to be printed in the XML report.
+int UnitTest::reportable_test_count() const {
+  return impl()->reportable_test_count();
+}
+
+// Gets the number of all tests.
+int UnitTest::total_test_count() const { return impl()->total_test_count(); }
+
+// Gets the number of tests that should run.
+int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }
+
+// Gets the time of the test program start, in ms from the start of the
+// UNIX epoch.
+internal::TimeInMillis UnitTest::start_timestamp() const {
+    return impl()->start_timestamp();
+}
+
+// Gets the elapsed time, in milliseconds.
+internal::TimeInMillis UnitTest::elapsed_time() const {
+  return impl()->elapsed_time();
+}
+
+// Returns true iff the unit test passed (i.e. all test cases passed).
+bool UnitTest::Passed() const { return impl()->Passed(); }
+
+// Returns true iff the unit test failed (i.e. some test case failed
+// or something outside of all tests failed).
+bool UnitTest::Failed() const { return impl()->Failed(); }
+
+// Gets the i-th test case among all the test cases. i can range from 0 to
+// total_test_case_count() - 1. If i is not in that range, returns NULL.
+const TestCase* UnitTest::GetTestCase(int i) const {
+  return impl()->GetTestCase(i);
+}
+
+// Returns the TestResult containing information on test failures and
+// properties logged outside of individual test cases.
+const TestResult& UnitTest::ad_hoc_test_result() const {
+  return *impl()->ad_hoc_test_result();
+}
+
+// Gets the i-th test case among all the test cases. i can range from 0 to
+// total_test_case_count() - 1. If i is not in that range, returns NULL.
+TestCase* UnitTest::GetMutableTestCase(int i) {
+  return impl()->GetMutableTestCase(i);
+}
+
+// Returns the list of event listeners that can be used to track events
+// inside Google Test.
+TestEventListeners& UnitTest::listeners() {
+  return *impl()->listeners();
+}
+
+// Registers and returns a global test environment.  When a test
+// program is run, all global test environments will be set-up in the
+// order they were registered.  After all tests in the program have
+// finished, all global test environments will be torn-down in the
+// *reverse* order they were registered.
+//
+// The UnitTest object takes ownership of the given environment.
+//
+// We don't protect this under mutex_, as we only support calling it
+// from the main thread.
+Environment* UnitTest::AddEnvironment(Environment* env) {
+  if (env == NULL) {
+    return NULL;
+  }
+
+  impl_->environments().push_back(env);
+  return env;
+}
+
+// Adds a TestPartResult to the current TestResult object.  All Google Test
+// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call
+// this to report their results.  The user code should use the
+// assertion macros instead of calling this directly.
+void UnitTest::AddTestPartResult(
+    TestPartResult::Type result_type,
+    const char* file_name,
+    int line_number,
+    const std::string& message,
+    const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+  Message msg;
+  msg << message;
+
+  internal::MutexLock lock(&mutex_);
+  if (impl_->gtest_trace_stack().size() > 0) {
+    msg << "\n" << GTEST_NAME_ << " trace:";
+
+    for (int i = static_cast<int>(impl_->gtest_trace_stack().size());
+         i > 0; --i) {
+      const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
+      msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
+          << " " << trace.message;
+    }
+  }
+
+  if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {
+    msg << internal::kStackTraceMarker << os_stack_trace;
+  }
+
+  const TestPartResult result =
+    TestPartResult(result_type, file_name, line_number,
+                   msg.GetString().c_str());
+  impl_->GetTestPartResultReporterForCurrentThread()->
+      ReportTestPartResult(result);
+
+  if (result_type != TestPartResult::kSuccess) {
+    // gtest_break_on_failure takes precedence over
+    // gtest_throw_on_failure.  This allows a user to set the latter
+    // in the code (perhaps in order to use Google Test assertions
+    // with another testing framework) and specify the former on the
+    // command line for debugging.
+    if (GTEST_FLAG(break_on_failure)) {
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+      // Using DebugBreak on Windows allows gtest to still break into a debugger
+      // when a failure happens and both the --gtest_break_on_failure and
+      // the --gtest_catch_exceptions flags are specified.
+      DebugBreak();
+#else
+      // Dereference NULL through a volatile pointer to prevent the compiler
+      // from removing. We use this rather than abort() or __builtin_trap() for
+      // portability: Symbian doesn't implement abort() well, and some debuggers
+      // don't correctly trap abort().
+      *static_cast<volatile int*>(NULL) = 1;
+#endif  // GTEST_OS_WINDOWS
+    } else if (GTEST_FLAG(throw_on_failure)) {
+#if GTEST_HAS_EXCEPTIONS
+      throw internal::GoogleTestFailureException(result);
+#else
+      // We cannot call abort() as it generates a pop-up in debug mode
+      // that cannot be suppressed in VC 7.1 or below.
+      exit(1);
+#endif
+    }
+  }
+}
+
+// Adds a TestProperty to the current TestResult object when invoked from
+// inside a test, to current TestCase's ad_hoc_test_result_ when invoked
+// from SetUpTestCase or TearDownTestCase, or to the global property set
+// when invoked elsewhere.  If the result already contains a property with
+// the same key, the value will be updated.
+void UnitTest::RecordProperty(const std::string& key,
+                              const std::string& value) {
+  impl_->RecordProperty(TestProperty(key, value));
+}
+
+// Runs all tests in this UnitTest object and prints the result.
+// Returns 0 if successful, or 1 otherwise.
+//
+// We don't protect this under mutex_, as we only support calling it
+// from the main thread.
+int UnitTest::Run() {
+  const bool in_death_test_child_process =
+      internal::GTEST_FLAG(internal_run_death_test).length() > 0;
+
+  // Google Test implements this protocol for catching that a test
+  // program exits before returning control to Google Test:
+  //
+  //   1. Upon start, Google Test creates a file whose absolute path
+  //      is specified by the environment variable
+  //      TEST_PREMATURE_EXIT_FILE.
+  //   2. When Google Test has finished its work, it deletes the file.
+  //
+  // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
+  // running a Google-Test-based test program and check the existence
+  // of the file at the end of the test execution to see if it has
+  // exited prematurely.
+
+  // If we are in the child process of a death test, don't
+  // create/delete the premature exit file, as doing so is unnecessary
+  // and will confuse the parent process.  Otherwise, create/delete
+  // the file upon entering/leaving this function.  If the program
+  // somehow exits before this function has a chance to return, the
+  // premature-exit file will be left undeleted, causing a test runner
+  // that understands the premature-exit-file protocol to report the
+  // test as having failed.
+  const internal::ScopedPrematureExitFile premature_exit_file(
+      in_death_test_child_process ?
+      NULL : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));
+
+  // Captures the value of GTEST_FLAG(catch_exceptions).  This value will be
+  // used for the duration of the program.
+  impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions));
+
+#if GTEST_HAS_SEH
+  // Either the user wants Google Test to catch exceptions thrown by the
+  // tests or this is executing in the context of death test child
+  // process. In either case the user does not want to see pop-up dialogs
+  // about crashes - they are expected.
+  if (impl()->catch_exceptions() || in_death_test_child_process) {
+# if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+    // SetErrorMode doesn't exist on CE.
+    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
+                 SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
+# endif  // !GTEST_OS_WINDOWS_MOBILE
+
+# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE
+    // Death test children can be terminated with _abort().  On Windows,
+    // _abort() can show a dialog with a warning message.  This forces the
+    // abort message to go to stderr instead.
+    _set_error_mode(_OUT_TO_STDERR);
+# endif
+
+# if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
+    // In the debug version, Visual Studio pops up a separate dialog
+    // offering a choice to debug the aborted program. We need to suppress
+    // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
+    // executed. Google Test will notify the user of any unexpected
+    // failure via stderr.
+    //
+    // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
+    // Users of prior VC versions shall suffer the agony and pain of
+    // clicking through the countless debug dialogs.
+    // TODO(vladl@google.com): find a way to suppress the abort dialog() in the
+    // debug mode when compiled with VC 7.1 or lower.
+    if (!GTEST_FLAG(break_on_failure))
+      _set_abort_behavior(
+          0x0,                                    // Clear the following flags:
+          _WRITE_ABORT_MSG | _CALL_REPORTFAULT);  // pop-up window, core dump.
+# endif
+  }
+#endif  // GTEST_HAS_SEH
+
+  return internal::HandleExceptionsInMethodIfSupported(
+      impl(),
+      &internal::UnitTestImpl::RunAllTests,
+      "auxiliary test code (environments or event listeners)") ? 0 : 1;
+}
+
+// Returns the working directory when the first TEST() or TEST_F() was
+// executed.
+const char* UnitTest::original_working_dir() const {
+  return impl_->original_working_dir_.c_str();
+}
+
+// Returns the TestCase object for the test that's currently running,
+// or NULL if no test is running.
+const TestCase* UnitTest::current_test_case() const
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  return impl_->current_test_case();
+}
+
+// Returns the TestInfo object for the test that's currently running,
+// or NULL if no test is running.
+const TestInfo* UnitTest::current_test_info() const
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  return impl_->current_test_info();
+}
+
+// Returns the random seed used at the start of the current test run.
+int UnitTest::random_seed() const { return impl_->random_seed(); }
+
+#if GTEST_HAS_PARAM_TEST
+// Returns ParameterizedTestCaseRegistry object used to keep track of
+// value-parameterized tests and instantiate and register them.
+internal::ParameterizedTestCaseRegistry&
+    UnitTest::parameterized_test_registry()
+        GTEST_LOCK_EXCLUDED_(mutex_) {
+  return impl_->parameterized_test_registry();
+}
+#endif  // GTEST_HAS_PARAM_TEST
+
+// Creates an empty UnitTest.
+UnitTest::UnitTest() {
+  impl_ = new internal::UnitTestImpl(this);
+}
+
+// Destructor of UnitTest.
+UnitTest::~UnitTest() {
+  delete impl_;
+}
+
+// Pushes a trace defined by SCOPED_TRACE() on to the per-thread
+// Google Test trace stack.
+void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  impl_->gtest_trace_stack().push_back(trace);
+}
+
+// Pops a trace from the per-thread Google Test trace stack.
+void UnitTest::PopGTestTrace()
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  impl_->gtest_trace_stack().pop_back();
+}
+
+namespace internal {
+
+UnitTestImpl::UnitTestImpl(UnitTest* parent)
+    : parent_(parent),
+      GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
+      default_global_test_part_result_reporter_(this),
+      default_per_thread_test_part_result_reporter_(this),
+      GTEST_DISABLE_MSC_WARNINGS_POP_()
+      global_test_part_result_repoter_(
+          &default_global_test_part_result_reporter_),
+      per_thread_test_part_result_reporter_(
+          &default_per_thread_test_part_result_reporter_),
+#if GTEST_HAS_PARAM_TEST
+      parameterized_test_registry_(),
+      parameterized_tests_registered_(false),
+#endif  // GTEST_HAS_PARAM_TEST
+      last_death_test_case_(-1),
+      current_test_case_(NULL),
+      current_test_info_(NULL),
+      ad_hoc_test_result_(),
+      os_stack_trace_getter_(NULL),
+      post_flag_parse_init_performed_(false),
+      random_seed_(0),  // Will be overridden by the flag before first use.
+      random_(0),  // Will be reseeded before first use.
+      start_timestamp_(0),
+      elapsed_time_(0),
+#if GTEST_HAS_DEATH_TEST
+      death_test_factory_(new DefaultDeathTestFactory),
+#endif
+      // Will be overridden by the flag before first use.
+      catch_exceptions_(false) {
+  listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);
+}
+
+UnitTestImpl::~UnitTestImpl() {
+  // Deletes every TestCase.
+  ForEach(test_cases_, internal::Delete<TestCase>);
+
+  // Deletes every Environment.
+  ForEach(environments_, internal::Delete<Environment>);
+
+  delete os_stack_trace_getter_;
+}
+
+// Adds a TestProperty to the current TestResult object when invoked in a
+// context of a test, to current test case's ad_hoc_test_result when invoke
+// from SetUpTestCase/TearDownTestCase, or to the global property set
+// otherwise.  If the result already contains a property with the same key,
+// the value will be updated.
+void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
+  std::string xml_element;
+  TestResult* test_result;  // TestResult appropriate for property recording.
+
+  if (current_test_info_ != NULL) {
+    xml_element = "testcase";
+    test_result = &(current_test_info_->result_);
+  } else if (current_test_case_ != NULL) {
+    xml_element = "testsuite";
+    test_result = &(current_test_case_->ad_hoc_test_result_);
+  } else {
+    xml_element = "testsuites";
+    test_result = &ad_hoc_test_result_;
+  }
+  test_result->RecordProperty(xml_element, test_property);
+}
+
+#if GTEST_HAS_DEATH_TEST
+// Disables event forwarding if the control is currently in a death test
+// subprocess. Must not be called before InitGoogleTest.
+void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
+  if (internal_run_death_test_flag_.get() != NULL)
+    listeners()->SuppressEventForwarding();
+}
+#endif  // GTEST_HAS_DEATH_TEST
+
+// Initializes event listeners performing XML output as specified by
+// UnitTestOptions. Must not be called before InitGoogleTest.
+void UnitTestImpl::ConfigureXmlOutput() {
+  const std::string& output_format = UnitTestOptions::GetOutputFormat();
+  if (output_format == "xml") {
+    listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
+        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
+  } else if (output_format != "") {
+    printf("WARNING: unrecognized output format \"%s\" ignored.\n",
+           output_format.c_str());
+    fflush(stdout);
+  }
+}
+
+#if GTEST_CAN_STREAM_RESULTS_
+// Initializes event listeners for streaming test results in string form.
+// Must not be called before InitGoogleTest.
+void UnitTestImpl::ConfigureStreamingOutput() {
+  const std::string& target = GTEST_FLAG(stream_result_to);
+  if (!target.empty()) {
+    const size_t pos = target.find(':');
+    if (pos != std::string::npos) {
+      listeners()->Append(new StreamingListener(target.substr(0, pos),
+                                                target.substr(pos+1)));
+    } else {
+      printf("WARNING: unrecognized streaming target \"%s\" ignored.\n",
+             target.c_str());
+      fflush(stdout);
+    }
+  }
+}
+#endif  // GTEST_CAN_STREAM_RESULTS_
+
+// Performs initialization dependent upon flag values obtained in
+// ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to
+// ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest
+// this function is also called from RunAllTests.  Since this function can be
+// called more than once, it has to be idempotent.
+void UnitTestImpl::PostFlagParsingInit() {
+  // Ensures that this function does not execute more than once.
+  if (!post_flag_parse_init_performed_) {
+    post_flag_parse_init_performed_ = true;
+
+#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+    // Register to send notifications about key process state changes.
+    listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());
+#endif  // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+
+#if GTEST_HAS_DEATH_TEST
+    InitDeathTestSubprocessControlInfo();
+    SuppressTestEventsIfInSubprocess();
+#endif  // GTEST_HAS_DEATH_TEST
+
+    // Registers parameterized tests. This makes parameterized tests
+    // available to the UnitTest reflection API without running
+    // RUN_ALL_TESTS.
+    RegisterParameterizedTests();
+
+    // Configures listeners for XML output. This makes it possible for users
+    // to shut down the default XML output before invoking RUN_ALL_TESTS.
+    ConfigureXmlOutput();
+
+#if GTEST_CAN_STREAM_RESULTS_
+    // Configures listeners for streaming test results to the specified server.
+    ConfigureStreamingOutput();
+#endif  // GTEST_CAN_STREAM_RESULTS_
+  }
+}
+
+// A predicate that checks the name of a TestCase against a known
+// value.
+//
+// This is used for implementation of the UnitTest class only.  We put
+// it in the anonymous namespace to prevent polluting the outer
+// namespace.
+//
+// TestCaseNameIs is copyable.
+class TestCaseNameIs {
+ public:
+  // Constructor.
+  explicit TestCaseNameIs(const std::string& name)
+      : name_(name) {}
+
+  // Returns true iff the name of test_case matches name_.
+  bool operator()(const TestCase* test_case) const {
+    return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;
+  }
+
+ private:
+  std::string name_;
+};
+
+// Finds and returns a TestCase with the given name.  If one doesn't
+// exist, creates one and returns it.  It's the CALLER'S
+// RESPONSIBILITY to ensure that this function is only called WHEN THE
+// TESTS ARE NOT SHUFFLED.
+//
+// Arguments:
+//
+//   test_case_name: name of the test case
+//   type_param:     the name of the test case's type parameter, or NULL if
+//                   this is not a typed or a type-parameterized test case.
+//   set_up_tc:      pointer to the function that sets up the test case
+//   tear_down_tc:   pointer to the function that tears down the test case
+TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
+                                    const char* type_param,
+                                    Test::SetUpTestCaseFunc set_up_tc,
+                                    Test::TearDownTestCaseFunc tear_down_tc) {
+  // Can we find a TestCase with the given name?
+  const std::vector<TestCase*>::const_iterator test_case =
+      std::find_if(test_cases_.begin(), test_cases_.end(),
+                   TestCaseNameIs(test_case_name));
+
+  if (test_case != test_cases_.end())
+    return *test_case;
+
+  // No.  Let's create one.
+  TestCase* const new_test_case =
+      new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc);
+
+  // Is this a death test case?
+  if (internal::UnitTestOptions::MatchesFilter(test_case_name,
+                                               kDeathTestCaseFilter)) {
+    // Yes.  Inserts the test case after the last death test case
+    // defined so far.  This only works when the test cases haven't
+    // been shuffled.  Otherwise we may end up running a death test
+    // after a non-death test.
+    ++last_death_test_case_;
+    test_cases_.insert(test_cases_.begin() + last_death_test_case_,
+                       new_test_case);
+  } else {
+    // No.  Appends to the end of the list.
+    test_cases_.push_back(new_test_case);
+  }
+
+  test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));
+  return new_test_case;
+}
+
+// Helpers for setting up / tearing down the given environment.  They
+// are for use in the ForEach() function.
+static void SetUpEnvironment(Environment* env) { env->SetUp(); }
+static void TearDownEnvironment(Environment* env) { env->TearDown(); }
+
+// Runs all tests in this UnitTest object, prints the result, and
+// returns true if all tests are successful.  If any exception is
+// thrown during a test, the test is considered to be failed, but the
+// rest of the tests will still be run.
+//
+// When parameterized tests are enabled, it expands and registers
+// parameterized tests first in RegisterParameterizedTests().
+// All other functions called from RunAllTests() may safely assume that
+// parameterized tests are ready to be counted and run.
+bool UnitTestImpl::RunAllTests() {
+  // Makes sure InitGoogleTest() was called.
+  if (!GTestIsInitialized()) {
+    printf("%s",
+           "\nThis test program did NOT call ::testing::InitGoogleTest "
+           "before calling RUN_ALL_TESTS().  Please fix it.\n");
+    return false;
+  }
+
+  // Do not run any test if the --help flag was specified.
+  if (g_help_flag)
+    return true;
+
+  // Repeats the call to the post-flag parsing initialization in case the
+  // user didn't call InitGoogleTest.
+  PostFlagParsingInit();
+
+  // Even if sharding is not on, test runners may want to use the
+  // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
+  // protocol.
+  internal::WriteToShardStatusFileIfNeeded();
+
+  // True iff we are in a subprocess for running a thread-safe-style
+  // death test.
+  bool in_subprocess_for_death_test = false;
+
+#if GTEST_HAS_DEATH_TEST
+  in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
+# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
+  if (in_subprocess_for_death_test) {
+    GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
+  }
+# endif  // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
+#endif  // GTEST_HAS_DEATH_TEST
+
+  const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
+                                        in_subprocess_for_death_test);
+
+  // Compares the full test names with the filter to decide which
+  // tests to run.
+  const bool has_tests_to_run = FilterTests(should_shard
+                                              ? HONOR_SHARDING_PROTOCOL
+                                              : IGNORE_SHARDING_PROTOCOL) > 0;
+
+  // Lists the tests and exits if the --gtest_list_tests flag was specified.
+  if (GTEST_FLAG(list_tests)) {
+    // This must be called *after* FilterTests() has been called.
+    ListTestsMatchingFilter();
+    return true;
+  }
+
+  random_seed_ = GTEST_FLAG(shuffle) ?
+      GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;
+
+  // True iff at least one test has failed.
+  bool failed = false;
+
+  TestEventListener* repeater = listeners()->repeater();
+
+  start_timestamp_ = GetTimeInMillis();
+  repeater->OnTestProgramStart(*parent_);
+
+  // How many times to repeat the tests?  We don't want to repeat them
+  // when we are inside the subprocess of a death test.
+  const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);
+  // Repeats forever if the repeat count is negative.
+  const bool forever = repeat < 0;
+  for (int i = 0; forever || i != repeat; i++) {
+    // We want to preserve failures generated by ad-hoc test
+    // assertions executed before RUN_ALL_TESTS().
+    ClearNonAdHocTestResult();
+
+    const TimeInMillis start = GetTimeInMillis();
+
+    // Shuffles test cases and tests if requested.
+    if (has_tests_to_run && GTEST_FLAG(shuffle)) {
+      random()->Reseed(random_seed_);
+      // This should be done before calling OnTestIterationStart(),
+      // such that a test event listener can see the actual test order
+      // in the event.
+      ShuffleTests();
+    }
+
+    // Tells the unit test event listeners that the tests are about to start.
+    repeater->OnTestIterationStart(*parent_, i);
+
+    // Runs each test case if there is at least one test to run.
+    if (has_tests_to_run) {
+      // Sets up all environments beforehand.
+      repeater->OnEnvironmentsSetUpStart(*parent_);
+      ForEach(environments_, SetUpEnvironment);
+      repeater->OnEnvironmentsSetUpEnd(*parent_);
+
+      // Runs the tests only if there was no fatal failure during global
+      // set-up.
+      if (!Test::HasFatalFailure()) {
+        for (int test_index = 0; test_index < total_test_case_count();
+             test_index++) {
+          GetMutableTestCase(test_index)->Run();
+        }
+      }
+
+      // Tears down all environments in reverse order afterwards.
+      repeater->OnEnvironmentsTearDownStart(*parent_);
+      std::for_each(environments_.rbegin(), environments_.rend(),
+                    TearDownEnvironment);
+      repeater->OnEnvironmentsTearDownEnd(*parent_);
+    }
+
+    elapsed_time_ = GetTimeInMillis() - start;
+
+    // Tells the unit test event listener that the tests have just finished.
+    repeater->OnTestIterationEnd(*parent_, i);
+
+    // Gets the result and clears it.
+    if (!Passed()) {
+      failed = true;
+    }
+
+    // Restores the original test order after the iteration.  This
+    // allows the user to quickly repro a failure that happens in the
+    // N-th iteration without repeating the first (N - 1) iterations.
+    // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
+    // case the user somehow changes the value of the flag somewhere
+    // (it's always safe to unshuffle the tests).
+    UnshuffleTests();
+
+    if (GTEST_FLAG(shuffle)) {
+      // Picks a new random seed for each iteration.
+      random_seed_ = GetNextRandomSeed(random_seed_);
+    }
+  }
+
+  repeater->OnTestProgramEnd(*parent_);
+
+  return !failed;
+}
+
+// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
+// if the variable is present. If a file already exists at this location, this
+// function will write over it. If the variable is present, but the file cannot
+// be created, prints an error and exits.
+void WriteToShardStatusFileIfNeeded() {
+  const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
+  if (test_shard_file != NULL) {
+    FILE* const file = posix::FOpen(test_shard_file, "w");
+    if (file == NULL) {
+      ColoredPrintf(COLOR_RED,
+                    "Could not write to the test shard status file \"%s\" "
+                    "specified by the %s environment variable.\n",
+                    test_shard_file, kTestShardStatusFile);
+      fflush(stdout);
+      exit(EXIT_FAILURE);
+    }
+    fclose(file);
+  }
+}
+
+// Checks whether sharding is enabled by examining the relevant
+// environment variable values. If the variables are present,
+// but inconsistent (i.e., shard_index >= total_shards), prints
+// an error and exits. If in_subprocess_for_death_test, sharding is
+// disabled because it must only be applied to the original test
+// process. Otherwise, we could filter out death tests we intended to execute.
+bool ShouldShard(const char* total_shards_env,
+                 const char* shard_index_env,
+                 bool in_subprocess_for_death_test) {
+  if (in_subprocess_for_death_test) {
+    return false;
+  }
+
+  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
+  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);
+
+  if (total_shards == -1 && shard_index == -1) {
+    return false;
+  } else if (total_shards == -1 && shard_index != -1) {
+    const Message msg = Message()
+      << "Invalid environment variables: you have "
+      << kTestShardIndex << " = " << shard_index
+      << ", but have left " << kTestTotalShards << " unset.\n";
+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
+    fflush(stdout);
+    exit(EXIT_FAILURE);
+  } else if (total_shards != -1 && shard_index == -1) {
+    const Message msg = Message()
+      << "Invalid environment variables: you have "
+      << kTestTotalShards << " = " << total_shards
+      << ", but have left " << kTestShardIndex << " unset.\n";
+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
+    fflush(stdout);
+    exit(EXIT_FAILURE);
+  } else if (shard_index < 0 || shard_index >= total_shards) {
+    const Message msg = Message()
+      << "Invalid environment variables: we require 0 <= "
+      << kTestShardIndex << " < " << kTestTotalShards
+      << ", but you have " << kTestShardIndex << "=" << shard_index
+      << ", " << kTestTotalShards << "=" << total_shards << ".\n";
+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
+    fflush(stdout);
+    exit(EXIT_FAILURE);
+  }
+
+  return total_shards > 1;
+}
+
+// Parses the environment variable var as an Int32. If it is unset,
+// returns default_val. If it is not an Int32, prints an error
+// and aborts.
+Int32 Int32FromEnvOrDie(const char* var, Int32 default_val) {
+  const char* str_val = posix::GetEnv(var);
+  if (str_val == NULL) {
+    return default_val;
+  }
+
+  Int32 result;
+  if (!ParseInt32(Message() << "The value of environment variable " << var,
+                  str_val, &result)) {
+    exit(EXIT_FAILURE);
+  }
+  return result;
+}
+
+// Given the total number of shards, the shard index, and the test id,
+// returns true iff the test should be run on this shard. The test id is
+// some arbitrary but unique non-negative integer assigned to each test
+// method. Assumes that 0 <= shard_index < total_shards.
+bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
+  return (test_id % total_shards) == shard_index;
+}
+
+// Compares the name of each test with the user-specified filter to
+// decide whether the test should be run, then records the result in
+// each TestCase and TestInfo object.
+// If shard_tests == true, further filters tests based on sharding
+// variables in the environment - see
+// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide.
+// Returns the number of tests that should run.
+int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+  const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?
+      Int32FromEnvOrDie(kTestTotalShards, -1) : -1;
+  const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?
+      Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+
+  // num_runnable_tests are the number of tests that will
+  // run across all shards (i.e., match filter and are not disabled).
+  // num_selected_tests are the number of tests to be run on
+  // this shard.
+  int num_runnable_tests = 0;
+  int num_selected_tests = 0;
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    TestCase* const test_case = test_cases_[i];
+    const std::string &test_case_name = test_case->name();
+    test_case->set_should_run(false);
+
+    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
+      TestInfo* const test_info = test_case->test_info_list()[j];
+      const std::string test_name(test_info->name());
+      // A test is disabled if test case name or test name matches
+      // kDisableTestFilter.
+      const bool is_disabled =
+          internal::UnitTestOptions::MatchesFilter(test_case_name,
+                                                   kDisableTestFilter) ||
+          internal::UnitTestOptions::MatchesFilter(test_name,
+                                                   kDisableTestFilter);
+      test_info->is_disabled_ = is_disabled;
+
+      const bool matches_filter =
+          internal::UnitTestOptions::FilterMatchesTest(test_case_name,
+                                                       test_name);
+      test_info->matches_filter_ = matches_filter;
+
+      const bool is_runnable =
+          (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) &&
+          matches_filter;
+
+      const bool is_selected = is_runnable &&
+          (shard_tests == IGNORE_SHARDING_PROTOCOL ||
+           ShouldRunTestOnShard(total_shards, shard_index,
+                                num_runnable_tests));
+
+      num_runnable_tests += is_runnable;
+      num_selected_tests += is_selected;
+
+      test_info->should_run_ = is_selected;
+      test_case->set_should_run(test_case->should_run() || is_selected);
+    }
+  }
+  return num_selected_tests;
+}
+
+// Prints the given C-string on a single line by replacing all '\n'
+// characters with string "\\n".  If the output takes more than
+// max_length characters, only prints the first max_length characters
+// and "...".
+static void PrintOnOneLine(const char* str, int max_length) {
+  if (str != NULL) {
+    for (int i = 0; *str != '\0'; ++str) {
+      if (i >= max_length) {
+        printf("...");
+        break;
+      }
+      if (*str == '\n') {
+        printf("\\n");
+        i += 2;
+      } else {
+        printf("%c", *str);
+        ++i;
+      }
+    }
+  }
+}
+
+// Prints the names of the tests matching the user-specified filter flag.
+void UnitTestImpl::ListTestsMatchingFilter() {
+  // Print at most this many characters for each type/value parameter.
+  const int kMaxParamLength = 250;
+
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    const TestCase* const test_case = test_cases_[i];
+    bool printed_test_case_name = false;
+
+    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
+      const TestInfo* const test_info =
+          test_case->test_info_list()[j];
+      if (test_info->matches_filter_) {
+        if (!printed_test_case_name) {
+          printed_test_case_name = true;
+          printf("%s.", test_case->name());
+          if (test_case->type_param() != NULL) {
+            printf("  # %s = ", kTypeParamLabel);
+            // We print the type parameter on a single line to make
+            // the output easy to parse by a program.
+            PrintOnOneLine(test_case->type_param(), kMaxParamLength);
+          }
+          printf("\n");
+        }
+        printf("  %s", test_info->name());
+        if (test_info->value_param() != NULL) {
+          printf("  # %s = ", kValueParamLabel);
+          // We print the value parameter on a single line to make the
+          // output easy to parse by a program.
+          PrintOnOneLine(test_info->value_param(), kMaxParamLength);
+        }
+        printf("\n");
+      }
+    }
+  }
+  fflush(stdout);
+}
+
+// Sets the OS stack trace getter.
+//
+// Does nothing if the input and the current OS stack trace getter are
+// the same; otherwise, deletes the old getter and makes the input the
+// current getter.
+void UnitTestImpl::set_os_stack_trace_getter(
+    OsStackTraceGetterInterface* getter) {
+  if (os_stack_trace_getter_ != getter) {
+    delete os_stack_trace_getter_;
+    os_stack_trace_getter_ = getter;
+  }
+}
+
+// Returns the current OS stack trace getter if it is not NULL;
+// otherwise, creates an OsStackTraceGetter, makes it the current
+// getter, and returns it.
+OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
+  if (os_stack_trace_getter_ == NULL) {
+#ifdef GTEST_OS_STACK_TRACE_GETTER_
+    os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
+#else
+    os_stack_trace_getter_ = new OsStackTraceGetter;
+#endif  // GTEST_OS_STACK_TRACE_GETTER_
+  }
+
+  return os_stack_trace_getter_;
+}
+
+// Returns the TestResult for the test that's currently running, or
+// the TestResult for the ad hoc test if no test is running.
+TestResult* UnitTestImpl::current_test_result() {
+  return current_test_info_ ?
+      &(current_test_info_->result_) : &ad_hoc_test_result_;
+}
+
+// Shuffles all test cases, and the tests within each test case,
+// making sure that death tests are still run first.
+void UnitTestImpl::ShuffleTests() {
+  // Shuffles the death test cases.
+  ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
+
+  // Shuffles the non-death test cases.
+  ShuffleRange(random(), last_death_test_case_ + 1,
+               static_cast<int>(test_cases_.size()), &test_case_indices_);
+
+  // Shuffles the tests inside each test case.
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    test_cases_[i]->ShuffleTests(random());
+  }
+}
+
+// Restores the test cases and tests to their order before the first shuffle.
+void UnitTestImpl::UnshuffleTests() {
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    // Unshuffles the tests in each test case.
+    test_cases_[i]->UnshuffleTests();
+    // Resets the index of each test case.
+    test_case_indices_[i] = static_cast<int>(i);
+  }
+}
+
+// Returns the current OS stack trace as an std::string.
+//
+// The maximum number of stack frames to be included is specified by
+// the gtest_stack_trace_depth flag.  The skip_count parameter
+// specifies the number of top frames to be skipped, which doesn't
+// count against the number of frames to be included.
+//
+// For example, if Foo() calls Bar(), which in turn calls
+// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
+// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
+std::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,
+                                            int skip_count) {
+  // We pass skip_count + 1 to skip this wrapper function in addition
+  // to what the user really wants to skip.
+  return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);
+}
+
+// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to
+// suppress unreachable code warnings.
+namespace {
+class ClassUniqueToAlwaysTrue {};
+}
+
+bool IsTrue(bool condition) { return condition; }
+
+bool AlwaysTrue() {
+#if GTEST_HAS_EXCEPTIONS
+  // This condition is always false so AlwaysTrue() never actually throws,
+  // but it makes the compiler think that it may throw.
+  if (IsTrue(false))
+    throw ClassUniqueToAlwaysTrue();
+#endif  // GTEST_HAS_EXCEPTIONS
+  return true;
+}
+
+// If *pstr starts with the given prefix, modifies *pstr to be right
+// past the prefix and returns true; otherwise leaves *pstr unchanged
+// and returns false.  None of pstr, *pstr, and prefix can be NULL.
+bool SkipPrefix(const char* prefix, const char** pstr) {
+  const size_t prefix_len = strlen(prefix);
+  if (strncmp(*pstr, prefix, prefix_len) == 0) {
+    *pstr += prefix_len;
+    return true;
+  }
+  return false;
+}
+
+// Parses a string as a command line flag.  The string should have
+// the format "--flag=value".  When def_optional is true, the "=value"
+// part can be omitted.
+//
+// Returns the value of the flag, or NULL if the parsing failed.
+const char* ParseFlagValue(const char* str,
+                           const char* flag,
+                           bool def_optional) {
+  // str and flag must not be NULL.
+  if (str == NULL || flag == NULL) return NULL;
+
+  // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
+  const std::string flag_str = std::string("--") + GTEST_FLAG_PREFIX_ + flag;
+  const size_t flag_len = flag_str.length();
+  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
+
+  // Skips the flag name.
+  const char* flag_end = str + flag_len;
+
+  // When def_optional is true, it's OK to not have a "=value" part.
+  if (def_optional && (flag_end[0] == '\0')) {
+    return flag_end;
+  }
+
+  // If def_optional is true and there are more characters after the
+  // flag name, or if def_optional is false, there must be a '=' after
+  // the flag name.
+  if (flag_end[0] != '=') return NULL;
+
+  // Returns the string after "=".
+  return flag_end + 1;
+}
+
+// Parses a string for a bool flag, in the form of either
+// "--flag=value" or "--flag".
+//
+// In the former case, the value is taken as true as long as it does
+// not start with '0', 'f', or 'F'.
+//
+// In the latter case, the value is taken as true.
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+bool ParseBoolFlag(const char* str, const char* flag, bool* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseFlagValue(str, flag, true);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Converts the string value to a bool.
+  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
+  return true;
+}
+
+// Parses a string for an Int32 flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseFlagValue(str, flag, false);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Sets *value to the value of the flag.
+  return ParseInt32(Message() << "The value of flag --" << flag,
+                    value_str, value);
+}
+
+// Parses a string for a string flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+bool ParseStringFlag(const char* str, const char* flag, std::string* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseFlagValue(str, flag, false);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Sets *value to the value of the flag.
+  *value = value_str;
+  return true;
+}
+
+// Determines whether a string has a prefix that Google Test uses for its
+// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.
+// If Google Test detects that a command line flag has its prefix but is not
+// recognized, it will print its help message. Flags starting with
+// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
+// internal flags and do not trigger the help message.
+static bool HasGoogleTestFlagPrefix(const char* str) {
+  return (SkipPrefix("--", &str) ||
+          SkipPrefix("-", &str) ||
+          SkipPrefix("/", &str)) &&
+         !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
+         (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
+          SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));
+}
+
+// Prints a string containing code-encoded text.  The following escape
+// sequences can be used in the string to control the text color:
+//
+//   @@    prints a single '@' character.
+//   @R    changes the color to red.
+//   @G    changes the color to green.
+//   @Y    changes the color to yellow.
+//   @D    changes to the default terminal text color.
+//
+// TODO(wan@google.com): Write tests for this once we add stdout
+// capturing to Google Test.
+static void PrintColorEncoded(const char* str) {
+  GTestColor color = COLOR_DEFAULT;  // The current color.
+
+  // Conceptually, we split the string into segments divided by escape
+  // sequences.  Then we print one segment at a time.  At the end of
+  // each iteration, the str pointer advances to the beginning of the
+  // next segment.
+  for (;;) {
+    const char* p = strchr(str, '@');
+    if (p == NULL) {
+      ColoredPrintf(color, "%s", str);
+      return;
+    }
+
+    ColoredPrintf(color, "%s", std::string(str, p).c_str());
+
+    const char ch = p[1];
+    str = p + 2;
+    if (ch == '@') {
+      ColoredPrintf(color, "@");
+    } else if (ch == 'D') {
+      color = COLOR_DEFAULT;
+    } else if (ch == 'R') {
+      color = COLOR_RED;
+    } else if (ch == 'G') {
+      color = COLOR_GREEN;
+    } else if (ch == 'Y') {
+      color = COLOR_YELLOW;
+    } else {
+      --str;
+    }
+  }
+}
+
+static const char kColorEncodedHelpMessage[] =
+"This program contains tests written using " GTEST_NAME_ ". You can use the\n"
+"following command line flags to control its behavior:\n"
+"\n"
+"Test Selection:\n"
+"  @G--" GTEST_FLAG_PREFIX_ "list_tests@D\n"
+"      List the names of all tests instead of running them. The name of\n"
+"      TEST(Foo, Bar) is \"Foo.Bar\".\n"
+"  @G--" GTEST_FLAG_PREFIX_ "filter=@YPOSTIVE_PATTERNS"
+    "[@G-@YNEGATIVE_PATTERNS]@D\n"
+"      Run only the tests whose name matches one of the positive patterns but\n"
+"      none of the negative patterns. '?' matches any single character; '*'\n"
+"      matches any substring; ':' separates two patterns.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "also_run_disabled_tests@D\n"
+"      Run all disabled tests too.\n"
+"\n"
+"Test Execution:\n"
+"  @G--" GTEST_FLAG_PREFIX_ "repeat=@Y[COUNT]@D\n"
+"      Run the tests repeatedly; use a negative count to repeat forever.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "shuffle@D\n"
+"      Randomize tests' orders on every iteration.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "random_seed=@Y[NUMBER]@D\n"
+"      Random number seed to use for shuffling test orders (between 1 and\n"
+"      99999, or 0 to use a seed based on the current time).\n"
+"\n"
+"Test Output:\n"
+"  @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n"
+"      Enable/disable colored output. The default is @Gauto@D.\n"
+"  -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n"
+"      Don't print the elapsed time of each test.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G"
+    GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n"
+"      Generate an XML report in the given directory or with the given file\n"
+"      name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n"
+#if GTEST_CAN_STREAM_RESULTS_
+"  @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n"
+"      Stream test results to the given server.\n"
+#endif  // GTEST_CAN_STREAM_RESULTS_
+"\n"
+"Assertion Behavior:\n"
+#if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
+"  @G--" GTEST_FLAG_PREFIX_ "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n"
+"      Set the default death test style.\n"
+#endif  // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
+"  @G--" GTEST_FLAG_PREFIX_ "break_on_failure@D\n"
+"      Turn assertion failures into debugger break-points.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n"
+"      Turn assertion failures into C++ exceptions.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "catch_exceptions=0@D\n"
+"      Do not report exceptions as test failures. Instead, allow them\n"
+"      to crash the program or throw a pop-up (on Windows).\n"
+"\n"
+"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set "
+    "the corresponding\n"
+"environment variable of a flag (all letters in upper-case). For example, to\n"
+"disable colored text output, you can either specify @G--" GTEST_FLAG_PREFIX_
+    "color=no@D or set\n"
+"the @G" GTEST_FLAG_PREFIX_UPPER_ "COLOR@D environment variable to @Gno@D.\n"
+"\n"
+"For more information, please read the " GTEST_NAME_ " documentation at\n"
+"@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_ "\n"
+"(not one in your own code or tests), please report it to\n"
+"@G<" GTEST_DEV_EMAIL_ ">@D.\n";
+
+bool ParseGoogleTestFlag(const char* const arg) {
+  return ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
+                       &GTEST_FLAG(also_run_disabled_tests)) ||
+      ParseBoolFlag(arg, kBreakOnFailureFlag,
+                    &GTEST_FLAG(break_on_failure)) ||
+      ParseBoolFlag(arg, kCatchExceptionsFlag,
+                    &GTEST_FLAG(catch_exceptions)) ||
+      ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
+      ParseStringFlag(arg, kDeathTestStyleFlag,
+                      &GTEST_FLAG(death_test_style)) ||
+      ParseBoolFlag(arg, kDeathTestUseFork,
+                    &GTEST_FLAG(death_test_use_fork)) ||
+      ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
+      ParseStringFlag(arg, kInternalRunDeathTestFlag,
+                      &GTEST_FLAG(internal_run_death_test)) ||
+      ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
+      ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
+      ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
+      ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
+      ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
+      ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
+      ParseInt32Flag(arg, kStackTraceDepthFlag,
+                     &GTEST_FLAG(stack_trace_depth)) ||
+      ParseStringFlag(arg, kStreamResultToFlag,
+                      &GTEST_FLAG(stream_result_to)) ||
+      ParseBoolFlag(arg, kThrowOnFailureFlag,
+                    &GTEST_FLAG(throw_on_failure));
+}
+
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+void LoadFlagsFromFile(const std::string& path) {
+  FILE* flagfile = posix::FOpen(path.c_str(), "r");
+  if (!flagfile) {
+    fprintf(stderr,
+            "Unable to open file \"%s\"\n",
+            GTEST_FLAG(flagfile).c_str());
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+  std::string contents(ReadEntireFile(flagfile));
+  posix::FClose(flagfile);
+  std::vector<std::string> lines;
+  SplitString(contents, '\n', &lines);
+  for (size_t i = 0; i < lines.size(); ++i) {
+    if (lines[i].empty())
+      continue;
+    if (!ParseGoogleTestFlag(lines[i].c_str()))
+      g_help_flag = true;
+  }
+}
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+
+// Parses the command line for Google Test flags, without initializing
+// other parts of Google Test.  The type parameter CharType can be
+// instantiated to either char or wchar_t.
+template <typename CharType>
+void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
+  for (int i = 1; i < *argc; i++) {
+    const std::string arg_string = StreamableToString(argv[i]);
+    const char* const arg = arg_string.c_str();
+
+    using internal::ParseBoolFlag;
+    using internal::ParseInt32Flag;
+    using internal::ParseStringFlag;
+
+    bool remove_flag = false;
+    if (ParseGoogleTestFlag(arg)) {
+      remove_flag = true;
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+    } else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {
+      LoadFlagsFromFile(GTEST_FLAG(flagfile));
+      remove_flag = true;
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+    } else if (arg_string == "--help" || arg_string == "-h" ||
+               arg_string == "-?" || arg_string == "/?" ||
+               HasGoogleTestFlagPrefix(arg)) {
+      // Both help flag and unrecognized Google Test flags (excluding
+      // internal ones) trigger help display.
+      g_help_flag = true;
+    }
+
+    if (remove_flag) {
+      // Shift the remainder of the argv list left by one.  Note
+      // that argv has (*argc + 1) elements, the last one always being
+      // NULL.  The following loop moves the trailing NULL element as
+      // well.
+      for (int j = i; j != *argc; j++) {
+        argv[j] = argv[j + 1];
+      }
+
+      // Decrements the argument count.
+      (*argc)--;
+
+      // We also need to decrement the iterator as we just removed
+      // an element.
+      i--;
+    }
+  }
+
+  if (g_help_flag) {
+    // We print the help here instead of in RUN_ALL_TESTS(), as the
+    // latter may not be called at all if the user is using Google
+    // Test with another testing framework.
+    PrintColorEncoded(kColorEncodedHelpMessage);
+  }
+}
+
+// Parses the command line for Google Test flags, without initializing
+// other parts of Google Test.
+void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
+  ParseGoogleTestFlagsOnlyImpl(argc, argv);
+}
+void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
+  ParseGoogleTestFlagsOnlyImpl(argc, argv);
+}
+
+// The internal implementation of InitGoogleTest().
+//
+// The type parameter CharType can be instantiated to either char or
+// wchar_t.
+template <typename CharType>
+void InitGoogleTestImpl(int* argc, CharType** argv) {
+  // We don't want to run the initialization code twice.
+  if (GTestIsInitialized()) return;
+
+  if (*argc <= 0) return;
+
+  g_argvs.clear();
+  for (int i = 0; i != *argc; i++) {
+    g_argvs.push_back(StreamableToString(argv[i]));
+  }
+
+  ParseGoogleTestFlagsOnly(argc, argv);
+  GetUnitTestImpl()->PostFlagParsingInit();
+}
+
+}  // namespace internal
+
+// Initializes Google Test.  This must be called before calling
+// RUN_ALL_TESTS().  In particular, it parses a command line for the
+// flags that Google Test recognizes.  Whenever a Google Test flag is
+// seen, it is removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Test flag variables are
+// updated.
+//
+// Calling the function for the second time has no user-visible effect.
+void InitGoogleTest(int* argc, char** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  internal::InitGoogleTestImpl(argc, argv);
+#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+}
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+void InitGoogleTest(int* argc, wchar_t** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  internal::InitGoogleTestImpl(argc, argv);
+#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+}
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/gtest/src/gtest_main.cc b/third_party/ntcore_2018/gmock/gtest/src/gtest_main.cc
new file mode 100644
index 0000000..f302822
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/gtest/src/gtest_main.cc
@@ -0,0 +1,38 @@
+// Copyright 2006, 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 <stdio.h>
+
+#include "gtest/gtest.h"
+
+GTEST_API_ int main(int argc, char **argv) {
+  printf("Running main() from gtest_main.cc\n");
+  testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-actions.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-actions.h
new file mode 100644
index 0000000..b3f654a
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-actions.h
@@ -0,0 +1,1205 @@
+// 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 <errno.h>
+#endif
+
+#include <algorithm>
+#include <string>
+
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+
+#if GTEST_HAS_STD_TYPE_TRAITS_  // Defined by gtest-port.h via gmock-port.h.
+#include <type_traits>
+#endif
+
+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 <typename F1, typename F2>
+class ActionAdaptor;
+
+// BuiltInDefaultValueGetter<T, true>::Get() returns a
+// default-constructed T value.  BuiltInDefaultValueGetter<T,
+// false>::Get() crashes with an error.
+//
+// This primary template is used when kDefaultConstructible is true.
+template <typename T, bool kDefaultConstructible>
+struct BuiltInDefaultValueGetter {
+  static T Get() { return T(); }
+};
+template <typename T>
+struct BuiltInDefaultValueGetter<T, false> {
+  static T Get() {
+    Assert(false, __FILE__, __LINE__,
+           "Default action undefined for the function return type.");
+    return internal::Invalid<T>();
+    // The above statement will never be reached, but is required in
+    // order for this function to compile.
+  }
+};
+
+// BuiltInDefaultValue<T>::Get() returns the "built-in" default value
+// for type T, which is NULL when T is a raw pointer type, 0 when T is
+// a numeric type, false when T is bool, or "" when T is string or
+// std::string.  In addition, in C++11 and above, it turns a
+// default-constructed T value if T is default constructible.  For any
+// other type T, the built-in default T value is undefined, and the
+// function will abort the process.
+template <typename T>
+class BuiltInDefaultValue {
+ public:
+#if GTEST_HAS_STD_TYPE_TRAITS_
+  // This function returns true iff type T has a built-in default value.
+  static bool Exists() {
+    return ::std::is_default_constructible<T>::value;
+  }
+
+  static T Get() {
+    return BuiltInDefaultValueGetter<
+        T, ::std::is_default_constructible<T>::value>::Get();
+  }
+
+#else  // GTEST_HAS_STD_TYPE_TRAITS_
+  // This function returns true iff type T has a built-in default value.
+  static bool Exists() {
+    return false;
+  }
+
+  static T Get() {
+    return BuiltInDefaultValueGetter<T, false>::Get();
+  }
+
+#endif  // GTEST_HAS_STD_TYPE_TRAITS_
+};
+
+// This partial specialization says that we use the same built-in
+// default value for T and const T.
+template <typename T>
+class BuiltInDefaultValue<const T> {
+ public:
+  static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
+  static T Get() { return BuiltInDefaultValue<T>::Get(); }
+};
+
+// This partial specialization defines the default values for pointer
+// types.
+template <typename T>
+class BuiltInDefaultValue<T*> {
+ 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<type> { \
+   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<T> 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<T>::Set(foo);
+template <typename T>
+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 producer_;
+    producer_ = new FixedValueProducer(x);
+  }
+
+  // Provides a factory function to be called to generate the default value.
+  // This method can be used even if T is only move-constructible, but it is not
+  // limited to that case.
+  typedef T (*FactoryFunction)();
+  static void SetFactory(FactoryFunction factory) {
+    delete producer_;
+    producer_ = new FactoryValueProducer(factory);
+  }
+
+  // Unsets the default value for type T.
+  static void Clear() {
+    delete producer_;
+    producer_ = NULL;
+  }
+
+  // Returns true iff the user has set the default value for type T.
+  static bool IsSet() { return producer_ != 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<T>::Exists();
+  }
+
+  // Returns the default value for type T if the user has set one;
+  // otherwise returns the built-in default value. Requires that Exists()
+  // is true, which ensures that the return value is well-defined.
+  static T Get() {
+    return producer_ == NULL ?
+        internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
+  }
+
+ private:
+  class ValueProducer {
+   public:
+    virtual ~ValueProducer() {}
+    virtual T Produce() = 0;
+  };
+
+  class FixedValueProducer : public ValueProducer {
+   public:
+    explicit FixedValueProducer(T value) : value_(value) {}
+    virtual T Produce() { return value_; }
+
+   private:
+    const T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
+  };
+
+  class FactoryValueProducer : public ValueProducer {
+   public:
+    explicit FactoryValueProducer(FactoryFunction factory)
+        : factory_(factory) {}
+    virtual T Produce() { return factory_(); }
+
+   private:
+    const FactoryFunction factory_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
+  };
+
+  static ValueProducer* producer_;
+};
+
+// This partial specialization allows a user to set default values for
+// reference types.
+template <typename T>
+class DefaultValue<T&> {
+ 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<T&>::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<T&>::Get() : *address_;
+  }
+
+ private:
+  static T* address_;
+};
+
+// This specialization allows DefaultValue<void>::Get() to
+// compile.
+template <>
+class DefaultValue<void> {
+ public:
+  static bool Exists() { return true; }
+  static void Get() {}
+};
+
+// Points to the user-set default value for type T.
+template <typename T>
+typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = NULL;
+
+// Points to the user-set default value for type T&.
+template <typename T>
+T* DefaultValue<T&>::address_ = NULL;
+
+// Implement this interface to define an action for function type F.
+template <typename F>
+class ActionInterface {
+ public:
+  typedef typename internal::Function<F>::Result Result;
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  ActionInterface() {}
+  virtual ~ActionInterface() {}
+
+  // Performs the action.  This method is not const, as in general an
+  // action can have side effects and be stateful.  For example, a
+  // get-the-next-element-from-the-collection action will need to
+  // remember the current element.
+  virtual Result Perform(const ArgumentTuple& args) = 0;
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
+};
+
+// An Action<F> is a copyable and IMMUTABLE (except by assignment)
+// object that represents an action to be taken when a mock function
+// of type F is called.  The implementation of Action<T> is just a
+// linked_ptr to const ActionInterface<T>, so copying is fairly cheap.
+// Don't inherit from Action!
+//
+// You can view an object implementing ActionInterface<F> as a
+// concrete action (including its current state), and an Action<F>
+// object as a handle to it.
+template <typename F>
+class Action {
+ public:
+  typedef typename internal::Function<F>::Result Result;
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  // Constructs a null Action.  Needed for storing Action objects in
+  // STL containers.
+  Action() : impl_(NULL) {}
+
+  // Constructs an Action from its implementation.  A NULL impl is
+  // used to represent the "do-default" action.
+  explicit Action(ActionInterface<F>* impl) : impl_(impl) {}
+
+  // Copy constructor.
+  Action(const Action& action) : impl_(action.impl_) {}
+
+  // This constructor allows us to turn an Action<Func> object into an
+  // Action<F>, as long as F's arguments can be implicitly converted
+  // to Func's and Func's return type can be implicitly converted to
+  // F's.
+  template <typename Func>
+  explicit Action(const Action<Func>& action);
+
+  // Returns true iff this is the DoDefault() action.
+  bool IsDoDefault() const { return impl_.get() == NULL; }
+
+  // Performs the action.  Note that this method is const even though
+  // the corresponding method in ActionInterface is not.  The reason
+  // is that a const Action<F> means that it cannot be re-bound to
+  // another concrete action, not that the concrete action it binds to
+  // cannot change state.  (Think of the difference between a const
+  // pointer and a pointer to const.)
+  Result Perform(const ArgumentTuple& args) const {
+    internal::Assert(
+        !IsDoDefault(), __FILE__, __LINE__,
+        "You are using DoDefault() inside a composite action like "
+        "DoAll() or WithArgs().  This is not supported for technical "
+        "reasons.  Please instead spell out the default action, or "
+        "assign the default action to an Action variable and use "
+        "the variable in various places.");
+    return impl_->Perform(args);
+  }
+
+ private:
+  template <typename F1, typename F2>
+  friend class internal::ActionAdaptor;
+
+  internal::linked_ptr<ActionInterface<F> > impl_;
+};
+
+// The PolymorphicAction class template makes it easy to implement a
+// polymorphic action (i.e. an action that can be used in mock
+// functions of than one type, e.g. Return()).
+//
+// To define a polymorphic action, a user first provides a COPYABLE
+// implementation class that has a Perform() method template:
+//
+//   class FooAction {
+//    public:
+//     template <typename Result, typename ArgumentTuple>
+//     Result Perform(const ArgumentTuple& args) const {
+//       // Processes the arguments and returns a result, using
+//       // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
+//     }
+//     ...
+//   };
+//
+// Then the user creates the polymorphic action using
+// MakePolymorphicAction(object) where object has type FooAction.  See
+// the definition of Return(void) and SetArgumentPointee<N>(value) for
+// complete examples.
+template <typename Impl>
+class PolymorphicAction {
+ public:
+  explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
+
+  template <typename F>
+  operator Action<F>() const {
+    return Action<F>(new MonomorphicImpl<F>(impl_));
+  }
+
+ private:
+  template <typename F>
+  class MonomorphicImpl : public ActionInterface<F> {
+   public:
+    typedef typename internal::Function<F>::Result Result;
+    typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      return impl_.template Perform<Result>(args);
+    }
+
+   private:
+    Impl impl_;
+
+    GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
+  };
+
+  Impl impl_;
+
+  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
+};
+
+// Creates an Action from its implementation and returns it.  The
+// created Action object owns the implementation.
+template <typename F>
+Action<F> MakeAction(ActionInterface<F>* impl) {
+  return Action<F>(impl);
+}
+
+// Creates a polymorphic action from its implementation.  This is
+// easier to use than the PolymorphicAction<Impl> constructor as it
+// doesn't require you to explicitly write the template argument, e.g.
+//
+//   MakePolymorphicAction(foo);
+// vs
+//   PolymorphicAction<TypeOfFoo>(foo);
+template <typename Impl>
+inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {
+  return PolymorphicAction<Impl>(impl);
+}
+
+namespace internal {
+
+// Allows an Action<F2> object to pose as an Action<F1>, as long as F2
+// and F1 are compatible.
+template <typename F1, typename F2>
+class ActionAdaptor : public ActionInterface<F1> {
+ public:
+  typedef typename internal::Function<F1>::Result Result;
+  typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
+
+  explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
+
+  virtual Result Perform(const ArgumentTuple& args) {
+    return impl_->Perform(args);
+  }
+
+ private:
+  const internal::linked_ptr<ActionInterface<F2> > impl_;
+
+  GTEST_DISALLOW_ASSIGN_(ActionAdaptor);
+};
+
+// Helper struct to specialize ReturnAction to execute a move instead of a copy
+// on return. Useful for move-only types, but could be used on any type.
+template <typename T>
+struct ByMoveWrapper {
+  explicit ByMoveWrapper(T value) : payload(internal::move(value)) {}
+  T payload;
+};
+
+// Implements the polymorphic Return(x) action, which can be used in
+// any function that returns the type of x, regardless of the argument
+// types.
+//
+// Note: The value passed into Return must be converted into
+// Function<F>::Result when this action is cast to Action<F> rather than
+// when that action is performed. This is important in scenarios like
+//
+// MOCK_METHOD1(Method, T(U));
+// ...
+// {
+//   Foo foo;
+//   X x(&foo);
+//   EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));
+// }
+//
+// In the example above the variable x holds reference to foo which leaves
+// scope and gets destroyed.  If copying X just copies a reference to foo,
+// that copy will be left with a hanging reference.  If conversion to T
+// makes a copy of foo, the above code is safe. To support that scenario, we
+// need to make sure that the type conversion happens inside the EXPECT_CALL
+// statement, and conversion of the result of Return to Action<T(U)> is a
+// good place for that.
+//
+template <typename R>
+class ReturnAction {
+ public:
+  // Constructs a ReturnAction object from the value to be returned.
+  // 'value' is passed by value instead of by const reference in order
+  // to allow Return("string literal") to compile.
+  explicit ReturnAction(R value) : value_(new R(internal::move(value))) {}
+
+  // This template type conversion operator allows Return(x) to be
+  // used in ANY function that returns x's type.
+  template <typename F>
+  operator Action<F>() const {
+    // Assert statement belongs here because this is the best place to verify
+    // conditions on F. It produces the clearest error messages
+    // in most compilers.
+    // Impl really belongs in this scope as a local class but can't
+    // because MSVC produces duplicate symbols in different translation units
+    // in this case. Until MS fixes that bug we put Impl into the class scope
+    // and put the typedef both here (for use in assert statement) and
+    // in the Impl class. But both definitions must be the same.
+    typedef typename Function<F>::Result Result;
+    GTEST_COMPILE_ASSERT_(
+        !is_reference<Result>::value,
+        use_ReturnRef_instead_of_Return_to_return_a_reference);
+    return Action<F>(new Impl<R, F>(value_));
+  }
+
+ private:
+  // Implements the Return(x) action for a particular function type F.
+  template <typename R_, typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    // The implicit cast is necessary when Result has more than one
+    // single-argument constructor (e.g. Result is std::vector<int>) and R
+    // has a type conversion operator template.  In that case, value_(value)
+    // won't compile as the compiler doesn't known which constructor of
+    // Result to call.  ImplicitCast_ forces the compiler to convert R to
+    // Result without considering explicit constructors, thus resolving the
+    // ambiguity. value_ is then initialized using its copy constructor.
+    explicit Impl(const linked_ptr<R>& value)
+        : value_before_cast_(*value),
+          value_(ImplicitCast_<Result>(value_before_cast_)) {}
+
+    virtual Result Perform(const ArgumentTuple&) { return value_; }
+
+   private:
+    GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
+                          Result_cannot_be_a_reference_type);
+    // We save the value before casting just in case it is being cast to a
+    // wrapper type.
+    R value_before_cast_;
+    Result value_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
+  };
+
+  // Partially specialize for ByMoveWrapper. This version of ReturnAction will
+  // move its contents instead.
+  template <typename R_, typename F>
+  class Impl<ByMoveWrapper<R_>, F> : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const linked_ptr<R>& wrapper)
+        : performed_(false), wrapper_(wrapper) {}
+
+    virtual Result Perform(const ArgumentTuple&) {
+      GTEST_CHECK_(!performed_)
+          << "A ByMove() action should only be performed once.";
+      performed_ = true;
+      return internal::move(wrapper_->payload);
+    }
+
+   private:
+    bool performed_;
+    const linked_ptr<R> wrapper_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const linked_ptr<R> value_;
+
+  GTEST_DISALLOW_ASSIGN_(ReturnAction);
+};
+
+// Implements the ReturnNull() action.
+class ReturnNullAction {
+ public:
+  // Allows ReturnNull() to be used in any pointer-returning function. In C++11
+  // this is enforced by returning nullptr, and in non-C++11 by asserting a
+  // pointer type on compile time.
+  template <typename Result, typename ArgumentTuple>
+  static Result Perform(const ArgumentTuple&) {
+#if GTEST_LANG_CXX11
+    return nullptr;
+#else
+    GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,
+                          ReturnNull_can_be_used_to_return_a_pointer_only);
+    return NULL;
+#endif  // GTEST_LANG_CXX11
+  }
+};
+
+// Implements the Return() action.
+class ReturnVoidAction {
+ public:
+  // Allows Return() to be used in any void-returning function.
+  template <typename Result, typename ArgumentTuple>
+  static void Perform(const ArgumentTuple&) {
+    CompileAssertTypesEqual<void, Result>();
+  }
+};
+
+// Implements the polymorphic ReturnRef(x) action, which can be used
+// in any function that returns a reference to the type of x,
+// regardless of the argument types.
+template <typename T>
+class ReturnRefAction {
+ public:
+  // Constructs a ReturnRefAction object from the reference to be returned.
+  explicit ReturnRefAction(T& ref) : ref_(ref) {}  // NOLINT
+
+  // This template type conversion operator allows ReturnRef(x) to be
+  // used in ANY function that returns a reference to x's type.
+  template <typename F>
+  operator Action<F>() const {
+    typedef typename Function<F>::Result Result;
+    // Asserts that the function return type is a reference.  This
+    // catches the user error of using ReturnRef(x) when Return(x)
+    // should be used, and generates some helpful error message.
+    GTEST_COMPILE_ASSERT_(internal::is_reference<Result>::value,
+                          use_Return_instead_of_ReturnRef_to_return_a_value);
+    return Action<F>(new Impl<F>(ref_));
+  }
+
+ private:
+  // Implements the ReturnRef(x) action for a particular function type F.
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(T& ref) : ref_(ref) {}  // NOLINT
+
+    virtual Result Perform(const ArgumentTuple&) {
+      return ref_;
+    }
+
+   private:
+    T& ref_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  T& ref_;
+
+  GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
+};
+
+// Implements the polymorphic ReturnRefOfCopy(x) action, which can be
+// used in any function that returns a reference to the type of x,
+// regardless of the argument types.
+template <typename T>
+class ReturnRefOfCopyAction {
+ public:
+  // Constructs a ReturnRefOfCopyAction object from the reference to
+  // be returned.
+  explicit ReturnRefOfCopyAction(const T& value) : value_(value) {}  // NOLINT
+
+  // This template type conversion operator allows ReturnRefOfCopy(x) to be
+  // used in ANY function that returns a reference to x's type.
+  template <typename F>
+  operator Action<F>() const {
+    typedef typename Function<F>::Result Result;
+    // Asserts that the function return type is a reference.  This
+    // catches the user error of using ReturnRefOfCopy(x) when Return(x)
+    // should be used, and generates some helpful error message.
+    GTEST_COMPILE_ASSERT_(
+        internal::is_reference<Result>::value,
+        use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
+    return Action<F>(new Impl<F>(value_));
+  }
+
+ private:
+  // Implements the ReturnRefOfCopy(x) action for a particular function type F.
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const T& value) : value_(value) {}  // NOLINT
+
+    virtual Result Perform(const ArgumentTuple&) {
+      return value_;
+    }
+
+   private:
+    T value_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const T value_;
+
+  GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
+};
+
+// Implements the polymorphic DoDefault() action.
+class DoDefaultAction {
+ public:
+  // This template type conversion operator allows DoDefault() to be
+  // used in any function.
+  template <typename F>
+  operator Action<F>() const { return Action<F>(NULL); }
+};
+
+// Implements the Assign action to set a given pointer referent to a
+// particular value.
+template <typename T1, typename T2>
+class AssignAction {
+ public:
+  AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
+
+  template <typename Result, typename ArgumentTuple>
+  void Perform(const ArgumentTuple& /* args */) const {
+    *ptr_ = value_;
+  }
+
+ private:
+  T1* const ptr_;
+  const T2 value_;
+
+  GTEST_DISALLOW_ASSIGN_(AssignAction);
+};
+
+#if !GTEST_OS_WINDOWS_MOBILE
+
+// Implements the SetErrnoAndReturn action to simulate return from
+// various system calls and libc functions.
+template <typename T>
+class SetErrnoAndReturnAction {
+ public:
+  SetErrnoAndReturnAction(int errno_value, T result)
+      : errno_(errno_value),
+        result_(result) {}
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& /* args */) const {
+    errno = errno_;
+    return result_;
+  }
+
+ private:
+  const int errno_;
+  const T result_;
+
+  GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
+};
+
+#endif  // !GTEST_OS_WINDOWS_MOBILE
+
+// Implements the SetArgumentPointee<N>(x) action for any function
+// whose N-th argument (0-based) is a pointer to x's type.  The
+// template parameter kIsProto is true iff type A is ProtocolMessage,
+// proto2::Message, or a sub-class of those.
+template <size_t N, typename A, bool kIsProto>
+class SetArgumentPointeeAction {
+ public:
+  // Constructs an action that sets the variable pointed to by the
+  // N-th function argument to 'value'.
+  explicit SetArgumentPointeeAction(const A& value) : value_(value) {}
+
+  template <typename Result, typename ArgumentTuple>
+  void Perform(const ArgumentTuple& args) const {
+    CompileAssertTypesEqual<void, Result>();
+    *::testing::get<N>(args) = value_;
+  }
+
+ private:
+  const A value_;
+
+  GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
+};
+
+template <size_t N, typename Proto>
+class SetArgumentPointeeAction<N, Proto, true> {
+ public:
+  // Constructs an action that sets the variable pointed to by the
+  // N-th function argument to 'proto'.  Both ProtocolMessage and
+  // proto2::Message have the CopyFrom() method, so the same
+  // implementation works for both.
+  explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {
+    proto_->CopyFrom(proto);
+  }
+
+  template <typename Result, typename ArgumentTuple>
+  void Perform(const ArgumentTuple& args) const {
+    CompileAssertTypesEqual<void, Result>();
+    ::testing::get<N>(args)->CopyFrom(*proto_);
+  }
+
+ private:
+  const internal::linked_ptr<Proto> proto_;
+
+  GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
+};
+
+// Implements the InvokeWithoutArgs(f) action.  The template argument
+// FunctionImpl is the implementation type of f, which can be either a
+// function pointer or a functor.  InvokeWithoutArgs(f) can be used as an
+// Action<F> as long as f's type is compatible with F (i.e. f can be
+// assigned to a tr1::function<F>).
+template <typename FunctionImpl>
+class InvokeWithoutArgsAction {
+ public:
+  // The c'tor makes a copy of function_impl (either a function
+  // pointer or a functor).
+  explicit InvokeWithoutArgsAction(FunctionImpl function_impl)
+      : function_impl_(function_impl) {}
+
+  // Allows InvokeWithoutArgs(f) to be used as any action whose type is
+  // compatible with f.
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple&) { return function_impl_(); }
+
+ private:
+  FunctionImpl function_impl_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction);
+};
+
+// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
+template <class Class, typename MethodPtr>
+class InvokeMethodWithoutArgsAction {
+ public:
+  InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)
+      : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
+
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple&) const {
+    return (obj_ptr_->*method_ptr_)();
+  }
+
+ private:
+  Class* const obj_ptr_;
+  const MethodPtr method_ptr_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction);
+};
+
+// Implements the IgnoreResult(action) action.
+template <typename A>
+class IgnoreResultAction {
+ public:
+  explicit IgnoreResultAction(const A& action) : action_(action) {}
+
+  template <typename F>
+  operator Action<F>() const {
+    // Assert statement belongs here because this is the best place to verify
+    // conditions on F. It produces the clearest error messages
+    // in most compilers.
+    // Impl really belongs in this scope as a local class but can't
+    // because MSVC produces duplicate symbols in different translation units
+    // in this case. Until MS fixes that bug we put Impl into the class scope
+    // and put the typedef both here (for use in assert statement) and
+    // in the Impl class. But both definitions must be the same.
+    typedef typename internal::Function<F>::Result Result;
+
+    // Asserts at compile time that F returns void.
+    CompileAssertTypesEqual<void, Result>();
+
+    return Action<F>(new Impl<F>(action_));
+  }
+
+ private:
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename internal::Function<F>::Result Result;
+    typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const A& action) : action_(action) {}
+
+    virtual void Perform(const ArgumentTuple& args) {
+      // Performs the action and ignores its result.
+      action_.Perform(args);
+    }
+
+   private:
+    // Type OriginalFunction is the same as F except that its return
+    // type is IgnoredValue.
+    typedef typename internal::Function<F>::MakeResultIgnoredValue
+        OriginalFunction;
+
+    const Action<OriginalFunction> action_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const A action_;
+
+  GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
+};
+
+// A ReferenceWrapper<T> object represents a reference to type T,
+// which can be either const or not.  It can be explicitly converted
+// from, and implicitly converted to, a T&.  Unlike a reference,
+// ReferenceWrapper<T> can be copied and can survive template type
+// inference.  This is used to support by-reference arguments in the
+// InvokeArgument<N>(...) action.  The idea was from "reference
+// wrappers" in tr1, which we don't have in our source tree yet.
+template <typename T>
+class ReferenceWrapper {
+ public:
+  // Constructs a ReferenceWrapper<T> object from a T&.
+  explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {}  // NOLINT
+
+  // Allows a ReferenceWrapper<T> object to be implicitly converted to
+  // a T&.
+  operator T&() const { return *pointer_; }
+ private:
+  T* pointer_;
+};
+
+// Allows the expression ByRef(x) to be printed as a reference to x.
+template <typename T>
+void PrintTo(const ReferenceWrapper<T>& ref, ::std::ostream* os) {
+  T& value = ref;
+  UniversalPrinter<T&>::Print(value, os);
+}
+
+// Does two actions sequentially.  Used for implementing the DoAll(a1,
+// a2, ...) action.
+template <typename Action1, typename Action2>
+class DoBothAction {
+ public:
+  DoBothAction(Action1 action1, Action2 action2)
+      : action1_(action1), action2_(action2) {}
+
+  // This template type conversion operator allows DoAll(a1, ..., a_n)
+  // to be used in ANY function of compatible type.
+  template <typename F>
+  operator Action<F>() const {
+    return Action<F>(new Impl<F>(action1_, action2_));
+  }
+
+ private:
+  // Implements the DoAll(...) action for a particular function type F.
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+    typedef typename Function<F>::MakeResultVoid VoidResult;
+
+    Impl(const Action<VoidResult>& action1, const Action<F>& action2)
+        : action1_(action1), action2_(action2) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      action1_.Perform(args);
+      return action2_.Perform(args);
+    }
+
+   private:
+    const Action<VoidResult> action1_;
+    const Action<F> action2_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  Action1 action1_;
+  Action2 action2_;
+
+  GTEST_DISALLOW_ASSIGN_(DoBothAction);
+};
+
+}  // namespace internal
+
+// An Unused object can be implicitly constructed from ANY value.
+// This is handy when defining actions that ignore some or all of the
+// mock function arguments.  For example, given
+//
+//   MOCK_METHOD3(Foo, double(const string& label, double x, double y));
+//   MOCK_METHOD3(Bar, double(int index, double x, double y));
+//
+// instead of
+//
+//   double DistanceToOriginWithLabel(const string& label, double x, double y) {
+//     return sqrt(x*x + y*y);
+//   }
+//   double DistanceToOriginWithIndex(int index, double x, double y) {
+//     return sqrt(x*x + y*y);
+//   }
+//   ...
+//   EXEPCT_CALL(mock, Foo("abc", _, _))
+//       .WillOnce(Invoke(DistanceToOriginWithLabel));
+//   EXEPCT_CALL(mock, Bar(5, _, _))
+//       .WillOnce(Invoke(DistanceToOriginWithIndex));
+//
+// you could write
+//
+//   // We can declare any uninteresting argument as Unused.
+//   double DistanceToOrigin(Unused, double x, double y) {
+//     return sqrt(x*x + y*y);
+//   }
+//   ...
+//   EXEPCT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));
+//   EXEPCT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));
+typedef internal::IgnoredValue Unused;
+
+// This constructor allows us to turn an Action<From> object into an
+// Action<To>, as long as To's arguments can be implicitly converted
+// to From's and From's return type cann be implicitly converted to
+// To's.
+template <typename To>
+template <typename From>
+Action<To>::Action(const Action<From>& from)
+    : impl_(new internal::ActionAdaptor<To, From>(from)) {}
+
+// Creates an action that returns 'value'.  'value' is passed by value
+// instead of const reference - otherwise Return("string literal")
+// will trigger a compiler error about using array as initializer.
+template <typename R>
+internal::ReturnAction<R> Return(R value) {
+  return internal::ReturnAction<R>(internal::move(value));
+}
+
+// Creates an action that returns NULL.
+inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {
+  return MakePolymorphicAction(internal::ReturnNullAction());
+}
+
+// Creates an action that returns from a void function.
+inline PolymorphicAction<internal::ReturnVoidAction> Return() {
+  return MakePolymorphicAction(internal::ReturnVoidAction());
+}
+
+// Creates an action that returns the reference to a variable.
+template <typename R>
+inline internal::ReturnRefAction<R> ReturnRef(R& x) {  // NOLINT
+  return internal::ReturnRefAction<R>(x);
+}
+
+// Creates an action that returns the reference to a copy of the
+// argument.  The copy is created when the action is constructed and
+// lives as long as the action.
+template <typename R>
+inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
+  return internal::ReturnRefOfCopyAction<R>(x);
+}
+
+// Modifies the parent action (a Return() action) to perform a move of the
+// argument instead of a copy.
+// Return(ByMove()) actions can only be executed once and will assert this
+// invariant.
+template <typename R>
+internal::ByMoveWrapper<R> ByMove(R x) {
+  return internal::ByMoveWrapper<R>(internal::move(x));
+}
+
+// Creates an action that does the default action for the give mock function.
+inline internal::DoDefaultAction DoDefault() {
+  return internal::DoDefaultAction();
+}
+
+// Creates an action that sets the variable pointed by the N-th
+// (0-based) function argument to 'value'.
+template <size_t N, typename T>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<
+    N, T, internal::IsAProtocolMessage<T>::value> >
+SetArgPointee(const T& x) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, T, internal::IsAProtocolMessage<T>::value>(x));
+}
+
+#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
+// This overload allows SetArgPointee() to accept a string literal.
+// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
+// this overload from the templated version and emit a compile error.
+template <size_t N>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<N, const char*, false> >
+SetArgPointee(const char* p) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, const char*, false>(p));
+}
+
+template <size_t N>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
+SetArgPointee(const wchar_t* p) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, const wchar_t*, false>(p));
+}
+#endif
+
+// The following version is DEPRECATED.
+template <size_t N, typename T>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<
+    N, T, internal::IsAProtocolMessage<T>::value> >
+SetArgumentPointee(const T& x) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, T, internal::IsAProtocolMessage<T>::value>(x));
+}
+
+// Creates an action that sets a pointer referent to a given value.
+template <typename T1, typename T2>
+PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
+  return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
+}
+
+#if !GTEST_OS_WINDOWS_MOBILE
+
+// Creates an action that sets errno and returns the appropriate error.
+template <typename T>
+PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
+SetErrnoAndReturn(int errval, T result) {
+  return MakePolymorphicAction(
+      internal::SetErrnoAndReturnAction<T>(errval, result));
+}
+
+#endif  // !GTEST_OS_WINDOWS_MOBILE
+
+// Various overloads for InvokeWithoutArgs().
+
+// Creates an action that invokes 'function_impl' with no argument.
+template <typename FunctionImpl>
+PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >
+InvokeWithoutArgs(FunctionImpl function_impl) {
+  return MakePolymorphicAction(
+      internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));
+}
+
+// Creates an action that invokes the given method on the given object
+// with no argument.
+template <class Class, typename MethodPtr>
+PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >
+InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) {
+  return MakePolymorphicAction(
+      internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>(
+          obj_ptr, method_ptr));
+}
+
+// Creates an action that performs an_action and throws away its
+// result.  In other words, it changes the return type of an_action to
+// void.  an_action MUST NOT return void, or the code won't compile.
+template <typename A>
+inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {
+  return internal::IgnoreResultAction<A>(an_action);
+}
+
+// Creates a reference wrapper for the given L-value.  If necessary,
+// you can explicitly specify the type of the reference.  For example,
+// suppose 'derived' is an object of type Derived, ByRef(derived)
+// would wrap a Derived&.  If you want to wrap a const Base& instead,
+// where Base is a base class of Derived, just write:
+//
+//   ByRef<const Base>(derived)
+template <typename T>
+inline internal::ReferenceWrapper<T> ByRef(T& l_value) {  // NOLINT
+  return internal::ReferenceWrapper<T>(l_value);
+}
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-cardinalities.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-cardinalities.h
new file mode 100644
index 0000000..fc315f9
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-cardinalities.h
@@ -0,0 +1,147 @@
+// 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 cardinalities.  More
+// cardinalities can be defined by the user implementing the
+// CardinalityInterface interface if necessary.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
+
+#include <limits.h>
+#include <ostream>  // NOLINT
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+
+// To implement a cardinality Foo, define:
+//   1. a class FooCardinality that implements the
+//      CardinalityInterface interface, and
+//   2. a factory function that creates a Cardinality object from a
+//      const FooCardinality*.
+//
+// The two-level delegation design follows that of Matcher, providing
+// consistency for extension developers.  It also eases ownership
+// management as Cardinality objects can now be copied like plain values.
+
+// The implementation of a cardinality.
+class CardinalityInterface {
+ public:
+  virtual ~CardinalityInterface() {}
+
+  // Conservative estimate on the lower/upper bound of the number of
+  // calls allowed.
+  virtual int ConservativeLowerBound() const { return 0; }
+  virtual int ConservativeUpperBound() const { return INT_MAX; }
+
+  // Returns true iff call_count calls will satisfy this cardinality.
+  virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
+
+  // Returns true iff call_count calls will saturate this cardinality.
+  virtual bool IsSaturatedByCallCount(int call_count) const = 0;
+
+  // Describes self to an ostream.
+  virtual void DescribeTo(::std::ostream* os) const = 0;
+};
+
+// A Cardinality is a copyable and IMMUTABLE (except by assignment)
+// object that specifies how many times a mock function is expected to
+// be called.  The implementation of Cardinality is just a linked_ptr
+// to const CardinalityInterface, so copying is fairly cheap.
+// Don't inherit from Cardinality!
+class GTEST_API_ Cardinality {
+ public:
+  // Constructs a null cardinality.  Needed for storing Cardinality
+  // objects in STL containers.
+  Cardinality() {}
+
+  // Constructs a Cardinality from its implementation.
+  explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
+
+  // Conservative estimate on the lower/upper bound of the number of
+  // calls allowed.
+  int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
+  int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
+
+  // Returns true iff call_count calls will satisfy this cardinality.
+  bool IsSatisfiedByCallCount(int call_count) const {
+    return impl_->IsSatisfiedByCallCount(call_count);
+  }
+
+  // Returns true iff call_count calls will saturate this cardinality.
+  bool IsSaturatedByCallCount(int call_count) const {
+    return impl_->IsSaturatedByCallCount(call_count);
+  }
+
+  // Returns true iff call_count calls will over-saturate this
+  // cardinality, i.e. exceed the maximum number of allowed calls.
+  bool IsOverSaturatedByCallCount(int call_count) const {
+    return impl_->IsSaturatedByCallCount(call_count) &&
+        !impl_->IsSatisfiedByCallCount(call_count);
+  }
+
+  // Describes self to an ostream
+  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
+
+  // Describes the given actual call count to an ostream.
+  static void DescribeActualCallCountTo(int actual_call_count,
+                                        ::std::ostream* os);
+
+ private:
+  internal::linked_ptr<const CardinalityInterface> impl_;
+};
+
+// Creates a cardinality that allows at least n calls.
+GTEST_API_ Cardinality AtLeast(int n);
+
+// Creates a cardinality that allows at most n calls.
+GTEST_API_ Cardinality AtMost(int n);
+
+// Creates a cardinality that allows any number of calls.
+GTEST_API_ Cardinality AnyNumber();
+
+// Creates a cardinality that allows between min and max calls.
+GTEST_API_ Cardinality Between(int min, int max);
+
+// Creates a cardinality that allows exactly n calls.
+GTEST_API_ Cardinality Exactly(int n);
+
+// Creates a cardinality from its implementation.
+inline Cardinality MakeCardinality(const CardinalityInterface* c) {
+  return Cardinality(c);
+}
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-actions.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-actions.h
new file mode 100644
index 0000000..b5a889c
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-actions.h
@@ -0,0 +1,2377 @@
+// This file was GENERATED by a script.  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 implements some commonly used variadic actions.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+
+#include "gmock/gmock-actions.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+namespace internal {
+
+// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
+// function or method with the unpacked values, where F is a function
+// type that takes N arguments.
+template <typename Result, typename ArgumentTuple>
+class InvokeHelper;
+
+template <typename R>
+class InvokeHelper<R, ::testing::tuple<> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<>&) {
+           return function();
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<>&) {
+           return (obj_ptr->*method_ptr)();
+  }
+};
+
+template <typename R, typename A1>
+class InvokeHelper<R, ::testing::tuple<A1> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1>& args) {
+           return function(get<0>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2>
+class InvokeHelper<R, ::testing::tuple<A1, A2> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) {
+           return function(get<0>(args), get<1>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3,
+      A4>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4,
+      A5>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6,
+                            A7>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
+                            A8>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8, A9>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args), get<8>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+                            A9>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args), get<8>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9,
+    typename A10>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+    A10> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8, A9, A10>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args), get<8>(args), get<9>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+                            A9, A10>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args), get<8>(args), get<9>(args));
+  }
+};
+
+// An INTERNAL macro for extracting the type of a tuple field.  It's
+// subject to change without notice - DO NOT USE IN USER CODE!
+#define GMOCK_FIELD_(Tuple, N) \
+    typename ::testing::tuple_element<N, Tuple>::type
+
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
+// type of an n-ary function whose i-th (1-based) argument type is the
+// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
+// type, and whose return type is Result.  For example,
+//   SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
+// is int(bool, long).
+//
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
+// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
+// For example,
+//   SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
+//       ::testing::make_tuple(true, 'a', 2.5))
+// returns tuple (2.5, true).
+//
+// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
+// in the range [0, 10].  Duplicates are allowed and they don't have
+// to be in an ascending or descending order.
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7, int k8, int k9, int k10>
+class SelectArgs {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
+      GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
+      GMOCK_FIELD_(ArgumentTuple, k10));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
+        get<k8>(args), get<k9>(args), get<k10>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple>
+class SelectArgs<Result, ArgumentTuple,
+                 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type();
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& /* args */) {
+    return SelectedArgs();
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7, int k8>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
+      GMOCK_FIELD_(ArgumentTuple, k8));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
+        get<k8>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7, int k8, int k9>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
+      GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
+        get<k8>(args), get<k9>(args));
+  }
+};
+
+#undef GMOCK_FIELD_
+
+// Implements the WithArgs action.
+template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,
+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
+    int k9 = -1, int k10 = -1>
+class WithArgsAction {
+ public:
+  explicit WithArgsAction(const InnerAction& action) : action_(action) {}
+
+  template <typename F>
+  operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
+
+ private:
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const InnerAction& action) : action_(action) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,
+          k5, k6, k7, k8, k9, k10>::Select(args));
+    }
+
+   private:
+    typedef typename SelectArgs<Result, ArgumentTuple,
+        k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;
+
+    Action<InnerFunctionType> action_;
+  };
+
+  const InnerAction action_;
+
+  GTEST_DISALLOW_ASSIGN_(WithArgsAction);
+};
+
+// A macro from the ACTION* family (defined later in this file)
+// defines an action that can be used in a mock function.  Typically,
+// these actions only care about a subset of the arguments of the mock
+// function.  For example, if such an action only uses the second
+// argument, it can be used in any mock function that takes >= 2
+// arguments where the type of the second argument is compatible.
+//
+// Therefore, the action implementation must be prepared to take more
+// arguments than it needs.  The ExcessiveArg type is used to
+// represent those excessive arguments.  In order to keep the compiler
+// error messages tractable, we define it in the testing namespace
+// instead of testing::internal.  However, this is an INTERNAL TYPE
+// and subject to change without notice, so a user MUST NOT USE THIS
+// TYPE DIRECTLY.
+struct ExcessiveArg {};
+
+// A helper class needed for implementing the ACTION* macros.
+template <typename Result, class Impl>
+class ActionHelper {
+ public:
+  static Result Perform(Impl* impl, const ::testing::tuple<>& args) {
+    return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) {
+    return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) {
+    return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
+        get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
+        get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2,
+      A3>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
+        get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3,
+      A4>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
+        get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
+        get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6, typename A7>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6, A7>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
+        A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6, typename A7, typename A8>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6, A7, A8>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
+        A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6, typename A7, typename A8, typename A9>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6, A7, A8, A9>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
+        A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
+        get<9>(args));
+  }
+};
+
+}  // namespace internal
+
+// Various overloads for Invoke().
+
+// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
+// the selected arguments of the mock function to an_action and
+// performs it.  It serves as an adaptor between actions with
+// different argument lists.  C++ doesn't support default arguments for
+// function templates, so we have to overload it.
+template <int k1, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1>(action);
+}
+
+template <int k1, int k2, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2>(action);
+}
+
+template <int k1, int k2, int k3, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3>(action);
+}
+
+template <int k1, int k2, int k3, int k4, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
+    typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6,
+      k7>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7,
+      k8>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, int k10, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
+    k9, k10>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9, k10>(action);
+}
+
+// Creates an action that does actions a1, a2, ..., sequentially in
+// each invocation.
+template <typename Action1, typename Action2>
+inline internal::DoBothAction<Action1, Action2>
+DoAll(Action1 a1, Action2 a2) {
+  return internal::DoBothAction<Action1, Action2>(a1, a2);
+}
+
+template <typename Action1, typename Action2, typename Action3>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    Action3> >
+DoAll(Action1 a1, Action2 a2, Action3 a3) {
+  return DoAll(a1, DoAll(a2, a3));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, Action4> > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) {
+  return DoAll(a1, DoAll(a2, a3, a4));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    Action5> > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, Action6> > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    Action7> > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7,
+    typename Action8>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    internal::DoBothAction<Action7, Action8> > > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7, Action8 a8) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7,
+    typename Action8, typename Action9>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    internal::DoBothAction<Action7, internal::DoBothAction<Action8,
+    Action9> > > > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7, Action8 a8, Action9 a9) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7,
+    typename Action8, typename Action9, typename Action10>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    internal::DoBothAction<Action7, internal::DoBothAction<Action8,
+    internal::DoBothAction<Action9, Action10> > > > > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7, Action8 a8, Action9 a9, Action10 a10) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));
+}
+
+}  // namespace testing
+
+// The ACTION* family of macros can be used in a namespace scope to
+// define custom actions easily.  The syntax:
+//
+//   ACTION(name) { statements; }
+//
+// will define an action with the given name that executes the
+// statements.  The value returned by the statements will be used as
+// the return value of the action.  Inside the statements, you can
+// refer to the K-th (0-based) argument of the mock function by
+// 'argK', and refer to its type by 'argK_type'.  For example:
+//
+//   ACTION(IncrementArg1) {
+//     arg1_type temp = arg1;
+//     return ++(*temp);
+//   }
+//
+// allows you to write
+//
+//   ...WillOnce(IncrementArg1());
+//
+// You can also refer to the entire argument tuple and its type by
+// 'args' and 'args_type', and refer to the mock function type and its
+// return type by 'function_type' and 'return_type'.
+//
+// Note that you don't need to specify the types of the mock function
+// arguments.  However rest assured that your code is still type-safe:
+// you'll get a compiler error if *arg1 doesn't support the ++
+// operator, or if the type of ++(*arg1) isn't compatible with the
+// mock function's return type, for example.
+//
+// Sometimes you'll want to parameterize the action.   For that you can use
+// another macro:
+//
+//   ACTION_P(name, param_name) { statements; }
+//
+// For example:
+//
+//   ACTION_P(Add, n) { return arg0 + n; }
+//
+// will allow you to write:
+//
+//   ...WillOnce(Add(5));
+//
+// Note that you don't need to provide the type of the parameter
+// either.  If you need to reference the type of a parameter named
+// 'foo', you can write 'foo_type'.  For example, in the body of
+// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
+// of 'n'.
+//
+// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
+// multi-parameter actions.
+//
+// For the purpose of typing, you can view
+//
+//   ACTION_Pk(Foo, p1, ..., pk) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// In particular, you can provide the template type arguments
+// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
+// although usually you can rely on the compiler to infer the types
+// for you automatically.  You can assign the result of expression
+// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
+// pk_type>.  This can be useful when composing actions.
+//
+// You can also overload actions with different numbers of parameters:
+//
+//   ACTION_P(Plus, a) { ... }
+//   ACTION_P2(Plus, a, b) { ... }
+//
+// While it's tempting to always use the ACTION* macros when defining
+// a new action, you should also consider implementing ActionInterface
+// or using MakePolymorphicAction() instead, especially if you need to
+// use the action a lot.  While these approaches require more work,
+// they give you more control on the types of the mock function
+// arguments and the action parameters, which in general leads to
+// better compiler error messages that pay off in the long run.  They
+// also allow overloading actions based on parameter types (as opposed
+// to just based on the number of parameters).
+//
+// CAVEAT:
+//
+// ACTION*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using ACTION*() inside
+// a function.
+//
+// MORE INFORMATION:
+//
+// To learn more about using these macros, please search for 'ACTION'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+// An internal macro needed for implementing ACTION*().
+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
+    const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
+    arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \
+    arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \
+    arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \
+    arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \
+    arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \
+    arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \
+    arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
+    arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
+    arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
+    arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
+
+// Sometimes you want to give an action explicit template parameters
+// that cannot be inferred from its value parameters.  ACTION() and
+// ACTION_P*() don't support that.  ACTION_TEMPLATE() remedies that
+// and can be viewed as an extension to ACTION() and ACTION_P*().
+//
+// The syntax:
+//
+//   ACTION_TEMPLATE(ActionName,
+//                   HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
+//                   AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
+//
+// defines an action template that takes m explicit template
+// parameters and n value parameters.  name_i is the name of the i-th
+// template parameter, and kind_i specifies whether it's a typename,
+// an integral constant, or a template.  p_i is the name of the i-th
+// value parameter.
+//
+// Example:
+//
+//   // DuplicateArg<k, T>(output) converts the k-th argument of the mock
+//   // function to type T and copies it to *output.
+//   ACTION_TEMPLATE(DuplicateArg,
+//                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
+//                   AND_1_VALUE_PARAMS(output)) {
+//     *output = T(::testing::get<k>(args));
+//   }
+//   ...
+//     int n;
+//     EXPECT_CALL(mock, Foo(_, _))
+//         .WillOnce(DuplicateArg<1, unsigned char>(&n));
+//
+// To create an instance of an action template, write:
+//
+//   ActionName<t1, ..., t_m>(v1, ..., v_n)
+//
+// where the ts are the template arguments and the vs are the value
+// arguments.  The value argument types are inferred by the compiler.
+// If you want to explicitly specify the value argument types, you can
+// provide additional template arguments:
+//
+//   ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
+//
+// where u_i is the desired type of v_i.
+//
+// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
+// number of value parameters, but not on the number of template
+// parameters.  Without the restriction, the meaning of the following
+// is unclear:
+//
+//   OverloadedAction<int, bool>(x);
+//
+// Are we using a single-template-parameter action where 'bool' refers
+// to the type of x, or are we using a two-template-parameter action
+// where the compiler is asked to infer the type of x?
+//
+// Implementation notes:
+//
+// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
+// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
+// implementing ACTION_TEMPLATE.  The main trick we use is to create
+// new macro invocations when expanding a macro.  For example, we have
+//
+//   #define ACTION_TEMPLATE(name, template_params, value_params)
+//       ... GMOCK_INTERNAL_DECL_##template_params ...
+//
+// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
+// to expand to
+//
+//       ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
+//
+// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
+// preprocessor will continue to expand it to
+//
+//       ... typename T ...
+//
+// This technique conforms to the C++ standard and is portable.  It
+// allows us to implement action templates using O(N) code, where N is
+// the maximum number of template/value parameters supported.  Without
+// using it, we'd have to devote O(N^2) amount of code to implement all
+// combinations of m and n.
+
+// Declares the template parameters.
+#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
+#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1) kind0 name0, kind1 name1
+#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2) kind0 name0, kind1 name1, kind2 name2
+#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
+    kind3 name3
+#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
+    kind2 name2, kind3 name3, kind4 name4
+#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
+    kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
+#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
+    kind5 name5, kind6 name6
+#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
+    kind4 name4, kind5 name5, kind6 name6, kind7 name7
+#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
+    kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
+    kind8 name8
+#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
+    kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
+    kind6 name6, kind7 name7, kind8 name8, kind9 name9
+
+// Lists the template parameters.
+#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
+#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1) name0, name1
+#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2) name0, name1, name2
+#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3) name0, name1, name2, name3
+#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
+    name4
+#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
+    name2, name3, name4, name5
+#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6) name0, name1, name2, name3, name4, name5, name6
+#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
+#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
+    name6, name7, name8
+#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
+    name3, name4, name5, name6, name7, name8, name9
+
+// Declares the types of value parameters.
+#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
+    typename p0##_type, typename p1##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
+    typename p0##_type, typename p1##_type, typename p2##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
+    typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
+    typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
+    typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type, \
+    typename p6##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type, \
+    typename p6##_type, typename p7##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type, \
+    typename p6##_type, typename p7##_type, typename p8##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
+    typename p2##_type, typename p3##_type, typename p4##_type, \
+    typename p5##_type, typename p6##_type, typename p7##_type, \
+    typename p8##_type, typename p9##_type
+
+// Initializes the value parameters.
+#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
+    ()
+#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
+    (p0##_type gmock_p0) : p0(gmock_p0)
+#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
+    (p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), p1(gmock_p1)
+#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2)
+#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3)
+#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4)
+#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5)
+#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6)
+#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7)
+#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8)
+#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
+        p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8), p9(gmock_p9)
+
+// Declares the fields for storing the value parameters.
+#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
+#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
+    p1##_type p1;
+#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
+    p1##_type p1; p2##_type p2;
+#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
+    p1##_type p1; p2##_type p2; p3##_type p3;
+#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
+    p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
+#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
+    p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
+    p5##_type p5;
+#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
+    p5##_type p5; p6##_type p6;
+#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
+    p5##_type p5; p6##_type p6; p7##_type p7;
+#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
+    p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
+#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
+    p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
+    p9##_type p9;
+
+// Lists the value parameters.
+#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
+#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
+#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
+#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
+#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
+    p2, p3, p4
+#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
+    p1, p2, p3, p4, p5
+#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) p0, p1, p2, p3, p4, p5, p6
+#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) p0, p1, p2, p3, p4, p5, p6, p7
+#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
+#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
+
+// Lists the value parameter types.
+#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
+    p1##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
+    p1##_type, p2##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
+    p0##_type, p1##_type, p2##_type, p3##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
+    p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
+    p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
+    p6##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+    p5##_type, p6##_type, p7##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+    p5##_type, p6##_type, p7##_type, p8##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+    p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
+
+// Declares the value parameters.
+#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
+#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
+    p1##_type p1
+#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
+    p1##_type p1, p2##_type p2
+#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
+    p1##_type p1, p2##_type p2, p3##_type p3
+#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
+    p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
+#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
+    p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
+    p5##_type p5
+#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
+    p5##_type p5, p6##_type p6
+#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
+    p5##_type p5, p6##_type p6, p7##_type p7
+#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+    p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
+#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+    p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
+    p9##_type p9
+
+// The suffix of the class template implementing the action template.
+#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
+#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
+#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
+#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
+#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
+#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
+#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
+#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) P8
+#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) P9
+#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) P10
+
+// The name of the class template implementing the action template.
+#define GMOCK_ACTION_CLASS_(name, value_params)\
+    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
+
+#define ACTION_TEMPLATE(name, template_params, value_params)\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  class GMOCK_ACTION_CLASS_(name, value_params) {\
+   public:\
+    explicit GMOCK_ACTION_CLASS_(name, value_params)\
+        GMOCK_INTERNAL_INIT_##value_params {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      GMOCK_INTERNAL_DEFN_##value_params\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(\
+          new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
+    }\
+    GMOCK_INTERNAL_DEFN_##value_params\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
+  };\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  inline GMOCK_ACTION_CLASS_(name, value_params)<\
+      GMOCK_INTERNAL_LIST_##template_params\
+      GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
+          GMOCK_INTERNAL_DECL_##value_params) {\
+    return GMOCK_ACTION_CLASS_(name, value_params)<\
+        GMOCK_INTERNAL_LIST_##template_params\
+        GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
+            GMOCK_INTERNAL_LIST_##value_params);\
+  }\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      GMOCK_ACTION_CLASS_(name, value_params)<\
+          GMOCK_INTERNAL_LIST_##template_params\
+          GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
+              gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION(name)\
+  class name##Action {\
+   public:\
+    name##Action() {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl() {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>());\
+    }\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##Action);\
+  };\
+  inline name##Action name() {\
+    return name##Action();\
+  }\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##Action::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P(name, p0)\
+  template <typename p0##_type>\
+  class name##ActionP {\
+   public:\
+    explicit name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      explicit gmock_Impl(p0##_type gmock_p0) : p0(gmock_p0) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0));\
+    }\
+    p0##_type p0;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP);\
+  };\
+  template <typename p0##_type>\
+  inline name##ActionP<p0##_type> name(p0##_type p0) {\
+    return name##ActionP<p0##_type>(p0);\
+  }\
+  template <typename p0##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P2(name, p0, p1)\
+  template <typename p0##_type, typename p1##_type>\
+  class name##ActionP2 {\
+   public:\
+    name##ActionP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
+        p1(gmock_p1) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
+          p1(gmock_p1) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
+  };\
+  template <typename p0##_type, typename p1##_type>\
+  inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
+      p1##_type p1) {\
+    return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
+  }\
+  template <typename p0##_type, typename p1##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P3(name, p0, p1, p2)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  class name##ActionP3 {\
+   public:\
+    name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
+          p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2) {\
+    return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP3<p0##_type, p1##_type, \
+          p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P4(name, p0, p1, p2, p3)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  class name##ActionP4 {\
+   public:\
+    name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
+      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3) {\
+    return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
+        p2, p3);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP4<p0##_type, p1##_type, p2##_type, \
+          p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P5(name, p0, p1, p2, p3, p4)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  class name##ActionP5 {\
+   public:\
+    name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, \
+        p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), \
+          p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4) {\
+    return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type>(p0, p1, p2, p3, p4);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+          p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  class name##ActionP6 {\
+   public:\
+    name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, \
+          p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3, p4##_type p4, p5##_type p5) {\
+    return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  class name##ActionP7 {\
+   public:\
+    name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
+        p6(gmock_p6) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
+      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6) {\
+    return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  class name##ActionP8 {\
+   public:\
+    name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, \
+        p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), \
+          p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \
+          p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6, p7));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6, p7##_type p7) {\
+    return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
+        p6, p7);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type, \
+          p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  class name##ActionP9 {\
+   public:\
+    name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, \
+          p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+          p7(gmock_p7), p8(gmock_p8) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6, p7, p8));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, \
+      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
+      p8##_type p8) {\
+    return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
+        p3, p4, p5, p6, p7, p8);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type, p7##_type, \
+          p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  class name##ActionP10 {\
+   public:\
+    name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
+          p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+          p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+      p9##_type p9;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6, p7, p8, p9));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+    p9##_type p9;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
+      p9##_type p9) {\
+    return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
+        p1, p2, p3, p4, p5, p6, p7, p8, p9);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type, p7##_type, p8##_type, \
+          p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+namespace testing {
+
+
+// The ACTION*() macros trigger warning C4100 (unreferenced formal
+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
+// the macro definition, as the warnings are generated when the macro
+// is expanded and macro expansion cannot contain #pragma.  Therefore
+// we suppress them here.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4100)
+#endif
+
+// Various overloads for InvokeArgument<N>().
+//
+// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
+// (0-based) argument, which must be a k-ary callable, of the mock
+// function, with arguments a1, a2, ..., a_k.
+//
+// Notes:
+//
+//   1. The arguments are passed by value by default.  If you need to
+//   pass an argument by reference, wrap it inside ByRef().  For
+//   example,
+//
+//     InvokeArgument<1>(5, string("Hello"), ByRef(foo))
+//
+//   passes 5 and string("Hello") by value, and passes foo by
+//   reference.
+//
+//   2. If the callable takes an argument by reference but ByRef() is
+//   not used, it will receive the reference to a copy of the value,
+//   instead of the original value.  For example, when the 0-th
+//   argument of the mock function takes a const string&, the action
+//
+//     InvokeArgument<0>(string("Hello"))
+//
+//   makes a copy of the temporary string("Hello") object and passes a
+//   reference of the copy, instead of the original temporary object,
+//   to the callable.  This makes it easy for a user to define an
+//   InvokeArgument action from temporary values and have it performed
+//   later.
+
+namespace internal {
+namespace invoke_argument {
+
+// Appears in InvokeArgumentAdl's argument list to help avoid
+// accidental calls to user functions of the same name.
+struct AdlTag {};
+
+// InvokeArgumentAdl - a helper for InvokeArgument.
+// The basic overloads are provided here for generic functors.
+// Overloads for other custom-callables are provided in the
+// internal/custom/callback-actions.h header.
+
+template <typename R, typename F>
+R InvokeArgumentAdl(AdlTag, F f) {
+  return f();
+}
+template <typename R, typename F, typename A1>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
+  return f(a1);
+}
+template <typename R, typename F, typename A1, typename A2>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
+  return f(a1, a2);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
+  return f(a1, a2, a3);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
+  return f(a1, a2, a3, a4);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
+  return f(a1, a2, a3, a4, a5);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
+  return f(a1, a2, a3, a4, a5, a6);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7) {
+  return f(a1, a2, a3, a4, a5, a6, a7);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8, A9 a9) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9, typename A10>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8, A9 a9, A10 a10) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+}
+}  // namespace invoke_argument
+}  // namespace internal
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_0_VALUE_PARAMS()) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args));
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(p0)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_2_VALUE_PARAMS(p0, p1)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_3_VALUE_PARAMS(p0, p1, p2)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+}
+
+// Various overloads for ReturnNew<T>().
+//
+// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
+// instance of type T, constructed on the heap with constructor arguments
+// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_0_VALUE_PARAMS()) {
+  return new T();
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_1_VALUE_PARAMS(p0)) {
+  return new T(p0);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_2_VALUE_PARAMS(p0, p1)) {
+  return new T(p0, p1);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_3_VALUE_PARAMS(p0, p1, p2)) {
+  return new T(p0, p1, p2);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
+  return new T(p0, p1, p2, p3);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
+  return new T(p0, p1, p2, p3, p4);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
+  return new T(p0, p1, p2, p3, p4, p5);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6, p7);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+}  // namespace testing
+
+// Include any custom actions added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-generated-actions.h"
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-actions.h.pump b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-actions.h.pump
new file mode 100644
index 0000000..66d9f9d
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-actions.h.pump
@@ -0,0 +1,794 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-actions.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+$$}} This meta comment fixes auto-indentation in editors.
+// 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 variadic actions.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+
+#include "gmock/gmock-actions.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+namespace internal {
+
+// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
+// function or method with the unpacked values, where F is a function
+// type that takes N arguments.
+template <typename Result, typename ArgumentTuple>
+class InvokeHelper;
+
+
+$range i 0..n
+$for i [[
+$range j 1..i
+$var types = [[$for j [[, typename A$j]]]]
+$var as = [[$for j, [[A$j]]]]
+$var args = [[$if i==0 [[]] $else [[ args]]]]
+$var gets = [[$for j, [[get<$(j - 1)>(args)]]]]
+template <typename R$types>
+class InvokeHelper<R, ::testing::tuple<$as> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<$as>&$args) {
+           return function($gets);
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<$as>&$args) {
+           return (obj_ptr->*method_ptr)($gets);
+  }
+};
+
+
+]]
+// An INTERNAL macro for extracting the type of a tuple field.  It's
+// subject to change without notice - DO NOT USE IN USER CODE!
+#define GMOCK_FIELD_(Tuple, N) \
+    typename ::testing::tuple_element<N, Tuple>::type
+
+$range i 1..n
+
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
+// type of an n-ary function whose i-th (1-based) argument type is the
+// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
+// type, and whose return type is Result.  For example,
+//   SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
+// is int(bool, long).
+//
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
+// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
+// For example,
+//   SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
+//       ::testing::make_tuple(true, 'a', 2.5))
+// returns tuple (2.5, true).
+//
+// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
+// in the range [0, $n].  Duplicates are allowed and they don't have
+// to be in an ascending or descending order.
+
+template <typename Result, typename ArgumentTuple, $for i, [[int k$i]]>
+class SelectArgs {
+ public:
+  typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]);
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs($for i, [[get<k$i>(args)]]);
+  }
+};
+
+
+$for i [[
+$range j 1..n
+$range j1 1..i-1
+template <typename Result, typename ArgumentTuple$for j1[[, int k$j1]]>
+class SelectArgs<Result, ArgumentTuple,
+                 $for j, [[$if j <= i-1 [[k$j]] $else [[-1]]]]> {
+ public:
+  typedef Result type($for j1, [[GMOCK_FIELD_(ArgumentTuple, k$j1)]]);
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& [[]]
+$if i == 1 [[/* args */]] $else [[args]]) {
+    return SelectedArgs($for j1, [[get<k$j1>(args)]]);
+  }
+};
+
+
+]]
+#undef GMOCK_FIELD_
+
+$var ks = [[$for i, [[k$i]]]]
+
+// Implements the WithArgs action.
+template <typename InnerAction, $for i, [[int k$i = -1]]>
+class WithArgsAction {
+ public:
+  explicit WithArgsAction(const InnerAction& action) : action_(action) {}
+
+  template <typename F>
+  operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
+
+ private:
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const InnerAction& action) : action_(action) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      return action_.Perform(SelectArgs<Result, ArgumentTuple, $ks>::Select(args));
+    }
+
+   private:
+    typedef typename SelectArgs<Result, ArgumentTuple,
+        $ks>::type InnerFunctionType;
+
+    Action<InnerFunctionType> action_;
+  };
+
+  const InnerAction action_;
+
+  GTEST_DISALLOW_ASSIGN_(WithArgsAction);
+};
+
+// A macro from the ACTION* family (defined later in this file)
+// defines an action that can be used in a mock function.  Typically,
+// these actions only care about a subset of the arguments of the mock
+// function.  For example, if such an action only uses the second
+// argument, it can be used in any mock function that takes >= 2
+// arguments where the type of the second argument is compatible.
+//
+// Therefore, the action implementation must be prepared to take more
+// arguments than it needs.  The ExcessiveArg type is used to
+// represent those excessive arguments.  In order to keep the compiler
+// error messages tractable, we define it in the testing namespace
+// instead of testing::internal.  However, this is an INTERNAL TYPE
+// and subject to change without notice, so a user MUST NOT USE THIS
+// TYPE DIRECTLY.
+struct ExcessiveArg {};
+
+// A helper class needed for implementing the ACTION* macros.
+template <typename Result, class Impl>
+class ActionHelper {
+ public:
+$range i 0..n
+$for i
+
+[[
+$var template = [[$if i==0 [[]] $else [[
+$range j 0..i-1
+  template <$for j, [[typename A$j]]>
+]]]]
+$range j 0..i-1
+$var As = [[$for j, [[A$j]]]]
+$var as = [[$for j, [[get<$j>(args)]]]]
+$range k 1..n-i
+$var eas = [[$for k, [[ExcessiveArg()]]]]
+$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]]
+$template
+  static Result Perform(Impl* impl, const ::testing::tuple<$As>& args) {
+    return impl->template gmock_PerformImpl<$As>(args, $arg_list);
+  }
+
+]]
+};
+
+}  // namespace internal
+
+// Various overloads for Invoke().
+
+// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
+// the selected arguments of the mock function to an_action and
+// performs it.  It serves as an adaptor between actions with
+// different argument lists.  C++ doesn't support default arguments for
+// function templates, so we have to overload it.
+
+$range i 1..n
+$for i [[
+$range j 1..i
+template <$for j [[int k$j, ]]typename InnerAction>
+inline internal::WithArgsAction<InnerAction$for j [[, k$j]]>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction$for j [[, k$j]]>(action);
+}
+
+
+]]
+// Creates an action that does actions a1, a2, ..., sequentially in
+// each invocation.
+$range i 2..n
+$for i [[
+$range j 2..i
+$var types = [[$for j, [[typename Action$j]]]]
+$var Aas = [[$for j [[, Action$j a$j]]]]
+
+template <typename Action1, $types>
+$range k 1..i-1
+
+inline $for k [[internal::DoBothAction<Action$k, ]]Action$i$for k  [[>]]
+
+DoAll(Action1 a1$Aas) {
+$if i==2 [[
+
+  return internal::DoBothAction<Action1, Action2>(a1, a2);
+]] $else [[
+$range j2 2..i
+
+  return DoAll(a1, DoAll($for j2, [[a$j2]]));
+]]
+
+}
+
+]]
+
+}  // namespace testing
+
+// The ACTION* family of macros can be used in a namespace scope to
+// define custom actions easily.  The syntax:
+//
+//   ACTION(name) { statements; }
+//
+// will define an action with the given name that executes the
+// statements.  The value returned by the statements will be used as
+// the return value of the action.  Inside the statements, you can
+// refer to the K-th (0-based) argument of the mock function by
+// 'argK', and refer to its type by 'argK_type'.  For example:
+//
+//   ACTION(IncrementArg1) {
+//     arg1_type temp = arg1;
+//     return ++(*temp);
+//   }
+//
+// allows you to write
+//
+//   ...WillOnce(IncrementArg1());
+//
+// You can also refer to the entire argument tuple and its type by
+// 'args' and 'args_type', and refer to the mock function type and its
+// return type by 'function_type' and 'return_type'.
+//
+// Note that you don't need to specify the types of the mock function
+// arguments.  However rest assured that your code is still type-safe:
+// you'll get a compiler error if *arg1 doesn't support the ++
+// operator, or if the type of ++(*arg1) isn't compatible with the
+// mock function's return type, for example.
+//
+// Sometimes you'll want to parameterize the action.   For that you can use
+// another macro:
+//
+//   ACTION_P(name, param_name) { statements; }
+//
+// For example:
+//
+//   ACTION_P(Add, n) { return arg0 + n; }
+//
+// will allow you to write:
+//
+//   ...WillOnce(Add(5));
+//
+// Note that you don't need to provide the type of the parameter
+// either.  If you need to reference the type of a parameter named
+// 'foo', you can write 'foo_type'.  For example, in the body of
+// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
+// of 'n'.
+//
+// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P$n to support
+// multi-parameter actions.
+//
+// For the purpose of typing, you can view
+//
+//   ACTION_Pk(Foo, p1, ..., pk) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// In particular, you can provide the template type arguments
+// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
+// although usually you can rely on the compiler to infer the types
+// for you automatically.  You can assign the result of expression
+// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
+// pk_type>.  This can be useful when composing actions.
+//
+// You can also overload actions with different numbers of parameters:
+//
+//   ACTION_P(Plus, a) { ... }
+//   ACTION_P2(Plus, a, b) { ... }
+//
+// While it's tempting to always use the ACTION* macros when defining
+// a new action, you should also consider implementing ActionInterface
+// or using MakePolymorphicAction() instead, especially if you need to
+// use the action a lot.  While these approaches require more work,
+// they give you more control on the types of the mock function
+// arguments and the action parameters, which in general leads to
+// better compiler error messages that pay off in the long run.  They
+// also allow overloading actions based on parameter types (as opposed
+// to just based on the number of parameters).
+//
+// CAVEAT:
+//
+// ACTION*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using ACTION*() inside
+// a function.
+//
+// MORE INFORMATION:
+//
+// To learn more about using these macros, please search for 'ACTION'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+$range i 0..n
+$range k 0..n-1
+
+// An internal macro needed for implementing ACTION*().
+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
+    const args_type& args GTEST_ATTRIBUTE_UNUSED_
+$for k [[, \
+    arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]]
+
+
+// Sometimes you want to give an action explicit template parameters
+// that cannot be inferred from its value parameters.  ACTION() and
+// ACTION_P*() don't support that.  ACTION_TEMPLATE() remedies that
+// and can be viewed as an extension to ACTION() and ACTION_P*().
+//
+// The syntax:
+//
+//   ACTION_TEMPLATE(ActionName,
+//                   HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
+//                   AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
+//
+// defines an action template that takes m explicit template
+// parameters and n value parameters.  name_i is the name of the i-th
+// template parameter, and kind_i specifies whether it's a typename,
+// an integral constant, or a template.  p_i is the name of the i-th
+// value parameter.
+//
+// Example:
+//
+//   // DuplicateArg<k, T>(output) converts the k-th argument of the mock
+//   // function to type T and copies it to *output.
+//   ACTION_TEMPLATE(DuplicateArg,
+//                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
+//                   AND_1_VALUE_PARAMS(output)) {
+//     *output = T(::testing::get<k>(args));
+//   }
+//   ...
+//     int n;
+//     EXPECT_CALL(mock, Foo(_, _))
+//         .WillOnce(DuplicateArg<1, unsigned char>(&n));
+//
+// To create an instance of an action template, write:
+//
+//   ActionName<t1, ..., t_m>(v1, ..., v_n)
+//
+// where the ts are the template arguments and the vs are the value
+// arguments.  The value argument types are inferred by the compiler.
+// If you want to explicitly specify the value argument types, you can
+// provide additional template arguments:
+//
+//   ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
+//
+// where u_i is the desired type of v_i.
+//
+// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
+// number of value parameters, but not on the number of template
+// parameters.  Without the restriction, the meaning of the following
+// is unclear:
+//
+//   OverloadedAction<int, bool>(x);
+//
+// Are we using a single-template-parameter action where 'bool' refers
+// to the type of x, or are we using a two-template-parameter action
+// where the compiler is asked to infer the type of x?
+//
+// Implementation notes:
+//
+// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
+// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
+// implementing ACTION_TEMPLATE.  The main trick we use is to create
+// new macro invocations when expanding a macro.  For example, we have
+//
+//   #define ACTION_TEMPLATE(name, template_params, value_params)
+//       ... GMOCK_INTERNAL_DECL_##template_params ...
+//
+// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
+// to expand to
+//
+//       ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
+//
+// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
+// preprocessor will continue to expand it to
+//
+//       ... typename T ...
+//
+// This technique conforms to the C++ standard and is portable.  It
+// allows us to implement action templates using O(N) code, where N is
+// the maximum number of template/value parameters supported.  Without
+// using it, we'd have to devote O(N^2) amount of code to implement all
+// combinations of m and n.
+
+// Declares the template parameters.
+
+$range j 1..n
+$for j [[
+$range m 0..j-1
+#define GMOCK_INTERNAL_DECL_HAS_$j[[]]
+_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[kind$m name$m]]
+
+
+]]
+
+// Lists the template parameters.
+
+$for j [[
+$range m 0..j-1
+#define GMOCK_INTERNAL_LIST_HAS_$j[[]]
+_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[name$m]]
+
+
+]]
+
+// Declares the types of value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_DECL_TYPE_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]]
+
+
+]]
+
+// Initializes the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\
+    ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(gmock_p$j)]]
+
+
+]]
+
+// Declares the fields for storing the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_DEFN_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j [[p$j##_type p$j; ]]
+
+
+]]
+
+// Lists the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_LIST_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j, [[p$j]]
+
+
+]]
+
+// Lists the value parameter types.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_LIST_TYPE_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j [[, p$j##_type]]
+
+
+]]
+
+// Declares the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_DECL_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]
+$for j, [[p$j##_type p$j]]
+
+
+]]
+
+// The suffix of the class template implementing the action template.
+$for i [[
+
+
+$range j 0..i-1
+#define GMOCK_INTERNAL_COUNT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]
+$if i==1 [[P]] $elif i>=2 [[P$i]]
+]]
+
+
+// The name of the class template implementing the action template.
+#define GMOCK_ACTION_CLASS_(name, value_params)\
+    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
+
+$range k 0..n-1
+
+#define ACTION_TEMPLATE(name, template_params, value_params)\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  class GMOCK_ACTION_CLASS_(name, value_params) {\
+   public:\
+    explicit GMOCK_ACTION_CLASS_(name, value_params)\
+        GMOCK_INTERNAL_INIT_##value_params {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <$for k, [[typename arg$k[[]]_type]]>\
+      return_type gmock_PerformImpl(const args_type& args[[]]
+$for k [[, arg$k[[]]_type arg$k]]) const;\
+      GMOCK_INTERNAL_DEFN_##value_params\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(\
+          new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
+    }\
+    GMOCK_INTERNAL_DEFN_##value_params\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
+  };\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  inline GMOCK_ACTION_CLASS_(name, value_params)<\
+      GMOCK_INTERNAL_LIST_##template_params\
+      GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
+          GMOCK_INTERNAL_DECL_##value_params) {\
+    return GMOCK_ACTION_CLASS_(name, value_params)<\
+        GMOCK_INTERNAL_LIST_##template_params\
+        GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
+            GMOCK_INTERNAL_LIST_##value_params);\
+  }\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      GMOCK_ACTION_CLASS_(name, value_params)<\
+          GMOCK_INTERNAL_LIST_##template_params\
+          GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
+              gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+$for i
+
+[[
+$var template = [[$if i==0 [[]] $else [[
+$range j 0..i-1
+
+  template <$for j, [[typename p$j##_type]]>\
+]]]]
+$var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]]
+                                                $else [[P$i]]]]]]
+$range j 0..i-1
+$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
+$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
+$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
+$var param_field_decls = [[$for j
+[[
+
+      p$j##_type p$j;\
+]]]]
+$var param_field_decls2 = [[$for j
+[[
+
+    p$j##_type p$j;\
+]]]]
+$var params = [[$for j, [[p$j]]]]
+$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
+$var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]]
+$var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]]
+$var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]]
+                                        $else [[ACTION_P$i]]]]
+
+#define $macro_name(name$for j [[, p$j]])\$template
+  class $class_name {\
+   public:\
+    [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <$typename_arg_types>\
+      return_type gmock_PerformImpl(const args_type& args, [[]]
+$arg_types_and_names) const;\$param_field_decls
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>($params));\
+    }\$param_field_decls2
+   private:\
+    GTEST_DISALLOW_ASSIGN_($class_name);\
+  };\$template
+  inline $class_name$param_types name($param_types_and_names) {\
+    return $class_name$param_types($params);\
+  }\$template
+  template <typename F>\
+  template <$typename_arg_types>\
+  typename ::testing::internal::Function<F>::Result\
+      $class_name$param_types::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+]]
+$$ }  // This meta comment fixes auto-indentation in Emacs.  It won't
+$$    // show up in the generated code.
+
+
+namespace testing {
+
+
+// The ACTION*() macros trigger warning C4100 (unreferenced formal
+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
+// the macro definition, as the warnings are generated when the macro
+// is expanded and macro expansion cannot contain #pragma.  Therefore
+// we suppress them here.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4100)
+#endif
+
+// Various overloads for InvokeArgument<N>().
+//
+// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
+// (0-based) argument, which must be a k-ary callable, of the mock
+// function, with arguments a1, a2, ..., a_k.
+//
+// Notes:
+//
+//   1. The arguments are passed by value by default.  If you need to
+//   pass an argument by reference, wrap it inside ByRef().  For
+//   example,
+//
+//     InvokeArgument<1>(5, string("Hello"), ByRef(foo))
+//
+//   passes 5 and string("Hello") by value, and passes foo by
+//   reference.
+//
+//   2. If the callable takes an argument by reference but ByRef() is
+//   not used, it will receive the reference to a copy of the value,
+//   instead of the original value.  For example, when the 0-th
+//   argument of the mock function takes a const string&, the action
+//
+//     InvokeArgument<0>(string("Hello"))
+//
+//   makes a copy of the temporary string("Hello") object and passes a
+//   reference of the copy, instead of the original temporary object,
+//   to the callable.  This makes it easy for a user to define an
+//   InvokeArgument action from temporary values and have it performed
+//   later.
+
+namespace internal {
+namespace invoke_argument {
+
+// Appears in InvokeArgumentAdl's argument list to help avoid
+// accidental calls to user functions of the same name.
+struct AdlTag {};
+
+// InvokeArgumentAdl - a helper for InvokeArgument.
+// The basic overloads are provided here for generic functors.
+// Overloads for other custom-callables are provided in the
+// internal/custom/callback-actions.h header.
+
+$range i 0..n
+$for i
+[[
+$range j 1..i
+
+template <typename R, typename F[[$for j [[, typename A$j]]]]>
+R InvokeArgumentAdl(AdlTag, F f[[$for j [[, A$j a$j]]]]) {
+  return f([[$for j, [[a$j]]]]);
+}
+]]
+
+}  // namespace invoke_argument
+}  // namespace internal
+
+$range i 0..n
+$for i [[
+$range j 0..i-1
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args)$for j [[, p$j]]);
+}
+
+]]
+
+// Various overloads for ReturnNew<T>().
+//
+// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
+// instance of type T, constructed on the heap with constructor arguments
+// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
+$range i 0..n
+$for i [[
+$range j 0..i-1
+$var ps = [[$for j, [[p$j]]]]
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_$i[[]]_VALUE_PARAMS($ps)) {
+  return new T($ps);
+}
+
+]]
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+}  // namespace testing
+
+// Include any custom callback actions added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-generated-actions.h"
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-function-mockers.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-function-mockers.h
new file mode 100644
index 0000000..4fa5ca9
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-function-mockers.h
@@ -0,0 +1,1095 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-function-mockers.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 implements function mockers of various arities.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-internal-utils.h"
+
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
+namespace testing {
+namespace internal {
+
+template <typename F>
+class FunctionMockerBase;
+
+// Note: class FunctionMocker really belongs to the ::testing
+// namespace.  However if we define it in ::testing, MSVC will
+// complain when classes in ::testing::internal declare it as a
+// friend class template.  To workaround this compiler bug, we define
+// FunctionMocker in ::testing::internal and import it into ::testing.
+template <typename F>
+class FunctionMocker;
+
+template <typename R>
+class FunctionMocker<R()> : public
+    internal::FunctionMockerBase<R()> {
+ public:
+  typedef R F();
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With() {
+    return this->current_spec();
+  }
+
+  R Invoke() {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple());
+  }
+};
+
+template <typename R, typename A1>
+class FunctionMocker<R(A1)> : public
+    internal::FunctionMockerBase<R(A1)> {
+ public:
+  typedef R F(A1);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1));
+  }
+};
+
+template <typename R, typename A1, typename A2>
+class FunctionMocker<R(A1, A2)> : public
+    internal::FunctionMockerBase<R(A1, A2)> {
+ public:
+  typedef R F(A1, A2);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+class FunctionMocker<R(A1, A2, A3)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3)> {
+ public:
+  typedef R F(A1, A2, A3);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+class FunctionMocker<R(A1, A2, A3, A4)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
+ public:
+  typedef R F(A1, A2, A3, A4);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7, m8));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
+      const Matcher<A9>& m9) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7, m8, m9));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9,
+    typename A10>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
+      const Matcher<A9>& m9, const Matcher<A10>& m10) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7, m8, m9, m10));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
+      A10 a10) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+        a10));
+  }
+};
+
+}  // namespace internal
+
+// The style guide prohibits "using" statements in a namespace scope
+// inside a header file.  However, the FunctionMocker class template
+// is meant to be defined in the ::testing namespace.  The following
+// line is just a trick for working around a bug in MSVC 8.0, which
+// cannot handle it if we define FunctionMocker in ::testing.
+using internal::FunctionMocker;
+
+// GMOCK_RESULT_(tn, F) expands to the result type of function type F.
+// We define this as a variadic macro in case F contains unprotected
+// commas (the same reason that we use variadic macros in other places
+// in this file).
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_RESULT_(tn, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Result
+
+// The type of argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_ARG_(tn, N, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
+
+// The matcher type for argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MATCHER_(tn, N, ...) \
+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
+
+// The variable for mocking the given method.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MOCKER_(arity, constness, Method) \
+    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      ) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 0), \
+        this_method_does_not_take_0_arguments); \
+    GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method() constness { \
+    GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(0, constness, Method).With(); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 1), \
+        this_method_does_not_take_1_argument); \
+    GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
+    GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 2), \
+        this_method_does_not_take_2_arguments); \
+    GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
+    GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 3), \
+        this_method_does_not_take_3_arguments); \
+    GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
+    GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 4), \
+        this_method_does_not_take_4_arguments); \
+    GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
+    GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 5), \
+        this_method_does_not_take_5_arguments); \
+    GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
+    GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 6), \
+        this_method_does_not_take_6_arguments); \
+    GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
+    GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 7), \
+        this_method_does_not_take_7_arguments); \
+    GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
+    GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 8), \
+        this_method_does_not_take_8_arguments); \
+    GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
+    GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
+      GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 9), \
+        this_method_does_not_take_9_arguments); \
+    GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
+        gmock_a9); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
+                     GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
+    GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
+        gmock_a9); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
+      GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
+      GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 10), \
+        this_method_does_not_take_10_arguments); \
+    GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
+        gmock_a10); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
+                     GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
+                     GMOCK_MATCHER_(tn, 10, \
+                         __VA_ARGS__) gmock_a10) constness { \
+    GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
+        gmock_a10); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
+      Method)
+
+#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
+
+#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0_T(m, ...) \
+    GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1_T(m, ...) \
+    GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2_T(m, ...) \
+    GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3_T(m, ...) \
+    GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4_T(m, ...) \
+    GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5_T(m, ...) \
+    GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6_T(m, ...) \
+    GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7_T(m, ...) \
+    GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8_T(m, ...) \
+    GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9_T(m, ...) \
+    GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10_T(m, ...) \
+    GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
+
+#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
+
+#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
+
+// A MockFunction<F> class has one mock method whose type is F.  It is
+// useful when you just want your test code to emit some messages and
+// have Google Mock verify the right messages are sent (and perhaps at
+// the right times).  For example, if you are exercising code:
+//
+//   Foo(1);
+//   Foo(2);
+//   Foo(3);
+//
+// and want to verify that Foo(1) and Foo(3) both invoke
+// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
+//
+// TEST(FooTest, InvokesBarCorrectly) {
+//   MyMock mock;
+//   MockFunction<void(string check_point_name)> check;
+//   {
+//     InSequence s;
+//
+//     EXPECT_CALL(mock, Bar("a"));
+//     EXPECT_CALL(check, Call("1"));
+//     EXPECT_CALL(check, Call("2"));
+//     EXPECT_CALL(mock, Bar("a"));
+//   }
+//   Foo(1);
+//   check.Call("1");
+//   Foo(2);
+//   check.Call("2");
+//   Foo(3);
+// }
+//
+// The expectation spec says that the first Bar("a") must happen
+// before check point "1", the second Bar("a") must happen after check
+// point "2", and nothing should happen between the two check
+// points. The explicit check points make it easy to tell which
+// Bar("a") is called by which call to Foo().
+//
+// MockFunction<F> can also be used to exercise code that accepts
+// std::function<F> callbacks. To do so, use AsStdFunction() method
+// to create std::function proxy forwarding to original object's Call.
+// Example:
+//
+// TEST(FooTest, RunsCallbackWithBarArgument) {
+//   MockFunction<int(string)> callback;
+//   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
+//   Foo(callback.AsStdFunction());
+// }
+template <typename F>
+class MockFunction;
+
+template <typename R>
+class MockFunction<R()> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD0_T(Call, R());
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R()> AsStdFunction() {
+    return [this]() -> R {
+      return this->Call();
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0>
+class MockFunction<R(A0)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD1_T(Call, R(A0));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0)> AsStdFunction() {
+    return [this](A0 a0) -> R {
+      return this->Call(a0);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1>
+class MockFunction<R(A0, A1)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD2_T(Call, R(A0, A1));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1)> AsStdFunction() {
+    return [this](A0 a0, A1 a1) -> R {
+      return this->Call(a0, a1);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2>
+class MockFunction<R(A0, A1, A2)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD3_T(Call, R(A0, A1, A2));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2) -> R {
+      return this->Call(a0, a1, a2);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3>
+class MockFunction<R(A0, A1, A2, A3)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
+      return this->Call(a0, a1, a2, a3);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4>
+class MockFunction<R(A0, A1, A2, A3, A4)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
+      return this->Call(a0, a1, a2, a3, a4);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+        A8 a8) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+        A8 a8, A9 a9) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump
new file mode 100644
index 0000000..811502d
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump
@@ -0,0 +1,291 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-function-mockers.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+// 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 function mockers of various arities.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-internal-utils.h"
+
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
+namespace testing {
+namespace internal {
+
+template <typename F>
+class FunctionMockerBase;
+
+// Note: class FunctionMocker really belongs to the ::testing
+// namespace.  However if we define it in ::testing, MSVC will
+// complain when classes in ::testing::internal declare it as a
+// friend class template.  To workaround this compiler bug, we define
+// FunctionMocker in ::testing::internal and import it into ::testing.
+template <typename F>
+class FunctionMocker;
+
+
+$range i 0..n
+$for i [[
+$range j 1..i
+$var typename_As = [[$for j [[, typename A$j]]]]
+$var As = [[$for j, [[A$j]]]]
+$var as = [[$for j, [[a$j]]]]
+$var Aas = [[$for j, [[A$j a$j]]]]
+$var ms = [[$for j, [[m$j]]]]
+$var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]]
+template <typename R$typename_As>
+class FunctionMocker<R($As)> : public
+    internal::FunctionMockerBase<R($As)> {
+ public:
+  typedef R F($As);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With($matchers) {
+
+$if i >= 1 [[
+    this->current_spec().SetMatchers(::testing::make_tuple($ms));
+
+]]
+    return this->current_spec();
+  }
+
+  R Invoke($Aas) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple($as));
+  }
+};
+
+
+]]
+}  // namespace internal
+
+// The style guide prohibits "using" statements in a namespace scope
+// inside a header file.  However, the FunctionMocker class template
+// is meant to be defined in the ::testing namespace.  The following
+// line is just a trick for working around a bug in MSVC 8.0, which
+// cannot handle it if we define FunctionMocker in ::testing.
+using internal::FunctionMocker;
+
+// GMOCK_RESULT_(tn, F) expands to the result type of function type F.
+// We define this as a variadic macro in case F contains unprotected
+// commas (the same reason that we use variadic macros in other places
+// in this file).
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_RESULT_(tn, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Result
+
+// The type of argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_ARG_(tn, N, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
+
+// The matcher type for argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MATCHER_(tn, N, ...) \
+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
+
+// The variable for mocking the given method.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MOCKER_(arity, constness, Method) \
+    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
+
+
+$for i [[
+$range j 1..i
+$var arg_as = [[$for j, \
+      [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
+$var as = [[$for j, [[gmock_a$j]]]]
+$var matcher_as = [[$for j, \
+                     [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      $arg_as) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
+        this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
+    GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method($matcher_as) constness { \
+    GMOCK_MOCKER_($i, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_($i, constness, Method).With($as); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_($i, constness, Method)
+
+
+]]
+$for i [[
+#define MOCK_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, , , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, const, , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_METHOD$i[[]]_T(m, ...) GMOCK_METHOD$i[[]]_(typename, , , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i[[]]_T(m, ...) \
+    GMOCK_METHOD$i[[]]_(typename, const, , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(, , ct, m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(, const, ct, m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(typename, , ct, m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(typename, const, ct, m, __VA_ARGS__)
+
+]]
+
+// A MockFunction<F> class has one mock method whose type is F.  It is
+// useful when you just want your test code to emit some messages and
+// have Google Mock verify the right messages are sent (and perhaps at
+// the right times).  For example, if you are exercising code:
+//
+//   Foo(1);
+//   Foo(2);
+//   Foo(3);
+//
+// and want to verify that Foo(1) and Foo(3) both invoke
+// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
+//
+// TEST(FooTest, InvokesBarCorrectly) {
+//   MyMock mock;
+//   MockFunction<void(string check_point_name)> check;
+//   {
+//     InSequence s;
+//
+//     EXPECT_CALL(mock, Bar("a"));
+//     EXPECT_CALL(check, Call("1"));
+//     EXPECT_CALL(check, Call("2"));
+//     EXPECT_CALL(mock, Bar("a"));
+//   }
+//   Foo(1);
+//   check.Call("1");
+//   Foo(2);
+//   check.Call("2");
+//   Foo(3);
+// }
+//
+// The expectation spec says that the first Bar("a") must happen
+// before check point "1", the second Bar("a") must happen after check
+// point "2", and nothing should happen between the two check
+// points. The explicit check points make it easy to tell which
+// Bar("a") is called by which call to Foo().
+//
+// MockFunction<F> can also be used to exercise code that accepts
+// std::function<F> callbacks. To do so, use AsStdFunction() method
+// to create std::function proxy forwarding to original object's Call.
+// Example:
+//
+// TEST(FooTest, RunsCallbackWithBarArgument) {
+//   MockFunction<int(string)> callback;
+//   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
+//   Foo(callback.AsStdFunction());
+// }
+template <typename F>
+class MockFunction;
+
+
+$for i [[
+$range j 0..i-1
+$var ArgTypes = [[$for j, [[A$j]]]]
+$var ArgNames = [[$for j, [[a$j]]]]
+$var ArgDecls = [[$for j, [[A$j a$j]]]]
+template <typename R$for j [[, typename A$j]]>
+class MockFunction<R($ArgTypes)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD$i[[]]_T(Call, R($ArgTypes));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R($ArgTypes)> AsStdFunction() {
+    return [this]($ArgDecls) -> R {
+      return this->Call($ArgNames);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+
+]]
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-matchers.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-matchers.h
new file mode 100644
index 0000000..57056fd
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-matchers.h
@@ -0,0 +1,2179 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-matchers.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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.
+
+// Google Mock - a framework for writing C++ mock classes.
+//
+// This file implements some commonly used variadic matchers.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+
+#include <iterator>
+#include <sstream>
+#include <string>
+#include <vector>
+#include "gmock/gmock-matchers.h"
+
+namespace testing {
+namespace internal {
+
+// The type of the i-th (0-based) field of Tuple.
+#define GMOCK_FIELD_TYPE_(Tuple, i) \
+    typename ::testing::tuple_element<i, Tuple>::type
+
+// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
+// tuple of type Tuple.  It has two members:
+//
+//   type: a tuple type whose i-th field is the ki-th field of Tuple.
+//   GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
+//
+// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
+//
+//   type is tuple<int, bool>, and
+//   GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
+
+template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
+    int k9 = -1>
+class TupleFields;
+
+// This generic version is used when there are 10 selectors.
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
+    int k7, int k8, int k9>
+class TupleFields {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
+      GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
+      GMOCK_FIELD_TYPE_(Tuple, k9)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
+  }
+};
+
+// The following specialization is used for 0 ~ 9 selectors.
+
+template <class Tuple>
+class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<> type;
+  static type GetSelectedFields(const Tuple& /* t */) {
+    return type();
+  }
+};
+
+template <class Tuple, int k0>
+class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1>
+class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2>
+class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3>
+class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
+    int k7>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
+      GMOCK_FIELD_TYPE_(Tuple, k7)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t), get<k7>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
+    int k7, int k8>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
+      GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
+  }
+};
+
+#undef GMOCK_FIELD_TYPE_
+
+// Implements the Args() matcher.
+template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
+    int k9 = -1>
+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
+ public:
+  // ArgsTuple may have top-level const or reference modifiers.
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
+  typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,
+      k6, k7, k8, k9>::type SelectedArgs;
+  typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
+
+  template <typename InnerMatcher>
+  explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
+      : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
+
+  virtual bool MatchAndExplain(ArgsTuple args,
+                               MatchResultListener* listener) const {
+    const SelectedArgs& selected_args = GetSelectedArgs(args);
+    if (!listener->IsInterested())
+      return inner_matcher_.Matches(selected_args);
+
+    PrintIndices(listener->stream());
+    *listener << "are " << PrintToString(selected_args);
+
+    StringMatchResultListener inner_listener;
+    const bool match = inner_matcher_.MatchAndExplain(selected_args,
+                                                      &inner_listener);
+    PrintIfNotEmpty(inner_listener.str(), listener->stream());
+    return match;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeNegationTo(os);
+  }
+
+ private:
+  static SelectedArgs GetSelectedArgs(ArgsTuple args) {
+    return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,
+        k9>::GetSelectedFields(args);
+  }
+
+  // Prints the indices of the selected fields.
+  static void PrintIndices(::std::ostream* os) {
+    *os << "whose fields (";
+    const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };
+    for (int i = 0; i < 10; i++) {
+      if (indices[i] < 0)
+        break;
+
+      if (i >= 1)
+        *os << ", ";
+
+      *os << "#" << indices[i];
+    }
+    *os << ") ";
+  }
+
+  const MonomorphicInnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
+};
+
+template <class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,
+    int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,
+    int k8 = -1, int k9 = -1>
+class ArgsMatcher {
+ public:
+  explicit ArgsMatcher(const InnerMatcher& inner_matcher)
+      : inner_matcher_(inner_matcher) {}
+
+  template <typename ArgsTuple>
+  operator Matcher<ArgsTuple>() const {
+    return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,
+        k6, k7, k8, k9>(inner_matcher_));
+  }
+
+ private:
+  const InnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
+};
+
+// A set of metafunctions for computing the result type of AllOf.
+// AllOf(m1, ..., mN) returns
+// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AllOf isn't defined for one argument, AllOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AllOfResult1 {
+  typedef M1 type;
+};
+
+template <typename M1, typename M2>
+struct AllOfResult2 {
+  typedef BothOfMatcher<
+      typename AllOfResult1<M1>::type,
+      typename AllOfResult1<M2>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3>
+struct AllOfResult3 {
+  typedef BothOfMatcher<
+      typename AllOfResult1<M1>::type,
+      typename AllOfResult2<M2, M3>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4>
+struct AllOfResult4 {
+  typedef BothOfMatcher<
+      typename AllOfResult2<M1, M2>::type,
+      typename AllOfResult2<M3, M4>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+struct AllOfResult5 {
+  typedef BothOfMatcher<
+      typename AllOfResult2<M1, M2>::type,
+      typename AllOfResult3<M3, M4, M5>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+struct AllOfResult6 {
+  typedef BothOfMatcher<
+      typename AllOfResult3<M1, M2, M3>::type,
+      typename AllOfResult3<M4, M5, M6>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+struct AllOfResult7 {
+  typedef BothOfMatcher<
+      typename AllOfResult3<M1, M2, M3>::type,
+      typename AllOfResult4<M4, M5, M6, M7>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+struct AllOfResult8 {
+  typedef BothOfMatcher<
+      typename AllOfResult4<M1, M2, M3, M4>::type,
+      typename AllOfResult4<M5, M6, M7, M8>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+struct AllOfResult9 {
+  typedef BothOfMatcher<
+      typename AllOfResult4<M1, M2, M3, M4>::type,
+      typename AllOfResult5<M5, M6, M7, M8, M9>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+struct AllOfResult10 {
+  typedef BothOfMatcher<
+      typename AllOfResult5<M1, M2, M3, M4, M5>::type,
+      typename AllOfResult5<M6, M7, M8, M9, M10>::type
+  > type;
+};
+
+// A set of metafunctions for computing the result type of AnyOf.
+// AnyOf(m1, ..., mN) returns
+// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AnyOfResult1 {
+  typedef M1 type;
+};
+
+template <typename M1, typename M2>
+struct AnyOfResult2 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult1<M1>::type,
+      typename AnyOfResult1<M2>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3>
+struct AnyOfResult3 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult1<M1>::type,
+      typename AnyOfResult2<M2, M3>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4>
+struct AnyOfResult4 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult2<M1, M2>::type,
+      typename AnyOfResult2<M3, M4>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+struct AnyOfResult5 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult2<M1, M2>::type,
+      typename AnyOfResult3<M3, M4, M5>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+struct AnyOfResult6 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult3<M1, M2, M3>::type,
+      typename AnyOfResult3<M4, M5, M6>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+struct AnyOfResult7 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult3<M1, M2, M3>::type,
+      typename AnyOfResult4<M4, M5, M6, M7>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+struct AnyOfResult8 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult4<M1, M2, M3, M4>::type,
+      typename AnyOfResult4<M5, M6, M7, M8>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+struct AnyOfResult9 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult4<M1, M2, M3, M4>::type,
+      typename AnyOfResult5<M5, M6, M7, M8, M9>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+struct AnyOfResult10 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult5<M1, M2, M3, M4, M5>::type,
+      typename AnyOfResult5<M6, M7, M8, M9, M10>::type
+  > type;
+};
+
+}  // namespace internal
+
+// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
+// fields of it matches a_matcher.  C++ doesn't support default
+// arguments for function templates, so we have to overload it.
+template <typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher>(matcher);
+}
+
+template <int k1, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1>(matcher);
+}
+
+template <int k1, int k2, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2>(matcher);
+}
+
+template <int k1, int k2, int k3, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
+    typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6,
+      k7>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7,
+      k8>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, int k10, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,
+    k10>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9, k10>(matcher);
+}
+
+// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
+// n elements, where the i-th element in the container must
+// match the i-th argument in the list.  Each argument of
+// ElementsAre() can be either a value or a matcher.  We support up to
+// 10 arguments.
+//
+// The use of DecayArray in the implementation allows ElementsAre()
+// to accept string literals, whose type is const char[N], but we
+// want to treat them as const char*.
+//
+// NOTE: Since ElementsAre() cares about the order of the elements, it
+// must not be used with containers whose elements's order is
+// undefined (e.g. hash_map).
+
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<> >
+ElementsAre() {
+  typedef ::testing::tuple<> Args;
+  return internal::ElementsAreMatcher<Args>(Args());
+}
+
+template <typename T1>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type> >
+ElementsAre(const T1& e1) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1));
+}
+
+template <typename T1, typename T2>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type> >
+ElementsAre(const T1& e1, const T2& e2) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2));
+}
+
+template <typename T1, typename T2, typename T3>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3));
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
+      e8));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
+      e8, e9));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type,
+        typename internal::DecayArray<T10>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
+    const T10& e10) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type,
+      typename internal::DecayArray<T10>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
+      e8, e9, e10));
+}
+
+// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
+// that matches n elements in any order.  We support up to n=10 arguments.
+
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<> >
+UnorderedElementsAre() {
+  typedef ::testing::tuple<> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args());
+}
+
+template <typename T1>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type> >
+UnorderedElementsAre(const T1& e1) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1));
+}
+
+template <typename T1, typename T2>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2));
+}
+
+template <typename T1, typename T2, typename T3>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3));
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7, e8));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7, e8, e9));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type,
+        typename internal::DecayArray<T10>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
+    const T10& e10) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type,
+      typename internal::DecayArray<T10>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7, e8, e9, e10));
+}
+
+// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
+// sub-matchers.  AllOf is called fully qualified to prevent ADL from firing.
+
+template <typename M1, typename M2>
+inline typename internal::AllOfResult2<M1, M2>::type
+AllOf(M1 m1, M2 m2) {
+  return typename internal::AllOfResult2<M1, M2>::type(
+      m1,
+      m2);
+}
+
+template <typename M1, typename M2, typename M3>
+inline typename internal::AllOfResult3<M1, M2, M3>::type
+AllOf(M1 m1, M2 m2, M3 m3) {
+  return typename internal::AllOfResult3<M1, M2, M3>::type(
+      m1,
+      ::testing::AllOf(m2, m3));
+}
+
+template <typename M1, typename M2, typename M3, typename M4>
+inline typename internal::AllOfResult4<M1, M2, M3, M4>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4) {
+  return typename internal::AllOfResult4<M1, M2, M3, M4>::type(
+      ::testing::AllOf(m1, m2),
+      ::testing::AllOf(m3, m4));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
+  return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type(
+      ::testing::AllOf(m1, m2),
+      ::testing::AllOf(m3, m4, m5));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
+  return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type(
+      ::testing::AllOf(m1, m2, m3),
+      ::testing::AllOf(m4, m5, m6));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
+  return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
+      ::testing::AllOf(m1, m2, m3),
+      ::testing::AllOf(m4, m5, m6, m7));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
+  return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
+      ::testing::AllOf(m1, m2, m3, m4),
+      ::testing::AllOf(m5, m6, m7, m8));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
+  return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
+      M9>::type(
+      ::testing::AllOf(m1, m2, m3, m4),
+      ::testing::AllOf(m5, m6, m7, m8, m9));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+    M10>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
+  return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+      M10>::type(
+      ::testing::AllOf(m1, m2, m3, m4, m5),
+      ::testing::AllOf(m6, m7, m8, m9, m10));
+}
+
+// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
+// sub-matchers.  AnyOf is called fully qualified to prevent ADL from firing.
+
+template <typename M1, typename M2>
+inline typename internal::AnyOfResult2<M1, M2>::type
+AnyOf(M1 m1, M2 m2) {
+  return typename internal::AnyOfResult2<M1, M2>::type(
+      m1,
+      m2);
+}
+
+template <typename M1, typename M2, typename M3>
+inline typename internal::AnyOfResult3<M1, M2, M3>::type
+AnyOf(M1 m1, M2 m2, M3 m3) {
+  return typename internal::AnyOfResult3<M1, M2, M3>::type(
+      m1,
+      ::testing::AnyOf(m2, m3));
+}
+
+template <typename M1, typename M2, typename M3, typename M4>
+inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) {
+  return typename internal::AnyOfResult4<M1, M2, M3, M4>::type(
+      ::testing::AnyOf(m1, m2),
+      ::testing::AnyOf(m3, m4));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
+  return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type(
+      ::testing::AnyOf(m1, m2),
+      ::testing::AnyOf(m3, m4, m5));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
+  return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type(
+      ::testing::AnyOf(m1, m2, m3),
+      ::testing::AnyOf(m4, m5, m6));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
+  return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
+      ::testing::AnyOf(m1, m2, m3),
+      ::testing::AnyOf(m4, m5, m6, m7));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
+  return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
+      ::testing::AnyOf(m1, m2, m3, m4),
+      ::testing::AnyOf(m5, m6, m7, m8));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
+  return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
+      M9>::type(
+      ::testing::AnyOf(m1, m2, m3, m4),
+      ::testing::AnyOf(m5, m6, m7, m8, m9));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+    M10>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
+  return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+      M10>::type(
+      ::testing::AnyOf(m1, m2, m3, m4, m5),
+      ::testing::AnyOf(m6, m7, m8, m9, m10));
+}
+
+}  // namespace testing
+
+
+// The MATCHER* family of macros can be used in a namespace scope to
+// define custom matchers easily.
+//
+// Basic Usage
+// ===========
+//
+// The syntax
+//
+//   MATCHER(name, description_string) { statements; }
+//
+// defines a matcher with the given name that executes the statements,
+// which must return a bool to indicate if the match succeeds.  Inside
+// the statements, you can refer to the value being matched by 'arg',
+// and refer to its type by 'arg_type'.
+//
+// The description string documents what the matcher does, and is used
+// to generate the failure message when the match fails.  Since a
+// MATCHER() is usually defined in a header file shared by multiple
+// C++ source files, we require the description to be a C-string
+// literal to avoid possible side effects.  It can be empty, in which
+// case we'll use the sequence of words in the matcher name as the
+// description.
+//
+// For example:
+//
+//   MATCHER(IsEven, "") { return (arg % 2) == 0; }
+//
+// allows you to write
+//
+//   // Expects mock_foo.Bar(n) to be called where n is even.
+//   EXPECT_CALL(mock_foo, Bar(IsEven()));
+//
+// or,
+//
+//   // Verifies that the value of some_expression is even.
+//   EXPECT_THAT(some_expression, IsEven());
+//
+// If the above assertion fails, it will print something like:
+//
+//   Value of: some_expression
+//   Expected: is even
+//     Actual: 7
+//
+// where the description "is even" is automatically calculated from the
+// matcher name IsEven.
+//
+// Argument Type
+// =============
+//
+// Note that the type of the value being matched (arg_type) is
+// determined by the context in which you use the matcher and is
+// supplied to you by the compiler, so you don't need to worry about
+// declaring it (nor can you).  This allows the matcher to be
+// polymorphic.  For example, IsEven() can be used to match any type
+// where the value of "(arg % 2) == 0" can be implicitly converted to
+// a bool.  In the "Bar(IsEven())" example above, if method Bar()
+// takes an int, 'arg_type' will be int; if it takes an unsigned long,
+// 'arg_type' will be unsigned long; and so on.
+//
+// Parameterizing Matchers
+// =======================
+//
+// Sometimes you'll want to parameterize the matcher.  For that you
+// can use another macro:
+//
+//   MATCHER_P(name, param_name, description_string) { statements; }
+//
+// For example:
+//
+//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
+//
+// will allow you to write:
+//
+//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
+//
+// which may lead to this message (assuming n is 10):
+//
+//   Value of: Blah("a")
+//   Expected: has absolute value 10
+//     Actual: -9
+//
+// Note that both the matcher description and its parameter are
+// printed, making the message human-friendly.
+//
+// In the matcher definition body, you can write 'foo_type' to
+// reference the type of a parameter named 'foo'.  For example, in the
+// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
+// 'value_type' to refer to the type of 'value'.
+//
+// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
+// support multi-parameter matchers.
+//
+// Describing Parameterized Matchers
+// =================================
+//
+// The last argument to MATCHER*() is a string-typed expression.  The
+// expression can reference all of the matcher's parameters and a
+// special bool-typed variable named 'negation'.  When 'negation' is
+// false, the expression should evaluate to the matcher's description;
+// otherwise it should evaluate to the description of the negation of
+// the matcher.  For example,
+//
+//   using testing::PrintToString;
+//
+//   MATCHER_P2(InClosedRange, low, hi,
+//       string(negation ? "is not" : "is") + " in range [" +
+//       PrintToString(low) + ", " + PrintToString(hi) + "]") {
+//     return low <= arg && arg <= hi;
+//   }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: is in range [4, 6]
+//   ...
+//   Expected: is not in range [2, 4]
+//
+// If you specify "" as the description, the failure message will
+// contain the sequence of words in the matcher name followed by the
+// parameter values printed as a tuple.  For example,
+//
+//   MATCHER_P2(InClosedRange, low, hi, "") { ... }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: in closed range (4, 6)
+//   ...
+//   Expected: not (in closed range (2, 4))
+//
+// Types of Matcher Parameters
+// ===========================
+//
+// For the purpose of typing, you can view
+//
+//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooMatcherPk<p1_type, ..., pk_type>
+//   Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// When you write Foo(v1, ..., vk), the compiler infers the types of
+// the parameters v1, ..., and vk for you.  If you are not happy with
+// the result of the type inference, you can specify the types by
+// explicitly instantiating the template, as in Foo<long, bool>(5,
+// false).  As said earlier, you don't get to (or need to) specify
+// 'arg_type' as that's determined by the context in which the matcher
+// is used.  You can assign the result of expression Foo(p1, ..., pk)
+// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This
+// can be useful when composing matchers.
+//
+// While you can instantiate a matcher template with reference types,
+// passing the parameters by pointer usually makes your code more
+// readable.  If, however, you still want to pass a parameter by
+// reference, be aware that in the failure message generated by the
+// matcher you will see the value of the referenced object but not its
+// address.
+//
+// Explaining Match Results
+// ========================
+//
+// Sometimes the matcher description alone isn't enough to explain why
+// the match has failed or succeeded.  For example, when expecting a
+// long string, it can be very helpful to also print the diff between
+// the expected string and the actual one.  To achieve that, you can
+// optionally stream additional information to a special variable
+// named result_listener, whose type is a pointer to class
+// MatchResultListener:
+//
+//   MATCHER_P(EqualsLongString, str, "") {
+//     if (arg == str) return true;
+//
+//     *result_listener << "the difference: "
+///                     << DiffStrings(str, arg);
+//     return false;
+//   }
+//
+// Overloading Matchers
+// ====================
+//
+// You can overload matchers with different numbers of parameters:
+//
+//   MATCHER_P(Blah, a, description_string1) { ... }
+//   MATCHER_P2(Blah, a, b, description_string2) { ... }
+//
+// Caveats
+// =======
+//
+// When defining a new matcher, you should also consider implementing
+// MatcherInterface or using MakePolymorphicMatcher().  These
+// approaches require more work than the MATCHER* macros, but also
+// give you more control on the types of the value being matched and
+// the matcher parameters, which may leads to better compiler error
+// messages when the matcher is used wrong.  They also allow
+// overloading matchers based on parameter types (as opposed to just
+// based on the number of parameters).
+//
+// MATCHER*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using MATCHER*() inside
+// a function.
+//
+// More Information
+// ================
+//
+// To learn more about using these macros, please search for 'MATCHER'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+#define MATCHER(name, description)\
+  class name##Matcher {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl()\
+           {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<>()));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>());\
+    }\
+    name##Matcher() {\
+    }\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##Matcher);\
+  };\
+  inline name##Matcher name() {\
+    return name##Matcher();\
+  }\
+  template <typename arg_type>\
+  bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P(name, p0, description)\
+  template <typename p0##_type>\
+  class name##MatcherP {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      explicit gmock_Impl(p0##_type gmock_p0)\
+           : p0(gmock_p0) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type>(p0)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0));\
+    }\
+    explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
+    }\
+    p0##_type p0;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
+  };\
+  template <typename p0##_type>\
+  inline name##MatcherP<p0##_type> name(p0##_type p0) {\
+    return name##MatcherP<p0##_type>(p0);\
+  }\
+  template <typename p0##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P2(name, p0, p1, description)\
+  template <typename p0##_type, typename p1##_type>\
+  class name##MatcherP2 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
+           : p0(gmock_p0), p1(gmock_p1) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1));\
+    }\
+    name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
+        p1(gmock_p1) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
+  };\
+  template <typename p0##_type, typename p1##_type>\
+  inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
+      p1##_type p1) {\
+    return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
+  }\
+  template <typename p0##_type, typename p1##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP2<p0##_type, \
+      p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P3(name, p0, p1, p2, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  class name##MatcherP3 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
+                    p2)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2));\
+    }\
+    name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2) {\
+    return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP3<p0##_type, p1##_type, \
+      p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P4(name, p0, p1, p2, p3, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  class name##MatcherP4 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, \
+                    p3##_type>(p0, p1, p2, p3)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3));\
+    }\
+    name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
+      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3) {\
+    return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
+        p1, p2, p3);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
+      p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  class name##MatcherP5 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type>(p0, p1, p2, p3, p4)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
+    }\
+    name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, \
+        p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4) {\
+    return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type>(p0, p1, p2, p3, p4);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  class name##MatcherP6 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
+    }\
+    name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3, p4##_type p4, p5##_type p5) {\
+    return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  class name##MatcherP7 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
+                    p6)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
+    }\
+    name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
+        p6(gmock_p6) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
+      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6) {\
+    return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  class name##MatcherP8 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
+                    p3, p4, p5, p6, p7)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
+    }\
+    name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, \
+        p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6, p7##_type p7) {\
+    return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
+        p6, p7);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type, p6##_type, \
+      p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  class name##MatcherP9 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+               p8(gmock_p8) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type, p7##_type, \
+                    p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
+    }\
+    name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, \
+      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
+      p8##_type p8) {\
+    return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
+        p3, p4, p5, p6, p7, p8);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type, p6##_type, p7##_type, \
+      p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  class name##MatcherP10 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
+          p9##_type gmock_p9)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+               p8(gmock_p8), p9(gmock_p9) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+      p9##_type p9;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+                    p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
+    }\
+    name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+    p9##_type p9;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
+      p9##_type p9) {\
+    return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
+        p1, p2, p3, p4, p5, p6, p7, p8, p9);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+      p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-matchers.h.pump b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-matchers.h.pump
new file mode 100644
index 0000000..de30c2c
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-matchers.h.pump
@@ -0,0 +1,672 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-actions.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+$$ }} This line fixes auto-indentation of the following code in Emacs.
+// 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.
+
+// Google Mock - a framework for writing C++ mock classes.
+//
+// This file implements some commonly used variadic matchers.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+
+#include <iterator>
+#include <sstream>
+#include <string>
+#include <vector>
+#include "gmock/gmock-matchers.h"
+
+namespace testing {
+namespace internal {
+
+$range i 0..n-1
+
+// The type of the i-th (0-based) field of Tuple.
+#define GMOCK_FIELD_TYPE_(Tuple, i) \
+    typename ::testing::tuple_element<i, Tuple>::type
+
+// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
+// tuple of type Tuple.  It has two members:
+//
+//   type: a tuple type whose i-th field is the ki-th field of Tuple.
+//   GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
+//
+// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
+//
+//   type is tuple<int, bool>, and
+//   GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
+
+template <class Tuple$for i [[, int k$i = -1]]>
+class TupleFields;
+
+// This generic version is used when there are $n selectors.
+template <class Tuple$for i [[, int k$i]]>
+class TupleFields {
+ public:
+  typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type($for i, [[get<k$i>(t)]]);
+  }
+};
+
+// The following specialization is used for 0 ~ $(n-1) selectors.
+
+$for i [[
+$$ }}}
+$range j 0..i-1
+$range k 0..n-1
+
+template <class Tuple$for j [[, int k$j]]>
+class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> {
+ public:
+  typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type;
+  static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) {
+    return type($for j, [[get<k$j>(t)]]);
+  }
+};
+
+]]
+
+#undef GMOCK_FIELD_TYPE_
+
+// Implements the Args() matcher.
+
+$var ks = [[$for i, [[k$i]]]]
+template <class ArgsTuple$for i [[, int k$i = -1]]>
+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
+ public:
+  // ArgsTuple may have top-level const or reference modifiers.
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
+  typedef typename internal::TupleFields<RawArgsTuple, $ks>::type SelectedArgs;
+  typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
+
+  template <typename InnerMatcher>
+  explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
+      : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
+
+  virtual bool MatchAndExplain(ArgsTuple args,
+                               MatchResultListener* listener) const {
+    const SelectedArgs& selected_args = GetSelectedArgs(args);
+    if (!listener->IsInterested())
+      return inner_matcher_.Matches(selected_args);
+
+    PrintIndices(listener->stream());
+    *listener << "are " << PrintToString(selected_args);
+
+    StringMatchResultListener inner_listener;
+    const bool match = inner_matcher_.MatchAndExplain(selected_args,
+                                                      &inner_listener);
+    PrintIfNotEmpty(inner_listener.str(), listener->stream());
+    return match;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeNegationTo(os);
+  }
+
+ private:
+  static SelectedArgs GetSelectedArgs(ArgsTuple args) {
+    return TupleFields<RawArgsTuple, $ks>::GetSelectedFields(args);
+  }
+
+  // Prints the indices of the selected fields.
+  static void PrintIndices(::std::ostream* os) {
+    *os << "whose fields (";
+    const int indices[$n] = { $ks };
+    for (int i = 0; i < $n; i++) {
+      if (indices[i] < 0)
+        break;
+
+      if (i >= 1)
+        *os << ", ";
+
+      *os << "#" << indices[i];
+    }
+    *os << ") ";
+  }
+
+  const MonomorphicInnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
+};
+
+template <class InnerMatcher$for i [[, int k$i = -1]]>
+class ArgsMatcher {
+ public:
+  explicit ArgsMatcher(const InnerMatcher& inner_matcher)
+      : inner_matcher_(inner_matcher) {}
+
+  template <typename ArgsTuple>
+  operator Matcher<ArgsTuple>() const {
+    return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, $ks>(inner_matcher_));
+  }
+
+ private:
+  const InnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
+};
+
+// A set of metafunctions for computing the result type of AllOf.
+// AllOf(m1, ..., mN) returns
+// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AllOf isn't defined for one argument, AllOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AllOfResult1 {
+  typedef M1 type;
+};
+
+$range i 1..n
+
+$range i 2..n
+$for i [[
+$range j 2..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <typename M1$for j [[, typename M$j]]>
+struct AllOfResult$i {
+  typedef BothOfMatcher<
+      typename AllOfResult$m<$for k, [[M$k]]>::type,
+      typename AllOfResult$(i-m)<$for t, [[M$t]]>::type
+  > type;
+};
+
+]]
+
+// A set of metafunctions for computing the result type of AnyOf.
+// AnyOf(m1, ..., mN) returns
+// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AnyOfResult1 {
+  typedef M1 type;
+};
+
+$range i 1..n
+
+$range i 2..n
+$for i [[
+$range j 2..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <typename M1$for j [[, typename M$j]]>
+struct AnyOfResult$i {
+  typedef EitherOfMatcher<
+      typename AnyOfResult$m<$for k, [[M$k]]>::type,
+      typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type
+  > type;
+};
+
+]]
+
+}  // namespace internal
+
+// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
+// fields of it matches a_matcher.  C++ doesn't support default
+// arguments for function templates, so we have to overload it.
+
+$range i 0..n
+$for i [[
+$range j 1..i
+template <$for j [[int k$j, ]]typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>(matcher);
+}
+
+
+]]
+// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
+// n elements, where the i-th element in the container must
+// match the i-th argument in the list.  Each argument of
+// ElementsAre() can be either a value or a matcher.  We support up to
+// $n arguments.
+//
+// The use of DecayArray in the implementation allows ElementsAre()
+// to accept string literals, whose type is const char[N], but we
+// want to treat them as const char*.
+//
+// NOTE: Since ElementsAre() cares about the order of the elements, it
+// must not be used with containers whose elements's order is
+// undefined (e.g. hash_map).
+
+$range i 0..n
+$for i [[
+
+$range j 1..i
+
+$if i>0 [[
+
+template <$for j, [[typename T$j]]>
+]]
+
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+$for j, [[
+
+        typename internal::DecayArray<T$j[[]]>::type]]> >
+ElementsAre($for j, [[const T$j& e$j]]) {
+  typedef ::testing::tuple<
+$for j, [[
+
+      typename internal::DecayArray<T$j[[]]>::type]]> Args;
+  return internal::ElementsAreMatcher<Args>(Args($for j, [[e$j]]));
+}
+
+]]
+
+// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
+// that matches n elements in any order.  We support up to n=$n arguments.
+
+$range i 0..n
+$for i [[
+
+$range j 1..i
+
+$if i>0 [[
+
+template <$for j, [[typename T$j]]>
+]]
+
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+$for j, [[
+
+        typename internal::DecayArray<T$j[[]]>::type]]> >
+UnorderedElementsAre($for j, [[const T$j& e$j]]) {
+  typedef ::testing::tuple<
+$for j, [[
+
+      typename internal::DecayArray<T$j[[]]>::type]]> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args($for j, [[e$j]]));
+}
+
+]]
+
+// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
+// sub-matchers.  AllOf is called fully qualified to prevent ADL from firing.
+
+$range i 2..n
+$for i [[
+$range j 1..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <$for j, [[typename M$j]]>
+inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type
+AllOf($for j, [[M$j m$j]]) {
+  return typename internal::AllOfResult$i<$for j, [[M$j]]>::type(
+      $if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]],
+      $if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]);
+}
+
+]]
+
+// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
+// sub-matchers.  AnyOf is called fully qualified to prevent ADL from firing.
+
+$range i 2..n
+$for i [[
+$range j 1..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <$for j, [[typename M$j]]>
+inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type
+AnyOf($for j, [[M$j m$j]]) {
+  return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type(
+      $if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]],
+      $if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]);
+}
+
+]]
+
+}  // namespace testing
+$$ } // This Pump meta comment fixes auto-indentation in Emacs. It will not
+$$   // show up in the generated code.
+
+
+// The MATCHER* family of macros can be used in a namespace scope to
+// define custom matchers easily.
+//
+// Basic Usage
+// ===========
+//
+// The syntax
+//
+//   MATCHER(name, description_string) { statements; }
+//
+// defines a matcher with the given name that executes the statements,
+// which must return a bool to indicate if the match succeeds.  Inside
+// the statements, you can refer to the value being matched by 'arg',
+// and refer to its type by 'arg_type'.
+//
+// The description string documents what the matcher does, and is used
+// to generate the failure message when the match fails.  Since a
+// MATCHER() is usually defined in a header file shared by multiple
+// C++ source files, we require the description to be a C-string
+// literal to avoid possible side effects.  It can be empty, in which
+// case we'll use the sequence of words in the matcher name as the
+// description.
+//
+// For example:
+//
+//   MATCHER(IsEven, "") { return (arg % 2) == 0; }
+//
+// allows you to write
+//
+//   // Expects mock_foo.Bar(n) to be called where n is even.
+//   EXPECT_CALL(mock_foo, Bar(IsEven()));
+//
+// or,
+//
+//   // Verifies that the value of some_expression is even.
+//   EXPECT_THAT(some_expression, IsEven());
+//
+// If the above assertion fails, it will print something like:
+//
+//   Value of: some_expression
+//   Expected: is even
+//     Actual: 7
+//
+// where the description "is even" is automatically calculated from the
+// matcher name IsEven.
+//
+// Argument Type
+// =============
+//
+// Note that the type of the value being matched (arg_type) is
+// determined by the context in which you use the matcher and is
+// supplied to you by the compiler, so you don't need to worry about
+// declaring it (nor can you).  This allows the matcher to be
+// polymorphic.  For example, IsEven() can be used to match any type
+// where the value of "(arg % 2) == 0" can be implicitly converted to
+// a bool.  In the "Bar(IsEven())" example above, if method Bar()
+// takes an int, 'arg_type' will be int; if it takes an unsigned long,
+// 'arg_type' will be unsigned long; and so on.
+//
+// Parameterizing Matchers
+// =======================
+//
+// Sometimes you'll want to parameterize the matcher.  For that you
+// can use another macro:
+//
+//   MATCHER_P(name, param_name, description_string) { statements; }
+//
+// For example:
+//
+//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
+//
+// will allow you to write:
+//
+//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
+//
+// which may lead to this message (assuming n is 10):
+//
+//   Value of: Blah("a")
+//   Expected: has absolute value 10
+//     Actual: -9
+//
+// Note that both the matcher description and its parameter are
+// printed, making the message human-friendly.
+//
+// In the matcher definition body, you can write 'foo_type' to
+// reference the type of a parameter named 'foo'.  For example, in the
+// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
+// 'value_type' to refer to the type of 'value'.
+//
+// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to
+// support multi-parameter matchers.
+//
+// Describing Parameterized Matchers
+// =================================
+//
+// The last argument to MATCHER*() is a string-typed expression.  The
+// expression can reference all of the matcher's parameters and a
+// special bool-typed variable named 'negation'.  When 'negation' is
+// false, the expression should evaluate to the matcher's description;
+// otherwise it should evaluate to the description of the negation of
+// the matcher.  For example,
+//
+//   using testing::PrintToString;
+//
+//   MATCHER_P2(InClosedRange, low, hi,
+//       string(negation ? "is not" : "is") + " in range [" +
+//       PrintToString(low) + ", " + PrintToString(hi) + "]") {
+//     return low <= arg && arg <= hi;
+//   }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: is in range [4, 6]
+//   ...
+//   Expected: is not in range [2, 4]
+//
+// If you specify "" as the description, the failure message will
+// contain the sequence of words in the matcher name followed by the
+// parameter values printed as a tuple.  For example,
+//
+//   MATCHER_P2(InClosedRange, low, hi, "") { ... }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: in closed range (4, 6)
+//   ...
+//   Expected: not (in closed range (2, 4))
+//
+// Types of Matcher Parameters
+// ===========================
+//
+// For the purpose of typing, you can view
+//
+//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooMatcherPk<p1_type, ..., pk_type>
+//   Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// When you write Foo(v1, ..., vk), the compiler infers the types of
+// the parameters v1, ..., and vk for you.  If you are not happy with
+// the result of the type inference, you can specify the types by
+// explicitly instantiating the template, as in Foo<long, bool>(5,
+// false).  As said earlier, you don't get to (or need to) specify
+// 'arg_type' as that's determined by the context in which the matcher
+// is used.  You can assign the result of expression Foo(p1, ..., pk)
+// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This
+// can be useful when composing matchers.
+//
+// While you can instantiate a matcher template with reference types,
+// passing the parameters by pointer usually makes your code more
+// readable.  If, however, you still want to pass a parameter by
+// reference, be aware that in the failure message generated by the
+// matcher you will see the value of the referenced object but not its
+// address.
+//
+// Explaining Match Results
+// ========================
+//
+// Sometimes the matcher description alone isn't enough to explain why
+// the match has failed or succeeded.  For example, when expecting a
+// long string, it can be very helpful to also print the diff between
+// the expected string and the actual one.  To achieve that, you can
+// optionally stream additional information to a special variable
+// named result_listener, whose type is a pointer to class
+// MatchResultListener:
+//
+//   MATCHER_P(EqualsLongString, str, "") {
+//     if (arg == str) return true;
+//
+//     *result_listener << "the difference: "
+///                     << DiffStrings(str, arg);
+//     return false;
+//   }
+//
+// Overloading Matchers
+// ====================
+//
+// You can overload matchers with different numbers of parameters:
+//
+//   MATCHER_P(Blah, a, description_string1) { ... }
+//   MATCHER_P2(Blah, a, b, description_string2) { ... }
+//
+// Caveats
+// =======
+//
+// When defining a new matcher, you should also consider implementing
+// MatcherInterface or using MakePolymorphicMatcher().  These
+// approaches require more work than the MATCHER* macros, but also
+// give you more control on the types of the value being matched and
+// the matcher parameters, which may leads to better compiler error
+// messages when the matcher is used wrong.  They also allow
+// overloading matchers based on parameter types (as opposed to just
+// based on the number of parameters).
+//
+// MATCHER*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using MATCHER*() inside
+// a function.
+//
+// More Information
+// ================
+//
+// To learn more about using these macros, please search for 'MATCHER'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+$range i 0..n
+$for i
+
+[[
+$var macro_name = [[$if i==0 [[MATCHER]] $elif i==1 [[MATCHER_P]]
+                                         $else [[MATCHER_P$i]]]]
+$var class_name = [[name##Matcher[[$if i==0 [[]] $elif i==1 [[P]]
+                                                 $else [[P$i]]]]]]
+$range j 0..i-1
+$var template = [[$if i==0 [[]] $else [[
+
+  template <$for j, [[typename p$j##_type]]>\
+]]]]
+$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
+$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
+$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
+$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
+$var params = [[$for j, [[p$j]]]]
+$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
+$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
+$var param_field_decls = [[$for j
+[[
+
+      p$j##_type p$j;\
+]]]]
+$var param_field_decls2 = [[$for j
+[[
+
+    p$j##_type p$j;\
+]]]]
+
+#define $macro_name(name$for j [[, p$j]], description)\$template
+  class $class_name {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\
+          $impl_inits {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\$param_field_decls
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>($params));\
+    }\
+    [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {\
+    }\$param_field_decls2
+   private:\
+    GTEST_DISALLOW_ASSIGN_($class_name);\
+  };\$template
+  inline $class_name$param_types name($param_types_and_names) {\
+    return $class_name$param_types($params);\
+  }\$template
+  template <typename arg_type>\
+  bool $class_name$param_types::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+]]
+
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-nice-strict.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-nice-strict.h
new file mode 100644
index 0000000..4095f4d
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-nice-strict.h
@@ -0,0 +1,397 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-nice-strict.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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: wan@google.com (Zhanyong Wan)
+
+// Implements class templates NiceMock, NaggyMock, and StrictMock.
+//
+// Given a mock class MockFoo that is created using Google Mock,
+// NiceMock<MockFoo> is a subclass of MockFoo that allows
+// uninteresting calls (i.e. calls to mock methods that have no
+// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo
+// that prints a warning when an uninteresting call occurs, and
+// StrictMock<MockFoo> is a subclass of MockFoo that treats all
+// uninteresting calls as errors.
+//
+// Currently a mock is naggy by default, so MockFoo and
+// NaggyMock<MockFoo> behave like the same.  However, we will soon
+// switch the default behavior of mocks to be nice, as that in general
+// leads to more maintainable tests.  When that happens, MockFoo will
+// stop behaving like NaggyMock<MockFoo> and start behaving like
+// NiceMock<MockFoo>.
+//
+// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
+// their respective base class, with up-to 10 arguments.  Therefore
+// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock
+// where MockFoo has a constructor that accepts (int, const char*),
+// for example.
+//
+// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,
+// and StrictMock<MockFoo> only works for mock methods defined using
+// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.
+// If a mock method is defined in a base class of MockFoo, the "nice"
+// or "strict" modifier may not affect it, depending on the compiler.
+// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
+// supported.
+//
+// Another known limitation is that the constructors of the base mock
+// cannot have arguments passed by non-const reference, which are
+// banned by the Google C++ style guide anyway.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+template <class MockClass>
+class NiceMock : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  NiceMock() {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit NiceMock(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+  template <typename A1, typename A2>
+  NiceMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3,
+      const A4& a4) : MockClass(a1, a2, a3, a4) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
+      a6, a7) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
+      a2, a3, a4, a5, a6, a7, a8) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,
+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9, typename A10>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  virtual ~NiceMock() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);
+};
+
+template <class MockClass>
+class NaggyMock : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  NaggyMock() {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit NaggyMock(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+  template <typename A1, typename A2>
+  NaggyMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3,
+      const A4& a4) : MockClass(a1, a2, a3, a4) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
+      a6, a7) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
+      a2, a3, a4, a5, a6, a7, a8) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,
+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9, typename A10>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  virtual ~NaggyMock() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock);
+};
+
+template <class MockClass>
+class StrictMock : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  StrictMock() {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit StrictMock(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+  template <typename A1, typename A2>
+  StrictMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3,
+      const A4& a4) : MockClass(a1, a2, a3, a4) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
+      a6, a7) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
+      a2, a3, a4, a5, a6, a7, a8) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,
+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9, typename A10>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  virtual ~StrictMock() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);
+};
+
+// The following specializations catch some (relatively more common)
+// user errors of nesting nice and strict mocks.  They do NOT catch
+// all possible errors.
+
+// These specializations are declared but not defined, as NiceMock,
+// NaggyMock, and StrictMock cannot be nested.
+
+template <typename MockClass>
+class NiceMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class NaggyMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class StrictMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<StrictMock<MockClass> >;
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump
new file mode 100644
index 0000000..3ee1ce7
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump
@@ -0,0 +1,161 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-nice-strict.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+// 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: wan@google.com (Zhanyong Wan)
+
+// Implements class templates NiceMock, NaggyMock, and StrictMock.
+//
+// Given a mock class MockFoo that is created using Google Mock,
+// NiceMock<MockFoo> is a subclass of MockFoo that allows
+// uninteresting calls (i.e. calls to mock methods that have no
+// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo
+// that prints a warning when an uninteresting call occurs, and
+// StrictMock<MockFoo> is a subclass of MockFoo that treats all
+// uninteresting calls as errors.
+//
+// Currently a mock is naggy by default, so MockFoo and
+// NaggyMock<MockFoo> behave like the same.  However, we will soon
+// switch the default behavior of mocks to be nice, as that in general
+// leads to more maintainable tests.  When that happens, MockFoo will
+// stop behaving like NaggyMock<MockFoo> and start behaving like
+// NiceMock<MockFoo>.
+//
+// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
+// their respective base class, with up-to $n arguments.  Therefore
+// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock
+// where MockFoo has a constructor that accepts (int, const char*),
+// for example.
+//
+// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,
+// and StrictMock<MockFoo> only works for mock methods defined using
+// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.
+// If a mock method is defined in a base class of MockFoo, the "nice"
+// or "strict" modifier may not affect it, depending on the compiler.
+// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
+// supported.
+//
+// Another known limitation is that the constructors of the base mock
+// cannot have arguments passed by non-const reference, which are
+// banned by the Google C++ style guide anyway.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+$range kind 0..2
+$for kind [[
+
+$var clazz=[[$if kind==0 [[NiceMock]]
+             $elif kind==1 [[NaggyMock]]
+             $else [[StrictMock]]]]
+
+$var method=[[$if kind==0 [[AllowUninterestingCalls]]
+             $elif kind==1 [[WarnUninterestingCalls]]
+             $else [[FailUninterestingCalls]]]]
+
+template <class MockClass>
+class $clazz : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  $clazz() {
+    ::testing::Mock::$method(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit $clazz(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::$method(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+$range i 2..n
+$for i [[
+$range j 1..i
+  template <$for j, [[typename A$j]]>
+  $clazz($for j, [[const A$j& a$j]]) : MockClass($for j, [[a$j]]) {
+    ::testing::Mock::$method(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+
+]]
+  virtual ~$clazz() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_($clazz);
+};
+
+]]
+
+// The following specializations catch some (relatively more common)
+// user errors of nesting nice and strict mocks.  They do NOT catch
+// all possible errors.
+
+// These specializations are declared but not defined, as NiceMock,
+// NaggyMock, and StrictMock cannot be nested.
+
+template <typename MockClass>
+class NiceMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class NaggyMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class StrictMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<StrictMock<MockClass> >;
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-matchers.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-matchers.h
new file mode 100644
index 0000000..33b37a7
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-matchers.h
@@ -0,0 +1,4399 @@
+// 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 argument matchers.  More
+// matchers can be defined by the user implementing the
+// MatcherInterface<T> interface if necessary.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
+
+#include <math.h>
+#include <algorithm>
+#include <iterator>
+#include <limits>
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.h"
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+# include <initializer_list>  // NOLINT -- must be after gtest.h
+#endif
+
+namespace testing {
+
+// To implement a matcher Foo for type T, define:
+//   1. a class FooMatcherImpl that implements the
+//      MatcherInterface<T> interface, and
+//   2. a factory function that creates a Matcher<T> object from a
+//      FooMatcherImpl*.
+//
+// The two-level delegation design makes it possible to allow a user
+// to write "v" instead of "Eq(v)" where a Matcher is expected, which
+// is impossible if we pass matchers by pointers.  It also eases
+// ownership management as Matcher objects can now be copied like
+// plain values.
+
+// MatchResultListener is an abstract class.  Its << operator can be
+// used by a matcher to explain why a value matches or doesn't match.
+//
+// TODO(wan@google.com): add method
+//   bool InterestedInWhy(bool result) const;
+// to indicate whether the listener is interested in why the match
+// result is 'result'.
+class MatchResultListener {
+ public:
+  // Creates a listener object with the given underlying ostream.  The
+  // listener does not own the ostream, and does not dereference it
+  // in the constructor or destructor.
+  explicit MatchResultListener(::std::ostream* os) : stream_(os) {}
+  virtual ~MatchResultListener() = 0;  // Makes this class abstract.
+
+  // Streams x to the underlying ostream; does nothing if the ostream
+  // is NULL.
+  template <typename T>
+  MatchResultListener& operator<<(const T& x) {
+    if (stream_ != NULL)
+      *stream_ << x;
+    return *this;
+  }
+
+  // Returns the underlying ostream.
+  ::std::ostream* stream() { return stream_; }
+
+  // Returns true iff the listener is interested in an explanation of
+  // the match result.  A matcher's MatchAndExplain() method can use
+  // this information to avoid generating the explanation when no one
+  // intends to hear it.
+  bool IsInterested() const { return stream_ != NULL; }
+
+ private:
+  ::std::ostream* const stream_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener);
+};
+
+inline MatchResultListener::~MatchResultListener() {
+}
+
+// An instance of a subclass of this knows how to describe itself as a
+// matcher.
+class MatcherDescriberInterface {
+ public:
+  virtual ~MatcherDescriberInterface() {}
+
+  // Describes this matcher to an ostream.  The function should print
+  // a verb phrase that describes the property a value matching this
+  // matcher should have.  The subject of the verb phrase is the value
+  // being matched.  For example, the DescribeTo() method of the Gt(7)
+  // matcher prints "is greater than 7".
+  virtual void DescribeTo(::std::ostream* os) const = 0;
+
+  // Describes the negation of this matcher to an ostream.  For
+  // example, if the description of this matcher is "is greater than
+  // 7", the negated description could be "is not greater than 7".
+  // You are not required to override this when implementing
+  // MatcherInterface, but it is highly advised so that your matcher
+  // can produce good error messages.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "not (";
+    DescribeTo(os);
+    *os << ")";
+  }
+};
+
+// The implementation of a matcher.
+template <typename T>
+class MatcherInterface : public MatcherDescriberInterface {
+ public:
+  // Returns true iff the matcher matches x; also explains the match
+  // result to 'listener' if necessary (see the next paragraph), in
+  // the form of a non-restrictive relative clause ("which ...",
+  // "whose ...", etc) that describes x.  For example, the
+  // MatchAndExplain() method of the Pointee(...) matcher should
+  // generate an explanation like "which points to ...".
+  //
+  // Implementations of MatchAndExplain() should add an explanation of
+  // the match result *if and only if* they can provide additional
+  // information that's not already present (or not obvious) in the
+  // print-out of x and the matcher's description.  Whether the match
+  // succeeds is not a factor in deciding whether an explanation is
+  // needed, as sometimes the caller needs to print a failure message
+  // when the match succeeds (e.g. when the matcher is used inside
+  // Not()).
+  //
+  // For example, a "has at least 10 elements" matcher should explain
+  // what the actual element count is, regardless of the match result,
+  // as it is useful information to the reader; on the other hand, an
+  // "is empty" matcher probably only needs to explain what the actual
+  // size is when the match fails, as it's redundant to say that the
+  // size is 0 when the value is already known to be empty.
+  //
+  // You should override this method when defining a new matcher.
+  //
+  // It's the responsibility of the caller (Google Mock) to guarantee
+  // that 'listener' is not NULL.  This helps to simplify a matcher's
+  // implementation when it doesn't care about the performance, as it
+  // can talk to 'listener' without checking its validity first.
+  // However, in order to implement dummy listeners efficiently,
+  // listener->stream() may be NULL.
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
+
+  // Inherits these methods from MatcherDescriberInterface:
+  //   virtual void DescribeTo(::std::ostream* os) const = 0;
+  //   virtual void DescribeNegationTo(::std::ostream* os) const;
+};
+
+// A match result listener that stores the explanation in a string.
+class StringMatchResultListener : public MatchResultListener {
+ public:
+  StringMatchResultListener() : MatchResultListener(&ss_) {}
+
+  // Returns the explanation accumulated so far.
+  internal::string str() const { return ss_.str(); }
+
+  // Clears the explanation accumulated so far.
+  void Clear() { ss_.str(""); }
+
+ private:
+  ::std::stringstream ss_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);
+};
+
+namespace internal {
+
+struct AnyEq {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a == b; }
+};
+struct AnyNe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a != b; }
+};
+struct AnyLt {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a < b; }
+};
+struct AnyGt {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a > b; }
+};
+struct AnyLe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a <= b; }
+};
+struct AnyGe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a >= b; }
+};
+
+// A match result listener that ignores the explanation.
+class DummyMatchResultListener : public MatchResultListener {
+ public:
+  DummyMatchResultListener() : MatchResultListener(NULL) {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener);
+};
+
+// A match result listener that forwards the explanation to a given
+// ostream.  The difference between this and MatchResultListener is
+// that the former is concrete.
+class StreamMatchResultListener : public MatchResultListener {
+ public:
+  explicit StreamMatchResultListener(::std::ostream* os)
+      : MatchResultListener(os) {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener);
+};
+
+// An internal class for implementing Matcher<T>, which will derive
+// from it.  We put functionalities common to all Matcher<T>
+// specializations here to avoid code duplication.
+template <typename T>
+class MatcherBase {
+ public:
+  // Returns true iff the matcher matches x; also explains the match
+  // result to 'listener'.
+  bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    return impl_->MatchAndExplain(x, listener);
+  }
+
+  // Returns true iff this matcher matches x.
+  bool Matches(T x) const {
+    DummyMatchResultListener dummy;
+    return MatchAndExplain(x, &dummy);
+  }
+
+  // Describes this matcher to an ostream.
+  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
+
+  // Describes the negation of this matcher to an ostream.
+  void DescribeNegationTo(::std::ostream* os) const {
+    impl_->DescribeNegationTo(os);
+  }
+
+  // Explains why x matches, or doesn't match, the matcher.
+  void ExplainMatchResultTo(T x, ::std::ostream* os) const {
+    StreamMatchResultListener listener(os);
+    MatchAndExplain(x, &listener);
+  }
+
+  // Returns the describer for this matcher object; retains ownership
+  // of the describer, which is only guaranteed to be alive when
+  // this matcher object is alive.
+  const MatcherDescriberInterface* GetDescriber() const {
+    return impl_.get();
+  }
+
+ protected:
+  MatcherBase() {}
+
+  // Constructs a matcher from its implementation.
+  explicit MatcherBase(const MatcherInterface<T>* impl)
+      : impl_(impl) {}
+
+  virtual ~MatcherBase() {}
+
+ private:
+  // shared_ptr (util/gtl/shared_ptr.h) and linked_ptr have similar
+  // interfaces.  The former dynamically allocates a chunk of memory
+  // to hold the reference count, while the latter tracks all
+  // references using a circular linked list without allocating
+  // memory.  It has been observed that linked_ptr performs better in
+  // typical scenarios.  However, shared_ptr can out-perform
+  // linked_ptr when there are many more uses of the copy constructor
+  // than the default constructor.
+  //
+  // If performance becomes a problem, we should see if using
+  // shared_ptr helps.
+  ::testing::internal::linked_ptr<const MatcherInterface<T> > impl_;
+};
+
+}  // namespace internal
+
+// A Matcher<T> is a copyable and IMMUTABLE (except by assignment)
+// object that can check whether a value of type T matches.  The
+// implementation of Matcher<T> is just a linked_ptr to const
+// MatcherInterface<T>, so copying is fairly cheap.  Don't inherit
+// from Matcher!
+template <typename T>
+class Matcher : public internal::MatcherBase<T> {
+ public:
+  // Constructs a null matcher.  Needed for storing Matcher objects in STL
+  // containers.  A default-constructed matcher is not yet initialized.  You
+  // cannot use it until a valid value has been assigned to it.
+  explicit Matcher() {}  // NOLINT
+
+  // Constructs a matcher from its implementation.
+  explicit Matcher(const MatcherInterface<T>* impl)
+      : internal::MatcherBase<T>(impl) {}
+
+  // Implicit constructor here allows people to write
+  // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes
+  Matcher(T value);  // NOLINT
+};
+
+// The following two specializations allow the user to write str
+// instead of Eq(str) and "foo" instead of Eq("foo") when a string
+// matcher is expected.
+template <>
+class GTEST_API_ Matcher<const internal::string&>
+    : public internal::MatcherBase<const internal::string&> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<const internal::string&>* impl)
+      : internal::MatcherBase<const internal::string&>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+};
+
+template <>
+class GTEST_API_ Matcher<internal::string>
+    : public internal::MatcherBase<internal::string> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<internal::string>* impl)
+      : internal::MatcherBase<internal::string>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+};
+
+#if GTEST_HAS_STRING_PIECE_
+// The following two specializations allow the user to write str
+// instead of Eq(str) and "foo" instead of Eq("foo") when a StringPiece
+// matcher is expected.
+template <>
+class GTEST_API_ Matcher<const StringPiece&>
+    : public internal::MatcherBase<const StringPiece&> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<const StringPiece&>* impl)
+      : internal::MatcherBase<const StringPiece&>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+
+  // Allows the user to pass StringPieces directly.
+  Matcher(StringPiece s);  // NOLINT
+};
+
+template <>
+class GTEST_API_ Matcher<StringPiece>
+    : public internal::MatcherBase<StringPiece> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<StringPiece>* impl)
+      : internal::MatcherBase<StringPiece>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+
+  // Allows the user to pass StringPieces directly.
+  Matcher(StringPiece s);  // NOLINT
+};
+#endif  // GTEST_HAS_STRING_PIECE_
+
+// The PolymorphicMatcher class template makes it easy to implement a
+// polymorphic matcher (i.e. a matcher that can match values of more
+// than one type, e.g. Eq(n) and NotNull()).
+//
+// To define a polymorphic matcher, a user should provide an Impl
+// class that has a DescribeTo() method and a DescribeNegationTo()
+// method, and define a member function (or member function template)
+//
+//   bool MatchAndExplain(const Value& value,
+//                        MatchResultListener* listener) const;
+//
+// See the definition of NotNull() for a complete example.
+template <class Impl>
+class PolymorphicMatcher {
+ public:
+  explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
+
+  // Returns a mutable reference to the underlying matcher
+  // implementation object.
+  Impl& mutable_impl() { return impl_; }
+
+  // Returns an immutable reference to the underlying matcher
+  // implementation object.
+  const Impl& impl() const { return impl_; }
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new MonomorphicImpl<T>(impl_));
+  }
+
+ private:
+  template <typename T>
+  class MonomorphicImpl : public MatcherInterface<T> {
+   public:
+    explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      impl_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      impl_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return impl_.MatchAndExplain(x, listener);
+    }
+
+   private:
+    const Impl impl_;
+
+    GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
+  };
+
+  Impl impl_;
+
+  GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher);
+};
+
+// Creates a matcher from its implementation.  This is easier to use
+// than the Matcher<T> constructor as it doesn't require you to
+// explicitly write the template argument, e.g.
+//
+//   MakeMatcher(foo);
+// vs
+//   Matcher<const string&>(foo);
+template <typename T>
+inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) {
+  return Matcher<T>(impl);
+}
+
+// Creates a polymorphic matcher from its implementation.  This is
+// easier to use than the PolymorphicMatcher<Impl> constructor as it
+// doesn't require you to explicitly write the template argument, e.g.
+//
+//   MakePolymorphicMatcher(foo);
+// vs
+//   PolymorphicMatcher<TypeOfFoo>(foo);
+template <class Impl>
+inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) {
+  return PolymorphicMatcher<Impl>(impl);
+}
+
+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
+// and MUST NOT BE USED IN USER CODE!!!
+namespace internal {
+
+// The MatcherCastImpl class template is a helper for implementing
+// MatcherCast().  We need this helper in order to partially
+// specialize the implementation of MatcherCast() (C++ allows
+// class/struct templates to be partially specialized, but not
+// function templates.).
+
+// This general version is used when MatcherCast()'s argument is a
+// polymorphic matcher (i.e. something that can be converted to a
+// Matcher but is not one yet; for example, Eq(value)) or a value (for
+// example, "hello").
+template <typename T, typename M>
+class MatcherCastImpl {
+ public:
+  static Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
+    // M can be a polymorhic matcher, in which case we want to use
+    // its conversion operator to create Matcher<T>.  Or it can be a value
+    // that should be passed to the Matcher<T>'s constructor.
+    //
+    // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a
+    // polymorphic matcher because it'll be ambiguous if T has an implicit
+    // constructor from M (this usually happens when T has an implicit
+    // constructor from any type).
+    //
+    // It won't work to unconditionally implict_cast
+    // polymorphic_matcher_or_value to Matcher<T> because it won't trigger
+    // a user-defined conversion from M to T if one exists (assuming M is
+    // a value).
+    return CastImpl(
+        polymorphic_matcher_or_value,
+        BooleanConstant<
+            internal::ImplicitlyConvertible<M, Matcher<T> >::value>());
+  }
+
+ private:
+  static Matcher<T> CastImpl(const M& value, BooleanConstant<false>) {
+    // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic
+    // matcher.  It must be a value then.  Use direct initialization to create
+    // a matcher.
+    return Matcher<T>(ImplicitCast_<T>(value));
+  }
+
+  static Matcher<T> CastImpl(const M& polymorphic_matcher_or_value,
+                             BooleanConstant<true>) {
+    // M is implicitly convertible to Matcher<T>, which means that either
+    // M is a polymorhpic matcher or Matcher<T> has an implicit constructor
+    // from M.  In both cases using the implicit conversion will produce a
+    // matcher.
+    //
+    // Even if T has an implicit constructor from M, it won't be called because
+    // creating Matcher<T> would require a chain of two user-defined conversions
+    // (first to create T from M and then to create Matcher<T> from T).
+    return polymorphic_matcher_or_value;
+  }
+};
+
+// This more specialized version is used when MatcherCast()'s argument
+// is already a Matcher.  This only compiles when type T can be
+// statically converted to type U.
+template <typename T, typename U>
+class MatcherCastImpl<T, Matcher<U> > {
+ public:
+  static Matcher<T> Cast(const Matcher<U>& source_matcher) {
+    return Matcher<T>(new Impl(source_matcher));
+  }
+
+ private:
+  class Impl : public MatcherInterface<T> {
+   public:
+    explicit Impl(const Matcher<U>& source_matcher)
+        : source_matcher_(source_matcher) {}
+
+    // We delegate the matching logic to the source matcher.
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
+    }
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      source_matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      source_matcher_.DescribeNegationTo(os);
+    }
+
+   private:
+    const Matcher<U> source_matcher_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+};
+
+// This even more specialized version is used for efficiently casting
+// a matcher to its own type.
+template <typename T>
+class MatcherCastImpl<T, Matcher<T> > {
+ public:
+  static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }
+};
+
+}  // namespace internal
+
+// In order to be safe and clear, casting between different matcher
+// types is done explicitly via MatcherCast<T>(m), which takes a
+// matcher m and returns a Matcher<T>.  It compiles only when T can be
+// statically converted to the argument type of m.
+template <typename T, typename M>
+inline Matcher<T> MatcherCast(const M& matcher) {
+  return internal::MatcherCastImpl<T, M>::Cast(matcher);
+}
+
+// Implements SafeMatcherCast().
+//
+// We use an intermediate class to do the actual safe casting as Nokia's
+// Symbian compiler cannot decide between
+// template <T, M> ... (M) and
+// template <T, U> ... (const Matcher<U>&)
+// for function templates but can for member function templates.
+template <typename T>
+class SafeMatcherCastImpl {
+ public:
+  // This overload handles polymorphic matchers and values only since
+  // monomorphic matchers are handled by the next one.
+  template <typename M>
+  static inline Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
+    return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
+  }
+
+  // This overload handles monomorphic matchers.
+  //
+  // In general, if type T can be implicitly converted to type U, we can
+  // safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is
+  // contravariant): just keep a copy of the original Matcher<U>, convert the
+  // argument from type T to U, and then pass it to the underlying Matcher<U>.
+  // The only exception is when U is a reference and T is not, as the
+  // underlying Matcher<U> may be interested in the argument's address, which
+  // is not preserved in the conversion from T to U.
+  template <typename U>
+  static inline Matcher<T> Cast(const Matcher<U>& matcher) {
+    // Enforce that T can be implicitly converted to U.
+    GTEST_COMPILE_ASSERT_((internal::ImplicitlyConvertible<T, U>::value),
+                          T_must_be_implicitly_convertible_to_U);
+    // Enforce that we are not converting a non-reference type T to a reference
+    // type U.
+    GTEST_COMPILE_ASSERT_(
+        internal::is_reference<T>::value || !internal::is_reference<U>::value,
+        cannot_convert_non_referentce_arg_to_reference);
+    // In case both T and U are arithmetic types, enforce that the
+    // conversion is not lossy.
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
+    const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
+    const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
+    GTEST_COMPILE_ASSERT_(
+        kTIsOther || kUIsOther ||
+        (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
+        conversion_of_arithmetic_types_must_be_lossless);
+    return MatcherCast<T>(matcher);
+  }
+};
+
+template <typename T, typename M>
+inline Matcher<T> SafeMatcherCast(const M& polymorphic_matcher) {
+  return SafeMatcherCastImpl<T>::Cast(polymorphic_matcher);
+}
+
+// A<T>() returns a matcher that matches any value of type T.
+template <typename T>
+Matcher<T> A();
+
+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
+// and MUST NOT BE USED IN USER CODE!!!
+namespace internal {
+
+// If the explanation is not empty, prints it to the ostream.
+inline void PrintIfNotEmpty(const internal::string& explanation,
+                            ::std::ostream* os) {
+  if (explanation != "" && os != NULL) {
+    *os << ", " << explanation;
+  }
+}
+
+// Returns true if the given type name is easy to read by a human.
+// This is used to decide whether printing the type of a value might
+// be helpful.
+inline bool IsReadableTypeName(const string& type_name) {
+  // We consider a type name readable if it's short or doesn't contain
+  // a template or function type.
+  return (type_name.length() <= 20 ||
+          type_name.find_first_of("<(") == string::npos);
+}
+
+// Matches the value against the given matcher, prints the value and explains
+// the match result to the listener. Returns the match result.
+// 'listener' must not be NULL.
+// Value cannot be passed by const reference, because some matchers take a
+// non-const argument.
+template <typename Value, typename T>
+bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
+                          MatchResultListener* listener) {
+  if (!listener->IsInterested()) {
+    // If the listener is not interested, we do not need to construct the
+    // inner explanation.
+    return matcher.Matches(value);
+  }
+
+  StringMatchResultListener inner_listener;
+  const bool match = matcher.MatchAndExplain(value, &inner_listener);
+
+  UniversalPrint(value, listener->stream());
+#if GTEST_HAS_RTTI
+  const string& type_name = GetTypeName<Value>();
+  if (IsReadableTypeName(type_name))
+    *listener->stream() << " (of type " << type_name << ")";
+#endif
+  PrintIfNotEmpty(inner_listener.str(), listener->stream());
+
+  return match;
+}
+
+// An internal helper class for doing compile-time loop on a tuple's
+// fields.
+template <size_t N>
+class TuplePrefix {
+ public:
+  // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
+  // iff the first N fields of matcher_tuple matches the first N
+  // fields of value_tuple, respectively.
+  template <typename MatcherTuple, typename ValueTuple>
+  static bool Matches(const MatcherTuple& matcher_tuple,
+                      const ValueTuple& value_tuple) {
+    return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)
+        && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));
+  }
+
+  // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)
+  // describes failures in matching the first N fields of matchers
+  // against the first N fields of values.  If there is no failure,
+  // nothing will be streamed to os.
+  template <typename MatcherTuple, typename ValueTuple>
+  static void ExplainMatchFailuresTo(const MatcherTuple& matchers,
+                                     const ValueTuple& values,
+                                     ::std::ostream* os) {
+    // First, describes failures in the first N - 1 fields.
+    TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);
+
+    // Then describes the failure (if any) in the (N - 1)-th (0-based)
+    // field.
+    typename tuple_element<N - 1, MatcherTuple>::type matcher =
+        get<N - 1>(matchers);
+    typedef typename tuple_element<N - 1, ValueTuple>::type Value;
+    Value value = get<N - 1>(values);
+    StringMatchResultListener listener;
+    if (!matcher.MatchAndExplain(value, &listener)) {
+      // TODO(wan): include in the message the name of the parameter
+      // as used in MOCK_METHOD*() when possible.
+      *os << "  Expected arg #" << N - 1 << ": ";
+      get<N - 1>(matchers).DescribeTo(os);
+      *os << "\n           Actual: ";
+      // We remove the reference in type Value to prevent the
+      // universal printer from printing the address of value, which
+      // isn't interesting to the user most of the time.  The
+      // matcher's MatchAndExplain() method handles the case when
+      // the address is interesting.
+      internal::UniversalPrint(value, os);
+      PrintIfNotEmpty(listener.str(), os);
+      *os << "\n";
+    }
+  }
+};
+
+// The base case.
+template <>
+class TuplePrefix<0> {
+ public:
+  template <typename MatcherTuple, typename ValueTuple>
+  static bool Matches(const MatcherTuple& /* matcher_tuple */,
+                      const ValueTuple& /* value_tuple */) {
+    return true;
+  }
+
+  template <typename MatcherTuple, typename ValueTuple>
+  static void ExplainMatchFailuresTo(const MatcherTuple& /* matchers */,
+                                     const ValueTuple& /* values */,
+                                     ::std::ostream* /* os */) {}
+};
+
+// TupleMatches(matcher_tuple, value_tuple) returns true iff all
+// matchers in matcher_tuple match the corresponding fields in
+// value_tuple.  It is a compiler error if matcher_tuple and
+// value_tuple have different number of fields or incompatible field
+// types.
+template <typename MatcherTuple, typename ValueTuple>
+bool TupleMatches(const MatcherTuple& matcher_tuple,
+                  const ValueTuple& value_tuple) {
+  // Makes sure that matcher_tuple and value_tuple have the same
+  // number of fields.
+  GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value ==
+                        tuple_size<ValueTuple>::value,
+                        matcher_and_value_have_different_numbers_of_fields);
+  return TuplePrefix<tuple_size<ValueTuple>::value>::
+      Matches(matcher_tuple, value_tuple);
+}
+
+// Describes failures in matching matchers against values.  If there
+// is no failure, nothing will be streamed to os.
+template <typename MatcherTuple, typename ValueTuple>
+void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
+                                const ValueTuple& values,
+                                ::std::ostream* os) {
+  TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
+      matchers, values, os);
+}
+
+// TransformTupleValues and its helper.
+//
+// TransformTupleValuesHelper hides the internal machinery that
+// TransformTupleValues uses to implement a tuple traversal.
+template <typename Tuple, typename Func, typename OutIter>
+class TransformTupleValuesHelper {
+ private:
+  typedef ::testing::tuple_size<Tuple> TupleSize;
+
+ public:
+  // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
+  // Returns the final value of 'out' in case the caller needs it.
+  static OutIter Run(Func f, const Tuple& t, OutIter out) {
+    return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
+  }
+
+ private:
+  template <typename Tup, size_t kRemainingSize>
+  struct IterateOverTuple {
+    OutIter operator() (Func f, const Tup& t, OutIter out) const {
+      *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
+      return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
+    }
+  };
+  template <typename Tup>
+  struct IterateOverTuple<Tup, 0> {
+    OutIter operator() (Func /* f */, const Tup& /* t */, OutIter out) const {
+      return out;
+    }
+  };
+};
+
+// Successively invokes 'f(element)' on each element of the tuple 't',
+// appending each result to the 'out' iterator. Returns the final value
+// of 'out'.
+template <typename Tuple, typename Func, typename OutIter>
+OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
+  return TransformTupleValuesHelper<Tuple, Func, OutIter>::Run(f, t, out);
+}
+
+// Implements A<T>().
+template <typename T>
+class AnyMatcherImpl : public MatcherInterface<T> {
+ public:
+  virtual bool MatchAndExplain(
+      T /* x */, MatchResultListener* /* listener */) const { return true; }
+  virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; }
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    // This is mostly for completeness' safe, as it's not very useful
+    // to write Not(A<bool>()).  However we cannot completely rule out
+    // such a possibility, and it doesn't hurt to be prepared.
+    *os << "never matches";
+  }
+};
+
+// Implements _, a matcher that matches any value of any
+// type.  This is a polymorphic matcher, so we need a template type
+// conversion operator to make it appearing as a Matcher<T> for any
+// type T.
+class AnythingMatcher {
+ public:
+  template <typename T>
+  operator Matcher<T>() const { return A<T>(); }
+};
+
+// Implements a matcher that compares a given value with a
+// pre-supplied value using one of the ==, <=, <, etc, operators.  The
+// two values being compared don't have to have the same type.
+//
+// The matcher defined here is polymorphic (for example, Eq(5) can be
+// used to match an int, a short, a double, etc).  Therefore we use
+// a template type conversion operator in the implementation.
+//
+// The following template definition assumes that the Rhs parameter is
+// a "bare" type (i.e. neither 'const T' nor 'T&').
+template <typename D, typename Rhs, typename Op>
+class ComparisonBase {
+ public:
+  explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {}
+  template <typename Lhs>
+  operator Matcher<Lhs>() const {
+    return MakeMatcher(new Impl<Lhs>(rhs_));
+  }
+
+ private:
+  template <typename Lhs>
+  class Impl : public MatcherInterface<Lhs> {
+   public:
+    explicit Impl(const Rhs& rhs) : rhs_(rhs) {}
+    virtual bool MatchAndExplain(
+        Lhs lhs, MatchResultListener* /* listener */) const {
+      return Op()(lhs, rhs_);
+    }
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << D::Desc() << " ";
+      UniversalPrint(rhs_, os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << D::NegatedDesc() <<  " ";
+      UniversalPrint(rhs_, os);
+    }
+   private:
+    Rhs rhs_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+  Rhs rhs_;
+  GTEST_DISALLOW_ASSIGN_(ComparisonBase);
+};
+
+template <typename Rhs>
+class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq> {
+ public:
+  explicit EqMatcher(const Rhs& rhs)
+      : ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq>(rhs) { }
+  static const char* Desc() { return "is equal to"; }
+  static const char* NegatedDesc() { return "isn't equal to"; }
+};
+template <typename Rhs>
+class NeMatcher : public ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe> {
+ public:
+  explicit NeMatcher(const Rhs& rhs)
+      : ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe>(rhs) { }
+  static const char* Desc() { return "isn't equal to"; }
+  static const char* NegatedDesc() { return "is equal to"; }
+};
+template <typename Rhs>
+class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt> {
+ public:
+  explicit LtMatcher(const Rhs& rhs)
+      : ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt>(rhs) { }
+  static const char* Desc() { return "is <"; }
+  static const char* NegatedDesc() { return "isn't <"; }
+};
+template <typename Rhs>
+class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt> {
+ public:
+  explicit GtMatcher(const Rhs& rhs)
+      : ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt>(rhs) { }
+  static const char* Desc() { return "is >"; }
+  static const char* NegatedDesc() { return "isn't >"; }
+};
+template <typename Rhs>
+class LeMatcher : public ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe> {
+ public:
+  explicit LeMatcher(const Rhs& rhs)
+      : ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe>(rhs) { }
+  static const char* Desc() { return "is <="; }
+  static const char* NegatedDesc() { return "isn't <="; }
+};
+template <typename Rhs>
+class GeMatcher : public ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe> {
+ public:
+  explicit GeMatcher(const Rhs& rhs)
+      : ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe>(rhs) { }
+  static const char* Desc() { return "is >="; }
+  static const char* NegatedDesc() { return "isn't >="; }
+};
+
+// Implements the polymorphic IsNull() matcher, which matches any raw or smart
+// pointer that is NULL.
+class IsNullMatcher {
+ public:
+  template <typename Pointer>
+  bool MatchAndExplain(const Pointer& p,
+                       MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+    return p == nullptr;
+#else  // GTEST_LANG_CXX11
+    return GetRawPointer(p) == NULL;
+#endif  // GTEST_LANG_CXX11
+  }
+
+  void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "isn't NULL";
+  }
+};
+
+// Implements the polymorphic NotNull() matcher, which matches any raw or smart
+// pointer that is not NULL.
+class NotNullMatcher {
+ public:
+  template <typename Pointer>
+  bool MatchAndExplain(const Pointer& p,
+                       MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+    return p != nullptr;
+#else  // GTEST_LANG_CXX11
+    return GetRawPointer(p) != NULL;
+#endif  // GTEST_LANG_CXX11
+  }
+
+  void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is NULL";
+  }
+};
+
+// Ref(variable) matches any argument that is a reference to
+// 'variable'.  This matcher is polymorphic as it can match any
+// super type of the type of 'variable'.
+//
+// The RefMatcher template class implements Ref(variable).  It can
+// only be instantiated with a reference type.  This prevents a user
+// from mistakenly using Ref(x) to match a non-reference function
+// argument.  For example, the following will righteously cause a
+// compiler error:
+//
+//   int n;
+//   Matcher<int> m1 = Ref(n);   // This won't compile.
+//   Matcher<int&> m2 = Ref(n);  // This will compile.
+template <typename T>
+class RefMatcher;
+
+template <typename T>
+class RefMatcher<T&> {
+  // Google Mock is a generic framework and thus needs to support
+  // mocking any function types, including those that take non-const
+  // reference arguments.  Therefore the template parameter T (and
+  // Super below) can be instantiated to either a const type or a
+  // non-const type.
+ public:
+  // RefMatcher() takes a T& instead of const T&, as we want the
+  // compiler to catch using Ref(const_value) as a matcher for a
+  // non-const reference.
+  explicit RefMatcher(T& x) : object_(x) {}  // NOLINT
+
+  template <typename Super>
+  operator Matcher<Super&>() const {
+    // By passing object_ (type T&) to Impl(), which expects a Super&,
+    // we make sure that Super is a super type of T.  In particular,
+    // this catches using Ref(const_value) as a matcher for a
+    // non-const reference, as you cannot implicitly convert a const
+    // reference to a non-const reference.
+    return MakeMatcher(new Impl<Super>(object_));
+  }
+
+ private:
+  template <typename Super>
+  class Impl : public MatcherInterface<Super&> {
+   public:
+    explicit Impl(Super& x) : object_(x) {}  // NOLINT
+
+    // MatchAndExplain() takes a Super& (as opposed to const Super&)
+    // in order to match the interface MatcherInterface<Super&>.
+    virtual bool MatchAndExplain(
+        Super& x, MatchResultListener* listener) const {
+      *listener << "which is located @" << static_cast<const void*>(&x);
+      return &x == &object_;
+    }
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "references the variable ";
+      UniversalPrinter<Super&>::Print(object_, os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "does not reference the variable ";
+      UniversalPrinter<Super&>::Print(object_, os);
+    }
+
+   private:
+    const Super& object_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  T& object_;
+
+  GTEST_DISALLOW_ASSIGN_(RefMatcher);
+};
+
+// Polymorphic helper functions for narrow and wide string matchers.
+inline bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) {
+  return String::CaseInsensitiveCStringEquals(lhs, rhs);
+}
+
+inline bool CaseInsensitiveCStringEquals(const wchar_t* lhs,
+                                         const wchar_t* rhs) {
+  return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
+}
+
+// String comparison for narrow or wide strings that can have embedded NUL
+// characters.
+template <typename StringType>
+bool CaseInsensitiveStringEquals(const StringType& s1,
+                                 const StringType& s2) {
+  // Are the heads equal?
+  if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) {
+    return false;
+  }
+
+  // Skip the equal heads.
+  const typename StringType::value_type nul = 0;
+  const size_t i1 = s1.find(nul), i2 = s2.find(nul);
+
+  // Are we at the end of either s1 or s2?
+  if (i1 == StringType::npos || i2 == StringType::npos) {
+    return i1 == i2;
+  }
+
+  // Are the tails equal?
+  return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1));
+}
+
+// String matchers.
+
+// Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
+template <typename StringType>
+class StrEqualityMatcher {
+ public:
+  StrEqualityMatcher(const StringType& str, bool expect_eq,
+                     bool case_sensitive)
+      : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    if (s == NULL) {
+      return !expect_eq_;
+    }
+    return MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    const bool eq = case_sensitive_ ? s2 == string_ :
+        CaseInsensitiveStringEquals(s2, string_);
+    return expect_eq_ == eq;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    DescribeToHelper(expect_eq_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    DescribeToHelper(!expect_eq_, os);
+  }
+
+ private:
+  void DescribeToHelper(bool expect_eq, ::std::ostream* os) const {
+    *os << (expect_eq ? "is " : "isn't ");
+    *os << "equal to ";
+    if (!case_sensitive_) {
+      *os << "(ignoring case) ";
+    }
+    UniversalPrint(string_, os);
+  }
+
+  const StringType string_;
+  const bool expect_eq_;
+  const bool case_sensitive_;
+
+  GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
+};
+
+// Implements the polymorphic HasSubstr(substring) matcher, which
+// can be used as a Matcher<T> as long as T can be converted to a
+// string.
+template <typename StringType>
+class HasSubstrMatcher {
+ public:
+  explicit HasSubstrMatcher(const StringType& substring)
+      : substring_(substring) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    return s2.find(substring_) != StringType::npos;
+  }
+
+  // Describes what this matcher matches.
+  void DescribeTo(::std::ostream* os) const {
+    *os << "has substring ";
+    UniversalPrint(substring_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "has no substring ";
+    UniversalPrint(substring_, os);
+  }
+
+ private:
+  const StringType substring_;
+
+  GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
+};
+
+// Implements the polymorphic StartsWith(substring) matcher, which
+// can be used as a Matcher<T> as long as T can be converted to a
+// string.
+template <typename StringType>
+class StartsWithMatcher {
+ public:
+  explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {
+  }
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    return s2.length() >= prefix_.length() &&
+        s2.substr(0, prefix_.length()) == prefix_;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "starts with ";
+    UniversalPrint(prefix_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't start with ";
+    UniversalPrint(prefix_, os);
+  }
+
+ private:
+  const StringType prefix_;
+
+  GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
+};
+
+// Implements the polymorphic EndsWith(substring) matcher, which
+// can be used as a Matcher<T> as long as T can be converted to a
+// string.
+template <typename StringType>
+class EndsWithMatcher {
+ public:
+  explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    return s2.length() >= suffix_.length() &&
+        s2.substr(s2.length() - suffix_.length()) == suffix_;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "ends with ";
+    UniversalPrint(suffix_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't end with ";
+    UniversalPrint(suffix_, os);
+  }
+
+ private:
+  const StringType suffix_;
+
+  GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
+};
+
+// Implements polymorphic matchers MatchesRegex(regex) and
+// ContainsRegex(regex), which can be used as a Matcher<T> as long as
+// T can be converted to a string.
+class MatchesRegexMatcher {
+ public:
+  MatchesRegexMatcher(const RE* regex, bool full_match)
+      : regex_(regex), full_match_(full_match) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(internal::string(s), listener);
+  }
+
+  // Matches anything that can convert to internal::string.
+  //
+  // This is a template, not just a plain function with const internal::string&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <class MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const internal::string& s2(s);
+    return full_match_ ? RE::FullMatch(s2, *regex_) :
+        RE::PartialMatch(s2, *regex_);
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << (full_match_ ? "matches" : "contains")
+        << " regular expression ";
+    UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't " << (full_match_ ? "match" : "contain")
+        << " regular expression ";
+    UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
+  }
+
+ private:
+  const internal::linked_ptr<const RE> regex_;
+  const bool full_match_;
+
+  GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher);
+};
+
+// Implements a matcher that compares the two fields of a 2-tuple
+// using one of the ==, <=, <, etc, operators.  The two fields being
+// compared don't have to have the same type.
+//
+// The matcher defined here is polymorphic (for example, Eq() can be
+// used to match a tuple<int, short>, a tuple<const long&, double>,
+// etc).  Therefore we use a template type conversion operator in the
+// implementation.
+template <typename D, typename Op>
+class PairMatchBase {
+ public:
+  template <typename T1, typename T2>
+  operator Matcher< ::testing::tuple<T1, T2> >() const {
+    return MakeMatcher(new Impl< ::testing::tuple<T1, T2> >);
+  }
+  template <typename T1, typename T2>
+  operator Matcher<const ::testing::tuple<T1, T2>&>() const {
+    return MakeMatcher(new Impl<const ::testing::tuple<T1, T2>&>);
+  }
+
+ private:
+  static ::std::ostream& GetDesc(::std::ostream& os) {  // NOLINT
+    return os << D::Desc();
+  }
+
+  template <typename Tuple>
+  class Impl : public MatcherInterface<Tuple> {
+   public:
+    virtual bool MatchAndExplain(
+        Tuple args,
+        MatchResultListener* /* listener */) const {
+      return Op()(::testing::get<0>(args), ::testing::get<1>(args));
+    }
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "are " << GetDesc;
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "aren't " << GetDesc;
+    }
+  };
+};
+
+class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
+ public:
+  static const char* Desc() { return "an equal pair"; }
+};
+class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
+ public:
+  static const char* Desc() { return "an unequal pair"; }
+};
+class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
+ public:
+  static const char* Desc() { return "a pair where the first < the second"; }
+};
+class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
+ public:
+  static const char* Desc() { return "a pair where the first > the second"; }
+};
+class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
+ public:
+  static const char* Desc() { return "a pair where the first <= the second"; }
+};
+class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
+ public:
+  static const char* Desc() { return "a pair where the first >= the second"; }
+};
+
+// Implements the Not(...) matcher for a particular argument type T.
+// We do not nest it inside the NotMatcher class template, as that
+// will prevent different instantiations of NotMatcher from sharing
+// the same NotMatcherImpl<T> class.
+template <typename T>
+class NotMatcherImpl : public MatcherInterface<T> {
+ public:
+  explicit NotMatcherImpl(const Matcher<T>& matcher)
+      : matcher_(matcher) {}
+
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    return !matcher_.MatchAndExplain(x, listener);
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    matcher_.DescribeNegationTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    matcher_.DescribeTo(os);
+  }
+
+ private:
+  const Matcher<T> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(NotMatcherImpl);
+};
+
+// Implements the Not(m) matcher, which matches a value that doesn't
+// match matcher m.
+template <typename InnerMatcher>
+class NotMatcher {
+ public:
+  explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}
+
+  // This template type conversion operator allows Not(m) to be used
+  // to match any type m can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new NotMatcherImpl<T>(SafeMatcherCast<T>(matcher_)));
+  }
+
+ private:
+  InnerMatcher matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(NotMatcher);
+};
+
+// Implements the AllOf(m1, m2) matcher for a particular argument type
+// T. We do not nest it inside the BothOfMatcher class template, as
+// that will prevent different instantiations of BothOfMatcher from
+// sharing the same BothOfMatcherImpl<T> class.
+template <typename T>
+class BothOfMatcherImpl : public MatcherInterface<T> {
+ public:
+  BothOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeTo(os);
+    *os << ") and (";
+    matcher2_.DescribeTo(os);
+    *os << ")";
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeNegationTo(os);
+    *os << ") or (";
+    matcher2_.DescribeNegationTo(os);
+    *os << ")";
+  }
+
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    // If either matcher1_ or matcher2_ doesn't match x, we only need
+    // to explain why one of them fails.
+    StringMatchResultListener listener1;
+    if (!matcher1_.MatchAndExplain(x, &listener1)) {
+      *listener << listener1.str();
+      return false;
+    }
+
+    StringMatchResultListener listener2;
+    if (!matcher2_.MatchAndExplain(x, &listener2)) {
+      *listener << listener2.str();
+      return false;
+    }
+
+    // Otherwise we need to explain why *both* of them match.
+    const internal::string s1 = listener1.str();
+    const internal::string s2 = listener2.str();
+
+    if (s1 == "") {
+      *listener << s2;
+    } else {
+      *listener << s1;
+      if (s2 != "") {
+        *listener << ", and " << s2;
+      }
+    }
+    return true;
+  }
+
+ private:
+  const Matcher<T> matcher1_;
+  const Matcher<T> matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl);
+};
+
+#if GTEST_LANG_CXX11
+// MatcherList provides mechanisms for storing a variable number of matchers in
+// a list structure (ListType) and creating a combining matcher from such a
+// list.
+// The template is defined recursively using the following template paramters:
+//   * kSize is the length of the MatcherList.
+//   * Head is the type of the first matcher of the list.
+//   * Tail denotes the types of the remaining matchers of the list.
+template <int kSize, typename Head, typename... Tail>
+struct MatcherList {
+  typedef MatcherList<kSize - 1, Tail...> MatcherListTail;
+  typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType;
+
+  // BuildList stores variadic type values in a nested pair structure.
+  // Example:
+  // MatcherList<3, int, string, float>::BuildList(5, "foo", 2.0) will return
+  // the corresponding result of type pair<int, pair<string, float>>.
+  static ListType BuildList(const Head& matcher, const Tail&... tail) {
+    return ListType(matcher, MatcherListTail::BuildList(tail...));
+  }
+
+  // CreateMatcher<T> creates a Matcher<T> from a given list of matchers (built
+  // by BuildList()). CombiningMatcher<T> is used to combine the matchers of the
+  // list. CombiningMatcher<T> must implement MatcherInterface<T> and have a
+  // constructor taking two Matcher<T>s as input.
+  template <typename T, template <typename /* T */> class CombiningMatcher>
+  static Matcher<T> CreateMatcher(const ListType& matchers) {
+    return Matcher<T>(new CombiningMatcher<T>(
+        SafeMatcherCast<T>(matchers.first),
+        MatcherListTail::template CreateMatcher<T, CombiningMatcher>(
+            matchers.second)));
+  }
+};
+
+// The following defines the base case for the recursive definition of
+// MatcherList.
+template <typename Matcher1, typename Matcher2>
+struct MatcherList<2, Matcher1, Matcher2> {
+  typedef ::std::pair<Matcher1, Matcher2> ListType;
+
+  static ListType BuildList(const Matcher1& matcher1,
+                            const Matcher2& matcher2) {
+    return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2);
+  }
+
+  template <typename T, template <typename /* T */> class CombiningMatcher>
+  static Matcher<T> CreateMatcher(const ListType& matchers) {
+    return Matcher<T>(new CombiningMatcher<T>(
+        SafeMatcherCast<T>(matchers.first),
+        SafeMatcherCast<T>(matchers.second)));
+  }
+};
+
+// VariadicMatcher is used for the variadic implementation of
+// AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...).
+// CombiningMatcher<T> is used to recursively combine the provided matchers
+// (of type Args...).
+template <template <typename T> class CombiningMatcher, typename... Args>
+class VariadicMatcher {
+ public:
+  VariadicMatcher(const Args&... matchers)  // NOLINT
+      : matchers_(MatcherListType::BuildList(matchers...)) {}
+
+  // This template type conversion operator allows an
+  // VariadicMatcher<Matcher1, Matcher2...> object to match any type that
+  // all of the provided matchers (Matcher1, Matcher2, ...) can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return MatcherListType::template CreateMatcher<T, CombiningMatcher>(
+        matchers_);
+  }
+
+ private:
+  typedef MatcherList<sizeof...(Args), Args...> MatcherListType;
+
+  const typename MatcherListType::ListType matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(VariadicMatcher);
+};
+
+template <typename... Args>
+using AllOfMatcher = VariadicMatcher<BothOfMatcherImpl, Args...>;
+
+#endif  // GTEST_LANG_CXX11
+
+// Used for implementing the AllOf(m_1, ..., m_n) matcher, which
+// matches a value that matches all of the matchers m_1, ..., and m_n.
+template <typename Matcher1, typename Matcher2>
+class BothOfMatcher {
+ public:
+  BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  // This template type conversion operator allows a
+  // BothOfMatcher<Matcher1, Matcher2> object to match any type that
+  // both Matcher1 and Matcher2 can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new BothOfMatcherImpl<T>(SafeMatcherCast<T>(matcher1_),
+                                               SafeMatcherCast<T>(matcher2_)));
+  }
+
+ private:
+  Matcher1 matcher1_;
+  Matcher2 matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(BothOfMatcher);
+};
+
+// Implements the AnyOf(m1, m2) matcher for a particular argument type
+// T.  We do not nest it inside the AnyOfMatcher class template, as
+// that will prevent different instantiations of AnyOfMatcher from
+// sharing the same EitherOfMatcherImpl<T> class.
+template <typename T>
+class EitherOfMatcherImpl : public MatcherInterface<T> {
+ public:
+  EitherOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeTo(os);
+    *os << ") or (";
+    matcher2_.DescribeTo(os);
+    *os << ")";
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeNegationTo(os);
+    *os << ") and (";
+    matcher2_.DescribeNegationTo(os);
+    *os << ")";
+  }
+
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    // If either matcher1_ or matcher2_ matches x, we just need to
+    // explain why *one* of them matches.
+    StringMatchResultListener listener1;
+    if (matcher1_.MatchAndExplain(x, &listener1)) {
+      *listener << listener1.str();
+      return true;
+    }
+
+    StringMatchResultListener listener2;
+    if (matcher2_.MatchAndExplain(x, &listener2)) {
+      *listener << listener2.str();
+      return true;
+    }
+
+    // Otherwise we need to explain why *both* of them fail.
+    const internal::string s1 = listener1.str();
+    const internal::string s2 = listener2.str();
+
+    if (s1 == "") {
+      *listener << s2;
+    } else {
+      *listener << s1;
+      if (s2 != "") {
+        *listener << ", and " << s2;
+      }
+    }
+    return false;
+  }
+
+ private:
+  const Matcher<T> matcher1_;
+  const Matcher<T> matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl);
+};
+
+#if GTEST_LANG_CXX11
+// AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...).
+template <typename... Args>
+using AnyOfMatcher = VariadicMatcher<EitherOfMatcherImpl, Args...>;
+
+#endif  // GTEST_LANG_CXX11
+
+// Used for implementing the AnyOf(m_1, ..., m_n) matcher, which
+// matches a value that matches at least one of the matchers m_1, ...,
+// and m_n.
+template <typename Matcher1, typename Matcher2>
+class EitherOfMatcher {
+ public:
+  EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  // This template type conversion operator allows a
+  // EitherOfMatcher<Matcher1, Matcher2> object to match any type that
+  // both Matcher1 and Matcher2 can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new EitherOfMatcherImpl<T>(
+        SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));
+  }
+
+ private:
+  Matcher1 matcher1_;
+  Matcher2 matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(EitherOfMatcher);
+};
+
+// Used for implementing Truly(pred), which turns a predicate into a
+// matcher.
+template <typename Predicate>
+class TrulyMatcher {
+ public:
+  explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}
+
+  // This method template allows Truly(pred) to be used as a matcher
+  // for type T where T is the argument type of predicate 'pred'.  The
+  // argument is passed by reference as the predicate may be
+  // interested in the address of the argument.
+  template <typename T>
+  bool MatchAndExplain(T& x,  // NOLINT
+                       MatchResultListener* /* listener */) const {
+    // Without the if-statement, MSVC sometimes warns about converting
+    // a value to bool (warning 4800).
+    //
+    // We cannot write 'return !!predicate_(x);' as that doesn't work
+    // when predicate_(x) returns a class convertible to bool but
+    // having no operator!().
+    if (predicate_(x))
+      return true;
+    return false;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "satisfies the given predicate";
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't satisfy the given predicate";
+  }
+
+ private:
+  Predicate predicate_;
+
+  GTEST_DISALLOW_ASSIGN_(TrulyMatcher);
+};
+
+// Used for implementing Matches(matcher), which turns a matcher into
+// a predicate.
+template <typename M>
+class MatcherAsPredicate {
+ public:
+  explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}
+
+  // This template operator() allows Matches(m) to be used as a
+  // predicate on type T where m is a matcher on type T.
+  //
+  // The argument x is passed by reference instead of by value, as
+  // some matcher may be interested in its address (e.g. as in
+  // Matches(Ref(n))(x)).
+  template <typename T>
+  bool operator()(const T& x) const {
+    // We let matcher_ commit to a particular type here instead of
+    // when the MatcherAsPredicate object was constructed.  This
+    // allows us to write Matches(m) where m is a polymorphic matcher
+    // (e.g. Eq(5)).
+    //
+    // If we write Matcher<T>(matcher_).Matches(x) here, it won't
+    // compile when matcher_ has type Matcher<const T&>; if we write
+    // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
+    // when matcher_ has type Matcher<T>; if we just write
+    // matcher_.Matches(x), it won't compile when matcher_ is
+    // polymorphic, e.g. Eq(5).
+    //
+    // MatcherCast<const T&>() is necessary for making the code work
+    // in all of the above situations.
+    return MatcherCast<const T&>(matcher_).Matches(x);
+  }
+
+ private:
+  M matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(MatcherAsPredicate);
+};
+
+// For implementing ASSERT_THAT() and EXPECT_THAT().  The template
+// argument M must be a type that can be converted to a matcher.
+template <typename M>
+class PredicateFormatterFromMatcher {
+ public:
+  explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {}
+
+  // This template () operator allows a PredicateFormatterFromMatcher
+  // object to act as a predicate-formatter suitable for using with
+  // Google Test's EXPECT_PRED_FORMAT1() macro.
+  template <typename T>
+  AssertionResult operator()(const char* value_text, const T& x) const {
+    // We convert matcher_ to a Matcher<const T&> *now* instead of
+    // when the PredicateFormatterFromMatcher object was constructed,
+    // as matcher_ may be polymorphic (e.g. NotNull()) and we won't
+    // know which type to instantiate it to until we actually see the
+    // type of x here.
+    //
+    // We write SafeMatcherCast<const T&>(matcher_) instead of
+    // Matcher<const T&>(matcher_), as the latter won't compile when
+    // matcher_ has type Matcher<T> (e.g. An<int>()).
+    // We don't write MatcherCast<const T&> either, as that allows
+    // potentially unsafe downcasting of the matcher argument.
+    const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);
+    StringMatchResultListener listener;
+    if (MatchPrintAndExplain(x, matcher, &listener))
+      return AssertionSuccess();
+
+    ::std::stringstream ss;
+    ss << "Value of: " << value_text << "\n"
+       << "Expected: ";
+    matcher.DescribeTo(&ss);
+    ss << "\n  Actual: " << listener.str();
+    return AssertionFailure() << ss.str();
+  }
+
+ private:
+  const M matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PredicateFormatterFromMatcher);
+};
+
+// A helper function for converting a matcher to a predicate-formatter
+// without the user needing to explicitly write the type.  This is
+// used for implementing ASSERT_THAT() and EXPECT_THAT().
+// Implementation detail: 'matcher' is received by-value to force decaying.
+template <typename M>
+inline PredicateFormatterFromMatcher<M>
+MakePredicateFormatterFromMatcher(M matcher) {
+  return PredicateFormatterFromMatcher<M>(internal::move(matcher));
+}
+
+// Implements the polymorphic floating point equality matcher, which matches
+// two float values using ULP-based approximation or, optionally, a
+// user-specified epsilon.  The template is meant to be instantiated with
+// FloatType being either float or double.
+template <typename FloatType>
+class FloatingEqMatcher {
+ public:
+  // Constructor for FloatingEqMatcher.
+  // The matcher's input will be compared with expected.  The matcher treats two
+  // NANs as equal if nan_eq_nan is true.  Otherwise, under IEEE standards,
+  // equality comparisons between NANs will always return false.  We specify a
+  // negative max_abs_error_ term to indicate that ULP-based approximation will
+  // be used for comparison.
+  FloatingEqMatcher(FloatType expected, bool nan_eq_nan) :
+    expected_(expected), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {
+  }
+
+  // Constructor that supports a user-specified max_abs_error that will be used
+  // for comparison instead of ULP-based approximation.  The max absolute
+  // should be non-negative.
+  FloatingEqMatcher(FloatType expected, bool nan_eq_nan,
+                    FloatType max_abs_error)
+      : expected_(expected),
+        nan_eq_nan_(nan_eq_nan),
+        max_abs_error_(max_abs_error) {
+    GTEST_CHECK_(max_abs_error >= 0)
+        << ", where max_abs_error is" << max_abs_error;
+  }
+
+  // Implements floating point equality matcher as a Matcher<T>.
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
+        : expected_(expected),
+          nan_eq_nan_(nan_eq_nan),
+          max_abs_error_(max_abs_error) {}
+
+    virtual bool MatchAndExplain(T value,
+                                 MatchResultListener* listener) const {
+      const FloatingPoint<FloatType> actual(value), expected(expected_);
+
+      // Compares NaNs first, if nan_eq_nan_ is true.
+      if (actual.is_nan() || expected.is_nan()) {
+        if (actual.is_nan() && expected.is_nan()) {
+          return nan_eq_nan_;
+        }
+        // One is nan; the other is not nan.
+        return false;
+      }
+      if (HasMaxAbsError()) {
+        // We perform an equality check so that inf will match inf, regardless
+        // of error bounds.  If the result of value - expected_ would result in
+        // overflow or if either value is inf, the default result is infinity,
+        // which should only match if max_abs_error_ is also infinity.
+        if (value == expected_) {
+          return true;
+        }
+
+        const FloatType diff = value - expected_;
+        if (fabs(diff) <= max_abs_error_) {
+          return true;
+        }
+
+        if (listener->IsInterested()) {
+          *listener << "which is " << diff << " from " << expected_;
+        }
+        return false;
+      } else {
+        return actual.AlmostEquals(expected);
+      }
+    }
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      // os->precision() returns the previously set precision, which we
+      // store to restore the ostream to its original configuration
+      // after outputting.
+      const ::std::streamsize old_precision = os->precision(
+          ::std::numeric_limits<FloatType>::digits10 + 2);
+      if (FloatingPoint<FloatType>(expected_).is_nan()) {
+        if (nan_eq_nan_) {
+          *os << "is NaN";
+        } else {
+          *os << "never matches";
+        }
+      } else {
+        *os << "is approximately " << expected_;
+        if (HasMaxAbsError()) {
+          *os << " (absolute error <= " << max_abs_error_ << ")";
+        }
+      }
+      os->precision(old_precision);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      // As before, get original precision.
+      const ::std::streamsize old_precision = os->precision(
+          ::std::numeric_limits<FloatType>::digits10 + 2);
+      if (FloatingPoint<FloatType>(expected_).is_nan()) {
+        if (nan_eq_nan_) {
+          *os << "isn't NaN";
+        } else {
+          *os << "is anything";
+        }
+      } else {
+        *os << "isn't approximately " << expected_;
+        if (HasMaxAbsError()) {
+          *os << " (absolute error > " << max_abs_error_ << ")";
+        }
+      }
+      // Restore original precision.
+      os->precision(old_precision);
+    }
+
+   private:
+    bool HasMaxAbsError() const {
+      return max_abs_error_ >= 0;
+    }
+
+    const FloatType expected_;
+    const bool nan_eq_nan_;
+    // max_abs_error will be used for value comparison when >= 0.
+    const FloatType max_abs_error_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  // The following 3 type conversion operators allow FloatEq(expected) and
+  // NanSensitiveFloatEq(expected) to be used as a Matcher<float>, a
+  // Matcher<const float&>, or a Matcher<float&>, but nothing else.
+  // (While Google's C++ coding style doesn't allow arguments passed
+  // by non-const reference, we may see them in code not conforming to
+  // the style.  Therefore Google Mock needs to support them.)
+  operator Matcher<FloatType>() const {
+    return MakeMatcher(
+        new Impl<FloatType>(expected_, nan_eq_nan_, max_abs_error_));
+  }
+
+  operator Matcher<const FloatType&>() const {
+    return MakeMatcher(
+        new Impl<const FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
+  }
+
+  operator Matcher<FloatType&>() const {
+    return MakeMatcher(
+        new Impl<FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
+  }
+
+ private:
+  const FloatType expected_;
+  const bool nan_eq_nan_;
+  // max_abs_error will be used for value comparison when >= 0.
+  const FloatType max_abs_error_;
+
+  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
+};
+
+// Implements the Pointee(m) matcher for matching a pointer whose
+// pointee matches matcher m.  The pointer can be either raw or smart.
+template <typename InnerMatcher>
+class PointeeMatcher {
+ public:
+  explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
+
+  // This type conversion operator template allows Pointee(m) to be
+  // used as a matcher for any pointer type whose pointee type is
+  // compatible with the inner matcher, where type Pointer can be
+  // either a raw pointer or a smart pointer.
+  //
+  // The reason we do this instead of relying on
+  // MakePolymorphicMatcher() is that the latter is not flexible
+  // enough for implementing the DescribeTo() method of Pointee().
+  template <typename Pointer>
+  operator Matcher<Pointer>() const {
+    return MakeMatcher(new Impl<Pointer>(matcher_));
+  }
+
+ private:
+  // The monomorphic implementation that works for a particular pointer type.
+  template <typename Pointer>
+  class Impl : public MatcherInterface<Pointer> {
+   public:
+    typedef typename PointeeOf<GTEST_REMOVE_CONST_(  // NOLINT
+        GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee;
+
+    explicit Impl(const InnerMatcher& matcher)
+        : matcher_(MatcherCast<const Pointee&>(matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "points to a value that ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "does not point to a value that ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual bool MatchAndExplain(Pointer pointer,
+                                 MatchResultListener* listener) const {
+      if (GetRawPointer(pointer) == NULL)
+        return false;
+
+      *listener << "which points to ";
+      return MatchPrintAndExplain(*pointer, matcher_, listener);
+    }
+
+   private:
+    const Matcher<const Pointee&> matcher_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const InnerMatcher matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PointeeMatcher);
+};
+
+// Implements the WhenDynamicCastTo<T>(m) matcher that matches a pointer or
+// reference that matches inner_matcher when dynamic_cast<T> is applied.
+// The result of dynamic_cast<To> is forwarded to the inner matcher.
+// If To is a pointer and the cast fails, the inner matcher will receive NULL.
+// If To is a reference and the cast fails, this matcher returns false
+// immediately.
+template <typename To>
+class WhenDynamicCastToMatcherBase {
+ public:
+  explicit WhenDynamicCastToMatcherBase(const Matcher<To>& matcher)
+      : matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    GetCastTypeDescription(os);
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    GetCastTypeDescription(os);
+    matcher_.DescribeNegationTo(os);
+  }
+
+ protected:
+  const Matcher<To> matcher_;
+
+  static string GetToName() {
+#if GTEST_HAS_RTTI
+    return GetTypeName<To>();
+#else  // GTEST_HAS_RTTI
+    return "the target type";
+#endif  // GTEST_HAS_RTTI
+  }
+
+ private:
+  static void GetCastTypeDescription(::std::ostream* os) {
+    *os << "when dynamic_cast to " << GetToName() << ", ";
+  }
+
+  GTEST_DISALLOW_ASSIGN_(WhenDynamicCastToMatcherBase);
+};
+
+// Primary template.
+// To is a pointer. Cast and forward the result.
+template <typename To>
+class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
+ public:
+  explicit WhenDynamicCastToMatcher(const Matcher<To>& matcher)
+      : WhenDynamicCastToMatcherBase<To>(matcher) {}
+
+  template <typename From>
+  bool MatchAndExplain(From from, MatchResultListener* listener) const {
+    // TODO(sbenza): Add more detail on failures. ie did the dyn_cast fail?
+    To to = dynamic_cast<To>(from);
+    return MatchPrintAndExplain(to, this->matcher_, listener);
+  }
+};
+
+// Specialize for references.
+// In this case we return false if the dynamic_cast fails.
+template <typename To>
+class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
+ public:
+  explicit WhenDynamicCastToMatcher(const Matcher<To&>& matcher)
+      : WhenDynamicCastToMatcherBase<To&>(matcher) {}
+
+  template <typename From>
+  bool MatchAndExplain(From& from, MatchResultListener* listener) const {
+    // We don't want an std::bad_cast here, so do the cast with pointers.
+    To* to = dynamic_cast<To*>(&from);
+    if (to == NULL) {
+      *listener << "which cannot be dynamic_cast to " << this->GetToName();
+      return false;
+    }
+    return MatchPrintAndExplain(*to, this->matcher_, listener);
+  }
+};
+
+// Implements the Field() matcher for matching a field (i.e. member
+// variable) of an object.
+template <typename Class, typename FieldType>
+class FieldMatcher {
+ public:
+  FieldMatcher(FieldType Class::*field,
+               const Matcher<const FieldType&>& matcher)
+      : field_(field), matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "is an object whose given field ";
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is an object whose given field ";
+    matcher_.DescribeNegationTo(os);
+  }
+
+  template <typename T>
+  bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
+    return MatchAndExplainImpl(
+        typename ::testing::internal::
+            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
+        value, listener);
+  }
+
+ private:
+  // The first argument of MatchAndExplainImpl() is needed to help
+  // Symbian's C++ compiler choose which overload to use.  Its type is
+  // true_type iff the Field() matcher is used to match a pointer.
+  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
+                           MatchResultListener* listener) const {
+    *listener << "whose given field is ";
+    return MatchPrintAndExplain(obj.*field_, matcher_, listener);
+  }
+
+  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
+                           MatchResultListener* listener) const {
+    if (p == NULL)
+      return false;
+
+    *listener << "which points to an object ";
+    // Since *p has a field, it must be a class/struct/union type and
+    // thus cannot be a pointer.  Therefore we pass false_type() as
+    // the first argument.
+    return MatchAndExplainImpl(false_type(), *p, listener);
+  }
+
+  const FieldType Class::*field_;
+  const Matcher<const FieldType&> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(FieldMatcher);
+};
+
+// Implements the Property() matcher for matching a property
+// (i.e. return value of a getter method) of an object.
+template <typename Class, typename PropertyType>
+class PropertyMatcher {
+ public:
+  // The property may have a reference type, so 'const PropertyType&'
+  // may cause double references and fail to compile.  That's why we
+  // need GTEST_REFERENCE_TO_CONST, which works regardless of
+  // PropertyType being a reference or not.
+  typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty;
+
+  PropertyMatcher(PropertyType (Class::*property)() const,
+                  const Matcher<RefToConstProperty>& matcher)
+      : property_(property), matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "is an object whose given property ";
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is an object whose given property ";
+    matcher_.DescribeNegationTo(os);
+  }
+
+  template <typename T>
+  bool MatchAndExplain(const T&value, MatchResultListener* listener) const {
+    return MatchAndExplainImpl(
+        typename ::testing::internal::
+            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
+        value, listener);
+  }
+
+ private:
+  // The first argument of MatchAndExplainImpl() is needed to help
+  // Symbian's C++ compiler choose which overload to use.  Its type is
+  // true_type iff the Property() matcher is used to match a pointer.
+  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
+                           MatchResultListener* listener) const {
+    *listener << "whose given property is ";
+    // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
+    // which takes a non-const reference as argument.
+#if defined(_PREFAST_ ) && _MSC_VER == 1800
+    // Workaround bug in VC++ 2013's /analyze parser.
+    // https://connect.microsoft.com/VisualStudio/feedback/details/1106363/internal-compiler-error-with-analyze-due-to-failure-to-infer-move
+    posix::Abort();  // To make sure it is never run.
+    return false;
+#else
+    RefToConstProperty result = (obj.*property_)();
+    return MatchPrintAndExplain(result, matcher_, listener);
+#endif
+  }
+
+  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
+                           MatchResultListener* listener) const {
+    if (p == NULL)
+      return false;
+
+    *listener << "which points to an object ";
+    // Since *p has a property method, it must be a class/struct/union
+    // type and thus cannot be a pointer.  Therefore we pass
+    // false_type() as the first argument.
+    return MatchAndExplainImpl(false_type(), *p, listener);
+  }
+
+  PropertyType (Class::*property_)() const;
+  const Matcher<RefToConstProperty> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PropertyMatcher);
+};
+
+// Type traits specifying various features of different functors for ResultOf.
+// The default template specifies features for functor objects.
+// Functor classes have to typedef argument_type and result_type
+// to be compatible with ResultOf.
+template <typename Functor>
+struct CallableTraits {
+  typedef typename Functor::result_type ResultType;
+  typedef Functor StorageType;
+
+  static void CheckIsValid(Functor /* functor */) {}
+  template <typename T>
+  static ResultType Invoke(Functor f, T arg) { return f(arg); }
+};
+
+// Specialization for function pointers.
+template <typename ArgType, typename ResType>
+struct CallableTraits<ResType(*)(ArgType)> {
+  typedef ResType ResultType;
+  typedef ResType(*StorageType)(ArgType);
+
+  static void CheckIsValid(ResType(*f)(ArgType)) {
+    GTEST_CHECK_(f != NULL)
+        << "NULL function pointer is passed into ResultOf().";
+  }
+  template <typename T>
+  static ResType Invoke(ResType(*f)(ArgType), T arg) {
+    return (*f)(arg);
+  }
+};
+
+// Implements the ResultOf() matcher for matching a return value of a
+// unary function of an object.
+template <typename Callable>
+class ResultOfMatcher {
+ public:
+  typedef typename CallableTraits<Callable>::ResultType ResultType;
+
+  ResultOfMatcher(Callable callable, const Matcher<ResultType>& matcher)
+      : callable_(callable), matcher_(matcher) {
+    CallableTraits<Callable>::CheckIsValid(callable_);
+  }
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new Impl<T>(callable_, matcher_));
+  }
+
+ private:
+  typedef typename CallableTraits<Callable>::StorageType CallableStorageType;
+
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    Impl(CallableStorageType callable, const Matcher<ResultType>& matcher)
+        : callable_(callable), matcher_(matcher) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "is mapped by the given callable to a value that ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "is mapped by the given callable to a value that ";
+      matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const {
+      *listener << "which is mapped by the given callable to ";
+      // Cannot pass the return value (for example, int) to
+      // MatchPrintAndExplain, which takes a non-const reference as argument.
+      ResultType result =
+          CallableTraits<Callable>::template Invoke<T>(callable_, obj);
+      return MatchPrintAndExplain(result, matcher_, listener);
+    }
+
+   private:
+    // Functors often define operator() as non-const method even though
+    // they are actualy stateless. But we need to use them even when
+    // 'this' is a const pointer. It's the user's responsibility not to
+    // use stateful callables with ResultOf(), which does't guarantee
+    // how many times the callable will be invoked.
+    mutable CallableStorageType callable_;
+    const Matcher<ResultType> matcher_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };  // class Impl
+
+  const CallableStorageType callable_;
+  const Matcher<ResultType> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ResultOfMatcher);
+};
+
+// Implements a matcher that checks the size of an STL-style container.
+template <typename SizeMatcher>
+class SizeIsMatcher {
+ public:
+  explicit SizeIsMatcher(const SizeMatcher& size_matcher)
+       : size_matcher_(size_matcher) {
+  }
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new Impl<Container>(size_matcher_));
+  }
+
+  template <typename Container>
+  class Impl : public MatcherInterface<Container> {
+   public:
+    typedef internal::StlContainerView<
+         GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
+    typedef typename ContainerView::type::size_type SizeType;
+    explicit Impl(const SizeMatcher& size_matcher)
+        : size_matcher_(MatcherCast<SizeType>(size_matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "size ";
+      size_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "size ";
+      size_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(Container container,
+                                 MatchResultListener* listener) const {
+      SizeType size = container.size();
+      StringMatchResultListener size_listener;
+      const bool result = size_matcher_.MatchAndExplain(size, &size_listener);
+      *listener
+          << "whose size " << size << (result ? " matches" : " doesn't match");
+      PrintIfNotEmpty(size_listener.str(), listener->stream());
+      return result;
+    }
+
+   private:
+    const Matcher<SizeType> size_matcher_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const SizeMatcher size_matcher_;
+  GTEST_DISALLOW_ASSIGN_(SizeIsMatcher);
+};
+
+// Implements a matcher that checks the begin()..end() distance of an STL-style
+// container.
+template <typename DistanceMatcher>
+class BeginEndDistanceIsMatcher {
+ public:
+  explicit BeginEndDistanceIsMatcher(const DistanceMatcher& distance_matcher)
+      : distance_matcher_(distance_matcher) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new Impl<Container>(distance_matcher_));
+  }
+
+  template <typename Container>
+  class Impl : public MatcherInterface<Container> {
+   public:
+    typedef internal::StlContainerView<
+        GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
+    typedef typename std::iterator_traits<
+        typename ContainerView::type::const_iterator>::difference_type
+        DistanceType;
+    explicit Impl(const DistanceMatcher& distance_matcher)
+        : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "distance between begin() and end() ";
+      distance_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "distance between begin() and end() ";
+      distance_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(Container container,
+                                 MatchResultListener* listener) const {
+#if GTEST_HAS_STD_BEGIN_AND_END_
+      using std::begin;
+      using std::end;
+      DistanceType distance = std::distance(begin(container), end(container));
+#else
+      DistanceType distance = std::distance(container.begin(), container.end());
+#endif
+      StringMatchResultListener distance_listener;
+      const bool result =
+          distance_matcher_.MatchAndExplain(distance, &distance_listener);
+      *listener << "whose distance between begin() and end() " << distance
+                << (result ? " matches" : " doesn't match");
+      PrintIfNotEmpty(distance_listener.str(), listener->stream());
+      return result;
+    }
+
+   private:
+    const Matcher<DistanceType> distance_matcher_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const DistanceMatcher distance_matcher_;
+  GTEST_DISALLOW_ASSIGN_(BeginEndDistanceIsMatcher);
+};
+
+// Implements an equality matcher for any STL-style container whose elements
+// support ==. This matcher is like Eq(), but its failure explanations provide
+// more detailed information that is useful when the container is used as a set.
+// The failure message reports elements that are in one of the operands but not
+// the other. The failure messages do not report duplicate or out-of-order
+// elements in the containers (which don't properly matter to sets, but can
+// occur if the containers are vectors or lists, for example).
+//
+// Uses the container's const_iterator, value_type, operator ==,
+// begin(), and end().
+template <typename Container>
+class ContainerEqMatcher {
+ public:
+  typedef internal::StlContainerView<Container> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+
+  // We make a copy of expected in case the elements in it are modified
+  // after this matcher is created.
+  explicit ContainerEqMatcher(const Container& expected)
+      : expected_(View::Copy(expected)) {
+    // Makes sure the user doesn't instantiate this class template
+    // with a const or reference type.
+    (void)testing::StaticAssertTypeEq<Container,
+        GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "equals ";
+    UniversalPrint(expected_, os);
+  }
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "does not equal ";
+    UniversalPrint(expected_, os);
+  }
+
+  template <typename LhsContainer>
+  bool MatchAndExplain(const LhsContainer& lhs,
+                       MatchResultListener* listener) const {
+    // GTEST_REMOVE_CONST_() is needed to work around an MSVC 8.0 bug
+    // that causes LhsContainer to be a const type sometimes.
+    typedef internal::StlContainerView<GTEST_REMOVE_CONST_(LhsContainer)>
+        LhsView;
+    typedef typename LhsView::type LhsStlContainer;
+    StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
+    if (lhs_stl_container == expected_)
+      return true;
+
+    ::std::ostream* const os = listener->stream();
+    if (os != NULL) {
+      // Something is different. Check for extra values first.
+      bool printed_header = false;
+      for (typename LhsStlContainer::const_iterator it =
+               lhs_stl_container.begin();
+           it != lhs_stl_container.end(); ++it) {
+        if (internal::ArrayAwareFind(expected_.begin(), expected_.end(), *it) ==
+            expected_.end()) {
+          if (printed_header) {
+            *os << ", ";
+          } else {
+            *os << "which has these unexpected elements: ";
+            printed_header = true;
+          }
+          UniversalPrint(*it, os);
+        }
+      }
+
+      // Now check for missing values.
+      bool printed_header2 = false;
+      for (typename StlContainer::const_iterator it = expected_.begin();
+           it != expected_.end(); ++it) {
+        if (internal::ArrayAwareFind(
+                lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
+            lhs_stl_container.end()) {
+          if (printed_header2) {
+            *os << ", ";
+          } else {
+            *os << (printed_header ? ",\nand" : "which")
+                << " doesn't have these expected elements: ";
+            printed_header2 = true;
+          }
+          UniversalPrint(*it, os);
+        }
+      }
+    }
+
+    return false;
+  }
+
+ private:
+  const StlContainer expected_;
+
+  GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher);
+};
+
+// A comparator functor that uses the < operator to compare two values.
+struct LessComparator {
+  template <typename T, typename U>
+  bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; }
+};
+
+// Implements WhenSortedBy(comparator, container_matcher).
+template <typename Comparator, typename ContainerMatcher>
+class WhenSortedByMatcher {
+ public:
+  WhenSortedByMatcher(const Comparator& comparator,
+                      const ContainerMatcher& matcher)
+      : comparator_(comparator), matcher_(matcher) {}
+
+  template <typename LhsContainer>
+  operator Matcher<LhsContainer>() const {
+    return MakeMatcher(new Impl<LhsContainer>(comparator_, matcher_));
+  }
+
+  template <typename LhsContainer>
+  class Impl : public MatcherInterface<LhsContainer> {
+   public:
+    typedef internal::StlContainerView<
+         GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;
+    typedef typename LhsView::type LhsStlContainer;
+    typedef typename LhsView::const_reference LhsStlContainerReference;
+    // Transforms std::pair<const Key, Value> into std::pair<Key, Value>
+    // so that we can match associative containers.
+    typedef typename RemoveConstFromKey<
+        typename LhsStlContainer::value_type>::type LhsValue;
+
+    Impl(const Comparator& comparator, const ContainerMatcher& matcher)
+        : comparator_(comparator), matcher_(matcher) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "(when sorted) ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "(when sorted) ";
+      matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(LhsContainer lhs,
+                                 MatchResultListener* listener) const {
+      LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
+      ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
+                                               lhs_stl_container.end());
+      ::std::sort(
+           sorted_container.begin(), sorted_container.end(), comparator_);
+
+      if (!listener->IsInterested()) {
+        // If the listener is not interested, we do not need to
+        // construct the inner explanation.
+        return matcher_.Matches(sorted_container);
+      }
+
+      *listener << "which is ";
+      UniversalPrint(sorted_container, listener->stream());
+      *listener << " when sorted";
+
+      StringMatchResultListener inner_listener;
+      const bool match = matcher_.MatchAndExplain(sorted_container,
+                                                  &inner_listener);
+      PrintIfNotEmpty(inner_listener.str(), listener->stream());
+      return match;
+    }
+
+   private:
+    const Comparator comparator_;
+    const Matcher<const ::std::vector<LhsValue>&> matcher_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
+  };
+
+ private:
+  const Comparator comparator_;
+  const ContainerMatcher matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher);
+};
+
+// Implements Pointwise(tuple_matcher, rhs_container).  tuple_matcher
+// must be able to be safely cast to Matcher<tuple<const T1&, const
+// T2&> >, where T1 and T2 are the types of elements in the LHS
+// container and the RHS container respectively.
+template <typename TupleMatcher, typename RhsContainer>
+class PointwiseMatcher {
+ public:
+  typedef internal::StlContainerView<RhsContainer> RhsView;
+  typedef typename RhsView::type RhsStlContainer;
+  typedef typename RhsStlContainer::value_type RhsValue;
+
+  // Like ContainerEq, we make a copy of rhs in case the elements in
+  // it are modified after this matcher is created.
+  PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs)
+      : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {
+    // Makes sure the user doesn't instantiate this class template
+    // with a const or reference type.
+    (void)testing::StaticAssertTypeEq<RhsContainer,
+        GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>();
+  }
+
+  template <typename LhsContainer>
+  operator Matcher<LhsContainer>() const {
+    return MakeMatcher(new Impl<LhsContainer>(tuple_matcher_, rhs_));
+  }
+
+  template <typename LhsContainer>
+  class Impl : public MatcherInterface<LhsContainer> {
+   public:
+    typedef internal::StlContainerView<
+         GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;
+    typedef typename LhsView::type LhsStlContainer;
+    typedef typename LhsView::const_reference LhsStlContainerReference;
+    typedef typename LhsStlContainer::value_type LhsValue;
+    // We pass the LHS value and the RHS value to the inner matcher by
+    // reference, as they may be expensive to copy.  We must use tuple
+    // instead of pair here, as a pair cannot hold references (C++ 98,
+    // 20.2.2 [lib.pairs]).
+    typedef ::testing::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
+
+    Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
+        // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
+        : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
+          rhs_(rhs) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "contains " << rhs_.size()
+          << " values, where each value and its corresponding value in ";
+      UniversalPrinter<RhsStlContainer>::Print(rhs_, os);
+      *os << " ";
+      mono_tuple_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "doesn't contain exactly " << rhs_.size()
+          << " values, or contains a value x at some index i"
+          << " where x and the i-th value of ";
+      UniversalPrint(rhs_, os);
+      *os << " ";
+      mono_tuple_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(LhsContainer lhs,
+                                 MatchResultListener* listener) const {
+      LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
+      const size_t actual_size = lhs_stl_container.size();
+      if (actual_size != rhs_.size()) {
+        *listener << "which contains " << actual_size << " values";
+        return false;
+      }
+
+      typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
+      typename RhsStlContainer::const_iterator right = rhs_.begin();
+      for (size_t i = 0; i != actual_size; ++i, ++left, ++right) {
+        const InnerMatcherArg value_pair(*left, *right);
+
+        if (listener->IsInterested()) {
+          StringMatchResultListener inner_listener;
+          if (!mono_tuple_matcher_.MatchAndExplain(
+                  value_pair, &inner_listener)) {
+            *listener << "where the value pair (";
+            UniversalPrint(*left, listener->stream());
+            *listener << ", ";
+            UniversalPrint(*right, listener->stream());
+            *listener << ") at index #" << i << " don't match";
+            PrintIfNotEmpty(inner_listener.str(), listener->stream());
+            return false;
+          }
+        } else {
+          if (!mono_tuple_matcher_.Matches(value_pair))
+            return false;
+        }
+      }
+
+      return true;
+    }
+
+   private:
+    const Matcher<InnerMatcherArg> mono_tuple_matcher_;
+    const RhsStlContainer rhs_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const TupleMatcher tuple_matcher_;
+  const RhsStlContainer rhs_;
+
+  GTEST_DISALLOW_ASSIGN_(PointwiseMatcher);
+};
+
+// Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
+template <typename Container>
+class QuantifierMatcherImpl : public MatcherInterface<Container> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+  typedef StlContainerView<RawContainer> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+  typedef typename StlContainer::value_type Element;
+
+  template <typename InnerMatcher>
+  explicit QuantifierMatcherImpl(InnerMatcher inner_matcher)
+      : inner_matcher_(
+           testing::SafeMatcherCast<const Element&>(inner_matcher)) {}
+
+  // Checks whether:
+  // * All elements in the container match, if all_elements_should_match.
+  // * Any element in the container matches, if !all_elements_should_match.
+  bool MatchAndExplainImpl(bool all_elements_should_match,
+                           Container container,
+                           MatchResultListener* listener) const {
+    StlContainerReference stl_container = View::ConstReference(container);
+    size_t i = 0;
+    for (typename StlContainer::const_iterator it = stl_container.begin();
+         it != stl_container.end(); ++it, ++i) {
+      StringMatchResultListener inner_listener;
+      const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
+
+      if (matches != all_elements_should_match) {
+        *listener << "whose element #" << i
+                  << (matches ? " matches" : " doesn't match");
+        PrintIfNotEmpty(inner_listener.str(), listener->stream());
+        return !all_elements_should_match;
+      }
+    }
+    return all_elements_should_match;
+  }
+
+ protected:
+  const Matcher<const Element&> inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl);
+};
+
+// Implements Contains(element_matcher) for the given argument type Container.
+// Symmetric to EachMatcherImpl.
+template <typename Container>
+class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
+ public:
+  template <typename InnerMatcher>
+  explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
+      : QuantifierMatcherImpl<Container>(inner_matcher) {}
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "contains at least one element that ";
+    this->inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't contain any element that ";
+    this->inner_matcher_.DescribeTo(os);
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    return this->MatchAndExplainImpl(false, container, listener);
+  }
+
+ private:
+  GTEST_DISALLOW_ASSIGN_(ContainsMatcherImpl);
+};
+
+// Implements Each(element_matcher) for the given argument type Container.
+// Symmetric to ContainsMatcherImpl.
+template <typename Container>
+class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
+ public:
+  template <typename InnerMatcher>
+  explicit EachMatcherImpl(InnerMatcher inner_matcher)
+      : QuantifierMatcherImpl<Container>(inner_matcher) {}
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "only contains elements that ";
+    this->inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "contains some element that ";
+    this->inner_matcher_.DescribeNegationTo(os);
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    return this->MatchAndExplainImpl(true, container, listener);
+  }
+
+ private:
+  GTEST_DISALLOW_ASSIGN_(EachMatcherImpl);
+};
+
+// Implements polymorphic Contains(element_matcher).
+template <typename M>
+class ContainsMatcher {
+ public:
+  explicit ContainsMatcher(M m) : inner_matcher_(m) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new ContainsMatcherImpl<Container>(inner_matcher_));
+  }
+
+ private:
+  const M inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ContainsMatcher);
+};
+
+// Implements polymorphic Each(element_matcher).
+template <typename M>
+class EachMatcher {
+ public:
+  explicit EachMatcher(M m) : inner_matcher_(m) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new EachMatcherImpl<Container>(inner_matcher_));
+  }
+
+ private:
+  const M inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(EachMatcher);
+};
+
+// Implements Key(inner_matcher) for the given argument pair type.
+// Key(inner_matcher) matches an std::pair whose 'first' field matches
+// inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an
+// std::map that contains at least one element whose key is >= 5.
+template <typename PairType>
+class KeyMatcherImpl : public MatcherInterface<PairType> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
+  typedef typename RawPairType::first_type KeyType;
+
+  template <typename InnerMatcher>
+  explicit KeyMatcherImpl(InnerMatcher inner_matcher)
+      : inner_matcher_(
+          testing::SafeMatcherCast<const KeyType&>(inner_matcher)) {
+  }
+
+  // Returns true iff 'key_value.first' (the key) matches the inner matcher.
+  virtual bool MatchAndExplain(PairType key_value,
+                               MatchResultListener* listener) const {
+    StringMatchResultListener inner_listener;
+    const bool match = inner_matcher_.MatchAndExplain(key_value.first,
+                                                      &inner_listener);
+    const internal::string explanation = inner_listener.str();
+    if (explanation != "") {
+      *listener << "whose first field is a value " << explanation;
+    }
+    return match;
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "has a key that ";
+    inner_matcher_.DescribeTo(os);
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't have a key that ";
+    inner_matcher_.DescribeTo(os);
+  }
+
+ private:
+  const Matcher<const KeyType&> inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(KeyMatcherImpl);
+};
+
+// Implements polymorphic Key(matcher_for_key).
+template <typename M>
+class KeyMatcher {
+ public:
+  explicit KeyMatcher(M m) : matcher_for_key_(m) {}
+
+  template <typename PairType>
+  operator Matcher<PairType>() const {
+    return MakeMatcher(new KeyMatcherImpl<PairType>(matcher_for_key_));
+  }
+
+ private:
+  const M matcher_for_key_;
+
+  GTEST_DISALLOW_ASSIGN_(KeyMatcher);
+};
+
+// Implements Pair(first_matcher, second_matcher) for the given argument pair
+// type with its two matchers. See Pair() function below.
+template <typename PairType>
+class PairMatcherImpl : public MatcherInterface<PairType> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
+  typedef typename RawPairType::first_type FirstType;
+  typedef typename RawPairType::second_type SecondType;
+
+  template <typename FirstMatcher, typename SecondMatcher>
+  PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
+      : first_matcher_(
+            testing::SafeMatcherCast<const FirstType&>(first_matcher)),
+        second_matcher_(
+            testing::SafeMatcherCast<const SecondType&>(second_matcher)) {
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "has a first field that ";
+    first_matcher_.DescribeTo(os);
+    *os << ", and has a second field that ";
+    second_matcher_.DescribeTo(os);
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "has a first field that ";
+    first_matcher_.DescribeNegationTo(os);
+    *os << ", or has a second field that ";
+    second_matcher_.DescribeNegationTo(os);
+  }
+
+  // Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second'
+  // matches second_matcher.
+  virtual bool MatchAndExplain(PairType a_pair,
+                               MatchResultListener* listener) const {
+    if (!listener->IsInterested()) {
+      // If the listener is not interested, we don't need to construct the
+      // explanation.
+      return first_matcher_.Matches(a_pair.first) &&
+             second_matcher_.Matches(a_pair.second);
+    }
+    StringMatchResultListener first_inner_listener;
+    if (!first_matcher_.MatchAndExplain(a_pair.first,
+                                        &first_inner_listener)) {
+      *listener << "whose first field does not match";
+      PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
+      return false;
+    }
+    StringMatchResultListener second_inner_listener;
+    if (!second_matcher_.MatchAndExplain(a_pair.second,
+                                         &second_inner_listener)) {
+      *listener << "whose second field does not match";
+      PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
+      return false;
+    }
+    ExplainSuccess(first_inner_listener.str(), second_inner_listener.str(),
+                   listener);
+    return true;
+  }
+
+ private:
+  void ExplainSuccess(const internal::string& first_explanation,
+                      const internal::string& second_explanation,
+                      MatchResultListener* listener) const {
+    *listener << "whose both fields match";
+    if (first_explanation != "") {
+      *listener << ", where the first field is a value " << first_explanation;
+    }
+    if (second_explanation != "") {
+      *listener << ", ";
+      if (first_explanation != "") {
+        *listener << "and ";
+      } else {
+        *listener << "where ";
+      }
+      *listener << "the second field is a value " << second_explanation;
+    }
+  }
+
+  const Matcher<const FirstType&> first_matcher_;
+  const Matcher<const SecondType&> second_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PairMatcherImpl);
+};
+
+// Implements polymorphic Pair(first_matcher, second_matcher).
+template <typename FirstMatcher, typename SecondMatcher>
+class PairMatcher {
+ public:
+  PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
+      : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
+
+  template <typename PairType>
+  operator Matcher<PairType> () const {
+    return MakeMatcher(
+        new PairMatcherImpl<PairType>(
+            first_matcher_, second_matcher_));
+  }
+
+ private:
+  const FirstMatcher first_matcher_;
+  const SecondMatcher second_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PairMatcher);
+};
+
+// Implements ElementsAre() and ElementsAreArray().
+template <typename Container>
+class ElementsAreMatcherImpl : public MatcherInterface<Container> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+  typedef internal::StlContainerView<RawContainer> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+  typedef typename StlContainer::value_type Element;
+
+  // Constructs the matcher from a sequence of element values or
+  // element matchers.
+  template <typename InputIter>
+  ElementsAreMatcherImpl(InputIter first, InputIter last) {
+    while (first != last) {
+      matchers_.push_back(MatcherCast<const Element&>(*first++));
+    }
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    if (count() == 0) {
+      *os << "is empty";
+    } else if (count() == 1) {
+      *os << "has 1 element that ";
+      matchers_[0].DescribeTo(os);
+    } else {
+      *os << "has " << Elements(count()) << " where\n";
+      for (size_t i = 0; i != count(); ++i) {
+        *os << "element #" << i << " ";
+        matchers_[i].DescribeTo(os);
+        if (i + 1 < count()) {
+          *os << ",\n";
+        }
+      }
+    }
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    if (count() == 0) {
+      *os << "isn't empty";
+      return;
+    }
+
+    *os << "doesn't have " << Elements(count()) << ", or\n";
+    for (size_t i = 0; i != count(); ++i) {
+      *os << "element #" << i << " ";
+      matchers_[i].DescribeNegationTo(os);
+      if (i + 1 < count()) {
+        *os << ", or\n";
+      }
+    }
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    // To work with stream-like "containers", we must only walk
+    // through the elements in one pass.
+
+    const bool listener_interested = listener->IsInterested();
+
+    // explanations[i] is the explanation of the element at index i.
+    ::std::vector<internal::string> explanations(count());
+    StlContainerReference stl_container = View::ConstReference(container);
+    typename StlContainer::const_iterator it = stl_container.begin();
+    size_t exam_pos = 0;
+    bool mismatch_found = false;  // Have we found a mismatched element yet?
+
+    // Go through the elements and matchers in pairs, until we reach
+    // the end of either the elements or the matchers, or until we find a
+    // mismatch.
+    for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {
+      bool match;  // Does the current element match the current matcher?
+      if (listener_interested) {
+        StringMatchResultListener s;
+        match = matchers_[exam_pos].MatchAndExplain(*it, &s);
+        explanations[exam_pos] = s.str();
+      } else {
+        match = matchers_[exam_pos].Matches(*it);
+      }
+
+      if (!match) {
+        mismatch_found = true;
+        break;
+      }
+    }
+    // If mismatch_found is true, 'exam_pos' is the index of the mismatch.
+
+    // Find how many elements the actual container has.  We avoid
+    // calling size() s.t. this code works for stream-like "containers"
+    // that don't define size().
+    size_t actual_count = exam_pos;
+    for (; it != stl_container.end(); ++it) {
+      ++actual_count;
+    }
+
+    if (actual_count != count()) {
+      // The element count doesn't match.  If the container is empty,
+      // there's no need to explain anything as Google Mock already
+      // prints the empty container.  Otherwise we just need to show
+      // how many elements there actually are.
+      if (listener_interested && (actual_count != 0)) {
+        *listener << "which has " << Elements(actual_count);
+      }
+      return false;
+    }
+
+    if (mismatch_found) {
+      // The element count matches, but the exam_pos-th element doesn't match.
+      if (listener_interested) {
+        *listener << "whose element #" << exam_pos << " doesn't match";
+        PrintIfNotEmpty(explanations[exam_pos], listener->stream());
+      }
+      return false;
+    }
+
+    // Every element matches its expectation.  We need to explain why
+    // (the obvious ones can be skipped).
+    if (listener_interested) {
+      bool reason_printed = false;
+      for (size_t i = 0; i != count(); ++i) {
+        const internal::string& s = explanations[i];
+        if (!s.empty()) {
+          if (reason_printed) {
+            *listener << ",\nand ";
+          }
+          *listener << "whose element #" << i << " matches, " << s;
+          reason_printed = true;
+        }
+      }
+    }
+    return true;
+  }
+
+ private:
+  static Message Elements(size_t count) {
+    return Message() << count << (count == 1 ? " element" : " elements");
+  }
+
+  size_t count() const { return matchers_.size(); }
+
+  ::std::vector<Matcher<const Element&> > matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl);
+};
+
+// Connectivity matrix of (elements X matchers), in element-major order.
+// Initially, there are no edges.
+// Use NextGraph() to iterate over all possible edge configurations.
+// Use Randomize() to generate a random edge configuration.
+class GTEST_API_ MatchMatrix {
+ public:
+  MatchMatrix(size_t num_elements, size_t num_matchers)
+      : num_elements_(num_elements),
+        num_matchers_(num_matchers),
+        matched_(num_elements_* num_matchers_, 0) {
+  }
+
+  size_t LhsSize() const { return num_elements_; }
+  size_t RhsSize() const { return num_matchers_; }
+  bool HasEdge(size_t ilhs, size_t irhs) const {
+    return matched_[SpaceIndex(ilhs, irhs)] == 1;
+  }
+  void SetEdge(size_t ilhs, size_t irhs, bool b) {
+    matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;
+  }
+
+  // Treating the connectivity matrix as a (LhsSize()*RhsSize())-bit number,
+  // adds 1 to that number; returns false if incrementing the graph left it
+  // empty.
+  bool NextGraph();
+
+  void Randomize();
+
+  string DebugString() const;
+
+ private:
+  size_t SpaceIndex(size_t ilhs, size_t irhs) const {
+    return ilhs * num_matchers_ + irhs;
+  }
+
+  size_t num_elements_;
+  size_t num_matchers_;
+
+  // Each element is a char interpreted as bool. They are stored as a
+  // flattened array in lhs-major order, use 'SpaceIndex()' to translate
+  // a (ilhs, irhs) matrix coordinate into an offset.
+  ::std::vector<char> matched_;
+};
+
+typedef ::std::pair<size_t, size_t> ElementMatcherPair;
+typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs;
+
+// Returns a maximum bipartite matching for the specified graph 'g'.
+// The matching is represented as a vector of {element, matcher} pairs.
+GTEST_API_ ElementMatcherPairs
+FindMaxBipartiteMatching(const MatchMatrix& g);
+
+GTEST_API_ bool FindPairing(const MatchMatrix& matrix,
+                            MatchResultListener* listener);
+
+// Untyped base class for implementing UnorderedElementsAre.  By
+// putting logic that's not specific to the element type here, we
+// reduce binary bloat and increase compilation speed.
+class GTEST_API_ UnorderedElementsAreMatcherImplBase {
+ protected:
+  // A vector of matcher describers, one for each element matcher.
+  // Does not own the describers (and thus can be used only when the
+  // element matchers are alive).
+  typedef ::std::vector<const MatcherDescriberInterface*> MatcherDescriberVec;
+
+  // Describes this UnorderedElementsAre matcher.
+  void DescribeToImpl(::std::ostream* os) const;
+
+  // Describes the negation of this UnorderedElementsAre matcher.
+  void DescribeNegationToImpl(::std::ostream* os) const;
+
+  bool VerifyAllElementsAndMatchersAreMatched(
+      const ::std::vector<string>& element_printouts,
+      const MatchMatrix& matrix,
+      MatchResultListener* listener) const;
+
+  MatcherDescriberVec& matcher_describers() {
+    return matcher_describers_;
+  }
+
+  static Message Elements(size_t n) {
+    return Message() << n << " element" << (n == 1 ? "" : "s");
+  }
+
+ private:
+  MatcherDescriberVec matcher_describers_;
+
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImplBase);
+};
+
+// Implements unordered ElementsAre and unordered ElementsAreArray.
+template <typename Container>
+class UnorderedElementsAreMatcherImpl
+    : public MatcherInterface<Container>,
+      public UnorderedElementsAreMatcherImplBase {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+  typedef internal::StlContainerView<RawContainer> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+  typedef typename StlContainer::const_iterator StlContainerConstIterator;
+  typedef typename StlContainer::value_type Element;
+
+  // Constructs the matcher from a sequence of element values or
+  // element matchers.
+  template <typename InputIter>
+  UnorderedElementsAreMatcherImpl(InputIter first, InputIter last) {
+    for (; first != last; ++first) {
+      matchers_.push_back(MatcherCast<const Element&>(*first));
+      matcher_describers().push_back(matchers_.back().GetDescriber());
+    }
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os);
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os);
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    StlContainerReference stl_container = View::ConstReference(container);
+    ::std::vector<string> element_printouts;
+    MatchMatrix matrix = AnalyzeElements(stl_container.begin(),
+                                         stl_container.end(),
+                                         &element_printouts,
+                                         listener);
+
+    const size_t actual_count = matrix.LhsSize();
+    if (actual_count == 0 && matchers_.empty()) {
+      return true;
+    }
+    if (actual_count != matchers_.size()) {
+      // The element count doesn't match.  If the container is empty,
+      // there's no need to explain anything as Google Mock already
+      // prints the empty container. Otherwise we just need to show
+      // how many elements there actually are.
+      if (actual_count != 0 && listener->IsInterested()) {
+        *listener << "which has " << Elements(actual_count);
+      }
+      return false;
+    }
+
+    return VerifyAllElementsAndMatchersAreMatched(element_printouts,
+                                                  matrix, listener) &&
+           FindPairing(matrix, listener);
+  }
+
+ private:
+  typedef ::std::vector<Matcher<const Element&> > MatcherVec;
+
+  template <typename ElementIter>
+  MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last,
+                              ::std::vector<string>* element_printouts,
+                              MatchResultListener* listener) const {
+    element_printouts->clear();
+    ::std::vector<char> did_match;
+    size_t num_elements = 0;
+    for (; elem_first != elem_last; ++num_elements, ++elem_first) {
+      if (listener->IsInterested()) {
+        element_printouts->push_back(PrintToString(*elem_first));
+      }
+      for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
+        did_match.push_back(Matches(matchers_[irhs])(*elem_first));
+      }
+    }
+
+    MatchMatrix matrix(num_elements, matchers_.size());
+    ::std::vector<char>::const_iterator did_match_iter = did_match.begin();
+    for (size_t ilhs = 0; ilhs != num_elements; ++ilhs) {
+      for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
+        matrix.SetEdge(ilhs, irhs, *did_match_iter++ != 0);
+      }
+    }
+    return matrix;
+  }
+
+  MatcherVec matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImpl);
+};
+
+// Functor for use in TransformTuple.
+// Performs MatcherCast<Target> on an input argument of any type.
+template <typename Target>
+struct CastAndAppendTransform {
+  template <typename Arg>
+  Matcher<Target> operator()(const Arg& a) const {
+    return MatcherCast<Target>(a);
+  }
+};
+
+// Implements UnorderedElementsAre.
+template <typename MatcherTuple>
+class UnorderedElementsAreMatcher {
+ public:
+  explicit UnorderedElementsAreMatcher(const MatcherTuple& args)
+      : matchers_(args) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+    typedef typename internal::StlContainerView<RawContainer>::type View;
+    typedef typename View::value_type Element;
+    typedef ::std::vector<Matcher<const Element&> > MatcherVec;
+    MatcherVec matchers;
+    matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
+    TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
+                         ::std::back_inserter(matchers));
+    return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(
+                           matchers.begin(), matchers.end()));
+  }
+
+ private:
+  const MatcherTuple matchers_;
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcher);
+};
+
+// Implements ElementsAre.
+template <typename MatcherTuple>
+class ElementsAreMatcher {
+ public:
+  explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+    typedef typename internal::StlContainerView<RawContainer>::type View;
+    typedef typename View::value_type Element;
+    typedef ::std::vector<Matcher<const Element&> > MatcherVec;
+    MatcherVec matchers;
+    matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
+    TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
+                         ::std::back_inserter(matchers));
+    return MakeMatcher(new ElementsAreMatcherImpl<Container>(
+                           matchers.begin(), matchers.end()));
+  }
+
+ private:
+  const MatcherTuple matchers_;
+  GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher);
+};
+
+// Implements UnorderedElementsAreArray().
+template <typename T>
+class UnorderedElementsAreArrayMatcher {
+ public:
+  UnorderedElementsAreArrayMatcher() {}
+
+  template <typename Iter>
+  UnorderedElementsAreArrayMatcher(Iter first, Iter last)
+      : matchers_(first, last) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(
+        new UnorderedElementsAreMatcherImpl<Container>(matchers_.begin(),
+                                                       matchers_.end()));
+  }
+
+ private:
+  ::std::vector<T> matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreArrayMatcher);
+};
+
+// Implements ElementsAreArray().
+template <typename T>
+class ElementsAreArrayMatcher {
+ public:
+  template <typename Iter>
+  ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new ElementsAreMatcherImpl<Container>(
+        matchers_.begin(), matchers_.end()));
+  }
+
+ private:
+  const ::std::vector<T> matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher);
+};
+
+// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
+// of type Second, BoundSecondMatcher<Tuple2Matcher, Second>(tm,
+// second) is a polymorphic matcher that matches a value x iff tm
+// matches tuple (x, second).  Useful for implementing
+// UnorderedPointwise() in terms of UnorderedElementsAreArray().
+//
+// BoundSecondMatcher is copyable and assignable, as we need to put
+// instances of this class in a vector when implementing
+// UnorderedPointwise().
+template <typename Tuple2Matcher, typename Second>
+class BoundSecondMatcher {
+ public:
+  BoundSecondMatcher(const Tuple2Matcher& tm, const Second& second)
+      : tuple2_matcher_(tm), second_value_(second) {}
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return MakeMatcher(new Impl<T>(tuple2_matcher_, second_value_));
+  }
+
+  // We have to define this for UnorderedPointwise() to compile in
+  // C++98 mode, as it puts BoundSecondMatcher instances in a vector,
+  // which requires the elements to be assignable in C++98.  The
+  // compiler cannot generate the operator= for us, as Tuple2Matcher
+  // and Second may not be assignable.
+  //
+  // However, this should never be called, so the implementation just
+  // need to assert.
+  void operator=(const BoundSecondMatcher& /*rhs*/) {
+    GTEST_LOG_(FATAL) << "BoundSecondMatcher should never be assigned.";
+  }
+
+ private:
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    typedef ::testing::tuple<T, Second> ArgTuple;
+
+    Impl(const Tuple2Matcher& tm, const Second& second)
+        : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
+          second_value_(second) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "and ";
+      UniversalPrint(second_value_, os);
+      *os << " ";
+      mono_tuple2_matcher_.DescribeTo(os);
+    }
+
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_),
+                                                  listener);
+    }
+
+   private:
+    const Matcher<const ArgTuple&> mono_tuple2_matcher_;
+    const Second second_value_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const Tuple2Matcher tuple2_matcher_;
+  const Second second_value_;
+};
+
+// Given a 2-tuple matcher tm and a value second,
+// MatcherBindSecond(tm, second) returns a matcher that matches a
+// value x iff tm matches tuple (x, second).  Useful for implementing
+// UnorderedPointwise() in terms of UnorderedElementsAreArray().
+template <typename Tuple2Matcher, typename Second>
+BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
+    const Tuple2Matcher& tm, const Second& second) {
+  return BoundSecondMatcher<Tuple2Matcher, Second>(tm, second);
+}
+
+// Returns the description for a matcher defined using the MATCHER*()
+// macro where the user-supplied description string is "", if
+// 'negation' is false; otherwise returns the description of the
+// negation of the matcher.  'param_values' contains a list of strings
+// that are the print-out of the matcher's parameters.
+GTEST_API_ string FormatMatcherDescription(bool negation,
+                                           const char* matcher_name,
+                                           const Strings& param_values);
+
+}  // namespace internal
+
+// ElementsAreArray(first, last)
+// ElementsAreArray(pointer, count)
+// ElementsAreArray(array)
+// ElementsAreArray(container)
+// ElementsAreArray({ e1, e2, ..., en })
+//
+// The ElementsAreArray() functions are like ElementsAre(...), except
+// that they are given a homogeneous sequence rather than taking each
+// element as a function argument. The sequence can be specified as an
+// array, a pointer and count, a vector, an initializer list, or an
+// STL iterator range. In each of these cases, the underlying sequence
+// can be either a sequence of values or a sequence of matchers.
+//
+// All forms of ElementsAreArray() make a copy of the input matcher sequence.
+
+template <typename Iter>
+inline internal::ElementsAreArrayMatcher<
+    typename ::std::iterator_traits<Iter>::value_type>
+ElementsAreArray(Iter first, Iter last) {
+  typedef typename ::std::iterator_traits<Iter>::value_type T;
+  return internal::ElementsAreArrayMatcher<T>(first, last);
+}
+
+template <typename T>
+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
+    const T* pointer, size_t count) {
+  return ElementsAreArray(pointer, pointer + count);
+}
+
+template <typename T, size_t N>
+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
+    const T (&array)[N]) {
+  return ElementsAreArray(array, N);
+}
+
+template <typename Container>
+inline internal::ElementsAreArrayMatcher<typename Container::value_type>
+ElementsAreArray(const Container& container) {
+  return ElementsAreArray(container.begin(), container.end());
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+template <typename T>
+inline internal::ElementsAreArrayMatcher<T>
+ElementsAreArray(::std::initializer_list<T> xs) {
+  return ElementsAreArray(xs.begin(), xs.end());
+}
+#endif
+
+// UnorderedElementsAreArray(first, last)
+// UnorderedElementsAreArray(pointer, count)
+// UnorderedElementsAreArray(array)
+// UnorderedElementsAreArray(container)
+// UnorderedElementsAreArray({ e1, e2, ..., en })
+//
+// The UnorderedElementsAreArray() functions are like
+// ElementsAreArray(...), but allow matching the elements in any order.
+template <typename Iter>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename ::std::iterator_traits<Iter>::value_type>
+UnorderedElementsAreArray(Iter first, Iter last) {
+  typedef typename ::std::iterator_traits<Iter>::value_type T;
+  return internal::UnorderedElementsAreArrayMatcher<T>(first, last);
+}
+
+template <typename T>
+inline internal::UnorderedElementsAreArrayMatcher<T>
+UnorderedElementsAreArray(const T* pointer, size_t count) {
+  return UnorderedElementsAreArray(pointer, pointer + count);
+}
+
+template <typename T, size_t N>
+inline internal::UnorderedElementsAreArrayMatcher<T>
+UnorderedElementsAreArray(const T (&array)[N]) {
+  return UnorderedElementsAreArray(array, N);
+}
+
+template <typename Container>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename Container::value_type>
+UnorderedElementsAreArray(const Container& container) {
+  return UnorderedElementsAreArray(container.begin(), container.end());
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+template <typename T>
+inline internal::UnorderedElementsAreArrayMatcher<T>
+UnorderedElementsAreArray(::std::initializer_list<T> xs) {
+  return UnorderedElementsAreArray(xs.begin(), xs.end());
+}
+#endif
+
+// _ is a matcher that matches anything of any type.
+//
+// This definition is fine as:
+//
+//   1. The C++ standard permits using the name _ in a namespace that
+//      is not the global namespace or ::std.
+//   2. The AnythingMatcher class has no data member or constructor,
+//      so it's OK to create global variables of this type.
+//   3. c-style has approved of using _ in this case.
+const internal::AnythingMatcher _ = {};
+// Creates a matcher that matches any value of the given type T.
+template <typename T>
+inline Matcher<T> A() { return MakeMatcher(new internal::AnyMatcherImpl<T>()); }
+
+// Creates a matcher that matches any value of the given type T.
+template <typename T>
+inline Matcher<T> An() { return A<T>(); }
+
+// Creates a polymorphic matcher that matches anything equal to x.
+// Note: if the parameter of Eq() were declared as const T&, Eq("foo")
+// wouldn't compile.
+template <typename T>
+inline internal::EqMatcher<T> Eq(T x) { return internal::EqMatcher<T>(x); }
+
+// Constructs a Matcher<T> from a 'value' of type T.  The constructed
+// matcher matches any value that's equal to 'value'.
+template <typename T>
+Matcher<T>::Matcher(T value) { *this = Eq(value); }
+
+// Creates a monomorphic matcher that matches anything with type Lhs
+// and equal to rhs.  A user may need to use this instead of Eq(...)
+// in order to resolve an overloading ambiguity.
+//
+// TypedEq<T>(x) is just a convenient short-hand for Matcher<T>(Eq(x))
+// or Matcher<T>(x), but more readable than the latter.
+//
+// We could define similar monomorphic matchers for other comparison
+// operations (e.g. TypedLt, TypedGe, and etc), but decided not to do
+// it yet as those are used much less than Eq() in practice.  A user
+// can always write Matcher<T>(Lt(5)) to be explicit about the type,
+// for example.
+template <typename Lhs, typename Rhs>
+inline Matcher<Lhs> TypedEq(const Rhs& rhs) { return Eq(rhs); }
+
+// Creates a polymorphic matcher that matches anything >= x.
+template <typename Rhs>
+inline internal::GeMatcher<Rhs> Ge(Rhs x) {
+  return internal::GeMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything > x.
+template <typename Rhs>
+inline internal::GtMatcher<Rhs> Gt(Rhs x) {
+  return internal::GtMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything <= x.
+template <typename Rhs>
+inline internal::LeMatcher<Rhs> Le(Rhs x) {
+  return internal::LeMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything < x.
+template <typename Rhs>
+inline internal::LtMatcher<Rhs> Lt(Rhs x) {
+  return internal::LtMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything != x.
+template <typename Rhs>
+inline internal::NeMatcher<Rhs> Ne(Rhs x) {
+  return internal::NeMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches any NULL pointer.
+inline PolymorphicMatcher<internal::IsNullMatcher > IsNull() {
+  return MakePolymorphicMatcher(internal::IsNullMatcher());
+}
+
+// Creates a polymorphic matcher that matches any non-NULL pointer.
+// This is convenient as Not(NULL) doesn't compile (the compiler
+// thinks that that expression is comparing a pointer with an integer).
+inline PolymorphicMatcher<internal::NotNullMatcher > NotNull() {
+  return MakePolymorphicMatcher(internal::NotNullMatcher());
+}
+
+// Creates a polymorphic matcher that matches any argument that
+// references variable x.
+template <typename T>
+inline internal::RefMatcher<T&> Ref(T& x) {  // NOLINT
+  return internal::RefMatcher<T&>(x);
+}
+
+// Creates a matcher that matches any double argument approximately
+// equal to rhs, where two NANs are considered unequal.
+inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) {
+  return internal::FloatingEqMatcher<double>(rhs, false);
+}
+
+// Creates a matcher that matches any double argument approximately
+// equal to rhs, including NaN values when rhs is NaN.
+inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {
+  return internal::FloatingEqMatcher<double>(rhs, true);
+}
+
+// Creates a matcher that matches any double argument approximately equal to
+// rhs, up to the specified max absolute error bound, where two NANs are
+// considered unequal.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<double> DoubleNear(
+    double rhs, double max_abs_error) {
+  return internal::FloatingEqMatcher<double>(rhs, false, max_abs_error);
+}
+
+// Creates a matcher that matches any double argument approximately equal to
+// rhs, up to the specified max absolute error bound, including NaN values when
+// rhs is NaN.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<double> NanSensitiveDoubleNear(
+    double rhs, double max_abs_error) {
+  return internal::FloatingEqMatcher<double>(rhs, true, max_abs_error);
+}
+
+// Creates a matcher that matches any float argument approximately
+// equal to rhs, where two NANs are considered unequal.
+inline internal::FloatingEqMatcher<float> FloatEq(float rhs) {
+  return internal::FloatingEqMatcher<float>(rhs, false);
+}
+
+// Creates a matcher that matches any float argument approximately
+// equal to rhs, including NaN values when rhs is NaN.
+inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {
+  return internal::FloatingEqMatcher<float>(rhs, true);
+}
+
+// Creates a matcher that matches any float argument approximately equal to
+// rhs, up to the specified max absolute error bound, where two NANs are
+// considered unequal.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<float> FloatNear(
+    float rhs, float max_abs_error) {
+  return internal::FloatingEqMatcher<float>(rhs, false, max_abs_error);
+}
+
+// Creates a matcher that matches any float argument approximately equal to
+// rhs, up to the specified max absolute error bound, including NaN values when
+// rhs is NaN.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<float> NanSensitiveFloatNear(
+    float rhs, float max_abs_error) {
+  return internal::FloatingEqMatcher<float>(rhs, true, max_abs_error);
+}
+
+// Creates a matcher that matches a pointer (raw or smart) that points
+// to a value that matches inner_matcher.
+template <typename InnerMatcher>
+inline internal::PointeeMatcher<InnerMatcher> Pointee(
+    const InnerMatcher& inner_matcher) {
+  return internal::PointeeMatcher<InnerMatcher>(inner_matcher);
+}
+
+// Creates a matcher that matches a pointer or reference that matches
+// inner_matcher when dynamic_cast<To> is applied.
+// The result of dynamic_cast<To> is forwarded to the inner matcher.
+// If To is a pointer and the cast fails, the inner matcher will receive NULL.
+// If To is a reference and the cast fails, this matcher returns false
+// immediately.
+template <typename To>
+inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To> >
+WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
+  return MakePolymorphicMatcher(
+      internal::WhenDynamicCastToMatcher<To>(inner_matcher));
+}
+
+// Creates a matcher that matches an object whose given field matches
+// 'matcher'.  For example,
+//   Field(&Foo::number, Ge(5))
+// matches a Foo object x iff x.number >= 5.
+template <typename Class, typename FieldType, typename FieldMatcher>
+inline PolymorphicMatcher<
+  internal::FieldMatcher<Class, FieldType> > Field(
+    FieldType Class::*field, const FieldMatcher& matcher) {
+  return MakePolymorphicMatcher(
+      internal::FieldMatcher<Class, FieldType>(
+          field, MatcherCast<const FieldType&>(matcher)));
+  // The call to MatcherCast() is required for supporting inner
+  // matchers of compatible types.  For example, it allows
+  //   Field(&Foo::bar, m)
+  // to compile where bar is an int32 and m is a matcher for int64.
+}
+
+// Creates a matcher that matches an object whose given property
+// matches 'matcher'.  For example,
+//   Property(&Foo::str, StartsWith("hi"))
+// matches a Foo object x iff x.str() starts with "hi".
+template <typename Class, typename PropertyType, typename PropertyMatcher>
+inline PolymorphicMatcher<
+  internal::PropertyMatcher<Class, PropertyType> > Property(
+    PropertyType (Class::*property)() const, const PropertyMatcher& matcher) {
+  return MakePolymorphicMatcher(
+      internal::PropertyMatcher<Class, PropertyType>(
+          property,
+          MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
+  // The call to MatcherCast() is required for supporting inner
+  // matchers of compatible types.  For example, it allows
+  //   Property(&Foo::bar, m)
+  // to compile where bar() returns an int32 and m is a matcher for int64.
+}
+
+// Creates a matcher that matches an object iff the result of applying
+// a callable to x matches 'matcher'.
+// For example,
+//   ResultOf(f, StartsWith("hi"))
+// matches a Foo object x iff f(x) starts with "hi".
+// callable parameter can be a function, function pointer, or a functor.
+// Callable has to satisfy the following conditions:
+//   * It is required to keep no state affecting the results of
+//     the calls on it and make no assumptions about how many calls
+//     will be made. Any state it keeps must be protected from the
+//     concurrent access.
+//   * If it is a function object, it has to define type result_type.
+//     We recommend deriving your functor classes from std::unary_function.
+template <typename Callable, typename ResultOfMatcher>
+internal::ResultOfMatcher<Callable> ResultOf(
+    Callable callable, const ResultOfMatcher& matcher) {
+  return internal::ResultOfMatcher<Callable>(
+          callable,
+          MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
+              matcher));
+  // The call to MatcherCast() is required for supporting inner
+  // matchers of compatible types.  For example, it allows
+  //   ResultOf(Function, m)
+  // to compile where Function() returns an int32 and m is a matcher for int64.
+}
+
+// String matchers.
+
+// Matches a string equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrEq(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, true, true));
+}
+
+// Matches a string not equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrNe(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, false, true));
+}
+
+// Matches a string equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrCaseEq(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, true, false));
+}
+
+// Matches a string not equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrCaseNe(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, false, false));
+}
+
+// Creates a matcher that matches any string, std::string, or C string
+// that contains the given substring.
+inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >
+    HasSubstr(const internal::string& substring) {
+  return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::string>(
+      substring));
+}
+
+// Matches a string that starts with 'prefix' (case-sensitive).
+inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >
+    StartsWith(const internal::string& prefix) {
+  return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::string>(
+      prefix));
+}
+
+// Matches a string that ends with 'suffix' (case-sensitive).
+inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >
+    EndsWith(const internal::string& suffix) {
+  return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::string>(
+      suffix));
+}
+
+// Matches a string that fully matches regular expression 'regex'.
+// The matcher takes ownership of 'regex'.
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
+    const internal::RE* regex) {
+  return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));
+}
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
+    const internal::string& regex) {
+  return MatchesRegex(new internal::RE(regex));
+}
+
+// Matches a string that contains regular expression 'regex'.
+// The matcher takes ownership of 'regex'.
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
+    const internal::RE* regex) {
+  return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));
+}
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
+    const internal::string& regex) {
+  return ContainsRegex(new internal::RE(regex));
+}
+
+#if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
+// Wide string matchers.
+
+// Matches a string equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrEq(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, true, true));
+}
+
+// Matches a string not equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrNe(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, false, true));
+}
+
+// Matches a string equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrCaseEq(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, true, false));
+}
+
+// Matches a string not equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrCaseNe(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, false, false));
+}
+
+// Creates a matcher that matches any wstring, std::wstring, or C wide string
+// that contains the given substring.
+inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::wstring> >
+    HasSubstr(const internal::wstring& substring) {
+  return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::wstring>(
+      substring));
+}
+
+// Matches a string that starts with 'prefix' (case-sensitive).
+inline PolymorphicMatcher<internal::StartsWithMatcher<internal::wstring> >
+    StartsWith(const internal::wstring& prefix) {
+  return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::wstring>(
+      prefix));
+}
+
+// Matches a string that ends with 'suffix' (case-sensitive).
+inline PolymorphicMatcher<internal::EndsWithMatcher<internal::wstring> >
+    EndsWith(const internal::wstring& suffix) {
+  return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::wstring>(
+      suffix));
+}
+
+#endif  // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field == the second field.
+inline internal::Eq2Matcher Eq() { return internal::Eq2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field >= the second field.
+inline internal::Ge2Matcher Ge() { return internal::Ge2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field > the second field.
+inline internal::Gt2Matcher Gt() { return internal::Gt2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field <= the second field.
+inline internal::Le2Matcher Le() { return internal::Le2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field < the second field.
+inline internal::Lt2Matcher Lt() { return internal::Lt2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field != the second field.
+inline internal::Ne2Matcher Ne() { return internal::Ne2Matcher(); }
+
+// Creates a matcher that matches any value of type T that m doesn't
+// match.
+template <typename InnerMatcher>
+inline internal::NotMatcher<InnerMatcher> Not(InnerMatcher m) {
+  return internal::NotMatcher<InnerMatcher>(m);
+}
+
+// Returns a matcher that matches anything that satisfies the given
+// predicate.  The predicate can be any unary function or functor
+// whose return type can be implicitly converted to bool.
+template <typename Predicate>
+inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >
+Truly(Predicate pred) {
+  return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred));
+}
+
+// Returns a matcher that matches the container size. The container must
+// support both size() and size_type which all STL-like containers provide.
+// Note that the parameter 'size' can be a value of type size_type as well as
+// matcher. For instance:
+//   EXPECT_THAT(container, SizeIs(2));     // Checks container has 2 elements.
+//   EXPECT_THAT(container, SizeIs(Le(2));  // Checks container has at most 2.
+template <typename SizeMatcher>
+inline internal::SizeIsMatcher<SizeMatcher>
+SizeIs(const SizeMatcher& size_matcher) {
+  return internal::SizeIsMatcher<SizeMatcher>(size_matcher);
+}
+
+// Returns a matcher that matches the distance between the container's begin()
+// iterator and its end() iterator, i.e. the size of the container. This matcher
+// can be used instead of SizeIs with containers such as std::forward_list which
+// do not implement size(). The container must provide const_iterator (with
+// valid iterator_traits), begin() and end().
+template <typename DistanceMatcher>
+inline internal::BeginEndDistanceIsMatcher<DistanceMatcher>
+BeginEndDistanceIs(const DistanceMatcher& distance_matcher) {
+  return internal::BeginEndDistanceIsMatcher<DistanceMatcher>(distance_matcher);
+}
+
+// Returns a matcher that matches an equal container.
+// This matcher behaves like Eq(), but in the event of mismatch lists the
+// values that are included in one container but not the other. (Duplicate
+// values and order differences are not explained.)
+template <typename Container>
+inline PolymorphicMatcher<internal::ContainerEqMatcher<  // NOLINT
+                            GTEST_REMOVE_CONST_(Container)> >
+    ContainerEq(const Container& rhs) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes Container to be a const type sometimes.
+  typedef GTEST_REMOVE_CONST_(Container) RawContainer;
+  return MakePolymorphicMatcher(
+      internal::ContainerEqMatcher<RawContainer>(rhs));
+}
+
+// Returns a matcher that matches a container that, when sorted using
+// the given comparator, matches container_matcher.
+template <typename Comparator, typename ContainerMatcher>
+inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>
+WhenSortedBy(const Comparator& comparator,
+             const ContainerMatcher& container_matcher) {
+  return internal::WhenSortedByMatcher<Comparator, ContainerMatcher>(
+      comparator, container_matcher);
+}
+
+// Returns a matcher that matches a container that, when sorted using
+// the < operator, matches container_matcher.
+template <typename ContainerMatcher>
+inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
+WhenSorted(const ContainerMatcher& container_matcher) {
+  return
+      internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>(
+          internal::LessComparator(), container_matcher);
+}
+
+// Matches an STL-style container or a native array that contains the
+// same number of elements as in rhs, where its i-th element and rhs's
+// i-th element (as a pair) satisfy the given pair matcher, for all i.
+// TupleMatcher must be able to be safely cast to Matcher<tuple<const
+// T1&, const T2&> >, where T1 and T2 are the types of elements in the
+// LHS container and the RHS container respectively.
+template <typename TupleMatcher, typename Container>
+inline internal::PointwiseMatcher<TupleMatcher,
+                                  GTEST_REMOVE_CONST_(Container)>
+Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes Container to be a const type sometimes (e.g. when
+  // rhs is a const int[])..
+  typedef GTEST_REMOVE_CONST_(Container) RawContainer;
+  return internal::PointwiseMatcher<TupleMatcher, RawContainer>(
+      tuple_matcher, rhs);
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Supports the Pointwise(m, {a, b, c}) syntax.
+template <typename TupleMatcher, typename T>
+inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise(
+    const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
+  return Pointwise(tuple_matcher, std::vector<T>(rhs));
+}
+
+#endif  // GTEST_HAS_STD_INITIALIZER_LIST_
+
+// UnorderedPointwise(pair_matcher, rhs) matches an STL-style
+// container or a native array that contains the same number of
+// elements as in rhs, where in some permutation of the container, its
+// i-th element and rhs's i-th element (as a pair) satisfy the given
+// pair matcher, for all i.  Tuple2Matcher must be able to be safely
+// cast to Matcher<tuple<const T1&, const T2&> >, where T1 and T2 are
+// the types of elements in the LHS container and the RHS container
+// respectively.
+//
+// This is like Pointwise(pair_matcher, rhs), except that the element
+// order doesn't matter.
+template <typename Tuple2Matcher, typename RhsContainer>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename internal::BoundSecondMatcher<
+        Tuple2Matcher, typename internal::StlContainerView<GTEST_REMOVE_CONST_(
+                           RhsContainer)>::type::value_type> >
+UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
+                   const RhsContainer& rhs_container) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes RhsContainer to be a const type sometimes (e.g. when
+  // rhs_container is a const int[]).
+  typedef GTEST_REMOVE_CONST_(RhsContainer) RawRhsContainer;
+
+  // RhsView allows the same code to handle RhsContainer being a
+  // STL-style container and it being a native C-style array.
+  typedef typename internal::StlContainerView<RawRhsContainer> RhsView;
+  typedef typename RhsView::type RhsStlContainer;
+  typedef typename RhsStlContainer::value_type Second;
+  const RhsStlContainer& rhs_stl_container =
+      RhsView::ConstReference(rhs_container);
+
+  // Create a matcher for each element in rhs_container.
+  ::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second> > matchers;
+  for (typename RhsStlContainer::const_iterator it = rhs_stl_container.begin();
+       it != rhs_stl_container.end(); ++it) {
+    matchers.push_back(
+        internal::MatcherBindSecond(tuple2_matcher, *it));
+  }
+
+  // Delegate the work to UnorderedElementsAreArray().
+  return UnorderedElementsAreArray(matchers);
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Supports the UnorderedPointwise(m, {a, b, c}) syntax.
+template <typename Tuple2Matcher, typename T>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename internal::BoundSecondMatcher<Tuple2Matcher, T> >
+UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
+                   std::initializer_list<T> rhs) {
+  return UnorderedPointwise(tuple2_matcher, std::vector<T>(rhs));
+}
+
+#endif  // GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Matches an STL-style container or a native array that contains at
+// least one element matching the given value or matcher.
+//
+// Examples:
+//   ::std::set<int> page_ids;
+//   page_ids.insert(3);
+//   page_ids.insert(1);
+//   EXPECT_THAT(page_ids, Contains(1));
+//   EXPECT_THAT(page_ids, Contains(Gt(2)));
+//   EXPECT_THAT(page_ids, Not(Contains(4)));
+//
+//   ::std::map<int, size_t> page_lengths;
+//   page_lengths[1] = 100;
+//   EXPECT_THAT(page_lengths,
+//               Contains(::std::pair<const int, size_t>(1, 100)));
+//
+//   const char* user_ids[] = { "joe", "mike", "tom" };
+//   EXPECT_THAT(user_ids, Contains(Eq(::std::string("tom"))));
+template <typename M>
+inline internal::ContainsMatcher<M> Contains(M matcher) {
+  return internal::ContainsMatcher<M>(matcher);
+}
+
+// Matches an STL-style container or a native array that contains only
+// elements matching the given value or matcher.
+//
+// Each(m) is semantically equivalent to Not(Contains(Not(m))). Only
+// the messages are different.
+//
+// Examples:
+//   ::std::set<int> page_ids;
+//   // Each(m) matches an empty container, regardless of what m is.
+//   EXPECT_THAT(page_ids, Each(Eq(1)));
+//   EXPECT_THAT(page_ids, Each(Eq(77)));
+//
+//   page_ids.insert(3);
+//   EXPECT_THAT(page_ids, Each(Gt(0)));
+//   EXPECT_THAT(page_ids, Not(Each(Gt(4))));
+//   page_ids.insert(1);
+//   EXPECT_THAT(page_ids, Not(Each(Lt(2))));
+//
+//   ::std::map<int, size_t> page_lengths;
+//   page_lengths[1] = 100;
+//   page_lengths[2] = 200;
+//   page_lengths[3] = 300;
+//   EXPECT_THAT(page_lengths, Not(Each(Pair(1, 100))));
+//   EXPECT_THAT(page_lengths, Each(Key(Le(3))));
+//
+//   const char* user_ids[] = { "joe", "mike", "tom" };
+//   EXPECT_THAT(user_ids, Not(Each(Eq(::std::string("tom")))));
+template <typename M>
+inline internal::EachMatcher<M> Each(M matcher) {
+  return internal::EachMatcher<M>(matcher);
+}
+
+// Key(inner_matcher) matches an std::pair whose 'first' field matches
+// inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an
+// std::map that contains at least one element whose key is >= 5.
+template <typename M>
+inline internal::KeyMatcher<M> Key(M inner_matcher) {
+  return internal::KeyMatcher<M>(inner_matcher);
+}
+
+// Pair(first_matcher, second_matcher) matches a std::pair whose 'first' field
+// matches first_matcher and whose 'second' field matches second_matcher.  For
+// example, EXPECT_THAT(map_type, ElementsAre(Pair(Ge(5), "foo"))) can be used
+// to match a std::map<int, string> that contains exactly one element whose key
+// is >= 5 and whose value equals "foo".
+template <typename FirstMatcher, typename SecondMatcher>
+inline internal::PairMatcher<FirstMatcher, SecondMatcher>
+Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
+  return internal::PairMatcher<FirstMatcher, SecondMatcher>(
+      first_matcher, second_matcher);
+}
+
+// Returns a predicate that is satisfied by anything that matches the
+// given matcher.
+template <typename M>
+inline internal::MatcherAsPredicate<M> Matches(M matcher) {
+  return internal::MatcherAsPredicate<M>(matcher);
+}
+
+// Returns true iff the value matches the matcher.
+template <typename T, typename M>
+inline bool Value(const T& value, M matcher) {
+  return testing::Matches(matcher)(value);
+}
+
+// Matches the value against the given matcher and explains the match
+// result to listener.
+template <typename T, typename M>
+inline bool ExplainMatchResult(
+    M matcher, const T& value, MatchResultListener* listener) {
+  return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
+}
+
+#if GTEST_LANG_CXX11
+// Define variadic matcher versions. They are overloaded in
+// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
+template <typename... Args>
+inline internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) {
+  return internal::AllOfMatcher<Args...>(matchers...);
+}
+
+template <typename... Args>
+inline internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
+  return internal::AnyOfMatcher<Args...>(matchers...);
+}
+
+#endif  // GTEST_LANG_CXX11
+
+// AllArgs(m) is a synonym of m.  This is useful in
+//
+//   EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));
+//
+// which is easier to read than
+//
+//   EXPECT_CALL(foo, Bar(_, _)).With(Eq());
+template <typename InnerMatcher>
+inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher; }
+
+// These macros allow using matchers to check values in Google Test
+// tests.  ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
+// succeed iff the value matches the matcher.  If the assertion fails,
+// the value and the description of the matcher will be printed.
+#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
+    ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
+#define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\
+    ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
+
+}  // namespace testing
+
+// Include any custom callback matchers added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-matchers.h"
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-more-actions.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-more-actions.h
new file mode 100644
index 0000000..3d387b6
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-more-actions.h
@@ -0,0 +1,246 @@
+// 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 actions that depend on gmock-generated-actions.h.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
+
+#include <algorithm>
+
+#include "gmock/gmock-generated-actions.h"
+
+namespace testing {
+namespace internal {
+
+// Implements the Invoke(f) action.  The template argument
+// FunctionImpl is the implementation type of f, which can be either a
+// function pointer or a functor.  Invoke(f) can be used as an
+// Action<F> as long as f's type is compatible with F (i.e. f can be
+// assigned to a tr1::function<F>).
+template <typename FunctionImpl>
+class InvokeAction {
+ public:
+  // The c'tor makes a copy of function_impl (either a function
+  // pointer or a functor).
+  explicit InvokeAction(FunctionImpl function_impl)
+      : function_impl_(function_impl) {}
+
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& args) {
+    return InvokeHelper<Result, ArgumentTuple>::Invoke(function_impl_, args);
+  }
+
+ private:
+  FunctionImpl function_impl_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeAction);
+};
+
+// Implements the Invoke(object_ptr, &Class::Method) action.
+template <class Class, typename MethodPtr>
+class InvokeMethodAction {
+ public:
+  InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)
+      : method_ptr_(method_ptr), obj_ptr_(obj_ptr) {}
+
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& args) const {
+    return InvokeHelper<Result, ArgumentTuple>::InvokeMethod(
+        obj_ptr_, method_ptr_, args);
+  }
+
+ private:
+  // The order of these members matters.  Reversing the order can trigger
+  // warning C4121 in MSVC (see
+  // http://computer-programming-forum.com/7-vc.net/6fbc30265f860ad1.htm ).
+  const MethodPtr method_ptr_;
+  Class* const obj_ptr_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);
+};
+
+// An internal replacement for std::copy which mimics its behavior. This is
+// necessary because Visual Studio deprecates ::std::copy, issuing warning 4996.
+// However Visual Studio 2010 and later do not honor #pragmas which disable that
+// warning.
+template<typename InputIterator, typename OutputIterator>
+inline OutputIterator CopyElements(InputIterator first,
+                                   InputIterator last,
+                                   OutputIterator output) {
+  for (; first != last; ++first, ++output) {
+    *output = *first;
+  }
+  return output;
+}
+
+}  // namespace internal
+
+// Various overloads for Invoke().
+
+// Creates an action that invokes 'function_impl' with the mock
+// function's arguments.
+template <typename FunctionImpl>
+PolymorphicAction<internal::InvokeAction<FunctionImpl> > Invoke(
+    FunctionImpl function_impl) {
+  return MakePolymorphicAction(
+      internal::InvokeAction<FunctionImpl>(function_impl));
+}
+
+// Creates an action that invokes the given method on the given object
+// with the mock function's arguments.
+template <class Class, typename MethodPtr>
+PolymorphicAction<internal::InvokeMethodAction<Class, MethodPtr> > Invoke(
+    Class* obj_ptr, MethodPtr method_ptr) {
+  return MakePolymorphicAction(
+      internal::InvokeMethodAction<Class, MethodPtr>(obj_ptr, method_ptr));
+}
+
+// WithoutArgs(inner_action) can be used in a mock function with a
+// non-empty argument list to perform inner_action, which takes no
+// argument.  In other words, it adapts an action accepting no
+// argument to one that accepts (and ignores) arguments.
+template <typename InnerAction>
+inline internal::WithArgsAction<InnerAction>
+WithoutArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction>(action);
+}
+
+// WithArg<k>(an_action) creates an action that passes the k-th
+// (0-based) argument of the mock function to an_action and performs
+// it.  It adapts an action accepting one argument to one that accepts
+// multiple arguments.  For convenience, we also provide
+// WithArgs<k>(an_action) (defined below) as a synonym.
+template <int k, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k>
+WithArg(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k>(action);
+}
+
+// The ACTION*() macros trigger warning C4100 (unreferenced formal
+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
+// the macro definition, as the warnings are generated when the macro
+// is expanded and macro expansion cannot contain #pragma.  Therefore
+// we suppress them here.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4100)
+#endif
+
+// Action ReturnArg<k>() returns the k-th argument of the mock function.
+ACTION_TEMPLATE(ReturnArg,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_0_VALUE_PARAMS()) {
+  return ::testing::get<k>(args);
+}
+
+// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
+// mock function to *pointer.
+ACTION_TEMPLATE(SaveArg,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(pointer)) {
+  *pointer = ::testing::get<k>(args);
+}
+
+// Action SaveArgPointee<k>(pointer) saves the value pointed to
+// by the k-th (0-based) argument of the mock function to *pointer.
+ACTION_TEMPLATE(SaveArgPointee,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(pointer)) {
+  *pointer = *::testing::get<k>(args);
+}
+
+// Action SetArgReferee<k>(value) assigns 'value' to the variable
+// referenced by the k-th (0-based) argument of the mock function.
+ACTION_TEMPLATE(SetArgReferee,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(value)) {
+  typedef typename ::testing::tuple_element<k, args_type>::type argk_type;
+  // Ensures that argument #k is a reference.  If you get a compiler
+  // error on the next line, you are using SetArgReferee<k>(value) in
+  // a mock function whose k-th (0-based) argument is not a reference.
+  GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,
+                        SetArgReferee_must_be_used_with_a_reference_argument);
+  ::testing::get<k>(args) = value;
+}
+
+// Action SetArrayArgument<k>(first, last) copies the elements in
+// source range [first, last) to the array pointed to by the k-th
+// (0-based) argument, which can be either a pointer or an
+// iterator. The action does not take ownership of the elements in the
+// source range.
+ACTION_TEMPLATE(SetArrayArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_2_VALUE_PARAMS(first, last)) {
+  // Visual Studio deprecates ::std::copy, so we use our own copy in that case.
+#ifdef _MSC_VER
+  internal::CopyElements(first, last, ::testing::get<k>(args));
+#else
+  ::std::copy(first, last, ::testing::get<k>(args));
+#endif
+}
+
+// Action DeleteArg<k>() deletes the k-th (0-based) argument of the mock
+// function.
+ACTION_TEMPLATE(DeleteArg,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_0_VALUE_PARAMS()) {
+  delete ::testing::get<k>(args);
+}
+
+// This action returns the value pointed to by 'pointer'.
+ACTION_P(ReturnPointee, pointer) { return *pointer; }
+
+// Action Throw(exception) can be used in a mock function of any type
+// to throw the given exception.  Any copyable value can be thrown.
+#if GTEST_HAS_EXCEPTIONS
+
+// Suppresses the 'unreachable code' warning that VC generates in opt modes.
+# ifdef _MSC_VER
+#  pragma warning(push)          // Saves the current warning state.
+#  pragma warning(disable:4702)  // Temporarily disables warning 4702.
+# endif
+ACTION_P(Throw, exception) { throw exception; }
+# ifdef _MSC_VER
+#  pragma warning(pop)           // Restores the warning state.
+# endif
+
+#endif  // GTEST_HAS_EXCEPTIONS
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-more-matchers.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-more-matchers.h
new file mode 100644
index 0000000..3db899f
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-more-matchers.h
@@ -0,0 +1,58 @@
+// Copyright 2013, 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: marcus.boerger@google.com (Marcus Boerger)
+
+// Google Mock - a framework for writing C++ mock classes.
+//
+// This file implements some matchers that depend on gmock-generated-matchers.h.
+//
+// Note that tests are implemented in gmock-matchers_test.cc rather than
+// gmock-more-matchers-test.cc.
+
+#ifndef GMOCK_GMOCK_MORE_MATCHERS_H_
+#define GMOCK_GMOCK_MORE_MATCHERS_H_
+
+#include "gmock/gmock-generated-matchers.h"
+
+namespace testing {
+
+// Defines a matcher that matches an empty container. The container must
+// support both size() and empty(), which all STL-like containers provide.
+MATCHER(IsEmpty, negation ? "isn't empty" : "is empty") {
+  if (arg.empty()) {
+    return true;
+  }
+  *result_listener << "whose size is " << arg.size();
+  return false;
+}
+
+}  // namespace testing
+
+#endif  // GMOCK_GMOCK_MORE_MATCHERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock-spec-builders.h b/third_party/ntcore_2018/gmock/include/gmock/gmock-spec-builders.h
new file mode 100644
index 0000000..fed7de6
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock-spec-builders.h
@@ -0,0 +1,1847 @@
+// 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 the ON_CALL() and EXPECT_CALL() macros.
+//
+// A user can use the ON_CALL() macro to specify the default action of
+// a mock method.  The syntax is:
+//
+//   ON_CALL(mock_object, Method(argument-matchers))
+//       .With(multi-argument-matcher)
+//       .WillByDefault(action);
+//
+//  where the .With() clause is optional.
+//
+// A user can use the EXPECT_CALL() macro to specify an expectation on
+// a mock method.  The syntax is:
+//
+//   EXPECT_CALL(mock_object, Method(argument-matchers))
+//       .With(multi-argument-matchers)
+//       .Times(cardinality)
+//       .InSequence(sequences)
+//       .After(expectations)
+//       .WillOnce(action)
+//       .WillRepeatedly(action)
+//       .RetiresOnSaturation();
+//
+// where all clauses are optional, and .InSequence()/.After()/
+// .WillOnce() can appear any number of times.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
+
+#include <map>
+#include <set>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#if GTEST_HAS_EXCEPTIONS
+# include <stdexcept>  // NOLINT
+#endif
+
+#include "gmock/gmock-actions.h"
+#include "gmock/gmock-cardinalities.h"
+#include "gmock/gmock-matchers.h"
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+
+// An abstract handle of an expectation.
+class Expectation;
+
+// A set of expectation handles.
+class ExpectationSet;
+
+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
+// and MUST NOT BE USED IN USER CODE!!!
+namespace internal {
+
+// Implements a mock function.
+template <typename F> class FunctionMocker;
+
+// Base class for expectations.
+class ExpectationBase;
+
+// Implements an expectation.
+template <typename F> class TypedExpectation;
+
+// Helper class for testing the Expectation class template.
+class ExpectationTester;
+
+// Base class for function mockers.
+template <typename F> class FunctionMockerBase;
+
+// Protects the mock object registry (in class Mock), all function
+// mockers, and all expectations.
+//
+// The reason we don't use more fine-grained protection is: when a
+// mock function Foo() is called, it needs to consult its expectations
+// to see which one should be picked.  If another thread is allowed to
+// call a mock function (either Foo() or a different one) at the same
+// time, it could affect the "retired" attributes of Foo()'s
+// expectations when InSequence() is used, and thus affect which
+// expectation gets picked.  Therefore, we sequence all mock function
+// calls to ensure the integrity of the mock objects' states.
+GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex);
+
+// Untyped base class for ActionResultHolder<R>.
+class UntypedActionResultHolderBase;
+
+// Abstract base class of FunctionMockerBase.  This is the
+// type-agnostic part of the function mocker interface.  Its pure
+// virtual methods are implemented by FunctionMockerBase.
+class GTEST_API_ UntypedFunctionMockerBase {
+ public:
+  UntypedFunctionMockerBase();
+  virtual ~UntypedFunctionMockerBase();
+
+  // Verifies that all expectations on this mock function have been
+  // satisfied.  Reports one or more Google Test non-fatal failures
+  // and returns false if not.
+  bool VerifyAndClearExpectationsLocked()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Clears the ON_CALL()s set on this mock function.
+  virtual void ClearDefaultActionsLocked()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) = 0;
+
+  // In all of the following Untyped* functions, it's the caller's
+  // responsibility to guarantee the correctness of the arguments'
+  // types.
+
+  // Performs the default action with the given arguments and returns
+  // the action's result.  The call description string will be used in
+  // the error message to describe the call in the case the default
+  // action fails.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
+      const void* untyped_args,
+      const string& call_description) const = 0;
+
+  // Performs the given action with the given arguments and returns
+  // the action's result.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformAction(
+      const void* untyped_action,
+      const void* untyped_args) const = 0;
+
+  // Writes a message that the call is uninteresting (i.e. neither
+  // explicitly expected nor explicitly unexpected) to the given
+  // ostream.
+  virtual void UntypedDescribeUninterestingCall(
+      const void* untyped_args,
+      ::std::ostream* os) const
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
+
+  // Returns the expectation that matches the given function arguments
+  // (or NULL is there's no match); when a match is found,
+  // untyped_action is set to point to the action that should be
+  // performed (or NULL if the action is "do default"), and
+  // is_excessive is modified to indicate whether the call exceeds the
+  // expected number.
+  virtual const ExpectationBase* UntypedFindMatchingExpectation(
+      const void* untyped_args,
+      const void** untyped_action, bool* is_excessive,
+      ::std::ostream* what, ::std::ostream* why)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
+
+  // Prints the given function arguments to the ostream.
+  virtual void UntypedPrintArgs(const void* untyped_args,
+                                ::std::ostream* os) const = 0;
+
+  // Sets the mock object this mock method belongs to, and registers
+  // this information in the global mock registry.  Will be called
+  // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
+  // method.
+  // TODO(wan@google.com): rename to SetAndRegisterOwner().
+  void RegisterOwner(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Sets the mock object this mock method belongs to, and sets the
+  // name of the mock function.  Will be called upon each invocation
+  // of this mock function.
+  void SetOwnerAndName(const void* mock_obj, const char* name)
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Returns the mock object this mock method belongs to.  Must be
+  // called after RegisterOwner() or SetOwnerAndName() has been
+  // called.
+  const void* MockObject() const
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Returns the name of this mock method.  Must be called after
+  // SetOwnerAndName() has been called.
+  const char* Name() const
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Returns the result of invoking this mock function with the given
+  // arguments.  This function can be safely called from multiple
+  // threads concurrently.  The caller is responsible for deleting the
+  // result.
+  UntypedActionResultHolderBase* UntypedInvokeWith(
+      const void* untyped_args)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+ protected:
+  typedef std::vector<const void*> UntypedOnCallSpecs;
+
+  typedef std::vector<internal::linked_ptr<ExpectationBase> >
+  UntypedExpectations;
+
+  // Returns an Expectation object that references and co-owns exp,
+  // which must be an expectation on this mock function.
+  Expectation GetHandleOf(ExpectationBase* exp);
+
+  // Address of the mock object this mock method belongs to.  Only
+  // valid after this mock method has been called or
+  // ON_CALL/EXPECT_CALL has been invoked on it.
+  const void* mock_obj_;  // Protected by g_gmock_mutex.
+
+  // Name of the function being mocked.  Only valid after this mock
+  // method has been called.
+  const char* name_;  // Protected by g_gmock_mutex.
+
+  // All default action specs for this function mocker.
+  UntypedOnCallSpecs untyped_on_call_specs_;
+
+  // All expectations for this function mocker.
+  UntypedExpectations untyped_expectations_;
+};  // class UntypedFunctionMockerBase
+
+// Untyped base class for OnCallSpec<F>.
+class UntypedOnCallSpecBase {
+ public:
+  // The arguments are the location of the ON_CALL() statement.
+  UntypedOnCallSpecBase(const char* a_file, int a_line)
+      : file_(a_file), line_(a_line), last_clause_(kNone) {}
+
+  // Where in the source file was the default action spec defined?
+  const char* file() const { return file_; }
+  int line() const { return line_; }
+
+ protected:
+  // Gives each clause in the ON_CALL() statement a name.
+  enum Clause {
+    // Do not change the order of the enum members!  The run-time
+    // syntax checking relies on it.
+    kNone,
+    kWith,
+    kWillByDefault
+  };
+
+  // Asserts that the ON_CALL() statement has a certain property.
+  void AssertSpecProperty(bool property, const string& failure_message) const {
+    Assert(property, file_, line_, failure_message);
+  }
+
+  // Expects that the ON_CALL() statement has a certain property.
+  void ExpectSpecProperty(bool property, const string& failure_message) const {
+    Expect(property, file_, line_, failure_message);
+  }
+
+  const char* file_;
+  int line_;
+
+  // The last clause in the ON_CALL() statement as seen so far.
+  // Initially kNone and changes as the statement is parsed.
+  Clause last_clause_;
+};  // class UntypedOnCallSpecBase
+
+// This template class implements an ON_CALL spec.
+template <typename F>
+class OnCallSpec : public UntypedOnCallSpecBase {
+ public:
+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
+
+  // Constructs an OnCallSpec object from the information inside
+  // the parenthesis of an ON_CALL() statement.
+  OnCallSpec(const char* a_file, int a_line,
+             const ArgumentMatcherTuple& matchers)
+      : UntypedOnCallSpecBase(a_file, a_line),
+        matchers_(matchers),
+        // By default, extra_matcher_ should match anything.  However,
+        // we cannot initialize it with _ as that triggers a compiler
+        // bug in Symbian's C++ compiler (cannot decide between two
+        // overloaded constructors of Matcher<const ArgumentTuple&>).
+        extra_matcher_(A<const ArgumentTuple&>()) {
+  }
+
+  // Implements the .With() clause.
+  OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
+    // Makes sure this is called at most once.
+    ExpectSpecProperty(last_clause_ < kWith,
+                       ".With() cannot appear "
+                       "more than once in an ON_CALL().");
+    last_clause_ = kWith;
+
+    extra_matcher_ = m;
+    return *this;
+  }
+
+  // Implements the .WillByDefault() clause.
+  OnCallSpec& WillByDefault(const Action<F>& action) {
+    ExpectSpecProperty(last_clause_ < kWillByDefault,
+                       ".WillByDefault() must appear "
+                       "exactly once in an ON_CALL().");
+    last_clause_ = kWillByDefault;
+
+    ExpectSpecProperty(!action.IsDoDefault(),
+                       "DoDefault() cannot be used in ON_CALL().");
+    action_ = action;
+    return *this;
+  }
+
+  // Returns true iff the given arguments match the matchers.
+  bool Matches(const ArgumentTuple& args) const {
+    return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
+  }
+
+  // Returns the action specified by the user.
+  const Action<F>& GetAction() const {
+    AssertSpecProperty(last_clause_ == kWillByDefault,
+                       ".WillByDefault() must appear exactly "
+                       "once in an ON_CALL().");
+    return action_;
+  }
+
+ private:
+  // The information in statement
+  //
+  //   ON_CALL(mock_object, Method(matchers))
+  //       .With(multi-argument-matcher)
+  //       .WillByDefault(action);
+  //
+  // is recorded in the data members like this:
+  //
+  //   source file that contains the statement => file_
+  //   line number of the statement            => line_
+  //   matchers                                => matchers_
+  //   multi-argument-matcher                  => extra_matcher_
+  //   action                                  => action_
+  ArgumentMatcherTuple matchers_;
+  Matcher<const ArgumentTuple&> extra_matcher_;
+  Action<F> action_;
+};  // class OnCallSpec
+
+// Possible reactions on uninteresting calls.
+enum CallReaction {
+  kAllow,
+  kWarn,
+  kFail,
+  kDefault = kWarn  // By default, warn about uninteresting calls.
+};
+
+}  // namespace internal
+
+// Utilities for manipulating mock objects.
+class GTEST_API_ Mock {
+ public:
+  // The following public methods can be called concurrently.
+
+  // Tells Google Mock to ignore mock_obj when checking for leaked
+  // mock objects.
+  static void AllowLeak(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Verifies and clears all expectations on the given mock object.
+  // If the expectations aren't satisfied, generates one or more
+  // Google Test non-fatal failures and returns false.
+  static bool VerifyAndClearExpectations(void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Verifies all expectations on the given mock object and clears its
+  // default actions and expectations.  Returns true iff the
+  // verification was successful.
+  static bool VerifyAndClear(void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+ private:
+  friend class internal::UntypedFunctionMockerBase;
+
+  // Needed for a function mocker to register itself (so that we know
+  // how to clear a mock object).
+  template <typename F>
+  friend class internal::FunctionMockerBase;
+
+  template <typename M>
+  friend class NiceMock;
+
+  template <typename M>
+  friend class NaggyMock;
+
+  template <typename M>
+  friend class StrictMock;
+
+  // Tells Google Mock to allow uninteresting calls on the given mock
+  // object.
+  static void AllowUninterestingCalls(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock to warn the user about uninteresting calls on
+  // the given mock object.
+  static void WarnUninterestingCalls(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock to fail uninteresting calls on the given mock
+  // object.
+  static void FailUninterestingCalls(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock the given mock object is being destroyed and
+  // its entry in the call-reaction table should be removed.
+  static void UnregisterCallReaction(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Returns the reaction Google Mock will have on uninteresting calls
+  // made on the given mock object.
+  static internal::CallReaction GetReactionOnUninterestingCalls(
+      const void* mock_obj)
+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Verifies that all expectations on the given mock object have been
+  // satisfied.  Reports one or more Google Test non-fatal failures
+  // and returns false if not.
+  static bool VerifyAndClearExpectationsLocked(void* mock_obj)
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
+
+  // Clears all ON_CALL()s set on the given mock object.
+  static void ClearDefaultActionsLocked(void* mock_obj)
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
+
+  // Registers a mock object and a mock method it owns.
+  static void Register(
+      const void* mock_obj,
+      internal::UntypedFunctionMockerBase* mocker)
+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock where in the source code mock_obj is used in an
+  // ON_CALL or EXPECT_CALL.  In case mock_obj is leaked, this
+  // information helps the user identify which object it is.
+  static void RegisterUseByOnCallOrExpectCall(
+      const void* mock_obj, const char* file, int line)
+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Unregisters a mock method; removes the owning mock object from
+  // the registry when the last mock method associated with it has
+  // been unregistered.  This is called only in the destructor of
+  // FunctionMockerBase.
+  static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
+};  // class Mock
+
+// An abstract handle of an expectation.  Useful in the .After()
+// clause of EXPECT_CALL() for setting the (partial) order of
+// expectations.  The syntax:
+//
+//   Expectation e1 = EXPECT_CALL(...)...;
+//   EXPECT_CALL(...).After(e1)...;
+//
+// sets two expectations where the latter can only be matched after
+// the former has been satisfied.
+//
+// Notes:
+//   - This class is copyable and has value semantics.
+//   - Constness is shallow: a const Expectation object itself cannot
+//     be modified, but the mutable methods of the ExpectationBase
+//     object it references can be called via expectation_base().
+//   - The constructors and destructor are defined out-of-line because
+//     the Symbian WINSCW compiler wants to otherwise instantiate them
+//     when it sees this class definition, at which point it doesn't have
+//     ExpectationBase available yet, leading to incorrect destruction
+//     in the linked_ptr (or compilation errors if using a checking
+//     linked_ptr).
+class GTEST_API_ Expectation {
+ public:
+  // Constructs a null object that doesn't reference any expectation.
+  Expectation();
+
+  ~Expectation();
+
+  // This single-argument ctor must not be explicit, in order to support the
+  //   Expectation e = EXPECT_CALL(...);
+  // syntax.
+  //
+  // A TypedExpectation object stores its pre-requisites as
+  // Expectation objects, and needs to call the non-const Retire()
+  // method on the ExpectationBase objects they reference.  Therefore
+  // Expectation must receive a *non-const* reference to the
+  // ExpectationBase object.
+  Expectation(internal::ExpectationBase& exp);  // NOLINT
+
+  // The compiler-generated copy ctor and operator= work exactly as
+  // intended, so we don't need to define our own.
+
+  // Returns true iff rhs references the same expectation as this object does.
+  bool operator==(const Expectation& rhs) const {
+    return expectation_base_ == rhs.expectation_base_;
+  }
+
+  bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
+
+ private:
+  friend class ExpectationSet;
+  friend class Sequence;
+  friend class ::testing::internal::ExpectationBase;
+  friend class ::testing::internal::UntypedFunctionMockerBase;
+
+  template <typename F>
+  friend class ::testing::internal::FunctionMockerBase;
+
+  template <typename F>
+  friend class ::testing::internal::TypedExpectation;
+
+  // This comparator is needed for putting Expectation objects into a set.
+  class Less {
+   public:
+    bool operator()(const Expectation& lhs, const Expectation& rhs) const {
+      return lhs.expectation_base_.get() < rhs.expectation_base_.get();
+    }
+  };
+
+  typedef ::std::set<Expectation, Less> Set;
+
+  Expectation(
+      const internal::linked_ptr<internal::ExpectationBase>& expectation_base);
+
+  // Returns the expectation this object references.
+  const internal::linked_ptr<internal::ExpectationBase>&
+  expectation_base() const {
+    return expectation_base_;
+  }
+
+  // A linked_ptr that co-owns the expectation this handle references.
+  internal::linked_ptr<internal::ExpectationBase> expectation_base_;
+};
+
+// A set of expectation handles.  Useful in the .After() clause of
+// EXPECT_CALL() for setting the (partial) order of expectations.  The
+// syntax:
+//
+//   ExpectationSet es;
+//   es += EXPECT_CALL(...)...;
+//   es += EXPECT_CALL(...)...;
+//   EXPECT_CALL(...).After(es)...;
+//
+// sets three expectations where the last one can only be matched
+// after the first two have both been satisfied.
+//
+// This class is copyable and has value semantics.
+class ExpectationSet {
+ public:
+  // A bidirectional iterator that can read a const element in the set.
+  typedef Expectation::Set::const_iterator const_iterator;
+
+  // An object stored in the set.  This is an alias of Expectation.
+  typedef Expectation::Set::value_type value_type;
+
+  // Constructs an empty set.
+  ExpectationSet() {}
+
+  // This single-argument ctor must not be explicit, in order to support the
+  //   ExpectationSet es = EXPECT_CALL(...);
+  // syntax.
+  ExpectationSet(internal::ExpectationBase& exp) {  // NOLINT
+    *this += Expectation(exp);
+  }
+
+  // This single-argument ctor implements implicit conversion from
+  // Expectation and thus must not be explicit.  This allows either an
+  // Expectation or an ExpectationSet to be used in .After().
+  ExpectationSet(const Expectation& e) {  // NOLINT
+    *this += e;
+  }
+
+  // The compiler-generator ctor and operator= works exactly as
+  // intended, so we don't need to define our own.
+
+  // Returns true iff rhs contains the same set of Expectation objects
+  // as this does.
+  bool operator==(const ExpectationSet& rhs) const {
+    return expectations_ == rhs.expectations_;
+  }
+
+  bool operator!=(const ExpectationSet& rhs) const { return !(*this == rhs); }
+
+  // Implements the syntax
+  //   expectation_set += EXPECT_CALL(...);
+  ExpectationSet& operator+=(const Expectation& e) {
+    expectations_.insert(e);
+    return *this;
+  }
+
+  int size() const { return static_cast<int>(expectations_.size()); }
+
+  const_iterator begin() const { return expectations_.begin(); }
+  const_iterator end() const { return expectations_.end(); }
+
+ private:
+  Expectation::Set expectations_;
+};
+
+
+// Sequence objects are used by a user to specify the relative order
+// in which the expectations should match.  They are copyable (we rely
+// on the compiler-defined copy constructor and assignment operator).
+class GTEST_API_ Sequence {
+ public:
+  // Constructs an empty sequence.
+  Sequence() : last_expectation_(new Expectation) {}
+
+  // Adds an expectation to this sequence.  The caller must ensure
+  // that no other thread is accessing this Sequence object.
+  void AddExpectation(const Expectation& expectation) const;
+
+ private:
+  // The last expectation in this sequence.  We use a linked_ptr here
+  // because Sequence objects are copyable and we want the copies to
+  // be aliases.  The linked_ptr allows the copies to co-own and share
+  // the same Expectation object.
+  internal::linked_ptr<Expectation> last_expectation_;
+};  // class Sequence
+
+// An object of this type causes all EXPECT_CALL() statements
+// encountered in its scope to be put in an anonymous sequence.  The
+// work is done in the constructor and destructor.  You should only
+// create an InSequence object on the stack.
+//
+// The sole purpose for this class is to support easy definition of
+// sequential expectations, e.g.
+//
+//   {
+//     InSequence dummy;  // The name of the object doesn't matter.
+//
+//     // The following expectations must match in the order they appear.
+//     EXPECT_CALL(a, Bar())...;
+//     EXPECT_CALL(a, Baz())...;
+//     ...
+//     EXPECT_CALL(b, Xyz())...;
+//   }
+//
+// You can create InSequence objects in multiple threads, as long as
+// they are used to affect different mock objects.  The idea is that
+// each thread can create and set up its own mocks as if it's the only
+// thread.  However, for clarity of your tests we recommend you to set
+// up mocks in the main thread unless you have a good reason not to do
+// so.
+class GTEST_API_ InSequence {
+ public:
+  InSequence();
+  ~InSequence();
+ private:
+  bool sequence_created_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence);  // NOLINT
+} GTEST_ATTRIBUTE_UNUSED_;
+
+namespace internal {
+
+// Points to the implicit sequence introduced by a living InSequence
+// object (if any) in the current thread or NULL.
+GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence;
+
+// Base class for implementing expectations.
+//
+// There are two reasons for having a type-agnostic base class for
+// Expectation:
+//
+//   1. We need to store collections of expectations of different
+//   types (e.g. all pre-requisites of a particular expectation, all
+//   expectations in a sequence).  Therefore these expectation objects
+//   must share a common base class.
+//
+//   2. We can avoid binary code bloat by moving methods not depending
+//   on the template argument of Expectation to the base class.
+//
+// This class is internal and mustn't be used by user code directly.
+class GTEST_API_ ExpectationBase {
+ public:
+  // source_text is the EXPECT_CALL(...) source that created this Expectation.
+  ExpectationBase(const char* file, int line, const string& source_text);
+
+  virtual ~ExpectationBase();
+
+  // Where in the source file was the expectation spec defined?
+  const char* file() const { return file_; }
+  int line() const { return line_; }
+  const char* source_text() const { return source_text_.c_str(); }
+  // Returns the cardinality specified in the expectation spec.
+  const Cardinality& cardinality() const { return cardinality_; }
+
+  // Describes the source file location of this expectation.
+  void DescribeLocationTo(::std::ostream* os) const {
+    *os << FormatFileLocation(file(), line()) << " ";
+  }
+
+  // Describes how many times a function call matching this
+  // expectation has occurred.
+  void DescribeCallCountTo(::std::ostream* os) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // If this mock method has an extra matcher (i.e. .With(matcher)),
+  // describes it to the ostream.
+  virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;
+
+ protected:
+  friend class ::testing::Expectation;
+  friend class UntypedFunctionMockerBase;
+
+  enum Clause {
+    // Don't change the order of the enum members!
+    kNone,
+    kWith,
+    kTimes,
+    kInSequence,
+    kAfter,
+    kWillOnce,
+    kWillRepeatedly,
+    kRetiresOnSaturation
+  };
+
+  typedef std::vector<const void*> UntypedActions;
+
+  // Returns an Expectation object that references and co-owns this
+  // expectation.
+  virtual Expectation GetHandle() = 0;
+
+  // Asserts that the EXPECT_CALL() statement has the given property.
+  void AssertSpecProperty(bool property, const string& failure_message) const {
+    Assert(property, file_, line_, failure_message);
+  }
+
+  // Expects that the EXPECT_CALL() statement has the given property.
+  void ExpectSpecProperty(bool property, const string& failure_message) const {
+    Expect(property, file_, line_, failure_message);
+  }
+
+  // Explicitly specifies the cardinality of this expectation.  Used
+  // by the subclasses to implement the .Times() clause.
+  void SpecifyCardinality(const Cardinality& cardinality);
+
+  // Returns true iff the user specified the cardinality explicitly
+  // using a .Times().
+  bool cardinality_specified() const { return cardinality_specified_; }
+
+  // Sets the cardinality of this expectation spec.
+  void set_cardinality(const Cardinality& a_cardinality) {
+    cardinality_ = a_cardinality;
+  }
+
+  // The following group of methods should only be called after the
+  // EXPECT_CALL() statement, and only when g_gmock_mutex is held by
+  // the current thread.
+
+  // Retires all pre-requisites of this expectation.
+  void RetireAllPreRequisites()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Returns true iff this expectation is retired.
+  bool is_retired() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return retired_;
+  }
+
+  // Retires this expectation.
+  void Retire()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    retired_ = true;
+  }
+
+  // Returns true iff this expectation is satisfied.
+  bool IsSatisfied() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return cardinality().IsSatisfiedByCallCount(call_count_);
+  }
+
+  // Returns true iff this expectation is saturated.
+  bool IsSaturated() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return cardinality().IsSaturatedByCallCount(call_count_);
+  }
+
+  // Returns true iff this expectation is over-saturated.
+  bool IsOverSaturated() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return cardinality().IsOverSaturatedByCallCount(call_count_);
+  }
+
+  // Returns true iff all pre-requisites of this expectation are satisfied.
+  bool AllPrerequisitesAreSatisfied() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Adds unsatisfied pre-requisites of this expectation to 'result'.
+  void FindUnsatisfiedPrerequisites(ExpectationSet* result) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Returns the number this expectation has been invoked.
+  int call_count() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return call_count_;
+  }
+
+  // Increments the number this expectation has been invoked.
+  void IncrementCallCount()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    call_count_++;
+  }
+
+  // Checks the action count (i.e. the number of WillOnce() and
+  // WillRepeatedly() clauses) against the cardinality if this hasn't
+  // been done before.  Prints a warning if there are too many or too
+  // few actions.
+  void CheckActionCountIfNotDone() const
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  friend class ::testing::Sequence;
+  friend class ::testing::internal::ExpectationTester;
+
+  template <typename Function>
+  friend class TypedExpectation;
+
+  // Implements the .Times() clause.
+  void UntypedTimes(const Cardinality& a_cardinality);
+
+  // This group of fields are part of the spec and won't change after
+  // an EXPECT_CALL() statement finishes.
+  const char* file_;          // The file that contains the expectation.
+  int line_;                  // The line number of the expectation.
+  const string source_text_;  // The EXPECT_CALL(...) source text.
+  // True iff the cardinality is specified explicitly.
+  bool cardinality_specified_;
+  Cardinality cardinality_;            // The cardinality of the expectation.
+  // The immediate pre-requisites (i.e. expectations that must be
+  // satisfied before this expectation can be matched) of this
+  // expectation.  We use linked_ptr in the set because we want an
+  // Expectation object to be co-owned by its FunctionMocker and its
+  // successors.  This allows multiple mock objects to be deleted at
+  // different times.
+  ExpectationSet immediate_prerequisites_;
+
+  // This group of fields are the current state of the expectation,
+  // and can change as the mock function is called.
+  int call_count_;  // How many times this expectation has been invoked.
+  bool retired_;    // True iff this expectation has retired.
+  UntypedActions untyped_actions_;
+  bool extra_matcher_specified_;
+  bool repeated_action_specified_;  // True if a WillRepeatedly() was specified.
+  bool retires_on_saturation_;
+  Clause last_clause_;
+  mutable bool action_count_checked_;  // Under mutex_.
+  mutable Mutex mutex_;  // Protects action_count_checked_.
+
+  GTEST_DISALLOW_ASSIGN_(ExpectationBase);
+};  // class ExpectationBase
+
+// Impements an expectation for the given function type.
+template <typename F>
+class TypedExpectation : public ExpectationBase {
+ public:
+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
+  typedef typename Function<F>::Result Result;
+
+  TypedExpectation(FunctionMockerBase<F>* owner,
+                   const char* a_file, int a_line, const string& a_source_text,
+                   const ArgumentMatcherTuple& m)
+      : ExpectationBase(a_file, a_line, a_source_text),
+        owner_(owner),
+        matchers_(m),
+        // By default, extra_matcher_ should match anything.  However,
+        // we cannot initialize it with _ as that triggers a compiler
+        // bug in Symbian's C++ compiler (cannot decide between two
+        // overloaded constructors of Matcher<const ArgumentTuple&>).
+        extra_matcher_(A<const ArgumentTuple&>()),
+        repeated_action_(DoDefault()) {}
+
+  virtual ~TypedExpectation() {
+    // Check the validity of the action count if it hasn't been done
+    // yet (for example, if the expectation was never used).
+    CheckActionCountIfNotDone();
+    for (UntypedActions::const_iterator it = untyped_actions_.begin();
+         it != untyped_actions_.end(); ++it) {
+      delete static_cast<const Action<F>*>(*it);
+    }
+  }
+
+  // Implements the .With() clause.
+  TypedExpectation& With(const Matcher<const ArgumentTuple&>& m) {
+    if (last_clause_ == kWith) {
+      ExpectSpecProperty(false,
+                         ".With() cannot appear "
+                         "more than once in an EXPECT_CALL().");
+    } else {
+      ExpectSpecProperty(last_clause_ < kWith,
+                         ".With() must be the first "
+                         "clause in an EXPECT_CALL().");
+    }
+    last_clause_ = kWith;
+
+    extra_matcher_ = m;
+    extra_matcher_specified_ = true;
+    return *this;
+  }
+
+  // Implements the .Times() clause.
+  TypedExpectation& Times(const Cardinality& a_cardinality) {
+    ExpectationBase::UntypedTimes(a_cardinality);
+    return *this;
+  }
+
+  // Implements the .Times() clause.
+  TypedExpectation& Times(int n) {
+    return Times(Exactly(n));
+  }
+
+  // Implements the .InSequence() clause.
+  TypedExpectation& InSequence(const Sequence& s) {
+    ExpectSpecProperty(last_clause_ <= kInSequence,
+                       ".InSequence() cannot appear after .After(),"
+                       " .WillOnce(), .WillRepeatedly(), or "
+                       ".RetiresOnSaturation().");
+    last_clause_ = kInSequence;
+
+    s.AddExpectation(GetHandle());
+    return *this;
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {
+    return InSequence(s1).InSequence(s2);
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
+                               const Sequence& s3) {
+    return InSequence(s1, s2).InSequence(s3);
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
+                               const Sequence& s3, const Sequence& s4) {
+    return InSequence(s1, s2, s3).InSequence(s4);
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
+                               const Sequence& s3, const Sequence& s4,
+                               const Sequence& s5) {
+    return InSequence(s1, s2, s3, s4).InSequence(s5);
+  }
+
+  // Implements that .After() clause.
+  TypedExpectation& After(const ExpectationSet& s) {
+    ExpectSpecProperty(last_clause_ <= kAfter,
+                       ".After() cannot appear after .WillOnce(),"
+                       " .WillRepeatedly(), or "
+                       ".RetiresOnSaturation().");
+    last_clause_ = kAfter;
+
+    for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
+      immediate_prerequisites_ += *it;
+    }
+    return *this;
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2) {
+    return After(s1).After(s2);
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
+                          const ExpectationSet& s3) {
+    return After(s1, s2).After(s3);
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
+                          const ExpectationSet& s3, const ExpectationSet& s4) {
+    return After(s1, s2, s3).After(s4);
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
+                          const ExpectationSet& s3, const ExpectationSet& s4,
+                          const ExpectationSet& s5) {
+    return After(s1, s2, s3, s4).After(s5);
+  }
+
+  // Implements the .WillOnce() clause.
+  TypedExpectation& WillOnce(const Action<F>& action) {
+    ExpectSpecProperty(last_clause_ <= kWillOnce,
+                       ".WillOnce() cannot appear after "
+                       ".WillRepeatedly() or .RetiresOnSaturation().");
+    last_clause_ = kWillOnce;
+
+    untyped_actions_.push_back(new Action<F>(action));
+    if (!cardinality_specified()) {
+      set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
+    }
+    return *this;
+  }
+
+  // Implements the .WillRepeatedly() clause.
+  TypedExpectation& WillRepeatedly(const Action<F>& action) {
+    if (last_clause_ == kWillRepeatedly) {
+      ExpectSpecProperty(false,
+                         ".WillRepeatedly() cannot appear "
+                         "more than once in an EXPECT_CALL().");
+    } else {
+      ExpectSpecProperty(last_clause_ < kWillRepeatedly,
+                         ".WillRepeatedly() cannot appear "
+                         "after .RetiresOnSaturation().");
+    }
+    last_clause_ = kWillRepeatedly;
+    repeated_action_specified_ = true;
+
+    repeated_action_ = action;
+    if (!cardinality_specified()) {
+      set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
+    }
+
+    // Now that no more action clauses can be specified, we check
+    // whether their count makes sense.
+    CheckActionCountIfNotDone();
+    return *this;
+  }
+
+  // Implements the .RetiresOnSaturation() clause.
+  TypedExpectation& RetiresOnSaturation() {
+    ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
+                       ".RetiresOnSaturation() cannot appear "
+                       "more than once.");
+    last_clause_ = kRetiresOnSaturation;
+    retires_on_saturation_ = true;
+
+    // Now that no more action clauses can be specified, we check
+    // whether their count makes sense.
+    CheckActionCountIfNotDone();
+    return *this;
+  }
+
+  // Returns the matchers for the arguments as specified inside the
+  // EXPECT_CALL() macro.
+  const ArgumentMatcherTuple& matchers() const {
+    return matchers_;
+  }
+
+  // Returns the matcher specified by the .With() clause.
+  const Matcher<const ArgumentTuple&>& extra_matcher() const {
+    return extra_matcher_;
+  }
+
+  // Returns the action specified by the .WillRepeatedly() clause.
+  const Action<F>& repeated_action() const { return repeated_action_; }
+
+  // If this mock method has an extra matcher (i.e. .With(matcher)),
+  // describes it to the ostream.
+  virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) {
+    if (extra_matcher_specified_) {
+      *os << "    Expected args: ";
+      extra_matcher_.DescribeTo(os);
+      *os << "\n";
+    }
+  }
+
+ private:
+  template <typename Function>
+  friend class FunctionMockerBase;
+
+  // Returns an Expectation object that references and co-owns this
+  // expectation.
+  virtual Expectation GetHandle() {
+    return owner_->GetHandleOf(this);
+  }
+
+  // The following methods will be called only after the EXPECT_CALL()
+  // statement finishes and when the current thread holds
+  // g_gmock_mutex.
+
+  // Returns true iff this expectation matches the given arguments.
+  bool Matches(const ArgumentTuple& args) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
+  }
+
+  // Returns true iff this expectation should handle the given arguments.
+  bool ShouldHandleArguments(const ArgumentTuple& args) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+
+    // In case the action count wasn't checked when the expectation
+    // was defined (e.g. if this expectation has no WillRepeatedly()
+    // or RetiresOnSaturation() clause), we check it when the
+    // expectation is used for the first time.
+    CheckActionCountIfNotDone();
+    return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
+  }
+
+  // Describes the result of matching the arguments against this
+  // expectation to the given ostream.
+  void ExplainMatchResultTo(
+      const ArgumentTuple& args,
+      ::std::ostream* os) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+
+    if (is_retired()) {
+      *os << "         Expected: the expectation is active\n"
+          << "           Actual: it is retired\n";
+    } else if (!Matches(args)) {
+      if (!TupleMatches(matchers_, args)) {
+        ExplainMatchFailureTupleTo(matchers_, args, os);
+      }
+      StringMatchResultListener listener;
+      if (!extra_matcher_.MatchAndExplain(args, &listener)) {
+        *os << "    Expected args: ";
+        extra_matcher_.DescribeTo(os);
+        *os << "\n           Actual: don't match";
+
+        internal::PrintIfNotEmpty(listener.str(), os);
+        *os << "\n";
+      }
+    } else if (!AllPrerequisitesAreSatisfied()) {
+      *os << "         Expected: all pre-requisites are satisfied\n"
+          << "           Actual: the following immediate pre-requisites "
+          << "are not satisfied:\n";
+      ExpectationSet unsatisfied_prereqs;
+      FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
+      int i = 0;
+      for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
+           it != unsatisfied_prereqs.end(); ++it) {
+        it->expectation_base()->DescribeLocationTo(os);
+        *os << "pre-requisite #" << i++ << "\n";
+      }
+      *os << "                   (end of pre-requisites)\n";
+    } else {
+      // This line is here just for completeness' sake.  It will never
+      // be executed as currently the ExplainMatchResultTo() function
+      // is called only when the mock function call does NOT match the
+      // expectation.
+      *os << "The call matches the expectation.\n";
+    }
+  }
+
+  // Returns the action that should be taken for the current invocation.
+  const Action<F>& GetCurrentAction(
+      const FunctionMockerBase<F>* mocker,
+      const ArgumentTuple& args) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    const int count = call_count();
+    Assert(count >= 1, __FILE__, __LINE__,
+           "call_count() is <= 0 when GetCurrentAction() is "
+           "called - this should never happen.");
+
+    const int action_count = static_cast<int>(untyped_actions_.size());
+    if (action_count > 0 && !repeated_action_specified_ &&
+        count > action_count) {
+      // If there is at least one WillOnce() and no WillRepeatedly(),
+      // we warn the user when the WillOnce() clauses ran out.
+      ::std::stringstream ss;
+      DescribeLocationTo(&ss);
+      ss << "Actions ran out in " << source_text() << "...\n"
+         << "Called " << count << " times, but only "
+         << action_count << " WillOnce()"
+         << (action_count == 1 ? " is" : "s are") << " specified - ";
+      mocker->DescribeDefaultActionTo(args, &ss);
+      Log(kWarning, ss.str(), 1);
+    }
+
+    return count <= action_count ?
+        *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
+        repeated_action();
+  }
+
+  // Given the arguments of a mock function call, if the call will
+  // over-saturate this expectation, returns the default action;
+  // otherwise, returns the next action in this expectation.  Also
+  // describes *what* happened to 'what', and explains *why* Google
+  // Mock does it to 'why'.  This method is not const as it calls
+  // IncrementCallCount().  A return value of NULL means the default
+  // action.
+  const Action<F>* GetActionForArguments(
+      const FunctionMockerBase<F>* mocker,
+      const ArgumentTuple& args,
+      ::std::ostream* what,
+      ::std::ostream* why)
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    if (IsSaturated()) {
+      // We have an excessive call.
+      IncrementCallCount();
+      *what << "Mock function called more times than expected - ";
+      mocker->DescribeDefaultActionTo(args, what);
+      DescribeCallCountTo(why);
+
+      // TODO(wan@google.com): allow the user to control whether
+      // unexpected calls should fail immediately or continue using a
+      // flag --gmock_unexpected_calls_are_fatal.
+      return NULL;
+    }
+
+    IncrementCallCount();
+    RetireAllPreRequisites();
+
+    if (retires_on_saturation_ && IsSaturated()) {
+      Retire();
+    }
+
+    // Must be done after IncrementCount()!
+    *what << "Mock function call matches " << source_text() <<"...\n";
+    return &(GetCurrentAction(mocker, args));
+  }
+
+  // All the fields below won't change once the EXPECT_CALL()
+  // statement finishes.
+  FunctionMockerBase<F>* const owner_;
+  ArgumentMatcherTuple matchers_;
+  Matcher<const ArgumentTuple&> extra_matcher_;
+  Action<F> repeated_action_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TypedExpectation);
+};  // class TypedExpectation
+
+// A MockSpec object is used by ON_CALL() or EXPECT_CALL() for
+// specifying the default behavior of, or expectation on, a mock
+// function.
+
+// Note: class MockSpec really belongs to the ::testing namespace.
+// However if we define it in ::testing, MSVC will complain when
+// classes in ::testing::internal declare it as a friend class
+// template.  To workaround this compiler bug, we define MockSpec in
+// ::testing::internal and import it into ::testing.
+
+// Logs a message including file and line number information.
+GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
+                                const char* file, int line,
+                                const string& message);
+
+template <typename F>
+class MockSpec {
+ public:
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename internal::Function<F>::ArgumentMatcherTuple
+      ArgumentMatcherTuple;
+
+  // Constructs a MockSpec object, given the function mocker object
+  // that the spec is associated with.
+  explicit MockSpec(internal::FunctionMockerBase<F>* function_mocker)
+      : function_mocker_(function_mocker) {}
+
+  // Adds a new default action spec to the function mocker and returns
+  // the newly created spec.
+  internal::OnCallSpec<F>& InternalDefaultActionSetAt(
+      const char* file, int line, const char* obj, const char* call) {
+    LogWithLocation(internal::kInfo, file, line,
+        string("ON_CALL(") + obj + ", " + call + ") invoked");
+    return function_mocker_->AddNewOnCallSpec(file, line, matchers_);
+  }
+
+  // Adds a new expectation spec to the function mocker and returns
+  // the newly created spec.
+  internal::TypedExpectation<F>& InternalExpectedAt(
+      const char* file, int line, const char* obj, const char* call) {
+    const string source_text(string("EXPECT_CALL(") + obj + ", " + call + ")");
+    LogWithLocation(internal::kInfo, file, line, source_text + " invoked");
+    return function_mocker_->AddNewExpectation(
+        file, line, source_text, matchers_);
+  }
+
+ private:
+  template <typename Function>
+  friend class internal::FunctionMocker;
+
+  void SetMatchers(const ArgumentMatcherTuple& matchers) {
+    matchers_ = matchers;
+  }
+
+  // The function mocker that owns this spec.
+  internal::FunctionMockerBase<F>* const function_mocker_;
+  // The argument matchers specified in the spec.
+  ArgumentMatcherTuple matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(MockSpec);
+};  // class MockSpec
+
+// Wrapper type for generically holding an ordinary value or lvalue reference.
+// If T is not a reference type, it must be copyable or movable.
+// ReferenceOrValueWrapper<T> is movable, and will also be copyable unless
+// T is a move-only value type (which means that it will always be copyable
+// if the current platform does not support move semantics).
+//
+// The primary template defines handling for values, but function header
+// comments describe the contract for the whole template (including
+// specializations).
+template <typename T>
+class ReferenceOrValueWrapper {
+ public:
+  // Constructs a wrapper from the given value/reference.
+  explicit ReferenceOrValueWrapper(T value)
+      : value_(::testing::internal::move(value)) {
+  }
+
+  // Unwraps and returns the underlying value/reference, exactly as
+  // originally passed. The behavior of calling this more than once on
+  // the same object is unspecified.
+  T Unwrap() { return ::testing::internal::move(value_); }
+
+  // Provides nondestructive access to the underlying value/reference.
+  // Always returns a const reference (more precisely,
+  // const RemoveReference<T>&). The behavior of calling this after
+  // calling Unwrap on the same object is unspecified.
+  const T& Peek() const {
+    return value_;
+  }
+
+ private:
+  T value_;
+};
+
+// Specialization for lvalue reference types. See primary template
+// for documentation.
+template <typename T>
+class ReferenceOrValueWrapper<T&> {
+ public:
+  // Workaround for debatable pass-by-reference lint warning (c-library-team
+  // policy precludes NOLINT in this context)
+  typedef T& reference;
+  explicit ReferenceOrValueWrapper(reference ref)
+      : value_ptr_(&ref) {}
+  T& Unwrap() { return *value_ptr_; }
+  const T& Peek() const { return *value_ptr_; }
+
+ private:
+  T* value_ptr_;
+};
+
+// MSVC warns about using 'this' in base member initializer list, so
+// we need to temporarily disable the warning.  We have to do it for
+// the entire class to suppress the warning, even though it's about
+// the constructor only.
+
+#ifdef _MSC_VER
+# pragma warning(push)          // Saves the current warning state.
+# pragma warning(disable:4355)  // Temporarily disables warning 4355.
+#endif  // _MSV_VER
+
+// C++ treats the void type specially.  For example, you cannot define
+// a void-typed variable or pass a void value to a function.
+// ActionResultHolder<T> holds a value of type T, where T must be a
+// copyable type or void (T doesn't need to be default-constructable).
+// It hides the syntactic difference between void and other types, and
+// is used to unify the code for invoking both void-returning and
+// non-void-returning mock functions.
+
+// Untyped base class for ActionResultHolder<T>.
+class UntypedActionResultHolderBase {
+ public:
+  virtual ~UntypedActionResultHolderBase() {}
+
+  // Prints the held value as an action's result to os.
+  virtual void PrintAsActionResult(::std::ostream* os) const = 0;
+};
+
+// This generic definition is used when T is not void.
+template <typename T>
+class ActionResultHolder : public UntypedActionResultHolderBase {
+ public:
+  // Returns the held value. Must not be called more than once.
+  T Unwrap() {
+    return result_.Unwrap();
+  }
+
+  // Prints the held value as an action's result to os.
+  virtual void PrintAsActionResult(::std::ostream* os) const {
+    *os << "\n          Returns: ";
+    // T may be a reference type, so we don't use UniversalPrint().
+    UniversalPrinter<T>::Print(result_.Peek(), os);
+  }
+
+  // Performs the given mock function's default action and returns the
+  // result in a new-ed ActionResultHolder.
+  template <typename F>
+  static ActionResultHolder* PerformDefaultAction(
+      const FunctionMockerBase<F>* func_mocker,
+      const typename Function<F>::ArgumentTuple& args,
+      const string& call_description) {
+    return new ActionResultHolder(Wrapper(
+        func_mocker->PerformDefaultAction(args, call_description)));
+  }
+
+  // Performs the given action and returns the result in a new-ed
+  // ActionResultHolder.
+  template <typename F>
+  static ActionResultHolder*
+  PerformAction(const Action<F>& action,
+                const typename Function<F>::ArgumentTuple& args) {
+    return new ActionResultHolder(Wrapper(action.Perform(args)));
+  }
+
+ private:
+  typedef ReferenceOrValueWrapper<T> Wrapper;
+
+  explicit ActionResultHolder(Wrapper result)
+      : result_(::testing::internal::move(result)) {
+  }
+
+  Wrapper result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
+};
+
+// Specialization for T = void.
+template <>
+class ActionResultHolder<void> : public UntypedActionResultHolderBase {
+ public:
+  void Unwrap() { }
+
+  virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
+
+  // Performs the given mock function's default action and returns ownership
+  // of an empty ActionResultHolder*.
+  template <typename F>
+  static ActionResultHolder* PerformDefaultAction(
+      const FunctionMockerBase<F>* func_mocker,
+      const typename Function<F>::ArgumentTuple& args,
+      const string& call_description) {
+    func_mocker->PerformDefaultAction(args, call_description);
+    return new ActionResultHolder;
+  }
+
+  // Performs the given action and returns ownership of an empty
+  // ActionResultHolder*.
+  template <typename F>
+  static ActionResultHolder* PerformAction(
+      const Action<F>& action,
+      const typename Function<F>::ArgumentTuple& args) {
+    action.Perform(args);
+    return new ActionResultHolder;
+  }
+
+ private:
+  ActionResultHolder() {}
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
+};
+
+// The base of the function mocker class for the given function type.
+// We put the methods in this class instead of its child to avoid code
+// bloat.
+template <typename F>
+class FunctionMockerBase : public UntypedFunctionMockerBase {
+ public:
+  typedef typename Function<F>::Result Result;
+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
+
+  FunctionMockerBase() : current_spec_(this) {}
+
+  // The destructor verifies that all expectations on this mock
+  // function have been satisfied.  If not, it will report Google Test
+  // non-fatal failures for the violations.
+  virtual ~FunctionMockerBase()
+        GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    MutexLock l(&g_gmock_mutex);
+    VerifyAndClearExpectationsLocked();
+    Mock::UnregisterLocked(this);
+    ClearDefaultActionsLocked();
+  }
+
+  // Returns the ON_CALL spec that matches this mock function with the
+  // given arguments; returns NULL if no matching ON_CALL is found.
+  // L = *
+  const OnCallSpec<F>* FindOnCallSpec(
+      const ArgumentTuple& args) const {
+    for (UntypedOnCallSpecs::const_reverse_iterator it
+             = untyped_on_call_specs_.rbegin();
+         it != untyped_on_call_specs_.rend(); ++it) {
+      const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it);
+      if (spec->Matches(args))
+        return spec;
+    }
+
+    return NULL;
+  }
+
+  // Performs the default action of this mock function on the given
+  // arguments and returns the result. Asserts (or throws if
+  // exceptions are enabled) with a helpful call descrption if there
+  // is no valid return value. This method doesn't depend on the
+  // mutable state of this object, and thus can be called concurrently
+  // without locking.
+  // L = *
+  Result PerformDefaultAction(const ArgumentTuple& args,
+                              const string& call_description) const {
+    const OnCallSpec<F>* const spec =
+        this->FindOnCallSpec(args);
+    if (spec != NULL) {
+      return spec->GetAction().Perform(args);
+    }
+    const string message = call_description +
+        "\n    The mock function has no default action "
+        "set, and its return type has no default value set.";
+#if GTEST_HAS_EXCEPTIONS
+    if (!DefaultValue<Result>::Exists()) {
+      throw std::runtime_error(message);
+    }
+#else
+    Assert(DefaultValue<Result>::Exists(), "", -1, message);
+#endif
+    return DefaultValue<Result>::Get();
+  }
+
+  // Performs the default action with the given arguments and returns
+  // the action's result.  The call description string will be used in
+  // the error message to describe the call in the case the default
+  // action fails.  The caller is responsible for deleting the result.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
+      const void* untyped_args,  // must point to an ArgumentTuple
+      const string& call_description) const {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    return ResultHolder::PerformDefaultAction(this, args, call_description);
+  }
+
+  // Performs the given action with the given arguments and returns
+  // the action's result.  The caller is responsible for deleting the
+  // result.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformAction(
+      const void* untyped_action, const void* untyped_args) const {
+    // Make a copy of the action before performing it, in case the
+    // action deletes the mock object (and thus deletes itself).
+    const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    return ResultHolder::PerformAction(action, args);
+  }
+
+  // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
+  // clears the ON_CALL()s set on this mock function.
+  virtual void ClearDefaultActionsLocked()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+
+    // Deleting our default actions may trigger other mock objects to be
+    // deleted, for example if an action contains a reference counted smart
+    // pointer to that mock object, and that is the last reference. So if we
+    // delete our actions within the context of the global mutex we may deadlock
+    // when this method is called again. Instead, make a copy of the set of
+    // actions to delete, clear our set within the mutex, and then delete the
+    // actions outside of the mutex.
+    UntypedOnCallSpecs specs_to_delete;
+    untyped_on_call_specs_.swap(specs_to_delete);
+
+    g_gmock_mutex.Unlock();
+    for (UntypedOnCallSpecs::const_iterator it =
+             specs_to_delete.begin();
+         it != specs_to_delete.end(); ++it) {
+      delete static_cast<const OnCallSpec<F>*>(*it);
+    }
+
+    // Lock the mutex again, since the caller expects it to be locked when we
+    // return.
+    g_gmock_mutex.Lock();
+  }
+
+ protected:
+  template <typename Function>
+  friend class MockSpec;
+
+  typedef ActionResultHolder<Result> ResultHolder;
+
+  // Returns the result of invoking this mock function with the given
+  // arguments.  This function can be safely called from multiple
+  // threads concurrently.
+  Result InvokeWith(const ArgumentTuple& args)
+        GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    scoped_ptr<ResultHolder> holder(
+        DownCast_<ResultHolder*>(this->UntypedInvokeWith(&args)));
+    return holder->Unwrap();
+  }
+
+  // Adds and returns a default action spec for this mock function.
+  OnCallSpec<F>& AddNewOnCallSpec(
+      const char* file, int line,
+      const ArgumentMatcherTuple& m)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
+    OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m);
+    untyped_on_call_specs_.push_back(on_call_spec);
+    return *on_call_spec;
+  }
+
+  // Adds and returns an expectation spec for this mock function.
+  TypedExpectation<F>& AddNewExpectation(
+      const char* file,
+      int line,
+      const string& source_text,
+      const ArgumentMatcherTuple& m)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
+    TypedExpectation<F>* const expectation =
+        new TypedExpectation<F>(this, file, line, source_text, m);
+    const linked_ptr<ExpectationBase> untyped_expectation(expectation);
+    untyped_expectations_.push_back(untyped_expectation);
+
+    // Adds this expectation into the implicit sequence if there is one.
+    Sequence* const implicit_sequence = g_gmock_implicit_sequence.get();
+    if (implicit_sequence != NULL) {
+      implicit_sequence->AddExpectation(Expectation(untyped_expectation));
+    }
+
+    return *expectation;
+  }
+
+  // The current spec (either default action spec or expectation spec)
+  // being described on this function mocker.
+  MockSpec<F>& current_spec() { return current_spec_; }
+
+ private:
+  template <typename Func> friend class TypedExpectation;
+
+  // Some utilities needed for implementing UntypedInvokeWith().
+
+  // Describes what default action will be performed for the given
+  // arguments.
+  // L = *
+  void DescribeDefaultActionTo(const ArgumentTuple& args,
+                               ::std::ostream* os) const {
+    const OnCallSpec<F>* const spec = FindOnCallSpec(args);
+
+    if (spec == NULL) {
+      *os << (internal::type_equals<Result, void>::value ?
+              "returning directly.\n" :
+              "returning default value.\n");
+    } else {
+      *os << "taking default action specified at:\n"
+          << FormatFileLocation(spec->file(), spec->line()) << "\n";
+    }
+  }
+
+  // Writes a message that the call is uninteresting (i.e. neither
+  // explicitly expected nor explicitly unexpected) to the given
+  // ostream.
+  virtual void UntypedDescribeUninterestingCall(
+      const void* untyped_args,
+      ::std::ostream* os) const
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    *os << "Uninteresting mock function call - ";
+    DescribeDefaultActionTo(args, os);
+    *os << "    Function call: " << Name();
+    UniversalPrint(args, os);
+  }
+
+  // Returns the expectation that matches the given function arguments
+  // (or NULL is there's no match); when a match is found,
+  // untyped_action is set to point to the action that should be
+  // performed (or NULL if the action is "do default"), and
+  // is_excessive is modified to indicate whether the call exceeds the
+  // expected number.
+  //
+  // Critical section: We must find the matching expectation and the
+  // corresponding action that needs to be taken in an ATOMIC
+  // transaction.  Otherwise another thread may call this mock
+  // method in the middle and mess up the state.
+  //
+  // However, performing the action has to be left out of the critical
+  // section.  The reason is that we have no control on what the
+  // action does (it can invoke an arbitrary user function or even a
+  // mock function) and excessive locking could cause a dead lock.
+  virtual const ExpectationBase* UntypedFindMatchingExpectation(
+      const void* untyped_args,
+      const void** untyped_action, bool* is_excessive,
+      ::std::ostream* what, ::std::ostream* why)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    MutexLock l(&g_gmock_mutex);
+    TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);
+    if (exp == NULL) {  // A match wasn't found.
+      this->FormatUnexpectedCallMessageLocked(args, what, why);
+      return NULL;
+    }
+
+    // This line must be done before calling GetActionForArguments(),
+    // which will increment the call count for *exp and thus affect
+    // its saturation status.
+    *is_excessive = exp->IsSaturated();
+    const Action<F>* action = exp->GetActionForArguments(this, args, what, why);
+    if (action != NULL && action->IsDoDefault())
+      action = NULL;  // Normalize "do default" to NULL.
+    *untyped_action = action;
+    return exp;
+  }
+
+  // Prints the given function arguments to the ostream.
+  virtual void UntypedPrintArgs(const void* untyped_args,
+                                ::std::ostream* os) const {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    UniversalPrint(args, os);
+  }
+
+  // Returns the expectation that matches the arguments, or NULL if no
+  // expectation matches them.
+  TypedExpectation<F>* FindMatchingExpectationLocked(
+      const ArgumentTuple& args) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    for (typename UntypedExpectations::const_reverse_iterator it =
+             untyped_expectations_.rbegin();
+         it != untyped_expectations_.rend(); ++it) {
+      TypedExpectation<F>* const exp =
+          static_cast<TypedExpectation<F>*>(it->get());
+      if (exp->ShouldHandleArguments(args)) {
+        return exp;
+      }
+    }
+    return NULL;
+  }
+
+  // Returns a message that the arguments don't match any expectation.
+  void FormatUnexpectedCallMessageLocked(
+      const ArgumentTuple& args,
+      ::std::ostream* os,
+      ::std::ostream* why) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    *os << "\nUnexpected mock function call - ";
+    DescribeDefaultActionTo(args, os);
+    PrintTriedExpectationsLocked(args, why);
+  }
+
+  // Prints a list of expectations that have been tried against the
+  // current mock function call.
+  void PrintTriedExpectationsLocked(
+      const ArgumentTuple& args,
+      ::std::ostream* why) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    const int count = static_cast<int>(untyped_expectations_.size());
+    *why << "Google Mock tried the following " << count << " "
+         << (count == 1 ? "expectation, but it didn't match" :
+             "expectations, but none matched")
+         << ":\n";
+    for (int i = 0; i < count; i++) {
+      TypedExpectation<F>* const expectation =
+          static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());
+      *why << "\n";
+      expectation->DescribeLocationTo(why);
+      if (count > 1) {
+        *why << "tried expectation #" << i << ": ";
+      }
+      *why << expectation->source_text() << "...\n";
+      expectation->ExplainMatchResultTo(args, why);
+      expectation->DescribeCallCountTo(why);
+    }
+  }
+
+  // The current spec (either default action spec or expectation spec)
+  // being described on this function mocker.
+  MockSpec<F> current_spec_;
+
+  // There is no generally useful and implementable semantics of
+  // copying a mock object, so copying a mock is usually a user error.
+  // Thus we disallow copying function mockers.  If the user really
+  // wants to copy a mock object, he should implement his own copy
+  // operation, for example:
+  //
+  //   class MockFoo : public Foo {
+  //    public:
+  //     // Defines a copy constructor explicitly.
+  //     MockFoo(const MockFoo& src) {}
+  //     ...
+  //   };
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(FunctionMockerBase);
+};  // class FunctionMockerBase
+
+#ifdef _MSC_VER
+# pragma warning(pop)  // Restores the warning state.
+#endif  // _MSV_VER
+
+// Implements methods of FunctionMockerBase.
+
+// Verifies that all expectations on this mock function have been
+// satisfied.  Reports one or more Google Test non-fatal failures and
+// returns false if not.
+
+// Reports an uninteresting call (whose description is in msg) in the
+// manner specified by 'reaction'.
+void ReportUninterestingCall(CallReaction reaction, const string& msg);
+
+}  // namespace internal
+
+// The style guide prohibits "using" statements in a namespace scope
+// inside a header file.  However, the MockSpec class template is
+// meant to be defined in the ::testing namespace.  The following line
+// is just a trick for working around a bug in MSVC 8.0, which cannot
+// handle it if we define MockSpec in ::testing.
+using internal::MockSpec;
+
+// Const(x) is a convenient function for obtaining a const reference
+// to x.  This is useful for setting expectations on an overloaded
+// const mock method, e.g.
+//
+//   class MockFoo : public FooInterface {
+//    public:
+//     MOCK_METHOD0(Bar, int());
+//     MOCK_CONST_METHOD0(Bar, int&());
+//   };
+//
+//   MockFoo foo;
+//   // Expects a call to non-const MockFoo::Bar().
+//   EXPECT_CALL(foo, Bar());
+//   // Expects a call to const MockFoo::Bar().
+//   EXPECT_CALL(Const(foo), Bar());
+template <typename T>
+inline const T& Const(const T& x) { return x; }
+
+// Constructs an Expectation object that references and co-owns exp.
+inline Expectation::Expectation(internal::ExpectationBase& exp)  // NOLINT
+    : expectation_base_(exp.GetHandle().expectation_base()) {}
+
+}  // namespace testing
+
+// A separate macro is required to avoid compile errors when the name
+// of the method used in call is a result of macro expansion.
+// See CompilesWithMethodNameExpandedFromMacro tests in
+// internal/gmock-spec-builders_test.cc for more details.
+#define GMOCK_ON_CALL_IMPL_(obj, call) \
+    ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \
+                                                    #obj, #call)
+#define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call)
+
+#define GMOCK_EXPECT_CALL_IMPL_(obj, call) \
+    ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
+#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/gmock.h b/third_party/ntcore_2018/gmock/include/gmock/gmock.h
new file mode 100644
index 0000000..6735c71
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/gmock.h
@@ -0,0 +1,94 @@
+// 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.
+
+#include "gmock/gmock-actions.h"
+#include "gmock/gmock-cardinalities.h"
+#include "gmock/gmock-generated-actions.h"
+#include "gmock/gmock-generated-function-mockers.h"
+#include "gmock/gmock-generated-nice-strict.h"
+#include "gmock/gmock-generated-matchers.h"
+#include "gmock/gmock-matchers.h"
+#include "gmock/gmock-more-actions.h"
+#include "gmock/gmock-more-matchers.h"
+#include "gmock/internal/gmock-internal-utils.h"
+
+namespace testing {
+
+// Declares Google Mock flags that we want a user to use programmatically.
+GMOCK_DECLARE_bool_(catch_leaked_mocks);
+GMOCK_DECLARE_string_(verbose);
+
+// Initializes Google Mock.  This must be called before running the
+// tests.  In particular, it parses the command line for the flags
+// that Google Mock recognizes.  Whenever a Google Mock flag is seen,
+// it is removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Mock flag variables are
+// updated.
+//
+// Since Google Test is needed for Google Mock to work, this function
+// also initializes Google Test and parses its flags, if that hasn't
+// been done.
+GTEST_API_ void InitGoogleMock(int* argc, char** argv);
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv);
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h
new file mode 100644
index 0000000..7dc3b1a
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h
@@ -0,0 +1,8 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-actions.h.pump
+// DO NOT EDIT BY HAND!!!
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h.pump b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h.pump
new file mode 100644
index 0000000..d26c8a0
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h.pump
@@ -0,0 +1,10 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file (http://go/pump).  Please use Pump to convert
+$$ it to callback-actions.h.
+$$
+$var max_callback_arity = 5
+$$}} This meta comment fixes auto-indentation in editors.
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-matchers.h b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-matchers.h
new file mode 100644
index 0000000..f2efef9
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-matchers.h
@@ -0,0 +1,39 @@
+// Copyright 2015, 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.
+//
+// ============================================================
+// An installation-specific extension point for gmock-matchers.h.
+// ============================================================
+//
+// Adds google3 callback support to CallableTraits.
+//
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
+
+#endif  //  GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-port.h b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-port.h
new file mode 100644
index 0000000..9ce8bfe
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/custom/gmock-port.h
@@ -0,0 +1,46 @@
+// Copyright 2015, 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.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+//   Flag related macros:
+//     GMOCK_DECLARE_bool_(name)
+//     GMOCK_DECLARE_int32_(name)
+//     GMOCK_DECLARE_string_(name)
+//     GMOCK_DEFINE_bool_(name, default_val, doc)
+//     GMOCK_DEFINE_int32_(name, default_val, doc)
+//     GMOCK_DEFINE_string_(name, default_val, doc)
+//
+// ** Custom implementation starts here **
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h
new file mode 100644
index 0000000..7811e43
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h
@@ -0,0 +1,279 @@
+// 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_
+
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+template <typename T>
+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 <typename T>
+  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
+};
+
+// MatcherTuple<T>::type is a tuple type where each field is a Matcher
+// for the corresponding field in tuple type T.
+template <typename Tuple>
+struct MatcherTuple;
+
+template <>
+struct MatcherTuple< ::testing::tuple<> > {
+  typedef ::testing::tuple< > type;
+};
+
+template <typename A1>
+struct MatcherTuple< ::testing::tuple<A1> > {
+  typedef ::testing::tuple<Matcher<A1> > type;
+};
+
+template <typename A1, typename A2>
+struct MatcherTuple< ::testing::tuple<A1, A2> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
+};
+
+template <typename A1, typename A2, typename A3>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
+      Matcher<A4> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7, typename A8>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7, typename A8, typename A9>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7, typename A8, typename A9, typename A10>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+    A10> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
+      Matcher<A10> > type;
+};
+
+// Template struct Function<F>, 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 <typename F>
+struct Function;
+
+template <typename R>
+struct Function<R()> {
+  typedef R Result;
+  typedef ::testing::tuple<> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid();
+  typedef IgnoredValue MakeResultIgnoredValue();
+};
+
+template <typename R, typename A1>
+struct Function<R(A1)>
+    : Function<R()> {
+  typedef A1 Argument1;
+  typedef ::testing::tuple<A1> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1);
+  typedef IgnoredValue MakeResultIgnoredValue(A1);
+};
+
+template <typename R, typename A1, typename A2>
+struct Function<R(A1, A2)>
+    : Function<R(A1)> {
+  typedef A2 Argument2;
+  typedef ::testing::tuple<A1, A2> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+struct Function<R(A1, A2, A3)>
+    : Function<R(A1, A2)> {
+  typedef A3 Argument3;
+  typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+struct Function<R(A1, A2, A3, A4)>
+    : Function<R(A1, A2, A3)> {
+  typedef A4 Argument4;
+  typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+struct Function<R(A1, A2, A3, A4, A5)>
+    : Function<R(A1, A2, A3, A4)> {
+  typedef A5 Argument5;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4, A5);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+struct Function<R(A1, A2, A3, A4, A5, A6)>
+    : Function<R(A1, A2, A3, A4, A5)> {
+  typedef A6 Argument6;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
+    : Function<R(A1, A2, A3, A4, A5, A6)> {
+  typedef A7 Argument7;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
+    : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
+  typedef A8 Argument8;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
+    : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
+  typedef A9 Argument9;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9,
+    typename A10>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
+    : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+  typedef A10 Argument10;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+      A10> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::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_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump
new file mode 100644
index 0000000..800af17
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump
@@ -0,0 +1,136 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-function-mockers.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+// 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_
+
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+template <typename T>
+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 <typename T>
+  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
+};
+
+// MatcherTuple<T>::type is a tuple type where each field is a Matcher
+// for the corresponding field in tuple type T.
+template <typename Tuple>
+struct MatcherTuple;
+
+
+$range i 0..n
+$for i [[
+$range j 1..i
+$var typename_As = [[$for j, [[typename A$j]]]]
+$var As = [[$for j, [[A$j]]]]
+$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
+template <$typename_As>
+struct MatcherTuple< ::testing::tuple<$As> > {
+  typedef ::testing::tuple<$matcher_As > type;
+};
+
+
+]]
+// Template struct Function<F>, 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 <typename F>
+struct Function;
+
+template <typename R>
+struct Function<R()> {
+  typedef R Result;
+  typedef ::testing::tuple<> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid();
+  typedef IgnoredValue MakeResultIgnoredValue();
+};
+
+
+$range i 1..n
+$for i [[
+$range j 1..i
+$var typename_As = [[$for j [[, typename A$j]]]]
+$var As = [[$for j, [[A$j]]]]
+$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
+$range k 1..i-1
+$var prev_As = [[$for k, [[A$k]]]]
+template <typename R$typename_As>
+struct Function<R($As)>
+    : Function<R($prev_As)> {
+  typedef A$i Argument$i;
+  typedef ::testing::tuple<$As> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid($As);
+  typedef IgnoredValue MakeResultIgnoredValue($As);
+};
+
+
+]]
+}  // namespace internal
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-internal-utils.h b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-internal-utils.h
new file mode 100644
index 0000000..e2ddb05
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-internal-utils.h
@@ -0,0 +1,511 @@
+// 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 <stdio.h>
+#include <ostream>  // NOLINT
+#include <string>
+
+#include "gmock/internal/gmock-generated-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.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<Pointer>::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 <typename Pointer>
+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 <typename T>
+struct PointeeOf<T*> { 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 <typename Pointer>
+inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
+  return p.get();
+}
+// This overloaded version is for the raw pointer case.
+template <typename Element>
+inline Element* GetRawPointer(Element* p) { return p; }
+
+// This comparator allows linked_ptr to be stored in sets.
+template <typename T>
+struct LinkedPtrLessThan {
+  bool operator()(const ::testing::internal::linked_ptr<T>& lhs,
+                  const ::testing::internal::linked_ptr<T>& 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<T>::value is the kind of type T.
+template <typename T> 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<type> { 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<type>::value)
+
+// Evaluates to true iff integer type T is signed.
+#define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
+
+// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::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 <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
+struct LosslessArithmeticConvertibleImpl : public false_type {};
+
+// Converting bool to bool is lossless.
+template <>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
+    : public true_type {};  // NOLINT
+
+// Converting bool to any integer type is lossless.
+template <typename To>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
+    : public true_type {};  // NOLINT
+
+// Converting bool to any floating-point type is lossless.
+template <typename To>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
+    : public true_type {};  // NOLINT
+
+// Converting an integer to bool is lossy.
+template <typename From>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
+    : 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 <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
+    : 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 <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
+    : public false_type {};  // NOLINT
+
+// Converting a floating-point to bool is lossy.
+template <typename From>
+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
+    : public false_type {};  // NOLINT
+
+// Converting a floating-point to an integer is lossy.
+template <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
+    : 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 <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<
+  kFloatingPoint, From, kFloatingPoint, To>
+    : public bool_constant<sizeof(From) <= sizeof(To)> {};  // NOLINT
+
+// LosslessArithmeticConvertible<From, To>::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 <typename From, typename To>
+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<T>::value is non-zero iff T is a reference type.
+template <typename T> struct is_reference : public false_type {};
+template <typename T> struct is_reference<T&> : public true_type {};
+
+// type_equals<T1, T2>::value is non-zero iff T1 and T2 are the same type.
+template <typename T1, typename T2> struct type_equals : public false_type {};
+template <typename T> struct type_equals<T, T> : public true_type {};
+
+// remove_reference<T>::type removes the reference from type T, if any.
+template <typename T> struct remove_reference { typedef T type; };  // NOLINT
+template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT
+
+// DecayArray<T>::type turns an array type U[N] to const U* and preserves
+// other types.  Useful for saving a copy of a function argument.
+template <typename T> struct DecayArray { typedef T type; };  // NOLINT
+template <typename T, size_t N> struct DecayArray<T[N]> {
+  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 <typename T> struct DecayArray<T[]> {
+  typedef const T* type;
+};
+
+// Disable MSVC warnings for infinite recursion, since in this case the
+// the recursion is unreachable.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4717)
+#endif
+
+// Invalid<T>() is usable as an expression of type T, but will terminate
+// the program with an assertion failure if actually run.  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 <typename T>
+inline T Invalid() {
+  Assert(false, "", -1, "Internal error: attempt to return invalid value");
+  // This statement is unreachable, and would never terminate even if it
+  // could be reached. It is provided only to placate compiler warnings
+  // about missing return statements.
+  return Invalid<T>();
+}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+// 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<RawContainer> 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 RawContainer>
+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<RawContainer,
+        GTEST_REMOVE_CONST_(RawContainer)>();
+    return container;
+  }
+  static type Copy(const RawContainer& container) { return container; }
+};
+
+// This specialization is used when RawContainer is a native array type.
+template <typename Element, size_t N>
+class StlContainerView<Element[N]> {
+ public:
+  typedef GTEST_REMOVE_CONST_(Element) RawElement;
+  typedef internal::NativeArray<RawElement> type;
+  // NativeArray<T> 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<Element, RawElement>();
+#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<char *>].NativeArray(
+    //     {lval} const char *[4], long, testing::internal::RelationToSource)'
+    //     does not match
+    // 'testing::internal::NativeArray<char *>::NativeArray(
+    //     char *const *, unsigned int, testing::internal::RelationToSource)'
+    // (instantiating: 'testing::internal::ContainsMatcherImpl
+    //     <const char * (&)[4]>::Matches(const char * (&)[4]) const')
+    // (instantiating: 'testing::internal::StlContainerView<char *[4]>::
+    //     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<Element*>(&array[0]), N,
+                RelationToSourceReference());
+#else
+    return type(array, N, RelationToSourceReference());
+#endif  // GTEST_OS_SYMBIAN
+  }
+  static type Copy(const Element (&array)[N]) {
+#if GTEST_OS_SYMBIAN
+    return type(const_cast<Element*>(&array[0]), N, RelationToSourceCopy());
+#else
+    return type(array, N, RelationToSourceCopy());
+#endif  // GTEST_OS_SYMBIAN
+  }
+};
+
+// This specialization is used when RawContainer is a native array
+// represented as a (pointer, size) tuple.
+template <typename ElementPointer, typename Size>
+class StlContainerView< ::testing::tuple<ElementPointer, Size> > {
+ public:
+  typedef GTEST_REMOVE_CONST_(
+      typename internal::PointeeOf<ElementPointer>::type) RawElement;
+  typedef internal::NativeArray<RawElement> type;
+  typedef const type const_reference;
+
+  static const_reference ConstReference(
+      const ::testing::tuple<ElementPointer, Size>& array) {
+    return type(get<0>(array), get<1>(array), RelationToSourceReference());
+  }
+  static type Copy(const ::testing::tuple<ElementPointer, Size>& array) {
+    return type(get<0>(array), get<1>(array), RelationToSourceCopy());
+  }
+};
+
+// The following specialization prevents the user from instantiating
+// StlContainer with a reference type.
+template <typename T> class StlContainerView<T&>;
+
+// 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 <typename T>
+struct RemoveConstFromKey {
+  typedef T type;
+};
+
+// Partially specialized to remove constness from std::pair<const K, V>.
+template <typename K, typename V>
+struct RemoveConstFromKey<std::pair<const K, V> > {
+  typedef std::pair<K, V> type;
+};
+
+// Mapping from booleans to types. Similar to boost::bool_<kValue> and
+// std::integral_constant<bool, kValue>.
+template <bool kValue>
+struct BooleanConstant {};
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
+
diff --git a/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-port.h b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-port.h
new file mode 100644
index 0000000..63f4a68
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/include/gmock/internal/gmock-port.h
@@ -0,0 +1,91 @@
+// 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.  All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice.  Code
+// outside Google Mock MUST NOT USE THEM DIRECTLY.  Macros that don't
+// end with _ are part of Google Mock's public API and can be used by
+// code outside Google Mock.
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
+
+#include <assert.h>
+#include <stdlib.h>
+#include <iostream>
+
+// Most of the utilities needed for porting Google Mock are also
+// required for Google Test and are defined in gtest-port.h.
+//
+// Note to maintainers: to reduce code duplication, prefer adding
+// portability utilities to Google Test's gtest-port.h instead of
+// here, as Google Mock depends on Google Test.  Only add a utility
+// here if it's truly specific to Google Mock.
+#include "gtest/internal/gtest-linked_ptr.h"
+#include "gtest/internal/gtest-port.h"
+#include "gmock/internal/custom/gmock-port.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
+
+#if !defined(GMOCK_DECLARE_bool_)
+
+// 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  // !defined(GMOCK_DECLARE_bool_)
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
diff --git a/third_party/ntcore_2018/gmock/src/gmock-all.cc b/third_party/ntcore_2018/gmock/src/gmock-all.cc
new file mode 100644
index 0000000..7aebce7
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock-all.cc
@@ -0,0 +1,47 @@
+// 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: wan@google.com (Zhanyong Wan)
+//
+// Google C++ Mocking Framework (Google Mock)
+//
+// This file #includes all Google Mock implementation .cc files.  The
+// purpose is to allow a user to build Google Mock by compiling this
+// file alone.
+
+// This line ensures that gmock.h can be compiled on its own, even
+// when it's fused.
+#include "gmock/gmock.h"
+
+// The following lines pull in the real gmock *.cc files.
+#include "src/gmock-cardinalities.cc"
+#include "src/gmock-internal-utils.cc"
+#include "src/gmock-matchers.cc"
+#include "src/gmock-spec-builders.cc"
+#include "src/gmock.cc"
diff --git a/third_party/ntcore_2018/gmock/src/gmock-cardinalities.cc b/third_party/ntcore_2018/gmock/src/gmock-cardinalities.cc
new file mode 100644
index 0000000..50ec728
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock-cardinalities.cc
@@ -0,0 +1,156 @@
+// 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 cardinalities.
+
+#include "gmock/gmock-cardinalities.h"
+
+#include <limits.h>
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <string>
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+
+namespace {
+
+// Implements the Between(m, n) cardinality.
+class BetweenCardinalityImpl : public CardinalityInterface {
+ public:
+  BetweenCardinalityImpl(int min, int max)
+      : min_(min >= 0 ? min : 0),
+        max_(max >= min_ ? max : min_) {
+    std::stringstream ss;
+    if (min < 0) {
+      ss << "The invocation lower bound must be >= 0, "
+         << "but is actually " << min << ".";
+      internal::Expect(false, __FILE__, __LINE__, ss.str());
+    } else if (max < 0) {
+      ss << "The invocation upper bound must be >= 0, "
+         << "but is actually " << max << ".";
+      internal::Expect(false, __FILE__, __LINE__, ss.str());
+    } else if (min > max) {
+      ss << "The invocation upper bound (" << max
+         << ") must be >= the invocation lower bound (" << min
+         << ").";
+      internal::Expect(false, __FILE__, __LINE__, ss.str());
+    }
+  }
+
+  // Conservative estimate on the lower/upper bound of the number of
+  // calls allowed.
+  virtual int ConservativeLowerBound() const { return min_; }
+  virtual int ConservativeUpperBound() const { return max_; }
+
+  virtual bool IsSatisfiedByCallCount(int call_count) const {
+    return min_ <= call_count && call_count <= max_;
+  }
+
+  virtual bool IsSaturatedByCallCount(int call_count) const {
+    return call_count >= max_;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const;
+
+ private:
+  const int min_;
+  const int max_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(BetweenCardinalityImpl);
+};
+
+// Formats "n times" in a human-friendly way.
+inline internal::string FormatTimes(int n) {
+  if (n == 1) {
+    return "once";
+  } else if (n == 2) {
+    return "twice";
+  } else {
+    std::stringstream ss;
+    ss << n << " times";
+    return ss.str();
+  }
+}
+
+// Describes the Between(m, n) cardinality in human-friendly text.
+void BetweenCardinalityImpl::DescribeTo(::std::ostream* os) const {
+  if (min_ == 0) {
+    if (max_ == 0) {
+      *os << "never called";
+    } else if (max_ == INT_MAX) {
+      *os << "called any number of times";
+    } else {
+      *os << "called at most " << FormatTimes(max_);
+    }
+  } else if (min_ == max_) {
+    *os << "called " << FormatTimes(min_);
+  } else if (max_ == INT_MAX) {
+    *os << "called at least " << FormatTimes(min_);
+  } else {
+    // 0 < min_ < max_ < INT_MAX
+    *os << "called between " << min_ << " and " << max_ << " times";
+  }
+}
+
+}  // Unnamed namespace
+
+// Describes the given call count to an ostream.
+void Cardinality::DescribeActualCallCountTo(int actual_call_count,
+                                            ::std::ostream* os) {
+  if (actual_call_count > 0) {
+    *os << "called " << FormatTimes(actual_call_count);
+  } else {
+    *os << "never called";
+  }
+}
+
+// Creates a cardinality that allows at least n calls.
+GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
+
+// Creates a cardinality that allows at most n calls.
+GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); }
+
+// Creates a cardinality that allows any number of calls.
+GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); }
+
+// Creates a cardinality that allows between min and max calls.
+GTEST_API_ Cardinality Between(int min, int max) {
+  return Cardinality(new BetweenCardinalityImpl(min, max));
+}
+
+// Creates a cardinality that allows exactly n calls.
+GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); }
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/src/gmock-internal-utils.cc b/third_party/ntcore_2018/gmock/src/gmock-internal-utils.cc
new file mode 100644
index 0000000..fb53080
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock-internal-utils.cc
@@ -0,0 +1,174 @@
+// 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.
+
+#include "gmock/internal/gmock-internal-utils.h"
+
+#include <ctype.h>
+#include <ostream>  // NOLINT
+#include <string>
+#include "gmock/gmock.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.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) {
+  string result;
+  char prev_char = '\0';
+  for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
+    // We don't care about the current locale as the input is
+    // guaranteed to be a valid C++ identifier name.
+    const bool starts_new_word = IsUpper(*p) ||
+        (!IsAlpha(prev_char) && IsLower(*p)) ||
+        (!IsDigit(prev_char) && IsDigit(*p));
+
+    if (IsAlNum(*p)) {
+      if (starts_new_word && result != "")
+        result += ' ';
+      result += ToLower(*p);
+    }
+  }
+  return result;
+}
+
+// This class reports Google Mock failures as Google Test failures.  A
+// user can define another class in a similar fashion if he intends to
+// use Google Mock with a testing framework other than Google Test.
+class GoogleTestFailureReporter : public FailureReporterInterface {
+ public:
+  virtual void ReportFailure(FailureType type, const char* file, int line,
+                             const string& message) {
+    AssertHelper(type == kFatal ?
+                 TestPartResult::kFatalFailure :
+                 TestPartResult::kNonFatalFailure,
+                 file,
+                 line,
+                 message.c_str()) = Message();
+    if (type == kFatal) {
+      posix::Abort();
+    }
+  }
+};
+
+// Returns the global failure reporter.  Will create a
+// GoogleTestFailureReporter and return it the first time called.
+GTEST_API_ FailureReporterInterface* GetFailureReporter() {
+  // Points to the global failure reporter used by Google Mock.  gcc
+  // guarantees that the following use of failure_reporter is
+  // thread-safe.  We may need to add additional synchronization to
+  // protect failure_reporter if we port Google Mock to other
+  // compilers.
+  static FailureReporterInterface* const failure_reporter =
+      new GoogleTestFailureReporter();
+  return failure_reporter;
+}
+
+// Protects global resources (stdout in particular) used by Log().
+static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex);
+
+// Returns true iff a log with the given severity is visible according
+// to the --gmock_verbose flag.
+GTEST_API_ bool LogIsVisible(LogSeverity severity) {
+  if (GMOCK_FLAG(verbose) == kInfoVerbosity) {
+    // Always show the log if --gmock_verbose=info.
+    return true;
+  } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) {
+    // Always hide it if --gmock_verbose=error.
+    return false;
+  } else {
+    // If --gmock_verbose is neither "info" nor "error", we treat it
+    // as "warning" (its default value).
+    return severity == kWarning;
+  }
+}
+
+// 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) {
+  if (!LogIsVisible(severity))
+    return;
+
+  // Ensures that logs from different threads don't interleave.
+  MutexLock l(&g_log_mutex);
+
+  // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a
+  // macro.
+
+  if (severity == kWarning) {
+    // Prints a GMOCK WARNING marker to make the warnings easily searchable.
+    std::cout << "\nGMOCK WARNING:";
+  }
+  // Pre-pends a new-line to message if it doesn't start with one.
+  if (message.empty() || message[0] != '\n') {
+    std::cout << "\n";
+  }
+  std::cout << message;
+  if (stack_frames_to_skip >= 0) {
+#ifdef NDEBUG
+    // In opt mode, we have to be conservative and skip no stack frame.
+    const int actual_to_skip = 0;
+#else
+    // In dbg mode, we can do what the caller tell us to do (plus one
+    // for skipping this function's stack frame).
+    const int actual_to_skip = stack_frames_to_skip + 1;
+#endif  // NDEBUG
+
+    // Appends a new-line to message if it doesn't end with one.
+    if (!message.empty() && *message.rbegin() != '\n') {
+      std::cout << "\n";
+    }
+    std::cout << "Stack trace:\n"
+         << ::testing::internal::GetCurrentOsStackTraceExceptTop(
+             ::testing::UnitTest::GetInstance(), actual_to_skip);
+  }
+  std::cout << ::std::flush;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/src/gmock-matchers.cc b/third_party/ntcore_2018/gmock/src/gmock-matchers.cc
new file mode 100644
index 0000000..e742451
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock-matchers.cc
@@ -0,0 +1,498 @@
+// 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 Matcher<const string&>, Matcher<string>, and
+// utilities for defining matchers.
+
+#include "gmock/gmock-matchers.h"
+#include "gmock/gmock-generated-matchers.h"
+
+#include <string.h>
+#include <sstream>
+#include <string>
+
+namespace testing {
+
+// Constructs a matcher that matches a const string& whose value is
+// equal to s.
+Matcher<const internal::string&>::Matcher(const internal::string& s) {
+  *this = Eq(s);
+}
+
+// Constructs a matcher that matches a const string& whose value is
+// equal to s.
+Matcher<const internal::string&>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a string whose value is equal to s.
+Matcher<internal::string>::Matcher(const internal::string& s) { *this = Eq(s); }
+
+// Constructs a matcher that matches a string whose value is equal to s.
+Matcher<internal::string>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+#if GTEST_HAS_STRING_PIECE_
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(const internal::string& s) {
+  *this = Eq(s);
+}
+
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(StringPiece s) {
+  *this = Eq(s.ToString());
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(const internal::string& s) {
+  *this = Eq(s);
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(StringPiece s) {
+  *this = Eq(s.ToString());
+}
+#endif  // GTEST_HAS_STRING_PIECE_
+
+namespace internal {
+
+// Joins a vector of strings as if they are fields of a tuple; returns
+// the joined string.
+GTEST_API_ string JoinAsTuple(const Strings& fields) {
+  switch (fields.size()) {
+    case 0:
+      return "";
+    case 1:
+      return fields[0];
+    default:
+      string result = "(" + fields[0];
+      for (size_t i = 1; i < fields.size(); i++) {
+        result += ", ";
+        result += fields[i];
+      }
+      result += ")";
+      return result;
+  }
+}
+
+// Returns the description for a matcher defined using the MATCHER*()
+// macro where the user-supplied description string is "", if
+// 'negation' is false; otherwise returns the description of the
+// negation of the matcher.  'param_values' contains a list of strings
+// that are the print-out of the matcher's parameters.
+GTEST_API_ string FormatMatcherDescription(bool negation,
+                                           const char* matcher_name,
+                                           const Strings& param_values) {
+  string result = ConvertIdentifierNameToWords(matcher_name);
+  if (param_values.size() >= 1)
+    result += " " + JoinAsTuple(param_values);
+  return negation ? "not (" + result + ")" : result;
+}
+
+// FindMaxBipartiteMatching and its helper class.
+//
+// Uses the well-known Ford-Fulkerson max flow method to find a maximum
+// bipartite matching. Flow is considered to be from left to right.
+// There is an implicit source node that is connected to all of the left
+// nodes, and an implicit sink node that is connected to all of the
+// right nodes. All edges have unit capacity.
+//
+// Neither the flow graph nor the residual flow graph are represented
+// explicitly. Instead, they are implied by the information in 'graph' and
+// a vector<int> called 'left_' whose elements are initialized to the
+// value kUnused. This represents the initial state of the algorithm,
+// where the flow graph is empty, and the residual flow graph has the
+// following edges:
+//   - An edge from source to each left_ node
+//   - An edge from each right_ node to sink
+//   - An edge from each left_ node to each right_ node, if the
+//     corresponding edge exists in 'graph'.
+//
+// When the TryAugment() method adds a flow, it sets left_[l] = r for some
+// nodes l and r. This induces the following changes:
+//   - The edges (source, l), (l, r), and (r, sink) are added to the
+//     flow graph.
+//   - The same three edges are removed from the residual flow graph.
+//   - The reverse edges (l, source), (r, l), and (sink, r) are added
+//     to the residual flow graph, which is a directional graph
+//     representing unused flow capacity.
+//
+// When the method augments a flow (moving left_[l] from some r1 to some
+// other r2), this can be thought of as "undoing" the above steps with
+// respect to r1 and "redoing" them with respect to r2.
+//
+// It bears repeating that the flow graph and residual flow graph are
+// never represented explicitly, but can be derived by looking at the
+// information in 'graph' and in left_.
+//
+// As an optimization, there is a second vector<int> called right_ which
+// does not provide any new information. Instead, it enables more
+// efficient queries about edges entering or leaving the right-side nodes
+// of the flow or residual flow graphs. The following invariants are
+// maintained:
+//
+// left[l] == kUnused or right[left[l]] == l
+// right[r] == kUnused or left[right[r]] == r
+//
+// . [ source ]                                        .
+// .   |||                                             .
+// .   |||                                             .
+// .   ||\--> left[0]=1  ---\    right[0]=-1 ----\     .
+// .   ||                   |                    |     .
+// .   |\---> left[1]=-1    \--> right[1]=0  ---\|     .
+// .   |                                        ||     .
+// .   \----> left[2]=2  ------> right[2]=2  --\||     .
+// .                                           |||     .
+// .         elements           matchers       vvv     .
+// .                                         [ sink ]  .
+//
+// See Also:
+//   [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
+//       "Introduction to Algorithms (Second ed.)", pp. 651-664.
+//   [2] "Ford-Fulkerson algorithm", Wikipedia,
+//       'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
+class MaxBipartiteMatchState {
+ public:
+  explicit MaxBipartiteMatchState(const MatchMatrix& graph)
+      : graph_(&graph),
+        left_(graph_->LhsSize(), kUnused),
+        right_(graph_->RhsSize(), kUnused) {
+  }
+
+  // Returns the edges of a maximal match, each in the form {left, right}.
+  ElementMatcherPairs Compute() {
+    // 'seen' is used for path finding { 0: unseen, 1: seen }.
+    ::std::vector<char> seen;
+    // Searches the residual flow graph for a path from each left node to
+    // the sink in the residual flow graph, and if one is found, add flow
+    // to the graph. It's okay to search through the left nodes once. The
+    // edge from the implicit source node to each previously-visited left
+    // node will have flow if that left node has any path to the sink
+    // whatsoever. Subsequent augmentations can only add flow to the
+    // network, and cannot take away that previous flow unit from the source.
+    // Since the source-to-left edge can only carry one flow unit (or,
+    // each element can be matched to only one matcher), there is no need
+    // to visit the left nodes more than once looking for augmented paths.
+    // The flow is known to be possible or impossible by looking at the
+    // node once.
+    for (size_t ilhs = 0; ilhs < graph_->LhsSize(); ++ilhs) {
+      // Reset the path-marking vector and try to find a path from
+      // source to sink starting at the left_[ilhs] node.
+      GTEST_CHECK_(left_[ilhs] == kUnused)
+          << "ilhs: " << ilhs << ", left_[ilhs]: " << left_[ilhs];
+      // 'seen' initialized to 'graph_->RhsSize()' copies of 0.
+      seen.assign(graph_->RhsSize(), 0);
+      TryAugment(ilhs, &seen);
+    }
+    ElementMatcherPairs result;
+    for (size_t ilhs = 0; ilhs < left_.size(); ++ilhs) {
+      size_t irhs = left_[ilhs];
+      if (irhs == kUnused) continue;
+      result.push_back(ElementMatcherPair(ilhs, irhs));
+    }
+    return result;
+  }
+
+ private:
+  static const size_t kUnused = static_cast<size_t>(-1);
+
+  // Perform a depth-first search from left node ilhs to the sink.  If a
+  // path is found, flow is added to the network by linking the left and
+  // right vector elements corresponding each segment of the path.
+  // Returns true if a path to sink was found, which means that a unit of
+  // flow was added to the network. The 'seen' vector elements correspond
+  // to right nodes and are marked to eliminate cycles from the search.
+  //
+  // Left nodes will only be explored at most once because they
+  // are accessible from at most one right node in the residual flow
+  // graph.
+  //
+  // Note that left_[ilhs] is the only element of left_ that TryAugment will
+  // potentially transition from kUnused to another value. Any other
+  // left_ element holding kUnused before TryAugment will be holding it
+  // when TryAugment returns.
+  //
+  bool TryAugment(size_t ilhs, ::std::vector<char>* seen) {
+    for (size_t irhs = 0; irhs < graph_->RhsSize(); ++irhs) {
+      if ((*seen)[irhs])
+        continue;
+      if (!graph_->HasEdge(ilhs, irhs))
+        continue;
+      // There's an available edge from ilhs to irhs.
+      (*seen)[irhs] = 1;
+      // Next a search is performed to determine whether
+      // this edge is a dead end or leads to the sink.
+      //
+      // right_[irhs] == kUnused means that there is residual flow from
+      // right node irhs to the sink, so we can use that to finish this
+      // flow path and return success.
+      //
+      // Otherwise there is residual flow to some ilhs. We push flow
+      // along that path and call ourselves recursively to see if this
+      // ultimately leads to sink.
+      if (right_[irhs] == kUnused || TryAugment(right_[irhs], seen)) {
+        // Add flow from left_[ilhs] to right_[irhs].
+        left_[ilhs] = irhs;
+        right_[irhs] = ilhs;
+        return true;
+      }
+    }
+    return false;
+  }
+
+  const MatchMatrix* graph_;  // not owned
+  // Each element of the left_ vector represents a left hand side node
+  // (i.e. an element) and each element of right_ is a right hand side
+  // node (i.e. a matcher). The values in the left_ vector indicate
+  // outflow from that node to a node on the the right_ side. The values
+  // in the right_ indicate inflow, and specify which left_ node is
+  // feeding that right_ node, if any. For example, left_[3] == 1 means
+  // there's a flow from element #3 to matcher #1. Such a flow would also
+  // be redundantly represented in the right_ vector as right_[1] == 3.
+  // Elements of left_ and right_ are either kUnused or mutually
+  // referent. Mutually referent means that left_[right_[i]] = i and
+  // right_[left_[i]] = i.
+  ::std::vector<size_t> left_;
+  ::std::vector<size_t> right_;
+
+  GTEST_DISALLOW_ASSIGN_(MaxBipartiteMatchState);
+};
+
+const size_t MaxBipartiteMatchState::kUnused;
+
+GTEST_API_ ElementMatcherPairs
+FindMaxBipartiteMatching(const MatchMatrix& g) {
+  return MaxBipartiteMatchState(g).Compute();
+}
+
+static void LogElementMatcherPairVec(const ElementMatcherPairs& pairs,
+                                     ::std::ostream* stream) {
+  typedef ElementMatcherPairs::const_iterator Iter;
+  ::std::ostream& os = *stream;
+  os << "{";
+  const char *sep = "";
+  for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
+    os << sep << "\n  ("
+       << "element #" << it->first << ", "
+       << "matcher #" << it->second << ")";
+    sep = ",";
+  }
+  os << "\n}";
+}
+
+// Tries to find a pairing, and explains the result.
+GTEST_API_ bool FindPairing(const MatchMatrix& matrix,
+                            MatchResultListener* listener) {
+  ElementMatcherPairs matches = FindMaxBipartiteMatching(matrix);
+
+  size_t max_flow = matches.size();
+  bool result = (max_flow == matrix.RhsSize());
+
+  if (!result) {
+    if (listener->IsInterested()) {
+      *listener << "where no permutation of the elements can "
+                   "satisfy all matchers, and the closest match is "
+                << max_flow << " of " << matrix.RhsSize()
+                << " matchers with the pairings:\n";
+      LogElementMatcherPairVec(matches, listener->stream());
+    }
+    return false;
+  }
+
+  if (matches.size() > 1) {
+    if (listener->IsInterested()) {
+      const char *sep = "where:\n";
+      for (size_t mi = 0; mi < matches.size(); ++mi) {
+        *listener << sep << " - element #" << matches[mi].first
+                  << " is matched by matcher #" << matches[mi].second;
+        sep = ",\n";
+      }
+    }
+  }
+  return true;
+}
+
+bool MatchMatrix::NextGraph() {
+  for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
+    for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
+      char& b = matched_[SpaceIndex(ilhs, irhs)];
+      if (!b) {
+        b = 1;
+        return true;
+      }
+      b = 0;
+    }
+  }
+  return false;
+}
+
+void MatchMatrix::Randomize() {
+  for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
+    for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
+      char& b = matched_[SpaceIndex(ilhs, irhs)];
+      b = static_cast<char>(rand() & 1);  // NOLINT
+    }
+  }
+}
+
+string MatchMatrix::DebugString() const {
+  ::std::stringstream ss;
+  const char *sep = "";
+  for (size_t i = 0; i < LhsSize(); ++i) {
+    ss << sep;
+    for (size_t j = 0; j < RhsSize(); ++j) {
+      ss << HasEdge(i, j);
+    }
+    sep = ";";
+  }
+  return ss.str();
+}
+
+void UnorderedElementsAreMatcherImplBase::DescribeToImpl(
+    ::std::ostream* os) const {
+  if (matcher_describers_.empty()) {
+    *os << "is empty";
+    return;
+  }
+  if (matcher_describers_.size() == 1) {
+    *os << "has " << Elements(1) << " and that element ";
+    matcher_describers_[0]->DescribeTo(os);
+    return;
+  }
+  *os << "has " << Elements(matcher_describers_.size())
+      << " and there exists some permutation of elements such that:\n";
+  const char* sep = "";
+  for (size_t i = 0; i != matcher_describers_.size(); ++i) {
+    *os << sep << " - element #" << i << " ";
+    matcher_describers_[i]->DescribeTo(os);
+    sep = ", and\n";
+  }
+}
+
+void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(
+    ::std::ostream* os) const {
+  if (matcher_describers_.empty()) {
+    *os << "isn't empty";
+    return;
+  }
+  if (matcher_describers_.size() == 1) {
+    *os << "doesn't have " << Elements(1)
+        << ", or has " << Elements(1) << " that ";
+    matcher_describers_[0]->DescribeNegationTo(os);
+    return;
+  }
+  *os << "doesn't have " << Elements(matcher_describers_.size())
+      << ", or there exists no permutation of elements such that:\n";
+  const char* sep = "";
+  for (size_t i = 0; i != matcher_describers_.size(); ++i) {
+    *os << sep << " - element #" << i << " ";
+    matcher_describers_[i]->DescribeTo(os);
+    sep = ", and\n";
+  }
+}
+
+// Checks that all matchers match at least one element, and that all
+// elements match at least one matcher. This enables faster matching
+// and better error reporting.
+// Returns false, writing an explanation to 'listener', if and only
+// if the success criteria are not met.
+bool UnorderedElementsAreMatcherImplBase::
+VerifyAllElementsAndMatchersAreMatched(
+    const ::std::vector<string>& element_printouts,
+    const MatchMatrix& matrix,
+    MatchResultListener* listener) const {
+  bool result = true;
+  ::std::vector<char> element_matched(matrix.LhsSize(), 0);
+  ::std::vector<char> matcher_matched(matrix.RhsSize(), 0);
+
+  for (size_t ilhs = 0; ilhs < matrix.LhsSize(); ilhs++) {
+    for (size_t irhs = 0; irhs < matrix.RhsSize(); irhs++) {
+      char matched = matrix.HasEdge(ilhs, irhs);
+      element_matched[ilhs] |= matched;
+      matcher_matched[irhs] |= matched;
+    }
+  }
+
+  {
+    const char* sep =
+        "where the following matchers don't match any elements:\n";
+    for (size_t mi = 0; mi < matcher_matched.size(); ++mi) {
+      if (matcher_matched[mi])
+        continue;
+      result = false;
+      if (listener->IsInterested()) {
+        *listener << sep << "matcher #" << mi << ": ";
+        matcher_describers_[mi]->DescribeTo(listener->stream());
+        sep = ",\n";
+      }
+    }
+  }
+
+  {
+    const char* sep =
+        "where the following elements don't match any matchers:\n";
+    const char* outer_sep = "";
+    if (!result) {
+      outer_sep = "\nand ";
+    }
+    for (size_t ei = 0; ei < element_matched.size(); ++ei) {
+      if (element_matched[ei])
+        continue;
+      result = false;
+      if (listener->IsInterested()) {
+        *listener << outer_sep << sep << "element #" << ei << ": "
+                  << element_printouts[ei];
+        sep = ",\n";
+        outer_sep = "";
+      }
+    }
+  }
+  return result;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/src/gmock-spec-builders.cc b/third_party/ntcore_2018/gmock/src/gmock-spec-builders.cc
new file mode 100644
index 0000000..9551342
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock-spec-builders.cc
@@ -0,0 +1,823 @@
+// 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 the spec builder syntax (ON_CALL and
+// EXPECT_CALL).
+
+#include "gmock/gmock-spec-builders.h"
+
+#include <stdlib.h>
+#include <iostream>  // NOLINT
+#include <map>
+#include <set>
+#include <string>
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
+# include <unistd.h>  // NOLINT
+#endif
+
+namespace testing {
+namespace internal {
+
+// Protects the mock object registry (in class Mock), all function
+// mockers, and all expectations.
+GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex);
+
+// Logs a message including file and line number information.
+GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
+                                const char* file, int line,
+                                const string& message) {
+  ::std::ostringstream s;
+  s << file << ":" << line << ": " << message << ::std::endl;
+  Log(severity, s.str(), 0);
+}
+
+// Constructs an ExpectationBase object.
+ExpectationBase::ExpectationBase(const char* a_file,
+                                 int a_line,
+                                 const string& a_source_text)
+    : file_(a_file),
+      line_(a_line),
+      source_text_(a_source_text),
+      cardinality_specified_(false),
+      cardinality_(Exactly(1)),
+      call_count_(0),
+      retired_(false),
+      extra_matcher_specified_(false),
+      repeated_action_specified_(false),
+      retires_on_saturation_(false),
+      last_clause_(kNone),
+      action_count_checked_(false) {}
+
+// Destructs an ExpectationBase object.
+ExpectationBase::~ExpectationBase() {}
+
+// Explicitly specifies the cardinality of this expectation.  Used by
+// the subclasses to implement the .Times() clause.
+void ExpectationBase::SpecifyCardinality(const Cardinality& a_cardinality) {
+  cardinality_specified_ = true;
+  cardinality_ = a_cardinality;
+}
+
+// Retires all pre-requisites of this expectation.
+void ExpectationBase::RetireAllPreRequisites()
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  if (is_retired()) {
+    // We can take this short-cut as we never retire an expectation
+    // until we have retired all its pre-requisites.
+    return;
+  }
+
+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
+       it != immediate_prerequisites_.end(); ++it) {
+    ExpectationBase* const prerequisite = it->expectation_base().get();
+    if (!prerequisite->is_retired()) {
+      prerequisite->RetireAllPreRequisites();
+      prerequisite->Retire();
+    }
+  }
+}
+
+// Returns true iff all pre-requisites of this expectation have been
+// satisfied.
+bool ExpectationBase::AllPrerequisitesAreSatisfied() const
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
+       it != immediate_prerequisites_.end(); ++it) {
+    if (!(it->expectation_base()->IsSatisfied()) ||
+        !(it->expectation_base()->AllPrerequisitesAreSatisfied()))
+      return false;
+  }
+  return true;
+}
+
+// Adds unsatisfied pre-requisites of this expectation to 'result'.
+void ExpectationBase::FindUnsatisfiedPrerequisites(ExpectationSet* result) const
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
+       it != immediate_prerequisites_.end(); ++it) {
+    if (it->expectation_base()->IsSatisfied()) {
+      // If *it is satisfied and has a call count of 0, some of its
+      // pre-requisites may not be satisfied yet.
+      if (it->expectation_base()->call_count_ == 0) {
+        it->expectation_base()->FindUnsatisfiedPrerequisites(result);
+      }
+    } else {
+      // Now that we know *it is unsatisfied, we are not so interested
+      // in whether its pre-requisites are satisfied.  Therefore we
+      // don't recursively call FindUnsatisfiedPrerequisites() here.
+      *result += *it;
+    }
+  }
+}
+
+// Describes how many times a function call matching this
+// expectation has occurred.
+void ExpectationBase::DescribeCallCountTo(::std::ostream* os) const
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+
+  // Describes how many times the function is expected to be called.
+  *os << "         Expected: to be ";
+  cardinality().DescribeTo(os);
+  *os << "\n           Actual: ";
+  Cardinality::DescribeActualCallCountTo(call_count(), os);
+
+  // Describes the state of the expectation (e.g. is it satisfied?
+  // is it active?).
+  *os << " - " << (IsOverSaturated() ? "over-saturated" :
+                   IsSaturated() ? "saturated" :
+                   IsSatisfied() ? "satisfied" : "unsatisfied")
+      << " and "
+      << (is_retired() ? "retired" : "active");
+}
+
+// Checks the action count (i.e. the number of WillOnce() and
+// WillRepeatedly() clauses) against the cardinality if this hasn't
+// been done before.  Prints a warning if there are too many or too
+// few actions.
+void ExpectationBase::CheckActionCountIfNotDone() const
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  bool should_check = false;
+  {
+    MutexLock l(&mutex_);
+    if (!action_count_checked_) {
+      action_count_checked_ = true;
+      should_check = true;
+    }
+  }
+
+  if (should_check) {
+    if (!cardinality_specified_) {
+      // The cardinality was inferred - no need to check the action
+      // count against it.
+      return;
+    }
+
+    // The cardinality was explicitly specified.
+    const int action_count = static_cast<int>(untyped_actions_.size());
+    const int upper_bound = cardinality().ConservativeUpperBound();
+    const int lower_bound = cardinality().ConservativeLowerBound();
+    bool too_many;  // True if there are too many actions, or false
+    // if there are too few.
+    if (action_count > upper_bound ||
+        (action_count == upper_bound && repeated_action_specified_)) {
+      too_many = true;
+    } else if (0 < action_count && action_count < lower_bound &&
+               !repeated_action_specified_) {
+      too_many = false;
+    } else {
+      return;
+    }
+
+    ::std::stringstream ss;
+    DescribeLocationTo(&ss);
+    ss << "Too " << (too_many ? "many" : "few")
+       << " actions specified in " << source_text() << "...\n"
+       << "Expected to be ";
+    cardinality().DescribeTo(&ss);
+    ss << ", but has " << (too_many ? "" : "only ")
+       << action_count << " WillOnce()"
+       << (action_count == 1 ? "" : "s");
+    if (repeated_action_specified_) {
+      ss << " and a WillRepeatedly()";
+    }
+    ss << ".";
+    Log(kWarning, ss.str(), -1);  // -1 means "don't print stack trace".
+  }
+}
+
+// Implements the .Times() clause.
+void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
+  if (last_clause_ == kTimes) {
+    ExpectSpecProperty(false,
+                       ".Times() cannot appear "
+                       "more than once in an EXPECT_CALL().");
+  } else {
+    ExpectSpecProperty(last_clause_ < kTimes,
+                       ".Times() cannot appear after "
+                       ".InSequence(), .WillOnce(), .WillRepeatedly(), "
+                       "or .RetiresOnSaturation().");
+  }
+  last_clause_ = kTimes;
+
+  SpecifyCardinality(a_cardinality);
+}
+
+// Points to the implicit sequence introduced by a living InSequence
+// object (if any) in the current thread or NULL.
+GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
+
+// Reports an uninteresting call (whose description is in msg) in the
+// manner specified by 'reaction'.
+void ReportUninterestingCall(CallReaction reaction, const string& msg) {
+  // Include a stack trace only if --gmock_verbose=info is specified.
+  const int stack_frames_to_skip =
+      GMOCK_FLAG(verbose) == kInfoVerbosity ? 3 : -1;
+  switch (reaction) {
+    case kAllow:
+      Log(kInfo, msg, stack_frames_to_skip);
+      break;
+    case kWarn:
+      Log(kWarning,
+          msg +
+          "\nNOTE: You can safely ignore the above warning unless this "
+          "call should not happen.  Do not suppress it by blindly adding "
+          "an EXPECT_CALL() if you don't mean to enforce the call.  "
+          "See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#"
+          "knowing-when-to-expect for details.\n",
+          stack_frames_to_skip);
+      break;
+    default:  // FAIL
+      Expect(false, NULL, -1, msg);
+  }
+}
+
+UntypedFunctionMockerBase::UntypedFunctionMockerBase()
+    : mock_obj_(NULL), name_("") {}
+
+UntypedFunctionMockerBase::~UntypedFunctionMockerBase() {}
+
+// Sets the mock object this mock method belongs to, and registers
+// this information in the global mock registry.  Will be called
+// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
+// method.
+void UntypedFunctionMockerBase::RegisterOwner(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  {
+    MutexLock l(&g_gmock_mutex);
+    mock_obj_ = mock_obj;
+  }
+  Mock::Register(mock_obj, this);
+}
+
+// Sets the mock object this mock method belongs to, and sets the name
+// of the mock function.  Will be called upon each invocation of this
+// mock function.
+void UntypedFunctionMockerBase::SetOwnerAndName(const void* mock_obj,
+                                                const char* name)
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  // We protect name_ under g_gmock_mutex in case this mock function
+  // is called from two threads concurrently.
+  MutexLock l(&g_gmock_mutex);
+  mock_obj_ = mock_obj;
+  name_ = name;
+}
+
+// Returns the name of the function being mocked.  Must be called
+// after RegisterOwner() or SetOwnerAndName() has been called.
+const void* UntypedFunctionMockerBase::MockObject() const
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  const void* mock_obj;
+  {
+    // We protect mock_obj_ under g_gmock_mutex in case this mock
+    // function is called from two threads concurrently.
+    MutexLock l(&g_gmock_mutex);
+    Assert(mock_obj_ != NULL, __FILE__, __LINE__,
+           "MockObject() must not be called before RegisterOwner() or "
+           "SetOwnerAndName() has been called.");
+    mock_obj = mock_obj_;
+  }
+  return mock_obj;
+}
+
+// Returns the name of this mock method.  Must be called after
+// SetOwnerAndName() has been called.
+const char* UntypedFunctionMockerBase::Name() const
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  const char* name;
+  {
+    // We protect name_ under g_gmock_mutex in case this mock
+    // function is called from two threads concurrently.
+    MutexLock l(&g_gmock_mutex);
+    Assert(name_ != NULL, __FILE__, __LINE__,
+           "Name() must not be called before SetOwnerAndName() has "
+           "been called.");
+    name = name_;
+  }
+  return name;
+}
+
+// Calculates the result of invoking this mock function with the given
+// arguments, prints it, and returns it.  The caller is responsible
+// for deleting the result.
+UntypedActionResultHolderBase*
+UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  if (untyped_expectations_.size() == 0) {
+    // No expectation is set on this mock method - we have an
+    // uninteresting call.
+
+    // We must get Google Mock's reaction on uninteresting calls
+    // made on this mock object BEFORE performing the action,
+    // because the action may DELETE the mock object and make the
+    // following expression meaningless.
+    const CallReaction reaction =
+        Mock::GetReactionOnUninterestingCalls(MockObject());
+
+    // True iff we need to print this call's arguments and return
+    // value.  This definition must be kept in sync with
+    // the behavior of ReportUninterestingCall().
+    const bool need_to_report_uninteresting_call =
+        // If the user allows this uninteresting call, we print it
+        // only when he wants informational messages.
+        reaction == kAllow ? LogIsVisible(kInfo) :
+        // If the user wants this to be a warning, we print it only
+        // when he wants to see warnings.
+        reaction == kWarn ? LogIsVisible(kWarning) :
+        // Otherwise, the user wants this to be an error, and we
+        // should always print detailed information in the error.
+        true;
+
+    if (!need_to_report_uninteresting_call) {
+      // Perform the action without printing the call information.
+      return this->UntypedPerformDefaultAction(untyped_args, "");
+    }
+
+    // Warns about the uninteresting call.
+    ::std::stringstream ss;
+    this->UntypedDescribeUninterestingCall(untyped_args, &ss);
+
+    // Calculates the function result.
+    UntypedActionResultHolderBase* const result =
+        this->UntypedPerformDefaultAction(untyped_args, ss.str());
+
+    // Prints the function result.
+    if (result != NULL)
+      result->PrintAsActionResult(&ss);
+
+    ReportUninterestingCall(reaction, ss.str());
+    return result;
+  }
+
+  bool is_excessive = false;
+  ::std::stringstream ss;
+  ::std::stringstream why;
+  ::std::stringstream loc;
+  const void* untyped_action = NULL;
+
+  // The UntypedFindMatchingExpectation() function acquires and
+  // releases g_gmock_mutex.
+  const ExpectationBase* const untyped_expectation =
+      this->UntypedFindMatchingExpectation(
+          untyped_args, &untyped_action, &is_excessive,
+          &ss, &why);
+  const bool found = untyped_expectation != NULL;
+
+  // True iff we need to print the call's arguments and return value.
+  // This definition must be kept in sync with the uses of Expect()
+  // and Log() in this function.
+  const bool need_to_report_call =
+      !found || is_excessive || LogIsVisible(kInfo);
+  if (!need_to_report_call) {
+    // Perform the action without printing the call information.
+    return
+        untyped_action == NULL ?
+        this->UntypedPerformDefaultAction(untyped_args, "") :
+        this->UntypedPerformAction(untyped_action, untyped_args);
+  }
+
+  ss << "    Function call: " << Name();
+  this->UntypedPrintArgs(untyped_args, &ss);
+
+  // In case the action deletes a piece of the expectation, we
+  // generate the message beforehand.
+  if (found && !is_excessive) {
+    untyped_expectation->DescribeLocationTo(&loc);
+  }
+
+  UntypedActionResultHolderBase* const result =
+      untyped_action == NULL ?
+      this->UntypedPerformDefaultAction(untyped_args, ss.str()) :
+      this->UntypedPerformAction(untyped_action, untyped_args);
+  if (result != NULL)
+    result->PrintAsActionResult(&ss);
+  ss << "\n" << why.str();
+
+  if (!found) {
+    // No expectation matches this call - reports a failure.
+    Expect(false, NULL, -1, ss.str());
+  } else if (is_excessive) {
+    // We had an upper-bound violation and the failure message is in ss.
+    Expect(false, untyped_expectation->file(),
+           untyped_expectation->line(), ss.str());
+  } else {
+    // We had an expected call and the matching expectation is
+    // described in ss.
+    Log(kInfo, loc.str() + ss.str(), 2);
+  }
+
+  return result;
+}
+
+// Returns an Expectation object that references and co-owns exp,
+// which must be an expectation on this mock function.
+Expectation UntypedFunctionMockerBase::GetHandleOf(ExpectationBase* exp) {
+  for (UntypedExpectations::const_iterator it =
+           untyped_expectations_.begin();
+       it != untyped_expectations_.end(); ++it) {
+    if (it->get() == exp) {
+      return Expectation(*it);
+    }
+  }
+
+  Assert(false, __FILE__, __LINE__, "Cannot find expectation.");
+  return Expectation();
+  // The above statement is just to make the code compile, and will
+  // never be executed.
+}
+
+// Verifies that all expectations on this mock function have been
+// satisfied.  Reports one or more Google Test non-fatal failures
+// and returns false if not.
+bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+  bool expectations_met = true;
+  for (UntypedExpectations::const_iterator it =
+           untyped_expectations_.begin();
+       it != untyped_expectations_.end(); ++it) {
+    ExpectationBase* const untyped_expectation = it->get();
+    if (untyped_expectation->IsOverSaturated()) {
+      // There was an upper-bound violation.  Since the error was
+      // already reported when it occurred, there is no need to do
+      // anything here.
+      expectations_met = false;
+    } else if (!untyped_expectation->IsSatisfied()) {
+      expectations_met = false;
+      ::std::stringstream ss;
+      ss  << "Actual function call count doesn't match "
+          << untyped_expectation->source_text() << "...\n";
+      // No need to show the source file location of the expectation
+      // in the description, as the Expect() call that follows already
+      // takes care of it.
+      untyped_expectation->MaybeDescribeExtraMatcherTo(&ss);
+      untyped_expectation->DescribeCallCountTo(&ss);
+      Expect(false, untyped_expectation->file(),
+             untyped_expectation->line(), ss.str());
+    }
+  }
+
+  // Deleting our expectations may trigger other mock objects to be deleted, for
+  // example if an action contains a reference counted smart pointer to that
+  // mock object, and that is the last reference. So if we delete our
+  // expectations within the context of the global mutex we may deadlock when
+  // this method is called again. Instead, make a copy of the set of
+  // expectations to delete, clear our set within the mutex, and then clear the
+  // copied set outside of it.
+  UntypedExpectations expectations_to_delete;
+  untyped_expectations_.swap(expectations_to_delete);
+
+  g_gmock_mutex.Unlock();
+  expectations_to_delete.clear();
+  g_gmock_mutex.Lock();
+
+  return expectations_met;
+}
+
+}  // namespace internal
+
+// Class Mock.
+
+namespace {
+
+typedef std::set<internal::UntypedFunctionMockerBase*> FunctionMockers;
+
+// The current state of a mock object.  Such information is needed for
+// detecting leaked mock objects and explicitly verifying a mock's
+// expectations.
+struct MockObjectState {
+  MockObjectState()
+      : first_used_file(NULL), first_used_line(-1), leakable(false) {}
+
+  // Where in the source file an ON_CALL or EXPECT_CALL is first
+  // invoked on this mock object.
+  const char* first_used_file;
+  int first_used_line;
+  ::std::string first_used_test_case;
+  ::std::string first_used_test;
+  bool leakable;  // true iff it's OK to leak the object.
+  FunctionMockers function_mockers;  // All registered methods of the object.
+};
+
+// A global registry holding the state of all mock objects that are
+// alive.  A mock object is added to this registry the first time
+// Mock::AllowLeak(), ON_CALL(), or EXPECT_CALL() is called on it.  It
+// is removed from the registry in the mock object's destructor.
+class MockObjectRegistry {
+ public:
+  // Maps a mock object (identified by its address) to its state.
+  typedef std::map<const void*, MockObjectState> StateMap;
+
+  // This destructor will be called when a program exits, after all
+  // tests in it have been run.  By then, there should be no mock
+  // object alive.  Therefore we report any living object as test
+  // failure, unless the user explicitly asked us to ignore it.
+  ~MockObjectRegistry() {
+    // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is
+    // a macro.
+
+    if (!GMOCK_FLAG(catch_leaked_mocks))
+      return;
+
+    int leaked_count = 0;
+    for (StateMap::const_iterator it = states_.begin(); it != states_.end();
+         ++it) {
+      if (it->second.leakable)  // The user said it's fine to leak this object.
+        continue;
+
+      // TODO(wan@google.com): Print the type of the leaked object.
+      // This can help the user identify the leaked object.
+      std::cout << "\n";
+      const MockObjectState& state = it->second;
+      std::cout << internal::FormatFileLocation(state.first_used_file,
+                                                state.first_used_line);
+      std::cout << " ERROR: this mock object";
+      if (state.first_used_test != "") {
+        std::cout << " (used in test " << state.first_used_test_case << "."
+             << state.first_used_test << ")";
+      }
+      std::cout << " should be deleted but never is. Its address is @"
+           << it->first << ".";
+      leaked_count++;
+    }
+    if (leaked_count > 0) {
+      std::cout << "\nERROR: " << leaked_count
+           << " leaked mock " << (leaked_count == 1 ? "object" : "objects")
+           << " found at program exit.\n";
+      std::cout.flush();
+      ::std::cerr.flush();
+      // RUN_ALL_TESTS() has already returned when this destructor is
+      // called.  Therefore we cannot use the normal Google Test
+      // failure reporting mechanism.
+      _exit(1);  // We cannot call exit() as it is not reentrant and
+                 // may already have been called.
+    }
+  }
+
+  StateMap& states() { return states_; }
+
+ private:
+  StateMap states_;
+};
+
+// Protected by g_gmock_mutex.
+MockObjectRegistry g_mock_object_registry;
+
+// Maps a mock object to the reaction Google Mock should have when an
+// uninteresting method is called.  Protected by g_gmock_mutex.
+std::map<const void*, internal::CallReaction> g_uninteresting_call_reaction;
+
+// Sets the reaction Google Mock should have when an uninteresting
+// method of the given mock object is called.
+void SetReactionOnUninterestingCalls(const void* mock_obj,
+                                     internal::CallReaction reaction)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_uninteresting_call_reaction[mock_obj] = reaction;
+}
+
+}  // namespace
+
+// Tells Google Mock to allow uninteresting calls on the given mock
+// object.
+void Mock::AllowUninterestingCalls(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  SetReactionOnUninterestingCalls(mock_obj, internal::kAllow);
+}
+
+// Tells Google Mock to warn the user about uninteresting calls on the
+// given mock object.
+void Mock::WarnUninterestingCalls(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  SetReactionOnUninterestingCalls(mock_obj, internal::kWarn);
+}
+
+// Tells Google Mock to fail uninteresting calls on the given mock
+// object.
+void Mock::FailUninterestingCalls(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  SetReactionOnUninterestingCalls(mock_obj, internal::kFail);
+}
+
+// Tells Google Mock the given mock object is being destroyed and its
+// entry in the call-reaction table should be removed.
+void Mock::UnregisterCallReaction(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_uninteresting_call_reaction.erase(mock_obj);
+}
+
+// Returns the reaction Google Mock will have on uninteresting calls
+// made on the given mock object.
+internal::CallReaction Mock::GetReactionOnUninterestingCalls(
+    const void* mock_obj)
+        GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  return (g_uninteresting_call_reaction.count(mock_obj) == 0) ?
+      internal::kDefault : g_uninteresting_call_reaction[mock_obj];
+}
+
+// Tells Google Mock to ignore mock_obj when checking for leaked mock
+// objects.
+void Mock::AllowLeak(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_mock_object_registry.states()[mock_obj].leakable = true;
+}
+
+// Verifies and clears all expectations on the given mock object.  If
+// the expectations aren't satisfied, generates one or more Google
+// Test non-fatal failures and returns false.
+bool Mock::VerifyAndClearExpectations(void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  return VerifyAndClearExpectationsLocked(mock_obj);
+}
+
+// Verifies all expectations on the given mock object and clears its
+// default actions and expectations.  Returns true iff the
+// verification was successful.
+bool Mock::VerifyAndClear(void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  ClearDefaultActionsLocked(mock_obj);
+  return VerifyAndClearExpectationsLocked(mock_obj);
+}
+
+// Verifies and clears all expectations on the given mock object.  If
+// the expectations aren't satisfied, generates one or more Google
+// Test non-fatal failures and returns false.
+bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
+  internal::g_gmock_mutex.AssertHeld();
+  if (g_mock_object_registry.states().count(mock_obj) == 0) {
+    // No EXPECT_CALL() was set on the given mock object.
+    return true;
+  }
+
+  // Verifies and clears the expectations on each mock method in the
+  // given mock object.
+  bool expectations_met = true;
+  FunctionMockers& mockers =
+      g_mock_object_registry.states()[mock_obj].function_mockers;
+  for (FunctionMockers::const_iterator it = mockers.begin();
+       it != mockers.end(); ++it) {
+    if (!(*it)->VerifyAndClearExpectationsLocked()) {
+      expectations_met = false;
+    }
+  }
+
+  // We don't clear the content of mockers, as they may still be
+  // needed by ClearDefaultActionsLocked().
+  return expectations_met;
+}
+
+// Registers a mock object and a mock method it owns.
+void Mock::Register(const void* mock_obj,
+                    internal::UntypedFunctionMockerBase* mocker)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_mock_object_registry.states()[mock_obj].function_mockers.insert(mocker);
+}
+
+// Tells Google Mock where in the source code mock_obj is used in an
+// ON_CALL or EXPECT_CALL.  In case mock_obj is leaked, this
+// information helps the user identify which object it is.
+void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
+                                           const char* file, int line)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  MockObjectState& state = g_mock_object_registry.states()[mock_obj];
+  if (state.first_used_file == NULL) {
+    state.first_used_file = file;
+    state.first_used_line = line;
+    const TestInfo* const test_info =
+        UnitTest::GetInstance()->current_test_info();
+    if (test_info != NULL) {
+      // TODO(wan@google.com): record the test case name when the
+      // ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
+      // TearDownTestCase().
+      state.first_used_test_case = test_info->test_case_name();
+      state.first_used_test = test_info->name();
+    }
+  }
+}
+
+// Unregisters a mock method; removes the owning mock object from the
+// registry when the last mock method associated with it has been
+// unregistered.  This is called only in the destructor of
+// FunctionMockerBase.
+void Mock::UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
+  internal::g_gmock_mutex.AssertHeld();
+  for (MockObjectRegistry::StateMap::iterator it =
+           g_mock_object_registry.states().begin();
+       it != g_mock_object_registry.states().end(); ++it) {
+    FunctionMockers& mockers = it->second.function_mockers;
+    if (mockers.erase(mocker) > 0) {
+      // mocker was in mockers and has been just removed.
+      if (mockers.empty()) {
+        g_mock_object_registry.states().erase(it);
+      }
+      return;
+    }
+  }
+}
+
+// Clears all ON_CALL()s set on the given mock object.
+void Mock::ClearDefaultActionsLocked(void* mock_obj)
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
+  internal::g_gmock_mutex.AssertHeld();
+
+  if (g_mock_object_registry.states().count(mock_obj) == 0) {
+    // No ON_CALL() was set on the given mock object.
+    return;
+  }
+
+  // Clears the default actions for each mock method in the given mock
+  // object.
+  FunctionMockers& mockers =
+      g_mock_object_registry.states()[mock_obj].function_mockers;
+  for (FunctionMockers::const_iterator it = mockers.begin();
+       it != mockers.end(); ++it) {
+    (*it)->ClearDefaultActionsLocked();
+  }
+
+  // We don't clear the content of mockers, as they may still be
+  // needed by VerifyAndClearExpectationsLocked().
+}
+
+Expectation::Expectation() {}
+
+Expectation::Expectation(
+    const internal::linked_ptr<internal::ExpectationBase>& an_expectation_base)
+    : expectation_base_(an_expectation_base) {}
+
+Expectation::~Expectation() {}
+
+// Adds an expectation to a sequence.
+void Sequence::AddExpectation(const Expectation& expectation) const {
+  if (*last_expectation_ != expectation) {
+    if (last_expectation_->expectation_base() != NULL) {
+      expectation.expectation_base()->immediate_prerequisites_
+          += *last_expectation_;
+    }
+    *last_expectation_ = expectation;
+  }
+}
+
+// Creates the implicit sequence if there isn't one.
+InSequence::InSequence() {
+  if (internal::g_gmock_implicit_sequence.get() == NULL) {
+    internal::g_gmock_implicit_sequence.set(new Sequence);
+    sequence_created_ = true;
+  } else {
+    sequence_created_ = false;
+  }
+}
+
+// Deletes the implicit sequence if it was created by the constructor
+// of this object.
+InSequence::~InSequence() {
+  if (sequence_created_) {
+    delete internal::g_gmock_implicit_sequence.get();
+    internal::g_gmock_implicit_sequence.set(NULL);
+  }
+}
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/src/gmock.cc b/third_party/ntcore_2018/gmock/src/gmock.cc
new file mode 100644
index 0000000..eac3d84
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock.cc
@@ -0,0 +1,183 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include "gmock/gmock.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+// TODO(wan@google.com): support using environment variables to
+// control the flag values, like what Google Test does.
+
+GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
+                   "true iff Google Mock should report leaked mock objects "
+                   "as failures.");
+
+GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity,
+                     "Controls how verbose Google Mock's output is."
+                     "  Valid values:\n"
+                     "  info    - prints all messages.\n"
+                     "  warning - prints warnings and errors.\n"
+                     "  error   - prints errors only.");
+
+namespace internal {
+
+// Parses a string as a command line flag.  The string should have the
+// format "--gmock_flag=value".  When def_optional is true, the
+// "=value" part can be omitted.
+//
+// Returns the value of the flag, or NULL if the parsing failed.
+static const char* ParseGoogleMockFlagValue(const char* str,
+                                            const char* flag,
+                                            bool def_optional) {
+  // str and flag must not be NULL.
+  if (str == NULL || flag == NULL) return NULL;
+
+  // The flag must start with "--gmock_".
+  const std::string flag_str = std::string("--gmock_") + flag;
+  const size_t flag_len = flag_str.length();
+  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
+
+  // Skips the flag name.
+  const char* flag_end = str + flag_len;
+
+  // When def_optional is true, it's OK to not have a "=value" part.
+  if (def_optional && (flag_end[0] == '\0')) {
+    return flag_end;
+  }
+
+  // If def_optional is true and there are more characters after the
+  // flag name, or if def_optional is false, there must be a '=' after
+  // the flag name.
+  if (flag_end[0] != '=') return NULL;
+
+  // Returns the string after "=".
+  return flag_end + 1;
+}
+
+// Parses a string for a Google Mock bool flag, in the form of
+// "--gmock_flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
+                                    bool* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Converts the string value to a bool.
+  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
+  return true;
+}
+
+// Parses a string for a Google Mock string flag, in the form of
+// "--gmock_flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+template <typename String>
+static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
+                                      String* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Sets *value to the value of the flag.
+  *value = value_str;
+  return true;
+}
+
+// The internal implementation of InitGoogleMock().
+//
+// The type parameter CharType can be instantiated to either char or
+// wchar_t.
+template <typename CharType>
+void InitGoogleMockImpl(int* argc, CharType** argv) {
+  // Makes sure Google Test is initialized.  InitGoogleTest() is
+  // idempotent, so it's fine if the user has already called it.
+  InitGoogleTest(argc, argv);
+  if (*argc <= 0) return;
+
+  for (int i = 1; i != *argc; i++) {
+    const std::string arg_string = StreamableToString(argv[i]);
+    const char* const arg = arg_string.c_str();
+
+    // Do we see a Google Mock flag?
+    if (ParseGoogleMockBoolFlag(arg, "catch_leaked_mocks",
+                                &GMOCK_FLAG(catch_leaked_mocks)) ||
+        ParseGoogleMockStringFlag(arg, "verbose", &GMOCK_FLAG(verbose))) {
+      // Yes.  Shift the remainder of the argv list left by one.  Note
+      // that argv has (*argc + 1) elements, the last one always being
+      // NULL.  The following loop moves the trailing NULL element as
+      // well.
+      for (int j = i; j != *argc; j++) {
+        argv[j] = argv[j + 1];
+      }
+
+      // Decrements the argument count.
+      (*argc)--;
+
+      // We also need to decrement the iterator as we just removed
+      // an element.
+      i--;
+    }
+  }
+}
+
+}  // namespace internal
+
+// Initializes Google Mock.  This must be called before running the
+// tests.  In particular, it parses a command line for the flags that
+// Google Mock recognizes.  Whenever a Google Mock flag is seen, it is
+// removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Mock flag variables are
+// updated.
+//
+// Since Google Test is needed for Google Mock to work, this function
+// also initializes Google Test and parses its flags, if that hasn't
+// been done.
+GTEST_API_ void InitGoogleMock(int* argc, char** argv) {
+  internal::InitGoogleMockImpl(argc, argv);
+}
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv) {
+  internal::InitGoogleMockImpl(argc, argv);
+}
+
+}  // namespace testing
diff --git a/third_party/ntcore_2018/gmock/src/gmock_main.cc b/third_party/ntcore_2018/gmock/src/gmock_main.cc
new file mode 100644
index 0000000..bd5be03
--- /dev/null
+++ b/third_party/ntcore_2018/gmock/src/gmock_main.cc
@@ -0,0 +1,54 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include <iostream>
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
+// causes a link error when _tmain is defined in a static library and UNICODE
+// is enabled. For this reason instead of _tmain, main function is used on
+// Windows. See the following link to track the current status of this bug:
+// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464  // NOLINT
+#if GTEST_OS_WINDOWS_MOBILE
+# include <tchar.h>  // NOLINT
+
+GTEST_API_ int _tmain(int argc, TCHAR** argv) {
+#else
+GTEST_API_ int main(int argc, char** argv) {
+#endif  // GTEST_OS_WINDOWS_MOBILE
+  std::cout << "Running main() from gmock_main.cc\n";
+  // Since Google Mock depends on Google Test, InitGoogleMock() is
+  // also responsible for initializing Google Test.  Therefore there's
+  // no need for calling testing::InitGoogleTest() separately.
+  testing::InitGoogleMock(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/third_party/ntcore_2018/gradle/wrapper/gradle-wrapper.jar b/third_party/ntcore_2018/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
--- /dev/null
+++ b/third_party/ntcore_2018/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/third_party/ntcore_2018/gradle/wrapper/gradle-wrapper.properties b/third_party/ntcore_2018/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..f16d266
--- /dev/null
+++ b/third_party/ntcore_2018/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip
diff --git a/third_party/ntcore_2018/gradlew b/third_party/ntcore_2018/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/third_party/ntcore_2018/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/third_party/ntcore_2018/gradlew.bat b/third_party/ntcore_2018/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/third_party/ntcore_2018/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/third_party/ntcore_2018/license.txt b/third_party/ntcore_2018/license.txt
new file mode 100644
index 0000000..9c33de4
--- /dev/null
+++ b/third_party/ntcore_2018/license.txt
@@ -0,0 +1,24 @@
+* Copyright (c) 2009-2016 FIRST
+* 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 the FIRST 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 FIRST AND CONTRIBUTORS``AS IS'' AND ANY
+* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+* WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST 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.
diff --git a/third_party/ntcore_2018/manualTests/java/Client.java b/third_party/ntcore_2018/manualTests/java/Client.java
new file mode 100644
index 0000000..6de3b85
--- /dev/null
+++ b/third_party/ntcore_2018/manualTests/java/Client.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+import edu.wpi.first.wpilibj.networktables.*;
+import edu.wpi.first.wpilibj.tables.*;
+
+public class Client {
+  private static class MyLogger implements NetworkTablesJNI.LoggerFunction {
+    public void apply(int level, String file, int line, String msg) {
+      System.err.println(msg);
+    }
+  }
+
+  public static void main(String[] args) {
+    NetworkTablesJNI.setLogger(new MyLogger(), 0);
+    NetworkTable.setIPAddress("127.0.0.1");
+    NetworkTable.setPort(10000);
+    NetworkTable.setClientMode();
+    NetworkTable nt = NetworkTable.getTable("");
+    try { Thread.sleep(2000); } catch (InterruptedException e) {}
+    try {
+      System.out.println("Got foo: " + nt.getNumber("foo"));
+    } catch(TableKeyNotDefinedException ex) {
+    }
+    nt.putBoolean("bar", false);
+    nt.setFlags("bar", NetworkTable.PERSISTENT);
+    nt.putBoolean("bar2", true);
+    nt.putBoolean("bar2", false);
+    nt.putBoolean("bar2", true);
+    nt.putString("str", "hello world");
+    double[] nums = new double[3];
+    nums[0] = 0.5;
+    nums[1] = 1.2;
+    nums[2] = 3.0;
+    nt.putNumberArray("numarray", nums);
+    String[] strs = new String[2];
+    strs[0] = "Hello";
+    strs[1] = "World";
+    nt.putStringArray("strarray", strs);
+    try { Thread.sleep(10000); } catch (InterruptedException e) {}
+  }
+}
diff --git a/third_party/ntcore_2018/manualTests/java/Server.java b/third_party/ntcore_2018/manualTests/java/Server.java
new file mode 100644
index 0000000..ecd221b
--- /dev/null
+++ b/third_party/ntcore_2018/manualTests/java/Server.java
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+import edu.wpi.first.wpilibj.networktables.*;
+import edu.wpi.first.wpilibj.tables.*;
+
+public class Server {
+  private static class MyLogger implements NetworkTablesJNI.LoggerFunction {
+    public void apply(int level, String file, int line, String msg) {
+      System.err.println(msg);
+    }
+  }
+
+  public static void main(String[] args) {
+    NetworkTablesJNI.setLogger(new MyLogger(), 0);
+    NetworkTable.setIPAddress("127.0.0.1");
+    NetworkTable.setPort(10000);
+    NetworkTable.setServerMode();
+    NetworkTable nt = NetworkTable.getTable("");
+    try { Thread.sleep(1000); } catch (InterruptedException e) {}
+    nt.putNumber("foo", 0.5);
+    nt.setFlags("foo", NetworkTable.PERSISTENT);
+    nt.putNumber("foo2", 0.5);
+    nt.putNumber("foo2", 0.7);
+    nt.putNumber("foo2", 0.6);
+    nt.putNumber("foo2", 0.5);
+    try { Thread.sleep(10000); } catch (InterruptedException e) {}
+  }
+}
diff --git a/third_party/ntcore_2018/manualTests/native/client.cpp b/third_party/ntcore_2018/manualTests/native/client.cpp
new file mode 100644
index 0000000..a4cef66
--- /dev/null
+++ b/third_party/ntcore_2018/manualTests/native/client.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <chrono>
+#include <climits>
+#include <cstdio>
+#include <thread>
+
+#include "ntcore.h"
+
+int main() {
+  auto inst = nt::GetDefaultInstance();
+  nt::AddLogger(inst,
+                [](const nt::LogMessage& msg) {
+                  std::fputs(msg.message.c_str(), stderr);
+                  std::fputc('\n', stderr);
+                },
+                0, UINT_MAX);
+  nt::StartClient(inst, "127.0.0.1", 10000);
+  std::this_thread::sleep_for(std::chrono::seconds(2));
+
+  auto foo = nt::GetEntry(inst, "/foo");
+  auto foo_val = nt::GetEntryValue(foo);
+  if (foo_val && foo_val->IsDouble())
+    std::printf("Got foo: %g\n", foo_val->GetDouble());
+
+  auto bar = nt::GetEntry(inst, "/bar");
+  nt::SetEntryValue(bar, nt::Value::MakeBoolean(false));
+  nt::SetEntryFlags(bar, NT_PERSISTENT);
+
+  auto bar2 = nt::GetEntry(inst, "/bar2");
+  nt::SetEntryValue(bar2, nt::Value::MakeBoolean(true));
+  nt::SetEntryValue(bar2, nt::Value::MakeBoolean(false));
+  nt::SetEntryValue(bar2, nt::Value::MakeBoolean(true));
+  std::this_thread::sleep_for(std::chrono::seconds(10));
+}
diff --git a/third_party/ntcore_2018/manualTests/native/rpc_local.cpp b/third_party/ntcore_2018/manualTests/native/rpc_local.cpp
new file mode 100644
index 0000000..8bfdaf7
--- /dev/null
+++ b/third_party/ntcore_2018/manualTests/native/rpc_local.cpp
@@ -0,0 +1,66 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <chrono>
+#include <climits>
+#include <cstdio>
+#include <thread>
+
+#include <support/json.h>
+
+#include "ntcore.h"
+
+void callback1(const nt::RpcAnswer& answer) {
+  wpi::json params;
+  try {
+    params = wpi::json::from_cbor(answer.params);
+  } catch (wpi::json::parse_error err) {
+    std::fputs("could not decode params?\n", stderr);
+    return;
+  }
+  if (!params.is_number()) {
+    std::fputs("did not get number\n", stderr);
+    return;
+  }
+  double val = params.get<double>();
+  std::fprintf(stderr, "called with %g\n", val);
+
+  answer.PostResponse(wpi::json::to_cbor(val + 1.2));
+}
+
+int main() {
+  auto inst = nt::GetDefaultInstance();
+  nt::AddLogger(inst,
+                [](const nt::LogMessage& msg) {
+                  std::fputs(msg.message.c_str(), stderr);
+                  std::fputc('\n', stderr);
+                },
+                0, UINT_MAX);
+
+  nt::StartServer(inst, "rpc_local.ini", "", 10000);
+  auto entry = nt::GetEntry(inst, "func1");
+  nt::CreateRpc(entry, nt::StringRef("", 1), callback1);
+  std::fputs("calling rpc\n", stderr);
+  unsigned int call1_uid = nt::CallRpc(entry, wpi::json::to_cbor(2.0));
+  std::string call1_result_str;
+  std::fputs("waiting for rpc result\n", stderr);
+  nt::GetRpcResult(entry, call1_uid, &call1_result_str);
+  wpi::json call1_result;
+  try {
+    call1_result = wpi::json::from_cbor(call1_result_str);
+  } catch (wpi::json::parse_error err) {
+    std::fputs("could not decode result?\n", stderr);
+    return 1;
+  }
+  if (!call1_result.is_number()) {
+    std::fputs("result is not number?\n", stderr);
+    return 1;
+  }
+  std::fprintf(stderr, "got %g\n", call1_result.get<double>());
+
+  return 0;
+}
diff --git a/third_party/ntcore_2018/manualTests/native/rpc_speed.cpp b/third_party/ntcore_2018/manualTests/native/rpc_speed.cpp
new file mode 100644
index 0000000..70020b3
--- /dev/null
+++ b/third_party/ntcore_2018/manualTests/native/rpc_speed.cpp
@@ -0,0 +1,75 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <chrono>
+#include <climits>
+#include <cstdio>
+#include <iostream>
+#include <thread>
+
+#include <support/json.h>
+
+#include "ntcore.h"
+
+void callback1(const nt::RpcAnswer& answer) {
+  wpi::json params;
+  try {
+    params = wpi::json::from_cbor(answer.params);
+  } catch (wpi::json::parse_error err) {
+    std::fputs("could not decode params?\n", stderr);
+    return;
+  }
+  if (!params.is_number()) {
+    std::fputs("did not get number\n", stderr);
+    return;
+  }
+  double val = params.get<double>();
+  answer.PostResponse(wpi::json::to_cbor(val + 1.2));
+}
+
+int main() {
+  auto inst = nt::GetDefaultInstance();
+  nt::StartServer(inst, "rpc_speed.ini", "", 10000);
+  auto entry = nt::GetEntry(inst, "func1");
+  nt::CreateRpc(entry, nt::StringRef("", 1), callback1);
+  std::string call1_result_str;
+
+  auto start2 = std::chrono::high_resolution_clock::now();
+  auto start = nt::Now();
+  for (int i = 0; i < 10000; ++i) {
+    unsigned int call1_uid = nt::CallRpc(entry, wpi::json::to_cbor(i));
+    nt::GetRpcResult(entry, call1_uid, &call1_result_str);
+    wpi::json call1_result;
+    try {
+      call1_result = wpi::json::from_cbor(call1_result_str);
+    } catch (wpi::json::parse_error err) {
+      std::fputs("could not decode result?\n", stderr);
+      return 1;
+    }
+    if (!call1_result.is_number()) {
+      std::fputs("result is not number?\n", stderr);
+      return 1;
+    }
+  }
+  auto end2 = std::chrono::high_resolution_clock::now();
+  auto end = nt::Now();
+  std::cerr << "nt::Now start=" << start << " end=" << end << '\n';
+  std::cerr << "std::chrono start="
+            << std::chrono::duration_cast<std::chrono::nanoseconds>(
+                   start2.time_since_epoch())
+                   .count()
+            << " end="
+            << std::chrono::duration_cast<std::chrono::nanoseconds>(
+                   end2.time_since_epoch())
+                   .count()
+            << '\n';
+  std::fprintf(stderr, "time/call = %g us\n", (end - start) / 10.0 / 10000.0);
+  std::chrono::duration<double, std::micro> diff = end2 - start2;
+  std::cerr << "time/call = " << (diff.count() / 10000.0) << " us\n";
+
+  return 0;
+}
diff --git a/third_party/ntcore_2018/manualTests/native/server.cpp b/third_party/ntcore_2018/manualTests/native/server.cpp
new file mode 100644
index 0000000..a19c50c
--- /dev/null
+++ b/third_party/ntcore_2018/manualTests/native/server.cpp
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <chrono>
+#include <climits>
+#include <cstdio>
+#include <thread>
+
+#include "ntcore.h"
+
+int main() {
+  auto inst = nt::GetDefaultInstance();
+  nt::AddLogger(inst,
+                [](const nt::LogMessage& msg) {
+                  std::fputs(msg.message.c_str(), stderr);
+                  std::fputc('\n', stderr);
+                },
+                0, UINT_MAX);
+  nt::StartServer(inst, "persistent.ini", "", 10000);
+  std::this_thread::sleep_for(std::chrono::seconds(1));
+
+  auto foo = nt::GetEntry(inst, "/foo");
+  nt::SetEntryValue(foo, nt::Value::MakeDouble(0.5));
+  nt::SetEntryFlags(foo, NT_PERSISTENT);
+
+  auto foo2 = nt::GetEntry(inst, "/foo2");
+  nt::SetEntryValue(foo2, nt::Value::MakeDouble(0.5));
+  nt::SetEntryValue(foo2, nt::Value::MakeDouble(0.7));
+  nt::SetEntryValue(foo2, nt::Value::MakeDouble(0.6));
+  nt::SetEntryValue(foo2, nt::Value::MakeDouble(0.5));
+
+  std::this_thread::sleep_for(std::chrono::seconds(10));
+}
diff --git a/third_party/ntcore_2018/publish.gradle b/third_party/ntcore_2018/publish.gradle
new file mode 100644
index 0000000..7df5cef
--- /dev/null
+++ b/third_party/ntcore_2018/publish.gradle
@@ -0,0 +1,268 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def outputsFolder = file("$buildDir/outputs")
+
+def versionFile = file("$outputsFolder/version.txt")
+
+task outputVersions() {
+    description = 'Prints the versions of ntcore to a file for use by the downstream packaging project'
+    group = 'Build'
+    outputs.files(versionFile)
+
+    doFirst {
+        outputsFolder.mkdir()
+    }
+
+    doLast {
+        versionFile.write pubVersion
+    }
+}
+
+build.dependsOn outputVersions
+
+def baseArtifactId = 'ntcore'
+def artifactGroupId = 'edu.wpi.first.ntcore'
+
+def licenseFile = file("$rootDir/license.txt")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+
+    model {
+        tasks {
+            it.each {
+                if (it in getJNIHeadersClass()) {
+                    from (it.outputs.files) {
+                        into '/'
+                    }
+                    dependsOn it
+                }
+            }
+        }
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+    classifier = 'sources'
+    from sourceSets.main.allSource
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
+if (project.hasProperty('jenkinsBuild')) {
+    jar {
+        classifier = 'javaArtifact'
+    }
+}
+
+artifacts {
+    archives sourcesJar
+    archives javadocJar
+    archives cppHeadersZip
+    archives cppSourcesZip
+}
+
+def createComponentZipTasks = { components, name, base, type, project, func ->
+    def configMap = [:]
+    components.each {
+        if (it in NativeLibrarySpec && it.name == name) {
+            it.binaries.each {
+                def target = getClassifier(it)
+                if (configMap.containsKey(target)) {
+                    configMap.get(target).add(it)
+                } else {
+                    configMap.put(target, [])
+                    configMap.get(target).add(it)
+                }
+            }
+        }
+    }
+    def taskList = []
+    configMap.each { key, value ->
+        def baseN = base + name
+        def task = project.tasks.create(baseN + "-${key}", type) {
+            description = 'Creates component archive for platform ' + key
+            destinationDir =  outputsFolder
+            classifier = key
+            baseName = baseN + '-classifier'
+            duplicatesStrategy = 'exclude'
+
+            from(licenseFile) {
+                into '/'
+            }
+
+            func(it, value)
+        }
+        taskList.add(task)
+
+        project.build.dependsOn task
+
+        project.artifacts {
+            task
+        }
+    }
+    return taskList
+}
+
+model {
+    publishing {
+        def ntcoreTaskList = createComponentZipTasks($.components, 'ntcore', 'zipcppntcore', Zip, project, { task, value ->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from(new File(binary.sharedLibraryFile.absolutePath + ".debug")) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                        task.from (binary.sharedLibraryLinkFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                    } else if (binary instanceof StaticLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.staticLibraryFile) {
+                            into getPlatformPath(binary) + '/static'
+                        }
+                    }
+                }
+            }
+        })
+
+        def ntcoreJNITaskList = createComponentZipTasks($.components, 'ntcoreJNI', 'jnijnintcore', Jar, project, { task, value ->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary)
+                        }
+                    }
+                }
+            }
+        })
+
+        def allJniTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allJniTask = project.tasks.create("ntcoreJNIAllJar", Jar) {
+                description = 'Creates a jar with all JNI artifacts'
+                classifier = 'all'
+                baseName = 'jnijnintcorentcoreJNI'
+                destinationDir = outputsFolder
+                duplicatesStrategy = 'exclude'
+
+                ntcoreJNITaskList.each {
+                    it.outputs.files.each {
+                        from project.zipTree(it)
+                    }
+                    dependsOn it
+                }
+            }
+            project.build.dependsOn allJniTask
+        }
+
+        def allCppTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allCppTask = project.tasks.create("ntcoreAllZip", Zip) {
+                description = 'Creates a zip with all Cpp artifacts'
+                classifier = 'all'
+                baseName = 'zipcppntcorentcore'
+                destinationDir = outputsFolder
+                duplicatesStrategy = 'exclude'
+
+                ntcoreTaskList.each {
+                    it.outputs.files.each {
+                        from project.zipTree(it)
+                    }
+                    dependsOn it
+                }
+            }
+            project.build.dependsOn allCppTask
+        }
+
+        publications {
+            cpp(MavenPublication) {
+                ntcoreTaskList.each {
+                    artifact it
+                }
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allCppTask
+                }
+
+                artifactId = "${baseArtifactId}-cpp"
+                groupId artifactGroupId
+                version pubVersion
+            }
+            jni(MavenPublication) {
+                ntcoreJNITaskList.each {
+                    artifact it
+                }
+
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allJniTask
+                }
+
+                artifactId = "${baseArtifactId}-jni"
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
+
+publishing {
+    publications {
+        java(MavenPublication) {
+            artifact jar
+            artifact sourcesJar
+            artifact javadocJar
+
+            artifactId = "${baseArtifactId}-java"
+            groupId artifactGroupId
+            version pubVersion
+        }
+    }
+}
diff --git a/third_party/ntcore_2018/settings.gradle b/third_party/ntcore_2018/settings.gradle
new file mode 100644
index 0000000..da7ccc2
--- /dev/null
+++ b/third_party/ntcore_2018/settings.gradle
@@ -0,0 +1 @@
+include 'gmock'
diff --git a/third_party/ntcore_2018/src/arm-linux-jni/LICENSE b/third_party/ntcore_2018/src/arm-linux-jni/LICENSE
new file mode 100644
index 0000000..b40a0f4
--- /dev/null
+++ b/third_party/ntcore_2018/src/arm-linux-jni/LICENSE
@@ -0,0 +1,347 @@
+The GNU General Public License (GPL)
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it.  By contrast, the GNU General Public License is intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users.  This General Public License applies to
+most of the Free Software Foundation's software and to any other program whose
+authors commit to using it.  (Some other Free Software Foundation software is
+covered by the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+When we speak of free software, we are referring to freedom, not price.  Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights.  These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have.  You must
+make sure that they, too, receive or can get the source code.  And you must
+show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software.  If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.  We
+wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must be licensed for
+everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms of
+this General Public License.  The "Program", below, refers to any such program
+or work, and a "work based on the Program" means either the Program or any
+derivative work under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with modifications and/or
+translated into another language.  (Hereinafter, translation is included
+without limitation in the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification are not covered by
+this License; they are outside its scope.  The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made by
+running the Program).  Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as
+you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may
+at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus
+forming a work based on the Program, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in whole or
+    in part contains or is derived from the Program or any part thereof, to be
+    licensed as a whole at no charge to all third parties under the terms of
+    this License.
+
+    c) If the modified program normally reads commands interactively when run,
+    you must cause it, when started running for such interactive use in the
+    most ordinary way, to print or display an announcement including an
+    appropriate copyright notice and a notice that there is no warranty (or
+    else, saying that you provide a warranty) and that users may redistribute
+    the program under these conditions, and telling the user how to view a copy
+    of this License.  (Exception: if the Program itself is interactive but does
+    not normally print such an announcement, your work based on the Program is
+    not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If identifiable
+sections of that work are not derived from the Program, and can be reasonably
+considered independent and separate works in themselves, then this License, and
+its terms, do not apply to those sections when you distribute them as separate
+works.  But when you distribute the same sections as part of a whole which is a
+work based on the Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based on
+the Program.
+
+In addition, mere aggregation of another work not based on the Program with the
+Program (or with a work based on the Program) on a volume of a storage or
+distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1 and
+2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source
+    code, which must be distributed under the terms of Sections 1 and 2 above
+    on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three years, to
+    give any third party, for a charge no more than your cost of physically
+    performing source distribution, a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of Sections 1
+    and 2 above on a medium customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer to
+    distribute corresponding source code.  (This alternative is allowed only
+    for noncommercial distribution and only if you received the program in
+    object code or executable form with such an offer, in accord with
+    Subsection b above.)
+
+The source code for a work means the preferred form of the work for making
+modifications to it.  For an executable work, complete source code means all
+the source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and installation
+of the executable.  However, as a special exception, the source code
+distributed need not include anything that is normally distributed (in either
+source or binary form) with the major components (compiler, kernel, and so on)
+of the operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the source
+code from the same place counts as distribution of the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License.  Any attempt otherwise to copy, modify,
+sublicense or distribute the Program is void, and will automatically terminate
+your rights under this License.  However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the Program
+or its derivative works.  These actions are prohibited by law if you do not
+accept this License.  Therefore, by modifying or distributing the Program (or
+any work based on the Program), you indicate your acceptance of this License to
+do so, and all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program),
+the recipient automatically receives a license from the original licensor to
+copy, distribute or modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the recipients' exercise of the
+rights granted herein.  You are not responsible for enforcing compliance by
+third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License.  If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices.  Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded.  In
+such case, this License incorporates the limitation as if written in the body
+of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the
+General Public License from time to time.  Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any later
+version", you have the option of following the terms and conditions either of
+that version or of any later version published by the Free Software Foundation.
+If the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission.  For software which is copyrighted by the Free Software Foundation,
+write to the Free Software Foundation; we sometimes make exceptions for this.
+Our decision will be guided by the two goals of preserving the free status of
+all derivatives of our free software and of promoting the sharing and reuse of
+software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
+ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
+PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
+OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible
+use to the public, the best way to achieve this is to make it free software
+which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest to attach
+them to the start of each source file to most effectively convey the exclusion
+of warranty; and each file should have at least the "copyright" line and a
+pointer to where the full notice is found.
+
+    One line to give the program's name and a brief idea of what it does.
+
+    Copyright (C) <year> <name of author>
+
+    This program is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the Free
+    Software Foundation; either version 2 of the License, or (at your option)
+    any later version.
+
+    This program is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+    more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc., 59
+    Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it
+starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
+    with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free
+    software, and you are welcome to redistribute it under certain conditions;
+    type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may be
+called something other than 'show w' and 'show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.  Here
+is a sample; alter the names:
+
+    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+    'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+    signature of Ty Coon, 1 April 1989
+
+    Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General Public
+License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL
+
+Certain source files distributed by Oracle America and/or its affiliates are
+subject to the following clarification and special exception to the GPL, but
+only where Oracle has expressly included in the particular source file's header
+the words "Oracle designates this particular file as subject to the "Classpath"
+exception as provided by Oracle in the LICENSE file that accompanied this code."
+
+    Linking this library statically or dynamically with other modules is making
+    a combined work based on this library.  Thus, the terms and conditions of
+    the GNU General Public License cover the whole combination.
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,
+    and to copy and distribute the resulting executable under terms of your
+    choice, provided that you also meet, for each linked independent module,
+    the terms and conditions of the license of that module.  An independent
+    module is a module which is not derived from or based on this library.  If
+    you modify this library, you may extend this exception to your version of
+    the library, but you are not obligated to do so.  If you do not wish to do
+    so, delete this exception statement from your version.
diff --git a/third_party/ntcore_2018/src/arm-linux-jni/jni.h b/third_party/ntcore_2018/src/arm-linux-jni/jni.h
new file mode 100644
index 0000000..2e83cb7
--- /dev/null
+++ b/third_party/ntcore_2018/src/arm-linux-jni/jni.h
@@ -0,0 +1,1960 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+   and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char   jboolean;
+typedef unsigned short  jchar;
+typedef short           jshort;
+typedef float           jfloat;
+typedef double          jdouble;
+
+typedef jint            jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+    jboolean z;
+    jbyte    b;
+    jchar    c;
+    jshort   s;
+    jint     i;
+    jlong    j;
+    jfloat   f;
+    jdouble  d;
+    jobject  l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+     JNIInvalidRefType    = 0,
+     JNILocalRefType      = 1,
+     JNIGlobalRefType     = 2,
+     JNIWeakGlobalRefType = 3
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK           0                 /* success */
+#define JNI_ERR          (-1)              /* unknown error */
+#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
+#define JNI_EVERSION     (-3)              /* JNI version error */
+#define JNI_ENOMEM       (-4)              /* not enough memory */
+#define JNI_EEXIST       (-5)              /* VM already created */
+#define JNI_EINVAL       (-6)              /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+    char *name;
+    char *signature;
+    void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    void *reserved3;
+    jint (JNICALL *GetVersion)(JNIEnv *env);
+
+    jclass (JNICALL *DefineClass)
+      (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+       jsize len);
+    jclass (JNICALL *FindClass)
+      (JNIEnv *env, const char *name);
+
+    jmethodID (JNICALL *FromReflectedMethod)
+      (JNIEnv *env, jobject method);
+    jfieldID (JNICALL *FromReflectedField)
+      (JNIEnv *env, jobject field);
+
+    jobject (JNICALL *ToReflectedMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+    jclass (JNICALL *GetSuperclass)
+      (JNIEnv *env, jclass sub);
+    jboolean (JNICALL *IsAssignableFrom)
+      (JNIEnv *env, jclass sub, jclass sup);
+
+    jobject (JNICALL *ToReflectedField)
+      (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+    jint (JNICALL *Throw)
+      (JNIEnv *env, jthrowable obj);
+    jint (JNICALL *ThrowNew)
+      (JNIEnv *env, jclass clazz, const char *msg);
+    jthrowable (JNICALL *ExceptionOccurred)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionDescribe)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionClear)
+      (JNIEnv *env);
+    void (JNICALL *FatalError)
+      (JNIEnv *env, const char *msg);
+
+    jint (JNICALL *PushLocalFrame)
+      (JNIEnv *env, jint capacity);
+    jobject (JNICALL *PopLocalFrame)
+      (JNIEnv *env, jobject result);
+
+    jobject (JNICALL *NewGlobalRef)
+      (JNIEnv *env, jobject lobj);
+    void (JNICALL *DeleteGlobalRef)
+      (JNIEnv *env, jobject gref);
+    void (JNICALL *DeleteLocalRef)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsSameObject)
+      (JNIEnv *env, jobject obj1, jobject obj2);
+    jobject (JNICALL *NewLocalRef)
+      (JNIEnv *env, jobject ref);
+    jint (JNICALL *EnsureLocalCapacity)
+      (JNIEnv *env, jint capacity);
+
+    jobject (JNICALL *AllocObject)
+      (JNIEnv *env, jclass clazz);
+    jobject (JNICALL *NewObject)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *NewObjectV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *NewObjectA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jclass (JNICALL *GetObjectClass)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsInstanceOf)
+      (JNIEnv *env, jobject obj, jclass clazz);
+
+    jmethodID (JNICALL *GetMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallObjectMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jobject (JNICALL *CallObjectMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallObjectMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jboolean (JNICALL *CallBooleanMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jboolean (JNICALL *CallBooleanMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallBooleanMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jbyte (JNICALL *CallByteMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jbyte (JNICALL *CallByteMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallByteMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallCharMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jchar (JNICALL *CallCharMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallCharMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallShortMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jshort (JNICALL *CallShortMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallShortMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallIntMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jint (JNICALL *CallIntMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jint (JNICALL *CallIntMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallLongMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jlong (JNICALL *CallLongMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallLongMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallFloatMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jfloat (JNICALL *CallFloatMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallFloatMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallDoubleMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jdouble (JNICALL *CallDoubleMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallDoubleMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallVoidMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    void (JNICALL *CallVoidMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    void (JNICALL *CallVoidMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jobject (JNICALL *CallNonvirtualObjectMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallNonvirtualObjectMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jobject (JNICALL *CallNonvirtualObjectMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jboolean (JNICALL *CallNonvirtualBooleanMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jbyte (JNICALL *CallNonvirtualByteMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallNonvirtualByteMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jbyte (JNICALL *CallNonvirtualByteMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jchar (JNICALL *CallNonvirtualCharMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallNonvirtualCharMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jchar (JNICALL *CallNonvirtualCharMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jshort (JNICALL *CallNonvirtualShortMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallNonvirtualShortMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jshort (JNICALL *CallNonvirtualShortMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jint (JNICALL *CallNonvirtualIntMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallNonvirtualIntMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jint (JNICALL *CallNonvirtualIntMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jlong (JNICALL *CallNonvirtualLongMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallNonvirtualLongMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jlong (JNICALL *CallNonvirtualLongMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jfloat (JNICALL *CallNonvirtualFloatMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallNonvirtualFloatMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jfloat (JNICALL *CallNonvirtualFloatMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jdouble (JNICALL *CallNonvirtualDoubleMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    void (JNICALL *CallNonvirtualVoidMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    void (JNICALL *CallNonvirtualVoidMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    void (JNICALL *CallNonvirtualVoidMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jfieldID (JNICALL *GetFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *GetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jboolean (JNICALL *GetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jbyte (JNICALL *GetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jchar (JNICALL *GetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jshort (JNICALL *GetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jint (JNICALL *GetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jlong (JNICALL *GetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jfloat (JNICALL *GetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jdouble (JNICALL *GetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+    void (JNICALL *SetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+    void (JNICALL *SetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+    void (JNICALL *SetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+    void (JNICALL *SetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+    void (JNICALL *SetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+    void (JNICALL *SetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+    void (JNICALL *SetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+    void (JNICALL *SetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+    void (JNICALL *SetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+    jmethodID (JNICALL *GetStaticMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallStaticObjectMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallStaticObjectMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallStaticObjectMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jboolean (JNICALL *CallStaticBooleanMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallStaticBooleanMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallStaticBooleanMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jbyte (JNICALL *CallStaticByteMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallStaticByteMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallStaticByteMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallStaticCharMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallStaticCharMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallStaticCharMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallStaticShortMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallStaticShortMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallStaticShortMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallStaticIntMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallStaticIntMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jint (JNICALL *CallStaticIntMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallStaticLongMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallStaticLongMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallStaticLongMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallStaticFloatMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallStaticFloatMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallStaticFloatMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallStaticDoubleMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallStaticDoubleMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallStaticDoubleMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallStaticVoidMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+    void (JNICALL *CallStaticVoidMethodV)
+      (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+    void (JNICALL *CallStaticVoidMethodA)
+      (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+    jfieldID (JNICALL *GetStaticFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+    jobject (JNICALL *GetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jboolean (JNICALL *GetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jbyte (JNICALL *GetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jchar (JNICALL *GetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jshort (JNICALL *GetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jint (JNICALL *GetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jlong (JNICALL *GetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jfloat (JNICALL *GetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jdouble (JNICALL *GetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+    void (JNICALL *SetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+    void (JNICALL *SetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+    void (JNICALL *SetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+    void (JNICALL *SetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+    void (JNICALL *SetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+    void (JNICALL *SetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+    void (JNICALL *SetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+    void (JNICALL *SetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+    void (JNICALL *SetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+    jstring (JNICALL *NewString)
+      (JNIEnv *env, const jchar *unicode, jsize len);
+    jsize (JNICALL *GetStringLength)
+      (JNIEnv *env, jstring str);
+    const jchar *(JNICALL *GetStringChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringChars)
+      (JNIEnv *env, jstring str, const jchar *chars);
+
+    jstring (JNICALL *NewStringUTF)
+      (JNIEnv *env, const char *utf);
+    jsize (JNICALL *GetStringUTFLength)
+      (JNIEnv *env, jstring str);
+    const char* (JNICALL *GetStringUTFChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringUTFChars)
+      (JNIEnv *env, jstring str, const char* chars);
+
+
+    jsize (JNICALL *GetArrayLength)
+      (JNIEnv *env, jarray array);
+
+    jobjectArray (JNICALL *NewObjectArray)
+      (JNIEnv *env, jsize len, jclass clazz, jobject init);
+    jobject (JNICALL *GetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index);
+    void (JNICALL *SetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+    jbooleanArray (JNICALL *NewBooleanArray)
+      (JNIEnv *env, jsize len);
+    jbyteArray (JNICALL *NewByteArray)
+      (JNIEnv *env, jsize len);
+    jcharArray (JNICALL *NewCharArray)
+      (JNIEnv *env, jsize len);
+    jshortArray (JNICALL *NewShortArray)
+      (JNIEnv *env, jsize len);
+    jintArray (JNICALL *NewIntArray)
+      (JNIEnv *env, jsize len);
+    jlongArray (JNICALL *NewLongArray)
+      (JNIEnv *env, jsize len);
+    jfloatArray (JNICALL *NewFloatArray)
+      (JNIEnv *env, jsize len);
+    jdoubleArray (JNICALL *NewDoubleArray)
+      (JNIEnv *env, jsize len);
+
+    jboolean * (JNICALL *GetBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+    jbyte * (JNICALL *GetByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+    jchar * (JNICALL *GetCharArrayElements)
+      (JNIEnv *env, jcharArray array, jboolean *isCopy);
+    jshort * (JNICALL *GetShortArrayElements)
+      (JNIEnv *env, jshortArray array, jboolean *isCopy);
+    jint * (JNICALL *GetIntArrayElements)
+      (JNIEnv *env, jintArray array, jboolean *isCopy);
+    jlong * (JNICALL *GetLongArrayElements)
+      (JNIEnv *env, jlongArray array, jboolean *isCopy);
+    jfloat * (JNICALL *GetFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+    jdouble * (JNICALL *GetDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+    void (JNICALL *ReleaseBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+    void (JNICALL *ReleaseByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+    void (JNICALL *ReleaseCharArrayElements)
+      (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+    void (JNICALL *ReleaseShortArrayElements)
+      (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+    void (JNICALL *ReleaseIntArrayElements)
+      (JNIEnv *env, jintArray array, jint *elems, jint mode);
+    void (JNICALL *ReleaseLongArrayElements)
+      (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+    void (JNICALL *ReleaseFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+    void (JNICALL *ReleaseDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+    void (JNICALL *GetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+    void (JNICALL *GetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+    void (JNICALL *GetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+    void (JNICALL *GetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+    void (JNICALL *GetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+    void (JNICALL *GetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+    void (JNICALL *GetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+    void (JNICALL *SetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+    void (JNICALL *SetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+    void (JNICALL *SetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+    void (JNICALL *SetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+    void (JNICALL *SetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+    void (JNICALL *SetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+    void (JNICALL *SetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+    void (JNICALL *SetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+    jint (JNICALL *RegisterNatives)
+      (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+       jint nMethods);
+    jint (JNICALL *UnregisterNatives)
+      (JNIEnv *env, jclass clazz);
+
+    jint (JNICALL *MonitorEnter)
+      (JNIEnv *env, jobject obj);
+    jint (JNICALL *MonitorExit)
+      (JNIEnv *env, jobject obj);
+
+    jint (JNICALL *GetJavaVM)
+      (JNIEnv *env, JavaVM **vm);
+
+    void (JNICALL *GetStringRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetStringUTFRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+    void * (JNICALL *GetPrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, jboolean *isCopy);
+    void (JNICALL *ReleasePrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, void *carray, jint mode);
+
+    const jchar * (JNICALL *GetStringCritical)
+      (JNIEnv *env, jstring string, jboolean *isCopy);
+    void (JNICALL *ReleaseStringCritical)
+      (JNIEnv *env, jstring string, const jchar *cstring);
+
+    jweak (JNICALL *NewWeakGlobalRef)
+       (JNIEnv *env, jobject obj);
+    void (JNICALL *DeleteWeakGlobalRef)
+       (JNIEnv *env, jweak ref);
+
+    jboolean (JNICALL *ExceptionCheck)
+       (JNIEnv *env);
+
+    jobject (JNICALL *NewDirectByteBuffer)
+       (JNIEnv* env, void* address, jlong capacity);
+    void* (JNICALL *GetDirectBufferAddress)
+       (JNIEnv* env, jobject buf);
+    jlong (JNICALL *GetDirectBufferCapacity)
+       (JNIEnv* env, jobject buf);
+
+    /* New JNI 1.6 Features */
+
+    jobjectRefType (JNICALL *GetObjectRefType)
+        (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ *    env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ *    (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+    const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint GetVersion() {
+        return functions->GetVersion(this);
+    }
+    jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+                       jsize len) {
+        return functions->DefineClass(this, name, loader, buf, len);
+    }
+    jclass FindClass(const char *name) {
+        return functions->FindClass(this, name);
+    }
+    jmethodID FromReflectedMethod(jobject method) {
+        return functions->FromReflectedMethod(this,method);
+    }
+    jfieldID FromReflectedField(jobject field) {
+        return functions->FromReflectedField(this,field);
+    }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+        return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+    }
+
+    jclass GetSuperclass(jclass sub) {
+        return functions->GetSuperclass(this, sub);
+    }
+    jboolean IsAssignableFrom(jclass sub, jclass sup) {
+        return functions->IsAssignableFrom(this, sub, sup);
+    }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+        return functions->ToReflectedField(this,cls,fieldID,isStatic);
+    }
+
+    jint Throw(jthrowable obj) {
+        return functions->Throw(this, obj);
+    }
+    jint ThrowNew(jclass clazz, const char *msg) {
+        return functions->ThrowNew(this, clazz, msg);
+    }
+    jthrowable ExceptionOccurred() {
+        return functions->ExceptionOccurred(this);
+    }
+    void ExceptionDescribe() {
+        functions->ExceptionDescribe(this);
+    }
+    void ExceptionClear() {
+        functions->ExceptionClear(this);
+    }
+    void FatalError(const char *msg) {
+        functions->FatalError(this, msg);
+    }
+
+    jint PushLocalFrame(jint capacity) {
+        return functions->PushLocalFrame(this,capacity);
+    }
+    jobject PopLocalFrame(jobject result) {
+        return functions->PopLocalFrame(this,result);
+    }
+
+    jobject NewGlobalRef(jobject lobj) {
+        return functions->NewGlobalRef(this,lobj);
+    }
+    void DeleteGlobalRef(jobject gref) {
+        functions->DeleteGlobalRef(this,gref);
+    }
+    void DeleteLocalRef(jobject obj) {
+        functions->DeleteLocalRef(this, obj);
+    }
+
+    jboolean IsSameObject(jobject obj1, jobject obj2) {
+        return functions->IsSameObject(this,obj1,obj2);
+    }
+
+    jobject NewLocalRef(jobject ref) {
+        return functions->NewLocalRef(this,ref);
+    }
+    jint EnsureLocalCapacity(jint capacity) {
+        return functions->EnsureLocalCapacity(this,capacity);
+    }
+
+    jobject AllocObject(jclass clazz) {
+        return functions->AllocObject(this,clazz);
+    }
+    jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args, methodID);
+        result = functions->NewObjectV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject NewObjectV(jclass clazz, jmethodID methodID,
+                       va_list args) {
+        return functions->NewObjectV(this,clazz,methodID,args);
+    }
+    jobject NewObjectA(jclass clazz, jmethodID methodID,
+                       const jvalue *args) {
+        return functions->NewObjectA(this,clazz,methodID,args);
+    }
+
+    jclass GetObjectClass(jobject obj) {
+        return functions->GetObjectClass(this,obj);
+    }
+    jboolean IsInstanceOf(jobject obj, jclass clazz) {
+        return functions->IsInstanceOf(this,obj,clazz);
+    }
+
+    jmethodID GetMethodID(jclass clazz, const char *name,
+                          const char *sig) {
+        return functions->GetMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallObjectMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallObjectMethodV(this,obj,methodID,args);
+    }
+    jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallObjectMethodA(this,obj,methodID,args);
+    }
+
+    jboolean CallBooleanMethod(jobject obj,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallBooleanMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+                                va_list args) {
+        return functions->CallBooleanMethodV(this,obj,methodID,args);
+    }
+    jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+                                const jvalue * args) {
+        return functions->CallBooleanMethodA(this,obj,methodID, args);
+    }
+
+    jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallByteMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallByteMethodV(this,obj,methodID,args);
+    }
+    jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallByteMethodA(this,obj,methodID,args);
+    }
+
+    jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallCharMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallCharMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallCharMethodV(this,obj,methodID,args);
+    }
+    jchar CallCharMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallCharMethodA(this,obj,methodID,args);
+    }
+
+    jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallShortMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallShortMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallShortMethodV(this,obj,methodID,args);
+    }
+    jshort CallShortMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallShortMethodA(this,obj,methodID,args);
+    }
+
+    jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallIntMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallIntMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallIntMethodV(this,obj,methodID,args);
+    }
+    jint CallIntMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallIntMethodA(this,obj,methodID,args);
+    }
+
+    jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallLongMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallLongMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallLongMethodV(this,obj,methodID,args);
+    }
+    jlong CallLongMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallLongMethodA(this,obj,methodID,args);
+    }
+
+    jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallFloatMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallFloatMethodV(this,obj,methodID,args);
+    }
+    jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallFloatMethodA(this,obj,methodID,args);
+    }
+
+    jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallDoubleMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallDoubleMethodV(this,obj,methodID,args);
+    }
+    jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallDoubleMethodA(this,obj,methodID,args);
+    }
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallVoidMethodV(this,obj,methodID,args);
+        va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID,
+                         va_list args) {
+        functions->CallVoidMethodV(this,obj,methodID,args);
+    }
+    void CallVoidMethodA(jobject obj, jmethodID methodID,
+                         const jvalue * args) {
+        functions->CallVoidMethodA(this,obj,methodID,args);
+    }
+
+    jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+                                         jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                         methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+                                          jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                       methodID,args);
+    }
+    jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+                                          jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+                                                       methodID, args);
+    }
+
+    jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                     methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                   methodID,args);
+    }
+    jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+                                  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+                                                   methodID,args);
+    }
+
+    jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      va_list args) {
+        return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      const jvalue * args) {
+        return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        va_list args) {
+        return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        const jvalue * args) {
+        return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+                                  jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+        va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   va_list args) {
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+    }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   const jvalue * args) {
+        functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+    }
+
+    jfieldID GetFieldID(jclass clazz, const char *name,
+                        const char *sig) {
+        return functions->GetFieldID(this,clazz,name,sig);
+    }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID) {
+        return functions->GetObjectField(this,obj,fieldID);
+    }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+        return functions->GetBooleanField(this,obj,fieldID);
+    }
+    jbyte GetByteField(jobject obj, jfieldID fieldID) {
+        return functions->GetByteField(this,obj,fieldID);
+    }
+    jchar GetCharField(jobject obj, jfieldID fieldID) {
+        return functions->GetCharField(this,obj,fieldID);
+    }
+    jshort GetShortField(jobject obj, jfieldID fieldID) {
+        return functions->GetShortField(this,obj,fieldID);
+    }
+    jint GetIntField(jobject obj, jfieldID fieldID) {
+        return functions->GetIntField(this,obj,fieldID);
+    }
+    jlong GetLongField(jobject obj, jfieldID fieldID) {
+        return functions->GetLongField(this,obj,fieldID);
+    }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+        return functions->GetFloatField(this,obj,fieldID);
+    }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+        return functions->GetDoubleField(this,obj,fieldID);
+    }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+        functions->SetObjectField(this,obj,fieldID,val);
+    }
+    void SetBooleanField(jobject obj, jfieldID fieldID,
+                         jboolean val) {
+        functions->SetBooleanField(this,obj,fieldID,val);
+    }
+    void SetByteField(jobject obj, jfieldID fieldID,
+                      jbyte val) {
+        functions->SetByteField(this,obj,fieldID,val);
+    }
+    void SetCharField(jobject obj, jfieldID fieldID,
+                      jchar val) {
+        functions->SetCharField(this,obj,fieldID,val);
+    }
+    void SetShortField(jobject obj, jfieldID fieldID,
+                       jshort val) {
+        functions->SetShortField(this,obj,fieldID,val);
+    }
+    void SetIntField(jobject obj, jfieldID fieldID,
+                     jint val) {
+        functions->SetIntField(this,obj,fieldID,val);
+    }
+    void SetLongField(jobject obj, jfieldID fieldID,
+                      jlong val) {
+        functions->SetLongField(this,obj,fieldID,val);
+    }
+    void SetFloatField(jobject obj, jfieldID fieldID,
+                       jfloat val) {
+        functions->SetFloatField(this,obj,fieldID,val);
+    }
+    void SetDoubleField(jobject obj, jfieldID fieldID,
+                        jdouble val) {
+        functions->SetDoubleField(this,obj,fieldID,val);
+    }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char *name,
+                                const char *sig) {
+        return functions->GetStaticMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+                             ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+                              va_list args) {
+        return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+    }
+    jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+                              const jvalue *args) {
+        return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+    }
+
+    jboolean CallStaticBooleanMethod(jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallStaticBooleanMethodV(jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+    }
+    jboolean CallStaticBooleanMethodA(jclass clazz,
+                                      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+    }
+
+    jbyte CallStaticByteMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallStaticByteMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+    }
+    jbyte CallStaticByteMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+    }
+
+    jchar CallStaticCharMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallStaticCharMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+    }
+    jchar CallStaticCharMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+    }
+
+    jshort CallStaticShortMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallStaticShortMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+    }
+    jshort CallStaticShortMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+    }
+
+    jint CallStaticIntMethod(jclass clazz,
+                             jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallStaticIntMethodV(jclass clazz,
+                              jmethodID methodID, va_list args) {
+        return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+    }
+    jint CallStaticIntMethodA(jclass clazz,
+                              jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+    }
+
+    jlong CallStaticLongMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallStaticLongMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+    }
+    jlong CallStaticLongMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+    }
+
+    jfloat CallStaticFloatMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallStaticFloatMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+    }
+    jfloat CallStaticFloatMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+    }
+
+    jdouble CallStaticDoubleMethod(jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallStaticDoubleMethodV(jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+    }
+    jdouble CallStaticDoubleMethodA(jclass clazz,
+                                    jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+    }
+
+    void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+        va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+                               va_list args) {
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+    }
+    void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+                               const jvalue * args) {
+        functions->CallStaticVoidMethodA(this,cls,methodID,args);
+    }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char *name,
+                              const char *sig) {
+        return functions->GetStaticFieldID(this,clazz,name,sig);
+    }
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticObjectField(this,clazz,fieldID);
+    }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticBooleanField(this,clazz,fieldID);
+    }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticByteField(this,clazz,fieldID);
+    }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticCharField(this,clazz,fieldID);
+    }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticShortField(this,clazz,fieldID);
+    }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticIntField(this,clazz,fieldID);
+    }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticLongField(this,clazz,fieldID);
+    }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticFloatField(this,clazz,fieldID);
+    }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticDoubleField(this,clazz,fieldID);
+    }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+                        jobject value) {
+      functions->SetStaticObjectField(this,clazz,fieldID,value);
+    }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+                        jboolean value) {
+      functions->SetStaticBooleanField(this,clazz,fieldID,value);
+    }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID,
+                        jbyte value) {
+      functions->SetStaticByteField(this,clazz,fieldID,value);
+    }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID,
+                        jchar value) {
+      functions->SetStaticCharField(this,clazz,fieldID,value);
+    }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID,
+                        jshort value) {
+      functions->SetStaticShortField(this,clazz,fieldID,value);
+    }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID,
+                        jint value) {
+      functions->SetStaticIntField(this,clazz,fieldID,value);
+    }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID,
+                        jlong value) {
+      functions->SetStaticLongField(this,clazz,fieldID,value);
+    }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+                        jfloat value) {
+      functions->SetStaticFloatField(this,clazz,fieldID,value);
+    }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+                        jdouble value) {
+      functions->SetStaticDoubleField(this,clazz,fieldID,value);
+    }
+
+    jstring NewString(const jchar *unicode, jsize len) {
+        return functions->NewString(this,unicode,len);
+    }
+    jsize GetStringLength(jstring str) {
+        return functions->GetStringLength(this,str);
+    }
+    const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringChars(this,str,isCopy);
+    }
+    void ReleaseStringChars(jstring str, const jchar *chars) {
+        functions->ReleaseStringChars(this,str,chars);
+    }
+
+    jstring NewStringUTF(const char *utf) {
+        return functions->NewStringUTF(this,utf);
+    }
+    jsize GetStringUTFLength(jstring str) {
+        return functions->GetStringUTFLength(this,str);
+    }
+    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringUTFChars(this,str,isCopy);
+    }
+    void ReleaseStringUTFChars(jstring str, const char* chars) {
+        functions->ReleaseStringUTFChars(this,str,chars);
+    }
+
+    jsize GetArrayLength(jarray array) {
+        return functions->GetArrayLength(this,array);
+    }
+
+    jobjectArray NewObjectArray(jsize len, jclass clazz,
+                                jobject init) {
+        return functions->NewObjectArray(this,len,clazz,init);
+    }
+    jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+        return functions->GetObjectArrayElement(this,array,index);
+    }
+    void SetObjectArrayElement(jobjectArray array, jsize index,
+                               jobject val) {
+        functions->SetObjectArrayElement(this,array,index,val);
+    }
+
+    jbooleanArray NewBooleanArray(jsize len) {
+        return functions->NewBooleanArray(this,len);
+    }
+    jbyteArray NewByteArray(jsize len) {
+        return functions->NewByteArray(this,len);
+    }
+    jcharArray NewCharArray(jsize len) {
+        return functions->NewCharArray(this,len);
+    }
+    jshortArray NewShortArray(jsize len) {
+        return functions->NewShortArray(this,len);
+    }
+    jintArray NewIntArray(jsize len) {
+        return functions->NewIntArray(this,len);
+    }
+    jlongArray NewLongArray(jsize len) {
+        return functions->NewLongArray(this,len);
+    }
+    jfloatArray NewFloatArray(jsize len) {
+        return functions->NewFloatArray(this,len);
+    }
+    jdoubleArray NewDoubleArray(jsize len) {
+        return functions->NewDoubleArray(this,len);
+    }
+
+    jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+        return functions->GetBooleanArrayElements(this,array,isCopy);
+    }
+    jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+        return functions->GetByteArrayElements(this,array,isCopy);
+    }
+    jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+        return functions->GetCharArrayElements(this,array,isCopy);
+    }
+    jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+        return functions->GetShortArrayElements(this,array,isCopy);
+    }
+    jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+        return functions->GetIntArrayElements(this,array,isCopy);
+    }
+    jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+        return functions->GetLongArrayElements(this,array,isCopy);
+    }
+    jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+        return functions->GetFloatArrayElements(this,array,isCopy);
+    }
+    jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+        return functions->GetDoubleArrayElements(this,array,isCopy);
+    }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array,
+                                     jboolean *elems,
+                                     jint mode) {
+        functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+    }
+    void ReleaseByteArrayElements(jbyteArray array,
+                                  jbyte *elems,
+                                  jint mode) {
+        functions->ReleaseByteArrayElements(this,array,elems,mode);
+    }
+    void ReleaseCharArrayElements(jcharArray array,
+                                  jchar *elems,
+                                  jint mode) {
+        functions->ReleaseCharArrayElements(this,array,elems,mode);
+    }
+    void ReleaseShortArrayElements(jshortArray array,
+                                   jshort *elems,
+                                   jint mode) {
+        functions->ReleaseShortArrayElements(this,array,elems,mode);
+    }
+    void ReleaseIntArrayElements(jintArray array,
+                                 jint *elems,
+                                 jint mode) {
+        functions->ReleaseIntArrayElements(this,array,elems,mode);
+    }
+    void ReleaseLongArrayElements(jlongArray array,
+                                  jlong *elems,
+                                  jint mode) {
+        functions->ReleaseLongArrayElements(this,array,elems,mode);
+    }
+    void ReleaseFloatArrayElements(jfloatArray array,
+                                   jfloat *elems,
+                                   jint mode) {
+        functions->ReleaseFloatArrayElements(this,array,elems,mode);
+    }
+    void ReleaseDoubleArrayElements(jdoubleArray array,
+                                    jdouble *elems,
+                                    jint mode) {
+        functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+    }
+
+    void GetBooleanArrayRegion(jbooleanArray array,
+                               jsize start, jsize len, jboolean *buf) {
+        functions->GetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void GetByteArrayRegion(jbyteArray array,
+                            jsize start, jsize len, jbyte *buf) {
+        functions->GetByteArrayRegion(this,array,start,len,buf);
+    }
+    void GetCharArrayRegion(jcharArray array,
+                            jsize start, jsize len, jchar *buf) {
+        functions->GetCharArrayRegion(this,array,start,len,buf);
+    }
+    void GetShortArrayRegion(jshortArray array,
+                             jsize start, jsize len, jshort *buf) {
+        functions->GetShortArrayRegion(this,array,start,len,buf);
+    }
+    void GetIntArrayRegion(jintArray array,
+                           jsize start, jsize len, jint *buf) {
+        functions->GetIntArrayRegion(this,array,start,len,buf);
+    }
+    void GetLongArrayRegion(jlongArray array,
+                            jsize start, jsize len, jlong *buf) {
+        functions->GetLongArrayRegion(this,array,start,len,buf);
+    }
+    void GetFloatArrayRegion(jfloatArray array,
+                             jsize start, jsize len, jfloat *buf) {
+        functions->GetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void GetDoubleArrayRegion(jdoubleArray array,
+                              jsize start, jsize len, jdouble *buf) {
+        functions->GetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+                               const jboolean *buf) {
+        functions->SetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+                            const jbyte *buf) {
+        functions->SetByteArrayRegion(this,array,start,len,buf);
+    }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+                            const jchar *buf) {
+        functions->SetCharArrayRegion(this,array,start,len,buf);
+    }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+                             const jshort *buf) {
+        functions->SetShortArrayRegion(this,array,start,len,buf);
+    }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+                           const jint *buf) {
+        functions->SetIntArrayRegion(this,array,start,len,buf);
+    }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+                            const jlong *buf) {
+        functions->SetLongArrayRegion(this,array,start,len,buf);
+    }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+                             const jfloat *buf) {
+        functions->SetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+                              const jdouble *buf) {
+        functions->SetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+                         jint nMethods) {
+        return functions->RegisterNatives(this,clazz,methods,nMethods);
+    }
+    jint UnregisterNatives(jclass clazz) {
+        return functions->UnregisterNatives(this,clazz);
+    }
+
+    jint MonitorEnter(jobject obj) {
+        return functions->MonitorEnter(this,obj);
+    }
+    jint MonitorExit(jobject obj) {
+        return functions->MonitorExit(this,obj);
+    }
+
+    jint GetJavaVM(JavaVM **vm) {
+        return functions->GetJavaVM(this,vm);
+    }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+        functions->GetStringRegion(this,str,start,len,buf);
+    }
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+        functions->GetStringUTFRegion(this,str,start,len,buf);
+    }
+
+    void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+        return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+    }
+    void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+        functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+    }
+
+    const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+        return functions->GetStringCritical(this,string,isCopy);
+    }
+    void ReleaseStringCritical(jstring string, const jchar *cstring) {
+        functions->ReleaseStringCritical(this,string,cstring);
+    }
+
+    jweak NewWeakGlobalRef(jobject obj) {
+        return functions->NewWeakGlobalRef(this,obj);
+    }
+    void DeleteWeakGlobalRef(jweak ref) {
+        functions->DeleteWeakGlobalRef(this,ref);
+    }
+
+    jboolean ExceptionCheck() {
+        return functions->ExceptionCheck(this);
+    }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity) {
+        return functions->NewDirectByteBuffer(this, address, capacity);
+    }
+    void* GetDirectBufferAddress(jobject buf) {
+        return functions->GetDirectBufferAddress(this, buf);
+    }
+    jlong GetDirectBufferCapacity(jobject buf) {
+        return functions->GetDirectBufferCapacity(this, buf);
+    }
+    jobjectRefType GetObjectRefType(jobject obj) {
+        return functions->GetObjectRefType(this, obj);
+    }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+    char *optionString;
+    void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint version;
+
+    jint nOptions;
+    JavaVMOption *options;
+    jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+    jint version;
+
+    char *name;
+    jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+    jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+    jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+    jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+    jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+    const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint DestroyJavaVM() {
+        return functions->DestroyJavaVM(this);
+    }
+    jint AttachCurrentThread(void **penv, void *args) {
+        return functions->AttachCurrentThread(this, penv, args);
+    }
+    jint DetachCurrentThread() {
+        return functions->DetachCurrentThread(this);
+    }
+
+    jint GetEnv(void **penv, jint version) {
+        return functions->GetEnv(this, penv, version);
+    }
+    jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+        return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+    }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+#define JNI_VERSION_1_8 0x00010008
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
diff --git a/third_party/ntcore_2018/src/arm-linux-jni/linux/jni_md.h b/third_party/ntcore_2018/src/arm-linux-jni/linux/jni_md.h
new file mode 100644
index 0000000..80eedf3
--- /dev/null
+++ b/third_party/ntcore_2018/src/arm-linux-jni/linux/jni_md.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#ifndef __has_attribute
+  #define __has_attribute(x) 0
+#endif
+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility)
+  #define JNIEXPORT     __attribute__((visibility("default")))
+  #define JNIIMPORT     __attribute__((visibility("default")))
+#else
+  #define JNIEXPORT
+  #define JNIIMPORT
+#endif
+
+#define JNICALL
+
+typedef int jint;
+#ifdef _LP64 /* 64-bit Solaris */
+typedef long jlong;
+#else
+typedef long long jlong;
+#endif
+
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
diff --git a/third_party/ntcore_2018/src/dev/java/edu/wpi/first/ntcore/DevMain.java b/third_party/ntcore_2018/src/dev/java/edu/wpi/first/ntcore/DevMain.java
new file mode 100644
index 0000000..f1a69e6
--- /dev/null
+++ b/third_party/ntcore_2018/src/dev/java/edu/wpi/first/ntcore/DevMain.java
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.ntcore;
+
+import edu.wpi.first.networktables.NetworkTablesJNI;
+import edu.wpi.first.wpiutil.RuntimeDetector;
+
+public class DevMain {
+    public static void main(String[] args) {
+        System.out.println("Hello World!");
+        System.out.println(RuntimeDetector.getPlatformPath());
+        NetworkTablesJNI.flush(NetworkTablesJNI.getDefaultInstance());
+    }
+}
diff --git a/third_party/ntcore_2018/src/dev/native/cpp/main.cpp b/third_party/ntcore_2018/src/dev/native/cpp/main.cpp
new file mode 100644
index 0000000..1bf33f9
--- /dev/null
+++ b/third_party/ntcore_2018/src/dev/native/cpp/main.cpp
@@ -0,0 +1,18 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "ntcore.h"
+
+int main() {
+  auto myValue = nt::GetEntry(nt::GetDefaultInstance(), "MyValue");
+
+  nt::SetEntryValue(myValue, nt::Value::MakeString("Hello World"));
+
+  std::cout << nt::GetEntryValue(myValue)->GetString() << std::endl;
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/ConnectionInfo.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/ConnectionInfo.java
new file mode 100644
index 0000000..045a412
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/ConnectionInfo.java
@@ -0,0 +1,57 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables Connection information.
+ */
+public final class ConnectionInfo {
+  /**
+   * The remote identifier (as set on the remote node by
+   * {@link NetworkTableInstance#setNetworkIdentity(String)}).
+   */
+  public final String remote_id;
+
+  /**
+   * The IP address of the remote node.
+   */
+  public final String remote_ip;
+
+  /**
+   * The port number of the remote node.
+   */
+  public final int remote_port;
+
+  /**
+   * The last time any update was received from the remote node (same scale as
+   * returned by {@link NetworkTablesJNI#now()}).
+   */
+  public final long last_update;
+
+  /**
+   * The protocol version being used for this connection.  This is in protocol
+   * layer format, so 0x0200 = 2.0, 0x0300 = 3.0).
+   */
+  public final int protocol_version;
+
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param remote_id Remote identifier
+   * @param remote_ip Remote IP address
+   * @param remote_port Remote port number
+   * @param last_update Last time an update was received
+   * @param protocol_version The protocol version used for the connection
+   */
+  public ConnectionInfo(String remote_id, String remote_ip, int remote_port, long last_update, int protocol_version) {
+    this.remote_id = remote_id;
+    this.remote_ip = remote_ip;
+    this.remote_port = remote_port;
+    this.last_update = last_update;
+    this.protocol_version = protocol_version;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/ConnectionNotification.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/ConnectionNotification.java
new file mode 100644
index 0000000..06dea88
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/ConnectionNotification.java
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables Connection notification.
+ */
+public final class ConnectionNotification {
+  /**
+   *  Listener that was triggered.
+   */
+  public final int listener;
+
+  /**
+   * True if event is due to connection being established.
+   */
+  public final boolean connected;
+
+  /**
+   * Connection information.
+   */
+  public final ConnectionInfo conn;
+
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param inst Instance
+   * @param listener Listener that was triggered
+   * @param connected Connected if true
+   * @param conn Connection information
+   */
+  public ConnectionNotification(NetworkTableInstance inst, int listener, boolean connected, ConnectionInfo conn) {
+    this.inst = inst;
+    this.listener = listener;
+    this.connected = connected;
+    this.conn = conn;
+  }
+
+  private final NetworkTableInstance inst;
+
+  public NetworkTableInstance getInstance() {
+    return inst;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryInfo.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryInfo.java
new file mode 100644
index 0000000..8b7d8f2
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryInfo.java
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables Entry information.
+ */
+public final class EntryInfo {
+  /** Entry handle. */
+  public final int entry;
+
+  /** Entry name. */
+  public final String name;
+
+  /** Entry type. */
+  public final NetworkTableType type;
+
+  /** Entry flags. */
+  public final int flags;
+
+  /** Timestamp of last change to entry (type or value). */
+  public final long last_change;
+
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param inst Instance
+   * @param entry Entry handle
+   * @param name Name
+   * @param type Type (integer version of {@link NetworkTableType})
+   * @param flags Flags
+   * @param last_change Timestamp of last change
+   */
+  public EntryInfo(NetworkTableInstance inst, int entry, String name, int type, int flags, long last_change) {
+    this.inst = inst;
+    this.entry = entry;
+    this.name = name;
+    this.type = NetworkTableType.getFromInt(type);
+    this.flags = flags;
+    this.last_change = last_change;
+  }
+
+  /* Network table instance. */
+  private final NetworkTableInstance inst;
+
+  /* Cached entry object. */
+  private NetworkTableEntry entryObject;
+
+  /**
+   * Get the entry as an object.
+   * @return NetworkTableEntry for this entry.
+   */
+  NetworkTableEntry getEntry() {
+    if (entryObject == null) {
+      entryObject = new NetworkTableEntry(inst, entry);
+    }
+    return entryObject;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryListenerFlags.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryListenerFlags.java
new file mode 100644
index 0000000..4adc976
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryListenerFlags.java
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * Flag values for use with entry listeners.
+ *
+ * The flags are a bitmask and must be OR'ed together to indicate the
+ * combination of events desired to be received.
+ *
+ * The constants kNew, kDelete, kUpdate, and kFlags represent different events
+ * that can occur to entries.
+ *
+ * By default, notifications are only generated for remote changes occurring
+ * after the listener is created.  The constants kImmediate and kLocal are
+ * modifiers that cause notifications to be generated at other times.
+ */
+public interface EntryListenerFlags {
+  /** Initial listener addition.
+   * Set this flag to receive immediate notification of entries matching the
+   * flag criteria (generally only useful when combined with kNew).
+   */
+  public static final int kImmediate = 0x01;
+
+  /** Changed locally.
+   * Set this flag to receive notification of both local changes and changes
+   * coming from remote nodes.  By default, notifications are only generated
+   * for remote changes.  Must be combined with some combination of kNew,
+   * kDelete, kUpdate, and kFlags to receive notifications of those respective
+   * events.
+   */
+  public static final int kLocal = 0x02;
+
+  /** Newly created entry.
+   * Set this flag to receive a notification when an entry is created.
+   */
+  public static final int kNew = 0x04;
+
+  /** Entry was deleted.
+   * Set this flag to receive a notification when an entry is deleted.
+   */
+  public static final int kDelete = 0x08;
+
+  /** Entry's value changed.
+   * Set this flag to receive a notification when an entry's value (or type)
+   * changes.
+   */
+  public static final int kUpdate = 0x10;
+
+  /** Entry's flags changed.
+   * Set this flag to receive a notification when an entry's flags value
+   * changes.
+   */
+  public static final int kFlags = 0x20;
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryNotification.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryNotification.java
new file mode 100644
index 0000000..10aa783
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/EntryNotification.java
@@ -0,0 +1,74 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables Entry notification.
+ */
+public final class EntryNotification {
+  /**
+   * Listener that was triggered.
+   */
+  public final int listener;
+
+  /**
+   * Entry handle.
+   */
+  public final int entry;
+
+  /**
+   * Entry name.
+   */
+  public final String name;
+
+  /**
+   * The new value.
+   */
+  public final NetworkTableValue value;
+
+  /**
+   * Update flags.  For example, {@link EntryListenerFlags#kNew} if the key did
+   * not previously exist.
+   */
+  public final int flags;
+
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param inst Instance
+   * @param listener Listener that was triggered
+   * @param entry Entry handle
+   * @param name Entry name
+   * @param value The new value
+   * @param flags Update flags
+   */
+  public EntryNotification(NetworkTableInstance inst, int listener, int entry, String name, NetworkTableValue value, int flags) {
+    this.inst = inst;
+    this.listener = listener;
+    this.entry = entry;
+    this.name = name;
+    this.value = value;
+    this.flags = flags;
+  }
+
+  /* Network table instance. */
+  private final NetworkTableInstance inst;
+
+  /* Cached entry object. */
+  NetworkTableEntry entryObject;
+
+  /**
+   * Get the entry as an object.
+   * @return NetworkTableEntry for this entry.
+   */
+  public NetworkTableEntry getEntry() {
+    if (entryObject == null) {
+      entryObject = new NetworkTableEntry(inst, entry);
+    }
+    return entryObject;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/LogMessage.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/LogMessage.java
new file mode 100644
index 0000000..e88a92d
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/LogMessage.java
@@ -0,0 +1,75 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables log message.
+ */
+public final class LogMessage {
+  /**
+   * Logging levels.
+   */
+  public static final int kCritical = 50;
+  public static final int kError = 40;
+  public static final int kWarning = 30;
+  public static final int kInfo = 20;
+  public static final int kDebug = 10;
+  public static final int kDebug1 = 9;
+  public static final int kDebug2 = 8;
+  public static final int kDebug3 = 7;
+  public static final int kDebug4 = 6;
+
+  /**
+   * The logger that generated the message.
+   */
+  public final int logger;
+
+  /**
+   * Log level of the message.
+   */
+  public final int level;
+
+  /**
+   * The filename of the source file that generated the message.
+   */
+  public final String filename;
+
+  /**
+   * The line number in the source file that generated the message.
+   */
+  public final int line;
+
+  /**
+   * The message.
+   */
+  public final String message;
+
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param inst Instance
+   * @param logger Logger
+   * @param level Log level
+   * @param filename Filename
+   * @param line Line number
+   * @param message Message
+   */
+  public LogMessage(NetworkTableInstance inst, int logger, int level, String filename, int line, String message) {
+    this.inst = inst;
+    this.logger = logger;
+    this.level = level;
+    this.filename = filename;
+    this.line = line;
+    this.message = message;
+  }
+
+  private final NetworkTableInstance inst;
+
+  NetworkTableInstance getInstance() {
+    return inst;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTable.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTable.java
new file mode 100644
index 0000000..cbae27b
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTable.java
@@ -0,0 +1,396 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.function.Consumer;
+
+/**
+ * A network table that knows its subtable path.
+ */
+public final class NetworkTable {
+  /**
+   * The path separator for sub-tables and keys
+   *
+   */
+  public static final char PATH_SEPARATOR = '/';
+
+  private final String path;
+  private final String pathWithSep;
+  private final NetworkTableInstance inst;
+
+  /**
+   * Gets the "base name" of a key. For example, "/foo/bar" becomes "bar".
+   * If the key has a trailing slash, returns an empty string.
+   * @param key key
+   * @return base name
+   */
+  public static String basenameKey(String key) {
+    final int slash = key.lastIndexOf(PATH_SEPARATOR);
+    if (slash == -1) {
+      return key;
+    }
+    return key.substring(slash + 1);
+  }
+
+  /**
+   * Normalizes an network table key to contain no consecutive slashes and
+   * optionally start with a leading slash. For example:
+   *
+   * <pre><code>
+   * normalizeKey("/foo/bar", true)  == "/foo/bar"
+   * normalizeKey("foo/bar", true)   == "/foo/bar"
+   * normalizeKey("/foo/bar", false) == "foo/bar"
+   * normalizeKey("foo//bar", false) == "foo/bar"
+   * </code></pre>
+   *
+   * @param key              the key to normalize
+   * @param withLeadingSlash whether or not the normalized key should begin
+   *                         with a leading slash
+   * @return normalized key
+   */
+  public static String normalizeKey(String key, boolean withLeadingSlash) {
+    String normalized;
+    if (withLeadingSlash) {
+      normalized = PATH_SEPARATOR + key;
+    } else {
+      normalized = key;
+    }
+    normalized = normalized.replaceAll(PATH_SEPARATOR + "{2,}", String.valueOf(PATH_SEPARATOR));
+
+    if (!withLeadingSlash && normalized.charAt(0) == PATH_SEPARATOR) {
+      // remove leading slash, if present
+      normalized = normalized.substring(1);
+    }
+    return normalized;
+  }
+
+  /**
+   * Normalizes a network table key to start with exactly one leading slash
+   * ("/") and contain no consecutive slashes. For example,
+   * {@code "//foo/bar/"} becomes {@code "/foo/bar/"} and
+   * {@code "///a/b/c"} becomes {@code "/a/b/c"}.
+   *
+   * <p>This is equivalent to {@code normalizeKey(key, true)}
+   *
+   * @param key the key to normalize
+   * @return normalized key
+   */
+  public static String normalizeKey(String key) {
+    return normalizeKey(key, true);
+  }
+
+  /**
+   * Gets a list of the names of all the super tables of a given key. For
+   * example, the key "/foo/bar/baz" has a hierarchy of "/", "/foo",
+   * "/foo/bar", and "/foo/bar/baz".
+   * @param key the key
+   * @return List of super tables
+   */
+  public static List<String> getHierarchy(String key) {
+    final String normal = normalizeKey(key, true);
+    List<String> hierarchy = new ArrayList<>();
+    if (normal.length() == 1) {
+      hierarchy.add(normal);
+      return hierarchy;
+    }
+    for (int i = 1; ; i = normal.indexOf(PATH_SEPARATOR, i + 1)) {
+      if (i == -1) {
+        // add the full key
+        hierarchy.add(normal);
+        break;
+      } else {
+        hierarchy.add(normal.substring(0, i));
+      }
+    }
+    return hierarchy;
+  }
+
+  /**
+   * Constructor.  Use NetworkTableInstance.getTable() or getSubTable() instead.
+   */
+  NetworkTable(NetworkTableInstance inst, String path) {
+    this.path = path;
+    this.pathWithSep = path + PATH_SEPARATOR;
+    this.inst = inst;
+  }
+
+  /**
+   * Gets the instance for the table.
+   * @return Instance
+   */
+  public NetworkTableInstance getInstance() { return inst; }
+
+  public String toString() { return "NetworkTable: " + path; }
+
+  private final ConcurrentMap<String, NetworkTableEntry> entries = new ConcurrentHashMap<String, NetworkTableEntry>();
+
+  /**
+   * Gets the entry for a subkey.
+   * @param key the key name
+   * @return Network table entry.
+   */
+  public NetworkTableEntry getEntry(String key) {
+    NetworkTableEntry entry = entries.get(key);
+    if (entry == null) {
+      entry = inst.getEntry(pathWithSep + key);
+      entries.putIfAbsent(key, entry);
+    }
+    return entry;
+  }
+
+  /**
+   * Listen to keys only within this table.
+   * @param listener    listener to add
+   * @param flags       {@link EntryListenerFlags} bitmask
+   * @return Listener handle
+   */
+  public int addEntryListener(TableEntryListener listener, int flags) {
+    final int prefixLen = path.length() + 1;
+    return inst.addEntryListener(pathWithSep, (event) -> {
+      String relativeKey = event.name.substring(prefixLen);
+      if (relativeKey.indexOf(PATH_SEPARATOR) != -1)  // part of a subtable
+        return;
+      listener.valueChanged(this, relativeKey, event.getEntry(), event.value, event.flags);
+    }, flags);
+  }
+
+  /**
+   * Listen to a single key.
+   * @param key         the key name
+   * @param listener    listener to add
+   * @param flags       {@link EntryListenerFlags} bitmask
+   * @return Listener handle
+   */
+  public int addEntryListener(String key, TableEntryListener listener, int flags) {
+    final NetworkTableEntry entry = getEntry(key);
+    return inst.addEntryListener(entry, (event) -> {
+      listener.valueChanged(this, key, entry, event.value, event.flags);
+    }, flags);
+  }
+
+  /**
+   * Remove an entry listener.
+   * @param listener    listener handle
+   */
+  public void removeEntryListener(int listener) {
+    inst.removeEntryListener(listener);
+  }
+
+  /**
+   * Listen for sub-table creation.
+   * This calls the listener once for each newly created sub-table.
+   * It immediately calls the listener for any existing sub-tables.
+   * @param listener        listener to add
+   * @param localNotify     notify local changes as well as remote
+   * @return Listener handle
+   */
+  public int addSubTableListener(TableListener listener, boolean localNotify) {
+    int flags = EntryListenerFlags.kNew | EntryListenerFlags.kImmediate;
+    if (localNotify)
+      flags |= EntryListenerFlags.kLocal;
+
+    final int prefixLen = path.length() + 1;
+    final NetworkTable parent = this;
+
+    return inst.addEntryListener(pathWithSep, new Consumer<EntryNotification>() {
+      final Set<String> notifiedTables = new HashSet<String>();
+
+      @Override
+      public void accept(EntryNotification event) {
+        String relativeKey = event.name.substring(prefixLen);
+        int endSubTable = relativeKey.indexOf(PATH_SEPARATOR);
+        if (endSubTable == -1)
+          return;
+        String subTableKey = relativeKey.substring(0, endSubTable);
+        if (notifiedTables.contains(subTableKey))
+          return;
+        notifiedTables.add(subTableKey);
+        listener.tableCreated(parent, subTableKey, parent.getSubTable(subTableKey));
+      }
+    }, flags);
+  }
+
+  /**
+   * Remove a sub-table listener.
+   * @param listener    listener handle
+   */
+  public void removeTableListener(int listener) {
+    inst.removeEntryListener(listener);
+  }
+
+  /**
+   * Returns the table at the specified key. If there is no table at the
+   * specified key, it will create a new table
+   *
+   * @param key the name of the table relative to this one
+   * @return a sub table relative to this one
+   */
+  public NetworkTable getSubTable(String key) {
+    return new NetworkTable(inst, pathWithSep + key);
+  }
+
+  /**
+   * Checks the table and tells if it contains the specified key
+   *
+   * @param key the key to search for
+   * @return true if the table as a value assigned to the given key
+   */
+  public boolean containsKey(String key) {
+    return !("".equals(key)) && getEntry(key).exists();
+  }
+
+  /**
+   * @param key the key to search for
+   * @return true if there is a subtable with the key which contains at least
+   * one key/subtable of its own
+   */
+  public boolean containsSubTable(String key) {
+    int[] handles = NetworkTablesJNI.getEntries(inst.getHandle(), pathWithSep + key + PATH_SEPARATOR, 0);
+    return handles.length != 0;
+  }
+
+  /**
+   * Gets all keys in the table (not including sub-tables).
+   * @param types bitmask of types; 0 is treated as a "don't care".
+   * @return keys currently in the table
+   */
+  public Set<String> getKeys(int types) {
+    Set<String> keys = new HashSet<String>();
+    int prefixLen = path.length() + 1;
+    for (EntryInfo info : inst.getEntryInfo(pathWithSep, types)) {
+      String relativeKey = info.name.substring(prefixLen);
+      if (relativeKey.indexOf(PATH_SEPARATOR) != -1)
+        continue;
+      keys.add(relativeKey);
+      // populate entries as we go
+      if (entries.get(relativeKey) == null) {
+        entries.putIfAbsent(relativeKey, new NetworkTableEntry(inst, info.entry));
+      }
+    }
+    return keys;
+  }
+
+  /**
+   * Gets all keys in the table (not including sub-tables).
+   * @return keys currently in the table
+   */
+  public Set<String> getKeys() {
+    return getKeys(0);
+  }
+
+  /**
+   * Gets the names of all subtables in the table.
+   * @return subtables currently in the table
+   */
+  public Set<String> getSubTables() {
+    Set<String> keys = new HashSet<String>();
+    int prefixLen = path.length() + 1;
+    for (EntryInfo info : inst.getEntryInfo(pathWithSep, 0)) {
+      String relativeKey = info.name.substring(prefixLen);
+      int endSubTable = relativeKey.indexOf(PATH_SEPARATOR);
+      if (endSubTable == -1)
+        continue;
+      keys.add(relativeKey.substring(0, endSubTable));
+    }
+    return keys;
+  }
+
+  /**
+   * Deletes the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   */
+  public void delete(String key) {
+    getEntry(key).delete();
+  }
+
+  /**
+   * Put a value in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  boolean putValue(String key, NetworkTableValue value) {
+    return getEntry(key).setValue(value);
+  }
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  boolean setDefaultValue(String key, NetworkTableValue defaultValue) {
+    return getEntry(key).setDefaultValue(defaultValue);
+  }
+
+  /**
+   * Gets the value associated with a key as an object
+   *
+   * @param key the key of the value to look up
+   * @return the value associated with the given key, or nullptr if the key
+   * does not exist
+   */
+  NetworkTableValue getValue(String key) {
+    return getEntry(key).getValue();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public String getPath() {
+    return path;
+  }
+
+  /**
+   * Save table values to a file.  The file format used is identical to
+   * that used for SavePersistent.
+   * @param filename  filename
+   * @throws PersistentException if error saving file
+   */
+  public void saveEntries(String filename) throws PersistentException {
+    inst.saveEntries(filename, pathWithSep);
+  }
+
+  /**
+   * Load table values from a file.  The file format used is identical to
+   * that used for SavePersistent / LoadPersistent.
+   * @param filename  filename
+   * @return List of warnings (errors result in an exception instead)
+   * @throws PersistentException if error saving file
+   */
+  public String[] loadEntries(String filename) throws PersistentException {
+    return inst.loadEntries(filename, pathWithSep);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (!(o instanceof NetworkTable)) {
+      return false;
+    }
+    NetworkTable other = (NetworkTable) o;
+    return inst.equals(other.inst) && path.equals(other.path);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(inst, path);
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableEntry.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableEntry.java
new file mode 100644
index 0000000..3e314be
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableEntry.java
@@ -0,0 +1,781 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.nio.ByteBuffer;
+import java.util.function.Consumer;
+
+/**
+ * NetworkTables Entry
+ */
+public final class NetworkTableEntry {
+  /**
+   * Flag values (as returned by {@link #getFlags()}).
+   */
+  public static final int kPersistent = 0x01;
+
+  /**
+   * Construct from native handle.
+   * @param inst Instance
+   * @param handle Native handle
+   */
+  public NetworkTableEntry(NetworkTableInstance inst, int handle) {
+    m_inst = inst;
+    m_handle = handle;
+  }
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  public boolean isValid() {
+    return m_handle != 0;
+  }
+
+  /**
+   * Gets the native handle for the entry.
+   * @return Native handle
+   */
+  public int getHandle() {
+    return m_handle;
+  }
+
+  /**
+   * Gets the instance for the entry.
+   * @return Instance
+   */
+  public NetworkTableInstance getInstance() {
+    return m_inst;
+  }
+
+  /**
+   * Determines if the entry currently exists.
+   * @return True if the entry exists, false otherwise.
+   */
+  public boolean exists() {
+    return NetworkTablesJNI.getType(m_handle) != 0;
+  }
+
+  /**
+   * Gets the name of the entry (the key).
+   * @return the entry's name
+   */
+  public String getName() {
+    return NetworkTablesJNI.getEntryName(m_handle);
+  }
+
+  /**
+   * Gets the type of the entry.
+   * @return the entry's type
+   */
+  public NetworkTableType getType() {
+    return NetworkTableType.getFromInt(NetworkTablesJNI.getType(m_handle));
+  }
+
+  /**
+   * Returns the flags.
+   * @return the flags (bitmask)
+   */
+  public int getFlags() {
+    return NetworkTablesJNI.getEntryFlags(m_handle);
+  }
+
+  /**
+   * Gets the last time the entry's value was changed.
+   * @return Entry last change time
+   */
+  public long getLastChange() {
+    return NetworkTablesJNI.getEntryLastChange(m_handle);
+  }
+
+  /**
+   * Gets combined information about the entry.
+   * @return Entry information
+   */
+  public EntryInfo getInfo() {
+    return NetworkTablesJNI.getEntryInfoHandle(m_inst, m_handle);
+  }
+
+  /**
+   * Gets the entry's value.
+   * Returns a value with type NetworkTableType.kUnassigned if the value
+   * does not exist.
+   * @return the entry's value
+   */
+  public NetworkTableValue getValue() {
+    return NetworkTablesJNI.getValue(m_handle);
+  }
+
+  /**
+   * Gets the entry's value as a boolean. If the entry does not exist or is of
+   * different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public boolean getBoolean(boolean defaultValue) {
+    return NetworkTablesJNI.getBoolean(m_handle, defaultValue);
+  }
+
+  /**
+   * Gets the entry's value as a double. If the entry does not exist or is of
+   * different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public double getDouble(double defaultValue) {
+    return NetworkTablesJNI.getDouble(m_handle, defaultValue);
+  }
+
+  /**
+   * Gets the entry's value as a double. If the entry does not exist or is of
+   * different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public Number getNumber(Number defaultValue) {
+    return NetworkTablesJNI.getDouble(m_handle, defaultValue.doubleValue());
+  }
+
+  /**
+   * Gets the entry's value as a string. If the entry does not exist or is of
+   * different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public String getString(String defaultValue) {
+    return NetworkTablesJNI.getString(m_handle, defaultValue);
+  }
+
+  /**
+   * Gets the entry's value as a raw value (byte array). If the entry does not
+   * exist or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public byte[] getRaw(byte[] defaultValue) {
+    return NetworkTablesJNI.getRaw(m_handle, defaultValue);
+  }
+
+  /**
+   * Gets the entry's value as a boolean array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public boolean[] getBooleanArray(boolean[] defaultValue) {
+    return NetworkTablesJNI.getBooleanArray(m_handle, defaultValue);
+  }
+
+  /**
+   * Gets the entry's value as a boolean array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public Boolean[] getBooleanArray(Boolean[] defaultValue) {
+    return NetworkTableValue.fromNative(NetworkTablesJNI.getBooleanArray(m_handle, NetworkTableValue.toNative(defaultValue)));
+  }
+
+  /**
+   * Gets the entry's value as a double array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public double[] getDoubleArray(double[] defaultValue) {
+    return NetworkTablesJNI.getDoubleArray(m_handle, defaultValue);
+  }
+
+  /**
+   * Gets the entry's value as a double array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public Double[] getDoubleArray(Double[] defaultValue) {
+    return NetworkTableValue.fromNative(NetworkTablesJNI.getDoubleArray(m_handle, NetworkTableValue.toNative(defaultValue)));
+  }
+
+  /**
+   * Gets the entry's value as a double array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public Number[] getNumberArray(Number[] defaultValue) {
+    return NetworkTableValue.fromNative(NetworkTablesJNI.getDoubleArray(m_handle, NetworkTableValue.toNative(defaultValue)));
+  }
+
+  /**
+   * Gets the entry's value as a string array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  public String[] getStringArray(String[] defaultValue) {
+    return NetworkTablesJNI.getStringArray(m_handle, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   * @throws IllegalArgumentException if the value is not a known type
+   */
+  public boolean setDefaultValue(Object defaultValue) {
+    if (defaultValue instanceof NetworkTableValue) {
+      long time = ((NetworkTableValue)defaultValue).getTime();
+      Object o = ((NetworkTableValue)defaultValue).getValue();
+      switch (((NetworkTableValue)defaultValue).getType()) {
+        case kBoolean:
+          return NetworkTablesJNI.setDefaultBoolean(m_handle, time, ((Boolean)o).booleanValue());
+        case kDouble:
+          return NetworkTablesJNI.setDefaultDouble(m_handle, time, ((Number)o).doubleValue());
+        case kString:
+          return NetworkTablesJNI.setDefaultString(m_handle, time, (String)o);
+        case kRaw:
+          return NetworkTablesJNI.setDefaultRaw(m_handle, time, (byte[])o);
+        case kBooleanArray:
+          return NetworkTablesJNI.setDefaultBooleanArray(m_handle, time, (boolean[])o);
+        case kDoubleArray:
+          return NetworkTablesJNI.setDefaultDoubleArray(m_handle, time, (double[])o);
+        case kStringArray:
+          return NetworkTablesJNI.setDefaultStringArray(m_handle, time, (String[])o);
+        case kRpc:
+          // TODO
+        default:
+          return true;
+      }
+    } else if (defaultValue instanceof Boolean) {
+      return setDefaultBoolean((Boolean)defaultValue);
+    } else if (defaultValue instanceof Number) {
+      return setDefaultNumber((Number)defaultValue);
+    } else if (defaultValue instanceof String) {
+      return setDefaultString((String)defaultValue);
+    } else if (defaultValue instanceof byte[]) {
+      return setDefaultRaw((byte[])defaultValue);
+    } else if (defaultValue instanceof boolean[]) {
+      return setDefaultBooleanArray((boolean[])defaultValue);
+    } else if (defaultValue instanceof double[]) {
+      return setDefaultDoubleArray((double[])defaultValue);
+    } else if (defaultValue instanceof Boolean[]) {
+      return setDefaultBooleanArray((Boolean[])defaultValue);
+    } else if (defaultValue instanceof Number[]) {
+      return setDefaultNumberArray((Number[])defaultValue);
+    } else if (defaultValue instanceof String[]) {
+      return setDefaultStringArray((String[])defaultValue);
+    } else {
+      throw new IllegalArgumentException("Value of type " + defaultValue.getClass().getName()
+        + " cannot be put into a table");
+    }
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultBoolean(boolean defaultValue) {
+    return NetworkTablesJNI.setDefaultBoolean(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultDouble(double defaultValue) {
+    return NetworkTablesJNI.setDefaultDouble(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultNumber(Number defaultValue) {
+    return NetworkTablesJNI.setDefaultDouble(m_handle, 0, defaultValue.doubleValue());
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultString(String defaultValue) {
+    return NetworkTablesJNI.setDefaultString(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultRaw(byte[] defaultValue) {
+    return NetworkTablesJNI.setDefaultRaw(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultBooleanArray(boolean[] defaultValue) {
+    return NetworkTablesJNI.setDefaultBooleanArray(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultBooleanArray(Boolean[] defaultValue) {
+    return NetworkTablesJNI.setDefaultBooleanArray(m_handle, 0, NetworkTableValue.toNative(defaultValue));
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultDoubleArray(double[] defaultValue) {
+    return NetworkTablesJNI.setDefaultDoubleArray(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultNumberArray(Number[] defaultValue) {
+    return NetworkTablesJNI.setDefaultDoubleArray(m_handle, 0, NetworkTableValue.toNative(defaultValue));
+  }
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDefaultStringArray(String[] defaultValue) {
+    return NetworkTablesJNI.setDefaultStringArray(m_handle, 0, defaultValue);
+  }
+
+  /**
+   * Sets the entry's value
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   * @throws IllegalArgumentException if the value is not a known type
+   */
+  public boolean setValue(Object value) {
+    if (value instanceof NetworkTableValue) {
+      long time = ((NetworkTableValue)value).getTime();
+      Object o = ((NetworkTableValue)value).getValue();
+      switch (((NetworkTableValue)value).getType()) {
+        case kBoolean:
+          return NetworkTablesJNI.setBoolean(m_handle, time, ((Boolean)o).booleanValue(), false);
+        case kDouble:
+          return NetworkTablesJNI.setDouble(m_handle, time, ((Number)o).doubleValue(), false);
+        case kString:
+          return NetworkTablesJNI.setString(m_handle, time, (String)o, false);
+        case kRaw:
+          return NetworkTablesJNI.setRaw(m_handle, time, (byte[])o, false);
+        case kBooleanArray:
+          return NetworkTablesJNI.setBooleanArray(m_handle, time, (boolean[])o, false);
+        case kDoubleArray:
+          return NetworkTablesJNI.setDoubleArray(m_handle, time, (double[])o, false);
+        case kStringArray:
+          return NetworkTablesJNI.setStringArray(m_handle, time, (String[])o, false);
+        case kRpc:
+          // TODO
+        default:
+          return true;
+      }
+    } else if (value instanceof Boolean) {
+      return setBoolean((Boolean)value);
+    } else if (value instanceof Number) {
+      return setNumber((Number)value);
+    } else if (value instanceof String) {
+      return setString((String)value);
+    } else if (value instanceof byte[]) {
+      return setRaw((byte[])value);
+    } else if (value instanceof boolean[]) {
+      return setBooleanArray((boolean[])value);
+    } else if (value instanceof double[]) {
+      return setDoubleArray((double[])value);
+    } else if (value instanceof Boolean[]) {
+      return setBooleanArray((Boolean[])value);
+    } else if (value instanceof Number[]) {
+      return setNumberArray((Number[])value);
+    } else if (value instanceof String[]) {
+      return setStringArray((String[])value);
+    } else {
+      throw new IllegalArgumentException("Value of type " + value.getClass().getName()
+        + " cannot be put into a table");
+    }
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setBoolean(boolean value) {
+    return NetworkTablesJNI.setBoolean(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDouble(double value) {
+    return NetworkTablesJNI.setDouble(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setNumber(Number value) {
+    return NetworkTablesJNI.setDouble(m_handle, 0, value.doubleValue(), false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setString(String value) {
+    return NetworkTablesJNI.setString(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setRaw(byte[] value) {
+    return NetworkTablesJNI.setRaw(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @param len the length of the value
+   * @return False if the entry exists with a different type
+   */
+  public boolean setRaw(ByteBuffer value, int len) {
+    if (!value.isDirect())
+      throw new IllegalArgumentException("must be a direct buffer");
+    if (value.capacity() < len)
+      throw new IllegalArgumentException("buffer is too small, must be at least " + len);
+    return NetworkTablesJNI.setRaw(m_handle, 0, value, len, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setBooleanArray(boolean[] value) {
+    return NetworkTablesJNI.setBooleanArray(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setBooleanArray(Boolean[] value) {
+    return NetworkTablesJNI.setBooleanArray(m_handle, 0, NetworkTableValue.toNative(value), false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setDoubleArray(double[] value) {
+    return NetworkTablesJNI.setDoubleArray(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setNumberArray(Number[] value) {
+    return NetworkTablesJNI.setDoubleArray(m_handle, 0, NetworkTableValue.toNative(value), false);
+  }
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  public boolean setStringArray(String[] value) {
+    return NetworkTablesJNI.setStringArray(m_handle, 0, value, false);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   * @throws IllegalArgumentException if the value is not a known type
+   */
+  public void forceSetValue(Object value) {
+    if (value instanceof NetworkTableValue) {
+      long time = ((NetworkTableValue)value).getTime();
+      Object o = ((NetworkTableValue)value).getValue();
+      switch (((NetworkTableValue)value).getType()) {
+        case kBoolean:
+          NetworkTablesJNI.setBoolean(m_handle, time, ((Boolean)o).booleanValue(), true);
+          return;
+        case kDouble:
+          NetworkTablesJNI.setDouble(m_handle, time, ((Number)o).doubleValue(), true);
+          return;
+        case kString:
+          NetworkTablesJNI.setString(m_handle, time, (String)o, true);
+          return;
+        case kRaw:
+          NetworkTablesJNI.setRaw(m_handle, time, (byte[])o, true);
+          return;
+        case kBooleanArray:
+          NetworkTablesJNI.setBooleanArray(m_handle, time, (boolean[])o, true);
+          return;
+        case kDoubleArray:
+          NetworkTablesJNI.setDoubleArray(m_handle, time, (double[])o, true);
+          return;
+        case kStringArray:
+          NetworkTablesJNI.setStringArray(m_handle, time, (String[])o, true);
+          return;
+        case kRpc:
+          // TODO
+        default:
+          return;
+      }
+    } else if (value instanceof Boolean) {
+      forceSetBoolean((Boolean)value);
+    } else if (value instanceof Number) {
+      forceSetNumber((Number)value);
+    } else if (value instanceof String) {
+      forceSetString((String)value);
+    } else if (value instanceof byte[]) {
+      forceSetRaw((byte[])value);
+    } else if (value instanceof boolean[]) {
+      forceSetBooleanArray((boolean[])value);
+    } else if (value instanceof double[]) {
+      forceSetDoubleArray((double[])value);
+    } else if (value instanceof Boolean[]) {
+      forceSetBooleanArray((Boolean[])value);
+    } else if (value instanceof Number[]) {
+      forceSetNumberArray((Number[])value);
+    } else if (value instanceof String[]) {
+      forceSetStringArray((String[])value);
+    } else {
+      throw new IllegalArgumentException("Value of type " + value.getClass().getName()
+        + " cannot be put into a table");
+    }
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetBoolean(boolean value) {
+    NetworkTablesJNI.setBoolean(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetDouble(double value) {
+    NetworkTablesJNI.setDouble(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetNumber(Number value) {
+    NetworkTablesJNI.setDouble(m_handle, 0, value.doubleValue(), true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetString(String value) {
+    NetworkTablesJNI.setString(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetRaw(byte[] value) {
+    NetworkTablesJNI.setRaw(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetBooleanArray(boolean[] value) {
+    NetworkTablesJNI.setBooleanArray(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetBooleanArray(Boolean[] value) {
+    NetworkTablesJNI.setBooleanArray(m_handle, 0, NetworkTableValue.toNative(value), true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetDoubleArray(double[] value) {
+    NetworkTablesJNI.setDoubleArray(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetNumberArray(Number[] value) {
+    NetworkTablesJNI.setDoubleArray(m_handle, 0, NetworkTableValue.toNative(value), true);
+  }
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  public void forceSetStringArray(String[] value) {
+    NetworkTablesJNI.setStringArray(m_handle, 0, value, true);
+  }
+
+  /**
+   * Sets flags.
+   * @param flags the flags to set (bitmask)
+   */
+  public void setFlags(int flags) {
+    NetworkTablesJNI.setEntryFlags(m_handle, getFlags() | flags);
+  }
+
+  /**
+   * Clears flags.
+   * @param flags the flags to clear (bitmask)
+   */
+  public void clearFlags(int flags) {
+    NetworkTablesJNI.setEntryFlags(m_handle, getFlags() & ~flags);
+  }
+
+  /**
+   * Make value persistent through program restarts.
+   */
+  public void setPersistent() {
+    setFlags(kPersistent);
+  }
+
+  /**
+   * Stop making value persistent through program restarts.
+   */
+  public void clearPersistent() {
+    clearFlags(kPersistent);
+  }
+
+  /**
+   * Returns whether the value is persistent through program restarts.
+   * @return True if the value is persistent.
+   */
+  public boolean isPersistent() {
+    return (getFlags() & kPersistent) != 0;
+  }
+
+  /**
+   * Deletes the entry.
+   */
+  public void delete() {
+    NetworkTablesJNI.deleteEntry(m_handle);
+  }
+
+  /**
+   * Create a callback-based RPC entry point.  Only valid to use on the server.
+   * The callback function will be called when the RPC is called.
+   * This function creates RPC version 0 definitions (raw data in and out).
+   * @param callback  callback function
+   */
+  void createRpc(Consumer<RpcAnswer> callback) {
+    m_inst.createRpc(this, callback);
+  }
+
+  /**
+   * Call a RPC function.  May be used on either the client or server.
+   * This function is non-blocking.  Either {@link RpcCall#GetResult()} or
+   * {@link RpcCall#CancelResult()} must be called on the return value to either
+   * get or ignore the result of the call.
+   * @param params      parameter
+   * @return RPC call object.
+   */
+  RpcCall callRpc(byte[] params) {
+    return new RpcCall(this, NetworkTablesJNI.callRpc(m_handle, params));
+  }
+
+  /**
+   * Add a listener for changes to the entry
+   * @param listener the listener to add
+   * @param flags bitmask specifying desired notifications
+   * @return listener handle
+   */
+  public int addListener(Consumer<EntryNotification> listener, int flags) {
+    return m_inst.addEntryListener(this, listener, flags);
+  }
+
+  /**
+   * Remove a listener from receiving entry events
+   * @param listener the listener to be removed
+   */
+  public void removeListener(int listener) {
+    m_inst.removeEntryListener(listener);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (!(o instanceof NetworkTableEntry)) {
+      return false;
+    }
+    NetworkTableEntry other = (NetworkTableEntry) o;
+    return m_handle == other.m_handle;
+  }
+
+  @Override
+  public int hashCode() {
+    return m_handle;
+  }
+
+  private NetworkTableInstance m_inst;
+  private int m_handle;
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java
new file mode 100644
index 0000000..9e3b68c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableInstance.java
@@ -0,0 +1,1121 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.function.Consumer;
+
+/**
+ * NetworkTables Instance.
+ *
+ * Instances are completely independent from each other.  Table operations on
+ * one instance will not be visible to other instances unless the instances are
+ * connected via the network.  The main limitation on instances is that you
+ * cannot have two servers on the same network port.  The main utility of
+ * instances is for unit testing, but they can also enable one program to
+ * connect to two different NetworkTables networks.
+ *
+ * The global "default" instance (as returned by {@link #getDefault()}) is
+ * always available, and is intended for the common case when there is only
+ * a single NetworkTables instance being used in the program.
+ *
+ * Additional instances can be created with the {@link #create()} function.
+ * A reference must be kept to the NetworkTableInstance returned by this
+ * function to keep it from being garbage collected.
+ */
+public final class NetworkTableInstance {
+  /**
+   * Client/server mode flag values (as returned by {@link #getNetworkMode()}).
+   * This is a bitmask.
+   */
+  public static final int kNetModeNone = 0x00;
+  public static final int kNetModeServer = 0x01;
+  public static final int kNetModeClient = 0x02;
+  public static final int kNetModeStarting = 0x04;
+  public static final int kNetModeFailure = 0x08;
+
+  /**
+   * The default port that network tables operates on.
+   */
+  public static final int kDefaultPort = 1735;
+
+  /**
+   * Construct from native handle.
+   * @param handle Native handle
+   */
+  private NetworkTableInstance(int handle) {
+    m_owned = false;
+    m_handle = handle;
+  }
+
+  /**
+   * Destroys the instance (if created by {@link #create()}).
+   */
+  public synchronized void free() {
+    if (m_owned && m_handle != 0) {
+      NetworkTablesJNI.destroyInstance(m_handle);
+    }
+  }
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  public boolean isValid() {
+    return m_handle != 0;
+  }
+
+  /* The default instance. */
+  private static NetworkTableInstance s_defaultInstance;
+
+  /**
+   * Get global default instance.
+   * @return Global default instance
+   */
+  public synchronized static NetworkTableInstance getDefault() {
+    if (s_defaultInstance == null) {
+      s_defaultInstance = new NetworkTableInstance(NetworkTablesJNI.getDefaultInstance());
+    }
+    return s_defaultInstance;
+  }
+
+  /**
+   * Create an instance.
+   * Note: A reference to the returned instance must be retained to ensure the
+   * instance is not garbage collected.
+   * @return Newly created instance
+   */
+  public static NetworkTableInstance create() {
+    NetworkTableInstance inst = new NetworkTableInstance(NetworkTablesJNI.createInstance());
+    inst.m_owned = true;
+    return inst;
+  }
+
+  /**
+   * Gets the native handle for the entry.
+   * @return Native handle
+   */
+  public int getHandle() {
+    return m_handle;
+  }
+
+  /**
+   * Gets the entry for a key.
+   * @param name Key
+   * @return Network table entry.
+   */
+  public NetworkTableEntry getEntry(String name) {
+    return new NetworkTableEntry(this, NetworkTablesJNI.getEntry(m_handle, name));
+  }
+
+  /**
+   * Get entries starting with the given prefix.
+   * The results are optionally filtered by string prefix and entry type to
+   * only return a subset of all entries.
+   *
+   * @param prefix entry name required prefix; only entries whose name
+   * starts with this string are returned
+   * @param types bitmask of types; 0 is treated as a "don't care"
+   * @return Array of entries.
+   */
+  public NetworkTableEntry[] getEntries(String prefix, int types) {
+    int[] handles = NetworkTablesJNI.getEntries(m_handle, prefix, types);
+    NetworkTableEntry[] entries = new NetworkTableEntry[handles.length];
+    for (int i = 0; i < handles.length; i++) {
+      entries[i] = new NetworkTableEntry(this, handles[i]);
+    }
+    return entries;
+  }
+
+  /**
+   * Get information about entries starting with the given prefix.
+   * The results are optionally filtered by string prefix and entry type to
+   * only return a subset of all entries.
+   *
+   * @param prefix entry name required prefix; only entries whose name
+   * starts with this string are returned
+   * @param types bitmask of types; 0 is treated as a "don't care"
+   * @return Array of entry information.
+   */
+  public EntryInfo[] getEntryInfo(String prefix, int types) {
+    return NetworkTablesJNI.getEntryInfo(this, m_handle, prefix, types);
+  }
+
+  /* Cache of created tables. */
+  private final ConcurrentMap<String, NetworkTable> m_tables = new ConcurrentHashMap<>();
+
+  /**
+   * Gets the table with the specified key.
+   *
+   * @param key the key name
+   * @return The network table
+   */
+  public NetworkTable getTable(String key) {
+    // prepend leading / if not present
+    String theKey;
+    if (key.isEmpty() || key.equals("/")) {
+      theKey = "";
+    } else if (key.charAt(0) == NetworkTable.PATH_SEPARATOR) {
+      theKey = key;
+    } else {
+      theKey = NetworkTable.PATH_SEPARATOR + key;
+    }
+
+    // cache created tables
+    NetworkTable table = m_tables.get(theKey);
+    if (table == null) {
+      table = new NetworkTable(this, theKey);
+      NetworkTable oldTable = m_tables.putIfAbsent(theKey, table);
+      if (oldTable != null) {
+        table = oldTable;
+      }
+    }
+    return table;
+  }
+
+  /**
+   * Deletes ALL keys in ALL subtables (except persistent values).
+   * Use with caution!
+   */
+  public void deleteAllEntries() {
+    NetworkTablesJNI.deleteAllEntries(m_handle);
+  }
+
+  /*
+   * Callback Creation Functions
+   */
+
+  private static class EntryConsumer<T> {
+    final NetworkTableEntry entry;
+    final Consumer<T> consumer;
+
+    EntryConsumer(NetworkTableEntry entry, Consumer<T> consumer) {
+      this.entry = entry;
+      this.consumer = consumer;
+    }
+  }
+
+  private final ReentrantLock m_entryListenerLock = new ReentrantLock();
+  private final Map<Integer, EntryConsumer<EntryNotification>> m_entryListeners = new HashMap<>();
+  private Thread m_entryListenerThread;
+  private int m_entryListenerPoller;
+  private boolean m_entryListenerWaitQueue;
+  private final Condition m_entryListenerWaitQueueCond = m_entryListenerLock.newCondition();
+
+  private void startEntryListenerThread() {
+    m_entryListenerThread = new Thread(() -> {
+      boolean wasInterrupted = false;
+      while (!Thread.interrupted()) {
+        EntryNotification[] events;
+        try {
+          events = NetworkTablesJNI.pollEntryListener(this, m_entryListenerPoller);
+        } catch (InterruptedException ex) {
+          m_entryListenerLock.lock();
+          try {
+            if (m_entryListenerWaitQueue) {
+              m_entryListenerWaitQueue = false;
+              m_entryListenerWaitQueueCond.signalAll();
+              continue;
+            }
+          } finally {
+            m_entryListenerLock.unlock();
+          }
+          Thread.currentThread().interrupt();
+          wasInterrupted = true; // don't try to destroy poller, as its handle is likely no longer valid
+          break;
+        }
+        for (EntryNotification event : events) {
+          EntryConsumer<EntryNotification> listener;
+          m_entryListenerLock.lock();
+          try {
+            listener = m_entryListeners.get(event.listener);
+          } finally {
+            m_entryListenerLock.unlock();
+          }
+          if (listener != null) {
+            event.entryObject = listener.entry;
+            try {
+              listener.consumer.accept(event);
+            } catch (Throwable throwable) {
+              System.err.println("Unhandled exception during entry listener callback: " + throwable.toString());
+              throwable.printStackTrace();
+            }
+          }
+        }
+      }
+      m_entryListenerLock.lock();
+      try {
+        if (!wasInterrupted) {
+          NetworkTablesJNI.destroyEntryListenerPoller(m_entryListenerPoller);
+        }
+        m_entryListenerPoller = 0;
+      } finally {
+        m_entryListenerLock.unlock();
+      }
+    }, "NTEntryListener");
+    m_entryListenerThread.setDaemon(true);
+    m_entryListenerThread.start();
+  }
+
+  /**
+   * Add a listener for all entries starting with a certain prefix.
+   *
+   * @param prefix            UTF-8 string prefix
+   * @param listener          listener to add
+   * @param flags             {@link EntryListenerFlags} bitmask
+   * @return Listener handle
+   */
+  public int addEntryListener(String prefix, Consumer<EntryNotification> listener, int flags) {
+    m_entryListenerLock.lock();
+    try {
+      if (m_entryListenerPoller == 0) {
+        m_entryListenerPoller = NetworkTablesJNI.createEntryListenerPoller(m_handle);
+        startEntryListenerThread();
+      }
+      int handle = NetworkTablesJNI.addPolledEntryListener(m_entryListenerPoller, prefix, flags);
+      m_entryListeners.put(handle, new EntryConsumer<>(null, listener));
+      return handle;
+    } finally {
+      m_entryListenerLock.unlock();
+    }
+  }
+
+  /**
+   * Add a listener for a particular entry.
+   *
+   * @param entry             the entry
+   * @param listener          listener to add
+   * @param flags             {@link EntryListenerFlags} bitmask
+   * @return Listener handle
+   */
+  public int addEntryListener(NetworkTableEntry entry, Consumer<EntryNotification> listener, int flags) {
+    if (!equals(entry.getInstance())) {
+      throw new IllegalArgumentException("entry does not belong to this instance");
+    }
+    m_entryListenerLock.lock();
+    try {
+      if (m_entryListenerPoller == 0) {
+        m_entryListenerPoller = NetworkTablesJNI.createEntryListenerPoller(m_handle);
+        startEntryListenerThread();
+      }
+      int handle = NetworkTablesJNI.addPolledEntryListener(m_entryListenerPoller, entry.getHandle(), flags);
+      m_entryListeners.put(handle, new EntryConsumer<>(entry, listener));
+      return handle;
+    } finally {
+      m_entryListenerLock.unlock();
+    }
+  }
+
+  /**
+   * Remove an entry listener.
+   * @param listener Listener handle to remove
+   */
+  public void removeEntryListener(int listener) {
+    NetworkTablesJNI.removeEntryListener(listener);
+  }
+
+  /**
+   * Wait for the entry listener queue to be empty.  This is primarily useful
+   * for deterministic testing.  This blocks until either the entry listener
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+  */
+  public boolean waitForEntryListenerQueue(double timeout) {
+    if (!NetworkTablesJNI.waitForEntryListenerQueue(m_handle, timeout)) {
+      return false;
+    }
+    m_entryListenerLock.lock();
+    try {
+      if (m_entryListenerPoller != 0) {
+        m_entryListenerWaitQueue = true;
+        NetworkTablesJNI.cancelPollEntryListener(m_entryListenerPoller);
+        while (m_entryListenerWaitQueue) {
+          try {
+            if (timeout < 0) {
+              m_entryListenerWaitQueueCond.await();
+            } else {
+              return m_entryListenerWaitQueueCond.await((long) (timeout * 1e9), TimeUnit.NANOSECONDS);
+            }
+          } catch (InterruptedException ex) {
+            Thread.currentThread().interrupt();
+            return true;
+          }
+        }
+      }
+    } finally {
+      m_entryListenerLock.unlock();
+    }
+    return true;
+  }
+
+  private final ReentrantLock m_connectionListenerLock = new ReentrantLock();
+  private final Map<Integer, Consumer<ConnectionNotification>> m_connectionListeners = new HashMap<>();
+  private Thread m_connectionListenerThread;
+  private int m_connectionListenerPoller;
+  private boolean m_connectionListenerWaitQueue;
+  private final Condition m_connectionListenerWaitQueueCond = m_connectionListenerLock.newCondition();
+
+  private void startConnectionListenerThread() {
+    m_connectionListenerThread = new Thread(() -> {
+      boolean wasInterrupted = false;
+      while (!Thread.interrupted()) {
+        ConnectionNotification[] events;
+        try {
+          events = NetworkTablesJNI.pollConnectionListener(this, m_connectionListenerPoller);
+        } catch (InterruptedException ex) {
+          m_connectionListenerLock.lock();
+          try {
+            if (m_connectionListenerWaitQueue) {
+              m_connectionListenerWaitQueue = false;
+              m_connectionListenerWaitQueueCond.signalAll();
+              continue;
+            }
+          } finally {
+            m_connectionListenerLock.unlock();
+          }
+          Thread.currentThread().interrupt();
+          wasInterrupted = true; // don't try to destroy poller, as its handle is likely no longer valid
+          break;
+        }
+        for (ConnectionNotification event : events) {
+          Consumer<ConnectionNotification> listener;
+          m_connectionListenerLock.lock();
+          try {
+            listener = m_connectionListeners.get(event.listener);
+          } finally {
+            m_connectionListenerLock.unlock();
+          }
+          if (listener != null) {
+            try {
+              listener.accept(event);
+            } catch (Throwable throwable) {
+              System.err.println("Unhandled exception during connection listener callback: " + throwable.toString());
+              throwable.printStackTrace();
+            }
+          }
+        }
+      }
+      m_connectionListenerLock.lock();
+      try {
+        if (!wasInterrupted) {
+          NetworkTablesJNI.destroyConnectionListenerPoller(m_connectionListenerPoller);
+        }
+        m_connectionListenerPoller = 0;
+      } finally {
+        m_connectionListenerLock.unlock();
+      }
+    }, "NTConnectionListener");
+    m_connectionListenerThread.setDaemon(true);
+    m_connectionListenerThread.start();
+  }
+
+  /**
+   * Add a connection listener.
+   *
+   * @param listener Listener to add
+   * @param immediateNotify Notify listener of all existing connections
+   * @return Listener handle
+   */
+  public int addConnectionListener(Consumer<ConnectionNotification> listener, boolean immediateNotify) {
+    m_connectionListenerLock.lock();
+    try {
+      if (m_connectionListenerPoller == 0) {
+        m_connectionListenerPoller = NetworkTablesJNI.createConnectionListenerPoller(m_handle);
+        startConnectionListenerThread();
+      }
+      int handle = NetworkTablesJNI.addPolledConnectionListener(m_connectionListenerPoller, immediateNotify);
+      m_connectionListeners.put(handle, listener);
+      return handle;
+    } finally {
+      m_connectionListenerLock.unlock();
+    }
+  }
+
+  /**
+   * Remove a connection listener.
+   * @param listener Listener handle to remove
+   */
+  public void removeConnectionListener(int listener) {
+    m_connectionListenerLock.lock();
+    try {
+      m_connectionListeners.remove(listener);
+    } finally {
+      m_connectionListenerLock.unlock();
+    }
+    NetworkTablesJNI.removeConnectionListener(listener);
+  }
+
+  /**
+   * Wait for the connection listener queue to be empty.  This is primarily useful
+   * for deterministic testing.  This blocks until either the connection listener
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  public boolean waitForConnectionListenerQueue(double timeout) {
+    if (!NetworkTablesJNI.waitForConnectionListenerQueue(m_handle, timeout)) {
+      return false;
+    }
+    m_connectionListenerLock.lock();
+    try {
+      if (m_connectionListenerPoller != 0) {
+        m_connectionListenerWaitQueue = true;
+        NetworkTablesJNI.cancelPollConnectionListener(m_connectionListenerPoller);
+        while (m_connectionListenerWaitQueue) {
+          try {
+            if (timeout < 0) {
+              m_connectionListenerWaitQueueCond.await();
+            } else {
+              return m_connectionListenerWaitQueueCond.await((long) (timeout * 1e9), TimeUnit.NANOSECONDS);
+            }
+          } catch (InterruptedException ex) {
+            Thread.currentThread().interrupt();
+            return true;
+          }
+        }
+      }
+    } finally {
+      m_connectionListenerLock.unlock();
+    }
+    return true;
+  }
+
+  /*
+   * Remote Procedure Call Functions
+   */
+
+  private final ReentrantLock m_rpcCallLock = new ReentrantLock();
+  private final Map<Integer, EntryConsumer<RpcAnswer>> m_rpcCalls = new HashMap<>();
+  private Thread m_rpcCallThread;
+  private int m_rpcCallPoller;
+  private boolean m_rpcCallWaitQueue;
+  private final Condition m_rpcCallWaitQueueCond = m_rpcCallLock.newCondition();
+
+  private void startRpcCallThread() {
+    m_rpcCallThread = new Thread(() -> {
+      boolean wasInterrupted = false;
+      while (!Thread.interrupted()) {
+        RpcAnswer[] events;
+        try {
+          events = NetworkTablesJNI.pollRpc(this, m_rpcCallPoller);
+        } catch (InterruptedException ex) {
+          m_rpcCallLock.lock();
+          try {
+            if (m_rpcCallWaitQueue) {
+              m_rpcCallWaitQueue = false;
+              m_rpcCallWaitQueueCond.signalAll();
+              continue;
+            }
+          } finally {
+            m_rpcCallLock.unlock();
+          }
+          Thread.currentThread().interrupt();
+          wasInterrupted = true; // don't try to destroy poller, as its handle is likely no longer valid
+          break;
+        }
+        for (RpcAnswer event : events) {
+          EntryConsumer<RpcAnswer> listener;
+          m_rpcCallLock.lock();
+          try {
+            listener = m_rpcCalls.get(event.entry);
+          } finally {
+            m_rpcCallLock.unlock();
+          }
+          if (listener != null) {
+            event.entryObject = listener.entry;
+            try {
+              listener.consumer.accept(event);
+            } catch (Throwable throwable) {
+              System.err.println("Unhandled exception during RPC callback: " + throwable.toString());
+              throwable.printStackTrace();
+            }
+          }
+        }
+      }
+      m_rpcCallLock.lock();
+      try {
+        if (!wasInterrupted) {
+          NetworkTablesJNI.destroyRpcCallPoller(m_rpcCallPoller);
+        }
+        m_rpcCallPoller = 0;
+      } finally {
+        m_rpcCallLock.unlock();
+      }
+    }, "NTRpcCall");
+    m_rpcCallThread.setDaemon(true);
+    m_rpcCallThread.start();
+  }
+
+  private static final byte[] rev0def = new byte[] {0};
+
+  /**
+   * Create a callback-based RPC entry point.  Only valid to use on the server.
+   * The callback function will be called when the RPC is called.
+   * This function creates RPC version 0 definitions (raw data in and out).
+   * @param entry     the entry
+   * @param callback  callback function
+   */
+  public void createRpc(NetworkTableEntry entry, Consumer<RpcAnswer> callback) {
+    m_rpcCallLock.lock();
+    try {
+      if (m_rpcCallPoller == 0) {
+        m_rpcCallPoller = NetworkTablesJNI.createRpcCallPoller(m_handle);
+        startRpcCallThread();
+      }
+      NetworkTablesJNI.createPolledRpc(entry.getHandle(), rev0def, m_rpcCallPoller);
+      m_rpcCalls.put(entry.getHandle(), new EntryConsumer<>(entry, callback));
+    } finally {
+      m_rpcCallLock.unlock();
+    }
+  }
+
+  /**
+   * Wait for the incoming RPC call queue to be empty.  This is primarily useful
+   * for deterministic testing.  This blocks until either the RPC call
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  public boolean waitForRpcCallQueue(double timeout) {
+    if (!NetworkTablesJNI.waitForRpcCallQueue(m_handle, timeout)) {
+      return false;
+    }
+    m_rpcCallLock.lock();
+    try {
+      if (m_rpcCallPoller != 0) {
+        m_rpcCallWaitQueue = true;
+        NetworkTablesJNI.cancelPollRpc(m_rpcCallPoller);
+        while (m_rpcCallWaitQueue) {
+          try {
+            if (timeout < 0) {
+              m_rpcCallWaitQueueCond.await();
+            } else {
+              return m_rpcCallWaitQueueCond.await((long) (timeout * 1e9), TimeUnit.NANOSECONDS);
+            }
+          } catch (InterruptedException ex) {
+            Thread.currentThread().interrupt();
+            return true;
+          }
+        }
+      }
+    } finally {
+      m_rpcCallLock.unlock();
+    }
+    return true;
+  }
+
+  /*
+   * Client/Server Functions
+   */
+
+  /**
+   * Set the network identity of this node.
+   * This is the name used during the initial connection handshake, and is
+   * visible through ConnectionInfo on the remote node.
+   * @param name      identity to advertise
+   */
+  public void setNetworkIdentity(String name) {
+    NetworkTablesJNI.setNetworkIdentity(m_handle, name);
+  }
+
+  /**
+   * Get the current network mode.
+   * @return Bitmask of NetworkMode.
+   */
+  public int getNetworkMode() {
+    return NetworkTablesJNI.getNetworkMode(m_handle);
+  }
+
+  /**
+   * Starts a server using the networktables.ini as the persistent file,
+   * using the default listening address and port.
+   */
+  public void startServer() {
+    startServer("networktables.ini");
+  }
+
+  /**
+   * Starts a server using the specified persistent filename, using the default
+   * listening address and port.
+   *
+   * @param persistFilename  the name of the persist file to use
+   */
+  public void startServer(String persistFilename) {
+    startServer(persistFilename, "");
+  }
+
+  /**
+   * Starts a server using the specified filename and listening address,
+   * using the default port.
+   *
+   * @param persistFilename  the name of the persist file to use
+   * @param listenAddress    the address to listen on, or empty to listen on any
+   *                         address
+   */
+  public void startServer(String persistFilename, String listenAddress) {
+    startServer(persistFilename, listenAddress, kDefaultPort);
+  }
+
+  /**
+   * Starts a server using the specified filename, listening address, and port.
+   *
+   * @param persistFilename  the name of the persist file to use
+   * @param listenAddress    the address to listen on, or empty to listen on any
+   *                         address
+   * @param port             port to communicate over
+   */
+  public void startServer(String persistFilename, String listenAddress, int port) {
+    NetworkTablesJNI.startServer(m_handle, persistFilename, listenAddress, port);
+  }
+
+  /**
+   * Stops the server if it is running.
+   */
+  public void stopServer() {
+    NetworkTablesJNI.stopServer(m_handle);
+  }
+
+  /**
+   * Starts a client.  Use SetServer to set the server name and port.
+   */
+  public void startClient() {
+    NetworkTablesJNI.startClient(m_handle);
+  }
+
+  /**
+   * Starts a client using the specified server and the default port
+   *
+   * @param serverName  server name
+   */
+  public void startClient(String serverName) {
+    startClient(serverName, kDefaultPort);
+  }
+
+  /**
+   * Starts a client using the specified server and port
+   *
+   * @param serverName  server name
+   * @param port        port to communicate over
+   */
+  public void startClient(String serverName, int port) {
+    NetworkTablesJNI.startClient(m_handle, serverName, port);
+  }
+
+  /**
+   * Starts a client using the specified servers and default port.  The
+   * client will attempt to connect to each server in round robin fashion.
+   *
+   * @param serverNames   array of server names
+   */
+  public void startClient(String[] serverNames) {
+    startClient(serverNames, kDefaultPort);
+  }
+
+  /**
+   * Starts a client using the specified servers and port number.  The
+   * client will attempt to connect to each server in round robin fashion.
+   *
+   * @param serverNames   array of server names
+   * @param port          port to communicate over
+   */
+  public void startClient(String[] serverNames, int port) {
+    int[] ports = new int[serverNames.length];
+    for (int i = 0; i < serverNames.length; i++) {
+      ports[i] = port;
+    }
+    startClient(serverNames, ports);
+  }
+
+  /**
+   * Starts a client using the specified (server, port) combinations.  The
+   * client will attempt to connect to each server in round robin fashion.
+   *
+   * @param serverNames   array of server names
+   * @param ports         array of port numbers
+   */
+  public void startClient(String[] serverNames, int[] ports) {
+    NetworkTablesJNI.startClient(m_handle, serverNames, ports);
+  }
+
+  /**
+   * Starts a client using commonly known robot addresses for the specified
+   * team using the default port number.
+   *
+   * @param team        team number
+   */
+  public void startClientTeam(int team) {
+    startClientTeam(team, kDefaultPort);
+  }
+
+  /**
+   * Starts a client using commonly known robot addresses for the specified
+   * team.
+   *
+   * @param team        team number
+   * @param port        port to communicate over
+   */
+  public void startClientTeam(int team, int port) {
+    NetworkTablesJNI.startClientTeam(m_handle, team, port);
+  }
+
+  /**
+   * Stops the client if it is running.
+   */
+  public void stopClient() {
+    NetworkTablesJNI.stopClient(m_handle);
+  }
+
+  /**
+   * Sets server address and port for client (without restarting client).
+   * Changes the port to the default port.
+   *
+   * @param serverName  server name
+   */
+  public void setServer(String serverName) {
+    setServer(serverName, kDefaultPort);
+  }
+
+  /**
+   * Sets server address and port for client (without restarting client).
+   *
+   * @param serverName  server name
+   * @param port        port to communicate over
+   */
+  public void setServer(String serverName, int port) {
+    NetworkTablesJNI.setServer(m_handle, serverName, port);
+  }
+
+  /**
+   * Sets server addresses and port for client (without restarting client).
+   * Changes the port to the default port.  The client will attempt to connect
+   * to each server in round robin fashion.
+   *
+   * @param serverNames   array of server names
+   */
+  public void setServer(String[] serverNames) {
+    setServer(serverNames, kDefaultPort);
+  }
+
+  /**
+   * Sets server addresses and port for client (without restarting client).
+   * The client will attempt to connect to each server in round robin fashion.
+   *
+   * @param serverNames   array of server names
+   * @param port          port to communicate over
+   */
+  public void setServer(String[] serverNames, int port) {
+    int[] ports = new int[serverNames.length];
+    for (int i = 0; i < serverNames.length; i++) {
+      ports[i] = port;
+    }
+    setServer(serverNames, ports);
+  }
+
+  /**
+   * Sets server addresses and ports for client (without restarting client).
+   * The client will attempt to connect to each server in round robin fashion.
+   *
+   * @param serverNames   array of server names
+   * @param ports         array of port numbers
+   */
+  public void setServer(String[] serverNames, int[] ports) {
+    NetworkTablesJNI.setServer(m_handle, serverNames, ports);
+  }
+
+  /**
+   * Sets server addresses and port for client (without restarting client).
+   * Changes the port to the default port.  The client will attempt to connect
+   * to each server in round robin fashion.
+   *
+   * @param team        team number
+   */
+  public void setServerTeam(int team) {
+    setServerTeam(team, kDefaultPort);
+  }
+
+  /**
+   * Sets server addresses and port for client (without restarting client).
+   * Connects using commonly known robot addresses for the specified team.
+   *
+   * @param team        team number
+   * @param port        port to communicate over
+   */
+  public void setServerTeam(int team, int port) {
+    NetworkTablesJNI.setServerTeam(m_handle, team, port);
+  }
+
+  /**
+   * Starts requesting server address from Driver Station.
+   * This connects to the Driver Station running on localhost to obtain the
+   * server IP address, and connects with the default port.
+   */
+  public void startDSClient() {
+    startDSClient(kDefaultPort);
+  }
+
+  /**
+   * Starts requesting server address from Driver Station.
+   * This connects to the Driver Station running on localhost to obtain the
+   * server IP address.
+   *
+   * @param port server port to use in combination with IP from DS
+   */
+  public void startDSClient(int port) {
+    NetworkTablesJNI.startDSClient(m_handle, port);
+  }
+
+  /**
+   * Stops requesting server address from Driver Station.
+   */
+  public void stopDSClient() {
+    NetworkTablesJNI.stopDSClient(m_handle);
+  }
+
+  /**
+   * Set the periodic update rate.
+   * Sets how frequently updates are sent to other nodes over the network.
+   *
+   * @param interval update interval in seconds (range 0.01 to 1.0)
+   */
+  public void setUpdateRate(double interval) {
+    NetworkTablesJNI.setUpdateRate(m_handle, interval);
+  }
+
+  /**
+   * Flushes all updated values immediately to the network.
+   * Note: This is rate-limited to protect the network from flooding.
+   * This is primarily useful for synchronizing network updates with
+   * user code.
+   */
+  public void flush() {
+    NetworkTablesJNI.flush(m_handle);
+  }
+
+  /**
+   * Gets information on the currently established network connections.
+   * If operating as a client, this will return either zero or one values.
+   * @return array of connection information
+   */
+  public ConnectionInfo[] getConnections() {
+    return NetworkTablesJNI.getConnections(m_handle);
+  }
+
+  /**
+   * Return whether or not the instance is connected to another node.
+   * @return True if connected.
+   */
+  public boolean isConnected() {
+    return NetworkTablesJNI.isConnected(m_handle);
+  }
+
+  /**
+   * Saves persistent keys to a file.  The server does this automatically.
+   *
+   * @param filename file name
+   * @throws PersistentException if error saving file
+   */
+  public void savePersistent(String filename) throws PersistentException {
+    NetworkTablesJNI.savePersistent(m_handle, filename);
+  }
+
+  /**
+   * Loads persistent keys from a file.  The server does this automatically.
+   *
+   * @param filename file name
+   * @return List of warnings (errors result in an exception instead)
+   * @throws PersistentException if error reading file
+   */
+  public String[] loadPersistent(String filename) throws PersistentException {
+    return NetworkTablesJNI.loadPersistent(m_handle, filename);
+  }
+
+  /**
+   * Save table values to a file.  The file format used is identical to
+   * that used for SavePersistent.
+   * @param filename  filename
+   * @param prefix    save only keys starting with this prefix
+   * @throws PersistentException if error saving file
+   */
+  public void saveEntries(String filename, String prefix) throws PersistentException {
+    NetworkTablesJNI.saveEntries(m_handle, filename, prefix);
+  }
+
+  /**
+   * Load table values from a file.  The file format used is identical to
+   * that used for SavePersistent / LoadPersistent.
+   * @param filename  filename
+   * @param prefix    load only keys starting with this prefix
+   * @return List of warnings (errors result in an exception instead)
+   * @throws PersistentException if error saving file
+   */
+  public String[] loadEntries(String filename, String prefix) throws PersistentException {
+    return NetworkTablesJNI.loadEntries(m_handle, filename, prefix);
+  }
+
+  private final ReentrantLock m_loggerLock = new ReentrantLock();
+  private final Map<Integer, Consumer<LogMessage>> m_loggers = new HashMap<>();
+  private Thread m_loggerThread;
+  private int m_loggerPoller;
+  private boolean m_loggerWaitQueue;
+  private final Condition m_loggerWaitQueueCond = m_loggerLock.newCondition();
+
+  private void startLogThread() {
+    m_loggerThread = new Thread(() -> {
+      boolean wasInterrupted = false;
+      while (!Thread.interrupted()) {
+        LogMessage[] events;
+        try {
+          events = NetworkTablesJNI.pollLogger(this, m_loggerPoller);
+        } catch (InterruptedException ex) {
+          Thread.currentThread().interrupt();
+          wasInterrupted = true; // don't try to destroy poller, as its handle is likely no longer valid
+          break;
+        }
+        for (LogMessage event : events) {
+          Consumer<LogMessage> logger;
+          m_loggerLock.lock();
+          try {
+            logger = m_loggers.get(event.logger);
+          } finally {
+            m_loggerLock.unlock();
+          }
+          if (logger != null) {
+            try {
+              logger.accept(event);
+            } catch (Throwable throwable) {
+              System.err.println("Unhandled exception during logger callback: " + throwable.toString());
+              throwable.printStackTrace();
+            }
+          }
+        }
+      }
+      m_loggerLock.lock();
+      try {
+        if (!wasInterrupted) {
+          NetworkTablesJNI.destroyLoggerPoller(m_loggerPoller);
+        }
+        m_rpcCallPoller = 0;
+      } finally {
+        m_loggerLock.unlock();
+      }
+    }, "NTLogger");
+    m_loggerThread.setDaemon(true);
+    m_loggerThread.start();
+  }
+
+  /**
+   * Add logger callback function.  By default, log messages are sent to stderr;
+   * this function sends log messages with the specified levels to the provided
+   * callback function instead.  The callback function will only be called for
+   * log messages with level greater than or equal to minLevel and less than or
+   * equal to maxLevel; messages outside this range will be silently ignored.
+   *
+   * @param func        log callback function
+   * @param minLevel    minimum log level
+   * @param maxLevel    maximum log level
+   * @return Logger handle
+   */
+  public int addLogger(Consumer<LogMessage> func, int minLevel, int maxLevel) {
+    m_loggerLock.lock();
+    try {
+      if (m_loggerPoller == 0) {
+        m_loggerPoller = NetworkTablesJNI.createLoggerPoller(m_handle);
+        startLogThread();
+      }
+      int handle = NetworkTablesJNI.addPolledLogger(m_loggerPoller, minLevel, maxLevel);
+      m_loggers.put(handle, func);
+      return handle;
+    } finally {
+      m_loggerLock.unlock();
+    }
+  }
+
+  /**
+   * Remove a logger.
+   * @param logger Logger handle to remove
+   */
+  public void removeLogger(int logger) {
+    m_loggerLock.lock();
+    try {
+      m_loggers.remove(logger);
+    } finally {
+      m_loggerLock.unlock();
+    }
+    NetworkTablesJNI.removeLogger(logger);
+  }
+
+  /**
+   * Wait for the incoming log event queue to be empty.  This is primarily useful
+   * for deterministic testing.  This blocks until either the log event
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  public boolean waitForLoggerQueue(double timeout) {
+    if (!NetworkTablesJNI.waitForLoggerQueue(m_handle, timeout)) {
+      return false;
+    }
+    m_loggerLock.lock();
+    try {
+      if (m_loggerPoller != 0) {
+        m_loggerWaitQueue = true;
+        NetworkTablesJNI.cancelPollLogger(m_loggerPoller);
+        while (m_loggerWaitQueue) {
+          try {
+            if (timeout < 0) {
+              m_loggerWaitQueueCond.await();
+            } else {
+              return m_loggerWaitQueueCond.await((long) (timeout * 1e9), TimeUnit.NANOSECONDS);
+            }
+          } catch (InterruptedException ex) {
+            Thread.currentThread().interrupt();
+            return true;
+          }
+        }
+      }
+    } finally {
+      m_loggerLock.unlock();
+    }
+    return true;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (!(o instanceof NetworkTableInstance)) {
+      return false;
+    }
+    NetworkTableInstance other = (NetworkTableInstance) o;
+    return m_handle == other.m_handle;
+  }
+
+  @Override
+  public int hashCode() {
+    return m_handle;
+  }
+
+  private boolean m_owned;
+  private int m_handle;
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableType.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableType.java
new file mode 100644
index 0000000..e2418e1
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableType.java
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * Network table data types.
+ */
+public enum NetworkTableType {
+  kUnassigned(0),
+  kBoolean(0x01),
+  kDouble(0x02),
+  kString(0x04),
+  kRaw(0x08),
+  kBooleanArray(0x10),
+  kDoubleArray(0x20),
+  kStringArray(0x40),
+  kRpc(0x80);
+
+  private final int value;
+
+  private NetworkTableType(int value) {
+    this.value = value;
+  }
+
+  public int getValue() {
+    return value;
+  }
+
+  public static NetworkTableType getFromInt(int value) {
+    switch (value) {
+      case 0x01: return kBoolean;
+      case 0x02: return kDouble;
+      case 0x04: return kString;
+      case 0x08: return kRaw;
+      case 0x10: return kBooleanArray;
+      case 0x20: return kDoubleArray;
+      case 0x40: return kStringArray;
+      case 0x80: return kRpc;
+      default: return kUnassigned;
+    }
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableValue.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableValue.java
new file mode 100644
index 0000000..e9e7a88
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTableValue.java
@@ -0,0 +1,472 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.Objects;
+
+/**
+ * A network table entry value.
+ */
+public final class NetworkTableValue {
+  NetworkTableValue(NetworkTableType type, Object value, long time) {
+    m_type = type;
+    m_value = value;
+    m_time = time;
+  }
+
+  NetworkTableValue(NetworkTableType type, Object value) {
+    this(type, value, NetworkTablesJNI.now());
+  }
+
+  NetworkTableValue(int type, Object value, long time) {
+    this(NetworkTableType.getFromInt(type), value, time);
+  }
+
+  /**
+   * Get the data type.
+   * @return The type.
+   */
+  public NetworkTableType getType() {
+    return m_type;
+  }
+
+  /**
+   * Get the data value stored.
+   * @return The type.
+   */
+  public Object getValue() {
+    return m_value;
+  }
+
+  /**
+   * Get the creation time of the value.
+   * @return The time, in the units returned by NetworkTablesJNI.now().
+   */
+  public long getTime() {
+    return m_time;
+  }
+
+  /*
+   * Type Checkers
+   */
+
+  /**
+   * Determine if entry value contains a value or is unassigned.
+   * @return True if the entry value contains a value.
+   */
+  public boolean isValid() {
+    return m_type != NetworkTableType.kUnassigned;
+  }
+
+  /**
+   * Determine if entry value contains a boolean.
+   * @return True if the entry value is of boolean type.
+   */
+  public boolean isBoolean() {
+    return m_type == NetworkTableType.kBoolean;
+  }
+
+  /**
+   * Determine if entry value contains a double.
+   * @return True if the entry value is of double type.
+   */
+  public boolean isDouble() {
+    return m_type == NetworkTableType.kDouble;
+  }
+
+  /**
+   * Determine if entry value contains a string.
+   * @return True if the entry value is of string type.
+   */
+  public boolean isString() {
+    return m_type == NetworkTableType.kString;
+  }
+
+  /**
+   * Determine if entry value contains a raw.
+   * @return True if the entry value is of raw type.
+   */
+  public boolean isRaw() {
+    return m_type == NetworkTableType.kRaw;
+  }
+
+  /**
+   * Determine if entry value contains a rpc definition.
+   * @return True if the entry value is of rpc definition type.
+   */
+  public boolean isRpc() {
+    return m_type == NetworkTableType.kRpc;
+  }
+
+  /**
+   * Determine if entry value contains a boolean array.
+   * @return True if the entry value is of boolean array type.
+   */
+  public boolean isBooleanArray() {
+    return m_type == NetworkTableType.kBooleanArray;
+  }
+
+  /**
+   * Determine if entry value contains a double array.
+   * @return True if the entry value is of double array type.
+   */
+  public boolean isDoubleArray() {
+    return m_type == NetworkTableType.kDoubleArray;
+  }
+
+  /**
+   * Determine if entry value contains a string array.
+   * @return True if the entry value is of string array type.
+   */
+  public boolean isStringArray() {
+    return m_type == NetworkTableType.kStringArray;
+  }
+
+  /*
+   * Type-Safe Getters
+   */
+
+  /**
+   * Get the entry's boolean value.
+   * @throws ClassCastException if the entry value is not of boolean type.
+   * @return The boolean value.
+   */
+  public boolean getBoolean() {
+    if (m_type != NetworkTableType.kBoolean) {
+      throw new ClassCastException("cannot convert " + m_type + " to boolean");
+    }
+    return ((Boolean)m_value).booleanValue();
+  }
+
+  /**
+   * Get the entry's double value.
+   * @throws ClassCastException if the entry value is not of double type.
+   * @return The double value.
+   */
+  public double getDouble() {
+    if (m_type != NetworkTableType.kDouble) {
+      throw new ClassCastException("cannot convert " + m_type + " to double");
+    }
+    return ((Number)m_value).doubleValue();
+  }
+
+  /**
+   * Get the entry's string value.
+   * @throws ClassCastException if the entry value is not of string type.
+   * @return The string value.
+   */
+  public String getString() {
+    if (m_type != NetworkTableType.kString) {
+      throw new ClassCastException("cannot convert " + m_type + " to string");
+    }
+    return (String)m_value;
+  }
+
+  /**
+   * Get the entry's raw value.
+   * @throws ClassCastException if the entry value is not of raw type.
+   * @return The raw value.
+   */
+  public byte[] getRaw() {
+    if (m_type != NetworkTableType.kRaw) {
+      throw new ClassCastException("cannot convert " + m_type + " to raw");
+    }
+    return (byte[])m_value;
+  }
+
+  /**
+   * Get the entry's rpc definition value.
+   * @throws ClassCastException if the entry value is not of rpc definition type.
+   * @return The rpc definition value.
+   */
+  public byte[] getRpc() {
+    if (m_type != NetworkTableType.kRpc) {
+      throw new ClassCastException("cannot convert " + m_type + " to rpc");
+    }
+    return (byte[])m_value;
+  }
+
+  /**
+   * Get the entry's boolean array value.
+   * @throws ClassCastException if the entry value is not of boolean array type.
+   * @return The boolean array value.
+   */
+  public boolean[] getBooleanArray() {
+    if (m_type != NetworkTableType.kBooleanArray) {
+      throw new ClassCastException("cannot convert " + m_type + " to boolean array");
+    }
+    return (boolean[])m_value;
+  }
+
+  /**
+   * Get the entry's double array value.
+   * @throws ClassCastException if the entry value is not of double array type.
+   * @return The double array value.
+   */
+  public double[] getDoubleArray() {
+    if (m_type != NetworkTableType.kDoubleArray) {
+      throw new ClassCastException("cannot convert " + m_type + " to double array");
+    }
+    return (double[])m_value;
+  }
+
+  /**
+   * Get the entry's string array value.
+   * @throws ClassCastException if the entry value is not of string array type.
+   * @return The string array value.
+   */
+  public String[] getStringArray() {
+    if (m_type != NetworkTableType.kStringArray) {
+      throw new ClassCastException("cannot convert " + m_type + " to string array");
+    }
+    return (String[])m_value;
+  }
+
+  /*
+   * Factory functions.
+   */
+
+  /**
+   * Creates a boolean entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeBoolean(boolean value) {
+    return new NetworkTableValue(NetworkTableType.kBoolean, new Boolean(value));
+  }
+
+  /**
+   * Creates a boolean entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeBoolean(boolean value, long time) {
+    return new NetworkTableValue(NetworkTableType.kBoolean, new Boolean(value), time);
+  }
+
+  /**
+   * Creates a double entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeDouble(double value) {
+    return new NetworkTableValue(NetworkTableType.kDouble, new Double(value));
+  }
+
+  /**
+   * Creates a double entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeDouble(double value, long time) {
+    return new NetworkTableValue(NetworkTableType.kDouble, new Double(value), time);
+  }
+
+  /**
+   * Creates a string entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeString(String value) {
+    return new NetworkTableValue(NetworkTableType.kString, value);
+  }
+
+  /**
+   * Creates a string entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeString(String value, long time) {
+    return new NetworkTableValue(NetworkTableType.kString, value, time);
+  }
+
+  /**
+   * Creates a raw entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeRaw(byte[] value) {
+    return new NetworkTableValue(NetworkTableType.kRaw, value);
+  }
+
+  /**
+   * Creates a raw entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeRaw(byte[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kRaw, value, time);
+  }
+
+  /**
+   * Creates a rpc entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeRpc(byte[] value) {
+    return new NetworkTableValue(NetworkTableType.kRpc, value);
+  }
+
+  /**
+   * Creates a rpc entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeRpc(byte[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kRpc, value, time);
+  }
+
+  /**
+   * Creates a boolean array entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeBooleanArray(boolean[] value) {
+    return new NetworkTableValue(NetworkTableType.kBooleanArray, value);
+  }
+
+  /**
+   * Creates a boolean array entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeBooleanArray(boolean[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kBooleanArray, value, time);
+  }
+
+  /**
+   * Creates a boolean array entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeBooleanArray(Boolean[] value) {
+    return new NetworkTableValue(NetworkTableType.kBooleanArray, toNative(value));
+  }
+
+  /**
+   * Creates a boolean array entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeBooleanArray(Boolean[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kBooleanArray, toNative(value), time);
+  }
+
+  /**
+   * Creates a double array entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeDoubleArray(double[] value) {
+    return new NetworkTableValue(NetworkTableType.kDoubleArray, value);
+  }
+
+  /**
+   * Creates a double array entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeDoubleArray(double[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kDoubleArray, value, time);
+  }
+
+  /**
+   * Creates a double array entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeDoubleArray(Number[] value) {
+    return new NetworkTableValue(NetworkTableType.kDoubleArray, toNative(value));
+  }
+
+  /**
+   * Creates a double array entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeDoubleArray(Number[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kDoubleArray, toNative(value), time);
+  }
+
+  /**
+   * Creates a string array entry value.
+   * @param value the value
+   * @return The entry value
+   */
+  public static NetworkTableValue makeStringArray(String[] value) {
+    return new NetworkTableValue(NetworkTableType.kStringArray, value);
+  }
+
+  /**
+   * Creates a string array entry value.
+   * @param value the value
+   * @param time the creation time to use (instead of the current time)
+   * @return The entry value
+   */
+  public static NetworkTableValue makeStringArray(String[] value, long time) {
+    return new NetworkTableValue(NetworkTableType.kStringArray, value, time);
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (!(o instanceof NetworkTableValue)) {
+      return false;
+    }
+    NetworkTableValue other = (NetworkTableValue) o;
+    return m_type == other.m_type && m_value.equals(other.m_value);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(m_type, m_value);
+  }
+
+  static boolean[] toNative(Boolean[] arr) {
+    boolean[] out = new boolean[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i];
+    return out;
+  }
+
+  static double[] toNative(Number[] arr) {
+    double[] out = new double[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i].doubleValue();
+    return out;
+  }
+
+  static Boolean[] fromNative(boolean[] arr) {
+    Boolean[] out = new Boolean[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i];
+    return out;
+  }
+
+  static Double[] fromNative(double[] arr) {
+    Double[] out = new Double[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i];
+    return out;
+  }
+
+  private NetworkTableType m_type;
+  private Object m_value;
+  private long m_time;
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java
new file mode 100644
index 0000000..05d1b3d
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/NetworkTablesJNI.java
@@ -0,0 +1,185 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import edu.wpi.first.wpiutil.RuntimeDetector;
+
+public final class NetworkTablesJNI {
+  static boolean libraryLoaded = false;
+  static File jniLibrary = null;
+  static {
+    if (!libraryLoaded) {
+      try {
+        System.loadLibrary("ntcore");
+      } catch (UnsatisfiedLinkError e) {
+        try {
+          String resname = RuntimeDetector.getLibraryResource("ntcore");
+          InputStream is = NetworkTablesJNI.class.getResourceAsStream(resname);
+          if (is != null) {
+            // create temporary file
+            if (System.getProperty("os.name").startsWith("Windows"))
+              jniLibrary = File.createTempFile("NetworkTablesJNI", ".dll");
+            else if (System.getProperty("os.name").startsWith("Mac"))
+              jniLibrary = File.createTempFile("libNetworkTablesJNI", ".dylib");
+            else
+              jniLibrary = File.createTempFile("libNetworkTablesJNI", ".so");
+            // flag for delete on exit
+            jniLibrary.deleteOnExit();
+            OutputStream os = new FileOutputStream(jniLibrary);
+
+            byte[] buffer = new byte[1024];
+            int readBytes;
+            try {
+              while ((readBytes = is.read(buffer)) != -1) {
+                os.write(buffer, 0, readBytes);
+              }
+            } finally {
+              os.close();
+              is.close();
+            }
+            System.load(jniLibrary.getAbsolutePath());
+          } else {
+            System.loadLibrary("ntcore");
+          }
+        } catch (IOException ex) {
+          ex.printStackTrace();
+          System.exit(1);
+        }
+      }
+      libraryLoaded = true;
+    }
+  }
+
+  public static native int getDefaultInstance();
+  public static native int createInstance();
+  public static native void destroyInstance(int inst);
+  public static native int getInstanceFromHandle(int handle);
+
+  public static native int getEntry(int inst, String key);
+  public static native int[] getEntries(int inst, String prefix, int types);
+  public static native String getEntryName(int entry);
+  public static native long getEntryLastChange(int entry);
+
+  public static native int getType(int entry);
+
+  public static native boolean setBoolean(int entry, long time, boolean value, boolean force);
+  public static native boolean setDouble(int entry, long time, double value, boolean force);
+  public static native boolean setString(int entry, long time, String value, boolean force);
+  public static native boolean setRaw(int entry, long time, byte[] value, boolean force);
+  public static native boolean setRaw(int entry, long time, ByteBuffer value, int len, boolean force);
+  public static native boolean setBooleanArray(int entry, long time, boolean[] value, boolean force);
+  public static native boolean setDoubleArray(int entry, long time, double[] value, boolean force);
+  public static native boolean setStringArray(int entry, long time, String[] value, boolean force);
+
+  public static native NetworkTableValue getValue(int entry);
+
+  public static native boolean getBoolean(int entry, boolean defaultValue);
+  public static native double getDouble(int entry, double defaultValue);
+  public static native String getString(int entry, String defaultValue);
+  public static native byte[] getRaw(int entry, byte[] defaultValue);
+  public static native boolean[] getBooleanArray(int entry, boolean[] defaultValue);
+  public static native double[] getDoubleArray(int entry, double[] defaultValue);
+  public static native String[] getStringArray(int entry, String[] defaultValue);
+  public static native boolean setDefaultBoolean(int entry, long time, boolean defaultValue);
+
+  public static native boolean setDefaultDouble(int entry, long time, double defaultValue);
+  public static native boolean setDefaultString(int entry, long time, String defaultValue);
+  public static native boolean setDefaultRaw(int entry, long time, byte[] defaultValue);
+  public static native boolean setDefaultBooleanArray(int entry, long time, boolean[] defaultValue);
+  public static native boolean setDefaultDoubleArray(int entry, long time, double[] defaultValue);
+  public static native boolean setDefaultStringArray(int entry, long time, String[] defaultValue);
+
+  public static native void setEntryFlags(int entry, int flags);
+  public static native int getEntryFlags(int entry);
+
+  public static native void deleteEntry(int entry);
+
+  public static native void deleteAllEntries(int inst);
+
+  public static native EntryInfo getEntryInfoHandle(NetworkTableInstance inst, int entry);
+  public static native EntryInfo[] getEntryInfo(NetworkTableInstance instObject, int inst, String prefix, int types);
+
+  public static native int createEntryListenerPoller(int inst);
+  public static native void destroyEntryListenerPoller(int poller);
+  public static native int addPolledEntryListener(int poller, String prefix, int flags);
+  public static native int addPolledEntryListener(int poller, int entry, int flags);
+  public static native EntryNotification[] pollEntryListener(NetworkTableInstance inst, int poller) throws InterruptedException;
+  public static native EntryNotification[] pollEntryListenerTimeout(NetworkTableInstance inst, int poller, double timeout) throws InterruptedException;
+  public static native void cancelPollEntryListener(int poller);
+  public static native void removeEntryListener(int entryListener);
+  public static native boolean waitForEntryListenerQueue(int inst, double timeout);
+
+  public static native int createConnectionListenerPoller(int inst);
+  public static native void destroyConnectionListenerPoller(int poller);
+  public static native int addPolledConnectionListener(int poller, boolean immediateNotify);
+  public static native ConnectionNotification[] pollConnectionListener(NetworkTableInstance inst, int poller) throws InterruptedException;
+  public static native ConnectionNotification[] pollConnectionListenerTimeout(NetworkTableInstance inst, int poller, double timeout) throws InterruptedException;
+  public static native void cancelPollConnectionListener(int poller);
+  public static native void removeConnectionListener(int connListener);
+  public static native boolean waitForConnectionListenerQueue(int inst, double timeout);
+
+  public static native int createRpcCallPoller(int inst);
+  public static native void destroyRpcCallPoller(int poller);
+  public static native void createPolledRpc(int entry, byte[] def, int poller);
+  public static native RpcAnswer[] pollRpc(NetworkTableInstance inst, int poller) throws InterruptedException;
+  public static native RpcAnswer[] pollRpcTimeout(NetworkTableInstance inst, int poller, double timeout) throws InterruptedException;
+  public static native void cancelPollRpc(int poller);
+  public static native boolean waitForRpcCallQueue(int inst, double timeout);
+  public static native void postRpcResponse(int entry, int call, byte[] result);
+  public static native int callRpc(int entry, byte[] params);
+  public static native byte[] getRpcResult(int entry, int call);
+  public static native byte[] getRpcResult(int entry, int call, double timeout);
+  public static native void cancelRpcResult(int entry, int call);
+
+  public static native byte[] getRpc(int entry, byte[] defaultValue);
+
+  public static native void setNetworkIdentity(int inst, String name);
+  public static native int getNetworkMode(int inst);
+  public static native void startServer(int inst, String persistFilename, String listenAddress, int port);
+  public static native void stopServer(int inst);
+  public static native void startClient(int inst);
+  public static native void startClient(int inst, String serverName, int port);
+  public static native void startClient(int inst, String[] serverNames, int[] ports);
+  public static native void startClientTeam(int inst, int team, int port);
+  public static native void stopClient(int inst);
+  public static native void setServer(int inst, String serverName, int port);
+  public static native void setServer(int inst, String[] serverNames, int[] ports);
+  public static native void setServerTeam(int inst, int team, int port);
+  public static native void startDSClient(int inst, int port);
+  public static native void stopDSClient(int inst);
+  public static native void setUpdateRate(int inst, double interval);
+
+  public static native void flush(int inst);
+
+  public static native ConnectionInfo[] getConnections(int inst);
+
+  public static native boolean isConnected(int inst);
+
+  public static native void savePersistent(int inst, String filename) throws PersistentException;
+  public static native String[] loadPersistent(int inst, String filename) throws PersistentException;  // returns warnings
+
+  public static native void saveEntries(int inst, String filename, String prefix) throws PersistentException;
+  public static native String[] loadEntries(int inst, String filename, String prefix) throws PersistentException;  // returns warnings
+
+  public static native long now();
+
+  public static native int createLoggerPoller(int inst);
+  public static native void destroyLoggerPoller(int poller);
+  public static native int addPolledLogger(int poller, int minLevel, int maxLevel);
+  public static native LogMessage[] pollLogger(NetworkTableInstance inst, int poller) throws InterruptedException;
+  public static native LogMessage[] pollLoggerTimeout(NetworkTableInstance inst, int poller, double timeout) throws InterruptedException;
+  public static native void cancelPollLogger(int poller);
+  public static native void removeLogger(int logger);
+  public static native boolean waitForLoggerQueue(int inst, double timeout);
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/PersistentException.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/PersistentException.java
new file mode 100644
index 0000000..194e3fb
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/PersistentException.java
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.io.IOException;
+
+/**
+ * An exception thrown when persistent load/save fails in a {@link NetworkTable}
+ *
+ */
+public final class PersistentException extends IOException {
+  public static final long serialVersionUID = 0;
+
+  /**
+   * @param message The error message
+   */
+  public PersistentException(String message) {
+    super(message);
+  }
+
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/RpcAnswer.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/RpcAnswer.java
new file mode 100644
index 0000000..428fb8a
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/RpcAnswer.java
@@ -0,0 +1,91 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables Remote Procedure Call (Server Side).
+ */
+public final class RpcAnswer {
+  /** Entry handle. */
+  public final int entry;
+
+  /** Call handle. */
+  public int call;
+
+  /** Entry name. */
+  public final String name;
+
+  /** Call raw parameters. */
+  public final String params;
+
+  /** Connection that called the RPC. */
+  public final ConnectionInfo conn;
+
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param inst Instance
+   * @param entry Entry handle
+   * @param call Call handle
+   * @param name Entry name
+   * @param params Call raw parameters
+   * @param conn Connection info
+   */
+  public RpcAnswer(NetworkTableInstance inst, int entry, int call, String name, String params, ConnectionInfo conn) {
+    this.inst = inst;
+    this.entry = entry;
+    this.call = call;
+    this.name = name;
+    this.params = params;
+    this.conn = conn;
+  }
+
+  static final byte[] emptyResponse = new byte[] {};
+
+  /**
+   * Posts an empty response if one was not previously sent.
+   */
+  public synchronized void free() {
+    if (call != 0) {
+      postResponse(emptyResponse);
+    }
+  }
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  public boolean isValid() {
+    return call != 0;
+  }
+
+  /**
+   * Post RPC response (return value) for a polled RPC.
+   * @param result  result raw data that will be provided to remote caller
+   */
+  public void postResponse(byte[] result) {
+    NetworkTablesJNI.postRpcResponse(entry, call, result);
+    call = 0;
+  }
+
+  /* Network table instance. */
+  private final NetworkTableInstance inst;
+
+  /* Cached entry object. */
+  NetworkTableEntry entryObject;
+
+  /**
+   * Get the entry as an object.
+   * @return NetworkTableEntry for the RPC.
+   */
+  NetworkTableEntry getEntry() {
+    if (entryObject == null) {
+      entryObject = new NetworkTableEntry(inst, entry);
+    }
+    return entryObject;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/RpcCall.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/RpcCall.java
new file mode 100644
index 0000000..a07b3c7
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/RpcCall.java
@@ -0,0 +1,93 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * NetworkTables Remote Procedure Call.
+ */
+public final class RpcCall {
+  /** Constructor.
+   * This should generally only be used internally to NetworkTables.
+   * @param entry Entry
+   * @param call Call handle
+   */
+  public RpcCall(NetworkTableEntry entry, int call) {
+    m_entry = entry;
+    m_call = call;
+  }
+
+  /**
+   * Cancels the result if no other action taken.
+   */
+  public synchronized void free() {
+    if (m_call != 0) {
+      cancelResult();
+    }
+  }
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  public boolean isValid() {
+    return m_call != 0;
+  }
+
+  /**
+   * Get the RPC entry.
+   * @return NetworkTableEntry for the RPC.
+   */
+  public NetworkTableEntry getEntry() {
+    return m_entry;
+  }
+
+  /**
+   * Get the call native handle.
+   * @return Native handle.
+   */
+  public int getCall() {
+    return m_call;
+  }
+
+  /**
+   * Get the result (return value).  This function blocks until
+   * the result is received.
+   * @return Received result (output)
+   */
+  public byte[] getResult() {
+    byte[] result = NetworkTablesJNI.getRpcResult(m_entry.getHandle(), m_call);
+    if (result.length != 0) {
+      m_call = 0;
+    }
+    return result;
+  }
+
+  /**
+   * Get the result (return value).  This function blocks until
+   * the result is received or it times out.
+   * @param timeout     timeout, in seconds
+   * @return Received result (output)
+   */
+  public byte[] getResult(double timeout) {
+    byte[] result = NetworkTablesJNI.getRpcResult(m_entry.getHandle(), m_call, timeout);
+    if (result.length != 0) {
+      m_call = 0;
+    }
+    return result;
+  }
+
+  /**
+   * Ignore the result.  This function is non-blocking.
+   */
+  public void cancelResult() {
+    NetworkTablesJNI.cancelRpcResult(m_entry.getHandle(), m_call);
+  }
+
+  private final NetworkTableEntry m_entry;
+  private int m_call;
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/TableEntryListener.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/TableEntryListener.java
new file mode 100644
index 0000000..aaeb248
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/TableEntryListener.java
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * A listener that listens to changes in values in a {@link NetworkTable}
+ */
+@FunctionalInterface
+public interface TableEntryListener extends EntryListenerFlags {
+  /**
+   * Called when a key-value pair is changed in a {@link NetworkTable}.
+   *
+   * @param table the table the key-value pair exists in
+   * @param key the key associated with the value that changed
+   * @param entry the entry associated with the value that changed
+   * @param value the new value
+   * @param flags update flags; for example, EntryListenerFlags.kNew if the key
+   * did not previously exist in the table
+   */
+  void valueChanged(NetworkTable table, String key, NetworkTableEntry entry, NetworkTableValue value, int flags);
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/TableListener.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/TableListener.java
new file mode 100644
index 0000000..276f6f9
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/networktables/TableListener.java
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+/**
+ * A listener that listens to new tables in a {@link NetworkTable}
+ */
+@FunctionalInterface
+public interface TableListener {
+  /**
+   * Called when a new table is created within a {@link NetworkTable}.
+   *
+   * @param parent the parent of the table
+   * @param name the name of the new table
+   * @param table the new table
+   */
+  void tableCreated(NetworkTable parent, String name, NetworkTable table);
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/networktables/NetworkTable.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/networktables/NetworkTable.java
new file mode 100644
index 0000000..66cf86a
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/networktables/NetworkTable.java
@@ -0,0 +1,1166 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.networktables;
+
+import edu.wpi.first.networktables.ConnectionInfo;
+import edu.wpi.first.networktables.ConnectionNotification;
+import edu.wpi.first.networktables.EntryInfo;
+import edu.wpi.first.networktables.EntryNotification;
+import edu.wpi.first.networktables.NetworkTableEntry;
+import edu.wpi.first.networktables.NetworkTableInstance;
+import edu.wpi.first.networktables.NetworkTableType;
+import edu.wpi.first.networktables.NetworkTableValue;
+import edu.wpi.first.networktables.NetworkTablesJNI;
+import edu.wpi.first.networktables.PersistentException;
+import edu.wpi.first.wpilibj.tables.IRemote;
+import edu.wpi.first.wpilibj.tables.IRemoteConnectionListener;
+import edu.wpi.first.wpilibj.tables.ITable;
+import edu.wpi.first.wpilibj.tables.ITableListener;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.function.Consumer;
+
+/**
+ * A network table that knows its subtable path.
+ * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable} instead.
+ */
+@Deprecated
+public class NetworkTable implements ITable, IRemote {
+  /**
+   * The path separator for sub-tables and keys
+   *
+   */
+  public static final char PATH_SEPARATOR = '/';
+  /**
+   * The default port that network tables operates on
+   */
+  public static final int DEFAULT_PORT = 1735;
+
+  private static boolean client = false;
+  private static boolean enableDS = true;
+  private static boolean running = false;
+  private static int port = DEFAULT_PORT;
+  private static String persistentFilename = "networktables.ini";
+
+  private synchronized static void checkInit() {
+    if (running)
+      throw new IllegalStateException(
+          "Network tables has already been initialized");
+  }
+
+  /**
+   * initializes network tables
+   * @deprecated Use {@link NetworkTableInstance#startServer()} or
+   * {@link NetworkTableInstance#startClient()} instead.
+   */
+  @Deprecated
+  public synchronized static void initialize() {
+    if (running)
+      shutdown();
+    NetworkTableInstance inst = NetworkTableInstance.getDefault();
+    if (client) {
+      inst.startClient();
+      if (enableDS)
+        inst.startDSClient(port);
+    } else
+      inst.startServer(persistentFilename, "", port);
+    running = true;
+  }
+
+  /**
+   * shuts down network tables
+   * @deprecated Use {@link NetworkTableInstance#stopServer()} or
+   * {@link NetworkTableInstance#stopClient()} instead.
+   */
+  @Deprecated
+  public synchronized static void shutdown() {
+    if (!running)
+      return;
+    NetworkTableInstance inst = NetworkTableInstance.getDefault();
+    if (client) {
+      inst.stopDSClient();
+      inst.stopClient();
+    } else
+      inst.stopServer();
+    running = false;
+  }
+
+  /**
+   * set that network tables should be a server
+   * This must be called before initialize or getTable
+   * @deprecated Use {@link NetworkTableInstance#startServer()} instead.
+   */
+  @Deprecated
+  public synchronized static void setServerMode() {
+    if (!client)
+      return;
+    checkInit();
+    client = false;
+  }
+
+  /**
+   * set that network tables should be a client
+   * This must be called before initialize or getTable
+   * @deprecated Use {@link NetworkTableInstance#startClient()} instead.
+   */
+  @Deprecated
+  public synchronized static void setClientMode() {
+    if (client)
+      return;
+    checkInit();
+    client = true;
+  }
+
+  /**
+   * set the team the robot is configured for (this will set the mdns address that
+   * network tables will connect to in client mode)
+   * This must be called before initialize or getTable
+   * @param team the team number
+   * @deprecated Use {@link NetworkTableInstance#setServerTeam(int)} or
+   * {@link NetworkTableInstance#startClientTeam(int)} instead.
+   */
+  @Deprecated
+  public synchronized static void setTeam(int team) {
+    NetworkTableInstance inst = NetworkTableInstance.getDefault();
+    inst.setServerTeam(team, port);
+    if (enableDS)
+      inst.startDSClient(port);
+  }
+
+  /**
+   * @param address the address that network tables will connect to in client
+   * mode
+   * @deprecated Use {@link NetworkTableInstance#setServer(String)} or
+   * {@link NetworkTableInstance#startClient(String)} instead.
+   */
+  @Deprecated
+  public synchronized static void setIPAddress(final String address) {
+    String[] addresses = new String[1];
+    addresses[0] = address;
+    setIPAddress(addresses);
+  }
+
+  /**
+   * @param addresses the adresses that network tables will connect to in
+   * client mode (in round robin order)
+   * @deprecated Use {@link NetworkTableInstance#setServer(String[])} or
+   * {@link NetworkTableInstance#startClient(String[])} instead.
+   */
+  @Deprecated
+  public synchronized static void setIPAddress(final String[] addresses) {
+    NetworkTableInstance inst = NetworkTableInstance.getDefault();
+    inst.setServer(addresses, port);
+
+    // Stop the DS client if we're explicitly connecting to localhost
+    if (addresses.length > 0 &&
+        (addresses[0].equals("localhost") || addresses[0].equals("127.0.0.1")))
+      inst.stopDSClient();
+    else if (enableDS)
+      inst.startDSClient(port);
+  }
+
+  /**
+   * Set the port number that network tables will connect to in client
+   * mode or listen to in server mode.
+   * @param aport the port number
+   * @deprecated Use the appropriate parameters to
+   * {@link NetworkTableInstance#setServer(String, int)},
+   * {@link NetworkTableInstance#startClient(String, int)},
+   * {@link NetworkTableInstance#startServer(String, String, int)}, and
+   * {@link NetworkTableInstance#startDSClient(int)} instead.
+   */
+  @Deprecated
+  public synchronized static void setPort(int aport) {
+    if (port == aport)
+      return;
+    checkInit();
+    port = aport;
+  }
+
+  /**
+   * Enable requesting the server address from the Driver Station.
+   * @param enabled whether to enable the connection to the local DS
+   * @deprecated Use {@link NetworkTableInstance#startDSClient()} and
+   * {@link NetworkTableInstance#stopDSClient()} instead.
+   */
+  @Deprecated
+  public synchronized static void setDSClientEnabled(boolean enabled) {
+    NetworkTableInstance inst = NetworkTableInstance.getDefault();
+    enableDS = enabled;
+    if (enableDS)
+      inst.startDSClient(port);
+    else
+      inst.stopDSClient();
+  }
+
+  /**
+   * Sets the persistent filename.
+   * @param filename the filename that the network tables server uses for
+   * automatic loading and saving of persistent values
+   * @deprecated Use the appropriate parameter to
+   * {@link NetworkTableInstance#startServer()} instead.
+   */
+  @Deprecated
+  public synchronized static void setPersistentFilename(final String filename) {
+    if (persistentFilename.equals(filename))
+      return;
+    checkInit();
+    persistentFilename = filename;
+  }
+
+  /**
+   * Sets the network identity.
+   * This is provided in the connection info on the remote end.
+   * @param name identity
+   * @deprecated Use {@link NetworkTableInstance#setNetworkIdentity(String)}
+   * instead.
+   */
+  @Deprecated
+  public static void setNetworkIdentity(String name) {
+    NetworkTableInstance.getDefault().setNetworkIdentity(name);
+  }
+
+  public static boolean[] toNative(Boolean[] arr) {
+    boolean[] out = new boolean[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i];
+    return out;
+  }
+
+  public static double[] toNative(Number[] arr) {
+    double[] out = new double[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i].doubleValue();
+    return out;
+  }
+
+  public static Boolean[] fromNative(boolean[] arr) {
+    Boolean[] out = new Boolean[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i];
+    return out;
+  }
+
+  public static Double[] fromNative(double[] arr) {
+    Double[] out = new Double[arr.length];
+    for (int i = 0; i < arr.length; i++)
+      out[i] = arr[i];
+    return out;
+  }
+
+  /**
+   * Gets the table with the specified key. If the table does not exist, a new
+   * table will be created.<br>
+   * This will automatically initialize network tables if it has not been
+   * already
+   *
+   * @deprecated Use {@link NetworkTableInstance#getTable(String)} instead.
+   *
+   * @param key   the key name
+   * @return the network table requested
+   */
+  @Deprecated
+  public synchronized static NetworkTable getTable(String key) {
+    if (!running)
+      initialize();
+    String theKey;
+    if (key.isEmpty() || key.equals("/")) {
+      theKey = "";
+    } else if (key.charAt(0) == NetworkTable.PATH_SEPARATOR) {
+      theKey = key;
+    } else {
+      theKey = NetworkTable.PATH_SEPARATOR + key;
+    }
+    return new NetworkTable(NetworkTableInstance.getDefault(), theKey);
+  }
+
+  private final String path;
+  private final String pathWithSep;
+  private final NetworkTableInstance inst;
+
+  NetworkTable(NetworkTableInstance inst, String path) {
+    this.path = path;
+    this.pathWithSep = path + PATH_SEPARATOR;
+    this.inst = inst;
+  }
+
+  public String toString() { return "NetworkTable: " + path; }
+
+  private final ConcurrentMap<String, NetworkTableEntry> entries = new ConcurrentHashMap<String, NetworkTableEntry>();
+
+  /**
+   * Gets the entry for a subkey.
+   * @param key the key name
+   * @return Network table entry.
+   */
+  private NetworkTableEntry getEntry(String key) {
+    NetworkTableEntry entry = entries.get(key);
+    if (entry == null) {
+      entry = inst.getEntry(pathWithSep + key);
+      entries.putIfAbsent(key, entry);
+    }
+    return entry;
+  }
+
+  /**
+   * Gets the current network connections.
+   * @return An array of connection information.
+   * @deprecated Use {@link NetworkTableInstance#getConnections()} instead.
+   */
+  @Deprecated
+  public static ConnectionInfo[] connections() {
+    return NetworkTableInstance.getDefault().getConnections();
+  }
+
+  /**
+   * Determine whether or not a network connection is active.
+   * @return True if connected, false if not connected.
+   * @deprecated Use {@link NetworkTableInstance#isConnected()} instead.
+   */
+  @Deprecated
+  public boolean isConnected() {
+    return inst.isConnected();
+  }
+
+  /**
+   * Determine whether NetworkTables is operating as a server or as a client.
+   * @return True if operating as a server, false otherwise.
+   * @deprecated Use {@link NetworkTableInstance#getNetworkMode()} instead.
+   */
+  @Deprecated
+  public boolean isServer() {
+    return (inst.getNetworkMode() & NetworkTableInstance.kNetModeServer) != 0;
+  }
+
+  /* Backwards compatibility shims for IRemoteConnectionListener */
+  private static class ConnectionListenerAdapter implements Consumer<ConnectionNotification> {
+    public int uid;
+    private final IRemote targetSource;
+    private final IRemoteConnectionListener targetListener;
+
+    public ConnectionListenerAdapter(IRemote targetSource, IRemoteConnectionListener targetListener) {
+      this.targetSource = targetSource;
+      this.targetListener = targetListener;
+    }
+
+    @Override
+    public void accept(ConnectionNotification event) {
+      if (event.connected)
+        targetListener.connectedEx(targetSource, event.conn);
+      else
+        targetListener.disconnectedEx(targetSource, event.conn);
+    }
+  }
+
+  private static final HashMap<IRemoteConnectionListener,ConnectionListenerAdapter> globalConnectionListenerMap = new HashMap<IRemoteConnectionListener,ConnectionListenerAdapter>();
+
+  private static IRemote staticRemote = new IRemote() {
+    public void addConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify) {
+      NetworkTable.addGlobalConnectionListener(listener, immediateNotify);
+    }
+    public void removeConnectionListener(IRemoteConnectionListener listener) {
+      NetworkTable.removeGlobalConnectionListener(listener);
+    }
+    public boolean isConnected() {
+      ConnectionInfo[] conns = NetworkTableInstance.getDefault().getConnections();
+      return conns.length > 0;
+    }
+    public boolean isServer() {
+      return (NetworkTableInstance.getDefault().getNetworkMode() & NetworkTableInstance.kNetModeServer) != 0;
+    }
+  };
+
+  private final HashMap<IRemoteConnectionListener,ConnectionListenerAdapter> connectionListenerMap = new HashMap<IRemoteConnectionListener,ConnectionListenerAdapter>();
+
+  /**
+   * Add a connection listener.
+   * @param listener connection listener
+   * @param immediateNotify call listener immediately for all existing connections
+   * @deprecated Use {@link NetworkTableInstance#addConnectionListener(Consumer, boolean)} instead.
+   */
+  @Deprecated
+  public static synchronized void addGlobalConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify) {
+    ConnectionListenerAdapter adapter = new ConnectionListenerAdapter(staticRemote, listener);
+    if (globalConnectionListenerMap.putIfAbsent(listener, adapter) != null) {
+      throw new IllegalStateException("Cannot add the same listener twice");
+    }
+    adapter.uid = NetworkTableInstance.getDefault().addConnectionListener(adapter, immediateNotify);
+  }
+
+  /**
+   * Remove a connection listener.
+   * @param listener connection listener
+   * @deprecated Use {@link NetworkTableInstance#removeConnectionListener(int)} instead.
+   */
+  @Deprecated
+  public static synchronized void removeGlobalConnectionListener(IRemoteConnectionListener listener) {
+    ConnectionListenerAdapter adapter = globalConnectionListenerMap.remove(listener);
+    if (adapter != null) {
+      NetworkTableInstance.getDefault().removeConnectionListener(adapter.uid);
+    }
+  }
+
+  /**
+   * Add a connection listener.
+   * @param listener connection listener
+   * @param immediateNotify call listener immediately for all existing connections
+   * @deprecated Use {@link NetworkTableInstance#addConnectionListener(Consumer, boolean)} instead.
+   */
+  @Deprecated
+  public synchronized void addConnectionListener(IRemoteConnectionListener listener,
+                                                 boolean immediateNotify) {
+    ConnectionListenerAdapter adapter = new ConnectionListenerAdapter(this, listener);
+    if (connectionListenerMap.putIfAbsent(listener, adapter) != null) {
+      throw new IllegalStateException("Cannot add the same listener twice");
+    }
+    adapter.uid = inst.addConnectionListener(adapter, immediateNotify);
+  }
+
+  /**
+   * Remove a connection listener.
+   * @param listener connection listener
+   * @deprecated Use {@link NetworkTableInstance#removeConnectionListener(int)} instead.
+   */
+  @Deprecated
+  public synchronized void removeConnectionListener(IRemoteConnectionListener listener) {
+    ConnectionListenerAdapter adapter = connectionListenerMap.get(listener);
+    if (adapter != null && connectionListenerMap.remove(listener, adapter)) {
+      inst.removeConnectionListener(adapter.uid);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addEntryListener(TableEntryListener, int)} instead
+   * (with flags value of NOTIFY_NEW | NOTIFY_UPDATE).
+   */
+  @Override
+  @Deprecated
+  public void addTableListener(ITableListener listener) {
+    addTableListenerEx(listener, NOTIFY_NEW | NOTIFY_UPDATE);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addEntryListener(TableEntryListener, int)} instead
+   * (with flags value of NOTIFY_NEW | NOTIFY_UPDATE | NOTIFY_IMMEDIATE).
+   */
+  @Override
+  @Deprecated
+  public void addTableListener(ITableListener listener,
+                               boolean immediateNotify) {
+    int flags = NOTIFY_NEW | NOTIFY_UPDATE;
+    if (immediateNotify)
+      flags |= NOTIFY_IMMEDIATE;
+    addTableListenerEx(listener, flags);
+  }
+
+  /* Base class for listeners; stores uid to implement remove functions */
+  private static class ListenerBase {
+    public int uid;
+  }
+
+  private class OldTableListenerAdapter extends ListenerBase implements Consumer<EntryNotification> {
+    private final int prefixLen;
+    private final ITable targetSource;
+    private final ITableListener targetListener;
+
+    public OldTableListenerAdapter(int prefixLen, ITable targetSource, ITableListener targetListener) {
+      this.prefixLen = prefixLen;
+      this.targetSource = targetSource;
+      this.targetListener = targetListener;
+    }
+
+    @Override
+    public void accept(EntryNotification event) {
+      String relativeKey = event.name.substring(prefixLen);
+      if (relativeKey.indexOf(PATH_SEPARATOR) != -1)
+        return;
+      targetListener.valueChangedEx(targetSource, relativeKey, event.value.getValue(), event.flags);
+    }
+  }
+
+  private final HashMap<ITableListener,List<ListenerBase>> oldListenerMap = new HashMap<ITableListener,List<ListenerBase>>();
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addEntryListener(TableEntryListener, int)} instead.
+   */
+  @Override
+  @Deprecated
+  public synchronized void addTableListenerEx(ITableListener listener,
+                                              int flags) {
+    List<ListenerBase> adapters = oldListenerMap.get(listener);
+    if (adapters == null) {
+      adapters = new ArrayList<ListenerBase>();
+      oldListenerMap.put(listener, adapters);
+    }
+    OldTableListenerAdapter adapter =
+        new OldTableListenerAdapter(path.length() + 1, this, listener);
+    adapter.uid = inst.addEntryListener(pathWithSep, adapter, flags);
+    adapters.add(adapter);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addEntryListener(String, TableEntryListener, int)}
+   * or {@link NetworkTableEntry#addListener(Consumer, int)} instead.
+   */
+  @Override
+  @Deprecated
+  public void addTableListener(String key, ITableListener listener,
+                               boolean immediateNotify) {
+    int flags = NOTIFY_NEW | NOTIFY_UPDATE;
+    if (immediateNotify)
+      flags |= NOTIFY_IMMEDIATE;
+    addTableListenerEx(key, listener, flags);
+  }
+
+  private class OldKeyListenerAdapter extends ListenerBase implements Consumer<EntryNotification> {
+    private final String relativeKey;
+    private final ITable targetSource;
+    private final ITableListener targetListener;
+
+    public OldKeyListenerAdapter(String relativeKey, ITable targetSource, ITableListener targetListener) {
+      this.relativeKey = relativeKey;
+      this.targetSource = targetSource;
+      this.targetListener = targetListener;
+    }
+
+    @Override
+    public void accept(EntryNotification event) {
+      targetListener.valueChangedEx(targetSource, relativeKey, event.value.getValue(), event.flags);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addEntryListener(String, TableEntryListener, int)}
+   * or {@link NetworkTableEntry#addListener(Consumer, int)} instead.
+   */
+  @Override
+  @Deprecated
+  public synchronized void addTableListenerEx(String key,
+                                              ITableListener listener,
+                                              int flags) {
+    List<ListenerBase> adapters = oldListenerMap.get(listener);
+    if (adapters == null) {
+      adapters = new ArrayList<ListenerBase>();
+      oldListenerMap.put(listener, adapters);
+    }
+    OldKeyListenerAdapter adapter = new OldKeyListenerAdapter(key, this, listener);
+    adapter.uid = inst.addEntryListener(getEntry(key), adapter, flags);
+    adapters.add(adapter);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addSubTableListener(TableListener, boolean)}
+   * instead.
+   */
+  @Override
+  @Deprecated
+  public void addSubTableListener(final ITableListener listener) {
+    addSubTableListener(listener, false);
+  }
+
+  private class OldSubListenerAdapter extends ListenerBase implements Consumer<EntryNotification> {
+    private final int prefixLen;
+    private final ITable targetSource;
+    private final ITableListener targetListener;
+    private final Set<String> notifiedTables = new HashSet<String>();
+
+    public OldSubListenerAdapter(int prefixLen, ITable targetSource, ITableListener targetListener) {
+      this.prefixLen = prefixLen;
+      this.targetSource = targetSource;
+      this.targetListener = targetListener;
+    }
+
+    @Override
+    public void accept(EntryNotification event) {
+      String relativeKey = event.name.substring(prefixLen);
+      int endSubTable = relativeKey.indexOf(PATH_SEPARATOR);
+      if (endSubTable == -1)
+        return;
+      String subTableKey = relativeKey.substring(0, endSubTable);
+      if (notifiedTables.contains(subTableKey))
+        return;
+      notifiedTables.add(subTableKey);
+      targetListener.valueChangedEx(targetSource, subTableKey, targetSource.getSubTable(subTableKey), event.flags);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#addSubTableListener(TableListener, boolean)}
+   * instead.
+   */
+  @Override
+  @Deprecated
+  public synchronized void addSubTableListener(final ITableListener listener,
+                                               boolean localNotify) {
+    List<ListenerBase> adapters = oldListenerMap.get(listener);
+    if (adapters == null) {
+      adapters = new ArrayList<ListenerBase>();
+      oldListenerMap.put(listener, adapters);
+    }
+    OldSubListenerAdapter adapter =
+        new OldSubListenerAdapter(path.length() + 1, this, listener);
+    int flags = NOTIFY_NEW | NOTIFY_IMMEDIATE;
+    if (localNotify)
+      flags |= NOTIFY_LOCAL;
+    adapter.uid = inst.addEntryListener(pathWithSep, adapter, flags);
+    adapters.add(adapter);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable#removeTableListener(int)} instead.
+   */
+  @Override
+  @Deprecated
+  public synchronized void removeTableListener(ITableListener listener) {
+    List<ListenerBase> adapters = oldListenerMap.remove(listener);
+    if (adapters != null) {
+      for (ListenerBase adapter : adapters)
+        inst.removeEntryListener(adapter.uid);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public ITable getSubTable(String key) {
+    return new NetworkTable(inst, pathWithSep + key);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean containsKey(String key) {
+    return getEntry(key).exists();
+  }
+
+  public boolean containsSubTable(String key) {
+    int[] handles = NetworkTablesJNI.getEntries(inst.getHandle(), pathWithSep + key + PATH_SEPARATOR, 0);
+    return handles.length != 0;
+  }
+
+  /**
+   * @param types bitmask of types; 0 is treated as a "don't care".
+   * @return keys currently in the table
+   */
+  public Set<String> getKeys(int types) {
+    Set<String> keys = new HashSet<String>();
+    int prefixLen = path.length() + 1;
+    for (EntryInfo info : inst.getEntryInfo(pathWithSep, types)) {
+      String relativeKey = info.name.substring(prefixLen);
+      if (relativeKey.indexOf(PATH_SEPARATOR) != -1)
+        continue;
+      keys.add(relativeKey);
+      // populate entries as we go
+      if (entries.get(relativeKey) == null) {
+        entries.putIfAbsent(relativeKey, new NetworkTableEntry(inst, info.entry));
+      }
+    }
+    return keys;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Set<String> getKeys() {
+    return getKeys(0);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Set<String> getSubTables() {
+    Set<String> keys = new HashSet<String>();
+    int prefixLen = path.length() + 1;
+    for (EntryInfo info : inst.getEntryInfo(pathWithSep, 0)) {
+      String relativeKey = info.name.substring(prefixLen);
+      int endSubTable = relativeKey.indexOf(PATH_SEPARATOR);
+      if (endSubTable == -1)
+        continue;
+      keys.add(relativeKey.substring(0, endSubTable));
+    }
+    return keys;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putNumber(String key, double value) {
+    return getEntry(key).setNumber(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultNumber(String key, double defaultValue) {
+    return getEntry(key).setDefaultDouble(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public double getNumber(String key, double defaultValue) {
+    return getEntry(key).getDouble(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putString(String key, String value) {
+    return getEntry(key).setString(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultString(String key, String defaultValue) {
+    return getEntry(key).setDefaultString(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String getString(String key, String defaultValue) {
+    return getEntry(key).getString(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putBoolean(String key, boolean value) {
+    return getEntry(key).setBoolean(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultBoolean(String key, boolean defaultValue) {
+    return getEntry(key).setDefaultBoolean(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean getBoolean(String key, boolean defaultValue) {
+    return getEntry(key).getBoolean(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putBooleanArray(String key, boolean[] value) {
+    return getEntry(key).setBooleanArray(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putBooleanArray(String key, Boolean[] value) {
+    return getEntry(key).setBooleanArray(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultBooleanArray(String key, boolean[] defaultValue) {
+    return getEntry(key).setDefaultBooleanArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultBooleanArray(String key, Boolean[] defaultValue) {
+    return getEntry(key).setDefaultBooleanArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean[] getBooleanArray(String key, boolean[] defaultValue) {
+    return getEntry(key).getBooleanArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Boolean[] getBooleanArray(String key, Boolean[] defaultValue) {
+    return getEntry(key).getBooleanArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putNumberArray(String key, double[] value) {
+    return getEntry(key).setDoubleArray(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putNumberArray(String key, Double[] value) {
+    return getEntry(key).setNumberArray(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultNumberArray(String key, double[] defaultValue) {
+    return getEntry(key).setDefaultDoubleArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultNumberArray(String key, Double[] defaultValue) {
+    return getEntry(key).setDefaultNumberArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public double[] getNumberArray(String key, double[] defaultValue) {
+    return getEntry(key).getDoubleArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Double[] getNumberArray(String key, Double[] defaultValue) {
+    return getEntry(key).getDoubleArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putStringArray(String key, String[] value) {
+    return getEntry(key).setStringArray(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultStringArray(String key, String[] defaultValue) {
+    return getEntry(key).setDefaultStringArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String[] getStringArray(String key, String[] defaultValue) {
+    return getEntry(key).getStringArray(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putRaw(String key, byte[] value) {
+    return getEntry(key).setRaw(value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public boolean setDefaultRaw(String key, byte[] defaultValue) {
+    return getEntry(key).setDefaultRaw(defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean putRaw(String key, ByteBuffer value, int len) {
+    return getEntry(key).setRaw(value, len);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public byte[] getRaw(String key, byte[] defaultValue) {
+    return getEntry(key).getRaw(defaultValue);
+  }
+
+  /**
+   * Put a value in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putValue(String key, NetworkTableValue value) {
+    return getEntry(key).setValue(value);
+  }
+
+  /**
+   * Sets the current value in the table if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultValue(String key, NetworkTableValue defaultValue) {
+    return getEntry(key).setDefaultValue(defaultValue);
+  }
+
+  /**
+   * Gets the value associated with a key as a NetworkTableValue object.
+   * @param key the key of the value to look up
+   * @return the value associated with the given key
+   */
+  public NetworkTableValue getValue(String key) {
+    return getEntry(key).getValue();
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTableEntry#setValue(Object)}
+   * instead, e.g. `NetworkTable.getEntry(key).setValue(NetworkTableEntry.makeBoolean(false));`
+   * or `NetworkTable.getEntry(key).setValue(new Boolean(false));`
+   */
+  @Deprecated
+  public boolean putValue(String key, Object value) throws IllegalArgumentException {
+    if (value instanceof Boolean)
+      return putBoolean(key, ((Boolean)value).booleanValue());
+    else if (value instanceof Number)
+      return putDouble(key, ((Number)value).doubleValue());
+    else if (value instanceof String)
+      return putString(key, (String)value);
+    else if (value instanceof byte[])
+      return putRaw(key, (byte[])value);
+    else if (value instanceof boolean[])
+      return putBooleanArray(key, (boolean[])value);
+    else if (value instanceof double[])
+      return putNumberArray(key, (double[])value);
+    else if (value instanceof Boolean[])
+      return putBooleanArray(key, toNative((Boolean[])value));
+    else if (value instanceof Number[])
+      return putNumberArray(key, toNative((Number[])value));
+    else if (value instanceof String[])
+      return putStringArray(key, (String[])value);
+    else if (value instanceof NetworkTableValue)
+      return getEntry(key).setValue((NetworkTableValue)value);
+    else
+      throw new IllegalArgumentException("Value of type " + value.getClass().getName() + " cannot be put into a table");
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link edu.wpi.first.networktables.NetworkTableEntry#getValue()}
+   * instead, e.g. `NetworkTable.getEntry(key).getValue();`
+   */
+  @Override
+  @Deprecated
+  public Object getValue(String key, Object defaultValue) {
+    NetworkTableValue value = getValue(key);
+    if (value.getType() == NetworkTableType.kUnassigned) {
+      return defaultValue;
+    }
+    return value.getValue();
+  }
+
+  /** The persistent flag value. */
+  public static final int PERSISTENT = 1;
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void setPersistent(String key) {
+    getEntry(key).setPersistent();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void clearPersistent(String key) {
+    getEntry(key).clearPersistent();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean isPersistent(String key) {
+    return getEntry(key).isPersistent();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void setFlags(String key, int flags) {
+    getEntry(key).setFlags(flags);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void clearFlags(String key, int flags) {
+    getEntry(key).clearFlags(flags);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public int getFlags(String key) {
+    return getEntry(key).getFlags();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void delete(String key) {
+    getEntry(key).delete();
+  }
+
+  /**
+   * Deletes ALL keys in ALL subtables.  Use with caution!
+   * @deprecated Use {@link NetworkTableInstance#deleteAllEntries()} instead.
+   */
+  @Deprecated
+  public static void globalDeleteAll() {
+    NetworkTableInstance.getDefault().deleteAllEntries();
+  }
+
+  /**
+   * Flushes all updated values immediately to the network.
+   * Note: This is rate-limited to protect the network from flooding.
+   * This is primarily useful for synchronizing network updates with
+   * user code.
+   * @deprecated Use {@link NetworkTableInstance#flush()} instead.
+   */
+  @Deprecated
+  public static void flush() {
+    NetworkTableInstance.getDefault().flush();
+  }
+
+  /**
+   * Set the periodic update rate.
+   *
+   * @param interval update interval in seconds (range 0.01 to 1.0)
+   * @deprecated Use {@link NetworkTableInstance#setUpdateRate(double)}
+   * instead.
+   */
+  @Deprecated
+  public static void setUpdateRate(double interval) {
+    NetworkTableInstance.getDefault().setUpdateRate(interval);
+  }
+
+  /**
+   * Saves persistent keys to a file.  The server does this automatically.
+   *
+   * @param filename file name
+   * @throws PersistentException if error saving file
+   * @deprecated Use {@link NetworkTableInstance#savePersistent(String)}
+   * instead.
+   */
+  @Deprecated
+  public static void savePersistent(String filename) throws PersistentException {
+    NetworkTableInstance.getDefault().savePersistent(filename);
+  }
+
+  /**
+   * Loads persistent keys from a file.  The server does this automatically.
+   *
+   * @param filename file name
+   * @return List of warnings (errors result in an exception instead)
+   * @throws PersistentException if error reading file
+   * @deprecated Use {@link NetworkTableInstance#loadPersistent(String)}
+   * instead.
+   */
+  @Deprecated
+  public static String[] loadPersistent(String filename) throws PersistentException {
+    return NetworkTableInstance.getDefault().loadPersistent(filename);
+  }
+
+  /*
+   * Deprecated Methods
+   */
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link #putNumber(String, double)} instead.
+   */
+  @Override
+  @Deprecated
+  public boolean putDouble(String key, double value) {
+    return putNumber(key, value);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @deprecated Use {@link #getNumber(String, double)} instead.
+   */
+  @Override
+  @Deprecated
+  public double getDouble(String key, double defaultValue) {
+    return getNumber(key, defaultValue);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String getPath() {
+    return path;
+  }
+
+  @Override
+  public boolean equals(Object o) {
+    if (o == this) {
+      return true;
+    }
+    if (!(o instanceof NetworkTable)) {
+      return false;
+    }
+    NetworkTable other = (NetworkTable) o;
+    return inst.equals(other.inst) && path.equals(other.path);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(inst, path);
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/IRemote.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/IRemote.java
new file mode 100644
index 0000000..89bcc8c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/IRemote.java
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.tables;
+
+
+/**
+ * Represents an object that has a remote connection
+ * @deprecated Use {@link edu.wpi.first.networktables.NetworkTableInstance}.
+ */
+@Deprecated
+public interface IRemote {
+	/**
+	 * Register an object to listen for connection and disconnection events
+	 *
+	 * @param listener the listener to be register
+	 * @param immediateNotify if the listener object should be notified of the current connection state
+	 */
+	public void addConnectionListener(IRemoteConnectionListener listener, boolean immediateNotify);
+
+	/**
+	 * Unregister a listener from connection events
+	 *
+	 * @param listener the listener to be unregistered
+	 */
+	public void removeConnectionListener(IRemoteConnectionListener listener);
+
+	/**
+	 * Get the current state of the objects connection
+	 * @return the current connection state
+	 */
+    public boolean isConnected();
+
+	/**
+	 * If the object is acting as a server
+	 * @return if the object is a server
+	 */
+    public boolean isServer();
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/IRemoteConnectionListener.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/IRemoteConnectionListener.java
new file mode 100644
index 0000000..7ab7abf
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/IRemoteConnectionListener.java
@@ -0,0 +1,46 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.tables;
+
+import edu.wpi.first.networktables.ConnectionInfo;
+
+/**
+ * A listener that listens for connection changes in a {@link IRemote} object
+ * @deprecated Use Consumer&lt;{@link edu.wpi.first.networktables.ConnectionNotification}&gt;.
+ */
+@Deprecated
+public interface IRemoteConnectionListener {
+	/**
+	 * Called when an IRemote is connected
+	 * @param remote the object that connected
+	 */
+	public void connected(IRemote remote);
+	/**
+	 * Called when an IRemote is disconnected
+	 * @param remote the object that disconnected
+	 */
+	public void disconnected(IRemote remote);
+	/**
+	 * Extended version of connected called when an IRemote is connected.
+ 	 * Contains the connection info of the connected remote
+	 * @param remote the object that connected
+	 * @param info the connection info for the connected remote
+	 */
+	default public void connectedEx(IRemote remote, ConnectionInfo info) {
+		connected(remote);
+	}
+	/**
+	 * Extended version of connected called when an IRemote is disconnected.
+	 * Contains the connection info of the disconnected remote
+	 * @param remote the object that disconnected
+	 * @param info the connection info for the disconnected remote
+	 */
+	default public void disconnectedEx(IRemote remote, ConnectionInfo info) {
+		disconnected(remote);
+	}
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/ITable.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/ITable.java
new file mode 100644
index 0000000..1cb74fd
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/ITable.java
@@ -0,0 +1,487 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.tables;
+
+import java.nio.ByteBuffer;
+import java.util.Set;
+
+
+/**
+ * A table whose values can be read and written to
+ * @deprecated Use {@link edu.wpi.first.networktables.NetworkTable}.
+ */
+@Deprecated
+public interface ITable {
+
+  /**
+   * Checks the table and tells if it contains the specified key
+   *
+   * @param key the key to search for
+   * @return true if the table as a value assigned to the given key
+   */
+  public boolean containsKey(String key);
+
+  /**
+   * @param key the key to search for
+   * @return true if there is a subtable with the key which contains at least
+   * one key/subtable of its own
+   */
+  public boolean containsSubTable(String key);
+
+  /**
+   * Returns the table at the specified key. If there is no table at the
+   * specified key, it will create a new table
+   *
+   * @param key the name of the table relative to this one
+   * @return a sub table relative to this one
+   */
+  public ITable getSubTable(String key);
+
+  /**
+   * Gets all keys in the table (not including sub-tables).
+   * @param types bitmask of types; 0 is treated as a "don't care".
+   * @return keys currently in the table
+   */
+  public Set<String> getKeys(int types);
+
+  /**
+   * Gets all keys in the table (not including sub-tables).
+   * @return keys currently in the table
+   */
+  public Set<String> getKeys();
+
+  /**
+   * Gets the names of all subtables in the table.
+   * @return subtables currently in the table
+   */
+  public Set<String> getSubTables();
+
+  /**
+   * Makes a key's value persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  public void setPersistent(String key);
+
+  /**
+   * Stop making a key's value persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  public void clearPersistent(String key);
+
+  /**
+   * Returns whether the value is persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   * @return True if the value is persistent.
+   */
+  public boolean isPersistent(String key);
+
+  /**
+   * Sets flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to set (bitmask)
+   */
+  public void setFlags(String key, int flags);
+
+  /**
+   * Clears flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to clear (bitmask)
+   */
+  public void clearFlags(String key, int flags);
+
+  /**
+   * Returns the flags for the specified key.
+   *
+   * @param key the key name
+   * @return the flags, or 0 if the key is not defined
+   */
+  public int getFlags(String key);
+
+  /**
+   * Deletes the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   */
+  public void delete(String key);
+
+  /**
+   * Gets the value associated with a key as an object.
+   * NOTE: If the value is a double, it will return a Double object,
+   * not a primitive.  To get the primitive, use
+   * {@link #getDouble(String, double)}.
+   * @param key the key of the value to look up
+   * @param defaultValue the default value if the key is null
+   * @return the value associated with the given key
+   */
+  public Object getValue(String key, Object defaultValue);
+
+  /**
+   * Put a value in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   * @throws IllegalArgumentException when the value is not supported by the
+   * table
+   */
+  public boolean putValue(String key, Object value)
+      throws IllegalArgumentException;
+
+  /**
+   * Put a number in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putNumber(String key, double value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultNumber(String key, double defaultValue);
+
+  /**
+   * Returns the number the key maps to. If the key does not exist or is of
+   * different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public double getNumber(String key, double defaultValue);
+
+  /**
+   * Put a string in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putString(String key, String value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultString(String key, String defaultValue);
+
+  /**
+   * Returns the string the key maps to. If the key does not exist or is of
+   * different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public String getString(String key, String defaultValue);
+
+  /**
+   * Put a boolean in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putBoolean(String key, boolean value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultBoolean(String key, boolean defaultValue);
+
+  /**
+   * Returns the boolean the key maps to. If the key does not exist or is of
+   * different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public boolean getBoolean(String key, boolean defaultValue);
+
+  /**
+   * Put a boolean array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putBooleanArray(String key, boolean[] value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultBooleanArray(String key, boolean[] defaultValue);
+
+  /**
+   * Put a boolean array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putBooleanArray(String key, Boolean[] value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultBooleanArray(String key, Boolean[] defaultValue);
+
+  /**
+   * Returns the boolean array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public boolean[] getBooleanArray(String key, boolean[] defaultValue);
+  /**
+   * Returns the boolean array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public Boolean[] getBooleanArray(String key, Boolean[] defaultValue);
+
+  /**
+   * Put a number array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putNumberArray(String key, double[] value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultNumberArray(String key, double[] defaultValue);
+
+  /**
+   * Put a number array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putNumberArray(String key, Double[] value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultNumberArray(String key, Double[] defaultValue);
+
+  /**
+   * Returns the number array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public double[] getNumberArray(String key, double[] defaultValue);
+  /**
+   * Returns the number array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public Double[] getNumberArray(String key, Double[] defaultValue);
+
+  /**
+   * Put a string array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putStringArray(String key, String[] value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultStringArray(String key, String[] defaultValue);
+
+  /**
+   * Returns the string array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public String[] getStringArray(String key, String[] defaultValue);
+
+  /**
+   * Put a raw value (byte array) in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putRaw(String key, byte[] value);
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doens't exist.
+   * @return False if the table key exists with a different type
+   */
+  public boolean setDefaultRaw(String key, byte[] defaultValue);
+
+  /**
+   * Put a raw value (bytes from a byte buffer) in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @param len the length of the value
+   * @return False if the table key already exists with a different type
+   */
+  public boolean putRaw(String key, ByteBuffer value, int len);
+
+  /**
+   * Returns the raw value (byte array) the key maps to. If the key does not
+   * exist or is of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  public byte[] getRaw(String key, byte[] defaultValue);
+
+  /** Notifier flag values. */
+  public static final int NOTIFY_IMMEDIATE = 0x01;
+  public static final int NOTIFY_LOCAL = 0x02;
+  public static final int NOTIFY_NEW = 0x04;
+  public static final int NOTIFY_DELETE = 0x08;
+  public static final int NOTIFY_UPDATE = 0x10;
+  public static final int NOTIFY_FLAGS = 0x20;
+
+  /**
+   * Add a listener for changes to the table
+   * @param listener the listener to add
+   */
+  public void addTableListener(ITableListener listener);
+  /**
+   * Add a listener for changes to the table
+   * @param listener the listener to add
+   * @param immediateNotify if true then this listener will be notified of all
+   * current entries (marked as new)
+   */
+  public void addTableListener(ITableListener listener,
+                               boolean immediateNotify);
+  /**
+   * Add a listener for changes to the table
+   * @param listener the listener to add
+   * @param flags bitmask specifying desired notifications
+   */
+  public void addTableListenerEx(ITableListener listener, int flags);
+
+  /**
+   * Add a listener for changes to a specific key the table
+   * @param key the key to listen for
+   * @param listener the listener to add
+   * @param immediateNotify if true then this listener will be notified of all
+   * current entries (marked as new)
+   */
+  public void addTableListener(String key, ITableListener listener,
+                               boolean immediateNotify);
+  /**
+   * Add a listener for changes to a specific key the table
+   * @param key the key to listen for
+   * @param listener the listener to add
+   * @param flags bitmask specifying desired notifications
+   */
+  public void addTableListenerEx(String key, ITableListener listener,
+                                 int flags);
+  /**
+   * This will immediately notify the listener of all current sub tables
+   * @param listener the listener to notify
+   */
+  public void addSubTableListener(final ITableListener listener);
+  /**
+   * This will immediately notify the listener of all current sub tables
+   * @param listener the listener to notify
+   * @param localNotify if true then this listener will be notified of all
+   * local changes in addition to all remote changes
+   */
+  public void addSubTableListener(final ITableListener listener,
+                                  boolean localNotify);
+  /**
+   * Remove a listener from receiving table events
+   * @param listener the listener to be removed
+   */
+  public void removeTableListener(ITableListener listener);
+
+  /*
+   * Deprecated Methods
+   */
+
+  /**
+   * Maps the specified key to the specified value in this table.
+   * The key can not be null.
+   * The value can be retrieved by calling the get method with a key that is
+   * equal to the original key.
+   * @param key the key
+   * @param value the value
+   * @return False if the table key already exists with a different type
+   * @throws IllegalArgumentException if key is null
+   * @deprecated Use {@link #putNumber(String, double)} instead.
+   */
+  @Deprecated
+  public boolean putDouble(String key, double value);
+
+  /**
+   * Returns the value at the specified key.
+   * @param key the key
+   * @param defaultValue the value returned if the key is undefined
+   * @return the value
+   * @throws IllegalArgumentException if the value mapped to by the key is not a
+   * double
+   * @throws IllegalArgumentException if the key is null
+   * @deprecated Use {@link #getNumber(String, double)} instead.
+   */
+  @Deprecated
+  public double getDouble(String key, double defaultValue);
+
+  /**
+   * Gets the full path of this table.  Does not include the trailing "/".
+   * @return The path to this table (e.g. "", "/foo").
+   */
+  public String getPath();
+
+}
diff --git a/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/ITableListener.java b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/ITableListener.java
new file mode 100644
index 0000000..dfc5bc3
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/java/edu/wpi/first/wpilibj/tables/ITableListener.java
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpilibj.tables;
+
+/**
+ * A listener that listens to changes in values in a {@link ITable}
+ * @deprecated Use Consumer&lt;{@link edu.wpi.first.networktables.EntryNotification}&gt;,
+ * {@link edu.wpi.first.networktables.TableEntryListener}, or
+ * {@link edu.wpi.first.networktables.TableListener} as appropriate.
+ */
+@FunctionalInterface
+@Deprecated
+public interface ITableListener {
+    /**
+     * Called when a key-value pair is changed in a {@link ITable}
+     * @param source the table the key-value pair exists in
+     * @param key the key associated with the value that changed
+     * @param value the new value
+     * @param isNew true if the key did not previously exist in the table, otherwise it is false
+     */
+    public void valueChanged(ITable source, String key, Object value, boolean isNew);
+
+    /**
+     * Extended version of valueChanged.  Called when a key-value pair is
+     * changed in a {@link ITable}.  The default implementation simply calls
+     * valueChanged().  If this is overridden, valueChanged() will not be
+     * called.
+     * @param source the table the key-value pair exists in
+     * @param key the key associated with the value that changed
+     * @param value the new value
+     * @param flags update flags; for example, NOTIFY_NEW if the key did not
+     * previously exist in the table
+     */
+    default public void valueChangedEx(ITable source, String key, Object value, int flags) {
+        // NOTIFY_NEW = 0x04
+        valueChanged(source, key, value, (flags & 0x04) != 0);
+    }
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/CallbackManager.h b/third_party/ntcore_2018/src/main/native/cpp/CallbackManager.h
new file mode 100644
index 0000000..cf43dbc
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/CallbackManager.h
@@ -0,0 +1,340 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_CALLBACKMANAGER_H_
+#define NTCORE_CALLBACKMANAGER_H_
+
+#include <atomic>
+#include <climits>
+#include <functional>
+#include <memory>
+#include <queue>
+#include <utility>
+#include <vector>
+
+#include <llvm/raw_ostream.h>
+#include <support/SafeThread.h>
+#include <support/UidVector.h>
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+namespace nt {
+
+namespace impl {
+
+template <typename Callback>
+class ListenerData {
+ public:
+  ListenerData() = default;
+  explicit ListenerData(Callback callback_) : callback(callback_) {}
+  explicit ListenerData(unsigned int poller_uid_) : poller_uid(poller_uid_) {}
+
+  explicit operator bool() const { return callback || poller_uid != UINT_MAX; }
+
+  Callback callback;
+  unsigned int poller_uid = UINT_MAX;
+};
+
+// CRTP callback manager thread
+// @tparam Derived        derived class
+// @tparam NotifierData   data buffered for each callback
+// @tparam ListenerData   data stored for each listener
+// Derived must define the following functions:
+//   bool Matches(const ListenerData& listener, const NotifierData& data);
+//   void SetListener(NotifierData* data, unsigned int listener_uid);
+//   void DoCallback(Callback callback, const NotifierData& data);
+template <typename Derived, typename TUserInfo,
+          typename TListenerData =
+              ListenerData<std::function<void(const TUserInfo& info)>>,
+          typename TNotifierData = TUserInfo>
+class CallbackThread : public wpi::SafeThread {
+ public:
+  typedef TUserInfo UserInfo;
+  typedef TNotifierData NotifierData;
+  typedef TListenerData ListenerData;
+
+  ~CallbackThread() {
+    // Wake up any blocked pollers
+    for (size_t i = 0; i < m_pollers.size(); ++i) {
+      if (auto poller = m_pollers[i]) poller->Terminate();
+    }
+  }
+
+  void Main() override;
+
+  wpi::UidVector<ListenerData, 64> m_listeners;
+
+  std::queue<std::pair<unsigned int, NotifierData>> m_queue;
+  wpi::condition_variable m_queue_empty;
+
+  struct Poller {
+    void Terminate() {
+      {
+        std::lock_guard<wpi::mutex> lock(poll_mutex);
+        terminating = true;
+      }
+      poll_cond.notify_all();
+    }
+    std::queue<NotifierData> poll_queue;
+    wpi::mutex poll_mutex;
+    wpi::condition_variable poll_cond;
+    bool terminating = false;
+    bool cancelling = false;
+  };
+  wpi::UidVector<std::shared_ptr<Poller>, 64> m_pollers;
+
+  // Must be called with m_mutex held
+  template <typename... Args>
+  void SendPoller(unsigned int poller_uid, Args&&... args) {
+    if (poller_uid > m_pollers.size()) return;
+    auto poller = m_pollers[poller_uid];
+    if (!poller) return;
+    {
+      std::lock_guard<wpi::mutex> lock(poller->poll_mutex);
+      poller->poll_queue.emplace(std::forward<Args>(args)...);
+    }
+    poller->poll_cond.notify_one();
+  }
+};
+
+template <typename Derived, typename TUserInfo, typename TListenerData,
+          typename TNotifierData>
+void CallbackThread<Derived, TUserInfo, TListenerData, TNotifierData>::Main() {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  while (m_active) {
+    while (m_queue.empty()) {
+      m_cond.wait(lock);
+      if (!m_active) return;
+    }
+
+    while (!m_queue.empty()) {
+      if (!m_active) return;
+      auto item = std::move(m_queue.front());
+
+      if (item.first != UINT_MAX) {
+        if (item.first < m_listeners.size()) {
+          auto& listener = m_listeners[item.first];
+          if (listener &&
+              static_cast<Derived*>(this)->Matches(listener, item.second)) {
+            static_cast<Derived*>(this)->SetListener(&item.second, item.first);
+            if (listener.callback) {
+              lock.unlock();
+              static_cast<Derived*>(this)->DoCallback(listener.callback,
+                                                      item.second);
+              lock.lock();
+            } else if (listener.poller_uid != UINT_MAX) {
+              SendPoller(listener.poller_uid, std::move(item.second));
+            }
+          }
+        }
+      } else {
+        // Use index because iterator might get invalidated.
+        for (size_t i = 0; i < m_listeners.size(); ++i) {
+          auto& listener = m_listeners[i];
+          if (!listener) continue;
+          if (!static_cast<Derived*>(this)->Matches(listener, item.second))
+            continue;
+          static_cast<Derived*>(this)->SetListener(&item.second, i);
+          if (listener.callback) {
+            lock.unlock();
+            static_cast<Derived*>(this)->DoCallback(listener.callback,
+                                                    item.second);
+            lock.lock();
+          } else if (listener.poller_uid != UINT_MAX) {
+            SendPoller(listener.poller_uid, item.second);
+          }
+        }
+      }
+      m_queue.pop();
+    }
+
+    m_queue_empty.notify_all();
+  }
+}
+
+}  // namespace impl
+
+// CRTP callback manager
+// @tparam Derived  derived class
+// @tparam Thread   custom thread (must be derived from impl::CallbackThread)
+//
+// Derived must define the following functions:
+//   void Start();
+template <typename Derived, typename Thread>
+class CallbackManager {
+  friend class RpcServerTest;
+
+ public:
+  void Stop() { m_owner.Stop(); }
+
+  void Remove(unsigned int listener_uid) {
+    auto thr = m_owner.GetThread();
+    if (!thr) return;
+    thr->m_listeners.erase(listener_uid);
+  }
+
+  unsigned int CreatePoller() {
+    static_cast<Derived*>(this)->Start();
+    auto thr = m_owner.GetThread();
+    return thr->m_pollers.emplace_back(
+        std::make_shared<typename Thread::Poller>());
+  }
+
+  void RemovePoller(unsigned int poller_uid) {
+    auto thr = m_owner.GetThread();
+    if (!thr) return;
+
+    // Remove any listeners that are associated with this poller
+    for (size_t i = 0; i < thr->m_listeners.size(); ++i) {
+      if (thr->m_listeners[i].poller_uid == poller_uid)
+        thr->m_listeners.erase(i);
+    }
+
+    // Wake up any blocked pollers
+    if (poller_uid >= thr->m_pollers.size()) return;
+    auto poller = thr->m_pollers[poller_uid];
+    if (!poller) return;
+    poller->Terminate();
+    return thr->m_pollers.erase(poller_uid);
+  }
+
+  bool WaitForQueue(double timeout) {
+    auto thr = m_owner.GetThread();
+    if (!thr) return true;
+
+    auto& lock = thr.GetLock();
+#if defined(_MSC_VER) && _MSC_VER < 1900
+    auto timeout_time = std::chrono::steady_clock::now() +
+                        std::chrono::duration<int64_t, std::nano>(
+                            static_cast<int64_t>(timeout * 1e9));
+#else
+    auto timeout_time = std::chrono::steady_clock::now() +
+                        std::chrono::duration<double>(timeout);
+#endif
+    while (!thr->m_queue.empty()) {
+      if (!thr->m_active) return true;
+      if (timeout == 0) return false;
+      if (timeout < 0) {
+        thr->m_queue_empty.wait(lock);
+      } else {
+        auto cond_timed_out = thr->m_queue_empty.wait_until(lock, timeout_time);
+        if (cond_timed_out == std::cv_status::timeout) return false;
+      }
+    }
+
+    return true;
+  }
+
+  std::vector<typename Thread::UserInfo> Poll(unsigned int poller_uid) {
+    bool timed_out = false;
+    return Poll(poller_uid, -1, &timed_out);
+  }
+
+  std::vector<typename Thread::UserInfo> Poll(unsigned int poller_uid,
+                                              double timeout, bool* timed_out) {
+    std::vector<typename Thread::UserInfo> infos;
+    std::shared_ptr<typename Thread::Poller> poller;
+    {
+      auto thr = m_owner.GetThread();
+      if (!thr) return infos;
+      if (poller_uid > thr->m_pollers.size()) return infos;
+      poller = thr->m_pollers[poller_uid];
+      if (!poller) return infos;
+    }
+
+    std::unique_lock<wpi::mutex> lock(poller->poll_mutex);
+#if defined(_MSC_VER) && _MSC_VER < 1900
+    auto timeout_time = std::chrono::steady_clock::now() +
+                        std::chrono::duration<int64_t, std::nano>(
+                            static_cast<int64_t>(timeout * 1e9));
+#else
+    auto timeout_time = std::chrono::steady_clock::now() +
+                        std::chrono::duration<double>(timeout);
+#endif
+    *timed_out = false;
+    while (poller->poll_queue.empty()) {
+      if (poller->terminating) return infos;
+      if (poller->cancelling) {
+        // Note: this only works if there's a single thread calling this
+        // function for any particular poller, but that's the intended use.
+        poller->cancelling = false;
+        return infos;
+      }
+      if (timeout == 0) {
+        *timed_out = true;
+        return infos;
+      }
+      if (timeout < 0) {
+        poller->poll_cond.wait(lock);
+      } else {
+        auto cond_timed_out = poller->poll_cond.wait_until(lock, timeout_time);
+        if (cond_timed_out == std::cv_status::timeout) {
+          *timed_out = true;
+          return infos;
+        }
+      }
+    }
+
+    while (!poller->poll_queue.empty()) {
+      infos.emplace_back(std::move(poller->poll_queue.front()));
+      poller->poll_queue.pop();
+    }
+    return infos;
+  }
+
+  void CancelPoll(unsigned int poller_uid) {
+    std::shared_ptr<typename Thread::Poller> poller;
+    {
+      auto thr = m_owner.GetThread();
+      if (!thr) return;
+      if (poller_uid > thr->m_pollers.size()) return;
+      poller = thr->m_pollers[poller_uid];
+      if (!poller) return;
+    }
+
+    {
+      std::lock_guard<wpi::mutex> lock(poller->poll_mutex);
+      poller->cancelling = true;
+    }
+    poller->poll_cond.notify_one();
+  }
+
+ protected:
+  template <typename... Args>
+  void DoStart(Args&&... args) {
+    auto thr = m_owner.GetThread();
+    if (!thr) m_owner.Start(new Thread(std::forward<Args>(args)...));
+  }
+
+  template <typename... Args>
+  unsigned int DoAdd(Args&&... args) {
+    static_cast<Derived*>(this)->Start();
+    auto thr = m_owner.GetThread();
+    return thr->m_listeners.emplace_back(std::forward<Args>(args)...);
+  }
+
+  template <typename... Args>
+  void Send(unsigned int only_listener, Args&&... args) {
+    auto thr = m_owner.GetThread();
+    if (!thr || thr->m_listeners.empty()) return;
+    thr->m_queue.emplace(std::piecewise_construct,
+                         std::make_tuple(only_listener),
+                         std::forward_as_tuple(std::forward<Args>(args)...));
+    thr->m_cond.notify_one();
+  }
+
+  typename wpi::SafeThreadOwner<Thread>::Proxy GetThread() const {
+    return m_owner.GetThread();
+  }
+
+ private:
+  wpi::SafeThreadOwner<Thread> m_owner;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_CALLBACKMANAGER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/ConnectionNotifier.cpp b/third_party/ntcore_2018/src/main/native/cpp/ConnectionNotifier.cpp
new file mode 100644
index 0000000..4310aff
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/ConnectionNotifier.cpp
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ConnectionNotifier.h"
+
+using namespace nt;
+
+ConnectionNotifier::ConnectionNotifier(int inst) : m_inst(inst) {}
+
+void ConnectionNotifier::Start() { DoStart(m_inst); }
+
+unsigned int ConnectionNotifier::Add(
+    std::function<void(const ConnectionNotification& event)> callback) {
+  return DoAdd(callback);
+}
+
+unsigned int ConnectionNotifier::AddPolled(unsigned int poller_uid) {
+  return DoAdd(poller_uid);
+}
+
+void ConnectionNotifier::NotifyConnection(bool connected,
+                                          const ConnectionInfo& conn_info,
+                                          unsigned int only_listener) {
+  Send(only_listener, 0, connected, conn_info);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/ConnectionNotifier.h b/third_party/ntcore_2018/src/main/native/cpp/ConnectionNotifier.h
new file mode 100644
index 0000000..4d3cc92
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/ConnectionNotifier.h
@@ -0,0 +1,72 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_CONNECTIONNOTIFIER_H_
+#define NTCORE_CONNECTIONNOTIFIER_H_
+
+#include "CallbackManager.h"
+#include "Handle.h"
+#include "IConnectionNotifier.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+namespace impl {
+
+class ConnectionNotifierThread
+    : public CallbackThread<ConnectionNotifierThread, ConnectionNotification> {
+ public:
+  explicit ConnectionNotifierThread(int inst) : m_inst(inst) {}
+
+  bool Matches(const ListenerData& listener,
+               const ConnectionNotification& data) {
+    return true;
+  }
+
+  void SetListener(ConnectionNotification* data, unsigned int listener_uid) {
+    data->listener =
+        Handle(m_inst, listener_uid, Handle::kConnectionListener).handle();
+  }
+
+  void DoCallback(
+      std::function<void(const ConnectionNotification& event)> callback,
+      const ConnectionNotification& data) {
+    callback(data);
+  }
+
+  int m_inst;
+};
+
+}  // namespace impl
+
+class ConnectionNotifier
+    : public IConnectionNotifier,
+      public CallbackManager<ConnectionNotifier,
+                             impl::ConnectionNotifierThread> {
+  friend class ConnectionNotifierTest;
+  friend class CallbackManager<ConnectionNotifier,
+                               impl::ConnectionNotifierThread>;
+
+ public:
+  explicit ConnectionNotifier(int inst);
+
+  void Start();
+
+  unsigned int Add(std::function<void(const ConnectionNotification& event)>
+                       callback) override;
+  unsigned int AddPolled(unsigned int poller_uid) override;
+
+  void NotifyConnection(bool connected, const ConnectionInfo& conn_info,
+                        unsigned int only_listener = UINT_MAX) override;
+
+ private:
+  int m_inst;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_CONNECTIONNOTIFIER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Dispatcher.cpp b/third_party/ntcore_2018/src/main/native/cpp/Dispatcher.cpp
new file mode 100644
index 0000000..cb73431
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Dispatcher.cpp
@@ -0,0 +1,639 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Dispatcher.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "IConnectionNotifier.h"
+#include "IStorage.h"
+#include "Log.h"
+#include "NetworkConnection.h"
+#include "tcpsockets/TCPAcceptor.h"
+#include "tcpsockets/TCPConnector.h"
+
+using namespace nt;
+
+void Dispatcher::StartServer(const Twine& persist_filename,
+                             const char* listen_address, unsigned int port) {
+  DispatcherBase::StartServer(
+      persist_filename,
+      std::unique_ptr<wpi::NetworkAcceptor>(new wpi::TCPAcceptor(
+          static_cast<int>(port), listen_address, m_logger)));
+}
+
+void Dispatcher::SetServer(const char* server_name, unsigned int port) {
+  std::string server_name_copy(server_name);
+  SetConnector([=]() -> std::unique_ptr<wpi::NetworkStream> {
+    return wpi::TCPConnector::connect(server_name_copy.c_str(),
+                                      static_cast<int>(port), m_logger, 1);
+  });
+}
+
+void Dispatcher::SetServer(
+    ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  llvm::SmallVector<std::pair<std::string, int>, 16> servers_copy;
+  for (const auto& server : servers)
+    servers_copy.emplace_back(std::string{server.first},
+                              static_cast<int>(server.second));
+
+  SetConnector([=]() -> std::unique_ptr<wpi::NetworkStream> {
+    llvm::SmallVector<std::pair<const char*, int>, 16> servers_copy2;
+    for (const auto& server : servers_copy)
+      servers_copy2.emplace_back(server.first.c_str(), server.second);
+    return wpi::TCPConnector::connect_parallel(servers_copy2, m_logger, 1);
+  });
+}
+
+void Dispatcher::SetServerTeam(unsigned int team, unsigned int port) {
+  std::pair<StringRef, unsigned int> servers[5];
+
+  // 10.te.am.2
+  llvm::SmallString<32> fixed;
+  {
+    llvm::raw_svector_ostream oss{fixed};
+    oss << "10." << static_cast<int>(team / 100) << '.'
+        << static_cast<int>(team % 100) << ".2";
+    servers[0] = std::make_pair(oss.str(), port);
+  }
+
+  // 172.22.11.2
+  servers[1] = std::make_pair("172.22.11.2", port);
+
+  // roboRIO-<team>-FRC.local
+  llvm::SmallString<32> mdns;
+  {
+    llvm::raw_svector_ostream oss{mdns};
+    oss << "roboRIO-" << team << "-FRC.local";
+    servers[2] = std::make_pair(oss.str(), port);
+  }
+
+  // roboRIO-<team>-FRC.lan
+  llvm::SmallString<32> mdns_lan;
+  {
+    llvm::raw_svector_ostream oss{mdns_lan};
+    oss << "roboRIO-" << team << "-FRC.lan";
+    servers[3] = std::make_pair(oss.str(), port);
+  }
+
+  // roboRIO-<team>-FRC.frc-field.local
+  llvm::SmallString<64> field_local;
+  {
+    llvm::raw_svector_ostream oss{field_local};
+    oss << "roboRIO-" << team << "-FRC.frc-field.local";
+    servers[4] = std::make_pair(oss.str(), port);
+  }
+
+  SetServer(servers);
+}
+
+void Dispatcher::SetServerOverride(const char* server_name, unsigned int port) {
+  std::string server_name_copy(server_name);
+  SetConnectorOverride([=]() -> std::unique_ptr<wpi::NetworkStream> {
+    return wpi::TCPConnector::connect(server_name_copy.c_str(),
+                                      static_cast<int>(port), m_logger, 1);
+  });
+}
+
+void Dispatcher::ClearServerOverride() { ClearConnectorOverride(); }
+
+DispatcherBase::DispatcherBase(IStorage& storage, IConnectionNotifier& notifier,
+                               wpi::Logger& logger)
+    : m_storage(storage), m_notifier(notifier), m_logger(logger) {
+  m_active = false;
+  m_update_rate = 100;
+}
+
+DispatcherBase::~DispatcherBase() { Stop(); }
+
+unsigned int DispatcherBase::GetNetworkMode() const { return m_networkMode; }
+
+void DispatcherBase::StartServer(
+    const Twine& persist_filename,
+    std::unique_ptr<wpi::NetworkAcceptor> acceptor) {
+  {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    if (m_active) return;
+    m_active = true;
+  }
+  m_networkMode = NT_NET_MODE_SERVER | NT_NET_MODE_STARTING;
+  m_persist_filename = persist_filename.str();
+  m_server_acceptor = std::move(acceptor);
+
+  // Load persistent file.  Ignore errors, but pass along warnings.
+  if (!persist_filename.isTriviallyEmpty() &&
+      (!persist_filename.isSingleStringRef() ||
+       !persist_filename.getSingleStringRef().empty())) {
+    bool first = true;
+    m_storage.LoadPersistent(
+        persist_filename, [&](size_t line, const char* msg) {
+          if (first) {
+            first = false;
+            WARNING("When reading initial persistent values from '"
+                    << persist_filename << "':");
+          }
+          WARNING(persist_filename << ":" << line << ": " << msg);
+        });
+  }
+
+  m_storage.SetDispatcher(this, true);
+
+  m_dispatch_thread = std::thread(&Dispatcher::DispatchThreadMain, this);
+  m_clientserver_thread = std::thread(&Dispatcher::ServerThreadMain, this);
+}
+
+void DispatcherBase::StartClient() {
+  {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    if (m_active) return;
+    m_active = true;
+  }
+  m_networkMode = NT_NET_MODE_CLIENT | NT_NET_MODE_STARTING;
+  m_storage.SetDispatcher(this, false);
+
+  m_dispatch_thread = std::thread(&Dispatcher::DispatchThreadMain, this);
+  m_clientserver_thread = std::thread(&Dispatcher::ClientThreadMain, this);
+}
+
+void DispatcherBase::Stop() {
+  m_active = false;
+
+  // wake up dispatch thread with a flush
+  m_flush_cv.notify_one();
+
+  // wake up client thread with a reconnect
+  {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    m_client_connector = nullptr;
+  }
+  ClientReconnect();
+
+  // wake up server thread by shutting down the socket
+  if (m_server_acceptor) m_server_acceptor->shutdown();
+
+  // join threads, with timeout
+  if (m_dispatch_thread.joinable()) m_dispatch_thread.join();
+  if (m_clientserver_thread.joinable()) m_clientserver_thread.join();
+
+  std::vector<std::shared_ptr<INetworkConnection>> conns;
+  {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    conns.swap(m_connections);
+  }
+
+  // close all connections
+  conns.resize(0);
+}
+
+void DispatcherBase::SetUpdateRate(double interval) {
+  // don't allow update rates faster than 10 ms or slower than 1 second
+  if (interval < 0.01)
+    interval = 0.01;
+  else if (interval > 1.0)
+    interval = 1.0;
+  m_update_rate = static_cast<unsigned int>(interval * 1000);
+}
+
+void DispatcherBase::SetIdentity(const Twine& name) {
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  m_identity = name.str();
+}
+
+void DispatcherBase::Flush() {
+  auto now = std::chrono::steady_clock::now();
+  {
+    std::lock_guard<wpi::mutex> lock(m_flush_mutex);
+    // don't allow flushes more often than every 10 ms
+    if ((now - m_last_flush) < std::chrono::milliseconds(10)) return;
+    m_last_flush = now;
+    m_do_flush = true;
+  }
+  m_flush_cv.notify_one();
+}
+
+std::vector<ConnectionInfo> DispatcherBase::GetConnections() const {
+  std::vector<ConnectionInfo> conns;
+  if (!m_active) return conns;
+
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  for (auto& conn : m_connections) {
+    if (conn->state() != NetworkConnection::kActive) continue;
+    conns.emplace_back(conn->info());
+  }
+
+  return conns;
+}
+
+bool DispatcherBase::IsConnected() const {
+  if (!m_active) return false;
+
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  for (auto& conn : m_connections) {
+    if (conn->state() == NetworkConnection::kActive) return true;
+  }
+
+  return false;
+}
+
+unsigned int DispatcherBase::AddListener(
+    std::function<void(const ConnectionNotification& event)> callback,
+    bool immediate_notify) const {
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  unsigned int uid = m_notifier.Add(callback);
+  // perform immediate notifications
+  if (immediate_notify) {
+    for (auto& conn : m_connections) {
+      if (conn->state() != NetworkConnection::kActive) continue;
+      m_notifier.NotifyConnection(true, conn->info(), uid);
+    }
+  }
+  return uid;
+}
+
+unsigned int DispatcherBase::AddPolledListener(unsigned int poller_uid,
+                                               bool immediate_notify) const {
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  unsigned int uid = m_notifier.AddPolled(poller_uid);
+  // perform immediate notifications
+  if (immediate_notify) {
+    for (auto& conn : m_connections) {
+      if (conn->state() != NetworkConnection::kActive) continue;
+      m_notifier.NotifyConnection(true, conn->info(), uid);
+    }
+  }
+  return uid;
+}
+
+void DispatcherBase::SetConnector(Connector connector) {
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  m_client_connector = std::move(connector);
+}
+
+void DispatcherBase::SetConnectorOverride(Connector connector) {
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  m_client_connector_override = std::move(connector);
+}
+
+void DispatcherBase::ClearConnectorOverride() {
+  std::lock_guard<wpi::mutex> lock(m_user_mutex);
+  m_client_connector_override = nullptr;
+}
+
+void DispatcherBase::DispatchThreadMain() {
+  auto timeout_time = std::chrono::steady_clock::now();
+
+  static const auto save_delta_time = std::chrono::seconds(1);
+  auto next_save_time = timeout_time + save_delta_time;
+
+  int count = 0;
+
+  while (m_active) {
+    // handle loop taking too long
+    auto start = std::chrono::steady_clock::now();
+    if (start > timeout_time) timeout_time = start;
+
+    // wait for periodic or when flushed
+    timeout_time += std::chrono::milliseconds(m_update_rate);
+    std::unique_lock<wpi::mutex> flush_lock(m_flush_mutex);
+    m_flush_cv.wait_until(flush_lock, timeout_time,
+                          [&] { return !m_active || m_do_flush; });
+    m_do_flush = false;
+    flush_lock.unlock();
+    if (!m_active) break;  // in case we were woken up to terminate
+
+    // perform periodic persistent save
+    if ((m_networkMode & NT_NET_MODE_SERVER) != 0 &&
+        !m_persist_filename.empty() && start > next_save_time) {
+      next_save_time += save_delta_time;
+      // handle loop taking too long
+      if (start > next_save_time) next_save_time = start + save_delta_time;
+      const char* err = m_storage.SavePersistent(m_persist_filename, true);
+      if (err) WARNING("periodic persistent save: " << err);
+    }
+
+    {
+      std::lock_guard<wpi::mutex> user_lock(m_user_mutex);
+      bool reconnect = false;
+
+      if (++count > 10) {
+        DEBUG("dispatch running " << m_connections.size() << " connections");
+        count = 0;
+      }
+
+      for (auto& conn : m_connections) {
+        // post outgoing messages if connection is active
+        // only send keep-alives on client
+        if (conn->state() == NetworkConnection::kActive)
+          conn->PostOutgoing((m_networkMode & NT_NET_MODE_CLIENT) != 0);
+
+        // if client, reconnect if connection died
+        if ((m_networkMode & NT_NET_MODE_CLIENT) != 0 &&
+            conn->state() == NetworkConnection::kDead)
+          reconnect = true;
+      }
+      // reconnect if we disconnected (and a reconnect is not in progress)
+      if (reconnect && !m_do_reconnect) {
+        m_do_reconnect = true;
+        m_reconnect_cv.notify_one();
+      }
+    }
+  }
+}
+
+void DispatcherBase::QueueOutgoing(std::shared_ptr<Message> msg,
+                                   INetworkConnection* only,
+                                   INetworkConnection* except) {
+  std::lock_guard<wpi::mutex> user_lock(m_user_mutex);
+  for (auto& conn : m_connections) {
+    if (conn.get() == except) continue;
+    if (only && conn.get() != only) continue;
+    auto state = conn->state();
+    if (state != NetworkConnection::kSynchronized &&
+        state != NetworkConnection::kActive)
+      continue;
+    conn->QueueOutgoing(msg);
+  }
+}
+
+void DispatcherBase::ServerThreadMain() {
+  if (m_server_acceptor->start() != 0) {
+    m_active = false;
+    m_networkMode = NT_NET_MODE_SERVER | NT_NET_MODE_FAILURE;
+    return;
+  }
+  m_networkMode = NT_NET_MODE_SERVER;
+  while (m_active) {
+    auto stream = m_server_acceptor->accept();
+    if (!stream) {
+      m_active = false;
+      return;
+    }
+    if (!m_active) {
+      m_networkMode = NT_NET_MODE_NONE;
+      return;
+    }
+    DEBUG("server: client connection from " << stream->getPeerIP() << " port "
+                                            << stream->getPeerPort());
+
+    // add to connections list
+    using namespace std::placeholders;
+    auto conn = std::make_shared<NetworkConnection>(
+        ++m_connections_uid, std::move(stream), m_notifier, m_logger,
+        std::bind(&Dispatcher::ServerHandshake, this, _1, _2, _3),
+        std::bind(&IStorage::GetMessageEntryType, &m_storage, _1));
+    conn->set_process_incoming(
+        std::bind(&IStorage::ProcessIncoming, &m_storage, _1, _2,
+                  std::weak_ptr<NetworkConnection>(conn)));
+    {
+      std::lock_guard<wpi::mutex> lock(m_user_mutex);
+      // reuse dead connection slots
+      bool placed = false;
+      for (auto& c : m_connections) {
+        if (c->state() == NetworkConnection::kDead) {
+          c = conn;
+          placed = true;
+          break;
+        }
+      }
+      if (!placed) m_connections.emplace_back(conn);
+      conn->Start();
+    }
+  }
+  m_networkMode = NT_NET_MODE_NONE;
+}
+
+void DispatcherBase::ClientThreadMain() {
+  while (m_active) {
+    // sleep between retries
+    std::this_thread::sleep_for(std::chrono::milliseconds(250));
+    Connector connect;
+
+    // get next server to connect to
+    {
+      std::lock_guard<wpi::mutex> lock(m_user_mutex);
+      if (m_client_connector_override) {
+        connect = m_client_connector_override;
+      } else {
+        if (!m_client_connector) {
+          m_networkMode = NT_NET_MODE_CLIENT | NT_NET_MODE_FAILURE;
+          continue;
+        }
+        connect = m_client_connector;
+      }
+    }
+
+    // try to connect (with timeout)
+    DEBUG("client trying to connect");
+    auto stream = connect();
+    if (!stream) {
+      m_networkMode = NT_NET_MODE_CLIENT | NT_NET_MODE_FAILURE;
+      continue;  // keep retrying
+    }
+    DEBUG("client connected");
+    m_networkMode = NT_NET_MODE_CLIENT;
+
+    std::unique_lock<wpi::mutex> lock(m_user_mutex);
+    using namespace std::placeholders;
+    auto conn = std::make_shared<NetworkConnection>(
+        ++m_connections_uid, std::move(stream), m_notifier, m_logger,
+        std::bind(&Dispatcher::ClientHandshake, this, _1, _2, _3),
+        std::bind(&IStorage::GetMessageEntryType, &m_storage, _1));
+    conn->set_process_incoming(
+        std::bind(&IStorage::ProcessIncoming, &m_storage, _1, _2,
+                  std::weak_ptr<NetworkConnection>(conn)));
+    m_connections.resize(0);  // disconnect any current
+    m_connections.emplace_back(conn);
+    conn->set_proto_rev(m_reconnect_proto_rev);
+    conn->Start();
+
+    // reconnect the next time starting with latest protocol revision
+    m_reconnect_proto_rev = 0x0300;
+
+    // block until told to reconnect
+    m_do_reconnect = false;
+    m_reconnect_cv.wait(lock, [&] { return !m_active || m_do_reconnect; });
+  }
+  m_networkMode = NT_NET_MODE_NONE;
+}
+
+bool DispatcherBase::ClientHandshake(
+    NetworkConnection& conn, std::function<std::shared_ptr<Message>()> get_msg,
+    std::function<void(llvm::ArrayRef<std::shared_ptr<Message>>)> send_msgs) {
+  // get identity
+  std::string self_id;
+  {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    self_id = m_identity;
+  }
+
+  // send client hello
+  DEBUG("client: sending hello");
+  send_msgs(Message::ClientHello(self_id));
+
+  // wait for response
+  auto msg = get_msg();
+  if (!msg) {
+    // disconnected, retry
+    DEBUG("client: server disconnected before first response");
+    return false;
+  }
+
+  if (msg->Is(Message::kProtoUnsup)) {
+    if (msg->id() == 0x0200) ClientReconnect(0x0200);
+    return false;
+  }
+
+  bool new_server = true;
+  if (conn.proto_rev() >= 0x0300) {
+    // should be server hello; if not, disconnect.
+    if (!msg->Is(Message::kServerHello)) return false;
+    conn.set_remote_id(msg->str());
+    if ((msg->flags() & 1) != 0) new_server = false;
+    // get the next message
+    msg = get_msg();
+  }
+
+  // receive initial assignments
+  std::vector<std::shared_ptr<Message>> incoming;
+  for (;;) {
+    if (!msg) {
+      // disconnected, retry
+      DEBUG("client: server disconnected during initial entries");
+      return false;
+    }
+    DEBUG4("received init str=" << msg->str() << " id=" << msg->id()
+                                << " seq_num=" << msg->seq_num_uid());
+    if (msg->Is(Message::kServerHelloDone)) break;
+    // shouldn't receive a keep alive, but handle gracefully
+    if (msg->Is(Message::kKeepAlive)) {
+      msg = get_msg();
+      continue;
+    }
+    if (!msg->Is(Message::kEntryAssign)) {
+      // unexpected message
+      DEBUG("client: received message ("
+            << msg->type()
+            << ") other than entry assignment during initial handshake");
+      return false;
+    }
+    incoming.emplace_back(std::move(msg));
+    // get the next message
+    msg = get_msg();
+  }
+
+  // generate outgoing assignments
+  NetworkConnection::Outgoing outgoing;
+
+  m_storage.ApplyInitialAssignments(conn, incoming, new_server, &outgoing);
+
+  if (conn.proto_rev() >= 0x0300)
+    outgoing.emplace_back(Message::ClientHelloDone());
+
+  if (!outgoing.empty()) send_msgs(outgoing);
+
+  INFO("client: CONNECTED to server " << conn.stream().getPeerIP() << " port "
+                                      << conn.stream().getPeerPort());
+  return true;
+}
+
+bool DispatcherBase::ServerHandshake(
+    NetworkConnection& conn, std::function<std::shared_ptr<Message>()> get_msg,
+    std::function<void(llvm::ArrayRef<std::shared_ptr<Message>>)> send_msgs) {
+  // Wait for the client to send us a hello.
+  auto msg = get_msg();
+  if (!msg) {
+    DEBUG("server: client disconnected before sending hello");
+    return false;
+  }
+  if (!msg->Is(Message::kClientHello)) {
+    DEBUG("server: client initial message was not client hello");
+    return false;
+  }
+
+  // Check that the client requested version is not too high.
+  unsigned int proto_rev = msg->id();
+  if (proto_rev > 0x0300) {
+    DEBUG("server: client requested proto > 0x0300");
+    send_msgs(Message::ProtoUnsup());
+    return false;
+  }
+
+  if (proto_rev >= 0x0300) conn.set_remote_id(msg->str());
+
+  // Set the proto version to the client requested version
+  DEBUG("server: client protocol " << proto_rev);
+  conn.set_proto_rev(proto_rev);
+
+  // Send initial set of assignments
+  NetworkConnection::Outgoing outgoing;
+
+  // Start with server hello.  TODO: initial connection flag
+  if (proto_rev >= 0x0300) {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    outgoing.emplace_back(Message::ServerHello(0u, m_identity));
+  }
+
+  // Get snapshot of initial assignments
+  m_storage.GetInitialAssignments(conn, &outgoing);
+
+  // Finish with server hello done
+  outgoing.emplace_back(Message::ServerHelloDone());
+
+  // Batch transmit
+  DEBUG("server: sending initial assignments");
+  send_msgs(outgoing);
+
+  // In proto rev 3.0 and later, the handshake concludes with a client hello
+  // done message, so we can batch the assigns before marking the connection
+  // active.  In pre-3.0, we need to just immediately mark it active and hand
+  // off control to the dispatcher to assign them as they arrive.
+  if (proto_rev >= 0x0300) {
+    // receive client initial assignments
+    std::vector<std::shared_ptr<Message>> incoming;
+    msg = get_msg();
+    for (;;) {
+      if (!msg) {
+        // disconnected, retry
+        DEBUG("server: disconnected waiting for initial entries");
+        return false;
+      }
+      if (msg->Is(Message::kClientHelloDone)) break;
+      // shouldn't receive a keep alive, but handle gracefully
+      if (msg->Is(Message::kKeepAlive)) {
+        msg = get_msg();
+        continue;
+      }
+      if (!msg->Is(Message::kEntryAssign)) {
+        // unexpected message
+        DEBUG("server: received message ("
+              << msg->type()
+              << ") other than entry assignment during initial handshake");
+        return false;
+      }
+      incoming.push_back(msg);
+      // get the next message (blocks)
+      msg = get_msg();
+    }
+    for (auto& msg : incoming)
+      m_storage.ProcessIncoming(msg, &conn, std::weak_ptr<NetworkConnection>());
+  }
+
+  INFO("server: client CONNECTED: " << conn.stream().getPeerIP() << " port "
+                                    << conn.stream().getPeerPort());
+  return true;
+}
+
+void DispatcherBase::ClientReconnect(unsigned int proto_rev) {
+  if ((m_networkMode & NT_NET_MODE_SERVER) != 0) return;
+  {
+    std::lock_guard<wpi::mutex> lock(m_user_mutex);
+    m_reconnect_proto_rev = proto_rev;
+    m_do_reconnect = true;
+  }
+  m_reconnect_cv.notify_one();
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Dispatcher.h b/third_party/ntcore_2018/src/main/native/cpp/Dispatcher.h
new file mode 100644
index 0000000..8a5d6e9
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Dispatcher.h
@@ -0,0 +1,151 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_DISPATCHER_H_
+#define NTCORE_DISPATCHER_H_
+
+#include <atomic>
+#include <chrono>
+#include <functional>
+#include <memory>
+#include <string>
+#include <thread>
+#include <utility>
+#include <vector>
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+#include "IDispatcher.h"
+#include "INetworkConnection.h"
+
+namespace wpi {
+class Logger;
+class NetworkAcceptor;
+class NetworkStream;
+}  // namespace wpi
+
+namespace nt {
+
+class IConnectionNotifier;
+class IStorage;
+class NetworkConnection;
+
+class DispatcherBase : public IDispatcher {
+  friend class DispatcherTest;
+
+ public:
+  typedef std::function<std::unique_ptr<wpi::NetworkStream>()> Connector;
+
+  DispatcherBase(IStorage& storage, IConnectionNotifier& notifier,
+                 wpi::Logger& logger);
+  virtual ~DispatcherBase();
+
+  unsigned int GetNetworkMode() const;
+  void StartServer(const Twine& persist_filename,
+                   std::unique_ptr<wpi::NetworkAcceptor> acceptor);
+  void StartClient();
+  void Stop();
+  void SetUpdateRate(double interval);
+  void SetIdentity(const Twine& name);
+  void Flush();
+  std::vector<ConnectionInfo> GetConnections() const;
+  bool IsConnected() const;
+
+  unsigned int AddListener(
+      std::function<void(const ConnectionNotification& event)> callback,
+      bool immediate_notify) const;
+  unsigned int AddPolledListener(unsigned int poller_uid,
+                                 bool immediate_notify) const;
+
+  void SetConnector(Connector connector);
+  void SetConnectorOverride(Connector connector);
+  void ClearConnectorOverride();
+
+  bool active() const { return m_active; }
+
+  DispatcherBase(const DispatcherBase&) = delete;
+  DispatcherBase& operator=(const DispatcherBase&) = delete;
+
+ private:
+  void DispatchThreadMain();
+  void ServerThreadMain();
+  void ClientThreadMain();
+
+  bool ClientHandshake(
+      NetworkConnection& conn,
+      std::function<std::shared_ptr<Message>()> get_msg,
+      std::function<void(llvm::ArrayRef<std::shared_ptr<Message>>)> send_msgs);
+  bool ServerHandshake(
+      NetworkConnection& conn,
+      std::function<std::shared_ptr<Message>()> get_msg,
+      std::function<void(llvm::ArrayRef<std::shared_ptr<Message>>)> send_msgs);
+
+  void ClientReconnect(unsigned int proto_rev = 0x0300);
+
+  void QueueOutgoing(std::shared_ptr<Message> msg, INetworkConnection* only,
+                     INetworkConnection* except) override;
+
+  IStorage& m_storage;
+  IConnectionNotifier& m_notifier;
+  unsigned int m_networkMode = NT_NET_MODE_NONE;
+  std::string m_persist_filename;
+  std::thread m_dispatch_thread;
+  std::thread m_clientserver_thread;
+
+  std::unique_ptr<wpi::NetworkAcceptor> m_server_acceptor;
+  Connector m_client_connector_override;
+  Connector m_client_connector;
+  uint8_t m_connections_uid = 0;
+
+  // Mutex for user-accessible items
+  mutable wpi::mutex m_user_mutex;
+  std::vector<std::shared_ptr<INetworkConnection>> m_connections;
+  std::string m_identity;
+
+  std::atomic_bool m_active;       // set to false to terminate threads
+  std::atomic_uint m_update_rate;  // periodic dispatch update rate, in ms
+
+  // Condition variable for forced dispatch wakeup (flush)
+  wpi::mutex m_flush_mutex;
+  wpi::condition_variable m_flush_cv;
+  std::chrono::steady_clock::time_point m_last_flush;
+  bool m_do_flush = false;
+
+  // Condition variable for client reconnect (uses user mutex)
+  wpi::condition_variable m_reconnect_cv;
+  unsigned int m_reconnect_proto_rev = 0x0300;
+  bool m_do_reconnect = true;
+
+ protected:
+  wpi::Logger& m_logger;
+};
+
+class Dispatcher : public DispatcherBase {
+  friend class DispatcherTest;
+
+ public:
+  Dispatcher(IStorage& storage, IConnectionNotifier& notifier,
+             wpi::Logger& logger)
+      : DispatcherBase(storage, notifier, logger) {}
+
+  void StartServer(const Twine& persist_filename, const char* listen_address,
+                   unsigned int port);
+
+  void SetServer(const char* server_name, unsigned int port);
+  void SetServer(ArrayRef<std::pair<StringRef, unsigned int>> servers);
+  void SetServerTeam(unsigned int team, unsigned int port);
+
+  void SetServerOverride(const char* server_name, unsigned int port);
+  void ClearServerOverride();
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_DISPATCHER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/DsClient.cpp b/third_party/ntcore_2018/src/main/native/cpp/DsClient.cpp
new file mode 100644
index 0000000..563ce4e
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/DsClient.cpp
@@ -0,0 +1,153 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "DsClient.h"
+
+#include <llvm/SmallString.h>
+#include <llvm/raw_ostream.h>
+#include <support/raw_socket_istream.h>
+
+#include "Dispatcher.h"
+#include "Log.h"
+#include "tcpsockets/TCPConnector.h"
+
+using namespace nt;
+
+class DsClient::Thread : public wpi::SafeThread {
+ public:
+  Thread(Dispatcher& dispatcher, wpi::Logger& logger, unsigned int port)
+      : m_dispatcher(dispatcher), m_logger(logger), m_port(port) {}
+
+  void Main();
+
+  Dispatcher& m_dispatcher;
+  wpi::Logger& m_logger;
+  unsigned int m_port;
+  std::unique_ptr<wpi::NetworkStream> m_stream;
+};
+
+DsClient::DsClient(Dispatcher& dispatcher, wpi::Logger& logger)
+    : m_dispatcher(dispatcher), m_logger(logger) {}
+
+void DsClient::Start(unsigned int port) {
+  auto thr = m_owner.GetThread();
+  if (!thr)
+    m_owner.Start(new Thread(m_dispatcher, m_logger, port));
+  else
+    thr->m_port = port;
+}
+
+void DsClient::Stop() {
+  {
+    // Close the stream so the read (if any) terminates.
+    auto thr = m_owner.GetThread();
+    if (thr) {
+      thr->m_active = false;
+      if (thr->m_stream) thr->m_stream->close();
+    }
+  }
+  m_owner.Stop();
+}
+
+void DsClient::Thread::Main() {
+  unsigned int oldip = 0;
+  wpi::Logger nolog;  // to silence log messages from TCPConnector
+
+  while (m_active) {
+    // wait for periodic reconnect or termination
+    auto timeout_time =
+        std::chrono::steady_clock::now() + std::chrono::milliseconds(500);
+    unsigned int port;
+    {
+      std::unique_lock<wpi::mutex> lock(m_mutex);
+      m_cond.wait_until(lock, timeout_time, [&] { return !m_active; });
+      port = m_port;
+    }
+    if (!m_active) goto done;
+
+    // Try to connect to DS on the local machine
+    m_stream = wpi::TCPConnector::connect("127.0.0.1", 1742, nolog, 1);
+    if (!m_active) goto done;
+    if (!m_stream) continue;
+
+    DEBUG3("connected to DS");
+    wpi::raw_socket_istream is(*m_stream);
+
+    while (m_active && !is.has_error()) {
+      // Read JSON "{...}".  This is very limited, does not handle quoted "}" or
+      // nested {}, but is sufficient for this purpose.
+      llvm::SmallString<128> json;
+      char ch;
+
+      // Throw away characters until {
+      do {
+        is.read(ch);
+        if (is.has_error()) break;
+        if (!m_active) goto done;
+      } while (ch != '{');
+      json += '{';
+
+      if (is.has_error()) {
+        m_stream = nullptr;
+        break;
+      }
+
+      // Read characters until }
+      do {
+        is.read(ch);
+        if (is.has_error()) break;
+        if (!m_active) goto done;
+        json += ch;
+      } while (ch != '}');
+
+      if (is.has_error()) {
+        m_stream = nullptr;
+        break;
+      }
+      DEBUG3("json=" << json);
+
+      // Look for "robotIP":12345, and get 12345 portion
+      size_t pos = json.find("\"robotIP\"");
+      if (pos == llvm::StringRef::npos) continue;  // could not find?
+      pos += 9;
+      pos = json.find(':', pos);
+      if (pos == llvm::StringRef::npos) continue;  // could not find?
+      size_t endpos = json.find_first_not_of("0123456789", pos + 1);
+      DEBUG3("found robotIP=" << json.slice(pos + 1, endpos));
+
+      // Parse into number
+      unsigned int ip = 0;
+      if (json.slice(pos + 1, endpos).getAsInteger(10, ip)) continue;  // error
+
+      // If zero, clear the server override
+      if (ip == 0) {
+        m_dispatcher.ClearServerOverride();
+        oldip = 0;
+        continue;
+      }
+
+      // If unchanged, don't reconnect
+      if (ip == oldip) continue;
+      oldip = ip;
+
+      // Convert number into dotted quad
+      json.clear();
+      llvm::raw_svector_ostream os{json};
+      os << ((ip >> 24) & 0xff) << "." << ((ip >> 16) & 0xff) << "."
+         << ((ip >> 8) & 0xff) << "." << (ip & 0xff);
+      INFO("client: DS overriding server IP to " << os.str());
+      m_dispatcher.SetServerOverride(json.c_str(), port);
+    }
+
+    // We disconnected from the DS, clear the server override
+    m_dispatcher.ClearServerOverride();
+    oldip = 0;
+  }
+
+done:
+  m_dispatcher.ClearServerOverride();
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/DsClient.h b/third_party/ntcore_2018/src/main/native/cpp/DsClient.h
new file mode 100644
index 0000000..623a33c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/DsClient.h
@@ -0,0 +1,36 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_DSCLIENT_H_
+#define NTCORE_DSCLIENT_H_
+
+#include <support/SafeThread.h>
+
+#include "Log.h"
+
+namespace nt {
+
+class Dispatcher;
+
+class DsClient {
+ public:
+  DsClient(Dispatcher& dispatcher, wpi::Logger& logger);
+  ~DsClient() = default;
+
+  void Start(unsigned int port);
+  void Stop();
+
+ private:
+  class Thread;
+  wpi::SafeThreadOwner<Thread> m_owner;
+  Dispatcher& m_dispatcher;
+  wpi::Logger& m_logger;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_DSCLIENT_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/EntryNotifier.cpp b/third_party/ntcore_2018/src/main/native/cpp/EntryNotifier.cpp
new file mode 100644
index 0000000..dfb7ab1
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/EntryNotifier.cpp
@@ -0,0 +1,89 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "EntryNotifier.h"
+
+#include "Log.h"
+
+using namespace nt;
+
+EntryNotifier::EntryNotifier(int inst, wpi::Logger& logger)
+    : m_inst(inst), m_logger(logger) {
+  m_local_notifiers = false;
+}
+
+void EntryNotifier::Start() { DoStart(m_inst); }
+
+bool EntryNotifier::local_notifiers() const { return m_local_notifiers; }
+
+bool impl::EntryNotifierThread::Matches(const EntryListenerData& listener,
+                                        const EntryNotification& data) {
+  if (!data.value) return false;
+
+  // Flags must be within requested flag set for this listener.
+  // Because assign messages can result in both a value and flags update,
+  // we handle that case specially.
+  unsigned int listen_flags =
+      listener.flags & ~(NT_NOTIFY_IMMEDIATE | NT_NOTIFY_LOCAL);
+  unsigned int flags = data.flags & ~(NT_NOTIFY_IMMEDIATE | NT_NOTIFY_LOCAL);
+  unsigned int assign_both = NT_NOTIFY_UPDATE | NT_NOTIFY_FLAGS;
+  if ((flags & assign_both) == assign_both) {
+    if ((listen_flags & assign_both) == 0) return false;
+    listen_flags &= ~assign_both;
+    flags &= ~assign_both;
+  }
+  if ((flags & ~listen_flags) != 0) return false;
+
+  // must match local id or prefix
+  if (listener.entry != 0 && data.entry != listener.entry) return false;
+  if (listener.entry == 0 &&
+      !llvm::StringRef(data.name).startswith(listener.prefix))
+    return false;
+
+  return true;
+}
+
+unsigned int EntryNotifier::Add(
+    std::function<void(const EntryNotification& event)> callback,
+    StringRef prefix, unsigned int flags) {
+  if ((flags & NT_NOTIFY_LOCAL) != 0) m_local_notifiers = true;
+  return DoAdd(callback, prefix, flags);
+}
+
+unsigned int EntryNotifier::Add(
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int local_id, unsigned int flags) {
+  if ((flags & NT_NOTIFY_LOCAL) != 0) m_local_notifiers = true;
+  return DoAdd(callback, Handle(m_inst, local_id, Handle::kEntry), flags);
+}
+
+unsigned int EntryNotifier::AddPolled(unsigned int poller_uid,
+                                      llvm::StringRef prefix,
+                                      unsigned int flags) {
+  if ((flags & NT_NOTIFY_LOCAL) != 0) m_local_notifiers = true;
+  return DoAdd(poller_uid, prefix, flags);
+}
+
+unsigned int EntryNotifier::AddPolled(unsigned int poller_uid,
+                                      unsigned int local_id,
+                                      unsigned int flags) {
+  if ((flags & NT_NOTIFY_LOCAL) != 0) m_local_notifiers = true;
+  return DoAdd(poller_uid, Handle(m_inst, local_id, Handle::kEntry), flags);
+}
+
+void EntryNotifier::NotifyEntry(unsigned int local_id, StringRef name,
+                                std::shared_ptr<Value> value,
+                                unsigned int flags,
+                                unsigned int only_listener) {
+  // optimization: don't generate needless local queue entries if we have
+  // no local listeners (as this is a common case on the server side)
+  if ((flags & NT_NOTIFY_LOCAL) != 0 && !m_local_notifiers) return;
+  DEBUG("notifying '" << name << "' (local=" << local_id
+                      << "), flags=" << flags);
+  Send(only_listener, 0, Handle(m_inst, local_id, Handle::kEntry).handle(),
+       name, value, flags);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/EntryNotifier.h b/third_party/ntcore_2018/src/main/native/cpp/EntryNotifier.h
new file mode 100644
index 0000000..cb5a61c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/EntryNotifier.h
@@ -0,0 +1,109 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_ENTRYNOTIFIER_H_
+#define NTCORE_ENTRYNOTIFIER_H_
+
+#include <atomic>
+#include <memory>
+#include <string>
+
+#include "CallbackManager.h"
+#include "Handle.h"
+#include "IEntryNotifier.h"
+#include "ntcore_cpp.h"
+
+namespace wpi {
+class Logger;
+}  // namespace wpi
+
+namespace nt {
+
+namespace impl {
+
+struct EntryListenerData
+    : public ListenerData<std::function<void(const EntryNotification& event)>> {
+  EntryListenerData() = default;
+  EntryListenerData(
+      std::function<void(const EntryNotification& event)> callback_,
+      StringRef prefix_, unsigned int flags_)
+      : ListenerData(callback_), prefix(prefix_), flags(flags_) {}
+  EntryListenerData(
+      std::function<void(const EntryNotification& event)> callback_,
+      NT_Entry entry_, unsigned int flags_)
+      : ListenerData(callback_), entry(entry_), flags(flags_) {}
+  EntryListenerData(unsigned int poller_uid_, StringRef prefix_,
+                    unsigned int flags_)
+      : ListenerData(poller_uid_), prefix(prefix_), flags(flags_) {}
+  EntryListenerData(unsigned int poller_uid_, NT_Entry entry_,
+                    unsigned int flags_)
+      : ListenerData(poller_uid_), entry(entry_), flags(flags_) {}
+
+  std::string prefix;
+  NT_Entry entry = 0;
+  unsigned int flags;
+};
+
+class EntryNotifierThread
+    : public CallbackThread<EntryNotifierThread, EntryNotification,
+                            EntryListenerData> {
+ public:
+  explicit EntryNotifierThread(int inst) : m_inst(inst) {}
+
+  bool Matches(const EntryListenerData& listener,
+               const EntryNotification& data);
+
+  void SetListener(EntryNotification* data, unsigned int listener_uid) {
+    data->listener =
+        Handle(m_inst, listener_uid, Handle::kEntryListener).handle();
+  }
+
+  void DoCallback(std::function<void(const EntryNotification& event)> callback,
+                  const EntryNotification& data) {
+    callback(data);
+  }
+
+  int m_inst;
+};
+
+}  // namespace impl
+
+class EntryNotifier
+    : public IEntryNotifier,
+      public CallbackManager<EntryNotifier, impl::EntryNotifierThread> {
+  friend class EntryNotifierTest;
+  friend class CallbackManager<EntryNotifier, impl::EntryNotifierThread>;
+
+ public:
+  explicit EntryNotifier(int inst, wpi::Logger& logger);
+
+  void Start();
+
+  bool local_notifiers() const override;
+
+  unsigned int Add(std::function<void(const EntryNotification& event)> callback,
+                   llvm::StringRef prefix, unsigned int flags) override;
+  unsigned int Add(std::function<void(const EntryNotification& event)> callback,
+                   unsigned int local_id, unsigned int flags) override;
+  unsigned int AddPolled(unsigned int poller_uid, llvm::StringRef prefix,
+                         unsigned int flags) override;
+  unsigned int AddPolled(unsigned int poller_uid, unsigned int local_id,
+                         unsigned int flags) override;
+
+  void NotifyEntry(unsigned int local_id, StringRef name,
+                   std::shared_ptr<Value> value, unsigned int flags,
+                   unsigned int only_listener = UINT_MAX) override;
+
+ private:
+  int m_inst;
+  wpi::Logger& m_logger;
+  std::atomic_bool m_local_notifiers;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_ENTRYNOTIFIER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Handle.h b/third_party/ntcore_2018/src/main/native/cpp/Handle.h
new file mode 100644
index 0000000..adb6250
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Handle.h
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_HANDLE_H_
+#define NTCORE_HANDLE_H_
+
+#include "ntcore_c.h"
+
+namespace nt {
+
+// Handle data layout:
+// Bits 30-28: Type
+// Bits 27-20: Instance index
+// Bits 19-0:  Handle index (0/unused for instance handles)
+
+class Handle {
+ public:
+  enum Type {
+    kConnectionListener = 1,
+    kConnectionListenerPoller,
+    kEntry,
+    kEntryListener,
+    kEntryListenerPoller,
+    kInstance,
+    kLogger,
+    kLoggerPoller,
+    kRpcCall,
+    kRpcCallPoller
+  };
+  enum { kIndexMax = 0xfffff };
+
+  explicit Handle(NT_Handle handle) : m_handle(handle) {}
+  operator NT_Handle() const { return m_handle; }
+
+  NT_Handle handle() const { return m_handle; }
+
+  Handle(int inst, int index, Type type) {
+    if (inst < 0 || index < 0) {
+      m_handle = 0;
+      return;
+    }
+    m_handle = ((static_cast<int>(type) & 0xf) << 27) | ((inst & 0x7f) << 20) |
+               (index & 0xfffff);
+  }
+
+  int GetIndex() const { return static_cast<int>(m_handle) & 0xfffff; }
+  Type GetType() const {
+    return static_cast<Type>((static_cast<int>(m_handle) >> 27) & 0xf);
+  }
+  int GetInst() const { return (static_cast<int>(m_handle) >> 20) & 0x7f; }
+  bool IsType(Type type) const { return type == GetType(); }
+  int GetTypedIndex(Type type) const { return IsType(type) ? GetIndex() : -1; }
+  int GetTypedInst(Type type) const { return IsType(type) ? GetInst() : -1; }
+
+ private:
+  NT_Handle m_handle;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_HANDLE_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/IConnectionNotifier.h b/third_party/ntcore_2018/src/main/native/cpp/IConnectionNotifier.h
new file mode 100644
index 0000000..a410407
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/IConnectionNotifier.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_ICONNECTIONNOTIFIER_H_
+#define NTCORE_ICONNECTIONNOTIFIER_H_
+
+#include <climits>
+
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+class IConnectionNotifier {
+ public:
+  IConnectionNotifier() = default;
+  IConnectionNotifier(const IConnectionNotifier&) = delete;
+  IConnectionNotifier& operator=(const IConnectionNotifier&) = delete;
+  virtual ~IConnectionNotifier() = default;
+  virtual unsigned int Add(
+      std::function<void(const ConnectionNotification& event)> callback) = 0;
+  virtual unsigned int AddPolled(unsigned int poller_uid) = 0;
+  virtual void NotifyConnection(bool connected, const ConnectionInfo& conn_info,
+                                unsigned int only_listener = UINT_MAX) = 0;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_ICONNECTIONNOTIFIER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/IDispatcher.h b/third_party/ntcore_2018/src/main/native/cpp/IDispatcher.h
new file mode 100644
index 0000000..b02e585
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/IDispatcher.h
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_IDISPATCHER_H_
+#define NTCORE_IDISPATCHER_H_
+
+#include <memory>
+
+#include "Message.h"
+
+namespace nt {
+
+class INetworkConnection;
+
+// Interface for generation of outgoing messages to break a dependency loop
+// between Storage and Dispatcher.
+class IDispatcher {
+ public:
+  IDispatcher() = default;
+  IDispatcher(const IDispatcher&) = delete;
+  IDispatcher& operator=(const IDispatcher&) = delete;
+  virtual ~IDispatcher() = default;
+  virtual void QueueOutgoing(std::shared_ptr<Message> msg,
+                             INetworkConnection* only,
+                             INetworkConnection* except) = 0;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_IDISPATCHER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/IEntryNotifier.h b/third_party/ntcore_2018/src/main/native/cpp/IEntryNotifier.h
new file mode 100644
index 0000000..34db97c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/IEntryNotifier.h
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_IENTRYNOTIFIER_H_
+#define NTCORE_IENTRYNOTIFIER_H_
+
+#include <climits>
+#include <memory>
+
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+class IEntryNotifier {
+ public:
+  IEntryNotifier() = default;
+  IEntryNotifier(const IEntryNotifier&) = delete;
+  IEntryNotifier& operator=(const IEntryNotifier&) = delete;
+  virtual ~IEntryNotifier() = default;
+  virtual bool local_notifiers() const = 0;
+
+  virtual unsigned int Add(
+      std::function<void(const EntryNotification& event)> callback,
+      llvm::StringRef prefix, unsigned int flags) = 0;
+  virtual unsigned int Add(
+      std::function<void(const EntryNotification& event)> callback,
+      unsigned int local_id, unsigned int flags) = 0;
+  virtual unsigned int AddPolled(unsigned int poller_uid,
+                                 llvm::StringRef prefix,
+                                 unsigned int flags) = 0;
+  virtual unsigned int AddPolled(unsigned int poller_uid, unsigned int local_id,
+                                 unsigned int flags) = 0;
+
+  virtual void NotifyEntry(unsigned int local_id, StringRef name,
+                           std::shared_ptr<Value> value, unsigned int flags,
+                           unsigned int only_listener = UINT_MAX) = 0;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_IENTRYNOTIFIER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/INetworkConnection.h b/third_party/ntcore_2018/src/main/native/cpp/INetworkConnection.h
new file mode 100644
index 0000000..a3a68ba
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/INetworkConnection.h
@@ -0,0 +1,41 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_INETWORKCONNECTION_H_
+#define NTCORE_INETWORKCONNECTION_H_
+
+#include <memory>
+
+#include "Message.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+class INetworkConnection {
+ public:
+  enum State { kCreated, kInit, kHandshake, kSynchronized, kActive, kDead };
+
+  INetworkConnection() = default;
+  INetworkConnection(const INetworkConnection&) = delete;
+  INetworkConnection& operator=(const INetworkConnection&) = delete;
+  virtual ~INetworkConnection() = default;
+
+  virtual ConnectionInfo info() const = 0;
+
+  virtual void QueueOutgoing(std::shared_ptr<Message> msg) = 0;
+  virtual void PostOutgoing(bool keep_alive) = 0;
+
+  virtual unsigned int proto_rev() const = 0;
+  virtual void set_proto_rev(unsigned int proto_rev) = 0;
+
+  virtual State state() const = 0;
+  virtual void set_state(State state) = 0;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_INETWORKCONNECTION_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/IRpcServer.h b/third_party/ntcore_2018/src/main/native/cpp/IRpcServer.h
new file mode 100644
index 0000000..f846ab2
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/IRpcServer.h
@@ -0,0 +1,38 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_IRPCSERVER_H_
+#define NTCORE_IRPCSERVER_H_
+
+#include <memory>
+
+#include "Message.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+class IRpcServer {
+ public:
+  typedef std::function<void(StringRef result)> SendResponseFunc;
+
+  IRpcServer() = default;
+  IRpcServer(const IRpcServer&) = delete;
+  IRpcServer& operator=(const IRpcServer&) = delete;
+  virtual ~IRpcServer() = default;
+
+  virtual void RemoveRpc(unsigned int rpc_uid) = 0;
+
+  virtual void ProcessRpc(unsigned int local_id, unsigned int call_uid,
+                          StringRef name, StringRef params,
+                          const ConnectionInfo& conn,
+                          SendResponseFunc send_response,
+                          unsigned int rpc_uid) = 0;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_IRPCSERVER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/IStorage.h b/third_party/ntcore_2018/src/main/native/cpp/IStorage.h
new file mode 100644
index 0000000..9eb096a
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/IStorage.h
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_ISTORAGE_H_
+#define NTCORE_ISTORAGE_H_
+
+#include <functional>
+#include <memory>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/Twine.h>
+
+#include "Message.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+class IDispatcher;
+class INetworkConnection;
+
+class IStorage {
+ public:
+  IStorage() = default;
+  IStorage(const IStorage&) = delete;
+  IStorage& operator=(const IStorage&) = delete;
+  virtual ~IStorage() = default;
+
+  // Accessors required by Dispatcher.  An interface is used for
+  // generation of outgoing messages to break a dependency loop between
+  // Storage and Dispatcher.
+  virtual void SetDispatcher(IDispatcher* dispatcher, bool server) = 0;
+  virtual void ClearDispatcher() = 0;
+
+  // Required for wire protocol 2.0 to get the entry type of an entry when
+  // receiving entry updates (because the length/type is not provided in the
+  // message itself).  Not used in wire protocol 3.0.
+  virtual NT_Type GetMessageEntryType(unsigned int id) const = 0;
+
+  virtual void ProcessIncoming(std::shared_ptr<Message> msg,
+                               INetworkConnection* conn,
+                               std::weak_ptr<INetworkConnection> conn_weak) = 0;
+  virtual void GetInitialAssignments(
+      INetworkConnection& conn,
+      std::vector<std::shared_ptr<Message>>* msgs) = 0;
+  virtual void ApplyInitialAssignments(
+      INetworkConnection& conn, llvm::ArrayRef<std::shared_ptr<Message>> msgs,
+      bool new_server, std::vector<std::shared_ptr<Message>>* out_msgs) = 0;
+
+  // Filename-based save/load functions.  Used both by periodic saves and
+  // accessible directly via the user API.
+  virtual const char* SavePersistent(const Twine& filename,
+                                     bool periodic) const = 0;
+  virtual const char* LoadPersistent(
+      const Twine& filename,
+      std::function<void(size_t line, const char* msg)> warn) = 0;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_ISTORAGE_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/InstanceImpl.cpp b/third_party/ntcore_2018/src/main/native/cpp/InstanceImpl.cpp
new file mode 100644
index 0000000..780362c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/InstanceImpl.cpp
@@ -0,0 +1,108 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "InstanceImpl.h"
+
+using namespace nt;
+
+std::atomic<int> InstanceImpl::s_default{-1};
+std::atomic<InstanceImpl*> InstanceImpl::s_fast_instances[10];
+wpi::UidVector<std::unique_ptr<InstanceImpl>, 10> InstanceImpl::s_instances;
+wpi::mutex InstanceImpl::s_mutex;
+
+using namespace std::placeholders;
+
+InstanceImpl::InstanceImpl(int inst)
+    : logger_impl(inst),
+      logger(std::bind(&LoggerImpl::Log, &logger_impl, _1, _2, _3, _4)),
+      connection_notifier(inst),
+      entry_notifier(inst, logger),
+      rpc_server(inst, logger),
+      storage(entry_notifier, rpc_server, logger),
+      dispatcher(storage, connection_notifier, logger),
+      ds_client(dispatcher, logger) {
+  logger.set_min_level(logger_impl.GetMinLevel());
+}
+
+InstanceImpl::~InstanceImpl() { logger.SetLogger(nullptr); }
+
+InstanceImpl* InstanceImpl::GetDefault() { return Get(GetDefaultIndex()); }
+
+InstanceImpl* InstanceImpl::Get(int inst) {
+  if (inst < 0) return nullptr;
+
+  // fast path, just an atomic read
+  if (static_cast<unsigned int>(inst) <
+      (sizeof(s_fast_instances) / sizeof(s_fast_instances[0]))) {
+    InstanceImpl* ptr = s_fast_instances[inst];
+    if (ptr) return ptr;
+  }
+
+  // slow path
+  std::lock_guard<wpi::mutex> lock(s_mutex);
+
+  // static fast-path block
+  if (static_cast<unsigned int>(inst) <
+      (sizeof(s_fast_instances) / sizeof(s_fast_instances[0]))) {
+    // double-check
+    return s_fast_instances[inst];
+  }
+
+  // vector
+  if (static_cast<unsigned int>(inst) < s_instances.size()) {
+    return s_instances[inst].get();
+  }
+
+  // doesn't exist
+  return nullptr;
+}
+
+int InstanceImpl::GetDefaultIndex() {
+  int inst = s_default;
+  if (inst >= 0) return inst;
+
+  // slow path
+  std::lock_guard<wpi::mutex> lock(s_mutex);
+
+  // double-check
+  inst = s_default;
+  if (inst >= 0) return inst;
+
+  // alloc and save
+  inst = AllocImpl();
+  s_default = inst;
+  return inst;
+}
+
+int InstanceImpl::Alloc() {
+  std::lock_guard<wpi::mutex> lock(s_mutex);
+  return AllocImpl();
+}
+
+int InstanceImpl::AllocImpl() {
+  unsigned int inst = s_instances.emplace_back();
+  InstanceImpl* ptr = new InstanceImpl(inst);
+  s_instances[inst].reset(ptr);
+
+  if (inst < (sizeof(s_fast_instances) / sizeof(s_fast_instances[0]))) {
+    s_fast_instances[inst] = ptr;
+  }
+
+  return static_cast<int>(inst);
+}
+
+void InstanceImpl::Destroy(int inst) {
+  std::lock_guard<wpi::mutex> lock(s_mutex);
+  if (inst < 0 || static_cast<unsigned int>(inst) >= s_instances.size()) return;
+
+  if (static_cast<unsigned int>(inst) <
+      (sizeof(s_fast_instances) / sizeof(s_fast_instances[0]))) {
+    s_fast_instances[inst] = nullptr;
+  }
+
+  s_instances.erase(inst);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/InstanceImpl.h b/third_party/ntcore_2018/src/main/native/cpp/InstanceImpl.h
new file mode 100644
index 0000000..a1dc2f3
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/InstanceImpl.h
@@ -0,0 +1,60 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_INSTANCEIMPL_H_
+#define NTCORE_INSTANCEIMPL_H_
+
+#include <atomic>
+#include <memory>
+
+#include <support/UidVector.h>
+#include <support/mutex.h>
+
+#include "ConnectionNotifier.h"
+#include "Dispatcher.h"
+#include "DsClient.h"
+#include "EntryNotifier.h"
+#include "Log.h"
+#include "LoggerImpl.h"
+#include "RpcServer.h"
+#include "Storage.h"
+
+namespace nt {
+
+class InstanceImpl {
+ public:
+  explicit InstanceImpl(int inst);
+  ~InstanceImpl();
+
+  // Instance repository
+  static InstanceImpl* GetDefault();
+  static InstanceImpl* Get(int inst);
+  static int GetDefaultIndex();
+  static int Alloc();
+  static void Destroy(int inst);
+
+  LoggerImpl logger_impl;
+  wpi::Logger logger;
+  ConnectionNotifier connection_notifier;
+  EntryNotifier entry_notifier;
+  RpcServer rpc_server;
+  Storage storage;
+  Dispatcher dispatcher;
+  DsClient ds_client;
+
+ private:
+  static int AllocImpl();
+
+  static std::atomic<int> s_default;
+  static std::atomic<InstanceImpl*> s_fast_instances[10];
+  static wpi::UidVector<std::unique_ptr<InstanceImpl>, 10> s_instances;
+  static wpi::mutex s_mutex;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_INSTANCEIMPL_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Log.h b/third_party/ntcore_2018/src/main/native/cpp/Log.h
new file mode 100644
index 0000000..bcc9078
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Log.h
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_LOG_H_
+#define NTCORE_LOG_H_
+
+#include <support/Logger.h>
+
+#define LOG(level, x) WPI_LOG(m_logger, level, x)
+
+#undef ERROR
+#define ERROR(x) WPI_ERROR(m_logger, x)
+#define WARNING(x) WPI_WARNING(m_logger, x)
+#define INFO(x) WPI_INFO(m_logger, x)
+
+#define DEBUG(x) WPI_DEBUG(m_logger, x)
+#define DEBUG1(x) WPI_DEBUG1(m_logger, x)
+#define DEBUG2(x) WPI_DEBUG2(m_logger, x)
+#define DEBUG3(x) WPI_DEBUG3(m_logger, x)
+#define DEBUG4(x) WPI_DEBUG4(m_logger, x)
+
+#endif  // NTCORE_LOG_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/LoggerImpl.cpp b/third_party/ntcore_2018/src/main/native/cpp/LoggerImpl.cpp
new file mode 100644
index 0000000..c6c58b7
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/LoggerImpl.cpp
@@ -0,0 +1,77 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "LoggerImpl.h"
+
+#include <llvm/Path.h>
+#include <llvm/SmallString.h>
+#include <llvm/StringRef.h>
+#include <llvm/raw_ostream.h>
+
+using namespace nt;
+
+static void DefaultLogger(unsigned int level, const char* file,
+                          unsigned int line, const char* msg) {
+  llvm::SmallString<128> buf;
+  llvm::raw_svector_ostream oss(buf);
+  if (level == 20) {
+    oss << "NT: " << msg << '\n';
+    llvm::errs() << oss.str();
+    return;
+  }
+
+  llvm::StringRef levelmsg;
+  if (level >= 50)
+    levelmsg = "CRITICAL: ";
+  else if (level >= 40)
+    levelmsg = "ERROR: ";
+  else if (level >= 30)
+    levelmsg = "WARNING: ";
+  else
+    return;
+  oss << "NT: " << levelmsg << msg << " (" << file << ':' << line << ")\n";
+  llvm::errs() << oss.str();
+}
+
+LoggerImpl::LoggerImpl(int inst) : m_inst(inst) {}
+
+void LoggerImpl::Start() { DoStart(m_inst); }
+
+unsigned int LoggerImpl::Add(
+    std::function<void(const LogMessage& msg)> callback, unsigned int min_level,
+    unsigned int max_level) {
+  return DoAdd(callback, min_level, max_level);
+}
+
+unsigned int LoggerImpl::AddPolled(unsigned int poller_uid,
+                                   unsigned int min_level,
+                                   unsigned int max_level) {
+  return DoAdd(poller_uid, min_level, max_level);
+}
+
+unsigned int LoggerImpl::GetMinLevel() {
+  auto thr = GetThread();
+  if (!thr) return NT_LOG_INFO;
+  unsigned int level = NT_LOG_INFO;
+  for (size_t i = 0; i < thr->m_listeners.size(); ++i) {
+    const auto& listener = thr->m_listeners[i];
+    if (listener && listener.min_level < level) level = listener.min_level;
+  }
+  return level;
+}
+
+void LoggerImpl::Log(unsigned int level, const char* file, unsigned int line,
+                     const char* msg) {
+  // this is safe because it's null terminated and always the end
+  const char* filename = llvm::sys::path::filename(file).data();
+  {
+    auto thr = GetThread();
+    if (!thr || thr->m_listeners.empty())
+      DefaultLogger(level, filename, line, msg);
+  }
+  Send(UINT_MAX, 0, level, filename, line, msg);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/LoggerImpl.h b/third_party/ntcore_2018/src/main/native/cpp/LoggerImpl.h
new file mode 100644
index 0000000..85c6b1e
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/LoggerImpl.h
@@ -0,0 +1,83 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_LOGGERIMPL_H_
+#define NTCORE_LOGGERIMPL_H_
+
+#include "CallbackManager.h"
+#include "Handle.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+namespace impl {
+
+struct LoggerListenerData
+    : public ListenerData<std::function<void(const LogMessage& msg)>> {
+  LoggerListenerData() = default;
+  LoggerListenerData(std::function<void(const LogMessage& msg)> callback_,
+                     unsigned int min_level_, unsigned int max_level_)
+      : ListenerData(callback_), min_level(min_level_), max_level(max_level_) {}
+  LoggerListenerData(unsigned int poller_uid_, unsigned int min_level_,
+                     unsigned int max_level_)
+      : ListenerData(poller_uid_),
+        min_level(min_level_),
+        max_level(max_level_) {}
+
+  unsigned int min_level;
+  unsigned int max_level;
+};
+
+class LoggerThread
+    : public CallbackThread<LoggerThread, LogMessage, LoggerListenerData> {
+ public:
+  explicit LoggerThread(int inst) : m_inst(inst) {}
+
+  bool Matches(const LoggerListenerData& listener, const LogMessage& data) {
+    return data.level >= listener.min_level && data.level <= listener.max_level;
+  }
+
+  void SetListener(LogMessage* data, unsigned int listener_uid) {
+    data->logger = Handle(m_inst, listener_uid, Handle::kLogger).handle();
+  }
+
+  void DoCallback(std::function<void(const LogMessage& msg)> callback,
+                  const LogMessage& data) {
+    callback(data);
+  }
+
+  int m_inst;
+};
+
+}  // namespace impl
+
+class LoggerImpl : public CallbackManager<LoggerImpl, impl::LoggerThread> {
+  friend class LoggerTest;
+  friend class CallbackManager<LoggerImpl, impl::LoggerThread>;
+
+ public:
+  explicit LoggerImpl(int inst);
+
+  void Start();
+
+  unsigned int Add(std::function<void(const LogMessage& msg)> callback,
+                   unsigned int min_level, unsigned int max_level);
+  unsigned int AddPolled(unsigned int poller_uid, unsigned int min_level,
+                         unsigned int max_level);
+
+  unsigned int GetMinLevel();
+
+  void Log(unsigned int level, const char* file, unsigned int line,
+           const char* msg);
+
+ private:
+  int m_inst;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_LOGGERIMPL_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Message.cpp b/third_party/ntcore_2018/src/main/native/cpp/Message.cpp
new file mode 100644
index 0000000..e20f149
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Message.cpp
@@ -0,0 +1,301 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Message.h"
+
+#include <stdint.h>
+
+#include "Log.h"
+#include "WireDecoder.h"
+#include "WireEncoder.h"
+
+#define kClearAllMagic 0xD06CB27Aul
+
+using namespace nt;
+
+std::shared_ptr<Message> Message::Read(WireDecoder& decoder,
+                                       GetEntryTypeFunc get_entry_type) {
+  unsigned int msg_type = 0;
+  if (!decoder.Read8(&msg_type)) return nullptr;
+  auto msg =
+      std::make_shared<Message>(static_cast<MsgType>(msg_type), private_init());
+  switch (msg_type) {
+    case kKeepAlive:
+      break;
+    case kClientHello: {
+      unsigned int proto_rev;
+      if (!decoder.Read16(&proto_rev)) return nullptr;
+      msg->m_id = proto_rev;
+      // This intentionally uses the provided proto_rev instead of
+      // decoder.proto_rev().
+      if (proto_rev >= 0x0300u) {
+        if (!decoder.ReadString(&msg->m_str)) return nullptr;
+      }
+      break;
+    }
+    case kProtoUnsup: {
+      if (!decoder.Read16(&msg->m_id)) return nullptr;  // proto rev
+      break;
+    }
+    case kServerHelloDone:
+      break;
+    case kServerHello:
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received SERVER_HELLO in protocol < 3.0");
+        return nullptr;
+      }
+      if (!decoder.Read8(&msg->m_flags)) return nullptr;
+      if (!decoder.ReadString(&msg->m_str)) return nullptr;
+      break;
+    case kClientHelloDone:
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received CLIENT_HELLO_DONE in protocol < 3.0");
+        return nullptr;
+      }
+      break;
+    case kEntryAssign: {
+      if (!decoder.ReadString(&msg->m_str)) return nullptr;  // name
+      NT_Type type;
+      if (!decoder.ReadType(&type)) return nullptr;              // entry type
+      if (!decoder.Read16(&msg->m_id)) return nullptr;           // id
+      if (!decoder.Read16(&msg->m_seq_num_uid)) return nullptr;  // seq num
+      if (decoder.proto_rev() >= 0x0300u) {
+        if (!decoder.Read8(&msg->m_flags)) return nullptr;  // flags
+      }
+      msg->m_value = decoder.ReadValue(type);
+      if (!msg->m_value) return nullptr;
+      break;
+    }
+    case kEntryUpdate: {
+      if (!decoder.Read16(&msg->m_id)) return nullptr;           // id
+      if (!decoder.Read16(&msg->m_seq_num_uid)) return nullptr;  // seq num
+      NT_Type type;
+      if (decoder.proto_rev() >= 0x0300u) {
+        if (!decoder.ReadType(&type)) return nullptr;
+      } else {
+        type = get_entry_type(msg->m_id);
+      }
+      WPI_DEBUG4(decoder.logger(), "update message data type: " << type);
+      msg->m_value = decoder.ReadValue(type);
+      if (!msg->m_value) return nullptr;
+      break;
+    }
+    case kFlagsUpdate: {
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received FLAGS_UPDATE in protocol < 3.0");
+        return nullptr;
+      }
+      if (!decoder.Read16(&msg->m_id)) return nullptr;
+      if (!decoder.Read8(&msg->m_flags)) return nullptr;
+      break;
+    }
+    case kEntryDelete: {
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received ENTRY_DELETE in protocol < 3.0");
+        return nullptr;
+      }
+      if (!decoder.Read16(&msg->m_id)) return nullptr;
+      break;
+    }
+    case kClearEntries: {
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received CLEAR_ENTRIES in protocol < 3.0");
+        return nullptr;
+      }
+      uint32_t magic;
+      if (!decoder.Read32(&magic)) return nullptr;
+      if (magic != kClearAllMagic) {
+        decoder.set_error(
+            "received incorrect CLEAR_ENTRIES magic value, ignoring");
+        return nullptr;
+      }
+      break;
+    }
+    case kExecuteRpc: {
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received EXECUTE_RPC in protocol < 3.0");
+        return nullptr;
+      }
+      if (!decoder.Read16(&msg->m_id)) return nullptr;
+      if (!decoder.Read16(&msg->m_seq_num_uid)) return nullptr;  // uid
+      uint64_t size;
+      if (!decoder.ReadUleb128(&size)) return nullptr;
+      const char* params;
+      if (!decoder.Read(&params, size)) return nullptr;
+      msg->m_str = llvm::StringRef(params, size);
+      break;
+    }
+    case kRpcResponse: {
+      if (decoder.proto_rev() < 0x0300u) {
+        decoder.set_error("received RPC_RESPONSE in protocol < 3.0");
+        return nullptr;
+      }
+      if (!decoder.Read16(&msg->m_id)) return nullptr;
+      if (!decoder.Read16(&msg->m_seq_num_uid)) return nullptr;  // uid
+      uint64_t size;
+      if (!decoder.ReadUleb128(&size)) return nullptr;
+      const char* results;
+      if (!decoder.Read(&results, size)) return nullptr;
+      msg->m_str = llvm::StringRef(results, size);
+      break;
+    }
+    default:
+      decoder.set_error("unrecognized message type");
+      WPI_INFO(decoder.logger(), "unrecognized message type: " << msg_type);
+      return nullptr;
+  }
+  return msg;
+}
+
+std::shared_ptr<Message> Message::ClientHello(llvm::StringRef self_id) {
+  auto msg = std::make_shared<Message>(kClientHello, private_init());
+  msg->m_str = self_id;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::ServerHello(unsigned int flags,
+                                              llvm::StringRef self_id) {
+  auto msg = std::make_shared<Message>(kServerHello, private_init());
+  msg->m_str = self_id;
+  msg->m_flags = flags;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::EntryAssign(llvm::StringRef name,
+                                              unsigned int id,
+                                              unsigned int seq_num,
+                                              std::shared_ptr<Value> value,
+                                              unsigned int flags) {
+  auto msg = std::make_shared<Message>(kEntryAssign, private_init());
+  msg->m_str = name;
+  msg->m_value = value;
+  msg->m_id = id;
+  msg->m_flags = flags;
+  msg->m_seq_num_uid = seq_num;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::EntryUpdate(unsigned int id,
+                                              unsigned int seq_num,
+                                              std::shared_ptr<Value> value) {
+  auto msg = std::make_shared<Message>(kEntryUpdate, private_init());
+  msg->m_value = value;
+  msg->m_id = id;
+  msg->m_seq_num_uid = seq_num;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::FlagsUpdate(unsigned int id,
+                                              unsigned int flags) {
+  auto msg = std::make_shared<Message>(kFlagsUpdate, private_init());
+  msg->m_id = id;
+  msg->m_flags = flags;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::EntryDelete(unsigned int id) {
+  auto msg = std::make_shared<Message>(kEntryDelete, private_init());
+  msg->m_id = id;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::ExecuteRpc(unsigned int id, unsigned int uid,
+                                             llvm::StringRef params) {
+  auto msg = std::make_shared<Message>(kExecuteRpc, private_init());
+  msg->m_str = params;
+  msg->m_id = id;
+  msg->m_seq_num_uid = uid;
+  return msg;
+}
+
+std::shared_ptr<Message> Message::RpcResponse(unsigned int id, unsigned int uid,
+                                              llvm::StringRef result) {
+  auto msg = std::make_shared<Message>(kRpcResponse, private_init());
+  msg->m_str = result;
+  msg->m_id = id;
+  msg->m_seq_num_uid = uid;
+  return msg;
+}
+
+void Message::Write(WireEncoder& encoder) const {
+  switch (m_type) {
+    case kKeepAlive:
+      encoder.Write8(kKeepAlive);
+      break;
+    case kClientHello:
+      encoder.Write8(kClientHello);
+      encoder.Write16(encoder.proto_rev());
+      if (encoder.proto_rev() < 0x0300u) return;
+      encoder.WriteString(m_str);
+      break;
+    case kProtoUnsup:
+      encoder.Write8(kProtoUnsup);
+      encoder.Write16(encoder.proto_rev());
+      break;
+    case kServerHelloDone:
+      encoder.Write8(kServerHelloDone);
+      break;
+    case kServerHello:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kServerHello);
+      encoder.Write8(m_flags);
+      encoder.WriteString(m_str);
+      break;
+    case kClientHelloDone:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kClientHelloDone);
+      break;
+    case kEntryAssign:
+      encoder.Write8(kEntryAssign);
+      encoder.WriteString(m_str);
+      encoder.WriteType(m_value->type());
+      encoder.Write16(m_id);
+      encoder.Write16(m_seq_num_uid);
+      if (encoder.proto_rev() >= 0x0300u) encoder.Write8(m_flags);
+      encoder.WriteValue(*m_value);
+      break;
+    case kEntryUpdate:
+      encoder.Write8(kEntryUpdate);
+      encoder.Write16(m_id);
+      encoder.Write16(m_seq_num_uid);
+      if (encoder.proto_rev() >= 0x0300u) encoder.WriteType(m_value->type());
+      encoder.WriteValue(*m_value);
+      break;
+    case kFlagsUpdate:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kFlagsUpdate);
+      encoder.Write16(m_id);
+      encoder.Write8(m_flags);
+      break;
+    case kEntryDelete:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kEntryDelete);
+      encoder.Write16(m_id);
+      break;
+    case kClearEntries:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kClearEntries);
+      encoder.Write32(kClearAllMagic);
+      break;
+    case kExecuteRpc:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kExecuteRpc);
+      encoder.Write16(m_id);
+      encoder.Write16(m_seq_num_uid);
+      encoder.WriteString(m_str);
+      break;
+    case kRpcResponse:
+      if (encoder.proto_rev() < 0x0300u) return;  // new message in version 3.0
+      encoder.Write8(kRpcResponse);
+      encoder.Write16(m_id);
+      encoder.Write16(m_seq_num_uid);
+      encoder.WriteString(m_str);
+      break;
+    default:
+      break;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Message.h b/third_party/ntcore_2018/src/main/native/cpp/Message.h
new file mode 100644
index 0000000..369b48f
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Message.h
@@ -0,0 +1,117 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MESSAGE_H_
+#define NTCORE_MESSAGE_H_
+
+#include <functional>
+#include <memory>
+#include <string>
+
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+
+class WireDecoder;
+class WireEncoder;
+
+class Message {
+  struct private_init {};
+
+ public:
+  enum MsgType {
+    kUnknown = -1,
+    kKeepAlive = 0x00,
+    kClientHello = 0x01,
+    kProtoUnsup = 0x02,
+    kServerHelloDone = 0x03,
+    kServerHello = 0x04,
+    kClientHelloDone = 0x05,
+    kEntryAssign = 0x10,
+    kEntryUpdate = 0x11,
+    kFlagsUpdate = 0x12,
+    kEntryDelete = 0x13,
+    kClearEntries = 0x14,
+    kExecuteRpc = 0x20,
+    kRpcResponse = 0x21
+  };
+  typedef std::function<NT_Type(unsigned int id)> GetEntryTypeFunc;
+
+  Message() : m_type(kUnknown), m_id(0), m_flags(0), m_seq_num_uid(0) {}
+  Message(MsgType type, const private_init&)
+      : m_type(type), m_id(0), m_flags(0), m_seq_num_uid(0) {}
+
+  MsgType type() const { return m_type; }
+  bool Is(MsgType type) const { return type == m_type; }
+
+  // Message data accessors.  Callers are responsible for knowing what data is
+  // actually provided for a particular message.
+  llvm::StringRef str() const { return m_str; }
+  std::shared_ptr<Value> value() const { return m_value; }
+  unsigned int id() const { return m_id; }
+  unsigned int flags() const { return m_flags; }
+  unsigned int seq_num_uid() const { return m_seq_num_uid; }
+
+  // Read and write from wire representation
+  void Write(WireEncoder& encoder) const;
+  static std::shared_ptr<Message> Read(WireDecoder& decoder,
+                                       GetEntryTypeFunc get_entry_type);
+
+  // Create messages without data
+  static std::shared_ptr<Message> KeepAlive() {
+    return std::make_shared<Message>(kKeepAlive, private_init());
+  }
+  static std::shared_ptr<Message> ProtoUnsup() {
+    return std::make_shared<Message>(kProtoUnsup, private_init());
+  }
+  static std::shared_ptr<Message> ServerHelloDone() {
+    return std::make_shared<Message>(kServerHelloDone, private_init());
+  }
+  static std::shared_ptr<Message> ClientHelloDone() {
+    return std::make_shared<Message>(kClientHelloDone, private_init());
+  }
+  static std::shared_ptr<Message> ClearEntries() {
+    return std::make_shared<Message>(kClearEntries, private_init());
+  }
+
+  // Create messages with data
+  static std::shared_ptr<Message> ClientHello(llvm::StringRef self_id);
+  static std::shared_ptr<Message> ServerHello(unsigned int flags,
+                                              llvm::StringRef self_id);
+  static std::shared_ptr<Message> EntryAssign(llvm::StringRef name,
+                                              unsigned int id,
+                                              unsigned int seq_num,
+                                              std::shared_ptr<Value> value,
+                                              unsigned int flags);
+  static std::shared_ptr<Message> EntryUpdate(unsigned int id,
+                                              unsigned int seq_num,
+                                              std::shared_ptr<Value> value);
+  static std::shared_ptr<Message> FlagsUpdate(unsigned int id,
+                                              unsigned int flags);
+  static std::shared_ptr<Message> EntryDelete(unsigned int id);
+  static std::shared_ptr<Message> ExecuteRpc(unsigned int id, unsigned int uid,
+                                             llvm::StringRef params);
+  static std::shared_ptr<Message> RpcResponse(unsigned int id, unsigned int uid,
+                                              llvm::StringRef result);
+
+  Message(const Message&) = delete;
+  Message& operator=(const Message&) = delete;
+
+ private:
+  MsgType m_type;
+
+  // Message data.  Use varies by message type.
+  std::string m_str;
+  std::shared_ptr<Value> m_value;
+  unsigned int m_id;  // also used for proto_rev
+  unsigned int m_flags;
+  unsigned int m_seq_num_uid;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_MESSAGE_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/NetworkConnection.cpp b/third_party/ntcore_2018/src/main/native/cpp/NetworkConnection.cpp
new file mode 100644
index 0000000..dac87b9
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/NetworkConnection.cpp
@@ -0,0 +1,333 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "NetworkConnection.h"
+
+#include <support/raw_socket_istream.h>
+#include <support/timestamp.h>
+
+#include "IConnectionNotifier.h"
+#include "Log.h"
+#include "WireDecoder.h"
+#include "WireEncoder.h"
+#include "tcpsockets/NetworkStream.h"
+
+using namespace nt;
+
+NetworkConnection::NetworkConnection(unsigned int uid,
+                                     std::unique_ptr<wpi::NetworkStream> stream,
+                                     IConnectionNotifier& notifier,
+                                     wpi::Logger& logger,
+                                     HandshakeFunc handshake,
+                                     Message::GetEntryTypeFunc get_entry_type)
+    : m_uid(uid),
+      m_stream(std::move(stream)),
+      m_notifier(notifier),
+      m_logger(logger),
+      m_handshake(handshake),
+      m_get_entry_type(get_entry_type),
+      m_state(kCreated) {
+  m_active = false;
+  m_proto_rev = 0x0300;
+  m_last_update = 0;
+
+  // turn off Nagle algorithm; we bundle packets for transmission
+  m_stream->setNoDelay();
+}
+
+NetworkConnection::~NetworkConnection() { Stop(); }
+
+void NetworkConnection::Start() {
+  if (m_active) return;
+  m_active = true;
+  set_state(kInit);
+  // clear queue
+  while (!m_outgoing.empty()) m_outgoing.pop();
+  // reset shutdown flags
+  {
+    std::lock_guard<wpi::mutex> lock(m_shutdown_mutex);
+    m_read_shutdown = false;
+    m_write_shutdown = false;
+  }
+  // start threads
+  m_write_thread = std::thread(&NetworkConnection::WriteThreadMain, this);
+  m_read_thread = std::thread(&NetworkConnection::ReadThreadMain, this);
+}
+
+void NetworkConnection::Stop() {
+  DEBUG2("NetworkConnection stopping (" << this << ")");
+  set_state(kDead);
+  m_active = false;
+  // closing the stream so the read thread terminates
+  if (m_stream) m_stream->close();
+  // send an empty outgoing message set so the write thread terminates
+  m_outgoing.push(Outgoing());
+  // wait for threads to terminate, with timeout
+  if (m_write_thread.joinable()) {
+    std::unique_lock<wpi::mutex> lock(m_shutdown_mutex);
+    auto timeout_time =
+        std::chrono::steady_clock::now() + std::chrono::milliseconds(200);
+    if (m_write_shutdown_cv.wait_until(lock, timeout_time,
+                                       [&] { return m_write_shutdown; }))
+      m_write_thread.join();
+    else
+      m_write_thread.detach();  // timed out, detach it
+  }
+  if (m_read_thread.joinable()) {
+    std::unique_lock<wpi::mutex> lock(m_shutdown_mutex);
+    auto timeout_time =
+        std::chrono::steady_clock::now() + std::chrono::milliseconds(200);
+    if (m_read_shutdown_cv.wait_until(lock, timeout_time,
+                                      [&] { return m_read_shutdown; }))
+      m_read_thread.join();
+    else
+      m_read_thread.detach();  // timed out, detach it
+  }
+  // clear queue
+  while (!m_outgoing.empty()) m_outgoing.pop();
+}
+
+ConnectionInfo NetworkConnection::info() const {
+  return ConnectionInfo{remote_id(), m_stream->getPeerIP(),
+                        static_cast<unsigned int>(m_stream->getPeerPort()),
+                        m_last_update, m_proto_rev};
+}
+
+unsigned int NetworkConnection::proto_rev() const { return m_proto_rev; }
+
+void NetworkConnection::set_proto_rev(unsigned int proto_rev) {
+  m_proto_rev = proto_rev;
+}
+
+NetworkConnection::State NetworkConnection::state() const {
+  std::lock_guard<wpi::mutex> lock(m_state_mutex);
+  return m_state;
+}
+
+void NetworkConnection::set_state(State state) {
+  std::lock_guard<wpi::mutex> lock(m_state_mutex);
+  // Don't update state any more once we've died
+  if (m_state == kDead) return;
+  // One-shot notify state changes
+  if (m_state != kActive && state == kActive)
+    m_notifier.NotifyConnection(true, info());
+  if (m_state != kDead && state == kDead)
+    m_notifier.NotifyConnection(false, info());
+  m_state = state;
+}
+
+std::string NetworkConnection::remote_id() const {
+  std::lock_guard<wpi::mutex> lock(m_remote_id_mutex);
+  return m_remote_id;
+}
+
+void NetworkConnection::set_remote_id(StringRef remote_id) {
+  std::lock_guard<wpi::mutex> lock(m_remote_id_mutex);
+  m_remote_id = remote_id;
+}
+
+void NetworkConnection::ReadThreadMain() {
+  wpi::raw_socket_istream is(*m_stream);
+  WireDecoder decoder(is, m_proto_rev, m_logger);
+
+  set_state(kHandshake);
+  if (!m_handshake(*this,
+                   [&] {
+                     decoder.set_proto_rev(m_proto_rev);
+                     auto msg = Message::Read(decoder, m_get_entry_type);
+                     if (!msg && decoder.error())
+                       DEBUG("error reading in handshake: " << decoder.error());
+                     return msg;
+                   },
+                   [&](llvm::ArrayRef<std::shared_ptr<Message>> msgs) {
+                     m_outgoing.emplace(msgs);
+                   })) {
+    set_state(kDead);
+    m_active = false;
+    goto done;
+  }
+
+  set_state(kActive);
+  while (m_active) {
+    if (!m_stream) break;
+    decoder.set_proto_rev(m_proto_rev);
+    decoder.Reset();
+    auto msg = Message::Read(decoder, m_get_entry_type);
+    if (!msg) {
+      if (decoder.error()) INFO("read error: " << decoder.error());
+      // terminate connection on bad message
+      if (m_stream) m_stream->close();
+      break;
+    }
+    DEBUG3("received type=" << msg->type() << " with str=" << msg->str()
+                            << " id=" << msg->id()
+                            << " seq_num=" << msg->seq_num_uid());
+    m_last_update = Now();
+    m_process_incoming(std::move(msg), this);
+  }
+  DEBUG2("read thread died (" << this << ")");
+  set_state(kDead);
+  m_active = false;
+  m_outgoing.push(Outgoing());  // also kill write thread
+
+done:
+  // use condition variable to signal thread shutdown
+  {
+    std::lock_guard<wpi::mutex> lock(m_shutdown_mutex);
+    m_read_shutdown = true;
+    m_read_shutdown_cv.notify_one();
+  }
+}
+
+void NetworkConnection::WriteThreadMain() {
+  WireEncoder encoder(m_proto_rev);
+
+  while (m_active) {
+    auto msgs = m_outgoing.pop();
+    DEBUG4("write thread woke up");
+    if (msgs.empty()) continue;
+    encoder.set_proto_rev(m_proto_rev);
+    encoder.Reset();
+    DEBUG3("sending " << msgs.size() << " messages");
+    for (auto& msg : msgs) {
+      if (msg) {
+        DEBUG3("sending type=" << msg->type() << " with str=" << msg->str()
+                               << " id=" << msg->id()
+                               << " seq_num=" << msg->seq_num_uid());
+        msg->Write(encoder);
+      }
+    }
+    wpi::NetworkStream::Error err;
+    if (!m_stream) break;
+    if (encoder.size() == 0) continue;
+    if (m_stream->send(encoder.data(), encoder.size(), &err) == 0) break;
+    DEBUG4("sent " << encoder.size() << " bytes");
+  }
+  DEBUG2("write thread died (" << this << ")");
+  set_state(kDead);
+  m_active = false;
+  if (m_stream) m_stream->close();  // also kill read thread
+
+  // use condition variable to signal thread shutdown
+  {
+    std::lock_guard<wpi::mutex> lock(m_shutdown_mutex);
+    m_write_shutdown = true;
+    m_write_shutdown_cv.notify_one();
+  }
+}
+
+void NetworkConnection::QueueOutgoing(std::shared_ptr<Message> msg) {
+  std::lock_guard<wpi::mutex> lock(m_pending_mutex);
+
+  // Merge with previous.  One case we don't combine: delete/assign loop.
+  switch (msg->type()) {
+    case Message::kEntryAssign:
+    case Message::kEntryUpdate: {
+      // don't do this for unassigned id's
+      unsigned int id = msg->id();
+      if (id == 0xffff) {
+        m_pending_outgoing.push_back(msg);
+        break;
+      }
+      if (id < m_pending_update.size() && m_pending_update[id].first != 0) {
+        // overwrite the previous one for this id
+        auto& oldmsg = m_pending_outgoing[m_pending_update[id].first - 1];
+        if (oldmsg && oldmsg->Is(Message::kEntryAssign) &&
+            msg->Is(Message::kEntryUpdate)) {
+          // need to update assignment with new seq_num and value
+          oldmsg = Message::EntryAssign(oldmsg->str(), id, msg->seq_num_uid(),
+                                        msg->value(), oldmsg->flags());
+        } else {
+          oldmsg = msg;  // easy update
+        }
+      } else {
+        // new, but remember it
+        size_t pos = m_pending_outgoing.size();
+        m_pending_outgoing.push_back(msg);
+        if (id >= m_pending_update.size()) m_pending_update.resize(id + 1);
+        m_pending_update[id].first = pos + 1;
+      }
+      break;
+    }
+    case Message::kEntryDelete: {
+      // don't do this for unassigned id's
+      unsigned int id = msg->id();
+      if (id == 0xffff) {
+        m_pending_outgoing.push_back(msg);
+        break;
+      }
+
+      // clear previous updates
+      if (id < m_pending_update.size()) {
+        if (m_pending_update[id].first != 0) {
+          m_pending_outgoing[m_pending_update[id].first - 1].reset();
+          m_pending_update[id].first = 0;
+        }
+        if (m_pending_update[id].second != 0) {
+          m_pending_outgoing[m_pending_update[id].second - 1].reset();
+          m_pending_update[id].second = 0;
+        }
+      }
+
+      // add deletion
+      m_pending_outgoing.push_back(msg);
+      break;
+    }
+    case Message::kFlagsUpdate: {
+      // don't do this for unassigned id's
+      unsigned int id = msg->id();
+      if (id == 0xffff) {
+        m_pending_outgoing.push_back(msg);
+        break;
+      }
+      if (id < m_pending_update.size() && m_pending_update[id].second != 0) {
+        // overwrite the previous one for this id
+        m_pending_outgoing[m_pending_update[id].second - 1] = msg;
+      } else {
+        // new, but remember it
+        size_t pos = m_pending_outgoing.size();
+        m_pending_outgoing.push_back(msg);
+        if (id >= m_pending_update.size()) m_pending_update.resize(id + 1);
+        m_pending_update[id].second = pos + 1;
+      }
+      break;
+    }
+    case Message::kClearEntries: {
+      // knock out all previous assigns/updates!
+      for (auto& i : m_pending_outgoing) {
+        if (!i) continue;
+        auto t = i->type();
+        if (t == Message::kEntryAssign || t == Message::kEntryUpdate ||
+            t == Message::kFlagsUpdate || t == Message::kEntryDelete ||
+            t == Message::kClearEntries)
+          i.reset();
+      }
+      m_pending_update.resize(0);
+      m_pending_outgoing.push_back(msg);
+      break;
+    }
+    default:
+      m_pending_outgoing.push_back(msg);
+      break;
+  }
+}
+
+void NetworkConnection::PostOutgoing(bool keep_alive) {
+  std::lock_guard<wpi::mutex> lock(m_pending_mutex);
+  auto now = std::chrono::steady_clock::now();
+  if (m_pending_outgoing.empty()) {
+    if (!keep_alive) return;
+    // send keep-alives once a second (if no other messages have been sent)
+    if ((now - m_last_post) < std::chrono::seconds(1)) return;
+    m_outgoing.emplace(Outgoing{Message::KeepAlive()});
+  } else {
+    m_outgoing.emplace(std::move(m_pending_outgoing));
+    m_pending_outgoing.resize(0);
+    m_pending_update.resize(0);
+  }
+  m_last_post = now;
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/NetworkConnection.h b/third_party/ntcore_2018/src/main/native/cpp/NetworkConnection.h
new file mode 100644
index 0000000..2e57a42
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/NetworkConnection.h
@@ -0,0 +1,127 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKCONNECTION_H_
+#define NTCORE_NETWORKCONNECTION_H_
+
+#include <stdint.h>
+
+#include <atomic>
+#include <chrono>
+#include <memory>
+#include <string>
+#include <thread>
+#include <utility>
+#include <vector>
+
+#include <support/ConcurrentQueue.h>
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+#include "INetworkConnection.h"
+#include "Message.h"
+#include "ntcore_cpp.h"
+
+namespace wpi {
+class Logger;
+class NetworkStream;
+}  // namespace wpi
+
+namespace nt {
+
+class IConnectionNotifier;
+
+class NetworkConnection : public INetworkConnection {
+ public:
+  typedef std::function<bool(
+      NetworkConnection& conn,
+      std::function<std::shared_ptr<Message>()> get_msg,
+      std::function<void(llvm::ArrayRef<std::shared_ptr<Message>>)> send_msgs)>
+      HandshakeFunc;
+  typedef std::function<void(std::shared_ptr<Message> msg,
+                             NetworkConnection* conn)>
+      ProcessIncomingFunc;
+  typedef std::vector<std::shared_ptr<Message>> Outgoing;
+  typedef wpi::ConcurrentQueue<Outgoing> OutgoingQueue;
+
+  NetworkConnection(unsigned int uid,
+                    std::unique_ptr<wpi::NetworkStream> stream,
+                    IConnectionNotifier& notifier, wpi::Logger& logger,
+                    HandshakeFunc handshake,
+                    Message::GetEntryTypeFunc get_entry_type);
+  ~NetworkConnection();
+
+  // Set the input processor function.  This must be called before Start().
+  void set_process_incoming(ProcessIncomingFunc func) {
+    m_process_incoming = func;
+  }
+
+  void Start();
+  void Stop();
+
+  ConnectionInfo info() const override;
+
+  bool active() const { return m_active; }
+  wpi::NetworkStream& stream() { return *m_stream; }
+
+  void QueueOutgoing(std::shared_ptr<Message> msg) override;
+  void PostOutgoing(bool keep_alive) override;
+
+  unsigned int uid() const { return m_uid; }
+
+  unsigned int proto_rev() const override;
+  void set_proto_rev(unsigned int proto_rev) override;
+
+  State state() const override;
+  void set_state(State state) override;
+
+  std::string remote_id() const;
+  void set_remote_id(StringRef remote_id);
+
+  uint64_t last_update() const { return m_last_update; }
+
+  NetworkConnection(const NetworkConnection&) = delete;
+  NetworkConnection& operator=(const NetworkConnection&) = delete;
+
+ private:
+  void ReadThreadMain();
+  void WriteThreadMain();
+
+  unsigned int m_uid;
+  std::unique_ptr<wpi::NetworkStream> m_stream;
+  IConnectionNotifier& m_notifier;
+  wpi::Logger& m_logger;
+  OutgoingQueue m_outgoing;
+  HandshakeFunc m_handshake;
+  Message::GetEntryTypeFunc m_get_entry_type;
+  ProcessIncomingFunc m_process_incoming;
+  std::thread m_read_thread;
+  std::thread m_write_thread;
+  std::atomic_bool m_active;
+  std::atomic_uint m_proto_rev;
+  mutable wpi::mutex m_state_mutex;
+  State m_state;
+  mutable wpi::mutex m_remote_id_mutex;
+  std::string m_remote_id;
+  std::atomic_ullong m_last_update;
+  std::chrono::steady_clock::time_point m_last_post;
+
+  wpi::mutex m_pending_mutex;
+  Outgoing m_pending_outgoing;
+  std::vector<std::pair<size_t, size_t>> m_pending_update;
+
+  // Condition variables for shutdown
+  wpi::mutex m_shutdown_mutex;
+  wpi::condition_variable m_read_shutdown_cv;
+  wpi::condition_variable m_write_shutdown_cv;
+  bool m_read_shutdown = false;
+  bool m_write_shutdown = false;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_NETWORKCONNECTION_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/RpcServer.cpp b/third_party/ntcore_2018/src/main/native/cpp/RpcServer.cpp
new file mode 100644
index 0000000..19b1e36
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/RpcServer.cpp
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "RpcServer.h"
+
+using namespace nt;
+
+RpcServer::RpcServer(int inst, wpi::Logger& logger)
+    : m_inst(inst), m_logger(logger) {}
+
+void RpcServer::Start() { DoStart(m_inst, m_logger); }
+
+unsigned int RpcServer::Add(
+    std::function<void(const RpcAnswer& answer)> callback) {
+  return DoAdd(callback);
+}
+
+unsigned int RpcServer::AddPolled(unsigned int poller_uid) {
+  return DoAdd(poller_uid);
+}
+
+void RpcServer::RemoveRpc(unsigned int rpc_uid) { Remove(rpc_uid); }
+
+void RpcServer::ProcessRpc(unsigned int local_id, unsigned int call_uid,
+                           StringRef name, StringRef params,
+                           const ConnectionInfo& conn,
+                           SendResponseFunc send_response,
+                           unsigned int rpc_uid) {
+  Send(rpc_uid, Handle(m_inst, local_id, Handle::kEntry).handle(),
+       Handle(m_inst, call_uid, Handle::kRpcCall).handle(), name, params, conn,
+       send_response);
+}
+
+void RpcServer::PostRpcResponse(unsigned int local_id, unsigned int call_uid,
+                                llvm::StringRef result) {
+  auto thr = GetThread();
+  auto i = thr->m_response_map.find(impl::RpcIdPair{local_id, call_uid});
+  if (i == thr->m_response_map.end()) {
+    WARNING("posting RPC response to nonexistent call (or duplicate response)");
+    return;
+  }
+  (i->getSecond())(result);
+  thr->m_response_map.erase(i);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/RpcServer.h b/third_party/ntcore_2018/src/main/native/cpp/RpcServer.h
new file mode 100644
index 0000000..2b80db7
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/RpcServer.h
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_RPCSERVER_H_
+#define NTCORE_RPCSERVER_H_
+
+#include <utility>
+
+#include <llvm/DenseMap.h>
+#include <support/mutex.h>
+
+#include "CallbackManager.h"
+#include "Handle.h"
+#include "IRpcServer.h"
+#include "Log.h"
+
+namespace nt {
+
+namespace impl {
+
+typedef std::pair<unsigned int, unsigned int> RpcIdPair;
+
+struct RpcNotifierData : public RpcAnswer {
+  RpcNotifierData(NT_Entry entry_, NT_RpcCall call_, StringRef name_,
+                  StringRef params_, const ConnectionInfo& conn_,
+                  IRpcServer::SendResponseFunc send_response_)
+      : RpcAnswer{entry_, call_, name_, params_, conn_},
+        send_response{send_response_} {}
+
+  IRpcServer::SendResponseFunc send_response;
+};
+
+using RpcListenerData =
+    ListenerData<std::function<void(const RpcAnswer& answer)>>;
+
+class RpcServerThread
+    : public CallbackThread<RpcServerThread, RpcAnswer, RpcListenerData,
+                            RpcNotifierData> {
+ public:
+  RpcServerThread(int inst, wpi::Logger& logger)
+      : m_inst(inst), m_logger(logger) {}
+
+  bool Matches(const RpcListenerData& listener, const RpcNotifierData& data) {
+    return !data.name.empty() && data.send_response;
+  }
+
+  void SetListener(RpcNotifierData* data, unsigned int listener_uid) {
+    unsigned int local_id = Handle{data->entry}.GetIndex();
+    unsigned int call_uid = Handle{data->call}.GetIndex();
+    RpcIdPair lookup_uid{local_id, call_uid};
+    m_response_map.insert(std::make_pair(lookup_uid, data->send_response));
+  }
+
+  void DoCallback(std::function<void(const RpcAnswer& call)> callback,
+                  const RpcNotifierData& data) {
+    DEBUG4("rpc calling " << data.name);
+    unsigned int local_id = Handle{data.entry}.GetIndex();
+    unsigned int call_uid = Handle{data.call}.GetIndex();
+    RpcIdPair lookup_uid{local_id, call_uid};
+    callback(data);
+    {
+      std::lock_guard<wpi::mutex> lock(m_mutex);
+      auto i = m_response_map.find(lookup_uid);
+      if (i != m_response_map.end()) {
+        // post an empty response and erase it
+        (i->getSecond())("");
+        m_response_map.erase(i);
+      }
+    }
+  }
+
+  int m_inst;
+  wpi::Logger& m_logger;
+  llvm::DenseMap<RpcIdPair, IRpcServer::SendResponseFunc> m_response_map;
+};
+
+}  // namespace impl
+
+class RpcServer : public IRpcServer,
+                  public CallbackManager<RpcServer, impl::RpcServerThread> {
+  friend class RpcServerTest;
+  friend class CallbackManager<RpcServer, impl::RpcServerThread>;
+
+ public:
+  RpcServer(int inst, wpi::Logger& logger);
+
+  void Start();
+
+  unsigned int Add(std::function<void(const RpcAnswer& answer)> callback);
+  unsigned int AddPolled(unsigned int poller_uid);
+  void RemoveRpc(unsigned int rpc_uid) override;
+
+  void ProcessRpc(unsigned int local_id, unsigned int call_uid, StringRef name,
+                  StringRef params, const ConnectionInfo& conn,
+                  SendResponseFunc send_response,
+                  unsigned int rpc_uid) override;
+
+  void PostRpcResponse(unsigned int local_id, unsigned int call_uid,
+                       llvm::StringRef result);
+
+ private:
+  int m_inst;
+  wpi::Logger& m_logger;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_RPCSERVER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/SequenceNumber.cpp b/third_party/ntcore_2018/src/main/native/cpp/SequenceNumber.cpp
new file mode 100644
index 0000000..54a7d5f
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/SequenceNumber.cpp
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "SequenceNumber.h"
+
+namespace nt {
+
+bool operator<(const SequenceNumber& lhs, const SequenceNumber& rhs) {
+  if (lhs.m_value < rhs.m_value)
+    return (rhs.m_value - lhs.m_value) < (1u << 15);
+  else if (lhs.m_value > rhs.m_value)
+    return (lhs.m_value - rhs.m_value) > (1u << 15);
+  else
+    return false;
+}
+
+bool operator>(const SequenceNumber& lhs, const SequenceNumber& rhs) {
+  if (lhs.m_value < rhs.m_value)
+    return (rhs.m_value - lhs.m_value) > (1u << 15);
+  else if (lhs.m_value > rhs.m_value)
+    return (lhs.m_value - rhs.m_value) < (1u << 15);
+  else
+    return false;
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/main/native/cpp/SequenceNumber.h b/third_party/ntcore_2018/src/main/native/cpp/SequenceNumber.h
new file mode 100644
index 0000000..04b07b4
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/SequenceNumber.h
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_SEQUENCENUMBER_H_
+#define NTCORE_SEQUENCENUMBER_H_
+
+namespace nt {
+
+/* A sequence number per RFC 1982 */
+class SequenceNumber {
+ public:
+  SequenceNumber() : m_value(0) {}
+  explicit SequenceNumber(unsigned int value) : m_value(value) {}
+  unsigned int value() const { return m_value; }
+
+  SequenceNumber& operator++() {
+    ++m_value;
+    if (m_value > 0xffff) m_value = 0;
+    return *this;
+  }
+  SequenceNumber operator++(int) {
+    SequenceNumber tmp(*this);
+    operator++();
+    return tmp;
+  }
+
+  friend bool operator<(const SequenceNumber& lhs, const SequenceNumber& rhs);
+  friend bool operator>(const SequenceNumber& lhs, const SequenceNumber& rhs);
+  friend bool operator<=(const SequenceNumber& lhs, const SequenceNumber& rhs);
+  friend bool operator>=(const SequenceNumber& lhs, const SequenceNumber& rhs);
+  friend bool operator==(const SequenceNumber& lhs, const SequenceNumber& rhs);
+  friend bool operator!=(const SequenceNumber& lhs, const SequenceNumber& rhs);
+
+ private:
+  unsigned int m_value;
+};
+
+bool operator<(const SequenceNumber& lhs, const SequenceNumber& rhs);
+bool operator>(const SequenceNumber& lhs, const SequenceNumber& rhs);
+
+inline bool operator<=(const SequenceNumber& lhs, const SequenceNumber& rhs) {
+  return lhs == rhs || lhs < rhs;
+}
+
+inline bool operator>=(const SequenceNumber& lhs, const SequenceNumber& rhs) {
+  return lhs == rhs || lhs > rhs;
+}
+
+inline bool operator==(const SequenceNumber& lhs, const SequenceNumber& rhs) {
+  return lhs.m_value == rhs.m_value;
+}
+
+inline bool operator!=(const SequenceNumber& lhs, const SequenceNumber& rhs) {
+  return lhs.m_value != rhs.m_value;
+}
+
+}  // namespace nt
+
+#endif  // NTCORE_SEQUENCENUMBER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Storage.cpp b/third_party/ntcore_2018/src/main/native/cpp/Storage.cpp
new file mode 100644
index 0000000..8bb37f8
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Storage.cpp
@@ -0,0 +1,1137 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "Storage.h"
+
+#include <support/timestamp.h>
+
+#include "Handle.h"
+#include "IDispatcher.h"
+#include "IEntryNotifier.h"
+#include "INetworkConnection.h"
+#include "IRpcServer.h"
+#include "Log.h"
+
+using namespace nt;
+
+Storage::Storage(IEntryNotifier& notifier, IRpcServer& rpc_server,
+                 wpi::Logger& logger)
+    : m_notifier(notifier), m_rpc_server(rpc_server), m_logger(logger) {
+  m_terminating = false;
+}
+
+Storage::~Storage() {
+  m_terminating = true;
+  m_rpc_results_cond.notify_all();
+}
+
+void Storage::SetDispatcher(IDispatcher* dispatcher, bool server) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  m_dispatcher = dispatcher;
+  m_server = server;
+}
+
+void Storage::ClearDispatcher() { m_dispatcher = nullptr; }
+
+NT_Type Storage::GetMessageEntryType(unsigned int id) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (id >= m_idmap.size()) return NT_UNASSIGNED;
+  Entry* entry = m_idmap[id];
+  if (!entry || !entry->value) return NT_UNASSIGNED;
+  return entry->value->type();
+}
+
+void Storage::ProcessIncoming(std::shared_ptr<Message> msg,
+                              INetworkConnection* conn,
+                              std::weak_ptr<INetworkConnection> conn_weak) {
+  switch (msg->type()) {
+    case Message::kKeepAlive:
+      break;  // ignore
+    case Message::kClientHello:
+    case Message::kProtoUnsup:
+    case Message::kServerHelloDone:
+    case Message::kServerHello:
+    case Message::kClientHelloDone:
+      // shouldn't get these, but ignore if we do
+      break;
+    case Message::kEntryAssign:
+      ProcessIncomingEntryAssign(std::move(msg), conn);
+      break;
+    case Message::kEntryUpdate:
+      ProcessIncomingEntryUpdate(std::move(msg), conn);
+      break;
+    case Message::kFlagsUpdate:
+      ProcessIncomingFlagsUpdate(std::move(msg), conn);
+      break;
+    case Message::kEntryDelete:
+      ProcessIncomingEntryDelete(std::move(msg), conn);
+      break;
+    case Message::kClearEntries:
+      ProcessIncomingClearEntries(std::move(msg), conn);
+      break;
+    case Message::kExecuteRpc:
+      ProcessIncomingExecuteRpc(std::move(msg), conn, std::move(conn_weak));
+      break;
+    case Message::kRpcResponse:
+      ProcessIncomingRpcResponse(std::move(msg), conn);
+      break;
+    default:
+      break;
+  }
+}
+
+void Storage::ProcessIncomingEntryAssign(std::shared_ptr<Message> msg,
+                                         INetworkConnection* conn) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  unsigned int id = msg->id();
+  StringRef name = msg->str();
+  Entry* entry;
+  bool may_need_update = false;
+  SequenceNumber seq_num(msg->seq_num_uid());
+  if (m_server) {
+    // if we're a server, id=0xffff requests are requests for an id
+    // to be assigned, and we need to send the new assignment back to
+    // the sender as well as all other connections.
+    if (id == 0xffff) {
+      entry = GetOrNew(name);
+      // see if it was already assigned; ignore if so.
+      if (entry->id != 0xffff) return;
+
+      entry->flags = msg->flags();
+      entry->seq_num = seq_num;
+      SetEntryValueImpl(entry, msg->value(), lock, false);
+      return;
+    }
+    if (id >= m_idmap.size() || !m_idmap[id]) {
+      // ignore arbitrary entry assignments
+      // this can happen due to e.g. assignment to deleted entry
+      lock.unlock();
+      DEBUG("server: received assignment to unknown entry");
+      return;
+    }
+    entry = m_idmap[id];
+  } else {
+    // clients simply accept new assignments
+    if (id == 0xffff) {
+      lock.unlock();
+      DEBUG("client: received entry assignment request?");
+      return;
+    }
+    if (id >= m_idmap.size()) m_idmap.resize(id + 1);
+    entry = m_idmap[id];
+    if (!entry) {
+      // create local
+      entry = GetOrNew(name);
+      entry->id = id;
+      m_idmap[id] = entry;
+      if (!entry->value) {
+        // didn't exist at all (rather than just being a response to a
+        // id assignment request)
+        entry->value = msg->value();
+        entry->flags = msg->flags();
+        entry->seq_num = seq_num;
+
+        // notify
+        m_notifier.NotifyEntry(entry->local_id, name, entry->value,
+                               NT_NOTIFY_NEW);
+        return;
+      }
+      may_need_update = true;  // we may need to send an update message
+
+      // if the received flags don't match what we sent, we most likely
+      // updated flags locally in the interim; send flags update message.
+      if (msg->flags() != entry->flags) {
+        auto dispatcher = m_dispatcher;
+        auto outmsg = Message::FlagsUpdate(id, entry->flags);
+        lock.unlock();
+        dispatcher->QueueOutgoing(outmsg, nullptr, nullptr);
+        lock.lock();
+      }
+    }
+  }
+
+  // common client and server handling
+
+  // already exists; ignore if sequence number not higher than local
+  if (seq_num < entry->seq_num) {
+    if (may_need_update) {
+      auto dispatcher = m_dispatcher;
+      auto outmsg =
+          Message::EntryUpdate(entry->id, entry->seq_num.value(), entry->value);
+      lock.unlock();
+      dispatcher->QueueOutgoing(outmsg, nullptr, nullptr);
+    }
+    return;
+  }
+
+  // sanity check: name should match id
+  if (msg->str() != entry->name) {
+    lock.unlock();
+    DEBUG("entry assignment for same id with different name?");
+    return;
+  }
+
+  unsigned int notify_flags = NT_NOTIFY_UPDATE;
+
+  // don't update flags from a <3.0 remote (not part of message)
+  // don't update flags if this is a server response to a client id request
+  if (!may_need_update && conn->proto_rev() >= 0x0300) {
+    // update persistent dirty flag if persistent flag changed
+    if ((entry->flags & NT_PERSISTENT) != (msg->flags() & NT_PERSISTENT))
+      m_persistent_dirty = true;
+    if (entry->flags != msg->flags()) notify_flags |= NT_NOTIFY_FLAGS;
+    entry->flags = msg->flags();
+  }
+
+  // update persistent dirty flag if the value changed and it's persistent
+  if (entry->IsPersistent() && *entry->value != *msg->value())
+    m_persistent_dirty = true;
+
+  // update local
+  entry->value = msg->value();
+  entry->seq_num = seq_num;
+
+  // notify
+  m_notifier.NotifyEntry(entry->local_id, name, entry->value, notify_flags);
+
+  // broadcast to all other connections (note for client there won't
+  // be any other connections, so don't bother)
+  if (m_server && m_dispatcher) {
+    auto dispatcher = m_dispatcher;
+    auto outmsg = Message::EntryAssign(entry->name, id, msg->seq_num_uid(),
+                                       msg->value(), entry->flags);
+    lock.unlock();
+    dispatcher->QueueOutgoing(outmsg, nullptr, conn);
+  }
+}
+
+void Storage::ProcessIncomingEntryUpdate(std::shared_ptr<Message> msg,
+                                         INetworkConnection* conn) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  unsigned int id = msg->id();
+  if (id >= m_idmap.size() || !m_idmap[id]) {
+    // ignore arbitrary entry updates;
+    // this can happen due to deleted entries
+    lock.unlock();
+    DEBUG("received update to unknown entry");
+    return;
+  }
+  Entry* entry = m_idmap[id];
+
+  // ignore if sequence number not higher than local
+  SequenceNumber seq_num(msg->seq_num_uid());
+  if (seq_num <= entry->seq_num) return;
+
+  // update local
+  entry->value = msg->value();
+  entry->seq_num = seq_num;
+
+  // update persistent dirty flag if it's a persistent value
+  if (entry->IsPersistent()) m_persistent_dirty = true;
+
+  // notify
+  m_notifier.NotifyEntry(entry->local_id, entry->name, entry->value,
+                         NT_NOTIFY_UPDATE);
+
+  // broadcast to all other connections (note for client there won't
+  // be any other connections, so don't bother)
+  if (m_server && m_dispatcher) {
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, conn);
+  }
+}
+
+void Storage::ProcessIncomingFlagsUpdate(std::shared_ptr<Message> msg,
+                                         INetworkConnection* conn) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  unsigned int id = msg->id();
+  if (id >= m_idmap.size() || !m_idmap[id]) {
+    // ignore arbitrary entry updates;
+    // this can happen due to deleted entries
+    lock.unlock();
+    DEBUG("received flags update to unknown entry");
+    return;
+  }
+
+  // update local
+  SetEntryFlagsImpl(m_idmap[id], msg->flags(), lock, false);
+
+  // broadcast to all other connections (note for client there won't
+  // be any other connections, so don't bother)
+  if (m_server && m_dispatcher) {
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, conn);
+  }
+}
+
+void Storage::ProcessIncomingEntryDelete(std::shared_ptr<Message> msg,
+                                         INetworkConnection* conn) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  unsigned int id = msg->id();
+  if (id >= m_idmap.size() || !m_idmap[id]) {
+    // ignore arbitrary entry updates;
+    // this can happen due to deleted entries
+    lock.unlock();
+    DEBUG("received delete to unknown entry");
+    return;
+  }
+
+  // update local
+  DeleteEntryImpl(m_idmap[id], lock, false);
+
+  // broadcast to all other connections (note for client there won't
+  // be any other connections, so don't bother)
+  if (m_server && m_dispatcher) {
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, conn);
+  }
+}
+
+void Storage::ProcessIncomingClearEntries(std::shared_ptr<Message> msg,
+                                          INetworkConnection* conn) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  // update local
+  DeleteAllEntriesImpl(false);
+
+  // broadcast to all other connections (note for client there won't
+  // be any other connections, so don't bother)
+  if (m_server && m_dispatcher) {
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, conn);
+  }
+}
+
+void Storage::ProcessIncomingExecuteRpc(
+    std::shared_ptr<Message> msg, INetworkConnection* conn,
+    std::weak_ptr<INetworkConnection> conn_weak) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (!m_server) return;  // only process on server
+  unsigned int id = msg->id();
+  if (id >= m_idmap.size() || !m_idmap[id]) {
+    // ignore call to non-existent RPC
+    // this can happen due to deleted entries
+    lock.unlock();
+    DEBUG("received RPC call to unknown entry");
+    return;
+  }
+  Entry* entry = m_idmap[id];
+  if (!entry->value || !entry->value->IsRpc()) {
+    lock.unlock();
+    DEBUG("received RPC call to non-RPC entry");
+    return;
+  }
+  ConnectionInfo conn_info;
+  auto c = conn_weak.lock();
+  if (c) {
+    conn_info = c->info();
+  } else {
+    conn_info.remote_id = "";
+    conn_info.remote_ip = "";
+    conn_info.remote_port = 0;
+    conn_info.last_update = 0;
+    conn_info.protocol_version = 0;
+  }
+  unsigned int call_uid = msg->seq_num_uid();
+  m_rpc_server.ProcessRpc(
+      entry->local_id, call_uid, entry->name, msg->str(), conn_info,
+      [=](StringRef result) {
+        auto c = conn_weak.lock();
+        if (c) c->QueueOutgoing(Message::RpcResponse(id, call_uid, result));
+      },
+      entry->rpc_uid);
+}
+
+void Storage::ProcessIncomingRpcResponse(std::shared_ptr<Message> msg,
+                                         INetworkConnection* conn) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (m_server) return;  // only process on client
+  unsigned int id = msg->id();
+  if (id >= m_idmap.size() || !m_idmap[id]) {
+    // ignore response to non-existent RPC
+    // this can happen due to deleted entries
+    lock.unlock();
+    DEBUG("received rpc response to unknown entry");
+    return;
+  }
+  Entry* entry = m_idmap[id];
+  if (!entry->value || !entry->value->IsRpc()) {
+    lock.unlock();
+    DEBUG("received RPC response to non-RPC entry");
+    return;
+  }
+  m_rpc_results.insert(std::make_pair(
+      RpcIdPair{entry->local_id, msg->seq_num_uid()}, msg->str()));
+  m_rpc_results_cond.notify_all();
+}
+
+void Storage::GetInitialAssignments(
+    INetworkConnection& conn, std::vector<std::shared_ptr<Message>>* msgs) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  conn.set_state(INetworkConnection::kSynchronized);
+  for (auto& i : m_entries) {
+    Entry* entry = i.getValue();
+    if (!entry->value) continue;
+    msgs->emplace_back(Message::EntryAssign(i.getKey(), entry->id,
+                                            entry->seq_num.value(),
+                                            entry->value, entry->flags));
+  }
+}
+
+void Storage::ApplyInitialAssignments(
+    INetworkConnection& conn, llvm::ArrayRef<std::shared_ptr<Message>> msgs,
+    bool new_server, std::vector<std::shared_ptr<Message>>* out_msgs) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (m_server) return;  // should not do this on server
+
+  conn.set_state(INetworkConnection::kSynchronized);
+
+  std::vector<std::shared_ptr<Message>> update_msgs;
+
+  // clear existing id's
+  for (auto& i : m_entries) i.getValue()->id = 0xffff;
+
+  // clear existing idmap
+  m_idmap.resize(0);
+
+  // apply assignments
+  for (auto& msg : msgs) {
+    if (!msg->Is(Message::kEntryAssign)) {
+      DEBUG("client: received non-entry assignment request?");
+      continue;
+    }
+
+    unsigned int id = msg->id();
+    if (id == 0xffff) {
+      DEBUG("client: received entry assignment request?");
+      continue;
+    }
+
+    SequenceNumber seq_num(msg->seq_num_uid());
+    StringRef name = msg->str();
+
+    Entry* entry = GetOrNew(name);
+    if (!entry->value) {
+      // doesn't currently exist
+      entry->value = msg->value();
+      entry->flags = msg->flags();
+      entry->seq_num = seq_num;
+      // notify
+      m_notifier.NotifyEntry(entry->local_id, name, entry->value,
+                             NT_NOTIFY_NEW);
+    } else {
+      // if we have written the value locally and the value is not persistent,
+      // then we don't update the local value and instead send it back to the
+      // server as an update message
+      if (entry->local_write && !entry->IsPersistent()) {
+        update_msgs.emplace_back(Message::EntryUpdate(
+            entry->id, entry->seq_num.value(), entry->value));
+      } else {
+        entry->value = msg->value();
+        entry->seq_num = seq_num;
+        unsigned int notify_flags = NT_NOTIFY_UPDATE;
+        // don't update flags from a <3.0 remote (not part of message)
+        if (conn.proto_rev() >= 0x0300) {
+          if (entry->flags != msg->flags()) notify_flags |= NT_NOTIFY_FLAGS;
+          entry->flags = msg->flags();
+        }
+        // notify
+        m_notifier.NotifyEntry(entry->local_id, name, entry->value,
+                               notify_flags);
+      }
+    }
+
+    // set id and save to idmap
+    entry->id = id;
+    if (id >= m_idmap.size()) m_idmap.resize(id + 1);
+    m_idmap[id] = entry;
+  }
+
+  // delete or generate assign messages for unassigned local entries
+  DeleteAllEntriesImpl(false, [&](Entry* entry) -> bool {
+    // was assigned by the server, don't delete
+    if (entry->id != 0xffff) return false;
+    // if we have written the value locally, we send an assign message to the
+    // server instead of deleting
+    if (entry->local_write) {
+      out_msgs->emplace_back(Message::EntryAssign(entry->name, entry->id,
+                                                  entry->seq_num.value(),
+                                                  entry->value, entry->flags));
+      return false;
+    }
+    // otherwise delete
+    return true;
+  });
+  auto dispatcher = m_dispatcher;
+  lock.unlock();
+  for (auto& msg : update_msgs)
+    dispatcher->QueueOutgoing(msg, nullptr, nullptr);
+}
+
+std::shared_ptr<Value> Storage::GetEntryValue(StringRef name) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  auto i = m_entries.find(name);
+  if (i == m_entries.end()) return nullptr;
+  return i->getValue()->value;
+}
+
+std::shared_ptr<Value> Storage::GetEntryValue(unsigned int local_id) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return nullptr;
+  return m_localmap[local_id]->value;
+}
+
+bool Storage::SetDefaultEntryValue(StringRef name,
+                                   std::shared_ptr<Value> value) {
+  if (name.empty()) return false;
+  if (!value) return false;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  Entry* entry = GetOrNew(name);
+
+  // we return early if value already exists; if types match return true
+  if (entry->value) return entry->value->type() == value->type();
+
+  SetEntryValueImpl(entry, value, lock, true);
+  return true;
+}
+
+bool Storage::SetDefaultEntryValue(unsigned int local_id,
+                                   std::shared_ptr<Value> value) {
+  if (!value) return false;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return false;
+  Entry* entry = m_localmap[local_id].get();
+
+  // we return early if value already exists; if types match return true
+  if (entry->value) return entry->value->type() == value->type();
+
+  SetEntryValueImpl(entry, value, lock, true);
+  return true;
+}
+
+bool Storage::SetEntryValue(StringRef name, std::shared_ptr<Value> value) {
+  if (name.empty()) return true;
+  if (!value) return true;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  Entry* entry = GetOrNew(name);
+
+  if (entry->value && entry->value->type() != value->type())
+    return false;  // error on type mismatch
+
+  SetEntryValueImpl(entry, value, lock, true);
+  return true;
+}
+
+bool Storage::SetEntryValue(unsigned int local_id,
+                            std::shared_ptr<Value> value) {
+  if (!value) return true;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return true;
+  Entry* entry = m_localmap[local_id].get();
+
+  if (entry->value && entry->value->type() != value->type())
+    return false;  // error on type mismatch
+
+  SetEntryValueImpl(entry, value, lock, true);
+  return true;
+}
+
+void Storage::SetEntryValueImpl(Entry* entry, std::shared_ptr<Value> value,
+                                std::unique_lock<wpi::mutex>& lock,
+                                bool local) {
+  if (!value) return;
+  auto old_value = entry->value;
+  entry->value = value;
+
+  // if we're the server, assign an id if it doesn't have one
+  if (m_server && entry->id == 0xffff) {
+    unsigned int id = m_idmap.size();
+    entry->id = id;
+    m_idmap.push_back(entry);
+  }
+
+  // update persistent dirty flag if value changed and it's persistent
+  if (entry->IsPersistent() && (!old_value || *old_value != *value))
+    m_persistent_dirty = true;
+
+  // notify
+  if (!old_value)
+    m_notifier.NotifyEntry(entry->local_id, entry->name, value,
+                           NT_NOTIFY_NEW | (local ? NT_NOTIFY_LOCAL : 0));
+  else if (*old_value != *value)
+    m_notifier.NotifyEntry(entry->local_id, entry->name, value,
+                           NT_NOTIFY_UPDATE | (local ? NT_NOTIFY_LOCAL : 0));
+
+  // remember local changes
+  if (local) entry->local_write = true;
+
+  // generate message
+  if (!m_dispatcher || (!local && !m_server)) return;
+  auto dispatcher = m_dispatcher;
+  if (!old_value || old_value->type() != value->type()) {
+    if (local) ++entry->seq_num;
+    auto msg = Message::EntryAssign(
+        entry->name, entry->id, entry->seq_num.value(), value, entry->flags);
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, nullptr);
+  } else if (*old_value != *value) {
+    if (local) ++entry->seq_num;
+    // don't send an update if we don't have an assigned id yet
+    if (entry->id != 0xffff) {
+      auto msg = Message::EntryUpdate(entry->id, entry->seq_num.value(), value);
+      lock.unlock();
+      dispatcher->QueueOutgoing(msg, nullptr, nullptr);
+    }
+  }
+}
+
+void Storage::SetEntryTypeValue(StringRef name, std::shared_ptr<Value> value) {
+  if (name.empty()) return;
+  if (!value) return;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  Entry* entry = GetOrNew(name);
+
+  SetEntryValueImpl(entry, value, lock, true);
+}
+
+void Storage::SetEntryTypeValue(unsigned int local_id,
+                                std::shared_ptr<Value> value) {
+  if (!value) return;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return;
+  Entry* entry = m_localmap[local_id].get();
+  if (!entry) return;
+
+  SetEntryValueImpl(entry, value, lock, true);
+}
+
+void Storage::SetEntryFlags(StringRef name, unsigned int flags) {
+  if (name.empty()) return;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  auto i = m_entries.find(name);
+  if (i == m_entries.end()) return;
+  SetEntryFlagsImpl(i->getValue(), flags, lock, true);
+}
+
+void Storage::SetEntryFlags(unsigned int id_local, unsigned int flags) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (id_local >= m_localmap.size()) return;
+  SetEntryFlagsImpl(m_localmap[id_local].get(), flags, lock, true);
+}
+
+void Storage::SetEntryFlagsImpl(Entry* entry, unsigned int flags,
+                                std::unique_lock<wpi::mutex>& lock,
+                                bool local) {
+  if (!entry->value || entry->flags == flags) return;
+
+  // update persistent dirty flag if persistent flag changed
+  if ((entry->flags & NT_PERSISTENT) != (flags & NT_PERSISTENT))
+    m_persistent_dirty = true;
+
+  entry->flags = flags;
+
+  // notify
+  m_notifier.NotifyEntry(entry->local_id, entry->name, entry->value,
+                         NT_NOTIFY_FLAGS | (local ? NT_NOTIFY_LOCAL : 0));
+
+  // generate message
+  if (!local || !m_dispatcher) return;
+  auto dispatcher = m_dispatcher;
+  unsigned int id = entry->id;
+  // don't send an update if we don't have an assigned id yet
+  if (id != 0xffff) {
+    lock.unlock();
+    dispatcher->QueueOutgoing(Message::FlagsUpdate(id, flags), nullptr,
+                              nullptr);
+  }
+}
+
+unsigned int Storage::GetEntryFlags(StringRef name) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  auto i = m_entries.find(name);
+  if (i == m_entries.end()) return 0;
+  return i->getValue()->flags;
+}
+
+unsigned int Storage::GetEntryFlags(unsigned int local_id) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return 0;
+  return m_localmap[local_id]->flags;
+}
+
+void Storage::DeleteEntry(StringRef name) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  auto i = m_entries.find(name);
+  if (i == m_entries.end()) return;
+  DeleteEntryImpl(i->getValue(), lock, true);
+}
+
+void Storage::DeleteEntry(unsigned int local_id) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return;
+  DeleteEntryImpl(m_localmap[local_id].get(), lock, true);
+}
+
+void Storage::DeleteEntryImpl(Entry* entry, std::unique_lock<wpi::mutex>& lock,
+                              bool local) {
+  unsigned int id = entry->id;
+
+  // Erase entry from id mapping.
+  if (id < m_idmap.size()) m_idmap[id] = nullptr;
+
+  // empty the value and reset id and local_write flag
+  std::shared_ptr<Value> old_value;
+  old_value.swap(entry->value);
+  entry->id = 0xffff;
+  entry->local_write = false;
+
+  // remove RPC if there was one
+  if (entry->rpc_uid != UINT_MAX) {
+    m_rpc_server.RemoveRpc(entry->rpc_uid);
+    entry->rpc_uid = UINT_MAX;
+  }
+
+  // update persistent dirty flag if it's a persistent value
+  if (entry->IsPersistent()) m_persistent_dirty = true;
+
+  // reset flags
+  entry->flags = 0;
+
+  if (!old_value) return;  // was not previously assigned
+
+  // notify
+  m_notifier.NotifyEntry(entry->local_id, entry->name, old_value,
+                         NT_NOTIFY_DELETE | (local ? NT_NOTIFY_LOCAL : 0));
+
+  // if it had a value, generate message
+  // don't send an update if we don't have an assigned id yet
+  if (local && id != 0xffff) {
+    if (!m_dispatcher) return;
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    dispatcher->QueueOutgoing(Message::EntryDelete(id), nullptr, nullptr);
+  }
+}
+
+template <typename F>
+void Storage::DeleteAllEntriesImpl(bool local, F should_delete) {
+  for (auto& i : m_entries) {
+    Entry* entry = i.getValue();
+    if (entry->value && should_delete(entry)) {
+      // notify it's being deleted
+      m_notifier.NotifyEntry(entry->local_id, i.getKey(), entry->value,
+                             NT_NOTIFY_DELETE | (local ? NT_NOTIFY_LOCAL : 0));
+      // remove it from idmap
+      if (entry->id < m_idmap.size()) m_idmap[entry->id] = nullptr;
+      entry->id = 0xffff;
+      entry->local_write = false;
+      entry->value.reset();
+      continue;
+    }
+  }
+}
+
+void Storage::DeleteAllEntriesImpl(bool local) {
+  // only delete non-persistent values
+  DeleteAllEntriesImpl(local,
+                       [](Entry* entry) { return !entry->IsPersistent(); });
+}
+
+void Storage::DeleteAllEntries() {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (m_entries.empty()) return;
+
+  DeleteAllEntriesImpl(true);
+
+  // generate message
+  if (!m_dispatcher) return;
+  auto dispatcher = m_dispatcher;
+  lock.unlock();
+  dispatcher->QueueOutgoing(Message::ClearEntries(), nullptr, nullptr);
+}
+
+Storage::Entry* Storage::GetOrNew(const Twine& name) {
+  llvm::SmallString<128> nameBuf;
+  StringRef nameStr = name.toStringRef(nameBuf);
+  auto& entry = m_entries[nameStr];
+  if (!entry) {
+    m_localmap.emplace_back(new Entry(nameStr));
+    entry = m_localmap.back().get();
+    entry->local_id = m_localmap.size() - 1;
+  }
+  return entry;
+}
+
+unsigned int Storage::GetEntry(const Twine& name) {
+  if (name.isTriviallyEmpty() ||
+      (name.isSingleStringRef() && name.getSingleStringRef().empty()))
+    return UINT_MAX;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  return GetOrNew(name)->local_id;
+}
+
+std::vector<unsigned int> Storage::GetEntries(const Twine& prefix,
+                                              unsigned int types) {
+  llvm::SmallString<128> prefixBuf;
+  StringRef prefixStr = prefix.toStringRef(prefixBuf);
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  std::vector<unsigned int> ids;
+  for (auto& i : m_entries) {
+    Entry* entry = i.getValue();
+    auto value = entry->value.get();
+    if (!value || !i.getKey().startswith(prefixStr)) continue;
+    if (types != 0 && (types & value->type()) == 0) continue;
+    ids.push_back(entry->local_id);
+  }
+  return ids;
+}
+
+EntryInfo Storage::GetEntryInfo(int inst, unsigned int local_id) const {
+  EntryInfo info;
+  info.entry = 0;
+  info.type = NT_UNASSIGNED;
+  info.flags = 0;
+  info.last_change = 0;
+
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return info;
+  Entry* entry = m_localmap[local_id].get();
+  if (!entry->value) return info;
+
+  info.entry = Handle(inst, local_id, Handle::kEntry);
+  info.name = entry->name;
+  info.type = entry->value->type();
+  info.flags = entry->flags;
+  info.last_change = entry->value->last_change();
+  return info;
+}
+
+std::string Storage::GetEntryName(unsigned int local_id) const {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return std::string{};
+  return m_localmap[local_id]->name;
+}
+
+NT_Type Storage::GetEntryType(unsigned int local_id) const {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return NT_UNASSIGNED;
+  Entry* entry = m_localmap[local_id].get();
+  if (!entry->value) return NT_UNASSIGNED;
+  return entry->value->type();
+}
+
+uint64_t Storage::GetEntryLastChange(unsigned int local_id) const {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return 0;
+  Entry* entry = m_localmap[local_id].get();
+  if (!entry->value) return 0;
+  return entry->value->last_change();
+}
+
+std::vector<EntryInfo> Storage::GetEntryInfo(int inst, const Twine& prefix,
+                                             unsigned int types) {
+  llvm::SmallString<128> prefixBuf;
+  StringRef prefixStr = prefix.toStringRef(prefixBuf);
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  std::vector<EntryInfo> infos;
+  for (auto& i : m_entries) {
+    Entry* entry = i.getValue();
+    auto value = entry->value.get();
+    if (!value || !i.getKey().startswith(prefixStr)) continue;
+    if (types != 0 && (types & value->type()) == 0) continue;
+    EntryInfo info;
+    info.entry = Handle(inst, entry->local_id, Handle::kEntry);
+    info.name = i.getKey();
+    info.type = value->type();
+    info.flags = entry->flags;
+    info.last_change = value->last_change();
+    infos.push_back(std::move(info));
+  }
+  return infos;
+}
+
+unsigned int Storage::AddListener(
+    const Twine& prefix,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags) const {
+  llvm::SmallString<128> prefixBuf;
+  StringRef prefixStr = prefix.toStringRef(prefixBuf);
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  unsigned int uid = m_notifier.Add(callback, prefixStr, flags);
+  // perform immediate notifications
+  if ((flags & NT_NOTIFY_IMMEDIATE) != 0 && (flags & NT_NOTIFY_NEW) != 0) {
+    for (auto& i : m_entries) {
+      Entry* entry = i.getValue();
+      if (!entry->value || !i.getKey().startswith(prefixStr)) continue;
+      m_notifier.NotifyEntry(entry->local_id, i.getKey(), entry->value,
+                             NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW, uid);
+    }
+  }
+  return uid;
+}
+
+unsigned int Storage::AddListener(
+    unsigned int local_id,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  unsigned int uid = m_notifier.Add(callback, local_id, flags);
+  // perform immediate notifications
+  if ((flags & NT_NOTIFY_IMMEDIATE) != 0 && (flags & NT_NOTIFY_NEW) != 0 &&
+      local_id < m_localmap.size()) {
+    Entry* entry = m_localmap[local_id].get();
+    if (entry->value) {
+      m_notifier.NotifyEntry(local_id, entry->name, entry->value,
+                             NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW, uid);
+    }
+  }
+  return uid;
+}
+
+unsigned int Storage::AddPolledListener(unsigned int poller,
+                                        const Twine& prefix,
+                                        unsigned int flags) const {
+  llvm::SmallString<128> prefixBuf;
+  StringRef prefixStr = prefix.toStringRef(prefixBuf);
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  unsigned int uid = m_notifier.AddPolled(poller, prefixStr, flags);
+  // perform immediate notifications
+  if ((flags & NT_NOTIFY_IMMEDIATE) != 0 && (flags & NT_NOTIFY_NEW) != 0) {
+    for (auto& i : m_entries) {
+      if (!i.getKey().startswith(prefixStr)) continue;
+      Entry* entry = i.getValue();
+      if (!entry->value) continue;
+      m_notifier.NotifyEntry(entry->local_id, i.getKey(), entry->value,
+                             NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW, uid);
+    }
+  }
+  return uid;
+}
+
+unsigned int Storage::AddPolledListener(unsigned int poller,
+                                        unsigned int local_id,
+                                        unsigned int flags) const {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  unsigned int uid = m_notifier.AddPolled(poller, local_id, flags);
+  // perform immediate notifications
+  if ((flags & NT_NOTIFY_IMMEDIATE) != 0 && (flags & NT_NOTIFY_NEW) != 0 &&
+      local_id < m_localmap.size()) {
+    Entry* entry = m_localmap[local_id].get();
+    // if no value, don't notify
+    if (entry->value) {
+      m_notifier.NotifyEntry(local_id, entry->name, entry->value,
+                             NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW, uid);
+    }
+  }
+  return uid;
+}
+
+bool Storage::GetPersistentEntries(
+    bool periodic,
+    std::vector<std::pair<std::string, std::shared_ptr<Value>>>* entries)
+    const {
+  // copy values out of storage as quickly as possible so lock isn't held
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    // for periodic, don't re-save unless something has changed
+    if (periodic && !m_persistent_dirty) return false;
+    m_persistent_dirty = false;
+    entries->reserve(m_entries.size());
+    for (auto& i : m_entries) {
+      Entry* entry = i.getValue();
+      // only write persistent-flagged values
+      if (!entry->value || !entry->IsPersistent()) continue;
+      entries->emplace_back(i.getKey(), entry->value);
+    }
+  }
+
+  // sort in name order
+  std::sort(entries->begin(), entries->end(),
+            [](const std::pair<std::string, std::shared_ptr<Value>>& a,
+               const std::pair<std::string, std::shared_ptr<Value>>& b) {
+              return a.first < b.first;
+            });
+  return true;
+}
+
+bool Storage::GetEntries(
+    const Twine& prefix,
+    std::vector<std::pair<std::string, std::shared_ptr<Value>>>* entries)
+    const {
+  llvm::SmallString<128> prefixBuf;
+  StringRef prefixStr = prefix.toStringRef(prefixBuf);
+  // copy values out of storage as quickly as possible so lock isn't held
+  {
+    std::lock_guard<wpi::mutex> lock(m_mutex);
+    entries->reserve(m_entries.size());
+    for (auto& i : m_entries) {
+      Entry* entry = i.getValue();
+      // only write values with given prefix
+      if (!entry->value || !i.getKey().startswith(prefixStr)) continue;
+      entries->emplace_back(i.getKey(), entry->value);
+    }
+  }
+
+  // sort in name order
+  std::sort(entries->begin(), entries->end(),
+            [](const std::pair<std::string, std::shared_ptr<Value>>& a,
+               const std::pair<std::string, std::shared_ptr<Value>>& b) {
+              return a.first < b.first;
+            });
+  return true;
+}
+
+void Storage::CreateRpc(unsigned int local_id, StringRef def,
+                        unsigned int rpc_uid) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return;
+  Entry* entry = m_localmap[local_id].get();
+
+  auto old_value = entry->value;
+  auto value = Value::MakeRpc(def);
+  entry->value = value;
+
+  // set up the RPC info
+  entry->rpc_uid = rpc_uid;
+
+  if (old_value && *old_value == *value) return;
+
+  // assign an id if it doesn't have one
+  if (entry->id == 0xffff) {
+    unsigned int id = m_idmap.size();
+    entry->id = id;
+    m_idmap.push_back(entry);
+  }
+
+  // generate message
+  if (!m_dispatcher) return;
+  auto dispatcher = m_dispatcher;
+  if (!old_value || old_value->type() != value->type()) {
+    ++entry->seq_num;
+    auto msg = Message::EntryAssign(
+        entry->name, entry->id, entry->seq_num.value(), value, entry->flags);
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, nullptr);
+  } else {
+    ++entry->seq_num;
+    auto msg = Message::EntryUpdate(entry->id, entry->seq_num.value(), value);
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, nullptr);
+  }
+}
+
+unsigned int Storage::CallRpc(unsigned int local_id, StringRef params) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  if (local_id >= m_localmap.size()) return 0;
+  Entry* entry = m_localmap[local_id].get();
+
+  if (!entry->value || !entry->value->IsRpc()) return 0;
+
+  ++entry->rpc_call_uid;
+  if (entry->rpc_call_uid > 0xffff) entry->rpc_call_uid = 0;
+  unsigned int call_uid = entry->rpc_call_uid;
+
+  auto msg = Message::ExecuteRpc(entry->id, call_uid, params);
+  StringRef name{entry->name};
+
+  if (m_server) {
+    // RPCs are unlikely to be used locally on the server, but handle it
+    // gracefully anyway.
+    auto rpc_uid = entry->rpc_uid;
+    lock.unlock();
+    ConnectionInfo conn_info;
+    conn_info.remote_id = "Server";
+    conn_info.remote_ip = "localhost";
+    conn_info.remote_port = 0;
+    conn_info.last_update = wpi::Now();
+    conn_info.protocol_version = 0x0300;
+    unsigned int call_uid = msg->seq_num_uid();
+    m_rpc_server.ProcessRpc(local_id, call_uid, name, msg->str(), conn_info,
+                            [=](StringRef result) {
+                              std::lock_guard<wpi::mutex> lock(m_mutex);
+                              m_rpc_results.insert(std::make_pair(
+                                  RpcIdPair{local_id, call_uid}, result));
+                              m_rpc_results_cond.notify_all();
+                            },
+                            rpc_uid);
+  } else {
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    dispatcher->QueueOutgoing(msg, nullptr, nullptr);
+  }
+  return call_uid;
+}
+
+bool Storage::GetRpcResult(unsigned int local_id, unsigned int call_uid,
+                           std::string* result) {
+  bool timed_out = false;
+  return GetRpcResult(local_id, call_uid, result, -1, &timed_out);
+}
+
+bool Storage::GetRpcResult(unsigned int local_id, unsigned int call_uid,
+                           std::string* result, double timeout,
+                           bool* timed_out) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+
+  RpcIdPair call_pair{local_id, call_uid};
+
+  // only allow one blocking call per rpc call uid
+  if (!m_rpc_blocking_calls.insert(call_pair).second) return false;
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+  auto timeout_time = std::chrono::steady_clock::now() +
+                      std::chrono::duration<int64_t, std::nano>(
+                          static_cast<int64_t>(timeout * 1e9));
+#else
+  auto timeout_time =
+      std::chrono::steady_clock::now() + std::chrono::duration<double>(timeout);
+#endif
+  *timed_out = false;
+  for (;;) {
+    auto i = m_rpc_results.find(call_pair);
+    if (i == m_rpc_results.end()) {
+      if (timeout == 0 || m_terminating) {
+        m_rpc_blocking_calls.erase(call_pair);
+        return false;
+      }
+      if (timeout < 0) {
+        m_rpc_results_cond.wait(lock);
+      } else {
+        auto cond_timed_out = m_rpc_results_cond.wait_until(lock, timeout_time);
+        if (cond_timed_out == std::cv_status::timeout) {
+          m_rpc_blocking_calls.erase(call_pair);
+          *timed_out = true;
+          return false;
+        }
+      }
+      // if element does not exist, we have been canceled
+      if (m_rpc_blocking_calls.count(call_pair) == 0) {
+        return false;
+      }
+      if (m_terminating) {
+        m_rpc_blocking_calls.erase(call_pair);
+        return false;
+      }
+      continue;
+    }
+    result->swap(i->getSecond());
+    // safe to erase even if id does not exist
+    m_rpc_blocking_calls.erase(call_pair);
+    m_rpc_results.erase(i);
+    return true;
+  }
+}
+
+void Storage::CancelRpcResult(unsigned int local_id, unsigned int call_uid) {
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  // safe to erase even if id does not exist
+  m_rpc_blocking_calls.erase(RpcIdPair{local_id, call_uid});
+  m_rpc_results_cond.notify_all();
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Storage.h b/third_party/ntcore_2018/src/main/native/cpp/Storage.h
new file mode 100644
index 0000000..333f218
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Storage.h
@@ -0,0 +1,265 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_STORAGE_H_
+#define NTCORE_STORAGE_H_
+
+#include <stdint.h>
+
+#include <atomic>
+#include <cstddef>
+#include <functional>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <llvm/DenseMap.h>
+#include <llvm/SmallSet.h>
+#include <llvm/StringMap.h>
+#include <support/condition_variable.h>
+#include <support/mutex.h>
+
+#include "IStorage.h"
+#include "Message.h"
+#include "SequenceNumber.h"
+#include "ntcore_cpp.h"
+
+namespace llvm {
+class raw_ostream;
+}  // namespace llvm
+
+namespace wpi {
+class Logger;
+class raw_istream;
+}  // namespace wpi
+
+namespace nt {
+
+class IEntryNotifier;
+class INetworkConnection;
+class IRpcServer;
+class IStorageTest;
+
+class Storage : public IStorage {
+  friend class StorageTest;
+
+ public:
+  Storage(IEntryNotifier& notifier, IRpcServer& rpcserver, wpi::Logger& logger);
+  Storage(const Storage&) = delete;
+  Storage& operator=(const Storage&) = delete;
+
+  ~Storage();
+
+  // Accessors required by Dispatcher.  An interface is used for
+  // generation of outgoing messages to break a dependency loop between
+  // Storage and Dispatcher.
+  void SetDispatcher(IDispatcher* dispatcher, bool server) override;
+  void ClearDispatcher() override;
+
+  // Required for wire protocol 2.0 to get the entry type of an entry when
+  // receiving entry updates (because the length/type is not provided in the
+  // message itself).  Not used in wire protocol 3.0.
+  NT_Type GetMessageEntryType(unsigned int id) const override;
+
+  void ProcessIncoming(std::shared_ptr<Message> msg, INetworkConnection* conn,
+                       std::weak_ptr<INetworkConnection> conn_weak) override;
+  void GetInitialAssignments(
+      INetworkConnection& conn,
+      std::vector<std::shared_ptr<Message>>* msgs) override;
+  void ApplyInitialAssignments(
+      INetworkConnection& conn, llvm::ArrayRef<std::shared_ptr<Message>> msgs,
+      bool new_server,
+      std::vector<std::shared_ptr<Message>>* out_msgs) override;
+
+  // User functions.  These are the actual implementations of the corresponding
+  // user API functions in ntcore_cpp.
+  std::shared_ptr<Value> GetEntryValue(StringRef name) const;
+  std::shared_ptr<Value> GetEntryValue(unsigned int local_id) const;
+
+  bool SetDefaultEntryValue(StringRef name, std::shared_ptr<Value> value);
+  bool SetDefaultEntryValue(unsigned int local_id,
+                            std::shared_ptr<Value> value);
+
+  bool SetEntryValue(StringRef name, std::shared_ptr<Value> value);
+  bool SetEntryValue(unsigned int local_id, std::shared_ptr<Value> value);
+
+  void SetEntryTypeValue(StringRef name, std::shared_ptr<Value> value);
+  void SetEntryTypeValue(unsigned int local_id, std::shared_ptr<Value> value);
+
+  void SetEntryFlags(StringRef name, unsigned int flags);
+  void SetEntryFlags(unsigned int local_id, unsigned int flags);
+
+  unsigned int GetEntryFlags(StringRef name) const;
+  unsigned int GetEntryFlags(unsigned int local_id) const;
+
+  void DeleteEntry(StringRef name);
+  void DeleteEntry(unsigned int local_id);
+
+  void DeleteAllEntries();
+
+  std::vector<EntryInfo> GetEntryInfo(int inst, const Twine& prefix,
+                                      unsigned int types);
+
+  unsigned int AddListener(
+      const Twine& prefix,
+      std::function<void(const EntryNotification& event)> callback,
+      unsigned int flags) const;
+  unsigned int AddListener(
+      unsigned int local_id,
+      std::function<void(const EntryNotification& event)> callback,
+      unsigned int flags) const;
+
+  unsigned int AddPolledListener(unsigned int poller_uid, const Twine& prefix,
+                                 unsigned int flags) const;
+  unsigned int AddPolledListener(unsigned int poller_uid, unsigned int local_id,
+                                 unsigned int flags) const;
+
+  // Index-only
+  unsigned int GetEntry(const Twine& name);
+  std::vector<unsigned int> GetEntries(const Twine& prefix, unsigned int types);
+  EntryInfo GetEntryInfo(int inst, unsigned int local_id) const;
+  std::string GetEntryName(unsigned int local_id) const;
+  NT_Type GetEntryType(unsigned int local_id) const;
+  uint64_t GetEntryLastChange(unsigned int local_id) const;
+
+  // Filename-based save/load functions.  Used both by periodic saves and
+  // accessible directly via the user API.
+  const char* SavePersistent(const Twine& filename,
+                             bool periodic) const override;
+  const char* LoadPersistent(
+      const Twine& filename,
+      std::function<void(size_t line, const char* msg)> warn) override;
+
+  const char* SaveEntries(const Twine& filename, const Twine& prefix) const;
+  const char* LoadEntries(
+      const Twine& filename, const Twine& prefix,
+      std::function<void(size_t line, const char* msg)> warn);
+
+  // Stream-based save/load functions (exposed for testing purposes).  These
+  // implement the guts of the filename-based functions.
+  void SavePersistent(llvm::raw_ostream& os, bool periodic) const;
+  bool LoadEntries(wpi::raw_istream& is, const Twine& prefix, bool persistent,
+                   std::function<void(size_t line, const char* msg)> warn);
+
+  void SaveEntries(llvm::raw_ostream& os, const Twine& prefix) const;
+
+  // RPC configuration needs to come through here as RPC definitions are
+  // actually special Storage value types.
+  void CreateRpc(unsigned int local_id, StringRef def, unsigned int rpc_uid);
+  unsigned int CallRpc(unsigned int local_id, StringRef params);
+  bool GetRpcResult(unsigned int local_id, unsigned int call_uid,
+                    std::string* result);
+  bool GetRpcResult(unsigned int local_id, unsigned int call_uid,
+                    std::string* result, double timeout, bool* timed_out);
+  void CancelRpcResult(unsigned int local_id, unsigned int call_uid);
+
+ private:
+  // Data for each table entry.
+  struct Entry {
+    explicit Entry(llvm::StringRef name_) : name(name_) {}
+    bool IsPersistent() const { return (flags & NT_PERSISTENT) != 0; }
+
+    // We redundantly store the name so that it's available when accessing the
+    // raw Entry* via the ID map.
+    std::string name;
+
+    // The current value and flags.
+    std::shared_ptr<Value> value;
+    unsigned int flags{0};
+
+    // Unique ID for this entry as used in network messages.  The value is
+    // assigned by the server, so on the client this is 0xffff until an
+    // entry assignment is received back from the server.
+    unsigned int id{0xffff};
+
+    // Local ID.
+    unsigned int local_id{UINT_MAX};
+
+    // Sequence number for update resolution.
+    SequenceNumber seq_num;
+
+    // If value has been written locally.  Used during initial handshake
+    // on client to determine whether or not to accept remote changes.
+    bool local_write{false};
+
+    // RPC handle.
+    unsigned int rpc_uid{UINT_MAX};
+
+    // Last UID used when calling this RPC (primarily for client use).  This
+    // is incremented for each call.
+    unsigned int rpc_call_uid{0};
+  };
+
+  typedef llvm::StringMap<Entry*> EntriesMap;
+  typedef std::vector<Entry*> IdMap;
+  typedef std::vector<std::unique_ptr<Entry>> LocalMap;
+  typedef std::pair<unsigned int, unsigned int> RpcIdPair;
+  typedef llvm::DenseMap<RpcIdPair, std::string> RpcResultMap;
+  typedef llvm::SmallSet<RpcIdPair, 12> RpcBlockingCallSet;
+
+  mutable wpi::mutex m_mutex;
+  EntriesMap m_entries;
+  IdMap m_idmap;
+  LocalMap m_localmap;
+  RpcResultMap m_rpc_results;
+  RpcBlockingCallSet m_rpc_blocking_calls;
+  // If any persistent values have changed
+  mutable bool m_persistent_dirty = false;
+
+  // condition variable and termination flag for blocking on a RPC result
+  std::atomic_bool m_terminating;
+  wpi::condition_variable m_rpc_results_cond;
+
+  // configured by dispatcher at startup
+  IDispatcher* m_dispatcher = nullptr;
+  bool m_server = true;
+
+  IEntryNotifier& m_notifier;
+  IRpcServer& m_rpc_server;
+  wpi::Logger& m_logger;
+
+  void ProcessIncomingEntryAssign(std::shared_ptr<Message> msg,
+                                  INetworkConnection* conn);
+  void ProcessIncomingEntryUpdate(std::shared_ptr<Message> msg,
+                                  INetworkConnection* conn);
+  void ProcessIncomingFlagsUpdate(std::shared_ptr<Message> msg,
+                                  INetworkConnection* conn);
+  void ProcessIncomingEntryDelete(std::shared_ptr<Message> msg,
+                                  INetworkConnection* conn);
+  void ProcessIncomingClearEntries(std::shared_ptr<Message> msg,
+                                   INetworkConnection* conn);
+  void ProcessIncomingExecuteRpc(std::shared_ptr<Message> msg,
+                                 INetworkConnection* conn,
+                                 std::weak_ptr<INetworkConnection> conn_weak);
+  void ProcessIncomingRpcResponse(std::shared_ptr<Message> msg,
+                                  INetworkConnection* conn);
+
+  bool GetPersistentEntries(
+      bool periodic,
+      std::vector<std::pair<std::string, std::shared_ptr<Value>>>* entries)
+      const;
+  bool GetEntries(const Twine& prefix,
+                  std::vector<std::pair<std::string, std::shared_ptr<Value>>>*
+                      entries) const;
+  void SetEntryValueImpl(Entry* entry, std::shared_ptr<Value> value,
+                         std::unique_lock<wpi::mutex>& lock, bool local);
+  void SetEntryFlagsImpl(Entry* entry, unsigned int flags,
+                         std::unique_lock<wpi::mutex>& lock, bool local);
+  void DeleteEntryImpl(Entry* entry, std::unique_lock<wpi::mutex>& lock,
+                       bool local);
+
+  // Must be called with m_mutex held
+  template <typename F>
+  void DeleteAllEntriesImpl(bool local, F should_delete);
+  void DeleteAllEntriesImpl(bool local);
+  Entry* GetOrNew(const Twine& name);
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_STORAGE_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Storage_load.cpp b/third_party/ntcore_2018/src/main/native/cpp/Storage_load.cpp
new file mode 100644
index 0000000..4c8641c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Storage_load.cpp
@@ -0,0 +1,453 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cctype>
+#include <string>
+
+#include <llvm/SmallString.h>
+#include <llvm/StringExtras.h>
+#include <support/Base64.h>
+#include <support/raw_istream.h>
+
+#include "IDispatcher.h"
+#include "IEntryNotifier.h"
+#include "Storage.h"
+
+using namespace nt;
+
+namespace {
+
+class LoadPersistentImpl {
+ public:
+  typedef std::pair<std::string, std::shared_ptr<Value>> Entry;
+  typedef std::function<void(size_t line, const char* msg)> WarnFunc;
+
+  LoadPersistentImpl(wpi::raw_istream& is, WarnFunc warn)
+      : m_is(is), m_warn(warn) {}
+
+  bool Load(StringRef prefix, std::vector<Entry>* entries);
+
+ private:
+  bool ReadLine();
+  bool ReadHeader();
+  NT_Type ReadType();
+  llvm::StringRef ReadName(llvm::SmallVectorImpl<char>& buf);
+  std::shared_ptr<Value> ReadValue(NT_Type type);
+  std::shared_ptr<Value> ReadBooleanValue();
+  std::shared_ptr<Value> ReadDoubleValue();
+  std::shared_ptr<Value> ReadStringValue();
+  std::shared_ptr<Value> ReadRawValue();
+  std::shared_ptr<Value> ReadBooleanArrayValue();
+  std::shared_ptr<Value> ReadDoubleArrayValue();
+  std::shared_ptr<Value> ReadStringArrayValue();
+
+  void Warn(const char* msg) {
+    if (m_warn) m_warn(m_line_num, msg);
+  }
+
+  wpi::raw_istream& m_is;
+  WarnFunc m_warn;
+
+  llvm::StringRef m_line;
+  llvm::SmallString<128> m_line_buf;
+  size_t m_line_num = 0;
+
+  std::vector<int> m_buf_boolean_array;
+  std::vector<double> m_buf_double_array;
+  std::vector<std::string> m_buf_string_array;
+};
+
+}  // namespace
+
+/* Extracts an escaped string token.  Does not unescape the string.
+ * If a string cannot be matched, an empty string is returned.
+ * If the string is unterminated, an empty tail string is returned.
+ * The returned token includes the starting and trailing quotes (unless the
+ * string is unterminated).
+ * Returns a pair containing the extracted token (if any) and the remaining
+ * tail string.
+ */
+static std::pair<llvm::StringRef, llvm::StringRef> ReadStringToken(
+    llvm::StringRef source) {
+  // Match opening quote
+  if (source.empty() || source.front() != '"')
+    return std::make_pair(llvm::StringRef(), source);
+
+  // Scan for ending double quote, checking for escaped as we go.
+  size_t size = source.size();
+  size_t pos;
+  for (pos = 1; pos < size; ++pos) {
+    if (source[pos] == '"' && source[pos - 1] != '\\') {
+      ++pos;  // we want to include the trailing quote in the result
+      break;
+    }
+  }
+  return std::make_pair(source.slice(0, pos), source.substr(pos));
+}
+
+static int fromxdigit(char ch) {
+  if (ch >= 'a' && ch <= 'f')
+    return (ch - 'a' + 10);
+  else if (ch >= 'A' && ch <= 'F')
+    return (ch - 'A' + 10);
+  else
+    return ch - '0';
+}
+
+static llvm::StringRef UnescapeString(llvm::StringRef source,
+                                      llvm::SmallVectorImpl<char>& buf) {
+  assert(source.size() >= 2 && source.front() == '"' && source.back() == '"');
+  buf.clear();
+  buf.reserve(source.size() - 2);
+  for (auto s = source.begin() + 1, end = source.end() - 1; s != end; ++s) {
+    if (*s != '\\') {
+      buf.push_back(*s);
+      continue;
+    }
+    switch (*++s) {
+      case '\\':
+      case '"':
+        buf.push_back(s[-1]);
+        break;
+      case 't':
+        buf.push_back('\t');
+        break;
+      case 'n':
+        buf.push_back('\n');
+        break;
+      case 'x': {
+        if (!isxdigit(*(s + 1))) {
+          buf.push_back('x');  // treat it like a unknown escape
+          break;
+        }
+        int ch = fromxdigit(*++s);
+        if (std::isxdigit(*(s + 1))) {
+          ch <<= 4;
+          ch |= fromxdigit(*++s);
+        }
+        buf.push_back(static_cast<char>(ch));
+        break;
+      }
+      default:
+        buf.push_back(s[-1]);
+        break;
+    }
+  }
+  return llvm::StringRef{buf.data(), buf.size()};
+}
+
+bool LoadPersistentImpl::Load(StringRef prefix, std::vector<Entry>* entries) {
+  if (!ReadHeader()) return false;  // header
+
+  while (ReadLine()) {
+    // type
+    NT_Type type = ReadType();
+    if (type == NT_UNASSIGNED) {
+      Warn("unrecognized type");
+      continue;
+    }
+
+    // name
+    llvm::SmallString<128> buf;
+    llvm::StringRef name = ReadName(buf);
+    if (name.empty() || !name.startswith(prefix)) continue;
+
+    // =
+    m_line = m_line.ltrim(" \t");
+    if (m_line.empty() || m_line.front() != '=') {
+      Warn("expected = after name");
+      continue;
+    }
+    m_line = m_line.drop_front().ltrim(" \t");
+
+    // value
+    auto value = ReadValue(type);
+
+    // move to entries
+    if (value) entries->emplace_back(name, std::move(value));
+  }
+  return true;
+}
+
+bool LoadPersistentImpl::ReadLine() {
+  // ignore blank lines and lines that start with ; or # (comments)
+  while (!m_is.has_error()) {
+    ++m_line_num;
+    m_line = m_is.getline(m_line_buf, INT_MAX).trim();
+    if (!m_line.empty() && m_line.front() != ';' && m_line.front() != '#')
+      return true;
+  }
+  return false;
+}
+
+bool LoadPersistentImpl::ReadHeader() {
+  // header
+  if (!ReadLine() || m_line != "[NetworkTables Storage 3.0]") {
+    Warn("header line mismatch, ignoring rest of file");
+    return false;
+  }
+  return true;
+}
+
+NT_Type LoadPersistentImpl::ReadType() {
+  llvm::StringRef tok;
+  std::tie(tok, m_line) = m_line.split(' ');
+  if (tok == "boolean") {
+    return NT_BOOLEAN;
+  } else if (tok == "double") {
+    return NT_DOUBLE;
+  } else if (tok == "string") {
+    return NT_STRING;
+  } else if (tok == "raw") {
+    return NT_RAW;
+  } else if (tok == "array") {
+    llvm::StringRef array_tok;
+    std::tie(array_tok, m_line) = m_line.split(' ');
+    if (array_tok == "boolean")
+      return NT_BOOLEAN_ARRAY;
+    else if (array_tok == "double")
+      return NT_DOUBLE_ARRAY;
+    else if (array_tok == "string")
+      return NT_STRING_ARRAY;
+  }
+  return NT_UNASSIGNED;
+}
+
+llvm::StringRef LoadPersistentImpl::ReadName(llvm::SmallVectorImpl<char>& buf) {
+  llvm::StringRef tok;
+  std::tie(tok, m_line) = ReadStringToken(m_line);
+  if (tok.empty()) {
+    Warn("missing name");
+    return llvm::StringRef{};
+  }
+  if (tok.back() != '"') {
+    Warn("unterminated name string");
+    return llvm::StringRef{};
+  }
+  return UnescapeString(tok, buf);
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadValue(NT_Type type) {
+  switch (type) {
+    case NT_BOOLEAN:
+      return ReadBooleanValue();
+    case NT_DOUBLE:
+      return ReadDoubleValue();
+    case NT_STRING:
+      return ReadStringValue();
+    case NT_RAW:
+      return ReadRawValue();
+    case NT_BOOLEAN_ARRAY:
+      return ReadBooleanArrayValue();
+    case NT_DOUBLE_ARRAY:
+      return ReadDoubleArrayValue();
+    case NT_STRING_ARRAY:
+      return ReadStringArrayValue();
+    default:
+      return nullptr;
+  }
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadBooleanValue() {
+  // only true or false is accepted
+  if (m_line == "true") return Value::MakeBoolean(true);
+  if (m_line == "false") return Value::MakeBoolean(false);
+  Warn("unrecognized boolean value, not 'true' or 'false'");
+  return nullptr;
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadDoubleValue() {
+  // need to convert to null-terminated string for std::strtod()
+  llvm::SmallString<64> buf;
+  char* end;
+  double v = std::strtod(m_line.c_str(buf), &end);
+  if (*end != '\0') {
+    Warn("invalid double value");
+    return nullptr;
+  }
+  return Value::MakeDouble(v);
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadStringValue() {
+  llvm::StringRef tok;
+  std::tie(tok, m_line) = ReadStringToken(m_line);
+  if (tok.empty()) {
+    Warn("missing string value");
+    return nullptr;
+  }
+  if (tok.back() != '"') {
+    Warn("unterminated string value");
+    return nullptr;
+  }
+  llvm::SmallString<128> buf;
+  return Value::MakeString(UnescapeString(tok, buf));
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadRawValue() {
+  llvm::SmallString<128> buf;
+  size_t nr;
+  return Value::MakeRaw(wpi::Base64Decode(m_line, &nr, buf));
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadBooleanArrayValue() {
+  m_buf_boolean_array.clear();
+  while (!m_line.empty()) {
+    llvm::StringRef tok;
+    std::tie(tok, m_line) = m_line.split(',');
+    tok = tok.trim(" \t");
+    if (tok == "true") {
+      m_buf_boolean_array.push_back(1);
+    } else if (tok == "false") {
+      m_buf_boolean_array.push_back(0);
+    } else {
+      Warn("unrecognized boolean value, not 'true' or 'false'");
+      return nullptr;
+    }
+  }
+  return Value::MakeBooleanArray(std::move(m_buf_boolean_array));
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadDoubleArrayValue() {
+  m_buf_double_array.clear();
+  while (!m_line.empty()) {
+    llvm::StringRef tok;
+    std::tie(tok, m_line) = m_line.split(',');
+    tok = tok.trim(" \t");
+    // need to convert to null-terminated string for std::strtod()
+    llvm::SmallString<64> buf;
+    char* end;
+    double v = std::strtod(tok.c_str(buf), &end);
+    if (*end != '\0') {
+      Warn("invalid double value");
+      return nullptr;
+    }
+    m_buf_double_array.push_back(v);
+  }
+
+  return Value::MakeDoubleArray(std::move(m_buf_double_array));
+}
+
+std::shared_ptr<Value> LoadPersistentImpl::ReadStringArrayValue() {
+  m_buf_string_array.clear();
+  while (!m_line.empty()) {
+    llvm::StringRef tok;
+    std::tie(tok, m_line) = ReadStringToken(m_line);
+    if (tok.empty()) {
+      Warn("missing string value");
+      return nullptr;
+    }
+    if (tok.back() != '"') {
+      Warn("unterminated string value");
+      return nullptr;
+    }
+
+    llvm::SmallString<128> buf;
+    m_buf_string_array.push_back(UnescapeString(tok, buf));
+
+    m_line = m_line.ltrim(" \t");
+    if (m_line.empty()) break;
+    if (m_line.front() != ',') {
+      Warn("expected comma between strings");
+      return nullptr;
+    }
+    m_line = m_line.drop_front().ltrim(" \t");
+  }
+
+  return Value::MakeStringArray(std::move(m_buf_string_array));
+}
+
+bool Storage::LoadEntries(
+    wpi::raw_istream& is, const Twine& prefix, bool persistent,
+    std::function<void(size_t line, const char* msg)> warn) {
+  llvm::SmallString<128> prefixBuf;
+  StringRef prefixStr = prefix.toStringRef(prefixBuf);
+
+  // entries to add
+  std::vector<LoadPersistentImpl::Entry> entries;
+
+  // load file
+  if (!LoadPersistentImpl(is, warn).Load(prefixStr, &entries)) return false;
+
+  // copy values into storage as quickly as possible so lock isn't held
+  std::vector<std::shared_ptr<Message>> msgs;
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  for (auto& i : entries) {
+    Entry* entry = GetOrNew(i.first);
+    auto old_value = entry->value;
+    entry->value = i.second;
+    bool was_persist = entry->IsPersistent();
+    if (!was_persist && persistent) entry->flags |= NT_PERSISTENT;
+
+    // if we're the server, assign an id if it doesn't have one
+    if (m_server && entry->id == 0xffff) {
+      unsigned int id = m_idmap.size();
+      entry->id = id;
+      m_idmap.push_back(entry);
+    }
+
+    // notify (for local listeners)
+    if (m_notifier.local_notifiers()) {
+      if (!old_value) {
+        m_notifier.NotifyEntry(entry->local_id, i.first, i.second,
+                               NT_NOTIFY_NEW | NT_NOTIFY_LOCAL);
+      } else if (*old_value != *i.second) {
+        unsigned int notify_flags = NT_NOTIFY_UPDATE | NT_NOTIFY_LOCAL;
+        if (!was_persist && persistent) notify_flags |= NT_NOTIFY_FLAGS;
+        m_notifier.NotifyEntry(entry->local_id, i.first, i.second,
+                               notify_flags);
+      } else if (!was_persist && persistent) {
+        m_notifier.NotifyEntry(entry->local_id, i.first, i.second,
+                               NT_NOTIFY_FLAGS | NT_NOTIFY_LOCAL);
+      }
+    }
+
+    if (!m_dispatcher) continue;  // shortcut
+    ++entry->seq_num;
+
+    // put on update queue
+    if (!old_value || old_value->type() != i.second->type()) {
+      msgs.emplace_back(Message::EntryAssign(
+          i.first, entry->id, entry->seq_num.value(), i.second, entry->flags));
+    } else if (entry->id != 0xffff) {
+      // don't send an update if we don't have an assigned id yet
+      if (*old_value != *i.second)
+        msgs.emplace_back(
+            Message::EntryUpdate(entry->id, entry->seq_num.value(), i.second));
+      if (!was_persist)
+        msgs.emplace_back(Message::FlagsUpdate(entry->id, entry->flags));
+    }
+  }
+
+  if (m_dispatcher) {
+    auto dispatcher = m_dispatcher;
+    lock.unlock();
+    for (auto& msg : msgs)
+      dispatcher->QueueOutgoing(std::move(msg), nullptr, nullptr);
+  }
+
+  return true;
+}
+
+const char* Storage::LoadPersistent(
+    const Twine& filename,
+    std::function<void(size_t line, const char* msg)> warn) {
+  std::error_code ec;
+  wpi::raw_fd_istream is(filename, ec);
+  if (ec.value() != 0) return "could not open file";
+  if (!LoadEntries(is, "", true, warn)) return "error reading file";
+  return nullptr;
+}
+
+const char* Storage::LoadEntries(
+    const Twine& filename, const Twine& prefix,
+    std::function<void(size_t line, const char* msg)> warn) {
+  std::error_code ec;
+  wpi::raw_fd_istream is(filename, ec);
+  if (ec.value() != 0) return "could not open file";
+  if (!LoadEntries(is, prefix, false, warn)) return "error reading file";
+  return nullptr;
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Storage_save.cpp b/third_party/ntcore_2018/src/main/native/cpp/Storage_save.cpp
new file mode 100644
index 0000000..efe918f
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Storage_save.cpp
@@ -0,0 +1,271 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cctype>
+#include <string>
+
+#include <llvm/Format.h>
+#include <llvm/SmallString.h>
+#include <llvm/StringExtras.h>
+#include <llvm/raw_ostream.h>
+#include <support/Base64.h>
+
+#include "Log.h"
+#include "Storage.h"
+
+using namespace nt;
+
+namespace {
+
+class SavePersistentImpl {
+ public:
+  typedef std::pair<std::string, std::shared_ptr<Value>> Entry;
+
+  explicit SavePersistentImpl(llvm::raw_ostream& os) : m_os(os) {}
+
+  void Save(llvm::ArrayRef<Entry> entries);
+
+ private:
+  void WriteString(llvm::StringRef str);
+  void WriteHeader();
+  void WriteEntries(llvm::ArrayRef<Entry> entries);
+  void WriteEntry(llvm::StringRef name, const Value& value);
+  bool WriteType(NT_Type type);
+  void WriteValue(const Value& value);
+
+  llvm::raw_ostream& m_os;
+};
+
+}  // namespace
+
+/* Escapes and writes a string, including start and end double quotes */
+void SavePersistentImpl::WriteString(llvm::StringRef str) {
+  m_os << '"';
+  for (auto c : str) {
+    switch (c) {
+      case '\\':
+        m_os << "\\\\";
+        break;
+      case '\t':
+        m_os << "\\t";
+        break;
+      case '\n':
+        m_os << "\\n";
+        break;
+      case '"':
+        m_os << "\\\"";
+        break;
+      default:
+        if (std::isprint(c) && c != '=') {
+          m_os << c;
+          break;
+        }
+
+        // Write out the escaped representation.
+        m_os << "\\x";
+        m_os << llvm::hexdigit((c >> 4) & 0xF);
+        m_os << llvm::hexdigit((c >> 0) & 0xF);
+    }
+  }
+  m_os << '"';
+}
+
+void SavePersistentImpl::Save(llvm::ArrayRef<Entry> entries) {
+  WriteHeader();
+  WriteEntries(entries);
+}
+
+void SavePersistentImpl::WriteHeader() {
+  m_os << "[NetworkTables Storage 3.0]\n";
+}
+
+void SavePersistentImpl::WriteEntries(llvm::ArrayRef<Entry> entries) {
+  for (auto& i : entries) {
+    if (!i.second) continue;
+    WriteEntry(i.first, *i.second);
+  }
+}
+
+void SavePersistentImpl::WriteEntry(llvm::StringRef name, const Value& value) {
+  if (!WriteType(value.type())) return;  // type
+  WriteString(name);                     // name
+  m_os << '=';                           // '='
+  WriteValue(value);                     // value
+  m_os << '\n';                          // eol
+}
+
+bool SavePersistentImpl::WriteType(NT_Type type) {
+  switch (type) {
+    case NT_BOOLEAN:
+      m_os << "boolean ";
+      break;
+    case NT_DOUBLE:
+      m_os << "double ";
+      break;
+    case NT_STRING:
+      m_os << "string ";
+      break;
+    case NT_RAW:
+      m_os << "raw ";
+      break;
+    case NT_BOOLEAN_ARRAY:
+      m_os << "array boolean ";
+      break;
+    case NT_DOUBLE_ARRAY:
+      m_os << "array double ";
+      break;
+    case NT_STRING_ARRAY:
+      m_os << "array string ";
+      break;
+    default:
+      return false;
+  }
+  return true;
+}
+
+void SavePersistentImpl::WriteValue(const Value& value) {
+  switch (value.type()) {
+    case NT_BOOLEAN:
+      m_os << (value.GetBoolean() ? "true" : "false");
+      break;
+    case NT_DOUBLE:
+      m_os << llvm::format("%g", value.GetDouble());
+      break;
+    case NT_STRING:
+      WriteString(value.GetString());
+      break;
+    case NT_RAW: {
+      wpi::Base64Encode(m_os, value.GetRaw());
+      break;
+    }
+    case NT_BOOLEAN_ARRAY: {
+      bool first = true;
+      for (auto elem : value.GetBooleanArray()) {
+        if (!first) m_os << ',';
+        first = false;
+        m_os << (elem ? "true" : "false");
+      }
+      break;
+    }
+    case NT_DOUBLE_ARRAY: {
+      bool first = true;
+      for (auto elem : value.GetDoubleArray()) {
+        if (!first) m_os << ',';
+        first = false;
+        m_os << llvm::format("%g", elem);
+      }
+      break;
+    }
+    case NT_STRING_ARRAY: {
+      bool first = true;
+      for (auto& elem : value.GetStringArray()) {
+        if (!first) m_os << ',';
+        first = false;
+        WriteString(elem);
+      }
+      break;
+    }
+    default:
+      break;
+  }
+}
+
+void Storage::SavePersistent(llvm::raw_ostream& os, bool periodic) const {
+  std::vector<SavePersistentImpl::Entry> entries;
+  if (!GetPersistentEntries(periodic, &entries)) return;
+  SavePersistentImpl(os).Save(entries);
+}
+
+const char* Storage::SavePersistent(const Twine& filename,
+                                    bool periodic) const {
+  llvm::SmallString<128> fn;
+  filename.toVector(fn);
+  llvm::SmallString<128> tmp = fn;
+  tmp += ".tmp";
+  llvm::SmallString<128> bak = fn;
+  bak += ".bak";
+
+  // Get entries before creating file
+  std::vector<SavePersistentImpl::Entry> entries;
+  if (!GetPersistentEntries(periodic, &entries)) return nullptr;
+
+  const char* err = nullptr;
+
+  // start by writing to temporary file
+  std::error_code ec;
+  llvm::raw_fd_ostream os(tmp, ec, llvm::sys::fs::F_Text);
+  if (ec.value() != 0) {
+    err = "could not open file";
+    goto done;
+  }
+  DEBUG("saving persistent file '" << filename << "'");
+  SavePersistentImpl(os).Save(entries);
+  os.close();
+  if (os.has_error()) {
+    std::remove(tmp.c_str());
+    err = "error saving file";
+    goto done;
+  }
+
+  // Safely move to real file.  We ignore any failures related to the backup.
+  std::remove(bak.c_str());
+  std::rename(fn.c_str(), bak.c_str());
+  if (std::rename(tmp.c_str(), fn.c_str()) != 0) {
+    std::rename(bak.c_str(), fn.c_str());  // attempt to restore backup
+    err = "could not rename temp file to real file";
+    goto done;
+  }
+
+done:
+  // try again if there was an error
+  if (err && periodic) m_persistent_dirty = true;
+  return err;
+}
+
+void Storage::SaveEntries(llvm::raw_ostream& os, const Twine& prefix) const {
+  std::vector<SavePersistentImpl::Entry> entries;
+  if (!GetEntries(prefix, &entries)) return;
+  SavePersistentImpl(os).Save(entries);
+}
+
+const char* Storage::SaveEntries(const Twine& filename,
+                                 const Twine& prefix) const {
+  llvm::SmallString<128> fn;
+  filename.toVector(fn);
+  llvm::SmallString<128> tmp = fn;
+  tmp += ".tmp";
+  llvm::SmallString<128> bak = fn;
+  bak += ".bak";
+
+  // Get entries before creating file
+  std::vector<SavePersistentImpl::Entry> entries;
+  if (!GetEntries(prefix, &entries)) return nullptr;
+
+  // start by writing to temporary file
+  std::error_code ec;
+  llvm::raw_fd_ostream os(tmp, ec, llvm::sys::fs::F_Text);
+  if (ec.value() != 0) {
+    return "could not open file";
+  }
+  DEBUG("saving file '" << filename << "'");
+  SavePersistentImpl(os).Save(entries);
+  os.close();
+  if (os.has_error()) {
+    std::remove(tmp.c_str());
+    return "error saving file";
+  }
+
+  // Safely move to real file.  We ignore any failures related to the backup.
+  std::remove(bak.c_str());
+  std::rename(fn.c_str(), bak.c_str());
+  if (std::rename(tmp.c_str(), fn.c_str()) != 0) {
+    std::rename(bak.c_str(), fn.c_str());  // attempt to restore backup
+    return "could not rename temp file to real file";
+  }
+
+  return nullptr;
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Value.cpp b/third_party/ntcore_2018/src/main/native/cpp/Value.cpp
new file mode 100644
index 0000000..fc63eea
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Value.cpp
@@ -0,0 +1,218 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <stdint.h>
+
+#include <support/timestamp.h>
+
+#include "Value_internal.h"
+#include "networktables/NetworkTableValue.h"
+
+using namespace nt;
+
+Value::Value() {
+  m_val.type = NT_UNASSIGNED;
+  m_val.last_change = wpi::Now();
+}
+
+Value::Value(NT_Type type, uint64_t time, const private_init&) {
+  m_val.type = type;
+  if (time == 0)
+    m_val.last_change = wpi::Now();
+  else
+    m_val.last_change = time;
+  if (m_val.type == NT_BOOLEAN_ARRAY)
+    m_val.data.arr_boolean.arr = nullptr;
+  else if (m_val.type == NT_DOUBLE_ARRAY)
+    m_val.data.arr_double.arr = nullptr;
+  else if (m_val.type == NT_STRING_ARRAY)
+    m_val.data.arr_string.arr = nullptr;
+}
+
+Value::~Value() {
+  if (m_val.type == NT_BOOLEAN_ARRAY)
+    delete[] m_val.data.arr_boolean.arr;
+  else if (m_val.type == NT_DOUBLE_ARRAY)
+    delete[] m_val.data.arr_double.arr;
+  else if (m_val.type == NT_STRING_ARRAY)
+    delete[] m_val.data.arr_string.arr;
+}
+
+std::shared_ptr<Value> Value::MakeBooleanArray(llvm::ArrayRef<int> value,
+                                               uint64_t time) {
+  auto val = std::make_shared<Value>(NT_BOOLEAN_ARRAY, time, private_init());
+  val->m_val.data.arr_boolean.arr = new int[value.size()];
+  val->m_val.data.arr_boolean.size = value.size();
+  std::copy(value.begin(), value.end(), val->m_val.data.arr_boolean.arr);
+  return val;
+}
+
+std::shared_ptr<Value> Value::MakeDoubleArray(llvm::ArrayRef<double> value,
+                                              uint64_t time) {
+  auto val = std::make_shared<Value>(NT_DOUBLE_ARRAY, time, private_init());
+  val->m_val.data.arr_double.arr = new double[value.size()];
+  val->m_val.data.arr_double.size = value.size();
+  std::copy(value.begin(), value.end(), val->m_val.data.arr_double.arr);
+  return val;
+}
+
+std::shared_ptr<Value> Value::MakeStringArray(llvm::ArrayRef<std::string> value,
+                                              uint64_t time) {
+  auto val = std::make_shared<Value>(NT_STRING_ARRAY, time, private_init());
+  val->m_string_array = value;
+  // point NT_Value to the contents in the vector.
+  val->m_val.data.arr_string.arr = new NT_String[value.size()];
+  val->m_val.data.arr_string.size = val->m_string_array.size();
+  for (size_t i = 0; i < value.size(); ++i) {
+    val->m_val.data.arr_string.arr[i].str = const_cast<char*>(value[i].c_str());
+    val->m_val.data.arr_string.arr[i].len = value[i].size();
+  }
+  return val;
+}
+
+std::shared_ptr<Value> Value::MakeStringArray(std::vector<std::string>&& value,
+                                              uint64_t time) {
+  auto val = std::make_shared<Value>(NT_STRING_ARRAY, time, private_init());
+  val->m_string_array = std::move(value);
+  value.clear();
+  // point NT_Value to the contents in the vector.
+  val->m_val.data.arr_string.arr = new NT_String[val->m_string_array.size()];
+  val->m_val.data.arr_string.size = val->m_string_array.size();
+  for (size_t i = 0; i < val->m_string_array.size(); ++i) {
+    val->m_val.data.arr_string.arr[i].str =
+        const_cast<char*>(val->m_string_array[i].c_str());
+    val->m_val.data.arr_string.arr[i].len = val->m_string_array[i].size();
+  }
+  return val;
+}
+
+void nt::ConvertToC(const Value& in, NT_Value* out) {
+  out->type = NT_UNASSIGNED;
+  switch (in.type()) {
+    case NT_UNASSIGNED:
+      return;
+    case NT_BOOLEAN:
+      out->data.v_boolean = in.GetBoolean() ? 1 : 0;
+      break;
+    case NT_DOUBLE:
+      out->data.v_double = in.GetDouble();
+      break;
+    case NT_STRING:
+      ConvertToC(in.GetString(), &out->data.v_string);
+      break;
+    case NT_RAW:
+      ConvertToC(in.GetRaw(), &out->data.v_raw);
+      break;
+    case NT_RPC:
+      ConvertToC(in.GetRpc(), &out->data.v_raw);
+      break;
+    case NT_BOOLEAN_ARRAY: {
+      auto v = in.GetBooleanArray();
+      out->data.arr_boolean.arr =
+          static_cast<int*>(std::malloc(v.size() * sizeof(int)));
+      out->data.arr_boolean.size = v.size();
+      std::copy(v.begin(), v.end(), out->data.arr_boolean.arr);
+      break;
+    }
+    case NT_DOUBLE_ARRAY: {
+      auto v = in.GetDoubleArray();
+      out->data.arr_double.arr =
+          static_cast<double*>(std::malloc(v.size() * sizeof(double)));
+      out->data.arr_double.size = v.size();
+      std::copy(v.begin(), v.end(), out->data.arr_double.arr);
+      break;
+    }
+    case NT_STRING_ARRAY: {
+      auto v = in.GetStringArray();
+      out->data.arr_string.arr =
+          static_cast<NT_String*>(std::malloc(v.size() * sizeof(NT_String)));
+      for (size_t i = 0; i < v.size(); ++i)
+        ConvertToC(v[i], &out->data.arr_string.arr[i]);
+      out->data.arr_string.size = v.size();
+      break;
+    }
+    default:
+      // assert(false && "unknown value type");
+      return;
+  }
+  out->type = in.type();
+}
+
+void nt::ConvertToC(llvm::StringRef in, NT_String* out) {
+  out->len = in.size();
+  out->str = static_cast<char*>(std::malloc(in.size() + 1));
+  std::memcpy(out->str, in.data(), in.size());
+  out->str[in.size()] = '\0';
+}
+
+std::shared_ptr<Value> nt::ConvertFromC(const NT_Value& value) {
+  switch (value.type) {
+    case NT_UNASSIGNED:
+      return nullptr;
+    case NT_BOOLEAN:
+      return Value::MakeBoolean(value.data.v_boolean != 0);
+    case NT_DOUBLE:
+      return Value::MakeDouble(value.data.v_double);
+    case NT_STRING:
+      return Value::MakeString(ConvertFromC(value.data.v_string));
+    case NT_RAW:
+      return Value::MakeRaw(ConvertFromC(value.data.v_raw));
+    case NT_RPC:
+      return Value::MakeRpc(ConvertFromC(value.data.v_raw));
+    case NT_BOOLEAN_ARRAY:
+      return Value::MakeBooleanArray(llvm::ArrayRef<int>(
+          value.data.arr_boolean.arr, value.data.arr_boolean.size));
+    case NT_DOUBLE_ARRAY:
+      return Value::MakeDoubleArray(llvm::ArrayRef<double>(
+          value.data.arr_double.arr, value.data.arr_double.size));
+    case NT_STRING_ARRAY: {
+      std::vector<std::string> v;
+      v.reserve(value.data.arr_string.size);
+      for (size_t i = 0; i < value.data.arr_string.size; ++i)
+        v.push_back(ConvertFromC(value.data.arr_string.arr[i]));
+      return Value::MakeStringArray(std::move(v));
+    }
+    default:
+      // assert(false && "unknown value type");
+      return nullptr;
+  }
+}
+
+bool nt::operator==(const Value& lhs, const Value& rhs) {
+  if (lhs.type() != rhs.type()) return false;
+  switch (lhs.type()) {
+    case NT_UNASSIGNED:
+      return true;  // XXX: is this better being false instead?
+    case NT_BOOLEAN:
+      return lhs.m_val.data.v_boolean == rhs.m_val.data.v_boolean;
+    case NT_DOUBLE:
+      return lhs.m_val.data.v_double == rhs.m_val.data.v_double;
+    case NT_STRING:
+    case NT_RAW:
+    case NT_RPC:
+      return lhs.m_string == rhs.m_string;
+    case NT_BOOLEAN_ARRAY:
+      if (lhs.m_val.data.arr_boolean.size != rhs.m_val.data.arr_boolean.size)
+        return false;
+      return std::memcmp(lhs.m_val.data.arr_boolean.arr,
+                         rhs.m_val.data.arr_boolean.arr,
+                         lhs.m_val.data.arr_boolean.size *
+                             sizeof(lhs.m_val.data.arr_boolean.arr[0])) == 0;
+    case NT_DOUBLE_ARRAY:
+      if (lhs.m_val.data.arr_double.size != rhs.m_val.data.arr_double.size)
+        return false;
+      return std::memcmp(lhs.m_val.data.arr_double.arr,
+                         rhs.m_val.data.arr_double.arr,
+                         lhs.m_val.data.arr_double.size *
+                             sizeof(lhs.m_val.data.arr_double.arr[0])) == 0;
+    case NT_STRING_ARRAY:
+      return lhs.m_string_array == rhs.m_string_array;
+    default:
+      // assert(false && "unknown value type");
+      return false;
+  }
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/Value_internal.h b/third_party/ntcore_2018/src/main/native/cpp/Value_internal.h
new file mode 100644
index 0000000..6eb710b
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/Value_internal.h
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_VALUE_INTERNAL_H_
+#define NTCORE_VALUE_INTERNAL_H_
+
+#include <memory>
+#include <string>
+
+#include <llvm/StringRef.h>
+
+#include "ntcore_c.h"
+
+namespace nt {
+
+class Value;
+
+void ConvertToC(const Value& in, NT_Value* out);
+std::shared_ptr<Value> ConvertFromC(const NT_Value& value);
+void ConvertToC(llvm::StringRef in, NT_String* out);
+inline llvm::StringRef ConvertFromC(const NT_String& str) {
+  return llvm::StringRef(str.str, str.len);
+}
+
+}  // namespace nt
+
+#endif  // NTCORE_VALUE_INTERNAL_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/WireDecoder.cpp b/third_party/ntcore_2018/src/main/native/cpp/WireDecoder.cpp
new file mode 100644
index 0000000..4713823
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/WireDecoder.cpp
@@ -0,0 +1,207 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "WireDecoder.h"
+
+#include <stdint.h>
+
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
+
+#include <llvm/MathExtras.h>
+#include <support/leb128.h>
+
+using namespace nt;
+
+static double ReadDouble(const char*& buf) {
+  // Fast but non-portable!
+  uint64_t val = (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  val <<= 8;
+  val |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+  ++buf;
+  return llvm::BitsToDouble(val);
+}
+
+WireDecoder::WireDecoder(wpi::raw_istream& is, unsigned int proto_rev,
+                         wpi::Logger& logger)
+    : m_is(is), m_logger(logger) {
+  // Start with a 1K temporary buffer.  Use malloc instead of new so we can
+  // realloc.
+  m_allocated = 1024;
+  m_buf = static_cast<char*>(std::malloc(m_allocated));
+  m_proto_rev = proto_rev;
+  m_error = nullptr;
+}
+
+WireDecoder::~WireDecoder() { std::free(m_buf); }
+
+bool WireDecoder::ReadDouble(double* val) {
+  const char* buf;
+  if (!Read(&buf, 8)) return false;
+  *val = ::ReadDouble(buf);
+  return true;
+}
+
+void WireDecoder::Realloc(size_t len) {
+  // Double current buffer size until we have enough space.
+  if (m_allocated >= len) return;
+  size_t newlen = m_allocated * 2;
+  while (newlen < len) newlen *= 2;
+  m_buf = static_cast<char*>(std::realloc(m_buf, newlen));
+  m_allocated = newlen;
+}
+
+bool WireDecoder::ReadType(NT_Type* type) {
+  unsigned int itype;
+  if (!Read8(&itype)) return false;
+  // Convert from byte value to enum
+  switch (itype) {
+    case 0x00:
+      *type = NT_BOOLEAN;
+      break;
+    case 0x01:
+      *type = NT_DOUBLE;
+      break;
+    case 0x02:
+      *type = NT_STRING;
+      break;
+    case 0x03:
+      *type = NT_RAW;
+      break;
+    case 0x10:
+      *type = NT_BOOLEAN_ARRAY;
+      break;
+    case 0x11:
+      *type = NT_DOUBLE_ARRAY;
+      break;
+    case 0x12:
+      *type = NT_STRING_ARRAY;
+      break;
+    case 0x20:
+      *type = NT_RPC;
+      break;
+    default:
+      *type = NT_UNASSIGNED;
+      m_error = "unrecognized value type";
+      return false;
+  }
+  return true;
+}
+
+std::shared_ptr<Value> WireDecoder::ReadValue(NT_Type type) {
+  switch (type) {
+    case NT_BOOLEAN: {
+      unsigned int v;
+      if (!Read8(&v)) return nullptr;
+      return Value::MakeBoolean(v != 0);
+    }
+    case NT_DOUBLE: {
+      double v;
+      if (!ReadDouble(&v)) return nullptr;
+      return Value::MakeDouble(v);
+    }
+    case NT_STRING: {
+      std::string v;
+      if (!ReadString(&v)) return nullptr;
+      return Value::MakeString(std::move(v));
+    }
+    case NT_RAW: {
+      if (m_proto_rev < 0x0300u) {
+        m_error = "received raw value in protocol < 3.0";
+        return nullptr;
+      }
+      std::string v;
+      if (!ReadString(&v)) return nullptr;
+      return Value::MakeRaw(std::move(v));
+    }
+    case NT_RPC: {
+      if (m_proto_rev < 0x0300u) {
+        m_error = "received RPC value in protocol < 3.0";
+        return nullptr;
+      }
+      std::string v;
+      if (!ReadString(&v)) return nullptr;
+      return Value::MakeRpc(std::move(v));
+    }
+    case NT_BOOLEAN_ARRAY: {
+      // size
+      unsigned int size;
+      if (!Read8(&size)) return nullptr;
+
+      // array values
+      const char* buf;
+      if (!Read(&buf, size)) return nullptr;
+      std::vector<int> v(size);
+      for (unsigned int i = 0; i < size; ++i) v[i] = buf[i] ? 1 : 0;
+      return Value::MakeBooleanArray(std::move(v));
+    }
+    case NT_DOUBLE_ARRAY: {
+      // size
+      unsigned int size;
+      if (!Read8(&size)) return nullptr;
+
+      // array values
+      const char* buf;
+      if (!Read(&buf, size * 8)) return nullptr;
+      std::vector<double> v(size);
+      for (unsigned int i = 0; i < size; ++i) v[i] = ::ReadDouble(buf);
+      return Value::MakeDoubleArray(std::move(v));
+    }
+    case NT_STRING_ARRAY: {
+      // size
+      unsigned int size;
+      if (!Read8(&size)) return nullptr;
+
+      // array values
+      std::vector<std::string> v(size);
+      for (unsigned int i = 0; i < size; ++i) {
+        if (!ReadString(&v[i])) return nullptr;
+      }
+      return Value::MakeStringArray(std::move(v));
+    }
+    default:
+      m_error = "invalid type when trying to read value";
+      return nullptr;
+  }
+}
+
+bool WireDecoder::ReadString(std::string* str) {
+  size_t len;
+  if (m_proto_rev < 0x0300u) {
+    unsigned int v;
+    if (!Read16(&v)) return false;
+    len = v;
+  } else {
+    uint64_t v;
+    if (!ReadUleb128(&v)) return false;
+    len = v;
+  }
+  const char* buf;
+  if (!Read(&buf, len)) return false;
+  *str = llvm::StringRef(buf, len);
+  return true;
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/WireDecoder.h b/third_party/ntcore_2018/src/main/native/cpp/WireDecoder.h
new file mode 100644
index 0000000..c8b166c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/WireDecoder.h
@@ -0,0 +1,158 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_WIREDECODER_H_
+#define NTCORE_WIREDECODER_H_
+
+#include <stdint.h>
+
+#include <cstddef>
+#include <memory>
+#include <string>
+
+#include <support/leb128.h>
+#include <support/raw_istream.h>
+
+#include "Log.h"
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+
+/* Decodes network data into native representation.
+ * This class is designed to read from a raw_istream, which provides a blocking
+ * read interface.  There are no provisions in this class for resuming a read
+ * that was interrupted partway.  Read functions return false if
+ * raw_istream.read() returned false (indicating the end of the input data
+ * stream).
+ */
+class WireDecoder {
+ public:
+  WireDecoder(wpi::raw_istream& is, unsigned int proto_rev,
+              wpi::Logger& logger);
+  ~WireDecoder();
+
+  void set_proto_rev(unsigned int proto_rev) { m_proto_rev = proto_rev; }
+
+  /* Get the active protocol revision. */
+  unsigned int proto_rev() const { return m_proto_rev; }
+
+  /* Get the logger. */
+  wpi::Logger& logger() const { return m_logger; }
+
+  /* Clears error indicator. */
+  void Reset() { m_error = nullptr; }
+
+  /* Returns error indicator (a string describing the error).  Returns nullptr
+   * if no error has occurred.
+   */
+  const char* error() const { return m_error; }
+
+  void set_error(const char* error) { m_error = error; }
+
+  /* Reads the specified number of bytes.
+   * @param buf pointer to read data (output parameter)
+   * @param len number of bytes to read
+   * Caution: the buffer is only temporarily valid.
+   */
+  bool Read(const char** buf, size_t len) {
+    if (len > m_allocated) Realloc(len);
+    *buf = m_buf;
+    m_is.read(m_buf, len);
+#if 0
+    if (m_logger.min_level() <= NT_LOG_DEBUG4 && m_logger.HasLogger()) {
+      std::ostringstream oss;
+      oss << "read " << len << " bytes:" << std::hex;
+      if (!rv) {
+        oss << "error";
+      } else {
+        for (size_t i = 0; i < len; ++i)
+          oss << ' ' << static_cast<unsigned int>((*buf)[i]);
+      }
+      m_logger.Log(NT_LOG_DEBUG4, __FILE__, __LINE__, oss.str().c_str());
+    }
+#endif
+    return !m_is.has_error();
+  }
+
+  /* Reads a single byte. */
+  bool Read8(unsigned int* val) {
+    const char* buf;
+    if (!Read(&buf, 1)) return false;
+    *val = (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    return true;
+  }
+
+  /* Reads a 16-bit word. */
+  bool Read16(unsigned int* val) {
+    const char* buf;
+    if (!Read(&buf, 2)) return false;
+    unsigned int v = (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    ++buf;
+    v <<= 8;
+    v |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    *val = v;
+    return true;
+  }
+
+  /* Reads a 32-bit word. */
+  bool Read32(uint32_t* val) {
+    const char* buf;
+    if (!Read(&buf, 4)) return false;
+    unsigned int v = (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    ++buf;
+    v <<= 8;
+    v |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    ++buf;
+    v <<= 8;
+    v |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    ++buf;
+    v <<= 8;
+    v |= (*reinterpret_cast<const unsigned char*>(buf)) & 0xff;
+    *val = v;
+    return true;
+  }
+
+  /* Reads a double. */
+  bool ReadDouble(double* val);
+
+  /* Reads an ULEB128-encoded unsigned integer. */
+  bool ReadUleb128(uint64_t* val) { return wpi::ReadUleb128(m_is, val); }
+
+  bool ReadType(NT_Type* type);
+  bool ReadString(std::string* str);
+  std::shared_ptr<Value> ReadValue(NT_Type type);
+
+  WireDecoder(const WireDecoder&) = delete;
+  WireDecoder& operator=(const WireDecoder&) = delete;
+
+ protected:
+  /* The protocol revision.  E.g. 0x0200 for version 2.0. */
+  unsigned int m_proto_rev;
+
+  /* Error indicator. */
+  const char* m_error;
+
+ private:
+  /* Reallocate temporary buffer to specified length. */
+  void Realloc(size_t len);
+
+  /* input stream */
+  wpi::raw_istream& m_is;
+
+  /* logger */
+  wpi::Logger& m_logger;
+
+  /* temporary buffer */
+  char* m_buf;
+
+  /* allocated size of temporary buffer */
+  size_t m_allocated;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_WIREDECODER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/WireEncoder.cpp b/third_party/ntcore_2018/src/main/native/cpp/WireEncoder.cpp
new file mode 100644
index 0000000..6457b20
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/WireEncoder.cpp
@@ -0,0 +1,199 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "WireEncoder.h"
+
+#include <stdint.h>
+
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
+
+#include <llvm/MathExtras.h>
+#include <support/leb128.h>
+
+using namespace nt;
+
+WireEncoder::WireEncoder(unsigned int proto_rev) {
+  m_proto_rev = proto_rev;
+  m_error = nullptr;
+}
+
+void WireEncoder::WriteDouble(double val) {
+  // The highest performance way to do this, albeit non-portable.
+  uint64_t v = llvm::DoubleToBits(val);
+  m_data.append(
+      {static_cast<char>((v >> 56) & 0xff), static_cast<char>((v >> 48) & 0xff),
+       static_cast<char>((v >> 40) & 0xff), static_cast<char>((v >> 32) & 0xff),
+       static_cast<char>((v >> 24) & 0xff), static_cast<char>((v >> 16) & 0xff),
+       static_cast<char>((v >> 8) & 0xff), static_cast<char>(v & 0xff)});
+}
+
+void WireEncoder::WriteUleb128(uint32_t val) { wpi::WriteUleb128(m_data, val); }
+
+void WireEncoder::WriteType(NT_Type type) {
+  char ch;
+  // Convert from enum to actual byte value.
+  switch (type) {
+    case NT_BOOLEAN:
+      ch = 0x00;
+      break;
+    case NT_DOUBLE:
+      ch = 0x01;
+      break;
+    case NT_STRING:
+      ch = 0x02;
+      break;
+    case NT_RAW:
+      if (m_proto_rev < 0x0300u) {
+        m_error = "raw type not supported in protocol < 3.0";
+        return;
+      }
+      ch = 0x03;
+      break;
+    case NT_BOOLEAN_ARRAY:
+      ch = 0x10;
+      break;
+    case NT_DOUBLE_ARRAY:
+      ch = 0x11;
+      break;
+    case NT_STRING_ARRAY:
+      ch = 0x12;
+      break;
+    case NT_RPC:
+      if (m_proto_rev < 0x0300u) {
+        m_error = "RPC type not supported in protocol < 3.0";
+        return;
+      }
+      ch = 0x20;
+      break;
+    default:
+      m_error = "unrecognized type";
+      return;
+  }
+  m_data.push_back(ch);
+}
+
+size_t WireEncoder::GetValueSize(const Value& value) const {
+  switch (value.type()) {
+    case NT_BOOLEAN:
+      return 1;
+    case NT_DOUBLE:
+      return 8;
+    case NT_STRING:
+      return GetStringSize(value.GetString());
+    case NT_RAW:
+      if (m_proto_rev < 0x0300u) return 0;
+      return GetStringSize(value.GetRaw());
+    case NT_RPC:
+      if (m_proto_rev < 0x0300u) return 0;
+      return GetStringSize(value.GetRpc());
+    case NT_BOOLEAN_ARRAY: {
+      // 1-byte size, 1 byte per element
+      size_t size = value.GetBooleanArray().size();
+      if (size > 0xff) size = 0xff;  // size is only 1 byte, truncate
+      return 1 + size;
+    }
+    case NT_DOUBLE_ARRAY: {
+      // 1-byte size, 8 bytes per element
+      size_t size = value.GetDoubleArray().size();
+      if (size > 0xff) size = 0xff;  // size is only 1 byte, truncate
+      return 1 + size * 8;
+    }
+    case NT_STRING_ARRAY: {
+      auto v = value.GetStringArray();
+      size_t size = v.size();
+      if (size > 0xff) size = 0xff;  // size is only 1 byte, truncate
+      size_t len = 1;                // 1-byte size
+      for (size_t i = 0; i < size; ++i) len += GetStringSize(v[i]);
+      return len;
+    }
+    default:
+      return 0;
+  }
+}
+
+void WireEncoder::WriteValue(const Value& value) {
+  switch (value.type()) {
+    case NT_BOOLEAN:
+      Write8(value.GetBoolean() ? 1 : 0);
+      break;
+    case NT_DOUBLE:
+      WriteDouble(value.GetDouble());
+      break;
+    case NT_STRING:
+      WriteString(value.GetString());
+      break;
+    case NT_RAW:
+      if (m_proto_rev < 0x0300u) {
+        m_error = "raw values not supported in protocol < 3.0";
+        return;
+      }
+      WriteString(value.GetRaw());
+      break;
+    case NT_RPC:
+      if (m_proto_rev < 0x0300u) {
+        m_error = "RPC values not supported in protocol < 3.0";
+        return;
+      }
+      WriteString(value.GetRpc());
+      break;
+    case NT_BOOLEAN_ARRAY: {
+      auto v = value.GetBooleanArray();
+      size_t size = v.size();
+      if (size > 0xff) size = 0xff;  // size is only 1 byte, truncate
+      Write8(size);
+
+      for (size_t i = 0; i < size; ++i) Write8(v[i] ? 1 : 0);
+      break;
+    }
+    case NT_DOUBLE_ARRAY: {
+      auto v = value.GetDoubleArray();
+      size_t size = v.size();
+      if (size > 0xff) size = 0xff;  // size is only 1 byte, truncate
+      Write8(size);
+
+      for (size_t i = 0; i < size; ++i) WriteDouble(v[i]);
+      break;
+    }
+    case NT_STRING_ARRAY: {
+      auto v = value.GetStringArray();
+      size_t size = v.size();
+      if (size > 0xff) size = 0xff;  // size is only 1 byte, truncate
+      Write8(size);
+
+      for (size_t i = 0; i < size; ++i) WriteString(v[i]);
+      break;
+    }
+    default:
+      m_error = "unrecognized type when writing value";
+      return;
+  }
+}
+
+size_t WireEncoder::GetStringSize(llvm::StringRef str) const {
+  if (m_proto_rev < 0x0300u) {
+    size_t len = str.size();
+    if (len > 0xffff) len = 0xffff;  // Limited to 64K length; truncate
+    return 2 + len;
+  }
+  return wpi::SizeUleb128(str.size()) + str.size();
+}
+
+void WireEncoder::WriteString(llvm::StringRef str) {
+  // length
+  size_t len = str.size();
+  if (m_proto_rev < 0x0300u) {
+    if (len > 0xffff) len = 0xffff;  // Limited to 64K length; truncate
+    Write16(len);
+  } else {
+    WriteUleb128(len);
+  }
+
+  // contents
+  m_data.append(str.data(), str.data() + len);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/WireEncoder.h b/third_party/ntcore_2018/src/main/native/cpp/WireEncoder.h
new file mode 100644
index 0000000..07e9879
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/WireEncoder.h
@@ -0,0 +1,111 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_WIREENCODER_H_
+#define NTCORE_WIREENCODER_H_
+
+#include <stdint.h>
+
+#include <cassert>
+#include <cstddef>
+
+#include <llvm/SmallVector.h>
+#include <llvm/StringRef.h>
+
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+
+/* Encodes native data for network transmission.
+ * This class maintains an internal memory buffer for written data so that
+ * it can be efficiently bursted to the network after a number of writes
+ * have been performed.  For this reason, all operations are non-blocking.
+ */
+class WireEncoder {
+ public:
+  explicit WireEncoder(unsigned int proto_rev);
+
+  /* Change the protocol revision (mostly affects value encoding). */
+  void set_proto_rev(unsigned int proto_rev) { m_proto_rev = proto_rev; }
+
+  /* Get the active protocol revision. */
+  unsigned int proto_rev() const { return m_proto_rev; }
+
+  /* Clears buffer and error indicator. */
+  void Reset() {
+    m_data.clear();
+    m_error = nullptr;
+  }
+
+  /* Returns error indicator (a string describing the error).  Returns nullptr
+   * if no error has occurred.
+   */
+  const char* error() const { return m_error; }
+
+  /* Returns pointer to start of memory buffer with written data. */
+  const char* data() const { return m_data.data(); }
+
+  /* Returns number of bytes written to memory buffer. */
+  size_t size() const { return m_data.size(); }
+
+  llvm::StringRef ToStringRef() const {
+    return llvm::StringRef(m_data.data(), m_data.size());
+  }
+
+  /* Writes a single byte. */
+  void Write8(unsigned int val) {
+    m_data.push_back(static_cast<char>(val & 0xff));
+  }
+
+  /* Writes a 16-bit word. */
+  void Write16(unsigned int val) {
+    m_data.append(
+        {static_cast<char>((val >> 8) & 0xff), static_cast<char>(val & 0xff)});
+  }
+
+  /* Writes a 32-bit word. */
+  void Write32(uint32_t val) {
+    m_data.append({static_cast<char>((val >> 24) & 0xff),
+                   static_cast<char>((val >> 16) & 0xff),
+                   static_cast<char>((val >> 8) & 0xff),
+                   static_cast<char>(val & 0xff)});
+  }
+
+  /* Writes a double. */
+  void WriteDouble(double val);
+
+  /* Writes an ULEB128-encoded unsigned integer. */
+  void WriteUleb128(uint32_t val);
+
+  void WriteType(NT_Type type);
+  void WriteValue(const Value& value);
+  void WriteString(llvm::StringRef str);
+
+  /* Utility function to get the written size of a value (without actually
+   * writing it).
+   */
+  size_t GetValueSize(const Value& value) const;
+
+  /* Utility function to get the written size of a string (without actually
+   * writing it).
+   */
+  size_t GetStringSize(llvm::StringRef str) const;
+
+ protected:
+  /* The protocol revision.  E.g. 0x0200 for version 2.0. */
+  unsigned int m_proto_rev;
+
+  /* Error indicator. */
+  const char* m_error;
+
+ private:
+  llvm::SmallVector<char, 256> m_data;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_WIREENCODER_H_
diff --git a/third_party/ntcore_2018/src/main/native/cpp/jni/NetworkTablesJNI.cpp b/third_party/ntcore_2018/src/main/native/cpp/jni/NetworkTablesJNI.cpp
new file mode 100644
index 0000000..9f01a0e
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/jni/NetworkTablesJNI.cpp
@@ -0,0 +1,1771 @@
+#include <jni.h>
+#include <cassert>
+
+#include "edu_wpi_first_networktables_NetworkTablesJNI.h"
+#include "ntcore.h"
+#include "support/jni_util.h"
+#include "llvm/ConvertUTF.h"
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+
+using namespace wpi::java;
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+//
+// Globals and load/unload
+//
+
+// Used for callback.
+static JavaVM *jvm = nullptr;
+static JClass booleanCls;
+static JClass connectionInfoCls;
+static JClass connectionNotificationCls;
+static JClass doubleCls;
+static JClass entryInfoCls;
+static JClass entryNotificationCls;
+static JClass logMessageCls;
+static JClass rpcAnswerCls;
+static JClass valueCls;
+static JException illegalArgEx;
+static JException interruptedEx;
+static JException nullPointerEx;
+static JException persistentEx;
+
+extern "C" {
+
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
+  jvm = vm;
+
+  JNIEnv *env;
+  if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
+    return JNI_ERR;
+
+  // Cache references to classes
+  booleanCls = JClass(env, "java/lang/Boolean");
+  if (!booleanCls) return JNI_ERR;
+
+  connectionInfoCls =
+      JClass(env, "edu/wpi/first/networktables/ConnectionInfo");
+  if (!connectionInfoCls) return JNI_ERR;
+
+  connectionNotificationCls = JClass(env, "edu/wpi/first/networktables/ConnectionNotification");
+  if (!connectionNotificationCls) return JNI_ERR;
+
+  doubleCls = JClass(env, "java/lang/Double");
+  if (!doubleCls) return JNI_ERR;
+
+  entryInfoCls = JClass(env, "edu/wpi/first/networktables/EntryInfo");
+  if (!entryInfoCls) return JNI_ERR;
+
+  entryNotificationCls = JClass(env, "edu/wpi/first/networktables/EntryNotification");
+  if (!entryNotificationCls) return JNI_ERR;
+
+  logMessageCls = JClass(env, "edu/wpi/first/networktables/LogMessage");
+  if (!logMessageCls) return JNI_ERR;
+
+  rpcAnswerCls = JClass(env, "edu/wpi/first/networktables/RpcAnswer");
+  if (!rpcAnswerCls) return JNI_ERR;
+
+  valueCls =
+      JClass(env, "edu/wpi/first/networktables/NetworkTableValue");
+  if (!valueCls) return JNI_ERR;
+
+  illegalArgEx = JException(env, "java/lang/IllegalArgumentException");
+  if (!illegalArgEx) return JNI_ERR;
+
+  interruptedEx = JException(env, "java/lang/InterruptedException");
+  if (!interruptedEx) return JNI_ERR;
+
+  nullPointerEx = JException(env, "java/lang/NullPointerException");
+  if (!nullPointerEx) return JNI_ERR;
+
+  persistentEx = JException(
+      env, "edu/wpi/first/networktables/PersistentException");
+  if (!persistentEx) return JNI_ERR;
+
+  return JNI_VERSION_1_6;
+}
+
+JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) {
+  JNIEnv *env;
+  if (vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6) != JNI_OK)
+    return;
+  // Delete global references
+  booleanCls.free(env);
+  connectionInfoCls.free(env);
+  connectionNotificationCls.free(env);
+  doubleCls.free(env);
+  entryInfoCls.free(env);
+  entryNotificationCls.free(env);
+  logMessageCls.free(env);
+  rpcAnswerCls.free(env);
+  valueCls.free(env);
+  illegalArgEx.free(env);
+  interruptedEx.free(env);
+  nullPointerEx.free(env);
+  persistentEx.free(env);
+  jvm = nullptr;
+}
+
+}  // extern "C"
+
+//
+// Conversions from Java objects to C++
+//
+
+inline std::shared_ptr<nt::Value> FromJavaRaw(JNIEnv *env, jbyteArray jarr,
+                                              jlong time) {
+  CriticalJByteArrayRef ref{env, jarr};
+  if (!ref) return nullptr;
+  return nt::Value::MakeRaw(ref, time);
+}
+
+inline std::shared_ptr<nt::Value> FromJavaRawBB(JNIEnv* env, jobject jbb,
+                                                int len, jlong time) {
+  JByteArrayRef ref{env, jbb, len};
+  if (!ref) return nullptr;
+  return nt::Value::MakeRaw(ref.str(), time);
+}
+
+inline std::shared_ptr<nt::Value> FromJavaRpc(JNIEnv *env, jbyteArray jarr,
+                                              jlong time) {
+  CriticalJByteArrayRef ref{env, jarr};
+  if (!ref) return nullptr;
+  return nt::Value::MakeRpc(ref.str(), time);
+}
+
+std::shared_ptr<nt::Value> FromJavaBooleanArray(JNIEnv* env, jbooleanArray jarr,
+                                                jlong time) {
+  CriticalJBooleanArrayRef ref{env, jarr};
+  if (!ref) return nullptr;
+  llvm::ArrayRef<jboolean> elements{ref};
+  size_t len = elements.size();
+  std::vector<int> arr;
+  arr.reserve(len);
+  for (size_t i = 0; i < len; ++i) arr.push_back(elements[i]);
+  return nt::Value::MakeBooleanArray(arr, time);
+}
+
+std::shared_ptr<nt::Value> FromJavaDoubleArray(JNIEnv* env, jdoubleArray jarr,
+                                               jlong time) {
+  CriticalJDoubleArrayRef ref{env, jarr};
+  if (!ref) return nullptr;
+  return nt::Value::MakeDoubleArray(ref, time);
+}
+
+std::shared_ptr<nt::Value> FromJavaStringArray(JNIEnv* env, jobjectArray jarr,
+                                               jlong time) {
+  size_t len = env->GetArrayLength(jarr);
+  std::vector<std::string> arr;
+  arr.reserve(len);
+  for (size_t i = 0; i < len; ++i) {
+    JLocal<jstring> elem{
+        env, static_cast<jstring>(env->GetObjectArrayElement(jarr, i))};
+    if (!elem) return nullptr;
+    arr.push_back(JStringRef{env, elem}.str());
+  }
+  return nt::Value::MakeStringArray(std::move(arr), time);
+}
+
+//
+// Conversions from C++ to Java objects
+//
+
+static jobject MakeJObject(JNIEnv *env, const nt::Value& value) {
+  static jmethodID booleanConstructor = nullptr;
+  static jmethodID doubleConstructor = nullptr;
+  if (!booleanConstructor)
+    booleanConstructor = env->GetMethodID(booleanCls, "<init>", "(Z)V");
+  if (!doubleConstructor)
+    doubleConstructor = env->GetMethodID(doubleCls, "<init>", "(D)V");
+
+  switch (value.type()) {
+    case NT_BOOLEAN:
+      return env->NewObject(booleanCls, booleanConstructor,
+                            (jboolean)(value.GetBoolean() ? 1 : 0));
+    case NT_DOUBLE:
+      return env->NewObject(doubleCls, doubleConstructor,
+                            (jdouble)value.GetDouble());
+    case NT_STRING:
+      return MakeJString(env, value.GetString());
+    case NT_RAW:
+      return MakeJByteArray(env, value.GetRaw());
+    case NT_BOOLEAN_ARRAY:
+      return MakeJBooleanArray(env, value.GetBooleanArray());
+    case NT_DOUBLE_ARRAY:
+      return MakeJDoubleArray(env, value.GetDoubleArray());
+    case NT_STRING_ARRAY:
+      return MakeJStringArray(env, value.GetStringArray());
+    case NT_RPC:
+      return MakeJByteArray(env, value.GetRpc());
+    default:
+      return nullptr;
+  }
+}
+
+static jobject MakeJValue(JNIEnv *env, const nt::Value* value) {
+  static jmethodID constructor =
+      env->GetMethodID(valueCls, "<init>", "(ILjava/lang/Object;J)V");
+  if (!value)
+    return env->NewObject(valueCls, constructor, (jint)NT_UNASSIGNED, nullptr,
+                          (jlong)0);
+  return env->NewObject(valueCls, constructor, (jint)value->type(),
+                        MakeJObject(env, *value), (jlong)value->time());
+}
+
+static jobject MakeJObject(JNIEnv *env, const nt::ConnectionInfo &info) {
+  static jmethodID constructor =
+      env->GetMethodID(connectionInfoCls, "<init>",
+                       "(Ljava/lang/String;Ljava/lang/String;IJI)V");
+  JLocal<jstring> remote_id{env, MakeJString(env, info.remote_id)};
+  JLocal<jstring> remote_ip{env, MakeJString(env, info.remote_ip)};
+  return env->NewObject(connectionInfoCls, constructor, remote_id.obj(),
+                        remote_ip.obj(), (jint)info.remote_port,
+                        (jlong)info.last_update, (jint)info.protocol_version);
+}
+
+static jobject MakeJObject(JNIEnv *env, jobject inst,
+                           const nt::ConnectionNotification &notification) {
+  static jmethodID constructor =
+      env->GetMethodID(connectionNotificationCls, "<init>",
+                       "(Ledu/wpi/first/networktables/NetworkTableInstance;IZLedu/wpi/first/networktables/ConnectionInfo;)V");
+  JLocal<jobject> conn{env, MakeJObject(env, notification.conn)};
+  return env->NewObject(connectionNotificationCls, constructor, inst,
+                        (jint)notification.listener,
+                        (jboolean)notification.connected, conn.obj());
+}
+
+static jobject MakeJObject(JNIEnv *env, jobject inst,
+                           const nt::EntryInfo &info) {
+  static jmethodID constructor =
+      env->GetMethodID(entryInfoCls, "<init>", "(Ledu/wpi/first/networktables/NetworkTableInstance;ILjava/lang/String;IIJ)V");
+  JLocal<jstring> name{env, MakeJString(env, info.name)};
+  return env->NewObject(entryInfoCls, constructor, inst, (jint)info.entry,
+                        name.obj(), (jint)info.type, (jint)info.flags,
+                        (jlong)info.last_change);
+}
+
+static jobject MakeJObject(JNIEnv *env, jobject inst,
+                           const nt::EntryNotification &notification) {
+  static jmethodID constructor =
+      env->GetMethodID(entryNotificationCls, "<init>",
+                       "(Ledu/wpi/first/networktables/NetworkTableInstance;IILjava/lang/String;Ledu/wpi/first/networktables/NetworkTableValue;I)V");
+  JLocal<jstring> name{env, MakeJString(env, notification.name)};
+  JLocal<jobject> value{env, MakeJValue(env, notification.value.get())};
+  return env->NewObject(entryNotificationCls, constructor, inst,
+                        (jint)notification.listener, (jint)notification.entry,
+                        name.obj(), value.obj(), (jint)notification.flags);
+}
+
+static jobject MakeJObject(JNIEnv *env, jobject inst,
+                           const nt::LogMessage &msg) {
+  static jmethodID constructor =
+      env->GetMethodID(logMessageCls, "<init>",
+                       "(Ledu/wpi/first/networktables/NetworkTableInstance;IILjava/lang/String;ILjava/lang/String;)V");
+  JLocal<jstring> filename{env, MakeJString(env, msg.filename)};
+  JLocal<jstring> message{env, MakeJString(env, msg.message)};
+  return env->NewObject(logMessageCls, constructor, inst, (jint)msg.logger,
+                        (jint)msg.level, filename.obj(), (jint)msg.line,
+                        message.obj());
+}
+
+static jobject MakeJObject(JNIEnv *env, jobject inst,
+                           const nt::RpcAnswer &answer) {
+  static jmethodID constructor =
+      env->GetMethodID(rpcAnswerCls, "<init>",
+                       "(Ledu/wpi/first/networktables/NetworkTableInstance;IILjava/lang/String;Ljava/lang/String;Ledu/wpi/first/networktables/ConnectionInfo;)V");
+  JLocal<jstring> name{env, MakeJString(env, answer.name)};
+  JLocal<jstring> params{env, MakeJString(env, answer.params)};
+  JLocal<jobject> conn{env, MakeJObject(env, answer.conn)};
+  return env->NewObject(rpcAnswerCls, constructor, inst, (jint)answer.entry,
+                        (jint)answer.call, name.obj(), params.obj(),
+                        conn.obj());
+}
+
+static jobjectArray MakeJObject(JNIEnv *env, jobject inst,
+                                llvm::ArrayRef<nt::ConnectionNotification> arr) {
+  jobjectArray jarr = env->NewObjectArray(arr.size(), connectionNotificationCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jobject> elem{env, MakeJObject(env, inst, arr[i])};
+    env->SetObjectArrayElement(jarr, i, elem.obj());
+  }
+  return jarr;
+}
+
+static jobjectArray MakeJObject(JNIEnv *env, jobject inst,
+                                llvm::ArrayRef<nt::EntryNotification> arr) {
+  jobjectArray jarr = env->NewObjectArray(arr.size(), entryNotificationCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jobject> elem{env, MakeJObject(env, inst, arr[i])};
+    env->SetObjectArrayElement(jarr, i, elem.obj());
+  }
+  return jarr;
+}
+
+static jobjectArray MakeJObject(JNIEnv *env, jobject inst,
+                                llvm::ArrayRef<nt::LogMessage> arr) {
+  jobjectArray jarr = env->NewObjectArray(arr.size(), logMessageCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jobject> elem{env, MakeJObject(env, inst, arr[i])};
+    env->SetObjectArrayElement(jarr, i, elem.obj());
+  }
+  return jarr;
+}
+
+static jobjectArray MakeJObject(JNIEnv *env, jobject inst,
+                                llvm::ArrayRef<nt::RpcAnswer> arr) {
+  jobjectArray jarr = env->NewObjectArray(arr.size(), rpcAnswerCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jobject> elem{env, MakeJObject(env, inst, arr[i])};
+    env->SetObjectArrayElement(jarr, i, elem.obj());
+  }
+  return jarr;
+}
+
+extern "C" {
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getDefaultInstance
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getDefaultInstance
+  (JNIEnv *, jclass)
+{
+  return nt::GetDefaultInstance();
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    createInstance
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_createInstance
+  (JNIEnv *, jclass)
+{
+  return nt::CreateInstance();
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    destroyInstance
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_destroyInstance
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::DestroyInstance(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getInstanceFromHandle
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getInstanceFromHandle
+  (JNIEnv *, jclass, jint handle)
+{
+  return nt::GetInstanceFromHandle(handle);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntry
+ * Signature: (ILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntry
+  (JNIEnv *env, jclass, jint inst, jstring key)
+{
+  if (!key) {
+    nullPointerEx.Throw(env, "key cannot be null");
+    return false;
+  }
+  return nt::GetEntry(inst, JStringRef{env, key}.str());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntries
+ * Signature: (ILjava/lang/String;I)[I
+ */
+JNIEXPORT jintArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntries
+  (JNIEnv *env, jclass, jint inst, jstring prefix, jint types)
+{
+  if (!prefix) {
+    nullPointerEx.Throw(env, "prefix cannot be null");
+    return nullptr;
+  }
+  return MakeJIntArray(
+      env, nt::GetEntries(inst, JStringRef{env, prefix}.str(), types));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntryName
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntryName
+  (JNIEnv *env, jclass, jint entry)
+{
+  return MakeJString(env, nt::GetEntryName(entry));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntryLastChange
+ * Signature: (I)J
+ */
+JNIEXPORT jlong JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntryLastChange
+  (JNIEnv *, jclass, jint entry)
+{
+  return nt::GetEntryLastChange(entry);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getType
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getType
+  (JNIEnv *, jclass, jint entry)
+{
+  return nt::GetEntryType(entry);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setBoolean
+ * Signature: (IJZZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setBoolean
+  (JNIEnv *, jclass, jint entry, jlong time, jboolean value, jboolean force)
+{
+  if (force) {
+    nt::SetEntryTypeValue(entry,
+                          nt::Value::MakeBoolean(value != JNI_FALSE, time));
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry,
+                           nt::Value::MakeBoolean(value != JNI_FALSE, time));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDouble
+ * Signature: (IJDZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDouble
+  (JNIEnv *, jclass, jint entry, jlong time, jdouble value, jboolean force)
+{
+  if (force) {
+    nt::SetEntryTypeValue(entry, nt::Value::MakeDouble(value, time));
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry, nt::Value::MakeDouble(value, time));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setString
+ * Signature: (IJLjava/lang/String;Z)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setString
+  (JNIEnv *env, jclass, jint entry, jlong time, jstring value, jboolean force)
+{
+  if (!value) {
+    nullPointerEx.Throw(env, "value cannot be null");
+    return false;
+  }
+  if (force) {
+    nt::SetEntryTypeValue(
+        entry, nt::Value::MakeString(JStringRef{env, value}.str(), time));
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(
+      entry, nt::Value::MakeString(JStringRef{env, value}.str(), time));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setRaw
+ * Signature: (IJ[BZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setRaw__IJ_3BZ
+  (JNIEnv *env, jclass, jint entry, jlong time, jbyteArray value, jboolean force)
+{
+  if (!value) {
+    nullPointerEx.Throw(env, "value cannot be null");
+    return false;
+  }
+  auto v = FromJavaRaw(env, value, time);
+  if (!v) return false;
+  if (force) {
+    nt::SetEntryTypeValue(entry, v);
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setRaw
+ * Signature: (IJLjava/nio/ByteBuffer;IZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setRaw__IJLjava_nio_ByteBuffer_2IZ
+  (JNIEnv *env, jclass, jint entry, jlong time, jobject value, jint len, jboolean force)
+{
+  if (!value) {
+    nullPointerEx.Throw(env, "value cannot be null");
+    return false;
+  }
+  auto v = FromJavaRawBB(env, value, len, time);
+  if (!v) return false;
+  if (force) {
+    nt::SetEntryTypeValue(entry, v);
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setBooleanArray
+ * Signature: (IJ[Z)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setBooleanArray
+  (JNIEnv *env, jclass, jint entry, jlong time, jbooleanArray value, jboolean force)
+{
+  if (!value) {
+    nullPointerEx.Throw(env, "value cannot be null");
+    return false;
+  }
+  auto v = FromJavaBooleanArray(env, value, time);
+  if (!v) return false;
+  if (force) {
+    nt::SetEntryTypeValue(entry, v);
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDoubleArray
+ * Signature: (IJ[DZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDoubleArray
+  (JNIEnv *env, jclass, jint entry, jlong time, jdoubleArray value, jboolean force)
+{
+  if (!value) {
+    nullPointerEx.Throw(env, "value cannot be null");
+    return false;
+  }
+  auto v = FromJavaDoubleArray(env, value, time);
+  if (!v) return false;
+  if (force) {
+    nt::SetEntryTypeValue(entry, v);
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setStringArray
+ * Signature: (IJ[Ljava/lang/String;Z)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setStringArray
+  (JNIEnv *env, jclass, jint entry, jlong time, jobjectArray value, jboolean force)
+{
+  if (!value) {
+    nullPointerEx.Throw(env, "value cannot be null");
+    return false;
+  }
+  auto v = FromJavaStringArray(env, value, time);
+  if (!v) return false;
+  if (force) {
+    nt::SetEntryTypeValue(entry, v);
+    return JNI_TRUE;
+  }
+  return nt::SetEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getValue
+ * Signature: (I)Ledu/wpi/first/networktables/NetworkTableValue;
+ */
+JNIEXPORT jobject JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getValue
+  (JNIEnv *env, jclass, jint entry)
+{
+  auto val = nt::GetEntryValue(entry);
+  return MakeJValue(env, val.get());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getBoolean
+ * Signature: (IZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getBoolean
+  (JNIEnv *, jclass, jint entry, jboolean defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsBoolean()) return defaultValue;
+  return val->GetBoolean();
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getDouble
+ * Signature: (ID)D
+ */
+JNIEXPORT jdouble JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getDouble
+  (JNIEnv *, jclass, jint entry, jdouble defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsDouble()) return defaultValue;
+  return val->GetDouble();
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getString
+ * Signature: (ILjava/lang/String;)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getString
+  (JNIEnv *env, jclass, jint entry, jstring defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsString()) return defaultValue;
+  return MakeJString(env, val->GetString());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getRaw
+ * Signature: (I[B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getRaw
+  (JNIEnv *env, jclass, jint entry, jbyteArray defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsRaw()) return defaultValue;
+  return MakeJByteArray(env, val->GetRaw());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getBooleanArray
+ * Signature: (I[Z)[Z
+ */
+JNIEXPORT jbooleanArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getBooleanArray
+  (JNIEnv *env, jclass, jint entry, jbooleanArray defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsBooleanArray()) return defaultValue;
+  return MakeJBooleanArray(env, val->GetBooleanArray());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getDoubleArray
+ * Signature: (I[D)[D
+ */
+JNIEXPORT jdoubleArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getDoubleArray
+  (JNIEnv *env, jclass, jint entry, jdoubleArray defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsDoubleArray()) return defaultValue;
+  return MakeJDoubleArray(env, val->GetDoubleArray());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getStringArray
+ * Signature: (I[Ljava/lang/String;)[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getStringArray
+  (JNIEnv *env, jclass, jint entry, jobjectArray defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsStringArray()) return defaultValue;
+  return MakeJStringArray(env, val->GetStringArray());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultBoolean
+ * Signature: (IJZ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultBoolean
+  (JNIEnv *, jclass, jint entry, jlong time, jboolean defaultValue)
+{
+  return nt::SetDefaultEntryValue(
+      entry, nt::Value::MakeBoolean(defaultValue != JNI_FALSE, time));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultDouble
+ * Signature: (IJD)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultDouble
+  (JNIEnv *, jclass, jint entry, jlong time, jdouble defaultValue)
+{
+  return nt::SetDefaultEntryValue(entry,
+                                  nt::Value::MakeDouble(defaultValue, time));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultString
+ * Signature: (IJLjava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultString
+  (JNIEnv *env, jclass, jint entry, jlong time, jstring defaultValue)
+{
+  if (!defaultValue) {
+    nullPointerEx.Throw(env, "defaultValue cannot be null");
+    return false;
+  }
+  return nt::SetDefaultEntryValue(
+      entry, nt::Value::MakeString(JStringRef{env, defaultValue}.str(), time));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultRaw
+ * Signature: (IJ[B)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultRaw
+  (JNIEnv *env, jclass, jint entry, jlong time, jbyteArray defaultValue)
+{
+  if (!defaultValue) {
+    nullPointerEx.Throw(env, "defaultValue cannot be null");
+    return false;
+  }
+  auto v = FromJavaRaw(env, defaultValue, time);
+  return nt::SetDefaultEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultBooleanArray
+ * Signature: (IJ[Z)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultBooleanArray
+  (JNIEnv *env, jclass, jint entry, jlong time, jbooleanArray defaultValue)
+{
+  if (!defaultValue) {
+    nullPointerEx.Throw(env, "defaultValue cannot be null");
+    return false;
+  }
+  auto v = FromJavaBooleanArray(env, defaultValue, time);
+  return nt::SetDefaultEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultDoubleArray
+ * Signature: (IJ[D)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultDoubleArray
+  (JNIEnv *env, jclass, jint entry, jlong time, jdoubleArray defaultValue)
+{
+  if (!defaultValue) {
+    nullPointerEx.Throw(env, "defaultValue cannot be null");
+    return false;
+  }
+  auto v = FromJavaDoubleArray(env, defaultValue, time);
+  return nt::SetDefaultEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setDefaultStringArray
+ * Signature: (IJ[Ljava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setDefaultStringArray
+  (JNIEnv *env, jclass, jint entry, jlong time, jobjectArray defaultValue)
+{
+  if (!defaultValue) {
+    nullPointerEx.Throw(env, "defaultValue cannot be null");
+    return false;
+  }
+  auto v = FromJavaStringArray(env, defaultValue, time);
+  return nt::SetDefaultEntryValue(entry, v);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setEntryFlags
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setEntryFlags
+  (JNIEnv *, jclass, jint entry, jint flags)
+{
+  nt::SetEntryFlags(entry, flags);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntryFlags
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntryFlags
+  (JNIEnv *, jclass, jint entry)
+{
+  return nt::GetEntryFlags(entry);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    deleteEntry
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_deleteEntry
+  (JNIEnv *, jclass, jint entry)
+{
+  nt::DeleteEntry(entry);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    deleteAllEntries
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_deleteAllEntries
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::DeleteAllEntries(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntryInfoHandle
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;I)Ledu/wpi/first/networktables/EntryInfo;
+ */
+JNIEXPORT jobject JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntryInfoHandle
+  (JNIEnv *env, jclass, jobject inst, jint entry)
+{
+  return MakeJObject(env, inst, nt::GetEntryInfo(entry));
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getEntryInfo
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;ILjava/lang/String;I)[Ledu/wpi/first/networktables/EntryInfo;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getEntryInfo
+  (JNIEnv *env, jclass, jobject instObject, jint inst, jstring prefix, jint types)
+{
+  if (!prefix) {
+    nullPointerEx.Throw(env, "prefix cannot be null");
+    return nullptr;
+  }
+  auto arr = nt::GetEntryInfo(inst, JStringRef{env, prefix}.str(), types);
+  jobjectArray jarr = env->NewObjectArray(arr.size(), entryInfoCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jobject> jelem{env, MakeJObject(env, instObject, arr[i])};
+    env->SetObjectArrayElement(jarr, i, jelem);
+  }
+  return jarr;
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    createEntryListenerPoller
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_createEntryListenerPoller
+  (JNIEnv *, jclass, jint inst)
+{
+  return nt::CreateEntryListenerPoller(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    destroyEntryListenerPoller
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_destroyEntryListenerPoller
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::DestroyEntryListenerPoller(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    addPolledEntryListener
+ * Signature: (ILjava/lang/String;I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_addPolledEntryListener__ILjava_lang_String_2I
+  (JNIEnv *env, jclass, jint poller, jstring prefix, jint flags)
+{
+  if (!prefix) {
+    nullPointerEx.Throw(env, "prefix cannot be null");
+    return 0;
+  }
+  return nt::AddPolledEntryListener(poller, JStringRef{env, prefix}.str(),
+                                    flags);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    addPolledEntryListener
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_addPolledEntryListener__III
+  (JNIEnv *env, jclass, jint poller, jint entry, jint flags)
+{
+  return nt::AddPolledEntryListener(poller, entry, flags);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollEntryListener
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;I)[Ledu/wpi/first/networktables/EntryNotification;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollEntryListener
+  (JNIEnv *env, jclass, jobject inst, jint poller)
+{
+  auto events = nt::PollEntryListener(poller);
+  if (events.empty()) {
+    interruptedEx.Throw(env, "PollEntryListener interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, events);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollEntryListenerTimeout
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;ID)[Ledu/wpi/first/networktables/EntryNotification;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollEntryListenerTimeout
+  (JNIEnv *env, jclass, jobject inst, jint poller, jdouble timeout)
+{
+  bool timed_out = false;
+  auto events = nt::PollEntryListener(poller, timeout, &timed_out);
+  if (events.empty() && !timed_out) {
+    interruptedEx.Throw(env, "PollEntryListener interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, events);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    cancelPollEntryListener
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_cancelPollEntryListener
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::CancelPollEntryListener(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    removeEntryListener
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_removeEntryListener
+  (JNIEnv *, jclass, jint entryListenerUid)
+{
+  nt::RemoveEntryListener(entryListenerUid);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    waitForEntryListenerQueue
+ * Signature: (ID)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_waitForEntryListenerQueue
+  (JNIEnv *, jclass, jint inst, jdouble timeout)
+{
+  return nt::WaitForEntryListenerQueue(inst, timeout);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    createConnectionListenerPoller
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_createConnectionListenerPoller
+  (JNIEnv *, jclass, jint inst)
+{
+  return nt::CreateConnectionListenerPoller(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    destroyConnectionListenerPoller
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_destroyConnectionListenerPoller
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::DestroyConnectionListenerPoller(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    addPolledConnectionListener
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_addPolledConnectionListener
+  (JNIEnv *env, jclass, jint poller, jboolean immediateNotify)
+{
+  return nt::AddPolledConnectionListener(poller, immediateNotify);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollConnectionListener
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;I)[Ledu/wpi/first/networktables/ConnectionNotification;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollConnectionListener
+  (JNIEnv *env, jclass, jobject inst, jint poller)
+{
+  auto events = nt::PollConnectionListener(poller);
+  if (events.empty()) {
+    interruptedEx.Throw(env, "PollConnectionListener interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, events);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollConnectionListenerTimeout
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;ID)[Ledu/wpi/first/networktables/ConnectionNotification;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollConnectionListenerTimeout
+  (JNIEnv *env, jclass, jobject inst, jint poller, jdouble timeout)
+{
+  bool timed_out = false;
+  auto events = nt::PollConnectionListener(poller, timeout, &timed_out);
+  if (events.empty() && !timed_out) {
+    interruptedEx.Throw(env, "PollConnectionListener interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, events);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    cancelPollConnectionListener
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_cancelPollConnectionListener
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::CancelPollConnectionListener(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    removeConnectionListener
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_removeConnectionListener
+  (JNIEnv *, jclass, jint connListenerUid)
+{
+  nt::RemoveConnectionListener(connListenerUid);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    waitForConnectionListenerQueue
+ * Signature: (ID)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_waitForConnectionListenerQueue
+  (JNIEnv *, jclass, jint inst, jdouble timeout)
+{
+  return nt::WaitForConnectionListenerQueue(inst, timeout);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    createRpcCallPoller
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_createRpcCallPoller
+  (JNIEnv *, jclass, jint inst)
+{
+  return nt::CreateRpcCallPoller(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    destroyRpcCallPoller
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_destroyRpcCallPoller
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::DestroyRpcCallPoller(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    createPolledRpc
+ * Signature: (I[BI)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_createPolledRpc
+  (JNIEnv *env, jclass, jint entry, jbyteArray def, jint poller)
+{
+  if (!def) {
+    nullPointerEx.Throw(env, "def cannot be null");
+    return;
+  }
+  nt::CreatePolledRpc(entry, JByteArrayRef{env, def}, poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollRpc
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;I)[Ledu/wpi/first/networktables/RpcAnswer;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollRpc
+  (JNIEnv *env, jclass, jobject inst, jint poller)
+{
+  auto infos = nt::PollRpc(poller);
+  if (infos.empty()) {
+    interruptedEx.Throw(env, "PollRpc interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, infos);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollRpcTimeout
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;ID)[Ledu/wpi/first/networktables/RpcAnswer;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollRpcTimeout
+  (JNIEnv *env, jclass, jobject inst, jint poller, jdouble timeout)
+{
+  bool timed_out = false;
+  auto infos = nt::PollRpc(poller, timeout, &timed_out);
+  if (infos.empty() && !timed_out) {
+    interruptedEx.Throw(env, "PollRpc interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, infos);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    cancelPollRpc
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_cancelPollRpc
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::CancelPollRpc(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    waitForRpcCallQueue
+ * Signature: (ID)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_waitForRpcCallQueue
+  (JNIEnv *, jclass, jint inst, jdouble timeout)
+{
+  return nt::WaitForRpcCallQueue(inst, timeout);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    postRpcResponse
+ * Signature: (II[B)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_postRpcResponse
+  (JNIEnv *env, jclass, jint entry, jint call, jbyteArray result)
+{
+  if (!result) {
+    nullPointerEx.Throw(env, "result cannot be null");
+    return;
+  }
+  nt::PostRpcResponse(entry, call, JByteArrayRef{env, result});
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    callRpc
+ * Signature: (I[B)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_callRpc
+  (JNIEnv *env, jclass, jint entry, jbyteArray params)
+{
+  if (!params) {
+    nullPointerEx.Throw(env, "params cannot be null");
+    return 0;
+  }
+  return nt::CallRpc(entry, JByteArrayRef{env, params});
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getRpcResult
+ * Signature: (II)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getRpcResult__II
+  (JNIEnv *env, jclass, jint entry, jint call)
+{
+  std::string result;
+  if (!nt::GetRpcResult(entry, call, &result)) return nullptr;
+  return MakeJByteArray(env, result);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getRpcResult
+ * Signature: (IID)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getRpcResult__IID
+  (JNIEnv *env, jclass, jint entry, jint call, jdouble timeout)
+{
+  std::string result;
+  bool timed_out = false;
+  if (!nt::GetRpcResult(entry, call, &result, timeout, &timed_out))
+    return nullptr;
+  return MakeJByteArray(env, result);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    cancelRpcResult
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_cancelRpcResult
+  (JNIEnv *, jclass, jint entry, jint call)
+{
+  nt::CancelRpcResult(entry, call);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getRpc
+ * Signature: (I[B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getRpc
+  (JNIEnv *env, jclass, jint entry, jbyteArray defaultValue)
+{
+  auto val = nt::GetEntryValue(entry);
+  if (!val || !val->IsRpc()) return defaultValue;
+  return MakeJByteArray(env, val->GetRpc());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setNetworkIdentity
+ * Signature: (ILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setNetworkIdentity
+  (JNIEnv *env, jclass, jint inst, jstring name)
+{
+  if (!name) {
+    nullPointerEx.Throw(env, "name cannot be null");
+    return;
+  }
+  nt::SetNetworkIdentity(inst, JStringRef{env, name}.str());
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getNetworkMode
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getNetworkMode
+  (JNIEnv *, jclass, jint inst)
+{
+  return nt::GetNetworkMode(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    startServer
+ * Signature: (ILjava/lang/String;Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_startServer
+  (JNIEnv *env, jclass, jint inst, jstring persistFilename, jstring listenAddress, jint port)
+{
+  if (!persistFilename) {
+    nullPointerEx.Throw(env, "persistFilename cannot be null");
+    return;
+  }
+  if (!listenAddress) {
+    nullPointerEx.Throw(env, "listenAddress cannot be null");
+    return;
+  }
+  nt::StartServer(inst, JStringRef{env, persistFilename}.str(),
+                  JStringRef{env, listenAddress}.c_str(), port);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    stopServer
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_stopServer
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::StopServer(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    startClient
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_startClient__I
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::StartClient(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    startClient
+ * Signature: (ILjava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_startClient__ILjava_lang_String_2I
+  (JNIEnv *env, jclass, jint inst, jstring serverName, jint port)
+{
+  if (!serverName) {
+    nullPointerEx.Throw(env, "serverName cannot be null");
+    return;
+  }
+  nt::StartClient(inst, JStringRef{env, serverName}.c_str(), port);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    startClient
+ * Signature: (I[Ljava/lang/String;[I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_startClient__I_3Ljava_lang_String_2_3I
+  (JNIEnv *env, jclass, jint inst, jobjectArray serverNames, jintArray ports)
+{
+  if (!serverNames) {
+    nullPointerEx.Throw(env, "serverNames cannot be null");
+    return;
+  }
+  if (!ports) {
+    nullPointerEx.Throw(env, "ports cannot be null");
+    return;
+  }
+  int len = env->GetArrayLength(serverNames);
+  if (len != env->GetArrayLength(ports)) {
+    illegalArgEx.Throw(env,
+                       "serverNames and ports arrays must be the same size");
+    return;
+  }
+  jint* portInts = env->GetIntArrayElements(ports, nullptr);
+  if (!portInts) return;
+
+  std::vector<std::string> names;
+  std::vector<std::pair<nt::StringRef, unsigned int>> servers;
+  names.reserve(len);
+  servers.reserve(len);
+  for (int i = 0; i < len; ++i) {
+    JLocal<jstring> elem{
+        env, static_cast<jstring>(env->GetObjectArrayElement(serverNames, i))};
+    if (!elem) {
+      nullPointerEx.Throw(env, "null string in serverNames");
+      return;
+    }
+    names.emplace_back(JStringRef{env, elem}.str());
+    servers.emplace_back(std::make_pair(nt::StringRef(names.back()),
+                                        portInts[i]));
+  }
+  env->ReleaseIntArrayElements(ports, portInts, JNI_ABORT);
+  nt::StartClient(inst, servers);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    startClientTeam
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_startClientTeam
+  (JNIEnv *env, jclass cls, jint inst, jint team, jint port)
+{
+  nt::StartClientTeam(inst, team, port);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    stopClient
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_stopClient
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::StopClient(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setServer
+ * Signature: (ILjava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setServer__ILjava_lang_String_2I
+  (JNIEnv *env, jclass, jint inst, jstring serverName, jint port)
+{
+  if (!serverName) {
+    nullPointerEx.Throw(env, "serverName cannot be null");
+    return;
+  }
+  nt::SetServer(inst, JStringRef{env, serverName}.c_str(), port);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setServer
+ * Signature: (I[Ljava/lang/String;[I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setServer__I_3Ljava_lang_String_2_3I
+  (JNIEnv *env, jclass, jint inst, jobjectArray serverNames, jintArray ports)
+{
+  if (!serverNames) {
+    nullPointerEx.Throw(env, "serverNames cannot be null");
+    return;
+  }
+  if (!ports) {
+    nullPointerEx.Throw(env, "ports cannot be null");
+    return;
+  }
+  int len = env->GetArrayLength(serverNames);
+  if (len != env->GetArrayLength(ports)) {
+    illegalArgEx.Throw(env,
+                       "serverNames and ports arrays must be the same size");
+    return;
+  }
+  jint* portInts = env->GetIntArrayElements(ports, nullptr);
+  if (!portInts) return;
+
+  std::vector<std::string> names;
+  std::vector<std::pair<nt::StringRef, unsigned int>> servers;
+  names.reserve(len);
+  servers.reserve(len);
+  for (int i = 0; i < len; ++i) {
+    JLocal<jstring> elem{
+        env, static_cast<jstring>(env->GetObjectArrayElement(serverNames, i))};
+    if (!elem) {
+      nullPointerEx.Throw(env, "null string in serverNames");
+      return;
+    }
+    names.emplace_back(JStringRef{env, elem}.str());
+    servers.emplace_back(std::make_pair(nt::StringRef(names.back()),
+                                        portInts[i]));
+  }
+  env->ReleaseIntArrayElements(ports, portInts, JNI_ABORT);
+  nt::SetServer(inst, servers);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setServerTeam
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setServerTeam
+  (JNIEnv *env, jclass, jint inst, jint team, jint port)
+{
+  nt::SetServerTeam(inst, team, port);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    startDSClient
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_startDSClient
+  (JNIEnv *, jclass, jint inst, jint port)
+{
+  nt::StartDSClient(inst, port);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    stopDSClient
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_stopDSClient
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::StopDSClient(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    setUpdateRate
+ * Signature: (ID)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_setUpdateRate
+  (JNIEnv *, jclass, jint inst, jdouble interval)
+{
+  nt::SetUpdateRate(inst, interval);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    flush
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_flush
+  (JNIEnv *, jclass, jint inst)
+{
+  nt::Flush(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    getConnections
+ * Signature: (I)[Ledu/wpi/first/networktables/ConnectionInfo;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_getConnections
+  (JNIEnv *env, jclass, jint inst)
+{
+  auto arr = nt::GetConnections(inst);
+  jobjectArray jarr =
+      env->NewObjectArray(arr.size(), connectionInfoCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jobject> jelem{env, MakeJObject(env, arr[i])};
+    env->SetObjectArrayElement(jarr, i, jelem);
+  }
+  return jarr;
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    isConnected
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_isConnected
+  (JNIEnv *, jclass, jint inst)
+{
+  return nt::IsConnected(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    savePersistent
+ * Signature: (ILjava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_savePersistent
+  (JNIEnv *env, jclass, jint inst, jstring filename)
+{
+  if (!filename) {
+    nullPointerEx.Throw(env, "filename cannot be null");
+    return;
+  }
+  const char *err = nt::SavePersistent(inst, JStringRef{env, filename}.str());
+  if (err) persistentEx.Throw(env, err);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    loadPersistent
+ * Signature: (ILjava/lang/String;)[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_loadPersistent
+  (JNIEnv *env, jclass, jint inst, jstring filename)
+{
+  if (!filename) {
+    nullPointerEx.Throw(env, "filename cannot be null");
+    return nullptr;
+  }
+  std::vector<std::string> warns;
+  const char* err = nt::LoadPersistent(inst, JStringRef{env, filename}.str(),
+                                       [&](size_t line, const char* msg) {
+                                         llvm::SmallString<128> warn;
+                                         llvm::raw_svector_ostream oss(warn);
+                                         oss << line << ": " << msg;
+                                         warns.emplace_back(oss.str());
+                                       });
+  if (err) {
+    persistentEx.Throw(env, err);
+    return nullptr;
+  }
+  return MakeJStringArray(env, warns);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    saveEntries
+ * Signature: (ILjava/lang/String;Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_saveEntries
+  (JNIEnv *env, jclass, jint inst, jstring filename, jstring prefix)
+{
+  if (!filename) {
+    nullPointerEx.Throw(env, "filename cannot be null");
+    return;
+  }
+  if (!prefix) {
+    nullPointerEx.Throw(env, "prefix cannot be null");
+    return;
+  }
+  const char* err = nt::SaveEntries(inst, JStringRef{env, filename}.str(),
+                                    JStringRef{env, prefix}.str());
+  if (err) persistentEx.Throw(env, err);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    loadEntries
+ * Signature: (ILjava/lang/String;Ljava/lang/String;)[Ljava/lang/String;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_loadEntries
+  (JNIEnv *env, jclass, jint inst, jstring filename, jstring prefix)
+{
+  if (!filename) {
+    nullPointerEx.Throw(env, "filename cannot be null");
+    return nullptr;
+  }
+  if (!prefix) {
+    nullPointerEx.Throw(env, "prefix cannot be null");
+    return nullptr;
+  }
+  std::vector<std::string> warns;
+  const char* err = nt::LoadEntries(inst, JStringRef{env, filename}.str(),
+                                    JStringRef{env, prefix}.str(),
+                                    [&](size_t line, const char* msg) {
+                                      llvm::SmallString<128> warn;
+                                      llvm::raw_svector_ostream oss(warn);
+                                      oss << line << ": " << msg;
+                                      warns.emplace_back(oss.str());
+                                    });
+  if (err) {
+    persistentEx.Throw(env, err);
+    return nullptr;
+  }
+  return MakeJStringArray(env, warns);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    now
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_now
+  (JNIEnv *, jclass)
+{
+  return nt::Now();
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    createLoggerPoller
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_createLoggerPoller
+  (JNIEnv *, jclass, jint inst)
+{
+  return nt::CreateLoggerPoller(inst);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    destroyLoggerPoller
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_destroyLoggerPoller
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::DestroyLoggerPoller(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    addPolledLogger
+ * Signature: (III)I
+ */
+JNIEXPORT jint JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_addPolledLogger
+  (JNIEnv *, jclass, jint poller, jint minLevel, jint maxLevel)
+{
+  return nt::AddPolledLogger(poller, minLevel, maxLevel);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollLogger
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;I)[Ledu/wpi/first/networktables/LogMessage;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollLogger
+  (JNIEnv *env, jclass, jobject inst, jint poller)
+{
+  auto events = nt::PollLogger(poller);
+  if (events.empty()) {
+    interruptedEx.Throw(env, "PollLogger interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, events);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    pollLogger
+ * Signature: (Ledu/wpi/first/networktables/NetworkTableInstance;ID)[Ledu/wpi/first/networktables/LogMessage;
+ */
+JNIEXPORT jobjectArray JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_pollLoggerTimeout
+  (JNIEnv *env, jclass, jobject inst, jint poller, jdouble timeout)
+{
+  bool timed_out = false;
+  auto events = nt::PollLogger(poller, timeout, &timed_out);
+  if (events.empty() && !timed_out) {
+    interruptedEx.Throw(env, "PollLogger interrupted");
+    return nullptr;
+  }
+  return MakeJObject(env, inst, events);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    cancelPollLogger
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_cancelPollLogger
+  (JNIEnv *, jclass, jint poller)
+{
+  nt::CancelPollLogger(poller);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    removeLogger
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_removeLogger
+  (JNIEnv *, jclass, jint logger)
+{
+  nt::RemoveLogger(logger);
+}
+
+/*
+ * Class:     edu_wpi_first_networktables_NetworkTablesJNI
+ * Method:    waitForLoggerQueue
+ * Signature: (ID)Z
+ */
+JNIEXPORT jboolean JNICALL Java_edu_wpi_first_networktables_NetworkTablesJNI_waitForLoggerQueue
+  (JNIEnv *, jclass, jint inst, jdouble timeout)
+{
+  return nt::WaitForLoggerQueue(inst, timeout);
+}
+
+}  // extern "C"
diff --git a/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTable.cpp b/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTable.cpp
new file mode 100644
index 0000000..3414bff
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTable.cpp
@@ -0,0 +1,527 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "networktables/NetworkTable.h"
+
+#include <algorithm>
+
+#include <llvm/SmallString.h>
+#include <llvm/StringMap.h>
+#include <llvm/raw_ostream.h>
+
+#include "networktables/NetworkTableInstance.h"
+#include "ntcore.h"
+#include "tables/ITableListener.h"
+
+using namespace nt;
+
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+const char NetworkTable::PATH_SEPARATOR_CHAR = '/';
+std::string NetworkTable::s_persistent_filename = "networktables.ini";
+bool NetworkTable::s_client = false;
+bool NetworkTable::s_enable_ds = true;
+bool NetworkTable::s_running = false;
+unsigned int NetworkTable::s_port = NT_DEFAULT_PORT;
+
+StringRef NetworkTable::BasenameKey(StringRef key) {
+  size_t slash = key.rfind(PATH_SEPARATOR_CHAR);
+  if (slash == StringRef::npos) return key;
+  return key.substr(slash + 1);
+}
+
+std::string NetworkTable::NormalizeKey(const Twine& key,
+                                       bool withLeadingSlash) {
+  llvm::SmallString<128> buf;
+  return NormalizeKey(key, buf, withLeadingSlash);
+}
+
+StringRef NetworkTable::NormalizeKey(const Twine& key,
+                                     llvm::SmallVectorImpl<char>& buf,
+                                     bool withLeadingSlash) {
+  buf.clear();
+  if (withLeadingSlash) buf.push_back(PATH_SEPARATOR_CHAR);
+  // for each path element, add it with a slash following
+  llvm::SmallString<128> keyBuf;
+  StringRef keyStr = key.toStringRef(keyBuf);
+  llvm::SmallVector<StringRef, 16> parts;
+  keyStr.split(parts, PATH_SEPARATOR_CHAR, -1, false);
+  for (auto i = parts.begin(); i != parts.end(); ++i) {
+    buf.append(i->begin(), i->end());
+    buf.push_back(PATH_SEPARATOR_CHAR);
+  }
+  // remove trailing slash if the input key didn't have one
+  if (!keyStr.empty() && keyStr.back() != PATH_SEPARATOR_CHAR) buf.pop_back();
+  return StringRef(buf.data(), buf.size());
+}
+
+std::vector<std::string> NetworkTable::GetHierarchy(const Twine& key) {
+  std::vector<std::string> hierarchy;
+  hierarchy.emplace_back(1, PATH_SEPARATOR_CHAR);
+  // for each path element, add it to the end of what we built previously
+  llvm::SmallString<128> keyBuf;
+  StringRef keyStr = key.toStringRef(keyBuf);
+  llvm::SmallString<128> path;
+  llvm::SmallVector<StringRef, 16> parts;
+  keyStr.split(parts, PATH_SEPARATOR_CHAR, -1, false);
+  if (!parts.empty()) {
+    for (auto i = parts.begin(); i != parts.end(); ++i) {
+      path += PATH_SEPARATOR_CHAR;
+      path += *i;
+      hierarchy.emplace_back(path.str());
+    }
+    // handle trailing slash
+    if (keyStr.back() == PATH_SEPARATOR_CHAR) {
+      path += PATH_SEPARATOR_CHAR;
+      hierarchy.emplace_back(path.str());
+    }
+  }
+  return hierarchy;
+}
+
+void NetworkTable::Initialize() {
+  if (s_running) Shutdown();
+  auto inst = NetworkTableInstance::GetDefault();
+  if (s_client) {
+    inst.StartClient();
+    if (s_enable_ds) inst.StartDSClient(s_port);
+  } else {
+    inst.StartServer(s_persistent_filename, "", s_port);
+  }
+  s_running = true;
+}
+
+void NetworkTable::Shutdown() {
+  if (!s_running) return;
+  auto inst = NetworkTableInstance::GetDefault();
+  if (s_client) {
+    inst.StopDSClient();
+    inst.StopClient();
+  } else {
+    inst.StopServer();
+  }
+  s_running = false;
+}
+
+void NetworkTable::SetClientMode() { s_client = true; }
+
+void NetworkTable::SetServerMode() { s_client = false; }
+
+void NetworkTable::SetTeam(int team) {
+  auto inst = NetworkTableInstance::GetDefault();
+  inst.SetServerTeam(team, s_port);
+  if (s_enable_ds) inst.StartDSClient(s_port);
+}
+
+void NetworkTable::SetIPAddress(StringRef address) {
+  auto inst = NetworkTableInstance::GetDefault();
+  llvm::SmallString<32> addr_copy{address};
+  inst.SetServer(addr_copy.c_str(), s_port);
+
+  // Stop the DS client if we're explicitly connecting to localhost
+  if (address == "localhost" || address == "127.0.0.1")
+    inst.StopDSClient();
+  else if (s_enable_ds)
+    inst.StartDSClient(s_port);
+}
+
+void NetworkTable::SetIPAddress(ArrayRef<std::string> addresses) {
+  auto inst = NetworkTableInstance::GetDefault();
+  llvm::SmallVector<StringRef, 8> servers;
+  for (const auto& ip_address : addresses) servers.emplace_back(ip_address);
+  inst.SetServer(servers, s_port);
+
+  // Stop the DS client if we're explicitly connecting to localhost
+  if (!addresses.empty() &&
+      (addresses[0] == "localhost" || addresses[0] == "127.0.0.1"))
+    inst.StopDSClient();
+  else if (s_enable_ds)
+    inst.StartDSClient(s_port);
+}
+
+void NetworkTable::SetPort(unsigned int port) { s_port = port; }
+
+void NetworkTable::SetDSClientEnabled(bool enabled) {
+  auto inst = NetworkTableInstance::GetDefault();
+  s_enable_ds = enabled;
+  if (s_enable_ds)
+    inst.StartDSClient(s_port);
+  else
+    inst.StopDSClient();
+}
+
+void NetworkTable::SetPersistentFilename(StringRef filename) {
+  s_persistent_filename = filename;
+}
+
+void NetworkTable::SetNetworkIdentity(StringRef name) {
+  NetworkTableInstance::GetDefault().SetNetworkIdentity(name);
+}
+
+void NetworkTable::GlobalDeleteAll() {
+  NetworkTableInstance::GetDefault().DeleteAllEntries();
+}
+
+void NetworkTable::Flush() { NetworkTableInstance::GetDefault().Flush(); }
+
+void NetworkTable::SetUpdateRate(double interval) {
+  NetworkTableInstance::GetDefault().SetUpdateRate(interval);
+}
+
+const char* NetworkTable::SavePersistent(StringRef filename) {
+  return NetworkTableInstance::GetDefault().SavePersistent(filename);
+}
+
+const char* NetworkTable::LoadPersistent(
+    StringRef filename,
+    std::function<void(size_t line, const char* msg)> warn) {
+  return NetworkTableInstance::GetDefault().LoadPersistent(filename, warn);
+}
+
+std::shared_ptr<NetworkTable> NetworkTable::GetTable(StringRef key) {
+  if (!s_running) Initialize();
+  return NetworkTableInstance::GetDefault().GetTable(key);
+}
+
+NetworkTable::NetworkTable(NT_Inst inst, const Twine& path, const private_init&)
+    : m_inst(inst), m_path(path.str()) {}
+
+NetworkTable::~NetworkTable() {
+  for (auto& i : m_listeners) RemoveEntryListener(i.second);
+}
+
+NetworkTableInstance NetworkTable::GetInstance() const {
+  return NetworkTableInstance{m_inst};
+}
+
+NetworkTableEntry NetworkTable::GetEntry(const Twine& key) const {
+  llvm::SmallString<128> keyBuf;
+  StringRef keyStr = key.toStringRef(keyBuf);
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  NT_Entry& entry = m_entries[keyStr];
+  if (entry == 0) {
+    entry = nt::GetEntry(m_inst, m_path + Twine(PATH_SEPARATOR_CHAR) + keyStr);
+  }
+  return NetworkTableEntry{entry};
+}
+
+NT_EntryListener NetworkTable::AddEntryListener(TableEntryListener listener,
+                                                unsigned int flags) const {
+  size_t prefix_len = m_path.size() + 1;
+  return nt::AddEntryListener(
+      m_inst, m_path + Twine(PATH_SEPARATOR_CHAR),
+      [=](const EntryNotification& event) {
+        StringRef relative_key = event.name.substr(prefix_len);
+        if (relative_key.find(PATH_SEPARATOR_CHAR) != StringRef::npos) return;
+        listener(const_cast<NetworkTable*>(this), relative_key,
+                 NetworkTableEntry{event.entry}, event.value, event.flags);
+      },
+      flags);
+}
+
+NT_EntryListener NetworkTable::AddEntryListener(const Twine& key,
+                                                TableEntryListener listener,
+                                                unsigned int flags) const {
+  size_t prefix_len = m_path.size() + 1;
+  auto entry = GetEntry(key);
+  return nt::AddEntryListener(entry.GetHandle(),
+                              [=](const EntryNotification& event) {
+                                listener(const_cast<NetworkTable*>(this),
+                                         event.name.substr(prefix_len), entry,
+                                         event.value, event.flags);
+                              },
+                              flags);
+}
+
+void NetworkTable::RemoveEntryListener(NT_EntryListener listener) const {
+  nt::RemoveEntryListener(listener);
+}
+
+void NetworkTable::AddTableListener(ITableListener* listener) {
+  AddTableListenerEx(listener, NT_NOTIFY_NEW | NT_NOTIFY_UPDATE);
+}
+
+void NetworkTable::AddTableListener(ITableListener* listener,
+                                    bool immediateNotify) {
+  unsigned int flags = NT_NOTIFY_NEW | NT_NOTIFY_UPDATE;
+  if (immediateNotify) flags |= NT_NOTIFY_IMMEDIATE;
+  AddTableListenerEx(listener, flags);
+}
+
+void NetworkTable::AddTableListenerEx(ITableListener* listener,
+                                      unsigned int flags) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  llvm::SmallString<128> path(m_path);
+  path += PATH_SEPARATOR_CHAR;
+  size_t prefix_len = path.size();
+  NT_EntryListener id = nt::AddEntryListener(
+      m_inst, path,
+      [=](const EntryNotification& event) {
+        StringRef relative_key = event.name.substr(prefix_len);
+        if (relative_key.find(PATH_SEPARATOR_CHAR) != StringRef::npos) return;
+        listener->ValueChangedEx(this, relative_key, event.value, event.flags);
+      },
+      flags);
+  m_listeners.emplace_back(listener, id);
+}
+
+void NetworkTable::AddTableListener(StringRef key, ITableListener* listener,
+                                    bool immediateNotify) {
+  unsigned int flags = NT_NOTIFY_NEW | NT_NOTIFY_UPDATE;
+  if (immediateNotify) flags |= NT_NOTIFY_IMMEDIATE;
+  AddTableListenerEx(key, listener, flags);
+}
+
+void NetworkTable::AddTableListenerEx(StringRef key, ITableListener* listener,
+                                      unsigned int flags) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  size_t prefix_len = m_path.size() + 1;
+  auto entry = GetEntry(key);
+  NT_EntryListener id = nt::AddEntryListener(
+      entry.GetHandle(),
+      [=](const EntryNotification& event) {
+        listener->ValueChangedEx(this, event.name.substr(prefix_len),
+                                 event.value, event.flags);
+      },
+      flags);
+  m_listeners.emplace_back(listener, id);
+}
+
+void NetworkTable::AddSubTableListener(ITableListener* listener) {
+  AddSubTableListener(listener, false);
+}
+
+void NetworkTable::AddSubTableListener(ITableListener* listener,
+                                       bool localNotify) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  size_t prefix_len = m_path.size() + 1;
+
+  // The lambda needs to be copyable, but StringMap is not, so use
+  // a shared_ptr to it.
+  auto notified_tables = std::make_shared<llvm::StringMap<char>>();
+
+  unsigned int flags = NT_NOTIFY_NEW | NT_NOTIFY_IMMEDIATE;
+  if (localNotify) flags |= NT_NOTIFY_LOCAL;
+  NT_EntryListener id = nt::AddEntryListener(
+      m_inst, m_path + Twine(PATH_SEPARATOR_CHAR),
+      [=](const EntryNotification& event) {
+        StringRef relative_key = event.name.substr(prefix_len);
+        auto end_sub_table = relative_key.find(PATH_SEPARATOR_CHAR);
+        if (end_sub_table == StringRef::npos) return;
+        StringRef sub_table_key = relative_key.substr(0, end_sub_table);
+        if (notified_tables->find(sub_table_key) == notified_tables->end())
+          return;
+        notified_tables->insert(std::make_pair(sub_table_key, '\0'));
+        listener->ValueChangedEx(this, sub_table_key, nullptr, event.flags);
+      },
+      flags);
+  m_listeners.emplace_back(listener, id);
+}
+
+void NetworkTable::RemoveTableListener(ITableListener* listener) {
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  auto matches_begin =
+      std::remove_if(m_listeners.begin(), m_listeners.end(),
+                     [=](const Listener& x) { return x.first == listener; });
+
+  for (auto i = matches_begin; i != m_listeners.end(); ++i)
+    RemoveEntryListener(i->second);
+  m_listeners.erase(matches_begin, m_listeners.end());
+}
+
+std::shared_ptr<NetworkTable> NetworkTable::GetSubTable(
+    const Twine& key) const {
+  return std::make_shared<NetworkTable>(
+      m_inst, m_path + Twine(PATH_SEPARATOR_CHAR) + key, private_init{});
+}
+
+bool NetworkTable::ContainsKey(const Twine& key) const {
+  if (key.isTriviallyEmpty() ||
+      (key.isSingleStringRef() && key.getSingleStringRef().empty()))
+    return false;
+  return GetEntry(key).Exists();
+}
+
+bool NetworkTable::ContainsSubTable(const Twine& key) const {
+  return !GetEntryInfo(m_inst,
+                       m_path + Twine(PATH_SEPARATOR_CHAR) + key +
+                           Twine(PATH_SEPARATOR_CHAR),
+                       0)
+              .empty();
+}
+
+std::vector<std::string> NetworkTable::GetKeys(int types) const {
+  std::vector<std::string> keys;
+  size_t prefix_len = m_path.size() + 1;
+  auto infos = GetEntryInfo(m_inst, m_path + Twine(PATH_SEPARATOR_CHAR), types);
+  std::lock_guard<wpi::mutex> lock(m_mutex);
+  for (auto& info : infos) {
+    auto relative_key = StringRef(info.name).substr(prefix_len);
+    if (relative_key.find(PATH_SEPARATOR_CHAR) != StringRef::npos) continue;
+    keys.push_back(relative_key);
+    m_entries[relative_key] = info.entry;
+  }
+  return keys;
+}
+
+std::vector<std::string> NetworkTable::GetSubTables() const {
+  std::vector<std::string> keys;
+  size_t prefix_len = m_path.size() + 1;
+  for (auto& entry :
+       GetEntryInfo(m_inst, m_path + Twine(PATH_SEPARATOR_CHAR), 0)) {
+    auto relative_key = StringRef(entry.name).substr(prefix_len);
+    size_t end_subtable = relative_key.find(PATH_SEPARATOR_CHAR);
+    if (end_subtable == StringRef::npos) continue;
+    keys.push_back(relative_key.substr(0, end_subtable));
+  }
+  return keys;
+}
+
+void NetworkTable::SetPersistent(StringRef key) {
+  GetEntry(key).SetPersistent();
+}
+
+void NetworkTable::ClearPersistent(StringRef key) {
+  GetEntry(key).ClearPersistent();
+}
+
+bool NetworkTable::IsPersistent(StringRef key) const {
+  return GetEntry(key).IsPersistent();
+}
+
+void NetworkTable::SetFlags(StringRef key, unsigned int flags) {
+  GetEntry(key).SetFlags(flags);
+}
+
+void NetworkTable::ClearFlags(StringRef key, unsigned int flags) {
+  GetEntry(key).ClearFlags(flags);
+}
+
+unsigned int NetworkTable::GetFlags(StringRef key) const {
+  return GetEntry(key).GetFlags();
+}
+
+void NetworkTable::Delete(const Twine& key) { GetEntry(key).Delete(); }
+
+bool NetworkTable::PutNumber(StringRef key, double value) {
+  return GetEntry(key).SetDouble(value);
+}
+
+bool NetworkTable::SetDefaultNumber(StringRef key, double defaultValue) {
+  return GetEntry(key).SetDefaultDouble(defaultValue);
+}
+
+double NetworkTable::GetNumber(StringRef key, double defaultValue) const {
+  return GetEntry(key).GetDouble(defaultValue);
+}
+
+bool NetworkTable::PutString(StringRef key, StringRef value) {
+  return GetEntry(key).SetString(value);
+}
+
+bool NetworkTable::SetDefaultString(StringRef key, StringRef defaultValue) {
+  return GetEntry(key).SetDefaultString(defaultValue);
+}
+
+std::string NetworkTable::GetString(StringRef key,
+                                    StringRef defaultValue) const {
+  return GetEntry(key).GetString(defaultValue);
+}
+
+bool NetworkTable::PutBoolean(StringRef key, bool value) {
+  return GetEntry(key).SetBoolean(value);
+}
+
+bool NetworkTable::SetDefaultBoolean(StringRef key, bool defaultValue) {
+  return GetEntry(key).SetDefaultBoolean(defaultValue);
+}
+
+bool NetworkTable::GetBoolean(StringRef key, bool defaultValue) const {
+  return GetEntry(key).GetBoolean(defaultValue);
+}
+
+bool NetworkTable::PutBooleanArray(StringRef key, ArrayRef<int> value) {
+  return GetEntry(key).SetBooleanArray(value);
+}
+
+bool NetworkTable::SetDefaultBooleanArray(StringRef key,
+                                          ArrayRef<int> defaultValue) {
+  return GetEntry(key).SetDefaultBooleanArray(defaultValue);
+}
+
+std::vector<int> NetworkTable::GetBooleanArray(
+    StringRef key, ArrayRef<int> defaultValue) const {
+  return GetEntry(key).GetBooleanArray(defaultValue);
+}
+
+bool NetworkTable::PutNumberArray(StringRef key, ArrayRef<double> value) {
+  return GetEntry(key).SetDoubleArray(value);
+}
+
+bool NetworkTable::SetDefaultNumberArray(StringRef key,
+                                         ArrayRef<double> defaultValue) {
+  return GetEntry(key).SetDefaultDoubleArray(defaultValue);
+}
+
+std::vector<double> NetworkTable::GetNumberArray(
+    StringRef key, ArrayRef<double> defaultValue) const {
+  return GetEntry(key).GetDoubleArray(defaultValue);
+}
+
+bool NetworkTable::PutStringArray(StringRef key, ArrayRef<std::string> value) {
+  return GetEntry(key).SetStringArray(value);
+}
+
+bool NetworkTable::SetDefaultStringArray(StringRef key,
+                                         ArrayRef<std::string> defaultValue) {
+  return GetEntry(key).SetDefaultStringArray(defaultValue);
+}
+
+std::vector<std::string> NetworkTable::GetStringArray(
+    StringRef key, ArrayRef<std::string> defaultValue) const {
+  return GetEntry(key).GetStringArray(defaultValue);
+}
+
+bool NetworkTable::PutRaw(StringRef key, StringRef value) {
+  return GetEntry(key).SetRaw(value);
+}
+
+bool NetworkTable::SetDefaultRaw(StringRef key, StringRef defaultValue) {
+  return GetEntry(key).SetDefaultRaw(defaultValue);
+}
+
+std::string NetworkTable::GetRaw(StringRef key, StringRef defaultValue) const {
+  return GetEntry(key).GetRaw(defaultValue);
+}
+
+bool NetworkTable::PutValue(const Twine& key, std::shared_ptr<Value> value) {
+  return GetEntry(key).SetValue(value);
+}
+
+bool NetworkTable::SetDefaultValue(const Twine& key,
+                                   std::shared_ptr<Value> defaultValue) {
+  return GetEntry(key).SetDefaultValue(defaultValue);
+}
+
+std::shared_ptr<Value> NetworkTable::GetValue(const Twine& key) const {
+  return GetEntry(key).GetValue();
+}
+
+StringRef NetworkTable::GetPath() const { return m_path; }
+
+const char* NetworkTable::SaveEntries(const Twine& filename) const {
+  return nt::SaveEntries(m_inst, filename, m_path + Twine(PATH_SEPARATOR_CHAR));
+}
+
+const char* NetworkTable::LoadEntries(
+    const Twine& filename,
+    std::function<void(size_t line, const char* msg)> warn) {
+  return nt::LoadEntries(m_inst, filename, m_path + Twine(PATH_SEPARATOR_CHAR),
+                         warn);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTableEntry.cpp b/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTableEntry.cpp
new file mode 100644
index 0000000..424d512
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTableEntry.cpp
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "networktables/NetworkTableEntry.h"
+
+#include "networktables/NetworkTableInstance.h"
+
+using namespace nt;
+
+NetworkTableInstance NetworkTableEntry::GetInstance() const {
+  return NetworkTableInstance{GetInstanceFromHandle(m_handle)};
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTableInstance.cpp b/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTableInstance.cpp
new file mode 100644
index 0000000..e01dade
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/networktables/NetworkTableInstance.cpp
@@ -0,0 +1,59 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "networktables/NetworkTableInstance.h"
+
+#include <llvm/SmallString.h>
+
+using namespace nt;
+
+std::shared_ptr<NetworkTable> NetworkTableInstance::GetTable(
+    const Twine& key) const {
+  StringRef simple;
+  bool isSimple = key.isSingleStringRef();
+  if (isSimple) simple = key.getSingleStringRef();
+  if (isSimple && (simple.empty() || simple == "/")) {
+    return std::make_shared<NetworkTable>(m_handle, "",
+                                          NetworkTable::private_init{});
+  } else if (isSimple && simple[0] == NetworkTable::PATH_SEPARATOR_CHAR) {
+    return std::make_shared<NetworkTable>(m_handle, key,
+                                          NetworkTable::private_init{});
+  } else {
+    return std::make_shared<NetworkTable>(
+        m_handle, Twine(NetworkTable::PATH_SEPARATOR_CHAR) + key,
+        NetworkTable::private_init{});
+  }
+}
+
+void NetworkTableInstance::StartClient(ArrayRef<StringRef> servers,
+                                       unsigned int port) {
+  llvm::SmallVector<std::pair<StringRef, unsigned int>, 8> server_ports;
+  for (const auto& server : servers)
+    server_ports.emplace_back(std::make_pair(server, port));
+  StartClient(server_ports);
+}
+
+void NetworkTableInstance::SetServer(ArrayRef<StringRef> servers,
+                                     unsigned int port) {
+  llvm::SmallVector<std::pair<StringRef, unsigned int>, 8> server_ports;
+  for (const auto& server : servers)
+    server_ports.emplace_back(std::make_pair(server, port));
+  SetServer(server_ports);
+}
+
+NT_EntryListener NetworkTableInstance::AddEntryListener(
+    const Twine& prefix,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags) const {
+  return ::nt::AddEntryListener(m_handle, prefix, callback, flags);
+}
+
+NT_ConnectionListener NetworkTableInstance::AddConnectionListener(
+    std::function<void(const ConnectionNotification& event)> callback,
+    bool immediate_notify) const {
+  return ::nt::AddConnectionListener(m_handle, callback, immediate_notify);
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/networktables/RpcCall.cpp b/third_party/ntcore_2018/src/main/native/cpp/networktables/RpcCall.cpp
new file mode 100644
index 0000000..88c74fd
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/networktables/RpcCall.cpp
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "networktables/RpcCall.h"
+
+#include "networktables/NetworkTableEntry.h"
+
+using namespace nt;
+
+NetworkTableEntry RpcCall::GetEntry() const {
+  return NetworkTableEntry{m_entry};
+}
diff --git a/third_party/ntcore_2018/src/main/native/cpp/ntcore_c.cpp b/third_party/ntcore_2018/src/main/native/cpp/ntcore_c.cpp
new file mode 100644
index 0000000..35ebbc5
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/ntcore_c.cpp
@@ -0,0 +1,1165 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <stdint.h>
+
+#include <cassert>
+#include <cstdlib>
+
+#include <support/timestamp.h>
+
+#include "Value_internal.h"
+#include "ntcore.h"
+
+using namespace nt;
+
+// Conversion helpers
+
+static void ConvertToC(llvm::StringRef in, char** out) {
+  *out = static_cast<char*>(std::malloc(in.size() + 1));
+  std::memmove(*out, in.data(), in.size());
+  (*out)[in.size()] = '\0';
+}
+
+static void ConvertToC(const EntryInfo& in, NT_EntryInfo* out) {
+  out->entry = in.entry;
+  ConvertToC(in.name, &out->name);
+  out->type = in.type;
+  out->flags = in.flags;
+  out->last_change = in.last_change;
+}
+
+static void ConvertToC(const ConnectionInfo& in, NT_ConnectionInfo* out) {
+  ConvertToC(in.remote_id, &out->remote_id);
+  ConvertToC(in.remote_ip, &out->remote_ip);
+  out->remote_port = in.remote_port;
+  out->last_update = in.last_update;
+  out->protocol_version = in.protocol_version;
+}
+
+static void ConvertToC(const RpcParamDef& in, NT_RpcParamDef* out) {
+  ConvertToC(in.name, &out->name);
+  ConvertToC(*in.def_value, &out->def_value);
+}
+
+static void ConvertToC(const RpcResultDef& in, NT_RpcResultDef* out) {
+  ConvertToC(in.name, &out->name);
+  out->type = in.type;
+}
+
+static void ConvertToC(const RpcDefinition& in, NT_RpcDefinition* out) {
+  out->version = in.version;
+  ConvertToC(in.name, &out->name);
+
+  out->num_params = in.params.size();
+  out->params = static_cast<NT_RpcParamDef*>(
+      std::malloc(in.params.size() * sizeof(NT_RpcParamDef)));
+  for (size_t i = 0; i < in.params.size(); ++i)
+    ConvertToC(in.params[i], &out->params[i]);
+
+  out->num_results = in.results.size();
+  out->results = static_cast<NT_RpcResultDef*>(
+      std::malloc(in.results.size() * sizeof(NT_RpcResultDef)));
+  for (size_t i = 0; i < in.results.size(); ++i)
+    ConvertToC(in.results[i], &out->results[i]);
+}
+
+static void ConvertToC(const RpcAnswer& in, NT_RpcAnswer* out) {
+  out->entry = in.entry;
+  out->call = in.call;
+  ConvertToC(in.name, &out->name);
+  ConvertToC(in.params, &out->params);
+  ConvertToC(in.conn, &out->conn);
+}
+
+static void ConvertToC(const EntryNotification& in, NT_EntryNotification* out) {
+  out->listener = in.listener;
+  out->entry = in.entry;
+  ConvertToC(in.name, &out->name);
+  ConvertToC(*in.value, &out->value);
+  out->flags = in.flags;
+}
+
+static void ConvertToC(const ConnectionNotification& in,
+                       NT_ConnectionNotification* out) {
+  out->listener = in.listener;
+  out->connected = in.connected;
+  ConvertToC(in.conn, &out->conn);
+}
+
+static void ConvertToC(const LogMessage& in, NT_LogMessage* out) {
+  out->logger = in.logger;
+  out->level = in.level;
+  out->filename = in.filename;
+  out->line = in.line;
+  ConvertToC(in.message, &out->message);
+}
+
+template <typename I, typename O>
+static void ConvertToC(const std::vector<I>& in, O** out, size_t* out_len) {
+  if (!out || !out_len) return;
+  *out_len = in.size();
+  if (in.empty()) {
+    *out = nullptr;
+    return;
+  }
+  *out = static_cast<O*>(std::malloc(sizeof(O*) * in.size()));
+  for (size_t i = 0; i < in.size(); ++i) {
+    out[i] = static_cast<O*>(std::malloc(sizeof(O)));
+    ConvertToC(in[i], out[i]);
+  }
+}
+
+static void DisposeConnectionInfo(NT_ConnectionInfo* info) {
+  std::free(info->remote_id.str);
+  std::free(info->remote_ip.str);
+}
+
+static void DisposeEntryInfo(NT_EntryInfo* info) { std::free(info->name.str); }
+
+static void DisposeEntryNotification(NT_EntryNotification* info) {
+  std::free(info->name.str);
+  NT_DisposeValue(&info->value);
+}
+
+static void DisposeConnectionNotification(NT_ConnectionNotification* info) {
+  DisposeConnectionInfo(&info->conn);
+}
+
+static RpcParamDef ConvertFromC(const NT_RpcParamDef& in) {
+  RpcParamDef out;
+  out.name = ConvertFromC(in.name);
+  out.def_value = ConvertFromC(in.def_value);
+  return out;
+}
+
+static RpcResultDef ConvertFromC(const NT_RpcResultDef& in) {
+  RpcResultDef out;
+  out.name = ConvertFromC(in.name);
+  out.type = in.type;
+  return out;
+}
+
+static RpcDefinition ConvertFromC(const NT_RpcDefinition& in) {
+  RpcDefinition out;
+  out.version = in.version;
+  out.name = ConvertFromC(in.name);
+
+  out.params.reserve(in.num_params);
+  for (size_t i = 0; i < in.num_params; ++i)
+    out.params.push_back(ConvertFromC(in.params[i]));
+
+  out.results.reserve(in.num_results);
+  for (size_t i = 0; i < in.num_results; ++i)
+    out.results.push_back(ConvertFromC(in.results[i]));
+
+  return out;
+}
+
+extern "C" {
+
+/*
+ * Instance Functions
+ */
+
+NT_Inst NT_GetDefaultInstance(void) { return nt::GetDefaultInstance(); }
+
+NT_Inst NT_CreateInstance(void) { return nt::CreateInstance(); }
+
+void NT_DestroyInstance(NT_Inst inst) { return nt::DestroyInstance(inst); }
+
+NT_Inst NT_GetInstanceFromHandle(NT_Handle handle) {
+  return nt::GetInstanceFromHandle(handle);
+}
+
+/*
+ * Table Functions
+ */
+
+NT_Entry NT_GetEntry(NT_Inst inst, const char* name, size_t name_len) {
+  return nt::GetEntry(inst, StringRef(name, name_len));
+}
+
+NT_Entry* NT_GetEntries(NT_Inst inst, const char* prefix, size_t prefix_len,
+                        unsigned int types, size_t* count) {
+  auto info_v = nt::GetEntries(inst, StringRef(prefix, prefix_len), types);
+  *count = info_v.size();
+  if (info_v.size() == 0) return nullptr;
+
+  // create array and copy into it
+  NT_Entry* info =
+      static_cast<NT_Entry*>(std::malloc(info_v.size() * sizeof(NT_Entry)));
+  std::memcpy(info, info_v.data(), info_v.size() * sizeof(NT_Entry));
+  return info;
+}
+
+char* NT_GetEntryName(NT_Entry entry, size_t* name_len) {
+  struct NT_String v_name;
+  nt::ConvertToC(nt::GetEntryName(entry), &v_name);
+  *name_len = v_name.len;
+  return v_name.str;
+}
+
+enum NT_Type NT_GetEntryType(NT_Entry entry) { return nt::GetEntryType(entry); }
+
+uint64_t NT_GetEntryLastChange(NT_Entry entry) {
+  return nt::GetEntryLastChange(entry);
+}
+
+void NT_GetEntryValue(NT_Entry entry, struct NT_Value* value) {
+  NT_InitValue(value);
+  auto v = nt::GetEntryValue(entry);
+  if (!v) return;
+  ConvertToC(*v, value);
+}
+
+int NT_SetDefaultEntryValue(NT_Entry entry,
+                            const struct NT_Value* default_value) {
+  return nt::SetDefaultEntryValue(entry, ConvertFromC(*default_value));
+}
+
+int NT_SetEntryValue(NT_Entry entry, const struct NT_Value* value) {
+  return nt::SetEntryValue(entry, ConvertFromC(*value));
+}
+
+void NT_SetEntryTypeValue(NT_Entry entry, const struct NT_Value* value) {
+  nt::SetEntryTypeValue(entry, ConvertFromC(*value));
+}
+
+void NT_SetEntryFlags(NT_Entry entry, unsigned int flags) {
+  nt::SetEntryFlags(entry, flags);
+}
+
+unsigned int NT_GetEntryFlags(NT_Entry entry) {
+  return nt::GetEntryFlags(entry);
+}
+
+void NT_DeleteEntry(NT_Entry entry) { nt::DeleteEntry(entry); }
+
+void NT_DeleteAllEntries(NT_Inst inst) { nt::DeleteAllEntries(inst); }
+
+struct NT_EntryInfo* NT_GetEntryInfo(NT_Inst inst, const char* prefix,
+                                     size_t prefix_len, unsigned int types,
+                                     size_t* count) {
+  auto info_v = nt::GetEntryInfo(inst, StringRef(prefix, prefix_len), types);
+  *count = info_v.size();
+  if (info_v.size() == 0) return nullptr;
+
+  // create array and copy into it
+  NT_EntryInfo* info = static_cast<NT_EntryInfo*>(
+      std::malloc(info_v.size() * sizeof(NT_EntryInfo)));
+  for (size_t i = 0; i < info_v.size(); ++i) ConvertToC(info_v[i], &info[i]);
+  return info;
+}
+
+NT_Bool NT_GetEntryInfoHandle(NT_Entry entry, struct NT_EntryInfo* info) {
+  auto info_v = nt::GetEntryInfo(entry);
+  if (info_v.name.empty()) return false;
+  ConvertToC(info_v, info);
+  return true;
+}
+
+/*
+ * Callback Creation Functions
+ */
+
+NT_EntryListener NT_AddEntryListener(NT_Inst inst, const char* prefix,
+                                     size_t prefix_len, void* data,
+                                     NT_EntryListenerCallback callback,
+                                     unsigned int flags) {
+  return nt::AddEntryListener(inst, StringRef(prefix, prefix_len),
+                              [=](const EntryNotification& event) {
+                                NT_EntryNotification c_event;
+                                ConvertToC(event, &c_event);
+                                callback(data, &c_event);
+                                DisposeEntryNotification(&c_event);
+                              },
+                              flags);
+}
+
+NT_EntryListener NT_AddEntryListenerSingle(NT_Entry entry, void* data,
+                                           NT_EntryListenerCallback callback,
+                                           unsigned int flags) {
+  return nt::AddEntryListener(entry,
+                              [=](const EntryNotification& event) {
+                                NT_EntryNotification c_event;
+                                ConvertToC(event, &c_event);
+                                callback(data, &c_event);
+                                DisposeEntryNotification(&c_event);
+                              },
+                              flags);
+}
+
+NT_EntryListenerPoller NT_CreateEntryListenerPoller(NT_Inst inst) {
+  return nt::CreateEntryListenerPoller(inst);
+}
+
+void NT_DestroyEntryListenerPoller(NT_EntryListenerPoller poller) {
+  nt::DestroyEntryListenerPoller(poller);
+}
+
+NT_EntryListener NT_AddPolledEntryListener(NT_EntryListenerPoller poller,
+                                           const char* prefix,
+                                           size_t prefix_len,
+                                           unsigned int flags) {
+  return nt::AddPolledEntryListener(poller, StringRef(prefix, prefix_len),
+                                    flags);
+}
+
+NT_EntryListener NT_AddPolledEntryListenerSingle(NT_EntryListenerPoller poller,
+                                                 NT_Entry entry,
+                                                 unsigned int flags) {
+  return nt::AddPolledEntryListener(poller, entry, flags);
+}
+
+struct NT_EntryNotification* NT_PollEntryListener(NT_EntryListenerPoller poller,
+                                                  size_t* len) {
+  auto arr_cpp = nt::PollEntryListener(poller);
+  NT_EntryNotification* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+struct NT_EntryNotification* NT_PollEntryListenerTimeout(
+    NT_EntryListenerPoller poller, size_t* len, double timeout,
+    NT_Bool* timed_out) {
+  bool cpp_timed_out = false;
+  auto arr_cpp = nt::PollEntryListener(poller, timeout, &cpp_timed_out);
+  *timed_out = cpp_timed_out;
+  NT_EntryNotification* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+void NT_CancelPollEntryListener(NT_EntryListenerPoller poller) {
+  nt::CancelPollEntryListener(poller);
+}
+
+void NT_RemoveEntryListener(NT_EntryListener entry_listener) {
+  nt::RemoveEntryListener(entry_listener);
+}
+
+NT_Bool NT_WaitForEntryListenerQueue(NT_Inst inst, double timeout) {
+  return nt::WaitForEntryListenerQueue(inst, timeout);
+}
+
+NT_ConnectionListener NT_AddConnectionListener(
+    NT_Inst inst, void* data, NT_ConnectionListenerCallback callback,
+    NT_Bool immediate_notify) {
+  return nt::AddConnectionListener(inst,
+                                   [=](const ConnectionNotification& event) {
+                                     NT_ConnectionNotification event_c;
+                                     ConvertToC(event, &event_c);
+                                     callback(data, &event_c);
+                                     DisposeConnectionNotification(&event_c);
+                                   },
+                                   immediate_notify != 0);
+}
+
+NT_ConnectionListenerPoller NT_CreateConnectionListenerPoller(NT_Inst inst) {
+  return nt::CreateConnectionListenerPoller(inst);
+}
+
+void NT_DestroyConnectionListenerPoller(NT_ConnectionListenerPoller poller) {
+  nt::DestroyConnectionListenerPoller(poller);
+}
+
+NT_ConnectionListener NT_AddPolledConnectionListener(
+    NT_ConnectionListenerPoller poller, NT_Bool immediate_notify) {
+  return nt::AddPolledConnectionListener(poller, immediate_notify);
+}
+
+struct NT_ConnectionNotification* NT_PollConnectionListener(
+    NT_ConnectionListenerPoller poller, size_t* len) {
+  auto arr_cpp = nt::PollConnectionListener(poller);
+  NT_ConnectionNotification* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+struct NT_ConnectionNotification* NT_PollConnectionListenerTimeout(
+    NT_ConnectionListenerPoller poller, size_t* len, double timeout,
+    NT_Bool* timed_out) {
+  bool cpp_timed_out = false;
+  auto arr_cpp = nt::PollConnectionListener(poller, timeout, &cpp_timed_out);
+  *timed_out = cpp_timed_out;
+  NT_ConnectionNotification* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+void NT_CancelPollConnectionListener(NT_ConnectionListenerPoller poller) {
+  nt::CancelPollConnectionListener(poller);
+}
+
+void NT_RemoveConnectionListener(NT_ConnectionListener conn_listener) {
+  nt::RemoveConnectionListener(conn_listener);
+}
+
+NT_Bool NT_WaitForConnectionListenerQueue(NT_Inst inst, double timeout) {
+  return nt::WaitForConnectionListenerQueue(inst, timeout);
+}
+
+/*
+ * Remote Procedure Call Functions
+ */
+
+void NT_CreateRpc(NT_Entry entry, const char* def, size_t def_len, void* data,
+                  NT_RpcCallback callback) {
+  nt::CreateRpc(entry, StringRef(def, def_len), [=](const RpcAnswer& answer) {
+    NT_RpcAnswer answer_c;
+    ConvertToC(answer, &answer_c);
+    callback(data, &answer_c);
+    NT_DisposeRpcAnswer(&answer_c);
+  });
+}
+
+NT_RpcCallPoller NT_CreateRpcCallPoller(NT_Inst inst) {
+  return nt::CreateRpcCallPoller(inst);
+}
+
+void NT_DestroyRpcCallPoller(NT_RpcCallPoller poller) {
+  nt::DestroyRpcCallPoller(poller);
+}
+
+void NT_CreatePolledRpc(NT_Entry entry, const char* def, size_t def_len,
+                        NT_RpcCallPoller poller) {
+  nt::CreatePolledRpc(entry, StringRef(def, def_len), poller);
+}
+
+NT_RpcAnswer* NT_PollRpc(NT_RpcCallPoller poller, size_t* len) {
+  auto arr_cpp = nt::PollRpc(poller);
+  NT_RpcAnswer* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+NT_RpcAnswer* NT_PollRpcTimeout(NT_RpcCallPoller poller, size_t* len,
+                                double timeout, NT_Bool* timed_out) {
+  bool cpp_timed_out = false;
+  auto arr_cpp = nt::PollRpc(poller, timeout, &cpp_timed_out);
+  *timed_out = cpp_timed_out;
+  NT_RpcAnswer* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+void NT_CancelPollRpc(NT_RpcCallPoller poller) { nt::CancelPollRpc(poller); }
+
+NT_Bool NT_WaitForRpcCallQueue(NT_Inst inst, double timeout) {
+  return nt::WaitForRpcCallQueue(inst, timeout);
+}
+
+void NT_PostRpcResponse(NT_Entry entry, NT_RpcCall call, const char* result,
+                        size_t result_len) {
+  nt::PostRpcResponse(entry, call, StringRef(result, result_len));
+}
+
+NT_RpcCall NT_CallRpc(NT_Entry entry, const char* params, size_t params_len) {
+  return nt::CallRpc(entry, StringRef(params, params_len));
+}
+
+char* NT_GetRpcResult(NT_Entry entry, NT_RpcCall call, size_t* result_len) {
+  std::string result;
+  if (!nt::GetRpcResult(entry, call, &result)) return nullptr;
+
+  // convert result
+  *result_len = result.size();
+  char* result_cstr;
+  ConvertToC(result, &result_cstr);
+  return result_cstr;
+}
+
+char* NT_GetRpcResultTimeout(NT_Entry entry, NT_RpcCall call,
+                             size_t* result_len, double timeout,
+                             NT_Bool* timed_out) {
+  std::string result;
+  bool cpp_timed_out = false;
+  if (!nt::GetRpcResult(entry, call, &result, timeout, &cpp_timed_out)) {
+    *timed_out = cpp_timed_out;
+    return nullptr;
+  }
+
+  *timed_out = cpp_timed_out;
+  // convert result
+  *result_len = result.size();
+  char* result_cstr;
+  ConvertToC(result, &result_cstr);
+  return result_cstr;
+}
+
+void NT_CancelRpcResult(NT_Entry entry, NT_RpcCall call) {
+  nt::CancelRpcResult(entry, call);
+}
+
+char* NT_PackRpcDefinition(const NT_RpcDefinition* def, size_t* packed_len) {
+  auto packed = nt::PackRpcDefinition(ConvertFromC(*def));
+
+  // convert result
+  *packed_len = packed.size();
+  char* packed_cstr;
+  ConvertToC(packed, &packed_cstr);
+  return packed_cstr;
+}
+
+NT_Bool NT_UnpackRpcDefinition(const char* packed, size_t packed_len,
+                               NT_RpcDefinition* def) {
+  nt::RpcDefinition def_v;
+  if (!nt::UnpackRpcDefinition(StringRef(packed, packed_len), &def_v)) return 0;
+
+  // convert result
+  ConvertToC(def_v, def);
+  return 1;
+}
+
+char* NT_PackRpcValues(const NT_Value** values, size_t values_len,
+                       size_t* packed_len) {
+  // create input vector
+  std::vector<std::shared_ptr<Value>> values_v;
+  values_v.reserve(values_len);
+  for (size_t i = 0; i < values_len; ++i)
+    values_v.push_back(ConvertFromC(*values[i]));
+
+  // make the call
+  auto packed = nt::PackRpcValues(values_v);
+
+  // convert result
+  *packed_len = packed.size();
+  char* packed_cstr;
+  ConvertToC(packed, &packed_cstr);
+  return packed_cstr;
+}
+
+NT_Value** NT_UnpackRpcValues(const char* packed, size_t packed_len,
+                              const NT_Type* types, size_t types_len) {
+  auto values_v = nt::UnpackRpcValues(StringRef(packed, packed_len),
+                                      ArrayRef<NT_Type>(types, types_len));
+  if (values_v.size() == 0) return nullptr;
+
+  // create array and copy into it
+  NT_Value** values =
+      static_cast<NT_Value**>(std::malloc(values_v.size() * sizeof(NT_Value*)));
+  for (size_t i = 0; i < values_v.size(); ++i) {
+    values[i] = static_cast<NT_Value*>(std::malloc(sizeof(NT_Value)));
+    ConvertToC(*values_v[i], values[i]);
+  }
+  return values;
+}
+
+/*
+ * Client/Server Functions
+ */
+
+void NT_SetNetworkIdentity(NT_Inst inst, const char* name, size_t name_len) {
+  nt::SetNetworkIdentity(inst, StringRef(name, name_len));
+}
+
+unsigned int NT_GetNetworkMode(NT_Inst inst) {
+  return nt::GetNetworkMode(inst);
+}
+
+void NT_StartServer(NT_Inst inst, const char* persist_filename,
+                    const char* listen_address, unsigned int port) {
+  nt::StartServer(inst, persist_filename, listen_address, port);
+}
+
+void NT_StopServer(NT_Inst inst) { nt::StopServer(inst); }
+
+void NT_StartClientNone(NT_Inst inst) { nt::StartClient(inst); }
+
+void NT_StartClient(NT_Inst inst, const char* server_name, unsigned int port) {
+  nt::StartClient(inst, server_name, port);
+}
+
+void NT_StartClientMulti(NT_Inst inst, size_t count, const char** server_names,
+                         const unsigned int* ports) {
+  std::vector<std::pair<StringRef, unsigned int>> servers;
+  servers.reserve(count);
+  for (size_t i = 0; i < count; ++i)
+    servers.emplace_back(std::make_pair(server_names[i], ports[i]));
+  nt::StartClient(inst, servers);
+}
+
+void NT_StartClientTeam(NT_Inst inst, unsigned int team, unsigned int port) {
+  nt::StartClientTeam(inst, team, port);
+}
+
+void NT_StopClient(NT_Inst inst) { nt::StopClient(inst); }
+
+void NT_SetServer(NT_Inst inst, const char* server_name, unsigned int port) {
+  nt::SetServer(inst, server_name, port);
+}
+
+void NT_SetServerMulti(NT_Inst inst, size_t count, const char** server_names,
+                       const unsigned int* ports) {
+  std::vector<std::pair<StringRef, unsigned int>> servers;
+  servers.reserve(count);
+  for (size_t i = 0; i < count; ++i)
+    servers.emplace_back(std::make_pair(server_names[i], ports[i]));
+  nt::SetServer(inst, servers);
+}
+
+void NT_SetServerTeam(NT_Inst inst, unsigned int team, unsigned int port) {
+  nt::SetServerTeam(inst, team, port);
+}
+
+void NT_StartDSClient(NT_Inst inst, unsigned int port) {
+  nt::StartDSClient(inst, port);
+}
+
+void NT_StopDSClient(NT_Inst inst) { nt::StopDSClient(inst); }
+
+void NT_SetUpdateRate(NT_Inst inst, double interval) {
+  nt::SetUpdateRate(inst, interval);
+}
+
+void NT_Flush(NT_Inst inst) { nt::Flush(inst); }
+
+NT_Bool NT_IsConnected(NT_Inst inst) { return nt::IsConnected(inst); }
+
+struct NT_ConnectionInfo* NT_GetConnections(NT_Inst inst, size_t* count) {
+  auto conn_v = nt::GetConnections(inst);
+  *count = conn_v.size();
+  if (conn_v.size() == 0) return nullptr;
+
+  // create array and copy into it
+  NT_ConnectionInfo* conn = static_cast<NT_ConnectionInfo*>(
+      std::malloc(conn_v.size() * sizeof(NT_ConnectionInfo)));
+  for (size_t i = 0; i < conn_v.size(); ++i) ConvertToC(conn_v[i], &conn[i]);
+  return conn;
+}
+
+/*
+ * File Save/Load Functions
+ */
+
+const char* NT_SavePersistent(NT_Inst inst, const char* filename) {
+  return nt::SavePersistent(inst, filename);
+}
+
+const char* NT_LoadPersistent(NT_Inst inst, const char* filename,
+                              void (*warn)(size_t line, const char* msg)) {
+  return nt::LoadPersistent(inst, filename, warn);
+}
+
+const char* NT_SaveEntries(NT_Inst inst, const char* filename,
+                           const char* prefix, size_t prefix_len) {
+  return nt::SaveEntries(inst, filename, StringRef(prefix, prefix_len));
+}
+
+const char* NT_LoadEntries(NT_Inst inst, const char* filename,
+                           const char* prefix, size_t prefix_len,
+                           void (*warn)(size_t line, const char* msg)) {
+  return nt::LoadEntries(inst, filename, StringRef(prefix, prefix_len), warn);
+}
+
+/*
+ * Utility Functions
+ */
+
+uint64_t NT_Now(void) { return wpi::Now(); }
+
+NT_Logger NT_AddLogger(NT_Inst inst, void* data, NT_LogFunc func,
+                       unsigned int min_level, unsigned int max_level) {
+  return nt::AddLogger(inst,
+                       [=](const LogMessage& msg) {
+                         NT_LogMessage msg_c;
+                         ConvertToC(msg, &msg_c);
+                         func(data, &msg_c);
+                         NT_DisposeLogMessage(&msg_c);
+                       },
+                       min_level, max_level);
+}
+
+NT_LoggerPoller NT_CreateLoggerPoller(NT_Inst inst) {
+  return nt::CreateLoggerPoller(inst);
+}
+
+void NT_DestroyLoggerPoller(NT_LoggerPoller poller) {
+  nt::DestroyLoggerPoller(poller);
+}
+
+NT_Logger NT_AddPolledLogger(NT_LoggerPoller poller, unsigned int min_level,
+                             unsigned int max_level) {
+  return nt::AddPolledLogger(poller, min_level, max_level);
+}
+
+struct NT_LogMessage* NT_PollLogger(NT_LoggerPoller poller, size_t* len) {
+  auto arr_cpp = nt::PollLogger(poller);
+  NT_LogMessage* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+struct NT_LogMessage* NT_PollLoggerTimeout(NT_LoggerPoller poller, size_t* len,
+                                           double timeout, NT_Bool* timed_out) {
+  bool cpp_timed_out = false;
+  auto arr_cpp = nt::PollLogger(poller, timeout, &cpp_timed_out);
+  *timed_out = cpp_timed_out;
+  NT_LogMessage* arr;
+  ConvertToC(arr_cpp, &arr, len);
+  return arr;
+}
+
+void NT_CancelPollLogger(NT_LoggerPoller poller) {
+  nt::CancelPollLogger(poller);
+}
+
+void NT_RemoveLogger(NT_Logger logger) { nt::RemoveLogger(logger); }
+
+NT_Bool NT_WaitForLoggerQueue(NT_Inst inst, double timeout) {
+  return nt::WaitForLoggerQueue(inst, timeout);
+}
+
+void NT_DisposeValue(NT_Value* value) {
+  switch (value->type) {
+    case NT_UNASSIGNED:
+    case NT_BOOLEAN:
+    case NT_DOUBLE:
+      break;
+    case NT_STRING:
+    case NT_RAW:
+    case NT_RPC:
+      std::free(value->data.v_string.str);
+      break;
+    case NT_BOOLEAN_ARRAY:
+      std::free(value->data.arr_boolean.arr);
+      break;
+    case NT_DOUBLE_ARRAY:
+      std::free(value->data.arr_double.arr);
+      break;
+    case NT_STRING_ARRAY: {
+      for (size_t i = 0; i < value->data.arr_string.size; i++)
+        std::free(value->data.arr_string.arr[i].str);
+      std::free(value->data.arr_string.arr);
+      break;
+    }
+    default:
+      assert(false && "unknown value type");
+  }
+  value->type = NT_UNASSIGNED;
+  value->last_change = 0;
+}
+
+void NT_InitValue(NT_Value* value) {
+  value->type = NT_UNASSIGNED;
+  value->last_change = 0;
+}
+
+void NT_DisposeString(NT_String* str) {
+  std::free(str->str);
+  str->str = nullptr;
+  str->len = 0;
+}
+
+void NT_InitString(NT_String* str) {
+  str->str = nullptr;
+  str->len = 0;
+}
+
+void NT_DisposeEntryArray(NT_Entry* arr, size_t count) { std::free(arr); }
+
+void NT_DisposeConnectionInfoArray(NT_ConnectionInfo* arr, size_t count) {
+  for (size_t i = 0; i < count; i++) DisposeConnectionInfo(&arr[i]);
+  std::free(arr);
+}
+
+void NT_DisposeEntryInfoArray(NT_EntryInfo* arr, size_t count) {
+  for (size_t i = 0; i < count; i++) DisposeEntryInfo(&arr[i]);
+  std::free(arr);
+}
+
+void NT_DisposeEntryInfo(NT_EntryInfo* info) { DisposeEntryInfo(info); }
+
+void NT_DisposeEntryNotificationArray(NT_EntryNotification* arr, size_t count) {
+  for (size_t i = 0; i < count; i++) DisposeEntryNotification(&arr[i]);
+  std::free(arr);
+}
+
+void NT_DisposeEntryNotification(NT_EntryNotification* info) {
+  DisposeEntryNotification(info);
+}
+
+void NT_DisposeConnectionNotificationArray(NT_ConnectionNotification* arr,
+                                           size_t count) {
+  for (size_t i = 0; i < count; i++) DisposeConnectionNotification(&arr[i]);
+  std::free(arr);
+}
+
+void NT_DisposeConnectionNotification(NT_ConnectionNotification* info) {
+  DisposeConnectionNotification(info);
+}
+
+void NT_DisposeLogMessageArray(NT_LogMessage* arr, size_t count) {
+  for (size_t i = 0; i < count; i++) NT_DisposeLogMessage(&arr[i]);
+  std::free(arr);
+}
+
+void NT_DisposeLogMessage(NT_LogMessage* info) { std::free(info->message); }
+
+void NT_DisposeRpcDefinition(NT_RpcDefinition* def) {
+  NT_DisposeString(&def->name);
+
+  for (size_t i = 0; i < def->num_params; ++i) {
+    NT_DisposeString(&def->params[i].name);
+    NT_DisposeValue(&def->params[i].def_value);
+  }
+  std::free(def->params);
+  def->params = nullptr;
+  def->num_params = 0;
+
+  for (size_t i = 0; i < def->num_results; ++i)
+    NT_DisposeString(&def->results[i].name);
+  std::free(def->results);
+  def->results = nullptr;
+  def->num_results = 0;
+}
+
+void NT_DisposeRpcAnswerArray(NT_RpcAnswer* arr, size_t count) {
+  for (size_t i = 0; i < count; i++) NT_DisposeRpcAnswer(&arr[i]);
+  std::free(arr);
+}
+
+void NT_DisposeRpcAnswer(NT_RpcAnswer* call_info) {
+  NT_DisposeString(&call_info->name);
+  NT_DisposeString(&call_info->params);
+  DisposeConnectionInfo(&call_info->conn);
+}
+
+/* Interop Utility Functions */
+
+/* Array and Struct Allocations */
+
+/* Allocates a char array of the specified size.*/
+char* NT_AllocateCharArray(size_t size) {
+  char* retVal = static_cast<char*>(std::malloc(size * sizeof(char)));
+  return retVal;
+}
+
+/* Allocates an integer or boolean array of the specified size. */
+int* NT_AllocateBooleanArray(size_t size) {
+  int* retVal = static_cast<int*>(std::malloc(size * sizeof(int)));
+  return retVal;
+}
+
+/* Allocates a double array of the specified size. */
+double* NT_AllocateDoubleArray(size_t size) {
+  double* retVal = static_cast<double*>(std::malloc(size * sizeof(double)));
+  return retVal;
+}
+
+/* Allocates an NT_String array of the specified size. */
+struct NT_String* NT_AllocateStringArray(size_t size) {
+  NT_String* retVal =
+      static_cast<NT_String*>(std::malloc(size * sizeof(NT_String)));
+  return retVal;
+}
+
+void NT_FreeCharArray(char* v_char) { std::free(v_char); }
+void NT_FreeDoubleArray(double* v_double) { std::free(v_double); }
+void NT_FreeBooleanArray(int* v_boolean) { std::free(v_boolean); }
+void NT_FreeStringArray(struct NT_String* v_string, size_t arr_size) {
+  for (size_t i = 0; i < arr_size; i++) std::free(v_string[i].str);
+  std::free(v_string);
+}
+
+NT_Bool NT_SetEntryDouble(NT_Entry entry, uint64_t time, double v_double,
+                          NT_Bool force) {
+  if (force != 0) {
+    nt::SetEntryTypeValue(entry, Value::MakeDouble(v_double, time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(entry, Value::MakeDouble(v_double, time));
+  }
+}
+
+NT_Bool NT_SetEntryBoolean(NT_Entry entry, uint64_t time, NT_Bool v_boolean,
+                           NT_Bool force) {
+  if (force != 0) {
+    nt::SetEntryTypeValue(entry, Value::MakeBoolean(v_boolean != 0, time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(entry, Value::MakeBoolean(v_boolean != 0, time));
+  }
+}
+
+NT_Bool NT_SetEntryString(NT_Entry entry, uint64_t time, const char* str,
+                          size_t str_len, NT_Bool force) {
+  if (force != 0) {
+    nt::SetEntryTypeValue(entry,
+                          Value::MakeString(StringRef(str, str_len), time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(entry,
+                             Value::MakeString(StringRef(str, str_len), time));
+  }
+}
+
+NT_Bool NT_SetEntryRaw(NT_Entry entry, uint64_t time, const char* raw,
+                       size_t raw_len, NT_Bool force) {
+  if (force != 0) {
+    nt::SetEntryTypeValue(entry, Value::MakeRaw(StringRef(raw, raw_len), time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(entry,
+                             Value::MakeRaw(StringRef(raw, raw_len), time));
+  }
+}
+
+NT_Bool NT_SetEntryBooleanArray(NT_Entry entry, uint64_t time,
+                                const NT_Bool* arr, size_t size,
+                                NT_Bool force) {
+  if (force != 0) {
+    nt::SetEntryTypeValue(
+        entry, Value::MakeBooleanArray(llvm::makeArrayRef(arr, size), time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(
+        entry, Value::MakeBooleanArray(llvm::makeArrayRef(arr, size), time));
+  }
+}
+
+NT_Bool NT_SetEntryDoubleArray(NT_Entry entry, uint64_t time, const double* arr,
+                               size_t size, NT_Bool force) {
+  if (force != 0) {
+    nt::SetEntryTypeValue(
+        entry, Value::MakeDoubleArray(llvm::makeArrayRef(arr, size), time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(
+        entry, Value::MakeDoubleArray(llvm::makeArrayRef(arr, size), time));
+  }
+}
+
+NT_Bool NT_SetEntryStringArray(NT_Entry entry, uint64_t time,
+                               const struct NT_String* arr, size_t size,
+                               NT_Bool force) {
+  std::vector<std::string> v;
+  v.reserve(size);
+  for (size_t i = 0; i < size; ++i) v.push_back(ConvertFromC(arr[i]));
+
+  if (force != 0) {
+    nt::SetEntryTypeValue(entry, Value::MakeStringArray(std::move(v), time));
+    return 1;
+  } else {
+    return nt::SetEntryValue(entry, Value::MakeStringArray(std::move(v), time));
+  }
+}
+
+enum NT_Type NT_GetValueType(const struct NT_Value* value) {
+  if (!value) return NT_Type::NT_UNASSIGNED;
+  return value->type;
+}
+
+NT_Bool NT_GetValueBoolean(const struct NT_Value* value, uint64_t* last_change,
+                           NT_Bool* v_boolean) {
+  if (!value || value->type != NT_Type::NT_BOOLEAN) return 0;
+  *v_boolean = value->data.v_boolean;
+  *last_change = value->last_change;
+  return 1;
+}
+
+NT_Bool NT_GetValueDouble(const struct NT_Value* value, uint64_t* last_change,
+                          double* v_double) {
+  if (!value || value->type != NT_Type::NT_DOUBLE) return 0;
+  *last_change = value->last_change;
+  *v_double = value->data.v_double;
+  return 1;
+}
+
+char* NT_GetValueString(const struct NT_Value* value, uint64_t* last_change,
+                        size_t* str_len) {
+  if (!value || value->type != NT_Type::NT_STRING) return nullptr;
+  *last_change = value->last_change;
+  *str_len = value->data.v_string.len;
+  char* str = static_cast<char*>(std::malloc(value->data.v_string.len + 1));
+  std::memcpy(str, value->data.v_string.str, value->data.v_string.len + 1);
+  return str;
+}
+
+char* NT_GetValueRaw(const struct NT_Value* value, uint64_t* last_change,
+                     size_t* raw_len) {
+  if (!value || value->type != NT_Type::NT_RAW) return nullptr;
+  *last_change = value->last_change;
+  *raw_len = value->data.v_string.len;
+  char* raw = static_cast<char*>(std::malloc(value->data.v_string.len + 1));
+  std::memcpy(raw, value->data.v_string.str, value->data.v_string.len + 1);
+  return raw;
+}
+
+NT_Bool* NT_GetValueBooleanArray(const struct NT_Value* value,
+                                 uint64_t* last_change, size_t* arr_size) {
+  if (!value || value->type != NT_Type::NT_BOOLEAN_ARRAY) return nullptr;
+  *last_change = value->last_change;
+  *arr_size = value->data.arr_boolean.size;
+  NT_Bool* arr = static_cast<int*>(
+      std::malloc(value->data.arr_boolean.size * sizeof(NT_Bool)));
+  std::memcpy(arr, value->data.arr_boolean.arr,
+              value->data.arr_boolean.size * sizeof(NT_Bool));
+  return arr;
+}
+
+double* NT_GetValueDoubleArray(const struct NT_Value* value,
+                               uint64_t* last_change, size_t* arr_size) {
+  if (!value || value->type != NT_Type::NT_DOUBLE_ARRAY) return nullptr;
+  *last_change = value->last_change;
+  *arr_size = value->data.arr_double.size;
+  double* arr = static_cast<double*>(
+      std::malloc(value->data.arr_double.size * sizeof(double)));
+  std::memcpy(arr, value->data.arr_double.arr,
+              value->data.arr_double.size * sizeof(double));
+  return arr;
+}
+
+NT_String* NT_GetValueStringArray(const struct NT_Value* value,
+                                  uint64_t* last_change, size_t* arr_size) {
+  if (!value || value->type != NT_Type::NT_STRING_ARRAY) return nullptr;
+  *last_change = value->last_change;
+  *arr_size = value->data.arr_string.size;
+  NT_String* arr = static_cast<NT_String*>(
+      std::malloc(value->data.arr_string.size * sizeof(NT_String)));
+  for (size_t i = 0; i < value->data.arr_string.size; ++i) {
+    size_t len = value->data.arr_string.arr[i].len;
+    arr[i].len = len;
+    arr[i].str = static_cast<char*>(std::malloc(len + 1));
+    std::memcpy(arr[i].str, value->data.arr_string.arr[i].str, len + 1);
+  }
+  return arr;
+}
+
+NT_Bool NT_SetDefaultEntryBoolean(NT_Entry entry, uint64_t time,
+                                  NT_Bool default_boolean) {
+  return nt::SetDefaultEntryValue(
+      entry, Value::MakeBoolean(default_boolean != 0, time));
+}
+
+NT_Bool NT_SetDefaultEntryDouble(NT_Entry entry, uint64_t time,
+                                 double default_double) {
+  return nt::SetDefaultEntryValue(entry,
+                                  Value::MakeDouble(default_double, time));
+}
+
+NT_Bool NT_SetDefaultEntryString(NT_Entry entry, uint64_t time,
+                                 const char* default_value,
+                                 size_t default_len) {
+  return nt::SetDefaultEntryValue(
+      entry, Value::MakeString(StringRef(default_value, default_len), time));
+}
+
+NT_Bool NT_SetDefaultEntryRaw(NT_Entry entry, uint64_t time,
+                              const char* default_value, size_t default_len) {
+  return nt::SetDefaultEntryValue(
+      entry, Value::MakeRaw(StringRef(default_value, default_len), time));
+}
+
+NT_Bool NT_SetDefaultEntryBooleanArray(NT_Entry entry, uint64_t time,
+                                       const NT_Bool* default_value,
+                                       size_t default_size) {
+  return nt::SetDefaultEntryValue(
+      entry, Value::MakeBooleanArray(
+                 llvm::makeArrayRef(default_value, default_size), time));
+}
+
+NT_Bool NT_SetDefaultEntryDoubleArray(NT_Entry entry, uint64_t time,
+                                      const double* default_value,
+                                      size_t default_size) {
+  return nt::SetDefaultEntryValue(
+      entry, Value::MakeDoubleArray(
+                 llvm::makeArrayRef(default_value, default_size), time));
+}
+
+NT_Bool NT_SetDefaultEntryStringArray(NT_Entry entry, uint64_t time,
+                                      const struct NT_String* default_value,
+                                      size_t default_size) {
+  std::vector<std::string> vec;
+  vec.reserve(default_size);
+  for (size_t i = 0; i < default_size; ++i)
+    vec.push_back(ConvertFromC(default_value[i]));
+
+  return nt::SetDefaultEntryValue(entry,
+                                  Value::MakeStringArray(std::move(vec), time));
+}
+
+NT_Bool NT_GetEntryBoolean(NT_Entry entry, uint64_t* last_change,
+                           NT_Bool* v_boolean) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsBoolean()) return 0;
+  *v_boolean = v->GetBoolean();
+  *last_change = v->last_change();
+  return 1;
+}
+
+NT_Bool NT_GetEntryDouble(NT_Entry entry, uint64_t* last_change,
+                          double* v_double) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsDouble()) return 0;
+  *last_change = v->last_change();
+  *v_double = v->GetDouble();
+  return 1;
+}
+
+char* NT_GetEntryString(NT_Entry entry, uint64_t* last_change,
+                        size_t* str_len) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsString()) return nullptr;
+  *last_change = v->last_change();
+  struct NT_String v_string;
+  nt::ConvertToC(v->GetString(), &v_string);
+  *str_len = v_string.len;
+  return v_string.str;
+}
+
+char* NT_GetEntryRaw(NT_Entry entry, uint64_t* last_change, size_t* raw_len) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsRaw()) return nullptr;
+  *last_change = v->last_change();
+  struct NT_String v_raw;
+  nt::ConvertToC(v->GetRaw(), &v_raw);
+  *raw_len = v_raw.len;
+  return v_raw.str;
+}
+
+NT_Bool* NT_GetEntryBooleanArray(NT_Entry entry, uint64_t* last_change,
+                                 size_t* arr_size) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsBooleanArray()) return nullptr;
+  *last_change = v->last_change();
+  auto vArr = v->GetBooleanArray();
+  NT_Bool* arr = static_cast<int*>(std::malloc(vArr.size() * sizeof(NT_Bool)));
+  *arr_size = vArr.size();
+  std::copy(vArr.begin(), vArr.end(), arr);
+  return arr;
+}
+
+double* NT_GetEntryDoubleArray(NT_Entry entry, uint64_t* last_change,
+                               size_t* arr_size) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsDoubleArray()) return nullptr;
+  *last_change = v->last_change();
+  auto vArr = v->GetDoubleArray();
+  double* arr = static_cast<double*>(std::malloc(vArr.size() * sizeof(double)));
+  *arr_size = vArr.size();
+  std::copy(vArr.begin(), vArr.end(), arr);
+  return arr;
+}
+
+NT_String* NT_GetEntryStringArray(NT_Entry entry, uint64_t* last_change,
+                                  size_t* arr_size) {
+  auto v = nt::GetEntryValue(entry);
+  if (!v || !v->IsStringArray()) return nullptr;
+  *last_change = v->last_change();
+  auto vArr = v->GetStringArray();
+  NT_String* arr =
+      static_cast<NT_String*>(std::malloc(vArr.size() * sizeof(NT_String)));
+  for (size_t i = 0; i < vArr.size(); ++i) {
+    ConvertToC(vArr[i], &arr[i]);
+  }
+  *arr_size = vArr.size();
+  return arr;
+}
+
+}  // extern "C"
diff --git a/third_party/ntcore_2018/src/main/native/cpp/ntcore_cpp.cpp b/third_party/ntcore_2018/src/main/native/cpp/ntcore_cpp.cpp
new file mode 100644
index 0000000..5e2b95c
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/ntcore_cpp.cpp
@@ -0,0 +1,1062 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <stdint.h>
+
+#include <cassert>
+#include <cstdio>
+#include <cstdlib>
+
+#include <support/timestamp.h>
+
+#include "Handle.h"
+#include "InstanceImpl.h"
+#include "Log.h"
+#include "WireDecoder.h"
+#include "WireEncoder.h"
+#include "ntcore.h"
+
+namespace nt {
+
+/*
+ * Instance Functions
+ */
+
+NT_Inst GetDefaultInstance() {
+  return Handle{InstanceImpl::GetDefaultIndex(), 0, Handle::kInstance};
+}
+
+NT_Inst CreateInstance() {
+  return Handle{InstanceImpl::Alloc(), 0, Handle::kInstance};
+}
+
+void DestroyInstance(NT_Inst inst) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  if (i < 0) return;
+  InstanceImpl::Destroy(i);
+}
+
+NT_Inst GetInstanceFromHandle(NT_Handle handle) {
+  Handle h{handle};
+  auto type = h.GetType();
+  if (type >= Handle::kConnectionListener && type <= Handle::kRpcCallPoller)
+    return Handle(h.GetInst(), 0, Handle::kInstance);
+
+  return 0;
+}
+
+/*
+ * Table Functions
+ */
+
+NT_Entry GetEntry(NT_Inst inst, const Twine& name) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  unsigned int id = ii->storage.GetEntry(name);
+  if (id == UINT_MAX) return 0;
+  return Handle(i, id, Handle::kEntry);
+}
+
+std::vector<NT_Entry> GetEntries(NT_Inst inst, const Twine& prefix,
+                                 unsigned int types) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return std::vector<NT_Entry>{};
+
+  auto arr = ii->storage.GetEntries(prefix, types);
+  // convert indices to handles
+  for (auto& val : arr) val = Handle(i, val, Handle::kEntry);
+  return arr;
+}
+
+std::string GetEntryName(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::string{};
+
+  return ii->storage.GetEntryName(id);
+}
+
+NT_Type GetEntryType(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return NT_UNASSIGNED;
+
+  return ii->storage.GetEntryType(id);
+}
+
+uint64_t GetEntryLastChange(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return 0;
+
+  return ii->storage.GetEntryLastChange(id);
+}
+
+std::shared_ptr<Value> GetEntryValue(StringRef name) {
+  return InstanceImpl::GetDefault()->storage.GetEntryValue(name);
+}
+
+std::shared_ptr<Value> GetEntryValue(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return nullptr;
+
+  return ii->storage.GetEntryValue(id);
+}
+
+bool SetDefaultEntryValue(StringRef name, std::shared_ptr<Value> value) {
+  return InstanceImpl::GetDefault()->storage.SetDefaultEntryValue(name, value);
+}
+
+bool SetDefaultEntryValue(NT_Entry entry, std::shared_ptr<Value> value) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return false;
+
+  return ii->storage.SetDefaultEntryValue(id, value);
+}
+
+bool SetEntryValue(StringRef name, std::shared_ptr<Value> value) {
+  return InstanceImpl::GetDefault()->storage.SetEntryValue(name, value);
+}
+
+bool SetEntryValue(NT_Entry entry, std::shared_ptr<Value> value) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return false;
+
+  return ii->storage.SetEntryValue(id, value);
+}
+
+void SetEntryTypeValue(StringRef name, std::shared_ptr<Value> value) {
+  InstanceImpl::GetDefault()->storage.SetEntryTypeValue(name, value);
+}
+
+void SetEntryTypeValue(NT_Entry entry, std::shared_ptr<Value> value) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->storage.SetEntryTypeValue(id, value);
+}
+
+void SetEntryFlags(StringRef name, unsigned int flags) {
+  InstanceImpl::GetDefault()->storage.SetEntryFlags(name, flags);
+}
+
+void SetEntryFlags(NT_Entry entry, unsigned int flags) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->storage.SetEntryFlags(id, flags);
+}
+
+unsigned int GetEntryFlags(StringRef name) {
+  return InstanceImpl::GetDefault()->storage.GetEntryFlags(name);
+}
+
+unsigned int GetEntryFlags(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return 0;
+
+  return ii->storage.GetEntryFlags(id);
+}
+
+void DeleteEntry(StringRef name) {
+  InstanceImpl::GetDefault()->storage.DeleteEntry(name);
+}
+
+void DeleteEntry(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->storage.DeleteEntry(id);
+}
+
+void DeleteAllEntries() {
+  InstanceImpl::GetDefault()->storage.DeleteAllEntries();
+}
+
+void DeleteAllEntries(NT_Inst inst) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (i < 0 || !ii) return;
+
+  ii->storage.DeleteAllEntries();
+}
+
+std::vector<EntryInfo> GetEntryInfo(StringRef prefix, unsigned int types) {
+  return InstanceImpl::GetDefault()->storage.GetEntryInfo(0, prefix, types);
+}
+
+std::vector<EntryInfo> GetEntryInfo(NT_Inst inst, const Twine& prefix,
+                                    unsigned int types) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return std::vector<EntryInfo>{};
+
+  return ii->storage.GetEntryInfo(i, prefix, types);
+}
+
+EntryInfo GetEntryInfo(NT_Entry entry) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) {
+    EntryInfo info;
+    info.entry = 0;
+    info.type = NT_UNASSIGNED;
+    info.flags = 0;
+    info.last_change = 0;
+    return info;
+  }
+
+  return ii->storage.GetEntryInfo(i, id);
+}
+
+/*
+ * Callback Creation Functions
+ */
+
+NT_EntryListener AddEntryListener(StringRef prefix,
+                                  EntryListenerCallback callback,
+                                  unsigned int flags) {
+  return AddEntryListener(
+      Handle(InstanceImpl::GetDefaultIndex(), 0, Handle::kInstance), prefix,
+      [=](const EntryNotification& event) {
+        callback(event.listener, event.name, event.value, event.flags);
+      },
+      flags);
+}
+
+NT_EntryListener AddEntryListener(
+    NT_Inst inst, const Twine& prefix,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (i < 0 || !ii) return 0;
+
+  unsigned int uid = ii->storage.AddListener(prefix, callback, flags);
+  return Handle(i, uid, Handle::kEntryListener);
+}
+
+NT_EntryListener AddEntryListener(
+    NT_Entry entry,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) return 0;
+
+  unsigned int uid = ii->storage.AddListener(id, callback, flags);
+  return Handle(i, uid, Handle::kEntryListener);
+}
+
+NT_EntryListenerPoller CreateEntryListenerPoller(NT_Inst inst) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  return Handle(i, ii->entry_notifier.CreatePoller(),
+                Handle::kEntryListenerPoller);
+}
+
+void DestroyEntryListenerPoller(NT_EntryListenerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kEntryListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->entry_notifier.RemovePoller(id);
+}
+
+NT_EntryListener AddPolledEntryListener(NT_EntryListenerPoller poller,
+                                        const Twine& prefix,
+                                        unsigned int flags) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kEntryListenerPoller);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) return 0;
+
+  unsigned int uid = ii->storage.AddPolledListener(id, prefix, flags);
+  return Handle(i, uid, Handle::kEntryListener);
+}
+
+NT_EntryListener AddPolledEntryListener(NT_EntryListenerPoller poller,
+                                        NT_Entry entry, unsigned int flags) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) return 0;
+
+  Handle phandle{poller};
+  int p_id = phandle.GetTypedIndex(Handle::kEntryListenerPoller);
+  if (p_id < 0) return 0;
+  if (handle.GetInst() != phandle.GetInst()) return 0;
+
+  unsigned int uid = ii->storage.AddPolledListener(p_id, id, flags);
+  return Handle(i, uid, Handle::kEntryListener);
+}
+
+std::vector<EntryNotification> PollEntryListener(
+    NT_EntryListenerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kEntryListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<EntryNotification>{};
+
+  return ii->entry_notifier.Poll(static_cast<unsigned int>(id));
+}
+
+std::vector<EntryNotification> PollEntryListener(NT_EntryListenerPoller poller,
+                                                 double timeout,
+                                                 bool* timed_out) {
+  *timed_out = false;
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kEntryListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<EntryNotification>{};
+
+  return ii->entry_notifier.Poll(static_cast<unsigned int>(id), timeout,
+                                 timed_out);
+}
+
+void CancelPollEntryListener(NT_EntryListenerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kEntryListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->entry_notifier.CancelPoll(id);
+}
+
+void RemoveEntryListener(NT_EntryListener entry_listener) {
+  Handle handle{entry_listener};
+  int uid = handle.GetTypedIndex(Handle::kEntryListener);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (uid < 0 || !ii) return;
+
+  ii->entry_notifier.Remove(uid);
+}
+
+bool WaitForEntryListenerQueue(NT_Inst inst, double timeout) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return true;
+  return ii->entry_notifier.WaitForQueue(timeout);
+}
+
+NT_ConnectionListener AddConnectionListener(ConnectionListenerCallback callback,
+                                            bool immediate_notify) {
+  return AddConnectionListener(
+      Handle(InstanceImpl::GetDefaultIndex(), 0, Handle::kInstance),
+      [=](const ConnectionNotification& event) {
+        callback(event.listener, event.connected, event.conn);
+      },
+      immediate_notify);
+}
+
+NT_ConnectionListener AddConnectionListener(
+    NT_Inst inst,
+    std::function<void(const ConnectionNotification& event)> callback,
+    bool immediate_notify) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  unsigned int uid = ii->dispatcher.AddListener(callback, immediate_notify);
+  return Handle(i, uid, Handle::kConnectionListener);
+}
+
+NT_ConnectionListenerPoller CreateConnectionListenerPoller(NT_Inst inst) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  return Handle(i, ii->connection_notifier.CreatePoller(),
+                Handle::kConnectionListenerPoller);
+}
+
+void DestroyConnectionListenerPoller(NT_ConnectionListenerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kConnectionListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->connection_notifier.RemovePoller(id);
+}
+
+NT_ConnectionListener AddPolledConnectionListener(
+    NT_ConnectionListenerPoller poller, bool immediate_notify) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kConnectionListenerPoller);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) return 0;
+
+  unsigned int uid = ii->dispatcher.AddPolledListener(id, immediate_notify);
+  return Handle(i, uid, Handle::kConnectionListener);
+}
+
+std::vector<ConnectionNotification> PollConnectionListener(
+    NT_ConnectionListenerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kConnectionListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<ConnectionNotification>{};
+
+  return ii->connection_notifier.Poll(static_cast<unsigned int>(id));
+}
+
+std::vector<ConnectionNotification> PollConnectionListener(
+    NT_ConnectionListenerPoller poller, double timeout, bool* timed_out) {
+  *timed_out = false;
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kConnectionListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<ConnectionNotification>{};
+
+  return ii->connection_notifier.Poll(static_cast<unsigned int>(id), timeout,
+                                      timed_out);
+}
+
+void CancelPollConnectionListener(NT_ConnectionListenerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kConnectionListenerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->connection_notifier.CancelPoll(id);
+}
+
+void RemoveConnectionListener(NT_ConnectionListener conn_listener) {
+  Handle handle{conn_listener};
+  int uid = handle.GetTypedIndex(Handle::kConnectionListener);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (uid < 0 || !ii) return;
+
+  ii->connection_notifier.Remove(uid);
+}
+
+bool WaitForConnectionListenerQueue(NT_Inst inst, double timeout) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return true;
+  return ii->connection_notifier.WaitForQueue(timeout);
+}
+
+/*
+ * Remote Procedure Call Functions
+ */
+
+void CreateRpc(NT_Entry entry, StringRef def,
+               std::function<void(const RpcAnswer& answer)> callback) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  // only server can create RPCs
+  if ((ii->dispatcher.GetNetworkMode() & NT_NET_MODE_SERVER) == 0) return;
+  if (def.empty() || !callback) return;
+
+  ii->storage.CreateRpc(id, def, ii->rpc_server.Add(callback));
+}
+
+NT_RpcCallPoller CreateRpcCallPoller(NT_Inst inst) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  return Handle(i, ii->rpc_server.CreatePoller(), Handle::kRpcCallPoller);
+}
+
+void DestroyRpcCallPoller(NT_RpcCallPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kRpcCallPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->rpc_server.RemovePoller(id);
+}
+
+void CreatePolledRpc(NT_Entry entry, StringRef def, NT_RpcCallPoller poller) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  Handle phandle{poller};
+  int p_id = phandle.GetTypedIndex(Handle::kRpcCallPoller);
+  if (p_id < 0) return;
+  if (handle.GetInst() != phandle.GetInst()) return;
+
+  // only server can create RPCs
+  if ((ii->dispatcher.GetNetworkMode() & NT_NET_MODE_SERVER) == 0) return;
+  if (def.empty()) return;
+
+  ii->storage.CreateRpc(id, def, ii->rpc_server.AddPolled(p_id));
+}
+
+std::vector<RpcAnswer> PollRpc(NT_RpcCallPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kRpcCallPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<RpcAnswer>{};
+
+  return ii->rpc_server.Poll(static_cast<unsigned int>(id));
+}
+
+std::vector<RpcAnswer> PollRpc(NT_RpcCallPoller poller, double timeout,
+                               bool* timed_out) {
+  *timed_out = false;
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kRpcCallPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<RpcAnswer>{};
+
+  return ii->rpc_server.Poll(static_cast<unsigned int>(id), timeout, timed_out);
+}
+
+void CancelPollRpc(NT_RpcCallPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kRpcCallPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->rpc_server.CancelPoll(id);
+}
+
+bool WaitForRpcCallQueue(NT_Inst inst, double timeout) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return true;
+  return ii->rpc_server.WaitForQueue(timeout);
+}
+
+void PostRpcResponse(NT_Entry entry, NT_RpcCall call, StringRef result) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  Handle chandle{call};
+  int call_uid = chandle.GetTypedIndex(Handle::kRpcCall);
+  if (call_uid < 0) return;
+  if (handle.GetInst() != chandle.GetInst()) return;
+
+  ii->rpc_server.PostRpcResponse(id, call_uid, result);
+}
+
+NT_RpcCall CallRpc(NT_Entry entry, StringRef params) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) return 0;
+
+  unsigned int call_uid = ii->storage.CallRpc(id, params);
+  if (call_uid == 0) return 0;
+  return Handle(i, call_uid, Handle::kRpcCall);
+}
+
+bool GetRpcResult(NT_Entry entry, NT_RpcCall call, std::string* result) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return false;
+
+  Handle chandle{call};
+  int call_uid = chandle.GetTypedIndex(Handle::kRpcCall);
+  if (call_uid < 0) return false;
+  if (handle.GetInst() != chandle.GetInst()) return false;
+
+  return ii->storage.GetRpcResult(id, call_uid, result);
+}
+
+bool GetRpcResult(NT_Entry entry, NT_RpcCall call, std::string* result,
+                  double timeout, bool* timed_out) {
+  *timed_out = false;
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return false;
+
+  Handle chandle{call};
+  int call_uid = chandle.GetTypedIndex(Handle::kRpcCall);
+  if (call_uid < 0) return false;
+  if (handle.GetInst() != chandle.GetInst()) return false;
+
+  return ii->storage.GetRpcResult(id, call_uid, result, timeout, timed_out);
+}
+
+void CancelRpcResult(NT_Entry entry, NT_RpcCall call) {
+  Handle handle{entry};
+  int id = handle.GetTypedIndex(Handle::kEntry);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  Handle chandle{call};
+  int call_uid = chandle.GetTypedIndex(Handle::kRpcCall);
+  if (call_uid < 0) return;
+  if (handle.GetInst() != chandle.GetInst()) return;
+
+  ii->storage.CancelRpcResult(id, call_uid);
+}
+
+std::string PackRpcDefinition(const RpcDefinition& def) {
+  WireEncoder enc(0x0300);
+  enc.Write8(def.version);
+  enc.WriteString(def.name);
+
+  // parameters
+  unsigned int params_size = def.params.size();
+  if (params_size > 0xff) params_size = 0xff;
+  enc.Write8(params_size);
+  for (size_t i = 0; i < params_size; ++i) {
+    enc.WriteType(def.params[i].def_value->type());
+    enc.WriteString(def.params[i].name);
+    enc.WriteValue(*def.params[i].def_value);
+  }
+
+  // results
+  unsigned int results_size = def.results.size();
+  if (results_size > 0xff) results_size = 0xff;
+  enc.Write8(results_size);
+  for (size_t i = 0; i < results_size; ++i) {
+    enc.WriteType(def.results[i].type);
+    enc.WriteString(def.results[i].name);
+  }
+
+  return enc.ToStringRef();
+}
+
+bool UnpackRpcDefinition(StringRef packed, RpcDefinition* def) {
+  wpi::raw_mem_istream is(packed.data(), packed.size());
+  wpi::Logger logger;
+  WireDecoder dec(is, 0x0300, logger);
+  if (!dec.Read8(&def->version)) return false;
+  if (!dec.ReadString(&def->name)) return false;
+
+  // parameters
+  unsigned int params_size;
+  if (!dec.Read8(&params_size)) return false;
+  def->params.resize(0);
+  def->params.reserve(params_size);
+  for (size_t i = 0; i < params_size; ++i) {
+    RpcParamDef pdef;
+    NT_Type type;
+    if (!dec.ReadType(&type)) return false;
+    if (!dec.ReadString(&pdef.name)) return false;
+    pdef.def_value = dec.ReadValue(type);
+    if (!pdef.def_value) return false;
+    def->params.emplace_back(std::move(pdef));
+  }
+
+  // results
+  unsigned int results_size;
+  if (!dec.Read8(&results_size)) return false;
+  def->results.resize(0);
+  def->results.reserve(results_size);
+  for (size_t i = 0; i < results_size; ++i) {
+    RpcResultDef rdef;
+    if (!dec.ReadType(&rdef.type)) return false;
+    if (!dec.ReadString(&rdef.name)) return false;
+    def->results.emplace_back(std::move(rdef));
+  }
+
+  return true;
+}
+
+std::string PackRpcValues(ArrayRef<std::shared_ptr<Value>> values) {
+  WireEncoder enc(0x0300);
+  for (auto& value : values) enc.WriteValue(*value);
+  return enc.ToStringRef();
+}
+
+std::vector<std::shared_ptr<Value>> UnpackRpcValues(StringRef packed,
+                                                    ArrayRef<NT_Type> types) {
+  wpi::raw_mem_istream is(packed.data(), packed.size());
+  wpi::Logger logger;
+  WireDecoder dec(is, 0x0300, logger);
+  std::vector<std::shared_ptr<Value>> vec;
+  for (auto type : types) {
+    auto item = dec.ReadValue(type);
+    if (!item) return std::vector<std::shared_ptr<Value>>();
+    vec.emplace_back(std::move(item));
+  }
+  return vec;
+}
+
+uint64_t Now() { return wpi::Now(); }
+
+/*
+ * Client/Server Functions
+ */
+
+void SetNetworkIdentity(StringRef name) {
+  InstanceImpl::GetDefault()->dispatcher.SetIdentity(name);
+}
+
+void SetNetworkIdentity(NT_Inst inst, const Twine& name) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetIdentity(name);
+}
+
+unsigned int GetNetworkMode() {
+  return InstanceImpl::GetDefault()->dispatcher.GetNetworkMode();
+}
+
+unsigned int GetNetworkMode(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return 0;
+
+  return ii->dispatcher.GetNetworkMode();
+}
+
+void StartServer(StringRef persist_filename, const char* listen_address,
+                 unsigned int port) {
+  auto ii = InstanceImpl::GetDefault();
+  ii->dispatcher.StartServer(persist_filename, listen_address, port);
+}
+
+void StartServer(NT_Inst inst, const Twine& persist_filename,
+                 const char* listen_address, unsigned int port) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.StartServer(persist_filename, listen_address, port);
+}
+
+void StopServer() { InstanceImpl::GetDefault()->dispatcher.Stop(); }
+
+void StopServer(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.Stop();
+}
+
+void StartClient() { InstanceImpl::GetDefault()->dispatcher.StartClient(); }
+
+void StartClient(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.StartClient();
+}
+
+void StartClient(const char* server_name, unsigned int port) {
+  auto ii = InstanceImpl::GetDefault();
+  ii->dispatcher.SetServer(server_name, port);
+  ii->dispatcher.StartClient();
+}
+
+void StartClient(NT_Inst inst, const char* server_name, unsigned int port) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetServer(server_name, port);
+  ii->dispatcher.StartClient();
+}
+
+void StartClient(ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  auto ii = InstanceImpl::GetDefault();
+  ii->dispatcher.SetServer(servers);
+  ii->dispatcher.StartClient();
+}
+
+void StartClient(NT_Inst inst,
+                 ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetServer(servers);
+  ii->dispatcher.StartClient();
+}
+
+void StartClientTeam(NT_Inst inst, unsigned int team, unsigned int port) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetServerTeam(team, port);
+  ii->dispatcher.StartClient();
+}
+
+void StopClient() { InstanceImpl::GetDefault()->dispatcher.Stop(); }
+
+void StopClient(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.Stop();
+}
+
+void SetServer(const char* server_name, unsigned int port) {
+  InstanceImpl::GetDefault()->dispatcher.SetServer(server_name, port);
+}
+
+void SetServer(NT_Inst inst, const char* server_name, unsigned int port) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetServer(server_name, port);
+}
+
+void SetServer(ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  InstanceImpl::GetDefault()->dispatcher.SetServer(servers);
+}
+
+void SetServer(NT_Inst inst,
+               ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetServer(servers);
+}
+
+void SetServerTeam(NT_Inst inst, unsigned int team, unsigned int port) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetServerTeam(team, port);
+}
+
+void StartDSClient(unsigned int port) {
+  InstanceImpl::GetDefault()->ds_client.Start(port);
+}
+
+void StartDSClient(NT_Inst inst, unsigned int port) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->ds_client.Start(port);
+}
+
+void StopDSClient() { InstanceImpl::GetDefault()->ds_client.Stop(); }
+
+void StopDSClient(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->ds_client.Stop();
+}
+
+void SetUpdateRate(double interval) {
+  InstanceImpl::GetDefault()->dispatcher.SetUpdateRate(interval);
+}
+
+void SetUpdateRate(NT_Inst inst, double interval) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.SetUpdateRate(interval);
+}
+
+void Flush() { InstanceImpl::GetDefault()->dispatcher.Flush(); }
+
+void Flush(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return;
+
+  ii->dispatcher.Flush();
+}
+
+std::vector<ConnectionInfo> GetConnections() {
+  return InstanceImpl::GetDefault()->dispatcher.GetConnections();
+}
+
+std::vector<ConnectionInfo> GetConnections(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return std::vector<ConnectionInfo>{};
+
+  return ii->dispatcher.GetConnections();
+}
+
+bool IsConnected(NT_Inst inst) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return false;
+
+  return ii->dispatcher.IsConnected();
+}
+
+/*
+ * Persistent Functions
+ */
+
+const char* SavePersistent(StringRef filename) {
+  return InstanceImpl::GetDefault()->storage.SavePersistent(filename, false);
+}
+
+const char* SavePersistent(NT_Inst inst, const Twine& filename) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return "invalid instance handle";
+
+  return ii->storage.SavePersistent(filename, false);
+}
+
+const char* LoadPersistent(
+    StringRef filename,
+    std::function<void(size_t line, const char* msg)> warn) {
+  return InstanceImpl::GetDefault()->storage.LoadPersistent(filename, warn);
+}
+
+const char* LoadPersistent(
+    NT_Inst inst, const Twine& filename,
+    std::function<void(size_t line, const char* msg)> warn) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return "invalid instance handle";
+
+  return ii->storage.LoadPersistent(filename, warn);
+}
+
+const char* SaveEntries(NT_Inst inst, const Twine& filename,
+                        const Twine& prefix) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return "invalid instance handle";
+
+  return ii->storage.SaveEntries(filename, prefix);
+}
+
+const char* LoadEntries(
+    NT_Inst inst, const Twine& filename, const Twine& prefix,
+    std::function<void(size_t line, const char* msg)> warn) {
+  auto ii = InstanceImpl::Get(Handle{inst}.GetTypedInst(Handle::kInstance));
+  if (!ii) return "invalid instance handle";
+
+  return ii->storage.LoadEntries(filename, prefix, warn);
+}
+
+void SetLogger(LogFunc func, unsigned int min_level) {
+  auto ii = InstanceImpl::GetDefault();
+  static wpi::mutex mutex;
+  static unsigned int logger = 0;
+  std::lock_guard<wpi::mutex> lock(mutex);
+  if (logger != 0) ii->logger_impl.Remove(logger);
+  logger = ii->logger_impl.Add(
+      [=](const LogMessage& msg) {
+        func(msg.level, msg.filename, msg.line, msg.message.c_str());
+      },
+      min_level, UINT_MAX);
+}
+
+NT_Logger AddLogger(NT_Inst inst,
+                    std::function<void(const LogMessage& msg)> func,
+                    unsigned int min_level, unsigned int max_level) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  if (min_level < ii->logger.min_level()) ii->logger.set_min_level(min_level);
+
+  return Handle(i, ii->logger_impl.Add(func, min_level, max_level),
+                Handle::kLogger);
+}
+
+NT_LoggerPoller CreateLoggerPoller(NT_Inst inst) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return 0;
+
+  return Handle(i, ii->logger_impl.CreatePoller(), Handle::kLoggerPoller);
+}
+
+void DestroyLoggerPoller(NT_LoggerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kLoggerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->logger_impl.RemovePoller(id);
+}
+
+NT_Logger AddPolledLogger(NT_LoggerPoller poller, unsigned int min_level,
+                          unsigned int max_level) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kLoggerPoller);
+  int i = handle.GetInst();
+  auto ii = InstanceImpl::Get(i);
+  if (id < 0 || !ii) return 0;
+
+  if (min_level < ii->logger.min_level()) ii->logger.set_min_level(min_level);
+
+  return Handle(i, ii->logger_impl.AddPolled(id, min_level, max_level),
+                Handle::kLogger);
+}
+
+std::vector<LogMessage> PollLogger(NT_LoggerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kLoggerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<LogMessage>{};
+
+  return ii->logger_impl.Poll(static_cast<unsigned int>(id));
+}
+
+std::vector<LogMessage> PollLogger(NT_LoggerPoller poller, double timeout,
+                                   bool* timed_out) {
+  *timed_out = false;
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kLoggerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return std::vector<LogMessage>{};
+
+  return ii->logger_impl.Poll(static_cast<unsigned int>(id), timeout,
+                              timed_out);
+}
+
+void CancelPollLogger(NT_LoggerPoller poller) {
+  Handle handle{poller};
+  int id = handle.GetTypedIndex(Handle::kLoggerPoller);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (id < 0 || !ii) return;
+
+  ii->logger_impl.CancelPoll(id);
+}
+
+void RemoveLogger(NT_Logger logger) {
+  Handle handle{logger};
+  int uid = handle.GetTypedIndex(Handle::kLogger);
+  auto ii = InstanceImpl::Get(handle.GetInst());
+  if (uid < 0 || !ii) return;
+
+  ii->logger_impl.Remove(uid);
+  ii->logger.set_min_level(ii->logger_impl.GetMinLevel());
+}
+
+bool WaitForLoggerQueue(NT_Inst inst, double timeout) {
+  int i = Handle{inst}.GetTypedInst(Handle::kInstance);
+  auto ii = InstanceImpl::Get(i);
+  if (!ii) return true;
+  return ii->logger_impl.WaitForQueue(timeout);
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/main/native/cpp/ntcore_test.cpp b/third_party/ntcore_2018/src/main/native/cpp/ntcore_test.cpp
new file mode 100644
index 0000000..ac5cc80
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/ntcore_test.cpp
@@ -0,0 +1,244 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ntcore_test.h"
+
+#include "Value_internal.h"
+
+extern "C" {
+struct NT_String* NT_GetStringForTesting(const char* string, int* struct_size) {
+  struct NT_String* str =
+      static_cast<NT_String*>(std::calloc(1, sizeof(NT_String)));
+  nt::ConvertToC(llvm::StringRef(string), str);
+  *struct_size = sizeof(NT_String);
+  return str;
+}
+
+struct NT_EntryInfo* NT_GetEntryInfoForTesting(const char* name,
+                                               enum NT_Type type,
+                                               unsigned int flags,
+                                               uint64_t last_change,
+                                               int* struct_size) {
+  struct NT_EntryInfo* entry_info =
+      static_cast<NT_EntryInfo*>(std::calloc(1, sizeof(NT_EntryInfo)));
+  nt::ConvertToC(llvm::StringRef(name), &entry_info->name);
+  entry_info->type = type;
+  entry_info->flags = flags;
+  entry_info->last_change = last_change;
+  *struct_size = sizeof(NT_EntryInfo);
+  return entry_info;
+}
+
+void NT_FreeEntryInfoForTesting(struct NT_EntryInfo* info) {
+  std::free(info->name.str);
+  std::free(info);
+}
+
+struct NT_ConnectionInfo* NT_GetConnectionInfoForTesting(
+    const char* remote_id, const char* remote_ip, unsigned int remote_port,
+    uint64_t last_update, unsigned int protocol_version, int* struct_size) {
+  struct NT_ConnectionInfo* conn_info = static_cast<NT_ConnectionInfo*>(
+      std::calloc(1, sizeof(NT_ConnectionInfo)));
+  nt::ConvertToC(llvm::StringRef(remote_id), &conn_info->remote_id);
+  nt::ConvertToC(llvm::StringRef(remote_ip), &conn_info->remote_ip);
+  conn_info->remote_port = remote_port;
+  conn_info->last_update = last_update;
+  conn_info->protocol_version = protocol_version;
+  *struct_size = sizeof(NT_ConnectionInfo);
+  return conn_info;
+}
+
+void NT_FreeConnectionInfoForTesting(struct NT_ConnectionInfo* info) {
+  std::free(info->remote_id.str);
+  std::free(info->remote_ip.str);
+  std::free(info);
+}
+
+struct NT_Value* NT_GetValueBooleanForTesting(uint64_t last_change, int val,
+                                              int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_BOOLEAN;
+  value->last_change = last_change;
+  value->data.v_boolean = val;
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+
+struct NT_Value* NT_GetValueDoubleForTesting(uint64_t last_change, double val,
+                                             int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_DOUBLE;
+  value->last_change = last_change;
+  value->data.v_double = val;
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+
+struct NT_Value* NT_GetValueStringForTesting(uint64_t last_change,
+                                             const char* str,
+                                             int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_STRING;
+  value->last_change = last_change;
+  nt::ConvertToC(llvm::StringRef(str), &value->data.v_string);
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+
+struct NT_Value* NT_GetValueRawForTesting(uint64_t last_change, const char* raw,
+                                          int raw_len, int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_RAW;
+  value->last_change = last_change;
+  nt::ConvertToC(llvm::StringRef(raw, raw_len), &value->data.v_string);
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+
+struct NT_Value* NT_GetValueBooleanArrayForTesting(uint64_t last_change,
+                                                   const int* arr,
+                                                   size_t array_len,
+                                                   int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_BOOLEAN_ARRAY;
+  value->last_change = last_change;
+  value->data.arr_boolean.arr = NT_AllocateBooleanArray(array_len);
+  value->data.arr_boolean.size = array_len;
+  std::memcpy(value->data.arr_boolean.arr, arr,
+              value->data.arr_boolean.size * sizeof(int));
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+
+struct NT_Value* NT_GetValueDoubleArrayForTesting(uint64_t last_change,
+                                                  const double* arr,
+                                                  size_t array_len,
+                                                  int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_BOOLEAN;
+  value->last_change = last_change;
+  value->data.arr_double.arr = NT_AllocateDoubleArray(array_len);
+  value->data.arr_double.size = array_len;
+  std::memcpy(value->data.arr_double.arr, arr,
+              value->data.arr_double.size * sizeof(int));
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+
+struct NT_Value* NT_GetValueStringArrayForTesting(uint64_t last_change,
+                                                  const struct NT_String* arr,
+                                                  size_t array_len,
+                                                  int* struct_size) {
+  struct NT_Value* value =
+      static_cast<NT_Value*>(std::calloc(1, sizeof(NT_Value)));
+  value->type = NT_BOOLEAN;
+  value->last_change = last_change;
+  value->data.arr_string.arr = NT_AllocateStringArray(array_len);
+  value->data.arr_string.size = array_len;
+  for (size_t i = 0; i < value->data.arr_string.size; ++i) {
+    size_t len = arr[i].len;
+    value->data.arr_string.arr[i].len = len;
+    value->data.arr_string.arr[i].str =
+        static_cast<char*>(std::malloc(len + 1));
+    std::memcpy(value->data.arr_string.arr[i].str, arr[i].str, len + 1);
+  }
+  *struct_size = sizeof(NT_Value);
+  return value;
+}
+// No need for free as one already exists in the main library
+
+static void CopyNtValue(const struct NT_Value* copy_from,
+                        struct NT_Value* copy_to) {
+  auto cpp_value = nt::ConvertFromC(*copy_from);
+  nt::ConvertToC(*cpp_value, copy_to);
+}
+
+static void CopyNtString(const struct NT_String* copy_from,
+                         struct NT_String* copy_to) {
+  nt::ConvertToC(llvm::StringRef(copy_from->str, copy_from->len), copy_to);
+}
+
+struct NT_RpcParamDef* NT_GetRpcParamDefForTesting(const char* name,
+                                                   const struct NT_Value* val,
+                                                   int* struct_size) {
+  struct NT_RpcParamDef* def =
+      static_cast<NT_RpcParamDef*>(std::calloc(1, sizeof(NT_RpcParamDef)));
+  nt::ConvertToC(llvm::StringRef(name), &def->name);
+  CopyNtValue(val, &def->def_value);
+  *struct_size = sizeof(NT_RpcParamDef);
+  return def;
+}
+
+void NT_FreeRpcParamDefForTesting(struct NT_RpcParamDef* def) {
+  NT_DisposeValue(&def->def_value);
+  NT_DisposeString(&def->name);
+  std::free(def);
+}
+
+struct NT_RpcResultDef* NT_GetRpcResultsDefForTesting(const char* name,
+                                                      enum NT_Type type,
+                                                      int* struct_size) {
+  struct NT_RpcResultDef* def =
+      static_cast<NT_RpcResultDef*>(std::calloc(1, sizeof(NT_RpcResultDef)));
+  nt::ConvertToC(llvm::StringRef(name), &def->name);
+  def->type = type;
+  *struct_size = sizeof(NT_RpcResultDef);
+  return def;
+}
+
+void NT_FreeRpcResultsDefForTesting(struct NT_RpcResultDef* def) {
+  NT_DisposeString(&def->name);
+  std::free(def);
+}
+
+struct NT_RpcDefinition* NT_GetRpcDefinitionForTesting(
+    unsigned int version, const char* name, size_t num_params,
+    const struct NT_RpcParamDef* params, size_t num_results,
+    const struct NT_RpcResultDef* results, int* struct_size) {
+  struct NT_RpcDefinition* def =
+      static_cast<NT_RpcDefinition*>(std::calloc(1, sizeof(NT_RpcDefinition)));
+  def->version = version;
+  nt::ConvertToC(llvm::StringRef(name), &def->name);
+  def->num_params = num_params;
+  def->params = static_cast<NT_RpcParamDef*>(
+      std::malloc(num_params * sizeof(NT_RpcParamDef)));
+  for (size_t i = 0; i < num_params; ++i) {
+    CopyNtString(&params[i].name, &def->params[i].name);
+    CopyNtValue(&params[i].def_value, &def->params[i].def_value);
+  }
+  def->num_results = num_results;
+  def->results = static_cast<NT_RpcResultDef*>(
+      std::malloc(num_results * sizeof(NT_RpcResultDef)));
+  for (size_t i = 0; i < num_results; ++i) {
+    CopyNtString(&results[i].name, &def->results[i].name);
+    def->results[i].type = results[i].type;
+  }
+  *struct_size = sizeof(NT_RpcDefinition);
+  return def;
+}
+// No need for free as one already exists in the main library
+
+struct NT_RpcAnswer* NT_GetRpcAnswerForTesting(
+    unsigned int rpc_id, unsigned int call_uid, const char* name,
+    const char* params, size_t params_len, int* struct_size) {
+  struct NT_RpcAnswer* info =
+      static_cast<NT_RpcAnswer*>(std::calloc(1, sizeof(NT_RpcAnswer)));
+  info->entry = rpc_id;
+  info->call = call_uid;
+  nt::ConvertToC(llvm::StringRef(name), &info->name);
+  nt::ConvertToC(llvm::StringRef(params, params_len), &info->params);
+  *struct_size = sizeof(NT_RpcAnswer);
+  return info;
+}
+// No need for free as one already exists in the main library
+}  // extern "C"
diff --git a/third_party/ntcore_2018/src/main/native/cpp/tables/ITableListener.cpp b/third_party/ntcore_2018/src/main/native/cpp/tables/ITableListener.cpp
new file mode 100644
index 0000000..f576b20
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/cpp/tables/ITableListener.cpp
@@ -0,0 +1,16 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "tables/ITableListener.h"
+
+#include "ntcore_c.h"
+
+void ITableListener::ValueChangedEx(ITable* source, llvm::StringRef key,
+                                    std::shared_ptr<nt::Value> value,
+                                    unsigned int flags) {
+  ValueChanged(source, key, value, (flags & NT_NOTIFY_NEW) != 0);
+}
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/EntryListenerFlags.h b/third_party/ntcore_2018/src/main/native/include/networktables/EntryListenerFlags.h
new file mode 100644
index 0000000..e6b6842
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/EntryListenerFlags.h
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_ENTRYLISTENERFLAGS_H_
+#define NTCORE_NETWORKTABLES_ENTRYLISTENERFLAGS_H_
+
+#include "ntcore_c.h"
+
+namespace nt {
+
+namespace EntryListenerFlags {
+
+/**
+ * Flag values for use with entry listeners.
+ *
+ * The flags are a bitmask and must be OR'ed together to indicate the
+ * combination of events desired to be received.
+ *
+ * The constants kNew, kDelete, kUpdate, and kFlags represent different events
+ * that can occur to entries.
+ *
+ * By default, notifications are only generated for remote changes occurring
+ * after the listener is created.  The constants kImmediate and kLocal are
+ * modifiers that cause notifications to be generated at other times.
+ */
+enum {
+  /** Initial listener addition.
+   * Set this flag to receive immediate notification of entries matching the
+   * flag criteria (generally only useful when combined with kNew).
+   */
+  kImmediate = NT_NOTIFY_IMMEDIATE,
+
+  /** Changed locally.
+   * Set this flag to receive notification of both local changes and changes
+   * coming from remote nodes.  By default, notifications are only generated
+   * for remote changes.  Must be combined with some combination of kNew,
+   * kDelete, kUpdate, and kFlags to receive notifications of those respective
+   * events.
+   */
+  kLocal = NT_NOTIFY_LOCAL,
+
+  /** Newly created entry.
+   * Set this flag to receive a notification when an entry is created.
+   */
+  kNew = NT_NOTIFY_NEW,
+
+  /** Entry was deleted.
+   * Set this flag to receive a notification when an entry is deleted.
+   */
+  kDelete = NT_NOTIFY_DELETE,
+
+  /** Entry's value changed.
+   * Set this flag to receive a notification when an entry's value (or type)
+   * changes.
+   */
+  kUpdate = NT_NOTIFY_UPDATE,
+
+  /** Entry's flags changed.
+   * Set this flag to receive a notification when an entry's flags value
+   * changes.
+   */
+  kFlags = NT_NOTIFY_FLAGS
+};
+
+}  // namespace EntryListenerFlags
+
+}  // namespace nt
+
+#endif  // NTCORE_NETWORKTABLES_ENTRYLISTENERFLAGS_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTable.h b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTable.h
new file mode 100644
index 0000000..0c049a2
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTable.h
@@ -0,0 +1,734 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_NETWORKTABLE_H_
+#define NTCORE_NETWORKTABLES_NETWORKTABLE_H_
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/StringMap.h>
+#include <llvm/Twine.h>
+#include <support/mutex.h>
+
+#include "networktables/NetworkTableEntry.h"
+#include "networktables/TableEntryListener.h"
+#include "networktables/TableListener.h"
+#include "ntcore_c.h"
+#include "tables/ITable.h"
+
+namespace nt {
+
+using llvm::ArrayRef;
+using llvm::StringRef;
+using llvm::Twine;
+
+class NetworkTableInstance;
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+/**
+ * A network table that knows its subtable path.
+ */
+class NetworkTable final : public ITable {
+ private:
+  NT_Inst m_inst;
+  std::string m_path;
+  mutable wpi::mutex m_mutex;
+  mutable llvm::StringMap<NT_Entry> m_entries;
+  typedef std::pair<ITableListener*, NT_EntryListener> Listener;
+  std::vector<Listener> m_listeners;
+
+  static std::vector<std::string> s_ip_addresses;
+  static std::string s_persistent_filename;
+  static bool s_client;
+  static bool s_enable_ds;
+  static bool s_running;
+  static unsigned int s_port;
+
+  struct private_init {};
+  friend class NetworkTableInstance;
+
+ public:
+  /**
+   * Gets the "base name" of a key. For example, "/foo/bar" becomes "bar".
+   * If the key has a trailing slash, returns an empty string.
+   * @param key key
+   * @return base name
+   */
+  static StringRef BasenameKey(StringRef key);
+
+  /**
+   * Normalizes an network table key to contain no consecutive slashes and
+   * optionally start with a leading slash. For example:
+   *
+   * <pre><code>
+   * normalizeKey("/foo/bar", true)  == "/foo/bar"
+   * normalizeKey("foo/bar", true)   == "/foo/bar"
+   * normalizeKey("/foo/bar", false) == "foo/bar"
+   * normalizeKey("foo//bar", false) == "foo/bar"
+   * </code></pre>
+   *
+   * @param key              the key to normalize
+   * @param withLeadingSlash whether or not the normalized key should begin
+   *                         with a leading slash
+   * @return normalized key
+   */
+  static std::string NormalizeKey(const Twine& key,
+                                  bool withLeadingSlash = true);
+
+  static StringRef NormalizeKey(const Twine& key,
+                                llvm::SmallVectorImpl<char>& buf,
+                                bool withLeadingSlash = true);
+
+  /**
+   * Gets a list of the names of all the super tables of a given key. For
+   * example, the key "/foo/bar/baz" has a hierarchy of "/", "/foo",
+   * "/foo/bar", and "/foo/bar/baz".
+   * @param key the key
+   * @return List of super tables
+   */
+  static std::vector<std::string> GetHierarchy(const Twine& key);
+
+  /**
+   * Constructor.  Use NetworkTableInstance::GetTable() or GetSubTable()
+   * instead.
+   */
+  NetworkTable(NT_Inst inst, const Twine& path, const private_init&);
+  virtual ~NetworkTable();
+
+  /**
+   * Gets the instance for the table.
+   * @return Instance
+   */
+  NetworkTableInstance GetInstance() const;
+
+  /**
+   * The path separator for sub-tables and keys
+   */
+  static const char PATH_SEPARATOR_CHAR;
+
+  /**
+   * Initializes network tables
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::StartServer() or "
+      "NetworkTableInstance::StartClient() instead")
+  static void Initialize();
+
+  /**
+   * Shuts down network tables
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::StopServer() or "
+      "NetworkTableInstance::StopClient() instead")
+  static void Shutdown();
+
+  /**
+   * set that network tables should be a client
+   * This must be called before initialize or GetTable
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::StartClient() instead")
+  static void SetClientMode();
+
+  /**
+   * set that network tables should be a server
+   * This must be called before initialize or GetTable
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::StartServer() instead")
+  static void SetServerMode();
+
+  /**
+   * set the team the robot is configured for (this will set the mdns address
+   * that network tables will connect to in client mode)
+   * This must be called before initialize or GetTable
+   * @param team the team number
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::SetServerTeam() or "
+      "NetworkTableInstance::StartClientTeam() instead")
+  static void SetTeam(int team);
+
+  /**
+   * @param address the adress that network tables will connect to in client
+   * mode
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::SetServer() or "
+      "NetworkTableInstance::StartClient() instead")
+  static void SetIPAddress(StringRef address);
+
+  /**
+   * @param addresses the addresses that network tables will connect to in
+   * client mode (in round robin order)
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::SetServer() or "
+      "NetworkTableInstance::StartClient() instead")
+  static void SetIPAddress(ArrayRef<std::string> addresses);
+
+  /**
+   * Set the port number that network tables will connect to in client
+   * mode or listen to in server mode.
+   * @param port the port number
+   */
+  WPI_DEPRECATED(
+      "use the appropriate parameters to NetworkTableInstance::SetServer(), "
+      "NetworkTableInstance::StartClient(), "
+      "NetworkTableInstance::StartServer(), and "
+      "NetworkTableInstance::StartDSClient() instead")
+  static void SetPort(unsigned int port);
+
+  /**
+   * Enable requesting the server address from the Driver Station.
+   * @param enabled whether to enable the connection to the local DS
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::StartDSClient() and "
+      "NetworkTableInstance::StopDSClient() instead")
+  static void SetDSClientEnabled(bool enabled);
+
+  /**
+   * Sets the persistent filename.
+   * @param filename the filename that the network tables server uses for
+   * automatic loading and saving of persistent values
+   */
+  WPI_DEPRECATED(
+      "use the appropriate parameter to NetworkTableInstance::StartServer() "
+      "instead")
+  static void SetPersistentFilename(StringRef filename);
+
+  /**
+   * Sets the network identity.
+   * This is provided in the connection info on the remote end.
+   * @param name identity
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::SetNetworkIdentity() instead")
+  static void SetNetworkIdentity(StringRef name);
+
+  /**
+   * Deletes ALL keys in ALL subtables.  Use with caution!
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::DeleteAllEntries() instead")
+  static void GlobalDeleteAll();
+
+  /**
+   * Flushes all updated values immediately to the network.
+   * Note: This is rate-limited to protect the network from flooding.
+   * This is primarily useful for synchronizing network updates with
+   * user code.
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::Flush() instead")
+  static void Flush();
+
+  /**
+   * Set the periodic update rate.
+   * Sets how frequently updates are sent to other nodes over the network.
+   *
+   * @param interval update interval in seconds (range 0.01 to 1.0)
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::SetUpdateRate() instead")
+  static void SetUpdateRate(double interval);
+
+  /**
+   * Saves persistent keys to a file.  The server does this automatically.
+   *
+   * @param filename file name
+   * @return Error (or nullptr).
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::SavePersistent() instead")
+  static const char* SavePersistent(StringRef filename);
+
+  /**
+   * Loads persistent keys from a file.  The server does this automatically.
+   *
+   * @param filename file name
+   * @param warn callback function called for warnings
+   * @return Error (or nullptr).
+   */
+  WPI_DEPRECATED("use NetworkTableInstance::LoadPersistent() instead")
+  static const char* LoadPersistent(
+      StringRef filename,
+      std::function<void(size_t line, const char* msg)> warn);
+
+  /**
+   * Gets the table with the specified key. If the table does not exist, a new
+   * table will be created.<br>
+   * This will automatically initialize network tables if it has not been
+   * already.
+   *
+   * @param key  the key name
+   * @return the network table requested
+   */
+  WPI_DEPRECATED(
+      "use NetworkTableInstance::GetTable() or "
+      "NetworkTableInstance::GetEntry() instead")
+  static std::shared_ptr<NetworkTable> GetTable(StringRef key);
+
+  /**
+   * Gets the entry for a subkey.
+   * @param key the key name
+   * @return Network table entry.
+   */
+  NetworkTableEntry GetEntry(const Twine& key) const;
+
+  /**
+   * Listen to keys only within this table.
+   * @param listener    listener to add
+   * @param flags       EntryListenerFlags bitmask
+   * @return Listener handle
+   */
+  NT_EntryListener AddEntryListener(TableEntryListener listener,
+                                    unsigned int flags) const;
+
+  /**
+   * Listen to a single key.
+   * @param key         the key name
+   * @param listener    listener to add
+   * @param flags       EntryListenerFlags bitmask
+   * @return Listener handle
+   */
+  NT_EntryListener AddEntryListener(const Twine& key,
+                                    TableEntryListener listener,
+                                    unsigned int flags) const;
+
+  /**
+   * Remove an entry listener.
+   * @param listener    listener handle
+   */
+  void RemoveEntryListener(NT_EntryListener listener) const;
+
+  /**
+   * Listen for sub-table creation.
+   * This calls the listener once for each newly created sub-table.
+   * It immediately calls the listener for any existing sub-tables.
+   * @param listener        listener to add
+   * @param localNotify     notify local changes as well as remote
+   * @return Listener handle
+   */
+  NT_EntryListener AddSubTableListener(TableListener listener,
+                                       bool localNotify = false) const;
+
+  /**
+   * Remove a sub-table listener.
+   * @param listener    listener handle
+   */
+  void RemoveTableListener(NT_EntryListener listener) const;
+
+  WPI_DEPRECATED(
+      "use AddEntryListener() instead with flags value of NT_NOTIFY_NEW | "
+      "NT_NOTIFY_UPDATE")
+  void AddTableListener(ITableListener* listener) override;
+
+  WPI_DEPRECATED(
+      "use AddEntryListener() instead with flags value of NT_NOTIFY_NEW | "
+      "NT_NOTIFY_UPDATE | NT_NOTIFY_IMMEDIATE")
+  void AddTableListener(ITableListener* listener,
+                        bool immediateNotify) override;
+
+  WPI_DEPRECATED("use AddEntryListener() instead")
+  void AddTableListenerEx(ITableListener* listener,
+                          unsigned int flags) override;
+
+  WPI_DEPRECATED("use AddEntryListener() instead")
+  void AddTableListener(StringRef key, ITableListener* listener,
+                        bool immediateNotify) override;
+
+  WPI_DEPRECATED("use AddEntryListener() instead")
+  void AddTableListenerEx(StringRef key, ITableListener* listener,
+                          unsigned int flags) override;
+
+  WPI_DEPRECATED("use AddSubTableListener(TableListener, bool) instead")
+  void AddSubTableListener(ITableListener* listener) override;
+
+  WPI_DEPRECATED("use AddSubTableListener(TableListener, bool) instead")
+  void AddSubTableListener(ITableListener* listener, bool localNotify) override;
+
+  WPI_DEPRECATED("use RemoveTableListener(NT_EntryListener) instead")
+  void RemoveTableListener(ITableListener* listener) override;
+
+  /**
+   * Returns the table at the specified key. If there is no table at the
+   * specified key, it will create a new table
+   *
+   * @param key the key name
+   * @return the networktable to be returned
+   */
+  std::shared_ptr<NetworkTable> GetSubTable(const Twine& key) const override;
+
+  /**
+   * Determines whether the given key is in this table.
+   *
+   * @param key the key to search for
+   * @return true if the table as a value assigned to the given key
+   */
+  bool ContainsKey(const Twine& key) const override;
+
+  /**
+   * Determines whether there exists a non-empty subtable for this key
+   * in this table.
+   *
+   * @param key the key to search for
+   * @return true if there is a subtable with the key which contains at least
+   * one key/subtable of its own
+   */
+  bool ContainsSubTable(const Twine& key) const override;
+
+  /**
+   * Gets all keys in the table (not including sub-tables).
+   * @param types bitmask of types; 0 is treated as a "don't care".
+   * @return keys currently in the table
+   */
+  std::vector<std::string> GetKeys(int types = 0) const override;
+
+  /**
+   * Gets the names of all subtables in the table.
+   * @return subtables currently in the table
+   */
+  std::vector<std::string> GetSubTables() const override;
+
+  /**
+   * Makes a key's value persistent through program restarts.
+   *
+   * @param key the key to make persistent
+   */
+  void SetPersistent(StringRef key) override;
+
+  /**
+   * Stop making a key's value persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  void ClearPersistent(StringRef key) override;
+
+  /**
+   * Returns whether the value is persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  bool IsPersistent(StringRef key) const override;
+
+  /**
+   * Sets flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to set (bitmask)
+   */
+  void SetFlags(StringRef key, unsigned int flags) override;
+
+  /**
+   * Clears flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to clear (bitmask)
+   */
+  void ClearFlags(StringRef key, unsigned int flags) override;
+
+  /**
+   * Returns the flags for the specified key.
+   *
+   * @param key the key name
+   * @return the flags, or 0 if the key is not defined
+   */
+  unsigned int GetFlags(StringRef key) const override;
+
+  /**
+   * Deletes the specified key in this table.
+   *
+   * @param key the key name
+   */
+  void Delete(const Twine& key) override;
+
+  /**
+   * Put a number in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutNumber(StringRef key, double value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultNumber(StringRef key, double defaultValue) override;
+
+  /**
+   * Gets the number associated with the given name.
+   *
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  double GetNumber(StringRef key, double defaultValue) const override;
+
+  /**
+   * Put a string in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutString(StringRef key, StringRef value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultString(StringRef key, StringRef defaultValue) override;
+
+  /**
+   * Gets the string associated with the given name. If the key does not
+   * exist or is of different type, it will return the default value.
+   *
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  std::string GetString(StringRef key, StringRef defaultValue) const override;
+
+  /**
+   * Put a boolean in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutBoolean(StringRef key, bool value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultBoolean(StringRef key, bool defaultValue) override;
+
+  /**
+   * Gets the boolean associated with the given name. If the key does not
+   * exist or is of different type, it will return the default value.
+   *
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  bool GetBoolean(StringRef key, bool defaultValue) const override;
+
+  /**
+   * Put a boolean array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   *
+   * @note The array must be of int's rather than of bool's because
+   *       std::vector<bool> is special-cased in C++.  0 is false, any
+   *       non-zero value is true.
+   */
+  bool PutBooleanArray(StringRef key, ArrayRef<int> value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultBooleanArray(StringRef key,
+                              ArrayRef<int> defaultValue) override;
+
+  /**
+   * Returns the boolean array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   *
+   * @note The returned array is std::vector<int> instead of std::vector<bool>
+   *       because std::vector<bool> is special-cased in C++.  0 is false, any
+   *       non-zero value is true.
+   */
+  std::vector<int> GetBooleanArray(StringRef key,
+                                   ArrayRef<int> defaultValue) const override;
+
+  /**
+   * Put a number array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutNumberArray(StringRef key, ArrayRef<double> value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultNumberArray(StringRef key,
+                             ArrayRef<double> defaultValue) override;
+
+  /**
+   * Returns the number array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  std::vector<double> GetNumberArray(
+      StringRef key, ArrayRef<double> defaultValue) const override;
+
+  /**
+   * Put a string array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutStringArray(StringRef key, ArrayRef<std::string> value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultStringArray(StringRef key,
+                             ArrayRef<std::string> defaultValue) override;
+
+  /**
+   * Returns the string array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  std::vector<std::string> GetStringArray(
+      StringRef key, ArrayRef<std::string> defaultValue) const override;
+
+  /**
+   * Put a raw value (byte array) in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutRaw(StringRef key, StringRef value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultRaw(StringRef key, StringRef defaultValue) override;
+
+  /**
+   * Returns the raw value (byte array) the key maps to. If the key does not
+   * exist or is of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the raw contents.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  std::string GetRaw(StringRef key, StringRef defaultValue) const override;
+
+  /**
+   * Put a value in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  bool PutValue(const Twine& key, std::shared_ptr<Value> value) override;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  bool SetDefaultValue(const Twine& key,
+                       std::shared_ptr<Value> defaultValue) override;
+
+  /**
+   * Gets the value associated with a key as an object
+   *
+   * @param key the key of the value to look up
+   * @return the value associated with the given key, or nullptr if the key
+   * does not exist
+   */
+  std::shared_ptr<Value> GetValue(const Twine& key) const override;
+
+  /**
+   * Gets the full path of this table.  Does not include the trailing "/".
+   * @return The path (e.g "", "/foo").
+   */
+  StringRef GetPath() const override;
+
+  /**
+   * Save table values to a file.  The file format used is identical to
+   * that used for SavePersistent.
+   * @param filename  filename
+   * @return error string, or nullptr if successful
+   */
+  const char* SaveEntries(const Twine& filename) const;
+
+  /**
+   * Load table values from a file.  The file format used is identical to
+   * that used for SavePersistent / LoadPersistent.
+   * @param filename  filename
+   * @param warn      callback function for warnings
+   * @return error string, or nullptr if successful
+   */
+  const char* LoadEntries(
+      const Twine& filename,
+      std::function<void(size_t line, const char* msg)> warn);
+};
+
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+}  // namespace nt
+
+// For backwards compatability
+#ifndef NAMESPACED_NT
+using nt::NetworkTable;  // NOLINT
+#endif
+
+#endif  // NTCORE_NETWORKTABLES_NETWORKTABLE_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableEntry.h b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableEntry.h
new file mode 100644
index 0000000..c4fddce
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableEntry.h
@@ -0,0 +1,454 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_NETWORKTABLEENTRY_H_
+#define NTCORE_NETWORKTABLES_NETWORKTABLEENTRY_H_
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+
+#include "networktables/NetworkTableType.h"
+#include "networktables/NetworkTableValue.h"
+#include "networktables/RpcCall.h"
+#include "ntcore_c.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+using llvm::ArrayRef;
+using llvm::StringRef;
+using llvm::Twine;
+
+class NetworkTableInstance;
+
+/** NetworkTables Entry */
+class NetworkTableEntry final {
+ public:
+  /**
+   * Flag values (as returned by {@link #getFlags()}).
+   */
+  enum Flags { kPersistent = NT_PERSISTENT };
+
+  /**
+   * Construct invalid instance.
+   */
+  NetworkTableEntry();
+
+  /**
+   * Construct from native handle.
+   * @param handle Native handle
+   */
+  explicit NetworkTableEntry(NT_Entry handle);
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  explicit operator bool() const { return m_handle != 0; }
+
+  /**
+   * Gets the native handle for the entry.
+   * @return Native handle
+   */
+  NT_Entry GetHandle() const;
+
+  /**
+   * Gets the instance for the entry.
+   * @return Instance
+   */
+  NetworkTableInstance GetInstance() const;
+
+  /**
+   * Determines if the entry currently exists.
+   * @return True if the entry exists, false otherwise.
+   */
+  bool Exists() const;
+
+  /**
+   * Gets the name of the entry (the key).
+   * @return the entry's name
+   */
+  std::string GetName() const;
+
+  /**
+   * Gets the type of the entry.
+   * @return the entry's type
+   */
+  NetworkTableType GetType() const;
+
+  /**
+   * Returns the flags.
+   * @return the flags (bitmask)
+   */
+  unsigned int GetFlags() const;
+
+  /**
+   * Gets the last time the entry's value was changed.
+   * @return Entry last change time
+   */
+  uint64_t GetLastChange() const;
+
+  /**
+   * Gets combined information about the entry.
+   * @return Entry information
+   */
+  EntryInfo GetInfo() const;
+
+  /**
+   * Gets the entry's value. If the entry does not exist, returns nullptr.
+   *
+   * @return the entry's value or nullptr if it does not exist.
+   */
+  std::shared_ptr<Value> GetValue() const;
+
+  /**
+   * Gets the entry's value as a boolean. If the entry does not exist or is of
+   * different type, it will return the default value.
+   *
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  bool GetBoolean(bool defaultValue) const;
+
+  /**
+   * Gets the entry's value as a double. If the entry does not exist or is of
+   * different type, it will return the default value.
+   *
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  double GetDouble(double defaultValue) const;
+
+  /**
+   * Gets the entry's value as a string. If the entry does not exist or is of
+   * different type, it will return the default value.
+   *
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  std::string GetString(StringRef defaultValue) const;
+
+  /**
+   * Gets the entry's value as a raw. If the entry does not exist or is of
+   * different type, it will return the default value.
+   *
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   */
+  std::string GetRaw(StringRef defaultValue) const;
+
+  /**
+   * Gets the entry's value as a boolean array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   *
+   * @note The returned array is std::vector<int> instead of std::vector<bool>
+   *       because std::vector<bool> is special-cased in C++.  0 is false, any
+   *       non-zero value is true.
+   */
+  std::vector<int> GetBooleanArray(ArrayRef<int> defaultValue) const;
+
+  /**
+   * Gets the entry's value as a double array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  std::vector<double> GetDoubleArray(ArrayRef<double> defaultValue) const;
+
+  /**
+   * Gets the entry's value as a string array. If the entry does not exist
+   * or is of different type, it will return the default value.
+   * @param defaultValue the value to be returned if no value is found
+   * @return the entry's value or the given default value
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  std::vector<std::string> GetStringArray(
+      ArrayRef<std::string> defaultValue) const;
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultValue(std::shared_ptr<Value> value);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultBoolean(bool defaultValue);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultDouble(double defaultValue);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultString(const Twine& defaultValue);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultRaw(StringRef defaultValue);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultBooleanArray(ArrayRef<int> defaultValue);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultDoubleArray(ArrayRef<double> defaultValue);
+
+  /**
+   * Sets the entry's value if it does not exist.
+   * @param defaultValue the default value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDefaultStringArray(ArrayRef<std::string> defaultValue);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetValue(std::shared_ptr<Value> value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetBoolean(bool value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDouble(double value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetString(const Twine& value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetRaw(StringRef value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetBooleanArray(ArrayRef<int> value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetDoubleArray(ArrayRef<double> value);
+
+  /**
+   * Sets the entry's value.
+   * @param value the value to set
+   * @return False if the entry exists with a different type
+   */
+  bool SetStringArray(ArrayRef<std::string> value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetValue(std::shared_ptr<Value> value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetBoolean(bool value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetDouble(double value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetString(const Twine& value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetRaw(StringRef value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetBooleanArray(ArrayRef<int> value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetDoubleArray(ArrayRef<double> value);
+
+  /**
+   * Sets the entry's value.  If the value is of different type, the type is
+   * changed to match the new value.
+   * @param value the value to set
+   */
+  void ForceSetStringArray(ArrayRef<std::string> value);
+
+  /**
+   * Sets flags.
+   * @param flags the flags to set (bitmask)
+   */
+  void SetFlags(unsigned int flags);
+
+  /**
+   * Clears flags.
+   * @param flags the flags to clear (bitmask)
+   */
+  void ClearFlags(unsigned int flags);
+
+  /**
+   * Make value persistent through program restarts.
+   */
+  void SetPersistent();
+
+  /**
+   * Stop making value persistent through program restarts.
+   */
+  void ClearPersistent();
+
+  /**
+   * Returns whether the value is persistent through program restarts.
+   * @return True if the value is persistent.
+   */
+  bool IsPersistent() const;
+
+  /**
+   * Deletes the entry.
+   */
+  void Delete();
+
+  /**
+   * Create a callback-based RPC entry point.  Only valid to use on the server.
+   * The callback function will be called when the RPC is called.
+   * This function creates RPC version 0 definitions (raw data in and out).
+   * @param callback  callback function
+   */
+  void CreateRpc(std::function<void(const RpcAnswer& answer)> callback);
+
+  /**
+   * Create a polled RPC entry point.  Only valid to use on the server.
+   * The caller is responsible for calling NetworkTableInstance::PollRpc()
+   * to poll for servicing incoming RPC calls.
+   * This function creates RPC version 0 definitions (raw data in and out).
+   */
+  void CreatePolledRpc();
+
+  /**
+   * Call a RPC function.  May be used on either the client or server.
+   * This function is non-blocking.  Either RpcCall::GetResult() or
+   * RpcCall::CancelResult() must be called on the return value to either
+   * get or ignore the result of the call.
+   * @param params      parameter
+   * @return RPC call object.
+   */
+  RpcCall CallRpc(StringRef params);
+
+  /**
+   * Add a listener for changes to this entry.
+   *
+   * @param callback          listener to add
+   * @param flags             NotifyKind bitmask
+   * @return Listener handle
+   */
+  NT_EntryListener AddListener(
+      std::function<void(const EntryNotification& event)> callback,
+      unsigned int flags) const;
+
+  /**
+   * Remove an entry listener.
+   * @param entry_listener Listener handle to remove
+   */
+  void RemoveListener(NT_EntryListener entry_listener);
+
+  /**
+   * Equality operator.  Returns true if both instances refer to the same
+   * native handle.
+   */
+  bool operator==(const NetworkTableEntry& oth) const {
+    return m_handle == oth.m_handle;
+  }
+
+  /** Inequality operator. */
+  bool operator!=(const NetworkTableEntry& oth) const {
+    return !(*this == oth);
+  }
+
+ protected:
+  /* Native handle */
+  NT_Entry m_handle;
+};
+
+}  // namespace nt
+
+#include "networktables/NetworkTableEntry.inl"
+
+#endif  // NTCORE_NETWORKTABLES_NETWORKTABLEENTRY_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableEntry.inl b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableEntry.inl
new file mode 100644
index 0000000..f95b1a8
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableEntry.inl
@@ -0,0 +1,232 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NT_ENTRY_INL_
+#define NT_ENTRY_INL_
+
+namespace nt {
+
+inline NetworkTableEntry::NetworkTableEntry() : m_handle{0} {}
+
+inline NetworkTableEntry::NetworkTableEntry(NT_Entry handle)
+    : m_handle{handle} {}
+
+inline NT_Entry NetworkTableEntry::GetHandle() const { return m_handle; }
+
+inline bool NetworkTableEntry::Exists() const {
+  return GetEntryType(m_handle) != NT_UNASSIGNED;
+}
+
+inline std::string NetworkTableEntry::GetName() const {
+  return GetEntryName(m_handle);
+}
+
+inline NetworkTableType NetworkTableEntry::GetType() const {
+  return static_cast<NetworkTableType>(GetEntryType(m_handle));
+}
+
+inline unsigned int NetworkTableEntry::GetFlags() const {
+  return GetEntryFlags(m_handle);
+}
+
+inline uint64_t NetworkTableEntry::GetLastChange() const {
+  return GetEntryLastChange(m_handle);
+}
+
+inline EntryInfo NetworkTableEntry::GetInfo() const {
+  return GetEntryInfo(m_handle);
+}
+
+inline std::shared_ptr<Value> NetworkTableEntry::GetValue() const {
+  return GetEntryValue(m_handle);
+}
+
+inline bool NetworkTableEntry::GetBoolean(bool defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_BOOLEAN) return defaultValue;
+  return value->GetBoolean();
+}
+
+inline double NetworkTableEntry::GetDouble(double defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_DOUBLE) return defaultValue;
+  return value->GetDouble();
+}
+
+inline std::string NetworkTableEntry::GetString(StringRef defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_STRING) return defaultValue;
+  return value->GetString();
+}
+
+inline std::string NetworkTableEntry::GetRaw(StringRef defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_RAW) return defaultValue;
+  return value->GetString();
+}
+
+inline std::vector<int> NetworkTableEntry::GetBooleanArray(
+    ArrayRef<int> defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_BOOLEAN_ARRAY) return defaultValue;
+  return value->GetBooleanArray();
+}
+
+inline std::vector<double> NetworkTableEntry::GetDoubleArray(
+    ArrayRef<double> defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_DOUBLE_ARRAY) return defaultValue;
+  return value->GetDoubleArray();
+}
+
+inline std::vector<std::string> NetworkTableEntry::GetStringArray(
+    ArrayRef<std::string> defaultValue) const {
+  auto value = GetEntryValue(m_handle);
+  if (!value || value->type() != NT_STRING_ARRAY) return defaultValue;
+  return value->GetStringArray();
+}
+
+inline bool NetworkTableEntry::SetDefaultValue(std::shared_ptr<Value> value) {
+  return SetDefaultEntryValue(m_handle, value);
+}
+
+inline bool NetworkTableEntry::SetDefaultBoolean(bool defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeBoolean(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetDefaultDouble(double defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeDouble(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetDefaultString(const Twine& defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeString(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetDefaultRaw(StringRef defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeRaw(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetDefaultBooleanArray(
+    ArrayRef<int> defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeBooleanArray(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetDefaultDoubleArray(
+    ArrayRef<double> defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeDoubleArray(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetDefaultStringArray(
+    ArrayRef<std::string> defaultValue) {
+  return SetDefaultEntryValue(m_handle, Value::MakeStringArray(defaultValue));
+}
+
+inline bool NetworkTableEntry::SetValue(std::shared_ptr<Value> value) {
+  return SetEntryValue(m_handle, value);
+}
+
+inline bool NetworkTableEntry::SetBoolean(bool value) {
+  return SetEntryValue(m_handle, Value::MakeBoolean(value));
+}
+
+inline bool NetworkTableEntry::SetDouble(double value) {
+  return SetEntryValue(m_handle, Value::MakeDouble(value));
+}
+
+inline bool NetworkTableEntry::SetString(const Twine& value) {
+  return SetEntryValue(m_handle, Value::MakeString(value));
+}
+
+inline bool NetworkTableEntry::SetRaw(StringRef value) {
+  return SetEntryValue(m_handle, Value::MakeRaw(value));
+}
+
+inline bool NetworkTableEntry::SetBooleanArray(ArrayRef<int> value) {
+  return SetEntryValue(m_handle, Value::MakeBooleanArray(value));
+}
+
+inline bool NetworkTableEntry::SetDoubleArray(ArrayRef<double> value) {
+  return SetEntryValue(m_handle, Value::MakeDoubleArray(value));
+}
+
+inline bool NetworkTableEntry::SetStringArray(ArrayRef<std::string> value) {
+  return SetEntryValue(m_handle, Value::MakeStringArray(value));
+}
+
+inline void NetworkTableEntry::ForceSetValue(std::shared_ptr<Value> value) {
+  SetEntryTypeValue(m_handle, value);
+}
+
+inline void NetworkTableEntry::ForceSetBoolean(bool value) {
+  SetEntryTypeValue(m_handle, Value::MakeBoolean(value));
+}
+
+inline void NetworkTableEntry::ForceSetDouble(double value) {
+  SetEntryTypeValue(m_handle, Value::MakeDouble(value));
+}
+
+inline void NetworkTableEntry::ForceSetString(const Twine& value) {
+  SetEntryTypeValue(m_handle, Value::MakeString(value));
+}
+
+inline void NetworkTableEntry::ForceSetRaw(StringRef value) {
+  SetEntryTypeValue(m_handle, Value::MakeRaw(value));
+}
+
+inline void NetworkTableEntry::ForceSetBooleanArray(ArrayRef<int> value) {
+  SetEntryTypeValue(m_handle, Value::MakeBooleanArray(value));
+}
+
+inline void NetworkTableEntry::ForceSetDoubleArray(ArrayRef<double> value) {
+  SetEntryTypeValue(m_handle, Value::MakeDoubleArray(value));
+}
+
+inline void NetworkTableEntry::ForceSetStringArray(
+    ArrayRef<std::string> value) {
+  SetEntryTypeValue(m_handle, Value::MakeStringArray(value));
+}
+
+inline void NetworkTableEntry::SetFlags(unsigned int flags) {
+  SetEntryFlags(m_handle, GetFlags() | flags);
+}
+
+inline void NetworkTableEntry::ClearFlags(unsigned int flags) {
+  SetEntryFlags(m_handle, GetFlags() & ~flags);
+}
+
+inline void NetworkTableEntry::SetPersistent() { SetFlags(kPersistent); }
+
+inline void NetworkTableEntry::ClearPersistent() { ClearFlags(kPersistent); }
+
+inline bool NetworkTableEntry::IsPersistent() const {
+  return (GetFlags() & kPersistent) != 0;
+}
+
+inline void NetworkTableEntry::Delete() { DeleteEntry(m_handle); }
+
+inline void NetworkTableEntry::CreateRpc(
+    std::function<void(const RpcAnswer& answer)> callback) {
+  ::nt::CreateRpc(m_handle, StringRef("\0", 1), callback);
+}
+
+inline RpcCall NetworkTableEntry::CallRpc(StringRef params) {
+  return RpcCall{m_handle, ::nt::CallRpc(m_handle, params)};
+}
+
+inline NT_EntryListener NetworkTableEntry::AddListener(
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags) const {
+  return AddEntryListener(m_handle, callback, flags);
+}
+
+inline void NetworkTableEntry::RemoveListener(NT_EntryListener entry_listener) {
+  RemoveEntryListener(entry_listener);
+}
+
+}  // namespace nt
+
+#endif  // NT_ENTRY_INL_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableInstance.h b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableInstance.h
new file mode 100644
index 0000000..fc5c53a
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableInstance.h
@@ -0,0 +1,548 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_NETWORKTABLEINSTANCE_H_
+#define NTCORE_NETWORKTABLES_NETWORKTABLEINSTANCE_H_
+
+#include <functional>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+
+#include "networktables/NetworkTable.h"
+#include "networktables/NetworkTableEntry.h"
+#include "ntcore_c.h"
+#include "ntcore_cpp.h"
+
+#ifndef NT_NOEXCEPT
+#ifdef _MSC_VER
+#if _MSC_VER >= 1900
+#define NT_NOEXCEPT noexcept
+#else
+#define NT_NOEXCEPT throw()
+#endif
+#else
+#define NT_NOEXCEPT noexcept
+#endif
+#endif
+
+namespace nt {
+
+using llvm::ArrayRef;
+using llvm::StringRef;
+using llvm::Twine;
+
+/** NetworkTables Instance.
+ *
+ * Instances are completely independent from each other.  Table operations on
+ * one instance will not be visible to other instances unless the instances are
+ * connected via the network.  The main limitation on instances is that you
+ * cannot have two servers on the same network port.  The main utility of
+ * instances is for unit testing, but they can also enable one program to
+ * connect to two different NetworkTables networks.
+ *
+ * The global "default" instance (as returned by GetDefault()) is
+ * always available, and is intended for the common case when there is only
+ * a single NetworkTables instance being used in the program.  The
+ * default instance cannot be destroyed.
+ *
+ * Additional instances can be created with the Create() function.
+ * Instances are not reference counted or RAII.  Instead, they must be
+ * explicitly destroyed (with Destroy()).
+ */
+class NetworkTableInstance final {
+ public:
+  /**
+   * Client/server mode flag values (as returned by GetNetworkMode()).
+   * This is a bitmask.
+   */
+  enum NetworkMode {
+    kNetModeNone = NT_NET_MODE_NONE,
+    kNetModeServer = NT_NET_MODE_SERVER,
+    kNetModeClient = NT_NET_MODE_CLIENT,
+    kNetModeStarting = NT_NET_MODE_STARTING,
+    kNetModeFailure = NT_NET_MODE_FAILURE
+  };
+
+  /**
+   * Logging levels (as used by SetLogger()).
+   */
+  enum LogLevel {
+    kLogCritical = NT_LOG_CRITICAL,
+    kLogError = NT_LOG_ERROR,
+    kLogWarning = NT_LOG_WARNING,
+    kLogInfo = NT_LOG_INFO,
+    kLogDebug = NT_LOG_DEBUG,
+    kLogDebug1 = NT_LOG_DEBUG1,
+    kLogDebug2 = NT_LOG_DEBUG2,
+    kLogDebug3 = NT_LOG_DEBUG3,
+    kLogDebug4 = NT_LOG_DEBUG4
+  };
+
+  /**
+   * The default port that network tables operates on.
+   */
+  enum { kDefaultPort = NT_DEFAULT_PORT };
+
+  /**
+   * Construct invalid instance.
+   */
+  NetworkTableInstance() NT_NOEXCEPT;
+
+  /**
+   * Construct from native handle.
+   * @param handle Native handle
+   */
+  explicit NetworkTableInstance(NT_Inst inst) NT_NOEXCEPT;
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  explicit operator bool() const { return m_handle != 0; }
+
+  /**
+   * Get global default instance.
+   * @return Global default instance
+   */
+  static NetworkTableInstance GetDefault();
+
+  /**
+   * Create an instance.
+   * @return Newly created instance
+   */
+  static NetworkTableInstance Create();
+
+  /**
+   * Destroys an instance (note: this has global effect).
+   * @param inst Instance
+   */
+  static void Destroy(NetworkTableInstance inst);
+
+  /**
+   * Gets the native handle for the entry.
+   * @return Native handle
+   */
+  NT_Inst GetHandle() const;
+
+  /**
+   * Gets the entry for a key.
+   * @param name Key
+   * @return Network table entry.
+   */
+  NetworkTableEntry GetEntry(const Twine& name);
+
+  /**
+   * Get entries starting with the given prefix.
+   * The results are optionally filtered by string prefix and entry type to
+   * only return a subset of all entries.
+   *
+   * @param prefix entry name required prefix; only entries whose name
+   * starts with this string are returned
+   * @param types bitmask of types; 0 is treated as a "don't care"
+   * @return Array of entries.
+   */
+  std::vector<NetworkTableEntry> GetEntries(const Twine& prefix,
+                                            unsigned int types);
+
+  /**
+   * Get information about entries starting with the given prefix.
+   * The results are optionally filtered by string prefix and entry type to
+   * only return a subset of all entries.
+   *
+   * @param prefix entry name required prefix; only entries whose name
+   * starts with this string are returned
+   * @param types bitmask of types; 0 is treated as a "don't care"
+   * @return Array of entry information.
+   */
+  std::vector<EntryInfo> GetEntryInfo(const Twine& prefix,
+                                      unsigned int types) const;
+
+  /**
+   * Gets the table with the specified key.
+   *
+   * @param key the key name
+   * @return The network table
+   */
+  std::shared_ptr<NetworkTable> GetTable(const Twine& key) const;
+
+  /**
+   * Deletes ALL keys in ALL subtables (except persistent values).
+   * Use with caution!
+   */
+  void DeleteAllEntries();
+
+  /**
+   * @defgroup EntryListenerFunctions Entry Listener Functions
+   * @{
+   */
+
+  /**
+   * Add a listener for all entries starting with a certain prefix.
+   *
+   * @param prefix            UTF-8 string prefix
+   * @param callback          listener to add
+   * @param flags             EntryListenerFlags bitmask
+   * @return Listener handle
+   */
+  NT_EntryListener AddEntryListener(
+      const Twine& prefix,
+      std::function<void(const EntryNotification& event)> callback,
+      unsigned int flags) const;
+
+  /**
+   * Remove an entry listener.
+   * @param entry_listener Listener handle to remove
+   */
+  static void RemoveEntryListener(NT_EntryListener entry_listener);
+
+  /**
+   * Wait for the entry listener queue to be empty.  This is primarily useful
+   * for deterministic testing.  This blocks until either the entry listener
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  bool WaitForEntryListenerQueue(double timeout);
+
+  /** @} */
+
+  /**
+   * @defgroup ConnectionListenerFunctions Connection Listener Functions
+   * @{
+   */
+
+  /**
+   * Add a connection listener.
+   *
+   * @param callback          listener to add
+   * @param immediate_notify  notify listener of all existing connections
+   * @return Listener handle
+   */
+  NT_ConnectionListener AddConnectionListener(
+      std::function<void(const ConnectionNotification& event)> callback,
+      bool immediate_notify) const;
+
+  /**
+   * Remove a connection listener.
+   * @param conn_listener Listener handle to remove
+   */
+  static void RemoveConnectionListener(NT_ConnectionListener conn_listener);
+
+  /**
+   * Wait for the connection listener queue to be empty.  This is primarily
+   * useful
+   * for deterministic testing.  This blocks until either the connection
+   * listener
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  bool WaitForConnectionListenerQueue(double timeout);
+
+  /** @} */
+
+  /**
+   * @defgroup RpcFunctions Remote Procedure Call Functions
+   * @{
+   */
+
+  /**
+   * Wait for the incoming RPC call queue to be empty.  This is primarily useful
+   * for deterministic testing.  This blocks until either the RPC call
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  bool WaitForRpcCallQueue(double timeout);
+
+  /** @} */
+
+  /**
+   * @defgroup NetworkFunctions Client/Server Functions
+   * @{
+   */
+
+  /**
+   * Set the network identity of this node.
+   * This is the name used during the initial connection handshake, and is
+   * visible through ConnectionInfo on the remote node.
+   * @param name      identity to advertise
+   */
+  void SetNetworkIdentity(const Twine& name);
+
+  /**
+   * Get the current network mode.
+   * @return Bitmask of NetworkMode.
+   */
+  unsigned int GetNetworkMode() const;
+
+  /**
+   * Starts a server using the specified filename, listening address, and port.
+   *
+   * @param persist_filename  the name of the persist file to use (UTF-8 string,
+   *                          null terminated)
+   * @param listen_address    the address to listen on, or null to listen on any
+   *                          address (UTF-8 string, null terminated)
+   * @param port              port to communicate over
+   */
+  void StartServer(const Twine& persist_filename = "networktables.ini",
+                   const char* listen_address = "",
+                   unsigned int port = kDefaultPort);
+
+  /**
+   * Stops the server if it is running.
+   */
+  void StopServer();
+
+  /**
+   * Starts a client.  Use SetServer to set the server name and port.
+   */
+  void StartClient();
+
+  /**
+   * Starts a client using the specified server and port
+   *
+   * @param server_name server name (UTF-8 string, null terminated)
+   * @param port        port to communicate over
+   */
+  void StartClient(const char* server_name, unsigned int port = kDefaultPort);
+
+  /**
+   * Starts a client using the specified (server, port) combinations.  The
+   * client will attempt to connect to each server in round robin fashion.
+   *
+   * @param servers   array of server name and port pairs
+   */
+  void StartClient(ArrayRef<std::pair<StringRef, unsigned int>> servers);
+
+  /**
+   * Starts a client using the specified servers and port.  The
+   * client will attempt to connect to each server in round robin fashion.
+   *
+   * @param servers   array of server names
+   * @param port      port to communicate over
+   */
+  void StartClient(ArrayRef<StringRef> servers,
+                   unsigned int port = kDefaultPort);
+
+  /**
+   * Starts a client using commonly known robot addresses for the specified
+   * team.
+   *
+   * @param team        team number
+   * @param port        port to communicate over
+   */
+  void StartClientTeam(unsigned int team, unsigned int port = kDefaultPort);
+
+  /**
+   * Stops the client if it is running.
+   */
+  void StopClient();
+
+  /**
+   * Sets server address and port for client (without restarting client).
+   *
+   * @param server_name server name (UTF-8 string, null terminated)
+   * @param port        port to communicate over
+   */
+  void SetServer(const char* server_name, unsigned int port = kDefaultPort);
+
+  /**
+   * Sets server addresses and ports for client (without restarting client).
+   * The client will attempt to connect to each server in round robin fashion.
+   *
+   * @param servers   array of server name and port pairs
+   */
+  void SetServer(ArrayRef<std::pair<StringRef, unsigned int>> servers);
+
+  /**
+   * Sets server addresses and port for client (without restarting client).
+   * The client will attempt to connect to each server in round robin fashion.
+   *
+   * @param servers   array of server names
+   * @param port      port to communicate over
+   */
+  void SetServer(ArrayRef<StringRef> servers, unsigned int port = kDefaultPort);
+
+  /**
+   * Sets server addresses and port for client (without restarting client).
+   * Connects using commonly known robot addresses for the specified team.
+   *
+   * @param team        team number
+   * @param port        port to communicate over
+   */
+  void SetServerTeam(unsigned int team, unsigned int port = kDefaultPort);
+
+  /**
+   * Starts requesting server address from Driver Station.
+   * This connects to the Driver Station running on localhost to obtain the
+   * server IP address.
+   *
+   * @param port server port to use in combination with IP from DS
+   */
+  void StartDSClient(unsigned int port = kDefaultPort);
+
+  /**
+   * Stops requesting server address from Driver Station.
+   */
+  void StopDSClient();
+
+  /**
+   * Set the periodic update rate.
+   * Sets how frequently updates are sent to other nodes over the network.
+   *
+   * @param interval update interval in seconds (range 0.01 to 1.0)
+   */
+  void SetUpdateRate(double interval);
+
+  /**
+   * Flushes all updated values immediately to the network.
+   * @note This is rate-limited to protect the network from flooding.
+   * This is primarily useful for synchronizing network updates with
+   * user code.
+   */
+  void Flush() const;
+
+  /**
+   * Get information on the currently established network connections.
+   * If operating as a client, this will return either zero or one values.
+   * @return array of connection information
+   */
+  std::vector<ConnectionInfo> GetConnections() const;
+
+  /**
+   * Return whether or not the instance is connected to another node.
+   * @return True if connected.
+   */
+  bool IsConnected() const;
+
+  /** @} */
+
+  /**
+   * @defgroup FileFunctions File Save/Load Functions
+   * @{
+   */
+
+  /**
+   * Save persistent values to a file.  The server automatically does this,
+   * but this function provides a way to save persistent values in the same
+   * format to a file on either a client or a server.
+   * @param filename  filename
+   * @return error string, or nullptr if successful
+   */
+  const char* SavePersistent(const Twine& filename) const;
+
+  /**
+   * Load persistent values from a file.  The server automatically does this
+   * at startup, but this function provides a way to restore persistent values
+   * in the same format from a file at any time on either a client or a server.
+   * @param filename  filename
+   * @param warn      callback function for warnings
+   * @return error string, or nullptr if successful
+   */
+  const char* LoadPersistent(
+      const Twine& filename,
+      std::function<void(size_t line, const char* msg)> warn);
+
+  /**
+   * Save table values to a file.  The file format used is identical to
+   * that used for SavePersistent.
+   * @param filename  filename
+   * @param prefix    save only keys starting with this prefix
+   * @return error string, or nullptr if successful
+   */
+  const char* SaveEntries(const Twine& filename, const Twine& prefix) const;
+
+  /**
+   * Load table values from a file.  The file format used is identical to
+   * that used for SavePersistent / LoadPersistent.
+   * @param filename  filename
+   * @param prefix    load only keys starting with this prefix
+   * @param warn      callback function for warnings
+   * @return error string, or nullptr if successful
+   */
+  const char* LoadEntries(
+      const Twine& filename, const Twine& prefix,
+      std::function<void(size_t line, const char* msg)> warn);
+
+  /** @} */
+
+  /**
+   * @defgroup LoggerFunctions Logger Functions
+   * @{
+   */
+
+  /**
+   * Add logger callback function.  By default, log messages are sent to stderr;
+   * this function sends log messages with the specified levels to the provided
+   * callback function instead.  The callback function will only be called for
+   * log messages with level greater than or equal to minLevel and less than or
+   * equal to maxLevel; messages outside this range will be silently ignored.
+   *
+   * @param func        log callback function
+   * @param minLevel    minimum log level
+   * @param maxLevel    maximum log level
+   * @return Logger handle
+   */
+  NT_Logger AddLogger(std::function<void(const LogMessage& msg)> func,
+                      unsigned int min_level, unsigned int max_level);
+
+  /**
+   * Remove a logger.
+   * @param logger Logger handle to remove
+   */
+  static void RemoveLogger(NT_Logger logger);
+
+  /**
+   * Wait for the incoming log event queue to be empty.  This is primarily
+   * useful
+   * for deterministic testing.  This blocks until either the log event
+   * queue is empty (e.g. there are no more events that need to be passed along
+   * to callbacks or poll queues) or the timeout expires.
+   * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+   *                  or a negative value to block indefinitely
+   * @return False if timed out, otherwise true.
+   */
+  bool WaitForLoggerQueue(double timeout);
+
+  /** @} */
+
+  /**
+   * Equality operator.  Returns true if both instances refer to the same
+   * native handle.
+   */
+  bool operator==(const NetworkTableInstance& other) const {
+    return m_handle == other.m_handle;
+  }
+
+  /** Inequality operator. */
+  bool operator!=(const NetworkTableInstance& other) const {
+    return !(*this == other);
+  }
+
+ private:
+  /* Native handle */
+  NT_Inst m_handle;
+};
+
+}  // namespace nt
+
+#include "networktables/NetworkTableInstance.inl"
+
+#endif  // NTCORE_NETWORKTABLES_NETWORKTABLEINSTANCE_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableInstance.inl b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableInstance.inl
new file mode 100644
index 0000000..23a6c22
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableInstance.inl
@@ -0,0 +1,187 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NT_INSTANCE_INL_
+#define NT_INSTANCE_INL_
+
+namespace nt {
+
+inline NetworkTableInstance::NetworkTableInstance() NT_NOEXCEPT : m_handle{0} {}
+
+inline NetworkTableInstance::NetworkTableInstance(NT_Inst handle) NT_NOEXCEPT
+    : m_handle{handle} {}
+
+inline NetworkTableInstance NetworkTableInstance::GetDefault() {
+  return NetworkTableInstance{GetDefaultInstance()};
+}
+
+inline NetworkTableInstance NetworkTableInstance::Create() {
+  return NetworkTableInstance{CreateInstance()};
+}
+
+inline void NetworkTableInstance::Destroy(NetworkTableInstance inst) {
+  if (inst.m_handle != 0) DestroyInstance(inst.m_handle);
+}
+
+inline NT_Inst NetworkTableInstance::GetHandle() const { return m_handle; }
+
+inline NetworkTableEntry NetworkTableInstance::GetEntry(const Twine& name) {
+  return NetworkTableEntry{::nt::GetEntry(m_handle, name)};
+}
+
+inline std::vector<NetworkTableEntry> NetworkTableInstance::GetEntries(
+    const Twine& prefix, unsigned int types) {
+  std::vector<NetworkTableEntry> entries;
+  for (auto entry : ::nt::GetEntries(m_handle, prefix, types))
+    entries.emplace_back(entry);
+  return entries;
+}
+
+inline std::vector<EntryInfo> NetworkTableInstance::GetEntryInfo(
+    const Twine& prefix, unsigned int types) const {
+  return ::nt::GetEntryInfo(m_handle, prefix, types);
+}
+
+inline void NetworkTableInstance::DeleteAllEntries() {
+  ::nt::DeleteAllEntries(m_handle);
+}
+
+inline void NetworkTableInstance::RemoveEntryListener(
+    NT_EntryListener entry_listener) {
+  ::nt::RemoveEntryListener(entry_listener);
+}
+
+inline bool NetworkTableInstance::WaitForEntryListenerQueue(double timeout) {
+  return ::nt::WaitForEntryListenerQueue(m_handle, timeout);
+}
+
+inline void NetworkTableInstance::RemoveConnectionListener(
+    NT_ConnectionListener conn_listener) {
+  ::nt::RemoveConnectionListener(conn_listener);
+}
+
+inline bool NetworkTableInstance::WaitForConnectionListenerQueue(
+    double timeout) {
+  return ::nt::WaitForConnectionListenerQueue(m_handle, timeout);
+}
+
+inline bool NetworkTableInstance::WaitForRpcCallQueue(double timeout) {
+  return ::nt::WaitForRpcCallQueue(m_handle, timeout);
+}
+
+inline void NetworkTableInstance::SetNetworkIdentity(const Twine& name) {
+  ::nt::SetNetworkIdentity(m_handle, name);
+}
+
+inline unsigned int NetworkTableInstance::GetNetworkMode() const {
+  return ::nt::GetNetworkMode(m_handle);
+}
+
+inline void NetworkTableInstance::StartServer(const Twine& persist_filename,
+                                              const char* listen_address,
+                                              unsigned int port) {
+  ::nt::StartServer(m_handle, persist_filename, listen_address, port);
+}
+
+inline void NetworkTableInstance::StopServer() { ::nt::StopServer(m_handle); }
+
+inline void NetworkTableInstance::StartClient() { ::nt::StartClient(m_handle); }
+
+inline void NetworkTableInstance::StartClient(const char* server_name,
+                                              unsigned int port) {
+  ::nt::StartClient(m_handle, server_name, port);
+}
+
+inline void NetworkTableInstance::StartClient(
+    ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  ::nt::StartClient(m_handle, servers);
+}
+
+inline void NetworkTableInstance::StartClientTeam(unsigned int team,
+                                                  unsigned int port) {
+  ::nt::StartClientTeam(m_handle, team, port);
+}
+
+inline void NetworkTableInstance::StopClient() { ::nt::StopClient(m_handle); }
+
+inline void NetworkTableInstance::SetServer(const char* server_name,
+                                            unsigned int port) {
+  ::nt::SetServer(m_handle, server_name, port);
+}
+
+inline void NetworkTableInstance::SetServer(
+    ArrayRef<std::pair<StringRef, unsigned int>> servers) {
+  ::nt::SetServer(m_handle, servers);
+}
+
+inline void NetworkTableInstance::SetServerTeam(unsigned int team,
+                                                unsigned int port) {
+  ::nt::SetServerTeam(m_handle, team, port);
+}
+
+inline void NetworkTableInstance::StartDSClient(unsigned int port) {
+  ::nt::StartDSClient(m_handle, port);
+}
+
+inline void NetworkTableInstance::StopDSClient() {
+  ::nt::StopDSClient(m_handle);
+}
+
+inline void NetworkTableInstance::SetUpdateRate(double interval) {
+  ::nt::SetUpdateRate(m_handle, interval);
+}
+
+inline void NetworkTableInstance::Flush() const { ::nt::Flush(m_handle); }
+
+inline std::vector<ConnectionInfo> NetworkTableInstance::GetConnections()
+    const {
+  return ::nt::GetConnections(m_handle);
+}
+
+inline bool NetworkTableInstance::IsConnected() const {
+  return ::nt::IsConnected(m_handle);
+}
+
+inline const char* NetworkTableInstance::SavePersistent(
+    const Twine& filename) const {
+  return ::nt::SavePersistent(m_handle, filename);
+}
+
+inline const char* NetworkTableInstance::LoadPersistent(
+    const Twine& filename,
+    std::function<void(size_t line, const char* msg)> warn) {
+  return ::nt::LoadPersistent(m_handle, filename, warn);
+}
+
+inline const char* NetworkTableInstance::SaveEntries(
+    const Twine& filename, const Twine& prefix) const {
+  return ::nt::SaveEntries(m_handle, filename, prefix);
+}
+
+inline const char* NetworkTableInstance::LoadEntries(
+    const Twine& filename, const Twine& prefix,
+    std::function<void(size_t line, const char* msg)> warn) {
+  return ::nt::LoadEntries(m_handle, filename, prefix, warn);
+}
+
+inline NT_Logger NetworkTableInstance::AddLogger(
+    std::function<void(const LogMessage& msg)> func, unsigned int min_level,
+    unsigned int max_level) {
+  return ::nt::AddLogger(m_handle, func, min_level, max_level);
+}
+
+inline void NetworkTableInstance::RemoveLogger(NT_Logger logger) {
+  ::nt::RemoveLogger(logger);
+}
+
+inline bool NetworkTableInstance::WaitForLoggerQueue(double timeout) {
+  return ::nt::WaitForLoggerQueue(m_handle, timeout);
+}
+
+}  // namespace nt
+
+#endif  // NT_INSTANCE_INL_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableType.h b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableType.h
new file mode 100644
index 0000000..8b648ea
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableType.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_NETWORKTABLETYPE_H_
+#define NTCORE_NETWORKTABLES_NETWORKTABLETYPE_H_
+
+#include "ntcore_c.h"
+
+namespace nt {
+
+enum class NetworkTableType {
+  kUnassigned = NT_UNASSIGNED,
+  kBoolean = NT_BOOLEAN,
+  kDouble = NT_DOUBLE,
+  kString = NT_STRING,
+  kRaw = NT_RAW,
+  kBooleanArray = NT_BOOLEAN_ARRAY,
+  kDoubleArray = NT_DOUBLE_ARRAY,
+  kStringArray = NT_STRING_ARRAY,
+  kRpc = NT_RPC
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_NETWORKTABLES_NETWORKTABLETYPE_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableValue.h b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableValue.h
new file mode 100644
index 0000000..a8a6c8e
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/NetworkTableValue.h
@@ -0,0 +1,402 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_NETWORKTABLEVALUE_H_
+#define NTCORE_NETWORKTABLES_NETWORKTABLEVALUE_H_
+
+#include <stdint.h>
+
+#include <cassert>
+#include <memory>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+
+#include "ntcore_c.h"
+
+namespace nt {
+
+using llvm::ArrayRef;
+using llvm::StringRef;
+using llvm::Twine;
+
+/**
+ * A network table entry value.
+ */
+class Value final {
+  struct private_init {};
+
+ public:
+  Value();
+  Value(NT_Type type, uint64_t time, const private_init&);
+  ~Value();
+
+  /**
+   * Get the data type.
+   * @return The type.
+   */
+  NT_Type type() const { return m_val.type; }
+
+  /**
+   * Get the data value stored.
+   * @return The type.
+   */
+  const NT_Value& value() const { return m_val; }
+
+  /**
+   * Get the creation time of the value.
+   * @return The time, in the units returned by nt::Now().
+   */
+  uint64_t last_change() const { return m_val.last_change; }
+
+  /**
+   * Get the creation time of the value.
+   * @return The time, in the units returned by nt::Now().
+   */
+  uint64_t time() const { return m_val.last_change; }
+
+  /**
+   * @defgroup TypeCheckers Type Checkers
+   * @{
+   */
+
+  /**
+   * Determine if entry value contains a value or is unassigned.
+   * @return True if the entry value contains a value.
+   */
+  bool IsValid() const { return m_val.type != NT_UNASSIGNED; }
+
+  /**
+   * Determine if entry value contains a boolean.
+   * @return True if the entry value is of boolean type.
+   */
+  bool IsBoolean() const { return m_val.type == NT_BOOLEAN; }
+
+  /**
+   * Determine if entry value contains a double.
+   * @return True if the entry value is of double type.
+   */
+  bool IsDouble() const { return m_val.type == NT_DOUBLE; }
+
+  /**
+   * Determine if entry value contains a string.
+   * @return True if the entry value is of string type.
+   */
+  bool IsString() const { return m_val.type == NT_STRING; }
+
+  /**
+   * Determine if entry value contains a raw.
+   * @return True if the entry value is of raw type.
+   */
+  bool IsRaw() const { return m_val.type == NT_RAW; }
+
+  /**
+   * Determine if entry value contains a rpc definition.
+   * @return True if the entry value is of rpc definition type.
+   */
+  bool IsRpc() const { return m_val.type == NT_RPC; }
+
+  /**
+   * Determine if entry value contains a boolean array.
+   * @return True if the entry value is of boolean array type.
+   */
+  bool IsBooleanArray() const { return m_val.type == NT_BOOLEAN_ARRAY; }
+
+  /**
+   * Determine if entry value contains a double array.
+   * @return True if the entry value is of double array type.
+   */
+  bool IsDoubleArray() const { return m_val.type == NT_DOUBLE_ARRAY; }
+
+  /**
+   * Determine if entry value contains a string array.
+   * @return True if the entry value is of string array type.
+   */
+  bool IsStringArray() const { return m_val.type == NT_STRING_ARRAY; }
+
+  /** @} */
+
+  /**
+   * @defgroup TypeSafeGetters Type-Safe Getters
+   * @{
+   */
+
+  /**
+   * Get the entry's boolean value.
+   * @return The boolean value.
+   */
+  bool GetBoolean() const {
+    assert(m_val.type == NT_BOOLEAN);
+    return m_val.data.v_boolean != 0;
+  }
+
+  /**
+   * Get the entry's double value.
+   * @return The double value.
+   */
+  double GetDouble() const {
+    assert(m_val.type == NT_DOUBLE);
+    return m_val.data.v_double;
+  }
+
+  /**
+   * Get the entry's string value.
+   * @return The string value.
+   */
+  StringRef GetString() const {
+    assert(m_val.type == NT_STRING);
+    return m_string;
+  }
+
+  /**
+   * Get the entry's raw value.
+   * @return The raw value.
+   */
+  StringRef GetRaw() const {
+    assert(m_val.type == NT_RAW);
+    return m_string;
+  }
+
+  /**
+   * Get the entry's rpc definition value.
+   * @return The rpc definition value.
+   */
+  StringRef GetRpc() const {
+    assert(m_val.type == NT_RPC);
+    return m_string;
+  }
+
+  /**
+   * Get the entry's boolean array value.
+   * @return The boolean array value.
+   */
+  ArrayRef<int> GetBooleanArray() const {
+    assert(m_val.type == NT_BOOLEAN_ARRAY);
+    return ArrayRef<int>(m_val.data.arr_boolean.arr,
+                         m_val.data.arr_boolean.size);
+  }
+
+  /**
+   * Get the entry's double array value.
+   * @return The double array value.
+   */
+  ArrayRef<double> GetDoubleArray() const {
+    assert(m_val.type == NT_DOUBLE_ARRAY);
+    return ArrayRef<double>(m_val.data.arr_double.arr,
+                            m_val.data.arr_double.size);
+  }
+
+  /**
+   * Get the entry's string array value.
+   * @return The string array value.
+   */
+  ArrayRef<std::string> GetStringArray() const {
+    assert(m_val.type == NT_STRING_ARRAY);
+    return m_string_array;
+  }
+
+  /** @} */
+
+  /**
+   * @defgroup Factories Factory functions
+   * @{
+   */
+
+  /**
+   * Creates a boolean entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeBoolean(bool value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_BOOLEAN, time, private_init());
+    val->m_val.data.v_boolean = value;
+    return val;
+  }
+
+  /**
+   * Creates a double entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeDouble(double value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_DOUBLE, time, private_init());
+    val->m_val.data.v_double = value;
+    return val;
+  }
+
+  /**
+   * Creates a string entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeString(const Twine& value,
+                                           uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_STRING, time, private_init());
+    val->m_string = value.str();
+    val->m_val.data.v_string.str = const_cast<char*>(val->m_string.c_str());
+    val->m_val.data.v_string.len = val->m_string.size();
+    return val;
+  }
+
+/**
+ * Creates a string entry value.
+ * @param value the value
+ * @param time if nonzero, the creation time to use (instead of the current
+ *             time)
+ * @return The entry value
+ */
+#ifdef _MSC_VER
+  template <typename T,
+            typename = std::enable_if_t<std::is_same<T, std::string>>>
+#else
+  template <typename T,
+            typename std::enable_if<std::is_same<T, std::string>::value>::type>
+#endif
+  static std::shared_ptr<Value> MakeString(T&& value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_STRING, time, private_init());
+    val->m_string = std::move(value);
+    val->m_val.data.v_string.str = const_cast<char*>(val->m_string.c_str());
+    val->m_val.data.v_string.len = val->m_string.size();
+    return val;
+  }
+
+  /**
+   * Creates a raw entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeRaw(StringRef value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_RAW, time, private_init());
+    val->m_string = value;
+    val->m_val.data.v_raw.str = const_cast<char*>(val->m_string.c_str());
+    val->m_val.data.v_raw.len = val->m_string.size();
+    return val;
+  }
+
+/**
+ * Creates a raw entry value.
+ * @param value the value
+ * @param time if nonzero, the creation time to use (instead of the current
+ *             time)
+ * @return The entry value
+ */
+#ifdef _MSC_VER
+  template <typename T,
+            typename = std::enable_if_t<std::is_same<T, std::string>>>
+#else
+  template <typename T,
+            typename std::enable_if<std::is_same<T, std::string>::value>::type>
+#endif
+  static std::shared_ptr<Value> MakeRaw(T&& value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_RAW, time, private_init());
+    val->m_string = std::move(value);
+    val->m_val.data.v_raw.str = const_cast<char*>(val->m_string.c_str());
+    val->m_val.data.v_raw.len = val->m_string.size();
+    return val;
+  }
+
+  /**
+   * Creates a rpc entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeRpc(StringRef value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_RPC, time, private_init());
+    val->m_string = value;
+    val->m_val.data.v_raw.str = const_cast<char*>(val->m_string.c_str());
+    val->m_val.data.v_raw.len = val->m_string.size();
+    return val;
+  }
+
+  /**
+   * Creates a rpc entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  template <typename T>
+  static std::shared_ptr<Value> MakeRpc(T&& value, uint64_t time = 0) {
+    auto val = std::make_shared<Value>(NT_RPC, time, private_init());
+    val->m_string = std::move(value);
+    val->m_val.data.v_raw.str = const_cast<char*>(val->m_string.c_str());
+    val->m_val.data.v_raw.len = val->m_string.size();
+    return val;
+  }
+
+  /**
+   * Creates a boolean array entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeBooleanArray(ArrayRef<int> value,
+                                                 uint64_t time = 0);
+
+  /**
+   * Creates a double array entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeDoubleArray(ArrayRef<double> value,
+                                                uint64_t time = 0);
+
+  /**
+   * Creates a string array entry value.
+   * @param value the value
+   * @param time if nonzero, the creation time to use (instead of the current
+   *             time)
+   * @return The entry value
+   */
+  static std::shared_ptr<Value> MakeStringArray(ArrayRef<std::string> value,
+                                                uint64_t time = 0);
+
+  // Note: This function moves the values out of the vector.
+  static std::shared_ptr<Value> MakeStringArray(
+      std::vector<std::string>&& value, uint64_t time = 0);
+
+  /** @} */
+
+  Value(const Value&) = delete;
+  Value& operator=(const Value&) = delete;
+  friend bool operator==(const Value& lhs, const Value& rhs);
+
+ private:
+  NT_Value m_val;
+  std::string m_string;
+  std::vector<std::string> m_string_array;
+};
+
+bool operator==(const Value& lhs, const Value& rhs);
+inline bool operator!=(const Value& lhs, const Value& rhs) {
+  return !(lhs == rhs);
+}
+
+/** NetworkTable Value alias for similarity with Java. */
+typedef Value NetworkTableValue;
+
+}  // namespace nt
+
+#endif  // NTCORE_NETWORKTABLES_NETWORKTABLEVALUE_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/RpcCall.h b/third_party/ntcore_2018/src/main/native/include/networktables/RpcCall.h
new file mode 100644
index 0000000..6c2acc7
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/RpcCall.h
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_RPCCALL_H_
+#define NTCORE_NETWORKTABLES_RPCCALL_H_
+
+#include <string>
+#include <utility>
+
+#include "ntcore_c.h"
+
+namespace nt {
+
+class NetworkTableEntry;
+
+/** NetworkTables Remote Procedure Call */
+class RpcCall final {
+ public:
+  /**
+   * Construct invalid instance.
+   */
+  RpcCall() : m_entry(0), m_call(0) {}
+
+  /**
+   * Construct from native handles.
+   * @param entry Entry handle
+   * @param call  Call handle
+   */
+  RpcCall(NT_Entry entry, NT_RpcCall call) : m_entry(entry), m_call(call) {}
+
+  RpcCall(RpcCall&& other);
+  RpcCall(const RpcCall&) = delete;
+  RpcCall& operator=(const RpcCall&) = delete;
+
+  /**
+   * Destructor.  Cancels the result if no other action taken.
+   */
+  ~RpcCall();
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  explicit operator bool() const { return m_call != 0; }
+
+  /**
+   * Get the RPC entry.
+   * @return NetworkTableEntry for the RPC.
+   */
+  NetworkTableEntry GetEntry() const;
+
+  /**
+   * Get the call native handle.
+   * @return Native handle.
+   */
+  NT_RpcCall GetCall() const { return m_call; }
+
+  /**
+   * Get the result (return value).  This function blocks until
+   * the result is received.
+   * @param result      received result (output)
+   * @return False on error, true otherwise.
+   */
+  bool GetResult(std::string* result);
+
+  /**
+   * Get the result (return value).  This function blocks until
+   * the result is received or it times out.
+   * @param result      received result (output)
+   * @param timeout     timeout, in seconds
+   * @param timed_out   true if the timeout period elapsed (output)
+   * @return False on error or timeout, true otherwise.
+   */
+  bool GetResult(std::string* result, double timeout, bool* timed_out);
+
+  /**
+   * Ignore the result.  This function is non-blocking.
+   */
+  void CancelResult();
+
+  friend void swap(RpcCall& first, RpcCall& second) {
+    using std::swap;
+    swap(first.m_entry, second.m_entry);
+    swap(first.m_call, second.m_call);
+  }
+
+ private:
+  NT_Entry m_entry;
+  NT_RpcCall m_call;
+};
+
+}  // namespace nt
+
+#include "networktables/RpcCall.inl"
+
+#endif  // NTCORE_NETWORKTABLES_RPCCALL_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/RpcCall.inl b/third_party/ntcore_2018/src/main/native/include/networktables/RpcCall.inl
new file mode 100644
index 0000000..d7dacf5
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/RpcCall.inl
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NT_RPCCALL_INL_
+#define NT_RPCCALL_INL_
+
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+inline RpcCall::RpcCall(RpcCall&& other) : RpcCall() {
+  swap(*this, other);
+}
+
+inline RpcCall::~RpcCall() {
+  // automatically cancel result if user didn't request it
+  if (m_call != 0) CancelResult();
+}
+
+inline bool RpcCall::GetResult(std::string* result) {
+  if (GetRpcResult(m_entry, m_call, result)) {
+    m_call = 0;
+    return true;
+  }
+  return false;
+}
+
+inline bool RpcCall::GetResult(std::string* result, double timeout,
+                               bool* timed_out) {
+  if (GetRpcResult(m_entry, m_call, result, timeout, timed_out)) {
+    m_call = 0;
+    return true;
+  }
+  return false;
+}
+
+inline void RpcCall::CancelResult() {
+  CancelRpcResult(m_entry, m_call);
+  m_call = 0;
+}
+
+}  // namespace nt
+
+#endif  // NT_RPCCALL_INL_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/TableEntryListener.h b/third_party/ntcore_2018/src/main/native/include/networktables/TableEntryListener.h
new file mode 100644
index 0000000..8142847
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/TableEntryListener.h
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_TABLEENTRYLISTENER_H_
+#define NTCORE_NETWORKTABLES_TABLEENTRYLISTENER_H_
+
+#include <functional>
+#include <memory>
+
+#include <llvm/StringRef.h>
+
+namespace nt {
+
+class NetworkTable;
+class NetworkTableEntry;
+class Value;
+
+using llvm::StringRef;
+
+/**
+ * A listener that listens to changes in values in a NetworkTable.
+ *
+ * Called when a key-value pair is changed in a NetworkTable.
+ *
+ * @param table the table the key-value pair exists in
+ * @param key the key associated with the value that changed
+ * @param entry the entry associated with the value that changed
+ * @param value the new value
+ * @param flags update flags; for example, EntryListenerFlags.kNew if the key
+ * did not previously exist
+ */
+typedef std::function<void(NetworkTable* table, StringRef name,
+                           NetworkTableEntry entry,
+                           std::shared_ptr<Value> value, int flags)>
+    TableEntryListener;
+
+}  // namespace nt
+
+#endif  // NTCORE_NETWORKTABLES_TABLEENTRYLISTENER_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/networktables/TableListener.h b/third_party/ntcore_2018/src/main/native/include/networktables/TableListener.h
new file mode 100644
index 0000000..e498690
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/networktables/TableListener.h
@@ -0,0 +1,37 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NETWORKTABLES_TABLELISTENER_H_
+#define NTCORE_NETWORKTABLES_TABLELISTENER_H_
+
+#include <functional>
+#include <memory>
+
+#include <llvm/StringRef.h>
+
+namespace nt {
+
+class NetworkTable;
+
+using llvm::StringRef;
+
+/**
+ * A listener that listens to new sub-tables in a NetworkTable.
+ *
+ * Called when a new table is created.
+ *
+ * @param parent the parent of the table
+ * @param name the name of the new table
+ * @param table the new table
+ */
+typedef std::function<void(NetworkTable* parent, StringRef name,
+                           NetworkTable* table)>
+    TableListener;
+
+}  // namespace nt
+
+#endif  // NTCORE_NETWORKTABLES_TABLELISTENER_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/ntcore.h b/third_party/ntcore_2018/src/main/native/include/ntcore.h
new file mode 100644
index 0000000..ce1f2ad
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/ntcore.h
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NTCORE_H_
+#define NTCORE_NTCORE_H_
+
+/* C API */
+#include "ntcore_c.h"
+
+#ifdef __cplusplus
+/* C++ API */
+#include "ntcore_cpp.h"
+#endif /* __cplusplus */
+
+#endif  // NTCORE_NTCORE_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/ntcore_c.h b/third_party/ntcore_2018/src/main/native/include/ntcore_c.h
new file mode 100644
index 0000000..8a93002
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/ntcore_c.h
@@ -0,0 +1,1955 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NTCORE_C_H_
+#define NTCORE_NTCORE_C_H_
+
+#include <stdint.h>
+
+#include <cstddef>
+
+#include <support/deprecated.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Typedefs */
+typedef int NT_Bool;
+
+typedef unsigned int NT_Handle;
+typedef NT_Handle NT_ConnectionListener;
+typedef NT_Handle NT_ConnectionListenerPoller;
+typedef NT_Handle NT_Entry;
+typedef NT_Handle NT_EntryListener;
+typedef NT_Handle NT_EntryListenerPoller;
+typedef NT_Handle NT_Inst;
+typedef NT_Handle NT_Logger;
+typedef NT_Handle NT_LoggerPoller;
+typedef NT_Handle NT_RpcCall;
+typedef NT_Handle NT_RpcCallPoller;
+
+/** Default network tables port number */
+#define NT_DEFAULT_PORT 1735
+
+/** NetworkTables data types. */
+enum NT_Type {
+  NT_UNASSIGNED = 0,
+  NT_BOOLEAN = 0x01,
+  NT_DOUBLE = 0x02,
+  NT_STRING = 0x04,
+  NT_RAW = 0x08,
+  NT_BOOLEAN_ARRAY = 0x10,
+  NT_DOUBLE_ARRAY = 0x20,
+  NT_STRING_ARRAY = 0x40,
+  NT_RPC = 0x80
+};
+
+/** NetworkTables entry flags. */
+enum NT_EntryFlags { NT_PERSISTENT = 0x01 };
+
+/** NetworkTables logging levels. */
+enum NT_LogLevel {
+  NT_LOG_CRITICAL = 50,
+  NT_LOG_ERROR = 40,
+  NT_LOG_WARNING = 30,
+  NT_LOG_INFO = 20,
+  NT_LOG_DEBUG = 10,
+  NT_LOG_DEBUG1 = 9,
+  NT_LOG_DEBUG2 = 8,
+  NT_LOG_DEBUG3 = 7,
+  NT_LOG_DEBUG4 = 6
+};
+
+/** NetworkTables notifier kinds. */
+enum NT_NotifyKind {
+  NT_NOTIFY_NONE = 0,
+  NT_NOTIFY_IMMEDIATE = 0x01, /* initial listener addition */
+  NT_NOTIFY_LOCAL = 0x02,     /* changed locally */
+  NT_NOTIFY_NEW = 0x04,       /* newly created entry */
+  NT_NOTIFY_DELETE = 0x08,    /* deleted */
+  NT_NOTIFY_UPDATE = 0x10,    /* value changed */
+  NT_NOTIFY_FLAGS = 0x20      /* flags changed */
+};
+
+/** Client/server modes */
+enum NT_NetworkMode {
+  NT_NET_MODE_NONE = 0x00,     /* not running */
+  NT_NET_MODE_SERVER = 0x01,   /* running in server mode */
+  NT_NET_MODE_CLIENT = 0x02,   /* running in client mode */
+  NT_NET_MODE_STARTING = 0x04, /* flag for starting (either client or server) */
+  NT_NET_MODE_FAILURE = 0x08,  /* flag for failure (either client or server) */
+};
+
+/*
+ * Structures
+ */
+
+/** A NetworkTables string. */
+struct NT_String {
+  /**
+   * String contents (UTF-8).
+   * The string is NOT required to be zero-terminated.
+   * When returned by the library, this is zero-terminated and allocated with
+   * std::malloc().
+   */
+  char* str;
+
+  /**
+   * Length of the string in bytes.  If the string happens to be zero
+   * terminated, this does not include the zero-termination.
+   */
+  size_t len;
+};
+
+/** NetworkTables Entry Value.  Note this is a typed union. */
+struct NT_Value {
+  enum NT_Type type;
+  uint64_t last_change;
+  union {
+    NT_Bool v_boolean;
+    double v_double;
+    struct NT_String v_string;
+    struct NT_String v_raw;
+    struct {
+      NT_Bool* arr;
+      size_t size;
+    } arr_boolean;
+    struct {
+      double* arr;
+      size_t size;
+    } arr_double;
+    struct {
+      struct NT_String* arr;
+      size_t size;
+    } arr_string;
+  } data;
+};
+
+/** NetworkTables Entry Information */
+struct NT_EntryInfo {
+  /** Entry handle */
+  NT_Entry entry;
+
+  /** Entry name */
+  struct NT_String name;
+
+  /** Entry type */
+  enum NT_Type type;
+
+  /** Entry flags */
+  unsigned int flags;
+
+  /** Timestamp of last change to entry (type or value). */
+  uint64_t last_change;
+};
+
+/** NetworkTables Connection Information */
+struct NT_ConnectionInfo {
+  /**
+   * The remote identifier (as set on the remote node by
+   * NetworkTableInstance::SetNetworkIdentity() or nt::SetNetworkIdentity()).
+   */
+  struct NT_String remote_id;
+
+  /** The IP address of the remote node. */
+  struct NT_String remote_ip;
+
+  /** The port number of the remote node. */
+  unsigned int remote_port;
+
+  /**
+   * The last time any update was received from the remote node (same scale as
+   * returned by nt::Now()).
+   */
+  uint64_t last_update;
+
+  /**
+   * The protocol version being used for this connection.  This in protocol
+   * layer format, so 0x0200 = 2.0, 0x0300 = 3.0).
+   */
+  unsigned int protocol_version;
+};
+
+/** NetworkTables RPC Version 1 Definition Parameter */
+struct NT_RpcParamDef {
+  struct NT_String name;
+  struct NT_Value def_value;
+};
+
+/** NetworkTables RPC Version 1 Definition Result */
+struct NT_RpcResultDef {
+  struct NT_String name;
+  enum NT_Type type;
+};
+
+/** NetworkTables RPC Version 1 Definition */
+struct NT_RpcDefinition {
+  unsigned int version;
+  struct NT_String name;
+  size_t num_params;
+  NT_RpcParamDef* params;
+  size_t num_results;
+  NT_RpcResultDef* results;
+};
+
+/** NetworkTables RPC Call Data */
+struct NT_RpcAnswer {
+  NT_Entry entry;
+  NT_RpcCall call;
+  struct NT_String name;
+  struct NT_String params;
+  struct NT_ConnectionInfo conn;
+};
+
+/** NetworkTables Entry Notification */
+struct NT_EntryNotification {
+  /** Listener that was triggered. */
+  NT_EntryListener listener;
+
+  /** Entry handle. */
+  NT_Entry entry;
+
+  /** Entry name. */
+  struct NT_String name;
+
+  /** The new value. */
+  struct NT_Value value;
+
+  /**
+   * Update flags.  For example, NT_NOTIFY_NEW if the key did not previously
+   * exist.
+   */
+  unsigned int flags;
+};
+
+/** NetworkTables Connection Notification */
+struct NT_ConnectionNotification {
+  /** Listener that was triggered. */
+  NT_ConnectionListener listener;
+
+  /** True if event is due to connection being established. */
+  NT_Bool connected;
+
+  /** Connection info. */
+  struct NT_ConnectionInfo conn;
+};
+
+/** NetworkTables log message. */
+struct NT_LogMessage {
+  /** The logger that generated the message. */
+  NT_Logger logger;
+
+  /** Log level of the message.  See NT_LogLevel. */
+  unsigned int level;
+
+  /** The filename of the source file that generated the message. */
+  const char* filename;
+
+  /** The line number in the source file that generated the message. */
+  unsigned int line;
+
+  /** The message. */
+  char* message;
+};
+
+/**
+ * @defgroup InstanceFunctions Instance Functions
+ * @{
+ */
+
+/**
+ * Get default instance.
+ * This is the instance used by non-handle-taking functions.
+ * @return Instance handle
+ */
+NT_Inst NT_GetDefaultInstance(void);
+
+/**
+ * Create an instance.
+ * @return Instance handle
+ */
+NT_Inst NT_CreateInstance(void);
+
+/**
+ * Destroy an instance.
+ * The default instance cannot be destroyed.
+ * @param inst Instance handle
+ */
+void NT_DestroyInstance(NT_Inst inst);
+
+/**
+ * Get instance handle from another handle.
+ * @param handle    handle
+ * @return Instance handle
+ */
+NT_Inst NT_GetInstanceFromHandle(NT_Handle handle);
+
+/** @} */
+
+/**
+ * @defgroup TableFunctions Table Functions
+ * @{
+ */
+
+/**
+ * Get Entry Handle.
+ * @param inst      instance handle
+ * @param name      entry name (UTF-8 string)
+ * @param name_len  length of name in bytes
+ * @return entry handle
+ */
+NT_Entry NT_GetEntry(NT_Inst inst, const char* name, size_t name_len);
+
+/**
+ * Get Entry Handles.
+ * Returns an array of entry handles.  The results are optionally
+ * filtered by string prefix and entry type to only return a subset of all
+ * entries.
+ *
+ * @param prefix        entry name required prefix; only entries whose name
+ *                      starts with this string are returned
+ * @param prefix_len    length of prefix in bytes
+ * @param types         bitmask of NT_Type values; 0 is treated specially
+ *                      as a "don't care"
+ * @return Array of entry handles.
+ */
+NT_Entry* NT_GetEntries(NT_Inst inst, const char* prefix, size_t prefix_len,
+                        unsigned int types, size_t* count);
+
+/**
+ * Gets the name of the specified entry.
+ * Returns an empty string if the handle is invalid.
+ * @param entry     entry handle
+ * @param name_len  length of the returned string (output parameter)
+ * @return Entry name
+ */
+char* NT_GetEntryName(NT_Entry entry, size_t* name_len);
+
+/**
+ * Gets the type for the specified key, or unassigned if non existent.
+ * @param entry   entry handle
+ * @return Entry type
+ */
+enum NT_Type NT_GetEntryType(NT_Entry entry);
+
+/**
+ * Gets the last time the entry was changed.
+ * Returns 0 if the handle is invalid.
+ * @param entry   entry handle
+ * @return Entry last change time
+ */
+uint64_t NT_GetEntryLastChange(NT_Entry entry);
+
+/**
+ * Get Entry Value.
+ * Returns copy of current entry value.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param entry     entry handle
+ * @param value     storage for returned entry value
+ *
+ * It is the caller's responsibility to free value once it's no longer
+ * needed (the utility function NT_DisposeValue() is useful for this
+ * purpose).
+ */
+void NT_GetEntryValue(NT_Entry entry, struct NT_Value* value);
+
+/**
+ * Set Default Entry Value.
+ * Returns copy of current entry value if it exists.
+ * Otherwise, sets passed in value, and returns set value.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param entry     entry handle
+ * @param default_value     value to be set if name does not exist
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryValue(NT_Entry entry,
+                                const struct NT_Value* default_value);
+
+/**
+ * Set Entry Value.
+ * Sets new entry value.  If type of new value differs from the type of the
+ * currently stored entry, returns error and does not update value.
+ *
+ * @param entry     entry handle
+ * @param value     new entry value
+ * @return 0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryValue(NT_Entry entry, const struct NT_Value* value);
+
+/**
+ * Set Entry Type and Value.
+ * Sets new entry value.  If type of new value differs from the type of the
+ * currently stored entry, the currently stored entry type is overridden
+ * (generally this will generate an Entry Assignment message).
+ *
+ * This is NOT the preferred method to update a value; generally
+ * NT_SetEntryValue() should be used instead, with appropriate error handling.
+ *
+ * @param entry     entry handle
+ * @param value     new entry value
+ */
+void NT_SetEntryTypeValue(NT_Entry entry, const struct NT_Value* value);
+
+/**
+ * Set Entry Flags.
+ * @param entry     entry handle
+ * @param flags     flags value (bitmask of NT_EntryFlags)
+ */
+void NT_SetEntryFlags(NT_Entry entry, unsigned int flags);
+
+/**
+ * Get Entry Flags.
+ * @param entry     entry handle
+ * @return Flags value (bitmask of NT_EntryFlags)
+ */
+unsigned int NT_GetEntryFlags(NT_Entry entry);
+
+/**
+ * Delete Entry.
+ * Deletes an entry.  This is a new feature in version 3.0 of the protocol,
+ * so this may not have an effect if any other node in the network is not
+ * version 3.0 or newer.
+ *
+ * Note: NT_GetConnections() can be used to determine the protocol version
+ * of direct remote connection(s), but this is not sufficient to determine
+ * if all nodes in the network are version 3.0 or newer.
+ *
+ * @param entry     entry handle
+ */
+void NT_DeleteEntry(NT_Entry entry);
+
+/**
+ * Delete All Entries.
+ * Deletes ALL table entries.  This is a new feature in version 3.0 of the
+ * so this may not have an effect if any other node in the network is not
+ * version 3.0 or newer.
+ *
+ * Note: NT_GetConnections() can be used to determine the protocol version
+ * of direct remote connection(s), but this is not sufficient to determine
+ * if all nodes in the network are version 3.0 or newer.
+ *
+ * @param inst      instance handle
+ */
+void NT_DeleteAllEntries(NT_Inst inst);
+
+/**
+ * Get Entry Information.
+ * Returns an array of entry information (entry handle, name, entry type,
+ * and timestamp of last change to type/value).  The results are optionally
+ * filtered by string prefix and entry type to only return a subset of all
+ * entries.
+ *
+ * @param inst          instance handle
+ * @param prefix        entry name required prefix; only entries whose name
+ *                      starts with this string are returned
+ * @param prefix_len    length of prefix in bytes
+ * @param types         bitmask of NT_Type values; 0 is treated specially
+ *                      as a "don't care"
+ * @param count         output parameter; set to length of returned array
+ * @return Array of entry information.
+ */
+struct NT_EntryInfo* NT_GetEntryInfo(NT_Inst inst, const char* prefix,
+                                     size_t prefix_len, unsigned int types,
+                                     size_t* count);
+
+/**
+ * Get Entry Information.
+ * Returns information about an entry (name, entry type,
+ * and timestamp of last change to type/value).
+ *
+ * @param entry         entry handle
+ * @param info          entry information (output)
+ * @return True if successful, false on error.
+ */
+NT_Bool NT_GetEntryInfoHandle(NT_Entry entry, struct NT_EntryInfo* info);
+
+/** @} */
+
+/**
+ * @defgroup EntryListenerFunctions Entry Listener Functions
+ * @{
+ */
+
+/**
+ * Entry listener callback function.
+ * Called when a key-value pair is changed.
+ *
+ * @param data            data pointer provided to callback creation function
+ * @param event           event information
+ */
+typedef void (*NT_EntryListenerCallback)(void* data,
+                                         const NT_EntryNotification* event);
+
+/**
+ * Add a listener for all entries starting with a certain prefix.
+ *
+ * @param inst              instance handle
+ * @param prefix            UTF-8 string prefix
+ * @param prefix_len        length of prefix in bytes
+ * @param data              data pointer to pass to callback
+ * @param callback          listener to add
+ * @param flags             NT_NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener NT_AddEntryListener(NT_Inst inst, const char* prefix,
+                                     size_t prefix_len, void* data,
+                                     NT_EntryListenerCallback callback,
+                                     unsigned int flags);
+
+/**
+ * Add a listener for a single entry.
+ *
+ * @param entry             entry handle
+ * @param data              data pointer to pass to callback
+ * @param callback          listener to add
+ * @param flags             NT_NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener NT_AddEntryListenerSingle(NT_Entry entry, void* data,
+                                           NT_EntryListenerCallback callback,
+                                           unsigned int flags);
+
+/**
+ * Create a entry listener poller.
+ * A poller provides a single queue of poll events.  Events linked to this
+ * poller (using NT_AddPolledEntryListener()) will be stored in the queue and
+ * must be collected by calling NT_PollEntryListener().
+ * The returned handle must be destroyed with NT_DestroyEntryListenerPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_EntryListenerPoller NT_CreateEntryListenerPoller(NT_Inst inst);
+
+/**
+ * Destroy a entry listener poller.  This will abort any blocked polling
+ * call and prevent additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void NT_DestroyEntryListenerPoller(NT_EntryListenerPoller poller);
+
+/**
+ * Create a polled entry listener.
+ * The caller is responsible for calling NT_PollEntryListener() to poll.
+ * @param poller            poller handle
+ * @param prefix            UTF-8 string prefix
+ * @param flags             NT_NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener NT_AddPolledEntryListener(NT_EntryListenerPoller poller,
+                                           const char* prefix,
+                                           size_t prefix_len,
+                                           unsigned int flags);
+
+/**
+ * Create a polled entry listener.
+ * The caller is responsible for calling NT_PollEntryListener() to poll.
+ * @param poller            poller handle
+ * @param prefix            UTF-8 string prefix
+ * @param flags             NT_NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener NT_AddPolledEntryListenerSingle(NT_EntryListenerPoller poller,
+                                                 NT_Entry entry,
+                                                 unsigned int flags);
+
+/**
+ * Get the next entry listener event.  This blocks until the next event occurs.
+ * This is intended to be used with NT_AddPolledEntryListener(void); entry
+ * listeners created using NT_AddEntryListener() will not be serviced through
+ * this function.
+ * @param poller    poller handle
+ * @param len       length of returned array (output)
+ * @return Array of information on the entry listener events.  Returns NULL if
+ *         an erroroccurred (e.g. the instance was invalid or is shutting down).
+ */
+struct NT_EntryNotification* NT_PollEntryListener(NT_EntryListenerPoller poller,
+                                                  size_t* len);
+
+/**
+ * Get the next entry listener event.  This blocks until the next event occurs
+ * or it times out.  This is intended to be used with
+ * NT_AddPolledEntryListener(); entry listeners created using
+ * NT_AddEntryListener() will not be serviced through this function.
+ * @param poller      poller handle
+ * @param len         length of returned array (output)
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Array of information on the entry listener events.  If NULL is
+ *         returned and timed_out is also false, an error occurred (e.g. the
+ *         instance was invalid or is shutting down).
+ */
+struct NT_EntryNotification* NT_PollEntryListenerTimeout(
+    NT_EntryListenerPoller poller, size_t* len, double timeout,
+    NT_Bool* timed_out);
+
+/**
+ * Cancel a PollEntryListener call.  This wakes up a call to
+ * PollEntryListener for this poller and causes it to immediately return
+ * an empty array.
+ * @param poller  poller handle
+ */
+void NT_CancelPollEntryListener(NT_EntryListenerPoller poller);
+
+/**
+ * Remove an entry listener.
+ * @param entry_listener Listener handle to remove
+ */
+void NT_RemoveEntryListener(NT_EntryListener entry_listener);
+
+/**
+ * Wait for the entry listener queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the entry listener
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+NT_Bool NT_WaitForEntryListenerQueue(NT_Inst inst, double timeout);
+
+/** @} */
+
+/**
+ * @defgroup ConnectionListenerFunctions Connection Listener Functions
+ * @{
+ */
+
+/**
+ * Connection listener callback function.
+ * Called when a network connection is made or lost.
+ *
+ * @param data            data pointer provided to callback creation function
+ * @param event           event info
+ */
+typedef void (*NT_ConnectionListenerCallback)(
+    void* data, const struct NT_ConnectionNotification* event);
+
+/**
+ * Add a connection listener.
+ *
+ * @param inst              instance handle
+ * @param data              data pointer to pass to callback
+ * @param callback          listener to add
+ * @param immediate_notify  notify listener of all existing connections
+ * @return Listener handle
+ */
+NT_ConnectionListener NT_AddConnectionListener(
+    NT_Inst inst, void* data, NT_ConnectionListenerCallback callback,
+    NT_Bool immediate_notify);
+
+/**
+ * Create a connection listener poller.
+ * A poller provides a single queue of poll events.  Events linked to this
+ * poller (using NT_AddPolledConnectionListener()) will be stored in the queue
+ * and must be collected by calling NT_PollConnectionListener().
+ * The returned handle must be destroyed with
+ * NT_DestroyConnectionListenerPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_ConnectionListenerPoller NT_CreateConnectionListenerPoller(NT_Inst inst);
+
+/**
+ * Destroy a connection listener poller.  This will abort any blocked polling
+ * call and prevent additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void NT_DestroyConnectionListenerPoller(NT_ConnectionListenerPoller poller);
+
+/**
+ * Create a polled connection listener.
+ * The caller is responsible for calling NT_PollConnectionListener() to poll.
+ * @param poller            poller handle
+ * @param immediate_notify  notify listener of all existing connections
+ */
+NT_ConnectionListener NT_AddPolledConnectionListener(
+    NT_ConnectionListenerPoller poller, NT_Bool immediate_notify);
+
+/**
+ * Get the next connection event.  This blocks until the next connect or
+ * disconnect occurs.  This is intended to be used with
+ * NT_AddPolledConnectionListener(); connection listeners created using
+ * NT_AddConnectionListener() will not be serviced through this function.
+ * @param poller    poller handle
+ * @param len       length of returned array (output)
+ * @return Array of information on the connection events.  Only returns NULL
+ *         if an error occurred (e.g. the instance was invalid or is shutting
+ *         down).
+ */
+struct NT_ConnectionNotification* NT_PollConnectionListener(
+    NT_ConnectionListenerPoller poller, size_t* len);
+
+/**
+ * Get the next connection event.  This blocks until the next connect or
+ * disconnect occurs or it times out.  This is intended to be used with
+ * NT_AddPolledConnectionListener(); connection listeners created using
+ * NT_AddConnectionListener() will not be serviced through this function.
+ * @param poller      poller handle
+ * @param len         length of returned array (output)
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Array of information on the connection events.  If NULL is returned
+ *         and timed_out is also false, an error occurred (e.g. the instance
+ *         was invalid or is shutting down).
+ */
+struct NT_ConnectionNotification* NT_PollConnectionListenerTimeout(
+    NT_ConnectionListenerPoller poller, size_t* len, double timeout,
+    NT_Bool* timed_out);
+
+/**
+ * Cancel a PollConnectionListener call.  This wakes up a call to
+ * PollConnectionListener for this poller and causes it to immediately return
+ * an empty array.
+ * @param poller  poller handle
+ */
+void NT_CancelPollConnectionListener(NT_ConnectionListenerPoller poller);
+
+/**
+ * Remove a connection listener.
+ * @param conn_listener Listener handle to remove
+ */
+void NT_RemoveConnectionListener(NT_ConnectionListener conn_listener);
+
+/**
+ * Wait for the connection listener queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the connection listener
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+NT_Bool NT_WaitForConnectionListenerQueue(NT_Inst inst, double timeout);
+
+/** @} */
+
+/**
+ * @defgroup RpcFunctions Remote Procedure Call Functions
+ * @{
+ */
+
+/**
+ * Remote Procedure Call (RPC) callback function.
+ * @param data        data pointer provided to NT_CreateRpc()
+ * @param call        call information
+ * Note: NT_PostRpcResponse() must be called by the callback to provide a
+ * response to the call.
+ */
+typedef void (*NT_RpcCallback)(void* data, const struct NT_RpcAnswer* call);
+
+/**
+ * Create a callback-based RPC entry point.  Only valid to use on the server.
+ * The callback function will be called when the RPC is called.
+ * @param entry     entry handle of RPC entry
+ * @param def       RPC definition
+ * @param def_len   length of def in bytes
+ * @param data      data pointer to pass to callback function
+ * @param callback  callback function
+ */
+void NT_CreateRpc(NT_Entry entry, const char* def, size_t def_len, void* data,
+                  NT_RpcCallback callback);
+
+/**
+ * Create a RPC call poller.  Only valid to use on the server.
+ * A poller provides a single queue of poll events.  Events linked to this
+ * poller (using NT_CreatePolledRpc()) will be stored in the queue and must be
+ * collected by calling NT_PollRpc() or NT_PollRpcTimeout().
+ * The returned handle must be destroyed with NT_DestroyRpcCallPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_RpcCallPoller NT_CreateRpcCallPoller(NT_Inst inst);
+
+/**
+ * Destroy a RPC call poller.  This will abort any blocked polling call and
+ * prevent additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void NT_DestroyRpcCallPoller(NT_RpcCallPoller poller);
+
+/**
+ * Create a polled RPC entry point.  Only valid to use on the server.
+ * The caller is responsible for calling NT_PollRpc() or NT_PollRpcTimeout()
+ * to poll for servicing incoming RPC calls.
+ * @param entry     entry handle of RPC entry
+ * @param def       RPC definition
+ * @param def_len   length of def in bytes
+ * @param poller    poller handle
+ */
+void NT_CreatePolledRpc(NT_Entry entry, const char* def, size_t def_len,
+                        NT_RpcCallPoller poller);
+
+/**
+ * Get the next incoming RPC call.  This blocks until the next incoming RPC
+ * call is received.  This is intended to be used with NT_CreatePolledRpc(void);
+ * RPC calls created using NT_CreateRpc() will not be serviced through this
+ * function.  Upon successful return, NT_PostRpcResponse() must be called to
+ * send the return value to the caller.  The returned array must be freed
+ * using NT_DisposeRpcAnswerArray().
+ * @param poller      poller handle
+ * @param len         length of returned array (output)
+ * @return Array of RPC call information.  Only returns NULL if an error
+ *         occurred (e.g. the instance was invalid or is shutting down).
+ */
+struct NT_RpcAnswer* NT_PollRpc(NT_RpcCallPoller poller, size_t* len);
+
+/**
+ * Get the next incoming RPC call.  This blocks until the next incoming RPC
+ * call is received or it times out.  This is intended to be used with
+ * NT_CreatePolledRpc(); RPC calls created using NT_CreateRpc() will not be
+ * serviced through this function.  Upon successful return,
+ * NT_PostRpcResponse() must be called to send the return value to the caller.
+ * The returned array must be freed using NT_DisposeRpcAnswerArray().
+ * @param poller      poller handle
+ * @param len         length of returned array (output)
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Array of RPC call information.  If NULL is returned and timed_out
+ *         is also false, an error occurred (e.g. the instance was invalid or
+ *         is shutting down).
+ */
+struct NT_RpcAnswer* NT_PollRpcTimeout(NT_RpcCallPoller poller, size_t* len,
+                                       double timeout, NT_Bool* timed_out);
+
+/**
+ * Cancel a PollRpc call.  This wakes up a call to PollRpc for this poller
+ * and causes it to immediately return an empty array.
+ * @param poller  poller handle
+ */
+void NT_CancelPollRpc(NT_RpcCallPoller poller);
+
+/**
+ * Wait for the incoming RPC call queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the RPC call
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+NT_Bool NT_WaitForRpcCallQueue(NT_Inst inst, double timeout);
+
+/**
+ * Post RPC response (return value) for a polled RPC.
+ * The rpc and call parameters should come from the NT_RpcAnswer returned
+ * by NT_PollRpc().
+ * @param entry       entry handle of RPC entry (from NT_RpcAnswer)
+ * @param call        RPC call handle (from NT_RpcAnswer)
+ * @param result      result raw data that will be provided to remote caller
+ * @param result_len  length of result in bytes
+ */
+void NT_PostRpcResponse(NT_Entry entry, NT_RpcCall call, const char* result,
+                        size_t result_len);
+
+/**
+ * Call a RPC function.  May be used on either the client or server.
+ * This function is non-blocking.  Either NT_GetRpcResult() or
+ * NT_CancelRpcResult() must be called to either get or ignore the result of
+ * the call.
+ * @param entry       entry handle of RPC entry
+ * @param params      parameter
+ * @param params_len  length of param in bytes
+ * @return RPC call handle (for use with NT_GetRpcResult() or
+ *         NT_CancelRpcResult()).
+ */
+NT_RpcCall NT_CallRpc(NT_Entry entry, const char* params, size_t params_len);
+
+/**
+ * Get the result (return value) of a RPC call.  This function blocks until
+ * the result is received.
+ * @param entry       entry handle of RPC entry
+ * @param call        RPC call handle returned by NT_CallRpc()
+ * @param result_len  length of returned result in bytes
+ * @return NULL on error, or result.
+ */
+char* NT_GetRpcResult(NT_Entry entry, NT_RpcCall call, size_t* result_len);
+
+/**
+ * Get the result (return value) of a RPC call.  This function blocks until
+ * the result is received or it times out.
+ * @param entry       entry handle of RPC entry
+ * @param call        RPC call handle returned by NT_CallRpc()
+ * @param result_len  length of returned result in bytes
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return NULL on error or timeout, or result.
+ */
+char* NT_GetRpcResultTimeout(NT_Entry entry, NT_RpcCall call,
+                             size_t* result_len, double timeout,
+                             NT_Bool* timed_out);
+
+/**
+ * Ignore the result of a RPC call.  This function is non-blocking.
+ * @param entry       entry handle of RPC entry
+ * @param call        RPC call handle returned by NT_CallRpc()
+ */
+void NT_CancelRpcResult(NT_Entry entry, NT_RpcCall call);
+
+/**
+ * Pack a RPC version 1 definition.
+ * @param def         RPC version 1 definition
+ * @param packed_len  length of return value in bytes
+ * @return Raw packed bytes.  Use C standard library std::free() to release.
+ */
+char* NT_PackRpcDefinition(const struct NT_RpcDefinition* def,
+                           size_t* packed_len);
+
+/**
+ * Unpack a RPC version 1 definition.  This can be used for introspection or
+ * validation.
+ * @param packed      raw packed bytes
+ * @param packed_len  length of packed in bytes
+ * @param def         RPC version 1 definition (output)
+ * @return True if successfully unpacked, false otherwise.
+ */
+NT_Bool NT_UnpackRpcDefinition(const char* packed, size_t packed_len,
+                               struct NT_RpcDefinition* def);
+
+/**
+ * Pack RPC values as required for RPC version 1 definition messages.
+ * @param values      array of values to pack
+ * @param values_len  length of values
+ * @param packed_len  length of return value in bytes
+ * @return Raw packed bytes.  Use C standard library std::free() to release.
+ */
+char* NT_PackRpcValues(const struct NT_Value** values, size_t values_len,
+                       size_t* packed_len);
+
+/**
+ * Unpack RPC values as required for RPC version 1 definition messages.
+ * @param packed      raw packed bytes
+ * @param packed_len  length of packed in bytes
+ * @param types       array of data types (as provided in the RPC definition)
+ * @param types_len   length of types
+ * @return Array of NT_Value's.
+ */
+struct NT_Value** NT_UnpackRpcValues(const char* packed, size_t packed_len,
+                                     const NT_Type* types, size_t types_len);
+
+/** @} */
+
+/**
+ * @defgroup NetworkFunctions Client/Server Functions
+ * @{
+ */
+
+/**
+ * Set the network identity of this node.
+ * This is the name used during the initial connection handshake, and is
+ * visible through NT_ConnectionInfo on the remote node.
+ * @param inst      instance handle
+ * @param name      identity to advertise
+ * @param name_len  length of name in bytes
+ */
+void NT_SetNetworkIdentity(NT_Inst inst, const char* name, size_t name_len);
+
+/**
+ * Get the current network mode.
+ * @param inst  instance handle
+ * @return Bitmask of NT_NetworkMode.
+ */
+unsigned int NT_GetNetworkMode(NT_Inst inst);
+
+/**
+ * Starts a server using the specified filename, listening address, and port.
+ *
+ * @param inst              instance handle
+ * @param persist_filename  the name of the persist file to use (UTF-8 string,
+ *                          null terminated)
+ * @param listen_address    the address to listen on, or null to listen on any
+ *                          address. (UTF-8 string, null terminated)
+ * @param port              port to communicate over.
+ */
+void NT_StartServer(NT_Inst inst, const char* persist_filename,
+                    const char* listen_address, unsigned int port);
+
+/**
+ * Stops the server if it is running.
+ * @param inst  instance handle
+ */
+void NT_StopServer(NT_Inst inst);
+
+/**
+ * Starts a client.  Use NT_SetServer to set the server name and port.
+ * @param inst  instance handle
+ */
+void NT_StartClientNone(NT_Inst inst);
+
+/**
+ * Starts a client using the specified server and port
+ *
+ * @param inst        instance handle
+ * @param server_name server name (UTF-8 string, null terminated)
+ * @param port        port to communicate over
+ */
+void NT_StartClient(NT_Inst inst, const char* server_name, unsigned int port);
+
+/**
+ * Starts a client using the specified (server, port) combinations.  The
+ * client will attempt to connect to each server in round robin fashion.
+ *
+ * @param inst         instance handle
+ * @param count        length of the server_names and ports arrays
+ * @param server_names array of server names (each a UTF-8 string, null
+ *                     terminated)
+ * @param ports        array of ports to communicate over (one for each server)
+ */
+void NT_StartClientMulti(NT_Inst inst, size_t count, const char** server_names,
+                         const unsigned int* ports);
+
+/**
+ * Starts a client using commonly known robot addresses for the specified team.
+ *
+ * @param inst        instance handle
+ * @param team        team number
+ * @param port        port to communicate over
+ */
+void NT_StartClientTeam(NT_Inst inst, unsigned int team, unsigned int port);
+
+/**
+ * Stops the client if it is running.
+ * @param inst  instance handle
+ */
+void NT_StopClient(NT_Inst inst);
+
+/**
+ * Sets server address and port for client (without restarting client).
+ *
+ * @param inst        instance handle
+ * @param server_name server name (UTF-8 string, null terminated)
+ * @param port        port to communicate over
+ */
+void NT_SetServer(NT_Inst inst, const char* server_name, unsigned int port);
+
+/**
+ * Sets server addresses for client (without restarting client).
+ * The client will attempt to connect to each server in round robin fashion.
+ *
+ * @param inst         instance handle
+ * @param count        length of the server_names and ports arrays
+ * @param server_names array of server names (each a UTF-8 string, null
+ *                     terminated)
+ * @param ports        array of ports to communicate over (one for each server)
+ */
+void NT_SetServerMulti(NT_Inst inst, size_t count, const char** server_names,
+                       const unsigned int* ports);
+
+/**
+ * Sets server addresses and port for client (without restarting client).
+ * Connects using commonly known robot addresses for the specified team.
+ *
+ * @param inst        instance handle
+ * @param team        team number
+ * @param port        port to communicate over
+ */
+void NT_SetServerTeam(NT_Inst inst, unsigned int team, unsigned int port);
+
+/**
+ * Starts requesting server address from Driver Station.
+ * This connects to the Driver Station running on localhost to obtain the
+ * server IP address.
+ *
+ * @param inst  instance handle
+ * @param port server port to use in combination with IP from DS
+ */
+void NT_StartDSClient(NT_Inst inst, unsigned int port);
+
+/**
+ * Stops requesting server address from Driver Station.
+ * @param inst  instance handle
+ */
+void NT_StopDSClient(NT_Inst inst);
+
+/**
+ * Set the periodic update rate.
+ * Sets how frequently updates are sent to other nodes over the network.
+ *
+ * @param inst      instance handle
+ * @param interval  update interval in seconds (range 0.01 to 1.0)
+ */
+void NT_SetUpdateRate(NT_Inst inst, double interval);
+
+/**
+ * Flush Entries.
+ * Forces an immediate flush of all local entry changes to network.
+ * Normally this is done on a regularly scheduled interval (see
+ * NT_SetUpdateRate()).
+ *
+ * Note: flushes are rate limited to avoid excessive network traffic.  If
+ * the time between calls is too short, the flush will occur after the minimum
+ * time elapses (rather than immediately).
+ *
+ * @param inst      instance handle
+ */
+void NT_Flush(NT_Inst inst);
+
+/**
+ * Get information on the currently established network connections.
+ * If operating as a client, this will return either zero or one values.
+ *
+ * @param inst  instance handle
+ * @param count returns the number of elements in the array
+ * @return      array of connection information
+ *
+ * It is the caller's responsibility to free the array. The
+ * NT_DisposeConnectionInfoArray function is useful for this purpose.
+ */
+struct NT_ConnectionInfo* NT_GetConnections(NT_Inst inst, size_t* count);
+
+/**
+ * Return whether or not the instance is connected to another node.
+ * @param inst  instance handle
+ * @return True if connected.
+ */
+NT_Bool NT_IsConnected(NT_Inst inst);
+
+/** @} */
+
+/**
+ * @defgroup FileFunctions File Save/Load Functions
+ * @{
+ */
+
+/**
+ * Save persistent values to a file.  The server automatically does this,
+ * but this function provides a way to save persistent values in the same
+ * format to a file on either a client or a server.
+ * @param inst      instance handle
+ * @param filename  filename
+ * @return error string, or NULL if successful
+ */
+const char* NT_SavePersistent(NT_Inst inst, const char* filename);
+
+/**
+ * Load persistent values from a file.  The server automatically does this
+ * at startup, but this function provides a way to restore persistent values
+ * in the same format from a file at any time on either a client or a server.
+ * @param inst      instance handle
+ * @param filename  filename
+ * @param warn      callback function for warnings
+ * @return error string, or NULL if successful
+ */
+const char* NT_LoadPersistent(NT_Inst inst, const char* filename,
+                              void (*warn)(size_t line, const char* msg));
+
+/**
+ * Save table values to a file.  The file format used is identical to
+ * that used for SavePersistent.
+ * @param inst        instance handle
+ * @param filename    filename
+ * @param prefix      save only keys starting with this prefix
+ * @param prefix_len  length of prefix in bytes
+ * @return error string, or nullptr if successful
+ */
+const char* NT_SaveEntries(NT_Inst inst, const char* filename,
+                           const char* prefix, size_t prefix_len);
+
+/**
+ * Load table values from a file.  The file format used is identical to
+ * that used for SavePersistent / LoadPersistent.
+ * @param inst        instance handle
+ * @param filename    filename
+ * @param prefix      load only keys starting with this prefix
+ * @param prefix_len  length of prefix in bytes
+ * @param warn        callback function for warnings
+ * @return error string, or nullptr if successful
+ */
+const char* NT_LoadEntries(NT_Inst inst, const char* filename,
+                           const char* prefix, size_t prefix_len,
+                           void (*warn)(size_t line, const char* msg));
+
+/** @} */
+
+/**
+ * @defgroup UtilityFunctions Utility Functions
+ * @{
+ */
+
+/**
+ * Frees value memory.
+ * @param value   value to free
+ */
+void NT_DisposeValue(struct NT_Value* value);
+
+/**
+ * Initializes a NT_Value.
+ * Sets type to NT_UNASSIGNED and clears rest of struct.
+ * @param value value to initialize
+ */
+void NT_InitValue(struct NT_Value* value);
+
+/**
+ * Frees string memory.
+ * @param str   string to free
+ */
+void NT_DisposeString(struct NT_String* str);
+
+/**
+ * Initializes a NT_String.
+ * Sets length to zero and pointer to null.
+ * @param str   string to initialize
+ */
+void NT_InitString(struct NT_String* str);
+
+/**
+ * Disposes an entry handle array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeEntryArray(NT_Entry* arr, size_t count);
+
+/**
+ * Disposes a connection info array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeConnectionInfoArray(struct NT_ConnectionInfo* arr, size_t count);
+
+/**
+ * Disposes an entry info array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeEntryInfoArray(struct NT_EntryInfo* arr, size_t count);
+
+/**
+ * Disposes a single entry info (as returned by NT_GetEntryInfoHandle).
+ * @param info  pointer to the info to dispose
+ */
+void NT_DisposeEntryInfo(struct NT_EntryInfo* info);
+
+/**
+ * Disposes a Rpc Definition structure.
+ * @param def  pointer to the struct to dispose
+ */
+void NT_DisposeRpcDefinition(struct NT_RpcDefinition* def);
+
+/**
+ * Disposes a Rpc Answer array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeRpcAnswerArray(struct NT_RpcAnswer* arr, size_t count);
+
+/**
+ * Disposes a Rpc Answer structure.
+ * @param answer     pointer to the struct to dispose
+ */
+void NT_DisposeRpcAnswer(struct NT_RpcAnswer* answer);
+
+/**
+ * Disposes an entry notification array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeEntryNotificationArray(struct NT_EntryNotification* arr,
+                                      size_t count);
+
+/**
+ * Disposes a single entry notification.
+ * @param info  pointer to the info to dispose
+ */
+void NT_DisposeEntryNotification(struct NT_EntryNotification* info);
+
+/**
+ * Disposes a connection notification array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeConnectionNotificationArray(
+    struct NT_ConnectionNotification* arr, size_t count);
+
+/**
+ * Disposes a single connection notification.
+ * @param info  pointer to the info to dispose
+ */
+void NT_DisposeConnectionNotification(struct NT_ConnectionNotification* info);
+
+/**
+ * Disposes a log message array.
+ * @param arr   pointer to the array to dispose
+ * @param count number of elements in the array
+ */
+void NT_DisposeLogMessageArray(struct NT_LogMessage* arr, size_t count);
+
+/**
+ * Disposes a single log message.
+ * @param info  pointer to the info to dispose
+ */
+void NT_DisposeLogMessage(struct NT_LogMessage* info);
+
+/**
+ * Returns monotonic current time in 1 us increments.
+ * This is the same time base used for entry and connection timestamps.
+ * This function is a compatibility wrapper around WPI_Now().
+ * @return Timestamp
+ */
+uint64_t NT_Now(void);
+
+/** @} */
+
+/**
+ * @defgroup LoggerFunctions Logger Functions
+ * @{
+ */
+
+/**
+ * Log function.
+ * @param data    data pointer passed to NT_AddLogger()
+ * @param msg     message information
+ */
+typedef void (*NT_LogFunc)(void* data, const struct NT_LogMessage* msg);
+
+/**
+ * Add logger callback function.  By default, log messages are sent to stderr;
+ * this function sends log messages to the provided callback function instead.
+ * The callback function will only be called for log messages with level
+ * greater than or equal to min_level and less than or equal to max_level;
+ * messages outside this range will be silently ignored.
+ *
+ * @param inst        instance handle
+ * @param data        data pointer to pass to func
+ * @param func        log callback function
+ * @param min_level   minimum log level
+ * @param max_level   maximum log level
+ * @return Logger handle
+ */
+NT_Logger NT_AddLogger(NT_Inst inst, void* data, NT_LogFunc func,
+                       unsigned int min_level, unsigned int max_level);
+
+/**
+ * Create a log poller.  A poller provides a single queue of poll events.
+ * The returned handle must be destroyed with NT_DestroyLoggerPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_LoggerPoller NT_CreateLoggerPoller(NT_Inst inst);
+
+/**
+ * Destroy a log poller.  This will abort any blocked polling call and prevent
+ * additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void NT_DestroyLoggerPoller(NT_LoggerPoller poller);
+
+/**
+ * Set the log level for a log poller.  Events will only be generated for
+ * log messages with level greater than or equal to min_level and less than or
+ * equal to max_level; messages outside this range will be silently ignored.
+ * @param poller        poller handle
+ * @param min_level     minimum log level
+ * @param max_level     maximum log level
+ * @return Logger handle
+ */
+NT_Logger NT_AddPolledLogger(NT_LoggerPoller poller, unsigned int min_level,
+                             unsigned int max_level);
+
+/**
+ * Get the next log event.  This blocks until the next log occurs.
+ * @param poller    poller handle
+ * @param len       length of returned array (output)
+ * @return Array of information on the log events.  Only returns NULL if an
+ *         error occurred (e.g. the instance was invalid or is shutting down).
+ */
+struct NT_LogMessage* NT_PollLogger(NT_LoggerPoller poller, size_t* len);
+
+/**
+ * Get the next log event.  This blocks until the next log occurs or it times
+ * out.
+ * @param poller      poller handle
+ * @param len         length of returned array (output)
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Array of information on the log events.  If NULL is returned and
+ *         timed_out is also false, an error occurred (e.g. the instance was
+ *         invalid or is shutting down).
+ */
+struct NT_LogMessage* NT_PollLoggerTimeout(NT_LoggerPoller poller, size_t* len,
+                                           double timeout, NT_Bool* timed_out);
+
+/**
+ * Cancel a PollLogger call.  This wakes up a call to PollLogger for this
+ * poller and causes it to immediately return an empty array.
+ * @param poller  poller handle
+ */
+void NT_CancelPollLogger(NT_LoggerPoller poller);
+
+/**
+ * Remove a logger.
+ * @param logger Logger handle to remove
+ */
+void NT_RemoveLogger(NT_Logger logger);
+
+/**
+ * Wait for the incoming log event queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the log event
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+NT_Bool NT_WaitForLoggerQueue(NT_Inst inst, double timeout);
+
+/** @} */
+
+/**
+ * @defgroup InteropFunctions Interop Utility Functions
+ * @{
+ */
+
+/**
+ * @defgroup MemoryAllocators Memory Allocators
+ * @{
+ */
+
+/**
+ * Allocates an array of chars.
+ * Note that the size is the number of elements, and not the
+ * specific number of bytes to allocate. That is calculated internally.
+ *
+ * @param size  the number of elements the array will contain
+ * @return      the allocated char array
+ *
+ * After use, the array should be freed using the NT_FreeCharArray()
+ * function.
+ */
+char* NT_AllocateCharArray(size_t size);
+
+/**
+ * Allocates an array of booleans.
+ * Note that the size is the number of elements, and not the
+ * specific number of bytes to allocate. That is calculated internally.
+ *
+ * @param size  the number of elements the array will contain
+ * @return      the allocated boolean array
+ *
+ * After use, the array should be freed using the NT_FreeBooleanArray()
+ * function.
+ */
+NT_Bool* NT_AllocateBooleanArray(size_t size);
+
+/**
+ * Allocates an array of doubles.
+ * Note that the size is the number of elements, and not the
+ * specific number of bytes to allocate. That is calculated internally.
+ *
+ * @param size  the number of elements the array will contain
+ * @return      the allocated double array
+ *
+ * After use, the array should be freed using the NT_FreeDoubleArray()
+ * function.
+ */
+double* NT_AllocateDoubleArray(size_t size);
+
+/**
+ * Allocates an array of NT_Strings.
+ * Note that the size is the number of elements, and not the
+ * specific number of bytes to allocate. That is calculated internally.
+ *
+ * @param size  the number of elements the array will contain
+ * @return      the allocated NT_String array
+ *
+ * After use, the array should be freed using the NT_FreeStringArray()
+ * function.
+ */
+struct NT_String* NT_AllocateStringArray(size_t size);
+
+/**
+ * Frees an array of chars.
+ *
+ * @param v_boolean  pointer to the char array to free
+ */
+void NT_FreeCharArray(char* v_char);
+
+/**
+ * Frees an array of doubles.
+ *
+ * @param v_boolean  pointer to the double array to free
+ */
+void NT_FreeDoubleArray(double* v_double);
+
+/**
+ * Frees an array of booleans.
+ *
+ * @param v_boolean  pointer to the boolean array to free
+ */
+void NT_FreeBooleanArray(NT_Bool* v_boolean);
+
+/**
+ * Frees an array of NT_Strings.
+ *
+ * @param v_string  pointer to the string array to free
+ * @param arr_size  size of the string array to free
+ *
+ * Note that the individual NT_Strings in the array should NOT be
+ * freed before calling this. This function will free all the strings
+ * individually.
+ */
+void NT_FreeStringArray(struct NT_String* v_string, size_t arr_size);
+
+/** @} */
+
+/**
+ * @defgroup TypedGetters Typed Getters
+ * @{
+ */
+
+/**
+ * Returns the type of an NT_Value struct.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param value  The NT_Value struct to get the type from.
+ * @return       The type of the value, or unassigned if null.
+ */
+enum NT_Type NT_GetValueType(const struct NT_Value* value);
+
+/**
+ * Returns the boolean from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns 0.
+ *
+ * @param value       NT_Value struct to get the boolean from
+ * @param last_change returns time in ms since the last change in the value
+ * @param v_boolean   returns the boolean assigned to the name
+ * @return            1 if successful, or 0 if value is null or not a boolean
+ */
+NT_Bool NT_GetValueBoolean(const struct NT_Value* value, uint64_t* last_change,
+                           NT_Bool* v_boolean);
+
+/**
+ * Returns the double from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns 0.
+ *
+ * @param value       NT_Value struct to get the double from
+ * @param last_change returns time in ms since the last change in the value
+ * @param v_double    returns the boolean assigned to the name
+ * @return            1 if successful, or 0 if value is null or not a double
+ */
+NT_Bool NT_GetValueDouble(const struct NT_Value* value, uint64_t* last_change,
+                          double* v_double);
+
+/**
+ * Returns a copy of the string from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns 0.
+ *
+ * @param value       NT_Value struct to get the string from
+ * @param last_change returns time in ms since the last change in the value
+ * @param str_len     returns the length of the string
+ * @return            pointer to the string (UTF-8), or null if error
+ *
+ * It is the caller's responsibility to free the string once its no longer
+ * needed. The NT_FreeCharArray() function is useful for this purpose. The
+ * returned string is a copy of the string in the value, and must be freed
+ * separately.
+ */
+char* NT_GetValueString(const struct NT_Value* value, uint64_t* last_change,
+                        size_t* str_len);
+
+/**
+ * Returns a copy of the raw value from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns null.
+ *
+ * @param value       NT_Value struct to get the string from
+ * @param last_change returns time in ms since the last change in the value
+ * @param raw_len     returns the length of the string
+ * @return            pointer to the raw value (UTF-8), or null if error
+ *
+ * It is the caller's responsibility to free the raw value once its no longer
+ * needed. The NT_FreeCharArray() function is useful for this purpose. The
+ * returned string is a copy of the string in the value, and must be freed
+ * separately.
+ */
+char* NT_GetValueRaw(const struct NT_Value* value, uint64_t* last_change,
+                     size_t* raw_len);
+
+/**
+ * Returns a copy of the boolean array from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns null.
+ *
+ * @param value       NT_Value struct to get the boolean array from
+ * @param last_change returns time in ms since the last change in the value
+ * @param arr_size    returns the number of elements in the array
+ * @return            pointer to the boolean array, or null if error
+ *
+ * It is the caller's responsibility to free the array once its no longer
+ * needed. The NT_FreeBooleanArray() function is useful for this purpose.
+ * The returned array is a copy of the array in the value, and must be
+ * freed separately.
+ */
+NT_Bool* NT_GetValueBooleanArray(const struct NT_Value* value,
+                                 uint64_t* last_change, size_t* arr_size);
+
+/**
+ * Returns a copy of the double array from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns null.
+ *
+ * @param value       NT_Value struct to get the double array from
+ * @param last_change returns time in ms since the last change in the value
+ * @param arr_size    returns the number of elements in the array
+ * @return            pointer to the double array, or null if error
+ *
+ * It is the caller's responsibility to free the array once its no longer
+ * needed. The NT_FreeDoubleArray() function is useful for this purpose.
+ * The returned array is a copy of the array in the value, and must be
+ * freed separately.
+ */
+double* NT_GetValueDoubleArray(const struct NT_Value* value,
+                               uint64_t* last_change, size_t* arr_size);
+
+/**
+ * Returns a copy of the NT_String array from the NT_Value.
+ * If the NT_Value is null, or is assigned to a different type, returns null.
+ *
+ * @param value       NT_Value struct to get the NT_String array from
+ * @param last_change returns time in ms since the last change in the value
+ * @param arr_size    returns the number of elements in the array
+ * @return            pointer to the NT_String array, or null if error
+ *
+ * It is the caller's responsibility to free the array once its no longer
+ * needed. The NT_FreeStringArray() function is useful for this purpose.
+ * The returned array is a copy of the array in the value, and must be
+ * freed seperately. Note that the individual NT_Strings should not be freed,
+ * but the entire array should be freed at once. The NT_FreeStringArray()
+ * function will free all the NT_Strings.
+ */
+NT_String* NT_GetValueStringArray(const struct NT_Value* value,
+                                  uint64_t* last_change, size_t* arr_size);
+
+/**
+ * Returns the boolean currently assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns 0.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param v_boolean   returns the boolean assigned to the name
+ * @return            1 if successful, or 0 if value is unassigned or not a
+ *                    boolean
+ */
+NT_Bool NT_GetEntryBoolean(NT_Entry entry, uint64_t* last_change,
+                           NT_Bool* v_boolean);
+
+/**
+ * Returns the double currently assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns 0.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param v_double    returns the double assigned to the name
+ * @return            1 if successful, or 0 if value is unassigned or not a
+ *                    double
+ */
+NT_Bool NT_GetEntryDouble(NT_Entry entry, uint64_t* last_change,
+                          double* v_double);
+
+/**
+ * Returns a copy of the string assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns null.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param str_len     returns the length of the string
+ * @return            pointer to the string (UTF-8), or null if error
+ *
+ * It is the caller's responsibility to free the string once its no longer
+ * needed. The NT_FreeCharArray() function is useful for this purpose.
+ */
+char* NT_GetEntryString(NT_Entry entry, uint64_t* last_change, size_t* str_len);
+
+/**
+ * Returns a copy of the raw value assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns null.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param raw_len     returns the length of the string
+ * @return            pointer to the raw value (UTF-8), or null if error
+ *
+ * It is the caller's responsibility to free the raw value once its no longer
+ * needed. The NT_FreeCharArray() function is useful for this purpose.
+ */
+char* NT_GetEntryRaw(NT_Entry entry, uint64_t* last_change, size_t* raw_len);
+
+/**
+ * Returns a copy of the boolean array assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns null.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param arr_size    returns the number of elements in the array
+ * @return            pointer to the boolean array, or null if error
+ *
+ * It is the caller's responsibility to free the array once its no longer
+ * needed. The NT_FreeBooleanArray() function is useful for this purpose.
+ */
+NT_Bool* NT_GetEntryBooleanArray(NT_Entry entry, uint64_t* last_change,
+                                 size_t* arr_size);
+
+/**
+ * Returns a copy of the double array assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns null.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param arr_size    returns the number of elements in the array
+ * @return            pointer to the double array, or null if error
+ *
+ * It is the caller's responsibility to free the array once its no longer
+ * needed. The NT_FreeDoubleArray() function is useful for this purpose.
+ */
+double* NT_GetEntryDoubleArray(NT_Entry entry, uint64_t* last_change,
+                               size_t* arr_size);
+
+/**
+ * Returns a copy of the NT_String array assigned to the entry name.
+ * If the entry name is not currently assigned, or is assigned to a
+ * different type, returns null.
+ *
+ * @param entry       entry handle
+ * @param last_change returns time in ms since the last change in the value
+ * @param arr_size    returns the number of elements in the array
+ * @return            pointer to the NT_String array, or null if error
+ *
+ * It is the caller's responsibility to free the array once its no longer
+ * needed. The NT_FreeStringArray() function is useful for this purpose. Note
+ * that the individual NT_Strings should not be freed, but the entire array
+ * should be freed at once. The NT_FreeStringArray() function will free all the
+ * NT_Strings.
+ */
+NT_String* NT_GetEntryStringArray(NT_Entry entry, uint64_t* last_change,
+                                  size_t* arr_size);
+
+/** @} */
+
+/**
+ * @defgroup SetDefault Set Default Values
+ * @{
+ */
+
+/** Set Default Entry Boolean.
+ * Sets the default for the specified key to be a boolean.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_boolean     value to be set if name does not exist
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryBoolean(NT_Entry entry, uint64_t time,
+                                  NT_Bool default_boolean);
+
+/** Set Default Entry Double.
+ * Sets the default for the specified key.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_double     value to be set if name does not exist
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryDouble(NT_Entry entry, uint64_t time,
+                                 double default_double);
+
+/** Set Default Entry String.
+ * Sets the default for the specified key.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_value     value to be set if name does not exist
+ * @param default_len       length of value
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryString(NT_Entry entry, uint64_t time,
+                                 const char* default_value, size_t default_len);
+
+/** Set Default Entry Raw.
+ * Sets the default for the specified key.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_value     value to be set if name does not exist
+ * @param default_len       length of value array
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryRaw(NT_Entry entry, uint64_t time,
+                              const char* default_value, size_t default_len);
+
+/** Set Default Entry Boolean Array.
+ * Sets the default for the specified key.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_value     value to be set if name does not exist
+ * @param default_size      size of value array
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryBooleanArray(NT_Entry entry, uint64_t time,
+                                       const int* default_value,
+                                       size_t default_size);
+
+/** Set Default Entry Double Array.
+ * Sets the default for the specified key.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_value     value to be set if name does not exist
+ * @param default_size      size of value array
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryDoubleArray(NT_Entry entry, uint64_t time,
+                                      const double* default_value,
+                                      size_t default_size);
+
+/** Set Default Entry String Array.
+ * Sets the default for the specified key.
+ * If key exists with same type, does not set value. Otherwise
+ * sets value to the default.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param default_value     value to be set if name does not exist
+ * @param default_size      size of value array
+ * @return 0 on error (value not set), 1 on success
+ */
+NT_Bool NT_SetDefaultEntryStringArray(NT_Entry entry, uint64_t time,
+                                      const struct NT_String* default_value,
+                                      size_t default_size);
+
+/** @} */
+
+/**
+ * @defgroup ValueSetters Entry Value Setters
+ * @{
+ */
+
+/** Set Entry Boolean
+ * Sets an entry boolean. If the entry name is not currently assigned to a
+ * boolean, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param v_boolean boolean value to set
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryBoolean(NT_Entry entry, uint64_t time, NT_Bool v_boolean,
+                           NT_Bool force);
+
+/** Set Entry Double
+ * Sets an entry double. If the entry name is not currently assigned to a
+ * double, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param v_double  double value to set
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryDouble(NT_Entry entry, uint64_t time, double v_double,
+                          NT_Bool force);
+
+/** Set Entry String
+ * Sets an entry string. If the entry name is not currently assigned to a
+ * string, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param str       string to set (UTF-8 string)
+ * @param str_len   length of string to write in bytes
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryString(NT_Entry entry, uint64_t time, const char* str,
+                          size_t str_len, NT_Bool force);
+
+/** Set Entry Raw
+ * Sets the raw value of an entry. If the entry name is not currently assigned
+ * to a raw value, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param raw       raw string to set (UTF-8 string)
+ * @param raw_len   length of raw string to write in bytes
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryRaw(NT_Entry entry, uint64_t time, const char* raw,
+                       size_t raw_len, NT_Bool force);
+
+/** Set Entry Boolean Array
+ * Sets an entry boolean array. If the entry name is not currently assigned to
+ * a boolean array, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param arr       boolean array to write
+ * @param size      number of elements in the array
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryBooleanArray(NT_Entry entry, uint64_t time, const int* arr,
+                                size_t size, NT_Bool force);
+
+/** Set Entry Double Array
+ * Sets an entry double array. If the entry name is not currently assigned to
+ * a double array, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param arr       double array to write
+ * @param size      number of elements in the array
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryDoubleArray(NT_Entry entry, uint64_t time, const double* arr,
+                               size_t size, NT_Bool force);
+
+/** Set Entry String Array
+ * Sets an entry string array. If the entry name is not currently assigned to
+ * a string array, returns error unless the force parameter is set.
+ *
+ * @param entry     entry handle
+ * @param time      timestamp
+ * @param arr       NT_String array to write
+ * @param size      number of elements in the array
+ * @param force     1 to force the entry to get overwritten, otherwise 0
+ * @return          0 on error (type mismatch), 1 on success
+ */
+NT_Bool NT_SetEntryStringArray(NT_Entry entry, uint64_t time,
+                               const struct NT_String* arr, size_t size,
+                               NT_Bool force);
+
+/** @} */
+/** @} */
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // NTCORE_NTCORE_C_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/ntcore_cpp.h b/third_party/ntcore_2018/src/main/native/include/ntcore_cpp.h
new file mode 100644
index 0000000..786c965
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/ntcore_cpp.h
@@ -0,0 +1,1489 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NTCORE_CPP_H_
+#define NTCORE_NTCORE_CPP_H_
+
+#include <stdint.h>
+
+#include <cassert>
+#include <functional>
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include <llvm/ArrayRef.h>
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+#include <support/deprecated.h>
+
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+
+using llvm::ArrayRef;
+using llvm::StringRef;
+using llvm::Twine;
+
+/** NetworkTables Entry Information */
+struct EntryInfo {
+  /** Entry handle */
+  NT_Entry entry;
+
+  /** Entry name */
+  std::string name;
+
+  /** Entry type */
+  NT_Type type;
+
+  /** Entry flags */
+  unsigned int flags;
+
+  /** Timestamp of last change to entry (type or value). */
+  uint64_t last_change;
+
+  friend void swap(EntryInfo& first, EntryInfo& second) {
+    using std::swap;
+    swap(first.entry, second.entry);
+    swap(first.name, second.name);
+    swap(first.type, second.type);
+    swap(first.flags, second.flags);
+    swap(first.last_change, second.last_change);
+  }
+};
+
+/** NetworkTables Connection Information */
+struct ConnectionInfo {
+  /**
+   * The remote identifier (as set on the remote node by
+   * NetworkTableInstance::SetNetworkIdentity() or nt::SetNetworkIdentity()).
+   */
+  std::string remote_id;
+
+  /** The IP address of the remote node. */
+  std::string remote_ip;
+
+  /** The port number of the remote node. */
+  unsigned int remote_port;
+
+  /**
+   * The last time any update was received from the remote node (same scale as
+   * returned by nt::Now()).
+   */
+  uint64_t last_update;
+
+  /**
+   * The protocol version being used for this connection.  This in protocol
+   * layer format, so 0x0200 = 2.0, 0x0300 = 3.0).
+   */
+  unsigned int protocol_version;
+
+  friend void swap(ConnectionInfo& first, ConnectionInfo& second) {
+    using std::swap;
+    swap(first.remote_id, second.remote_id);
+    swap(first.remote_ip, second.remote_ip);
+    swap(first.remote_port, second.remote_port);
+    swap(first.last_update, second.last_update);
+    swap(first.protocol_version, second.protocol_version);
+  }
+};
+
+/** NetworkTables RPC Version 1 Definition Parameter */
+struct RpcParamDef {
+  RpcParamDef() = default;
+  RpcParamDef(StringRef name_, std::shared_ptr<Value> def_value_)
+      : name(name_), def_value(def_value_) {}
+
+  std::string name;
+  std::shared_ptr<Value> def_value;
+};
+
+/** NetworkTables RPC Version 1 Definition Result */
+struct RpcResultDef {
+  RpcResultDef() = default;
+  RpcResultDef(StringRef name_, NT_Type type_) : name(name_), type(type_) {}
+
+  std::string name;
+  NT_Type type;
+};
+
+/** NetworkTables RPC Version 1 Definition */
+struct RpcDefinition {
+  unsigned int version;
+  std::string name;
+  std::vector<RpcParamDef> params;
+  std::vector<RpcResultDef> results;
+};
+
+/** NetworkTables Remote Procedure Call (Server Side) */
+class RpcAnswer {
+ public:
+  RpcAnswer() : entry(0), call(0) {}
+  RpcAnswer(NT_Entry entry_, NT_RpcCall call_, StringRef name_,
+            StringRef params_, const ConnectionInfo& conn_)
+      : entry(entry_), call(call_), name(name_), params(params_), conn(conn_) {}
+
+  /** Entry handle. */
+  NT_Entry entry;
+
+  /** Call handle. */
+  NT_RpcCall call;
+
+  /** Entry name. */
+  std::string name;
+
+  /** Call raw parameters. */
+  std::string params;
+
+  /** Connection that called the RPC. */
+  ConnectionInfo conn;
+
+  /**
+   * Determines if the native handle is valid.
+   * @return True if the native handle is valid, false otherwise.
+   */
+  explicit operator bool() const { return call != 0; }
+
+  /**
+   * Post RPC response (return value) for a polled RPC.
+   * @param result  result raw data that will be provided to remote caller
+   */
+  void PostResponse(StringRef result) const;
+
+  friend void swap(RpcAnswer& first, RpcAnswer& second) {
+    using std::swap;
+    swap(first.entry, second.entry);
+    swap(first.call, second.call);
+    swap(first.name, second.name);
+    swap(first.params, second.params);
+    swap(first.conn, second.conn);
+  }
+};
+
+/** NetworkTables Entry Notification */
+class EntryNotification {
+ public:
+  EntryNotification() : listener(0), entry(0) {}
+  EntryNotification(NT_EntryListener listener_, NT_Entry entry_,
+                    StringRef name_, std::shared_ptr<Value> value_,
+                    unsigned int flags_)
+      : listener(listener_),
+        entry(entry_),
+        name(name_),
+        value(value_),
+        flags(flags_) {}
+
+  /** Listener that was triggered. */
+  NT_EntryListener listener;
+
+  /** Entry handle. */
+  NT_Entry entry;
+
+  /** Entry name. */
+  std::string name;
+
+  /** The new value. */
+  std::shared_ptr<Value> value;
+
+  /**
+   * Update flags.  For example, NT_NOTIFY_NEW if the key did not previously
+   * exist.
+   */
+  unsigned int flags;
+
+  friend void swap(EntryNotification& first, EntryNotification& second) {
+    using std::swap;
+    swap(first.listener, second.listener);
+    swap(first.entry, second.entry);
+    swap(first.name, second.name);
+    swap(first.value, second.value);
+    swap(first.flags, second.flags);
+  }
+};
+
+/** NetworkTables Connection Notification */
+class ConnectionNotification {
+ public:
+  ConnectionNotification() : listener(0), connected(false) {}
+  ConnectionNotification(NT_ConnectionListener listener_, bool connected_,
+                         const ConnectionInfo& conn_)
+      : listener(listener_), connected(connected_), conn(conn_) {}
+
+  /** Listener that was triggered. */
+  NT_ConnectionListener listener;
+
+  /** True if event is due to connection being established. */
+  bool connected = false;
+
+  /** Connection info. */
+  ConnectionInfo conn;
+
+  friend void swap(ConnectionNotification& first,
+                   ConnectionNotification& second) {
+    using std::swap;
+    swap(first.listener, second.listener);
+    swap(first.connected, second.connected);
+    swap(first.conn, second.conn);
+  }
+};
+
+/** NetworkTables log message. */
+class LogMessage {
+ public:
+  LogMessage() : logger(0), level(0), filename(""), line(0) {}
+  LogMessage(NT_Logger logger_, unsigned int level_, const char* filename_,
+             unsigned int line_, StringRef message_)
+      : logger(logger_),
+        level(level_),
+        filename(filename_),
+        line(line_),
+        message(message_) {}
+
+  /** The logger that generated the message. */
+  NT_Logger logger;
+
+  /** Log level of the message.  See NT_LogLevel. */
+  unsigned int level;
+
+  /** The filename of the source file that generated the message. */
+  const char* filename;
+
+  /** The line number in the source file that generated the message. */
+  unsigned int line;
+
+  /** The message. */
+  std::string message;
+
+  friend void swap(LogMessage& first, LogMessage& second) {
+    using std::swap;
+    swap(first.logger, second.logger);
+    swap(first.level, second.level);
+    swap(first.filename, second.filename);
+    swap(first.line, second.line);
+    swap(first.message, second.message);
+  }
+};
+
+/**
+ * @defgroup InstanceFunctions Instance Functions
+ * @{
+ */
+
+/**
+ * Get default instance.
+ * This is the instance used by non-handle-taking functions.
+ * @return Instance handle
+ */
+NT_Inst GetDefaultInstance();
+
+/**
+ * Create an instance.
+ * @return Instance handle
+ */
+NT_Inst CreateInstance();
+
+/**
+ * Destroy an instance.
+ * The default instance cannot be destroyed.
+ * @param inst Instance handle
+ */
+void DestroyInstance(NT_Inst inst);
+
+/**
+ * Get instance handle from another handle.
+ * @param handle    entry/instance/etc. handle
+ * @return Instance handle
+ */
+NT_Inst GetInstanceFromHandle(NT_Handle handle);
+
+/** @} */
+
+/**
+ * @defgroup TableFunctions Table Functions
+ * @{
+ */
+
+/**
+ * Get Entry Handle.
+ * @param inst      instance handle
+ * @param name      entry name (UTF-8 string)
+ * @return entry handle
+ */
+NT_Entry GetEntry(NT_Inst inst, const Twine& name);
+
+/**
+ * Get Entry Handles.
+ * Returns an array of entry handles.  The results are optionally
+ * filtered by string prefix and entry type to only return a subset of all
+ * entries.
+ *
+ * @param inst          instance handle
+ * @param prefix        entry name required prefix; only entries whose name
+ *                      starts with this string are returned
+ * @param types         bitmask of NT_Type values; 0 is treated specially
+ *                      as a "don't care"
+ * @return Array of entry handles.
+ */
+std::vector<NT_Entry> GetEntries(NT_Inst inst, const Twine& prefix,
+                                 unsigned int types);
+
+/**
+ * Gets the name of the specified entry.
+ * Returns an empty string if the handle is invalid.
+ * @param entry   entry handle
+ * @return Entry name
+ */
+std::string GetEntryName(NT_Entry entry);
+
+/**
+ * Gets the type for the specified entry, or unassigned if non existent.
+ * @param entry   entry handle
+ * @return Entry type
+ */
+NT_Type GetEntryType(NT_Entry entry);
+
+/**
+ * Gets the last time the entry was changed.
+ * Returns 0 if the handle is invalid.
+ * @param entry   entry handle
+ * @return Entry last change time
+ */
+uint64_t GetEntryLastChange(NT_Entry entry);
+
+/**
+ * Get Entry Value.
+ * Returns copy of current entry value.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param name      entry name (UTF-8 string)
+ * @return entry value
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+std::shared_ptr<Value> GetEntryValue(StringRef name);
+
+/**
+ * Get Entry Value.
+ * Returns copy of current entry value.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param entry     entry handle
+ * @return entry value
+ */
+std::shared_ptr<Value> GetEntryValue(NT_Entry entry);
+
+/**
+ * Set Default Entry Value
+ * Returns copy of current entry value if it exists.
+ * Otherwise, sets passed in value, and returns set value.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param name      entry name (UTF-8 string)
+ * @param value     value to be set if name does not exist
+ * @return False on error (value not set), True on success
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+bool SetDefaultEntryValue(StringRef name, std::shared_ptr<Value> value);
+
+/**
+ * Set Default Entry Value
+ * Returns copy of current entry value if it exists.
+ * Otherwise, sets passed in value, and returns set value.
+ * Note that one of the type options is "unassigned".
+ *
+ * @param entry     entry handle
+ * @param value     value to be set if name does not exist
+ * @return False on error (value not set), True on success
+ */
+bool SetDefaultEntryValue(NT_Entry entry, std::shared_ptr<Value> value);
+
+/**
+ * Set Entry Value.
+ * Sets new entry value.  If type of new value differs from the type of the
+ * currently stored entry, returns error and does not update value.
+ *
+ * @param name      entry name (UTF-8 string)
+ * @param value     new entry value
+ * @return False on error (type mismatch), True on success
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+bool SetEntryValue(StringRef name, std::shared_ptr<Value> value);
+
+/**
+ * Set Entry Value.
+ * Sets new entry value.  If type of new value differs from the type of the
+ * currently stored entry, returns error and does not update value.
+ *
+ * @param entry     entry handle
+ * @param value     new entry value
+ * @return False on error (type mismatch), True on success
+ */
+bool SetEntryValue(NT_Entry entry, std::shared_ptr<Value> value);
+
+/**
+ * Set Entry Type and Value.
+ * Sets new entry value.  If type of new value differs from the type of the
+ * currently stored entry, the currently stored entry type is overridden
+ * (generally this will generate an Entry Assignment message).
+ *
+ * This is NOT the preferred method to update a value; generally
+ * SetEntryValue() should be used instead, with appropriate error handling.
+ *
+ * @param name      entry name (UTF-8 string)
+ * @param value     new entry value
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+void SetEntryTypeValue(StringRef name, std::shared_ptr<Value> value);
+
+/**
+ * Set Entry Type and Value.
+ * Sets new entry value.  If type of new value differs from the type of the
+ * currently stored entry, the currently stored entry type is overridden
+ * (generally this will generate an Entry Assignment message).
+ *
+ * This is NOT the preferred method to update a value; generally
+ * SetEntryValue() should be used instead, with appropriate error handling.
+ *
+ * @param entry     entry handle
+ * @param value     new entry value
+ */
+void SetEntryTypeValue(NT_Entry entry, std::shared_ptr<Value> value);
+
+/**
+ * Set Entry Flags.
+ * @param name      entry name (UTF-8 string)
+ * @param flags     flags value (bitmask of NT_EntryFlags)
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+void SetEntryFlags(StringRef name, unsigned int flags);
+
+/**
+ * Set Entry Flags.
+ * @param entry     entry handle
+ * @param flags     flags value (bitmask of NT_EntryFlags)
+ */
+void SetEntryFlags(NT_Entry entry, unsigned int flags);
+
+/**
+ * Get Entry Flags.
+ * @param name      entry name (UTF-8 string)
+ * @return Flags value (bitmask of NT_EntryFlags)
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+unsigned int GetEntryFlags(StringRef name);
+
+/**
+ * Get Entry Flags.
+ * @param entry     entry handle
+ * @return Flags value (bitmask of NT_EntryFlags)
+ */
+unsigned int GetEntryFlags(NT_Entry entry);
+
+/**
+ * Delete Entry.
+ * Deletes an entry.  This is a new feature in version 3.0 of the protocol,
+ * so this may not have an effect if any other node in the network is not
+ * version 3.0 or newer.
+ *
+ * Note: GetConnections() can be used to determine the protocol version
+ * of direct remote connection(s), but this is not sufficient to determine
+ * if all nodes in the network are version 3.0 or newer.
+ *
+ * @param name      entry name (UTF-8 string)
+ */
+WPI_DEPRECATED("use NT_Entry function instead")
+void DeleteEntry(StringRef name);
+
+/**
+ * Delete Entry.
+ * Deletes an entry.  This is a new feature in version 3.0 of the protocol,
+ * so this may not have an effect if any other node in the network is not
+ * version 3.0 or newer.
+ *
+ * Note: GetConnections() can be used to determine the protocol version
+ * of direct remote connection(s), but this is not sufficient to determine
+ * if all nodes in the network are version 3.0 or newer.
+ *
+ * @param entry     entry handle
+ */
+void DeleteEntry(NT_Entry entry);
+
+/**
+ * Delete All Entries.
+ * Deletes ALL table entries.  This is a new feature in version 3.0 of the
+ * so this may not have an effect if any other node in the network is not
+ * version 3.0 or newer.
+ *
+ * Note: GetConnections() can be used to determine the protocol version
+ * of direct remote connection(s), but this is not sufficient to determine
+ * if all nodes in the network are version 3.0 or newer.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void DeleteAllEntries();
+
+/**
+ * @copydoc DeleteAllEntries()
+ *
+ * @param inst      instance handle
+ */
+void DeleteAllEntries(NT_Inst inst);
+
+/**
+ * Get Entry Information.
+ * Returns an array of entry information (name, entry type,
+ * and timestamp of last change to type/value).  The results are optionally
+ * filtered by string prefix and entry type to only return a subset of all
+ * entries.
+ *
+ * @param prefix        entry name required prefix; only entries whose name
+ *                      starts with this string are returned
+ * @param types         bitmask of NT_Type values; 0 is treated specially
+ *                      as a "don't care"
+ * @return Array of entry information.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+std::vector<EntryInfo> GetEntryInfo(StringRef prefix, unsigned int types);
+
+/**
+ * @copydoc GetEntryInfo(StringRef, unsigned int)
+ *
+ * @param inst    instance handle
+ */
+std::vector<EntryInfo> GetEntryInfo(NT_Inst inst, const Twine& prefix,
+                                    unsigned int types);
+
+/**
+ * Get Entry Information.
+ * Returns information about an entry (name, entry type,
+ * and timestamp of last change to type/value).
+ *
+ * @param entry         entry handle
+ * @return Entry information.
+ */
+EntryInfo GetEntryInfo(NT_Entry entry);
+
+/** @} */
+
+/**
+ * @defgroup EntryListenerFunctions Entry Listener Functions
+ * @{
+ */
+
+/**
+ * Entry listener callback function.
+ * Called when a key-value pair is changed.
+ *
+ * @param entry_listener  entry listener handle returned by callback creation
+ *                        function
+ * @param name            entry name
+ * @param value           the new value
+ * @param flags           update flags; for example, NT_NOTIFY_NEW if the key
+ *                        did not previously exist
+ */
+typedef std::function<void(NT_EntryListener entry_listener, StringRef name,
+                           std::shared_ptr<Value> value, unsigned int flags)>
+    EntryListenerCallback;
+
+/**
+ * Add a listener for all entries starting with a certain prefix.
+ *
+ * @param prefix            UTF-8 string prefix
+ * @param callback          listener to add
+ * @param flags             NotifyKind bitmask
+ * @return Listener handle
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+NT_EntryListener AddEntryListener(StringRef prefix,
+                                  EntryListenerCallback callback,
+                                  unsigned int flags);
+
+/**
+ * @copydoc AddEntryListener(StringRef, EntryListenerCallback, unsigned int)
+ * @param inst              instance handle
+ */
+NT_EntryListener AddEntryListener(
+    NT_Inst inst, const Twine& prefix,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags);
+
+/**
+ * Add a listener for a single entry.
+ *
+ * @param entry             entry handle
+ * @param callback          listener to add
+ * @param flags             NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener AddEntryListener(
+    NT_Entry entry,
+    std::function<void(const EntryNotification& event)> callback,
+    unsigned int flags);
+
+/**
+ * Create a entry listener poller.
+ * A poller provides a single queue of poll events.  Events linked to this
+ * poller (using AddPolledEntryListener()) will be stored in the queue and
+ * must be collected by calling PollEntryListener().
+ * The returned handle must be destroyed with DestroyEntryListenerPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_EntryListenerPoller CreateEntryListenerPoller(NT_Inst inst);
+
+/**
+ * Destroy a entry listener poller.  This will abort any blocked polling
+ * call and prevent additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void DestroyEntryListenerPoller(NT_EntryListenerPoller poller);
+
+/**
+ * Create a polled entry listener.
+ * The caller is responsible for calling PollEntryListener() to poll.
+ * @param poller            poller handle
+ * @param prefix            UTF-8 string prefix
+ * @param flags             NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener AddPolledEntryListener(NT_EntryListenerPoller poller,
+                                        const Twine& prefix,
+                                        unsigned int flags);
+
+/**
+ * Create a polled entry listener.
+ * The caller is responsible for calling PollEntryListener() to poll.
+ * @param poller            poller handle
+ * @param prefix            UTF-8 string prefix
+ * @param flags             NotifyKind bitmask
+ * @return Listener handle
+ */
+NT_EntryListener AddPolledEntryListener(NT_EntryListenerPoller poller,
+                                        NT_Entry entry, unsigned int flags);
+
+/**
+ * Get the next entry listener event.  This blocks until the next event occurs.
+ * This is intended to be used with AddPolledEntryListener(); entry listeners
+ * created using AddEntryListener() will not be serviced through this function.
+ * @param poller    poller handle
+ * @return Information on the entry listener events.  Only returns empty if an
+ *         error occurred (e.g. the instance was invalid or is shutting down).
+ */
+std::vector<EntryNotification> PollEntryListener(NT_EntryListenerPoller poller);
+
+/**
+ * Get the next entry listener event.  This blocks until the next event occurs
+ * or it times out.  This is intended to be used with AddPolledEntryListener();
+ * entry listeners created using AddEntryListener() will not be serviced
+ * through this function.
+ * @param poller      poller handle
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Information on the entry listener events.  If empty is returned and
+ *         and timed_out is also false, an error occurred (e.g. the instance
+ *         was invalid or is shutting down).
+ */
+std::vector<EntryNotification> PollEntryListener(NT_EntryListenerPoller poller,
+                                                 double timeout,
+                                                 bool* timed_out);
+
+/**
+ * Cancel a PollEntryListener call.  This wakes up a call to
+ * PollEntryListener for this poller and causes it to immediately return
+ * an empty array.
+ * @param poller  poller handle
+ */
+void CancelPollEntryListener(NT_EntryListenerPoller poller);
+
+/**
+ * Remove an entry listener.
+ * @param entry_listener Listener handle to remove
+ */
+void RemoveEntryListener(NT_EntryListener entry_listener);
+
+/**
+ * Wait for the entry listener queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the entry listener
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+bool WaitForEntryListenerQueue(NT_Inst inst, double timeout);
+
+/** @} */
+
+/**
+ * @defgroup ConnectionListenerFunctions Connection Listener Functions
+ * @{
+ */
+
+/**
+ * Connection listener callback function.
+ * Called when a network connection is made or lost.
+ *
+ * @param conn_listener   connection listener handle returned by callback
+ *                        creation function
+ * @param connected       true if event is due to connection being established
+ * @param conn            connection info
+ */
+typedef std::function<void(NT_ConnectionListener conn_listener, bool connected,
+                           const ConnectionInfo& conn)>
+    ConnectionListenerCallback;
+
+/**
+ * Add a connection listener.
+ *
+ * @param callback          listener to add
+ * @param immediate_notify  notify listener of all existing connections
+ * @return Listener handle
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+NT_ConnectionListener AddConnectionListener(ConnectionListenerCallback callback,
+                                            bool immediate_notify);
+
+/**
+ * @copydoc AddConnectionListener(ConnectionListenerCallback, bool)
+ * @param inst              instance handle
+ */
+NT_ConnectionListener AddConnectionListener(
+    NT_Inst inst,
+    std::function<void(const ConnectionNotification& event)> callback,
+    bool immediate_notify);
+
+/**
+ * Create a connection listener poller.
+ * A poller provides a single queue of poll events.  Events linked to this
+ * poller (using AddPolledConnectionListener()) will be stored in the queue and
+ * must be collected by calling PollConnectionListener().
+ * The returned handle must be destroyed with DestroyConnectionListenerPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_ConnectionListenerPoller CreateConnectionListenerPoller(NT_Inst inst);
+
+/**
+ * Destroy a connection listener poller.  This will abort any blocked polling
+ * call and prevent additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void DestroyConnectionListenerPoller(NT_ConnectionListenerPoller poller);
+
+/**
+ * Create a polled connection listener.
+ * The caller is responsible for calling PollConnectionListener() to poll.
+ * @param poller            poller handle
+ * @param immediate_notify  notify listener of all existing connections
+ */
+NT_ConnectionListener AddPolledConnectionListener(
+    NT_ConnectionListenerPoller poller, bool immediate_notify);
+
+/**
+ * Get the next connection event.  This blocks until the next connect or
+ * disconnect occurs.  This is intended to be used with
+ * AddPolledConnectionListener(); connection listeners created using
+ * AddConnectionListener() will not be serviced through this function.
+ * @param poller    poller handle
+ * @return Information on the connection events.  Only returns empty if an
+ *         error occurred (e.g. the instance was invalid or is shutting down).
+ */
+std::vector<ConnectionNotification> PollConnectionListener(
+    NT_ConnectionListenerPoller poller);
+
+/**
+ * Get the next connection event.  This blocks until the next connect or
+ * disconnect occurs or it times out.  This is intended to be used with
+ * AddPolledConnectionListener(); connection listeners created using
+ * AddConnectionListener() will not be serviced through this function.
+ * @param poller      poller handle
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Information on the connection events.  If empty is returned and
+ *         timed_out is also false, an error occurred (e.g. the instance was
+ *         invalid or is shutting down).
+ */
+std::vector<ConnectionNotification> PollConnectionListener(
+    NT_ConnectionListenerPoller poller, double timeout, bool* timed_out);
+
+/**
+ * Cancel a PollConnectionListener call.  This wakes up a call to
+ * PollConnectionListener for this poller and causes it to immediately return
+ * an empty array.
+ * @param poller  poller handle
+ */
+void CancelPollConnectionListener(NT_ConnectionListenerPoller poller);
+
+/**
+ * Remove a connection listener.
+ * @param conn_listener Listener handle to remove
+ */
+void RemoveConnectionListener(NT_ConnectionListener conn_listener);
+
+/**
+ * Wait for the connection listener queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the connection listener
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+bool WaitForConnectionListenerQueue(NT_Inst inst, double timeout);
+
+/** @} */
+
+/**
+ * @defgroup RpcFunctions Remote Procedure Call Functions
+ * @{
+ */
+
+/**
+ * Create a callback-based RPC entry point.  Only valid to use on the server.
+ * The callback function will be called when the RPC is called.
+ * @param entry     entry handle of RPC entry
+ * @param def       RPC definition
+ * @param callback  callback function; note the callback function must call
+ *                  PostRpcResponse() to provide a response to the call
+ */
+void CreateRpc(NT_Entry entry, StringRef def,
+               std::function<void(const RpcAnswer& answer)> callback);
+
+/**
+ * Create a RPC call poller.  Only valid to use on the server.
+ * A poller provides a single queue of poll events.  Events linked to this
+ * poller (using CreatePolledRpc()) will be stored in the queue and must be
+ * collected by calling PollRpc().
+ * The returned handle must be destroyed with DestroyRpcCallPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_RpcCallPoller CreateRpcCallPoller(NT_Inst inst);
+
+/**
+ * Destroy a RPC call poller.  This will abort any blocked polling call and
+ * prevent additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void DestroyRpcCallPoller(NT_RpcCallPoller poller);
+
+/**
+ * Create a polled RPC entry point.  Only valid to use on the server.
+ * The caller is responsible for calling PollRpc() to poll for servicing
+ * incoming RPC calls.
+ * @param entry     entry handle of RPC entry
+ * @param def       RPC definition
+ * @param poller    poller handle
+ */
+void CreatePolledRpc(NT_Entry entry, StringRef def, NT_RpcCallPoller poller);
+
+/**
+ * Get the next incoming RPC call.  This blocks until the next incoming RPC
+ * call is received.  This is intended to be used with CreatePolledRpc();
+ * RPC calls created using CreateRpc() will not be serviced through this
+ * function.  Upon successful return, PostRpcResponse() must be called to
+ * send the return value to the caller.
+ * @param poller      poller handle
+ * @return Information on the next RPC calls.  Only returns empty if an error
+ *         occurred (e.g. the instance was invalid or is shutting down).
+ */
+std::vector<RpcAnswer> PollRpc(NT_RpcCallPoller poller);
+
+/**
+ * Get the next incoming RPC call.  This blocks until the next incoming RPC
+ * call is received or it times out.  This is intended to be used with
+ * CreatePolledRpc(); RPC calls created using CreateRpc() will not be
+ * serviced through this function.  Upon successful return,
+ * PostRpcResponse() must be called to send the return value to the caller.
+ * @param poller      poller handle
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Information on the next RPC calls.  If empty and timed_out is also
+ *         false, an error occurred (e.g. the instance was invalid or is
+ *         shutting down).
+ */
+std::vector<RpcAnswer> PollRpc(NT_RpcCallPoller poller, double timeout,
+                               bool* timed_out);
+
+/**
+ * Cancel a PollRpc call.  This wakes up a call to PollRpc for this poller
+ * and causes it to immediately return an empty array.
+ * @param poller  poller handle
+ */
+void CancelPollRpc(NT_RpcCallPoller poller);
+
+/**
+ * Wait for the incoming RPC call queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the RPC call
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+bool WaitForRpcCallQueue(NT_Inst inst, double timeout);
+
+/**
+ * Post RPC response (return value) for a polled RPC.
+ * The rpc and call parameters should come from the RpcAnswer returned
+ * by PollRpc().
+ * @param entry       entry handle of RPC entry (from RpcAnswer)
+ * @param call        RPC call handle (from RpcAnswer)
+ * @param result      result raw data that will be provided to remote caller
+ */
+void PostRpcResponse(NT_Entry entry, NT_RpcCall call, StringRef result);
+
+/**
+ * Call a RPC function.  May be used on either the client or server.
+ * This function is non-blocking.  Either GetRpcResult() or
+ * CancelRpcResult() must be called to either get or ignore the result of
+ * the call.
+ * @param entry       entry handle of RPC entry
+ * @param params      parameter
+ * @return RPC call handle (for use with GetRpcResult() or
+ *         CancelRpcResult()).
+ */
+NT_RpcCall CallRpc(NT_Entry entry, StringRef params);
+
+/**
+ * Get the result (return value) of a RPC call.  This function blocks until
+ * the result is received.
+ * @param entry       entry handle of RPC entry
+ * @param call        RPC call handle returned by CallRpc()
+ * @param result      received result (output)
+ * @return False on error, true otherwise.
+ */
+bool GetRpcResult(NT_Entry entry, NT_RpcCall call, std::string* result);
+
+/**
+ * Get the result (return value) of a RPC call.  This function blocks until
+ * the result is received or it times out.
+ * @param entry       entry handle of RPC entry
+ * @param call        RPC call handle returned by CallRpc()
+ * @param result      received result (output)
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return False on error or timeout, true otherwise.
+ */
+bool GetRpcResult(NT_Entry entry, NT_RpcCall call, std::string* result,
+                  double timeout, bool* timed_out);
+
+/**
+ * Ignore the result of a RPC call.  This function is non-blocking.
+ * @param entry       entry handle of RPC entry
+ * @param call        RPC call handle returned by CallRpc()
+ */
+void CancelRpcResult(NT_Entry entry, NT_RpcCall call);
+
+/**
+ * Pack a RPC version 1 definition.
+ * @param def         RPC version 1 definition
+ * @return Raw packed bytes.
+ */
+std::string PackRpcDefinition(const RpcDefinition& def);
+
+/**
+ * Unpack a RPC version 1 definition.  This can be used for introspection or
+ * validation.
+ * @param packed      raw packed bytes
+ * @param def         RPC version 1 definition (output)
+ * @return True if successfully unpacked, false otherwise.
+ */
+bool UnpackRpcDefinition(StringRef packed, RpcDefinition* def);
+
+/**
+ * Pack RPC values as required for RPC version 1 definition messages.
+ * @param values      array of values to pack
+ * @return Raw packed bytes.
+ */
+std::string PackRpcValues(ArrayRef<std::shared_ptr<Value>> values);
+
+/**
+ * Unpack RPC values as required for RPC version 1 definition messages.
+ * @param packed      raw packed bytes
+ * @param types       array of data types (as provided in the RPC definition)
+ * @return Array of values.
+ */
+std::vector<std::shared_ptr<Value>> UnpackRpcValues(StringRef packed,
+                                                    ArrayRef<NT_Type> types);
+
+/** @} */
+
+/**
+ * @defgroup NetworkFunctions Client/Server Functions
+ * @{
+ */
+
+/**
+ * Set the network identity of this node.
+ * This is the name used during the initial connection handshake, and is
+ * visible through ConnectionInfo on the remote node.
+ * @param name      identity to advertise
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void SetNetworkIdentity(StringRef name);
+
+/**
+ * @copydoc SetNetworkIdentity(StringRef)
+ * @param inst      instance handle
+ */
+void SetNetworkIdentity(NT_Inst inst, const Twine& name);
+
+/**
+ * Get the current network mode.
+ * @return Bitmask of NT_NetworkMode.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+unsigned int GetNetworkMode();
+
+/**
+ * Get the current network mode.
+ * @param inst  instance handle
+ * @return Bitmask of NT_NetworkMode.
+ */
+unsigned int GetNetworkMode(NT_Inst inst);
+
+/**
+ * Starts a server using the specified filename, listening address, and port.
+ *
+ * @param persist_filename  the name of the persist file to use (UTF-8 string,
+ *                          null terminated)
+ * @param listen_address    the address to listen on, or null to listen on any
+ *                          address. (UTF-8 string, null terminated)
+ * @param port              port to communicate over.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StartServer(StringRef persist_filename, const char* listen_address,
+                 unsigned int port);
+
+/**
+ * @copydoc StartServer(StringRef, const char*, unsigned int)
+ * @param inst              instance handle
+ */
+void StartServer(NT_Inst inst, const Twine& persist_filename,
+                 const char* listen_address, unsigned int port);
+
+/**
+ * Stops the server if it is running.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StopServer();
+
+/**
+ * @copydoc StopServer()
+ * @param inst  instance handle
+ */
+void StopServer(NT_Inst inst);
+
+/**
+ * Starts a client.  Use SetServer to set the server name and port.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StartClient();
+
+/**
+ * Starts a client using the specified server and port
+ *
+ * @param server_name server name (UTF-8 string, null terminated)
+ * @param port        port to communicate over
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StartClient(const char* server_name, unsigned int port);
+
+/**
+ * Starts a client using the specified (server, port) combinations.  The
+ * client will attempt to connect to each server in round robin fashion.
+ *
+ * @param servers   array of server name and port pairs
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StartClient(ArrayRef<std::pair<StringRef, unsigned int>> servers);
+
+/**
+ * @copydoc StartClient()
+ * @param inst  instance handle
+ */
+void StartClient(NT_Inst inst);
+
+/**
+ * @copydoc StartClient(const char*, unsigned int)
+ * @param inst        instance handle
+ */
+void StartClient(NT_Inst inst, const char* server_name, unsigned int port);
+
+/**
+ * @copydoc StartClient(ArrayRef<std::pair<StringRef, unsigned int>>)
+ * @param inst      instance handle
+ */
+void StartClient(NT_Inst inst,
+                 ArrayRef<std::pair<StringRef, unsigned int>> servers);
+
+/**
+ * Starts a client using commonly known robot addresses for the specified
+ * team.
+ *
+ * @param inst        instance handle
+ * @param team        team number
+ * @param port        port to communicate over
+ */
+void StartClientTeam(NT_Inst inst, unsigned int team, unsigned int port);
+
+/**
+ * Stops the client if it is running.
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StopClient();
+
+/**
+ * @copydoc StopClient()
+ * @param inst  instance handle
+ */
+void StopClient(NT_Inst inst);
+
+/**
+ * Sets server address and port for client (without restarting client).
+ *
+ * @param server_name server name (UTF-8 string, null terminated)
+ * @param port        port to communicate over
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void SetServer(const char* server_name, unsigned int port);
+
+/**
+ * Sets server addresses for client (without restarting client).
+ * The client will attempt to connect to each server in round robin fashion.
+ *
+ * @param servers   array of server name and port pairs
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void SetServer(ArrayRef<std::pair<StringRef, unsigned int>> servers);
+
+/**
+ * @copydoc SetServer(const char*, unsigned int)
+ * @param inst        instance handle
+ */
+void SetServer(NT_Inst inst, const char* server_name, unsigned int port);
+
+/**
+ * @copydoc SetServer(ArrayRef<std::pair<StringRef, unsigned int>>)
+ * @param inst      instance handle
+ */
+void SetServer(NT_Inst inst,
+               ArrayRef<std::pair<StringRef, unsigned int>> servers);
+
+/**
+ * Sets server addresses and port for client (without restarting client).
+ * Connects using commonly known robot addresses for the specified team.
+ *
+ * @param inst        instance handle
+ * @param team        team number
+ * @param port        port to communicate over
+ */
+void SetServerTeam(NT_Inst inst, unsigned int team, unsigned int port);
+
+/**
+ * Starts requesting server address from Driver Station.
+ * This connects to the Driver Station running on localhost to obtain the
+ * server IP address.
+ *
+ * @param port server port to use in combination with IP from DS
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StartDSClient(unsigned int port);
+
+/**
+ * @copydoc StartDSClient(unsigned int)
+ * @param inst  instance handle
+ */
+void StartDSClient(NT_Inst inst, unsigned int port);
+
+/** Stops requesting server address from Driver Station. */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StopDSClient();
+
+/**
+ * @copydoc StopDSClient()
+ * @param inst  instance handle
+ */
+void StopDSClient(NT_Inst inst);
+
+/** Stops the RPC server if it is running. */
+WPI_DEPRECATED("use NT_Inst function instead")
+void StopRpcServer();
+
+/**
+ * Set the periodic update rate.
+ * Sets how frequently updates are sent to other nodes over the network.
+ *
+ * @param interval  update interval in seconds (range 0.01 to 1.0)
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void SetUpdateRate(double interval);
+
+/**
+ * @copydoc SetUpdateRate(double)
+ * @param inst      instance handle
+ */
+void SetUpdateRate(NT_Inst inst, double interval);
+
+/**
+ * Flush Entries.
+ * Forces an immediate flush of all local entry changes to network.
+ * Normally this is done on a regularly scheduled interval (see
+ * SetUpdateRate()).
+ *
+ * Note: flushes are rate limited to avoid excessive network traffic.  If
+ * the time between calls is too short, the flush will occur after the minimum
+ * time elapses (rather than immediately).
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void Flush();
+
+/**
+ * @copydoc Flush()
+ *
+ * @param inst      instance handle
+ */
+void Flush(NT_Inst inst);
+
+/**
+ * Get information on the currently established network connections.
+ * If operating as a client, this will return either zero or one values.
+ *
+ * @return      array of connection information
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+std::vector<ConnectionInfo> GetConnections();
+
+/**
+ * @copydoc GetConnections()
+ * @param inst  instance handle
+ */
+std::vector<ConnectionInfo> GetConnections(NT_Inst inst);
+
+/**
+ * Return whether or not the instance is connected to another node.
+ * @param inst  instance handle
+ * @return True if connected.
+ */
+bool IsConnected(NT_Inst inst);
+
+/** @} */
+
+/**
+ * @defgroup FileFunctions File Save/Load Functions
+ * @{
+ */
+
+/**
+ * Save persistent values to a file.  The server automatically does this,
+ * but this function provides a way to save persistent values in the same
+ * format to a file on either a client or a server.
+ * @param filename  filename
+ * @return error string, or nullptr if successful
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+const char* SavePersistent(StringRef filename);
+
+/**
+ * @copydoc SavePersistent(StringRef)
+ * @param inst      instance handle
+ */
+const char* SavePersistent(NT_Inst inst, const Twine& filename);
+
+/**
+ * Load persistent values from a file.  The server automatically does this
+ * at startup, but this function provides a way to restore persistent values
+ * in the same format from a file at any time on either a client or a server.
+ * @param filename  filename
+ * @param warn      callback function for warnings
+ * @return error string, or nullptr if successful
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+const char* LoadPersistent(
+    StringRef filename, std::function<void(size_t line, const char* msg)> warn);
+
+/**
+ * @copydoc LoadPersistent(StringRef, std::function<void(size_t, const
+ * char*)>)
+ * @param inst      instance handle
+ */
+const char* LoadPersistent(
+    NT_Inst inst, const Twine& filename,
+    std::function<void(size_t line, const char* msg)> warn);
+
+/**
+ * Save table values to a file.  The file format used is identical to
+ * that used for SavePersistent.
+ * @param inst      instance handle
+ * @param filename  filename
+ * @param prefix    save only keys starting with this prefix
+ * @return error string, or nullptr if successful
+ */
+const char* SaveEntries(NT_Inst inst, const Twine& filename,
+                        const Twine& prefix);
+
+/**
+ * Load table values from a file.  The file format used is identical to
+ * that used for SavePersistent / LoadPersistent.
+ * @param inst      instance handle
+ * @param filename  filename
+ * @param prefix    load only keys starting with this prefix
+ * @param warn      callback function for warnings
+ * @return error string, or nullptr if successful
+ */
+const char* LoadEntries(NT_Inst inst, const Twine& filename,
+                        const Twine& prefix,
+                        std::function<void(size_t line, const char* msg)> warn);
+
+/** @} */
+
+/**
+ * @defgroup UtilityFunctions Utility Functions
+ * @{
+ */
+
+/**
+ * Returns monotonic current time in 1 us increments.
+ * This is the same time base used for entry and connection timestamps.
+ * This function is a compatibility wrapper around wpi::Now().
+ * @return Timestamp
+ */
+uint64_t Now();
+
+/** @} */
+
+/**
+ * @defgroup LoggerFunctions Logger Functions
+ * @{
+ */
+
+/**
+ * Log function.
+ * @param level   log level of the message (see NT_LogLevel)
+ * @param file    origin source filename
+ * @param line    origin source line number
+ * @param msg     message
+ */
+typedef std::function<void(unsigned int level, const char* file,
+                           unsigned int line, const char* msg)>
+    LogFunc;
+
+/**
+ * Set logger callback function.  By default, log messages are sent to stderr;
+ * this function changes the log level and sends log messages to the provided
+ * callback function instead.  The callback function will only be called for
+ * log messages with level greater than or equal to min_level; messages lower
+ * than this level will be silently ignored.
+ *
+ * @param func        log callback function
+ * @param min_level   minimum log level
+ */
+WPI_DEPRECATED("use NT_Inst function instead")
+void SetLogger(LogFunc func, unsigned int min_level);
+
+/**
+ * Add logger callback function.  By default, log messages are sent to stderr;
+ * this function sends log messages to the provided callback function instead.
+ * The callback function will only be called for log messages with level
+ * greater than or equal to min_level and less than or equal to max_level;
+ * messages outside this range will be silently ignored.
+ *
+ * @param inst        instance handle
+ * @param func        log callback function
+ * @param min_level   minimum log level
+ * @param max_level   maximum log level
+ * @return Logger handle
+ */
+NT_Logger AddLogger(NT_Inst inst,
+                    std::function<void(const LogMessage& msg)> func,
+                    unsigned int min_level, unsigned int max_level);
+
+/**
+ * Create a log poller.  A poller provides a single queue of poll events.
+ * The returned handle must be destroyed with DestroyLoggerPoller().
+ * @param inst      instance handle
+ * @return poller handle
+ */
+NT_LoggerPoller CreateLoggerPoller(NT_Inst inst);
+
+/**
+ * Destroy a log poller.  This will abort any blocked polling call and prevent
+ * additional events from being generated for this poller.
+ * @param poller    poller handle
+ */
+void DestroyLoggerPoller(NT_LoggerPoller poller);
+
+/**
+ * Set the log level for a log poller.  Events will only be generated for
+ * log messages with level greater than or equal to min_level and less than or
+ * equal to max_level; messages outside this range will be silently ignored.
+ * @param poller        poller handle
+ * @param min_level     minimum log level
+ * @param max_level     maximum log level
+ * @return Logger handle
+ */
+NT_Logger AddPolledLogger(NT_LoggerPoller poller, unsigned int min_level,
+                          unsigned int max_level);
+
+/**
+ * Get the next log event.  This blocks until the next log occurs.
+ * @param poller    poller handle
+ * @return Information on the log events.  Only returns empty if an error
+ *         occurred (e.g. the instance was invalid or is shutting down).
+ */
+std::vector<LogMessage> PollLogger(NT_LoggerPoller poller);
+
+/**
+ * Get the next log event.  This blocks until the next log occurs or it times
+ * out.
+ * @param poller      poller handle
+ * @param timeout     timeout, in seconds
+ * @param timed_out   true if the timeout period elapsed (output)
+ * @return Information on the log events.  If empty is returned and timed_out
+ *         is also false, an error occurred (e.g. the instance was invalid or
+ *         is shutting down).
+ */
+std::vector<LogMessage> PollLogger(NT_LoggerPoller poller, double timeout,
+                                   bool* timed_out);
+
+/**
+ * Cancel a PollLogger call.  This wakes up a call to PollLogger for this
+ * poller and causes it to immediately return an empty array.
+ * @param poller  poller handle
+ */
+void CancelPollLogger(NT_LoggerPoller poller);
+
+/**
+ * Remove a logger.
+ * @param logger Logger handle to remove
+ */
+void RemoveLogger(NT_Logger logger);
+
+/**
+ * Wait for the incoming log event queue to be empty.  This is primarily useful
+ * for deterministic testing.  This blocks until either the log event
+ * queue is empty (e.g. there are no more events that need to be passed along
+ * to callbacks or poll queues) or the timeout expires.
+ * @param inst      instance handle
+ * @param timeout   timeout, in seconds.  Set to 0 for non-blocking behavior,
+ *                  or a negative value to block indefinitely
+ * @return False if timed out, otherwise true.
+ */
+bool WaitForLoggerQueue(NT_Inst inst, double timeout);
+
+/** @} */
+
+inline void RpcAnswer::PostResponse(StringRef result) const {
+  PostRpcResponse(entry, call, result);
+}
+
+}  // namespace nt
+
+#endif  // NTCORE_NTCORE_CPP_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/ntcore_test.h b/third_party/ntcore_2018/src/main/native/include/ntcore_test.h
new file mode 100644
index 0000000..bb736a5
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/ntcore_test.h
@@ -0,0 +1,89 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2016-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_NTCORE_TEST_H_
+#define NTCORE_NTCORE_TEST_H_
+
+#include <stdint.h>
+
+#include <string>
+
+#include "ntcore.h"
+
+// Functions in this header are to be used only for testing
+
+extern "C" {
+struct NT_String* NT_GetStringForTesting(const char* string, int* struct_size);
+// No need for free as one already exists in main library
+
+struct NT_EntryInfo* NT_GetEntryInfoForTesting(const char* name,
+                                               enum NT_Type type,
+                                               unsigned int flags,
+                                               uint64_t last_change,
+                                               int* struct_size);
+
+void NT_FreeEntryInfoForTesting(struct NT_EntryInfo* info);
+
+struct NT_ConnectionInfo* NT_GetConnectionInfoForTesting(
+    const char* remote_id, const char* remote_ip, unsigned int remote_port,
+    uint64_t last_update, unsigned int protocol_version, int* struct_size);
+
+void NT_FreeConnectionInfoForTesting(struct NT_ConnectionInfo* info);
+
+struct NT_Value* NT_GetValueBooleanForTesting(uint64_t last_change, int val,
+                                              int* struct_size);
+
+struct NT_Value* NT_GetValueDoubleForTesting(uint64_t last_change, double val,
+                                             int* struct_size);
+
+struct NT_Value* NT_GetValueStringForTesting(uint64_t last_change,
+                                             const char* str, int* struct_size);
+
+struct NT_Value* NT_GetValueRawForTesting(uint64_t last_change, const char* raw,
+                                          int raw_len, int* struct_size);
+
+struct NT_Value* NT_GetValueBooleanArrayForTesting(uint64_t last_change,
+                                                   const int* arr,
+                                                   size_t array_len,
+                                                   int* struct_size);
+
+struct NT_Value* NT_GetValueDoubleArrayForTesting(uint64_t last_change,
+                                                  const double* arr,
+                                                  size_t array_len,
+                                                  int* struct_size);
+
+struct NT_Value* NT_GetValueStringArrayForTesting(uint64_t last_change,
+                                                  const struct NT_String* arr,
+                                                  size_t array_len,
+                                                  int* struct_size);
+// No need for free as one already exists in the main library
+
+struct NT_RpcParamDef* NT_GetRpcParamDefForTesting(const char* name,
+                                                   const struct NT_Value* val,
+                                                   int* struct_size);
+
+void NT_FreeRpcParamDefForTesting(struct NT_RpcParamDef* def);
+
+struct NT_RpcResultDef* NT_GetRpcResultsDefForTesting(const char* name,
+                                                      enum NT_Type type,
+                                                      int* struct_size);
+
+void NT_FreeRpcResultsDefForTesting(struct NT_RpcResultDef* def);
+
+struct NT_RpcDefinition* NT_GetRpcDefinitionForTesting(
+    unsigned int version, const char* name, size_t num_params,
+    const struct NT_RpcParamDef* params, size_t num_results,
+    const struct NT_RpcResultDef* results, int* struct_size);
+// No need for free as one already exists in the main library
+
+struct NT_RpcCallInfo* NT_GetRpcCallInfoForTesting(
+    unsigned int rpc_id, unsigned int call_uid, const char* name,
+    const char* params, size_t params_len, int* struct_size);
+// No need for free as one already exists in the main library
+}  // extern "C"
+
+#endif  // NTCORE_NTCORE_TEST_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/tables/ITable.h b/third_party/ntcore_2018/src/main/native/include/tables/ITable.h
new file mode 100644
index 0000000..f14860e
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/tables/ITable.h
@@ -0,0 +1,456 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_TABLES_ITABLE_H_
+#define NTCORE_TABLES_ITABLE_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <llvm/StringRef.h>
+#include <llvm/Twine.h>
+#include <support/deprecated.h>
+
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+class NetworkTable;
+}  // namespace nt
+
+class ITableListener;
+
+/**
+ * A table whose values can be read and written to
+ */
+class WPI_DEPRECATED("Use NetworkTable directly") ITable {
+ public:
+  /**
+   * Determines whether the given key is in this table.
+   *
+   * @param key the key to search for
+   * @return true if the table as a value assigned to the given key
+   */
+  virtual bool ContainsKey(const llvm::Twine& key) const = 0;
+
+  /**
+   * Determines whether there exists a non-empty subtable for this key
+   * in this table.
+   *
+   * @param key the key to search for
+   * @return true if there is a subtable with the key which contains at least
+   * one key/subtable of its own
+   */
+  virtual bool ContainsSubTable(const llvm::Twine& key) const = 0;
+
+  /**
+   * Gets the subtable in this table for the given name.
+   *
+   * @param key the name of the table relative to this one
+   * @return a sub table relative to this one
+   */
+  virtual std::shared_ptr<nt::NetworkTable> GetSubTable(
+      const llvm::Twine& key) const = 0;
+
+  /**
+   * @param types bitmask of types; 0 is treated as a "don't care".
+   * @return keys currently in the table
+   */
+  virtual std::vector<std::string> GetKeys(int types = 0) const = 0;
+
+  /**
+   * @return subtables currently in the table
+   */
+  virtual std::vector<std::string> GetSubTables() const = 0;
+
+  /**
+   * Makes a key's value persistent through program restarts.
+   *
+   * @param key the key to make persistent
+   */
+  virtual void SetPersistent(llvm::StringRef key) = 0;
+
+  /**
+   * Stop making a key's value persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  virtual void ClearPersistent(llvm::StringRef key) = 0;
+
+  /**
+   * Returns whether the value is persistent through program restarts.
+   * The key cannot be null.
+   *
+   * @param key the key name
+   */
+  virtual bool IsPersistent(llvm::StringRef key) const = 0;
+
+  /**
+   * Sets flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to set (bitmask)
+   */
+  virtual void SetFlags(llvm::StringRef key, unsigned int flags) = 0;
+
+  /**
+   * Clears flags on the specified key in this table. The key can
+   * not be null.
+   *
+   * @param key the key name
+   * @param flags the flags to clear (bitmask)
+   */
+  virtual void ClearFlags(llvm::StringRef key, unsigned int flags) = 0;
+
+  /**
+   * Returns the flags for the specified key.
+   *
+   * @param key the key name
+   * @return the flags, or 0 if the key is not defined
+   */
+  virtual unsigned int GetFlags(llvm::StringRef key) const = 0;
+
+  /**
+   * Deletes the specified key in this table.
+   *
+   * @param key the key name
+   */
+  virtual void Delete(const llvm::Twine& key) = 0;
+
+  /**
+   * Gets the value associated with a key as an object
+   *
+   * @param key the key of the value to look up
+   * @return the value associated with the given key, or nullptr if the key
+   * does not exist
+   */
+  virtual std::shared_ptr<nt::Value> GetValue(const llvm::Twine& key) const = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultValue(const llvm::Twine& key,
+                               std::shared_ptr<nt::Value> defaultValue) = 0;
+
+  /**
+   * Put a value in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutValue(const llvm::Twine& key,
+                        std::shared_ptr<nt::Value> value) = 0;
+
+  /**
+   * Put a number in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutNumber(llvm::StringRef key, double value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultNumber(llvm::StringRef key, double defaultValue) = 0;
+
+  /**
+   * Gets the number associated with the given name.
+   *
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  virtual double GetNumber(llvm::StringRef key, double defaultValue) const = 0;
+
+  /**
+   * Put a string in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutString(llvm::StringRef key, llvm::StringRef value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultString(llvm::StringRef key,
+                                llvm::StringRef defaultValue) = 0;
+
+  /**
+   * Gets the string associated with the given name. If the key does not
+   * exist or is of different type, it will return the default value.
+   *
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the string.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  virtual std::string GetString(llvm::StringRef key,
+                                llvm::StringRef defaultValue) const = 0;
+
+  /**
+   * Put a boolean in the table
+   *
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutBoolean(llvm::StringRef key, bool value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultBoolean(llvm::StringRef key, bool defaultValue) = 0;
+
+  /**
+   * Gets the boolean associated with the given name. If the key does not
+   * exist or is of different type, it will return the default value.
+   *
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   */
+  virtual bool GetBoolean(llvm::StringRef key, bool defaultValue) const = 0;
+
+  /**
+   * Put a boolean array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   *
+   * @note The array must be of int's rather than of bool's because
+   *       std::vector<bool> is special-cased in C++.  0 is false, any
+   *       non-zero value is true.
+   */
+  virtual bool PutBooleanArray(llvm::StringRef key,
+                               llvm::ArrayRef<int> value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultBooleanArray(llvm::StringRef key,
+                                      llvm::ArrayRef<int> defaultValue) = 0;
+
+  /**
+   * Returns the boolean array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   *
+   * @note The returned array is std::vector<int> instead of std::vector<bool>
+   *       because std::vector<bool> is special-cased in C++.  0 is false, any
+   *       non-zero value is true.
+   */
+  virtual std::vector<int> GetBooleanArray(
+      llvm::StringRef key, llvm::ArrayRef<int> defaultValue) const = 0;
+
+  /**
+   * Put a number array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutNumberArray(llvm::StringRef key,
+                              llvm::ArrayRef<double> value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultNumberArray(llvm::StringRef key,
+                                     llvm::ArrayRef<double> defaultValue) = 0;
+
+  /**
+   * Returns the number array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  virtual std::vector<double> GetNumberArray(
+      llvm::StringRef key, llvm::ArrayRef<double> defaultValue) const = 0;
+
+  /**
+   * Put a string array in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutStringArray(llvm::StringRef key,
+                              llvm::ArrayRef<std::string> value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultStringArray(
+      llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue) = 0;
+
+  /**
+   * Returns the string array the key maps to. If the key does not exist or is
+   * of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the array.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  virtual std::vector<std::string> GetStringArray(
+      llvm::StringRef key, llvm::ArrayRef<std::string> defaultValue) const = 0;
+
+  /**
+   * Put a raw value (byte array) in the table
+   * @param key the key to be assigned to
+   * @param value the value that will be assigned
+   * @return False if the table key already exists with a different type
+   */
+  virtual bool PutRaw(llvm::StringRef key, llvm::StringRef value) = 0;
+
+  /**
+   * Gets the current value in the table, setting it if it does not exist.
+   * @param key the key
+   * @param defaultValue the default value to set if key doesn't exist.
+   * @returns False if the table key exists with a different type
+   */
+  virtual bool SetDefaultRaw(llvm::StringRef key,
+                             llvm::StringRef defaultValue) = 0;
+
+  /**
+   * Returns the raw value (byte array) the key maps to. If the key does not
+   * exist or is of different type, it will return the default value.
+   * @param key the key to look up
+   * @param defaultValue the value to be returned if no value is found
+   * @return the value associated with the given key or the given default value
+   * if there is no value associated with the key
+   *
+   * @note This makes a copy of the raw contents.  If the overhead of this is a
+   *       concern, use GetValue() instead.
+   */
+  virtual std::string GetRaw(llvm::StringRef key,
+                             llvm::StringRef defaultValue) const = 0;
+
+  /**
+   * Add a listener for changes to the table
+   *
+   * @param listener the listener to add
+   */
+  virtual void AddTableListener(ITableListener* listener) = 0;
+
+  /**
+   * Add a listener for changes to the table
+   *
+   * @param listener the listener to add
+   * @param immediateNotify if true then this listener will be notified of all
+   * current entries (marked as new)
+   */
+  virtual void AddTableListener(ITableListener* listener,
+                                bool immediateNotify) = 0;
+
+  /**
+   * Add a listener for changes to the table
+   *
+   * @param listener the listener to add
+   * @param immediateNotify if true then this listener will be notified of all
+   * current entries (marked as new)
+   * @param flags bitmask of NT_NotifyKind specifying desired notifications
+   */
+  virtual void AddTableListenerEx(ITableListener* listener,
+                                  unsigned int flags) = 0;
+
+  /**
+   * Add a listener for changes to a specific key the table
+   *
+   * @param key the key to listen for
+   * @param listener the listener to add
+   * @param immediateNotify if true then this listener will be notified of all
+   * current entries (marked as new)
+   */
+  virtual void AddTableListener(llvm::StringRef key, ITableListener* listener,
+                                bool immediateNotify) = 0;
+
+  /**
+   * Add a listener for changes to a specific key the table
+   *
+   * @param key the key to listen for
+   * @param listener the listener to add
+   * @param immediateNotify if true then this listener will be notified of all
+   * current entries (marked as new)
+   * @param flags bitmask of NT_NotifyKind specifying desired notifications
+   */
+  virtual void AddTableListenerEx(llvm::StringRef key, ITableListener* listener,
+                                  unsigned int flags) = 0;
+
+  /**
+   * This will immediately notify the listener of all current sub tables
+   * @param listener the listener to add
+   */
+  virtual void AddSubTableListener(ITableListener* listener) = 0;
+
+  /**
+   * This will immediately notify the listener of all current sub tables
+   * @param listener the listener to add
+   * @param localNotify if true then this listener will be notified of all
+   * local changes in addition to all remote changes
+   */
+  virtual void AddSubTableListener(ITableListener* listener,
+                                   bool localNotify) = 0;
+
+  /**
+   * Remove a listener from receiving table events
+   *
+   * @param listener the listener to be removed
+   */
+  virtual void RemoveTableListener(ITableListener* listener) = 0;
+
+  /**
+   * Gets the full path of this table.
+   */
+  virtual llvm::StringRef GetPath() const = 0;
+};
+
+#endif  // NTCORE_TABLES_ITABLE_H_
diff --git a/third_party/ntcore_2018/src/main/native/include/tables/ITableListener.h b/third_party/ntcore_2018/src/main/native/include/tables/ITableListener.h
new file mode 100644
index 0000000..48127a6
--- /dev/null
+++ b/third_party/ntcore_2018/src/main/native/include/tables/ITableListener.h
@@ -0,0 +1,63 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_TABLES_ITABLELISTENER_H_
+#define NTCORE_TABLES_ITABLELISTENER_H_
+
+#include <memory>
+
+#include <llvm/StringRef.h>
+#include <support/deprecated.h>
+
+#include "networktables/NetworkTableValue.h"
+
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+class ITable;
+
+/**
+ * A listener that listens to changes in values in a {@link ITable}
+ */
+class WPI_DEPRECATED(
+    "Use EntryListener, TableEntryListener, or TableListener as appropriate")
+    ITableListener {
+ public:
+  virtual ~ITableListener() = default;
+  /**
+   * Called when a key-value pair is changed in a {@link ITable}
+   * @param source the table the key-value pair exists in
+   * @param key the key associated with the value that changed
+   * @param value the new value
+   * @param isNew true if the key did not previously exist in the table,
+   * otherwise it is false
+   */
+  virtual void ValueChanged(ITable* source, llvm::StringRef key,
+                            std::shared_ptr<nt::Value> value, bool isNew) = 0;
+
+  /**
+   * Extended version of ValueChanged.  Called when a key-value pair is
+   * changed in a {@link ITable}.  The default implementation simply calls
+   * ValueChanged().  If this is overridden, ValueChanged() will not be called.
+   * @param source the table the key-value pair exists in
+   * @param key the key associated with the value that changed
+   * @param value the new value
+   * @param flags update flags; for example, NT_NOTIFY_NEW if the key did not
+   * previously exist in the table
+   */
+  virtual void ValueChangedEx(ITable* source, llvm::StringRef key,
+                              std::shared_ptr<nt::Value> value,
+                              unsigned int flags);
+};
+
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+
+#endif  // NTCORE_TABLES_ITABLELISTENER_H_
diff --git a/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/ConnectionListenerTest.java b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/ConnectionListenerTest.java
new file mode 100644
index 0000000..98012e6
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/ConnectionListenerTest.java
@@ -0,0 +1,136 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.ArrayList;
+import java.util.List;
+import junit.framework.TestCase;
+
+public class ConnectionListenerTest extends TestCase {
+  NetworkTableInstance serverInst;
+  NetworkTableInstance clientInst;
+
+  @Override
+  protected void setUp() throws Exception {
+    serverInst = NetworkTableInstance.create();
+    serverInst.setNetworkIdentity("server");
+
+    clientInst = NetworkTableInstance.create();
+    clientInst.setNetworkIdentity("client");
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    clientInst.free();
+    serverInst.free();
+  }
+
+  private void connect() {
+    serverInst.startServer("connectionlistenertest.ini", "127.0.0.1", 10000);
+    clientInst.startClient("127.0.0.1", 10000);
+
+    // wait for client to report it's started, then wait another 0.1 sec
+    try {
+      while ((clientInst.getNetworkMode() & NetworkTableInstance.kNetModeStarting) != 0) {
+        Thread.sleep(100);
+      }
+      Thread.sleep(100);
+    } catch (InterruptedException ex) {
+      fail("interrupted while waiting for client to start");
+    }
+  }
+
+  public void testJNI() {
+    // set up the poller
+    int poller = NetworkTablesJNI.createConnectionListenerPoller(serverInst.getHandle());
+    assertTrue("bad poller handle", poller != 0);
+    int handle = NetworkTablesJNI.addPolledConnectionListener(poller, false);
+    assertTrue("bad listener handle", handle != 0);
+
+    // trigger a connect event
+    connect();
+
+    // get the event
+    assertTrue(serverInst.waitForConnectionListenerQueue(1.0));
+    ConnectionNotification[] events = null;
+    try {
+      events = NetworkTablesJNI.pollConnectionListenerTimeout(serverInst, poller, 0.0);
+    } catch (InterruptedException ex) {
+      Thread.currentThread().interrupt();
+      fail("unexpected interrupted exception" + ex);
+    }
+
+    assertNotNull(events);
+    assertEquals(events.length, 1);
+    assertEquals(handle, events[0].listener);
+    assertTrue(events[0].connected);
+
+    // trigger a disconnect event
+    clientInst.stopClient();
+    try {
+      Thread.sleep(100);
+    } catch (InterruptedException ex) {
+      fail("interrupted while waiting for client to stop");
+    }
+
+    // get the event
+    assertTrue(serverInst.waitForConnectionListenerQueue(1.0));
+    try {
+      events = NetworkTablesJNI.pollConnectionListenerTimeout(serverInst, poller, 0.0);
+    } catch (InterruptedException ex) {
+      Thread.currentThread().interrupt();
+      fail("unexpected interrupted exception" + ex);
+    }
+
+    assertNotNull(events);
+    assertEquals(events.length, 1);
+    assertEquals(handle, events[0].listener);
+    assertFalse(events[0].connected);
+
+  }
+
+  public void testThreaded() {
+    serverInst.startServer("connectionlistenertest.ini", "127.0.0.1", 10000);
+    List<ConnectionNotification> events = new ArrayList<>();
+    int handle = serverInst.addConnectionListener((event) -> events.add(event), false);
+
+    // trigger a connect event
+    clientInst.startClient("127.0.0.1", 10000);
+
+    // wait for client to report it's started, then wait another 0.1 sec
+    try {
+      while ((clientInst.getNetworkMode() & NetworkTableInstance.kNetModeStarting) != 0) {
+        Thread.sleep(100);
+      }
+      Thread.sleep(100);
+    } catch (InterruptedException ex) {
+      fail("interrupted while waiting for client to start");
+    }
+    assertTrue(serverInst.waitForConnectionListenerQueue(1.0));
+
+    // get the event
+    assertEquals(events.size(), 1);
+    assertEquals(handle, events.get(0).listener);
+    assertTrue(events.get(0).connected);
+    events.clear();
+
+    // trigger a disconnect event
+    clientInst.stopClient();
+    try {
+      Thread.sleep(100);
+    } catch (InterruptedException ex) {
+      fail("interrupted while waiting for client to stop");
+    }
+
+    // get the event
+    assertTrue(serverInst.waitForConnectionListenerQueue(1.0));
+    assertEquals(events.size(), 1);
+    assertEquals(handle, events.get(0).listener);
+    assertFalse(events.get(0).connected);
+  }
+}
diff --git a/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/EntryListenerTest.java b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/EntryListenerTest.java
new file mode 100644
index 0000000..72e530a
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/EntryListenerTest.java
@@ -0,0 +1,76 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.ArrayList;
+import java.util.List;
+import junit.framework.TestCase;
+
+public class EntryListenerTest extends TestCase {
+  NetworkTableInstance serverInst;
+  NetworkTableInstance clientInst;
+
+  @Override
+  protected void setUp() throws Exception {
+    serverInst = NetworkTableInstance.create();
+    serverInst.setNetworkIdentity("server");
+
+    clientInst = NetworkTableInstance.create();
+    clientInst.setNetworkIdentity("client");
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    clientInst.free();
+    serverInst.free();
+  }
+
+  private void connect() {
+    serverInst.startServer("connectionlistenertest.ini", "127.0.0.1", 10000);
+    clientInst.startClient("127.0.0.1", 10000);
+
+    // Use connection listener to ensure we've connected
+    int poller = NetworkTablesJNI.createConnectionListenerPoller(clientInst.getHandle());
+    NetworkTablesJNI.addPolledConnectionListener(poller, false);
+    try {
+      if (NetworkTablesJNI.pollConnectionListenerTimeout(clientInst, poller, 1.0).length == 0) {
+        fail("client didn't connect to server");
+      }
+    } catch (InterruptedException ex) {
+      Thread.currentThread().interrupt();
+      fail("interrupted while waiting for server connection");
+    }
+  }
+
+  public void testPrefixNewRemote() {
+    connect();
+    List<EntryNotification> events = new ArrayList<>();
+    int handle = serverInst.addEntryListener("/foo", (event) -> events.add(event),
+        EntryListenerFlags.kNew);
+
+    // Trigger an event
+    clientInst.getEntry("/foo/bar").setDouble(1.0);
+    clientInst.getEntry("/baz").setDouble(1.0);
+    clientInst.flush();
+    try {
+      Thread.sleep(100);
+    } catch (InterruptedException ex) {
+      fail("interrupted while waiting for entries to update");
+    }
+
+    assertTrue(serverInst.waitForEntryListenerQueue(1.0));
+
+    // Check the event
+    assertEquals(events.size(), 1);
+    assertEquals(events.get(0).listener, handle);
+    assertEquals(events.get(0).getEntry(), serverInst.getEntry("/foo/bar"));
+    assertEquals(events.get(0).name, "/foo/bar");
+    assertEquals(events.get(0).value, NetworkTableValue.makeDouble(1.0));
+    assertEquals(events.get(0).flags, EntryListenerFlags.kNew);
+  }
+}
diff --git a/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/JNITest.java b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/JNITest.java
new file mode 100644
index 0000000..3b9339a
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/JNITest.java
@@ -0,0 +1,19 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import org.junit.Test;
+
+public class JNITest {
+  @Test
+  public void jniLinkTest() {
+    // Test to verify that the JNI test link works correctly.
+    int inst = NetworkTablesJNI.getDefaultInstance();
+    NetworkTablesJNI.flush(inst);
+  }
+}
diff --git a/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/LoggerTest.java b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/LoggerTest.java
new file mode 100644
index 0000000..3b73858
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/LoggerTest.java
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.ArrayList;
+import java.util.List;
+import junit.framework.TestCase;
+
+public class LoggerTest extends TestCase {
+  NetworkTableInstance clientInst;
+
+  @Override
+  protected void setUp() throws Exception {
+    clientInst = NetworkTableInstance.create();
+  }
+
+  @Override
+  protected void tearDown() throws Exception {
+    clientInst.free();
+  }
+
+  public void testLogger() {
+    List<LogMessage> msgs = new ArrayList<>();
+    clientInst.addLogger((msg) -> msgs.add(msg), LogMessage.kInfo, 100);
+
+    clientInst.startClient("127.0.0.1", 10000);
+
+    // wait for client to report it's started, then wait another 0.1 sec
+    try {
+      while ((clientInst.getNetworkMode() & NetworkTableInstance.kNetModeStarting) != 0) {
+        Thread.sleep(100);
+      }
+      Thread.sleep(100);
+    } catch (InterruptedException ex) {
+      fail("interrupted while waiting for client to start");
+    }
+
+    assertFalse(msgs.isEmpty());
+  }
+}
diff --git a/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java
new file mode 100644
index 0000000..7c4a651
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/java/edu/wpi/first/networktables/NetworkTableTest.java
@@ -0,0 +1,73 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.networktables;
+
+import java.util.ArrayList;
+import java.util.List;
+import junit.framework.TestCase;
+
+public class NetworkTableTest extends TestCase {
+  public void testBasenameKey() {
+    assertEquals("simple", NetworkTable.basenameKey("simple"));
+    assertEquals("simple", NetworkTable.basenameKey("one/two/many/simple"));
+    assertEquals("simple",
+                 NetworkTable.basenameKey("//////an/////awful/key////simple"));
+  }
+
+  public void testNormalizeKeySlash() {
+    assertEquals("/", NetworkTable.normalizeKey("///"));
+    assertEquals("/no/normal/req", NetworkTable.normalizeKey("/no/normal/req"));
+    assertEquals("/no/leading/slash",
+                 NetworkTable.normalizeKey("no/leading/slash"));
+    assertEquals(
+        "/what/an/awful/key/",
+        NetworkTable.normalizeKey("//////what////an/awful/////key///"));
+  }
+
+  public void testNormalizeKeyNoSlash() {
+    assertEquals("a", NetworkTable.normalizeKey("a", false));
+    assertEquals("a", NetworkTable.normalizeKey("///a", false));
+    assertEquals("leading/slash",
+                 NetworkTable.normalizeKey("/leading/slash", false));
+    assertEquals("no/leading/slash",
+                 NetworkTable.normalizeKey("no/leading/slash", false));
+    assertEquals(
+        "what/an/awful/key/",
+        NetworkTable.normalizeKey("//////what////an/awful/////key///", false));
+  }
+
+  public void testGetHierarchyEmpty() {
+    List<String> expected = new ArrayList<>();
+    expected.add("/");
+    assertEquals(expected, NetworkTable.getHierarchy(""));
+  }
+
+  public void testGetHierarchyRoot() {
+    List<String> expected = new ArrayList<>();
+    expected.add("/");
+    assertEquals(expected, NetworkTable.getHierarchy("/"));
+  }
+
+  public void testGetHierarchyNormal() {
+    List<String> expected = new ArrayList<>();
+    expected.add("/");
+    expected.add("/foo");
+    expected.add("/foo/bar");
+    expected.add("/foo/bar/baz");
+    assertEquals(expected, NetworkTable.getHierarchy("/foo/bar/baz"));
+  }
+
+  public void testGetHierarchyTrailingSlash() {
+    List<String> expected = new ArrayList<>();
+    expected.add("/");
+    expected.add("/foo");
+    expected.add("/foo/bar");
+    expected.add("/foo/bar/");
+    assertEquals(expected, NetworkTable.getHierarchy("/foo/bar/"));
+  }
+}
diff --git a/third_party/ntcore_2018/src/test/native/cpp/ConnectionListenerTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/ConnectionListenerTest.cpp
new file mode 100644
index 0000000..1732c74
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/ConnectionListenerTest.cpp
@@ -0,0 +1,108 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <chrono>
+#include <thread>
+
+#include "TestPrinters.h"
+#include "gtest/gtest.h"
+#include "ntcore_cpp.h"
+
+class ConnectionListenerTest : public ::testing::Test {
+ public:
+  ConnectionListenerTest()
+      : server_inst(nt::CreateInstance()), client_inst(nt::CreateInstance()) {
+    nt::SetNetworkIdentity(server_inst, "server");
+    nt::SetNetworkIdentity(client_inst, "client");
+  }
+
+  ~ConnectionListenerTest() override {
+    nt::DestroyInstance(server_inst);
+    nt::DestroyInstance(client_inst);
+  }
+
+  void Connect();
+
+ protected:
+  NT_Inst server_inst;
+  NT_Inst client_inst;
+};
+
+void ConnectionListenerTest::Connect() {
+  nt::StartServer(server_inst, "connectionlistenertest.ini", "127.0.0.1",
+                  10000);
+  nt::StartClient(client_inst, "127.0.0.1", 10000);
+
+  // wait for client to report it's started, then wait another 0.1 sec
+  while ((nt::GetNetworkMode(client_inst) & NT_NET_MODE_STARTING) != 0)
+    std::this_thread::sleep_for(std::chrono::milliseconds(100));
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
+}
+
+TEST_F(ConnectionListenerTest, Polled) {
+  // set up the poller
+  NT_ConnectionListenerPoller poller =
+      nt::CreateConnectionListenerPoller(server_inst);
+  ASSERT_NE(poller, 0u);
+  NT_ConnectionListener handle = nt::AddPolledConnectionListener(poller, false);
+  ASSERT_NE(handle, 0u);
+
+  // trigger a connect event
+  Connect();
+
+  // get the event
+  ASSERT_TRUE(nt::WaitForConnectionListenerQueue(server_inst, 1.0));
+  bool timed_out = false;
+  auto result = nt::PollConnectionListener(poller, 0.1, &timed_out);
+  EXPECT_FALSE(timed_out);
+  ASSERT_EQ(result.size(), 1u);
+  EXPECT_EQ(handle, result[0].listener);
+  EXPECT_TRUE(result[0].connected);
+
+  // trigger a disconnect event
+  nt::StopClient(client_inst);
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+  // get the event
+  ASSERT_TRUE(nt::WaitForConnectionListenerQueue(server_inst, 1.0));
+  timed_out = false;
+  result = nt::PollConnectionListener(poller, 0.1, &timed_out);
+  EXPECT_FALSE(timed_out);
+  ASSERT_EQ(result.size(), 1u);
+  EXPECT_EQ(handle, result[0].listener);
+  EXPECT_FALSE(result[0].connected);
+
+  // trigger a disconnect event
+}
+
+TEST_F(ConnectionListenerTest, Threaded) {
+  std::vector<nt::ConnectionNotification> result;
+  auto handle = nt::AddConnectionListener(
+      server_inst,
+      [&](const nt::ConnectionNotification& event) { result.push_back(event); },
+      false);
+
+  // trigger a connect event
+  Connect();
+
+  ASSERT_TRUE(nt::WaitForConnectionListenerQueue(server_inst, 1.0));
+
+  // get the event
+  ASSERT_EQ(result.size(), 1u);
+  EXPECT_EQ(handle, result[0].listener);
+  EXPECT_TRUE(result[0].connected);
+  result.clear();
+
+  // trigger a disconnect event
+  nt::StopClient(client_inst);
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+  // get the event
+  ASSERT_EQ(result.size(), 1u);
+  EXPECT_EQ(handle, result[0].listener);
+  EXPECT_FALSE(result[0].connected);
+}
diff --git a/third_party/ntcore_2018/src/test/native/cpp/EntryListenerTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/EntryListenerTest.cpp
new file mode 100644
index 0000000..38b5aea
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/EntryListenerTest.cpp
@@ -0,0 +1,164 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <chrono>
+#include <thread>
+
+#include "TestPrinters.h"
+#include "ValueMatcher.h"
+#include "gtest/gtest.h"
+#include "ntcore_cpp.h"
+
+class EntryListenerTest : public ::testing::Test {
+ public:
+  EntryListenerTest()
+      : server_inst(nt::CreateInstance()), client_inst(nt::CreateInstance()) {
+    nt::SetNetworkIdentity(server_inst, "server");
+    nt::SetNetworkIdentity(client_inst, "client");
+#if 0
+    nt::AddLogger(server_inst,
+                  [](const nt::LogMessage& msg) {
+                    std::fprintf(stderr, "SERVER: %s\n", msg.message.c_str());
+                  },
+                  0, UINT_MAX);
+    nt::AddLogger(client_inst,
+                  [](const nt::LogMessage& msg) {
+                    std::fprintf(stderr, "CLIENT: %s\n", msg.message.c_str());
+                  },
+                  0, UINT_MAX);
+#endif
+  }
+
+  ~EntryListenerTest() override {
+    nt::DestroyInstance(server_inst);
+    nt::DestroyInstance(client_inst);
+  }
+
+  void Connect();
+
+ protected:
+  NT_Inst server_inst;
+  NT_Inst client_inst;
+};
+
+void EntryListenerTest::Connect() {
+  nt::StartServer(server_inst, "entrylistenertest.ini", "127.0.0.1", 10000);
+  nt::StartClient(client_inst, "127.0.0.1", 10000);
+
+  // Use connection listener to ensure we've connected
+  NT_ConnectionListenerPoller poller =
+      nt::CreateConnectionListenerPoller(server_inst);
+  nt::AddPolledConnectionListener(poller, false);
+  bool timed_out = false;
+  if (nt::PollConnectionListener(poller, 1.0, &timed_out).empty()) {
+    FAIL() << "client didn't connect to server";
+  }
+}
+
+TEST_F(EntryListenerTest, EntryNewLocal) {
+  std::vector<nt::EntryNotification> events;
+  auto handle = nt::AddEntryListener(
+      nt::GetEntry(server_inst, "/foo"),
+      [&](const nt::EntryNotification& event) { events.push_back(event); },
+      NT_NOTIFY_NEW | NT_NOTIFY_LOCAL);
+
+  // Trigger an event
+  nt::SetEntryValue(nt::GetEntry(server_inst, "/foo/bar"),
+                    nt::Value::MakeDouble(2.0));
+  nt::SetEntryValue(nt::GetEntry(server_inst, "/foo"),
+                    nt::Value::MakeDouble(1.0));
+
+  ASSERT_TRUE(nt::WaitForEntryListenerQueue(server_inst, 1.0));
+
+  // Check the event
+  ASSERT_EQ(events.size(), 1u);
+  ASSERT_EQ(events[0].listener, handle);
+  ASSERT_EQ(events[0].entry, nt::GetEntry(server_inst, "/foo"));
+  ASSERT_EQ(events[0].name, "/foo");
+  ASSERT_THAT(events[0].value, nt::ValueEq(nt::Value::MakeDouble(1.0)));
+  ASSERT_EQ(events[0].flags, (unsigned int)(NT_NOTIFY_NEW | NT_NOTIFY_LOCAL));
+}
+
+TEST_F(EntryListenerTest, EntryNewRemote) {
+  Connect();
+  if (HasFatalFailure()) return;
+  std::vector<nt::EntryNotification> events;
+  auto handle = nt::AddEntryListener(
+      nt::GetEntry(server_inst, "/foo"),
+      [&](const nt::EntryNotification& event) { events.push_back(event); },
+      NT_NOTIFY_NEW);
+
+  // Trigger an event
+  nt::SetEntryValue(nt::GetEntry(client_inst, "/foo/bar"),
+                    nt::Value::MakeDouble(2.0));
+  nt::SetEntryValue(nt::GetEntry(client_inst, "/foo"),
+                    nt::Value::MakeDouble(1.0));
+  nt::Flush(client_inst);
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+  ASSERT_TRUE(nt::WaitForEntryListenerQueue(server_inst, 1.0));
+
+  // Check the event
+  ASSERT_EQ(events.size(), 1u);
+  ASSERT_EQ(events[0].listener, handle);
+  ASSERT_EQ(events[0].entry, nt::GetEntry(server_inst, "/foo"));
+  ASSERT_EQ(events[0].name, "/foo");
+  ASSERT_THAT(events[0].value, nt::ValueEq(nt::Value::MakeDouble(1.0)));
+  ASSERT_EQ(events[0].flags, NT_NOTIFY_NEW);
+}
+
+TEST_F(EntryListenerTest, PrefixNewLocal) {
+  std::vector<nt::EntryNotification> events;
+  auto handle = nt::AddEntryListener(
+      server_inst, "/foo",
+      [&](const nt::EntryNotification& event) { events.push_back(event); },
+      NT_NOTIFY_NEW | NT_NOTIFY_LOCAL);
+
+  // Trigger an event
+  nt::SetEntryValue(nt::GetEntry(server_inst, "/foo/bar"),
+                    nt::Value::MakeDouble(1.0));
+  nt::SetEntryValue(nt::GetEntry(server_inst, "/baz"),
+                    nt::Value::MakeDouble(1.0));
+
+  ASSERT_TRUE(nt::WaitForEntryListenerQueue(server_inst, 1.0));
+
+  // Check the event
+  ASSERT_EQ(events.size(), 1u);
+  ASSERT_EQ(events[0].listener, handle);
+  ASSERT_EQ(events[0].entry, nt::GetEntry(server_inst, "/foo/bar"));
+  ASSERT_EQ(events[0].name, "/foo/bar");
+  ASSERT_THAT(events[0].value, nt::ValueEq(nt::Value::MakeDouble(1.0)));
+  ASSERT_EQ(events[0].flags, (unsigned int)(NT_NOTIFY_NEW | NT_NOTIFY_LOCAL));
+}
+
+TEST_F(EntryListenerTest, PrefixNewRemote) {
+  Connect();
+  if (HasFatalFailure()) return;
+  std::vector<nt::EntryNotification> events;
+  auto handle = nt::AddEntryListener(
+      server_inst, "/foo",
+      [&](const nt::EntryNotification& event) { events.push_back(event); },
+      NT_NOTIFY_NEW);
+
+  // Trigger an event
+  nt::SetEntryValue(nt::GetEntry(client_inst, "/foo/bar"),
+                    nt::Value::MakeDouble(1.0));
+  nt::SetEntryValue(nt::GetEntry(client_inst, "/baz"),
+                    nt::Value::MakeDouble(1.0));
+  nt::Flush(client_inst);
+  std::this_thread::sleep_for(std::chrono::milliseconds(100));
+
+  ASSERT_TRUE(nt::WaitForEntryListenerQueue(server_inst, 1.0));
+
+  // Check the event
+  ASSERT_EQ(events.size(), 1u);
+  ASSERT_EQ(events[0].listener, handle);
+  ASSERT_EQ(events[0].entry, nt::GetEntry(server_inst, "/foo/bar"));
+  ASSERT_EQ(events[0].name, "/foo/bar");
+  ASSERT_THAT(events[0].value, nt::ValueEq(nt::Value::MakeDouble(1.0)));
+  ASSERT_EQ(events[0].flags, NT_NOTIFY_NEW);
+}
diff --git a/third_party/ntcore_2018/src/test/native/cpp/EntryNotifierTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/EntryNotifierTest.cpp
new file mode 100644
index 0000000..7982c28
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/EntryNotifierTest.cpp
@@ -0,0 +1,314 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <support/Logger.h>
+
+#include "EntryNotifier.h"
+#include "TestPrinters.h"
+#include "ValueMatcher.h"
+#include "gtest/gtest.h"
+
+using ::testing::AnyNumber;
+using ::testing::IsNull;
+using ::testing::Return;
+using ::testing::_;
+
+namespace nt {
+
+class EntryNotifierTest : public ::testing::Test {
+ public:
+  EntryNotifierTest() : notifier(1, logger) { notifier.Start(); }
+
+  void GenerateNotifications();
+
+ protected:
+  wpi::Logger logger;
+  EntryNotifier notifier;
+};
+
+void EntryNotifierTest::GenerateNotifications() {
+  // All flags combos that can be generated by Storage
+  static const unsigned int flags[] = {
+      // "normal" notifications
+      NT_NOTIFY_NEW, NT_NOTIFY_DELETE, NT_NOTIFY_UPDATE, NT_NOTIFY_FLAGS,
+      NT_NOTIFY_UPDATE | NT_NOTIFY_FLAGS,
+      // immediate notifications are always "new"
+      NT_NOTIFY_IMMEDIATE | NT_NOTIFY_NEW,
+      // local notifications can be of any flag combo
+      NT_NOTIFY_LOCAL | NT_NOTIFY_NEW, NT_NOTIFY_LOCAL | NT_NOTIFY_DELETE,
+      NT_NOTIFY_LOCAL | NT_NOTIFY_UPDATE, NT_NOTIFY_LOCAL | NT_NOTIFY_FLAGS,
+      NT_NOTIFY_LOCAL | NT_NOTIFY_UPDATE | NT_NOTIFY_FLAGS};
+  // Generate across keys
+  static const char* keys[] = {"/foo/bar", "/baz", "/boo"};
+
+  auto val = Value::MakeDouble(1);
+
+  // Provide unique key indexes for each key
+  unsigned int keyindex = 5;
+  for (auto key : keys) {
+    for (auto flag : flags) {
+      notifier.NotifyEntry(keyindex, key, val, flag);
+    }
+    ++keyindex;
+  }
+}
+
+TEST_F(EntryNotifierTest, PollEntryMultiple) {
+  auto poller1 = notifier.CreatePoller();
+  auto poller2 = notifier.CreatePoller();
+  auto poller3 = notifier.CreatePoller();
+  auto h1 = notifier.AddPolled(poller1, 6, NT_NOTIFY_NEW);
+  auto h2 = notifier.AddPolled(poller2, 6, NT_NOTIFY_NEW);
+  auto h3 = notifier.AddPolled(poller3, 6, NT_NOTIFY_UPDATE);
+
+  ASSERT_FALSE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results1 = notifier.Poll(poller1, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  auto results2 = notifier.Poll(poller2, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  auto results3 = notifier.Poll(poller3, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+
+  ASSERT_EQ(results1.size(), 2u);
+  for (const auto& result : results1) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(Handle{result.listener}.GetIndex(), (int)h1);
+  }
+
+  ASSERT_EQ(results2.size(), 2u);
+  for (const auto& result : results2) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(Handle{result.listener}.GetIndex(), (int)h2);
+  }
+
+  ASSERT_EQ(results3.size(), 2u);
+  for (const auto& result : results3) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(Handle{result.listener}.GetIndex(), (int)h3);
+  }
+}
+
+TEST_F(EntryNotifierTest, PollEntryBasic) {
+  auto poller = notifier.CreatePoller();
+  auto g1 = notifier.AddPolled(poller, 6, NT_NOTIFY_NEW);
+  auto g2 = notifier.AddPolled(poller, 6, NT_NOTIFY_DELETE);
+  auto g3 = notifier.AddPolled(poller, 6, NT_NOTIFY_UPDATE);
+  auto g4 = notifier.AddPolled(poller, 6, NT_NOTIFY_FLAGS);
+
+  ASSERT_FALSE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results = notifier.Poll(poller, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+
+  int g1count = 0;
+  int g2count = 0;
+  int g3count = 0;
+  int g4count = 0;
+  for (const auto& result : results) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(result.name, "/baz");
+    EXPECT_THAT(result.value, ValueEq(Value::MakeDouble(1)));
+    EXPECT_EQ(Handle{result.entry}.GetType(), Handle::kEntry);
+    EXPECT_EQ(Handle{result.entry}.GetInst(), 1);
+    EXPECT_EQ(Handle{result.entry}.GetIndex(), 6);
+    EXPECT_EQ(Handle{result.listener}.GetType(), Handle::kEntryListener);
+    EXPECT_EQ(Handle{result.listener}.GetInst(), 1);
+    if (Handle{result.listener}.GetIndex() == static_cast<int>(g1)) {
+      ++g1count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_NEW) != 0);
+    } else if (Handle{result.listener}.GetIndex() == static_cast<int>(g2)) {
+      ++g2count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_DELETE) != 0);
+    } else if (Handle{result.listener}.GetIndex() == static_cast<int>(g3)) {
+      ++g3count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_UPDATE) != 0);
+    } else if (Handle{result.listener}.GetIndex() == static_cast<int>(g4)) {
+      ++g4count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_FLAGS) != 0);
+    } else {
+      ADD_FAILURE() << "unknown listener index";
+    }
+  }
+  EXPECT_EQ(g1count, 2);
+  EXPECT_EQ(g2count, 1);  // NT_NOTIFY_DELETE
+  EXPECT_EQ(g3count, 2);
+  EXPECT_EQ(g4count, 2);
+}
+
+TEST_F(EntryNotifierTest, PollEntryImmediate) {
+  auto poller = notifier.CreatePoller();
+  notifier.AddPolled(poller, 6, NT_NOTIFY_NEW | NT_NOTIFY_IMMEDIATE);
+  notifier.AddPolled(poller, 6, NT_NOTIFY_NEW);
+
+  ASSERT_FALSE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results = notifier.Poll(poller, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  SCOPED_TRACE(::testing::PrintToString(results));
+  ASSERT_EQ(results.size(), 4u);
+}
+
+TEST_F(EntryNotifierTest, PollEntryLocal) {
+  auto poller = notifier.CreatePoller();
+  notifier.AddPolled(poller, 6, NT_NOTIFY_NEW | NT_NOTIFY_LOCAL);
+  notifier.AddPolled(poller, 6, NT_NOTIFY_NEW);
+
+  ASSERT_TRUE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results = notifier.Poll(poller, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  SCOPED_TRACE(::testing::PrintToString(results));
+  ASSERT_EQ(results.size(), 6u);
+}
+
+TEST_F(EntryNotifierTest, PollPrefixMultiple) {
+  auto poller1 = notifier.CreatePoller();
+  auto poller2 = notifier.CreatePoller();
+  auto poller3 = notifier.CreatePoller();
+  auto h1 = notifier.AddPolled(poller1, "/foo", NT_NOTIFY_NEW);
+  auto h2 = notifier.AddPolled(poller2, "/foo", NT_NOTIFY_NEW);
+  auto h3 = notifier.AddPolled(poller3, "/foo", NT_NOTIFY_UPDATE);
+
+  ASSERT_FALSE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results1 = notifier.Poll(poller1, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  auto results2 = notifier.Poll(poller2, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  auto results3 = notifier.Poll(poller3, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+
+  ASSERT_EQ(results1.size(), 2u);
+  for (const auto& result : results1) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(Handle{result.listener}.GetIndex(), (int)h1);
+  }
+
+  ASSERT_EQ(results2.size(), 2u);
+  for (const auto& result : results2) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(Handle{result.listener}.GetIndex(), (int)h2);
+  }
+
+  ASSERT_EQ(results3.size(), 2u);
+  for (const auto& result : results3) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_EQ(Handle{result.listener}.GetIndex(), (int)h3);
+  }
+}
+
+TEST_F(EntryNotifierTest, PollPrefixBasic) {
+  auto poller = notifier.CreatePoller();
+  auto g1 = notifier.AddPolled(poller, "/foo", NT_NOTIFY_NEW);
+  auto g2 = notifier.AddPolled(poller, "/foo", NT_NOTIFY_DELETE);
+  auto g3 = notifier.AddPolled(poller, "/foo", NT_NOTIFY_UPDATE);
+  auto g4 = notifier.AddPolled(poller, "/foo", NT_NOTIFY_FLAGS);
+  notifier.AddPolled(poller, "/bar", NT_NOTIFY_NEW);
+  notifier.AddPolled(poller, "/bar", NT_NOTIFY_DELETE);
+  notifier.AddPolled(poller, "/bar", NT_NOTIFY_UPDATE);
+  notifier.AddPolled(poller, "/bar", NT_NOTIFY_FLAGS);
+
+  ASSERT_FALSE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results = notifier.Poll(poller, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+
+  int g1count = 0;
+  int g2count = 0;
+  int g3count = 0;
+  int g4count = 0;
+  for (const auto& result : results) {
+    SCOPED_TRACE(::testing::PrintToString(result));
+    EXPECT_TRUE(StringRef(result.name).startswith("/foo"));
+    EXPECT_THAT(result.value, ValueEq(Value::MakeDouble(1)));
+    EXPECT_EQ(Handle{result.entry}.GetType(), Handle::kEntry);
+    EXPECT_EQ(Handle{result.entry}.GetInst(), 1);
+    EXPECT_EQ(Handle{result.entry}.GetIndex(), 5);
+    EXPECT_EQ(Handle{result.listener}.GetType(), Handle::kEntryListener);
+    EXPECT_EQ(Handle{result.listener}.GetInst(), 1);
+    if (Handle{result.listener}.GetIndex() == static_cast<int>(g1)) {
+      ++g1count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_NEW) != 0);
+    } else if (Handle{result.listener}.GetIndex() == static_cast<int>(g2)) {
+      ++g2count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_DELETE) != 0);
+    } else if (Handle{result.listener}.GetIndex() == static_cast<int>(g3)) {
+      ++g3count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_UPDATE) != 0);
+    } else if (Handle{result.listener}.GetIndex() == static_cast<int>(g4)) {
+      ++g4count;
+      EXPECT_TRUE((result.flags & NT_NOTIFY_FLAGS) != 0);
+    } else {
+      ADD_FAILURE() << "unknown listener index";
+    }
+  }
+  EXPECT_EQ(g1count, 2);
+  EXPECT_EQ(g2count, 1);  // NT_NOTIFY_DELETE
+  EXPECT_EQ(g3count, 2);
+  EXPECT_EQ(g4count, 2);
+}
+
+TEST_F(EntryNotifierTest, PollPrefixImmediate) {
+  auto poller = notifier.CreatePoller();
+  notifier.AddPolled(poller, "/foo", NT_NOTIFY_NEW | NT_NOTIFY_IMMEDIATE);
+  notifier.AddPolled(poller, "/foo", NT_NOTIFY_NEW);
+
+  ASSERT_FALSE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results = notifier.Poll(poller, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  SCOPED_TRACE(::testing::PrintToString(results));
+  ASSERT_EQ(results.size(), 4u);
+}
+
+TEST_F(EntryNotifierTest, PollPrefixLocal) {
+  auto poller = notifier.CreatePoller();
+  notifier.AddPolled(poller, "/foo", NT_NOTIFY_NEW | NT_NOTIFY_LOCAL);
+  notifier.AddPolled(poller, "/foo", NT_NOTIFY_NEW);
+
+  ASSERT_TRUE(notifier.local_notifiers());
+
+  GenerateNotifications();
+
+  ASSERT_TRUE(notifier.WaitForQueue(1.0));
+  bool timed_out = false;
+  auto results = notifier.Poll(poller, 0, &timed_out);
+  ASSERT_FALSE(timed_out);
+  SCOPED_TRACE(::testing::PrintToString(results));
+  ASSERT_EQ(results.size(), 6u);
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MessageMatcher.cpp b/third_party/ntcore_2018/src/test/native/cpp/MessageMatcher.cpp
new file mode 100644
index 0000000..de8719d
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MessageMatcher.cpp
@@ -0,0 +1,52 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "MessageMatcher.h"
+
+namespace nt {
+
+bool MessageMatcher::MatchAndExplain(
+    std::shared_ptr<Message> msg,
+    ::testing::MatchResultListener* listener) const {
+  bool match = true;
+  if (!msg) return false;
+  if (msg->str() != goodmsg->str()) {
+    *listener << "str mismatch ";
+    match = false;
+  }
+  if ((!msg->value() && goodmsg->value()) ||
+      (msg->value() && !goodmsg->value()) ||
+      (msg->value() && goodmsg->value() &&
+       *msg->value() != *goodmsg->value())) {
+    *listener << "value mismatch ";
+    match = false;
+  }
+  if (msg->id() != goodmsg->id()) {
+    *listener << "id mismatch ";
+    match = false;
+  }
+  if (msg->flags() != goodmsg->flags()) {
+    *listener << "flags mismatch";
+    match = false;
+  }
+  if (msg->seq_num_uid() != goodmsg->seq_num_uid()) {
+    *listener << "seq_num_uid mismatch";
+    match = false;
+  }
+  return match;
+}
+
+void MessageMatcher::DescribeTo(::std::ostream* os) const {
+  PrintTo(goodmsg, os);
+}
+
+void MessageMatcher::DescribeNegationTo(::std::ostream* os) const {
+  *os << "is not equal to ";
+  PrintTo(goodmsg, os);
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MessageMatcher.h b/third_party/ntcore_2018/src/test/native/cpp/MessageMatcher.h
new file mode 100644
index 0000000..d498cf0
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MessageMatcher.h
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MESSAGEMATCHER_H_
+#define NTCORE_MESSAGEMATCHER_H_
+
+#include <memory>
+#include <ostream>
+
+#include "Message.h"
+#include "TestPrinters.h"
+#include "gmock/gmock.h"
+
+namespace nt {
+
+class MessageMatcher
+    : public ::testing::MatcherInterface<std::shared_ptr<Message>> {
+ public:
+  explicit MessageMatcher(std::shared_ptr<Message> goodmsg_)
+      : goodmsg(goodmsg_) {}
+
+  bool MatchAndExplain(std::shared_ptr<Message> msg,
+                       ::testing::MatchResultListener* listener) const override;
+  void DescribeTo(::std::ostream* os) const override;
+  void DescribeNegationTo(::std::ostream* os) const override;
+
+ private:
+  std::shared_ptr<Message> goodmsg;
+};
+
+inline ::testing::Matcher<std::shared_ptr<Message>> MessageEq(
+    std::shared_ptr<Message> goodmsg) {
+  return ::testing::MakeMatcher(new MessageMatcher(goodmsg));
+}
+
+}  // namespace nt
+
+#endif  // NTCORE_MESSAGEMATCHER_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MockConnectionNotifier.h b/third_party/ntcore_2018/src/test/native/cpp/MockConnectionNotifier.h
new file mode 100644
index 0000000..12d98b8
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MockConnectionNotifier.h
@@ -0,0 +1,30 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MOCKCONNECTIONNOTIFIER_H_
+#define NTCORE_MOCKCONNECTIONNOTIFIER_H_
+
+#include "IConnectionNotifier.h"
+#include "gmock/gmock.h"
+
+namespace nt {
+
+class MockConnectionNotifier : public IConnectionNotifier {
+ public:
+  MOCK_METHOD1(
+      Add,
+      unsigned int(
+          std::function<void(const ConnectionNotification& event)> callback));
+  MOCK_METHOD1(AddPolled, unsigned int(unsigned int poller_uid));
+  MOCK_METHOD3(NotifyConnection,
+               void(bool connected, const ConnectionInfo& conn_info,
+                    unsigned int only_listener));
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_MOCKCONNECTIONNOTIFIER_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MockDispatcher.h b/third_party/ntcore_2018/src/test/native/cpp/MockDispatcher.h
new file mode 100644
index 0000000..081ed6d
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MockDispatcher.h
@@ -0,0 +1,27 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MOCKDISPATCHER_H_
+#define NTCORE_MOCKDISPATCHER_H_
+
+#include <memory>
+
+#include "IDispatcher.h"
+#include "gmock/gmock.h"
+
+namespace nt {
+
+class MockDispatcher : public IDispatcher {
+ public:
+  MOCK_METHOD3(QueueOutgoing,
+               void(std::shared_ptr<Message> msg, INetworkConnection* only,
+                    INetworkConnection* except));
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_MOCKDISPATCHER_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MockEntryNotifier.h b/third_party/ntcore_2018/src/test/native/cpp/MockEntryNotifier.h
new file mode 100644
index 0000000..3eff0f5
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MockEntryNotifier.h
@@ -0,0 +1,43 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MOCKENTRYNOTIFIER_H_
+#define NTCORE_MOCKENTRYNOTIFIER_H_
+
+#include <memory>
+
+#include "IEntryNotifier.h"
+#include "gmock/gmock.h"
+
+namespace nt {
+
+class MockEntryNotifier : public IEntryNotifier {
+ public:
+  MOCK_CONST_METHOD0(local_notifiers, bool());
+  MOCK_METHOD3(
+      Add,
+      unsigned int(std::function<void(const EntryNotification& event)> callback,
+                   llvm::StringRef prefix, unsigned int flags));
+  MOCK_METHOD3(
+      Add,
+      unsigned int(std::function<void(const EntryNotification& event)> callback,
+                   unsigned int local_id, unsigned int flags));
+  MOCK_METHOD3(AddPolled,
+               unsigned int(unsigned int poller_uid, llvm::StringRef prefix,
+                            unsigned int flags));
+  MOCK_METHOD3(AddPolled,
+               unsigned int(unsigned int poller_uid, unsigned int local_id,
+                            unsigned int flags));
+  MOCK_METHOD5(NotifyEntry,
+               void(unsigned int local_id, StringRef name,
+                    std::shared_ptr<Value> value, unsigned int flags,
+                    unsigned int only_listener));
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_MOCKENTRYNOTIFIER_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MockNetworkConnection.h b/third_party/ntcore_2018/src/test/native/cpp/MockNetworkConnection.h
new file mode 100644
index 0000000..1d697d7
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MockNetworkConnection.h
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MOCKNETWORKCONNECTION_H_
+#define NTCORE_MOCKNETWORKCONNECTION_H_
+
+#include <memory>
+
+#include "INetworkConnection.h"
+#include "gmock/gmock.h"
+
+namespace nt {
+
+class MockNetworkConnection : public INetworkConnection {
+ public:
+  MOCK_CONST_METHOD0(info, ConnectionInfo());
+
+  MOCK_METHOD1(QueueOutgoing, void(std::shared_ptr<Message> msg));
+  MOCK_METHOD1(PostOutgoing, void(bool keep_alive));
+
+  MOCK_CONST_METHOD0(proto_rev, unsigned int());
+  MOCK_METHOD1(set_proto_rev, void(unsigned int proto_rev));
+
+  MOCK_CONST_METHOD0(state, State());
+  MOCK_METHOD1(set_state, void(State state));
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_MOCKNETWORKCONNECTION_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/MockRpcServer.h b/third_party/ntcore_2018/src/test/native/cpp/MockRpcServer.h
new file mode 100644
index 0000000..1a58dfe
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/MockRpcServer.h
@@ -0,0 +1,29 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_MOCKRPCSERVER_H_
+#define NTCORE_MOCKRPCSERVER_H_
+
+#include "IRpcServer.h"
+#include "gmock/gmock.h"
+
+namespace nt {
+
+class MockRpcServer : public IRpcServer {
+ public:
+  MOCK_METHOD0(Start, void());
+  MOCK_METHOD1(RemoveRpc, void(unsigned int rpc_uid));
+  MOCK_METHOD7(ProcessRpc,
+               void(unsigned int local_id, unsigned int call_uid,
+                    StringRef name, StringRef params,
+                    const ConnectionInfo& conn, SendResponseFunc send_response,
+                    unsigned int rpc_uid));
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_MOCKRPCSERVER_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/NetworkTableTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/NetworkTableTest.cpp
new file mode 100644
index 0000000..d16a9e1
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/NetworkTableTest.cpp
@@ -0,0 +1,91 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "TestPrinters.h"
+#include "gtest/gtest.h"
+#include "networktables/NetworkTable.h"
+#include "networktables/NetworkTableInstance.h"
+
+class NetworkTableTest : public ::testing::Test {};
+
+TEST_F(NetworkTableTest, BasenameKey) {
+  EXPECT_EQ("simple", NetworkTable::BasenameKey("simple"));
+  EXPECT_EQ("simple", NetworkTable::BasenameKey("one/two/many/simple"));
+  EXPECT_EQ("simple",
+            NetworkTable::BasenameKey("//////an/////awful/key////simple"));
+}
+
+TEST_F(NetworkTableTest, NormalizeKeySlash) {
+  EXPECT_EQ("/", NetworkTable::NormalizeKey("///"));
+  EXPECT_EQ("/no/normal/req", NetworkTable::NormalizeKey("/no/normal/req"));
+  EXPECT_EQ("/no/leading/slash",
+            NetworkTable::NormalizeKey("no/leading/slash"));
+  EXPECT_EQ("/what/an/awful/key/",
+            NetworkTable::NormalizeKey("//////what////an/awful/////key///"));
+}
+
+TEST_F(NetworkTableTest, NormalizeKeyNoSlash) {
+  EXPECT_EQ("a", NetworkTable::NormalizeKey("a", false));
+  EXPECT_EQ("a", NetworkTable::NormalizeKey("///a", false));
+  EXPECT_EQ("leading/slash",
+            NetworkTable::NormalizeKey("/leading/slash", false));
+  EXPECT_EQ("no/leading/slash",
+            NetworkTable::NormalizeKey("no/leading/slash", false));
+  EXPECT_EQ(
+      "what/an/awful/key/",
+      NetworkTable::NormalizeKey("//////what////an/awful/////key///", false));
+}
+
+TEST_F(NetworkTableTest, GetHierarchyEmpty) {
+  std::vector<std::string> expected{"/"};
+  ASSERT_EQ(expected, NetworkTable::GetHierarchy(""));
+}
+
+TEST_F(NetworkTableTest, GetHierarchyRoot) {
+  std::vector<std::string> expected{"/"};
+  ASSERT_EQ(expected, NetworkTable::GetHierarchy("/"));
+}
+
+TEST_F(NetworkTableTest, GetHierarchyNormal) {
+  std::vector<std::string> expected{"/", "/foo", "/foo/bar", "/foo/bar/baz"};
+  ASSERT_EQ(expected, NetworkTable::GetHierarchy("/foo/bar/baz"));
+}
+
+TEST_F(NetworkTableTest, GetHierarchyTrailingSlash) {
+  std::vector<std::string> expected{"/", "/foo", "/foo/bar", "/foo/bar/"};
+  ASSERT_EQ(expected, NetworkTable::GetHierarchy("/foo/bar/"));
+}
+
+TEST_F(NetworkTableTest, ContainsKey) {
+  auto inst = nt::NetworkTableInstance::Create();
+  auto nt = inst.GetTable("containskey");
+  ASSERT_FALSE(nt->ContainsKey("testkey"));
+  nt->PutNumber("testkey", 5);
+  ASSERT_TRUE(nt->ContainsKey("testkey"));
+  ASSERT_TRUE(inst.GetEntry("/containskey/testkey").Exists());
+  ASSERT_FALSE(inst.GetEntry("containskey/testkey").Exists());
+}
+
+TEST_F(NetworkTableTest, LeadingSlash) {
+  auto inst = nt::NetworkTableInstance::Create();
+  auto nt = inst.GetTable("leadingslash");
+  auto nt2 = inst.GetTable("/leadingslash");
+  ASSERT_FALSE(nt->ContainsKey("testkey"));
+  nt2->PutNumber("testkey", 5);
+  ASSERT_TRUE(nt->ContainsKey("testkey"));
+  ASSERT_TRUE(inst.GetEntry("/leadingslash/testkey").Exists());
+}
+
+TEST_F(NetworkTableTest, EmptyOrNoSlash) {
+  auto inst = nt::NetworkTableInstance::Create();
+  auto nt = inst.GetTable("/");
+  auto nt2 = inst.GetTable("");
+  ASSERT_FALSE(nt->ContainsKey("testkey"));
+  nt2->PutNumber("testkey", 5);
+  ASSERT_TRUE(nt->ContainsKey("testkey"));
+  ASSERT_TRUE(inst.GetEntry("/testkey").Exists());
+}
diff --git a/third_party/ntcore_2018/src/test/native/cpp/StorageTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/StorageTest.cpp
new file mode 100644
index 0000000..c0be44b
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/StorageTest.cpp
@@ -0,0 +1,991 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "StorageTest.h"
+
+#include <llvm/raw_ostream.h>
+#include <support/raw_istream.h>
+
+#include "MessageMatcher.h"
+#include "MockNetworkConnection.h"
+#include "Storage.h"
+#include "TestPrinters.h"
+#include "ValueMatcher.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+using ::testing::AnyNumber;
+using ::testing::IsNull;
+using ::testing::Return;
+using ::testing::_;
+
+namespace nt {
+
+class StorageTestEmpty : public StorageTest,
+                         public ::testing::TestWithParam<bool> {
+ public:
+  StorageTestEmpty() {
+    HookOutgoing(GetParam());
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(true));
+  }
+};
+
+class StorageTestPopulateOne : public StorageTestEmpty {
+ public:
+  StorageTestPopulateOne() {
+    EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+    EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(false));
+    storage.SetEntryTypeValue("foo", Value::MakeBoolean(true));
+    ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+    ::testing::Mock::VerifyAndClearExpectations(&notifier);
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(true));
+  }
+};
+
+class StorageTestPopulated : public StorageTestEmpty {
+ public:
+  StorageTestPopulated() {
+    EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+    EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(false));
+    storage.SetEntryTypeValue("foo", Value::MakeBoolean(true));
+    storage.SetEntryTypeValue("foo2", Value::MakeDouble(0.0));
+    storage.SetEntryTypeValue("bar", Value::MakeDouble(1.0));
+    storage.SetEntryTypeValue("bar2", Value::MakeBoolean(false));
+    ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+    ::testing::Mock::VerifyAndClearExpectations(&notifier);
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(true));
+  }
+};
+
+class StorageTestPersistent : public StorageTestEmpty {
+ public:
+  StorageTestPersistent() {
+    EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+    EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(false));
+    storage.SetEntryTypeValue("boolean/true", Value::MakeBoolean(true));
+    storage.SetEntryTypeValue("boolean/false", Value::MakeBoolean(false));
+    storage.SetEntryTypeValue("double/neg", Value::MakeDouble(-1.5));
+    storage.SetEntryTypeValue("double/zero", Value::MakeDouble(0.0));
+    storage.SetEntryTypeValue("double/big", Value::MakeDouble(1.3e8));
+    storage.SetEntryTypeValue("string/empty", Value::MakeString(""));
+    storage.SetEntryTypeValue("string/normal", Value::MakeString("hello"));
+    storage.SetEntryTypeValue("string/special",
+                              Value::MakeString(StringRef("\0\3\5\n", 4)));
+    storage.SetEntryTypeValue("raw/empty", Value::MakeRaw(""));
+    storage.SetEntryTypeValue("raw/normal", Value::MakeRaw("hello"));
+    storage.SetEntryTypeValue("raw/special",
+                              Value::MakeRaw(StringRef("\0\3\5\n", 4)));
+    storage.SetEntryTypeValue("booleanarr/empty",
+                              Value::MakeBooleanArray(std::vector<int>{}));
+    storage.SetEntryTypeValue("booleanarr/one",
+                              Value::MakeBooleanArray(std::vector<int>{1}));
+    storage.SetEntryTypeValue("booleanarr/two",
+                              Value::MakeBooleanArray(std::vector<int>{1, 0}));
+    storage.SetEntryTypeValue("doublearr/empty",
+                              Value::MakeDoubleArray(std::vector<double>{}));
+    storage.SetEntryTypeValue("doublearr/one",
+                              Value::MakeDoubleArray(std::vector<double>{0.5}));
+    storage.SetEntryTypeValue(
+        "doublearr/two",
+        Value::MakeDoubleArray(std::vector<double>{0.5, -0.25}));
+    storage.SetEntryTypeValue(
+        "stringarr/empty", Value::MakeStringArray(std::vector<std::string>{}));
+    storage.SetEntryTypeValue(
+        "stringarr/one",
+        Value::MakeStringArray(std::vector<std::string>{"hello"}));
+    storage.SetEntryTypeValue(
+        "stringarr/two",
+        Value::MakeStringArray(std::vector<std::string>{"hello", "world\n"}));
+    storage.SetEntryTypeValue(StringRef("\0\3\5\n", 4),
+                              Value::MakeBoolean(true));
+    storage.SetEntryTypeValue("=", Value::MakeBoolean(true));
+    ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+    ::testing::Mock::VerifyAndClearExpectations(&notifier);
+    EXPECT_CALL(notifier, local_notifiers())
+        .Times(AnyNumber())
+        .WillRepeatedly(Return(true));
+  }
+};
+
+class MockLoadWarn {
+ public:
+  MOCK_METHOD2(Warn, void(size_t line, llvm::StringRef msg));
+};
+
+TEST_P(StorageTestEmpty, Construct) {
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, StorageEntryInit) {
+  auto entry = GetEntry("foo");
+  EXPECT_FALSE(entry->value);
+  EXPECT_EQ(0u, entry->flags);
+  EXPECT_EQ("foobar", entry->name);  // since GetEntry uses the tmp_entry.
+  EXPECT_EQ(0xffffu, entry->id);
+  EXPECT_EQ(SequenceNumber(), entry->seq_num);
+}
+
+TEST_P(StorageTestEmpty, GetEntryValueNotExist) {
+  EXPECT_FALSE(storage.GetEntryValue("foo"));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, GetEntryValueExist) {
+  auto value = Value::MakeBoolean(true);
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _));
+  storage.SetEntryTypeValue("foo", value);
+  EXPECT_EQ(value, storage.GetEntryValue("foo"));
+}
+
+TEST_P(StorageTestEmpty, SetEntryTypeValueAssignNew) {
+  // brand new entry
+  auto value = Value::MakeBoolean(true);
+  // id assigned if server
+  EXPECT_CALL(dispatcher,
+              QueueOutgoing(MessageEq(Message::EntryAssign(
+                                "foo", GetParam() ? 0 : 0xffff, 1, value, 0)),
+                            IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"), value,
+                                    NT_NOTIFY_NEW | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  storage.SetEntryTypeValue("foo", value);
+  EXPECT_EQ(value, GetEntry("foo")->value);
+  if (GetParam()) {
+    ASSERT_EQ(1u, idmap().size());
+    EXPECT_EQ(value, idmap()[0]->value);
+  } else {
+    EXPECT_TRUE(idmap().empty());
+  }
+}
+
+TEST_P(StorageTestPopulateOne, SetEntryTypeValueAssignTypeChange) {
+  // update with different type results in assignment message
+  auto value = Value::MakeDouble(0.0);
+
+  // id assigned if server; seq_num incremented
+  EXPECT_CALL(dispatcher,
+              QueueOutgoing(MessageEq(Message::EntryAssign(
+                                "foo", GetParam() ? 0 : 0xffff, 2, value, 0)),
+                            IsNull(), IsNull()));
+  EXPECT_CALL(notifier,
+              NotifyEntry(0, StringRef("foo"), value,
+                          NT_NOTIFY_UPDATE | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  storage.SetEntryTypeValue("foo", value);
+  EXPECT_EQ(value, GetEntry("foo")->value);
+}
+
+TEST_P(StorageTestPopulateOne, SetEntryTypeValueEqualValue) {
+  // update with same type and same value: change value contents but no update
+  // message is issued (minimizing bandwidth usage)
+  auto value = Value::MakeBoolean(true);
+  storage.SetEntryTypeValue("foo", value);
+  EXPECT_EQ(value, GetEntry("foo")->value);
+}
+
+TEST_P(StorageTestPopulated, SetEntryTypeValueDifferentValue) {
+  // update with same type and different value results in value update message
+  auto value = Value::MakeDouble(1.0);
+
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned if server; seq_num incremented
+    EXPECT_CALL(dispatcher,
+                QueueOutgoing(MessageEq(Message::EntryUpdate(1, 2, value)),
+                              IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), value,
+                          NT_NOTIFY_UPDATE | NT_NOTIFY_LOCAL, UINT_MAX));
+  storage.SetEntryTypeValue("foo2", value);
+  EXPECT_EQ(value, GetEntry("foo2")->value);
+
+  if (!GetParam()) {
+    // seq_num should still be incremented
+    EXPECT_EQ(2u, GetEntry("foo2")->seq_num.value());
+  }
+}
+
+TEST_P(StorageTestEmpty, SetEntryTypeValueEmptyName) {
+  auto value = Value::MakeBoolean(true);
+  storage.SetEntryTypeValue("", value);
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, SetEntryTypeValueEmptyValue) {
+  storage.SetEntryTypeValue("foo", nullptr);
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, SetEntryValueAssignNew) {
+  // brand new entry
+  auto value = Value::MakeBoolean(true);
+
+  // id assigned if server
+  EXPECT_CALL(dispatcher,
+              QueueOutgoing(MessageEq(Message::EntryAssign(
+                                "foo", GetParam() ? 0 : 0xffff, 1, value, 0)),
+                            IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"), value,
+                                    NT_NOTIFY_NEW | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  EXPECT_TRUE(storage.SetEntryValue("foo", value));
+  EXPECT_EQ(value, GetEntry("foo")->value);
+}
+
+TEST_P(StorageTestPopulateOne, SetEntryValueAssignTypeChange) {
+  // update with different type results in error and no message or notification
+  auto value = Value::MakeDouble(0.0);
+  EXPECT_FALSE(storage.SetEntryValue("foo", value));
+  auto entry = GetEntry("foo");
+  EXPECT_NE(value, entry->value);
+}
+
+TEST_P(StorageTestPopulateOne, SetEntryValueEqualValue) {
+  // update with same type and same value: change value contents but no update
+  // message is issued (minimizing bandwidth usage)
+  auto value = Value::MakeBoolean(true);
+  EXPECT_TRUE(storage.SetEntryValue("foo", value));
+  auto entry = GetEntry("foo");
+  EXPECT_EQ(value, entry->value);
+}
+
+TEST_P(StorageTestPopulated, SetEntryValueDifferentValue) {
+  // update with same type and different value results in value update message
+  auto value = Value::MakeDouble(1.0);
+
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned if server; seq_num incremented
+    EXPECT_CALL(dispatcher,
+                QueueOutgoing(MessageEq(Message::EntryUpdate(1, 2, value)),
+                              IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), value,
+                          NT_NOTIFY_UPDATE | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  EXPECT_TRUE(storage.SetEntryValue("foo2", value));
+  auto entry = GetEntry("foo2");
+  EXPECT_EQ(value, entry->value);
+
+  if (!GetParam()) {
+    // seq_num should still be incremented
+    EXPECT_EQ(2u, GetEntry("foo2")->seq_num.value());
+  }
+}
+
+TEST_P(StorageTestEmpty, SetEntryValueEmptyName) {
+  auto value = Value::MakeBoolean(true);
+  EXPECT_TRUE(storage.SetEntryValue("", value));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, SetEntryValueEmptyValue) {
+  EXPECT_TRUE(storage.SetEntryValue("foo", nullptr));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, SetDefaultEntryAssignNew) {
+  // brand new entry
+  auto value = Value::MakeBoolean(true);
+
+  // id assigned if server
+  EXPECT_CALL(dispatcher,
+              QueueOutgoing(MessageEq(Message::EntryAssign(
+                                "foo", GetParam() ? 0 : 0xffff, 1, value, 0)),
+                            IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"), value,
+                                    NT_NOTIFY_NEW | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  auto ret_val = storage.SetDefaultEntryValue("foo", value);
+  EXPECT_TRUE(ret_val);
+  EXPECT_EQ(value, GetEntry("foo")->value);
+}
+
+TEST_P(StorageTestPopulateOne, SetDefaultEntryExistsSameType) {
+  // existing entry
+  auto value = Value::MakeBoolean(true);
+  auto ret_val = storage.SetDefaultEntryValue("foo", value);
+  EXPECT_TRUE(ret_val);
+  EXPECT_NE(value, GetEntry("foo")->value);
+}
+
+TEST_P(StorageTestPopulateOne, SetDefaultEntryExistsDifferentType) {
+  // existing entry is boolean
+  auto value = Value::MakeDouble(2.0);
+  auto ret_val = storage.SetDefaultEntryValue("foo", value);
+  EXPECT_FALSE(ret_val);
+  // should not have updated value in table if it already existed.
+  EXPECT_NE(value, GetEntry("foo")->value);
+}
+
+TEST_P(StorageTestEmpty, SetDefaultEntryEmptyName) {
+  auto value = Value::MakeBoolean(true);
+  auto ret_val = storage.SetDefaultEntryValue("", value);
+  EXPECT_FALSE(ret_val);
+  auto entry = GetEntry("foo");
+  EXPECT_FALSE(entry->value);
+  EXPECT_EQ(0u, entry->flags);
+  EXPECT_EQ("foobar", entry->name);  // since GetEntry uses the tmp_entry.
+  EXPECT_EQ(0xffffu, entry->id);
+  EXPECT_EQ(SequenceNumber(), entry->seq_num);
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, SetDefaultEntryEmptyValue) {
+  auto value = Value::MakeBoolean(true);
+  auto ret_val = storage.SetDefaultEntryValue("", nullptr);
+  EXPECT_FALSE(ret_val);
+  auto entry = GetEntry("foo");
+  EXPECT_FALSE(entry->value);
+  EXPECT_EQ(0u, entry->flags);
+  EXPECT_EQ("foobar", entry->name);  // since GetEntry uses the tmp_entry.
+  EXPECT_EQ(0xffffu, entry->id);
+  EXPECT_EQ(SequenceNumber(), entry->seq_num);
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestPopulated, SetDefaultEntryEmptyName) {
+  auto value = Value::MakeBoolean(true);
+  auto ret_val = storage.SetDefaultEntryValue("", value);
+  EXPECT_FALSE(ret_val);
+  // assert that no entries get added
+  EXPECT_EQ(4u, entries().size());
+  if (GetParam())
+    EXPECT_EQ(4u, idmap().size());
+  else
+    EXPECT_EQ(0u, idmap().size());
+}
+
+TEST_P(StorageTestPopulated, SetDefaultEntryEmptyValue) {
+  auto value = Value::MakeBoolean(true);
+  auto ret_val = storage.SetDefaultEntryValue("", nullptr);
+  EXPECT_FALSE(ret_val);
+  // assert that no entries get added
+  EXPECT_EQ(4u, entries().size());
+  if (GetParam())
+    EXPECT_EQ(4u, idmap().size());
+  else
+    EXPECT_EQ(0u, idmap().size());
+}
+
+TEST_P(StorageTestEmpty, SetEntryFlagsNew) {
+  // flags setting doesn't create an entry
+  storage.SetEntryFlags("foo", 0u);
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestPopulateOne, SetEntryFlagsEqualValue) {
+  // update with same value: no update message is issued (minimizing bandwidth
+  // usage)
+  storage.SetEntryFlags("foo", 0u);
+  auto entry = GetEntry("foo");
+  EXPECT_EQ(0u, entry->flags);
+}
+
+TEST_P(StorageTestPopulated, SetEntryFlagsDifferentValue) {
+  // update with different value results in flags update message
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned as this is the server
+    EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::FlagsUpdate(1, 1)),
+                                          IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), _,
+                          NT_NOTIFY_FLAGS | NT_NOTIFY_LOCAL, UINT_MAX));
+  storage.SetEntryFlags("foo2", 1u);
+  EXPECT_EQ(1u, GetEntry("foo2")->flags);
+}
+
+TEST_P(StorageTestEmpty, SetEntryFlagsEmptyName) {
+  storage.SetEntryFlags("", 0u);
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, GetEntryFlagsNotExist) {
+  EXPECT_EQ(0u, storage.GetEntryFlags("foo"));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestPopulateOne, GetEntryFlagsExist) {
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _));
+  storage.SetEntryFlags("foo", 1u);
+  ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+  EXPECT_EQ(1u, storage.GetEntryFlags("foo"));
+}
+
+TEST_P(StorageTestEmpty, DeleteEntryNotExist) { storage.DeleteEntry("foo"); }
+
+TEST_P(StorageTestPopulated, DeleteEntryExist) {
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned as this is the server
+    EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::EntryDelete(1)),
+                                          IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), ValueEq(Value::MakeDouble(0)),
+                          NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  storage.DeleteEntry("foo2");
+  ASSERT_EQ(1u, entries().count("foo2"));
+  EXPECT_EQ(nullptr, entries()["foo2"]->value);
+  EXPECT_EQ(0xffffu, entries()["foo2"]->id);
+  EXPECT_FALSE(entries()["foo2"]->local_write);
+  if (GetParam()) {
+    ASSERT_TRUE(idmap().size() >= 2);
+    EXPECT_FALSE(idmap()[1]);
+  }
+}
+
+TEST_P(StorageTestEmpty, DeleteAllEntriesEmpty) {
+  storage.DeleteAllEntries();
+  ASSERT_TRUE(entries().empty());
+}
+
+TEST_P(StorageTestPopulated, DeleteAllEntries) {
+  EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::ClearEntries()),
+                                        IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL,
+                                    UINT_MAX))
+      .Times(4);
+
+  storage.DeleteAllEntries();
+  ASSERT_EQ(1u, entries().count("foo2"));
+  EXPECT_EQ(nullptr, entries()["foo2"]->value);
+}
+
+TEST_P(StorageTestPopulated, DeleteAllEntriesPersistent) {
+  GetEntry("foo2")->flags = NT_PERSISTENT;
+
+  EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::ClearEntries()),
+                                        IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, NT_NOTIFY_DELETE | NT_NOTIFY_LOCAL,
+                                    UINT_MAX))
+      .Times(3);
+
+  storage.DeleteAllEntries();
+  ASSERT_EQ(1u, entries().count("foo2"));
+  EXPECT_NE(nullptr, entries()["foo2"]->value);
+}
+
+TEST_P(StorageTestPopulated, GetEntryInfoAll) {
+  auto info = storage.GetEntryInfo(0, "", 0u);
+  ASSERT_EQ(4u, info.size());
+}
+
+TEST_P(StorageTestPopulated, GetEntryInfoPrefix) {
+  auto info = storage.GetEntryInfo(0, "foo", 0u);
+  ASSERT_EQ(2u, info.size());
+  if (info[0].name == "foo") {
+    EXPECT_EQ("foo", info[0].name);
+    EXPECT_EQ(NT_BOOLEAN, info[0].type);
+    EXPECT_EQ("foo2", info[1].name);
+    EXPECT_EQ(NT_DOUBLE, info[1].type);
+  } else {
+    EXPECT_EQ("foo2", info[0].name);
+    EXPECT_EQ(NT_DOUBLE, info[0].type);
+    EXPECT_EQ("foo", info[1].name);
+    EXPECT_EQ(NT_BOOLEAN, info[1].type);
+  }
+}
+
+TEST_P(StorageTestPopulated, GetEntryInfoTypes) {
+  auto info = storage.GetEntryInfo(0, "", NT_DOUBLE);
+  ASSERT_EQ(2u, info.size());
+  EXPECT_EQ(NT_DOUBLE, info[0].type);
+  EXPECT_EQ(NT_DOUBLE, info[1].type);
+  if (info[0].name == "foo2") {
+    EXPECT_EQ("foo2", info[0].name);
+    EXPECT_EQ("bar", info[1].name);
+  } else {
+    EXPECT_EQ("bar", info[0].name);
+    EXPECT_EQ("foo2", info[1].name);
+  }
+}
+
+TEST_P(StorageTestPopulated, GetEntryInfoPrefixTypes) {
+  auto info = storage.GetEntryInfo(0, "bar", NT_BOOLEAN);
+  ASSERT_EQ(1u, info.size());
+  EXPECT_EQ("bar2", info[0].name);
+  EXPECT_EQ(NT_BOOLEAN, info[0].type);
+}
+
+TEST_P(StorageTestPersistent, SavePersistentEmpty) {
+  llvm::SmallString<256> buf;
+  llvm::raw_svector_ostream oss(buf);
+  storage.SavePersistent(oss, false);
+  ASSERT_EQ("[NetworkTables Storage 3.0]\n", oss.str());
+}
+
+TEST_P(StorageTestPersistent, SavePersistent) {
+  for (auto& i : entries()) i.getValue()->flags = NT_PERSISTENT;
+  llvm::SmallString<256> buf;
+  llvm::raw_svector_ostream oss(buf);
+  storage.SavePersistent(oss, false);
+  llvm::StringRef out = oss.str();
+  // std::fputs(out.c_str(), stderr);
+  llvm::StringRef line, rem = out;
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("[NetworkTables Storage 3.0]", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("boolean \"\\x00\\x03\\x05\\n\"=true", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("boolean \"\\x3D\"=true", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("boolean \"boolean/false\"=false", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("boolean \"boolean/true\"=true", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array boolean \"booleanarr/empty\"=", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array boolean \"booleanarr/one\"=true", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array boolean \"booleanarr/two\"=true,false", line);
+  std::tie(line, rem) = rem.split('\n');
+#if defined(_MSC_VER) && _MSC_VER < 1900
+  ASSERT_EQ("double \"double/big\"=1.3e+008", line);
+#else
+  ASSERT_EQ("double \"double/big\"=1.3e+08", line);
+#endif
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("double \"double/neg\"=-1.5", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("double \"double/zero\"=0", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array double \"doublearr/empty\"=", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array double \"doublearr/one\"=0.5", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array double \"doublearr/two\"=0.5,-0.25", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("raw \"raw/empty\"=", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("raw \"raw/normal\"=aGVsbG8=", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("raw \"raw/special\"=AAMFCg==", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("string \"string/empty\"=\"\"", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("string \"string/normal\"=\"hello\"", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("string \"string/special\"=\"\\x00\\x03\\x05\\n\"", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array string \"stringarr/empty\"=", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array string \"stringarr/one\"=\"hello\"", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("array string \"stringarr/two\"=\"hello\",\"world\\n\"", line);
+  std::tie(line, rem) = rem.split('\n');
+  ASSERT_EQ("", line);
+}
+
+TEST_P(StorageTestEmpty, LoadPersistentBadHeader) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  wpi::raw_mem_istream iss("");
+  EXPECT_CALL(
+      warn,
+      Warn(1, llvm::StringRef("header line mismatch, ignoring rest of file")));
+  EXPECT_FALSE(storage.LoadEntries(iss, "", true, warn_func));
+
+  wpi::raw_mem_istream iss2("[NetworkTables");
+  EXPECT_CALL(
+      warn,
+      Warn(1, llvm::StringRef("header line mismatch, ignoring rest of file")));
+
+  EXPECT_FALSE(storage.LoadEntries(iss2, "", true, warn_func));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, LoadPersistentCommentHeader) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  wpi::raw_mem_istream iss(
+      "\n; comment\n# comment\n[NetworkTables Storage 3.0]\n");
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, LoadPersistentEmptyName) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  wpi::raw_mem_istream iss("[NetworkTables Storage 3.0]\nboolean \"\"=true\n");
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, LoadPersistentAssign) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  auto value = Value::MakeBoolean(true);
+
+  // id assigned if server
+  EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::EntryAssign(
+                                            "foo", GetParam() ? 0 : 0xffff, 1,
+                                            value, NT_PERSISTENT)),
+                                        IsNull(), IsNull()));
+  EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"),
+                                    ValueEq(Value::MakeBoolean(true)),
+                                    NT_NOTIFY_NEW | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  wpi::raw_mem_istream iss(
+      "[NetworkTables Storage 3.0]\nboolean \"foo\"=true\n");
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  auto entry = GetEntry("foo");
+  EXPECT_EQ(*value, *entry->value);
+  EXPECT_EQ(NT_PERSISTENT, entry->flags);
+}
+
+TEST_P(StorageTestPopulated, LoadPersistentUpdateFlags) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned as this is server
+    EXPECT_CALL(dispatcher,
+                QueueOutgoing(MessageEq(Message::FlagsUpdate(1, NT_PERSISTENT)),
+                              IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), ValueEq(Value::MakeDouble(0)),
+                          NT_NOTIFY_FLAGS | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  wpi::raw_mem_istream iss(
+      "[NetworkTables Storage 3.0]\ndouble \"foo2\"=0.0\n");
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  auto entry = GetEntry("foo2");
+  EXPECT_EQ(*Value::MakeDouble(0.0), *entry->value);
+  EXPECT_EQ(NT_PERSISTENT, entry->flags);
+}
+
+TEST_P(StorageTestPopulated, LoadPersistentUpdateValue) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  GetEntry("foo2")->flags = NT_PERSISTENT;
+
+  auto value = Value::MakeDouble(1.0);
+
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned as this is the server; seq_num incremented
+    EXPECT_CALL(dispatcher,
+                QueueOutgoing(MessageEq(Message::EntryUpdate(1, 2, value)),
+                              IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), ValueEq(Value::MakeDouble(1)),
+                          NT_NOTIFY_UPDATE | NT_NOTIFY_LOCAL, UINT_MAX));
+
+  wpi::raw_mem_istream iss(
+      "[NetworkTables Storage 3.0]\ndouble \"foo2\"=1.0\n");
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  auto entry = GetEntry("foo2");
+  EXPECT_EQ(*value, *entry->value);
+  EXPECT_EQ(NT_PERSISTENT, entry->flags);
+
+  if (!GetParam()) {
+    // seq_num should still be incremented
+    EXPECT_EQ(2u, GetEntry("foo2")->seq_num.value());
+  }
+}
+
+TEST_P(StorageTestPopulated, LoadPersistentUpdateValueFlags) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  auto value = Value::MakeDouble(1.0);
+
+  // client shouldn't send an update as id not assigned yet
+  if (GetParam()) {
+    // id assigned as this is the server; seq_num incremented
+    EXPECT_CALL(dispatcher,
+                QueueOutgoing(MessageEq(Message::EntryUpdate(1, 2, value)),
+                              IsNull(), IsNull()));
+    EXPECT_CALL(dispatcher,
+                QueueOutgoing(MessageEq(Message::FlagsUpdate(1, NT_PERSISTENT)),
+                              IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier,
+              NotifyEntry(1, StringRef("foo2"), ValueEq(Value::MakeDouble(1)),
+                          NT_NOTIFY_FLAGS | NT_NOTIFY_UPDATE | NT_NOTIFY_LOCAL,
+                          UINT_MAX));
+
+  wpi::raw_mem_istream iss(
+      "[NetworkTables Storage 3.0]\ndouble \"foo2\"=1.0\n");
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  auto entry = GetEntry("foo2");
+  EXPECT_EQ(*value, *entry->value);
+  EXPECT_EQ(NT_PERSISTENT, entry->flags);
+
+  if (!GetParam()) {
+    // seq_num should still be incremented
+    EXPECT_EQ(2u, GetEntry("foo2")->seq_num.value());
+  }
+}
+
+TEST_P(StorageTestEmpty, LoadPersistent) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  std::string in = "[NetworkTables Storage 3.0]\n";
+  in += "boolean \"\\x00\\x03\\x05\\n\"=true\n";
+  in += "boolean \"\\x3D\"=true\n";
+  in += "boolean \"boolean/false\"=false\n";
+  in += "boolean \"boolean/true\"=true\n";
+  in += "array boolean \"booleanarr/empty\"=\n";
+  in += "array boolean \"booleanarr/one\"=true\n";
+  in += "array boolean \"booleanarr/two\"=true,false\n";
+  in += "double \"double/big\"=1.3e+08\n";
+  in += "double \"double/neg\"=-1.5\n";
+  in += "double \"double/zero\"=0\n";
+  in += "array double \"doublearr/empty\"=\n";
+  in += "array double \"doublearr/one\"=0.5\n";
+  in += "array double \"doublearr/two\"=0.5,-0.25\n";
+  in += "raw \"raw/empty\"=\n";
+  in += "raw \"raw/normal\"=aGVsbG8=\n";
+  in += "raw \"raw/special\"=AAMFCg==\n";
+  in += "string \"string/empty\"=\"\"\n";
+  in += "string \"string/normal\"=\"hello\"\n";
+  in += "string \"string/special\"=\"\\x00\\x03\\x05\\n\"\n";
+  in += "array string \"stringarr/empty\"=\n";
+  in += "array string \"stringarr/one\"=\"hello\"\n";
+  in += "array string \"stringarr/two\"=\"hello\",\"world\\n\"\n";
+
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(22);
+  EXPECT_CALL(notifier,
+              NotifyEntry(_, _, _, NT_NOTIFY_NEW | NT_NOTIFY_LOCAL, UINT_MAX))
+      .Times(22);
+
+  wpi::raw_mem_istream iss(in);
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+  ASSERT_EQ(22u, entries().size());
+
+  EXPECT_EQ(*Value::MakeBoolean(true), *storage.GetEntryValue("boolean/true"));
+  EXPECT_EQ(*Value::MakeBoolean(false),
+            *storage.GetEntryValue("boolean/false"));
+  EXPECT_EQ(*Value::MakeDouble(-1.5), *storage.GetEntryValue("double/neg"));
+  EXPECT_EQ(*Value::MakeDouble(0.0), *storage.GetEntryValue("double/zero"));
+  EXPECT_EQ(*Value::MakeDouble(1.3e8), *storage.GetEntryValue("double/big"));
+  EXPECT_EQ(*Value::MakeString(""), *storage.GetEntryValue("string/empty"));
+  EXPECT_EQ(*Value::MakeString("hello"),
+            *storage.GetEntryValue("string/normal"));
+  EXPECT_EQ(*Value::MakeString(StringRef("\0\3\5\n", 4)),
+            *storage.GetEntryValue("string/special"));
+  EXPECT_EQ(*Value::MakeRaw(""), *storage.GetEntryValue("raw/empty"));
+  EXPECT_EQ(*Value::MakeRaw("hello"), *storage.GetEntryValue("raw/normal"));
+  EXPECT_EQ(*Value::MakeRaw(StringRef("\0\3\5\n", 4)),
+            *storage.GetEntryValue("raw/special"));
+  EXPECT_EQ(*Value::MakeBooleanArray(std::vector<int>{}),
+            *storage.GetEntryValue("booleanarr/empty"));
+  EXPECT_EQ(*Value::MakeBooleanArray(std::vector<int>{1}),
+            *storage.GetEntryValue("booleanarr/one"));
+  EXPECT_EQ(*Value::MakeBooleanArray(std::vector<int>{1, 0}),
+            *storage.GetEntryValue("booleanarr/two"));
+  EXPECT_EQ(*Value::MakeDoubleArray(std::vector<double>{}),
+            *storage.GetEntryValue("doublearr/empty"));
+  EXPECT_EQ(*Value::MakeDoubleArray(std::vector<double>{0.5}),
+            *storage.GetEntryValue("doublearr/one"));
+  EXPECT_EQ(*Value::MakeDoubleArray(std::vector<double>{0.5, -0.25}),
+            *storage.GetEntryValue("doublearr/two"));
+  EXPECT_EQ(*Value::MakeStringArray(std::vector<std::string>{}),
+            *storage.GetEntryValue("stringarr/empty"));
+  EXPECT_EQ(*Value::MakeStringArray(std::vector<std::string>{"hello"}),
+            *storage.GetEntryValue("stringarr/one"));
+  EXPECT_EQ(
+      *Value::MakeStringArray(std::vector<std::string>{"hello", "world\n"}),
+      *storage.GetEntryValue("stringarr/two"));
+  EXPECT_EQ(*Value::MakeBoolean(true),
+            *storage.GetEntryValue(StringRef("\0\3\5\n", 4)));
+  EXPECT_EQ(*Value::MakeBoolean(true), *storage.GetEntryValue("="));
+}
+
+TEST_P(StorageTestEmpty, LoadPersistentWarn) {
+  MockLoadWarn warn;
+  auto warn_func = [&](size_t line, const char* msg) { warn.Warn(line, msg); };
+
+  wpi::raw_mem_istream iss(
+      "[NetworkTables Storage 3.0]\nboolean \"foo\"=foo\n");
+  EXPECT_CALL(
+      warn, Warn(2, llvm::StringRef(
+                        "unrecognized boolean value, not 'true' or 'false'")));
+  EXPECT_TRUE(storage.LoadEntries(iss, "", true, warn_func));
+
+  EXPECT_TRUE(entries().empty());
+  EXPECT_TRUE(idmap().empty());
+}
+
+TEST_P(StorageTestEmpty, ProcessIncomingEntryAssign) {
+  auto conn = std::make_shared<MockNetworkConnection>();
+  auto value = Value::MakeDouble(1.0);
+  if (GetParam()) {
+    // id assign message reply generated on the server; sent to everyone
+    EXPECT_CALL(
+        dispatcher,
+        QueueOutgoing(MessageEq(Message::EntryAssign("foo", 0, 0, value, 0)),
+                      IsNull(), IsNull()));
+  }
+  EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"), ValueEq(value),
+                                    NT_NOTIFY_NEW, UINT_MAX));
+
+  storage.ProcessIncoming(
+      Message::EntryAssign("foo", GetParam() ? 0xffff : 0, 0, value, 0),
+      conn.get(), conn);
+}
+
+TEST_P(StorageTestPopulateOne, ProcessIncomingEntryAssign) {
+  auto conn = std::make_shared<MockNetworkConnection>();
+  auto value = Value::MakeDouble(1.0);
+  EXPECT_CALL(*conn, proto_rev()).WillRepeatedly(Return(0x0300u));
+  if (GetParam()) {
+    // server broadcasts new value to all *other* connections
+    EXPECT_CALL(
+        dispatcher,
+        QueueOutgoing(MessageEq(Message::EntryAssign("foo", 0, 1, value, 0)),
+                      IsNull(), conn.get()));
+  }
+  EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"), ValueEq(value),
+                                    NT_NOTIFY_UPDATE, UINT_MAX));
+
+  storage.ProcessIncoming(Message::EntryAssign("foo", 0, 1, value, 0),
+                          conn.get(), conn);
+}
+
+TEST_P(StorageTestPopulateOne, ProcessIncomingEntryAssignIgnore) {
+  auto conn = std::make_shared<MockNetworkConnection>();
+  auto value = Value::MakeDouble(1.0);
+  storage.ProcessIncoming(Message::EntryAssign("foo", 0xffff, 1, value, 0),
+                          conn.get(), conn);
+}
+
+TEST_P(StorageTestPopulateOne, ProcessIncomingEntryAssignWithFlags) {
+  auto conn = std::make_shared<MockNetworkConnection>();
+  auto value = Value::MakeDouble(1.0);
+  EXPECT_CALL(*conn, proto_rev()).WillRepeatedly(Return(0x0300u));
+  if (GetParam()) {
+    // server broadcasts new value/flags to all *other* connections
+    EXPECT_CALL(
+        dispatcher,
+        QueueOutgoing(MessageEq(Message::EntryAssign("foo", 0, 1, value, 0x2)),
+                      IsNull(), conn.get()));
+    EXPECT_CALL(notifier,
+                NotifyEntry(0, StringRef("foo"), ValueEq(value),
+                            NT_NOTIFY_UPDATE | NT_NOTIFY_FLAGS, UINT_MAX));
+  } else {
+    // client forces flags back when an assign message is received for an
+    // existing entry with different flags
+    EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::FlagsUpdate(0, 0)),
+                                          IsNull(), IsNull()));
+    EXPECT_CALL(notifier, NotifyEntry(0, StringRef("foo"), ValueEq(value),
+                                      NT_NOTIFY_UPDATE, UINT_MAX));
+  }
+
+  storage.ProcessIncoming(Message::EntryAssign("foo", 0, 1, value, 0x2),
+                          conn.get(), conn);
+}
+
+TEST_P(StorageTestPopulateOne, DeleteCheckHandle) {
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+  auto handle = storage.GetEntry("foo");
+  storage.DeleteEntry("foo");
+  storage.SetEntryTypeValue("foo", Value::MakeBoolean(true));
+  ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+  ::testing::Mock::VerifyAndClearExpectations(&notifier);
+
+  auto handle2 = storage.GetEntry("foo");
+  ASSERT_EQ(handle, handle2);
+}
+
+TEST_P(StorageTestPopulateOne, DeletedEntryFlags) {
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+  auto handle = storage.GetEntry("foo");
+  storage.SetEntryFlags("foo", 2);
+  storage.DeleteEntry("foo");
+  ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+  ::testing::Mock::VerifyAndClearExpectations(&notifier);
+
+  EXPECT_EQ(storage.GetEntryFlags("foo"), 0u);
+  EXPECT_EQ(storage.GetEntryFlags(handle), 0u);
+  storage.SetEntryFlags("foo", 4);
+  storage.SetEntryFlags(handle, 4);
+  EXPECT_EQ(storage.GetEntryFlags("foo"), 0u);
+  EXPECT_EQ(storage.GetEntryFlags(handle), 0u);
+}
+
+TEST_P(StorageTestPopulateOne, DeletedDeleteAllEntries) {
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+  storage.DeleteEntry("foo");
+  ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+  ::testing::Mock::VerifyAndClearExpectations(&notifier);
+
+  EXPECT_CALL(dispatcher, QueueOutgoing(MessageEq(Message::ClearEntries()),
+                                        IsNull(), IsNull()));
+  storage.DeleteAllEntries();
+}
+
+TEST_P(StorageTestPopulateOne, DeletedGetEntries) {
+  EXPECT_CALL(dispatcher, QueueOutgoing(_, _, _)).Times(AnyNumber());
+  EXPECT_CALL(notifier, NotifyEntry(_, _, _, _, _)).Times(AnyNumber());
+  storage.DeleteEntry("foo");
+  ::testing::Mock::VerifyAndClearExpectations(&dispatcher);
+  ::testing::Mock::VerifyAndClearExpectations(&notifier);
+
+  EXPECT_TRUE(storage.GetEntries("", 0).empty());
+}
+
+INSTANTIATE_TEST_CASE_P(StorageTestsEmpty, StorageTestEmpty,
+                        ::testing::Bool(), );
+INSTANTIATE_TEST_CASE_P(StorageTestsPopulateOne, StorageTestPopulateOne,
+                        ::testing::Bool(), );
+INSTANTIATE_TEST_CASE_P(StorageTestsPopulated, StorageTestPopulated,
+                        ::testing::Bool(), );
+INSTANTIATE_TEST_CASE_P(StorageTestsPersistent, StorageTestPersistent,
+                        ::testing::Bool(), );
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/StorageTest.h b/third_party/ntcore_2018/src/test/native/cpp/StorageTest.h
new file mode 100644
index 0000000..559a98c
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/StorageTest.h
@@ -0,0 +1,47 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_STORAGETEST_H_
+#define NTCORE_STORAGETEST_H_
+
+#include <functional>
+#include <memory>
+#include <vector>
+
+#include "Log.h"
+#include "MockDispatcher.h"
+#include "MockEntryNotifier.h"
+#include "MockRpcServer.h"
+#include "Storage.h"
+
+namespace nt {
+
+class StorageTest {
+ public:
+  StorageTest() : storage(notifier, rpc_server, logger), tmp_entry("foobar") {}
+
+  Storage::EntriesMap& entries() { return storage.m_entries; }
+  Storage::IdMap& idmap() { return storage.m_idmap; }
+
+  Storage::Entry* GetEntry(StringRef name) {
+    auto i = storage.m_entries.find(name);
+    return i == storage.m_entries.end() ? &tmp_entry : i->getValue();
+  }
+
+  void HookOutgoing(bool server) { storage.SetDispatcher(&dispatcher, server); }
+
+  wpi::Logger logger;
+  ::testing::StrictMock<MockEntryNotifier> notifier;
+  ::testing::StrictMock<MockRpcServer> rpc_server;
+  ::testing::StrictMock<MockDispatcher> dispatcher;
+  Storage storage;
+  Storage::Entry tmp_entry;
+};
+
+}  // namespace nt
+
+#endif  // NTCORE_STORAGETEST_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/TestPrinters.cpp b/third_party/ntcore_2018/src/test/native/cpp/TestPrinters.cpp
new file mode 100644
index 0000000..d12a3e3
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/TestPrinters.cpp
@@ -0,0 +1,156 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "TestPrinters.h"
+
+#include "Handle.h"
+#include "Message.h"
+#include "networktables/NetworkTableValue.h"
+#include "ntcore_cpp.h"
+
+namespace nt {
+
+void PrintTo(const EntryNotification& event, std::ostream* os) {
+  *os << "EntryNotification{listener=";
+  PrintTo(Handle{event.listener}, os);
+  *os << ", entry=";
+  PrintTo(Handle{event.entry}, os);
+  *os << ", name=\"" << event.name << "\", flags=" << event.flags << ", value=";
+  PrintTo(event.value, os);
+  *os << '}';
+}
+
+void PrintTo(const Handle& handle, std::ostream* os) {
+  *os << "Handle{";
+  switch (handle.GetType()) {
+    case Handle::kConnectionListener:
+      *os << "kConnectionListener";
+      break;
+    case Handle::kConnectionListenerPoller:
+      *os << "kConnectionListenerPoller";
+      break;
+    case Handle::kEntry:
+      *os << "kEntry";
+      break;
+    case Handle::kEntryListener:
+      *os << "kEntryListener";
+      break;
+    case Handle::kEntryListenerPoller:
+      *os << "kEntryListenerPoller";
+      break;
+    case Handle::kInstance:
+      *os << "kInstance";
+      break;
+    case Handle::kLogger:
+      *os << "kLogger";
+      break;
+    case Handle::kLoggerPoller:
+      *os << "kLoggerPoller";
+      break;
+    case Handle::kRpcCall:
+      *os << "kRpcCall";
+      break;
+    case Handle::kRpcCallPoller:
+      *os << "kRpcCallPoller";
+      break;
+    default:
+      *os << "UNKNOWN";
+      break;
+  }
+  *os << ", " << handle.GetInst() << ", " << handle.GetIndex() << '}';
+}
+
+void PrintTo(const Message& msg, std::ostream* os) {
+  *os << "Message{";
+  switch (msg.type()) {
+    case Message::kKeepAlive:
+      *os << "kKeepAlive";
+      break;
+    case Message::kClientHello:
+      *os << "kClientHello";
+      break;
+    case Message::kProtoUnsup:
+      *os << "kProtoUnsup";
+      break;
+    case Message::kServerHelloDone:
+      *os << "kServerHelloDone";
+      break;
+    case Message::kServerHello:
+      *os << "kServerHello";
+      break;
+    case Message::kClientHelloDone:
+      *os << "kClientHelloDone";
+      break;
+    case Message::kEntryAssign:
+      *os << "kEntryAssign";
+      break;
+    case Message::kEntryUpdate:
+      *os << "kEntryUpdate";
+      break;
+    case Message::kFlagsUpdate:
+      *os << "kFlagsUpdate";
+      break;
+    case Message::kEntryDelete:
+      *os << "kEntryDelete";
+      break;
+    case Message::kClearEntries:
+      *os << "kClearEntries";
+      break;
+    case Message::kExecuteRpc:
+      *os << "kExecuteRpc";
+      break;
+    case Message::kRpcResponse:
+      *os << "kRpcResponse";
+      break;
+    default:
+      *os << "UNKNOWN";
+      break;
+  }
+  *os << ": str=\"" << msg.str() << "\", id=" << msg.id()
+      << ", flags=" << msg.flags() << ", seq_num_uid=" << msg.seq_num_uid()
+      << ", value=";
+  PrintTo(msg.value(), os);
+  *os << '}';
+}
+
+void PrintTo(const Value& value, std::ostream* os) {
+  *os << "Value{";
+  switch (value.type()) {
+    case NT_UNASSIGNED:
+      break;
+    case NT_BOOLEAN:
+      *os << (value.GetBoolean() ? "true" : "false");
+      break;
+    case NT_DOUBLE:
+      *os << value.GetDouble();
+      break;
+    case NT_STRING:
+      *os << '"' << value.GetString().str() << '"';
+      break;
+    case NT_RAW:
+      *os << ::testing::PrintToString(value.GetRaw());
+      break;
+    case NT_BOOLEAN_ARRAY:
+      *os << ::testing::PrintToString(value.GetBooleanArray());
+      break;
+    case NT_DOUBLE_ARRAY:
+      *os << ::testing::PrintToString(value.GetDoubleArray());
+      break;
+    case NT_STRING_ARRAY:
+      *os << ::testing::PrintToString(value.GetStringArray());
+      break;
+    case NT_RPC:
+      *os << ::testing::PrintToString(value.GetRpc());
+      break;
+    default:
+      *os << "UNKNOWN TYPE " << value.type();
+      break;
+  }
+  *os << '}';
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/TestPrinters.h b/third_party/ntcore_2018/src/test/native/cpp/TestPrinters.h
new file mode 100644
index 0000000..462db93
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/TestPrinters.h
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_TESTPRINTERS_H_
+#define NTCORE_TESTPRINTERS_H_
+
+#include <memory>
+#include <ostream>
+
+#include <llvm/StringRef.h>
+
+#include "gtest/gtest.h"
+
+namespace llvm {
+
+inline void PrintTo(StringRef str, ::std::ostream* os) {
+  ::testing::internal::PrintStringTo(str.str(), os);
+}
+
+}  // namespace llvm
+
+namespace nt {
+
+class EntryNotification;
+class Handle;
+class Message;
+class Value;
+
+void PrintTo(const EntryNotification& event, std::ostream* os);
+void PrintTo(const Handle& handle, std::ostream* os);
+
+void PrintTo(const Message& msg, std::ostream* os);
+
+inline void PrintTo(std::shared_ptr<Message> msg, std::ostream* os) {
+  *os << "shared_ptr{";
+  if (msg) PrintTo(*msg, os);
+  *os << '}';
+}
+
+void PrintTo(const Value& value, std::ostream* os);
+
+inline void PrintTo(std::shared_ptr<Value> value, std::ostream* os) {
+  *os << "shared_ptr{";
+  if (value) PrintTo(*value, os);
+  *os << '}';
+}
+
+}  // namespace nt
+
+#endif  // NTCORE_TESTPRINTERS_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/ValueMatcher.cpp b/third_party/ntcore_2018/src/test/native/cpp/ValueMatcher.cpp
new file mode 100644
index 0000000..b429305
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/ValueMatcher.cpp
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "ValueMatcher.h"
+
+#include "TestPrinters.h"
+
+namespace nt {
+
+bool ValueMatcher::MatchAndExplain(
+    std::shared_ptr<Value> val,
+    ::testing::MatchResultListener* listener) const {
+  if ((!val && goodval) || (val && !goodval) ||
+      (val && goodval && *val != *goodval)) {
+    return false;
+  }
+  return true;
+}
+
+void ValueMatcher::DescribeTo(::std::ostream* os) const {
+  PrintTo(goodval, os);
+}
+
+void ValueMatcher::DescribeNegationTo(::std::ostream* os) const {
+  *os << "is not equal to ";
+  PrintTo(goodval, os);
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/ValueMatcher.h b/third_party/ntcore_2018/src/test/native/cpp/ValueMatcher.h
new file mode 100644
index 0000000..99ecc84
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/ValueMatcher.h
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef NTCORE_VALUEMATCHER_H_
+#define NTCORE_VALUEMATCHER_H_
+
+#include <memory>
+#include <ostream>
+
+#include "gmock/gmock.h"
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+
+class ValueMatcher
+    : public ::testing::MatcherInterface<std::shared_ptr<Value>> {
+ public:
+  explicit ValueMatcher(std::shared_ptr<Value> goodval_) : goodval(goodval_) {}
+
+  bool MatchAndExplain(std::shared_ptr<Value> msg,
+                       ::testing::MatchResultListener* listener) const override;
+  void DescribeTo(::std::ostream* os) const override;
+  void DescribeNegationTo(::std::ostream* os) const override;
+
+ private:
+  std::shared_ptr<Value> goodval;
+};
+
+inline ::testing::Matcher<std::shared_ptr<Value>> ValueEq(
+    std::shared_ptr<Value> goodval) {
+  return ::testing::MakeMatcher(new ValueMatcher(goodval));
+}
+
+}  // namespace nt
+
+#endif  // NTCORE_VALUEMATCHER_H_
diff --git a/third_party/ntcore_2018/src/test/native/cpp/ValueTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/ValueTest.cpp
new file mode 100644
index 0000000..1d08702
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/ValueTest.cpp
@@ -0,0 +1,365 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "TestPrinters.h"
+#include "Value_internal.h"
+#include "gtest/gtest.h"
+#include "networktables/NetworkTableValue.h"
+
+namespace nt {
+
+class ValueTest : public ::testing::Test {};
+
+typedef ValueTest ValueDeathTest;
+
+TEST_F(ValueTest, ConstructEmpty) {
+  Value v;
+  ASSERT_EQ(NT_UNASSIGNED, v.type());
+}
+
+TEST_F(ValueTest, Boolean) {
+  auto v = Value::MakeBoolean(false);
+  ASSERT_EQ(NT_BOOLEAN, v->type());
+  ASSERT_FALSE(v->GetBoolean());
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_BOOLEAN, cv.type);
+  ASSERT_EQ(0, cv.data.v_boolean);
+
+  v = Value::MakeBoolean(true);
+  ASSERT_EQ(NT_BOOLEAN, v->type());
+  ASSERT_TRUE(v->GetBoolean());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_BOOLEAN, cv.type);
+  ASSERT_EQ(1, cv.data.v_boolean);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueTest, Double) {
+  auto v = Value::MakeDouble(0.5);
+  ASSERT_EQ(NT_DOUBLE, v->type());
+  ASSERT_EQ(0.5, v->GetDouble());
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_DOUBLE, cv.type);
+  ASSERT_EQ(0.5, cv.data.v_double);
+
+  v = Value::MakeDouble(0.25);
+  ASSERT_EQ(NT_DOUBLE, v->type());
+  ASSERT_EQ(0.25, v->GetDouble());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_DOUBLE, cv.type);
+  ASSERT_EQ(0.25, cv.data.v_double);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueTest, String) {
+  auto v = Value::MakeString("hello");
+  ASSERT_EQ(NT_STRING, v->type());
+  ASSERT_EQ("hello", v->GetString());
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_STRING, cv.type);
+  ASSERT_EQ(llvm::StringRef("hello"), cv.data.v_string.str);
+  ASSERT_EQ(5u, cv.data.v_string.len);
+
+  v = Value::MakeString("goodbye");
+  ASSERT_EQ(NT_STRING, v->type());
+  ASSERT_EQ("goodbye", v->GetString());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_STRING, cv.type);
+  ASSERT_EQ(llvm::StringRef("goodbye"), cv.data.v_string.str);
+  ASSERT_EQ(7u, cv.data.v_string.len);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueTest, Raw) {
+  auto v = Value::MakeRaw("hello");
+  ASSERT_EQ(NT_RAW, v->type());
+  ASSERT_EQ("hello", v->GetRaw());
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_RAW, cv.type);
+  ASSERT_EQ(llvm::StringRef("hello"), cv.data.v_string.str);
+  ASSERT_EQ(5u, cv.data.v_string.len);
+
+  v = Value::MakeRaw("goodbye");
+  ASSERT_EQ(NT_RAW, v->type());
+  ASSERT_EQ("goodbye", v->GetRaw());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_RAW, cv.type);
+  ASSERT_EQ(llvm::StringRef("goodbye"), cv.data.v_string.str);
+  ASSERT_EQ(7u, cv.data.v_string.len);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueTest, BooleanArray) {
+  std::vector<int> vec{1, 0, 1};
+  auto v = Value::MakeBooleanArray(vec);
+  ASSERT_EQ(NT_BOOLEAN_ARRAY, v->type());
+  ASSERT_EQ(llvm::ArrayRef<int>(vec), v->GetBooleanArray());
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_BOOLEAN_ARRAY, cv.type);
+  ASSERT_EQ(3u, cv.data.arr_boolean.size);
+  ASSERT_EQ(vec[0], cv.data.arr_boolean.arr[0]);
+  ASSERT_EQ(vec[1], cv.data.arr_boolean.arr[1]);
+  ASSERT_EQ(vec[2], cv.data.arr_boolean.arr[2]);
+
+  // assign with same size
+  vec = {0, 1, 0};
+  v = Value::MakeBooleanArray(vec);
+  ASSERT_EQ(NT_BOOLEAN_ARRAY, v->type());
+  ASSERT_EQ(llvm::ArrayRef<int>(vec), v->GetBooleanArray());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_BOOLEAN_ARRAY, cv.type);
+  ASSERT_EQ(3u, cv.data.arr_boolean.size);
+  ASSERT_EQ(vec[0], cv.data.arr_boolean.arr[0]);
+  ASSERT_EQ(vec[1], cv.data.arr_boolean.arr[1]);
+  ASSERT_EQ(vec[2], cv.data.arr_boolean.arr[2]);
+
+  // assign with different size
+  vec = {1, 0};
+  v = Value::MakeBooleanArray(vec);
+  ASSERT_EQ(NT_BOOLEAN_ARRAY, v->type());
+  ASSERT_EQ(llvm::ArrayRef<int>(vec), v->GetBooleanArray());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_BOOLEAN_ARRAY, cv.type);
+  ASSERT_EQ(2u, cv.data.arr_boolean.size);
+  ASSERT_EQ(vec[0], cv.data.arr_boolean.arr[0]);
+  ASSERT_EQ(vec[1], cv.data.arr_boolean.arr[1]);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueTest, DoubleArray) {
+  std::vector<double> vec{0.5, 0.25, 0.5};
+  auto v = Value::MakeDoubleArray(vec);
+  ASSERT_EQ(NT_DOUBLE_ARRAY, v->type());
+  ASSERT_EQ(llvm::ArrayRef<double>(vec), v->GetDoubleArray());
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_DOUBLE_ARRAY, cv.type);
+  ASSERT_EQ(3u, cv.data.arr_double.size);
+  ASSERT_EQ(vec[0], cv.data.arr_double.arr[0]);
+  ASSERT_EQ(vec[1], cv.data.arr_double.arr[1]);
+  ASSERT_EQ(vec[2], cv.data.arr_double.arr[2]);
+
+  // assign with same size
+  vec = {0.25, 0.5, 0.25};
+  v = Value::MakeDoubleArray(vec);
+  ASSERT_EQ(NT_DOUBLE_ARRAY, v->type());
+  ASSERT_EQ(llvm::ArrayRef<double>(vec), v->GetDoubleArray());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_DOUBLE_ARRAY, cv.type);
+  ASSERT_EQ(3u, cv.data.arr_double.size);
+  ASSERT_EQ(vec[0], cv.data.arr_double.arr[0]);
+  ASSERT_EQ(vec[1], cv.data.arr_double.arr[1]);
+  ASSERT_EQ(vec[2], cv.data.arr_double.arr[2]);
+
+  // assign with different size
+  vec = {0.5, 0.25};
+  v = Value::MakeDoubleArray(vec);
+  ASSERT_EQ(NT_DOUBLE_ARRAY, v->type());
+  ASSERT_EQ(llvm::ArrayRef<double>(vec), v->GetDoubleArray());
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_DOUBLE_ARRAY, cv.type);
+  ASSERT_EQ(2u, cv.data.arr_double.size);
+  ASSERT_EQ(vec[0], cv.data.arr_double.arr[0]);
+  ASSERT_EQ(vec[1], cv.data.arr_double.arr[1]);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueTest, StringArray) {
+  std::vector<std::string> vec;
+  vec.push_back("hello");
+  vec.push_back("goodbye");
+  vec.push_back("string");
+  auto v = Value::MakeStringArray(std::move(vec));
+  ASSERT_EQ(NT_STRING_ARRAY, v->type());
+  ASSERT_EQ(3u, v->GetStringArray().size());
+  ASSERT_EQ(llvm::StringRef("hello"), v->GetStringArray()[0]);
+  ASSERT_EQ(llvm::StringRef("goodbye"), v->GetStringArray()[1]);
+  ASSERT_EQ(llvm::StringRef("string"), v->GetStringArray()[2]);
+  NT_Value cv;
+  NT_InitValue(&cv);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_STRING_ARRAY, cv.type);
+  ASSERT_EQ(3u, cv.data.arr_string.size);
+  ASSERT_EQ(llvm::StringRef("hello"), cv.data.arr_string.arr[0].str);
+  ASSERT_EQ(llvm::StringRef("goodbye"), cv.data.arr_string.arr[1].str);
+  ASSERT_EQ(llvm::StringRef("string"), cv.data.arr_string.arr[2].str);
+
+  // assign with same size
+  vec.clear();
+  vec.push_back("s1");
+  vec.push_back("str2");
+  vec.push_back("string3");
+  v = Value::MakeStringArray(vec);
+  ASSERT_EQ(NT_STRING_ARRAY, v->type());
+  ASSERT_EQ(3u, v->GetStringArray().size());
+  ASSERT_EQ(llvm::StringRef("s1"), v->GetStringArray()[0]);
+  ASSERT_EQ(llvm::StringRef("str2"), v->GetStringArray()[1]);
+  ASSERT_EQ(llvm::StringRef("string3"), v->GetStringArray()[2]);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_STRING_ARRAY, cv.type);
+  ASSERT_EQ(3u, cv.data.arr_string.size);
+  ASSERT_EQ(llvm::StringRef("s1"), cv.data.arr_string.arr[0].str);
+  ASSERT_EQ(llvm::StringRef("str2"), cv.data.arr_string.arr[1].str);
+  ASSERT_EQ(llvm::StringRef("string3"), cv.data.arr_string.arr[2].str);
+
+  // assign with different size
+  vec.clear();
+  vec.push_back("short");
+  vec.push_back("er");
+  v = Value::MakeStringArray(std::move(vec));
+  ASSERT_EQ(NT_STRING_ARRAY, v->type());
+  ASSERT_EQ(2u, v->GetStringArray().size());
+  ASSERT_EQ(llvm::StringRef("short"), v->GetStringArray()[0]);
+  ASSERT_EQ(llvm::StringRef("er"), v->GetStringArray()[1]);
+  ConvertToC(*v, &cv);
+  ASSERT_EQ(NT_STRING_ARRAY, cv.type);
+  ASSERT_EQ(2u, cv.data.arr_string.size);
+  ASSERT_EQ(llvm::StringRef("short"), cv.data.arr_string.arr[0].str);
+  ASSERT_EQ(llvm::StringRef("er"), cv.data.arr_string.arr[1].str);
+
+  NT_DisposeValue(&cv);
+}
+
+TEST_F(ValueDeathTest, GetAssertions) {
+  Value v;
+  ASSERT_DEATH(v.GetBoolean(), "type == NT_BOOLEAN");
+  ASSERT_DEATH(v.GetDouble(), "type == NT_DOUBLE");
+  ASSERT_DEATH(v.GetString(), "type == NT_STRING");
+  ASSERT_DEATH(v.GetRaw(), "type == NT_RAW");
+  ASSERT_DEATH(v.GetBooleanArray(), "type == NT_BOOLEAN_ARRAY");
+  ASSERT_DEATH(v.GetDoubleArray(), "type == NT_DOUBLE_ARRAY");
+  ASSERT_DEATH(v.GetStringArray(), "type == NT_STRING_ARRAY");
+}
+
+TEST_F(ValueTest, UnassignedComparison) {
+  Value v1, v2;
+  ASSERT_EQ(v1, v2);
+}
+
+TEST_F(ValueTest, MixedComparison) {
+  Value v1;
+  auto v2 = Value::MakeBoolean(true);
+  ASSERT_NE(v1, *v2);  // unassigned vs boolean
+  auto v3 = Value::MakeDouble(0.5);
+  ASSERT_NE(*v2, *v3);  // boolean vs double
+}
+
+TEST_F(ValueTest, BooleanComparison) {
+  auto v1 = Value::MakeBoolean(true);
+  auto v2 = Value::MakeBoolean(true);
+  ASSERT_EQ(*v1, *v2);
+  v2 = Value::MakeBoolean(false);
+  ASSERT_NE(*v1, *v2);
+}
+
+TEST_F(ValueTest, DoubleComparison) {
+  auto v1 = Value::MakeDouble(0.25);
+  auto v2 = Value::MakeDouble(0.25);
+  ASSERT_EQ(*v1, *v2);
+  v2 = Value::MakeDouble(0.5);
+  ASSERT_NE(*v1, *v2);
+}
+
+TEST_F(ValueTest, StringComparison) {
+  auto v1 = Value::MakeString("hello");
+  auto v2 = Value::MakeString("hello");
+  ASSERT_EQ(*v1, *v2);
+  v2 = Value::MakeString("world");  // different contents
+  ASSERT_NE(*v1, *v2);
+  v2 = Value::MakeString("goodbye");  // different size
+  ASSERT_NE(*v1, *v2);
+}
+
+TEST_F(ValueTest, BooleanArrayComparison) {
+  std::vector<int> vec{1, 0, 1};
+  auto v1 = Value::MakeBooleanArray(vec);
+  auto v2 = Value::MakeBooleanArray(vec);
+  ASSERT_EQ(*v1, *v2);
+
+  // different contents
+  vec = {1, 1, 1};
+  v2 = Value::MakeBooleanArray(vec);
+  ASSERT_NE(*v1, *v2);
+
+  // different size
+  vec = {1, 0};
+  v2 = Value::MakeBooleanArray(vec);
+  ASSERT_NE(*v1, *v2);
+}
+
+TEST_F(ValueTest, DoubleArrayComparison) {
+  std::vector<double> vec{0.5, 0.25, 0.5};
+  auto v1 = Value::MakeDoubleArray(vec);
+  auto v2 = Value::MakeDoubleArray(vec);
+  ASSERT_EQ(*v1, *v2);
+
+  // different contents
+  vec = {0.5, 0.5, 0.5};
+  v2 = Value::MakeDoubleArray(vec);
+  ASSERT_NE(*v1, *v2);
+
+  // different size
+  vec = {0.5, 0.25};
+  v2 = Value::MakeDoubleArray(vec);
+  ASSERT_NE(*v1, *v2);
+}
+
+TEST_F(ValueTest, StringArrayComparison) {
+  std::vector<std::string> vec;
+  vec.push_back("hello");
+  vec.push_back("goodbye");
+  vec.push_back("string");
+  auto v1 = Value::MakeStringArray(vec);
+  vec.clear();
+  vec.push_back("hello");
+  vec.push_back("goodbye");
+  vec.push_back("string");
+  auto v2 = Value::MakeStringArray(std::move(vec));
+  ASSERT_EQ(*v1, *v2);
+
+  // different contents
+  vec.clear();
+  vec.push_back("hello");
+  vec.push_back("goodby2");
+  vec.push_back("string");
+  v2 = Value::MakeStringArray(std::move(vec));
+  ASSERT_NE(*v1, *v2);
+
+  // different sized contents
+  vec.clear();
+  vec.push_back("hello");
+  vec.push_back("goodbye2");
+  vec.push_back("string");
+  v2 = Value::MakeStringArray(vec);
+  ASSERT_NE(*v1, *v2);
+
+  // different size
+  vec.clear();
+  vec.push_back("hello");
+  vec.push_back("goodbye");
+  v2 = Value::MakeStringArray(std::move(vec));
+  ASSERT_NE(*v1, *v2);
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/WireDecoderTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/WireDecoderTest.cpp
new file mode 100644
index 0000000..5ac9a72
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/WireDecoderTest.cpp
@@ -0,0 +1,643 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <stdint.h>
+
+#include <cfloat>
+#include <climits>
+#include <string>
+
+#include <llvm/StringRef.h>
+
+#include "TestPrinters.h"
+#include "WireDecoder.h"
+#include "gtest/gtest.h"
+
+namespace nt {
+
+class WireDecoderTest : public ::testing::Test {
+ protected:
+  WireDecoderTest() {
+    v_boolean = Value::MakeBoolean(true);
+    v_double = Value::MakeDouble(1.0);
+    v_string = Value::MakeString(llvm::StringRef("hello"));
+    v_raw = Value::MakeRaw(llvm::StringRef("hello"));
+    v_boolean_array = Value::MakeBooleanArray(std::vector<int>{0, 1, 0});
+    v_boolean_array_big = Value::MakeBooleanArray(std::vector<int>(255));
+    v_double_array = Value::MakeDoubleArray(std::vector<double>{0.5, 0.25});
+    v_double_array_big = Value::MakeDoubleArray(std::vector<double>(255));
+
+    std::vector<std::string> sa;
+    sa.push_back("hello");
+    sa.push_back("goodbye");
+    v_string_array = Value::MakeStringArray(std::move(sa));
+
+    sa.clear();
+    for (int i = 0; i < 255; ++i) sa.push_back("h");
+    v_string_array_big = Value::MakeStringArray(std::move(sa));
+
+    s_normal = std::string("hello");
+
+    s_long.clear();
+    s_long.append(127, '*');
+    s_long.push_back('x');
+
+    s_big2.clear();
+    s_big2.append(65534, '*');
+    s_big2.push_back('x');
+
+    s_big3.clear();
+    s_big3.append(65534, '*');
+    s_big3.append(3, 'x');
+  }
+
+  std::shared_ptr<Value> v_boolean, v_double, v_string, v_raw;
+  std::shared_ptr<Value> v_boolean_array, v_boolean_array_big;
+  std::shared_ptr<Value> v_double_array, v_double_array_big;
+  std::shared_ptr<Value> v_string_array, v_string_array_big;
+
+  std::string s_normal, s_long, s_big2, s_big3;
+};
+
+TEST_F(WireDecoderTest, Construct) {
+  wpi::raw_mem_istream is("", 0);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  EXPECT_EQ(nullptr, d.error());
+  EXPECT_EQ(0x0300u, d.proto_rev());
+}
+
+TEST_F(WireDecoderTest, SetProtoRev) {
+  wpi::raw_mem_istream is("", 0);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  d.set_proto_rev(0x0200u);
+  EXPECT_EQ(0x0200u, d.proto_rev());
+}
+
+TEST_F(WireDecoderTest, Read8) {
+  wpi::raw_mem_istream is("\x05\x01\x00", 3);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  unsigned int val;
+  ASSERT_TRUE(d.Read8(&val));
+  EXPECT_EQ(5u, val);
+  ASSERT_TRUE(d.Read8(&val));
+  EXPECT_EQ(1u, val);
+  ASSERT_TRUE(d.Read8(&val));
+  EXPECT_EQ(0u, val);
+  ASSERT_FALSE(d.Read8(&val));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, Read16) {
+  wpi::raw_mem_istream is("\x00\x05\x00\x01\x45\x67\x00\x00", 8);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  unsigned int val;
+  ASSERT_TRUE(d.Read16(&val));
+  EXPECT_EQ(5u, val);
+  ASSERT_TRUE(d.Read16(&val));
+  EXPECT_EQ(1u, val);
+  ASSERT_TRUE(d.Read16(&val));
+  EXPECT_EQ(0x4567u, val);
+  ASSERT_TRUE(d.Read16(&val));
+  EXPECT_EQ(0u, val);
+  ASSERT_FALSE(d.Read16(&val));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, Read32) {
+  wpi::raw_mem_istream is(
+      "\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\xab\xcd"
+      "\x12\x34\x56\x78\x00\x00\x00\x00",
+      20);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  uint32_t val;
+  ASSERT_TRUE(d.Read32(&val));
+  EXPECT_EQ(5ul, val);
+  ASSERT_TRUE(d.Read32(&val));
+  EXPECT_EQ(1ul, val);
+  ASSERT_TRUE(d.Read32(&val));
+  EXPECT_EQ(0xabcdul, val);
+  ASSERT_TRUE(d.Read32(&val));
+  EXPECT_EQ(0x12345678ul, val);
+  ASSERT_TRUE(d.Read32(&val));
+  EXPECT_EQ(0ul, val);
+  ASSERT_FALSE(d.Read32(&val));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDouble) {
+  // values except min and max from
+  // http://www.binaryconvert.com/result_double.html
+  wpi::raw_mem_istream is(
+      "\x00\x00\x00\x00\x00\x00\x00\x00"
+      "\x41\x0c\x13\x80\x00\x00\x00\x00"
+      "\x7f\xf0\x00\x00\x00\x00\x00\x00"
+      "\x00\x10\x00\x00\x00\x00\x00\x00"
+      "\x7f\xef\xff\xff\xff\xff\xff\xff",
+      40);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  double val;
+  ASSERT_TRUE(d.ReadDouble(&val));
+  EXPECT_EQ(0.0, val);
+  ASSERT_TRUE(d.ReadDouble(&val));
+  EXPECT_EQ(2.3e5, val);
+  ASSERT_TRUE(d.ReadDouble(&val));
+  EXPECT_EQ(std::numeric_limits<double>::infinity(), val);
+  ASSERT_TRUE(d.ReadDouble(&val));
+  EXPECT_EQ(DBL_MIN, val);
+  ASSERT_TRUE(d.ReadDouble(&val));
+  EXPECT_EQ(DBL_MAX, val);
+  ASSERT_FALSE(d.ReadDouble(&val));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadUleb128) {
+  wpi::raw_mem_istream is("\x00\x7f\x80\x01\x80", 5);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  uint64_t val;
+  ASSERT_TRUE(d.ReadUleb128(&val));
+  EXPECT_EQ(0ul, val);
+  ASSERT_TRUE(d.ReadUleb128(&val));
+  EXPECT_EQ(0x7ful, val);
+  ASSERT_TRUE(d.ReadUleb128(&val));
+  EXPECT_EQ(0x80ul, val);
+  ASSERT_FALSE(d.ReadUleb128(&val));  // partial
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadType) {
+  wpi::raw_mem_istream is("\x00\x01\x02\x03\x10\x11\x12\x20", 8);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  NT_Type val;
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_BOOLEAN, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_DOUBLE, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_STRING, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_RAW, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_BOOLEAN_ARRAY, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_DOUBLE_ARRAY, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_STRING_ARRAY, val);
+  ASSERT_TRUE(d.ReadType(&val));
+  EXPECT_EQ(NT_RPC, val);
+  ASSERT_FALSE(d.ReadType(&val));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadTypeError) {
+  wpi::raw_mem_istream is("\x30", 1);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  NT_Type val;
+  ASSERT_FALSE(d.ReadType(&val));
+  EXPECT_EQ(NT_UNASSIGNED, val);
+  ASSERT_NE(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, Reset) {
+  wpi::raw_mem_istream is("\x30", 1);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  NT_Type val;
+  ASSERT_FALSE(d.ReadType(&val));
+  EXPECT_EQ(NT_UNASSIGNED, val);
+  ASSERT_NE(nullptr, d.error());
+  d.Reset();
+  EXPECT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadBooleanValue2) {
+  wpi::raw_mem_istream is("\x01\x00", 2);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_BOOLEAN);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean, *val);
+
+  auto v_false = Value::MakeBoolean(false);
+  val = d.ReadValue(NT_BOOLEAN);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_false, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_BOOLEAN));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDoubleValue2) {
+  wpi::raw_mem_istream is(
+      "\x3f\xf0\x00\x00\x00\x00\x00\x00"
+      "\x3f\xf0\x00\x00\x00\x00\x00\x00",
+      16);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_DOUBLE);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double, *val);
+
+  val = d.ReadValue(NT_DOUBLE);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_DOUBLE));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadStringValue2) {
+  wpi::raw_mem_istream is(
+      "\x00\x05hello\x00\x03"
+      "bye\x55",
+      13);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_STRING);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_string, *val);
+
+  auto v_bye = Value::MakeString(llvm::StringRef("bye"));
+  val = d.ReadValue(NT_STRING);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_bye, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_STRING));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadBooleanArrayValue2) {
+  wpi::raw_mem_istream is("\x03\x00\x01\x00\x02\x01\x00\xff", 8);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_BOOLEAN_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean_array, *val);
+
+  auto v_boolean_array2 = Value::MakeBooleanArray(std::vector<int>{1, 0});
+  val = d.ReadValue(NT_BOOLEAN_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean_array2, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_BOOLEAN_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadBooleanArrayBigValue2) {
+  std::string s;
+  s.push_back('\xff');
+  s.append(255, '\x00');
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_BOOLEAN_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean_array_big, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_BOOLEAN_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDoubleArrayValue2) {
+  wpi::raw_mem_istream is(
+      "\x02\x3f\xe0\x00\x00\x00\x00\x00\x00"
+      "\x3f\xd0\x00\x00\x00\x00\x00\x00\x55",
+      18);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_DOUBLE_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double_array, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_DOUBLE_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDoubleArrayBigValue2) {
+  std::string s;
+  s.push_back('\xff');
+  s.append(255 * 8, '\x00');
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_DOUBLE_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double_array_big, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_DOUBLE_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadStringArrayValue2) {
+  wpi::raw_mem_istream is("\x02\x00\x05hello\x00\x07goodbye\x55", 18);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_STRING_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_string_array, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_STRING_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadStringArrayBigValue2) {
+  std::string s;
+  s.push_back('\xff');
+  for (int i = 0; i < 255; ++i) s.append("\x00\x01h", 3);
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  auto val = d.ReadValue(NT_STRING_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_string_array_big, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_STRING_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadValueError2) {
+  wpi::raw_mem_istream is("", 0);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  ASSERT_FALSE(d.ReadValue(NT_UNASSIGNED));  // unassigned
+  ASSERT_NE(nullptr, d.error());
+
+  d.Reset();
+  ASSERT_FALSE(d.ReadValue(NT_RAW));  // not supported
+  ASSERT_NE(nullptr, d.error());
+
+  d.Reset();
+  ASSERT_FALSE(d.ReadValue(NT_RPC));  // not supported
+  ASSERT_NE(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadBooleanValue3) {
+  wpi::raw_mem_istream is("\x01\x00", 2);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_BOOLEAN);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean, *val);
+
+  auto v_false = Value::MakeBoolean(false);
+  val = d.ReadValue(NT_BOOLEAN);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_false, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_BOOLEAN));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDoubleValue3) {
+  wpi::raw_mem_istream is(
+      "\x3f\xf0\x00\x00\x00\x00\x00\x00"
+      "\x3f\xf0\x00\x00\x00\x00\x00\x00",
+      16);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_DOUBLE);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double, *val);
+
+  val = d.ReadValue(NT_DOUBLE);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_DOUBLE));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadStringValue3) {
+  wpi::raw_mem_istream is(
+      "\x05hello\x03"
+      "bye\x55",
+      11);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_STRING);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_string, *val);
+
+  auto v_bye = Value::MakeString(llvm::StringRef("bye"));
+  val = d.ReadValue(NT_STRING);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_bye, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_STRING));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadRawValue3) {
+  wpi::raw_mem_istream is(
+      "\x05hello\x03"
+      "bye\x55",
+      11);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_RAW);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_raw, *val);
+
+  auto v_bye = Value::MakeRaw(llvm::StringRef("bye"));
+  val = d.ReadValue(NT_RAW);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_bye, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_RAW));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadBooleanArrayValue3) {
+  wpi::raw_mem_istream is("\x03\x00\x01\x00\x02\x01\x00\xff", 8);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_BOOLEAN_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean_array, *val);
+
+  auto v_boolean_array2 = Value::MakeBooleanArray(std::vector<int>{1, 0});
+  val = d.ReadValue(NT_BOOLEAN_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean_array2, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_BOOLEAN_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadBooleanArrayBigValue3) {
+  std::string s;
+  s.push_back('\xff');
+  s.append(255, '\x00');
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_BOOLEAN_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_boolean_array_big, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_BOOLEAN_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDoubleArrayValue3) {
+  wpi::raw_mem_istream is(
+      "\x02\x3f\xe0\x00\x00\x00\x00\x00\x00"
+      "\x3f\xd0\x00\x00\x00\x00\x00\x00\x55",
+      18);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_DOUBLE_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double_array, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_DOUBLE_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadDoubleArrayBigValue3) {
+  std::string s;
+  s.push_back('\xff');
+  s.append(255 * 8, '\x00');
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_DOUBLE_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_double_array_big, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_DOUBLE_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadStringArrayValue3) {
+  wpi::raw_mem_istream is("\x02\x05hello\x07goodbye\x55", 16);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_STRING_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_string_array, *val);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadValue(NT_STRING_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadStringArrayBigValue3) {
+  std::string s;
+  s.push_back('\xff');
+  for (int i = 0; i < 255; ++i) s.append("\x01h", 2);
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  auto val = d.ReadValue(NT_STRING_ARRAY);
+  ASSERT_TRUE(static_cast<bool>(val));
+  EXPECT_EQ(*v_string_array_big, *val);
+
+  ASSERT_FALSE(d.ReadValue(NT_STRING_ARRAY));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadValueError3) {
+  wpi::raw_mem_istream is("", 0);
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  ASSERT_FALSE(d.ReadValue(NT_UNASSIGNED));  // unassigned
+  ASSERT_NE(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadString2) {
+  std::string s;
+  s.append("\x00\x05", 2);
+  s += s_normal;
+  s.append("\x00\x80", 2);
+  s += s_long;
+  s.append("\xff\xff", 2);
+  s += s_big2;
+  s.push_back('\x55');
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0200u, logger);
+  std::string outs;
+  ASSERT_TRUE(d.ReadString(&outs));
+  EXPECT_EQ(s_normal, outs);
+  ASSERT_TRUE(d.ReadString(&outs));
+  EXPECT_EQ(s_long, outs);
+  ASSERT_TRUE(d.ReadString(&outs));
+  EXPECT_EQ(s_big2, outs);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadString(&outs));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+TEST_F(WireDecoderTest, ReadString3) {
+  std::string s;
+  s.push_back('\x05');
+  s += s_normal;
+  s.append("\x80\x01", 2);
+  s += s_long;
+  s.append("\x81\x80\x04", 3);
+  s += s_big3;
+  s.push_back('\x55');
+  wpi::raw_mem_istream is(s.data(), s.size());
+  wpi::Logger logger;
+  WireDecoder d(is, 0x0300u, logger);
+  std::string outs;
+  ASSERT_TRUE(d.ReadString(&outs));
+  EXPECT_EQ(s_normal, outs);
+  ASSERT_TRUE(d.ReadString(&outs));
+  EXPECT_EQ(s_long, outs);
+  ASSERT_TRUE(d.ReadString(&outs));
+  EXPECT_EQ(s_big3, outs);
+
+  unsigned int b;
+  ASSERT_TRUE(d.Read8(&b));
+  EXPECT_EQ(0x55u, b);
+
+  ASSERT_FALSE(d.ReadString(&outs));
+  ASSERT_EQ(nullptr, d.error());
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/WireEncoderTest.cpp b/third_party/ntcore_2018/src/test/native/cpp/WireEncoderTest.cpp
new file mode 100644
index 0000000..dd73b2e
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/WireEncoderTest.cpp
@@ -0,0 +1,498 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <cfloat>
+#include <climits>
+#include <string>
+
+#include <llvm/StringRef.h>
+
+#include "TestPrinters.h"
+#include "WireEncoder.h"
+#include "gtest/gtest.h"
+
+#define BUFSIZE 1024
+
+namespace nt {
+
+class WireEncoderTest : public ::testing::Test {
+ protected:
+  WireEncoderTest() {
+    v_empty = std::make_shared<Value>();
+    v_boolean = Value::MakeBoolean(true);
+    v_double = Value::MakeDouble(1.0);
+    v_string = Value::MakeString(llvm::StringRef("hello"));
+    v_raw = Value::MakeRaw(llvm::StringRef("hello"));
+    v_boolean_array = Value::MakeBooleanArray(std::vector<int>{0, 1, 0});
+    v_boolean_array_big = Value::MakeBooleanArray(std::vector<int>(256));
+    v_double_array = Value::MakeDoubleArray(std::vector<double>{0.5, 0.25});
+    v_double_array_big = Value::MakeDoubleArray(std::vector<double>(256));
+
+    std::vector<std::string> sa;
+    sa.push_back("hello");
+    sa.push_back("goodbye");
+    v_string_array = Value::MakeStringArray(std::move(sa));
+
+    sa.clear();
+    for (int i = 0; i < 256; ++i) sa.push_back("h");
+    v_string_array_big = Value::MakeStringArray(std::move(sa));
+
+    s_normal = "hello";
+
+    s_long.clear();
+    s_long.append(127, '*');
+    s_long.push_back('x');
+
+    s_big.clear();
+    s_big.append(65534, '*');
+    s_big.append(3, 'x');
+  }
+
+  std::shared_ptr<Value> v_empty;
+  std::shared_ptr<Value> v_boolean, v_double, v_string, v_raw;
+  std::shared_ptr<Value> v_boolean_array, v_boolean_array_big;
+  std::shared_ptr<Value> v_double_array, v_double_array_big;
+  std::shared_ptr<Value> v_string_array, v_string_array_big;
+
+  std::string s_normal, s_long, s_big;
+};
+
+TEST_F(WireEncoderTest, Construct) {
+  WireEncoder e(0x0300u);
+  EXPECT_EQ(0u, e.size());
+  EXPECT_EQ(nullptr, e.error());
+  EXPECT_EQ(0x0300u, e.proto_rev());
+}
+
+TEST_F(WireEncoderTest, SetProtoRev) {
+  WireEncoder e(0x0300u);
+  e.set_proto_rev(0x0200u);
+  EXPECT_EQ(0x0200u, e.proto_rev());
+}
+
+TEST_F(WireEncoderTest, Write8) {
+  size_t off = BUFSIZE - 1;
+  WireEncoder e(0x0300u);
+  for (size_t i = 0; i < off; ++i) e.Write8(0u);  // test across Reserve()
+  e.Write8(5u);
+  e.Write8(0x101u);  // should be truncated
+  e.Write8(0u);
+  ASSERT_EQ(3u, e.size() - off);
+  ASSERT_EQ(llvm::StringRef("\x05\x01\x00", 3),
+            llvm::StringRef(e.data(), e.size()).substr(off));
+}
+
+TEST_F(WireEncoderTest, Write16) {
+  size_t off = BUFSIZE - 2;
+  WireEncoder e(0x0300u);
+  for (size_t i = 0; i < off; ++i) e.Write8(0u);  // test across Reserve()
+  e.Write16(5u);
+  e.Write16(0x10001u);  // should be truncated
+  e.Write16(0x4567u);
+  e.Write16(0u);
+  ASSERT_EQ(8u, e.size() - off);
+  ASSERT_EQ(llvm::StringRef("\x00\x05\x00\x01\x45\x67\x00\x00", 8),
+            llvm::StringRef(e.data(), e.size()).substr(off));
+}
+
+TEST_F(WireEncoderTest, Write32) {
+  size_t off = BUFSIZE - 4;
+  WireEncoder e(0x0300u);
+  for (size_t i = 0; i < off; ++i) e.Write8(0u);  // test across Reserve()
+  e.Write32(5ul);
+  e.Write32(1ul);
+  e.Write32(0xabcdul);
+  e.Write32(0x12345678ul);
+  e.Write32(0ul);
+  ASSERT_EQ(20u, e.size() - off);
+  ASSERT_EQ(llvm::StringRef("\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\xab\xcd"
+                            "\x12\x34\x56\x78\x00\x00\x00\x00",
+                            20),
+            llvm::StringRef(e.data(), e.size()).substr(off));
+}
+
+TEST_F(WireEncoderTest, WriteDouble) {
+  size_t off = BUFSIZE - 8;
+  WireEncoder e(0x0300u);
+  for (size_t i = 0; i < off; ++i) e.Write8(0u);  // test across Reserve()
+  e.WriteDouble(0.0);
+  e.WriteDouble(2.3e5);
+  e.WriteDouble(std::numeric_limits<double>::infinity());
+  e.WriteDouble(DBL_MIN);
+  e.WriteDouble(DBL_MAX);
+  ASSERT_EQ(40u, e.size() - off);
+  // golden values except min and max from
+  // http://www.binaryconvert.com/result_double.html
+  ASSERT_EQ(llvm::StringRef("\x00\x00\x00\x00\x00\x00\x00\x00"
+                            "\x41\x0c\x13\x80\x00\x00\x00\x00"
+                            "\x7f\xf0\x00\x00\x00\x00\x00\x00"
+                            "\x00\x10\x00\x00\x00\x00\x00\x00"
+                            "\x7f\xef\xff\xff\xff\xff\xff\xff",
+                            40),
+            llvm::StringRef(e.data(), e.size()).substr(off));
+}
+
+TEST_F(WireEncoderTest, WriteUleb128) {
+  size_t off = BUFSIZE - 2;
+  WireEncoder e(0x0300u);
+  for (size_t i = 0; i < off; ++i) e.Write8(0u);  // test across Reserve()
+  e.WriteUleb128(0ul);
+  e.WriteUleb128(0x7ful);
+  e.WriteUleb128(0x80ul);
+  ASSERT_EQ(4u, e.size() - off);
+  ASSERT_EQ(llvm::StringRef("\x00\x7f\x80\x01", 4),
+            llvm::StringRef(e.data(), e.size()).substr(off));
+}
+
+TEST_F(WireEncoderTest, WriteType) {
+  size_t off = BUFSIZE - 1;
+  WireEncoder e(0x0300u);
+  for (size_t i = 0; i < off; ++i) e.Write8(0u);  // test across Reserve()
+  e.WriteType(NT_BOOLEAN);
+  e.WriteType(NT_DOUBLE);
+  e.WriteType(NT_STRING);
+  e.WriteType(NT_RAW);
+  e.WriteType(NT_BOOLEAN_ARRAY);
+  e.WriteType(NT_DOUBLE_ARRAY);
+  e.WriteType(NT_STRING_ARRAY);
+  e.WriteType(NT_RPC);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(8u, e.size() - off);
+  ASSERT_EQ(llvm::StringRef("\x00\x01\x02\x03\x10\x11\x12\x20", 8),
+            llvm::StringRef(e.data(), e.size()).substr(off));
+}
+
+TEST_F(WireEncoderTest, WriteTypeError) {
+  WireEncoder e(0x0200u);
+  e.WriteType(NT_UNASSIGNED);
+  EXPECT_EQ(0u, e.size());
+  EXPECT_EQ(std::string("unrecognized type"), e.error());
+
+  e.Reset();
+  e.WriteType(NT_RAW);
+  EXPECT_EQ(0u, e.size());
+  EXPECT_EQ(std::string("raw type not supported in protocol < 3.0"), e.error());
+
+  e.Reset();
+  e.WriteType(NT_RPC);
+  EXPECT_EQ(0u, e.size());
+  EXPECT_EQ(std::string("RPC type not supported in protocol < 3.0"), e.error());
+}
+
+TEST_F(WireEncoderTest, Reset) {
+  WireEncoder e(0x0300u);
+  e.WriteType(NT_UNASSIGNED);
+  EXPECT_NE(nullptr, e.error());
+  e.Reset();
+  EXPECT_EQ(nullptr, e.error());
+
+  e.Write8(0u);
+  EXPECT_EQ(1u, e.size());
+  e.Reset();
+  EXPECT_EQ(0u, e.size());
+}
+
+TEST_F(WireEncoderTest, GetValueSize2) {
+  WireEncoder e(0x0200u);
+  EXPECT_EQ(0u, e.GetValueSize(*v_empty));  // empty
+  EXPECT_EQ(1u, e.GetValueSize(*v_boolean));
+  EXPECT_EQ(8u, e.GetValueSize(*v_double));
+  EXPECT_EQ(7u, e.GetValueSize(*v_string));
+  EXPECT_EQ(0u, e.GetValueSize(*v_raw));  // not supported
+
+  EXPECT_EQ(1u + 3u, e.GetValueSize(*v_boolean_array));
+  // truncated
+  EXPECT_EQ(1u + 255u, e.GetValueSize(*v_boolean_array_big));
+
+  EXPECT_EQ(1u + 2u * 8u, e.GetValueSize(*v_double_array));
+  // truncated
+  EXPECT_EQ(1u + 255u * 8u, e.GetValueSize(*v_double_array_big));
+
+  EXPECT_EQ(1u + 7u + 9u, e.GetValueSize(*v_string_array));
+  // truncated
+  EXPECT_EQ(1u + 255u * 3u, e.GetValueSize(*v_string_array_big));
+}
+
+TEST_F(WireEncoderTest, WriteBooleanValue2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_boolean);
+  auto v_false = Value::MakeBoolean(false);
+  e.WriteValue(*v_false);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(2u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x01\x00", 2),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteDoubleValue2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_double);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x3f\xf0\x00\x00\x00\x00\x00\x00", 8),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteStringValue2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_string);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(7u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x00\x05hello", 7),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteBooleanArrayValue2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_boolean_array);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 3u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x03\x00\x01\x00", 4),
+            llvm::StringRef(e.data(), e.size()));
+
+  // truncated
+  e.Reset();
+  e.WriteValue(*v_boolean_array_big);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 255u, e.size());
+  ASSERT_EQ(llvm::StringRef("\xff\x00", 2), llvm::StringRef(e.data(), 2));
+}
+
+TEST_F(WireEncoderTest, WriteDoubleArrayValue2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_double_array);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 2u * 8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x02\x3f\xe0\x00\x00\x00\x00\x00\x00"
+                            "\x3f\xd0\x00\x00\x00\x00\x00\x00",
+                            17),
+            llvm::StringRef(e.data(), e.size()));
+
+  // truncated
+  e.Reset();
+  e.WriteValue(*v_double_array_big);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 255u * 8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\xff\x00", 2), llvm::StringRef(e.data(), 2));
+}
+
+TEST_F(WireEncoderTest, WriteStringArrayValue2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_string_array);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 7u + 9u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x02\x00\x05hello\x00\x07goodbye", 17),
+            llvm::StringRef(e.data(), e.size()));
+
+  // truncated
+  e.Reset();
+  e.WriteValue(*v_string_array_big);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 255u * 3u, e.size());
+  ASSERT_EQ(llvm::StringRef("\xff\x00\x01", 3), llvm::StringRef(e.data(), 3));
+}
+
+TEST_F(WireEncoderTest, WriteValueError2) {
+  WireEncoder e(0x0200u);
+  e.WriteValue(*v_empty);  // empty
+  ASSERT_EQ(0u, e.size());
+  ASSERT_NE(nullptr, e.error());
+
+  e.Reset();
+  e.WriteValue(*v_raw);  // not supported
+  ASSERT_EQ(0u, e.size());
+  ASSERT_NE(nullptr, e.error());
+}
+
+TEST_F(WireEncoderTest, GetValueSize3) {
+  WireEncoder e(0x0300u);
+  EXPECT_EQ(0u, e.GetValueSize(*v_empty));  // empty
+  EXPECT_EQ(1u, e.GetValueSize(*v_boolean));
+  EXPECT_EQ(8u, e.GetValueSize(*v_double));
+  EXPECT_EQ(6u, e.GetValueSize(*v_string));
+  EXPECT_EQ(6u, e.GetValueSize(*v_raw));
+
+  EXPECT_EQ(1u + 3u, e.GetValueSize(*v_boolean_array));
+  // truncated
+  EXPECT_EQ(1u + 255u, e.GetValueSize(*v_boolean_array_big));
+
+  EXPECT_EQ(1u + 2u * 8u, e.GetValueSize(*v_double_array));
+  // truncated
+  EXPECT_EQ(1u + 255u * 8u, e.GetValueSize(*v_double_array_big));
+
+  EXPECT_EQ(1u + 6u + 8u, e.GetValueSize(*v_string_array));
+  // truncated
+  EXPECT_EQ(1u + 255u * 2u, e.GetValueSize(*v_string_array_big));
+}
+
+TEST_F(WireEncoderTest, WriteBooleanValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_boolean);
+  auto v_false = Value::MakeBoolean(false);
+  e.WriteValue(*v_false);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(2u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x01\x00", 2),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteDoubleValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_double);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x3f\xf0\x00\x00\x00\x00\x00\x00", 8),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteStringValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_string);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(6u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x05hello", 6),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteRawValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_raw);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(6u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x05hello", 6),
+            llvm::StringRef(e.data(), e.size()));
+}
+
+TEST_F(WireEncoderTest, WriteBooleanArrayValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_boolean_array);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 3u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x03\x00\x01\x00", 4),
+            llvm::StringRef(e.data(), e.size()));
+
+  // truncated
+  e.Reset();
+  e.WriteValue(*v_boolean_array_big);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 255u, e.size());
+  ASSERT_EQ(llvm::StringRef("\xff\x00", 2), llvm::StringRef(e.data(), 2));
+}
+
+TEST_F(WireEncoderTest, WriteDoubleArrayValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_double_array);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 2u * 8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x02\x3f\xe0\x00\x00\x00\x00\x00\x00"
+                            "\x3f\xd0\x00\x00\x00\x00\x00\x00",
+                            17),
+            llvm::StringRef(e.data(), e.size()));
+
+  // truncated
+  e.Reset();
+  e.WriteValue(*v_double_array_big);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 255u * 8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\xff\x00", 2), llvm::StringRef(e.data(), 2));
+}
+
+TEST_F(WireEncoderTest, WriteStringArrayValue3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_string_array);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 6u + 8u, e.size());
+  ASSERT_EQ(llvm::StringRef("\x02\x05hello\x07goodbye", 15),
+            llvm::StringRef(e.data(), e.size()));
+
+  // truncated
+  e.Reset();
+  e.WriteValue(*v_string_array_big);
+  ASSERT_EQ(nullptr, e.error());
+  ASSERT_EQ(1u + 255u * 2u, e.size());
+  ASSERT_EQ(llvm::StringRef("\xff\x01", 2), llvm::StringRef(e.data(), 2));
+}
+
+TEST_F(WireEncoderTest, WriteValueError3) {
+  WireEncoder e(0x0300u);
+  e.WriteValue(*v_empty);  // empty
+  ASSERT_EQ(0u, e.size());
+  ASSERT_NE(nullptr, e.error());
+}
+
+TEST_F(WireEncoderTest, GetStringSize2) {
+  // 2-byte length
+  WireEncoder e(0x0200u);
+  EXPECT_EQ(7u, e.GetStringSize(s_normal));
+  EXPECT_EQ(130u, e.GetStringSize(s_long));
+  // truncated
+  EXPECT_EQ(65537u, e.GetStringSize(s_big));
+}
+
+TEST_F(WireEncoderTest, WriteString2) {
+  WireEncoder e(0x0200u);
+  e.WriteString(s_normal);
+  EXPECT_EQ(nullptr, e.error());
+  EXPECT_EQ(7u, e.size());
+  EXPECT_EQ(llvm::StringRef("\x00\x05hello", 7),
+            llvm::StringRef(e.data(), e.size()));
+
+  e.Reset();
+  e.WriteString(s_long);
+  EXPECT_EQ(nullptr, e.error());
+  ASSERT_EQ(130u, e.size());
+  EXPECT_EQ(llvm::StringRef("\x00\x80**", 4), llvm::StringRef(e.data(), 4));
+  EXPECT_EQ('*', e.data()[128]);
+  EXPECT_EQ('x', e.data()[129]);
+
+  // truncated
+  e.Reset();
+  e.WriteString(s_big);
+  EXPECT_EQ(nullptr, e.error());
+  ASSERT_EQ(65537u, e.size());
+  EXPECT_EQ(llvm::StringRef("\xff\xff**", 4), llvm::StringRef(e.data(), 4));
+  EXPECT_EQ('*', e.data()[65535]);
+  EXPECT_EQ('x', e.data()[65536]);
+}
+
+TEST_F(WireEncoderTest, GetStringSize3) {
+  // leb128-encoded length
+  WireEncoder e(0x0300u);
+  EXPECT_EQ(6u, e.GetStringSize(s_normal));
+  EXPECT_EQ(130u, e.GetStringSize(s_long));
+  EXPECT_EQ(65540u, e.GetStringSize(s_big));
+}
+
+TEST_F(WireEncoderTest, WriteString3) {
+  WireEncoder e(0x0300u);
+  e.WriteString(s_normal);
+  EXPECT_EQ(nullptr, e.error());
+  EXPECT_EQ(6u, e.size());
+  EXPECT_EQ(llvm::StringRef("\x05hello", 6),
+            llvm::StringRef(e.data(), e.size()));
+
+  e.Reset();
+  e.WriteString(s_long);
+  EXPECT_EQ(nullptr, e.error());
+  ASSERT_EQ(130u, e.size());
+  EXPECT_EQ(llvm::StringRef("\x80\x01**", 4), llvm::StringRef(e.data(), 4));
+  EXPECT_EQ('*', e.data()[128]);
+  EXPECT_EQ('x', e.data()[129]);
+
+  // NOT truncated
+  e.Reset();
+  e.WriteString(s_big);
+  EXPECT_EQ(nullptr, e.error());
+  ASSERT_EQ(65540u, e.size());
+  EXPECT_EQ(llvm::StringRef("\x81\x80\x04*", 4), llvm::StringRef(e.data(), 4));
+  EXPECT_EQ('*', e.data()[65536]);
+  EXPECT_EQ('x', e.data()[65537]);
+  EXPECT_EQ('x', e.data()[65538]);
+  EXPECT_EQ('x', e.data()[65539]);
+}
+
+}  // namespace nt
diff --git a/third_party/ntcore_2018/src/test/native/cpp/main.cpp b/third_party/ntcore_2018/src/test/native/cpp/main.cpp
new file mode 100644
index 0000000..146e217
--- /dev/null
+++ b/third_party/ntcore_2018/src/test/native/cpp/main.cpp
@@ -0,0 +1,23 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015-2018. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <climits>
+
+#include "gmock/gmock.h"
+#include "ntcore.h"
+
+int main(int argc, char** argv) {
+  nt::AddLogger(nt::GetDefaultInstance(),
+                [](const nt::LogMessage& msg) {
+                  std::fputs(msg.message.c_str(), stderr);
+                  std::fputc('\n', stderr);
+                },
+                0, UINT_MAX);
+  ::testing::InitGoogleMock(&argc, argv);
+  int ret = RUN_ALL_TESTS();
+  return ret;
+}
diff --git a/third_party/wpiutil_2018/.clang-format b/third_party/wpiutil_2018/.clang-format
new file mode 100644
index 0000000..92b4049
--- /dev/null
+++ b/third_party/wpiutil_2018/.clang-format
@@ -0,0 +1,107 @@
+---
+Language:        Cpp
+BasedOnStyle:  Google
+AccessModifierOffset: -1
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlines: Left
+AlignOperands:   true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: true
+AllowShortLoopsOnASingleLine: true
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: true
+AlwaysBreakTemplateDeclarations: true
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+  AfterClass:      false
+  AfterControlStatement: false
+  AfterEnum:       false
+  AfterFunction:   false
+  AfterNamespace:  false
+  AfterObjCDeclaration: false
+  AfterStruct:     false
+  AfterUnion:      false
+  BeforeCatch:     false
+  BeforeElse:      false
+  IndentBraces:    false
+  SplitEmptyFunction: true
+  SplitEmptyRecord: true
+  SplitEmptyNamespace: true
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeInheritanceComma: false
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+BreakConstructorInitializers: BeforeColon
+BreakAfterJavaFieldAnnotations: false
+BreakStringLiterals: true
+ColumnLimit:     80
+CommentPragmas:  '^ IWYU pragma:'
+CompactNamespaces: false
+ConstructorInitializerAllOnOneLineOrOnePerLine: true
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat:   false
+ExperimentalAutoDetectBinPacking: false
+FixNamespaceComments: true
+ForEachMacros:
+  - foreach
+  - Q_FOREACH
+  - BOOST_FOREACH
+IncludeCategories:
+  - Regex:           '^<.*\.h>'
+    Priority:        1
+  - Regex:           '^<.*'
+    Priority:        2
+  - Regex:           '.*'
+    Priority:        3
+IncludeIsMainRegex: '([-_](test|unittest))?$'
+IndentCaseLabels: true
+IndentWidth:     2
+IndentWrappedFunctionNames: false
+JavaScriptQuotes: Leave
+JavaScriptWrapImports: true
+KeepEmptyLinesAtTheStartOfBlocks: false
+MacroBlockBegin: ''
+MacroBlockEnd:   ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: false
+PenaltyBreakAssignment: 2
+PenaltyBreakBeforeFirstCallParameter: 1
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 200
+PointerAlignment: Left
+ReflowComments:  true
+SortIncludes:    false
+SortUsingDeclarations: true
+SpaceAfterCStyleCast: false
+SpaceAfterTemplateKeyword: true
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 2
+SpacesInAngles:  false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard:        Auto
+TabWidth:        8
+UseTab:          Never
+...
diff --git a/third_party/wpiutil_2018/.gitignore b/third_party/wpiutil_2018/.gitignore
new file mode 100644
index 0000000..bf89f4c
--- /dev/null
+++ b/third_party/wpiutil_2018/.gitignore
@@ -0,0 +1,228 @@
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+*.vcxproj
+*.sln
+*.vcxproj.filters
+
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+.vs/
+*.def
+!ntcore.def
+!ntcore-jni.def
+*.opensdf
+*.vcxproj
+*.vcxproj.user
+*.sdf
+*.sublime-project
+*.sublime-workspace
+
+# Compiled Java files
+*.class
+
+# Build directories
+/.gradle
+/build/
+!build.gradle
+/native
+/arm
+/gmock/build
+
+
+# Created by https://www.gitignore.io/api/intellij,eclipse,netbeans,java,gradle,c++,cmake
+
+### Intellij ###
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff:
+.idea/*
+
+## File-based project format:
+*.iws
+
+## Plugin-specific files:
+
+# IntelliJ
+/out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+### Intellij Patch ###
+# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
+
+# *.iml
+# modules.xml
+
+
+### Eclipse ###
+
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.settings/
+.loadpath
+.recommenders
+
+# Eclipse Core
+.project
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# PyDev specific (Python IDE for Eclipse)
+*.pydevproject
+
+# CDT-specific (C/C++ Development Tooling)
+.cproject
+
+# JDT-specific (Eclipse Java Development Tools)
+.classpath
+
+# Java annotation processor (APT)
+.factorypath
+
+# PDT-specific (PHP Development Tools)
+.buildpath
+
+# sbteclipse plugin
+.target
+
+# Tern plugin
+.tern-project
+
+# TeXlipse plugin
+.texlipse
+
+# STS (Spring Tool Suite)
+.springBeans
+
+# Code Recommenders
+.recommenders/
+
+
+### NetBeans ###
+nbproject/private/
+build/
+nbbuild/
+dist/
+nbdist/
+nbactions.xml
+.nb-gradle/
+
+
+### C++ ###
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+
+### CMake ###
+CMakeCache.txt
+CMakeFiles
+CMakeScripts
+Makefile
+cmake_install.cmake
+install_manifest.txt
+
+
+### Java ###
+*.class
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.ear
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+
+### Gradle ###
+.gradle
+build/
+
+# Ignore Gradle GUI config
+gradle-app.setting
+
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+
+# Cache of project
+.gradletasknamecache
+
+# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
+# gradle/wrapper/gradle-wrapper.properties
+
+#VSCode
+.vscode/
diff --git a/third_party/wpiutil_2018/.styleguide b/third_party/wpiutil_2018/.styleguide
new file mode 100644
index 0000000..f40ca70
--- /dev/null
+++ b/third_party/wpiutil_2018/.styleguide
@@ -0,0 +1,35 @@
+cppHeaderFileInclude {
+  \.h$
+  \.inc$
+}
+
+cppSrcFileInclude {
+  \.cpp$
+}
+
+generatedFileExclude {
+  gmock/
+  llvm/
+  src/main/native/cpp/support/json
+  src/main/native/include/support/json
+  src/test/native/cpp/json/
+}
+
+licenseUpdateExclude {
+  src/main/native/cpp/support/Base64\.cpp$
+  src/main/native/cpp/support/sha1\.cpp$
+  src/main/native/cpp/tcpsockets/TCPAcceptor\.cpp$
+  src/main/native/cpp/tcpsockets/TCPConnector\.cpp$
+  src/main/native/cpp/tcpsockets/TCPStream\.cpp$
+  src/main/native/include/support/ConcurrentQueue\.h$
+  src/main/native/include/support/sha1\.h$
+  src/main/native/include/tcpsockets/TCPAcceptor\.h$
+  src/main/native/include/tcpsockets/TCPConnector\.h$
+  src/main/native/include/tcpsockets/TCPStream\.h$
+}
+
+includeGuardRoots {
+  src/main/native/cpp/
+  src/main/native/include/
+  src/test/native/cpp/
+}
diff --git a/third_party/wpiutil_2018/.styleguide-license b/third_party/wpiutil_2018/.styleguide-license
new file mode 100644
index 0000000..b802370
--- /dev/null
+++ b/third_party/wpiutil_2018/.styleguide-license
@@ -0,0 +1,6 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) {year} FIRST. All Rights Reserved.{padding}*/
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
diff --git a/third_party/wpiutil_2018/.travis-scripts/install.sh b/third_party/wpiutil_2018/.travis-scripts/install.sh
new file mode 100755
index 0000000..7f4773b
--- /dev/null
+++ b/third_party/wpiutil_2018/.travis-scripts/install.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
+    # Install custom requirements on Linux
+    sudo sh -c 'echo "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-5.0 main" > /etc/apt/sources.list.d/llvm.list'
+    wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
+    sudo add-apt-repository ppa:wpilib/toolchain -y
+    sudo apt-get update -q
+    sudo apt-get install clang-format-5.0 frc-toolchain -y
+
+    wget https://bootstrap.pypa.io/get-pip.py
+    sudo python3.5 get-pip.py
+    python3.5 -m pip install --user wpiformat
+else
+    echo PATH=$PATH
+    brew update
+    brew install python3 clang-format
+    clang-format --version
+    echo PATH=$PATH
+
+    pip3 install --user wpiformat
+fi
diff --git a/third_party/wpiutil_2018/.travis-scripts/wpiformat.sh b/third_party/wpiutil_2018/.travis-scripts/wpiformat.sh
new file mode 100755
index 0000000..84aee9c
--- /dev/null
+++ b/third_party/wpiutil_2018/.travis-scripts/wpiformat.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
+    python3.5 -m wpiformat -y 2018 -clang 5.0
+else
+    python3 -m wpiformat -y 2018
+fi
+
+git --no-pager diff --exit-code HEAD  # Ensure formatter made no changes
diff --git a/third_party/wpiutil_2018/.travis.yml b/third_party/wpiutil_2018/.travis.yml
new file mode 100644
index 0000000..346230c
--- /dev/null
+++ b/third_party/wpiutil_2018/.travis.yml
@@ -0,0 +1,36 @@
+sudo: true

+language: java

+

+matrix:

+  include:

+    - os: linux

+      dist: trusty

+      sudo: required

+    - os: osx

+      osx_image: xcode8

+

+addons:

+  apt:

+    sources:

+      - deadsnakes

+    packages:

+      - g++-multilib

+      - lib32stdc++6

+      - python3.5

+

+before_install:

+  - .travis-scripts/install.sh

+

+install:

+  - ./gradlew assemble -PbuildAll

+

+script:

+  - .travis-scripts/wpiformat.sh

+  - ./gradlew build -PbuildAll

+

+before_cache:

+  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock

+cache:

+  directories:

+    - $HOME/.gradle/caches/

+    - $HOME/.gradle/wrapper/

diff --git a/third_party/wpiutil_2018/CONTRIBUTING.md b/third_party/wpiutil_2018/CONTRIBUTING.md
new file mode 100644
index 0000000..fc2203c
--- /dev/null
+++ b/third_party/wpiutil_2018/CONTRIBUTING.md
@@ -0,0 +1,53 @@
+# Contributing to wpiutil
+
+So you want to contribute your changes back to ntcore. Great! We have a few contributing rules that will help you make sure your changes will be accepted into the project. Please remember to follow the rules written here, and behave with Gracious Professionalism.
+
+- [General Contribution Rules](#general-contribution-rules)
+- [What to Contribute](#what-to-contribute)
+- [Coding Guidelines](#coding-guidelines)
+- [Submitting Changes](#submitting-changes)
+    - [Pull Request Format](#pull-request-format)
+    - [Merge Process](#merge-process)
+- [Licensing](#licensing)
+
+## General Contribution Rules
+
+- Everything in the library must work for the 3000+ teams that will be using it.
+- We need to be able to maintain submitted changes, even if you are no longer working on the project.
+- Excluding bug fixes, changes in one language generally need to have corresponding changes in other languages.
+    - Substantial changes often need to have corresponding LabVIEW changes. To do this, we will work with NI on these large changes.
+    - Protocol changes must be carefully considered. Please open issues for protocol enhancements so we can discuss first.
+- Changes should have tests.
+- Code should be well documented.
+    - This often involves ScreenSteps. To add content to ScreenSteps, we will work with you to get the appropriate articles written.
+
+## What to Contribute
+
+- Bug reports and fixes
+    - We will generally accept bug fixes without too much question. If they are only implemented for one language, we will implement them for any other necessary languages. Bug reports are also welcome, please submit them to our GitHub issue tracker.
+- While we do welcome improvements to the API, there are a few important rules to consider:
+    - Features must be added to both the C++ API and the Java API, with rare exceptions.
+    - During competition season, we will not merge any new feature additions. We want to ensure that the API is stable during the season to help minimize issues for teams.
+    - Ask about large changes before spending a bunch of time on them! You can create a new issue on our GitHub tracker for feature request/discussion and talk about it with us there.
+    - Features that make it easier for teams with less experience to be more successful are more likely to be accepted.
+    - Features in ntcore should be broadly applicable to all teams. Anything that is team specific should not be submitted.
+
+## Coding Guidelines
+
+ntcore uses Google style guides for both C++ and Java. Autoformatters are available for many popular editors at [https://github.com/google/styleguide]. An online version of the styleguide for [C++](https://google.github.io/styleguide/cppguide.html) and [Java](https://google.github.io/styleguide/javaguide.html) are also available.  Additionally, offline copies of the style guide can be found in the style guide directory of the repository.
+
+While the library should be fully formatted according to the styles, additional elements of the style guide were not followed when the library was initially created. All new code should follow the guidelines. If you are looking for some easy ramp-up tasks, finding areas that don't follow the style guide and fixing them is very welcome.
+
+## Submitting Changes
+
+### Pull Request Format
+
+Changes should be submitted as a Pull Request against the master branch of ntcore. For most changes, we ask that you squash your changes down to a single commit. For particularly large changes, multiple commits are ok, but assume one commit unless asked otherwise. No change will be merged unless it is up to date with the current master. We will also not merge any changes with merge commits in them; please rebase off of master before submitting a pull request. We do this to make sure that the git history isn't too cluttered.
+
+### Merge Process
+
+When you first submit changes, Travis-CI will attempt to run `./gradlew check` on your change. If this fails, you will need to fix any issues that it sees. Once Travis passes, we will begin the review process in more earnest. One or more WPILib team members will review your change. This will be a back-and-forth process with the WPILib team and the greater community. Once we are satisfied that your change is ready, we will allow our Jenkins instance to test it. This will run the full gamut of checks, including integration tests on actual hardware. Once all tests have passed and the team is satisfied, we will merge your change into the WPILib repository.
+
+## Licensing
+
+By contributing to ntcore, you agree that your code will be distributed with ntcore, and licensed under the license for the ntcore project. You should not contribute code that you do not have permission to relicense in this manner. This includes code that is licensed under the GPL that you do not have permission to relicense, as ntcore is not released under a copyleft license. Our license is the 3-clause BSD license, which you can find [here](license.txt).
diff --git a/third_party/wpiutil_2018/appveyor.yml b/third_party/wpiutil_2018/appveyor.yml
new file mode 100644
index 0000000..713c47d
--- /dev/null
+++ b/third_party/wpiutil_2018/appveyor.yml
@@ -0,0 +1,26 @@
+version: "{branch} {build}"

+

+image:

+- Visual Studio 2015

+

+build:

+  verbosity: detailed

+

+build_script:

+  - gradlew.bat assemble --info -PbuildAll

+

+test_script:

+- cmd: >-

+    SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0

+

+    gradlew.bat check --info -PbuildAll

+

+    SET JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0

+

+    gradlew.bat check --info -PbuildAll

+

+cache:

+  - C:\Users\appveyor\.gradle

+

+matrix:

+  fast_finish: true

diff --git a/third_party/wpiutil_2018/build.gradle b/third_party/wpiutil_2018/build.gradle
new file mode 100644
index 0000000..fe04288
--- /dev/null
+++ b/third_party/wpiutil_2018/build.gradle
@@ -0,0 +1,187 @@
+import edu.wpi.first.nativeutils.NativeUtils
+
+buildscript {
+    repositories {
+        mavenLocal()
+        maven {
+            url "https://plugins.gradle.org/m2/"
+        }
+    }
+    dependencies {
+        classpath 'gradle.plugin.edu.wpi.first:native-utils:1.5.1'
+        classpath 'gradle.plugin.edu.wpi.first.wpilib.versioning:wpilib-version-plugin:2.0'
+    }
+}
+
+ext.getClassifier = { binary->
+    return NativeUtils.getClassifier(binary)
+}
+
+ext.getPlatformPath = { binary->
+    return NativeUtils.getPlatformPath(binary)
+}
+
+apply plugin: 'cpp'
+apply plugin: 'google-test'
+apply plugin: 'visual-studio'
+apply plugin: 'edu.wpi.first.NativeUtils'
+apply plugin: 'java'
+
+apply from: 'config.gradle'
+
+sourceSets {
+    dev
+}
+
+task run(type: JavaExec) {
+    classpath = sourceSets.dev.runtimeClasspath
+
+    main = 'edu.wpi.first.wpiutil.DevMain'
+}
+
+build.dependsOn devClasses
+
+dependencies {
+    testCompile 'junit:junit:4.12'
+    devCompile sourceSets.main.output
+}
+
+model {
+    // Exports config is a utility to enable exporting all symbols in a C++ library on windows to a DLL.
+    // This removes the need for DllExport on a library. However, the gradle C++ builder has a bug
+    // where some extra symbols are added that cannot be resolved at link time. This configuration
+    // lets you specify specific symbols to exlude from exporting.
+    exportsConfigs {
+        wpiutil(ExportsConfig) {
+            x86ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
+                                  '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast' ]
+            x64ExcludeSymbols = [ '_CT??_R0?AV_System_error', '_CT??_R0?AVexception', '_CT??_R0?AVfailure',
+                                  '_CT??_R0?AVruntime_error', '_CT??_R0?AVsystem_error', '_CTA5?AVfailure',
+                                  '_TI5?AVfailure', '_CT??_R0?AVout_of_range', '_CTA3?AVout_of_range',
+                                  '_TI3?AVout_of_range', '_CT??_R0?AVbad_cast' ]
+        }
+    }
+    jniConfigs {
+        wpiutilTestingBaseTest(JNIConfig) {
+            jniArmHeaderLocations = [ all: file("${rootDir}/src/arm-linux-jni") ]
+            onlyIncludeSystemHeaders = true
+        }
+    }
+    components {
+        wpiutil(NativeLibrarySpec) {
+            sources {
+                cpp {
+                    source {
+                        srcDirs 'src/main/native/cpp'
+                        include '**/*.cpp'
+                    }
+                    exportedHeaders {
+                        srcDirs 'src/main/native/include'
+                    }
+                }
+            }
+        }
+        // By default, a development executable will be generated. This is to help the case of
+        // testing specific functionality of the library.
+        if (!project.hasProperty('skipDevExe')) {
+            wpiutilDev(NativeExecutableSpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs 'src/dev/native/cpp'
+                            include '**/*.cpp'
+                            lib library: "wpiutil"
+                        }
+                        exportedHeaders {
+                            srcDirs 'src/dev/native/include'
+                        }
+                    }
+                }
+            }
+        }
+        // The TestingBase library is a workaround for an issue with the GoogleTest plugin.
+        // The plugin by default will rebuild the entire test source set, which increases
+        // build time. By testing an empty library, and then just linking the already built component
+        // into the test, we save the extra build
+        wpiutilTestingBase(NativeLibrarySpec) { }
+    }
+    testSuites {
+        wpiutilTestingBaseTest {
+            sources {
+                cpp {
+                    source {
+                        srcDirs 'src/test/native/cpp'
+                        include '**/*.cpp'
+                    }
+                    exportedHeaders {
+                        srcDirs 'src/test/native/include', 'src/main/native/cpp'
+                    }
+                }
+            }
+        }
+    }
+    binaries {
+        withType(GoogleTestTestSuiteBinarySpec) {
+            if (it.component.testedComponent.name.contains('TestingBase') && !project.hasProperty('onlyAthena')) {
+                lib project: ':gmock', library: 'gmock', linkage: 'static'
+                lib library: 'wpiutil', linkage: 'shared'
+            } else {
+                it.buildable = false
+            }
+        }
+    }
+    tasks {
+        def c = $.components
+        project.tasks.create('runCpp', Exec) {
+            def found = false
+            c.each {
+                if (it in NativeExecutableSpec && it.name == 'wpiutilDev') {
+                    it.binaries.each {
+                        if (!found) {
+                            def arch = it.targetPlatform.architecture.name
+                            if (arch == 'x86-64' || arch == 'x86') {
+                                dependsOn it.tasks.install
+                                commandLine it.tasks.install.runScript
+                                found = true
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        getHeaders(Task) {
+            def list = []
+            $.components.each {
+                if (it in NativeLibrarySpec && (it.name == 'wpiutil')) {
+                    it.sources.each {
+                        it.exportedHeaders.srcDirs.each {
+                            list.add(it)
+                        }
+                    }
+                    it.binaries.each {
+                        it.libs.each {
+                            it.includeRoots.each {
+                                list.add(it)
+                            }
+                        }
+                    }
+                }
+            }
+            list = list.unique(false)
+            doLast {
+                list.each {
+                    print "WPIHEADER: "
+                    println it
+                }
+            }
+        }
+    }
+}
+
+apply from: 'publish.gradle'
+
+task wrapper(type: Wrapper) {
+    gradleVersion = '4.1'
+}
diff --git a/third_party/wpiutil_2018/config.gradle b/third_party/wpiutil_2018/config.gradle
new file mode 100644
index 0000000..2325819
--- /dev/null
+++ b/third_party/wpiutil_2018/config.gradle
@@ -0,0 +1,219 @@
+import edu.wpi.first.nativeutils.*
+import org.gradle.internal.os.OperatingSystem
+
+def windowsCompilerArgs = ['/EHsc', '/DNOMINMAX', '/Zi', '/FS', '/Zc:inline', '/MT']
+def windowsReleaseCompilerArgs = ['/O2']
+def windowsLinkerArgs = [ '/DEBUG:FULL' ]
+def windowsReleaseLinkerArgs = [ '/OPT:REF', '/OPT:ICF' ]
+
+def linuxCompilerArgs = ['-std=c++11', '-Wformat=2', '-Wall', '-Wextra', '-Werror', '-pedantic', '-Wno-psabi', '-g',
+                         '-Wno-unused-parameter', '-fPIC', '-rdynamic', '-Wno-error=deprecated-declarations', '-pthread']
+def linuxLinkerArgs = ['-rdynamic', '-pthread']
+def linuxReleaseCompilerArgs = ['-Og']
+def linuxDebugCompilerArgs = ['-O0']
+def linux32BitArg = '-m32'
+
+def macCompilerArgs =  ['-std=c++11', '-Wall', '-Wextra', '-Werror', '-pedantic-errors', '-fPIC', '-g',
+                            '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-Wno-unused-private-field']
+def macReleaseCompilerArgs = ['-O2']
+def macDebugCompilerArgs = ['-O0']
+def mac32BitArg = '-m32'
+
+def buildAll = project.hasProperty('buildAll')
+
+def windows64PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isWin = OperatingSystem.current().isWindows()
+    if (buildAll) {
+        return isWin
+    } else {
+        return isWin && arch == 'amd64'
+    }
+}
+
+def windows32PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isWin = OperatingSystem.current().isWindows()
+    if (buildAll) {
+        return isWin
+    } else {
+        return isWin && arch == 'x86'
+    }
+}
+
+def linux32IntelPlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isLinux = OperatingSystem.current().isLinux()
+    def isIntel = (arch == 'amd64' || arch == 'i386')
+    if (buildAll) {
+        return isLinux && isIntel
+    } else {
+        return isLinux && arch == 'i386'
+    }
+}
+
+def linux64IntelPlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isLinux = OperatingSystem.current().isLinux()
+    def isIntel = (arch == 'amd64' || arch == 'i386')
+    if (buildAll) {
+        return isLinux && isIntel
+    } else {
+        return isLinux && arch == 'amd64'
+    }
+}
+
+def linuxArmPlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isIntel = (arch == 'amd64' || arch == 'i386')
+    return OperatingSystem.current().isLinux() && !isIntel
+}
+
+def mac64PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isMac = OperatingSystem.current().isMacOsX()
+    if (buildAll) {
+        return isMac
+    } else {
+        return isMac && arch == 'x86_64'
+    }
+}
+
+def mac32PlatformDetect = {
+    def arch = System.getProperty("os.arch")
+    def isMac = OperatingSystem.current().isMacOsX()
+    if (buildAll) {
+        return isMac
+    } else {
+        return isMac && arch == 'x86'
+    }
+}
+
+if (!project.hasProperty('skipAthena')) {
+    model {
+        buildConfigs {
+                roboRio(CrossBuildConfig) {
+                architecture = 'athena'
+                operatingSystem = 'linux'
+                toolChainPrefix = 'arm-frc-linux-gnueabi-'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                exclude << 'gmock'
+                exclude << 'wpiutilTestingBase'
+            }
+        }
+    }
+}
+
+if (!project.hasProperty('onlyAthena')) {
+    model {
+        buildConfigs {
+            winX86(BuildConfig) {
+                architecture = 'x86'
+                operatingSystem = 'windows'
+                compilerArgs = windowsCompilerArgs
+                linkerArgs = windowsLinkerArgs
+                releaseCompilerArgs = windowsReleaseCompilerArgs
+                releaseLinkerArgs = windowsReleaseLinkerArgs
+                compilerFamily = 'VisualCpp'
+                detectPlatform = windows32PlatformDetect
+            }
+            winX64(BuildConfig) {
+                architecture = 'x86-64'
+                operatingSystem = 'windows'
+                compilerArgs = windowsCompilerArgs
+                linkerArgs = windowsLinkerArgs
+                releaseCompilerArgs = windowsReleaseCompilerArgs
+                releaseLinkerArgs = windowsReleaseLinkerArgs
+                compilerFamily = 'VisualCpp'
+                detectPlatform = windows64PlatformDetect
+            }
+            linuxX86(BuildConfig) {
+                architecture = 'x86'
+                operatingSystem = 'linux'
+                compilerArgs = linuxCompilerArgs
+                compilerArgs << linux32BitArg
+                linkerArgs = linuxLinkerArgs
+                linkerArgs << linux32BitArg
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                detectPlatform = linux32IntelPlatformDetect
+            }
+            linuxX64(BuildConfig) {
+                architecture = 'x86-64'
+                operatingSystem = 'linux'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                detectPlatform = linux64IntelPlatformDetect
+            }
+            macX86(BuildConfig) {
+                architecture = 'x86'
+                operatingSystem = 'osx'
+                compilerArgs = macCompilerArgs
+                compilerArgs << mac32BitArg
+                linkerArgs << mac32BitArg
+                debugCompilerArgs = macDebugCompilerArgs
+                releaseCompilerArgs = macReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Clang'
+                detectPlatform = mac32PlatformDetect
+            }
+            macX64(BuildConfig) {
+                architecture = 'x86-64'
+                operatingSystem = 'osx'
+                compilerArgs = macCompilerArgs
+                debugCompilerArgs = macDebugCompilerArgs
+                releaseCompilerArgs = macReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Clang'
+                detectPlatform = mac64PlatformDetect
+            }
+        }
+    }
+}
+
+if (project.hasProperty('linuxCross')) {
+    model {
+        buildConfigs {
+            linuxArm(CrossBuildConfig) {
+                architecture = 'nativearm'
+                operatingSystem = 'linux'
+                toolChainPrefix = 'PLEASE_PROVIDE_A_COMPILER_NAME'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                skipByDefault = true
+                compilerFamily = 'Gcc'
+                exclude << 'gmock'
+            }
+        }
+    }
+} else {
+    model {
+        buildConfigs {
+            linuxArm(BuildConfig) {
+                architecture = 'nativearm'
+                operatingSystem = 'linux'
+                compilerArgs = linuxCompilerArgs
+                linkerArgs = linuxLinkerArgs
+                debugCompilerArgs = linuxDebugCompilerArgs
+                releaseCompilerArgs = linuxReleaseCompilerArgs
+                releaseStripBinaries = true
+                compilerFamily = 'Gcc'
+                detectPlatform = linuxArmPlatformDetect
+            }
+        }
+    }
+}
diff --git a/third_party/wpiutil_2018/gmock/LICENSE b/third_party/wpiutil_2018/gmock/LICENSE
new file mode 100644
index 0000000..1941a11
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/LICENSE
@@ -0,0 +1,28 @@
+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.
diff --git a/third_party/wpiutil_2018/gmock/build.gradle b/third_party/wpiutil_2018/gmock/build.gradle
new file mode 100644
index 0000000..51ff139
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/build.gradle
@@ -0,0 +1,40 @@
+import org.gradle.internal.os.OperatingSystem
+
+if (!project.hasProperty('onlyAthena')) {
+    apply plugin: 'cpp'
+    apply plugin: 'visual-studio'
+    apply plugin: 'edu.wpi.first.NativeUtils'
+
+    ext.gmockProject = true
+
+    apply from: '../config.gradle'
+
+    model {
+        components {
+            gmock(NativeLibrarySpec) {
+                sources {
+                    cpp {
+                        source {
+                            srcDirs = ['src', 'gtest/src']
+                            includes = ['*-all.cc']
+                        }
+                        exportedHeaders {
+                            srcDirs = ['include', 'gtest/include', '.', 'gtest']
+                            includes = ['**/*.h', '**/*.cc']
+                        }
+                    }
+                }
+                binaries.all {
+                    if (toolChain in VisualCpp) {
+                        cppCompiler.args '-D_UNICODE', '-DUNICODE', '-DWIN32',  '-D_WIN32', '-DSTRICT', '-DWIN32_LEAN_AND_MEAN', '-D_HAS_EXCEPTIONS=1'
+                    } else {
+                        cppCompiler.args '-Wall', '-Wshadow', '-fexceptions', '-Wextra', '-Wno-unused-parameter', '-Wno-missing-field-initializers', '-pthread', '-fPIC'
+                    }
+                }
+                binaries.withType(SharedLibraryBinarySpec) {
+                    buildable = false
+                }
+            }
+        }
+    }
+}
diff --git a/third_party/wpiutil_2018/gmock/gtest/CMakeLists.txt b/third_party/wpiutil_2018/gmock/gtest/CMakeLists.txt
new file mode 100644
index 0000000..b9498cd
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/CMakeLists.txt
@@ -0,0 +1,69 @@
+########################################################################
+# CMake build script for Google Test.
+#
+# To run the tests for Google Test itself on Linux, use 'make test' or
+# ctest.  You can select which tests to run using 'ctest -R regex'.
+# For more options, run 'ctest --help'.
+
+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+# make it prominent in the GUI.
+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+
+# When other libraries are using a shared version of runtime libraries,
+# Google Test also has to use one.
+option(
+  gtest_force_shared_crt
+  "Use shared (DLL) run-time lib even when Google Test is built as static lib."
+  OFF)
+
+option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
+
+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
+include(cmake/hermetic_build.cmake OPTIONAL)
+
+if (COMMAND pre_project_set_up_hermetic_build)
+  pre_project_set_up_hermetic_build()
+endif()
+
+########################################################################
+#
+# Project-wide settings
+
+# Name of the project.
+#
+# CMake files in this project can refer to the root source directory
+# as ${gtest_SOURCE_DIR} and to the root binary directory as
+# ${gtest_BINARY_DIR}.
+# Language "C" is required for find_package(Threads).
+project(gtest CXX C)
+cmake_minimum_required(VERSION 2.6.2)
+
+if (COMMAND set_up_hermetic_build)
+  set_up_hermetic_build()
+endif()
+
+# Define helper functions and macros used by Google Test.
+include(cmake/internal_utils.cmake)
+
+config_compiler_and_linker()  # Defined in internal_utils.cmake.
+
+# Where Google Test's .h files can be found.
+include_directories(
+  ${gtest_SOURCE_DIR}/include
+  ${gtest_SOURCE_DIR})
+
+# Where Google Test's libraries can be found.
+link_directories(${gtest_BINARY_DIR}/src)
+
+########################################################################
+#
+# Defines the gtest & gtest_main libraries.  User tests should link
+# with one of them.
+
+# Google Test libraries.  We build them using more strict warnings than what
+# are used for other targets, to ensure that gtest can be compiled by a user
+# aggressive about warnings.
+cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
+cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
+target_link_libraries(gtest_main gtest)
+
diff --git a/third_party/wpiutil_2018/gmock/gtest/LICENSE b/third_party/wpiutil_2018/gmock/gtest/LICENSE
new file mode 100644
index 0000000..1941a11
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/LICENSE
@@ -0,0 +1,28 @@
+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.
diff --git a/third_party/wpiutil_2018/gmock/gtest/cmake/internal_utils.cmake b/third_party/wpiutil_2018/gmock/gtest/cmake/internal_utils.cmake
new file mode 100644
index 0000000..075410a
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/cmake/internal_utils.cmake
@@ -0,0 +1,206 @@
+# Defines functions and macros useful for building Google Test and
+# Google Mock.
+#
+# Note:
+#
+# - This file will be run twice when building Google Mock (once via
+#   Google Test's CMakeLists.txt, and once via Google Mock's).
+#   Therefore it shouldn't have any side effects other than defining
+#   the functions and macros.
+#
+# - The functions/macros defined in this file may depend on Google
+#   Test and Google Mock's option() definitions, and thus must be
+#   called *after* the options have been defined.
+
+# Tweaks CMake's default compiler/linker settings to suit Google Test's needs.
+#
+# This must be a macro(), as inside a function string() can only
+# update variables in the function scope.
+macro(fix_default_compiler_settings_)
+  if (MSVC)
+    # For MSVC, CMake sets certain flags to defaults we want to override.
+    # This replacement code is taken from sample in the CMake Wiki at
+    # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.
+    foreach (flag_var
+             CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
+             CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+      if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
+        # When Google Test is built as a shared library, it should also use
+        # shared runtime libraries.  Otherwise, it may end up with multiple
+        # copies of runtime library data in different modules, resulting in
+        # hard-to-find crashes. When it is built as a static library, it is
+        # preferable to use CRT as static libraries, as we don't have to rely
+        # on CRT DLLs being available. CMake always defaults to using shared
+        # CRT libraries, so we override that default here.
+        string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
+      endif()
+
+      # We prefer more strict warning checking for building Google Test.
+      # Replaces /W3 with /W4 in defaults.
+      string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}")
+    endforeach()
+  endif()
+endmacro()
+
+# Defines the compiler/linker flags used to build Google Test and
+# Google Mock.  You can tweak these definitions to suit your need.  A
+# variable's value is empty before it's explicitly assigned to.
+macro(config_compiler_and_linker)
+  if (NOT gtest_disable_pthreads)
+    # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
+    find_package(Threads)
+  endif()
+
+  fix_default_compiler_settings_()
+  if (MSVC)
+    # Newlines inside flags variables break CMake's NMake generator.
+    # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
+    set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi")
+    if (MSVC_VERSION LESS 1400)
+      # Suppress spurious warnings MSVC 7.1 sometimes issues.
+      # Forcing value to bool.
+      set(cxx_base_flags "${cxx_base_flags} -wd4800")
+      # Copy constructor and assignment operator could not be generated.
+      set(cxx_base_flags "${cxx_base_flags} -wd4511 -wd4512")
+      # Compatibility warnings not applicable to Google Test.
+      # Resolved overload was found by argument-dependent lookup.
+      set(cxx_base_flags "${cxx_base_flags} -wd4675")
+    endif()
+    set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32")
+    set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN")
+    set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
+    set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")
+    set(cxx_no_rtti_flags "-GR-")
+  elseif (CMAKE_COMPILER_IS_GNUCXX)
+    set(cxx_base_flags "-Wall -Wshadow")
+    set(cxx_exception_flags "-fexceptions")
+    set(cxx_no_exception_flags "-fno-exceptions")
+    # Until version 4.3.2, GCC doesn't define a macro to indicate
+    # whether RTTI is enabled.  Therefore we define GTEST_HAS_RTTI
+    # explicitly.
+    set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
+    set(cxx_strict_flags
+      "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
+    set(cxx_exception_flags "-features=except")
+    # Sun Pro doesn't provide macros to indicate whether exceptions and
+    # RTTI are enabled, so we define GTEST_HAS_* explicitly.
+    set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0")
+    set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0")
+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR
+      CMAKE_CXX_COMPILER_ID STREQUAL "XL")
+    # CMake 2.8 changes Visual Age's compiler ID to "XL".
+    set(cxx_exception_flags "-qeh")
+    set(cxx_no_exception_flags "-qnoeh")
+    # Until version 9.0, Visual Age doesn't define a macro to indicate
+    # whether RTTI is enabled.  Therefore we define GTEST_HAS_RTTI
+    # explicitly.
+    set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
+  elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
+    set(cxx_base_flags "-AA -mt")
+    set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1")
+    set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0")
+    # RTTI can not be disabled in HP aCC compiler.
+    set(cxx_no_rtti_flags "")
+  endif()
+
+  if (CMAKE_USE_PTHREADS_INIT)  # The pthreads library is available and allowed.
+    set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1")
+  else()
+    set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0")
+  endif()
+
+  # For building gtest's own tests and samples.
+  set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}")
+  set(cxx_no_exception
+    "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
+  set(cxx_default "${cxx_exception}")
+  set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")
+  set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1")
+
+  # For building the gtest libraries.
+  set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
+endmacro()
+
+# Defines the gtest & gtest_main libraries.  User tests should link
+# with one of them.
+function(cxx_library_with_type name type cxx_flags)
+  # type can be either STATIC or SHARED to denote a static or shared library.
+  # ARGN refers to additional arguments after 'cxx_flags'.
+  add_library(${name} ${type} ${ARGN})
+  set_target_properties(${name}
+    PROPERTIES
+    COMPILE_FLAGS "${cxx_flags}")
+  if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
+    set_target_properties(${name}
+      PROPERTIES
+      COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
+  endif()
+  if (CMAKE_USE_PTHREADS_INIT)
+    target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
+  endif()
+endfunction()
+
+########################################################################
+#
+# Helper functions for creating build targets.
+
+function(cxx_shared_library name cxx_flags)
+  cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN})
+endfunction()
+
+function(cxx_library name cxx_flags)
+  cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN})
+endfunction()
+
+# cxx_executable_with_flags(name cxx_flags libs srcs...)
+#
+# creates a named C++ executable that depends on the given libraries and
+# is built from the given source files with the given compiler flags.
+function(cxx_executable_with_flags name cxx_flags libs)
+  add_executable(${name} ${ARGN})
+  if (cxx_flags)
+    set_target_properties(${name}
+      PROPERTIES
+      COMPILE_FLAGS "${cxx_flags}")
+  endif()
+  if (BUILD_SHARED_LIBS)
+    set_target_properties(${name}
+      PROPERTIES
+      COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
+  endif()
+  # To support mixing linking in static and dynamic libraries, link each
+  # library in with an extra call to target_link_libraries.
+  foreach (lib "${libs}")
+    target_link_libraries(${name} ${lib})
+  endforeach()
+endfunction()
+
+# cxx_executable(name dir lib srcs...)
+#
+# creates a named target that depends on the given libs and is built
+# from the given source files.  dir/name.cc is implicitly included in
+# the source file list.
+function(cxx_executable name dir libs)
+  cxx_executable_with_flags(
+    ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})
+endfunction()
+
+# cxx_test_with_flags(name cxx_flags libs srcs...)
+#
+# creates a named C++ test that depends on the given libs and is built
+# from the given source files with the given compiler flags.
+function(cxx_test_with_flags name cxx_flags libs)
+  cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
+  add_test(${name} ${name})
+endfunction()
+
+# cxx_test(name libs srcs...)
+#
+# creates a named test target that depends on the given libs and is
+# built from the given source files.  Unlike cxx_test_with_flags,
+# test/name.cc is already implicitly included in the source file list.
+function(cxx_test name libs)
+  cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
+    "test/${name}.cc" ${ARGN})
+endfunction()
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-death-test.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-death-test.h
new file mode 100644
index 0000000..957a69c
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-death-test.h
@@ -0,0 +1,294 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the public API for death tests.  It is
+// #included by gtest.h so a user doesn't need to include this
+// directly.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
+
+#include "gtest/internal/gtest-death-test-internal.h"
+
+namespace testing {
+
+// This flag controls the style of death tests.  Valid values are "threadsafe",
+// meaning that the death test child process will re-execute the test binary
+// from the start, running only a single death test, or "fast",
+// meaning that the child process will execute the test logic immediately
+// after forking.
+GTEST_DECLARE_string_(death_test_style);
+
+#if GTEST_HAS_DEATH_TEST
+
+namespace internal {
+
+// Returns a Boolean value indicating whether the caller is currently
+// executing in the context of the death test child process.  Tools such as
+// Valgrind heap checkers may need this to modify their behavior in death
+// tests.  IMPORTANT: This is an internal utility.  Using it may break the
+// implementation of death tests.  User code MUST NOT use it.
+GTEST_API_ bool InDeathTestChild();
+
+}  // namespace internal
+
+// The following macros are useful for writing death tests.
+
+// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
+// executed:
+//
+//   1. It generates a warning if there is more than one active
+//   thread.  This is because it's safe to fork() or clone() only
+//   when there is a single thread.
+//
+//   2. The parent process clone()s a sub-process and runs the death
+//   test in it; the sub-process exits with code 0 at the end of the
+//   death test, if it hasn't exited already.
+//
+//   3. The parent process waits for the sub-process to terminate.
+//
+//   4. The parent process checks the exit code and error message of
+//   the sub-process.
+//
+// Examples:
+//
+//   ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
+//   for (int i = 0; i < 5; i++) {
+//     EXPECT_DEATH(server.ProcessRequest(i),
+//                  "Invalid request .* in ProcessRequest()")
+//                  << "Failed to die on request " << i;
+//   }
+//
+//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
+//
+//   bool KilledBySIGHUP(int exit_code) {
+//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
+//   }
+//
+//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
+//
+// On the regular expressions used in death tests:
+//
+//   On POSIX-compliant systems (*nix), we use the <regex.h> library,
+//   which uses the POSIX extended regex syntax.
+//
+//   On other platforms (e.g. Windows), we only support a simple regex
+//   syntax implemented as part of Google Test.  This limited
+//   implementation should be enough most of the time when writing
+//   death tests; though it lacks many features you can find in PCRE
+//   or POSIX extended regex syntax.  For example, we don't support
+//   union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
+//   repetition count ("x{5,7}"), among others.
+//
+//   Below is the syntax that we do support.  We chose it to be a
+//   subset of both PCRE and POSIX extended regex, so it's easy to
+//   learn wherever you come from.  In the following: 'A' denotes a
+//   literal character, period (.), or a single \\ escape sequence;
+//   'x' and 'y' denote regular expressions; 'm' and 'n' are for
+//   natural numbers.
+//
+//     c     matches any literal character c
+//     \\d   matches any decimal digit
+//     \\D   matches any character that's not a decimal digit
+//     \\f   matches \f
+//     \\n   matches \n
+//     \\r   matches \r
+//     \\s   matches any ASCII whitespace, including \n
+//     \\S   matches any character that's not a whitespace
+//     \\t   matches \t
+//     \\v   matches \v
+//     \\w   matches any letter, _, or decimal digit
+//     \\W   matches any character that \\w doesn't match
+//     \\c   matches any literal character c, which must be a punctuation
+//     .     matches any single character except \n
+//     A?    matches 0 or 1 occurrences of A
+//     A*    matches 0 or many occurrences of A
+//     A+    matches 1 or many occurrences of A
+//     ^     matches the beginning of a string (not that of each line)
+//     $     matches the end of a string (not that of each line)
+//     xy    matches x followed by y
+//
+//   If you accidentally use PCRE or POSIX extended regex features
+//   not implemented by us, you will get a run-time failure.  In that
+//   case, please try to rewrite your regular expression within the
+//   above syntax.
+//
+//   This implementation is *not* meant to be as highly tuned or robust
+//   as a compiled regex library, but should perform well enough for a
+//   death test, which already incurs significant overhead by launching
+//   a child process.
+//
+// Known caveats:
+//
+//   A "threadsafe" style death test obtains the path to the test
+//   program from argv[0] and re-executes it in the sub-process.  For
+//   simplicity, the current implementation doesn't search the PATH
+//   when launching the sub-process.  This means that the user must
+//   invoke the test program via a path that contains at least one
+//   path separator (e.g. path/to/foo_test and
+//   /absolute/path/to/bar_test are fine, but foo_test is not).  This
+//   is rarely a problem as people usually don't put the test binary
+//   directory in PATH.
+//
+// TODO(wan@google.com): make thread-safe death tests search the PATH.
+
+// Asserts that a given statement causes the program to exit, with an
+// integer exit status that satisfies predicate, and emitting error output
+// that matches regex.
+# define ASSERT_EXIT(statement, predicate, regex) \
+    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
+
+// Like ASSERT_EXIT, but continues on to successive tests in the
+// test case, if any:
+# define EXPECT_EXIT(statement, predicate, regex) \
+    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
+
+// Asserts that a given statement causes the program to exit, either by
+// explicitly exiting with a nonzero exit code or being killed by a
+// signal, and emitting error output that matches regex.
+# define ASSERT_DEATH(statement, regex) \
+    ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+
+// Like ASSERT_DEATH, but continues on to successive tests in the
+// test case, if any:
+# define EXPECT_DEATH(statement, regex) \
+    EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
+
+// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
+
+// Tests that an exit code describes a normal exit with a given exit code.
+class GTEST_API_ ExitedWithCode {
+ public:
+  explicit ExitedWithCode(int exit_code);
+  bool operator()(int exit_status) const;
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ExitedWithCode& other);
+
+  const int exit_code_;
+};
+
+# if !GTEST_OS_WINDOWS
+// Tests that an exit code describes an exit due to termination by a
+// given signal.
+class GTEST_API_ KilledBySignal {
+ public:
+  explicit KilledBySignal(int signum);
+  bool operator()(int exit_status) const;
+ private:
+  const int signum_;
+};
+# endif  // !GTEST_OS_WINDOWS
+
+// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
+// The death testing framework causes this to have interesting semantics,
+// since the sideeffects of the call are only visible in opt mode, and not
+// in debug mode.
+//
+// In practice, this can be used to test functions that utilize the
+// LOG(DFATAL) macro using the following style:
+//
+// int DieInDebugOr12(int* sideeffect) {
+//   if (sideeffect) {
+//     *sideeffect = 12;
+//   }
+//   LOG(DFATAL) << "death";
+//   return 12;
+// }
+//
+// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
+//   int sideeffect = 0;
+//   // Only asserts in dbg.
+//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
+//
+// #ifdef NDEBUG
+//   // opt-mode has sideeffect visible.
+//   EXPECT_EQ(12, sideeffect);
+// #else
+//   // dbg-mode no visible sideeffect.
+//   EXPECT_EQ(0, sideeffect);
+// #endif
+// }
+//
+// This will assert that DieInDebugReturn12InOpt() crashes in debug
+// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
+// appropriate fallback value (12 in this case) in opt mode. If you
+// need to test that a function has appropriate side-effects in opt
+// mode, include assertions against the side-effects.  A general
+// pattern for this is:
+//
+// EXPECT_DEBUG_DEATH({
+//   // Side-effects here will have an effect after this statement in
+//   // opt mode, but none in debug mode.
+//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
+// }, "death");
+//
+# ifdef NDEBUG
+
+#  define EXPECT_DEBUG_DEATH(statement, regex) \
+  GTEST_EXECUTE_STATEMENT_(statement, regex)
+
+#  define ASSERT_DEBUG_DEATH(statement, regex) \
+  GTEST_EXECUTE_STATEMENT_(statement, regex)
+
+# else
+
+#  define EXPECT_DEBUG_DEATH(statement, regex) \
+  EXPECT_DEATH(statement, regex)
+
+#  define ASSERT_DEBUG_DEATH(statement, regex) \
+  ASSERT_DEATH(statement, regex)
+
+# endif  // NDEBUG for EXPECT_DEBUG_DEATH
+#endif  // GTEST_HAS_DEATH_TEST
+
+// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
+// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
+// death tests are supported; otherwise they just issue a warning.  This is
+// useful when you are combining death test assertions with normal test
+// assertions in one test.
+#if GTEST_HAS_DEATH_TEST
+# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
+    EXPECT_DEATH(statement, regex)
+# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
+    ASSERT_DEATH(statement, regex)
+#else
+# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
+    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
+# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
+    GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
+#endif
+
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-message.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-message.h
new file mode 100644
index 0000000..fe879bc
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-message.h
@@ -0,0 +1,250 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the Message class.
+//
+// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
+// leave some internal implementation details in this header file.
+// They are clearly marked by comments like this:
+//
+//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+//
+// Such code is NOT meant to be used by a user directly, and is subject
+// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
+// program!
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
+#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
+
+#include <limits>
+
+#include "gtest/internal/gtest-port.h"
+
+// Ensures that there is at least one operator<< in the global namespace.
+// See Message& operator<<(...) below for why.
+void operator<<(const testing::internal::Secret&, int);
+
+namespace testing {
+
+// The Message class works like an ostream repeater.
+//
+// Typical usage:
+//
+//   1. You stream a bunch of values to a Message object.
+//      It will remember the text in a stringstream.
+//   2. Then you stream the Message object to an ostream.
+//      This causes the text in the Message to be streamed
+//      to the ostream.
+//
+// For example;
+//
+//   testing::Message foo;
+//   foo << 1 << " != " << 2;
+//   std::cout << foo;
+//
+// will print "1 != 2".
+//
+// Message is not intended to be inherited from.  In particular, its
+// destructor is not virtual.
+//
+// Note that stringstream behaves differently in gcc and in MSVC.  You
+// can stream a NULL char pointer to it in the former, but not in the
+// latter (it causes an access violation if you do).  The Message
+// class hides this difference by treating a NULL char pointer as
+// "(null)".
+class GTEST_API_ Message {
+ private:
+  // The type of basic IO manipulators (endl, ends, and flush) for
+  // narrow streams.
+  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
+
+ public:
+  // Constructs an empty Message.
+  Message();
+
+  // Copy constructor.
+  Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT
+    *ss_ << msg.GetString();
+  }
+
+  // Constructs a Message from a C-string.
+  explicit Message(const char* str) : ss_(new ::std::stringstream) {
+    *ss_ << str;
+  }
+
+#if GTEST_OS_SYMBIAN
+  // Streams a value (either a pointer or not) to this object.
+  template <typename T>
+  inline Message& operator <<(const T& value) {
+    StreamHelper(typename internal::is_pointer<T>::type(), value);
+    return *this;
+  }
+#else
+  // Streams a non-pointer value to this object.
+  template <typename T>
+  inline Message& operator <<(const T& val) {
+    // Some libraries overload << for STL containers.  These
+    // overloads are defined in the global namespace instead of ::std.
+    //
+    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
+    // overloads are visible in either the std namespace or the global
+    // namespace, but not other namespaces, including the testing
+    // namespace which Google Test's Message class is in.
+    //
+    // To allow STL containers (and other types that has a << operator
+    // defined in the global namespace) to be used in Google Test
+    // assertions, testing::Message must access the custom << operator
+    // from the global namespace.  With this using declaration,
+    // overloads of << defined in the global namespace and those
+    // visible via Koenig lookup are both exposed in this function.
+    using ::operator <<;
+    *ss_ << val;
+    return *this;
+  }
+
+  // Streams a pointer value to this object.
+  //
+  // This function is an overload of the previous one.  When you
+  // stream a pointer to a Message, this definition will be used as it
+  // is more specialized.  (The C++ Standard, section
+  // [temp.func.order].)  If you stream a non-pointer, then the
+  // previous definition will be used.
+  //
+  // The reason for this overload is that streaming a NULL pointer to
+  // ostream is undefined behavior.  Depending on the compiler, you
+  // may get "0", "(nil)", "(null)", or an access violation.  To
+  // ensure consistent result across compilers, we always treat NULL
+  // as "(null)".
+  template <typename T>
+  inline Message& operator <<(T* const& pointer) {  // NOLINT
+    if (pointer == NULL) {
+      *ss_ << "(null)";
+    } else {
+      *ss_ << pointer;
+    }
+    return *this;
+  }
+#endif  // GTEST_OS_SYMBIAN
+
+  // Since the basic IO manipulators are overloaded for both narrow
+  // and wide streams, we have to provide this specialized definition
+  // of operator <<, even though its body is the same as the
+  // templatized version above.  Without this definition, streaming
+  // endl or other basic IO manipulators to Message will confuse the
+  // compiler.
+  Message& operator <<(BasicNarrowIoManip val) {
+    *ss_ << val;
+    return *this;
+  }
+
+  // Instead of 1/0, we want to see true/false for bool values.
+  Message& operator <<(bool b) {
+    return *this << (b ? "true" : "false");
+  }
+
+  // These two overloads allow streaming a wide C string to a Message
+  // using the UTF-8 encoding.
+  Message& operator <<(const wchar_t* wide_c_str);
+  Message& operator <<(wchar_t* wide_c_str);
+
+#if GTEST_HAS_STD_WSTRING
+  // Converts the given wide string to a narrow string using the UTF-8
+  // encoding, and streams the result to this Message object.
+  Message& operator <<(const ::std::wstring& wstr);
+#endif  // GTEST_HAS_STD_WSTRING
+
+#if GTEST_HAS_GLOBAL_WSTRING
+  // Converts the given wide string to a narrow string using the UTF-8
+  // encoding, and streams the result to this Message object.
+  Message& operator <<(const ::wstring& wstr);
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+  // Gets the text streamed to this object so far as an std::string.
+  // Each '\0' character in the buffer is replaced with "\\0".
+  //
+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+  std::string GetString() const;
+
+ private:
+
+#if GTEST_OS_SYMBIAN
+  // These are needed as the Nokia Symbian Compiler cannot decide between
+  // const T& and const T* in a function template. The Nokia compiler _can_
+  // decide between class template specializations for T and T*, so a
+  // tr1::type_traits-like is_pointer works, and we can overload on that.
+  template <typename T>
+  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {
+    if (pointer == NULL) {
+      *ss_ << "(null)";
+    } else {
+      *ss_ << pointer;
+    }
+  }
+  template <typename T>
+  inline void StreamHelper(internal::false_type /*is_pointer*/,
+                           const T& value) {
+    // See the comments in Message& operator <<(const T&) above for why
+    // we need this using statement.
+    using ::operator <<;
+    *ss_ << value;
+  }
+#endif  // GTEST_OS_SYMBIAN
+
+  // We'll hold the text streamed to this object here.
+  const internal::scoped_ptr< ::std::stringstream> ss_;
+
+  // We declare (but don't implement) this to prevent the compiler
+  // from implementing the assignment operator.
+  void operator=(const Message&);
+};
+
+// Streams a Message to an ostream.
+inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
+  return os << sb.GetString();
+}
+
+namespace internal {
+
+// Converts a streamable value to an std::string.  A NULL pointer is
+// converted to "(null)".  When the input value is a ::string,
+// ::std::string, ::wstring, or ::std::wstring object, each NUL
+// character in it is replaced with "\\0".
+template <typename T>
+std::string StreamableToString(const T& streamable) {
+  return (Message() << streamable).GetString();
+}
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-param-test.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-param-test.h
new file mode 100644
index 0000000..038f9ba
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-param-test.h
@@ -0,0 +1,1444 @@
+// This file was GENERATED by command:
+//     pump.py gtest-param-test.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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.
+//
+// Authors: vladl@google.com (Vlad Losev)
+//
+// Macros and functions for implementing parameterized tests
+// in Google C++ Testing Framework (Google Test)
+//
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+
+
+// Value-parameterized tests allow you to test your code with different
+// parameters without writing multiple copies of the same test.
+//
+// Here is how you use value-parameterized tests:
+
+#if 0
+
+// To write value-parameterized tests, first you should define a fixture
+// class. It is usually derived from testing::TestWithParam<T> (see below for
+// another inheritance scheme that's sometimes useful in more complicated
+// class hierarchies), where the type of your parameter values.
+// TestWithParam<T> is itself derived from testing::Test. T can be any
+// copyable type. If it's a raw pointer, you are responsible for managing the
+// lifespan of the pointed values.
+
+class FooTest : public ::testing::TestWithParam<const char*> {
+  // You can implement all the usual class fixture members here.
+};
+
+// Then, use the TEST_P macro to define as many parameterized tests
+// for this fixture as you want. The _P suffix is for "parameterized"
+// or "pattern", whichever you prefer to think.
+
+TEST_P(FooTest, DoesBlah) {
+  // Inside a test, access the test parameter with the GetParam() method
+  // of the TestWithParam<T> class:
+  EXPECT_TRUE(foo.Blah(GetParam()));
+  ...
+}
+
+TEST_P(FooTest, HasBlahBlah) {
+  ...
+}
+
+// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
+// case with any set of parameters you want. Google Test defines a number
+// of functions for generating test parameters. They return what we call
+// (surprise!) parameter generators. Here is a  summary of them, which
+// are all in the testing namespace:
+//
+//
+//  Range(begin, end [, step]) - Yields values {begin, begin+step,
+//                               begin+step+step, ...}. The values do not
+//                               include end. step defaults to 1.
+//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
+//  ValuesIn(container)        - Yields values from a C-style array, an STL
+//  ValuesIn(begin,end)          container, or an iterator range [begin, end).
+//  Bool()                     - Yields sequence {false, true}.
+//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
+//                               for the math savvy) of the values generated
+//                               by the N generators.
+//
+// For more details, see comments at the definitions of these functions below
+// in this file.
+//
+// The following statement will instantiate tests from the FooTest test case
+// each with parameter values "meeny", "miny", and "moe".
+
+INSTANTIATE_TEST_CASE_P(InstantiationName,
+                        FooTest,
+                        Values("meeny", "miny", "moe"));
+
+// To distinguish different instances of the pattern, (yes, you
+// can instantiate it more then once) the first argument to the
+// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
+// actual test case name. Remember to pick unique prefixes for different
+// instantiations. The tests from the instantiation above will have
+// these names:
+//
+//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
+//    * InstantiationName/FooTest.DoesBlah/1 for "miny"
+//    * InstantiationName/FooTest.DoesBlah/2 for "moe"
+//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
+//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
+//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
+//
+// You can use these names in --gtest_filter.
+//
+// This statement will instantiate all tests from FooTest again, each
+// with parameter values "cat" and "dog":
+
+const char* pets[] = {"cat", "dog"};
+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
+
+// The tests from the instantiation above will have these names:
+//
+//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
+//
+// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
+// in the given test case, whether their definitions come before or
+// AFTER the INSTANTIATE_TEST_CASE_P statement.
+//
+// Please also note that generator expressions (including parameters to the
+// generators) are evaluated in InitGoogleTest(), after main() has started.
+// This allows the user on one hand, to adjust generator parameters in order
+// to dynamically determine a set of tests to run and on the other hand,
+// give the user a chance to inspect the generated tests with Google Test
+// reflection API before RUN_ALL_TESTS() is executed.
+//
+// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
+// for more examples.
+//
+// In the future, we plan to publish the API for defining new parameter
+// generators. But for now this interface remains part of the internal
+// implementation and is subject to change.
+//
+//
+// A parameterized test fixture must be derived from testing::Test and from
+// testing::WithParamInterface<T>, where T is the type of the parameter
+// values. Inheriting from TestWithParam<T> satisfies that requirement because
+// TestWithParam<T> inherits from both Test and WithParamInterface. In more
+// complicated hierarchies, however, it is occasionally useful to inherit
+// separately from Test and WithParamInterface. For example:
+
+class BaseTest : public ::testing::Test {
+  // You can inherit all the usual members for a non-parameterized test
+  // fixture here.
+};
+
+class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
+  // The usual test fixture members go here too.
+};
+
+TEST_F(BaseTest, HasFoo) {
+  // This is an ordinary non-parameterized test.
+}
+
+TEST_P(DerivedTest, DoesBlah) {
+  // GetParam works just the same here as if you inherit from TestWithParam.
+  EXPECT_TRUE(foo.Blah(GetParam()));
+}
+
+#endif  // 0
+
+#include "gtest/internal/gtest-port.h"
+
+#if !GTEST_OS_SYMBIAN
+# include <utility>
+#endif
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-param-util-generated.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Functions producing parameter generators.
+//
+// Google Test uses these generators to produce parameters for value-
+// parameterized tests. When a parameterized test case is instantiated
+// with a particular generator, Google Test creates and runs tests
+// for each element in the sequence produced by the generator.
+//
+// In the following sample, tests from test case FooTest are instantiated
+// each three times with parameter values 3, 5, and 8:
+//
+// class FooTest : public TestWithParam<int> { ... };
+//
+// TEST_P(FooTest, TestThis) {
+// }
+// TEST_P(FooTest, TestThat) {
+// }
+// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
+//
+
+// Range() returns generators providing sequences of values in a range.
+//
+// Synopsis:
+// Range(start, end)
+//   - returns a generator producing a sequence of values {start, start+1,
+//     start+2, ..., }.
+// Range(start, end, step)
+//   - returns a generator producing a sequence of values {start, start+step,
+//     start+step+step, ..., }.
+// Notes:
+//   * The generated sequences never include end. For example, Range(1, 5)
+//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
+//     returns a generator producing {1, 3, 5, 7}.
+//   * start and end must have the same type. That type may be any integral or
+//     floating-point type or a user defined type satisfying these conditions:
+//     * It must be assignable (have operator=() defined).
+//     * It must have operator+() (operator+(int-compatible type) for
+//       two-operand version).
+//     * It must have operator<() defined.
+//     Elements in the resulting sequences will also have that type.
+//   * Condition start < end must be satisfied in order for resulting sequences
+//     to contain any elements.
+//
+template <typename T, typename IncrementT>
+internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
+  return internal::ParamGenerator<T>(
+      new internal::RangeGenerator<T, IncrementT>(start, end, step));
+}
+
+template <typename T>
+internal::ParamGenerator<T> Range(T start, T end) {
+  return Range(start, end, 1);
+}
+
+// ValuesIn() function allows generation of tests with parameters coming from
+// a container.
+//
+// Synopsis:
+// ValuesIn(const T (&array)[N])
+//   - returns a generator producing sequences with elements from
+//     a C-style array.
+// ValuesIn(const Container& container)
+//   - returns a generator producing sequences with elements from
+//     an STL-style container.
+// ValuesIn(Iterator begin, Iterator end)
+//   - returns a generator producing sequences with elements from
+//     a range [begin, end) defined by a pair of STL-style iterators. These
+//     iterators can also be plain C pointers.
+//
+// Please note that ValuesIn copies the values from the containers
+// passed in and keeps them to generate tests in RUN_ALL_TESTS().
+//
+// Examples:
+//
+// This instantiates tests from test case StringTest
+// each with C-string values of "foo", "bar", and "baz":
+//
+// const char* strings[] = {"foo", "bar", "baz"};
+// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
+//
+// This instantiates tests from test case StlStringTest
+// each with STL strings with values "a" and "b":
+//
+// ::std::vector< ::std::string> GetParameterStrings() {
+//   ::std::vector< ::std::string> v;
+//   v.push_back("a");
+//   v.push_back("b");
+//   return v;
+// }
+//
+// INSTANTIATE_TEST_CASE_P(CharSequence,
+//                         StlStringTest,
+//                         ValuesIn(GetParameterStrings()));
+//
+//
+// This will also instantiate tests from CharTest
+// each with parameter values 'a' and 'b':
+//
+// ::std::list<char> GetParameterChars() {
+//   ::std::list<char> list;
+//   list.push_back('a');
+//   list.push_back('b');
+//   return list;
+// }
+// ::std::list<char> l = GetParameterChars();
+// INSTANTIATE_TEST_CASE_P(CharSequence2,
+//                         CharTest,
+//                         ValuesIn(l.begin(), l.end()));
+//
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end) {
+  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
+      ::value_type ParamType;
+  return internal::ParamGenerator<ParamType>(
+      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
+}
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
+  return ValuesIn(array, array + N);
+}
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container) {
+  return ValuesIn(container.begin(), container.end());
+}
+
+// Values() allows generating tests from explicitly specified list of
+// parameters.
+//
+// Synopsis:
+// Values(T v1, T v2, ..., T vN)
+//   - returns a generator producing sequences with elements v1, v2, ..., vN.
+//
+// For example, this instantiates tests from test case BarTest each
+// with values "one", "two", and "three":
+//
+// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
+//
+// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
+// The exact type of values will depend on the type of parameter in BazTest.
+//
+// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
+//
+// Currently, Values() supports from 1 to 50 parameters.
+//
+template <typename T1>
+internal::ValueArray1<T1> Values(T1 v1) {
+  return internal::ValueArray1<T1>(v1);
+}
+
+template <typename T1, typename T2>
+internal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {
+  return internal::ValueArray2<T1, T2>(v1, v2);
+}
+
+template <typename T1, typename T2, typename T3>
+internal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {
+  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+internal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {
+  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+internal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5) {
+  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+internal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6) {
+  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6, T7 v7) {
+  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,
+      v6, v7);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {
+  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,
+      v5, v6, v7, v8);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {
+  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,
+      v4, v5, v6, v7, v8, v9);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,
+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {
+  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,
+      v2, v3, v4, v5, v6, v7, v8, v9, v10);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
+    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11) {
+  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,
+      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12) {
+  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13) {
+  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {
+  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
+      v14);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {
+  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
+      v13, v14, v15);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16) {
+  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
+      v12, v13, v14, v15, v16);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17) {
+  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
+      v11, v12, v13, v14, v15, v16, v17);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18) {
+  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
+      v10, v11, v12, v13, v14, v15, v16, v17, v18);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {
+  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,
+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {
+  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,
+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {
+  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,
+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22) {
+  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,
+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23) {
+  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,
+      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24) {
+  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,
+      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
+      v19, v20, v21, v22, v23, v24);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,
+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
+    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
+    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {
+  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,
+      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
+      v18, v19, v20, v21, v22, v23, v24, v25);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26) {
+  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
+      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27) {
+  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
+      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28) {
+  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
+      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
+      v28);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29) {
+  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
+      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
+      v27, v28, v29);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
+    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
+    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {
+  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
+      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
+      v26, v27, v28, v29, v30);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {
+  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
+      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
+      v25, v26, v27, v28, v29, v30, v31);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32) {
+  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
+      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33) {
+  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,
+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
+    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
+    T31 v31, T32 v32, T33 v33, T34 v34) {
+  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,
+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
+      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {
+  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,
+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
+      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {
+  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,
+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
+      v34, v35, v36);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,
+    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
+    T37 v37) {
+  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,
+      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
+      v34, v35, v36, v37);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
+    T37 v37, T38 v38) {
+  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,
+      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,
+      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,
+      v33, v34, v35, v36, v37, v38);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,
+    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,
+    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,
+    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,
+    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,
+    T37 v37, T38 v38, T39 v39) {
+  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,
+      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,
+      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,
+      v32, v33, v34, v35, v36, v37, v38, v39);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,
+    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,
+    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,
+    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,
+    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,
+    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {
+  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,
+      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,
+      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {
+  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,
+      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,
+      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+    T42 v42) {
+  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,
+      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,
+      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,
+      v42);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+    T42 v42, T43 v43) {
+  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,
+      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,
+      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,
+      v41, v42, v43);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+    T42 v42, T43 v43, T44 v44) {
+  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,
+      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,
+      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,
+      v40, v41, v42, v43, v44);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
+    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
+    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
+    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
+    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {
+  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,
+      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,
+      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,
+      v39, v40, v41, v42, v43, v44, v45);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {
+  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,
+      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
+      v38, v39, v40, v41, v42, v43, v44, v45, v46);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {
+  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,
+      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,
+      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,
+      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,
+    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,
+    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,
+    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,
+    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,
+    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,
+    T48 v48) {
+  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,
+      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,
+      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,
+      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,
+    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,
+    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,
+    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,
+    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,
+    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,
+    T47 v47, T48 v48, T49 v49) {
+  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,
+      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,
+      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,
+      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,
+    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,
+    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,
+    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,
+    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,
+    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,
+    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {
+  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,
+      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,
+      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,
+      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,
+      v48, v49, v50);
+}
+
+// Bool() allows generating tests with parameters in a set of (false, true).
+//
+// Synopsis:
+// Bool()
+//   - returns a generator producing sequences with elements {false, true}.
+//
+// It is useful when testing code that depends on Boolean flags. Combinations
+// of multiple flags can be tested when several Bool()'s are combined using
+// Combine() function.
+//
+// In the following example all tests in the test case FlagDependentTest
+// will be instantiated twice with parameters false and true.
+//
+// class FlagDependentTest : public testing::TestWithParam<bool> {
+//   virtual void SetUp() {
+//     external_flag = GetParam();
+//   }
+// }
+// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
+//
+inline internal::ParamGenerator<bool> Bool() {
+  return Values(false, true);
+}
+
+# if GTEST_HAS_COMBINE
+// Combine() allows the user to combine two or more sequences to produce
+// values of a Cartesian product of those sequences' elements.
+//
+// Synopsis:
+// Combine(gen1, gen2, ..., genN)
+//   - returns a generator producing sequences with elements coming from
+//     the Cartesian product of elements from the sequences generated by
+//     gen1, gen2, ..., genN. The sequence elements will have a type of
+//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
+//     of elements from sequences produces by gen1, gen2, ..., genN.
+//
+// Combine can have up to 10 arguments. This number is currently limited
+// by the maximum number of elements in the tuple implementation used by Google
+// Test.
+//
+// Example:
+//
+// This will instantiate tests in test case AnimalTest each one with
+// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
+// tuple("dog", BLACK), and tuple("dog", WHITE):
+//
+// enum Color { BLACK, GRAY, WHITE };
+// class AnimalTest
+//     : public testing::TestWithParam<tuple<const char*, Color> > {...};
+//
+// TEST_P(AnimalTest, AnimalLooksNice) {...}
+//
+// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
+//                         Combine(Values("cat", "dog"),
+//                                 Values(BLACK, WHITE)));
+//
+// This will instantiate tests in FlagDependentTest with all variations of two
+// Boolean flags:
+//
+// class FlagDependentTest
+//     : public testing::TestWithParam<tuple<bool, bool> > {
+//   virtual void SetUp() {
+//     // Assigns external_flag_1 and external_flag_2 values from the tuple.
+//     tie(external_flag_1, external_flag_2) = GetParam();
+//   }
+// };
+//
+// TEST_P(FlagDependentTest, TestFeature1) {
+//   // Test your code using external_flag_1 and external_flag_2 here.
+// }
+// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
+//                         Combine(Bool(), Bool()));
+//
+template <typename Generator1, typename Generator2>
+internal::CartesianProductHolder2<Generator1, Generator2> Combine(
+    const Generator1& g1, const Generator2& g2) {
+  return internal::CartesianProductHolder2<Generator1, Generator2>(
+      g1, g2);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3>
+internal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3) {
+  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(
+      g1, g2, g3);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4>
+internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
+    Generator4> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4) {
+  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,
+      Generator4>(
+      g1, g2, g3, g4);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5>
+internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
+    Generator4, Generator5> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5) {
+  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,
+      Generator4, Generator5>(
+      g1, g2, g3, g4, g5);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6>
+internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6) {
+  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6>(
+      g1, g2, g3, g4, g5, g6);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7>
+internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7) {
+  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7>(
+      g1, g2, g3, g4, g5, g6, g7);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7, typename Generator8>
+internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7, const Generator8& g8) {
+  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7, Generator8>(
+      g1, g2, g3, g4, g5, g6, g7, g8);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7, typename Generator8, typename Generator9>
+internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7, Generator8,
+    Generator9> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7, const Generator8& g8, const Generator9& g9) {
+  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(
+      g1, g2, g3, g4, g5, g6, g7, g8, g9);
+}
+
+template <typename Generator1, typename Generator2, typename Generator3,
+    typename Generator4, typename Generator5, typename Generator6,
+    typename Generator7, typename Generator8, typename Generator9,
+    typename Generator10>
+internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
+    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
+    Generator10> Combine(
+    const Generator1& g1, const Generator2& g2, const Generator3& g3,
+        const Generator4& g4, const Generator5& g5, const Generator6& g6,
+        const Generator7& g7, const Generator8& g8, const Generator9& g9,
+        const Generator10& g10) {
+  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
+      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,
+      Generator10>(
+      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);
+}
+# endif  // GTEST_HAS_COMBINE
+
+
+
+# define TEST_P(test_case_name, test_name) \
+  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
+      : public test_case_name { \
+   public: \
+    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
+    virtual void TestBody(); \
+   private: \
+    static int AddToRegistry() { \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestPattern(\
+                      #test_case_name, \
+                      #test_name, \
+                      new ::testing::internal::TestMetaFactory< \
+                          GTEST_TEST_CLASS_NAME_(\
+                              test_case_name, test_name)>()); \
+      return 0; \
+    } \
+    static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(\
+        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
+  }; \
+  int GTEST_TEST_CLASS_NAME_(test_case_name, \
+                             test_name)::gtest_registering_dummy_ = \
+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
+  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
+
+// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
+// to specify a function or functor that generates custom test name suffixes
+// based on the test parameters. The function should accept one argument of
+// type testing::TestParamInfo<class ParamType>, and return std::string.
+//
+// testing::PrintToStringParamName is a builtin test suffix generator that
+// returns the value of testing::PrintToString(GetParam()). It does not work
+// for std::string or C strings.
+//
+// Note: test names must be non-empty, unique, and may only contain ASCII
+// alphanumeric characters or underscore.
+
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
+  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
+  ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+      const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+    return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+        (__VA_ARGS__)(info); \
+  } \
+  int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestCaseInstantiation(\
+                      #prefix, \
+                      &gtest_##prefix##test_case_name##_EvalGenerator_, \
+                      &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+                      __FILE__, __LINE__)
+
+}  // namespace testing
+
+#endif  // GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump
new file mode 100644
index 0000000..3078d6d
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-param-test.h.pump
@@ -0,0 +1,510 @@
+$$ -*- mode: c++; -*-
+$var n = 50  $$ Maximum length of Values arguments we want to support.
+$var maxtuple = 10  $$ Maximum number of Combine arguments we want to support.
+// 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.
+//
+// Authors: vladl@google.com (Vlad Losev)
+//
+// Macros and functions for implementing parameterized tests
+// in Google C++ Testing Framework (Google Test)
+//
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
+
+
+// Value-parameterized tests allow you to test your code with different
+// parameters without writing multiple copies of the same test.
+//
+// Here is how you use value-parameterized tests:
+
+#if 0
+
+// To write value-parameterized tests, first you should define a fixture
+// class. It is usually derived from testing::TestWithParam<T> (see below for
+// another inheritance scheme that's sometimes useful in more complicated
+// class hierarchies), where the type of your parameter values.
+// TestWithParam<T> is itself derived from testing::Test. T can be any
+// copyable type. If it's a raw pointer, you are responsible for managing the
+// lifespan of the pointed values.
+
+class FooTest : public ::testing::TestWithParam<const char*> {
+  // You can implement all the usual class fixture members here.
+};
+
+// Then, use the TEST_P macro to define as many parameterized tests
+// for this fixture as you want. The _P suffix is for "parameterized"
+// or "pattern", whichever you prefer to think.
+
+TEST_P(FooTest, DoesBlah) {
+  // Inside a test, access the test parameter with the GetParam() method
+  // of the TestWithParam<T> class:
+  EXPECT_TRUE(foo.Blah(GetParam()));
+  ...
+}
+
+TEST_P(FooTest, HasBlahBlah) {
+  ...
+}
+
+// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
+// case with any set of parameters you want. Google Test defines a number
+// of functions for generating test parameters. They return what we call
+// (surprise!) parameter generators. Here is a  summary of them, which
+// are all in the testing namespace:
+//
+//
+//  Range(begin, end [, step]) - Yields values {begin, begin+step,
+//                               begin+step+step, ...}. The values do not
+//                               include end. step defaults to 1.
+//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.
+//  ValuesIn(container)        - Yields values from a C-style array, an STL
+//  ValuesIn(begin,end)          container, or an iterator range [begin, end).
+//  Bool()                     - Yields sequence {false, true}.
+//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product
+//                               for the math savvy) of the values generated
+//                               by the N generators.
+//
+// For more details, see comments at the definitions of these functions below
+// in this file.
+//
+// The following statement will instantiate tests from the FooTest test case
+// each with parameter values "meeny", "miny", and "moe".
+
+INSTANTIATE_TEST_CASE_P(InstantiationName,
+                        FooTest,
+                        Values("meeny", "miny", "moe"));
+
+// To distinguish different instances of the pattern, (yes, you
+// can instantiate it more then once) the first argument to the
+// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
+// actual test case name. Remember to pick unique prefixes for different
+// instantiations. The tests from the instantiation above will have
+// these names:
+//
+//    * InstantiationName/FooTest.DoesBlah/0 for "meeny"
+//    * InstantiationName/FooTest.DoesBlah/1 for "miny"
+//    * InstantiationName/FooTest.DoesBlah/2 for "moe"
+//    * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
+//    * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
+//    * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
+//
+// You can use these names in --gtest_filter.
+//
+// This statement will instantiate all tests from FooTest again, each
+// with parameter values "cat" and "dog":
+
+const char* pets[] = {"cat", "dog"};
+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
+
+// The tests from the instantiation above will have these names:
+//
+//    * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
+//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
+//
+// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
+// in the given test case, whether their definitions come before or
+// AFTER the INSTANTIATE_TEST_CASE_P statement.
+//
+// Please also note that generator expressions (including parameters to the
+// generators) are evaluated in InitGoogleTest(), after main() has started.
+// This allows the user on one hand, to adjust generator parameters in order
+// to dynamically determine a set of tests to run and on the other hand,
+// give the user a chance to inspect the generated tests with Google Test
+// reflection API before RUN_ALL_TESTS() is executed.
+//
+// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
+// for more examples.
+//
+// In the future, we plan to publish the API for defining new parameter
+// generators. But for now this interface remains part of the internal
+// implementation and is subject to change.
+//
+//
+// A parameterized test fixture must be derived from testing::Test and from
+// testing::WithParamInterface<T>, where T is the type of the parameter
+// values. Inheriting from TestWithParam<T> satisfies that requirement because
+// TestWithParam<T> inherits from both Test and WithParamInterface. In more
+// complicated hierarchies, however, it is occasionally useful to inherit
+// separately from Test and WithParamInterface. For example:
+
+class BaseTest : public ::testing::Test {
+  // You can inherit all the usual members for a non-parameterized test
+  // fixture here.
+};
+
+class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
+  // The usual test fixture members go here too.
+};
+
+TEST_F(BaseTest, HasFoo) {
+  // This is an ordinary non-parameterized test.
+}
+
+TEST_P(DerivedTest, DoesBlah) {
+  // GetParam works just the same here as if you inherit from TestWithParam.
+  EXPECT_TRUE(foo.Blah(GetParam()));
+}
+
+#endif  // 0
+
+#include "gtest/internal/gtest-port.h"
+
+#if !GTEST_OS_SYMBIAN
+# include <utility>
+#endif
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-param-util-generated.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Functions producing parameter generators.
+//
+// Google Test uses these generators to produce parameters for value-
+// parameterized tests. When a parameterized test case is instantiated
+// with a particular generator, Google Test creates and runs tests
+// for each element in the sequence produced by the generator.
+//
+// In the following sample, tests from test case FooTest are instantiated
+// each three times with parameter values 3, 5, and 8:
+//
+// class FooTest : public TestWithParam<int> { ... };
+//
+// TEST_P(FooTest, TestThis) {
+// }
+// TEST_P(FooTest, TestThat) {
+// }
+// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
+//
+
+// Range() returns generators providing sequences of values in a range.
+//
+// Synopsis:
+// Range(start, end)
+//   - returns a generator producing a sequence of values {start, start+1,
+//     start+2, ..., }.
+// Range(start, end, step)
+//   - returns a generator producing a sequence of values {start, start+step,
+//     start+step+step, ..., }.
+// Notes:
+//   * The generated sequences never include end. For example, Range(1, 5)
+//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
+//     returns a generator producing {1, 3, 5, 7}.
+//   * start and end must have the same type. That type may be any integral or
+//     floating-point type or a user defined type satisfying these conditions:
+//     * It must be assignable (have operator=() defined).
+//     * It must have operator+() (operator+(int-compatible type) for
+//       two-operand version).
+//     * It must have operator<() defined.
+//     Elements in the resulting sequences will also have that type.
+//   * Condition start < end must be satisfied in order for resulting sequences
+//     to contain any elements.
+//
+template <typename T, typename IncrementT>
+internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
+  return internal::ParamGenerator<T>(
+      new internal::RangeGenerator<T, IncrementT>(start, end, step));
+}
+
+template <typename T>
+internal::ParamGenerator<T> Range(T start, T end) {
+  return Range(start, end, 1);
+}
+
+// ValuesIn() function allows generation of tests with parameters coming from
+// a container.
+//
+// Synopsis:
+// ValuesIn(const T (&array)[N])
+//   - returns a generator producing sequences with elements from
+//     a C-style array.
+// ValuesIn(const Container& container)
+//   - returns a generator producing sequences with elements from
+//     an STL-style container.
+// ValuesIn(Iterator begin, Iterator end)
+//   - returns a generator producing sequences with elements from
+//     a range [begin, end) defined by a pair of STL-style iterators. These
+//     iterators can also be plain C pointers.
+//
+// Please note that ValuesIn copies the values from the containers
+// passed in and keeps them to generate tests in RUN_ALL_TESTS().
+//
+// Examples:
+//
+// This instantiates tests from test case StringTest
+// each with C-string values of "foo", "bar", and "baz":
+//
+// const char* strings[] = {"foo", "bar", "baz"};
+// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
+//
+// This instantiates tests from test case StlStringTest
+// each with STL strings with values "a" and "b":
+//
+// ::std::vector< ::std::string> GetParameterStrings() {
+//   ::std::vector< ::std::string> v;
+//   v.push_back("a");
+//   v.push_back("b");
+//   return v;
+// }
+//
+// INSTANTIATE_TEST_CASE_P(CharSequence,
+//                         StlStringTest,
+//                         ValuesIn(GetParameterStrings()));
+//
+//
+// This will also instantiate tests from CharTest
+// each with parameter values 'a' and 'b':
+//
+// ::std::list<char> GetParameterChars() {
+//   ::std::list<char> list;
+//   list.push_back('a');
+//   list.push_back('b');
+//   return list;
+// }
+// ::std::list<char> l = GetParameterChars();
+// INSTANTIATE_TEST_CASE_P(CharSequence2,
+//                         CharTest,
+//                         ValuesIn(l.begin(), l.end()));
+//
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end) {
+  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
+      ::value_type ParamType;
+  return internal::ParamGenerator<ParamType>(
+      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
+}
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
+  return ValuesIn(array, array + N);
+}
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container) {
+  return ValuesIn(container.begin(), container.end());
+}
+
+// Values() allows generating tests from explicitly specified list of
+// parameters.
+//
+// Synopsis:
+// Values(T v1, T v2, ..., T vN)
+//   - returns a generator producing sequences with elements v1, v2, ..., vN.
+//
+// For example, this instantiates tests from test case BarTest each
+// with values "one", "two", and "three":
+//
+// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
+//
+// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
+// The exact type of values will depend on the type of parameter in BazTest.
+//
+// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
+//
+// Currently, Values() supports from 1 to $n parameters.
+//
+$range i 1..n
+$for i [[
+$range j 1..i
+
+template <$for j, [[typename T$j]]>
+internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) {
+  return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]);
+}
+
+]]
+
+// Bool() allows generating tests with parameters in a set of (false, true).
+//
+// Synopsis:
+// Bool()
+//   - returns a generator producing sequences with elements {false, true}.
+//
+// It is useful when testing code that depends on Boolean flags. Combinations
+// of multiple flags can be tested when several Bool()'s are combined using
+// Combine() function.
+//
+// In the following example all tests in the test case FlagDependentTest
+// will be instantiated twice with parameters false and true.
+//
+// class FlagDependentTest : public testing::TestWithParam<bool> {
+//   virtual void SetUp() {
+//     external_flag = GetParam();
+//   }
+// }
+// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
+//
+inline internal::ParamGenerator<bool> Bool() {
+  return Values(false, true);
+}
+
+# if GTEST_HAS_COMBINE
+// Combine() allows the user to combine two or more sequences to produce
+// values of a Cartesian product of those sequences' elements.
+//
+// Synopsis:
+// Combine(gen1, gen2, ..., genN)
+//   - returns a generator producing sequences with elements coming from
+//     the Cartesian product of elements from the sequences generated by
+//     gen1, gen2, ..., genN. The sequence elements will have a type of
+//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
+//     of elements from sequences produces by gen1, gen2, ..., genN.
+//
+// Combine can have up to $maxtuple arguments. This number is currently limited
+// by the maximum number of elements in the tuple implementation used by Google
+// Test.
+//
+// Example:
+//
+// This will instantiate tests in test case AnimalTest each one with
+// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
+// tuple("dog", BLACK), and tuple("dog", WHITE):
+//
+// enum Color { BLACK, GRAY, WHITE };
+// class AnimalTest
+//     : public testing::TestWithParam<tuple<const char*, Color> > {...};
+//
+// TEST_P(AnimalTest, AnimalLooksNice) {...}
+//
+// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
+//                         Combine(Values("cat", "dog"),
+//                                 Values(BLACK, WHITE)));
+//
+// This will instantiate tests in FlagDependentTest with all variations of two
+// Boolean flags:
+//
+// class FlagDependentTest
+//     : public testing::TestWithParam<tuple<bool, bool> > {
+//   virtual void SetUp() {
+//     // Assigns external_flag_1 and external_flag_2 values from the tuple.
+//     tie(external_flag_1, external_flag_2) = GetParam();
+//   }
+// };
+//
+// TEST_P(FlagDependentTest, TestFeature1) {
+//   // Test your code using external_flag_1 and external_flag_2 here.
+// }
+// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
+//                         Combine(Bool(), Bool()));
+//
+$range i 2..maxtuple
+$for i [[
+$range j 1..i
+
+template <$for j, [[typename Generator$j]]>
+internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine(
+    $for j, [[const Generator$j& g$j]]) {
+  return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>(
+      $for j, [[g$j]]);
+}
+
+]]
+# endif  // GTEST_HAS_COMBINE
+
+
+
+# define TEST_P(test_case_name, test_name) \
+  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
+      : public test_case_name { \
+   public: \
+    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
+    virtual void TestBody(); \
+   private: \
+    static int AddToRegistry() { \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestPattern(\
+                      #test_case_name, \
+                      #test_name, \
+                      new ::testing::internal::TestMetaFactory< \
+                          GTEST_TEST_CLASS_NAME_(\
+                              test_case_name, test_name)>()); \
+      return 0; \
+    } \
+    static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(\
+        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
+  }; \
+  int GTEST_TEST_CLASS_NAME_(test_case_name, \
+                             test_name)::gtest_registering_dummy_ = \
+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
+  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
+
+// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
+// to specify a function or functor that generates custom test name suffixes
+// based on the test parameters. The function should accept one argument of
+// type testing::TestParamInfo<class ParamType>, and return std::string.
+//
+// testing::PrintToStringParamName is a builtin test suffix generator that
+// returns the value of testing::PrintToString(GetParam()).
+//
+// Note: test names must be non-empty, unique, and may only contain ASCII
+// alphanumeric characters or underscore. Because PrintToString adds quotes
+// to std::string and C strings, it won't work for these types.
+
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
+  ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
+  ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+      const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+    return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+        (__VA_ARGS__)(info); \
+  } \
+  int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
+          GetTestCasePatternHolder<test_case_name>(\
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestCaseInstantiation(\
+                      #prefix, \
+                      &gtest_##prefix##test_case_name##_EvalGenerator_, \
+                      &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+                      __FILE__, __LINE__)
+
+}  // namespace testing
+
+#endif  // GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-printers.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-printers.h
new file mode 100644
index 0000000..8a33164
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-printers.h
@@ -0,0 +1,993 @@
+// 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 Test - The Google C++ Testing Framework
+//
+// This file implements a universal value printer that can print a
+// value of any type T:
+//
+//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
+//
+// A user can teach this function how to print a class type T by
+// defining either operator<<() or PrintTo() in the namespace that
+// defines T.  More specifically, the FIRST defined function in the
+// following list will be used (assuming T is defined in namespace
+// foo):
+//
+//   1. foo::PrintTo(const T&, ostream*)
+//   2. operator<<(ostream&, const T&) defined in either foo or the
+//      global namespace.
+//
+// If none of the above is defined, it will print the debug string of
+// the value if it is a protocol buffer, or print the raw bytes in the
+// value otherwise.
+//
+// To aid debugging: when T is a reference type, the address of the
+// value is also printed; when T is a (const) char pointer, both the
+// pointer value and the NUL-terminated string it points to are
+// printed.
+//
+// We also provide some convenient wrappers:
+//
+//   // Prints a value to a string.  For a (const or not) char
+//   // pointer, the NUL-terminated string (but not the pointer) is
+//   // printed.
+//   std::string ::testing::PrintToString(const T& value);
+//
+//   // Prints a value tersely: for a reference type, the referenced
+//   // value (but not the address) is printed; for a (const or not) char
+//   // pointer, the NUL-terminated string (but not the pointer) is
+//   // printed.
+//   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
+//
+//   // Prints value using the type inferred by the compiler.  The difference
+//   // from UniversalTersePrint() is that this function prints both the
+//   // pointer and the NUL-terminated string for a (const or not) char pointer.
+//   void ::testing::internal::UniversalPrint(const T& value, ostream*);
+//
+//   // Prints the fields of a tuple tersely to a string vector, one
+//   // element for each field. Tuple support must be enabled in
+//   // gtest-port.h.
+//   std::vector<string> UniversalTersePrintTupleFieldsToStrings(
+//       const Tuple& value);
+//
+// Known limitation:
+//
+// The print primitives print the elements of an STL-style container
+// using the compiler-inferred type of *iter where iter is a
+// const_iterator of the container.  When const_iterator is an input
+// iterator but not a forward iterator, this inferred type may not
+// match value_type, and the print output may be incorrect.  In
+// practice, this is rarely a problem as for most containers
+// const_iterator is a forward iterator.  We'll fix this if there's an
+// actual need for it.  Note that this fix cannot rely on value_type
+// being defined as many user-defined container types don't have
+// value_type.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
+
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
+#include "gtest/internal/gtest-port.h"
+#include "gtest/internal/gtest-internal.h"
+
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>
+#endif
+
+namespace testing {
+
+// Definitions in the 'internal' and 'internal2' name spaces are
+// subject to change without notice.  DO NOT USE THEM IN USER CODE!
+namespace internal2 {
+
+// Prints the given number of bytes in the given object to the given
+// ostream.
+GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
+                                     size_t count,
+                                     ::std::ostream* os);
+
+// For selecting which printer to use when a given type has neither <<
+// nor PrintTo().
+enum TypeKind {
+  kProtobuf,              // a protobuf type
+  kConvertibleToInteger,  // a type implicitly convertible to BiggestInt
+                          // (e.g. a named or unnamed enum type)
+  kOtherType              // anything else
+};
+
+// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
+// by the universal printer to print a value of type T when neither
+// operator<< nor PrintTo() is defined for T, where kTypeKind is the
+// "kind" of T as defined by enum TypeKind.
+template <typename T, TypeKind kTypeKind>
+class TypeWithoutFormatter {
+ public:
+  // This default version is called when kTypeKind is kOtherType.
+  static void PrintValue(const T& value, ::std::ostream* os) {
+    PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
+                         sizeof(value), os);
+  }
+};
+
+// We print a protobuf using its ShortDebugString() when the string
+// doesn't exceed this many characters; otherwise we print it using
+// DebugString() for better readability.
+const size_t kProtobufOneLinerMaxLength = 50;
+
+template <typename T>
+class TypeWithoutFormatter<T, kProtobuf> {
+ public:
+  static void PrintValue(const T& value, ::std::ostream* os) {
+    const ::testing::internal::string short_str = value.ShortDebugString();
+    const ::testing::internal::string pretty_str =
+        short_str.length() <= kProtobufOneLinerMaxLength ?
+        short_str : ("\n" + value.DebugString());
+    *os << ("<" + pretty_str + ">");
+  }
+};
+
+template <typename T>
+class TypeWithoutFormatter<T, kConvertibleToInteger> {
+ public:
+  // Since T has no << operator or PrintTo() but can be implicitly
+  // converted to BiggestInt, we print it as a BiggestInt.
+  //
+  // Most likely T is an enum type (either named or unnamed), in which
+  // case printing it as an integer is the desired behavior.  In case
+  // T is not an enum, printing it as an integer is the best we can do
+  // given that it has no user-defined printer.
+  static void PrintValue(const T& value, ::std::ostream* os) {
+    const internal::BiggestInt kBigInt = value;
+    *os << kBigInt;
+  }
+};
+
+// Prints the given value to the given ostream.  If the value is a
+// protocol message, its debug string is printed; if it's an enum or
+// of a type implicitly convertible to BiggestInt, it's printed as an
+// integer; otherwise the bytes in the value are printed.  This is
+// what UniversalPrinter<T>::Print() does when it knows nothing about
+// type T and T has neither << operator nor PrintTo().
+//
+// A user can override this behavior for a class type Foo by defining
+// a << operator in the namespace where Foo is defined.
+//
+// We put this operator in namespace 'internal2' instead of 'internal'
+// to simplify the implementation, as much code in 'internal' needs to
+// use << in STL, which would conflict with our own << were it defined
+// in 'internal'.
+//
+// Note that this operator<< takes a generic std::basic_ostream<Char,
+// CharTraits> type instead of the more restricted std::ostream.  If
+// we define it to take an std::ostream instead, we'll get an
+// "ambiguous overloads" compiler error when trying to print a type
+// Foo that supports streaming to std::basic_ostream<Char,
+// CharTraits>, as the compiler cannot tell whether
+// operator<<(std::ostream&, const T&) or
+// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
+// specific.
+template <typename Char, typename CharTraits, typename T>
+::std::basic_ostream<Char, CharTraits>& operator<<(
+    ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
+  TypeWithoutFormatter<T,
+      (internal::IsAProtocolMessage<T>::value ? kProtobuf :
+       internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
+       kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
+  return os;
+}
+
+}  // namespace internal2
+}  // namespace testing
+
+// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
+// magic needed for implementing UniversalPrinter won't work.
+namespace testing_internal {
+
+// Used to print a value that is not an STL-style container when the
+// user doesn't define PrintTo() for it.
+template <typename T>
+void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
+  // With the following statement, during unqualified name lookup,
+  // testing::internal2::operator<< appears as if it was declared in
+  // the nearest enclosing namespace that contains both
+  // ::testing_internal and ::testing::internal2, i.e. the global
+  // namespace.  For more details, refer to the C++ Standard section
+  // 7.3.4-1 [namespace.udir].  This allows us to fall back onto
+  // testing::internal2::operator<< in case T doesn't come with a <<
+  // operator.
+  //
+  // We cannot write 'using ::testing::internal2::operator<<;', which
+  // gcc 3.3 fails to compile due to a compiler bug.
+  using namespace ::testing::internal2;  // NOLINT
+
+  // Assuming T is defined in namespace foo, in the next statement,
+  // the compiler will consider all of:
+  //
+  //   1. foo::operator<< (thanks to Koenig look-up),
+  //   2. ::operator<< (as the current namespace is enclosed in ::),
+  //   3. testing::internal2::operator<< (thanks to the using statement above).
+  //
+  // The operator<< whose type matches T best will be picked.
+  //
+  // We deliberately allow #2 to be a candidate, as sometimes it's
+  // impossible to define #1 (e.g. when foo is ::std, defining
+  // anything in it is undefined behavior unless you are a compiler
+  // vendor.).
+  *os << value;
+}
+
+}  // namespace testing_internal
+
+namespace testing {
+namespace internal {
+
+// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
+// value of type ToPrint that is an operand of a comparison assertion
+// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
+// the comparison, and is used to help determine the best way to
+// format the value.  In particular, when the value is a C string
+// (char pointer) and the other operand is an STL string object, we
+// want to format the C string as a string, since we know it is
+// compared by value with the string object.  If the value is a char
+// pointer but the other operand is not an STL string object, we don't
+// know whether the pointer is supposed to point to a NUL-terminated
+// string, and thus want to print it as a pointer to be safe.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+// The default case.
+template <typename ToPrint, typename OtherOperand>
+class FormatForComparison {
+ public:
+  static ::std::string Format(const ToPrint& value) {
+    return ::testing::PrintToString(value);
+  }
+};
+
+// Array.
+template <typename ToPrint, size_t N, typename OtherOperand>
+class FormatForComparison<ToPrint[N], OtherOperand> {
+ public:
+  static ::std::string Format(const ToPrint* value) {
+    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
+  }
+};
+
+// By default, print C string as pointers to be safe, as we don't know
+// whether they actually point to a NUL-terminated string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
+  template <typename OtherOperand>                                      \
+  class FormatForComparison<CharType*, OtherOperand> {                  \
+   public:                                                              \
+    static ::std::string Format(CharType* value) {                      \
+      return ::testing::PrintToString(static_cast<const void*>(value)); \
+    }                                                                   \
+  }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
+
+// If a C string is compared with an STL string object, we know it's meant
+// to point to a NUL-terminated string, and thus can print it as a string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
+  template <>                                                           \
+  class FormatForComparison<CharType*, OtherStringType> {               \
+   public:                                                              \
+    static ::std::string Format(CharType* value) {                      \
+      return ::testing::PrintToString(value);                           \
+    }                                                                   \
+  }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
+
+#if GTEST_HAS_GLOBAL_STRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
+#endif
+
+#if GTEST_HAS_GLOBAL_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
+#endif
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
+#endif
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
+
+// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
+// operand to be used in a failure message.  The type (but not value)
+// of the other operand may affect the format.  This allows us to
+// print a char* as a raw pointer when it is compared against another
+// char* or void*, and print it as a C string when it is compared
+// against an std::string object, for example.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+template <typename T1, typename T2>
+std::string FormatForComparisonFailureMessage(
+    const T1& value, const T2& /* other_operand */) {
+  return FormatForComparison<T1, T2>::Format(value);
+}
+
+// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
+// value to the given ostream.  The caller must ensure that
+// 'ostream_ptr' is not NULL, or the behavior is undefined.
+//
+// We define UniversalPrinter as a class template (as opposed to a
+// function template), as we need to partially specialize it for
+// reference types, which cannot be done with function templates.
+template <typename T>
+class UniversalPrinter;
+
+template <typename T>
+void UniversalPrint(const T& value, ::std::ostream* os);
+
+// Used to print an STL-style container when the user doesn't define
+// a PrintTo() for it.
+template <typename C>
+void DefaultPrintTo(IsContainer /* dummy */,
+                    false_type /* is not a pointer */,
+                    const C& container, ::std::ostream* os) {
+  const size_t kMaxCount = 32;  // The maximum number of elements to print.
+  *os << '{';
+  size_t count = 0;
+  for (typename C::const_iterator it = container.begin();
+       it != container.end(); ++it, ++count) {
+    if (count > 0) {
+      *os << ',';
+      if (count == kMaxCount) {  // Enough has been printed.
+        *os << " ...";
+        break;
+      }
+    }
+    *os << ' ';
+    // We cannot call PrintTo(*it, os) here as PrintTo() doesn't
+    // handle *it being a native array.
+    internal::UniversalPrint(*it, os);
+  }
+
+  if (count > 0) {
+    *os << ' ';
+  }
+  *os << '}';
+}
+
+// Used to print a pointer that is neither a char pointer nor a member
+// pointer, when the user doesn't define PrintTo() for it.  (A member
+// variable pointer or member function pointer doesn't really point to
+// a location in the address space.  Their representation is
+// implementation-defined.  Therefore they will be printed as raw
+// bytes.)
+template <typename T>
+void DefaultPrintTo(IsNotContainer /* dummy */,
+                    true_type /* is a pointer */,
+                    T* p, ::std::ostream* os) {
+  if (p == NULL) {
+    *os << "NULL";
+  } else {
+    // C++ doesn't allow casting from a function pointer to any object
+    // pointer.
+    //
+    // IsTrue() silences warnings: "Condition is always true",
+    // "unreachable code".
+    if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
+      // T is not a function type.  We just call << to print p,
+      // relying on ADL to pick up user-defined << for their pointer
+      // types, if any.
+      *os << p;
+    } else {
+      // T is a function type, so '*os << p' doesn't do what we want
+      // (it just prints p as bool).  We want to print p as a const
+      // void*.  However, we cannot cast it to const void* directly,
+      // even using reinterpret_cast, as earlier versions of gcc
+      // (e.g. 3.4.5) cannot compile the cast when p is a function
+      // pointer.  Casting to UInt64 first solves the problem.
+      *os << reinterpret_cast<const void*>(
+          reinterpret_cast<internal::UInt64>(p));
+    }
+  }
+}
+
+// Used to print a non-container, non-pointer value when the user
+// doesn't define PrintTo() for it.
+template <typename T>
+void DefaultPrintTo(IsNotContainer /* dummy */,
+                    false_type /* is not a pointer */,
+                    const T& value, ::std::ostream* os) {
+  ::testing_internal::DefaultPrintNonContainerTo(value, os);
+}
+
+// Prints the given value using the << operator if it has one;
+// otherwise prints the bytes in it.  This is what
+// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
+// or overloaded for type T.
+//
+// A user can override this behavior for a class type Foo by defining
+// an overload of PrintTo() in the namespace where Foo is defined.  We
+// give the user this option as sometimes defining a << operator for
+// Foo is not desirable (e.g. the coding style may prevent doing it,
+// or there is already a << operator but it doesn't do what the user
+// wants).
+template <typename T>
+void PrintTo(const T& value, ::std::ostream* os) {
+  // DefaultPrintTo() is overloaded.  The type of its first two
+  // arguments determine which version will be picked.  If T is an
+  // STL-style container, the version for container will be called; if
+  // T is a pointer, the pointer version will be called; otherwise the
+  // generic version will be called.
+  //
+  // Note that we check for container types here, prior to we check
+  // for protocol message types in our operator<<.  The rationale is:
+  //
+  // For protocol messages, we want to give people a chance to
+  // override Google Mock's format by defining a PrintTo() or
+  // operator<<.  For STL containers, other formats can be
+  // incompatible with Google Mock's format for the container
+  // elements; therefore we check for container types here to ensure
+  // that our format is used.
+  //
+  // The second argument of DefaultPrintTo() is needed to bypass a bug
+  // in Symbian's C++ compiler that prevents it from picking the right
+  // overload between:
+  //
+  //   PrintTo(const T& x, ...);
+  //   PrintTo(T* x, ...);
+  DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
+}
+
+// The following list of PrintTo() overloads tells
+// UniversalPrinter<T>::Print() how to print standard types (built-in
+// types, strings, plain arrays, and pointers).
+
+// Overloads for various char types.
+GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
+GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
+inline void PrintTo(char c, ::std::ostream* os) {
+  // When printing a plain char, we always treat it as unsigned.  This
+  // way, the output won't be affected by whether the compiler thinks
+  // char is signed or not.
+  PrintTo(static_cast<unsigned char>(c), os);
+}
+
+// Overloads for other simple built-in types.
+inline void PrintTo(bool x, ::std::ostream* os) {
+  *os << (x ? "true" : "false");
+}
+
+// Overload for wchar_t type.
+// Prints a wchar_t as a symbol if it is printable or as its internal
+// code otherwise and also as its decimal code (except for L'\0').
+// The L'\0' char is printed as "L'\\0'". The decimal code is printed
+// as signed integer when wchar_t is implemented by the compiler
+// as a signed type and is printed as an unsigned integer when wchar_t
+// is implemented as an unsigned type.
+GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
+
+// Overloads for C strings.
+GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
+inline void PrintTo(char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const char*>(s), os);
+}
+
+// signed/unsigned char is often used for representing binary data, so
+// we print pointers to it as void* to be safe.
+inline void PrintTo(const signed char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+inline void PrintTo(signed char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+inline void PrintTo(unsigned char* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const void*>(s), os);
+}
+
+// MSVC can be configured to define wchar_t as a typedef of unsigned
+// short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
+// type.  When wchar_t is a typedef, defining an overload for const
+// wchar_t* would cause unsigned short* be printed as a wide string,
+// possibly causing invalid memory accesses.
+#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
+// Overloads for wide C strings
+GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
+inline void PrintTo(wchar_t* s, ::std::ostream* os) {
+  PrintTo(ImplicitCast_<const wchar_t*>(s), os);
+}
+#endif
+
+// Overload for C arrays.  Multi-dimensional arrays are printed
+// properly.
+
+// Prints the given number of elements in an array, without printing
+// the curly braces.
+template <typename T>
+void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
+  UniversalPrint(a[0], os);
+  for (size_t i = 1; i != count; i++) {
+    *os << ", ";
+    UniversalPrint(a[i], os);
+  }
+}
+
+// Overloads for ::string and ::std::string.
+#if GTEST_HAS_GLOBAL_STRING
+GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
+inline void PrintTo(const ::string& s, ::std::ostream* os) {
+  PrintStringTo(s, os);
+}
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
+inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
+  PrintStringTo(s, os);
+}
+
+// Overloads for ::wstring and ::std::wstring.
+#if GTEST_HAS_GLOBAL_WSTRING
+GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
+inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
+  PrintWideStringTo(s, os);
+}
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
+inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
+  PrintWideStringTo(s, os);
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+// Helper function for printing a tuple.  T must be instantiated with
+// a tuple type.
+template <typename T>
+void PrintTupleTo(const T& t, ::std::ostream* os);
+#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE
+// Overload for ::std::tr1::tuple.  Needed for printing function arguments,
+// which are packed as tuples.
+
+// Overloaded PrintTo() for tuples of various arities.  We support
+// tuples of up-to 10 fields.  The following implementation works
+// regardless of whether tr1::tuple is implemented using the
+// non-standard variadic template feature or not.
+
+inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1>
+void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2>
+void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7, typename T8>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7, typename T8, typename T9>
+void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
+             ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+          typename T6, typename T7, typename T8, typename T9, typename T10>
+void PrintTo(
+    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
+    ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+#endif  // GTEST_HAS_TR1_TUPLE
+
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+#endif  // GTEST_HAS_STD_TUPLE_
+
+// Overload for std::pair.
+template <typename T1, typename T2>
+void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
+  *os << '(';
+  // We cannot use UniversalPrint(value.first, os) here, as T1 may be
+  // a reference type.  The same for printing value.second.
+  UniversalPrinter<T1>::Print(value.first, os);
+  *os << ", ";
+  UniversalPrinter<T2>::Print(value.second, os);
+  *os << ')';
+}
+
+// Implements printing a non-reference type T by letting the compiler
+// pick the right overload of PrintTo() for T.
+template <typename T>
+class UniversalPrinter {
+ public:
+  // MSVC warns about adding const to a function type, so we want to
+  // disable the warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
+
+  // Note: we deliberately don't call this PrintTo(), as that name
+  // conflicts with ::testing::internal::PrintTo in the body of the
+  // function.
+  static void Print(const T& value, ::std::ostream* os) {
+    // By default, ::testing::internal::PrintTo() is used for printing
+    // the value.
+    //
+    // Thanks to Koenig look-up, if T is a class and has its own
+    // PrintTo() function defined in its namespace, that function will
+    // be visible here.  Since it is more specific than the generic ones
+    // in ::testing::internal, it will be picked by the compiler in the
+    // following statement - exactly what we want.
+    PrintTo(value, os);
+  }
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+};
+
+// UniversalPrintArray(begin, len, os) prints an array of 'len'
+// elements, starting at address 'begin'.
+template <typename T>
+void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
+  if (len == 0) {
+    *os << "{}";
+  } else {
+    *os << "{ ";
+    const size_t kThreshold = 18;
+    const size_t kChunkSize = 8;
+    // If the array has more than kThreshold elements, we'll have to
+    // omit some details by printing only the first and the last
+    // kChunkSize elements.
+    // TODO(wan@google.com): let the user control the threshold using a flag.
+    if (len <= kThreshold) {
+      PrintRawArrayTo(begin, len, os);
+    } else {
+      PrintRawArrayTo(begin, kChunkSize, os);
+      *os << ", ..., ";
+      PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
+    }
+    *os << " }";
+  }
+}
+// This overload prints a (const) char array compactly.
+GTEST_API_ void UniversalPrintArray(
+    const char* begin, size_t len, ::std::ostream* os);
+
+// This overload prints a (const) wchar_t array compactly.
+GTEST_API_ void UniversalPrintArray(
+    const wchar_t* begin, size_t len, ::std::ostream* os);
+
+// Implements printing an array type T[N].
+template <typename T, size_t N>
+class UniversalPrinter<T[N]> {
+ public:
+  // Prints the given array, omitting some elements when there are too
+  // many.
+  static void Print(const T (&a)[N], ::std::ostream* os) {
+    UniversalPrintArray(a, N, os);
+  }
+};
+
+// Implements printing a reference type T&.
+template <typename T>
+class UniversalPrinter<T&> {
+ public:
+  // MSVC warns about adding const to a function type, so we want to
+  // disable the warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
+
+  static void Print(const T& value, ::std::ostream* os) {
+    // Prints the address of the value.  We use reinterpret_cast here
+    // as static_cast doesn't compile when T is a function type.
+    *os << "@" << reinterpret_cast<const void*>(&value) << " ";
+
+    // Then prints the value itself.
+    UniversalPrint(value, os);
+  }
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+};
+
+// Prints a value tersely: for a reference type, the referenced value
+// (but not the address) is printed; for a (const) char pointer, the
+// NUL-terminated string (but not the pointer) is printed.
+
+template <typename T>
+class UniversalTersePrinter {
+ public:
+  static void Print(const T& value, ::std::ostream* os) {
+    UniversalPrint(value, os);
+  }
+};
+template <typename T>
+class UniversalTersePrinter<T&> {
+ public:
+  static void Print(const T& value, ::std::ostream* os) {
+    UniversalPrint(value, os);
+  }
+};
+template <typename T, size_t N>
+class UniversalTersePrinter<T[N]> {
+ public:
+  static void Print(const T (&value)[N], ::std::ostream* os) {
+    UniversalPrinter<T[N]>::Print(value, os);
+  }
+};
+template <>
+class UniversalTersePrinter<const char*> {
+ public:
+  static void Print(const char* str, ::std::ostream* os) {
+    if (str == NULL) {
+      *os << "NULL";
+    } else {
+      UniversalPrint(string(str), os);
+    }
+  }
+};
+template <>
+class UniversalTersePrinter<char*> {
+ public:
+  static void Print(char* str, ::std::ostream* os) {
+    UniversalTersePrinter<const char*>::Print(str, os);
+  }
+};
+
+#if GTEST_HAS_STD_WSTRING
+template <>
+class UniversalTersePrinter<const wchar_t*> {
+ public:
+  static void Print(const wchar_t* str, ::std::ostream* os) {
+    if (str == NULL) {
+      *os << "NULL";
+    } else {
+      UniversalPrint(::std::wstring(str), os);
+    }
+  }
+};
+#endif
+
+template <>
+class UniversalTersePrinter<wchar_t*> {
+ public:
+  static void Print(wchar_t* str, ::std::ostream* os) {
+    UniversalTersePrinter<const wchar_t*>::Print(str, os);
+  }
+};
+
+template <typename T>
+void UniversalTersePrint(const T& value, ::std::ostream* os) {
+  UniversalTersePrinter<T>::Print(value, os);
+}
+
+// Prints a value using the type inferred by the compiler.  The
+// difference between this and UniversalTersePrint() is that for a
+// (const) char pointer, this prints both the pointer and the
+// NUL-terminated string.
+template <typename T>
+void UniversalPrint(const T& value, ::std::ostream* os) {
+  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
+  // UniversalPrinter with T directly.
+  typedef T T1;
+  UniversalPrinter<T1>::Print(value, os);
+}
+
+typedef ::std::vector<string> Strings;
+
+// TuplePolicy<TupleT> must provide:
+// - tuple_size
+//     size of tuple TupleT.
+// - get<size_t I>(const TupleT& t)
+//     static function extracting element I of tuple TupleT.
+// - tuple_element<size_t I>::type
+//     type of element I of tuple TupleT.
+template <typename TupleT>
+struct TuplePolicy;
+
+#if GTEST_HAS_TR1_TUPLE
+template <typename TupleT>
+struct TuplePolicy {
+  typedef TupleT Tuple;
+  static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
+
+  template <size_t I>
+  struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
+
+  template <size_t I>
+  static typename AddReference<
+      const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
+      const Tuple& tuple) {
+    return ::std::tr1::get<I>(tuple);
+  }
+};
+template <typename TupleT>
+const size_t TuplePolicy<TupleT>::tuple_size;
+#endif  // GTEST_HAS_TR1_TUPLE
+
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+struct TuplePolicy< ::std::tuple<Types...> > {
+  typedef ::std::tuple<Types...> Tuple;
+  static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
+
+  template <size_t I>
+  struct tuple_element : ::std::tuple_element<I, Tuple> {};
+
+  template <size_t I>
+  static const typename ::std::tuple_element<I, Tuple>::type& get(
+      const Tuple& tuple) {
+    return ::std::get<I>(tuple);
+  }
+};
+template <typename... Types>
+const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
+#endif  // GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+// This helper template allows PrintTo() for tuples and
+// UniversalTersePrintTupleFieldsToStrings() to be defined by
+// induction on the number of tuple fields.  The idea is that
+// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
+// fields in tuple t, and can be defined in terms of
+// TuplePrefixPrinter<N - 1>.
+//
+// The inductive case.
+template <size_t N>
+struct TuplePrefixPrinter {
+  // Prints the first N fields of a tuple.
+  template <typename Tuple>
+  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
+    TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
+    GTEST_INTENTIONAL_CONST_COND_PUSH_()
+    if (N > 1) {
+    GTEST_INTENTIONAL_CONST_COND_POP_()
+      *os << ", ";
+    }
+    UniversalPrinter<
+        typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
+        ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
+  }
+
+  // Tersely prints the first N fields of a tuple to a string vector,
+  // one element for each field.
+  template <typename Tuple>
+  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
+    TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
+    ::std::stringstream ss;
+    UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
+    strings->push_back(ss.str());
+  }
+};
+
+// Base case.
+template <>
+struct TuplePrefixPrinter<0> {
+  template <typename Tuple>
+  static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
+
+  template <typename Tuple>
+  static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
+};
+
+// Helper function for printing a tuple.
+// Tuple must be either std::tr1::tuple or std::tuple type.
+template <typename Tuple>
+void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
+  *os << "(";
+  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
+  *os << ")";
+}
+
+// Prints the fields of a tuple tersely to a string vector, one
+// element for each field.  See the comment before
+// UniversalTersePrint() for how we define "tersely".
+template <typename Tuple>
+Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
+  Strings result;
+  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
+      TersePrintPrefixToStrings(value, &result);
+  return result;
+}
+#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+
+}  // namespace internal
+
+template <typename T>
+::std::string PrintToString(const T& value) {
+  ::std::stringstream ss;
+  internal::UniversalTersePrinter<T>::Print(value, &ss);
+  return ss.str();
+}
+
+}  // namespace testing
+
+// Include any custom printer added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gtest/internal/custom/gtest-printers.h"
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-spi.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-spi.h
new file mode 100644
index 0000000..f63fa9a
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-spi.h
@@ -0,0 +1,232 @@
+// 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)
+//
+// Utilities for testing Google Test itself and code that uses Google Test
+// (e.g. frameworks built on top of Google Test).
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_
+#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_
+
+#include "gtest/gtest.h"
+
+namespace testing {
+
+// This helper class can be used to mock out Google Test failure reporting
+// so that we can test Google Test or code that builds on Google Test.
+//
+// An object of this class appends a TestPartResult object to the
+// TestPartResultArray object given in the constructor whenever a Google Test
+// failure is reported. It can either intercept only failures that are
+// generated in the same thread that created this object or it can intercept
+// all generated failures. The scope of this mock object can be controlled with
+// the second argument to the two arguments constructor.
+class GTEST_API_ ScopedFakeTestPartResultReporter
+    : public TestPartResultReporterInterface {
+ public:
+  // The two possible mocking modes of this object.
+  enum InterceptMode {
+    INTERCEPT_ONLY_CURRENT_THREAD,  // Intercepts only thread local failures.
+    INTERCEPT_ALL_THREADS           // Intercepts all failures.
+  };
+
+  // The c'tor sets this object as the test part result reporter used
+  // by Google Test.  The 'result' parameter specifies where to report the
+  // results. This reporter will only catch failures generated in the current
+  // thread. DEPRECATED
+  explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);
+
+  // Same as above, but you can choose the interception scope of this object.
+  ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
+                                   TestPartResultArray* result);
+
+  // The d'tor restores the previous test part result reporter.
+  virtual ~ScopedFakeTestPartResultReporter();
+
+  // Appends the TestPartResult object to the TestPartResultArray
+  // received in the constructor.
+  //
+  // This method is from the TestPartResultReporterInterface
+  // interface.
+  virtual void ReportTestPartResult(const TestPartResult& result);
+ private:
+  void Init();
+
+  const InterceptMode intercept_mode_;
+  TestPartResultReporterInterface* old_reporter_;
+  TestPartResultArray* const result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
+};
+
+namespace internal {
+
+// A helper class for implementing EXPECT_FATAL_FAILURE() and
+// EXPECT_NONFATAL_FAILURE().  Its destructor verifies that the given
+// TestPartResultArray contains exactly one failure that has the given
+// type and contains the given substring.  If that's not the case, a
+// non-fatal failure will be generated.
+class GTEST_API_ SingleFailureChecker {
+ public:
+  // The constructor remembers the arguments.
+  SingleFailureChecker(const TestPartResultArray* results,
+                       TestPartResult::Type type,
+                       const string& substr);
+  ~SingleFailureChecker();
+ private:
+  const TestPartResultArray* const results_;
+  const TestPartResult::Type type_;
+  const string substr_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);
+};
+
+}  // namespace internal
+
+}  // namespace testing
+
+// A set of macros for testing Google Test assertions or code that's expected
+// to generate Google Test fatal failures.  It verifies that the given
+// statement will cause exactly one fatal Google Test failure with 'substr'
+// being part of the failure message.
+//
+// There are two different versions of this macro. EXPECT_FATAL_FAILURE only
+// affects and considers failures generated in the current thread and
+// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
+//
+// The verification of the assertion is done correctly even when the statement
+// throws an exception or aborts the current function.
+//
+// Known restrictions:
+//   - 'statement' cannot reference local non-static variables or
+//     non-static members of the current object.
+//   - 'statement' cannot return a value.
+//   - You cannot stream a failure message to this macro.
+//
+// Note that even though the implementations of the following two
+// macros are much alike, we cannot refactor them to use a common
+// helper macro, due to some peculiarity in how the preprocessor
+// works.  The AcceptsMacroThatExpandsToUnprotectedComma test in
+// gtest_unittest.cc will fail to compile if we do that.
+#define EXPECT_FATAL_FAILURE(statement, substr) \
+  do { \
+    class GTestExpectFatalFailureHelper {\
+     public:\
+      static void Execute() { statement; }\
+    };\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter:: \
+          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
+      GTestExpectFatalFailureHelper::Execute();\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
+  do { \
+    class GTestExpectFatalFailureHelper {\
+     public:\
+      static void Execute() { statement; }\
+    };\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter:: \
+          INTERCEPT_ALL_THREADS, &gtest_failures);\
+      GTestExpectFatalFailureHelper::Execute();\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+// A macro for testing Google Test assertions or code that's expected to
+// generate Google Test non-fatal failures.  It asserts that the given
+// statement will cause exactly one non-fatal Google Test failure with 'substr'
+// being part of the failure message.
+//
+// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
+// affects and considers failures generated in the current thread and
+// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
+//
+// 'statement' is allowed to reference local variables and members of
+// the current object.
+//
+// The verification of the assertion is done correctly even when the statement
+// throws an exception or aborts the current function.
+//
+// Known restrictions:
+//   - You cannot stream a failure message to this macro.
+//
+// Note that even though the implementations of the following two
+// macros are much alike, we cannot refactor them to use a common
+// helper macro, due to some peculiarity in how the preprocessor
+// works.  If we do that, the code won't compile when the user gives
+// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that
+// expands to code containing an unprotected comma.  The
+// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
+// catches that.
+//
+// For the same reason, we have to write
+//   if (::testing::internal::AlwaysTrue()) { statement; }
+// instead of
+//   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
+// to avoid an MSVC warning on unreachable code.
+#define EXPECT_NONFATAL_FAILURE(statement, substr) \
+  do {\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
+        (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter:: \
+          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
+      if (::testing::internal::AlwaysTrue()) { statement; }\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
+  do {\
+    ::testing::TestPartResultArray gtest_failures;\
+    ::testing::internal::SingleFailureChecker gtest_checker(\
+        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
+        (substr));\
+    {\
+      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
+          ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \
+          &gtest_failures);\
+      if (::testing::internal::AlwaysTrue()) { statement; }\
+    }\
+  } while (::testing::internal::AlwaysFalse())
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_SPI_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-test-part.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-test-part.h
new file mode 100644
index 0000000..77eb844
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-test-part.h
@@ -0,0 +1,179 @@
+// 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: mheule@google.com (Markus Heule)
+//
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
+#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
+
+#include <iosfwd>
+#include <vector>
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-string.h"
+
+namespace testing {
+
+// A copyable object representing the result of a test part (i.e. an
+// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
+//
+// Don't inherit from TestPartResult as its destructor is not virtual.
+class GTEST_API_ TestPartResult {
+ public:
+  // The possible outcomes of a test part (i.e. an assertion or an
+  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
+  enum Type {
+    kSuccess,          // Succeeded.
+    kNonFatalFailure,  // Failed but the test can continue.
+    kFatalFailure      // Failed and the test should be terminated.
+  };
+
+  // C'tor.  TestPartResult does NOT have a default constructor.
+  // Always use this constructor (with parameters) to create a
+  // TestPartResult object.
+  TestPartResult(Type a_type,
+                 const char* a_file_name,
+                 int a_line_number,
+                 const char* a_message)
+      : type_(a_type),
+        file_name_(a_file_name == NULL ? "" : a_file_name),
+        line_number_(a_line_number),
+        summary_(ExtractSummary(a_message)),
+        message_(a_message) {
+  }
+
+  // Gets the outcome of the test part.
+  Type type() const { return type_; }
+
+  // Gets the name of the source file where the test part took place, or
+  // NULL if it's unknown.
+  const char* file_name() const {
+    return file_name_.empty() ? NULL : file_name_.c_str();
+  }
+
+  // Gets the line in the source file where the test part took place,
+  // or -1 if it's unknown.
+  int line_number() const { return line_number_; }
+
+  // Gets the summary of the failure message.
+  const char* summary() const { return summary_.c_str(); }
+
+  // Gets the message associated with the test part.
+  const char* message() const { return message_.c_str(); }
+
+  // Returns true iff the test part passed.
+  bool passed() const { return type_ == kSuccess; }
+
+  // Returns true iff the test part failed.
+  bool failed() const { return type_ != kSuccess; }
+
+  // Returns true iff the test part non-fatally failed.
+  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
+
+  // Returns true iff the test part fatally failed.
+  bool fatally_failed() const { return type_ == kFatalFailure; }
+
+ private:
+  Type type_;
+
+  // Gets the summary of the failure message by omitting the stack
+  // trace in it.
+  static std::string ExtractSummary(const char* message);
+
+  // The name of the source file where the test part took place, or
+  // "" if the source file is unknown.
+  std::string file_name_;
+  // The line in the source file where the test part took place, or -1
+  // if the line number is unknown.
+  int line_number_;
+  std::string summary_;  // The test failure summary.
+  std::string message_;  // The test failure message.
+};
+
+// Prints a TestPartResult object.
+std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
+
+// An array of TestPartResult objects.
+//
+// Don't inherit from TestPartResultArray as its destructor is not
+// virtual.
+class GTEST_API_ TestPartResultArray {
+ public:
+  TestPartResultArray() {}
+
+  // Appends the given TestPartResult to the array.
+  void Append(const TestPartResult& result);
+
+  // Returns the TestPartResult at the given index (0-based).
+  const TestPartResult& GetTestPartResult(int index) const;
+
+  // Returns the number of TestPartResult objects in the array.
+  int size() const;
+
+ private:
+  std::vector<TestPartResult> array_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
+};
+
+// This interface knows how to report a test part result.
+class TestPartResultReporterInterface {
+ public:
+  virtual ~TestPartResultReporterInterface() {}
+
+  virtual void ReportTestPartResult(const TestPartResult& result) = 0;
+};
+
+namespace internal {
+
+// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
+// statement generates new fatal failures. To do so it registers itself as the
+// current test part result reporter. Besides checking if fatal failures were
+// reported, it only delegates the reporting to the former result reporter.
+// The original result reporter is restored in the destructor.
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+class GTEST_API_ HasNewFatalFailureHelper
+    : public TestPartResultReporterInterface {
+ public:
+  HasNewFatalFailureHelper();
+  virtual ~HasNewFatalFailureHelper();
+  virtual void ReportTestPartResult(const TestPartResult& result);
+  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
+ private:
+  bool has_new_fatal_failure_;
+  TestPartResultReporterInterface* original_reporter_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
+};
+
+}  // namespace internal
+
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-typed-test.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-typed-test.h
new file mode 100644
index 0000000..5f69d56
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest-typed-test.h
@@ -0,0 +1,263 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
+
+// This header implements typed tests and type-parameterized tests.
+
+// Typed (aka type-driven) tests repeat the same test for types in a
+// list.  You must know which types you want to test with when writing
+// typed tests. Here's how you do it:
+
+#if 0
+
+// First, define a fixture class template.  It should be parameterized
+// by a type.  Remember to derive it from testing::Test.
+template <typename T>
+class FooTest : public testing::Test {
+ public:
+  ...
+  typedef std::list<T> List;
+  static T shared_;
+  T value_;
+};
+
+// Next, associate a list of types with the test case, which will be
+// repeated for each type in the list.  The typedef is necessary for
+// the macro to parse correctly.
+typedef testing::Types<char, int, unsigned int> MyTypes;
+TYPED_TEST_CASE(FooTest, MyTypes);
+
+// If the type list contains only one type, you can write that type
+// directly without Types<...>:
+//   TYPED_TEST_CASE(FooTest, int);
+
+// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
+// tests for this test case as you want.
+TYPED_TEST(FooTest, DoesBlah) {
+  // Inside a test, refer to TypeParam to get the type parameter.
+  // Since we are inside a derived class template, C++ requires use to
+  // visit the members of FooTest via 'this'.
+  TypeParam n = this->value_;
+
+  // To visit static members of the fixture, add the TestFixture::
+  // prefix.
+  n += TestFixture::shared_;
+
+  // To refer to typedefs in the fixture, add the "typename
+  // TestFixture::" prefix.
+  typename TestFixture::List values;
+  values.push_back(n);
+  ...
+}
+
+TYPED_TEST(FooTest, HasPropertyA) { ... }
+
+#endif  // 0
+
+// Type-parameterized tests are abstract test patterns parameterized
+// by a type.  Compared with typed tests, type-parameterized tests
+// allow you to define the test pattern without knowing what the type
+// parameters are.  The defined pattern can be instantiated with
+// different types any number of times, in any number of translation
+// units.
+//
+// If you are designing an interface or concept, you can define a
+// suite of type-parameterized tests to verify properties that any
+// valid implementation of the interface/concept should have.  Then,
+// each implementation can easily instantiate the test suite to verify
+// that it conforms to the requirements, without having to write
+// similar tests repeatedly.  Here's an example:
+
+#if 0
+
+// First, define a fixture class template.  It should be parameterized
+// by a type.  Remember to derive it from testing::Test.
+template <typename T>
+class FooTest : public testing::Test {
+  ...
+};
+
+// Next, declare that you will define a type-parameterized test case
+// (the _P suffix is for "parameterized" or "pattern", whichever you
+// prefer):
+TYPED_TEST_CASE_P(FooTest);
+
+// Then, use TYPED_TEST_P() to define as many type-parameterized tests
+// for this type-parameterized test case as you want.
+TYPED_TEST_P(FooTest, DoesBlah) {
+  // Inside a test, refer to TypeParam to get the type parameter.
+  TypeParam n = 0;
+  ...
+}
+
+TYPED_TEST_P(FooTest, HasPropertyA) { ... }
+
+// Now the tricky part: you need to register all test patterns before
+// you can instantiate them.  The first argument of the macro is the
+// test case name; the rest are the names of the tests in this test
+// case.
+REGISTER_TYPED_TEST_CASE_P(FooTest,
+                           DoesBlah, HasPropertyA);
+
+// Finally, you are free to instantiate the pattern with the types you
+// want.  If you put the above code in a header file, you can #include
+// it in multiple C++ source files and instantiate it multiple times.
+//
+// To distinguish different instances of the pattern, the first
+// argument to the INSTANTIATE_* macro is a prefix that will be added
+// to the actual test case name.  Remember to pick unique prefixes for
+// different instances.
+typedef testing::Types<char, int, unsigned int> MyTypes;
+INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
+
+// If the type list contains only one type, you can write that type
+// directly without Types<...>:
+//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
+
+#endif  // 0
+
+#include "gtest/internal/gtest-port.h"
+#include "gtest/internal/gtest-type-util.h"
+
+// Implements typed tests.
+
+#if GTEST_HAS_TYPED_TEST
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Expands to the name of the typedef for the type parameters of the
+// given test case.
+# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_
+
+// The 'Types' template argument below must have spaces around it
+// since some compilers may choke on '>>' when passing a template
+// instance (e.g. Types<int>)
+# define TYPED_TEST_CASE(CaseName, Types) \
+  typedef ::testing::internal::TypeList< Types >::type \
+      GTEST_TYPE_PARAMS_(CaseName)
+
+# define TYPED_TEST(CaseName, TestName) \
+  template <typename gtest_TypeParam_> \
+  class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
+      : public CaseName<gtest_TypeParam_> { \
+   private: \
+    typedef CaseName<gtest_TypeParam_> TestFixture; \
+    typedef gtest_TypeParam_ TypeParam; \
+    virtual void TestBody(); \
+  }; \
+  bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::internal::TypeParameterizedTest< \
+          CaseName, \
+          ::testing::internal::TemplateSel< \
+              GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
+          GTEST_TYPE_PARAMS_(CaseName)>::Register(\
+              "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+              #CaseName, #TestName, 0); \
+  template <typename gtest_TypeParam_> \
+  void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
+
+#endif  // GTEST_HAS_TYPED_TEST
+
+// Implements type-parameterized tests.
+
+#if GTEST_HAS_TYPED_TEST_P
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Expands to the namespace name that the type-parameterized tests for
+// the given type-parameterized test case are defined in.  The exact
+// name of the namespace is subject to change without notice.
+# define GTEST_CASE_NAMESPACE_(TestCaseName) \
+  gtest_case_##TestCaseName##_
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Expands to the name of the variable used to remember the names of
+// the defined tests in the given test case.
+# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \
+  gtest_typed_test_case_p_state_##TestCaseName##_
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
+//
+// Expands to the name of the variable used to remember the names of
+// the registered tests in the given test case.
+# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \
+  gtest_registered_test_names_##TestCaseName##_
+
+// The variables defined in the type-parameterized test macros are
+// static as typically these macros are used in a .h file that can be
+// #included in multiple translation units linked together.
+# define TYPED_TEST_CASE_P(CaseName) \
+  static ::testing::internal::TypedTestCasePState \
+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)
+
+# define TYPED_TEST_P(CaseName, TestName) \
+  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
+  template <typename gtest_TypeParam_> \
+  class TestName : public CaseName<gtest_TypeParam_> { \
+   private: \
+    typedef CaseName<gtest_TypeParam_> TestFixture; \
+    typedef gtest_TypeParam_ TypeParam; \
+    virtual void TestBody(); \
+  }; \
+  static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\
+          __FILE__, __LINE__, #CaseName, #TestName); \
+  } \
+  template <typename gtest_TypeParam_> \
+  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()
+
+# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \
+  namespace GTEST_CASE_NAMESPACE_(CaseName) { \
+  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \
+  } \
+  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \
+      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\
+          __FILE__, __LINE__, #__VA_ARGS__)
+
+// The 'Types' template argument below must have spaces around it
+// since some compilers may choke on '>>' when passing a template
+// instance (e.g. Types<int>)
+# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \
+  bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \
+      ::testing::internal::TypeParameterizedTestCase<CaseName, \
+          GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
+          ::testing::internal::TypeList< Types >::type>::Register(\
+              #Prefix, \
+              ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+              &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \
+              #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+
+#endif  // GTEST_HAS_TYPED_TEST_P
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest.h
new file mode 100644
index 0000000..f846c5b
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest.h
@@ -0,0 +1,2236 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the public API for Google Test.  It should be
+// included by any test program that uses Google Test.
+//
+// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
+// leave some internal implementation details in this header file.
+// They are clearly marked by comments like this:
+//
+//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+//
+// Such code is NOT meant to be used by a user directly, and is subject
+// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user
+// program!
+//
+// Acknowledgment: Google Test borrowed the idea of automatic test
+// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
+// easyUnit framework.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
+#define GTEST_INCLUDE_GTEST_GTEST_H_
+
+#include <limits>
+#include <ostream>
+#include <vector>
+
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-string.h"
+#include "gtest/gtest-death-test.h"
+#include "gtest/gtest-message.h"
+#include "gtest/gtest-param-test.h"
+#include "gtest/gtest-printers.h"
+#include "gtest/gtest_prod.h"
+#include "gtest/gtest-test-part.h"
+#include "gtest/gtest-typed-test.h"
+
+// Depending on the platform, different string classes are available.
+// On Linux, in addition to ::std::string, Google also makes use of
+// class ::string, which has the same interface as ::std::string, but
+// has a different implementation.
+//
+// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
+// ::string is available AND is a distinct type to ::std::string, or
+// define it to 0 to indicate otherwise.
+//
+// If ::std::string and ::string are the same class on your platform
+// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
+//
+// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
+// heuristically.
+
+namespace testing {
+
+// Declares the flags.
+
+// This flag temporary enables the disabled tests.
+GTEST_DECLARE_bool_(also_run_disabled_tests);
+
+// This flag brings the debugger on an assertion failure.
+GTEST_DECLARE_bool_(break_on_failure);
+
+// This flag controls whether Google Test catches all test-thrown exceptions
+// and logs them as failures.
+GTEST_DECLARE_bool_(catch_exceptions);
+
+// This flag enables using colors in terminal output. Available values are
+// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
+// to let Google Test decide.
+GTEST_DECLARE_string_(color);
+
+// This flag sets up the filter to select by name using a glob pattern
+// the tests to run. If the filter is not given all tests are executed.
+GTEST_DECLARE_string_(filter);
+
+// This flag causes the Google Test to list tests. None of the tests listed
+// are actually run if the flag is provided.
+GTEST_DECLARE_bool_(list_tests);
+
+// This flag controls whether Google Test emits a detailed XML report to a file
+// in addition to its normal textual output.
+GTEST_DECLARE_string_(output);
+
+// This flags control whether Google Test prints the elapsed time for each
+// test.
+GTEST_DECLARE_bool_(print_time);
+
+// This flag specifies the random number seed.
+GTEST_DECLARE_int32_(random_seed);
+
+// This flag sets how many times the tests are repeated. The default value
+// is 1. If the value is -1 the tests are repeating forever.
+GTEST_DECLARE_int32_(repeat);
+
+// This flag controls whether Google Test includes Google Test internal
+// stack frames in failure stack traces.
+GTEST_DECLARE_bool_(show_internal_stack_frames);
+
+// When this flag is specified, tests' order is randomized on every iteration.
+GTEST_DECLARE_bool_(shuffle);
+
+// This flag specifies the maximum number of stack frames to be
+// printed in a failure message.
+GTEST_DECLARE_int32_(stack_trace_depth);
+
+// When this flag is specified, a failed assertion will throw an
+// exception if exceptions are enabled, or exit the program with a
+// non-zero code otherwise.
+GTEST_DECLARE_bool_(throw_on_failure);
+
+// When this flag is set with a "host:port" string, on supported
+// platforms test results are streamed to the specified port on
+// the specified host machine.
+GTEST_DECLARE_string_(stream_result_to);
+
+// The upper limit for valid stack trace depths.
+const int kMaxStackTraceDepth = 100;
+
+namespace internal {
+
+class AssertHelper;
+class DefaultGlobalTestPartResultReporter;
+class ExecDeathTest;
+class NoExecDeathTest;
+class FinalSuccessChecker;
+class GTestFlagSaver;
+class StreamingListenerTest;
+class TestResultAccessor;
+class TestEventListenersAccessor;
+class TestEventRepeater;
+class UnitTestRecordPropertyTestHelper;
+class WindowsDeathTest;
+class UnitTestImpl* GetUnitTestImpl();
+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
+                                    const std::string& message);
+
+}  // namespace internal
+
+// The friend relationship of some of these classes is cyclic.
+// If we don't forward declare them the compiler might confuse the classes
+// in friendship clauses with same named classes on the scope.
+class Test;
+class TestCase;
+class TestInfo;
+class UnitTest;
+
+// A class for indicating whether an assertion was successful.  When
+// the assertion wasn't successful, the AssertionResult object
+// remembers a non-empty message that describes how it failed.
+//
+// To create an instance of this class, use one of the factory functions
+// (AssertionSuccess() and AssertionFailure()).
+//
+// This class is useful for two purposes:
+//   1. Defining predicate functions to be used with Boolean test assertions
+//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
+//   2. Defining predicate-format functions to be
+//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
+//
+// For example, if you define IsEven predicate:
+//
+//   testing::AssertionResult IsEven(int n) {
+//     if ((n % 2) == 0)
+//       return testing::AssertionSuccess();
+//     else
+//       return testing::AssertionFailure() << n << " is odd";
+//   }
+//
+// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
+// will print the message
+//
+//   Value of: IsEven(Fib(5))
+//     Actual: false (5 is odd)
+//   Expected: true
+//
+// instead of a more opaque
+//
+//   Value of: IsEven(Fib(5))
+//     Actual: false
+//   Expected: true
+//
+// in case IsEven is a simple Boolean predicate.
+//
+// If you expect your predicate to be reused and want to support informative
+// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
+// about half as often as positive ones in our tests), supply messages for
+// both success and failure cases:
+//
+//   testing::AssertionResult IsEven(int n) {
+//     if ((n % 2) == 0)
+//       return testing::AssertionSuccess() << n << " is even";
+//     else
+//       return testing::AssertionFailure() << n << " is odd";
+//   }
+//
+// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
+//
+//   Value of: IsEven(Fib(6))
+//     Actual: true (8 is even)
+//   Expected: false
+//
+// NB: Predicates that support negative Boolean assertions have reduced
+// performance in positive ones so be careful not to use them in tests
+// that have lots (tens of thousands) of positive Boolean assertions.
+//
+// To use this class with EXPECT_PRED_FORMAT assertions such as:
+//
+//   // Verifies that Foo() returns an even number.
+//   EXPECT_PRED_FORMAT1(IsEven, Foo());
+//
+// you need to define:
+//
+//   testing::AssertionResult IsEven(const char* expr, int n) {
+//     if ((n % 2) == 0)
+//       return testing::AssertionSuccess();
+//     else
+//       return testing::AssertionFailure()
+//         << "Expected: " << expr << " is even\n  Actual: it's " << n;
+//   }
+//
+// If Foo() returns 5, you will see the following message:
+//
+//   Expected: Foo() is even
+//     Actual: it's 5
+//
+class GTEST_API_ AssertionResult {
+ public:
+  // Copy constructor.
+  // Used in EXPECT_TRUE/FALSE(assertion_result).
+  AssertionResult(const AssertionResult& other);
+
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
+
+  // Used in the EXPECT_TRUE/FALSE(bool_expression).
+  //
+  // T must be contextually convertible to bool.
+  //
+  // The second parameter prevents this overload from being considered if
+  // the argument is implicitly convertible to AssertionResult. In that case
+  // we want AssertionResult's copy constructor to be used.
+  template <typename T>
+  explicit AssertionResult(
+      const T& success,
+      typename internal::EnableIf<
+          !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
+          /*enabler*/ = NULL)
+      : success_(success) {}
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  // Assignment operator.
+  AssertionResult& operator=(AssertionResult other) {
+    swap(other);
+    return *this;
+  }
+
+  // Returns true iff the assertion succeeded.
+  operator bool() const { return success_; }  // NOLINT
+
+  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
+  AssertionResult operator!() const;
+
+  // Returns the text streamed into this AssertionResult. Test assertions
+  // use it when they fail (i.e., the predicate's outcome doesn't match the
+  // assertion's expectation). When nothing has been streamed into the
+  // object, returns an empty string.
+  const char* message() const {
+    return message_.get() != NULL ?  message_->c_str() : "";
+  }
+  // TODO(vladl@google.com): Remove this after making sure no clients use it.
+  // Deprecated; please use message() instead.
+  const char* failure_message() const { return message(); }
+
+  // Streams a custom failure message into this object.
+  template <typename T> AssertionResult& operator<<(const T& value) {
+    AppendMessage(Message() << value);
+    return *this;
+  }
+
+  // Allows streaming basic output manipulators such as endl or flush into
+  // this object.
+  AssertionResult& operator<<(
+      ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
+    AppendMessage(Message() << basic_manipulator);
+    return *this;
+  }
+
+ private:
+  // Appends the contents of message to message_.
+  void AppendMessage(const Message& a_message) {
+    if (message_.get() == NULL)
+      message_.reset(new ::std::string);
+    message_->append(a_message.GetString().c_str());
+  }
+
+  // Swap the contents of this AssertionResult with other.
+  void swap(AssertionResult& other);
+
+  // Stores result of the assertion predicate.
+  bool success_;
+  // Stores the message describing the condition in case the expectation
+  // construct is not satisfied with the predicate's outcome.
+  // Referenced via a pointer to avoid taking too much stack frame space
+  // with test assertions.
+  internal::scoped_ptr< ::std::string> message_;
+};
+
+// Makes a successful assertion result.
+GTEST_API_ AssertionResult AssertionSuccess();
+
+// Makes a failed assertion result.
+GTEST_API_ AssertionResult AssertionFailure();
+
+// Makes a failed assertion result with the given failure message.
+// Deprecated; use AssertionFailure() << msg.
+GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
+
+// The abstract class that all tests inherit from.
+//
+// In Google Test, a unit test program contains one or many TestCases, and
+// each TestCase contains one or many Tests.
+//
+// When you define a test using the TEST macro, you don't need to
+// explicitly derive from Test - the TEST macro automatically does
+// this for you.
+//
+// The only time you derive from Test is when defining a test fixture
+// to be used a TEST_F.  For example:
+//
+//   class FooTest : public testing::Test {
+//    protected:
+//     void SetUp() override { ... }
+//     void TearDown() override { ... }
+//     ...
+//   };
+//
+//   TEST_F(FooTest, Bar) { ... }
+//   TEST_F(FooTest, Baz) { ... }
+//
+// Test is not copyable.
+class GTEST_API_ Test {
+ public:
+  friend class TestInfo;
+
+  // Defines types for pointers to functions that set up and tear down
+  // a test case.
+  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;
+  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;
+
+  // The d'tor is virtual as we intend to inherit from Test.
+  virtual ~Test();
+
+  // Sets up the stuff shared by all tests in this test case.
+  //
+  // Google Test will call Foo::SetUpTestCase() before running the first
+  // test in test case Foo.  Hence a sub-class can define its own
+  // SetUpTestCase() method to shadow the one defined in the super
+  // class.
+  static void SetUpTestCase() {}
+
+  // Tears down the stuff shared by all tests in this test case.
+  //
+  // Google Test will call Foo::TearDownTestCase() after running the last
+  // test in test case Foo.  Hence a sub-class can define its own
+  // TearDownTestCase() method to shadow the one defined in the super
+  // class.
+  static void TearDownTestCase() {}
+
+  // Returns true iff the current test has a fatal failure.
+  static bool HasFatalFailure();
+
+  // Returns true iff the current test has a non-fatal failure.
+  static bool HasNonfatalFailure();
+
+  // Returns true iff the current test has a (either fatal or
+  // non-fatal) failure.
+  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
+
+  // Logs a property for the current test, test case, or for the entire
+  // invocation of the test program when used outside of the context of a
+  // test case.  Only the last value for a given key is remembered.  These
+  // are public static so they can be called from utility functions that are
+  // not members of the test fixture.  Calls to RecordProperty made during
+  // lifespan of the test (from the moment its constructor starts to the
+  // moment its destructor finishes) will be output in XML as attributes of
+  // the <testcase> element.  Properties recorded from fixture's
+  // SetUpTestCase or TearDownTestCase are logged as attributes of the
+  // corresponding <testsuite> element.  Calls to RecordProperty made in the
+  // global context (before or after invocation of RUN_ALL_TESTS and from
+  // SetUp/TearDown method of Environment objects registered with Google
+  // Test) will be output as attributes of the <testsuites> element.
+  static void RecordProperty(const std::string& key, const std::string& value);
+  static void RecordProperty(const std::string& key, int value);
+
+ protected:
+  // Creates a Test object.
+  Test();
+
+  // Sets up the test fixture.
+  virtual void SetUp();
+
+  // Tears down the test fixture.
+  virtual void TearDown();
+
+ private:
+  // Returns true iff the current test has the same fixture class as
+  // the first test in the current test case.
+  static bool HasSameFixtureClass();
+
+  // Runs the test after the test fixture has been set up.
+  //
+  // A sub-class must implement this to define the test logic.
+  //
+  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
+  // Instead, use the TEST or TEST_F macro.
+  virtual void TestBody() = 0;
+
+  // Sets up, executes, and tears down the test.
+  void Run();
+
+  // Deletes self.  We deliberately pick an unusual name for this
+  // internal method to avoid clashing with names used in user TESTs.
+  void DeleteSelf_() { delete this; }
+
+  const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
+
+  // Often a user misspells SetUp() as Setup() and spends a long time
+  // wondering why it is never called by Google Test.  The declaration of
+  // the following method is solely for catching such an error at
+  // compile time:
+  //
+  //   - The return type is deliberately chosen to be not void, so it
+  //   will be a conflict if void Setup() is declared in the user's
+  //   test fixture.
+  //
+  //   - This method is private, so it will be another compiler error
+  //   if the method is called from the user's test fixture.
+  //
+  // DO NOT OVERRIDE THIS FUNCTION.
+  //
+  // If you see an error about overriding the following function or
+  // about it being private, you have mis-spelled SetUp() as Setup().
+  struct Setup_should_be_spelled_SetUp {};
+  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
+
+  // We disallow copying Tests.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
+};
+
+typedef internal::TimeInMillis TimeInMillis;
+
+// A copyable object representing a user specified test property which can be
+// output as a key/value string pair.
+//
+// Don't inherit from TestProperty as its destructor is not virtual.
+class TestProperty {
+ public:
+  // C'tor.  TestProperty does NOT have a default constructor.
+  // Always use this constructor (with parameters) to create a
+  // TestProperty object.
+  TestProperty(const std::string& a_key, const std::string& a_value) :
+    key_(a_key), value_(a_value) {
+  }
+
+  // Gets the user supplied key.
+  const char* key() const {
+    return key_.c_str();
+  }
+
+  // Gets the user supplied value.
+  const char* value() const {
+    return value_.c_str();
+  }
+
+  // Sets a new value, overriding the one supplied in the constructor.
+  void SetValue(const std::string& new_value) {
+    value_ = new_value;
+  }
+
+ private:
+  // The key supplied by the user.
+  std::string key_;
+  // The value supplied by the user.
+  std::string value_;
+};
+
+// The result of a single Test.  This includes a list of
+// TestPartResults, a list of TestProperties, a count of how many
+// death tests there are in the Test, and how much time it took to run
+// the Test.
+//
+// TestResult is not copyable.
+class GTEST_API_ TestResult {
+ public:
+  // Creates an empty TestResult.
+  TestResult();
+
+  // D'tor.  Do not inherit from TestResult.
+  ~TestResult();
+
+  // Gets the number of all test parts.  This is the sum of the number
+  // of successful test parts and the number of failed test parts.
+  int total_part_count() const;
+
+  // Returns the number of the test properties.
+  int test_property_count() const;
+
+  // Returns true iff the test passed (i.e. no test part failed).
+  bool Passed() const { return !Failed(); }
+
+  // Returns true iff the test failed.
+  bool Failed() const;
+
+  // Returns true iff the test fatally failed.
+  bool HasFatalFailure() const;
+
+  // Returns true iff the test has a non-fatal failure.
+  bool HasNonfatalFailure() const;
+
+  // Returns the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const { return elapsed_time_; }
+
+  // Returns the i-th test part result among all the results. i can range
+  // from 0 to test_property_count() - 1. If i is not in that range, aborts
+  // the program.
+  const TestPartResult& GetTestPartResult(int i) const;
+
+  // Returns the i-th test property. i can range from 0 to
+  // test_property_count() - 1. If i is not in that range, aborts the
+  // program.
+  const TestProperty& GetTestProperty(int i) const;
+
+ private:
+  friend class TestInfo;
+  friend class TestCase;
+  friend class UnitTest;
+  friend class internal::DefaultGlobalTestPartResultReporter;
+  friend class internal::ExecDeathTest;
+  friend class internal::TestResultAccessor;
+  friend class internal::UnitTestImpl;
+  friend class internal::WindowsDeathTest;
+
+  // Gets the vector of TestPartResults.
+  const std::vector<TestPartResult>& test_part_results() const {
+    return test_part_results_;
+  }
+
+  // Gets the vector of TestProperties.
+  const std::vector<TestProperty>& test_properties() const {
+    return test_properties_;
+  }
+
+  // Sets the elapsed time.
+  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
+
+  // Adds a test property to the list. The property is validated and may add
+  // a non-fatal failure if invalid (e.g., if it conflicts with reserved
+  // key names). If a property is already recorded for the same key, the
+  // value will be updated, rather than storing multiple values for the same
+  // key.  xml_element specifies the element for which the property is being
+  // recorded and is used for validation.
+  void RecordProperty(const std::string& xml_element,
+                      const TestProperty& test_property);
+
+  // Adds a failure if the key is a reserved attribute of Google Test
+  // testcase tags.  Returns true if the property is valid.
+  // TODO(russr): Validate attribute names are legal and human readable.
+  static bool ValidateTestProperty(const std::string& xml_element,
+                                   const TestProperty& test_property);
+
+  // Adds a test part result to the list.
+  void AddTestPartResult(const TestPartResult& test_part_result);
+
+  // Returns the death test count.
+  int death_test_count() const { return death_test_count_; }
+
+  // Increments the death test count, returning the new count.
+  int increment_death_test_count() { return ++death_test_count_; }
+
+  // Clears the test part results.
+  void ClearTestPartResults();
+
+  // Clears the object.
+  void Clear();
+
+  // Protects mutable state of the property vector and of owned
+  // properties, whose values may be updated.
+  internal::Mutex test_properites_mutex_;
+
+  // The vector of TestPartResults
+  std::vector<TestPartResult> test_part_results_;
+  // The vector of TestProperties
+  std::vector<TestProperty> test_properties_;
+  // Running count of death tests.
+  int death_test_count_;
+  // The elapsed time, in milliseconds.
+  TimeInMillis elapsed_time_;
+
+  // We disallow copying TestResult.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
+};  // class TestResult
+
+// A TestInfo object stores the following information about a test:
+//
+//   Test case name
+//   Test name
+//   Whether the test should be run
+//   A function pointer that creates the test object when invoked
+//   Test result
+//
+// The constructor of TestInfo registers itself with the UnitTest
+// singleton such that the RUN_ALL_TESTS() macro knows which tests to
+// run.
+class GTEST_API_ TestInfo {
+ public:
+  // Destructs a TestInfo object.  This function is not virtual, so
+  // don't inherit from TestInfo.
+  ~TestInfo();
+
+  // Returns the test case name.
+  const char* test_case_name() const { return test_case_name_.c_str(); }
+
+  // Returns the test name.
+  const char* name() const { return name_.c_str(); }
+
+  // Returns the name of the parameter type, or NULL if this is not a typed
+  // or a type-parameterized test.
+  const char* type_param() const {
+    if (type_param_.get() != NULL)
+      return type_param_->c_str();
+    return NULL;
+  }
+
+  // Returns the text representation of the value parameter, or NULL if this
+  // is not a value-parameterized test.
+  const char* value_param() const {
+    if (value_param_.get() != NULL)
+      return value_param_->c_str();
+    return NULL;
+  }
+
+  // Returns the file name where this test is defined.
+  const char* file() const { return location_.file.c_str(); }
+
+  // Returns the line where this test is defined.
+  int line() const { return location_.line; }
+
+  // Returns true if this test should run, that is if the test is not
+  // disabled (or it is disabled but the also_run_disabled_tests flag has
+  // been specified) and its full name matches the user-specified filter.
+  //
+  // Google Test allows the user to filter the tests by their full names.
+  // The full name of a test Bar in test case Foo is defined as
+  // "Foo.Bar".  Only the tests that match the filter will run.
+  //
+  // A filter is a colon-separated list of glob (not regex) patterns,
+  // optionally followed by a '-' and a colon-separated list of
+  // negative patterns (tests to exclude).  A test is run if it
+  // matches one of the positive patterns and does not match any of
+  // the negative patterns.
+  //
+  // For example, *A*:Foo.* is a filter that matches any string that
+  // contains the character 'A' or starts with "Foo.".
+  bool should_run() const { return should_run_; }
+
+  // Returns true iff this test will appear in the XML report.
+  bool is_reportable() const {
+    // For now, the XML report includes all tests matching the filter.
+    // In the future, we may trim tests that are excluded because of
+    // sharding.
+    return matches_filter_;
+  }
+
+  // Returns the result of the test.
+  const TestResult* result() const { return &result_; }
+
+ private:
+#if GTEST_HAS_DEATH_TEST
+  friend class internal::DefaultDeathTestFactory;
+#endif  // GTEST_HAS_DEATH_TEST
+  friend class Test;
+  friend class TestCase;
+  friend class internal::UnitTestImpl;
+  friend class internal::StreamingListenerTest;
+  friend TestInfo* internal::MakeAndRegisterTestInfo(
+      const char* test_case_name,
+      const char* name,
+      const char* type_param,
+      const char* value_param,
+      internal::CodeLocation code_location,
+      internal::TypeId fixture_class_id,
+      Test::SetUpTestCaseFunc set_up_tc,
+      Test::TearDownTestCaseFunc tear_down_tc,
+      internal::TestFactoryBase* factory);
+
+  // Constructs a TestInfo object. The newly constructed instance assumes
+  // ownership of the factory object.
+  TestInfo(const std::string& test_case_name,
+           const std::string& name,
+           const char* a_type_param,   // NULL if not a type-parameterized test
+           const char* a_value_param,  // NULL if not a value-parameterized test
+           internal::CodeLocation a_code_location,
+           internal::TypeId fixture_class_id,
+           internal::TestFactoryBase* factory);
+
+  // Increments the number of death tests encountered in this test so
+  // far.
+  int increment_death_test_count() {
+    return result_.increment_death_test_count();
+  }
+
+  // Creates the test object, runs it, records its result, and then
+  // deletes it.
+  void Run();
+
+  static void ClearTestResult(TestInfo* test_info) {
+    test_info->result_.Clear();
+  }
+
+  // These fields are immutable properties of the test.
+  const std::string test_case_name_;     // Test case name
+  const std::string name_;               // Test name
+  // Name of the parameter type, or NULL if this is not a typed or a
+  // type-parameterized test.
+  const internal::scoped_ptr<const ::std::string> type_param_;
+  // Text representation of the value parameter, or NULL if this is not a
+  // value-parameterized test.
+  const internal::scoped_ptr<const ::std::string> value_param_;
+  internal::CodeLocation location_;
+  const internal::TypeId fixture_class_id_;   // ID of the test fixture class
+  bool should_run_;                 // True iff this test should run
+  bool is_disabled_;                // True iff this test is disabled
+  bool matches_filter_;             // True if this test matches the
+                                    // user-specified filter.
+  internal::TestFactoryBase* const factory_;  // The factory that creates
+                                              // the test object
+
+  // This field is mutable and needs to be reset before running the
+  // test for the second time.
+  TestResult result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
+};
+
+// A test case, which consists of a vector of TestInfos.
+//
+// TestCase is not copyable.
+class GTEST_API_ TestCase {
+ public:
+  // Creates a TestCase with the given name.
+  //
+  // TestCase does NOT have a default constructor.  Always use this
+  // constructor to create a TestCase object.
+  //
+  // Arguments:
+  //
+  //   name:         name of the test case
+  //   a_type_param: the name of the test's type parameter, or NULL if
+  //                 this is not a type-parameterized test.
+  //   set_up_tc:    pointer to the function that sets up the test case
+  //   tear_down_tc: pointer to the function that tears down the test case
+  TestCase(const char* name, const char* a_type_param,
+           Test::SetUpTestCaseFunc set_up_tc,
+           Test::TearDownTestCaseFunc tear_down_tc);
+
+  // Destructor of TestCase.
+  virtual ~TestCase();
+
+  // Gets the name of the TestCase.
+  const char* name() const { return name_.c_str(); }
+
+  // Returns the name of the parameter type, or NULL if this is not a
+  // type-parameterized test case.
+  const char* type_param() const {
+    if (type_param_.get() != NULL)
+      return type_param_->c_str();
+    return NULL;
+  }
+
+  // Returns true if any test in this test case should run.
+  bool should_run() const { return should_run_; }
+
+  // Gets the number of successful tests in this test case.
+  int successful_test_count() const;
+
+  // Gets the number of failed tests in this test case.
+  int failed_test_count() const;
+
+  // Gets the number of disabled tests that will be reported in the XML report.
+  int reportable_disabled_test_count() const;
+
+  // Gets the number of disabled tests in this test case.
+  int disabled_test_count() const;
+
+  // Gets the number of tests to be printed in the XML report.
+  int reportable_test_count() const;
+
+  // Get the number of tests in this test case that should run.
+  int test_to_run_count() const;
+
+  // Gets the number of all tests in this test case.
+  int total_test_count() const;
+
+  // Returns true iff the test case passed.
+  bool Passed() const { return !Failed(); }
+
+  // Returns true iff the test case failed.
+  bool Failed() const { return failed_test_count() > 0; }
+
+  // Returns the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const { return elapsed_time_; }
+
+  // Returns the i-th test among all the tests. i can range from 0 to
+  // total_test_count() - 1. If i is not in that range, returns NULL.
+  const TestInfo* GetTestInfo(int i) const;
+
+  // Returns the TestResult that holds test properties recorded during
+  // execution of SetUpTestCase and TearDownTestCase.
+  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
+
+ private:
+  friend class Test;
+  friend class internal::UnitTestImpl;
+
+  // Gets the (mutable) vector of TestInfos in this TestCase.
+  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
+
+  // Gets the (immutable) vector of TestInfos in this TestCase.
+  const std::vector<TestInfo*>& test_info_list() const {
+    return test_info_list_;
+  }
+
+  // Returns the i-th test among all the tests. i can range from 0 to
+  // total_test_count() - 1. If i is not in that range, returns NULL.
+  TestInfo* GetMutableTestInfo(int i);
+
+  // Sets the should_run member.
+  void set_should_run(bool should) { should_run_ = should; }
+
+  // Adds a TestInfo to this test case.  Will delete the TestInfo upon
+  // destruction of the TestCase object.
+  void AddTestInfo(TestInfo * test_info);
+
+  // Clears the results of all tests in this test case.
+  void ClearResult();
+
+  // Clears the results of all tests in the given test case.
+  static void ClearTestCaseResult(TestCase* test_case) {
+    test_case->ClearResult();
+  }
+
+  // Runs every test in this TestCase.
+  void Run();
+
+  // Runs SetUpTestCase() for this TestCase.  This wrapper is needed
+  // for catching exceptions thrown from SetUpTestCase().
+  void RunSetUpTestCase() { (*set_up_tc_)(); }
+
+  // Runs TearDownTestCase() for this TestCase.  This wrapper is
+  // needed for catching exceptions thrown from TearDownTestCase().
+  void RunTearDownTestCase() { (*tear_down_tc_)(); }
+
+  // Returns true iff test passed.
+  static bool TestPassed(const TestInfo* test_info) {
+    return test_info->should_run() && test_info->result()->Passed();
+  }
+
+  // Returns true iff test failed.
+  static bool TestFailed(const TestInfo* test_info) {
+    return test_info->should_run() && test_info->result()->Failed();
+  }
+
+  // Returns true iff the test is disabled and will be reported in the XML
+  // report.
+  static bool TestReportableDisabled(const TestInfo* test_info) {
+    return test_info->is_reportable() && test_info->is_disabled_;
+  }
+
+  // Returns true iff test is disabled.
+  static bool TestDisabled(const TestInfo* test_info) {
+    return test_info->is_disabled_;
+  }
+
+  // Returns true iff this test will appear in the XML report.
+  static bool TestReportable(const TestInfo* test_info) {
+    return test_info->is_reportable();
+  }
+
+  // Returns true if the given test should run.
+  static bool ShouldRunTest(const TestInfo* test_info) {
+    return test_info->should_run();
+  }
+
+  // Shuffles the tests in this test case.
+  void ShuffleTests(internal::Random* random);
+
+  // Restores the test order to before the first shuffle.
+  void UnshuffleTests();
+
+  // Name of the test case.
+  std::string name_;
+  // Name of the parameter type, or NULL if this is not a typed or a
+  // type-parameterized test.
+  const internal::scoped_ptr<const ::std::string> type_param_;
+  // The vector of TestInfos in their original order.  It owns the
+  // elements in the vector.
+  std::vector<TestInfo*> test_info_list_;
+  // Provides a level of indirection for the test list to allow easy
+  // shuffling and restoring the test order.  The i-th element in this
+  // vector is the index of the i-th test in the shuffled test list.
+  std::vector<int> test_indices_;
+  // Pointer to the function that sets up the test case.
+  Test::SetUpTestCaseFunc set_up_tc_;
+  // Pointer to the function that tears down the test case.
+  Test::TearDownTestCaseFunc tear_down_tc_;
+  // True iff any test in this test case should run.
+  bool should_run_;
+  // Elapsed time, in milliseconds.
+  TimeInMillis elapsed_time_;
+  // Holds test properties recorded during execution of SetUpTestCase and
+  // TearDownTestCase.
+  TestResult ad_hoc_test_result_;
+
+  // We disallow copying TestCases.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);
+};
+
+// An Environment object is capable of setting up and tearing down an
+// environment.  You should subclass this to define your own
+// environment(s).
+//
+// An Environment object does the set-up and tear-down in virtual
+// methods SetUp() and TearDown() instead of the constructor and the
+// destructor, as:
+//
+//   1. You cannot safely throw from a destructor.  This is a problem
+//      as in some cases Google Test is used where exceptions are enabled, and
+//      we may want to implement ASSERT_* using exceptions where they are
+//      available.
+//   2. You cannot use ASSERT_* directly in a constructor or
+//      destructor.
+class Environment {
+ public:
+  // The d'tor is virtual as we need to subclass Environment.
+  virtual ~Environment() {}
+
+  // Override this to define how to set up the environment.
+  virtual void SetUp() {}
+
+  // Override this to define how to tear down the environment.
+  virtual void TearDown() {}
+ private:
+  // If you see an error about overriding the following function or
+  // about it being private, you have mis-spelled SetUp() as Setup().
+  struct Setup_should_be_spelled_SetUp {};
+  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }
+};
+
+// The interface for tracing execution of tests. The methods are organized in
+// the order the corresponding events are fired.
+class TestEventListener {
+ public:
+  virtual ~TestEventListener() {}
+
+  // Fired before any test activity starts.
+  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
+
+  // Fired before each iteration of tests starts.  There may be more than
+  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
+  // index, starting from 0.
+  virtual void OnTestIterationStart(const UnitTest& unit_test,
+                                    int iteration) = 0;
+
+  // Fired before environment set-up for each iteration of tests starts.
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
+
+  // Fired after environment set-up for each iteration of tests ends.
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
+
+  // Fired before the test case starts.
+  virtual void OnTestCaseStart(const TestCase& test_case) = 0;
+
+  // Fired before the test starts.
+  virtual void OnTestStart(const TestInfo& test_info) = 0;
+
+  // Fired after a failed assertion or a SUCCEED() invocation.
+  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
+
+  // Fired after the test ends.
+  virtual void OnTestEnd(const TestInfo& test_info) = 0;
+
+  // Fired after the test case ends.
+  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;
+
+  // Fired before environment tear-down for each iteration of tests starts.
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
+
+  // Fired after environment tear-down for each iteration of tests ends.
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
+
+  // Fired after each iteration of tests finishes.
+  virtual void OnTestIterationEnd(const UnitTest& unit_test,
+                                  int iteration) = 0;
+
+  // Fired after all test activities have ended.
+  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
+};
+
+// The convenience class for users who need to override just one or two
+// methods and are not concerned that a possible change to a signature of
+// the methods they override will not be caught during the build.  For
+// comments about each method please see the definition of TestEventListener
+// above.
+class EmptyTestEventListener : public TestEventListener {
+ public:
+  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,
+                                    int /*iteration*/) {}
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
+  virtual void OnTestStart(const TestInfo& /*test_info*/) {}
+  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}
+  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}
+  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,
+                                  int /*iteration*/) {}
+  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+};
+
+// TestEventListeners lets users add listeners to track events in Google Test.
+class GTEST_API_ TestEventListeners {
+ public:
+  TestEventListeners();
+  ~TestEventListeners();
+
+  // Appends an event listener to the end of the list. Google Test assumes
+  // the ownership of the listener (i.e. it will delete the listener when
+  // the test program finishes).
+  void Append(TestEventListener* listener);
+
+  // Removes the given event listener from the list and returns it.  It then
+  // becomes the caller's responsibility to delete the listener. Returns
+  // NULL if the listener is not found in the list.
+  TestEventListener* Release(TestEventListener* listener);
+
+  // Returns the standard listener responsible for the default console
+  // output.  Can be removed from the listeners list to shut down default
+  // console output.  Note that removing this object from the listener list
+  // with Release transfers its ownership to the caller and makes this
+  // function return NULL the next time.
+  TestEventListener* default_result_printer() const {
+    return default_result_printer_;
+  }
+
+  // Returns the standard listener responsible for the default XML output
+  // controlled by the --gtest_output=xml flag.  Can be removed from the
+  // listeners list by users who want to shut down the default XML output
+  // controlled by this flag and substitute it with custom one.  Note that
+  // removing this object from the listener list with Release transfers its
+  // ownership to the caller and makes this function return NULL the next
+  // time.
+  TestEventListener* default_xml_generator() const {
+    return default_xml_generator_;
+  }
+
+ private:
+  friend class TestCase;
+  friend class TestInfo;
+  friend class internal::DefaultGlobalTestPartResultReporter;
+  friend class internal::NoExecDeathTest;
+  friend class internal::TestEventListenersAccessor;
+  friend class internal::UnitTestImpl;
+
+  // Returns repeater that broadcasts the TestEventListener events to all
+  // subscribers.
+  TestEventListener* repeater();
+
+  // Sets the default_result_printer attribute to the provided listener.
+  // The listener is also added to the listener list and previous
+  // default_result_printer is removed from it and deleted. The listener can
+  // also be NULL in which case it will not be added to the list. Does
+  // nothing if the previous and the current listener objects are the same.
+  void SetDefaultResultPrinter(TestEventListener* listener);
+
+  // Sets the default_xml_generator attribute to the provided listener.  The
+  // listener is also added to the listener list and previous
+  // default_xml_generator is removed from it and deleted. The listener can
+  // also be NULL in which case it will not be added to the list. Does
+  // nothing if the previous and the current listener objects are the same.
+  void SetDefaultXmlGenerator(TestEventListener* listener);
+
+  // Controls whether events will be forwarded by the repeater to the
+  // listeners in the list.
+  bool EventForwardingEnabled() const;
+  void SuppressEventForwarding();
+
+  // The actual list of listeners.
+  internal::TestEventRepeater* repeater_;
+  // Listener responsible for the standard result output.
+  TestEventListener* default_result_printer_;
+  // Listener responsible for the creation of the XML output file.
+  TestEventListener* default_xml_generator_;
+
+  // We disallow copying TestEventListeners.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
+};
+
+// A UnitTest consists of a vector of TestCases.
+//
+// This is a singleton class.  The only instance of UnitTest is
+// created when UnitTest::GetInstance() is first called.  This
+// instance is never deleted.
+//
+// UnitTest is not copyable.
+//
+// This class is thread-safe as long as the methods are called
+// according to their specification.
+class GTEST_API_ UnitTest {
+ public:
+  // Gets the singleton UnitTest object.  The first time this method
+  // is called, a UnitTest object is constructed and returned.
+  // Consecutive calls will return the same object.
+  static UnitTest* GetInstance();
+
+  // Runs all tests in this UnitTest object and prints the result.
+  // Returns 0 if successful, or 1 otherwise.
+  //
+  // This method can only be called from the main thread.
+  //
+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+  int Run() GTEST_MUST_USE_RESULT_;
+
+  // Returns the working directory when the first TEST() or TEST_F()
+  // was executed.  The UnitTest object owns the string.
+  const char* original_working_dir() const;
+
+  // Returns the TestCase object for the test that's currently running,
+  // or NULL if no test is running.
+  const TestCase* current_test_case() const
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Returns the TestInfo object for the test that's currently running,
+  // or NULL if no test is running.
+  const TestInfo* current_test_info() const
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Returns the random seed used at the start of the current test run.
+  int random_seed() const;
+
+#if GTEST_HAS_PARAM_TEST
+  // Returns the ParameterizedTestCaseRegistry object used to keep track of
+  // value-parameterized tests and instantiate and register them.
+  //
+  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+  internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
+      GTEST_LOCK_EXCLUDED_(mutex_);
+#endif  // GTEST_HAS_PARAM_TEST
+
+  // Gets the number of successful test cases.
+  int successful_test_case_count() const;
+
+  // Gets the number of failed test cases.
+  int failed_test_case_count() const;
+
+  // Gets the number of all test cases.
+  int total_test_case_count() const;
+
+  // Gets the number of all test cases that contain at least one test
+  // that should run.
+  int test_case_to_run_count() const;
+
+  // Gets the number of successful tests.
+  int successful_test_count() const;
+
+  // Gets the number of failed tests.
+  int failed_test_count() const;
+
+  // Gets the number of disabled tests that will be reported in the XML report.
+  int reportable_disabled_test_count() const;
+
+  // Gets the number of disabled tests.
+  int disabled_test_count() const;
+
+  // Gets the number of tests to be printed in the XML report.
+  int reportable_test_count() const;
+
+  // Gets the number of all tests.
+  int total_test_count() const;
+
+  // Gets the number of tests that should run.
+  int test_to_run_count() const;
+
+  // Gets the time of the test program start, in ms from the start of the
+  // UNIX epoch.
+  TimeInMillis start_timestamp() const;
+
+  // Gets the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const;
+
+  // Returns true iff the unit test passed (i.e. all test cases passed).
+  bool Passed() const;
+
+  // Returns true iff the unit test failed (i.e. some test case failed
+  // or something outside of all tests failed).
+  bool Failed() const;
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  const TestCase* GetTestCase(int i) const;
+
+  // Returns the TestResult containing information on test failures and
+  // properties logged outside of individual test cases.
+  const TestResult& ad_hoc_test_result() const;
+
+  // Returns the list of event listeners that can be used to track events
+  // inside Google Test.
+  TestEventListeners& listeners();
+
+ private:
+  // Registers and returns a global test environment.  When a test
+  // program is run, all global test environments will be set-up in
+  // the order they were registered.  After all tests in the program
+  // have finished, all global test environments will be torn-down in
+  // the *reverse* order they were registered.
+  //
+  // The UnitTest object takes ownership of the given environment.
+  //
+  // This method can only be called from the main thread.
+  Environment* AddEnvironment(Environment* env);
+
+  // Adds a TestPartResult to the current TestResult object.  All
+  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
+  // eventually call this to report their results.  The user code
+  // should use the assertion macros instead of calling this directly.
+  void AddTestPartResult(TestPartResult::Type result_type,
+                         const char* file_name,
+                         int line_number,
+                         const std::string& message,
+                         const std::string& os_stack_trace)
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Adds a TestProperty to the current TestResult object when invoked from
+  // inside a test, to current TestCase's ad_hoc_test_result_ when invoked
+  // from SetUpTestCase or TearDownTestCase, or to the global property set
+  // when invoked elsewhere.  If the result already contains a property with
+  // the same key, the value will be updated.
+  void RecordProperty(const std::string& key, const std::string& value);
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  TestCase* GetMutableTestCase(int i);
+
+  // Accessors for the implementation object.
+  internal::UnitTestImpl* impl() { return impl_; }
+  const internal::UnitTestImpl* impl() const { return impl_; }
+
+  // These classes and funcions are friends as they need to access private
+  // members of UnitTest.
+  friend class Test;
+  friend class internal::AssertHelper;
+  friend class internal::ScopedTrace;
+  friend class internal::StreamingListenerTest;
+  friend class internal::UnitTestRecordPropertyTestHelper;
+  friend Environment* AddGlobalTestEnvironment(Environment* env);
+  friend internal::UnitTestImpl* internal::GetUnitTestImpl();
+  friend void internal::ReportFailureInUnknownLocation(
+      TestPartResult::Type result_type,
+      const std::string& message);
+
+  // Creates an empty UnitTest.
+  UnitTest();
+
+  // D'tor
+  virtual ~UnitTest();
+
+  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
+  // Google Test trace stack.
+  void PushGTestTrace(const internal::TraceInfo& trace)
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Pops a trace from the per-thread Google Test trace stack.
+  void PopGTestTrace()
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  // Protects mutable state in *impl_.  This is mutable as some const
+  // methods need to lock it too.
+  mutable internal::Mutex mutex_;
+
+  // Opaque implementation object.  This field is never changed once
+  // the object is constructed.  We don't mark it as const here, as
+  // doing so will cause a warning in the constructor of UnitTest.
+  // Mutable state in *impl_ is protected by mutex_.
+  internal::UnitTestImpl* impl_;
+
+  // We disallow copying UnitTest.
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
+};
+
+// A convenient wrapper for adding an environment for the test
+// program.
+//
+// You should call this before RUN_ALL_TESTS() is called, probably in
+// main().  If you use gtest_main, you need to call this before main()
+// starts for it to take effect.  For example, you can define a global
+// variable like this:
+//
+//   testing::Environment* const foo_env =
+//       testing::AddGlobalTestEnvironment(new FooEnvironment);
+//
+// However, we strongly recommend you to write your own main() and
+// call AddGlobalTestEnvironment() there, as relying on initialization
+// of global variables makes the code harder to read and may cause
+// problems when you register multiple environments from different
+// translation units and the environments have dependencies among them
+// (remember that the compiler doesn't guarantee the order in which
+// global variables from different translation units are initialized).
+inline Environment* AddGlobalTestEnvironment(Environment* env) {
+  return UnitTest::GetInstance()->AddEnvironment(env);
+}
+
+// Initializes Google Test.  This must be called before calling
+// RUN_ALL_TESTS().  In particular, it parses a command line for the
+// flags that Google Test recognizes.  Whenever a Google Test flag is
+// seen, it is removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Test flag variables are
+// updated.
+//
+// Calling the function for the second time has no user-visible effect.
+GTEST_API_ void InitGoogleTest(int* argc, char** argv);
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
+
+namespace internal {
+
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_* in a tight loop.
+template <typename T1, typename T2>
+AssertionResult CmpHelperEQFailure(const char* lhs_expression,
+                                   const char* rhs_expression,
+                                   const T1& lhs, const T2& rhs) {
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   FormatForComparisonFailureMessage(lhs, rhs),
+                   FormatForComparisonFailureMessage(rhs, lhs),
+                   false);
+}
+
+// The helper function for {ASSERT|EXPECT}_EQ.
+template <typename T1, typename T2>
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+                            const char* rhs_expression,
+                            const T1& lhs,
+                            const T2& rhs) {
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
+  if (lhs == rhs) {
+    return AssertionSuccess();
+  }
+GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
+}
+
+// With this overloaded version, we allow anonymous enums to be used
+// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
+// can be implicitly cast to BiggestInt.
+GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
+                                       const char* rhs_expression,
+                                       BiggestInt lhs,
+                                       BiggestInt rhs);
+
+// The helper class for {ASSERT|EXPECT}_EQ.  The template argument
+// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
+// is a null pointer literal.  The following default implementation is
+// for lhs_is_null_literal being false.
+template <bool lhs_is_null_literal>
+class EqHelper {
+ public:
+  // This templatized version is for the general case.
+  template <typename T1, typename T2>
+  static AssertionResult Compare(const char* lhs_expression,
+                                 const char* rhs_expression,
+                                 const T1& lhs,
+                                 const T2& rhs) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
+  }
+
+  // With this overloaded version, we allow anonymous enums to be used
+  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
+  // enums can be implicitly cast to BiggestInt.
+  //
+  // Even though its body looks the same as the above version, we
+  // cannot merge the two, as it will make anonymous enums unhappy.
+  static AssertionResult Compare(const char* lhs_expression,
+                                 const char* rhs_expression,
+                                 BiggestInt lhs,
+                                 BiggestInt rhs) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
+  }
+};
+
+// This specialization is used when the first argument to ASSERT_EQ()
+// is a null pointer literal, like NULL, false, or 0.
+template <>
+class EqHelper<true> {
+ public:
+  // We define two overloaded versions of Compare().  The first
+  // version will be picked when the second argument to ASSERT_EQ() is
+  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or
+  // EXPECT_EQ(false, a_bool).
+  template <typename T1, typename T2>
+  static AssertionResult Compare(
+      const char* lhs_expression,
+      const char* rhs_expression,
+      const T1& lhs,
+      const T2& rhs,
+      // The following line prevents this overload from being considered if T2
+      // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
+      // expands to Compare("", "", NULL, my_ptr), which requires a conversion
+      // to match the Secret* in the other overload, which would otherwise make
+      // this template match better.
+      typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
+  }
+
+  // This version will be picked when the second argument to ASSERT_EQ() is a
+  // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
+  template <typename T>
+  static AssertionResult Compare(
+      const char* lhs_expression,
+      const char* rhs_expression,
+      // We used to have a second template parameter instead of Secret*.  That
+      // template parameter would deduce to 'long', making this a better match
+      // than the first overload even without the first overload's EnableIf.
+      // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
+      // non-pointer argument" (even a deduced integral argument), so the old
+      // implementation caused warnings in user code.
+      Secret* /* lhs (NULL) */,
+      T* rhs) {
+    // We already know that 'lhs' is a null pointer.
+    return CmpHelperEQ(lhs_expression, rhs_expression,
+                       static_cast<T*>(NULL), rhs);
+  }
+};
+
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_OP in a tight loop.
+template <typename T1, typename T2>
+AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
+                                   const T1& val1, const T2& val2,
+                                   const char* op) {
+  return AssertionFailure()
+         << "Expected: (" << expr1 << ") " << op << " (" << expr2
+         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
+         << " vs " << FormatForComparisonFailureMessage(val2, val1);
+}
+
+// A macro for implementing the helper functions needed to implement
+// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
+// of similar code.
+//
+// For each templatized helper function, we also define an overloaded
+// version for BiggestInt in order to reduce code bloat and allow
+// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled
+// with gcc 4.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
+template <typename T1, typename T2>\
+AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
+                                   const T1& val1, const T2& val2) {\
+  if (val1 op val2) {\
+    return AssertionSuccess();\
+  } else {\
+    return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
+  }\
+}\
+GTEST_API_ AssertionResult CmpHelper##op_name(\
+    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+// Implements the helper function for {ASSERT|EXPECT}_NE
+GTEST_IMPL_CMP_HELPER_(NE, !=);
+// Implements the helper function for {ASSERT|EXPECT}_LE
+GTEST_IMPL_CMP_HELPER_(LE, <=);
+// Implements the helper function for {ASSERT|EXPECT}_LT
+GTEST_IMPL_CMP_HELPER_(LT, <);
+// Implements the helper function for {ASSERT|EXPECT}_GE
+GTEST_IMPL_CMP_HELPER_(GE, >=);
+// Implements the helper function for {ASSERT|EXPECT}_GT
+GTEST_IMPL_CMP_HELPER_(GT, >);
+
+#undef GTEST_IMPL_CMP_HELPER_
+
+// The helper function for {ASSERT|EXPECT}_STREQ.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const char* s1,
+                                          const char* s2);
+
+// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
+                                              const char* s2_expression,
+                                              const char* s1,
+                                              const char* s2);
+
+// The helper function for {ASSERT|EXPECT}_STRNE.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const char* s1,
+                                          const char* s2);
+
+// The helper function for {ASSERT|EXPECT}_STRCASENE.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
+                                              const char* s2_expression,
+                                              const char* s1,
+                                              const char* s2);
+
+
+// Helper function for *_STREQ on wide strings.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const wchar_t* s1,
+                                          const wchar_t* s2);
+
+// Helper function for *_STRNE on wide strings.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const wchar_t* s1,
+                                          const wchar_t* s2);
+
+}  // namespace internal
+
+// IsSubstring() and IsNotSubstring() are intended to be used as the
+// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
+// themselves.  They check whether needle is a substring of haystack
+// (NULL is considered a substring of itself only), and return an
+// appropriate error message when they fail.
+//
+// The {needle,haystack}_expr arguments are the stringified
+// expressions that generated the two real arguments.
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack);
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack);
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack);
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_API_ AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack);
+GTEST_API_ AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack);
+#endif  // GTEST_HAS_STD_WSTRING
+
+namespace internal {
+
+// Helper template function for comparing floating-points.
+//
+// Template parameter:
+//
+//   RawType: the raw floating-point type (either float or double)
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+template <typename RawType>
+AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
+                                         const char* rhs_expression,
+                                         RawType lhs_value,
+                                         RawType rhs_value) {
+  const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
+
+  if (lhs.AlmostEquals(rhs)) {
+    return AssertionSuccess();
+  }
+
+  ::std::stringstream lhs_ss;
+  lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+         << lhs_value;
+
+  ::std::stringstream rhs_ss;
+  rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+         << rhs_value;
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   StringStreamToString(&lhs_ss),
+                   StringStreamToString(&rhs_ss),
+                   false);
+}
+
+// Helper function for implementing ASSERT_NEAR.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
+                                                const char* expr2,
+                                                const char* abs_error_expr,
+                                                double val1,
+                                                double val2,
+                                                double abs_error);
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+// A class that enables one to stream messages to assertion macros
+class GTEST_API_ AssertHelper {
+ public:
+  // Constructor.
+  AssertHelper(TestPartResult::Type type,
+               const char* file,
+               int line,
+               const char* message);
+  ~AssertHelper();
+
+  // Message assignment is a semantic trick to enable assertion
+  // streaming; see the GTEST_MESSAGE_ macro below.
+  void operator=(const Message& message) const;
+
+ private:
+  // We put our data in a struct so that the size of the AssertHelper class can
+  // be as small as possible.  This is important because gcc is incapable of
+  // re-using stack space even for temporary variables, so every EXPECT_EQ
+  // reserves stack space for another AssertHelper.
+  struct AssertHelperData {
+    AssertHelperData(TestPartResult::Type t,
+                     const char* srcfile,
+                     int line_num,
+                     const char* msg)
+        : type(t), file(srcfile), line(line_num), message(msg) { }
+
+    TestPartResult::Type const type;
+    const char* const file;
+    int const line;
+    std::string const message;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
+  };
+
+  AssertHelperData* const data_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
+};
+
+}  // namespace internal
+
+#if GTEST_HAS_PARAM_TEST
+// The pure interface class that all value-parameterized tests inherit from.
+// A value-parameterized class must inherit from both ::testing::Test and
+// ::testing::WithParamInterface. In most cases that just means inheriting
+// from ::testing::TestWithParam, but more complicated test hierarchies
+// may need to inherit from Test and WithParamInterface at different levels.
+//
+// This interface has support for accessing the test parameter value via
+// the GetParam() method.
+//
+// Use it with one of the parameter generator defining functions, like Range(),
+// Values(), ValuesIn(), Bool(), and Combine().
+//
+// class FooTest : public ::testing::TestWithParam<int> {
+//  protected:
+//   FooTest() {
+//     // Can use GetParam() here.
+//   }
+//   virtual ~FooTest() {
+//     // Can use GetParam() here.
+//   }
+//   virtual void SetUp() {
+//     // Can use GetParam() here.
+//   }
+//   virtual void TearDown {
+//     // Can use GetParam() here.
+//   }
+// };
+// TEST_P(FooTest, DoesBar) {
+//   // Can use GetParam() method here.
+//   Foo foo;
+//   ASSERT_TRUE(foo.DoesBar(GetParam()));
+// }
+// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
+
+template <typename T>
+class WithParamInterface {
+ public:
+  typedef T ParamType;
+  virtual ~WithParamInterface() {}
+
+  // The current parameter value. Is also available in the test fixture's
+  // constructor. This member function is non-static, even though it only
+  // references static data, to reduce the opportunity for incorrect uses
+  // like writing 'WithParamInterface<bool>::GetParam()' for a test that
+  // uses a fixture whose parameter type is int.
+  const ParamType& GetParam() const {
+    GTEST_CHECK_(parameter_ != NULL)
+        << "GetParam() can only be called inside a value-parameterized test "
+        << "-- did you intend to write TEST_P instead of TEST_F?";
+    return *parameter_;
+  }
+
+ private:
+  // Sets parameter value. The caller is responsible for making sure the value
+  // remains alive and unchanged throughout the current test.
+  static void SetParam(const ParamType* parameter) {
+    parameter_ = parameter;
+  }
+
+  // Static value used for accessing parameter during a test lifetime.
+  static const ParamType* parameter_;
+
+  // TestClass must be a subclass of WithParamInterface<T> and Test.
+  template <class TestClass> friend class internal::ParameterizedTestFactory;
+};
+
+template <typename T>
+const T* WithParamInterface<T>::parameter_ = NULL;
+
+// Most value-parameterized classes can ignore the existence of
+// WithParamInterface, and can just inherit from ::testing::TestWithParam.
+
+template <typename T>
+class TestWithParam : public Test, public WithParamInterface<T> {
+};
+
+#endif  // GTEST_HAS_PARAM_TEST
+
+// Macros for indicating success/failure in test code.
+
+// ADD_FAILURE unconditionally adds a failure to the current test.
+// SUCCEED generates a success - it doesn't automatically make the
+// current test successful, as a test is only successful when it has
+// no failure.
+//
+// EXPECT_* verifies that a certain condition is satisfied.  If not,
+// it behaves like ADD_FAILURE.  In particular:
+//
+//   EXPECT_TRUE  verifies that a Boolean condition is true.
+//   EXPECT_FALSE verifies that a Boolean condition is false.
+//
+// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
+// that they will also abort the current function on failure.  People
+// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
+// writing data-driven tests often find themselves using ADD_FAILURE
+// and EXPECT_* more.
+
+// Generates a nonfatal failure with a generic message.
+#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
+
+// Generates a nonfatal failure at the given source file location with
+// a generic message.
+#define ADD_FAILURE_AT(file, line) \
+  GTEST_MESSAGE_AT_(file, line, "Failed", \
+                    ::testing::TestPartResult::kNonFatalFailure)
+
+// Generates a fatal failure with a generic message.
+#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
+
+// Define this macro to 1 to omit the definition of FAIL(), which is a
+// generic name and clashes with some other libraries.
+#if !GTEST_DONT_DEFINE_FAIL
+# define FAIL() GTEST_FAIL()
+#endif
+
+// Generates a success with a generic message.
+#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
+
+// Define this macro to 1 to omit the definition of SUCCEED(), which
+// is a generic name and clashes with some other libraries.
+#if !GTEST_DONT_DEFINE_SUCCEED
+# define SUCCEED() GTEST_SUCCEED()
+#endif
+
+// Macros for testing exceptions.
+//
+//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):
+//         Tests that the statement throws the expected exception.
+//    * {ASSERT|EXPECT}_NO_THROW(statement):
+//         Tests that the statement doesn't throw any exception.
+//    * {ASSERT|EXPECT}_ANY_THROW(statement):
+//         Tests that the statement throws an exception.
+
+#define EXPECT_THROW(statement, expected_exception) \
+  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_NO_THROW(statement) \
+  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_ANY_THROW(statement) \
+  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_THROW(statement, expected_exception) \
+  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
+#define ASSERT_NO_THROW(statement) \
+  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
+#define ASSERT_ANY_THROW(statement) \
+  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
+
+// Boolean assertions. Condition can be either a Boolean expression or an
+// AssertionResult. For more information on how to use AssertionResult with
+// these macros see comments on that class.
+#define EXPECT_TRUE(condition) \
+  GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
+                      GTEST_NONFATAL_FAILURE_)
+#define EXPECT_FALSE(condition) \
+  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
+                      GTEST_NONFATAL_FAILURE_)
+#define ASSERT_TRUE(condition) \
+  GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
+                      GTEST_FATAL_FAILURE_)
+#define ASSERT_FALSE(condition) \
+  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
+                      GTEST_FATAL_FAILURE_)
+
+// Includes the auto-generated header that implements a family of
+// generic predicate assertion macros.
+#include "gtest/gtest_pred_impl.h"
+
+// Macros for testing equalities and inequalities.
+//
+//    * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
+//    * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
+//    * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
+//    * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
+//    * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
+//    * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
+//
+// When they are not, Google Test prints both the tested expressions and
+// their actual values.  The values must be compatible built-in types,
+// or you will get a compiler error.  By "compatible" we mean that the
+// values can be compared by the respective operator.
+//
+// Note:
+//
+//   1. It is possible to make a user-defined type work with
+//   {ASSERT|EXPECT}_??(), but that requires overloading the
+//   comparison operators and is thus discouraged by the Google C++
+//   Usage Guide.  Therefore, you are advised to use the
+//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
+//   equal.
+//
+//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
+//   pointers (in particular, C strings).  Therefore, if you use it
+//   with two C strings, you are testing how their locations in memory
+//   are related, not how their content is related.  To compare two C
+//   strings by content, use {ASSERT|EXPECT}_STR*().
+//
+//   3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
+//   {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
+//   what the actual value is when it fails, and similarly for the
+//   other comparisons.
+//
+//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()
+//   evaluate their arguments, which is undefined.
+//
+//   5. These macros evaluate their arguments exactly once.
+//
+// Examples:
+//
+//   EXPECT_NE(5, Foo());
+//   EXPECT_EQ(NULL, a_pointer);
+//   ASSERT_LT(i, array_size);
+//   ASSERT_GT(records.size(), 0) << "There is no record left.";
+
+#define EXPECT_EQ(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal:: \
+                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+                      val1, val2)
+#define EXPECT_NE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
+#define EXPECT_LE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
+#define EXPECT_LT(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
+#define EXPECT_GE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
+#define EXPECT_GT(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
+
+#define GTEST_ASSERT_EQ(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal:: \
+                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+                      val1, val2)
+#define GTEST_ASSERT_NE(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
+#define GTEST_ASSERT_LE(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
+#define GTEST_ASSERT_LT(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
+#define GTEST_ASSERT_GE(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
+#define GTEST_ASSERT_GT(val1, val2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
+
+// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
+// ASSERT_XY(), which clashes with some users' own code.
+
+#if !GTEST_DONT_DEFINE_ASSERT_EQ
+# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_NE
+# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_LE
+# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_LT
+# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_GE
+# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
+#endif
+
+#if !GTEST_DONT_DEFINE_ASSERT_GT
+# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
+#endif
+
+// C-string Comparisons.  All tests treat NULL and any non-NULL string
+// as different.  Two NULLs are equal.
+//
+//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2
+//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2
+//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
+//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
+//
+// For wide or narrow string objects, you can use the
+// {ASSERT|EXPECT}_??() macros.
+//
+// Don't depend on the order in which the arguments are evaluated,
+// which is undefined.
+//
+// These macros evaluate their arguments exactly once.
+
+#define EXPECT_STREQ(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
+#define EXPECT_STRNE(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
+#define EXPECT_STRCASEEQ(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
+#define EXPECT_STRCASENE(s1, s2)\
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
+
+#define ASSERT_STREQ(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
+#define ASSERT_STRNE(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
+#define ASSERT_STRCASEEQ(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
+#define ASSERT_STRCASENE(s1, s2)\
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
+
+// Macros for comparing floating-point numbers.
+//
+//    * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
+//         Tests that two float values are almost equal.
+//    * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
+//         Tests that two double values are almost equal.
+//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
+//         Tests that v1 and v2 are within the given distance to each other.
+//
+// Google Test uses ULP-based comparison to automatically pick a default
+// error bound that is appropriate for the operands.  See the
+// FloatingPoint template class in gtest-internal.h if you are
+// interested in the implementation details.
+
+#define EXPECT_FLOAT_EQ(val1, val2)\
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
+                      val1, val2)
+
+#define EXPECT_DOUBLE_EQ(val1, val2)\
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
+                      val1, val2)
+
+#define ASSERT_FLOAT_EQ(val1, val2)\
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
+                      val1, val2)
+
+#define ASSERT_DOUBLE_EQ(val1, val2)\
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
+                      val1, val2)
+
+#define EXPECT_NEAR(val1, val2, abs_error)\
+  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
+                      val1, val2, abs_error)
+
+#define ASSERT_NEAR(val1, val2, abs_error)\
+  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
+                      val1, val2, abs_error)
+
+// These predicate format functions work on floating-point values, and
+// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
+//
+//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
+
+// Asserts that val1 is less than, or almost equal to, val2.  Fails
+// otherwise.  In particular, it fails if either val1 or val2 is NaN.
+GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
+                                   float val1, float val2);
+GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
+                                    double val1, double val2);
+
+
+#if GTEST_OS_WINDOWS
+
+// Macros that test for HRESULT failure and success, these are only useful
+// on Windows, and rely on Windows SDK macros and APIs to compile.
+//
+//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
+//
+// When expr unexpectedly fails or succeeds, Google Test prints the
+// expected result and the actual result with both a human-readable
+// string representation of the error, if available, as well as the
+// hex result code.
+# define EXPECT_HRESULT_SUCCEEDED(expr) \
+    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
+
+# define ASSERT_HRESULT_SUCCEEDED(expr) \
+    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
+
+# define EXPECT_HRESULT_FAILED(expr) \
+    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+
+# define ASSERT_HRESULT_FAILED(expr) \
+    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
+
+#endif  // GTEST_OS_WINDOWS
+
+// Macros that execute statement and check that it doesn't generate new fatal
+// failures in the current thread.
+//
+//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
+//
+// Examples:
+//
+//   EXPECT_NO_FATAL_FAILURE(Process());
+//   ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
+//
+#define ASSERT_NO_FATAL_FAILURE(statement) \
+    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
+#define EXPECT_NO_FATAL_FAILURE(statement) \
+    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
+
+// Causes a trace (including the source file path, the current line
+// number, and the given message) to be included in every test failure
+// message generated by code in the current scope.  The effect is
+// undone when the control leaves the current scope.
+//
+// The message argument can be anything streamable to std::ostream.
+//
+// In the implementation, we include the current line number as part
+// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
+// to appear in the same block - as long as they are on different
+// lines.
+#define SCOPED_TRACE(message) \
+  ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
+    __FILE__, __LINE__, ::testing::Message() << (message))
+
+// Compile-time assertion for type equality.
+// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are
+// the same type.  The value it returns is not interesting.
+//
+// Instead of making StaticAssertTypeEq a class template, we make it a
+// function template that invokes a helper class template.  This
+// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
+// defining objects of that type.
+//
+// CAVEAT:
+//
+// When used inside a method of a class template,
+// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
+// instantiated.  For example, given:
+//
+//   template <typename T> class Foo {
+//    public:
+//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }
+//   };
+//
+// the code:
+//
+//   void Test1() { Foo<bool> foo; }
+//
+// will NOT generate a compiler error, as Foo<bool>::Bar() is never
+// actually instantiated.  Instead, you need:
+//
+//   void Test2() { Foo<bool> foo; foo.Bar(); }
+//
+// to cause a compiler error.
+template <typename T1, typename T2>
+bool StaticAssertTypeEq() {
+  (void)internal::StaticAssertTypeEqHelper<T1, T2>();
+  return true;
+}
+
+// Defines a test.
+//
+// The first parameter is the name of the test case, and the second
+// parameter is the name of the test within the test case.
+//
+// The convention is to end the test case name with "Test".  For
+// example, a test case for the Foo class can be named FooTest.
+//
+// Test code should appear between braces after an invocation of
+// this macro.  Example:
+//
+//   TEST(FooTest, InitializesCorrectly) {
+//     Foo foo;
+//     EXPECT_TRUE(foo.StatusIsOK());
+//   }
+
+// Note that we call GetTestTypeId() instead of GetTypeId<
+// ::testing::Test>() here to get the type ID of testing::Test.  This
+// is to work around a suspected linker bug when using Google Test as
+// a framework on Mac OS X.  The bug causes GetTypeId<
+// ::testing::Test>() to return different values depending on whether
+// the call is from the Google Test framework itself or from user test
+// code.  GetTestTypeId() is guaranteed to always return the same
+// value, as it always calls GetTypeId<>() from the Google Test
+// framework.
+#define GTEST_TEST(test_case_name, test_name)\
+  GTEST_TEST_(test_case_name, test_name, \
+              ::testing::Test, ::testing::internal::GetTestTypeId())
+
+// Define this macro to 1 to omit the definition of TEST(), which
+// is a generic name and clashes with some other libraries.
+#if !GTEST_DONT_DEFINE_TEST
+# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
+#endif
+
+// Defines a test that uses a test fixture.
+//
+// The first parameter is the name of the test fixture class, which
+// also doubles as the test case name.  The second parameter is the
+// name of the test within the test case.
+//
+// A test fixture class must be declared earlier.  The user should put
+// his test code between braces after using this macro.  Example:
+//
+//   class FooTest : public testing::Test {
+//    protected:
+//     virtual void SetUp() { b_.AddElement(3); }
+//
+//     Foo a_;
+//     Foo b_;
+//   };
+//
+//   TEST_F(FooTest, InitializesCorrectly) {
+//     EXPECT_TRUE(a_.StatusIsOK());
+//   }
+//
+//   TEST_F(FooTest, ReturnsElementCountCorrectly) {
+//     EXPECT_EQ(0, a_.size());
+//     EXPECT_EQ(1, b_.size());
+//   }
+
+#define TEST_F(test_fixture, test_name)\
+  GTEST_TEST_(test_fixture, test_name, test_fixture, \
+              ::testing::internal::GetTypeId<test_fixture>())
+
+}  // namespace testing
+
+// Use this function in main() to run all tests.  It returns 0 if all
+// tests are successful, or 1 otherwise.
+//
+// RUN_ALL_TESTS() should be invoked after the command line has been
+// parsed by InitGoogleTest().
+//
+// This function was formerly a macro; thus, it is in the global
+// namespace and has an all-caps name.
+int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
+
+inline int RUN_ALL_TESTS() {
+  return ::testing::UnitTest::GetInstance()->Run();
+}
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest_pred_impl.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest_pred_impl.h
new file mode 100644
index 0000000..30ae712
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest_pred_impl.h
@@ -0,0 +1,358 @@
+// Copyright 2006, 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.
+
+// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command
+// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!
+//
+// Implements a family of generic predicate assertion macros.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
+
+// Makes sure this header is not included before gtest.h.
+#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
+# error Do not include gtest_pred_impl.h directly.  Include gtest.h instead.
+#endif  // GTEST_INCLUDE_GTEST_GTEST_H_
+
+// This header implements a family of generic predicate assertion
+// macros:
+//
+//   ASSERT_PRED_FORMAT1(pred_format, v1)
+//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)
+//   ...
+//
+// where pred_format is a function or functor that takes n (in the
+// case of ASSERT_PRED_FORMATn) values and their source expression
+// text, and returns a testing::AssertionResult.  See the definition
+// of ASSERT_EQ in gtest.h for an example.
+//
+// If you don't care about formatting, you can use the more
+// restrictive version:
+//
+//   ASSERT_PRED1(pred, v1)
+//   ASSERT_PRED2(pred, v1, v2)
+//   ...
+//
+// where pred is an n-ary function or functor that returns bool,
+// and the values v1, v2, ..., must support the << operator for
+// streaming to std::ostream.
+//
+// We also define the EXPECT_* variations.
+//
+// For now we only support predicates whose arity is at most 5.
+// Please email googletestframework@googlegroups.com if you need
+// support for higher arities.
+
+// GTEST_ASSERT_ is the basic statement to which all of the assertions
+// in this file reduce.  Don't use this in your code.
+
+#define GTEST_ASSERT_(expression, on_failure) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (const ::testing::AssertionResult gtest_ar = (expression)) \
+    ; \
+  else \
+    on_failure(gtest_ar.failure_message())
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1>
+AssertionResult AssertPred1Helper(const char* pred_text,
+                                  const char* e1,
+                                  Pred pred,
+                                  const T1& v1) {
+  if (pred(v1)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, v1), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use
+// this in your code.
+#define GTEST_PRED1_(pred, v1, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
+                                             #v1, \
+                                             pred, \
+                                             v1), on_failure)
+
+// Unary predicate assertion macros.
+#define EXPECT_PRED_FORMAT1(pred_format, v1) \
+  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED1(pred, v1) \
+  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT1(pred_format, v1) \
+  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED1(pred, v1) \
+  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2>
+AssertionResult AssertPred2Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2) {
+  if (pred(v1, v2)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use
+// this in your code.
+#define GTEST_PRED2_(pred, v1, v2, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             pred, \
+                                             v1, \
+                                             v2), on_failure)
+
+// Binary predicate assertion macros.
+#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
+  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED2(pred, v1, v2) \
+  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
+  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED2(pred, v1, v2) \
+  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2,
+          typename T3>
+AssertionResult AssertPred3Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  const char* e3,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2,
+                                  const T3& v3) {
+  if (pred(v1, v2, v3)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ", "
+                            << e3 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2
+                            << "\n" << e3 << " evaluates to " << v3;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use
+// this in your code.
+#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             #v3, \
+                                             pred, \
+                                             v1, \
+                                             v2, \
+                                             v3), on_failure)
+
+// Ternary predicate assertion macros.
+#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
+  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED3(pred, v1, v2, v3) \
+  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
+  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED3(pred, v1, v2, v3) \
+  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4>
+AssertionResult AssertPred4Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  const char* e3,
+                                  const char* e4,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2,
+                                  const T3& v3,
+                                  const T4& v4) {
+  if (pred(v1, v2, v3, v4)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ", "
+                            << e3 << ", "
+                            << e4 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2
+                            << "\n" << e3 << " evaluates to " << v3
+                            << "\n" << e4 << " evaluates to " << v4;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use
+// this in your code.
+#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             #v3, \
+                                             #v4, \
+                                             pred, \
+                                             v1, \
+                                             v2, \
+                                             v3, \
+                                             v4), on_failure)
+
+// 4-ary predicate assertion macros.
+#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
+  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
+  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
+  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
+  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
+
+
+
+// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use
+// this in your code.
+template <typename Pred,
+          typename T1,
+          typename T2,
+          typename T3,
+          typename T4,
+          typename T5>
+AssertionResult AssertPred5Helper(const char* pred_text,
+                                  const char* e1,
+                                  const char* e2,
+                                  const char* e3,
+                                  const char* e4,
+                                  const char* e5,
+                                  Pred pred,
+                                  const T1& v1,
+                                  const T2& v2,
+                                  const T3& v3,
+                                  const T4& v4,
+                                  const T5& v5) {
+  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
+
+  return AssertionFailure() << pred_text << "("
+                            << e1 << ", "
+                            << e2 << ", "
+                            << e3 << ", "
+                            << e4 << ", "
+                            << e5 << ") evaluates to false, where"
+                            << "\n" << e1 << " evaluates to " << v1
+                            << "\n" << e2 << " evaluates to " << v2
+                            << "\n" << e3 << " evaluates to " << v3
+                            << "\n" << e4 << " evaluates to " << v4
+                            << "\n" << e5 << " evaluates to " << v5;
+}
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
+// Don't use this in your code.
+#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
+  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
+                on_failure)
+
+// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use
+// this in your code.
+#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
+  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
+                                             #v1, \
+                                             #v2, \
+                                             #v3, \
+                                             #v4, \
+                                             #v5, \
+                                             pred, \
+                                             v1, \
+                                             v2, \
+                                             v3, \
+                                             v4, \
+                                             v5), on_failure)
+
+// 5-ary predicate assertion macros.
+#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
+  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
+#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
+  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
+#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
+  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
+#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
+  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
+
+
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest_prod.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest_prod.h
new file mode 100644
index 0000000..da80ddc
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/gtest_prod.h
@@ -0,0 +1,58 @@
+// Copyright 2006, 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 C++ Testing Framework definitions useful in production code.
+
+#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
+#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
+
+// When you need to test the private or protected members of a class,
+// use the FRIEND_TEST macro to declare your tests as friends of the
+// class.  For example:
+//
+// class MyClass {
+//  private:
+//   void MyMethod();
+//   FRIEND_TEST(MyClassTest, MyMethod);
+// };
+//
+// class MyClassTest : public testing::Test {
+//   // ...
+// };
+//
+// TEST_F(MyClassTest, MyMethod) {
+//   // Can call MyClass::MyMethod() here.
+// }
+
+#define FRIEND_TEST(test_case_name, test_name)\
+friend class test_case_name##_##test_name##_Test
+
+#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest-port.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest-port.h
new file mode 100644
index 0000000..7e744bd
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest-port.h
@@ -0,0 +1,69 @@
+// Copyright 2015, 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.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+//   Flag related macros:
+//     GTEST_FLAG(flag_name)
+//     GTEST_USE_OWN_FLAGFILE_FLAG_  - Define to 0 when the system provides its
+//                                     own flagfile flag parsing.
+//     GTEST_DECLARE_bool_(name)
+//     GTEST_DECLARE_int32_(name)
+//     GTEST_DECLARE_string_(name)
+//     GTEST_DEFINE_bool_(name, default_val, doc)
+//     GTEST_DEFINE_int32_(name, default_val, doc)
+//     GTEST_DEFINE_string_(name, default_val, doc)
+//
+//   Test filtering:
+//     GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
+//                                  will be used if --GTEST_FLAG(test_filter)
+//                                  is not provided.
+//
+//   Logging:
+//     GTEST_LOG_(severity)
+//     GTEST_CHECK_(condition)
+//     Functions LogToStderr() and FlushInfoLog() have to be provided too.
+//
+//   Threading:
+//     GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
+//     GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
+//                                         already provided.
+//     Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
+//     GTEST_DEFINE_STATIC_MUTEX_(mutex)
+//
+//     GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+//     GTEST_LOCK_EXCLUDED_(locks)
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest-printers.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest-printers.h
new file mode 100644
index 0000000..60c1ea0
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest-printers.h
@@ -0,0 +1,42 @@
+// Copyright 2015, 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.
+//
+// This file provides an injection point for custom printers in a local
+// installation of gTest.
+// It will be included from gtest-printers.h and the overrides in this file
+// will be visible to everyone.
+// See documentation at gtest/gtest-printers.h for details on how to define a
+// custom printer.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest.h
new file mode 100644
index 0000000..c27412a
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/custom/gtest.h
@@ -0,0 +1,41 @@
+// Copyright 2015, 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.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+// GTEST_OS_STACK_TRACE_GETTER_  - The name of an implementation of
+//                                 OsStackTraceGetterInterface.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h
new file mode 100644
index 0000000..2b3a78f
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-death-test-internal.h
@@ -0,0 +1,319 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines internal utilities needed for implementing
+// death tests.  They are subject to change without notice.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
+
+#include "gtest/internal/gtest-internal.h"
+
+#include <stdio.h>
+
+namespace testing {
+namespace internal {
+
+GTEST_DECLARE_string_(internal_run_death_test);
+
+// Names of the flags (needed for parsing Google Test flags).
+const char kDeathTestStyleFlag[] = "death_test_style";
+const char kDeathTestUseFork[] = "death_test_use_fork";
+const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
+
+#if GTEST_HAS_DEATH_TEST
+
+// DeathTest is a class that hides much of the complexity of the
+// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method
+// returns a concrete class that depends on the prevailing death test
+// style, as defined by the --gtest_death_test_style and/or
+// --gtest_internal_run_death_test flags.
+
+// In describing the results of death tests, these terms are used with
+// the corresponding definitions:
+//
+// exit status:  The integer exit information in the format specified
+//               by wait(2)
+// exit code:    The integer code passed to exit(3), _exit(2), or
+//               returned from main()
+class GTEST_API_ DeathTest {
+ public:
+  // Create returns false if there was an error determining the
+  // appropriate action to take for the current death test; for example,
+  // if the gtest_death_test_style flag is set to an invalid value.
+  // The LastMessage method will return a more detailed message in that
+  // case.  Otherwise, the DeathTest pointer pointed to by the "test"
+  // argument is set.  If the death test should be skipped, the pointer
+  // is set to NULL; otherwise, it is set to the address of a new concrete
+  // DeathTest object that controls the execution of the current test.
+  static bool Create(const char* statement, const RE* regex,
+                     const char* file, int line, DeathTest** test);
+  DeathTest();
+  virtual ~DeathTest() { }
+
+  // A helper class that aborts a death test when it's deleted.
+  class ReturnSentinel {
+   public:
+    explicit ReturnSentinel(DeathTest* test) : test_(test) { }
+    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
+   private:
+    DeathTest* const test_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
+  } GTEST_ATTRIBUTE_UNUSED_;
+
+  // An enumeration of possible roles that may be taken when a death
+  // test is encountered.  EXECUTE means that the death test logic should
+  // be executed immediately.  OVERSEE means that the program should prepare
+  // the appropriate environment for a child process to execute the death
+  // test, then wait for it to complete.
+  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
+
+  // An enumeration of the three reasons that a test might be aborted.
+  enum AbortReason {
+    TEST_ENCOUNTERED_RETURN_STATEMENT,
+    TEST_THREW_EXCEPTION,
+    TEST_DID_NOT_DIE
+  };
+
+  // Assumes one of the above roles.
+  virtual TestRole AssumeRole() = 0;
+
+  // Waits for the death test to finish and returns its status.
+  virtual int Wait() = 0;
+
+  // Returns true if the death test passed; that is, the test process
+  // exited during the test, its exit status matches a user-supplied
+  // predicate, and its stderr output matches a user-supplied regular
+  // expression.
+  // The user-supplied predicate may be a macro expression rather
+  // than a function pointer or functor, or else Wait and Passed could
+  // be combined.
+  virtual bool Passed(bool exit_status_ok) = 0;
+
+  // Signals that the death test did not die as expected.
+  virtual void Abort(AbortReason reason) = 0;
+
+  // Returns a human-readable outcome message regarding the outcome of
+  // the last death test.
+  static const char* LastMessage();
+
+  static void set_last_death_test_message(const std::string& message);
+
+ private:
+  // A string containing a description of the outcome of the last death test.
+  static std::string last_death_test_message_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
+};
+
+// Factory interface for death tests.  May be mocked out for testing.
+class DeathTestFactory {
+ public:
+  virtual ~DeathTestFactory() { }
+  virtual bool Create(const char* statement, const RE* regex,
+                      const char* file, int line, DeathTest** test) = 0;
+};
+
+// A concrete DeathTestFactory implementation for normal use.
+class DefaultDeathTestFactory : public DeathTestFactory {
+ public:
+  virtual bool Create(const char* statement, const RE* regex,
+                      const char* file, int line, DeathTest** test);
+};
+
+// Returns true if exit_status describes a process that was terminated
+// by a signal, or exited normally with a nonzero exit code.
+GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
+
+// Traps C++ exceptions escaping statement and reports them as test
+// failures. Note that trapping SEH exceptions is not implemented here.
+# if GTEST_HAS_EXCEPTIONS
+#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
+  try { \
+    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+  } catch (const ::std::exception& gtest_exception) { \
+    fprintf(\
+        stderr, \
+        "\n%s: Caught std::exception-derived exception escaping the " \
+        "death test statement. Exception message: %s\n", \
+        ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
+        gtest_exception.what()); \
+    fflush(stderr); \
+    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
+  } catch (...) { \
+    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
+  }
+
+# else
+#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
+  GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
+
+# endif
+
+// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
+// ASSERT_EXIT*, and EXPECT_EXIT*.
+# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    const ::testing::internal::RE& gtest_regex = (regex); \
+    ::testing::internal::DeathTest* gtest_dt; \
+    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \
+        __FILE__, __LINE__, &gtest_dt)) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
+    } \
+    if (gtest_dt != NULL) { \
+      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \
+          gtest_dt_ptr(gtest_dt); \
+      switch (gtest_dt->AssumeRole()) { \
+        case ::testing::internal::DeathTest::OVERSEE_TEST: \
+          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
+            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
+          } \
+          break; \
+        case ::testing::internal::DeathTest::EXECUTE_TEST: { \
+          ::testing::internal::DeathTest::ReturnSentinel \
+              gtest_sentinel(gtest_dt); \
+          GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
+          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
+          break; \
+        } \
+        default: \
+          break; \
+      } \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \
+      fail(::testing::internal::DeathTest::LastMessage())
+// The symbol "fail" here expands to something into which a message
+// can be streamed.
+
+// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
+// NDEBUG mode. In this case we need the statements to be executed, the regex is
+// ignored, and the macro must accept a streamed message even though the message
+// is never printed.
+# define GTEST_EXECUTE_STATEMENT_(statement, regex) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+     GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+  } else \
+    ::testing::Message()
+
+// A class representing the parsed contents of the
+// --gtest_internal_run_death_test flag, as it existed when
+// RUN_ALL_TESTS was called.
+class InternalRunDeathTestFlag {
+ public:
+  InternalRunDeathTestFlag(const std::string& a_file,
+                           int a_line,
+                           int an_index,
+                           int a_write_fd)
+      : file_(a_file), line_(a_line), index_(an_index),
+        write_fd_(a_write_fd) {}
+
+  ~InternalRunDeathTestFlag() {
+    if (write_fd_ >= 0)
+      posix::Close(write_fd_);
+  }
+
+  const std::string& file() const { return file_; }
+  int line() const { return line_; }
+  int index() const { return index_; }
+  int write_fd() const { return write_fd_; }
+
+ private:
+  std::string file_;
+  int line_;
+  int index_;
+  int write_fd_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
+};
+
+// Returns a newly created InternalRunDeathTestFlag object with fields
+// initialized from the GTEST_FLAG(internal_run_death_test) flag if
+// the flag is specified; otherwise returns NULL.
+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
+
+#else  // GTEST_HAS_DEATH_TEST
+
+// This macro is used for implementing macros such as
+// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
+// death tests are not supported. Those macros must compile on such systems
+// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on
+// systems that support death tests. This allows one to write such a macro
+// on a system that does not support death tests and be sure that it will
+// compile on a death-test supporting system.
+//
+// Parameters:
+//   statement -  A statement that a macro such as EXPECT_DEATH would test
+//                for program termination. This macro has to make sure this
+//                statement is compiled but not executed, to ensure that
+//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain
+//                parameter iff EXPECT_DEATH compiles with it.
+//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test
+//                the output of statement.  This parameter has to be
+//                compiled but not evaluated by this macro, to ensure that
+//                this macro only accepts expressions that a macro such as
+//                EXPECT_DEATH would accept.
+//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
+//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.
+//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not
+//                compile inside functions where ASSERT_DEATH doesn't
+//                compile.
+//
+//  The branch that has an always false condition is used to ensure that
+//  statement and regex are compiled (and thus syntactically correct) but
+//  never executed. The unreachable code macro protects the terminator
+//  statement from generating an 'unreachable code' warning in case
+//  statement unconditionally returns or throws. The Message constructor at
+//  the end allows the syntax of streaming additional messages into the
+//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
+# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \
+    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+    if (::testing::internal::AlwaysTrue()) { \
+      GTEST_LOG_(WARNING) \
+          << "Death tests are not supported on this platform.\n" \
+          << "Statement '" #statement "' cannot be verified."; \
+    } else if (::testing::internal::AlwaysFalse()) { \
+      ::testing::internal::RE::PartialMatch(".*", (regex)); \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+      terminator; \
+    } else \
+      ::testing::Message()
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h
new file mode 100644
index 0000000..7a13b4b
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-filepath.h
@@ -0,0 +1,206 @@
+// 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: keith.ray@gmail.com (Keith Ray)
+//
+// Google Test filepath utilities
+//
+// This header file declares classes and functions used internally by
+// Google Test.  They are subject to change without notice.
+//
+// This file is #included in <gtest/internal/gtest-internal.h>.
+// Do not include this header file separately!
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
+
+#include "gtest/internal/gtest-string.h"
+
+namespace testing {
+namespace internal {
+
+// FilePath - a class for file and directory pathname manipulation which
+// handles platform-specific conventions (like the pathname separator).
+// Used for helper functions for naming files in a directory for xml output.
+// Except for Set methods, all methods are const or static, which provides an
+// "immutable value object" -- useful for peace of mind.
+// A FilePath with a value ending in a path separator ("like/this/") represents
+// a directory, otherwise it is assumed to represent a file. In either case,
+// it may or may not represent an actual file or directory in the file system.
+// Names are NOT checked for syntax correctness -- no checking for illegal
+// characters, malformed paths, etc.
+
+class GTEST_API_ FilePath {
+ public:
+  FilePath() : pathname_("") { }
+  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
+
+  explicit FilePath(const std::string& pathname) : pathname_(pathname) {
+    Normalize();
+  }
+
+  FilePath& operator=(const FilePath& rhs) {
+    Set(rhs);
+    return *this;
+  }
+
+  void Set(const FilePath& rhs) {
+    pathname_ = rhs.pathname_;
+  }
+
+  const std::string& string() const { return pathname_; }
+  const char* c_str() const { return pathname_.c_str(); }
+
+  // Returns the current working directory, or "" if unsuccessful.
+  static FilePath GetCurrentDir();
+
+  // Given directory = "dir", base_name = "test", number = 0,
+  // extension = "xml", returns "dir/test.xml". If number is greater
+  // than zero (e.g., 12), returns "dir/test_12.xml".
+  // On Windows platform, uses \ as the separator rather than /.
+  static FilePath MakeFileName(const FilePath& directory,
+                               const FilePath& base_name,
+                               int number,
+                               const char* extension);
+
+  // Given directory = "dir", relative_path = "test.xml",
+  // returns "dir/test.xml".
+  // On Windows, uses \ as the separator rather than /.
+  static FilePath ConcatPaths(const FilePath& directory,
+                              const FilePath& relative_path);
+
+  // Returns a pathname for a file that does not currently exist. The pathname
+  // will be directory/base_name.extension or
+  // directory/base_name_<number>.extension if directory/base_name.extension
+  // already exists. The number will be incremented until a pathname is found
+  // that does not already exist.
+  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
+  // There could be a race condition if two or more processes are calling this
+  // function at the same time -- they could both pick the same filename.
+  static FilePath GenerateUniqueFileName(const FilePath& directory,
+                                         const FilePath& base_name,
+                                         const char* extension);
+
+  // Returns true iff the path is "".
+  bool IsEmpty() const { return pathname_.empty(); }
+
+  // If input name has a trailing separator character, removes it and returns
+  // the name, otherwise return the name string unmodified.
+  // On Windows platform, uses \ as the separator, other platforms use /.
+  FilePath RemoveTrailingPathSeparator() const;
+
+  // Returns a copy of the FilePath with the directory part removed.
+  // Example: FilePath("path/to/file").RemoveDirectoryName() returns
+  // FilePath("file"). If there is no directory part ("just_a_file"), it returns
+  // the FilePath unmodified. If there is no file part ("just_a_dir/") it
+  // returns an empty FilePath ("").
+  // On Windows platform, '\' is the path separator, otherwise it is '/'.
+  FilePath RemoveDirectoryName() const;
+
+  // RemoveFileName returns the directory path with the filename removed.
+  // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
+  // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
+  // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
+  // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
+  // On Windows platform, '\' is the path separator, otherwise it is '/'.
+  FilePath RemoveFileName() const;
+
+  // Returns a copy of the FilePath with the case-insensitive extension removed.
+  // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
+  // FilePath("dir/file"). If a case-insensitive extension is not
+  // found, returns a copy of the original FilePath.
+  FilePath RemoveExtension(const char* extension) const;
+
+  // Creates directories so that path exists. Returns true if successful or if
+  // the directories already exist; returns false if unable to create
+  // directories for any reason. Will also return false if the FilePath does
+  // not represent a directory (that is, it doesn't end with a path separator).
+  bool CreateDirectoriesRecursively() const;
+
+  // Create the directory so that path exists. Returns true if successful or
+  // if the directory already exists; returns false if unable to create the
+  // directory for any reason, including if the parent directory does not
+  // exist. Not named "CreateDirectory" because that's a macro on Windows.
+  bool CreateFolder() const;
+
+  // Returns true if FilePath describes something in the file-system,
+  // either a file, directory, or whatever, and that something exists.
+  bool FileOrDirectoryExists() const;
+
+  // Returns true if pathname describes a directory in the file-system
+  // that exists.
+  bool DirectoryExists() const;
+
+  // Returns true if FilePath ends with a path separator, which indicates that
+  // it is intended to represent a directory. Returns false otherwise.
+  // This does NOT check that a directory (or file) actually exists.
+  bool IsDirectory() const;
+
+  // Returns true if pathname describes a root directory. (Windows has one
+  // root directory per disk drive.)
+  bool IsRootDirectory() const;
+
+  // Returns true if pathname describes an absolute path.
+  bool IsAbsolutePath() const;
+
+ private:
+  // Replaces multiple consecutive separators with a single separator.
+  // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
+  // redundancies that might be in a pathname involving "." or "..".
+  //
+  // A pathname with multiple consecutive separators may occur either through
+  // user error or as a result of some scripts or APIs that generate a pathname
+  // with a trailing separator. On other platforms the same API or script
+  // may NOT generate a pathname with a trailing "/". Then elsewhere that
+  // pathname may have another "/" and pathname components added to it,
+  // without checking for the separator already being there.
+  // The script language and operating system may allow paths like "foo//bar"
+  // but some of the functions in FilePath will not handle that correctly. In
+  // particular, RemoveTrailingPathSeparator() only removes one separator, and
+  // it is called in CreateDirectoriesRecursively() assuming that it will change
+  // a pathname from directory syntax (trailing separator) to filename syntax.
+  //
+  // On Windows this method also replaces the alternate path separator '/' with
+  // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
+  // "bar\\foo".
+
+  void Normalize();
+
+  // Returns a pointer to the last occurence of a valid path separator in
+  // the FilePath. On Windows, for example, both '/' and '\' are valid path
+  // separators. Returns NULL if no path separator was found.
+  const char* FindLastPathSeparator() const;
+
+  std::string pathname_;
+};  // class FilePath
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-internal.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-internal.h
new file mode 100644
index 0000000..ebd1cf6
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-internal.h
@@ -0,0 +1,1238 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file declares functions and macros used internally by
+// Google Test.  They are subject to change without notice.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_OS_LINUX
+# include <stdlib.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <unistd.h>
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_HAS_EXCEPTIONS
+# include <stdexcept>
+#endif
+
+#include <ctype.h>
+#include <float.h>
+#include <string.h>
+#include <iomanip>
+#include <limits>
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-string.h"
+#include "gtest/internal/gtest-filepath.h"
+#include "gtest/internal/gtest-type-util.h"
+
+// Due to C++ preprocessor weirdness, we need double indirection to
+// concatenate two tokens when one of them is __LINE__.  Writing
+//
+//   foo ## __LINE__
+//
+// will result in the token foo__LINE__, instead of foo followed by
+// the current line number.  For more details, see
+// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
+#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
+#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
+
+class ProtocolMessage;
+namespace proto2 { class Message; }
+
+namespace testing {
+
+// Forward declarations.
+
+class AssertionResult;                 // Result of an assertion.
+class Message;                         // Represents a failure message.
+class Test;                            // Represents a test.
+class TestInfo;                        // Information about a test.
+class TestPartResult;                  // Result of a test part.
+class UnitTest;                        // A collection of test cases.
+
+template <typename T>
+::std::string PrintToString(const T& value);
+
+namespace internal {
+
+struct TraceInfo;                      // Information about a trace point.
+class ScopedTrace;                     // Implements scoped trace.
+class TestInfoImpl;                    // Opaque implementation of TestInfo
+class UnitTestImpl;                    // Opaque implementation of UnitTest
+
+// The text used in failure messages to indicate the start of the
+// stack trace.
+GTEST_API_ extern const char kStackTraceMarker[];
+
+// Two overloaded helpers for checking at compile time whether an
+// expression is a null pointer literal (i.e. NULL or any 0-valued
+// compile-time integral constant).  Their return values have
+// different sizes, so we can use sizeof() to test which version is
+// picked by the compiler.  These helpers have no implementations, as
+// we only need their signatures.
+//
+// Given IsNullLiteralHelper(x), the compiler will pick the first
+// version if x can be implicitly converted to Secret*, and pick the
+// second version otherwise.  Since Secret is a secret and incomplete
+// type, the only expression a user can write that has type Secret* is
+// a null pointer literal.  Therefore, we know that x is a null
+// pointer literal if and only if the first version is picked by the
+// compiler.
+char IsNullLiteralHelper(Secret* p);
+char (&IsNullLiteralHelper(...))[2];  // NOLINT
+
+// A compile-time bool constant that is true if and only if x is a
+// null pointer literal (i.e. NULL or any 0-valued compile-time
+// integral constant).
+#ifdef GTEST_ELLIPSIS_NEEDS_POD_
+// We lose support for NULL detection where the compiler doesn't like
+// passing non-POD classes through ellipsis (...).
+# define GTEST_IS_NULL_LITERAL_(x) false
+#else
+# define GTEST_IS_NULL_LITERAL_(x) \
+    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)
+#endif  // GTEST_ELLIPSIS_NEEDS_POD_
+
+// Appends the user-supplied message to the Google-Test-generated message.
+GTEST_API_ std::string AppendUserMessage(
+    const std::string& gtest_msg, const Message& user_msg);
+
+#if GTEST_HAS_EXCEPTIONS
+
+// This exception is thrown by (and only by) a failed Google Test
+// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
+// are enabled).  We derive it from std::runtime_error, which is for
+// errors presumably detectable only at run time.  Since
+// std::runtime_error inherits from std::exception, many testing
+// frameworks know how to extract and print the message inside it.
+class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
+ public:
+  explicit GoogleTestFailureException(const TestPartResult& failure);
+};
+
+#endif  // GTEST_HAS_EXCEPTIONS
+
+// A helper class for creating scoped traces in user programs.
+class GTEST_API_ ScopedTrace {
+ public:
+  // The c'tor pushes the given source file location and message onto
+  // a trace stack maintained by Google Test.
+  ScopedTrace(const char* file, int line, const Message& message);
+
+  // The d'tor pops the info pushed by the c'tor.
+  //
+  // Note that the d'tor is not virtual in order to be efficient.
+  // Don't inherit from ScopedTrace!
+  ~ScopedTrace();
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
+} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its
+                            // c'tor and d'tor.  Therefore it doesn't
+                            // need to be used otherwise.
+
+namespace edit_distance {
+// Returns the optimal edits to go from 'left' to 'right'.
+// All edits cost the same, with replace having lower priority than
+// add/remove.
+// Simple implementation of the Wagner–Fischer algorithm.
+// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
+enum EditType { kMatch, kAdd, kRemove, kReplace };
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<size_t>& left, const std::vector<size_t>& right);
+
+// Same as above, but the input is represented as strings.
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<std::string>& left,
+    const std::vector<std::string>& right);
+
+// Create a diff of the input strings in Unified diff format.
+GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+                                         const std::vector<std::string>& right,
+                                         size_t context = 2);
+
+}  // namespace edit_distance
+
+// Calculate the diff between 'left' and 'right' and return it in unified diff
+// format.
+// If not null, stores in 'total_line_count' the total number of lines found
+// in left + right.
+GTEST_API_ std::string DiffStrings(const std::string& left,
+                                   const std::string& right,
+                                   size_t* total_line_count);
+
+// Constructs and returns the message for an equality assertion
+// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
+//
+// The first four parameters are the expressions used in the assertion
+// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
+// where foo is 5 and bar is 6, we have:
+//
+//   expected_expression: "foo"
+//   actual_expression:   "bar"
+//   expected_value:      "5"
+//   actual_value:        "6"
+//
+// The ignoring_case parameter is true iff the assertion is a
+// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
+// be inserted into the message.
+GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
+                                     const char* actual_expression,
+                                     const std::string& expected_value,
+                                     const std::string& actual_value,
+                                     bool ignoring_case);
+
+// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
+GTEST_API_ std::string GetBoolAssertionFailureMessage(
+    const AssertionResult& assertion_result,
+    const char* expression_text,
+    const char* actual_predicate_value,
+    const char* expected_predicate_value);
+
+// This template class represents an IEEE floating-point number
+// (either single-precision or double-precision, depending on the
+// template parameters).
+//
+// The purpose of this class is to do more sophisticated number
+// comparison.  (Due to round-off error, etc, it's very unlikely that
+// two floating-points will be equal exactly.  Hence a naive
+// comparison by the == operation often doesn't work.)
+//
+// Format of IEEE floating-point:
+//
+//   The most-significant bit being the leftmost, an IEEE
+//   floating-point looks like
+//
+//     sign_bit exponent_bits fraction_bits
+//
+//   Here, sign_bit is a single bit that designates the sign of the
+//   number.
+//
+//   For float, there are 8 exponent bits and 23 fraction bits.
+//
+//   For double, there are 11 exponent bits and 52 fraction bits.
+//
+//   More details can be found at
+//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
+//
+// Template parameter:
+//
+//   RawType: the raw floating-point type (either float or double)
+template <typename RawType>
+class FloatingPoint {
+ public:
+  // Defines the unsigned integer type that has the same size as the
+  // floating point number.
+  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
+
+  // Constants.
+
+  // # of bits in a number.
+  static const size_t kBitCount = 8*sizeof(RawType);
+
+  // # of fraction bits in a number.
+  static const size_t kFractionBitCount =
+    std::numeric_limits<RawType>::digits - 1;
+
+  // # of exponent bits in a number.
+  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
+
+  // The mask for the sign bit.
+  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
+
+  // The mask for the fraction bits.
+  static const Bits kFractionBitMask =
+    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
+
+  // The mask for the exponent bits.
+  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
+
+  // How many ULP's (Units in the Last Place) we want to tolerate when
+  // comparing two numbers.  The larger the value, the more error we
+  // allow.  A 0 value means that two numbers must be exactly the same
+  // to be considered equal.
+  //
+  // The maximum error of a single floating-point operation is 0.5
+  // units in the last place.  On Intel CPU's, all floating-point
+  // calculations are done with 80-bit precision, while double has 64
+  // bits.  Therefore, 4 should be enough for ordinary use.
+  //
+  // See the following article for more details on ULP:
+  // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
+  static const size_t kMaxUlps = 4;
+
+  // Constructs a FloatingPoint from a raw floating-point number.
+  //
+  // On an Intel CPU, passing a non-normalized NAN (Not a Number)
+  // around may change its bits, although the new value is guaranteed
+  // to be also a NAN.  Therefore, don't expect this constructor to
+  // preserve the bits in x when x is a NAN.
+  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
+
+  // Static methods
+
+  // Reinterprets a bit pattern as a floating-point number.
+  //
+  // This function is needed to test the AlmostEquals() method.
+  static RawType ReinterpretBits(const Bits bits) {
+    FloatingPoint fp(0);
+    fp.u_.bits_ = bits;
+    return fp.u_.value_;
+  }
+
+  // Returns the floating-point number that represent positive infinity.
+  static RawType Infinity() {
+    return ReinterpretBits(kExponentBitMask);
+  }
+
+  // Returns the maximum representable finite floating-point number.
+  static RawType Max();
+
+  // Non-static methods
+
+  // Returns the bits that represents this number.
+  const Bits &bits() const { return u_.bits_; }
+
+  // Returns the exponent bits of this number.
+  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
+
+  // Returns the fraction bits of this number.
+  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
+
+  // Returns the sign bit of this number.
+  Bits sign_bit() const { return kSignBitMask & u_.bits_; }
+
+  // Returns true iff this is NAN (not a number).
+  bool is_nan() const {
+    // It's a NAN if the exponent bits are all ones and the fraction
+    // bits are not entirely zeros.
+    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
+  }
+
+  // Returns true iff this number is at most kMaxUlps ULP's away from
+  // rhs.  In particular, this function:
+  //
+  //   - returns false if either number is (or both are) NAN.
+  //   - treats really large numbers as almost equal to infinity.
+  //   - thinks +0.0 and -0.0 are 0 DLP's apart.
+  bool AlmostEquals(const FloatingPoint& rhs) const {
+    // The IEEE standard says that any comparison operation involving
+    // a NAN must return false.
+    if (is_nan() || rhs.is_nan()) return false;
+
+    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
+        <= kMaxUlps;
+  }
+
+ private:
+  // The data type used to store the actual floating-point number.
+  union FloatingPointUnion {
+    RawType value_;  // The raw floating-point number.
+    Bits bits_;      // The bits that represent the number.
+  };
+
+  // Converts an integer from the sign-and-magnitude representation to
+  // the biased representation.  More precisely, let N be 2 to the
+  // power of (kBitCount - 1), an integer x is represented by the
+  // unsigned number x + N.
+  //
+  // For instance,
+  //
+  //   -N + 1 (the most negative number representable using
+  //          sign-and-magnitude) is represented by 1;
+  //   0      is represented by N; and
+  //   N - 1  (the biggest number representable using
+  //          sign-and-magnitude) is represented by 2N - 1.
+  //
+  // Read http://en.wikipedia.org/wiki/Signed_number_representations
+  // for more details on signed number representations.
+  static Bits SignAndMagnitudeToBiased(const Bits &sam) {
+    if (kSignBitMask & sam) {
+      // sam represents a negative number.
+      return ~sam + 1;
+    } else {
+      // sam represents a positive number.
+      return kSignBitMask | sam;
+    }
+  }
+
+  // Given two numbers in the sign-and-magnitude representation,
+  // returns the distance between them as an unsigned number.
+  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
+                                                     const Bits &sam2) {
+    const Bits biased1 = SignAndMagnitudeToBiased(sam1);
+    const Bits biased2 = SignAndMagnitudeToBiased(sam2);
+    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
+  }
+
+  FloatingPointUnion u_;
+};
+
+// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
+// macro defined by <windows.h>.
+template <>
+inline float FloatingPoint<float>::Max() { return FLT_MAX; }
+template <>
+inline double FloatingPoint<double>::Max() { return DBL_MAX; }
+
+// Typedefs the instances of the FloatingPoint template class that we
+// care to use.
+typedef FloatingPoint<float> Float;
+typedef FloatingPoint<double> Double;
+
+// In order to catch the mistake of putting tests that use different
+// test fixture classes in the same test case, we need to assign
+// unique IDs to fixture classes and compare them.  The TypeId type is
+// used to hold such IDs.  The user should treat TypeId as an opaque
+// type: the only operation allowed on TypeId values is to compare
+// them for equality using the == operator.
+typedef const void* TypeId;
+
+template <typename T>
+class TypeIdHelper {
+ public:
+  // dummy_ must not have a const type.  Otherwise an overly eager
+  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
+  // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
+  static bool dummy_;
+};
+
+template <typename T>
+bool TypeIdHelper<T>::dummy_ = false;
+
+// GetTypeId<T>() returns the ID of type T.  Different values will be
+// returned for different types.  Calling the function twice with the
+// same type argument is guaranteed to return the same ID.
+template <typename T>
+TypeId GetTypeId() {
+  // The compiler is required to allocate a different
+  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
+  // the template.  Therefore, the address of dummy_ is guaranteed to
+  // be unique.
+  return &(TypeIdHelper<T>::dummy_);
+}
+
+// Returns the type ID of ::testing::Test.  Always call this instead
+// of GetTypeId< ::testing::Test>() to get the type ID of
+// ::testing::Test, as the latter may give the wrong result due to a
+// suspected linker bug when compiling Google Test as a Mac OS X
+// framework.
+GTEST_API_ TypeId GetTestTypeId();
+
+// Defines the abstract factory interface that creates instances
+// of a Test object.
+class TestFactoryBase {
+ public:
+  virtual ~TestFactoryBase() {}
+
+  // Creates a test instance to run. The instance is both created and destroyed
+  // within TestInfoImpl::Run()
+  virtual Test* CreateTest() = 0;
+
+ protected:
+  TestFactoryBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
+};
+
+// This class provides implementation of TeastFactoryBase interface.
+// It is used in TEST and TEST_F macros.
+template <class TestClass>
+class TestFactoryImpl : public TestFactoryBase {
+ public:
+  virtual Test* CreateTest() { return new TestClass; }
+};
+
+#if GTEST_OS_WINDOWS
+
+// Predicate-formatters for implementing the HRESULT checking macros
+// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
+// We pass a long instead of HRESULT to avoid causing an
+// include dependency for the HRESULT type.
+GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
+                                            long hr);  // NOLINT
+GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
+                                            long hr);  // NOLINT
+
+#endif  // GTEST_OS_WINDOWS
+
+// Types of SetUpTestCase() and TearDownTestCase() functions.
+typedef void (*SetUpTestCaseFunc)();
+typedef void (*TearDownTestCaseFunc)();
+
+struct CodeLocation {
+  CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {}
+
+  string file;
+  int line;
+};
+
+// Creates a new TestInfo object and registers it with Google Test;
+// returns the created object.
+//
+// Arguments:
+//
+//   test_case_name:   name of the test case
+//   name:             name of the test
+//   type_param        the name of the test's type parameter, or NULL if
+//                     this is not a typed or a type-parameterized test.
+//   value_param       text representation of the test's value parameter,
+//                     or NULL if this is not a type-parameterized test.
+//   code_location:    code location where the test is defined
+//   fixture_class_id: ID of the test fixture class
+//   set_up_tc:        pointer to the function that sets up the test case
+//   tear_down_tc:     pointer to the function that tears down the test case
+//   factory:          pointer to the factory that creates a test object.
+//                     The newly created TestInfo instance will assume
+//                     ownership of the factory object.
+GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
+    const char* test_case_name,
+    const char* name,
+    const char* type_param,
+    const char* value_param,
+    CodeLocation code_location,
+    TypeId fixture_class_id,
+    SetUpTestCaseFunc set_up_tc,
+    TearDownTestCaseFunc tear_down_tc,
+    TestFactoryBase* factory);
+
+// If *pstr starts with the given prefix, modifies *pstr to be right
+// past the prefix and returns true; otherwise leaves *pstr unchanged
+// and returns false.  None of pstr, *pstr, and prefix can be NULL.
+GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
+
+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// State of the definition of a type-parameterized test case.
+class GTEST_API_ TypedTestCasePState {
+ public:
+  TypedTestCasePState() : registered_(false) {}
+
+  // Adds the given test name to defined_test_names_ and return true
+  // if the test case hasn't been registered; otherwise aborts the
+  // program.
+  bool AddTestName(const char* file, int line, const char* case_name,
+                   const char* test_name) {
+    if (registered_) {
+      fprintf(stderr, "%s Test %s must be defined before "
+              "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n",
+              FormatFileLocation(file, line).c_str(), test_name, case_name);
+      fflush(stderr);
+      posix::Abort();
+    }
+    registered_tests_.insert(
+        ::std::make_pair(test_name, CodeLocation(file, line)));
+    return true;
+  }
+
+  bool TestExists(const std::string& test_name) const {
+    return registered_tests_.count(test_name) > 0;
+  }
+
+  const CodeLocation& GetCodeLocation(const std::string& test_name) const {
+    RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
+    GTEST_CHECK_(it != registered_tests_.end());
+    return it->second;
+  }
+
+  // Verifies that registered_tests match the test names in
+  // defined_test_names_; returns registered_tests if successful, or
+  // aborts the program otherwise.
+  const char* VerifyRegisteredTestNames(
+      const char* file, int line, const char* registered_tests);
+
+ private:
+  typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
+
+  bool registered_;
+  RegisteredTestsMap registered_tests_;
+};
+
+// Skips to the first non-space char after the first comma in 'str';
+// returns NULL if no comma is found in 'str'.
+inline const char* SkipComma(const char* str) {
+  const char* comma = strchr(str, ',');
+  if (comma == NULL) {
+    return NULL;
+  }
+  while (IsSpace(*(++comma))) {}
+  return comma;
+}
+
+// Returns the prefix of 'str' before the first comma in it; returns
+// the entire string if it contains no comma.
+inline std::string GetPrefixUntilComma(const char* str) {
+  const char* comma = strchr(str, ',');
+  return comma == NULL ? str : std::string(str, comma);
+}
+
+// Splits a given string on a given delimiter, populating a given
+// vector with the fields.
+void SplitString(const ::std::string& str, char delimiter,
+                 ::std::vector< ::std::string>* dest);
+
+// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
+// registers a list of type-parameterized tests with Google Test.  The
+// return value is insignificant - we just need to return something
+// such that we can call this function in a namespace scope.
+//
+// Implementation note: The GTEST_TEMPLATE_ macro declares a template
+// template parameter.  It's defined in gtest-type-util.h.
+template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
+class TypeParameterizedTest {
+ public:
+  // 'index' is the index of the test in the type list 'Types'
+  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
+  // Types).  Valid values for 'index' are [0, N - 1] where N is the
+  // length of Types.
+  static bool Register(const char* prefix,
+                       CodeLocation code_location,
+                       const char* case_name, const char* test_names,
+                       int index) {
+    typedef typename Types::Head Type;
+    typedef Fixture<Type> FixtureClass;
+    typedef typename GTEST_BIND_(TestSel, Type) TestClass;
+
+    // First, registers the first type-parameterized test in the type
+    // list.
+    MakeAndRegisterTestInfo(
+        (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
+         + StreamableToString(index)).c_str(),
+        StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
+        GetTypeName<Type>().c_str(),
+        NULL,  // No value parameter.
+        code_location,
+        GetTypeId<FixtureClass>(),
+        TestClass::SetUpTestCase,
+        TestClass::TearDownTestCase,
+        new TestFactoryImpl<TestClass>);
+
+    // Next, recurses (at compile time) with the tail of the type list.
+    return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
+        ::Register(prefix, code_location, case_name, test_names, index + 1);
+  }
+};
+
+// The base case for the compile time recursion.
+template <GTEST_TEMPLATE_ Fixture, class TestSel>
+class TypeParameterizedTest<Fixture, TestSel, Types0> {
+ public:
+  static bool Register(const char* /*prefix*/, CodeLocation,
+                       const char* /*case_name*/, const char* /*test_names*/,
+                       int /*index*/) {
+    return true;
+  }
+};
+
+// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()
+// registers *all combinations* of 'Tests' and 'Types' with Google
+// Test.  The return value is insignificant - we just need to return
+// something such that we can call this function in a namespace scope.
+template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
+class TypeParameterizedTestCase {
+ public:
+  static bool Register(const char* prefix, CodeLocation code_location,
+                       const TypedTestCasePState* state,
+                       const char* case_name, const char* test_names) {
+    std::string test_name = StripTrailingSpaces(
+        GetPrefixUntilComma(test_names));
+    if (!state->TestExists(test_name)) {
+      fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
+              case_name, test_name.c_str(),
+              FormatFileLocation(code_location.file.c_str(),
+                                 code_location.line).c_str());
+      fflush(stderr);
+      posix::Abort();
+    }
+    const CodeLocation& test_location = state->GetCodeLocation(test_name);
+
+    typedef typename Tests::Head Head;
+
+    // First, register the first test in 'Test' for each type in 'Types'.
+    TypeParameterizedTest<Fixture, Head, Types>::Register(
+        prefix, test_location, case_name, test_names, 0);
+
+    // Next, recurses (at compile time) with the tail of the test list.
+    return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
+        ::Register(prefix, code_location, state,
+                   case_name, SkipComma(test_names));
+  }
+};
+
+// The base case for the compile time recursion.
+template <GTEST_TEMPLATE_ Fixture, typename Types>
+class TypeParameterizedTestCase<Fixture, Templates0, Types> {
+ public:
+  static bool Register(const char* /*prefix*/, CodeLocation,
+                       const TypedTestCasePState* /*state*/,
+                       const char* /*case_name*/, const char* /*test_names*/) {
+    return true;
+  }
+};
+
+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// Returns the current OS stack trace as an std::string.
+//
+// The maximum number of stack frames to be included is specified by
+// the gtest_stack_trace_depth flag.  The skip_count parameter
+// specifies the number of top frames to be skipped, which doesn't
+// count against the number of frames to be included.
+//
+// For example, if Foo() calls Bar(), which in turn calls
+// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
+// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
+GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
+    UnitTest* unit_test, int skip_count);
+
+// Helpers for suppressing warnings on unreachable code or constant
+// condition.
+
+// Always returns true.
+GTEST_API_ bool AlwaysTrue();
+
+// Always returns false.
+inline bool AlwaysFalse() { return !AlwaysTrue(); }
+
+// Helper for suppressing false warning from Clang on a const char*
+// variable declared in a conditional expression always being NULL in
+// the else branch.
+struct GTEST_API_ ConstCharPtr {
+  ConstCharPtr(const char* str) : value(str) {}
+  operator bool() const { return true; }
+  const char* value;
+};
+
+// A simple Linear Congruential Generator for generating random
+// numbers with a uniform distribution.  Unlike rand() and srand(), it
+// doesn't use global state (and therefore can't interfere with user
+// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,
+// but it's good enough for our purposes.
+class GTEST_API_ Random {
+ public:
+  static const UInt32 kMaxRange = 1u << 31;
+
+  explicit Random(UInt32 seed) : state_(seed) {}
+
+  void Reseed(UInt32 seed) { state_ = seed; }
+
+  // Generates a random number from [0, range).  Crashes if 'range' is
+  // 0 or greater than kMaxRange.
+  UInt32 Generate(UInt32 range);
+
+ private:
+  UInt32 state_;
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
+};
+
+// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a
+// compiler error iff T1 and T2 are different types.
+template <typename T1, typename T2>
+struct CompileAssertTypesEqual;
+
+template <typename T>
+struct CompileAssertTypesEqual<T, T> {
+};
+
+// Removes the reference from a type if it is a reference type,
+// otherwise leaves it unchanged.  This is the same as
+// tr1::remove_reference, which is not widely available yet.
+template <typename T>
+struct RemoveReference { typedef T type; };  // NOLINT
+template <typename T>
+struct RemoveReference<T&> { typedef T type; };  // NOLINT
+
+// A handy wrapper around RemoveReference that works when the argument
+// T depends on template parameters.
+#define GTEST_REMOVE_REFERENCE_(T) \
+    typename ::testing::internal::RemoveReference<T>::type
+
+// Removes const from a type if it is a const type, otherwise leaves
+// it unchanged.  This is the same as tr1::remove_const, which is not
+// widely available yet.
+template <typename T>
+struct RemoveConst { typedef T type; };  // NOLINT
+template <typename T>
+struct RemoveConst<const T> { typedef T type; };  // NOLINT
+
+// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above
+// definition to fail to remove the const in 'const int[3]' and 'const
+// char[3][4]'.  The following specialization works around the bug.
+template <typename T, size_t N>
+struct RemoveConst<const T[N]> {
+  typedef typename RemoveConst<T>::type type[N];
+};
+
+#if defined(_MSC_VER) && _MSC_VER < 1400
+// This is the only specialization that allows VC++ 7.1 to remove const in
+// 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC
+// and thus needs to be conditionally compiled.
+template <typename T, size_t N>
+struct RemoveConst<T[N]> {
+  typedef typename RemoveConst<T>::type type[N];
+};
+#endif
+
+// A handy wrapper around RemoveConst that works when the argument
+// T depends on template parameters.
+#define GTEST_REMOVE_CONST_(T) \
+    typename ::testing::internal::RemoveConst<T>::type
+
+// Turns const U&, U&, const U, and U all into U.
+#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
+    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))
+
+// Adds reference to a type if it is not a reference type,
+// otherwise leaves it unchanged.  This is the same as
+// tr1::add_reference, which is not widely available yet.
+template <typename T>
+struct AddReference { typedef T& type; };  // NOLINT
+template <typename T>
+struct AddReference<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper around AddReference that works when the argument T
+// depends on template parameters.
+#define GTEST_ADD_REFERENCE_(T) \
+    typename ::testing::internal::AddReference<T>::type
+
+// Adds a reference to const on top of T as necessary.  For example,
+// it transforms
+//
+//   char         ==> const char&
+//   const char   ==> const char&
+//   char&        ==> const char&
+//   const char&  ==> const char&
+//
+// The argument T must depend on some template parameters.
+#define GTEST_REFERENCE_TO_CONST_(T) \
+    GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T))
+
+// ImplicitlyConvertible<From, To>::value is a compile-time bool
+// constant that's true iff type From can be implicitly converted to
+// type To.
+template <typename From, typename To>
+class ImplicitlyConvertible {
+ private:
+  // We need the following helper functions only for their types.
+  // They have no implementations.
+
+  // MakeFrom() is an expression whose type is From.  We cannot simply
+  // use From(), as the type From may not have a public default
+  // constructor.
+  static typename AddReference<From>::type MakeFrom();
+
+  // These two functions are overloaded.  Given an expression
+  // Helper(x), the compiler will pick the first version if x can be
+  // implicitly converted to type To; otherwise it will pick the
+  // second version.
+  //
+  // The first version returns a value of size 1, and the second
+  // version returns a value of size 2.  Therefore, by checking the
+  // size of Helper(x), which can be done at compile time, we can tell
+  // which version of Helper() is used, and hence whether x can be
+  // implicitly converted to type To.
+  static char Helper(To);
+  static char (&Helper(...))[2];  // NOLINT
+
+  // We have to put the 'public' section after the 'private' section,
+  // or MSVC refuses to compile the code.
+ public:
+#if defined(__BORLANDC__)
+  // C++Builder cannot use member overload resolution during template
+  // instantiation.  The simplest workaround is to use its C++0x type traits
+  // functions (C++Builder 2009 and above only).
+  static const bool value = __is_convertible(From, To);
+#else
+  // MSVC warns about implicitly converting from double to int for
+  // possible loss of data, so we need to temporarily disable the
+  // warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
+  static const bool value =
+      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif  // __BORLANDC__
+};
+template <typename From, typename To>
+const bool ImplicitlyConvertible<From, To>::value;
+
+// IsAProtocolMessage<T>::value is a compile-time bool constant that's
+// true iff T is type ProtocolMessage, proto2::Message, or a subclass
+// of those.
+template <typename T>
+struct IsAProtocolMessage
+    : public bool_constant<
+  ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||
+  ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {
+};
+
+// When the compiler sees expression IsContainerTest<C>(0), if C is an
+// STL-style container class, the first overload of IsContainerTest
+// will be viable (since both C::iterator* and C::const_iterator* are
+// valid types and NULL can be implicitly converted to them).  It will
+// be picked over the second overload as 'int' is a perfect match for
+// the type of argument 0.  If C::iterator or C::const_iterator is not
+// a valid type, the first overload is not viable, and the second
+// overload will be picked.  Therefore, we can determine whether C is
+// a container class by checking the type of IsContainerTest<C>(0).
+// The value of the expression is insignificant.
+//
+// Note that we look for both C::iterator and C::const_iterator.  The
+// reason is that C++ injects the name of a class as a member of the
+// class itself (e.g. you can refer to class iterator as either
+// 'iterator' or 'iterator::iterator').  If we look for C::iterator
+// only, for example, we would mistakenly think that a class named
+// iterator is an STL container.
+//
+// Also note that the simpler approach of overloading
+// IsContainerTest(typename C::const_iterator*) and
+// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
+typedef int IsContainer;
+template <class C>
+IsContainer IsContainerTest(int /* dummy */,
+                            typename C::iterator* /* it */ = NULL,
+                            typename C::const_iterator* /* const_it */ = NULL) {
+  return 0;
+}
+
+typedef char IsNotContainer;
+template <class C>
+IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
+
+// EnableIf<condition>::type is void when 'Cond' is true, and
+// undefined when 'Cond' is false.  To use SFINAE to make a function
+// overload only apply when a particular expression is true, add
+// "typename EnableIf<expression>::type* = 0" as the last parameter.
+template<bool> struct EnableIf;
+template<> struct EnableIf<true> { typedef void type; };  // NOLINT
+
+// Utilities for native arrays.
+
+// ArrayEq() compares two k-dimensional native arrays using the
+// elements' operator==, where k can be any integer >= 0.  When k is
+// 0, ArrayEq() degenerates into comparing a single pair of values.
+
+template <typename T, typename U>
+bool ArrayEq(const T* lhs, size_t size, const U* rhs);
+
+// This generic version is used when k is 0.
+template <typename T, typename U>
+inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
+
+// This overload is used when k >= 1.
+template <typename T, typename U, size_t N>
+inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
+  return internal::ArrayEq(lhs, N, rhs);
+}
+
+// This helper reduces code bloat.  If we instead put its logic inside
+// the previous ArrayEq() function, arrays with different sizes would
+// lead to different copies of the template code.
+template <typename T, typename U>
+bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
+  for (size_t i = 0; i != size; i++) {
+    if (!internal::ArrayEq(lhs[i], rhs[i]))
+      return false;
+  }
+  return true;
+}
+
+// Finds the first element in the iterator range [begin, end) that
+// equals elem.  Element may be a native array type itself.
+template <typename Iter, typename Element>
+Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
+  for (Iter it = begin; it != end; ++it) {
+    if (internal::ArrayEq(*it, elem))
+      return it;
+  }
+  return end;
+}
+
+// CopyArray() copies a k-dimensional native array using the elements'
+// operator=, where k can be any integer >= 0.  When k is 0,
+// CopyArray() degenerates into copying a single value.
+
+template <typename T, typename U>
+void CopyArray(const T* from, size_t size, U* to);
+
+// This generic version is used when k is 0.
+template <typename T, typename U>
+inline void CopyArray(const T& from, U* to) { *to = from; }
+
+// This overload is used when k >= 1.
+template <typename T, typename U, size_t N>
+inline void CopyArray(const T(&from)[N], U(*to)[N]) {
+  internal::CopyArray(from, N, *to);
+}
+
+// This helper reduces code bloat.  If we instead put its logic inside
+// the previous CopyArray() function, arrays with different sizes
+// would lead to different copies of the template code.
+template <typename T, typename U>
+void CopyArray(const T* from, size_t size, U* to) {
+  for (size_t i = 0; i != size; i++) {
+    internal::CopyArray(from[i], to + i);
+  }
+}
+
+// The relation between an NativeArray object (see below) and the
+// native array it represents.
+// We use 2 different structs to allow non-copyable types to be used, as long
+// as RelationToSourceReference() is passed.
+struct RelationToSourceReference {};
+struct RelationToSourceCopy {};
+
+// Adapts a native array to a read-only STL-style container.  Instead
+// of the complete STL container concept, this adaptor only implements
+// members useful for Google Mock's container matchers.  New members
+// should be added as needed.  To simplify the implementation, we only
+// support Element being a raw type (i.e. having no top-level const or
+// reference modifier).  It's the client's responsibility to satisfy
+// this requirement.  Element can be an array type itself (hence
+// multi-dimensional arrays are supported).
+template <typename Element>
+class NativeArray {
+ public:
+  // STL-style container typedefs.
+  typedef Element value_type;
+  typedef Element* iterator;
+  typedef const Element* const_iterator;
+
+  // Constructs from a native array. References the source.
+  NativeArray(const Element* array, size_t count, RelationToSourceReference) {
+    InitRef(array, count);
+  }
+
+  // Constructs from a native array. Copies the source.
+  NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
+    InitCopy(array, count);
+  }
+
+  // Copy constructor.
+  NativeArray(const NativeArray& rhs) {
+    (this->*rhs.clone_)(rhs.array_, rhs.size_);
+  }
+
+  ~NativeArray() {
+    if (clone_ != &NativeArray::InitRef)
+      delete[] array_;
+  }
+
+  // STL-style container methods.
+  size_t size() const { return size_; }
+  const_iterator begin() const { return array_; }
+  const_iterator end() const { return array_ + size_; }
+  bool operator==(const NativeArray& rhs) const {
+    return size() == rhs.size() &&
+        ArrayEq(begin(), size(), rhs.begin());
+  }
+
+ private:
+  enum {
+    kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
+        Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
+  };
+
+  // Initializes this object with a copy of the input.
+  void InitCopy(const Element* array, size_t a_size) {
+    Element* const copy = new Element[a_size];
+    CopyArray(array, a_size, copy);
+    array_ = copy;
+    size_ = a_size;
+    clone_ = &NativeArray::InitCopy;
+  }
+
+  // Initializes this object with a reference of the input.
+  void InitRef(const Element* array, size_t a_size) {
+    array_ = array;
+    size_ = a_size;
+    clone_ = &NativeArray::InitRef;
+  }
+
+  const Element* array_;
+  size_t size_;
+  void (NativeArray::*clone_)(const Element*, size_t);
+
+  GTEST_DISALLOW_ASSIGN_(NativeArray);
+};
+
+}  // namespace internal
+}  // namespace testing
+
+#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
+  ::testing::internal::AssertHelper(result_type, file, line, message) \
+    = ::testing::Message()
+
+#define GTEST_MESSAGE_(message, result_type) \
+  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
+
+#define GTEST_FATAL_FAILURE_(message) \
+  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
+
+#define GTEST_NONFATAL_FAILURE_(message) \
+  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
+
+#define GTEST_SUCCESS_(message) \
+  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
+
+// Suppresses MSVC warnings 4072 (unreachable code) for the code following
+// statement if it returns or throws (or doesn't return or throw in some
+// situations).
+#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
+  if (::testing::internal::AlwaysTrue()) { statement; }
+
+#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::ConstCharPtr gtest_msg = "") { \
+    bool gtest_caught_expected = false; \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (expected_exception const&) { \
+      gtest_caught_expected = true; \
+    } \
+    catch (...) { \
+      gtest_msg.value = \
+          "Expected: " #statement " throws an exception of type " \
+          #expected_exception ".\n  Actual: it throws a different type."; \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
+    } \
+    if (!gtest_caught_expected) { \
+      gtest_msg.value = \
+          "Expected: " #statement " throws an exception of type " \
+          #expected_exception ".\n  Actual: it throws nothing."; \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
+      fail(gtest_msg.value)
+
+#define GTEST_TEST_NO_THROW_(statement, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (...) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
+      fail("Expected: " #statement " doesn't throw an exception.\n" \
+           "  Actual: it throws.")
+
+#define GTEST_TEST_ANY_THROW_(statement, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    bool gtest_caught_any = false; \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (...) { \
+      gtest_caught_any = true; \
+    } \
+    if (!gtest_caught_any) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
+      fail("Expected: " #statement " throws an exception.\n" \
+           "  Actual: it doesn't.")
+
+
+// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
+// either a boolean expression or an AssertionResult. text is a textual
+// represenation of expression as it was passed into the EXPECT_TRUE.
+#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (const ::testing::AssertionResult gtest_ar_ = \
+      ::testing::AssertionResult(expression)) \
+    ; \
+  else \
+    fail(::testing::internal::GetBoolAssertionFailureMessage(\
+        gtest_ar_, text, #actual, #expected).c_str())
+
+#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::AlwaysTrue()) { \
+    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
+    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
+      fail("Expected: " #statement " doesn't generate new fatal " \
+           "failures in the current thread.\n" \
+           "  Actual: it does.")
+
+// Expands to the name of the class that implements the given test.
+#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
+  test_case_name##_##test_name##_Test
+
+// Helper macro for defining tests.
+#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\
+class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
+ public:\
+  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\
+ private:\
+  virtual void TestBody();\
+  static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(\
+      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\
+};\
+\
+::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\
+  ::test_info_ =\
+    ::testing::internal::MakeAndRegisterTestInfo(\
+        #test_case_name, #test_name, NULL, NULL, \
+        ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+        (parent_id), \
+        parent_class::SetUpTestCase, \
+        parent_class::TearDownTestCase, \
+        new ::testing::internal::TestFactoryImpl<\
+            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\
+void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h
new file mode 100644
index 0000000..3602942
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-linked_ptr.h
@@ -0,0 +1,243 @@
+// Copyright 2003 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.
+//
+// Authors: Dan Egnor (egnor@google.com)
+//
+// A "smart" pointer type with reference tracking.  Every pointer to a
+// particular object is kept on a circular linked list.  When the last pointer
+// to an object is destroyed or reassigned, the object is deleted.
+//
+// Used properly, this deletes the object when the last reference goes away.
+// There are several caveats:
+// - Like all reference counting schemes, cycles lead to leaks.
+// - Each smart pointer is actually two pointers (8 bytes instead of 4).
+// - Every time a pointer is assigned, the entire list of pointers to that
+//   object is traversed.  This class is therefore NOT SUITABLE when there
+//   will often be more than two or three pointers to a particular object.
+// - References are only tracked as long as linked_ptr<> objects are copied.
+//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
+//   will happen (double deletion).
+//
+// A good use of this class is storing object references in STL containers.
+// You can safely put linked_ptr<> in a vector<>.
+// Other uses may not be as good.
+//
+// Note: If you use an incomplete type with linked_ptr<>, the class
+// *containing* linked_ptr<> must have a constructor and destructor (even
+// if they do nothing!).
+//
+// Bill Gibbons suggested we use something like this.
+//
+// Thread Safety:
+//   Unlike other linked_ptr implementations, in this implementation
+//   a linked_ptr object is thread-safe in the sense that:
+//     - it's safe to copy linked_ptr objects concurrently,
+//     - it's safe to copy *from* a linked_ptr and read its underlying
+//       raw pointer (e.g. via get()) concurrently, and
+//     - it's safe to write to two linked_ptrs that point to the same
+//       shared object concurrently.
+// TODO(wan@google.com): rename this to safe_linked_ptr to avoid
+// confusion with normal linked_ptr.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
+
+#include <stdlib.h>
+#include <assert.h>
+
+#include "gtest/internal/gtest-port.h"
+
+namespace testing {
+namespace internal {
+
+// Protects copying of all linked_ptr objects.
+GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);
+
+// This is used internally by all instances of linked_ptr<>.  It needs to be
+// a non-template class because different types of linked_ptr<> can refer to
+// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
+// So, it needs to be possible for different types of linked_ptr to participate
+// in the same circular linked list, so we need a single class type here.
+//
+// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.
+class linked_ptr_internal {
+ public:
+  // Create a new circle that includes only this instance.
+  void join_new() {
+    next_ = this;
+  }
+
+  // Many linked_ptr operations may change p.link_ for some linked_ptr
+  // variable p in the same circle as this object.  Therefore we need
+  // to prevent two such operations from occurring concurrently.
+  //
+  // Note that different types of linked_ptr objects can coexist in a
+  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and
+  // linked_ptr<Derived2>).  Therefore we must use a single mutex to
+  // protect all linked_ptr objects.  This can create serious
+  // contention in production code, but is acceptable in a testing
+  // framework.
+
+  // Join an existing circle.
+  void join(linked_ptr_internal const* ptr)
+      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
+    MutexLock lock(&g_linked_ptr_mutex);
+
+    linked_ptr_internal const* p = ptr;
+    while (p->next_ != ptr) {
+      assert(p->next_ != this &&
+             "Trying to join() a linked ring we are already in. "
+             "Is GMock thread safety enabled?");
+      p = p->next_;
+    }
+    p->next_ = this;
+    next_ = ptr;
+  }
+
+  // Leave whatever circle we're part of.  Returns true if we were the
+  // last member of the circle.  Once this is done, you can join() another.
+  bool depart()
+      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {
+    MutexLock lock(&g_linked_ptr_mutex);
+
+    if (next_ == this) return true;
+    linked_ptr_internal const* p = next_;
+    while (p->next_ != this) {
+      assert(p->next_ != next_ &&
+             "Trying to depart() a linked ring we are not in. "
+             "Is GMock thread safety enabled?");
+      p = p->next_;
+    }
+    p->next_ = next_;
+    return false;
+  }
+
+ private:
+  mutable linked_ptr_internal const* next_;
+};
+
+template <typename T>
+class linked_ptr {
+ public:
+  typedef T element_type;
+
+  // Take over ownership of a raw pointer.  This should happen as soon as
+  // possible after the object is created.
+  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
+  ~linked_ptr() { depart(); }
+
+  // Copy an existing linked_ptr<>, adding ourselves to the list of references.
+  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
+  linked_ptr(linked_ptr const& ptr) {  // NOLINT
+    assert(&ptr != this);
+    copy(&ptr);
+  }
+
+  // Assignment releases the old value and acquires the new.
+  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
+    depart();
+    copy(&ptr);
+    return *this;
+  }
+
+  linked_ptr& operator=(linked_ptr const& ptr) {
+    if (&ptr != this) {
+      depart();
+      copy(&ptr);
+    }
+    return *this;
+  }
+
+  // Smart pointer members.
+  void reset(T* ptr = NULL) {
+    depart();
+    capture(ptr);
+  }
+  T* get() const { return value_; }
+  T* operator->() const { return value_; }
+  T& operator*() const { return *value_; }
+
+  bool operator==(T* p) const { return value_ == p; }
+  bool operator!=(T* p) const { return value_ != p; }
+  template <typename U>
+  bool operator==(linked_ptr<U> const& ptr) const {
+    return value_ == ptr.get();
+  }
+  template <typename U>
+  bool operator!=(linked_ptr<U> const& ptr) const {
+    return value_ != ptr.get();
+  }
+
+ private:
+  template <typename U>
+  friend class linked_ptr;
+
+  T* value_;
+  linked_ptr_internal link_;
+
+  void depart() {
+    if (link_.depart()) delete value_;
+  }
+
+  void capture(T* ptr) {
+    value_ = ptr;
+    link_.join_new();
+  }
+
+  template <typename U> void copy(linked_ptr<U> const* ptr) {
+    value_ = ptr->get();
+    if (value_)
+      link_.join(&ptr->link_);
+    else
+      link_.join_new();
+  }
+};
+
+template<typename T> inline
+bool operator==(T* ptr, const linked_ptr<T>& x) {
+  return ptr == x.get();
+}
+
+template<typename T> inline
+bool operator!=(T* ptr, const linked_ptr<T>& x) {
+  return ptr != x.get();
+}
+
+// A function to convert T* into linked_ptr<T>
+// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
+// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
+template <typename T>
+linked_ptr<T> make_linked_ptr(T* ptr) {
+  return linked_ptr<T>(ptr);
+}
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h
new file mode 100644
index 0000000..4d1d81d
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h
@@ -0,0 +1,5146 @@
+// This file was GENERATED by command:
+//     pump.py gtest-param-util-generated.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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: vladl@google.com (Vlad Losev)
+
+// Type and function utilities for implementing parameterized tests.
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently Google Test supports at most 50 arguments in Values,
+// and at most 10 arguments in Combine. Please contact
+// googletestframework@googlegroups.com if you need more.
+// Please note that the number of arguments to Combine is limited
+// by the maximum arity of the implementation of tuple which is
+// currently set at 10.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Forward declarations of ValuesIn(), which is implemented in
+// include/gtest/gtest-param-test.h.
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end);
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container);
+
+namespace internal {
+
+// Used in the Values() function to provide polymorphic capabilities.
+template <typename T1>
+class ValueArray1 {
+ public:
+  explicit ValueArray1(T1 v1) : v1_(v1) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray1& other);
+
+  const T1 v1_;
+};
+
+template <typename T1, typename T2>
+class ValueArray2 {
+ public:
+  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray2& other);
+
+  const T1 v1_;
+  const T2 v2_;
+};
+
+template <typename T1, typename T2, typename T3>
+class ValueArray3 {
+ public:
+  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray3& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4>
+class ValueArray4 {
+ public:
+  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray4& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+class ValueArray5 {
+ public:
+  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray5& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+class ValueArray6 {
+ public:
+  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray6& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+class ValueArray7 {
+ public:
+  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray7& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+class ValueArray8 {
+ public:
+  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,
+      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray8& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+class ValueArray9 {
+ public:
+  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,
+      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray9& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+class ValueArray10 {
+ public:
+  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray10& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+class ValueArray11 {
+ public:
+  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray11& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+class ValueArray12 {
+ public:
+  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray12& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+class ValueArray13 {
+ public:
+  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray13& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+class ValueArray14 {
+ public:
+  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray14& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+class ValueArray15 {
+ public:
+  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray15& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+class ValueArray16 {
+ public:
+  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray16& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+class ValueArray17 {
+ public:
+  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,
+      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray17& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+class ValueArray18 {
+ public:
+  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray18& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+class ValueArray19 {
+ public:
+  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray19& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+class ValueArray20 {
+ public:
+  ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray20& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+class ValueArray21 {
+ public:
+  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray21& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+class ValueArray22 {
+ public:
+  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray22& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+class ValueArray23 {
+ public:
+  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray23& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+class ValueArray24 {
+ public:
+  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray24& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+class ValueArray25 {
+ public:
+  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,
+      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray25& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+class ValueArray26 {
+ public:
+  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray26& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+class ValueArray27 {
+ public:
+  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
+      v26_(v26), v27_(v27) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray27& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+class ValueArray28 {
+ public:
+  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
+      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray28& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+class ValueArray29 {
+ public:
+  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray29& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+class ValueArray30 {
+ public:
+  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray30& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+class ValueArray31 {
+ public:
+  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray31& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+class ValueArray32 {
+ public:
+  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray32& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+class ValueArray33 {
+ public:
+  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,
+      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray33& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+class ValueArray34 {
+ public:
+  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray34& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+class ValueArray35 {
+ public:
+  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
+      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
+      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray35& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+class ValueArray36 {
+ public:
+  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
+      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
+      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray36& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+class ValueArray37 {
+ public:
+  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
+      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
+      v36_(v36), v37_(v37) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray37& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+class ValueArray38 {
+ public:
+  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray38& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+class ValueArray39 {
+ public:
+  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray39& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+class ValueArray40 {
+ public:
+  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
+      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
+      v40_(v40) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray40& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+class ValueArray41 {
+ public:
+  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,
+      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray41& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+class ValueArray42 {
+ public:
+  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray42& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+class ValueArray43 {
+ public:
+  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),
+      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),
+      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),
+      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),
+      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),
+      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),
+      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray43& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+class ValueArray44 {
+ public:
+  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),
+      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),
+      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),
+      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),
+      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),
+      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),
+      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),
+      v43_(v43), v44_(v44) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray44& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+class ValueArray45 {
+ public:
+  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),
+      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),
+      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),
+      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),
+      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),
+      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),
+      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),
+      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray45& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+class ValueArray46 {
+ public:
+  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),
+      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
+      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray46& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+class ValueArray47 {
+ public:
+  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),
+      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),
+      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),
+      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),
+      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),
+      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),
+      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),
+      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),
+      v47_(v47) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray47& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+class ValueArray48 {
+ public:
+  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),
+      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),
+      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),
+      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),
+      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),
+      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),
+      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),
+      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),
+      v46_(v46), v47_(v47), v48_(v48) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
+        static_cast<T>(v48_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray48& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+  const T48 v48_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+class ValueArray49 {
+ public:
+  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,
+      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
+      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
+        static_cast<T>(v48_), static_cast<T>(v49_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray49& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+  const T48 v48_;
+  const T49 v49_;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+class ValueArray50 {
+ public:
+  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,
+      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,
+      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,
+      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,
+      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,
+      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,
+      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),
+      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),
+      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),
+      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),
+      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),
+      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),
+      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),
+      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),
+        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),
+        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),
+        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),
+        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),
+        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),
+        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),
+        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),
+        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),
+        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),
+        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),
+        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),
+        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),
+        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),
+        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),
+        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),
+        static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray50& other);
+
+  const T1 v1_;
+  const T2 v2_;
+  const T3 v3_;
+  const T4 v4_;
+  const T5 v5_;
+  const T6 v6_;
+  const T7 v7_;
+  const T8 v8_;
+  const T9 v9_;
+  const T10 v10_;
+  const T11 v11_;
+  const T12 v12_;
+  const T13 v13_;
+  const T14 v14_;
+  const T15 v15_;
+  const T16 v16_;
+  const T17 v17_;
+  const T18 v18_;
+  const T19 v19_;
+  const T20 v20_;
+  const T21 v21_;
+  const T22 v22_;
+  const T23 v23_;
+  const T24 v24_;
+  const T25 v25_;
+  const T26 v26_;
+  const T27 v27_;
+  const T28 v28_;
+  const T29 v29_;
+  const T30 v30_;
+  const T31 v31_;
+  const T32 v32_;
+  const T33 v33_;
+  const T34 v34_;
+  const T35 v35_;
+  const T36 v36_;
+  const T37 v37_;
+  const T38 v38_;
+  const T39 v39_;
+  const T40 v40_;
+  const T41 v41_;
+  const T42 v42_;
+  const T43 v43_;
+  const T44 v44_;
+  const T45 v45_;
+  const T46 v46_;
+  const T47 v47_;
+  const T48 v48_;
+  const T49 v49_;
+  const T50 v50_;
+};
+
+# if GTEST_HAS_COMBINE
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Generates values from the Cartesian product of values produced
+// by the argument generators.
+//
+template <typename T1, typename T2>
+class CartesianProductGenerator2
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
+ public:
+  typedef ::testing::tuple<T1, T2> ParamType;
+
+  CartesianProductGenerator2(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2)
+      : g1_(g1), g2_(g2) {}
+  virtual ~CartesianProductGenerator2() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current2_;
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator2::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator2& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+};  // class CartesianProductGenerator2
+
+
+template <typename T1, typename T2, typename T3>
+class CartesianProductGenerator3
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3> ParamType;
+
+  CartesianProductGenerator3(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
+      : g1_(g1), g2_(g2), g3_(g3) {}
+  virtual ~CartesianProductGenerator3() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current3_;
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator3::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator3& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+};  // class CartesianProductGenerator3
+
+
+template <typename T1, typename T2, typename T3, typename T4>
+class CartesianProductGenerator4
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
+
+  CartesianProductGenerator4(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
+  virtual ~CartesianProductGenerator4() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current4_;
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator4::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator4& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+};  // class CartesianProductGenerator4
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+class CartesianProductGenerator5
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
+
+  CartesianProductGenerator5(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
+  virtual ~CartesianProductGenerator5() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current5_;
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator5::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator5& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+};  // class CartesianProductGenerator5
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+class CartesianProductGenerator6
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
+        T6> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
+
+  CartesianProductGenerator6(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
+  virtual ~CartesianProductGenerator6() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current6_;
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator6::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator6& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+};  // class CartesianProductGenerator6
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+class CartesianProductGenerator7
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
+
+  CartesianProductGenerator7(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
+  virtual ~CartesianProductGenerator7() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current7_;
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator7::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator7& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+};  // class CartesianProductGenerator7
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+class CartesianProductGenerator8
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7, T8> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
+
+  CartesianProductGenerator8(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
+      const ParamGenerator<T8>& g8)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
+          g8_(g8) {}
+  virtual ~CartesianProductGenerator8() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin(), g8_, g8_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
+        g8_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7,
+      const ParamGenerator<T8>& g8,
+      const typename ParamGenerator<T8>::iterator& current8)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current8_;
+      if (current8_ == end8_) {
+        current8_ = begin8_;
+        ++current7_;
+      }
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_ &&
+          current8_ == typed_other->current8_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_),
+        begin8_(other.begin8_),
+        end8_(other.end8_),
+        current8_(other.current8_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_, *current8_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_ ||
+          current8_ == end8_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    const typename ParamGenerator<T8>::iterator begin8_;
+    const typename ParamGenerator<T8>::iterator end8_;
+    typename ParamGenerator<T8>::iterator current8_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator8::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator8& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+  const ParamGenerator<T8> g8_;
+};  // class CartesianProductGenerator8
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+class CartesianProductGenerator9
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7, T8, T9> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
+
+  CartesianProductGenerator9(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
+      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9) {}
+  virtual ~CartesianProductGenerator9() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
+        g8_.end(), g9_, g9_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7,
+      const ParamGenerator<T8>& g8,
+      const typename ParamGenerator<T8>::iterator& current8,
+      const ParamGenerator<T9>& g9,
+      const typename ParamGenerator<T9>::iterator& current9)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
+          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current9_;
+      if (current9_ == end9_) {
+        current9_ = begin9_;
+        ++current8_;
+      }
+      if (current8_ == end8_) {
+        current8_ = begin8_;
+        ++current7_;
+      }
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_ &&
+          current8_ == typed_other->current8_ &&
+          current9_ == typed_other->current9_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_),
+        begin8_(other.begin8_),
+        end8_(other.end8_),
+        current8_(other.current8_),
+        begin9_(other.begin9_),
+        end9_(other.end9_),
+        current9_(other.current9_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_, *current8_,
+            *current9_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_ ||
+          current8_ == end8_ ||
+          current9_ == end9_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    const typename ParamGenerator<T8>::iterator begin8_;
+    const typename ParamGenerator<T8>::iterator end8_;
+    typename ParamGenerator<T8>::iterator current8_;
+    const typename ParamGenerator<T9>::iterator begin9_;
+    const typename ParamGenerator<T9>::iterator end9_;
+    typename ParamGenerator<T9>::iterator current9_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator9::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator9& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+  const ParamGenerator<T8> g8_;
+  const ParamGenerator<T9> g9_;
+};  // class CartesianProductGenerator9
+
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+class CartesianProductGenerator10
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+        T7, T8, T9, T10> > {
+ public:
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
+
+  CartesianProductGenerator10(const ParamGenerator<T1>& g1,
+      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
+      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,
+      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,
+      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,
+      const ParamGenerator<T10>& g10)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9), g10_(g10) {}
+  virtual ~CartesianProductGenerator10() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,
+        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,
+        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),
+        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,
+        g8_.end(), g9_, g9_.end(), g10_, g10_.end());
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base,
+      const ParamGenerator<T1>& g1,
+      const typename ParamGenerator<T1>::iterator& current1,
+      const ParamGenerator<T2>& g2,
+      const typename ParamGenerator<T2>::iterator& current2,
+      const ParamGenerator<T3>& g3,
+      const typename ParamGenerator<T3>::iterator& current3,
+      const ParamGenerator<T4>& g4,
+      const typename ParamGenerator<T4>::iterator& current4,
+      const ParamGenerator<T5>& g5,
+      const typename ParamGenerator<T5>::iterator& current5,
+      const ParamGenerator<T6>& g6,
+      const typename ParamGenerator<T6>::iterator& current6,
+      const ParamGenerator<T7>& g7,
+      const typename ParamGenerator<T7>::iterator& current7,
+      const ParamGenerator<T8>& g8,
+      const typename ParamGenerator<T8>::iterator& current8,
+      const ParamGenerator<T9>& g9,
+      const typename ParamGenerator<T9>::iterator& current9,
+      const ParamGenerator<T10>& g10,
+      const typename ParamGenerator<T10>::iterator& current10)
+        : base_(base),
+          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),
+          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),
+          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),
+          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),
+          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),
+          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),
+          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),
+          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),
+          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),
+          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current10_;
+      if (current10_ == end10_) {
+        current10_ = begin10_;
+        ++current9_;
+      }
+      if (current9_ == end9_) {
+        current9_ = begin9_;
+        ++current8_;
+      }
+      if (current8_ == end8_) {
+        current8_ = begin8_;
+        ++current7_;
+      }
+      if (current7_ == end7_) {
+        current7_ = begin7_;
+        ++current6_;
+      }
+      if (current6_ == end6_) {
+        current6_ = begin6_;
+        ++current5_;
+      }
+      if (current5_ == end5_) {
+        current5_ = begin5_;
+        ++current4_;
+      }
+      if (current4_ == end4_) {
+        current4_ = begin4_;
+        ++current3_;
+      }
+      if (current3_ == end3_) {
+        current3_ = begin3_;
+        ++current2_;
+      }
+      if (current2_ == end2_) {
+        current2_ = begin2_;
+        ++current1_;
+      }
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         (
+          current1_ == typed_other->current1_ &&
+          current2_ == typed_other->current2_ &&
+          current3_ == typed_other->current3_ &&
+          current4_ == typed_other->current4_ &&
+          current5_ == typed_other->current5_ &&
+          current6_ == typed_other->current6_ &&
+          current7_ == typed_other->current7_ &&
+          current8_ == typed_other->current8_ &&
+          current9_ == typed_other->current9_ &&
+          current10_ == typed_other->current10_);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_),
+        begin1_(other.begin1_),
+        end1_(other.end1_),
+        current1_(other.current1_),
+        begin2_(other.begin2_),
+        end2_(other.end2_),
+        current2_(other.current2_),
+        begin3_(other.begin3_),
+        end3_(other.end3_),
+        current3_(other.current3_),
+        begin4_(other.begin4_),
+        end4_(other.end4_),
+        current4_(other.current4_),
+        begin5_(other.begin5_),
+        end5_(other.end5_),
+        current5_(other.current5_),
+        begin6_(other.begin6_),
+        end6_(other.end6_),
+        current6_(other.current6_),
+        begin7_(other.begin7_),
+        end7_(other.end7_),
+        current7_(other.current7_),
+        begin8_(other.begin8_),
+        end8_(other.end8_),
+        current8_(other.current8_),
+        begin9_(other.begin9_),
+        end9_(other.end9_),
+        current9_(other.current9_),
+        begin10_(other.begin10_),
+        end10_(other.end10_),
+        current10_(other.current10_) {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType(*current1_, *current2_, *current3_,
+            *current4_, *current5_, *current6_, *current7_, *current8_,
+            *current9_, *current10_);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+          current1_ == end1_ ||
+          current2_ == end2_ ||
+          current3_ == end3_ ||
+          current4_ == end4_ ||
+          current5_ == end5_ ||
+          current6_ == end6_ ||
+          current7_ == end7_ ||
+          current8_ == end8_ ||
+          current9_ == end9_ ||
+          current10_ == end10_;
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+    const typename ParamGenerator<T1>::iterator begin1_;
+    const typename ParamGenerator<T1>::iterator end1_;
+    typename ParamGenerator<T1>::iterator current1_;
+    const typename ParamGenerator<T2>::iterator begin2_;
+    const typename ParamGenerator<T2>::iterator end2_;
+    typename ParamGenerator<T2>::iterator current2_;
+    const typename ParamGenerator<T3>::iterator begin3_;
+    const typename ParamGenerator<T3>::iterator end3_;
+    typename ParamGenerator<T3>::iterator current3_;
+    const typename ParamGenerator<T4>::iterator begin4_;
+    const typename ParamGenerator<T4>::iterator end4_;
+    typename ParamGenerator<T4>::iterator current4_;
+    const typename ParamGenerator<T5>::iterator begin5_;
+    const typename ParamGenerator<T5>::iterator end5_;
+    typename ParamGenerator<T5>::iterator current5_;
+    const typename ParamGenerator<T6>::iterator begin6_;
+    const typename ParamGenerator<T6>::iterator end6_;
+    typename ParamGenerator<T6>::iterator current6_;
+    const typename ParamGenerator<T7>::iterator begin7_;
+    const typename ParamGenerator<T7>::iterator end7_;
+    typename ParamGenerator<T7>::iterator current7_;
+    const typename ParamGenerator<T8>::iterator begin8_;
+    const typename ParamGenerator<T8>::iterator end8_;
+    typename ParamGenerator<T8>::iterator current8_;
+    const typename ParamGenerator<T9>::iterator begin9_;
+    const typename ParamGenerator<T9>::iterator end9_;
+    typename ParamGenerator<T9>::iterator current9_;
+    const typename ParamGenerator<T10>::iterator begin10_;
+    const typename ParamGenerator<T10>::iterator end10_;
+    typename ParamGenerator<T10>::iterator current10_;
+    ParamType current_value_;
+  };  // class CartesianProductGenerator10::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator10& other);
+
+  const ParamGenerator<T1> g1_;
+  const ParamGenerator<T2> g2_;
+  const ParamGenerator<T3> g3_;
+  const ParamGenerator<T4> g4_;
+  const ParamGenerator<T5> g5_;
+  const ParamGenerator<T6> g6_;
+  const ParamGenerator<T7> g7_;
+  const ParamGenerator<T8> g8_;
+  const ParamGenerator<T9> g9_;
+  const ParamGenerator<T10> g10_;
+};  // class CartesianProductGenerator10
+
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Helper classes providing Combine() with polymorphic features. They allow
+// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
+// convertible to U.
+//
+template <class Generator1, class Generator2>
+class CartesianProductHolder2 {
+ public:
+CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
+      : g1_(g1), g2_(g2) {}
+  template <typename T1, typename T2>
+  operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2> >(
+        new CartesianProductGenerator2<T1, T2>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder2& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+};  // class CartesianProductHolder2
+
+template <class Generator1, class Generator2, class Generator3>
+class CartesianProductHolder3 {
+ public:
+CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3)
+      : g1_(g1), g2_(g2), g3_(g3) {}
+  template <typename T1, typename T2, typename T3>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
+        new CartesianProductGenerator3<T1, T2, T3>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder3& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+};  // class CartesianProductHolder3
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4>
+class CartesianProductHolder4 {
+ public:
+CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
+  template <typename T1, typename T2, typename T3, typename T4>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
+        new CartesianProductGenerator4<T1, T2, T3, T4>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder4& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+};  // class CartesianProductHolder4
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5>
+class CartesianProductHolder5 {
+ public:
+CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
+        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder5& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+};  // class CartesianProductHolder5
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6>
+class CartesianProductHolder6 {
+ public:
+CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
+        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder6& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+};  // class CartesianProductHolder6
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7>
+class CartesianProductHolder7 {
+ public:
+CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
+      T7> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
+        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder7& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+};  // class CartesianProductHolder7
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7,
+    class Generator8>
+class CartesianProductHolder8 {
+ public:
+CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7, const Generator8& g8)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),
+          g8_(g8) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7, typename T8>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
+      T8> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
+        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_),
+        static_cast<ParamGenerator<T8> >(g8_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder8& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+  const Generator8 g8_;
+};  // class CartesianProductHolder8
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7,
+    class Generator8, class Generator9>
+class CartesianProductHolder9 {
+ public:
+CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7, const Generator8& g8,
+    const Generator9& g9)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7, typename T8, typename T9>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+      T9> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+        T9> >(
+        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_),
+        static_cast<ParamGenerator<T8> >(g8_),
+        static_cast<ParamGenerator<T9> >(g9_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder9& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+  const Generator8 g8_;
+  const Generator9 g9_;
+};  // class CartesianProductHolder9
+
+template <class Generator1, class Generator2, class Generator3,
+    class Generator4, class Generator5, class Generator6, class Generator7,
+    class Generator8, class Generator9, class Generator10>
+class CartesianProductHolder10 {
+ public:
+CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
+    const Generator3& g3, const Generator4& g4, const Generator5& g5,
+    const Generator6& g6, const Generator7& g7, const Generator8& g8,
+    const Generator9& g9, const Generator10& g10)
+      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),
+          g9_(g9), g10_(g10) {}
+  template <typename T1, typename T2, typename T3, typename T4, typename T5,
+      typename T6, typename T7, typename T8, typename T9, typename T10>
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+      T10> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+        T10> >(
+        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+            T10>(
+        static_cast<ParamGenerator<T1> >(g1_),
+        static_cast<ParamGenerator<T2> >(g2_),
+        static_cast<ParamGenerator<T3> >(g3_),
+        static_cast<ParamGenerator<T4> >(g4_),
+        static_cast<ParamGenerator<T5> >(g5_),
+        static_cast<ParamGenerator<T6> >(g6_),
+        static_cast<ParamGenerator<T7> >(g7_),
+        static_cast<ParamGenerator<T8> >(g8_),
+        static_cast<ParamGenerator<T9> >(g9_),
+        static_cast<ParamGenerator<T10> >(g10_)));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder10& other);
+
+  const Generator1 g1_;
+  const Generator2 g2_;
+  const Generator3 g3_;
+  const Generator4 g4_;
+  const Generator5 g5_;
+  const Generator6 g6_;
+  const Generator7 g7_;
+  const Generator8 g8_;
+  const Generator9 g9_;
+  const Generator10 g10_;
+};  // class CartesianProductHolder10
+
+# endif  // GTEST_HAS_COMBINE
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  //  GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
new file mode 100644
index 0000000..5c7c47a
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util-generated.h.pump
@@ -0,0 +1,286 @@
+$$ -*- mode: c++; -*-
+$var n = 50  $$ Maximum length of Values arguments we want to support.
+$var maxtuple = 10  $$ Maximum number of Combine arguments we want to support.
+// 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: vladl@google.com (Vlad Losev)
+
+// Type and function utilities for implementing parameterized tests.
+// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently Google Test supports at most $n arguments in Values,
+// and at most $maxtuple arguments in Combine. Please contact
+// googletestframework@googlegroups.com if you need more.
+// Please note that the number of arguments to Combine is limited
+// by the maximum arity of the implementation of tuple which is
+// currently set at $maxtuple.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-param-util.h"
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Forward declarations of ValuesIn(), which is implemented in
+// include/gtest/gtest-param-test.h.
+template <typename ForwardIterator>
+internal::ParamGenerator<
+  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
+ValuesIn(ForwardIterator begin, ForwardIterator end);
+
+template <typename T, size_t N>
+internal::ParamGenerator<T> ValuesIn(const T (&array)[N]);
+
+template <class Container>
+internal::ParamGenerator<typename Container::value_type> ValuesIn(
+    const Container& container);
+
+namespace internal {
+
+// Used in the Values() function to provide polymorphic capabilities.
+$range i 1..n
+$for i [[
+$range j 1..i
+
+template <$for j, [[typename T$j]]>
+class ValueArray$i {
+ public:
+  $if i==1 [[explicit ]]ValueArray$i($for j, [[T$j v$j]]) : $for j, [[v$(j)_(v$j)]] {}
+
+  template <typename T>
+  operator ParamGenerator<T>() const {
+    const T array[] = {$for j, [[static_cast<T>(v$(j)_)]]};
+    return ValuesIn(array);
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const ValueArray$i& other);
+
+$for j [[
+
+  const T$j v$(j)_;
+]]
+
+};
+
+]]
+
+# if GTEST_HAS_COMBINE
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Generates values from the Cartesian product of values produced
+// by the argument generators.
+//
+$range i 2..maxtuple
+$for i [[
+$range j 1..i
+$range k 2..i
+
+template <$for j, [[typename T$j]]>
+class CartesianProductGenerator$i
+    : public ParamGeneratorInterface< ::testing::tuple<$for j, [[T$j]]> > {
+ public:
+  typedef ::testing::tuple<$for j, [[T$j]]> ParamType;
+
+  CartesianProductGenerator$i($for j, [[const ParamGenerator<T$j>& g$j]])
+      : $for j, [[g$(j)_(g$j)]] {}
+  virtual ~CartesianProductGenerator$i() {}
+
+  virtual ParamIteratorInterface<ParamType>* Begin() const {
+    return new Iterator(this, $for j, [[g$(j)_, g$(j)_.begin()]]);
+  }
+  virtual ParamIteratorInterface<ParamType>* End() const {
+    return new Iterator(this, $for j, [[g$(j)_, g$(j)_.end()]]);
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<ParamType> {
+   public:
+    Iterator(const ParamGeneratorInterface<ParamType>* base, $for j, [[
+
+      const ParamGenerator<T$j>& g$j,
+      const typename ParamGenerator<T$j>::iterator& current$(j)]])
+        : base_(base),
+$for j, [[
+
+          begin$(j)_(g$j.begin()), end$(j)_(g$j.end()), current$(j)_(current$j)
+]]    {
+      ComputeCurrentValue();
+    }
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {
+      return base_;
+    }
+    // Advance should not be called on beyond-of-range iterators
+    // so no component iterators must be beyond end of range, either.
+    virtual void Advance() {
+      assert(!AtEnd());
+      ++current$(i)_;
+
+$for k [[
+      if (current$(i+2-k)_ == end$(i+2-k)_) {
+        current$(i+2-k)_ = begin$(i+2-k)_;
+        ++current$(i+2-k-1)_;
+      }
+
+]]
+      ComputeCurrentValue();
+    }
+    virtual ParamIteratorInterface<ParamType>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const ParamType* Current() const { return &current_value_; }
+    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const Iterator* typed_other =
+          CheckedDowncastToActualType<const Iterator>(&other);
+      // We must report iterators equal if they both point beyond their
+      // respective ranges. That can happen in a variety of fashions,
+      // so we have to consult AtEnd().
+      return (AtEnd() && typed_other->AtEnd()) ||
+         ($for j  && [[
+
+          current$(j)_ == typed_other->current$(j)_
+]]);
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : base_(other.base_), $for j, [[
+
+        begin$(j)_(other.begin$(j)_),
+        end$(j)_(other.end$(j)_),
+        current$(j)_(other.current$(j)_)
+]] {
+      ComputeCurrentValue();
+    }
+
+    void ComputeCurrentValue() {
+      if (!AtEnd())
+        current_value_ = ParamType($for j, [[*current$(j)_]]);
+    }
+    bool AtEnd() const {
+      // We must report iterator past the end of the range when either of the
+      // component iterators has reached the end of its range.
+      return
+$for j  || [[
+
+          current$(j)_ == end$(j)_
+]];
+    }
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<ParamType>* const base_;
+    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.
+    // current[i]_ is the actual traversing iterator.
+$for j [[
+
+    const typename ParamGenerator<T$j>::iterator begin$(j)_;
+    const typename ParamGenerator<T$j>::iterator end$(j)_;
+    typename ParamGenerator<T$j>::iterator current$(j)_;
+]]
+
+    ParamType current_value_;
+  };  // class CartesianProductGenerator$i::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductGenerator$i& other);
+
+
+$for j [[
+  const ParamGenerator<T$j> g$(j)_;
+
+]]
+};  // class CartesianProductGenerator$i
+
+
+]]
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Helper classes providing Combine() with polymorphic features. They allow
+// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is
+// convertible to U.
+//
+$range i 2..maxtuple
+$for i [[
+$range j 1..i
+
+template <$for j, [[class Generator$j]]>
+class CartesianProductHolder$i {
+ public:
+CartesianProductHolder$i($for j, [[const Generator$j& g$j]])
+      : $for j, [[g$(j)_(g$j)]] {}
+  template <$for j, [[typename T$j]]>
+  operator ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >() const {
+    return ParamGenerator< ::testing::tuple<$for j, [[T$j]]> >(
+        new CartesianProductGenerator$i<$for j, [[T$j]]>(
+$for j,[[
+
+        static_cast<ParamGenerator<T$j> >(g$(j)_)
+]]));
+  }
+
+ private:
+  // No implementation - assignment is unsupported.
+  void operator=(const CartesianProductHolder$i& other);
+
+
+$for j [[
+  const Generator$j g$(j)_;
+
+]]
+};  // class CartesianProductHolder$i
+
+]]
+
+# endif  // GTEST_HAS_COMBINE
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  //  GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h
new file mode 100644
index 0000000..82cab9b
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-param-util.h
@@ -0,0 +1,731 @@
+// 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: vladl@google.com (Vlad Losev)
+
+// Type and function utilities for implementing parameterized tests.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
+
+#include <ctype.h>
+
+#include <iterator>
+#include <set>
+#include <utility>
+#include <vector>
+
+// scripts/fuse_gtest.py depends on gtest's own header being #included
+// *unconditionally*.  Therefore these #includes cannot be moved
+// inside #if GTEST_HAS_PARAM_TEST.
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-linked_ptr.h"
+#include "gtest/internal/gtest-port.h"
+#include "gtest/gtest-printers.h"
+
+#if GTEST_HAS_PARAM_TEST
+
+namespace testing {
+
+// Input to a parameterized test name generator, describing a test parameter.
+// Consists of the parameter value and the integer parameter index.
+template <class ParamType>
+struct TestParamInfo {
+  TestParamInfo(const ParamType& a_param, size_t an_index) :
+    param(a_param),
+    index(an_index) {}
+  ParamType param;
+  size_t index;
+};
+
+// A builtin parameterized test name generator which returns the result of
+// testing::PrintToString.
+struct PrintToStringParamName {
+  template <class ParamType>
+  std::string operator()(const TestParamInfo<ParamType>& info) const {
+    return PrintToString(info.param);
+  }
+};
+
+namespace internal {
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Outputs a message explaining invalid registration of different
+// fixture class for the same test case. This may happen when
+// TEST_P macro is used to define two tests with the same name
+// but in different namespaces.
+GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
+                                          CodeLocation code_location);
+
+template <typename> class ParamGeneratorInterface;
+template <typename> class ParamGenerator;
+
+// Interface for iterating over elements provided by an implementation
+// of ParamGeneratorInterface<T>.
+template <typename T>
+class ParamIteratorInterface {
+ public:
+  virtual ~ParamIteratorInterface() {}
+  // A pointer to the base generator instance.
+  // Used only for the purposes of iterator comparison
+  // to make sure that two iterators belong to the same generator.
+  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
+  // Advances iterator to point to the next element
+  // provided by the generator. The caller is responsible
+  // for not calling Advance() on an iterator equal to
+  // BaseGenerator()->End().
+  virtual void Advance() = 0;
+  // Clones the iterator object. Used for implementing copy semantics
+  // of ParamIterator<T>.
+  virtual ParamIteratorInterface* Clone() const = 0;
+  // Dereferences the current iterator and provides (read-only) access
+  // to the pointed value. It is the caller's responsibility not to call
+  // Current() on an iterator equal to BaseGenerator()->End().
+  // Used for implementing ParamGenerator<T>::operator*().
+  virtual const T* Current() const = 0;
+  // Determines whether the given iterator and other point to the same
+  // element in the sequence generated by the generator.
+  // Used for implementing ParamGenerator<T>::operator==().
+  virtual bool Equals(const ParamIteratorInterface& other) const = 0;
+};
+
+// Class iterating over elements provided by an implementation of
+// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
+// and implements the const forward iterator concept.
+template <typename T>
+class ParamIterator {
+ public:
+  typedef T value_type;
+  typedef const T& reference;
+  typedef ptrdiff_t difference_type;
+
+  // ParamIterator assumes ownership of the impl_ pointer.
+  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
+  ParamIterator& operator=(const ParamIterator& other) {
+    if (this != &other)
+      impl_.reset(other.impl_->Clone());
+    return *this;
+  }
+
+  const T& operator*() const { return *impl_->Current(); }
+  const T* operator->() const { return impl_->Current(); }
+  // Prefix version of operator++.
+  ParamIterator& operator++() {
+    impl_->Advance();
+    return *this;
+  }
+  // Postfix version of operator++.
+  ParamIterator operator++(int /*unused*/) {
+    ParamIteratorInterface<T>* clone = impl_->Clone();
+    impl_->Advance();
+    return ParamIterator(clone);
+  }
+  bool operator==(const ParamIterator& other) const {
+    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
+  }
+  bool operator!=(const ParamIterator& other) const {
+    return !(*this == other);
+  }
+
+ private:
+  friend class ParamGenerator<T>;
+  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
+  scoped_ptr<ParamIteratorInterface<T> > impl_;
+};
+
+// ParamGeneratorInterface<T> is the binary interface to access generators
+// defined in other translation units.
+template <typename T>
+class ParamGeneratorInterface {
+ public:
+  typedef T ParamType;
+
+  virtual ~ParamGeneratorInterface() {}
+
+  // Generator interface definition
+  virtual ParamIteratorInterface<T>* Begin() const = 0;
+  virtual ParamIteratorInterface<T>* End() const = 0;
+};
+
+// Wraps ParamGeneratorInterface<T> and provides general generator syntax
+// compatible with the STL Container concept.
+// This class implements copy initialization semantics and the contained
+// ParamGeneratorInterface<T> instance is shared among all copies
+// of the original object. This is possible because that instance is immutable.
+template<typename T>
+class ParamGenerator {
+ public:
+  typedef ParamIterator<T> iterator;
+
+  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
+  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
+
+  ParamGenerator& operator=(const ParamGenerator& other) {
+    impl_ = other.impl_;
+    return *this;
+  }
+
+  iterator begin() const { return iterator(impl_->Begin()); }
+  iterator end() const { return iterator(impl_->End()); }
+
+ private:
+  linked_ptr<const ParamGeneratorInterface<T> > impl_;
+};
+
+// Generates values from a range of two comparable values. Can be used to
+// generate sequences of user-defined types that implement operator+() and
+// operator<().
+// This class is used in the Range() function.
+template <typename T, typename IncrementT>
+class RangeGenerator : public ParamGeneratorInterface<T> {
+ public:
+  RangeGenerator(T begin, T end, IncrementT step)
+      : begin_(begin), end_(end),
+        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
+  virtual ~RangeGenerator() {}
+
+  virtual ParamIteratorInterface<T>* Begin() const {
+    return new Iterator(this, begin_, 0, step_);
+  }
+  virtual ParamIteratorInterface<T>* End() const {
+    return new Iterator(this, end_, end_index_, step_);
+  }
+
+ private:
+  class Iterator : public ParamIteratorInterface<T> {
+   public:
+    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
+             IncrementT step)
+        : base_(base), value_(value), index_(index), step_(step) {}
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
+      return base_;
+    }
+    virtual void Advance() {
+      value_ = static_cast<T>(value_ + step_);
+      index_++;
+    }
+    virtual ParamIteratorInterface<T>* Clone() const {
+      return new Iterator(*this);
+    }
+    virtual const T* Current() const { return &value_; }
+    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      const int other_index =
+          CheckedDowncastToActualType<const Iterator>(&other)->index_;
+      return index_ == other_index;
+    }
+
+   private:
+    Iterator(const Iterator& other)
+        : ParamIteratorInterface<T>(),
+          base_(other.base_), value_(other.value_), index_(other.index_),
+          step_(other.step_) {}
+
+    // No implementation - assignment is unsupported.
+    void operator=(const Iterator& other);
+
+    const ParamGeneratorInterface<T>* const base_;
+    T value_;
+    int index_;
+    const IncrementT step_;
+  };  // class RangeGenerator::Iterator
+
+  static int CalculateEndIndex(const T& begin,
+                               const T& end,
+                               const IncrementT& step) {
+    int end_index = 0;
+    for (T i = begin; i < end; i = static_cast<T>(i + step))
+      end_index++;
+    return end_index;
+  }
+
+  // No implementation - assignment is unsupported.
+  void operator=(const RangeGenerator& other);
+
+  const T begin_;
+  const T end_;
+  const IncrementT step_;
+  // The index for the end() iterator. All the elements in the generated
+  // sequence are indexed (0-based) to aid iterator comparison.
+  const int end_index_;
+};  // class RangeGenerator
+
+
+// Generates values from a pair of STL-style iterators. Used in the
+// ValuesIn() function. The elements are copied from the source range
+// since the source can be located on the stack, and the generator
+// is likely to persist beyond that stack frame.
+template <typename T>
+class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
+ public:
+  template <typename ForwardIterator>
+  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
+      : container_(begin, end) {}
+  virtual ~ValuesInIteratorRangeGenerator() {}
+
+  virtual ParamIteratorInterface<T>* Begin() const {
+    return new Iterator(this, container_.begin());
+  }
+  virtual ParamIteratorInterface<T>* End() const {
+    return new Iterator(this, container_.end());
+  }
+
+ private:
+  typedef typename ::std::vector<T> ContainerType;
+
+  class Iterator : public ParamIteratorInterface<T> {
+   public:
+    Iterator(const ParamGeneratorInterface<T>* base,
+             typename ContainerType::const_iterator iterator)
+        : base_(base), iterator_(iterator) {}
+    virtual ~Iterator() {}
+
+    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {
+      return base_;
+    }
+    virtual void Advance() {
+      ++iterator_;
+      value_.reset();
+    }
+    virtual ParamIteratorInterface<T>* Clone() const {
+      return new Iterator(*this);
+    }
+    // We need to use cached value referenced by iterator_ because *iterator_
+    // can return a temporary object (and of type other then T), so just
+    // having "return &*iterator_;" doesn't work.
+    // value_ is updated here and not in Advance() because Advance()
+    // can advance iterator_ beyond the end of the range, and we cannot
+    // detect that fact. The client code, on the other hand, is
+    // responsible for not calling Current() on an out-of-range iterator.
+    virtual const T* Current() const {
+      if (value_.get() == NULL)
+        value_.reset(new T(*iterator_));
+      return value_.get();
+    }
+    virtual bool Equals(const ParamIteratorInterface<T>& other) const {
+      // Having the same base generator guarantees that the other
+      // iterator is of the same type and we can downcast.
+      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
+          << "The program attempted to compare iterators "
+          << "from different generators." << std::endl;
+      return iterator_ ==
+          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
+    }
+
+   private:
+    Iterator(const Iterator& other)
+          // The explicit constructor call suppresses a false warning
+          // emitted by gcc when supplied with the -Wextra option.
+        : ParamIteratorInterface<T>(),
+          base_(other.base_),
+          iterator_(other.iterator_) {}
+
+    const ParamGeneratorInterface<T>* const base_;
+    typename ContainerType::const_iterator iterator_;
+    // A cached value of *iterator_. We keep it here to allow access by
+    // pointer in the wrapping iterator's operator->().
+    // value_ needs to be mutable to be accessed in Current().
+    // Use of scoped_ptr helps manage cached value's lifetime,
+    // which is bound by the lifespan of the iterator itself.
+    mutable scoped_ptr<const T> value_;
+  };  // class ValuesInIteratorRangeGenerator::Iterator
+
+  // No implementation - assignment is unsupported.
+  void operator=(const ValuesInIteratorRangeGenerator& other);
+
+  const ContainerType container_;
+};  // class ValuesInIteratorRangeGenerator
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Default parameterized test name generator, returns a string containing the
+// integer test parameter index.
+template <class ParamType>
+std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
+  Message name_stream;
+  name_stream << info.index;
+  return name_stream.GetString();
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Parameterized test name overload helpers, which help the
+// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
+// test name generator and user param name generator.
+template <class ParamType, class ParamNameGenFunctor>
+ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
+  return func;
+}
+
+template <class ParamType>
+struct ParamNameGenFunc {
+  typedef std::string Type(const TestParamInfo<ParamType>&);
+};
+
+template <class ParamType>
+typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
+  return DefaultParamName;
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Stores a parameter value and later creates tests parameterized with that
+// value.
+template <class TestClass>
+class ParameterizedTestFactory : public TestFactoryBase {
+ public:
+  typedef typename TestClass::ParamType ParamType;
+  explicit ParameterizedTestFactory(ParamType parameter) :
+      parameter_(parameter) {}
+  virtual Test* CreateTest() {
+    TestClass::SetParam(&parameter_);
+    return new TestClass();
+  }
+
+ private:
+  const ParamType parameter_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// TestMetaFactoryBase is a base class for meta-factories that create
+// test factories for passing into MakeAndRegisterTestInfo function.
+template <class ParamType>
+class TestMetaFactoryBase {
+ public:
+  virtual ~TestMetaFactoryBase() {}
+
+  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// TestMetaFactory creates test factories for passing into
+// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
+// ownership of test factory pointer, same factory object cannot be passed
+// into that method twice. But ParameterizedTestCaseInfo is going to call
+// it for each Test/Parameter value combination. Thus it needs meta factory
+// creator class.
+template <class TestCase>
+class TestMetaFactory
+    : public TestMetaFactoryBase<typename TestCase::ParamType> {
+ public:
+  typedef typename TestCase::ParamType ParamType;
+
+  TestMetaFactory() {}
+
+  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {
+    return new ParameterizedTestFactory<TestCase>(parameter);
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// ParameterizedTestCaseInfoBase is a generic interface
+// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase
+// accumulates test information provided by TEST_P macro invocations
+// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations
+// and uses that information to register all resulting test instances
+// in RegisterTests method. The ParameterizeTestCaseRegistry class holds
+// a collection of pointers to the ParameterizedTestCaseInfo objects
+// and calls RegisterTests() on each of them when asked.
+class ParameterizedTestCaseInfoBase {
+ public:
+  virtual ~ParameterizedTestCaseInfoBase() {}
+
+  // Base part of test case name for display purposes.
+  virtual const string& GetTestCaseName() const = 0;
+  // Test case id to verify identity.
+  virtual TypeId GetTestCaseTypeId() const = 0;
+  // UnitTest class invokes this method to register tests in this
+  // test case right before running them in RUN_ALL_TESTS macro.
+  // This method should not be called more then once on any single
+  // instance of a ParameterizedTestCaseInfoBase derived class.
+  virtual void RegisterTests() = 0;
+
+ protected:
+  ParameterizedTestCaseInfoBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);
+};
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P
+// macro invocations for a particular test case and generators
+// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that
+// test case. It registers tests with all values generated by all
+// generators when asked.
+template <class TestCase>
+class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
+ public:
+  // ParamType and GeneratorCreationFunc are private types but are required
+  // for declarations of public methods AddTestPattern() and
+  // AddTestCaseInstantiation().
+  typedef typename TestCase::ParamType ParamType;
+  // A function that returns an instance of appropriate generator type.
+  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
+  typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
+
+  explicit ParameterizedTestCaseInfo(
+      const char* name, CodeLocation code_location)
+      : test_case_name_(name), code_location_(code_location) {}
+
+  // Test case base name for display purposes.
+  virtual const string& GetTestCaseName() const { return test_case_name_; }
+  // Test case id to verify identity.
+  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }
+  // TEST_P macro uses AddTestPattern() to record information
+  // about a single test in a LocalTestInfo structure.
+  // test_case_name is the base name of the test case (without invocation
+  // prefix). test_base_name is the name of an individual test without
+  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
+  // test case base name and DoBar is test base name.
+  void AddTestPattern(const char* test_case_name,
+                      const char* test_base_name,
+                      TestMetaFactoryBase<ParamType>* meta_factory) {
+    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,
+                                                       test_base_name,
+                                                       meta_factory)));
+  }
+  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information
+  // about a generator.
+  int AddTestCaseInstantiation(const string& instantiation_name,
+                               GeneratorCreationFunc* func,
+                               ParamNameGeneratorFunc* name_func,
+                               const char* file,
+                               int line) {
+    instantiations_.push_back(
+        InstantiationInfo(instantiation_name, func, name_func, file, line));
+    return 0;  // Return value used only to run this method in namespace scope.
+  }
+  // UnitTest class invokes this method to register tests in this test case
+  // test cases right before running tests in RUN_ALL_TESTS macro.
+  // This method should not be called more then once on any single
+  // instance of a ParameterizedTestCaseInfoBase derived class.
+  // UnitTest has a guard to prevent from calling this method more then once.
+  virtual void RegisterTests() {
+    for (typename TestInfoContainer::iterator test_it = tests_.begin();
+         test_it != tests_.end(); ++test_it) {
+      linked_ptr<TestInfo> test_info = *test_it;
+      for (typename InstantiationContainer::iterator gen_it =
+               instantiations_.begin(); gen_it != instantiations_.end();
+               ++gen_it) {
+        const string& instantiation_name = gen_it->name;
+        ParamGenerator<ParamType> generator((*gen_it->generator)());
+        ParamNameGeneratorFunc* name_func = gen_it->name_func;
+        const char* file = gen_it->file;
+        int line = gen_it->line;
+
+        string test_case_name;
+        if ( !instantiation_name.empty() )
+          test_case_name = instantiation_name + "/";
+        test_case_name += test_info->test_case_base_name;
+
+        size_t i = 0;
+        std::set<std::string> test_param_names;
+        for (typename ParamGenerator<ParamType>::iterator param_it =
+                 generator.begin();
+             param_it != generator.end(); ++param_it, ++i) {
+          Message test_name_stream;
+
+          std::string param_name = name_func(
+              TestParamInfo<ParamType>(*param_it, i));
+
+          GTEST_CHECK_(IsValidParamName(param_name))
+              << "Parameterized test name '" << param_name
+              << "' is invalid, in " << file
+              << " line " << line << std::endl;
+
+          GTEST_CHECK_(test_param_names.count(param_name) == 0)
+              << "Duplicate parameterized test name '" << param_name
+              << "', in " << file << " line " << line << std::endl;
+
+          test_param_names.insert(param_name);
+
+          test_name_stream << test_info->test_base_name << "/" << param_name;
+          MakeAndRegisterTestInfo(
+              test_case_name.c_str(),
+              test_name_stream.GetString().c_str(),
+              NULL,  // No type parameter.
+              PrintToString(*param_it).c_str(),
+              code_location_,
+              GetTestCaseTypeId(),
+              TestCase::SetUpTestCase,
+              TestCase::TearDownTestCase,
+              test_info->test_meta_factory->CreateTestFactory(*param_it));
+        }  // for param_it
+      }  // for gen_it
+    }  // for test_it
+  }  // RegisterTests
+
+ private:
+  // LocalTestInfo structure keeps information about a single test registered
+  // with TEST_P macro.
+  struct TestInfo {
+    TestInfo(const char* a_test_case_base_name,
+             const char* a_test_base_name,
+             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :
+        test_case_base_name(a_test_case_base_name),
+        test_base_name(a_test_base_name),
+        test_meta_factory(a_test_meta_factory) {}
+
+    const string test_case_base_name;
+    const string test_base_name;
+    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
+  };
+  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
+  // Records data received from INSTANTIATE_TEST_CASE_P macros:
+  //  <Instantiation name, Sequence generator creation function,
+  //     Name generator function, Source file, Source line>
+  struct InstantiationInfo {
+      InstantiationInfo(const std::string &name_in,
+                        GeneratorCreationFunc* generator_in,
+                        ParamNameGeneratorFunc* name_func_in,
+                        const char* file_in,
+                        int line_in)
+          : name(name_in),
+            generator(generator_in),
+            name_func(name_func_in),
+            file(file_in),
+            line(line_in) {}
+
+      std::string name;
+      GeneratorCreationFunc* generator;
+      ParamNameGeneratorFunc* name_func;
+      const char* file;
+      int line;
+  };
+  typedef ::std::vector<InstantiationInfo> InstantiationContainer;
+
+  static bool IsValidParamName(const std::string& name) {
+    // Check for empty string
+    if (name.empty())
+      return false;
+
+    // Check for invalid characters
+    for (std::string::size_type index = 0; index < name.size(); ++index) {
+      if (!isalnum(name[index]) && name[index] != '_')
+        return false;
+    }
+
+    return true;
+  }
+
+  const string test_case_name_;
+  CodeLocation code_location_;
+  TestInfoContainer tests_;
+  InstantiationContainer instantiations_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);
+};  // class ParameterizedTestCaseInfo
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase
+// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P
+// macros use it to locate their corresponding ParameterizedTestCaseInfo
+// descriptors.
+class ParameterizedTestCaseRegistry {
+ public:
+  ParameterizedTestCaseRegistry() {}
+  ~ParameterizedTestCaseRegistry() {
+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
+         it != test_case_infos_.end(); ++it) {
+      delete *it;
+    }
+  }
+
+  // Looks up or creates and returns a structure containing information about
+  // tests and instantiations of a particular test case.
+  template <class TestCase>
+  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
+      const char* test_case_name,
+      CodeLocation code_location) {
+    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
+         it != test_case_infos_.end(); ++it) {
+      if ((*it)->GetTestCaseName() == test_case_name) {
+        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {
+          // Complain about incorrect usage of Google Test facilities
+          // and terminate the program since we cannot guaranty correct
+          // test case setup and tear-down in this case.
+          ReportInvalidTestCaseType(test_case_name, code_location);
+          posix::Abort();
+        } else {
+          // At this point we are sure that the object we found is of the same
+          // type we are looking for, so we downcast it to that type
+          // without further checks.
+          typed_test_info = CheckedDowncastToActualType<
+              ParameterizedTestCaseInfo<TestCase> >(*it);
+        }
+        break;
+      }
+    }
+    if (typed_test_info == NULL) {
+      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
+          test_case_name, code_location);
+      test_case_infos_.push_back(typed_test_info);
+    }
+    return typed_test_info;
+  }
+  void RegisterTests() {
+    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
+         it != test_case_infos_.end(); ++it) {
+      (*it)->RegisterTests();
+    }
+  }
+
+ private:
+  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;
+
+  TestCaseInfoContainer test_case_infos_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);
+};
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  //  GTEST_HAS_PARAM_TEST
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-port-arch.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-port-arch.h
new file mode 100644
index 0000000..74ab949
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-port-arch.h
@@ -0,0 +1,93 @@
+// Copyright 2015, 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.
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the GTEST_OS_* macro.
+// It is separate from gtest-port.h so that custom/gtest-port.h can include it.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+
+// Determines the platform on which Google Test is compiled.
+#ifdef __CYGWIN__
+# define GTEST_OS_CYGWIN 1
+#elif defined __SYMBIAN32__
+# define GTEST_OS_SYMBIAN 1
+#elif defined _WIN32
+# define GTEST_OS_WINDOWS 1
+# ifdef _WIN32_WCE
+#  define GTEST_OS_WINDOWS_MOBILE 1
+# elif defined(__MINGW__) || defined(__MINGW32__)
+#  define GTEST_OS_WINDOWS_MINGW 1
+# elif defined(WINAPI_FAMILY)
+#  include <winapifamily.h>
+#  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#   define GTEST_OS_WINDOWS_DESKTOP 1
+#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+#   define GTEST_OS_WINDOWS_PHONE 1
+#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+#   define GTEST_OS_WINDOWS_RT 1
+#  else
+    // WINAPI_FAMILY defined but no known partition matched.
+    // Default to desktop.
+#   define GTEST_OS_WINDOWS_DESKTOP 1
+#  endif
+# else
+#  define GTEST_OS_WINDOWS_DESKTOP 1
+# endif  // _WIN32_WCE
+#elif defined __APPLE__
+# define GTEST_OS_MAC 1
+# if TARGET_OS_IPHONE
+#  define GTEST_OS_IOS 1
+# endif
+#elif defined __FreeBSD__
+# define GTEST_OS_FREEBSD 1
+#elif defined __linux__
+# define GTEST_OS_LINUX 1
+# if defined __ANDROID__
+#  define GTEST_OS_LINUX_ANDROID 1
+# endif
+#elif defined __MVS__
+# define GTEST_OS_ZOS 1
+#elif defined(__sun) && defined(__SVR4)
+# define GTEST_OS_SOLARIS 1
+#elif defined(_AIX)
+# define GTEST_OS_AIX 1
+#elif defined(__hpux)
+# define GTEST_OS_HPUX 1
+#elif defined __native_client__
+# define GTEST_OS_NACL 1
+#elif defined __OpenBSD__
+# define GTEST_OS_OPENBSD 1
+#elif defined __QNX__
+# define GTEST_OS_QNX 1
+#endif  // __CYGWIN__
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-port.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-port.h
new file mode 100644
index 0000000..0094ed5
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-port.h
@@ -0,0 +1,2554 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan)
+//
+// Low-level types and utilities for porting Google Test to various
+// platforms.  All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice.  Code
+// outside Google Test MUST NOT USE THEM DIRECTLY.  Macros that don't
+// end with _ are part of Google Test's public API and can be used by
+// code outside Google Test.
+//
+// This file is fundamental to Google Test.  All other Google Test source
+// files are expected to #include this.  Therefore, it cannot #include
+// any other Google Test header.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
+
+// Environment-describing macros
+// -----------------------------
+//
+// Google Test can be used in many different environments.  Macros in
+// this section tell Google Test what kind of environment it is being
+// used in, such that Google Test can provide environment-specific
+// features and implementations.
+//
+// Google Test tries to automatically detect the properties of its
+// environment, so users usually don't need to worry about these
+// macros.  However, the automatic detection is not perfect.
+// Sometimes it's necessary for a user to define some of the following
+// macros in the build script to override Google Test's decisions.
+//
+// If the user doesn't define a macro in the list, Google Test will
+// provide a default definition.  After this header is #included, all
+// macros in this list will be defined to either 1 or 0.
+//
+// Notes to maintainers:
+//   - Each macro here is a user-tweakable knob; do not grow the list
+//     lightly.
+//   - Use #if to key off these macros.  Don't use #ifdef or "#if
+//     defined(...)", which will not work as these macros are ALWAYS
+//     defined.
+//
+//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
+//                              is/isn't available.
+//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions
+//                              are enabled.
+//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string
+//                              is/isn't available (some systems define
+//                              ::string, which is different to std::string).
+//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string
+//                              is/isn't available (some systems define
+//                              ::wstring, which is different to std::wstring).
+//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular
+//                              expressions are/aren't available.
+//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>
+//                              is/isn't available.
+//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't
+//                              enabled.
+//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that
+//                              std::wstring does/doesn't work (Google Test can
+//                              be used where std::wstring is unavailable).
+//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple
+//                              is/isn't available.
+//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the
+//                              compiler supports Microsoft's "Structured
+//                              Exception Handling".
+//   GTEST_HAS_STREAM_REDIRECTION
+//                            - Define it to 1/0 to indicate whether the
+//                              platform supports I/O stream redirection using
+//                              dup() and dup2().
+//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google
+//                              Test's own tr1 tuple implementation should be
+//                              used.  Unused when the user sets
+//                              GTEST_HAS_TR1_TUPLE to 0.
+//   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test
+//                              is building in C++11/C++98 mode.
+//   GTEST_LINKED_AS_SHARED_LIBRARY
+//                            - Define to 1 when compiling tests that use
+//                              Google Test as a shared library (known as
+//                              DLL on Windows).
+//   GTEST_CREATE_SHARED_LIBRARY
+//                            - Define to 1 when compiling Google Test itself
+//                              as a shared library.
+
+// Platform-indicating macros
+// --------------------------
+//
+// Macros indicating the platform on which Google Test is being used
+// (a macro is defined to 1 if compiled on the given platform;
+// otherwise UNDEFINED -- it's never defined to 0.).  Google Test
+// defines these macros automatically.  Code outside Google Test MUST
+// NOT define them.
+//
+//   GTEST_OS_AIX      - IBM AIX
+//   GTEST_OS_CYGWIN   - Cygwin
+//   GTEST_OS_FREEBSD  - FreeBSD
+//   GTEST_OS_HPUX     - HP-UX
+//   GTEST_OS_LINUX    - Linux
+//     GTEST_OS_LINUX_ANDROID - Google Android
+//   GTEST_OS_MAC      - Mac OS X
+//     GTEST_OS_IOS    - iOS
+//   GTEST_OS_NACL     - Google Native Client (NaCl)
+//   GTEST_OS_OPENBSD  - OpenBSD
+//   GTEST_OS_QNX      - QNX
+//   GTEST_OS_SOLARIS  - Sun Solaris
+//   GTEST_OS_SYMBIAN  - Symbian
+//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)
+//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
+//     GTEST_OS_WINDOWS_MINGW    - MinGW
+//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
+//     GTEST_OS_WINDOWS_PHONE    - Windows Phone
+//     GTEST_OS_WINDOWS_RT       - Windows Store App/WinRT
+//   GTEST_OS_ZOS      - z/OS
+//
+// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
+// most stable support.  Since core members of the Google Test project
+// don't have access to other platforms, support for them may be less
+// stable.  If you notice any problems on your platform, please notify
+// googletestframework@googlegroups.com (patches for fixing them are
+// even more welcome!).
+//
+// It is possible that none of the GTEST_OS_* macros are defined.
+
+// Feature-indicating macros
+// -------------------------
+//
+// Macros indicating which Google Test features are available (a macro
+// is defined to 1 if the corresponding feature is supported;
+// otherwise UNDEFINED -- it's never defined to 0.).  Google Test
+// defines these macros automatically.  Code outside Google Test MUST
+// NOT define them.
+//
+// These macros are public so that portable tests can be written.
+// Such tests typically surround code using a feature with an #if
+// which controls that code.  For example:
+//
+// #if GTEST_HAS_DEATH_TEST
+//   EXPECT_DEATH(DoSomethingDeadly());
+// #endif
+//
+//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
+//                            tests)
+//   GTEST_HAS_DEATH_TEST   - death tests
+//   GTEST_HAS_PARAM_TEST   - value-parameterized tests
+//   GTEST_HAS_TYPED_TEST   - typed tests
+//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
+//   GTEST_IS_THREADSAFE    - Google Test is thread-safe.
+//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
+//                            GTEST_HAS_POSIX_RE (see above) which users can
+//                            define themselves.
+//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
+//                            the above two are mutually exclusive.
+//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
+
+// Misc public macros
+// ------------------
+//
+//   GTEST_FLAG(flag_name)  - references the variable corresponding to
+//                            the given Google Test flag.
+
+// Internal utilities
+// ------------------
+//
+// The following macros and utilities are for Google Test's INTERNAL
+// use only.  Code outside Google Test MUST NOT USE THEM DIRECTLY.
+//
+// Macros for basic C++ coding:
+//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
+//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a
+//                              variable don't have to be used.
+//   GTEST_DISALLOW_ASSIGN_   - disables operator=.
+//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
+//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
+//   GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
+//                                        suppressed (constant conditional).
+//   GTEST_INTENTIONAL_CONST_COND_POP_  - finish code section where MSVC C4127
+//                                        is suppressed.
+//
+// C++11 feature wrappers:
+//
+//   testing::internal::move  - portability wrapper for std::move.
+//
+// Synchronization:
+//   Mutex, MutexLock, ThreadLocal, GetThreadCount()
+//                            - synchronization primitives.
+//
+// Template meta programming:
+//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
+//   IteratorTraits - partial implementation of std::iterator_traits, which
+//                    is not available in libCstd when compiled with Sun C++.
+//
+// Smart pointers:
+//   scoped_ptr     - as in TR2.
+//
+// Regular expressions:
+//   RE             - a simple regular expression class using the POSIX
+//                    Extended Regular Expression syntax on UNIX-like
+//                    platforms, or a reduced regular exception syntax on
+//                    other platforms, including Windows.
+//
+// Logging:
+//   GTEST_LOG_()   - logs messages at the specified severity level.
+//   LogToStderr()  - directs all log messages to stderr.
+//   FlushInfoLog() - flushes informational log messages.
+//
+// Stdout and stderr capturing:
+//   CaptureStdout()     - starts capturing stdout.
+//   GetCapturedStdout() - stops capturing stdout and returns the captured
+//                         string.
+//   CaptureStderr()     - starts capturing stderr.
+//   GetCapturedStderr() - stops capturing stderr and returns the captured
+//                         string.
+//
+// Integer types:
+//   TypeWithSize   - maps an integer to a int type.
+//   Int32, UInt32, Int64, UInt64, TimeInMillis
+//                  - integers of known sizes.
+//   BiggestInt     - the biggest signed integer type.
+//
+// Command-line utilities:
+//   GTEST_DECLARE_*()  - declares a flag.
+//   GTEST_DEFINE_*()   - defines a flag.
+//   GetInjectableArgvs() - returns the command line as a vector of strings.
+//
+// Environment variable utilities:
+//   GetEnv()             - gets the value of an environment variable.
+//   BoolFromGTestEnv()   - parses a bool environment variable.
+//   Int32FromGTestEnv()  - parses an Int32 environment variable.
+//   StringFromGTestEnv() - parses a string environment variable.
+
+#include <ctype.h>   // for isspace, etc
+#include <stddef.h>  // for ptrdiff_t
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32_WCE
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif  // !_WIN32_WCE
+
+#if defined __APPLE__
+# include <AvailabilityMacros.h>
+# include <TargetConditionals.h>
+#endif
+
+#include <algorithm>  // NOLINT
+#include <iostream>  // NOLINT
+#include <sstream>  // NOLINT
+#include <string>  // NOLINT
+#include <utility>
+#include <vector>  // NOLINT
+
+#include "gtest/internal/gtest-port-arch.h"
+#include "gtest/internal/custom/gtest-port.h"
+
+#if !defined(GTEST_DEV_EMAIL_)
+# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
+# define GTEST_FLAG_PREFIX_ "gtest_"
+# define GTEST_FLAG_PREFIX_DASH_ "gtest-"
+# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
+# define GTEST_NAME_ "Google Test"
+# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
+#endif  // !defined(GTEST_DEV_EMAIL_)
+
+#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
+#endif  // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+
+// Determines the version of gcc that is used to compile this.
+#ifdef __GNUC__
+// 40302 means version 4.3.2.
+# define GTEST_GCC_VER_ \
+    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
+#endif  // __GNUC__
+
+// Macros for disabling Microsoft Visual C++ warnings.
+//
+//   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
+//   /* code that triggers warnings C4800 and C4385 */
+//   GTEST_DISABLE_MSC_WARNINGS_POP_()
+#if _MSC_VER >= 1500
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
+    __pragma(warning(push))                        \
+    __pragma(warning(disable: warnings))
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()          \
+    __pragma(warning(pop))
+#else
+// Older versions of MSVC don't have __pragma.
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif
+
+#ifndef GTEST_LANG_CXX11
+// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
+// -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a
+// value for __cplusplus, and recent versions of clang, gcc, and
+// probably other compilers set that too in C++11 mode.
+# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L
+// Compiling in at least C++11 mode.
+#  define GTEST_LANG_CXX11 1
+# else
+#  define GTEST_LANG_CXX11 0
+# endif
+#endif
+
+// Distinct from C++11 language support, some environments don't provide
+// proper C++11 library support. Notably, it's possible to build in
+// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
+// with no C++11 support.
+//
+// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
+// 20110325, but maintenance releases in the 4.4 and 4.5 series followed
+// this date, so check for those versions by their date stamps.
+// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
+#if GTEST_LANG_CXX11 && \
+    (!defined(__GLIBCXX__) || ( \
+        __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \
+        /* Blacklist of patch releases of older branches: */ \
+        __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \
+        __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \
+        __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \
+        __GLIBCXX__ != 20120702ul))   /* GCC 4.5.4 */
+# define GTEST_STDLIB_CXX11 1
+#endif
+
+// Only use C++11 library features if the library provides them.
+#if GTEST_STDLIB_CXX11
+# define GTEST_HAS_STD_BEGIN_AND_END_ 1
+# define GTEST_HAS_STD_FORWARD_LIST_ 1
+# define GTEST_HAS_STD_FUNCTION_ 1
+# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
+# define GTEST_HAS_STD_MOVE_ 1
+# define GTEST_HAS_STD_SHARED_PTR_ 1
+# define GTEST_HAS_STD_TYPE_TRAITS_ 1
+# define GTEST_HAS_STD_UNIQUE_PTR_ 1
+#endif
+
+// C++11 specifies that <tuple> provides std::tuple.
+// Some platforms still might not have it, however.
+#if GTEST_LANG_CXX11
+# define GTEST_HAS_STD_TUPLE_ 1
+# if defined(__clang__)
+// Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
+#  if defined(__has_include) && !__has_include(<tuple>)
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# elif defined(_MSC_VER)
+// Inspired by boost/config/stdlib/dinkumware.hpp
+#  if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# elif defined(__GLIBCXX__)
+// Inspired by boost/config/stdlib/libstdcpp3.hpp,
+// http://gcc.gnu.org/gcc-4.2/changes.html and
+// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
+#  if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# endif
+#endif
+
+// Brings in definitions for functions used in the testing::internal::posix
+// namespace (read, write, close, chdir, isatty, stat). We do not currently
+// use them on Windows Mobile.
+#if GTEST_OS_WINDOWS
+# if !GTEST_OS_WINDOWS_MOBILE
+#  include <direct.h>
+#  include <io.h>
+# endif
+// In order to avoid having to include <windows.h>, use forward declaration
+// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
+// This assumption is verified by
+// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
+struct _RTL_CRITICAL_SECTION;
+#else
+// This assumes that non-Windows OSes provide unistd.h. For OSes where this
+// is not the case, we need to include headers that provide the functions
+// mentioned above.
+# include <unistd.h>
+# include <strings.h>
+#endif  // GTEST_OS_WINDOWS
+
+#if GTEST_OS_LINUX_ANDROID
+// Used to define __ANDROID_API__ matching the target NDK API level.
+#  include <android/api-level.h>  // NOLINT
+#endif
+
+// Defines this to true iff Google Test can use POSIX regular expressions.
+#ifndef GTEST_HAS_POSIX_RE
+# if GTEST_OS_LINUX_ANDROID
+// On Android, <regex.h> is only available starting with Gingerbread.
+#  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
+# else
+#  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)
+# endif
+#endif
+
+#if GTEST_USES_PCRE
+// The appropriate headers have already been included.
+
+#elif GTEST_HAS_POSIX_RE
+
+// On some platforms, <regex.h> needs someone to define size_t, and
+// won't compile otherwise.  We can #include it here as we already
+// included <stdlib.h>, which is guaranteed to define size_t through
+// <stddef.h>.
+# include <regex.h>  // NOLINT
+
+# define GTEST_USES_POSIX_RE 1
+
+#elif GTEST_OS_WINDOWS
+
+// <regex.h> is not available on Windows.  Use our own simple regex
+// implementation instead.
+# define GTEST_USES_SIMPLE_RE 1
+
+#else
+
+// <regex.h> may not be available on this platform.  Use our own
+// simple regex implementation instead.
+# define GTEST_USES_SIMPLE_RE 1
+
+#endif  // GTEST_USES_PCRE
+
+#ifndef GTEST_HAS_EXCEPTIONS
+// The user didn't tell us whether exceptions are enabled, so we need
+// to figure it out.
+# if defined(_MSC_VER) || defined(__BORLANDC__)
+// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS
+// macro to enable exceptions, so we'll do the same.
+// Assumes that exceptions are enabled by default.
+#  ifndef _HAS_EXCEPTIONS
+#   define _HAS_EXCEPTIONS 1
+#  endif  // _HAS_EXCEPTIONS
+#  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
+# elif defined(__clang__)
+// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
+// but iff cleanups are enabled after that. In Obj-C++ files, there can be
+// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
+// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
+// exceptions starting at clang r206352, but which checked for cleanups prior to
+// that. To reliably check for C++ exception availability with clang, check for
+// __EXCEPTIONS && __has_feature(cxx_exceptions).
+#  define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
+# elif defined(__GNUC__) && __EXCEPTIONS
+// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
+#  define GTEST_HAS_EXCEPTIONS 1
+# elif defined(__SUNPRO_CC)
+// Sun Pro CC supports exceptions.  However, there is no compile-time way of
+// detecting whether they are enabled or not.  Therefore, we assume that
+// they are enabled unless the user tells us otherwise.
+#  define GTEST_HAS_EXCEPTIONS 1
+# elif defined(__IBMCPP__) && __EXCEPTIONS
+// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.
+#  define GTEST_HAS_EXCEPTIONS 1
+# elif defined(__HP_aCC)
+// Exception handling is in effect by default in HP aCC compiler. It has to
+// be turned of by +noeh compiler option if desired.
+#  define GTEST_HAS_EXCEPTIONS 1
+# else
+// For other compilers, we assume exceptions are disabled to be
+// conservative.
+#  define GTEST_HAS_EXCEPTIONS 0
+# endif  // defined(_MSC_VER) || defined(__BORLANDC__)
+#endif  // GTEST_HAS_EXCEPTIONS
+
+#if !defined(GTEST_HAS_STD_STRING)
+// Even though we don't use this macro any longer, we keep it in case
+// some clients still depend on it.
+# define GTEST_HAS_STD_STRING 1
+#elif !GTEST_HAS_STD_STRING
+// The user told us that ::std::string isn't available.
+# error "Google Test cannot be used where ::std::string isn't available."
+#endif  // !defined(GTEST_HAS_STD_STRING)
+
+#ifndef GTEST_HAS_GLOBAL_STRING
+// The user didn't tell us whether ::string is available, so we need
+// to figure it out.
+
+# define GTEST_HAS_GLOBAL_STRING 0
+
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+#ifndef GTEST_HAS_STD_WSTRING
+// The user didn't tell us whether ::std::wstring is available, so we need
+// to figure it out.
+// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring
+//   is available.
+
+// Cygwin 1.7 and below doesn't support ::std::wstring.
+// Solaris' libc++ doesn't support it either.  Android has
+// no support for it at least as recent as Froyo (2.2).
+# define GTEST_HAS_STD_WSTRING \
+    (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))
+
+#endif  // GTEST_HAS_STD_WSTRING
+
+#ifndef GTEST_HAS_GLOBAL_WSTRING
+// The user didn't tell us whether ::wstring is available, so we need
+// to figure it out.
+# define GTEST_HAS_GLOBAL_WSTRING \
+    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+// Determines whether RTTI is available.
+#ifndef GTEST_HAS_RTTI
+// The user didn't tell us whether RTTI is enabled, so we need to
+// figure it out.
+
+# ifdef _MSC_VER
+
+#  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.
+#   define GTEST_HAS_RTTI 1
+#  else
+#   define GTEST_HAS_RTTI 0
+#  endif
+
+// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.
+# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)
+
+#  ifdef __GXX_RTTI
+// When building against STLport with the Android NDK and with
+// -frtti -fno-exceptions, the build fails at link time with undefined
+// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
+// so disable RTTI when detected.
+#   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
+       !defined(__EXCEPTIONS)
+#    define GTEST_HAS_RTTI 0
+#   else
+#    define GTEST_HAS_RTTI 1
+#   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
+#  else
+#   define GTEST_HAS_RTTI 0
+#  endif  // __GXX_RTTI
+
+// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
+// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
+// first version with C++ support.
+# elif defined(__clang__)
+
+#  define GTEST_HAS_RTTI __has_feature(cxx_rtti)
+
+// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
+// both the typeid and dynamic_cast features are present.
+# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
+
+#  ifdef __RTTI_ALL__
+#   define GTEST_HAS_RTTI 1
+#  else
+#   define GTEST_HAS_RTTI 0
+#  endif
+
+# else
+
+// For all other compilers, we assume RTTI is enabled.
+#  define GTEST_HAS_RTTI 1
+
+# endif  // _MSC_VER
+
+#endif  // GTEST_HAS_RTTI
+
+// It's this header's responsibility to #include <typeinfo> when RTTI
+// is enabled.
+#if GTEST_HAS_RTTI
+# include <typeinfo>
+#endif
+
+// Determines whether Google Test can use the pthreads library.
+#ifndef GTEST_HAS_PTHREAD
+// The user didn't tell us explicitly, so we make reasonable assumptions about
+// which platforms have pthreads support.
+//
+// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
+// to your compiler flags.
+# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
+    || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL)
+#endif  // GTEST_HAS_PTHREAD
+
+#if GTEST_HAS_PTHREAD
+// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
+// true.
+# include <pthread.h>  // NOLINT
+
+// For timespec and nanosleep, used below.
+# include <time.h>  // NOLINT
+#endif
+
+// Determines if hash_map/hash_set are available.
+// Only used for testing against those containers.
+#if !defined(GTEST_HAS_HASH_MAP_)
+# if _MSC_VER
+#  define GTEST_HAS_HASH_MAP_ 1  // Indicates that hash_map is available.
+#  define GTEST_HAS_HASH_SET_ 1  // Indicates that hash_set is available.
+# endif  // _MSC_VER
+#endif  // !defined(GTEST_HAS_HASH_MAP_)
+
+// Determines whether Google Test can use tr1/tuple.  You can define
+// this macro to 0 to prevent Google Test from using tuple (any
+// feature depending on tuple with be disabled in this mode).
+#ifndef GTEST_HAS_TR1_TUPLE
+# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)
+// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.
+#  define GTEST_HAS_TR1_TUPLE 0
+# else
+// The user didn't tell us not to do it, so we assume it's OK.
+#  define GTEST_HAS_TR1_TUPLE 1
+# endif
+#endif  // GTEST_HAS_TR1_TUPLE
+
+// Determines whether Google Test's own tr1 tuple implementation
+// should be used.
+#ifndef GTEST_USE_OWN_TR1_TUPLE
+// The user didn't tell us, so we need to figure it out.
+
+// We use our own TR1 tuple if we aren't sure the user has an
+// implementation of it already.  At this time, libstdc++ 4.0.0+ and
+// MSVC 2010 are the only mainstream standard libraries that come
+// with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler
+// pretends to be GCC by defining __GNUC__ and friends, but cannot
+// compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1
+// tuple in a 323 MB Feature Pack download, which we cannot assume the
+// user has.  QNX's QCC compiler is a modified GCC but it doesn't
+// support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,
+// and it can be used with some compilers that define __GNUC__.
+# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \
+      && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600
+#  define GTEST_ENV_HAS_TR1_TUPLE_ 1
+# endif
+
+// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used
+// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6
+// can build with clang but need to use gcc4.2's libstdc++).
+# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)
+#  define GTEST_ENV_HAS_STD_TUPLE_ 1
+# endif
+
+# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_
+#  define GTEST_USE_OWN_TR1_TUPLE 0
+# else
+#  define GTEST_USE_OWN_TR1_TUPLE 1
+# endif
+
+#endif  // GTEST_USE_OWN_TR1_TUPLE
+
+// To avoid conditional compilation everywhere, we make it
+// gtest-port.h's responsibility to #include the header implementing
+// tuple.
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>  // IWYU pragma: export
+# define GTEST_TUPLE_NAMESPACE_ ::std
+#endif  // GTEST_HAS_STD_TUPLE_
+
+// We include tr1::tuple even if std::tuple is available to define printers for
+// them.
+#if GTEST_HAS_TR1_TUPLE
+# ifndef GTEST_TUPLE_NAMESPACE_
+#  define GTEST_TUPLE_NAMESPACE_ ::std::tr1
+# endif  // GTEST_TUPLE_NAMESPACE_
+
+# if GTEST_USE_OWN_TR1_TUPLE
+#  include "gtest/internal/gtest-tuple.h"  // IWYU pragma: export  // NOLINT
+# elif GTEST_ENV_HAS_STD_TUPLE_
+#  include <tuple>
+// C++11 puts its tuple into the ::std namespace rather than
+// ::std::tr1.  gtest expects tuple to live in ::std::tr1, so put it there.
+// This causes undefined behavior, but supported compilers react in
+// the way we intend.
+namespace std {
+namespace tr1 {
+using ::std::get;
+using ::std::make_tuple;
+using ::std::tuple;
+using ::std::tuple_element;
+using ::std::tuple_size;
+}
+}
+
+# elif GTEST_OS_SYMBIAN
+
+// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to
+// use STLport's tuple implementation, which unfortunately doesn't
+// work as the copy of STLport distributed with Symbian is incomplete.
+// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to
+// use its own tuple implementation.
+#  ifdef BOOST_HAS_TR1_TUPLE
+#   undef BOOST_HAS_TR1_TUPLE
+#  endif  // BOOST_HAS_TR1_TUPLE
+
+// This prevents <boost/tr1/detail/config.hpp>, which defines
+// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
+#  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
+#  include <tuple>  // IWYU pragma: export  // NOLINT
+
+# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
+// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
+// not conform to the TR1 spec, which requires the header to be <tuple>.
+
+#  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,
+// which is #included by <tr1/tuple>, to not compile when RTTI is
+// disabled.  _TR1_FUNCTIONAL is the header guard for
+// <tr1/functional>.  Hence the following #define is a hack to prevent
+// <tr1/functional> from being included.
+#   define _TR1_FUNCTIONAL 1
+#   include <tr1/tuple>
+#   undef _TR1_FUNCTIONAL  // Allows the user to #include
+                        // <tr1/functional> if he chooses to.
+#  else
+#   include <tr1/tuple>  // NOLINT
+#  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302
+
+# else
+// If the compiler is not GCC 4.0+, we assume the user is using a
+// spec-conforming TR1 implementation.
+#  include <tuple>  // IWYU pragma: export  // NOLINT
+# endif  // GTEST_USE_OWN_TR1_TUPLE
+
+#endif  // GTEST_HAS_TR1_TUPLE
+
+// Determines whether clone(2) is supported.
+// Usually it will only be available on Linux, excluding
+// Linux on the Itanium architecture.
+// Also see http://linux.die.net/man/2/clone.
+#ifndef GTEST_HAS_CLONE
+// The user didn't tell us, so we need to figure it out.
+
+# if GTEST_OS_LINUX && !defined(__ia64__)
+#  if GTEST_OS_LINUX_ANDROID
+// On Android, clone() is only available on ARM starting with Gingerbread.
+#    if defined(__arm__) && __ANDROID_API__ >= 9
+#     define GTEST_HAS_CLONE 1
+#    else
+#     define GTEST_HAS_CLONE 0
+#    endif
+#  else
+#   define GTEST_HAS_CLONE 1
+#  endif
+# else
+#  define GTEST_HAS_CLONE 0
+# endif  // GTEST_OS_LINUX && !defined(__ia64__)
+
+#endif  // GTEST_HAS_CLONE
+
+// Determines whether to support stream redirection. This is used to test
+// output correctness and to implement death tests.
+#ifndef GTEST_HAS_STREAM_REDIRECTION
+// By default, we assume that stream redirection is supported on all
+// platforms except known mobile ones.
+# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
+    GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+#  define GTEST_HAS_STREAM_REDIRECTION 0
+# else
+#  define GTEST_HAS_STREAM_REDIRECTION 1
+# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN
+#endif  // GTEST_HAS_STREAM_REDIRECTION
+
+// Determines whether to support death tests.
+// Google Test does not support death tests for VC 7.1 and earlier as
+// abort() in a VC 7.1 application compiled as GUI in debug config
+// pops up a dialog window that cannot be suppressed programmatically.
+#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
+     (GTEST_OS_MAC && !GTEST_OS_IOS) || \
+     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
+     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
+     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
+# define GTEST_HAS_DEATH_TEST 1
+#endif
+
+// We don't support MSVC 7.1 with exceptions disabled now.  Therefore
+// all the compilers we care about are adequate for supporting
+// value-parameterized tests.
+#define GTEST_HAS_PARAM_TEST 1
+
+// Determines whether to support type-driven tests.
+
+// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
+// Sun Pro CC, IBM Visual Age, and HP aCC support.
+#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \
+    defined(__IBMCPP__) || defined(__HP_aCC)
+# define GTEST_HAS_TYPED_TEST 1
+# define GTEST_HAS_TYPED_TEST_P 1
+#endif
+
+// Determines whether to support Combine(). This only makes sense when
+// value-parameterized tests are enabled.  The implementation doesn't
+// work on Sun Studio since it doesn't understand templated conversion
+// operators.
+#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC)
+# define GTEST_HAS_COMBINE 1
+#endif
+
+// Determines whether the system compiler uses UTF-16 for encoding wide strings.
+#define GTEST_WIDE_STRING_USES_UTF16_ \
+    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
+
+// Determines whether test results can be streamed to a socket.
+#if GTEST_OS_LINUX
+# define GTEST_CAN_STREAM_RESULTS_ 1
+#endif
+
+// Defines some utility macros.
+
+// The GNU compiler emits a warning if nested "if" statements are followed by
+// an "else" statement and braces are not used to explicitly disambiguate the
+// "else" binding.  This leads to problems with code like:
+//
+//   if (gate)
+//     ASSERT_*(condition) << "Some message";
+//
+// The "switch (0) case 0:" idiom is used to suppress this.
+#ifdef __INTEL_COMPILER
+# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
+#else
+# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT
+#endif
+
+// Use this annotation at the end of a struct/class definition to
+// prevent the compiler from optimizing away instances that are never
+// used.  This is useful when all interesting logic happens inside the
+// c'tor and / or d'tor.  Example:
+//
+//   struct Foo {
+//     Foo() { ... }
+//   } GTEST_ATTRIBUTE_UNUSED_;
+//
+// Also use it after a variable or parameter declaration to tell the
+// compiler the variable/parameter does not have to be used.
+#if defined(__GNUC__) && !defined(COMPILER_ICC)
+# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
+#elif defined(__clang__)
+# if __has_attribute(unused)
+#  define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
+# endif
+#endif
+#ifndef GTEST_ATTRIBUTE_UNUSED_
+# define GTEST_ATTRIBUTE_UNUSED_
+#endif
+
+// A macro to disallow operator=
+// This should be used in the private: declarations for a class.
+#define GTEST_DISALLOW_ASSIGN_(type)\
+  void operator=(type const &)
+
+// A macro to disallow copy constructor and operator=
+// This should be used in the private: declarations for a class.
+#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\
+  type(type const &);\
+  GTEST_DISALLOW_ASSIGN_(type)
+
+// Tell the compiler to warn about unused return values for functions declared
+// with this macro.  The macro should be used on function declarations
+// following the argument list:
+//
+//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
+#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)
+# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
+#else
+# define GTEST_MUST_USE_RESULT_
+#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
+
+// MS C++ compiler emits warning when a conditional expression is compile time
+// constant. In some contexts this warning is false positive and needs to be
+// suppressed. Use the following two macros in such cases:
+//
+// GTEST_INTENTIONAL_CONST_COND_PUSH_()
+// while (true) {
+// GTEST_INTENTIONAL_CONST_COND_POP_()
+// }
+# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
+    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
+# define GTEST_INTENTIONAL_CONST_COND_POP_() \
+    GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+// Determine whether the compiler supports Microsoft's Structured Exception
+// Handling.  This is supported by several Windows compilers but generally
+// does not exist on any other system.
+#ifndef GTEST_HAS_SEH
+// The user didn't tell us, so we need to figure it out.
+
+# if defined(_MSC_VER) || defined(__BORLANDC__)
+// These two compilers are known to support SEH.
+#  define GTEST_HAS_SEH 1
+# else
+// Assume no SEH.
+#  define GTEST_HAS_SEH 0
+# endif
+
+#define GTEST_IS_THREADSAFE \
+    (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
+     || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
+     || GTEST_HAS_PTHREAD)
+
+#endif  // GTEST_HAS_SEH
+
+#ifdef _MSC_VER
+# if GTEST_LINKED_AS_SHARED_LIBRARY
+#  define GTEST_API_ __declspec(dllimport)
+# elif GTEST_CREATE_SHARED_LIBRARY
+#  define GTEST_API_ __declspec(dllexport)
+# endif
+#elif __GNUC__ >= 4 || defined(__clang__)
+# define GTEST_API_ __attribute__((visibility ("default")))
+#endif // _MSC_VER
+
+#ifndef GTEST_API_
+# define GTEST_API_
+#endif
+
+#ifdef __GNUC__
+// Ask the compiler to never inline a given function.
+# define GTEST_NO_INLINE_ __attribute__((noinline))
+#else
+# define GTEST_NO_INLINE_
+#endif
+
+// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
+#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION)
+# define GTEST_HAS_CXXABI_H_ 1
+#else
+# define GTEST_HAS_CXXABI_H_ 0
+#endif
+
+// A function level attribute to disable checking for use of uninitialized
+// memory when built with MemorySanitizer.
+#if defined(__clang__)
+# if __has_feature(memory_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
+       __attribute__((no_sanitize_memory))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+# endif  // __has_feature(memory_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+#endif  // __clang__
+
+// A function level attribute to disable AddressSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(address_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
+       __attribute__((no_sanitize_address))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+# endif  // __has_feature(address_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+#endif  // __clang__
+
+// A function level attribute to disable ThreadSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(thread_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
+       __attribute__((no_sanitize_thread))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+# endif  // __has_feature(thread_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+#endif  // __clang__
+
+namespace testing {
+
+class Message;
+
+#if defined(GTEST_TUPLE_NAMESPACE_)
+// Import tuple and friends into the ::testing namespace.
+// It is part of our interface, having them in ::testing allows us to change
+// their types as needed.
+using GTEST_TUPLE_NAMESPACE_::get;
+using GTEST_TUPLE_NAMESPACE_::make_tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple_size;
+using GTEST_TUPLE_NAMESPACE_::tuple_element;
+#endif  // defined(GTEST_TUPLE_NAMESPACE_)
+
+namespace internal {
+
+// A secret type that Google Test users don't know about.  It has no
+// definition on purpose.  Therefore it's impossible to create a
+// Secret object, which is what we want.
+class Secret;
+
+// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time
+// expression is true. For example, you could use it to verify the
+// size of a static array:
+//
+//   GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
+//                         names_incorrect_size);
+//
+// or to make sure a struct is smaller than a certain size:
+//
+//   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);
+//
+// The second argument to the macro is the name of the variable. If
+// the expression is false, most compilers will issue a warning/error
+// containing the name of the variable.
+
+#if GTEST_LANG_CXX11
+# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
+#else  // !GTEST_LANG_CXX11
+template <bool>
+  struct CompileAssert {
+};
+
+# define GTEST_COMPILE_ASSERT_(expr, msg) \
+  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
+      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
+#endif  // !GTEST_LANG_CXX11
+
+// Implementation details of GTEST_COMPILE_ASSERT_:
+//
+// (In C++11, we simply use static_assert instead of the following)
+//
+// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
+//   elements (and thus is invalid) when the expression is false.
+//
+// - The simpler definition
+//
+//    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]
+//
+//   does not work, as gcc supports variable-length arrays whose sizes
+//   are determined at run-time (this is gcc's extension and not part
+//   of the C++ standard).  As a result, gcc fails to reject the
+//   following code with the simple definition:
+//
+//     int foo;
+//     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is
+//                                      // not a compile-time constant.
+//
+// - By using the type CompileAssert<(bool(expr))>, we ensures that
+//   expr is a compile-time constant.  (Template arguments must be
+//   determined at compile-time.)
+//
+// - The outter parentheses in CompileAssert<(bool(expr))> are necessary
+//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written
+//
+//     CompileAssert<bool(expr)>
+//
+//   instead, these compilers will refuse to compile
+//
+//     GTEST_COMPILE_ASSERT_(5 > 0, some_message);
+//
+//   (They seem to think the ">" in "5 > 0" marks the end of the
+//   template argument list.)
+//
+// - The array size is (bool(expr) ? 1 : -1), instead of simply
+//
+//     ((expr) ? 1 : -1).
+//
+//   This is to avoid running into a bug in MS VC 7.1, which
+//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.
+
+// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.
+//
+// This template is declared, but intentionally undefined.
+template <typename T1, typename T2>
+struct StaticAssertTypeEqHelper;
+
+template <typename T>
+struct StaticAssertTypeEqHelper<T, T> {
+  enum { value = true };
+};
+
+// Evaluates to the number of elements in 'array'.
+#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
+
+#if GTEST_HAS_GLOBAL_STRING
+typedef ::string string;
+#else
+typedef ::std::string string;
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+#if GTEST_HAS_GLOBAL_WSTRING
+typedef ::wstring wstring;
+#elif GTEST_HAS_STD_WSTRING
+typedef ::std::wstring wstring;
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+// A helper for suppressing warnings on constant condition.  It just
+// returns 'condition'.
+GTEST_API_ bool IsTrue(bool condition);
+
+// Defines scoped_ptr.
+
+// This implementation of scoped_ptr is PARTIAL - it only contains
+// enough stuff to satisfy Google Test's need.
+template <typename T>
+class scoped_ptr {
+ public:
+  typedef T element_type;
+
+  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}
+  ~scoped_ptr() { reset(); }
+
+  T& operator*() const { return *ptr_; }
+  T* operator->() const { return ptr_; }
+  T* get() const { return ptr_; }
+
+  T* release() {
+    T* const ptr = ptr_;
+    ptr_ = NULL;
+    return ptr;
+  }
+
+  void reset(T* p = NULL) {
+    if (p != ptr_) {
+      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.
+        delete ptr_;
+      }
+      ptr_ = p;
+    }
+  }
+
+  friend void swap(scoped_ptr& a, scoped_ptr& b) {
+    using std::swap;
+    swap(a.ptr_, b.ptr_);
+  }
+
+ private:
+  T* ptr_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);
+};
+
+// Defines RE.
+
+// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended
+// Regular Expression syntax.
+class GTEST_API_ RE {
+ public:
+  // A copy constructor is required by the Standard to initialize object
+  // references from r-values.
+  RE(const RE& other) { Init(other.pattern()); }
+
+  // Constructs an RE from a string.
+  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT
+
+#if GTEST_HAS_GLOBAL_STRING
+
+  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT
+
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+  RE(const char* regex) { Init(regex); }  // NOLINT
+  ~RE();
+
+  // Returns the string representation of the regex.
+  const char* pattern() const { return pattern_; }
+
+  // FullMatch(str, re) returns true iff regular expression re matches
+  // the entire str.
+  // PartialMatch(str, re) returns true iff regular expression re
+  // matches a substring of str (including str itself).
+  //
+  // TODO(wan@google.com): make FullMatch() and PartialMatch() work
+  // when str contains NUL characters.
+  static bool FullMatch(const ::std::string& str, const RE& re) {
+    return FullMatch(str.c_str(), re);
+  }
+  static bool PartialMatch(const ::std::string& str, const RE& re) {
+    return PartialMatch(str.c_str(), re);
+  }
+
+#if GTEST_HAS_GLOBAL_STRING
+
+  static bool FullMatch(const ::string& str, const RE& re) {
+    return FullMatch(str.c_str(), re);
+  }
+  static bool PartialMatch(const ::string& str, const RE& re) {
+    return PartialMatch(str.c_str(), re);
+  }
+
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+  static bool FullMatch(const char* str, const RE& re);
+  static bool PartialMatch(const char* str, const RE& re);
+
+ private:
+  void Init(const char* regex);
+
+  // We use a const char* instead of an std::string, as Google Test used to be
+  // used where std::string is not available.  TODO(wan@google.com): change to
+  // std::string.
+  const char* pattern_;
+  bool is_valid_;
+
+#if GTEST_USES_POSIX_RE
+
+  regex_t full_regex_;     // For FullMatch().
+  regex_t partial_regex_;  // For PartialMatch().
+
+#else  // GTEST_USES_SIMPLE_RE
+
+  const char* full_pattern_;  // For FullMatch();
+
+#endif
+
+  GTEST_DISALLOW_ASSIGN_(RE);
+};
+
+// Formats a source file path and a line number as they would appear
+// in an error message from the compiler used to compile this code.
+GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
+
+// Formats a file location for compiler-independent XML output.
+// Although this function is not platform dependent, we put it next to
+// FormatFileLocation in order to contrast the two functions.
+GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
+                                                               int line);
+
+// Defines logging utilities:
+//   GTEST_LOG_(severity) - logs messages at the specified severity level. The
+//                          message itself is streamed into the macro.
+//   LogToStderr()  - directs all log messages to stderr.
+//   FlushInfoLog() - flushes informational log messages.
+
+enum GTestLogSeverity {
+  GTEST_INFO,
+  GTEST_WARNING,
+  GTEST_ERROR,
+  GTEST_FATAL
+};
+
+// Formats log entry severity, provides a stream object for streaming the
+// log message, and terminates the message with a newline when going out of
+// scope.
+class GTEST_API_ GTestLog {
+ public:
+  GTestLog(GTestLogSeverity severity, const char* file, int line);
+
+  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
+  ~GTestLog();
+
+  ::std::ostream& GetStream() { return ::std::cerr; }
+
+ private:
+  const GTestLogSeverity severity_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
+};
+
+#if !defined(GTEST_LOG_)
+
+# define GTEST_LOG_(severity) \
+    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
+                                  __FILE__, __LINE__).GetStream()
+
+inline void LogToStderr() {}
+inline void FlushInfoLog() { fflush(NULL); }
+
+#endif  // !defined(GTEST_LOG_)
+
+#if !defined(GTEST_CHECK_)
+// INTERNAL IMPLEMENTATION - DO NOT USE.
+//
+// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
+// is not satisfied.
+//  Synopsys:
+//    GTEST_CHECK_(boolean_condition);
+//     or
+//    GTEST_CHECK_(boolean_condition) << "Additional message";
+//
+//    This checks the condition and if the condition is not satisfied
+//    it prints message about the condition violation, including the
+//    condition itself, plus additional message streamed into it, if any,
+//    and then it aborts the program. It aborts the program irrespective of
+//    whether it is built in the debug mode or not.
+# define GTEST_CHECK_(condition) \
+    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+    if (::testing::internal::IsTrue(condition)) \
+      ; \
+    else \
+      GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+#endif  // !defined(GTEST_CHECK_)
+
+// An all-mode assert to verify that the given POSIX-style function
+// call returns 0 (indicating success).  Known limitation: this
+// doesn't expand to a balanced 'if' statement, so enclose the macro
+// in {} if you need to use it as the only statement in an 'if'
+// branch.
+#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
+  if (const int gtest_error = (posix_call)) \
+    GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
+                      << gtest_error
+
+#if GTEST_HAS_STD_MOVE_
+using std::move;
+#else  // GTEST_HAS_STD_MOVE_
+template <typename T>
+const T& move(const T& t) {
+  return t;
+}
+#endif  // GTEST_HAS_STD_MOVE_
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Use ImplicitCast_ as a safe version of static_cast for upcasting in
+// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
+// const Foo*).  When you use ImplicitCast_, the compiler checks that
+// the cast is safe.  Such explicit ImplicitCast_s are necessary in
+// surprisingly many situations where C++ demands an exact type match
+// instead of an argument type convertable to a target type.
+//
+// The syntax for using ImplicitCast_ is the same as for static_cast:
+//
+//   ImplicitCast_<ToType>(expr)
+//
+// ImplicitCast_ would have been part of the C++ standard library,
+// but the proposal was submitted too late.  It will probably make
+// its way into the language in the future.
+//
+// This relatively ugly name is intentional. It prevents clashes with
+// similar functions users may have (e.g., implicit_cast). The internal
+// namespace alone is not enough because the function can be found by ADL.
+template<typename To>
+inline To ImplicitCast_(To x) { return x; }
+
+// When you upcast (that is, cast a pointer from type Foo to type
+// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
+// always succeed.  When you downcast (that is, cast a pointer from
+// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
+// how do you know the pointer is really of type SubclassOfFoo?  It
+// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,
+// when you downcast, you should use this macro.  In debug mode, we
+// use dynamic_cast<> to double-check the downcast is legal (we die
+// if it's not).  In normal mode, we do the efficient static_cast<>
+// instead.  Thus, it's important to test in debug mode to make sure
+// the cast is legal!
+//    This is the only place in the code we should use dynamic_cast<>.
+// In particular, you SHOULDN'T be using dynamic_cast<> in order to
+// do RTTI (eg code like this:
+//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
+//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
+// You should design the code some other way not to need this.
+//
+// This relatively ugly name is intentional. It prevents clashes with
+// similar functions users may have (e.g., down_cast). The internal
+// namespace alone is not enough because the function can be found by ADL.
+template<typename To, typename From>  // use like this: DownCast_<T*>(foo);
+inline To DownCast_(From* f) {  // so we only accept pointers
+  // Ensures that To is a sub-type of From *.  This test is here only
+  // for compile-time type checking, and has no overhead in an
+  // optimized build at run-time, as it will be optimized away
+  // completely.
+  GTEST_INTENTIONAL_CONST_COND_PUSH_()
+  if (false) {
+  GTEST_INTENTIONAL_CONST_COND_POP_()
+    const To to = NULL;
+    ::testing::internal::ImplicitCast_<From*>(to);
+  }
+
+#if GTEST_HAS_RTTI
+  // RTTI: debug mode only!
+  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);
+#endif
+  return static_cast<To>(f);
+}
+
+// Downcasts the pointer of type Base to Derived.
+// Derived must be a subclass of Base. The parameter MUST
+// point to a class of type Derived, not any subclass of it.
+// When RTTI is available, the function performs a runtime
+// check to enforce this.
+template <class Derived, class Base>
+Derived* CheckedDowncastToActualType(Base* base) {
+#if GTEST_HAS_RTTI
+  GTEST_CHECK_(typeid(*base) == typeid(Derived));
+#endif
+
+#if GTEST_HAS_DOWNCAST_
+  return ::down_cast<Derived*>(base);
+#elif GTEST_HAS_RTTI
+  return dynamic_cast<Derived*>(base);  // NOLINT
+#else
+  return static_cast<Derived*>(base);  // Poor man's downcast.
+#endif
+}
+
+#if GTEST_HAS_STREAM_REDIRECTION
+
+// Defines the stderr capturer:
+//   CaptureStdout     - starts capturing stdout.
+//   GetCapturedStdout - stops capturing stdout and returns the captured string.
+//   CaptureStderr     - starts capturing stderr.
+//   GetCapturedStderr - stops capturing stderr and returns the captured string.
+//
+GTEST_API_ void CaptureStdout();
+GTEST_API_ std::string GetCapturedStdout();
+GTEST_API_ void CaptureStderr();
+GTEST_API_ std::string GetCapturedStderr();
+
+#endif  // GTEST_HAS_STREAM_REDIRECTION
+
+// Returns a path to temporary directory.
+GTEST_API_ std::string TempDir();
+
+// Returns the size (in bytes) of a file.
+GTEST_API_ size_t GetFileSize(FILE* file);
+
+// Reads the entire content of a file as a string.
+GTEST_API_ std::string ReadEntireFile(FILE* file);
+
+// All command line arguments.
+GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
+
+#if GTEST_HAS_DEATH_TEST
+
+const ::std::vector<testing::internal::string>& GetInjectableArgvs();
+void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
+                             new_argvs);
+
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+// Defines synchronization primitives.
+#if GTEST_IS_THREADSAFE
+# if GTEST_HAS_PTHREAD
+// Sleeps for (roughly) n milliseconds.  This function is only for testing
+// Google Test's own constructs.  Don't use it in user tests, either
+// directly or indirectly.
+inline void SleepMilliseconds(int n) {
+  const timespec time = {
+    0,                  // 0 seconds.
+    n * 1000L * 1000L,  // And n ms.
+  };
+  nanosleep(&time, NULL);
+}
+# endif  // GTEST_HAS_PTHREAD
+
+# if GTEST_HAS_NOTIFICATION_
+// Notification has already been imported into the namespace.
+// Nothing to do here.
+
+# elif GTEST_HAS_PTHREAD
+// Allows a controller thread to pause execution of newly created
+// threads until notified.  Instances of this class must be created
+// and destroyed in the controller thread.
+//
+// This class is only for testing Google Test's own constructs. Do not
+// use it in user tests, either directly or indirectly.
+class Notification {
+ public:
+  Notification() : notified_(false) {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
+  }
+  ~Notification() {
+    pthread_mutex_destroy(&mutex_);
+  }
+
+  // Notifies all threads created with this notification to start. Must
+  // be called from the controller thread.
+  void Notify() {
+    pthread_mutex_lock(&mutex_);
+    notified_ = true;
+    pthread_mutex_unlock(&mutex_);
+  }
+
+  // Blocks until the controller thread notifies. Must be called from a test
+  // thread.
+  void WaitForNotification() {
+    for (;;) {
+      pthread_mutex_lock(&mutex_);
+      const bool notified = notified_;
+      pthread_mutex_unlock(&mutex_);
+      if (notified)
+        break;
+      SleepMilliseconds(10);
+    }
+  }
+
+ private:
+  pthread_mutex_t mutex_;
+  bool notified_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
+};
+
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+GTEST_API_ void SleepMilliseconds(int n);
+
+// Provides leak-safe Windows kernel handle ownership.
+// Used in death tests and in threading support.
+class GTEST_API_ AutoHandle {
+ public:
+  // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
+  // avoid including <windows.h> in this header file. Including <windows.h> is
+  // undesirable because it defines a lot of symbols and macros that tend to
+  // conflict with client code. This assumption is verified by
+  // WindowsTypesTest.HANDLEIsVoidStar.
+  typedef void* Handle;
+  AutoHandle();
+  explicit AutoHandle(Handle handle);
+
+  ~AutoHandle();
+
+  Handle Get() const;
+  void Reset();
+  void Reset(Handle handle);
+
+ private:
+  // Returns true iff the handle is a valid handle object that can be closed.
+  bool IsCloseable() const;
+
+  Handle handle_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
+};
+
+// Allows a controller thread to pause execution of newly created
+// threads until notified.  Instances of this class must be created
+// and destroyed in the controller thread.
+//
+// This class is only for testing Google Test's own constructs. Do not
+// use it in user tests, either directly or indirectly.
+class GTEST_API_ Notification {
+ public:
+  Notification();
+  void Notify();
+  void WaitForNotification();
+
+ private:
+  AutoHandle event_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
+};
+# endif  // GTEST_HAS_NOTIFICATION_
+
+// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
+// defined, but we don't want to use MinGW's pthreads implementation, which
+// has conformance problems with some versions of the POSIX standard.
+# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
+
+// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
+// Consequently, it cannot select a correct instantiation of ThreadWithParam
+// in order to call its Run(). Introducing ThreadWithParamBase as a
+// non-templated base class for ThreadWithParam allows us to bypass this
+// problem.
+class ThreadWithParamBase {
+ public:
+  virtual ~ThreadWithParamBase() {}
+  virtual void Run() = 0;
+};
+
+// pthread_create() accepts a pointer to a function type with the C linkage.
+// According to the Standard (7.5/1), function types with different linkages
+// are different even if they are otherwise identical.  Some compilers (for
+// example, SunStudio) treat them as different types.  Since class methods
+// cannot be defined with C-linkage we need to define a free C-function to
+// pass into pthread_create().
+extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
+  static_cast<ThreadWithParamBase*>(thread)->Run();
+  return NULL;
+}
+
+// Helper class for testing Google Test's multi-threading constructs.
+// To use it, write:
+//
+//   void ThreadFunc(int param) { /* Do things with param */ }
+//   Notification thread_can_start;
+//   ...
+//   // The thread_can_start parameter is optional; you can supply NULL.
+//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
+//   thread_can_start.Notify();
+//
+// These classes are only for testing Google Test's own constructs. Do
+// not use them in user tests, either directly or indirectly.
+template <typename T>
+class ThreadWithParam : public ThreadWithParamBase {
+ public:
+  typedef void UserThreadFunc(T);
+
+  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
+      : func_(func),
+        param_(param),
+        thread_can_start_(thread_can_start),
+        finished_(false) {
+    ThreadWithParamBase* const base = this;
+    // The thread can be created only after all fields except thread_
+    // have been initialized.
+    GTEST_CHECK_POSIX_SUCCESS_(
+        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));
+  }
+  ~ThreadWithParam() { Join(); }
+
+  void Join() {
+    if (!finished_) {
+      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));
+      finished_ = true;
+    }
+  }
+
+  virtual void Run() {
+    if (thread_can_start_ != NULL)
+      thread_can_start_->WaitForNotification();
+    func_(param_);
+  }
+
+ private:
+  UserThreadFunc* const func_;  // User-supplied thread function.
+  const T param_;  // User-supplied parameter to the thread function.
+  // When non-NULL, used to block execution until the controller thread
+  // notifies.
+  Notification* const thread_can_start_;
+  bool finished_;  // true iff we know that the thread function has finished.
+  pthread_t thread_;  // The native thread object.
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
+};
+# endif  // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
+         // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+
+# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+// Mutex and ThreadLocal have already been imported into the namespace.
+// Nothing to do here.
+
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+// Mutex implements mutex on Windows platforms.  It is used in conjunction
+// with class MutexLock:
+//
+//   Mutex mutex;
+//   ...
+//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the
+//                            // end of the current scope.
+//
+// A static Mutex *must* be defined or declared using one of the following
+// macros:
+//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
+//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
+//
+// (A non-static Mutex is defined/declared in the usual way).
+class GTEST_API_ Mutex {
+ public:
+  enum MutexType { kStatic = 0, kDynamic = 1 };
+  // We rely on kStaticMutex being 0 as it is to what the linker initializes
+  // type_ in static mutexes.  critical_section_ will be initialized lazily
+  // in ThreadSafeLazyInit().
+  enum StaticConstructorSelector { kStaticMutex = 0 };
+
+  // This constructor intentionally does nothing.  It relies on type_ being
+  // statically initialized to 0 (effectively setting it to kStatic) and on
+  // ThreadSafeLazyInit() to lazily initialize the rest of the members.
+  explicit Mutex(StaticConstructorSelector /*dummy*/) {}
+
+  Mutex();
+  ~Mutex();
+
+  void Lock();
+
+  void Unlock();
+
+  // Does nothing if the current thread holds the mutex. Otherwise, crashes
+  // with high probability.
+  void AssertHeld();
+
+ private:
+  // Initializes owner_thread_id_ and critical_section_ in static mutexes.
+  void ThreadSafeLazyInit();
+
+  // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
+  // we assume that 0 is an invalid value for thread IDs.
+  unsigned int owner_thread_id_;
+
+  // For static mutexes, we rely on these members being initialized to zeros
+  // by the linker.
+  MutexType type_;
+  long critical_section_init_phase_;  // NOLINT
+  _RTL_CRITICAL_SECTION* critical_section_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
+};
+
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+    extern ::testing::internal::Mutex mutex
+
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+    ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(Mutex* mutex)
+      : mutex_(mutex) { mutex_->Lock(); }
+
+  ~GTestMutexLock() { mutex_->Unlock(); }
+
+ private:
+  Mutex* const mutex_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
+};
+
+typedef GTestMutexLock MutexLock;
+
+// Base class for ValueHolder<T>.  Allows a caller to hold and delete a value
+// without knowing its type.
+class ThreadLocalValueHolderBase {
+ public:
+  virtual ~ThreadLocalValueHolderBase() {}
+};
+
+// Provides a way for a thread to send notifications to a ThreadLocal
+// regardless of its parameter type.
+class ThreadLocalBase {
+ public:
+  // Creates a new ValueHolder<T> object holding a default value passed to
+  // this ThreadLocal<T>'s constructor and returns it.  It is the caller's
+  // responsibility not to call this when the ThreadLocal<T> instance already
+  // has a value on the current thread.
+  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
+
+ protected:
+  ThreadLocalBase() {}
+  virtual ~ThreadLocalBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
+};
+
+// Maps a thread to a set of ThreadLocals that have values instantiated on that
+// thread and notifies them when the thread exits.  A ThreadLocal instance is
+// expected to persist until all threads it has values on have terminated.
+class GTEST_API_ ThreadLocalRegistry {
+ public:
+  // Registers thread_local_instance as having value on the current thread.
+  // Returns a value that can be used to identify the thread from other threads.
+  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance);
+
+  // Invoked when a ThreadLocal instance is destroyed.
+  static void OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance);
+};
+
+class GTEST_API_ ThreadWithParamBase {
+ public:
+  void Join();
+
+ protected:
+  class Runnable {
+   public:
+    virtual ~Runnable() {}
+    virtual void Run() = 0;
+  };
+
+  ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
+  virtual ~ThreadWithParamBase();
+
+ private:
+  AutoHandle thread_;
+};
+
+// Helper class for testing Google Test's multi-threading constructs.
+template <typename T>
+class ThreadWithParam : public ThreadWithParamBase {
+ public:
+  typedef void UserThreadFunc(T);
+
+  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
+      : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
+  }
+  virtual ~ThreadWithParam() {}
+
+ private:
+  class RunnableImpl : public Runnable {
+   public:
+    RunnableImpl(UserThreadFunc* func, T param)
+        : func_(func),
+          param_(param) {
+    }
+    virtual ~RunnableImpl() {}
+    virtual void Run() {
+      func_(param_);
+    }
+
+   private:
+    UserThreadFunc* const func_;
+    const T param_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
+  };
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
+};
+
+// Implements thread-local storage on Windows systems.
+//
+//   // Thread 1
+//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
+//
+//   // Thread 2
+//   tl.set(150);  // Changes the value for thread 2 only.
+//   EXPECT_EQ(150, tl.get());
+//
+//   // Thread 1
+//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
+//   tl.set(200);
+//   EXPECT_EQ(200, tl.get());
+//
+// The template type argument T must have a public copy constructor.
+// In addition, the default ThreadLocal constructor requires T to have
+// a public default constructor.
+//
+// The users of a TheadLocal instance have to make sure that all but one
+// threads (including the main one) using that instance have exited before
+// destroying it. Otherwise, the per-thread objects managed for them by the
+// ThreadLocal instance are not guaranteed to be destroyed on all platforms.
+//
+// Google Test only uses global ThreadLocal objects.  That means they
+// will die after main() has returned.  Therefore, no per-thread
+// object managed by Google Test will be leaked as long as all threads
+// using Google Test have exited when main() returns.
+template <typename T>
+class ThreadLocal : public ThreadLocalBase {
+ public:
+  ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
+  explicit ThreadLocal(const T& value)
+      : default_factory_(new InstanceValueHolderFactory(value)) {}
+
+  ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
+
+  T* pointer() { return GetOrCreateValue(); }
+  const T* pointer() const { return GetOrCreateValue(); }
+  const T& get() const { return *pointer(); }
+  void set(const T& value) { *pointer() = value; }
+
+ private:
+  // Holds a value of T.  Can be deleted via its base class without the caller
+  // knowing the type of T.
+  class ValueHolder : public ThreadLocalValueHolderBase {
+   public:
+    ValueHolder() : value_() {}
+    explicit ValueHolder(const T& value) : value_(value) {}
+
+    T* pointer() { return &value_; }
+
+   private:
+    T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
+  };
+
+
+  T* GetOrCreateValue() const {
+    return static_cast<ValueHolder*>(
+        ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
+  }
+
+  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
+    return default_factory_->MakeNewHolder();
+  }
+
+  class ValueHolderFactory {
+   public:
+    ValueHolderFactory() {}
+    virtual ~ValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const = 0;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+  };
+
+  class DefaultValueHolderFactory : public ValueHolderFactory {
+   public:
+    DefaultValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+  };
+
+  class InstanceValueHolderFactory : public ValueHolderFactory {
+   public:
+    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+    virtual ValueHolder* MakeNewHolder() const {
+      return new ValueHolder(value_);
+    }
+
+   private:
+    const T value_;  // The value for each thread.
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+  };
+
+  scoped_ptr<ValueHolderFactory> default_factory_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
+};
+
+# elif GTEST_HAS_PTHREAD
+
+// MutexBase and Mutex implement mutex on pthreads-based platforms.
+class MutexBase {
+ public:
+  // Acquires this mutex.
+  void Lock() {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
+    owner_ = pthread_self();
+    has_owner_ = true;
+  }
+
+  // Releases this mutex.
+  void Unlock() {
+    // Since the lock is being released the owner_ field should no longer be
+    // considered valid. We don't protect writing to has_owner_ here, as it's
+    // the caller's responsibility to ensure that the current thread holds the
+    // mutex when this is called.
+    has_owner_ = false;
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
+  }
+
+  // Does nothing if the current thread holds the mutex. Otherwise, crashes
+  // with high probability.
+  void AssertHeld() const {
+    GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
+        << "The current thread is not holding the mutex @" << this;
+  }
+
+  // A static mutex may be used before main() is entered.  It may even
+  // be used before the dynamic initialization stage.  Therefore we
+  // must be able to initialize a static mutex object at link time.
+  // This means MutexBase has to be a POD and its member variables
+  // have to be public.
+ public:
+  pthread_mutex_t mutex_;  // The underlying pthread mutex.
+  // has_owner_ indicates whether the owner_ field below contains a valid thread
+  // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
+  // accesses to the owner_ field should be protected by a check of this field.
+  // An alternative might be to memset() owner_ to all zeros, but there's no
+  // guarantee that a zero'd pthread_t is necessarily invalid or even different
+  // from pthread_self().
+  bool has_owner_;
+  pthread_t owner_;  // The thread holding the mutex.
+};
+
+// Forward-declares a static mutex.
+#  define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+     extern ::testing::internal::MutexBase mutex
+
+// Defines and statically (i.e. at link time) initializes a static mutex.
+#  define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
+
+// The Mutex class can only be used for mutexes created at runtime. It
+// shares its API with MutexBase otherwise.
+class Mutex : public MutexBase {
+ public:
+  Mutex() {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));
+    has_owner_ = false;
+  }
+  ~Mutex() {
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
+};
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(MutexBase* mutex)
+      : mutex_(mutex) { mutex_->Lock(); }
+
+  ~GTestMutexLock() { mutex_->Unlock(); }
+
+ private:
+  MutexBase* const mutex_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
+};
+
+typedef GTestMutexLock MutexLock;
+
+// Helpers for ThreadLocal.
+
+// pthread_key_create() requires DeleteThreadLocalValue() to have
+// C-linkage.  Therefore it cannot be templatized to access
+// ThreadLocal<T>.  Hence the need for class
+// ThreadLocalValueHolderBase.
+class ThreadLocalValueHolderBase {
+ public:
+  virtual ~ThreadLocalValueHolderBase() {}
+};
+
+// Called by pthread to delete thread-local data stored by
+// pthread_setspecific().
+extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
+  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
+}
+
+// Implements thread-local storage on pthreads-based systems.
+template <typename T>
+class ThreadLocal {
+ public:
+  ThreadLocal()
+      : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
+  explicit ThreadLocal(const T& value)
+      : key_(CreateKey()),
+        default_factory_(new InstanceValueHolderFactory(value)) {}
+
+  ~ThreadLocal() {
+    // Destroys the managed object for the current thread, if any.
+    DeleteThreadLocalValue(pthread_getspecific(key_));
+
+    // Releases resources associated with the key.  This will *not*
+    // delete managed objects for other threads.
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
+  }
+
+  T* pointer() { return GetOrCreateValue(); }
+  const T* pointer() const { return GetOrCreateValue(); }
+  const T& get() const { return *pointer(); }
+  void set(const T& value) { *pointer() = value; }
+
+ private:
+  // Holds a value of type T.
+  class ValueHolder : public ThreadLocalValueHolderBase {
+   public:
+    ValueHolder() : value_() {}
+    explicit ValueHolder(const T& value) : value_(value) {}
+
+    T* pointer() { return &value_; }
+
+   private:
+    T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
+  };
+
+  static pthread_key_t CreateKey() {
+    pthread_key_t key;
+    // When a thread exits, DeleteThreadLocalValue() will be called on
+    // the object managed for that thread.
+    GTEST_CHECK_POSIX_SUCCESS_(
+        pthread_key_create(&key, &DeleteThreadLocalValue));
+    return key;
+  }
+
+  T* GetOrCreateValue() const {
+    ThreadLocalValueHolderBase* const holder =
+        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
+    if (holder != NULL) {
+      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
+    }
+
+    ValueHolder* const new_holder = default_factory_->MakeNewHolder();
+    ThreadLocalValueHolderBase* const holder_base = new_holder;
+    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
+    return new_holder->pointer();
+  }
+
+  class ValueHolderFactory {
+   public:
+    ValueHolderFactory() {}
+    virtual ~ValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const = 0;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+  };
+
+  class DefaultValueHolderFactory : public ValueHolderFactory {
+   public:
+    DefaultValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+  };
+
+  class InstanceValueHolderFactory : public ValueHolderFactory {
+   public:
+    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+    virtual ValueHolder* MakeNewHolder() const {
+      return new ValueHolder(value_);
+    }
+
+   private:
+    const T value_;  // The value for each thread.
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+  };
+
+  // A key pthreads uses for looking up per-thread values.
+  const pthread_key_t key_;
+  scoped_ptr<ValueHolderFactory> default_factory_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
+};
+
+# endif  // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+
+#else  // GTEST_IS_THREADSAFE
+
+// A dummy implementation of synchronization primitives (mutex, lock,
+// and thread-local variable).  Necessary for compiling Google Test where
+// mutex is not supported - using Google Test in multiple threads is not
+// supported on such platforms.
+
+class Mutex {
+ public:
+  Mutex() {}
+  void Lock() {}
+  void Unlock() {}
+  void AssertHeld() const {}
+};
+
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+  extern ::testing::internal::Mutex mutex
+
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(Mutex*) {}  // NOLINT
+};
+
+typedef GTestMutexLock MutexLock;
+
+template <typename T>
+class ThreadLocal {
+ public:
+  ThreadLocal() : value_() {}
+  explicit ThreadLocal(const T& value) : value_(value) {}
+  T* pointer() { return &value_; }
+  const T* pointer() const { return &value_; }
+  const T& get() const { return value_; }
+  void set(const T& value) { value_ = value; }
+ private:
+  T value_;
+};
+
+#endif  // GTEST_IS_THREADSAFE
+
+// Returns the number of threads running in the process, or 0 to indicate that
+// we cannot detect it.
+GTEST_API_ size_t GetThreadCount();
+
+// Passing non-POD classes through ellipsis (...) crashes the ARM
+// compiler and generates a warning in Sun Studio.  The Nokia Symbian
+// and the IBM XL C/C++ compiler try to instantiate a copy constructor
+// for objects passed through ellipsis (...), failing for uncopyable
+// objects.  We define this to ensure that only POD is passed through
+// ellipsis on these systems.
+#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
+// We lose support for NULL detection where the compiler doesn't like
+// passing non-POD classes through ellipsis (...).
+# define GTEST_ELLIPSIS_NEEDS_POD_ 1
+#else
+# define GTEST_CAN_COMPARE_NULL 1
+#endif
+
+// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between
+// const T& and const T* in a function template.  These compilers
+// _can_ decide between class template specializations for T and T*,
+// so a tr1::type_traits-like is_pointer works.
+#if defined(__SYMBIAN32__) || defined(__IBMCPP__)
+# define GTEST_NEEDS_IS_POINTER_ 1
+#endif
+
+template <bool bool_value>
+struct bool_constant {
+  typedef bool_constant<bool_value> type;
+  static const bool value = bool_value;
+};
+template <bool bool_value> const bool bool_constant<bool_value>::value;
+
+typedef bool_constant<false> false_type;
+typedef bool_constant<true> true_type;
+
+template <typename T>
+struct is_pointer : public false_type {};
+
+template <typename T>
+struct is_pointer<T*> : public true_type {};
+
+template <typename Iterator>
+struct IteratorTraits {
+  typedef typename Iterator::value_type value_type;
+};
+
+template <typename T>
+struct IteratorTraits<T*> {
+  typedef T value_type;
+};
+
+template <typename T>
+struct IteratorTraits<const T*> {
+  typedef T value_type;
+};
+
+#if GTEST_OS_WINDOWS
+# define GTEST_PATH_SEP_ "\\"
+# define GTEST_HAS_ALT_PATH_SEP_ 1
+// The biggest signed integer type the compiler supports.
+typedef __int64 BiggestInt;
+#else
+# define GTEST_PATH_SEP_ "/"
+# define GTEST_HAS_ALT_PATH_SEP_ 0
+typedef long long BiggestInt;  // NOLINT
+#endif  // GTEST_OS_WINDOWS
+
+// Utilities for char.
+
+// isspace(int ch) and friends accept an unsigned char or EOF.  char
+// may be signed, depending on the compiler (or compiler flags).
+// Therefore we need to cast a char to unsigned char before calling
+// isspace(), etc.
+
+inline bool IsAlpha(char ch) {
+  return isalpha(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsAlNum(char ch) {
+  return isalnum(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsDigit(char ch) {
+  return isdigit(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsLower(char ch) {
+  return islower(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsSpace(char ch) {
+  return isspace(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsUpper(char ch) {
+  return isupper(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsXDigit(char ch) {
+  return isxdigit(static_cast<unsigned char>(ch)) != 0;
+}
+inline bool IsXDigit(wchar_t ch) {
+  const unsigned char low_byte = static_cast<unsigned char>(ch);
+  return ch == low_byte && isxdigit(low_byte) != 0;
+}
+
+inline char ToLower(char ch) {
+  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
+}
+inline char ToUpper(char ch) {
+  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
+}
+
+inline std::string StripTrailingSpaces(std::string str) {
+  std::string::iterator it = str.end();
+  while (it != str.begin() && IsSpace(*--it))
+    it = str.erase(it);
+  return str;
+}
+
+// The testing::internal::posix namespace holds wrappers for common
+// POSIX functions.  These wrappers hide the differences between
+// Windows/MSVC and POSIX systems.  Since some compilers define these
+// standard functions as macros, the wrapper cannot have the same name
+// as the wrapped function.
+
+namespace posix {
+
+// Functions with a different name on Windows.
+
+#if GTEST_OS_WINDOWS
+
+typedef struct _stat StatStruct;
+
+# ifdef __BORLANDC__
+inline int IsATTY(int fd) { return isatty(fd); }
+inline int StrCaseCmp(const char* s1, const char* s2) {
+  return stricmp(s1, s2);
+}
+inline char* StrDup(const char* src) { return strdup(src); }
+# else  // !__BORLANDC__
+#  if GTEST_OS_WINDOWS_MOBILE
+inline int IsATTY(int /* fd */) { return 0; }
+#  else
+inline int IsATTY(int fd) { return _isatty(fd); }
+#  endif  // GTEST_OS_WINDOWS_MOBILE
+inline int StrCaseCmp(const char* s1, const char* s2) {
+  return _stricmp(s1, s2);
+}
+inline char* StrDup(const char* src) { return _strdup(src); }
+# endif  // __BORLANDC__
+
+# if GTEST_OS_WINDOWS_MOBILE
+inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
+// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
+// time and thus not defined there.
+# else
+inline int FileNo(FILE* file) { return _fileno(file); }
+inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
+inline int RmDir(const char* dir) { return _rmdir(dir); }
+inline bool IsDir(const StatStruct& st) {
+  return (_S_IFDIR & st.st_mode) != 0;
+}
+# endif  // GTEST_OS_WINDOWS_MOBILE
+
+#else
+
+typedef struct stat StatStruct;
+
+inline int FileNo(FILE* file) { return fileno(file); }
+inline int IsATTY(int fd) { return isatty(fd); }
+inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
+inline int StrCaseCmp(const char* s1, const char* s2) {
+  return strcasecmp(s1, s2);
+}
+inline char* StrDup(const char* src) { return strdup(src); }
+inline int RmDir(const char* dir) { return rmdir(dir); }
+inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
+
+#endif  // GTEST_OS_WINDOWS
+
+// Functions deprecated by MSVC 8.0.
+
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
+
+inline const char* StrNCpy(char* dest, const char* src, size_t n) {
+  return strncpy(dest, src, n);
+}
+
+// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
+// StrError() aren't needed on Windows CE at this time and thus not
+// defined there.
+
+#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+inline int ChDir(const char* dir) { return chdir(dir); }
+#endif
+inline FILE* FOpen(const char* path, const char* mode) {
+  return fopen(path, mode);
+}
+#if !GTEST_OS_WINDOWS_MOBILE
+inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
+  return freopen(path, mode, stream);
+}
+inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
+#endif
+inline int FClose(FILE* fp) { return fclose(fp); }
+#if !GTEST_OS_WINDOWS_MOBILE
+inline int Read(int fd, void* buf, unsigned int count) {
+  return static_cast<int>(read(fd, buf, count));
+}
+inline int Write(int fd, const void* buf, unsigned int count) {
+  return static_cast<int>(write(fd, buf, count));
+}
+inline int Close(int fd) { return close(fd); }
+inline const char* StrError(int errnum) { return strerror(errnum); }
+#endif
+inline const char* GetEnv(const char* name) {
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
+  // We are on Windows CE, which has no environment variables.
+  static_cast<void>(name);  // To prevent 'unused argument' warning.
+  return NULL;
+#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
+  // Environment variables which we programmatically clear will be set to the
+  // empty string rather than unset (NULL).  Handle that case.
+  const char* const env = getenv(name);
+  return (env != NULL && env[0] != '\0') ? env : NULL;
+#else
+  return getenv(name);
+#endif
+}
+
+GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+#if GTEST_OS_WINDOWS_MOBILE
+// Windows CE has no C library. The abort() function is used in
+// several places in Google Test. This implementation provides a reasonable
+// imitation of standard behaviour.
+void Abort();
+#else
+inline void Abort() { abort(); }
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+}  // namespace posix
+
+// MSVC "deprecates" snprintf and issues warnings wherever it is used.  In
+// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
+// MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate
+// function in order to achieve that.  We use macro definition here because
+// snprintf is a variadic function.
+#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
+// MSVC 2005 and above support variadic macros.
+# define GTEST_SNPRINTF_(buffer, size, format, ...) \
+     _snprintf_s(buffer, size, size, format, __VA_ARGS__)
+#elif defined(_MSC_VER)
+// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't
+// complain about _snprintf.
+# define GTEST_SNPRINTF_ _snprintf
+#else
+# define GTEST_SNPRINTF_ snprintf
+#endif
+
+// The maximum number a BiggestInt can represent.  This definition
+// works no matter BiggestInt is represented in one's complement or
+// two's complement.
+//
+// We cannot rely on numeric_limits in STL, as __int64 and long long
+// are not part of standard C++ and numeric_limits doesn't need to be
+// defined for them.
+const BiggestInt kMaxBiggestInt =
+    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));
+
+// This template class serves as a compile-time function from size to
+// type.  It maps a size in bytes to a primitive type with that
+// size. e.g.
+//
+//   TypeWithSize<4>::UInt
+//
+// is typedef-ed to be unsigned int (unsigned integer made up of 4
+// bytes).
+//
+// Such functionality should belong to STL, but I cannot find it
+// there.
+//
+// Google Test uses this class in the implementation of floating-point
+// comparison.
+//
+// For now it only handles UInt (unsigned int) as that's all Google Test
+// needs.  Other types can be easily added in the future if need
+// arises.
+template <size_t size>
+class TypeWithSize {
+ public:
+  // This prevents the user from using TypeWithSize<N> with incorrect
+  // values of N.
+  typedef void UInt;
+};
+
+// The specialization for size 4.
+template <>
+class TypeWithSize<4> {
+ public:
+  // unsigned int has size 4 in both gcc and MSVC.
+  //
+  // As base/basictypes.h doesn't compile on Windows, we cannot use
+  // uint32, uint64, and etc here.
+  typedef int Int;
+  typedef unsigned int UInt;
+};
+
+// The specialization for size 8.
+template <>
+class TypeWithSize<8> {
+ public:
+#if GTEST_OS_WINDOWS
+  typedef __int64 Int;
+  typedef unsigned __int64 UInt;
+#else
+  typedef long long Int;  // NOLINT
+  typedef unsigned long long UInt;  // NOLINT
+#endif  // GTEST_OS_WINDOWS
+};
+
+// Integer types of known sizes.
+typedef TypeWithSize<4>::Int Int32;
+typedef TypeWithSize<4>::UInt UInt32;
+typedef TypeWithSize<8>::Int Int64;
+typedef TypeWithSize<8>::UInt UInt64;
+typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
+
+// Utilities for command line flags and environment variables.
+
+// Macro for referencing flags.
+#if !defined(GTEST_FLAG)
+# define GTEST_FLAG(name) FLAGS_gtest_##name
+#endif  // !defined(GTEST_FLAG)
+
+#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
+#endif  // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+
+#if !defined(GTEST_DECLARE_bool_)
+# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
+
+// Macros for declaring flags.
+# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
+# define GTEST_DECLARE_int32_(name) \
+    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
+#define GTEST_DECLARE_string_(name) \
+    GTEST_API_ extern ::std::string GTEST_FLAG(name)
+
+// Macros for defining flags.
+#define GTEST_DEFINE_bool_(name, default_val, doc) \
+    GTEST_API_ bool GTEST_FLAG(name) = (default_val)
+#define GTEST_DEFINE_int32_(name, default_val, doc) \
+    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)
+#define GTEST_DEFINE_string_(name, default_val, doc) \
+    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
+
+#endif  // !defined(GTEST_DECLARE_bool_)
+
+// Thread annotations
+#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
+# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+# define GTEST_LOCK_EXCLUDED_(locks)
+#endif  // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
+
+// Parses 'str' for a 32-bit signed integer.  If successful, writes the result
+// to *value and returns true; otherwise leaves *value unchanged and returns
+// false.
+// TODO(chandlerc): Find a better way to refactor flag and environment parsing
+// out of both gtest-port.cc and gtest.cc to avoid exporting this utility
+// function.
+bool ParseInt32(const Message& src_text, const char* str, Int32* value);
+
+// Parses a bool/Int32/string from the environment variable
+// corresponding to the given Google Test flag.
+bool BoolFromGTestEnv(const char* flag, bool default_val);
+GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
+std::string StringFromGTestEnv(const char* flag, const char* default_val);
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-string.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-string.h
new file mode 100644
index 0000000..97f1a7f
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-string.h
@@ -0,0 +1,167 @@
+// Copyright 2005, 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.
+//
+// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee)
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file declares the String class and functions used internally by
+// Google Test.  They are subject to change without notice. They should not used
+// by code external to Google Test.
+//
+// This header file is #included by <gtest/internal/gtest-internal.h>.
+// It should not be #included by other files.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
+
+#ifdef __BORLANDC__
+// string.h is not guaranteed to provide strcpy on C++ Builder.
+# include <mem.h>
+#endif
+
+#include <string.h>
+#include <string>
+
+#include "gtest/internal/gtest-port.h"
+
+namespace testing {
+namespace internal {
+
+// String - an abstract class holding static string utilities.
+class GTEST_API_ String {
+ public:
+  // Static utility methods
+
+  // Clones a 0-terminated C string, allocating memory using new.  The
+  // caller is responsible for deleting the return value using
+  // delete[].  Returns the cloned string, or NULL if the input is
+  // NULL.
+  //
+  // This is different from strdup() in string.h, which allocates
+  // memory using malloc().
+  static const char* CloneCString(const char* c_str);
+
+#if GTEST_OS_WINDOWS_MOBILE
+  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
+  // able to pass strings to Win32 APIs on CE we need to convert them
+  // to 'Unicode', UTF-16.
+
+  // Creates a UTF-16 wide string from the given ANSI string, allocating
+  // memory using new. The caller is responsible for deleting the return
+  // value using delete[]. Returns the wide string, or NULL if the
+  // input is NULL.
+  //
+  // The wide string is created using the ANSI codepage (CP_ACP) to
+  // match the behaviour of the ANSI versions of Win32 calls and the
+  // C runtime.
+  static LPCWSTR AnsiToUtf16(const char* c_str);
+
+  // Creates an ANSI string from the given wide string, allocating
+  // memory using new. The caller is responsible for deleting the return
+  // value using delete[]. Returns the ANSI string, or NULL if the
+  // input is NULL.
+  //
+  // The returned string is created using the ANSI codepage (CP_ACP) to
+  // match the behaviour of the ANSI versions of Win32 calls and the
+  // C runtime.
+  static const char* Utf16ToAnsi(LPCWSTR utf16_str);
+#endif
+
+  // Compares two C strings.  Returns true iff they have the same content.
+  //
+  // Unlike strcmp(), this function can handle NULL argument(s).  A
+  // NULL C string is considered different to any non-NULL C string,
+  // including the empty string.
+  static bool CStringEquals(const char* lhs, const char* rhs);
+
+  // Converts a wide C string to a String using the UTF-8 encoding.
+  // NULL will be converted to "(null)".  If an error occurred during
+  // the conversion, "(failed to convert from wide string)" is
+  // returned.
+  static std::string ShowWideCString(const wchar_t* wide_c_str);
+
+  // Compares two wide C strings.  Returns true iff they have the same
+  // content.
+  //
+  // Unlike wcscmp(), this function can handle NULL argument(s).  A
+  // NULL C string is considered different to any non-NULL C string,
+  // including the empty string.
+  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
+
+  // Compares two C strings, ignoring case.  Returns true iff they
+  // have the same content.
+  //
+  // Unlike strcasecmp(), this function can handle NULL argument(s).
+  // A NULL C string is considered different to any non-NULL C string,
+  // including the empty string.
+  static bool CaseInsensitiveCStringEquals(const char* lhs,
+                                           const char* rhs);
+
+  // Compares two wide C strings, ignoring case.  Returns true iff they
+  // have the same content.
+  //
+  // Unlike wcscasecmp(), this function can handle NULL argument(s).
+  // A NULL C string is considered different to any non-NULL wide C string,
+  // including the empty string.
+  // NB: The implementations on different platforms slightly differ.
+  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
+  // environment variable. On GNU platform this method uses wcscasecmp
+  // which compares according to LC_CTYPE category of the current locale.
+  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
+  // current locale.
+  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
+                                               const wchar_t* rhs);
+
+  // Returns true iff the given string ends with the given suffix, ignoring
+  // case. Any string is considered to end with an empty suffix.
+  static bool EndsWithCaseInsensitive(
+      const std::string& str, const std::string& suffix);
+
+  // Formats an int value as "%02d".
+  static std::string FormatIntWidth2(int value);  // "%02d" for width == 2
+
+  // Formats an int value as "%X".
+  static std::string FormatHexInt(int value);
+
+  // Formats a byte as "%02X".
+  static std::string FormatByte(unsigned char value);
+
+ private:
+  String();  // Not meant to be instantiated.
+};  // class String
+
+// Gets the content of the stringstream's buffer as an std::string.  Each '\0'
+// character in the buffer is replaced with "\\0".
+GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h
new file mode 100644
index 0000000..e9b4053
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h
@@ -0,0 +1,1020 @@
+// This file was GENERATED by command:
+//     pump.py gtest-tuple.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// Copyright 2009 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)
+
+// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+
+#include <utility>  // For ::std::pair.
+
+// The compiler used in Symbian has a bug that prevents us from declaring the
+// tuple template as a friend (it complains that tuple is redefined).  This
+// hack bypasses the bug by declaring the members that should otherwise be
+// private as public.
+// Sun Studio versions < 12 also have the above bug.
+#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
+#else
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
+    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \
+   private:
+#endif
+
+// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
+// with our own definitions. Therefore using our own tuple does not work on
+// those compilers.
+#if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */
+# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
+GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
+#endif
+
+// GTEST_n_TUPLE_(T) is the type of an n-tuple.
+#define GTEST_0_TUPLE_(T) tuple<>
+#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
+    void, void, void>
+#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \
+    void, void, void>
+#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \
+    void, void, void>
+#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \
+    void, void, void>
+#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \
+    void, void, void>
+#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \
+    void, void, void>
+#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    void, void, void>
+#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    T##7, void, void>
+#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    T##7, T##8, void>
+#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \
+    T##7, T##8, T##9>
+
+// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
+#define GTEST_0_TYPENAMES_(T)
+#define GTEST_1_TYPENAMES_(T) typename T##0
+#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1
+#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2
+#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3
+#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4
+#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5
+#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6
+#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
+#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6, \
+    typename T##7, typename T##8
+#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \
+    typename T##3, typename T##4, typename T##5, typename T##6, \
+    typename T##7, typename T##8, typename T##9
+
+// In theory, defining stuff in the ::std namespace is undefined
+// behavior.  We can do this as we are playing the role of a standard
+// library vendor.
+namespace std {
+namespace tr1 {
+
+template <typename T0 = void, typename T1 = void, typename T2 = void,
+    typename T3 = void, typename T4 = void, typename T5 = void,
+    typename T6 = void, typename T7 = void, typename T8 = void,
+    typename T9 = void>
+class tuple;
+
+// Anything in namespace gtest_internal is Google Test's INTERNAL
+// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
+namespace gtest_internal {
+
+// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
+template <typename T>
+struct ByRef { typedef const T& type; };  // NOLINT
+template <typename T>
+struct ByRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for ByRef.
+#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
+
+// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
+// is the same as tr1::add_reference<T>::type.
+template <typename T>
+struct AddRef { typedef T& type; };  // NOLINT
+template <typename T>
+struct AddRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for AddRef.
+#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
+
+// A helper for implementing get<k>().
+template <int k> class Get;
+
+// A helper for implementing tuple_element<k, T>.  kIndexValid is true
+// iff k < the number of fields in tuple type T.
+template <bool kIndexValid, int kIndex, class Tuple>
+struct TupleElement;
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
+  typedef T0 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
+  typedef T1 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
+  typedef T2 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
+  typedef T3 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
+  typedef T4 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
+  typedef T5 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
+  typedef T6 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
+  typedef T7 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
+  typedef T8 type;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
+  typedef T9 type;
+};
+
+}  // namespace gtest_internal
+
+template <>
+class tuple<> {
+ public:
+  tuple() {}
+  tuple(const tuple& /* t */)  {}
+  tuple& operator=(const tuple& /* t */) { return *this; }
+};
+
+template <GTEST_1_TYPENAMES_(T)>
+class GTEST_1_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}
+
+  tuple(const tuple& t) : f0_(t.f0_) {}
+
+  template <GTEST_1_TYPENAMES_(U)>
+  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_1_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_1_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    return *this;
+  }
+
+  T0 f0_;
+};
+
+template <GTEST_2_TYPENAMES_(T)>
+class GTEST_2_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),
+      f1_(f1) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
+
+  template <GTEST_2_TYPENAMES_(U)>
+  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
+  template <typename U0, typename U1>
+  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_2_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+  template <typename U0, typename U1>
+  tuple& operator=(const ::std::pair<U0, U1>& p) {
+    f0_ = p.first;
+    f1_ = p.second;
+    return *this;
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_2_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+};
+
+template <GTEST_3_TYPENAMES_(T)>
+class GTEST_3_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
+
+  template <GTEST_3_TYPENAMES_(U)>
+  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_3_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_3_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+};
+
+template <GTEST_4_TYPENAMES_(T)>
+class GTEST_4_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),
+      f3_(f3) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
+
+  template <GTEST_4_TYPENAMES_(U)>
+  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_4_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_4_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+};
+
+template <GTEST_5_TYPENAMES_(T)>
+class GTEST_5_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,
+      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_) {}
+
+  template <GTEST_5_TYPENAMES_(U)>
+  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_5_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_5_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+};
+
+template <GTEST_6_TYPENAMES_(T)>
+class GTEST_6_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
+      f5_(f5) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_) {}
+
+  template <GTEST_6_TYPENAMES_(U)>
+  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_6_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_6_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+};
+
+template <GTEST_7_TYPENAMES_(T)>
+class GTEST_7_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),
+      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
+
+  template <GTEST_7_TYPENAMES_(U)>
+  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_7_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_7_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+};
+
+template <GTEST_8_TYPENAMES_(T)>
+class GTEST_8_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,
+      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
+      f5_(f5), f6_(f6), f7_(f7) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
+
+  template <GTEST_8_TYPENAMES_(U)>
+  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_8_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_8_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    f7_ = t.f7_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+  T7 f7_;
+};
+
+template <GTEST_9_TYPENAMES_(T)>
+class GTEST_9_TUPLE_(T) {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
+      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),
+      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
+
+  template <GTEST_9_TYPENAMES_(U)>
+  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_9_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_9_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    f7_ = t.f7_;
+    f8_ = t.f8_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+  T7 f7_;
+  T8 f8_;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+class tuple {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),
+      f9_() {}
+
+  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,
+      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,
+      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,
+      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),
+      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}
+
+  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
+      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
+
+  template <GTEST_10_TYPENAMES_(U)>
+  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
+      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
+      f9_(t.f9_) {}
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_10_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_10_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
+    f0_ = t.f0_;
+    f1_ = t.f1_;
+    f2_ = t.f2_;
+    f3_ = t.f3_;
+    f4_ = t.f4_;
+    f5_ = t.f5_;
+    f6_ = t.f6_;
+    f7_ = t.f7_;
+    f8_ = t.f8_;
+    f9_ = t.f9_;
+    return *this;
+  }
+
+  T0 f0_;
+  T1 f1_;
+  T2 f2_;
+  T3 f3_;
+  T4 f4_;
+  T5 f5_;
+  T6 f6_;
+  T7 f7_;
+  T8 f8_;
+  T9 f9_;
+};
+
+// 6.1.3.2 Tuple creation functions.
+
+// Known limitations: we don't support passing an
+// std::tr1::reference_wrapper<T> to make_tuple().  And we don't
+// implement tie().
+
+inline tuple<> make_tuple() { return tuple<>(); }
+
+template <GTEST_1_TYPENAMES_(T)>
+inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
+  return GTEST_1_TUPLE_(T)(f0);
+}
+
+template <GTEST_2_TYPENAMES_(T)>
+inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
+  return GTEST_2_TUPLE_(T)(f0, f1);
+}
+
+template <GTEST_3_TYPENAMES_(T)>
+inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
+  return GTEST_3_TUPLE_(T)(f0, f1, f2);
+}
+
+template <GTEST_4_TYPENAMES_(T)>
+inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3) {
+  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
+}
+
+template <GTEST_5_TYPENAMES_(T)>
+inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4) {
+  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
+}
+
+template <GTEST_6_TYPENAMES_(T)>
+inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5) {
+  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
+}
+
+template <GTEST_7_TYPENAMES_(T)>
+inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {
+  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
+}
+
+template <GTEST_8_TYPENAMES_(T)>
+inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {
+  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
+}
+
+template <GTEST_9_TYPENAMES_(T)>
+inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
+    const T8& f8) {
+  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
+}
+
+template <GTEST_10_TYPENAMES_(T)>
+inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
+    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,
+    const T8& f8, const T9& f9) {
+  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
+}
+
+// 6.1.3.3 Tuple helper classes.
+
+template <typename Tuple> struct tuple_size;
+
+template <GTEST_0_TYPENAMES_(T)>
+struct tuple_size<GTEST_0_TUPLE_(T) > {
+  static const int value = 0;
+};
+
+template <GTEST_1_TYPENAMES_(T)>
+struct tuple_size<GTEST_1_TUPLE_(T) > {
+  static const int value = 1;
+};
+
+template <GTEST_2_TYPENAMES_(T)>
+struct tuple_size<GTEST_2_TUPLE_(T) > {
+  static const int value = 2;
+};
+
+template <GTEST_3_TYPENAMES_(T)>
+struct tuple_size<GTEST_3_TUPLE_(T) > {
+  static const int value = 3;
+};
+
+template <GTEST_4_TYPENAMES_(T)>
+struct tuple_size<GTEST_4_TUPLE_(T) > {
+  static const int value = 4;
+};
+
+template <GTEST_5_TYPENAMES_(T)>
+struct tuple_size<GTEST_5_TUPLE_(T) > {
+  static const int value = 5;
+};
+
+template <GTEST_6_TYPENAMES_(T)>
+struct tuple_size<GTEST_6_TUPLE_(T) > {
+  static const int value = 6;
+};
+
+template <GTEST_7_TYPENAMES_(T)>
+struct tuple_size<GTEST_7_TUPLE_(T) > {
+  static const int value = 7;
+};
+
+template <GTEST_8_TYPENAMES_(T)>
+struct tuple_size<GTEST_8_TUPLE_(T) > {
+  static const int value = 8;
+};
+
+template <GTEST_9_TYPENAMES_(T)>
+struct tuple_size<GTEST_9_TUPLE_(T) > {
+  static const int value = 9;
+};
+
+template <GTEST_10_TYPENAMES_(T)>
+struct tuple_size<GTEST_10_TUPLE_(T) > {
+  static const int value = 10;
+};
+
+template <int k, class Tuple>
+struct tuple_element {
+  typedef typename gtest_internal::TupleElement<
+      k < (tuple_size<Tuple>::value), k, Tuple>::type type;
+};
+
+#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
+
+// 6.1.3.4 Element access.
+
+namespace gtest_internal {
+
+template <>
+class Get<0> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
+  Field(Tuple& t) { return t.f0_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))
+  ConstField(const Tuple& t) { return t.f0_; }
+};
+
+template <>
+class Get<1> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
+  Field(Tuple& t) { return t.f1_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))
+  ConstField(const Tuple& t) { return t.f1_; }
+};
+
+template <>
+class Get<2> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
+  Field(Tuple& t) { return t.f2_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))
+  ConstField(const Tuple& t) { return t.f2_; }
+};
+
+template <>
+class Get<3> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
+  Field(Tuple& t) { return t.f3_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))
+  ConstField(const Tuple& t) { return t.f3_; }
+};
+
+template <>
+class Get<4> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
+  Field(Tuple& t) { return t.f4_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))
+  ConstField(const Tuple& t) { return t.f4_; }
+};
+
+template <>
+class Get<5> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
+  Field(Tuple& t) { return t.f5_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))
+  ConstField(const Tuple& t) { return t.f5_; }
+};
+
+template <>
+class Get<6> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
+  Field(Tuple& t) { return t.f6_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))
+  ConstField(const Tuple& t) { return t.f6_; }
+};
+
+template <>
+class Get<7> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
+  Field(Tuple& t) { return t.f7_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))
+  ConstField(const Tuple& t) { return t.f7_; }
+};
+
+template <>
+class Get<8> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
+  Field(Tuple& t) { return t.f8_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))
+  ConstField(const Tuple& t) { return t.f8_; }
+};
+
+template <>
+class Get<9> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
+  Field(Tuple& t) { return t.f9_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))
+  ConstField(const Tuple& t) { return t.f9_; }
+};
+
+}  // namespace gtest_internal
+
+template <int k, GTEST_10_TYPENAMES_(T)>
+GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
+get(GTEST_10_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::Field(t);
+}
+
+template <int k, GTEST_10_TYPENAMES_(T)>
+GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))
+get(const GTEST_10_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::ConstField(t);
+}
+
+// 6.1.3.5 Relational operators
+
+// We only implement == and !=, as we don't have a need for the rest yet.
+
+namespace gtest_internal {
+
+// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
+// first k fields of t1 equals the first k fields of t2.
+// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
+// k1 != k2.
+template <int kSize1, int kSize2>
+struct SameSizeTuplePrefixComparator;
+
+template <>
+struct SameSizeTuplePrefixComparator<0, 0> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
+    return true;
+  }
+};
+
+template <int k>
+struct SameSizeTuplePrefixComparator<k, k> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& t1, const Tuple2& t2) {
+    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
+        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
+  }
+};
+
+}  // namespace gtest_internal
+
+template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
+inline bool operator==(const GTEST_10_TUPLE_(T)& t,
+                       const GTEST_10_TUPLE_(U)& u) {
+  return gtest_internal::SameSizeTuplePrefixComparator<
+      tuple_size<GTEST_10_TUPLE_(T) >::value,
+      tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
+}
+
+template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
+inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
+                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }
+
+// 6.1.4 Pairs.
+// Unimplemented.
+
+}  // namespace tr1
+}  // namespace std
+
+#undef GTEST_0_TUPLE_
+#undef GTEST_1_TUPLE_
+#undef GTEST_2_TUPLE_
+#undef GTEST_3_TUPLE_
+#undef GTEST_4_TUPLE_
+#undef GTEST_5_TUPLE_
+#undef GTEST_6_TUPLE_
+#undef GTEST_7_TUPLE_
+#undef GTEST_8_TUPLE_
+#undef GTEST_9_TUPLE_
+#undef GTEST_10_TUPLE_
+
+#undef GTEST_0_TYPENAMES_
+#undef GTEST_1_TYPENAMES_
+#undef GTEST_2_TYPENAMES_
+#undef GTEST_3_TYPENAMES_
+#undef GTEST_4_TYPENAMES_
+#undef GTEST_5_TYPENAMES_
+#undef GTEST_6_TYPENAMES_
+#undef GTEST_7_TYPENAMES_
+#undef GTEST_8_TYPENAMES_
+#undef GTEST_9_TYPENAMES_
+#undef GTEST_10_TYPENAMES_
+
+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
+#undef GTEST_BY_REF_
+#undef GTEST_ADD_REF_
+#undef GTEST_TUPLE_ELEMENT_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump
new file mode 100644
index 0000000..429ddfe
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-tuple.h.pump
@@ -0,0 +1,347 @@
+$$ -*- mode: c++; -*-
+$var n = 10  $$ Maximum number of tuple fields we want to support.
+$$ This meta comment fixes auto-indentation in Emacs. }}
+// Copyright 2009 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)
+
+// Implements a subset of TR1 tuple needed by Google Test and Google Mock.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
+
+#include <utility>  // For ::std::pair.
+
+// The compiler used in Symbian has a bug that prevents us from declaring the
+// tuple template as a friend (it complains that tuple is redefined).  This
+// hack bypasses the bug by declaring the members that should otherwise be
+// private as public.
+// Sun Studio versions < 12 also have the above bug.
+#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:
+#else
+# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \
+    template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple; \
+   private:
+#endif
+
+// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
+// with our own definitions. Therefore using our own tuple does not work on
+// those compilers.
+#if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */
+# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
+GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
+#endif
+
+
+$range i 0..n-1
+$range j 0..n
+$range k 1..n
+// GTEST_n_TUPLE_(T) is the type of an n-tuple.
+#define GTEST_0_TUPLE_(T) tuple<>
+
+$for k [[
+$range m 0..k-1
+$range m2 k..n-1
+#define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]>
+
+]]
+
+// GTEST_n_TYPENAMES_(T) declares a list of n typenames.
+
+$for j [[
+$range m 0..j-1
+#define GTEST_$(j)_TYPENAMES_(T) $for m, [[typename T##$m]]
+
+
+]]
+
+// In theory, defining stuff in the ::std namespace is undefined
+// behavior.  We can do this as we are playing the role of a standard
+// library vendor.
+namespace std {
+namespace tr1 {
+
+template <$for i, [[typename T$i = void]]>
+class tuple;
+
+// Anything in namespace gtest_internal is Google Test's INTERNAL
+// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.
+namespace gtest_internal {
+
+// ByRef<T>::type is T if T is a reference; otherwise it's const T&.
+template <typename T>
+struct ByRef { typedef const T& type; };  // NOLINT
+template <typename T>
+struct ByRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for ByRef.
+#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
+
+// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This
+// is the same as tr1::add_reference<T>::type.
+template <typename T>
+struct AddRef { typedef T& type; };  // NOLINT
+template <typename T>
+struct AddRef<T&> { typedef T& type; };  // NOLINT
+
+// A handy wrapper for AddRef.
+#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
+
+// A helper for implementing get<k>().
+template <int k> class Get;
+
+// A helper for implementing tuple_element<k, T>.  kIndexValid is true
+// iff k < the number of fields in tuple type T.
+template <bool kIndexValid, int kIndex, class Tuple>
+struct TupleElement;
+
+
+$for i [[
+template <GTEST_$(n)_TYPENAMES_(T)>
+struct TupleElement<true, $i, GTEST_$(n)_TUPLE_(T) > {
+  typedef T$i type;
+};
+
+
+]]
+}  // namespace gtest_internal
+
+template <>
+class tuple<> {
+ public:
+  tuple() {}
+  tuple(const tuple& /* t */)  {}
+  tuple& operator=(const tuple& /* t */) { return *this; }
+};
+
+
+$for k [[
+$range m 0..k-1
+template <GTEST_$(k)_TYPENAMES_(T)>
+class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] {
+ public:
+  template <int k> friend class gtest_internal::Get;
+
+  tuple() : $for m, [[f$(m)_()]] {}
+
+  explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]]
+$for m, [[f$(m)_(f$m)]] {}
+
+  tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
+
+  template <GTEST_$(k)_TYPENAMES_(U)>
+  tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
+
+$if k == 2 [[
+  template <typename U0, typename U1>
+  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
+
+]]
+
+  tuple& operator=(const tuple& t) { return CopyFrom(t); }
+
+  template <GTEST_$(k)_TYPENAMES_(U)>
+  tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) {
+    return CopyFrom(t);
+  }
+
+$if k == 2 [[
+  template <typename U0, typename U1>
+  tuple& operator=(const ::std::pair<U0, U1>& p) {
+    f0_ = p.first;
+    f1_ = p.second;
+    return *this;
+  }
+
+]]
+
+  GTEST_DECLARE_TUPLE_AS_FRIEND_
+
+  template <GTEST_$(k)_TYPENAMES_(U)>
+  tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) {
+
+$for m [[
+    f$(m)_ = t.f$(m)_;
+
+]]
+    return *this;
+  }
+
+
+$for m [[
+  T$m f$(m)_;
+
+]]
+};
+
+
+]]
+// 6.1.3.2 Tuple creation functions.
+
+// Known limitations: we don't support passing an
+// std::tr1::reference_wrapper<T> to make_tuple().  And we don't
+// implement tie().
+
+inline tuple<> make_tuple() { return tuple<>(); }
+
+$for k [[
+$range m 0..k-1
+
+template <GTEST_$(k)_TYPENAMES_(T)>
+inline GTEST_$(k)_TUPLE_(T) make_tuple($for m, [[const T$m& f$m]]) {
+  return GTEST_$(k)_TUPLE_(T)($for m, [[f$m]]);
+}
+
+]]
+
+// 6.1.3.3 Tuple helper classes.
+
+template <typename Tuple> struct tuple_size;
+
+
+$for j [[
+template <GTEST_$(j)_TYPENAMES_(T)>
+struct tuple_size<GTEST_$(j)_TUPLE_(T) > {
+  static const int value = $j;
+};
+
+
+]]
+template <int k, class Tuple>
+struct tuple_element {
+  typedef typename gtest_internal::TupleElement<
+      k < (tuple_size<Tuple>::value), k, Tuple>::type type;
+};
+
+#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
+
+// 6.1.3.4 Element access.
+
+namespace gtest_internal {
+
+
+$for i [[
+template <>
+class Get<$i> {
+ public:
+  template <class Tuple>
+  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
+  Field(Tuple& t) { return t.f$(i)_; }  // NOLINT
+
+  template <class Tuple>
+  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
+  ConstField(const Tuple& t) { return t.f$(i)_; }
+};
+
+
+]]
+}  // namespace gtest_internal
+
+template <int k, GTEST_$(n)_TYPENAMES_(T)>
+GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_$(n)_TUPLE_(T)))
+get(GTEST_$(n)_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::Field(t);
+}
+
+template <int k, GTEST_$(n)_TYPENAMES_(T)>
+GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_$(n)_TUPLE_(T)))
+get(const GTEST_$(n)_TUPLE_(T)& t) {
+  return gtest_internal::Get<k>::ConstField(t);
+}
+
+// 6.1.3.5 Relational operators
+
+// We only implement == and !=, as we don't have a need for the rest yet.
+
+namespace gtest_internal {
+
+// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the
+// first k fields of t1 equals the first k fields of t2.
+// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if
+// k1 != k2.
+template <int kSize1, int kSize2>
+struct SameSizeTuplePrefixComparator;
+
+template <>
+struct SameSizeTuplePrefixComparator<0, 0> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {
+    return true;
+  }
+};
+
+template <int k>
+struct SameSizeTuplePrefixComparator<k, k> {
+  template <class Tuple1, class Tuple2>
+  static bool Eq(const Tuple1& t1, const Tuple2& t2) {
+    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&
+        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);
+  }
+};
+
+}  // namespace gtest_internal
+
+template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>
+inline bool operator==(const GTEST_$(n)_TUPLE_(T)& t,
+                       const GTEST_$(n)_TUPLE_(U)& u) {
+  return gtest_internal::SameSizeTuplePrefixComparator<
+      tuple_size<GTEST_$(n)_TUPLE_(T) >::value,
+      tuple_size<GTEST_$(n)_TUPLE_(U) >::value>::Eq(t, u);
+}
+
+template <GTEST_$(n)_TYPENAMES_(T), GTEST_$(n)_TYPENAMES_(U)>
+inline bool operator!=(const GTEST_$(n)_TUPLE_(T)& t,
+                       const GTEST_$(n)_TUPLE_(U)& u) { return !(t == u); }
+
+// 6.1.4 Pairs.
+// Unimplemented.
+
+}  // namespace tr1
+}  // namespace std
+
+
+$for j [[
+#undef GTEST_$(j)_TUPLE_
+
+]]
+
+
+$for j [[
+#undef GTEST_$(j)_TYPENAMES_
+
+]]
+
+#undef GTEST_DECLARE_TUPLE_AS_FRIEND_
+#undef GTEST_BY_REF_
+#undef GTEST_ADD_REF_
+#undef GTEST_TUPLE_ELEMENT_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h
new file mode 100644
index 0000000..e46f7cf
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h
@@ -0,0 +1,3331 @@
+// This file was GENERATED by command:
+//     pump.py gtest-type-util.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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: wan@google.com (Zhanyong Wan)
+
+// Type utilities needed for implementing typed and type-parameterized
+// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently we support at most 50 types in a list, and at most 50
+// type-parameterized tests in one type-parameterized test case.
+// Please contact googletestframework@googlegroups.com if you need
+// more.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+
+#include "gtest/internal/gtest-port.h"
+
+// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
+// libstdc++ (which is where cxxabi.h comes from).
+# if GTEST_HAS_CXXABI_H_
+#  include <cxxabi.h>
+# elif defined(__HP_aCC)
+#  include <acxx_demangle.h>
+# endif  // GTEST_HASH_CXXABI_H_
+
+namespace testing {
+namespace internal {
+
+// GetTypeName<T>() returns a human-readable name of type T.
+// NB: This function is also used in Google Mock, so don't move it inside of
+// the typed-test-only section below.
+template <typename T>
+std::string GetTypeName() {
+# if GTEST_HAS_RTTI
+
+  const char* const name = typeid(T).name();
+#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
+  int status = 0;
+  // gcc's implementation of typeid(T).name() mangles the type name,
+  // so we have to demangle it.
+#   if GTEST_HAS_CXXABI_H_
+  using abi::__cxa_demangle;
+#   endif  // GTEST_HAS_CXXABI_H_
+  char* const readable_name = __cxa_demangle(name, 0, 0, &status);
+  const std::string name_str(status == 0 ? readable_name : name);
+  free(readable_name);
+  return name_str;
+#  else
+  return name;
+#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
+
+# else
+
+  return "<type>";
+
+# endif  // GTEST_HAS_RTTI
+}
+
+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
+// type.  This can be used as a compile-time assertion to ensure that
+// two types are equal.
+
+template <typename T1, typename T2>
+struct AssertTypeEq;
+
+template <typename T>
+struct AssertTypeEq<T, T> {
+  typedef bool type;
+};
+
+// A unique type used as the default value for the arguments of class
+// template Types.  This allows us to simulate variadic templates
+// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
+// support directly.
+struct None {};
+
+// The following family of struct and struct templates are used to
+// represent type lists.  In particular, TypesN<T1, T2, ..., TN>
+// represents a type list with N types (T1, T2, ..., and TN) in it.
+// Except for Types0, every struct in the family has two member types:
+// Head for the first type in the list, and Tail for the rest of the
+// list.
+
+// The empty type list.
+struct Types0 {};
+
+// Type lists of length 1, 2, 3, and so on.
+
+template <typename T1>
+struct Types1 {
+  typedef T1 Head;
+  typedef Types0 Tail;
+};
+template <typename T1, typename T2>
+struct Types2 {
+  typedef T1 Head;
+  typedef Types1<T2> Tail;
+};
+
+template <typename T1, typename T2, typename T3>
+struct Types3 {
+  typedef T1 Head;
+  typedef Types2<T2, T3> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4>
+struct Types4 {
+  typedef T1 Head;
+  typedef Types3<T2, T3, T4> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+struct Types5 {
+  typedef T1 Head;
+  typedef Types4<T2, T3, T4, T5> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+struct Types6 {
+  typedef T1 Head;
+  typedef Types5<T2, T3, T4, T5, T6> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+struct Types7 {
+  typedef T1 Head;
+  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+struct Types8 {
+  typedef T1 Head;
+  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+struct Types9 {
+  typedef T1 Head;
+  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+struct Types10 {
+  typedef T1 Head;
+  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+struct Types11 {
+  typedef T1 Head;
+  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+struct Types12 {
+  typedef T1 Head;
+  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+struct Types13 {
+  typedef T1 Head;
+  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+struct Types14 {
+  typedef T1 Head;
+  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+struct Types15 {
+  typedef T1 Head;
+  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+struct Types16 {
+  typedef T1 Head;
+  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+struct Types17 {
+  typedef T1 Head;
+  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+struct Types18 {
+  typedef T1 Head;
+  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+struct Types19 {
+  typedef T1 Head;
+  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+struct Types20 {
+  typedef T1 Head;
+  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+struct Types21 {
+  typedef T1 Head;
+  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+struct Types22 {
+  typedef T1 Head;
+  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+struct Types23 {
+  typedef T1 Head;
+  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+struct Types24 {
+  typedef T1 Head;
+  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+struct Types25 {
+  typedef T1 Head;
+  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+struct Types26 {
+  typedef T1 Head;
+  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+struct Types27 {
+  typedef T1 Head;
+  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+struct Types28 {
+  typedef T1 Head;
+  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+struct Types29 {
+  typedef T1 Head;
+  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+struct Types30 {
+  typedef T1 Head;
+  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+struct Types31 {
+  typedef T1 Head;
+  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+struct Types32 {
+  typedef T1 Head;
+  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+struct Types33 {
+  typedef T1 Head;
+  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+struct Types34 {
+  typedef T1 Head;
+  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+struct Types35 {
+  typedef T1 Head;
+  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+struct Types36 {
+  typedef T1 Head;
+  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+struct Types37 {
+  typedef T1 Head;
+  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+struct Types38 {
+  typedef T1 Head;
+  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+struct Types39 {
+  typedef T1 Head;
+  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+struct Types40 {
+  typedef T1 Head;
+  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+struct Types41 {
+  typedef T1 Head;
+  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+struct Types42 {
+  typedef T1 Head;
+  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+struct Types43 {
+  typedef T1 Head;
+  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+struct Types44 {
+  typedef T1 Head;
+  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+struct Types45 {
+  typedef T1 Head;
+  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+struct Types46 {
+  typedef T1 Head;
+  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+struct Types47 {
+  typedef T1 Head;
+  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+struct Types48 {
+  typedef T1 Head;
+  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47, T48> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+struct Types49 {
+  typedef T1 Head;
+  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47, T48, T49> Tail;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+struct Types50 {
+  typedef T1 Head;
+  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+      T44, T45, T46, T47, T48, T49, T50> Tail;
+};
+
+
+}  // namespace internal
+
+// We don't want to require the users to write TypesN<...> directly,
+// as that would require them to count the length.  Types<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Types<int>
+// will appear as Types<int, None, None, ..., None> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Types<T1, ..., TN>, and Google Test will translate
+// that to TypesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Types template.
+template <typename T1 = internal::None, typename T2 = internal::None,
+    typename T3 = internal::None, typename T4 = internal::None,
+    typename T5 = internal::None, typename T6 = internal::None,
+    typename T7 = internal::None, typename T8 = internal::None,
+    typename T9 = internal::None, typename T10 = internal::None,
+    typename T11 = internal::None, typename T12 = internal::None,
+    typename T13 = internal::None, typename T14 = internal::None,
+    typename T15 = internal::None, typename T16 = internal::None,
+    typename T17 = internal::None, typename T18 = internal::None,
+    typename T19 = internal::None, typename T20 = internal::None,
+    typename T21 = internal::None, typename T22 = internal::None,
+    typename T23 = internal::None, typename T24 = internal::None,
+    typename T25 = internal::None, typename T26 = internal::None,
+    typename T27 = internal::None, typename T28 = internal::None,
+    typename T29 = internal::None, typename T30 = internal::None,
+    typename T31 = internal::None, typename T32 = internal::None,
+    typename T33 = internal::None, typename T34 = internal::None,
+    typename T35 = internal::None, typename T36 = internal::None,
+    typename T37 = internal::None, typename T38 = internal::None,
+    typename T39 = internal::None, typename T40 = internal::None,
+    typename T41 = internal::None, typename T42 = internal::None,
+    typename T43 = internal::None, typename T44 = internal::None,
+    typename T45 = internal::None, typename T46 = internal::None,
+    typename T47 = internal::None, typename T48 = internal::None,
+    typename T49 = internal::None, typename T50 = internal::None>
+struct Types {
+  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
+};
+
+template <>
+struct Types<internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types0 type;
+};
+template <typename T1>
+struct Types<T1, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types1<T1> type;
+};
+template <typename T1, typename T2>
+struct Types<T1, T2, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types2<T1, T2> type;
+};
+template <typename T1, typename T2, typename T3>
+struct Types<T1, T2, T3, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types3<T1, T2, T3> type;
+};
+template <typename T1, typename T2, typename T3, typename T4>
+struct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types4<T1, T2, T3, T4> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+struct Types<T1, T2, T3, T4, T5, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types5<T1, T2, T3, T4, T5> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+struct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+struct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
+      T12> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,
+      T26> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,
+      T40> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None, internal::None> {
+  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None, internal::None> {
+  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    internal::None, internal::None, internal::None, internal::None,
+    internal::None> {
+  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, internal::None, internal::None, internal::None, internal::None> {
+  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, T47, internal::None, internal::None, internal::None> {
+  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, T47, T48, internal::None, internal::None> {
+  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48> type;
+};
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49>
+struct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
+    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,
+    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,
+    T46, T47, T48, T49, internal::None> {
+  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;
+};
+
+namespace internal {
+
+# define GTEST_TEMPLATE_ template <typename T> class
+
+// The template "selector" struct TemplateSel<Tmpl> is used to
+// represent Tmpl, which must be a class template with one type
+// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
+// as the type Tmpl<T>.  This allows us to actually instantiate the
+// template "selected" by TemplateSel<Tmpl>.
+//
+// This trick is necessary for simulating typedef for class templates,
+// which C++ doesn't support directly.
+template <GTEST_TEMPLATE_ Tmpl>
+struct TemplateSel {
+  template <typename T>
+  struct Bind {
+    typedef Tmpl<T> type;
+  };
+};
+
+# define GTEST_BIND_(TmplSel, T) \
+  TmplSel::template Bind<T>::type
+
+// A unique struct template used as the default value for the
+// arguments of class template Templates.  This allows us to simulate
+// variadic templates (e.g. Templates<int>, Templates<int, double>,
+// and etc), which C++ doesn't support directly.
+template <typename T>
+struct NoneT {};
+
+// The following family of struct and struct templates are used to
+// represent template lists.  In particular, TemplatesN<T1, T2, ...,
+// TN> represents a list of N templates (T1, T2, ..., and TN).  Except
+// for Templates0, every struct in the family has two member types:
+// Head for the selector of the first template in the list, and Tail
+// for the rest of the list.
+
+// The empty template list.
+struct Templates0 {};
+
+// Template lists of length 1, 2, 3, and so on.
+
+template <GTEST_TEMPLATE_ T1>
+struct Templates1 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates0 Tail;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
+struct Templates2 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates1<T2> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
+struct Templates3 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates2<T2, T3> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4>
+struct Templates4 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates3<T2, T3, T4> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
+struct Templates5 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates4<T2, T3, T4, T5> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
+struct Templates6 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates5<T2, T3, T4, T5, T6> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7>
+struct Templates7 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
+struct Templates8 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
+struct Templates9 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10>
+struct Templates10 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
+struct Templates11 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
+struct Templates12 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13>
+struct Templates13 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
+struct Templates14 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
+struct Templates15 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16>
+struct Templates16 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
+struct Templates17 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
+struct Templates18 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19>
+struct Templates19 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
+struct Templates20 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
+struct Templates21 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22>
+struct Templates22 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
+struct Templates23 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
+struct Templates24 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25>
+struct Templates25 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
+struct Templates26 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
+struct Templates27 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28>
+struct Templates28 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
+struct Templates29 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
+struct Templates30 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31>
+struct Templates31 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
+struct Templates32 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
+struct Templates33 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34>
+struct Templates34 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
+struct Templates35 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
+struct Templates36 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37>
+struct Templates37 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
+struct Templates38 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
+struct Templates39 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40>
+struct Templates40 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
+struct Templates41 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
+struct Templates42 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43>
+struct Templates43 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
+struct Templates44 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
+struct Templates45 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46>
+struct Templates46 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
+struct Templates47 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
+struct Templates48 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47, T48> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
+    GTEST_TEMPLATE_ T49>
+struct Templates49 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47, T48, T49> Tail;
+};
+
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
+    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>
+struct Templates50 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,
+      T43, T44, T45, T46, T47, T48, T49, T50> Tail;
+};
+
+
+// We don't want to require the users to write TemplatesN<...> directly,
+// as that would require them to count the length.  Templates<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Templates<list>
+// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Templates<T1, ..., TN>, and Google Test will translate
+// that to TemplatesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Templates template.
+template <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,
+    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,
+    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,
+    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,
+    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,
+    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,
+    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,
+    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,
+    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,
+    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,
+    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,
+    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,
+    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,
+    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,
+    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,
+    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,
+    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,
+    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,
+    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,
+    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,
+    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,
+    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,
+    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,
+    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,
+    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>
+struct Templates {
+  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;
+};
+
+template <>
+struct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates0 type;
+};
+template <GTEST_TEMPLATE_ T1>
+struct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates1<T1> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>
+struct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates2<T1, T2> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>
+struct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates3<T1, T2, T3> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4>
+struct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates4<T1, T2, T3, T4> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>
+struct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates5<T1, T2, T3, T4, T5> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>
+struct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates6<T1, T2, T3, T4, T5, T6> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT> {
+  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT> {
+  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT> {
+  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT> {
+  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT> {
+  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, NoneT, NoneT, NoneT, NoneT> {
+  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, T47, NoneT, NoneT, NoneT> {
+  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, T47, T48, NoneT, NoneT> {
+  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47, T48> type;
+};
+template <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,
+    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,
+    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,
+    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,
+    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,
+    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,
+    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,
+    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,
+    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,
+    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,
+    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,
+    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,
+    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,
+    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,
+    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,
+    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,
+    GTEST_TEMPLATE_ T49>
+struct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
+    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,
+    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,
+    T45, T46, T47, T48, T49, NoneT> {
+  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,
+      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,
+      T42, T43, T44, T45, T46, T47, T48, T49> type;
+};
+
+// The TypeList template makes it possible to use either a single type
+// or a Types<...> list in TYPED_TEST_CASE() and
+// INSTANTIATE_TYPED_TEST_CASE_P().
+
+template <typename T>
+struct TypeList {
+  typedef Types1<T> type;
+};
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10,
+    typename T11, typename T12, typename T13, typename T14, typename T15,
+    typename T16, typename T17, typename T18, typename T19, typename T20,
+    typename T21, typename T22, typename T23, typename T24, typename T25,
+    typename T26, typename T27, typename T28, typename T29, typename T30,
+    typename T31, typename T32, typename T33, typename T34, typename T35,
+    typename T36, typename T37, typename T38, typename T39, typename T40,
+    typename T41, typename T42, typename T43, typename T44, typename T45,
+    typename T46, typename T47, typename T48, typename T49, typename T50>
+struct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
+    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,
+    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,
+    T44, T45, T46, T47, T48, T49, T50> > {
+  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
+      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,
+      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,
+      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;
+};
+
+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump
new file mode 100644
index 0000000..251fdf0
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/include/gtest/internal/gtest-type-util.h.pump
@@ -0,0 +1,297 @@
+$$ -*- mode: c++; -*-
+$var n = 50  $$ Maximum length of type lists we want to support.
+// 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: wan@google.com (Zhanyong Wan)
+
+// Type utilities needed for implementing typed and type-parameterized
+// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!
+//
+// Currently we support at most $n types in a list, and at most $n
+// type-parameterized tests in one type-parameterized test case.
+// Please contact googletestframework@googlegroups.com if you need
+// more.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
+
+#include "gtest/internal/gtest-port.h"
+
+// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using
+// libstdc++ (which is where cxxabi.h comes from).
+# if GTEST_HAS_CXXABI_H_
+#  include <cxxabi.h>
+# elif defined(__HP_aCC)
+#  include <acxx_demangle.h>
+# endif  // GTEST_HASH_CXXABI_H_
+
+namespace testing {
+namespace internal {
+
+// GetTypeName<T>() returns a human-readable name of type T.
+// NB: This function is also used in Google Mock, so don't move it inside of
+// the typed-test-only section below.
+template <typename T>
+std::string GetTypeName() {
+# if GTEST_HAS_RTTI
+
+  const char* const name = typeid(T).name();
+#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
+  int status = 0;
+  // gcc's implementation of typeid(T).name() mangles the type name,
+  // so we have to demangle it.
+#   if GTEST_HAS_CXXABI_H_
+  using abi::__cxa_demangle;
+#   endif  // GTEST_HAS_CXXABI_H_
+  char* const readable_name = __cxa_demangle(name, 0, 0, &status);
+  const std::string name_str(status == 0 ? readable_name : name);
+  free(readable_name);
+  return name_str;
+#  else
+  return name;
+#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC
+
+# else
+
+  return "<type>";
+
+# endif  // GTEST_HAS_RTTI
+}
+
+#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same
+// type.  This can be used as a compile-time assertion to ensure that
+// two types are equal.
+
+template <typename T1, typename T2>
+struct AssertTypeEq;
+
+template <typename T>
+struct AssertTypeEq<T, T> {
+  typedef bool type;
+};
+
+// A unique type used as the default value for the arguments of class
+// template Types.  This allows us to simulate variadic templates
+// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't
+// support directly.
+struct None {};
+
+// The following family of struct and struct templates are used to
+// represent type lists.  In particular, TypesN<T1, T2, ..., TN>
+// represents a type list with N types (T1, T2, ..., and TN) in it.
+// Except for Types0, every struct in the family has two member types:
+// Head for the first type in the list, and Tail for the rest of the
+// list.
+
+// The empty type list.
+struct Types0 {};
+
+// Type lists of length 1, 2, 3, and so on.
+
+template <typename T1>
+struct Types1 {
+  typedef T1 Head;
+  typedef Types0 Tail;
+};
+
+$range i 2..n
+
+$for i [[
+$range j 1..i
+$range k 2..i
+template <$for j, [[typename T$j]]>
+struct Types$i {
+  typedef T1 Head;
+  typedef Types$(i-1)<$for k, [[T$k]]> Tail;
+};
+
+
+]]
+
+}  // namespace internal
+
+// We don't want to require the users to write TypesN<...> directly,
+// as that would require them to count the length.  Types<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Types<int>
+// will appear as Types<int, None, None, ..., None> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Types<T1, ..., TN>, and Google Test will translate
+// that to TypesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Types template.
+
+$range i 1..n
+template <$for i, [[typename T$i = internal::None]]>
+struct Types {
+  typedef internal::Types$n<$for i, [[T$i]]> type;
+};
+
+template <>
+struct Types<$for i, [[internal::None]]> {
+  typedef internal::Types0 type;
+};
+
+$range i 1..n-1
+$for i [[
+$range j 1..i
+$range k i+1..n
+template <$for j, [[typename T$j]]>
+struct Types<$for j, [[T$j]]$for k[[, internal::None]]> {
+  typedef internal::Types$i<$for j, [[T$j]]> type;
+};
+
+]]
+
+namespace internal {
+
+# define GTEST_TEMPLATE_ template <typename T> class
+
+// The template "selector" struct TemplateSel<Tmpl> is used to
+// represent Tmpl, which must be a class template with one type
+// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined
+// as the type Tmpl<T>.  This allows us to actually instantiate the
+// template "selected" by TemplateSel<Tmpl>.
+//
+// This trick is necessary for simulating typedef for class templates,
+// which C++ doesn't support directly.
+template <GTEST_TEMPLATE_ Tmpl>
+struct TemplateSel {
+  template <typename T>
+  struct Bind {
+    typedef Tmpl<T> type;
+  };
+};
+
+# define GTEST_BIND_(TmplSel, T) \
+  TmplSel::template Bind<T>::type
+
+// A unique struct template used as the default value for the
+// arguments of class template Templates.  This allows us to simulate
+// variadic templates (e.g. Templates<int>, Templates<int, double>,
+// and etc), which C++ doesn't support directly.
+template <typename T>
+struct NoneT {};
+
+// The following family of struct and struct templates are used to
+// represent template lists.  In particular, TemplatesN<T1, T2, ...,
+// TN> represents a list of N templates (T1, T2, ..., and TN).  Except
+// for Templates0, every struct in the family has two member types:
+// Head for the selector of the first template in the list, and Tail
+// for the rest of the list.
+
+// The empty template list.
+struct Templates0 {};
+
+// Template lists of length 1, 2, 3, and so on.
+
+template <GTEST_TEMPLATE_ T1>
+struct Templates1 {
+  typedef TemplateSel<T1> Head;
+  typedef Templates0 Tail;
+};
+
+$range i 2..n
+
+$for i [[
+$range j 1..i
+$range k 2..i
+template <$for j, [[GTEST_TEMPLATE_ T$j]]>
+struct Templates$i {
+  typedef TemplateSel<T1> Head;
+  typedef Templates$(i-1)<$for k, [[T$k]]> Tail;
+};
+
+
+]]
+
+// We don't want to require the users to write TemplatesN<...> directly,
+// as that would require them to count the length.  Templates<...> is much
+// easier to write, but generates horrible messages when there is a
+// compiler error, as gcc insists on printing out each template
+// argument, even if it has the default value (this means Templates<list>
+// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler
+// errors).
+//
+// Our solution is to combine the best part of the two approaches: a
+// user would write Templates<T1, ..., TN>, and Google Test will translate
+// that to TemplatesN<T1, ..., TN> internally to make error messages
+// readable.  The translation is done by the 'type' member of the
+// Templates template.
+
+$range i 1..n
+template <$for i, [[GTEST_TEMPLATE_ T$i = NoneT]]>
+struct Templates {
+  typedef Templates$n<$for i, [[T$i]]> type;
+};
+
+template <>
+struct Templates<$for i, [[NoneT]]> {
+  typedef Templates0 type;
+};
+
+$range i 1..n-1
+$for i [[
+$range j 1..i
+$range k i+1..n
+template <$for j, [[GTEST_TEMPLATE_ T$j]]>
+struct Templates<$for j, [[T$j]]$for k[[, NoneT]]> {
+  typedef Templates$i<$for j, [[T$j]]> type;
+};
+
+]]
+
+// The TypeList template makes it possible to use either a single type
+// or a Types<...> list in TYPED_TEST_CASE() and
+// INSTANTIATE_TYPED_TEST_CASE_P().
+
+template <typename T>
+struct TypeList {
+  typedef Types1<T> type;
+};
+
+
+$range i 1..n
+template <$for i, [[typename T$i]]>
+struct TypeList<Types<$for i, [[T$i]]> > {
+  typedef typename Types<$for i, [[T$i]]>::type type;
+};
+
+#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-all.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-all.cc
new file mode 100644
index 0000000..0a9cee5
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-all.cc
@@ -0,0 +1,48 @@
+// 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: mheule@google.com (Markus Heule)
+//
+// Google C++ Testing Framework (Google Test)
+//
+// Sometimes it's desirable to build Google Test by compiling a single file.
+// This file serves this purpose.
+
+// This line ensures that gtest.h can be compiled on its own, even
+// when it's fused.
+#include "gtest/gtest.h"
+
+// The following lines pull in the real gtest *.cc files.
+#include "src/gtest.cc"
+#include "src/gtest-death-test.cc"
+#include "src/gtest-filepath.cc"
+#include "src/gtest-port.cc"
+#include "src/gtest-printers.cc"
+#include "src/gtest-test-part.cc"
+#include "src/gtest-typed-test.cc"
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-death-test.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-death-test.cc
new file mode 100644
index 0000000..a01a369
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-death-test.cc
@@ -0,0 +1,1342 @@
+// Copyright 2005, 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), vladl@google.com (Vlad Losev)
+//
+// This file implements death tests.
+
+#include "gtest/gtest-death-test.h"
+#include "gtest/internal/gtest-port.h"
+#include "gtest/internal/custom/gtest.h"
+
+#if GTEST_HAS_DEATH_TEST
+
+# if GTEST_OS_MAC
+#  include <crt_externs.h>
+# endif  // GTEST_OS_MAC
+
+# include <errno.h>
+# include <fcntl.h>
+# include <limits.h>
+
+# if GTEST_OS_LINUX
+#  include <signal.h>
+# endif  // GTEST_OS_LINUX
+
+# include <stdarg.h>
+
+# if GTEST_OS_WINDOWS
+#  include <windows.h>
+# else
+#  include <sys/mman.h>
+#  include <sys/wait.h>
+# endif  // GTEST_OS_WINDOWS
+
+# if GTEST_OS_QNX
+#  include <spawn.h>
+# endif  // GTEST_OS_QNX
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-string.h"
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+namespace testing {
+
+// Constants.
+
+// The default death test style.
+static const char kDefaultDeathTestStyle[] = "fast";
+
+GTEST_DEFINE_string_(
+    death_test_style,
+    internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle),
+    "Indicates how to run a death test in a forked child process: "
+    "\"threadsafe\" (child process re-executes the test binary "
+    "from the beginning, running only the specific death test) or "
+    "\"fast\" (child process runs the death test immediately "
+    "after forking).");
+
+GTEST_DEFINE_bool_(
+    death_test_use_fork,
+    internal::BoolFromGTestEnv("death_test_use_fork", false),
+    "Instructs to use fork()/_exit() instead of clone() in death tests. "
+    "Ignored and always uses fork() on POSIX systems where clone() is not "
+    "implemented. Useful when running under valgrind or similar tools if "
+    "those do not support clone(). Valgrind 3.3.1 will just fail if "
+    "it sees an unsupported combination of clone() flags. "
+    "It is not recommended to use this flag w/o valgrind though it will "
+    "work in 99% of the cases. Once valgrind is fixed, this flag will "
+    "most likely be removed.");
+
+namespace internal {
+GTEST_DEFINE_string_(
+    internal_run_death_test, "",
+    "Indicates the file, line number, temporal index of "
+    "the single death test to run, and a file descriptor to "
+    "which a success code may be sent, all separated by "
+    "the '|' characters.  This flag is specified if and only if the current "
+    "process is a sub-process launched for running a thread-safe "
+    "death test.  FOR INTERNAL USE ONLY.");
+}  // namespace internal
+
+#if GTEST_HAS_DEATH_TEST
+
+namespace internal {
+
+// Valid only for fast death tests. Indicates the code is running in the
+// child process of a fast style death test.
+# if !GTEST_OS_WINDOWS
+static bool g_in_fast_death_test_child = false;
+# endif
+
+// Returns a Boolean value indicating whether the caller is currently
+// executing in the context of the death test child process.  Tools such as
+// Valgrind heap checkers may need this to modify their behavior in death
+// tests.  IMPORTANT: This is an internal utility.  Using it may break the
+// implementation of death tests.  User code MUST NOT use it.
+bool InDeathTestChild() {
+# if GTEST_OS_WINDOWS
+
+  // On Windows, death tests are thread-safe regardless of the value of the
+  // death_test_style flag.
+  return !GTEST_FLAG(internal_run_death_test).empty();
+
+# else
+
+  if (GTEST_FLAG(death_test_style) == "threadsafe")
+    return !GTEST_FLAG(internal_run_death_test).empty();
+  else
+    return g_in_fast_death_test_child;
+#endif
+}
+
+}  // namespace internal
+
+// ExitedWithCode constructor.
+ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {
+}
+
+// ExitedWithCode function-call operator.
+bool ExitedWithCode::operator()(int exit_status) const {
+# if GTEST_OS_WINDOWS
+
+  return exit_status == exit_code_;
+
+# else
+
+  return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;
+
+# endif  // GTEST_OS_WINDOWS
+}
+
+# if !GTEST_OS_WINDOWS
+// KilledBySignal constructor.
+KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
+}
+
+// KilledBySignal function-call operator.
+bool KilledBySignal::operator()(int exit_status) const {
+#  if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
+  {
+    bool result;
+    if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {
+      return result;
+    }
+  }
+#  endif  // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
+  return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
+}
+# endif  // !GTEST_OS_WINDOWS
+
+namespace internal {
+
+// Utilities needed for death tests.
+
+// Generates a textual description of a given exit code, in the format
+// specified by wait(2).
+static std::string ExitSummary(int exit_code) {
+  Message m;
+
+# if GTEST_OS_WINDOWS
+
+  m << "Exited with exit status " << exit_code;
+
+# else
+
+  if (WIFEXITED(exit_code)) {
+    m << "Exited with exit status " << WEXITSTATUS(exit_code);
+  } else if (WIFSIGNALED(exit_code)) {
+    m << "Terminated by signal " << WTERMSIG(exit_code);
+  }
+#  ifdef WCOREDUMP
+  if (WCOREDUMP(exit_code)) {
+    m << " (core dumped)";
+  }
+#  endif
+# endif  // GTEST_OS_WINDOWS
+
+  return m.GetString();
+}
+
+// Returns true if exit_status describes a process that was terminated
+// by a signal, or exited normally with a nonzero exit code.
+bool ExitedUnsuccessfully(int exit_status) {
+  return !ExitedWithCode(0)(exit_status);
+}
+
+# if !GTEST_OS_WINDOWS
+// Generates a textual failure message when a death test finds more than
+// one thread running, or cannot determine the number of threads, prior
+// to executing the given statement.  It is the responsibility of the
+// caller not to pass a thread_count of 1.
+static std::string DeathTestThreadWarning(size_t thread_count) {
+  Message msg;
+  msg << "Death tests use fork(), which is unsafe particularly"
+      << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
+  if (thread_count == 0)
+    msg << "couldn't detect the number of threads.";
+  else
+    msg << "detected " << thread_count << " threads.";
+  return msg.GetString();
+}
+# endif  // !GTEST_OS_WINDOWS
+
+// Flag characters for reporting a death test that did not die.
+static const char kDeathTestLived = 'L';
+static const char kDeathTestReturned = 'R';
+static const char kDeathTestThrew = 'T';
+static const char kDeathTestInternalError = 'I';
+
+// An enumeration describing all of the possible ways that a death test can
+// conclude.  DIED means that the process died while executing the test
+// code; LIVED means that process lived beyond the end of the test code;
+// RETURNED means that the test statement attempted to execute a return
+// statement, which is not allowed; THREW means that the test statement
+// returned control by throwing an exception.  IN_PROGRESS means the test
+// has not yet concluded.
+// TODO(vladl@google.com): Unify names and possibly values for
+// AbortReason, DeathTestOutcome, and flag characters above.
+enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
+
+// Routine for aborting the program which is safe to call from an
+// exec-style death test child process, in which case the error
+// message is propagated back to the parent process.  Otherwise, the
+// message is simply printed to stderr.  In either case, the program
+// then exits with status 1.
+void DeathTestAbort(const std::string& message) {
+  // On a POSIX system, this function may be called from a threadsafe-style
+  // death test child process, which operates on a very small stack.  Use
+  // the heap for any additional non-minuscule memory requirements.
+  const InternalRunDeathTestFlag* const flag =
+      GetUnitTestImpl()->internal_run_death_test_flag();
+  if (flag != NULL) {
+    FILE* parent = posix::FDOpen(flag->write_fd(), "w");
+    fputc(kDeathTestInternalError, parent);
+    fprintf(parent, "%s", message.c_str());
+    fflush(parent);
+    _exit(1);
+  } else {
+    fprintf(stderr, "%s", message.c_str());
+    fflush(stderr);
+    posix::Abort();
+  }
+}
+
+// A replacement for CHECK that calls DeathTestAbort if the assertion
+// fails.
+# define GTEST_DEATH_TEST_CHECK_(expression) \
+  do { \
+    if (!::testing::internal::IsTrue(expression)) { \
+      DeathTestAbort( \
+          ::std::string("CHECK failed: File ") + __FILE__ +  ", line " \
+          + ::testing::internal::StreamableToString(__LINE__) + ": " \
+          + #expression); \
+    } \
+  } while (::testing::internal::AlwaysFalse())
+
+// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for
+// evaluating any system call that fulfills two conditions: it must return
+// -1 on failure, and set errno to EINTR when it is interrupted and
+// should be tried again.  The macro expands to a loop that repeatedly
+// evaluates the expression as long as it evaluates to -1 and sets
+// errno to EINTR.  If the expression evaluates to -1 but errno is
+// something other than EINTR, DeathTestAbort is called.
+# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
+  do { \
+    int gtest_retval; \
+    do { \
+      gtest_retval = (expression); \
+    } while (gtest_retval == -1 && errno == EINTR); \
+    if (gtest_retval == -1) { \
+      DeathTestAbort( \
+          ::std::string("CHECK failed: File ") + __FILE__ + ", line " \
+          + ::testing::internal::StreamableToString(__LINE__) + ": " \
+          + #expression + " != -1"); \
+    } \
+  } while (::testing::internal::AlwaysFalse())
+
+// Returns the message describing the last system error in errno.
+std::string GetLastErrnoDescription() {
+    return errno == 0 ? "" : posix::StrError(errno);
+}
+
+// This is called from a death test parent process to read a failure
+// message from the death test child process and log it with the FATAL
+// severity. On Windows, the message is read from a pipe handle. On other
+// platforms, it is read from a file descriptor.
+static void FailFromInternalError(int fd) {
+  Message error;
+  char buffer[256];
+  int num_read;
+
+  do {
+    while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
+      buffer[num_read] = '\0';
+      error << buffer;
+    }
+  } while (num_read == -1 && errno == EINTR);
+
+  if (num_read == 0) {
+    GTEST_LOG_(FATAL) << error.GetString();
+  } else {
+    const int last_error = errno;
+    GTEST_LOG_(FATAL) << "Error while reading death test internal: "
+                      << GetLastErrnoDescription() << " [" << last_error << "]";
+  }
+}
+
+// Death test constructor.  Increments the running death test count
+// for the current test.
+DeathTest::DeathTest() {
+  TestInfo* const info = GetUnitTestImpl()->current_test_info();
+  if (info == NULL) {
+    DeathTestAbort("Cannot run a death test outside of a TEST or "
+                   "TEST_F construct");
+  }
+}
+
+// Creates and returns a death test by dispatching to the current
+// death test factory.
+bool DeathTest::Create(const char* statement, const RE* regex,
+                       const char* file, int line, DeathTest** test) {
+  return GetUnitTestImpl()->death_test_factory()->Create(
+      statement, regex, file, line, test);
+}
+
+const char* DeathTest::LastMessage() {
+  return last_death_test_message_.c_str();
+}
+
+void DeathTest::set_last_death_test_message(const std::string& message) {
+  last_death_test_message_ = message;
+}
+
+std::string DeathTest::last_death_test_message_;
+
+// Provides cross platform implementation for some death functionality.
+class DeathTestImpl : public DeathTest {
+ protected:
+  DeathTestImpl(const char* a_statement, const RE* a_regex)
+      : statement_(a_statement),
+        regex_(a_regex),
+        spawned_(false),
+        status_(-1),
+        outcome_(IN_PROGRESS),
+        read_fd_(-1),
+        write_fd_(-1) {}
+
+  // read_fd_ is expected to be closed and cleared by a derived class.
+  ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
+
+  void Abort(AbortReason reason);
+  virtual bool Passed(bool status_ok);
+
+  const char* statement() const { return statement_; }
+  const RE* regex() const { return regex_; }
+  bool spawned() const { return spawned_; }
+  void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
+  int status() const { return status_; }
+  void set_status(int a_status) { status_ = a_status; }
+  DeathTestOutcome outcome() const { return outcome_; }
+  void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
+  int read_fd() const { return read_fd_; }
+  void set_read_fd(int fd) { read_fd_ = fd; }
+  int write_fd() const { return write_fd_; }
+  void set_write_fd(int fd) { write_fd_ = fd; }
+
+  // Called in the parent process only. Reads the result code of the death
+  // test child process via a pipe, interprets it to set the outcome_
+  // member, and closes read_fd_.  Outputs diagnostics and terminates in
+  // case of unexpected codes.
+  void ReadAndInterpretStatusByte();
+
+ private:
+  // The textual content of the code this object is testing.  This class
+  // doesn't own this string and should not attempt to delete it.
+  const char* const statement_;
+  // The regular expression which test output must match.  DeathTestImpl
+  // doesn't own this object and should not attempt to delete it.
+  const RE* const regex_;
+  // True if the death test child process has been successfully spawned.
+  bool spawned_;
+  // The exit status of the child process.
+  int status_;
+  // How the death test concluded.
+  DeathTestOutcome outcome_;
+  // Descriptor to the read end of the pipe to the child process.  It is
+  // always -1 in the child process.  The child keeps its write end of the
+  // pipe in write_fd_.
+  int read_fd_;
+  // Descriptor to the child's write end of the pipe to the parent process.
+  // It is always -1 in the parent process.  The parent keeps its end of the
+  // pipe in read_fd_.
+  int write_fd_;
+};
+
+// Called in the parent process only. Reads the result code of the death
+// test child process via a pipe, interprets it to set the outcome_
+// member, and closes read_fd_.  Outputs diagnostics and terminates in
+// case of unexpected codes.
+void DeathTestImpl::ReadAndInterpretStatusByte() {
+  char flag;
+  int bytes_read;
+
+  // The read() here blocks until data is available (signifying the
+  // failure of the death test) or until the pipe is closed (signifying
+  // its success), so it's okay to call this in the parent before
+  // the child process has exited.
+  do {
+    bytes_read = posix::Read(read_fd(), &flag, 1);
+  } while (bytes_read == -1 && errno == EINTR);
+
+  if (bytes_read == 0) {
+    set_outcome(DIED);
+  } else if (bytes_read == 1) {
+    switch (flag) {
+      case kDeathTestReturned:
+        set_outcome(RETURNED);
+        break;
+      case kDeathTestThrew:
+        set_outcome(THREW);
+        break;
+      case kDeathTestLived:
+        set_outcome(LIVED);
+        break;
+      case kDeathTestInternalError:
+        FailFromInternalError(read_fd());  // Does not return.
+        break;
+      default:
+        GTEST_LOG_(FATAL) << "Death test child process reported "
+                          << "unexpected status byte ("
+                          << static_cast<unsigned int>(flag) << ")";
+    }
+  } else {
+    GTEST_LOG_(FATAL) << "Read from death test child process failed: "
+                      << GetLastErrnoDescription();
+  }
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
+  set_read_fd(-1);
+}
+
+// Signals that the death test code which should have exited, didn't.
+// Should be called only in a death test child process.
+// Writes a status byte to the child's status file descriptor, then
+// calls _exit(1).
+void DeathTestImpl::Abort(AbortReason reason) {
+  // The parent process considers the death test to be a failure if
+  // it finds any data in our pipe.  So, here we write a single flag byte
+  // to the pipe, then exit.
+  const char status_ch =
+      reason == TEST_DID_NOT_DIE ? kDeathTestLived :
+      reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;
+
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
+  // We are leaking the descriptor here because on some platforms (i.e.,
+  // when built as Windows DLL), destructors of global objects will still
+  // run after calling _exit(). On such systems, write_fd_ will be
+  // indirectly closed from the destructor of UnitTestImpl, causing double
+  // close if it is also closed here. On debug configurations, double close
+  // may assert. As there are no in-process buffers to flush here, we are
+  // relying on the OS to close the descriptor after the process terminates
+  // when the destructors are not run.
+  _exit(1);  // Exits w/o any normal exit hooks (we were supposed to crash)
+}
+
+// Returns an indented copy of stderr output for a death test.
+// This makes distinguishing death test output lines from regular log lines
+// much easier.
+static ::std::string FormatDeathTestOutput(const ::std::string& output) {
+  ::std::string ret;
+  for (size_t at = 0; ; ) {
+    const size_t line_end = output.find('\n', at);
+    ret += "[  DEATH   ] ";
+    if (line_end == ::std::string::npos) {
+      ret += output.substr(at);
+      break;
+    }
+    ret += output.substr(at, line_end + 1 - at);
+    at = line_end + 1;
+  }
+  return ret;
+}
+
+// Assesses the success or failure of a death test, using both private
+// members which have previously been set, and one argument:
+//
+// Private data members:
+//   outcome:  An enumeration describing how the death test
+//             concluded: DIED, LIVED, THREW, or RETURNED.  The death test
+//             fails in the latter three cases.
+//   status:   The exit status of the child process. On *nix, it is in the
+//             in the format specified by wait(2). On Windows, this is the
+//             value supplied to the ExitProcess() API or a numeric code
+//             of the exception that terminated the program.
+//   regex:    A regular expression object to be applied to
+//             the test's captured standard error output; the death test
+//             fails if it does not match.
+//
+// Argument:
+//   status_ok: true if exit_status is acceptable in the context of
+//              this particular death test, which fails if it is false
+//
+// Returns true iff all of the above conditions are met.  Otherwise, the
+// first failing condition, in the order given above, is the one that is
+// reported. Also sets the last death test message string.
+bool DeathTestImpl::Passed(bool status_ok) {
+  if (!spawned())
+    return false;
+
+  const std::string error_message = GetCapturedStderr();
+
+  bool success = false;
+  Message buffer;
+
+  buffer << "Death test: " << statement() << "\n";
+  switch (outcome()) {
+    case LIVED:
+      buffer << "    Result: failed to die.\n"
+             << " Error msg:\n" << FormatDeathTestOutput(error_message);
+      break;
+    case THREW:
+      buffer << "    Result: threw an exception.\n"
+             << " Error msg:\n" << FormatDeathTestOutput(error_message);
+      break;
+    case RETURNED:
+      buffer << "    Result: illegal return in test statement.\n"
+             << " Error msg:\n" << FormatDeathTestOutput(error_message);
+      break;
+    case DIED:
+      if (status_ok) {
+        const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
+        if (matched) {
+          success = true;
+        } else {
+          buffer << "    Result: died but not with expected error.\n"
+                 << "  Expected: " << regex()->pattern() << "\n"
+                 << "Actual msg:\n" << FormatDeathTestOutput(error_message);
+        }
+      } else {
+        buffer << "    Result: died but not with expected exit code:\n"
+               << "            " << ExitSummary(status()) << "\n"
+               << "Actual msg:\n" << FormatDeathTestOutput(error_message);
+      }
+      break;
+    case IN_PROGRESS:
+    default:
+      GTEST_LOG_(FATAL)
+          << "DeathTest::Passed somehow called before conclusion of test";
+  }
+
+  DeathTest::set_last_death_test_message(buffer.GetString());
+  return success;
+}
+
+# if GTEST_OS_WINDOWS
+// WindowsDeathTest implements death tests on Windows. Due to the
+// specifics of starting new processes on Windows, death tests there are
+// always threadsafe, and Google Test considers the
+// --gtest_death_test_style=fast setting to be equivalent to
+// --gtest_death_test_style=threadsafe there.
+//
+// A few implementation notes:  Like the Linux version, the Windows
+// implementation uses pipes for child-to-parent communication. But due to
+// the specifics of pipes on Windows, some extra steps are required:
+//
+// 1. The parent creates a communication pipe and stores handles to both
+//    ends of it.
+// 2. The parent starts the child and provides it with the information
+//    necessary to acquire the handle to the write end of the pipe.
+// 3. The child acquires the write end of the pipe and signals the parent
+//    using a Windows event.
+// 4. Now the parent can release the write end of the pipe on its side. If
+//    this is done before step 3, the object's reference count goes down to
+//    0 and it is destroyed, preventing the child from acquiring it. The
+//    parent now has to release it, or read operations on the read end of
+//    the pipe will not return when the child terminates.
+// 5. The parent reads child's output through the pipe (outcome code and
+//    any possible error messages) from the pipe, and its stderr and then
+//    determines whether to fail the test.
+//
+// Note: to distinguish Win32 API calls from the local method and function
+// calls, the former are explicitly resolved in the global namespace.
+//
+class WindowsDeathTest : public DeathTestImpl {
+ public:
+  WindowsDeathTest(const char* a_statement,
+                   const RE* a_regex,
+                   const char* file,
+                   int line)
+      : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
+
+  // All of these virtual functions are inherited from DeathTest.
+  virtual int Wait();
+  virtual TestRole AssumeRole();
+
+ private:
+  // The name of the file in which the death test is located.
+  const char* const file_;
+  // The line number on which the death test is located.
+  const int line_;
+  // Handle to the write end of the pipe to the child process.
+  AutoHandle write_handle_;
+  // Child process handle.
+  AutoHandle child_handle_;
+  // Event the child process uses to signal the parent that it has
+  // acquired the handle to the write end of the pipe. After seeing this
+  // event the parent can release its own handles to make sure its
+  // ReadFile() calls return when the child terminates.
+  AutoHandle event_handle_;
+};
+
+// Waits for the child in a death test to exit, returning its exit
+// status, or 0 if no child process exists.  As a side effect, sets the
+// outcome data member.
+int WindowsDeathTest::Wait() {
+  if (!spawned())
+    return 0;
+
+  // Wait until the child either signals that it has acquired the write end
+  // of the pipe or it dies.
+  const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
+  switch (::WaitForMultipleObjects(2,
+                                   wait_handles,
+                                   FALSE,  // Waits for any of the handles.
+                                   INFINITE)) {
+    case WAIT_OBJECT_0:
+    case WAIT_OBJECT_0 + 1:
+      break;
+    default:
+      GTEST_DEATH_TEST_CHECK_(false);  // Should not get here.
+  }
+
+  // The child has acquired the write end of the pipe or exited.
+  // We release the handle on our side and continue.
+  write_handle_.Reset();
+  event_handle_.Reset();
+
+  ReadAndInterpretStatusByte();
+
+  // Waits for the child process to exit if it haven't already. This
+  // returns immediately if the child has already exited, regardless of
+  // whether previous calls to WaitForMultipleObjects synchronized on this
+  // handle or not.
+  GTEST_DEATH_TEST_CHECK_(
+      WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),
+                                             INFINITE));
+  DWORD status_code;
+  GTEST_DEATH_TEST_CHECK_(
+      ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);
+  child_handle_.Reset();
+  set_status(static_cast<int>(status_code));
+  return status();
+}
+
+// The AssumeRole process for a Windows death test.  It creates a child
+// process with the same executable as the current process to run the
+// death test.  The child process is given the --gtest_filter and
+// --gtest_internal_run_death_test flags such that it knows to run the
+// current death test only.
+DeathTest::TestRole WindowsDeathTest::AssumeRole() {
+  const UnitTestImpl* const impl = GetUnitTestImpl();
+  const InternalRunDeathTestFlag* const flag =
+      impl->internal_run_death_test_flag();
+  const TestInfo* const info = impl->current_test_info();
+  const int death_test_index = info->result()->death_test_count();
+
+  if (flag != NULL) {
+    // ParseInternalRunDeathTestFlag() has performed all the necessary
+    // processing.
+    set_write_fd(flag->write_fd());
+    return EXECUTE_TEST;
+  }
+
+  // WindowsDeathTest uses an anonymous pipe to communicate results of
+  // a death test.
+  SECURITY_ATTRIBUTES handles_are_inheritable = {
+    sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
+  HANDLE read_handle, write_handle;
+  GTEST_DEATH_TEST_CHECK_(
+      ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
+                   0)  // Default buffer size.
+      != FALSE);
+  set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),
+                                O_RDONLY));
+  write_handle_.Reset(write_handle);
+  event_handle_.Reset(::CreateEvent(
+      &handles_are_inheritable,
+      TRUE,    // The event will automatically reset to non-signaled state.
+      FALSE,   // The initial state is non-signalled.
+      NULL));  // The even is unnamed.
+  GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);
+  const std::string filter_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" +
+      info->test_case_name() + "." + info->name();
+  const std::string internal_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag +
+      "=" + file_ + "|" + StreamableToString(line_) + "|" +
+      StreamableToString(death_test_index) + "|" +
+      StreamableToString(static_cast<unsigned int>(::GetCurrentProcessId())) +
+      // size_t has the same width as pointers on both 32-bit and 64-bit
+      // Windows platforms.
+      // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
+      "|" + StreamableToString(reinterpret_cast<size_t>(write_handle)) +
+      "|" + StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));
+
+  char executable_path[_MAX_PATH + 1];  // NOLINT
+  GTEST_DEATH_TEST_CHECK_(
+      _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,
+                                            executable_path,
+                                            _MAX_PATH));
+
+  std::string command_line =
+      std::string(::GetCommandLineA()) + " " + filter_flag + " \"" +
+      internal_flag + "\"";
+
+  DeathTest::set_last_death_test_message("");
+
+  CaptureStderr();
+  // Flush the log buffers since the log streams are shared with the child.
+  FlushInfoLog();
+
+  // The child process will share the standard handles with the parent.
+  STARTUPINFOA startup_info;
+  memset(&startup_info, 0, sizeof(STARTUPINFO));
+  startup_info.dwFlags = STARTF_USESTDHANDLES;
+  startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);
+  startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
+  startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
+
+  PROCESS_INFORMATION process_info;
+  GTEST_DEATH_TEST_CHECK_(::CreateProcessA(
+      executable_path,
+      const_cast<char*>(command_line.c_str()),
+      NULL,   // Retuned process handle is not inheritable.
+      NULL,   // Retuned thread handle is not inheritable.
+      TRUE,   // Child inherits all inheritable handles (for write_handle_).
+      0x0,    // Default creation flags.
+      NULL,   // Inherit the parent's environment.
+      UnitTest::GetInstance()->original_working_dir(),
+      &startup_info,
+      &process_info) != FALSE);
+  child_handle_.Reset(process_info.hProcess);
+  ::CloseHandle(process_info.hThread);
+  set_spawned(true);
+  return OVERSEE_TEST;
+}
+# else  // We are not on Windows.
+
+// ForkingDeathTest provides implementations for most of the abstract
+// methods of the DeathTest interface.  Only the AssumeRole method is
+// left undefined.
+class ForkingDeathTest : public DeathTestImpl {
+ public:
+  ForkingDeathTest(const char* statement, const RE* regex);
+
+  // All of these virtual functions are inherited from DeathTest.
+  virtual int Wait();
+
+ protected:
+  void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
+
+ private:
+  // PID of child process during death test; 0 in the child process itself.
+  pid_t child_pid_;
+};
+
+// Constructs a ForkingDeathTest.
+ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
+    : DeathTestImpl(a_statement, a_regex),
+      child_pid_(-1) {}
+
+// Waits for the child in a death test to exit, returning its exit
+// status, or 0 if no child process exists.  As a side effect, sets the
+// outcome data member.
+int ForkingDeathTest::Wait() {
+  if (!spawned())
+    return 0;
+
+  ReadAndInterpretStatusByte();
+
+  int status_value;
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
+  set_status(status_value);
+  return status_value;
+}
+
+// A concrete death test class that forks, then immediately runs the test
+// in the child process.
+class NoExecDeathTest : public ForkingDeathTest {
+ public:
+  NoExecDeathTest(const char* a_statement, const RE* a_regex) :
+      ForkingDeathTest(a_statement, a_regex) { }
+  virtual TestRole AssumeRole();
+};
+
+// The AssumeRole process for a fork-and-run death test.  It implements a
+// straightforward fork, with a simple pipe to transmit the status byte.
+DeathTest::TestRole NoExecDeathTest::AssumeRole() {
+  const size_t thread_count = GetThreadCount();
+  if (thread_count != 1) {
+    GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
+  }
+
+  int pipe_fd[2];
+  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
+
+  DeathTest::set_last_death_test_message("");
+  CaptureStderr();
+  // When we fork the process below, the log file buffers are copied, but the
+  // file descriptors are shared.  We flush all log files here so that closing
+  // the file descriptors in the child process doesn't throw off the
+  // synchronization between descriptors and buffers in the parent process.
+  // This is as close to the fork as possible to avoid a race condition in case
+  // there are multiple threads running before the death test, and another
+  // thread writes to the log file.
+  FlushInfoLog();
+
+  const pid_t child_pid = fork();
+  GTEST_DEATH_TEST_CHECK_(child_pid != -1);
+  set_child_pid(child_pid);
+  if (child_pid == 0) {
+    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
+    set_write_fd(pipe_fd[1]);
+    // Redirects all logging to stderr in the child process to prevent
+    // concurrent writes to the log files.  We capture stderr in the parent
+    // process and append the child process' output to a log.
+    LogToStderr();
+    // Event forwarding to the listeners of event listener API mush be shut
+    // down in death test subprocesses.
+    GetUnitTestImpl()->listeners()->SuppressEventForwarding();
+    g_in_fast_death_test_child = true;
+    return EXECUTE_TEST;
+  } else {
+    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
+    set_read_fd(pipe_fd[0]);
+    set_spawned(true);
+    return OVERSEE_TEST;
+  }
+}
+
+// A concrete death test class that forks and re-executes the main
+// program from the beginning, with command-line flags set that cause
+// only this specific death test to be run.
+class ExecDeathTest : public ForkingDeathTest {
+ public:
+  ExecDeathTest(const char* a_statement, const RE* a_regex,
+                const char* file, int line) :
+      ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
+  virtual TestRole AssumeRole();
+ private:
+  static ::std::vector<testing::internal::string>
+  GetArgvsForDeathTestChildProcess() {
+    ::std::vector<testing::internal::string> args = GetInjectableArgvs();
+#  if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
+    ::std::vector<testing::internal::string> extra_args =
+        GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();
+    args.insert(args.end(), extra_args.begin(), extra_args.end());
+#  endif  // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
+    return args;
+  }
+  // The name of the file in which the death test is located.
+  const char* const file_;
+  // The line number on which the death test is located.
+  const int line_;
+};
+
+// Utility class for accumulating command-line arguments.
+class Arguments {
+ public:
+  Arguments() {
+    args_.push_back(NULL);
+  }
+
+  ~Arguments() {
+    for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
+         ++i) {
+      free(*i);
+    }
+  }
+  void AddArgument(const char* argument) {
+    args_.insert(args_.end() - 1, posix::StrDup(argument));
+  }
+
+  template <typename Str>
+  void AddArguments(const ::std::vector<Str>& arguments) {
+    for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
+         i != arguments.end();
+         ++i) {
+      args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
+    }
+  }
+  char* const* Argv() {
+    return &args_[0];
+  }
+
+ private:
+  std::vector<char*> args_;
+};
+
+// A struct that encompasses the arguments to the child process of a
+// threadsafe-style death test process.
+struct ExecDeathTestArgs {
+  char* const* argv;  // Command-line arguments for the child's call to exec
+  int close_fd;       // File descriptor to close; the read end of a pipe
+};
+
+#  if GTEST_OS_MAC
+inline char** GetEnviron() {
+  // When Google Test is built as a framework on MacOS X, the environ variable
+  // is unavailable. Apple's documentation (man environ) recommends using
+  // _NSGetEnviron() instead.
+  return *_NSGetEnviron();
+}
+#  else
+// Some POSIX platforms expect you to declare environ. extern "C" makes
+// it reside in the global namespace.
+extern "C" char** environ;
+inline char** GetEnviron() { return environ; }
+#  endif  // GTEST_OS_MAC
+
+#  if !GTEST_OS_QNX
+// The main function for a threadsafe-style death test child process.
+// This function is called in a clone()-ed process and thus must avoid
+// any potentially unsafe operations like malloc or libc functions.
+static int ExecDeathTestChildMain(void* child_arg) {
+  ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
+
+  // We need to execute the test program in the same environment where
+  // it was originally invoked.  Therefore we change to the original
+  // working directory first.
+  const char* const original_dir =
+      UnitTest::GetInstance()->original_working_dir();
+  // We can safely call chdir() as it's a direct system call.
+  if (chdir(original_dir) != 0) {
+    DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
+                   GetLastErrnoDescription());
+    return EXIT_FAILURE;
+  }
+
+  // We can safely call execve() as it's a direct system call.  We
+  // cannot use execvp() as it's a libc function and thus potentially
+  // unsafe.  Since execve() doesn't search the PATH, the user must
+  // invoke the test program via a valid path that contains at least
+  // one path separator.
+  execve(args->argv[0], args->argv, GetEnviron());
+  DeathTestAbort(std::string("execve(") + args->argv[0] + ", ...) in " +
+                 original_dir + " failed: " +
+                 GetLastErrnoDescription());
+  return EXIT_FAILURE;
+}
+#  endif  // !GTEST_OS_QNX
+
+// Two utility routines that together determine the direction the stack
+// grows.
+// This could be accomplished more elegantly by a single recursive
+// function, but we want to guard against the unlikely possibility of
+// a smart compiler optimizing the recursion away.
+//
+// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
+// StackLowerThanAddress into StackGrowsDown, which then doesn't give
+// correct answer.
+void StackLowerThanAddress(const void* ptr, bool* result) GTEST_NO_INLINE_;
+void StackLowerThanAddress(const void* ptr, bool* result) {
+  int dummy;
+  *result = (&dummy < ptr);
+}
+
+// Make sure AddressSanitizer does not tamper with the stack here.
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+bool StackGrowsDown() {
+  int dummy;
+  bool result;
+  StackLowerThanAddress(&dummy, &result);
+  return result;
+}
+
+// Spawns a child process with the same executable as the current process in
+// a thread-safe manner and instructs it to run the death test.  The
+// implementation uses fork(2) + exec.  On systems where clone(2) is
+// available, it is used instead, being slightly more thread-safe.  On QNX,
+// fork supports only single-threaded environments, so this function uses
+// spawn(2) there instead.  The function dies with an error message if
+// anything goes wrong.
+static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
+  ExecDeathTestArgs args = { argv, close_fd };
+  pid_t child_pid = -1;
+
+#  if GTEST_OS_QNX
+  // Obtains the current directory and sets it to be closed in the child
+  // process.
+  const int cwd_fd = open(".", O_RDONLY);
+  GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));
+  // We need to execute the test program in the same environment where
+  // it was originally invoked.  Therefore we change to the original
+  // working directory first.
+  const char* const original_dir =
+      UnitTest::GetInstance()->original_working_dir();
+  // We can safely call chdir() as it's a direct system call.
+  if (chdir(original_dir) != 0) {
+    DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
+                   GetLastErrnoDescription());
+    return EXIT_FAILURE;
+  }
+
+  int fd_flags;
+  // Set close_fd to be closed after spawn.
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,
+                                        fd_flags | FD_CLOEXEC));
+  struct inheritance inherit = {0};
+  // spawn is a system call.
+  child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());
+  // Restores the current working directory.
+  GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
+
+#  else   // GTEST_OS_QNX
+#   if GTEST_OS_LINUX
+  // When a SIGPROF signal is received while fork() or clone() are executing,
+  // the process may hang. To avoid this, we ignore SIGPROF here and re-enable
+  // it after the call to fork()/clone() is complete.
+  struct sigaction saved_sigprof_action;
+  struct sigaction ignore_sigprof_action;
+  memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));
+  sigemptyset(&ignore_sigprof_action.sa_mask);
+  ignore_sigprof_action.sa_handler = SIG_IGN;
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(
+      SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));
+#   endif  // GTEST_OS_LINUX
+
+#   if GTEST_HAS_CLONE
+  const bool use_fork = GTEST_FLAG(death_test_use_fork);
+
+  if (!use_fork) {
+    static const bool stack_grows_down = StackGrowsDown();
+    const size_t stack_size = getpagesize();
+    // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
+    void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
+                             MAP_ANON | MAP_PRIVATE, -1, 0);
+    GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
+
+    // Maximum stack alignment in bytes:  For a downward-growing stack, this
+    // amount is subtracted from size of the stack space to get an address
+    // that is within the stack space and is aligned on all systems we care
+    // about.  As far as I know there is no ABI with stack alignment greater
+    // than 64.  We assume stack and stack_size already have alignment of
+    // kMaxStackAlignment.
+    const size_t kMaxStackAlignment = 64;
+    void* const stack_top =
+        static_cast<char*>(stack) +
+            (stack_grows_down ? stack_size - kMaxStackAlignment : 0);
+    GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment &&
+        reinterpret_cast<intptr_t>(stack_top) % kMaxStackAlignment == 0);
+
+    child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
+
+    GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
+  }
+#   else
+  const bool use_fork = true;
+#   endif  // GTEST_HAS_CLONE
+
+  if (use_fork && (child_pid = fork()) == 0) {
+      ExecDeathTestChildMain(&args);
+      _exit(0);
+  }
+#  endif  // GTEST_OS_QNX
+#  if GTEST_OS_LINUX
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(
+      sigaction(SIGPROF, &saved_sigprof_action, NULL));
+#  endif  // GTEST_OS_LINUX
+
+  GTEST_DEATH_TEST_CHECK_(child_pid != -1);
+  return child_pid;
+}
+
+// The AssumeRole process for a fork-and-exec death test.  It re-executes the
+// main program from the beginning, setting the --gtest_filter
+// and --gtest_internal_run_death_test flags to cause only the current
+// death test to be re-run.
+DeathTest::TestRole ExecDeathTest::AssumeRole() {
+  const UnitTestImpl* const impl = GetUnitTestImpl();
+  const InternalRunDeathTestFlag* const flag =
+      impl->internal_run_death_test_flag();
+  const TestInfo* const info = impl->current_test_info();
+  const int death_test_index = info->result()->death_test_count();
+
+  if (flag != NULL) {
+    set_write_fd(flag->write_fd());
+    return EXECUTE_TEST;
+  }
+
+  int pipe_fd[2];
+  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
+  // Clear the close-on-exec flag on the write end of the pipe, lest
+  // it be closed when the child process does an exec:
+  GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
+
+  const std::string filter_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="
+      + info->test_case_name() + "." + info->name();
+  const std::string internal_flag =
+      std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
+      + file_ + "|" + StreamableToString(line_) + "|"
+      + StreamableToString(death_test_index) + "|"
+      + StreamableToString(pipe_fd[1]);
+  Arguments args;
+  args.AddArguments(GetArgvsForDeathTestChildProcess());
+  args.AddArgument(filter_flag.c_str());
+  args.AddArgument(internal_flag.c_str());
+
+  DeathTest::set_last_death_test_message("");
+
+  CaptureStderr();
+  // See the comment in NoExecDeathTest::AssumeRole for why the next line
+  // is necessary.
+  FlushInfoLog();
+
+  const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);
+  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
+  set_child_pid(child_pid);
+  set_read_fd(pipe_fd[0]);
+  set_spawned(true);
+  return OVERSEE_TEST;
+}
+
+# endif  // !GTEST_OS_WINDOWS
+
+// Creates a concrete DeathTest-derived class that depends on the
+// --gtest_death_test_style flag, and sets the pointer pointed to
+// by the "test" argument to its address.  If the test should be
+// skipped, sets that pointer to NULL.  Returns true, unless the
+// flag is set to an invalid value.
+bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
+                                     const char* file, int line,
+                                     DeathTest** test) {
+  UnitTestImpl* const impl = GetUnitTestImpl();
+  const InternalRunDeathTestFlag* const flag =
+      impl->internal_run_death_test_flag();
+  const int death_test_index = impl->current_test_info()
+      ->increment_death_test_count();
+
+  if (flag != NULL) {
+    if (death_test_index > flag->index()) {
+      DeathTest::set_last_death_test_message(
+          "Death test count (" + StreamableToString(death_test_index)
+          + ") somehow exceeded expected maximum ("
+          + StreamableToString(flag->index()) + ")");
+      return false;
+    }
+
+    if (!(flag->file() == file && flag->line() == line &&
+          flag->index() == death_test_index)) {
+      *test = NULL;
+      return true;
+    }
+  }
+
+# if GTEST_OS_WINDOWS
+
+  if (GTEST_FLAG(death_test_style) == "threadsafe" ||
+      GTEST_FLAG(death_test_style) == "fast") {
+    *test = new WindowsDeathTest(statement, regex, file, line);
+  }
+
+# else
+
+  if (GTEST_FLAG(death_test_style) == "threadsafe") {
+    *test = new ExecDeathTest(statement, regex, file, line);
+  } else if (GTEST_FLAG(death_test_style) == "fast") {
+    *test = new NoExecDeathTest(statement, regex);
+  }
+
+# endif  // GTEST_OS_WINDOWS
+
+  else {  // NOLINT - this is more readable than unbalanced brackets inside #if.
+    DeathTest::set_last_death_test_message(
+        "Unknown death test style \"" + GTEST_FLAG(death_test_style)
+        + "\" encountered");
+    return false;
+  }
+
+  return true;
+}
+
+# if GTEST_OS_WINDOWS
+// Recreates the pipe and event handles from the provided parameters,
+// signals the event, and returns a file descriptor wrapped around the pipe
+// handle. This function is called in the child process only.
+int GetStatusFileDescriptor(unsigned int parent_process_id,
+                            size_t write_handle_as_size_t,
+                            size_t event_handle_as_size_t) {
+  AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
+                                                   FALSE,  // Non-inheritable.
+                                                   parent_process_id));
+  if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
+    DeathTestAbort("Unable to open parent process " +
+                   StreamableToString(parent_process_id));
+  }
+
+  // TODO(vladl@google.com): Replace the following check with a
+  // compile-time assertion when available.
+  GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
+
+  const HANDLE write_handle =
+      reinterpret_cast<HANDLE>(write_handle_as_size_t);
+  HANDLE dup_write_handle;
+
+  // The newly initialized handle is accessible only in in the parent
+  // process. To obtain one accessible within the child, we need to use
+  // DuplicateHandle.
+  if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
+                         ::GetCurrentProcess(), &dup_write_handle,
+                         0x0,    // Requested privileges ignored since
+                                 // DUPLICATE_SAME_ACCESS is used.
+                         FALSE,  // Request non-inheritable handler.
+                         DUPLICATE_SAME_ACCESS)) {
+    DeathTestAbort("Unable to duplicate the pipe handle " +
+                   StreamableToString(write_handle_as_size_t) +
+                   " from the parent process " +
+                   StreamableToString(parent_process_id));
+  }
+
+  const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);
+  HANDLE dup_event_handle;
+
+  if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
+                         ::GetCurrentProcess(), &dup_event_handle,
+                         0x0,
+                         FALSE,
+                         DUPLICATE_SAME_ACCESS)) {
+    DeathTestAbort("Unable to duplicate the event handle " +
+                   StreamableToString(event_handle_as_size_t) +
+                   " from the parent process " +
+                   StreamableToString(parent_process_id));
+  }
+
+  const int write_fd =
+      ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);
+  if (write_fd == -1) {
+    DeathTestAbort("Unable to convert pipe handle " +
+                   StreamableToString(write_handle_as_size_t) +
+                   " to a file descriptor");
+  }
+
+  // Signals the parent that the write end of the pipe has been acquired
+  // so the parent can release its own write end.
+  ::SetEvent(dup_event_handle);
+
+  return write_fd;
+}
+# endif  // GTEST_OS_WINDOWS
+
+// Returns a newly created InternalRunDeathTestFlag object with fields
+// initialized from the GTEST_FLAG(internal_run_death_test) flag if
+// the flag is specified; otherwise returns NULL.
+InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
+  if (GTEST_FLAG(internal_run_death_test) == "") return NULL;
+
+  // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
+  // can use it here.
+  int line = -1;
+  int index = -1;
+  ::std::vector< ::std::string> fields;
+  SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);
+  int write_fd = -1;
+
+# if GTEST_OS_WINDOWS
+
+  unsigned int parent_process_id = 0;
+  size_t write_handle_as_size_t = 0;
+  size_t event_handle_as_size_t = 0;
+
+  if (fields.size() != 6
+      || !ParseNaturalNumber(fields[1], &line)
+      || !ParseNaturalNumber(fields[2], &index)
+      || !ParseNaturalNumber(fields[3], &parent_process_id)
+      || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)
+      || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
+    DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
+                   GTEST_FLAG(internal_run_death_test));
+  }
+  write_fd = GetStatusFileDescriptor(parent_process_id,
+                                     write_handle_as_size_t,
+                                     event_handle_as_size_t);
+# else
+
+  if (fields.size() != 4
+      || !ParseNaturalNumber(fields[1], &line)
+      || !ParseNaturalNumber(fields[2], &index)
+      || !ParseNaturalNumber(fields[3], &write_fd)) {
+    DeathTestAbort("Bad --gtest_internal_run_death_test flag: "
+        + GTEST_FLAG(internal_run_death_test));
+  }
+
+# endif  // GTEST_OS_WINDOWS
+
+  return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
+}
+
+}  // namespace internal
+
+#endif  // GTEST_HAS_DEATH_TEST
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-filepath.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-filepath.cc
new file mode 100644
index 0000000..0292dc1
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-filepath.cc
@@ -0,0 +1,387 @@
+// 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.
+//
+// Authors: keith.ray@gmail.com (Keith Ray)
+
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-filepath.h"
+#include "gtest/internal/gtest-port.h"
+
+#include <stdlib.h>
+
+#if GTEST_OS_WINDOWS_MOBILE
+# include <windows.h>
+#elif GTEST_OS_WINDOWS
+# include <direct.h>
+# include <io.h>
+#elif GTEST_OS_SYMBIAN
+// Symbian OpenC has PATH_MAX in sys/syslimits.h
+# include <sys/syslimits.h>
+#else
+# include <limits.h>
+# include <climits>  // Some Linux distributions define PATH_MAX here.
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+#if GTEST_OS_WINDOWS
+# define GTEST_PATH_MAX_ _MAX_PATH
+#elif defined(PATH_MAX)
+# define GTEST_PATH_MAX_ PATH_MAX
+#elif defined(_XOPEN_PATH_MAX)
+# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
+#else
+# define GTEST_PATH_MAX_ _POSIX_PATH_MAX
+#endif  // GTEST_OS_WINDOWS
+
+#include "gtest/internal/gtest-string.h"
+
+namespace testing {
+namespace internal {
+
+#if GTEST_OS_WINDOWS
+// On Windows, '\\' is the standard path separator, but many tools and the
+// Windows API also accept '/' as an alternate path separator. Unless otherwise
+// noted, a file path can contain either kind of path separators, or a mixture
+// of them.
+const char kPathSeparator = '\\';
+const char kAlternatePathSeparator = '/';
+const char kAlternatePathSeparatorString[] = "/";
+# if GTEST_OS_WINDOWS_MOBILE
+// Windows CE doesn't have a current directory. You should not use
+// the current directory in tests on Windows CE, but this at least
+// provides a reasonable fallback.
+const char kCurrentDirectoryString[] = "\\";
+// Windows CE doesn't define INVALID_FILE_ATTRIBUTES
+const DWORD kInvalidFileAttributes = 0xffffffff;
+# else
+const char kCurrentDirectoryString[] = ".\\";
+# endif  // GTEST_OS_WINDOWS_MOBILE
+#else
+const char kPathSeparator = '/';
+const char kCurrentDirectoryString[] = "./";
+#endif  // GTEST_OS_WINDOWS
+
+// Returns whether the given character is a valid path separator.
+static bool IsPathSeparator(char c) {
+#if GTEST_HAS_ALT_PATH_SEP_
+  return (c == kPathSeparator) || (c == kAlternatePathSeparator);
+#else
+  return c == kPathSeparator;
+#endif
+}
+
+// Returns the current working directory, or "" if unsuccessful.
+FilePath FilePath::GetCurrentDir() {
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+  // Windows CE doesn't have a current directory, so we just return
+  // something reasonable.
+  return FilePath(kCurrentDirectoryString);
+#elif GTEST_OS_WINDOWS
+  char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
+  return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
+#else
+  char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
+  char* result = getcwd(cwd, sizeof(cwd));
+# if GTEST_OS_NACL
+  // getcwd will likely fail in NaCl due to the sandbox, so return something
+  // reasonable. The user may have provided a shim implementation for getcwd,
+  // however, so fallback only when failure is detected.
+  return FilePath(result == NULL ? kCurrentDirectoryString : cwd);
+# endif  // GTEST_OS_NACL
+  return FilePath(result == NULL ? "" : cwd);
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+// Returns a copy of the FilePath with the case-insensitive extension removed.
+// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
+// FilePath("dir/file"). If a case-insensitive extension is not
+// found, returns a copy of the original FilePath.
+FilePath FilePath::RemoveExtension(const char* extension) const {
+  const std::string dot_extension = std::string(".") + extension;
+  if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {
+    return FilePath(pathname_.substr(
+        0, pathname_.length() - dot_extension.length()));
+  }
+  return *this;
+}
+
+// Returns a pointer to the last occurence of a valid path separator in
+// the FilePath. On Windows, for example, both '/' and '\' are valid path
+// separators. Returns NULL if no path separator was found.
+const char* FilePath::FindLastPathSeparator() const {
+  const char* const last_sep = strrchr(c_str(), kPathSeparator);
+#if GTEST_HAS_ALT_PATH_SEP_
+  const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
+  // Comparing two pointers of which only one is NULL is undefined.
+  if (last_alt_sep != NULL &&
+      (last_sep == NULL || last_alt_sep > last_sep)) {
+    return last_alt_sep;
+  }
+#endif
+  return last_sep;
+}
+
+// Returns a copy of the FilePath with the directory part removed.
+// Example: FilePath("path/to/file").RemoveDirectoryName() returns
+// FilePath("file"). If there is no directory part ("just_a_file"), it returns
+// the FilePath unmodified. If there is no file part ("just_a_dir/") it
+// returns an empty FilePath ("").
+// On Windows platform, '\' is the path separator, otherwise it is '/'.
+FilePath FilePath::RemoveDirectoryName() const {
+  const char* const last_sep = FindLastPathSeparator();
+  return last_sep ? FilePath(last_sep + 1) : *this;
+}
+
+// RemoveFileName returns the directory path with the filename removed.
+// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
+// If the FilePath is "a_file" or "/a_file", RemoveFileName returns
+// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
+// not have a file, like "just/a/dir/", it returns the FilePath unmodified.
+// On Windows platform, '\' is the path separator, otherwise it is '/'.
+FilePath FilePath::RemoveFileName() const {
+  const char* const last_sep = FindLastPathSeparator();
+  std::string dir;
+  if (last_sep) {
+    dir = std::string(c_str(), last_sep + 1 - c_str());
+  } else {
+    dir = kCurrentDirectoryString;
+  }
+  return FilePath(dir);
+}
+
+// Helper functions for naming files in a directory for xml output.
+
+// Given directory = "dir", base_name = "test", number = 0,
+// extension = "xml", returns "dir/test.xml". If number is greater
+// than zero (e.g., 12), returns "dir/test_12.xml".
+// On Windows platform, uses \ as the separator rather than /.
+FilePath FilePath::MakeFileName(const FilePath& directory,
+                                const FilePath& base_name,
+                                int number,
+                                const char* extension) {
+  std::string file;
+  if (number == 0) {
+    file = base_name.string() + "." + extension;
+  } else {
+    file = base_name.string() + "_" + StreamableToString(number)
+        + "." + extension;
+  }
+  return ConcatPaths(directory, FilePath(file));
+}
+
+// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
+// On Windows, uses \ as the separator rather than /.
+FilePath FilePath::ConcatPaths(const FilePath& directory,
+                               const FilePath& relative_path) {
+  if (directory.IsEmpty())
+    return relative_path;
+  const FilePath dir(directory.RemoveTrailingPathSeparator());
+  return FilePath(dir.string() + kPathSeparator + relative_path.string());
+}
+
+// Returns true if pathname describes something findable in the file-system,
+// either a file, directory, or whatever.
+bool FilePath::FileOrDirectoryExists() const {
+#if GTEST_OS_WINDOWS_MOBILE
+  LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
+  const DWORD attributes = GetFileAttributes(unicode);
+  delete [] unicode;
+  return attributes != kInvalidFileAttributes;
+#else
+  posix::StatStruct file_stat;
+  return posix::Stat(pathname_.c_str(), &file_stat) == 0;
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+// Returns true if pathname describes a directory in the file-system
+// that exists.
+bool FilePath::DirectoryExists() const {
+  bool result = false;
+#if GTEST_OS_WINDOWS
+  // Don't strip off trailing separator if path is a root directory on
+  // Windows (like "C:\\").
+  const FilePath& path(IsRootDirectory() ? *this :
+                                           RemoveTrailingPathSeparator());
+#else
+  const FilePath& path(*this);
+#endif
+
+#if GTEST_OS_WINDOWS_MOBILE
+  LPCWSTR unicode = String::AnsiToUtf16(path.c_str());
+  const DWORD attributes = GetFileAttributes(unicode);
+  delete [] unicode;
+  if ((attributes != kInvalidFileAttributes) &&
+      (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
+    result = true;
+  }
+#else
+  posix::StatStruct file_stat;
+  result = posix::Stat(path.c_str(), &file_stat) == 0 &&
+      posix::IsDir(file_stat);
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+  return result;
+}
+
+// Returns true if pathname describes a root directory. (Windows has one
+// root directory per disk drive.)
+bool FilePath::IsRootDirectory() const {
+#if GTEST_OS_WINDOWS
+  // TODO(wan@google.com): on Windows a network share like
+  // \\server\share can be a root directory, although it cannot be the
+  // current directory.  Handle this properly.
+  return pathname_.length() == 3 && IsAbsolutePath();
+#else
+  return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
+#endif
+}
+
+// Returns true if pathname describes an absolute path.
+bool FilePath::IsAbsolutePath() const {
+  const char* const name = pathname_.c_str();
+#if GTEST_OS_WINDOWS
+  return pathname_.length() >= 3 &&
+     ((name[0] >= 'a' && name[0] <= 'z') ||
+      (name[0] >= 'A' && name[0] <= 'Z')) &&
+     name[1] == ':' &&
+     IsPathSeparator(name[2]);
+#else
+  return IsPathSeparator(name[0]);
+#endif
+}
+
+// Returns a pathname for a file that does not currently exist. The pathname
+// will be directory/base_name.extension or
+// directory/base_name_<number>.extension if directory/base_name.extension
+// already exists. The number will be incremented until a pathname is found
+// that does not already exist.
+// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
+// There could be a race condition if two or more processes are calling this
+// function at the same time -- they could both pick the same filename.
+FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
+                                          const FilePath& base_name,
+                                          const char* extension) {
+  FilePath full_pathname;
+  int number = 0;
+  do {
+    full_pathname.Set(MakeFileName(directory, base_name, number++, extension));
+  } while (full_pathname.FileOrDirectoryExists());
+  return full_pathname;
+}
+
+// Returns true if FilePath ends with a path separator, which indicates that
+// it is intended to represent a directory. Returns false otherwise.
+// This does NOT check that a directory (or file) actually exists.
+bool FilePath::IsDirectory() const {
+  return !pathname_.empty() &&
+         IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);
+}
+
+// Create directories so that path exists. Returns true if successful or if
+// the directories already exist; returns false if unable to create directories
+// for any reason.
+bool FilePath::CreateDirectoriesRecursively() const {
+  if (!this->IsDirectory()) {
+    return false;
+  }
+
+  if (pathname_.length() == 0 || this->DirectoryExists()) {
+    return true;
+  }
+
+  const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
+  return parent.CreateDirectoriesRecursively() && this->CreateFolder();
+}
+
+// Create the directory so that path exists. Returns true if successful or
+// if the directory already exists; returns false if unable to create the
+// directory for any reason, including if the parent directory does not
+// exist. Not named "CreateDirectory" because that's a macro on Windows.
+bool FilePath::CreateFolder() const {
+#if GTEST_OS_WINDOWS_MOBILE
+  FilePath removed_sep(this->RemoveTrailingPathSeparator());
+  LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
+  int result = CreateDirectory(unicode, NULL) ? 0 : -1;
+  delete [] unicode;
+#elif GTEST_OS_WINDOWS
+  int result = _mkdir(pathname_.c_str());
+#else
+  int result = mkdir(pathname_.c_str(), 0777);
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+  if (result == -1) {
+    return this->DirectoryExists();  // An error is OK if the directory exists.
+  }
+  return true;  // No error.
+}
+
+// If input name has a trailing separator character, remove it and return the
+// name, otherwise return the name string unmodified.
+// On Windows platform, uses \ as the separator, other platforms use /.
+FilePath FilePath::RemoveTrailingPathSeparator() const {
+  return IsDirectory()
+      ? FilePath(pathname_.substr(0, pathname_.length() - 1))
+      : *this;
+}
+
+// Removes any redundant separators that might be in the pathname.
+// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
+// redundancies that might be in a pathname involving "." or "..".
+// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
+void FilePath::Normalize() {
+  if (pathname_.c_str() == NULL) {
+    pathname_ = "";
+    return;
+  }
+  const char* src = pathname_.c_str();
+  char* const dest = new char[pathname_.length() + 1];
+  char* dest_ptr = dest;
+  memset(dest_ptr, 0, pathname_.length() + 1);
+
+  while (*src != '\0') {
+    *dest_ptr = *src;
+    if (!IsPathSeparator(*src)) {
+      src++;
+    } else {
+#if GTEST_HAS_ALT_PATH_SEP_
+      if (*dest_ptr == kAlternatePathSeparator) {
+        *dest_ptr = kPathSeparator;
+      }
+#endif
+      while (IsPathSeparator(*src))
+        src++;
+    }
+    dest_ptr++;
+  }
+  *dest_ptr = '\0';
+  pathname_ = dest;
+  delete[] dest;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-internal-inl.h b/third_party/wpiutil_2018/gmock/gtest/src/gtest-internal-inl.h
new file mode 100644
index 0000000..ed8a682
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-internal-inl.h
@@ -0,0 +1,1183 @@
+// Copyright 2005, 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.
+
+// Utility functions and classes used by the Google C++ testing framework.
+//
+// Author: wan@google.com (Zhanyong Wan)
+//
+// This file contains purely Google Test's internal implementation.  Please
+// DO NOT #INCLUDE IT IN A USER PROGRAM.
+
+#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
+#define GTEST_SRC_GTEST_INTERNAL_INL_H_
+
+// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
+// part of Google Test's implementation; otherwise it's undefined.
+#if !GTEST_IMPLEMENTATION_
+// If this file is included from the user's code, just say no.
+# error "gtest-internal-inl.h is part of Google Test's internal implementation."
+# error "It must not be included except by Google Test itself."
+#endif  // GTEST_IMPLEMENTATION_
+
+#ifndef _WIN32_WCE
+# include <errno.h>
+#endif  // !_WIN32_WCE
+#include <stddef.h>
+#include <stdlib.h>  // For strtoll/_strtoul64/malloc/free.
+#include <string.h>  // For memmove.
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+#include "gtest/internal/gtest-port.h"
+
+#if GTEST_CAN_STREAM_RESULTS_
+# include <arpa/inet.h>  // NOLINT
+# include <netdb.h>  // NOLINT
+#endif
+
+#if GTEST_OS_WINDOWS
+# include <windows.h>  // NOLINT
+#endif  // GTEST_OS_WINDOWS
+
+#include "gtest/gtest.h"  // NOLINT
+#include "gtest/gtest-spi.h"
+
+namespace testing {
+
+// Declares the flags.
+//
+// We don't want the users to modify this flag in the code, but want
+// Google Test's own unit tests to be able to access it. Therefore we
+// declare it here as opposed to in gtest.h.
+GTEST_DECLARE_bool_(death_test_use_fork);
+
+namespace internal {
+
+// The value of GetTestTypeId() as seen from within the Google Test
+// library.  This is solely for testing GetTestTypeId().
+GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;
+
+// Names of the flags (needed for parsing Google Test flags).
+const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests";
+const char kBreakOnFailureFlag[] = "break_on_failure";
+const char kCatchExceptionsFlag[] = "catch_exceptions";
+const char kColorFlag[] = "color";
+const char kFilterFlag[] = "filter";
+const char kListTestsFlag[] = "list_tests";
+const char kOutputFlag[] = "output";
+const char kPrintTimeFlag[] = "print_time";
+const char kRandomSeedFlag[] = "random_seed";
+const char kRepeatFlag[] = "repeat";
+const char kShuffleFlag[] = "shuffle";
+const char kStackTraceDepthFlag[] = "stack_trace_depth";
+const char kStreamResultToFlag[] = "stream_result_to";
+const char kThrowOnFailureFlag[] = "throw_on_failure";
+const char kFlagfileFlag[] = "flagfile";
+
+// A valid random seed must be in [1, kMaxRandomSeed].
+const int kMaxRandomSeed = 99999;
+
+// g_help_flag is true iff the --help flag or an equivalent form is
+// specified on the command line.
+GTEST_API_ extern bool g_help_flag;
+
+// Returns the current time in milliseconds.
+GTEST_API_ TimeInMillis GetTimeInMillis();
+
+// Returns true iff Google Test should use colors in the output.
+GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
+
+// Formats the given time in milliseconds as seconds.
+GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
+
+// Converts the given time in milliseconds to a date string in the ISO 8601
+// format, without the timezone information.  N.B.: due to the use the
+// non-reentrant localtime() function, this function is not thread safe.  Do
+// not use it in any code that can be called from multiple threads.
+GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
+
+// Parses a string for an Int32 flag, in the form of "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+GTEST_API_ bool ParseInt32Flag(
+    const char* str, const char* flag, Int32* value);
+
+// Returns a random seed in range [1, kMaxRandomSeed] based on the
+// given --gtest_random_seed flag value.
+inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
+  const unsigned int raw_seed = (random_seed_flag == 0) ?
+      static_cast<unsigned int>(GetTimeInMillis()) :
+      static_cast<unsigned int>(random_seed_flag);
+
+  // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
+  // it's easy to type.
+  const int normalized_seed =
+      static_cast<int>((raw_seed - 1U) %
+                       static_cast<unsigned int>(kMaxRandomSeed)) + 1;
+  return normalized_seed;
+}
+
+// Returns the first valid random seed after 'seed'.  The behavior is
+// undefined if 'seed' is invalid.  The seed after kMaxRandomSeed is
+// considered to be 1.
+inline int GetNextRandomSeed(int seed) {
+  GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
+      << "Invalid random seed " << seed << " - must be in [1, "
+      << kMaxRandomSeed << "].";
+  const int next_seed = seed + 1;
+  return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
+}
+
+// This class saves the values of all Google Test flags in its c'tor, and
+// restores them in its d'tor.
+class GTestFlagSaver {
+ public:
+  // The c'tor.
+  GTestFlagSaver() {
+    also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
+    break_on_failure_ = GTEST_FLAG(break_on_failure);
+    catch_exceptions_ = GTEST_FLAG(catch_exceptions);
+    color_ = GTEST_FLAG(color);
+    death_test_style_ = GTEST_FLAG(death_test_style);
+    death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
+    filter_ = GTEST_FLAG(filter);
+    internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
+    list_tests_ = GTEST_FLAG(list_tests);
+    output_ = GTEST_FLAG(output);
+    print_time_ = GTEST_FLAG(print_time);
+    random_seed_ = GTEST_FLAG(random_seed);
+    repeat_ = GTEST_FLAG(repeat);
+    shuffle_ = GTEST_FLAG(shuffle);
+    stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
+    stream_result_to_ = GTEST_FLAG(stream_result_to);
+    throw_on_failure_ = GTEST_FLAG(throw_on_failure);
+  }
+
+  // The d'tor is not virtual.  DO NOT INHERIT FROM THIS CLASS.
+  ~GTestFlagSaver() {
+    GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
+    GTEST_FLAG(break_on_failure) = break_on_failure_;
+    GTEST_FLAG(catch_exceptions) = catch_exceptions_;
+    GTEST_FLAG(color) = color_;
+    GTEST_FLAG(death_test_style) = death_test_style_;
+    GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
+    GTEST_FLAG(filter) = filter_;
+    GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
+    GTEST_FLAG(list_tests) = list_tests_;
+    GTEST_FLAG(output) = output_;
+    GTEST_FLAG(print_time) = print_time_;
+    GTEST_FLAG(random_seed) = random_seed_;
+    GTEST_FLAG(repeat) = repeat_;
+    GTEST_FLAG(shuffle) = shuffle_;
+    GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
+    GTEST_FLAG(stream_result_to) = stream_result_to_;
+    GTEST_FLAG(throw_on_failure) = throw_on_failure_;
+  }
+
+ private:
+  // Fields for saving the original values of flags.
+  bool also_run_disabled_tests_;
+  bool break_on_failure_;
+  bool catch_exceptions_;
+  std::string color_;
+  std::string death_test_style_;
+  bool death_test_use_fork_;
+  std::string filter_;
+  std::string internal_run_death_test_;
+  bool list_tests_;
+  std::string output_;
+  bool print_time_;
+  internal::Int32 random_seed_;
+  internal::Int32 repeat_;
+  bool shuffle_;
+  internal::Int32 stack_trace_depth_;
+  std::string stream_result_to_;
+  bool throw_on_failure_;
+} GTEST_ATTRIBUTE_UNUSED_;
+
+// Converts a Unicode code point to a narrow string in UTF-8 encoding.
+// code_point parameter is of type UInt32 because wchar_t may not be
+// wide enough to contain a code point.
+// If the code_point is not a valid Unicode code point
+// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
+// to "(Invalid Unicode 0xXXXXXXXX)".
+GTEST_API_ std::string CodePointToUtf8(UInt32 code_point);
+
+// Converts a wide string to a narrow string in UTF-8 encoding.
+// The wide string is assumed to have the following encoding:
+//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
+//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
+// Parameter str points to a null-terminated wide string.
+// Parameter num_chars may additionally limit the number
+// of wchar_t characters processed. -1 is used when the entire string
+// should be processed.
+// If the string contains code points that are not valid Unicode code points
+// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
+// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
+// and contains invalid UTF-16 surrogate pairs, values in those pairs
+// will be encoded as individual Unicode characters from Basic Normal Plane.
+GTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars);
+
+// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
+// if the variable is present. If a file already exists at this location, this
+// function will write over it. If the variable is present, but the file cannot
+// be created, prints an error and exits.
+void WriteToShardStatusFileIfNeeded();
+
+// Checks whether sharding is enabled by examining the relevant
+// environment variable values. If the variables are present,
+// but inconsistent (e.g., shard_index >= total_shards), prints
+// an error and exits. If in_subprocess_for_death_test, sharding is
+// disabled because it must only be applied to the original test
+// process. Otherwise, we could filter out death tests we intended to execute.
+GTEST_API_ bool ShouldShard(const char* total_shards_str,
+                            const char* shard_index_str,
+                            bool in_subprocess_for_death_test);
+
+// Parses the environment variable var as an Int32. If it is unset,
+// returns default_val. If it is not an Int32, prints an error and
+// and aborts.
+GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);
+
+// Given the total number of shards, the shard index, and the test id,
+// returns true iff the test should be run on this shard. The test id is
+// some arbitrary but unique non-negative integer assigned to each test
+// method. Assumes that 0 <= shard_index < total_shards.
+GTEST_API_ bool ShouldRunTestOnShard(
+    int total_shards, int shard_index, int test_id);
+
+// STL container utilities.
+
+// Returns the number of elements in the given container that satisfy
+// the given predicate.
+template <class Container, typename Predicate>
+inline int CountIf(const Container& c, Predicate predicate) {
+  // Implemented as an explicit loop since std::count_if() in libCstd on
+  // Solaris has a non-standard signature.
+  int count = 0;
+  for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {
+    if (predicate(*it))
+      ++count;
+  }
+  return count;
+}
+
+// Applies a function/functor to each element in the container.
+template <class Container, typename Functor>
+void ForEach(const Container& c, Functor functor) {
+  std::for_each(c.begin(), c.end(), functor);
+}
+
+// Returns the i-th element of the vector, or default_value if i is not
+// in range [0, v.size()).
+template <typename E>
+inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
+  return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
+}
+
+// Performs an in-place shuffle of a range of the vector's elements.
+// 'begin' and 'end' are element indices as an STL-style range;
+// i.e. [begin, end) are shuffled, where 'end' == size() means to
+// shuffle to the end of the vector.
+template <typename E>
+void ShuffleRange(internal::Random* random, int begin, int end,
+                  std::vector<E>* v) {
+  const int size = static_cast<int>(v->size());
+  GTEST_CHECK_(0 <= begin && begin <= size)
+      << "Invalid shuffle range start " << begin << ": must be in range [0, "
+      << size << "].";
+  GTEST_CHECK_(begin <= end && end <= size)
+      << "Invalid shuffle range finish " << end << ": must be in range ["
+      << begin << ", " << size << "].";
+
+  // Fisher-Yates shuffle, from
+  // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
+  for (int range_width = end - begin; range_width >= 2; range_width--) {
+    const int last_in_range = begin + range_width - 1;
+    const int selected = begin + random->Generate(range_width);
+    std::swap((*v)[selected], (*v)[last_in_range]);
+  }
+}
+
+// Performs an in-place shuffle of the vector's elements.
+template <typename E>
+inline void Shuffle(internal::Random* random, std::vector<E>* v) {
+  ShuffleRange(random, 0, static_cast<int>(v->size()), v);
+}
+
+// A function for deleting an object.  Handy for being used as a
+// functor.
+template <typename T>
+static void Delete(T* x) {
+  delete x;
+}
+
+// A predicate that checks the key of a TestProperty against a known key.
+//
+// TestPropertyKeyIs is copyable.
+class TestPropertyKeyIs {
+ public:
+  // Constructor.
+  //
+  // TestPropertyKeyIs has NO default constructor.
+  explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
+
+  // Returns true iff the test name of test property matches on key_.
+  bool operator()(const TestProperty& test_property) const {
+    return test_property.key() == key_;
+  }
+
+ private:
+  std::string key_;
+};
+
+// Class UnitTestOptions.
+//
+// This class contains functions for processing options the user
+// specifies when running the tests.  It has only static members.
+//
+// In most cases, the user can specify an option using either an
+// environment variable or a command line flag.  E.g. you can set the
+// test filter using either GTEST_FILTER or --gtest_filter.  If both
+// the variable and the flag are present, the latter overrides the
+// former.
+class GTEST_API_ UnitTestOptions {
+ public:
+  // Functions for processing the gtest_output flag.
+
+  // Returns the output format, or "" for normal printed output.
+  static std::string GetOutputFormat();
+
+  // Returns the absolute path of the requested output file, or the
+  // default (test_detail.xml in the original working directory) if
+  // none was explicitly specified.
+  static std::string GetAbsolutePathToOutputFile();
+
+  // Functions for processing the gtest_filter flag.
+
+  // Returns true iff the wildcard pattern matches the string.  The
+  // first ':' or '\0' character in pattern marks the end of it.
+  //
+  // This recursive algorithm isn't very efficient, but is clear and
+  // works well enough for matching test names, which are short.
+  static bool PatternMatchesString(const char *pattern, const char *str);
+
+  // Returns true iff the user-specified filter matches the test case
+  // name and the test name.
+  static bool FilterMatchesTest(const std::string &test_case_name,
+                                const std::string &test_name);
+
+#if GTEST_OS_WINDOWS
+  // Function for supporting the gtest_catch_exception flag.
+
+  // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
+  // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
+  // This function is useful as an __except condition.
+  static int GTestShouldProcessSEH(DWORD exception_code);
+#endif  // GTEST_OS_WINDOWS
+
+  // Returns true if "name" matches the ':' separated list of glob-style
+  // filters in "filter".
+  static bool MatchesFilter(const std::string& name, const char* filter);
+};
+
+// Returns the current application's name, removing directory path if that
+// is present.  Used by UnitTestOptions::GetOutputFile.
+GTEST_API_ FilePath GetCurrentExecutableName();
+
+// The role interface for getting the OS stack trace as a string.
+class OsStackTraceGetterInterface {
+ public:
+  OsStackTraceGetterInterface() {}
+  virtual ~OsStackTraceGetterInterface() {}
+
+  // Returns the current OS stack trace as an std::string.  Parameters:
+  //
+  //   max_depth  - the maximum number of stack frames to be included
+  //                in the trace.
+  //   skip_count - the number of top frames to be skipped; doesn't count
+  //                against max_depth.
+  virtual string CurrentStackTrace(int max_depth, int skip_count) = 0;
+
+  // UponLeavingGTest() should be called immediately before Google Test calls
+  // user code. It saves some information about the current stack that
+  // CurrentStackTrace() will use to find and hide Google Test stack frames.
+  virtual void UponLeavingGTest() = 0;
+
+  // This string is inserted in place of stack frames that are part of
+  // Google Test's implementation.
+  static const char* const kElidedFramesMarker;
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
+};
+
+// A working implementation of the OsStackTraceGetterInterface interface.
+class OsStackTraceGetter : public OsStackTraceGetterInterface {
+ public:
+  OsStackTraceGetter() {}
+
+  virtual string CurrentStackTrace(int max_depth, int skip_count);
+  virtual void UponLeavingGTest();
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
+};
+
+// Information about a Google Test trace point.
+struct TraceInfo {
+  const char* file;
+  int line;
+  std::string message;
+};
+
+// This is the default global test part result reporter used in UnitTestImpl.
+// This class should only be used by UnitTestImpl.
+class DefaultGlobalTestPartResultReporter
+  : public TestPartResultReporterInterface {
+ public:
+  explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
+  // Implements the TestPartResultReporterInterface. Reports the test part
+  // result in the current test.
+  virtual void ReportTestPartResult(const TestPartResult& result);
+
+ private:
+  UnitTestImpl* const unit_test_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
+};
+
+// This is the default per thread test part result reporter used in
+// UnitTestImpl. This class should only be used by UnitTestImpl.
+class DefaultPerThreadTestPartResultReporter
+    : public TestPartResultReporterInterface {
+ public:
+  explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
+  // Implements the TestPartResultReporterInterface. The implementation just
+  // delegates to the current global test part result reporter of *unit_test_.
+  virtual void ReportTestPartResult(const TestPartResult& result);
+
+ private:
+  UnitTestImpl* const unit_test_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
+};
+
+// The private implementation of the UnitTest class.  We don't protect
+// the methods under a mutex, as this class is not accessible by a
+// user and the UnitTest class that delegates work to this class does
+// proper locking.
+class GTEST_API_ UnitTestImpl {
+ public:
+  explicit UnitTestImpl(UnitTest* parent);
+  virtual ~UnitTestImpl();
+
+  // There are two different ways to register your own TestPartResultReporter.
+  // You can register your own repoter to listen either only for test results
+  // from the current thread or for results from all threads.
+  // By default, each per-thread test result repoter just passes a new
+  // TestPartResult to the global test result reporter, which registers the
+  // test part result for the currently running test.
+
+  // Returns the global test part result reporter.
+  TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
+
+  // Sets the global test part result reporter.
+  void SetGlobalTestPartResultReporter(
+      TestPartResultReporterInterface* reporter);
+
+  // Returns the test part result reporter for the current thread.
+  TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
+
+  // Sets the test part result reporter for the current thread.
+  void SetTestPartResultReporterForCurrentThread(
+      TestPartResultReporterInterface* reporter);
+
+  // Gets the number of successful test cases.
+  int successful_test_case_count() const;
+
+  // Gets the number of failed test cases.
+  int failed_test_case_count() const;
+
+  // Gets the number of all test cases.
+  int total_test_case_count() const;
+
+  // Gets the number of all test cases that contain at least one test
+  // that should run.
+  int test_case_to_run_count() const;
+
+  // Gets the number of successful tests.
+  int successful_test_count() const;
+
+  // Gets the number of failed tests.
+  int failed_test_count() const;
+
+  // Gets the number of disabled tests that will be reported in the XML report.
+  int reportable_disabled_test_count() const;
+
+  // Gets the number of disabled tests.
+  int disabled_test_count() const;
+
+  // Gets the number of tests to be printed in the XML report.
+  int reportable_test_count() const;
+
+  // Gets the number of all tests.
+  int total_test_count() const;
+
+  // Gets the number of tests that should run.
+  int test_to_run_count() const;
+
+  // Gets the time of the test program start, in ms from the start of the
+  // UNIX epoch.
+  TimeInMillis start_timestamp() const { return start_timestamp_; }
+
+  // Gets the elapsed time, in milliseconds.
+  TimeInMillis elapsed_time() const { return elapsed_time_; }
+
+  // Returns true iff the unit test passed (i.e. all test cases passed).
+  bool Passed() const { return !Failed(); }
+
+  // Returns true iff the unit test failed (i.e. some test case failed
+  // or something outside of all tests failed).
+  bool Failed() const {
+    return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
+  }
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  const TestCase* GetTestCase(int i) const {
+    const int index = GetElementOr(test_case_indices_, i, -1);
+    return index < 0 ? NULL : test_cases_[i];
+  }
+
+  // Gets the i-th test case among all the test cases. i can range from 0 to
+  // total_test_case_count() - 1. If i is not in that range, returns NULL.
+  TestCase* GetMutableTestCase(int i) {
+    const int index = GetElementOr(test_case_indices_, i, -1);
+    return index < 0 ? NULL : test_cases_[index];
+  }
+
+  // Provides access to the event listener list.
+  TestEventListeners* listeners() { return &listeners_; }
+
+  // Returns the TestResult for the test that's currently running, or
+  // the TestResult for the ad hoc test if no test is running.
+  TestResult* current_test_result();
+
+  // Returns the TestResult for the ad hoc test.
+  const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }
+
+  // Sets the OS stack trace getter.
+  //
+  // Does nothing if the input and the current OS stack trace getter
+  // are the same; otherwise, deletes the old getter and makes the
+  // input the current getter.
+  void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
+
+  // Returns the current OS stack trace getter if it is not NULL;
+  // otherwise, creates an OsStackTraceGetter, makes it the current
+  // getter, and returns it.
+  OsStackTraceGetterInterface* os_stack_trace_getter();
+
+  // Returns the current OS stack trace as an std::string.
+  //
+  // The maximum number of stack frames to be included is specified by
+  // the gtest_stack_trace_depth flag.  The skip_count parameter
+  // specifies the number of top frames to be skipped, which doesn't
+  // count against the number of frames to be included.
+  //
+  // For example, if Foo() calls Bar(), which in turn calls
+  // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
+  // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
+  std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
+
+  // Finds and returns a TestCase with the given name.  If one doesn't
+  // exist, creates one and returns it.
+  //
+  // Arguments:
+  //
+  //   test_case_name: name of the test case
+  //   type_param:     the name of the test's type parameter, or NULL if
+  //                   this is not a typed or a type-parameterized test.
+  //   set_up_tc:      pointer to the function that sets up the test case
+  //   tear_down_tc:   pointer to the function that tears down the test case
+  TestCase* GetTestCase(const char* test_case_name,
+                        const char* type_param,
+                        Test::SetUpTestCaseFunc set_up_tc,
+                        Test::TearDownTestCaseFunc tear_down_tc);
+
+  // Adds a TestInfo to the unit test.
+  //
+  // Arguments:
+  //
+  //   set_up_tc:    pointer to the function that sets up the test case
+  //   tear_down_tc: pointer to the function that tears down the test case
+  //   test_info:    the TestInfo object
+  void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
+                   Test::TearDownTestCaseFunc tear_down_tc,
+                   TestInfo* test_info) {
+    // In order to support thread-safe death tests, we need to
+    // remember the original working directory when the test program
+    // was first invoked.  We cannot do this in RUN_ALL_TESTS(), as
+    // the user may have changed the current directory before calling
+    // RUN_ALL_TESTS().  Therefore we capture the current directory in
+    // AddTestInfo(), which is called to register a TEST or TEST_F
+    // before main() is reached.
+    if (original_working_dir_.IsEmpty()) {
+      original_working_dir_.Set(FilePath::GetCurrentDir());
+      GTEST_CHECK_(!original_working_dir_.IsEmpty())
+          << "Failed to get the current working directory.";
+    }
+
+    GetTestCase(test_info->test_case_name(),
+                test_info->type_param(),
+                set_up_tc,
+                tear_down_tc)->AddTestInfo(test_info);
+  }
+
+#if GTEST_HAS_PARAM_TEST
+  // Returns ParameterizedTestCaseRegistry object used to keep track of
+  // value-parameterized tests and instantiate and register them.
+  internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
+    return parameterized_test_registry_;
+  }
+#endif  // GTEST_HAS_PARAM_TEST
+
+  // Sets the TestCase object for the test that's currently running.
+  void set_current_test_case(TestCase* a_current_test_case) {
+    current_test_case_ = a_current_test_case;
+  }
+
+  // Sets the TestInfo object for the test that's currently running.  If
+  // current_test_info is NULL, the assertion results will be stored in
+  // ad_hoc_test_result_.
+  void set_current_test_info(TestInfo* a_current_test_info) {
+    current_test_info_ = a_current_test_info;
+  }
+
+  // Registers all parameterized tests defined using TEST_P and
+  // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
+  // combination. This method can be called more then once; it has guards
+  // protecting from registering the tests more then once.  If
+  // value-parameterized tests are disabled, RegisterParameterizedTests is
+  // present but does nothing.
+  void RegisterParameterizedTests();
+
+  // Runs all tests in this UnitTest object, prints the result, and
+  // returns true if all tests are successful.  If any exception is
+  // thrown during a test, this test is considered to be failed, but
+  // the rest of the tests will still be run.
+  bool RunAllTests();
+
+  // Clears the results of all tests, except the ad hoc tests.
+  void ClearNonAdHocTestResult() {
+    ForEach(test_cases_, TestCase::ClearTestCaseResult);
+  }
+
+  // Clears the results of ad-hoc test assertions.
+  void ClearAdHocTestResult() {
+    ad_hoc_test_result_.Clear();
+  }
+
+  // Adds a TestProperty to the current TestResult object when invoked in a
+  // context of a test or a test case, or to the global property set. If the
+  // result already contains a property with the same key, the value will be
+  // updated.
+  void RecordProperty(const TestProperty& test_property);
+
+  enum ReactionToSharding {
+    HONOR_SHARDING_PROTOCOL,
+    IGNORE_SHARDING_PROTOCOL
+  };
+
+  // Matches the full name of each test against the user-specified
+  // filter to decide whether the test should run, then records the
+  // result in each TestCase and TestInfo object.
+  // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
+  // based on sharding variables in the environment.
+  // Returns the number of tests that should run.
+  int FilterTests(ReactionToSharding shard_tests);
+
+  // Prints the names of the tests matching the user-specified filter flag.
+  void ListTestsMatchingFilter();
+
+  const TestCase* current_test_case() const { return current_test_case_; }
+  TestInfo* current_test_info() { return current_test_info_; }
+  const TestInfo* current_test_info() const { return current_test_info_; }
+
+  // Returns the vector of environments that need to be set-up/torn-down
+  // before/after the tests are run.
+  std::vector<Environment*>& environments() { return environments_; }
+
+  // Getters for the per-thread Google Test trace stack.
+  std::vector<TraceInfo>& gtest_trace_stack() {
+    return *(gtest_trace_stack_.pointer());
+  }
+  const std::vector<TraceInfo>& gtest_trace_stack() const {
+    return gtest_trace_stack_.get();
+  }
+
+#if GTEST_HAS_DEATH_TEST
+  void InitDeathTestSubprocessControlInfo() {
+    internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
+  }
+  // Returns a pointer to the parsed --gtest_internal_run_death_test
+  // flag, or NULL if that flag was not specified.
+  // This information is useful only in a death test child process.
+  // Must not be called before a call to InitGoogleTest.
+  const InternalRunDeathTestFlag* internal_run_death_test_flag() const {
+    return internal_run_death_test_flag_.get();
+  }
+
+  // Returns a pointer to the current death test factory.
+  internal::DeathTestFactory* death_test_factory() {
+    return death_test_factory_.get();
+  }
+
+  void SuppressTestEventsIfInSubprocess();
+
+  friend class ReplaceDeathTestFactory;
+#endif  // GTEST_HAS_DEATH_TEST
+
+  // Initializes the event listener performing XML output as specified by
+  // UnitTestOptions. Must not be called before InitGoogleTest.
+  void ConfigureXmlOutput();
+
+#if GTEST_CAN_STREAM_RESULTS_
+  // Initializes the event listener for streaming test results to a socket.
+  // Must not be called before InitGoogleTest.
+  void ConfigureStreamingOutput();
+#endif
+
+  // Performs initialization dependent upon flag values obtained in
+  // ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to
+  // ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest
+  // this function is also called from RunAllTests.  Since this function can be
+  // called more than once, it has to be idempotent.
+  void PostFlagParsingInit();
+
+  // Gets the random seed used at the start of the current test iteration.
+  int random_seed() const { return random_seed_; }
+
+  // Gets the random number generator.
+  internal::Random* random() { return &random_; }
+
+  // Shuffles all test cases, and the tests within each test case,
+  // making sure that death tests are still run first.
+  void ShuffleTests();
+
+  // Restores the test cases and tests to their order before the first shuffle.
+  void UnshuffleTests();
+
+  // Returns the value of GTEST_FLAG(catch_exceptions) at the moment
+  // UnitTest::Run() starts.
+  bool catch_exceptions() const { return catch_exceptions_; }
+
+ private:
+  friend class ::testing::UnitTest;
+
+  // Used by UnitTest::Run() to capture the state of
+  // GTEST_FLAG(catch_exceptions) at the moment it starts.
+  void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
+
+  // The UnitTest object that owns this implementation object.
+  UnitTest* const parent_;
+
+  // The working directory when the first TEST() or TEST_F() was
+  // executed.
+  internal::FilePath original_working_dir_;
+
+  // The default test part result reporters.
+  DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
+  DefaultPerThreadTestPartResultReporter
+      default_per_thread_test_part_result_reporter_;
+
+  // Points to (but doesn't own) the global test part result reporter.
+  TestPartResultReporterInterface* global_test_part_result_repoter_;
+
+  // Protects read and write access to global_test_part_result_reporter_.
+  internal::Mutex global_test_part_result_reporter_mutex_;
+
+  // Points to (but doesn't own) the per-thread test part result reporter.
+  internal::ThreadLocal<TestPartResultReporterInterface*>
+      per_thread_test_part_result_reporter_;
+
+  // The vector of environments that need to be set-up/torn-down
+  // before/after the tests are run.
+  std::vector<Environment*> environments_;
+
+  // The vector of TestCases in their original order.  It owns the
+  // elements in the vector.
+  std::vector<TestCase*> test_cases_;
+
+  // Provides a level of indirection for the test case list to allow
+  // easy shuffling and restoring the test case order.  The i-th
+  // element of this vector is the index of the i-th test case in the
+  // shuffled order.
+  std::vector<int> test_case_indices_;
+
+#if GTEST_HAS_PARAM_TEST
+  // ParameterizedTestRegistry object used to register value-parameterized
+  // tests.
+  internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
+
+  // Indicates whether RegisterParameterizedTests() has been called already.
+  bool parameterized_tests_registered_;
+#endif  // GTEST_HAS_PARAM_TEST
+
+  // Index of the last death test case registered.  Initially -1.
+  int last_death_test_case_;
+
+  // This points to the TestCase for the currently running test.  It
+  // changes as Google Test goes through one test case after another.
+  // When no test is running, this is set to NULL and Google Test
+  // stores assertion results in ad_hoc_test_result_.  Initially NULL.
+  TestCase* current_test_case_;
+
+  // This points to the TestInfo for the currently running test.  It
+  // changes as Google Test goes through one test after another.  When
+  // no test is running, this is set to NULL and Google Test stores
+  // assertion results in ad_hoc_test_result_.  Initially NULL.
+  TestInfo* current_test_info_;
+
+  // Normally, a user only writes assertions inside a TEST or TEST_F,
+  // or inside a function called by a TEST or TEST_F.  Since Google
+  // Test keeps track of which test is current running, it can
+  // associate such an assertion with the test it belongs to.
+  //
+  // If an assertion is encountered when no TEST or TEST_F is running,
+  // Google Test attributes the assertion result to an imaginary "ad hoc"
+  // test, and records the result in ad_hoc_test_result_.
+  TestResult ad_hoc_test_result_;
+
+  // The list of event listeners that can be used to track events inside
+  // Google Test.
+  TestEventListeners listeners_;
+
+  // The OS stack trace getter.  Will be deleted when the UnitTest
+  // object is destructed.  By default, an OsStackTraceGetter is used,
+  // but the user can set this field to use a custom getter if that is
+  // desired.
+  OsStackTraceGetterInterface* os_stack_trace_getter_;
+
+  // True iff PostFlagParsingInit() has been called.
+  bool post_flag_parse_init_performed_;
+
+  // The random number seed used at the beginning of the test run.
+  int random_seed_;
+
+  // Our random number generator.
+  internal::Random random_;
+
+  // The time of the test program start, in ms from the start of the
+  // UNIX epoch.
+  TimeInMillis start_timestamp_;
+
+  // How long the test took to run, in milliseconds.
+  TimeInMillis elapsed_time_;
+
+#if GTEST_HAS_DEATH_TEST
+  // The decomposed components of the gtest_internal_run_death_test flag,
+  // parsed when RUN_ALL_TESTS is called.
+  internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
+  internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
+#endif  // GTEST_HAS_DEATH_TEST
+
+  // A per-thread stack of traces created by the SCOPED_TRACE() macro.
+  internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
+
+  // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()
+  // starts.
+  bool catch_exceptions_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
+};  // class UnitTestImpl
+
+// Convenience function for accessing the global UnitTest
+// implementation object.
+inline UnitTestImpl* GetUnitTestImpl() {
+  return UnitTest::GetInstance()->impl();
+}
+
+#if GTEST_USES_SIMPLE_RE
+
+// Internal helper functions for implementing the simple regular
+// expression matcher.
+GTEST_API_ bool IsInSet(char ch, const char* str);
+GTEST_API_ bool IsAsciiDigit(char ch);
+GTEST_API_ bool IsAsciiPunct(char ch);
+GTEST_API_ bool IsRepeat(char ch);
+GTEST_API_ bool IsAsciiWhiteSpace(char ch);
+GTEST_API_ bool IsAsciiWordChar(char ch);
+GTEST_API_ bool IsValidEscape(char ch);
+GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);
+GTEST_API_ bool ValidateRegex(const char* regex);
+GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);
+GTEST_API_ bool MatchRepetitionAndRegexAtHead(
+    bool escaped, char ch, char repeat, const char* regex, const char* str);
+GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);
+
+#endif  // GTEST_USES_SIMPLE_RE
+
+// Parses the command line for Google Test flags, without initializing
+// other parts of Google Test.
+GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);
+GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
+
+#if GTEST_HAS_DEATH_TEST
+
+// Returns the message describing the last system error, regardless of the
+// platform.
+GTEST_API_ std::string GetLastErrnoDescription();
+
+// Attempts to parse a string into a positive integer pointed to by the
+// number parameter.  Returns true if that is possible.
+// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
+// it here.
+template <typename Integer>
+bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
+  // Fail fast if the given string does not begin with a digit;
+  // this bypasses strtoXXX's "optional leading whitespace and plus
+  // or minus sign" semantics, which are undesirable here.
+  if (str.empty() || !IsDigit(str[0])) {
+    return false;
+  }
+  errno = 0;
+
+  char* end;
+  // BiggestConvertible is the largest integer type that system-provided
+  // string-to-number conversion routines can return.
+
+# if GTEST_OS_WINDOWS && !defined(__GNUC__)
+
+  // MSVC and C++ Builder define __int64 instead of the standard long long.
+  typedef unsigned __int64 BiggestConvertible;
+  const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);
+
+# else
+
+  typedef unsigned long long BiggestConvertible;  // NOLINT
+  const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);
+
+# endif  // GTEST_OS_WINDOWS && !defined(__GNUC__)
+
+  const bool parse_success = *end == '\0' && errno == 0;
+
+  // TODO(vladl@google.com): Convert this to compile time assertion when it is
+  // available.
+  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
+
+  const Integer result = static_cast<Integer>(parsed);
+  if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
+    *number = result;
+    return true;
+  }
+  return false;
+}
+#endif  // GTEST_HAS_DEATH_TEST
+
+// TestResult contains some private methods that should be hidden from
+// Google Test user but are required for testing. This class allow our tests
+// to access them.
+//
+// This class is supplied only for the purpose of testing Google Test's own
+// constructs. Do not use it in user tests, either directly or indirectly.
+class TestResultAccessor {
+ public:
+  static void RecordProperty(TestResult* test_result,
+                             const std::string& xml_element,
+                             const TestProperty& property) {
+    test_result->RecordProperty(xml_element, property);
+  }
+
+  static void ClearTestPartResults(TestResult* test_result) {
+    test_result->ClearTestPartResults();
+  }
+
+  static const std::vector<testing::TestPartResult>& test_part_results(
+      const TestResult& test_result) {
+    return test_result.test_part_results();
+  }
+};
+
+#if GTEST_CAN_STREAM_RESULTS_
+
+// Streams test results to the given port on the given host machine.
+class GTEST_API_ StreamingListener : public EmptyTestEventListener {
+ public:
+  // Abstract base class for writing strings to a socket.
+  class AbstractSocketWriter {
+   public:
+    virtual ~AbstractSocketWriter() {}
+
+    // Sends a string to the socket.
+    virtual void Send(const string& message) = 0;
+
+    // Closes the socket.
+    virtual void CloseConnection() {}
+
+    // Sends a string and a newline to the socket.
+    void SendLn(const string& message) {
+      Send(message + "\n");
+    }
+  };
+
+  // Concrete class for actually writing strings to a socket.
+  class SocketWriter : public AbstractSocketWriter {
+   public:
+    SocketWriter(const string& host, const string& port)
+        : sockfd_(-1), host_name_(host), port_num_(port) {
+      MakeConnection();
+    }
+
+    virtual ~SocketWriter() {
+      if (sockfd_ != -1)
+        CloseConnection();
+    }
+
+    // Sends a string to the socket.
+    virtual void Send(const string& message) {
+      GTEST_CHECK_(sockfd_ != -1)
+          << "Send() can be called only when there is a connection.";
+
+      const int len = static_cast<int>(message.length());
+      if (write(sockfd_, message.c_str(), len) != len) {
+        GTEST_LOG_(WARNING)
+            << "stream_result_to: failed to stream to "
+            << host_name_ << ":" << port_num_;
+      }
+    }
+
+   private:
+    // Creates a client socket and connects to the server.
+    void MakeConnection();
+
+    // Closes the socket.
+    void CloseConnection() {
+      GTEST_CHECK_(sockfd_ != -1)
+          << "CloseConnection() can be called only when there is a connection.";
+
+      close(sockfd_);
+      sockfd_ = -1;
+    }
+
+    int sockfd_;  // socket file descriptor
+    const string host_name_;
+    const string port_num_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);
+  };  // class SocketWriter
+
+  // Escapes '=', '&', '%', and '\n' characters in str as "%xx".
+  static string UrlEncode(const char* str);
+
+  StreamingListener(const string& host, const string& port)
+      : socket_writer_(new SocketWriter(host, port)) { Start(); }
+
+  explicit StreamingListener(AbstractSocketWriter* socket_writer)
+      : socket_writer_(socket_writer) { Start(); }
+
+  void OnTestProgramStart(const UnitTest& /* unit_test */) {
+    SendLn("event=TestProgramStart");
+  }
+
+  void OnTestProgramEnd(const UnitTest& unit_test) {
+    // Note that Google Test current only report elapsed time for each
+    // test iteration, not for the entire test program.
+    SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
+
+    // Notify the streaming server to stop.
+    socket_writer_->CloseConnection();
+  }
+
+  void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
+    SendLn("event=TestIterationStart&iteration=" +
+           StreamableToString(iteration));
+  }
+
+  void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
+    SendLn("event=TestIterationEnd&passed=" +
+           FormatBool(unit_test.Passed()) + "&elapsed_time=" +
+           StreamableToString(unit_test.elapsed_time()) + "ms");
+  }
+
+  void OnTestCaseStart(const TestCase& test_case) {
+    SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
+  }
+
+  void OnTestCaseEnd(const TestCase& test_case) {
+    SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
+           + "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
+           + "ms");
+  }
+
+  void OnTestStart(const TestInfo& test_info) {
+    SendLn(std::string("event=TestStart&name=") + test_info.name());
+  }
+
+  void OnTestEnd(const TestInfo& test_info) {
+    SendLn("event=TestEnd&passed=" +
+           FormatBool((test_info.result())->Passed()) +
+           "&elapsed_time=" +
+           StreamableToString((test_info.result())->elapsed_time()) + "ms");
+  }
+
+  void OnTestPartResult(const TestPartResult& test_part_result) {
+    const char* file_name = test_part_result.file_name();
+    if (file_name == NULL)
+      file_name = "";
+    SendLn("event=TestPartResult&file=" + UrlEncode(file_name) +
+           "&line=" + StreamableToString(test_part_result.line_number()) +
+           "&message=" + UrlEncode(test_part_result.message()));
+  }
+
+ private:
+  // Sends the given message and a newline to the socket.
+  void SendLn(const string& message) { socket_writer_->SendLn(message); }
+
+  // Called at the start of streaming to notify the receiver what
+  // protocol we are using.
+  void Start() { SendLn("gtest_streaming_protocol_version=1.0"); }
+
+  string FormatBool(bool value) { return value ? "1" : "0"; }
+
+  const scoped_ptr<AbstractSocketWriter> socket_writer_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
+};  // class StreamingListener
+
+#endif  // GTEST_CAN_STREAM_RESULTS_
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GTEST_SRC_GTEST_INTERNAL_INL_H_
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-port.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-port.cc
new file mode 100644
index 0000000..e5bf3dd
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-port.cc
@@ -0,0 +1,1259 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include "gtest/internal/gtest-port.h"
+
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fstream>
+
+#if GTEST_OS_WINDOWS
+# include <windows.h>
+# include <io.h>
+# include <sys/stat.h>
+# include <map>  // Used in ThreadLocal.
+#else
+# include <unistd.h>
+#endif  // GTEST_OS_WINDOWS
+
+#if GTEST_OS_MAC
+# include <mach/mach_init.h>
+# include <mach/task.h>
+# include <mach/vm_map.h>
+#endif  // GTEST_OS_MAC
+
+#if GTEST_OS_QNX
+# include <devctl.h>
+# include <fcntl.h>
+# include <sys/procfs.h>
+#endif  // GTEST_OS_QNX
+
+#if GTEST_OS_AIX
+# include <procinfo.h>
+# include <sys/types.h>
+#endif  // GTEST_OS_AIX
+
+#include "gtest/gtest-spi.h"
+#include "gtest/gtest-message.h"
+#include "gtest/internal/gtest-internal.h"
+#include "gtest/internal/gtest-string.h"
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+namespace testing {
+namespace internal {
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
+const int kStdOutFileno = 1;
+const int kStdErrFileno = 2;
+#else
+const int kStdOutFileno = STDOUT_FILENO;
+const int kStdErrFileno = STDERR_FILENO;
+#endif  // _MSC_VER
+
+#if GTEST_OS_LINUX
+
+namespace {
+template <typename T>
+T ReadProcFileField(const string& filename, int field) {
+  std::string dummy;
+  std::ifstream file(filename.c_str());
+  while (field-- > 0) {
+    file >> dummy;
+  }
+  T output = 0;
+  file >> output;
+  return output;
+}
+}  // namespace
+
+// Returns the number of active threads, or 0 when there is an error.
+size_t GetThreadCount() {
+  const string filename =
+      (Message() << "/proc/" << getpid() << "/stat").GetString();
+  return ReadProcFileField<int>(filename, 19);
+}
+
+#elif GTEST_OS_MAC
+
+size_t GetThreadCount() {
+  const task_t task = mach_task_self();
+  mach_msg_type_number_t thread_count;
+  thread_act_array_t thread_list;
+  const kern_return_t status = task_threads(task, &thread_list, &thread_count);
+  if (status == KERN_SUCCESS) {
+    // task_threads allocates resources in thread_list and we need to free them
+    // to avoid leaks.
+    vm_deallocate(task,
+                  reinterpret_cast<vm_address_t>(thread_list),
+                  sizeof(thread_t) * thread_count);
+    return static_cast<size_t>(thread_count);
+  } else {
+    return 0;
+  }
+}
+
+#elif GTEST_OS_QNX
+
+// Returns the number of threads running in the process, or 0 to indicate that
+// we cannot detect it.
+size_t GetThreadCount() {
+  const int fd = open("/proc/self/as", O_RDONLY);
+  if (fd < 0) {
+    return 0;
+  }
+  procfs_info process_info;
+  const int status =
+      devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);
+  close(fd);
+  if (status == EOK) {
+    return static_cast<size_t>(process_info.num_threads);
+  } else {
+    return 0;
+  }
+}
+
+#elif GTEST_OS_AIX
+
+size_t GetThreadCount() {
+  struct procentry64 entry;
+  pid_t pid = getpid();
+  int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
+  if (status == 1) {
+    return entry.pi_thcount;
+  } else {
+    return 0;
+  }
+}
+
+#else
+
+size_t GetThreadCount() {
+  // There's no portable way to detect the number of threads, so we just
+  // return 0 to indicate that we cannot detect it.
+  return 0;
+}
+
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+
+void SleepMilliseconds(int n) {
+  ::Sleep(n);
+}
+
+AutoHandle::AutoHandle()
+    : handle_(INVALID_HANDLE_VALUE) {}
+
+AutoHandle::AutoHandle(Handle handle)
+    : handle_(handle) {}
+
+AutoHandle::~AutoHandle() {
+  Reset();
+}
+
+AutoHandle::Handle AutoHandle::Get() const {
+  return handle_;
+}
+
+void AutoHandle::Reset() {
+  Reset(INVALID_HANDLE_VALUE);
+}
+
+void AutoHandle::Reset(HANDLE handle) {
+  // Resetting with the same handle we already own is invalid.
+  if (handle_ != handle) {
+    if (IsCloseable()) {
+      ::CloseHandle(handle_);
+    }
+    handle_ = handle;
+  } else {
+    GTEST_CHECK_(!IsCloseable())
+        << "Resetting a valid handle to itself is likely a programmer error "
+            "and thus not allowed.";
+  }
+}
+
+bool AutoHandle::IsCloseable() const {
+  // Different Windows APIs may use either of these values to represent an
+  // invalid handle.
+  return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
+}
+
+Notification::Notification()
+    : event_(::CreateEvent(NULL,   // Default security attributes.
+                           TRUE,   // Do not reset automatically.
+                           FALSE,  // Initially unset.
+                           NULL)) {  // Anonymous event.
+  GTEST_CHECK_(event_.Get() != NULL);
+}
+
+void Notification::Notify() {
+  GTEST_CHECK_(::SetEvent(event_.Get()) != FALSE);
+}
+
+void Notification::WaitForNotification() {
+  GTEST_CHECK_(
+      ::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);
+}
+
+Mutex::Mutex()
+    : owner_thread_id_(0),
+      type_(kDynamic),
+      critical_section_init_phase_(0),
+      critical_section_(new CRITICAL_SECTION) {
+  ::InitializeCriticalSection(critical_section_);
+}
+
+Mutex::~Mutex() {
+  // Static mutexes are leaked intentionally. It is not thread-safe to try
+  // to clean them up.
+  // TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
+  // nothing to clean it up but is available only on Vista and later.
+  // http://msdn.microsoft.com/en-us/library/windows/desktop/aa904937.aspx
+  if (type_ == kDynamic) {
+    ::DeleteCriticalSection(critical_section_);
+    delete critical_section_;
+    critical_section_ = NULL;
+  }
+}
+
+void Mutex::Lock() {
+  ThreadSafeLazyInit();
+  ::EnterCriticalSection(critical_section_);
+  owner_thread_id_ = ::GetCurrentThreadId();
+}
+
+void Mutex::Unlock() {
+  ThreadSafeLazyInit();
+  // We don't protect writing to owner_thread_id_ here, as it's the
+  // caller's responsibility to ensure that the current thread holds the
+  // mutex when this is called.
+  owner_thread_id_ = 0;
+  ::LeaveCriticalSection(critical_section_);
+}
+
+// Does nothing if the current thread holds the mutex. Otherwise, crashes
+// with high probability.
+void Mutex::AssertHeld() {
+  ThreadSafeLazyInit();
+  GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
+      << "The current thread is not holding the mutex @" << this;
+}
+
+// Initializes owner_thread_id_ and critical_section_ in static mutexes.
+void Mutex::ThreadSafeLazyInit() {
+  // Dynamic mutexes are initialized in the constructor.
+  if (type_ == kStatic) {
+    switch (
+        ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
+      case 0:
+        // If critical_section_init_phase_ was 0 before the exchange, we
+        // are the first to test it and need to perform the initialization.
+        owner_thread_id_ = 0;
+        critical_section_ = new CRITICAL_SECTION;
+        ::InitializeCriticalSection(critical_section_);
+        // Updates the critical_section_init_phase_ to 2 to signal
+        // initialization complete.
+        GTEST_CHECK_(::InterlockedCompareExchange(
+                          &critical_section_init_phase_, 2L, 1L) ==
+                      1L);
+        break;
+      case 1:
+        // Somebody else is already initializing the mutex; spin until they
+        // are done.
+        while (::InterlockedCompareExchange(&critical_section_init_phase_,
+                                            2L,
+                                            2L) != 2L) {
+          // Possibly yields the rest of the thread's time slice to other
+          // threads.
+          ::Sleep(0);
+        }
+        break;
+
+      case 2:
+        break;  // The mutex is already initialized and ready for use.
+
+      default:
+        GTEST_CHECK_(false)
+            << "Unexpected value of critical_section_init_phase_ "
+            << "while initializing a static mutex.";
+    }
+  }
+}
+
+namespace {
+
+class ThreadWithParamSupport : public ThreadWithParamBase {
+ public:
+  static HANDLE CreateThread(Runnable* runnable,
+                             Notification* thread_can_start) {
+    ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
+    DWORD thread_id;
+    // TODO(yukawa): Consider to use _beginthreadex instead.
+    HANDLE thread_handle = ::CreateThread(
+        NULL,    // Default security.
+        0,       // Default stack size.
+        &ThreadWithParamSupport::ThreadMain,
+        param,   // Parameter to ThreadMainStatic
+        0x0,     // Default creation flags.
+        &thread_id);  // Need a valid pointer for the call to work under Win98.
+    GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
+                                        << ::GetLastError() << ".";
+    if (thread_handle == NULL) {
+      delete param;
+    }
+    return thread_handle;
+  }
+
+ private:
+  struct ThreadMainParam {
+    ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
+        : runnable_(runnable),
+          thread_can_start_(thread_can_start) {
+    }
+    scoped_ptr<Runnable> runnable_;
+    // Does not own.
+    Notification* thread_can_start_;
+  };
+
+  static DWORD WINAPI ThreadMain(void* ptr) {
+    // Transfers ownership.
+    scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
+    if (param->thread_can_start_ != NULL)
+      param->thread_can_start_->WaitForNotification();
+    param->runnable_->Run();
+    return 0;
+  }
+
+  // Prohibit instantiation.
+  ThreadWithParamSupport();
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);
+};
+
+}  // namespace
+
+ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+                                         Notification* thread_can_start)
+      : thread_(ThreadWithParamSupport::CreateThread(runnable,
+                                                     thread_can_start)) {
+}
+
+ThreadWithParamBase::~ThreadWithParamBase() {
+  Join();
+}
+
+void ThreadWithParamBase::Join() {
+  GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
+      << "Failed to join the thread with error " << ::GetLastError() << ".";
+}
+
+// Maps a thread to a set of ThreadIdToThreadLocals that have values
+// instantiated on that thread and notifies them when the thread exits.  A
+// ThreadLocal instance is expected to persist until all threads it has
+// values on have terminated.
+class ThreadLocalRegistryImpl {
+ public:
+  // Registers thread_local_instance as having value on the current thread.
+  // Returns a value that can be used to identify the thread from other threads.
+  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance) {
+    DWORD current_thread = ::GetCurrentThreadId();
+    MutexLock lock(&mutex_);
+    ThreadIdToThreadLocals* const thread_to_thread_locals =
+        GetThreadLocalsMapLocked();
+    ThreadIdToThreadLocals::iterator thread_local_pos =
+        thread_to_thread_locals->find(current_thread);
+    if (thread_local_pos == thread_to_thread_locals->end()) {
+      thread_local_pos = thread_to_thread_locals->insert(
+          std::make_pair(current_thread, ThreadLocalValues())).first;
+      StartWatcherThreadFor(current_thread);
+    }
+    ThreadLocalValues& thread_local_values = thread_local_pos->second;
+    ThreadLocalValues::iterator value_pos =
+        thread_local_values.find(thread_local_instance);
+    if (value_pos == thread_local_values.end()) {
+      value_pos =
+          thread_local_values
+              .insert(std::make_pair(
+                  thread_local_instance,
+                  linked_ptr<ThreadLocalValueHolderBase>(
+                      thread_local_instance->NewValueForCurrentThread())))
+              .first;
+    }
+    return value_pos->second.get();
+  }
+
+  static void OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance) {
+    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+    // Clean up the ThreadLocalValues data structure while holding the lock, but
+    // defer the destruction of the ThreadLocalValueHolderBases.
+    {
+      MutexLock lock(&mutex_);
+      ThreadIdToThreadLocals* const thread_to_thread_locals =
+          GetThreadLocalsMapLocked();
+      for (ThreadIdToThreadLocals::iterator it =
+          thread_to_thread_locals->begin();
+          it != thread_to_thread_locals->end();
+          ++it) {
+        ThreadLocalValues& thread_local_values = it->second;
+        ThreadLocalValues::iterator value_pos =
+            thread_local_values.find(thread_local_instance);
+        if (value_pos != thread_local_values.end()) {
+          value_holders.push_back(value_pos->second);
+          thread_local_values.erase(value_pos);
+          // This 'if' can only be successful at most once, so theoretically we
+          // could break out of the loop here, but we don't bother doing so.
+        }
+      }
+    }
+    // Outside the lock, let the destructor for 'value_holders' deallocate the
+    // ThreadLocalValueHolderBases.
+  }
+
+  static void OnThreadExit(DWORD thread_id) {
+    GTEST_CHECK_(thread_id != 0) << ::GetLastError();
+    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+    // Clean up the ThreadIdToThreadLocals data structure while holding the
+    // lock, but defer the destruction of the ThreadLocalValueHolderBases.
+    {
+      MutexLock lock(&mutex_);
+      ThreadIdToThreadLocals* const thread_to_thread_locals =
+          GetThreadLocalsMapLocked();
+      ThreadIdToThreadLocals::iterator thread_local_pos =
+          thread_to_thread_locals->find(thread_id);
+      if (thread_local_pos != thread_to_thread_locals->end()) {
+        ThreadLocalValues& thread_local_values = thread_local_pos->second;
+        for (ThreadLocalValues::iterator value_pos =
+            thread_local_values.begin();
+            value_pos != thread_local_values.end();
+            ++value_pos) {
+          value_holders.push_back(value_pos->second);
+        }
+        thread_to_thread_locals->erase(thread_local_pos);
+      }
+    }
+    // Outside the lock, let the destructor for 'value_holders' deallocate the
+    // ThreadLocalValueHolderBases.
+  }
+
+ private:
+  // In a particular thread, maps a ThreadLocal object to its value.
+  typedef std::map<const ThreadLocalBase*,
+                   linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
+  // Stores all ThreadIdToThreadLocals having values in a thread, indexed by
+  // thread's ID.
+  typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
+
+  // Holds the thread id and thread handle that we pass from
+  // StartWatcherThreadFor to WatcherThreadFunc.
+  typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
+
+  static void StartWatcherThreadFor(DWORD thread_id) {
+    // The returned handle will be kept in thread_map and closed by
+    // watcher_thread in WatcherThreadFunc.
+    HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
+                                 FALSE,
+                                 thread_id);
+    GTEST_CHECK_(thread != NULL);
+    // We need to to pass a valid thread ID pointer into CreateThread for it
+    // to work correctly under Win98.
+    DWORD watcher_thread_id;
+    HANDLE watcher_thread = ::CreateThread(
+        NULL,   // Default security.
+        0,      // Default stack size
+        &ThreadLocalRegistryImpl::WatcherThreadFunc,
+        reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
+        CREATE_SUSPENDED,
+        &watcher_thread_id);
+    GTEST_CHECK_(watcher_thread != NULL);
+    // Give the watcher thread the same priority as ours to avoid being
+    // blocked by it.
+    ::SetThreadPriority(watcher_thread,
+                        ::GetThreadPriority(::GetCurrentThread()));
+    ::ResumeThread(watcher_thread);
+    ::CloseHandle(watcher_thread);
+  }
+
+  // Monitors exit from a given thread and notifies those
+  // ThreadIdToThreadLocals about thread termination.
+  static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+    const ThreadIdAndHandle* tah =
+        reinterpret_cast<const ThreadIdAndHandle*>(param);
+    GTEST_CHECK_(
+        ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+    OnThreadExit(tah->first);
+    ::CloseHandle(tah->second);
+    delete tah;
+    return 0;
+  }
+
+  // Returns map of thread local instances.
+  static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
+    mutex_.AssertHeld();
+    static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
+    return map;
+  }
+
+  // Protects access to GetThreadLocalsMapLocked() and its return value.
+  static Mutex mutex_;
+  // Protects access to GetThreadMapLocked() and its return value.
+  static Mutex thread_map_mutex_;
+};
+
+Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);
+Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);
+
+ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance) {
+  return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
+      thread_local_instance);
+}
+
+void ThreadLocalRegistry::OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance) {
+  ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
+}
+
+#endif  // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+
+#if GTEST_USES_POSIX_RE
+
+// Implements RE.  Currently only needed for death tests.
+
+RE::~RE() {
+  if (is_valid_) {
+    // regfree'ing an invalid regex might crash because the content
+    // of the regex is undefined. Since the regex's are essentially
+    // the same, one cannot be valid (or invalid) without the other
+    // being so too.
+    regfree(&partial_regex_);
+    regfree(&full_regex_);
+  }
+  free(const_cast<char*>(pattern_));
+}
+
+// Returns true iff regular expression re matches the entire str.
+bool RE::FullMatch(const char* str, const RE& re) {
+  if (!re.is_valid_) return false;
+
+  regmatch_t match;
+  return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
+}
+
+// Returns true iff regular expression re matches a substring of str
+// (including str itself).
+bool RE::PartialMatch(const char* str, const RE& re) {
+  if (!re.is_valid_) return false;
+
+  regmatch_t match;
+  return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
+}
+
+// Initializes an RE from its string representation.
+void RE::Init(const char* regex) {
+  pattern_ = posix::StrDup(regex);
+
+  // Reserves enough bytes to hold the regular expression used for a
+  // full match.
+  const size_t full_regex_len = strlen(regex) + 10;
+  char* const full_pattern = new char[full_regex_len];
+
+  snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
+  is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
+  // We want to call regcomp(&partial_regex_, ...) even if the
+  // previous expression returns false.  Otherwise partial_regex_ may
+  // not be properly initialized can may cause trouble when it's
+  // freed.
+  //
+  // Some implementation of POSIX regex (e.g. on at least some
+  // versions of Cygwin) doesn't accept the empty string as a valid
+  // regex.  We change it to an equivalent form "()" to be safe.
+  if (is_valid_) {
+    const char* const partial_regex = (*regex == '\0') ? "()" : regex;
+    is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
+  }
+  EXPECT_TRUE(is_valid_)
+      << "Regular expression \"" << regex
+      << "\" is not a valid POSIX Extended regular expression.";
+
+  delete[] full_pattern;
+}
+
+#elif GTEST_USES_SIMPLE_RE
+
+// Returns true iff ch appears anywhere in str (excluding the
+// terminating '\0' character).
+bool IsInSet(char ch, const char* str) {
+  return ch != '\0' && strchr(str, ch) != NULL;
+}
+
+// Returns true iff ch belongs to the given classification.  Unlike
+// similar functions in <ctype.h>, these aren't affected by the
+// current locale.
+bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }
+bool IsAsciiPunct(char ch) {
+  return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
+}
+bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }
+bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }
+bool IsAsciiWordChar(char ch) {
+  return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||
+      ('0' <= ch && ch <= '9') || ch == '_';
+}
+
+// Returns true iff "\\c" is a supported escape sequence.
+bool IsValidEscape(char c) {
+  return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));
+}
+
+// Returns true iff the given atom (specified by escaped and pattern)
+// matches ch.  The result is undefined if the atom is invalid.
+bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
+  if (escaped) {  // "\\p" where p is pattern_char.
+    switch (pattern_char) {
+      case 'd': return IsAsciiDigit(ch);
+      case 'D': return !IsAsciiDigit(ch);
+      case 'f': return ch == '\f';
+      case 'n': return ch == '\n';
+      case 'r': return ch == '\r';
+      case 's': return IsAsciiWhiteSpace(ch);
+      case 'S': return !IsAsciiWhiteSpace(ch);
+      case 't': return ch == '\t';
+      case 'v': return ch == '\v';
+      case 'w': return IsAsciiWordChar(ch);
+      case 'W': return !IsAsciiWordChar(ch);
+    }
+    return IsAsciiPunct(pattern_char) && pattern_char == ch;
+  }
+
+  return (pattern_char == '.' && ch != '\n') || pattern_char == ch;
+}
+
+// Helper function used by ValidateRegex() to format error messages.
+std::string FormatRegexSyntaxError(const char* regex, int index) {
+  return (Message() << "Syntax error at index " << index
+          << " in simple regular expression \"" << regex << "\": ").GetString();
+}
+
+// Generates non-fatal failures and returns false if regex is invalid;
+// otherwise returns true.
+bool ValidateRegex(const char* regex) {
+  if (regex == NULL) {
+    // TODO(wan@google.com): fix the source file location in the
+    // assertion failures to match where the regex is used in user
+    // code.
+    ADD_FAILURE() << "NULL is not a valid simple regular expression.";
+    return false;
+  }
+
+  bool is_valid = true;
+
+  // True iff ?, *, or + can follow the previous atom.
+  bool prev_repeatable = false;
+  for (int i = 0; regex[i]; i++) {
+    if (regex[i] == '\\') {  // An escape sequence
+      i++;
+      if (regex[i] == '\0') {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
+                      << "'\\' cannot appear at the end.";
+        return false;
+      }
+
+      if (!IsValidEscape(regex[i])) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
+                      << "invalid escape sequence \"\\" << regex[i] << "\".";
+        is_valid = false;
+      }
+      prev_repeatable = true;
+    } else {  // Not an escape sequence.
+      const char ch = regex[i];
+
+      if (ch == '^' && i > 0) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'^' can only appear at the beginning.";
+        is_valid = false;
+      } else if (ch == '$' && regex[i + 1] != '\0') {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'$' can only appear at the end.";
+        is_valid = false;
+      } else if (IsInSet(ch, "()[]{}|")) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'" << ch << "' is unsupported.";
+        is_valid = false;
+      } else if (IsRepeat(ch) && !prev_repeatable) {
+        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
+                      << "'" << ch << "' can only follow a repeatable token.";
+        is_valid = false;
+      }
+
+      prev_repeatable = !IsInSet(ch, "^$?*+");
+    }
+  }
+
+  return is_valid;
+}
+
+// Matches a repeated regex atom followed by a valid simple regular
+// expression.  The regex atom is defined as c if escaped is false,
+// or \c otherwise.  repeat is the repetition meta character (?, *,
+// or +).  The behavior is undefined if str contains too many
+// characters to be indexable by size_t, in which case the test will
+// probably time out anyway.  We are fine with this limitation as
+// std::string has it too.
+bool MatchRepetitionAndRegexAtHead(
+    bool escaped, char c, char repeat, const char* regex,
+    const char* str) {
+  const size_t min_count = (repeat == '+') ? 1 : 0;
+  const size_t max_count = (repeat == '?') ? 1 :
+      static_cast<size_t>(-1) - 1;
+  // We cannot call numeric_limits::max() as it conflicts with the
+  // max() macro on Windows.
+
+  for (size_t i = 0; i <= max_count; ++i) {
+    // We know that the atom matches each of the first i characters in str.
+    if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
+      // We have enough matches at the head, and the tail matches too.
+      // Since we only care about *whether* the pattern matches str
+      // (as opposed to *how* it matches), there is no need to find a
+      // greedy match.
+      return true;
+    }
+    if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
+      return false;
+  }
+  return false;
+}
+
+// Returns true iff regex matches a prefix of str.  regex must be a
+// valid simple regular expression and not start with "^", or the
+// result is undefined.
+bool MatchRegexAtHead(const char* regex, const char* str) {
+  if (*regex == '\0')  // An empty regex matches a prefix of anything.
+    return true;
+
+  // "$" only matches the end of a string.  Note that regex being
+  // valid guarantees that there's nothing after "$" in it.
+  if (*regex == '$')
+    return *str == '\0';
+
+  // Is the first thing in regex an escape sequence?
+  const bool escaped = *regex == '\\';
+  if (escaped)
+    ++regex;
+  if (IsRepeat(regex[1])) {
+    // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so
+    // here's an indirect recursion.  It terminates as the regex gets
+    // shorter in each recursion.
+    return MatchRepetitionAndRegexAtHead(
+        escaped, regex[0], regex[1], regex + 2, str);
+  } else {
+    // regex isn't empty, isn't "$", and doesn't start with a
+    // repetition.  We match the first atom of regex with the first
+    // character of str and recurse.
+    return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
+        MatchRegexAtHead(regex + 1, str + 1);
+  }
+}
+
+// Returns true iff regex matches any substring of str.  regex must be
+// a valid simple regular expression, or the result is undefined.
+//
+// The algorithm is recursive, but the recursion depth doesn't exceed
+// the regex length, so we won't need to worry about running out of
+// stack space normally.  In rare cases the time complexity can be
+// exponential with respect to the regex length + the string length,
+// but usually it's must faster (often close to linear).
+bool MatchRegexAnywhere(const char* regex, const char* str) {
+  if (regex == NULL || str == NULL)
+    return false;
+
+  if (*regex == '^')
+    return MatchRegexAtHead(regex + 1, str);
+
+  // A successful match can be anywhere in str.
+  do {
+    if (MatchRegexAtHead(regex, str))
+      return true;
+  } while (*str++ != '\0');
+  return false;
+}
+
+// Implements the RE class.
+
+RE::~RE() {
+  free(const_cast<char*>(pattern_));
+  free(const_cast<char*>(full_pattern_));
+}
+
+// Returns true iff regular expression re matches the entire str.
+bool RE::FullMatch(const char* str, const RE& re) {
+  return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
+}
+
+// Returns true iff regular expression re matches a substring of str
+// (including str itself).
+bool RE::PartialMatch(const char* str, const RE& re) {
+  return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
+}
+
+// Initializes an RE from its string representation.
+void RE::Init(const char* regex) {
+  pattern_ = full_pattern_ = NULL;
+  if (regex != NULL) {
+    pattern_ = posix::StrDup(regex);
+  }
+
+  is_valid_ = ValidateRegex(regex);
+  if (!is_valid_) {
+    // No need to calculate the full pattern when the regex is invalid.
+    return;
+  }
+
+  const size_t len = strlen(regex);
+  // Reserves enough bytes to hold the regular expression used for a
+  // full match: we need space to prepend a '^', append a '$', and
+  // terminate the string with '\0'.
+  char* buffer = static_cast<char*>(malloc(len + 3));
+  full_pattern_ = buffer;
+
+  if (*regex != '^')
+    *buffer++ = '^';  // Makes sure full_pattern_ starts with '^'.
+
+  // We don't use snprintf or strncpy, as they trigger a warning when
+  // compiled with VC++ 8.0.
+  memcpy(buffer, regex, len);
+  buffer += len;
+
+  if (len == 0 || regex[len - 1] != '$')
+    *buffer++ = '$';  // Makes sure full_pattern_ ends with '$'.
+
+  *buffer = '\0';
+}
+
+#endif  // GTEST_USES_POSIX_RE
+
+const char kUnknownFile[] = "unknown file";
+
+// Formats a source file path and a line number as they would appear
+// in an error message from the compiler used to compile this code.
+GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
+  const std::string file_name(file == NULL ? kUnknownFile : file);
+
+  if (line < 0) {
+    return file_name + ":";
+  }
+#ifdef _MSC_VER
+  return file_name + "(" + StreamableToString(line) + "):";
+#else
+  return file_name + ":" + StreamableToString(line) + ":";
+#endif  // _MSC_VER
+}
+
+// Formats a file location for compiler-independent XML output.
+// Although this function is not platform dependent, we put it next to
+// FormatFileLocation in order to contrast the two functions.
+// Note that FormatCompilerIndependentFileLocation() does NOT append colon
+// to the file location it produces, unlike FormatFileLocation().
+GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
+    const char* file, int line) {
+  const std::string file_name(file == NULL ? kUnknownFile : file);
+
+  if (line < 0)
+    return file_name;
+  else
+    return file_name + ":" + StreamableToString(line);
+}
+
+GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
+    : severity_(severity) {
+  const char* const marker =
+      severity == GTEST_INFO ?    "[  INFO ]" :
+      severity == GTEST_WARNING ? "[WARNING]" :
+      severity == GTEST_ERROR ?   "[ ERROR ]" : "[ FATAL ]";
+  GetStream() << ::std::endl << marker << " "
+              << FormatFileLocation(file, line).c_str() << ": ";
+}
+
+// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
+GTestLog::~GTestLog() {
+  GetStream() << ::std::endl;
+  if (severity_ == GTEST_FATAL) {
+    fflush(stderr);
+    posix::Abort();
+  }
+}
+// Disable Microsoft deprecation warnings for POSIX functions called from
+// this class (creat, dup, dup2, and close)
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+
+#if GTEST_HAS_STREAM_REDIRECTION
+
+// Object that captures an output stream (stdout/stderr).
+class CapturedStream {
+ public:
+  // The ctor redirects the stream to a temporary file.
+  explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
+# if GTEST_OS_WINDOWS
+    char temp_dir_path[MAX_PATH + 1] = { '\0' };  // NOLINT
+    char temp_file_path[MAX_PATH + 1] = { '\0' };  // NOLINT
+
+    ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
+    const UINT success = ::GetTempFileNameA(temp_dir_path,
+                                            "gtest_redir",
+                                            0,  // Generate unique file name.
+                                            temp_file_path);
+    GTEST_CHECK_(success != 0)
+        << "Unable to create a temporary file in " << temp_dir_path;
+    const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
+    GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
+                                    << temp_file_path;
+    filename_ = temp_file_path;
+# else
+    // There's no guarantee that a test has write access to the current
+    // directory, so we create the temporary file in the /tmp directory
+    // instead. We use /tmp on most systems, and /sdcard on Android.
+    // That's because Android doesn't have /tmp.
+#  if GTEST_OS_LINUX_ANDROID
+    // Note: Android applications are expected to call the framework's
+    // Context.getExternalStorageDirectory() method through JNI to get
+    // the location of the world-writable SD Card directory. However,
+    // this requires a Context handle, which cannot be retrieved
+    // globally from native code. Doing so also precludes running the
+    // code as part of a regular standalone executable, which doesn't
+    // run in a Dalvik process (e.g. when running it through 'adb shell').
+    //
+    // The location /sdcard is directly accessible from native code
+    // and is the only location (unofficially) supported by the Android
+    // team. It's generally a symlink to the real SD Card mount point
+    // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or
+    // other OEM-customized locations. Never rely on these, and always
+    // use /sdcard.
+    char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX";
+#  else
+    char name_template[] = "/tmp/captured_stream.XXXXXX";
+#  endif  // GTEST_OS_LINUX_ANDROID
+    const int captured_fd = mkstemp(name_template);
+    filename_ = name_template;
+# endif  // GTEST_OS_WINDOWS
+    fflush(NULL);
+    dup2(captured_fd, fd_);
+    close(captured_fd);
+  }
+
+  ~CapturedStream() {
+    remove(filename_.c_str());
+  }
+
+  std::string GetCapturedString() {
+    if (uncaptured_fd_ != -1) {
+      // Restores the original stream.
+      fflush(NULL);
+      dup2(uncaptured_fd_, fd_);
+      close(uncaptured_fd_);
+      uncaptured_fd_ = -1;
+    }
+
+    FILE* const file = posix::FOpen(filename_.c_str(), "r");
+    const std::string content = ReadEntireFile(file);
+    posix::FClose(file);
+    return content;
+  }
+
+ private:
+  const int fd_;  // A stream to capture.
+  int uncaptured_fd_;
+  // Name of the temporary file holding the stderr output.
+  ::std::string filename_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
+};
+
+GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+static CapturedStream* g_captured_stderr = NULL;
+static CapturedStream* g_captured_stdout = NULL;
+
+// Starts capturing an output stream (stdout/stderr).
+void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) {
+  if (*stream != NULL) {
+    GTEST_LOG_(FATAL) << "Only one " << stream_name
+                      << " capturer can exist at a time.";
+  }
+  *stream = new CapturedStream(fd);
+}
+
+// Stops capturing the output stream and returns the captured string.
+std::string GetCapturedStream(CapturedStream** captured_stream) {
+  const std::string content = (*captured_stream)->GetCapturedString();
+
+  delete *captured_stream;
+  *captured_stream = NULL;
+
+  return content;
+}
+
+// Starts capturing stdout.
+void CaptureStdout() {
+  CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
+}
+
+// Starts capturing stderr.
+void CaptureStderr() {
+  CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
+}
+
+// Stops capturing stdout and returns the captured string.
+std::string GetCapturedStdout() {
+  return GetCapturedStream(&g_captured_stdout);
+}
+
+// Stops capturing stderr and returns the captured string.
+std::string GetCapturedStderr() {
+  return GetCapturedStream(&g_captured_stderr);
+}
+
+#endif  // GTEST_HAS_STREAM_REDIRECTION
+
+std::string TempDir() {
+#if GTEST_OS_WINDOWS_MOBILE
+  return "\\temp\\";
+#elif GTEST_OS_WINDOWS
+  const char* temp_dir = posix::GetEnv("TEMP");
+  if (temp_dir == NULL || temp_dir[0] == '\0')
+    return "\\temp\\";
+  else if (temp_dir[strlen(temp_dir) - 1] == '\\')
+    return temp_dir;
+  else
+    return std::string(temp_dir) + "\\";
+#elif GTEST_OS_LINUX_ANDROID
+  return "/sdcard/";
+#else
+  return "/tmp/";
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+size_t GetFileSize(FILE* file) {
+  fseek(file, 0, SEEK_END);
+  return static_cast<size_t>(ftell(file));
+}
+
+std::string ReadEntireFile(FILE* file) {
+  const size_t file_size = GetFileSize(file);
+  char* const buffer = new char[file_size];
+
+  size_t bytes_last_read = 0;  // # of bytes read in the last fread()
+  size_t bytes_read = 0;       // # of bytes read so far
+
+  fseek(file, 0, SEEK_SET);
+
+  // Keeps reading the file until we cannot read further or the
+  // pre-determined file size is reached.
+  do {
+    bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
+    bytes_read += bytes_last_read;
+  } while (bytes_last_read > 0 && bytes_read < file_size);
+
+  const std::string content(buffer, bytes_read);
+  delete[] buffer;
+
+  return content;
+}
+
+#if GTEST_HAS_DEATH_TEST
+
+static const ::std::vector<testing::internal::string>* g_injected_test_argvs =
+                                        NULL;  // Owned.
+
+void SetInjectableArgvs(const ::std::vector<testing::internal::string>* argvs) {
+  if (g_injected_test_argvs != argvs)
+    delete g_injected_test_argvs;
+  g_injected_test_argvs = argvs;
+}
+
+const ::std::vector<testing::internal::string>& GetInjectableArgvs() {
+  if (g_injected_test_argvs != NULL) {
+    return *g_injected_test_argvs;
+  }
+  return GetArgvs();
+}
+#endif  // GTEST_HAS_DEATH_TEST
+
+#if GTEST_OS_WINDOWS_MOBILE
+namespace posix {
+void Abort() {
+  DebugBreak();
+  TerminateProcess(GetCurrentProcess(), 1);
+}
+}  // namespace posix
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+// Returns the name of the environment variable corresponding to the
+// given flag.  For example, FlagToEnvVar("foo") will return
+// "GTEST_FOO" in the open-source version.
+static std::string FlagToEnvVar(const char* flag) {
+  const std::string full_flag =
+      (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
+
+  Message env_var;
+  for (size_t i = 0; i != full_flag.length(); i++) {
+    env_var << ToUpper(full_flag.c_str()[i]);
+  }
+
+  return env_var.GetString();
+}
+
+// Parses 'str' for a 32-bit signed integer.  If successful, writes
+// the result to *value and returns true; otherwise leaves *value
+// unchanged and returns false.
+bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
+  // Parses the environment variable as a decimal integer.
+  char* end = NULL;
+  const long long_value = strtol(str, &end, 10);  // NOLINT
+
+  // Has strtol() consumed all characters in the string?
+  if (*end != '\0') {
+    // No - an invalid character was encountered.
+    Message msg;
+    msg << "WARNING: " << src_text
+        << " is expected to be a 32-bit integer, but actually"
+        << " has value \"" << str << "\".\n";
+    printf("%s", msg.GetString().c_str());
+    fflush(stdout);
+    return false;
+  }
+
+  // Is the parsed value in the range of an Int32?
+  const Int32 result = static_cast<Int32>(long_value);
+  if (long_value == LONG_MAX || long_value == LONG_MIN ||
+      // The parsed value overflows as a long.  (strtol() returns
+      // LONG_MAX or LONG_MIN when the input overflows.)
+      result != long_value
+      // The parsed value overflows as an Int32.
+      ) {
+    Message msg;
+    msg << "WARNING: " << src_text
+        << " is expected to be a 32-bit integer, but actually"
+        << " has value " << str << ", which overflows.\n";
+    printf("%s", msg.GetString().c_str());
+    fflush(stdout);
+    return false;
+  }
+
+  *value = result;
+  return true;
+}
+
+// Reads and returns the Boolean environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+//
+// The value is considered true iff it's not "0".
+bool BoolFromGTestEnv(const char* flag, bool default_value) {
+#if defined(GTEST_GET_BOOL_FROM_ENV_)
+  return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_BOOL_FROM_ENV_)
+  const std::string env_var = FlagToEnvVar(flag);
+  const char* const string_value = posix::GetEnv(env_var.c_str());
+  return string_value == NULL ?
+      default_value : strcmp(string_value, "0") != 0;
+}
+
+// Reads and returns a 32-bit integer stored in the environment
+// variable corresponding to the given flag; if it isn't set or
+// doesn't represent a valid 32-bit integer, returns default_value.
+Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
+#if defined(GTEST_GET_INT32_FROM_ENV_)
+  return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_INT32_FROM_ENV_)
+  const std::string env_var = FlagToEnvVar(flag);
+  const char* const string_value = posix::GetEnv(env_var.c_str());
+  if (string_value == NULL) {
+    // The environment variable is not set.
+    return default_value;
+  }
+
+  Int32 result = default_value;
+  if (!ParseInt32(Message() << "Environment variable " << env_var,
+                  string_value, &result)) {
+    printf("The default value %s is used.\n",
+           (Message() << default_value).GetString().c_str());
+    fflush(stdout);
+    return default_value;
+  }
+
+  return result;
+}
+
+// Reads and returns the string environment variable corresponding to
+// the given flag; if it's not set, returns default_value.
+std::string StringFromGTestEnv(const char* flag, const char* default_value) {
+#if defined(GTEST_GET_STRING_FROM_ENV_)
+  return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_STRING_FROM_ENV_)
+  const std::string env_var = FlagToEnvVar(flag);
+  const char* value = posix::GetEnv(env_var.c_str());
+  if (value != NULL) {
+    return value;
+  }
+
+  // As a special case for the 'output' flag, if GTEST_OUTPUT is not
+  // set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
+  // system.  The value of XML_OUTPUT_FILE is a filename without the
+  // "xml:" prefix of GTEST_OUTPUT.
+  //
+  // The net priority order after flag processing is thus:
+  //   --gtest_output command line flag
+  //   GTEST_OUTPUT environment variable
+  //   XML_OUTPUT_FILE environment variable
+  //   'default_value'
+  if (strcmp(flag, "output") == 0) {
+    value = posix::GetEnv("XML_OUTPUT_FILE");
+    if (value != NULL) {
+      return std::string("xml:") + value;
+    }
+  }
+  return default_value;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-printers.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-printers.cc
new file mode 100644
index 0000000..a2df412
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-printers.cc
@@ -0,0 +1,373 @@
+// 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 Test - The Google C++ Testing Framework
+//
+// This file implements a universal value printer that can print a
+// value of any type T:
+//
+//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
+//
+// It uses the << operator when possible, and prints the bytes in the
+// object otherwise.  A user can override its behavior for a class
+// type Foo by defining either operator<<(::std::ostream&, const Foo&)
+// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that
+// defines Foo.
+
+#include "gtest/gtest-printers.h"
+#include <ctype.h>
+#include <stdio.h>
+#include <cwchar>
+#include <ostream>  // NOLINT
+#include <string>
+#include "gtest/internal/gtest-port.h"
+
+namespace testing {
+
+namespace {
+
+using ::std::ostream;
+
+// Prints a segment of bytes in the given object.
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
+                                size_t count, ostream* os) {
+  char text[5] = "";
+  for (size_t i = 0; i != count; i++) {
+    const size_t j = start + i;
+    if (i != 0) {
+      // Organizes the bytes into groups of 2 for easy parsing by
+      // human.
+      if ((j % 2) == 0)
+        *os << ' ';
+      else
+        *os << '-';
+    }
+    GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]);
+    *os << text;
+  }
+}
+
+// Prints the bytes in the given value to the given ostream.
+void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
+                              ostream* os) {
+  // Tells the user how big the object is.
+  *os << count << "-byte object <";
+
+  const size_t kThreshold = 132;
+  const size_t kChunkSize = 64;
+  // If the object size is bigger than kThreshold, we'll have to omit
+  // some details by printing only the first and the last kChunkSize
+  // bytes.
+  // TODO(wan): let the user control the threshold using a flag.
+  if (count < kThreshold) {
+    PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
+  } else {
+    PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os);
+    *os << " ... ";
+    // Rounds up to 2-byte boundary.
+    const size_t resume_pos = (count - kChunkSize + 1)/2*2;
+    PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os);
+  }
+  *os << ">";
+}
+
+}  // namespace
+
+namespace internal2 {
+
+// Delegates to PrintBytesInObjectToImpl() to print the bytes in the
+// given object.  The delegation simplifies the implementation, which
+// uses the << operator and thus is easier done outside of the
+// ::testing::internal namespace, which contains a << operator that
+// sometimes conflicts with the one in STL.
+void PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count,
+                          ostream* os) {
+  PrintBytesInObjectToImpl(obj_bytes, count, os);
+}
+
+}  // namespace internal2
+
+namespace internal {
+
+// Depending on the value of a char (or wchar_t), we print it in one
+// of three formats:
+//   - as is if it's a printable ASCII (e.g. 'a', '2', ' '),
+//   - as a hexidecimal escape sequence (e.g. '\x7F'), or
+//   - as a special escape sequence (e.g. '\r', '\n').
+enum CharFormat {
+  kAsIs,
+  kHexEscape,
+  kSpecialEscape
+};
+
+// Returns true if c is a printable ASCII character.  We test the
+// value of c directly instead of calling isprint(), which is buggy on
+// Windows Mobile.
+inline bool IsPrintableAscii(wchar_t c) {
+  return 0x20 <= c && c <= 0x7E;
+}
+
+// Prints a wide or narrow char c as a character literal without the
+// quotes, escaping it when necessary; returns how c was formatted.
+// The template argument UnsignedChar is the unsigned version of Char,
+// which is the type of c.
+template <typename UnsignedChar, typename Char>
+static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
+  switch (static_cast<wchar_t>(c)) {
+    case L'\0':
+      *os << "\\0";
+      break;
+    case L'\'':
+      *os << "\\'";
+      break;
+    case L'\\':
+      *os << "\\\\";
+      break;
+    case L'\a':
+      *os << "\\a";
+      break;
+    case L'\b':
+      *os << "\\b";
+      break;
+    case L'\f':
+      *os << "\\f";
+      break;
+    case L'\n':
+      *os << "\\n";
+      break;
+    case L'\r':
+      *os << "\\r";
+      break;
+    case L'\t':
+      *os << "\\t";
+      break;
+    case L'\v':
+      *os << "\\v";
+      break;
+    default:
+      if (IsPrintableAscii(c)) {
+        *os << static_cast<char>(c);
+        return kAsIs;
+      } else {
+        *os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));
+        return kHexEscape;
+      }
+  }
+  return kSpecialEscape;
+}
+
+// Prints a wchar_t c as if it's part of a string literal, escaping it when
+// necessary; returns how c was formatted.
+static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {
+  switch (c) {
+    case L'\'':
+      *os << "'";
+      return kAsIs;
+    case L'"':
+      *os << "\\\"";
+      return kSpecialEscape;
+    default:
+      return PrintAsCharLiteralTo<wchar_t>(c, os);
+  }
+}
+
+// Prints a char c as if it's part of a string literal, escaping it when
+// necessary; returns how c was formatted.
+static CharFormat PrintAsStringLiteralTo(char c, ostream* os) {
+  return PrintAsStringLiteralTo(
+      static_cast<wchar_t>(static_cast<unsigned char>(c)), os);
+}
+
+// Prints a wide or narrow character c and its code.  '\0' is printed
+// as "'\\0'", other unprintable characters are also properly escaped
+// using the standard C++ escape sequence.  The template argument
+// UnsignedChar is the unsigned version of Char, which is the type of c.
+template <typename UnsignedChar, typename Char>
+void PrintCharAndCodeTo(Char c, ostream* os) {
+  // First, print c as a literal in the most readable form we can find.
+  *os << ((sizeof(c) > 1) ? "L'" : "'");
+  const CharFormat format = PrintAsCharLiteralTo<UnsignedChar>(c, os);
+  *os << "'";
+
+  // To aid user debugging, we also print c's code in decimal, unless
+  // it's 0 (in which case c was printed as '\\0', making the code
+  // obvious).
+  if (c == 0)
+    return;
+  *os << " (" << static_cast<int>(c);
+
+  // For more convenience, we print c's code again in hexidecimal,
+  // unless c was already printed in the form '\x##' or the code is in
+  // [1, 9].
+  if (format == kHexEscape || (1 <= c && c <= 9)) {
+    // Do nothing.
+  } else {
+    *os << ", 0x" << String::FormatHexInt(static_cast<UnsignedChar>(c));
+  }
+  *os << ")";
+}
+
+void PrintTo(unsigned char c, ::std::ostream* os) {
+  PrintCharAndCodeTo<unsigned char>(c, os);
+}
+void PrintTo(signed char c, ::std::ostream* os) {
+  PrintCharAndCodeTo<unsigned char>(c, os);
+}
+
+// Prints a wchar_t as a symbol if it is printable or as its internal
+// code otherwise and also as its code.  L'\0' is printed as "L'\\0'".
+void PrintTo(wchar_t wc, ostream* os) {
+  PrintCharAndCodeTo<wchar_t>(wc, os);
+}
+
+// Prints the given array of characters to the ostream.  CharType must be either
+// char or wchar_t.
+// The array starts at begin, the length is len, it may include '\0' characters
+// and may not be NUL-terminated.
+template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+static void PrintCharsAsStringTo(
+    const CharType* begin, size_t len, ostream* os) {
+  const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
+  *os << kQuoteBegin;
+  bool is_previous_hex = false;
+  for (size_t index = 0; index < len; ++index) {
+    const CharType cur = begin[index];
+    if (is_previous_hex && IsXDigit(cur)) {
+      // Previous character is of '\x..' form and this character can be
+      // interpreted as another hexadecimal digit in its number. Break string to
+      // disambiguate.
+      *os << "\" " << kQuoteBegin;
+    }
+    is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;
+  }
+  *os << "\"";
+}
+
+// Prints a (const) char/wchar_t array of 'len' elements, starting at address
+// 'begin'.  CharType must be either char or wchar_t.
+template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+static void UniversalPrintCharArray(
+    const CharType* begin, size_t len, ostream* os) {
+  // The code
+  //   const char kFoo[] = "foo";
+  // generates an array of 4, not 3, elements, with the last one being '\0'.
+  //
+  // Therefore when printing a char array, we don't print the last element if
+  // it's '\0', such that the output matches the string literal as it's
+  // written in the source code.
+  if (len > 0 && begin[len - 1] == '\0') {
+    PrintCharsAsStringTo(begin, len - 1, os);
+    return;
+  }
+
+  // If, however, the last element in the array is not '\0', e.g.
+  //    const char kFoo[] = { 'f', 'o', 'o' };
+  // we must print the entire array.  We also print a message to indicate
+  // that the array is not NUL-terminated.
+  PrintCharsAsStringTo(begin, len, os);
+  *os << " (no terminating NUL)";
+}
+
+// Prints a (const) char array of 'len' elements, starting at address 'begin'.
+void UniversalPrintArray(const char* begin, size_t len, ostream* os) {
+  UniversalPrintCharArray(begin, len, os);
+}
+
+// Prints a (const) wchar_t array of 'len' elements, starting at address
+// 'begin'.
+void UniversalPrintArray(const wchar_t* begin, size_t len, ostream* os) {
+  UniversalPrintCharArray(begin, len, os);
+}
+
+// Prints the given C string to the ostream.
+void PrintTo(const char* s, ostream* os) {
+  if (s == NULL) {
+    *os << "NULL";
+  } else {
+    *os << ImplicitCast_<const void*>(s) << " pointing to ";
+    PrintCharsAsStringTo(s, strlen(s), os);
+  }
+}
+
+// MSVC compiler can be configured to define whar_t as a typedef
+// of unsigned short. Defining an overload for const wchar_t* in that case
+// would cause pointers to unsigned shorts be printed as wide strings,
+// possibly accessing more memory than intended and causing invalid
+// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when
+// wchar_t is implemented as a native type.
+#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
+// Prints the given wide C string to the ostream.
+void PrintTo(const wchar_t* s, ostream* os) {
+  if (s == NULL) {
+    *os << "NULL";
+  } else {
+    *os << ImplicitCast_<const void*>(s) << " pointing to ";
+    PrintCharsAsStringTo(s, std::wcslen(s), os);
+  }
+}
+#endif  // wchar_t is native
+
+// Prints a ::string object.
+#if GTEST_HAS_GLOBAL_STRING
+void PrintStringTo(const ::string& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+#endif  // GTEST_HAS_GLOBAL_STRING
+
+void PrintStringTo(const ::std::string& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+
+// Prints a ::wstring object.
+#if GTEST_HAS_GLOBAL_WSTRING
+void PrintWideStringTo(const ::wstring& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+#if GTEST_HAS_STD_WSTRING
+void PrintWideStringTo(const ::std::wstring& s, ostream* os) {
+  PrintCharsAsStringTo(s.data(), s.size(), os);
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+}  // namespace internal
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-test-part.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-test-part.cc
new file mode 100644
index 0000000..fb0e354
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-test-part.cc
@@ -0,0 +1,110 @@
+// 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: mheule@google.com (Markus Heule)
+//
+// The Google C++ Testing Framework (Google Test)
+
+#include "gtest/gtest-test-part.h"
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+namespace testing {
+
+using internal::GetUnitTestImpl;
+
+// Gets the summary of the failure message by omitting the stack trace
+// in it.
+std::string TestPartResult::ExtractSummary(const char* message) {
+  const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
+  return stack_trace == NULL ? message :
+      std::string(message, stack_trace);
+}
+
+// Prints a TestPartResult object.
+std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
+  return os
+      << result.file_name() << ":" << result.line_number() << ": "
+      << (result.type() == TestPartResult::kSuccess ? "Success" :
+          result.type() == TestPartResult::kFatalFailure ? "Fatal failure" :
+          "Non-fatal failure") << ":\n"
+      << result.message() << std::endl;
+}
+
+// Appends a TestPartResult to the array.
+void TestPartResultArray::Append(const TestPartResult& result) {
+  array_.push_back(result);
+}
+
+// Returns the TestPartResult at the given index (0-based).
+const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
+  if (index < 0 || index >= size()) {
+    printf("\nInvalid index (%d) into TestPartResultArray.\n", index);
+    internal::posix::Abort();
+  }
+
+  return array_[index];
+}
+
+// Returns the number of TestPartResult objects in the array.
+int TestPartResultArray::size() const {
+  return static_cast<int>(array_.size());
+}
+
+namespace internal {
+
+HasNewFatalFailureHelper::HasNewFatalFailureHelper()
+    : has_new_fatal_failure_(false),
+      original_reporter_(GetUnitTestImpl()->
+                         GetTestPartResultReporterForCurrentThread()) {
+  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
+}
+
+HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
+  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
+      original_reporter_);
+}
+
+void HasNewFatalFailureHelper::ReportTestPartResult(
+    const TestPartResult& result) {
+  if (result.fatally_failed())
+    has_new_fatal_failure_ = true;
+  original_reporter_->ReportTestPartResult(result);
+}
+
+}  // namespace internal
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest-typed-test.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest-typed-test.cc
new file mode 100644
index 0000000..df1eef4
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest-typed-test.cc
@@ -0,0 +1,118 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include "gtest/gtest-typed-test.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+namespace internal {
+
+#if GTEST_HAS_TYPED_TEST_P
+
+// Skips to the first non-space char in str. Returns an empty string if str
+// contains only whitespace characters.
+static const char* SkipSpaces(const char* str) {
+  while (IsSpace(*str))
+    str++;
+  return str;
+}
+
+static std::vector<std::string> SplitIntoTestNames(const char* src) {
+  std::vector<std::string> name_vec;
+  src = SkipSpaces(src);
+  for (; src != NULL; src = SkipComma(src)) {
+    name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
+  }
+  return name_vec;
+}
+
+// Verifies that registered_tests match the test names in
+// registered_tests_; returns registered_tests if successful, or
+// aborts the program otherwise.
+const char* TypedTestCasePState::VerifyRegisteredTestNames(
+    const char* file, int line, const char* registered_tests) {
+  typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
+  registered_ = true;
+
+  std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
+
+  Message errors;
+
+  std::set<std::string> tests;
+  for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
+       name_it != name_vec.end(); ++name_it) {
+    const std::string& name = *name_it;
+    if (tests.count(name) != 0) {
+      errors << "Test " << name << " is listed more than once.\n";
+      continue;
+    }
+
+    bool found = false;
+    for (RegisteredTestIter it = registered_tests_.begin();
+         it != registered_tests_.end();
+         ++it) {
+      if (name == it->first) {
+        found = true;
+        break;
+      }
+    }
+
+    if (found) {
+      tests.insert(name);
+    } else {
+      errors << "No test named " << name
+             << " can be found in this test case.\n";
+    }
+  }
+
+  for (RegisteredTestIter it = registered_tests_.begin();
+       it != registered_tests_.end();
+       ++it) {
+    if (tests.count(it->first) == 0) {
+      errors << "You forgot to list test " << it->first << ".\n";
+    }
+  }
+
+  const std::string& errors_str = errors.GetString();
+  if (errors_str != "") {
+    fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
+            errors_str.c_str());
+    fflush(stderr);
+    posix::Abort();
+  }
+
+  return registered_tests;
+}
+
+#endif  // GTEST_HAS_TYPED_TEST_P
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest.cc
new file mode 100644
index 0000000..d882ab2
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest.cc
@@ -0,0 +1,5388 @@
+// Copyright 2005, 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)
+//
+// The Google C++ Testing Framework (Google Test)
+
+#include "gtest/gtest.h"
+#include "gtest/internal/custom/gtest.h"
+#include "gtest/gtest-spi.h"
+
+#include <ctype.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#include <algorithm>
+#include <iomanip>
+#include <limits>
+#include <list>
+#include <map>
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <vector>
+
+#if GTEST_OS_LINUX
+
+// TODO(kenton@google.com): Use autoconf to detect availability of
+// gettimeofday().
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+
+# include <fcntl.h>  // NOLINT
+# include <limits.h>  // NOLINT
+# include <sched.h>  // NOLINT
+// Declares vsnprintf().  This header is not available on Windows.
+# include <strings.h>  // NOLINT
+# include <sys/mman.h>  // NOLINT
+# include <sys/time.h>  // NOLINT
+# include <unistd.h>  // NOLINT
+# include <string>
+
+#elif GTEST_OS_SYMBIAN
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+# include <sys/time.h>  // NOLINT
+
+#elif GTEST_OS_ZOS
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+# include <sys/time.h>  // NOLINT
+
+// On z/OS we additionally need strings.h for strcasecmp.
+# include <strings.h>  // NOLINT
+
+#elif GTEST_OS_WINDOWS_MOBILE  // We are on Windows CE.
+
+# include <windows.h>  // NOLINT
+# undef min
+
+#elif GTEST_OS_WINDOWS  // We are on Windows proper.
+
+# include <io.h>  // NOLINT
+# include <sys/timeb.h>  // NOLINT
+# include <sys/types.h>  // NOLINT
+# include <sys/stat.h>  // NOLINT
+
+# if GTEST_OS_WINDOWS_MINGW
+// MinGW has gettimeofday() but not _ftime64().
+// TODO(kenton@google.com): Use autoconf to detect availability of
+//   gettimeofday().
+// TODO(kenton@google.com): There are other ways to get the time on
+//   Windows, like GetTickCount() or GetSystemTimeAsFileTime().  MinGW
+//   supports these.  consider using them instead.
+#  define GTEST_HAS_GETTIMEOFDAY_ 1
+#  include <sys/time.h>  // NOLINT
+# endif  // GTEST_OS_WINDOWS_MINGW
+
+// cpplint thinks that the header is already included, so we want to
+// silence it.
+# include <windows.h>  // NOLINT
+# undef min
+
+#else
+
+// Assume other platforms have gettimeofday().
+// TODO(kenton@google.com): Use autoconf to detect availability of
+//   gettimeofday().
+# define GTEST_HAS_GETTIMEOFDAY_ 1
+
+// cpplint thinks that the header is already included, so we want to
+// silence it.
+# include <sys/time.h>  // NOLINT
+# include <unistd.h>  // NOLINT
+
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_HAS_EXCEPTIONS
+# include <stdexcept>
+#endif
+
+#if GTEST_CAN_STREAM_RESULTS_
+# include <arpa/inet.h>  // NOLINT
+# include <netdb.h>  // NOLINT
+# include <sys/socket.h>  // NOLINT
+# include <sys/types.h>  // NOLINT
+#endif
+
+// Indicates that this translation unit is part of Google Test's
+// implementation.  It must come before gtest-internal-inl.h is
+// included, or there will be a compiler error.  This trick is to
+// prevent a user from accidentally including gtest-internal-inl.h in
+// his code.
+#define GTEST_IMPLEMENTATION_ 1
+#include "src/gtest-internal-inl.h"
+#undef GTEST_IMPLEMENTATION_
+
+#if GTEST_OS_WINDOWS
+# define vsnprintf _vsnprintf
+#endif  // GTEST_OS_WINDOWS
+
+namespace testing {
+
+using internal::CountIf;
+using internal::ForEach;
+using internal::GetElementOr;
+using internal::Shuffle;
+
+// Constants.
+
+// A test whose test case name or test name matches this filter is
+// disabled and not run.
+static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
+
+// A test case whose name matches this filter is considered a death
+// test case and will be run before test cases whose name doesn't
+// match this filter.
+static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*";
+
+// A test filter that matches everything.
+static const char kUniversalFilter[] = "*";
+
+// The default output file for XML output.
+static const char kDefaultOutputFile[] = "test_detail.xml";
+
+// The environment variable name for the test shard index.
+static const char kTestShardIndex[] = "GTEST_SHARD_INDEX";
+// The environment variable name for the total number of test shards.
+static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS";
+// The environment variable name for the test shard status file.
+static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE";
+
+namespace internal {
+
+// The text used in failure messages to indicate the start of the
+// stack trace.
+const char kStackTraceMarker[] = "\nStack trace:\n";
+
+// g_help_flag is true iff the --help flag or an equivalent form is
+// specified on the command line.
+bool g_help_flag = false;
+
+}  // namespace internal
+
+static const char* GetDefaultFilter() {
+#ifdef GTEST_TEST_FILTER_ENV_VAR_
+  const char* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_);
+  if (testbridge_test_only != NULL) {
+    return testbridge_test_only;
+  }
+#endif  // GTEST_TEST_FILTER_ENV_VAR_
+  return kUniversalFilter;
+}
+
+GTEST_DEFINE_bool_(
+    also_run_disabled_tests,
+    internal::BoolFromGTestEnv("also_run_disabled_tests", false),
+    "Run disabled tests too, in addition to the tests normally being run.");
+
+GTEST_DEFINE_bool_(
+    break_on_failure,
+    internal::BoolFromGTestEnv("break_on_failure", false),
+    "True iff a failed assertion should be a debugger break-point.");
+
+GTEST_DEFINE_bool_(
+    catch_exceptions,
+    internal::BoolFromGTestEnv("catch_exceptions", true),
+    "True iff " GTEST_NAME_
+    " should catch exceptions and treat them as test failures.");
+
+GTEST_DEFINE_string_(
+    color,
+    internal::StringFromGTestEnv("color", "auto"),
+    "Whether to use colors in the output.  Valid values: yes, no, "
+    "and auto.  'auto' means to use colors if the output is "
+    "being sent to a terminal and the TERM environment variable "
+    "is set to a terminal type that supports colors.");
+
+GTEST_DEFINE_string_(
+    filter,
+    internal::StringFromGTestEnv("filter", GetDefaultFilter()),
+    "A colon-separated list of glob (not regex) patterns "
+    "for filtering the tests to run, optionally followed by a "
+    "'-' and a : separated list of negative patterns (tests to "
+    "exclude).  A test is run if it matches one of the positive "
+    "patterns and does not match any of the negative patterns.");
+
+GTEST_DEFINE_bool_(list_tests, false,
+                   "List all tests without running them.");
+
+GTEST_DEFINE_string_(
+    output,
+    internal::StringFromGTestEnv("output", ""),
+    "A format (currently must be \"xml\"), optionally followed "
+    "by a colon and an output file name or directory. A directory "
+    "is indicated by a trailing pathname separator. "
+    "Examples: \"xml:filename.xml\", \"xml::directoryname/\". "
+    "If a directory is specified, output files will be created "
+    "within that directory, with file-names based on the test "
+    "executable's name and, if necessary, made unique by adding "
+    "digits.");
+
+GTEST_DEFINE_bool_(
+    print_time,
+    internal::BoolFromGTestEnv("print_time", true),
+    "True iff " GTEST_NAME_
+    " should display elapsed time in text output.");
+
+GTEST_DEFINE_int32_(
+    random_seed,
+    internal::Int32FromGTestEnv("random_seed", 0),
+    "Random number seed to use when shuffling test orders.  Must be in range "
+    "[1, 99999], or 0 to use a seed based on the current time.");
+
+GTEST_DEFINE_int32_(
+    repeat,
+    internal::Int32FromGTestEnv("repeat", 1),
+    "How many times to repeat each test.  Specify a negative number "
+    "for repeating forever.  Useful for shaking out flaky tests.");
+
+GTEST_DEFINE_bool_(
+    show_internal_stack_frames, false,
+    "True iff " GTEST_NAME_ " should include internal stack frames when "
+    "printing test failure stack traces.");
+
+GTEST_DEFINE_bool_(
+    shuffle,
+    internal::BoolFromGTestEnv("shuffle", false),
+    "True iff " GTEST_NAME_
+    " should randomize tests' order on every run.");
+
+GTEST_DEFINE_int32_(
+    stack_trace_depth,
+    internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth),
+    "The maximum number of stack frames to print when an "
+    "assertion fails.  The valid range is 0 through 100, inclusive.");
+
+GTEST_DEFINE_string_(
+    stream_result_to,
+    internal::StringFromGTestEnv("stream_result_to", ""),
+    "This flag specifies the host name and the port number on which to stream "
+    "test results. Example: \"localhost:555\". The flag is effective only on "
+    "Linux.");
+
+GTEST_DEFINE_bool_(
+    throw_on_failure,
+    internal::BoolFromGTestEnv("throw_on_failure", false),
+    "When this flag is specified, a failed assertion will throw an exception "
+    "if exceptions are enabled or exit the program with a non-zero code "
+    "otherwise.");
+
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+GTEST_DEFINE_string_(
+    flagfile,
+    internal::StringFromGTestEnv("flagfile", ""),
+    "This flag specifies the flagfile to read command-line flags from.");
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+
+namespace internal {
+
+// Generates a random number from [0, range), using a Linear
+// Congruential Generator (LCG).  Crashes if 'range' is 0 or greater
+// than kMaxRange.
+UInt32 Random::Generate(UInt32 range) {
+  // These constants are the same as are used in glibc's rand(3).
+  state_ = (1103515245U*state_ + 12345U) % kMaxRange;
+
+  GTEST_CHECK_(range > 0)
+      << "Cannot generate a number in the range [0, 0).";
+  GTEST_CHECK_(range <= kMaxRange)
+      << "Generation of a number in [0, " << range << ") was requested, "
+      << "but this can only generate numbers in [0, " << kMaxRange << ").";
+
+  // Converting via modulus introduces a bit of downward bias, but
+  // it's simple, and a linear congruential generator isn't too good
+  // to begin with.
+  return state_ % range;
+}
+
+// GTestIsInitialized() returns true iff the user has initialized
+// Google Test.  Useful for catching the user mistake of not initializing
+// Google Test before calling RUN_ALL_TESTS().
+static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
+
+// Iterates over a vector of TestCases, keeping a running sum of the
+// results of calling a given int-returning method on each.
+// Returns the sum.
+static int SumOverTestCaseList(const std::vector<TestCase*>& case_list,
+                               int (TestCase::*method)() const) {
+  int sum = 0;
+  for (size_t i = 0; i < case_list.size(); i++) {
+    sum += (case_list[i]->*method)();
+  }
+  return sum;
+}
+
+// Returns true iff the test case passed.
+static bool TestCasePassed(const TestCase* test_case) {
+  return test_case->should_run() && test_case->Passed();
+}
+
+// Returns true iff the test case failed.
+static bool TestCaseFailed(const TestCase* test_case) {
+  return test_case->should_run() && test_case->Failed();
+}
+
+// Returns true iff test_case contains at least one test that should
+// run.
+static bool ShouldRunTestCase(const TestCase* test_case) {
+  return test_case->should_run();
+}
+
+// AssertHelper constructor.
+AssertHelper::AssertHelper(TestPartResult::Type type,
+                           const char* file,
+                           int line,
+                           const char* message)
+    : data_(new AssertHelperData(type, file, line, message)) {
+}
+
+AssertHelper::~AssertHelper() {
+  delete data_;
+}
+
+// Message assignment, for assertion streaming support.
+void AssertHelper::operator=(const Message& message) const {
+  UnitTest::GetInstance()->
+    AddTestPartResult(data_->type, data_->file, data_->line,
+                      AppendUserMessage(data_->message, message),
+                      UnitTest::GetInstance()->impl()
+                      ->CurrentOsStackTraceExceptTop(1)
+                      // Skips the stack frame for this function itself.
+                      );  // NOLINT
+}
+
+// Mutex for linked pointers.
+GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
+
+// A copy of all command line arguments.  Set by InitGoogleTest().
+::std::vector<testing::internal::string> g_argvs;
+
+const ::std::vector<testing::internal::string>& GetArgvs() {
+#if defined(GTEST_CUSTOM_GET_ARGVS_)
+  return GTEST_CUSTOM_GET_ARGVS_();
+#else  // defined(GTEST_CUSTOM_GET_ARGVS_)
+  return g_argvs;
+#endif  // defined(GTEST_CUSTOM_GET_ARGVS_)
+}
+
+// Returns the current application's name, removing directory path if that
+// is present.
+FilePath GetCurrentExecutableName() {
+  FilePath result;
+
+#if GTEST_OS_WINDOWS
+  result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
+#else
+  result.Set(FilePath(GetArgvs()[0]));
+#endif  // GTEST_OS_WINDOWS
+
+  return result.RemoveDirectoryName();
+}
+
+// Functions for processing the gtest_output flag.
+
+// Returns the output format, or "" for normal printed output.
+std::string UnitTestOptions::GetOutputFormat() {
+  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
+  if (gtest_output_flag == NULL) return std::string("");
+
+  const char* const colon = strchr(gtest_output_flag, ':');
+  return (colon == NULL) ?
+      std::string(gtest_output_flag) :
+      std::string(gtest_output_flag, colon - gtest_output_flag);
+}
+
+// Returns the name of the requested output file, or the default if none
+// was explicitly specified.
+std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
+  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();
+  if (gtest_output_flag == NULL)
+    return "";
+
+  const char* const colon = strchr(gtest_output_flag, ':');
+  if (colon == NULL)
+    return internal::FilePath::ConcatPaths(
+        internal::FilePath(
+            UnitTest::GetInstance()->original_working_dir()),
+        internal::FilePath(kDefaultOutputFile)).string();
+
+  internal::FilePath output_name(colon + 1);
+  if (!output_name.IsAbsolutePath())
+    // TODO(wan@google.com): on Windows \some\path is not an absolute
+    // path (as its meaning depends on the current drive), yet the
+    // following logic for turning it into an absolute path is wrong.
+    // Fix it.
+    output_name = internal::FilePath::ConcatPaths(
+        internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
+        internal::FilePath(colon + 1));
+
+  if (!output_name.IsDirectory())
+    return output_name.string();
+
+  internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
+      output_name, internal::GetCurrentExecutableName(),
+      GetOutputFormat().c_str()));
+  return result.string();
+}
+
+// Returns true iff the wildcard pattern matches the string.  The
+// first ':' or '\0' character in pattern marks the end of it.
+//
+// This recursive algorithm isn't very efficient, but is clear and
+// works well enough for matching test names, which are short.
+bool UnitTestOptions::PatternMatchesString(const char *pattern,
+                                           const char *str) {
+  switch (*pattern) {
+    case '\0':
+    case ':':  // Either ':' or '\0' marks the end of the pattern.
+      return *str == '\0';
+    case '?':  // Matches any single character.
+      return *str != '\0' && PatternMatchesString(pattern + 1, str + 1);
+    case '*':  // Matches any string (possibly empty) of characters.
+      return (*str != '\0' && PatternMatchesString(pattern, str + 1)) ||
+          PatternMatchesString(pattern + 1, str);
+    default:  // Non-special character.  Matches itself.
+      return *pattern == *str &&
+          PatternMatchesString(pattern + 1, str + 1);
+  }
+}
+
+bool UnitTestOptions::MatchesFilter(
+    const std::string& name, const char* filter) {
+  const char *cur_pattern = filter;
+  for (;;) {
+    if (PatternMatchesString(cur_pattern, name.c_str())) {
+      return true;
+    }
+
+    // Finds the next pattern in the filter.
+    cur_pattern = strchr(cur_pattern, ':');
+
+    // Returns if no more pattern can be found.
+    if (cur_pattern == NULL) {
+      return false;
+    }
+
+    // Skips the pattern separater (the ':' character).
+    cur_pattern++;
+  }
+}
+
+// Returns true iff the user-specified filter matches the test case
+// name and the test name.
+bool UnitTestOptions::FilterMatchesTest(const std::string &test_case_name,
+                                        const std::string &test_name) {
+  const std::string& full_name = test_case_name + "." + test_name.c_str();
+
+  // Split --gtest_filter at '-', if there is one, to separate into
+  // positive filter and negative filter portions
+  const char* const p = GTEST_FLAG(filter).c_str();
+  const char* const dash = strchr(p, '-');
+  std::string positive;
+  std::string negative;
+  if (dash == NULL) {
+    positive = GTEST_FLAG(filter).c_str();  // Whole string is a positive filter
+    negative = "";
+  } else {
+    positive = std::string(p, dash);   // Everything up to the dash
+    negative = std::string(dash + 1);  // Everything after the dash
+    if (positive.empty()) {
+      // Treat '-test1' as the same as '*-test1'
+      positive = kUniversalFilter;
+    }
+  }
+
+  // A filter is a colon-separated list of patterns.  It matches a
+  // test if any pattern in it matches the test.
+  return (MatchesFilter(full_name, positive.c_str()) &&
+          !MatchesFilter(full_name, negative.c_str()));
+}
+
+#if GTEST_HAS_SEH
+// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
+// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
+// This function is useful as an __except condition.
+int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {
+  // Google Test should handle a SEH exception if:
+  //   1. the user wants it to, AND
+  //   2. this is not a breakpoint exception, AND
+  //   3. this is not a C++ exception (VC++ implements them via SEH,
+  //      apparently).
+  //
+  // SEH exception code for C++ exceptions.
+  // (see http://support.microsoft.com/kb/185294 for more information).
+  const DWORD kCxxExceptionCode = 0xe06d7363;
+
+  bool should_handle = true;
+
+  if (!GTEST_FLAG(catch_exceptions))
+    should_handle = false;
+  else if (exception_code == EXCEPTION_BREAKPOINT)
+    should_handle = false;
+  else if (exception_code == kCxxExceptionCode)
+    should_handle = false;
+
+  return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
+}
+#endif  // GTEST_HAS_SEH
+
+}  // namespace internal
+
+// The c'tor sets this object as the test part result reporter used by
+// Google Test.  The 'result' parameter specifies where to report the
+// results. Intercepts only failures from the current thread.
+ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
+    TestPartResultArray* result)
+    : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),
+      result_(result) {
+  Init();
+}
+
+// The c'tor sets this object as the test part result reporter used by
+// Google Test.  The 'result' parameter specifies where to report the
+// results.
+ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
+    InterceptMode intercept_mode, TestPartResultArray* result)
+    : intercept_mode_(intercept_mode),
+      result_(result) {
+  Init();
+}
+
+void ScopedFakeTestPartResultReporter::Init() {
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
+    old_reporter_ = impl->GetGlobalTestPartResultReporter();
+    impl->SetGlobalTestPartResultReporter(this);
+  } else {
+    old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();
+    impl->SetTestPartResultReporterForCurrentThread(this);
+  }
+}
+
+// The d'tor restores the test part result reporter used by Google Test
+// before.
+ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
+    impl->SetGlobalTestPartResultReporter(old_reporter_);
+  } else {
+    impl->SetTestPartResultReporterForCurrentThread(old_reporter_);
+  }
+}
+
+// Increments the test part result count and remembers the result.
+// This method is from the TestPartResultReporterInterface interface.
+void ScopedFakeTestPartResultReporter::ReportTestPartResult(
+    const TestPartResult& result) {
+  result_->Append(result);
+}
+
+namespace internal {
+
+// Returns the type ID of ::testing::Test.  We should always call this
+// instead of GetTypeId< ::testing::Test>() to get the type ID of
+// testing::Test.  This is to work around a suspected linker bug when
+// using Google Test as a framework on Mac OS X.  The bug causes
+// GetTypeId< ::testing::Test>() to return different values depending
+// on whether the call is from the Google Test framework itself or
+// from user test code.  GetTestTypeId() is guaranteed to always
+// return the same value, as it always calls GetTypeId<>() from the
+// gtest.cc, which is within the Google Test framework.
+TypeId GetTestTypeId() {
+  return GetTypeId<Test>();
+}
+
+// The value of GetTestTypeId() as seen from within the Google Test
+// library.  This is solely for testing GetTestTypeId().
+extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();
+
+// This predicate-formatter checks that 'results' contains a test part
+// failure of the given type and that the failure message contains the
+// given substring.
+AssertionResult HasOneFailure(const char* /* results_expr */,
+                              const char* /* type_expr */,
+                              const char* /* substr_expr */,
+                              const TestPartResultArray& results,
+                              TestPartResult::Type type,
+                              const string& substr) {
+  const std::string expected(type == TestPartResult::kFatalFailure ?
+                        "1 fatal failure" :
+                        "1 non-fatal failure");
+  Message msg;
+  if (results.size() != 1) {
+    msg << "Expected: " << expected << "\n"
+        << "  Actual: " << results.size() << " failures";
+    for (int i = 0; i < results.size(); i++) {
+      msg << "\n" << results.GetTestPartResult(i);
+    }
+    return AssertionFailure() << msg;
+  }
+
+  const TestPartResult& r = results.GetTestPartResult(0);
+  if (r.type() != type) {
+    return AssertionFailure() << "Expected: " << expected << "\n"
+                              << "  Actual:\n"
+                              << r;
+  }
+
+  if (strstr(r.message(), substr.c_str()) == NULL) {
+    return AssertionFailure() << "Expected: " << expected << " containing \""
+                              << substr << "\"\n"
+                              << "  Actual:\n"
+                              << r;
+  }
+
+  return AssertionSuccess();
+}
+
+// The constructor of SingleFailureChecker remembers where to look up
+// test part results, what type of failure we expect, and what
+// substring the failure message should contain.
+SingleFailureChecker:: SingleFailureChecker(
+    const TestPartResultArray* results,
+    TestPartResult::Type type,
+    const string& substr)
+    : results_(results),
+      type_(type),
+      substr_(substr) {}
+
+// The destructor of SingleFailureChecker verifies that the given
+// TestPartResultArray contains exactly one failure that has the given
+// type and contains the given substring.  If that's not the case, a
+// non-fatal failure will be generated.
+SingleFailureChecker::~SingleFailureChecker() {
+  EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);
+}
+
+DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
+    UnitTestImpl* unit_test) : unit_test_(unit_test) {}
+
+void DefaultGlobalTestPartResultReporter::ReportTestPartResult(
+    const TestPartResult& result) {
+  unit_test_->current_test_result()->AddTestPartResult(result);
+  unit_test_->listeners()->repeater()->OnTestPartResult(result);
+}
+
+DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(
+    UnitTestImpl* unit_test) : unit_test_(unit_test) {}
+
+void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
+    const TestPartResult& result) {
+  unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);
+}
+
+// Returns the global test part result reporter.
+TestPartResultReporterInterface*
+UnitTestImpl::GetGlobalTestPartResultReporter() {
+  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
+  return global_test_part_result_repoter_;
+}
+
+// Sets the global test part result reporter.
+void UnitTestImpl::SetGlobalTestPartResultReporter(
+    TestPartResultReporterInterface* reporter) {
+  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
+  global_test_part_result_repoter_ = reporter;
+}
+
+// Returns the test part result reporter for the current thread.
+TestPartResultReporterInterface*
+UnitTestImpl::GetTestPartResultReporterForCurrentThread() {
+  return per_thread_test_part_result_reporter_.get();
+}
+
+// Sets the test part result reporter for the current thread.
+void UnitTestImpl::SetTestPartResultReporterForCurrentThread(
+    TestPartResultReporterInterface* reporter) {
+  per_thread_test_part_result_reporter_.set(reporter);
+}
+
+// Gets the number of successful test cases.
+int UnitTestImpl::successful_test_case_count() const {
+  return CountIf(test_cases_, TestCasePassed);
+}
+
+// Gets the number of failed test cases.
+int UnitTestImpl::failed_test_case_count() const {
+  return CountIf(test_cases_, TestCaseFailed);
+}
+
+// Gets the number of all test cases.
+int UnitTestImpl::total_test_case_count() const {
+  return static_cast<int>(test_cases_.size());
+}
+
+// Gets the number of all test cases that contain at least one test
+// that should run.
+int UnitTestImpl::test_case_to_run_count() const {
+  return CountIf(test_cases_, ShouldRunTestCase);
+}
+
+// Gets the number of successful tests.
+int UnitTestImpl::successful_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);
+}
+
+// Gets the number of failed tests.
+int UnitTestImpl::failed_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);
+}
+
+// Gets the number of disabled tests that will be reported in the XML report.
+int UnitTestImpl::reportable_disabled_test_count() const {
+  return SumOverTestCaseList(test_cases_,
+                             &TestCase::reportable_disabled_test_count);
+}
+
+// Gets the number of disabled tests.
+int UnitTestImpl::disabled_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);
+}
+
+// Gets the number of tests to be printed in the XML report.
+int UnitTestImpl::reportable_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::reportable_test_count);
+}
+
+// Gets the number of all tests.
+int UnitTestImpl::total_test_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);
+}
+
+// Gets the number of tests that should run.
+int UnitTestImpl::test_to_run_count() const {
+  return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);
+}
+
+// Returns the current OS stack trace as an std::string.
+//
+// The maximum number of stack frames to be included is specified by
+// the gtest_stack_trace_depth flag.  The skip_count parameter
+// specifies the number of top frames to be skipped, which doesn't
+// count against the number of frames to be included.
+//
+// For example, if Foo() calls Bar(), which in turn calls
+// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
+// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
+std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
+  return os_stack_trace_getter()->CurrentStackTrace(
+      static_cast<int>(GTEST_FLAG(stack_trace_depth)),
+      skip_count + 1
+      // Skips the user-specified number of frames plus this function
+      // itself.
+      );  // NOLINT
+}
+
+// Returns the current time in milliseconds.
+TimeInMillis GetTimeInMillis() {
+#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)
+  // Difference between 1970-01-01 and 1601-01-01 in milliseconds.
+  // http://analogous.blogspot.com/2005/04/epoch.html
+  const TimeInMillis kJavaEpochToWinFileTimeDelta =
+    static_cast<TimeInMillis>(116444736UL) * 100000UL;
+  const DWORD kTenthMicrosInMilliSecond = 10000;
+
+  SYSTEMTIME now_systime;
+  FILETIME now_filetime;
+  ULARGE_INTEGER now_int64;
+  // TODO(kenton@google.com): Shouldn't this just use
+  //   GetSystemTimeAsFileTime()?
+  GetSystemTime(&now_systime);
+  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {
+    now_int64.LowPart = now_filetime.dwLowDateTime;
+    now_int64.HighPart = now_filetime.dwHighDateTime;
+    now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -
+      kJavaEpochToWinFileTimeDelta;
+    return now_int64.QuadPart;
+  }
+  return 0;
+#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
+  __timeb64 now;
+
+  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
+  // (deprecated function) there.
+  // TODO(kenton@google.com): Use GetTickCount()?  Or use
+  //   SystemTimeToFileTime()
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
+  _ftime64(&now);
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
+#elif GTEST_HAS_GETTIMEOFDAY_
+  struct timeval now;
+  gettimeofday(&now, NULL);
+  return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;
+#else
+# error "Don't know how to get the current time on your system."
+#endif
+}
+
+// Utilities
+
+// class String.
+
+#if GTEST_OS_WINDOWS_MOBILE
+// Creates a UTF-16 wide string from the given ANSI string, allocating
+// memory using new. The caller is responsible for deleting the return
+// value using delete[]. Returns the wide string, or NULL if the
+// input is NULL.
+LPCWSTR String::AnsiToUtf16(const char* ansi) {
+  if (!ansi) return NULL;
+  const int length = strlen(ansi);
+  const int unicode_length =
+      MultiByteToWideChar(CP_ACP, 0, ansi, length,
+                          NULL, 0);
+  WCHAR* unicode = new WCHAR[unicode_length + 1];
+  MultiByteToWideChar(CP_ACP, 0, ansi, length,
+                      unicode, unicode_length);
+  unicode[unicode_length] = 0;
+  return unicode;
+}
+
+// Creates an ANSI string from the given wide string, allocating
+// memory using new. The caller is responsible for deleting the return
+// value using delete[]. Returns the ANSI string, or NULL if the
+// input is NULL.
+const char* String::Utf16ToAnsi(LPCWSTR utf16_str)  {
+  if (!utf16_str) return NULL;
+  const int ansi_length =
+      WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
+                          NULL, 0, NULL, NULL);
+  char* ansi = new char[ansi_length + 1];
+  WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,
+                      ansi, ansi_length, NULL, NULL);
+  ansi[ansi_length] = 0;
+  return ansi;
+}
+
+#endif  // GTEST_OS_WINDOWS_MOBILE
+
+// Compares two C strings.  Returns true iff they have the same content.
+//
+// Unlike strcmp(), this function can handle NULL argument(s).  A NULL
+// C string is considered different to any non-NULL C string,
+// including the empty string.
+bool String::CStringEquals(const char * lhs, const char * rhs) {
+  if ( lhs == NULL ) return rhs == NULL;
+
+  if ( rhs == NULL ) return false;
+
+  return strcmp(lhs, rhs) == 0;
+}
+
+#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
+
+// Converts an array of wide chars to a narrow string using the UTF-8
+// encoding, and streams the result to the given Message object.
+static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
+                                     Message* msg) {
+  for (size_t i = 0; i != length; ) {  // NOLINT
+    if (wstr[i] != L'\0') {
+      *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
+      while (i != length && wstr[i] != L'\0')
+        i++;
+    } else {
+      *msg << '\0';
+      i++;
+    }
+  }
+}
+
+#endif  // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
+
+void SplitString(const ::std::string& str, char delimiter,
+                 ::std::vector< ::std::string>* dest) {
+  ::std::vector< ::std::string> parsed;
+  ::std::string::size_type pos = 0;
+  while (::testing::internal::AlwaysTrue()) {
+    const ::std::string::size_type colon = str.find(delimiter, pos);
+    if (colon == ::std::string::npos) {
+      parsed.push_back(str.substr(pos));
+      break;
+    } else {
+      parsed.push_back(str.substr(pos, colon - pos));
+      pos = colon + 1;
+    }
+  }
+  dest->swap(parsed);
+}
+
+}  // namespace internal
+
+// Constructs an empty Message.
+// We allocate the stringstream separately because otherwise each use of
+// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
+// stack frame leading to huge stack frames in some cases; gcc does not reuse
+// the stack space.
+Message::Message() : ss_(new ::std::stringstream) {
+  // By default, we want there to be enough precision when printing
+  // a double to a Message.
+  *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
+}
+
+// These two overloads allow streaming a wide C string to a Message
+// using the UTF-8 encoding.
+Message& Message::operator <<(const wchar_t* wide_c_str) {
+  return *this << internal::String::ShowWideCString(wide_c_str);
+}
+Message& Message::operator <<(wchar_t* wide_c_str) {
+  return *this << internal::String::ShowWideCString(wide_c_str);
+}
+
+#if GTEST_HAS_STD_WSTRING
+// Converts the given wide string to a narrow string using the UTF-8
+// encoding, and streams the result to this Message object.
+Message& Message::operator <<(const ::std::wstring& wstr) {
+  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
+  return *this;
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+#if GTEST_HAS_GLOBAL_WSTRING
+// Converts the given wide string to a narrow string using the UTF-8
+// encoding, and streams the result to this Message object.
+Message& Message::operator <<(const ::wstring& wstr) {
+  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
+  return *this;
+}
+#endif  // GTEST_HAS_GLOBAL_WSTRING
+
+// Gets the text streamed to this object so far as an std::string.
+// Each '\0' character in the buffer is replaced with "\\0".
+std::string Message::GetString() const {
+  return internal::StringStreamToString(ss_.get());
+}
+
+// AssertionResult constructors.
+// Used in EXPECT_TRUE/FALSE(assertion_result).
+AssertionResult::AssertionResult(const AssertionResult& other)
+    : success_(other.success_),
+      message_(other.message_.get() != NULL ?
+               new ::std::string(*other.message_) :
+               static_cast< ::std::string*>(NULL)) {
+}
+
+// Swaps two AssertionResults.
+void AssertionResult::swap(AssertionResult& other) {
+  using std::swap;
+  swap(success_, other.success_);
+  swap(message_, other.message_);
+}
+
+// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
+AssertionResult AssertionResult::operator!() const {
+  AssertionResult negation(!success_);
+  if (message_.get() != NULL)
+    negation << *message_;
+  return negation;
+}
+
+// Makes a successful assertion result.
+AssertionResult AssertionSuccess() {
+  return AssertionResult(true);
+}
+
+// Makes a failed assertion result.
+AssertionResult AssertionFailure() {
+  return AssertionResult(false);
+}
+
+// Makes a failed assertion result with the given failure message.
+// Deprecated; use AssertionFailure() << message.
+AssertionResult AssertionFailure(const Message& message) {
+  return AssertionFailure() << message;
+}
+
+namespace internal {
+
+namespace edit_distance {
+std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
+                                            const std::vector<size_t>& right) {
+  std::vector<std::vector<double> > costs(
+      left.size() + 1, std::vector<double>(right.size() + 1));
+  std::vector<std::vector<EditType> > best_move(
+      left.size() + 1, std::vector<EditType>(right.size() + 1));
+
+  // Populate for empty right.
+  for (size_t l_i = 0; l_i < costs.size(); ++l_i) {
+    costs[l_i][0] = static_cast<double>(l_i);
+    best_move[l_i][0] = kRemove;
+  }
+  // Populate for empty left.
+  for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {
+    costs[0][r_i] = static_cast<double>(r_i);
+    best_move[0][r_i] = kAdd;
+  }
+
+  for (size_t l_i = 0; l_i < left.size(); ++l_i) {
+    for (size_t r_i = 0; r_i < right.size(); ++r_i) {
+      if (left[l_i] == right[r_i]) {
+        // Found a match. Consume it.
+        costs[l_i + 1][r_i + 1] = costs[l_i][r_i];
+        best_move[l_i + 1][r_i + 1] = kMatch;
+        continue;
+      }
+
+      const double add = costs[l_i + 1][r_i];
+      const double remove = costs[l_i][r_i + 1];
+      const double replace = costs[l_i][r_i];
+      if (add < remove && add < replace) {
+        costs[l_i + 1][r_i + 1] = add + 1;
+        best_move[l_i + 1][r_i + 1] = kAdd;
+      } else if (remove < add && remove < replace) {
+        costs[l_i + 1][r_i + 1] = remove + 1;
+        best_move[l_i + 1][r_i + 1] = kRemove;
+      } else {
+        // We make replace a little more expensive than add/remove to lower
+        // their priority.
+        costs[l_i + 1][r_i + 1] = replace + 1.00001;
+        best_move[l_i + 1][r_i + 1] = kReplace;
+      }
+    }
+  }
+
+  // Reconstruct the best path. We do it in reverse order.
+  std::vector<EditType> best_path;
+  for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {
+    EditType move = best_move[l_i][r_i];
+    best_path.push_back(move);
+    l_i -= move != kAdd;
+    r_i -= move != kRemove;
+  }
+  std::reverse(best_path.begin(), best_path.end());
+  return best_path;
+}
+
+namespace {
+
+// Helper class to convert string into ids with deduplication.
+class InternalStrings {
+ public:
+  size_t GetId(const std::string& str) {
+    IdMap::iterator it = ids_.find(str);
+    if (it != ids_.end()) return it->second;
+    size_t id = ids_.size();
+    return ids_[str] = id;
+  }
+
+ private:
+  typedef std::map<std::string, size_t> IdMap;
+  IdMap ids_;
+};
+
+}  // namespace
+
+std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<std::string>& left,
+    const std::vector<std::string>& right) {
+  std::vector<size_t> left_ids, right_ids;
+  {
+    InternalStrings intern_table;
+    for (size_t i = 0; i < left.size(); ++i) {
+      left_ids.push_back(intern_table.GetId(left[i]));
+    }
+    for (size_t i = 0; i < right.size(); ++i) {
+      right_ids.push_back(intern_table.GetId(right[i]));
+    }
+  }
+  return CalculateOptimalEdits(left_ids, right_ids);
+}
+
+namespace {
+
+// Helper class that holds the state for one hunk and prints it out to the
+// stream.
+// It reorders adds/removes when possible to group all removes before all
+// adds. It also adds the hunk header before printint into the stream.
+class Hunk {
+ public:
+  Hunk(size_t left_start, size_t right_start)
+      : left_start_(left_start),
+        right_start_(right_start),
+        adds_(),
+        removes_(),
+        common_() {}
+
+  void PushLine(char edit, const char* line) {
+    switch (edit) {
+      case ' ':
+        ++common_;
+        FlushEdits();
+        hunk_.push_back(std::make_pair(' ', line));
+        break;
+      case '-':
+        ++removes_;
+        hunk_removes_.push_back(std::make_pair('-', line));
+        break;
+      case '+':
+        ++adds_;
+        hunk_adds_.push_back(std::make_pair('+', line));
+        break;
+    }
+  }
+
+  void PrintTo(std::ostream* os) {
+    PrintHeader(os);
+    FlushEdits();
+    for (std::list<std::pair<char, const char*> >::const_iterator it =
+             hunk_.begin();
+         it != hunk_.end(); ++it) {
+      *os << it->first << it->second << "\n";
+    }
+  }
+
+  bool has_edits() const { return adds_ || removes_; }
+
+ private:
+  void FlushEdits() {
+    hunk_.splice(hunk_.end(), hunk_removes_);
+    hunk_.splice(hunk_.end(), hunk_adds_);
+  }
+
+  // Print a unified diff header for one hunk.
+  // The format is
+  //   "@@ -<left_start>,<left_length> +<right_start>,<right_length> @@"
+  // where the left/right parts are ommitted if unnecessary.
+  void PrintHeader(std::ostream* ss) const {
+    *ss << "@@ ";
+    if (removes_) {
+      *ss << "-" << left_start_ << "," << (removes_ + common_);
+    }
+    if (removes_ && adds_) {
+      *ss << " ";
+    }
+    if (adds_) {
+      *ss << "+" << right_start_ << "," << (adds_ + common_);
+    }
+    *ss << " @@\n";
+  }
+
+  size_t left_start_, right_start_;
+  size_t adds_, removes_, common_;
+  std::list<std::pair<char, const char*> > hunk_, hunk_adds_, hunk_removes_;
+};
+
+}  // namespace
+
+// Create a list of diff hunks in Unified diff format.
+// Each hunk has a header generated by PrintHeader above plus a body with
+// lines prefixed with ' ' for no change, '-' for deletion and '+' for
+// addition.
+// 'context' represents the desired unchanged prefix/suffix around the diff.
+// If two hunks are close enough that their contexts overlap, then they are
+// joined into one hunk.
+std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+                              const std::vector<std::string>& right,
+                              size_t context) {
+  const std::vector<EditType> edits = CalculateOptimalEdits(left, right);
+
+  size_t l_i = 0, r_i = 0, edit_i = 0;
+  std::stringstream ss;
+  while (edit_i < edits.size()) {
+    // Find first edit.
+    while (edit_i < edits.size() && edits[edit_i] == kMatch) {
+      ++l_i;
+      ++r_i;
+      ++edit_i;
+    }
+
+    // Find the first line to include in the hunk.
+    const size_t prefix_context = std::min(l_i, context);
+    Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);
+    for (size_t i = prefix_context; i > 0; --i) {
+      hunk.PushLine(' ', left[l_i - i].c_str());
+    }
+
+    // Iterate the edits until we found enough suffix for the hunk or the input
+    // is over.
+    size_t n_suffix = 0;
+    for (; edit_i < edits.size(); ++edit_i) {
+      if (n_suffix >= context) {
+        // Continue only if the next hunk is very close.
+        std::vector<EditType>::const_iterator it = edits.begin() + edit_i;
+        while (it != edits.end() && *it == kMatch) ++it;
+        if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {
+          // There is no next edit or it is too far away.
+          break;
+        }
+      }
+
+      EditType edit = edits[edit_i];
+      // Reset count when a non match is found.
+      n_suffix = edit == kMatch ? n_suffix + 1 : 0;
+
+      if (edit == kMatch || edit == kRemove || edit == kReplace) {
+        hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());
+      }
+      if (edit == kAdd || edit == kReplace) {
+        hunk.PushLine('+', right[r_i].c_str());
+      }
+
+      // Advance indices, depending on edit type.
+      l_i += edit != kAdd;
+      r_i += edit != kRemove;
+    }
+
+    if (!hunk.has_edits()) {
+      // We are done. We don't want this hunk.
+      break;
+    }
+
+    hunk.PrintTo(&ss);
+  }
+  return ss.str();
+}
+
+}  // namespace edit_distance
+
+namespace {
+
+// The string representation of the values received in EqFailure() are already
+// escaped. Split them on escaped '\n' boundaries. Leave all other escaped
+// characters the same.
+std::vector<std::string> SplitEscapedString(const std::string& str) {
+  std::vector<std::string> lines;
+  size_t start = 0, end = str.size();
+  if (end > 2 && str[0] == '"' && str[end - 1] == '"') {
+    ++start;
+    --end;
+  }
+  bool escaped = false;
+  for (size_t i = start; i + 1 < end; ++i) {
+    if (escaped) {
+      escaped = false;
+      if (str[i] == 'n') {
+        lines.push_back(str.substr(start, i - start - 1));
+        start = i + 1;
+      }
+    } else {
+      escaped = str[i] == '\\';
+    }
+  }
+  lines.push_back(str.substr(start, end - start));
+  return lines;
+}
+
+}  // namespace
+
+// Constructs and returns the message for an equality assertion
+// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
+//
+// The first four parameters are the expressions used in the assertion
+// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
+// where foo is 5 and bar is 6, we have:
+//
+//   lhs_expression: "foo"
+//   rhs_expression: "bar"
+//   lhs_value:      "5"
+//   rhs_value:      "6"
+//
+// The ignoring_case parameter is true iff the assertion is a
+// *_STRCASEEQ*.  When it's true, the string "Ignoring case" will
+// be inserted into the message.
+AssertionResult EqFailure(const char* lhs_expression,
+                          const char* rhs_expression,
+                          const std::string& lhs_value,
+                          const std::string& rhs_value,
+                          bool ignoring_case) {
+  Message msg;
+  msg << "      Expected: " << lhs_expression;
+  if (lhs_value != lhs_expression) {
+    msg << "\n      Which is: " << lhs_value;
+  }
+  msg << "\nTo be equal to: " << rhs_expression;
+  if (rhs_value != rhs_expression) {
+    msg << "\n      Which is: " << rhs_value;
+  }
+
+  if (ignoring_case) {
+    msg << "\nIgnoring case";
+  }
+
+  if (!lhs_value.empty() && !rhs_value.empty()) {
+    const std::vector<std::string> lhs_lines =
+        SplitEscapedString(lhs_value);
+    const std::vector<std::string> rhs_lines =
+        SplitEscapedString(rhs_value);
+    if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {
+      msg << "\nWith diff:\n"
+          << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);
+    }
+  }
+
+  return AssertionFailure() << msg;
+}
+
+// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
+std::string GetBoolAssertionFailureMessage(
+    const AssertionResult& assertion_result,
+    const char* expression_text,
+    const char* actual_predicate_value,
+    const char* expected_predicate_value) {
+  const char* actual_message = assertion_result.message();
+  Message msg;
+  msg << "Value of: " << expression_text
+      << "\n  Actual: " << actual_predicate_value;
+  if (actual_message[0] != '\0')
+    msg << " (" << actual_message << ")";
+  msg << "\nExpected: " << expected_predicate_value;
+  return msg.GetString();
+}
+
+// Helper function for implementing ASSERT_NEAR.
+AssertionResult DoubleNearPredFormat(const char* expr1,
+                                     const char* expr2,
+                                     const char* abs_error_expr,
+                                     double val1,
+                                     double val2,
+                                     double abs_error) {
+  const double diff = fabs(val1 - val2);
+  if (diff <= abs_error) return AssertionSuccess();
+
+  // TODO(wan): do not print the value of an expression if it's
+  // already a literal.
+  return AssertionFailure()
+      << "The difference between " << expr1 << " and " << expr2
+      << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
+      << expr1 << " evaluates to " << val1 << ",\n"
+      << expr2 << " evaluates to " << val2 << ", and\n"
+      << abs_error_expr << " evaluates to " << abs_error << ".";
+}
+
+
+// Helper template for implementing FloatLE() and DoubleLE().
+template <typename RawType>
+AssertionResult FloatingPointLE(const char* expr1,
+                                const char* expr2,
+                                RawType val1,
+                                RawType val2) {
+  // Returns success if val1 is less than val2,
+  if (val1 < val2) {
+    return AssertionSuccess();
+  }
+
+  // or if val1 is almost equal to val2.
+  const FloatingPoint<RawType> lhs(val1), rhs(val2);
+  if (lhs.AlmostEquals(rhs)) {
+    return AssertionSuccess();
+  }
+
+  // Note that the above two checks will both fail if either val1 or
+  // val2 is NaN, as the IEEE floating-point standard requires that
+  // any predicate involving a NaN must return false.
+
+  ::std::stringstream val1_ss;
+  val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+          << val1;
+
+  ::std::stringstream val2_ss;
+  val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+          << val2;
+
+  return AssertionFailure()
+      << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"
+      << "  Actual: " << StringStreamToString(&val1_ss) << " vs "
+      << StringStreamToString(&val2_ss);
+}
+
+}  // namespace internal
+
+// Asserts that val1 is less than, or almost equal to, val2.  Fails
+// otherwise.  In particular, it fails if either val1 or val2 is NaN.
+AssertionResult FloatLE(const char* expr1, const char* expr2,
+                        float val1, float val2) {
+  return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);
+}
+
+// Asserts that val1 is less than, or almost equal to, val2.  Fails
+// otherwise.  In particular, it fails if either val1 or val2 is NaN.
+AssertionResult DoubleLE(const char* expr1, const char* expr2,
+                         double val1, double val2) {
+  return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);
+}
+
+namespace internal {
+
+// The helper function for {ASSERT|EXPECT}_EQ with int or enum
+// arguments.
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+                            const char* rhs_expression,
+                            BiggestInt lhs,
+                            BiggestInt rhs) {
+  if (lhs == rhs) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   FormatForComparisonFailureMessage(lhs, rhs),
+                   FormatForComparisonFailureMessage(rhs, lhs),
+                   false);
+}
+
+// A macro for implementing the helper functions needed to implement
+// ASSERT_?? and EXPECT_?? with integer or enum arguments.  It is here
+// just to avoid copy-and-paste of similar code.
+#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
+AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
+                                   BiggestInt val1, BiggestInt val2) {\
+  if (val1 op val2) {\
+    return AssertionSuccess();\
+  } else {\
+    return AssertionFailure() \
+        << "Expected: (" << expr1 << ") " #op " (" << expr2\
+        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
+        << " vs " << FormatForComparisonFailureMessage(val2, val1);\
+  }\
+}
+
+// Implements the helper function for {ASSERT|EXPECT}_NE with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(NE, !=)
+// Implements the helper function for {ASSERT|EXPECT}_LE with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(LE, <=)
+// Implements the helper function for {ASSERT|EXPECT}_LT with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(LT, < )
+// Implements the helper function for {ASSERT|EXPECT}_GE with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(GE, >=)
+// Implements the helper function for {ASSERT|EXPECT}_GT with int or
+// enum arguments.
+GTEST_IMPL_CMP_HELPER_(GT, > )
+
+#undef GTEST_IMPL_CMP_HELPER_
+
+// The helper function for {ASSERT|EXPECT}_STREQ.
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+                               const char* rhs_expression,
+                               const char* lhs,
+                               const char* rhs) {
+  if (String::CStringEquals(lhs, rhs)) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
+                   false);
+}
+
+// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
+AssertionResult CmpHelperSTRCASEEQ(const char* lhs_expression,
+                                   const char* rhs_expression,
+                                   const char* lhs,
+                                   const char* rhs) {
+  if (String::CaseInsensitiveCStringEquals(lhs, rhs)) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
+                   true);
+}
+
+// The helper function for {ASSERT|EXPECT}_STRNE.
+AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                               const char* s2_expression,
+                               const char* s1,
+                               const char* s2) {
+  if (!String::CStringEquals(s1, s2)) {
+    return AssertionSuccess();
+  } else {
+    return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
+                              << s2_expression << "), actual: \""
+                              << s1 << "\" vs \"" << s2 << "\"";
+  }
+}
+
+// The helper function for {ASSERT|EXPECT}_STRCASENE.
+AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
+                                   const char* s2_expression,
+                                   const char* s1,
+                                   const char* s2) {
+  if (!String::CaseInsensitiveCStringEquals(s1, s2)) {
+    return AssertionSuccess();
+  } else {
+    return AssertionFailure()
+        << "Expected: (" << s1_expression << ") != ("
+        << s2_expression << ") (ignoring case), actual: \""
+        << s1 << "\" vs \"" << s2 << "\"";
+  }
+}
+
+}  // namespace internal
+
+namespace {
+
+// Helper functions for implementing IsSubString() and IsNotSubstring().
+
+// This group of overloaded functions return true iff needle is a
+// substring of haystack.  NULL is considered a substring of itself
+// only.
+
+bool IsSubstringPred(const char* needle, const char* haystack) {
+  if (needle == NULL || haystack == NULL)
+    return needle == haystack;
+
+  return strstr(haystack, needle) != NULL;
+}
+
+bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {
+  if (needle == NULL || haystack == NULL)
+    return needle == haystack;
+
+  return wcsstr(haystack, needle) != NULL;
+}
+
+// StringType here can be either ::std::string or ::std::wstring.
+template <typename StringType>
+bool IsSubstringPred(const StringType& needle,
+                     const StringType& haystack) {
+  return haystack.find(needle) != StringType::npos;
+}
+
+// This function implements either IsSubstring() or IsNotSubstring(),
+// depending on the value of the expected_to_be_substring parameter.
+// StringType here can be const char*, const wchar_t*, ::std::string,
+// or ::std::wstring.
+template <typename StringType>
+AssertionResult IsSubstringImpl(
+    bool expected_to_be_substring,
+    const char* needle_expr, const char* haystack_expr,
+    const StringType& needle, const StringType& haystack) {
+  if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
+    return AssertionSuccess();
+
+  const bool is_wide_string = sizeof(needle[0]) > 1;
+  const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
+  return AssertionFailure()
+      << "Value of: " << needle_expr << "\n"
+      << "  Actual: " << begin_string_quote << needle << "\"\n"
+      << "Expected: " << (expected_to_be_substring ? "" : "not ")
+      << "a substring of " << haystack_expr << "\n"
+      << "Which is: " << begin_string_quote << haystack << "\"";
+}
+
+}  // namespace
+
+// IsSubstring() and IsNotSubstring() check whether needle is a
+// substring of haystack (NULL is considered a substring of itself
+// only), and return an appropriate error message when they fail.
+
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const char* needle, const char* haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const wchar_t* needle, const wchar_t* haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::string& needle, const ::std::string& haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+
+#if GTEST_HAS_STD_WSTRING
+AssertionResult IsSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack) {
+  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
+}
+
+AssertionResult IsNotSubstring(
+    const char* needle_expr, const char* haystack_expr,
+    const ::std::wstring& needle, const ::std::wstring& haystack) {
+  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
+}
+#endif  // GTEST_HAS_STD_WSTRING
+
+namespace internal {
+
+#if GTEST_OS_WINDOWS
+
+namespace {
+
+// Helper function for IsHRESULT{SuccessFailure} predicates
+AssertionResult HRESULTFailureHelper(const char* expr,
+                                     const char* expected,
+                                     long hr) {  // NOLINT
+# if GTEST_OS_WINDOWS_MOBILE
+
+  // Windows CE doesn't support FormatMessage.
+  const char error_text[] = "";
+
+# else
+
+  // Looks up the human-readable system message for the HRESULT code
+  // and since we're not passing any params to FormatMessage, we don't
+  // want inserts expanded.
+  const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |
+                       FORMAT_MESSAGE_IGNORE_INSERTS;
+  const DWORD kBufSize = 4096;
+  // Gets the system's human readable message string for this HRESULT.
+  char error_text[kBufSize] = { '\0' };
+  DWORD message_length = ::FormatMessageA(kFlags,
+                                          0,  // no source, we're asking system
+                                          hr,  // the error
+                                          0,  // no line width restrictions
+                                          error_text,  // output buffer
+                                          kBufSize,  // buf size
+                                          NULL);  // no arguments for inserts
+  // Trims tailing white space (FormatMessage leaves a trailing CR-LF)
+  for (; message_length && IsSpace(error_text[message_length - 1]);
+          --message_length) {
+    error_text[message_length - 1] = '\0';
+  }
+
+# endif  // GTEST_OS_WINDOWS_MOBILE
+
+  const std::string error_hex("0x" + String::FormatHexInt(hr));
+  return ::testing::AssertionFailure()
+      << "Expected: " << expr << " " << expected << ".\n"
+      << "  Actual: " << error_hex << " " << error_text << "\n";
+}
+
+}  // namespace
+
+AssertionResult IsHRESULTSuccess(const char* expr, long hr) {  // NOLINT
+  if (SUCCEEDED(hr)) {
+    return AssertionSuccess();
+  }
+  return HRESULTFailureHelper(expr, "succeeds", hr);
+}
+
+AssertionResult IsHRESULTFailure(const char* expr, long hr) {  // NOLINT
+  if (FAILED(hr)) {
+    return AssertionSuccess();
+  }
+  return HRESULTFailureHelper(expr, "fails", hr);
+}
+
+#endif  // GTEST_OS_WINDOWS
+
+// Utility functions for encoding Unicode text (wide strings) in
+// UTF-8.
+
+// A Unicode code-point can have upto 21 bits, and is encoded in UTF-8
+// like this:
+//
+// Code-point length   Encoding
+//   0 -  7 bits       0xxxxxxx
+//   8 - 11 bits       110xxxxx 10xxxxxx
+//  12 - 16 bits       1110xxxx 10xxxxxx 10xxxxxx
+//  17 - 21 bits       11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+
+// The maximum code-point a one-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) <<  7) - 1;
+
+// The maximum code-point a two-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1;
+
+// The maximum code-point a three-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1;
+
+// The maximum code-point a four-byte UTF-8 sequence can represent.
+const UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1;
+
+// Chops off the n lowest bits from a bit pattern.  Returns the n
+// lowest bits.  As a side effect, the original bit pattern will be
+// shifted to the right by n bits.
+inline UInt32 ChopLowBits(UInt32* bits, int n) {
+  const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);
+  *bits >>= n;
+  return low_bits;
+}
+
+// Converts a Unicode code point to a narrow string in UTF-8 encoding.
+// code_point parameter is of type UInt32 because wchar_t may not be
+// wide enough to contain a code point.
+// If the code_point is not a valid Unicode code point
+// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
+// to "(Invalid Unicode 0xXXXXXXXX)".
+std::string CodePointToUtf8(UInt32 code_point) {
+  if (code_point > kMaxCodePoint4) {
+    return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")";
+  }
+
+  char str[5];  // Big enough for the largest valid code point.
+  if (code_point <= kMaxCodePoint1) {
+    str[1] = '\0';
+    str[0] = static_cast<char>(code_point);                          // 0xxxxxxx
+  } else if (code_point <= kMaxCodePoint2) {
+    str[2] = '\0';
+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[0] = static_cast<char>(0xC0 | code_point);                   // 110xxxxx
+  } else if (code_point <= kMaxCodePoint3) {
+    str[3] = '\0';
+    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[0] = static_cast<char>(0xE0 | code_point);                   // 1110xxxx
+  } else {  // code_point <= kMaxCodePoint4
+    str[4] = '\0';
+    str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx
+    str[0] = static_cast<char>(0xF0 | code_point);                   // 11110xxx
+  }
+  return str;
+}
+
+// The following two functions only make sense if the the system
+// uses UTF-16 for wide string encoding. All supported systems
+// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.
+
+// Determines if the arguments constitute UTF-16 surrogate pair
+// and thus should be combined into a single Unicode code point
+// using CreateCodePointFromUtf16SurrogatePair.
+inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
+  return sizeof(wchar_t) == 2 &&
+      (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
+}
+
+// Creates a Unicode code point from UTF16 surrogate pair.
+inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,
+                                                    wchar_t second) {
+  const UInt32 mask = (1 << 10) - 1;
+  return (sizeof(wchar_t) == 2) ?
+      (((first & mask) << 10) | (second & mask)) + 0x10000 :
+      // This function should not be called when the condition is
+      // false, but we provide a sensible default in case it is.
+      static_cast<UInt32>(first);
+}
+
+// Converts a wide string to a narrow string in UTF-8 encoding.
+// The wide string is assumed to have the following encoding:
+//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
+//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)
+// Parameter str points to a null-terminated wide string.
+// Parameter num_chars may additionally limit the number
+// of wchar_t characters processed. -1 is used when the entire string
+// should be processed.
+// If the string contains code points that are not valid Unicode code points
+// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
+// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
+// and contains invalid UTF-16 surrogate pairs, values in those pairs
+// will be encoded as individual Unicode characters from Basic Normal Plane.
+std::string WideStringToUtf8(const wchar_t* str, int num_chars) {
+  if (num_chars == -1)
+    num_chars = static_cast<int>(wcslen(str));
+
+  ::std::stringstream stream;
+  for (int i = 0; i < num_chars; ++i) {
+    UInt32 unicode_code_point;
+
+    if (str[i] == L'\0') {
+      break;
+    } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
+      unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
+                                                                 str[i + 1]);
+      i++;
+    } else {
+      unicode_code_point = static_cast<UInt32>(str[i]);
+    }
+
+    stream << CodePointToUtf8(unicode_code_point);
+  }
+  return StringStreamToString(&stream);
+}
+
+// Converts a wide C string to an std::string using the UTF-8 encoding.
+// NULL will be converted to "(null)".
+std::string String::ShowWideCString(const wchar_t * wide_c_str) {
+  if (wide_c_str == NULL)  return "(null)";
+
+  return internal::WideStringToUtf8(wide_c_str, -1);
+}
+
+// Compares two wide C strings.  Returns true iff they have the same
+// content.
+//
+// Unlike wcscmp(), this function can handle NULL argument(s).  A NULL
+// C string is considered different to any non-NULL C string,
+// including the empty string.
+bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
+  if (lhs == NULL) return rhs == NULL;
+
+  if (rhs == NULL) return false;
+
+  return wcscmp(lhs, rhs) == 0;
+}
+
+// Helper function for *_STREQ on wide strings.
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+                               const char* rhs_expression,
+                               const wchar_t* lhs,
+                               const wchar_t* rhs) {
+  if (String::WideCStringEquals(lhs, rhs)) {
+    return AssertionSuccess();
+  }
+
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
+                   false);
+}
+
+// Helper function for *_STRNE on wide strings.
+AssertionResult CmpHelperSTRNE(const char* s1_expression,
+                               const char* s2_expression,
+                               const wchar_t* s1,
+                               const wchar_t* s2) {
+  if (!String::WideCStringEquals(s1, s2)) {
+    return AssertionSuccess();
+  }
+
+  return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
+                            << s2_expression << "), actual: "
+                            << PrintToString(s1)
+                            << " vs " << PrintToString(s2);
+}
+
+// Compares two C strings, ignoring case.  Returns true iff they have
+// the same content.
+//
+// Unlike strcasecmp(), this function can handle NULL argument(s).  A
+// NULL C string is considered different to any non-NULL C string,
+// including the empty string.
+bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
+  if (lhs == NULL)
+    return rhs == NULL;
+  if (rhs == NULL)
+    return false;
+  return posix::StrCaseCmp(lhs, rhs) == 0;
+}
+
+  // Compares two wide C strings, ignoring case.  Returns true iff they
+  // have the same content.
+  //
+  // Unlike wcscasecmp(), this function can handle NULL argument(s).
+  // A NULL C string is considered different to any non-NULL wide C string,
+  // including the empty string.
+  // NB: The implementations on different platforms slightly differ.
+  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
+  // environment variable. On GNU platform this method uses wcscasecmp
+  // which compares according to LC_CTYPE category of the current locale.
+  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
+  // current locale.
+bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
+                                              const wchar_t* rhs) {
+  if (lhs == NULL) return rhs == NULL;
+
+  if (rhs == NULL) return false;
+
+#if GTEST_OS_WINDOWS
+  return _wcsicmp(lhs, rhs) == 0;
+#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
+  return wcscasecmp(lhs, rhs) == 0;
+#else
+  // Android, Mac OS X and Cygwin don't define wcscasecmp.
+  // Other unknown OSes may not define it either.
+  wint_t left, right;
+  do {
+    left = towlower(*lhs++);
+    right = towlower(*rhs++);
+  } while (left && left == right);
+  return left == right;
+#endif  // OS selector
+}
+
+// Returns true iff str ends with the given suffix, ignoring case.
+// Any string is considered to end with an empty suffix.
+bool String::EndsWithCaseInsensitive(
+    const std::string& str, const std::string& suffix) {
+  const size_t str_len = str.length();
+  const size_t suffix_len = suffix.length();
+  return (str_len >= suffix_len) &&
+         CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len,
+                                      suffix.c_str());
+}
+
+// Formats an int value as "%02d".
+std::string String::FormatIntWidth2(int value) {
+  std::stringstream ss;
+  ss << std::setfill('0') << std::setw(2) << value;
+  return ss.str();
+}
+
+// Formats an int value as "%X".
+std::string String::FormatHexInt(int value) {
+  std::stringstream ss;
+  ss << std::hex << std::uppercase << value;
+  return ss.str();
+}
+
+// Formats a byte as "%02X".
+std::string String::FormatByte(unsigned char value) {
+  std::stringstream ss;
+  ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase
+     << static_cast<unsigned int>(value);
+  return ss.str();
+}
+
+// Converts the buffer in a stringstream to an std::string, converting NUL
+// bytes to "\\0" along the way.
+std::string StringStreamToString(::std::stringstream* ss) {
+  const ::std::string& str = ss->str();
+  const char* const start = str.c_str();
+  const char* const end = start + str.length();
+
+  std::string result;
+  result.reserve(2 * (end - start));
+  for (const char* ch = start; ch != end; ++ch) {
+    if (*ch == '\0') {
+      result += "\\0";  // Replaces NUL with "\\0";
+    } else {
+      result += *ch;
+    }
+  }
+
+  return result;
+}
+
+// Appends the user-supplied message to the Google-Test-generated message.
+std::string AppendUserMessage(const std::string& gtest_msg,
+                              const Message& user_msg) {
+  // Appends the user message if it's non-empty.
+  const std::string user_msg_string = user_msg.GetString();
+  if (user_msg_string.empty()) {
+    return gtest_msg;
+  }
+
+  return gtest_msg + "\n" + user_msg_string;
+}
+
+}  // namespace internal
+
+// class TestResult
+
+// Creates an empty TestResult.
+TestResult::TestResult()
+    : death_test_count_(0),
+      elapsed_time_(0) {
+}
+
+// D'tor.
+TestResult::~TestResult() {
+}
+
+// Returns the i-th test part result among all the results. i can
+// range from 0 to total_part_count() - 1. If i is not in that range,
+// aborts the program.
+const TestPartResult& TestResult::GetTestPartResult(int i) const {
+  if (i < 0 || i >= total_part_count())
+    internal::posix::Abort();
+  return test_part_results_.at(i);
+}
+
+// Returns the i-th test property. i can range from 0 to
+// test_property_count() - 1. If i is not in that range, aborts the
+// program.
+const TestProperty& TestResult::GetTestProperty(int i) const {
+  if (i < 0 || i >= test_property_count())
+    internal::posix::Abort();
+  return test_properties_.at(i);
+}
+
+// Clears the test part results.
+void TestResult::ClearTestPartResults() {
+  test_part_results_.clear();
+}
+
+// Adds a test part result to the list.
+void TestResult::AddTestPartResult(const TestPartResult& test_part_result) {
+  test_part_results_.push_back(test_part_result);
+}
+
+// Adds a test property to the list. If a property with the same key as the
+// supplied property is already represented, the value of this test_property
+// replaces the old value for that key.
+void TestResult::RecordProperty(const std::string& xml_element,
+                                const TestProperty& test_property) {
+  if (!ValidateTestProperty(xml_element, test_property)) {
+    return;
+  }
+  internal::MutexLock lock(&test_properites_mutex_);
+  const std::vector<TestProperty>::iterator property_with_matching_key =
+      std::find_if(test_properties_.begin(), test_properties_.end(),
+                   internal::TestPropertyKeyIs(test_property.key()));
+  if (property_with_matching_key == test_properties_.end()) {
+    test_properties_.push_back(test_property);
+    return;
+  }
+  property_with_matching_key->SetValue(test_property.value());
+}
+
+// The list of reserved attributes used in the <testsuites> element of XML
+// output.
+static const char* const kReservedTestSuitesAttributes[] = {
+  "disabled",
+  "errors",
+  "failures",
+  "name",
+  "random_seed",
+  "tests",
+  "time",
+  "timestamp"
+};
+
+// The list of reserved attributes used in the <testsuite> element of XML
+// output.
+static const char* const kReservedTestSuiteAttributes[] = {
+  "disabled",
+  "errors",
+  "failures",
+  "name",
+  "tests",
+  "time"
+};
+
+// The list of reserved attributes used in the <testcase> element of XML output.
+static const char* const kReservedTestCaseAttributes[] = {
+  "classname",
+  "name",
+  "status",
+  "time",
+  "type_param",
+  "value_param"
+};
+
+template <int kSize>
+std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {
+  return std::vector<std::string>(array, array + kSize);
+}
+
+static std::vector<std::string> GetReservedAttributesForElement(
+    const std::string& xml_element) {
+  if (xml_element == "testsuites") {
+    return ArrayAsVector(kReservedTestSuitesAttributes);
+  } else if (xml_element == "testsuite") {
+    return ArrayAsVector(kReservedTestSuiteAttributes);
+  } else if (xml_element == "testcase") {
+    return ArrayAsVector(kReservedTestCaseAttributes);
+  } else {
+    GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;
+  }
+  // This code is unreachable but some compilers may not realizes that.
+  return std::vector<std::string>();
+}
+
+static std::string FormatWordList(const std::vector<std::string>& words) {
+  Message word_list;
+  for (size_t i = 0; i < words.size(); ++i) {
+    if (i > 0 && words.size() > 2) {
+      word_list << ", ";
+    }
+    if (i == words.size() - 1) {
+      word_list << "and ";
+    }
+    word_list << "'" << words[i] << "'";
+  }
+  return word_list.GetString();
+}
+
+bool ValidateTestPropertyName(const std::string& property_name,
+                              const std::vector<std::string>& reserved_names) {
+  if (std::find(reserved_names.begin(), reserved_names.end(), property_name) !=
+          reserved_names.end()) {
+    ADD_FAILURE() << "Reserved key used in RecordProperty(): " << property_name
+                  << " (" << FormatWordList(reserved_names)
+                  << " are reserved by " << GTEST_NAME_ << ")";
+    return false;
+  }
+  return true;
+}
+
+// Adds a failure if the key is a reserved attribute of the element named
+// xml_element.  Returns true if the property is valid.
+bool TestResult::ValidateTestProperty(const std::string& xml_element,
+                                      const TestProperty& test_property) {
+  return ValidateTestPropertyName(test_property.key(),
+                                  GetReservedAttributesForElement(xml_element));
+}
+
+// Clears the object.
+void TestResult::Clear() {
+  test_part_results_.clear();
+  test_properties_.clear();
+  death_test_count_ = 0;
+  elapsed_time_ = 0;
+}
+
+// Returns true iff the test failed.
+bool TestResult::Failed() const {
+  for (int i = 0; i < total_part_count(); ++i) {
+    if (GetTestPartResult(i).failed())
+      return true;
+  }
+  return false;
+}
+
+// Returns true iff the test part fatally failed.
+static bool TestPartFatallyFailed(const TestPartResult& result) {
+  return result.fatally_failed();
+}
+
+// Returns true iff the test fatally failed.
+bool TestResult::HasFatalFailure() const {
+  return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
+}
+
+// Returns true iff the test part non-fatally failed.
+static bool TestPartNonfatallyFailed(const TestPartResult& result) {
+  return result.nonfatally_failed();
+}
+
+// Returns true iff the test has a non-fatal failure.
+bool TestResult::HasNonfatalFailure() const {
+  return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;
+}
+
+// Gets the number of all test parts.  This is the sum of the number
+// of successful test parts and the number of failed test parts.
+int TestResult::total_part_count() const {
+  return static_cast<int>(test_part_results_.size());
+}
+
+// Returns the number of the test properties.
+int TestResult::test_property_count() const {
+  return static_cast<int>(test_properties_.size());
+}
+
+// class Test
+
+// Creates a Test object.
+
+// The c'tor saves the states of all flags.
+Test::Test()
+    : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {
+}
+
+// The d'tor restores the states of all flags.  The actual work is
+// done by the d'tor of the gtest_flag_saver_ field, and thus not
+// visible here.
+Test::~Test() {
+}
+
+// Sets up the test fixture.
+//
+// A sub-class may override this.
+void Test::SetUp() {
+}
+
+// Tears down the test fixture.
+//
+// A sub-class may override this.
+void Test::TearDown() {
+}
+
+// Allows user supplied key value pairs to be recorded for later output.
+void Test::RecordProperty(const std::string& key, const std::string& value) {
+  UnitTest::GetInstance()->RecordProperty(key, value);
+}
+
+// Allows user supplied key value pairs to be recorded for later output.
+void Test::RecordProperty(const std::string& key, int value) {
+  Message value_message;
+  value_message << value;
+  RecordProperty(key, value_message.GetString().c_str());
+}
+
+namespace internal {
+
+void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
+                                    const std::string& message) {
+  // This function is a friend of UnitTest and as such has access to
+  // AddTestPartResult.
+  UnitTest::GetInstance()->AddTestPartResult(
+      result_type,
+      NULL,  // No info about the source file where the exception occurred.
+      -1,    // We have no info on which line caused the exception.
+      message,
+      "");   // No stack trace, either.
+}
+
+}  // namespace internal
+
+// Google Test requires all tests in the same test case to use the same test
+// fixture class.  This function checks if the current test has the
+// same fixture class as the first test in the current test case.  If
+// yes, it returns true; otherwise it generates a Google Test failure and
+// returns false.
+bool Test::HasSameFixtureClass() {
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  const TestCase* const test_case = impl->current_test_case();
+
+  // Info about the first test in the current test case.
+  const TestInfo* const first_test_info = test_case->test_info_list()[0];
+  const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;
+  const char* const first_test_name = first_test_info->name();
+
+  // Info about the current test.
+  const TestInfo* const this_test_info = impl->current_test_info();
+  const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;
+  const char* const this_test_name = this_test_info->name();
+
+  if (this_fixture_id != first_fixture_id) {
+    // Is the first test defined using TEST?
+    const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();
+    // Is this test defined using TEST?
+    const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
+
+    if (first_is_TEST || this_is_TEST) {
+      // Both TEST and TEST_F appear in same test case, which is incorrect.
+      // Tell the user how to fix this.
+
+      // Gets the name of the TEST and the name of the TEST_F.  Note
+      // that first_is_TEST and this_is_TEST cannot both be true, as
+      // the fixture IDs are different for the two tests.
+      const char* const TEST_name =
+          first_is_TEST ? first_test_name : this_test_name;
+      const char* const TEST_F_name =
+          first_is_TEST ? this_test_name : first_test_name;
+
+      ADD_FAILURE()
+          << "All tests in the same test case must use the same test fixture\n"
+          << "class, so mixing TEST_F and TEST in the same test case is\n"
+          << "illegal.  In test case " << this_test_info->test_case_name()
+          << ",\n"
+          << "test " << TEST_F_name << " is defined using TEST_F but\n"
+          << "test " << TEST_name << " is defined using TEST.  You probably\n"
+          << "want to change the TEST to TEST_F or move it to another test\n"
+          << "case.";
+    } else {
+      // Two fixture classes with the same name appear in two different
+      // namespaces, which is not allowed. Tell the user how to fix this.
+      ADD_FAILURE()
+          << "All tests in the same test case must use the same test fixture\n"
+          << "class.  However, in test case "
+          << this_test_info->test_case_name() << ",\n"
+          << "you defined test " << first_test_name
+          << " and test " << this_test_name << "\n"
+          << "using two different test fixture classes.  This can happen if\n"
+          << "the two classes are from different namespaces or translation\n"
+          << "units and have the same name.  You should probably rename one\n"
+          << "of the classes to put the tests into different test cases.";
+    }
+    return false;
+  }
+
+  return true;
+}
+
+#if GTEST_HAS_SEH
+
+// Adds an "exception thrown" fatal failure to the current test.  This
+// function returns its result via an output parameter pointer because VC++
+// prohibits creation of objects with destructors on stack in functions
+// using __try (see error C2712).
+static std::string* FormatSehExceptionMessage(DWORD exception_code,
+                                              const char* location) {
+  Message message;
+  message << "SEH exception with code 0x" << std::setbase(16) <<
+    exception_code << std::setbase(10) << " thrown in " << location << ".";
+
+  return new std::string(message.GetString());
+}
+
+#endif  // GTEST_HAS_SEH
+
+namespace internal {
+
+#if GTEST_HAS_EXCEPTIONS
+
+// Adds an "exception thrown" fatal failure to the current test.
+static std::string FormatCxxExceptionMessage(const char* description,
+                                             const char* location) {
+  Message message;
+  if (description != NULL) {
+    message << "C++ exception with description \"" << description << "\"";
+  } else {
+    message << "Unknown C++ exception";
+  }
+  message << " thrown in " << location << ".";
+
+  return message.GetString();
+}
+
+static std::string PrintTestPartResultToString(
+    const TestPartResult& test_part_result);
+
+GoogleTestFailureException::GoogleTestFailureException(
+    const TestPartResult& failure)
+    : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}
+
+#endif  // GTEST_HAS_EXCEPTIONS
+
+// We put these helper functions in the internal namespace as IBM's xlC
+// compiler rejects the code if they were declared static.
+
+// Runs the given method and handles SEH exceptions it throws, when
+// SEH is supported; returns the 0-value for type Result in case of an
+// SEH exception.  (Microsoft compilers cannot handle SEH and C++
+// exceptions in the same function.  Therefore, we provide a separate
+// wrapper function for handling SEH exceptions.)
+template <class T, typename Result>
+Result HandleSehExceptionsInMethodIfSupported(
+    T* object, Result (T::*method)(), const char* location) {
+#if GTEST_HAS_SEH
+  __try {
+    return (object->*method)();
+  } __except (internal::UnitTestOptions::GTestShouldProcessSEH(  // NOLINT
+      GetExceptionCode())) {
+    // We create the exception message on the heap because VC++ prohibits
+    // creation of objects with destructors on stack in functions using __try
+    // (see error C2712).
+    std::string* exception_message = FormatSehExceptionMessage(
+        GetExceptionCode(), location);
+    internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
+                                             *exception_message);
+    delete exception_message;
+    return static_cast<Result>(0);
+  }
+#else
+  (void)location;
+  return (object->*method)();
+#endif  // GTEST_HAS_SEH
+}
+
+// Runs the given method and catches and reports C++ and/or SEH-style
+// exceptions, if they are supported; returns the 0-value for type
+// Result in case of an SEH exception.
+template <class T, typename Result>
+Result HandleExceptionsInMethodIfSupported(
+    T* object, Result (T::*method)(), const char* location) {
+  // NOTE: The user code can affect the way in which Google Test handles
+  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
+  // RUN_ALL_TESTS() starts. It is technically possible to check the flag
+  // after the exception is caught and either report or re-throw the
+  // exception based on the flag's value:
+  //
+  // try {
+  //   // Perform the test method.
+  // } catch (...) {
+  //   if (GTEST_FLAG(catch_exceptions))
+  //     // Report the exception as failure.
+  //   else
+  //     throw;  // Re-throws the original exception.
+  // }
+  //
+  // However, the purpose of this flag is to allow the program to drop into
+  // the debugger when the exception is thrown. On most platforms, once the
+  // control enters the catch block, the exception origin information is
+  // lost and the debugger will stop the program at the point of the
+  // re-throw in this function -- instead of at the point of the original
+  // throw statement in the code under test.  For this reason, we perform
+  // the check early, sacrificing the ability to affect Google Test's
+  // exception handling in the method where the exception is thrown.
+  if (internal::GetUnitTestImpl()->catch_exceptions()) {
+#if GTEST_HAS_EXCEPTIONS
+    try {
+      return HandleSehExceptionsInMethodIfSupported(object, method, location);
+    } catch (const internal::GoogleTestFailureException&) {  // NOLINT
+      // This exception type can only be thrown by a failed Google
+      // Test assertion with the intention of letting another testing
+      // framework catch it.  Therefore we just re-throw it.
+      throw;
+    } catch (const std::exception& e) {  // NOLINT
+      internal::ReportFailureInUnknownLocation(
+          TestPartResult::kFatalFailure,
+          FormatCxxExceptionMessage(e.what(), location));
+    } catch (...) {  // NOLINT
+      internal::ReportFailureInUnknownLocation(
+          TestPartResult::kFatalFailure,
+          FormatCxxExceptionMessage(NULL, location));
+    }
+    return static_cast<Result>(0);
+#else
+    return HandleSehExceptionsInMethodIfSupported(object, method, location);
+#endif  // GTEST_HAS_EXCEPTIONS
+  } else {
+    return (object->*method)();
+  }
+}
+
+}  // namespace internal
+
+// Runs the test and updates the test result.
+void Test::Run() {
+  if (!HasSameFixtureClass()) return;
+
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
+  // We will run the test only if SetUp() was successful.
+  if (!HasFatalFailure()) {
+    impl->os_stack_trace_getter()->UponLeavingGTest();
+    internal::HandleExceptionsInMethodIfSupported(
+        this, &Test::TestBody, "the test body");
+  }
+
+  // However, we want to clean up as much as possible.  Hence we will
+  // always call TearDown(), even if SetUp() or the test body has
+  // failed.
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      this, &Test::TearDown, "TearDown()");
+}
+
+// Returns true iff the current test has a fatal failure.
+bool Test::HasFatalFailure() {
+  return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
+}
+
+// Returns true iff the current test has a non-fatal failure.
+bool Test::HasNonfatalFailure() {
+  return internal::GetUnitTestImpl()->current_test_result()->
+      HasNonfatalFailure();
+}
+
+// class TestInfo
+
+// Constructs a TestInfo object. It assumes ownership of the test factory
+// object.
+TestInfo::TestInfo(const std::string& a_test_case_name,
+                   const std::string& a_name,
+                   const char* a_type_param,
+                   const char* a_value_param,
+                   internal::CodeLocation a_code_location,
+                   internal::TypeId fixture_class_id,
+                   internal::TestFactoryBase* factory)
+    : test_case_name_(a_test_case_name),
+      name_(a_name),
+      type_param_(a_type_param ? new std::string(a_type_param) : NULL),
+      value_param_(a_value_param ? new std::string(a_value_param) : NULL),
+      location_(a_code_location),
+      fixture_class_id_(fixture_class_id),
+      should_run_(false),
+      is_disabled_(false),
+      matches_filter_(false),
+      factory_(factory),
+      result_() {}
+
+// Destructs a TestInfo object.
+TestInfo::~TestInfo() { delete factory_; }
+
+namespace internal {
+
+// Creates a new TestInfo object and registers it with Google Test;
+// returns the created object.
+//
+// Arguments:
+//
+//   test_case_name:   name of the test case
+//   name:             name of the test
+//   type_param:       the name of the test's type parameter, or NULL if
+//                     this is not a typed or a type-parameterized test.
+//   value_param:      text representation of the test's value parameter,
+//                     or NULL if this is not a value-parameterized test.
+//   code_location:    code location where the test is defined
+//   fixture_class_id: ID of the test fixture class
+//   set_up_tc:        pointer to the function that sets up the test case
+//   tear_down_tc:     pointer to the function that tears down the test case
+//   factory:          pointer to the factory that creates a test object.
+//                     The newly created TestInfo instance will assume
+//                     ownership of the factory object.
+TestInfo* MakeAndRegisterTestInfo(
+    const char* test_case_name,
+    const char* name,
+    const char* type_param,
+    const char* value_param,
+    CodeLocation code_location,
+    TypeId fixture_class_id,
+    SetUpTestCaseFunc set_up_tc,
+    TearDownTestCaseFunc tear_down_tc,
+    TestFactoryBase* factory) {
+  TestInfo* const test_info =
+      new TestInfo(test_case_name, name, type_param, value_param,
+                   code_location, fixture_class_id, factory);
+  GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
+  return test_info;
+}
+
+#if GTEST_HAS_PARAM_TEST
+void ReportInvalidTestCaseType(const char* test_case_name,
+                               CodeLocation code_location) {
+  Message errors;
+  errors
+      << "Attempted redefinition of test case " << test_case_name << ".\n"
+      << "All tests in the same test case must use the same test fixture\n"
+      << "class.  However, in test case " << test_case_name << ", you tried\n"
+      << "to define a test using a fixture class different from the one\n"
+      << "used earlier. This can happen if the two fixture classes are\n"
+      << "from different namespaces and have the same name. You should\n"
+      << "probably rename one of the classes to put the tests into different\n"
+      << "test cases.";
+
+  fprintf(stderr, "%s %s",
+          FormatFileLocation(code_location.file.c_str(),
+                             code_location.line).c_str(),
+          errors.GetString().c_str());
+}
+#endif  // GTEST_HAS_PARAM_TEST
+
+}  // namespace internal
+
+namespace {
+
+// A predicate that checks the test name of a TestInfo against a known
+// value.
+//
+// This is used for implementation of the TestCase class only.  We put
+// it in the anonymous namespace to prevent polluting the outer
+// namespace.
+//
+// TestNameIs is copyable.
+class TestNameIs {
+ public:
+  // Constructor.
+  //
+  // TestNameIs has NO default constructor.
+  explicit TestNameIs(const char* name)
+      : name_(name) {}
+
+  // Returns true iff the test name of test_info matches name_.
+  bool operator()(const TestInfo * test_info) const {
+    return test_info && test_info->name() == name_;
+  }
+
+ private:
+  std::string name_;
+};
+
+}  // namespace
+
+namespace internal {
+
+// This method expands all parameterized tests registered with macros TEST_P
+// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
+// This will be done just once during the program runtime.
+void UnitTestImpl::RegisterParameterizedTests() {
+#if GTEST_HAS_PARAM_TEST
+  if (!parameterized_tests_registered_) {
+    parameterized_test_registry_.RegisterTests();
+    parameterized_tests_registered_ = true;
+  }
+#endif
+}
+
+}  // namespace internal
+
+// Creates the test object, runs it, records its result, and then
+// deletes it.
+void TestInfo::Run() {
+  if (!should_run_) return;
+
+  // Tells UnitTest where to store test result.
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  impl->set_current_test_info(this);
+
+  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
+
+  // Notifies the unit test event listeners that a test is about to start.
+  repeater->OnTestStart(*this);
+
+  const TimeInMillis start = internal::GetTimeInMillis();
+
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+
+  // Creates the test object.
+  Test* const test = internal::HandleExceptionsInMethodIfSupported(
+      factory_, &internal::TestFactoryBase::CreateTest,
+      "the test fixture's constructor");
+
+  // Runs the test only if the test object was created and its
+  // constructor didn't generate a fatal failure.
+  if ((test != NULL) && !Test::HasFatalFailure()) {
+    // This doesn't throw as all user code that can throw are wrapped into
+    // exception handling code.
+    test->Run();
+  }
+
+  // Deletes the test object.
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      test, &Test::DeleteSelf_, "the test fixture's destructor");
+
+  result_.set_elapsed_time(internal::GetTimeInMillis() - start);
+
+  // Notifies the unit test event listener that a test has just finished.
+  repeater->OnTestEnd(*this);
+
+  // Tells UnitTest to stop associating assertion results to this
+  // test.
+  impl->set_current_test_info(NULL);
+}
+
+// class TestCase
+
+// Gets the number of successful tests in this test case.
+int TestCase::successful_test_count() const {
+  return CountIf(test_info_list_, TestPassed);
+}
+
+// Gets the number of failed tests in this test case.
+int TestCase::failed_test_count() const {
+  return CountIf(test_info_list_, TestFailed);
+}
+
+// Gets the number of disabled tests that will be reported in the XML report.
+int TestCase::reportable_disabled_test_count() const {
+  return CountIf(test_info_list_, TestReportableDisabled);
+}
+
+// Gets the number of disabled tests in this test case.
+int TestCase::disabled_test_count() const {
+  return CountIf(test_info_list_, TestDisabled);
+}
+
+// Gets the number of tests to be printed in the XML report.
+int TestCase::reportable_test_count() const {
+  return CountIf(test_info_list_, TestReportable);
+}
+
+// Get the number of tests in this test case that should run.
+int TestCase::test_to_run_count() const {
+  return CountIf(test_info_list_, ShouldRunTest);
+}
+
+// Gets the number of all tests.
+int TestCase::total_test_count() const {
+  return static_cast<int>(test_info_list_.size());
+}
+
+// Creates a TestCase with the given name.
+//
+// Arguments:
+//
+//   name:         name of the test case
+//   a_type_param: the name of the test case's type parameter, or NULL if
+//                 this is not a typed or a type-parameterized test case.
+//   set_up_tc:    pointer to the function that sets up the test case
+//   tear_down_tc: pointer to the function that tears down the test case
+TestCase::TestCase(const char* a_name, const char* a_type_param,
+                   Test::SetUpTestCaseFunc set_up_tc,
+                   Test::TearDownTestCaseFunc tear_down_tc)
+    : name_(a_name),
+      type_param_(a_type_param ? new std::string(a_type_param) : NULL),
+      set_up_tc_(set_up_tc),
+      tear_down_tc_(tear_down_tc),
+      should_run_(false),
+      elapsed_time_(0) {
+}
+
+// Destructor of TestCase.
+TestCase::~TestCase() {
+  // Deletes every Test in the collection.
+  ForEach(test_info_list_, internal::Delete<TestInfo>);
+}
+
+// Returns the i-th test among all the tests. i can range from 0 to
+// total_test_count() - 1. If i is not in that range, returns NULL.
+const TestInfo* TestCase::GetTestInfo(int i) const {
+  const int index = GetElementOr(test_indices_, i, -1);
+  return index < 0 ? NULL : test_info_list_[index];
+}
+
+// Returns the i-th test among all the tests. i can range from 0 to
+// total_test_count() - 1. If i is not in that range, returns NULL.
+TestInfo* TestCase::GetMutableTestInfo(int i) {
+  const int index = GetElementOr(test_indices_, i, -1);
+  return index < 0 ? NULL : test_info_list_[index];
+}
+
+// Adds a test to this test case.  Will delete the test upon
+// destruction of the TestCase object.
+void TestCase::AddTestInfo(TestInfo * test_info) {
+  test_info_list_.push_back(test_info);
+  test_indices_.push_back(static_cast<int>(test_indices_.size()));
+}
+
+// Runs every test in this TestCase.
+void TestCase::Run() {
+  if (!should_run_) return;
+
+  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
+  impl->set_current_test_case(this);
+
+  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
+
+  repeater->OnTestCaseStart(*this);
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      this, &TestCase::RunSetUpTestCase, "SetUpTestCase()");
+
+  const internal::TimeInMillis start = internal::GetTimeInMillis();
+  for (int i = 0; i < total_test_count(); i++) {
+    GetMutableTestInfo(i)->Run();
+  }
+  elapsed_time_ = internal::GetTimeInMillis() - start;
+
+  impl->os_stack_trace_getter()->UponLeavingGTest();
+  internal::HandleExceptionsInMethodIfSupported(
+      this, &TestCase::RunTearDownTestCase, "TearDownTestCase()");
+
+  repeater->OnTestCaseEnd(*this);
+  impl->set_current_test_case(NULL);
+}
+
+// Clears the results of all tests in this test case.
+void TestCase::ClearResult() {
+  ad_hoc_test_result_.Clear();
+  ForEach(test_info_list_, TestInfo::ClearTestResult);
+}
+
+// Shuffles the tests in this test case.
+void TestCase::ShuffleTests(internal::Random* random) {
+  Shuffle(random, &test_indices_);
+}
+
+// Restores the test order to before the first shuffle.
+void TestCase::UnshuffleTests() {
+  for (size_t i = 0; i < test_indices_.size(); i++) {
+    test_indices_[i] = static_cast<int>(i);
+  }
+}
+
+// Formats a countable noun.  Depending on its quantity, either the
+// singular form or the plural form is used. e.g.
+//
+// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
+// FormatCountableNoun(5, "book", "books") returns "5 books".
+static std::string FormatCountableNoun(int count,
+                                       const char * singular_form,
+                                       const char * plural_form) {
+  return internal::StreamableToString(count) + " " +
+      (count == 1 ? singular_form : plural_form);
+}
+
+// Formats the count of tests.
+static std::string FormatTestCount(int test_count) {
+  return FormatCountableNoun(test_count, "test", "tests");
+}
+
+// Formats the count of test cases.
+static std::string FormatTestCaseCount(int test_case_count) {
+  return FormatCountableNoun(test_case_count, "test case", "test cases");
+}
+
+// Converts a TestPartResult::Type enum to human-friendly string
+// representation.  Both kNonFatalFailure and kFatalFailure are translated
+// to "Failure", as the user usually doesn't care about the difference
+// between the two when viewing the test result.
+static const char * TestPartResultTypeToString(TestPartResult::Type type) {
+  switch (type) {
+    case TestPartResult::kSuccess:
+      return "Success";
+
+    case TestPartResult::kNonFatalFailure:
+    case TestPartResult::kFatalFailure:
+#ifdef _MSC_VER
+      return "error: ";
+#else
+      return "Failure\n";
+#endif
+    default:
+      return "Unknown result type";
+  }
+}
+
+namespace internal {
+
+// Prints a TestPartResult to an std::string.
+static std::string PrintTestPartResultToString(
+    const TestPartResult& test_part_result) {
+  return (Message()
+          << internal::FormatFileLocation(test_part_result.file_name(),
+                                          test_part_result.line_number())
+          << " " << TestPartResultTypeToString(test_part_result.type())
+          << test_part_result.message()).GetString();
+}
+
+// Prints a TestPartResult.
+static void PrintTestPartResult(const TestPartResult& test_part_result) {
+  const std::string& result =
+      PrintTestPartResultToString(test_part_result);
+  printf("%s\n", result.c_str());
+  fflush(stdout);
+  // If the test program runs in Visual Studio or a debugger, the
+  // following statements add the test part result message to the Output
+  // window such that the user can double-click on it to jump to the
+  // corresponding source code location; otherwise they do nothing.
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+  // We don't call OutputDebugString*() on Windows Mobile, as printing
+  // to stdout is done by OutputDebugString() there already - we don't
+  // want the same message printed twice.
+  ::OutputDebugStringA(result.c_str());
+  ::OutputDebugStringA("\n");
+#endif
+}
+
+// class PrettyUnitTestResultPrinter
+
+enum GTestColor {
+  COLOR_DEFAULT,
+  COLOR_RED,
+  COLOR_GREEN,
+  COLOR_YELLOW
+};
+
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+// Returns the character attribute for the given color.
+WORD GetColorAttribute(GTestColor color) {
+  switch (color) {
+    case COLOR_RED:    return FOREGROUND_RED;
+    case COLOR_GREEN:  return FOREGROUND_GREEN;
+    case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN;
+    default:           return 0;
+  }
+}
+
+#else
+
+// Returns the ANSI color code for the given color.  COLOR_DEFAULT is
+// an invalid input.
+const char* GetAnsiColorCode(GTestColor color) {
+  switch (color) {
+    case COLOR_RED:     return "1";
+    case COLOR_GREEN:   return "2";
+    case COLOR_YELLOW:  return "3";
+    default:            return NULL;
+  };
+}
+
+#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+
+// Returns true iff Google Test should use colors in the output.
+bool ShouldUseColor(bool stdout_is_tty) {
+  const char* const gtest_color = GTEST_FLAG(color).c_str();
+
+  if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
+#if GTEST_OS_WINDOWS
+    // On Windows the TERM variable is usually not set, but the
+    // console there does support colors.
+    return stdout_is_tty;
+#else
+    // On non-Windows platforms, we rely on the TERM variable.
+    const char* const term = posix::GetEnv("TERM");
+    const bool term_supports_color =
+        String::CStringEquals(term, "xterm") ||
+        String::CStringEquals(term, "xterm-color") ||
+        String::CStringEquals(term, "xterm-256color") ||
+        String::CStringEquals(term, "screen") ||
+        String::CStringEquals(term, "screen-256color") ||
+        String::CStringEquals(term, "tmux") ||
+        String::CStringEquals(term, "tmux-256color") ||
+        String::CStringEquals(term, "rxvt-unicode") ||
+        String::CStringEquals(term, "rxvt-unicode-256color") ||
+        String::CStringEquals(term, "linux") ||
+        String::CStringEquals(term, "cygwin");
+    return stdout_is_tty && term_supports_color;
+#endif  // GTEST_OS_WINDOWS
+  }
+
+  return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
+      String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
+      String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
+      String::CStringEquals(gtest_color, "1");
+  // We take "yes", "true", "t", and "1" as meaning "yes".  If the
+  // value is neither one of these nor "auto", we treat it as "no" to
+  // be conservative.
+}
+
+// Helpers for printing colored strings to stdout. Note that on Windows, we
+// cannot simply emit special characters and have the terminal change colors.
+// This routine must actually emit the characters rather than return a string
+// that would be colored when printed, as can be done on Linux.
+void ColoredPrintf(GTestColor color, const char* fmt, ...) {
+  va_list args;
+  va_start(args, fmt);
+
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
+    GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+  const bool use_color = AlwaysFalse();
+#else
+  static const bool in_color_mode =
+      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
+  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);
+#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS
+  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.
+
+  if (!use_color) {
+    vprintf(fmt, args);
+    va_end(args);
+    return;
+  }
+
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
+
+  // Gets the current text color.
+  CONSOLE_SCREEN_BUFFER_INFO buffer_info;
+  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
+  const WORD old_color_attrs = buffer_info.wAttributes;
+
+  // We need to flush the stream buffers into the console before each
+  // SetConsoleTextAttribute call lest it affect the text that is already
+  // printed but has not yet reached the console.
+  fflush(stdout);
+  SetConsoleTextAttribute(stdout_handle,
+                          GetColorAttribute(color) | FOREGROUND_INTENSITY);
+  vprintf(fmt, args);
+
+  fflush(stdout);
+  // Restores the text color.
+  SetConsoleTextAttribute(stdout_handle, old_color_attrs);
+#else
+  printf("\033[0;3%sm", GetAnsiColorCode(color));
+  vprintf(fmt, args);
+  printf("\033[m");  // Resets the terminal to default.
+#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+  va_end(args);
+}
+
+// Text printed in Google Test's text output and --gunit_list_tests
+// output to label the type parameter and value parameter for a test.
+static const char kTypeParamLabel[] = "TypeParam";
+static const char kValueParamLabel[] = "GetParam()";
+
+void PrintFullTestCommentIfPresent(const TestInfo& test_info) {
+  const char* const type_param = test_info.type_param();
+  const char* const value_param = test_info.value_param();
+
+  if (type_param != NULL || value_param != NULL) {
+    printf(", where ");
+    if (type_param != NULL) {
+      printf("%s = %s", kTypeParamLabel, type_param);
+      if (value_param != NULL)
+        printf(" and ");
+    }
+    if (value_param != NULL) {
+      printf("%s = %s", kValueParamLabel, value_param);
+    }
+  }
+}
+
+// This class implements the TestEventListener interface.
+//
+// Class PrettyUnitTestResultPrinter is copyable.
+class PrettyUnitTestResultPrinter : public TestEventListener {
+ public:
+  PrettyUnitTestResultPrinter() {}
+  static void PrintTestName(const char * test_case, const char * test) {
+    printf("%s.%s", test_case, test);
+  }
+
+  // The following methods override what's in the TestEventListener class.
+  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestCaseStart(const TestCase& test_case);
+  virtual void OnTestStart(const TestInfo& test_info);
+  virtual void OnTestPartResult(const TestPartResult& result);
+  virtual void OnTestEnd(const TestInfo& test_info);
+  virtual void OnTestCaseEnd(const TestCase& test_case);
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}
+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}
+
+ private:
+  static void PrintFailedTests(const UnitTest& unit_test);
+};
+
+  // Fired before each iteration of tests starts.
+void PrettyUnitTestResultPrinter::OnTestIterationStart(
+    const UnitTest& unit_test, int iteration) {
+  if (GTEST_FLAG(repeat) != 1)
+    printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
+
+  const char* const filter = GTEST_FLAG(filter).c_str();
+
+  // Prints the filter if it's not *.  This reminds the user that some
+  // tests may be skipped.
+  if (!String::CStringEquals(filter, kUniversalFilter)) {
+    ColoredPrintf(COLOR_YELLOW,
+                  "Note: %s filter = %s\n", GTEST_NAME_, filter);
+  }
+
+  if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
+    const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
+    ColoredPrintf(COLOR_YELLOW,
+                  "Note: This is test shard %d of %s.\n",
+                  static_cast<int>(shard_index) + 1,
+                  internal::posix::GetEnv(kTestTotalShards));
+  }
+
+  if (GTEST_FLAG(shuffle)) {
+    ColoredPrintf(COLOR_YELLOW,
+                  "Note: Randomizing tests' orders with a seed of %d .\n",
+                  unit_test.random_seed());
+  }
+
+  ColoredPrintf(COLOR_GREEN,  "[==========] ");
+  printf("Running %s from %s.\n",
+         FormatTestCount(unit_test.test_to_run_count()).c_str(),
+         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(
+    const UnitTest& /*unit_test*/) {
+  ColoredPrintf(COLOR_GREEN,  "[----------] ");
+  printf("Global test environment set-up.\n");
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
+  const std::string counts =
+      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
+  ColoredPrintf(COLOR_GREEN, "[----------] ");
+  printf("%s from %s", counts.c_str(), test_case.name());
+  if (test_case.type_param() == NULL) {
+    printf("\n");
+  } else {
+    printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());
+  }
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
+  ColoredPrintf(COLOR_GREEN,  "[ RUN      ] ");
+  PrintTestName(test_info.test_case_name(), test_info.name());
+  printf("\n");
+  fflush(stdout);
+}
+
+// Called after an assertion failure.
+void PrettyUnitTestResultPrinter::OnTestPartResult(
+    const TestPartResult& result) {
+  // If the test part succeeded, we don't need to do anything.
+  if (result.type() == TestPartResult::kSuccess)
+    return;
+
+  // Print failure message from the assertion (e.g. expected this and got that).
+  PrintTestPartResult(result);
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
+  if (test_info.result()->Passed()) {
+    ColoredPrintf(COLOR_GREEN, "[       OK ] ");
+  } else {
+    ColoredPrintf(COLOR_RED, "[  FAILED  ] ");
+  }
+  PrintTestName(test_info.test_case_name(), test_info.name());
+  if (test_info.result()->Failed())
+    PrintFullTestCommentIfPresent(test_info);
+
+  if (GTEST_FLAG(print_time)) {
+    printf(" (%s ms)\n", internal::StreamableToString(
+           test_info.result()->elapsed_time()).c_str());
+  } else {
+    printf("\n");
+  }
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
+  if (!GTEST_FLAG(print_time)) return;
+
+  const std::string counts =
+      FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
+  ColoredPrintf(COLOR_GREEN, "[----------] ");
+  printf("%s from %s (%s ms total)\n\n",
+         counts.c_str(), test_case.name(),
+         internal::StreamableToString(test_case.elapsed_time()).c_str());
+  fflush(stdout);
+}
+
+void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
+    const UnitTest& /*unit_test*/) {
+  ColoredPrintf(COLOR_GREEN,  "[----------] ");
+  printf("Global test environment tear-down\n");
+  fflush(stdout);
+}
+
+// Internal helper for printing the list of failed tests.
+void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
+  const int failed_test_count = unit_test.failed_test_count();
+  if (failed_test_count == 0) {
+    return;
+  }
+
+  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
+    const TestCase& test_case = *unit_test.GetTestCase(i);
+    if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {
+      continue;
+    }
+    for (int j = 0; j < test_case.total_test_count(); ++j) {
+      const TestInfo& test_info = *test_case.GetTestInfo(j);
+      if (!test_info.should_run() || test_info.result()->Passed()) {
+        continue;
+      }
+      ColoredPrintf(COLOR_RED, "[  FAILED  ] ");
+      printf("%s.%s", test_case.name(), test_info.name());
+      PrintFullTestCommentIfPresent(test_info);
+      printf("\n");
+    }
+  }
+}
+
+void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
+                                                     int /*iteration*/) {
+  ColoredPrintf(COLOR_GREEN,  "[==========] ");
+  printf("%s from %s ran.",
+         FormatTestCount(unit_test.test_to_run_count()).c_str(),
+         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());
+  if (GTEST_FLAG(print_time)) {
+    printf(" (%s ms total)",
+           internal::StreamableToString(unit_test.elapsed_time()).c_str());
+  }
+  printf("\n");
+  ColoredPrintf(COLOR_GREEN,  "[  PASSED  ] ");
+  printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
+
+  int num_failures = unit_test.failed_test_count();
+  if (!unit_test.Passed()) {
+    const int failed_test_count = unit_test.failed_test_count();
+    ColoredPrintf(COLOR_RED,  "[  FAILED  ] ");
+    printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
+    PrintFailedTests(unit_test);
+    printf("\n%2d FAILED %s\n", num_failures,
+                        num_failures == 1 ? "TEST" : "TESTS");
+  }
+
+  int num_disabled = unit_test.reportable_disabled_test_count();
+  if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {
+    if (!num_failures) {
+      printf("\n");  // Add a spacer if no FAILURE banner is displayed.
+    }
+    ColoredPrintf(COLOR_YELLOW,
+                  "  YOU HAVE %d DISABLED %s\n\n",
+                  num_disabled,
+                  num_disabled == 1 ? "TEST" : "TESTS");
+  }
+  // Ensure that Google Test output is printed before, e.g., heapchecker output.
+  fflush(stdout);
+}
+
+// End PrettyUnitTestResultPrinter
+
+// class TestEventRepeater
+//
+// This class forwards events to other event listeners.
+class TestEventRepeater : public TestEventListener {
+ public:
+  TestEventRepeater() : forwarding_enabled_(true) {}
+  virtual ~TestEventRepeater();
+  void Append(TestEventListener *listener);
+  TestEventListener* Release(TestEventListener* listener);
+
+  // Controls whether events will be forwarded to listeners_. Set to false
+  // in death test child processes.
+  bool forwarding_enabled() const { return forwarding_enabled_; }
+  void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
+
+  virtual void OnTestProgramStart(const UnitTest& unit_test);
+  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);
+  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);
+  virtual void OnTestCaseStart(const TestCase& test_case);
+  virtual void OnTestStart(const TestInfo& test_info);
+  virtual void OnTestPartResult(const TestPartResult& result);
+  virtual void OnTestEnd(const TestInfo& test_info);
+  virtual void OnTestCaseEnd(const TestCase& test_case);
+  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);
+  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);
+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+  virtual void OnTestProgramEnd(const UnitTest& unit_test);
+
+ private:
+  // Controls whether events will be forwarded to listeners_. Set to false
+  // in death test child processes.
+  bool forwarding_enabled_;
+  // The list of listeners that receive events.
+  std::vector<TestEventListener*> listeners_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);
+};
+
+TestEventRepeater::~TestEventRepeater() {
+  ForEach(listeners_, Delete<TestEventListener>);
+}
+
+void TestEventRepeater::Append(TestEventListener *listener) {
+  listeners_.push_back(listener);
+}
+
+// TODO(vladl@google.com): Factor the search functionality into Vector::Find.
+TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
+  for (size_t i = 0; i < listeners_.size(); ++i) {
+    if (listeners_[i] == listener) {
+      listeners_.erase(listeners_.begin() + i);
+      return listener;
+    }
+  }
+
+  return NULL;
+}
+
+// Since most methods are very similar, use macros to reduce boilerplate.
+// This defines a member that forwards the call to all listeners.
+#define GTEST_REPEATER_METHOD_(Name, Type) \
+void TestEventRepeater::Name(const Type& parameter) { \
+  if (forwarding_enabled_) { \
+    for (size_t i = 0; i < listeners_.size(); i++) { \
+      listeners_[i]->Name(parameter); \
+    } \
+  } \
+}
+// This defines a member that forwards the call to all listeners in reverse
+// order.
+#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
+void TestEventRepeater::Name(const Type& parameter) { \
+  if (forwarding_enabled_) { \
+    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \
+      listeners_[i]->Name(parameter); \
+    } \
+  } \
+}
+
+GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)
+GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)
+GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)
+GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)
+GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)
+GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)
+GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)
+GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)
+GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)
+GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)
+GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)
+
+#undef GTEST_REPEATER_METHOD_
+#undef GTEST_REVERSE_REPEATER_METHOD_
+
+void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,
+                                             int iteration) {
+  if (forwarding_enabled_) {
+    for (size_t i = 0; i < listeners_.size(); i++) {
+      listeners_[i]->OnTestIterationStart(unit_test, iteration);
+    }
+  }
+}
+
+void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,
+                                           int iteration) {
+  if (forwarding_enabled_) {
+    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {
+      listeners_[i]->OnTestIterationEnd(unit_test, iteration);
+    }
+  }
+}
+
+// End TestEventRepeater
+
+// This class generates an XML output file.
+class XmlUnitTestResultPrinter : public EmptyTestEventListener {
+ public:
+  explicit XmlUnitTestResultPrinter(const char* output_file);
+
+  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);
+
+ private:
+  // Is c a whitespace character that is normalized to a space character
+  // when it appears in an XML attribute value?
+  static bool IsNormalizableWhitespace(char c) {
+    return c == 0x9 || c == 0xA || c == 0xD;
+  }
+
+  // May c appear in a well-formed XML document?
+  static bool IsValidXmlCharacter(char c) {
+    return IsNormalizableWhitespace(c) || c >= 0x20;
+  }
+
+  // Returns an XML-escaped copy of the input string str.  If
+  // is_attribute is true, the text is meant to appear as an attribute
+  // value, and normalizable whitespace is preserved by replacing it
+  // with character references.
+  static std::string EscapeXml(const std::string& str, bool is_attribute);
+
+  // Returns the given string with all characters invalid in XML removed.
+  static std::string RemoveInvalidXmlCharacters(const std::string& str);
+
+  // Convenience wrapper around EscapeXml when str is an attribute value.
+  static std::string EscapeXmlAttribute(const std::string& str) {
+    return EscapeXml(str, true);
+  }
+
+  // Convenience wrapper around EscapeXml when str is not an attribute value.
+  static std::string EscapeXmlText(const char* str) {
+    return EscapeXml(str, false);
+  }
+
+  // Verifies that the given attribute belongs to the given element and
+  // streams the attribute as XML.
+  static void OutputXmlAttribute(std::ostream* stream,
+                                 const std::string& element_name,
+                                 const std::string& name,
+                                 const std::string& value);
+
+  // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
+  static void OutputXmlCDataSection(::std::ostream* stream, const char* data);
+
+  // Streams an XML representation of a TestInfo object.
+  static void OutputXmlTestInfo(::std::ostream* stream,
+                                const char* test_case_name,
+                                const TestInfo& test_info);
+
+  // Prints an XML representation of a TestCase object
+  static void PrintXmlTestCase(::std::ostream* stream,
+                               const TestCase& test_case);
+
+  // Prints an XML summary of unit_test to output stream out.
+  static void PrintXmlUnitTest(::std::ostream* stream,
+                               const UnitTest& unit_test);
+
+  // Produces a string representing the test properties in a result as space
+  // delimited XML attributes based on the property key="value" pairs.
+  // When the std::string is not empty, it includes a space at the beginning,
+  // to delimit this attribute from prior attributes.
+  static std::string TestPropertiesAsXmlAttributes(const TestResult& result);
+
+  // The output file.
+  const std::string output_file_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);
+};
+
+// Creates a new XmlUnitTestResultPrinter.
+XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
+    : output_file_(output_file) {
+  if (output_file_.c_str() == NULL || output_file_.empty()) {
+    fprintf(stderr, "XML output file may not be null\n");
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+}
+
+// Called after the unit test ends.
+void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
+                                                  int /*iteration*/) {
+  FILE* xmlout = NULL;
+  FilePath output_file(output_file_);
+  FilePath output_dir(output_file.RemoveFileName());
+
+  if (output_dir.CreateDirectoriesRecursively()) {
+    xmlout = posix::FOpen(output_file_.c_str(), "w");
+  }
+  if (xmlout == NULL) {
+    // TODO(wan): report the reason of the failure.
+    //
+    // We don't do it for now as:
+    //
+    //   1. There is no urgent need for it.
+    //   2. It's a bit involved to make the errno variable thread-safe on
+    //      all three operating systems (Linux, Windows, and Mac OS).
+    //   3. To interpret the meaning of errno in a thread-safe way,
+    //      we need the strerror_r() function, which is not available on
+    //      Windows.
+    fprintf(stderr,
+            "Unable to open file \"%s\"\n",
+            output_file_.c_str());
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+  std::stringstream stream;
+  PrintXmlUnitTest(&stream, unit_test);
+  fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
+  fclose(xmlout);
+}
+
+// Returns an XML-escaped copy of the input string str.  If is_attribute
+// is true, the text is meant to appear as an attribute value, and
+// normalizable whitespace is preserved by replacing it with character
+// references.
+//
+// Invalid XML characters in str, if any, are stripped from the output.
+// It is expected that most, if not all, of the text processed by this
+// module will consist of ordinary English text.
+// If this module is ever modified to produce version 1.1 XML output,
+// most invalid characters can be retained using character references.
+// TODO(wan): It might be nice to have a minimally invasive, human-readable
+// escaping scheme for invalid characters, rather than dropping them.
+std::string XmlUnitTestResultPrinter::EscapeXml(
+    const std::string& str, bool is_attribute) {
+  Message m;
+
+  for (size_t i = 0; i < str.size(); ++i) {
+    const char ch = str[i];
+    switch (ch) {
+      case '<':
+        m << "&lt;";
+        break;
+      case '>':
+        m << "&gt;";
+        break;
+      case '&':
+        m << "&amp;";
+        break;
+      case '\'':
+        if (is_attribute)
+          m << "&apos;";
+        else
+          m << '\'';
+        break;
+      case '"':
+        if (is_attribute)
+          m << "&quot;";
+        else
+          m << '"';
+        break;
+      default:
+        if (IsValidXmlCharacter(ch)) {
+          if (is_attribute && IsNormalizableWhitespace(ch))
+            m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
+              << ";";
+          else
+            m << ch;
+        }
+        break;
+    }
+  }
+
+  return m.GetString();
+}
+
+// Returns the given string with all characters invalid in XML removed.
+// Currently invalid characters are dropped from the string. An
+// alternative is to replace them with certain characters such as . or ?.
+std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
+    const std::string& str) {
+  std::string output;
+  output.reserve(str.size());
+  for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
+    if (IsValidXmlCharacter(*it))
+      output.push_back(*it);
+
+  return output;
+}
+
+// The following routines generate an XML representation of a UnitTest
+// object.
+//
+// This is how Google Test concepts map to the DTD:
+//
+// <testsuites name="AllTests">        <-- corresponds to a UnitTest object
+//   <testsuite name="testcase-name">  <-- corresponds to a TestCase object
+//     <testcase name="test-name">     <-- corresponds to a TestInfo object
+//       <failure message="...">...</failure>
+//       <failure message="...">...</failure>
+//       <failure message="...">...</failure>
+//                                     <-- individual assertion failures
+//     </testcase>
+//   </testsuite>
+// </testsuites>
+
+// Formats the given time in milliseconds as seconds.
+std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
+  ::std::stringstream ss;
+  ss << (static_cast<double>(ms) * 1e-3);
+  return ss.str();
+}
+
+static bool PortableLocaltime(time_t seconds, struct tm* out) {
+#if defined(_MSC_VER)
+  return localtime_s(out, &seconds) == 0;
+#elif defined(__MINGW32__) || defined(__MINGW64__)
+  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
+  // Windows' localtime(), which has a thread-local tm buffer.
+  struct tm* tm_ptr = localtime(&seconds);  // NOLINT
+  if (tm_ptr == NULL)
+    return false;
+  *out = *tm_ptr;
+  return true;
+#else
+  return localtime_r(&seconds, out) != NULL;
+#endif
+}
+
+// Converts the given epoch time in milliseconds to a date string in the ISO
+// 8601 format, without the timezone information.
+std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
+  struct tm time_struct;
+  if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
+    return "";
+  // YYYY-MM-DDThh:mm:ss
+  return StreamableToString(time_struct.tm_year + 1900) + "-" +
+      String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
+      String::FormatIntWidth2(time_struct.tm_mday) + "T" +
+      String::FormatIntWidth2(time_struct.tm_hour) + ":" +
+      String::FormatIntWidth2(time_struct.tm_min) + ":" +
+      String::FormatIntWidth2(time_struct.tm_sec);
+}
+
+// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
+void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,
+                                                     const char* data) {
+  const char* segment = data;
+  *stream << "<![CDATA[";
+  for (;;) {
+    const char* const next_segment = strstr(segment, "]]>");
+    if (next_segment != NULL) {
+      stream->write(
+          segment, static_cast<std::streamsize>(next_segment - segment));
+      *stream << "]]>]]&gt;<![CDATA[";
+      segment = next_segment + strlen("]]>");
+    } else {
+      *stream << segment;
+      break;
+    }
+  }
+  *stream << "]]>";
+}
+
+void XmlUnitTestResultPrinter::OutputXmlAttribute(
+    std::ostream* stream,
+    const std::string& element_name,
+    const std::string& name,
+    const std::string& value) {
+  const std::vector<std::string>& allowed_names =
+      GetReservedAttributesForElement(element_name);
+
+  GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
+                   allowed_names.end())
+      << "Attribute " << name << " is not allowed for element <" << element_name
+      << ">.";
+
+  *stream << " " << name << "=\"" << EscapeXmlAttribute(value) << "\"";
+}
+
+// Prints an XML representation of a TestInfo object.
+// TODO(wan): There is also value in printing properties with the plain printer.
+void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
+                                                 const char* test_case_name,
+                                                 const TestInfo& test_info) {
+  const TestResult& result = *test_info.result();
+  const std::string kTestcase = "testcase";
+
+  *stream << "    <testcase";
+  OutputXmlAttribute(stream, kTestcase, "name", test_info.name());
+
+  if (test_info.value_param() != NULL) {
+    OutputXmlAttribute(stream, kTestcase, "value_param",
+                       test_info.value_param());
+  }
+  if (test_info.type_param() != NULL) {
+    OutputXmlAttribute(stream, kTestcase, "type_param", test_info.type_param());
+  }
+
+  OutputXmlAttribute(stream, kTestcase, "status",
+                     test_info.should_run() ? "run" : "notrun");
+  OutputXmlAttribute(stream, kTestcase, "time",
+                     FormatTimeInMillisAsSeconds(result.elapsed_time()));
+  OutputXmlAttribute(stream, kTestcase, "classname", test_case_name);
+  *stream << TestPropertiesAsXmlAttributes(result);
+
+  int failures = 0;
+  for (int i = 0; i < result.total_part_count(); ++i) {
+    const TestPartResult& part = result.GetTestPartResult(i);
+    if (part.failed()) {
+      if (++failures == 1) {
+        *stream << ">\n";
+      }
+      const string location = internal::FormatCompilerIndependentFileLocation(
+          part.file_name(), part.line_number());
+      const string summary = location + "\n" + part.summary();
+      *stream << "      <failure message=\""
+              << EscapeXmlAttribute(summary.c_str())
+              << "\" type=\"\">";
+      const string detail = location + "\n" + part.message();
+      OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
+      *stream << "</failure>\n";
+    }
+  }
+
+  if (failures == 0)
+    *stream << " />\n";
+  else
+    *stream << "    </testcase>\n";
+}
+
+// Prints an XML representation of a TestCase object
+void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,
+                                                const TestCase& test_case) {
+  const std::string kTestsuite = "testsuite";
+  *stream << "  <" << kTestsuite;
+  OutputXmlAttribute(stream, kTestsuite, "name", test_case.name());
+  OutputXmlAttribute(stream, kTestsuite, "tests",
+                     StreamableToString(test_case.reportable_test_count()));
+  OutputXmlAttribute(stream, kTestsuite, "failures",
+                     StreamableToString(test_case.failed_test_count()));
+  OutputXmlAttribute(
+      stream, kTestsuite, "disabled",
+      StreamableToString(test_case.reportable_disabled_test_count()));
+  OutputXmlAttribute(stream, kTestsuite, "errors", "0");
+  OutputXmlAttribute(stream, kTestsuite, "time",
+                     FormatTimeInMillisAsSeconds(test_case.elapsed_time()));
+  *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result())
+          << ">\n";
+
+  for (int i = 0; i < test_case.total_test_count(); ++i) {
+    if (test_case.GetTestInfo(i)->is_reportable())
+      OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));
+  }
+  *stream << "  </" << kTestsuite << ">\n";
+}
+
+// Prints an XML summary of unit_test to output stream out.
+void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,
+                                                const UnitTest& unit_test) {
+  const std::string kTestsuites = "testsuites";
+
+  *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+  *stream << "<" << kTestsuites;
+
+  OutputXmlAttribute(stream, kTestsuites, "tests",
+                     StreamableToString(unit_test.reportable_test_count()));
+  OutputXmlAttribute(stream, kTestsuites, "failures",
+                     StreamableToString(unit_test.failed_test_count()));
+  OutputXmlAttribute(
+      stream, kTestsuites, "disabled",
+      StreamableToString(unit_test.reportable_disabled_test_count()));
+  OutputXmlAttribute(stream, kTestsuites, "errors", "0");
+  OutputXmlAttribute(
+      stream, kTestsuites, "timestamp",
+      FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()));
+  OutputXmlAttribute(stream, kTestsuites, "time",
+                     FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));
+
+  if (GTEST_FLAG(shuffle)) {
+    OutputXmlAttribute(stream, kTestsuites, "random_seed",
+                       StreamableToString(unit_test.random_seed()));
+  }
+
+  *stream << TestPropertiesAsXmlAttributes(unit_test.ad_hoc_test_result());
+
+  OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
+  *stream << ">\n";
+
+  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {
+    if (unit_test.GetTestCase(i)->reportable_test_count() > 0)
+      PrintXmlTestCase(stream, *unit_test.GetTestCase(i));
+  }
+  *stream << "</" << kTestsuites << ">\n";
+}
+
+// Produces a string representing the test properties in a result as space
+// delimited XML attributes based on the property key="value" pairs.
+std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(
+    const TestResult& result) {
+  Message attributes;
+  for (int i = 0; i < result.test_property_count(); ++i) {
+    const TestProperty& property = result.GetTestProperty(i);
+    attributes << " " << property.key() << "="
+        << "\"" << EscapeXmlAttribute(property.value()) << "\"";
+  }
+  return attributes.GetString();
+}
+
+// End XmlUnitTestResultPrinter
+
+#if GTEST_CAN_STREAM_RESULTS_
+
+// Checks if str contains '=', '&', '%' or '\n' characters. If yes,
+// replaces them by "%xx" where xx is their hexadecimal value. For
+// example, replaces "=" with "%3D".  This algorithm is O(strlen(str))
+// in both time and space -- important as the input str may contain an
+// arbitrarily long test failure message and stack trace.
+string StreamingListener::UrlEncode(const char* str) {
+  string result;
+  result.reserve(strlen(str) + 1);
+  for (char ch = *str; ch != '\0'; ch = *++str) {
+    switch (ch) {
+      case '%':
+      case '=':
+      case '&':
+      case '\n':
+        result.append("%" + String::FormatByte(static_cast<unsigned char>(ch)));
+        break;
+      default:
+        result.push_back(ch);
+        break;
+    }
+  }
+  return result;
+}
+
+void StreamingListener::SocketWriter::MakeConnection() {
+  GTEST_CHECK_(sockfd_ == -1)
+      << "MakeConnection() can't be called when there is already a connection.";
+
+  addrinfo hints;
+  memset(&hints, 0, sizeof(hints));
+  hints.ai_family = AF_UNSPEC;    // To allow both IPv4 and IPv6 addresses.
+  hints.ai_socktype = SOCK_STREAM;
+  addrinfo* servinfo = NULL;
+
+  // Use the getaddrinfo() to get a linked list of IP addresses for
+  // the given host name.
+  const int error_num = getaddrinfo(
+      host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);
+  if (error_num != 0) {
+    GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: "
+                        << gai_strerror(error_num);
+  }
+
+  // Loop through all the results and connect to the first we can.
+  for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;
+       cur_addr = cur_addr->ai_next) {
+    sockfd_ = socket(
+        cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);
+    if (sockfd_ != -1) {
+      // Connect the client socket to the server socket.
+      if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {
+        close(sockfd_);
+        sockfd_ = -1;
+      }
+    }
+  }
+
+  freeaddrinfo(servinfo);  // all done with this structure
+
+  if (sockfd_ == -1) {
+    GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to "
+                        << host_name_ << ":" << port_num_;
+  }
+}
+
+// End of class Streaming Listener
+#endif  // GTEST_CAN_STREAM_RESULTS__
+
+// Class ScopedTrace
+
+// Pushes the given source file location and message onto a per-thread
+// trace stack maintained by Google Test.
+ScopedTrace::ScopedTrace(const char* file, int line, const Message& message)
+    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
+  TraceInfo trace;
+  trace.file = file;
+  trace.line = line;
+  trace.message = message.GetString();
+
+  UnitTest::GetInstance()->PushGTestTrace(trace);
+}
+
+// Pops the info pushed by the c'tor.
+ScopedTrace::~ScopedTrace()
+    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
+  UnitTest::GetInstance()->PopGTestTrace();
+}
+
+
+// class OsStackTraceGetter
+
+const char* const OsStackTraceGetterInterface::kElidedFramesMarker =
+    "... " GTEST_NAME_ " internal frames ...";
+
+string OsStackTraceGetter::CurrentStackTrace(int /*max_depth*/,
+                                             int /*skip_count*/) {
+  return "";
+}
+
+void OsStackTraceGetter::UponLeavingGTest() {}
+
+// A helper class that creates the premature-exit file in its
+// constructor and deletes the file in its destructor.
+class ScopedPrematureExitFile {
+ public:
+  explicit ScopedPrematureExitFile(const char* premature_exit_filepath)
+      : premature_exit_filepath_(premature_exit_filepath) {
+    // If a path to the premature-exit file is specified...
+    if (premature_exit_filepath != NULL && *premature_exit_filepath != '\0') {
+      // create the file with a single "0" character in it.  I/O
+      // errors are ignored as there's nothing better we can do and we
+      // don't want to fail the test because of this.
+      FILE* pfile = posix::FOpen(premature_exit_filepath, "w");
+      fwrite("0", 1, 1, pfile);
+      fclose(pfile);
+    }
+  }
+
+  ~ScopedPrematureExitFile() {
+    if (premature_exit_filepath_ != NULL && *premature_exit_filepath_ != '\0') {
+      remove(premature_exit_filepath_);
+    }
+  }
+
+ private:
+  const char* const premature_exit_filepath_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile);
+};
+
+}  // namespace internal
+
+// class TestEventListeners
+
+TestEventListeners::TestEventListeners()
+    : repeater_(new internal::TestEventRepeater()),
+      default_result_printer_(NULL),
+      default_xml_generator_(NULL) {
+}
+
+TestEventListeners::~TestEventListeners() { delete repeater_; }
+
+// Returns the standard listener responsible for the default console
+// output.  Can be removed from the listeners list to shut down default
+// console output.  Note that removing this object from the listener list
+// with Release transfers its ownership to the user.
+void TestEventListeners::Append(TestEventListener* listener) {
+  repeater_->Append(listener);
+}
+
+// Removes the given event listener from the list and returns it.  It then
+// becomes the caller's responsibility to delete the listener. Returns
+// NULL if the listener is not found in the list.
+TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
+  if (listener == default_result_printer_)
+    default_result_printer_ = NULL;
+  else if (listener == default_xml_generator_)
+    default_xml_generator_ = NULL;
+  return repeater_->Release(listener);
+}
+
+// Returns repeater that broadcasts the TestEventListener events to all
+// subscribers.
+TestEventListener* TestEventListeners::repeater() { return repeater_; }
+
+// Sets the default_result_printer attribute to the provided listener.
+// The listener is also added to the listener list and previous
+// default_result_printer is removed from it and deleted. The listener can
+// also be NULL in which case it will not be added to the list. Does
+// nothing if the previous and the current listener objects are the same.
+void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {
+  if (default_result_printer_ != listener) {
+    // It is an error to pass this method a listener that is already in the
+    // list.
+    delete Release(default_result_printer_);
+    default_result_printer_ = listener;
+    if (listener != NULL)
+      Append(listener);
+  }
+}
+
+// Sets the default_xml_generator attribute to the provided listener.  The
+// listener is also added to the listener list and previous
+// default_xml_generator is removed from it and deleted. The listener can
+// also be NULL in which case it will not be added to the list. Does
+// nothing if the previous and the current listener objects are the same.
+void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {
+  if (default_xml_generator_ != listener) {
+    // It is an error to pass this method a listener that is already in the
+    // list.
+    delete Release(default_xml_generator_);
+    default_xml_generator_ = listener;
+    if (listener != NULL)
+      Append(listener);
+  }
+}
+
+// Controls whether events will be forwarded by the repeater to the
+// listeners in the list.
+bool TestEventListeners::EventForwardingEnabled() const {
+  return repeater_->forwarding_enabled();
+}
+
+void TestEventListeners::SuppressEventForwarding() {
+  repeater_->set_forwarding_enabled(false);
+}
+
+// class UnitTest
+
+// Gets the singleton UnitTest object.  The first time this method is
+// called, a UnitTest object is constructed and returned.  Consecutive
+// calls will return the same object.
+//
+// We don't protect this under mutex_ as a user is not supposed to
+// call this before main() starts, from which point on the return
+// value will never change.
+UnitTest* UnitTest::GetInstance() {
+  // When compiled with MSVC 7.1 in optimized mode, destroying the
+  // UnitTest object upon exiting the program messes up the exit code,
+  // causing successful tests to appear failed.  We have to use a
+  // different implementation in this case to bypass the compiler bug.
+  // This implementation makes the compiler happy, at the cost of
+  // leaking the UnitTest object.
+
+  // CodeGear C++Builder insists on a public destructor for the
+  // default implementation.  Use this implementation to keep good OO
+  // design with private destructor.
+
+#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
+  static UnitTest* const instance = new UnitTest;
+  return instance;
+#else
+  static UnitTest instance;
+  return &instance;
+#endif  // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)
+}
+
+// Gets the number of successful test cases.
+int UnitTest::successful_test_case_count() const {
+  return impl()->successful_test_case_count();
+}
+
+// Gets the number of failed test cases.
+int UnitTest::failed_test_case_count() const {
+  return impl()->failed_test_case_count();
+}
+
+// Gets the number of all test cases.
+int UnitTest::total_test_case_count() const {
+  return impl()->total_test_case_count();
+}
+
+// Gets the number of all test cases that contain at least one test
+// that should run.
+int UnitTest::test_case_to_run_count() const {
+  return impl()->test_case_to_run_count();
+}
+
+// Gets the number of successful tests.
+int UnitTest::successful_test_count() const {
+  return impl()->successful_test_count();
+}
+
+// Gets the number of failed tests.
+int UnitTest::failed_test_count() const { return impl()->failed_test_count(); }
+
+// Gets the number of disabled tests that will be reported in the XML report.
+int UnitTest::reportable_disabled_test_count() const {
+  return impl()->reportable_disabled_test_count();
+}
+
+// Gets the number of disabled tests.
+int UnitTest::disabled_test_count() const {
+  return impl()->disabled_test_count();
+}
+
+// Gets the number of tests to be printed in the XML report.
+int UnitTest::reportable_test_count() const {
+  return impl()->reportable_test_count();
+}
+
+// Gets the number of all tests.
+int UnitTest::total_test_count() const { return impl()->total_test_count(); }
+
+// Gets the number of tests that should run.
+int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }
+
+// Gets the time of the test program start, in ms from the start of the
+// UNIX epoch.
+internal::TimeInMillis UnitTest::start_timestamp() const {
+    return impl()->start_timestamp();
+}
+
+// Gets the elapsed time, in milliseconds.
+internal::TimeInMillis UnitTest::elapsed_time() const {
+  return impl()->elapsed_time();
+}
+
+// Returns true iff the unit test passed (i.e. all test cases passed).
+bool UnitTest::Passed() const { return impl()->Passed(); }
+
+// Returns true iff the unit test failed (i.e. some test case failed
+// or something outside of all tests failed).
+bool UnitTest::Failed() const { return impl()->Failed(); }
+
+// Gets the i-th test case among all the test cases. i can range from 0 to
+// total_test_case_count() - 1. If i is not in that range, returns NULL.
+const TestCase* UnitTest::GetTestCase(int i) const {
+  return impl()->GetTestCase(i);
+}
+
+// Returns the TestResult containing information on test failures and
+// properties logged outside of individual test cases.
+const TestResult& UnitTest::ad_hoc_test_result() const {
+  return *impl()->ad_hoc_test_result();
+}
+
+// Gets the i-th test case among all the test cases. i can range from 0 to
+// total_test_case_count() - 1. If i is not in that range, returns NULL.
+TestCase* UnitTest::GetMutableTestCase(int i) {
+  return impl()->GetMutableTestCase(i);
+}
+
+// Returns the list of event listeners that can be used to track events
+// inside Google Test.
+TestEventListeners& UnitTest::listeners() {
+  return *impl()->listeners();
+}
+
+// Registers and returns a global test environment.  When a test
+// program is run, all global test environments will be set-up in the
+// order they were registered.  After all tests in the program have
+// finished, all global test environments will be torn-down in the
+// *reverse* order they were registered.
+//
+// The UnitTest object takes ownership of the given environment.
+//
+// We don't protect this under mutex_, as we only support calling it
+// from the main thread.
+Environment* UnitTest::AddEnvironment(Environment* env) {
+  if (env == NULL) {
+    return NULL;
+  }
+
+  impl_->environments().push_back(env);
+  return env;
+}
+
+// Adds a TestPartResult to the current TestResult object.  All Google Test
+// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call
+// this to report their results.  The user code should use the
+// assertion macros instead of calling this directly.
+void UnitTest::AddTestPartResult(
+    TestPartResult::Type result_type,
+    const char* file_name,
+    int line_number,
+    const std::string& message,
+    const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
+  Message msg;
+  msg << message;
+
+  internal::MutexLock lock(&mutex_);
+  if (impl_->gtest_trace_stack().size() > 0) {
+    msg << "\n" << GTEST_NAME_ << " trace:";
+
+    for (int i = static_cast<int>(impl_->gtest_trace_stack().size());
+         i > 0; --i) {
+      const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
+      msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
+          << " " << trace.message;
+    }
+  }
+
+  if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {
+    msg << internal::kStackTraceMarker << os_stack_trace;
+  }
+
+  const TestPartResult result =
+    TestPartResult(result_type, file_name, line_number,
+                   msg.GetString().c_str());
+  impl_->GetTestPartResultReporterForCurrentThread()->
+      ReportTestPartResult(result);
+
+  if (result_type != TestPartResult::kSuccess) {
+    // gtest_break_on_failure takes precedence over
+    // gtest_throw_on_failure.  This allows a user to set the latter
+    // in the code (perhaps in order to use Google Test assertions
+    // with another testing framework) and specify the former on the
+    // command line for debugging.
+    if (GTEST_FLAG(break_on_failure)) {
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+      // Using DebugBreak on Windows allows gtest to still break into a debugger
+      // when a failure happens and both the --gtest_break_on_failure and
+      // the --gtest_catch_exceptions flags are specified.
+      DebugBreak();
+#else
+      // Dereference NULL through a volatile pointer to prevent the compiler
+      // from removing. We use this rather than abort() or __builtin_trap() for
+      // portability: Symbian doesn't implement abort() well, and some debuggers
+      // don't correctly trap abort().
+      *static_cast<volatile int*>(NULL) = 1;
+#endif  // GTEST_OS_WINDOWS
+    } else if (GTEST_FLAG(throw_on_failure)) {
+#if GTEST_HAS_EXCEPTIONS
+      throw internal::GoogleTestFailureException(result);
+#else
+      // We cannot call abort() as it generates a pop-up in debug mode
+      // that cannot be suppressed in VC 7.1 or below.
+      exit(1);
+#endif
+    }
+  }
+}
+
+// Adds a TestProperty to the current TestResult object when invoked from
+// inside a test, to current TestCase's ad_hoc_test_result_ when invoked
+// from SetUpTestCase or TearDownTestCase, or to the global property set
+// when invoked elsewhere.  If the result already contains a property with
+// the same key, the value will be updated.
+void UnitTest::RecordProperty(const std::string& key,
+                              const std::string& value) {
+  impl_->RecordProperty(TestProperty(key, value));
+}
+
+// Runs all tests in this UnitTest object and prints the result.
+// Returns 0 if successful, or 1 otherwise.
+//
+// We don't protect this under mutex_, as we only support calling it
+// from the main thread.
+int UnitTest::Run() {
+  const bool in_death_test_child_process =
+      internal::GTEST_FLAG(internal_run_death_test).length() > 0;
+
+  // Google Test implements this protocol for catching that a test
+  // program exits before returning control to Google Test:
+  //
+  //   1. Upon start, Google Test creates a file whose absolute path
+  //      is specified by the environment variable
+  //      TEST_PREMATURE_EXIT_FILE.
+  //   2. When Google Test has finished its work, it deletes the file.
+  //
+  // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
+  // running a Google-Test-based test program and check the existence
+  // of the file at the end of the test execution to see if it has
+  // exited prematurely.
+
+  // If we are in the child process of a death test, don't
+  // create/delete the premature exit file, as doing so is unnecessary
+  // and will confuse the parent process.  Otherwise, create/delete
+  // the file upon entering/leaving this function.  If the program
+  // somehow exits before this function has a chance to return, the
+  // premature-exit file will be left undeleted, causing a test runner
+  // that understands the premature-exit-file protocol to report the
+  // test as having failed.
+  const internal::ScopedPrematureExitFile premature_exit_file(
+      in_death_test_child_process ?
+      NULL : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));
+
+  // Captures the value of GTEST_FLAG(catch_exceptions).  This value will be
+  // used for the duration of the program.
+  impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions));
+
+#if GTEST_HAS_SEH
+  // Either the user wants Google Test to catch exceptions thrown by the
+  // tests or this is executing in the context of death test child
+  // process. In either case the user does not want to see pop-up dialogs
+  // about crashes - they are expected.
+  if (impl()->catch_exceptions() || in_death_test_child_process) {
+# if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+    // SetErrorMode doesn't exist on CE.
+    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
+                 SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
+# endif  // !GTEST_OS_WINDOWS_MOBILE
+
+# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE
+    // Death test children can be terminated with _abort().  On Windows,
+    // _abort() can show a dialog with a warning message.  This forces the
+    // abort message to go to stderr instead.
+    _set_error_mode(_OUT_TO_STDERR);
+# endif
+
+# if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE
+    // In the debug version, Visual Studio pops up a separate dialog
+    // offering a choice to debug the aborted program. We need to suppress
+    // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
+    // executed. Google Test will notify the user of any unexpected
+    // failure via stderr.
+    //
+    // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.
+    // Users of prior VC versions shall suffer the agony and pain of
+    // clicking through the countless debug dialogs.
+    // TODO(vladl@google.com): find a way to suppress the abort dialog() in the
+    // debug mode when compiled with VC 7.1 or lower.
+    if (!GTEST_FLAG(break_on_failure))
+      _set_abort_behavior(
+          0x0,                                    // Clear the following flags:
+          _WRITE_ABORT_MSG | _CALL_REPORTFAULT);  // pop-up window, core dump.
+# endif
+  }
+#endif  // GTEST_HAS_SEH
+
+  return internal::HandleExceptionsInMethodIfSupported(
+      impl(),
+      &internal::UnitTestImpl::RunAllTests,
+      "auxiliary test code (environments or event listeners)") ? 0 : 1;
+}
+
+// Returns the working directory when the first TEST() or TEST_F() was
+// executed.
+const char* UnitTest::original_working_dir() const {
+  return impl_->original_working_dir_.c_str();
+}
+
+// Returns the TestCase object for the test that's currently running,
+// or NULL if no test is running.
+const TestCase* UnitTest::current_test_case() const
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  return impl_->current_test_case();
+}
+
+// Returns the TestInfo object for the test that's currently running,
+// or NULL if no test is running.
+const TestInfo* UnitTest::current_test_info() const
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  return impl_->current_test_info();
+}
+
+// Returns the random seed used at the start of the current test run.
+int UnitTest::random_seed() const { return impl_->random_seed(); }
+
+#if GTEST_HAS_PARAM_TEST
+// Returns ParameterizedTestCaseRegistry object used to keep track of
+// value-parameterized tests and instantiate and register them.
+internal::ParameterizedTestCaseRegistry&
+    UnitTest::parameterized_test_registry()
+        GTEST_LOCK_EXCLUDED_(mutex_) {
+  return impl_->parameterized_test_registry();
+}
+#endif  // GTEST_HAS_PARAM_TEST
+
+// Creates an empty UnitTest.
+UnitTest::UnitTest() {
+  impl_ = new internal::UnitTestImpl(this);
+}
+
+// Destructor of UnitTest.
+UnitTest::~UnitTest() {
+  delete impl_;
+}
+
+// Pushes a trace defined by SCOPED_TRACE() on to the per-thread
+// Google Test trace stack.
+void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  impl_->gtest_trace_stack().push_back(trace);
+}
+
+// Pops a trace from the per-thread Google Test trace stack.
+void UnitTest::PopGTestTrace()
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  internal::MutexLock lock(&mutex_);
+  impl_->gtest_trace_stack().pop_back();
+}
+
+namespace internal {
+
+UnitTestImpl::UnitTestImpl(UnitTest* parent)
+    : parent_(parent),
+      GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
+      default_global_test_part_result_reporter_(this),
+      default_per_thread_test_part_result_reporter_(this),
+      GTEST_DISABLE_MSC_WARNINGS_POP_()
+      global_test_part_result_repoter_(
+          &default_global_test_part_result_reporter_),
+      per_thread_test_part_result_reporter_(
+          &default_per_thread_test_part_result_reporter_),
+#if GTEST_HAS_PARAM_TEST
+      parameterized_test_registry_(),
+      parameterized_tests_registered_(false),
+#endif  // GTEST_HAS_PARAM_TEST
+      last_death_test_case_(-1),
+      current_test_case_(NULL),
+      current_test_info_(NULL),
+      ad_hoc_test_result_(),
+      os_stack_trace_getter_(NULL),
+      post_flag_parse_init_performed_(false),
+      random_seed_(0),  // Will be overridden by the flag before first use.
+      random_(0),  // Will be reseeded before first use.
+      start_timestamp_(0),
+      elapsed_time_(0),
+#if GTEST_HAS_DEATH_TEST
+      death_test_factory_(new DefaultDeathTestFactory),
+#endif
+      // Will be overridden by the flag before first use.
+      catch_exceptions_(false) {
+  listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);
+}
+
+UnitTestImpl::~UnitTestImpl() {
+  // Deletes every TestCase.
+  ForEach(test_cases_, internal::Delete<TestCase>);
+
+  // Deletes every Environment.
+  ForEach(environments_, internal::Delete<Environment>);
+
+  delete os_stack_trace_getter_;
+}
+
+// Adds a TestProperty to the current TestResult object when invoked in a
+// context of a test, to current test case's ad_hoc_test_result when invoke
+// from SetUpTestCase/TearDownTestCase, or to the global property set
+// otherwise.  If the result already contains a property with the same key,
+// the value will be updated.
+void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
+  std::string xml_element;
+  TestResult* test_result;  // TestResult appropriate for property recording.
+
+  if (current_test_info_ != NULL) {
+    xml_element = "testcase";
+    test_result = &(current_test_info_->result_);
+  } else if (current_test_case_ != NULL) {
+    xml_element = "testsuite";
+    test_result = &(current_test_case_->ad_hoc_test_result_);
+  } else {
+    xml_element = "testsuites";
+    test_result = &ad_hoc_test_result_;
+  }
+  test_result->RecordProperty(xml_element, test_property);
+}
+
+#if GTEST_HAS_DEATH_TEST
+// Disables event forwarding if the control is currently in a death test
+// subprocess. Must not be called before InitGoogleTest.
+void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
+  if (internal_run_death_test_flag_.get() != NULL)
+    listeners()->SuppressEventForwarding();
+}
+#endif  // GTEST_HAS_DEATH_TEST
+
+// Initializes event listeners performing XML output as specified by
+// UnitTestOptions. Must not be called before InitGoogleTest.
+void UnitTestImpl::ConfigureXmlOutput() {
+  const std::string& output_format = UnitTestOptions::GetOutputFormat();
+  if (output_format == "xml") {
+    listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
+        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
+  } else if (output_format != "") {
+    printf("WARNING: unrecognized output format \"%s\" ignored.\n",
+           output_format.c_str());
+    fflush(stdout);
+  }
+}
+
+#if GTEST_CAN_STREAM_RESULTS_
+// Initializes event listeners for streaming test results in string form.
+// Must not be called before InitGoogleTest.
+void UnitTestImpl::ConfigureStreamingOutput() {
+  const std::string& target = GTEST_FLAG(stream_result_to);
+  if (!target.empty()) {
+    const size_t pos = target.find(':');
+    if (pos != std::string::npos) {
+      listeners()->Append(new StreamingListener(target.substr(0, pos),
+                                                target.substr(pos+1)));
+    } else {
+      printf("WARNING: unrecognized streaming target \"%s\" ignored.\n",
+             target.c_str());
+      fflush(stdout);
+    }
+  }
+}
+#endif  // GTEST_CAN_STREAM_RESULTS_
+
+// Performs initialization dependent upon flag values obtained in
+// ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to
+// ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest
+// this function is also called from RunAllTests.  Since this function can be
+// called more than once, it has to be idempotent.
+void UnitTestImpl::PostFlagParsingInit() {
+  // Ensures that this function does not execute more than once.
+  if (!post_flag_parse_init_performed_) {
+    post_flag_parse_init_performed_ = true;
+
+#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+    // Register to send notifications about key process state changes.
+    listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());
+#endif  // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+
+#if GTEST_HAS_DEATH_TEST
+    InitDeathTestSubprocessControlInfo();
+    SuppressTestEventsIfInSubprocess();
+#endif  // GTEST_HAS_DEATH_TEST
+
+    // Registers parameterized tests. This makes parameterized tests
+    // available to the UnitTest reflection API without running
+    // RUN_ALL_TESTS.
+    RegisterParameterizedTests();
+
+    // Configures listeners for XML output. This makes it possible for users
+    // to shut down the default XML output before invoking RUN_ALL_TESTS.
+    ConfigureXmlOutput();
+
+#if GTEST_CAN_STREAM_RESULTS_
+    // Configures listeners for streaming test results to the specified server.
+    ConfigureStreamingOutput();
+#endif  // GTEST_CAN_STREAM_RESULTS_
+  }
+}
+
+// A predicate that checks the name of a TestCase against a known
+// value.
+//
+// This is used for implementation of the UnitTest class only.  We put
+// it in the anonymous namespace to prevent polluting the outer
+// namespace.
+//
+// TestCaseNameIs is copyable.
+class TestCaseNameIs {
+ public:
+  // Constructor.
+  explicit TestCaseNameIs(const std::string& name)
+      : name_(name) {}
+
+  // Returns true iff the name of test_case matches name_.
+  bool operator()(const TestCase* test_case) const {
+    return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;
+  }
+
+ private:
+  std::string name_;
+};
+
+// Finds and returns a TestCase with the given name.  If one doesn't
+// exist, creates one and returns it.  It's the CALLER'S
+// RESPONSIBILITY to ensure that this function is only called WHEN THE
+// TESTS ARE NOT SHUFFLED.
+//
+// Arguments:
+//
+//   test_case_name: name of the test case
+//   type_param:     the name of the test case's type parameter, or NULL if
+//                   this is not a typed or a type-parameterized test case.
+//   set_up_tc:      pointer to the function that sets up the test case
+//   tear_down_tc:   pointer to the function that tears down the test case
+TestCase* UnitTestImpl::GetTestCase(const char* test_case_name,
+                                    const char* type_param,
+                                    Test::SetUpTestCaseFunc set_up_tc,
+                                    Test::TearDownTestCaseFunc tear_down_tc) {
+  // Can we find a TestCase with the given name?
+  const std::vector<TestCase*>::const_iterator test_case =
+      std::find_if(test_cases_.begin(), test_cases_.end(),
+                   TestCaseNameIs(test_case_name));
+
+  if (test_case != test_cases_.end())
+    return *test_case;
+
+  // No.  Let's create one.
+  TestCase* const new_test_case =
+      new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc);
+
+  // Is this a death test case?
+  if (internal::UnitTestOptions::MatchesFilter(test_case_name,
+                                               kDeathTestCaseFilter)) {
+    // Yes.  Inserts the test case after the last death test case
+    // defined so far.  This only works when the test cases haven't
+    // been shuffled.  Otherwise we may end up running a death test
+    // after a non-death test.
+    ++last_death_test_case_;
+    test_cases_.insert(test_cases_.begin() + last_death_test_case_,
+                       new_test_case);
+  } else {
+    // No.  Appends to the end of the list.
+    test_cases_.push_back(new_test_case);
+  }
+
+  test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));
+  return new_test_case;
+}
+
+// Helpers for setting up / tearing down the given environment.  They
+// are for use in the ForEach() function.
+static void SetUpEnvironment(Environment* env) { env->SetUp(); }
+static void TearDownEnvironment(Environment* env) { env->TearDown(); }
+
+// Runs all tests in this UnitTest object, prints the result, and
+// returns true if all tests are successful.  If any exception is
+// thrown during a test, the test is considered to be failed, but the
+// rest of the tests will still be run.
+//
+// When parameterized tests are enabled, it expands and registers
+// parameterized tests first in RegisterParameterizedTests().
+// All other functions called from RunAllTests() may safely assume that
+// parameterized tests are ready to be counted and run.
+bool UnitTestImpl::RunAllTests() {
+  // Makes sure InitGoogleTest() was called.
+  if (!GTestIsInitialized()) {
+    printf("%s",
+           "\nThis test program did NOT call ::testing::InitGoogleTest "
+           "before calling RUN_ALL_TESTS().  Please fix it.\n");
+    return false;
+  }
+
+  // Do not run any test if the --help flag was specified.
+  if (g_help_flag)
+    return true;
+
+  // Repeats the call to the post-flag parsing initialization in case the
+  // user didn't call InitGoogleTest.
+  PostFlagParsingInit();
+
+  // Even if sharding is not on, test runners may want to use the
+  // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
+  // protocol.
+  internal::WriteToShardStatusFileIfNeeded();
+
+  // True iff we are in a subprocess for running a thread-safe-style
+  // death test.
+  bool in_subprocess_for_death_test = false;
+
+#if GTEST_HAS_DEATH_TEST
+  in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
+# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
+  if (in_subprocess_for_death_test) {
+    GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
+  }
+# endif  // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
+#endif  // GTEST_HAS_DEATH_TEST
+
+  const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
+                                        in_subprocess_for_death_test);
+
+  // Compares the full test names with the filter to decide which
+  // tests to run.
+  const bool has_tests_to_run = FilterTests(should_shard
+                                              ? HONOR_SHARDING_PROTOCOL
+                                              : IGNORE_SHARDING_PROTOCOL) > 0;
+
+  // Lists the tests and exits if the --gtest_list_tests flag was specified.
+  if (GTEST_FLAG(list_tests)) {
+    // This must be called *after* FilterTests() has been called.
+    ListTestsMatchingFilter();
+    return true;
+  }
+
+  random_seed_ = GTEST_FLAG(shuffle) ?
+      GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;
+
+  // True iff at least one test has failed.
+  bool failed = false;
+
+  TestEventListener* repeater = listeners()->repeater();
+
+  start_timestamp_ = GetTimeInMillis();
+  repeater->OnTestProgramStart(*parent_);
+
+  // How many times to repeat the tests?  We don't want to repeat them
+  // when we are inside the subprocess of a death test.
+  const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);
+  // Repeats forever if the repeat count is negative.
+  const bool forever = repeat < 0;
+  for (int i = 0; forever || i != repeat; i++) {
+    // We want to preserve failures generated by ad-hoc test
+    // assertions executed before RUN_ALL_TESTS().
+    ClearNonAdHocTestResult();
+
+    const TimeInMillis start = GetTimeInMillis();
+
+    // Shuffles test cases and tests if requested.
+    if (has_tests_to_run && GTEST_FLAG(shuffle)) {
+      random()->Reseed(random_seed_);
+      // This should be done before calling OnTestIterationStart(),
+      // such that a test event listener can see the actual test order
+      // in the event.
+      ShuffleTests();
+    }
+
+    // Tells the unit test event listeners that the tests are about to start.
+    repeater->OnTestIterationStart(*parent_, i);
+
+    // Runs each test case if there is at least one test to run.
+    if (has_tests_to_run) {
+      // Sets up all environments beforehand.
+      repeater->OnEnvironmentsSetUpStart(*parent_);
+      ForEach(environments_, SetUpEnvironment);
+      repeater->OnEnvironmentsSetUpEnd(*parent_);
+
+      // Runs the tests only if there was no fatal failure during global
+      // set-up.
+      if (!Test::HasFatalFailure()) {
+        for (int test_index = 0; test_index < total_test_case_count();
+             test_index++) {
+          GetMutableTestCase(test_index)->Run();
+        }
+      }
+
+      // Tears down all environments in reverse order afterwards.
+      repeater->OnEnvironmentsTearDownStart(*parent_);
+      std::for_each(environments_.rbegin(), environments_.rend(),
+                    TearDownEnvironment);
+      repeater->OnEnvironmentsTearDownEnd(*parent_);
+    }
+
+    elapsed_time_ = GetTimeInMillis() - start;
+
+    // Tells the unit test event listener that the tests have just finished.
+    repeater->OnTestIterationEnd(*parent_, i);
+
+    // Gets the result and clears it.
+    if (!Passed()) {
+      failed = true;
+    }
+
+    // Restores the original test order after the iteration.  This
+    // allows the user to quickly repro a failure that happens in the
+    // N-th iteration without repeating the first (N - 1) iterations.
+    // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
+    // case the user somehow changes the value of the flag somewhere
+    // (it's always safe to unshuffle the tests).
+    UnshuffleTests();
+
+    if (GTEST_FLAG(shuffle)) {
+      // Picks a new random seed for each iteration.
+      random_seed_ = GetNextRandomSeed(random_seed_);
+    }
+  }
+
+  repeater->OnTestProgramEnd(*parent_);
+
+  return !failed;
+}
+
+// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
+// if the variable is present. If a file already exists at this location, this
+// function will write over it. If the variable is present, but the file cannot
+// be created, prints an error and exits.
+void WriteToShardStatusFileIfNeeded() {
+  const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
+  if (test_shard_file != NULL) {
+    FILE* const file = posix::FOpen(test_shard_file, "w");
+    if (file == NULL) {
+      ColoredPrintf(COLOR_RED,
+                    "Could not write to the test shard status file \"%s\" "
+                    "specified by the %s environment variable.\n",
+                    test_shard_file, kTestShardStatusFile);
+      fflush(stdout);
+      exit(EXIT_FAILURE);
+    }
+    fclose(file);
+  }
+}
+
+// Checks whether sharding is enabled by examining the relevant
+// environment variable values. If the variables are present,
+// but inconsistent (i.e., shard_index >= total_shards), prints
+// an error and exits. If in_subprocess_for_death_test, sharding is
+// disabled because it must only be applied to the original test
+// process. Otherwise, we could filter out death tests we intended to execute.
+bool ShouldShard(const char* total_shards_env,
+                 const char* shard_index_env,
+                 bool in_subprocess_for_death_test) {
+  if (in_subprocess_for_death_test) {
+    return false;
+  }
+
+  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);
+  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);
+
+  if (total_shards == -1 && shard_index == -1) {
+    return false;
+  } else if (total_shards == -1 && shard_index != -1) {
+    const Message msg = Message()
+      << "Invalid environment variables: you have "
+      << kTestShardIndex << " = " << shard_index
+      << ", but have left " << kTestTotalShards << " unset.\n";
+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
+    fflush(stdout);
+    exit(EXIT_FAILURE);
+  } else if (total_shards != -1 && shard_index == -1) {
+    const Message msg = Message()
+      << "Invalid environment variables: you have "
+      << kTestTotalShards << " = " << total_shards
+      << ", but have left " << kTestShardIndex << " unset.\n";
+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
+    fflush(stdout);
+    exit(EXIT_FAILURE);
+  } else if (shard_index < 0 || shard_index >= total_shards) {
+    const Message msg = Message()
+      << "Invalid environment variables: we require 0 <= "
+      << kTestShardIndex << " < " << kTestTotalShards
+      << ", but you have " << kTestShardIndex << "=" << shard_index
+      << ", " << kTestTotalShards << "=" << total_shards << ".\n";
+    ColoredPrintf(COLOR_RED, msg.GetString().c_str());
+    fflush(stdout);
+    exit(EXIT_FAILURE);
+  }
+
+  return total_shards > 1;
+}
+
+// Parses the environment variable var as an Int32. If it is unset,
+// returns default_val. If it is not an Int32, prints an error
+// and aborts.
+Int32 Int32FromEnvOrDie(const char* var, Int32 default_val) {
+  const char* str_val = posix::GetEnv(var);
+  if (str_val == NULL) {
+    return default_val;
+  }
+
+  Int32 result;
+  if (!ParseInt32(Message() << "The value of environment variable " << var,
+                  str_val, &result)) {
+    exit(EXIT_FAILURE);
+  }
+  return result;
+}
+
+// Given the total number of shards, the shard index, and the test id,
+// returns true iff the test should be run on this shard. The test id is
+// some arbitrary but unique non-negative integer assigned to each test
+// method. Assumes that 0 <= shard_index < total_shards.
+bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
+  return (test_id % total_shards) == shard_index;
+}
+
+// Compares the name of each test with the user-specified filter to
+// decide whether the test should be run, then records the result in
+// each TestCase and TestInfo object.
+// If shard_tests == true, further filters tests based on sharding
+// variables in the environment - see
+// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide.
+// Returns the number of tests that should run.
+int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
+  const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?
+      Int32FromEnvOrDie(kTestTotalShards, -1) : -1;
+  const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?
+      Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
+
+  // num_runnable_tests are the number of tests that will
+  // run across all shards (i.e., match filter and are not disabled).
+  // num_selected_tests are the number of tests to be run on
+  // this shard.
+  int num_runnable_tests = 0;
+  int num_selected_tests = 0;
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    TestCase* const test_case = test_cases_[i];
+    const std::string &test_case_name = test_case->name();
+    test_case->set_should_run(false);
+
+    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
+      TestInfo* const test_info = test_case->test_info_list()[j];
+      const std::string test_name(test_info->name());
+      // A test is disabled if test case name or test name matches
+      // kDisableTestFilter.
+      const bool is_disabled =
+          internal::UnitTestOptions::MatchesFilter(test_case_name,
+                                                   kDisableTestFilter) ||
+          internal::UnitTestOptions::MatchesFilter(test_name,
+                                                   kDisableTestFilter);
+      test_info->is_disabled_ = is_disabled;
+
+      const bool matches_filter =
+          internal::UnitTestOptions::FilterMatchesTest(test_case_name,
+                                                       test_name);
+      test_info->matches_filter_ = matches_filter;
+
+      const bool is_runnable =
+          (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) &&
+          matches_filter;
+
+      const bool is_selected = is_runnable &&
+          (shard_tests == IGNORE_SHARDING_PROTOCOL ||
+           ShouldRunTestOnShard(total_shards, shard_index,
+                                num_runnable_tests));
+
+      num_runnable_tests += is_runnable;
+      num_selected_tests += is_selected;
+
+      test_info->should_run_ = is_selected;
+      test_case->set_should_run(test_case->should_run() || is_selected);
+    }
+  }
+  return num_selected_tests;
+}
+
+// Prints the given C-string on a single line by replacing all '\n'
+// characters with string "\\n".  If the output takes more than
+// max_length characters, only prints the first max_length characters
+// and "...".
+static void PrintOnOneLine(const char* str, int max_length) {
+  if (str != NULL) {
+    for (int i = 0; *str != '\0'; ++str) {
+      if (i >= max_length) {
+        printf("...");
+        break;
+      }
+      if (*str == '\n') {
+        printf("\\n");
+        i += 2;
+      } else {
+        printf("%c", *str);
+        ++i;
+      }
+    }
+  }
+}
+
+// Prints the names of the tests matching the user-specified filter flag.
+void UnitTestImpl::ListTestsMatchingFilter() {
+  // Print at most this many characters for each type/value parameter.
+  const int kMaxParamLength = 250;
+
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    const TestCase* const test_case = test_cases_[i];
+    bool printed_test_case_name = false;
+
+    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {
+      const TestInfo* const test_info =
+          test_case->test_info_list()[j];
+      if (test_info->matches_filter_) {
+        if (!printed_test_case_name) {
+          printed_test_case_name = true;
+          printf("%s.", test_case->name());
+          if (test_case->type_param() != NULL) {
+            printf("  # %s = ", kTypeParamLabel);
+            // We print the type parameter on a single line to make
+            // the output easy to parse by a program.
+            PrintOnOneLine(test_case->type_param(), kMaxParamLength);
+          }
+          printf("\n");
+        }
+        printf("  %s", test_info->name());
+        if (test_info->value_param() != NULL) {
+          printf("  # %s = ", kValueParamLabel);
+          // We print the value parameter on a single line to make the
+          // output easy to parse by a program.
+          PrintOnOneLine(test_info->value_param(), kMaxParamLength);
+        }
+        printf("\n");
+      }
+    }
+  }
+  fflush(stdout);
+}
+
+// Sets the OS stack trace getter.
+//
+// Does nothing if the input and the current OS stack trace getter are
+// the same; otherwise, deletes the old getter and makes the input the
+// current getter.
+void UnitTestImpl::set_os_stack_trace_getter(
+    OsStackTraceGetterInterface* getter) {
+  if (os_stack_trace_getter_ != getter) {
+    delete os_stack_trace_getter_;
+    os_stack_trace_getter_ = getter;
+  }
+}
+
+// Returns the current OS stack trace getter if it is not NULL;
+// otherwise, creates an OsStackTraceGetter, makes it the current
+// getter, and returns it.
+OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
+  if (os_stack_trace_getter_ == NULL) {
+#ifdef GTEST_OS_STACK_TRACE_GETTER_
+    os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
+#else
+    os_stack_trace_getter_ = new OsStackTraceGetter;
+#endif  // GTEST_OS_STACK_TRACE_GETTER_
+  }
+
+  return os_stack_trace_getter_;
+}
+
+// Returns the TestResult for the test that's currently running, or
+// the TestResult for the ad hoc test if no test is running.
+TestResult* UnitTestImpl::current_test_result() {
+  return current_test_info_ ?
+      &(current_test_info_->result_) : &ad_hoc_test_result_;
+}
+
+// Shuffles all test cases, and the tests within each test case,
+// making sure that death tests are still run first.
+void UnitTestImpl::ShuffleTests() {
+  // Shuffles the death test cases.
+  ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);
+
+  // Shuffles the non-death test cases.
+  ShuffleRange(random(), last_death_test_case_ + 1,
+               static_cast<int>(test_cases_.size()), &test_case_indices_);
+
+  // Shuffles the tests inside each test case.
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    test_cases_[i]->ShuffleTests(random());
+  }
+}
+
+// Restores the test cases and tests to their order before the first shuffle.
+void UnitTestImpl::UnshuffleTests() {
+  for (size_t i = 0; i < test_cases_.size(); i++) {
+    // Unshuffles the tests in each test case.
+    test_cases_[i]->UnshuffleTests();
+    // Resets the index of each test case.
+    test_case_indices_[i] = static_cast<int>(i);
+  }
+}
+
+// Returns the current OS stack trace as an std::string.
+//
+// The maximum number of stack frames to be included is specified by
+// the gtest_stack_trace_depth flag.  The skip_count parameter
+// specifies the number of top frames to be skipped, which doesn't
+// count against the number of frames to be included.
+//
+// For example, if Foo() calls Bar(), which in turn calls
+// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
+// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
+std::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,
+                                            int skip_count) {
+  // We pass skip_count + 1 to skip this wrapper function in addition
+  // to what the user really wants to skip.
+  return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);
+}
+
+// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to
+// suppress unreachable code warnings.
+namespace {
+class ClassUniqueToAlwaysTrue {};
+}
+
+bool IsTrue(bool condition) { return condition; }
+
+bool AlwaysTrue() {
+#if GTEST_HAS_EXCEPTIONS
+  // This condition is always false so AlwaysTrue() never actually throws,
+  // but it makes the compiler think that it may throw.
+  if (IsTrue(false))
+    throw ClassUniqueToAlwaysTrue();
+#endif  // GTEST_HAS_EXCEPTIONS
+  return true;
+}
+
+// If *pstr starts with the given prefix, modifies *pstr to be right
+// past the prefix and returns true; otherwise leaves *pstr unchanged
+// and returns false.  None of pstr, *pstr, and prefix can be NULL.
+bool SkipPrefix(const char* prefix, const char** pstr) {
+  const size_t prefix_len = strlen(prefix);
+  if (strncmp(*pstr, prefix, prefix_len) == 0) {
+    *pstr += prefix_len;
+    return true;
+  }
+  return false;
+}
+
+// Parses a string as a command line flag.  The string should have
+// the format "--flag=value".  When def_optional is true, the "=value"
+// part can be omitted.
+//
+// Returns the value of the flag, or NULL if the parsing failed.
+const char* ParseFlagValue(const char* str,
+                           const char* flag,
+                           bool def_optional) {
+  // str and flag must not be NULL.
+  if (str == NULL || flag == NULL) return NULL;
+
+  // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
+  const std::string flag_str = std::string("--") + GTEST_FLAG_PREFIX_ + flag;
+  const size_t flag_len = flag_str.length();
+  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
+
+  // Skips the flag name.
+  const char* flag_end = str + flag_len;
+
+  // When def_optional is true, it's OK to not have a "=value" part.
+  if (def_optional && (flag_end[0] == '\0')) {
+    return flag_end;
+  }
+
+  // If def_optional is true and there are more characters after the
+  // flag name, or if def_optional is false, there must be a '=' after
+  // the flag name.
+  if (flag_end[0] != '=') return NULL;
+
+  // Returns the string after "=".
+  return flag_end + 1;
+}
+
+// Parses a string for a bool flag, in the form of either
+// "--flag=value" or "--flag".
+//
+// In the former case, the value is taken as true as long as it does
+// not start with '0', 'f', or 'F'.
+//
+// In the latter case, the value is taken as true.
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+bool ParseBoolFlag(const char* str, const char* flag, bool* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseFlagValue(str, flag, true);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Converts the string value to a bool.
+  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
+  return true;
+}
+
+// Parses a string for an Int32 flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+bool ParseInt32Flag(const char* str, const char* flag, Int32* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseFlagValue(str, flag, false);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Sets *value to the value of the flag.
+  return ParseInt32(Message() << "The value of flag --" << flag,
+                    value_str, value);
+}
+
+// Parses a string for a string flag, in the form of
+// "--flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+bool ParseStringFlag(const char* str, const char* flag, std::string* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseFlagValue(str, flag, false);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Sets *value to the value of the flag.
+  *value = value_str;
+  return true;
+}
+
+// Determines whether a string has a prefix that Google Test uses for its
+// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.
+// If Google Test detects that a command line flag has its prefix but is not
+// recognized, it will print its help message. Flags starting with
+// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
+// internal flags and do not trigger the help message.
+static bool HasGoogleTestFlagPrefix(const char* str) {
+  return (SkipPrefix("--", &str) ||
+          SkipPrefix("-", &str) ||
+          SkipPrefix("/", &str)) &&
+         !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
+         (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
+          SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));
+}
+
+// Prints a string containing code-encoded text.  The following escape
+// sequences can be used in the string to control the text color:
+//
+//   @@    prints a single '@' character.
+//   @R    changes the color to red.
+//   @G    changes the color to green.
+//   @Y    changes the color to yellow.
+//   @D    changes to the default terminal text color.
+//
+// TODO(wan@google.com): Write tests for this once we add stdout
+// capturing to Google Test.
+static void PrintColorEncoded(const char* str) {
+  GTestColor color = COLOR_DEFAULT;  // The current color.
+
+  // Conceptually, we split the string into segments divided by escape
+  // sequences.  Then we print one segment at a time.  At the end of
+  // each iteration, the str pointer advances to the beginning of the
+  // next segment.
+  for (;;) {
+    const char* p = strchr(str, '@');
+    if (p == NULL) {
+      ColoredPrintf(color, "%s", str);
+      return;
+    }
+
+    ColoredPrintf(color, "%s", std::string(str, p).c_str());
+
+    const char ch = p[1];
+    str = p + 2;
+    if (ch == '@') {
+      ColoredPrintf(color, "@");
+    } else if (ch == 'D') {
+      color = COLOR_DEFAULT;
+    } else if (ch == 'R') {
+      color = COLOR_RED;
+    } else if (ch == 'G') {
+      color = COLOR_GREEN;
+    } else if (ch == 'Y') {
+      color = COLOR_YELLOW;
+    } else {
+      --str;
+    }
+  }
+}
+
+static const char kColorEncodedHelpMessage[] =
+"This program contains tests written using " GTEST_NAME_ ". You can use the\n"
+"following command line flags to control its behavior:\n"
+"\n"
+"Test Selection:\n"
+"  @G--" GTEST_FLAG_PREFIX_ "list_tests@D\n"
+"      List the names of all tests instead of running them. The name of\n"
+"      TEST(Foo, Bar) is \"Foo.Bar\".\n"
+"  @G--" GTEST_FLAG_PREFIX_ "filter=@YPOSTIVE_PATTERNS"
+    "[@G-@YNEGATIVE_PATTERNS]@D\n"
+"      Run only the tests whose name matches one of the positive patterns but\n"
+"      none of the negative patterns. '?' matches any single character; '*'\n"
+"      matches any substring; ':' separates two patterns.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "also_run_disabled_tests@D\n"
+"      Run all disabled tests too.\n"
+"\n"
+"Test Execution:\n"
+"  @G--" GTEST_FLAG_PREFIX_ "repeat=@Y[COUNT]@D\n"
+"      Run the tests repeatedly; use a negative count to repeat forever.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "shuffle@D\n"
+"      Randomize tests' orders on every iteration.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "random_seed=@Y[NUMBER]@D\n"
+"      Random number seed to use for shuffling test orders (between 1 and\n"
+"      99999, or 0 to use a seed based on the current time).\n"
+"\n"
+"Test Output:\n"
+"  @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n"
+"      Enable/disable colored output. The default is @Gauto@D.\n"
+"  -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n"
+"      Don't print the elapsed time of each test.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G"
+    GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n"
+"      Generate an XML report in the given directory or with the given file\n"
+"      name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n"
+#if GTEST_CAN_STREAM_RESULTS_
+"  @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n"
+"      Stream test results to the given server.\n"
+#endif  // GTEST_CAN_STREAM_RESULTS_
+"\n"
+"Assertion Behavior:\n"
+#if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
+"  @G--" GTEST_FLAG_PREFIX_ "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n"
+"      Set the default death test style.\n"
+#endif  // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
+"  @G--" GTEST_FLAG_PREFIX_ "break_on_failure@D\n"
+"      Turn assertion failures into debugger break-points.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n"
+"      Turn assertion failures into C++ exceptions.\n"
+"  @G--" GTEST_FLAG_PREFIX_ "catch_exceptions=0@D\n"
+"      Do not report exceptions as test failures. Instead, allow them\n"
+"      to crash the program or throw a pop-up (on Windows).\n"
+"\n"
+"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set "
+    "the corresponding\n"
+"environment variable of a flag (all letters in upper-case). For example, to\n"
+"disable colored text output, you can either specify @G--" GTEST_FLAG_PREFIX_
+    "color=no@D or set\n"
+"the @G" GTEST_FLAG_PREFIX_UPPER_ "COLOR@D environment variable to @Gno@D.\n"
+"\n"
+"For more information, please read the " GTEST_NAME_ " documentation at\n"
+"@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_ "\n"
+"(not one in your own code or tests), please report it to\n"
+"@G<" GTEST_DEV_EMAIL_ ">@D.\n";
+
+bool ParseGoogleTestFlag(const char* const arg) {
+  return ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
+                       &GTEST_FLAG(also_run_disabled_tests)) ||
+      ParseBoolFlag(arg, kBreakOnFailureFlag,
+                    &GTEST_FLAG(break_on_failure)) ||
+      ParseBoolFlag(arg, kCatchExceptionsFlag,
+                    &GTEST_FLAG(catch_exceptions)) ||
+      ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
+      ParseStringFlag(arg, kDeathTestStyleFlag,
+                      &GTEST_FLAG(death_test_style)) ||
+      ParseBoolFlag(arg, kDeathTestUseFork,
+                    &GTEST_FLAG(death_test_use_fork)) ||
+      ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
+      ParseStringFlag(arg, kInternalRunDeathTestFlag,
+                      &GTEST_FLAG(internal_run_death_test)) ||
+      ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
+      ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
+      ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
+      ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
+      ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
+      ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
+      ParseInt32Flag(arg, kStackTraceDepthFlag,
+                     &GTEST_FLAG(stack_trace_depth)) ||
+      ParseStringFlag(arg, kStreamResultToFlag,
+                      &GTEST_FLAG(stream_result_to)) ||
+      ParseBoolFlag(arg, kThrowOnFailureFlag,
+                    &GTEST_FLAG(throw_on_failure));
+}
+
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+void LoadFlagsFromFile(const std::string& path) {
+  FILE* flagfile = posix::FOpen(path.c_str(), "r");
+  if (!flagfile) {
+    fprintf(stderr,
+            "Unable to open file \"%s\"\n",
+            GTEST_FLAG(flagfile).c_str());
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+  std::string contents(ReadEntireFile(flagfile));
+  posix::FClose(flagfile);
+  std::vector<std::string> lines;
+  SplitString(contents, '\n', &lines);
+  for (size_t i = 0; i < lines.size(); ++i) {
+    if (lines[i].empty())
+      continue;
+    if (!ParseGoogleTestFlag(lines[i].c_str()))
+      g_help_flag = true;
+  }
+}
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+
+// Parses the command line for Google Test flags, without initializing
+// other parts of Google Test.  The type parameter CharType can be
+// instantiated to either char or wchar_t.
+template <typename CharType>
+void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
+  for (int i = 1; i < *argc; i++) {
+    const std::string arg_string = StreamableToString(argv[i]);
+    const char* const arg = arg_string.c_str();
+
+    using internal::ParseBoolFlag;
+    using internal::ParseInt32Flag;
+    using internal::ParseStringFlag;
+
+    bool remove_flag = false;
+    if (ParseGoogleTestFlag(arg)) {
+      remove_flag = true;
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+    } else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {
+      LoadFlagsFromFile(GTEST_FLAG(flagfile));
+      remove_flag = true;
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+    } else if (arg_string == "--help" || arg_string == "-h" ||
+               arg_string == "-?" || arg_string == "/?" ||
+               HasGoogleTestFlagPrefix(arg)) {
+      // Both help flag and unrecognized Google Test flags (excluding
+      // internal ones) trigger help display.
+      g_help_flag = true;
+    }
+
+    if (remove_flag) {
+      // Shift the remainder of the argv list left by one.  Note
+      // that argv has (*argc + 1) elements, the last one always being
+      // NULL.  The following loop moves the trailing NULL element as
+      // well.
+      for (int j = i; j != *argc; j++) {
+        argv[j] = argv[j + 1];
+      }
+
+      // Decrements the argument count.
+      (*argc)--;
+
+      // We also need to decrement the iterator as we just removed
+      // an element.
+      i--;
+    }
+  }
+
+  if (g_help_flag) {
+    // We print the help here instead of in RUN_ALL_TESTS(), as the
+    // latter may not be called at all if the user is using Google
+    // Test with another testing framework.
+    PrintColorEncoded(kColorEncodedHelpMessage);
+  }
+}
+
+// Parses the command line for Google Test flags, without initializing
+// other parts of Google Test.
+void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
+  ParseGoogleTestFlagsOnlyImpl(argc, argv);
+}
+void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
+  ParseGoogleTestFlagsOnlyImpl(argc, argv);
+}
+
+// The internal implementation of InitGoogleTest().
+//
+// The type parameter CharType can be instantiated to either char or
+// wchar_t.
+template <typename CharType>
+void InitGoogleTestImpl(int* argc, CharType** argv) {
+  // We don't want to run the initialization code twice.
+  if (GTestIsInitialized()) return;
+
+  if (*argc <= 0) return;
+
+  g_argvs.clear();
+  for (int i = 0; i != *argc; i++) {
+    g_argvs.push_back(StreamableToString(argv[i]));
+  }
+
+  ParseGoogleTestFlagsOnly(argc, argv);
+  GetUnitTestImpl()->PostFlagParsingInit();
+}
+
+}  // namespace internal
+
+// Initializes Google Test.  This must be called before calling
+// RUN_ALL_TESTS().  In particular, it parses a command line for the
+// flags that Google Test recognizes.  Whenever a Google Test flag is
+// seen, it is removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Test flag variables are
+// updated.
+//
+// Calling the function for the second time has no user-visible effect.
+void InitGoogleTest(int* argc, char** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  internal::InitGoogleTestImpl(argc, argv);
+#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+}
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+void InitGoogleTest(int* argc, wchar_t** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  internal::InitGoogleTestImpl(argc, argv);
+#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+}
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/gtest/src/gtest_main.cc b/third_party/wpiutil_2018/gmock/gtest/src/gtest_main.cc
new file mode 100644
index 0000000..f302822
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/gtest/src/gtest_main.cc
@@ -0,0 +1,38 @@
+// Copyright 2006, 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 <stdio.h>
+
+#include "gtest/gtest.h"
+
+GTEST_API_ int main(int argc, char **argv) {
+  printf("Running main() from gtest_main.cc\n");
+  testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-actions.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-actions.h
new file mode 100644
index 0000000..b3f654a
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-actions.h
@@ -0,0 +1,1205 @@
+// 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 <errno.h>
+#endif
+
+#include <algorithm>
+#include <string>
+
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+
+#if GTEST_HAS_STD_TYPE_TRAITS_  // Defined by gtest-port.h via gmock-port.h.
+#include <type_traits>
+#endif
+
+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 <typename F1, typename F2>
+class ActionAdaptor;
+
+// BuiltInDefaultValueGetter<T, true>::Get() returns a
+// default-constructed T value.  BuiltInDefaultValueGetter<T,
+// false>::Get() crashes with an error.
+//
+// This primary template is used when kDefaultConstructible is true.
+template <typename T, bool kDefaultConstructible>
+struct BuiltInDefaultValueGetter {
+  static T Get() { return T(); }
+};
+template <typename T>
+struct BuiltInDefaultValueGetter<T, false> {
+  static T Get() {
+    Assert(false, __FILE__, __LINE__,
+           "Default action undefined for the function return type.");
+    return internal::Invalid<T>();
+    // The above statement will never be reached, but is required in
+    // order for this function to compile.
+  }
+};
+
+// BuiltInDefaultValue<T>::Get() returns the "built-in" default value
+// for type T, which is NULL when T is a raw pointer type, 0 when T is
+// a numeric type, false when T is bool, or "" when T is string or
+// std::string.  In addition, in C++11 and above, it turns a
+// default-constructed T value if T is default constructible.  For any
+// other type T, the built-in default T value is undefined, and the
+// function will abort the process.
+template <typename T>
+class BuiltInDefaultValue {
+ public:
+#if GTEST_HAS_STD_TYPE_TRAITS_
+  // This function returns true iff type T has a built-in default value.
+  static bool Exists() {
+    return ::std::is_default_constructible<T>::value;
+  }
+
+  static T Get() {
+    return BuiltInDefaultValueGetter<
+        T, ::std::is_default_constructible<T>::value>::Get();
+  }
+
+#else  // GTEST_HAS_STD_TYPE_TRAITS_
+  // This function returns true iff type T has a built-in default value.
+  static bool Exists() {
+    return false;
+  }
+
+  static T Get() {
+    return BuiltInDefaultValueGetter<T, false>::Get();
+  }
+
+#endif  // GTEST_HAS_STD_TYPE_TRAITS_
+};
+
+// This partial specialization says that we use the same built-in
+// default value for T and const T.
+template <typename T>
+class BuiltInDefaultValue<const T> {
+ public:
+  static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
+  static T Get() { return BuiltInDefaultValue<T>::Get(); }
+};
+
+// This partial specialization defines the default values for pointer
+// types.
+template <typename T>
+class BuiltInDefaultValue<T*> {
+ 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<type> { \
+   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<T> 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<T>::Set(foo);
+template <typename T>
+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 producer_;
+    producer_ = new FixedValueProducer(x);
+  }
+
+  // Provides a factory function to be called to generate the default value.
+  // This method can be used even if T is only move-constructible, but it is not
+  // limited to that case.
+  typedef T (*FactoryFunction)();
+  static void SetFactory(FactoryFunction factory) {
+    delete producer_;
+    producer_ = new FactoryValueProducer(factory);
+  }
+
+  // Unsets the default value for type T.
+  static void Clear() {
+    delete producer_;
+    producer_ = NULL;
+  }
+
+  // Returns true iff the user has set the default value for type T.
+  static bool IsSet() { return producer_ != 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<T>::Exists();
+  }
+
+  // Returns the default value for type T if the user has set one;
+  // otherwise returns the built-in default value. Requires that Exists()
+  // is true, which ensures that the return value is well-defined.
+  static T Get() {
+    return producer_ == NULL ?
+        internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
+  }
+
+ private:
+  class ValueProducer {
+   public:
+    virtual ~ValueProducer() {}
+    virtual T Produce() = 0;
+  };
+
+  class FixedValueProducer : public ValueProducer {
+   public:
+    explicit FixedValueProducer(T value) : value_(value) {}
+    virtual T Produce() { return value_; }
+
+   private:
+    const T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
+  };
+
+  class FactoryValueProducer : public ValueProducer {
+   public:
+    explicit FactoryValueProducer(FactoryFunction factory)
+        : factory_(factory) {}
+    virtual T Produce() { return factory_(); }
+
+   private:
+    const FactoryFunction factory_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
+  };
+
+  static ValueProducer* producer_;
+};
+
+// This partial specialization allows a user to set default values for
+// reference types.
+template <typename T>
+class DefaultValue<T&> {
+ 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<T&>::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<T&>::Get() : *address_;
+  }
+
+ private:
+  static T* address_;
+};
+
+// This specialization allows DefaultValue<void>::Get() to
+// compile.
+template <>
+class DefaultValue<void> {
+ public:
+  static bool Exists() { return true; }
+  static void Get() {}
+};
+
+// Points to the user-set default value for type T.
+template <typename T>
+typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = NULL;
+
+// Points to the user-set default value for type T&.
+template <typename T>
+T* DefaultValue<T&>::address_ = NULL;
+
+// Implement this interface to define an action for function type F.
+template <typename F>
+class ActionInterface {
+ public:
+  typedef typename internal::Function<F>::Result Result;
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  ActionInterface() {}
+  virtual ~ActionInterface() {}
+
+  // Performs the action.  This method is not const, as in general an
+  // action can have side effects and be stateful.  For example, a
+  // get-the-next-element-from-the-collection action will need to
+  // remember the current element.
+  virtual Result Perform(const ArgumentTuple& args) = 0;
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
+};
+
+// An Action<F> is a copyable and IMMUTABLE (except by assignment)
+// object that represents an action to be taken when a mock function
+// of type F is called.  The implementation of Action<T> is just a
+// linked_ptr to const ActionInterface<T>, so copying is fairly cheap.
+// Don't inherit from Action!
+//
+// You can view an object implementing ActionInterface<F> as a
+// concrete action (including its current state), and an Action<F>
+// object as a handle to it.
+template <typename F>
+class Action {
+ public:
+  typedef typename internal::Function<F>::Result Result;
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  // Constructs a null Action.  Needed for storing Action objects in
+  // STL containers.
+  Action() : impl_(NULL) {}
+
+  // Constructs an Action from its implementation.  A NULL impl is
+  // used to represent the "do-default" action.
+  explicit Action(ActionInterface<F>* impl) : impl_(impl) {}
+
+  // Copy constructor.
+  Action(const Action& action) : impl_(action.impl_) {}
+
+  // This constructor allows us to turn an Action<Func> object into an
+  // Action<F>, as long as F's arguments can be implicitly converted
+  // to Func's and Func's return type can be implicitly converted to
+  // F's.
+  template <typename Func>
+  explicit Action(const Action<Func>& action);
+
+  // Returns true iff this is the DoDefault() action.
+  bool IsDoDefault() const { return impl_.get() == NULL; }
+
+  // Performs the action.  Note that this method is const even though
+  // the corresponding method in ActionInterface is not.  The reason
+  // is that a const Action<F> means that it cannot be re-bound to
+  // another concrete action, not that the concrete action it binds to
+  // cannot change state.  (Think of the difference between a const
+  // pointer and a pointer to const.)
+  Result Perform(const ArgumentTuple& args) const {
+    internal::Assert(
+        !IsDoDefault(), __FILE__, __LINE__,
+        "You are using DoDefault() inside a composite action like "
+        "DoAll() or WithArgs().  This is not supported for technical "
+        "reasons.  Please instead spell out the default action, or "
+        "assign the default action to an Action variable and use "
+        "the variable in various places.");
+    return impl_->Perform(args);
+  }
+
+ private:
+  template <typename F1, typename F2>
+  friend class internal::ActionAdaptor;
+
+  internal::linked_ptr<ActionInterface<F> > impl_;
+};
+
+// The PolymorphicAction class template makes it easy to implement a
+// polymorphic action (i.e. an action that can be used in mock
+// functions of than one type, e.g. Return()).
+//
+// To define a polymorphic action, a user first provides a COPYABLE
+// implementation class that has a Perform() method template:
+//
+//   class FooAction {
+//    public:
+//     template <typename Result, typename ArgumentTuple>
+//     Result Perform(const ArgumentTuple& args) const {
+//       // Processes the arguments and returns a result, using
+//       // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple.
+//     }
+//     ...
+//   };
+//
+// Then the user creates the polymorphic action using
+// MakePolymorphicAction(object) where object has type FooAction.  See
+// the definition of Return(void) and SetArgumentPointee<N>(value) for
+// complete examples.
+template <typename Impl>
+class PolymorphicAction {
+ public:
+  explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
+
+  template <typename F>
+  operator Action<F>() const {
+    return Action<F>(new MonomorphicImpl<F>(impl_));
+  }
+
+ private:
+  template <typename F>
+  class MonomorphicImpl : public ActionInterface<F> {
+   public:
+    typedef typename internal::Function<F>::Result Result;
+    typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      return impl_.template Perform<Result>(args);
+    }
+
+   private:
+    Impl impl_;
+
+    GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
+  };
+
+  Impl impl_;
+
+  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
+};
+
+// Creates an Action from its implementation and returns it.  The
+// created Action object owns the implementation.
+template <typename F>
+Action<F> MakeAction(ActionInterface<F>* impl) {
+  return Action<F>(impl);
+}
+
+// Creates a polymorphic action from its implementation.  This is
+// easier to use than the PolymorphicAction<Impl> constructor as it
+// doesn't require you to explicitly write the template argument, e.g.
+//
+//   MakePolymorphicAction(foo);
+// vs
+//   PolymorphicAction<TypeOfFoo>(foo);
+template <typename Impl>
+inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {
+  return PolymorphicAction<Impl>(impl);
+}
+
+namespace internal {
+
+// Allows an Action<F2> object to pose as an Action<F1>, as long as F2
+// and F1 are compatible.
+template <typename F1, typename F2>
+class ActionAdaptor : public ActionInterface<F1> {
+ public:
+  typedef typename internal::Function<F1>::Result Result;
+  typedef typename internal::Function<F1>::ArgumentTuple ArgumentTuple;
+
+  explicit ActionAdaptor(const Action<F2>& from) : impl_(from.impl_) {}
+
+  virtual Result Perform(const ArgumentTuple& args) {
+    return impl_->Perform(args);
+  }
+
+ private:
+  const internal::linked_ptr<ActionInterface<F2> > impl_;
+
+  GTEST_DISALLOW_ASSIGN_(ActionAdaptor);
+};
+
+// Helper struct to specialize ReturnAction to execute a move instead of a copy
+// on return. Useful for move-only types, but could be used on any type.
+template <typename T>
+struct ByMoveWrapper {
+  explicit ByMoveWrapper(T value) : payload(internal::move(value)) {}
+  T payload;
+};
+
+// Implements the polymorphic Return(x) action, which can be used in
+// any function that returns the type of x, regardless of the argument
+// types.
+//
+// Note: The value passed into Return must be converted into
+// Function<F>::Result when this action is cast to Action<F> rather than
+// when that action is performed. This is important in scenarios like
+//
+// MOCK_METHOD1(Method, T(U));
+// ...
+// {
+//   Foo foo;
+//   X x(&foo);
+//   EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));
+// }
+//
+// In the example above the variable x holds reference to foo which leaves
+// scope and gets destroyed.  If copying X just copies a reference to foo,
+// that copy will be left with a hanging reference.  If conversion to T
+// makes a copy of foo, the above code is safe. To support that scenario, we
+// need to make sure that the type conversion happens inside the EXPECT_CALL
+// statement, and conversion of the result of Return to Action<T(U)> is a
+// good place for that.
+//
+template <typename R>
+class ReturnAction {
+ public:
+  // Constructs a ReturnAction object from the value to be returned.
+  // 'value' is passed by value instead of by const reference in order
+  // to allow Return("string literal") to compile.
+  explicit ReturnAction(R value) : value_(new R(internal::move(value))) {}
+
+  // This template type conversion operator allows Return(x) to be
+  // used in ANY function that returns x's type.
+  template <typename F>
+  operator Action<F>() const {
+    // Assert statement belongs here because this is the best place to verify
+    // conditions on F. It produces the clearest error messages
+    // in most compilers.
+    // Impl really belongs in this scope as a local class but can't
+    // because MSVC produces duplicate symbols in different translation units
+    // in this case. Until MS fixes that bug we put Impl into the class scope
+    // and put the typedef both here (for use in assert statement) and
+    // in the Impl class. But both definitions must be the same.
+    typedef typename Function<F>::Result Result;
+    GTEST_COMPILE_ASSERT_(
+        !is_reference<Result>::value,
+        use_ReturnRef_instead_of_Return_to_return_a_reference);
+    return Action<F>(new Impl<R, F>(value_));
+  }
+
+ private:
+  // Implements the Return(x) action for a particular function type F.
+  template <typename R_, typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    // The implicit cast is necessary when Result has more than one
+    // single-argument constructor (e.g. Result is std::vector<int>) and R
+    // has a type conversion operator template.  In that case, value_(value)
+    // won't compile as the compiler doesn't known which constructor of
+    // Result to call.  ImplicitCast_ forces the compiler to convert R to
+    // Result without considering explicit constructors, thus resolving the
+    // ambiguity. value_ is then initialized using its copy constructor.
+    explicit Impl(const linked_ptr<R>& value)
+        : value_before_cast_(*value),
+          value_(ImplicitCast_<Result>(value_before_cast_)) {}
+
+    virtual Result Perform(const ArgumentTuple&) { return value_; }
+
+   private:
+    GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
+                          Result_cannot_be_a_reference_type);
+    // We save the value before casting just in case it is being cast to a
+    // wrapper type.
+    R value_before_cast_;
+    Result value_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
+  };
+
+  // Partially specialize for ByMoveWrapper. This version of ReturnAction will
+  // move its contents instead.
+  template <typename R_, typename F>
+  class Impl<ByMoveWrapper<R_>, F> : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const linked_ptr<R>& wrapper)
+        : performed_(false), wrapper_(wrapper) {}
+
+    virtual Result Perform(const ArgumentTuple&) {
+      GTEST_CHECK_(!performed_)
+          << "A ByMove() action should only be performed once.";
+      performed_ = true;
+      return internal::move(wrapper_->payload);
+    }
+
+   private:
+    bool performed_;
+    const linked_ptr<R> wrapper_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const linked_ptr<R> value_;
+
+  GTEST_DISALLOW_ASSIGN_(ReturnAction);
+};
+
+// Implements the ReturnNull() action.
+class ReturnNullAction {
+ public:
+  // Allows ReturnNull() to be used in any pointer-returning function. In C++11
+  // this is enforced by returning nullptr, and in non-C++11 by asserting a
+  // pointer type on compile time.
+  template <typename Result, typename ArgumentTuple>
+  static Result Perform(const ArgumentTuple&) {
+#if GTEST_LANG_CXX11
+    return nullptr;
+#else
+    GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,
+                          ReturnNull_can_be_used_to_return_a_pointer_only);
+    return NULL;
+#endif  // GTEST_LANG_CXX11
+  }
+};
+
+// Implements the Return() action.
+class ReturnVoidAction {
+ public:
+  // Allows Return() to be used in any void-returning function.
+  template <typename Result, typename ArgumentTuple>
+  static void Perform(const ArgumentTuple&) {
+    CompileAssertTypesEqual<void, Result>();
+  }
+};
+
+// Implements the polymorphic ReturnRef(x) action, which can be used
+// in any function that returns a reference to the type of x,
+// regardless of the argument types.
+template <typename T>
+class ReturnRefAction {
+ public:
+  // Constructs a ReturnRefAction object from the reference to be returned.
+  explicit ReturnRefAction(T& ref) : ref_(ref) {}  // NOLINT
+
+  // This template type conversion operator allows ReturnRef(x) to be
+  // used in ANY function that returns a reference to x's type.
+  template <typename F>
+  operator Action<F>() const {
+    typedef typename Function<F>::Result Result;
+    // Asserts that the function return type is a reference.  This
+    // catches the user error of using ReturnRef(x) when Return(x)
+    // should be used, and generates some helpful error message.
+    GTEST_COMPILE_ASSERT_(internal::is_reference<Result>::value,
+                          use_Return_instead_of_ReturnRef_to_return_a_value);
+    return Action<F>(new Impl<F>(ref_));
+  }
+
+ private:
+  // Implements the ReturnRef(x) action for a particular function type F.
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(T& ref) : ref_(ref) {}  // NOLINT
+
+    virtual Result Perform(const ArgumentTuple&) {
+      return ref_;
+    }
+
+   private:
+    T& ref_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  T& ref_;
+
+  GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
+};
+
+// Implements the polymorphic ReturnRefOfCopy(x) action, which can be
+// used in any function that returns a reference to the type of x,
+// regardless of the argument types.
+template <typename T>
+class ReturnRefOfCopyAction {
+ public:
+  // Constructs a ReturnRefOfCopyAction object from the reference to
+  // be returned.
+  explicit ReturnRefOfCopyAction(const T& value) : value_(value) {}  // NOLINT
+
+  // This template type conversion operator allows ReturnRefOfCopy(x) to be
+  // used in ANY function that returns a reference to x's type.
+  template <typename F>
+  operator Action<F>() const {
+    typedef typename Function<F>::Result Result;
+    // Asserts that the function return type is a reference.  This
+    // catches the user error of using ReturnRefOfCopy(x) when Return(x)
+    // should be used, and generates some helpful error message.
+    GTEST_COMPILE_ASSERT_(
+        internal::is_reference<Result>::value,
+        use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
+    return Action<F>(new Impl<F>(value_));
+  }
+
+ private:
+  // Implements the ReturnRefOfCopy(x) action for a particular function type F.
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const T& value) : value_(value) {}  // NOLINT
+
+    virtual Result Perform(const ArgumentTuple&) {
+      return value_;
+    }
+
+   private:
+    T value_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const T value_;
+
+  GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
+};
+
+// Implements the polymorphic DoDefault() action.
+class DoDefaultAction {
+ public:
+  // This template type conversion operator allows DoDefault() to be
+  // used in any function.
+  template <typename F>
+  operator Action<F>() const { return Action<F>(NULL); }
+};
+
+// Implements the Assign action to set a given pointer referent to a
+// particular value.
+template <typename T1, typename T2>
+class AssignAction {
+ public:
+  AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
+
+  template <typename Result, typename ArgumentTuple>
+  void Perform(const ArgumentTuple& /* args */) const {
+    *ptr_ = value_;
+  }
+
+ private:
+  T1* const ptr_;
+  const T2 value_;
+
+  GTEST_DISALLOW_ASSIGN_(AssignAction);
+};
+
+#if !GTEST_OS_WINDOWS_MOBILE
+
+// Implements the SetErrnoAndReturn action to simulate return from
+// various system calls and libc functions.
+template <typename T>
+class SetErrnoAndReturnAction {
+ public:
+  SetErrnoAndReturnAction(int errno_value, T result)
+      : errno_(errno_value),
+        result_(result) {}
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& /* args */) const {
+    errno = errno_;
+    return result_;
+  }
+
+ private:
+  const int errno_;
+  const T result_;
+
+  GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
+};
+
+#endif  // !GTEST_OS_WINDOWS_MOBILE
+
+// Implements the SetArgumentPointee<N>(x) action for any function
+// whose N-th argument (0-based) is a pointer to x's type.  The
+// template parameter kIsProto is true iff type A is ProtocolMessage,
+// proto2::Message, or a sub-class of those.
+template <size_t N, typename A, bool kIsProto>
+class SetArgumentPointeeAction {
+ public:
+  // Constructs an action that sets the variable pointed to by the
+  // N-th function argument to 'value'.
+  explicit SetArgumentPointeeAction(const A& value) : value_(value) {}
+
+  template <typename Result, typename ArgumentTuple>
+  void Perform(const ArgumentTuple& args) const {
+    CompileAssertTypesEqual<void, Result>();
+    *::testing::get<N>(args) = value_;
+  }
+
+ private:
+  const A value_;
+
+  GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
+};
+
+template <size_t N, typename Proto>
+class SetArgumentPointeeAction<N, Proto, true> {
+ public:
+  // Constructs an action that sets the variable pointed to by the
+  // N-th function argument to 'proto'.  Both ProtocolMessage and
+  // proto2::Message have the CopyFrom() method, so the same
+  // implementation works for both.
+  explicit SetArgumentPointeeAction(const Proto& proto) : proto_(new Proto) {
+    proto_->CopyFrom(proto);
+  }
+
+  template <typename Result, typename ArgumentTuple>
+  void Perform(const ArgumentTuple& args) const {
+    CompileAssertTypesEqual<void, Result>();
+    ::testing::get<N>(args)->CopyFrom(*proto_);
+  }
+
+ private:
+  const internal::linked_ptr<Proto> proto_;
+
+  GTEST_DISALLOW_ASSIGN_(SetArgumentPointeeAction);
+};
+
+// Implements the InvokeWithoutArgs(f) action.  The template argument
+// FunctionImpl is the implementation type of f, which can be either a
+// function pointer or a functor.  InvokeWithoutArgs(f) can be used as an
+// Action<F> as long as f's type is compatible with F (i.e. f can be
+// assigned to a tr1::function<F>).
+template <typename FunctionImpl>
+class InvokeWithoutArgsAction {
+ public:
+  // The c'tor makes a copy of function_impl (either a function
+  // pointer or a functor).
+  explicit InvokeWithoutArgsAction(FunctionImpl function_impl)
+      : function_impl_(function_impl) {}
+
+  // Allows InvokeWithoutArgs(f) to be used as any action whose type is
+  // compatible with f.
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple&) { return function_impl_(); }
+
+ private:
+  FunctionImpl function_impl_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeWithoutArgsAction);
+};
+
+// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
+template <class Class, typename MethodPtr>
+class InvokeMethodWithoutArgsAction {
+ public:
+  InvokeMethodWithoutArgsAction(Class* obj_ptr, MethodPtr method_ptr)
+      : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
+
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple&) const {
+    return (obj_ptr_->*method_ptr_)();
+  }
+
+ private:
+  Class* const obj_ptr_;
+  const MethodPtr method_ptr_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeMethodWithoutArgsAction);
+};
+
+// Implements the IgnoreResult(action) action.
+template <typename A>
+class IgnoreResultAction {
+ public:
+  explicit IgnoreResultAction(const A& action) : action_(action) {}
+
+  template <typename F>
+  operator Action<F>() const {
+    // Assert statement belongs here because this is the best place to verify
+    // conditions on F. It produces the clearest error messages
+    // in most compilers.
+    // Impl really belongs in this scope as a local class but can't
+    // because MSVC produces duplicate symbols in different translation units
+    // in this case. Until MS fixes that bug we put Impl into the class scope
+    // and put the typedef both here (for use in assert statement) and
+    // in the Impl class. But both definitions must be the same.
+    typedef typename internal::Function<F>::Result Result;
+
+    // Asserts at compile time that F returns void.
+    CompileAssertTypesEqual<void, Result>();
+
+    return Action<F>(new Impl<F>(action_));
+  }
+
+ private:
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename internal::Function<F>::Result Result;
+    typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const A& action) : action_(action) {}
+
+    virtual void Perform(const ArgumentTuple& args) {
+      // Performs the action and ignores its result.
+      action_.Perform(args);
+    }
+
+   private:
+    // Type OriginalFunction is the same as F except that its return
+    // type is IgnoredValue.
+    typedef typename internal::Function<F>::MakeResultIgnoredValue
+        OriginalFunction;
+
+    const Action<OriginalFunction> action_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const A action_;
+
+  GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
+};
+
+// A ReferenceWrapper<T> object represents a reference to type T,
+// which can be either const or not.  It can be explicitly converted
+// from, and implicitly converted to, a T&.  Unlike a reference,
+// ReferenceWrapper<T> can be copied and can survive template type
+// inference.  This is used to support by-reference arguments in the
+// InvokeArgument<N>(...) action.  The idea was from "reference
+// wrappers" in tr1, which we don't have in our source tree yet.
+template <typename T>
+class ReferenceWrapper {
+ public:
+  // Constructs a ReferenceWrapper<T> object from a T&.
+  explicit ReferenceWrapper(T& l_value) : pointer_(&l_value) {}  // NOLINT
+
+  // Allows a ReferenceWrapper<T> object to be implicitly converted to
+  // a T&.
+  operator T&() const { return *pointer_; }
+ private:
+  T* pointer_;
+};
+
+// Allows the expression ByRef(x) to be printed as a reference to x.
+template <typename T>
+void PrintTo(const ReferenceWrapper<T>& ref, ::std::ostream* os) {
+  T& value = ref;
+  UniversalPrinter<T&>::Print(value, os);
+}
+
+// Does two actions sequentially.  Used for implementing the DoAll(a1,
+// a2, ...) action.
+template <typename Action1, typename Action2>
+class DoBothAction {
+ public:
+  DoBothAction(Action1 action1, Action2 action2)
+      : action1_(action1), action2_(action2) {}
+
+  // This template type conversion operator allows DoAll(a1, ..., a_n)
+  // to be used in ANY function of compatible type.
+  template <typename F>
+  operator Action<F>() const {
+    return Action<F>(new Impl<F>(action1_, action2_));
+  }
+
+ private:
+  // Implements the DoAll(...) action for a particular function type F.
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+    typedef typename Function<F>::MakeResultVoid VoidResult;
+
+    Impl(const Action<VoidResult>& action1, const Action<F>& action2)
+        : action1_(action1), action2_(action2) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      action1_.Perform(args);
+      return action2_.Perform(args);
+    }
+
+   private:
+    const Action<VoidResult> action1_;
+    const Action<F> action2_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  Action1 action1_;
+  Action2 action2_;
+
+  GTEST_DISALLOW_ASSIGN_(DoBothAction);
+};
+
+}  // namespace internal
+
+// An Unused object can be implicitly constructed from ANY value.
+// This is handy when defining actions that ignore some or all of the
+// mock function arguments.  For example, given
+//
+//   MOCK_METHOD3(Foo, double(const string& label, double x, double y));
+//   MOCK_METHOD3(Bar, double(int index, double x, double y));
+//
+// instead of
+//
+//   double DistanceToOriginWithLabel(const string& label, double x, double y) {
+//     return sqrt(x*x + y*y);
+//   }
+//   double DistanceToOriginWithIndex(int index, double x, double y) {
+//     return sqrt(x*x + y*y);
+//   }
+//   ...
+//   EXEPCT_CALL(mock, Foo("abc", _, _))
+//       .WillOnce(Invoke(DistanceToOriginWithLabel));
+//   EXEPCT_CALL(mock, Bar(5, _, _))
+//       .WillOnce(Invoke(DistanceToOriginWithIndex));
+//
+// you could write
+//
+//   // We can declare any uninteresting argument as Unused.
+//   double DistanceToOrigin(Unused, double x, double y) {
+//     return sqrt(x*x + y*y);
+//   }
+//   ...
+//   EXEPCT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));
+//   EXEPCT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));
+typedef internal::IgnoredValue Unused;
+
+// This constructor allows us to turn an Action<From> object into an
+// Action<To>, as long as To's arguments can be implicitly converted
+// to From's and From's return type cann be implicitly converted to
+// To's.
+template <typename To>
+template <typename From>
+Action<To>::Action(const Action<From>& from)
+    : impl_(new internal::ActionAdaptor<To, From>(from)) {}
+
+// Creates an action that returns 'value'.  'value' is passed by value
+// instead of const reference - otherwise Return("string literal")
+// will trigger a compiler error about using array as initializer.
+template <typename R>
+internal::ReturnAction<R> Return(R value) {
+  return internal::ReturnAction<R>(internal::move(value));
+}
+
+// Creates an action that returns NULL.
+inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {
+  return MakePolymorphicAction(internal::ReturnNullAction());
+}
+
+// Creates an action that returns from a void function.
+inline PolymorphicAction<internal::ReturnVoidAction> Return() {
+  return MakePolymorphicAction(internal::ReturnVoidAction());
+}
+
+// Creates an action that returns the reference to a variable.
+template <typename R>
+inline internal::ReturnRefAction<R> ReturnRef(R& x) {  // NOLINT
+  return internal::ReturnRefAction<R>(x);
+}
+
+// Creates an action that returns the reference to a copy of the
+// argument.  The copy is created when the action is constructed and
+// lives as long as the action.
+template <typename R>
+inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
+  return internal::ReturnRefOfCopyAction<R>(x);
+}
+
+// Modifies the parent action (a Return() action) to perform a move of the
+// argument instead of a copy.
+// Return(ByMove()) actions can only be executed once and will assert this
+// invariant.
+template <typename R>
+internal::ByMoveWrapper<R> ByMove(R x) {
+  return internal::ByMoveWrapper<R>(internal::move(x));
+}
+
+// Creates an action that does the default action for the give mock function.
+inline internal::DoDefaultAction DoDefault() {
+  return internal::DoDefaultAction();
+}
+
+// Creates an action that sets the variable pointed by the N-th
+// (0-based) function argument to 'value'.
+template <size_t N, typename T>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<
+    N, T, internal::IsAProtocolMessage<T>::value> >
+SetArgPointee(const T& x) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, T, internal::IsAProtocolMessage<T>::value>(x));
+}
+
+#if !((GTEST_GCC_VER_ && GTEST_GCC_VER_ < 40000) || GTEST_OS_SYMBIAN)
+// This overload allows SetArgPointee() to accept a string literal.
+// GCC prior to the version 4.0 and Symbian C++ compiler cannot distinguish
+// this overload from the templated version and emit a compile error.
+template <size_t N>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<N, const char*, false> >
+SetArgPointee(const char* p) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, const char*, false>(p));
+}
+
+template <size_t N>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<N, const wchar_t*, false> >
+SetArgPointee(const wchar_t* p) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, const wchar_t*, false>(p));
+}
+#endif
+
+// The following version is DEPRECATED.
+template <size_t N, typename T>
+PolymorphicAction<
+  internal::SetArgumentPointeeAction<
+    N, T, internal::IsAProtocolMessage<T>::value> >
+SetArgumentPointee(const T& x) {
+  return MakePolymorphicAction(internal::SetArgumentPointeeAction<
+      N, T, internal::IsAProtocolMessage<T>::value>(x));
+}
+
+// Creates an action that sets a pointer referent to a given value.
+template <typename T1, typename T2>
+PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
+  return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
+}
+
+#if !GTEST_OS_WINDOWS_MOBILE
+
+// Creates an action that sets errno and returns the appropriate error.
+template <typename T>
+PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
+SetErrnoAndReturn(int errval, T result) {
+  return MakePolymorphicAction(
+      internal::SetErrnoAndReturnAction<T>(errval, result));
+}
+
+#endif  // !GTEST_OS_WINDOWS_MOBILE
+
+// Various overloads for InvokeWithoutArgs().
+
+// Creates an action that invokes 'function_impl' with no argument.
+template <typename FunctionImpl>
+PolymorphicAction<internal::InvokeWithoutArgsAction<FunctionImpl> >
+InvokeWithoutArgs(FunctionImpl function_impl) {
+  return MakePolymorphicAction(
+      internal::InvokeWithoutArgsAction<FunctionImpl>(function_impl));
+}
+
+// Creates an action that invokes the given method on the given object
+// with no argument.
+template <class Class, typename MethodPtr>
+PolymorphicAction<internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> >
+InvokeWithoutArgs(Class* obj_ptr, MethodPtr method_ptr) {
+  return MakePolymorphicAction(
+      internal::InvokeMethodWithoutArgsAction<Class, MethodPtr>(
+          obj_ptr, method_ptr));
+}
+
+// Creates an action that performs an_action and throws away its
+// result.  In other words, it changes the return type of an_action to
+// void.  an_action MUST NOT return void, or the code won't compile.
+template <typename A>
+inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {
+  return internal::IgnoreResultAction<A>(an_action);
+}
+
+// Creates a reference wrapper for the given L-value.  If necessary,
+// you can explicitly specify the type of the reference.  For example,
+// suppose 'derived' is an object of type Derived, ByRef(derived)
+// would wrap a Derived&.  If you want to wrap a const Base& instead,
+// where Base is a base class of Derived, just write:
+//
+//   ByRef<const Base>(derived)
+template <typename T>
+inline internal::ReferenceWrapper<T> ByRef(T& l_value) {  // NOLINT
+  return internal::ReferenceWrapper<T>(l_value);
+}
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-cardinalities.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-cardinalities.h
new file mode 100644
index 0000000..fc315f9
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-cardinalities.h
@@ -0,0 +1,147 @@
+// 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 cardinalities.  More
+// cardinalities can be defined by the user implementing the
+// CardinalityInterface interface if necessary.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
+
+#include <limits.h>
+#include <ostream>  // NOLINT
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+
+// To implement a cardinality Foo, define:
+//   1. a class FooCardinality that implements the
+//      CardinalityInterface interface, and
+//   2. a factory function that creates a Cardinality object from a
+//      const FooCardinality*.
+//
+// The two-level delegation design follows that of Matcher, providing
+// consistency for extension developers.  It also eases ownership
+// management as Cardinality objects can now be copied like plain values.
+
+// The implementation of a cardinality.
+class CardinalityInterface {
+ public:
+  virtual ~CardinalityInterface() {}
+
+  // Conservative estimate on the lower/upper bound of the number of
+  // calls allowed.
+  virtual int ConservativeLowerBound() const { return 0; }
+  virtual int ConservativeUpperBound() const { return INT_MAX; }
+
+  // Returns true iff call_count calls will satisfy this cardinality.
+  virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
+
+  // Returns true iff call_count calls will saturate this cardinality.
+  virtual bool IsSaturatedByCallCount(int call_count) const = 0;
+
+  // Describes self to an ostream.
+  virtual void DescribeTo(::std::ostream* os) const = 0;
+};
+
+// A Cardinality is a copyable and IMMUTABLE (except by assignment)
+// object that specifies how many times a mock function is expected to
+// be called.  The implementation of Cardinality is just a linked_ptr
+// to const CardinalityInterface, so copying is fairly cheap.
+// Don't inherit from Cardinality!
+class GTEST_API_ Cardinality {
+ public:
+  // Constructs a null cardinality.  Needed for storing Cardinality
+  // objects in STL containers.
+  Cardinality() {}
+
+  // Constructs a Cardinality from its implementation.
+  explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
+
+  // Conservative estimate on the lower/upper bound of the number of
+  // calls allowed.
+  int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
+  int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
+
+  // Returns true iff call_count calls will satisfy this cardinality.
+  bool IsSatisfiedByCallCount(int call_count) const {
+    return impl_->IsSatisfiedByCallCount(call_count);
+  }
+
+  // Returns true iff call_count calls will saturate this cardinality.
+  bool IsSaturatedByCallCount(int call_count) const {
+    return impl_->IsSaturatedByCallCount(call_count);
+  }
+
+  // Returns true iff call_count calls will over-saturate this
+  // cardinality, i.e. exceed the maximum number of allowed calls.
+  bool IsOverSaturatedByCallCount(int call_count) const {
+    return impl_->IsSaturatedByCallCount(call_count) &&
+        !impl_->IsSatisfiedByCallCount(call_count);
+  }
+
+  // Describes self to an ostream
+  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
+
+  // Describes the given actual call count to an ostream.
+  static void DescribeActualCallCountTo(int actual_call_count,
+                                        ::std::ostream* os);
+
+ private:
+  internal::linked_ptr<const CardinalityInterface> impl_;
+};
+
+// Creates a cardinality that allows at least n calls.
+GTEST_API_ Cardinality AtLeast(int n);
+
+// Creates a cardinality that allows at most n calls.
+GTEST_API_ Cardinality AtMost(int n);
+
+// Creates a cardinality that allows any number of calls.
+GTEST_API_ Cardinality AnyNumber();
+
+// Creates a cardinality that allows between min and max calls.
+GTEST_API_ Cardinality Between(int min, int max);
+
+// Creates a cardinality that allows exactly n calls.
+GTEST_API_ Cardinality Exactly(int n);
+
+// Creates a cardinality from its implementation.
+inline Cardinality MakeCardinality(const CardinalityInterface* c) {
+  return Cardinality(c);
+}
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-actions.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-actions.h
new file mode 100644
index 0000000..b5a889c
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-actions.h
@@ -0,0 +1,2377 @@
+// This file was GENERATED by a script.  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 implements some commonly used variadic actions.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+
+#include "gmock/gmock-actions.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+namespace internal {
+
+// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
+// function or method with the unpacked values, where F is a function
+// type that takes N arguments.
+template <typename Result, typename ArgumentTuple>
+class InvokeHelper;
+
+template <typename R>
+class InvokeHelper<R, ::testing::tuple<> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<>&) {
+           return function();
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<>&) {
+           return (obj_ptr->*method_ptr)();
+  }
+};
+
+template <typename R, typename A1>
+class InvokeHelper<R, ::testing::tuple<A1> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1>& args) {
+           return function(get<0>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2>
+class InvokeHelper<R, ::testing::tuple<A1, A2> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) {
+           return function(get<0>(args), get<1>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3,
+      A4>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4,
+      A5>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6,
+                            A7>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
+                            A8>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8, A9>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args), get<8>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+                            A9>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args), get<8>(args));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9,
+    typename A10>
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+    A10> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8, A9, A10>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args), get<8>(args), get<9>(args));
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+                            A9, A10>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args), get<8>(args), get<9>(args));
+  }
+};
+
+// An INTERNAL macro for extracting the type of a tuple field.  It's
+// subject to change without notice - DO NOT USE IN USER CODE!
+#define GMOCK_FIELD_(Tuple, N) \
+    typename ::testing::tuple_element<N, Tuple>::type
+
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
+// type of an n-ary function whose i-th (1-based) argument type is the
+// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
+// type, and whose return type is Result.  For example,
+//   SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
+// is int(bool, long).
+//
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
+// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
+// For example,
+//   SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
+//       ::testing::make_tuple(true, 'a', 2.5))
+// returns tuple (2.5, true).
+//
+// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
+// in the range [0, 10].  Duplicates are allowed and they don't have
+// to be in an ascending or descending order.
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7, int k8, int k9, int k10>
+class SelectArgs {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
+      GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9),
+      GMOCK_FIELD_(ArgumentTuple, k10));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
+        get<k8>(args), get<k9>(args), get<k10>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple>
+class SelectArgs<Result, ArgumentTuple,
+                 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type();
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& /* args */) {
+    return SelectedArgs();
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, -1, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, -1, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, k7, -1, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7, int k8>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, k7, k8, -1, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
+      GMOCK_FIELD_(ArgumentTuple, k8));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
+        get<k8>(args));
+  }
+};
+
+template <typename Result, typename ArgumentTuple, int k1, int k2, int k3,
+    int k4, int k5, int k6, int k7, int k8, int k9>
+class SelectArgs<Result, ArgumentTuple,
+                 k1, k2, k3, k4, k5, k6, k7, k8, k9, -1> {
+ public:
+  typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1),
+      GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3),
+      GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5),
+      GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7),
+      GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
+        get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
+        get<k8>(args), get<k9>(args));
+  }
+};
+
+#undef GMOCK_FIELD_
+
+// Implements the WithArgs action.
+template <typename InnerAction, int k1 = -1, int k2 = -1, int k3 = -1,
+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
+    int k9 = -1, int k10 = -1>
+class WithArgsAction {
+ public:
+  explicit WithArgsAction(const InnerAction& action) : action_(action) {}
+
+  template <typename F>
+  operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
+
+ private:
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const InnerAction& action) : action_(action) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      return action_.Perform(SelectArgs<Result, ArgumentTuple, k1, k2, k3, k4,
+          k5, k6, k7, k8, k9, k10>::Select(args));
+    }
+
+   private:
+    typedef typename SelectArgs<Result, ArgumentTuple,
+        k1, k2, k3, k4, k5, k6, k7, k8, k9, k10>::type InnerFunctionType;
+
+    Action<InnerFunctionType> action_;
+  };
+
+  const InnerAction action_;
+
+  GTEST_DISALLOW_ASSIGN_(WithArgsAction);
+};
+
+// A macro from the ACTION* family (defined later in this file)
+// defines an action that can be used in a mock function.  Typically,
+// these actions only care about a subset of the arguments of the mock
+// function.  For example, if such an action only uses the second
+// argument, it can be used in any mock function that takes >= 2
+// arguments where the type of the second argument is compatible.
+//
+// Therefore, the action implementation must be prepared to take more
+// arguments than it needs.  The ExcessiveArg type is used to
+// represent those excessive arguments.  In order to keep the compiler
+// error messages tractable, we define it in the testing namespace
+// instead of testing::internal.  However, this is an INTERNAL TYPE
+// and subject to change without notice, so a user MUST NOT USE THIS
+// TYPE DIRECTLY.
+struct ExcessiveArg {};
+
+// A helper class needed for implementing the ACTION* macros.
+template <typename Result, class Impl>
+class ActionHelper {
+ public:
+  static Result Perform(Impl* impl, const ::testing::tuple<>& args) {
+    return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) {
+    return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) {
+    return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
+        get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
+        get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2,
+      A3>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
+        get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3,
+      A4>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
+        ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
+        get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
+        get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
+        get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6, typename A7>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6, A7>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
+        A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6, typename A7, typename A8>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6, A7, A8>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
+        A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
+        ExcessiveArg());
+  }
+
+  template <typename A0, typename A1, typename A2, typename A3, typename A4,
+      typename A5, typename A6, typename A7, typename A8, typename A9>
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
+      A5, A6, A7, A8, A9>& args) {
+    return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
+        A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
+        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
+        get<9>(args));
+  }
+};
+
+}  // namespace internal
+
+// Various overloads for Invoke().
+
+// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
+// the selected arguments of the mock function to an_action and
+// performs it.  It serves as an adaptor between actions with
+// different argument lists.  C++ doesn't support default arguments for
+// function templates, so we have to overload it.
+template <int k1, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1>(action);
+}
+
+template <int k1, int k2, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2>(action);
+}
+
+template <int k1, int k2, int k3, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3>(action);
+}
+
+template <int k1, int k2, int k3, int k4, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
+    typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6,
+      k7>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7,
+      k8>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8, k9>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9>(action);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, int k10, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
+    k9, k10>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9, k10>(action);
+}
+
+// Creates an action that does actions a1, a2, ..., sequentially in
+// each invocation.
+template <typename Action1, typename Action2>
+inline internal::DoBothAction<Action1, Action2>
+DoAll(Action1 a1, Action2 a2) {
+  return internal::DoBothAction<Action1, Action2>(a1, a2);
+}
+
+template <typename Action1, typename Action2, typename Action3>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    Action3> >
+DoAll(Action1 a1, Action2 a2, Action3 a3) {
+  return DoAll(a1, DoAll(a2, a3));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, Action4> > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4) {
+  return DoAll(a1, DoAll(a2, a3, a4));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    Action5> > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, Action6> > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    Action7> > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7,
+    typename Action8>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    internal::DoBothAction<Action7, Action8> > > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7, Action8 a8) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7,
+    typename Action8, typename Action9>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    internal::DoBothAction<Action7, internal::DoBothAction<Action8,
+    Action9> > > > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7, Action8 a8, Action9 a9) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template <typename Action1, typename Action2, typename Action3,
+    typename Action4, typename Action5, typename Action6, typename Action7,
+    typename Action8, typename Action9, typename Action10>
+inline internal::DoBothAction<Action1, internal::DoBothAction<Action2,
+    internal::DoBothAction<Action3, internal::DoBothAction<Action4,
+    internal::DoBothAction<Action5, internal::DoBothAction<Action6,
+    internal::DoBothAction<Action7, internal::DoBothAction<Action8,
+    internal::DoBothAction<Action9, Action10> > > > > > > > >
+DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
+    Action7 a7, Action8 a8, Action9 a9, Action10 a10) {
+  return DoAll(a1, DoAll(a2, a3, a4, a5, a6, a7, a8, a9, a10));
+}
+
+}  // namespace testing
+
+// The ACTION* family of macros can be used in a namespace scope to
+// define custom actions easily.  The syntax:
+//
+//   ACTION(name) { statements; }
+//
+// will define an action with the given name that executes the
+// statements.  The value returned by the statements will be used as
+// the return value of the action.  Inside the statements, you can
+// refer to the K-th (0-based) argument of the mock function by
+// 'argK', and refer to its type by 'argK_type'.  For example:
+//
+//   ACTION(IncrementArg1) {
+//     arg1_type temp = arg1;
+//     return ++(*temp);
+//   }
+//
+// allows you to write
+//
+//   ...WillOnce(IncrementArg1());
+//
+// You can also refer to the entire argument tuple and its type by
+// 'args' and 'args_type', and refer to the mock function type and its
+// return type by 'function_type' and 'return_type'.
+//
+// Note that you don't need to specify the types of the mock function
+// arguments.  However rest assured that your code is still type-safe:
+// you'll get a compiler error if *arg1 doesn't support the ++
+// operator, or if the type of ++(*arg1) isn't compatible with the
+// mock function's return type, for example.
+//
+// Sometimes you'll want to parameterize the action.   For that you can use
+// another macro:
+//
+//   ACTION_P(name, param_name) { statements; }
+//
+// For example:
+//
+//   ACTION_P(Add, n) { return arg0 + n; }
+//
+// will allow you to write:
+//
+//   ...WillOnce(Add(5));
+//
+// Note that you don't need to provide the type of the parameter
+// either.  If you need to reference the type of a parameter named
+// 'foo', you can write 'foo_type'.  For example, in the body of
+// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
+// of 'n'.
+//
+// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
+// multi-parameter actions.
+//
+// For the purpose of typing, you can view
+//
+//   ACTION_Pk(Foo, p1, ..., pk) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// In particular, you can provide the template type arguments
+// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
+// although usually you can rely on the compiler to infer the types
+// for you automatically.  You can assign the result of expression
+// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
+// pk_type>.  This can be useful when composing actions.
+//
+// You can also overload actions with different numbers of parameters:
+//
+//   ACTION_P(Plus, a) { ... }
+//   ACTION_P2(Plus, a, b) { ... }
+//
+// While it's tempting to always use the ACTION* macros when defining
+// a new action, you should also consider implementing ActionInterface
+// or using MakePolymorphicAction() instead, especially if you need to
+// use the action a lot.  While these approaches require more work,
+// they give you more control on the types of the mock function
+// arguments and the action parameters, which in general leads to
+// better compiler error messages that pay off in the long run.  They
+// also allow overloading actions based on parameter types (as opposed
+// to just based on the number of parameters).
+//
+// CAVEAT:
+//
+// ACTION*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using ACTION*() inside
+// a function.
+//
+// MORE INFORMATION:
+//
+// To learn more about using these macros, please search for 'ACTION'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+// An internal macro needed for implementing ACTION*().
+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
+    const args_type& args GTEST_ATTRIBUTE_UNUSED_, \
+    arg0_type arg0 GTEST_ATTRIBUTE_UNUSED_, \
+    arg1_type arg1 GTEST_ATTRIBUTE_UNUSED_, \
+    arg2_type arg2 GTEST_ATTRIBUTE_UNUSED_, \
+    arg3_type arg3 GTEST_ATTRIBUTE_UNUSED_, \
+    arg4_type arg4 GTEST_ATTRIBUTE_UNUSED_, \
+    arg5_type arg5 GTEST_ATTRIBUTE_UNUSED_, \
+    arg6_type arg6 GTEST_ATTRIBUTE_UNUSED_, \
+    arg7_type arg7 GTEST_ATTRIBUTE_UNUSED_, \
+    arg8_type arg8 GTEST_ATTRIBUTE_UNUSED_, \
+    arg9_type arg9 GTEST_ATTRIBUTE_UNUSED_
+
+// Sometimes you want to give an action explicit template parameters
+// that cannot be inferred from its value parameters.  ACTION() and
+// ACTION_P*() don't support that.  ACTION_TEMPLATE() remedies that
+// and can be viewed as an extension to ACTION() and ACTION_P*().
+//
+// The syntax:
+//
+//   ACTION_TEMPLATE(ActionName,
+//                   HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
+//                   AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
+//
+// defines an action template that takes m explicit template
+// parameters and n value parameters.  name_i is the name of the i-th
+// template parameter, and kind_i specifies whether it's a typename,
+// an integral constant, or a template.  p_i is the name of the i-th
+// value parameter.
+//
+// Example:
+//
+//   // DuplicateArg<k, T>(output) converts the k-th argument of the mock
+//   // function to type T and copies it to *output.
+//   ACTION_TEMPLATE(DuplicateArg,
+//                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
+//                   AND_1_VALUE_PARAMS(output)) {
+//     *output = T(::testing::get<k>(args));
+//   }
+//   ...
+//     int n;
+//     EXPECT_CALL(mock, Foo(_, _))
+//         .WillOnce(DuplicateArg<1, unsigned char>(&n));
+//
+// To create an instance of an action template, write:
+//
+//   ActionName<t1, ..., t_m>(v1, ..., v_n)
+//
+// where the ts are the template arguments and the vs are the value
+// arguments.  The value argument types are inferred by the compiler.
+// If you want to explicitly specify the value argument types, you can
+// provide additional template arguments:
+//
+//   ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
+//
+// where u_i is the desired type of v_i.
+//
+// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
+// number of value parameters, but not on the number of template
+// parameters.  Without the restriction, the meaning of the following
+// is unclear:
+//
+//   OverloadedAction<int, bool>(x);
+//
+// Are we using a single-template-parameter action where 'bool' refers
+// to the type of x, or are we using a two-template-parameter action
+// where the compiler is asked to infer the type of x?
+//
+// Implementation notes:
+//
+// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
+// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
+// implementing ACTION_TEMPLATE.  The main trick we use is to create
+// new macro invocations when expanding a macro.  For example, we have
+//
+//   #define ACTION_TEMPLATE(name, template_params, value_params)
+//       ... GMOCK_INTERNAL_DECL_##template_params ...
+//
+// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
+// to expand to
+//
+//       ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
+//
+// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
+// preprocessor will continue to expand it to
+//
+//       ... typename T ...
+//
+// This technique conforms to the C++ standard and is portable.  It
+// allows us to implement action templates using O(N) code, where N is
+// the maximum number of template/value parameters supported.  Without
+// using it, we'd have to devote O(N^2) amount of code to implement all
+// combinations of m and n.
+
+// Declares the template parameters.
+#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
+#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1) kind0 name0, kind1 name1
+#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2) kind0 name0, kind1 name1, kind2 name2
+#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
+    kind3 name3
+#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
+    kind2 name2, kind3 name3, kind4 name4
+#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
+    kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
+#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
+    kind5 name5, kind6 name6
+#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
+    kind4 name4, kind5 name5, kind6 name6, kind7 name7
+#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
+    kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
+    kind8 name8
+#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
+    kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
+    kind6 name6, kind7 name7, kind8 name8, kind9 name9
+
+// Lists the template parameters.
+#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
+#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1) name0, name1
+#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2) name0, name1, name2
+#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3) name0, name1, name2, name3
+#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
+    name4
+#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
+    name2, name3, name4, name5
+#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6) name0, name1, name2, name3, name4, name5, name6
+#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
+#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
+    kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
+    kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
+    name6, name7, name8
+#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
+    name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
+    name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
+    name3, name4, name5, name6, name7, name8, name9
+
+// Declares the types of value parameters.
+#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
+    typename p0##_type, typename p1##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
+    typename p0##_type, typename p1##_type, typename p2##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
+    typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
+    typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
+    typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type, \
+    typename p6##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type, \
+    typename p6##_type, typename p7##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
+    typename p3##_type, typename p4##_type, typename p5##_type, \
+    typename p6##_type, typename p7##_type, typename p8##_type
+#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
+    typename p2##_type, typename p3##_type, typename p4##_type, \
+    typename p5##_type, typename p6##_type, typename p7##_type, \
+    typename p8##_type, typename p9##_type
+
+// Initializes the value parameters.
+#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
+    ()
+#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
+    (p0##_type gmock_p0) : p0(gmock_p0)
+#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
+    (p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), p1(gmock_p1)
+#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2)
+#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3)
+#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4)
+#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5)
+#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6)
+#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7)
+#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8)
+#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9)\
+    (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+        p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+        p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
+        p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8), p9(gmock_p9)
+
+// Declares the fields for storing the value parameters.
+#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
+#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
+    p1##_type p1;
+#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
+    p1##_type p1; p2##_type p2;
+#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
+    p1##_type p1; p2##_type p2; p3##_type p3;
+#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
+    p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
+#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
+    p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
+    p5##_type p5;
+#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
+    p5##_type p5; p6##_type p6;
+#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
+    p5##_type p5; p6##_type p6; p7##_type p7;
+#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
+    p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
+#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
+    p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
+    p9##_type p9;
+
+// Lists the value parameters.
+#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
+#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
+#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
+#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
+#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
+    p2, p3, p4
+#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
+    p1, p2, p3, p4, p5
+#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) p0, p1, p2, p3, p4, p5, p6
+#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) p0, p1, p2, p3, p4, p5, p6, p7
+#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
+#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
+
+// Lists the value parameter types.
+#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
+    p1##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
+    p1##_type, p2##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
+    p0##_type, p1##_type, p2##_type, p3##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
+    p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
+    p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
+    p6##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+    p5##_type, p6##_type, p7##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+    p5##_type, p6##_type, p7##_type, p8##_type
+#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+    p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
+
+// Declares the value parameters.
+#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
+#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
+    p1##_type p1
+#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
+    p1##_type p1, p2##_type p2
+#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
+    p1##_type p1, p2##_type p2, p3##_type p3
+#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
+    p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
+#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
+    p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
+    p5##_type p5
+#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
+    p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
+    p5##_type p5, p6##_type p6
+#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
+    p5##_type p5, p6##_type p6, p7##_type p7
+#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+    p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
+#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+    p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
+    p9##_type p9
+
+// The suffix of the class template implementing the action template.
+#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
+#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
+#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
+#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
+#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
+#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
+#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
+#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
+#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7) P8
+#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8) P9
+#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
+    p7, p8, p9) P10
+
+// The name of the class template implementing the action template.
+#define GMOCK_ACTION_CLASS_(name, value_params)\
+    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
+
+#define ACTION_TEMPLATE(name, template_params, value_params)\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  class GMOCK_ACTION_CLASS_(name, value_params) {\
+   public:\
+    explicit GMOCK_ACTION_CLASS_(name, value_params)\
+        GMOCK_INTERNAL_INIT_##value_params {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      GMOCK_INTERNAL_DEFN_##value_params\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(\
+          new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
+    }\
+    GMOCK_INTERNAL_DEFN_##value_params\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
+  };\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  inline GMOCK_ACTION_CLASS_(name, value_params)<\
+      GMOCK_INTERNAL_LIST_##template_params\
+      GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
+          GMOCK_INTERNAL_DECL_##value_params) {\
+    return GMOCK_ACTION_CLASS_(name, value_params)<\
+        GMOCK_INTERNAL_LIST_##template_params\
+        GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
+            GMOCK_INTERNAL_LIST_##value_params);\
+  }\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      GMOCK_ACTION_CLASS_(name, value_params)<\
+          GMOCK_INTERNAL_LIST_##template_params\
+          GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
+              gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION(name)\
+  class name##Action {\
+   public:\
+    name##Action() {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl() {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>());\
+    }\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##Action);\
+  };\
+  inline name##Action name() {\
+    return name##Action();\
+  }\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##Action::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P(name, p0)\
+  template <typename p0##_type>\
+  class name##ActionP {\
+   public:\
+    explicit name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      explicit gmock_Impl(p0##_type gmock_p0) : p0(gmock_p0) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0));\
+    }\
+    p0##_type p0;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP);\
+  };\
+  template <typename p0##_type>\
+  inline name##ActionP<p0##_type> name(p0##_type p0) {\
+    return name##ActionP<p0##_type>(p0);\
+  }\
+  template <typename p0##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP<p0##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P2(name, p0, p1)\
+  template <typename p0##_type, typename p1##_type>\
+  class name##ActionP2 {\
+   public:\
+    name##ActionP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
+        p1(gmock_p1) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
+          p1(gmock_p1) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP2);\
+  };\
+  template <typename p0##_type, typename p1##_type>\
+  inline name##ActionP2<p0##_type, p1##_type> name(p0##_type p0, \
+      p1##_type p1) {\
+    return name##ActionP2<p0##_type, p1##_type>(p0, p1);\
+  }\
+  template <typename p0##_type, typename p1##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP2<p0##_type, p1##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P3(name, p0, p1, p2)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  class name##ActionP3 {\
+   public:\
+    name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \
+          p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP3);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  inline name##ActionP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2) {\
+    return name##ActionP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP3<p0##_type, p1##_type, \
+          p2##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P4(name, p0, p1, p2, p3)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  class name##ActionP4 {\
+   public:\
+    name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP4);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  inline name##ActionP4<p0##_type, p1##_type, p2##_type, \
+      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3) {\
+    return name##ActionP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, p1, \
+        p2, p3);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP4<p0##_type, p1##_type, p2##_type, \
+          p3##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P5(name, p0, p1, p2, p3, p4)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  class name##ActionP5 {\
+   public:\
+    name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, \
+        p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4) : p0(gmock_p0), \
+          p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP5);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  inline name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4) {\
+    return name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type>(p0, p1, p2, p3, p4);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+          p4##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P6(name, p0, p1, p2, p3, p4, p5)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  class name##ActionP6 {\
+   public:\
+    name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, \
+          p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP6);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  inline name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3, p4##_type p4, p5##_type p5) {\
+    return name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P7(name, p0, p1, p2, p3, p4, p5, p6)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  class name##ActionP7 {\
+   public:\
+    name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
+        p6(gmock_p6) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP7);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  inline name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
+      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6) {\
+    return name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P8(name, p0, p1, p2, p3, p4, p5, p6, p7)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  class name##ActionP8 {\
+   public:\
+    name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, \
+        p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7) : p0(gmock_p0), \
+          p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), \
+          p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6, p7));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP8);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  inline name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6, p7##_type p7) {\
+    return name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
+        p6, p7);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type, \
+          p7##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  class name##ActionP9 {\
+   public:\
+    name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, \
+          p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+          p7(gmock_p7), p8(gmock_p8) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6, p7, p8));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP9);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  inline name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, \
+      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
+      p8##_type p8) {\
+    return name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
+        p3, p4, p5, p6, p7, p8);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type, p7##_type, \
+          p8##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+#define ACTION_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  class name##ActionP10 {\
+   public:\
+    name##ActionP10(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
+          p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+          p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+          p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <typename arg0_type, typename arg1_type, typename arg2_type, \
+          typename arg3_type, typename arg4_type, typename arg5_type, \
+          typename arg6_type, typename arg7_type, typename arg8_type, \
+          typename arg9_type>\
+      return_type gmock_PerformImpl(const args_type& args, arg0_type arg0, \
+          arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4, \
+          arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
+          arg9_type arg9) const;\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+      p9##_type p9;\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>(p0, p1, p2, p3, p4, p5, \
+          p6, p7, p8, p9));\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+    p9##_type p9;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##ActionP10);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  inline name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
+      p9##_type p9) {\
+    return name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
+        p1, p2, p3, p4, p5, p6, p7, p8, p9);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      name##ActionP10<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+          p5##_type, p6##_type, p7##_type, p8##_type, \
+          p9##_type>::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+namespace testing {
+
+
+// The ACTION*() macros trigger warning C4100 (unreferenced formal
+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
+// the macro definition, as the warnings are generated when the macro
+// is expanded and macro expansion cannot contain #pragma.  Therefore
+// we suppress them here.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4100)
+#endif
+
+// Various overloads for InvokeArgument<N>().
+//
+// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
+// (0-based) argument, which must be a k-ary callable, of the mock
+// function, with arguments a1, a2, ..., a_k.
+//
+// Notes:
+//
+//   1. The arguments are passed by value by default.  If you need to
+//   pass an argument by reference, wrap it inside ByRef().  For
+//   example,
+//
+//     InvokeArgument<1>(5, string("Hello"), ByRef(foo))
+//
+//   passes 5 and string("Hello") by value, and passes foo by
+//   reference.
+//
+//   2. If the callable takes an argument by reference but ByRef() is
+//   not used, it will receive the reference to a copy of the value,
+//   instead of the original value.  For example, when the 0-th
+//   argument of the mock function takes a const string&, the action
+//
+//     InvokeArgument<0>(string("Hello"))
+//
+//   makes a copy of the temporary string("Hello") object and passes a
+//   reference of the copy, instead of the original temporary object,
+//   to the callable.  This makes it easy for a user to define an
+//   InvokeArgument action from temporary values and have it performed
+//   later.
+
+namespace internal {
+namespace invoke_argument {
+
+// Appears in InvokeArgumentAdl's argument list to help avoid
+// accidental calls to user functions of the same name.
+struct AdlTag {};
+
+// InvokeArgumentAdl - a helper for InvokeArgument.
+// The basic overloads are provided here for generic functors.
+// Overloads for other custom-callables are provided in the
+// internal/custom/callback-actions.h header.
+
+template <typename R, typename F>
+R InvokeArgumentAdl(AdlTag, F f) {
+  return f();
+}
+template <typename R, typename F, typename A1>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
+  return f(a1);
+}
+template <typename R, typename F, typename A1, typename A2>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
+  return f(a1, a2);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
+  return f(a1, a2, a3);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
+  return f(a1, a2, a3, a4);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
+  return f(a1, a2, a3, a4, a5);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
+  return f(a1, a2, a3, a4, a5, a6);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7) {
+  return f(a1, a2, a3, a4, a5, a6, a7);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8, A9 a9) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9, typename A10>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8, A9 a9, A10 a10) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+}
+}  // namespace invoke_argument
+}  // namespace internal
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_0_VALUE_PARAMS()) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args));
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(p0)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_2_VALUE_PARAMS(p0, p1)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_3_VALUE_PARAMS(p0, p1, p2)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
+}
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+}
+
+// Various overloads for ReturnNew<T>().
+//
+// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
+// instance of type T, constructed on the heap with constructor arguments
+// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_0_VALUE_PARAMS()) {
+  return new T();
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_1_VALUE_PARAMS(p0)) {
+  return new T(p0);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_2_VALUE_PARAMS(p0, p1)) {
+  return new T(p0, p1);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_3_VALUE_PARAMS(p0, p1, p2)) {
+  return new T(p0, p1, p2);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
+  return new T(p0, p1, p2, p3);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
+  return new T(p0, p1, p2, p3, p4);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
+  return new T(p0, p1, p2, p3, p4, p5);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6, p7);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8);
+}
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
+  return new T(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+}  // namespace testing
+
+// Include any custom actions added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-generated-actions.h"
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-actions.h.pump b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-actions.h.pump
new file mode 100644
index 0000000..66d9f9d
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-actions.h.pump
@@ -0,0 +1,794 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-actions.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+$$}} This meta comment fixes auto-indentation in editors.
+// 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 variadic actions.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
+
+#include "gmock/gmock-actions.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+namespace internal {
+
+// InvokeHelper<F> knows how to unpack an N-tuple and invoke an N-ary
+// function or method with the unpacked values, where F is a function
+// type that takes N arguments.
+template <typename Result, typename ArgumentTuple>
+class InvokeHelper;
+
+
+$range i 0..n
+$for i [[
+$range j 1..i
+$var types = [[$for j [[, typename A$j]]]]
+$var as = [[$for j, [[A$j]]]]
+$var args = [[$if i==0 [[]] $else [[ args]]]]
+$var gets = [[$for j, [[get<$(j - 1)>(args)]]]]
+template <typename R$types>
+class InvokeHelper<R, ::testing::tuple<$as> > {
+ public:
+  template <typename Function>
+  static R Invoke(Function function, const ::testing::tuple<$as>&$args) {
+           return function($gets);
+  }
+
+  template <class Class, typename MethodPtr>
+  static R InvokeMethod(Class* obj_ptr,
+                        MethodPtr method_ptr,
+                        const ::testing::tuple<$as>&$args) {
+           return (obj_ptr->*method_ptr)($gets);
+  }
+};
+
+
+]]
+// An INTERNAL macro for extracting the type of a tuple field.  It's
+// subject to change without notice - DO NOT USE IN USER CODE!
+#define GMOCK_FIELD_(Tuple, N) \
+    typename ::testing::tuple_element<N, Tuple>::type
+
+$range i 1..n
+
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
+// type of an n-ary function whose i-th (1-based) argument type is the
+// k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
+// type, and whose return type is Result.  For example,
+//   SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
+// is int(bool, long).
+//
+// SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
+// returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
+// For example,
+//   SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
+//       ::testing::make_tuple(true, 'a', 2.5))
+// returns tuple (2.5, true).
+//
+// The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
+// in the range [0, $n].  Duplicates are allowed and they don't have
+// to be in an ascending or descending order.
+
+template <typename Result, typename ArgumentTuple, $for i, [[int k$i]]>
+class SelectArgs {
+ public:
+  typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]);
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& args) {
+    return SelectedArgs($for i, [[get<k$i>(args)]]);
+  }
+};
+
+
+$for i [[
+$range j 1..n
+$range j1 1..i-1
+template <typename Result, typename ArgumentTuple$for j1[[, int k$j1]]>
+class SelectArgs<Result, ArgumentTuple,
+                 $for j, [[$if j <= i-1 [[k$j]] $else [[-1]]]]> {
+ public:
+  typedef Result type($for j1, [[GMOCK_FIELD_(ArgumentTuple, k$j1)]]);
+  typedef typename Function<type>::ArgumentTuple SelectedArgs;
+  static SelectedArgs Select(const ArgumentTuple& [[]]
+$if i == 1 [[/* args */]] $else [[args]]) {
+    return SelectedArgs($for j1, [[get<k$j1>(args)]]);
+  }
+};
+
+
+]]
+#undef GMOCK_FIELD_
+
+$var ks = [[$for i, [[k$i]]]]
+
+// Implements the WithArgs action.
+template <typename InnerAction, $for i, [[int k$i = -1]]>
+class WithArgsAction {
+ public:
+  explicit WithArgsAction(const InnerAction& action) : action_(action) {}
+
+  template <typename F>
+  operator Action<F>() const { return MakeAction(new Impl<F>(action_)); }
+
+ private:
+  template <typename F>
+  class Impl : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const InnerAction& action) : action_(action) {}
+
+    virtual Result Perform(const ArgumentTuple& args) {
+      return action_.Perform(SelectArgs<Result, ArgumentTuple, $ks>::Select(args));
+    }
+
+   private:
+    typedef typename SelectArgs<Result, ArgumentTuple,
+        $ks>::type InnerFunctionType;
+
+    Action<InnerFunctionType> action_;
+  };
+
+  const InnerAction action_;
+
+  GTEST_DISALLOW_ASSIGN_(WithArgsAction);
+};
+
+// A macro from the ACTION* family (defined later in this file)
+// defines an action that can be used in a mock function.  Typically,
+// these actions only care about a subset of the arguments of the mock
+// function.  For example, if such an action only uses the second
+// argument, it can be used in any mock function that takes >= 2
+// arguments where the type of the second argument is compatible.
+//
+// Therefore, the action implementation must be prepared to take more
+// arguments than it needs.  The ExcessiveArg type is used to
+// represent those excessive arguments.  In order to keep the compiler
+// error messages tractable, we define it in the testing namespace
+// instead of testing::internal.  However, this is an INTERNAL TYPE
+// and subject to change without notice, so a user MUST NOT USE THIS
+// TYPE DIRECTLY.
+struct ExcessiveArg {};
+
+// A helper class needed for implementing the ACTION* macros.
+template <typename Result, class Impl>
+class ActionHelper {
+ public:
+$range i 0..n
+$for i
+
+[[
+$var template = [[$if i==0 [[]] $else [[
+$range j 0..i-1
+  template <$for j, [[typename A$j]]>
+]]]]
+$range j 0..i-1
+$var As = [[$for j, [[A$j]]]]
+$var as = [[$for j, [[get<$j>(args)]]]]
+$range k 1..n-i
+$var eas = [[$for k, [[ExcessiveArg()]]]]
+$var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]]
+$template
+  static Result Perform(Impl* impl, const ::testing::tuple<$As>& args) {
+    return impl->template gmock_PerformImpl<$As>(args, $arg_list);
+  }
+
+]]
+};
+
+}  // namespace internal
+
+// Various overloads for Invoke().
+
+// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
+// the selected arguments of the mock function to an_action and
+// performs it.  It serves as an adaptor between actions with
+// different argument lists.  C++ doesn't support default arguments for
+// function templates, so we have to overload it.
+
+$range i 1..n
+$for i [[
+$range j 1..i
+template <$for j [[int k$j, ]]typename InnerAction>
+inline internal::WithArgsAction<InnerAction$for j [[, k$j]]>
+WithArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction$for j [[, k$j]]>(action);
+}
+
+
+]]
+// Creates an action that does actions a1, a2, ..., sequentially in
+// each invocation.
+$range i 2..n
+$for i [[
+$range j 2..i
+$var types = [[$for j, [[typename Action$j]]]]
+$var Aas = [[$for j [[, Action$j a$j]]]]
+
+template <typename Action1, $types>
+$range k 1..i-1
+
+inline $for k [[internal::DoBothAction<Action$k, ]]Action$i$for k  [[>]]
+
+DoAll(Action1 a1$Aas) {
+$if i==2 [[
+
+  return internal::DoBothAction<Action1, Action2>(a1, a2);
+]] $else [[
+$range j2 2..i
+
+  return DoAll(a1, DoAll($for j2, [[a$j2]]));
+]]
+
+}
+
+]]
+
+}  // namespace testing
+
+// The ACTION* family of macros can be used in a namespace scope to
+// define custom actions easily.  The syntax:
+//
+//   ACTION(name) { statements; }
+//
+// will define an action with the given name that executes the
+// statements.  The value returned by the statements will be used as
+// the return value of the action.  Inside the statements, you can
+// refer to the K-th (0-based) argument of the mock function by
+// 'argK', and refer to its type by 'argK_type'.  For example:
+//
+//   ACTION(IncrementArg1) {
+//     arg1_type temp = arg1;
+//     return ++(*temp);
+//   }
+//
+// allows you to write
+//
+//   ...WillOnce(IncrementArg1());
+//
+// You can also refer to the entire argument tuple and its type by
+// 'args' and 'args_type', and refer to the mock function type and its
+// return type by 'function_type' and 'return_type'.
+//
+// Note that you don't need to specify the types of the mock function
+// arguments.  However rest assured that your code is still type-safe:
+// you'll get a compiler error if *arg1 doesn't support the ++
+// operator, or if the type of ++(*arg1) isn't compatible with the
+// mock function's return type, for example.
+//
+// Sometimes you'll want to parameterize the action.   For that you can use
+// another macro:
+//
+//   ACTION_P(name, param_name) { statements; }
+//
+// For example:
+//
+//   ACTION_P(Add, n) { return arg0 + n; }
+//
+// will allow you to write:
+//
+//   ...WillOnce(Add(5));
+//
+// Note that you don't need to provide the type of the parameter
+// either.  If you need to reference the type of a parameter named
+// 'foo', you can write 'foo_type'.  For example, in the body of
+// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
+// of 'n'.
+//
+// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P$n to support
+// multi-parameter actions.
+//
+// For the purpose of typing, you can view
+//
+//   ACTION_Pk(Foo, p1, ..., pk) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// In particular, you can provide the template type arguments
+// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
+// although usually you can rely on the compiler to infer the types
+// for you automatically.  You can assign the result of expression
+// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
+// pk_type>.  This can be useful when composing actions.
+//
+// You can also overload actions with different numbers of parameters:
+//
+//   ACTION_P(Plus, a) { ... }
+//   ACTION_P2(Plus, a, b) { ... }
+//
+// While it's tempting to always use the ACTION* macros when defining
+// a new action, you should also consider implementing ActionInterface
+// or using MakePolymorphicAction() instead, especially if you need to
+// use the action a lot.  While these approaches require more work,
+// they give you more control on the types of the mock function
+// arguments and the action parameters, which in general leads to
+// better compiler error messages that pay off in the long run.  They
+// also allow overloading actions based on parameter types (as opposed
+// to just based on the number of parameters).
+//
+// CAVEAT:
+//
+// ACTION*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using ACTION*() inside
+// a function.
+//
+// MORE INFORMATION:
+//
+// To learn more about using these macros, please search for 'ACTION'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+$range i 0..n
+$range k 0..n-1
+
+// An internal macro needed for implementing ACTION*().
+#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\
+    const args_type& args GTEST_ATTRIBUTE_UNUSED_
+$for k [[, \
+    arg$k[[]]_type arg$k GTEST_ATTRIBUTE_UNUSED_]]
+
+
+// Sometimes you want to give an action explicit template parameters
+// that cannot be inferred from its value parameters.  ACTION() and
+// ACTION_P*() don't support that.  ACTION_TEMPLATE() remedies that
+// and can be viewed as an extension to ACTION() and ACTION_P*().
+//
+// The syntax:
+//
+//   ACTION_TEMPLATE(ActionName,
+//                   HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
+//                   AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
+//
+// defines an action template that takes m explicit template
+// parameters and n value parameters.  name_i is the name of the i-th
+// template parameter, and kind_i specifies whether it's a typename,
+// an integral constant, or a template.  p_i is the name of the i-th
+// value parameter.
+//
+// Example:
+//
+//   // DuplicateArg<k, T>(output) converts the k-th argument of the mock
+//   // function to type T and copies it to *output.
+//   ACTION_TEMPLATE(DuplicateArg,
+//                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
+//                   AND_1_VALUE_PARAMS(output)) {
+//     *output = T(::testing::get<k>(args));
+//   }
+//   ...
+//     int n;
+//     EXPECT_CALL(mock, Foo(_, _))
+//         .WillOnce(DuplicateArg<1, unsigned char>(&n));
+//
+// To create an instance of an action template, write:
+//
+//   ActionName<t1, ..., t_m>(v1, ..., v_n)
+//
+// where the ts are the template arguments and the vs are the value
+// arguments.  The value argument types are inferred by the compiler.
+// If you want to explicitly specify the value argument types, you can
+// provide additional template arguments:
+//
+//   ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
+//
+// where u_i is the desired type of v_i.
+//
+// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
+// number of value parameters, but not on the number of template
+// parameters.  Without the restriction, the meaning of the following
+// is unclear:
+//
+//   OverloadedAction<int, bool>(x);
+//
+// Are we using a single-template-parameter action where 'bool' refers
+// to the type of x, or are we using a two-template-parameter action
+// where the compiler is asked to infer the type of x?
+//
+// Implementation notes:
+//
+// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
+// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
+// implementing ACTION_TEMPLATE.  The main trick we use is to create
+// new macro invocations when expanding a macro.  For example, we have
+//
+//   #define ACTION_TEMPLATE(name, template_params, value_params)
+//       ... GMOCK_INTERNAL_DECL_##template_params ...
+//
+// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
+// to expand to
+//
+//       ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
+//
+// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
+// preprocessor will continue to expand it to
+//
+//       ... typename T ...
+//
+// This technique conforms to the C++ standard and is portable.  It
+// allows us to implement action templates using O(N) code, where N is
+// the maximum number of template/value parameters supported.  Without
+// using it, we'd have to devote O(N^2) amount of code to implement all
+// combinations of m and n.
+
+// Declares the template parameters.
+
+$range j 1..n
+$for j [[
+$range m 0..j-1
+#define GMOCK_INTERNAL_DECL_HAS_$j[[]]
+_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[kind$m name$m]]
+
+
+]]
+
+// Lists the template parameters.
+
+$for j [[
+$range m 0..j-1
+#define GMOCK_INTERNAL_LIST_HAS_$j[[]]
+_TEMPLATE_PARAMS($for m, [[kind$m, name$m]]) $for m, [[name$m]]
+
+
+]]
+
+// Declares the types of value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_DECL_TYPE_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]]
+
+
+]]
+
+// Initializes the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\
+    ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(gmock_p$j)]]
+
+
+]]
+
+// Declares the fields for storing the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_DEFN_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j [[p$j##_type p$j; ]]
+
+
+]]
+
+// Lists the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_LIST_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j, [[p$j]]
+
+
+]]
+
+// Lists the value parameter types.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_LIST_TYPE_AND_$i[[]]
+_VALUE_PARAMS($for j, [[p$j]]) $for j [[, p$j##_type]]
+
+
+]]
+
+// Declares the value parameters.
+
+$for i [[
+$range j 0..i-1
+#define GMOCK_INTERNAL_DECL_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]
+$for j, [[p$j##_type p$j]]
+
+
+]]
+
+// The suffix of the class template implementing the action template.
+$for i [[
+
+
+$range j 0..i-1
+#define GMOCK_INTERNAL_COUNT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]]) [[]]
+$if i==1 [[P]] $elif i>=2 [[P$i]]
+]]
+
+
+// The name of the class template implementing the action template.
+#define GMOCK_ACTION_CLASS_(name, value_params)\
+    GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
+
+$range k 0..n-1
+
+#define ACTION_TEMPLATE(name, template_params, value_params)\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  class GMOCK_ACTION_CLASS_(name, value_params) {\
+   public:\
+    explicit GMOCK_ACTION_CLASS_(name, value_params)\
+        GMOCK_INTERNAL_INIT_##value_params {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <$for k, [[typename arg$k[[]]_type]]>\
+      return_type gmock_PerformImpl(const args_type& args[[]]
+$for k [[, arg$k[[]]_type arg$k]]) const;\
+      GMOCK_INTERNAL_DEFN_##value_params\
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(\
+          new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
+    }\
+    GMOCK_INTERNAL_DEFN_##value_params\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
+  };\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  inline GMOCK_ACTION_CLASS_(name, value_params)<\
+      GMOCK_INTERNAL_LIST_##template_params\
+      GMOCK_INTERNAL_LIST_TYPE_##value_params> name(\
+          GMOCK_INTERNAL_DECL_##value_params) {\
+    return GMOCK_ACTION_CLASS_(name, value_params)<\
+        GMOCK_INTERNAL_LIST_##template_params\
+        GMOCK_INTERNAL_LIST_TYPE_##value_params>(\
+            GMOCK_INTERNAL_LIST_##value_params);\
+  }\
+  template <GMOCK_INTERNAL_DECL_##template_params\
+            GMOCK_INTERNAL_DECL_TYPE_##value_params>\
+  template <typename F>\
+  template <typename arg0_type, typename arg1_type, typename arg2_type, \
+      typename arg3_type, typename arg4_type, typename arg5_type, \
+      typename arg6_type, typename arg7_type, typename arg8_type, \
+      typename arg9_type>\
+  typename ::testing::internal::Function<F>::Result\
+      GMOCK_ACTION_CLASS_(name, value_params)<\
+          GMOCK_INTERNAL_LIST_##template_params\
+          GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl<F>::\
+              gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+
+$for i
+
+[[
+$var template = [[$if i==0 [[]] $else [[
+$range j 0..i-1
+
+  template <$for j, [[typename p$j##_type]]>\
+]]]]
+$var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]]
+                                                $else [[P$i]]]]]]
+$range j 0..i-1
+$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
+$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
+$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
+$var param_field_decls = [[$for j
+[[
+
+      p$j##_type p$j;\
+]]]]
+$var param_field_decls2 = [[$for j
+[[
+
+    p$j##_type p$j;\
+]]]]
+$var params = [[$for j, [[p$j]]]]
+$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
+$var typename_arg_types = [[$for k, [[typename arg$k[[]]_type]]]]
+$var arg_types_and_names = [[$for k, [[arg$k[[]]_type arg$k]]]]
+$var macro_name = [[$if i==0 [[ACTION]] $elif i==1 [[ACTION_P]]
+                                        $else [[ACTION_P$i]]]]
+
+#define $macro_name(name$for j [[, p$j]])\$template
+  class $class_name {\
+   public:\
+    [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {}\
+    template <typename F>\
+    class gmock_Impl : public ::testing::ActionInterface<F> {\
+     public:\
+      typedef F function_type;\
+      typedef typename ::testing::internal::Function<F>::Result return_type;\
+      typedef typename ::testing::internal::Function<F>::ArgumentTuple\
+          args_type;\
+      [[$if i==1 [[explicit ]]]]gmock_Impl($ctor_param_list)$inits {}\
+      virtual return_type Perform(const args_type& args) {\
+        return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\
+            Perform(this, args);\
+      }\
+      template <$typename_arg_types>\
+      return_type gmock_PerformImpl(const args_type& args, [[]]
+$arg_types_and_names) const;\$param_field_decls
+     private:\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename F> operator ::testing::Action<F>() const {\
+      return ::testing::Action<F>(new gmock_Impl<F>($params));\
+    }\$param_field_decls2
+   private:\
+    GTEST_DISALLOW_ASSIGN_($class_name);\
+  };\$template
+  inline $class_name$param_types name($param_types_and_names) {\
+    return $class_name$param_types($params);\
+  }\$template
+  template <typename F>\
+  template <$typename_arg_types>\
+  typename ::testing::internal::Function<F>::Result\
+      $class_name$param_types::gmock_Impl<F>::gmock_PerformImpl(\
+          GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
+]]
+$$ }  // This meta comment fixes auto-indentation in Emacs.  It won't
+$$    // show up in the generated code.
+
+
+namespace testing {
+
+
+// The ACTION*() macros trigger warning C4100 (unreferenced formal
+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
+// the macro definition, as the warnings are generated when the macro
+// is expanded and macro expansion cannot contain #pragma.  Therefore
+// we suppress them here.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4100)
+#endif
+
+// Various overloads for InvokeArgument<N>().
+//
+// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
+// (0-based) argument, which must be a k-ary callable, of the mock
+// function, with arguments a1, a2, ..., a_k.
+//
+// Notes:
+//
+//   1. The arguments are passed by value by default.  If you need to
+//   pass an argument by reference, wrap it inside ByRef().  For
+//   example,
+//
+//     InvokeArgument<1>(5, string("Hello"), ByRef(foo))
+//
+//   passes 5 and string("Hello") by value, and passes foo by
+//   reference.
+//
+//   2. If the callable takes an argument by reference but ByRef() is
+//   not used, it will receive the reference to a copy of the value,
+//   instead of the original value.  For example, when the 0-th
+//   argument of the mock function takes a const string&, the action
+//
+//     InvokeArgument<0>(string("Hello"))
+//
+//   makes a copy of the temporary string("Hello") object and passes a
+//   reference of the copy, instead of the original temporary object,
+//   to the callable.  This makes it easy for a user to define an
+//   InvokeArgument action from temporary values and have it performed
+//   later.
+
+namespace internal {
+namespace invoke_argument {
+
+// Appears in InvokeArgumentAdl's argument list to help avoid
+// accidental calls to user functions of the same name.
+struct AdlTag {};
+
+// InvokeArgumentAdl - a helper for InvokeArgument.
+// The basic overloads are provided here for generic functors.
+// Overloads for other custom-callables are provided in the
+// internal/custom/callback-actions.h header.
+
+$range i 0..n
+$for i
+[[
+$range j 1..i
+
+template <typename R, typename F[[$for j [[, typename A$j]]]]>
+R InvokeArgumentAdl(AdlTag, F f[[$for j [[, A$j a$j]]]]) {
+  return f([[$for j, [[a$j]]]]);
+}
+]]
+
+}  // namespace invoke_argument
+}  // namespace internal
+
+$range i 0..n
+$for i [[
+$range j 0..i-1
+
+ACTION_TEMPLATE(InvokeArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])) {
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args)$for j [[, p$j]]);
+}
+
+]]
+
+// Various overloads for ReturnNew<T>().
+//
+// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
+// instance of type T, constructed on the heap with constructor arguments
+// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
+$range i 0..n
+$for i [[
+$range j 0..i-1
+$var ps = [[$for j, [[p$j]]]]
+
+ACTION_TEMPLATE(ReturnNew,
+                HAS_1_TEMPLATE_PARAMS(typename, T),
+                AND_$i[[]]_VALUE_PARAMS($ps)) {
+  return new T($ps);
+}
+
+]]
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+}  // namespace testing
+
+// Include any custom callback actions added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-generated-actions.h"
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-function-mockers.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-function-mockers.h
new file mode 100644
index 0000000..4fa5ca9
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-function-mockers.h
@@ -0,0 +1,1095 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-function-mockers.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 implements function mockers of various arities.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-internal-utils.h"
+
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
+namespace testing {
+namespace internal {
+
+template <typename F>
+class FunctionMockerBase;
+
+// Note: class FunctionMocker really belongs to the ::testing
+// namespace.  However if we define it in ::testing, MSVC will
+// complain when classes in ::testing::internal declare it as a
+// friend class template.  To workaround this compiler bug, we define
+// FunctionMocker in ::testing::internal and import it into ::testing.
+template <typename F>
+class FunctionMocker;
+
+template <typename R>
+class FunctionMocker<R()> : public
+    internal::FunctionMockerBase<R()> {
+ public:
+  typedef R F();
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With() {
+    return this->current_spec();
+  }
+
+  R Invoke() {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple());
+  }
+};
+
+template <typename R, typename A1>
+class FunctionMocker<R(A1)> : public
+    internal::FunctionMockerBase<R(A1)> {
+ public:
+  typedef R F(A1);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1));
+  }
+};
+
+template <typename R, typename A1, typename A2>
+class FunctionMocker<R(A1, A2)> : public
+    internal::FunctionMockerBase<R(A1, A2)> {
+ public:
+  typedef R F(A1, A2);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+class FunctionMocker<R(A1, A2, A3)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3)> {
+ public:
+  typedef R F(A1, A2, A3);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+class FunctionMocker<R(A1, A2, A3, A4)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4)> {
+ public:
+  typedef R F(A1, A2, A3, A4);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7, m8));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
+      const Matcher<A9>& m9) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7, m8, m9));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+  }
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9,
+    typename A10>
+class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
+    internal::FunctionMockerBase<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> {
+ public:
+  typedef R F(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
+      const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
+      const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
+      const Matcher<A9>& m9, const Matcher<A10>& m10) {
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
+        m6, m7, m8, m9, m10));
+    return this->current_spec();
+  }
+
+  R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9,
+      A10 a10) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple(a1, a2, a3, a4, a5, a6, a7, a8, a9,
+        a10));
+  }
+};
+
+}  // namespace internal
+
+// The style guide prohibits "using" statements in a namespace scope
+// inside a header file.  However, the FunctionMocker class template
+// is meant to be defined in the ::testing namespace.  The following
+// line is just a trick for working around a bug in MSVC 8.0, which
+// cannot handle it if we define FunctionMocker in ::testing.
+using internal::FunctionMocker;
+
+// GMOCK_RESULT_(tn, F) expands to the result type of function type F.
+// We define this as a variadic macro in case F contains unprotected
+// commas (the same reason that we use variadic macros in other places
+// in this file).
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_RESULT_(tn, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Result
+
+// The type of argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_ARG_(tn, N, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
+
+// The matcher type for argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MATCHER_(tn, N, ...) \
+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
+
+// The variable for mocking the given method.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MOCKER_(arity, constness, Method) \
+    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      ) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 0), \
+        this_method_does_not_take_0_arguments); \
+    GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(0, constness, Method).Invoke(); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method() constness { \
+    GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(0, constness, Method).With(); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 1), \
+        this_method_does_not_take_1_argument); \
+    GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(1, constness, Method).Invoke(gmock_a1); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
+    GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 2), \
+        this_method_does_not_take_2_arguments); \
+    GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(2, constness, Method).Invoke(gmock_a1, gmock_a2); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
+    GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 3), \
+        this_method_does_not_take_3_arguments); \
+    GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(3, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
+    GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 4), \
+        this_method_does_not_take_4_arguments); \
+    GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(4, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
+    GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 5), \
+        this_method_does_not_take_5_arguments); \
+    GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(5, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
+    GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 6), \
+        this_method_does_not_take_6_arguments); \
+    GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(6, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
+    GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 7), \
+        this_method_does_not_take_7_arguments); \
+    GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(7, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
+    GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 8), \
+        this_method_does_not_take_8_arguments); \
+    GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(8, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
+    GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
+      GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 9), \
+        this_method_does_not_take_9_arguments); \
+    GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(9, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
+        gmock_a9); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
+                     GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
+    GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \
+        gmock_a9); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \
+      Method)
+
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
+      GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
+      GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
+      GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
+      GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
+      GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
+      GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
+      GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
+      GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
+      GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
+            == 10), \
+        this_method_does_not_take_10_arguments); \
+    GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_(10, constness, Method).Invoke(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
+        gmock_a10); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \
+                     GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \
+                     GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \
+                     GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \
+                     GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \
+                     GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \
+                     GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \
+                     GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \
+                     GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \
+                     GMOCK_MATCHER_(tn, 10, \
+                         __VA_ARGS__) gmock_a10) constness { \
+    GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \
+        gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \
+        gmock_a10); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \
+      Method)
+
+#define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD2(m, ...) GMOCK_METHOD2_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD3(m, ...) GMOCK_METHOD3_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD4(m, ...) GMOCK_METHOD4_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD5(m, ...) GMOCK_METHOD5_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD6(m, ...) GMOCK_METHOD6_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD7(m, ...) GMOCK_METHOD7_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD8(m, ...) GMOCK_METHOD8_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD9(m, ...) GMOCK_METHOD9_(, , , m, __VA_ARGS__)
+#define MOCK_METHOD10(m, ...) GMOCK_METHOD10_(, , , m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0(m, ...) GMOCK_METHOD0_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1(m, ...) GMOCK_METHOD1_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2(m, ...) GMOCK_METHOD2_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3(m, ...) GMOCK_METHOD3_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4(m, ...) GMOCK_METHOD4_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5(m, ...) GMOCK_METHOD5_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6(m, ...) GMOCK_METHOD6_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7(m, ...) GMOCK_METHOD7_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8(m, ...) GMOCK_METHOD8_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9(m, ...) GMOCK_METHOD9_(, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10(m, ...) GMOCK_METHOD10_(, const, , m, __VA_ARGS__)
+
+#define MOCK_METHOD0_T(m, ...) GMOCK_METHOD0_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD1_T(m, ...) GMOCK_METHOD1_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD2_T(m, ...) GMOCK_METHOD2_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD3_T(m, ...) GMOCK_METHOD3_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD4_T(m, ...) GMOCK_METHOD4_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD5_T(m, ...) GMOCK_METHOD5_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD6_T(m, ...) GMOCK_METHOD6_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD7_T(m, ...) GMOCK_METHOD7_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD8_T(m, ...) GMOCK_METHOD8_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD9_T(m, ...) GMOCK_METHOD9_(typename, , , m, __VA_ARGS__)
+#define MOCK_METHOD10_T(m, ...) GMOCK_METHOD10_(typename, , , m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0_T(m, ...) \
+    GMOCK_METHOD0_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1_T(m, ...) \
+    GMOCK_METHOD1_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2_T(m, ...) \
+    GMOCK_METHOD2_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3_T(m, ...) \
+    GMOCK_METHOD3_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4_T(m, ...) \
+    GMOCK_METHOD4_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5_T(m, ...) \
+    GMOCK_METHOD5_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6_T(m, ...) \
+    GMOCK_METHOD6_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7_T(m, ...) \
+    GMOCK_METHOD7_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8_T(m, ...) \
+    GMOCK_METHOD8_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9_T(m, ...) \
+    GMOCK_METHOD9_(typename, const, , m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10_T(m, ...) \
+    GMOCK_METHOD10_(typename, const, , m, __VA_ARGS__)
+
+#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(, , ct, m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(, const, ct, m, __VA_ARGS__)
+
+#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(typename, , ct, m, __VA_ARGS__)
+#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(typename, , ct, m, __VA_ARGS__)
+
+#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD0_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD1_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD2_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD3_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD4_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD5_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD6_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD7_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD8_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD9_(typename, const, ct, m, __VA_ARGS__)
+#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD10_(typename, const, ct, m, __VA_ARGS__)
+
+// A MockFunction<F> class has one mock method whose type is F.  It is
+// useful when you just want your test code to emit some messages and
+// have Google Mock verify the right messages are sent (and perhaps at
+// the right times).  For example, if you are exercising code:
+//
+//   Foo(1);
+//   Foo(2);
+//   Foo(3);
+//
+// and want to verify that Foo(1) and Foo(3) both invoke
+// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
+//
+// TEST(FooTest, InvokesBarCorrectly) {
+//   MyMock mock;
+//   MockFunction<void(string check_point_name)> check;
+//   {
+//     InSequence s;
+//
+//     EXPECT_CALL(mock, Bar("a"));
+//     EXPECT_CALL(check, Call("1"));
+//     EXPECT_CALL(check, Call("2"));
+//     EXPECT_CALL(mock, Bar("a"));
+//   }
+//   Foo(1);
+//   check.Call("1");
+//   Foo(2);
+//   check.Call("2");
+//   Foo(3);
+// }
+//
+// The expectation spec says that the first Bar("a") must happen
+// before check point "1", the second Bar("a") must happen after check
+// point "2", and nothing should happen between the two check
+// points. The explicit check points make it easy to tell which
+// Bar("a") is called by which call to Foo().
+//
+// MockFunction<F> can also be used to exercise code that accepts
+// std::function<F> callbacks. To do so, use AsStdFunction() method
+// to create std::function proxy forwarding to original object's Call.
+// Example:
+//
+// TEST(FooTest, RunsCallbackWithBarArgument) {
+//   MockFunction<int(string)> callback;
+//   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
+//   Foo(callback.AsStdFunction());
+// }
+template <typename F>
+class MockFunction;
+
+template <typename R>
+class MockFunction<R()> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD0_T(Call, R());
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R()> AsStdFunction() {
+    return [this]() -> R {
+      return this->Call();
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0>
+class MockFunction<R(A0)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD1_T(Call, R(A0));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0)> AsStdFunction() {
+    return [this](A0 a0) -> R {
+      return this->Call(a0);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1>
+class MockFunction<R(A0, A1)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD2_T(Call, R(A0, A1));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1)> AsStdFunction() {
+    return [this](A0 a0, A1 a1) -> R {
+      return this->Call(a0, a1);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2>
+class MockFunction<R(A0, A1, A2)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD3_T(Call, R(A0, A1, A2));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2) -> R {
+      return this->Call(a0, a1, a2);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3>
+class MockFunction<R(A0, A1, A2, A3)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
+      return this->Call(a0, a1, a2, a3);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4>
+class MockFunction<R(A0, A1, A2, A3, A4)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
+      return this->Call(a0, a1, a2, a3, a4);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+        A8 a8) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+template <typename R, typename A0, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9>
+class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+        A8 a8, A9 a9) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump
new file mode 100644
index 0000000..811502d
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-function-mockers.h.pump
@@ -0,0 +1,291 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-function-mockers.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+// 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 function mockers of various arities.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-internal-utils.h"
+
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
+namespace testing {
+namespace internal {
+
+template <typename F>
+class FunctionMockerBase;
+
+// Note: class FunctionMocker really belongs to the ::testing
+// namespace.  However if we define it in ::testing, MSVC will
+// complain when classes in ::testing::internal declare it as a
+// friend class template.  To workaround this compiler bug, we define
+// FunctionMocker in ::testing::internal and import it into ::testing.
+template <typename F>
+class FunctionMocker;
+
+
+$range i 0..n
+$for i [[
+$range j 1..i
+$var typename_As = [[$for j [[, typename A$j]]]]
+$var As = [[$for j, [[A$j]]]]
+$var as = [[$for j, [[a$j]]]]
+$var Aas = [[$for j, [[A$j a$j]]]]
+$var ms = [[$for j, [[m$j]]]]
+$var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]]
+template <typename R$typename_As>
+class FunctionMocker<R($As)> : public
+    internal::FunctionMockerBase<R($As)> {
+ public:
+  typedef R F($As);
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+
+  MockSpec<F>& With($matchers) {
+
+$if i >= 1 [[
+    this->current_spec().SetMatchers(::testing::make_tuple($ms));
+
+]]
+    return this->current_spec();
+  }
+
+  R Invoke($Aas) {
+    // Even though gcc and MSVC don't enforce it, 'this->' is required
+    // by the C++ standard [14.6.4] here, as the base class type is
+    // dependent on the template argument (and thus shouldn't be
+    // looked into when resolving InvokeWith).
+    return this->InvokeWith(ArgumentTuple($as));
+  }
+};
+
+
+]]
+}  // namespace internal
+
+// The style guide prohibits "using" statements in a namespace scope
+// inside a header file.  However, the FunctionMocker class template
+// is meant to be defined in the ::testing namespace.  The following
+// line is just a trick for working around a bug in MSVC 8.0, which
+// cannot handle it if we define FunctionMocker in ::testing.
+using internal::FunctionMocker;
+
+// GMOCK_RESULT_(tn, F) expands to the result type of function type F.
+// We define this as a variadic macro in case F contains unprotected
+// commas (the same reason that we use variadic macros in other places
+// in this file).
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_RESULT_(tn, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Result
+
+// The type of argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_ARG_(tn, N, ...) \
+    tn ::testing::internal::Function<__VA_ARGS__>::Argument##N
+
+// The matcher type for argument N of the given function type.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MATCHER_(tn, N, ...) \
+    const ::testing::Matcher<GMOCK_ARG_(tn, N, __VA_ARGS__)>&
+
+// The variable for mocking the given method.
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_MOCKER_(arity, constness, Method) \
+    GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
+
+
+$for i [[
+$range j 1..i
+$var arg_as = [[$for j, \
+      [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
+$var as = [[$for j, [[gmock_a$j]]]]
+$var matcher_as = [[$for j, \
+                     [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]]
+// INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!!
+#define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \
+  GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
+      $arg_as) constness { \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
+        tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \
+        this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \
+    GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \
+    return GMOCK_MOCKER_($i, constness, Method).Invoke($as); \
+  } \
+  ::testing::MockSpec<__VA_ARGS__>& \
+      gmock_##Method($matcher_as) constness { \
+    GMOCK_MOCKER_($i, constness, Method).RegisterOwner(this); \
+    return GMOCK_MOCKER_($i, constness, Method).With($as); \
+  } \
+  mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_($i, constness, Method)
+
+
+]]
+$for i [[
+#define MOCK_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, , , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i(m, ...) GMOCK_METHOD$i[[]]_(, const, , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_METHOD$i[[]]_T(m, ...) GMOCK_METHOD$i[[]]_(typename, , , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i[[]]_T(m, ...) \
+    GMOCK_METHOD$i[[]]_(typename, const, , m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(, , ct, m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i[[]]_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(, const, ct, m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(typename, , ct, m, __VA_ARGS__)
+
+]]
+
+
+$for i [[
+#define MOCK_CONST_METHOD$i[[]]_T_WITH_CALLTYPE(ct, m, ...) \
+    GMOCK_METHOD$i[[]]_(typename, const, ct, m, __VA_ARGS__)
+
+]]
+
+// A MockFunction<F> class has one mock method whose type is F.  It is
+// useful when you just want your test code to emit some messages and
+// have Google Mock verify the right messages are sent (and perhaps at
+// the right times).  For example, if you are exercising code:
+//
+//   Foo(1);
+//   Foo(2);
+//   Foo(3);
+//
+// and want to verify that Foo(1) and Foo(3) both invoke
+// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
+//
+// TEST(FooTest, InvokesBarCorrectly) {
+//   MyMock mock;
+//   MockFunction<void(string check_point_name)> check;
+//   {
+//     InSequence s;
+//
+//     EXPECT_CALL(mock, Bar("a"));
+//     EXPECT_CALL(check, Call("1"));
+//     EXPECT_CALL(check, Call("2"));
+//     EXPECT_CALL(mock, Bar("a"));
+//   }
+//   Foo(1);
+//   check.Call("1");
+//   Foo(2);
+//   check.Call("2");
+//   Foo(3);
+// }
+//
+// The expectation spec says that the first Bar("a") must happen
+// before check point "1", the second Bar("a") must happen after check
+// point "2", and nothing should happen between the two check
+// points. The explicit check points make it easy to tell which
+// Bar("a") is called by which call to Foo().
+//
+// MockFunction<F> can also be used to exercise code that accepts
+// std::function<F> callbacks. To do so, use AsStdFunction() method
+// to create std::function proxy forwarding to original object's Call.
+// Example:
+//
+// TEST(FooTest, RunsCallbackWithBarArgument) {
+//   MockFunction<int(string)> callback;
+//   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
+//   Foo(callback.AsStdFunction());
+// }
+template <typename F>
+class MockFunction;
+
+
+$for i [[
+$range j 0..i-1
+$var ArgTypes = [[$for j, [[A$j]]]]
+$var ArgNames = [[$for j, [[a$j]]]]
+$var ArgDecls = [[$for j, [[A$j a$j]]]]
+template <typename R$for j [[, typename A$j]]>
+class MockFunction<R($ArgTypes)> {
+ public:
+  MockFunction() {}
+
+  MOCK_METHOD$i[[]]_T(Call, R($ArgTypes));
+
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R($ArgTypes)> AsStdFunction() {
+    return [this]($ArgDecls) -> R {
+      return this->Call($ArgNames);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
+};
+
+
+]]
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-matchers.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-matchers.h
new file mode 100644
index 0000000..57056fd
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-matchers.h
@@ -0,0 +1,2179 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-matchers.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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.
+
+// Google Mock - a framework for writing C++ mock classes.
+//
+// This file implements some commonly used variadic matchers.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+
+#include <iterator>
+#include <sstream>
+#include <string>
+#include <vector>
+#include "gmock/gmock-matchers.h"
+
+namespace testing {
+namespace internal {
+
+// The type of the i-th (0-based) field of Tuple.
+#define GMOCK_FIELD_TYPE_(Tuple, i) \
+    typename ::testing::tuple_element<i, Tuple>::type
+
+// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
+// tuple of type Tuple.  It has two members:
+//
+//   type: a tuple type whose i-th field is the ki-th field of Tuple.
+//   GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
+//
+// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
+//
+//   type is tuple<int, bool>, and
+//   GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
+
+template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
+    int k9 = -1>
+class TupleFields;
+
+// This generic version is used when there are 10 selectors.
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
+    int k7, int k8, int k9>
+class TupleFields {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
+      GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
+      GMOCK_FIELD_TYPE_(Tuple, k9)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
+  }
+};
+
+// The following specialization is used for 0 ~ 9 selectors.
+
+template <class Tuple>
+class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<> type;
+  static type GetSelectedFields(const Tuple& /* t */) {
+    return type();
+  }
+};
+
+template <class Tuple, int k0>
+class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1>
+class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2>
+class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3>
+class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
+    int k7>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
+      GMOCK_FIELD_TYPE_(Tuple, k7)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t), get<k7>(t));
+  }
+};
+
+template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
+    int k7, int k8>
+class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
+ public:
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+      GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
+      GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
+      GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
+      GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
+        get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
+  }
+};
+
+#undef GMOCK_FIELD_TYPE_
+
+// Implements the Args() matcher.
+template <class ArgsTuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1,
+    int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1,
+    int k9 = -1>
+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
+ public:
+  // ArgsTuple may have top-level const or reference modifiers.
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
+  typedef typename internal::TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5,
+      k6, k7, k8, k9>::type SelectedArgs;
+  typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
+
+  template <typename InnerMatcher>
+  explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
+      : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
+
+  virtual bool MatchAndExplain(ArgsTuple args,
+                               MatchResultListener* listener) const {
+    const SelectedArgs& selected_args = GetSelectedArgs(args);
+    if (!listener->IsInterested())
+      return inner_matcher_.Matches(selected_args);
+
+    PrintIndices(listener->stream());
+    *listener << "are " << PrintToString(selected_args);
+
+    StringMatchResultListener inner_listener;
+    const bool match = inner_matcher_.MatchAndExplain(selected_args,
+                                                      &inner_listener);
+    PrintIfNotEmpty(inner_listener.str(), listener->stream());
+    return match;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeNegationTo(os);
+  }
+
+ private:
+  static SelectedArgs GetSelectedArgs(ArgsTuple args) {
+    return TupleFields<RawArgsTuple, k0, k1, k2, k3, k4, k5, k6, k7, k8,
+        k9>::GetSelectedFields(args);
+  }
+
+  // Prints the indices of the selected fields.
+  static void PrintIndices(::std::ostream* os) {
+    *os << "whose fields (";
+    const int indices[10] = { k0, k1, k2, k3, k4, k5, k6, k7, k8, k9 };
+    for (int i = 0; i < 10; i++) {
+      if (indices[i] < 0)
+        break;
+
+      if (i >= 1)
+        *os << ", ";
+
+      *os << "#" << indices[i];
+    }
+    *os << ") ";
+  }
+
+  const MonomorphicInnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
+};
+
+template <class InnerMatcher, int k0 = -1, int k1 = -1, int k2 = -1,
+    int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1,
+    int k8 = -1, int k9 = -1>
+class ArgsMatcher {
+ public:
+  explicit ArgsMatcher(const InnerMatcher& inner_matcher)
+      : inner_matcher_(inner_matcher) {}
+
+  template <typename ArgsTuple>
+  operator Matcher<ArgsTuple>() const {
+    return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k0, k1, k2, k3, k4, k5,
+        k6, k7, k8, k9>(inner_matcher_));
+  }
+
+ private:
+  const InnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
+};
+
+// A set of metafunctions for computing the result type of AllOf.
+// AllOf(m1, ..., mN) returns
+// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AllOf isn't defined for one argument, AllOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AllOfResult1 {
+  typedef M1 type;
+};
+
+template <typename M1, typename M2>
+struct AllOfResult2 {
+  typedef BothOfMatcher<
+      typename AllOfResult1<M1>::type,
+      typename AllOfResult1<M2>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3>
+struct AllOfResult3 {
+  typedef BothOfMatcher<
+      typename AllOfResult1<M1>::type,
+      typename AllOfResult2<M2, M3>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4>
+struct AllOfResult4 {
+  typedef BothOfMatcher<
+      typename AllOfResult2<M1, M2>::type,
+      typename AllOfResult2<M3, M4>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+struct AllOfResult5 {
+  typedef BothOfMatcher<
+      typename AllOfResult2<M1, M2>::type,
+      typename AllOfResult3<M3, M4, M5>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+struct AllOfResult6 {
+  typedef BothOfMatcher<
+      typename AllOfResult3<M1, M2, M3>::type,
+      typename AllOfResult3<M4, M5, M6>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+struct AllOfResult7 {
+  typedef BothOfMatcher<
+      typename AllOfResult3<M1, M2, M3>::type,
+      typename AllOfResult4<M4, M5, M6, M7>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+struct AllOfResult8 {
+  typedef BothOfMatcher<
+      typename AllOfResult4<M1, M2, M3, M4>::type,
+      typename AllOfResult4<M5, M6, M7, M8>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+struct AllOfResult9 {
+  typedef BothOfMatcher<
+      typename AllOfResult4<M1, M2, M3, M4>::type,
+      typename AllOfResult5<M5, M6, M7, M8, M9>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+struct AllOfResult10 {
+  typedef BothOfMatcher<
+      typename AllOfResult5<M1, M2, M3, M4, M5>::type,
+      typename AllOfResult5<M6, M7, M8, M9, M10>::type
+  > type;
+};
+
+// A set of metafunctions for computing the result type of AnyOf.
+// AnyOf(m1, ..., mN) returns
+// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AnyOfResult1 {
+  typedef M1 type;
+};
+
+template <typename M1, typename M2>
+struct AnyOfResult2 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult1<M1>::type,
+      typename AnyOfResult1<M2>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3>
+struct AnyOfResult3 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult1<M1>::type,
+      typename AnyOfResult2<M2, M3>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4>
+struct AnyOfResult4 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult2<M1, M2>::type,
+      typename AnyOfResult2<M3, M4>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+struct AnyOfResult5 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult2<M1, M2>::type,
+      typename AnyOfResult3<M3, M4, M5>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+struct AnyOfResult6 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult3<M1, M2, M3>::type,
+      typename AnyOfResult3<M4, M5, M6>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+struct AnyOfResult7 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult3<M1, M2, M3>::type,
+      typename AnyOfResult4<M4, M5, M6, M7>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+struct AnyOfResult8 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult4<M1, M2, M3, M4>::type,
+      typename AnyOfResult4<M5, M6, M7, M8>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+struct AnyOfResult9 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult4<M1, M2, M3, M4>::type,
+      typename AnyOfResult5<M5, M6, M7, M8, M9>::type
+  > type;
+};
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+struct AnyOfResult10 {
+  typedef EitherOfMatcher<
+      typename AnyOfResult5<M1, M2, M3, M4, M5>::type,
+      typename AnyOfResult5<M6, M7, M8, M9, M10>::type
+  > type;
+};
+
+}  // namespace internal
+
+// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
+// fields of it matches a_matcher.  C++ doesn't support default
+// arguments for function templates, so we have to overload it.
+template <typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher>(matcher);
+}
+
+template <int k1, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1>(matcher);
+}
+
+template <int k1, int k2, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2>(matcher);
+}
+
+template <int k1, int k2, int k3, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7,
+    typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6,
+      k7>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7,
+      k8>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9>(matcher);
+}
+
+template <int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8,
+    int k9, int k10, typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8, k9,
+    k10>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher, k1, k2, k3, k4, k5, k6, k7, k8,
+      k9, k10>(matcher);
+}
+
+// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
+// n elements, where the i-th element in the container must
+// match the i-th argument in the list.  Each argument of
+// ElementsAre() can be either a value or a matcher.  We support up to
+// 10 arguments.
+//
+// The use of DecayArray in the implementation allows ElementsAre()
+// to accept string literals, whose type is const char[N], but we
+// want to treat them as const char*.
+//
+// NOTE: Since ElementsAre() cares about the order of the elements, it
+// must not be used with containers whose elements's order is
+// undefined (e.g. hash_map).
+
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<> >
+ElementsAre() {
+  typedef ::testing::tuple<> Args;
+  return internal::ElementsAreMatcher<Args>(Args());
+}
+
+template <typename T1>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type> >
+ElementsAre(const T1& e1) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1));
+}
+
+template <typename T1, typename T2>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type> >
+ElementsAre(const T1& e1, const T2& e2) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2));
+}
+
+template <typename T1, typename T2, typename T3>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3));
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
+      e8));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
+      e8, e9));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type,
+        typename internal::DecayArray<T10>::type> >
+ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
+    const T10& e10) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type,
+      typename internal::DecayArray<T10>::type> Args;
+  return internal::ElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5, e6, e7,
+      e8, e9, e10));
+}
+
+// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
+// that matches n elements in any order.  We support up to n=10 arguments.
+
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<> >
+UnorderedElementsAre() {
+  typedef ::testing::tuple<> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args());
+}
+
+template <typename T1>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type> >
+UnorderedElementsAre(const T1& e1) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1));
+}
+
+template <typename T1, typename T2>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2));
+}
+
+template <typename T1, typename T2, typename T3>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3));
+}
+
+template <typename T1, typename T2, typename T3, typename T4>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7, e8));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7, e8, e9));
+}
+
+template <typename T1, typename T2, typename T3, typename T4, typename T5,
+    typename T6, typename T7, typename T8, typename T9, typename T10>
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+        typename internal::DecayArray<T1>::type,
+        typename internal::DecayArray<T2>::type,
+        typename internal::DecayArray<T3>::type,
+        typename internal::DecayArray<T4>::type,
+        typename internal::DecayArray<T5>::type,
+        typename internal::DecayArray<T6>::type,
+        typename internal::DecayArray<T7>::type,
+        typename internal::DecayArray<T8>::type,
+        typename internal::DecayArray<T9>::type,
+        typename internal::DecayArray<T10>::type> >
+UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
+    const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
+    const T10& e10) {
+  typedef ::testing::tuple<
+      typename internal::DecayArray<T1>::type,
+      typename internal::DecayArray<T2>::type,
+      typename internal::DecayArray<T3>::type,
+      typename internal::DecayArray<T4>::type,
+      typename internal::DecayArray<T5>::type,
+      typename internal::DecayArray<T6>::type,
+      typename internal::DecayArray<T7>::type,
+      typename internal::DecayArray<T8>::type,
+      typename internal::DecayArray<T9>::type,
+      typename internal::DecayArray<T10>::type> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2, e3, e4, e5,
+      e6, e7, e8, e9, e10));
+}
+
+// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
+// sub-matchers.  AllOf is called fully qualified to prevent ADL from firing.
+
+template <typename M1, typename M2>
+inline typename internal::AllOfResult2<M1, M2>::type
+AllOf(M1 m1, M2 m2) {
+  return typename internal::AllOfResult2<M1, M2>::type(
+      m1,
+      m2);
+}
+
+template <typename M1, typename M2, typename M3>
+inline typename internal::AllOfResult3<M1, M2, M3>::type
+AllOf(M1 m1, M2 m2, M3 m3) {
+  return typename internal::AllOfResult3<M1, M2, M3>::type(
+      m1,
+      ::testing::AllOf(m2, m3));
+}
+
+template <typename M1, typename M2, typename M3, typename M4>
+inline typename internal::AllOfResult4<M1, M2, M3, M4>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4) {
+  return typename internal::AllOfResult4<M1, M2, M3, M4>::type(
+      ::testing::AllOf(m1, m2),
+      ::testing::AllOf(m3, m4));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
+  return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type(
+      ::testing::AllOf(m1, m2),
+      ::testing::AllOf(m3, m4, m5));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
+  return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type(
+      ::testing::AllOf(m1, m2, m3),
+      ::testing::AllOf(m4, m5, m6));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
+  return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
+      ::testing::AllOf(m1, m2, m3),
+      ::testing::AllOf(m4, m5, m6, m7));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
+  return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
+      ::testing::AllOf(m1, m2, m3, m4),
+      ::testing::AllOf(m5, m6, m7, m8));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
+  return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
+      M9>::type(
+      ::testing::AllOf(m1, m2, m3, m4),
+      ::testing::AllOf(m5, m6, m7, m8, m9));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+    M10>::type
+AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
+  return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+      M10>::type(
+      ::testing::AllOf(m1, m2, m3, m4, m5),
+      ::testing::AllOf(m6, m7, m8, m9, m10));
+}
+
+// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
+// sub-matchers.  AnyOf is called fully qualified to prevent ADL from firing.
+
+template <typename M1, typename M2>
+inline typename internal::AnyOfResult2<M1, M2>::type
+AnyOf(M1 m1, M2 m2) {
+  return typename internal::AnyOfResult2<M1, M2>::type(
+      m1,
+      m2);
+}
+
+template <typename M1, typename M2, typename M3>
+inline typename internal::AnyOfResult3<M1, M2, M3>::type
+AnyOf(M1 m1, M2 m2, M3 m3) {
+  return typename internal::AnyOfResult3<M1, M2, M3>::type(
+      m1,
+      ::testing::AnyOf(m2, m3));
+}
+
+template <typename M1, typename M2, typename M3, typename M4>
+inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) {
+  return typename internal::AnyOfResult4<M1, M2, M3, M4>::type(
+      ::testing::AnyOf(m1, m2),
+      ::testing::AnyOf(m3, m4));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5>
+inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) {
+  return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type(
+      ::testing::AnyOf(m1, m2),
+      ::testing::AnyOf(m3, m4, m5));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6>
+inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) {
+  return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type(
+      ::testing::AnyOf(m1, m2, m3),
+      ::testing::AnyOf(m4, m5, m6));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7>
+inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) {
+  return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type(
+      ::testing::AnyOf(m1, m2, m3),
+      ::testing::AnyOf(m4, m5, m6, m7));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8>
+inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) {
+  return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type(
+      ::testing::AnyOf(m1, m2, m3, m4),
+      ::testing::AnyOf(m5, m6, m7, m8));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9>
+inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) {
+  return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8,
+      M9>::type(
+      ::testing::AnyOf(m1, m2, m3, m4),
+      ::testing::AnyOf(m5, m6, m7, m8, m9));
+}
+
+template <typename M1, typename M2, typename M3, typename M4, typename M5,
+    typename M6, typename M7, typename M8, typename M9, typename M10>
+inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+    M10>::type
+AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
+  return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9,
+      M10>::type(
+      ::testing::AnyOf(m1, m2, m3, m4, m5),
+      ::testing::AnyOf(m6, m7, m8, m9, m10));
+}
+
+}  // namespace testing
+
+
+// The MATCHER* family of macros can be used in a namespace scope to
+// define custom matchers easily.
+//
+// Basic Usage
+// ===========
+//
+// The syntax
+//
+//   MATCHER(name, description_string) { statements; }
+//
+// defines a matcher with the given name that executes the statements,
+// which must return a bool to indicate if the match succeeds.  Inside
+// the statements, you can refer to the value being matched by 'arg',
+// and refer to its type by 'arg_type'.
+//
+// The description string documents what the matcher does, and is used
+// to generate the failure message when the match fails.  Since a
+// MATCHER() is usually defined in a header file shared by multiple
+// C++ source files, we require the description to be a C-string
+// literal to avoid possible side effects.  It can be empty, in which
+// case we'll use the sequence of words in the matcher name as the
+// description.
+//
+// For example:
+//
+//   MATCHER(IsEven, "") { return (arg % 2) == 0; }
+//
+// allows you to write
+//
+//   // Expects mock_foo.Bar(n) to be called where n is even.
+//   EXPECT_CALL(mock_foo, Bar(IsEven()));
+//
+// or,
+//
+//   // Verifies that the value of some_expression is even.
+//   EXPECT_THAT(some_expression, IsEven());
+//
+// If the above assertion fails, it will print something like:
+//
+//   Value of: some_expression
+//   Expected: is even
+//     Actual: 7
+//
+// where the description "is even" is automatically calculated from the
+// matcher name IsEven.
+//
+// Argument Type
+// =============
+//
+// Note that the type of the value being matched (arg_type) is
+// determined by the context in which you use the matcher and is
+// supplied to you by the compiler, so you don't need to worry about
+// declaring it (nor can you).  This allows the matcher to be
+// polymorphic.  For example, IsEven() can be used to match any type
+// where the value of "(arg % 2) == 0" can be implicitly converted to
+// a bool.  In the "Bar(IsEven())" example above, if method Bar()
+// takes an int, 'arg_type' will be int; if it takes an unsigned long,
+// 'arg_type' will be unsigned long; and so on.
+//
+// Parameterizing Matchers
+// =======================
+//
+// Sometimes you'll want to parameterize the matcher.  For that you
+// can use another macro:
+//
+//   MATCHER_P(name, param_name, description_string) { statements; }
+//
+// For example:
+//
+//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
+//
+// will allow you to write:
+//
+//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
+//
+// which may lead to this message (assuming n is 10):
+//
+//   Value of: Blah("a")
+//   Expected: has absolute value 10
+//     Actual: -9
+//
+// Note that both the matcher description and its parameter are
+// printed, making the message human-friendly.
+//
+// In the matcher definition body, you can write 'foo_type' to
+// reference the type of a parameter named 'foo'.  For example, in the
+// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
+// 'value_type' to refer to the type of 'value'.
+//
+// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P10 to
+// support multi-parameter matchers.
+//
+// Describing Parameterized Matchers
+// =================================
+//
+// The last argument to MATCHER*() is a string-typed expression.  The
+// expression can reference all of the matcher's parameters and a
+// special bool-typed variable named 'negation'.  When 'negation' is
+// false, the expression should evaluate to the matcher's description;
+// otherwise it should evaluate to the description of the negation of
+// the matcher.  For example,
+//
+//   using testing::PrintToString;
+//
+//   MATCHER_P2(InClosedRange, low, hi,
+//       string(negation ? "is not" : "is") + " in range [" +
+//       PrintToString(low) + ", " + PrintToString(hi) + "]") {
+//     return low <= arg && arg <= hi;
+//   }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: is in range [4, 6]
+//   ...
+//   Expected: is not in range [2, 4]
+//
+// If you specify "" as the description, the failure message will
+// contain the sequence of words in the matcher name followed by the
+// parameter values printed as a tuple.  For example,
+//
+//   MATCHER_P2(InClosedRange, low, hi, "") { ... }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: in closed range (4, 6)
+//   ...
+//   Expected: not (in closed range (2, 4))
+//
+// Types of Matcher Parameters
+// ===========================
+//
+// For the purpose of typing, you can view
+//
+//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooMatcherPk<p1_type, ..., pk_type>
+//   Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// When you write Foo(v1, ..., vk), the compiler infers the types of
+// the parameters v1, ..., and vk for you.  If you are not happy with
+// the result of the type inference, you can specify the types by
+// explicitly instantiating the template, as in Foo<long, bool>(5,
+// false).  As said earlier, you don't get to (or need to) specify
+// 'arg_type' as that's determined by the context in which the matcher
+// is used.  You can assign the result of expression Foo(p1, ..., pk)
+// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This
+// can be useful when composing matchers.
+//
+// While you can instantiate a matcher template with reference types,
+// passing the parameters by pointer usually makes your code more
+// readable.  If, however, you still want to pass a parameter by
+// reference, be aware that in the failure message generated by the
+// matcher you will see the value of the referenced object but not its
+// address.
+//
+// Explaining Match Results
+// ========================
+//
+// Sometimes the matcher description alone isn't enough to explain why
+// the match has failed or succeeded.  For example, when expecting a
+// long string, it can be very helpful to also print the diff between
+// the expected string and the actual one.  To achieve that, you can
+// optionally stream additional information to a special variable
+// named result_listener, whose type is a pointer to class
+// MatchResultListener:
+//
+//   MATCHER_P(EqualsLongString, str, "") {
+//     if (arg == str) return true;
+//
+//     *result_listener << "the difference: "
+///                     << DiffStrings(str, arg);
+//     return false;
+//   }
+//
+// Overloading Matchers
+// ====================
+//
+// You can overload matchers with different numbers of parameters:
+//
+//   MATCHER_P(Blah, a, description_string1) { ... }
+//   MATCHER_P2(Blah, a, b, description_string2) { ... }
+//
+// Caveats
+// =======
+//
+// When defining a new matcher, you should also consider implementing
+// MatcherInterface or using MakePolymorphicMatcher().  These
+// approaches require more work than the MATCHER* macros, but also
+// give you more control on the types of the value being matched and
+// the matcher parameters, which may leads to better compiler error
+// messages when the matcher is used wrong.  They also allow
+// overloading matchers based on parameter types (as opposed to just
+// based on the number of parameters).
+//
+// MATCHER*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using MATCHER*() inside
+// a function.
+//
+// More Information
+// ================
+//
+// To learn more about using these macros, please search for 'MATCHER'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+#define MATCHER(name, description)\
+  class name##Matcher {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl()\
+           {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<>()));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>());\
+    }\
+    name##Matcher() {\
+    }\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##Matcher);\
+  };\
+  inline name##Matcher name() {\
+    return name##Matcher();\
+  }\
+  template <typename arg_type>\
+  bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P(name, p0, description)\
+  template <typename p0##_type>\
+  class name##MatcherP {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      explicit gmock_Impl(p0##_type gmock_p0)\
+           : p0(gmock_p0) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type>(p0)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0));\
+    }\
+    explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
+    }\
+    p0##_type p0;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP);\
+  };\
+  template <typename p0##_type>\
+  inline name##MatcherP<p0##_type> name(p0##_type p0) {\
+    return name##MatcherP<p0##_type>(p0);\
+  }\
+  template <typename p0##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP<p0##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P2(name, p0, p1, description)\
+  template <typename p0##_type, typename p1##_type>\
+  class name##MatcherP2 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\
+           : p0(gmock_p0), p1(gmock_p1) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1));\
+    }\
+    name##MatcherP2(p0##_type gmock_p0, p1##_type gmock_p1) : p0(gmock_p0), \
+        p1(gmock_p1) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP2);\
+  };\
+  template <typename p0##_type, typename p1##_type>\
+  inline name##MatcherP2<p0##_type, p1##_type> name(p0##_type p0, \
+      p1##_type p1) {\
+    return name##MatcherP2<p0##_type, p1##_type>(p0, p1);\
+  }\
+  template <typename p0##_type, typename p1##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP2<p0##_type, \
+      p1##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P3(name, p0, p1, p2, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  class name##MatcherP3 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
+                    p2)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2));\
+    }\
+    name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP3);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  inline name##MatcherP3<p0##_type, p1##_type, p2##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2) {\
+    return name##MatcherP3<p0##_type, p1##_type, p2##_type>(p0, p1, p2);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP3<p0##_type, p1##_type, \
+      p2##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P4(name, p0, p1, p2, p3, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  class name##MatcherP4 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, \
+                    p3##_type>(p0, p1, p2, p3)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3));\
+    }\
+    name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP4);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  inline name##MatcherP4<p0##_type, p1##_type, p2##_type, \
+      p3##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3) {\
+    return name##MatcherP4<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \
+        p1, p2, p3);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP4<p0##_type, p1##_type, p2##_type, \
+      p3##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P5(name, p0, p1, p2, p3, p4, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  class name##MatcherP5 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type>(p0, p1, p2, p3, p4)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4));\
+    }\
+    name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, \
+        p4##_type gmock_p4) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP5);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  inline name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4) {\
+    return name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type>(p0, p1, p2, p3, p4);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP5<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  class name##MatcherP6 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5));\
+    }\
+    name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP6);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  inline name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, \
+      p3##_type p3, p4##_type p4, p5##_type p5) {\
+    return name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP6<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  class name##MatcherP7 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
+                    p6)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6));\
+    }\
+    name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), \
+        p6(gmock_p6) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP7);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  inline name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type> name(p0##_type p0, p1##_type p1, \
+      p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6) {\
+    return name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, p6);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP7<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type, p6##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  class name##MatcherP8 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
+                    p3, p4, p5, p6, p7)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7));\
+    }\
+    name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, \
+        p7##_type gmock_p7) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP8);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  inline name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type> name(p0##_type p0, \
+      p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, p5##_type p5, \
+      p6##_type p6, p7##_type p7) {\
+    return name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, p3, p4, p5, \
+        p6, p7);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP8<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type, p6##_type, \
+      p7##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  class name##MatcherP9 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+               p8(gmock_p8) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type, p7##_type, \
+                    p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8));\
+    }\
+    name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8) : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), \
+        p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+        p8(gmock_p8) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP9);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  inline name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, \
+      p8##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, \
+      p8##_type p8) {\
+    return name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type>(p0, p1, p2, \
+        p3, p4, p5, p6, p7, p8);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP9<p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
+      p5##_type, p6##_type, p7##_type, \
+      p8##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description)\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  class name##MatcherP10 {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
+          p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
+          p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
+          p9##_type gmock_p9)\
+           : p0(gmock_p0), p1(gmock_p1), p2(gmock_p2), p3(gmock_p3), \
+               p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), p7(gmock_p7), \
+               p8(gmock_p8), p9(gmock_p9) {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\
+      p0##_type p0;\
+      p1##_type p1;\
+      p2##_type p2;\
+      p3##_type p3;\
+      p4##_type p4;\
+      p5##_type p5;\
+      p6##_type p6;\
+      p7##_type p7;\
+      p8##_type p8;\
+      p9##_type p9;\
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                    p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+                    p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9));\
+    }\
+    name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \
+        p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \
+        p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \
+        p8##_type gmock_p8, p9##_type gmock_p9) : p0(gmock_p0), p1(gmock_p1), \
+        p2(gmock_p2), p3(gmock_p3), p4(gmock_p4), p5(gmock_p5), p6(gmock_p6), \
+        p7(gmock_p7), p8(gmock_p8), p9(gmock_p9) {\
+    }\
+    p0##_type p0;\
+    p1##_type p1;\
+    p2##_type p2;\
+    p3##_type p3;\
+    p4##_type p4;\
+    p5##_type p5;\
+    p6##_type p6;\
+    p7##_type p7;\
+    p8##_type p8;\
+    p9##_type p9;\
+   private:\
+    GTEST_DISALLOW_ASSIGN_(name##MatcherP10);\
+  };\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  inline name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+      p9##_type> name(p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
+      p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
+      p9##_type p9) {\
+    return name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+        p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, p9##_type>(p0, \
+        p1, p2, p3, p4, p5, p6, p7, p8, p9);\
+  }\
+  template <typename p0##_type, typename p1##_type, typename p2##_type, \
+      typename p3##_type, typename p4##_type, typename p5##_type, \
+      typename p6##_type, typename p7##_type, typename p8##_type, \
+      typename p9##_type>\
+  template <typename arg_type>\
+  bool name##MatcherP10<p0##_type, p1##_type, p2##_type, p3##_type, \
+      p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
+      p9##_type>::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-matchers.h.pump b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-matchers.h.pump
new file mode 100644
index 0000000..de30c2c
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-matchers.h.pump
@@ -0,0 +1,672 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-actions.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+$$ }} This line fixes auto-indentation of the following code in Emacs.
+// 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.
+
+// Google Mock - a framework for writing C++ mock classes.
+//
+// This file implements some commonly used variadic matchers.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
+
+#include <iterator>
+#include <sstream>
+#include <string>
+#include <vector>
+#include "gmock/gmock-matchers.h"
+
+namespace testing {
+namespace internal {
+
+$range i 0..n-1
+
+// The type of the i-th (0-based) field of Tuple.
+#define GMOCK_FIELD_TYPE_(Tuple, i) \
+    typename ::testing::tuple_element<i, Tuple>::type
+
+// TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
+// tuple of type Tuple.  It has two members:
+//
+//   type: a tuple type whose i-th field is the ki-th field of Tuple.
+//   GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple.
+//
+// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have:
+//
+//   type is tuple<int, bool>, and
+//   GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true).
+
+template <class Tuple$for i [[, int k$i = -1]]>
+class TupleFields;
+
+// This generic version is used when there are $n selectors.
+template <class Tuple$for i [[, int k$i]]>
+class TupleFields {
+ public:
+  typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type;
+  static type GetSelectedFields(const Tuple& t) {
+    return type($for i, [[get<k$i>(t)]]);
+  }
+};
+
+// The following specialization is used for 0 ~ $(n-1) selectors.
+
+$for i [[
+$$ }}}
+$range j 0..i-1
+$range k 0..n-1
+
+template <class Tuple$for j [[, int k$j]]>
+class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> {
+ public:
+  typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type;
+  static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) {
+    return type($for j, [[get<k$j>(t)]]);
+  }
+};
+
+]]
+
+#undef GMOCK_FIELD_TYPE_
+
+// Implements the Args() matcher.
+
+$var ks = [[$for i, [[k$i]]]]
+template <class ArgsTuple$for i [[, int k$i = -1]]>
+class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
+ public:
+  // ArgsTuple may have top-level const or reference modifiers.
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(ArgsTuple) RawArgsTuple;
+  typedef typename internal::TupleFields<RawArgsTuple, $ks>::type SelectedArgs;
+  typedef Matcher<const SelectedArgs&> MonomorphicInnerMatcher;
+
+  template <typename InnerMatcher>
+  explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
+      : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
+
+  virtual bool MatchAndExplain(ArgsTuple args,
+                               MatchResultListener* listener) const {
+    const SelectedArgs& selected_args = GetSelectedArgs(args);
+    if (!listener->IsInterested())
+      return inner_matcher_.Matches(selected_args);
+
+    PrintIndices(listener->stream());
+    *listener << "are " << PrintToString(selected_args);
+
+    StringMatchResultListener inner_listener;
+    const bool match = inner_matcher_.MatchAndExplain(selected_args,
+                                                      &inner_listener);
+    PrintIfNotEmpty(inner_listener.str(), listener->stream());
+    return match;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "are a tuple ";
+    PrintIndices(os);
+    inner_matcher_.DescribeNegationTo(os);
+  }
+
+ private:
+  static SelectedArgs GetSelectedArgs(ArgsTuple args) {
+    return TupleFields<RawArgsTuple, $ks>::GetSelectedFields(args);
+  }
+
+  // Prints the indices of the selected fields.
+  static void PrintIndices(::std::ostream* os) {
+    *os << "whose fields (";
+    const int indices[$n] = { $ks };
+    for (int i = 0; i < $n; i++) {
+      if (indices[i] < 0)
+        break;
+
+      if (i >= 1)
+        *os << ", ";
+
+      *os << "#" << indices[i];
+    }
+    *os << ") ";
+  }
+
+  const MonomorphicInnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcherImpl);
+};
+
+template <class InnerMatcher$for i [[, int k$i = -1]]>
+class ArgsMatcher {
+ public:
+  explicit ArgsMatcher(const InnerMatcher& inner_matcher)
+      : inner_matcher_(inner_matcher) {}
+
+  template <typename ArgsTuple>
+  operator Matcher<ArgsTuple>() const {
+    return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, $ks>(inner_matcher_));
+  }
+
+ private:
+  const InnerMatcher inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ArgsMatcher);
+};
+
+// A set of metafunctions for computing the result type of AllOf.
+// AllOf(m1, ..., mN) returns
+// AllOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AllOf isn't defined for one argument, AllOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AllOfResult1 {
+  typedef M1 type;
+};
+
+$range i 1..n
+
+$range i 2..n
+$for i [[
+$range j 2..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <typename M1$for j [[, typename M$j]]>
+struct AllOfResult$i {
+  typedef BothOfMatcher<
+      typename AllOfResult$m<$for k, [[M$k]]>::type,
+      typename AllOfResult$(i-m)<$for t, [[M$t]]>::type
+  > type;
+};
+
+]]
+
+// A set of metafunctions for computing the result type of AnyOf.
+// AnyOf(m1, ..., mN) returns
+// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type.
+
+// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined
+// to simplify the implementation.
+template <typename M1>
+struct AnyOfResult1 {
+  typedef M1 type;
+};
+
+$range i 1..n
+
+$range i 2..n
+$for i [[
+$range j 2..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <typename M1$for j [[, typename M$j]]>
+struct AnyOfResult$i {
+  typedef EitherOfMatcher<
+      typename AnyOfResult$m<$for k, [[M$k]]>::type,
+      typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type
+  > type;
+};
+
+]]
+
+}  // namespace internal
+
+// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
+// fields of it matches a_matcher.  C++ doesn't support default
+// arguments for function templates, so we have to overload it.
+
+$range i 0..n
+$for i [[
+$range j 1..i
+template <$for j [[int k$j, ]]typename InnerMatcher>
+inline internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>
+Args(const InnerMatcher& matcher) {
+  return internal::ArgsMatcher<InnerMatcher$for j [[, k$j]]>(matcher);
+}
+
+
+]]
+// ElementsAre(e_1, e_2, ... e_n) matches an STL-style container with
+// n elements, where the i-th element in the container must
+// match the i-th argument in the list.  Each argument of
+// ElementsAre() can be either a value or a matcher.  We support up to
+// $n arguments.
+//
+// The use of DecayArray in the implementation allows ElementsAre()
+// to accept string literals, whose type is const char[N], but we
+// want to treat them as const char*.
+//
+// NOTE: Since ElementsAre() cares about the order of the elements, it
+// must not be used with containers whose elements's order is
+// undefined (e.g. hash_map).
+
+$range i 0..n
+$for i [[
+
+$range j 1..i
+
+$if i>0 [[
+
+template <$for j, [[typename T$j]]>
+]]
+
+inline internal::ElementsAreMatcher<
+    ::testing::tuple<
+$for j, [[
+
+        typename internal::DecayArray<T$j[[]]>::type]]> >
+ElementsAre($for j, [[const T$j& e$j]]) {
+  typedef ::testing::tuple<
+$for j, [[
+
+      typename internal::DecayArray<T$j[[]]>::type]]> Args;
+  return internal::ElementsAreMatcher<Args>(Args($for j, [[e$j]]));
+}
+
+]]
+
+// UnorderedElementsAre(e_1, e_2, ..., e_n) is an ElementsAre extension
+// that matches n elements in any order.  We support up to n=$n arguments.
+
+$range i 0..n
+$for i [[
+
+$range j 1..i
+
+$if i>0 [[
+
+template <$for j, [[typename T$j]]>
+]]
+
+inline internal::UnorderedElementsAreMatcher<
+    ::testing::tuple<
+$for j, [[
+
+        typename internal::DecayArray<T$j[[]]>::type]]> >
+UnorderedElementsAre($for j, [[const T$j& e$j]]) {
+  typedef ::testing::tuple<
+$for j, [[
+
+      typename internal::DecayArray<T$j[[]]>::type]]> Args;
+  return internal::UnorderedElementsAreMatcher<Args>(Args($for j, [[e$j]]));
+}
+
+]]
+
+// AllOf(m1, m2, ..., mk) matches any value that matches all of the given
+// sub-matchers.  AllOf is called fully qualified to prevent ADL from firing.
+
+$range i 2..n
+$for i [[
+$range j 1..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <$for j, [[typename M$j]]>
+inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type
+AllOf($for j, [[M$j m$j]]) {
+  return typename internal::AllOfResult$i<$for j, [[M$j]]>::type(
+      $if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]],
+      $if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]);
+}
+
+]]
+
+// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given
+// sub-matchers.  AnyOf is called fully qualified to prevent ADL from firing.
+
+$range i 2..n
+$for i [[
+$range j 1..i
+$var m = i/2
+$range k 1..m
+$range t m+1..i
+
+template <$for j, [[typename M$j]]>
+inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type
+AnyOf($for j, [[M$j m$j]]) {
+  return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type(
+      $if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]],
+      $if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]);
+}
+
+]]
+
+}  // namespace testing
+$$ } // This Pump meta comment fixes auto-indentation in Emacs. It will not
+$$   // show up in the generated code.
+
+
+// The MATCHER* family of macros can be used in a namespace scope to
+// define custom matchers easily.
+//
+// Basic Usage
+// ===========
+//
+// The syntax
+//
+//   MATCHER(name, description_string) { statements; }
+//
+// defines a matcher with the given name that executes the statements,
+// which must return a bool to indicate if the match succeeds.  Inside
+// the statements, you can refer to the value being matched by 'arg',
+// and refer to its type by 'arg_type'.
+//
+// The description string documents what the matcher does, and is used
+// to generate the failure message when the match fails.  Since a
+// MATCHER() is usually defined in a header file shared by multiple
+// C++ source files, we require the description to be a C-string
+// literal to avoid possible side effects.  It can be empty, in which
+// case we'll use the sequence of words in the matcher name as the
+// description.
+//
+// For example:
+//
+//   MATCHER(IsEven, "") { return (arg % 2) == 0; }
+//
+// allows you to write
+//
+//   // Expects mock_foo.Bar(n) to be called where n is even.
+//   EXPECT_CALL(mock_foo, Bar(IsEven()));
+//
+// or,
+//
+//   // Verifies that the value of some_expression is even.
+//   EXPECT_THAT(some_expression, IsEven());
+//
+// If the above assertion fails, it will print something like:
+//
+//   Value of: some_expression
+//   Expected: is even
+//     Actual: 7
+//
+// where the description "is even" is automatically calculated from the
+// matcher name IsEven.
+//
+// Argument Type
+// =============
+//
+// Note that the type of the value being matched (arg_type) is
+// determined by the context in which you use the matcher and is
+// supplied to you by the compiler, so you don't need to worry about
+// declaring it (nor can you).  This allows the matcher to be
+// polymorphic.  For example, IsEven() can be used to match any type
+// where the value of "(arg % 2) == 0" can be implicitly converted to
+// a bool.  In the "Bar(IsEven())" example above, if method Bar()
+// takes an int, 'arg_type' will be int; if it takes an unsigned long,
+// 'arg_type' will be unsigned long; and so on.
+//
+// Parameterizing Matchers
+// =======================
+//
+// Sometimes you'll want to parameterize the matcher.  For that you
+// can use another macro:
+//
+//   MATCHER_P(name, param_name, description_string) { statements; }
+//
+// For example:
+//
+//   MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
+//
+// will allow you to write:
+//
+//   EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
+//
+// which may lead to this message (assuming n is 10):
+//
+//   Value of: Blah("a")
+//   Expected: has absolute value 10
+//     Actual: -9
+//
+// Note that both the matcher description and its parameter are
+// printed, making the message human-friendly.
+//
+// In the matcher definition body, you can write 'foo_type' to
+// reference the type of a parameter named 'foo'.  For example, in the
+// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
+// 'value_type' to refer to the type of 'value'.
+//
+// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to
+// support multi-parameter matchers.
+//
+// Describing Parameterized Matchers
+// =================================
+//
+// The last argument to MATCHER*() is a string-typed expression.  The
+// expression can reference all of the matcher's parameters and a
+// special bool-typed variable named 'negation'.  When 'negation' is
+// false, the expression should evaluate to the matcher's description;
+// otherwise it should evaluate to the description of the negation of
+// the matcher.  For example,
+//
+//   using testing::PrintToString;
+//
+//   MATCHER_P2(InClosedRange, low, hi,
+//       string(negation ? "is not" : "is") + " in range [" +
+//       PrintToString(low) + ", " + PrintToString(hi) + "]") {
+//     return low <= arg && arg <= hi;
+//   }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: is in range [4, 6]
+//   ...
+//   Expected: is not in range [2, 4]
+//
+// If you specify "" as the description, the failure message will
+// contain the sequence of words in the matcher name followed by the
+// parameter values printed as a tuple.  For example,
+//
+//   MATCHER_P2(InClosedRange, low, hi, "") { ... }
+//   ...
+//   EXPECT_THAT(3, InClosedRange(4, 6));
+//   EXPECT_THAT(3, Not(InClosedRange(2, 4)));
+//
+// would generate two failures that contain the text:
+//
+//   Expected: in closed range (4, 6)
+//   ...
+//   Expected: not (in closed range (2, 4))
+//
+// Types of Matcher Parameters
+// ===========================
+//
+// For the purpose of typing, you can view
+//
+//   MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
+//
+// as shorthand for
+//
+//   template <typename p1_type, ..., typename pk_type>
+//   FooMatcherPk<p1_type, ..., pk_type>
+//   Foo(p1_type p1, ..., pk_type pk) { ... }
+//
+// When you write Foo(v1, ..., vk), the compiler infers the types of
+// the parameters v1, ..., and vk for you.  If you are not happy with
+// the result of the type inference, you can specify the types by
+// explicitly instantiating the template, as in Foo<long, bool>(5,
+// false).  As said earlier, you don't get to (or need to) specify
+// 'arg_type' as that's determined by the context in which the matcher
+// is used.  You can assign the result of expression Foo(p1, ..., pk)
+// to a variable of type FooMatcherPk<p1_type, ..., pk_type>.  This
+// can be useful when composing matchers.
+//
+// While you can instantiate a matcher template with reference types,
+// passing the parameters by pointer usually makes your code more
+// readable.  If, however, you still want to pass a parameter by
+// reference, be aware that in the failure message generated by the
+// matcher you will see the value of the referenced object but not its
+// address.
+//
+// Explaining Match Results
+// ========================
+//
+// Sometimes the matcher description alone isn't enough to explain why
+// the match has failed or succeeded.  For example, when expecting a
+// long string, it can be very helpful to also print the diff between
+// the expected string and the actual one.  To achieve that, you can
+// optionally stream additional information to a special variable
+// named result_listener, whose type is a pointer to class
+// MatchResultListener:
+//
+//   MATCHER_P(EqualsLongString, str, "") {
+//     if (arg == str) return true;
+//
+//     *result_listener << "the difference: "
+///                     << DiffStrings(str, arg);
+//     return false;
+//   }
+//
+// Overloading Matchers
+// ====================
+//
+// You can overload matchers with different numbers of parameters:
+//
+//   MATCHER_P(Blah, a, description_string1) { ... }
+//   MATCHER_P2(Blah, a, b, description_string2) { ... }
+//
+// Caveats
+// =======
+//
+// When defining a new matcher, you should also consider implementing
+// MatcherInterface or using MakePolymorphicMatcher().  These
+// approaches require more work than the MATCHER* macros, but also
+// give you more control on the types of the value being matched and
+// the matcher parameters, which may leads to better compiler error
+// messages when the matcher is used wrong.  They also allow
+// overloading matchers based on parameter types (as opposed to just
+// based on the number of parameters).
+//
+// MATCHER*() can only be used in a namespace scope.  The reason is
+// that C++ doesn't yet allow function-local types to be used to
+// instantiate templates.  The up-coming C++0x standard will fix this.
+// Once that's done, we'll consider supporting using MATCHER*() inside
+// a function.
+//
+// More Information
+// ================
+//
+// To learn more about using these macros, please search for 'MATCHER'
+// on http://code.google.com/p/googlemock/wiki/CookBook.
+
+$range i 0..n
+$for i
+
+[[
+$var macro_name = [[$if i==0 [[MATCHER]] $elif i==1 [[MATCHER_P]]
+                                         $else [[MATCHER_P$i]]]]
+$var class_name = [[name##Matcher[[$if i==0 [[]] $elif i==1 [[P]]
+                                                 $else [[P$i]]]]]]
+$range j 0..i-1
+$var template = [[$if i==0 [[]] $else [[
+
+  template <$for j, [[typename p$j##_type]]>\
+]]]]
+$var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
+$var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]]
+$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
+$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(gmock_p$j)]]]]]]
+$var params = [[$for j, [[p$j]]]]
+$var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]]
+$var param_types_and_names = [[$for j, [[p$j##_type p$j]]]]
+$var param_field_decls = [[$for j
+[[
+
+      p$j##_type p$j;\
+]]]]
+$var param_field_decls2 = [[$for j
+[[
+
+    p$j##_type p$j;\
+]]]]
+
+#define $macro_name(name$for j [[, p$j]], description)\$template
+  class $class_name {\
+   public:\
+    template <typename arg_type>\
+    class gmock_Impl : public ::testing::MatcherInterface<arg_type> {\
+     public:\
+      [[$if i==1 [[explicit ]]]]gmock_Impl($impl_ctor_param_list)\
+          $impl_inits {}\
+      virtual bool MatchAndExplain(\
+          arg_type arg, ::testing::MatchResultListener* result_listener) const;\
+      virtual void DescribeTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(false);\
+      }\
+      virtual void DescribeNegationTo(::std::ostream* gmock_os) const {\
+        *gmock_os << FormatDescription(true);\
+      }\$param_field_decls
+     private:\
+      ::testing::internal::string FormatDescription(bool negation) const {\
+        const ::testing::internal::string gmock_description = (description);\
+        if (!gmock_description.empty())\
+          return gmock_description;\
+        return ::testing::internal::FormatMatcherDescription(\
+            negation, #name, \
+            ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
+                ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\
+      }\
+      GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
+    };\
+    template <typename arg_type>\
+    operator ::testing::Matcher<arg_type>() const {\
+      return ::testing::Matcher<arg_type>(\
+          new gmock_Impl<arg_type>($params));\
+    }\
+    [[$if i==1 [[explicit ]]]]$class_name($ctor_param_list)$inits {\
+    }\$param_field_decls2
+   private:\
+    GTEST_DISALLOW_ASSIGN_($class_name);\
+  };\$template
+  inline $class_name$param_types name($param_types_and_names) {\
+    return $class_name$param_types($params);\
+  }\$template
+  template <typename arg_type>\
+  bool $class_name$param_types::gmock_Impl<arg_type>::MatchAndExplain(\
+      arg_type arg, \
+      ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_)\
+          const
+]]
+
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_MATCHERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-nice-strict.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-nice-strict.h
new file mode 100644
index 0000000..4095f4d
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-nice-strict.h
@@ -0,0 +1,397 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-nice-strict.h.pump
+// DO NOT EDIT BY HAND!!!
+
+// 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: wan@google.com (Zhanyong Wan)
+
+// Implements class templates NiceMock, NaggyMock, and StrictMock.
+//
+// Given a mock class MockFoo that is created using Google Mock,
+// NiceMock<MockFoo> is a subclass of MockFoo that allows
+// uninteresting calls (i.e. calls to mock methods that have no
+// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo
+// that prints a warning when an uninteresting call occurs, and
+// StrictMock<MockFoo> is a subclass of MockFoo that treats all
+// uninteresting calls as errors.
+//
+// Currently a mock is naggy by default, so MockFoo and
+// NaggyMock<MockFoo> behave like the same.  However, we will soon
+// switch the default behavior of mocks to be nice, as that in general
+// leads to more maintainable tests.  When that happens, MockFoo will
+// stop behaving like NaggyMock<MockFoo> and start behaving like
+// NiceMock<MockFoo>.
+//
+// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
+// their respective base class, with up-to 10 arguments.  Therefore
+// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock
+// where MockFoo has a constructor that accepts (int, const char*),
+// for example.
+//
+// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,
+// and StrictMock<MockFoo> only works for mock methods defined using
+// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.
+// If a mock method is defined in a base class of MockFoo, the "nice"
+// or "strict" modifier may not affect it, depending on the compiler.
+// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
+// supported.
+//
+// Another known limitation is that the constructors of the base mock
+// cannot have arguments passed by non-const reference, which are
+// banned by the Google C++ style guide anyway.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+template <class MockClass>
+class NiceMock : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  NiceMock() {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit NiceMock(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+  template <typename A1, typename A2>
+  NiceMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3,
+      const A4& a4) : MockClass(a1, a2, a3, a4) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
+      a6, a7) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
+      a2, a3, a4, a5, a6, a7, a8) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,
+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9, typename A10>
+  NiceMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
+    ::testing::Mock::AllowUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  virtual ~NiceMock() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);
+};
+
+template <class MockClass>
+class NaggyMock : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  NaggyMock() {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit NaggyMock(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+  template <typename A1, typename A2>
+  NaggyMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3,
+      const A4& a4) : MockClass(a1, a2, a3, a4) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
+      a6, a7) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
+      a2, a3, a4, a5, a6, a7, a8) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,
+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9, typename A10>
+  NaggyMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
+    ::testing::Mock::WarnUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  virtual ~NaggyMock() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock);
+};
+
+template <class MockClass>
+class StrictMock : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  StrictMock() {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit StrictMock(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+  template <typename A1, typename A2>
+  StrictMock(const A1& a1, const A2& a2) : MockClass(a1, a2) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3) : MockClass(a1, a2, a3) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3,
+      const A4& a4) : MockClass(a1, a2, a3, a4) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5) : MockClass(a1, a2, a3, a4, a5) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6) : MockClass(a1, a2, a3, a4, a5, a6) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7) : MockClass(a1, a2, a3, a4, a5,
+      a6, a7) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8) : MockClass(a1,
+      a2, a3, a4, a5, a6, a7, a8) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8,
+      const A9& a9) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  template <typename A1, typename A2, typename A3, typename A4, typename A5,
+      typename A6, typename A7, typename A8, typename A9, typename A10>
+  StrictMock(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+      const A5& a5, const A6& a6, const A7& a7, const A8& a8, const A9& a9,
+      const A10& a10) : MockClass(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) {
+    ::testing::Mock::FailUninterestingCalls(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  virtual ~StrictMock() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);
+};
+
+// The following specializations catch some (relatively more common)
+// user errors of nesting nice and strict mocks.  They do NOT catch
+// all possible errors.
+
+// These specializations are declared but not defined, as NiceMock,
+// NaggyMock, and StrictMock cannot be nested.
+
+template <typename MockClass>
+class NiceMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class NaggyMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class StrictMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<StrictMock<MockClass> >;
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump
new file mode 100644
index 0000000..3ee1ce7
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-generated-nice-strict.h.pump
@@ -0,0 +1,161 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-nice-strict.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+// 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: wan@google.com (Zhanyong Wan)
+
+// Implements class templates NiceMock, NaggyMock, and StrictMock.
+//
+// Given a mock class MockFoo that is created using Google Mock,
+// NiceMock<MockFoo> is a subclass of MockFoo that allows
+// uninteresting calls (i.e. calls to mock methods that have no
+// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo
+// that prints a warning when an uninteresting call occurs, and
+// StrictMock<MockFoo> is a subclass of MockFoo that treats all
+// uninteresting calls as errors.
+//
+// Currently a mock is naggy by default, so MockFoo and
+// NaggyMock<MockFoo> behave like the same.  However, we will soon
+// switch the default behavior of mocks to be nice, as that in general
+// leads to more maintainable tests.  When that happens, MockFoo will
+// stop behaving like NaggyMock<MockFoo> and start behaving like
+// NiceMock<MockFoo>.
+//
+// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
+// their respective base class, with up-to $n arguments.  Therefore
+// you can write NiceMock<MockFoo>(5, "a") to construct a nice mock
+// where MockFoo has a constructor that accepts (int, const char*),
+// for example.
+//
+// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,
+// and StrictMock<MockFoo> only works for mock methods defined using
+// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.
+// If a mock method is defined in a base class of MockFoo, the "nice"
+// or "strict" modifier may not affect it, depending on the compiler.
+// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
+// supported.
+//
+// Another known limitation is that the constructors of the base mock
+// cannot have arguments passed by non-const reference, which are
+// banned by the Google C++ style guide anyway.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
+
+#include "gmock/gmock-spec-builders.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+$range kind 0..2
+$for kind [[
+
+$var clazz=[[$if kind==0 [[NiceMock]]
+             $elif kind==1 [[NaggyMock]]
+             $else [[StrictMock]]]]
+
+$var method=[[$if kind==0 [[AllowUninterestingCalls]]
+             $elif kind==1 [[WarnUninterestingCalls]]
+             $else [[FailUninterestingCalls]]]]
+
+template <class MockClass>
+class $clazz : public MockClass {
+ public:
+  // We don't factor out the constructor body to a common method, as
+  // we have to avoid a possible clash with members of MockClass.
+  $clazz() {
+    ::testing::Mock::$method(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+  // C++ doesn't (yet) allow inheritance of constructors, so we have
+  // to define it for each arity.
+  template <typename A1>
+  explicit $clazz(const A1& a1) : MockClass(a1) {
+    ::testing::Mock::$method(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+$range i 2..n
+$for i [[
+$range j 1..i
+  template <$for j, [[typename A$j]]>
+  $clazz($for j, [[const A$j& a$j]]) : MockClass($for j, [[a$j]]) {
+    ::testing::Mock::$method(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+
+]]
+  virtual ~$clazz() {
+    ::testing::Mock::UnregisterCallReaction(
+        internal::ImplicitCast_<MockClass*>(this));
+  }
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_($clazz);
+};
+
+]]
+
+// The following specializations catch some (relatively more common)
+// user errors of nesting nice and strict mocks.  They do NOT catch
+// all possible errors.
+
+// These specializations are declared but not defined, as NiceMock,
+// NaggyMock, and StrictMock cannot be nested.
+
+template <typename MockClass>
+class NiceMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NiceMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class NaggyMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class NaggyMock<StrictMock<MockClass> >;
+
+template <typename MockClass>
+class StrictMock<NiceMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<NaggyMock<MockClass> >;
+template <typename MockClass>
+class StrictMock<StrictMock<MockClass> >;
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_NICE_STRICT_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-matchers.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-matchers.h
new file mode 100644
index 0000000..33b37a7
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-matchers.h
@@ -0,0 +1,4399 @@
+// 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 argument matchers.  More
+// matchers can be defined by the user implementing the
+// MatcherInterface<T> interface if necessary.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
+
+#include <math.h>
+#include <algorithm>
+#include <iterator>
+#include <limits>
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.h"
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+# include <initializer_list>  // NOLINT -- must be after gtest.h
+#endif
+
+namespace testing {
+
+// To implement a matcher Foo for type T, define:
+//   1. a class FooMatcherImpl that implements the
+//      MatcherInterface<T> interface, and
+//   2. a factory function that creates a Matcher<T> object from a
+//      FooMatcherImpl*.
+//
+// The two-level delegation design makes it possible to allow a user
+// to write "v" instead of "Eq(v)" where a Matcher is expected, which
+// is impossible if we pass matchers by pointers.  It also eases
+// ownership management as Matcher objects can now be copied like
+// plain values.
+
+// MatchResultListener is an abstract class.  Its << operator can be
+// used by a matcher to explain why a value matches or doesn't match.
+//
+// TODO(wan@google.com): add method
+//   bool InterestedInWhy(bool result) const;
+// to indicate whether the listener is interested in why the match
+// result is 'result'.
+class MatchResultListener {
+ public:
+  // Creates a listener object with the given underlying ostream.  The
+  // listener does not own the ostream, and does not dereference it
+  // in the constructor or destructor.
+  explicit MatchResultListener(::std::ostream* os) : stream_(os) {}
+  virtual ~MatchResultListener() = 0;  // Makes this class abstract.
+
+  // Streams x to the underlying ostream; does nothing if the ostream
+  // is NULL.
+  template <typename T>
+  MatchResultListener& operator<<(const T& x) {
+    if (stream_ != NULL)
+      *stream_ << x;
+    return *this;
+  }
+
+  // Returns the underlying ostream.
+  ::std::ostream* stream() { return stream_; }
+
+  // Returns true iff the listener is interested in an explanation of
+  // the match result.  A matcher's MatchAndExplain() method can use
+  // this information to avoid generating the explanation when no one
+  // intends to hear it.
+  bool IsInterested() const { return stream_ != NULL; }
+
+ private:
+  ::std::ostream* const stream_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener);
+};
+
+inline MatchResultListener::~MatchResultListener() {
+}
+
+// An instance of a subclass of this knows how to describe itself as a
+// matcher.
+class MatcherDescriberInterface {
+ public:
+  virtual ~MatcherDescriberInterface() {}
+
+  // Describes this matcher to an ostream.  The function should print
+  // a verb phrase that describes the property a value matching this
+  // matcher should have.  The subject of the verb phrase is the value
+  // being matched.  For example, the DescribeTo() method of the Gt(7)
+  // matcher prints "is greater than 7".
+  virtual void DescribeTo(::std::ostream* os) const = 0;
+
+  // Describes the negation of this matcher to an ostream.  For
+  // example, if the description of this matcher is "is greater than
+  // 7", the negated description could be "is not greater than 7".
+  // You are not required to override this when implementing
+  // MatcherInterface, but it is highly advised so that your matcher
+  // can produce good error messages.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "not (";
+    DescribeTo(os);
+    *os << ")";
+  }
+};
+
+// The implementation of a matcher.
+template <typename T>
+class MatcherInterface : public MatcherDescriberInterface {
+ public:
+  // Returns true iff the matcher matches x; also explains the match
+  // result to 'listener' if necessary (see the next paragraph), in
+  // the form of a non-restrictive relative clause ("which ...",
+  // "whose ...", etc) that describes x.  For example, the
+  // MatchAndExplain() method of the Pointee(...) matcher should
+  // generate an explanation like "which points to ...".
+  //
+  // Implementations of MatchAndExplain() should add an explanation of
+  // the match result *if and only if* they can provide additional
+  // information that's not already present (or not obvious) in the
+  // print-out of x and the matcher's description.  Whether the match
+  // succeeds is not a factor in deciding whether an explanation is
+  // needed, as sometimes the caller needs to print a failure message
+  // when the match succeeds (e.g. when the matcher is used inside
+  // Not()).
+  //
+  // For example, a "has at least 10 elements" matcher should explain
+  // what the actual element count is, regardless of the match result,
+  // as it is useful information to the reader; on the other hand, an
+  // "is empty" matcher probably only needs to explain what the actual
+  // size is when the match fails, as it's redundant to say that the
+  // size is 0 when the value is already known to be empty.
+  //
+  // You should override this method when defining a new matcher.
+  //
+  // It's the responsibility of the caller (Google Mock) to guarantee
+  // that 'listener' is not NULL.  This helps to simplify a matcher's
+  // implementation when it doesn't care about the performance, as it
+  // can talk to 'listener' without checking its validity first.
+  // However, in order to implement dummy listeners efficiently,
+  // listener->stream() may be NULL.
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
+
+  // Inherits these methods from MatcherDescriberInterface:
+  //   virtual void DescribeTo(::std::ostream* os) const = 0;
+  //   virtual void DescribeNegationTo(::std::ostream* os) const;
+};
+
+// A match result listener that stores the explanation in a string.
+class StringMatchResultListener : public MatchResultListener {
+ public:
+  StringMatchResultListener() : MatchResultListener(&ss_) {}
+
+  // Returns the explanation accumulated so far.
+  internal::string str() const { return ss_.str(); }
+
+  // Clears the explanation accumulated so far.
+  void Clear() { ss_.str(""); }
+
+ private:
+  ::std::stringstream ss_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);
+};
+
+namespace internal {
+
+struct AnyEq {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a == b; }
+};
+struct AnyNe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a != b; }
+};
+struct AnyLt {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a < b; }
+};
+struct AnyGt {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a > b; }
+};
+struct AnyLe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a <= b; }
+};
+struct AnyGe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a >= b; }
+};
+
+// A match result listener that ignores the explanation.
+class DummyMatchResultListener : public MatchResultListener {
+ public:
+  DummyMatchResultListener() : MatchResultListener(NULL) {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener);
+};
+
+// A match result listener that forwards the explanation to a given
+// ostream.  The difference between this and MatchResultListener is
+// that the former is concrete.
+class StreamMatchResultListener : public MatchResultListener {
+ public:
+  explicit StreamMatchResultListener(::std::ostream* os)
+      : MatchResultListener(os) {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener);
+};
+
+// An internal class for implementing Matcher<T>, which will derive
+// from it.  We put functionalities common to all Matcher<T>
+// specializations here to avoid code duplication.
+template <typename T>
+class MatcherBase {
+ public:
+  // Returns true iff the matcher matches x; also explains the match
+  // result to 'listener'.
+  bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    return impl_->MatchAndExplain(x, listener);
+  }
+
+  // Returns true iff this matcher matches x.
+  bool Matches(T x) const {
+    DummyMatchResultListener dummy;
+    return MatchAndExplain(x, &dummy);
+  }
+
+  // Describes this matcher to an ostream.
+  void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
+
+  // Describes the negation of this matcher to an ostream.
+  void DescribeNegationTo(::std::ostream* os) const {
+    impl_->DescribeNegationTo(os);
+  }
+
+  // Explains why x matches, or doesn't match, the matcher.
+  void ExplainMatchResultTo(T x, ::std::ostream* os) const {
+    StreamMatchResultListener listener(os);
+    MatchAndExplain(x, &listener);
+  }
+
+  // Returns the describer for this matcher object; retains ownership
+  // of the describer, which is only guaranteed to be alive when
+  // this matcher object is alive.
+  const MatcherDescriberInterface* GetDescriber() const {
+    return impl_.get();
+  }
+
+ protected:
+  MatcherBase() {}
+
+  // Constructs a matcher from its implementation.
+  explicit MatcherBase(const MatcherInterface<T>* impl)
+      : impl_(impl) {}
+
+  virtual ~MatcherBase() {}
+
+ private:
+  // shared_ptr (util/gtl/shared_ptr.h) and linked_ptr have similar
+  // interfaces.  The former dynamically allocates a chunk of memory
+  // to hold the reference count, while the latter tracks all
+  // references using a circular linked list without allocating
+  // memory.  It has been observed that linked_ptr performs better in
+  // typical scenarios.  However, shared_ptr can out-perform
+  // linked_ptr when there are many more uses of the copy constructor
+  // than the default constructor.
+  //
+  // If performance becomes a problem, we should see if using
+  // shared_ptr helps.
+  ::testing::internal::linked_ptr<const MatcherInterface<T> > impl_;
+};
+
+}  // namespace internal
+
+// A Matcher<T> is a copyable and IMMUTABLE (except by assignment)
+// object that can check whether a value of type T matches.  The
+// implementation of Matcher<T> is just a linked_ptr to const
+// MatcherInterface<T>, so copying is fairly cheap.  Don't inherit
+// from Matcher!
+template <typename T>
+class Matcher : public internal::MatcherBase<T> {
+ public:
+  // Constructs a null matcher.  Needed for storing Matcher objects in STL
+  // containers.  A default-constructed matcher is not yet initialized.  You
+  // cannot use it until a valid value has been assigned to it.
+  explicit Matcher() {}  // NOLINT
+
+  // Constructs a matcher from its implementation.
+  explicit Matcher(const MatcherInterface<T>* impl)
+      : internal::MatcherBase<T>(impl) {}
+
+  // Implicit constructor here allows people to write
+  // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes
+  Matcher(T value);  // NOLINT
+};
+
+// The following two specializations allow the user to write str
+// instead of Eq(str) and "foo" instead of Eq("foo") when a string
+// matcher is expected.
+template <>
+class GTEST_API_ Matcher<const internal::string&>
+    : public internal::MatcherBase<const internal::string&> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<const internal::string&>* impl)
+      : internal::MatcherBase<const internal::string&>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+};
+
+template <>
+class GTEST_API_ Matcher<internal::string>
+    : public internal::MatcherBase<internal::string> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<internal::string>* impl)
+      : internal::MatcherBase<internal::string>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+};
+
+#if GTEST_HAS_STRING_PIECE_
+// The following two specializations allow the user to write str
+// instead of Eq(str) and "foo" instead of Eq("foo") when a StringPiece
+// matcher is expected.
+template <>
+class GTEST_API_ Matcher<const StringPiece&>
+    : public internal::MatcherBase<const StringPiece&> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<const StringPiece&>* impl)
+      : internal::MatcherBase<const StringPiece&>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+
+  // Allows the user to pass StringPieces directly.
+  Matcher(StringPiece s);  // NOLINT
+};
+
+template <>
+class GTEST_API_ Matcher<StringPiece>
+    : public internal::MatcherBase<StringPiece> {
+ public:
+  Matcher() {}
+
+  explicit Matcher(const MatcherInterface<StringPiece>* impl)
+      : internal::MatcherBase<StringPiece>(impl) {}
+
+  // Allows the user to write str instead of Eq(str) sometimes, where
+  // str is a string object.
+  Matcher(const internal::string& s);  // NOLINT
+
+  // Allows the user to write "foo" instead of Eq("foo") sometimes.
+  Matcher(const char* s);  // NOLINT
+
+  // Allows the user to pass StringPieces directly.
+  Matcher(StringPiece s);  // NOLINT
+};
+#endif  // GTEST_HAS_STRING_PIECE_
+
+// The PolymorphicMatcher class template makes it easy to implement a
+// polymorphic matcher (i.e. a matcher that can match values of more
+// than one type, e.g. Eq(n) and NotNull()).
+//
+// To define a polymorphic matcher, a user should provide an Impl
+// class that has a DescribeTo() method and a DescribeNegationTo()
+// method, and define a member function (or member function template)
+//
+//   bool MatchAndExplain(const Value& value,
+//                        MatchResultListener* listener) const;
+//
+// See the definition of NotNull() for a complete example.
+template <class Impl>
+class PolymorphicMatcher {
+ public:
+  explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
+
+  // Returns a mutable reference to the underlying matcher
+  // implementation object.
+  Impl& mutable_impl() { return impl_; }
+
+  // Returns an immutable reference to the underlying matcher
+  // implementation object.
+  const Impl& impl() const { return impl_; }
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new MonomorphicImpl<T>(impl_));
+  }
+
+ private:
+  template <typename T>
+  class MonomorphicImpl : public MatcherInterface<T> {
+   public:
+    explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      impl_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      impl_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return impl_.MatchAndExplain(x, listener);
+    }
+
+   private:
+    const Impl impl_;
+
+    GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
+  };
+
+  Impl impl_;
+
+  GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher);
+};
+
+// Creates a matcher from its implementation.  This is easier to use
+// than the Matcher<T> constructor as it doesn't require you to
+// explicitly write the template argument, e.g.
+//
+//   MakeMatcher(foo);
+// vs
+//   Matcher<const string&>(foo);
+template <typename T>
+inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) {
+  return Matcher<T>(impl);
+}
+
+// Creates a polymorphic matcher from its implementation.  This is
+// easier to use than the PolymorphicMatcher<Impl> constructor as it
+// doesn't require you to explicitly write the template argument, e.g.
+//
+//   MakePolymorphicMatcher(foo);
+// vs
+//   PolymorphicMatcher<TypeOfFoo>(foo);
+template <class Impl>
+inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) {
+  return PolymorphicMatcher<Impl>(impl);
+}
+
+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
+// and MUST NOT BE USED IN USER CODE!!!
+namespace internal {
+
+// The MatcherCastImpl class template is a helper for implementing
+// MatcherCast().  We need this helper in order to partially
+// specialize the implementation of MatcherCast() (C++ allows
+// class/struct templates to be partially specialized, but not
+// function templates.).
+
+// This general version is used when MatcherCast()'s argument is a
+// polymorphic matcher (i.e. something that can be converted to a
+// Matcher but is not one yet; for example, Eq(value)) or a value (for
+// example, "hello").
+template <typename T, typename M>
+class MatcherCastImpl {
+ public:
+  static Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
+    // M can be a polymorhic matcher, in which case we want to use
+    // its conversion operator to create Matcher<T>.  Or it can be a value
+    // that should be passed to the Matcher<T>'s constructor.
+    //
+    // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a
+    // polymorphic matcher because it'll be ambiguous if T has an implicit
+    // constructor from M (this usually happens when T has an implicit
+    // constructor from any type).
+    //
+    // It won't work to unconditionally implict_cast
+    // polymorphic_matcher_or_value to Matcher<T> because it won't trigger
+    // a user-defined conversion from M to T if one exists (assuming M is
+    // a value).
+    return CastImpl(
+        polymorphic_matcher_or_value,
+        BooleanConstant<
+            internal::ImplicitlyConvertible<M, Matcher<T> >::value>());
+  }
+
+ private:
+  static Matcher<T> CastImpl(const M& value, BooleanConstant<false>) {
+    // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic
+    // matcher.  It must be a value then.  Use direct initialization to create
+    // a matcher.
+    return Matcher<T>(ImplicitCast_<T>(value));
+  }
+
+  static Matcher<T> CastImpl(const M& polymorphic_matcher_or_value,
+                             BooleanConstant<true>) {
+    // M is implicitly convertible to Matcher<T>, which means that either
+    // M is a polymorhpic matcher or Matcher<T> has an implicit constructor
+    // from M.  In both cases using the implicit conversion will produce a
+    // matcher.
+    //
+    // Even if T has an implicit constructor from M, it won't be called because
+    // creating Matcher<T> would require a chain of two user-defined conversions
+    // (first to create T from M and then to create Matcher<T> from T).
+    return polymorphic_matcher_or_value;
+  }
+};
+
+// This more specialized version is used when MatcherCast()'s argument
+// is already a Matcher.  This only compiles when type T can be
+// statically converted to type U.
+template <typename T, typename U>
+class MatcherCastImpl<T, Matcher<U> > {
+ public:
+  static Matcher<T> Cast(const Matcher<U>& source_matcher) {
+    return Matcher<T>(new Impl(source_matcher));
+  }
+
+ private:
+  class Impl : public MatcherInterface<T> {
+   public:
+    explicit Impl(const Matcher<U>& source_matcher)
+        : source_matcher_(source_matcher) {}
+
+    // We delegate the matching logic to the source matcher.
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return source_matcher_.MatchAndExplain(static_cast<U>(x), listener);
+    }
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      source_matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      source_matcher_.DescribeNegationTo(os);
+    }
+
+   private:
+    const Matcher<U> source_matcher_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+};
+
+// This even more specialized version is used for efficiently casting
+// a matcher to its own type.
+template <typename T>
+class MatcherCastImpl<T, Matcher<T> > {
+ public:
+  static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }
+};
+
+}  // namespace internal
+
+// In order to be safe and clear, casting between different matcher
+// types is done explicitly via MatcherCast<T>(m), which takes a
+// matcher m and returns a Matcher<T>.  It compiles only when T can be
+// statically converted to the argument type of m.
+template <typename T, typename M>
+inline Matcher<T> MatcherCast(const M& matcher) {
+  return internal::MatcherCastImpl<T, M>::Cast(matcher);
+}
+
+// Implements SafeMatcherCast().
+//
+// We use an intermediate class to do the actual safe casting as Nokia's
+// Symbian compiler cannot decide between
+// template <T, M> ... (M) and
+// template <T, U> ... (const Matcher<U>&)
+// for function templates but can for member function templates.
+template <typename T>
+class SafeMatcherCastImpl {
+ public:
+  // This overload handles polymorphic matchers and values only since
+  // monomorphic matchers are handled by the next one.
+  template <typename M>
+  static inline Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
+    return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
+  }
+
+  // This overload handles monomorphic matchers.
+  //
+  // In general, if type T can be implicitly converted to type U, we can
+  // safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is
+  // contravariant): just keep a copy of the original Matcher<U>, convert the
+  // argument from type T to U, and then pass it to the underlying Matcher<U>.
+  // The only exception is when U is a reference and T is not, as the
+  // underlying Matcher<U> may be interested in the argument's address, which
+  // is not preserved in the conversion from T to U.
+  template <typename U>
+  static inline Matcher<T> Cast(const Matcher<U>& matcher) {
+    // Enforce that T can be implicitly converted to U.
+    GTEST_COMPILE_ASSERT_((internal::ImplicitlyConvertible<T, U>::value),
+                          T_must_be_implicitly_convertible_to_U);
+    // Enforce that we are not converting a non-reference type T to a reference
+    // type U.
+    GTEST_COMPILE_ASSERT_(
+        internal::is_reference<T>::value || !internal::is_reference<U>::value,
+        cannot_convert_non_referentce_arg_to_reference);
+    // In case both T and U are arithmetic types, enforce that the
+    // conversion is not lossy.
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
+    const bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
+    const bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
+    GTEST_COMPILE_ASSERT_(
+        kTIsOther || kUIsOther ||
+        (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
+        conversion_of_arithmetic_types_must_be_lossless);
+    return MatcherCast<T>(matcher);
+  }
+};
+
+template <typename T, typename M>
+inline Matcher<T> SafeMatcherCast(const M& polymorphic_matcher) {
+  return SafeMatcherCastImpl<T>::Cast(polymorphic_matcher);
+}
+
+// A<T>() returns a matcher that matches any value of type T.
+template <typename T>
+Matcher<T> A();
+
+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
+// and MUST NOT BE USED IN USER CODE!!!
+namespace internal {
+
+// If the explanation is not empty, prints it to the ostream.
+inline void PrintIfNotEmpty(const internal::string& explanation,
+                            ::std::ostream* os) {
+  if (explanation != "" && os != NULL) {
+    *os << ", " << explanation;
+  }
+}
+
+// Returns true if the given type name is easy to read by a human.
+// This is used to decide whether printing the type of a value might
+// be helpful.
+inline bool IsReadableTypeName(const string& type_name) {
+  // We consider a type name readable if it's short or doesn't contain
+  // a template or function type.
+  return (type_name.length() <= 20 ||
+          type_name.find_first_of("<(") == string::npos);
+}
+
+// Matches the value against the given matcher, prints the value and explains
+// the match result to the listener. Returns the match result.
+// 'listener' must not be NULL.
+// Value cannot be passed by const reference, because some matchers take a
+// non-const argument.
+template <typename Value, typename T>
+bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
+                          MatchResultListener* listener) {
+  if (!listener->IsInterested()) {
+    // If the listener is not interested, we do not need to construct the
+    // inner explanation.
+    return matcher.Matches(value);
+  }
+
+  StringMatchResultListener inner_listener;
+  const bool match = matcher.MatchAndExplain(value, &inner_listener);
+
+  UniversalPrint(value, listener->stream());
+#if GTEST_HAS_RTTI
+  const string& type_name = GetTypeName<Value>();
+  if (IsReadableTypeName(type_name))
+    *listener->stream() << " (of type " << type_name << ")";
+#endif
+  PrintIfNotEmpty(inner_listener.str(), listener->stream());
+
+  return match;
+}
+
+// An internal helper class for doing compile-time loop on a tuple's
+// fields.
+template <size_t N>
+class TuplePrefix {
+ public:
+  // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
+  // iff the first N fields of matcher_tuple matches the first N
+  // fields of value_tuple, respectively.
+  template <typename MatcherTuple, typename ValueTuple>
+  static bool Matches(const MatcherTuple& matcher_tuple,
+                      const ValueTuple& value_tuple) {
+    return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)
+        && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));
+  }
+
+  // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)
+  // describes failures in matching the first N fields of matchers
+  // against the first N fields of values.  If there is no failure,
+  // nothing will be streamed to os.
+  template <typename MatcherTuple, typename ValueTuple>
+  static void ExplainMatchFailuresTo(const MatcherTuple& matchers,
+                                     const ValueTuple& values,
+                                     ::std::ostream* os) {
+    // First, describes failures in the first N - 1 fields.
+    TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);
+
+    // Then describes the failure (if any) in the (N - 1)-th (0-based)
+    // field.
+    typename tuple_element<N - 1, MatcherTuple>::type matcher =
+        get<N - 1>(matchers);
+    typedef typename tuple_element<N - 1, ValueTuple>::type Value;
+    Value value = get<N - 1>(values);
+    StringMatchResultListener listener;
+    if (!matcher.MatchAndExplain(value, &listener)) {
+      // TODO(wan): include in the message the name of the parameter
+      // as used in MOCK_METHOD*() when possible.
+      *os << "  Expected arg #" << N - 1 << ": ";
+      get<N - 1>(matchers).DescribeTo(os);
+      *os << "\n           Actual: ";
+      // We remove the reference in type Value to prevent the
+      // universal printer from printing the address of value, which
+      // isn't interesting to the user most of the time.  The
+      // matcher's MatchAndExplain() method handles the case when
+      // the address is interesting.
+      internal::UniversalPrint(value, os);
+      PrintIfNotEmpty(listener.str(), os);
+      *os << "\n";
+    }
+  }
+};
+
+// The base case.
+template <>
+class TuplePrefix<0> {
+ public:
+  template <typename MatcherTuple, typename ValueTuple>
+  static bool Matches(const MatcherTuple& /* matcher_tuple */,
+                      const ValueTuple& /* value_tuple */) {
+    return true;
+  }
+
+  template <typename MatcherTuple, typename ValueTuple>
+  static void ExplainMatchFailuresTo(const MatcherTuple& /* matchers */,
+                                     const ValueTuple& /* values */,
+                                     ::std::ostream* /* os */) {}
+};
+
+// TupleMatches(matcher_tuple, value_tuple) returns true iff all
+// matchers in matcher_tuple match the corresponding fields in
+// value_tuple.  It is a compiler error if matcher_tuple and
+// value_tuple have different number of fields or incompatible field
+// types.
+template <typename MatcherTuple, typename ValueTuple>
+bool TupleMatches(const MatcherTuple& matcher_tuple,
+                  const ValueTuple& value_tuple) {
+  // Makes sure that matcher_tuple and value_tuple have the same
+  // number of fields.
+  GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value ==
+                        tuple_size<ValueTuple>::value,
+                        matcher_and_value_have_different_numbers_of_fields);
+  return TuplePrefix<tuple_size<ValueTuple>::value>::
+      Matches(matcher_tuple, value_tuple);
+}
+
+// Describes failures in matching matchers against values.  If there
+// is no failure, nothing will be streamed to os.
+template <typename MatcherTuple, typename ValueTuple>
+void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
+                                const ValueTuple& values,
+                                ::std::ostream* os) {
+  TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
+      matchers, values, os);
+}
+
+// TransformTupleValues and its helper.
+//
+// TransformTupleValuesHelper hides the internal machinery that
+// TransformTupleValues uses to implement a tuple traversal.
+template <typename Tuple, typename Func, typename OutIter>
+class TransformTupleValuesHelper {
+ private:
+  typedef ::testing::tuple_size<Tuple> TupleSize;
+
+ public:
+  // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
+  // Returns the final value of 'out' in case the caller needs it.
+  static OutIter Run(Func f, const Tuple& t, OutIter out) {
+    return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
+  }
+
+ private:
+  template <typename Tup, size_t kRemainingSize>
+  struct IterateOverTuple {
+    OutIter operator() (Func f, const Tup& t, OutIter out) const {
+      *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
+      return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
+    }
+  };
+  template <typename Tup>
+  struct IterateOverTuple<Tup, 0> {
+    OutIter operator() (Func /* f */, const Tup& /* t */, OutIter out) const {
+      return out;
+    }
+  };
+};
+
+// Successively invokes 'f(element)' on each element of the tuple 't',
+// appending each result to the 'out' iterator. Returns the final value
+// of 'out'.
+template <typename Tuple, typename Func, typename OutIter>
+OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
+  return TransformTupleValuesHelper<Tuple, Func, OutIter>::Run(f, t, out);
+}
+
+// Implements A<T>().
+template <typename T>
+class AnyMatcherImpl : public MatcherInterface<T> {
+ public:
+  virtual bool MatchAndExplain(
+      T /* x */, MatchResultListener* /* listener */) const { return true; }
+  virtual void DescribeTo(::std::ostream* os) const { *os << "is anything"; }
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    // This is mostly for completeness' safe, as it's not very useful
+    // to write Not(A<bool>()).  However we cannot completely rule out
+    // such a possibility, and it doesn't hurt to be prepared.
+    *os << "never matches";
+  }
+};
+
+// Implements _, a matcher that matches any value of any
+// type.  This is a polymorphic matcher, so we need a template type
+// conversion operator to make it appearing as a Matcher<T> for any
+// type T.
+class AnythingMatcher {
+ public:
+  template <typename T>
+  operator Matcher<T>() const { return A<T>(); }
+};
+
+// Implements a matcher that compares a given value with a
+// pre-supplied value using one of the ==, <=, <, etc, operators.  The
+// two values being compared don't have to have the same type.
+//
+// The matcher defined here is polymorphic (for example, Eq(5) can be
+// used to match an int, a short, a double, etc).  Therefore we use
+// a template type conversion operator in the implementation.
+//
+// The following template definition assumes that the Rhs parameter is
+// a "bare" type (i.e. neither 'const T' nor 'T&').
+template <typename D, typename Rhs, typename Op>
+class ComparisonBase {
+ public:
+  explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {}
+  template <typename Lhs>
+  operator Matcher<Lhs>() const {
+    return MakeMatcher(new Impl<Lhs>(rhs_));
+  }
+
+ private:
+  template <typename Lhs>
+  class Impl : public MatcherInterface<Lhs> {
+   public:
+    explicit Impl(const Rhs& rhs) : rhs_(rhs) {}
+    virtual bool MatchAndExplain(
+        Lhs lhs, MatchResultListener* /* listener */) const {
+      return Op()(lhs, rhs_);
+    }
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << D::Desc() << " ";
+      UniversalPrint(rhs_, os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << D::NegatedDesc() <<  " ";
+      UniversalPrint(rhs_, os);
+    }
+   private:
+    Rhs rhs_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+  Rhs rhs_;
+  GTEST_DISALLOW_ASSIGN_(ComparisonBase);
+};
+
+template <typename Rhs>
+class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq> {
+ public:
+  explicit EqMatcher(const Rhs& rhs)
+      : ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq>(rhs) { }
+  static const char* Desc() { return "is equal to"; }
+  static const char* NegatedDesc() { return "isn't equal to"; }
+};
+template <typename Rhs>
+class NeMatcher : public ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe> {
+ public:
+  explicit NeMatcher(const Rhs& rhs)
+      : ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe>(rhs) { }
+  static const char* Desc() { return "isn't equal to"; }
+  static const char* NegatedDesc() { return "is equal to"; }
+};
+template <typename Rhs>
+class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt> {
+ public:
+  explicit LtMatcher(const Rhs& rhs)
+      : ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt>(rhs) { }
+  static const char* Desc() { return "is <"; }
+  static const char* NegatedDesc() { return "isn't <"; }
+};
+template <typename Rhs>
+class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt> {
+ public:
+  explicit GtMatcher(const Rhs& rhs)
+      : ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt>(rhs) { }
+  static const char* Desc() { return "is >"; }
+  static const char* NegatedDesc() { return "isn't >"; }
+};
+template <typename Rhs>
+class LeMatcher : public ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe> {
+ public:
+  explicit LeMatcher(const Rhs& rhs)
+      : ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe>(rhs) { }
+  static const char* Desc() { return "is <="; }
+  static const char* NegatedDesc() { return "isn't <="; }
+};
+template <typename Rhs>
+class GeMatcher : public ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe> {
+ public:
+  explicit GeMatcher(const Rhs& rhs)
+      : ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe>(rhs) { }
+  static const char* Desc() { return "is >="; }
+  static const char* NegatedDesc() { return "isn't >="; }
+};
+
+// Implements the polymorphic IsNull() matcher, which matches any raw or smart
+// pointer that is NULL.
+class IsNullMatcher {
+ public:
+  template <typename Pointer>
+  bool MatchAndExplain(const Pointer& p,
+                       MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+    return p == nullptr;
+#else  // GTEST_LANG_CXX11
+    return GetRawPointer(p) == NULL;
+#endif  // GTEST_LANG_CXX11
+  }
+
+  void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "isn't NULL";
+  }
+};
+
+// Implements the polymorphic NotNull() matcher, which matches any raw or smart
+// pointer that is not NULL.
+class NotNullMatcher {
+ public:
+  template <typename Pointer>
+  bool MatchAndExplain(const Pointer& p,
+                       MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+    return p != nullptr;
+#else  // GTEST_LANG_CXX11
+    return GetRawPointer(p) != NULL;
+#endif  // GTEST_LANG_CXX11
+  }
+
+  void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is NULL";
+  }
+};
+
+// Ref(variable) matches any argument that is a reference to
+// 'variable'.  This matcher is polymorphic as it can match any
+// super type of the type of 'variable'.
+//
+// The RefMatcher template class implements Ref(variable).  It can
+// only be instantiated with a reference type.  This prevents a user
+// from mistakenly using Ref(x) to match a non-reference function
+// argument.  For example, the following will righteously cause a
+// compiler error:
+//
+//   int n;
+//   Matcher<int> m1 = Ref(n);   // This won't compile.
+//   Matcher<int&> m2 = Ref(n);  // This will compile.
+template <typename T>
+class RefMatcher;
+
+template <typename T>
+class RefMatcher<T&> {
+  // Google Mock is a generic framework and thus needs to support
+  // mocking any function types, including those that take non-const
+  // reference arguments.  Therefore the template parameter T (and
+  // Super below) can be instantiated to either a const type or a
+  // non-const type.
+ public:
+  // RefMatcher() takes a T& instead of const T&, as we want the
+  // compiler to catch using Ref(const_value) as a matcher for a
+  // non-const reference.
+  explicit RefMatcher(T& x) : object_(x) {}  // NOLINT
+
+  template <typename Super>
+  operator Matcher<Super&>() const {
+    // By passing object_ (type T&) to Impl(), which expects a Super&,
+    // we make sure that Super is a super type of T.  In particular,
+    // this catches using Ref(const_value) as a matcher for a
+    // non-const reference, as you cannot implicitly convert a const
+    // reference to a non-const reference.
+    return MakeMatcher(new Impl<Super>(object_));
+  }
+
+ private:
+  template <typename Super>
+  class Impl : public MatcherInterface<Super&> {
+   public:
+    explicit Impl(Super& x) : object_(x) {}  // NOLINT
+
+    // MatchAndExplain() takes a Super& (as opposed to const Super&)
+    // in order to match the interface MatcherInterface<Super&>.
+    virtual bool MatchAndExplain(
+        Super& x, MatchResultListener* listener) const {
+      *listener << "which is located @" << static_cast<const void*>(&x);
+      return &x == &object_;
+    }
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "references the variable ";
+      UniversalPrinter<Super&>::Print(object_, os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "does not reference the variable ";
+      UniversalPrinter<Super&>::Print(object_, os);
+    }
+
+   private:
+    const Super& object_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  T& object_;
+
+  GTEST_DISALLOW_ASSIGN_(RefMatcher);
+};
+
+// Polymorphic helper functions for narrow and wide string matchers.
+inline bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) {
+  return String::CaseInsensitiveCStringEquals(lhs, rhs);
+}
+
+inline bool CaseInsensitiveCStringEquals(const wchar_t* lhs,
+                                         const wchar_t* rhs) {
+  return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
+}
+
+// String comparison for narrow or wide strings that can have embedded NUL
+// characters.
+template <typename StringType>
+bool CaseInsensitiveStringEquals(const StringType& s1,
+                                 const StringType& s2) {
+  // Are the heads equal?
+  if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) {
+    return false;
+  }
+
+  // Skip the equal heads.
+  const typename StringType::value_type nul = 0;
+  const size_t i1 = s1.find(nul), i2 = s2.find(nul);
+
+  // Are we at the end of either s1 or s2?
+  if (i1 == StringType::npos || i2 == StringType::npos) {
+    return i1 == i2;
+  }
+
+  // Are the tails equal?
+  return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1));
+}
+
+// String matchers.
+
+// Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
+template <typename StringType>
+class StrEqualityMatcher {
+ public:
+  StrEqualityMatcher(const StringType& str, bool expect_eq,
+                     bool case_sensitive)
+      : string_(str), expect_eq_(expect_eq), case_sensitive_(case_sensitive) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    if (s == NULL) {
+      return !expect_eq_;
+    }
+    return MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    const bool eq = case_sensitive_ ? s2 == string_ :
+        CaseInsensitiveStringEquals(s2, string_);
+    return expect_eq_ == eq;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    DescribeToHelper(expect_eq_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    DescribeToHelper(!expect_eq_, os);
+  }
+
+ private:
+  void DescribeToHelper(bool expect_eq, ::std::ostream* os) const {
+    *os << (expect_eq ? "is " : "isn't ");
+    *os << "equal to ";
+    if (!case_sensitive_) {
+      *os << "(ignoring case) ";
+    }
+    UniversalPrint(string_, os);
+  }
+
+  const StringType string_;
+  const bool expect_eq_;
+  const bool case_sensitive_;
+
+  GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
+};
+
+// Implements the polymorphic HasSubstr(substring) matcher, which
+// can be used as a Matcher<T> as long as T can be converted to a
+// string.
+template <typename StringType>
+class HasSubstrMatcher {
+ public:
+  explicit HasSubstrMatcher(const StringType& substring)
+      : substring_(substring) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    return s2.find(substring_) != StringType::npos;
+  }
+
+  // Describes what this matcher matches.
+  void DescribeTo(::std::ostream* os) const {
+    *os << "has substring ";
+    UniversalPrint(substring_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "has no substring ";
+    UniversalPrint(substring_, os);
+  }
+
+ private:
+  const StringType substring_;
+
+  GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
+};
+
+// Implements the polymorphic StartsWith(substring) matcher, which
+// can be used as a Matcher<T> as long as T can be converted to a
+// string.
+template <typename StringType>
+class StartsWithMatcher {
+ public:
+  explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {
+  }
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    return s2.length() >= prefix_.length() &&
+        s2.substr(0, prefix_.length()) == prefix_;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "starts with ";
+    UniversalPrint(prefix_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't start with ";
+    UniversalPrint(prefix_, os);
+  }
+
+ private:
+  const StringType prefix_;
+
+  GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
+};
+
+// Implements the polymorphic EndsWith(substring) matcher, which
+// can be used as a Matcher<T> as long as T can be converted to a
+// string.
+template <typename StringType>
+class EndsWithMatcher {
+ public:
+  explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(StringType(s), listener);
+  }
+
+  // Matches anything that can convert to StringType.
+  //
+  // This is a template, not just a plain function with const StringType&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <typename MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const StringType& s2(s);
+    return s2.length() >= suffix_.length() &&
+        s2.substr(s2.length() - suffix_.length()) == suffix_;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "ends with ";
+    UniversalPrint(suffix_, os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't end with ";
+    UniversalPrint(suffix_, os);
+  }
+
+ private:
+  const StringType suffix_;
+
+  GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
+};
+
+// Implements polymorphic matchers MatchesRegex(regex) and
+// ContainsRegex(regex), which can be used as a Matcher<T> as long as
+// T can be converted to a string.
+class MatchesRegexMatcher {
+ public:
+  MatchesRegexMatcher(const RE* regex, bool full_match)
+      : regex_(regex), full_match_(full_match) {}
+
+  // Accepts pointer types, particularly:
+  //   const char*
+  //   char*
+  //   const wchar_t*
+  //   wchar_t*
+  template <typename CharType>
+  bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
+    return s != NULL && MatchAndExplain(internal::string(s), listener);
+  }
+
+  // Matches anything that can convert to internal::string.
+  //
+  // This is a template, not just a plain function with const internal::string&,
+  // because StringPiece has some interfering non-explicit constructors.
+  template <class MatcheeStringType>
+  bool MatchAndExplain(const MatcheeStringType& s,
+                       MatchResultListener* /* listener */) const {
+    const internal::string& s2(s);
+    return full_match_ ? RE::FullMatch(s2, *regex_) :
+        RE::PartialMatch(s2, *regex_);
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << (full_match_ ? "matches" : "contains")
+        << " regular expression ";
+    UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't " << (full_match_ ? "match" : "contain")
+        << " regular expression ";
+    UniversalPrinter<internal::string>::Print(regex_->pattern(), os);
+  }
+
+ private:
+  const internal::linked_ptr<const RE> regex_;
+  const bool full_match_;
+
+  GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher);
+};
+
+// Implements a matcher that compares the two fields of a 2-tuple
+// using one of the ==, <=, <, etc, operators.  The two fields being
+// compared don't have to have the same type.
+//
+// The matcher defined here is polymorphic (for example, Eq() can be
+// used to match a tuple<int, short>, a tuple<const long&, double>,
+// etc).  Therefore we use a template type conversion operator in the
+// implementation.
+template <typename D, typename Op>
+class PairMatchBase {
+ public:
+  template <typename T1, typename T2>
+  operator Matcher< ::testing::tuple<T1, T2> >() const {
+    return MakeMatcher(new Impl< ::testing::tuple<T1, T2> >);
+  }
+  template <typename T1, typename T2>
+  operator Matcher<const ::testing::tuple<T1, T2>&>() const {
+    return MakeMatcher(new Impl<const ::testing::tuple<T1, T2>&>);
+  }
+
+ private:
+  static ::std::ostream& GetDesc(::std::ostream& os) {  // NOLINT
+    return os << D::Desc();
+  }
+
+  template <typename Tuple>
+  class Impl : public MatcherInterface<Tuple> {
+   public:
+    virtual bool MatchAndExplain(
+        Tuple args,
+        MatchResultListener* /* listener */) const {
+      return Op()(::testing::get<0>(args), ::testing::get<1>(args));
+    }
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "are " << GetDesc;
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "aren't " << GetDesc;
+    }
+  };
+};
+
+class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
+ public:
+  static const char* Desc() { return "an equal pair"; }
+};
+class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
+ public:
+  static const char* Desc() { return "an unequal pair"; }
+};
+class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
+ public:
+  static const char* Desc() { return "a pair where the first < the second"; }
+};
+class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
+ public:
+  static const char* Desc() { return "a pair where the first > the second"; }
+};
+class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
+ public:
+  static const char* Desc() { return "a pair where the first <= the second"; }
+};
+class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
+ public:
+  static const char* Desc() { return "a pair where the first >= the second"; }
+};
+
+// Implements the Not(...) matcher for a particular argument type T.
+// We do not nest it inside the NotMatcher class template, as that
+// will prevent different instantiations of NotMatcher from sharing
+// the same NotMatcherImpl<T> class.
+template <typename T>
+class NotMatcherImpl : public MatcherInterface<T> {
+ public:
+  explicit NotMatcherImpl(const Matcher<T>& matcher)
+      : matcher_(matcher) {}
+
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    return !matcher_.MatchAndExplain(x, listener);
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    matcher_.DescribeNegationTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    matcher_.DescribeTo(os);
+  }
+
+ private:
+  const Matcher<T> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(NotMatcherImpl);
+};
+
+// Implements the Not(m) matcher, which matches a value that doesn't
+// match matcher m.
+template <typename InnerMatcher>
+class NotMatcher {
+ public:
+  explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}
+
+  // This template type conversion operator allows Not(m) to be used
+  // to match any type m can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new NotMatcherImpl<T>(SafeMatcherCast<T>(matcher_)));
+  }
+
+ private:
+  InnerMatcher matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(NotMatcher);
+};
+
+// Implements the AllOf(m1, m2) matcher for a particular argument type
+// T. We do not nest it inside the BothOfMatcher class template, as
+// that will prevent different instantiations of BothOfMatcher from
+// sharing the same BothOfMatcherImpl<T> class.
+template <typename T>
+class BothOfMatcherImpl : public MatcherInterface<T> {
+ public:
+  BothOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeTo(os);
+    *os << ") and (";
+    matcher2_.DescribeTo(os);
+    *os << ")";
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeNegationTo(os);
+    *os << ") or (";
+    matcher2_.DescribeNegationTo(os);
+    *os << ")";
+  }
+
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    // If either matcher1_ or matcher2_ doesn't match x, we only need
+    // to explain why one of them fails.
+    StringMatchResultListener listener1;
+    if (!matcher1_.MatchAndExplain(x, &listener1)) {
+      *listener << listener1.str();
+      return false;
+    }
+
+    StringMatchResultListener listener2;
+    if (!matcher2_.MatchAndExplain(x, &listener2)) {
+      *listener << listener2.str();
+      return false;
+    }
+
+    // Otherwise we need to explain why *both* of them match.
+    const internal::string s1 = listener1.str();
+    const internal::string s2 = listener2.str();
+
+    if (s1 == "") {
+      *listener << s2;
+    } else {
+      *listener << s1;
+      if (s2 != "") {
+        *listener << ", and " << s2;
+      }
+    }
+    return true;
+  }
+
+ private:
+  const Matcher<T> matcher1_;
+  const Matcher<T> matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(BothOfMatcherImpl);
+};
+
+#if GTEST_LANG_CXX11
+// MatcherList provides mechanisms for storing a variable number of matchers in
+// a list structure (ListType) and creating a combining matcher from such a
+// list.
+// The template is defined recursively using the following template paramters:
+//   * kSize is the length of the MatcherList.
+//   * Head is the type of the first matcher of the list.
+//   * Tail denotes the types of the remaining matchers of the list.
+template <int kSize, typename Head, typename... Tail>
+struct MatcherList {
+  typedef MatcherList<kSize - 1, Tail...> MatcherListTail;
+  typedef ::std::pair<Head, typename MatcherListTail::ListType> ListType;
+
+  // BuildList stores variadic type values in a nested pair structure.
+  // Example:
+  // MatcherList<3, int, string, float>::BuildList(5, "foo", 2.0) will return
+  // the corresponding result of type pair<int, pair<string, float>>.
+  static ListType BuildList(const Head& matcher, const Tail&... tail) {
+    return ListType(matcher, MatcherListTail::BuildList(tail...));
+  }
+
+  // CreateMatcher<T> creates a Matcher<T> from a given list of matchers (built
+  // by BuildList()). CombiningMatcher<T> is used to combine the matchers of the
+  // list. CombiningMatcher<T> must implement MatcherInterface<T> and have a
+  // constructor taking two Matcher<T>s as input.
+  template <typename T, template <typename /* T */> class CombiningMatcher>
+  static Matcher<T> CreateMatcher(const ListType& matchers) {
+    return Matcher<T>(new CombiningMatcher<T>(
+        SafeMatcherCast<T>(matchers.first),
+        MatcherListTail::template CreateMatcher<T, CombiningMatcher>(
+            matchers.second)));
+  }
+};
+
+// The following defines the base case for the recursive definition of
+// MatcherList.
+template <typename Matcher1, typename Matcher2>
+struct MatcherList<2, Matcher1, Matcher2> {
+  typedef ::std::pair<Matcher1, Matcher2> ListType;
+
+  static ListType BuildList(const Matcher1& matcher1,
+                            const Matcher2& matcher2) {
+    return ::std::pair<Matcher1, Matcher2>(matcher1, matcher2);
+  }
+
+  template <typename T, template <typename /* T */> class CombiningMatcher>
+  static Matcher<T> CreateMatcher(const ListType& matchers) {
+    return Matcher<T>(new CombiningMatcher<T>(
+        SafeMatcherCast<T>(matchers.first),
+        SafeMatcherCast<T>(matchers.second)));
+  }
+};
+
+// VariadicMatcher is used for the variadic implementation of
+// AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...).
+// CombiningMatcher<T> is used to recursively combine the provided matchers
+// (of type Args...).
+template <template <typename T> class CombiningMatcher, typename... Args>
+class VariadicMatcher {
+ public:
+  VariadicMatcher(const Args&... matchers)  // NOLINT
+      : matchers_(MatcherListType::BuildList(matchers...)) {}
+
+  // This template type conversion operator allows an
+  // VariadicMatcher<Matcher1, Matcher2...> object to match any type that
+  // all of the provided matchers (Matcher1, Matcher2, ...) can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return MatcherListType::template CreateMatcher<T, CombiningMatcher>(
+        matchers_);
+  }
+
+ private:
+  typedef MatcherList<sizeof...(Args), Args...> MatcherListType;
+
+  const typename MatcherListType::ListType matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(VariadicMatcher);
+};
+
+template <typename... Args>
+using AllOfMatcher = VariadicMatcher<BothOfMatcherImpl, Args...>;
+
+#endif  // GTEST_LANG_CXX11
+
+// Used for implementing the AllOf(m_1, ..., m_n) matcher, which
+// matches a value that matches all of the matchers m_1, ..., and m_n.
+template <typename Matcher1, typename Matcher2>
+class BothOfMatcher {
+ public:
+  BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  // This template type conversion operator allows a
+  // BothOfMatcher<Matcher1, Matcher2> object to match any type that
+  // both Matcher1 and Matcher2 can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new BothOfMatcherImpl<T>(SafeMatcherCast<T>(matcher1_),
+                                               SafeMatcherCast<T>(matcher2_)));
+  }
+
+ private:
+  Matcher1 matcher1_;
+  Matcher2 matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(BothOfMatcher);
+};
+
+// Implements the AnyOf(m1, m2) matcher for a particular argument type
+// T.  We do not nest it inside the AnyOfMatcher class template, as
+// that will prevent different instantiations of AnyOfMatcher from
+// sharing the same EitherOfMatcherImpl<T> class.
+template <typename T>
+class EitherOfMatcherImpl : public MatcherInterface<T> {
+ public:
+  EitherOfMatcherImpl(const Matcher<T>& matcher1, const Matcher<T>& matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeTo(os);
+    *os << ") or (";
+    matcher2_.DescribeTo(os);
+    *os << ")";
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "(";
+    matcher1_.DescribeNegationTo(os);
+    *os << ") and (";
+    matcher2_.DescribeNegationTo(os);
+    *os << ")";
+  }
+
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+    // If either matcher1_ or matcher2_ matches x, we just need to
+    // explain why *one* of them matches.
+    StringMatchResultListener listener1;
+    if (matcher1_.MatchAndExplain(x, &listener1)) {
+      *listener << listener1.str();
+      return true;
+    }
+
+    StringMatchResultListener listener2;
+    if (matcher2_.MatchAndExplain(x, &listener2)) {
+      *listener << listener2.str();
+      return true;
+    }
+
+    // Otherwise we need to explain why *both* of them fail.
+    const internal::string s1 = listener1.str();
+    const internal::string s2 = listener2.str();
+
+    if (s1 == "") {
+      *listener << s2;
+    } else {
+      *listener << s1;
+      if (s2 != "") {
+        *listener << ", and " << s2;
+      }
+    }
+    return false;
+  }
+
+ private:
+  const Matcher<T> matcher1_;
+  const Matcher<T> matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(EitherOfMatcherImpl);
+};
+
+#if GTEST_LANG_CXX11
+// AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...).
+template <typename... Args>
+using AnyOfMatcher = VariadicMatcher<EitherOfMatcherImpl, Args...>;
+
+#endif  // GTEST_LANG_CXX11
+
+// Used for implementing the AnyOf(m_1, ..., m_n) matcher, which
+// matches a value that matches at least one of the matchers m_1, ...,
+// and m_n.
+template <typename Matcher1, typename Matcher2>
+class EitherOfMatcher {
+ public:
+  EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2)
+      : matcher1_(matcher1), matcher2_(matcher2) {}
+
+  // This template type conversion operator allows a
+  // EitherOfMatcher<Matcher1, Matcher2> object to match any type that
+  // both Matcher1 and Matcher2 can match.
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new EitherOfMatcherImpl<T>(
+        SafeMatcherCast<T>(matcher1_), SafeMatcherCast<T>(matcher2_)));
+  }
+
+ private:
+  Matcher1 matcher1_;
+  Matcher2 matcher2_;
+
+  GTEST_DISALLOW_ASSIGN_(EitherOfMatcher);
+};
+
+// Used for implementing Truly(pred), which turns a predicate into a
+// matcher.
+template <typename Predicate>
+class TrulyMatcher {
+ public:
+  explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}
+
+  // This method template allows Truly(pred) to be used as a matcher
+  // for type T where T is the argument type of predicate 'pred'.  The
+  // argument is passed by reference as the predicate may be
+  // interested in the address of the argument.
+  template <typename T>
+  bool MatchAndExplain(T& x,  // NOLINT
+                       MatchResultListener* /* listener */) const {
+    // Without the if-statement, MSVC sometimes warns about converting
+    // a value to bool (warning 4800).
+    //
+    // We cannot write 'return !!predicate_(x);' as that doesn't work
+    // when predicate_(x) returns a class convertible to bool but
+    // having no operator!().
+    if (predicate_(x))
+      return true;
+    return false;
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "satisfies the given predicate";
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't satisfy the given predicate";
+  }
+
+ private:
+  Predicate predicate_;
+
+  GTEST_DISALLOW_ASSIGN_(TrulyMatcher);
+};
+
+// Used for implementing Matches(matcher), which turns a matcher into
+// a predicate.
+template <typename M>
+class MatcherAsPredicate {
+ public:
+  explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}
+
+  // This template operator() allows Matches(m) to be used as a
+  // predicate on type T where m is a matcher on type T.
+  //
+  // The argument x is passed by reference instead of by value, as
+  // some matcher may be interested in its address (e.g. as in
+  // Matches(Ref(n))(x)).
+  template <typename T>
+  bool operator()(const T& x) const {
+    // We let matcher_ commit to a particular type here instead of
+    // when the MatcherAsPredicate object was constructed.  This
+    // allows us to write Matches(m) where m is a polymorphic matcher
+    // (e.g. Eq(5)).
+    //
+    // If we write Matcher<T>(matcher_).Matches(x) here, it won't
+    // compile when matcher_ has type Matcher<const T&>; if we write
+    // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
+    // when matcher_ has type Matcher<T>; if we just write
+    // matcher_.Matches(x), it won't compile when matcher_ is
+    // polymorphic, e.g. Eq(5).
+    //
+    // MatcherCast<const T&>() is necessary for making the code work
+    // in all of the above situations.
+    return MatcherCast<const T&>(matcher_).Matches(x);
+  }
+
+ private:
+  M matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(MatcherAsPredicate);
+};
+
+// For implementing ASSERT_THAT() and EXPECT_THAT().  The template
+// argument M must be a type that can be converted to a matcher.
+template <typename M>
+class PredicateFormatterFromMatcher {
+ public:
+  explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {}
+
+  // This template () operator allows a PredicateFormatterFromMatcher
+  // object to act as a predicate-formatter suitable for using with
+  // Google Test's EXPECT_PRED_FORMAT1() macro.
+  template <typename T>
+  AssertionResult operator()(const char* value_text, const T& x) const {
+    // We convert matcher_ to a Matcher<const T&> *now* instead of
+    // when the PredicateFormatterFromMatcher object was constructed,
+    // as matcher_ may be polymorphic (e.g. NotNull()) and we won't
+    // know which type to instantiate it to until we actually see the
+    // type of x here.
+    //
+    // We write SafeMatcherCast<const T&>(matcher_) instead of
+    // Matcher<const T&>(matcher_), as the latter won't compile when
+    // matcher_ has type Matcher<T> (e.g. An<int>()).
+    // We don't write MatcherCast<const T&> either, as that allows
+    // potentially unsafe downcasting of the matcher argument.
+    const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);
+    StringMatchResultListener listener;
+    if (MatchPrintAndExplain(x, matcher, &listener))
+      return AssertionSuccess();
+
+    ::std::stringstream ss;
+    ss << "Value of: " << value_text << "\n"
+       << "Expected: ";
+    matcher.DescribeTo(&ss);
+    ss << "\n  Actual: " << listener.str();
+    return AssertionFailure() << ss.str();
+  }
+
+ private:
+  const M matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PredicateFormatterFromMatcher);
+};
+
+// A helper function for converting a matcher to a predicate-formatter
+// without the user needing to explicitly write the type.  This is
+// used for implementing ASSERT_THAT() and EXPECT_THAT().
+// Implementation detail: 'matcher' is received by-value to force decaying.
+template <typename M>
+inline PredicateFormatterFromMatcher<M>
+MakePredicateFormatterFromMatcher(M matcher) {
+  return PredicateFormatterFromMatcher<M>(internal::move(matcher));
+}
+
+// Implements the polymorphic floating point equality matcher, which matches
+// two float values using ULP-based approximation or, optionally, a
+// user-specified epsilon.  The template is meant to be instantiated with
+// FloatType being either float or double.
+template <typename FloatType>
+class FloatingEqMatcher {
+ public:
+  // Constructor for FloatingEqMatcher.
+  // The matcher's input will be compared with expected.  The matcher treats two
+  // NANs as equal if nan_eq_nan is true.  Otherwise, under IEEE standards,
+  // equality comparisons between NANs will always return false.  We specify a
+  // negative max_abs_error_ term to indicate that ULP-based approximation will
+  // be used for comparison.
+  FloatingEqMatcher(FloatType expected, bool nan_eq_nan) :
+    expected_(expected), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {
+  }
+
+  // Constructor that supports a user-specified max_abs_error that will be used
+  // for comparison instead of ULP-based approximation.  The max absolute
+  // should be non-negative.
+  FloatingEqMatcher(FloatType expected, bool nan_eq_nan,
+                    FloatType max_abs_error)
+      : expected_(expected),
+        nan_eq_nan_(nan_eq_nan),
+        max_abs_error_(max_abs_error) {
+    GTEST_CHECK_(max_abs_error >= 0)
+        << ", where max_abs_error is" << max_abs_error;
+  }
+
+  // Implements floating point equality matcher as a Matcher<T>.
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
+        : expected_(expected),
+          nan_eq_nan_(nan_eq_nan),
+          max_abs_error_(max_abs_error) {}
+
+    virtual bool MatchAndExplain(T value,
+                                 MatchResultListener* listener) const {
+      const FloatingPoint<FloatType> actual(value), expected(expected_);
+
+      // Compares NaNs first, if nan_eq_nan_ is true.
+      if (actual.is_nan() || expected.is_nan()) {
+        if (actual.is_nan() && expected.is_nan()) {
+          return nan_eq_nan_;
+        }
+        // One is nan; the other is not nan.
+        return false;
+      }
+      if (HasMaxAbsError()) {
+        // We perform an equality check so that inf will match inf, regardless
+        // of error bounds.  If the result of value - expected_ would result in
+        // overflow or if either value is inf, the default result is infinity,
+        // which should only match if max_abs_error_ is also infinity.
+        if (value == expected_) {
+          return true;
+        }
+
+        const FloatType diff = value - expected_;
+        if (fabs(diff) <= max_abs_error_) {
+          return true;
+        }
+
+        if (listener->IsInterested()) {
+          *listener << "which is " << diff << " from " << expected_;
+        }
+        return false;
+      } else {
+        return actual.AlmostEquals(expected);
+      }
+    }
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      // os->precision() returns the previously set precision, which we
+      // store to restore the ostream to its original configuration
+      // after outputting.
+      const ::std::streamsize old_precision = os->precision(
+          ::std::numeric_limits<FloatType>::digits10 + 2);
+      if (FloatingPoint<FloatType>(expected_).is_nan()) {
+        if (nan_eq_nan_) {
+          *os << "is NaN";
+        } else {
+          *os << "never matches";
+        }
+      } else {
+        *os << "is approximately " << expected_;
+        if (HasMaxAbsError()) {
+          *os << " (absolute error <= " << max_abs_error_ << ")";
+        }
+      }
+      os->precision(old_precision);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      // As before, get original precision.
+      const ::std::streamsize old_precision = os->precision(
+          ::std::numeric_limits<FloatType>::digits10 + 2);
+      if (FloatingPoint<FloatType>(expected_).is_nan()) {
+        if (nan_eq_nan_) {
+          *os << "isn't NaN";
+        } else {
+          *os << "is anything";
+        }
+      } else {
+        *os << "isn't approximately " << expected_;
+        if (HasMaxAbsError()) {
+          *os << " (absolute error > " << max_abs_error_ << ")";
+        }
+      }
+      // Restore original precision.
+      os->precision(old_precision);
+    }
+
+   private:
+    bool HasMaxAbsError() const {
+      return max_abs_error_ >= 0;
+    }
+
+    const FloatType expected_;
+    const bool nan_eq_nan_;
+    // max_abs_error will be used for value comparison when >= 0.
+    const FloatType max_abs_error_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  // The following 3 type conversion operators allow FloatEq(expected) and
+  // NanSensitiveFloatEq(expected) to be used as a Matcher<float>, a
+  // Matcher<const float&>, or a Matcher<float&>, but nothing else.
+  // (While Google's C++ coding style doesn't allow arguments passed
+  // by non-const reference, we may see them in code not conforming to
+  // the style.  Therefore Google Mock needs to support them.)
+  operator Matcher<FloatType>() const {
+    return MakeMatcher(
+        new Impl<FloatType>(expected_, nan_eq_nan_, max_abs_error_));
+  }
+
+  operator Matcher<const FloatType&>() const {
+    return MakeMatcher(
+        new Impl<const FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
+  }
+
+  operator Matcher<FloatType&>() const {
+    return MakeMatcher(
+        new Impl<FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
+  }
+
+ private:
+  const FloatType expected_;
+  const bool nan_eq_nan_;
+  // max_abs_error will be used for value comparison when >= 0.
+  const FloatType max_abs_error_;
+
+  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
+};
+
+// Implements the Pointee(m) matcher for matching a pointer whose
+// pointee matches matcher m.  The pointer can be either raw or smart.
+template <typename InnerMatcher>
+class PointeeMatcher {
+ public:
+  explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
+
+  // This type conversion operator template allows Pointee(m) to be
+  // used as a matcher for any pointer type whose pointee type is
+  // compatible with the inner matcher, where type Pointer can be
+  // either a raw pointer or a smart pointer.
+  //
+  // The reason we do this instead of relying on
+  // MakePolymorphicMatcher() is that the latter is not flexible
+  // enough for implementing the DescribeTo() method of Pointee().
+  template <typename Pointer>
+  operator Matcher<Pointer>() const {
+    return MakeMatcher(new Impl<Pointer>(matcher_));
+  }
+
+ private:
+  // The monomorphic implementation that works for a particular pointer type.
+  template <typename Pointer>
+  class Impl : public MatcherInterface<Pointer> {
+   public:
+    typedef typename PointeeOf<GTEST_REMOVE_CONST_(  // NOLINT
+        GTEST_REMOVE_REFERENCE_(Pointer))>::type Pointee;
+
+    explicit Impl(const InnerMatcher& matcher)
+        : matcher_(MatcherCast<const Pointee&>(matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "points to a value that ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "does not point to a value that ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual bool MatchAndExplain(Pointer pointer,
+                                 MatchResultListener* listener) const {
+      if (GetRawPointer(pointer) == NULL)
+        return false;
+
+      *listener << "which points to ";
+      return MatchPrintAndExplain(*pointer, matcher_, listener);
+    }
+
+   private:
+    const Matcher<const Pointee&> matcher_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const InnerMatcher matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PointeeMatcher);
+};
+
+// Implements the WhenDynamicCastTo<T>(m) matcher that matches a pointer or
+// reference that matches inner_matcher when dynamic_cast<T> is applied.
+// The result of dynamic_cast<To> is forwarded to the inner matcher.
+// If To is a pointer and the cast fails, the inner matcher will receive NULL.
+// If To is a reference and the cast fails, this matcher returns false
+// immediately.
+template <typename To>
+class WhenDynamicCastToMatcherBase {
+ public:
+  explicit WhenDynamicCastToMatcherBase(const Matcher<To>& matcher)
+      : matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    GetCastTypeDescription(os);
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    GetCastTypeDescription(os);
+    matcher_.DescribeNegationTo(os);
+  }
+
+ protected:
+  const Matcher<To> matcher_;
+
+  static string GetToName() {
+#if GTEST_HAS_RTTI
+    return GetTypeName<To>();
+#else  // GTEST_HAS_RTTI
+    return "the target type";
+#endif  // GTEST_HAS_RTTI
+  }
+
+ private:
+  static void GetCastTypeDescription(::std::ostream* os) {
+    *os << "when dynamic_cast to " << GetToName() << ", ";
+  }
+
+  GTEST_DISALLOW_ASSIGN_(WhenDynamicCastToMatcherBase);
+};
+
+// Primary template.
+// To is a pointer. Cast and forward the result.
+template <typename To>
+class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
+ public:
+  explicit WhenDynamicCastToMatcher(const Matcher<To>& matcher)
+      : WhenDynamicCastToMatcherBase<To>(matcher) {}
+
+  template <typename From>
+  bool MatchAndExplain(From from, MatchResultListener* listener) const {
+    // TODO(sbenza): Add more detail on failures. ie did the dyn_cast fail?
+    To to = dynamic_cast<To>(from);
+    return MatchPrintAndExplain(to, this->matcher_, listener);
+  }
+};
+
+// Specialize for references.
+// In this case we return false if the dynamic_cast fails.
+template <typename To>
+class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
+ public:
+  explicit WhenDynamicCastToMatcher(const Matcher<To&>& matcher)
+      : WhenDynamicCastToMatcherBase<To&>(matcher) {}
+
+  template <typename From>
+  bool MatchAndExplain(From& from, MatchResultListener* listener) const {
+    // We don't want an std::bad_cast here, so do the cast with pointers.
+    To* to = dynamic_cast<To*>(&from);
+    if (to == NULL) {
+      *listener << "which cannot be dynamic_cast to " << this->GetToName();
+      return false;
+    }
+    return MatchPrintAndExplain(*to, this->matcher_, listener);
+  }
+};
+
+// Implements the Field() matcher for matching a field (i.e. member
+// variable) of an object.
+template <typename Class, typename FieldType>
+class FieldMatcher {
+ public:
+  FieldMatcher(FieldType Class::*field,
+               const Matcher<const FieldType&>& matcher)
+      : field_(field), matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "is an object whose given field ";
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is an object whose given field ";
+    matcher_.DescribeNegationTo(os);
+  }
+
+  template <typename T>
+  bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
+    return MatchAndExplainImpl(
+        typename ::testing::internal::
+            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
+        value, listener);
+  }
+
+ private:
+  // The first argument of MatchAndExplainImpl() is needed to help
+  // Symbian's C++ compiler choose which overload to use.  Its type is
+  // true_type iff the Field() matcher is used to match a pointer.
+  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
+                           MatchResultListener* listener) const {
+    *listener << "whose given field is ";
+    return MatchPrintAndExplain(obj.*field_, matcher_, listener);
+  }
+
+  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
+                           MatchResultListener* listener) const {
+    if (p == NULL)
+      return false;
+
+    *listener << "which points to an object ";
+    // Since *p has a field, it must be a class/struct/union type and
+    // thus cannot be a pointer.  Therefore we pass false_type() as
+    // the first argument.
+    return MatchAndExplainImpl(false_type(), *p, listener);
+  }
+
+  const FieldType Class::*field_;
+  const Matcher<const FieldType&> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(FieldMatcher);
+};
+
+// Implements the Property() matcher for matching a property
+// (i.e. return value of a getter method) of an object.
+template <typename Class, typename PropertyType>
+class PropertyMatcher {
+ public:
+  // The property may have a reference type, so 'const PropertyType&'
+  // may cause double references and fail to compile.  That's why we
+  // need GTEST_REFERENCE_TO_CONST, which works regardless of
+  // PropertyType being a reference or not.
+  typedef GTEST_REFERENCE_TO_CONST_(PropertyType) RefToConstProperty;
+
+  PropertyMatcher(PropertyType (Class::*property)() const,
+                  const Matcher<RefToConstProperty>& matcher)
+      : property_(property), matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "is an object whose given property ";
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is an object whose given property ";
+    matcher_.DescribeNegationTo(os);
+  }
+
+  template <typename T>
+  bool MatchAndExplain(const T&value, MatchResultListener* listener) const {
+    return MatchAndExplainImpl(
+        typename ::testing::internal::
+            is_pointer<GTEST_REMOVE_CONST_(T)>::type(),
+        value, listener);
+  }
+
+ private:
+  // The first argument of MatchAndExplainImpl() is needed to help
+  // Symbian's C++ compiler choose which overload to use.  Its type is
+  // true_type iff the Property() matcher is used to match a pointer.
+  bool MatchAndExplainImpl(false_type /* is_not_pointer */, const Class& obj,
+                           MatchResultListener* listener) const {
+    *listener << "whose given property is ";
+    // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
+    // which takes a non-const reference as argument.
+#if defined(_PREFAST_ ) && _MSC_VER == 1800
+    // Workaround bug in VC++ 2013's /analyze parser.
+    // https://connect.microsoft.com/VisualStudio/feedback/details/1106363/internal-compiler-error-with-analyze-due-to-failure-to-infer-move
+    posix::Abort();  // To make sure it is never run.
+    return false;
+#else
+    RefToConstProperty result = (obj.*property_)();
+    return MatchPrintAndExplain(result, matcher_, listener);
+#endif
+  }
+
+  bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
+                           MatchResultListener* listener) const {
+    if (p == NULL)
+      return false;
+
+    *listener << "which points to an object ";
+    // Since *p has a property method, it must be a class/struct/union
+    // type and thus cannot be a pointer.  Therefore we pass
+    // false_type() as the first argument.
+    return MatchAndExplainImpl(false_type(), *p, listener);
+  }
+
+  PropertyType (Class::*property_)() const;
+  const Matcher<RefToConstProperty> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PropertyMatcher);
+};
+
+// Type traits specifying various features of different functors for ResultOf.
+// The default template specifies features for functor objects.
+// Functor classes have to typedef argument_type and result_type
+// to be compatible with ResultOf.
+template <typename Functor>
+struct CallableTraits {
+  typedef typename Functor::result_type ResultType;
+  typedef Functor StorageType;
+
+  static void CheckIsValid(Functor /* functor */) {}
+  template <typename T>
+  static ResultType Invoke(Functor f, T arg) { return f(arg); }
+};
+
+// Specialization for function pointers.
+template <typename ArgType, typename ResType>
+struct CallableTraits<ResType(*)(ArgType)> {
+  typedef ResType ResultType;
+  typedef ResType(*StorageType)(ArgType);
+
+  static void CheckIsValid(ResType(*f)(ArgType)) {
+    GTEST_CHECK_(f != NULL)
+        << "NULL function pointer is passed into ResultOf().";
+  }
+  template <typename T>
+  static ResType Invoke(ResType(*f)(ArgType), T arg) {
+    return (*f)(arg);
+  }
+};
+
+// Implements the ResultOf() matcher for matching a return value of a
+// unary function of an object.
+template <typename Callable>
+class ResultOfMatcher {
+ public:
+  typedef typename CallableTraits<Callable>::ResultType ResultType;
+
+  ResultOfMatcher(Callable callable, const Matcher<ResultType>& matcher)
+      : callable_(callable), matcher_(matcher) {
+    CallableTraits<Callable>::CheckIsValid(callable_);
+  }
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return Matcher<T>(new Impl<T>(callable_, matcher_));
+  }
+
+ private:
+  typedef typename CallableTraits<Callable>::StorageType CallableStorageType;
+
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    Impl(CallableStorageType callable, const Matcher<ResultType>& matcher)
+        : callable_(callable), matcher_(matcher) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "is mapped by the given callable to a value that ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "is mapped by the given callable to a value that ";
+      matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(T obj, MatchResultListener* listener) const {
+      *listener << "which is mapped by the given callable to ";
+      // Cannot pass the return value (for example, int) to
+      // MatchPrintAndExplain, which takes a non-const reference as argument.
+      ResultType result =
+          CallableTraits<Callable>::template Invoke<T>(callable_, obj);
+      return MatchPrintAndExplain(result, matcher_, listener);
+    }
+
+   private:
+    // Functors often define operator() as non-const method even though
+    // they are actualy stateless. But we need to use them even when
+    // 'this' is a const pointer. It's the user's responsibility not to
+    // use stateful callables with ResultOf(), which does't guarantee
+    // how many times the callable will be invoked.
+    mutable CallableStorageType callable_;
+    const Matcher<ResultType> matcher_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };  // class Impl
+
+  const CallableStorageType callable_;
+  const Matcher<ResultType> matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ResultOfMatcher);
+};
+
+// Implements a matcher that checks the size of an STL-style container.
+template <typename SizeMatcher>
+class SizeIsMatcher {
+ public:
+  explicit SizeIsMatcher(const SizeMatcher& size_matcher)
+       : size_matcher_(size_matcher) {
+  }
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new Impl<Container>(size_matcher_));
+  }
+
+  template <typename Container>
+  class Impl : public MatcherInterface<Container> {
+   public:
+    typedef internal::StlContainerView<
+         GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
+    typedef typename ContainerView::type::size_type SizeType;
+    explicit Impl(const SizeMatcher& size_matcher)
+        : size_matcher_(MatcherCast<SizeType>(size_matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "size ";
+      size_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "size ";
+      size_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(Container container,
+                                 MatchResultListener* listener) const {
+      SizeType size = container.size();
+      StringMatchResultListener size_listener;
+      const bool result = size_matcher_.MatchAndExplain(size, &size_listener);
+      *listener
+          << "whose size " << size << (result ? " matches" : " doesn't match");
+      PrintIfNotEmpty(size_listener.str(), listener->stream());
+      return result;
+    }
+
+   private:
+    const Matcher<SizeType> size_matcher_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const SizeMatcher size_matcher_;
+  GTEST_DISALLOW_ASSIGN_(SizeIsMatcher);
+};
+
+// Implements a matcher that checks the begin()..end() distance of an STL-style
+// container.
+template <typename DistanceMatcher>
+class BeginEndDistanceIsMatcher {
+ public:
+  explicit BeginEndDistanceIsMatcher(const DistanceMatcher& distance_matcher)
+      : distance_matcher_(distance_matcher) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new Impl<Container>(distance_matcher_));
+  }
+
+  template <typename Container>
+  class Impl : public MatcherInterface<Container> {
+   public:
+    typedef internal::StlContainerView<
+        GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
+    typedef typename std::iterator_traits<
+        typename ContainerView::type::const_iterator>::difference_type
+        DistanceType;
+    explicit Impl(const DistanceMatcher& distance_matcher)
+        : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "distance between begin() and end() ";
+      distance_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "distance between begin() and end() ";
+      distance_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(Container container,
+                                 MatchResultListener* listener) const {
+#if GTEST_HAS_STD_BEGIN_AND_END_
+      using std::begin;
+      using std::end;
+      DistanceType distance = std::distance(begin(container), end(container));
+#else
+      DistanceType distance = std::distance(container.begin(), container.end());
+#endif
+      StringMatchResultListener distance_listener;
+      const bool result =
+          distance_matcher_.MatchAndExplain(distance, &distance_listener);
+      *listener << "whose distance between begin() and end() " << distance
+                << (result ? " matches" : " doesn't match");
+      PrintIfNotEmpty(distance_listener.str(), listener->stream());
+      return result;
+    }
+
+   private:
+    const Matcher<DistanceType> distance_matcher_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const DistanceMatcher distance_matcher_;
+  GTEST_DISALLOW_ASSIGN_(BeginEndDistanceIsMatcher);
+};
+
+// Implements an equality matcher for any STL-style container whose elements
+// support ==. This matcher is like Eq(), but its failure explanations provide
+// more detailed information that is useful when the container is used as a set.
+// The failure message reports elements that are in one of the operands but not
+// the other. The failure messages do not report duplicate or out-of-order
+// elements in the containers (which don't properly matter to sets, but can
+// occur if the containers are vectors or lists, for example).
+//
+// Uses the container's const_iterator, value_type, operator ==,
+// begin(), and end().
+template <typename Container>
+class ContainerEqMatcher {
+ public:
+  typedef internal::StlContainerView<Container> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+
+  // We make a copy of expected in case the elements in it are modified
+  // after this matcher is created.
+  explicit ContainerEqMatcher(const Container& expected)
+      : expected_(View::Copy(expected)) {
+    // Makes sure the user doesn't instantiate this class template
+    // with a const or reference type.
+    (void)testing::StaticAssertTypeEq<Container,
+        GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>();
+  }
+
+  void DescribeTo(::std::ostream* os) const {
+    *os << "equals ";
+    UniversalPrint(expected_, os);
+  }
+  void DescribeNegationTo(::std::ostream* os) const {
+    *os << "does not equal ";
+    UniversalPrint(expected_, os);
+  }
+
+  template <typename LhsContainer>
+  bool MatchAndExplain(const LhsContainer& lhs,
+                       MatchResultListener* listener) const {
+    // GTEST_REMOVE_CONST_() is needed to work around an MSVC 8.0 bug
+    // that causes LhsContainer to be a const type sometimes.
+    typedef internal::StlContainerView<GTEST_REMOVE_CONST_(LhsContainer)>
+        LhsView;
+    typedef typename LhsView::type LhsStlContainer;
+    StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
+    if (lhs_stl_container == expected_)
+      return true;
+
+    ::std::ostream* const os = listener->stream();
+    if (os != NULL) {
+      // Something is different. Check for extra values first.
+      bool printed_header = false;
+      for (typename LhsStlContainer::const_iterator it =
+               lhs_stl_container.begin();
+           it != lhs_stl_container.end(); ++it) {
+        if (internal::ArrayAwareFind(expected_.begin(), expected_.end(), *it) ==
+            expected_.end()) {
+          if (printed_header) {
+            *os << ", ";
+          } else {
+            *os << "which has these unexpected elements: ";
+            printed_header = true;
+          }
+          UniversalPrint(*it, os);
+        }
+      }
+
+      // Now check for missing values.
+      bool printed_header2 = false;
+      for (typename StlContainer::const_iterator it = expected_.begin();
+           it != expected_.end(); ++it) {
+        if (internal::ArrayAwareFind(
+                lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
+            lhs_stl_container.end()) {
+          if (printed_header2) {
+            *os << ", ";
+          } else {
+            *os << (printed_header ? ",\nand" : "which")
+                << " doesn't have these expected elements: ";
+            printed_header2 = true;
+          }
+          UniversalPrint(*it, os);
+        }
+      }
+    }
+
+    return false;
+  }
+
+ private:
+  const StlContainer expected_;
+
+  GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher);
+};
+
+// A comparator functor that uses the < operator to compare two values.
+struct LessComparator {
+  template <typename T, typename U>
+  bool operator()(const T& lhs, const U& rhs) const { return lhs < rhs; }
+};
+
+// Implements WhenSortedBy(comparator, container_matcher).
+template <typename Comparator, typename ContainerMatcher>
+class WhenSortedByMatcher {
+ public:
+  WhenSortedByMatcher(const Comparator& comparator,
+                      const ContainerMatcher& matcher)
+      : comparator_(comparator), matcher_(matcher) {}
+
+  template <typename LhsContainer>
+  operator Matcher<LhsContainer>() const {
+    return MakeMatcher(new Impl<LhsContainer>(comparator_, matcher_));
+  }
+
+  template <typename LhsContainer>
+  class Impl : public MatcherInterface<LhsContainer> {
+   public:
+    typedef internal::StlContainerView<
+         GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;
+    typedef typename LhsView::type LhsStlContainer;
+    typedef typename LhsView::const_reference LhsStlContainerReference;
+    // Transforms std::pair<const Key, Value> into std::pair<Key, Value>
+    // so that we can match associative containers.
+    typedef typename RemoveConstFromKey<
+        typename LhsStlContainer::value_type>::type LhsValue;
+
+    Impl(const Comparator& comparator, const ContainerMatcher& matcher)
+        : comparator_(comparator), matcher_(matcher) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "(when sorted) ";
+      matcher_.DescribeTo(os);
+    }
+
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "(when sorted) ";
+      matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(LhsContainer lhs,
+                                 MatchResultListener* listener) const {
+      LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
+      ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
+                                               lhs_stl_container.end());
+      ::std::sort(
+           sorted_container.begin(), sorted_container.end(), comparator_);
+
+      if (!listener->IsInterested()) {
+        // If the listener is not interested, we do not need to
+        // construct the inner explanation.
+        return matcher_.Matches(sorted_container);
+      }
+
+      *listener << "which is ";
+      UniversalPrint(sorted_container, listener->stream());
+      *listener << " when sorted";
+
+      StringMatchResultListener inner_listener;
+      const bool match = matcher_.MatchAndExplain(sorted_container,
+                                                  &inner_listener);
+      PrintIfNotEmpty(inner_listener.str(), listener->stream());
+      return match;
+    }
+
+   private:
+    const Comparator comparator_;
+    const Matcher<const ::std::vector<LhsValue>&> matcher_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
+  };
+
+ private:
+  const Comparator comparator_;
+  const ContainerMatcher matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher);
+};
+
+// Implements Pointwise(tuple_matcher, rhs_container).  tuple_matcher
+// must be able to be safely cast to Matcher<tuple<const T1&, const
+// T2&> >, where T1 and T2 are the types of elements in the LHS
+// container and the RHS container respectively.
+template <typename TupleMatcher, typename RhsContainer>
+class PointwiseMatcher {
+ public:
+  typedef internal::StlContainerView<RhsContainer> RhsView;
+  typedef typename RhsView::type RhsStlContainer;
+  typedef typename RhsStlContainer::value_type RhsValue;
+
+  // Like ContainerEq, we make a copy of rhs in case the elements in
+  // it are modified after this matcher is created.
+  PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs)
+      : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {
+    // Makes sure the user doesn't instantiate this class template
+    // with a const or reference type.
+    (void)testing::StaticAssertTypeEq<RhsContainer,
+        GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>();
+  }
+
+  template <typename LhsContainer>
+  operator Matcher<LhsContainer>() const {
+    return MakeMatcher(new Impl<LhsContainer>(tuple_matcher_, rhs_));
+  }
+
+  template <typename LhsContainer>
+  class Impl : public MatcherInterface<LhsContainer> {
+   public:
+    typedef internal::StlContainerView<
+         GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)> LhsView;
+    typedef typename LhsView::type LhsStlContainer;
+    typedef typename LhsView::const_reference LhsStlContainerReference;
+    typedef typename LhsStlContainer::value_type LhsValue;
+    // We pass the LHS value and the RHS value to the inner matcher by
+    // reference, as they may be expensive to copy.  We must use tuple
+    // instead of pair here, as a pair cannot hold references (C++ 98,
+    // 20.2.2 [lib.pairs]).
+    typedef ::testing::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
+
+    Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
+        // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
+        : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
+          rhs_(rhs) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "contains " << rhs_.size()
+          << " values, where each value and its corresponding value in ";
+      UniversalPrinter<RhsStlContainer>::Print(rhs_, os);
+      *os << " ";
+      mono_tuple_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "doesn't contain exactly " << rhs_.size()
+          << " values, or contains a value x at some index i"
+          << " where x and the i-th value of ";
+      UniversalPrint(rhs_, os);
+      *os << " ";
+      mono_tuple_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(LhsContainer lhs,
+                                 MatchResultListener* listener) const {
+      LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
+      const size_t actual_size = lhs_stl_container.size();
+      if (actual_size != rhs_.size()) {
+        *listener << "which contains " << actual_size << " values";
+        return false;
+      }
+
+      typename LhsStlContainer::const_iterator left = lhs_stl_container.begin();
+      typename RhsStlContainer::const_iterator right = rhs_.begin();
+      for (size_t i = 0; i != actual_size; ++i, ++left, ++right) {
+        const InnerMatcherArg value_pair(*left, *right);
+
+        if (listener->IsInterested()) {
+          StringMatchResultListener inner_listener;
+          if (!mono_tuple_matcher_.MatchAndExplain(
+                  value_pair, &inner_listener)) {
+            *listener << "where the value pair (";
+            UniversalPrint(*left, listener->stream());
+            *listener << ", ";
+            UniversalPrint(*right, listener->stream());
+            *listener << ") at index #" << i << " don't match";
+            PrintIfNotEmpty(inner_listener.str(), listener->stream());
+            return false;
+          }
+        } else {
+          if (!mono_tuple_matcher_.Matches(value_pair))
+            return false;
+        }
+      }
+
+      return true;
+    }
+
+   private:
+    const Matcher<InnerMatcherArg> mono_tuple_matcher_;
+    const RhsStlContainer rhs_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const TupleMatcher tuple_matcher_;
+  const RhsStlContainer rhs_;
+
+  GTEST_DISALLOW_ASSIGN_(PointwiseMatcher);
+};
+
+// Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
+template <typename Container>
+class QuantifierMatcherImpl : public MatcherInterface<Container> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+  typedef StlContainerView<RawContainer> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+  typedef typename StlContainer::value_type Element;
+
+  template <typename InnerMatcher>
+  explicit QuantifierMatcherImpl(InnerMatcher inner_matcher)
+      : inner_matcher_(
+           testing::SafeMatcherCast<const Element&>(inner_matcher)) {}
+
+  // Checks whether:
+  // * All elements in the container match, if all_elements_should_match.
+  // * Any element in the container matches, if !all_elements_should_match.
+  bool MatchAndExplainImpl(bool all_elements_should_match,
+                           Container container,
+                           MatchResultListener* listener) const {
+    StlContainerReference stl_container = View::ConstReference(container);
+    size_t i = 0;
+    for (typename StlContainer::const_iterator it = stl_container.begin();
+         it != stl_container.end(); ++it, ++i) {
+      StringMatchResultListener inner_listener;
+      const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
+
+      if (matches != all_elements_should_match) {
+        *listener << "whose element #" << i
+                  << (matches ? " matches" : " doesn't match");
+        PrintIfNotEmpty(inner_listener.str(), listener->stream());
+        return !all_elements_should_match;
+      }
+    }
+    return all_elements_should_match;
+  }
+
+ protected:
+  const Matcher<const Element&> inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl);
+};
+
+// Implements Contains(element_matcher) for the given argument type Container.
+// Symmetric to EachMatcherImpl.
+template <typename Container>
+class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
+ public:
+  template <typename InnerMatcher>
+  explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
+      : QuantifierMatcherImpl<Container>(inner_matcher) {}
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "contains at least one element that ";
+    this->inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't contain any element that ";
+    this->inner_matcher_.DescribeTo(os);
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    return this->MatchAndExplainImpl(false, container, listener);
+  }
+
+ private:
+  GTEST_DISALLOW_ASSIGN_(ContainsMatcherImpl);
+};
+
+// Implements Each(element_matcher) for the given argument type Container.
+// Symmetric to ContainsMatcherImpl.
+template <typename Container>
+class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
+ public:
+  template <typename InnerMatcher>
+  explicit EachMatcherImpl(InnerMatcher inner_matcher)
+      : QuantifierMatcherImpl<Container>(inner_matcher) {}
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "only contains elements that ";
+    this->inner_matcher_.DescribeTo(os);
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "contains some element that ";
+    this->inner_matcher_.DescribeNegationTo(os);
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    return this->MatchAndExplainImpl(true, container, listener);
+  }
+
+ private:
+  GTEST_DISALLOW_ASSIGN_(EachMatcherImpl);
+};
+
+// Implements polymorphic Contains(element_matcher).
+template <typename M>
+class ContainsMatcher {
+ public:
+  explicit ContainsMatcher(M m) : inner_matcher_(m) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new ContainsMatcherImpl<Container>(inner_matcher_));
+  }
+
+ private:
+  const M inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(ContainsMatcher);
+};
+
+// Implements polymorphic Each(element_matcher).
+template <typename M>
+class EachMatcher {
+ public:
+  explicit EachMatcher(M m) : inner_matcher_(m) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new EachMatcherImpl<Container>(inner_matcher_));
+  }
+
+ private:
+  const M inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(EachMatcher);
+};
+
+// Implements Key(inner_matcher) for the given argument pair type.
+// Key(inner_matcher) matches an std::pair whose 'first' field matches
+// inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an
+// std::map that contains at least one element whose key is >= 5.
+template <typename PairType>
+class KeyMatcherImpl : public MatcherInterface<PairType> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
+  typedef typename RawPairType::first_type KeyType;
+
+  template <typename InnerMatcher>
+  explicit KeyMatcherImpl(InnerMatcher inner_matcher)
+      : inner_matcher_(
+          testing::SafeMatcherCast<const KeyType&>(inner_matcher)) {
+  }
+
+  // Returns true iff 'key_value.first' (the key) matches the inner matcher.
+  virtual bool MatchAndExplain(PairType key_value,
+                               MatchResultListener* listener) const {
+    StringMatchResultListener inner_listener;
+    const bool match = inner_matcher_.MatchAndExplain(key_value.first,
+                                                      &inner_listener);
+    const internal::string explanation = inner_listener.str();
+    if (explanation != "") {
+      *listener << "whose first field is a value " << explanation;
+    }
+    return match;
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "has a key that ";
+    inner_matcher_.DescribeTo(os);
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "doesn't have a key that ";
+    inner_matcher_.DescribeTo(os);
+  }
+
+ private:
+  const Matcher<const KeyType&> inner_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(KeyMatcherImpl);
+};
+
+// Implements polymorphic Key(matcher_for_key).
+template <typename M>
+class KeyMatcher {
+ public:
+  explicit KeyMatcher(M m) : matcher_for_key_(m) {}
+
+  template <typename PairType>
+  operator Matcher<PairType>() const {
+    return MakeMatcher(new KeyMatcherImpl<PairType>(matcher_for_key_));
+  }
+
+ private:
+  const M matcher_for_key_;
+
+  GTEST_DISALLOW_ASSIGN_(KeyMatcher);
+};
+
+// Implements Pair(first_matcher, second_matcher) for the given argument pair
+// type with its two matchers. See Pair() function below.
+template <typename PairType>
+class PairMatcherImpl : public MatcherInterface<PairType> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
+  typedef typename RawPairType::first_type FirstType;
+  typedef typename RawPairType::second_type SecondType;
+
+  template <typename FirstMatcher, typename SecondMatcher>
+  PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
+      : first_matcher_(
+            testing::SafeMatcherCast<const FirstType&>(first_matcher)),
+        second_matcher_(
+            testing::SafeMatcherCast<const SecondType&>(second_matcher)) {
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "has a first field that ";
+    first_matcher_.DescribeTo(os);
+    *os << ", and has a second field that ";
+    second_matcher_.DescribeTo(os);
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "has a first field that ";
+    first_matcher_.DescribeNegationTo(os);
+    *os << ", or has a second field that ";
+    second_matcher_.DescribeNegationTo(os);
+  }
+
+  // Returns true iff 'a_pair.first' matches first_matcher and 'a_pair.second'
+  // matches second_matcher.
+  virtual bool MatchAndExplain(PairType a_pair,
+                               MatchResultListener* listener) const {
+    if (!listener->IsInterested()) {
+      // If the listener is not interested, we don't need to construct the
+      // explanation.
+      return first_matcher_.Matches(a_pair.first) &&
+             second_matcher_.Matches(a_pair.second);
+    }
+    StringMatchResultListener first_inner_listener;
+    if (!first_matcher_.MatchAndExplain(a_pair.first,
+                                        &first_inner_listener)) {
+      *listener << "whose first field does not match";
+      PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
+      return false;
+    }
+    StringMatchResultListener second_inner_listener;
+    if (!second_matcher_.MatchAndExplain(a_pair.second,
+                                         &second_inner_listener)) {
+      *listener << "whose second field does not match";
+      PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
+      return false;
+    }
+    ExplainSuccess(first_inner_listener.str(), second_inner_listener.str(),
+                   listener);
+    return true;
+  }
+
+ private:
+  void ExplainSuccess(const internal::string& first_explanation,
+                      const internal::string& second_explanation,
+                      MatchResultListener* listener) const {
+    *listener << "whose both fields match";
+    if (first_explanation != "") {
+      *listener << ", where the first field is a value " << first_explanation;
+    }
+    if (second_explanation != "") {
+      *listener << ", ";
+      if (first_explanation != "") {
+        *listener << "and ";
+      } else {
+        *listener << "where ";
+      }
+      *listener << "the second field is a value " << second_explanation;
+    }
+  }
+
+  const Matcher<const FirstType&> first_matcher_;
+  const Matcher<const SecondType&> second_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PairMatcherImpl);
+};
+
+// Implements polymorphic Pair(first_matcher, second_matcher).
+template <typename FirstMatcher, typename SecondMatcher>
+class PairMatcher {
+ public:
+  PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
+      : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
+
+  template <typename PairType>
+  operator Matcher<PairType> () const {
+    return MakeMatcher(
+        new PairMatcherImpl<PairType>(
+            first_matcher_, second_matcher_));
+  }
+
+ private:
+  const FirstMatcher first_matcher_;
+  const SecondMatcher second_matcher_;
+
+  GTEST_DISALLOW_ASSIGN_(PairMatcher);
+};
+
+// Implements ElementsAre() and ElementsAreArray().
+template <typename Container>
+class ElementsAreMatcherImpl : public MatcherInterface<Container> {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+  typedef internal::StlContainerView<RawContainer> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+  typedef typename StlContainer::value_type Element;
+
+  // Constructs the matcher from a sequence of element values or
+  // element matchers.
+  template <typename InputIter>
+  ElementsAreMatcherImpl(InputIter first, InputIter last) {
+    while (first != last) {
+      matchers_.push_back(MatcherCast<const Element&>(*first++));
+    }
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    if (count() == 0) {
+      *os << "is empty";
+    } else if (count() == 1) {
+      *os << "has 1 element that ";
+      matchers_[0].DescribeTo(os);
+    } else {
+      *os << "has " << Elements(count()) << " where\n";
+      for (size_t i = 0; i != count(); ++i) {
+        *os << "element #" << i << " ";
+        matchers_[i].DescribeTo(os);
+        if (i + 1 < count()) {
+          *os << ",\n";
+        }
+      }
+    }
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    if (count() == 0) {
+      *os << "isn't empty";
+      return;
+    }
+
+    *os << "doesn't have " << Elements(count()) << ", or\n";
+    for (size_t i = 0; i != count(); ++i) {
+      *os << "element #" << i << " ";
+      matchers_[i].DescribeNegationTo(os);
+      if (i + 1 < count()) {
+        *os << ", or\n";
+      }
+    }
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    // To work with stream-like "containers", we must only walk
+    // through the elements in one pass.
+
+    const bool listener_interested = listener->IsInterested();
+
+    // explanations[i] is the explanation of the element at index i.
+    ::std::vector<internal::string> explanations(count());
+    StlContainerReference stl_container = View::ConstReference(container);
+    typename StlContainer::const_iterator it = stl_container.begin();
+    size_t exam_pos = 0;
+    bool mismatch_found = false;  // Have we found a mismatched element yet?
+
+    // Go through the elements and matchers in pairs, until we reach
+    // the end of either the elements or the matchers, or until we find a
+    // mismatch.
+    for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {
+      bool match;  // Does the current element match the current matcher?
+      if (listener_interested) {
+        StringMatchResultListener s;
+        match = matchers_[exam_pos].MatchAndExplain(*it, &s);
+        explanations[exam_pos] = s.str();
+      } else {
+        match = matchers_[exam_pos].Matches(*it);
+      }
+
+      if (!match) {
+        mismatch_found = true;
+        break;
+      }
+    }
+    // If mismatch_found is true, 'exam_pos' is the index of the mismatch.
+
+    // Find how many elements the actual container has.  We avoid
+    // calling size() s.t. this code works for stream-like "containers"
+    // that don't define size().
+    size_t actual_count = exam_pos;
+    for (; it != stl_container.end(); ++it) {
+      ++actual_count;
+    }
+
+    if (actual_count != count()) {
+      // The element count doesn't match.  If the container is empty,
+      // there's no need to explain anything as Google Mock already
+      // prints the empty container.  Otherwise we just need to show
+      // how many elements there actually are.
+      if (listener_interested && (actual_count != 0)) {
+        *listener << "which has " << Elements(actual_count);
+      }
+      return false;
+    }
+
+    if (mismatch_found) {
+      // The element count matches, but the exam_pos-th element doesn't match.
+      if (listener_interested) {
+        *listener << "whose element #" << exam_pos << " doesn't match";
+        PrintIfNotEmpty(explanations[exam_pos], listener->stream());
+      }
+      return false;
+    }
+
+    // Every element matches its expectation.  We need to explain why
+    // (the obvious ones can be skipped).
+    if (listener_interested) {
+      bool reason_printed = false;
+      for (size_t i = 0; i != count(); ++i) {
+        const internal::string& s = explanations[i];
+        if (!s.empty()) {
+          if (reason_printed) {
+            *listener << ",\nand ";
+          }
+          *listener << "whose element #" << i << " matches, " << s;
+          reason_printed = true;
+        }
+      }
+    }
+    return true;
+  }
+
+ private:
+  static Message Elements(size_t count) {
+    return Message() << count << (count == 1 ? " element" : " elements");
+  }
+
+  size_t count() const { return matchers_.size(); }
+
+  ::std::vector<Matcher<const Element&> > matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl);
+};
+
+// Connectivity matrix of (elements X matchers), in element-major order.
+// Initially, there are no edges.
+// Use NextGraph() to iterate over all possible edge configurations.
+// Use Randomize() to generate a random edge configuration.
+class GTEST_API_ MatchMatrix {
+ public:
+  MatchMatrix(size_t num_elements, size_t num_matchers)
+      : num_elements_(num_elements),
+        num_matchers_(num_matchers),
+        matched_(num_elements_* num_matchers_, 0) {
+  }
+
+  size_t LhsSize() const { return num_elements_; }
+  size_t RhsSize() const { return num_matchers_; }
+  bool HasEdge(size_t ilhs, size_t irhs) const {
+    return matched_[SpaceIndex(ilhs, irhs)] == 1;
+  }
+  void SetEdge(size_t ilhs, size_t irhs, bool b) {
+    matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;
+  }
+
+  // Treating the connectivity matrix as a (LhsSize()*RhsSize())-bit number,
+  // adds 1 to that number; returns false if incrementing the graph left it
+  // empty.
+  bool NextGraph();
+
+  void Randomize();
+
+  string DebugString() const;
+
+ private:
+  size_t SpaceIndex(size_t ilhs, size_t irhs) const {
+    return ilhs * num_matchers_ + irhs;
+  }
+
+  size_t num_elements_;
+  size_t num_matchers_;
+
+  // Each element is a char interpreted as bool. They are stored as a
+  // flattened array in lhs-major order, use 'SpaceIndex()' to translate
+  // a (ilhs, irhs) matrix coordinate into an offset.
+  ::std::vector<char> matched_;
+};
+
+typedef ::std::pair<size_t, size_t> ElementMatcherPair;
+typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs;
+
+// Returns a maximum bipartite matching for the specified graph 'g'.
+// The matching is represented as a vector of {element, matcher} pairs.
+GTEST_API_ ElementMatcherPairs
+FindMaxBipartiteMatching(const MatchMatrix& g);
+
+GTEST_API_ bool FindPairing(const MatchMatrix& matrix,
+                            MatchResultListener* listener);
+
+// Untyped base class for implementing UnorderedElementsAre.  By
+// putting logic that's not specific to the element type here, we
+// reduce binary bloat and increase compilation speed.
+class GTEST_API_ UnorderedElementsAreMatcherImplBase {
+ protected:
+  // A vector of matcher describers, one for each element matcher.
+  // Does not own the describers (and thus can be used only when the
+  // element matchers are alive).
+  typedef ::std::vector<const MatcherDescriberInterface*> MatcherDescriberVec;
+
+  // Describes this UnorderedElementsAre matcher.
+  void DescribeToImpl(::std::ostream* os) const;
+
+  // Describes the negation of this UnorderedElementsAre matcher.
+  void DescribeNegationToImpl(::std::ostream* os) const;
+
+  bool VerifyAllElementsAndMatchersAreMatched(
+      const ::std::vector<string>& element_printouts,
+      const MatchMatrix& matrix,
+      MatchResultListener* listener) const;
+
+  MatcherDescriberVec& matcher_describers() {
+    return matcher_describers_;
+  }
+
+  static Message Elements(size_t n) {
+    return Message() << n << " element" << (n == 1 ? "" : "s");
+  }
+
+ private:
+  MatcherDescriberVec matcher_describers_;
+
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImplBase);
+};
+
+// Implements unordered ElementsAre and unordered ElementsAreArray.
+template <typename Container>
+class UnorderedElementsAreMatcherImpl
+    : public MatcherInterface<Container>,
+      public UnorderedElementsAreMatcherImplBase {
+ public:
+  typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+  typedef internal::StlContainerView<RawContainer> View;
+  typedef typename View::type StlContainer;
+  typedef typename View::const_reference StlContainerReference;
+  typedef typename StlContainer::const_iterator StlContainerConstIterator;
+  typedef typename StlContainer::value_type Element;
+
+  // Constructs the matcher from a sequence of element values or
+  // element matchers.
+  template <typename InputIter>
+  UnorderedElementsAreMatcherImpl(InputIter first, InputIter last) {
+    for (; first != last; ++first) {
+      matchers_.push_back(MatcherCast<const Element&>(*first));
+      matcher_describers().push_back(matchers_.back().GetDescriber());
+    }
+  }
+
+  // Describes what this matcher does.
+  virtual void DescribeTo(::std::ostream* os) const {
+    return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os);
+  }
+
+  // Describes what the negation of this matcher does.
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os);
+  }
+
+  virtual bool MatchAndExplain(Container container,
+                               MatchResultListener* listener) const {
+    StlContainerReference stl_container = View::ConstReference(container);
+    ::std::vector<string> element_printouts;
+    MatchMatrix matrix = AnalyzeElements(stl_container.begin(),
+                                         stl_container.end(),
+                                         &element_printouts,
+                                         listener);
+
+    const size_t actual_count = matrix.LhsSize();
+    if (actual_count == 0 && matchers_.empty()) {
+      return true;
+    }
+    if (actual_count != matchers_.size()) {
+      // The element count doesn't match.  If the container is empty,
+      // there's no need to explain anything as Google Mock already
+      // prints the empty container. Otherwise we just need to show
+      // how many elements there actually are.
+      if (actual_count != 0 && listener->IsInterested()) {
+        *listener << "which has " << Elements(actual_count);
+      }
+      return false;
+    }
+
+    return VerifyAllElementsAndMatchersAreMatched(element_printouts,
+                                                  matrix, listener) &&
+           FindPairing(matrix, listener);
+  }
+
+ private:
+  typedef ::std::vector<Matcher<const Element&> > MatcherVec;
+
+  template <typename ElementIter>
+  MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last,
+                              ::std::vector<string>* element_printouts,
+                              MatchResultListener* listener) const {
+    element_printouts->clear();
+    ::std::vector<char> did_match;
+    size_t num_elements = 0;
+    for (; elem_first != elem_last; ++num_elements, ++elem_first) {
+      if (listener->IsInterested()) {
+        element_printouts->push_back(PrintToString(*elem_first));
+      }
+      for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
+        did_match.push_back(Matches(matchers_[irhs])(*elem_first));
+      }
+    }
+
+    MatchMatrix matrix(num_elements, matchers_.size());
+    ::std::vector<char>::const_iterator did_match_iter = did_match.begin();
+    for (size_t ilhs = 0; ilhs != num_elements; ++ilhs) {
+      for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
+        matrix.SetEdge(ilhs, irhs, *did_match_iter++ != 0);
+      }
+    }
+    return matrix;
+  }
+
+  MatcherVec matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImpl);
+};
+
+// Functor for use in TransformTuple.
+// Performs MatcherCast<Target> on an input argument of any type.
+template <typename Target>
+struct CastAndAppendTransform {
+  template <typename Arg>
+  Matcher<Target> operator()(const Arg& a) const {
+    return MatcherCast<Target>(a);
+  }
+};
+
+// Implements UnorderedElementsAre.
+template <typename MatcherTuple>
+class UnorderedElementsAreMatcher {
+ public:
+  explicit UnorderedElementsAreMatcher(const MatcherTuple& args)
+      : matchers_(args) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+    typedef typename internal::StlContainerView<RawContainer>::type View;
+    typedef typename View::value_type Element;
+    typedef ::std::vector<Matcher<const Element&> > MatcherVec;
+    MatcherVec matchers;
+    matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
+    TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
+                         ::std::back_inserter(matchers));
+    return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(
+                           matchers.begin(), matchers.end()));
+  }
+
+ private:
+  const MatcherTuple matchers_;
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcher);
+};
+
+// Implements ElementsAre.
+template <typename MatcherTuple>
+class ElementsAreMatcher {
+ public:
+  explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
+    typedef typename internal::StlContainerView<RawContainer>::type View;
+    typedef typename View::value_type Element;
+    typedef ::std::vector<Matcher<const Element&> > MatcherVec;
+    MatcherVec matchers;
+    matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
+    TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
+                         ::std::back_inserter(matchers));
+    return MakeMatcher(new ElementsAreMatcherImpl<Container>(
+                           matchers.begin(), matchers.end()));
+  }
+
+ private:
+  const MatcherTuple matchers_;
+  GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher);
+};
+
+// Implements UnorderedElementsAreArray().
+template <typename T>
+class UnorderedElementsAreArrayMatcher {
+ public:
+  UnorderedElementsAreArrayMatcher() {}
+
+  template <typename Iter>
+  UnorderedElementsAreArrayMatcher(Iter first, Iter last)
+      : matchers_(first, last) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(
+        new UnorderedElementsAreMatcherImpl<Container>(matchers_.begin(),
+                                                       matchers_.end()));
+  }
+
+ private:
+  ::std::vector<T> matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreArrayMatcher);
+};
+
+// Implements ElementsAreArray().
+template <typename T>
+class ElementsAreArrayMatcher {
+ public:
+  template <typename Iter>
+  ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new ElementsAreMatcherImpl<Container>(
+        matchers_.begin(), matchers_.end()));
+  }
+
+ private:
+  const ::std::vector<T> matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher);
+};
+
+// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
+// of type Second, BoundSecondMatcher<Tuple2Matcher, Second>(tm,
+// second) is a polymorphic matcher that matches a value x iff tm
+// matches tuple (x, second).  Useful for implementing
+// UnorderedPointwise() in terms of UnorderedElementsAreArray().
+//
+// BoundSecondMatcher is copyable and assignable, as we need to put
+// instances of this class in a vector when implementing
+// UnorderedPointwise().
+template <typename Tuple2Matcher, typename Second>
+class BoundSecondMatcher {
+ public:
+  BoundSecondMatcher(const Tuple2Matcher& tm, const Second& second)
+      : tuple2_matcher_(tm), second_value_(second) {}
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return MakeMatcher(new Impl<T>(tuple2_matcher_, second_value_));
+  }
+
+  // We have to define this for UnorderedPointwise() to compile in
+  // C++98 mode, as it puts BoundSecondMatcher instances in a vector,
+  // which requires the elements to be assignable in C++98.  The
+  // compiler cannot generate the operator= for us, as Tuple2Matcher
+  // and Second may not be assignable.
+  //
+  // However, this should never be called, so the implementation just
+  // need to assert.
+  void operator=(const BoundSecondMatcher& /*rhs*/) {
+    GTEST_LOG_(FATAL) << "BoundSecondMatcher should never be assigned.";
+  }
+
+ private:
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    typedef ::testing::tuple<T, Second> ArgTuple;
+
+    Impl(const Tuple2Matcher& tm, const Second& second)
+        : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
+          second_value_(second) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "and ";
+      UniversalPrint(second_value_, os);
+      *os << " ";
+      mono_tuple2_matcher_.DescribeTo(os);
+    }
+
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_),
+                                                  listener);
+    }
+
+   private:
+    const Matcher<const ArgTuple&> mono_tuple2_matcher_;
+    const Second second_value_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const Tuple2Matcher tuple2_matcher_;
+  const Second second_value_;
+};
+
+// Given a 2-tuple matcher tm and a value second,
+// MatcherBindSecond(tm, second) returns a matcher that matches a
+// value x iff tm matches tuple (x, second).  Useful for implementing
+// UnorderedPointwise() in terms of UnorderedElementsAreArray().
+template <typename Tuple2Matcher, typename Second>
+BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
+    const Tuple2Matcher& tm, const Second& second) {
+  return BoundSecondMatcher<Tuple2Matcher, Second>(tm, second);
+}
+
+// Returns the description for a matcher defined using the MATCHER*()
+// macro where the user-supplied description string is "", if
+// 'negation' is false; otherwise returns the description of the
+// negation of the matcher.  'param_values' contains a list of strings
+// that are the print-out of the matcher's parameters.
+GTEST_API_ string FormatMatcherDescription(bool negation,
+                                           const char* matcher_name,
+                                           const Strings& param_values);
+
+}  // namespace internal
+
+// ElementsAreArray(first, last)
+// ElementsAreArray(pointer, count)
+// ElementsAreArray(array)
+// ElementsAreArray(container)
+// ElementsAreArray({ e1, e2, ..., en })
+//
+// The ElementsAreArray() functions are like ElementsAre(...), except
+// that they are given a homogeneous sequence rather than taking each
+// element as a function argument. The sequence can be specified as an
+// array, a pointer and count, a vector, an initializer list, or an
+// STL iterator range. In each of these cases, the underlying sequence
+// can be either a sequence of values or a sequence of matchers.
+//
+// All forms of ElementsAreArray() make a copy of the input matcher sequence.
+
+template <typename Iter>
+inline internal::ElementsAreArrayMatcher<
+    typename ::std::iterator_traits<Iter>::value_type>
+ElementsAreArray(Iter first, Iter last) {
+  typedef typename ::std::iterator_traits<Iter>::value_type T;
+  return internal::ElementsAreArrayMatcher<T>(first, last);
+}
+
+template <typename T>
+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
+    const T* pointer, size_t count) {
+  return ElementsAreArray(pointer, pointer + count);
+}
+
+template <typename T, size_t N>
+inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
+    const T (&array)[N]) {
+  return ElementsAreArray(array, N);
+}
+
+template <typename Container>
+inline internal::ElementsAreArrayMatcher<typename Container::value_type>
+ElementsAreArray(const Container& container) {
+  return ElementsAreArray(container.begin(), container.end());
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+template <typename T>
+inline internal::ElementsAreArrayMatcher<T>
+ElementsAreArray(::std::initializer_list<T> xs) {
+  return ElementsAreArray(xs.begin(), xs.end());
+}
+#endif
+
+// UnorderedElementsAreArray(first, last)
+// UnorderedElementsAreArray(pointer, count)
+// UnorderedElementsAreArray(array)
+// UnorderedElementsAreArray(container)
+// UnorderedElementsAreArray({ e1, e2, ..., en })
+//
+// The UnorderedElementsAreArray() functions are like
+// ElementsAreArray(...), but allow matching the elements in any order.
+template <typename Iter>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename ::std::iterator_traits<Iter>::value_type>
+UnorderedElementsAreArray(Iter first, Iter last) {
+  typedef typename ::std::iterator_traits<Iter>::value_type T;
+  return internal::UnorderedElementsAreArrayMatcher<T>(first, last);
+}
+
+template <typename T>
+inline internal::UnorderedElementsAreArrayMatcher<T>
+UnorderedElementsAreArray(const T* pointer, size_t count) {
+  return UnorderedElementsAreArray(pointer, pointer + count);
+}
+
+template <typename T, size_t N>
+inline internal::UnorderedElementsAreArrayMatcher<T>
+UnorderedElementsAreArray(const T (&array)[N]) {
+  return UnorderedElementsAreArray(array, N);
+}
+
+template <typename Container>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename Container::value_type>
+UnorderedElementsAreArray(const Container& container) {
+  return UnorderedElementsAreArray(container.begin(), container.end());
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+template <typename T>
+inline internal::UnorderedElementsAreArrayMatcher<T>
+UnorderedElementsAreArray(::std::initializer_list<T> xs) {
+  return UnorderedElementsAreArray(xs.begin(), xs.end());
+}
+#endif
+
+// _ is a matcher that matches anything of any type.
+//
+// This definition is fine as:
+//
+//   1. The C++ standard permits using the name _ in a namespace that
+//      is not the global namespace or ::std.
+//   2. The AnythingMatcher class has no data member or constructor,
+//      so it's OK to create global variables of this type.
+//   3. c-style has approved of using _ in this case.
+const internal::AnythingMatcher _ = {};
+// Creates a matcher that matches any value of the given type T.
+template <typename T>
+inline Matcher<T> A() { return MakeMatcher(new internal::AnyMatcherImpl<T>()); }
+
+// Creates a matcher that matches any value of the given type T.
+template <typename T>
+inline Matcher<T> An() { return A<T>(); }
+
+// Creates a polymorphic matcher that matches anything equal to x.
+// Note: if the parameter of Eq() were declared as const T&, Eq("foo")
+// wouldn't compile.
+template <typename T>
+inline internal::EqMatcher<T> Eq(T x) { return internal::EqMatcher<T>(x); }
+
+// Constructs a Matcher<T> from a 'value' of type T.  The constructed
+// matcher matches any value that's equal to 'value'.
+template <typename T>
+Matcher<T>::Matcher(T value) { *this = Eq(value); }
+
+// Creates a monomorphic matcher that matches anything with type Lhs
+// and equal to rhs.  A user may need to use this instead of Eq(...)
+// in order to resolve an overloading ambiguity.
+//
+// TypedEq<T>(x) is just a convenient short-hand for Matcher<T>(Eq(x))
+// or Matcher<T>(x), but more readable than the latter.
+//
+// We could define similar monomorphic matchers for other comparison
+// operations (e.g. TypedLt, TypedGe, and etc), but decided not to do
+// it yet as those are used much less than Eq() in practice.  A user
+// can always write Matcher<T>(Lt(5)) to be explicit about the type,
+// for example.
+template <typename Lhs, typename Rhs>
+inline Matcher<Lhs> TypedEq(const Rhs& rhs) { return Eq(rhs); }
+
+// Creates a polymorphic matcher that matches anything >= x.
+template <typename Rhs>
+inline internal::GeMatcher<Rhs> Ge(Rhs x) {
+  return internal::GeMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything > x.
+template <typename Rhs>
+inline internal::GtMatcher<Rhs> Gt(Rhs x) {
+  return internal::GtMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything <= x.
+template <typename Rhs>
+inline internal::LeMatcher<Rhs> Le(Rhs x) {
+  return internal::LeMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything < x.
+template <typename Rhs>
+inline internal::LtMatcher<Rhs> Lt(Rhs x) {
+  return internal::LtMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches anything != x.
+template <typename Rhs>
+inline internal::NeMatcher<Rhs> Ne(Rhs x) {
+  return internal::NeMatcher<Rhs>(x);
+}
+
+// Creates a polymorphic matcher that matches any NULL pointer.
+inline PolymorphicMatcher<internal::IsNullMatcher > IsNull() {
+  return MakePolymorphicMatcher(internal::IsNullMatcher());
+}
+
+// Creates a polymorphic matcher that matches any non-NULL pointer.
+// This is convenient as Not(NULL) doesn't compile (the compiler
+// thinks that that expression is comparing a pointer with an integer).
+inline PolymorphicMatcher<internal::NotNullMatcher > NotNull() {
+  return MakePolymorphicMatcher(internal::NotNullMatcher());
+}
+
+// Creates a polymorphic matcher that matches any argument that
+// references variable x.
+template <typename T>
+inline internal::RefMatcher<T&> Ref(T& x) {  // NOLINT
+  return internal::RefMatcher<T&>(x);
+}
+
+// Creates a matcher that matches any double argument approximately
+// equal to rhs, where two NANs are considered unequal.
+inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) {
+  return internal::FloatingEqMatcher<double>(rhs, false);
+}
+
+// Creates a matcher that matches any double argument approximately
+// equal to rhs, including NaN values when rhs is NaN.
+inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {
+  return internal::FloatingEqMatcher<double>(rhs, true);
+}
+
+// Creates a matcher that matches any double argument approximately equal to
+// rhs, up to the specified max absolute error bound, where two NANs are
+// considered unequal.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<double> DoubleNear(
+    double rhs, double max_abs_error) {
+  return internal::FloatingEqMatcher<double>(rhs, false, max_abs_error);
+}
+
+// Creates a matcher that matches any double argument approximately equal to
+// rhs, up to the specified max absolute error bound, including NaN values when
+// rhs is NaN.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<double> NanSensitiveDoubleNear(
+    double rhs, double max_abs_error) {
+  return internal::FloatingEqMatcher<double>(rhs, true, max_abs_error);
+}
+
+// Creates a matcher that matches any float argument approximately
+// equal to rhs, where two NANs are considered unequal.
+inline internal::FloatingEqMatcher<float> FloatEq(float rhs) {
+  return internal::FloatingEqMatcher<float>(rhs, false);
+}
+
+// Creates a matcher that matches any float argument approximately
+// equal to rhs, including NaN values when rhs is NaN.
+inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {
+  return internal::FloatingEqMatcher<float>(rhs, true);
+}
+
+// Creates a matcher that matches any float argument approximately equal to
+// rhs, up to the specified max absolute error bound, where two NANs are
+// considered unequal.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<float> FloatNear(
+    float rhs, float max_abs_error) {
+  return internal::FloatingEqMatcher<float>(rhs, false, max_abs_error);
+}
+
+// Creates a matcher that matches any float argument approximately equal to
+// rhs, up to the specified max absolute error bound, including NaN values when
+// rhs is NaN.  The max absolute error bound must be non-negative.
+inline internal::FloatingEqMatcher<float> NanSensitiveFloatNear(
+    float rhs, float max_abs_error) {
+  return internal::FloatingEqMatcher<float>(rhs, true, max_abs_error);
+}
+
+// Creates a matcher that matches a pointer (raw or smart) that points
+// to a value that matches inner_matcher.
+template <typename InnerMatcher>
+inline internal::PointeeMatcher<InnerMatcher> Pointee(
+    const InnerMatcher& inner_matcher) {
+  return internal::PointeeMatcher<InnerMatcher>(inner_matcher);
+}
+
+// Creates a matcher that matches a pointer or reference that matches
+// inner_matcher when dynamic_cast<To> is applied.
+// The result of dynamic_cast<To> is forwarded to the inner matcher.
+// If To is a pointer and the cast fails, the inner matcher will receive NULL.
+// If To is a reference and the cast fails, this matcher returns false
+// immediately.
+template <typename To>
+inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To> >
+WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
+  return MakePolymorphicMatcher(
+      internal::WhenDynamicCastToMatcher<To>(inner_matcher));
+}
+
+// Creates a matcher that matches an object whose given field matches
+// 'matcher'.  For example,
+//   Field(&Foo::number, Ge(5))
+// matches a Foo object x iff x.number >= 5.
+template <typename Class, typename FieldType, typename FieldMatcher>
+inline PolymorphicMatcher<
+  internal::FieldMatcher<Class, FieldType> > Field(
+    FieldType Class::*field, const FieldMatcher& matcher) {
+  return MakePolymorphicMatcher(
+      internal::FieldMatcher<Class, FieldType>(
+          field, MatcherCast<const FieldType&>(matcher)));
+  // The call to MatcherCast() is required for supporting inner
+  // matchers of compatible types.  For example, it allows
+  //   Field(&Foo::bar, m)
+  // to compile where bar is an int32 and m is a matcher for int64.
+}
+
+// Creates a matcher that matches an object whose given property
+// matches 'matcher'.  For example,
+//   Property(&Foo::str, StartsWith("hi"))
+// matches a Foo object x iff x.str() starts with "hi".
+template <typename Class, typename PropertyType, typename PropertyMatcher>
+inline PolymorphicMatcher<
+  internal::PropertyMatcher<Class, PropertyType> > Property(
+    PropertyType (Class::*property)() const, const PropertyMatcher& matcher) {
+  return MakePolymorphicMatcher(
+      internal::PropertyMatcher<Class, PropertyType>(
+          property,
+          MatcherCast<GTEST_REFERENCE_TO_CONST_(PropertyType)>(matcher)));
+  // The call to MatcherCast() is required for supporting inner
+  // matchers of compatible types.  For example, it allows
+  //   Property(&Foo::bar, m)
+  // to compile where bar() returns an int32 and m is a matcher for int64.
+}
+
+// Creates a matcher that matches an object iff the result of applying
+// a callable to x matches 'matcher'.
+// For example,
+//   ResultOf(f, StartsWith("hi"))
+// matches a Foo object x iff f(x) starts with "hi".
+// callable parameter can be a function, function pointer, or a functor.
+// Callable has to satisfy the following conditions:
+//   * It is required to keep no state affecting the results of
+//     the calls on it and make no assumptions about how many calls
+//     will be made. Any state it keeps must be protected from the
+//     concurrent access.
+//   * If it is a function object, it has to define type result_type.
+//     We recommend deriving your functor classes from std::unary_function.
+template <typename Callable, typename ResultOfMatcher>
+internal::ResultOfMatcher<Callable> ResultOf(
+    Callable callable, const ResultOfMatcher& matcher) {
+  return internal::ResultOfMatcher<Callable>(
+          callable,
+          MatcherCast<typename internal::CallableTraits<Callable>::ResultType>(
+              matcher));
+  // The call to MatcherCast() is required for supporting inner
+  // matchers of compatible types.  For example, it allows
+  //   ResultOf(Function, m)
+  // to compile where Function() returns an int32 and m is a matcher for int64.
+}
+
+// String matchers.
+
+// Matches a string equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrEq(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, true, true));
+}
+
+// Matches a string not equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrNe(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, false, true));
+}
+
+// Matches a string equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrCaseEq(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, true, false));
+}
+
+// Matches a string not equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::string> >
+    StrCaseNe(const internal::string& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::string>(
+      str, false, false));
+}
+
+// Creates a matcher that matches any string, std::string, or C string
+// that contains the given substring.
+inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::string> >
+    HasSubstr(const internal::string& substring) {
+  return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::string>(
+      substring));
+}
+
+// Matches a string that starts with 'prefix' (case-sensitive).
+inline PolymorphicMatcher<internal::StartsWithMatcher<internal::string> >
+    StartsWith(const internal::string& prefix) {
+  return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::string>(
+      prefix));
+}
+
+// Matches a string that ends with 'suffix' (case-sensitive).
+inline PolymorphicMatcher<internal::EndsWithMatcher<internal::string> >
+    EndsWith(const internal::string& suffix) {
+  return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::string>(
+      suffix));
+}
+
+// Matches a string that fully matches regular expression 'regex'.
+// The matcher takes ownership of 'regex'.
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
+    const internal::RE* regex) {
+  return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));
+}
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
+    const internal::string& regex) {
+  return MatchesRegex(new internal::RE(regex));
+}
+
+// Matches a string that contains regular expression 'regex'.
+// The matcher takes ownership of 'regex'.
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
+    const internal::RE* regex) {
+  return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));
+}
+inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
+    const internal::string& regex) {
+  return ContainsRegex(new internal::RE(regex));
+}
+
+#if GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
+// Wide string matchers.
+
+// Matches a string equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrEq(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, true, true));
+}
+
+// Matches a string not equal to str.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrNe(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, false, true));
+}
+
+// Matches a string equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrCaseEq(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, true, false));
+}
+
+// Matches a string not equal to str, ignoring case.
+inline PolymorphicMatcher<internal::StrEqualityMatcher<internal::wstring> >
+    StrCaseNe(const internal::wstring& str) {
+  return MakePolymorphicMatcher(internal::StrEqualityMatcher<internal::wstring>(
+      str, false, false));
+}
+
+// Creates a matcher that matches any wstring, std::wstring, or C wide string
+// that contains the given substring.
+inline PolymorphicMatcher<internal::HasSubstrMatcher<internal::wstring> >
+    HasSubstr(const internal::wstring& substring) {
+  return MakePolymorphicMatcher(internal::HasSubstrMatcher<internal::wstring>(
+      substring));
+}
+
+// Matches a string that starts with 'prefix' (case-sensitive).
+inline PolymorphicMatcher<internal::StartsWithMatcher<internal::wstring> >
+    StartsWith(const internal::wstring& prefix) {
+  return MakePolymorphicMatcher(internal::StartsWithMatcher<internal::wstring>(
+      prefix));
+}
+
+// Matches a string that ends with 'suffix' (case-sensitive).
+inline PolymorphicMatcher<internal::EndsWithMatcher<internal::wstring> >
+    EndsWith(const internal::wstring& suffix) {
+  return MakePolymorphicMatcher(internal::EndsWithMatcher<internal::wstring>(
+      suffix));
+}
+
+#endif  // GTEST_HAS_GLOBAL_WSTRING || GTEST_HAS_STD_WSTRING
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field == the second field.
+inline internal::Eq2Matcher Eq() { return internal::Eq2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field >= the second field.
+inline internal::Ge2Matcher Ge() { return internal::Ge2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field > the second field.
+inline internal::Gt2Matcher Gt() { return internal::Gt2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field <= the second field.
+inline internal::Le2Matcher Le() { return internal::Le2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field < the second field.
+inline internal::Lt2Matcher Lt() { return internal::Lt2Matcher(); }
+
+// Creates a polymorphic matcher that matches a 2-tuple where the
+// first field != the second field.
+inline internal::Ne2Matcher Ne() { return internal::Ne2Matcher(); }
+
+// Creates a matcher that matches any value of type T that m doesn't
+// match.
+template <typename InnerMatcher>
+inline internal::NotMatcher<InnerMatcher> Not(InnerMatcher m) {
+  return internal::NotMatcher<InnerMatcher>(m);
+}
+
+// Returns a matcher that matches anything that satisfies the given
+// predicate.  The predicate can be any unary function or functor
+// whose return type can be implicitly converted to bool.
+template <typename Predicate>
+inline PolymorphicMatcher<internal::TrulyMatcher<Predicate> >
+Truly(Predicate pred) {
+  return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred));
+}
+
+// Returns a matcher that matches the container size. The container must
+// support both size() and size_type which all STL-like containers provide.
+// Note that the parameter 'size' can be a value of type size_type as well as
+// matcher. For instance:
+//   EXPECT_THAT(container, SizeIs(2));     // Checks container has 2 elements.
+//   EXPECT_THAT(container, SizeIs(Le(2));  // Checks container has at most 2.
+template <typename SizeMatcher>
+inline internal::SizeIsMatcher<SizeMatcher>
+SizeIs(const SizeMatcher& size_matcher) {
+  return internal::SizeIsMatcher<SizeMatcher>(size_matcher);
+}
+
+// Returns a matcher that matches the distance between the container's begin()
+// iterator and its end() iterator, i.e. the size of the container. This matcher
+// can be used instead of SizeIs with containers such as std::forward_list which
+// do not implement size(). The container must provide const_iterator (with
+// valid iterator_traits), begin() and end().
+template <typename DistanceMatcher>
+inline internal::BeginEndDistanceIsMatcher<DistanceMatcher>
+BeginEndDistanceIs(const DistanceMatcher& distance_matcher) {
+  return internal::BeginEndDistanceIsMatcher<DistanceMatcher>(distance_matcher);
+}
+
+// Returns a matcher that matches an equal container.
+// This matcher behaves like Eq(), but in the event of mismatch lists the
+// values that are included in one container but not the other. (Duplicate
+// values and order differences are not explained.)
+template <typename Container>
+inline PolymorphicMatcher<internal::ContainerEqMatcher<  // NOLINT
+                            GTEST_REMOVE_CONST_(Container)> >
+    ContainerEq(const Container& rhs) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes Container to be a const type sometimes.
+  typedef GTEST_REMOVE_CONST_(Container) RawContainer;
+  return MakePolymorphicMatcher(
+      internal::ContainerEqMatcher<RawContainer>(rhs));
+}
+
+// Returns a matcher that matches a container that, when sorted using
+// the given comparator, matches container_matcher.
+template <typename Comparator, typename ContainerMatcher>
+inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher>
+WhenSortedBy(const Comparator& comparator,
+             const ContainerMatcher& container_matcher) {
+  return internal::WhenSortedByMatcher<Comparator, ContainerMatcher>(
+      comparator, container_matcher);
+}
+
+// Returns a matcher that matches a container that, when sorted using
+// the < operator, matches container_matcher.
+template <typename ContainerMatcher>
+inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
+WhenSorted(const ContainerMatcher& container_matcher) {
+  return
+      internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>(
+          internal::LessComparator(), container_matcher);
+}
+
+// Matches an STL-style container or a native array that contains the
+// same number of elements as in rhs, where its i-th element and rhs's
+// i-th element (as a pair) satisfy the given pair matcher, for all i.
+// TupleMatcher must be able to be safely cast to Matcher<tuple<const
+// T1&, const T2&> >, where T1 and T2 are the types of elements in the
+// LHS container and the RHS container respectively.
+template <typename TupleMatcher, typename Container>
+inline internal::PointwiseMatcher<TupleMatcher,
+                                  GTEST_REMOVE_CONST_(Container)>
+Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes Container to be a const type sometimes (e.g. when
+  // rhs is a const int[])..
+  typedef GTEST_REMOVE_CONST_(Container) RawContainer;
+  return internal::PointwiseMatcher<TupleMatcher, RawContainer>(
+      tuple_matcher, rhs);
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Supports the Pointwise(m, {a, b, c}) syntax.
+template <typename TupleMatcher, typename T>
+inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise(
+    const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
+  return Pointwise(tuple_matcher, std::vector<T>(rhs));
+}
+
+#endif  // GTEST_HAS_STD_INITIALIZER_LIST_
+
+// UnorderedPointwise(pair_matcher, rhs) matches an STL-style
+// container or a native array that contains the same number of
+// elements as in rhs, where in some permutation of the container, its
+// i-th element and rhs's i-th element (as a pair) satisfy the given
+// pair matcher, for all i.  Tuple2Matcher must be able to be safely
+// cast to Matcher<tuple<const T1&, const T2&> >, where T1 and T2 are
+// the types of elements in the LHS container and the RHS container
+// respectively.
+//
+// This is like Pointwise(pair_matcher, rhs), except that the element
+// order doesn't matter.
+template <typename Tuple2Matcher, typename RhsContainer>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename internal::BoundSecondMatcher<
+        Tuple2Matcher, typename internal::StlContainerView<GTEST_REMOVE_CONST_(
+                           RhsContainer)>::type::value_type> >
+UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
+                   const RhsContainer& rhs_container) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes RhsContainer to be a const type sometimes (e.g. when
+  // rhs_container is a const int[]).
+  typedef GTEST_REMOVE_CONST_(RhsContainer) RawRhsContainer;
+
+  // RhsView allows the same code to handle RhsContainer being a
+  // STL-style container and it being a native C-style array.
+  typedef typename internal::StlContainerView<RawRhsContainer> RhsView;
+  typedef typename RhsView::type RhsStlContainer;
+  typedef typename RhsStlContainer::value_type Second;
+  const RhsStlContainer& rhs_stl_container =
+      RhsView::ConstReference(rhs_container);
+
+  // Create a matcher for each element in rhs_container.
+  ::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second> > matchers;
+  for (typename RhsStlContainer::const_iterator it = rhs_stl_container.begin();
+       it != rhs_stl_container.end(); ++it) {
+    matchers.push_back(
+        internal::MatcherBindSecond(tuple2_matcher, *it));
+  }
+
+  // Delegate the work to UnorderedElementsAreArray().
+  return UnorderedElementsAreArray(matchers);
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Supports the UnorderedPointwise(m, {a, b, c}) syntax.
+template <typename Tuple2Matcher, typename T>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename internal::BoundSecondMatcher<Tuple2Matcher, T> >
+UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
+                   std::initializer_list<T> rhs) {
+  return UnorderedPointwise(tuple2_matcher, std::vector<T>(rhs));
+}
+
+#endif  // GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Matches an STL-style container or a native array that contains at
+// least one element matching the given value or matcher.
+//
+// Examples:
+//   ::std::set<int> page_ids;
+//   page_ids.insert(3);
+//   page_ids.insert(1);
+//   EXPECT_THAT(page_ids, Contains(1));
+//   EXPECT_THAT(page_ids, Contains(Gt(2)));
+//   EXPECT_THAT(page_ids, Not(Contains(4)));
+//
+//   ::std::map<int, size_t> page_lengths;
+//   page_lengths[1] = 100;
+//   EXPECT_THAT(page_lengths,
+//               Contains(::std::pair<const int, size_t>(1, 100)));
+//
+//   const char* user_ids[] = { "joe", "mike", "tom" };
+//   EXPECT_THAT(user_ids, Contains(Eq(::std::string("tom"))));
+template <typename M>
+inline internal::ContainsMatcher<M> Contains(M matcher) {
+  return internal::ContainsMatcher<M>(matcher);
+}
+
+// Matches an STL-style container or a native array that contains only
+// elements matching the given value or matcher.
+//
+// Each(m) is semantically equivalent to Not(Contains(Not(m))). Only
+// the messages are different.
+//
+// Examples:
+//   ::std::set<int> page_ids;
+//   // Each(m) matches an empty container, regardless of what m is.
+//   EXPECT_THAT(page_ids, Each(Eq(1)));
+//   EXPECT_THAT(page_ids, Each(Eq(77)));
+//
+//   page_ids.insert(3);
+//   EXPECT_THAT(page_ids, Each(Gt(0)));
+//   EXPECT_THAT(page_ids, Not(Each(Gt(4))));
+//   page_ids.insert(1);
+//   EXPECT_THAT(page_ids, Not(Each(Lt(2))));
+//
+//   ::std::map<int, size_t> page_lengths;
+//   page_lengths[1] = 100;
+//   page_lengths[2] = 200;
+//   page_lengths[3] = 300;
+//   EXPECT_THAT(page_lengths, Not(Each(Pair(1, 100))));
+//   EXPECT_THAT(page_lengths, Each(Key(Le(3))));
+//
+//   const char* user_ids[] = { "joe", "mike", "tom" };
+//   EXPECT_THAT(user_ids, Not(Each(Eq(::std::string("tom")))));
+template <typename M>
+inline internal::EachMatcher<M> Each(M matcher) {
+  return internal::EachMatcher<M>(matcher);
+}
+
+// Key(inner_matcher) matches an std::pair whose 'first' field matches
+// inner_matcher.  For example, Contains(Key(Ge(5))) can be used to match an
+// std::map that contains at least one element whose key is >= 5.
+template <typename M>
+inline internal::KeyMatcher<M> Key(M inner_matcher) {
+  return internal::KeyMatcher<M>(inner_matcher);
+}
+
+// Pair(first_matcher, second_matcher) matches a std::pair whose 'first' field
+// matches first_matcher and whose 'second' field matches second_matcher.  For
+// example, EXPECT_THAT(map_type, ElementsAre(Pair(Ge(5), "foo"))) can be used
+// to match a std::map<int, string> that contains exactly one element whose key
+// is >= 5 and whose value equals "foo".
+template <typename FirstMatcher, typename SecondMatcher>
+inline internal::PairMatcher<FirstMatcher, SecondMatcher>
+Pair(FirstMatcher first_matcher, SecondMatcher second_matcher) {
+  return internal::PairMatcher<FirstMatcher, SecondMatcher>(
+      first_matcher, second_matcher);
+}
+
+// Returns a predicate that is satisfied by anything that matches the
+// given matcher.
+template <typename M>
+inline internal::MatcherAsPredicate<M> Matches(M matcher) {
+  return internal::MatcherAsPredicate<M>(matcher);
+}
+
+// Returns true iff the value matches the matcher.
+template <typename T, typename M>
+inline bool Value(const T& value, M matcher) {
+  return testing::Matches(matcher)(value);
+}
+
+// Matches the value against the given matcher and explains the match
+// result to listener.
+template <typename T, typename M>
+inline bool ExplainMatchResult(
+    M matcher, const T& value, MatchResultListener* listener) {
+  return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
+}
+
+#if GTEST_LANG_CXX11
+// Define variadic matcher versions. They are overloaded in
+// gmock-generated-matchers.h for the cases supported by pre C++11 compilers.
+template <typename... Args>
+inline internal::AllOfMatcher<Args...> AllOf(const Args&... matchers) {
+  return internal::AllOfMatcher<Args...>(matchers...);
+}
+
+template <typename... Args>
+inline internal::AnyOfMatcher<Args...> AnyOf(const Args&... matchers) {
+  return internal::AnyOfMatcher<Args...>(matchers...);
+}
+
+#endif  // GTEST_LANG_CXX11
+
+// AllArgs(m) is a synonym of m.  This is useful in
+//
+//   EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));
+//
+// which is easier to read than
+//
+//   EXPECT_CALL(foo, Bar(_, _)).With(Eq());
+template <typename InnerMatcher>
+inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher; }
+
+// These macros allow using matchers to check values in Google Test
+// tests.  ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
+// succeed iff the value matches the matcher.  If the assertion fails,
+// the value and the description of the matcher will be printed.
+#define ASSERT_THAT(value, matcher) ASSERT_PRED_FORMAT1(\
+    ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
+#define EXPECT_THAT(value, matcher) EXPECT_PRED_FORMAT1(\
+    ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
+
+}  // namespace testing
+
+// Include any custom callback matchers added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-matchers.h"
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-more-actions.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-more-actions.h
new file mode 100644
index 0000000..3d387b6
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-more-actions.h
@@ -0,0 +1,246 @@
+// 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 actions that depend on gmock-generated-actions.h.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
+
+#include <algorithm>
+
+#include "gmock/gmock-generated-actions.h"
+
+namespace testing {
+namespace internal {
+
+// Implements the Invoke(f) action.  The template argument
+// FunctionImpl is the implementation type of f, which can be either a
+// function pointer or a functor.  Invoke(f) can be used as an
+// Action<F> as long as f's type is compatible with F (i.e. f can be
+// assigned to a tr1::function<F>).
+template <typename FunctionImpl>
+class InvokeAction {
+ public:
+  // The c'tor makes a copy of function_impl (either a function
+  // pointer or a functor).
+  explicit InvokeAction(FunctionImpl function_impl)
+      : function_impl_(function_impl) {}
+
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& args) {
+    return InvokeHelper<Result, ArgumentTuple>::Invoke(function_impl_, args);
+  }
+
+ private:
+  FunctionImpl function_impl_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeAction);
+};
+
+// Implements the Invoke(object_ptr, &Class::Method) action.
+template <class Class, typename MethodPtr>
+class InvokeMethodAction {
+ public:
+  InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)
+      : method_ptr_(method_ptr), obj_ptr_(obj_ptr) {}
+
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& args) const {
+    return InvokeHelper<Result, ArgumentTuple>::InvokeMethod(
+        obj_ptr_, method_ptr_, args);
+  }
+
+ private:
+  // The order of these members matters.  Reversing the order can trigger
+  // warning C4121 in MSVC (see
+  // http://computer-programming-forum.com/7-vc.net/6fbc30265f860ad1.htm ).
+  const MethodPtr method_ptr_;
+  Class* const obj_ptr_;
+
+  GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);
+};
+
+// An internal replacement for std::copy which mimics its behavior. This is
+// necessary because Visual Studio deprecates ::std::copy, issuing warning 4996.
+// However Visual Studio 2010 and later do not honor #pragmas which disable that
+// warning.
+template<typename InputIterator, typename OutputIterator>
+inline OutputIterator CopyElements(InputIterator first,
+                                   InputIterator last,
+                                   OutputIterator output) {
+  for (; first != last; ++first, ++output) {
+    *output = *first;
+  }
+  return output;
+}
+
+}  // namespace internal
+
+// Various overloads for Invoke().
+
+// Creates an action that invokes 'function_impl' with the mock
+// function's arguments.
+template <typename FunctionImpl>
+PolymorphicAction<internal::InvokeAction<FunctionImpl> > Invoke(
+    FunctionImpl function_impl) {
+  return MakePolymorphicAction(
+      internal::InvokeAction<FunctionImpl>(function_impl));
+}
+
+// Creates an action that invokes the given method on the given object
+// with the mock function's arguments.
+template <class Class, typename MethodPtr>
+PolymorphicAction<internal::InvokeMethodAction<Class, MethodPtr> > Invoke(
+    Class* obj_ptr, MethodPtr method_ptr) {
+  return MakePolymorphicAction(
+      internal::InvokeMethodAction<Class, MethodPtr>(obj_ptr, method_ptr));
+}
+
+// WithoutArgs(inner_action) can be used in a mock function with a
+// non-empty argument list to perform inner_action, which takes no
+// argument.  In other words, it adapts an action accepting no
+// argument to one that accepts (and ignores) arguments.
+template <typename InnerAction>
+inline internal::WithArgsAction<InnerAction>
+WithoutArgs(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction>(action);
+}
+
+// WithArg<k>(an_action) creates an action that passes the k-th
+// (0-based) argument of the mock function to an_action and performs
+// it.  It adapts an action accepting one argument to one that accepts
+// multiple arguments.  For convenience, we also provide
+// WithArgs<k>(an_action) (defined below) as a synonym.
+template <int k, typename InnerAction>
+inline internal::WithArgsAction<InnerAction, k>
+WithArg(const InnerAction& action) {
+  return internal::WithArgsAction<InnerAction, k>(action);
+}
+
+// The ACTION*() macros trigger warning C4100 (unreferenced formal
+// parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
+// the macro definition, as the warnings are generated when the macro
+// is expanded and macro expansion cannot contain #pragma.  Therefore
+// we suppress them here.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4100)
+#endif
+
+// Action ReturnArg<k>() returns the k-th argument of the mock function.
+ACTION_TEMPLATE(ReturnArg,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_0_VALUE_PARAMS()) {
+  return ::testing::get<k>(args);
+}
+
+// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
+// mock function to *pointer.
+ACTION_TEMPLATE(SaveArg,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(pointer)) {
+  *pointer = ::testing::get<k>(args);
+}
+
+// Action SaveArgPointee<k>(pointer) saves the value pointed to
+// by the k-th (0-based) argument of the mock function to *pointer.
+ACTION_TEMPLATE(SaveArgPointee,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(pointer)) {
+  *pointer = *::testing::get<k>(args);
+}
+
+// Action SetArgReferee<k>(value) assigns 'value' to the variable
+// referenced by the k-th (0-based) argument of the mock function.
+ACTION_TEMPLATE(SetArgReferee,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_1_VALUE_PARAMS(value)) {
+  typedef typename ::testing::tuple_element<k, args_type>::type argk_type;
+  // Ensures that argument #k is a reference.  If you get a compiler
+  // error on the next line, you are using SetArgReferee<k>(value) in
+  // a mock function whose k-th (0-based) argument is not a reference.
+  GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,
+                        SetArgReferee_must_be_used_with_a_reference_argument);
+  ::testing::get<k>(args) = value;
+}
+
+// Action SetArrayArgument<k>(first, last) copies the elements in
+// source range [first, last) to the array pointed to by the k-th
+// (0-based) argument, which can be either a pointer or an
+// iterator. The action does not take ownership of the elements in the
+// source range.
+ACTION_TEMPLATE(SetArrayArgument,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_2_VALUE_PARAMS(first, last)) {
+  // Visual Studio deprecates ::std::copy, so we use our own copy in that case.
+#ifdef _MSC_VER
+  internal::CopyElements(first, last, ::testing::get<k>(args));
+#else
+  ::std::copy(first, last, ::testing::get<k>(args));
+#endif
+}
+
+// Action DeleteArg<k>() deletes the k-th (0-based) argument of the mock
+// function.
+ACTION_TEMPLATE(DeleteArg,
+                HAS_1_TEMPLATE_PARAMS(int, k),
+                AND_0_VALUE_PARAMS()) {
+  delete ::testing::get<k>(args);
+}
+
+// This action returns the value pointed to by 'pointer'.
+ACTION_P(ReturnPointee, pointer) { return *pointer; }
+
+// Action Throw(exception) can be used in a mock function of any type
+// to throw the given exception.  Any copyable value can be thrown.
+#if GTEST_HAS_EXCEPTIONS
+
+// Suppresses the 'unreachable code' warning that VC generates in opt modes.
+# ifdef _MSC_VER
+#  pragma warning(push)          // Saves the current warning state.
+#  pragma warning(disable:4702)  // Temporarily disables warning 4702.
+# endif
+ACTION_P(Throw, exception) { throw exception; }
+# ifdef _MSC_VER
+#  pragma warning(pop)           // Restores the warning state.
+# endif
+
+#endif  // GTEST_HAS_EXCEPTIONS
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-more-matchers.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-more-matchers.h
new file mode 100644
index 0000000..3db899f
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-more-matchers.h
@@ -0,0 +1,58 @@
+// Copyright 2013, 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: marcus.boerger@google.com (Marcus Boerger)
+
+// Google Mock - a framework for writing C++ mock classes.
+//
+// This file implements some matchers that depend on gmock-generated-matchers.h.
+//
+// Note that tests are implemented in gmock-matchers_test.cc rather than
+// gmock-more-matchers-test.cc.
+
+#ifndef GMOCK_GMOCK_MORE_MATCHERS_H_
+#define GMOCK_GMOCK_MORE_MATCHERS_H_
+
+#include "gmock/gmock-generated-matchers.h"
+
+namespace testing {
+
+// Defines a matcher that matches an empty container. The container must
+// support both size() and empty(), which all STL-like containers provide.
+MATCHER(IsEmpty, negation ? "isn't empty" : "is empty") {
+  if (arg.empty()) {
+    return true;
+  }
+  *result_listener << "whose size is " << arg.size();
+  return false;
+}
+
+}  // namespace testing
+
+#endif  // GMOCK_GMOCK_MORE_MATCHERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock-spec-builders.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock-spec-builders.h
new file mode 100644
index 0000000..fed7de6
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock-spec-builders.h
@@ -0,0 +1,1847 @@
+// 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 the ON_CALL() and EXPECT_CALL() macros.
+//
+// A user can use the ON_CALL() macro to specify the default action of
+// a mock method.  The syntax is:
+//
+//   ON_CALL(mock_object, Method(argument-matchers))
+//       .With(multi-argument-matcher)
+//       .WillByDefault(action);
+//
+//  where the .With() clause is optional.
+//
+// A user can use the EXPECT_CALL() macro to specify an expectation on
+// a mock method.  The syntax is:
+//
+//   EXPECT_CALL(mock_object, Method(argument-matchers))
+//       .With(multi-argument-matchers)
+//       .Times(cardinality)
+//       .InSequence(sequences)
+//       .After(expectations)
+//       .WillOnce(action)
+//       .WillRepeatedly(action)
+//       .RetiresOnSaturation();
+//
+// where all clauses are optional, and .InSequence()/.After()/
+// .WillOnce() can appear any number of times.
+
+#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
+#define GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
+
+#include <map>
+#include <set>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#if GTEST_HAS_EXCEPTIONS
+# include <stdexcept>  // NOLINT
+#endif
+
+#include "gmock/gmock-actions.h"
+#include "gmock/gmock-cardinalities.h"
+#include "gmock/gmock-matchers.h"
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+
+// An abstract handle of an expectation.
+class Expectation;
+
+// A set of expectation handles.
+class ExpectationSet;
+
+// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
+// and MUST NOT BE USED IN USER CODE!!!
+namespace internal {
+
+// Implements a mock function.
+template <typename F> class FunctionMocker;
+
+// Base class for expectations.
+class ExpectationBase;
+
+// Implements an expectation.
+template <typename F> class TypedExpectation;
+
+// Helper class for testing the Expectation class template.
+class ExpectationTester;
+
+// Base class for function mockers.
+template <typename F> class FunctionMockerBase;
+
+// Protects the mock object registry (in class Mock), all function
+// mockers, and all expectations.
+//
+// The reason we don't use more fine-grained protection is: when a
+// mock function Foo() is called, it needs to consult its expectations
+// to see which one should be picked.  If another thread is allowed to
+// call a mock function (either Foo() or a different one) at the same
+// time, it could affect the "retired" attributes of Foo()'s
+// expectations when InSequence() is used, and thus affect which
+// expectation gets picked.  Therefore, we sequence all mock function
+// calls to ensure the integrity of the mock objects' states.
+GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex);
+
+// Untyped base class for ActionResultHolder<R>.
+class UntypedActionResultHolderBase;
+
+// Abstract base class of FunctionMockerBase.  This is the
+// type-agnostic part of the function mocker interface.  Its pure
+// virtual methods are implemented by FunctionMockerBase.
+class GTEST_API_ UntypedFunctionMockerBase {
+ public:
+  UntypedFunctionMockerBase();
+  virtual ~UntypedFunctionMockerBase();
+
+  // Verifies that all expectations on this mock function have been
+  // satisfied.  Reports one or more Google Test non-fatal failures
+  // and returns false if not.
+  bool VerifyAndClearExpectationsLocked()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Clears the ON_CALL()s set on this mock function.
+  virtual void ClearDefaultActionsLocked()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) = 0;
+
+  // In all of the following Untyped* functions, it's the caller's
+  // responsibility to guarantee the correctness of the arguments'
+  // types.
+
+  // Performs the default action with the given arguments and returns
+  // the action's result.  The call description string will be used in
+  // the error message to describe the call in the case the default
+  // action fails.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
+      const void* untyped_args,
+      const string& call_description) const = 0;
+
+  // Performs the given action with the given arguments and returns
+  // the action's result.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformAction(
+      const void* untyped_action,
+      const void* untyped_args) const = 0;
+
+  // Writes a message that the call is uninteresting (i.e. neither
+  // explicitly expected nor explicitly unexpected) to the given
+  // ostream.
+  virtual void UntypedDescribeUninterestingCall(
+      const void* untyped_args,
+      ::std::ostream* os) const
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
+
+  // Returns the expectation that matches the given function arguments
+  // (or NULL is there's no match); when a match is found,
+  // untyped_action is set to point to the action that should be
+  // performed (or NULL if the action is "do default"), and
+  // is_excessive is modified to indicate whether the call exceeds the
+  // expected number.
+  virtual const ExpectationBase* UntypedFindMatchingExpectation(
+      const void* untyped_args,
+      const void** untyped_action, bool* is_excessive,
+      ::std::ostream* what, ::std::ostream* why)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
+
+  // Prints the given function arguments to the ostream.
+  virtual void UntypedPrintArgs(const void* untyped_args,
+                                ::std::ostream* os) const = 0;
+
+  // Sets the mock object this mock method belongs to, and registers
+  // this information in the global mock registry.  Will be called
+  // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
+  // method.
+  // TODO(wan@google.com): rename to SetAndRegisterOwner().
+  void RegisterOwner(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Sets the mock object this mock method belongs to, and sets the
+  // name of the mock function.  Will be called upon each invocation
+  // of this mock function.
+  void SetOwnerAndName(const void* mock_obj, const char* name)
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Returns the mock object this mock method belongs to.  Must be
+  // called after RegisterOwner() or SetOwnerAndName() has been
+  // called.
+  const void* MockObject() const
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Returns the name of this mock method.  Must be called after
+  // SetOwnerAndName() has been called.
+  const char* Name() const
+      GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+  // Returns the result of invoking this mock function with the given
+  // arguments.  This function can be safely called from multiple
+  // threads concurrently.  The caller is responsible for deleting the
+  // result.
+  UntypedActionResultHolderBase* UntypedInvokeWith(
+      const void* untyped_args)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
+
+ protected:
+  typedef std::vector<const void*> UntypedOnCallSpecs;
+
+  typedef std::vector<internal::linked_ptr<ExpectationBase> >
+  UntypedExpectations;
+
+  // Returns an Expectation object that references and co-owns exp,
+  // which must be an expectation on this mock function.
+  Expectation GetHandleOf(ExpectationBase* exp);
+
+  // Address of the mock object this mock method belongs to.  Only
+  // valid after this mock method has been called or
+  // ON_CALL/EXPECT_CALL has been invoked on it.
+  const void* mock_obj_;  // Protected by g_gmock_mutex.
+
+  // Name of the function being mocked.  Only valid after this mock
+  // method has been called.
+  const char* name_;  // Protected by g_gmock_mutex.
+
+  // All default action specs for this function mocker.
+  UntypedOnCallSpecs untyped_on_call_specs_;
+
+  // All expectations for this function mocker.
+  UntypedExpectations untyped_expectations_;
+};  // class UntypedFunctionMockerBase
+
+// Untyped base class for OnCallSpec<F>.
+class UntypedOnCallSpecBase {
+ public:
+  // The arguments are the location of the ON_CALL() statement.
+  UntypedOnCallSpecBase(const char* a_file, int a_line)
+      : file_(a_file), line_(a_line), last_clause_(kNone) {}
+
+  // Where in the source file was the default action spec defined?
+  const char* file() const { return file_; }
+  int line() const { return line_; }
+
+ protected:
+  // Gives each clause in the ON_CALL() statement a name.
+  enum Clause {
+    // Do not change the order of the enum members!  The run-time
+    // syntax checking relies on it.
+    kNone,
+    kWith,
+    kWillByDefault
+  };
+
+  // Asserts that the ON_CALL() statement has a certain property.
+  void AssertSpecProperty(bool property, const string& failure_message) const {
+    Assert(property, file_, line_, failure_message);
+  }
+
+  // Expects that the ON_CALL() statement has a certain property.
+  void ExpectSpecProperty(bool property, const string& failure_message) const {
+    Expect(property, file_, line_, failure_message);
+  }
+
+  const char* file_;
+  int line_;
+
+  // The last clause in the ON_CALL() statement as seen so far.
+  // Initially kNone and changes as the statement is parsed.
+  Clause last_clause_;
+};  // class UntypedOnCallSpecBase
+
+// This template class implements an ON_CALL spec.
+template <typename F>
+class OnCallSpec : public UntypedOnCallSpecBase {
+ public:
+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
+
+  // Constructs an OnCallSpec object from the information inside
+  // the parenthesis of an ON_CALL() statement.
+  OnCallSpec(const char* a_file, int a_line,
+             const ArgumentMatcherTuple& matchers)
+      : UntypedOnCallSpecBase(a_file, a_line),
+        matchers_(matchers),
+        // By default, extra_matcher_ should match anything.  However,
+        // we cannot initialize it with _ as that triggers a compiler
+        // bug in Symbian's C++ compiler (cannot decide between two
+        // overloaded constructors of Matcher<const ArgumentTuple&>).
+        extra_matcher_(A<const ArgumentTuple&>()) {
+  }
+
+  // Implements the .With() clause.
+  OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
+    // Makes sure this is called at most once.
+    ExpectSpecProperty(last_clause_ < kWith,
+                       ".With() cannot appear "
+                       "more than once in an ON_CALL().");
+    last_clause_ = kWith;
+
+    extra_matcher_ = m;
+    return *this;
+  }
+
+  // Implements the .WillByDefault() clause.
+  OnCallSpec& WillByDefault(const Action<F>& action) {
+    ExpectSpecProperty(last_clause_ < kWillByDefault,
+                       ".WillByDefault() must appear "
+                       "exactly once in an ON_CALL().");
+    last_clause_ = kWillByDefault;
+
+    ExpectSpecProperty(!action.IsDoDefault(),
+                       "DoDefault() cannot be used in ON_CALL().");
+    action_ = action;
+    return *this;
+  }
+
+  // Returns true iff the given arguments match the matchers.
+  bool Matches(const ArgumentTuple& args) const {
+    return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
+  }
+
+  // Returns the action specified by the user.
+  const Action<F>& GetAction() const {
+    AssertSpecProperty(last_clause_ == kWillByDefault,
+                       ".WillByDefault() must appear exactly "
+                       "once in an ON_CALL().");
+    return action_;
+  }
+
+ private:
+  // The information in statement
+  //
+  //   ON_CALL(mock_object, Method(matchers))
+  //       .With(multi-argument-matcher)
+  //       .WillByDefault(action);
+  //
+  // is recorded in the data members like this:
+  //
+  //   source file that contains the statement => file_
+  //   line number of the statement            => line_
+  //   matchers                                => matchers_
+  //   multi-argument-matcher                  => extra_matcher_
+  //   action                                  => action_
+  ArgumentMatcherTuple matchers_;
+  Matcher<const ArgumentTuple&> extra_matcher_;
+  Action<F> action_;
+};  // class OnCallSpec
+
+// Possible reactions on uninteresting calls.
+enum CallReaction {
+  kAllow,
+  kWarn,
+  kFail,
+  kDefault = kWarn  // By default, warn about uninteresting calls.
+};
+
+}  // namespace internal
+
+// Utilities for manipulating mock objects.
+class GTEST_API_ Mock {
+ public:
+  // The following public methods can be called concurrently.
+
+  // Tells Google Mock to ignore mock_obj when checking for leaked
+  // mock objects.
+  static void AllowLeak(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Verifies and clears all expectations on the given mock object.
+  // If the expectations aren't satisfied, generates one or more
+  // Google Test non-fatal failures and returns false.
+  static bool VerifyAndClearExpectations(void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Verifies all expectations on the given mock object and clears its
+  // default actions and expectations.  Returns true iff the
+  // verification was successful.
+  static bool VerifyAndClear(void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+ private:
+  friend class internal::UntypedFunctionMockerBase;
+
+  // Needed for a function mocker to register itself (so that we know
+  // how to clear a mock object).
+  template <typename F>
+  friend class internal::FunctionMockerBase;
+
+  template <typename M>
+  friend class NiceMock;
+
+  template <typename M>
+  friend class NaggyMock;
+
+  template <typename M>
+  friend class StrictMock;
+
+  // Tells Google Mock to allow uninteresting calls on the given mock
+  // object.
+  static void AllowUninterestingCalls(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock to warn the user about uninteresting calls on
+  // the given mock object.
+  static void WarnUninterestingCalls(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock to fail uninteresting calls on the given mock
+  // object.
+  static void FailUninterestingCalls(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock the given mock object is being destroyed and
+  // its entry in the call-reaction table should be removed.
+  static void UnregisterCallReaction(const void* mock_obj)
+      GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Returns the reaction Google Mock will have on uninteresting calls
+  // made on the given mock object.
+  static internal::CallReaction GetReactionOnUninterestingCalls(
+      const void* mock_obj)
+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Verifies that all expectations on the given mock object have been
+  // satisfied.  Reports one or more Google Test non-fatal failures
+  // and returns false if not.
+  static bool VerifyAndClearExpectationsLocked(void* mock_obj)
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
+
+  // Clears all ON_CALL()s set on the given mock object.
+  static void ClearDefaultActionsLocked(void* mock_obj)
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
+
+  // Registers a mock object and a mock method it owns.
+  static void Register(
+      const void* mock_obj,
+      internal::UntypedFunctionMockerBase* mocker)
+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Tells Google Mock where in the source code mock_obj is used in an
+  // ON_CALL or EXPECT_CALL.  In case mock_obj is leaked, this
+  // information helps the user identify which object it is.
+  static void RegisterUseByOnCallOrExpectCall(
+      const void* mock_obj, const char* file, int line)
+          GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
+
+  // Unregisters a mock method; removes the owning mock object from
+  // the registry when the last mock method associated with it has
+  // been unregistered.  This is called only in the destructor of
+  // FunctionMockerBase.
+  static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
+};  // class Mock
+
+// An abstract handle of an expectation.  Useful in the .After()
+// clause of EXPECT_CALL() for setting the (partial) order of
+// expectations.  The syntax:
+//
+//   Expectation e1 = EXPECT_CALL(...)...;
+//   EXPECT_CALL(...).After(e1)...;
+//
+// sets two expectations where the latter can only be matched after
+// the former has been satisfied.
+//
+// Notes:
+//   - This class is copyable and has value semantics.
+//   - Constness is shallow: a const Expectation object itself cannot
+//     be modified, but the mutable methods of the ExpectationBase
+//     object it references can be called via expectation_base().
+//   - The constructors and destructor are defined out-of-line because
+//     the Symbian WINSCW compiler wants to otherwise instantiate them
+//     when it sees this class definition, at which point it doesn't have
+//     ExpectationBase available yet, leading to incorrect destruction
+//     in the linked_ptr (or compilation errors if using a checking
+//     linked_ptr).
+class GTEST_API_ Expectation {
+ public:
+  // Constructs a null object that doesn't reference any expectation.
+  Expectation();
+
+  ~Expectation();
+
+  // This single-argument ctor must not be explicit, in order to support the
+  //   Expectation e = EXPECT_CALL(...);
+  // syntax.
+  //
+  // A TypedExpectation object stores its pre-requisites as
+  // Expectation objects, and needs to call the non-const Retire()
+  // method on the ExpectationBase objects they reference.  Therefore
+  // Expectation must receive a *non-const* reference to the
+  // ExpectationBase object.
+  Expectation(internal::ExpectationBase& exp);  // NOLINT
+
+  // The compiler-generated copy ctor and operator= work exactly as
+  // intended, so we don't need to define our own.
+
+  // Returns true iff rhs references the same expectation as this object does.
+  bool operator==(const Expectation& rhs) const {
+    return expectation_base_ == rhs.expectation_base_;
+  }
+
+  bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
+
+ private:
+  friend class ExpectationSet;
+  friend class Sequence;
+  friend class ::testing::internal::ExpectationBase;
+  friend class ::testing::internal::UntypedFunctionMockerBase;
+
+  template <typename F>
+  friend class ::testing::internal::FunctionMockerBase;
+
+  template <typename F>
+  friend class ::testing::internal::TypedExpectation;
+
+  // This comparator is needed for putting Expectation objects into a set.
+  class Less {
+   public:
+    bool operator()(const Expectation& lhs, const Expectation& rhs) const {
+      return lhs.expectation_base_.get() < rhs.expectation_base_.get();
+    }
+  };
+
+  typedef ::std::set<Expectation, Less> Set;
+
+  Expectation(
+      const internal::linked_ptr<internal::ExpectationBase>& expectation_base);
+
+  // Returns the expectation this object references.
+  const internal::linked_ptr<internal::ExpectationBase>&
+  expectation_base() const {
+    return expectation_base_;
+  }
+
+  // A linked_ptr that co-owns the expectation this handle references.
+  internal::linked_ptr<internal::ExpectationBase> expectation_base_;
+};
+
+// A set of expectation handles.  Useful in the .After() clause of
+// EXPECT_CALL() for setting the (partial) order of expectations.  The
+// syntax:
+//
+//   ExpectationSet es;
+//   es += EXPECT_CALL(...)...;
+//   es += EXPECT_CALL(...)...;
+//   EXPECT_CALL(...).After(es)...;
+//
+// sets three expectations where the last one can only be matched
+// after the first two have both been satisfied.
+//
+// This class is copyable and has value semantics.
+class ExpectationSet {
+ public:
+  // A bidirectional iterator that can read a const element in the set.
+  typedef Expectation::Set::const_iterator const_iterator;
+
+  // An object stored in the set.  This is an alias of Expectation.
+  typedef Expectation::Set::value_type value_type;
+
+  // Constructs an empty set.
+  ExpectationSet() {}
+
+  // This single-argument ctor must not be explicit, in order to support the
+  //   ExpectationSet es = EXPECT_CALL(...);
+  // syntax.
+  ExpectationSet(internal::ExpectationBase& exp) {  // NOLINT
+    *this += Expectation(exp);
+  }
+
+  // This single-argument ctor implements implicit conversion from
+  // Expectation and thus must not be explicit.  This allows either an
+  // Expectation or an ExpectationSet to be used in .After().
+  ExpectationSet(const Expectation& e) {  // NOLINT
+    *this += e;
+  }
+
+  // The compiler-generator ctor and operator= works exactly as
+  // intended, so we don't need to define our own.
+
+  // Returns true iff rhs contains the same set of Expectation objects
+  // as this does.
+  bool operator==(const ExpectationSet& rhs) const {
+    return expectations_ == rhs.expectations_;
+  }
+
+  bool operator!=(const ExpectationSet& rhs) const { return !(*this == rhs); }
+
+  // Implements the syntax
+  //   expectation_set += EXPECT_CALL(...);
+  ExpectationSet& operator+=(const Expectation& e) {
+    expectations_.insert(e);
+    return *this;
+  }
+
+  int size() const { return static_cast<int>(expectations_.size()); }
+
+  const_iterator begin() const { return expectations_.begin(); }
+  const_iterator end() const { return expectations_.end(); }
+
+ private:
+  Expectation::Set expectations_;
+};
+
+
+// Sequence objects are used by a user to specify the relative order
+// in which the expectations should match.  They are copyable (we rely
+// on the compiler-defined copy constructor and assignment operator).
+class GTEST_API_ Sequence {
+ public:
+  // Constructs an empty sequence.
+  Sequence() : last_expectation_(new Expectation) {}
+
+  // Adds an expectation to this sequence.  The caller must ensure
+  // that no other thread is accessing this Sequence object.
+  void AddExpectation(const Expectation& expectation) const;
+
+ private:
+  // The last expectation in this sequence.  We use a linked_ptr here
+  // because Sequence objects are copyable and we want the copies to
+  // be aliases.  The linked_ptr allows the copies to co-own and share
+  // the same Expectation object.
+  internal::linked_ptr<Expectation> last_expectation_;
+};  // class Sequence
+
+// An object of this type causes all EXPECT_CALL() statements
+// encountered in its scope to be put in an anonymous sequence.  The
+// work is done in the constructor and destructor.  You should only
+// create an InSequence object on the stack.
+//
+// The sole purpose for this class is to support easy definition of
+// sequential expectations, e.g.
+//
+//   {
+//     InSequence dummy;  // The name of the object doesn't matter.
+//
+//     // The following expectations must match in the order they appear.
+//     EXPECT_CALL(a, Bar())...;
+//     EXPECT_CALL(a, Baz())...;
+//     ...
+//     EXPECT_CALL(b, Xyz())...;
+//   }
+//
+// You can create InSequence objects in multiple threads, as long as
+// they are used to affect different mock objects.  The idea is that
+// each thread can create and set up its own mocks as if it's the only
+// thread.  However, for clarity of your tests we recommend you to set
+// up mocks in the main thread unless you have a good reason not to do
+// so.
+class GTEST_API_ InSequence {
+ public:
+  InSequence();
+  ~InSequence();
+ private:
+  bool sequence_created_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence);  // NOLINT
+} GTEST_ATTRIBUTE_UNUSED_;
+
+namespace internal {
+
+// Points to the implicit sequence introduced by a living InSequence
+// object (if any) in the current thread or NULL.
+GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence;
+
+// Base class for implementing expectations.
+//
+// There are two reasons for having a type-agnostic base class for
+// Expectation:
+//
+//   1. We need to store collections of expectations of different
+//   types (e.g. all pre-requisites of a particular expectation, all
+//   expectations in a sequence).  Therefore these expectation objects
+//   must share a common base class.
+//
+//   2. We can avoid binary code bloat by moving methods not depending
+//   on the template argument of Expectation to the base class.
+//
+// This class is internal and mustn't be used by user code directly.
+class GTEST_API_ ExpectationBase {
+ public:
+  // source_text is the EXPECT_CALL(...) source that created this Expectation.
+  ExpectationBase(const char* file, int line, const string& source_text);
+
+  virtual ~ExpectationBase();
+
+  // Where in the source file was the expectation spec defined?
+  const char* file() const { return file_; }
+  int line() const { return line_; }
+  const char* source_text() const { return source_text_.c_str(); }
+  // Returns the cardinality specified in the expectation spec.
+  const Cardinality& cardinality() const { return cardinality_; }
+
+  // Describes the source file location of this expectation.
+  void DescribeLocationTo(::std::ostream* os) const {
+    *os << FormatFileLocation(file(), line()) << " ";
+  }
+
+  // Describes how many times a function call matching this
+  // expectation has occurred.
+  void DescribeCallCountTo(::std::ostream* os) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // If this mock method has an extra matcher (i.e. .With(matcher)),
+  // describes it to the ostream.
+  virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;
+
+ protected:
+  friend class ::testing::Expectation;
+  friend class UntypedFunctionMockerBase;
+
+  enum Clause {
+    // Don't change the order of the enum members!
+    kNone,
+    kWith,
+    kTimes,
+    kInSequence,
+    kAfter,
+    kWillOnce,
+    kWillRepeatedly,
+    kRetiresOnSaturation
+  };
+
+  typedef std::vector<const void*> UntypedActions;
+
+  // Returns an Expectation object that references and co-owns this
+  // expectation.
+  virtual Expectation GetHandle() = 0;
+
+  // Asserts that the EXPECT_CALL() statement has the given property.
+  void AssertSpecProperty(bool property, const string& failure_message) const {
+    Assert(property, file_, line_, failure_message);
+  }
+
+  // Expects that the EXPECT_CALL() statement has the given property.
+  void ExpectSpecProperty(bool property, const string& failure_message) const {
+    Expect(property, file_, line_, failure_message);
+  }
+
+  // Explicitly specifies the cardinality of this expectation.  Used
+  // by the subclasses to implement the .Times() clause.
+  void SpecifyCardinality(const Cardinality& cardinality);
+
+  // Returns true iff the user specified the cardinality explicitly
+  // using a .Times().
+  bool cardinality_specified() const { return cardinality_specified_; }
+
+  // Sets the cardinality of this expectation spec.
+  void set_cardinality(const Cardinality& a_cardinality) {
+    cardinality_ = a_cardinality;
+  }
+
+  // The following group of methods should only be called after the
+  // EXPECT_CALL() statement, and only when g_gmock_mutex is held by
+  // the current thread.
+
+  // Retires all pre-requisites of this expectation.
+  void RetireAllPreRequisites()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Returns true iff this expectation is retired.
+  bool is_retired() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return retired_;
+  }
+
+  // Retires this expectation.
+  void Retire()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    retired_ = true;
+  }
+
+  // Returns true iff this expectation is satisfied.
+  bool IsSatisfied() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return cardinality().IsSatisfiedByCallCount(call_count_);
+  }
+
+  // Returns true iff this expectation is saturated.
+  bool IsSaturated() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return cardinality().IsSaturatedByCallCount(call_count_);
+  }
+
+  // Returns true iff this expectation is over-saturated.
+  bool IsOverSaturated() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return cardinality().IsOverSaturatedByCallCount(call_count_);
+  }
+
+  // Returns true iff all pre-requisites of this expectation are satisfied.
+  bool AllPrerequisitesAreSatisfied() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Adds unsatisfied pre-requisites of this expectation to 'result'.
+  void FindUnsatisfiedPrerequisites(ExpectationSet* result) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
+
+  // Returns the number this expectation has been invoked.
+  int call_count() const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return call_count_;
+  }
+
+  // Increments the number this expectation has been invoked.
+  void IncrementCallCount()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    call_count_++;
+  }
+
+  // Checks the action count (i.e. the number of WillOnce() and
+  // WillRepeatedly() clauses) against the cardinality if this hasn't
+  // been done before.  Prints a warning if there are too many or too
+  // few actions.
+  void CheckActionCountIfNotDone() const
+      GTEST_LOCK_EXCLUDED_(mutex_);
+
+  friend class ::testing::Sequence;
+  friend class ::testing::internal::ExpectationTester;
+
+  template <typename Function>
+  friend class TypedExpectation;
+
+  // Implements the .Times() clause.
+  void UntypedTimes(const Cardinality& a_cardinality);
+
+  // This group of fields are part of the spec and won't change after
+  // an EXPECT_CALL() statement finishes.
+  const char* file_;          // The file that contains the expectation.
+  int line_;                  // The line number of the expectation.
+  const string source_text_;  // The EXPECT_CALL(...) source text.
+  // True iff the cardinality is specified explicitly.
+  bool cardinality_specified_;
+  Cardinality cardinality_;            // The cardinality of the expectation.
+  // The immediate pre-requisites (i.e. expectations that must be
+  // satisfied before this expectation can be matched) of this
+  // expectation.  We use linked_ptr in the set because we want an
+  // Expectation object to be co-owned by its FunctionMocker and its
+  // successors.  This allows multiple mock objects to be deleted at
+  // different times.
+  ExpectationSet immediate_prerequisites_;
+
+  // This group of fields are the current state of the expectation,
+  // and can change as the mock function is called.
+  int call_count_;  // How many times this expectation has been invoked.
+  bool retired_;    // True iff this expectation has retired.
+  UntypedActions untyped_actions_;
+  bool extra_matcher_specified_;
+  bool repeated_action_specified_;  // True if a WillRepeatedly() was specified.
+  bool retires_on_saturation_;
+  Clause last_clause_;
+  mutable bool action_count_checked_;  // Under mutex_.
+  mutable Mutex mutex_;  // Protects action_count_checked_.
+
+  GTEST_DISALLOW_ASSIGN_(ExpectationBase);
+};  // class ExpectationBase
+
+// Impements an expectation for the given function type.
+template <typename F>
+class TypedExpectation : public ExpectationBase {
+ public:
+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
+  typedef typename Function<F>::Result Result;
+
+  TypedExpectation(FunctionMockerBase<F>* owner,
+                   const char* a_file, int a_line, const string& a_source_text,
+                   const ArgumentMatcherTuple& m)
+      : ExpectationBase(a_file, a_line, a_source_text),
+        owner_(owner),
+        matchers_(m),
+        // By default, extra_matcher_ should match anything.  However,
+        // we cannot initialize it with _ as that triggers a compiler
+        // bug in Symbian's C++ compiler (cannot decide between two
+        // overloaded constructors of Matcher<const ArgumentTuple&>).
+        extra_matcher_(A<const ArgumentTuple&>()),
+        repeated_action_(DoDefault()) {}
+
+  virtual ~TypedExpectation() {
+    // Check the validity of the action count if it hasn't been done
+    // yet (for example, if the expectation was never used).
+    CheckActionCountIfNotDone();
+    for (UntypedActions::const_iterator it = untyped_actions_.begin();
+         it != untyped_actions_.end(); ++it) {
+      delete static_cast<const Action<F>*>(*it);
+    }
+  }
+
+  // Implements the .With() clause.
+  TypedExpectation& With(const Matcher<const ArgumentTuple&>& m) {
+    if (last_clause_ == kWith) {
+      ExpectSpecProperty(false,
+                         ".With() cannot appear "
+                         "more than once in an EXPECT_CALL().");
+    } else {
+      ExpectSpecProperty(last_clause_ < kWith,
+                         ".With() must be the first "
+                         "clause in an EXPECT_CALL().");
+    }
+    last_clause_ = kWith;
+
+    extra_matcher_ = m;
+    extra_matcher_specified_ = true;
+    return *this;
+  }
+
+  // Implements the .Times() clause.
+  TypedExpectation& Times(const Cardinality& a_cardinality) {
+    ExpectationBase::UntypedTimes(a_cardinality);
+    return *this;
+  }
+
+  // Implements the .Times() clause.
+  TypedExpectation& Times(int n) {
+    return Times(Exactly(n));
+  }
+
+  // Implements the .InSequence() clause.
+  TypedExpectation& InSequence(const Sequence& s) {
+    ExpectSpecProperty(last_clause_ <= kInSequence,
+                       ".InSequence() cannot appear after .After(),"
+                       " .WillOnce(), .WillRepeatedly(), or "
+                       ".RetiresOnSaturation().");
+    last_clause_ = kInSequence;
+
+    s.AddExpectation(GetHandle());
+    return *this;
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {
+    return InSequence(s1).InSequence(s2);
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
+                               const Sequence& s3) {
+    return InSequence(s1, s2).InSequence(s3);
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
+                               const Sequence& s3, const Sequence& s4) {
+    return InSequence(s1, s2, s3).InSequence(s4);
+  }
+  TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
+                               const Sequence& s3, const Sequence& s4,
+                               const Sequence& s5) {
+    return InSequence(s1, s2, s3, s4).InSequence(s5);
+  }
+
+  // Implements that .After() clause.
+  TypedExpectation& After(const ExpectationSet& s) {
+    ExpectSpecProperty(last_clause_ <= kAfter,
+                       ".After() cannot appear after .WillOnce(),"
+                       " .WillRepeatedly(), or "
+                       ".RetiresOnSaturation().");
+    last_clause_ = kAfter;
+
+    for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
+      immediate_prerequisites_ += *it;
+    }
+    return *this;
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2) {
+    return After(s1).After(s2);
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
+                          const ExpectationSet& s3) {
+    return After(s1, s2).After(s3);
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
+                          const ExpectationSet& s3, const ExpectationSet& s4) {
+    return After(s1, s2, s3).After(s4);
+  }
+  TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
+                          const ExpectationSet& s3, const ExpectationSet& s4,
+                          const ExpectationSet& s5) {
+    return After(s1, s2, s3, s4).After(s5);
+  }
+
+  // Implements the .WillOnce() clause.
+  TypedExpectation& WillOnce(const Action<F>& action) {
+    ExpectSpecProperty(last_clause_ <= kWillOnce,
+                       ".WillOnce() cannot appear after "
+                       ".WillRepeatedly() or .RetiresOnSaturation().");
+    last_clause_ = kWillOnce;
+
+    untyped_actions_.push_back(new Action<F>(action));
+    if (!cardinality_specified()) {
+      set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
+    }
+    return *this;
+  }
+
+  // Implements the .WillRepeatedly() clause.
+  TypedExpectation& WillRepeatedly(const Action<F>& action) {
+    if (last_clause_ == kWillRepeatedly) {
+      ExpectSpecProperty(false,
+                         ".WillRepeatedly() cannot appear "
+                         "more than once in an EXPECT_CALL().");
+    } else {
+      ExpectSpecProperty(last_clause_ < kWillRepeatedly,
+                         ".WillRepeatedly() cannot appear "
+                         "after .RetiresOnSaturation().");
+    }
+    last_clause_ = kWillRepeatedly;
+    repeated_action_specified_ = true;
+
+    repeated_action_ = action;
+    if (!cardinality_specified()) {
+      set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
+    }
+
+    // Now that no more action clauses can be specified, we check
+    // whether their count makes sense.
+    CheckActionCountIfNotDone();
+    return *this;
+  }
+
+  // Implements the .RetiresOnSaturation() clause.
+  TypedExpectation& RetiresOnSaturation() {
+    ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
+                       ".RetiresOnSaturation() cannot appear "
+                       "more than once.");
+    last_clause_ = kRetiresOnSaturation;
+    retires_on_saturation_ = true;
+
+    // Now that no more action clauses can be specified, we check
+    // whether their count makes sense.
+    CheckActionCountIfNotDone();
+    return *this;
+  }
+
+  // Returns the matchers for the arguments as specified inside the
+  // EXPECT_CALL() macro.
+  const ArgumentMatcherTuple& matchers() const {
+    return matchers_;
+  }
+
+  // Returns the matcher specified by the .With() clause.
+  const Matcher<const ArgumentTuple&>& extra_matcher() const {
+    return extra_matcher_;
+  }
+
+  // Returns the action specified by the .WillRepeatedly() clause.
+  const Action<F>& repeated_action() const { return repeated_action_; }
+
+  // If this mock method has an extra matcher (i.e. .With(matcher)),
+  // describes it to the ostream.
+  virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) {
+    if (extra_matcher_specified_) {
+      *os << "    Expected args: ";
+      extra_matcher_.DescribeTo(os);
+      *os << "\n";
+    }
+  }
+
+ private:
+  template <typename Function>
+  friend class FunctionMockerBase;
+
+  // Returns an Expectation object that references and co-owns this
+  // expectation.
+  virtual Expectation GetHandle() {
+    return owner_->GetHandleOf(this);
+  }
+
+  // The following methods will be called only after the EXPECT_CALL()
+  // statement finishes and when the current thread holds
+  // g_gmock_mutex.
+
+  // Returns true iff this expectation matches the given arguments.
+  bool Matches(const ArgumentTuple& args) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
+  }
+
+  // Returns true iff this expectation should handle the given arguments.
+  bool ShouldHandleArguments(const ArgumentTuple& args) const
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+
+    // In case the action count wasn't checked when the expectation
+    // was defined (e.g. if this expectation has no WillRepeatedly()
+    // or RetiresOnSaturation() clause), we check it when the
+    // expectation is used for the first time.
+    CheckActionCountIfNotDone();
+    return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
+  }
+
+  // Describes the result of matching the arguments against this
+  // expectation to the given ostream.
+  void ExplainMatchResultTo(
+      const ArgumentTuple& args,
+      ::std::ostream* os) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+
+    if (is_retired()) {
+      *os << "         Expected: the expectation is active\n"
+          << "           Actual: it is retired\n";
+    } else if (!Matches(args)) {
+      if (!TupleMatches(matchers_, args)) {
+        ExplainMatchFailureTupleTo(matchers_, args, os);
+      }
+      StringMatchResultListener listener;
+      if (!extra_matcher_.MatchAndExplain(args, &listener)) {
+        *os << "    Expected args: ";
+        extra_matcher_.DescribeTo(os);
+        *os << "\n           Actual: don't match";
+
+        internal::PrintIfNotEmpty(listener.str(), os);
+        *os << "\n";
+      }
+    } else if (!AllPrerequisitesAreSatisfied()) {
+      *os << "         Expected: all pre-requisites are satisfied\n"
+          << "           Actual: the following immediate pre-requisites "
+          << "are not satisfied:\n";
+      ExpectationSet unsatisfied_prereqs;
+      FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
+      int i = 0;
+      for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
+           it != unsatisfied_prereqs.end(); ++it) {
+        it->expectation_base()->DescribeLocationTo(os);
+        *os << "pre-requisite #" << i++ << "\n";
+      }
+      *os << "                   (end of pre-requisites)\n";
+    } else {
+      // This line is here just for completeness' sake.  It will never
+      // be executed as currently the ExplainMatchResultTo() function
+      // is called only when the mock function call does NOT match the
+      // expectation.
+      *os << "The call matches the expectation.\n";
+    }
+  }
+
+  // Returns the action that should be taken for the current invocation.
+  const Action<F>& GetCurrentAction(
+      const FunctionMockerBase<F>* mocker,
+      const ArgumentTuple& args) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    const int count = call_count();
+    Assert(count >= 1, __FILE__, __LINE__,
+           "call_count() is <= 0 when GetCurrentAction() is "
+           "called - this should never happen.");
+
+    const int action_count = static_cast<int>(untyped_actions_.size());
+    if (action_count > 0 && !repeated_action_specified_ &&
+        count > action_count) {
+      // If there is at least one WillOnce() and no WillRepeatedly(),
+      // we warn the user when the WillOnce() clauses ran out.
+      ::std::stringstream ss;
+      DescribeLocationTo(&ss);
+      ss << "Actions ran out in " << source_text() << "...\n"
+         << "Called " << count << " times, but only "
+         << action_count << " WillOnce()"
+         << (action_count == 1 ? " is" : "s are") << " specified - ";
+      mocker->DescribeDefaultActionTo(args, &ss);
+      Log(kWarning, ss.str(), 1);
+    }
+
+    return count <= action_count ?
+        *static_cast<const Action<F>*>(untyped_actions_[count - 1]) :
+        repeated_action();
+  }
+
+  // Given the arguments of a mock function call, if the call will
+  // over-saturate this expectation, returns the default action;
+  // otherwise, returns the next action in this expectation.  Also
+  // describes *what* happened to 'what', and explains *why* Google
+  // Mock does it to 'why'.  This method is not const as it calls
+  // IncrementCallCount().  A return value of NULL means the default
+  // action.
+  const Action<F>* GetActionForArguments(
+      const FunctionMockerBase<F>* mocker,
+      const ArgumentTuple& args,
+      ::std::ostream* what,
+      ::std::ostream* why)
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    if (IsSaturated()) {
+      // We have an excessive call.
+      IncrementCallCount();
+      *what << "Mock function called more times than expected - ";
+      mocker->DescribeDefaultActionTo(args, what);
+      DescribeCallCountTo(why);
+
+      // TODO(wan@google.com): allow the user to control whether
+      // unexpected calls should fail immediately or continue using a
+      // flag --gmock_unexpected_calls_are_fatal.
+      return NULL;
+    }
+
+    IncrementCallCount();
+    RetireAllPreRequisites();
+
+    if (retires_on_saturation_ && IsSaturated()) {
+      Retire();
+    }
+
+    // Must be done after IncrementCount()!
+    *what << "Mock function call matches " << source_text() <<"...\n";
+    return &(GetCurrentAction(mocker, args));
+  }
+
+  // All the fields below won't change once the EXPECT_CALL()
+  // statement finishes.
+  FunctionMockerBase<F>* const owner_;
+  ArgumentMatcherTuple matchers_;
+  Matcher<const ArgumentTuple&> extra_matcher_;
+  Action<F> repeated_action_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(TypedExpectation);
+};  // class TypedExpectation
+
+// A MockSpec object is used by ON_CALL() or EXPECT_CALL() for
+// specifying the default behavior of, or expectation on, a mock
+// function.
+
+// Note: class MockSpec really belongs to the ::testing namespace.
+// However if we define it in ::testing, MSVC will complain when
+// classes in ::testing::internal declare it as a friend class
+// template.  To workaround this compiler bug, we define MockSpec in
+// ::testing::internal and import it into ::testing.
+
+// Logs a message including file and line number information.
+GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
+                                const char* file, int line,
+                                const string& message);
+
+template <typename F>
+class MockSpec {
+ public:
+  typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename internal::Function<F>::ArgumentMatcherTuple
+      ArgumentMatcherTuple;
+
+  // Constructs a MockSpec object, given the function mocker object
+  // that the spec is associated with.
+  explicit MockSpec(internal::FunctionMockerBase<F>* function_mocker)
+      : function_mocker_(function_mocker) {}
+
+  // Adds a new default action spec to the function mocker and returns
+  // the newly created spec.
+  internal::OnCallSpec<F>& InternalDefaultActionSetAt(
+      const char* file, int line, const char* obj, const char* call) {
+    LogWithLocation(internal::kInfo, file, line,
+        string("ON_CALL(") + obj + ", " + call + ") invoked");
+    return function_mocker_->AddNewOnCallSpec(file, line, matchers_);
+  }
+
+  // Adds a new expectation spec to the function mocker and returns
+  // the newly created spec.
+  internal::TypedExpectation<F>& InternalExpectedAt(
+      const char* file, int line, const char* obj, const char* call) {
+    const string source_text(string("EXPECT_CALL(") + obj + ", " + call + ")");
+    LogWithLocation(internal::kInfo, file, line, source_text + " invoked");
+    return function_mocker_->AddNewExpectation(
+        file, line, source_text, matchers_);
+  }
+
+ private:
+  template <typename Function>
+  friend class internal::FunctionMocker;
+
+  void SetMatchers(const ArgumentMatcherTuple& matchers) {
+    matchers_ = matchers;
+  }
+
+  // The function mocker that owns this spec.
+  internal::FunctionMockerBase<F>* const function_mocker_;
+  // The argument matchers specified in the spec.
+  ArgumentMatcherTuple matchers_;
+
+  GTEST_DISALLOW_ASSIGN_(MockSpec);
+};  // class MockSpec
+
+// Wrapper type for generically holding an ordinary value or lvalue reference.
+// If T is not a reference type, it must be copyable or movable.
+// ReferenceOrValueWrapper<T> is movable, and will also be copyable unless
+// T is a move-only value type (which means that it will always be copyable
+// if the current platform does not support move semantics).
+//
+// The primary template defines handling for values, but function header
+// comments describe the contract for the whole template (including
+// specializations).
+template <typename T>
+class ReferenceOrValueWrapper {
+ public:
+  // Constructs a wrapper from the given value/reference.
+  explicit ReferenceOrValueWrapper(T value)
+      : value_(::testing::internal::move(value)) {
+  }
+
+  // Unwraps and returns the underlying value/reference, exactly as
+  // originally passed. The behavior of calling this more than once on
+  // the same object is unspecified.
+  T Unwrap() { return ::testing::internal::move(value_); }
+
+  // Provides nondestructive access to the underlying value/reference.
+  // Always returns a const reference (more precisely,
+  // const RemoveReference<T>&). The behavior of calling this after
+  // calling Unwrap on the same object is unspecified.
+  const T& Peek() const {
+    return value_;
+  }
+
+ private:
+  T value_;
+};
+
+// Specialization for lvalue reference types. See primary template
+// for documentation.
+template <typename T>
+class ReferenceOrValueWrapper<T&> {
+ public:
+  // Workaround for debatable pass-by-reference lint warning (c-library-team
+  // policy precludes NOLINT in this context)
+  typedef T& reference;
+  explicit ReferenceOrValueWrapper(reference ref)
+      : value_ptr_(&ref) {}
+  T& Unwrap() { return *value_ptr_; }
+  const T& Peek() const { return *value_ptr_; }
+
+ private:
+  T* value_ptr_;
+};
+
+// MSVC warns about using 'this' in base member initializer list, so
+// we need to temporarily disable the warning.  We have to do it for
+// the entire class to suppress the warning, even though it's about
+// the constructor only.
+
+#ifdef _MSC_VER
+# pragma warning(push)          // Saves the current warning state.
+# pragma warning(disable:4355)  // Temporarily disables warning 4355.
+#endif  // _MSV_VER
+
+// C++ treats the void type specially.  For example, you cannot define
+// a void-typed variable or pass a void value to a function.
+// ActionResultHolder<T> holds a value of type T, where T must be a
+// copyable type or void (T doesn't need to be default-constructable).
+// It hides the syntactic difference between void and other types, and
+// is used to unify the code for invoking both void-returning and
+// non-void-returning mock functions.
+
+// Untyped base class for ActionResultHolder<T>.
+class UntypedActionResultHolderBase {
+ public:
+  virtual ~UntypedActionResultHolderBase() {}
+
+  // Prints the held value as an action's result to os.
+  virtual void PrintAsActionResult(::std::ostream* os) const = 0;
+};
+
+// This generic definition is used when T is not void.
+template <typename T>
+class ActionResultHolder : public UntypedActionResultHolderBase {
+ public:
+  // Returns the held value. Must not be called more than once.
+  T Unwrap() {
+    return result_.Unwrap();
+  }
+
+  // Prints the held value as an action's result to os.
+  virtual void PrintAsActionResult(::std::ostream* os) const {
+    *os << "\n          Returns: ";
+    // T may be a reference type, so we don't use UniversalPrint().
+    UniversalPrinter<T>::Print(result_.Peek(), os);
+  }
+
+  // Performs the given mock function's default action and returns the
+  // result in a new-ed ActionResultHolder.
+  template <typename F>
+  static ActionResultHolder* PerformDefaultAction(
+      const FunctionMockerBase<F>* func_mocker,
+      const typename Function<F>::ArgumentTuple& args,
+      const string& call_description) {
+    return new ActionResultHolder(Wrapper(
+        func_mocker->PerformDefaultAction(args, call_description)));
+  }
+
+  // Performs the given action and returns the result in a new-ed
+  // ActionResultHolder.
+  template <typename F>
+  static ActionResultHolder*
+  PerformAction(const Action<F>& action,
+                const typename Function<F>::ArgumentTuple& args) {
+    return new ActionResultHolder(Wrapper(action.Perform(args)));
+  }
+
+ private:
+  typedef ReferenceOrValueWrapper<T> Wrapper;
+
+  explicit ActionResultHolder(Wrapper result)
+      : result_(::testing::internal::move(result)) {
+  }
+
+  Wrapper result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
+};
+
+// Specialization for T = void.
+template <>
+class ActionResultHolder<void> : public UntypedActionResultHolderBase {
+ public:
+  void Unwrap() { }
+
+  virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
+
+  // Performs the given mock function's default action and returns ownership
+  // of an empty ActionResultHolder*.
+  template <typename F>
+  static ActionResultHolder* PerformDefaultAction(
+      const FunctionMockerBase<F>* func_mocker,
+      const typename Function<F>::ArgumentTuple& args,
+      const string& call_description) {
+    func_mocker->PerformDefaultAction(args, call_description);
+    return new ActionResultHolder;
+  }
+
+  // Performs the given action and returns ownership of an empty
+  // ActionResultHolder*.
+  template <typename F>
+  static ActionResultHolder* PerformAction(
+      const Action<F>& action,
+      const typename Function<F>::ArgumentTuple& args) {
+    action.Perform(args);
+    return new ActionResultHolder;
+  }
+
+ private:
+  ActionResultHolder() {}
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
+};
+
+// The base of the function mocker class for the given function type.
+// We put the methods in this class instead of its child to avoid code
+// bloat.
+template <typename F>
+class FunctionMockerBase : public UntypedFunctionMockerBase {
+ public:
+  typedef typename Function<F>::Result Result;
+  typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+  typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
+
+  FunctionMockerBase() : current_spec_(this) {}
+
+  // The destructor verifies that all expectations on this mock
+  // function have been satisfied.  If not, it will report Google Test
+  // non-fatal failures for the violations.
+  virtual ~FunctionMockerBase()
+        GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    MutexLock l(&g_gmock_mutex);
+    VerifyAndClearExpectationsLocked();
+    Mock::UnregisterLocked(this);
+    ClearDefaultActionsLocked();
+  }
+
+  // Returns the ON_CALL spec that matches this mock function with the
+  // given arguments; returns NULL if no matching ON_CALL is found.
+  // L = *
+  const OnCallSpec<F>* FindOnCallSpec(
+      const ArgumentTuple& args) const {
+    for (UntypedOnCallSpecs::const_reverse_iterator it
+             = untyped_on_call_specs_.rbegin();
+         it != untyped_on_call_specs_.rend(); ++it) {
+      const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it);
+      if (spec->Matches(args))
+        return spec;
+    }
+
+    return NULL;
+  }
+
+  // Performs the default action of this mock function on the given
+  // arguments and returns the result. Asserts (or throws if
+  // exceptions are enabled) with a helpful call descrption if there
+  // is no valid return value. This method doesn't depend on the
+  // mutable state of this object, and thus can be called concurrently
+  // without locking.
+  // L = *
+  Result PerformDefaultAction(const ArgumentTuple& args,
+                              const string& call_description) const {
+    const OnCallSpec<F>* const spec =
+        this->FindOnCallSpec(args);
+    if (spec != NULL) {
+      return spec->GetAction().Perform(args);
+    }
+    const string message = call_description +
+        "\n    The mock function has no default action "
+        "set, and its return type has no default value set.";
+#if GTEST_HAS_EXCEPTIONS
+    if (!DefaultValue<Result>::Exists()) {
+      throw std::runtime_error(message);
+    }
+#else
+    Assert(DefaultValue<Result>::Exists(), "", -1, message);
+#endif
+    return DefaultValue<Result>::Get();
+  }
+
+  // Performs the default action with the given arguments and returns
+  // the action's result.  The call description string will be used in
+  // the error message to describe the call in the case the default
+  // action fails.  The caller is responsible for deleting the result.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
+      const void* untyped_args,  // must point to an ArgumentTuple
+      const string& call_description) const {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    return ResultHolder::PerformDefaultAction(this, args, call_description);
+  }
+
+  // Performs the given action with the given arguments and returns
+  // the action's result.  The caller is responsible for deleting the
+  // result.
+  // L = *
+  virtual UntypedActionResultHolderBase* UntypedPerformAction(
+      const void* untyped_action, const void* untyped_args) const {
+    // Make a copy of the action before performing it, in case the
+    // action deletes the mock object (and thus deletes itself).
+    const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    return ResultHolder::PerformAction(action, args);
+  }
+
+  // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
+  // clears the ON_CALL()s set on this mock function.
+  virtual void ClearDefaultActionsLocked()
+      GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+
+    // Deleting our default actions may trigger other mock objects to be
+    // deleted, for example if an action contains a reference counted smart
+    // pointer to that mock object, and that is the last reference. So if we
+    // delete our actions within the context of the global mutex we may deadlock
+    // when this method is called again. Instead, make a copy of the set of
+    // actions to delete, clear our set within the mutex, and then delete the
+    // actions outside of the mutex.
+    UntypedOnCallSpecs specs_to_delete;
+    untyped_on_call_specs_.swap(specs_to_delete);
+
+    g_gmock_mutex.Unlock();
+    for (UntypedOnCallSpecs::const_iterator it =
+             specs_to_delete.begin();
+         it != specs_to_delete.end(); ++it) {
+      delete static_cast<const OnCallSpec<F>*>(*it);
+    }
+
+    // Lock the mutex again, since the caller expects it to be locked when we
+    // return.
+    g_gmock_mutex.Lock();
+  }
+
+ protected:
+  template <typename Function>
+  friend class MockSpec;
+
+  typedef ActionResultHolder<Result> ResultHolder;
+
+  // Returns the result of invoking this mock function with the given
+  // arguments.  This function can be safely called from multiple
+  // threads concurrently.
+  Result InvokeWith(const ArgumentTuple& args)
+        GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    scoped_ptr<ResultHolder> holder(
+        DownCast_<ResultHolder*>(this->UntypedInvokeWith(&args)));
+    return holder->Unwrap();
+  }
+
+  // Adds and returns a default action spec for this mock function.
+  OnCallSpec<F>& AddNewOnCallSpec(
+      const char* file, int line,
+      const ArgumentMatcherTuple& m)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
+    OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m);
+    untyped_on_call_specs_.push_back(on_call_spec);
+    return *on_call_spec;
+  }
+
+  // Adds and returns an expectation spec for this mock function.
+  TypedExpectation<F>& AddNewExpectation(
+      const char* file,
+      int line,
+      const string& source_text,
+      const ArgumentMatcherTuple& m)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
+    TypedExpectation<F>* const expectation =
+        new TypedExpectation<F>(this, file, line, source_text, m);
+    const linked_ptr<ExpectationBase> untyped_expectation(expectation);
+    untyped_expectations_.push_back(untyped_expectation);
+
+    // Adds this expectation into the implicit sequence if there is one.
+    Sequence* const implicit_sequence = g_gmock_implicit_sequence.get();
+    if (implicit_sequence != NULL) {
+      implicit_sequence->AddExpectation(Expectation(untyped_expectation));
+    }
+
+    return *expectation;
+  }
+
+  // The current spec (either default action spec or expectation spec)
+  // being described on this function mocker.
+  MockSpec<F>& current_spec() { return current_spec_; }
+
+ private:
+  template <typename Func> friend class TypedExpectation;
+
+  // Some utilities needed for implementing UntypedInvokeWith().
+
+  // Describes what default action will be performed for the given
+  // arguments.
+  // L = *
+  void DescribeDefaultActionTo(const ArgumentTuple& args,
+                               ::std::ostream* os) const {
+    const OnCallSpec<F>* const spec = FindOnCallSpec(args);
+
+    if (spec == NULL) {
+      *os << (internal::type_equals<Result, void>::value ?
+              "returning directly.\n" :
+              "returning default value.\n");
+    } else {
+      *os << "taking default action specified at:\n"
+          << FormatFileLocation(spec->file(), spec->line()) << "\n";
+    }
+  }
+
+  // Writes a message that the call is uninteresting (i.e. neither
+  // explicitly expected nor explicitly unexpected) to the given
+  // ostream.
+  virtual void UntypedDescribeUninterestingCall(
+      const void* untyped_args,
+      ::std::ostream* os) const
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    *os << "Uninteresting mock function call - ";
+    DescribeDefaultActionTo(args, os);
+    *os << "    Function call: " << Name();
+    UniversalPrint(args, os);
+  }
+
+  // Returns the expectation that matches the given function arguments
+  // (or NULL is there's no match); when a match is found,
+  // untyped_action is set to point to the action that should be
+  // performed (or NULL if the action is "do default"), and
+  // is_excessive is modified to indicate whether the call exceeds the
+  // expected number.
+  //
+  // Critical section: We must find the matching expectation and the
+  // corresponding action that needs to be taken in an ATOMIC
+  // transaction.  Otherwise another thread may call this mock
+  // method in the middle and mess up the state.
+  //
+  // However, performing the action has to be left out of the critical
+  // section.  The reason is that we have no control on what the
+  // action does (it can invoke an arbitrary user function or even a
+  // mock function) and excessive locking could cause a dead lock.
+  virtual const ExpectationBase* UntypedFindMatchingExpectation(
+      const void* untyped_args,
+      const void** untyped_action, bool* is_excessive,
+      ::std::ostream* what, ::std::ostream* why)
+          GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    MutexLock l(&g_gmock_mutex);
+    TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);
+    if (exp == NULL) {  // A match wasn't found.
+      this->FormatUnexpectedCallMessageLocked(args, what, why);
+      return NULL;
+    }
+
+    // This line must be done before calling GetActionForArguments(),
+    // which will increment the call count for *exp and thus affect
+    // its saturation status.
+    *is_excessive = exp->IsSaturated();
+    const Action<F>* action = exp->GetActionForArguments(this, args, what, why);
+    if (action != NULL && action->IsDoDefault())
+      action = NULL;  // Normalize "do default" to NULL.
+    *untyped_action = action;
+    return exp;
+  }
+
+  // Prints the given function arguments to the ostream.
+  virtual void UntypedPrintArgs(const void* untyped_args,
+                                ::std::ostream* os) const {
+    const ArgumentTuple& args =
+        *static_cast<const ArgumentTuple*>(untyped_args);
+    UniversalPrint(args, os);
+  }
+
+  // Returns the expectation that matches the arguments, or NULL if no
+  // expectation matches them.
+  TypedExpectation<F>* FindMatchingExpectationLocked(
+      const ArgumentTuple& args) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    for (typename UntypedExpectations::const_reverse_iterator it =
+             untyped_expectations_.rbegin();
+         it != untyped_expectations_.rend(); ++it) {
+      TypedExpectation<F>* const exp =
+          static_cast<TypedExpectation<F>*>(it->get());
+      if (exp->ShouldHandleArguments(args)) {
+        return exp;
+      }
+    }
+    return NULL;
+  }
+
+  // Returns a message that the arguments don't match any expectation.
+  void FormatUnexpectedCallMessageLocked(
+      const ArgumentTuple& args,
+      ::std::ostream* os,
+      ::std::ostream* why) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    *os << "\nUnexpected mock function call - ";
+    DescribeDefaultActionTo(args, os);
+    PrintTriedExpectationsLocked(args, why);
+  }
+
+  // Prints a list of expectations that have been tried against the
+  // current mock function call.
+  void PrintTriedExpectationsLocked(
+      const ArgumentTuple& args,
+      ::std::ostream* why) const
+          GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+    g_gmock_mutex.AssertHeld();
+    const int count = static_cast<int>(untyped_expectations_.size());
+    *why << "Google Mock tried the following " << count << " "
+         << (count == 1 ? "expectation, but it didn't match" :
+             "expectations, but none matched")
+         << ":\n";
+    for (int i = 0; i < count; i++) {
+      TypedExpectation<F>* const expectation =
+          static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());
+      *why << "\n";
+      expectation->DescribeLocationTo(why);
+      if (count > 1) {
+        *why << "tried expectation #" << i << ": ";
+      }
+      *why << expectation->source_text() << "...\n";
+      expectation->ExplainMatchResultTo(args, why);
+      expectation->DescribeCallCountTo(why);
+    }
+  }
+
+  // The current spec (either default action spec or expectation spec)
+  // being described on this function mocker.
+  MockSpec<F> current_spec_;
+
+  // There is no generally useful and implementable semantics of
+  // copying a mock object, so copying a mock is usually a user error.
+  // Thus we disallow copying function mockers.  If the user really
+  // wants to copy a mock object, he should implement his own copy
+  // operation, for example:
+  //
+  //   class MockFoo : public Foo {
+  //    public:
+  //     // Defines a copy constructor explicitly.
+  //     MockFoo(const MockFoo& src) {}
+  //     ...
+  //   };
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(FunctionMockerBase);
+};  // class FunctionMockerBase
+
+#ifdef _MSC_VER
+# pragma warning(pop)  // Restores the warning state.
+#endif  // _MSV_VER
+
+// Implements methods of FunctionMockerBase.
+
+// Verifies that all expectations on this mock function have been
+// satisfied.  Reports one or more Google Test non-fatal failures and
+// returns false if not.
+
+// Reports an uninteresting call (whose description is in msg) in the
+// manner specified by 'reaction'.
+void ReportUninterestingCall(CallReaction reaction, const string& msg);
+
+}  // namespace internal
+
+// The style guide prohibits "using" statements in a namespace scope
+// inside a header file.  However, the MockSpec class template is
+// meant to be defined in the ::testing namespace.  The following line
+// is just a trick for working around a bug in MSVC 8.0, which cannot
+// handle it if we define MockSpec in ::testing.
+using internal::MockSpec;
+
+// Const(x) is a convenient function for obtaining a const reference
+// to x.  This is useful for setting expectations on an overloaded
+// const mock method, e.g.
+//
+//   class MockFoo : public FooInterface {
+//    public:
+//     MOCK_METHOD0(Bar, int());
+//     MOCK_CONST_METHOD0(Bar, int&());
+//   };
+//
+//   MockFoo foo;
+//   // Expects a call to non-const MockFoo::Bar().
+//   EXPECT_CALL(foo, Bar());
+//   // Expects a call to const MockFoo::Bar().
+//   EXPECT_CALL(Const(foo), Bar());
+template <typename T>
+inline const T& Const(const T& x) { return x; }
+
+// Constructs an Expectation object that references and co-owns exp.
+inline Expectation::Expectation(internal::ExpectationBase& exp)  // NOLINT
+    : expectation_base_(exp.GetHandle().expectation_base()) {}
+
+}  // namespace testing
+
+// A separate macro is required to avoid compile errors when the name
+// of the method used in call is a result of macro expansion.
+// See CompilesWithMethodNameExpandedFromMacro tests in
+// internal/gmock-spec-builders_test.cc for more details.
+#define GMOCK_ON_CALL_IMPL_(obj, call) \
+    ((obj).gmock_##call).InternalDefaultActionSetAt(__FILE__, __LINE__, \
+                                                    #obj, #call)
+#define ON_CALL(obj, call) GMOCK_ON_CALL_IMPL_(obj, call)
+
+#define GMOCK_EXPECT_CALL_IMPL_(obj, call) \
+    ((obj).gmock_##call).InternalExpectedAt(__FILE__, __LINE__, #obj, #call)
+#define EXPECT_CALL(obj, call) GMOCK_EXPECT_CALL_IMPL_(obj, call)
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/gmock.h b/third_party/wpiutil_2018/gmock/include/gmock/gmock.h
new file mode 100644
index 0000000..6735c71
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/gmock.h
@@ -0,0 +1,94 @@
+// 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.
+
+#include "gmock/gmock-actions.h"
+#include "gmock/gmock-cardinalities.h"
+#include "gmock/gmock-generated-actions.h"
+#include "gmock/gmock-generated-function-mockers.h"
+#include "gmock/gmock-generated-nice-strict.h"
+#include "gmock/gmock-generated-matchers.h"
+#include "gmock/gmock-matchers.h"
+#include "gmock/gmock-more-actions.h"
+#include "gmock/gmock-more-matchers.h"
+#include "gmock/internal/gmock-internal-utils.h"
+
+namespace testing {
+
+// Declares Google Mock flags that we want a user to use programmatically.
+GMOCK_DECLARE_bool_(catch_leaked_mocks);
+GMOCK_DECLARE_string_(verbose);
+
+// Initializes Google Mock.  This must be called before running the
+// tests.  In particular, it parses the command line for the flags
+// that Google Mock recognizes.  Whenever a Google Mock flag is seen,
+// it is removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Mock flag variables are
+// updated.
+//
+// Since Google Test is needed for Google Mock to work, this function
+// also initializes Google Test and parses its flags, if that hasn't
+// been done.
+GTEST_API_ void InitGoogleMock(int* argc, char** argv);
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv);
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_GMOCK_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h
new file mode 100644
index 0000000..7dc3b1a
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h
@@ -0,0 +1,8 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-actions.h.pump
+// DO NOT EDIT BY HAND!!!
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h.pump b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h.pump
new file mode 100644
index 0000000..d26c8a0
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-generated-actions.h.pump
@@ -0,0 +1,10 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file (http://go/pump).  Please use Pump to convert
+$$ it to callback-actions.h.
+$$
+$var max_callback_arity = 5
+$$}} This meta comment fixes auto-indentation in editors.
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-matchers.h b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-matchers.h
new file mode 100644
index 0000000..f2efef9
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-matchers.h
@@ -0,0 +1,39 @@
+// Copyright 2015, 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.
+//
+// ============================================================
+// An installation-specific extension point for gmock-matchers.h.
+// ============================================================
+//
+// Adds google3 callback support to CallableTraits.
+//
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
+
+#endif  //  GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-port.h b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-port.h
new file mode 100644
index 0000000..9ce8bfe
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/custom/gmock-port.h
@@ -0,0 +1,46 @@
+// Copyright 2015, 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.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+//   Flag related macros:
+//     GMOCK_DECLARE_bool_(name)
+//     GMOCK_DECLARE_int32_(name)
+//     GMOCK_DECLARE_string_(name)
+//     GMOCK_DEFINE_bool_(name, default_val, doc)
+//     GMOCK_DEFINE_int32_(name, default_val, doc)
+//     GMOCK_DEFINE_string_(name, default_val, doc)
+//
+// ** Custom implementation starts here **
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h
new file mode 100644
index 0000000..7811e43
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h
@@ -0,0 +1,279 @@
+// 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_
+
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+template <typename T>
+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 <typename T>
+  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
+};
+
+// MatcherTuple<T>::type is a tuple type where each field is a Matcher
+// for the corresponding field in tuple type T.
+template <typename Tuple>
+struct MatcherTuple;
+
+template <>
+struct MatcherTuple< ::testing::tuple<> > {
+  typedef ::testing::tuple< > type;
+};
+
+template <typename A1>
+struct MatcherTuple< ::testing::tuple<A1> > {
+  typedef ::testing::tuple<Matcher<A1> > type;
+};
+
+template <typename A1, typename A2>
+struct MatcherTuple< ::testing::tuple<A1, A2> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
+};
+
+template <typename A1, typename A2, typename A3>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
+      Matcher<A4> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7, typename A8>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7, typename A8, typename A9>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
+};
+
+template <typename A1, typename A2, typename A3, typename A4, typename A5,
+    typename A6, typename A7, typename A8, typename A9, typename A10>
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+    A10> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+      Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
+      Matcher<A10> > type;
+};
+
+// Template struct Function<F>, 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 <typename F>
+struct Function;
+
+template <typename R>
+struct Function<R()> {
+  typedef R Result;
+  typedef ::testing::tuple<> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid();
+  typedef IgnoredValue MakeResultIgnoredValue();
+};
+
+template <typename R, typename A1>
+struct Function<R(A1)>
+    : Function<R()> {
+  typedef A1 Argument1;
+  typedef ::testing::tuple<A1> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1);
+  typedef IgnoredValue MakeResultIgnoredValue(A1);
+};
+
+template <typename R, typename A1, typename A2>
+struct Function<R(A1, A2)>
+    : Function<R(A1)> {
+  typedef A2 Argument2;
+  typedef ::testing::tuple<A1, A2> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
+};
+
+template <typename R, typename A1, typename A2, typename A3>
+struct Function<R(A1, A2, A3)>
+    : Function<R(A1, A2)> {
+  typedef A3 Argument3;
+  typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4>
+struct Function<R(A1, A2, A3, A4)>
+    : Function<R(A1, A2, A3)> {
+  typedef A4 Argument4;
+  typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5>
+struct Function<R(A1, A2, A3, A4, A5)>
+    : Function<R(A1, A2, A3, A4)> {
+  typedef A5 Argument5;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4, A5);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6>
+struct Function<R(A1, A2, A3, A4, A5, A6)>
+    : Function<R(A1, A2, A3, A4, A5)> {
+  typedef A6 Argument6;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
+    : Function<R(A1, A2, A3, A4, A5, A6)> {
+  typedef A7 Argument7;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
+  typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
+};
+
+template <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
+    : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
+  typedef A8 Argument8;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
+    : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
+  typedef A9 Argument9;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::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 <typename R, typename A1, typename A2, typename A3, typename A4,
+    typename A5, typename A6, typename A7, typename A8, typename A9,
+    typename A10>
+struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
+    : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+  typedef A10 Argument10;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+      A10> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::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_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump
new file mode 100644
index 0000000..800af17
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-generated-internal-utils.h.pump
@@ -0,0 +1,136 @@
+$$ -*- mode: c++; -*-
+$$ This is a Pump source file.  Please use Pump to convert it to
+$$ gmock-generated-function-mockers.h.
+$$
+$var n = 10  $$ The maximum arity we support.
+// 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_
+
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+template <typename T>
+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 <typename T>
+  IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
+};
+
+// MatcherTuple<T>::type is a tuple type where each field is a Matcher
+// for the corresponding field in tuple type T.
+template <typename Tuple>
+struct MatcherTuple;
+
+
+$range i 0..n
+$for i [[
+$range j 1..i
+$var typename_As = [[$for j, [[typename A$j]]]]
+$var As = [[$for j, [[A$j]]]]
+$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
+template <$typename_As>
+struct MatcherTuple< ::testing::tuple<$As> > {
+  typedef ::testing::tuple<$matcher_As > type;
+};
+
+
+]]
+// Template struct Function<F>, 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 <typename F>
+struct Function;
+
+template <typename R>
+struct Function<R()> {
+  typedef R Result;
+  typedef ::testing::tuple<> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid();
+  typedef IgnoredValue MakeResultIgnoredValue();
+};
+
+
+$range i 1..n
+$for i [[
+$range j 1..i
+$var typename_As = [[$for j [[, typename A$j]]]]
+$var As = [[$for j, [[A$j]]]]
+$var matcher_As = [[$for j, [[Matcher<A$j>]]]]
+$range k 1..i-1
+$var prev_As = [[$for k, [[A$k]]]]
+template <typename R$typename_As>
+struct Function<R($As)>
+    : Function<R($prev_As)> {
+  typedef A$i Argument$i;
+  typedef ::testing::tuple<$As> ArgumentTuple;
+  typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
+  typedef void MakeResultVoid($As);
+  typedef IgnoredValue MakeResultIgnoredValue($As);
+};
+
+
+]]
+}  // namespace internal
+
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-internal-utils.h b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-internal-utils.h
new file mode 100644
index 0000000..e2ddb05
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-internal-utils.h
@@ -0,0 +1,511 @@
+// 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 <stdio.h>
+#include <ostream>  // NOLINT
+#include <string>
+
+#include "gmock/internal/gmock-generated-internal-utils.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.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<Pointer>::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 <typename Pointer>
+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 <typename T>
+struct PointeeOf<T*> { 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 <typename Pointer>
+inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
+  return p.get();
+}
+// This overloaded version is for the raw pointer case.
+template <typename Element>
+inline Element* GetRawPointer(Element* p) { return p; }
+
+// This comparator allows linked_ptr to be stored in sets.
+template <typename T>
+struct LinkedPtrLessThan {
+  bool operator()(const ::testing::internal::linked_ptr<T>& lhs,
+                  const ::testing::internal::linked_ptr<T>& 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<T>::value is the kind of type T.
+template <typename T> 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<type> { 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<type>::value)
+
+// Evaluates to true iff integer type T is signed.
+#define GMOCK_IS_SIGNED_(T) (static_cast<T>(-1) < 0)
+
+// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::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 <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
+struct LosslessArithmeticConvertibleImpl : public false_type {};
+
+// Converting bool to bool is lossless.
+template <>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kBool, bool>
+    : public true_type {};  // NOLINT
+
+// Converting bool to any integer type is lossless.
+template <typename To>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kInteger, To>
+    : public true_type {};  // NOLINT
+
+// Converting bool to any floating-point type is lossless.
+template <typename To>
+struct LosslessArithmeticConvertibleImpl<kBool, bool, kFloatingPoint, To>
+    : public true_type {};  // NOLINT
+
+// Converting an integer to bool is lossy.
+template <typename From>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kBool, bool>
+    : 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 <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kInteger, To>
+    : 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 <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<kInteger, From, kFloatingPoint, To>
+    : public false_type {};  // NOLINT
+
+// Converting a floating-point to bool is lossy.
+template <typename From>
+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kBool, bool>
+    : public false_type {};  // NOLINT
+
+// Converting a floating-point to an integer is lossy.
+template <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<kFloatingPoint, From, kInteger, To>
+    : 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 <typename From, typename To>
+struct LosslessArithmeticConvertibleImpl<
+  kFloatingPoint, From, kFloatingPoint, To>
+    : public bool_constant<sizeof(From) <= sizeof(To)> {};  // NOLINT
+
+// LosslessArithmeticConvertible<From, To>::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 <typename From, typename To>
+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<T>::value is non-zero iff T is a reference type.
+template <typename T> struct is_reference : public false_type {};
+template <typename T> struct is_reference<T&> : public true_type {};
+
+// type_equals<T1, T2>::value is non-zero iff T1 and T2 are the same type.
+template <typename T1, typename T2> struct type_equals : public false_type {};
+template <typename T> struct type_equals<T, T> : public true_type {};
+
+// remove_reference<T>::type removes the reference from type T, if any.
+template <typename T> struct remove_reference { typedef T type; };  // NOLINT
+template <typename T> struct remove_reference<T&> { typedef T type; }; // NOLINT
+
+// DecayArray<T>::type turns an array type U[N] to const U* and preserves
+// other types.  Useful for saving a copy of a function argument.
+template <typename T> struct DecayArray { typedef T type; };  // NOLINT
+template <typename T, size_t N> struct DecayArray<T[N]> {
+  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 <typename T> struct DecayArray<T[]> {
+  typedef const T* type;
+};
+
+// Disable MSVC warnings for infinite recursion, since in this case the
+// the recursion is unreachable.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4717)
+#endif
+
+// Invalid<T>() is usable as an expression of type T, but will terminate
+// the program with an assertion failure if actually run.  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 <typename T>
+inline T Invalid() {
+  Assert(false, "", -1, "Internal error: attempt to return invalid value");
+  // This statement is unreachable, and would never terminate even if it
+  // could be reached. It is provided only to placate compiler warnings
+  // about missing return statements.
+  return Invalid<T>();
+}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
+
+// 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<RawContainer> 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 RawContainer>
+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<RawContainer,
+        GTEST_REMOVE_CONST_(RawContainer)>();
+    return container;
+  }
+  static type Copy(const RawContainer& container) { return container; }
+};
+
+// This specialization is used when RawContainer is a native array type.
+template <typename Element, size_t N>
+class StlContainerView<Element[N]> {
+ public:
+  typedef GTEST_REMOVE_CONST_(Element) RawElement;
+  typedef internal::NativeArray<RawElement> type;
+  // NativeArray<T> 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<Element, RawElement>();
+#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<char *>].NativeArray(
+    //     {lval} const char *[4], long, testing::internal::RelationToSource)'
+    //     does not match
+    // 'testing::internal::NativeArray<char *>::NativeArray(
+    //     char *const *, unsigned int, testing::internal::RelationToSource)'
+    // (instantiating: 'testing::internal::ContainsMatcherImpl
+    //     <const char * (&)[4]>::Matches(const char * (&)[4]) const')
+    // (instantiating: 'testing::internal::StlContainerView<char *[4]>::
+    //     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<Element*>(&array[0]), N,
+                RelationToSourceReference());
+#else
+    return type(array, N, RelationToSourceReference());
+#endif  // GTEST_OS_SYMBIAN
+  }
+  static type Copy(const Element (&array)[N]) {
+#if GTEST_OS_SYMBIAN
+    return type(const_cast<Element*>(&array[0]), N, RelationToSourceCopy());
+#else
+    return type(array, N, RelationToSourceCopy());
+#endif  // GTEST_OS_SYMBIAN
+  }
+};
+
+// This specialization is used when RawContainer is a native array
+// represented as a (pointer, size) tuple.
+template <typename ElementPointer, typename Size>
+class StlContainerView< ::testing::tuple<ElementPointer, Size> > {
+ public:
+  typedef GTEST_REMOVE_CONST_(
+      typename internal::PointeeOf<ElementPointer>::type) RawElement;
+  typedef internal::NativeArray<RawElement> type;
+  typedef const type const_reference;
+
+  static const_reference ConstReference(
+      const ::testing::tuple<ElementPointer, Size>& array) {
+    return type(get<0>(array), get<1>(array), RelationToSourceReference());
+  }
+  static type Copy(const ::testing::tuple<ElementPointer, Size>& array) {
+    return type(get<0>(array), get<1>(array), RelationToSourceCopy());
+  }
+};
+
+// The following specialization prevents the user from instantiating
+// StlContainer with a reference type.
+template <typename T> class StlContainerView<T&>;
+
+// 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 <typename T>
+struct RemoveConstFromKey {
+  typedef T type;
+};
+
+// Partially specialized to remove constness from std::pair<const K, V>.
+template <typename K, typename V>
+struct RemoveConstFromKey<std::pair<const K, V> > {
+  typedef std::pair<K, V> type;
+};
+
+// Mapping from booleans to types. Similar to boost::bool_<kValue> and
+// std::integral_constant<bool, kValue>.
+template <bool kValue>
+struct BooleanConstant {};
+
+}  // namespace internal
+}  // namespace testing
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
+
diff --git a/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-port.h b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-port.h
new file mode 100644
index 0000000..63f4a68
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/include/gmock/internal/gmock-port.h
@@ -0,0 +1,91 @@
+// 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.  All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice.  Code
+// outside Google Mock MUST NOT USE THEM DIRECTLY.  Macros that don't
+// end with _ are part of Google Mock's public API and can be used by
+// code outside Google Mock.
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
+
+#include <assert.h>
+#include <stdlib.h>
+#include <iostream>
+
+// Most of the utilities needed for porting Google Mock are also
+// required for Google Test and are defined in gtest-port.h.
+//
+// Note to maintainers: to reduce code duplication, prefer adding
+// portability utilities to Google Test's gtest-port.h instead of
+// here, as Google Mock depends on Google Test.  Only add a utility
+// here if it's truly specific to Google Mock.
+#include "gtest/internal/gtest-linked_ptr.h"
+#include "gtest/internal/gtest-port.h"
+#include "gmock/internal/custom/gmock-port.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
+
+#if !defined(GMOCK_DECLARE_bool_)
+
+// 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  // !defined(GMOCK_DECLARE_bool_)
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
diff --git a/third_party/wpiutil_2018/gmock/src/gmock-all.cc b/third_party/wpiutil_2018/gmock/src/gmock-all.cc
new file mode 100644
index 0000000..7aebce7
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock-all.cc
@@ -0,0 +1,47 @@
+// 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: wan@google.com (Zhanyong Wan)
+//
+// Google C++ Mocking Framework (Google Mock)
+//
+// This file #includes all Google Mock implementation .cc files.  The
+// purpose is to allow a user to build Google Mock by compiling this
+// file alone.
+
+// This line ensures that gmock.h can be compiled on its own, even
+// when it's fused.
+#include "gmock/gmock.h"
+
+// The following lines pull in the real gmock *.cc files.
+#include "src/gmock-cardinalities.cc"
+#include "src/gmock-internal-utils.cc"
+#include "src/gmock-matchers.cc"
+#include "src/gmock-spec-builders.cc"
+#include "src/gmock.cc"
diff --git a/third_party/wpiutil_2018/gmock/src/gmock-cardinalities.cc b/third_party/wpiutil_2018/gmock/src/gmock-cardinalities.cc
new file mode 100644
index 0000000..50ec728
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock-cardinalities.cc
@@ -0,0 +1,156 @@
+// 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 cardinalities.
+
+#include "gmock/gmock-cardinalities.h"
+
+#include <limits.h>
+#include <ostream>  // NOLINT
+#include <sstream>
+#include <string>
+#include "gmock/internal/gmock-internal-utils.h"
+#include "gtest/gtest.h"
+
+namespace testing {
+
+namespace {
+
+// Implements the Between(m, n) cardinality.
+class BetweenCardinalityImpl : public CardinalityInterface {
+ public:
+  BetweenCardinalityImpl(int min, int max)
+      : min_(min >= 0 ? min : 0),
+        max_(max >= min_ ? max : min_) {
+    std::stringstream ss;
+    if (min < 0) {
+      ss << "The invocation lower bound must be >= 0, "
+         << "but is actually " << min << ".";
+      internal::Expect(false, __FILE__, __LINE__, ss.str());
+    } else if (max < 0) {
+      ss << "The invocation upper bound must be >= 0, "
+         << "but is actually " << max << ".";
+      internal::Expect(false, __FILE__, __LINE__, ss.str());
+    } else if (min > max) {
+      ss << "The invocation upper bound (" << max
+         << ") must be >= the invocation lower bound (" << min
+         << ").";
+      internal::Expect(false, __FILE__, __LINE__, ss.str());
+    }
+  }
+
+  // Conservative estimate on the lower/upper bound of the number of
+  // calls allowed.
+  virtual int ConservativeLowerBound() const { return min_; }
+  virtual int ConservativeUpperBound() const { return max_; }
+
+  virtual bool IsSatisfiedByCallCount(int call_count) const {
+    return min_ <= call_count && call_count <= max_;
+  }
+
+  virtual bool IsSaturatedByCallCount(int call_count) const {
+    return call_count >= max_;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const;
+
+ private:
+  const int min_;
+  const int max_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(BetweenCardinalityImpl);
+};
+
+// Formats "n times" in a human-friendly way.
+inline internal::string FormatTimes(int n) {
+  if (n == 1) {
+    return "once";
+  } else if (n == 2) {
+    return "twice";
+  } else {
+    std::stringstream ss;
+    ss << n << " times";
+    return ss.str();
+  }
+}
+
+// Describes the Between(m, n) cardinality in human-friendly text.
+void BetweenCardinalityImpl::DescribeTo(::std::ostream* os) const {
+  if (min_ == 0) {
+    if (max_ == 0) {
+      *os << "never called";
+    } else if (max_ == INT_MAX) {
+      *os << "called any number of times";
+    } else {
+      *os << "called at most " << FormatTimes(max_);
+    }
+  } else if (min_ == max_) {
+    *os << "called " << FormatTimes(min_);
+  } else if (max_ == INT_MAX) {
+    *os << "called at least " << FormatTimes(min_);
+  } else {
+    // 0 < min_ < max_ < INT_MAX
+    *os << "called between " << min_ << " and " << max_ << " times";
+  }
+}
+
+}  // Unnamed namespace
+
+// Describes the given call count to an ostream.
+void Cardinality::DescribeActualCallCountTo(int actual_call_count,
+                                            ::std::ostream* os) {
+  if (actual_call_count > 0) {
+    *os << "called " << FormatTimes(actual_call_count);
+  } else {
+    *os << "never called";
+  }
+}
+
+// Creates a cardinality that allows at least n calls.
+GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
+
+// Creates a cardinality that allows at most n calls.
+GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); }
+
+// Creates a cardinality that allows any number of calls.
+GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); }
+
+// Creates a cardinality that allows between min and max calls.
+GTEST_API_ Cardinality Between(int min, int max) {
+  return Cardinality(new BetweenCardinalityImpl(min, max));
+}
+
+// Creates a cardinality that allows exactly n calls.
+GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); }
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/src/gmock-internal-utils.cc b/third_party/wpiutil_2018/gmock/src/gmock-internal-utils.cc
new file mode 100644
index 0000000..fb53080
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock-internal-utils.cc
@@ -0,0 +1,174 @@
+// 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.
+
+#include "gmock/internal/gmock-internal-utils.h"
+
+#include <ctype.h>
+#include <ostream>  // NOLINT
+#include <string>
+#include "gmock/gmock.h"
+#include "gmock/internal/gmock-port.h"
+#include "gtest/gtest.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) {
+  string result;
+  char prev_char = '\0';
+  for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
+    // We don't care about the current locale as the input is
+    // guaranteed to be a valid C++ identifier name.
+    const bool starts_new_word = IsUpper(*p) ||
+        (!IsAlpha(prev_char) && IsLower(*p)) ||
+        (!IsDigit(prev_char) && IsDigit(*p));
+
+    if (IsAlNum(*p)) {
+      if (starts_new_word && result != "")
+        result += ' ';
+      result += ToLower(*p);
+    }
+  }
+  return result;
+}
+
+// This class reports Google Mock failures as Google Test failures.  A
+// user can define another class in a similar fashion if he intends to
+// use Google Mock with a testing framework other than Google Test.
+class GoogleTestFailureReporter : public FailureReporterInterface {
+ public:
+  virtual void ReportFailure(FailureType type, const char* file, int line,
+                             const string& message) {
+    AssertHelper(type == kFatal ?
+                 TestPartResult::kFatalFailure :
+                 TestPartResult::kNonFatalFailure,
+                 file,
+                 line,
+                 message.c_str()) = Message();
+    if (type == kFatal) {
+      posix::Abort();
+    }
+  }
+};
+
+// Returns the global failure reporter.  Will create a
+// GoogleTestFailureReporter and return it the first time called.
+GTEST_API_ FailureReporterInterface* GetFailureReporter() {
+  // Points to the global failure reporter used by Google Mock.  gcc
+  // guarantees that the following use of failure_reporter is
+  // thread-safe.  We may need to add additional synchronization to
+  // protect failure_reporter if we port Google Mock to other
+  // compilers.
+  static FailureReporterInterface* const failure_reporter =
+      new GoogleTestFailureReporter();
+  return failure_reporter;
+}
+
+// Protects global resources (stdout in particular) used by Log().
+static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex);
+
+// Returns true iff a log with the given severity is visible according
+// to the --gmock_verbose flag.
+GTEST_API_ bool LogIsVisible(LogSeverity severity) {
+  if (GMOCK_FLAG(verbose) == kInfoVerbosity) {
+    // Always show the log if --gmock_verbose=info.
+    return true;
+  } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) {
+    // Always hide it if --gmock_verbose=error.
+    return false;
+  } else {
+    // If --gmock_verbose is neither "info" nor "error", we treat it
+    // as "warning" (its default value).
+    return severity == kWarning;
+  }
+}
+
+// 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) {
+  if (!LogIsVisible(severity))
+    return;
+
+  // Ensures that logs from different threads don't interleave.
+  MutexLock l(&g_log_mutex);
+
+  // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is a
+  // macro.
+
+  if (severity == kWarning) {
+    // Prints a GMOCK WARNING marker to make the warnings easily searchable.
+    std::cout << "\nGMOCK WARNING:";
+  }
+  // Pre-pends a new-line to message if it doesn't start with one.
+  if (message.empty() || message[0] != '\n') {
+    std::cout << "\n";
+  }
+  std::cout << message;
+  if (stack_frames_to_skip >= 0) {
+#ifdef NDEBUG
+    // In opt mode, we have to be conservative and skip no stack frame.
+    const int actual_to_skip = 0;
+#else
+    // In dbg mode, we can do what the caller tell us to do (plus one
+    // for skipping this function's stack frame).
+    const int actual_to_skip = stack_frames_to_skip + 1;
+#endif  // NDEBUG
+
+    // Appends a new-line to message if it doesn't end with one.
+    if (!message.empty() && *message.rbegin() != '\n') {
+      std::cout << "\n";
+    }
+    std::cout << "Stack trace:\n"
+         << ::testing::internal::GetCurrentOsStackTraceExceptTop(
+             ::testing::UnitTest::GetInstance(), actual_to_skip);
+  }
+  std::cout << ::std::flush;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/src/gmock-matchers.cc b/third_party/wpiutil_2018/gmock/src/gmock-matchers.cc
new file mode 100644
index 0000000..e742451
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock-matchers.cc
@@ -0,0 +1,498 @@
+// 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 Matcher<const string&>, Matcher<string>, and
+// utilities for defining matchers.
+
+#include "gmock/gmock-matchers.h"
+#include "gmock/gmock-generated-matchers.h"
+
+#include <string.h>
+#include <sstream>
+#include <string>
+
+namespace testing {
+
+// Constructs a matcher that matches a const string& whose value is
+// equal to s.
+Matcher<const internal::string&>::Matcher(const internal::string& s) {
+  *this = Eq(s);
+}
+
+// Constructs a matcher that matches a const string& whose value is
+// equal to s.
+Matcher<const internal::string&>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a string whose value is equal to s.
+Matcher<internal::string>::Matcher(const internal::string& s) { *this = Eq(s); }
+
+// Constructs a matcher that matches a string whose value is equal to s.
+Matcher<internal::string>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+#if GTEST_HAS_STRING_PIECE_
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(const internal::string& s) {
+  *this = Eq(s);
+}
+
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a const StringPiece& whose value is
+// equal to s.
+Matcher<const StringPiece&>::Matcher(StringPiece s) {
+  *this = Eq(s.ToString());
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(const internal::string& s) {
+  *this = Eq(s);
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(const char* s) {
+  *this = Eq(internal::string(s));
+}
+
+// Constructs a matcher that matches a StringPiece whose value is equal to s.
+Matcher<StringPiece>::Matcher(StringPiece s) {
+  *this = Eq(s.ToString());
+}
+#endif  // GTEST_HAS_STRING_PIECE_
+
+namespace internal {
+
+// Joins a vector of strings as if they are fields of a tuple; returns
+// the joined string.
+GTEST_API_ string JoinAsTuple(const Strings& fields) {
+  switch (fields.size()) {
+    case 0:
+      return "";
+    case 1:
+      return fields[0];
+    default:
+      string result = "(" + fields[0];
+      for (size_t i = 1; i < fields.size(); i++) {
+        result += ", ";
+        result += fields[i];
+      }
+      result += ")";
+      return result;
+  }
+}
+
+// Returns the description for a matcher defined using the MATCHER*()
+// macro where the user-supplied description string is "", if
+// 'negation' is false; otherwise returns the description of the
+// negation of the matcher.  'param_values' contains a list of strings
+// that are the print-out of the matcher's parameters.
+GTEST_API_ string FormatMatcherDescription(bool negation,
+                                           const char* matcher_name,
+                                           const Strings& param_values) {
+  string result = ConvertIdentifierNameToWords(matcher_name);
+  if (param_values.size() >= 1)
+    result += " " + JoinAsTuple(param_values);
+  return negation ? "not (" + result + ")" : result;
+}
+
+// FindMaxBipartiteMatching and its helper class.
+//
+// Uses the well-known Ford-Fulkerson max flow method to find a maximum
+// bipartite matching. Flow is considered to be from left to right.
+// There is an implicit source node that is connected to all of the left
+// nodes, and an implicit sink node that is connected to all of the
+// right nodes. All edges have unit capacity.
+//
+// Neither the flow graph nor the residual flow graph are represented
+// explicitly. Instead, they are implied by the information in 'graph' and
+// a vector<int> called 'left_' whose elements are initialized to the
+// value kUnused. This represents the initial state of the algorithm,
+// where the flow graph is empty, and the residual flow graph has the
+// following edges:
+//   - An edge from source to each left_ node
+//   - An edge from each right_ node to sink
+//   - An edge from each left_ node to each right_ node, if the
+//     corresponding edge exists in 'graph'.
+//
+// When the TryAugment() method adds a flow, it sets left_[l] = r for some
+// nodes l and r. This induces the following changes:
+//   - The edges (source, l), (l, r), and (r, sink) are added to the
+//     flow graph.
+//   - The same three edges are removed from the residual flow graph.
+//   - The reverse edges (l, source), (r, l), and (sink, r) are added
+//     to the residual flow graph, which is a directional graph
+//     representing unused flow capacity.
+//
+// When the method augments a flow (moving left_[l] from some r1 to some
+// other r2), this can be thought of as "undoing" the above steps with
+// respect to r1 and "redoing" them with respect to r2.
+//
+// It bears repeating that the flow graph and residual flow graph are
+// never represented explicitly, but can be derived by looking at the
+// information in 'graph' and in left_.
+//
+// As an optimization, there is a second vector<int> called right_ which
+// does not provide any new information. Instead, it enables more
+// efficient queries about edges entering or leaving the right-side nodes
+// of the flow or residual flow graphs. The following invariants are
+// maintained:
+//
+// left[l] == kUnused or right[left[l]] == l
+// right[r] == kUnused or left[right[r]] == r
+//
+// . [ source ]                                        .
+// .   |||                                             .
+// .   |||                                             .
+// .   ||\--> left[0]=1  ---\    right[0]=-1 ----\     .
+// .   ||                   |                    |     .
+// .   |\---> left[1]=-1    \--> right[1]=0  ---\|     .
+// .   |                                        ||     .
+// .   \----> left[2]=2  ------> right[2]=2  --\||     .
+// .                                           |||     .
+// .         elements           matchers       vvv     .
+// .                                         [ sink ]  .
+//
+// See Also:
+//   [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
+//       "Introduction to Algorithms (Second ed.)", pp. 651-664.
+//   [2] "Ford-Fulkerson algorithm", Wikipedia,
+//       'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
+class MaxBipartiteMatchState {
+ public:
+  explicit MaxBipartiteMatchState(const MatchMatrix& graph)
+      : graph_(&graph),
+        left_(graph_->LhsSize(), kUnused),
+        right_(graph_->RhsSize(), kUnused) {
+  }
+
+  // Returns the edges of a maximal match, each in the form {left, right}.
+  ElementMatcherPairs Compute() {
+    // 'seen' is used for path finding { 0: unseen, 1: seen }.
+    ::std::vector<char> seen;
+    // Searches the residual flow graph for a path from each left node to
+    // the sink in the residual flow graph, and if one is found, add flow
+    // to the graph. It's okay to search through the left nodes once. The
+    // edge from the implicit source node to each previously-visited left
+    // node will have flow if that left node has any path to the sink
+    // whatsoever. Subsequent augmentations can only add flow to the
+    // network, and cannot take away that previous flow unit from the source.
+    // Since the source-to-left edge can only carry one flow unit (or,
+    // each element can be matched to only one matcher), there is no need
+    // to visit the left nodes more than once looking for augmented paths.
+    // The flow is known to be possible or impossible by looking at the
+    // node once.
+    for (size_t ilhs = 0; ilhs < graph_->LhsSize(); ++ilhs) {
+      // Reset the path-marking vector and try to find a path from
+      // source to sink starting at the left_[ilhs] node.
+      GTEST_CHECK_(left_[ilhs] == kUnused)
+          << "ilhs: " << ilhs << ", left_[ilhs]: " << left_[ilhs];
+      // 'seen' initialized to 'graph_->RhsSize()' copies of 0.
+      seen.assign(graph_->RhsSize(), 0);
+      TryAugment(ilhs, &seen);
+    }
+    ElementMatcherPairs result;
+    for (size_t ilhs = 0; ilhs < left_.size(); ++ilhs) {
+      size_t irhs = left_[ilhs];
+      if (irhs == kUnused) continue;
+      result.push_back(ElementMatcherPair(ilhs, irhs));
+    }
+    return result;
+  }
+
+ private:
+  static const size_t kUnused = static_cast<size_t>(-1);
+
+  // Perform a depth-first search from left node ilhs to the sink.  If a
+  // path is found, flow is added to the network by linking the left and
+  // right vector elements corresponding each segment of the path.
+  // Returns true if a path to sink was found, which means that a unit of
+  // flow was added to the network. The 'seen' vector elements correspond
+  // to right nodes and are marked to eliminate cycles from the search.
+  //
+  // Left nodes will only be explored at most once because they
+  // are accessible from at most one right node in the residual flow
+  // graph.
+  //
+  // Note that left_[ilhs] is the only element of left_ that TryAugment will
+  // potentially transition from kUnused to another value. Any other
+  // left_ element holding kUnused before TryAugment will be holding it
+  // when TryAugment returns.
+  //
+  bool TryAugment(size_t ilhs, ::std::vector<char>* seen) {
+    for (size_t irhs = 0; irhs < graph_->RhsSize(); ++irhs) {
+      if ((*seen)[irhs])
+        continue;
+      if (!graph_->HasEdge(ilhs, irhs))
+        continue;
+      // There's an available edge from ilhs to irhs.
+      (*seen)[irhs] = 1;
+      // Next a search is performed to determine whether
+      // this edge is a dead end or leads to the sink.
+      //
+      // right_[irhs] == kUnused means that there is residual flow from
+      // right node irhs to the sink, so we can use that to finish this
+      // flow path and return success.
+      //
+      // Otherwise there is residual flow to some ilhs. We push flow
+      // along that path and call ourselves recursively to see if this
+      // ultimately leads to sink.
+      if (right_[irhs] == kUnused || TryAugment(right_[irhs], seen)) {
+        // Add flow from left_[ilhs] to right_[irhs].
+        left_[ilhs] = irhs;
+        right_[irhs] = ilhs;
+        return true;
+      }
+    }
+    return false;
+  }
+
+  const MatchMatrix* graph_;  // not owned
+  // Each element of the left_ vector represents a left hand side node
+  // (i.e. an element) and each element of right_ is a right hand side
+  // node (i.e. a matcher). The values in the left_ vector indicate
+  // outflow from that node to a node on the the right_ side. The values
+  // in the right_ indicate inflow, and specify which left_ node is
+  // feeding that right_ node, if any. For example, left_[3] == 1 means
+  // there's a flow from element #3 to matcher #1. Such a flow would also
+  // be redundantly represented in the right_ vector as right_[1] == 3.
+  // Elements of left_ and right_ are either kUnused or mutually
+  // referent. Mutually referent means that left_[right_[i]] = i and
+  // right_[left_[i]] = i.
+  ::std::vector<size_t> left_;
+  ::std::vector<size_t> right_;
+
+  GTEST_DISALLOW_ASSIGN_(MaxBipartiteMatchState);
+};
+
+const size_t MaxBipartiteMatchState::kUnused;
+
+GTEST_API_ ElementMatcherPairs
+FindMaxBipartiteMatching(const MatchMatrix& g) {
+  return MaxBipartiteMatchState(g).Compute();
+}
+
+static void LogElementMatcherPairVec(const ElementMatcherPairs& pairs,
+                                     ::std::ostream* stream) {
+  typedef ElementMatcherPairs::const_iterator Iter;
+  ::std::ostream& os = *stream;
+  os << "{";
+  const char *sep = "";
+  for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
+    os << sep << "\n  ("
+       << "element #" << it->first << ", "
+       << "matcher #" << it->second << ")";
+    sep = ",";
+  }
+  os << "\n}";
+}
+
+// Tries to find a pairing, and explains the result.
+GTEST_API_ bool FindPairing(const MatchMatrix& matrix,
+                            MatchResultListener* listener) {
+  ElementMatcherPairs matches = FindMaxBipartiteMatching(matrix);
+
+  size_t max_flow = matches.size();
+  bool result = (max_flow == matrix.RhsSize());
+
+  if (!result) {
+    if (listener->IsInterested()) {
+      *listener << "where no permutation of the elements can "
+                   "satisfy all matchers, and the closest match is "
+                << max_flow << " of " << matrix.RhsSize()
+                << " matchers with the pairings:\n";
+      LogElementMatcherPairVec(matches, listener->stream());
+    }
+    return false;
+  }
+
+  if (matches.size() > 1) {
+    if (listener->IsInterested()) {
+      const char *sep = "where:\n";
+      for (size_t mi = 0; mi < matches.size(); ++mi) {
+        *listener << sep << " - element #" << matches[mi].first
+                  << " is matched by matcher #" << matches[mi].second;
+        sep = ",\n";
+      }
+    }
+  }
+  return true;
+}
+
+bool MatchMatrix::NextGraph() {
+  for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
+    for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
+      char& b = matched_[SpaceIndex(ilhs, irhs)];
+      if (!b) {
+        b = 1;
+        return true;
+      }
+      b = 0;
+    }
+  }
+  return false;
+}
+
+void MatchMatrix::Randomize() {
+  for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
+    for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
+      char& b = matched_[SpaceIndex(ilhs, irhs)];
+      b = static_cast<char>(rand() & 1);  // NOLINT
+    }
+  }
+}
+
+string MatchMatrix::DebugString() const {
+  ::std::stringstream ss;
+  const char *sep = "";
+  for (size_t i = 0; i < LhsSize(); ++i) {
+    ss << sep;
+    for (size_t j = 0; j < RhsSize(); ++j) {
+      ss << HasEdge(i, j);
+    }
+    sep = ";";
+  }
+  return ss.str();
+}
+
+void UnorderedElementsAreMatcherImplBase::DescribeToImpl(
+    ::std::ostream* os) const {
+  if (matcher_describers_.empty()) {
+    *os << "is empty";
+    return;
+  }
+  if (matcher_describers_.size() == 1) {
+    *os << "has " << Elements(1) << " and that element ";
+    matcher_describers_[0]->DescribeTo(os);
+    return;
+  }
+  *os << "has " << Elements(matcher_describers_.size())
+      << " and there exists some permutation of elements such that:\n";
+  const char* sep = "";
+  for (size_t i = 0; i != matcher_describers_.size(); ++i) {
+    *os << sep << " - element #" << i << " ";
+    matcher_describers_[i]->DescribeTo(os);
+    sep = ", and\n";
+  }
+}
+
+void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(
+    ::std::ostream* os) const {
+  if (matcher_describers_.empty()) {
+    *os << "isn't empty";
+    return;
+  }
+  if (matcher_describers_.size() == 1) {
+    *os << "doesn't have " << Elements(1)
+        << ", or has " << Elements(1) << " that ";
+    matcher_describers_[0]->DescribeNegationTo(os);
+    return;
+  }
+  *os << "doesn't have " << Elements(matcher_describers_.size())
+      << ", or there exists no permutation of elements such that:\n";
+  const char* sep = "";
+  for (size_t i = 0; i != matcher_describers_.size(); ++i) {
+    *os << sep << " - element #" << i << " ";
+    matcher_describers_[i]->DescribeTo(os);
+    sep = ", and\n";
+  }
+}
+
+// Checks that all matchers match at least one element, and that all
+// elements match at least one matcher. This enables faster matching
+// and better error reporting.
+// Returns false, writing an explanation to 'listener', if and only
+// if the success criteria are not met.
+bool UnorderedElementsAreMatcherImplBase::
+VerifyAllElementsAndMatchersAreMatched(
+    const ::std::vector<string>& element_printouts,
+    const MatchMatrix& matrix,
+    MatchResultListener* listener) const {
+  bool result = true;
+  ::std::vector<char> element_matched(matrix.LhsSize(), 0);
+  ::std::vector<char> matcher_matched(matrix.RhsSize(), 0);
+
+  for (size_t ilhs = 0; ilhs < matrix.LhsSize(); ilhs++) {
+    for (size_t irhs = 0; irhs < matrix.RhsSize(); irhs++) {
+      char matched = matrix.HasEdge(ilhs, irhs);
+      element_matched[ilhs] |= matched;
+      matcher_matched[irhs] |= matched;
+    }
+  }
+
+  {
+    const char* sep =
+        "where the following matchers don't match any elements:\n";
+    for (size_t mi = 0; mi < matcher_matched.size(); ++mi) {
+      if (matcher_matched[mi])
+        continue;
+      result = false;
+      if (listener->IsInterested()) {
+        *listener << sep << "matcher #" << mi << ": ";
+        matcher_describers_[mi]->DescribeTo(listener->stream());
+        sep = ",\n";
+      }
+    }
+  }
+
+  {
+    const char* sep =
+        "where the following elements don't match any matchers:\n";
+    const char* outer_sep = "";
+    if (!result) {
+      outer_sep = "\nand ";
+    }
+    for (size_t ei = 0; ei < element_matched.size(); ++ei) {
+      if (element_matched[ei])
+        continue;
+      result = false;
+      if (listener->IsInterested()) {
+        *listener << outer_sep << sep << "element #" << ei << ": "
+                  << element_printouts[ei];
+        sep = ",\n";
+        outer_sep = "";
+      }
+    }
+  }
+  return result;
+}
+
+}  // namespace internal
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/src/gmock-spec-builders.cc b/third_party/wpiutil_2018/gmock/src/gmock-spec-builders.cc
new file mode 100644
index 0000000..9551342
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock-spec-builders.cc
@@ -0,0 +1,823 @@
+// 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 the spec builder syntax (ON_CALL and
+// EXPECT_CALL).
+
+#include "gmock/gmock-spec-builders.h"
+
+#include <stdlib.h>
+#include <iostream>  // NOLINT
+#include <map>
+#include <set>
+#include <string>
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
+# include <unistd.h>  // NOLINT
+#endif
+
+namespace testing {
+namespace internal {
+
+// Protects the mock object registry (in class Mock), all function
+// mockers, and all expectations.
+GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex);
+
+// Logs a message including file and line number information.
+GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
+                                const char* file, int line,
+                                const string& message) {
+  ::std::ostringstream s;
+  s << file << ":" << line << ": " << message << ::std::endl;
+  Log(severity, s.str(), 0);
+}
+
+// Constructs an ExpectationBase object.
+ExpectationBase::ExpectationBase(const char* a_file,
+                                 int a_line,
+                                 const string& a_source_text)
+    : file_(a_file),
+      line_(a_line),
+      source_text_(a_source_text),
+      cardinality_specified_(false),
+      cardinality_(Exactly(1)),
+      call_count_(0),
+      retired_(false),
+      extra_matcher_specified_(false),
+      repeated_action_specified_(false),
+      retires_on_saturation_(false),
+      last_clause_(kNone),
+      action_count_checked_(false) {}
+
+// Destructs an ExpectationBase object.
+ExpectationBase::~ExpectationBase() {}
+
+// Explicitly specifies the cardinality of this expectation.  Used by
+// the subclasses to implement the .Times() clause.
+void ExpectationBase::SpecifyCardinality(const Cardinality& a_cardinality) {
+  cardinality_specified_ = true;
+  cardinality_ = a_cardinality;
+}
+
+// Retires all pre-requisites of this expectation.
+void ExpectationBase::RetireAllPreRequisites()
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  if (is_retired()) {
+    // We can take this short-cut as we never retire an expectation
+    // until we have retired all its pre-requisites.
+    return;
+  }
+
+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
+       it != immediate_prerequisites_.end(); ++it) {
+    ExpectationBase* const prerequisite = it->expectation_base().get();
+    if (!prerequisite->is_retired()) {
+      prerequisite->RetireAllPreRequisites();
+      prerequisite->Retire();
+    }
+  }
+}
+
+// Returns true iff all pre-requisites of this expectation have been
+// satisfied.
+bool ExpectationBase::AllPrerequisitesAreSatisfied() const
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
+       it != immediate_prerequisites_.end(); ++it) {
+    if (!(it->expectation_base()->IsSatisfied()) ||
+        !(it->expectation_base()->AllPrerequisitesAreSatisfied()))
+      return false;
+  }
+  return true;
+}
+
+// Adds unsatisfied pre-requisites of this expectation to 'result'.
+void ExpectationBase::FindUnsatisfiedPrerequisites(ExpectationSet* result) const
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+  for (ExpectationSet::const_iterator it = immediate_prerequisites_.begin();
+       it != immediate_prerequisites_.end(); ++it) {
+    if (it->expectation_base()->IsSatisfied()) {
+      // If *it is satisfied and has a call count of 0, some of its
+      // pre-requisites may not be satisfied yet.
+      if (it->expectation_base()->call_count_ == 0) {
+        it->expectation_base()->FindUnsatisfiedPrerequisites(result);
+      }
+    } else {
+      // Now that we know *it is unsatisfied, we are not so interested
+      // in whether its pre-requisites are satisfied.  Therefore we
+      // don't recursively call FindUnsatisfiedPrerequisites() here.
+      *result += *it;
+    }
+  }
+}
+
+// Describes how many times a function call matching this
+// expectation has occurred.
+void ExpectationBase::DescribeCallCountTo(::std::ostream* os) const
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+
+  // Describes how many times the function is expected to be called.
+  *os << "         Expected: to be ";
+  cardinality().DescribeTo(os);
+  *os << "\n           Actual: ";
+  Cardinality::DescribeActualCallCountTo(call_count(), os);
+
+  // Describes the state of the expectation (e.g. is it satisfied?
+  // is it active?).
+  *os << " - " << (IsOverSaturated() ? "over-saturated" :
+                   IsSaturated() ? "saturated" :
+                   IsSatisfied() ? "satisfied" : "unsatisfied")
+      << " and "
+      << (is_retired() ? "retired" : "active");
+}
+
+// Checks the action count (i.e. the number of WillOnce() and
+// WillRepeatedly() clauses) against the cardinality if this hasn't
+// been done before.  Prints a warning if there are too many or too
+// few actions.
+void ExpectationBase::CheckActionCountIfNotDone() const
+    GTEST_LOCK_EXCLUDED_(mutex_) {
+  bool should_check = false;
+  {
+    MutexLock l(&mutex_);
+    if (!action_count_checked_) {
+      action_count_checked_ = true;
+      should_check = true;
+    }
+  }
+
+  if (should_check) {
+    if (!cardinality_specified_) {
+      // The cardinality was inferred - no need to check the action
+      // count against it.
+      return;
+    }
+
+    // The cardinality was explicitly specified.
+    const int action_count = static_cast<int>(untyped_actions_.size());
+    const int upper_bound = cardinality().ConservativeUpperBound();
+    const int lower_bound = cardinality().ConservativeLowerBound();
+    bool too_many;  // True if there are too many actions, or false
+    // if there are too few.
+    if (action_count > upper_bound ||
+        (action_count == upper_bound && repeated_action_specified_)) {
+      too_many = true;
+    } else if (0 < action_count && action_count < lower_bound &&
+               !repeated_action_specified_) {
+      too_many = false;
+    } else {
+      return;
+    }
+
+    ::std::stringstream ss;
+    DescribeLocationTo(&ss);
+    ss << "Too " << (too_many ? "many" : "few")
+       << " actions specified in " << source_text() << "...\n"
+       << "Expected to be ";
+    cardinality().DescribeTo(&ss);
+    ss << ", but has " << (too_many ? "" : "only ")
+       << action_count << " WillOnce()"
+       << (action_count == 1 ? "" : "s");
+    if (repeated_action_specified_) {
+      ss << " and a WillRepeatedly()";
+    }
+    ss << ".";
+    Log(kWarning, ss.str(), -1);  // -1 means "don't print stack trace".
+  }
+}
+
+// Implements the .Times() clause.
+void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
+  if (last_clause_ == kTimes) {
+    ExpectSpecProperty(false,
+                       ".Times() cannot appear "
+                       "more than once in an EXPECT_CALL().");
+  } else {
+    ExpectSpecProperty(last_clause_ < kTimes,
+                       ".Times() cannot appear after "
+                       ".InSequence(), .WillOnce(), .WillRepeatedly(), "
+                       "or .RetiresOnSaturation().");
+  }
+  last_clause_ = kTimes;
+
+  SpecifyCardinality(a_cardinality);
+}
+
+// Points to the implicit sequence introduced by a living InSequence
+// object (if any) in the current thread or NULL.
+GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
+
+// Reports an uninteresting call (whose description is in msg) in the
+// manner specified by 'reaction'.
+void ReportUninterestingCall(CallReaction reaction, const string& msg) {
+  // Include a stack trace only if --gmock_verbose=info is specified.
+  const int stack_frames_to_skip =
+      GMOCK_FLAG(verbose) == kInfoVerbosity ? 3 : -1;
+  switch (reaction) {
+    case kAllow:
+      Log(kInfo, msg, stack_frames_to_skip);
+      break;
+    case kWarn:
+      Log(kWarning,
+          msg +
+          "\nNOTE: You can safely ignore the above warning unless this "
+          "call should not happen.  Do not suppress it by blindly adding "
+          "an EXPECT_CALL() if you don't mean to enforce the call.  "
+          "See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#"
+          "knowing-when-to-expect for details.\n",
+          stack_frames_to_skip);
+      break;
+    default:  // FAIL
+      Expect(false, NULL, -1, msg);
+  }
+}
+
+UntypedFunctionMockerBase::UntypedFunctionMockerBase()
+    : mock_obj_(NULL), name_("") {}
+
+UntypedFunctionMockerBase::~UntypedFunctionMockerBase() {}
+
+// Sets the mock object this mock method belongs to, and registers
+// this information in the global mock registry.  Will be called
+// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
+// method.
+void UntypedFunctionMockerBase::RegisterOwner(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  {
+    MutexLock l(&g_gmock_mutex);
+    mock_obj_ = mock_obj;
+  }
+  Mock::Register(mock_obj, this);
+}
+
+// Sets the mock object this mock method belongs to, and sets the name
+// of the mock function.  Will be called upon each invocation of this
+// mock function.
+void UntypedFunctionMockerBase::SetOwnerAndName(const void* mock_obj,
+                                                const char* name)
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  // We protect name_ under g_gmock_mutex in case this mock function
+  // is called from two threads concurrently.
+  MutexLock l(&g_gmock_mutex);
+  mock_obj_ = mock_obj;
+  name_ = name;
+}
+
+// Returns the name of the function being mocked.  Must be called
+// after RegisterOwner() or SetOwnerAndName() has been called.
+const void* UntypedFunctionMockerBase::MockObject() const
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  const void* mock_obj;
+  {
+    // We protect mock_obj_ under g_gmock_mutex in case this mock
+    // function is called from two threads concurrently.
+    MutexLock l(&g_gmock_mutex);
+    Assert(mock_obj_ != NULL, __FILE__, __LINE__,
+           "MockObject() must not be called before RegisterOwner() or "
+           "SetOwnerAndName() has been called.");
+    mock_obj = mock_obj_;
+  }
+  return mock_obj;
+}
+
+// Returns the name of this mock method.  Must be called after
+// SetOwnerAndName() has been called.
+const char* UntypedFunctionMockerBase::Name() const
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  const char* name;
+  {
+    // We protect name_ under g_gmock_mutex in case this mock
+    // function is called from two threads concurrently.
+    MutexLock l(&g_gmock_mutex);
+    Assert(name_ != NULL, __FILE__, __LINE__,
+           "Name() must not be called before SetOwnerAndName() has "
+           "been called.");
+    name = name_;
+  }
+  return name;
+}
+
+// Calculates the result of invoking this mock function with the given
+// arguments, prints it, and returns it.  The caller is responsible
+// for deleting the result.
+UntypedActionResultHolderBase*
+UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
+    GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
+  if (untyped_expectations_.size() == 0) {
+    // No expectation is set on this mock method - we have an
+    // uninteresting call.
+
+    // We must get Google Mock's reaction on uninteresting calls
+    // made on this mock object BEFORE performing the action,
+    // because the action may DELETE the mock object and make the
+    // following expression meaningless.
+    const CallReaction reaction =
+        Mock::GetReactionOnUninterestingCalls(MockObject());
+
+    // True iff we need to print this call's arguments and return
+    // value.  This definition must be kept in sync with
+    // the behavior of ReportUninterestingCall().
+    const bool need_to_report_uninteresting_call =
+        // If the user allows this uninteresting call, we print it
+        // only when he wants informational messages.
+        reaction == kAllow ? LogIsVisible(kInfo) :
+        // If the user wants this to be a warning, we print it only
+        // when he wants to see warnings.
+        reaction == kWarn ? LogIsVisible(kWarning) :
+        // Otherwise, the user wants this to be an error, and we
+        // should always print detailed information in the error.
+        true;
+
+    if (!need_to_report_uninteresting_call) {
+      // Perform the action without printing the call information.
+      return this->UntypedPerformDefaultAction(untyped_args, "");
+    }
+
+    // Warns about the uninteresting call.
+    ::std::stringstream ss;
+    this->UntypedDescribeUninterestingCall(untyped_args, &ss);
+
+    // Calculates the function result.
+    UntypedActionResultHolderBase* const result =
+        this->UntypedPerformDefaultAction(untyped_args, ss.str());
+
+    // Prints the function result.
+    if (result != NULL)
+      result->PrintAsActionResult(&ss);
+
+    ReportUninterestingCall(reaction, ss.str());
+    return result;
+  }
+
+  bool is_excessive = false;
+  ::std::stringstream ss;
+  ::std::stringstream why;
+  ::std::stringstream loc;
+  const void* untyped_action = NULL;
+
+  // The UntypedFindMatchingExpectation() function acquires and
+  // releases g_gmock_mutex.
+  const ExpectationBase* const untyped_expectation =
+      this->UntypedFindMatchingExpectation(
+          untyped_args, &untyped_action, &is_excessive,
+          &ss, &why);
+  const bool found = untyped_expectation != NULL;
+
+  // True iff we need to print the call's arguments and return value.
+  // This definition must be kept in sync with the uses of Expect()
+  // and Log() in this function.
+  const bool need_to_report_call =
+      !found || is_excessive || LogIsVisible(kInfo);
+  if (!need_to_report_call) {
+    // Perform the action without printing the call information.
+    return
+        untyped_action == NULL ?
+        this->UntypedPerformDefaultAction(untyped_args, "") :
+        this->UntypedPerformAction(untyped_action, untyped_args);
+  }
+
+  ss << "    Function call: " << Name();
+  this->UntypedPrintArgs(untyped_args, &ss);
+
+  // In case the action deletes a piece of the expectation, we
+  // generate the message beforehand.
+  if (found && !is_excessive) {
+    untyped_expectation->DescribeLocationTo(&loc);
+  }
+
+  UntypedActionResultHolderBase* const result =
+      untyped_action == NULL ?
+      this->UntypedPerformDefaultAction(untyped_args, ss.str()) :
+      this->UntypedPerformAction(untyped_action, untyped_args);
+  if (result != NULL)
+    result->PrintAsActionResult(&ss);
+  ss << "\n" << why.str();
+
+  if (!found) {
+    // No expectation matches this call - reports a failure.
+    Expect(false, NULL, -1, ss.str());
+  } else if (is_excessive) {
+    // We had an upper-bound violation and the failure message is in ss.
+    Expect(false, untyped_expectation->file(),
+           untyped_expectation->line(), ss.str());
+  } else {
+    // We had an expected call and the matching expectation is
+    // described in ss.
+    Log(kInfo, loc.str() + ss.str(), 2);
+  }
+
+  return result;
+}
+
+// Returns an Expectation object that references and co-owns exp,
+// which must be an expectation on this mock function.
+Expectation UntypedFunctionMockerBase::GetHandleOf(ExpectationBase* exp) {
+  for (UntypedExpectations::const_iterator it =
+           untyped_expectations_.begin();
+       it != untyped_expectations_.end(); ++it) {
+    if (it->get() == exp) {
+      return Expectation(*it);
+    }
+  }
+
+  Assert(false, __FILE__, __LINE__, "Cannot find expectation.");
+  return Expectation();
+  // The above statement is just to make the code compile, and will
+  // never be executed.
+}
+
+// Verifies that all expectations on this mock function have been
+// satisfied.  Reports one or more Google Test non-fatal failures
+// and returns false if not.
+bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
+  g_gmock_mutex.AssertHeld();
+  bool expectations_met = true;
+  for (UntypedExpectations::const_iterator it =
+           untyped_expectations_.begin();
+       it != untyped_expectations_.end(); ++it) {
+    ExpectationBase* const untyped_expectation = it->get();
+    if (untyped_expectation->IsOverSaturated()) {
+      // There was an upper-bound violation.  Since the error was
+      // already reported when it occurred, there is no need to do
+      // anything here.
+      expectations_met = false;
+    } else if (!untyped_expectation->IsSatisfied()) {
+      expectations_met = false;
+      ::std::stringstream ss;
+      ss  << "Actual function call count doesn't match "
+          << untyped_expectation->source_text() << "...\n";
+      // No need to show the source file location of the expectation
+      // in the description, as the Expect() call that follows already
+      // takes care of it.
+      untyped_expectation->MaybeDescribeExtraMatcherTo(&ss);
+      untyped_expectation->DescribeCallCountTo(&ss);
+      Expect(false, untyped_expectation->file(),
+             untyped_expectation->line(), ss.str());
+    }
+  }
+
+  // Deleting our expectations may trigger other mock objects to be deleted, for
+  // example if an action contains a reference counted smart pointer to that
+  // mock object, and that is the last reference. So if we delete our
+  // expectations within the context of the global mutex we may deadlock when
+  // this method is called again. Instead, make a copy of the set of
+  // expectations to delete, clear our set within the mutex, and then clear the
+  // copied set outside of it.
+  UntypedExpectations expectations_to_delete;
+  untyped_expectations_.swap(expectations_to_delete);
+
+  g_gmock_mutex.Unlock();
+  expectations_to_delete.clear();
+  g_gmock_mutex.Lock();
+
+  return expectations_met;
+}
+
+}  // namespace internal
+
+// Class Mock.
+
+namespace {
+
+typedef std::set<internal::UntypedFunctionMockerBase*> FunctionMockers;
+
+// The current state of a mock object.  Such information is needed for
+// detecting leaked mock objects and explicitly verifying a mock's
+// expectations.
+struct MockObjectState {
+  MockObjectState()
+      : first_used_file(NULL), first_used_line(-1), leakable(false) {}
+
+  // Where in the source file an ON_CALL or EXPECT_CALL is first
+  // invoked on this mock object.
+  const char* first_used_file;
+  int first_used_line;
+  ::std::string first_used_test_case;
+  ::std::string first_used_test;
+  bool leakable;  // true iff it's OK to leak the object.
+  FunctionMockers function_mockers;  // All registered methods of the object.
+};
+
+// A global registry holding the state of all mock objects that are
+// alive.  A mock object is added to this registry the first time
+// Mock::AllowLeak(), ON_CALL(), or EXPECT_CALL() is called on it.  It
+// is removed from the registry in the mock object's destructor.
+class MockObjectRegistry {
+ public:
+  // Maps a mock object (identified by its address) to its state.
+  typedef std::map<const void*, MockObjectState> StateMap;
+
+  // This destructor will be called when a program exits, after all
+  // tests in it have been run.  By then, there should be no mock
+  // object alive.  Therefore we report any living object as test
+  // failure, unless the user explicitly asked us to ignore it.
+  ~MockObjectRegistry() {
+    // "using ::std::cout;" doesn't work with Symbian's STLport, where cout is
+    // a macro.
+
+    if (!GMOCK_FLAG(catch_leaked_mocks))
+      return;
+
+    int leaked_count = 0;
+    for (StateMap::const_iterator it = states_.begin(); it != states_.end();
+         ++it) {
+      if (it->second.leakable)  // The user said it's fine to leak this object.
+        continue;
+
+      // TODO(wan@google.com): Print the type of the leaked object.
+      // This can help the user identify the leaked object.
+      std::cout << "\n";
+      const MockObjectState& state = it->second;
+      std::cout << internal::FormatFileLocation(state.first_used_file,
+                                                state.first_used_line);
+      std::cout << " ERROR: this mock object";
+      if (state.first_used_test != "") {
+        std::cout << " (used in test " << state.first_used_test_case << "."
+             << state.first_used_test << ")";
+      }
+      std::cout << " should be deleted but never is. Its address is @"
+           << it->first << ".";
+      leaked_count++;
+    }
+    if (leaked_count > 0) {
+      std::cout << "\nERROR: " << leaked_count
+           << " leaked mock " << (leaked_count == 1 ? "object" : "objects")
+           << " found at program exit.\n";
+      std::cout.flush();
+      ::std::cerr.flush();
+      // RUN_ALL_TESTS() has already returned when this destructor is
+      // called.  Therefore we cannot use the normal Google Test
+      // failure reporting mechanism.
+      _exit(1);  // We cannot call exit() as it is not reentrant and
+                 // may already have been called.
+    }
+  }
+
+  StateMap& states() { return states_; }
+
+ private:
+  StateMap states_;
+};
+
+// Protected by g_gmock_mutex.
+MockObjectRegistry g_mock_object_registry;
+
+// Maps a mock object to the reaction Google Mock should have when an
+// uninteresting method is called.  Protected by g_gmock_mutex.
+std::map<const void*, internal::CallReaction> g_uninteresting_call_reaction;
+
+// Sets the reaction Google Mock should have when an uninteresting
+// method of the given mock object is called.
+void SetReactionOnUninterestingCalls(const void* mock_obj,
+                                     internal::CallReaction reaction)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_uninteresting_call_reaction[mock_obj] = reaction;
+}
+
+}  // namespace
+
+// Tells Google Mock to allow uninteresting calls on the given mock
+// object.
+void Mock::AllowUninterestingCalls(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  SetReactionOnUninterestingCalls(mock_obj, internal::kAllow);
+}
+
+// Tells Google Mock to warn the user about uninteresting calls on the
+// given mock object.
+void Mock::WarnUninterestingCalls(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  SetReactionOnUninterestingCalls(mock_obj, internal::kWarn);
+}
+
+// Tells Google Mock to fail uninteresting calls on the given mock
+// object.
+void Mock::FailUninterestingCalls(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  SetReactionOnUninterestingCalls(mock_obj, internal::kFail);
+}
+
+// Tells Google Mock the given mock object is being destroyed and its
+// entry in the call-reaction table should be removed.
+void Mock::UnregisterCallReaction(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_uninteresting_call_reaction.erase(mock_obj);
+}
+
+// Returns the reaction Google Mock will have on uninteresting calls
+// made on the given mock object.
+internal::CallReaction Mock::GetReactionOnUninterestingCalls(
+    const void* mock_obj)
+        GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  return (g_uninteresting_call_reaction.count(mock_obj) == 0) ?
+      internal::kDefault : g_uninteresting_call_reaction[mock_obj];
+}
+
+// Tells Google Mock to ignore mock_obj when checking for leaked mock
+// objects.
+void Mock::AllowLeak(const void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_mock_object_registry.states()[mock_obj].leakable = true;
+}
+
+// Verifies and clears all expectations on the given mock object.  If
+// the expectations aren't satisfied, generates one or more Google
+// Test non-fatal failures and returns false.
+bool Mock::VerifyAndClearExpectations(void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  return VerifyAndClearExpectationsLocked(mock_obj);
+}
+
+// Verifies all expectations on the given mock object and clears its
+// default actions and expectations.  Returns true iff the
+// verification was successful.
+bool Mock::VerifyAndClear(void* mock_obj)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  ClearDefaultActionsLocked(mock_obj);
+  return VerifyAndClearExpectationsLocked(mock_obj);
+}
+
+// Verifies and clears all expectations on the given mock object.  If
+// the expectations aren't satisfied, generates one or more Google
+// Test non-fatal failures and returns false.
+bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
+  internal::g_gmock_mutex.AssertHeld();
+  if (g_mock_object_registry.states().count(mock_obj) == 0) {
+    // No EXPECT_CALL() was set on the given mock object.
+    return true;
+  }
+
+  // Verifies and clears the expectations on each mock method in the
+  // given mock object.
+  bool expectations_met = true;
+  FunctionMockers& mockers =
+      g_mock_object_registry.states()[mock_obj].function_mockers;
+  for (FunctionMockers::const_iterator it = mockers.begin();
+       it != mockers.end(); ++it) {
+    if (!(*it)->VerifyAndClearExpectationsLocked()) {
+      expectations_met = false;
+    }
+  }
+
+  // We don't clear the content of mockers, as they may still be
+  // needed by ClearDefaultActionsLocked().
+  return expectations_met;
+}
+
+// Registers a mock object and a mock method it owns.
+void Mock::Register(const void* mock_obj,
+                    internal::UntypedFunctionMockerBase* mocker)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  g_mock_object_registry.states()[mock_obj].function_mockers.insert(mocker);
+}
+
+// Tells Google Mock where in the source code mock_obj is used in an
+// ON_CALL or EXPECT_CALL.  In case mock_obj is leaked, this
+// information helps the user identify which object it is.
+void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
+                                           const char* file, int line)
+    GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
+  internal::MutexLock l(&internal::g_gmock_mutex);
+  MockObjectState& state = g_mock_object_registry.states()[mock_obj];
+  if (state.first_used_file == NULL) {
+    state.first_used_file = file;
+    state.first_used_line = line;
+    const TestInfo* const test_info =
+        UnitTest::GetInstance()->current_test_info();
+    if (test_info != NULL) {
+      // TODO(wan@google.com): record the test case name when the
+      // ON_CALL or EXPECT_CALL is invoked from SetUpTestCase() or
+      // TearDownTestCase().
+      state.first_used_test_case = test_info->test_case_name();
+      state.first_used_test = test_info->name();
+    }
+  }
+}
+
+// Unregisters a mock method; removes the owning mock object from the
+// registry when the last mock method associated with it has been
+// unregistered.  This is called only in the destructor of
+// FunctionMockerBase.
+void Mock::UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
+  internal::g_gmock_mutex.AssertHeld();
+  for (MockObjectRegistry::StateMap::iterator it =
+           g_mock_object_registry.states().begin();
+       it != g_mock_object_registry.states().end(); ++it) {
+    FunctionMockers& mockers = it->second.function_mockers;
+    if (mockers.erase(mocker) > 0) {
+      // mocker was in mockers and has been just removed.
+      if (mockers.empty()) {
+        g_mock_object_registry.states().erase(it);
+      }
+      return;
+    }
+  }
+}
+
+// Clears all ON_CALL()s set on the given mock object.
+void Mock::ClearDefaultActionsLocked(void* mock_obj)
+    GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
+  internal::g_gmock_mutex.AssertHeld();
+
+  if (g_mock_object_registry.states().count(mock_obj) == 0) {
+    // No ON_CALL() was set on the given mock object.
+    return;
+  }
+
+  // Clears the default actions for each mock method in the given mock
+  // object.
+  FunctionMockers& mockers =
+      g_mock_object_registry.states()[mock_obj].function_mockers;
+  for (FunctionMockers::const_iterator it = mockers.begin();
+       it != mockers.end(); ++it) {
+    (*it)->ClearDefaultActionsLocked();
+  }
+
+  // We don't clear the content of mockers, as they may still be
+  // needed by VerifyAndClearExpectationsLocked().
+}
+
+Expectation::Expectation() {}
+
+Expectation::Expectation(
+    const internal::linked_ptr<internal::ExpectationBase>& an_expectation_base)
+    : expectation_base_(an_expectation_base) {}
+
+Expectation::~Expectation() {}
+
+// Adds an expectation to a sequence.
+void Sequence::AddExpectation(const Expectation& expectation) const {
+  if (*last_expectation_ != expectation) {
+    if (last_expectation_->expectation_base() != NULL) {
+      expectation.expectation_base()->immediate_prerequisites_
+          += *last_expectation_;
+    }
+    *last_expectation_ = expectation;
+  }
+}
+
+// Creates the implicit sequence if there isn't one.
+InSequence::InSequence() {
+  if (internal::g_gmock_implicit_sequence.get() == NULL) {
+    internal::g_gmock_implicit_sequence.set(new Sequence);
+    sequence_created_ = true;
+  } else {
+    sequence_created_ = false;
+  }
+}
+
+// Deletes the implicit sequence if it was created by the constructor
+// of this object.
+InSequence::~InSequence() {
+  if (sequence_created_) {
+    delete internal::g_gmock_implicit_sequence.get();
+    internal::g_gmock_implicit_sequence.set(NULL);
+  }
+}
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/src/gmock.cc b/third_party/wpiutil_2018/gmock/src/gmock.cc
new file mode 100644
index 0000000..eac3d84
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock.cc
@@ -0,0 +1,183 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include "gmock/gmock.h"
+#include "gmock/internal/gmock-port.h"
+
+namespace testing {
+
+// TODO(wan@google.com): support using environment variables to
+// control the flag values, like what Google Test does.
+
+GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
+                   "true iff Google Mock should report leaked mock objects "
+                   "as failures.");
+
+GMOCK_DEFINE_string_(verbose, internal::kWarningVerbosity,
+                     "Controls how verbose Google Mock's output is."
+                     "  Valid values:\n"
+                     "  info    - prints all messages.\n"
+                     "  warning - prints warnings and errors.\n"
+                     "  error   - prints errors only.");
+
+namespace internal {
+
+// Parses a string as a command line flag.  The string should have the
+// format "--gmock_flag=value".  When def_optional is true, the
+// "=value" part can be omitted.
+//
+// Returns the value of the flag, or NULL if the parsing failed.
+static const char* ParseGoogleMockFlagValue(const char* str,
+                                            const char* flag,
+                                            bool def_optional) {
+  // str and flag must not be NULL.
+  if (str == NULL || flag == NULL) return NULL;
+
+  // The flag must start with "--gmock_".
+  const std::string flag_str = std::string("--gmock_") + flag;
+  const size_t flag_len = flag_str.length();
+  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;
+
+  // Skips the flag name.
+  const char* flag_end = str + flag_len;
+
+  // When def_optional is true, it's OK to not have a "=value" part.
+  if (def_optional && (flag_end[0] == '\0')) {
+    return flag_end;
+  }
+
+  // If def_optional is true and there are more characters after the
+  // flag name, or if def_optional is false, there must be a '=' after
+  // the flag name.
+  if (flag_end[0] != '=') return NULL;
+
+  // Returns the string after "=".
+  return flag_end + 1;
+}
+
+// Parses a string for a Google Mock bool flag, in the form of
+// "--gmock_flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
+                                    bool* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseGoogleMockFlagValue(str, flag, true);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Converts the string value to a bool.
+  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
+  return true;
+}
+
+// Parses a string for a Google Mock string flag, in the form of
+// "--gmock_flag=value".
+//
+// On success, stores the value of the flag in *value, and returns
+// true.  On failure, returns false without changing *value.
+template <typename String>
+static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
+                                      String* value) {
+  // Gets the value of the flag as a string.
+  const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
+
+  // Aborts if the parsing failed.
+  if (value_str == NULL) return false;
+
+  // Sets *value to the value of the flag.
+  *value = value_str;
+  return true;
+}
+
+// The internal implementation of InitGoogleMock().
+//
+// The type parameter CharType can be instantiated to either char or
+// wchar_t.
+template <typename CharType>
+void InitGoogleMockImpl(int* argc, CharType** argv) {
+  // Makes sure Google Test is initialized.  InitGoogleTest() is
+  // idempotent, so it's fine if the user has already called it.
+  InitGoogleTest(argc, argv);
+  if (*argc <= 0) return;
+
+  for (int i = 1; i != *argc; i++) {
+    const std::string arg_string = StreamableToString(argv[i]);
+    const char* const arg = arg_string.c_str();
+
+    // Do we see a Google Mock flag?
+    if (ParseGoogleMockBoolFlag(arg, "catch_leaked_mocks",
+                                &GMOCK_FLAG(catch_leaked_mocks)) ||
+        ParseGoogleMockStringFlag(arg, "verbose", &GMOCK_FLAG(verbose))) {
+      // Yes.  Shift the remainder of the argv list left by one.  Note
+      // that argv has (*argc + 1) elements, the last one always being
+      // NULL.  The following loop moves the trailing NULL element as
+      // well.
+      for (int j = i; j != *argc; j++) {
+        argv[j] = argv[j + 1];
+      }
+
+      // Decrements the argument count.
+      (*argc)--;
+
+      // We also need to decrement the iterator as we just removed
+      // an element.
+      i--;
+    }
+  }
+}
+
+}  // namespace internal
+
+// Initializes Google Mock.  This must be called before running the
+// tests.  In particular, it parses a command line for the flags that
+// Google Mock recognizes.  Whenever a Google Mock flag is seen, it is
+// removed from argv, and *argc is decremented.
+//
+// No value is returned.  Instead, the Google Mock flag variables are
+// updated.
+//
+// Since Google Test is needed for Google Mock to work, this function
+// also initializes Google Test and parses its flags, if that hasn't
+// been done.
+GTEST_API_ void InitGoogleMock(int* argc, char** argv) {
+  internal::InitGoogleMockImpl(argc, argv);
+}
+
+// This overloaded version can be used in Windows programs compiled in
+// UNICODE mode.
+GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv) {
+  internal::InitGoogleMockImpl(argc, argv);
+}
+
+}  // namespace testing
diff --git a/third_party/wpiutil_2018/gmock/src/gmock_main.cc b/third_party/wpiutil_2018/gmock/src/gmock_main.cc
new file mode 100644
index 0000000..bd5be03
--- /dev/null
+++ b/third_party/wpiutil_2018/gmock/src/gmock_main.cc
@@ -0,0 +1,54 @@
+// 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: wan@google.com (Zhanyong Wan)
+
+#include <iostream>
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
+// causes a link error when _tmain is defined in a static library and UNICODE
+// is enabled. For this reason instead of _tmain, main function is used on
+// Windows. See the following link to track the current status of this bug:
+// http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=394464  // NOLINT
+#if GTEST_OS_WINDOWS_MOBILE
+# include <tchar.h>  // NOLINT
+
+GTEST_API_ int _tmain(int argc, TCHAR** argv) {
+#else
+GTEST_API_ int main(int argc, char** argv) {
+#endif  // GTEST_OS_WINDOWS_MOBILE
+  std::cout << "Running main() from gmock_main.cc\n";
+  // Since Google Mock depends on Google Test, InitGoogleMock() is
+  // also responsible for initializing Google Test.  Therefore there's
+  // no need for calling testing::InitGoogleTest() separately.
+  testing::InitGoogleMock(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/third_party/wpiutil_2018/gradle/wrapper/gradle-wrapper.jar b/third_party/wpiutil_2018/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..7a3265e
--- /dev/null
+++ b/third_party/wpiutil_2018/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/third_party/wpiutil_2018/gradle/wrapper/gradle-wrapper.properties b/third_party/wpiutil_2018/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..fe51c02
--- /dev/null
+++ b/third_party/wpiutil_2018/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME

+distributionPath=wrapper/dists

+zipStoreBase=GRADLE_USER_HOME

+zipStorePath=wrapper/dists

+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-bin.zip

diff --git a/third_party/wpiutil_2018/gradlew b/third_party/wpiutil_2018/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/third_party/wpiutil_2018/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/third_party/wpiutil_2018/gradlew.bat b/third_party/wpiutil_2018/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/third_party/wpiutil_2018/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off

+@rem ##########################################################################

+@rem

+@rem  Gradle startup script for Windows

+@rem

+@rem ##########################################################################

+

+@rem Set local scope for the variables with windows NT shell

+if "%OS%"=="Windows_NT" setlocal

+

+set DIRNAME=%~dp0

+if "%DIRNAME%" == "" set DIRNAME=.

+set APP_BASE_NAME=%~n0

+set APP_HOME=%DIRNAME%

+

+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.

+set DEFAULT_JVM_OPTS=

+

+@rem Find java.exe

+if defined JAVA_HOME goto findJavaFromJavaHome

+

+set JAVA_EXE=java.exe

+%JAVA_EXE% -version >NUL 2>&1

+if "%ERRORLEVEL%" == "0" goto init

+

+echo.

+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:findJavaFromJavaHome

+set JAVA_HOME=%JAVA_HOME:"=%

+set JAVA_EXE=%JAVA_HOME%/bin/java.exe

+

+if exist "%JAVA_EXE%" goto init

+

+echo.

+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%

+echo.

+echo Please set the JAVA_HOME variable in your environment to match the

+echo location of your Java installation.

+

+goto fail

+

+:init

+@rem Get command-line arguments, handling Windows variants

+

+if not "%OS%" == "Windows_NT" goto win9xME_args

+

+:win9xME_args

+@rem Slurp the command line arguments.

+set CMD_LINE_ARGS=

+set _SKIP=2

+

+:win9xME_args_slurp

+if "x%~1" == "x" goto execute

+

+set CMD_LINE_ARGS=%*

+

+:execute

+@rem Setup the command line

+

+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

+

+@rem Execute Gradle

+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

+

+:end

+@rem End local scope for the variables with windows NT shell

+if "%ERRORLEVEL%"=="0" goto mainEnd

+

+:fail

+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of

+rem the _cmd.exe /c_ return code!

+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1

+exit /b 1

+

+:mainEnd

+if "%OS%"=="Windows_NT" endlocal

+

+:omega

diff --git a/third_party/wpiutil_2018/license.txt b/third_party/wpiutil_2018/license.txt
new file mode 100644
index 0000000..3f3592e
--- /dev/null
+++ b/third_party/wpiutil_2018/license.txt
@@ -0,0 +1,96 @@
+Copyright (c) 2009-2017 FIRST
+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 the FIRST 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 FIRST AND CONTRIBUTORS``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST 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.
+
+
+==============================================================================
+LLVM Release License
+==============================================================================
+University of Illinois/NCSA
+Open Source License
+
+Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign.
+All rights reserved.
+
+Developed by:
+
+    LLVM Team
+
+    University of Illinois at Urbana-Champaign
+
+    http://llvm.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimers.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimers in the
+      documentation and/or other materials provided with the distribution.
+
+    * Neither the names of the LLVM Team, University of Illinois at
+      Urbana-Champaign, nor the names of its contributors may be used to
+      endorse or promote products derived from this Software without specific
+      prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/third_party/wpiutil_2018/publish.gradle b/third_party/wpiutil_2018/publish.gradle
new file mode 100644
index 0000000..6e58025
--- /dev/null
+++ b/third_party/wpiutil_2018/publish.gradle
@@ -0,0 +1,221 @@
+apply plugin: 'maven-publish'
+apply plugin: 'edu.wpi.first.wpilib.versioning.WPILibVersioningPlugin'
+
+def getVersion = {
+    if (WPILibVersion.version.contains('-'))
+        return WPILibVersion.version.substring(WPILibVersion.version.indexOf('-'))
+    else
+        return ""
+}
+
+if (!hasProperty('releaseType')) {
+    WPILibVersion {
+        releaseType = 'dev'
+    }
+}
+
+def pubVersion
+if (project.hasProperty("publishVersion")) {
+    pubVersion = project.publishVersion
+} else {
+    pubVersion = WPILibVersion.version
+}
+
+def outputsFolder = file("$buildDir/outputs")
+
+def versionFile = file("$outputsFolder/version.txt")
+
+task outputVersions() {
+    description = 'Prints the versions of wpiutil to a file for use by the downstream packaging project'
+    group = 'Build'
+    outputs.files(versionFile)
+
+    doFirst {
+        outputsFolder.mkdir()
+    }
+
+    doLast {
+        versionFile.write pubVersion
+    }
+}
+
+build.dependsOn outputVersions
+
+def baseArtifactId = 'wpiutil'
+def artifactGroupId = 'edu.wpi.first.wpiutil'
+
+def licenseFile = file("$rootDir/license.txt")
+
+task cppSourcesZip(type: Zip) {
+    destinationDir = outputsFolder
+    classifier = "sources"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/cpp') {
+        into '/'
+    }
+}
+
+task cppHeadersZip(type: Zip) {
+    destinationDir = outputsFolder
+    classifier = "headers"
+
+    from(licenseFile) {
+        into '/'
+    }
+
+    from('src/main/native/include') {
+        into '/'
+    }
+}
+
+task sourcesJar(type: Jar, dependsOn: classes) {
+    classifier = 'sources'
+    from sourceSets.main.allSource
+}
+
+task javadocJar(type: Jar, dependsOn: javadoc) {
+    classifier = 'javadoc'
+    from javadoc.destinationDir
+}
+
+if (project.hasProperty('jenkinsBuild')) {
+    jar {
+        classifier = 'javaArtifact'
+    }
+}
+
+artifacts {
+    archives sourcesJar
+    archives javadocJar
+    archives cppHeadersZip
+    archives cppSourcesZip
+    outputVersions.outputs.files.each {
+        archives it
+    }
+}
+
+def createComponentZipTasks = { components, name, base, type, project, func ->
+    def configMap = [:]
+    components.each {
+        if (it in NativeLibrarySpec && it.name == name) {
+            it.binaries.each {
+                def target = getClassifier(it)
+                if (configMap.containsKey(target)) {
+                    configMap.get(target).add(it)
+                } else {
+                    configMap.put(target, [])
+                    configMap.get(target).add(it)
+                }
+            }
+        }
+    }
+    def taskList = []
+    configMap.each { key, value ->
+        def baseN = base + name
+        def task = project.tasks.create(baseN + "-${key}", type) {
+            description = 'Creates component archive for platform ' + key
+            destinationDir =  outputsFolder
+            classifier = key
+            baseName = baseN + '-classifier'
+            duplicatesStrategy = 'exclude'
+
+            from(licenseFile) {
+                into '/'
+            }
+
+            func(it, value)
+        }
+        taskList.add(task)
+
+        project.build.dependsOn task
+
+        project.artifacts {
+            archives task
+        }
+    }
+    return taskList
+}
+
+model {
+    publishing {
+        def wpiutilTaskList = createComponentZipTasks($.components, 'wpiutil', 'zipcppwpiutil', Zip, project, { task, value ->
+            value.each { binary->
+                if (binary.buildable) {
+                    if (binary instanceof SharedLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from(new File(binary.sharedLibraryFile.absolutePath + ".debug")) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                        task.from (binary.sharedLibraryFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                        task.from (binary.sharedLibraryLinkFile) {
+                            into getPlatformPath(binary) + '/shared'
+                        }
+                    } else if (binary instanceof StaticLibraryBinarySpec) {
+                        task.dependsOn binary.buildTask
+                        task.from (binary.staticLibraryFile) {
+                            into getPlatformPath(binary) + '/static'
+                        }
+                    }
+                }
+            }
+        })
+
+        def allCppTask
+        if (!project.hasProperty('jenkinsBuild')) {
+            allCppTask = project.tasks.create("wpiutilAllZip", Zip) {
+                description = 'Creates a zip with all Cpp artifacts'
+                classifier = 'all'
+                baseName = 'zipcppwpiutilwpiutil'
+                destinationDir = outputsFolder
+                duplicatesStrategy = 'exclude'
+
+                wpiutilTaskList.each {
+                    it.outputs.files.each {
+                        from project.zipTree(it)
+                    }
+                    dependsOn it
+                }
+            }
+            project.build.dependsOn allCppTask
+        }
+
+        publications {
+            cpp(MavenPublication) {
+                wpiutilTaskList.each {
+                    artifact it
+                }
+                artifact cppHeadersZip
+                artifact cppSourcesZip
+
+                if (!project.hasProperty('jenkinsBuild')) {
+                    artifact allCppTask
+                }
+
+                artifactId = "${baseArtifactId}-cpp"
+                groupId artifactGroupId
+                version pubVersion
+            }
+        }
+    }
+}
+
+publishing {
+  publications {
+
+    java(MavenPublication) {
+        artifact jar
+        artifact sourcesJar
+        artifact javadocJar
+
+        artifactId = "${baseArtifactId}-java"
+        groupId artifactGroupId
+        version pubVersion
+    }
+  }
+}
diff --git a/third_party/wpiutil_2018/readme.md b/third_party/wpiutil_2018/readme.md
new file mode 100644
index 0000000..def70be
--- /dev/null
+++ b/third_party/wpiutil_2018/readme.md
@@ -0,0 +1,72 @@
+# wpiutil
+
+wpiutil is a utility library designed for making C++ interfacing easier.
+
+## Build Requirements
+To build wpiutil, a few requirements must be met:
+
+- Platform Native Toolchain - You must have a toolchain for your native platform installed if you wish to build wpiutil for your machine. On Windows, this is Visual Studio. On Mac, this is Clang, and on Linux, this is GCC. Your toolchain must support the `-std=c++11` language flag.
+- Platform Native JDK - In order to compile wpiutil your native platform, you must have the JDK for your platform installed, so that the correct JNI headers can be included.
+- ARM Toolchain - To crosscompile wpiutil for the roboRIO, you must have the FRC ARM toolchain installed, which can be found [here](http://first.wpi.edu/FRC/roborio/toolchains/).
+- Cross Toolchains (coming soon)
+
+## Building
+Gradle is the main build system used by wpiutil. All tasks are run with the `gradlew` wrapper, which is included in the root of the repository. All targets that can be accomplished by Gradle are referred to as tasks. The main task available is `build`. To run Gradle, cd into the build directory and run:
+
+```bash
+./gradlew build
+```
+
+This will build the roboRIO wpiutil library, in addition to the library for your native platform. Note if the roboRIO compiler cannot be found, the build will skip the roboRIO build. To build for either only the roboRIO, or every platform except the roboRIO, use the following flags:
+
+```bash
+-PskipAthena
+-PonlyAthena
+```
+
+Note if you choose the `onlyAthena` flag, tests will not be ran, as they depend on the current platform being built.
+
+In addition, more platforms can be built. For instance, with additional cross compilers more Arm binaries can be built. In addition, the second bitness for your current platform can be built with an additional flag. To enable every possible platform, use the following flag.
+
+```bash
+-PbuildAll
+```
+
+If you are building the native version on a 64 bit Linux computer, use a GCC installation which has multilib support enabled (it can compile both 32 and 64 bit programs). The package providing that support on most Linux distributions is called `gcc-multilib`.
+
+By default, debug binaries of the libraries will be built. To switch to instead build release binaries, use the following flag
+
+```bash
+-PreleaseBuild
+```
+
+### Custom Cross Compilers
+Coming soon
+
+### Testing
+By default, tests will be built for any native platform, and will be run during any execution of the `build` or `publish` tasks. To skip building and running the tests, use the `-PskipAllTests` command line flag.
+
+### Publishing
+to use wpiutil in downstream projects as a Maven-style dependency, use the `publish` command. This will publish the following artifact id's:
+
+- edu.wpi.first.wpiutil:wpiutil-cpp
+- edu.wpi.first.wpiutil:wpiutil-java
+
+The `wpiutil-cpp` artifact will contain the following 2 classifiers:
+
+- `headers` (contains C++ headers)
+- `sources` (contains C++ sources)
+
+In addition, a classifier will be created for each binary built by the current build. The internal layout of the artifacts will be as follows.
+
+- `/os/arch/shared/` (shared binaries located here)
+- `/os/arch/static/` (static binaries located here)
+
+The `wpiutil-java` artifact will contain a jar with no classifiers. This is the java jar file. In addition, the following 2 classifiers will be contained
+
+- `sources` (contains Java sources)
+- `javadoc` (contains Javadoc sources)
+
+All of these artifacts by default are published to `~/releases/maven/development`. To switch to the release repository (`~/release/maven/release`), use the flag `-PreleaseType=OFFICIAL`.
+
+All downstream projects are configured to use the individual classifier artifacts. The previouse `desktop` classifier does not exist anymore.
diff --git a/third_party/wpiutil_2018/settings.gradle b/third_party/wpiutil_2018/settings.gradle
new file mode 100644
index 0000000..5fbda89
--- /dev/null
+++ b/third_party/wpiutil_2018/settings.gradle
@@ -0,0 +1 @@
+include 'gmock'

diff --git a/third_party/wpiutil_2018/src/dev/java/edu/wpi/first/wpiutil/DevMain.java b/third_party/wpiutil_2018/src/dev/java/edu/wpi/first/wpiutil/DevMain.java
new file mode 100644
index 0000000..90c3670
--- /dev/null
+++ b/third_party/wpiutil_2018/src/dev/java/edu/wpi/first/wpiutil/DevMain.java
@@ -0,0 +1,15 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpiutil;
+
+public class DevMain {
+    public static void main(String[] args) {
+        System.out.println("Hello World!");
+        System.out.println(RuntimeDetector.getPlatformPath());
+    }
+}
diff --git a/third_party/wpiutil_2018/src/dev/native/cpp/main.cpp b/third_party/wpiutil_2018/src/dev/native/cpp/main.cpp
new file mode 100644
index 0000000..ba2318f
--- /dev/null
+++ b/third_party/wpiutil_2018/src/dev/native/cpp/main.cpp
@@ -0,0 +1,17 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+#include "support/hostname.h"
+
+int main() {
+  llvm::StringRef v1("Hello");
+  std::cout << v1.lower() << std::endl;
+}
diff --git a/third_party/wpiutil_2018/src/main/java/edu/wpi/first/wpiutil/RuntimeDetector.java b/third_party/wpiutil_2018/src/main/java/edu/wpi/first/wpiutil/RuntimeDetector.java
new file mode 100644
index 0000000..a024f28
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/java/edu/wpi/first/wpiutil/RuntimeDetector.java
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+package edu.wpi.first.wpiutil;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+
+public class RuntimeDetector {
+  private static String filePrefix;
+  private static String fileExtension;
+  private static String filePath;
+
+  private static synchronized void computePlatform() {
+    if (fileExtension != null && filePath != null && filePrefix != null) {
+      return;
+    }
+
+
+    boolean intel32 = is32BitIntel();
+    boolean intel64 = is64BitIntel();
+
+    if (isWindows()) {
+      filePrefix = "";
+      fileExtension = ".dll";
+      if (intel32) {
+        filePath = "/windows/x86/";
+      } else {
+        filePath = "/windows/x86-64/";
+      }
+    } else if (isMac()) {
+      filePrefix = "lib";
+      fileExtension = ".dylib";
+      if (intel32) {
+        filePath = "/osx/x86";
+      } else {
+        filePath = "/osx/x86-64/";
+      }
+    } else if (isLinux()) {
+      filePrefix = "lib";
+      fileExtension = ".so";
+      if (intel32) {
+        filePath = "/linux/x86/";
+      } else if (intel64) {
+        filePath = "/linux/x86-64/";
+      } else if (isAthena()) {
+        filePath = "/linux/athena/";
+      } else {
+        filePath = "/linux/nativearm/";
+      }
+    } else {
+      throw new RuntimeException("Failed to determine OS");
+    }
+  }
+
+  public static synchronized String getFilePrefix() {
+    computePlatform();
+
+    return filePrefix;
+  }
+
+  public static synchronized String getFileExtension() {
+    computePlatform();
+
+    return fileExtension;
+  }
+
+  public static synchronized String getPlatformPath() {
+    computePlatform();
+
+    return filePath;
+  }
+
+  public static synchronized String getLibraryResource(String libName) {
+    computePlatform();
+
+    return filePath + filePrefix + libName + fileExtension;
+  }
+
+  public static boolean isAthena() {
+    File runRobotFile = new File("/usr/local/frc/bin/frcRunRobot.sh");
+    return runRobotFile.exists();
+  }
+
+  public static boolean isLinux() {
+    return System.getProperty("os.name").startsWith("Linux");
+  }
+
+  public static boolean isWindows() {
+    return System.getProperty("os.name").startsWith("Windows");
+  }
+
+  public static boolean isMac() {
+    return System.getProperty("os.name").startsWith("Mac");
+  }
+
+  public static boolean is32BitIntel() {
+    String arch = System.getProperty("os.arch");
+    return arch.equals("x86") || arch.equals("i386");
+  }
+
+  public static boolean is64BitIntel() {
+    String arch = System.getProperty("os.arch");
+    return arch.equals("amd64") || arch.equals("x86_64");
+  }
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/ConvertUTF.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/ConvertUTF.cpp
new file mode 100644
index 0000000..73f66d1
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/ConvertUTF.cpp
@@ -0,0 +1,708 @@
+/*===--- ConvertUTF.c - Universal Character Names conversions ---------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ *===------------------------------------------------------------------------=*/
+/*
+ * Copyright 2001-2004 Unicode, Inc.
+ * 
+ * Disclaimer
+ * 
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ * 
+ * Limitations on Rights to Redistribute This Code
+ * 
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+/* ---------------------------------------------------------------------
+
+    Conversions between UTF32, UTF-16, and UTF-8. Source code file.
+    Author: Mark E. Davis, 1994.
+    Rev History: Rick McGowan, fixes & updates May 2001.
+    Sept 2001: fixed const & error conditions per
+        mods suggested by S. Parent & A. Lillich.
+    June 2002: Tim Dodd added detection and handling of incomplete
+        source sequences, enhanced error detection, added casts
+        to eliminate compiler warnings.
+    July 2003: slight mods to back out aggressive FFFE detection.
+    Jan 2004: updated switches in from-UTF8 conversions.
+    Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
+
+    See the header file "ConvertUTF.h" for complete documentation.
+
+------------------------------------------------------------------------ */
+
+
+#include "llvm/ConvertUTF.h"
+#ifdef CVTUTF_DEBUG
+#include <stdio.h>
+#endif
+#include <assert.h>
+
+static const int halfShift  = 10; /* used for shifting by 10 bits */
+
+static const UTF32 halfBase = 0x0010000UL;
+static const UTF32 halfMask = 0x3FFUL;
+
+#define UNI_SUR_HIGH_START  (UTF32)0xD800
+#define UNI_SUR_HIGH_END    (UTF32)0xDBFF
+#define UNI_SUR_LOW_START   (UTF32)0xDC00
+#define UNI_SUR_LOW_END     (UTF32)0xDFFF
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Index into the table below with the first byte of a UTF-8 sequence to
+ * get the number of trailing bytes that are supposed to follow it.
+ * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
+ * left as-is for anyone who may want to do such conversion, which was
+ * allowed in earlier algorithms.
+ */
+static const char trailingBytesForUTF8[256] = {
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
+};
+
+/*
+ * Magic values subtracted from a buffer value during UTF8 conversion.
+ * This table contains as many values as there might be trailing bytes
+ * in a UTF-8 sequence.
+ */
+static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 
+                     0x03C82080UL, 0xFA082080UL, 0x82082080UL };
+
+/*
+ * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
+ * into the first byte, depending on how many bytes follow.  There are
+ * as many entries in this table as there are UTF-8 sequence types.
+ * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
+ * for *legal* UTF-8 will be 4 or fewer bytes total.
+ */
+static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+
+/* --------------------------------------------------------------------- */
+
+/* The interface converts a whole buffer to avoid function-call overhead.
+ * Constants have been gathered. Loops & conditionals have been removed as
+ * much as possible for efficiency, in favor of drop-through switches.
+ * (See "Note A" at the bottom of the file for equivalent code.)
+ * If your compiler supports it, the "isLegalUTF8" call can be turned
+ * into an inline function.
+ */
+
+extern "C" {
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF32toUTF16 (
+        const UTF32** sourceStart, const UTF32* sourceEnd, 
+        UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+    ConversionResult result = conversionOK;
+    const UTF32* source = *sourceStart;
+    UTF16* target = *targetStart;
+    while (source < sourceEnd) {
+        UTF32 ch;
+        if (target >= targetEnd) {
+            result = targetExhausted; break;
+        }
+        ch = *source++;
+        if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
+            /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */
+            if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+                if (flags == strictConversion) {
+                    --source; /* return to the illegal value itself */
+                    result = sourceIllegal;
+                    break;
+                } else {
+                    *target++ = UNI_REPLACEMENT_CHAR;
+                }
+            } else {
+                *target++ = (UTF16)ch; /* normal case */
+            }
+        } else if (ch > UNI_MAX_LEGAL_UTF32) {
+            if (flags == strictConversion) {
+                result = sourceIllegal;
+            } else {
+                *target++ = UNI_REPLACEMENT_CHAR;
+            }
+        } else {
+            /* target is a character in range 0xFFFF - 0x10FFFF. */
+            if (target + 1 >= targetEnd) {
+                --source; /* Back up source pointer! */
+                result = targetExhausted; break;
+            }
+            ch -= halfBase;
+            *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
+            *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
+        }
+    }
+    *sourceStart = source;
+    *targetStart = target;
+    return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF16toUTF32 (
+        const UTF16** sourceStart, const UTF16* sourceEnd, 
+        UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
+    ConversionResult result = conversionOK;
+    const UTF16* source = *sourceStart;
+    UTF32* target = *targetStart;
+    UTF32 ch, ch2;
+    while (source < sourceEnd) {
+        const UTF16* oldSource = source; /*  In case we have to back up because of target overflow. */
+        ch = *source++;
+        /* If we have a surrogate pair, convert to UTF32 first. */
+        if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
+            /* If the 16 bits following the high surrogate are in the source buffer... */
+            if (source < sourceEnd) {
+                ch2 = *source;
+                /* If it's a low surrogate, convert to UTF32. */
+                if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
+                    ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+                        + (ch2 - UNI_SUR_LOW_START) + halfBase;
+                    ++source;
+                } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
+                    --source; /* return to the illegal value itself */
+                    result = sourceIllegal;
+                    break;
+                }
+            } else { /* We don't have the 16 bits following the high surrogate. */
+                --source; /* return to the high surrogate */
+                result = sourceExhausted;
+                break;
+            }
+        } else if (flags == strictConversion) {
+            /* UTF-16 surrogate values are illegal in UTF-32 */
+            if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
+                --source; /* return to the illegal value itself */
+                result = sourceIllegal;
+                break;
+            }
+        }
+        if (target >= targetEnd) {
+            source = oldSource; /* Back up source pointer! */
+            result = targetExhausted; break;
+        }
+        *target++ = ch;
+    }
+    *sourceStart = source;
+    *targetStart = target;
+#ifdef CVTUTF_DEBUG
+if (result == sourceIllegal) {
+    fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2);
+    fflush(stderr);
+}
+#endif
+    return result;
+}
+ConversionResult ConvertUTF16toUTF8 (
+        const UTF16** sourceStart, const UTF16* sourceEnd, 
+        UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+    ConversionResult result = conversionOK;
+    const UTF16* source = *sourceStart;
+    UTF8* target = *targetStart;
+    while (source < sourceEnd) {
+        UTF32 ch;
+        unsigned short bytesToWrite = 0;
+        const UTF32 byteMask = 0xBF;
+        const UTF32 byteMark = 0x80; 
+        const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
+        ch = *source++;
+        /* If we have a surrogate pair, convert to UTF32 first. */
+        if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
+            /* If the 16 bits following the high surrogate are in the source buffer... */
+            if (source < sourceEnd) {
+                UTF32 ch2 = *source;
+                /* If it's a low surrogate, convert to UTF32. */
+                if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
+                    ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
+                        + (ch2 - UNI_SUR_LOW_START) + halfBase;
+                    ++source;
+                } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
+                    --source; /* return to the illegal value itself */
+                    result = sourceIllegal;
+                    break;
+                }
+            } else { /* We don't have the 16 bits following the high surrogate. */
+                --source; /* return to the high surrogate */
+                result = sourceExhausted;
+                break;
+            }
+        } else if (flags == strictConversion) {
+            /* UTF-16 surrogate values are illegal in UTF-32 */
+            if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
+                --source; /* return to the illegal value itself */
+                result = sourceIllegal;
+                break;
+            }
+        }
+        /* Figure out how many bytes the result will require */
+        if (ch < (UTF32)0x80) {      bytesToWrite = 1;
+        } else if (ch < (UTF32)0x800) {     bytesToWrite = 2;
+        } else if (ch < (UTF32)0x10000) {   bytesToWrite = 3;
+        } else if (ch < (UTF32)0x110000) {  bytesToWrite = 4;
+        } else {                            bytesToWrite = 3;
+                                            ch = UNI_REPLACEMENT_CHAR;
+        }
+
+        target += bytesToWrite;
+        if (target > targetEnd) {
+            source = oldSource; /* Back up source pointer! */
+            target -= bytesToWrite; result = targetExhausted; break;
+        }
+        switch (bytesToWrite) { /* note: everything falls through. */
+            case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+            case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+            case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+            case 1: *--target =  (UTF8)(ch | firstByteMark[bytesToWrite]);
+        }
+        target += bytesToWrite;
+    }
+    *sourceStart = source;
+    *targetStart = target;
+    return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF32toUTF8 (
+        const UTF32** sourceStart, const UTF32* sourceEnd, 
+        UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+    ConversionResult result = conversionOK;
+    const UTF32* source = *sourceStart;
+    UTF8* target = *targetStart;
+    while (source < sourceEnd) {
+        UTF32 ch;
+        unsigned short bytesToWrite = 0;
+        const UTF32 byteMask = 0xBF;
+        const UTF32 byteMark = 0x80; 
+        ch = *source++;
+        if (flags == strictConversion ) {
+            /* UTF-16 surrogate values are illegal in UTF-32 */
+            if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+                --source; /* return to the illegal value itself */
+                result = sourceIllegal;
+                break;
+            }
+        }
+        /*
+         * Figure out how many bytes the result will require. Turn any
+         * illegally large UTF32 things (> Plane 17) into replacement chars.
+         */
+        if (ch < (UTF32)0x80) {      bytesToWrite = 1;
+        } else if (ch < (UTF32)0x800) {     bytesToWrite = 2;
+        } else if (ch < (UTF32)0x10000) {   bytesToWrite = 3;
+        } else if (ch <= UNI_MAX_LEGAL_UTF32) {  bytesToWrite = 4;
+        } else {                            bytesToWrite = 3;
+                                            ch = UNI_REPLACEMENT_CHAR;
+                                            result = sourceIllegal;
+        }
+        
+        target += bytesToWrite;
+        if (target > targetEnd) {
+            --source; /* Back up source pointer! */
+            target -= bytesToWrite; result = targetExhausted; break;
+        }
+        switch (bytesToWrite) { /* note: everything falls through. */
+            case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+            case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+            case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
+            case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
+        }
+        target += bytesToWrite;
+    }
+    *sourceStart = source;
+    *targetStart = target;
+    return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Utility routine to tell whether a sequence of bytes is legal UTF-8.
+ * This must be called with the length pre-determined by the first byte.
+ * If not calling this from ConvertUTF8to*, then the length can be set by:
+ *  length = trailingBytesForUTF8[*source]+1;
+ * and the sequence is illegal right away if there aren't that many bytes
+ * available.
+ * If presented with a length > 4, this returns false.  The Unicode
+ * definition of UTF-8 goes up to 4-byte sequences.
+ */
+
+static Boolean isLegalUTF8(const UTF8 *source, int length) {
+    UTF8 a;
+    const UTF8 *srcptr = source+length;
+    switch (length) {
+    default: return false;
+        /* Everything else falls through when "true"... */
+    case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+    case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+    case 2: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
+
+        switch (*source) {
+            /* no fall-through in this inner switch */
+            case 0xE0: if (a < 0xA0) return false; break;
+            case 0xED: if (a > 0x9F) return false; break;
+            case 0xF0: if (a < 0x90) return false; break;
+            case 0xF4: if (a > 0x8F) return false; break;
+            default:   if (a < 0x80) return false;
+        }
+
+    case 1: if (*source >= 0x80 && *source < 0xC2) return false;
+    }
+    if (*source > 0xF4) return false;
+    return true;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Exported function to return whether a UTF-8 sequence is legal or not.
+ * This is not used here; it's just exported.
+ */
+Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
+    int length = trailingBytesForUTF8[*source]+1;
+    if (length > sourceEnd - source) {
+        return false;
+    }
+    return isLegalUTF8(source, length);
+}
+
+/* --------------------------------------------------------------------- */
+
+static unsigned
+findMaximalSubpartOfIllFormedUTF8Sequence(const UTF8 *source,
+                                          const UTF8 *sourceEnd) {
+  UTF8 b1, b2, b3;
+
+  assert(!isLegalUTF8Sequence(source, sourceEnd));
+
+  /*
+   * Unicode 6.3.0, D93b:
+   *
+   *   Maximal subpart of an ill-formed subsequence: The longest code unit
+   *   subsequence starting at an unconvertible offset that is either:
+   *   a. the initial subsequence of a well-formed code unit sequence, or
+   *   b. a subsequence of length one.
+   */
+
+  if (source == sourceEnd)
+    return 0;
+
+  /*
+   * Perform case analysis.  See Unicode 6.3.0, Table 3-7. Well-Formed UTF-8
+   * Byte Sequences.
+   */
+
+  b1 = *source;
+  ++source;
+  if (b1 >= 0xC2 && b1 <= 0xDF) {
+    /*
+     * First byte is valid, but we know that this code unit sequence is
+     * invalid, so the maximal subpart has to end after the first byte.
+     */
+    return 1;
+  }
+
+  if (source == sourceEnd)
+    return 1;
+
+  b2 = *source;
+  ++source;
+
+  if (b1 == 0xE0) {
+    return (b2 >= 0xA0 && b2 <= 0xBF) ? 2 : 1;
+  }
+  if (b1 >= 0xE1 && b1 <= 0xEC) {
+    return (b2 >= 0x80 && b2 <= 0xBF) ? 2 : 1;
+  }
+  if (b1 == 0xED) {
+    return (b2 >= 0x80 && b2 <= 0x9F) ? 2 : 1;
+  }
+  if (b1 >= 0xEE && b1 <= 0xEF) {
+    return (b2 >= 0x80 && b2 <= 0xBF) ? 2 : 1;
+  }
+  if (b1 == 0xF0) {
+    if (b2 >= 0x90 && b2 <= 0xBF) {
+      if (source == sourceEnd)
+        return 2;
+
+      b3 = *source;
+      return (b3 >= 0x80 && b3 <= 0xBF) ? 3 : 2;
+    }
+    return 1;
+  }
+  if (b1 >= 0xF1 && b1 <= 0xF3) {
+    if (b2 >= 0x80 && b2 <= 0xBF) {
+      if (source == sourceEnd)
+        return 2;
+
+      b3 = *source;
+      return (b3 >= 0x80 && b3 <= 0xBF) ? 3 : 2;
+    }
+    return 1;
+  }
+  if (b1 == 0xF4) {
+    if (b2 >= 0x80 && b2 <= 0x8F) {
+      if (source == sourceEnd)
+        return 2;
+
+      b3 = *source;
+      return (b3 >= 0x80 && b3 <= 0xBF) ? 3 : 2;
+    }
+    return 1;
+  }
+
+  assert((b1 >= 0x80 && b1 <= 0xC1) || b1 >= 0xF5);
+  /*
+   * There are no valid sequences that start with these bytes.  Maximal subpart
+   * is defined to have length 1 in these cases.
+   */
+  return 1;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Exported function to return the total number of bytes in a codepoint
+ * represented in UTF-8, given the value of the first byte.
+ */
+unsigned getNumBytesForUTF8(UTF8 first) {
+  return trailingBytesForUTF8[first] + 1;
+}
+
+/* --------------------------------------------------------------------- */
+
+/*
+ * Exported function to return whether a UTF-8 string is legal or not.
+ * This is not used here; it's just exported.
+ */
+Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) {
+    while (*source != sourceEnd) {
+        int length = trailingBytesForUTF8[**source] + 1;
+        if (length > sourceEnd - *source || !isLegalUTF8(*source, length))
+            return false;
+        *source += length;
+    }
+    return true;
+}
+
+/* --------------------------------------------------------------------- */
+
+ConversionResult ConvertUTF8toUTF16 (
+        const UTF8** sourceStart, const UTF8* sourceEnd, 
+        UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+    ConversionResult result = conversionOK;
+    const UTF8* source = *sourceStart;
+    UTF16* target = *targetStart;
+    while (source < sourceEnd) {
+        UTF32 ch = 0;
+        unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+        if (extraBytesToRead >= sourceEnd - source) {
+            result = sourceExhausted; break;
+        }
+        /* Do this check whether lenient or strict */
+        if (!isLegalUTF8(source, extraBytesToRead+1)) {
+            result = sourceIllegal;
+            break;
+        }
+        /*
+         * The cases all fall through. See "Note A" below.
+         */
+        switch (extraBytesToRead) {
+            case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
+            case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
+            case 3: ch += *source++; ch <<= 6;
+            case 2: ch += *source++; ch <<= 6;
+            case 1: ch += *source++; ch <<= 6;
+            case 0: ch += *source++;
+        }
+        ch -= offsetsFromUTF8[extraBytesToRead];
+
+        if (target >= targetEnd) {
+            source -= (extraBytesToRead+1); /* Back up source pointer! */
+            result = targetExhausted; break;
+        }
+        if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
+            /* UTF-16 surrogate values are illegal in UTF-32 */
+            if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+                if (flags == strictConversion) {
+                    source -= (extraBytesToRead+1); /* return to the illegal value itself */
+                    result = sourceIllegal;
+                    break;
+                } else {
+                    *target++ = UNI_REPLACEMENT_CHAR;
+                }
+            } else {
+                *target++ = (UTF16)ch; /* normal case */
+            }
+        } else if (ch > UNI_MAX_UTF16) {
+            if (flags == strictConversion) {
+                result = sourceIllegal;
+                source -= (extraBytesToRead+1); /* return to the start */
+                break; /* Bail out; shouldn't continue */
+            } else {
+                *target++ = UNI_REPLACEMENT_CHAR;
+            }
+        } else {
+            /* target is a character in range 0xFFFF - 0x10FFFF. */
+            if (target + 1 >= targetEnd) {
+                source -= (extraBytesToRead+1); /* Back up source pointer! */
+                result = targetExhausted; break;
+            }
+            ch -= halfBase;
+            *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
+            *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
+        }
+    }
+    *sourceStart = source;
+    *targetStart = target;
+    return result;
+}
+
+/* --------------------------------------------------------------------- */
+
+static ConversionResult ConvertUTF8toUTF32Impl(
+        const UTF8** sourceStart, const UTF8* sourceEnd, 
+        UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags,
+        Boolean InputIsPartial) {
+    ConversionResult result = conversionOK;
+    const UTF8* source = *sourceStart;
+    UTF32* target = *targetStart;
+    while (source < sourceEnd) {
+        UTF32 ch = 0;
+        unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
+        if (extraBytesToRead >= sourceEnd - source) {
+            if (flags == strictConversion || InputIsPartial) {
+                result = sourceExhausted;
+                break;
+            } else {
+                result = sourceIllegal;
+
+                /*
+                 * Replace the maximal subpart of ill-formed sequence with
+                 * replacement character.
+                 */
+                source += findMaximalSubpartOfIllFormedUTF8Sequence(source,
+                                                                    sourceEnd);
+                *target++ = UNI_REPLACEMENT_CHAR;
+                continue;
+            }
+        }
+        if (target >= targetEnd) {
+            result = targetExhausted; break;
+        }
+
+        /* Do this check whether lenient or strict */
+        if (!isLegalUTF8(source, extraBytesToRead+1)) {
+            result = sourceIllegal;
+            if (flags == strictConversion) {
+                /* Abort conversion. */
+                break;
+            } else {
+                /*
+                 * Replace the maximal subpart of ill-formed sequence with
+                 * replacement character.
+                 */
+                source += findMaximalSubpartOfIllFormedUTF8Sequence(source,
+                                                                    sourceEnd);
+                *target++ = UNI_REPLACEMENT_CHAR;
+                continue;
+            }
+        }
+        /*
+         * The cases all fall through. See "Note A" below.
+         */
+        switch (extraBytesToRead) {
+            case 5: ch += *source++; ch <<= 6;
+            case 4: ch += *source++; ch <<= 6;
+            case 3: ch += *source++; ch <<= 6;
+            case 2: ch += *source++; ch <<= 6;
+            case 1: ch += *source++; ch <<= 6;
+            case 0: ch += *source++;
+        }
+        ch -= offsetsFromUTF8[extraBytesToRead];
+
+        if (ch <= UNI_MAX_LEGAL_UTF32) {
+            /*
+             * UTF-16 surrogate values are illegal in UTF-32, and anything
+             * over Plane 17 (> 0x10FFFF) is illegal.
+             */
+            if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
+                if (flags == strictConversion) {
+                    source -= (extraBytesToRead+1); /* return to the illegal value itself */
+                    result = sourceIllegal;
+                    break;
+                } else {
+                    *target++ = UNI_REPLACEMENT_CHAR;
+                }
+            } else {
+                *target++ = ch;
+            }
+        } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
+            result = sourceIllegal;
+            *target++ = UNI_REPLACEMENT_CHAR;
+        }
+    }
+    *sourceStart = source;
+    *targetStart = target;
+    return result;
+}
+
+ConversionResult ConvertUTF8toUTF32Partial(const UTF8 **sourceStart,
+                                           const UTF8 *sourceEnd,
+                                           UTF32 **targetStart,
+                                           UTF32 *targetEnd,
+                                           ConversionFlags flags) {
+  return ConvertUTF8toUTF32Impl(sourceStart, sourceEnd, targetStart, targetEnd,
+                                flags, /*InputIsPartial=*/true);
+}
+
+ConversionResult ConvertUTF8toUTF32(const UTF8 **sourceStart,
+                                    const UTF8 *sourceEnd, UTF32 **targetStart,
+                                    UTF32 *targetEnd, ConversionFlags flags) {
+  return ConvertUTF8toUTF32Impl(sourceStart, sourceEnd, targetStart, targetEnd,
+                                flags, /*InputIsPartial=*/false);
+}
+
+}
+
+/* ---------------------------------------------------------------------
+
+    Note A.
+    The fall-through switches in UTF-8 reading code save a
+    temp variable, some decrements & conditionals.  The switches
+    are equivalent to the following loop:
+        {
+            int tmpBytesToRead = extraBytesToRead+1;
+            do {
+                ch += *source++;
+                --tmpBytesToRead;
+                if (tmpBytesToRead) ch <<= 6;
+            } while (tmpBytesToRead > 0);
+        }
+    In UTF-8 writing code, the switches on "bytesToWrite" are
+    similarly unrolled loops.
+
+   --------------------------------------------------------------------- */
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/ConvertUTFWrapper.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/ConvertUTFWrapper.cpp
new file mode 100644
index 0000000..810c135
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/ConvertUTFWrapper.cpp
@@ -0,0 +1,122 @@
+//===-- ConvertUTFWrapper.cpp - Wrap ConvertUTF.h with clang data types -----===
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ConvertUTF.h"
+#include <string>
+#include <vector>
+
+namespace llvm {
+
+bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr) {
+  const UTF32 *SourceStart = &Source;
+  const UTF32 *SourceEnd = SourceStart + 1;
+  UTF8 *TargetStart = reinterpret_cast<UTF8 *>(ResultPtr);
+  UTF8 *TargetEnd = TargetStart + 4;
+  ConversionResult CR = ConvertUTF32toUTF8(&SourceStart, SourceEnd,
+                                           &TargetStart, TargetEnd,
+                                           strictConversion);
+  if (CR != conversionOK)
+    return false;
+
+  ResultPtr = reinterpret_cast<char*>(TargetStart);
+  return true;
+}
+
+bool hasUTF16ByteOrderMark(ArrayRef<char> S) {
+  return (S.size() >= 2 &&
+          ((S[0] == '\xff' && S[1] == '\xfe') ||
+           (S[0] == '\xfe' && S[1] == '\xff')));
+}
+
+bool convertUTF16ToUTF8String(ArrayRef<UTF16> SrcUTF16,
+                              SmallVectorImpl<char> &DstUTF8) {
+  assert(DstUTF8.empty());
+
+  // Avoid OOB by returning early on empty input.
+  if (SrcUTF16.empty())
+    return true;
+
+  const UTF16 *Src = SrcUTF16.begin();
+  const UTF16 *SrcEnd = SrcUTF16.end();
+
+  // Byteswap if necessary.
+  std::vector<UTF16> ByteSwapped;
+  if (Src[0] == UNI_UTF16_BYTE_ORDER_MARK_SWAPPED) {
+    ByteSwapped.insert(ByteSwapped.end(), Src, SrcEnd);
+    for (unsigned I = 0, E = ByteSwapped.size(); I != E; ++I)
+      ByteSwapped[I] = (ByteSwapped[I] << 8) | (ByteSwapped[I] >> 8);
+    Src = &ByteSwapped[0];
+    SrcEnd = &ByteSwapped[ByteSwapped.size() - 1] + 1;
+  }
+
+  // Skip the BOM for conversion.
+  if (Src[0] == UNI_UTF16_BYTE_ORDER_MARK_NATIVE)
+    Src++;
+
+  // Just allocate enough space up front.  We'll shrink it later.  Allocate
+  // enough that we can fit a null terminator without reallocating.
+  DstUTF8.resize(SrcUTF16.size() * UNI_MAX_UTF8_BYTES_PER_CODE_POINT + 1);
+  UTF8 *Dst = reinterpret_cast<UTF8*>(&DstUTF8[0]);
+  UTF8 *DstEnd = Dst + DstUTF8.size();
+
+  ConversionResult CR =
+      ConvertUTF16toUTF8(&Src, SrcEnd, &Dst, DstEnd, strictConversion);
+  assert(CR != targetExhausted);
+
+  if (CR != conversionOK) {
+    DstUTF8.clear();
+    return false;
+  }
+
+  DstUTF8.resize(reinterpret_cast<char*>(Dst) - &DstUTF8[0]);
+  DstUTF8.push_back(0);
+  DstUTF8.pop_back();
+  return true;
+}
+
+bool convertUTF8ToUTF16String(StringRef SrcUTF8,
+                              SmallVectorImpl<UTF16> &DstUTF16) {
+  assert(DstUTF16.empty());
+
+  // Avoid OOB by returning early on empty input.
+  if (SrcUTF8.empty()) {
+    DstUTF16.push_back(0);
+    DstUTF16.pop_back();
+    return true;
+  }
+
+  const UTF8 *Src = reinterpret_cast<const UTF8 *>(SrcUTF8.begin());
+  const UTF8 *SrcEnd = reinterpret_cast<const UTF8 *>(SrcUTF8.end());
+
+  // Allocate the same number of UTF-16 code units as UTF-8 code units. Encoding
+  // as UTF-16 should always require the same amount or less code units than the
+  // UTF-8 encoding.  Allocate one extra byte for the null terminator though,
+  // so that someone calling DstUTF16.data() gets a null terminated string.
+  // We resize down later so we don't have to worry that this over allocates.
+  DstUTF16.resize(SrcUTF8.size()+1);
+  UTF16 *Dst = &DstUTF16[0];
+  UTF16 *DstEnd = Dst + DstUTF16.size();
+
+  ConversionResult CR =
+      ConvertUTF8toUTF16(&Src, SrcEnd, &Dst, DstEnd, strictConversion);
+  assert(CR != targetExhausted);
+
+  if (CR != conversionOK) {
+    DstUTF16.clear();
+    return false;
+  }
+
+  DstUTF16.resize(Dst - &DstUTF16[0]);
+  DstUTF16.push_back(0);
+  DstUTF16.pop_back();
+  return true;
+}
+
+} // end namespace llvm
+
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/ErrorHandling.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/ErrorHandling.cpp
new file mode 100644
index 0000000..1ab2405
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/ErrorHandling.cpp
@@ -0,0 +1,83 @@
+//===- lib/Support/ErrorHandling.cpp - Callbacks for errors ---------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines an API used to indicate fatal error conditions.  Non-fatal
+// errors (most of them) should be handled through LLVMContext.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/WindowsError.h"
+
+#ifdef _WIN32
+
+#include <system_error>
+#include <winerror.h>
+
+// I'd rather not double the line count of the following.
+#define MAP_ERR_TO_COND(x, y)                                                  \
+  case x:                                                                      \
+    return std::make_error_code(std::errc::y)
+
+std::error_code llvm::mapWindowsError(unsigned EV) {
+  switch (EV) {
+    MAP_ERR_TO_COND(ERROR_ACCESS_DENIED, permission_denied);
+    MAP_ERR_TO_COND(ERROR_ALREADY_EXISTS, file_exists);
+    MAP_ERR_TO_COND(ERROR_BAD_UNIT, no_such_device);
+    MAP_ERR_TO_COND(ERROR_BUFFER_OVERFLOW, filename_too_long);
+    MAP_ERR_TO_COND(ERROR_BUSY, device_or_resource_busy);
+    MAP_ERR_TO_COND(ERROR_BUSY_DRIVE, device_or_resource_busy);
+    MAP_ERR_TO_COND(ERROR_CANNOT_MAKE, permission_denied);
+    MAP_ERR_TO_COND(ERROR_CANTOPEN, io_error);
+    MAP_ERR_TO_COND(ERROR_CANTREAD, io_error);
+    MAP_ERR_TO_COND(ERROR_CANTWRITE, io_error);
+    MAP_ERR_TO_COND(ERROR_CURRENT_DIRECTORY, permission_denied);
+    MAP_ERR_TO_COND(ERROR_DEV_NOT_EXIST, no_such_device);
+    MAP_ERR_TO_COND(ERROR_DEVICE_IN_USE, device_or_resource_busy);
+    MAP_ERR_TO_COND(ERROR_DIR_NOT_EMPTY, directory_not_empty);
+    MAP_ERR_TO_COND(ERROR_DIRECTORY, invalid_argument);
+    MAP_ERR_TO_COND(ERROR_DISK_FULL, no_space_on_device);
+    MAP_ERR_TO_COND(ERROR_FILE_EXISTS, file_exists);
+    MAP_ERR_TO_COND(ERROR_FILE_NOT_FOUND, no_such_file_or_directory);
+    MAP_ERR_TO_COND(ERROR_HANDLE_DISK_FULL, no_space_on_device);
+    MAP_ERR_TO_COND(ERROR_INVALID_ACCESS, permission_denied);
+    MAP_ERR_TO_COND(ERROR_INVALID_DRIVE, no_such_device);
+    MAP_ERR_TO_COND(ERROR_INVALID_FUNCTION, function_not_supported);
+    MAP_ERR_TO_COND(ERROR_INVALID_HANDLE, invalid_argument);
+    MAP_ERR_TO_COND(ERROR_INVALID_NAME, invalid_argument);
+    MAP_ERR_TO_COND(ERROR_LOCK_VIOLATION, no_lock_available);
+    MAP_ERR_TO_COND(ERROR_LOCKED, no_lock_available);
+    MAP_ERR_TO_COND(ERROR_NEGATIVE_SEEK, invalid_argument);
+    MAP_ERR_TO_COND(ERROR_NOACCESS, permission_denied);
+    MAP_ERR_TO_COND(ERROR_NOT_ENOUGH_MEMORY, not_enough_memory);
+    MAP_ERR_TO_COND(ERROR_NOT_READY, resource_unavailable_try_again);
+    MAP_ERR_TO_COND(ERROR_OPEN_FAILED, io_error);
+    MAP_ERR_TO_COND(ERROR_OPEN_FILES, device_or_resource_busy);
+    MAP_ERR_TO_COND(ERROR_OUTOFMEMORY, not_enough_memory);
+    MAP_ERR_TO_COND(ERROR_PATH_NOT_FOUND, no_such_file_or_directory);
+    MAP_ERR_TO_COND(ERROR_BAD_NETPATH, no_such_file_or_directory);
+    MAP_ERR_TO_COND(ERROR_READ_FAULT, io_error);
+    MAP_ERR_TO_COND(ERROR_RETRY, resource_unavailable_try_again);
+    MAP_ERR_TO_COND(ERROR_SEEK, io_error);
+    MAP_ERR_TO_COND(ERROR_SHARING_VIOLATION, permission_denied);
+    MAP_ERR_TO_COND(ERROR_TOO_MANY_OPEN_FILES, too_many_files_open);
+    MAP_ERR_TO_COND(ERROR_WRITE_FAULT, io_error);
+    MAP_ERR_TO_COND(ERROR_WRITE_PROTECT, permission_denied);
+    MAP_ERR_TO_COND(WSAEACCES, permission_denied);
+    MAP_ERR_TO_COND(WSAEBADF, bad_file_descriptor);
+    MAP_ERR_TO_COND(WSAEFAULT, bad_address);
+    MAP_ERR_TO_COND(WSAEINTR, interrupted);
+    MAP_ERR_TO_COND(WSAEINVAL, invalid_argument);
+    MAP_ERR_TO_COND(WSAEMFILE, too_many_files_open);
+    MAP_ERR_TO_COND(WSAENAMETOOLONG, filename_too_long);
+  default:
+    return std::error_code(EV, std::system_category());
+  }
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/Hashing.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Hashing.cpp
new file mode 100644
index 0000000..b280043
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Hashing.cpp
@@ -0,0 +1,29 @@
+//===-------------- lib/Support/Hashing.cpp -------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides implementation bits for the LLVM common hashing
+// infrastructure. Documentation and most of the other information is in the
+// header file.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Hashing.h"
+
+using namespace llvm;
+
+// Provide a definition and static initializer for the fixed seed. This
+// initializer should always be zero to ensure its value can never appear to be
+// non-zero, even during dynamic initialization.
+size_t llvm::hashing::detail::fixed_seed_override = 0;
+
+// Implement the function for forced setting of the fixed seed.
+// FIXME: Use atomic operations here so that there is no data race.
+void llvm::set_fixed_execution_hash_seed(size_t fixed_value) {
+  hashing::detail::fixed_seed_override = fixed_value;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/Path.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Path.cpp
new file mode 100644
index 0000000..b29f6d1
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Path.cpp
@@ -0,0 +1,822 @@
+//===-- Path.cpp - Implement OS Path Concept ------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file implements the operating system Path API.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Path.h"
+
+#include <cctype>
+#include <cstring>
+
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
+#include <unistd.h>
+#else
+#include <io.h>
+#endif
+
+#include "llvm/FileSystem.h"
+#include "llvm/SmallString.h"
+
+using namespace llvm;
+
+namespace {
+  using llvm::StringRef;
+  using llvm::sys::path::is_separator;
+
+#ifdef _WIN32
+  const char *separators = "\\/";
+  const char preferred_separator = '\\';
+#else
+  const char  separators = '/';
+  const char preferred_separator = '/';
+#endif
+
+  StringRef find_first_component(StringRef path) {
+    // Look for this first component in the following order.
+    // * empty (in this case we return an empty string)
+    // * either C: or {//,\\}net.
+    // * {/,\}
+    // * {file,directory}name
+
+    if (path.empty())
+      return path;
+
+#ifdef _WIN32
+    // C:
+    if (path.size() >= 2 && std::isalpha(static_cast<unsigned char>(path[0])) &&
+        path[1] == ':')
+      return path.substr(0, 2);
+#endif
+
+    // //net
+    if ((path.size() > 2) &&
+        is_separator(path[0]) &&
+        path[0] == path[1] &&
+        !is_separator(path[2])) {
+      // Find the next directory separator.
+      size_t end = path.find_first_of(separators, 2);
+      return path.substr(0, end);
+    }
+
+    // {/,\}
+    if (is_separator(path[0]))
+      return path.substr(0, 1);
+
+    // * {file,directory}name
+    size_t end = path.find_first_of(separators);
+    return path.substr(0, end);
+  }
+
+  size_t filename_pos(StringRef str) {
+    if (str.size() == 2 &&
+        is_separator(str[0]) &&
+        str[0] == str[1])
+      return 0;
+
+    if (str.size() > 0 && is_separator(str[str.size() - 1]))
+      return str.size() - 1;
+
+    size_t pos = str.find_last_of(separators, str.size() - 1);
+
+#ifdef _WIN32
+    if (pos == StringRef::npos)
+      pos = str.find_last_of(':', str.size() - 2);
+#endif
+
+    if (pos == StringRef::npos ||
+        (pos == 1 && is_separator(str[0])))
+      return 0;
+
+    return pos + 1;
+  }
+
+  size_t root_dir_start(StringRef str) {
+    // case "c:/"
+#ifdef _WIN32
+    if (str.size() > 2 &&
+        str[1] == ':' &&
+        is_separator(str[2]))
+      return 2;
+#endif
+
+    // case "//"
+    if (str.size() == 2 &&
+        is_separator(str[0]) &&
+        str[0] == str[1])
+      return StringRef::npos;
+
+    // case "//net"
+    if (str.size() > 3 &&
+        is_separator(str[0]) &&
+        str[0] == str[1] &&
+        !is_separator(str[2])) {
+      return str.find_first_of(separators, 2);
+    }
+
+    // case "/"
+    if (str.size() > 0 && is_separator(str[0]))
+      return 0;
+
+    return StringRef::npos;
+  }
+
+  size_t parent_path_end(StringRef path) {
+    size_t end_pos = filename_pos(path);
+
+    bool filename_was_sep = path.size() > 0 && is_separator(path[end_pos]);
+
+    // Skip separators except for root dir.
+    size_t root_dir_pos = root_dir_start(path.substr(0, end_pos));
+
+    while(end_pos > 0 &&
+          (end_pos - 1) != root_dir_pos &&
+          is_separator(path[end_pos - 1]))
+      --end_pos;
+
+    if (end_pos == 1 && root_dir_pos == 0 && filename_was_sep)
+      return StringRef::npos;
+
+    return end_pos;
+  }
+} // end unnamed namespace
+
+namespace llvm {
+namespace sys  {
+namespace path {
+
+const_iterator begin(StringRef path) {
+  const_iterator i;
+  i.Path      = path;
+  i.Component = find_first_component(path);
+  i.Position  = 0;
+  return i;
+}
+
+const_iterator end(StringRef path) {
+  const_iterator i;
+  i.Path      = path;
+  i.Position  = path.size();
+  return i;
+}
+
+const_iterator &const_iterator::operator++() {
+  assert(Position < Path.size() && "Tried to increment past end!");
+
+  // Increment Position to past the current component
+  Position += Component.size();
+
+  // Check for end.
+  if (Position == Path.size()) {
+    Component = StringRef();
+    return *this;
+  }
+
+  // Both POSIX and Windows treat paths that begin with exactly two separators
+  // specially.
+  bool was_net = Component.size() > 2 &&
+    is_separator(Component[0]) &&
+    Component[1] == Component[0] &&
+    !is_separator(Component[2]);
+
+  // Handle separators.
+  if (is_separator(Path[Position])) {
+    // Root dir.
+    if (was_net
+#ifdef _WIN32
+        // c:/
+        || Component.endswith(":")
+#endif
+        ) {
+      Component = Path.substr(Position, 1);
+      return *this;
+    }
+
+    // Skip extra separators.
+    while (Position != Path.size() &&
+           is_separator(Path[Position])) {
+      ++Position;
+    }
+
+    // Treat trailing '/' as a '.'.
+    if (Position == Path.size()) {
+      --Position;
+      Component = ".";
+      return *this;
+    }
+  }
+
+  // Find next component.
+  size_t end_pos = Path.find_first_of(separators, Position);
+  Component = Path.slice(Position, end_pos);
+
+  return *this;
+}
+
+bool const_iterator::operator==(const const_iterator &RHS) const {
+  return Path.begin() == RHS.Path.begin() && Position == RHS.Position;
+}
+
+ptrdiff_t const_iterator::operator-(const const_iterator &RHS) const {
+  return Position - RHS.Position;
+}
+
+reverse_iterator rbegin(StringRef Path) {
+  reverse_iterator I;
+  I.Path = Path;
+  I.Position = Path.size();
+  return ++I;
+}
+
+reverse_iterator rend(StringRef Path) {
+  reverse_iterator I;
+  I.Path = Path;
+  I.Component = Path.substr(0, 0);
+  I.Position = 0;
+  return I;
+}
+
+reverse_iterator &reverse_iterator::operator++() {
+  // If we're at the end and the previous char was a '/', return '.' unless
+  // we are the root path.
+  size_t root_dir_pos = root_dir_start(Path);
+  if (Position == Path.size() &&
+      Path.size() > root_dir_pos + 1 &&
+      is_separator(Path[Position - 1])) {
+    --Position;
+    Component = ".";
+    return *this;
+  }
+
+  // Skip separators unless it's the root directory.
+  size_t end_pos = Position;
+
+  while(end_pos > 0 &&
+        (end_pos - 1) != root_dir_pos &&
+        is_separator(Path[end_pos - 1]))
+    --end_pos;
+
+  // Find next separator.
+  size_t start_pos = filename_pos(Path.substr(0, end_pos));
+  Component = Path.slice(start_pos, end_pos);
+  Position = start_pos;
+  return *this;
+}
+
+bool reverse_iterator::operator==(const reverse_iterator &RHS) const {
+  return Path.begin() == RHS.Path.begin() && Component == RHS.Component &&
+         Position == RHS.Position;
+}
+
+ptrdiff_t reverse_iterator::operator-(const reverse_iterator &RHS) const {
+  return Position - RHS.Position;
+}
+
+StringRef root_path(StringRef path) {
+  const_iterator b = begin(path),
+                 pos = b,
+                 e = end(path);
+  if (b != e) {
+    bool has_net = b->size() > 2 && is_separator((*b)[0]) && (*b)[1] == (*b)[0];
+    bool has_drive =
+#ifdef _WIN32
+      b->endswith(":");
+#else
+      false;
+#endif
+
+    if (has_net || has_drive) {
+      if ((++pos != e) && is_separator((*pos)[0])) {
+        // {C:/,//net/}, so get the first two components.
+        return path.substr(0, b->size() + pos->size());
+      } else {
+        // just {C:,//net}, return the first component.
+        return *b;
+      }
+    }
+
+    // POSIX style root directory.
+    if (is_separator((*b)[0])) {
+      return *b;
+    }
+  }
+
+  return StringRef();
+}
+
+StringRef root_name(StringRef path) {
+  const_iterator b = begin(path),
+                 e = end(path);
+  if (b != e) {
+    bool has_net = b->size() > 2 && is_separator((*b)[0]) && (*b)[1] == (*b)[0];
+    bool has_drive =
+#ifdef _WIN32
+      b->endswith(":");
+#else
+      false;
+#endif
+
+    if (has_net || has_drive) {
+      // just {C:,//net}, return the first component.
+      return *b;
+    }
+  }
+
+  // No path or no name.
+  return StringRef();
+}
+
+StringRef root_directory(StringRef path) {
+  const_iterator b = begin(path),
+                 pos = b,
+                 e = end(path);
+  if (b != e) {
+    bool has_net = b->size() > 2 && is_separator((*b)[0]) && (*b)[1] == (*b)[0];
+    bool has_drive =
+#ifdef _WIN32
+      b->endswith(":");
+#else
+      false;
+#endif
+
+    if ((has_net || has_drive) &&
+        // {C:,//net}, skip to the next component.
+        (++pos != e) && is_separator((*pos)[0])) {
+      return *pos;
+    }
+
+    // POSIX style root directory.
+    if (!has_net && is_separator((*b)[0])) {
+      return *b;
+    }
+  }
+
+  // No path or no root.
+  return StringRef();
+}
+
+StringRef relative_path(StringRef path) {
+  StringRef root = root_path(path);
+  return path.substr(root.size());
+}
+
+void append(SmallVectorImpl<char> &path, const Twine &a,
+                                         const Twine &b,
+                                         const Twine &c,
+                                         const Twine &d) {
+  SmallString<32> a_storage;
+  SmallString<32> b_storage;
+  SmallString<32> c_storage;
+  SmallString<32> d_storage;
+
+  SmallVector<StringRef, 4> components;
+  if (!a.isTriviallyEmpty()) components.push_back(a.toStringRef(a_storage));
+  if (!b.isTriviallyEmpty()) components.push_back(b.toStringRef(b_storage));
+  if (!c.isTriviallyEmpty()) components.push_back(c.toStringRef(c_storage));
+  if (!d.isTriviallyEmpty()) components.push_back(d.toStringRef(d_storage));
+
+  for (auto &component : components) {
+    bool path_has_sep = !path.empty() && is_separator(path[path.size() - 1]);
+    bool component_has_sep = !component.empty() && is_separator(component[0]);
+    bool is_root_name = has_root_name(component);
+
+    if (path_has_sep) {
+      // Strip separators from beginning of component.
+      size_t loc = component.find_first_not_of(separators);
+      StringRef c = component.substr(loc);
+
+      // Append it.
+      path.append(c.begin(), c.end());
+      continue;
+    }
+
+    if (!component_has_sep && !(path.empty() || is_root_name)) {
+      // Add a separator.
+      path.push_back(preferred_separator);
+    }
+
+    path.append(component.begin(), component.end());
+  }
+}
+
+void append(SmallVectorImpl<char> &path,
+            const_iterator begin, const_iterator end) {
+  for (; begin != end; ++begin)
+    path::append(path, *begin);
+}
+
+StringRef parent_path(StringRef path) {
+  size_t end_pos = parent_path_end(path);
+  if (end_pos == StringRef::npos)
+    return StringRef();
+  else
+    return path.substr(0, end_pos);
+}
+
+void remove_filename(SmallVectorImpl<char> &path) {
+  size_t end_pos = parent_path_end(StringRef(path.begin(), path.size()));
+  if (end_pos != StringRef::npos)
+    path.set_size(end_pos);
+}
+
+void replace_extension(SmallVectorImpl<char> &path, const Twine &extension) {
+  StringRef p(path.begin(), path.size());
+  SmallString<32> ext_storage;
+  StringRef ext = extension.toStringRef(ext_storage);
+
+  // Erase existing extension.
+  size_t pos = p.find_last_of('.');
+  if (pos != StringRef::npos && pos >= filename_pos(p))
+    path.set_size(pos);
+
+  // Append '.' if needed.
+  if (ext.size() > 0 && ext[0] != '.')
+    path.push_back('.');
+
+  // Append extension.
+  path.append(ext.begin(), ext.end());
+}
+
+void replace_path_prefix(SmallVectorImpl<char> &Path,
+                         const StringRef &OldPrefix,
+                         const StringRef &NewPrefix) {
+  if (OldPrefix.empty() && NewPrefix.empty())
+    return;
+
+  StringRef OrigPath(Path.begin(), Path.size());
+  if (!OrigPath.startswith(OldPrefix))
+    return;
+
+  // If prefixes have the same size we can simply copy the new one over.
+  if (OldPrefix.size() == NewPrefix.size()) {
+    std::copy(NewPrefix.begin(), NewPrefix.end(), Path.begin());
+    return;
+  }
+
+  StringRef RelPath = OrigPath.substr(OldPrefix.size());
+  SmallString<256> NewPath;
+  path::append(NewPath, NewPrefix);
+  path::append(NewPath, RelPath);
+  Path.swap(NewPath);
+}
+
+void native(const Twine &path, SmallVectorImpl<char> &result) {
+  assert((!path.isSingleStringRef() ||
+          path.getSingleStringRef().data() != result.data()) &&
+         "path and result are not allowed to overlap!");
+  // Clear result.
+  result.clear();
+  path.toVector(result);
+  native(result);
+}
+
+void native(SmallVectorImpl<char> &Path) {
+#ifdef _WIN32
+  std::replace(Path.begin(), Path.end(), '/', '\\');
+#else
+  for (auto PI = Path.begin(), PE = Path.end(); PI < PE; ++PI) {
+    if (*PI == '\\') {
+      auto PN = PI + 1;
+      if (PN < PE && *PN == '\\')
+        ++PI; // increment once, the for loop will move over the escaped slash
+      else
+        *PI = '/';
+    }
+  }
+#endif
+}
+
+StringRef filename(StringRef path) {
+  return *rbegin(path);
+}
+
+StringRef stem(StringRef path) {
+  StringRef fname = filename(path);
+  size_t pos = fname.find_last_of('.');
+  if (pos == StringRef::npos)
+    return fname;
+  else
+    if ((fname.size() == 1 && fname == ".") ||
+        (fname.size() == 2 && fname == ".."))
+      return fname;
+    else
+      return fname.substr(0, pos);
+}
+
+StringRef extension(StringRef path) {
+  StringRef fname = filename(path);
+  size_t pos = fname.find_last_of('.');
+  if (pos == StringRef::npos)
+    return StringRef();
+  else
+    if ((fname.size() == 1 && fname == ".") ||
+        (fname.size() == 2 && fname == ".."))
+      return StringRef();
+    else
+      return fname.substr(pos);
+}
+
+bool is_separator(char value) {
+  switch(value) {
+#ifdef _WIN32
+    case '\\': // fall through
+#endif
+    case '/': return true;
+    default: return false;
+  }
+}
+
+static const char preferred_separator_string[] = { preferred_separator, '\0' };
+
+StringRef get_separator() {
+  return preferred_separator_string;
+}
+
+bool has_root_name(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !root_name(p).empty();
+}
+
+bool has_root_directory(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !root_directory(p).empty();
+}
+
+bool has_root_path(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !root_path(p).empty();
+}
+
+bool has_relative_path(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !relative_path(p).empty();
+}
+
+bool has_filename(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !filename(p).empty();
+}
+
+bool has_parent_path(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !parent_path(p).empty();
+}
+
+bool has_stem(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !stem(p).empty();
+}
+
+bool has_extension(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  return !extension(p).empty();
+}
+
+bool is_absolute(const Twine &path) {
+  SmallString<128> path_storage;
+  StringRef p = path.toStringRef(path_storage);
+
+  bool rootDir = has_root_directory(p),
+#ifdef _WIN32
+       rootName = has_root_name(p);
+#else
+       rootName = true;
+#endif
+
+  return rootDir && rootName;
+}
+
+bool is_relative(const Twine &path) { return !is_absolute(path); }
+
+StringRef remove_leading_dotslash(StringRef Path) {
+  // Remove leading "./" (or ".//" or "././" etc.)
+  while (Path.size() > 2 && Path[0] == '.' && is_separator(Path[1])) {
+    Path = Path.substr(2);
+    while (Path.size() > 0 && is_separator(Path[0]))
+      Path = Path.substr(1);
+  }
+  return Path;
+}
+
+static SmallString<256> remove_dots(StringRef path, bool remove_dot_dot) {
+  SmallVector<StringRef, 16> components;
+
+  // Skip the root path, then look for traversal in the components.
+  StringRef rel = path::relative_path(path);
+  for (StringRef C : llvm::make_range(path::begin(rel), path::end(rel))) {
+    if (C == ".")
+      continue;
+    if (remove_dot_dot) {
+      if (C == "..") {
+        if (!components.empty())
+          components.pop_back();
+        continue;
+      }
+    }
+    components.push_back(C);
+  }
+
+  SmallString<256> buffer = path::root_path(path);
+  for (StringRef C : components)
+    path::append(buffer, C);
+  return buffer;
+}
+
+bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot) {
+  StringRef p(path.data(), path.size());
+
+  SmallString<256> result = remove_dots(p, remove_dot_dot);
+  if (result == path)
+    return false;
+
+  path.swap(result);
+  return true;
+}
+
+} // end namespace path
+
+namespace fs {
+
+std::error_code getUniqueID(const Twine Path, UniqueID &Result) {
+  file_status Status;
+  std::error_code EC = status(Path, Status);
+  if (EC)
+    return EC;
+  Result = Status.getUniqueID();
+  return std::error_code();
+}
+
+static std::error_code make_absolute(const Twine &current_directory,
+                                     SmallVectorImpl<char> &path,
+                                     bool use_current_directory) {
+  StringRef p(path.data(), path.size());
+
+  bool rootDirectory = path::has_root_directory(p),
+#ifdef _WIN32
+       rootName = path::has_root_name(p);
+#else
+       rootName = true;
+#endif
+
+  // Already absolute.
+  if (rootName && rootDirectory)
+    return std::error_code();
+
+  // All of the following conditions will need the current directory.
+  SmallString<128> current_dir;
+  if (use_current_directory)
+    current_directory.toVector(current_dir);
+  else if (std::error_code ec = current_path(current_dir))
+    return ec;
+
+  // Relative path. Prepend the current directory.
+  if (!rootName && !rootDirectory) {
+    // Append path to the current directory.
+    path::append(current_dir, p);
+    // Set path to the result.
+    path.swap(current_dir);
+    return std::error_code();
+  }
+
+  if (!rootName && rootDirectory) {
+    StringRef cdrn = path::root_name(current_dir);
+    SmallString<128> curDirRootName(cdrn.begin(), cdrn.end());
+    path::append(curDirRootName, p);
+    // Set path to the result.
+    path.swap(curDirRootName);
+    return std::error_code();
+  }
+
+  if (rootName && !rootDirectory) {
+    StringRef pRootName      = path::root_name(p);
+    StringRef bRootDirectory = path::root_directory(current_dir);
+    StringRef bRelativePath  = path::relative_path(current_dir);
+    StringRef pRelativePath  = path::relative_path(p);
+
+    SmallString<128> res;
+    path::append(res, pRootName, bRootDirectory, bRelativePath, pRelativePath);
+    path.swap(res);
+    return std::error_code();
+  }
+
+  assert(false && "All rootName and rootDirectory combinations should have "
+                   "occurred above!");
+  return std::error_code();
+}
+
+std::error_code make_absolute(const Twine &current_directory,
+                              SmallVectorImpl<char> &path) {
+  return make_absolute(current_directory, path, true);
+}
+
+std::error_code make_absolute(SmallVectorImpl<char> &path) {
+  return make_absolute(Twine(), path, false);
+}
+
+bool exists(file_status status) {
+  return status_known(status) && status.type() != file_type::file_not_found;
+}
+
+bool status_known(file_status s) {
+  return s.type() != file_type::status_error;
+}
+
+bool is_directory(file_status status) {
+  return status.type() == file_type::directory_file;
+}
+
+std::error_code is_directory(const Twine &path, bool &result) {
+  file_status st;
+  if (std::error_code ec = status(path, st))
+    return ec;
+  result = is_directory(st);
+  return std::error_code();
+}
+
+bool is_regular_file(file_status status) {
+  return status.type() == file_type::regular_file;
+}
+
+std::error_code is_regular_file(const Twine &path, bool &result) {
+  file_status st;
+  if (std::error_code ec = status(path, st))
+    return ec;
+  result = is_regular_file(st);
+  return std::error_code();
+}
+
+bool is_other(file_status status) {
+  return exists(status) &&
+         !is_regular_file(status) &&
+         !is_directory(status);
+}
+
+std::error_code is_other(const Twine &Path, bool &Result) {
+  file_status FileStatus;
+  if (std::error_code EC = status(Path, FileStatus))
+    return EC;
+  Result = is_other(FileStatus);
+  return std::error_code();
+}
+
+void directory_entry::replace_filename(const Twine &filename, file_status st) {
+  SmallString<128> path = path::parent_path(Path);
+  path::append(path, filename);
+  Path = path.str();
+  Status = st;
+}
+
+std::error_code directory_entry::status(file_status &result) const {
+  return fs::status(Path, result);
+}
+
+} // end namespace fs
+} // end namespace sys
+} // end namespace llvm
+
+// Include the truly platform-specific parts.
+#ifdef _WIN32
+#include "Windows/Path.inc"
+#else
+#include "Unix/Path.inc"
+#endif
+
+namespace llvm {
+namespace sys {
+namespace path {
+
+bool user_cache_directory(SmallVectorImpl<char> &Result, const Twine &Path1,
+                          const Twine &Path2, const Twine &Path3) {
+  if (getUserCacheDir(Result)) {
+    append(Result, Path1, Path2, Path3);
+    return true;
+  }
+  return false;
+}
+
+} // end namespace path
+} // end namsspace sys
+} // end namespace llvm
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/SmallPtrSet.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/SmallPtrSet.cpp
new file mode 100644
index 0000000..6187f78
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/SmallPtrSet.cpp
@@ -0,0 +1,295 @@
+//===- llvm/ADT/SmallPtrSet.cpp - 'Normally small' pointer set ------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SmallPtrSet class.  See SmallPtrSet.h for an
+// overview of the algorithm.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/SmallPtrSet.h"
+#include "llvm/DenseMapInfo.h"
+#include "llvm/MathExtras.h"
+#include <algorithm>
+#include <cstdlib>
+
+using namespace llvm;
+
+void SmallPtrSetImplBase::shrink_and_clear() {
+  assert(!isSmall() && "Can't shrink a small set!");
+  free(CurArray);
+
+  // Reduce the number of buckets.
+  unsigned Size = size();
+  CurArraySize = Size > 16 ? 1 << (Log2_32_Ceil(Size) + 1) : 32;
+  NumNonEmpty = NumTombstones = 0;
+
+  // Install the new array.  Clear all the buckets to empty.
+  CurArray = (const void**)malloc(sizeof(void*) * CurArraySize);
+  assert(CurArray && "Failed to allocate memory?");
+  memset(CurArray, -1, CurArraySize*sizeof(void*));
+}
+
+std::pair<const void *const *, bool>
+SmallPtrSetImplBase::insert_imp_big(const void *Ptr) {
+  if (LLVM_UNLIKELY(size() * 4 >= CurArraySize * 3)) {
+    // If more than 3/4 of the array is full, grow.
+    Grow(CurArraySize < 64 ? 128 : CurArraySize * 2);
+  } else if (LLVM_UNLIKELY(CurArraySize - NumNonEmpty < CurArraySize / 8)) {
+    // If fewer of 1/8 of the array is empty (meaning that many are filled with
+    // tombstones), rehash.
+    Grow(CurArraySize);
+  }
+
+  // Okay, we know we have space.  Find a hash bucket.
+  const void **Bucket = const_cast<const void**>(FindBucketFor(Ptr));
+  if (*Bucket == Ptr)
+    return std::make_pair(Bucket, false); // Already inserted, good.
+
+  // Otherwise, insert it!
+  if (*Bucket == getTombstoneMarker())
+    --NumTombstones;
+  else
+    ++NumNonEmpty; // Track density.
+  *Bucket = Ptr;
+  return std::make_pair(Bucket, true);
+}
+
+bool SmallPtrSetImplBase::erase_imp(const void * Ptr) {
+  if (isSmall()) {
+    // Check to see if it is in the set.
+    for (const void **APtr = CurArray, **E = CurArray + NumNonEmpty; APtr != E;
+         ++APtr)
+      if (*APtr == Ptr) {
+        // If it is in the set, replace this element.
+        *APtr = getTombstoneMarker();
+        ++NumTombstones;
+        return true;
+      }
+
+    return false;
+  }
+
+  // Okay, we know we have space.  Find a hash bucket.
+  void **Bucket = const_cast<void**>(FindBucketFor(Ptr));
+  if (*Bucket != Ptr) return false;  // Not in the set?
+
+  // Set this as a tombstone.
+  *Bucket = getTombstoneMarker();
+  ++NumTombstones;
+  return true;
+}
+
+const void * const *SmallPtrSetImplBase::FindBucketFor(const void *Ptr) const {
+  unsigned Bucket = DenseMapInfo<void *>::getHashValue(Ptr) & (CurArraySize-1);
+  unsigned ArraySize = CurArraySize;
+  unsigned ProbeAmt = 1;
+  const void *const *Array = CurArray;
+  const void *const *Tombstone = nullptr;
+  while (1) {
+    // If we found an empty bucket, the pointer doesn't exist in the set.
+    // Return a tombstone if we've seen one so far, or the empty bucket if
+    // not.
+    if (LLVM_LIKELY(Array[Bucket] == getEmptyMarker()))
+      return Tombstone ? Tombstone : Array+Bucket;
+
+    // Found Ptr's bucket?
+    if (LLVM_LIKELY(Array[Bucket] == Ptr))
+      return Array+Bucket;
+
+    // If this is a tombstone, remember it.  If Ptr ends up not in the set, we
+    // prefer to return it than something that would require more probing.
+    if (Array[Bucket] == getTombstoneMarker() && !Tombstone)
+      Tombstone = Array+Bucket;  // Remember the first tombstone found.
+
+    // It's a hash collision or a tombstone. Reprobe.
+    Bucket = (Bucket + ProbeAmt++) & (ArraySize-1);
+  }
+}
+
+/// Grow - Allocate a larger backing store for the buckets and move it over.
+///
+void SmallPtrSetImplBase::Grow(unsigned NewSize) {
+  const void **OldBuckets = CurArray;
+  const void **OldEnd = EndPointer();
+  bool WasSmall = isSmall();
+
+  // Install the new array.  Clear all the buckets to empty.
+  CurArray = (const void**)malloc(sizeof(void*) * NewSize);
+  assert(CurArray && "Failed to allocate memory?");
+  CurArraySize = NewSize;
+  memset(CurArray, -1, NewSize*sizeof(void*));
+
+  // Copy over all valid entries.
+  for (const void **BucketPtr = OldBuckets; BucketPtr != OldEnd; ++BucketPtr) {
+    // Copy over the element if it is valid.
+    const void *Elt = *BucketPtr;
+    if (Elt != getTombstoneMarker() && Elt != getEmptyMarker())
+      *const_cast<void**>(FindBucketFor(Elt)) = const_cast<void*>(Elt);
+  }
+
+  if (!WasSmall)
+    free(OldBuckets);
+  NumNonEmpty -= NumTombstones;
+  NumTombstones = 0;
+}
+
+SmallPtrSetImplBase::SmallPtrSetImplBase(const void **SmallStorage,
+                                         const SmallPtrSetImplBase &that) {
+  SmallArray = SmallStorage;
+
+  // If we're becoming small, prepare to insert into our stack space
+  if (that.isSmall()) {
+    CurArray = SmallArray;
+  // Otherwise, allocate new heap space (unless we were the same size)
+  } else {
+    CurArray = (const void**)malloc(sizeof(void*) * that.CurArraySize);
+    assert(CurArray && "Failed to allocate memory?");
+  }
+
+  // Copy over the that array.
+  CopyHelper(that);
+}
+
+SmallPtrSetImplBase::SmallPtrSetImplBase(const void **SmallStorage,
+                                         unsigned SmallSize,
+                                         SmallPtrSetImplBase &&that) {
+  SmallArray = SmallStorage;
+  MoveHelper(SmallSize, std::move(that));
+}
+
+void SmallPtrSetImplBase::CopyFrom(const SmallPtrSetImplBase &RHS) {
+  assert(&RHS != this && "Self-copy should be handled by the caller.");
+
+  if (isSmall() && RHS.isSmall())
+    assert(CurArraySize == RHS.CurArraySize &&
+           "Cannot assign sets with different small sizes");
+
+  // If we're becoming small, prepare to insert into our stack space
+  if (RHS.isSmall()) {
+    if (!isSmall())
+      free(CurArray);
+    CurArray = SmallArray;
+  // Otherwise, allocate new heap space (unless we were the same size)
+  } else if (CurArraySize != RHS.CurArraySize) {
+    if (isSmall())
+      CurArray = (const void**)malloc(sizeof(void*) * RHS.CurArraySize);
+    else {
+      const void **T = (const void**)realloc(CurArray,
+                                             sizeof(void*) * RHS.CurArraySize);
+      if (!T)
+        free(CurArray);
+      CurArray = T;
+    }
+    assert(CurArray && "Failed to allocate memory?");
+  }
+
+  CopyHelper(RHS);
+}
+
+void SmallPtrSetImplBase::CopyHelper(const SmallPtrSetImplBase &RHS) {
+  // Copy over the new array size
+  CurArraySize = RHS.CurArraySize;
+
+  // Copy over the contents from the other set
+  std::copy(RHS.CurArray, RHS.EndPointer(), CurArray);
+
+  NumNonEmpty = RHS.NumNonEmpty;
+  NumTombstones = RHS.NumTombstones;
+}
+
+void SmallPtrSetImplBase::MoveFrom(unsigned SmallSize,
+                                   SmallPtrSetImplBase &&RHS) {
+  if (!isSmall())
+    free(CurArray);
+  MoveHelper(SmallSize, std::move(RHS));
+}
+
+void SmallPtrSetImplBase::MoveHelper(unsigned SmallSize,
+                                     SmallPtrSetImplBase &&RHS) {
+  assert(&RHS != this && "Self-move should be handled by the caller.");
+
+  if (RHS.isSmall()) {
+    // Copy a small RHS rather than moving.
+    CurArray = SmallArray;
+    std::copy(RHS.CurArray, RHS.CurArray + RHS.NumNonEmpty, CurArray);
+  } else {
+    CurArray = RHS.CurArray;
+    RHS.CurArray = RHS.SmallArray;
+  }
+
+  // Copy the rest of the trivial members.
+  CurArraySize = RHS.CurArraySize;
+  NumNonEmpty = RHS.NumNonEmpty;
+  NumTombstones = RHS.NumTombstones;
+
+  // Make the RHS small and empty.
+  RHS.CurArraySize = SmallSize;
+  assert(RHS.CurArray == RHS.SmallArray);
+  RHS.NumNonEmpty = 0;
+  RHS.NumTombstones = 0;
+}
+
+void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
+  if (this == &RHS) return;
+
+  // We can only avoid copying elements if neither set is small.
+  if (!this->isSmall() && !RHS.isSmall()) {
+    std::swap(this->CurArray, RHS.CurArray);
+    std::swap(this->CurArraySize, RHS.CurArraySize);
+    std::swap(this->NumNonEmpty, RHS.NumNonEmpty);
+    std::swap(this->NumTombstones, RHS.NumTombstones);
+    return;
+  }
+
+  // FIXME: From here on we assume that both sets have the same small size.
+
+  // If only RHS is small, copy the small elements into LHS and move the pointer
+  // from LHS to RHS.
+  if (!this->isSmall() && RHS.isSmall()) {
+    assert(RHS.CurArray == RHS.SmallArray);
+    std::copy(RHS.CurArray, RHS.CurArray + RHS.NumNonEmpty, this->SmallArray);
+    std::swap(RHS.CurArraySize, this->CurArraySize);
+    std::swap(this->NumNonEmpty, RHS.NumNonEmpty);
+    std::swap(this->NumTombstones, RHS.NumTombstones);
+    RHS.CurArray = this->CurArray;
+    this->CurArray = this->SmallArray;
+    return;
+  }
+
+  // If only LHS is small, copy the small elements into RHS and move the pointer
+  // from RHS to LHS.
+  if (this->isSmall() && !RHS.isSmall()) {
+    assert(this->CurArray == this->SmallArray);
+    std::copy(this->CurArray, this->CurArray + this->NumNonEmpty,
+              RHS.SmallArray);
+    std::swap(RHS.CurArraySize, this->CurArraySize);
+    std::swap(RHS.NumNonEmpty, this->NumNonEmpty);
+    std::swap(RHS.NumTombstones, this->NumTombstones);
+    this->CurArray = RHS.CurArray;
+    RHS.CurArray = RHS.SmallArray;
+    return;
+  }
+
+  // Both a small, just swap the small elements.
+  assert(this->isSmall() && RHS.isSmall());
+  unsigned MinNonEmpty = std::min(this->NumNonEmpty, RHS.NumNonEmpty);
+  std::swap_ranges(this->SmallArray, this->SmallArray + MinNonEmpty,
+                   RHS.SmallArray);
+  if (this->NumNonEmpty > MinNonEmpty) {
+    std::copy(this->SmallArray + MinNonEmpty,
+              this->SmallArray + this->NumNonEmpty,
+              RHS.SmallArray + MinNonEmpty);
+  } else {
+    std::copy(RHS.SmallArray + MinNonEmpty, RHS.SmallArray + RHS.NumNonEmpty,
+              this->SmallArray + MinNonEmpty);
+  }
+  assert(this->CurArraySize == RHS.CurArraySize);
+  std::swap(this->NumNonEmpty, RHS.NumNonEmpty);
+  std::swap(this->NumTombstones, RHS.NumTombstones);
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/SmallVector.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/SmallVector.cpp
new file mode 100644
index 0000000..6aa709e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/SmallVector.cpp
@@ -0,0 +1,41 @@
+//===- llvm/ADT/SmallVector.cpp - 'Normally small' vectors ----------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the SmallVector class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/SmallVector.h"
+using namespace llvm;
+
+/// grow_pod - This is an implementation of the grow() method which only works
+/// on POD-like datatypes and is out of line to reduce code duplication.
+void SmallVectorBase::grow_pod(void *FirstEl, size_t MinSizeInBytes,
+                               size_t TSize) {
+  size_t CurSizeBytes = size_in_bytes();
+  size_t NewCapacityInBytes = 2 * capacity_in_bytes() + TSize; // Always grow.
+  if (NewCapacityInBytes < MinSizeInBytes)
+    NewCapacityInBytes = MinSizeInBytes;
+
+  void *NewElts;
+  if (BeginX == FirstEl) {
+    NewElts = malloc(NewCapacityInBytes);
+
+    // Copy the elements over.  No need to run dtors on PODs.
+    memcpy(NewElts, this->BeginX, CurSizeBytes);
+  } else {
+    // If this wasn't grown from the inline copy, grow the allocated space.
+    NewElts = realloc(this->BeginX, NewCapacityInBytes);
+  }
+  assert(NewElts && "Out of memory");
+
+  this->EndX = (char*)NewElts+CurSizeBytes;
+  this->BeginX = NewElts;
+  this->CapacityX = (char*)this->BeginX + NewCapacityInBytes;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringExtras.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringExtras.cpp
new file mode 100644
index 0000000..74b47a5
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringExtras.cpp
@@ -0,0 +1,58 @@
+//===-- StringExtras.cpp - Implement the StringExtras header --------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the StringExtras.h header
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/StringExtras.h"
+#include "llvm/SmallVector.h"
+using namespace llvm;
+
+/// StrInStrNoCase - Portable version of strcasestr.  Locates the first
+/// occurrence of string 's1' in string 's2', ignoring case.  Returns
+/// the offset of s2 in s1 or npos if s2 cannot be found.
+StringRef::size_type llvm::StrInStrNoCase(StringRef s1, StringRef s2) {
+  size_t N = s2.size(), M = s1.size();
+  if (N > M)
+    return StringRef::npos;
+  for (size_t i = 0, e = M - N + 1; i != e; ++i)
+    if (s1.substr(i, N).equals_lower(s2))
+      return i;
+  return StringRef::npos;
+}
+
+/// getToken - This function extracts one token from source, ignoring any
+/// leading characters that appear in the Delimiters string, and ending the
+/// token at any of the characters that appear in the Delimiters string.  If
+/// there are no tokens in the source string, an empty string is returned.
+/// The function returns a pair containing the extracted token and the
+/// remaining tail string.
+std::pair<StringRef, StringRef> llvm::getToken(StringRef Source,
+                                               StringRef Delimiters) {
+  // Figure out where the token starts.
+  StringRef::size_type Start = Source.find_first_not_of(Delimiters);
+
+  // Find the next occurrence of the delimiter.
+  StringRef::size_type End = Source.find_first_of(Delimiters, Start);
+
+  return std::make_pair(Source.slice(Start, End), Source.substr(End));
+}
+
+/// SplitString - Split up the specified string according to the specified
+/// delimiters, appending the result fragments to the output list.
+void llvm::SplitString(StringRef Source,
+                       SmallVectorImpl<StringRef> &OutFragments,
+                       StringRef Delimiters) {
+  std::pair<StringRef, StringRef> S = getToken(Source, Delimiters);
+  while (!S.first.empty()) {
+    OutFragments.push_back(S.first);
+    S = getToken(S.second, Delimiters);
+  }
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringMap.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringMap.cpp
new file mode 100644
index 0000000..032c368
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringMap.cpp
@@ -0,0 +1,260 @@
+//===--- StringMap.cpp - String Hash table map implementation -------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the StringMap class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/StringMap.h"
+#include "llvm/MathExtras.h"
+#include "llvm/StringExtras.h"
+#include "llvm/Compiler.h"
+#include <cassert>
+using namespace llvm;
+
+/// Returns the number of buckets to allocate to ensure that the DenseMap can
+/// accommodate \p NumEntries without need to grow().
+static unsigned getMinBucketToReserveForEntries(unsigned NumEntries) {
+  // Ensure that "NumEntries * 4 < NumBuckets * 3"
+  if (NumEntries == 0)
+    return 0;
+  // +1 is required because of the strict equality.
+  // For example if NumEntries is 48, we need to return 401.
+  return NextPowerOf2(NumEntries * 4 / 3 + 1);
+}
+
+StringMapImpl::StringMapImpl(unsigned InitSize, unsigned itemSize) {
+  ItemSize = itemSize;
+
+  // If a size is specified, initialize the table with that many buckets.
+  if (InitSize) {
+    // The table will grow when the number of entries reach 3/4 of the number of
+    // buckets. To guarantee that "InitSize" number of entries can be inserted
+    // in the table without growing, we allocate just what is needed here.
+    init(getMinBucketToReserveForEntries(InitSize));
+    return;
+  }
+
+  // Otherwise, initialize it with zero buckets to avoid the allocation.
+  TheTable = nullptr;
+  NumBuckets = 0;
+  NumItems = 0;
+  NumTombstones = 0;
+}
+
+void StringMapImpl::init(unsigned InitSize) {
+  assert((InitSize & (InitSize-1)) == 0 &&
+         "Init Size must be a power of 2 or zero!");
+  NumBuckets = InitSize ? InitSize : 16;
+  NumItems = 0;
+  NumTombstones = 0;
+
+  TheTable = (StringMapEntryBase **)calloc(NumBuckets+1,
+                                           sizeof(StringMapEntryBase **) +
+                                           sizeof(unsigned));
+
+  // Allocate one extra bucket, set it to look filled so the iterators stop at
+  // end.
+  TheTable[NumBuckets] = (StringMapEntryBase*)2;
+}
+
+
+/// LookupBucketFor - Look up the bucket that the specified string should end
+/// up in.  If it already exists as a key in the map, the Item pointer for the
+/// specified bucket will be non-null.  Otherwise, it will be null.  In either
+/// case, the FullHashValue field of the bucket will be set to the hash value
+/// of the string.
+unsigned StringMapImpl::LookupBucketFor(StringRef Name) {
+  unsigned HTSize = NumBuckets;
+  if (HTSize == 0) {  // Hash table unallocated so far?
+    init(16);
+    HTSize = NumBuckets;
+  }
+  unsigned FullHashValue = HashString(Name);
+  unsigned BucketNo = FullHashValue & (HTSize-1);
+  unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);
+
+  unsigned ProbeAmt = 1;
+  int FirstTombstone = -1;
+  while (1) {
+    StringMapEntryBase *BucketItem = TheTable[BucketNo];
+    // If we found an empty bucket, this key isn't in the table yet, return it.
+    if (LLVM_LIKELY(!BucketItem)) {
+      // If we found a tombstone, we want to reuse the tombstone instead of an
+      // empty bucket.  This reduces probing.
+      if (FirstTombstone != -1) {
+        HashTable[FirstTombstone] = FullHashValue;
+        return FirstTombstone;
+      }
+
+      HashTable[BucketNo] = FullHashValue;
+      return BucketNo;
+    }
+
+    if (BucketItem == getTombstoneVal()) {
+      // Skip over tombstones.  However, remember the first one we see.
+      if (FirstTombstone == -1) FirstTombstone = BucketNo;
+    } else if (LLVM_LIKELY(HashTable[BucketNo] == FullHashValue)) {
+      // If the full hash value matches, check deeply for a match.  The common
+      // case here is that we are only looking at the buckets (for item info
+      // being non-null and for the full hash value) not at the items.  This
+      // is important for cache locality.
+
+      // Do the comparison like this because Name isn't necessarily
+      // null-terminated!
+      char *ItemStr = (char*)BucketItem+ItemSize;
+      if (Name == StringRef(ItemStr, BucketItem->getKeyLength())) {
+        // We found a match!
+        return BucketNo;
+      }
+    }
+
+    // Okay, we didn't find the item.  Probe to the next bucket.
+    BucketNo = (BucketNo+ProbeAmt) & (HTSize-1);
+
+    // Use quadratic probing, it has fewer clumping artifacts than linear
+    // probing and has good cache behavior in the common case.
+    ++ProbeAmt;
+  }
+}
+
+
+/// FindKey - Look up the bucket that contains the specified key. If it exists
+/// in the map, return the bucket number of the key.  Otherwise return -1.
+/// This does not modify the map.
+int StringMapImpl::FindKey(StringRef Key) const {
+  unsigned HTSize = NumBuckets;
+  if (HTSize == 0) return -1;  // Really empty table?
+  unsigned FullHashValue = HashString(Key);
+  unsigned BucketNo = FullHashValue & (HTSize-1);
+  unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);
+
+  unsigned ProbeAmt = 1;
+  while (1) {
+    StringMapEntryBase *BucketItem = TheTable[BucketNo];
+    // If we found an empty bucket, this key isn't in the table yet, return.
+    if (LLVM_LIKELY(!BucketItem))
+      return -1;
+
+    if (BucketItem == getTombstoneVal()) {
+      // Ignore tombstones.
+    } else if (LLVM_LIKELY(HashTable[BucketNo] == FullHashValue)) {
+      // If the full hash value matches, check deeply for a match.  The common
+      // case here is that we are only looking at the buckets (for item info
+      // being non-null and for the full hash value) not at the items.  This
+      // is important for cache locality.
+
+      // Do the comparison like this because NameStart isn't necessarily
+      // null-terminated!
+      char *ItemStr = (char*)BucketItem+ItemSize;
+      if (Key == StringRef(ItemStr, BucketItem->getKeyLength())) {
+        // We found a match!
+        return BucketNo;
+      }
+    }
+
+    // Okay, we didn't find the item.  Probe to the next bucket.
+    BucketNo = (BucketNo+ProbeAmt) & (HTSize-1);
+
+    // Use quadratic probing, it has fewer clumping artifacts than linear
+    // probing and has good cache behavior in the common case.
+    ++ProbeAmt;
+  }
+}
+
+/// RemoveKey - Remove the specified StringMapEntry from the table, but do not
+/// delete it.  This aborts if the value isn't in the table.
+void StringMapImpl::RemoveKey(StringMapEntryBase *V) {
+  const char *VStr = (char*)V + ItemSize;
+  StringMapEntryBase *V2 = RemoveKey(StringRef(VStr, V->getKeyLength()));
+  (void)V2;
+  assert(V == V2 && "Didn't find key?");
+}
+
+/// RemoveKey - Remove the StringMapEntry for the specified key from the
+/// table, returning it.  If the key is not in the table, this returns null.
+StringMapEntryBase *StringMapImpl::RemoveKey(StringRef Key) {
+  int Bucket = FindKey(Key);
+  if (Bucket == -1) return nullptr;
+
+  StringMapEntryBase *Result = TheTable[Bucket];
+  TheTable[Bucket] = getTombstoneVal();
+  --NumItems;
+  ++NumTombstones;
+  assert(NumItems + NumTombstones <= NumBuckets);
+
+  return Result;
+}
+
+
+
+/// RehashTable - Grow the table, redistributing values into the buckets with
+/// the appropriate mod-of-hashtable-size.
+unsigned StringMapImpl::RehashTable(unsigned BucketNo) {
+  unsigned NewSize;
+  unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1);
+
+  // If the hash table is now more than 3/4 full, or if fewer than 1/8 of
+  // the buckets are empty (meaning that many are filled with tombstones),
+  // grow/rehash the table.
+  if (LLVM_UNLIKELY(NumItems * 4 > NumBuckets * 3)) {
+    NewSize = NumBuckets*2;
+  } else if (LLVM_UNLIKELY(NumBuckets - (NumItems + NumTombstones) <=
+                           NumBuckets / 8)) {
+    NewSize = NumBuckets;
+  } else {
+    return BucketNo;
+  }
+
+  unsigned NewBucketNo = BucketNo;
+  // Allocate one extra bucket which will always be non-empty.  This allows the
+  // iterators to stop at end.
+  StringMapEntryBase **NewTableArray =
+    (StringMapEntryBase **)calloc(NewSize+1, sizeof(StringMapEntryBase *) +
+                                             sizeof(unsigned));
+  unsigned *NewHashArray = (unsigned *)(NewTableArray + NewSize + 1);
+  NewTableArray[NewSize] = (StringMapEntryBase*)2;
+
+  // Rehash all the items into their new buckets.  Luckily :) we already have
+  // the hash values available, so we don't have to rehash any strings.
+  for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+    StringMapEntryBase *Bucket = TheTable[I];
+    if (Bucket && Bucket != getTombstoneVal()) {
+      // Fast case, bucket available.
+      unsigned FullHash = HashTable[I];
+      unsigned NewBucket = FullHash & (NewSize-1);
+      if (!NewTableArray[NewBucket]) {
+        NewTableArray[FullHash & (NewSize-1)] = Bucket;
+        NewHashArray[FullHash & (NewSize-1)] = FullHash;
+        if (I == BucketNo)
+          NewBucketNo = NewBucket;
+        continue;
+      }
+
+      // Otherwise probe for a spot.
+      unsigned ProbeSize = 1;
+      do {
+        NewBucket = (NewBucket + ProbeSize++) & (NewSize-1);
+      } while (NewTableArray[NewBucket]);
+
+      // Finally found a slot.  Fill it in.
+      NewTableArray[NewBucket] = Bucket;
+      NewHashArray[NewBucket] = FullHash;
+      if (I == BucketNo)
+        NewBucketNo = NewBucket;
+    }
+  }
+
+  free(TheTable);
+
+  TheTable = NewTableArray;
+  NumBuckets = NewSize;
+  NumTombstones = 0;
+  return NewBucketNo;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringRef.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringRef.cpp
new file mode 100644
index 0000000..c254ae3
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/StringRef.cpp
@@ -0,0 +1,452 @@
+//===-- StringRef.cpp - Lightweight String References ---------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/StringRef.h"
+#include "llvm/Hashing.h"
+#include "llvm/SmallVector.h"
+#include <bitset>
+#include <climits>
+
+using namespace llvm;
+
+// MSVC emits references to this into the translation units which reference it.
+#ifndef _MSC_VER
+const size_t StringRef::npos;
+#endif
+
+static char ascii_tolower(char x) {
+  if (x >= 'A' && x <= 'Z')
+    return x - 'A' + 'a';
+  return x;
+}
+
+static char ascii_toupper(char x) {
+  if (x >= 'a' && x <= 'z')
+    return x - 'a' + 'A';
+  return x;
+}
+
+static bool ascii_isdigit(char x) {
+  return x >= '0' && x <= '9';
+}
+
+// strncasecmp() is not available on non-POSIX systems, so define an
+// alternative function here.
+static int ascii_strncasecmp(const char *LHS, const char *RHS, size_t Length) {
+  for (size_t I = 0; I < Length; ++I) {
+    unsigned char LHC = ascii_tolower(LHS[I]);
+    unsigned char RHC = ascii_tolower(RHS[I]);
+    if (LHC != RHC)
+      return LHC < RHC ? -1 : 1;
+  }
+  return 0;
+}
+
+/// compare_lower - Compare strings, ignoring case.
+int StringRef::compare_lower(StringRef RHS) const {
+  if (int Res = ascii_strncasecmp(Data, RHS.Data, std::min(size(), RHS.size())))
+    return Res;
+  if (size() == RHS.size())
+    return 0;
+  return size() < RHS.size() ? -1 : 1;
+}
+
+/// Check if this string starts with the given \p Prefix, ignoring case.
+bool StringRef::startswith_lower(StringRef Prefix) const {
+  return size() >= Prefix.size() &&
+      ascii_strncasecmp(Data, Prefix.Data, Prefix.size()) == 0;
+}
+
+/// Check if this string ends with the given \p Suffix, ignoring case.
+bool StringRef::endswith_lower(StringRef Suffix) const {
+  return size() >= Suffix.size() &&
+      ascii_strncasecmp(end() - Suffix.size(), Suffix.Data, Suffix.size()) == 0;
+}
+
+/// compare_numeric - Compare strings, handle embedded numbers.
+int StringRef::compare_numeric(StringRef RHS) const {
+  for (size_t I = 0, E = std::min(size(), RHS.size()); I != E; ++I) {
+    // Check for sequences of digits.
+    if (ascii_isdigit(Data[I]) && ascii_isdigit(RHS.Data[I])) {
+      // The longer sequence of numbers is considered larger.
+      // This doesn't really handle prefixed zeros well.
+      size_t J;
+      for (J = I + 1; J != E + 1; ++J) {
+        bool ld = J < size() && ascii_isdigit(Data[J]);
+        bool rd = J < RHS.size() && ascii_isdigit(RHS.Data[J]);
+        if (ld != rd)
+          return rd ? -1 : 1;
+        if (!rd)
+          break;
+      }
+      // The two number sequences have the same length (J-I), just memcmp them.
+      if (int Res = compareMemory(Data + I, RHS.Data + I, J - I))
+        return Res < 0 ? -1 : 1;
+      // Identical number sequences, continue search after the numbers.
+      I = J - 1;
+      continue;
+    }
+    if (Data[I] != RHS.Data[I])
+      return (unsigned char)Data[I] < (unsigned char)RHS.Data[I] ? -1 : 1;
+  }
+  if (size() == RHS.size())
+    return 0;
+  return size() < RHS.size() ? -1 : 1;
+}
+
+//===----------------------------------------------------------------------===//
+// String Operations
+//===----------------------------------------------------------------------===//
+
+std::string StringRef::lower() const {
+  std::string Result(size(), char());
+  for (size_type i = 0, e = size(); i != e; ++i) {
+    Result[i] = ascii_tolower(Data[i]);
+  }
+  return Result;
+}
+
+std::string StringRef::upper() const {
+  std::string Result(size(), char());
+  for (size_type i = 0, e = size(); i != e; ++i) {
+    Result[i] = ascii_toupper(Data[i]);
+  }
+  return Result;
+}
+
+const char *StringRef::c_str(llvm::SmallVectorImpl<char>& buf) const {
+  if (is_null_terminated()) {
+    // If null terminated, return data directly
+    return data();
+  } else {
+    // If not null terminated, use SmallVectorImpl to store data
+    // copy data, and return a known null terminated string
+    buf.clear();
+    buf.append(begin(), end());
+    buf.push_back(0);
+    return buf.begin();
+  }
+}
+
+//===----------------------------------------------------------------------===//
+// String Searching
+//===----------------------------------------------------------------------===//
+
+
+/// find - Search for the first string \arg Str in the string.
+///
+/// \return - The index of the first occurrence of \arg Str, or npos if not
+/// found.
+size_t StringRef::find(StringRef Str, size_t From) const {
+  if (From > size())
+    return npos;
+
+  const char *Needle = Str.data();
+  size_t N = Str.size();
+  if (N == 0)
+    return From;
+
+  size_t Size = size() - From;
+  if (Size < N)
+    return npos;
+
+  const char *Start = Data + From;
+  const char *Stop = Start + (Size - N + 1);
+
+  // For short haystacks or unsupported needles fall back to the naive algorithm
+  if (Size < 16 || N > 255) {
+    do {
+      if (std::memcmp(Start, Needle, N) == 0)
+        return Start - Data;
+      ++Start;
+    } while (Start < Stop);
+    return npos;
+  }
+
+  // Build the bad char heuristic table, with uint8_t to reduce cache thrashing.
+  uint8_t BadCharSkip[256];
+  std::memset(BadCharSkip, N, 256);
+  for (unsigned i = 0; i != N-1; ++i)
+    BadCharSkip[(uint8_t)Str[i]] = N-1-i;
+
+  do {
+    if (std::memcmp(Start, Needle, N) == 0)
+      return Start - Data;
+
+    // Otherwise skip the appropriate number of bytes.
+    Start += BadCharSkip[(uint8_t)Start[N-1]];
+  } while (Start < Stop);
+
+  return npos;
+}
+
+/// rfind - Search for the last string \arg Str in the string.
+///
+/// \return - The index of the last occurrence of \arg Str, or npos if not
+/// found.
+size_t StringRef::rfind(StringRef Str) const {
+  size_t N = Str.size();
+  if (N > size())
+    return npos;
+  for (size_t i = size() - N + 1, e = 0; i != e;) {
+    --i;
+    if (substr(i, N).equals(Str))
+      return i;
+  }
+  return npos;
+}
+
+/// find_first_of - Find the first character in the string that is in \arg
+/// Chars, or npos if not found.
+///
+/// Note: O(size() + Chars.size())
+StringRef::size_type StringRef::find_first_of(StringRef Chars,
+                                              size_t From) const {
+  std::bitset<1 << CHAR_BIT> CharBits;
+  for (size_type i = 0; i != Chars.size(); ++i)
+    CharBits.set((unsigned char)Chars[i]);
+
+  for (size_type i = std::min(From, size()), e = size(); i != e; ++i)
+    if (CharBits.test((unsigned char)Data[i]))
+      return i;
+  return npos;
+}
+
+/// find_first_not_of - Find the first character in the string that is not
+/// \arg C or npos if not found.
+StringRef::size_type StringRef::find_first_not_of(char C, size_t From) const {
+  for (size_type i = std::min(From, size()), e = size(); i != e; ++i)
+    if (Data[i] != C)
+      return i;
+  return npos;
+}
+
+/// find_first_not_of - Find the first character in the string that is not
+/// in the string \arg Chars, or npos if not found.
+///
+/// Note: O(size() + Chars.size())
+StringRef::size_type StringRef::find_first_not_of(StringRef Chars,
+                                                  size_t From) const {
+  std::bitset<1 << CHAR_BIT> CharBits;
+  for (size_type i = 0; i != Chars.size(); ++i)
+    CharBits.set((unsigned char)Chars[i]);
+
+  for (size_type i = std::min(From, size()), e = size(); i != e; ++i)
+    if (!CharBits.test((unsigned char)Data[i]))
+      return i;
+  return npos;
+}
+
+/// find_last_of - Find the last character in the string that is in \arg C,
+/// or npos if not found.
+///
+/// Note: O(size() + Chars.size())
+StringRef::size_type StringRef::find_last_of(StringRef Chars,
+                                             size_t From) const {
+  std::bitset<1 << CHAR_BIT> CharBits;
+  for (size_type i = 0; i != Chars.size(); ++i)
+    CharBits.set((unsigned char)Chars[i]);
+
+  for (size_type i = std::min(From, size()) - 1, e = -1; i != e; --i)
+    if (CharBits.test((unsigned char)Data[i]))
+      return i;
+  return npos;
+}
+
+/// find_last_not_of - Find the last character in the string that is not
+/// \arg C, or npos if not found.
+StringRef::size_type StringRef::find_last_not_of(char C, size_t From) const {
+  for (size_type i = std::min(From, size()) - 1, e = -1; i != e; --i)
+    if (Data[i] != C)
+      return i;
+  return npos;
+}
+
+/// find_last_not_of - Find the last character in the string that is not in
+/// \arg Chars, or npos if not found.
+///
+/// Note: O(size() + Chars.size())
+StringRef::size_type StringRef::find_last_not_of(StringRef Chars,
+                                                 size_t From) const {
+  std::bitset<1 << CHAR_BIT> CharBits;
+  for (size_type i = 0, e = Chars.size(); i != e; ++i)
+    CharBits.set((unsigned char)Chars[i]);
+
+  for (size_type i = std::min(From, size()) - 1, e = -1; i != e; --i)
+    if (!CharBits.test((unsigned char)Data[i]))
+      return i;
+  return npos;
+}
+
+void StringRef::split(SmallVectorImpl<StringRef> &A,
+                      StringRef Separator, int MaxSplit,
+                      bool KeepEmpty) const {
+  StringRef S = *this;
+
+  // Count down from MaxSplit. When MaxSplit is -1, this will just split
+  // "forever". This doesn't support splitting more than 2^31 times
+  // intentionally; if we ever want that we can make MaxSplit a 64-bit integer
+  // but that seems unlikely to be useful.
+  while (MaxSplit-- != 0) {
+    size_t Idx = S.find(Separator);
+    if (Idx == npos)
+      break;
+
+    // Push this split.
+    if (KeepEmpty || Idx > 0)
+      A.push_back(S.slice(0, Idx));
+
+    // Jump forward.
+    S = S.slice(Idx + Separator.size(), npos);
+  }
+
+  // Push the tail.
+  if (KeepEmpty || !S.empty())
+    A.push_back(S);
+}
+
+void StringRef::split(SmallVectorImpl<StringRef> &A, char Separator,
+                      int MaxSplit, bool KeepEmpty) const {
+  StringRef S = *this;
+
+  // Count down from MaxSplit. When MaxSplit is -1, this will just split
+  // "forever". This doesn't support splitting more than 2^31 times
+  // intentionally; if we ever want that we can make MaxSplit a 64-bit integer
+  // but that seems unlikely to be useful.
+  while (MaxSplit-- != 0) {
+    size_t Idx = S.find(Separator);
+    if (Idx == npos)
+      break;
+
+    // Push this split.
+    if (KeepEmpty || Idx > 0)
+      A.push_back(S.slice(0, Idx));
+
+    // Jump forward.
+    S = S.slice(Idx + 1, npos);
+  }
+
+  // Push the tail.
+  if (KeepEmpty || !S.empty())
+    A.push_back(S);
+}
+
+//===----------------------------------------------------------------------===//
+// Helpful Algorithms
+//===----------------------------------------------------------------------===//
+
+/// count - Return the number of non-overlapped occurrences of \arg Str in
+/// the string.
+size_t StringRef::count(StringRef Str) const {
+  size_t Count = 0;
+  size_t N = Str.size();
+  if (N > size())
+    return 0;
+  for (size_t i = 0, e = size() - N + 1; i != e; ++i)
+    if (substr(i, N).equals(Str))
+      ++Count;
+  return Count;
+}
+
+static unsigned GetAutoSenseRadix(StringRef &Str) {
+  if (Str.startswith("0x") || Str.startswith("0X")) {
+    Str = Str.substr(2);
+    return 16;
+  }
+
+  if (Str.startswith("0b") || Str.startswith("0B")) {
+    Str = Str.substr(2);
+    return 2;
+  }
+
+  if (Str.startswith("0o")) {
+    Str = Str.substr(2);
+    return 8;
+  }
+
+  if (Str.startswith("0"))
+    return 8;
+
+  return 10;
+}
+
+
+/// GetAsUnsignedInteger - Workhorse method that converts a integer character
+/// sequence of radix up to 36 to an unsigned long long value.
+bool llvm::getAsUnsignedInteger(StringRef Str, unsigned Radix,
+                                unsigned long long &Result) {
+  // Autosense radix if not specified.
+  if (Radix == 0)
+    Radix = GetAutoSenseRadix(Str);
+
+  // Empty strings (after the radix autosense) are invalid.
+  if (Str.empty()) return true;
+
+  // Parse all the bytes of the string given this radix.  Watch for overflow.
+  Result = 0;
+  while (!Str.empty()) {
+    unsigned CharVal;
+    if (Str[0] >= '0' && Str[0] <= '9')
+      CharVal = Str[0]-'0';
+    else if (Str[0] >= 'a' && Str[0] <= 'z')
+      CharVal = Str[0]-'a'+10;
+    else if (Str[0] >= 'A' && Str[0] <= 'Z')
+      CharVal = Str[0]-'A'+10;
+    else
+      return true;
+
+    // If the parsed value is larger than the integer radix, the string is
+    // invalid.
+    if (CharVal >= Radix)
+      return true;
+
+    // Add in this character.
+    unsigned long long PrevResult = Result;
+    Result = Result*Radix+CharVal;
+
+    // Check for overflow by shifting back and seeing if bits were lost.
+    if (Result/Radix < PrevResult)
+      return true;
+
+    Str = Str.substr(1);
+  }
+
+  return false;
+}
+
+bool llvm::getAsSignedInteger(StringRef Str, unsigned Radix,
+                              long long &Result) {
+  unsigned long long ULLVal;
+
+  // Handle positive strings first.
+  if (Str.empty() || Str.front() != '-') {
+    if (getAsUnsignedInteger(Str, Radix, ULLVal) ||
+        // Check for value so large it overflows a signed value.
+        (long long)ULLVal < 0)
+      return true;
+    Result = ULLVal;
+    return false;
+  }
+
+  // Get the positive part of the value.
+  if (getAsUnsignedInteger(Str.substr(1), Radix, ULLVal) ||
+      // Reject values so large they'd overflow as negative signed, but allow
+      // "-0".  This negates the unsigned so that the negative isn't undefined
+      // on signed overflow.
+      (long long)-ULLVal > 0)
+    return true;
+
+  Result = -ULLVal;
+  return false;
+}
+
+// Implementation of StringRef hashing.
+hash_code llvm::hash_value(StringRef S) {
+  return hash_combine_range(S.begin(), S.end());
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/Twine.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Twine.cpp
new file mode 100644
index 0000000..7d771d5
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Twine.cpp
@@ -0,0 +1,169 @@
+//===-- Twine.cpp - Fast Temporary String Concatenation -------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Twine.h"
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+using namespace llvm;
+
+std::string Twine::str() const {
+  // If we're storing only a std::string, just return it.
+  if (LHSKind == StdStringKind && RHSKind == EmptyKind)
+    return *LHS.stdString;
+
+  // Otherwise, flatten and copy the contents first.
+  SmallString<256> Vec;
+  return toStringRef(Vec).str();
+}
+
+void Twine::toVector(SmallVectorImpl<char> &Out) const {
+  raw_svector_ostream OS(Out);
+  print(OS);
+}
+
+StringRef Twine::toNullTerminatedStringRef(SmallVectorImpl<char> &Out) const {
+  if (isUnary()) {
+    switch (getLHSKind()) {
+    case CStringKind:
+      // Already null terminated, yay!
+      return StringRef(LHS.cString);
+    case StdStringKind: {
+      const std::string *str = LHS.stdString;
+      return StringRef(str->c_str(), str->size());
+    }
+    default:
+      break;
+    }
+  }
+  toVector(Out);
+  Out.push_back(0);
+  Out.pop_back();
+  return StringRef(Out.data(), Out.size());
+}
+
+void Twine::printOneChild(raw_ostream &OS, Child Ptr,
+                          NodeKind Kind) const {
+  switch (Kind) {
+  case Twine::NullKind: break;
+  case Twine::EmptyKind: break;
+  case Twine::TwineKind:
+    Ptr.twine->print(OS);
+    break;
+  case Twine::CStringKind:
+    OS << Ptr.cString;
+    break;
+  case Twine::StdStringKind:
+    OS << *Ptr.stdString;
+    break;
+  case Twine::StringRefKind:
+    OS << *Ptr.stringRef;
+    break;
+  case Twine::SmallStringKind:
+    OS << *Ptr.smallString;
+    break;
+  case Twine::CharKind:
+    OS << Ptr.character;
+    break;
+  case Twine::DecUIKind:
+    OS << Ptr.decUI;
+    break;
+  case Twine::DecIKind:
+    OS << Ptr.decI;
+    break;
+  case Twine::DecULKind:
+    OS << *Ptr.decUL;
+    break;
+  case Twine::DecLKind:
+    OS << *Ptr.decL;
+    break;
+  case Twine::DecULLKind:
+    OS << *Ptr.decULL;
+    break;
+  case Twine::DecLLKind:
+    OS << *Ptr.decLL;
+    break;
+  case Twine::UHexKind:
+    OS.write_hex(*Ptr.uHex);
+    break;
+  }
+}
+
+void Twine::printOneChildRepr(raw_ostream &OS, Child Ptr,
+                              NodeKind Kind) const {
+  switch (Kind) {
+  case Twine::NullKind:
+    OS << "null"; break;
+  case Twine::EmptyKind:
+    OS << "empty"; break;
+  case Twine::TwineKind:
+    OS << "rope:";
+    Ptr.twine->printRepr(OS);
+    break;
+  case Twine::CStringKind:
+    OS << "cstring:\""
+       << Ptr.cString << "\"";
+    break;
+  case Twine::StdStringKind:
+    OS << "std::string:\""
+       << Ptr.stdString << "\"";
+    break;
+  case Twine::StringRefKind:
+    OS << "stringref:\""
+       << Ptr.stringRef << "\"";
+    break;
+  case Twine::SmallStringKind:
+    OS << "smallstring:\"" << *Ptr.smallString << "\"";
+    break;
+  case Twine::CharKind:
+    OS << "char:\"" << Ptr.character << "\"";
+    break;
+  case Twine::DecUIKind:
+    OS << "decUI:\"" << Ptr.decUI << "\"";
+    break;
+  case Twine::DecIKind:
+    OS << "decI:\"" << Ptr.decI << "\"";
+    break;
+  case Twine::DecULKind:
+    OS << "decUL:\"" << *Ptr.decUL << "\"";
+    break;
+  case Twine::DecLKind:
+    OS << "decL:\"" << *Ptr.decL << "\"";
+    break;
+  case Twine::DecULLKind:
+    OS << "decULL:\"" << *Ptr.decULL << "\"";
+    break;
+  case Twine::DecLLKind:
+    OS << "decLL:\"" << *Ptr.decLL << "\"";
+    break;
+  case Twine::UHexKind:
+    OS << "uhex:\"" << Ptr.uHex << "\"";
+    break;
+  }
+}
+
+void Twine::print(raw_ostream &OS) const {
+  printOneChild(OS, LHS, getLHSKind());
+  printOneChild(OS, RHS, getRHSKind());
+}
+
+void Twine::printRepr(raw_ostream &OS) const {
+  OS << "(Twine ";
+  printOneChildRepr(OS, LHS, getLHSKind());
+  OS << " ";
+  printOneChildRepr(OS, RHS, getRHSKind());
+  OS << ")";
+}
+
+void Twine::dump() const {
+  print(errs());
+}
+
+void Twine::dumpRepr() const {
+  printRepr(errs());
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/Unix/Path.inc b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Unix/Path.inc
new file mode 100644
index 0000000..b1bf52d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Unix/Path.inc
@@ -0,0 +1,390 @@
+//===- llvm/Support/Unix/Path.inc - Unix Path Implementation ----*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the Unix specific implementation of the Path API.
+//
+//===----------------------------------------------------------------------===//
+
+//===----------------------------------------------------------------------===//
+//=== WARNING: Implementation here must contain only generic UNIX code that
+//===          is guaranteed to work on *all* UNIX variants.
+//===----------------------------------------------------------------------===//
+
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <dirent.h>
+#define NAMLEN(dirent) strlen((dirent)->d_name)
+#include <sys/param.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+namespace llvm {
+namespace sys  {
+namespace fs {
+UniqueID file_status::getUniqueID() const {
+  return UniqueID(fs_st_dev, fs_st_ino);
+}
+
+std::error_code current_path(SmallVectorImpl<char> &result) {
+  result.clear();
+
+  const char *pwd = ::getenv("PWD");
+  llvm::sys::fs::file_status PWDStatus, DotStatus;
+  if (pwd && llvm::sys::path::is_absolute(pwd) &&
+      !llvm::sys::fs::status(pwd, PWDStatus) &&
+      !llvm::sys::fs::status(".", DotStatus) &&
+      PWDStatus.getUniqueID() == DotStatus.getUniqueID()) {
+    result.append(pwd, pwd + strlen(pwd));
+    return std::error_code();
+  }
+
+#ifdef MAXPATHLEN
+  result.reserve(MAXPATHLEN);
+#else
+  result.reserve(1024);
+#endif
+
+  while (true) {
+    if (::getcwd(result.data(), result.capacity()) == nullptr) {
+      // See if there was a real error.
+      if (errno != ENOMEM)
+        return std::error_code(errno, std::generic_category());
+      // Otherwise there just wasn't enough space.
+      result.reserve(result.capacity() * 2);
+    } else
+      break;
+  }
+
+  result.set_size(strlen(result.data()));
+  return std::error_code();
+}
+
+static int convertAccessMode(AccessMode Mode) {
+  switch (Mode) {
+  case AccessMode::Exist:
+    return F_OK;
+  case AccessMode::Write:
+    return W_OK;
+  case AccessMode::Execute:
+    return R_OK | X_OK; // scripts also need R_OK.
+  default:
+    return F_OK;
+  }
+}
+
+std::error_code access(const Twine &Path, AccessMode Mode) {
+  SmallString<128> PathStorage;
+  StringRef P = Path.toNullTerminatedStringRef(PathStorage);
+
+  if (::access(P.begin(), convertAccessMode(Mode)) == -1)
+    return std::error_code(errno, std::generic_category());
+
+  if (Mode == AccessMode::Execute) {
+    // Don't say that directories are executable.
+    struct stat buf;
+    if (0 != stat(P.begin(), &buf))
+      return std::make_error_code(std::errc::permission_denied);
+    if (!S_ISREG(buf.st_mode))
+      return std::make_error_code(std::errc::permission_denied);
+  }
+
+  return std::error_code();
+}
+
+bool equivalent(file_status A, file_status B) {
+  assert(status_known(A) && status_known(B));
+  return A.fs_st_dev == B.fs_st_dev &&
+         A.fs_st_ino == B.fs_st_ino;
+}
+
+std::error_code equivalent(const Twine &A, const Twine &B, bool &result) {
+  file_status fsA, fsB;
+  if (std::error_code ec = status(A, fsA))
+    return ec;
+  if (std::error_code ec = status(B, fsB))
+    return ec;
+  result = equivalent(fsA, fsB);
+  return std::error_code();
+}
+
+static std::error_code fillStatus(int StatRet, const struct stat &Status,
+                             file_status &Result) {
+  if (StatRet != 0) {
+    std::error_code ec(errno, std::generic_category());
+    if (ec == std::errc::no_such_file_or_directory)
+      Result = file_status(file_type::file_not_found);
+    else
+      Result = file_status(file_type::status_error);
+    return ec;
+  }
+
+  file_type Type = file_type::type_unknown;
+
+  if (S_ISDIR(Status.st_mode))
+    Type = file_type::directory_file;
+  else if (S_ISREG(Status.st_mode))
+    Type = file_type::regular_file;
+  else if (S_ISBLK(Status.st_mode))
+    Type = file_type::block_file;
+  else if (S_ISCHR(Status.st_mode))
+    Type = file_type::character_file;
+  else if (S_ISFIFO(Status.st_mode))
+    Type = file_type::fifo_file;
+  else if (S_ISSOCK(Status.st_mode))
+    Type = file_type::socket_file;
+  else if (S_ISLNK(Status.st_mode))
+    Type = file_type::symlink_file;
+
+  perms Perms = static_cast<perms>(Status.st_mode);
+  Result =
+      file_status(Type, Perms, Status.st_dev, Status.st_ino, Status.st_atime,
+                  Status.st_mtime, Status.st_uid, Status.st_gid,
+                  Status.st_size);
+
+  return std::error_code();
+}
+
+std::error_code status(const Twine &Path, file_status &Result) {
+  SmallString<128> PathStorage;
+  StringRef P = Path.toNullTerminatedStringRef(PathStorage);
+
+  struct stat Status;
+  int StatRet = ::lstat(P.begin(), &Status);
+  return fillStatus(StatRet, Status, Result);
+}
+
+std::error_code status(int FD, file_status &Result) {
+  struct stat Status;
+  int StatRet = ::fstat(FD, &Status);
+  return fillStatus(StatRet, Status, Result);
+}
+
+std::error_code detail::directory_iterator_construct(detail::DirIterState &it,
+                                                StringRef path){
+  SmallString<128> path_null(path);
+  DIR *directory = ::opendir(path_null.c_str());
+  if (!directory)
+    return std::error_code(errno, std::generic_category());
+
+  it.IterationHandle = reinterpret_cast<intptr_t>(directory);
+  // Add something for replace_filename to replace.
+  path::append(path_null, ".");
+  it.CurrentEntry = directory_entry(path_null.str());
+  return directory_iterator_increment(it);
+}
+
+std::error_code detail::directory_iterator_destruct(detail::DirIterState &it) {
+  if (it.IterationHandle)
+    ::closedir(reinterpret_cast<DIR *>(it.IterationHandle));
+  it.IterationHandle = 0;
+  it.CurrentEntry = directory_entry();
+  return std::error_code();
+}
+
+std::error_code detail::directory_iterator_increment(detail::DirIterState &it) {
+  errno = 0;
+  dirent *cur_dir = ::readdir(reinterpret_cast<DIR *>(it.IterationHandle));
+  if (cur_dir == nullptr && errno != 0) {
+    return std::error_code(errno, std::generic_category());
+  } else if (cur_dir != nullptr) {
+    StringRef name(cur_dir->d_name, NAMLEN(cur_dir));
+    if ((name.size() == 1 && name[0] == '.') ||
+        (name.size() == 2 && name[0] == '.' && name[1] == '.'))
+      return directory_iterator_increment(it);
+    it.CurrentEntry.replace_filename(name);
+  } else
+    return directory_iterator_destruct(it);
+
+  return std::error_code();
+}
+
+#if !defined(F_GETPATH)
+static bool hasProcSelfFD() {
+  // If we have a /proc filesystem mounted, we can quickly establish the
+  // real name of the file with readlink
+  static const bool Result = (::access("/proc/self/fd", R_OK) == 0);
+  return Result;
+}
+#endif
+
+std::error_code openFileForRead(const Twine &Name, int &ResultFD,
+                                SmallVectorImpl<char> *RealPath) {
+  SmallString<128> Storage;
+  StringRef P = Name.toNullTerminatedStringRef(Storage);
+  while ((ResultFD = open(P.begin(), O_RDONLY)) < 0) {
+    if (errno != EINTR)
+      return std::error_code(errno, std::generic_category());
+  }
+  // Attempt to get the real name of the file, if the user asked
+  if(!RealPath)
+    return std::error_code();
+  RealPath->clear();
+#if defined(F_GETPATH)
+  // When F_GETPATH is availble, it is the quickest way to get
+  // the real path name.
+  char Buffer[MAXPATHLEN];
+  if (::fcntl(ResultFD, F_GETPATH, Buffer) != -1)
+    RealPath->append(Buffer, Buffer + strlen(Buffer));
+#else
+  char Buffer[PATH_MAX];
+  if (hasProcSelfFD()) {
+    char ProcPath[64];
+    snprintf(ProcPath, sizeof(ProcPath), "/proc/self/fd/%d", ResultFD);
+    ssize_t CharCount = ::readlink(ProcPath, Buffer, sizeof(Buffer));
+    if (CharCount > 0)
+      RealPath->append(Buffer, Buffer + CharCount);
+  } else {
+    // Use ::realpath to get the real path name
+    if (::realpath(P.begin(), Buffer) != nullptr)
+      RealPath->append(Buffer, Buffer + strlen(Buffer));
+  }
+#endif
+  return std::error_code();
+}
+
+std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
+                                 OpenFlags Flags, unsigned Mode) {
+  // Verify that we don't have both "append" and "excl".
+  assert((!(Flags & F_Excl) || !(Flags & F_Append)) &&
+         "Cannot specify both 'excl' and 'append' file creation flags!");
+
+  int OpenFlags = O_CREAT;
+
+  if (Flags & F_RW)
+    OpenFlags |= O_RDWR;
+  else
+    OpenFlags |= O_WRONLY;
+
+  if (Flags & F_Append)
+    OpenFlags |= O_APPEND;
+  else
+    OpenFlags |= O_TRUNC;
+
+  if (Flags & F_Excl)
+    OpenFlags |= O_EXCL;
+
+  SmallString<128> Storage;
+  StringRef P = Name.toNullTerminatedStringRef(Storage);
+  while ((ResultFD = open(P.begin(), OpenFlags, Mode)) < 0) {
+    if (errno != EINTR)
+      return std::error_code(errno, std::generic_category());
+  }
+  return std::error_code();
+}
+
+} // end namespace fs
+
+namespace path {
+
+bool home_directory(SmallVectorImpl<char> &result) {
+  if (char *RequestedDir = std::getenv("HOME")) {
+    result.clear();
+    result.append(RequestedDir, RequestedDir + strlen(RequestedDir));
+    return true;
+  }
+
+  return false;
+}
+
+static bool getDarwinConfDir(bool TempDir, SmallVectorImpl<char> &Result) {
+  #if defined(_CS_DARWIN_USER_TEMP_DIR) && defined(_CS_DARWIN_USER_CACHE_DIR)
+  // On Darwin, use DARWIN_USER_TEMP_DIR or DARWIN_USER_CACHE_DIR.
+  // macros defined in <unistd.h> on darwin >= 9
+  int ConfName = TempDir ? _CS_DARWIN_USER_TEMP_DIR
+                         : _CS_DARWIN_USER_CACHE_DIR;
+  size_t ConfLen = confstr(ConfName, nullptr, 0);
+  if (ConfLen > 0) {
+    do {
+      Result.resize(ConfLen);
+      ConfLen = confstr(ConfName, Result.data(), Result.size());
+    } while (ConfLen > 0 && ConfLen != Result.size());
+
+    if (ConfLen > 0) {
+      assert(Result.back() == 0);
+      Result.pop_back();
+      return true;
+    }
+
+    Result.clear();
+  }
+  #endif
+  return false;
+}
+
+static bool getUserCacheDir(SmallVectorImpl<char> &Result) {
+  // First try using XDG_CACHE_HOME env variable,
+  // as specified in XDG Base Directory Specification at
+  // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+  if (const char *XdgCacheDir = std::getenv("XDG_CACHE_HOME")) {
+    Result.clear();
+    Result.append(XdgCacheDir, XdgCacheDir + strlen(XdgCacheDir));
+    return true;
+  }
+
+  // Try Darwin configuration query
+  if (getDarwinConfDir(false, Result))
+    return true;
+
+  // Use "$HOME/.cache" if $HOME is available
+  if (home_directory(Result)) {
+    append(Result, ".cache");
+    return true;
+  }
+
+  return false;
+}
+
+static const char *getEnvTempDir() {
+  // Check whether the temporary directory is specified by an environment
+  // variable.
+  const char *EnvironmentVariables[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR"};
+  for (const char *Env : EnvironmentVariables) {
+    if (const char *Dir = std::getenv(Env))
+      return Dir;
+  }
+
+  return nullptr;
+}
+
+static const char *getDefaultTempDir(bool ErasedOnReboot) {
+#ifdef P_tmpdir
+  if ((bool)P_tmpdir)
+    return P_tmpdir;
+#endif
+
+  if (ErasedOnReboot)
+    return "/tmp";
+  return "/var/tmp";
+}
+
+void system_temp_directory(bool ErasedOnReboot, SmallVectorImpl<char> &Result) {
+  Result.clear();
+
+  if (ErasedOnReboot) {
+    // There is no env variable for the cache directory.
+    if (const char *RequestedDir = getEnvTempDir()) {
+      Result.append(RequestedDir, RequestedDir + strlen(RequestedDir));
+      return;
+    }
+  }
+
+  if (getDarwinConfDir(ErasedOnReboot, Result))
+    return;
+
+  const char *RequestedDir = getDefaultTempDir(ErasedOnReboot);
+  Result.append(RequestedDir, RequestedDir + strlen(RequestedDir));
+}
+
+} // end namespace path
+} // end namespace sys
+} // end namespace llvm
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/Windows/Path.inc b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Windows/Path.inc
new file mode 100644
index 0000000..0c4a6fc
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Windows/Path.inc
@@ -0,0 +1,648 @@
+//===- llvm/Support/Windows/Path.inc - Windows Path Impl --------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the Windows specific implementation of the Path API.
+//
+//===----------------------------------------------------------------------===//
+
+//===----------------------------------------------------------------------===//
+//=== WARNING: Implementation here must contain only generic Windows code that
+//===          is guaranteed to work on *all* Windows variants.
+//===----------------------------------------------------------------------===//
+
+#include "llvm/STLExtras.h"
+#include "llvm/WindowsError.h"
+#include <fcntl.h>
+#include <io.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+// These two headers must be included last, and make sure shlobj is required
+// after Windows.h to make sure it picks up our definition of _WIN32_WINNT
+#include "WindowsSupport.h"
+#include <shlobj.h>
+
+#undef max
+
+#ifdef _MSC_VER
+# pragma comment(lib, "shell32.lib")
+# pragma comment(lib, "ole32.lib")
+#endif
+
+using namespace llvm;
+
+using llvm::sys::windows::UTF8ToUTF16;
+using llvm::sys::windows::UTF16ToUTF8;
+using llvm::sys::path::widenPath;
+
+static bool is_separator(const wchar_t value) {
+  switch (value) {
+  case L'\\':
+  case L'/':
+    return true;
+  default:
+    return false;
+  }
+}
+
+namespace llvm {
+namespace sys  {
+namespace path {
+
+// Convert a UTF-8 path to UTF-16.  Also, if the absolute equivalent of the
+// path is longer than CreateDirectory can tolerate, make it absolute and
+// prefixed by '\\?\'.
+std::error_code widenPath(const Twine &Path8,
+                          SmallVectorImpl<wchar_t> &Path16) {
+  const size_t MaxDirLen = MAX_PATH - 12; // Must leave room for 8.3 filename.
+
+  // Several operations would convert Path8 to SmallString; more efficient to
+  // do it once up front.
+  SmallString<128> Path8Str;
+  Path8.toVector(Path8Str);
+
+  // If we made this path absolute, how much longer would it get?
+  size_t CurPathLen;
+  if (llvm::sys::path::is_absolute(Twine(Path8Str)))
+    CurPathLen = 0; // No contribution from current_path needed.
+  else {
+    CurPathLen = ::GetCurrentDirectoryW(0, NULL);
+    if (CurPathLen == 0)
+      return mapWindowsError(::GetLastError());
+  }
+
+  // Would the absolute path be longer than our limit?
+  if ((Path8Str.size() + CurPathLen) >= MaxDirLen &&
+      !Path8Str.startswith("\\\\?\\")) {
+    SmallString<2*MAX_PATH> FullPath("\\\\?\\");
+    if (CurPathLen) {
+      SmallString<80> CurPath;
+      if (std::error_code EC = llvm::sys::fs::current_path(CurPath))
+        return EC;
+      FullPath.append(CurPath);
+    }
+    // Traverse the requested path, canonicalizing . and .. as we go (because
+    // the \\?\ prefix is documented to treat them as real components).
+    // The iterators don't report separators and append() always attaches
+    // preferred_separator so we don't need to call native() on the result.
+    for (llvm::sys::path::const_iterator I = llvm::sys::path::begin(Path8Str),
+                                         E = llvm::sys::path::end(Path8Str);
+                                         I != E; ++I) {
+      if (I->size() == 1 && *I == ".")
+        continue;
+      if (I->size() == 2 && *I == "..")
+        llvm::sys::path::remove_filename(FullPath);
+      else
+        llvm::sys::path::append(FullPath, *I);
+    }
+    return UTF8ToUTF16(FullPath, Path16);
+  }
+
+  // Just use the caller's original path.
+  return UTF8ToUTF16(Path8Str, Path16);
+}
+} // end namespace path
+
+namespace fs {
+
+UniqueID file_status::getUniqueID() const {
+  // The file is uniquely identified by the volume serial number along
+  // with the 64-bit file identifier.
+  uint64_t FileID = (static_cast<uint64_t>(FileIndexHigh) << 32ULL) |
+                    static_cast<uint64_t>(FileIndexLow);
+
+  return UniqueID(VolumeSerialNumber, FileID);
+}
+
+std::error_code current_path(SmallVectorImpl<char> &result) {
+  SmallVector<wchar_t, MAX_PATH> cur_path;
+  DWORD len = MAX_PATH;
+
+  do {
+    cur_path.reserve(len);
+    len = ::GetCurrentDirectoryW(cur_path.capacity(), cur_path.data());
+
+    // A zero return value indicates a failure other than insufficient space.
+    if (len == 0)
+      return mapWindowsError(::GetLastError());
+
+    // If there's insufficient space, the len returned is larger than the len
+    // given.
+  } while (len > cur_path.capacity());
+
+  // On success, GetCurrentDirectoryW returns the number of characters not
+  // including the null-terminator.
+  cur_path.set_size(len);
+  return UTF16ToUTF8(cur_path.begin(), cur_path.size(), result);
+}
+
+
+std::error_code access(const Twine &Path, AccessMode Mode) {
+  SmallVector<wchar_t, 128> PathUtf16;
+
+  if (std::error_code EC = widenPath(Path, PathUtf16))
+    return EC;
+
+  DWORD Attributes = ::GetFileAttributesW(PathUtf16.begin());
+
+  if (Attributes == INVALID_FILE_ATTRIBUTES) {
+    // See if the file didn't actually exist.
+    DWORD LastError = ::GetLastError();
+    if (LastError != ERROR_FILE_NOT_FOUND &&
+        LastError != ERROR_PATH_NOT_FOUND)
+      return mapWindowsError(LastError);
+    return std::make_error_code(std::errc::no_such_file_or_directory);
+  }
+
+  if (Mode == AccessMode::Write && (Attributes & FILE_ATTRIBUTE_READONLY))
+    return std::make_error_code(std::errc::permission_denied);
+
+  return std::error_code();
+}
+
+bool equivalent(file_status A, file_status B) {
+  assert(status_known(A) && status_known(B));
+  return A.FileIndexHigh         == B.FileIndexHigh &&
+         A.FileIndexLow          == B.FileIndexLow &&
+         A.FileSizeHigh          == B.FileSizeHigh &&
+         A.FileSizeLow           == B.FileSizeLow &&
+         A.LastAccessedTimeHigh  == B.LastAccessedTimeHigh &&
+         A.LastAccessedTimeLow   == B.LastAccessedTimeLow &&
+         A.LastWriteTimeHigh     == B.LastWriteTimeHigh &&
+         A.LastWriteTimeLow      == B.LastWriteTimeLow &&
+         A.VolumeSerialNumber    == B.VolumeSerialNumber;
+}
+
+std::error_code equivalent(const Twine &A, const Twine &B, bool &result) {
+  file_status fsA, fsB;
+  if (std::error_code ec = status(A, fsA))
+    return ec;
+  if (std::error_code ec = status(B, fsB))
+    return ec;
+  result = equivalent(fsA, fsB);
+  return std::error_code();
+}
+
+static bool isReservedName(StringRef path) {
+  // This list of reserved names comes from MSDN, at:
+  // http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx
+  static const char *const sReservedNames[] = { "nul", "con", "prn", "aux",
+                                                "com1", "com2", "com3", "com4",
+                                                "com5", "com6", "com7", "com8",
+                                                "com9", "lpt1", "lpt2", "lpt3",
+                                                "lpt4", "lpt5", "lpt6", "lpt7",
+                                                "lpt8", "lpt9" };
+
+  // First, check to see if this is a device namespace, which always
+  // starts with \\.\, since device namespaces are not legal file paths.
+  if (path.startswith("\\\\.\\"))
+    return true;
+
+  // Then compare against the list of ancient reserved names.
+  for (size_t i = 0; i < array_lengthof(sReservedNames); ++i) {
+    if (path.equals_lower(sReservedNames[i]))
+      return true;
+  }
+
+  // The path isn't what we consider reserved.
+  return false;
+}
+
+static std::error_code getStatus(HANDLE FileHandle, file_status &Result) {
+  if (FileHandle == INVALID_HANDLE_VALUE)
+    goto handle_status_error;
+
+  switch (::GetFileType(FileHandle)) {
+  default:
+    Result = file_status(file_type::type_unknown);
+    return std::error_code();
+  case FILE_TYPE_UNKNOWN: {
+    DWORD Err = ::GetLastError();
+    if (Err != NO_ERROR)
+      return mapWindowsError(Err);
+    Result = file_status(file_type::type_unknown);
+    return std::error_code();
+  }
+  case FILE_TYPE_DISK:
+    break;
+  case FILE_TYPE_CHAR:
+    Result = file_status(file_type::character_file);
+    return std::error_code();
+  case FILE_TYPE_PIPE:
+    Result = file_status(file_type::fifo_file);
+    return std::error_code();
+  }
+
+  BY_HANDLE_FILE_INFORMATION Info;
+  if (!::GetFileInformationByHandle(FileHandle, &Info))
+    goto handle_status_error;
+
+  {
+    file_type Type = (Info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+                         ? file_type::directory_file
+                         : file_type::regular_file;
+    Result =
+        file_status(Type, Info.ftLastAccessTime.dwHighDateTime,
+                    Info.ftLastAccessTime.dwLowDateTime,
+                    Info.ftLastWriteTime.dwHighDateTime,
+                    Info.ftLastWriteTime.dwLowDateTime,
+                    Info.dwVolumeSerialNumber, Info.nFileSizeHigh,
+                    Info.nFileSizeLow, Info.nFileIndexHigh, Info.nFileIndexLow);
+    return std::error_code();
+  }
+
+handle_status_error:
+  DWORD LastError = ::GetLastError();
+  if (LastError == ERROR_FILE_NOT_FOUND ||
+      LastError == ERROR_PATH_NOT_FOUND)
+    Result = file_status(file_type::file_not_found);
+  else if (LastError == ERROR_SHARING_VIOLATION)
+    Result = file_status(file_type::type_unknown);
+  else
+    Result = file_status(file_type::status_error);
+  return mapWindowsError(LastError);
+}
+
+std::error_code status(const Twine &path, file_status &result) {
+  SmallString<128> path_storage;
+  SmallVector<wchar_t, 128> path_utf16;
+
+  StringRef path8 = path.toStringRef(path_storage);
+  if (isReservedName(path8)) {
+    result = file_status(file_type::character_file);
+    return std::error_code();
+  }
+
+  if (std::error_code ec = widenPath(path8, path_utf16))
+    return ec;
+
+  DWORD attr = ::GetFileAttributesW(path_utf16.begin());
+  if (attr == INVALID_FILE_ATTRIBUTES)
+    return getStatus(INVALID_HANDLE_VALUE, result);
+
+  // Handle reparse points.
+  if (attr & FILE_ATTRIBUTE_REPARSE_POINT) {
+    ScopedFileHandle h(
+      ::CreateFileW(path_utf16.begin(),
+                    0, // Attributes only.
+                    FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+                    NULL,
+                    OPEN_EXISTING,
+                    FILE_FLAG_BACKUP_SEMANTICS,
+                    0));
+    if (!h)
+      return getStatus(INVALID_HANDLE_VALUE, result);
+  }
+
+  ScopedFileHandle h(
+      ::CreateFileW(path_utf16.begin(), 0, // Attributes only.
+                    FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
+                    NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0));
+    if (!h)
+      return getStatus(INVALID_HANDLE_VALUE, result);
+
+    return getStatus(h, result);
+}
+
+std::error_code status(int FD, file_status &Result) {
+  HANDLE FileHandle = reinterpret_cast<HANDLE>(_get_osfhandle(FD));
+  return getStatus(FileHandle, Result);
+}
+
+std::error_code detail::directory_iterator_construct(detail::DirIterState &it,
+                                                StringRef path){
+  SmallVector<wchar_t, 128> path_utf16;
+
+  if (std::error_code ec = widenPath(path, path_utf16))
+    return ec;
+
+  // Convert path to the format that Windows is happy with.
+  if (path_utf16.size() > 0 &&
+      !is_separator(path_utf16[path.size() - 1]) &&
+      path_utf16[path.size() - 1] != L':') {
+    path_utf16.push_back(L'\\');
+    path_utf16.push_back(L'*');
+  } else {
+    path_utf16.push_back(L'*');
+  }
+
+  //  Get the first directory entry.
+  WIN32_FIND_DATAW FirstFind;
+  ScopedFindHandle FindHandle(::FindFirstFileW(c_str(path_utf16), &FirstFind));
+  if (!FindHandle)
+    return mapWindowsError(::GetLastError());
+
+  size_t FilenameLen = ::wcslen(FirstFind.cFileName);
+  while ((FilenameLen == 1 && FirstFind.cFileName[0] == L'.') ||
+         (FilenameLen == 2 && FirstFind.cFileName[0] == L'.' &&
+                              FirstFind.cFileName[1] == L'.'))
+    if (!::FindNextFileW(FindHandle, &FirstFind)) {
+      DWORD LastError = ::GetLastError();
+      // Check for end.
+      if (LastError == ERROR_NO_MORE_FILES)
+        return detail::directory_iterator_destruct(it);
+      return mapWindowsError(LastError);
+    } else
+      FilenameLen = ::wcslen(FirstFind.cFileName);
+
+  // Construct the current directory entry.
+  SmallString<128> directory_entry_name_utf8;
+  if (std::error_code ec =
+          UTF16ToUTF8(FirstFind.cFileName, ::wcslen(FirstFind.cFileName),
+                      directory_entry_name_utf8))
+    return ec;
+
+  it.IterationHandle = intptr_t(FindHandle.take());
+  SmallString<128> directory_entry_path(path);
+  path::append(directory_entry_path, directory_entry_name_utf8);
+  it.CurrentEntry = directory_entry(directory_entry_path);
+
+  return std::error_code();
+}
+
+std::error_code detail::directory_iterator_destruct(detail::DirIterState &it) {
+  if (it.IterationHandle != 0)
+    // Closes the handle if it's valid.
+    ScopedFindHandle close(HANDLE(it.IterationHandle));
+  it.IterationHandle = 0;
+  it.CurrentEntry = directory_entry();
+  return std::error_code();
+}
+
+std::error_code detail::directory_iterator_increment(detail::DirIterState &it) {
+  WIN32_FIND_DATAW FindData;
+  if (!::FindNextFileW(HANDLE(it.IterationHandle), &FindData)) {
+    DWORD LastError = ::GetLastError();
+    // Check for end.
+    if (LastError == ERROR_NO_MORE_FILES)
+      return detail::directory_iterator_destruct(it);
+    return mapWindowsError(LastError);
+  }
+
+  size_t FilenameLen = ::wcslen(FindData.cFileName);
+  if ((FilenameLen == 1 && FindData.cFileName[0] == L'.') ||
+      (FilenameLen == 2 && FindData.cFileName[0] == L'.' &&
+                           FindData.cFileName[1] == L'.'))
+    return directory_iterator_increment(it);
+
+  SmallString<128> directory_entry_path_utf8;
+  if (std::error_code ec =
+          UTF16ToUTF8(FindData.cFileName, ::wcslen(FindData.cFileName),
+                      directory_entry_path_utf8))
+    return ec;
+
+  it.CurrentEntry.replace_filename(Twine(directory_entry_path_utf8));
+  return std::error_code();
+}
+
+std::error_code openFileForRead(const Twine &Name, int &ResultFD,
+                                SmallVectorImpl<char> *RealPath) {
+  SmallVector<wchar_t, 128> PathUTF16;
+
+  if (std::error_code EC = widenPath(Name, PathUTF16))
+    return EC;
+
+  HANDLE H =
+      ::CreateFileW(PathUTF16.begin(), GENERIC_READ,
+                    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                    NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+  if (H == INVALID_HANDLE_VALUE) {
+    DWORD LastError = ::GetLastError();
+    std::error_code EC = mapWindowsError(LastError);
+    // Provide a better error message when trying to open directories.
+    // This only runs if we failed to open the file, so there is probably
+    // no performances issues.
+    if (LastError != ERROR_ACCESS_DENIED)
+      return EC;
+    if (is_directory(Name))
+      return std::make_error_code(std::errc::is_a_directory);
+    return EC;
+  }
+
+  int FD = ::_open_osfhandle(intptr_t(H), 0);
+  if (FD == -1) {
+    ::CloseHandle(H);
+    return mapWindowsError(ERROR_INVALID_HANDLE);
+  }
+
+  // Fetch the real name of the file, if the user asked
+  if (RealPath) {
+    RealPath->clear();
+    wchar_t RealPathUTF16[MAX_PATH];
+    DWORD CountChars =
+      ::GetFinalPathNameByHandleW(H, RealPathUTF16, MAX_PATH,
+                                  FILE_NAME_NORMALIZED);
+    if (CountChars > 0 && CountChars < MAX_PATH) {
+      // Convert the result from UTF-16 to UTF-8.
+      SmallString<MAX_PATH> RealPathUTF8;
+      if (!UTF16ToUTF8(RealPathUTF16, CountChars, RealPathUTF8))
+        RealPath->append(RealPathUTF8.data(),
+                         RealPathUTF8.data() + strlen(RealPathUTF8.data()));
+    }
+  }
+
+  ResultFD = FD;
+  return std::error_code();
+}
+
+std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
+                                 OpenFlags Flags, unsigned Mode) {
+  // Verify that we don't have both "append" and "excl".
+  assert((!(Flags & F_Excl) || !(Flags & F_Append)) &&
+         "Cannot specify both 'excl' and 'append' file creation flags!");
+
+  SmallVector<wchar_t, 128> PathUTF16;
+
+  if (std::error_code EC = widenPath(Name, PathUTF16))
+    return EC;
+
+  DWORD CreationDisposition;
+  if (Flags & F_Excl)
+    CreationDisposition = CREATE_NEW;
+  else if (Flags & F_Append)
+    CreationDisposition = OPEN_ALWAYS;
+  else
+    CreationDisposition = CREATE_ALWAYS;
+
+  DWORD Access = GENERIC_WRITE;
+  if (Flags & F_RW)
+    Access |= GENERIC_READ;
+
+  HANDLE H = ::CreateFileW(PathUTF16.begin(), Access,
+                           FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+                           CreationDisposition, FILE_ATTRIBUTE_NORMAL, NULL);
+
+  if (H == INVALID_HANDLE_VALUE) {
+    DWORD LastError = ::GetLastError();
+    std::error_code EC = mapWindowsError(LastError);
+    // Provide a better error message when trying to open directories.
+    // This only runs if we failed to open the file, so there is probably
+    // no performances issues.
+    if (LastError != ERROR_ACCESS_DENIED)
+      return EC;
+    if (is_directory(Name))
+      return std::make_error_code(std::errc::is_a_directory);
+    return EC;
+  }
+
+  int OpenFlags = 0;
+  if (Flags & F_Append)
+    OpenFlags |= _O_APPEND;
+
+  if (Flags & F_Text)
+    OpenFlags |= _O_TEXT;
+
+  int FD = ::_open_osfhandle(intptr_t(H), OpenFlags);
+  if (FD == -1) {
+    ::CloseHandle(H);
+    return mapWindowsError(ERROR_INVALID_HANDLE);
+  }
+
+  ResultFD = FD;
+  return std::error_code();
+}
+
+} // end namespace fs
+
+namespace path {
+static bool getKnownFolderPath(KNOWNFOLDERID folderId,
+                               SmallVectorImpl<char> &result) {
+  wchar_t *path = nullptr;
+  if (::SHGetKnownFolderPath(folderId, KF_FLAG_CREATE, nullptr, &path) != S_OK)
+    return false;
+
+  bool ok = !UTF16ToUTF8(path, ::wcslen(path), result);
+  ::CoTaskMemFree(path);
+  return ok;
+}
+
+bool getUserCacheDir(SmallVectorImpl<char> &Result) {
+  return getKnownFolderPath(FOLDERID_LocalAppData, Result);
+}
+
+bool home_directory(SmallVectorImpl<char> &result) {
+  return getKnownFolderPath(FOLDERID_Profile, result);
+}
+
+static bool getTempDirEnvVar(const wchar_t *Var, SmallVectorImpl<char> &Res) {
+  SmallVector<wchar_t, 1024> Buf;
+  size_t Size = 1024;
+  do {
+    Buf.reserve(Size);
+    Size = GetEnvironmentVariableW(Var, Buf.data(), Buf.capacity());
+    if (Size == 0)
+      return false;
+
+    // Try again with larger buffer.
+  } while (Size > Buf.capacity());
+  Buf.set_size(Size);
+
+  return !windows::UTF16ToUTF8(Buf.data(), Size, Res);
+}
+
+static bool getTempDirEnvVar(SmallVectorImpl<char> &Res) {
+  const wchar_t *EnvironmentVariables[] = {L"TMP", L"TEMP", L"USERPROFILE"};
+  for (auto *Env : EnvironmentVariables) {
+    if (getTempDirEnvVar(Env, Res))
+      return true;
+  }
+  return false;
+}
+
+void system_temp_directory(bool ErasedOnReboot, SmallVectorImpl<char> &Result) {
+  (void)ErasedOnReboot;
+  Result.clear();
+
+  // Check whether the temporary directory is specified by an environment var.
+  // This matches GetTempPath logic to some degree. GetTempPath is not used
+  // directly as it cannot handle evn var longer than 130 chars on Windows 7
+  // (fixed on Windows 8).
+  if (getTempDirEnvVar(Result)) {
+    assert(!Result.empty() && "Unexpected empty path");
+    native(Result); // Some Unix-like shells use Unix path separator in $TMP.
+    fs::make_absolute(Result); // Make it absolute if not already.
+    return;
+  }
+
+  // Fall back to a system default.
+  const char *DefaultResult = "C:\\Temp";
+  Result.append(DefaultResult, DefaultResult + strlen(DefaultResult));
+}
+} // end namespace path
+
+namespace windows {
+std::error_code UTF8ToUTF16(llvm::StringRef utf8,
+                            llvm::SmallVectorImpl<wchar_t> &utf16) {
+  if (!utf8.empty()) {
+    int len = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8.begin(),
+                                    utf8.size(), utf16.begin(), 0);
+
+    if (len == 0)
+      return mapWindowsError(::GetLastError());
+
+    utf16.reserve(len + 1);
+    utf16.set_size(len);
+
+    len = ::MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8.begin(),
+                                utf8.size(), utf16.begin(), utf16.size());
+
+    if (len == 0)
+      return mapWindowsError(::GetLastError());
+  }
+
+  // Make utf16 null terminated.
+  utf16.push_back(0);
+  utf16.pop_back();
+
+  return std::error_code();
+}
+
+static
+std::error_code UTF16ToCodePage(unsigned codepage, const wchar_t *utf16,
+                                size_t utf16_len,
+                                llvm::SmallVectorImpl<char> &utf8) {
+  if (utf16_len) {
+    // Get length.
+    int len = ::WideCharToMultiByte(codepage, 0, utf16, utf16_len, utf8.begin(),
+                                    0, NULL, NULL);
+
+    if (len == 0)
+      return mapWindowsError(::GetLastError());
+
+    utf8.reserve(len);
+    utf8.set_size(len);
+
+    // Now do the actual conversion.
+    len = ::WideCharToMultiByte(codepage, 0, utf16, utf16_len, utf8.data(),
+                                utf8.size(), NULL, NULL);
+
+    if (len == 0)
+      return mapWindowsError(::GetLastError());
+  }
+
+  // Make utf8 null terminated.
+  utf8.push_back(0);
+  utf8.pop_back();
+
+  return std::error_code();
+}
+
+std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
+                            llvm::SmallVectorImpl<char> &utf8) {
+  return UTF16ToCodePage(CP_UTF8, utf16, utf16_len, utf8);
+}
+
+std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len,
+                             llvm::SmallVectorImpl<char> &utf8) {
+  return UTF16ToCodePage(CP_ACP, utf16, utf16_len, utf8);
+}
+
+} // end namespace windows
+} // end namespace sys
+} // end namespace llvm
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/Windows/WindowsSupport.h b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Windows/WindowsSupport.h
new file mode 100644
index 0000000..fd820e7
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/Windows/WindowsSupport.h
@@ -0,0 +1,211 @@
+//===- WindowsSupport.h - Common Windows Include File -----------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines things specific to Windows implementations.  In addition to
+// providing some helpers for working with win32 APIs, this header wraps
+// <windows.h> with some portability macros.  Always include WindowsSupport.h
+// instead of including <windows.h> directly.
+//
+//===----------------------------------------------------------------------===//
+
+//===----------------------------------------------------------------------===//
+//=== WARNING: Implementation here must contain only generic Win32 code that
+//===          is guaranteed to work on *all* Win32 variants.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_WINDOWSSUPPORT_H
+#define LLVM_SUPPORT_WINDOWSSUPPORT_H
+
+// mingw-w64 tends to define it as 0x0502 in its headers.
+#undef _WIN32_WINNT
+#undef _WIN32_IE
+
+// Require at least Windows 7 API.
+#define _WIN32_WINNT 0x0601
+#define _WIN32_IE    0x0800 // MinGW at it again. FIXME: verify if still needed.
+#define WIN32_LEAN_AND_MEAN
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringExtras.h"
+#include "llvm/StringRef.h"
+#include "llvm/Twine.h"
+#include "llvm/Compiler.h"
+#include <system_error>
+#include <windows.h>
+#include <cassert>
+#include <string>
+
+/// Determines if the program is running on Windows 8 or newer. This
+/// reimplements one of the helpers in the Windows 8.1 SDK, which are intended
+/// to supercede raw calls to GetVersionEx. Old SDKs, Cygwin, and MinGW don't
+/// yet have VersionHelpers.h, so we have our own helper.
+inline bool RunningWindows8OrGreater() {
+  // Windows 8 is version 6.2, service pack 0.
+  OSVERSIONINFOEXW osvi = {};
+  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+  osvi.dwMajorVersion = 6;
+  osvi.dwMinorVersion = 2;
+  osvi.wServicePackMajor = 0;
+
+  DWORDLONG Mask = 0;
+  Mask = VerSetConditionMask(Mask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+  Mask = VerSetConditionMask(Mask, VER_MINORVERSION, VER_GREATER_EQUAL);
+  Mask = VerSetConditionMask(Mask, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
+
+  return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION |
+                                       VER_SERVICEPACKMAJOR,
+                            Mask) != FALSE;
+}
+
+inline bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix) {
+  if (!ErrMsg)
+    return true;
+  char *buffer = NULL;
+  DWORD LastError = GetLastError();
+  DWORD R = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                               FORMAT_MESSAGE_FROM_SYSTEM |
+                               FORMAT_MESSAGE_MAX_WIDTH_MASK,
+                           NULL, LastError, 0, (LPSTR)&buffer, 1, NULL);
+  if (R)
+    *ErrMsg = prefix + ": " + buffer;
+  else
+    *ErrMsg = prefix + ": Unknown error";
+  *ErrMsg += " (0x" + llvm::utohexstr(LastError) + ")";
+
+  LocalFree(buffer);
+  return R != 0;
+}
+
+template <typename HandleTraits>
+class ScopedHandle {
+  typedef typename HandleTraits::handle_type handle_type;
+  handle_type Handle;
+
+  ScopedHandle(const ScopedHandle &other); // = delete;
+  void operator=(const ScopedHandle &other); // = delete;
+public:
+  ScopedHandle()
+    : Handle(HandleTraits::GetInvalid()) {}
+
+  explicit ScopedHandle(handle_type h)
+    : Handle(h) {}
+
+  ~ScopedHandle() {
+    if (HandleTraits::IsValid(Handle))
+      HandleTraits::Close(Handle);
+  }
+
+  handle_type take() {
+    handle_type t = Handle;
+    Handle = HandleTraits::GetInvalid();
+    return t;
+  }
+
+  ScopedHandle &operator=(handle_type h) {
+    if (HandleTraits::IsValid(Handle))
+      HandleTraits::Close(Handle);
+    Handle = h;
+    return *this;
+  }
+
+  // True if Handle is valid.
+  explicit operator bool() const {
+    return HandleTraits::IsValid(Handle) ? true : false;
+  }
+
+  operator handle_type() const {
+    return Handle;
+  }
+};
+
+struct CommonHandleTraits {
+  typedef HANDLE handle_type;
+
+  static handle_type GetInvalid() {
+    return INVALID_HANDLE_VALUE;
+  }
+
+  static void Close(handle_type h) {
+    ::CloseHandle(h);
+  }
+
+  static bool IsValid(handle_type h) {
+    return h != GetInvalid();
+  }
+};
+
+struct JobHandleTraits : CommonHandleTraits {
+  static handle_type GetInvalid() {
+    return NULL;
+  }
+};
+
+struct RegTraits : CommonHandleTraits {
+  typedef HKEY handle_type;
+
+  static handle_type GetInvalid() {
+    return NULL;
+  }
+
+  static void Close(handle_type h) {
+    ::RegCloseKey(h);
+  }
+
+  static bool IsValid(handle_type h) {
+    return h != GetInvalid();
+  }
+};
+
+struct FindHandleTraits : CommonHandleTraits {
+  static void Close(handle_type h) {
+    ::FindClose(h);
+  }
+};
+
+struct FileHandleTraits : CommonHandleTraits {};
+
+typedef ScopedHandle<CommonHandleTraits> ScopedCommonHandle;
+typedef ScopedHandle<FileHandleTraits>   ScopedFileHandle;
+typedef ScopedHandle<RegTraits>          ScopedRegHandle;
+typedef ScopedHandle<FindHandleTraits>   ScopedFindHandle;
+typedef ScopedHandle<JobHandleTraits>    ScopedJobHandle;
+
+namespace llvm {
+template <class T>
+class SmallVectorImpl;
+
+template <class T>
+typename SmallVectorImpl<T>::const_pointer
+c_str(SmallVectorImpl<T> &str) {
+  str.push_back(0);
+  str.pop_back();
+  return str.data();
+}
+
+namespace sys {
+namespace path {
+std::error_code widenPath(const Twine &Path8,
+                          SmallVectorImpl<wchar_t> &Path16);
+} // end namespace path
+
+namespace windows {
+std::error_code UTF8ToUTF16(StringRef utf8, SmallVectorImpl<wchar_t> &utf16);
+std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
+                            SmallVectorImpl<char> &utf8);
+/// Convert from UTF16 to the current code page used in the system
+std::error_code UTF16ToCurCP(const wchar_t *utf16, size_t utf16_len,
+                             SmallVectorImpl<char> &utf8);
+} // end namespace windows
+} // end namespace sys
+} // end namespace llvm.
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/raw_os_ostream.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/raw_os_ostream.cpp
new file mode 100644
index 0000000..402004e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/raw_os_ostream.cpp
@@ -0,0 +1,30 @@
+//===--- raw_os_ostream.cpp - Implement the raw_os_ostream class ----------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This implements support adapting raw_ostream to std::ostream.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/raw_os_ostream.h"
+#include <ostream>
+using namespace llvm;
+
+//===----------------------------------------------------------------------===//
+//  raw_os_ostream
+//===----------------------------------------------------------------------===//
+
+raw_os_ostream::~raw_os_ostream() {
+  flush();
+}
+
+void raw_os_ostream::write_impl(const char *Ptr, size_t Size) {
+  OS.write(Ptr, Size);
+}
+
+uint64_t raw_os_ostream::current_pos() const { return OS.tellp(); }
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/llvm/raw_ostream.cpp b/third_party/wpiutil_2018/src/main/native/cpp/llvm/raw_ostream.cpp
new file mode 100644
index 0000000..3fab800
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/llvm/raw_ostream.cpp
@@ -0,0 +1,733 @@
+//===--- raw_ostream.cpp - Implement the raw_ostream classes --------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This implements support for bulk buffered stream output.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/raw_ostream.h"
+#include "llvm/SmallString.h"
+#include "llvm/SmallVector.h"
+#include "llvm/StringExtras.h"
+#include "llvm/Compiler.h"
+#include "llvm/Format.h"
+#include "llvm/MathExtras.h"
+#include "llvm/WindowsError.h"
+#include <cctype>
+#include <cerrno>
+#include <sys/stat.h>
+#include <system_error>
+
+// <fcntl.h> may provide O_BINARY.
+#include <fcntl.h>
+
+#ifndef _WIN32
+#include <unistd.h>
+#include <sys/uio.h>
+#endif
+
+#if defined(__CYGWIN__)
+#include <io.h>
+#endif
+
+#if defined(_MSC_VER)
+#include <io.h>
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
+#endif
+
+#if defined(_WIN32)
+#include "Windows/WindowsSupport.h"
+#endif
+
+using namespace llvm;
+
+raw_ostream::~raw_ostream() {
+  // raw_ostream's subclasses should take care to flush the buffer
+  // in their destructors.
+  assert(OutBufCur == OutBufStart &&
+         "raw_ostream destructor called with non-empty buffer!");
+
+  if (BufferMode == InternalBuffer)
+    delete [] OutBufStart;
+}
+
+// An out of line virtual method to provide a home for the class vtable.
+void raw_ostream::handle() {}
+
+size_t raw_ostream::preferred_buffer_size() const {
+  // BUFSIZ is intended to be a reasonable default.
+  return BUFSIZ;
+}
+
+void raw_ostream::SetBuffered() {
+  // Ask the subclass to determine an appropriate buffer size.
+  if (size_t Size = preferred_buffer_size())
+    SetBufferSize(Size);
+  else
+    // It may return 0, meaning this stream should be unbuffered.
+    SetUnbuffered();
+}
+
+void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size,
+                                   BufferKind Mode) {
+  assert(((Mode == Unbuffered && !BufferStart && Size == 0) ||
+          (Mode != Unbuffered && BufferStart && Size != 0)) &&
+         "stream must be unbuffered or have at least one byte");
+  // Make sure the current buffer is free of content (we can't flush here; the
+  // child buffer management logic will be in write_impl).
+  assert(GetNumBytesInBuffer() == 0 && "Current buffer is non-empty!");
+
+  if (BufferMode == InternalBuffer)
+    delete [] OutBufStart;
+  OutBufStart = BufferStart;
+  OutBufEnd = OutBufStart+Size;
+  OutBufCur = OutBufStart;
+  BufferMode = Mode;
+
+  assert(OutBufStart <= OutBufEnd && "Invalid size!");
+}
+
+raw_ostream &raw_ostream::operator<<(unsigned long N) {
+  // Zero is a special case.
+  if (N == 0)
+    return *this << '0';
+
+  char NumberBuffer[20];
+  char *EndPtr = NumberBuffer+sizeof(NumberBuffer);
+  char *CurPtr = EndPtr;
+
+  while (N) {
+    *--CurPtr = '0' + char(N % 10);
+    N /= 10;
+  }
+  return write(CurPtr, EndPtr-CurPtr);
+}
+
+raw_ostream &raw_ostream::operator<<(long N) {
+  if (N <  0) {
+    *this << '-';
+    // Avoid undefined behavior on LONG_MIN with a cast.
+    N = -(unsigned long)N;
+  }
+
+  return this->operator<<(static_cast<unsigned long>(N));
+}
+
+raw_ostream &raw_ostream::operator<<(unsigned long long N) {
+  // Output using 32-bit div/mod when possible.
+  if (N == static_cast<unsigned long>(N))
+    return this->operator<<(static_cast<unsigned long>(N));
+
+  char NumberBuffer[20];
+  char *EndPtr = std::end(NumberBuffer);
+  char *CurPtr = EndPtr;
+
+  while (N) {
+    *--CurPtr = '0' + char(N % 10);
+    N /= 10;
+  }
+  return write(CurPtr, EndPtr-CurPtr);
+}
+
+raw_ostream &raw_ostream::operator<<(long long N) {
+  if (N < 0) {
+    *this << '-';
+    // Avoid undefined behavior on INT64_MIN with a cast.
+    N = -(unsigned long long)N;
+  }
+
+  return this->operator<<(static_cast<unsigned long long>(N));
+}
+
+raw_ostream &raw_ostream::write_hex(unsigned long long N) {
+  // Zero is a special case.
+  if (N == 0)
+    return *this << '0';
+
+  char NumberBuffer[16];
+  char *EndPtr = std::end(NumberBuffer);
+  char *CurPtr = EndPtr;
+
+  while (N) {
+    unsigned char x = static_cast<unsigned char>(N) % 16;
+    *--CurPtr = hexdigit(x, /*LowerCase*/true);
+    N /= 16;
+  }
+
+  return write(CurPtr, EndPtr-CurPtr);
+}
+
+raw_ostream &raw_ostream::write_escaped(StringRef Str,
+                                        bool UseHexEscapes) {
+  for (unsigned char c : Str) {
+    switch (c) {
+    case '\\':
+      *this << '\\' << '\\';
+      break;
+    case '\t':
+      *this << '\\' << 't';
+      break;
+    case '\n':
+      *this << '\\' << 'n';
+      break;
+    case '"':
+      *this << '\\' << '"';
+      break;
+    default:
+      if (std::isprint(c)) {
+        *this << c;
+        break;
+      }
+
+      // Write out the escaped representation.
+      if (UseHexEscapes) {
+        *this << '\\' << 'x';
+        *this << hexdigit((c >> 4 & 0xF));
+        *this << hexdigit((c >> 0) & 0xF);
+      } else {
+        // Always use a full 3-character octal escape.
+        *this << '\\';
+        *this << char('0' + ((c >> 6) & 7));
+        *this << char('0' + ((c >> 3) & 7));
+        *this << char('0' + ((c >> 0) & 7));
+      }
+    }
+  }
+
+  return *this;
+}
+
+raw_ostream &raw_ostream::operator<<(const void *P) {
+  *this << '0' << 'x';
+
+  return write_hex((uintptr_t) P);
+}
+
+raw_ostream &raw_ostream::operator<<(double N) {
+#ifdef _WIN32
+  // On MSVCRT and compatible, output of %e is incompatible to Posix
+  // by default. Number of exponent digits should be at least 2. "%+03d"
+  // FIXME: Implement our formatter to here or Support/Format.h!
+#if defined(__MINGW32__)
+  // FIXME: It should be generic to C++11.
+  if (N == 0.0 && std::signbit(N))
+    return *this << "-0.000000e+00";
+#else
+  int fpcl = _fpclass(N);
+
+  // negative zero
+  if (fpcl == _FPCLASS_NZ)
+    return *this << "-0.000000e+00";
+#endif
+
+  char buf[16];
+  unsigned len;
+  len = format("%e", N).snprint(buf, sizeof(buf));
+  if (len <= sizeof(buf) - 2) {
+    if (len >= 5 && buf[len - 5] == 'e' && buf[len - 3] == '0') {
+      int cs = buf[len - 4];
+      if (cs == '+' || cs == '-') {
+        int c1 = buf[len - 2];
+        int c0 = buf[len - 1];
+        if (isdigit(static_cast<unsigned char>(c1)) &&
+            isdigit(static_cast<unsigned char>(c0))) {
+          // Trim leading '0': "...e+012" -> "...e+12\0"
+          buf[len - 3] = c1;
+          buf[len - 2] = c0;
+          buf[--len] = 0;
+        }
+      }
+    }
+    return this->operator<<(buf);
+  }
+#endif
+  return this->operator<<(format("%e", N));
+}
+
+
+
+void raw_ostream::flush_nonempty() {
+  assert(OutBufCur > OutBufStart && "Invalid call to flush_nonempty.");
+  size_t Length = OutBufCur - OutBufStart;
+  OutBufCur = OutBufStart;
+  write_impl(OutBufStart, Length);
+}
+
+raw_ostream &raw_ostream::write(unsigned char C) {
+  // Group exceptional cases into a single branch.
+  if (LLVM_UNLIKELY(OutBufCur >= OutBufEnd)) {
+    if (LLVM_UNLIKELY(!OutBufStart)) {
+      if (BufferMode == Unbuffered) {
+        write_impl(reinterpret_cast<char*>(&C), 1);
+        return *this;
+      }
+      // Set up a buffer and start over.
+      SetBuffered();
+      return write(C);
+    }
+
+    flush_nonempty();
+  }
+
+  *OutBufCur++ = C;
+  return *this;
+}
+
+raw_ostream &raw_ostream::write(const char *Ptr, size_t Size) {
+  // Group exceptional cases into a single branch.
+  if (LLVM_UNLIKELY(size_t(OutBufEnd - OutBufCur) < Size)) {
+    if (LLVM_UNLIKELY(!OutBufStart)) {
+      if (BufferMode == Unbuffered) {
+        write_impl(Ptr, Size);
+        return *this;
+      }
+      // Set up a buffer and start over.
+      SetBuffered();
+      return write(Ptr, Size);
+    }
+
+    size_t NumBytes = OutBufEnd - OutBufCur;
+
+    // If the buffer is empty at this point we have a string that is larger
+    // than the buffer. Directly write the chunk that is a multiple of the
+    // preferred buffer size and put the remainder in the buffer.
+    if (LLVM_UNLIKELY(OutBufCur == OutBufStart)) {
+      assert(NumBytes != 0 && "undefined behavior");
+      size_t BytesToWrite = Size - (Size % NumBytes);
+      write_impl(Ptr, BytesToWrite);
+      size_t BytesRemaining = Size - BytesToWrite;
+      if (BytesRemaining > size_t(OutBufEnd - OutBufCur)) {
+        // Too much left over to copy into our buffer.
+        return write(Ptr + BytesToWrite, BytesRemaining);
+      }
+      copy_to_buffer(Ptr + BytesToWrite, BytesRemaining);
+      return *this;
+    }
+
+    // We don't have enough space in the buffer to fit the string in. Insert as
+    // much as possible, flush and start over with the remainder.
+    copy_to_buffer(Ptr, NumBytes);
+    flush_nonempty();
+    return write(Ptr + NumBytes, Size - NumBytes);
+  }
+
+  copy_to_buffer(Ptr, Size);
+
+  return *this;
+}
+
+void raw_ostream::copy_to_buffer(const char *Ptr, size_t Size) {
+  assert(Size <= size_t(OutBufEnd - OutBufCur) && "Buffer overrun!");
+
+  // Handle short strings specially, memcpy isn't very good at very short
+  // strings.
+  switch (Size) {
+  case 4: OutBufCur[3] = Ptr[3]; // FALL THROUGH
+  case 3: OutBufCur[2] = Ptr[2]; // FALL THROUGH
+  case 2: OutBufCur[1] = Ptr[1]; // FALL THROUGH
+  case 1: OutBufCur[0] = Ptr[0]; // FALL THROUGH
+  case 0: break;
+  default:
+    memcpy(OutBufCur, Ptr, Size);
+    break;
+  }
+
+  OutBufCur += Size;
+}
+
+// Formatted output.
+raw_ostream &raw_ostream::operator<<(const format_object_base &Fmt) {
+  // If we have more than a few bytes left in our output buffer, try
+  // formatting directly onto its end.
+  size_t NextBufferSize = 127;
+  size_t BufferBytesLeft = OutBufEnd - OutBufCur;
+  if (BufferBytesLeft > 3) {
+    size_t BytesUsed = Fmt.print(OutBufCur, BufferBytesLeft);
+
+    // Common case is that we have plenty of space.
+    if (BytesUsed <= BufferBytesLeft) {
+      OutBufCur += BytesUsed;
+      return *this;
+    }
+
+    // Otherwise, we overflowed and the return value tells us the size to try
+    // again with.
+    NextBufferSize = BytesUsed;
+  }
+
+  // If we got here, we didn't have enough space in the output buffer for the
+  // string.  Try printing into a SmallVector that is resized to have enough
+  // space.  Iterate until we win.
+  SmallVector<char, 128> V;
+
+  while (1) {
+    V.resize(NextBufferSize);
+
+    // Try formatting into the SmallVector.
+    size_t BytesUsed = Fmt.print(V.data(), NextBufferSize);
+
+    // If BytesUsed fit into the vector, we win.
+    if (BytesUsed <= NextBufferSize)
+      return write(V.data(), BytesUsed);
+
+    // Otherwise, try again with a new size.
+    assert(BytesUsed > NextBufferSize && "Didn't grow buffer!?");
+    NextBufferSize = BytesUsed;
+  }
+}
+
+raw_ostream &raw_ostream::operator<<(const FormattedString &FS) {
+  unsigned Len = FS.Str.size(); 
+  int PadAmount = FS.Width - Len;
+  if (FS.RightJustify && (PadAmount > 0))
+    this->indent(PadAmount);
+  this->operator<<(FS.Str);
+  if (!FS.RightJustify && (PadAmount > 0))
+    this->indent(PadAmount);
+  return *this;
+}
+
+raw_ostream &raw_ostream::operator<<(const FormattedNumber &FN) {
+  if (FN.Hex) {
+    unsigned Nibbles = (64 - countLeadingZeros(FN.HexValue)+3)/4;
+    unsigned PrefixChars = FN.HexPrefix ? 2 : 0;
+    unsigned Width = std::max(FN.Width, Nibbles + PrefixChars);
+
+    char NumberBuffer[20] = "0x0000000000000000";
+    if (!FN.HexPrefix)
+      NumberBuffer[1] = '0';
+    char *EndPtr = NumberBuffer+Width;
+    char *CurPtr = EndPtr;
+    unsigned long long N = FN.HexValue;
+    while (N) {
+      unsigned char x = static_cast<unsigned char>(N) % 16;
+      *--CurPtr = hexdigit(x, !FN.Upper);
+      N /= 16;
+    }
+
+    return write(NumberBuffer, Width);
+  } else {
+    // Zero is a special case.
+    if (FN.DecValue == 0) {
+      this->indent(FN.Width-1);
+      return *this << '0';
+    }
+    char NumberBuffer[32];
+    char *EndPtr = NumberBuffer+sizeof(NumberBuffer);
+    char *CurPtr = EndPtr;
+    bool Neg = (FN.DecValue < 0);
+    uint64_t N = Neg ? -static_cast<uint64_t>(FN.DecValue) : FN.DecValue;
+    while (N) {
+      *--CurPtr = '0' + char(N % 10);
+      N /= 10;
+    }
+    int Len = EndPtr - CurPtr;
+    int Pad = FN.Width - Len;
+    if (Neg) 
+      --Pad;
+    if (Pad > 0)
+      this->indent(Pad);
+    if (Neg)
+      *this << '-';
+    return write(CurPtr, Len);
+  }
+}
+
+
+/// indent - Insert 'NumSpaces' spaces.
+raw_ostream &raw_ostream::indent(unsigned NumSpaces) {
+  static const char Spaces[] = "                                "
+                               "                                "
+                               "                ";
+
+  // Usually the indentation is small, handle it with a fastpath.
+  if (NumSpaces < array_lengthof(Spaces))
+    return write(Spaces, NumSpaces);
+
+  while (NumSpaces) {
+    unsigned NumToWrite = std::min(NumSpaces,
+                                   (unsigned)array_lengthof(Spaces)-1);
+    write(Spaces, NumToWrite);
+    NumSpaces -= NumToWrite;
+  }
+  return *this;
+}
+
+
+//===----------------------------------------------------------------------===//
+//  Formatted Output
+//===----------------------------------------------------------------------===//
+
+// Out of line virtual method.
+void format_object_base::home() {
+}
+
+//===----------------------------------------------------------------------===//
+//  raw_fd_ostream
+//===----------------------------------------------------------------------===//
+
+static int getFD(StringRef Filename, std::error_code &EC,
+                 sys::fs::OpenFlags Flags) {
+  // Handle "-" as stdout. Note that when we do this, we consider ourself
+  // the owner of stdout. This means that we can do things like close the
+  // file descriptor when we're done and set the "binary" flag globally.
+  if (Filename == "-") {
+    EC = std::error_code();
+    // If user requested binary then put stdout into binary mode if
+    // possible.
+    if (!(Flags & sys::fs::F_Text)) {
+#if defined(_WIN32)
+      _setmode(_fileno(stdout), _O_BINARY);
+#endif
+    }
+    return STDOUT_FILENO;
+  }
+
+  int FD;
+
+  EC = sys::fs::openFileForWrite(Filename, FD, Flags);
+  if (EC)
+    return -1;
+
+  EC = std::error_code();
+  return FD;
+}
+
+raw_fd_ostream::raw_fd_ostream(StringRef Filename, std::error_code &EC,
+                               sys::fs::OpenFlags Flags)
+    : raw_fd_ostream(getFD(Filename, EC, Flags), true) {}
+
+/// FD is the file descriptor that this writes to.  If ShouldClose is true, this
+/// closes the file when the stream is destroyed.
+raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered)
+    : raw_pwrite_stream(unbuffered), FD(fd), ShouldClose(shouldClose),
+      Error(false) {
+  if (FD < 0 ) {
+    ShouldClose = false;
+    return;
+  }
+
+  // Get the starting position.
+  off_t loc = ::lseek(FD, 0, SEEK_CUR);
+#ifdef _WIN32
+  // MSVCRT's _lseek(SEEK_CUR) doesn't return -1 for pipes.
+  SupportsSeeking = loc != (off_t)-1 && ::GetFileType(reinterpret_cast<HANDLE>(::_get_osfhandle(FD))) != FILE_TYPE_PIPE;
+#else
+  SupportsSeeking = loc != (off_t)-1;
+#endif
+  if (!SupportsSeeking)
+    pos = 0;
+  else
+    pos = static_cast<uint64_t>(loc);
+}
+
+raw_fd_ostream::~raw_fd_ostream() {
+  if (FD >= 0) {
+    flush();
+    if (ShouldClose && ::close(FD) < 0)
+      error_detected();
+  }
+
+#ifdef __MINGW32__
+  // On mingw, global dtors should not call exit().
+  // report_fatal_error() invokes exit(). We know report_fatal_error()
+  // might not write messages to stderr when any errors were detected
+  // on FD == 2.
+  if (FD == 2) return;
+#endif
+}
+
+
+void raw_fd_ostream::write_impl(const char *Ptr, size_t Size) {
+  assert(FD >= 0 && "File already closed.");
+  pos += Size;
+
+#ifndef _WIN32
+  bool ShouldWriteInChunks = false;
+#else
+  // Writing a large size of output to Windows console returns ENOMEM. It seems
+  // that, prior to Windows 8, WriteFile() is redirecting to WriteConsole(), and
+  // the latter has a size limit (66000 bytes or less, depending on heap usage).
+  bool ShouldWriteInChunks = !!::_isatty(FD) && !RunningWindows8OrGreater();
+#endif
+
+  do {
+    size_t ChunkSize = Size;
+    if (ChunkSize > 32767 && ShouldWriteInChunks)
+        ChunkSize = 32767;
+
+#ifdef _WIN32
+    int ret = ::_write(FD, Ptr, ChunkSize);
+#else
+    ssize_t ret = ::write(FD, Ptr, ChunkSize);
+#endif
+
+    if (ret < 0) {
+      // If it's a recoverable error, swallow it and retry the write.
+      //
+      // Ideally we wouldn't ever see EAGAIN or EWOULDBLOCK here, since
+      // raw_ostream isn't designed to do non-blocking I/O. However, some
+      // programs, such as old versions of bjam, have mistakenly used
+      // O_NONBLOCK. For compatibility, emulate blocking semantics by
+      // spinning until the write succeeds. If you don't want spinning,
+      // don't use O_NONBLOCK file descriptors with raw_ostream.
+      if (errno == EINTR || errno == EAGAIN
+#ifdef EWOULDBLOCK
+          || errno == EWOULDBLOCK
+#endif
+          )
+        continue;
+
+      // Otherwise it's a non-recoverable error. Note it and quit.
+      error_detected();
+      break;
+    }
+
+    // The write may have written some or all of the data. Update the
+    // size and buffer pointer to reflect the remainder that needs
+    // to be written. If there are no bytes left, we're done.
+    Ptr += ret;
+    Size -= ret;
+  } while (Size > 0);
+}
+
+void raw_fd_ostream::close() {
+  assert(ShouldClose);
+  ShouldClose = false;
+  flush();
+  if (::close(FD) < 0)
+    error_detected();
+  FD = -1;
+}
+
+uint64_t raw_fd_ostream::seek(uint64_t off) {
+  assert(SupportsSeeking && "Stream does not support seeking!");
+  flush();
+  pos = ::lseek(FD, off, SEEK_SET);
+  if (pos == (uint64_t)-1)
+    error_detected();
+  return pos;
+}
+
+void raw_fd_ostream::pwrite_impl(const char *Ptr, size_t Size,
+                                 uint64_t Offset) {
+  uint64_t Pos = tell();
+  seek(Offset);
+  write(Ptr, Size);
+  seek(Pos);
+}
+
+size_t raw_fd_ostream::preferred_buffer_size() const {
+#if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__minix)
+  // Windows and Minix have no st_blksize.
+  assert(FD >= 0 && "File not yet open!");
+  struct stat statbuf;
+  if (fstat(FD, &statbuf) != 0)
+    return 0;
+
+  // If this is a terminal, don't use buffering. Line buffering
+  // would be a more traditional thing to do, but it's not worth
+  // the complexity.
+  if (S_ISCHR(statbuf.st_mode) && isatty(FD))
+    return 0;
+  // Return the preferred block size.
+  return statbuf.st_blksize;
+#else
+  return raw_ostream::preferred_buffer_size();
+#endif
+}
+
+//===----------------------------------------------------------------------===//
+//  outs(), errs(), nulls()
+//===----------------------------------------------------------------------===//
+
+/// outs() - This returns a reference to a raw_ostream for standard output.
+/// Use it like: outs() << "foo" << "bar";
+raw_ostream &llvm::outs() {
+  // Set buffer settings to model stdout behavior.  Delete the file descriptor
+  // when the program exits, forcing error detection.  This means that if you
+  // ever call outs(), you can't open another raw_fd_ostream on stdout, as we'll
+  // close stdout twice and print an error the second time.
+  std::error_code EC;
+  static raw_fd_ostream S("-", EC, sys::fs::F_None);
+  assert(!EC);
+  return S;
+}
+
+/// errs() - This returns a reference to a raw_ostream for standard error.
+/// Use it like: errs() << "foo" << "bar";
+raw_ostream &llvm::errs() {
+  // Set standard error to be unbuffered by default.
+  static raw_fd_ostream S(STDERR_FILENO, false, true);
+  return S;
+}
+
+/// nulls() - This returns a reference to a raw_ostream which discards output.
+raw_ostream &llvm::nulls() {
+  static raw_null_ostream S;
+  return S;
+}
+
+
+//===----------------------------------------------------------------------===//
+//  raw_string_ostream
+//===----------------------------------------------------------------------===//
+
+raw_string_ostream::~raw_string_ostream() {
+  flush();
+}
+
+void raw_string_ostream::write_impl(const char *Ptr, size_t Size) {
+  OS.append(Ptr, Size);
+}
+
+//===----------------------------------------------------------------------===//
+//  raw_svector_ostream
+//===----------------------------------------------------------------------===//
+
+uint64_t raw_svector_ostream::current_pos() const { return OS.size(); }
+
+void raw_svector_ostream::write_impl(const char *Ptr, size_t Size) {
+  OS.append(Ptr, Ptr + Size);
+}
+
+void raw_svector_ostream::pwrite_impl(const char *Ptr, size_t Size,
+                                      uint64_t Offset) {
+  memcpy(OS.data() + Offset, Ptr, Size);
+}
+
+//===----------------------------------------------------------------------===//
+//  raw_null_ostream
+//===----------------------------------------------------------------------===//
+
+raw_null_ostream::~raw_null_ostream() {
+#ifndef NDEBUG
+  // ~raw_ostream asserts that the buffer is empty. This isn't necessary
+  // with raw_null_ostream, but it's better to have raw_null_ostream follow
+  // the rules than to change the rules just for raw_null_ostream.
+  flush();
+#endif
+}
+
+void raw_null_ostream::write_impl(const char * /*Ptr*/, size_t /*Size*/) {}
+
+uint64_t raw_null_ostream::current_pos() const {
+  return 0;
+}
+
+void raw_null_ostream::pwrite_impl(const char * /*Ptr*/, size_t /*Size*/,
+                                   uint64_t /*Offset*/) {}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/Base64.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/Base64.cpp
new file mode 100644
index 0000000..461d752
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/Base64.cpp
@@ -0,0 +1,171 @@
+/* ====================================================================
+ * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. 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.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the Apache Group
+ *    for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * 4. The names "Apache Server" and "Apache Group" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ *    nor may "Apache" appear in their names without prior written
+ *    permission of the Apache Group.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the Apache Group
+ *    for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
+ * EXPRESSED 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 APACHE GROUP OR
+ * ITS 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.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Group and was originally based
+ * on public domain software written at the National Center for
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign.
+ * For more information on the Apache Group and the Apache HTTP server
+ * project, please see <http://www.apache.org/>.
+ *
+ */
+
+#include "support/Base64.h"
+
+#include "llvm/SmallVector.h"
+#include "llvm/raw_ostream.h"
+
+namespace wpi {
+
+// aaaack but it's fast and const should make it shared text page.
+static const unsigned char pr2six[256] = {
+    // ASCII table
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 62, 64, 64, 64, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60,
+    61, 64, 64, 64, 64, 64, 64, 64, 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10,
+    11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64,
+    64, 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
+    43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
+    64, 64, 64, 64, 64, 64, 64, 64, 64};
+
+size_t Base64Decode(llvm::raw_ostream& os, llvm::StringRef encoded) {
+  const unsigned char* end = encoded.bytes_begin();
+  while (pr2six[*end] <= 63 && end != encoded.bytes_end()) ++end;
+  size_t nprbytes = end - encoded.bytes_begin();
+  if (nprbytes == 0) return 0;
+
+  const unsigned char* cur = encoded.bytes_begin();
+
+  while (nprbytes > 4) {
+    os << static_cast<unsigned char>(pr2six[cur[0]] << 2 | pr2six[cur[1]] >> 4);
+    os << static_cast<unsigned char>(pr2six[cur[1]] << 4 | pr2six[cur[2]] >> 2);
+    os << static_cast<unsigned char>(pr2six[cur[2]] << 6 | pr2six[cur[3]]);
+    cur += 4;
+    nprbytes -= 4;
+  }
+
+  // Note: (nprbytes == 1) would be an error, so just ignore that case
+  if (nprbytes > 1)
+    os << static_cast<unsigned char>(pr2six[cur[0]] << 2 | pr2six[cur[1]] >> 4);
+  if (nprbytes > 2)
+    os << static_cast<unsigned char>(pr2six[cur[1]] << 4 | pr2six[cur[2]] >> 2);
+  if (nprbytes > 3)
+    os << static_cast<unsigned char>(pr2six[cur[2]] << 6 | pr2six[cur[3]]);
+
+  return (end - encoded.bytes_begin()) + ((4 - nprbytes) & 3);
+}
+
+size_t Base64Decode(llvm::StringRef encoded, std::string* plain) {
+  plain->resize(0);
+  llvm::raw_string_ostream os(*plain);
+  size_t rv = Base64Decode(os, encoded);
+  os.flush();
+  return rv;
+}
+
+llvm::StringRef Base64Decode(llvm::StringRef encoded, size_t* num_read,
+                             llvm::SmallVectorImpl<char>& buf) {
+  buf.clear();
+  llvm::raw_svector_ostream os(buf);
+  *num_read = Base64Decode(os, encoded);
+  return os.str();
+}
+
+static const char basis_64[] =
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+void Base64Encode(llvm::raw_ostream& os, llvm::StringRef plain) {
+  if (plain.empty()) return;
+  size_t len = plain.size();
+
+  size_t i;
+  for (i = 0; (i + 2) < len; i += 3) {
+    os << basis_64[(plain[i] >> 2) & 0x3F];
+    os << basis_64[((plain[i] & 0x3) << 4) |
+                   (static_cast<int>(plain[i + 1] & 0xF0) >> 4)];
+    os << basis_64[((plain[i + 1] & 0xF) << 2) |
+                   (static_cast<int>(plain[i + 2] & 0xC0) >> 6)];
+    os << basis_64[plain[i + 2] & 0x3F];
+  }
+  if (i < len) {
+    os << basis_64[(plain[i] >> 2) & 0x3F];
+    if (i == (len - 1)) {
+      os << basis_64[((plain[i] & 0x3) << 4)];
+      os << '=';
+    } else {
+      os << basis_64[((plain[i] & 0x3) << 4) |
+                     (static_cast<int>(plain[i + 1] & 0xF0) >> 4)];
+      os << basis_64[((plain[i + 1] & 0xF) << 2)];
+    }
+    os << '=';
+  }
+}
+
+void Base64Encode(llvm::StringRef plain, std::string* encoded) {
+  encoded->resize(0);
+  llvm::raw_string_ostream os(*encoded);
+  Base64Encode(os, plain);
+  os.flush();
+}
+
+llvm::StringRef Base64Encode(llvm::StringRef plain,
+                             llvm::SmallVectorImpl<char>& buf) {
+  buf.clear();
+  llvm::raw_svector_ostream os(buf);
+  Base64Encode(os, plain);
+  return os.str();
+}
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/HttpUtil.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/HttpUtil.cpp
new file mode 100644
index 0000000..7b42e29
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/HttpUtil.cpp
@@ -0,0 +1,336 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/HttpUtil.h"
+
+#include <cctype>
+
+#include "llvm/STLExtras.h"
+#include "llvm/StringExtras.h"
+#include "llvm/raw_ostream.h"
+#include "support/Base64.h"
+#include "tcpsockets/TCPConnector.h"
+
+namespace wpi {
+
+llvm::StringRef UnescapeURI(const llvm::Twine& str,
+                            llvm::SmallVectorImpl<char>& buf, bool* error) {
+  llvm::SmallString<128> strBuf;
+  llvm::StringRef strStr = str.toStringRef(strBuf);
+  buf.clear();
+  for (auto i = strStr.begin(), end = strStr.end(); i != end; ++i) {
+    // pass non-escaped characters to output
+    if (*i != '%') {
+      // decode + to space
+      if (*i == '+')
+        buf.push_back(' ');
+      else
+        buf.push_back(*i);
+      continue;
+    }
+
+    // are there enough characters left?
+    if (i + 2 >= end) {
+      *error = true;
+      return llvm::StringRef{};
+    }
+
+    // replace %xx with the corresponding character
+    unsigned val1 = llvm::hexDigitValue(*++i);
+    if (val1 == -1U) {
+      *error = true;
+      return llvm::StringRef{};
+    }
+    unsigned val2 = llvm::hexDigitValue(*++i);
+    if (val2 == -1U) {
+      *error = true;
+      return llvm::StringRef{};
+    }
+    buf.push_back((val1 << 4) | val2);
+  }
+
+  *error = false;
+  return llvm::StringRef{buf.data(), buf.size()};
+}
+
+llvm::StringRef EscapeURI(const llvm::Twine& str,
+                          llvm::SmallVectorImpl<char>& buf, bool spacePlus) {
+  static const char* const hexLut = "0123456789ABCDEF";
+
+  llvm::SmallString<128> strBuf;
+  llvm::StringRef strStr = str.toStringRef(strBuf);
+  buf.clear();
+  for (auto i = strStr.begin(), end = strStr.end(); i != end; ++i) {
+    // pass unreserved characters to output
+    if (std::isalnum(*i) || *i == '-' || *i == '_' || *i == '.' || *i == '~') {
+      buf.push_back(*i);
+      continue;
+    }
+
+    // encode space to +
+    if (spacePlus && *i == ' ') {
+      buf.push_back('+');
+      continue;
+    }
+
+    // convert others to %xx
+    buf.push_back('%');
+    buf.push_back(hexLut[((*i) >> 4) & 0x0f]);
+    buf.push_back(hexLut[(*i) & 0x0f]);
+  }
+
+  return llvm::StringRef{buf.data(), buf.size()};
+}
+
+bool ParseHttpHeaders(raw_istream& is, llvm::SmallVectorImpl<char>* contentType,
+                      llvm::SmallVectorImpl<char>* contentLength) {
+  if (contentType) contentType->clear();
+  if (contentLength) contentLength->clear();
+
+  bool inContentType = false;
+  bool inContentLength = false;
+  llvm::SmallString<64> lineBuf;
+  for (;;) {
+    llvm::StringRef line = is.getline(lineBuf, 1024).rtrim();
+    if (is.has_error()) return false;
+    if (line.empty()) return true;  // empty line signals end of headers
+
+    // header fields start at the beginning of the line
+    if (!std::isspace(line[0])) {
+      inContentType = false;
+      inContentLength = false;
+      llvm::StringRef field;
+      std::tie(field, line) = line.split(':');
+      field = field.rtrim();
+      if (field == "Content-Type")
+        inContentType = true;
+      else if (field == "Content-Length")
+        inContentLength = true;
+      else
+        continue;  // ignore other fields
+    }
+
+    // collapse whitespace
+    line = line.ltrim();
+
+    // save field data
+    if (inContentType && contentType)
+      contentType->append(line.begin(), line.end());
+    else if (inContentLength && contentLength)
+      contentLength->append(line.begin(), line.end());
+  }
+}
+
+bool FindMultipartBoundary(raw_istream& is, llvm::StringRef boundary,
+                           std::string* saveBuf) {
+  llvm::SmallString<64> searchBuf;
+  searchBuf.resize(boundary.size() + 2);
+  size_t searchPos = 0;
+
+  // Per the spec, the --boundary should be preceded by \r\n, so do a first
+  // pass of 1-byte reads to throw those away (common case) and keep the
+  // last non-\r\n character in searchBuf.
+  if (!saveBuf) {
+    do {
+      is.read(searchBuf.data(), 1);
+      if (is.has_error()) return false;
+    } while (searchBuf[0] == '\r' || searchBuf[0] == '\n');
+    searchPos = 1;
+  }
+
+  // Look for --boundary.  Read boundarysize+2 bytes at a time
+  // during the search to speed up the reads, then fast-scan for -,
+  // and only then match the entire boundary.  This will be slow if
+  // there's a bunch of continuous -'s in the output, but that's unlikely.
+  for (;;) {
+    is.read(searchBuf.data() + searchPos, searchBuf.size() - searchPos);
+    if (is.has_error()) return false;
+
+    // Did we find the boundary?
+    if (searchBuf[0] == '-' && searchBuf[1] == '-' &&
+        searchBuf.substr(2) == boundary)
+      return true;
+
+    // Fast-scan for '-'
+    size_t pos = searchBuf.find('-', searchBuf[0] == '-' ? 1 : 0);
+    if (pos == llvm::StringRef::npos) {
+      if (saveBuf) saveBuf->append(searchBuf.data(), searchBuf.size());
+    } else {
+      if (saveBuf) saveBuf->append(searchBuf.data(), pos);
+
+      // move '-' and following to start of buffer (next read will fill)
+      std::memmove(searchBuf.data(), searchBuf.data() + pos,
+                   searchBuf.size() - pos);
+      searchPos = searchBuf.size() - pos;
+    }
+  }
+}
+
+HttpLocation::HttpLocation(const llvm::Twine& url_, bool* error,
+                           std::string* errorMsg)
+    : url{url_.str()} {
+  // Split apart into components
+  llvm::StringRef query{url};
+
+  // scheme:
+  llvm::StringRef scheme;
+  std::tie(scheme, query) = query.split(':');
+  if (!scheme.equals_lower("http")) {
+    *errorMsg = "only supports http URLs";
+    *error = true;
+    return;
+  }
+
+  // "//"
+  if (!query.startswith("//")) {
+    *errorMsg = "expected http://...";
+    *error = true;
+    return;
+  }
+  query = query.drop_front(2);
+
+  // user:password@host:port/
+  llvm::StringRef authority;
+  std::tie(authority, query) = query.split('/');
+
+  llvm::StringRef userpass, hostport;
+  std::tie(userpass, hostport) = authority.split('@');
+  // split leaves the RHS empty if the split char isn't present...
+  if (hostport.empty()) {
+    hostport = userpass;
+    userpass = llvm::StringRef{};
+  }
+
+  if (!userpass.empty()) {
+    llvm::StringRef rawUser, rawPassword;
+    std::tie(rawUser, rawPassword) = userpass.split(':');
+    llvm::SmallString<64> userBuf, passBuf;
+    user = UnescapeURI(rawUser, userBuf, error);
+    if (*error) {
+      llvm::raw_string_ostream oss(*errorMsg);
+      oss << "could not unescape user \"" << rawUser << "\"";
+      oss.flush();
+      return;
+    }
+    password = UnescapeURI(rawPassword, passBuf, error);
+    if (*error) {
+      llvm::raw_string_ostream oss(*errorMsg);
+      oss << "could not unescape password \"" << rawPassword << "\"";
+      oss.flush();
+      return;
+    }
+  }
+
+  llvm::StringRef portStr;
+  std::tie(host, portStr) = hostport.rsplit(':');
+  if (host.empty()) {
+    *errorMsg = "host is empty";
+    *error = true;
+    return;
+  }
+  if (portStr.empty()) {
+    port = 80;
+  } else if (portStr.getAsInteger(10, port)) {
+    llvm::raw_string_ostream oss(*errorMsg);
+    oss << "port \"" << portStr << "\" is not an integer";
+    oss.flush();
+    *error = true;
+    return;
+  }
+
+  // path?query#fragment
+  std::tie(query, fragment) = query.split('#');
+  std::tie(path, query) = query.split('?');
+
+  // Split query string into parameters
+  while (!query.empty()) {
+    // split out next param and value
+    llvm::StringRef rawParam, rawValue;
+    std::tie(rawParam, query) = query.split('&');
+    if (rawParam.empty()) continue;  // ignore "&&"
+    std::tie(rawParam, rawValue) = rawParam.split('=');
+
+    // unescape param
+    *error = false;
+    llvm::SmallString<64> paramBuf;
+    llvm::StringRef param = UnescapeURI(rawParam, paramBuf, error);
+    if (*error) {
+      llvm::raw_string_ostream oss(*errorMsg);
+      oss << "could not unescape parameter \"" << rawParam << "\"";
+      oss.flush();
+      return;
+    }
+
+    // unescape value
+    llvm::SmallString<64> valueBuf;
+    llvm::StringRef value = UnescapeURI(rawValue, valueBuf, error);
+    if (*error) {
+      llvm::raw_string_ostream oss(*errorMsg);
+      oss << "could not unescape value \"" << rawValue << "\"";
+      oss.flush();
+      return;
+    }
+
+    params.emplace_back(std::make_pair(param, value));
+  }
+
+  *error = false;
+}
+
+void HttpRequest::SetAuth(const HttpLocation& loc) {
+  if (!loc.user.empty()) {
+    llvm::SmallString<64> userpass;
+    userpass += loc.user;
+    userpass += ':';
+    userpass += loc.password;
+    Base64Encode(userpass, &auth);
+  }
+}
+
+bool HttpConnection::Handshake(const HttpRequest& request,
+                               std::string* warnMsg) {
+  // send GET request
+  os << "GET /" << request.path << " HTTP/1.1\r\n";
+  os << "Host: " << request.host << "\r\n";
+  if (!request.auth.empty())
+    os << "Authorization: Basic " << request.auth << "\r\n";
+  os << "\r\n";
+  os.flush();
+
+  // read first line of response
+  llvm::SmallString<64> lineBuf;
+  llvm::StringRef line = is.getline(lineBuf, 1024).rtrim();
+  if (is.has_error()) {
+    *warnMsg = "disconnected before response";
+    return false;
+  }
+
+  // see if we got a HTTP 200 response
+  llvm::StringRef httpver, code, codeText;
+  std::tie(httpver, line) = line.split(' ');
+  std::tie(code, codeText) = line.split(' ');
+  if (!httpver.startswith("HTTP")) {
+    *warnMsg = "did not receive HTTP response";
+    return false;
+  }
+  if (code != "200") {
+    llvm::raw_string_ostream oss(*warnMsg);
+    oss << "received " << code << " " << codeText << " response";
+    oss.flush();
+    return false;
+  }
+
+  // Parse headers
+  if (!ParseHttpHeaders(is, &contentType, &contentLength)) {
+    *warnMsg = "disconnected during headers";
+    return false;
+  }
+
+  return true;
+}
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/hostname.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/hostname.cpp
new file mode 100644
index 0000000..12b5330
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/hostname.cpp
@@ -0,0 +1,65 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/hostname.h"
+
+#ifdef _WIN32
+#include <Winsock2.h>
+#pragma comment(lib, "Ws2_32.lib")
+#else
+#include <unistd.h>
+#endif
+
+#include <string>
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+
+#ifdef _WIN32
+struct WSAHelper {
+  WSAHelper() {
+    WSAData wsaData;
+    WORD wVersionRequested = MAKEWORD(2, 2);
+    WSAStartup(wVersionRequested, &wsaData);
+  }
+  ~WSAHelper() { WSACleanup(); }
+};
+static WSAHelper& GetWSAHelper() {
+  static WSAHelper helper;
+  return helper;
+}
+#endif
+
+namespace wpi {
+static bool GetHostnameImpl(char* name, size_t name_len) {
+#ifdef _WIN32
+  GetWSAHelper();
+#endif
+  if (::gethostname(name, name_len) != 0) return false;
+  name[name_len - 1] =
+      '\0';  // Per POSIX, may not be null terminated if too long
+  return true;
+}
+
+std::string GetHostname() {
+  char name[256];
+  if (!GetHostnameImpl(name, sizeof(name))) return "";
+  return name;
+}
+
+llvm::StringRef GetHostname(llvm::SmallVectorImpl<char>& name) {
+  // Use a tmp array to not require the SmallVector to be too large.
+  char tmpName[256];
+  if (!GetHostnameImpl(tmpName, sizeof(tmpName))) {
+    return llvm::StringRef{};
+  }
+  name.clear();
+  name.append(tmpName, tmpName + std::strlen(tmpName) + 1);
+
+  return llvm::StringRef{name.data(), name.size(), true};
+}
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/json.cpp
new file mode 100644
index 0000000..698a946
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json.cpp
@@ -0,0 +1,1182 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#define WPI_JSON_IMPLEMENTATION
+#include "support/json.h"
+
+using namespace wpi;
+
+namespace wpi {
+namespace detail {
+
+std::string exception::name(const std::string& ename, int id)
+{
+    return "[json.exception." + ename + "." + std::to_string(id) + "] ";
+}
+
+parse_error parse_error::create(int id, size_t byte_, const std::string& what_arg)
+{
+    std::string w = exception::name("parse_error", id) + "parse error" +
+                    (byte_ != 0 ? (" at " + std::to_string(byte_)) : "") +
+                    ": " + what_arg;
+    return parse_error(id, byte_, w.c_str());
+}
+
+invalid_iterator invalid_iterator::create(int id, const std::string& what_arg)
+{
+    std::string w = exception::name("invalid_iterator", id) + what_arg;
+    return invalid_iterator(id, w.c_str());
+}
+
+type_error type_error::create(int id, const std::string& what_arg)
+{
+    std::string w = exception::name("type_error", id) + what_arg;
+    return type_error(id, w.c_str());
+}
+
+out_of_range out_of_range::create(int id, const std::string& what_arg)
+{
+    std::string w = exception::name("out_of_range", id) + what_arg;
+    return out_of_range(id, w.c_str());
+}
+
+other_error other_error::create(int id, const std::string& what_arg)
+{
+    std::string w = exception::name("other_error", id) + what_arg;
+    return other_error(id, w.c_str());
+}
+
+}  // namespace detail
+}  // namespace wpi
+
+json::json_value::json_value(value_t t)
+{
+    switch (t)
+    {
+        case value_t::object:
+        {
+            object = create<object_t>();
+            break;
+        }
+
+        case value_t::array:
+        {
+            array = create<array_t>();
+            break;
+        }
+
+        case value_t::string:
+        {
+            string = create<std::string>("");
+            break;
+        }
+
+        case value_t::boolean:
+        {
+            boolean = false;
+            break;
+        }
+
+        case value_t::number_integer:
+        {
+            number_integer = 0;
+            break;
+        }
+
+        case value_t::number_unsigned:
+        {
+            number_unsigned = 0;
+            break;
+        }
+
+        case value_t::number_float:
+        {
+            number_float = 0.0;
+            break;
+        }
+
+        case value_t::null:
+        {
+            break;
+        }
+
+        default:
+        {
+            if (JSON_UNLIKELY(t == value_t::null))
+            {
+                JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 2.1.1")); // LCOV_EXCL_LINE
+            }
+            break;
+        }
+    }
+}
+
+json::json_value::json_value(llvm::StringRef value)
+{
+    string = create<std::string>(value);
+}
+
+json::json_value::json_value(const std::string& value)
+{
+    string = create<std::string>(value);
+}
+
+json::json_value::json_value(const object_t& value)
+{
+    object = create<object_t>(value);
+}
+
+json::json_value::json_value(const array_t& value)
+{
+    array = create<array_t>(value);
+}
+
+json::json(std::initializer_list<json> init,
+           bool type_deduction,
+           value_t manual_type)
+{
+    // check if each element is an array with two elements whose first
+    // element is a string
+    bool is_an_object = std::all_of(init.begin(), init.end(),
+                                    [](const json & element)
+    {
+        return element.is_array() && element.size() == 2 && element[0].is_string();
+    });
+
+    // adjust type if type deduction is not wanted
+    if (!type_deduction)
+    {
+        // if array is wanted, do not create an object though possible
+        if (manual_type == value_t::array)
+        {
+            is_an_object = false;
+        }
+
+        // if object is wanted but impossible, throw an exception
+        if (manual_type == value_t::object && !is_an_object)
+        {
+            JSON_THROW(type_error::create(301, "cannot create object from initializer list"));
+        }
+    }
+
+    if (is_an_object)
+    {
+        // the initializer list is a list of pairs -> create object
+        m_type = value_t::object;
+        m_value = value_t::object;
+
+        std::for_each(init.begin(), init.end(), [this](const json & element)
+        {
+            m_value.object->emplace_second(*(element[0].m_value.string), element[1]);
+        });
+    }
+    else
+    {
+        // the initializer list describes an array -> create array
+        m_type = value_t::array;
+        m_value.array = create<array_t>(init);
+    }
+
+    assert_invariant();
+}
+
+json::json(size_type cnt, const json& val)
+    : m_type(value_t::array)
+{
+    m_value.array = create<array_t>(cnt, val);
+    assert_invariant();
+}
+
+json::json(const json& other)
+    : m_type(other.m_type)
+{
+    // check of passed value is valid
+    other.assert_invariant();
+
+    switch (m_type)
+    {
+        case value_t::object:
+        {
+            m_value = *other.m_value.object;
+            break;
+        }
+
+        case value_t::array:
+        {
+            m_value = *other.m_value.array;
+            break;
+        }
+
+        case value_t::string:
+        {
+            m_value = *other.m_value.string;
+            break;
+        }
+
+        case value_t::boolean:
+        {
+            m_value = other.m_value.boolean;
+            break;
+        }
+
+        case value_t::number_integer:
+        {
+            m_value = other.m_value.number_integer;
+            break;
+        }
+
+        case value_t::number_unsigned:
+        {
+            m_value = other.m_value.number_unsigned;
+            break;
+        }
+
+        case value_t::number_float:
+        {
+            m_value = other.m_value.number_float;
+            break;
+        }
+
+        default:
+        {
+            break;
+        }
+    }
+
+    assert_invariant();
+}
+
+json::~json()
+{
+    assert_invariant();
+
+    switch (m_type)
+    {
+        case value_t::object:
+        {
+            std::allocator<object_t> alloc;
+            alloc.destroy(m_value.object);
+            alloc.deallocate(m_value.object, 1);
+            break;
+        }
+
+        case value_t::array:
+        {
+            std::allocator<array_t> alloc;
+            alloc.destroy(m_value.array);
+            alloc.deallocate(m_value.array, 1);
+            break;
+        }
+
+        case value_t::string:
+        {
+            std::allocator<std::string> alloc;
+            alloc.destroy(m_value.string);
+            alloc.deallocate(m_value.string, 1);
+            break;
+        }
+
+        default:
+        {
+            // all other types need no specific destructor
+            break;
+        }
+    }
+}
+
+json json::meta()
+{
+    json result;
+
+    result["copyright"] = "(C) 2013-2017 Niels Lohmann, (C) 2017 FIRST";
+    result["name"] = "WPI version of JSON for Modern C++";
+    result["url"] = "https://github.com/wpilibsuite/wpiutil";
+    result["version"] =
+    {
+        {"string", "2.1.1"}, {"major", 2}, {"minor", 1}, {"patch", 1}
+    };
+
+#ifdef _WIN32
+    result["platform"] = "win32";
+#elif defined __linux__
+    result["platform"] = "linux";
+#elif defined __APPLE__
+    result["platform"] = "apple";
+#elif defined __unix__
+    result["platform"] = "unix";
+#else
+    result["platform"] = "unknown";
+#endif
+
+#if defined(__clang__)
+    result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}};
+#elif defined(__ICC) || defined(__INTEL_COMPILER)
+    result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}};
+#elif defined(__GNUC__) || defined(__GNUG__)
+    result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}};
+#elif defined(__HP_cc) || defined(__HP_aCC)
+    result["compiler"] = "hp"
+#elif defined(__IBMCPP__)
+    result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}};
+#elif defined(_MSC_VER)
+    result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}};
+#elif defined(__PGI)
+    result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}};
+#elif defined(__SUNPRO_CC)
+    result["compiler"] = {{"family", "sunpro"}, {"version", __SUNPRO_CC}};
+#else
+    result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}};
+#endif
+
+#ifdef __cplusplus
+    result["compiler"]["c++"] = std::to_string(__cplusplus);
+#else
+    result["compiler"]["c++"] = "unknown";
+#endif
+    return result;
+}
+
+namespace wpi {
+
+bool operator==(json::const_reference lhs, json::const_reference rhs) noexcept
+{
+    using value_t = json::value_t;
+    const auto lhs_type = lhs.type();
+    const auto rhs_type = rhs.type();
+
+    if (lhs_type == rhs_type)
+    {
+        switch (lhs_type)
+        {
+            case value_t::array:
+            {
+                return *lhs.m_value.array == *rhs.m_value.array;
+            }
+            case value_t::object:
+            {
+                return *lhs.m_value.object == *rhs.m_value.object;
+            }
+            case value_t::null:
+            {
+                return true;
+            }
+            case value_t::string:
+            {
+                return *lhs.m_value.string == *rhs.m_value.string;
+            }
+            case value_t::boolean:
+            {
+                return lhs.m_value.boolean == rhs.m_value.boolean;
+            }
+            case value_t::number_integer:
+            {
+                return lhs.m_value.number_integer == rhs.m_value.number_integer;
+            }
+            case value_t::number_unsigned:
+            {
+                return lhs.m_value.number_unsigned == rhs.m_value.number_unsigned;
+            }
+            case value_t::number_float:
+            {
+                return lhs.m_value.number_float == rhs.m_value.number_float;
+            }
+            default:
+            {
+                return false;
+            }
+        }
+    }
+    else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_float)
+    {
+        return static_cast<double>(lhs.m_value.number_integer) == rhs.m_value.number_float;
+    }
+    else if (lhs_type == value_t::number_float && rhs_type == value_t::number_integer)
+    {
+        return lhs.m_value.number_float == static_cast<double>(rhs.m_value.number_integer);
+    }
+    else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_float)
+    {
+        return static_cast<double>(lhs.m_value.number_unsigned) == rhs.m_value.number_float;
+    }
+    else if (lhs_type == value_t::number_float && rhs_type == value_t::number_unsigned)
+    {
+        return lhs.m_value.number_float == static_cast<double>(rhs.m_value.number_unsigned);
+    }
+    else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_integer)
+    {
+        return static_cast<std::int64_t>(lhs.m_value.number_unsigned) == rhs.m_value.number_integer;
+    }
+    else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_unsigned)
+    {
+        return lhs.m_value.number_integer == static_cast<std::int64_t>(rhs.m_value.number_unsigned);
+    }
+
+    return false;
+}
+
+bool operator<(json::const_reference lhs, json::const_reference rhs) noexcept
+{
+    using value_t = json::value_t;
+    const auto lhs_type = lhs.type();
+    const auto rhs_type = rhs.type();
+
+    if (lhs_type == rhs_type)
+    {
+        switch (lhs_type)
+        {
+            case value_t::array:
+            {
+                return (*lhs.m_value.array) < (*rhs.m_value.array);
+            }
+            case value_t::object:
+            {
+                return *lhs.m_value.object < *rhs.m_value.object;
+            }
+            case value_t::null:
+            {
+                return false;
+            }
+            case value_t::string:
+            {
+                return *lhs.m_value.string < *rhs.m_value.string;
+            }
+            case value_t::boolean:
+            {
+                return lhs.m_value.boolean < rhs.m_value.boolean;
+            }
+            case value_t::number_integer:
+            {
+                return lhs.m_value.number_integer < rhs.m_value.number_integer;
+            }
+            case value_t::number_unsigned:
+            {
+                return lhs.m_value.number_unsigned < rhs.m_value.number_unsigned;
+            }
+            case value_t::number_float:
+            {
+                return lhs.m_value.number_float < rhs.m_value.number_float;
+            }
+            default:
+            {
+                return false;
+            }
+        }
+    }
+    else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_float)
+    {
+        return static_cast<double>(lhs.m_value.number_integer) < rhs.m_value.number_float;
+    }
+    else if (lhs_type == value_t::number_float && rhs_type == value_t::number_integer)
+    {
+        return lhs.m_value.number_float < static_cast<double>(rhs.m_value.number_integer);
+    }
+    else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_float)
+    {
+        return static_cast<double>(lhs.m_value.number_unsigned) < rhs.m_value.number_float;
+    }
+    else if (lhs_type == value_t::number_float && rhs_type == value_t::number_unsigned)
+    {
+        return lhs.m_value.number_float < static_cast<double>(rhs.m_value.number_unsigned);
+    }
+    else if (lhs_type == value_t::number_integer && rhs_type == value_t::number_unsigned)
+    {
+        return lhs.m_value.number_integer < static_cast<std::int64_t>(rhs.m_value.number_unsigned);
+    }
+    else if (lhs_type == value_t::number_unsigned && rhs_type == value_t::number_integer)
+    {
+        return static_cast<std::int64_t>(lhs.m_value.number_unsigned) < rhs.m_value.number_integer;
+    }
+
+    // We only reach this line if we cannot compare values. In that case,
+    // we compare types. Note we have to call the operator explicitly,
+    // because MSVC has problems otherwise.
+    return operator<(lhs_type, rhs_type);
+}
+
+}  // namespace wpi
+
+std::string json::type_name() const
+{
+    {
+        switch (m_type)
+        {
+            case value_t::null:
+                return "null";
+            case value_t::object:
+                return "object";
+            case value_t::array:
+                return "array";
+            case value_t::string:
+                return "string";
+            case value_t::boolean:
+                return "boolean";
+            case value_t::discarded:
+                return "discarded";
+            default:
+                return "number";
+        }
+    }
+}
+
+bool json::empty() const noexcept
+{
+    switch (m_type)
+    {
+        case value_t::null:
+        {
+            // null values are empty
+            return true;
+        }
+
+        case value_t::array:
+        {
+            // delegate call to array_t::empty()
+            return m_value.array->empty();
+        }
+
+        case value_t::object:
+        {
+            // delegate call to object_t::empty()
+            return m_value.object->empty();
+        }
+
+        default:
+        {
+            // all other types are nonempty
+            return false;
+        }
+    }
+}
+
+json::size_type json::size() const noexcept
+{
+    switch (m_type)
+    {
+        case value_t::null:
+        {
+            // null values are empty
+            return 0;
+        }
+
+        case value_t::array:
+        {
+            // delegate call to array_t::size()
+            return m_value.array->size();
+        }
+
+        case value_t::object:
+        {
+            // delegate call to object_t::size()
+            return m_value.object->size();
+        }
+
+        default:
+        {
+            // all other types have size 1
+            return 1;
+        }
+    }
+}
+
+json::size_type json::max_size() const noexcept
+{
+    switch (m_type)
+    {
+        case value_t::array:
+        {
+            // delegate call to array_t::max_size()
+            return m_value.array->max_size();
+        }
+
+        case value_t::object:
+        {
+            // delegate call to std::allocator<json>::max_size()
+            return std::allocator<json>().max_size();
+        }
+
+        default:
+        {
+            // all other types have max_size() == size()
+            return size();
+        }
+    }
+}
+
+void json::clear() noexcept
+{
+    switch (m_type)
+    {
+        case value_t::number_integer:
+        {
+            m_value.number_integer = 0;
+            break;
+        }
+
+        case value_t::number_unsigned:
+        {
+            m_value.number_unsigned = 0;
+            break;
+        }
+
+        case value_t::number_float:
+        {
+            m_value.number_float = 0.0;
+            break;
+        }
+
+        case value_t::boolean:
+        {
+            m_value.boolean = false;
+            break;
+        }
+
+        case value_t::string:
+        {
+            m_value.string->clear();
+            break;
+        }
+
+        case value_t::array:
+        {
+            m_value.array->clear();
+            break;
+        }
+
+        case value_t::object:
+        {
+            m_value.object->clear();
+            break;
+        }
+
+        default:
+        {
+            break;
+        }
+    }
+}
+
+void json::push_back(json&& val)
+{
+    // push_back only works for null objects or arrays
+    if (!(is_null() || is_array()))
+    {
+        JSON_THROW(type_error::create(308, "cannot use push_back() with " + type_name()));
+    }
+
+    // transform null object into an array
+    if (is_null())
+    {
+        m_type = value_t::array;
+        m_value = value_t::array;
+        assert_invariant();
+    }
+
+    // add element to array (move semantics)
+    m_value.array->push_back(std::move(val));
+    // invalidate object
+    val.m_type = value_t::null;
+}
+
+void json::push_back(const json& val)
+{
+    // push_back only works for null objects or arrays
+    if (!(is_null() || is_array()))
+    {
+        JSON_THROW(type_error::create(308, "cannot use push_back() with " + type_name()));
+    }
+
+    // transform null object into an array
+    if (is_null())
+    {
+        m_type = value_t::array;
+        m_value = value_t::array;
+        assert_invariant();
+    }
+
+    // add element to array
+    m_value.array->push_back(val);
+}
+
+void json::push_back(const std::pair<llvm::StringRef, json>& val)
+{
+    // push_back only works for null objects or objects
+    if (!(is_null() || is_object()))
+    {
+        JSON_THROW(type_error::create(308, "cannot use push_back() with " + type_name()));
+    }
+
+    // transform null object into an object
+    if (is_null())
+    {
+        m_type = value_t::object;
+        m_value = value_t::object;
+        assert_invariant();
+    }
+
+    // add element to array
+    m_value.object->insert(val);
+}
+
+void json::push_back(std::initializer_list<json> init)
+{
+    if (is_object() && init.size() == 2 && init.begin()->is_string())
+    {
+        const std::string key = *init.begin();
+        push_back(std::pair<llvm::StringRef, json>(key, *(init.begin() + 1)));
+    }
+    else
+    {
+        push_back(json(init));
+    }
+}
+
+json::reference json::at(size_type idx)
+{
+    // at only works for arrays
+    if (is_array())
+    {
+        JSON_TRY
+        {
+            return m_value.array->at(idx);
+        }
+        JSON_CATCH (std::out_of_range&)
+        {
+            // create better exception explanation
+            JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range"));
+        }
+    }
+    else
+    {
+        JSON_THROW(type_error::create(304, "cannot use at() with " + type_name()));
+    }
+}
+
+json::const_reference json::at(size_type idx) const
+{
+    // at only works for arrays
+    if (is_array())
+    {
+        JSON_TRY
+        {
+            return m_value.array->at(idx);
+        }
+        JSON_CATCH (std::out_of_range&)
+        {
+            // create better exception explanation
+            JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range"));
+        }
+    }
+    else
+    {
+        JSON_THROW(type_error::create(304, "cannot use at() with " + type_name()));
+    }
+}
+
+json::reference json::at(llvm::StringRef key)
+{
+    // at only works for objects
+    if (is_object())
+    {
+        auto it = m_value.object->find(key);
+        if (it == m_value.object->end())
+        {
+            JSON_THROW(out_of_range::create(403, "key '" + key.str() + "' not found"));
+        }
+        return it->second;
+    }
+    else
+    {
+        JSON_THROW(type_error::create(304, "cannot use at() with " + type_name()));
+    }
+}
+
+json::const_reference json::at(llvm::StringRef key) const
+{
+    // at only works for objects
+    if (is_object())
+    {
+        auto it = m_value.object->find(key);
+        if (it == m_value.object->end())
+        {
+            // create better exception explanation
+            JSON_THROW(out_of_range::create(403, "key '" + key.str() + "' not found"));
+        }
+        return it->second;
+    }
+    else
+    {
+        JSON_THROW(type_error::create(304, "cannot use at() with " + type_name()));
+    }
+}
+
+json::reference json::operator[](size_type idx)
+{
+    // implicitly convert null value to an empty array
+    if (is_null())
+    {
+        m_type = value_t::array;
+        m_value.array = create<array_t>();
+        assert_invariant();
+    }
+
+    // operator[] only works for arrays
+    if (is_array())
+    {
+        // fill up array with null values if given idx is outside range
+        if (idx >= m_value.array->size())
+        {
+            m_value.array->insert(m_value.array->end(),
+                                  idx - m_value.array->size() + 1,
+                                  json());
+        }
+
+        return m_value.array->operator[](idx);
+    }
+
+    JSON_THROW(type_error::create(305, "cannot use operator[] with " + type_name()));
+}
+
+json::const_reference json::operator[](size_type idx) const
+{
+    // const operator[] only works for arrays
+    if (is_array())
+    {
+        return m_value.array->operator[](idx);
+    }
+
+    JSON_THROW(type_error::create(305, "cannot use operator[] with " + type_name()));
+}
+
+json::reference json::operator[](llvm::StringRef key)
+{
+    // implicitly convert null value to an empty object
+    if (is_null())
+    {
+        m_type = value_t::object;
+        m_value.object = create<object_t>();
+        assert_invariant();
+    }
+
+    // operator[] only works for objects
+    if (is_object())
+    {
+        return m_value.object->operator[](key);
+    }
+
+    JSON_THROW(type_error::create(305, "cannot use operator[] with " + type_name()));
+}
+
+json::const_reference json::operator[](llvm::StringRef key) const
+{
+    // const operator[] only works for objects
+    if (is_object())
+    {
+        assert(m_value.object->find(key) != m_value.object->end());
+        return m_value.object->find(key)->second;
+    }
+
+    JSON_THROW(type_error::create(305, "cannot use operator[] with " + type_name()));
+}
+
+json::reference json::back()
+{
+    switch (m_type)
+    {
+        case value_t::object:
+        {
+            JSON_THROW(type_error::create(305, "cannot use back() with " + type_name()));
+        }
+
+        case value_t::array:
+        {
+            return m_value.array->back();
+        }
+
+        case value_t::null:
+        {
+            JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+        }
+
+        default:
+        {
+            return *this;
+        }
+    }
+}
+
+json::const_reference json::back() const
+{
+    switch (m_type)
+    {
+        case value_t::object:
+        {
+            JSON_THROW(type_error::create(305, "cannot use back() with " + type_name()));
+        }
+
+        case value_t::array:
+        {
+            return m_value.array->back();
+        }
+
+        case value_t::null:
+        {
+            JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+        }
+
+        default:
+        {
+            return *this;
+        }
+    }
+}
+
+json::size_type json::erase(llvm::StringRef key)
+{
+    // this erase only works for objects
+    if (is_object())
+    {
+        return m_value.object->erase(key);
+    }
+
+    JSON_THROW(type_error::create(307, "cannot use erase() with " + type_name()));
+}
+
+void json::erase(const size_type idx)
+{
+    // this erase only works for arrays
+    if (is_array())
+    {
+        if (idx >= size())
+        {
+            JSON_THROW(out_of_range::create(401, "array index " + std::to_string(idx) + " is out of range"));
+        }
+
+        m_value.array->erase(m_value.array->begin() + static_cast<difference_type>(idx));
+    }
+    else
+    {
+        JSON_THROW(type_error::create(307, "cannot use erase() with " + type_name()));
+    }
+}
+
+json::iterator json::find(llvm::StringRef key)
+{
+    auto result = end();
+
+    if (is_object())
+    {
+        result.m_it.object_iterator = m_value.object->find(key);
+    }
+
+    return result;
+}
+
+json::const_iterator json::find(llvm::StringRef key) const
+{
+    auto result = cend();
+
+    if (is_object())
+    {
+        result.m_it.object_iterator = m_value.object->find(key);
+    }
+
+    return result;
+}
+
+json::iterator json::insert(const_iterator pos, const json& val)
+{
+    // insert only works for arrays
+    if (is_array())
+    {
+        // check if iterator pos fits to this JSON value
+        if (pos.m_object != this)
+        {
+            JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value"));
+        }
+
+        // insert to array and return iterator
+        iterator result(this);
+        result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, val);
+        return result;
+    }
+
+    JSON_THROW(type_error::create(309, "cannot use insert() with " + type_name()));
+}
+
+json::iterator json::insert(const_iterator pos, size_type cnt, const json& val)
+{
+    // insert only works for arrays
+    if (is_array())
+    {
+        // check if iterator pos fits to this JSON value
+        if (pos.m_object != this)
+        {
+            JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value"));
+        }
+
+        // insert to array and return iterator
+        iterator result(this);
+#if defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40900
+        // handle C++11 noncompliance: insert(it, cnt, val) returns void
+        if (cnt == 0) {
+            result.m_it.array_iterator = pos.m_it.array_iterator;
+        } else {
+            size_t ipos = pos.m_it.array_iterator - m_value.array->begin();
+            m_value.array->insert(pos.m_it.array_iterator, cnt, val);
+            result.m_it.array_iterator = m_value.array->begin() + ipos;
+        }
+#else
+        result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, cnt, val);
+#endif
+        return result;
+    }
+
+    JSON_THROW(type_error::create(309, "cannot use insert() with " + type_name()));
+}
+
+json::iterator json::insert(const_iterator pos, const_iterator first, const_iterator last)
+{
+    // insert only works for arrays
+    if (!is_array())
+    {
+        JSON_THROW(type_error::create(309, "cannot use insert() with " + type_name()));
+    }
+
+    // check if iterator pos fits to this JSON value
+    if (pos.m_object != this)
+    {
+        JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value"));
+    }
+
+    // check if range iterators belong to the same JSON object
+    if (first.m_object != last.m_object)
+    {
+        JSON_THROW(invalid_iterator::create(210, "iterators do not fit"));
+    }
+
+    if (first.m_object == this || last.m_object == this)
+    {
+        JSON_THROW(invalid_iterator::create(211, "passed iterators may not belong to container"));
+    }
+
+    // insert to array and return iterator
+    iterator result(this);
+#if defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40900
+    // handle C++11 noncompliance: insert(it, first, last) returns void
+    if (first == last) {
+        result.m_it.array_iterator = pos.m_it.array_iterator;
+    } else {
+        size_t ipos = pos.m_it.array_iterator - m_value.array->begin();
+        m_value.array->insert(pos.m_it.array_iterator, first.m_it.array_iterator,
+                              last.m_it.array_iterator);
+        result.m_it.array_iterator = m_value.array->begin() + ipos;
+    }
+#else
+    result.m_it.array_iterator = m_value.array->insert(
+                                     pos.m_it.array_iterator,
+                                     first.m_it.array_iterator,
+                                     last.m_it.array_iterator);
+#endif
+    return result;
+}
+
+json::iterator json::insert(const_iterator pos, std::initializer_list<json> ilist)
+{
+    // insert only works for arrays
+    if (!is_array())
+    {
+        JSON_THROW(type_error::create(309, "cannot use insert() with " + type_name()));
+    }
+
+    // check if iterator pos fits to this JSON value
+    if (pos.m_object != this)
+    {
+        JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value"));
+    }
+
+    // insert to array and return iterator
+    iterator result(this);
+#if defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40900
+    // handle C++11 noncompliance: insert(it, ilist) returns void
+    if (ilist.size() == 0) {
+        result.m_it.array_iterator = pos.m_it.array_iterator;
+    } else {
+        size_t ipos = pos.m_it.array_iterator - m_value.array->begin();
+        m_value.array->insert(pos.m_it.array_iterator, ilist);
+        result.m_it.array_iterator = m_value.array->begin() + ipos;
+    }
+#else
+    result.m_it.array_iterator = m_value.array->insert(pos.m_it.array_iterator, ilist);
+#endif
+    return result;
+}
+
+void json::insert(const_iterator first, const_iterator last)
+{
+    // insert only works for objects
+    if (!is_object())
+    {
+        JSON_THROW(type_error::create(309, "cannot use insert() with " + type_name()));
+    }
+
+    // check if range iterators belong to the same JSON object
+    if (first.m_object != last.m_object)
+    {
+        JSON_THROW(invalid_iterator::create(210, "iterators do not fit"));
+    }
+
+    // passed iterators must belong to objects
+    if (!first.m_object->is_object() || !first.m_object->is_object())
+    {
+        JSON_THROW(invalid_iterator::create(202, "iterators first and last must point to objects"));
+    }
+
+    for (auto it = first.m_it.object_iterator, end = last.m_it.object_iterator; it != end; ++it)
+    {
+        m_value.object->insert(std::make_pair(it->first(), it->second));
+    }
+}
+
+namespace std {
+
+std::size_t hash<wpi::json>::operator()(const wpi::json& j) const
+{
+    // a naive hashing via the string representation
+    const auto& h = hash<std::string>();
+    llvm::SmallVector<char, 128> buf;
+    llvm::raw_svector_ostream os(buf);
+    j.dump(os);
+    return h(os.str());
+}
+
+}  // namespace std
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json_binary_reader.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/json_binary_reader.cpp
new file mode 100644
index 0000000..551b1dd
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json_binary_reader.cpp
@@ -0,0 +1,1233 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#define WPI_JSON_IMPLEMENTATION
+#include "support/json.h"
+
+#include <array>
+
+#include "llvm/Format.h"
+#include "llvm/raw_ostream.h"
+#include "support/raw_istream.h"
+
+using namespace wpi;
+
+namespace {
+
+/*!
+@brief deserialization of CBOR and MessagePack values
+*/
+class binary_reader
+{
+    using value_t = json::value_t;
+
+  public:
+    /*!
+    @brief create a binary reader
+
+    @param[in] adapter  input adapter to read from
+    */
+    explicit binary_reader(wpi::raw_istream& s)
+        : is(s), is_little_endian(little_endianess())
+    {
+    }
+
+    /*!
+    @brief create a JSON value from CBOR input
+
+    @param[in] get_char  whether a new character should be retrieved from
+                         the input (true, default) or whether the last
+                         read character should be considered instead
+
+    @return JSON value created from CBOR input
+
+    @throw parse_error.110 if input ended unexpectedly
+    @throw parse_error.112 if unsupported byte was read
+    */
+    json parse_cbor(bool get_char = true);
+
+    /*!
+    @brief create a JSON value from MessagePack input
+
+    @return JSON value created from MessagePack input
+
+    @throw parse_error.110 if input ended unexpectedly
+    @throw parse_error.112 if unsupported byte was read
+    */
+    json parse_msgpack();
+
+    /*!
+    @brief determine system byte order
+
+    @return true iff system's byte order is little endian
+
+    @note from http://stackoverflow.com/a/1001328/266378
+    */
+    static bool little_endianess() noexcept
+    {
+        int num = 1;
+        return (*reinterpret_cast<char*>(&num) == 1);
+    }
+
+  private:
+    /*!
+    @brief get next character from the input
+
+    This function provides the interface to the used input adapter. It does
+    not throw in case the input reached EOF, but returns
+    `std::char_traits<char>::eof()` in that case.
+
+    @return character read from the input
+    */
+    int get()
+    {
+        ++chars_read;
+        unsigned char c;
+        is.read(c);
+        if (is.has_error())
+        {
+            current = std::char_traits<char>::eof();
+        }
+        else
+        {
+            current = c;
+        }
+        return current;
+    }
+
+    /*
+    @brief read a number from the input
+
+    @tparam T the type of the number
+
+    @return number of type @a T
+
+    @note This function needs to respect the system's endianess, because
+          bytes in CBOR and MessagePack are stored in network order (big
+          endian) and therefore need reordering on little endian systems.
+
+    @throw parse_error.110 if input has less than `sizeof(T)` bytes
+    */
+    template<typename T>
+    T get_number()
+    {
+        // step 1: read input into array with system's byte order
+        std::array<uint8_t, sizeof(T)> vec;
+        for (size_t i = 0; i < sizeof(T); ++i)
+        {
+            get();
+            check_eof();
+
+            // reverse byte order prior to conversion if necessary
+            if (is_little_endian)
+            {
+                vec[sizeof(T) - i - 1] = static_cast<uint8_t>(current);
+            }
+            else
+            {
+                vec[i] = static_cast<uint8_t>(current);
+            }
+        }
+
+        // step 2: convert array into number of type T and return
+        T result;
+        std::memcpy(&result, vec.data(), sizeof(T));
+        return result;
+    }
+
+    /*!
+    @brief create a string by reading characters from the input
+
+    @param[in] len number of bytes to read
+
+    @return string created by reading @a len bytes
+
+    @throw parse_error.110 if input has less than @a len bytes
+    */
+    std::string get_string(const size_t len);
+
+    /*!
+    @brief reads a CBOR string
+
+    This function first reads starting bytes to determine the expected
+    string length and then copies this number of bytes into a string.
+    Additionally, CBOR's strings with indefinite lengths are supported.
+
+    @return string
+
+    @throw parse_error.110 if input ended
+    @throw parse_error.113 if an unexpexted byte is read
+    */
+    std::string get_cbor_string();
+
+    /*!
+    @brief reads a MessagePack string
+
+    This function first reads starting bytes to determine the expected
+    string length and then copies this number of bytes into a string.
+
+    @return string
+
+    @throw parse_error.110 if input ended
+    @throw parse_error.113 if an unexpexted byte is read
+    */
+    std::string get_msgpack_string();
+
+    /*!
+    @brief check if input ended
+    @throw parse_error.110 if input ended
+    */
+    void check_eof() const
+    {
+        if (JSON_UNLIKELY(current == std::char_traits<char>::eof()))
+        {
+            JSON_THROW(json::parse_error::create(110, chars_read, "unexpected end of input"));
+        }
+    }
+
+  private:
+    /// input adapter
+    wpi::raw_istream& is;
+
+    /// the current character
+    int current = std::char_traits<char>::eof();
+
+    /// the number of characters read
+    size_t chars_read = 0;
+
+    /// whether we can assume little endianess
+    const bool is_little_endian = true;
+};
+
+}  // anonymous namespace
+
+json binary_reader::parse_cbor(bool get_char)
+{
+    switch (get_char ? get() : current)
+    {
+        // EOF
+        case std::char_traits<char>::eof():
+        {
+            JSON_THROW(json::parse_error::create(110, chars_read, "unexpected end of input"));
+        }
+
+        // Integer 0x00..0x17 (0..23)
+        case 0x00:
+        case 0x01:
+        case 0x02:
+        case 0x03:
+        case 0x04:
+        case 0x05:
+        case 0x06:
+        case 0x07:
+        case 0x08:
+        case 0x09:
+        case 0x0a:
+        case 0x0b:
+        case 0x0c:
+        case 0x0d:
+        case 0x0e:
+        case 0x0f:
+        case 0x10:
+        case 0x11:
+        case 0x12:
+        case 0x13:
+        case 0x14:
+        case 0x15:
+        case 0x16:
+        case 0x17:
+        {
+            return static_cast<std::uint64_t>(current);
+        }
+
+        case 0x18: // Unsigned integer (one-byte uint8_t follows)
+        {
+            return get_number<uint8_t>();
+        }
+
+        case 0x19: // Unsigned integer (two-byte uint16_t follows)
+        {
+            return get_number<uint16_t>();
+        }
+
+        case 0x1a: // Unsigned integer (four-byte uint32_t follows)
+        {
+            return get_number<uint32_t>();
+        }
+
+        case 0x1b: // Unsigned integer (eight-byte uint64_t follows)
+        {
+            return get_number<uint64_t>();
+        }
+
+        // Negative integer -1-0x00..-1-0x17 (-1..-24)
+        case 0x20:
+        case 0x21:
+        case 0x22:
+        case 0x23:
+        case 0x24:
+        case 0x25:
+        case 0x26:
+        case 0x27:
+        case 0x28:
+        case 0x29:
+        case 0x2a:
+        case 0x2b:
+        case 0x2c:
+        case 0x2d:
+        case 0x2e:
+        case 0x2f:
+        case 0x30:
+        case 0x31:
+        case 0x32:
+        case 0x33:
+        case 0x34:
+        case 0x35:
+        case 0x36:
+        case 0x37:
+        {
+            return static_cast<int8_t>(0x20 - 1 - current);
+        }
+
+        case 0x38: // Negative integer (one-byte uint8_t follows)
+        {
+            // must be uint8_t !
+            return static_cast<std::int64_t>(-1) - get_number<uint8_t>();
+        }
+
+        case 0x39: // Negative integer -1-n (two-byte uint16_t follows)
+        {
+            return static_cast<std::int64_t>(-1) - get_number<uint16_t>();
+        }
+
+        case 0x3a: // Negative integer -1-n (four-byte uint32_t follows)
+        {
+            return static_cast<std::int64_t>(-1) - get_number<uint32_t>();
+        }
+
+        case 0x3b: // Negative integer -1-n (eight-byte uint64_t follows)
+        {
+            return static_cast<std::int64_t>(-1) - static_cast<std::int64_t>(get_number<uint64_t>());
+        }
+
+        // UTF-8 string (0x00..0x17 bytes follow)
+        case 0x60:
+        case 0x61:
+        case 0x62:
+        case 0x63:
+        case 0x64:
+        case 0x65:
+        case 0x66:
+        case 0x67:
+        case 0x68:
+        case 0x69:
+        case 0x6a:
+        case 0x6b:
+        case 0x6c:
+        case 0x6d:
+        case 0x6e:
+        case 0x6f:
+        case 0x70:
+        case 0x71:
+        case 0x72:
+        case 0x73:
+        case 0x74:
+        case 0x75:
+        case 0x76:
+        case 0x77:
+        case 0x78: // UTF-8 string (one-byte uint8_t for n follows)
+        case 0x79: // UTF-8 string (two-byte uint16_t for n follow)
+        case 0x7a: // UTF-8 string (four-byte uint32_t for n follow)
+        case 0x7b: // UTF-8 string (eight-byte uint64_t for n follow)
+        case 0x7f: // UTF-8 string (indefinite length)
+        {
+            return get_cbor_string();
+        }
+
+        // array (0x00..0x17 data items follow)
+        case 0x80:
+        case 0x81:
+        case 0x82:
+        case 0x83:
+        case 0x84:
+        case 0x85:
+        case 0x86:
+        case 0x87:
+        case 0x88:
+        case 0x89:
+        case 0x8a:
+        case 0x8b:
+        case 0x8c:
+        case 0x8d:
+        case 0x8e:
+        case 0x8f:
+        case 0x90:
+        case 0x91:
+        case 0x92:
+        case 0x93:
+        case 0x94:
+        case 0x95:
+        case 0x96:
+        case 0x97:
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(current & 0x1f);
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_cbor());
+            }
+            return result;
+        }
+
+        case 0x98: // array (one-byte uint8_t for n follows)
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(get_number<uint8_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_cbor());
+            }
+            return result;
+        }
+
+        case 0x99: // array (two-byte uint16_t for n follow)
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(get_number<uint16_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_cbor());
+            }
+            return result;
+        }
+
+        case 0x9a: // array (four-byte uint32_t for n follow)
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(get_number<uint32_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_cbor());
+            }
+            return result;
+        }
+
+        case 0x9b: // array (eight-byte uint64_t for n follow)
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(get_number<uint64_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_cbor());
+            }
+            return result;
+        }
+
+        case 0x9f: // array (indefinite length)
+        {
+            json result = value_t::array;
+            while (get() != 0xff)
+            {
+                result.push_back(parse_cbor(false));
+            }
+            return result;
+        }
+
+        // map (0x00..0x17 pairs of data items follow)
+        case 0xa0:
+        case 0xa1:
+        case 0xa2:
+        case 0xa3:
+        case 0xa4:
+        case 0xa5:
+        case 0xa6:
+        case 0xa7:
+        case 0xa8:
+        case 0xa9:
+        case 0xaa:
+        case 0xab:
+        case 0xac:
+        case 0xad:
+        case 0xae:
+        case 0xaf:
+        case 0xb0:
+        case 0xb1:
+        case 0xb2:
+        case 0xb3:
+        case 0xb4:
+        case 0xb5:
+        case 0xb6:
+        case 0xb7:
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(current & 0x1f);
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_cbor_string();
+                result[key] = parse_cbor();
+            }
+            return result;
+        }
+
+        case 0xb8: // map (one-byte uint8_t for n follows)
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(get_number<uint8_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_cbor_string();
+                result[key] = parse_cbor();
+            }
+            return result;
+        }
+
+        case 0xb9: // map (two-byte uint16_t for n follow)
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(get_number<uint16_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_cbor_string();
+                result[key] = parse_cbor();
+            }
+            return result;
+        }
+
+        case 0xba: // map (four-byte uint32_t for n follow)
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(get_number<uint32_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_cbor_string();
+                result[key] = parse_cbor();
+            }
+            return result;
+        }
+
+        case 0xbb: // map (eight-byte uint64_t for n follow)
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(get_number<uint64_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_cbor_string();
+                result[key] = parse_cbor();
+            }
+            return result;
+        }
+
+        case 0xbf: // map (indefinite length)
+        {
+            json result = value_t::object;
+            while (get() != 0xff)
+            {
+                auto key = get_cbor_string();
+                result[key] = parse_cbor();
+            }
+            return result;
+        }
+
+        case 0xf4: // false
+        {
+            return false;
+        }
+
+        case 0xf5: // true
+        {
+            return true;
+        }
+
+        case 0xf6: // null
+        {
+            return value_t::null;
+        }
+
+        case 0xf9: // Half-Precision Float (two-byte IEEE 754)
+        {
+            const int byte1 = get();
+            check_eof();
+            const int byte2 = get();
+            check_eof();
+
+            // code from RFC 7049, Appendix D, Figure 3:
+            // As half-precision floating-point numbers were only added
+            // to IEEE 754 in 2008, today's programming platforms often
+            // still only have limited support for them. It is very
+            // easy to include at least decoding support for them even
+            // without such support. An example of a small decoder for
+            // half-precision floating-point numbers in the C language
+            // is shown in Fig. 3.
+            const int half = (byte1 << 8) + byte2;
+            const int exp = (half >> 10) & 0x1f;
+            const int mant = half & 0x3ff;
+            double val;
+            if (exp == 0)
+            {
+                val = std::ldexp(mant, -24);
+            }
+            else if (exp != 31)
+            {
+                val = std::ldexp(mant + 1024, exp - 25);
+            }
+            else
+            {
+                val = mant == 0
+                      ? std::numeric_limits<double>::infinity()
+                      : std::numeric_limits<double>::quiet_NaN();
+            }
+            return (half & 0x8000) != 0 ? -val : val;
+        }
+
+        case 0xfa: // Single-Precision Float (four-byte IEEE 754)
+        {
+            return get_number<float>();
+        }
+
+        case 0xfb: // Double-Precision Float (eight-byte IEEE 754)
+        {
+            return get_number<double>();
+        }
+
+        default: // anything else (0xFF is handled inside the other types)
+        {
+            std::string s;
+            llvm::raw_string_ostream ss(s);
+            ss << "error reading CBOR; last byte: ";
+            ss << llvm::format_hex(current, 2);
+            JSON_THROW(json::parse_error::create(112, chars_read, ss.str()));
+        }
+    }
+}
+
+std::string binary_reader::get_cbor_string()
+{
+    check_eof();
+
+    switch (current)
+    {
+        // UTF-8 string (0x00..0x17 bytes follow)
+        case 0x60:
+        case 0x61:
+        case 0x62:
+        case 0x63:
+        case 0x64:
+        case 0x65:
+        case 0x66:
+        case 0x67:
+        case 0x68:
+        case 0x69:
+        case 0x6a:
+        case 0x6b:
+        case 0x6c:
+        case 0x6d:
+        case 0x6e:
+        case 0x6f:
+        case 0x70:
+        case 0x71:
+        case 0x72:
+        case 0x73:
+        case 0x74:
+        case 0x75:
+        case 0x76:
+        case 0x77:
+        {
+            const auto len = static_cast<size_t>(current & 0x1f);
+            return get_string(len);
+        }
+
+        case 0x78: // UTF-8 string (one-byte uint8_t for n follows)
+        {
+            const auto len = static_cast<size_t>(get_number<uint8_t>());
+            return get_string(len);
+        }
+
+        case 0x79: // UTF-8 string (two-byte uint16_t for n follow)
+        {
+            const auto len = static_cast<size_t>(get_number<uint16_t>());
+            return get_string(len);
+        }
+
+        case 0x7a: // UTF-8 string (four-byte uint32_t for n follow)
+        {
+            const auto len = static_cast<size_t>(get_number<uint32_t>());
+            return get_string(len);
+        }
+
+        case 0x7b: // UTF-8 string (eight-byte uint64_t for n follow)
+        {
+            const auto len = static_cast<size_t>(get_number<uint64_t>());
+            return get_string(len);
+        }
+
+        case 0x7f: // UTF-8 string (indefinite length)
+        {
+            std::string result;
+            while (get() != 0xff)
+            {
+                check_eof();
+                result.append(1, static_cast<char>(current));
+            }
+            return result;
+        }
+
+        default:
+        {
+            std::string s;
+            llvm::raw_string_ostream ss(s);
+            ss << "expected a CBOR string; last byte: ";
+            ss << llvm::format_hex(current, 2);
+            JSON_THROW(json::parse_error::create(113, chars_read, ss.str()));
+        }
+    }
+}
+
+json binary_reader::parse_msgpack()
+{
+    switch (get())
+    {
+        // EOF
+        case std::char_traits<char>::eof():
+        {
+            JSON_THROW(json::parse_error::create(110, chars_read, "unexpected end of input"));
+        }
+
+        // positive fixint
+        case 0x00:
+        case 0x01:
+        case 0x02:
+        case 0x03:
+        case 0x04:
+        case 0x05:
+        case 0x06:
+        case 0x07:
+        case 0x08:
+        case 0x09:
+        case 0x0a:
+        case 0x0b:
+        case 0x0c:
+        case 0x0d:
+        case 0x0e:
+        case 0x0f:
+        case 0x10:
+        case 0x11:
+        case 0x12:
+        case 0x13:
+        case 0x14:
+        case 0x15:
+        case 0x16:
+        case 0x17:
+        case 0x18:
+        case 0x19:
+        case 0x1a:
+        case 0x1b:
+        case 0x1c:
+        case 0x1d:
+        case 0x1e:
+        case 0x1f:
+        case 0x20:
+        case 0x21:
+        case 0x22:
+        case 0x23:
+        case 0x24:
+        case 0x25:
+        case 0x26:
+        case 0x27:
+        case 0x28:
+        case 0x29:
+        case 0x2a:
+        case 0x2b:
+        case 0x2c:
+        case 0x2d:
+        case 0x2e:
+        case 0x2f:
+        case 0x30:
+        case 0x31:
+        case 0x32:
+        case 0x33:
+        case 0x34:
+        case 0x35:
+        case 0x36:
+        case 0x37:
+        case 0x38:
+        case 0x39:
+        case 0x3a:
+        case 0x3b:
+        case 0x3c:
+        case 0x3d:
+        case 0x3e:
+        case 0x3f:
+        case 0x40:
+        case 0x41:
+        case 0x42:
+        case 0x43:
+        case 0x44:
+        case 0x45:
+        case 0x46:
+        case 0x47:
+        case 0x48:
+        case 0x49:
+        case 0x4a:
+        case 0x4b:
+        case 0x4c:
+        case 0x4d:
+        case 0x4e:
+        case 0x4f:
+        case 0x50:
+        case 0x51:
+        case 0x52:
+        case 0x53:
+        case 0x54:
+        case 0x55:
+        case 0x56:
+        case 0x57:
+        case 0x58:
+        case 0x59:
+        case 0x5a:
+        case 0x5b:
+        case 0x5c:
+        case 0x5d:
+        case 0x5e:
+        case 0x5f:
+        case 0x60:
+        case 0x61:
+        case 0x62:
+        case 0x63:
+        case 0x64:
+        case 0x65:
+        case 0x66:
+        case 0x67:
+        case 0x68:
+        case 0x69:
+        case 0x6a:
+        case 0x6b:
+        case 0x6c:
+        case 0x6d:
+        case 0x6e:
+        case 0x6f:
+        case 0x70:
+        case 0x71:
+        case 0x72:
+        case 0x73:
+        case 0x74:
+        case 0x75:
+        case 0x76:
+        case 0x77:
+        case 0x78:
+        case 0x79:
+        case 0x7a:
+        case 0x7b:
+        case 0x7c:
+        case 0x7d:
+        case 0x7e:
+        case 0x7f:
+        {
+            return static_cast<std::uint64_t>(current);
+        }
+
+        // fixmap
+        case 0x80:
+        case 0x81:
+        case 0x82:
+        case 0x83:
+        case 0x84:
+        case 0x85:
+        case 0x86:
+        case 0x87:
+        case 0x88:
+        case 0x89:
+        case 0x8a:
+        case 0x8b:
+        case 0x8c:
+        case 0x8d:
+        case 0x8e:
+        case 0x8f:
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(current & 0x0f);
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_msgpack_string();
+                result[key] = parse_msgpack();
+            }
+            return result;
+        }
+
+        // fixarray
+        case 0x90:
+        case 0x91:
+        case 0x92:
+        case 0x93:
+        case 0x94:
+        case 0x95:
+        case 0x96:
+        case 0x97:
+        case 0x98:
+        case 0x99:
+        case 0x9a:
+        case 0x9b:
+        case 0x9c:
+        case 0x9d:
+        case 0x9e:
+        case 0x9f:
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(current & 0x0f);
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_msgpack());
+            }
+            return result;
+        }
+
+        // fixstr
+        case 0xa0:
+        case 0xa1:
+        case 0xa2:
+        case 0xa3:
+        case 0xa4:
+        case 0xa5:
+        case 0xa6:
+        case 0xa7:
+        case 0xa8:
+        case 0xa9:
+        case 0xaa:
+        case 0xab:
+        case 0xac:
+        case 0xad:
+        case 0xae:
+        case 0xaf:
+        case 0xb0:
+        case 0xb1:
+        case 0xb2:
+        case 0xb3:
+        case 0xb4:
+        case 0xb5:
+        case 0xb6:
+        case 0xb7:
+        case 0xb8:
+        case 0xb9:
+        case 0xba:
+        case 0xbb:
+        case 0xbc:
+        case 0xbd:
+        case 0xbe:
+        case 0xbf:
+        {
+            return get_msgpack_string();
+        }
+
+        case 0xc0: // nil
+        {
+            return value_t::null;
+        }
+
+        case 0xc2: // false
+        {
+            return false;
+        }
+
+        case 0xc3: // true
+        {
+            return true;
+        }
+
+        case 0xca: // float 32
+        {
+            return get_number<float>();
+        }
+
+        case 0xcb: // float 64
+        {
+            return get_number<double>();
+        }
+
+        case 0xcc: // uint 8
+        {
+            return get_number<uint8_t>();
+        }
+
+        case 0xcd: // uint 16
+        {
+            return get_number<uint16_t>();
+        }
+
+        case 0xce: // uint 32
+        {
+            return get_number<uint32_t>();
+        }
+
+        case 0xcf: // uint 64
+        {
+            return get_number<uint64_t>();
+        }
+
+        case 0xd0: // int 8
+        {
+            return get_number<int8_t>();
+        }
+
+        case 0xd1: // int 16
+        {
+            return get_number<int16_t>();
+        }
+
+        case 0xd2: // int 32
+        {
+            return get_number<int32_t>();
+        }
+
+        case 0xd3: // int 64
+        {
+            return get_number<int64_t>();
+        }
+
+        case 0xd9: // str 8
+        case 0xda: // str 16
+        case 0xdb: // str 32
+        {
+            return get_msgpack_string();
+        }
+
+        case 0xdc: // array 16
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(get_number<uint16_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_msgpack());
+            }
+            return result;
+        }
+
+        case 0xdd: // array 32
+        {
+            json result = value_t::array;
+            const auto len = static_cast<size_t>(get_number<uint32_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                result.push_back(parse_msgpack());
+            }
+            return result;
+        }
+
+        case 0xde: // map 16
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(get_number<uint16_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_msgpack_string();
+                result[key] = parse_msgpack();
+            }
+            return result;
+        }
+
+        case 0xdf: // map 32
+        {
+            json result = value_t::object;
+            const auto len = static_cast<size_t>(get_number<uint32_t>());
+            for (size_t i = 0; i < len; ++i)
+            {
+                get();
+                auto key = get_msgpack_string();
+                result[key] = parse_msgpack();
+            }
+            return result;
+        }
+
+        // positive fixint
+        case 0xe0:
+        case 0xe1:
+        case 0xe2:
+        case 0xe3:
+        case 0xe4:
+        case 0xe5:
+        case 0xe6:
+        case 0xe7:
+        case 0xe8:
+        case 0xe9:
+        case 0xea:
+        case 0xeb:
+        case 0xec:
+        case 0xed:
+        case 0xee:
+        case 0xef:
+        case 0xf0:
+        case 0xf1:
+        case 0xf2:
+        case 0xf3:
+        case 0xf4:
+        case 0xf5:
+        case 0xf6:
+        case 0xf7:
+        case 0xf8:
+        case 0xf9:
+        case 0xfa:
+        case 0xfb:
+        case 0xfc:
+        case 0xfd:
+        case 0xfe:
+        case 0xff:
+        {
+            return static_cast<int8_t>(current);
+        }
+
+        default: // anything else
+        {
+            std::string s;
+            llvm::raw_string_ostream ss(s);
+            ss << "error reading MessagePack; last byte: ";
+            ss << llvm::format_hex(current, 2);
+            JSON_THROW(json::parse_error::create(112, chars_read, ss.str()));
+        }
+    }
+}
+
+std::string binary_reader::get_msgpack_string()
+{
+    check_eof();
+
+    switch (current)
+    {
+        // fixstr
+        case 0xa0:
+        case 0xa1:
+        case 0xa2:
+        case 0xa3:
+        case 0xa4:
+        case 0xa5:
+        case 0xa6:
+        case 0xa7:
+        case 0xa8:
+        case 0xa9:
+        case 0xaa:
+        case 0xab:
+        case 0xac:
+        case 0xad:
+        case 0xae:
+        case 0xaf:
+        case 0xb0:
+        case 0xb1:
+        case 0xb2:
+        case 0xb3:
+        case 0xb4:
+        case 0xb5:
+        case 0xb6:
+        case 0xb7:
+        case 0xb8:
+        case 0xb9:
+        case 0xba:
+        case 0xbb:
+        case 0xbc:
+        case 0xbd:
+        case 0xbe:
+        case 0xbf:
+        {
+            const auto len = static_cast<size_t>(current & 0x1f);
+            return get_string(len);
+        }
+
+        case 0xd9: // str 8
+        {
+            const auto len = static_cast<size_t>(get_number<uint8_t>());
+            return get_string(len);
+        }
+
+        case 0xda: // str 16
+        {
+            const auto len = static_cast<size_t>(get_number<uint16_t>());
+            return get_string(len);
+        }
+
+        case 0xdb: // str 32
+        {
+            const auto len = static_cast<size_t>(get_number<uint32_t>());
+            return get_string(len);
+        }
+
+        default:
+        {
+            std::string s;
+            llvm::raw_string_ostream ss(s);
+            ss << "expected a MessagePack string; last byte: ";
+            ss << llvm::format_hex(current, 2);
+            JSON_THROW(json::parse_error::create(113, chars_read, ss.str()));
+        }
+    }
+}
+
+std::string binary_reader::get_string(const size_t len)
+{
+    std::string result;
+    for (size_t i = 0; i < len; ++i)
+    {
+        get();
+        check_eof();
+        result.append(1, static_cast<char>(current));
+    }
+    return result;
+}
+
+json json::from_cbor(wpi::raw_istream& is)
+{
+    binary_reader br(is);
+    return br.parse_cbor();
+}
+
+json json::from_cbor(llvm::StringRef s)
+{
+    wpi::raw_mem_istream is(s.data(), s.size());
+    binary_reader br(is);
+    return br.parse_cbor();
+}
+
+json json::from_msgpack(wpi::raw_istream& is)
+{
+    binary_reader br(is);
+    return br.parse_msgpack();
+}
+
+json json::from_msgpack(llvm::StringRef s)
+{
+    wpi::raw_mem_istream is(s.data(), s.size());
+    binary_reader br(is);
+    return br.parse_msgpack();
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json_binary_writer.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/json_binary_writer.cpp
new file mode 100644
index 0000000..86a9811
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json_binary_writer.cpp
@@ -0,0 +1,668 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#define WPI_JSON_IMPLEMENTATION
+#include "support/json.h"
+
+#include <array>
+#include <clocale> // lconv, localeconv
+#include <locale> // locale
+#include <numeric> // accumulate
+
+#include "llvm/raw_ostream.h"
+#include "llvm/SmallString.h"
+#include "llvm/StringExtras.h"
+
+using namespace wpi;
+
+/*!
+@brief serialization to CBOR and MessagePack values
+*/
+class json::binary_writer
+{
+  public:
+    /*!
+    @brief create a binary writer
+
+    @param[in] adapter  output adapter to write to
+    */
+    explicit binary_writer(llvm::raw_ostream& s)
+        : is_little_endian(little_endianess()), o(s)
+    {
+    }
+
+    /*!
+    @brief[in] j  JSON value to serialize
+    */
+    void write_cbor(const json& j);
+
+    /*!
+    @brief[in] j  JSON value to serialize
+    */
+    void write_msgpack(const json& j);
+
+    /*!
+    @brief determine system byte order
+
+    @return true iff system's byte order is little endian
+
+    @note from http://stackoverflow.com/a/1001328/266378
+    */
+    static bool little_endianess() noexcept
+    {
+        int num = 1;
+        return (*reinterpret_cast<char*>(&num) == 1);
+    }
+
+  private:
+    /*!
+    @brief[in] str string to serialize
+    */
+    void write_cbor_string(llvm::StringRef str);
+
+    /*!
+    @brief[in] str string to serialize
+    */
+    void write_msgpack_string(llvm::StringRef str);
+
+    /*
+    @brief write a number to output input
+
+    @param[in] n number of type @a T
+    @tparam T the type of the number
+
+    @note This function needs to respect the system's endianess, because
+          bytes in CBOR and MessagePack are stored in network order (big
+          endian) and therefore need reordering on little endian systems.
+    */
+    template<typename T>
+    void write_number(T n)
+    {
+        // step 1: write number to array of length T
+        std::array<uint8_t, sizeof(T)> vec;
+        std::memcpy(vec.data(), &n, sizeof(T));
+
+        // step 2: write array to output (with possible reordering)
+        for (size_t i = 0; i < sizeof(T); ++i)
+        {
+            // reverse byte order prior to conversion if necessary
+            if (is_little_endian)
+            {
+                o << static_cast<unsigned char>(vec[sizeof(T) - i - 1]);
+            }
+            else
+            {
+                o << static_cast<unsigned char>(vec[i]);
+            }
+        }
+    }
+
+  private:
+    /// whether we can assume little endianess
+    const bool is_little_endian = true;
+
+    /// the output
+    llvm::raw_ostream& o;
+};
+
+void json::binary_writer::write_cbor(const json& j)
+{
+    switch (j.type())
+    {
+        case value_t::null:
+        {
+            o << static_cast<unsigned char>(0xf6);
+            break;
+        }
+
+        case value_t::boolean:
+        {
+            o << static_cast<unsigned char>(j.m_value.boolean ? 0xf5 : 0xf4);
+            break;
+        }
+
+        case value_t::number_integer:
+        {
+            if (j.m_value.number_integer >= 0)
+            {
+                // CBOR does not differentiate between positive signed
+                // integers and unsigned integers. Therefore, we used the
+                // code from the value_t::number_unsigned case here.
+                if (j.m_value.number_integer <= 0x17)
+                {
+                    write_number(static_cast<uint8_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer <= (std::numeric_limits<uint8_t>::max)())
+                {
+                    o << static_cast<unsigned char>(0x18);
+                    write_number(static_cast<uint8_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer <= (std::numeric_limits<uint16_t>::max)())
+                {
+                    o << static_cast<unsigned char>(0x19);
+                    write_number(static_cast<uint16_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer <= (std::numeric_limits<uint32_t>::max)())
+                {
+                    o << static_cast<unsigned char>(0x1a);
+                    write_number(static_cast<uint32_t>(j.m_value.number_integer));
+                }
+                else
+                {
+                    o << static_cast<unsigned char>(0x1b);
+                    write_number(static_cast<uint64_t>(j.m_value.number_integer));
+                }
+            }
+            else
+            {
+                // The conversions below encode the sign in the first
+                // byte, and the value is converted to a positive number.
+                const auto positive_number = -1 - j.m_value.number_integer;
+                if (j.m_value.number_integer >= -24)
+                {
+                    write_number(static_cast<uint8_t>(0x20 + positive_number));
+                }
+                else if (positive_number <= (std::numeric_limits<uint8_t>::max)())
+                {
+                    o << static_cast<unsigned char>(0x38);
+                    write_number(static_cast<uint8_t>(positive_number));
+                }
+                else if (positive_number <= (std::numeric_limits<uint16_t>::max)())
+                {
+                    o << static_cast<unsigned char>(0x39);
+                    write_number(static_cast<uint16_t>(positive_number));
+                }
+                else if (positive_number <= (std::numeric_limits<uint32_t>::max)())
+                {
+                    o << static_cast<unsigned char>(0x3a);
+                    write_number(static_cast<uint32_t>(positive_number));
+                }
+                else
+                {
+                    o << static_cast<unsigned char>(0x3b);
+                    write_number(static_cast<uint64_t>(positive_number));
+                }
+            }
+            break;
+        }
+
+        case value_t::number_unsigned:
+        {
+            if (j.m_value.number_unsigned <= 0x17)
+            {
+                write_number(static_cast<uint8_t>(j.m_value.number_unsigned));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint8_t>::max)())
+            {
+                o << static_cast<unsigned char>(0x18);
+                write_number(static_cast<uint8_t>(j.m_value.number_unsigned));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint16_t>::max)())
+            {
+                o << static_cast<unsigned char>(0x19);
+                write_number(static_cast<uint16_t>(j.m_value.number_unsigned));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint32_t>::max)())
+            {
+                o << static_cast<unsigned char>(0x1a);
+                write_number(static_cast<uint32_t>(j.m_value.number_unsigned));
+            }
+            else
+            {
+                o << static_cast<unsigned char>(0x1b);
+                write_number(static_cast<uint64_t>(j.m_value.number_unsigned));
+            }
+            break;
+        }
+
+        case value_t::number_float:
+        {
+            // Double-Precision Float
+            o << static_cast<unsigned char>(0xfb);
+            write_number(j.m_value.number_float);
+            break;
+        }
+
+        case value_t::string:
+        {
+            write_cbor_string(*j.m_value.string);
+            break;
+        }
+
+        case value_t::array:
+        {
+            // step 1: write control byte and the array size
+            const auto N = j.m_value.array->size();
+            if (N <= 0x17)
+            {
+                write_number(static_cast<uint8_t>(0x80 + N));
+            }
+            else if (N <= 0xff)
+            {
+                o << static_cast<unsigned char>(0x98);
+                write_number(static_cast<uint8_t>(N));
+            }
+            else if (N <= 0xffff)
+            {
+                o << static_cast<unsigned char>(0x99);
+                write_number(static_cast<uint16_t>(N));
+            }
+            else if (N <= 0xffffffff)
+            {
+                o << static_cast<unsigned char>(0x9a);
+                write_number(static_cast<uint32_t>(N));
+            }
+            // LCOV_EXCL_START
+            else if (N <= 0xffffffffffffffff)
+            {
+                o << static_cast<unsigned char>(0x9b);
+                write_number(static_cast<uint64_t>(N));
+            }
+            // LCOV_EXCL_STOP
+
+            // step 2: write each element
+            for (const auto& el : *j.m_value.array)
+            {
+                write_cbor(el);
+            }
+            break;
+        }
+
+        case value_t::object:
+        {
+            // step 1: write control byte and the object size
+            const auto N = j.m_value.object->size();
+            if (N <= 0x17)
+            {
+                write_number(static_cast<uint8_t>(0xa0 + N));
+            }
+            else if (N <= 0xff)
+            {
+                o << static_cast<unsigned char>(0xb8);
+                write_number(static_cast<uint8_t>(N));
+            }
+            else if (N <= 0xffff)
+            {
+                o << static_cast<unsigned char>(0xb9);
+                write_number(static_cast<uint16_t>(N));
+            }
+            else if (N <= 0xffffffff)
+            {
+                o << static_cast<unsigned char>(0xba);
+                write_number(static_cast<uint32_t>(N));
+            }
+            // LCOV_EXCL_START
+            else if (N <= 0xffffffffffffffff)
+            {
+                o << static_cast<unsigned char>(0xbb);
+                write_number(static_cast<uint64_t>(N));
+            }
+            // LCOV_EXCL_STOP
+
+            // step 2: write each element
+            for (const auto& el : *j.m_value.object)
+            {
+                write_cbor_string(el.first());
+                write_cbor(el.second);
+            }
+            break;
+        }
+
+        default:
+        {
+            break;
+        }
+    }
+}
+
+void json::binary_writer::write_cbor_string(llvm::StringRef str)
+{
+    // step 1: write control byte and the string length
+    const auto N = str.size();
+    if (N <= 0x17)
+    {
+        write_number(static_cast<uint8_t>(0x60 + N));
+    }
+    else if (N <= 0xff)
+    {
+        o << static_cast<unsigned char>(0x78);
+        write_number(static_cast<uint8_t>(N));
+    }
+    else if (N <= 0xffff)
+    {
+        o << static_cast<unsigned char>(0x79);
+        write_number(static_cast<uint16_t>(N));
+    }
+    else if (N <= 0xffffffff)
+    {
+        o << static_cast<unsigned char>(0x7a);
+        write_number(static_cast<uint32_t>(N));
+    }
+    // LCOV_EXCL_START
+    else if (N <= 0xffffffffffffffff)
+    {
+        o << static_cast<unsigned char>(0x7b);
+        write_number(static_cast<uint64_t>(N));
+    }
+    // LCOV_EXCL_STOP
+
+    // step 2: write the string
+    o << str;
+}
+
+void json::binary_writer::write_msgpack(const json& j)
+{
+    switch (j.type())
+    {
+        case value_t::null:
+        {
+            // nil
+            o << static_cast<unsigned char>(0xc0);
+            break;
+        }
+
+        case value_t::boolean:
+        {
+            // true and false
+            o << static_cast<unsigned char>(j.m_value.boolean ? 0xc3 : 0xc2);
+            break;
+        }
+
+        case value_t::number_integer:
+        {
+            if (j.m_value.number_integer >= 0)
+            {
+                // MessagePack does not differentiate between positive
+                // signed integers and unsigned integers. Therefore, we
+                // used the code from the value_t::number_unsigned case
+                // here.
+                if (j.m_value.number_unsigned < 128)
+                {
+                    // positive fixnum
+                    write_number(static_cast<uint8_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_unsigned <= (std::numeric_limits<uint8_t>::max)())
+                {
+                    // uint 8
+                    o << static_cast<unsigned char>(0xcc);
+                    write_number(static_cast<uint8_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_unsigned <= (std::numeric_limits<uint16_t>::max)())
+                {
+                    // uint 16
+                    o << static_cast<unsigned char>(0xcd);
+                    write_number(static_cast<uint16_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_unsigned <= (std::numeric_limits<uint32_t>::max)())
+                {
+                    // uint 32
+                    o << static_cast<unsigned char>(0xce);
+                    write_number(static_cast<uint32_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_unsigned <= (std::numeric_limits<uint64_t>::max)())
+                {
+                    // uint 64
+                    o << static_cast<unsigned char>(0xcf);
+                    write_number(static_cast<uint64_t>(j.m_value.number_integer));
+                }
+            }
+            else
+            {
+                if (j.m_value.number_integer >= -32)
+                {
+                    // negative fixnum
+                    write_number(static_cast<int8_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer >= (std::numeric_limits<int8_t>::min)() && j.m_value.number_integer <= (std::numeric_limits<int8_t>::max)())
+                {
+                    // int 8
+                    o << static_cast<unsigned char>(0xd0);
+                    write_number(static_cast<int8_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer >= (std::numeric_limits<int16_t>::min)() && j.m_value.number_integer <= (std::numeric_limits<int16_t>::max)())
+                {
+                    // int 16
+                    o << static_cast<unsigned char>(0xd1);
+                    write_number(static_cast<int16_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer >= (std::numeric_limits<int32_t>::min)() && j.m_value.number_integer <= (std::numeric_limits<int32_t>::max)())
+                {
+                    // int 32
+                    o << static_cast<unsigned char>(0xd2);
+                    write_number(static_cast<int32_t>(j.m_value.number_integer));
+                }
+                else if (j.m_value.number_integer >= (std::numeric_limits<int64_t>::min)() && j.m_value.number_integer <= (std::numeric_limits<int64_t>::max)())
+                {
+                    // int 64
+                    o << static_cast<unsigned char>(0xd3);
+                    write_number(static_cast<int64_t>(j.m_value.number_integer));
+                }
+            }
+            break;
+        }
+
+        case value_t::number_unsigned:
+        {
+            if (j.m_value.number_unsigned < 128)
+            {
+                // positive fixnum
+                write_number(static_cast<uint8_t>(j.m_value.number_integer));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint8_t>::max)())
+            {
+                // uint 8
+                o << static_cast<unsigned char>(0xcc);
+                write_number(static_cast<uint8_t>(j.m_value.number_integer));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint16_t>::max)())
+            {
+                // uint 16
+                o << static_cast<unsigned char>(0xcd);
+                write_number(static_cast<uint16_t>(j.m_value.number_integer));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint32_t>::max)())
+            {
+                // uint 32
+                o << static_cast<unsigned char>(0xce);
+                write_number(static_cast<uint32_t>(j.m_value.number_integer));
+            }
+            else if (j.m_value.number_unsigned <= (std::numeric_limits<uint64_t>::max)())
+            {
+                // uint 64
+                o << static_cast<unsigned char>(0xcf);
+                write_number(static_cast<uint64_t>(j.m_value.number_integer));
+            }
+            break;
+        }
+
+        case value_t::number_float:
+        {
+            // float 64
+            o << static_cast<unsigned char>(0xcb);
+            write_number(j.m_value.number_float);
+            break;
+        }
+
+        case value_t::string:
+        {
+            write_msgpack_string(*j.m_value.string);
+            break;
+        }
+
+        case value_t::array:
+        {
+            // step 1: write control byte and the array size
+            const auto N = j.m_value.array->size();
+            if (N <= 15)
+            {
+                // fixarray
+                write_number(static_cast<uint8_t>(0x90 | N));
+            }
+            else if (N <= 0xffff)
+            {
+                // array 16
+                o << static_cast<unsigned char>(0xdc);
+                write_number(static_cast<uint16_t>(N));
+            }
+            else if (N <= 0xffffffff)
+            {
+                // array 32
+                o << static_cast<unsigned char>(0xdd);
+                write_number(static_cast<uint32_t>(N));
+            }
+
+            // step 2: write each element
+            for (const auto& el : *j.m_value.array)
+            {
+                write_msgpack(el);
+            }
+            break;
+        }
+
+        case value_t::object:
+        {
+            // step 1: write control byte and the object size
+            const auto N = j.m_value.object->size();
+            if (N <= 15)
+            {
+                // fixmap
+                write_number(static_cast<uint8_t>(0x80 | (N & 0xf)));
+            }
+            else if (N <= 65535)
+            {
+                // map 16
+                o << static_cast<unsigned char>(0xde);
+                write_number(static_cast<uint16_t>(N));
+            }
+            else if (N <= 4294967295)
+            {
+                // map 32
+                o << static_cast<unsigned char>(0xdf);
+                write_number(static_cast<uint32_t>(N));
+            }
+
+            // step 2: write each element
+            for (const auto& el : *j.m_value.object)
+            {
+                write_msgpack_string(el.first());
+                write_msgpack(el.second);
+            }
+            break;
+        }
+
+        default:
+        {
+            break;
+        }
+    }
+}
+
+void json::binary_writer::write_msgpack_string(llvm::StringRef str)
+{
+    // step 1: write control byte and the string length
+    const auto N = str.size();
+    if (N <= 31)
+    {
+        // fixstr
+        write_number(static_cast<uint8_t>(0xa0 | N));
+    }
+    else if (N <= 255)
+    {
+        // str 8
+        o << static_cast<unsigned char>(0xd9);
+        write_number(static_cast<uint8_t>(N));
+    }
+    else if (N <= 65535)
+    {
+        // str 16
+        o << static_cast<unsigned char>(0xda);
+        write_number(static_cast<uint16_t>(N));
+    }
+    else if (N <= 4294967295)
+    {
+        // str 32
+        o << static_cast<unsigned char>(0xdb);
+        write_number(static_cast<uint32_t>(N));
+    }
+
+    // step 2: write the string
+    o << str;
+}
+
+void json::to_cbor(llvm::raw_ostream& os, const json& j)
+{
+    binary_writer bw(os);
+    bw.write_cbor(j);
+}
+
+llvm::StringRef json::to_cbor(const json& j, llvm::SmallVectorImpl<char> buf)
+{
+    llvm::raw_svector_ostream os(buf);
+    binary_writer bw(os);
+    bw.write_cbor(j);
+    return os.str();
+}
+
+std::string json::to_cbor(const json& j)
+{
+    std::string s;
+    llvm::raw_string_ostream os(s);
+    binary_writer bw(os);
+    bw.write_cbor(j);
+    os.flush();
+    return s;
+}
+
+void json::to_msgpack(llvm::raw_ostream& os, const json& j)
+{
+    binary_writer bw(os);
+    bw.write_msgpack(j);
+}
+
+llvm::StringRef json::to_msgpack(const json& j, llvm::SmallVectorImpl<char> buf)
+{
+    llvm::raw_svector_ostream os(buf);
+    binary_writer bw(os);
+    bw.write_msgpack(j);
+    return os.str();
+}
+
+std::string json::to_msgpack(const json& j)
+{
+    std::string s;
+    llvm::raw_string_ostream os(s);
+    binary_writer bw(os);
+    bw.write_msgpack(j);
+    os.flush();
+    return s;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json_parser.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/json_parser.cpp
new file mode 100644
index 0000000..1ff3313
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json_parser.cpp
@@ -0,0 +1,2095 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#define WPI_JSON_IMPLEMENTATION
+#include "support/json.h"
+
+#include <array>
+#include <clocale> // lconv, localeconv
+#include <locale> // locale
+
+#include "llvm/Format.h"
+#include "llvm/raw_ostream.h"
+#include "llvm/SmallString.h"
+#include "support/raw_istream.h"
+
+using namespace wpi;
+
+namespace {
+
+//////////////////////
+// lexer and parser //
+//////////////////////
+
+/*!
+@brief lexical analysis
+
+This class organizes the lexical analysis during JSON deserialization.
+*/
+class lexer
+{
+  public:
+    /// token types for the parser
+    enum class token_type
+    {
+        uninitialized,   ///< indicating the scanner is uninitialized
+        literal_true,    ///< the `true` literal
+        literal_false,   ///< the `false` literal
+        literal_null,    ///< the `null` literal
+        value_string,    ///< a string -- use get_string() for actual value
+        value_unsigned,  ///< an unsigned integer -- use get_number_unsigned() for actual value
+        value_integer,   ///< a signed integer -- use get_number_integer() for actual value
+        value_float,     ///< an floating point number -- use get_number_float() for actual value
+        begin_array,     ///< the character for array begin `[`
+        begin_object,    ///< the character for object begin `{`
+        end_array,       ///< the character for array end `]`
+        end_object,      ///< the character for object end `}`
+        name_separator,  ///< the name separator `:`
+        value_separator, ///< the value separator `,`
+        parse_error,     ///< indicating a parse error
+        end_of_input     ///< indicating the end of the input buffer
+    };
+
+    /// return name of values of type token_type (only used for errors)
+    static const char* token_type_name(const token_type t) noexcept;
+
+    explicit lexer(wpi::raw_istream& s)
+        : is(s), decimal_point_char(get_decimal_point())
+    {}
+
+  private:
+    /////////////////////
+    // locales
+    /////////////////////
+
+    /// return the locale-dependent decimal point
+    static char get_decimal_point() noexcept
+    {
+        const auto loc = localeconv();
+        assert(loc != nullptr);
+        return (loc->decimal_point == nullptr) ? '.' : loc->decimal_point[0];
+    }
+
+    /////////////////////
+    // scan functions
+    /////////////////////
+
+    /*!
+    @brief get codepoint from 4 hex characters following `\u`
+
+    @return codepoint or -1 in case of an error (e.g. EOF or non-hex
+            character)
+    */
+    int get_codepoint();
+
+    /*!
+    @brief create diagnostic representation of a codepoint
+    @return string "U+XXXX" for codepoint XXXX
+    */
+    static std::string codepoint_to_string(int codepoint);
+
+    /*!
+    @brief scan a string literal
+
+    This function scans a string according to Sect. 7 of RFC 7159. While
+    scanning, bytes are escaped and copied into buffer yytext. Then the
+    function returns successfully.
+
+    @return token_type::value_string if string could be successfully
+            scanned, token_type::parse_error otherwise
+
+    @note In case of errors, variable error_message contains a textual
+          description.
+    */
+    token_type scan_string();
+
+    static void strtof(float& f, const char* str, char** endptr) noexcept
+    {
+        f = std::strtof(str, endptr);
+    }
+
+    static void strtof(double& f, const char* str, char** endptr) noexcept
+    {
+        f = std::strtod(str, endptr);
+    }
+
+    static void strtof(long double& f, const char* str, char** endptr) noexcept
+    {
+        f = std::strtold(str, endptr);
+    }
+
+    /*!
+    @brief scan a number literal
+
+    This function scans a string according to Sect. 6 of RFC 7159.
+
+    The function is realized with a deterministic finite state machine
+    derived from the grammar described in RFC 7159. Starting in state
+    "init", the input is read and used to determined the next state. Only
+    state "done" accepts the number. State "error" is a trap state to model
+    errors. In the table below, "anything" means any character but the ones
+    listed before.
+
+    state    | 0        | 1-9      | e E      | +       | -       | .        | anything
+    ---------|----------|----------|----------|---------|---------|----------|-----------
+    init     | zero     | any1     | [error]  | [error] | minus   | [error]  | [error]
+    minus    | zero     | any1     | [error]  | [error] | [error] | [error]  | [error]
+    zero     | done     | done     | exponent | done    | done    | decimal1 | done
+    any1     | any1     | any1     | exponent | done    | done    | decimal1 | done
+    decimal1 | decimal2 | [error]  | [error]  | [error] | [error] | [error]  | [error]
+    decimal2 | decimal2 | decimal2 | exponent | done    | done    | done     | done
+    exponent | any2     | any2     | [error]  | sign    | sign    | [error]  | [error]
+    sign     | any2     | any2     | [error]  | [error] | [error] | [error]  | [error]
+    any2     | any2     | any2     | done     | done    | done    | done     | done
+
+    The state machine is realized with one label per state (prefixed with
+    "scan_number_") and `goto` statements between them. The state machine
+    contains cycles, but any cycle can be left when EOF is read. Therefore,
+    the function is guaranteed to terminate.
+
+    During scanning, the read bytes are stored in yytext. This string is
+    then converted to a signed integer, an unsigned integer, or a
+    floating-point number.
+
+    @return token_type::value_unsigned, token_type::value_integer, or
+            token_type::value_float if number could be successfully scanned,
+            token_type::parse_error otherwise
+
+    @note The scanner is independent of the current locale. Internally, the
+          locale's decimal point is used instead of `.` to work with the
+          locale-dependent converters.
+    */
+    token_type scan_number();
+
+    token_type scan_true();
+    token_type scan_false();
+    token_type scan_null();
+
+    /////////////////////
+    // input management
+    /////////////////////
+
+    /// reset yytext
+    void reset() noexcept
+    {
+        token_string.resize(0);
+        yytext.resize(0);
+    }
+
+    /// get a character from the input
+    int get()
+    {
+        ++chars_read;
+        if (next_unget)
+        {
+            next_unget = false;
+            return current;
+        }
+        char c;
+        is.read(c);
+        if (is.has_error())
+        {
+            current = std::char_traits<char>::eof();
+        }
+        else
+        {
+            current = static_cast<uint8_t>(c);
+            token_string.push_back(c);
+        }
+        return current;
+    }
+
+    /// add a character to yytext
+    void add(int c)
+    {
+        yytext.push_back(static_cast<char>(c));
+    }
+
+  public:
+    /////////////////////
+    // value getters
+    /////////////////////
+
+    /// return integer value
+    std::int64_t get_number_integer() const noexcept
+    {
+        return value_integer;
+    }
+
+    /// return unsigned integer value
+    std::uint64_t get_number_unsigned() const noexcept
+    {
+        return value_unsigned;
+    }
+
+    /// return floating-point value
+    double get_number_float() const noexcept
+    {
+        return value_float;
+    }
+
+    /// return string value
+    llvm::StringRef get_string()
+    {
+        return yytext.str();
+    }
+
+    /////////////////////
+    // diagnostics
+    /////////////////////
+
+    /// return position of last read token
+    size_t get_position() const noexcept
+    {
+        return chars_read;
+    }
+
+    /// return the last read token (for errors only)
+    std::string get_token_string() const;
+
+    /// return syntax error message
+    const std::string& get_error_message() const noexcept
+    {
+        return error_message;
+    }
+
+    /////////////////////
+    // actual scanner
+    /////////////////////
+
+    token_type scan();
+
+  private:
+    /// input adapter
+    wpi::raw_istream& is;
+
+    /// the current character
+    int current = std::char_traits<char>::eof();
+
+    /// whether get() should return the last character again
+    bool next_unget = false;
+
+    /// the number of characters read
+    size_t chars_read = 0;
+
+    /// buffer for raw byte sequence of the current token
+    llvm::SmallString<128> token_string;
+
+    /// buffer for variable-length tokens (numbers, strings)
+    llvm::SmallString<128> yytext;
+
+    /// a description of occurred lexer errors
+    std::string error_message = "";
+
+    // number values
+    std::int64_t value_integer = 0;
+    std::uint64_t value_unsigned = 0;
+    double value_float = 0;
+
+    /// the decimal point
+    const char decimal_point_char = '.';
+};
+
+}  // anonymous namespace
+
+const char* lexer::token_type_name(const token_type t) noexcept
+{
+    switch (t)
+    {
+        case token_type::uninitialized:
+            return "<uninitialized>";
+        case token_type::literal_true:
+            return "true literal";
+        case token_type::literal_false:
+            return "false literal";
+        case token_type::literal_null:
+            return "null literal";
+        case token_type::value_string:
+            return "string literal";
+        case lexer::token_type::value_unsigned:
+        case lexer::token_type::value_integer:
+        case lexer::token_type::value_float:
+            return "number literal";
+        case token_type::begin_array:
+            return "'['";
+        case token_type::begin_object:
+            return "'{'";
+        case token_type::end_array:
+            return "']'";
+        case token_type::end_object:
+            return "'}'";
+        case token_type::name_separator:
+            return "':'";
+        case token_type::value_separator:
+            return "','";
+        case token_type::parse_error:
+            return "<parse error>";
+        case token_type::end_of_input:
+            return "end of input";
+        default:
+        {
+            // catch non-enum values
+            return "unknown token"; // LCOV_EXCL_LINE
+        }
+    }
+}
+
+int lexer::get_codepoint()
+{
+    // this function only makes sense after reading `\u`
+    assert(current == 'u');
+    int codepoint = 0;
+
+    // byte 1: \uXxxx
+    switch (get())
+    {
+        case '0':
+            break;
+        case '1':
+            codepoint += 0x1000;
+            break;
+        case '2':
+            codepoint += 0x2000;
+            break;
+        case '3':
+            codepoint += 0x3000;
+            break;
+        case '4':
+            codepoint += 0x4000;
+            break;
+        case '5':
+            codepoint += 0x5000;
+            break;
+        case '6':
+            codepoint += 0x6000;
+            break;
+        case '7':
+            codepoint += 0x7000;
+            break;
+        case '8':
+            codepoint += 0x8000;
+            break;
+        case '9':
+            codepoint += 0x9000;
+            break;
+        case 'A':
+        case 'a':
+            codepoint += 0xa000;
+            break;
+        case 'B':
+        case 'b':
+            codepoint += 0xb000;
+            break;
+        case 'C':
+        case 'c':
+            codepoint += 0xc000;
+            break;
+        case 'D':
+        case 'd':
+            codepoint += 0xd000;
+            break;
+        case 'E':
+        case 'e':
+            codepoint += 0xe000;
+            break;
+        case 'F':
+        case 'f':
+            codepoint += 0xf000;
+            break;
+        default:
+            return -1;
+    }
+
+    // byte 2: \uxXxx
+    switch (get())
+    {
+        case '0':
+            break;
+        case '1':
+            codepoint += 0x0100;
+            break;
+        case '2':
+            codepoint += 0x0200;
+            break;
+        case '3':
+            codepoint += 0x0300;
+            break;
+        case '4':
+            codepoint += 0x0400;
+            break;
+        case '5':
+            codepoint += 0x0500;
+            break;
+        case '6':
+            codepoint += 0x0600;
+            break;
+        case '7':
+            codepoint += 0x0700;
+            break;
+        case '8':
+            codepoint += 0x0800;
+            break;
+        case '9':
+            codepoint += 0x0900;
+            break;
+        case 'A':
+        case 'a':
+            codepoint += 0x0a00;
+            break;
+        case 'B':
+        case 'b':
+            codepoint += 0x0b00;
+            break;
+        case 'C':
+        case 'c':
+            codepoint += 0x0c00;
+            break;
+        case 'D':
+        case 'd':
+            codepoint += 0x0d00;
+            break;
+        case 'E':
+        case 'e':
+            codepoint += 0x0e00;
+            break;
+        case 'F':
+        case 'f':
+            codepoint += 0x0f00;
+            break;
+        default:
+            return -1;
+    }
+
+    // byte 3: \uxxXx
+    switch (get())
+    {
+        case '0':
+            break;
+        case '1':
+            codepoint += 0x0010;
+            break;
+        case '2':
+            codepoint += 0x0020;
+            break;
+        case '3':
+            codepoint += 0x0030;
+            break;
+        case '4':
+            codepoint += 0x0040;
+            break;
+        case '5':
+            codepoint += 0x0050;
+            break;
+        case '6':
+            codepoint += 0x0060;
+            break;
+        case '7':
+            codepoint += 0x0070;
+            break;
+        case '8':
+            codepoint += 0x0080;
+            break;
+        case '9':
+            codepoint += 0x0090;
+            break;
+        case 'A':
+        case 'a':
+            codepoint += 0x00a0;
+            break;
+        case 'B':
+        case 'b':
+            codepoint += 0x00b0;
+            break;
+        case 'C':
+        case 'c':
+            codepoint += 0x00c0;
+            break;
+        case 'D':
+        case 'd':
+            codepoint += 0x00d0;
+            break;
+        case 'E':
+        case 'e':
+            codepoint += 0x00e0;
+            break;
+        case 'F':
+        case 'f':
+            codepoint += 0x00f0;
+            break;
+        default:
+            return -1;
+    }
+
+    // byte 4: \uxxxX
+    switch (get())
+    {
+        case '0':
+            break;
+        case '1':
+            codepoint += 0x0001;
+            break;
+        case '2':
+            codepoint += 0x0002;
+            break;
+        case '3':
+            codepoint += 0x0003;
+            break;
+        case '4':
+            codepoint += 0x0004;
+            break;
+        case '5':
+            codepoint += 0x0005;
+            break;
+        case '6':
+            codepoint += 0x0006;
+            break;
+        case '7':
+            codepoint += 0x0007;
+            break;
+        case '8':
+            codepoint += 0x0008;
+            break;
+        case '9':
+            codepoint += 0x0009;
+            break;
+        case 'A':
+        case 'a':
+            codepoint += 0x000a;
+            break;
+        case 'B':
+        case 'b':
+            codepoint += 0x000b;
+            break;
+        case 'C':
+        case 'c':
+            codepoint += 0x000c;
+            break;
+        case 'D':
+        case 'd':
+            codepoint += 0x000d;
+            break;
+        case 'E':
+        case 'e':
+            codepoint += 0x000e;
+            break;
+        case 'F':
+        case 'f':
+            codepoint += 0x000f;
+            break;
+        default:
+            return -1;
+    }
+
+    return codepoint;
+}
+
+std::string lexer::codepoint_to_string(int codepoint)
+{
+    std::string s;
+    llvm::raw_string_ostream ss(s);
+    ss << "U+" << llvm::format_hex_no_prefix(codepoint, 4, true);
+    return ss.str();
+}
+
+lexer::token_type lexer::scan_string()
+{
+    // reset yytext (ignore opening quote)
+    reset();
+
+    // we entered the function by reading an open quote
+    assert(current == '\"');
+
+    while (true)
+    {
+        // get next character
+        get();
+
+        switch (current)
+        {
+            // end of file while parsing string
+            case std::char_traits<char>::eof():
+            {
+                error_message = "invalid string: missing closing quote";
+                return token_type::parse_error;
+            }
+
+            // closing quote
+            case '\"':
+            {
+                // terminate yytext
+                return token_type::value_string;
+            }
+
+            // escapes
+            case '\\':
+            {
+                switch (get())
+                {
+                    // quotation mark
+                    case '\"':
+                        add('\"');
+                        break;
+                    // reverse solidus
+                    case '\\':
+                        add('\\');
+                        break;
+                    // solidus
+                    case '/':
+                        add('/');
+                        break;
+                    // backspace
+                    case 'b':
+                        add('\b');
+                        break;
+                    // form feed
+                    case 'f':
+                        add('\f');
+                        break;
+                    // line feed
+                    case 'n':
+                        add('\n');
+                        break;
+                    // carriage return
+                    case 'r':
+                        add('\r');
+                        break;
+                    // tab
+                    case 't':
+                        add('\t');
+                        break;
+
+                    // unicode escapes
+                    case 'u':
+                    {
+                        int codepoint;
+                        int codepoint1 = get_codepoint();
+
+                        if (JSON_UNLIKELY(codepoint1 == -1))
+                        {
+                            error_message = "invalid string: '\\u' must be followed by 4 hex digits";
+                            return token_type::parse_error;
+                        }
+
+                        // check if code point is a high surrogate
+                        if (0xD800 <= codepoint1 && codepoint1 <= 0xDBFF)
+                        {
+                            // expect next \uxxxx entry
+                            if (JSON_LIKELY(get() == '\\' && get() == 'u'))
+                            {
+                                const int codepoint2 = get_codepoint();
+
+                                if (JSON_UNLIKELY(codepoint2 == -1))
+                                {
+                                    error_message = "invalid string: '\\u' must be followed by 4 hex digits";
+                                    return token_type::parse_error;
+                                }
+
+                                // check if codepoint2 is a low surrogate
+                                if (JSON_LIKELY(0xDC00 <= codepoint2 && codepoint2 <= 0xDFFF))
+                                {
+                                    codepoint =
+                                        // high surrogate occupies the most significant 22 bits
+                                        (codepoint1 << 10)
+                                        // low surrogate occupies the least significant 15 bits
+                                        + codepoint2
+                                        // there is still the 0xD800, 0xDC00 and 0x10000 noise
+                                        // in the result so we have to subtract with:
+                                        // (0xD800 << 10) + DC00 - 0x10000 = 0x35FDC00
+                                        - 0x35FDC00;
+                                }
+                                else
+                                {
+                                    error_message = "invalid string: surrogate " + codepoint_to_string(codepoint1) + " must be followed by U+DC00..U+DFFF instead of " + codepoint_to_string(codepoint2);
+                                    return token_type::parse_error;
+                                }
+                            }
+                            else
+                            {
+                                error_message = "invalid string: surrogate " + codepoint_to_string(codepoint1) + " must be followed by U+DC00..U+DFFF";
+                                return token_type::parse_error;
+                            }
+                        }
+                        else
+                        {
+                            if (JSON_UNLIKELY(0xDC00 <= codepoint1 && codepoint1 <= 0xDFFF))
+                            {
+                                error_message = "invalid string: surrogate " + codepoint_to_string(codepoint1) + " must follow U+D800..U+DBFF";
+                                return token_type::parse_error;
+                            }
+
+                            // only work with first code point
+                            codepoint = codepoint1;
+                        }
+
+                        // result of the above calculation yields a proper codepoint
+                        assert(0x00 <= codepoint && codepoint <= 0x10FFFF);
+
+                        // translate code point to bytes
+                        if (codepoint < 0x80)
+                        {
+                            // 1-byte characters: 0xxxxxxx (ASCII)
+                            add(codepoint);
+                        }
+                        else if (codepoint <= 0x7ff)
+                        {
+                            // 2-byte characters: 110xxxxx 10xxxxxx
+                            add(0xC0 | (codepoint >> 6));
+                            add(0x80 | (codepoint & 0x3F));
+                        }
+                        else if (codepoint <= 0xffff)
+                        {
+                            // 3-byte characters: 1110xxxx 10xxxxxx 10xxxxxx
+                            add(0xE0 | (codepoint >> 12));
+                            add(0x80 | ((codepoint >> 6) & 0x3F));
+                            add(0x80 | (codepoint & 0x3F));
+                        }
+                        else
+                        {
+                            // 4-byte characters: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+                            add(0xF0 | (codepoint >> 18));
+                            add(0x80 | ((codepoint >> 12) & 0x3F));
+                            add(0x80 | ((codepoint >> 6) & 0x3F));
+                            add(0x80 | (codepoint & 0x3F));
+                        }
+
+                        break;
+                    }
+
+                    // other characters after escape
+                    default:
+                        error_message = "invalid string: forbidden character after backslash";
+                        return token_type::parse_error;
+                }
+
+                break;
+            }
+
+            // invalid control characters
+            case 0x00:
+            case 0x01:
+            case 0x02:
+            case 0x03:
+            case 0x04:
+            case 0x05:
+            case 0x06:
+            case 0x07:
+            case 0x08:
+            case 0x09:
+            case 0x0a:
+            case 0x0b:
+            case 0x0c:
+            case 0x0d:
+            case 0x0e:
+            case 0x0f:
+            case 0x10:
+            case 0x11:
+            case 0x12:
+            case 0x13:
+            case 0x14:
+            case 0x15:
+            case 0x16:
+            case 0x17:
+            case 0x18:
+            case 0x19:
+            case 0x1a:
+            case 0x1b:
+            case 0x1c:
+            case 0x1d:
+            case 0x1e:
+            case 0x1f:
+            {
+                error_message = "invalid string: control character " + codepoint_to_string(current) + " must be escaped";
+                return token_type::parse_error;
+            }
+
+            // U+0020..U+007F (except U+0022 (quote) and U+005C (backspace))
+            case 0x20:
+            case 0x21:
+            case 0x23:
+            case 0x24:
+            case 0x25:
+            case 0x26:
+            case 0x27:
+            case 0x28:
+            case 0x29:
+            case 0x2a:
+            case 0x2b:
+            case 0x2c:
+            case 0x2d:
+            case 0x2e:
+            case 0x2f:
+            case 0x30:
+            case 0x31:
+            case 0x32:
+            case 0x33:
+            case 0x34:
+            case 0x35:
+            case 0x36:
+            case 0x37:
+            case 0x38:
+            case 0x39:
+            case 0x3a:
+            case 0x3b:
+            case 0x3c:
+            case 0x3d:
+            case 0x3e:
+            case 0x3f:
+            case 0x40:
+            case 0x41:
+            case 0x42:
+            case 0x43:
+            case 0x44:
+            case 0x45:
+            case 0x46:
+            case 0x47:
+            case 0x48:
+            case 0x49:
+            case 0x4a:
+            case 0x4b:
+            case 0x4c:
+            case 0x4d:
+            case 0x4e:
+            case 0x4f:
+            case 0x50:
+            case 0x51:
+            case 0x52:
+            case 0x53:
+            case 0x54:
+            case 0x55:
+            case 0x56:
+            case 0x57:
+            case 0x58:
+            case 0x59:
+            case 0x5a:
+            case 0x5b:
+            case 0x5d:
+            case 0x5e:
+            case 0x5f:
+            case 0x60:
+            case 0x61:
+            case 0x62:
+            case 0x63:
+            case 0x64:
+            case 0x65:
+            case 0x66:
+            case 0x67:
+            case 0x68:
+            case 0x69:
+            case 0x6a:
+            case 0x6b:
+            case 0x6c:
+            case 0x6d:
+            case 0x6e:
+            case 0x6f:
+            case 0x70:
+            case 0x71:
+            case 0x72:
+            case 0x73:
+            case 0x74:
+            case 0x75:
+            case 0x76:
+            case 0x77:
+            case 0x78:
+            case 0x79:
+            case 0x7a:
+            case 0x7b:
+            case 0x7c:
+            case 0x7d:
+            case 0x7e:
+            case 0x7f:
+            {
+                add(current);
+                break;
+            }
+
+            // U+0080..U+07FF: bytes C2..DF 80..BF
+            case 0xc2:
+            case 0xc3:
+            case 0xc4:
+            case 0xc5:
+            case 0xc6:
+            case 0xc7:
+            case 0xc8:
+            case 0xc9:
+            case 0xca:
+            case 0xcb:
+            case 0xcc:
+            case 0xcd:
+            case 0xce:
+            case 0xcf:
+            case 0xd0:
+            case 0xd1:
+            case 0xd2:
+            case 0xd3:
+            case 0xd4:
+            case 0xd5:
+            case 0xd6:
+            case 0xd7:
+            case 0xd8:
+            case 0xd9:
+            case 0xda:
+            case 0xdb:
+            case 0xdc:
+            case 0xdd:
+            case 0xde:
+            case 0xdf:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                {
+                    add(current);
+                    continue;
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // U+0800..U+0FFF: bytes E0 A0..BF 80..BF
+            case 0xe0:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0xa0 <= current && current <= 0xbf))
+                {
+                    add(current);
+                    get();
+                    if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                    {
+                        add(current);
+                        continue;
+                    }
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // U+1000..U+CFFF: bytes E1..EC 80..BF 80..BF
+            // U+E000..U+FFFF: bytes EE..EF 80..BF 80..BF
+            case 0xe1:
+            case 0xe2:
+            case 0xe3:
+            case 0xe4:
+            case 0xe5:
+            case 0xe6:
+            case 0xe7:
+            case 0xe8:
+            case 0xe9:
+            case 0xea:
+            case 0xeb:
+            case 0xec:
+            case 0xee:
+            case 0xef:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                {
+                    add(current);
+                    get();
+                    if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                    {
+                        add(current);
+                        continue;
+                    }
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // U+D000..U+D7FF: bytes ED 80..9F 80..BF
+            case 0xed:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0x80 <= current && current <= 0x9f))
+                {
+                    add(current);
+                    get();
+                    if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                    {
+                        add(current);
+                        continue;
+                    }
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // U+10000..U+3FFFF F0 90..BF 80..BF 80..BF
+            case 0xf0:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0x90 <= current && current <= 0xbf))
+                {
+                    add(current);
+                    get();
+                    if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                    {
+                        add(current);
+                        get();
+                        if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                        {
+                            add(current);
+                            continue;
+                        }
+                    }
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // U+40000..U+FFFFF F1..F3 80..BF 80..BF 80..BF
+            case 0xf1:
+            case 0xf2:
+            case 0xf3:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                {
+                    add(current);
+                    get();
+                    if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                    {
+                        add(current);
+                        get();
+                        if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                        {
+                            add(current);
+                            continue;
+                        }
+                    }
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // U+100000..U+10FFFF F4 80..8F 80..BF 80..BF
+            case 0xf4:
+            {
+                add(current);
+                get();
+                if (JSON_LIKELY(0x80 <= current && current <= 0x8f))
+                {
+                    add(current);
+                    get();
+                    if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                    {
+                        add(current);
+                        get();
+                        if (JSON_LIKELY(0x80 <= current && current <= 0xbf))
+                        {
+                            add(current);
+                            continue;
+                        }
+                    }
+                }
+
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+
+            // remaining bytes (80..C1 and F5..FF) are ill-formed
+            default:
+            {
+                error_message = "invalid string: ill-formed UTF-8 byte";
+                return token_type::parse_error;
+            }
+        }
+    }
+}
+
+lexer::token_type lexer::scan_number()
+{
+    // reset yytext to store the number's bytes
+    reset();
+
+    // the type of the parsed number; initially set to unsigned; will be
+    // changed if minus sign, decimal point or exponent is read
+    token_type number_type = token_type::value_unsigned;
+
+    // state (init): we just found out we need to scan a number
+    switch (current)
+    {
+        case '-':
+        {
+            add(current);
+            goto scan_number_minus;
+        }
+
+        case '0':
+        {
+            add(current);
+            goto scan_number_zero;
+        }
+
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_any1;
+        }
+
+        default:
+        {
+            // all other characters are rejected outside scan_number()
+            assert(false);  // LCOV_EXCL_LINE
+        }
+    }
+
+scan_number_minus:
+    // state: we just parsed a leading minus sign
+    number_type = token_type::value_integer;
+    switch (get())
+    {
+        case '0':
+        {
+            add(current);
+            goto scan_number_zero;
+        }
+
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_any1;
+        }
+
+        default:
+        {
+            error_message = "invalid number; expected digit after '-'";
+            return token_type::parse_error;
+        }
+    }
+
+scan_number_zero:
+    // state: we just parse a zero (maybe with a leading minus sign)
+    switch (get())
+    {
+        case '.':
+        {
+            add(decimal_point_char);
+            goto scan_number_decimal1;
+        }
+
+        case 'e':
+        case 'E':
+        {
+            add(current);
+            goto scan_number_exponent;
+        }
+
+        default:
+        {
+            goto scan_number_done;
+        }
+    }
+
+scan_number_any1:
+    // state: we just parsed a number 0-9 (maybe with a leading minus sign)
+    switch (get())
+    {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_any1;
+        }
+
+        case '.':
+        {
+            add(decimal_point_char);
+            goto scan_number_decimal1;
+        }
+
+        case 'e':
+        case 'E':
+        {
+            add(current);
+            goto scan_number_exponent;
+        }
+
+        default:
+        {
+            goto scan_number_done;
+        }
+    }
+
+scan_number_decimal1:
+    // state: we just parsed a decimal point
+    number_type = token_type::value_float;
+    switch (get())
+    {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_decimal2;
+        }
+
+        default:
+        {
+            error_message = "invalid number; expected digit after '.'";
+            return token_type::parse_error;
+        }
+    }
+
+scan_number_decimal2:
+    // we just parsed at least one number after a decimal point
+    switch (get())
+    {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_decimal2;
+        }
+
+        case 'e':
+        case 'E':
+        {
+            add(current);
+            goto scan_number_exponent;
+        }
+
+        default:
+        {
+            goto scan_number_done;
+        }
+    }
+
+scan_number_exponent:
+    // we just parsed an exponent
+    number_type = token_type::value_float;
+    switch (get())
+    {
+        case '+':
+        case '-':
+        {
+            add(current);
+            goto scan_number_sign;
+        }
+
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_any2;
+        }
+
+        default:
+        {
+            error_message = "invalid number; expected '+', '-', or digit after exponent";
+            return token_type::parse_error;
+        }
+    }
+
+scan_number_sign:
+    // we just parsed an exponent sign
+    switch (get())
+    {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_any2;
+        }
+
+        default:
+        {
+            error_message = "invalid number; expected digit after exponent sign";
+            return token_type::parse_error;
+        }
+    }
+
+scan_number_any2:
+    // we just parsed a number after the exponent or exponent sign
+    switch (get())
+    {
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+        {
+            add(current);
+            goto scan_number_any2;
+        }
+
+        default:
+        {
+            goto scan_number_done;
+        }
+    }
+
+scan_number_done:
+    // unget the character after the number (we only read it to know
+    // that we are done scanning a number)
+    --chars_read;
+    next_unget = true;
+
+    // try to parse integers first and fall back to floats
+    if (number_type == token_type::value_unsigned)
+    {
+        char* endptr = nullptr;
+        errno = 0;
+        const auto x = std::strtoull(yytext.c_str(), &endptr, 10);
+
+        // we checked the number format before
+        assert(endptr == yytext.data() + yytext.size());
+
+        if (errno == 0)
+        {
+            value_unsigned = static_cast<std::uint64_t>(x);
+            if (value_unsigned == x)
+            {
+                return token_type::value_unsigned;
+            }
+        }
+    }
+    else if (number_type == token_type::value_integer)
+    {
+        char* endptr = nullptr;
+        errno = 0;
+        const auto x = std::strtoll(yytext.c_str(), &endptr, 10);
+
+        // we checked the number format before
+        assert(endptr == yytext.data() + yytext.size());
+
+        if (errno == 0)
+        {
+            value_integer = static_cast<std::int64_t>(x);
+            if (value_integer == x)
+            {
+                return token_type::value_integer;
+            }
+        }
+    }
+
+    // this code is reached if we parse a floating-point number or if
+    // an integer conversion above failed
+    strtof(value_float, yytext.c_str(), nullptr);
+    return token_type::value_float;
+}
+
+lexer::token_type lexer::scan_true()
+{
+    assert(current == 't');
+    if (JSON_LIKELY((get() == 'r' && get() == 'u' && get() == 'e')))
+    {
+        return token_type::literal_true;
+    }
+
+    error_message = "invalid literal; expected 'true'";
+    return token_type::parse_error;
+}
+
+lexer::token_type lexer::scan_false()
+{
+    assert(current == 'f');
+    if (JSON_LIKELY((get() == 'a' && get() == 'l' && get() == 's' && get() == 'e')))
+    {
+        return token_type::literal_false;
+    }
+
+    error_message = "invalid literal; expected 'false'";
+    return token_type::parse_error;
+}
+
+lexer::token_type lexer::scan_null()
+{
+    assert(current == 'n');
+    if (JSON_LIKELY((get() == 'u' && get() == 'l' && get() == 'l')))
+    {
+        return token_type::literal_null;
+    }
+
+    error_message = "invalid literal; expected 'null'";
+    return token_type::parse_error;
+}
+
+std::string lexer::get_token_string() const
+{
+    // escape control characters
+    std::string result;
+    for (auto c : token_string)
+    {
+        if (c == '\0' || c == std::char_traits<char>::eof())
+        {
+            // ignore EOF
+            continue;
+        }
+        else if ('\x00' <= c && c <= '\x1f')
+        {
+            // escape control characters
+            result += "<" + codepoint_to_string(c) + ">";
+        }
+        else
+        {
+            // add character as is
+            result.append(1, c);
+        }
+    }
+
+    return result;
+}
+
+lexer::token_type lexer::scan()
+{
+    // read next character and ignore whitespace
+    do
+    {
+        get();
+    }
+    while (current == ' ' || current == '\t' || current == '\n' || current == '\r');
+
+    switch (current)
+    {
+        // structural characters
+        case '[':
+            return token_type::begin_array;
+        case ']':
+            return token_type::end_array;
+        case '{':
+            return token_type::begin_object;
+        case '}':
+            return token_type::end_object;
+        case ':':
+            return token_type::name_separator;
+        case ',':
+            return token_type::value_separator;
+
+        // literals
+        case 't':
+            return scan_true();
+        case 'f':
+            return scan_false();
+        case 'n':
+            return scan_null();
+
+        // string
+        case '\"':
+            return scan_string();
+
+        // number
+        case '-':
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+            return scan_number();
+
+        // end of input (the null byte is needed when parsing from
+        // string literals)
+        case '\0':
+        case std::char_traits<char>::eof():
+            return token_type::end_of_input;
+
+        // error
+        default:
+            error_message = "invalid literal";
+            return token_type::parse_error;
+    }
+}
+
+/*!
+@brief syntax analysis
+
+This class implements a recursive decent parser.
+*/
+class json::parser
+{
+    using value_t = json::value_t;
+
+  public:
+    /// a parser reading from an input adapter
+    explicit parser(wpi::raw_istream& s,
+                    const parser_callback_t cb = nullptr)
+        : callback(cb), m_lexer(s)
+    {}
+
+    /*!
+    @brief public parser interface
+
+    @param[in] strict  whether to expect the last token to be EOF
+    @return parsed JSON value
+
+    @throw parse_error.101 in case of an unexpected token
+    @throw parse_error.102 if to_unicode fails or surrogate error
+    @throw parse_error.103 if to_unicode fails
+    */
+    json parse(bool strict = true);
+
+    /*!
+    @brief public accept interface
+
+    @param[in] strict  whether to expect the last token to be EOF
+    @return whether the input is a proper JSON text
+    */
+    bool accept(bool strict = true);
+
+  private:
+    /*!
+    @brief the actual parser
+    @throw parse_error.101 in case of an unexpected token
+    @throw parse_error.102 if to_unicode fails or surrogate error
+    @throw parse_error.103 if to_unicode fails
+    */
+    json parse_internal(bool keep);
+
+    /*!
+    @brief the acutal acceptor
+
+    @invariant 1. The last token is not yet processed. Therefore, the
+                  caller of this function must make sure a token has
+                  been read.
+               2. When this function returns, the last token is processed.
+                  That is, the last read character was already considered.
+
+    This invariant makes sure that no token needs to be "unput".
+    */
+    bool accept_internal();
+
+    /// get next token from lexer
+    lexer::token_type get_token()
+    {
+        last_token = m_lexer.scan();
+        return last_token;
+    }
+
+    /*!
+    @throw parse_error.101 if expected token did not occur
+    */
+    void expect(lexer::token_type t) const;
+
+    /*!
+    @throw parse_error.101 if unexpected token occurred
+    */
+    void unexpect(lexer::token_type t) const;
+
+  private:
+    /// current level of recursion
+    int depth = 0;
+    /// callback function
+    const parser_callback_t callback = nullptr;
+    /// the type of the last read token
+    lexer::token_type last_token = lexer::token_type::uninitialized;
+    /// the lexer
+    lexer m_lexer;
+};
+
+json json::parser::parse(bool strict)
+{
+    // read first token
+    get_token();
+
+    json result = parse_internal(true);
+    result.assert_invariant();
+
+    if (strict)
+    {
+        get_token();
+        expect(lexer::token_type::end_of_input);
+    }
+
+    // return parser result and replace it with null in case the
+    // top-level value was discarded by the callback function
+    return result.is_discarded() ? json() : std::move(result);
+}
+
+bool json::parser::accept(bool strict)
+{
+    // read first token
+    get_token();
+
+    if (!accept_internal())
+    {
+        return false;
+    }
+
+    if (strict && get_token() != lexer::token_type::end_of_input)
+    {
+        return false;
+    }
+
+    return true;
+}
+
+json json::parser::parse_internal(bool keep)
+{
+    auto result = json(value_t::discarded);
+
+    switch (last_token)
+    {
+        case lexer::token_type::begin_object:
+        {
+            if (keep && (!callback
+                          || ((keep = callback(depth++, parse_event_t::object_start, result)) != 0)))
+            {
+                // explicitly set result to object to cope with {}
+                result.m_type = value_t::object;
+                result.m_value = value_t::object;
+            }
+
+            // read next token
+            get_token();
+
+            // closing } -> we are done
+            if (last_token == lexer::token_type::end_object)
+            {
+                if (keep && callback && !callback(--depth, parse_event_t::object_end, result))
+                {
+                    result = json(value_t::discarded);
+                }
+                return result;
+            }
+
+            // parse values
+            while (true)
+            {
+                // store key
+                expect(lexer::token_type::value_string);
+                std::string key = m_lexer.get_string();
+
+                bool keep_tag = false;
+                if (keep)
+                {
+                    if (callback)
+                    {
+                        json k(key);
+                        keep_tag = callback(depth, parse_event_t::key, k);
+                    }
+                    else
+                    {
+                        keep_tag = true;
+                    }
+                }
+
+                // parse separator (:)
+                get_token();
+                expect(lexer::token_type::name_separator);
+
+                // parse and add value
+                get_token();
+                auto value = parse_internal(keep);
+                if (keep && keep_tag && !value.is_discarded())
+                {
+                    result[key] = std::move(value);
+                }
+
+                // comma -> next value
+                get_token();
+                if (last_token == lexer::token_type::value_separator)
+                {
+                    get_token();
+                    continue;
+                }
+
+                // closing }
+                expect(lexer::token_type::end_object);
+                break;
+            }
+
+            if (keep && callback && !callback(--depth, parse_event_t::object_end, result))
+            {
+                result = json(value_t::discarded);
+            }
+
+            return result;
+        }
+
+        case lexer::token_type::begin_array:
+        {
+            if (keep && (!callback
+                          || ((keep = callback(depth++, parse_event_t::array_start, result)) != 0)))
+            {
+                // explicitly set result to object to cope with []
+                result.m_type = value_t::array;
+                result.m_value = value_t::array;
+            }
+
+            // read next token
+            get_token();
+
+            // closing ] -> we are done
+            if (last_token == lexer::token_type::end_array)
+            {
+                if (callback && !callback(--depth, parse_event_t::array_end, result))
+                {
+                    result = json(value_t::discarded);
+                }
+                return result;
+            }
+
+            // parse values
+            while (true)
+            {
+                // parse value
+                auto value = parse_internal(keep);
+                if (keep && !value.is_discarded())
+                {
+                    result.push_back(std::move(value));
+                }
+
+                // comma -> next value
+                get_token();
+                if (last_token == lexer::token_type::value_separator)
+                {
+                    get_token();
+                    continue;
+                }
+
+                // closing ]
+                expect(lexer::token_type::end_array);
+                break;
+            }
+
+            if (keep && callback && !callback(--depth, parse_event_t::array_end, result))
+            {
+                result = json(value_t::discarded);
+            }
+
+            return result;
+        }
+
+        case lexer::token_type::literal_null:
+        {
+            result.m_type = value_t::null;
+            break;
+        }
+
+        case lexer::token_type::value_string:
+        {
+            result = json(m_lexer.get_string());
+            break;
+        }
+
+        case lexer::token_type::literal_true:
+        {
+            result.m_type = value_t::boolean;
+            result.m_value = true;
+            break;
+        }
+
+        case lexer::token_type::literal_false:
+        {
+            result.m_type = value_t::boolean;
+            result.m_value = false;
+            break;
+        }
+
+        case lexer::token_type::value_unsigned:
+        {
+            result.m_type = value_t::number_unsigned;
+            result.m_value = m_lexer.get_number_unsigned();
+            break;
+        }
+
+        case lexer::token_type::value_integer:
+        {
+            result.m_type = value_t::number_integer;
+            result.m_value = m_lexer.get_number_integer();
+            break;
+        }
+
+        case lexer::token_type::value_float:
+        {
+            result.m_type = value_t::number_float;
+            result.m_value = m_lexer.get_number_float();
+
+            // throw in case of infinity or NAN
+            if (JSON_UNLIKELY(!std::isfinite(result.m_value.number_float)))
+            {
+                JSON_THROW(json::out_of_range::create(406, "number overflow parsing '" + m_lexer.get_token_string() + "'"));
+            }
+
+            break;
+        }
+
+        default:
+        {
+            // the last token was unexpected
+            unexpect(last_token);
+        }
+    }
+
+    if (keep && callback && !callback(depth, parse_event_t::value, result))
+    {
+        result = json(value_t::discarded);
+    }
+    return result;
+}
+
+bool json::parser::accept_internal()
+{
+    switch (last_token)
+    {
+        case lexer::token_type::begin_object:
+        {
+            // read next token
+            get_token();
+
+            // closing } -> we are done
+            if (last_token == lexer::token_type::end_object)
+            {
+                return true;
+            }
+
+            // parse values
+            while (true)
+            {
+                // parse key
+                if (last_token != lexer::token_type::value_string)
+                {
+                    return false;
+                }
+
+                // parse separator (:)
+                get_token();
+                if (last_token != lexer::token_type::name_separator)
+                {
+                    return false;
+                }
+
+                // parse value
+                get_token();
+                if (!accept_internal())
+                {
+                    return false;
+                }
+
+                // comma -> next value
+                get_token();
+                if (last_token == lexer::token_type::value_separator)
+                {
+                    get_token();
+                    continue;
+                }
+
+                // closing }
+                if (last_token != lexer::token_type::end_object)
+                {
+                    return false;
+                }
+
+                return true;
+            }
+        }
+
+        case lexer::token_type::begin_array:
+        {
+            // read next token
+            get_token();
+
+            // closing ] -> we are done
+            if (last_token == lexer::token_type::end_array)
+            {
+                return true;
+            }
+
+            // parse values
+            while (true)
+            {
+                // parse value
+                if (!accept_internal())
+                {
+                    return false;
+                }
+
+                // comma -> next value
+                get_token();
+                if (last_token == lexer::token_type::value_separator)
+                {
+                    get_token();
+                    continue;
+                }
+
+                // closing ]
+                if (last_token != lexer::token_type::end_array)
+                {
+                    return false;
+                }
+
+                return true;
+            }
+        }
+
+        case lexer::token_type::literal_false:
+        case lexer::token_type::literal_null:
+        case lexer::token_type::literal_true:
+        case lexer::token_type::value_float:
+        case lexer::token_type::value_integer:
+        case lexer::token_type::value_string:
+        case lexer::token_type::value_unsigned:
+        {
+            return true;
+        }
+
+        default:
+        {
+            // the last token was unexpected
+            return false;
+        }
+    }
+}
+
+void json::parser::expect(lexer::token_type t) const
+{
+    if (JSON_UNLIKELY(t != last_token))
+    {
+        std::string error_msg = "syntax error - ";
+        if (last_token == lexer::token_type::parse_error)
+        {
+            error_msg += m_lexer.get_error_message() + "; last read: '" + m_lexer.get_token_string() + "'";
+        }
+        else
+        {
+            error_msg += "unexpected " + std::string(lexer::token_type_name(last_token));
+        }
+
+        error_msg += "; expected " + std::string(lexer::token_type_name(t));
+        JSON_THROW(json::parse_error::create(101, m_lexer.get_position(), error_msg));
+    }
+}
+
+void json::parser::unexpect(lexer::token_type t) const
+{
+    if (JSON_UNLIKELY(t == last_token))
+    {
+        std::string error_msg = "syntax error - ";
+        if (last_token == lexer::token_type::parse_error)
+        {
+            error_msg += m_lexer.get_error_message() + "; last read '" + m_lexer.get_token_string() + "'";
+        }
+        else
+        {
+            error_msg += "unexpected " + std::string(lexer::token_type_name(last_token));
+        }
+
+        JSON_THROW(json::parse_error::create(101, m_lexer.get_position(), error_msg));
+    }
+}
+
+json json::parse(llvm::StringRef s, const parser_callback_t cb)
+{
+    wpi::raw_mem_istream is(s.data(), s.size());
+    return parser(is, cb).parse(true);
+}
+
+json json::parse(wpi::raw_istream& i, const parser_callback_t cb)
+{
+    return parser(i, cb).parse(true);
+}
+
+namespace wpi {
+
+wpi::raw_istream& operator>>(wpi::raw_istream& i, json& j)
+{
+    j = json::parser(i).parse(false);
+    return i;
+}
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json_pointer.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/json_pointer.cpp
new file mode 100644
index 0000000..375805a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json_pointer.cpp
@@ -0,0 +1,540 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#define WPI_JSON_IMPLEMENTATION
+#include "support/json.h"
+
+#include <algorithm>
+#include <numeric> // accumulate
+
+using namespace wpi;
+
+std::string json::json_pointer::to_string() const noexcept
+{
+    return std::accumulate(reference_tokens.begin(),
+                           reference_tokens.end(), std::string{},
+                           [](const std::string & a, const std::string & b)
+    {
+        return a + "/" + escape(b);
+    });
+}
+
+json::reference json::json_pointer::get_and_create(reference j) const
+{
+    pointer result = &j;
+
+    // in case no reference tokens exist, return a reference to the
+    // JSON value j which will be overwritten by a primitive value
+    for (const auto& reference_token : reference_tokens)
+    {
+        switch (result->m_type)
+        {
+            case value_t::null:
+            {
+                if (reference_token == "0")
+                {
+                    // start a new array if reference token is 0
+                    result = &result->operator[](0);
+                }
+                else
+                {
+                    // start a new object otherwise
+                    result = &result->operator[](reference_token);
+                }
+                break;
+            }
+
+            case value_t::object:
+            {
+                // create an entry in the object
+                result = &result->operator[](reference_token);
+                break;
+            }
+
+            case value_t::array:
+            {
+                // create an entry in the array
+                JSON_TRY
+                {
+                    result = &result->operator[](static_cast<size_type>(std::stoi(reference_token)));
+                }
+                JSON_CATCH (std::invalid_argument&)
+                {
+                    JSON_THROW(parse_error::create(109, 0, "array index '" + reference_token + "' is not a number"));
+                }
+                break;
+            }
+
+            /*
+            The following code is only reached if there exists a
+            reference token _and_ the current value is primitive. In
+            this case, we have an error situation, because primitive
+            values may only occur as single value; that is, with an
+            empty list of reference tokens.
+            */
+            default:
+            {
+                JSON_THROW(type_error::create(313, "invalid value to unflatten"));
+            }
+        }
+    }
+
+    return *result;
+}
+
+json::reference json::json_pointer::get_unchecked(pointer ptr) const
+{
+    for (const auto& reference_token : reference_tokens)
+    {
+        // convert null values to arrays or objects before continuing
+        if (ptr->m_type == value_t::null)
+        {
+            // check if reference token is a number
+            const bool nums = std::all_of(reference_token.begin(),
+                                          reference_token.end(),
+                                          [](const char x)
+            {
+                return (x >= '0' && x <= '9');
+            });
+
+            // change value to array for numbers or "-" or to object
+            // otherwise
+            if (nums || reference_token == "-")
+            {
+                *ptr = value_t::array;
+            }
+            else
+            {
+                *ptr = value_t::object;
+            }
+        }
+
+        switch (ptr->m_type)
+        {
+            case value_t::object:
+            {
+                // use unchecked object access
+                ptr = &ptr->operator[](reference_token);
+                break;
+            }
+
+            case value_t::array:
+            {
+                // error condition (cf. RFC 6901, Sect. 4)
+                if (reference_token.size() > 1 && reference_token[0] == '0')
+                {
+                    JSON_THROW(parse_error::create(106, 0, "array index '" + reference_token + "' must not begin with '0'"));
+                }
+
+                if (reference_token == "-")
+                {
+                    // explicitly treat "-" as index beyond the end
+                    ptr = &ptr->operator[](ptr->m_value.array->size());
+                }
+                else
+                {
+                    // convert array index to number; unchecked access
+                    JSON_TRY
+                    {
+                        ptr = &ptr->operator[](static_cast<size_type>(std::stoi(reference_token)));
+                    }
+                    JSON_CATCH (std::invalid_argument&)
+                    {
+                        JSON_THROW(parse_error::create(109, 0, "array index '" + reference_token + "' is not a number"));
+                    }
+                }
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(out_of_range::create(404, "unresolved reference token '" + reference_token + "'"));
+            }
+        }
+    }
+
+    return *ptr;
+}
+
+json::reference json::json_pointer::get_checked(pointer ptr) const
+{
+    for (const auto& reference_token : reference_tokens)
+    {
+        switch (ptr->m_type)
+        {
+            case value_t::object:
+            {
+                // note: at performs range check
+                ptr = &ptr->at(reference_token);
+                break;
+            }
+
+            case value_t::array:
+            {
+                if (reference_token == "-")
+                {
+                    // "-" always fails the range check
+                    JSON_THROW(out_of_range::create(402, "array index '-' (" +
+                                                    std::to_string(ptr->m_value.array->size()) +
+                                                    ") is out of range"));
+                }
+
+                // error condition (cf. RFC 6901, Sect. 4)
+                if (reference_token.size() > 1 && reference_token[0] == '0')
+                {
+                    JSON_THROW(parse_error::create(106, 0, "array index '" + reference_token + "' must not begin with '0'"));
+                }
+
+                // note: at performs range check
+                JSON_TRY
+                {
+                    ptr = &ptr->at(static_cast<size_type>(std::stoi(reference_token)));
+                }
+                JSON_CATCH (std::invalid_argument&)
+                {
+                    JSON_THROW(parse_error::create(109, 0, "array index '" + reference_token + "' is not a number"));
+                }
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(out_of_range::create(404, "unresolved reference token '" + reference_token + "'"));
+            }
+        }
+    }
+
+    return *ptr;
+}
+
+json::const_reference json::json_pointer::get_unchecked(const_pointer ptr) const
+{
+    for (const auto& reference_token : reference_tokens)
+    {
+        switch (ptr->m_type)
+        {
+            case value_t::object:
+            {
+                // use unchecked object access
+                ptr = &ptr->operator[](reference_token);
+                break;
+            }
+
+            case value_t::array:
+            {
+                if (reference_token == "-")
+                {
+                    // "-" cannot be used for const access
+                    JSON_THROW(out_of_range::create(402, "array index '-' (" +
+                                                    std::to_string(ptr->m_value.array->size()) +
+                                                    ") is out of range"));
+                }
+
+                // error condition (cf. RFC 6901, Sect. 4)
+                if (reference_token.size() > 1 && reference_token[0] == '0')
+                {
+                    JSON_THROW(parse_error::create(106, 0, "array index '" + reference_token + "' must not begin with '0'"));
+                }
+
+                // use unchecked array access
+                JSON_TRY
+                {
+                    ptr = &ptr->operator[](static_cast<size_type>(std::stoi(reference_token)));
+                }
+                JSON_CATCH (std::invalid_argument&)
+                {
+                    JSON_THROW(parse_error::create(109, 0, "array index '" + reference_token + "' is not a number"));
+                }
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(out_of_range::create(404, "unresolved reference token '" + reference_token + "'"));
+            }
+        }
+    }
+
+    return *ptr;
+}
+
+json::const_reference json::json_pointer::get_checked(const_pointer ptr) const
+{
+    for (const auto& reference_token : reference_tokens)
+    {
+        switch (ptr->m_type)
+        {
+            case value_t::object:
+            {
+                // note: at performs range check
+                ptr = &ptr->at(reference_token);
+                break;
+            }
+
+            case value_t::array:
+            {
+                if (reference_token == "-")
+                {
+                    // "-" always fails the range check
+                    JSON_THROW(out_of_range::create(402, "array index '-' (" +
+                                                    std::to_string(ptr->m_value.array->size()) +
+                                                    ") is out of range"));
+                }
+
+                // error condition (cf. RFC 6901, Sect. 4)
+                if (reference_token.size() > 1 && reference_token[0] == '0')
+                {
+                    JSON_THROW(parse_error::create(106, 0, "array index '" + reference_token + "' must not begin with '0'"));
+                }
+
+                // note: at performs range check
+                JSON_TRY
+                {
+                    ptr = &ptr->at(static_cast<size_type>(std::stoi(reference_token)));
+                }
+                JSON_CATCH (std::invalid_argument&)
+                {
+                    JSON_THROW(parse_error::create(109, 0, "array index '" + reference_token + "' is not a number"));
+                }
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(out_of_range::create(404, "unresolved reference token '" + reference_token + "'"));
+            }
+        }
+    }
+
+    return *ptr;
+}
+
+std::vector<std::string> json::json_pointer::split(const std::string& reference_string)
+{
+    std::vector<std::string> result;
+
+    // special case: empty reference string -> no reference tokens
+    if (reference_string.empty())
+    {
+        return result;
+    }
+
+    // check if nonempty reference string begins with slash
+    if (reference_string[0] != '/')
+    {
+        JSON_THROW(parse_error::create(107, 1, "JSON pointer must be empty or begin with '/' - was: '" + reference_string + "'"));
+    }
+
+    // extract the reference tokens:
+    // - slash: position of the last read slash (or end of string)
+    // - start: position after the previous slash
+    for (
+        // search for the first slash after the first character
+        size_t slash = reference_string.find_first_of('/', 1),
+        // set the beginning of the first reference token
+        start = 1;
+        // we can stop if start == string::npos+1 = 0
+        start != 0;
+        // set the beginning of the next reference token
+        // (will eventually be 0 if slash == std::string::npos)
+        start = slash + 1,
+        // find next slash
+        slash = reference_string.find_first_of('/', start))
+    {
+        // use the text between the beginning of the reference token
+        // (start) and the last slash (slash).
+        auto reference_token = reference_string.substr(start, slash - start);
+
+        // check reference tokens are properly escaped
+        for (size_t pos = reference_token.find_first_of('~');
+                pos != std::string::npos;
+                pos = reference_token.find_first_of('~', pos + 1))
+        {
+            assert(reference_token[pos] == '~');
+
+            // ~ must be followed by 0 or 1
+            if (pos == reference_token.size() - 1 ||
+                    (reference_token[pos + 1] != '0' &&
+                     reference_token[pos + 1] != '1'))
+            {
+                JSON_THROW(parse_error::create(108, 0, "escape character '~' must be followed with '0' or '1'"));
+            }
+        }
+
+        // finally, store the reference token
+        unescape(reference_token);
+        result.push_back(reference_token);
+    }
+
+    return result;
+}
+
+/*!
+@brief replace all occurrences of a substring by another string
+
+@param[in,out] s  the string to manipulate; changed so that all
+                  occurrences of @a f are replaced with @a t
+@param[in]     f  the substring to replace with @a t
+@param[in]     t  the string to replace @a f
+
+@pre The search string @a f must not be empty. **This precondition is
+     enforced with an assertion.**
+
+@since version 2.0.0
+*/
+void json::json_pointer::replace_substring(std::string& s,
+                              const std::string& f,
+                              const std::string& t)
+{
+    assert(!f.empty());
+
+    for (
+        size_t pos = s.find(f);         // find first occurrence of f
+        pos != std::string::npos;       // make sure f was found
+        s.replace(pos, f.size(), t),    // replace with t
+        pos = s.find(f, pos + t.size()) // find next occurrence of f
+    );
+}
+
+/// escape tilde and slash
+std::string json::json_pointer::escape(std::string s)
+{
+    // escape "~"" to "~0" and "/" to "~1"
+    replace_substring(s, "~", "~0");
+    replace_substring(s, "/", "~1");
+    return s;
+}
+
+/// unescape tilde and slash
+void json::json_pointer::unescape(std::string& s)
+{
+    // first transform any occurrence of the sequence '~1' to '/'
+    replace_substring(s, "~1", "/");
+    // then transform any occurrence of the sequence '~0' to '~'
+    replace_substring(s, "~0", "~");
+}
+
+void json::json_pointer::flatten(const std::string& reference_string,
+                    const json& value,
+                    json& result)
+{
+    switch (value.m_type)
+    {
+        case value_t::array:
+        {
+            if (value.m_value.array->empty())
+            {
+                // flatten empty array as null
+                result[reference_string] = nullptr;
+            }
+            else
+            {
+                // iterate array and use index as reference string
+                for (size_t i = 0; i < value.m_value.array->size(); ++i)
+                {
+                    flatten(reference_string + "/" + std::to_string(i),
+                            value.m_value.array->operator[](i), result);
+                }
+            }
+            break;
+        }
+
+        case value_t::object:
+        {
+            if (value.m_value.object->empty())
+            {
+                // flatten empty object as null
+                result[reference_string] = nullptr;
+            }
+            else
+            {
+                // iterate object and use keys as reference string
+                for (const auto& element : *value.m_value.object)
+                {
+                    flatten(reference_string + "/" + escape(element.first()),
+                            element.second, result);
+                }
+            }
+            break;
+        }
+
+        default:
+        {
+            // add primitive value with its reference string
+            result[reference_string] = value;
+            break;
+        }
+    }
+}
+
+json json::json_pointer::unflatten(const json& value)
+{
+    if (!value.is_object())
+    {
+        JSON_THROW(type_error::create(314, "only objects can be unflattened"));
+    }
+
+    // we need to iterate over the object values in sorted key order
+    llvm::SmallVector<llvm::StringMapConstIterator<json>, 64> sorted;
+    for (auto i = value.m_value.object->begin(),
+         end = value.m_value.object->end(); i != end; ++i)
+    {
+        if (!i->second.is_primitive())
+        {
+            JSON_THROW(type_error::create(315, "values in object must be primitive"));
+        }
+        sorted.push_back(i);
+    }
+    std::sort(sorted.begin(), sorted.end(),
+              [](const llvm::StringMapConstIterator<json>& a,
+                 const llvm::StringMapConstIterator<json>& b) {
+                return a->getKey() < b->getKey();
+              });
+
+    json result;
+
+    // iterate the sorted JSON object values
+    for (const auto& element : sorted)
+    {
+
+        // assign value to reference pointed to by JSON pointer; Note
+        // that if the JSON pointer is "" (i.e., points to the whole
+        // value), function get_and_create returns a reference to
+        // result itself. An assignment will then create a primitive
+        // value.
+        json_pointer(element->first()).get_and_create(result) = element->second;
+    }
+
+    return result;
+}
+
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json_serializer.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/json_serializer.cpp
new file mode 100644
index 0000000..3ee052d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json_serializer.cpp
@@ -0,0 +1,433 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#define WPI_JSON_IMPLEMENTATION
+#include "support/json.h"
+
+#include "llvm/SmallString.h"
+#include "llvm/StringExtras.h"
+
+#include "json_serializer.h"
+
+using namespace wpi;
+
+void json::serializer::dump(const json& val,
+          const bool pretty_print,
+          const unsigned int indent_step,
+          const unsigned int current_indent)
+{
+    switch (val.m_type)
+    {
+        case value_t::object:
+        {
+            if (val.m_value.object->empty())
+            {
+                o << "{}";
+                return;
+            }
+
+            if (pretty_print)
+            {
+                o << "{\n";
+
+                // variable to hold indentation for recursive calls
+                const auto new_indent = current_indent + indent_step;
+
+                // first n-1 elements
+                auto i = val.m_value.object->begin();
+                for (size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i)
+                {
+                    o.indent(new_indent);
+                    o << '\"';
+                    dump_escaped(i->first());
+                    o << "\": ";
+                    dump(i->second, true, indent_step, new_indent);
+                    o << ",\n";
+                }
+
+                // last element
+                assert(i != val.m_value.object->end());
+                o.indent(new_indent);
+                o << '\"';
+                dump_escaped(i->first());
+                o << "\": ";
+                dump(i->second, true, indent_step, new_indent);
+
+                o << '\n';
+                o.indent(current_indent);
+                o << '}';
+            }
+            else
+            {
+                o << '{';
+
+                // first n-1 elements
+                auto i = val.m_value.object->begin();
+                for (size_t cnt = 0; cnt < val.m_value.object->size() - 1; ++cnt, ++i)
+                {
+                    o << '\"';
+                    dump_escaped(i->first());
+                    o << "\":";
+                    dump(i->second, false, indent_step, current_indent);
+                    o << ',';
+                }
+
+                // last element
+                assert(i != val.m_value.object->end());
+                o << '\"';
+                dump_escaped(i->first());
+                o << "\":";
+                dump(i->second, false, indent_step, current_indent);
+
+                o << '}';
+            }
+
+            return;
+        }
+
+        case value_t::array:
+        {
+            if (val.m_value.array->empty())
+            {
+                o << "[]";
+                return;
+            }
+
+            if (pretty_print)
+            {
+                o << "[\n";
+
+                // variable to hold indentation for recursive calls
+                const auto new_indent = current_indent + indent_step;
+
+                // first n-1 elements
+                for (auto i = val.m_value.array->cbegin(); i != val.m_value.array->cend() - 1; ++i)
+                {
+                    o.indent(new_indent);
+                    dump(*i, true, indent_step, new_indent);
+                    o << ",\n";
+                }
+
+                // last element
+                assert(!val.m_value.array->empty());
+                o.indent(new_indent);
+                dump(val.m_value.array->back(), true, indent_step, new_indent);
+
+                o << '\n';
+                o.indent(current_indent);
+                o << ']';
+            }
+            else
+            {
+                o << '[';
+
+                // first n-1 elements
+                for (auto i = val.m_value.array->cbegin(); i != val.m_value.array->cend() - 1; ++i)
+                {
+                    dump(*i, false, indent_step, current_indent);
+                    o << ',';
+                }
+
+                // last element
+                assert(!val.m_value.array->empty());
+                dump(val.m_value.array->back(), false, indent_step, current_indent);
+
+                o << ']';
+            }
+
+            return;
+        }
+
+        case value_t::string:
+        {
+            o << '\"';
+            dump_escaped(*val.m_value.string);
+            o << '\"';
+            return;
+        }
+
+        case value_t::boolean:
+        {
+            if (val.m_value.boolean)
+            {
+                o << "true";
+            }
+            else
+            {
+                o << "false";
+            }
+            return;
+        }
+
+        case value_t::number_integer:
+        {
+            o << static_cast<long long>(val.m_value.number_integer);
+            return;
+        }
+
+        case value_t::number_unsigned:
+        {
+            o << static_cast<unsigned long long>(val.m_value.number_unsigned);
+            return;
+        }
+
+        case value_t::number_float:
+        {
+            dump_float(val.m_value.number_float);
+            return;
+        }
+
+        case value_t::discarded:
+        {
+            o << "<discarded>";
+            return;
+        }
+
+        case value_t::null:
+        {
+            o << "null";
+            return;
+        }
+    }
+}
+
+void json::serializer::dump_escaped(llvm::StringRef s) const
+{
+    for (const auto& c : s)
+    {
+        switch (c)
+        {
+            // quotation mark (0x22)
+            case '"':
+            {
+                o << '\\' << '"';
+                break;
+            }
+
+            // reverse solidus (0x5c)
+            case '\\':
+            {
+                // nothing to change
+                o << '\\' << '\\';
+                break;
+            }
+
+            // backspace (0x08)
+            case '\b':
+            {
+                o << '\\' << 'b';
+                break;
+            }
+
+            // formfeed (0x0c)
+            case '\f':
+            {
+                o << '\\' << 'f';
+                break;
+            }
+
+            // newline (0x0a)
+            case '\n':
+            {
+                o << '\\' << 'n';
+                break;
+            }
+
+            // carriage return (0x0d)
+            case '\r':
+            {
+                o << '\\' << 'r';
+                break;
+            }
+
+            // horizontal tab (0x09)
+            case '\t':
+            {
+                o << '\\' << 't';
+                break;
+            }
+
+            case 0x00:
+            case 0x01:
+            case 0x02:
+            case 0x03:
+            case 0x04:
+            case 0x05:
+            case 0x06:
+            case 0x07:
+            case 0x0b:
+            case 0x0e:
+            case 0x0f:
+            case 0x10:
+            case 0x11:
+            case 0x12:
+            case 0x13:
+            case 0x14:
+            case 0x15:
+            case 0x16:
+            case 0x17:
+            case 0x18:
+            case 0x19:
+            case 0x1a:
+            case 0x1b:
+            case 0x1c:
+            case 0x1d:
+            case 0x1e:
+            case 0x1f:
+            {
+                // print character c as \uxxxx
+                o << "\\u00";
+                o << llvm::hexdigit((c >> 4) & 0xf, true);
+                o << llvm::hexdigit((c >> 0) & 0xf, true);
+                break;
+            }
+
+            default:
+            {
+                // all other characters are added as-is
+                o << c;
+                break;
+            }
+        }
+    }
+}
+
+void json::serializer::dump_float(double x)
+{
+    // NaN / inf
+    if (!std::isfinite(x) || std::isnan(x))
+    {
+        o << "null";
+        return;
+    }
+
+    // special case for 0.0 and -0.0
+    if (x == 0)
+    {
+        if (std::signbit(x))
+        {
+            o << "-0.0";
+        }
+        else
+        {
+            o << "0.0";
+        }
+        return;
+    }
+
+    // get number of digits for a text -> float -> text round-trip
+    static constexpr auto d = std::numeric_limits<double>::digits10;
+
+    // the actual conversion
+    llvm::SmallString<64> number_buffer;
+    number_buffer.resize(64);
+    std::ptrdiff_t len = snprintf(number_buffer.data(), number_buffer.size(),
+                                  "%.*g", d, x);
+
+    // negative value indicates an error
+    assert(len > 0);
+    // check if buffer was large enough
+    assert(static_cast<size_t>(len) < number_buffer.size());
+
+    // erase thousands separator
+    if (thousands_sep != '\0')
+    {
+        const auto end = std::remove(number_buffer.begin(),
+                                     number_buffer.begin() + len,
+                                     thousands_sep);
+        std::fill(end, number_buffer.end(), '\0');
+        assert((end - number_buffer.begin()) <= len);
+        len = (end - number_buffer.begin());
+    }
+
+    // convert decimal point to '.'
+    if (decimal_point != '\0' && decimal_point != '.')
+    {
+        for (auto& c : number_buffer)
+        {
+            if (c == decimal_point)
+            {
+                c = '.';
+                break;
+            }
+        }
+    }
+
+    o.write(number_buffer.data(), static_cast<size_t>(len));
+
+    // determine if need to append ".0"
+    const bool value_is_int_like = std::none_of(number_buffer.begin(),
+                                   number_buffer.begin() + len + 1,
+                                   [](char c)
+    {
+        return c == '.' || c == 'e';
+    });
+
+    if (value_is_int_like)
+    {
+        o << ".0";
+    }
+}
+
+namespace wpi {
+
+llvm::raw_ostream& operator<<(llvm::raw_ostream& o, const json& j)
+{
+    j.dump(o, 0);
+    return o;
+}
+
+}  // namespace wpi
+
+std::string json::dump(int indent) const
+{
+    std::string s;
+    llvm::raw_string_ostream os(s);
+    dump(os, indent);
+    os.flush();
+    return s;
+}
+
+void json::dump(llvm::raw_ostream& os, int indent) const
+{
+    serializer s(os);
+
+    if (indent >= 0)
+    {
+        s.dump(*this, true, static_cast<unsigned int>(indent));
+    }
+    else
+    {
+        s.dump(*this, false, 0);
+    }
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/json_serializer.h b/third_party/wpiutil_2018/src/main/native/cpp/support/json_serializer.h
new file mode 100644
index 0000000..fcbb488
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/json_serializer.h
@@ -0,0 +1,120 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+#include "support/json.h"
+
+#include <clocale> // lconv, localeconv
+#include <locale> // locale
+
+#include "llvm/raw_ostream.h"
+
+namespace wpi {
+
+/*!
+@brief wrapper around the serialization functions
+*/
+class json::serializer
+{
+  public:
+    serializer(const serializer&) = delete;
+    serializer& operator=(const serializer&) = delete;
+
+    /*!
+    @param[in] s  output stream to serialize to
+    @param[in] ichar  indentation character to use
+    */
+    explicit serializer(llvm::raw_ostream& s)
+        : o(s), loc(std::localeconv()),
+          thousands_sep(!loc->thousands_sep ? '\0' : loc->thousands_sep[0]),
+          decimal_point(!loc->decimal_point ? '\0' : loc->decimal_point[0])
+    {}
+
+    /*!
+    @brief internal implementation of the serialization function
+
+    This function is called by the public member function dump and
+    organizes the serialization internally. The indentation level is
+    propagated as additional parameter. In case of arrays and objects, the
+    function is called recursively.
+
+    - strings and object keys are escaped using `escape_string()`
+    - integer numbers are converted implicitly via `operator<<`
+    - floating-point numbers are converted to a string using `"%g"` format
+
+    @param[in] val             value to serialize
+    @param[in] pretty_print    whether the output shall be pretty-printed
+    @param[in] indent_step     the indent level
+    @param[in] current_indent  the current indent level (only used internally)
+    */
+    void dump(const json& val,
+              const bool pretty_print,
+              const unsigned int indent_step,
+              const unsigned int current_indent = 0);
+
+    /*!
+    @brief dump escaped string
+
+    Escape a string by replacing certain special characters by a sequence
+    of an escape character (backslash) and another character and other
+    control characters by a sequence of "\u" followed by a four-digit hex
+    representation. The escaped string is written to output stream @a o.
+
+    @param[in] s  the string to escape
+
+    @complexity Linear in the length of string @a s.
+    */
+    void dump_escaped(llvm::StringRef s) const;
+
+    /*!
+    @brief dump a floating-point number
+
+    Dump a given floating-point number to output stream @a o. Works
+    internally with @a number_buffer.
+
+    @param[in] x  floating-point number to dump
+    */
+    void dump_float(double x);
+
+  private:
+    /// the output of the serializer
+    llvm::raw_ostream& o;
+
+    /// the locale
+    const std::lconv* loc = nullptr;
+    /// the locale's thousand separator character
+    const char thousands_sep = '\0';
+    /// the locale's decimal point character
+    const char decimal_point = '\0';
+};
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/leb128.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/leb128.cpp
new file mode 100644
index 0000000..fd7e48f
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/leb128.cpp
@@ -0,0 +1,120 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/leb128.h"
+
+#include "support/raw_istream.h"
+
+namespace wpi {
+
+/**
+ * Get size of unsigned LEB128 data
+ * @val: value
+ *
+ * Determine the number of bytes required to encode an unsigned LEB128 datum.
+ * The algorithm is taken from Appendix C of the DWARF 3 spec. For information
+ * on the encodings refer to section "7.6 - Variable Length Data". Return
+ * the number of bytes required.
+ */
+uint64_t SizeUleb128(uint64_t val) {
+  size_t count = 0;
+  do {
+    val >>= 7;
+    ++count;
+  } while (val != 0);
+  return count;
+}
+
+/**
+ * Write unsigned LEB128 data
+ * @addr: the address where the ULEB128 data is to be stored
+ * @val: value to be stored
+ *
+ * Encode an unsigned LEB128 encoded datum. The algorithm is taken
+ * from Appendix C of the DWARF 3 spec. For information on the
+ * encodings refer to section "7.6 - Variable Length Data". Return
+ * the number of bytes written.
+ */
+uint64_t WriteUleb128(llvm::SmallVectorImpl<char>& dest, uint64_t val) {
+  size_t count = 0;
+
+  do {
+    unsigned char byte = val & 0x7f;
+    val >>= 7;
+
+    if (val != 0)
+      byte |= 0x80;  // mark this byte to show that more bytes will follow
+
+    dest.push_back(byte);
+    count++;
+  } while (val != 0);
+
+  return count;
+}
+
+/**
+ * Read unsigned LEB128 data
+ * @addr: the address where the ULEB128 data is stored
+ * @ret: address to store the result
+ *
+ * Decode an unsigned LEB128 encoded datum. The algorithm is taken
+ * from Appendix C of the DWARF 3 spec. For information on the
+ * encodings refer to section "7.6 - Variable Length Data". Return
+ * the number of bytes read.
+ */
+uint64_t ReadUleb128(const char* addr, uint64_t* ret) {
+  uint32_t result = 0;
+  int shift = 0;
+  size_t count = 0;
+
+  while (1) {
+    unsigned char byte = *reinterpret_cast<const unsigned char*>(addr);
+    addr++;
+    count++;
+
+    result |= (byte & 0x7f) << shift;
+    shift += 7;
+
+    if (!(byte & 0x80)) break;
+  }
+
+  *ret = result;
+
+  return count;
+}
+
+/**
+ * Read unsigned LEB128 data from a stream
+ * @is: the input stream where the ULEB128 data is to be read from
+ * @ret: address to store the result
+ *
+ * Decode an unsigned LEB128 encoded datum. The algorithm is taken
+ * from Appendix C of the DWARF 3 spec. For information on the
+ * encodings refer to section "7.6 - Variable Length Data". Return
+ * false on stream error, true on success.
+ */
+bool ReadUleb128(raw_istream& is, uint64_t* ret) {
+  uint32_t result = 0;
+  int shift = 0;
+
+  while (1) {
+    unsigned char byte;
+    is.read(reinterpret_cast<char*>(&byte), 1);
+    if (is.has_error()) return false;
+
+    result |= (byte & 0x7f) << shift;
+    shift += 7;
+
+    if (!(byte & 0x80)) break;
+  }
+
+  *ret = result;
+
+  return true;
+}
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/raw_istream.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/raw_istream.cpp
new file mode 100644
index 0000000..3c981ee
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/raw_istream.cpp
@@ -0,0 +1,134 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/raw_istream.h"
+
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <cstdlib>
+#include <cstring>
+
+#include "llvm/FileSystem.h"
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+
+#if defined(_MSC_VER)
+#ifndef STDIN_FILENO
+#define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+#define STDERR_FILENO 2
+#endif
+#endif
+
+using namespace wpi;
+
+llvm::StringRef raw_istream::getline(llvm::SmallVectorImpl<char>& buf,
+                                     int maxLen) {
+  buf.clear();
+  for (int i = 0; i < maxLen; ++i) {
+    char c;
+    read(c);
+    if (has_error()) return llvm::StringRef{buf.data(), buf.size()};
+    if (c == '\r') continue;
+    buf.push_back(c);
+    if (c == '\n') break;
+  }
+  return llvm::StringRef{buf.data(), buf.size()};
+}
+
+raw_mem_istream::raw_mem_istream(llvm::StringRef mem)
+    : raw_mem_istream(mem.data(), mem.size()) {}
+
+void raw_mem_istream::close() {}
+
+size_t raw_mem_istream::in_avail() const { return m_left; }
+
+void raw_mem_istream::read_impl(void* data, size_t len) {
+  if (len > m_left) {
+    error_detected();
+    return;
+  }
+  std::memcpy(data, m_cur, len);
+  m_cur += len;
+  m_left -= len;
+}
+
+static int getFD(const llvm::Twine& Filename, std::error_code& EC) {
+  // Handle "-" as stdin. Note that when we do this, we consider ourself
+  // the owner of stdin. This means that we can do things like close the
+  // file descriptor when we're done and set the "binary" flag globally.
+  if (Filename.isSingleStringRef() && Filename.getSingleStringRef() == "-") {
+    EC = std::error_code();
+    return STDIN_FILENO;
+  }
+
+  int FD;
+
+  EC = llvm::sys::fs::openFileForRead(Filename, FD);
+  if (EC) return -1;
+
+  EC = std::error_code();
+  return FD;
+}
+
+raw_fd_istream::raw_fd_istream(const llvm::Twine& filename, std::error_code& ec,
+                               size_t bufSize)
+    : raw_fd_istream(getFD(filename, ec), true, bufSize) {}
+
+raw_fd_istream::raw_fd_istream(int fd, bool shouldClose, size_t bufSize)
+    : m_bufSize(bufSize), m_fd(fd), m_shouldClose(shouldClose) {
+  m_cur = m_end = m_buf = static_cast<char*>(std::malloc(bufSize));
+}
+
+raw_fd_istream::~raw_fd_istream() {
+  if (m_shouldClose) close();
+  std::free(m_buf);
+}
+
+void raw_fd_istream::close() {
+  if (m_fd >= 0) {
+    ::close(m_fd);
+    m_fd = -1;
+  }
+}
+
+size_t raw_fd_istream::in_avail() const { return m_end - m_cur; }
+
+void raw_fd_istream::read_impl(void* data, size_t len) {
+  size_t left = m_end - m_cur;
+  if (left < len) {
+    // not enough data
+    if (m_cur == m_end) {
+#ifdef _WIN32
+      int count = ::_read(m_fd, m_buf, m_bufSize);
+#else
+      ssize_t count = ::read(m_fd, m_buf, m_bufSize);
+#endif
+      if (count <= 0) {
+        error_detected();
+        return;
+      }
+      m_cur = m_buf;
+      m_end = m_buf + count;
+      return read_impl(data, len);
+    }
+
+    std::memcpy(data, m_cur, left);
+    return read_impl(static_cast<char*>(data) + left, len - left);
+  }
+
+  std::memcpy(data, m_cur, len);
+  m_cur += len;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/raw_socket_istream.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/raw_socket_istream.cpp
new file mode 100644
index 0000000..4902be6
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/raw_socket_istream.cpp
@@ -0,0 +1,31 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/raw_socket_istream.h"
+
+#include "tcpsockets/NetworkStream.h"
+
+using namespace wpi;
+
+void raw_socket_istream::read_impl(void* data, size_t len) {
+  char* cdata = static_cast<char*>(data);
+  size_t pos = 0;
+
+  while (pos < len) {
+    NetworkStream::Error err;
+    size_t count = m_stream.receive(&cdata[pos], len - pos, &err, m_timeout);
+    if (count == 0) {
+      error_detected();
+      return;
+    }
+    pos += count;
+  }
+}
+
+void raw_socket_istream::close() { m_stream.close(); }
+
+size_t raw_socket_istream::in_avail() const { return 0; }
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/raw_socket_ostream.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/raw_socket_ostream.cpp
new file mode 100644
index 0000000..f9a4000
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/raw_socket_ostream.cpp
@@ -0,0 +1,39 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/raw_socket_ostream.h"
+
+#include "tcpsockets/NetworkStream.h"
+
+using namespace wpi;
+
+raw_socket_ostream::~raw_socket_ostream() {
+  flush();
+  if (m_shouldClose) close();
+}
+
+void raw_socket_ostream::write_impl(const char* data, size_t len) {
+  size_t pos = 0;
+
+  while (pos < len) {
+    NetworkStream::Error err;
+    size_t count = m_stream.send(&data[pos], len - pos, &err);
+    if (count == 0) {
+      error_detected();
+      return;
+    }
+    pos += count;
+  }
+}
+
+uint64_t raw_socket_ostream::current_pos() const { return 0; }
+
+void raw_socket_ostream::close() {
+  if (!m_shouldClose) return;
+  flush();
+  m_stream.close();
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/sha1.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/sha1.cpp
new file mode 100644
index 0000000..3de313b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/sha1.cpp
@@ -0,0 +1,301 @@
+/*
+    sha1.cpp - source code of
+
+    ============
+    SHA-1 in C++
+    ============
+
+    100% Public Domain.
+
+    Original C Code
+        -- Steve Reid <steve@edmweb.com>
+    Small changes to fit into bglibs
+        -- Bruce Guenter <bruce@untroubled.org>
+    Translation to simpler C++ Code
+        -- Volker Grabsch <vog@notjusthosting.com>
+    Safety fixes
+        -- Eugene Hopkinson <slowriot at voxelstorm dot com>
+*/
+
+#include "support/sha1.h"
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringExtras.h"
+#include "llvm/raw_ostream.h"
+#include "support/raw_istream.h"
+
+using namespace wpi;
+
+static const size_t BLOCK_INTS =
+    16; /* number of 32bit integers per SHA1 block */
+static const size_t BLOCK_BYTES = BLOCK_INTS * 4;
+
+static void reset(uint32_t digest[], size_t& buf_size, uint64_t& transforms) {
+  /* SHA1 initialization constants */
+  digest[0] = 0x67452301;
+  digest[1] = 0xefcdab89;
+  digest[2] = 0x98badcfe;
+  digest[3] = 0x10325476;
+  digest[4] = 0xc3d2e1f0;
+
+  /* Reset counters */
+  buf_size = 0;
+  transforms = 0;
+}
+
+static uint32_t rol(const uint32_t value, const size_t bits) {
+  return (value << bits) | (value >> (32 - bits));
+}
+
+static uint32_t blk(const uint32_t block[BLOCK_INTS], const size_t i) {
+  return rol(block[(i + 13) & 15] ^ block[(i + 8) & 15] ^ block[(i + 2) & 15] ^
+                 block[i],
+             1);
+}
+
+/*
+ * (R0+R1), R2, R3, R4 are the different operations used in SHA1
+ */
+
+static void R0(const uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t& w,
+               const uint32_t x, const uint32_t y, uint32_t& z,
+               const size_t i) {
+  z += ((w & (x ^ y)) ^ y) + block[i] + 0x5a827999 + rol(v, 5);
+  w = rol(w, 30);
+}
+
+static void R1(uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t& w,
+               const uint32_t x, const uint32_t y, uint32_t& z,
+               const size_t i) {
+  block[i] = blk(block, i);
+  z += ((w & (x ^ y)) ^ y) + block[i] + 0x5a827999 + rol(v, 5);
+  w = rol(w, 30);
+}
+
+static void R2(uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t& w,
+               const uint32_t x, const uint32_t y, uint32_t& z,
+               const size_t i) {
+  block[i] = blk(block, i);
+  z += (w ^ x ^ y) + block[i] + 0x6ed9eba1 + rol(v, 5);
+  w = rol(w, 30);
+}
+
+static void R3(uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t& w,
+               const uint32_t x, const uint32_t y, uint32_t& z,
+               const size_t i) {
+  block[i] = blk(block, i);
+  z += (((w | x) & y) | (w & x)) + block[i] + 0x8f1bbcdc + rol(v, 5);
+  w = rol(w, 30);
+}
+
+static void R4(uint32_t block[BLOCK_INTS], const uint32_t v, uint32_t& w,
+               const uint32_t x, const uint32_t y, uint32_t& z,
+               const size_t i) {
+  block[i] = blk(block, i);
+  z += (w ^ x ^ y) + block[i] + 0xca62c1d6 + rol(v, 5);
+  w = rol(w, 30);
+}
+
+/*
+ * Hash a single 512-bit block. This is the core of the algorithm.
+ */
+
+static void transform(uint32_t digest[], uint32_t block[BLOCK_INTS],
+                      uint64_t& transforms) {
+  /* Copy digest[] to working vars */
+  uint32_t a = digest[0];
+  uint32_t b = digest[1];
+  uint32_t c = digest[2];
+  uint32_t d = digest[3];
+  uint32_t e = digest[4];
+
+  /* 4 rounds of 20 operations each. Loop unrolled. */
+  R0(block, a, b, c, d, e, 0);
+  R0(block, e, a, b, c, d, 1);
+  R0(block, d, e, a, b, c, 2);
+  R0(block, c, d, e, a, b, 3);
+  R0(block, b, c, d, e, a, 4);
+  R0(block, a, b, c, d, e, 5);
+  R0(block, e, a, b, c, d, 6);
+  R0(block, d, e, a, b, c, 7);
+  R0(block, c, d, e, a, b, 8);
+  R0(block, b, c, d, e, a, 9);
+  R0(block, a, b, c, d, e, 10);
+  R0(block, e, a, b, c, d, 11);
+  R0(block, d, e, a, b, c, 12);
+  R0(block, c, d, e, a, b, 13);
+  R0(block, b, c, d, e, a, 14);
+  R0(block, a, b, c, d, e, 15);
+  R1(block, e, a, b, c, d, 0);
+  R1(block, d, e, a, b, c, 1);
+  R1(block, c, d, e, a, b, 2);
+  R1(block, b, c, d, e, a, 3);
+  R2(block, a, b, c, d, e, 4);
+  R2(block, e, a, b, c, d, 5);
+  R2(block, d, e, a, b, c, 6);
+  R2(block, c, d, e, a, b, 7);
+  R2(block, b, c, d, e, a, 8);
+  R2(block, a, b, c, d, e, 9);
+  R2(block, e, a, b, c, d, 10);
+  R2(block, d, e, a, b, c, 11);
+  R2(block, c, d, e, a, b, 12);
+  R2(block, b, c, d, e, a, 13);
+  R2(block, a, b, c, d, e, 14);
+  R2(block, e, a, b, c, d, 15);
+  R2(block, d, e, a, b, c, 0);
+  R2(block, c, d, e, a, b, 1);
+  R2(block, b, c, d, e, a, 2);
+  R2(block, a, b, c, d, e, 3);
+  R2(block, e, a, b, c, d, 4);
+  R2(block, d, e, a, b, c, 5);
+  R2(block, c, d, e, a, b, 6);
+  R2(block, b, c, d, e, a, 7);
+  R3(block, a, b, c, d, e, 8);
+  R3(block, e, a, b, c, d, 9);
+  R3(block, d, e, a, b, c, 10);
+  R3(block, c, d, e, a, b, 11);
+  R3(block, b, c, d, e, a, 12);
+  R3(block, a, b, c, d, e, 13);
+  R3(block, e, a, b, c, d, 14);
+  R3(block, d, e, a, b, c, 15);
+  R3(block, c, d, e, a, b, 0);
+  R3(block, b, c, d, e, a, 1);
+  R3(block, a, b, c, d, e, 2);
+  R3(block, e, a, b, c, d, 3);
+  R3(block, d, e, a, b, c, 4);
+  R3(block, c, d, e, a, b, 5);
+  R3(block, b, c, d, e, a, 6);
+  R3(block, a, b, c, d, e, 7);
+  R3(block, e, a, b, c, d, 8);
+  R3(block, d, e, a, b, c, 9);
+  R3(block, c, d, e, a, b, 10);
+  R3(block, b, c, d, e, a, 11);
+  R4(block, a, b, c, d, e, 12);
+  R4(block, e, a, b, c, d, 13);
+  R4(block, d, e, a, b, c, 14);
+  R4(block, c, d, e, a, b, 15);
+  R4(block, b, c, d, e, a, 0);
+  R4(block, a, b, c, d, e, 1);
+  R4(block, e, a, b, c, d, 2);
+  R4(block, d, e, a, b, c, 3);
+  R4(block, c, d, e, a, b, 4);
+  R4(block, b, c, d, e, a, 5);
+  R4(block, a, b, c, d, e, 6);
+  R4(block, e, a, b, c, d, 7);
+  R4(block, d, e, a, b, c, 8);
+  R4(block, c, d, e, a, b, 9);
+  R4(block, b, c, d, e, a, 10);
+  R4(block, a, b, c, d, e, 11);
+  R4(block, e, a, b, c, d, 12);
+  R4(block, d, e, a, b, c, 13);
+  R4(block, c, d, e, a, b, 14);
+  R4(block, b, c, d, e, a, 15);
+
+  /* Add the working vars back into digest[] */
+  digest[0] += a;
+  digest[1] += b;
+  digest[2] += c;
+  digest[3] += d;
+  digest[4] += e;
+
+  /* Count the number of transformations */
+  transforms++;
+}
+
+static void buffer_to_block(const unsigned char* buffer,
+                            uint32_t block[BLOCK_INTS]) {
+  /* Convert the std::string (byte buffer) to a uint32_t array (MSB) */
+  for (size_t i = 0; i < BLOCK_INTS; i++) {
+    block[i] = (buffer[4 * i + 3] & 0xff) | (buffer[4 * i + 2] & 0xff) << 8 |
+               (buffer[4 * i + 1] & 0xff) << 16 |
+               (buffer[4 * i + 0] & 0xff) << 24;
+  }
+}
+
+SHA1::SHA1() { reset(digest, buf_size, transforms); }
+
+void SHA1::Update(llvm::StringRef s) {
+  raw_mem_istream is(s);
+  Update(is);
+}
+
+void SHA1::Update(raw_istream& is) {
+  while (true) {
+    buf_size += is.readsome(&buffer[buf_size], BLOCK_BYTES - buf_size);
+    if (buf_size != BLOCK_BYTES) {
+      return;
+    }
+    uint32_t block[BLOCK_INTS];
+    buffer_to_block(buffer, block);
+    transform(digest, block, transforms);
+    buf_size = 0;
+  }
+}
+
+/*
+ * Add padding and return the message digest.
+ */
+
+static void finalize(uint32_t digest[], unsigned char* buffer, size_t& buf_size,
+                     uint64_t& transforms, llvm::raw_ostream& os) {
+  /* Total number of hashed bits */
+  uint64_t total_bits = (transforms * BLOCK_BYTES + buf_size) * 8;
+
+  /* Padding */
+  buffer[buf_size++] = 0x80;
+  for (size_t i = buf_size; i < BLOCK_BYTES; ++i) {
+    buffer[i] = 0x00;
+  }
+
+  uint32_t block[BLOCK_INTS];
+  buffer_to_block(buffer, block);
+
+  if (buf_size > BLOCK_BYTES - 8) {
+    transform(digest, block, transforms);
+    for (size_t i = 0; i < BLOCK_INTS - 2; i++) {
+      block[i] = 0;
+    }
+  }
+
+  /* Append total_bits, split this uint64_t into two uint32_t */
+  block[BLOCK_INTS - 1] = total_bits;
+  block[BLOCK_INTS - 2] = (total_bits >> 32);
+  transform(digest, block, transforms);
+
+  /* Hex string */
+  static const char* const LUT = "0123456789abcdef";
+  for (size_t i = 0; i < 5; i++) {
+    uint32_t v = digest[i];
+    os << LUT[(v >> 28) & 0xf] << LUT[(v >> 24) & 0xf] << LUT[(v >> 20) & 0xf]
+       << LUT[(v >> 16) & 0xf] << LUT[(v >> 12) & 0xf] << LUT[(v >> 8) & 0xf]
+       << LUT[(v >> 4) & 0xf] << LUT[(v >> 0) & 0xf];
+  }
+
+  /* Reset for next run */
+  reset(digest, buf_size, transforms);
+}
+
+std::string SHA1::Final() {
+  std::string out;
+  llvm::raw_string_ostream os(out);
+
+  finalize(digest, buffer, buf_size, transforms, os);
+
+  return os.str();
+}
+
+llvm::StringRef SHA1::Final(llvm::SmallVectorImpl<char>& buf) {
+  llvm::raw_svector_ostream os(buf);
+
+  finalize(digest, buffer, buf_size, transforms, os);
+
+  return os.str();
+}
+
+std::string SHA1::FromFile(llvm::StringRef filename) {
+  std::error_code ec;
+  raw_fd_istream stream(filename, ec);
+  SHA1 checksum;
+  checksum.Update(stream);
+  return checksum.Final();
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/support/timestamp.cpp b/third_party/wpiutil_2018/src/main/native/cpp/support/timestamp.cpp
new file mode 100644
index 0000000..a6dc0e2
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/support/timestamp.cpp
@@ -0,0 +1,108 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/timestamp.h"
+
+#include <atomic>
+
+#ifdef _WIN32
+#include <windows.h>
+
+#include <cassert>
+#include <exception>
+#else
+#include <chrono>
+#endif
+
+// offset in microseconds
+static uint64_t zerotime() {
+#ifdef _WIN32
+  FILETIME ft;
+  uint64_t tmpres = 0;
+  // 100-nanosecond intervals since January 1, 1601 (UTC)
+  // which means 0.1 us
+  GetSystemTimeAsFileTime(&ft);
+  tmpres |= ft.dwHighDateTime;
+  tmpres <<= 32;
+  tmpres |= ft.dwLowDateTime;
+  tmpres /= 10u;  // convert to us
+  // January 1st, 1970 - January 1st, 1601 UTC ~ 369 years
+  // or 11644473600000000 us
+  static const uint64_t deltaepoch = 11644473600000000ull;
+  tmpres -= deltaepoch;
+  return tmpres;
+#else
+  // 1-us intervals
+  return std::chrono::duration_cast<std::chrono::microseconds>(
+             std::chrono::high_resolution_clock::now().time_since_epoch())
+      .count();
+#endif
+}
+
+static uint64_t timestamp() {
+#ifdef _WIN32
+  LARGE_INTEGER li;
+  QueryPerformanceCounter(&li);
+  // there is an imprecision with the initial value,
+  // but what matters is that timestamps are monotonic and consistent
+  return static_cast<uint64_t>(li.QuadPart);
+#else
+  // 1-us intervals
+  return std::chrono::duration_cast<std::chrono::microseconds>(
+             std::chrono::steady_clock::now().time_since_epoch())
+      .count();
+#endif
+}
+
+#ifdef _WIN32
+static uint64_t update_frequency() {
+  LARGE_INTEGER li;
+  if (!QueryPerformanceFrequency(&li) || !li.QuadPart) {
+    // log something
+    std::terminate();
+  }
+  return static_cast<uint64_t>(li.QuadPart);
+}
+#endif
+
+static const uint64_t zerotime_val = zerotime();
+static const uint64_t offset_val = timestamp();
+#ifdef _WIN32
+static const uint64_t frequency_val = update_frequency();
+#endif
+
+uint64_t wpi::NowDefault() {
+#ifdef _WIN32
+  assert(offset_val > 0u);
+  assert(frequency_val > 0u);
+  uint64_t delta = timestamp() - offset_val;
+  // because the frequency is in update per seconds, we have to multiply the
+  // delta by 1,000,000
+  uint64_t delta_in_us = delta * 1000000ull / frequency_val;
+  return delta_in_us + zerotime_val;
+#else
+  return zerotime_val + timestamp() - offset_val;
+#endif
+}
+
+static std::atomic<uint64_t (*)()> now_impl{wpi::NowDefault};
+
+void wpi::SetNowImpl(uint64_t (*func)(void)) {
+  now_impl = func ? func : NowDefault;
+}
+
+uint64_t wpi::Now() { return (now_impl.load())(); }
+
+extern "C" {
+
+uint64_t WPI_NowDefault(void) { return wpi::NowDefault(); }
+
+void WPI_SetNowImpl(uint64_t (*func)(void)) { wpi::SetNowImpl(func); }
+
+uint64_t WPI_Now(void) { return wpi::Now(); }
+
+}  // extern "C"
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/SocketError.cpp b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/SocketError.cpp
new file mode 100644
index 0000000..3f3fd63
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/SocketError.cpp
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "tcpsockets/SocketError.h"
+
+#ifdef _WIN32
+#include <winsock2.h>
+#else
+#include <cerrno>
+#include <cstring>
+#endif
+
+namespace wpi {
+
+int SocketErrno() {
+#ifdef _WIN32
+  return WSAGetLastError();
+#else
+  return errno;
+#endif
+}
+
+std::string SocketStrerror(int code) {
+#ifdef _WIN32
+  LPSTR errstr = nullptr;
+  FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 0,
+                code, 0, (LPSTR)&errstr, 0, 0);
+  std::string rv(errstr);
+  LocalFree(errstr);
+  return rv;
+#else
+  return std::strerror(code);
+#endif
+}
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPAcceptor.cpp b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPAcceptor.cpp
new file mode 100644
index 0000000..a71356c
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPAcceptor.cpp
@@ -0,0 +1,205 @@
+/*
+   TCPAcceptor.cpp
+
+   TCPAcceptor class definition. TCPAcceptor provides methods to passively
+   establish TCP/IP connections with clients.
+
+   ------------------------------------------
+
+   Copyright (c) 2013 [Vic Hargrave - http://vichargrave.com]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+#include "tcpsockets/TCPAcceptor.h"
+
+#include <cstdio>
+#include <cstring>
+
+#ifdef _WIN32
+#include <WinSock2.h>
+#include <Ws2tcpip.h>
+#pragma comment(lib, "Ws2_32.lib")
+#else
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <unistd.h>
+#endif
+
+#include "llvm/SmallString.h"
+#include "support/Logger.h"
+#include "tcpsockets/SocketError.h"
+
+using namespace wpi;
+
+TCPAcceptor::TCPAcceptor(int port, const char* address, Logger& logger)
+    : m_lsd(0),
+      m_port(port),
+      m_address(address),
+      m_listening(false),
+      m_logger(logger) {
+  m_shutdown = false;
+#ifdef _WIN32
+  WSAData wsaData;
+  WORD wVersionRequested = MAKEWORD(2, 2);
+  WSAStartup(wVersionRequested, &wsaData);
+#endif
+}
+
+TCPAcceptor::~TCPAcceptor() {
+  if (m_lsd > 0) {
+    shutdown();
+#ifdef _WIN32
+    closesocket(m_lsd);
+#else
+    close(m_lsd);
+#endif
+  }
+#ifdef _WIN32
+  WSACleanup();
+#endif
+}
+
+int TCPAcceptor::start() {
+  if (m_listening) return 0;
+
+  m_lsd = socket(PF_INET, SOCK_STREAM, 0);
+  if (m_lsd < 0) {
+    WPI_ERROR(m_logger, "could not create socket");
+    return -1;
+  }
+  struct sockaddr_in address;
+
+  std::memset(&address, 0, sizeof(address));
+  address.sin_family = PF_INET;
+  if (m_address.size() > 0) {
+#ifdef _WIN32
+    llvm::SmallString<128> addr_copy(m_address);
+    addr_copy.push_back('\0');
+    int res = InetPton(PF_INET, addr_copy.data(), &(address.sin_addr));
+#else
+    int res = inet_pton(PF_INET, m_address.c_str(), &(address.sin_addr));
+#endif
+    if (res != 1) {
+      WPI_ERROR(m_logger, "could not resolve " << m_address << " address");
+      return -1;
+    }
+  } else {
+    address.sin_addr.s_addr = INADDR_ANY;
+  }
+  address.sin_port = htons(m_port);
+
+#ifdef _WIN32
+  int optval = 1;
+  setsockopt(m_lsd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
+             reinterpret_cast<char*>(&optval), sizeof optval);
+#else
+  int optval = 1;
+  setsockopt(m_lsd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&optval),
+             sizeof optval);
+#endif
+
+  int result = bind(m_lsd, reinterpret_cast<struct sockaddr*>(&address),
+                    sizeof(address));
+  if (result != 0) {
+    WPI_ERROR(m_logger,
+              "bind() to port " << m_port << " failed: " << SocketStrerror());
+    return result;
+  }
+
+  result = listen(m_lsd, 5);
+  if (result != 0) {
+    WPI_ERROR(m_logger,
+              "listen() on port " << m_port << " failed: " << SocketStrerror());
+    return result;
+  }
+  m_listening = true;
+  return result;
+}
+
+void TCPAcceptor::shutdown() {
+  m_shutdown = true;
+#ifdef _WIN32
+  ::shutdown(m_lsd, SD_BOTH);
+
+  // this is ugly, but the easiest way to do this
+  // force wakeup of accept() with a non-blocking connect to ourselves
+  struct sockaddr_in address;
+
+  std::memset(&address, 0, sizeof(address));
+  address.sin_family = PF_INET;
+  llvm::SmallString<128> addr_copy;
+  if (m_address.size() > 0)
+    addr_copy = m_address;
+  else
+    addr_copy = "127.0.0.1";
+  addr_copy.push_back('\0');
+  int size = sizeof(address);
+  if (WSAStringToAddress(addr_copy.data(), PF_INET, nullptr,
+                         (struct sockaddr*)&address, &size) != 0)
+    return;
+  address.sin_port = htons(m_port);
+
+  fd_set sdset;
+  struct timeval tv;
+  int result = -1, valopt, sd = socket(AF_INET, SOCK_STREAM, 0);
+  if (sd < 0) return;
+
+  // Set socket to non-blocking
+  u_long mode = 1;
+  ioctlsocket(sd, FIONBIO, &mode);
+
+  // Try to connect
+  ::connect(sd, (struct sockaddr*)&address, sizeof(address));
+
+  // Close
+  ::closesocket(sd);
+
+#else
+  ::shutdown(m_lsd, SHUT_RDWR);
+  int nullfd = ::open("/dev/null", O_RDONLY);
+  if (nullfd >= 0) {
+    ::dup2(nullfd, m_lsd);
+    ::close(nullfd);
+  }
+#endif
+}
+
+std::unique_ptr<NetworkStream> TCPAcceptor::accept() {
+  if (!m_listening || m_shutdown) return nullptr;
+
+  struct sockaddr_in address;
+#ifdef _WIN32
+  int len = sizeof(address);
+#else
+  socklen_t len = sizeof(address);
+#endif
+  std::memset(&address, 0, sizeof(address));
+  int sd = ::accept(m_lsd, (struct sockaddr*)&address, &len);
+  if (sd < 0) {
+    if (!m_shutdown)
+      WPI_ERROR(m_logger, "accept() on port "
+                              << m_port << " failed: " << SocketStrerror());
+    return nullptr;
+  }
+  if (m_shutdown) {
+#ifdef _WIN32
+    closesocket(sd);
+#else
+    close(sd);
+#endif
+    return nullptr;
+  }
+  return std::unique_ptr<NetworkStream>(new TCPStream(sd, &address));
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPConnector.cpp b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPConnector.cpp
new file mode 100644
index 0000000..a9e7df8
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPConnector.cpp
@@ -0,0 +1,218 @@
+/*
+   TCPConnector.h
+
+   TCPConnector class definition. TCPConnector provides methods to actively
+   establish TCP/IP connections with a server.
+
+   ------------------------------------------
+
+   Copyright (c) 2013 [Vic Hargrave - http://vichargrave.com]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License
+*/
+
+#include "tcpsockets/TCPConnector.h"
+
+#include <fcntl.h>
+
+#include <cerrno>
+#include <cstdio>
+#include <cstring>
+
+#ifdef _WIN32
+#include <WS2tcpip.h>
+#include <WinSock2.h>
+#else
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <sys/select.h>
+#include <unistd.h>
+#endif
+
+#include "llvm/SmallString.h"
+#include "support/Logger.h"
+#include "tcpsockets/SocketError.h"
+#include "tcpsockets/TCPStream.h"
+
+using namespace wpi;
+
+static int ResolveHostName(const char* hostname, struct in_addr* addr) {
+  struct addrinfo hints;
+  struct addrinfo* res;
+
+  hints.ai_flags = 0;
+  hints.ai_family = AF_INET;
+  hints.ai_socktype = SOCK_STREAM;
+  hints.ai_protocol = 0;
+  hints.ai_addrlen = 0;
+  hints.ai_addr = nullptr;
+  hints.ai_canonname = nullptr;
+  hints.ai_next = nullptr;
+  int result = getaddrinfo(hostname, nullptr, &hints, &res);
+  if (result == 0) {
+    std::memcpy(
+        addr, &(reinterpret_cast<struct sockaddr_in*>(res->ai_addr)->sin_addr),
+        sizeof(struct in_addr));
+    freeaddrinfo(res);
+  }
+  return result;
+}
+
+std::unique_ptr<NetworkStream> TCPConnector::connect(const char* server,
+                                                     int port, Logger& logger,
+                                                     int timeout) {
+#ifdef _WIN32
+  struct WSAHelper {
+    WSAHelper() {
+      WSAData wsaData;
+      WORD wVersionRequested = MAKEWORD(2, 2);
+      WSAStartup(wVersionRequested, &wsaData);
+    }
+    ~WSAHelper() { WSACleanup(); }
+  };
+  static WSAHelper helper;
+#endif
+  struct sockaddr_in address;
+
+  std::memset(&address, 0, sizeof(address));
+  address.sin_family = AF_INET;
+  if (ResolveHostName(server, &(address.sin_addr)) != 0) {
+#ifdef _WIN32
+    llvm::SmallString<128> addr_copy(server);
+    addr_copy.push_back('\0');
+    int res = InetPton(PF_INET, addr_copy.data(), &(address.sin_addr));
+#else
+    int res = inet_pton(PF_INET, server, &(address.sin_addr));
+#endif
+    if (res != 1) {
+      WPI_ERROR(logger, "could not resolve " << server << " address");
+      return nullptr;
+    }
+  }
+  address.sin_port = htons(port);
+
+  if (timeout == 0) {
+    int sd = socket(AF_INET, SOCK_STREAM, 0);
+    if (sd < 0) {
+      WPI_ERROR(logger, "could not create socket");
+      return nullptr;
+    }
+    if (::connect(sd, (struct sockaddr*)&address, sizeof(address)) != 0) {
+      WPI_ERROR(logger, "connect() to " << server << " port " << port
+                                        << " failed: " << SocketStrerror());
+#ifdef _WIN32
+      closesocket(sd);
+#else
+      ::close(sd);
+#endif
+      return nullptr;
+    }
+    return std::unique_ptr<NetworkStream>(new TCPStream(sd, &address));
+  }
+
+  fd_set sdset;
+  struct timeval tv;
+  socklen_t len;
+  int result = -1, valopt, sd = socket(AF_INET, SOCK_STREAM, 0);
+  if (sd < 0) {
+    WPI_ERROR(logger, "could not create socket");
+    return nullptr;
+  }
+
+// Set socket to non-blocking
+#ifdef _WIN32
+  u_long mode = 1;
+  if (ioctlsocket(sd, FIONBIO, &mode) == SOCKET_ERROR)
+    WPI_WARNING(logger,
+                "could not set socket to non-blocking: " << SocketStrerror());
+#else
+  int arg;
+  arg = fcntl(sd, F_GETFL, nullptr);
+  if (arg < 0) {
+    WPI_WARNING(logger,
+                "could not set socket to non-blocking: " << SocketStrerror());
+  } else {
+    arg |= O_NONBLOCK;
+    if (fcntl(sd, F_SETFL, arg) < 0)
+      WPI_WARNING(logger,
+                  "could not set socket to non-blocking: " << SocketStrerror());
+  }
+#endif
+
+  // Connect with time limit
+  if ((result = ::connect(sd, (struct sockaddr*)&address, sizeof(address))) <
+      0) {
+    int my_errno = SocketErrno();
+#ifdef _WIN32
+    if (my_errno == WSAEWOULDBLOCK || my_errno == WSAEINPROGRESS) {
+#else
+    if (my_errno == EWOULDBLOCK || my_errno == EINPROGRESS) {
+#endif
+      tv.tv_sec = timeout;
+      tv.tv_usec = 0;
+      FD_ZERO(&sdset);
+      FD_SET(sd, &sdset);
+      if (select(sd + 1, nullptr, &sdset, nullptr, &tv) > 0) {
+        len = sizeof(int);
+        getsockopt(sd, SOL_SOCKET, SO_ERROR, reinterpret_cast<char*>(&valopt),
+                   &len);
+        if (valopt) {
+          WPI_ERROR(logger, "select() to " << server << " port " << port
+                                           << " error " << valopt << " - "
+                                           << SocketStrerror(valopt));
+        }
+        // connection established
+        else
+          result = 0;
+      } else {
+        WPI_INFO(logger,
+                 "connect() to " << server << " port " << port << " timed out");
+      }
+    } else {
+      WPI_ERROR(logger, "connect() to " << server << " port " << port
+                                        << " error " << SocketErrno() << " - "
+                                        << SocketStrerror());
+    }
+  }
+
+// Return socket to blocking mode
+#ifdef _WIN32
+  mode = 0;
+  if (ioctlsocket(sd, FIONBIO, &mode) == SOCKET_ERROR)
+    WPI_WARNING(logger,
+                "could not set socket to blocking: " << SocketStrerror());
+#else
+  arg = fcntl(sd, F_GETFL, nullptr);
+  if (arg < 0) {
+    WPI_WARNING(logger,
+                "could not set socket to blocking: " << SocketStrerror());
+  } else {
+    arg &= (~O_NONBLOCK);
+    if (fcntl(sd, F_SETFL, arg) < 0)
+      WPI_WARNING(logger,
+                  "could not set socket to blocking: " << SocketStrerror());
+  }
+#endif
+
+  // Create stream object if connected, close if not.
+  if (result == -1) {
+#ifdef _WIN32
+    closesocket(sd);
+#else
+    ::close(sd);
+#endif
+    return nullptr;
+  }
+  return std::unique_ptr<NetworkStream>(new TCPStream(sd, &address));
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPConnector_parallel.cpp b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPConnector_parallel.cpp
new file mode 100644
index 0000000..92db3d8
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPConnector_parallel.cpp
@@ -0,0 +1,129 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "tcpsockets/TCPConnector.h"  // NOLINT(build/include_order)
+
+#include <atomic>
+#include <chrono>
+#include <thread>
+#include <tuple>
+
+#include "llvm/SmallSet.h"
+#include "support/condition_variable.h"
+#include "support/mutex.h"
+
+using namespace wpi;
+
+// MSVC < 1900 doesn't have support for thread_local
+#if !defined(_MSC_VER) || _MSC_VER >= 1900
+// clang check for availability of thread_local
+#if !defined(__has_feature) || __has_feature(cxx_thread_local)
+#define HAVE_THREAD_LOCAL
+#endif
+#endif
+
+std::unique_ptr<NetworkStream> TCPConnector::connect_parallel(
+    llvm::ArrayRef<std::pair<const char*, int>> servers, Logger& logger,
+    int timeout) {
+  if (servers.empty()) return nullptr;
+
+  // structure to make sure we don't start duplicate workers
+  struct GlobalState {
+    wpi::mutex mtx;
+#ifdef HAVE_THREAD_LOCAL
+    llvm::SmallSet<std::pair<std::string, int>, 16> active;
+#else
+    llvm::SmallSet<std::tuple<std::thread::id, std::string, int>, 16> active;
+#endif
+  };
+#ifdef HAVE_THREAD_LOCAL
+  thread_local auto global = std::make_shared<GlobalState>();
+#else
+  static auto global = std::make_shared<GlobalState>();
+  auto this_id = std::this_thread::get_id();
+#endif
+  auto local = global;  // copy to an automatic variable for lambda capture
+
+  // structure shared between threads and this function
+  struct Result {
+    wpi::mutex mtx;
+    wpi::condition_variable cv;
+    std::unique_ptr<NetworkStream> stream;
+    std::atomic<unsigned int> count{0};
+    std::atomic<bool> done{false};
+  };
+  auto result = std::make_shared<Result>();
+
+  // start worker threads; this is I/O bound so we don't limit to # of procs
+  Logger* plogger = &logger;
+  unsigned int num_workers = 0;
+  for (const auto& server : servers) {
+    std::pair<std::string, int> server_copy{std::string{server.first},
+                                            server.second};
+#ifdef HAVE_THREAD_LOCAL
+    const auto& active_tracker = server_copy;
+#else
+    std::tuple<std::thread::id, std::string, int> active_tracker{
+        this_id, server_copy.first, server_copy.second};
+#endif
+
+    // don't start a new worker if we had a previously still-active connection
+    // attempt to the same server
+    {
+      std::lock_guard<wpi::mutex> lock(local->mtx);
+      if (local->active.count(active_tracker) > 0) continue;  // already in set
+    }
+
+    ++num_workers;
+
+    // start the worker
+    std::thread([=]() {
+      if (!result->done) {
+        // add to global state
+        {
+          std::lock_guard<wpi::mutex> lock(local->mtx);
+          local->active.insert(active_tracker);
+        }
+
+        // try to connect
+        auto stream = connect(server_copy.first.c_str(), server_copy.second,
+                              *plogger, timeout);
+
+        // remove from global state
+        {
+          std::lock_guard<wpi::mutex> lock(local->mtx);
+          local->active.erase(active_tracker);
+        }
+
+        // successful connection
+        if (stream) {
+          std::lock_guard<wpi::mutex> lock(result->mtx);
+          if (!result->done.exchange(true)) result->stream = std::move(stream);
+        }
+      }
+      ++result->count;
+      result->cv.notify_all();
+    })
+        .detach();
+  }
+
+  // wait for a result, timeout, or all finished
+  std::unique_lock<wpi::mutex> lock(result->mtx);
+  if (timeout == 0) {
+    result->cv.wait(
+        lock, [&] { return result->stream || result->count >= num_workers; });
+  } else {
+    auto timeout_time =
+        std::chrono::steady_clock::now() + std::chrono::seconds(timeout);
+    result->cv.wait_until(lock, timeout_time, [&] {
+      return result->stream || result->count >= num_workers;
+    });
+  }
+
+  // no need to wait for remaining worker threads; shared_ptr will clean up
+  return std::move(result->stream);
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPStream.cpp b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPStream.cpp
new file mode 100644
index 0000000..399a4e9
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/tcpsockets/TCPStream.cpp
@@ -0,0 +1,207 @@
+/*
+   TCPStream.h
+
+   TCPStream class definition. TCPStream provides methods to trasnfer
+   data between peers over a TCP/IP connection.
+
+   ------------------------------------------
+
+   Copyright (c) 2013 [Vic Hargrave - http://vichargrave.com]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+#include "tcpsockets/TCPStream.h"
+
+#include <fcntl.h>
+
+#ifdef _WIN32
+#include <WinSock2.h>
+#include <Ws2tcpip.h>
+#else
+#include <arpa/inet.h>
+#include <netinet/tcp.h>
+#include <unistd.h>
+#endif
+
+using namespace wpi;
+
+TCPStream::TCPStream(int sd, sockaddr_in* address)
+    : m_sd(sd), m_blocking(true) {
+  char ip[50];
+#ifdef _WIN32
+  InetNtop(PF_INET, &(address->sin_addr.s_addr), ip, sizeof(ip) - 1);
+#else
+  inet_ntop(PF_INET, reinterpret_cast<in_addr*>(&(address->sin_addr.s_addr)),
+            ip, sizeof(ip) - 1);
+#ifdef SO_NOSIGPIPE
+  // disable SIGPIPE on Mac OS X
+  int set = 1;
+  setsockopt(m_sd, SOL_SOCKET, SO_NOSIGPIPE, reinterpret_cast<char*>(&set),
+             sizeof set);
+#endif
+#endif
+  m_peerIP = ip;
+  m_peerPort = ntohs(address->sin_port);
+}
+
+TCPStream::~TCPStream() { close(); }
+
+size_t TCPStream::send(const char* buffer, size_t len, Error* err) {
+  if (m_sd < 0) {
+    *err = kConnectionClosed;
+    return 0;
+  }
+#ifdef _WIN32
+  WSABUF wsaBuf;
+  wsaBuf.buf = const_cast<char*>(buffer);
+  wsaBuf.len = (ULONG)len;
+  DWORD rv;
+  bool result = true;
+  while (WSASend(m_sd, &wsaBuf, 1, &rv, 0, nullptr, nullptr) == SOCKET_ERROR) {
+    if (WSAGetLastError() != WSAEWOULDBLOCK) {
+      result = false;
+      break;
+    }
+    if (!m_blocking) {
+      *err = kWouldBlock;
+      return 0;
+    }
+    Sleep(1);
+  }
+  if (!result) {
+    char Buffer[128];
+#ifdef _MSC_VER
+    sprintf_s(Buffer, "Send() failed: WSA error=%d\n", WSAGetLastError());
+#else
+    std::snprintf(Buffer, sizeof(Buffer), "Send() failed: WSA error=%d\n",
+                  WSAGetLastError());
+#endif
+    OutputDebugStringA(Buffer);
+    *err = kConnectionReset;
+    return 0;
+  }
+#else
+#ifdef MSG_NOSIGNAL
+  // disable SIGPIPE on Linux
+  ssize_t rv = ::send(m_sd, buffer, len, MSG_NOSIGNAL);
+#else
+  ssize_t rv = ::send(m_sd, buffer, len, 0);
+#endif
+  if (rv < 0) {
+    if (!m_blocking && (errno == EAGAIN || errno == EWOULDBLOCK))
+      *err = kWouldBlock;
+    else
+      *err = kConnectionReset;
+    return 0;
+  }
+#endif
+  return static_cast<size_t>(rv);
+}
+
+size_t TCPStream::receive(char* buffer, size_t len, Error* err, int timeout) {
+  if (m_sd < 0) {
+    *err = kConnectionClosed;
+    return 0;
+  }
+#ifdef _WIN32
+  int rv;
+#else
+  ssize_t rv;
+#endif
+  if (timeout <= 0) {
+#ifdef _WIN32
+    rv = recv(m_sd, buffer, len, 0);
+#else
+    rv = read(m_sd, buffer, len);
+#endif
+  } else if (WaitForReadEvent(timeout)) {
+#ifdef _WIN32
+    rv = recv(m_sd, buffer, len, 0);
+#else
+    rv = read(m_sd, buffer, len);
+#endif
+  } else {
+    *err = kConnectionTimedOut;
+    return 0;
+  }
+  if (rv < 0) {
+#ifdef _WIN32
+    if (!m_blocking && WSAGetLastError() == WSAEWOULDBLOCK)
+#else
+    if (!m_blocking && (errno == EAGAIN || errno == EWOULDBLOCK))
+#endif
+      *err = kWouldBlock;
+    else
+      *err = kConnectionReset;
+    return 0;
+  }
+  return static_cast<size_t>(rv);
+}
+
+void TCPStream::close() {
+  if (m_sd >= 0) {
+#ifdef _WIN32
+    ::shutdown(m_sd, SD_BOTH);
+    closesocket(m_sd);
+#else
+    ::shutdown(m_sd, SHUT_RDWR);
+    ::close(m_sd);
+#endif
+  }
+  m_sd = -1;
+}
+
+llvm::StringRef TCPStream::getPeerIP() const { return m_peerIP; }
+
+int TCPStream::getPeerPort() const { return m_peerPort; }
+
+void TCPStream::setNoDelay() {
+  if (m_sd < 0) return;
+  int optval = 1;
+  setsockopt(m_sd, IPPROTO_TCP, TCP_NODELAY, reinterpret_cast<char*>(&optval),
+             sizeof optval);
+}
+
+bool TCPStream::setBlocking(bool enabled) {
+  if (m_sd < 0) return true;  // silently accept
+#ifdef _WIN32
+  u_long mode = enabled ? 0 : 1;
+  if (ioctlsocket(m_sd, FIONBIO, &mode) == SOCKET_ERROR) return false;
+#else
+  int flags = fcntl(m_sd, F_GETFL, nullptr);
+  if (flags < 0) return false;
+  if (enabled)
+    flags &= ~O_NONBLOCK;
+  else
+    flags |= O_NONBLOCK;
+  if (fcntl(m_sd, F_SETFL, flags) < 0) return false;
+#endif
+  return true;
+}
+
+int TCPStream::getNativeHandle() const { return m_sd; }
+
+bool TCPStream::WaitForReadEvent(int timeout) {
+  fd_set sdset;
+  struct timeval tv;
+
+  tv.tv_sec = timeout;
+  tv.tv_usec = 0;
+  FD_ZERO(&sdset);
+  FD_SET(m_sd, &sdset);
+  if (select(m_sd + 1, &sdset, NULL, NULL, &tv) > 0) {
+    return true;
+  }
+  return false;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/cpp/udpsockets/UDPClient.cpp b/third_party/wpiutil_2018/src/main/native/cpp/udpsockets/UDPClient.cpp
new file mode 100644
index 0000000..eb615a6
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/cpp/udpsockets/UDPClient.cpp
@@ -0,0 +1,170 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "udpsockets/UDPClient.h"
+
+#ifdef _WIN32
+#include <WinSock2.h>
+#include <Ws2tcpip.h>
+#pragma comment(lib, "Ws2_32.lib")
+#else
+#include <arpa/inet.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <unistd.h>
+#endif
+
+#include "support/Logger.h"
+#include "tcpsockets/SocketError.h"
+
+using namespace wpi;
+
+UDPClient::UDPClient(Logger& logger) : UDPClient("", logger) {}
+
+UDPClient::UDPClient(llvm::StringRef address, Logger& logger)
+    : m_lsd(0), m_address(address), m_logger(logger) {}
+
+UDPClient::UDPClient(UDPClient&& other)
+    : m_lsd(other.m_lsd),
+      m_address(std::move(other.m_address)),
+      m_logger(other.m_logger) {
+  other.m_lsd = 0;
+}
+
+UDPClient::~UDPClient() {
+  if (m_lsd > 0) {
+    shutdown();
+  }
+}
+
+UDPClient& UDPClient::operator=(UDPClient&& other) {
+  if (this == &other) return *this;
+  shutdown();
+  m_logger = other.m_logger;
+  m_lsd = other.m_lsd;
+  m_address = std::move(other.m_address);
+  other.m_lsd = 0;
+  return *this;
+}
+
+int UDPClient::start() {
+  if (m_lsd > 0) return 0;
+
+#ifdef _WIN32
+  WSAData wsaData;
+  WORD wVersionRequested = MAKEWORD(2, 2);
+  WSAStartup(wVersionRequested, &wsaData);
+#endif
+
+  m_lsd = socket(AF_INET, SOCK_DGRAM, 0);
+
+  if (m_lsd < 0) {
+    WPI_ERROR(m_logger, "could not create socket");
+    return -1;
+  }
+
+  struct sockaddr_in addr;
+  std::memset(&addr, 0, sizeof(addr));
+  addr.sin_family = AF_INET;
+  if (m_address.size() > 0) {
+#ifdef _WIN32
+    llvm::SmallString<128> addr_copy(m_address);
+    addr_copy.push_back('\0');
+    int res = InetPton(PF_INET, addr_copy.data(), &(addr.sin_addr));
+#else
+    int res = inet_pton(PF_INET, m_address.c_str(), &(addr.sin_addr));
+#endif
+    if (res != 1) {
+      WPI_ERROR(m_logger, "could not resolve " << m_address << " address");
+      return -1;
+    }
+  } else {
+    addr.sin_addr.s_addr = INADDR_ANY;
+  }
+  addr.sin_port = htons(0);
+
+  int result = bind(m_lsd, reinterpret_cast<sockaddr*>(&addr), sizeof(addr));
+  if (result != 0) {
+    WPI_ERROR(m_logger, "bind() failed: " << SocketStrerror());
+    return result;
+  }
+  return 0;
+}
+
+void UDPClient::shutdown() {
+  if (m_lsd > 0) {
+#ifdef _WIN32
+    ::shutdown(m_lsd, SD_BOTH);
+    closesocket(m_lsd);
+    WSACleanup();
+#else
+    ::shutdown(m_lsd, SHUT_RDWR);
+    close(m_lsd);
+#endif
+    m_lsd = 0;
+  }
+}
+
+int UDPClient::send(llvm::ArrayRef<uint8_t> data, llvm::StringRef server,
+                    int port) {
+  // server must be a resolvable IP address
+  struct sockaddr_in addr;
+  std::memset(&addr, 0, sizeof(addr));
+  addr.sin_family = AF_INET;
+  if (server.size() > 0) {
+    llvm::SmallVector<char, 128> addr_store;
+    auto remoteAddr = server.c_str(addr_store);
+#ifdef _WIN32
+    int res = InetPton(AF_INET, remoteAddr, &(addr.sin_addr));
+#else
+    int res = inet_pton(AF_INET, remoteAddr, &(addr.sin_addr));
+#endif
+    if (res != 1) {
+      WPI_ERROR(m_logger, "could not resolve " << server << " address");
+      return -1;
+    }
+  } else {
+    WPI_ERROR(m_logger, "server must be passed");
+    return -1;
+  }
+  addr.sin_port = htons(port);
+
+  // sendto should not block
+  int result =
+      sendto(m_lsd, reinterpret_cast<const char*>(data.data()), data.size(), 0,
+             reinterpret_cast<sockaddr*>(&addr), sizeof(addr));
+  return result;
+}
+
+int UDPClient::send(llvm::StringRef data, llvm::StringRef server, int port) {
+  // server must be a resolvable IP address
+  struct sockaddr_in addr;
+  std::memset(&addr, 0, sizeof(addr));
+  addr.sin_family = AF_INET;
+  if (server.size() > 0) {
+    llvm::SmallVector<char, 128> addr_store;
+    auto remoteAddr = server.c_str(addr_store);
+#ifdef _WIN32
+    int res = InetPton(AF_INET, remoteAddr, &(addr.sin_addr));
+#else
+    int res = inet_pton(AF_INET, remoteAddr, &(addr.sin_addr));
+#endif
+    if (res != 1) {
+      WPI_ERROR(m_logger, "could not resolve " << server << " address");
+      return -1;
+    }
+  } else {
+    WPI_ERROR(m_logger, "server must be passed");
+    return -1;
+  }
+  addr.sin_port = htons(port);
+
+  // sendto should not block
+  int result = sendto(m_lsd, data.data(), data.size(), 0,
+                      reinterpret_cast<sockaddr*>(&addr), sizeof(addr));
+  return result;
+}
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/AlignOf.h b/third_party/wpiutil_2018/src/main/native/include/llvm/AlignOf.h
new file mode 100644
index 0000000..d54328b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/AlignOf.h
@@ -0,0 +1,259 @@
+//===--- AlignOf.h - Portable calculation of type alignment -----*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the AlignOf function that computes alignments for
+// arbitrary types.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_ALIGNOF_H
+#define LLVM_SUPPORT_ALIGNOF_H
+
+#include "llvm/Compiler.h"
+#include <cstddef>
+#include <type_traits>
+
+namespace llvm {
+
+namespace detail {
+
+// For everything other than an abstract class we can calulate alignment by
+// building a class with a single character and a member of the given type.
+template <typename T, bool = std::is_abstract<T>::value>
+struct AlignmentCalcImpl {
+  char x;
+#if defined(_MSC_VER)
+// Disables "structure was padded due to __declspec(align())" warnings that are
+// generated by any class using AlignOf<T> with a manually specified alignment.
+// Although the warning is disabled in the LLVM project we need this pragma
+// as AlignOf.h is a published support header that's available for use
+// out-of-tree, and we would like that to compile cleanly at /W4.
+#pragma warning(suppress : 4324)
+#endif
+  T t;
+private:
+  AlignmentCalcImpl() = delete;
+};
+
+// Abstract base class helper, this will have the minimal alignment and size
+// for any abstract class. We don't even define its destructor because this
+// type should never be used in a way that requires it.
+struct AlignmentCalcImplBase {
+  virtual ~AlignmentCalcImplBase() = 0;
+};
+
+// When we have an abstract class type, specialize the alignment computation
+// engine to create another abstract class that derives from both an empty
+// abstract base class and the provided type. This has the same effect as the
+// above except that it handles the fact that we can't actually create a member
+// of type T.
+template <typename T>
+struct AlignmentCalcImpl<T, true> : AlignmentCalcImplBase, T {
+  ~AlignmentCalcImpl() override = 0;
+};
+
+} // End detail namespace.
+
+/// AlignOf - A templated class that contains an enum value representing
+///  the alignment of the template argument.  For example,
+///  AlignOf<int>::Alignment represents the alignment of type "int".  The
+///  alignment calculated is the minimum alignment, and not necessarily
+///  the "desired" alignment returned by GCC's __alignof__ (for example).  Note
+///  that because the alignment is an enum value, it can be used as a
+///  compile-time constant (e.g., for template instantiation).
+template <typename T>
+struct AlignOf {
+#ifndef _MSC_VER
+  // Avoid warnings from GCC like:
+  //   comparison between 'enum llvm::AlignOf<X>::<anonymous>' and 'enum
+  //   llvm::AlignOf<Y>::<anonymous>' [-Wenum-compare]
+  // by using constexpr instead of enum.
+  // (except on MSVC, since it doesn't support constexpr yet).
+  static constexpr unsigned Alignment = static_cast<unsigned int>(
+      sizeof(detail::AlignmentCalcImpl<T>) - sizeof(T));
+#else
+  enum {
+    Alignment = static_cast<unsigned int>(
+        sizeof(::llvm::detail::AlignmentCalcImpl<T>) - sizeof(T))
+  };
+#endif
+  enum { Alignment_GreaterEqual_2Bytes = Alignment >= 2 ? 1 : 0 };
+  enum { Alignment_GreaterEqual_4Bytes = Alignment >= 4 ? 1 : 0 };
+  enum { Alignment_GreaterEqual_8Bytes = Alignment >= 8 ? 1 : 0 };
+  enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 };
+
+  enum { Alignment_LessEqual_2Bytes = Alignment <= 2 ? 1 : 0 };
+  enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 };
+  enum { Alignment_LessEqual_8Bytes = Alignment <= 8 ? 1 : 0 };
+  enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 };
+};
+
+#ifndef _MSC_VER
+template <typename T> constexpr unsigned AlignOf<T>::Alignment;
+#endif
+
+/// alignOf - A templated function that returns the minimum alignment of
+///  of a type.  This provides no extra functionality beyond the AlignOf
+///  class besides some cosmetic cleanliness.  Example usage:
+///  alignOf<int>() returns the alignment of an int.
+template <typename T>
+inline unsigned alignOf() { return AlignOf<T>::Alignment; }
+
+/// \struct AlignedCharArray
+/// \brief Helper for building an aligned character array type.
+///
+/// This template is used to explicitly build up a collection of aligned
+/// character array types. We have to build these up using a macro and explicit
+/// specialization to cope with old versions of MSVC and GCC where only an
+/// integer literal can be used to specify an alignment constraint. Once built
+/// up here, we can then begin to indirect between these using normal C++
+/// template parameters.
+
+// MSVC requires special handling here.
+#ifndef _MSC_VER
+
+#if __has_feature(cxx_alignas)
+template<std::size_t Alignment, std::size_t Size>
+struct AlignedCharArray {
+  alignas(Alignment) char buffer[Size];
+};
+
+#elif defined(__GNUC__) || defined(__IBM_ATTRIBUTES)
+/// \brief Create a type with an aligned char buffer.
+template<std::size_t Alignment, std::size_t Size>
+struct AlignedCharArray;
+
+#define LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
+  template<std::size_t Size> \
+  struct AlignedCharArray<x, Size> { \
+    __attribute__((aligned(x))) char buffer[Size]; \
+  };
+
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(1)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(2)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(4)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(8)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128)
+
+#undef LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
+
+#else
+# error No supported align as directive.
+#endif
+
+#else // _MSC_VER
+
+/// \brief Create a type with an aligned char buffer.
+template<std::size_t Alignment, std::size_t Size>
+struct AlignedCharArray;
+
+// We provide special variations of this template for the most common
+// alignments because __declspec(align(...)) doesn't actually work when it is
+// a member of a by-value function argument in MSVC, even if the alignment
+// request is something reasonably like 8-byte or 16-byte. Note that we can't
+// even include the declspec with the union that forces the alignment because
+// MSVC warns on the existence of the declspec despite the union member forcing
+// proper alignment.
+
+template<std::size_t Size>
+struct AlignedCharArray<1, Size> {
+  union {
+    char aligned;
+    char buffer[Size];
+  };
+};
+
+template<std::size_t Size>
+struct AlignedCharArray<2, Size> {
+  union {
+    short aligned;
+    char buffer[Size];
+  };
+};
+
+template<std::size_t Size>
+struct AlignedCharArray<4, Size> {
+  union {
+    int aligned;
+    char buffer[Size];
+  };
+};
+
+template<std::size_t Size>
+struct AlignedCharArray<8, Size> {
+  union {
+    double aligned;
+    char buffer[Size];
+  };
+};
+
+
+// The rest of these are provided with a __declspec(align(...)) and we simply
+// can't pass them by-value as function arguments on MSVC.
+
+#define LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(x) \
+  template<std::size_t Size> \
+  struct AlignedCharArray<x, Size> { \
+    __declspec(align(x)) char buffer[Size]; \
+  };
+
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(16)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(32)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(64)
+LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT(128)
+
+#undef LLVM_ALIGNEDCHARARRAY_TEMPLATE_ALIGNMENT
+
+#endif // _MSC_VER
+
+namespace detail {
+template <typename T1,
+          typename T2 = char, typename T3 = char, typename T4 = char,
+          typename T5 = char, typename T6 = char, typename T7 = char,
+          typename T8 = char, typename T9 = char, typename T10 = char>
+class AlignerImpl {
+  T1 t1; T2 t2; T3 t3; T4 t4; T5 t5; T6 t6; T7 t7; T8 t8; T9 t9; T10 t10;
+
+  AlignerImpl() = delete;
+};
+
+template <typename T1,
+          typename T2 = char, typename T3 = char, typename T4 = char,
+          typename T5 = char, typename T6 = char, typename T7 = char,
+          typename T8 = char, typename T9 = char, typename T10 = char>
+union SizerImpl {
+  char arr1[sizeof(T1)], arr2[sizeof(T2)], arr3[sizeof(T3)], arr4[sizeof(T4)],
+       arr5[sizeof(T5)], arr6[sizeof(T6)], arr7[sizeof(T7)], arr8[sizeof(T8)],
+       arr9[sizeof(T9)], arr10[sizeof(T10)];
+};
+} // end namespace detail
+
+/// \brief This union template exposes a suitably aligned and sized character
+/// array member which can hold elements of any of up to ten types.
+///
+/// These types may be arrays, structs, or any other types. The goal is to
+/// expose a char array buffer member which can be used as suitable storage for
+/// a placement new of any of these types. Support for more than ten types can
+/// be added at the cost of more boilerplate.
+template <typename T1,
+          typename T2 = char, typename T3 = char, typename T4 = char,
+          typename T5 = char, typename T6 = char, typename T7 = char,
+          typename T8 = char, typename T9 = char, typename T10 = char>
+struct AlignedCharArrayUnion : llvm::AlignedCharArray<
+    AlignOf<llvm::detail::AlignerImpl<T1, T2, T3, T4, T5,
+                                      T6, T7, T8, T9, T10> >::Alignment,
+    sizeof(::llvm::detail::SizerImpl<T1, T2, T3, T4, T5,
+                                     T6, T7, T8, T9, T10>)> {
+};
+} // end namespace llvm
+
+#endif // LLVM_SUPPORT_ALIGNOF_H
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/ArrayRef.h b/third_party/wpiutil_2018/src/main/native/include/llvm/ArrayRef.h
new file mode 100644
index 0000000..4e7cd1a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/ArrayRef.h
@@ -0,0 +1,397 @@
+//===--- ArrayRef.h - Array Reference Wrapper -------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_ARRAYREF_H
+#define LLVM_ADT_ARRAYREF_H
+
+#include "llvm/Compiler.h"
+#include "llvm/Hashing.h"
+#include "llvm/None.h"
+#include "llvm/SmallVector.h"
+#include <vector>
+
+namespace llvm {
+  /// ArrayRef - Represent a constant reference to an array (0 or more elements
+  /// consecutively in memory), i.e. a start pointer and a length.  It allows
+  /// various APIs to take consecutive elements easily and conveniently.
+  ///
+  /// This class does not own the underlying data, it is expected to be used in
+  /// situations where the data resides in some other buffer, whose lifetime
+  /// extends past that of the ArrayRef. For this reason, it is not in general
+  /// safe to store an ArrayRef.
+  ///
+  /// This is intended to be trivially copyable, so it should be passed by
+  /// value.
+  template<typename T>
+  class ArrayRef {
+  public:
+    typedef const T *iterator;
+    typedef const T *const_iterator;
+    typedef size_t size_type;
+
+    typedef std::reverse_iterator<iterator> reverse_iterator;
+
+  private:
+    /// The start of the array, in an external buffer.
+    const T *Data;
+
+    /// The number of elements.
+    size_type Length;
+
+  public:
+    /// @name Constructors
+    /// @{
+
+    /// Construct an empty ArrayRef.
+    /*implicit*/ ArrayRef() : Data(nullptr), Length(0) {}
+
+    /// Construct an empty ArrayRef from None.
+    /*implicit*/ ArrayRef(NoneType) : Data(nullptr), Length(0) {}
+
+    /// Construct an ArrayRef from a single element.
+    /*implicit*/ ArrayRef(const T &OneElt)
+      : Data(&OneElt), Length(1) {}
+
+    /// Construct an ArrayRef from a pointer and length.
+    /*implicit*/ ArrayRef(const T *data, size_t length)
+      : Data(data), Length(length) {}
+
+    /// Construct an ArrayRef from a range.
+    ArrayRef(const T *begin, const T *end)
+      : Data(begin), Length(end - begin) {}
+
+    /// Construct an ArrayRef from a SmallVector. This is templated in order to
+    /// avoid instantiating SmallVectorTemplateCommon<T> whenever we
+    /// copy-construct an ArrayRef.
+    template<typename U>
+    /*implicit*/ ArrayRef(const SmallVectorTemplateCommon<T, U> &Vec)
+      : Data(Vec.data()), Length(Vec.size()) {
+    }
+
+    /// Construct an ArrayRef from a std::vector.
+    template<typename A>
+    /*implicit*/ ArrayRef(const std::vector<T, A> &Vec)
+      : Data(Vec.data()), Length(Vec.size()) {}
+
+    /// Construct an ArrayRef from a C array.
+    template <size_t N>
+    /*implicit*/ LLVM_CONSTEXPR ArrayRef(const T (&Arr)[N])
+      : Data(Arr), Length(N) {}
+
+    /// Construct an ArrayRef from a std::initializer_list.
+    /*implicit*/ ArrayRef(const std::initializer_list<T> &Vec)
+    : Data(Vec.begin() == Vec.end() ? (T*)nullptr : Vec.begin()),
+      Length(Vec.size()) {}
+
+    /// Construct an ArrayRef<const T*> from ArrayRef<T*>. This uses SFINAE to
+    /// ensure that only ArrayRefs of pointers can be converted.
+    template <typename U>
+    ArrayRef(
+        const ArrayRef<U *> &A,
+        typename std::enable_if<
+           std::is_convertible<U *const *, T const *>::value>::type * = nullptr)
+      : Data(A.data()), Length(A.size()) {}
+
+    /// Construct an ArrayRef<const T*> from a SmallVector<T*>. This is
+    /// templated in order to avoid instantiating SmallVectorTemplateCommon<T>
+    /// whenever we copy-construct an ArrayRef.
+    template<typename U, typename DummyT>
+    /*implicit*/ ArrayRef(
+      const SmallVectorTemplateCommon<U *, DummyT> &Vec,
+      typename std::enable_if<
+          std::is_convertible<U *const *, T const *>::value>::type * = nullptr)
+      : Data(Vec.data()), Length(Vec.size()) {
+    }
+
+    /// Construct an ArrayRef<const T*> from std::vector<T*>. This uses SFINAE
+    /// to ensure that only vectors of pointers can be converted.
+    template<typename U, typename A>
+    ArrayRef(const std::vector<U *, A> &Vec,
+             typename std::enable_if<
+                 std::is_convertible<U *const *, T const *>::value>::type* = 0)
+      : Data(Vec.data()), Length(Vec.size()) {}
+
+    /// @}
+    /// @name Simple Operations
+    /// @{
+
+    iterator begin() const { return Data; }
+    iterator end() const { return Data + Length; }
+
+    reverse_iterator rbegin() const { return reverse_iterator(end()); }
+    reverse_iterator rend() const { return reverse_iterator(begin()); }
+
+    /// empty - Check if the array is empty.
+    bool empty() const { return Length == 0; }
+
+    const T *data() const { return Data; }
+
+    /// size - Get the array size.
+    size_t size() const { return Length; }
+
+    /// front - Get the first element.
+    const T &front() const {
+      assert(!empty());
+      return Data[0];
+    }
+
+    /// back - Get the last element.
+    const T &back() const {
+      assert(!empty());
+      return Data[Length-1];
+    }
+
+    // copy - Allocate copy in Allocator and return ArrayRef<T> to it.
+    template <typename Allocator> ArrayRef<T> copy(Allocator &A) {
+      T *Buff = A.template Allocate<T>(Length);
+      std::uninitialized_copy(begin(), end(), Buff);
+      return ArrayRef<T>(Buff, Length);
+    }
+
+    /// equals - Check for element-wise equality.
+    bool equals(ArrayRef RHS) const {
+      if (Length != RHS.Length)
+        return false;
+      return std::equal(begin(), end(), RHS.begin());
+    }
+
+    /// slice(n) - Chop off the first N elements of the array.
+    ArrayRef<T> slice(size_t N) const {
+      assert(N <= size() && "Invalid specifier");
+      return ArrayRef<T>(data()+N, size()-N);
+    }
+
+    /// slice(n, m) - Chop off the first N elements of the array, and keep M
+    /// elements in the array.
+    ArrayRef<T> slice(size_t N, size_t M) const {
+      assert(N+M <= size() && "Invalid specifier");
+      return ArrayRef<T>(data()+N, M);
+    }
+
+    /// \brief Drop the first \p N elements of the array.
+    ArrayRef<T> drop_front(size_t N = 1) const {
+      assert(size() >= N && "Dropping more elements than exist");
+      return slice(N, size() - N);
+    }
+
+    /// \brief Drop the last \p N elements of the array.
+    ArrayRef<T> drop_back(size_t N = 1) const {
+      assert(size() >= N && "Dropping more elements than exist");
+      return slice(0, size() - N);
+    }
+
+    /// @}
+    /// @name Operator Overloads
+    /// @{
+    const T &operator[](size_t Index) const {
+      assert(Index < Length && "Invalid index!");
+      return Data[Index];
+    }
+
+    /// @}
+    /// @name Expensive Operations
+    /// @{
+    std::vector<T> vec() const {
+      return std::vector<T>(Data, Data+Length);
+    }
+
+    /// @}
+    /// @name Conversion operators
+    /// @{
+    operator std::vector<T>() const {
+      return std::vector<T>(Data, Data+Length);
+    }
+
+    /// @}
+  };
+
+  /// MutableArrayRef - Represent a mutable reference to an array (0 or more
+  /// elements consecutively in memory), i.e. a start pointer and a length.  It
+  /// allows various APIs to take and modify consecutive elements easily and
+  /// conveniently.
+  ///
+  /// This class does not own the underlying data, it is expected to be used in
+  /// situations where the data resides in some other buffer, whose lifetime
+  /// extends past that of the MutableArrayRef. For this reason, it is not in
+  /// general safe to store a MutableArrayRef.
+  ///
+  /// This is intended to be trivially copyable, so it should be passed by
+  /// value.
+  template<typename T>
+  class MutableArrayRef : public ArrayRef<T> {
+  public:
+    typedef T *iterator;
+
+    typedef std::reverse_iterator<iterator> reverse_iterator;
+
+    /// Construct an empty MutableArrayRef.
+    /*implicit*/ MutableArrayRef() : ArrayRef<T>() {}
+
+    /// Construct an empty MutableArrayRef from None.
+    /*implicit*/ MutableArrayRef(NoneType) : ArrayRef<T>() {}
+
+    /// Construct an MutableArrayRef from a single element.
+    /*implicit*/ MutableArrayRef(T &OneElt) : ArrayRef<T>(OneElt) {}
+
+    /// Construct an MutableArrayRef from a pointer and length.
+    /*implicit*/ MutableArrayRef(T *data, size_t length)
+      : ArrayRef<T>(data, length) {}
+
+    /// Construct an MutableArrayRef from a range.
+    MutableArrayRef(T *begin, T *end) : ArrayRef<T>(begin, end) {}
+
+    /// Construct an MutableArrayRef from a SmallVector.
+    /*implicit*/ MutableArrayRef(SmallVectorImpl<T> &Vec)
+    : ArrayRef<T>(Vec) {}
+
+    /// Construct a MutableArrayRef from a std::vector.
+    /*implicit*/ MutableArrayRef(std::vector<T> &Vec)
+    : ArrayRef<T>(Vec) {}
+
+    /// Construct an MutableArrayRef from a C array.
+    template <size_t N>
+    /*implicit*/ LLVM_CONSTEXPR MutableArrayRef(T (&Arr)[N])
+      : ArrayRef<T>(Arr) {}
+
+    T *data() const { return const_cast<T*>(ArrayRef<T>::data()); }
+
+    iterator begin() const { return data(); }
+    iterator end() const { return data() + this->size(); }
+
+    reverse_iterator rbegin() const { return reverse_iterator(end()); }
+    reverse_iterator rend() const { return reverse_iterator(begin()); }
+
+    /// front - Get the first element.
+    T &front() const {
+      assert(!this->empty());
+      return data()[0];
+    }
+
+    /// back - Get the last element.
+    T &back() const {
+      assert(!this->empty());
+      return data()[this->size()-1];
+    }
+
+    /// slice(n) - Chop off the first N elements of the array.
+    MutableArrayRef<T> slice(size_t N) const {
+      assert(N <= this->size() && "Invalid specifier");
+      return MutableArrayRef<T>(data()+N, this->size()-N);
+    }
+
+    /// slice(n, m) - Chop off the first N elements of the array, and keep M
+    /// elements in the array.
+    MutableArrayRef<T> slice(size_t N, size_t M) const {
+      assert(N+M <= this->size() && "Invalid specifier");
+      return MutableArrayRef<T>(data()+N, M);
+    }
+
+    /// \brief Drop the first \p N elements of the array.
+    MutableArrayRef<T> drop_front(size_t N = 1) const {
+      assert(this->size() >= N && "Dropping more elements than exist");
+      return slice(N, this->size() - N);
+    }
+
+    MutableArrayRef<T> drop_back(size_t N = 1) const {
+      assert(this->size() >= N && "Dropping more elements than exist");
+      return slice(0, this->size() - N);
+    }
+
+    /// @}
+    /// @name Operator Overloads
+    /// @{
+    T &operator[](size_t Index) const {
+      assert(Index < this->size() && "Invalid index!");
+      return data()[Index];
+    }
+  };
+
+  /// @name ArrayRef Convenience constructors
+  /// @{
+
+  /// Construct an ArrayRef from a single element.
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const T &OneElt) {
+    return OneElt;
+  }
+
+  /// Construct an ArrayRef from a pointer and length.
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const T *data, size_t length) {
+    return ArrayRef<T>(data, length);
+  }
+
+  /// Construct an ArrayRef from a range.
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const T *begin, const T *end) {
+    return ArrayRef<T>(begin, end);
+  }
+
+  /// Construct an ArrayRef from a SmallVector.
+  template <typename T>
+  ArrayRef<T> makeArrayRef(const SmallVectorImpl<T> &Vec) {
+    return Vec;
+  }
+
+  /// Construct an ArrayRef from a SmallVector.
+  template <typename T, unsigned N>
+  ArrayRef<T> makeArrayRef(const SmallVector<T, N> &Vec) {
+    return Vec;
+  }
+
+  /// Construct an ArrayRef from a std::vector.
+  template<typename T>
+  ArrayRef<T> makeArrayRef(const std::vector<T> &Vec) {
+    return Vec;
+  }
+
+  /// Construct an ArrayRef from an ArrayRef (no-op) (const)
+  template <typename T> ArrayRef<T> makeArrayRef(const ArrayRef<T> &Vec) {
+    return Vec;
+  }
+
+  /// Construct an ArrayRef from an ArrayRef (no-op)
+  template <typename T> ArrayRef<T> &makeArrayRef(ArrayRef<T> &Vec) {
+    return Vec;
+  }
+
+  /// Construct an ArrayRef from a C array.
+  template<typename T, size_t N>
+  ArrayRef<T> makeArrayRef(const T (&Arr)[N]) {
+    return ArrayRef<T>(Arr);
+  }
+
+  /// @}
+  /// @name ArrayRef Comparison Operators
+  /// @{
+
+  template<typename T>
+  inline bool operator==(ArrayRef<T> LHS, ArrayRef<T> RHS) {
+    return LHS.equals(RHS);
+  }
+
+  template<typename T>
+  inline bool operator!=(ArrayRef<T> LHS, ArrayRef<T> RHS) {
+    return !(LHS == RHS);
+  }
+
+  /// @}
+
+  // ArrayRefs can be treated like a POD type.
+  template <typename T> struct isPodLike;
+  template <typename T> struct isPodLike<ArrayRef<T> > {
+    static const bool value = true;
+  };
+
+  template <typename T> hash_code hash_value(ArrayRef<T> S) {
+    return hash_combine_range(S.begin(), S.end());
+  }
+} // end namespace llvm
+
+#endif // LLVM_ADT_ARRAYREF_H
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/Compiler.h b/third_party/wpiutil_2018/src/main/native/include/llvm/Compiler.h
new file mode 100644
index 0000000..b7add94
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/Compiler.h
@@ -0,0 +1,92 @@
+//===-- llvm/Support/Compiler.h - Compiler abstraction support --*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines several macros, based on the current compiler.  This allows
+// use of compiler-specific features in a way that remains portable.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_COMPILER_H
+#define LLVM_SUPPORT_COMPILER_H
+
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
+
+#ifndef __has_extension
+# define __has_extension(x) 0
+#endif
+
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+
+#ifndef __has_builtin
+# define __has_builtin(x) 0
+#endif
+
+/// \macro LLVM_GNUC_PREREQ
+/// \brief Extend the default __GNUC_PREREQ even if glibc's features.h isn't
+/// available.
+#ifndef LLVM_GNUC_PREREQ
+# if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+#  define LLVM_GNUC_PREREQ(maj, min, patch) \
+    ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) + __GNUC_PATCHLEVEL__ >= \
+     ((maj) << 20) + ((min) << 10) + (patch))
+# elif defined(__GNUC__) && defined(__GNUC_MINOR__)
+#  define LLVM_GNUC_PREREQ(maj, min, patch) \
+    ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) >= ((maj) << 20) + ((min) << 10))
+# else
+#  define LLVM_GNUC_PREREQ(maj, min, patch) 0
+# endif
+#endif
+
+#ifndef LLVM_CONSTEXPR
+# ifdef _MSC_VER
+#  if _MSC_VER >= 1900
+#   define LLVM_CONSTEXPR constexpr
+#  else
+#   define LLVM_CONSTEXPR
+#  endif
+# elif defined(__has_feature)
+#  if __has_feature(cxx_constexpr)
+#   define LLVM_CONSTEXPR constexpr
+#  else
+#   define LLVM_CONSTEXPR
+#  endif
+# elif defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define LLVM_CONSTEXPR constexpr
+# elif defined(__has_constexpr)
+#  define LLVM_CONSTEXPR constexpr
+# else
+#  define LLVM_CONSTEXPR
+# endif
+#endif
+
+#ifndef LLVM_ATTRIBUTE_UNUSED_RESULT
+#if __has_attribute(warn_unused_result) || LLVM_GNUC_PREREQ(3, 4, 0)
+#define LLVM_ATTRIBUTE_UNUSED_RESULT __attribute__((__warn_unused_result__))
+#elif defined(_MSC_VER)
+#define LLVM_ATTRIBUTE_UNUSED_RESULT _Check_return_
+#else
+#define LLVM_ATTRIBUTE_UNUSED_RESULT
+#endif
+#endif
+
+#ifndef LLVM_UNLIKELY
+#if __has_builtin(__builtin_expect) || LLVM_GNUC_PREREQ(4, 0, 0)
+#define LLVM_LIKELY(EXPR) __builtin_expect((bool)(EXPR), true)
+#define LLVM_UNLIKELY(EXPR) __builtin_expect((bool)(EXPR), false)
+#else
+#define LLVM_LIKELY(EXPR) (EXPR)
+#define LLVM_UNLIKELY(EXPR) (EXPR)
+#endif
+#endif
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/ConvertUTF.h b/third_party/wpiutil_2018/src/main/native/include/llvm/ConvertUTF.h
new file mode 100644
index 0000000..5b02533
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/ConvertUTF.h
@@ -0,0 +1,255 @@
+/*===--- ConvertUTF.h - Universal Character Names conversions ---------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+ *==------------------------------------------------------------------------==*/
+/*
+ * Copyright 2001-2004 Unicode, Inc.
+ *
+ * Disclaimer
+ *
+ * This source code is provided as is by Unicode, Inc. No claims are
+ * made as to fitness for any particular purpose. No warranties of any
+ * kind are expressed or implied. The recipient agrees to determine
+ * applicability of information provided. If this file has been
+ * purchased on magnetic or optical media from Unicode, Inc., the
+ * sole remedy for any claim will be exchange of defective media
+ * within 90 days of receipt.
+ *
+ * Limitations on Rights to Redistribute This Code
+ *
+ * Unicode, Inc. hereby grants the right to freely use the information
+ * supplied in this file in the creation of products supporting the
+ * Unicode Standard, and to make copies of this file in any form
+ * for internal or external distribution as long as this notice
+ * remains attached.
+ */
+
+/* ---------------------------------------------------------------------
+
+    Conversions between UTF32, UTF-16, and UTF-8.  Header file.
+
+    Several funtions are included here, forming a complete set of
+    conversions between the three formats.  UTF-7 is not included
+    here, but is handled in a separate source file.
+
+    Each of these routines takes pointers to input buffers and output
+    buffers.  The input buffers are const.
+
+    Each routine converts the text between *sourceStart and sourceEnd,
+    putting the result into the buffer between *targetStart and
+    targetEnd. Note: the end pointers are *after* the last item: e.g.
+    *(sourceEnd - 1) is the last item.
+
+    The return result indicates whether the conversion was successful,
+    and if not, whether the problem was in the source or target buffers.
+    (Only the first encountered problem is indicated.)
+
+    After the conversion, *sourceStart and *targetStart are both
+    updated to point to the end of last text successfully converted in
+    the respective buffers.
+
+    Input parameters:
+        sourceStart - pointer to a pointer to the source buffer.
+                The contents of this are modified on return so that
+                it points at the next thing to be converted.
+        targetStart - similarly, pointer to pointer to the target buffer.
+        sourceEnd, targetEnd - respectively pointers to the ends of the
+                two buffers, for overflow checking only.
+
+    These conversion functions take a ConversionFlags argument. When this
+    flag is set to strict, both irregular sequences and isolated surrogates
+    will cause an error.  When the flag is set to lenient, both irregular
+    sequences and isolated surrogates are converted.
+
+    Whether the flag is strict or lenient, all illegal sequences will cause
+    an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
+    or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
+    must check for illegal sequences.
+
+    When the flag is set to lenient, characters over 0x10FFFF are converted
+    to the replacement character; otherwise (when the flag is set to strict)
+    they constitute an error.
+
+    Output parameters:
+        The value "sourceIllegal" is returned from some routines if the input
+        sequence is malformed.  When "sourceIllegal" is returned, the source
+        value will point to the illegal value that caused the problem. E.g.,
+        in UTF-8 when a sequence is malformed, it points to the start of the
+        malformed sequence.
+
+    Author: Mark E. Davis, 1994.
+    Rev History: Rick McGowan, fixes & updates May 2001.
+         Fixes & updates, Sept 2001.
+
+------------------------------------------------------------------------ */
+
+#ifndef LLVM_SUPPORT_CONVERTUTF_H
+#define LLVM_SUPPORT_CONVERTUTF_H
+
+/* ---------------------------------------------------------------------
+    The following 4 definitions are compiler-specific.
+    The C standard does not guarantee that wchar_t has at least
+    16 bits, so wchar_t is no less portable than unsigned short!
+    All should be unsigned values to avoid sign extension during
+    bit mask & shift operations.
+------------------------------------------------------------------------ */
+
+typedef unsigned int    UTF32;  /* at least 32 bits */
+typedef unsigned short  UTF16;  /* at least 16 bits */
+typedef unsigned char   UTF8;   /* typically 8 bits */
+typedef bool   Boolean; /* 0 or 1 */
+
+/* Some fundamental constants */
+#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
+#define UNI_MAX_BMP (UTF32)0x0000FFFF
+#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
+#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
+#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
+
+#define UNI_MAX_UTF8_BYTES_PER_CODE_POINT 4
+
+#define UNI_UTF16_BYTE_ORDER_MARK_NATIVE  0xFEFF
+#define UNI_UTF16_BYTE_ORDER_MARK_SWAPPED 0xFFFE
+
+typedef enum {
+  conversionOK,           /* conversion successful */
+  sourceExhausted,        /* partial character in source, but hit end */
+  targetExhausted,        /* insuff. room in target for conversion */
+  sourceIllegal           /* source sequence is illegal/malformed */
+} ConversionResult;
+
+typedef enum {
+  strictConversion = 0,
+  lenientConversion
+} ConversionFlags;
+
+/* This is for C++ and does no harm in C */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ConversionResult ConvertUTF8toUTF16 (
+  const UTF8** sourceStart, const UTF8* sourceEnd,
+  UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+
+/**
+ * Convert a partial UTF8 sequence to UTF32.  If the sequence ends in an
+ * incomplete code unit sequence, returns \c sourceExhausted.
+ */
+ConversionResult ConvertUTF8toUTF32Partial(
+  const UTF8** sourceStart, const UTF8* sourceEnd,
+  UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+
+/**
+ * Convert a partial UTF8 sequence to UTF32.  If the sequence ends in an
+ * incomplete code unit sequence, returns \c sourceIllegal.
+ */
+ConversionResult ConvertUTF8toUTF32(
+  const UTF8** sourceStart, const UTF8* sourceEnd,
+  UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF16toUTF8 (
+  const UTF16** sourceStart, const UTF16* sourceEnd,
+  UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF32toUTF8 (
+  const UTF32** sourceStart, const UTF32* sourceEnd,
+  UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF16toUTF32 (
+  const UTF16** sourceStart, const UTF16* sourceEnd,
+  UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
+
+ConversionResult ConvertUTF32toUTF16 (
+  const UTF32** sourceStart, const UTF32* sourceEnd,
+  UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
+
+Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
+
+Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd);
+
+unsigned getNumBytesForUTF8(UTF8 firstByte);
+
+#ifdef __cplusplus
+}
+
+/*************************************************************************/
+/* Below are LLVM-specific wrappers of the functions above. */
+
+#include "llvm/ArrayRef.h"
+#include "llvm/StringRef.h"
+
+namespace llvm {
+
+/**
+ * Convert an Unicode code point to UTF8 sequence.
+ *
+ * \param Source a Unicode code point.
+ * \param [in,out] ResultPtr pointer to the output buffer, needs to be at least
+ * \c UNI_MAX_UTF8_BYTES_PER_CODE_POINT bytes.  On success \c ResultPtr is
+ * updated one past end of the converted sequence.
+ *
+ * \returns true on success.
+ */
+bool ConvertCodePointToUTF8(unsigned Source, char *&ResultPtr);
+
+/**
+ * Convert the first UTF8 sequence in the given source buffer to a UTF32
+ * code point.
+ *
+ * \param [in,out] source A pointer to the source buffer. If the conversion
+ * succeeds, this pointer will be updated to point to the byte just past the
+ * end of the converted sequence.
+ * \param sourceEnd A pointer just past the end of the source buffer.
+ * \param [out] target The converted code
+ * \param flags Whether the conversion is strict or lenient.
+ *
+ * \returns conversionOK on success
+ *
+ * \sa ConvertUTF8toUTF32
+ */
+static inline ConversionResult convertUTF8Sequence(const UTF8 **source,
+                                                   const UTF8 *sourceEnd,
+                                                   UTF32 *target,
+                                                   ConversionFlags flags) {
+  if (*source == sourceEnd)
+    return sourceExhausted;
+  unsigned size = getNumBytesForUTF8(**source);
+  if ((ptrdiff_t)size > sourceEnd - *source)
+    return sourceExhausted;
+  return ConvertUTF8toUTF32(source, *source + size, &target, target + 1, flags);
+}
+
+/**
+ * Returns true if a blob of text starts with a UTF-16 big or little endian byte
+ * order mark.
+ */
+bool hasUTF16ByteOrderMark(ArrayRef<char> SrcBytes);
+
+/**
+ * Converts a UTF-16 string into a UTF-8 string.
+ *
+ * \returns true on success
+ */
+bool convertUTF16ToUTF8String(ArrayRef<UTF16> SrcUTF16,
+                              SmallVectorImpl<char> &DstUTF8);
+
+/**
+ * Converts a UTF-8 string into a UTF-16 string with native endianness.
+ *
+ * \returns true on success
+ */
+bool convertUTF8ToUTF16String(StringRef SrcUTF8,
+                              SmallVectorImpl<UTF16> &DstUTF16);
+
+} /* end namespace llvm */
+
+#endif
+
+/* --------------------------------------------------------------------- */
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/DenseMap.h b/third_party/wpiutil_2018/src/main/native/include/llvm/DenseMap.h
new file mode 100644
index 0000000..6b66d7e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/DenseMap.h
@@ -0,0 +1,1120 @@
+//===- llvm/ADT/DenseMap.h - Dense probed hash table ------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the DenseMap class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_DENSEMAP_H
+#define LLVM_ADT_DENSEMAP_H
+
+#include "llvm/DenseMapInfo.h"
+#include "llvm/EpochTracker.h"
+#include "llvm/AlignOf.h"
+#include "llvm/Compiler.h"
+#include "llvm/MathExtras.h"
+#include "llvm/PointerLikeTypeTraits.h"
+#include "llvm/type_traits.h"
+#include <algorithm>
+#include <cassert>
+#include <climits>
+#include <cstddef>
+#include <cstring>
+#include <iterator>
+#include <new>
+#include <utility>
+
+namespace llvm {
+
+namespace detail {
+// We extend a pair to allow users to override the bucket type with their own
+// implementation without requiring two members.
+template <typename KeyT, typename ValueT>
+struct DenseMapPair : public std::pair<KeyT, ValueT> {
+  KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }
+  const KeyT &getFirst() const { return std::pair<KeyT, ValueT>::first; }
+  ValueT &getSecond() { return std::pair<KeyT, ValueT>::second; }
+  const ValueT &getSecond() const { return std::pair<KeyT, ValueT>::second; }
+};
+}
+
+template <
+    typename KeyT, typename ValueT, typename KeyInfoT = DenseMapInfo<KeyT>,
+    typename Bucket = detail::DenseMapPair<KeyT, ValueT>, bool IsConst = false>
+class DenseMapIterator;
+
+template <typename DerivedT, typename KeyT, typename ValueT, typename KeyInfoT,
+          typename BucketT>
+class DenseMapBase : public DebugEpochBase {
+public:
+  typedef unsigned size_type;
+  typedef KeyT key_type;
+  typedef ValueT mapped_type;
+  typedef BucketT value_type;
+
+  typedef DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT> iterator;
+  typedef DenseMapIterator<KeyT, ValueT, KeyInfoT, BucketT, true>
+      const_iterator;
+  inline iterator begin() {
+    // When the map is empty, avoid the overhead of AdvancePastEmptyBuckets().
+    return empty() ? end() : iterator(getBuckets(), getBucketsEnd(), *this);
+  }
+  inline iterator end() {
+    return iterator(getBucketsEnd(), getBucketsEnd(), *this, true);
+  }
+  inline const_iterator begin() const {
+    return empty() ? end()
+                   : const_iterator(getBuckets(), getBucketsEnd(), *this);
+  }
+  inline const_iterator end() const {
+    return const_iterator(getBucketsEnd(), getBucketsEnd(), *this, true);
+  }
+
+  bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
+    return getNumEntries() == 0;
+  }
+  unsigned size() const { return getNumEntries(); }
+
+  /// Grow the densemap so that it can contain at least \p NumEntries items
+  /// before resizing again.
+  void reserve(size_type NumEntries) {
+    auto NumBuckets = getMinBucketToReserveForEntries(NumEntries);
+    incrementEpoch();
+    if (NumBuckets > getNumBuckets())
+      grow(NumBuckets);
+  }
+
+  void clear() {
+    incrementEpoch();
+    if (getNumEntries() == 0 && getNumTombstones() == 0) return;
+
+    // If the capacity of the array is huge, and the # elements used is small,
+    // shrink the array.
+    if (getNumEntries() * 4 < getNumBuckets() && getNumBuckets() > 64) {
+      shrink_and_clear();
+      return;
+    }
+
+    const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
+    unsigned NumEntries = getNumEntries();
+    for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
+      if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey)) {
+        if (!KeyInfoT::isEqual(P->getFirst(), TombstoneKey)) {
+          P->getSecond().~ValueT();
+          --NumEntries;
+        }
+        P->getFirst() = EmptyKey;
+      }
+    }
+    assert(NumEntries == 0 && "Node count imbalance!");
+    setNumEntries(0);
+    setNumTombstones(0);
+  }
+
+  /// Return 1 if the specified key is in the map, 0 otherwise.
+  size_type count(const KeyT &Val) const {
+    const BucketT *TheBucket;
+    return LookupBucketFor(Val, TheBucket) ? 1 : 0;
+  }
+
+  iterator find(const KeyT &Val) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return iterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+  const_iterator find(const KeyT &Val) const {
+    const BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return const_iterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+
+  /// Alternate version of find() which allows a different, and possibly
+  /// less expensive, key type.
+  /// The DenseMapInfo is responsible for supplying methods
+  /// getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key
+  /// type used.
+  template<class LookupKeyT>
+  iterator find_as(const LookupKeyT &Val) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return iterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+  template<class LookupKeyT>
+  const_iterator find_as(const LookupKeyT &Val) const {
+    const BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return const_iterator(TheBucket, getBucketsEnd(), *this, true);
+    return end();
+  }
+
+  /// lookup - Return the entry for the specified key, or a default
+  /// constructed value if no such entry exists.
+  ValueT lookup(const KeyT &Val) const {
+    const BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return TheBucket->getSecond();
+    return ValueT();
+  }
+
+  // Inserts key,value pair into the map if the key isn't already in the map.
+  // If the key is already in the map, it returns false and doesn't update the
+  // value.
+  std::pair<iterator, bool> insert(const std::pair<KeyT, ValueT> &KV) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(KV.first, TheBucket))
+      return std::make_pair(iterator(TheBucket, getBucketsEnd(), *this, true),
+                            false); // Already in map.
+
+    // Otherwise, insert the new element.
+    TheBucket = InsertIntoBucket(KV.first, KV.second, TheBucket);
+    return std::make_pair(iterator(TheBucket, getBucketsEnd(), *this, true),
+                          true);
+  }
+
+  // Inserts key,value pair into the map if the key isn't already in the map.
+  // If the key is already in the map, it returns false and doesn't update the
+  // value.
+  std::pair<iterator, bool> insert(std::pair<KeyT, ValueT> &&KV) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(KV.first, TheBucket))
+      return std::make_pair(iterator(TheBucket, getBucketsEnd(), *this, true),
+                            false); // Already in map.
+
+    // Otherwise, insert the new element.
+    TheBucket = InsertIntoBucket(std::move(KV.first),
+                                 std::move(KV.second),
+                                 TheBucket);
+    return std::make_pair(iterator(TheBucket, getBucketsEnd(), *this, true),
+                          true);
+  }
+
+  /// Alternate version of insert() which allows a different, and possibly
+  /// less expensive, key type.
+  /// The DenseMapInfo is responsible for supplying methods
+  /// getHashValue(LookupKeyT) and isEqual(LookupKeyT, KeyT) for each key
+  /// type used.
+  template <typename LookupKeyT>
+  std::pair<iterator, bool> insert_as(std::pair<KeyT, ValueT> &&KV,
+                                      const LookupKeyT &Val) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Val, TheBucket))
+      return std::make_pair(iterator(TheBucket, getBucketsEnd(), *this, true),
+                            false); // Already in map.
+
+    // Otherwise, insert the new element.
+    TheBucket = InsertIntoBucket(std::move(KV.first), std::move(KV.second), Val,
+                                 TheBucket);
+    return std::make_pair(iterator(TheBucket, getBucketsEnd(), *this, true),
+                          true);
+  }
+
+  /// insert - Range insertion of pairs.
+  template<typename InputIt>
+  void insert(InputIt I, InputIt E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+
+
+  bool erase(const KeyT &Val) {
+    BucketT *TheBucket;
+    if (!LookupBucketFor(Val, TheBucket))
+      return false; // not in map.
+
+    TheBucket->getSecond().~ValueT();
+    TheBucket->getFirst() = getTombstoneKey();
+    decrementNumEntries();
+    incrementNumTombstones();
+    return true;
+  }
+  void erase(iterator I) {
+    BucketT *TheBucket = &*I;
+    TheBucket->getSecond().~ValueT();
+    TheBucket->getFirst() = getTombstoneKey();
+    decrementNumEntries();
+    incrementNumTombstones();
+  }
+
+  value_type& FindAndConstruct(const KeyT &Key) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Key, TheBucket))
+      return *TheBucket;
+
+    return *InsertIntoBucket(Key, ValueT(), TheBucket);
+  }
+
+  ValueT &operator[](const KeyT &Key) {
+    return FindAndConstruct(Key).second;
+  }
+
+  value_type& FindAndConstruct(KeyT &&Key) {
+    BucketT *TheBucket;
+    if (LookupBucketFor(Key, TheBucket))
+      return *TheBucket;
+
+    return *InsertIntoBucket(std::move(Key), ValueT(), TheBucket);
+  }
+
+  ValueT &operator[](KeyT &&Key) {
+    return FindAndConstruct(std::move(Key)).second;
+  }
+
+  /// isPointerIntoBucketsArray - Return true if the specified pointer points
+  /// somewhere into the DenseMap's array of buckets (i.e. either to a key or
+  /// value in the DenseMap).
+  bool isPointerIntoBucketsArray(const void *Ptr) const {
+    return Ptr >= getBuckets() && Ptr < getBucketsEnd();
+  }
+
+  /// getPointerIntoBucketsArray() - Return an opaque pointer into the buckets
+  /// array.  In conjunction with the previous method, this can be used to
+  /// determine whether an insertion caused the DenseMap to reallocate.
+  const void *getPointerIntoBucketsArray() const { return getBuckets(); }
+
+protected:
+  DenseMapBase() = default;
+
+  void destroyAll() {
+    if (getNumBuckets() == 0) // Nothing to do.
+      return;
+
+    const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
+    for (BucketT *P = getBuckets(), *E = getBucketsEnd(); P != E; ++P) {
+      if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey) &&
+          !KeyInfoT::isEqual(P->getFirst(), TombstoneKey))
+        P->getSecond().~ValueT();
+      P->getFirst().~KeyT();
+    }
+  }
+
+  void initEmpty() {
+    setNumEntries(0);
+    setNumTombstones(0);
+
+    assert((getNumBuckets() & (getNumBuckets()-1)) == 0 &&
+           "# initial buckets must be a power of two!");
+    const KeyT EmptyKey = getEmptyKey();
+    for (BucketT *B = getBuckets(), *E = getBucketsEnd(); B != E; ++B)
+      ::new (&B->getFirst()) KeyT(EmptyKey);
+  }
+
+  /// Returns the number of buckets to allocate to ensure that the DenseMap can
+  /// accommodate \p NumEntries without need to grow().
+  unsigned getMinBucketToReserveForEntries(unsigned NumEntries) {
+    // Ensure that "NumEntries * 4 < NumBuckets * 3"
+    if (NumEntries == 0)
+      return 0;
+    // +1 is required because of the strict equality.
+    // For example if NumEntries is 48, we need to return 401.
+    return NextPowerOf2(NumEntries * 4 / 3 + 1);
+  }
+
+  void moveFromOldBuckets(BucketT *OldBucketsBegin, BucketT *OldBucketsEnd) {
+    initEmpty();
+
+    // Insert all the old elements.
+    const KeyT EmptyKey = getEmptyKey();
+    const KeyT TombstoneKey = getTombstoneKey();
+    for (BucketT *B = OldBucketsBegin, *E = OldBucketsEnd; B != E; ++B) {
+      if (!KeyInfoT::isEqual(B->getFirst(), EmptyKey) &&
+          !KeyInfoT::isEqual(B->getFirst(), TombstoneKey)) {
+        // Insert the key/value into the new table.
+        BucketT *DestBucket;
+        bool FoundVal = LookupBucketFor(B->getFirst(), DestBucket);
+        (void)FoundVal; // silence warning.
+        assert(!FoundVal && "Key already in new map?");
+        DestBucket->getFirst() = std::move(B->getFirst());
+        ::new (&DestBucket->getSecond()) ValueT(std::move(B->getSecond()));
+        incrementNumEntries();
+
+        // Free the value.
+        B->getSecond().~ValueT();
+      }
+      B->getFirst().~KeyT();
+    }
+  }
+
+  template <typename OtherBaseT>
+  void copyFrom(
+      const DenseMapBase<OtherBaseT, KeyT, ValueT, KeyInfoT, BucketT> &other) {
+    assert(&other != this);
+    assert(getNumBuckets() == other.getNumBuckets());
+
+    setNumEntries(other.getNumEntries());
+    setNumTombstones(other.getNumTombstones());
+
+    if (isPodLike<KeyT>::value && isPodLike<ValueT>::value)
+      memcpy(getBuckets(), other.getBuckets(),
+             getNumBuckets() * sizeof(BucketT));
+    else
+      for (size_t i = 0; i < getNumBuckets(); ++i) {
+        ::new (&getBuckets()[i].getFirst())
+            KeyT(other.getBuckets()[i].getFirst());
+        if (!KeyInfoT::isEqual(getBuckets()[i].getFirst(), getEmptyKey()) &&
+            !KeyInfoT::isEqual(getBuckets()[i].getFirst(), getTombstoneKey()))
+          ::new (&getBuckets()[i].getSecond())
+              ValueT(other.getBuckets()[i].getSecond());
+      }
+  }
+
+  static unsigned getHashValue(const KeyT &Val) {
+    return KeyInfoT::getHashValue(Val);
+  }
+  template<typename LookupKeyT>
+  static unsigned getHashValue(const LookupKeyT &Val) {
+    return KeyInfoT::getHashValue(Val);
+  }
+  static const KeyT getEmptyKey() {
+    return KeyInfoT::getEmptyKey();
+  }
+  static const KeyT getTombstoneKey() {
+    return KeyInfoT::getTombstoneKey();
+  }
+
+private:
+  unsigned getNumEntries() const {
+    return static_cast<const DerivedT *>(this)->getNumEntries();
+  }
+  void setNumEntries(unsigned Num) {
+    static_cast<DerivedT *>(this)->setNumEntries(Num);
+  }
+  void incrementNumEntries() {
+    setNumEntries(getNumEntries() + 1);
+  }
+  void decrementNumEntries() {
+    setNumEntries(getNumEntries() - 1);
+  }
+  unsigned getNumTombstones() const {
+    return static_cast<const DerivedT *>(this)->getNumTombstones();
+  }
+  void setNumTombstones(unsigned Num) {
+    static_cast<DerivedT *>(this)->setNumTombstones(Num);
+  }
+  void incrementNumTombstones() {
+    setNumTombstones(getNumTombstones() + 1);
+  }
+  void decrementNumTombstones() {
+    setNumTombstones(getNumTombstones() - 1);
+  }
+  const BucketT *getBuckets() const {
+    return static_cast<const DerivedT *>(this)->getBuckets();
+  }
+  BucketT *getBuckets() {
+    return static_cast<DerivedT *>(this)->getBuckets();
+  }
+  unsigned getNumBuckets() const {
+    return static_cast<const DerivedT *>(this)->getNumBuckets();
+  }
+  BucketT *getBucketsEnd() {
+    return getBuckets() + getNumBuckets();
+  }
+  const BucketT *getBucketsEnd() const {
+    return getBuckets() + getNumBuckets();
+  }
+
+  void grow(unsigned AtLeast) {
+    static_cast<DerivedT *>(this)->grow(AtLeast);
+  }
+
+  void shrink_and_clear() {
+    static_cast<DerivedT *>(this)->shrink_and_clear();
+  }
+
+
+  BucketT *InsertIntoBucket(const KeyT &Key, const ValueT &Value,
+                            BucketT *TheBucket) {
+    TheBucket = InsertIntoBucketImpl(Key, Key, TheBucket);
+
+    TheBucket->getFirst() = Key;
+    ::new (&TheBucket->getSecond()) ValueT(Value);
+    return TheBucket;
+  }
+
+  BucketT *InsertIntoBucket(const KeyT &Key, ValueT &&Value,
+                            BucketT *TheBucket) {
+    TheBucket = InsertIntoBucketImpl(Key, Key, TheBucket);
+
+    TheBucket->getFirst() = Key;
+    ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
+    return TheBucket;
+  }
+
+  BucketT *InsertIntoBucket(KeyT &&Key, ValueT &&Value, BucketT *TheBucket) {
+    TheBucket = InsertIntoBucketImpl(Key, Key, TheBucket);
+
+    TheBucket->getFirst() = std::move(Key);
+    ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
+    return TheBucket;
+  }
+
+  template <typename LookupKeyT>
+  BucketT *InsertIntoBucket(KeyT &&Key, ValueT &&Value, LookupKeyT &Lookup,
+                            BucketT *TheBucket) {
+    TheBucket = InsertIntoBucketImpl(Key, Lookup, TheBucket);
+
+    TheBucket->getFirst() = std::move(Key);
+    ::new (&TheBucket->getSecond()) ValueT(std::move(Value));
+    return TheBucket;
+  }
+
+  template <typename LookupKeyT>
+  BucketT *InsertIntoBucketImpl(const KeyT &Key, const LookupKeyT &Lookup,
+                                BucketT *TheBucket) {
+    incrementEpoch();
+
+    // If the load of the hash table is more than 3/4, or if fewer than 1/8 of
+    // the buckets are empty (meaning that many are filled with tombstones),
+    // grow the table.
+    //
+    // The later case is tricky.  For example, if we had one empty bucket with
+    // tons of tombstones, failing lookups (e.g. for insertion) would have to
+    // probe almost the entire table until it found the empty bucket.  If the
+    // table completely filled with tombstones, no lookup would ever succeed,
+    // causing infinite loops in lookup.
+    unsigned NewNumEntries = getNumEntries() + 1;
+    unsigned NumBuckets = getNumBuckets();
+    if (LLVM_UNLIKELY(NewNumEntries * 4 >= NumBuckets * 3)) {
+      this->grow(NumBuckets * 2);
+      LookupBucketFor(Lookup, TheBucket);
+      NumBuckets = getNumBuckets();
+    } else if (LLVM_UNLIKELY(NumBuckets-(NewNumEntries+getNumTombstones()) <=
+                             NumBuckets/8)) {
+      this->grow(NumBuckets);
+      LookupBucketFor(Lookup, TheBucket);
+    }
+    assert(TheBucket);
+
+    // Only update the state after we've grown our bucket space appropriately
+    // so that when growing buckets we have self-consistent entry count.
+    incrementNumEntries();
+
+    // If we are writing over a tombstone, remember this.
+    const KeyT EmptyKey = getEmptyKey();
+    if (!KeyInfoT::isEqual(TheBucket->getFirst(), EmptyKey))
+      decrementNumTombstones();
+
+    return TheBucket;
+  }
+
+  /// LookupBucketFor - Lookup the appropriate bucket for Val, returning it in
+  /// FoundBucket.  If the bucket contains the key and a value, this returns
+  /// true, otherwise it returns a bucket with an empty marker or tombstone and
+  /// returns false.
+  template<typename LookupKeyT>
+  bool LookupBucketFor(const LookupKeyT &Val,
+                       const BucketT *&FoundBucket) const {
+    const BucketT *BucketsPtr = getBuckets();
+    const unsigned NumBuckets = getNumBuckets();
+
+    if (NumBuckets == 0) {
+      FoundBucket = nullptr;
+      return false;
+    }
+
+    // FoundTombstone - Keep track of whether we find a tombstone while probing.
+    const BucketT *FoundTombstone = nullptr;
+    const KeyT EmptyKey = getEmptyKey();
+    const KeyT TombstoneKey = getTombstoneKey();
+    assert(!KeyInfoT::isEqual(Val, EmptyKey) &&
+           !KeyInfoT::isEqual(Val, TombstoneKey) &&
+           "Empty/Tombstone value shouldn't be inserted into map!");
+
+    unsigned BucketNo = getHashValue(Val) & (NumBuckets-1);
+    unsigned ProbeAmt = 1;
+    while (1) {
+      const BucketT *ThisBucket = BucketsPtr + BucketNo;
+      // Found Val's bucket?  If so, return it.
+      if (LLVM_LIKELY(KeyInfoT::isEqual(Val, ThisBucket->getFirst()))) {
+        FoundBucket = ThisBucket;
+        return true;
+      }
+
+      // If we found an empty bucket, the key doesn't exist in the set.
+      // Insert it and return the default value.
+      if (LLVM_LIKELY(KeyInfoT::isEqual(ThisBucket->getFirst(), EmptyKey))) {
+        // If we've already seen a tombstone while probing, fill it in instead
+        // of the empty bucket we eventually probed to.
+        FoundBucket = FoundTombstone ? FoundTombstone : ThisBucket;
+        return false;
+      }
+
+      // If this is a tombstone, remember it.  If Val ends up not in the map, we
+      // prefer to return it than something that would require more probing.
+      if (KeyInfoT::isEqual(ThisBucket->getFirst(), TombstoneKey) &&
+          !FoundTombstone)
+        FoundTombstone = ThisBucket;  // Remember the first tombstone found.
+
+      // Otherwise, it's a hash collision or a tombstone, continue quadratic
+      // probing.
+      BucketNo += ProbeAmt++;
+      BucketNo &= (NumBuckets-1);
+    }
+  }
+
+  template <typename LookupKeyT>
+  bool LookupBucketFor(const LookupKeyT &Val, BucketT *&FoundBucket) {
+    const BucketT *ConstFoundBucket;
+    bool Result = const_cast<const DenseMapBase *>(this)
+      ->LookupBucketFor(Val, ConstFoundBucket);
+    FoundBucket = const_cast<BucketT *>(ConstFoundBucket);
+    return Result;
+  }
+
+public:
+  /// Return the approximate size (in bytes) of the actual map.
+  /// This is just the raw memory used by DenseMap.
+  /// If entries are pointers to objects, the size of the referenced objects
+  /// are not included.
+  size_t getMemorySize() const {
+    return getNumBuckets() * sizeof(BucketT);
+  }
+};
+
+template <typename KeyT, typename ValueT,
+          typename KeyInfoT = DenseMapInfo<KeyT>,
+          typename BucketT = detail::DenseMapPair<KeyT, ValueT>>
+class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
+                                     KeyT, ValueT, KeyInfoT, BucketT> {
+  // Lift some types from the dependent base class into this class for
+  // simplicity of referring to them.
+  typedef DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT> BaseT;
+  friend class DenseMapBase<DenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+
+  BucketT *Buckets;
+  unsigned NumEntries;
+  unsigned NumTombstones;
+  unsigned NumBuckets;
+
+public:
+  /// Create a DenseMap wth an optional \p InitialReserve that guarantee that
+  /// this number of elements can be inserted in the map without grow()
+  explicit DenseMap(unsigned InitialReserve = 0) { init(InitialReserve); }
+
+  DenseMap(const DenseMap &other) : BaseT() {
+    init(0);
+    copyFrom(other);
+  }
+
+  DenseMap(DenseMap &&other) : BaseT() {
+    init(0);
+    swap(other);
+  }
+
+  template<typename InputIt>
+  DenseMap(const InputIt &I, const InputIt &E) {
+    init(std::distance(I, E));
+    this->insert(I, E);
+  }
+
+  ~DenseMap() {
+    this->destroyAll();
+    operator delete(Buckets);
+  }
+
+  void swap(DenseMap& RHS) {
+    this->incrementEpoch();
+    RHS.incrementEpoch();
+    std::swap(Buckets, RHS.Buckets);
+    std::swap(NumEntries, RHS.NumEntries);
+    std::swap(NumTombstones, RHS.NumTombstones);
+    std::swap(NumBuckets, RHS.NumBuckets);
+  }
+
+  DenseMap& operator=(const DenseMap& other) {
+    if (&other != this)
+      copyFrom(other);
+    return *this;
+  }
+
+  DenseMap& operator=(DenseMap &&other) {
+    this->destroyAll();
+    operator delete(Buckets);
+    init(0);
+    swap(other);
+    return *this;
+  }
+
+  void copyFrom(const DenseMap& other) {
+    this->destroyAll();
+    operator delete(Buckets);
+    if (allocateBuckets(other.NumBuckets)) {
+      this->BaseT::copyFrom(other);
+    } else {
+      NumEntries = 0;
+      NumTombstones = 0;
+    }
+  }
+
+  void init(unsigned InitNumEntries) {
+    auto InitBuckets = BaseT::getMinBucketToReserveForEntries(InitNumEntries);
+    if (allocateBuckets(InitBuckets)) {
+      this->BaseT::initEmpty();
+    } else {
+      NumEntries = 0;
+      NumTombstones = 0;
+    }
+  }
+
+  void grow(unsigned AtLeast) {
+    unsigned OldNumBuckets = NumBuckets;
+    BucketT *OldBuckets = Buckets;
+
+    allocateBuckets(std::max<unsigned>(64, static_cast<unsigned>(NextPowerOf2(AtLeast-1))));
+    assert(Buckets);
+    if (!OldBuckets) {
+      this->BaseT::initEmpty();
+      return;
+    }
+
+    this->moveFromOldBuckets(OldBuckets, OldBuckets+OldNumBuckets);
+
+    // Free the old table.
+    operator delete(OldBuckets);
+  }
+
+  void shrink_and_clear() {
+    unsigned OldNumEntries = NumEntries;
+    this->destroyAll();
+
+    // Reduce the number of buckets.
+    unsigned NewNumBuckets = 0;
+    if (OldNumEntries)
+      NewNumBuckets = std::max(64, 1 << (Log2_32_Ceil(OldNumEntries) + 1));
+    if (NewNumBuckets == NumBuckets) {
+      this->BaseT::initEmpty();
+      return;
+    }
+
+    operator delete(Buckets);
+    init(NewNumBuckets);
+  }
+
+private:
+  unsigned getNumEntries() const {
+    return NumEntries;
+  }
+  void setNumEntries(unsigned Num) {
+    NumEntries = Num;
+  }
+
+  unsigned getNumTombstones() const {
+    return NumTombstones;
+  }
+  void setNumTombstones(unsigned Num) {
+    NumTombstones = Num;
+  }
+
+  BucketT *getBuckets() const {
+    return Buckets;
+  }
+
+  unsigned getNumBuckets() const {
+    return NumBuckets;
+  }
+
+  bool allocateBuckets(unsigned Num) {
+    NumBuckets = Num;
+    if (NumBuckets == 0) {
+      Buckets = nullptr;
+      return false;
+    }
+
+    Buckets = static_cast<BucketT*>(operator new(sizeof(BucketT) * NumBuckets));
+    return true;
+  }
+};
+
+template <typename KeyT, typename ValueT, unsigned InlineBuckets = 4,
+          typename KeyInfoT = DenseMapInfo<KeyT>,
+          typename BucketT = detail::DenseMapPair<KeyT, ValueT>>
+class SmallDenseMap
+    : public DenseMapBase<
+          SmallDenseMap<KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT>, KeyT,
+          ValueT, KeyInfoT, BucketT> {
+  // Lift some types from the dependent base class into this class for
+  // simplicity of referring to them.
+  typedef DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT> BaseT;
+  friend class DenseMapBase<SmallDenseMap, KeyT, ValueT, KeyInfoT, BucketT>;
+
+  unsigned Small : 1;
+  unsigned NumEntries : 31;
+  unsigned NumTombstones;
+
+  struct LargeRep {
+    BucketT *Buckets;
+    unsigned NumBuckets;
+  };
+
+  /// A "union" of an inline bucket array and the struct representing
+  /// a large bucket. This union will be discriminated by the 'Small' bit.
+  AlignedCharArrayUnion<BucketT[InlineBuckets], LargeRep> storage;
+
+public:
+  explicit SmallDenseMap(unsigned NumInitBuckets = 0) {
+    init(NumInitBuckets);
+  }
+
+  SmallDenseMap(const SmallDenseMap &other) : BaseT() {
+    init(0);
+    copyFrom(other);
+  }
+
+  SmallDenseMap(SmallDenseMap &&other) : BaseT() {
+    init(0);
+    swap(other);
+  }
+
+  template<typename InputIt>
+  SmallDenseMap(const InputIt &I, const InputIt &E) {
+    init(NextPowerOf2(std::distance(I, E)));
+    this->insert(I, E);
+  }
+
+  ~SmallDenseMap() {
+    this->destroyAll();
+    deallocateBuckets();
+  }
+
+  void swap(SmallDenseMap& RHS) {
+    unsigned TmpNumEntries = RHS.NumEntries;
+    RHS.NumEntries = NumEntries;
+    NumEntries = TmpNumEntries;
+    std::swap(NumTombstones, RHS.NumTombstones);
+
+    const KeyT EmptyKey = this->getEmptyKey();
+    const KeyT TombstoneKey = this->getTombstoneKey();
+    if (Small && RHS.Small) {
+      // If we're swapping inline bucket arrays, we have to cope with some of
+      // the tricky bits of DenseMap's storage system: the buckets are not
+      // fully initialized. Thus we swap every key, but we may have
+      // a one-directional move of the value.
+      for (unsigned i = 0, e = InlineBuckets; i != e; ++i) {
+        BucketT *LHSB = &getInlineBuckets()[i],
+                *RHSB = &RHS.getInlineBuckets()[i];
+        bool hasLHSValue = (!KeyInfoT::isEqual(LHSB->getFirst(), EmptyKey) &&
+                            !KeyInfoT::isEqual(LHSB->getFirst(), TombstoneKey));
+        bool hasRHSValue = (!KeyInfoT::isEqual(RHSB->getFirst(), EmptyKey) &&
+                            !KeyInfoT::isEqual(RHSB->getFirst(), TombstoneKey));
+        if (hasLHSValue && hasRHSValue) {
+          // Swap together if we can...
+          std::swap(*LHSB, *RHSB);
+          continue;
+        }
+        // Swap separately and handle any assymetry.
+        std::swap(LHSB->getFirst(), RHSB->getFirst());
+        if (hasLHSValue) {
+          ::new (&RHSB->getSecond()) ValueT(std::move(LHSB->getSecond()));
+          LHSB->getSecond().~ValueT();
+        } else if (hasRHSValue) {
+          ::new (&LHSB->getSecond()) ValueT(std::move(RHSB->getSecond()));
+          RHSB->getSecond().~ValueT();
+        }
+      }
+      return;
+    }
+    if (!Small && !RHS.Small) {
+      std::swap(getLargeRep()->Buckets, RHS.getLargeRep()->Buckets);
+      std::swap(getLargeRep()->NumBuckets, RHS.getLargeRep()->NumBuckets);
+      return;
+    }
+
+    SmallDenseMap &SmallSide = Small ? *this : RHS;
+    SmallDenseMap &LargeSide = Small ? RHS : *this;
+
+    // First stash the large side's rep and move the small side across.
+    LargeRep TmpRep = std::move(*LargeSide.getLargeRep());
+    LargeSide.getLargeRep()->~LargeRep();
+    LargeSide.Small = true;
+    // This is similar to the standard move-from-old-buckets, but the bucket
+    // count hasn't actually rotated in this case. So we have to carefully
+    // move construct the keys and values into their new locations, but there
+    // is no need to re-hash things.
+    for (unsigned i = 0, e = InlineBuckets; i != e; ++i) {
+      BucketT *NewB = &LargeSide.getInlineBuckets()[i],
+              *OldB = &SmallSide.getInlineBuckets()[i];
+      ::new (&NewB->getFirst()) KeyT(std::move(OldB->getFirst()));
+      OldB->getFirst().~KeyT();
+      if (!KeyInfoT::isEqual(NewB->getFirst(), EmptyKey) &&
+          !KeyInfoT::isEqual(NewB->getFirst(), TombstoneKey)) {
+        ::new (&NewB->getSecond()) ValueT(std::move(OldB->getSecond()));
+        OldB->getSecond().~ValueT();
+      }
+    }
+
+    // The hard part of moving the small buckets across is done, just move
+    // the TmpRep into its new home.
+    SmallSide.Small = false;
+    new (SmallSide.getLargeRep()) LargeRep(std::move(TmpRep));
+  }
+
+  SmallDenseMap& operator=(const SmallDenseMap& other) {
+    if (&other != this)
+      copyFrom(other);
+    return *this;
+  }
+
+  SmallDenseMap& operator=(SmallDenseMap &&other) {
+    this->destroyAll();
+    deallocateBuckets();
+    init(0);
+    swap(other);
+    return *this;
+  }
+
+  void copyFrom(const SmallDenseMap& other) {
+    this->destroyAll();
+    deallocateBuckets();
+    Small = true;
+    if (other.getNumBuckets() > InlineBuckets) {
+      Small = false;
+      new (getLargeRep()) LargeRep(allocateBuckets(other.getNumBuckets()));
+    }
+    this->BaseT::copyFrom(other);
+  }
+
+  void init(unsigned InitBuckets) {
+    Small = true;
+    if (InitBuckets > InlineBuckets) {
+      Small = false;
+      new (getLargeRep()) LargeRep(allocateBuckets(InitBuckets));
+    }
+    this->BaseT::initEmpty();
+  }
+
+  void grow(unsigned AtLeast) {
+    if (AtLeast >= InlineBuckets)
+      AtLeast = std::max<unsigned>(64, NextPowerOf2(AtLeast-1));
+
+    if (Small) {
+      if (AtLeast < InlineBuckets)
+        return; // Nothing to do.
+
+      // First move the inline buckets into a temporary storage.
+      AlignedCharArrayUnion<BucketT[InlineBuckets]> TmpStorage;
+      BucketT *TmpBegin = reinterpret_cast<BucketT *>(TmpStorage.buffer);
+      BucketT *TmpEnd = TmpBegin;
+
+      // Loop over the buckets, moving non-empty, non-tombstones into the
+      // temporary storage. Have the loop move the TmpEnd forward as it goes.
+      const KeyT EmptyKey = this->getEmptyKey();
+      const KeyT TombstoneKey = this->getTombstoneKey();
+      for (BucketT *P = getBuckets(), *E = P + InlineBuckets; P != E; ++P) {
+        if (!KeyInfoT::isEqual(P->getFirst(), EmptyKey) &&
+            !KeyInfoT::isEqual(P->getFirst(), TombstoneKey)) {
+          assert(size_t(TmpEnd - TmpBegin) < InlineBuckets &&
+                 "Too many inline buckets!");
+          ::new (&TmpEnd->getFirst()) KeyT(std::move(P->getFirst()));
+          ::new (&TmpEnd->getSecond()) ValueT(std::move(P->getSecond()));
+          ++TmpEnd;
+          P->getSecond().~ValueT();
+        }
+        P->getFirst().~KeyT();
+      }
+
+      // Now make this map use the large rep, and move all the entries back
+      // into it.
+      Small = false;
+      new (getLargeRep()) LargeRep(allocateBuckets(AtLeast));
+      this->moveFromOldBuckets(TmpBegin, TmpEnd);
+      return;
+    }
+
+    LargeRep OldRep = std::move(*getLargeRep());
+    getLargeRep()->~LargeRep();
+    if (AtLeast <= InlineBuckets) {
+      Small = true;
+    } else {
+      new (getLargeRep()) LargeRep(allocateBuckets(AtLeast));
+    }
+
+    this->moveFromOldBuckets(OldRep.Buckets, OldRep.Buckets+OldRep.NumBuckets);
+
+    // Free the old table.
+    operator delete(OldRep.Buckets);
+  }
+
+  void shrink_and_clear() {
+    unsigned OldSize = this->size();
+    this->destroyAll();
+
+    // Reduce the number of buckets.
+    unsigned NewNumBuckets = 0;
+    if (OldSize) {
+      NewNumBuckets = 1 << (Log2_32_Ceil(OldSize) + 1);
+      if (NewNumBuckets > InlineBuckets && NewNumBuckets < 64u)
+        NewNumBuckets = 64;
+    }
+    if ((Small && NewNumBuckets <= InlineBuckets) ||
+        (!Small && NewNumBuckets == getLargeRep()->NumBuckets)) {
+      this->BaseT::initEmpty();
+      return;
+    }
+
+    deallocateBuckets();
+    init(NewNumBuckets);
+  }
+
+private:
+  unsigned getNumEntries() const {
+    return NumEntries;
+  }
+  void setNumEntries(unsigned Num) {
+    assert(Num < INT_MAX && "Cannot support more than INT_MAX entries");
+    NumEntries = Num;
+  }
+
+  unsigned getNumTombstones() const {
+    return NumTombstones;
+  }
+  void setNumTombstones(unsigned Num) {
+    NumTombstones = Num;
+  }
+
+  const BucketT *getInlineBuckets() const {
+    assert(Small);
+    // Note that this cast does not violate aliasing rules as we assert that
+    // the memory's dynamic type is the small, inline bucket buffer, and the
+    // 'storage.buffer' static type is 'char *'.
+    return reinterpret_cast<const BucketT *>(storage.buffer);
+  }
+  BucketT *getInlineBuckets() {
+    return const_cast<BucketT *>(
+      const_cast<const SmallDenseMap *>(this)->getInlineBuckets());
+  }
+  const LargeRep *getLargeRep() const {
+    assert(!Small);
+    // Note, same rule about aliasing as with getInlineBuckets.
+    return reinterpret_cast<const LargeRep *>(storage.buffer);
+  }
+  LargeRep *getLargeRep() {
+    return const_cast<LargeRep *>(
+      const_cast<const SmallDenseMap *>(this)->getLargeRep());
+  }
+
+  const BucketT *getBuckets() const {
+    return Small ? getInlineBuckets() : getLargeRep()->Buckets;
+  }
+  BucketT *getBuckets() {
+    return const_cast<BucketT *>(
+      const_cast<const SmallDenseMap *>(this)->getBuckets());
+  }
+  unsigned getNumBuckets() const {
+    return Small ? InlineBuckets : getLargeRep()->NumBuckets;
+  }
+
+  void deallocateBuckets() {
+    if (Small)
+      return;
+
+    operator delete(getLargeRep()->Buckets);
+    getLargeRep()->~LargeRep();
+  }
+
+  LargeRep allocateBuckets(unsigned Num) {
+    assert(Num > InlineBuckets && "Must allocate more buckets than are inline");
+    LargeRep Rep = {
+      static_cast<BucketT*>(operator new(sizeof(BucketT) * Num)), Num
+    };
+    return Rep;
+  }
+};
+
+template <typename KeyT, typename ValueT, typename KeyInfoT, typename Bucket,
+          bool IsConst>
+class DenseMapIterator : DebugEpochBase::HandleBase {
+  typedef DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, true> ConstIterator;
+  friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, true>;
+  friend class DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, false>;
+
+public:
+  typedef ptrdiff_t difference_type;
+  typedef typename std::conditional<IsConst, const Bucket, Bucket>::type
+  value_type;
+  typedef value_type *pointer;
+  typedef value_type &reference;
+  typedef std::forward_iterator_tag iterator_category;
+private:
+  pointer Ptr, End;
+public:
+  DenseMapIterator() : Ptr(nullptr), End(nullptr) {}
+
+  DenseMapIterator(pointer Pos, pointer E, const DebugEpochBase &Epoch,
+                   bool NoAdvance = false)
+      : DebugEpochBase::HandleBase(&Epoch), Ptr(Pos), End(E) {
+    assert(isHandleInSync() && "invalid construction!");
+    if (!NoAdvance) AdvancePastEmptyBuckets();
+  }
+
+  // Converting ctor from non-const iterators to const iterators. SFINAE'd out
+  // for const iterator destinations so it doesn't end up as a user defined copy
+  // constructor.
+  template <bool IsConstSrc,
+            typename = typename std::enable_if<!IsConstSrc && IsConst>::type>
+  DenseMapIterator(
+      const DenseMapIterator<KeyT, ValueT, KeyInfoT, Bucket, IsConstSrc> &I)
+      : DebugEpochBase::HandleBase(I), Ptr(I.Ptr), End(I.End) {}
+
+  reference operator*() const {
+    assert(isHandleInSync() && "invalid iterator access!");
+    return *Ptr;
+  }
+  pointer operator->() const {
+    assert(isHandleInSync() && "invalid iterator access!");
+    return Ptr;
+  }
+
+  bool operator==(const ConstIterator &RHS) const {
+    assert((!Ptr || isHandleInSync()) && "handle not in sync!");
+    assert((!RHS.Ptr || RHS.isHandleInSync()) && "handle not in sync!");
+    assert(getEpochAddress() == RHS.getEpochAddress() &&
+           "comparing incomparable iterators!");
+    return Ptr == RHS.Ptr;
+  }
+  bool operator!=(const ConstIterator &RHS) const {
+    assert((!Ptr || isHandleInSync()) && "handle not in sync!");
+    assert((!RHS.Ptr || RHS.isHandleInSync()) && "handle not in sync!");
+    assert(getEpochAddress() == RHS.getEpochAddress() &&
+           "comparing incomparable iterators!");
+    return Ptr != RHS.Ptr;
+  }
+
+  inline DenseMapIterator& operator++() {  // Preincrement
+    assert(isHandleInSync() && "invalid iterator access!");
+    ++Ptr;
+    AdvancePastEmptyBuckets();
+    return *this;
+  }
+  DenseMapIterator operator++(int) {  // Postincrement
+    assert(isHandleInSync() && "invalid iterator access!");
+    DenseMapIterator tmp = *this; ++*this; return tmp;
+  }
+
+private:
+  void AdvancePastEmptyBuckets() {
+    const KeyT Empty = KeyInfoT::getEmptyKey();
+    const KeyT Tombstone = KeyInfoT::getTombstoneKey();
+
+    while (Ptr != End && (KeyInfoT::isEqual(Ptr->getFirst(), Empty) ||
+                          KeyInfoT::isEqual(Ptr->getFirst(), Tombstone)))
+      ++Ptr;
+  }
+};
+
+template<typename KeyT, typename ValueT, typename KeyInfoT>
+static inline size_t
+capacity_in_bytes(const DenseMap<KeyT, ValueT, KeyInfoT> &X) {
+  return X.getMemorySize();
+}
+
+} // end namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/DenseMapInfo.h b/third_party/wpiutil_2018/src/main/native/include/llvm/DenseMapInfo.h
new file mode 100644
index 0000000..65e38cc
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/DenseMapInfo.h
@@ -0,0 +1,251 @@
+//===- llvm/ADT/DenseMapInfo.h - Type traits for DenseMap -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines DenseMapInfo traits for DenseMap.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_DENSEMAPINFO_H
+#define LLVM_ADT_DENSEMAPINFO_H
+
+#include "llvm/ArrayRef.h"
+#include "llvm/Hashing.h"
+#include "llvm/StringRef.h"
+#include "llvm/PointerLikeTypeTraits.h"
+#include "llvm/type_traits.h"
+
+namespace llvm {
+
+template<typename T>
+struct DenseMapInfo {
+  //static inline T getEmptyKey();
+  //static inline T getTombstoneKey();
+  //static unsigned getHashValue(const T &Val);
+  //static bool isEqual(const T &LHS, const T &RHS);
+};
+
+template <typename T> struct CachedHash {
+  CachedHash(T Val) : Val(std::move(Val)) {
+    Hash = DenseMapInfo<T>::getHashValue(Val);
+  }
+  CachedHash(T Val, unsigned Hash) : Val(std::move(Val)), Hash(Hash) {}
+  T Val;
+  unsigned Hash;
+};
+
+// Provide DenseMapInfo for all CachedHash<T>.
+template <typename T> struct DenseMapInfo<CachedHash<T>> {
+  static CachedHash<T> getEmptyKey() {
+    T N = DenseMapInfo<T>::getEmptyKey();
+    return {N, 0};
+  }
+  static CachedHash<T> getTombstoneKey() {
+    T N = DenseMapInfo<T>::getTombstoneKey();
+    return {N, 0};
+  }
+  static unsigned getHashValue(CachedHash<T> Val) {
+    assert(!isEqual(Val, getEmptyKey()) && "Cannot hash the empty key!");
+    assert(!isEqual(Val, getTombstoneKey()) &&
+           "Cannot hash the tombstone key!");
+    return Val.Hash;
+  }
+  static bool isEqual(CachedHash<T> A, CachedHash<T> B) {
+    return DenseMapInfo<T>::isEqual(A.Val, B.Val);
+  }
+};
+
+// Provide DenseMapInfo for all pointers.
+template<typename T>
+struct DenseMapInfo<T*> {
+  static inline T* getEmptyKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
+    return reinterpret_cast<T*>(Val);
+  }
+  static inline T* getTombstoneKey() {
+    uintptr_t Val = static_cast<uintptr_t>(-2);
+    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
+    return reinterpret_cast<T*>(Val);
+  }
+  static unsigned getHashValue(const T *PtrVal) {
+    return (unsigned((uintptr_t)PtrVal) >> 4) ^
+           (unsigned((uintptr_t)PtrVal) >> 9);
+  }
+  static bool isEqual(const T *LHS, const T *RHS) { return LHS == RHS; }
+};
+
+// Provide DenseMapInfo for chars.
+template<> struct DenseMapInfo<char> {
+  static inline char getEmptyKey() { return ~0; }
+  static inline char getTombstoneKey() { return ~0 - 1; }
+  static unsigned getHashValue(const char& Val) { return Val * 37U; }
+  static bool isEqual(const char &LHS, const char &RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for unsigned ints.
+template<> struct DenseMapInfo<unsigned> {
+  static inline unsigned getEmptyKey() { return ~0U; }
+  static inline unsigned getTombstoneKey() { return ~0U - 1; }
+  static unsigned getHashValue(const unsigned& Val) { return Val * 37U; }
+  static bool isEqual(const unsigned& LHS, const unsigned& RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for unsigned longs.
+template<> struct DenseMapInfo<unsigned long> {
+  static inline unsigned long getEmptyKey() { return ~0UL; }
+  static inline unsigned long getTombstoneKey() { return ~0UL - 1L; }
+  static unsigned getHashValue(const unsigned long& Val) {
+    return (unsigned)(Val * 37UL);
+  }
+  static bool isEqual(const unsigned long& LHS, const unsigned long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for unsigned long longs.
+template<> struct DenseMapInfo<unsigned long long> {
+  static inline unsigned long long getEmptyKey() { return ~0ULL; }
+  static inline unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; }
+  static unsigned getHashValue(const unsigned long long& Val) {
+    return (unsigned)(Val * 37ULL);
+  }
+  static bool isEqual(const unsigned long long& LHS,
+                      const unsigned long long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for ints.
+template<> struct DenseMapInfo<int> {
+  static inline int getEmptyKey() { return 0x7fffffff; }
+  static inline int getTombstoneKey() { return -0x7fffffff - 1; }
+  static unsigned getHashValue(const int& Val) { return (unsigned)(Val * 37U); }
+  static bool isEqual(const int& LHS, const int& RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for longs.
+template<> struct DenseMapInfo<long> {
+  static inline long getEmptyKey() {
+    return (1UL << (sizeof(long) * 8 - 1)) - 1UL;
+  }
+  static inline long getTombstoneKey() { return getEmptyKey() - 1L; }
+  static unsigned getHashValue(const long& Val) {
+    return (unsigned)(Val * 37UL);
+  }
+  static bool isEqual(const long& LHS, const long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for long longs.
+template<> struct DenseMapInfo<long long> {
+  static inline long long getEmptyKey() { return 0x7fffffffffffffffLL; }
+  static inline long long getTombstoneKey() { return -0x7fffffffffffffffLL-1; }
+  static unsigned getHashValue(const long long& Val) {
+    return (unsigned)(Val * 37ULL);
+  }
+  static bool isEqual(const long long& LHS,
+                      const long long& RHS) {
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for all pairs whose members have info.
+template<typename T, typename U>
+struct DenseMapInfo<std::pair<T, U> > {
+  typedef std::pair<T, U> Pair;
+  typedef DenseMapInfo<T> FirstInfo;
+  typedef DenseMapInfo<U> SecondInfo;
+
+  static inline Pair getEmptyKey() {
+    return std::make_pair(FirstInfo::getEmptyKey(),
+                          SecondInfo::getEmptyKey());
+  }
+  static inline Pair getTombstoneKey() {
+    return std::make_pair(FirstInfo::getTombstoneKey(),
+                          SecondInfo::getTombstoneKey());
+  }
+  static unsigned getHashValue(const Pair& PairVal) {
+    uint64_t key = (uint64_t)FirstInfo::getHashValue(PairVal.first) << 32
+          | (uint64_t)SecondInfo::getHashValue(PairVal.second);
+    key += ~(key << 32);
+    key ^= (key >> 22);
+    key += ~(key << 13);
+    key ^= (key >> 8);
+    key += (key << 3);
+    key ^= (key >> 15);
+    key += ~(key << 27);
+    key ^= (key >> 31);
+    return (unsigned)key;
+  }
+  static bool isEqual(const Pair &LHS, const Pair &RHS) {
+    return FirstInfo::isEqual(LHS.first, RHS.first) &&
+           SecondInfo::isEqual(LHS.second, RHS.second);
+  }
+};
+
+// Provide DenseMapInfo for StringRefs.
+template <> struct DenseMapInfo<StringRef> {
+  static inline StringRef getEmptyKey() {
+    return StringRef(reinterpret_cast<const char *>(~static_cast<uintptr_t>(0)),
+                     0);
+  }
+  static inline StringRef getTombstoneKey() {
+    return StringRef(reinterpret_cast<const char *>(~static_cast<uintptr_t>(1)),
+                     0);
+  }
+  static unsigned getHashValue(StringRef Val) {
+    assert(Val.data() != getEmptyKey().data() && "Cannot hash the empty key!");
+    assert(Val.data() != getTombstoneKey().data() &&
+           "Cannot hash the tombstone key!");
+    return (unsigned)(hash_value(Val));
+  }
+  static bool isEqual(StringRef LHS, StringRef RHS) {
+    if (RHS.data() == getEmptyKey().data())
+      return LHS.data() == getEmptyKey().data();
+    if (RHS.data() == getTombstoneKey().data())
+      return LHS.data() == getTombstoneKey().data();
+    return LHS == RHS;
+  }
+};
+
+// Provide DenseMapInfo for ArrayRefs.
+template <typename T> struct DenseMapInfo<ArrayRef<T>> {
+  static inline ArrayRef<T> getEmptyKey() {
+    return ArrayRef<T>(reinterpret_cast<const T *>(~static_cast<uintptr_t>(0)),
+                       size_t(0));
+  }
+  static inline ArrayRef<T> getTombstoneKey() {
+    return ArrayRef<T>(reinterpret_cast<const T *>(~static_cast<uintptr_t>(1)),
+                       size_t(0));
+  }
+  static unsigned getHashValue(ArrayRef<T> Val) {
+    assert(Val.data() != getEmptyKey().data() && "Cannot hash the empty key!");
+    assert(Val.data() != getTombstoneKey().data() &&
+           "Cannot hash the tombstone key!");
+    return (unsigned)(hash_value(Val));
+  }
+  static bool isEqual(ArrayRef<T> LHS, ArrayRef<T> RHS) {
+    if (RHS.data() == getEmptyKey().data())
+      return LHS.data() == getEmptyKey().data();
+    if (RHS.data() == getTombstoneKey().data())
+      return LHS.data() == getTombstoneKey().data();
+    return LHS == RHS;
+  }
+};
+
+} // end namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/EpochTracker.h b/third_party/wpiutil_2018/src/main/native/include/llvm/EpochTracker.h
new file mode 100644
index 0000000..f589136
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/EpochTracker.h
@@ -0,0 +1,97 @@
+//===- llvm/ADT/EpochTracker.h - ADT epoch tracking --------------*- C++ -*-==//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the DebugEpochBase and DebugEpochBase::HandleBase classes.
+// These can be used to write iterators that are fail-fast when LLVM is built
+// with asserts enabled.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_EPOCH_TRACKER_H
+#define LLVM_ADT_EPOCH_TRACKER_H
+
+#include <cstdint>
+
+namespace llvm {
+
+#ifdef NDEBUG //ifndef LLVM_ENABLE_ABI_BREAKING_CHECKS
+
+class DebugEpochBase {
+public:
+  void incrementEpoch() {}
+
+  class HandleBase {
+  public:
+    HandleBase() = default;
+    explicit HandleBase(const DebugEpochBase *) {}
+    bool isHandleInSync() const { return true; }
+    const void *getEpochAddress() const { return nullptr; }
+  };
+};
+
+#else
+
+/// \brief A base class for data structure classes wishing to make iterators
+/// ("handles") pointing into themselves fail-fast.  When building without
+/// asserts, this class is empty and does nothing.
+///
+/// DebugEpochBase does not by itself track handles pointing into itself.  The
+/// expectation is that routines touching the handles will poll on
+/// isHandleInSync at appropriate points to assert that the handle they're using
+/// is still valid.
+///
+class DebugEpochBase {
+  uint64_t Epoch;
+
+public:
+  DebugEpochBase() : Epoch(0) {}
+
+  /// \brief Calling incrementEpoch invalidates all handles pointing into the
+  /// calling instance.
+  void incrementEpoch() { ++Epoch; }
+
+  /// \brief The destructor calls incrementEpoch to make use-after-free bugs
+  /// more likely to crash deterministically.
+  ~DebugEpochBase() { incrementEpoch(); }
+
+  /// \brief A base class for iterator classes ("handles") that wish to poll for
+  /// iterator invalidating modifications in the underlying data structure.
+  /// When LLVM is built without asserts, this class is empty and does nothing.
+  ///
+  /// HandleBase does not track the parent data structure by itself.  It expects
+  /// the routines modifying the data structure to call incrementEpoch when they
+  /// make an iterator-invalidating modification.
+  ///
+  class HandleBase {
+    const uint64_t *EpochAddress;
+    uint64_t EpochAtCreation;
+
+  public:
+    HandleBase() : EpochAddress(nullptr), EpochAtCreation(UINT64_MAX) {}
+
+    explicit HandleBase(const DebugEpochBase *Parent)
+        : EpochAddress(&Parent->Epoch), EpochAtCreation(Parent->Epoch) {}
+
+    /// \brief Returns true if the DebugEpochBase this Handle is linked to has
+    /// not called incrementEpoch on itself since the creation of this
+    /// HandleBase instance.
+    bool isHandleInSync() const { return *EpochAddress == EpochAtCreation; }
+
+    /// \brief Returns a pointer to the epoch word stored in the data structure
+    /// this handle points into.  Can be used to check if two iterators point
+    /// into the same data structure.
+    const void *getEpochAddress() const { return EpochAddress; }
+  };
+};
+
+#endif // LLVM_ENABLE_ABI_BREAKING_CHECKS
+
+} // namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/FileSystem.h b/third_party/wpiutil_2018/src/main/native/include/llvm/FileSystem.h
new file mode 100644
index 0000000..c45afc8
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/FileSystem.h
@@ -0,0 +1,668 @@
+//===- llvm/Support/FileSystem.h - File System OS Concept -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the llvm::sys::fs namespace. It is designed after
+// TR2/boost filesystem (v3), but modified to remove exception handling and the
+// path class.
+//
+// All functions return an error_code and their actual work via the last out
+// argument. The out argument is defined if and only if errc::success is
+// returned. A function may return any error code in the generic or system
+// category. However, they shall be equivalent to any error conditions listed
+// in each functions respective documentation if the condition applies. [ note:
+// this does not guarantee that error_code will be in the set of explicitly
+// listed codes, but it does guarantee that if any of the explicitly listed
+// errors occur, the correct error_code will be used ]. All functions may
+// return errc::not_enough_memory if there is not enough memory to complete the
+// operation.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_FILESYSTEM_H
+#define LLVM_SUPPORT_FILESYSTEM_H
+
+#include "llvm/IntrusiveRefCntPtr.h"
+#include "llvm/SmallString.h"
+#include "llvm/Twine.h"
+
+#include <sys/stat.h>
+
+#include <ctime>
+#include <stack>
+#include <system_error>
+#include <tuple>
+#include <vector>
+
+namespace llvm {
+namespace sys {
+namespace fs {
+
+/// An enumeration for the file system's view of the type.
+enum class file_type {
+  status_error,
+  file_not_found,
+  regular_file,
+  directory_file,
+  symlink_file,
+  block_file,
+  character_file,
+  fifo_file,
+  socket_file,
+  type_unknown
+};
+
+enum perms {
+  no_perms = 0,
+  owner_read = 0400,
+  owner_write = 0200,
+  owner_exe = 0100,
+  owner_all = owner_read | owner_write | owner_exe,
+  group_read = 040,
+  group_write = 020,
+  group_exe = 010,
+  group_all = group_read | group_write | group_exe,
+  others_read = 04,
+  others_write = 02,
+  others_exe = 01,
+  others_all = others_read | others_write | others_exe,
+  all_read = owner_read | group_read | others_read,
+  all_write = owner_write | group_write | others_write,
+  all_exe = owner_exe | group_exe | others_exe,
+  all_all = owner_all | group_all | others_all,
+  set_uid_on_exe = 04000,
+  set_gid_on_exe = 02000,
+  sticky_bit = 01000,
+  perms_not_known = 0xFFFF
+};
+
+// Helper functions so that you can use & and | to manipulate perms bits:
+inline perms operator|(perms l, perms r) {
+  return static_cast<perms>(static_cast<unsigned short>(l) |
+                            static_cast<unsigned short>(r));
+}
+inline perms operator&(perms l, perms r) {
+  return static_cast<perms>(static_cast<unsigned short>(l) &
+                            static_cast<unsigned short>(r));
+}
+inline perms &operator|=(perms &l, perms r) {
+  l = l | r;
+  return l;
+}
+inline perms &operator&=(perms &l, perms r) {
+  l = l & r;
+  return l;
+}
+inline perms operator~(perms x) {
+  return static_cast<perms>(
+    static_cast<unsigned short>(~static_cast<unsigned short>(x)));
+}
+
+class UniqueID {
+  uint64_t Device;
+  uint64_t File;
+
+public:
+  UniqueID() = default;
+  UniqueID(uint64_t Device, uint64_t File) : Device(Device), File(File) {}
+  bool operator==(const UniqueID &Other) const {
+    return Device == Other.Device && File == Other.File;
+  }
+  bool operator!=(const UniqueID &Other) const { return !(*this == Other); }
+  bool operator<(const UniqueID &Other) const {
+    return std::tie(Device, File) < std::tie(Other.Device, Other.File);
+  }
+  uint64_t getDevice() const { return Device; }
+  uint64_t getFile() const { return File; }
+};
+
+/// file_status - Represents the result of a call to stat and friends. It has
+///               a platform-specific member to store the result.
+class file_status
+{
+  #ifdef _WIN32
+  uint32_t LastAccessedTimeHigh;
+  uint32_t LastAccessedTimeLow;
+  uint32_t LastWriteTimeHigh;
+  uint32_t LastWriteTimeLow;
+  uint32_t VolumeSerialNumber;
+  uint32_t FileSizeHigh;
+  uint32_t FileSizeLow;
+  uint32_t FileIndexHigh;
+  uint32_t FileIndexLow;
+  #else
+  dev_t fs_st_dev;
+  ino_t fs_st_ino;
+  time_t fs_st_atime;
+  time_t fs_st_mtime;
+  uid_t fs_st_uid;
+  gid_t fs_st_gid;
+  off_t fs_st_size;
+  #endif
+  friend bool equivalent(file_status A, file_status B);
+  file_type Type;
+  perms Perms;
+
+public:
+  #ifdef _WIN32
+  file_status()
+      : LastAccessedTimeHigh(0), LastAccessedTimeLow(0), LastWriteTimeHigh(0),
+        LastWriteTimeLow(0), VolumeSerialNumber(0), FileSizeHigh(0),
+        FileSizeLow(0), FileIndexHigh(0), FileIndexLow(0),
+        Type(file_type::status_error), Perms(perms_not_known) {}
+
+  file_status(file_type Type)
+      : LastAccessedTimeHigh(0), LastAccessedTimeLow(0), LastWriteTimeHigh(0),
+        LastWriteTimeLow(0), VolumeSerialNumber(0), FileSizeHigh(0),
+        FileSizeLow(0), FileIndexHigh(0), FileIndexLow(0), Type(Type),
+        Perms(perms_not_known) {}
+
+  file_status(file_type Type, uint32_t LastAccessTimeHigh,
+              uint32_t LastAccessTimeLow, uint32_t LastWriteTimeHigh,
+              uint32_t LastWriteTimeLow, uint32_t VolumeSerialNumber,
+              uint32_t FileSizeHigh, uint32_t FileSizeLow,
+              uint32_t FileIndexHigh, uint32_t FileIndexLow)
+      : LastAccessedTimeHigh(LastAccessTimeHigh), LastAccessedTimeLow(LastAccessTimeLow),
+        LastWriteTimeHigh(LastWriteTimeHigh),
+        LastWriteTimeLow(LastWriteTimeLow),
+        VolumeSerialNumber(VolumeSerialNumber), FileSizeHigh(FileSizeHigh),
+        FileSizeLow(FileSizeLow), FileIndexHigh(FileIndexHigh),
+        FileIndexLow(FileIndexLow), Type(Type), Perms(perms_not_known) {}
+  #else
+  file_status()
+      : fs_st_dev(0), fs_st_ino(0), fs_st_atime(0), fs_st_mtime(0),
+        fs_st_uid(0), fs_st_gid(0), fs_st_size(0),
+        Type(file_type::status_error), Perms(perms_not_known) {}
+
+  file_status(file_type Type)
+      : fs_st_dev(0), fs_st_ino(0), fs_st_atime(0), fs_st_mtime(0),
+        fs_st_uid(0), fs_st_gid(0), fs_st_size(0), Type(Type),
+        Perms(perms_not_known) {}
+
+  file_status(file_type Type, perms Perms, dev_t Dev, ino_t Ino, time_t ATime,
+              time_t MTime, uid_t UID, gid_t GID, off_t Size)
+      : fs_st_dev(Dev), fs_st_ino(Ino), fs_st_atime(ATime), fs_st_mtime(MTime),
+        fs_st_uid(UID), fs_st_gid(GID), fs_st_size(Size), Type(Type),
+        Perms(Perms) {}
+  #endif
+
+  // getters
+  file_type type() const { return Type; }
+  perms permissions() const { return Perms; }
+  UniqueID getUniqueID() const;
+
+  #ifdef _WIN32
+  uint32_t getUser() const {
+    return 9999; // Not applicable to Windows, so...
+  }
+  uint32_t getGroup() const {
+    return 9999; // Not applicable to Windows, so...
+  }
+  uint64_t getSize() const {
+    return (uint64_t(FileSizeHigh) << 32) + FileSizeLow;
+  }
+  #else
+  uint32_t getUser() const { return fs_st_uid; }
+  uint32_t getGroup() const { return fs_st_gid; }
+  uint64_t getSize() const { return fs_st_size; }
+  #endif
+
+  // setters
+  void type(file_type v) { Type = v; }
+  void permissions(perms p) { Perms = p; }
+};
+
+/// @}
+/// @name Physical Operators
+/// @{
+
+/// @brief Make \a path an absolute path.
+///
+/// Makes \a path absolute using the \a current_directory if it is not already.
+/// An empty \a path will result in the \a current_directory.
+///
+/// /absolute/path   => /absolute/path
+/// relative/../path => <current-directory>/relative/../path
+///
+/// @param path A path that is modified to be an absolute path.
+/// @returns errc::success if \a path has been made absolute, otherwise a
+///          platform-specific error_code.
+std::error_code make_absolute(const Twine &current_directory,
+                              SmallVectorImpl<char> &path);
+
+/// @brief Make \a path an absolute path.
+///
+/// Makes \a path absolute using the current directory if it is not already. An
+/// empty \a path will result in the current directory.
+///
+/// /absolute/path   => /absolute/path
+/// relative/../path => <current-directory>/relative/../path
+///
+/// @param path A path that is modified to be an absolute path.
+/// @returns errc::success if \a path has been made absolute, otherwise a
+///          platform-specific error_code.
+std::error_code make_absolute(SmallVectorImpl<char> &path);
+
+/// @brief Get the current path.
+///
+/// @param result Holds the current path on return.
+/// @returns errc::success if the current path has been stored in result,
+///          otherwise a platform-specific error_code.
+std::error_code current_path(SmallVectorImpl<char> &result);
+
+/// @}
+/// @name Physical Observers
+/// @{
+
+/// @brief Does file exist?
+///
+/// @param status A file_status previously returned from stat.
+/// @returns True if the file represented by status exists, false if it does
+///          not.
+bool exists(file_status status);
+
+enum class AccessMode { Exist, Write, Execute };
+
+/// @brief Can the file be accessed?
+///
+/// @param Path Input path.
+/// @returns errc::success if the path can be accessed, otherwise a
+///          platform-specific error_code.
+std::error_code access(const Twine &Path, AccessMode Mode);
+
+/// @brief Does file exist?
+///
+/// @param Path Input path.
+/// @returns True if it exists, false otherwise.
+inline bool exists(const Twine &Path) {
+  return !access(Path, AccessMode::Exist);
+}
+
+/// @brief Can we write this file?
+///
+/// @param Path Input path.
+/// @returns True if we can write to it, false otherwise.
+inline bool can_write(const Twine &Path) {
+  return !access(Path, AccessMode::Write);
+}
+
+/// @brief Do file_status's represent the same thing?
+///
+/// @param A Input file_status.
+/// @param B Input file_status.
+///
+/// assert(status_known(A) || status_known(B));
+///
+/// @returns True if A and B both represent the same file system entity, false
+///          otherwise.
+bool equivalent(file_status A, file_status B);
+
+/// @brief Do paths represent the same thing?
+///
+/// assert(status_known(A) || status_known(B));
+///
+/// @param A Input path A.
+/// @param B Input path B.
+/// @param result Set to true if stat(A) and stat(B) have the same device and
+///               inode (or equivalent).
+/// @returns errc::success if result has been successfully set, otherwise a
+///          platform-specific error_code.
+std::error_code equivalent(const Twine &A, const Twine &B, bool &result);
+
+/// @brief Simpler version of equivalent for clients that don't need to
+///        differentiate between an error and false.
+inline bool equivalent(const Twine &A, const Twine &B) {
+  bool result;
+  return !equivalent(A, B, result) && result;
+}
+
+/// @brief Does status represent a directory?
+///
+/// @param status A file_status previously returned from status.
+/// @returns status.type() == file_type::directory_file.
+bool is_directory(file_status status);
+
+/// @brief Is path a directory?
+///
+/// @param path Input path.
+/// @param result Set to true if \a path is a directory, false if it is not.
+///               Undefined otherwise.
+/// @returns errc::success if result has been successfully set, otherwise a
+///          platform-specific error_code.
+std::error_code is_directory(const Twine &path, bool &result);
+
+/// @brief Simpler version of is_directory for clients that don't need to
+///        differentiate between an error and false.
+inline bool is_directory(const Twine &Path) {
+  bool Result;
+  return !is_directory(Path, Result) && Result;
+}
+
+/// @brief Does status represent a regular file?
+///
+/// @param status A file_status previously returned from status.
+/// @returns status_known(status) && status.type() == file_type::regular_file.
+bool is_regular_file(file_status status);
+
+/// @brief Is path a regular file?
+///
+/// @param path Input path.
+/// @param result Set to true if \a path is a regular file, false if it is not.
+///               Undefined otherwise.
+/// @returns errc::success if result has been successfully set, otherwise a
+///          platform-specific error_code.
+std::error_code is_regular_file(const Twine &path, bool &result);
+
+/// @brief Simpler version of is_regular_file for clients that don't need to
+///        differentiate between an error and false.
+inline bool is_regular_file(const Twine &Path) {
+  bool Result;
+  if (is_regular_file(Path, Result))
+    return false;
+  return Result;
+}
+
+/// @brief Does this status represent something that exists but is not a
+///        directory, regular file, or symlink?
+///
+/// @param status A file_status previously returned from status.
+/// @returns exists(s) && !is_regular_file(s) && !is_directory(s)
+bool is_other(file_status status);
+
+/// @brief Is path something that exists but is not a directory,
+///        regular file, or symlink?
+///
+/// @param path Input path.
+/// @param result Set to true if \a path exists, but is not a directory, regular
+///               file, or a symlink, false if it does not. Undefined otherwise.
+/// @returns errc::success if result has been successfully set, otherwise a
+///          platform-specific error_code.
+std::error_code is_other(const Twine &path, bool &result);
+
+/// @brief Get file status as if by POSIX stat().
+///
+/// @param path Input path.
+/// @param result Set to the file status.
+/// @returns errc::success if result has been successfully set, otherwise a
+///          platform-specific error_code.
+std::error_code status(const Twine &path, file_status &result);
+
+/// @brief A version for when a file descriptor is already available.
+std::error_code status(int FD, file_status &Result);
+
+/// @brief Is status available?
+///
+/// @param s Input file status.
+/// @returns True if status() != status_error.
+bool status_known(file_status s);
+
+/// @brief Is status available?
+///
+/// @param path Input path.
+/// @param result Set to true if status() != status_error.
+/// @returns errc::success if result has been successfully set, otherwise a
+///          platform-specific error_code.
+std::error_code status_known(const Twine &path, bool &result);
+
+enum OpenFlags : unsigned {
+  F_None = 0,
+
+  /// F_Excl - When opening a file, this flag makes raw_fd_ostream
+  /// report an error if the file already exists.
+  F_Excl = 1,
+
+  /// F_Append - When opening a file, if it already exists append to the
+  /// existing file instead of returning an error.  This may not be specified
+  /// with F_Excl.
+  F_Append = 2,
+
+  /// The file should be opened in text mode on platforms that make this
+  /// distinction.
+  F_Text = 4,
+
+  /// Open the file for read and write.
+  F_RW = 8
+};
+
+inline OpenFlags operator|(OpenFlags A, OpenFlags B) {
+  return OpenFlags(unsigned(A) | unsigned(B));
+}
+
+inline OpenFlags &operator|=(OpenFlags &A, OpenFlags B) {
+  A = A | B;
+  return A;
+}
+
+std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
+                                 OpenFlags Flags, unsigned Mode = 0666);
+
+std::error_code openFileForRead(const Twine &Name, int &ResultFD,
+                                SmallVectorImpl<char> *RealPath = nullptr);
+std::error_code getUniqueID(const Twine Path, UniqueID &Result);
+
+/// @}
+/// @name Iterators
+/// @{
+
+/// directory_entry - A single entry in a directory. Caches the status either
+/// from the result of the iteration syscall, or the first time status is
+/// called.
+class directory_entry {
+  std::string Path;
+  mutable file_status Status;
+
+public:
+  explicit directory_entry(const Twine &path, file_status st = file_status())
+    : Path(path.str())
+    , Status(st) {}
+
+  directory_entry() {}
+
+  void assign(const Twine &path, file_status st = file_status()) {
+    Path = path.str();
+    Status = st;
+  }
+
+  void replace_filename(const Twine &filename, file_status st = file_status());
+
+  const std::string &path() const { return Path; }
+  std::error_code status(file_status &result) const;
+
+  bool operator==(const directory_entry& rhs) const { return Path == rhs.Path; }
+  bool operator!=(const directory_entry& rhs) const { return !(*this == rhs); }
+  bool operator< (const directory_entry& rhs) const;
+  bool operator<=(const directory_entry& rhs) const;
+  bool operator> (const directory_entry& rhs) const;
+  bool operator>=(const directory_entry& rhs) const;
+};
+
+namespace detail {
+  struct DirIterState;
+
+  std::error_code directory_iterator_construct(DirIterState &, StringRef);
+  std::error_code directory_iterator_increment(DirIterState &);
+  std::error_code directory_iterator_destruct(DirIterState &);
+
+  /// DirIterState - Keeps state for the directory_iterator. It is reference
+  /// counted in order to preserve InputIterator semantics on copy.
+  struct DirIterState : public RefCountedBase<DirIterState> {
+    DirIterState()
+      : IterationHandle(0) {}
+
+    ~DirIterState() {
+      directory_iterator_destruct(*this);
+    }
+
+    intptr_t IterationHandle;
+    directory_entry CurrentEntry;
+  };
+} // end namespace detail
+
+/// directory_iterator - Iterates through the entries in path. There is no
+/// operator++ because we need an error_code. If it's really needed we can make
+/// it call report_fatal_error on error.
+class directory_iterator {
+  IntrusiveRefCntPtr<detail::DirIterState> State;
+
+public:
+  explicit directory_iterator(const Twine &path, std::error_code &ec) {
+    State = new detail::DirIterState;
+    SmallString<128> path_storage;
+    ec = detail::directory_iterator_construct(*State,
+            path.toStringRef(path_storage));
+  }
+
+  explicit directory_iterator(const directory_entry &de, std::error_code &ec) {
+    State = new detail::DirIterState;
+    ec = detail::directory_iterator_construct(*State, de.path());
+  }
+
+  /// Construct end iterator.
+  directory_iterator() : State(nullptr) {}
+
+  // No operator++ because we need error_code.
+  directory_iterator &increment(std::error_code &ec) {
+    ec = directory_iterator_increment(*State);
+    return *this;
+  }
+
+  const directory_entry &operator*() const { return State->CurrentEntry; }
+  const directory_entry *operator->() const { return &State->CurrentEntry; }
+
+  bool operator==(const directory_iterator &RHS) const {
+    if (State == RHS.State)
+      return true;
+    if (!RHS.State)
+      return State->CurrentEntry == directory_entry();
+    if (!State)
+      return RHS.State->CurrentEntry == directory_entry();
+    return State->CurrentEntry == RHS.State->CurrentEntry;
+  }
+
+  bool operator!=(const directory_iterator &RHS) const {
+    return !(*this == RHS);
+  }
+  // Other members as required by
+  // C++ Std, 24.1.1 Input iterators [input.iterators]
+};
+
+namespace detail {
+  /// RecDirIterState - Keeps state for the recursive_directory_iterator. It is
+  /// reference counted in order to preserve InputIterator semantics on copy.
+  struct RecDirIterState : public RefCountedBase<RecDirIterState> {
+    RecDirIterState()
+      : Level(0)
+      , HasNoPushRequest(false) {}
+
+    std::stack<directory_iterator, std::vector<directory_iterator> > Stack;
+    uint16_t Level;
+    bool HasNoPushRequest;
+  };
+} // end namespace detail
+
+/// recursive_directory_iterator - Same as directory_iterator except for it
+/// recurses down into child directories.
+class recursive_directory_iterator {
+  IntrusiveRefCntPtr<detail::RecDirIterState> State;
+
+public:
+  recursive_directory_iterator() {}
+  explicit recursive_directory_iterator(const Twine &path, std::error_code &ec)
+      : State(new detail::RecDirIterState) {
+    State->Stack.push(directory_iterator(path, ec));
+    if (State->Stack.top() == directory_iterator())
+      State.reset();
+  }
+  // No operator++ because we need error_code.
+  recursive_directory_iterator &increment(std::error_code &ec) {
+    const directory_iterator end_itr;
+
+    if (State->HasNoPushRequest)
+      State->HasNoPushRequest = false;
+    else {
+      file_status st;
+      if ((ec = State->Stack.top()->status(st))) return *this;
+      if (is_directory(st)) {
+        State->Stack.push(directory_iterator(*State->Stack.top(), ec));
+        if (ec) return *this;
+        if (State->Stack.top() != end_itr) {
+          ++State->Level;
+          return *this;
+        }
+        State->Stack.pop();
+      }
+    }
+
+    while (!State->Stack.empty()
+           && State->Stack.top().increment(ec) == end_itr) {
+      State->Stack.pop();
+      --State->Level;
+    }
+
+    // Check if we are done. If so, create an end iterator.
+    if (State->Stack.empty())
+      State.reset();
+
+    return *this;
+  }
+
+  const directory_entry &operator*() const { return *State->Stack.top(); }
+  const directory_entry *operator->() const { return &*State->Stack.top(); }
+
+  // observers
+  /// Gets the current level. Starting path is at level 0.
+  int level() const { return State->Level; }
+
+  /// Returns true if no_push has been called for this directory_entry.
+  bool no_push_request() const { return State->HasNoPushRequest; }
+
+  // modifiers
+  /// Goes up one level if Level > 0.
+  void pop() {
+    assert(State && "Cannot pop an end iterator!");
+    assert(State->Level > 0 && "Cannot pop an iterator with level < 1");
+
+    const directory_iterator end_itr;
+    std::error_code ec;
+    do {
+      if (ec) {
+        //report_fatal_error("Error incrementing directory iterator.");
+        while (!State->Stack.empty()) State->Stack.pop();
+        break;
+      }
+      State->Stack.pop();
+      --State->Level;
+    } while (!State->Stack.empty()
+             && State->Stack.top().increment(ec) == end_itr);
+
+    // Check if we are done. If so, create an end iterator.
+    if (State->Stack.empty())
+      State.reset();
+  }
+
+  /// Does not go down into the current directory_entry.
+  void no_push() { State->HasNoPushRequest = true; }
+
+  bool operator==(const recursive_directory_iterator &RHS) const {
+    return State == RHS.State;
+  }
+
+  bool operator!=(const recursive_directory_iterator &RHS) const {
+    return !(*this == RHS);
+  }
+  // Other members as required by
+  // C++ Std, 24.1.1 Input iterators [input.iterators]
+};
+
+/// @}
+
+} // end namespace fs
+} // end namespace sys
+} // end namespace llvm
+
+#endif // LLVM_SUPPORT_FILESYSTEM_H
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/Format.h b/third_party/wpiutil_2018/src/main/native/include/llvm/Format.h
new file mode 100644
index 0000000..5138dec
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/Format.h
@@ -0,0 +1,202 @@
+//===- Format.h - Efficient printf-style formatting for streams -*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the format() function, which can be used with other
+// LLVM subsystems to provide printf-style formatting.  This gives all the power
+// and risk of printf.  This can be used like this (with raw_ostreams as an
+// example):
+//
+//    OS << "mynumber: " << format("%4.5f", 1234.412) << '\n';
+//
+// Or if you prefer:
+//
+//  OS << format("mynumber: %4.5f\n", 1234.412);
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_FORMAT_H
+#define LLVM_SUPPORT_FORMAT_H
+
+#include "llvm/STLExtras.h"
+#include "llvm/StringRef.h"
+#include <cassert>
+#include <cstdint>
+#include <cstdio>
+#include <tuple>
+
+namespace llvm {
+
+/// This is a helper class used for handling formatted output.  It is the
+/// abstract base class of a templated derived class.
+class format_object_base {
+protected:
+  const char *Fmt;
+  ~format_object_base() = default; // Disallow polymorphic deletion.
+  format_object_base(const format_object_base &) = default;
+  virtual void home(); // Out of line virtual method.
+
+  /// Call snprintf() for this object, on the given buffer and size.
+  virtual int snprint(char *Buffer, unsigned BufferSize) const = 0;
+
+public:
+  format_object_base(const char *fmt) : Fmt(fmt) {}
+
+  /// Format the object into the specified buffer.  On success, this returns
+  /// the length of the formatted string.  If the buffer is too small, this
+  /// returns a length to retry with, which will be larger than BufferSize.
+  unsigned print(char *Buffer, unsigned BufferSize) const {
+    assert(BufferSize && "Invalid buffer size!");
+
+    // Print the string, leaving room for the terminating null.
+    int N = snprint(Buffer, BufferSize);
+
+    // VC++ and old GlibC return negative on overflow, just double the size.
+    if (N < 0)
+      return BufferSize * 2;
+
+    // Other implementations yield number of bytes needed, not including the
+    // final '\0'.
+    if (unsigned(N) >= BufferSize)
+      return N + 1;
+
+    // Otherwise N is the length of output (not including the final '\0').
+    return N;
+  }
+};
+
+/// These are templated helper classes used by the format function that
+/// capture the object to be formated and the format string. When actually
+/// printed, this synthesizes the string into a temporary buffer provided and
+/// returns whether or not it is big enough.
+
+template <typename... Ts>
+class format_object final : public format_object_base {
+  std::tuple<Ts...> Vals;
+
+  template <std::size_t... Is>
+  int snprint_tuple(char *Buffer, unsigned BufferSize,
+                    index_sequence<Is...>) const {
+#ifdef _MSC_VER
+    return _snprintf(Buffer, BufferSize, Fmt, std::get<Is>(Vals)...);
+#else
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
+    return snprintf(Buffer, BufferSize, Fmt, std::get<Is>(Vals)...);
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+#endif
+  }
+
+public:
+  format_object(const char *fmt, const Ts &... vals)
+      : format_object_base(fmt), Vals(vals...) {}
+
+  int snprint(char *Buffer, unsigned BufferSize) const override {
+    return snprint_tuple(Buffer, BufferSize, index_sequence_for<Ts...>());
+  }
+};
+
+/// These are helper functions used to produce formatted output.  They use
+/// template type deduction to construct the appropriate instance of the
+/// format_object class to simplify their construction.
+///
+/// This is typically used like:
+/// \code
+///   OS << format("%0.4f", myfloat) << '\n';
+/// \endcode
+
+template <typename... Ts>
+inline format_object<Ts...> format(const char *Fmt, const Ts &... Vals) {
+  return format_object<Ts...>(Fmt, Vals...);
+}
+
+/// This is a helper class used for left_justify() and right_justify().
+class FormattedString {
+  StringRef Str;
+  unsigned Width;
+  bool RightJustify;
+  friend class raw_ostream;
+
+public:
+    FormattedString(StringRef S, unsigned W, bool R)
+      : Str(S), Width(W), RightJustify(R) { }
+};
+
+/// left_justify - append spaces after string so total output is
+/// \p Width characters.  If \p Str is larger that \p Width, full string
+/// is written with no padding.
+inline FormattedString left_justify(StringRef Str, unsigned Width) {
+  return FormattedString(Str, Width, false);
+}
+
+/// right_justify - add spaces before string so total output is
+/// \p Width characters.  If \p Str is larger that \p Width, full string
+/// is written with no padding.
+inline FormattedString right_justify(StringRef Str, unsigned Width) {
+  return FormattedString(Str, Width, true);
+}
+
+/// This is a helper class used for format_hex() and format_decimal().
+class FormattedNumber {
+  uint64_t HexValue;
+  int64_t DecValue;
+  unsigned Width;
+  bool Hex;
+  bool Upper;
+  bool HexPrefix;
+  friend class raw_ostream;
+
+public:
+  FormattedNumber(uint64_t HV, int64_t DV, unsigned W, bool H, bool U,
+                  bool Prefix)
+      : HexValue(HV), DecValue(DV), Width(W), Hex(H), Upper(U),
+        HexPrefix(Prefix) {}
+};
+
+/// format_hex - Output \p N as a fixed width hexadecimal. If number will not
+/// fit in width, full number is still printed.  Examples:
+///   OS << format_hex(255, 4)              => 0xff
+///   OS << format_hex(255, 4, true)        => 0xFF
+///   OS << format_hex(255, 6)              => 0x00ff
+///   OS << format_hex(255, 2)              => 0xff
+inline FormattedNumber format_hex(uint64_t N, unsigned Width,
+                                  bool Upper = false) {
+  assert(Width <= 18 && "hex width must be <= 18");
+  return FormattedNumber(N, 0, Width, true, Upper, true);
+}
+
+/// format_hex_no_prefix - Output \p N as a fixed width hexadecimal. Does not
+/// prepend '0x' to the outputted string.  If number will not fit in width,
+/// full number is still printed.  Examples:
+///   OS << format_hex_no_prefix(255, 2)              => ff
+///   OS << format_hex_no_prefix(255, 2, true)        => FF
+///   OS << format_hex_no_prefix(255, 4)              => 00ff
+///   OS << format_hex_no_prefix(255, 1)              => ff
+inline FormattedNumber format_hex_no_prefix(uint64_t N, unsigned Width,
+                                            bool Upper = false) {
+  assert(Width <= 16 && "hex width must be <= 16");
+  return FormattedNumber(N, 0, Width, true, Upper, false);
+}
+
+/// format_decimal - Output \p N as a right justified, fixed-width decimal. If
+/// number will not fit in width, full number is still printed.  Examples:
+///   OS << format_decimal(0, 5)     => "    0"
+///   OS << format_decimal(255, 5)   => "  255"
+///   OS << format_decimal(-1, 3)    => " -1"
+///   OS << format_decimal(12345, 3) => "12345"
+inline FormattedNumber format_decimal(int64_t N, unsigned Width) {
+  return FormattedNumber(0, N, Width, false, false, false);
+}
+
+} // end namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/Hashing.h b/third_party/wpiutil_2018/src/main/native/include/llvm/Hashing.h
new file mode 100644
index 0000000..6efd99e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/Hashing.h
@@ -0,0 +1,659 @@
+//===-- llvm/ADT/Hashing.h - Utilities for hashing --------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the newly proposed standard C++ interfaces for hashing
+// arbitrary data and building hash functions for user-defined types. This
+// interface was originally proposed in N3333[1] and is currently under review
+// for inclusion in a future TR and/or standard.
+//
+// The primary interfaces provide are comprised of one type and three functions:
+//
+//  -- 'hash_code' class is an opaque type representing the hash code for some
+//     data. It is the intended product of hashing, and can be used to implement
+//     hash tables, checksumming, and other common uses of hashes. It is not an
+//     integer type (although it can be converted to one) because it is risky
+//     to assume much about the internals of a hash_code. In particular, each
+//     execution of the program has a high probability of producing a different
+//     hash_code for a given input. Thus their values are not stable to save or
+//     persist, and should only be used during the execution for the
+//     construction of hashing datastructures.
+//
+//  -- 'hash_value' is a function designed to be overloaded for each
+//     user-defined type which wishes to be used within a hashing context. It
+//     should be overloaded within the user-defined type's namespace and found
+//     via ADL. Overloads for primitive types are provided by this library.
+//
+//  -- 'hash_combine' and 'hash_combine_range' are functions designed to aid
+//      programmers in easily and intuitively combining a set of data into
+//      a single hash_code for their object. They should only logically be used
+//      within the implementation of a 'hash_value' routine or similar context.
+//
+// Note that 'hash_combine_range' contains very special logic for hashing
+// a contiguous array of integers or pointers. This logic is *extremely* fast,
+// on a modern Intel "Gainestown" Xeon (Nehalem uarch) @2.2 GHz, these were
+// benchmarked at over 6.5 GiB/s for large keys, and <20 cycles/hash for keys
+// under 32-bytes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_HASHING_H
+#define LLVM_ADT_HASHING_H
+
+#include "llvm/type_traits.h"
+#include <algorithm>
+#include <cassert>
+#include <cstdint>
+#include <cstring>
+#include <string>
+#include <utility>
+
+namespace llvm {
+
+/// \brief An opaque object representing a hash code.
+///
+/// This object represents the result of hashing some entity. It is intended to
+/// be used to implement hashtables or other hashing-based data structures.
+/// While it wraps and exposes a numeric value, this value should not be
+/// trusted to be stable or predictable across processes or executions.
+///
+/// In order to obtain the hash_code for an object 'x':
+/// \code
+///   using llvm::hash_value;
+///   llvm::hash_code code = hash_value(x);
+/// \endcode
+class hash_code {
+  size_t value;
+
+public:
+  /// \brief Default construct a hash_code.
+  /// Note that this leaves the value uninitialized.
+  hash_code() = default;
+
+  /// \brief Form a hash code directly from a numerical value.
+  hash_code(size_t value) : value(value) {}
+
+  /// \brief Convert the hash code to its numerical value for use.
+  /*explicit*/ operator size_t() const { return value; }
+
+  friend bool operator==(const hash_code &lhs, const hash_code &rhs) {
+    return lhs.value == rhs.value;
+  }
+  friend bool operator!=(const hash_code &lhs, const hash_code &rhs) {
+    return lhs.value != rhs.value;
+  }
+
+  /// \brief Allow a hash_code to be directly run through hash_value.
+  friend size_t hash_value(const hash_code &code) { return code.value; }
+};
+
+/// \brief Compute a hash_code for any integer value.
+///
+/// Note that this function is intended to compute the same hash_code for
+/// a particular value without regard to the pre-promotion type. This is in
+/// contrast to hash_combine which may produce different hash_codes for
+/// differing argument types even if they would implicit promote to a common
+/// type without changing the value.
+template <typename T>
+typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
+hash_value(T value);
+
+/// \brief Compute a hash_code for a pointer's address.
+///
+/// N.B.: This hashes the *address*. Not the value and not the type.
+template <typename T> hash_code hash_value(const T *ptr);
+
+/// \brief Compute a hash_code for a pair of objects.
+template <typename T, typename U>
+hash_code hash_value(const std::pair<T, U> &arg);
+
+/// \brief Compute a hash_code for a standard string.
+template <typename T>
+hash_code hash_value(const std::basic_string<T> &arg);
+
+
+/// \brief Override the execution seed with a fixed value.
+///
+/// This hashing library uses a per-execution seed designed to change on each
+/// run with high probability in order to ensure that the hash codes are not
+/// attackable and to ensure that output which is intended to be stable does
+/// not rely on the particulars of the hash codes produced.
+///
+/// That said, there are use cases where it is important to be able to
+/// reproduce *exactly* a specific behavior. To that end, we provide a function
+/// which will forcibly set the seed to a fixed value. This must be done at the
+/// start of the program, before any hashes are computed. Also, it cannot be
+/// undone. This makes it thread-hostile and very hard to use outside of
+/// immediately on start of a simple program designed for reproducible
+/// behavior.
+void set_fixed_execution_hash_seed(size_t fixed_value);
+
+
+// All of the implementation details of actually computing the various hash
+// code values are held within this namespace. These routines are included in
+// the header file mainly to allow inlining and constant propagation.
+namespace hashing {
+namespace detail {
+
+inline uint64_t fetch64(const char *p) {
+  uint64_t result;
+  memcpy(&result, p, sizeof(result));
+  //if (sys::IsBigEndianHost)
+  //  sys::swapByteOrder(result);
+  return result;
+}
+
+inline uint32_t fetch32(const char *p) {
+  uint32_t result;
+  memcpy(&result, p, sizeof(result));
+  //if (sys::IsBigEndianHost)
+  //  sys::swapByteOrder(result);
+  return result;
+}
+
+/// Some primes between 2^63 and 2^64 for various uses.
+static const uint64_t k0 = 0xc3a5c85c97cb3127ULL;
+static const uint64_t k1 = 0xb492b66fbe98f273ULL;
+static const uint64_t k2 = 0x9ae16a3b2f90404fULL;
+static const uint64_t k3 = 0xc949d7c7509e6557ULL;
+
+/// \brief Bitwise right rotate.
+/// Normally this will compile to a single instruction, especially if the
+/// shift is a manifest constant.
+inline uint64_t rotate(uint64_t val, size_t shift) {
+  // Avoid shifting by 64: doing so yields an undefined result.
+  return shift == 0 ? val : ((val >> shift) | (val << (64 - shift)));
+}
+
+inline uint64_t shift_mix(uint64_t val) {
+  return val ^ (val >> 47);
+}
+
+inline uint64_t hash_16_bytes(uint64_t low, uint64_t high) {
+  // Murmur-inspired hashing.
+  const uint64_t kMul = 0x9ddfea08eb382d69ULL;
+  uint64_t a = (low ^ high) * kMul;
+  a ^= (a >> 47);
+  uint64_t b = (high ^ a) * kMul;
+  b ^= (b >> 47);
+  b *= kMul;
+  return b;
+}
+
+inline uint64_t hash_1to3_bytes(const char *s, size_t len, uint64_t seed) {
+  uint8_t a = s[0];
+  uint8_t b = s[len >> 1];
+  uint8_t c = s[len - 1];
+  uint32_t y = static_cast<uint32_t>(a) + (static_cast<uint32_t>(b) << 8);
+  uint32_t z = len + (static_cast<uint32_t>(c) << 2);
+  return shift_mix(y * k2 ^ z * k3 ^ seed) * k2;
+}
+
+inline uint64_t hash_4to8_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t a = fetch32(s);
+  return hash_16_bytes(len + (a << 3), seed ^ fetch32(s + len - 4));
+}
+
+inline uint64_t hash_9to16_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t a = fetch64(s);
+  uint64_t b = fetch64(s + len - 8);
+  return hash_16_bytes(seed ^ a, rotate(b + len, len)) ^ b;
+}
+
+inline uint64_t hash_17to32_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t a = fetch64(s) * k1;
+  uint64_t b = fetch64(s + 8);
+  uint64_t c = fetch64(s + len - 8) * k2;
+  uint64_t d = fetch64(s + len - 16) * k0;
+  return hash_16_bytes(rotate(a - b, 43) + rotate(c ^ seed, 30) + d,
+                       a + rotate(b ^ k3, 20) - c + len + seed);
+}
+
+inline uint64_t hash_33to64_bytes(const char *s, size_t len, uint64_t seed) {
+  uint64_t z = fetch64(s + 24);
+  uint64_t a = fetch64(s) + (len + fetch64(s + len - 16)) * k0;
+  uint64_t b = rotate(a + z, 52);
+  uint64_t c = rotate(a, 37);
+  a += fetch64(s + 8);
+  c += rotate(a, 7);
+  a += fetch64(s + 16);
+  uint64_t vf = a + z;
+  uint64_t vs = b + rotate(a, 31) + c;
+  a = fetch64(s + 16) + fetch64(s + len - 32);
+  z = fetch64(s + len - 8);
+  b = rotate(a + z, 52);
+  c = rotate(a, 37);
+  a += fetch64(s + len - 24);
+  c += rotate(a, 7);
+  a += fetch64(s + len - 16);
+  uint64_t wf = a + z;
+  uint64_t ws = b + rotate(a, 31) + c;
+  uint64_t r = shift_mix((vf + ws) * k2 + (wf + vs) * k0);
+  return shift_mix((seed ^ (r * k0)) + vs) * k2;
+}
+
+inline uint64_t hash_short(const char *s, size_t length, uint64_t seed) {
+  if (length >= 4 && length <= 8)
+    return hash_4to8_bytes(s, length, seed);
+  if (length > 8 && length <= 16)
+    return hash_9to16_bytes(s, length, seed);
+  if (length > 16 && length <= 32)
+    return hash_17to32_bytes(s, length, seed);
+  if (length > 32)
+    return hash_33to64_bytes(s, length, seed);
+  if (length != 0)
+    return hash_1to3_bytes(s, length, seed);
+
+  return k2 ^ seed;
+}
+
+/// \brief The intermediate state used during hashing.
+/// Currently, the algorithm for computing hash codes is based on CityHash and
+/// keeps 56 bytes of arbitrary state.
+struct hash_state {
+  uint64_t h0, h1, h2, h3, h4, h5, h6;
+
+  /// \brief Create a new hash_state structure and initialize it based on the
+  /// seed and the first 64-byte chunk.
+  /// This effectively performs the initial mix.
+  static hash_state create(const char *s, uint64_t seed) {
+    hash_state state = {
+      0, seed, hash_16_bytes(seed, k1), rotate(seed ^ k1, 49),
+      seed * k1, shift_mix(seed), 0 };
+    state.h6 = hash_16_bytes(state.h4, state.h5);
+    state.mix(s);
+    return state;
+  }
+
+  /// \brief Mix 32-bytes from the input sequence into the 16-bytes of 'a'
+  /// and 'b', including whatever is already in 'a' and 'b'.
+  static void mix_32_bytes(const char *s, uint64_t &a, uint64_t &b) {
+    a += fetch64(s);
+    uint64_t c = fetch64(s + 24);
+    b = rotate(b + a + c, 21);
+    uint64_t d = a;
+    a += fetch64(s + 8) + fetch64(s + 16);
+    b += rotate(a, 44) + d;
+    a += c;
+  }
+
+  /// \brief Mix in a 64-byte buffer of data.
+  /// We mix all 64 bytes even when the chunk length is smaller, but we
+  /// record the actual length.
+  void mix(const char *s) {
+    h0 = rotate(h0 + h1 + h3 + fetch64(s + 8), 37) * k1;
+    h1 = rotate(h1 + h4 + fetch64(s + 48), 42) * k1;
+    h0 ^= h6;
+    h1 += h3 + fetch64(s + 40);
+    h2 = rotate(h2 + h5, 33) * k1;
+    h3 = h4 * k1;
+    h4 = h0 + h5;
+    mix_32_bytes(s, h3, h4);
+    h5 = h2 + h6;
+    h6 = h1 + fetch64(s + 16);
+    mix_32_bytes(s + 32, h5, h6);
+    std::swap(h2, h0);
+  }
+
+  /// \brief Compute the final 64-bit hash code value based on the current
+  /// state and the length of bytes hashed.
+  uint64_t finalize(size_t length) {
+    return hash_16_bytes(hash_16_bytes(h3, h5) + shift_mix(h1) * k1 + h2,
+                         hash_16_bytes(h4, h6) + shift_mix(length) * k1 + h0);
+  }
+};
+
+
+/// \brief A global, fixed seed-override variable.
+///
+/// This variable can be set using the \see llvm::set_fixed_execution_seed
+/// function. See that function for details. Do not, under any circumstances,
+/// set or read this variable.
+extern size_t fixed_seed_override;
+
+inline size_t get_execution_seed() {
+  // FIXME: This needs to be a per-execution seed. This is just a placeholder
+  // implementation. Switching to a per-execution seed is likely to flush out
+  // instability bugs and so will happen as its own commit.
+  //
+  // However, if there is a fixed seed override set the first time this is
+  // called, return that instead of the per-execution seed.
+  const uint64_t seed_prime = 0xff51afd7ed558ccdULL;
+  static size_t seed = fixed_seed_override ? fixed_seed_override
+                                           : (size_t)seed_prime;
+  return seed;
+}
+
+
+/// \brief Trait to indicate whether a type's bits can be hashed directly.
+///
+/// A type trait which is true if we want to combine values for hashing by
+/// reading the underlying data. It is false if values of this type must
+/// first be passed to hash_value, and the resulting hash_codes combined.
+//
+// FIXME: We want to replace is_integral_or_enum and is_pointer here with
+// a predicate which asserts that comparing the underlying storage of two
+// values of the type for equality is equivalent to comparing the two values
+// for equality. For all the platforms we care about, this holds for integers
+// and pointers, but there are platforms where it doesn't and we would like to
+// support user-defined types which happen to satisfy this property.
+template <typename T> struct is_hashable_data
+  : std::integral_constant<bool, ((is_integral_or_enum<T>::value ||
+                                   std::is_pointer<T>::value) &&
+                                  64 % sizeof(T) == 0)> {};
+
+// Special case std::pair to detect when both types are viable and when there
+// is no alignment-derived padding in the pair. This is a bit of a lie because
+// std::pair isn't truly POD, but it's close enough in all reasonable
+// implementations for our use case of hashing the underlying data.
+template <typename T, typename U> struct is_hashable_data<std::pair<T, U> >
+  : std::integral_constant<bool, (is_hashable_data<T>::value &&
+                                  is_hashable_data<U>::value &&
+                                  (sizeof(T) + sizeof(U)) ==
+                                   sizeof(std::pair<T, U>))> {};
+
+/// \brief Helper to get the hashable data representation for a type.
+/// This variant is enabled when the type itself can be used.
+template <typename T>
+typename std::enable_if<is_hashable_data<T>::value, T>::type
+get_hashable_data(const T &value) {
+  return value;
+}
+/// \brief Helper to get the hashable data representation for a type.
+/// This variant is enabled when we must first call hash_value and use the
+/// result as our data.
+template <typename T>
+typename std::enable_if<!is_hashable_data<T>::value, size_t>::type
+get_hashable_data(const T &value) {
+  using ::llvm::hash_value;
+  return hash_value(value);
+}
+
+/// \brief Helper to store data from a value into a buffer and advance the
+/// pointer into that buffer.
+///
+/// This routine first checks whether there is enough space in the provided
+/// buffer, and if not immediately returns false. If there is space, it
+/// copies the underlying bytes of value into the buffer, advances the
+/// buffer_ptr past the copied bytes, and returns true.
+template <typename T>
+bool store_and_advance(char *&buffer_ptr, char *buffer_end, const T& value,
+                       size_t offset = 0) {
+  size_t store_size = sizeof(value) - offset;
+  if (buffer_ptr + store_size > buffer_end)
+    return false;
+  const char *value_data = reinterpret_cast<const char *>(&value);
+  memcpy(buffer_ptr, value_data + offset, store_size);
+  buffer_ptr += store_size;
+  return true;
+}
+
+/// \brief Implement the combining of integral values into a hash_code.
+///
+/// This overload is selected when the value type of the iterator is
+/// integral. Rather than computing a hash_code for each object and then
+/// combining them, this (as an optimization) directly combines the integers.
+template <typename InputIteratorT>
+hash_code hash_combine_range_impl(InputIteratorT first, InputIteratorT last) {
+  const size_t seed = get_execution_seed();
+  char buffer[64], *buffer_ptr = buffer;
+  char *const buffer_end = std::end(buffer);
+  while (first != last && store_and_advance(buffer_ptr, buffer_end,
+                                            get_hashable_data(*first)))
+    ++first;
+  if (first == last)
+    return hash_short(buffer, buffer_ptr - buffer, seed);
+  assert(buffer_ptr == buffer_end);
+
+  hash_state state = state.create(buffer, seed);
+  size_t length = 64;
+  while (first != last) {
+    // Fill up the buffer. We don't clear it, which re-mixes the last round
+    // when only a partial 64-byte chunk is left.
+    buffer_ptr = buffer;
+    while (first != last && store_and_advance(buffer_ptr, buffer_end,
+                                              get_hashable_data(*first)))
+      ++first;
+
+    // Rotate the buffer if we did a partial fill in order to simulate doing
+    // a mix of the last 64-bytes. That is how the algorithm works when we
+    // have a contiguous byte sequence, and we want to emulate that here.
+    std::rotate(buffer, buffer_ptr, buffer_end);
+
+    // Mix this chunk into the current state.
+    state.mix(buffer);
+    length += buffer_ptr - buffer;
+  };
+
+  return state.finalize(length);
+}
+
+/// \brief Implement the combining of integral values into a hash_code.
+///
+/// This overload is selected when the value type of the iterator is integral
+/// and when the input iterator is actually a pointer. Rather than computing
+/// a hash_code for each object and then combining them, this (as an
+/// optimization) directly combines the integers. Also, because the integers
+/// are stored in contiguous memory, this routine avoids copying each value
+/// and directly reads from the underlying memory.
+template <typename ValueT>
+typename std::enable_if<is_hashable_data<ValueT>::value, hash_code>::type
+hash_combine_range_impl(ValueT *first, ValueT *last) {
+  const size_t seed = get_execution_seed();
+  const char *s_begin = reinterpret_cast<const char *>(first);
+  const char *s_end = reinterpret_cast<const char *>(last);
+  const size_t length = std::distance(s_begin, s_end);
+  if (length <= 64)
+    return hash_short(s_begin, length, seed);
+
+  const char *s_aligned_end = s_begin + (length & ~63);
+  hash_state state = state.create(s_begin, seed);
+  s_begin += 64;
+  while (s_begin != s_aligned_end) {
+    state.mix(s_begin);
+    s_begin += 64;
+  }
+  if (length & 63)
+    state.mix(s_end - 64);
+
+  return state.finalize(length);
+}
+
+} // namespace detail
+} // namespace hashing
+
+
+/// \brief Compute a hash_code for a sequence of values.
+///
+/// This hashes a sequence of values. It produces the same hash_code as
+/// 'hash_combine(a, b, c, ...)', but can run over arbitrary sized sequences
+/// and is significantly faster given pointers and types which can be hashed as
+/// a sequence of bytes.
+template <typename InputIteratorT>
+hash_code hash_combine_range(InputIteratorT first, InputIteratorT last) {
+  return ::llvm::hashing::detail::hash_combine_range_impl(first, last);
+}
+
+
+// Implementation details for hash_combine.
+namespace hashing {
+namespace detail {
+
+/// \brief Helper class to manage the recursive combining of hash_combine
+/// arguments.
+///
+/// This class exists to manage the state and various calls involved in the
+/// recursive combining of arguments used in hash_combine. It is particularly
+/// useful at minimizing the code in the recursive calls to ease the pain
+/// caused by a lack of variadic functions.
+struct hash_combine_recursive_helper {
+  char buffer[64];
+  hash_state state;
+  const size_t seed;
+
+public:
+  /// \brief Construct a recursive hash combining helper.
+  ///
+  /// This sets up the state for a recursive hash combine, including getting
+  /// the seed and buffer setup.
+  hash_combine_recursive_helper()
+    : seed(get_execution_seed()) {}
+
+  /// \brief Combine one chunk of data into the current in-flight hash.
+  ///
+  /// This merges one chunk of data into the hash. First it tries to buffer
+  /// the data. If the buffer is full, it hashes the buffer into its
+  /// hash_state, empties it, and then merges the new chunk in. This also
+  /// handles cases where the data straddles the end of the buffer.
+  template <typename T>
+  char *combine_data(size_t &length, char *buffer_ptr, char *buffer_end, T data) {
+    if (!store_and_advance(buffer_ptr, buffer_end, data)) {
+      // Check for skew which prevents the buffer from being packed, and do
+      // a partial store into the buffer to fill it. This is only a concern
+      // with the variadic combine because that formation can have varying
+      // argument types.
+      size_t partial_store_size = buffer_end - buffer_ptr;
+      memcpy(buffer_ptr, &data, partial_store_size);
+
+      // If the store fails, our buffer is full and ready to hash. We have to
+      // either initialize the hash state (on the first full buffer) or mix
+      // this buffer into the existing hash state. Length tracks the *hashed*
+      // length, not the buffered length.
+      if (length == 0) {
+        state = state.create(buffer, seed);
+        length = 64;
+      } else {
+        // Mix this chunk into the current state and bump length up by 64.
+        state.mix(buffer);
+        length += 64;
+      }
+      // Reset the buffer_ptr to the head of the buffer for the next chunk of
+      // data.
+      buffer_ptr = buffer;
+
+      // Try again to store into the buffer -- this cannot fail as we only
+      // store types smaller than the buffer.
+      if (!store_and_advance(buffer_ptr, buffer_end, data,
+                             partial_store_size))
+        abort();
+    }
+    return buffer_ptr;
+  }
+
+  /// \brief Recursive, variadic combining method.
+  ///
+  /// This function recurses through each argument, combining that argument
+  /// into a single hash.
+  template <typename T, typename ...Ts>
+  hash_code combine(size_t length, char *buffer_ptr, char *buffer_end,
+                    const T &arg, const Ts &...args) {
+    buffer_ptr = combine_data(length, buffer_ptr, buffer_end, get_hashable_data(arg));
+
+    // Recurse to the next argument.
+    return combine(length, buffer_ptr, buffer_end, args...);
+  }
+
+  /// \brief Base case for recursive, variadic combining.
+  ///
+  /// The base case when combining arguments recursively is reached when all
+  /// arguments have been handled. It flushes the remaining buffer and
+  /// constructs a hash_code.
+  hash_code combine(size_t length, char *buffer_ptr, char *buffer_end) {
+    // Check whether the entire set of values fit in the buffer. If so, we'll
+    // use the optimized short hashing routine and skip state entirely.
+    if (length == 0)
+      return hash_short(buffer, buffer_ptr - buffer, seed);
+
+    // Mix the final buffer, rotating it if we did a partial fill in order to
+    // simulate doing a mix of the last 64-bytes. That is how the algorithm
+    // works when we have a contiguous byte sequence, and we want to emulate
+    // that here.
+    std::rotate(buffer, buffer_ptr, buffer_end);
+
+    // Mix this chunk into the current state.
+    state.mix(buffer);
+    length += buffer_ptr - buffer;
+
+    return state.finalize(length);
+  }
+};
+
+} // namespace detail
+} // namespace hashing
+
+/// \brief Combine values into a single hash_code.
+///
+/// This routine accepts a varying number of arguments of any type. It will
+/// attempt to combine them into a single hash_code. For user-defined types it
+/// attempts to call a \see hash_value overload (via ADL) for the type. For
+/// integer and pointer types it directly combines their data into the
+/// resulting hash_code.
+///
+/// The result is suitable for returning from a user's hash_value
+/// *implementation* for their user-defined type. Consumers of a type should
+/// *not* call this routine, they should instead call 'hash_value'.
+template <typename ...Ts> hash_code hash_combine(const Ts &...args) {
+  // Recursively hash each argument using a helper class.
+  ::llvm::hashing::detail::hash_combine_recursive_helper helper;
+  return helper.combine(0, helper.buffer, helper.buffer + 64, args...);
+}
+
+// Implementation details for implementations of hash_value overloads provided
+// here.
+namespace hashing {
+namespace detail {
+
+/// \brief Helper to hash the value of a single integer.
+///
+/// Overloads for smaller integer types are not provided to ensure consistent
+/// behavior in the presence of integral promotions. Essentially,
+/// "hash_value('4')" and "hash_value('0' + 4)" should be the same.
+inline hash_code hash_integer_value(uint64_t value) {
+  // Similar to hash_4to8_bytes but using a seed instead of length.
+  const uint64_t seed = get_execution_seed();
+  const char *s = reinterpret_cast<const char *>(&value);
+  const uint64_t a = fetch32(s);
+  return hash_16_bytes(seed + (a << 3), fetch32(s + 4));
+}
+
+} // namespace detail
+} // namespace hashing
+
+// Declared and documented above, but defined here so that any of the hashing
+// infrastructure is available.
+template <typename T>
+typename std::enable_if<is_integral_or_enum<T>::value, hash_code>::type
+hash_value(T value) {
+  return ::llvm::hashing::detail::hash_integer_value(
+      static_cast<uint64_t>(value));
+}
+
+// Declared and documented above, but defined here so that any of the hashing
+// infrastructure is available.
+template <typename T> hash_code hash_value(const T *ptr) {
+  return ::llvm::hashing::detail::hash_integer_value(
+    reinterpret_cast<uintptr_t>(ptr));
+}
+
+// Declared and documented above, but defined here so that any of the hashing
+// infrastructure is available.
+template <typename T, typename U>
+hash_code hash_value(const std::pair<T, U> &arg) {
+  return hash_combine(arg.first, arg.second);
+}
+
+// Declared and documented above, but defined here so that any of the hashing
+// infrastructure is available.
+template <typename T>
+hash_code hash_value(const std::basic_string<T> &arg) {
+  return hash_combine_range(arg.begin(), arg.end());
+}
+
+} // namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/IntrusiveRefCntPtr.h b/third_party/wpiutil_2018/src/main/native/include/llvm/IntrusiveRefCntPtr.h
new file mode 100644
index 0000000..8057ec1
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/IntrusiveRefCntPtr.h
@@ -0,0 +1,288 @@
+//== llvm/ADT/IntrusiveRefCntPtr.h - Smart Refcounting Pointer ---*- C++ -*-==//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines IntrusiveRefCntPtr, a template class that
+// implements a "smart" pointer for objects that maintain their own
+// internal reference count, and RefCountedBase/RefCountedBaseVPTR, two
+// generic base classes for objects that wish to have their lifetimes
+// managed using reference counting.
+//
+// IntrusiveRefCntPtr is similar to Boost's intrusive_ptr with added
+// LLVM-style casting.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_INTRUSIVEREFCNTPTR_H
+#define LLVM_ADT_INTRUSIVEREFCNTPTR_H
+
+#include <atomic>
+#include <cassert>
+#include <cstddef>
+
+namespace llvm {
+
+  template <class T>
+  class IntrusiveRefCntPtr;
+
+//===----------------------------------------------------------------------===//
+/// RefCountedBase - A generic base class for objects that wish to
+///  have their lifetimes managed using reference counts. Classes
+///  subclass RefCountedBase to obtain such functionality, and are
+///  typically handled with IntrusiveRefCntPtr "smart pointers" (see below)
+///  which automatically handle the management of reference counts.
+///  Objects that subclass RefCountedBase should not be allocated on
+///  the stack, as invoking "delete" (which is called when the
+///  reference count hits 0) on such objects is an error.
+//===----------------------------------------------------------------------===//
+  template <class Derived>
+  class RefCountedBase {
+    mutable unsigned ref_cnt;
+
+  public:
+    RefCountedBase() : ref_cnt(0) {}
+    RefCountedBase(const RefCountedBase &) : ref_cnt(0) {}
+
+    void Retain() const { ++ref_cnt; }
+    void Release() const {
+      assert (ref_cnt > 0 && "Reference count is already zero.");
+      if (--ref_cnt == 0) delete static_cast<const Derived*>(this);
+    }
+  };
+
+//===----------------------------------------------------------------------===//
+/// RefCountedBaseVPTR - A class that has the same function as
+///  RefCountedBase, but with a virtual destructor. Should be used
+///  instead of RefCountedBase for classes that already have virtual
+///  methods to enforce dynamic allocation via 'new'. Classes that
+///  inherit from RefCountedBaseVPTR can't be allocated on stack -
+///  attempting to do this will produce a compile error.
+//===----------------------------------------------------------------------===//
+  class RefCountedBaseVPTR {
+    mutable unsigned ref_cnt;
+    virtual void anchor();
+
+  protected:
+    RefCountedBaseVPTR() : ref_cnt(0) {}
+    RefCountedBaseVPTR(const RefCountedBaseVPTR &) : ref_cnt(0) {}
+
+    virtual ~RefCountedBaseVPTR() {}
+
+    void Retain() const { ++ref_cnt; }
+    void Release() const {
+      assert (ref_cnt > 0 && "Reference count is already zero.");
+      if (--ref_cnt == 0) delete this;
+    }
+
+    template <typename T>
+    friend struct IntrusiveRefCntPtrInfo;
+  };
+
+
+  template <typename T> struct IntrusiveRefCntPtrInfo {
+    static void retain(T *obj) { obj->Retain(); }
+    static void release(T *obj) { obj->Release(); }
+  };
+
+/// \brief A thread-safe version of \c llvm::RefCountedBase.
+///
+/// A generic base class for objects that wish to have their lifetimes managed
+/// using reference counts. Classes subclass \c ThreadSafeRefCountedBase to
+/// obtain such functionality, and are typically handled with
+/// \c IntrusiveRefCntPtr "smart pointers" which automatically handle the
+/// management of reference counts.
+template <class Derived>
+class ThreadSafeRefCountedBase {
+  mutable std::atomic<int> RefCount;
+
+protected:
+  ThreadSafeRefCountedBase() : RefCount(0) {}
+
+public:
+  void Retain() const { ++RefCount; }
+
+  void Release() const {
+    int NewRefCount = --RefCount;
+    assert(NewRefCount >= 0 && "Reference count was already zero.");
+    if (NewRefCount == 0)
+      delete static_cast<const Derived*>(this);
+  }
+};
+
+//===----------------------------------------------------------------------===//
+/// IntrusiveRefCntPtr - A template class that implements a "smart pointer"
+///  that assumes the wrapped object has a reference count associated
+///  with it that can be managed via calls to
+///  IntrusivePtrAddRef/IntrusivePtrRelease.  The smart pointers
+///  manage reference counts via the RAII idiom: upon creation of
+///  smart pointer the reference count of the wrapped object is
+///  incremented and upon destruction of the smart pointer the
+///  reference count is decremented.  This class also safely handles
+///  wrapping NULL pointers.
+///
+/// Reference counting is implemented via calls to
+///  Obj->Retain()/Obj->Release(). Release() is required to destroy
+///  the object when the reference count reaches zero. Inheriting from
+///  RefCountedBase/RefCountedBaseVPTR takes care of this
+///  automatically.
+//===----------------------------------------------------------------------===//
+  template <typename T>
+  class IntrusiveRefCntPtr {
+    T* Obj;
+
+  public:
+    typedef T element_type;
+
+    explicit IntrusiveRefCntPtr() : Obj(nullptr) {}
+
+    IntrusiveRefCntPtr(T* obj) : Obj(obj) {
+      retain();
+    }
+
+    IntrusiveRefCntPtr(const IntrusiveRefCntPtr& S) : Obj(S.Obj) {
+      retain();
+    }
+
+    IntrusiveRefCntPtr(IntrusiveRefCntPtr&& S) : Obj(S.Obj) {
+      S.Obj = nullptr;
+    }
+
+    template <class X>
+    IntrusiveRefCntPtr(IntrusiveRefCntPtr<X>&& S) : Obj(S.get()) {
+      S.Obj = nullptr;
+    }
+
+    template <class X>
+    IntrusiveRefCntPtr(const IntrusiveRefCntPtr<X>& S)
+      : Obj(S.get()) {
+      retain();
+    }
+
+    IntrusiveRefCntPtr& operator=(IntrusiveRefCntPtr S) {
+      swap(S);
+      return *this;
+    }
+
+    ~IntrusiveRefCntPtr() { release(); }
+
+    T& operator*() const { return *Obj; }
+
+    T* operator->() const { return Obj; }
+
+    T* get() const { return Obj; }
+
+    explicit operator bool() const { return Obj; }
+
+    void swap(IntrusiveRefCntPtr& other) {
+      T* tmp = other.Obj;
+      other.Obj = Obj;
+      Obj = tmp;
+    }
+
+    void reset() {
+      release();
+      Obj = nullptr;
+    }
+
+    void resetWithoutRelease() {
+      Obj = nullptr;
+    }
+
+  private:
+    void retain() { if (Obj) IntrusiveRefCntPtrInfo<T>::retain(Obj); }
+    void release() { if (Obj) IntrusiveRefCntPtrInfo<T>::release(Obj); }
+
+    template <typename X>
+    friend class IntrusiveRefCntPtr;
+  };
+
+  template<class T, class U>
+  inline bool operator==(const IntrusiveRefCntPtr<T>& A,
+                         const IntrusiveRefCntPtr<U>& B)
+  {
+    return A.get() == B.get();
+  }
+
+  template<class T, class U>
+  inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
+                         const IntrusiveRefCntPtr<U>& B)
+  {
+    return A.get() != B.get();
+  }
+
+  template<class T, class U>
+  inline bool operator==(const IntrusiveRefCntPtr<T>& A,
+                         U* B)
+  {
+    return A.get() == B;
+  }
+
+  template<class T, class U>
+  inline bool operator!=(const IntrusiveRefCntPtr<T>& A,
+                         U* B)
+  {
+    return A.get() != B;
+  }
+
+  template<class T, class U>
+  inline bool operator==(T* A,
+                         const IntrusiveRefCntPtr<U>& B)
+  {
+    return A == B.get();
+  }
+
+  template<class T, class U>
+  inline bool operator!=(T* A,
+                         const IntrusiveRefCntPtr<U>& B)
+  {
+    return A != B.get();
+  }
+
+  template <class T>
+  bool operator==(std::nullptr_t A, const IntrusiveRefCntPtr<T> &B) {
+    return !B;
+  }
+
+  template <class T>
+  bool operator==(const IntrusiveRefCntPtr<T> &A, std::nullptr_t B) {
+    return B == A;
+  }
+
+  template <class T>
+  bool operator!=(std::nullptr_t A, const IntrusiveRefCntPtr<T> &B) {
+    return !(A == B);
+  }
+
+  template <class T>
+  bool operator!=(const IntrusiveRefCntPtr<T> &A, std::nullptr_t B) {
+    return !(A == B);
+  }
+
+//===----------------------------------------------------------------------===//
+// LLVM-style downcasting support for IntrusiveRefCntPtr objects
+//===----------------------------------------------------------------------===//
+
+  template <typename From> struct simplify_type;
+
+  template<class T> struct simplify_type<IntrusiveRefCntPtr<T> > {
+    typedef T* SimpleType;
+    static SimpleType getSimplifiedValue(IntrusiveRefCntPtr<T>& Val) {
+      return Val.get();
+    }
+  };
+
+  template<class T> struct simplify_type<const IntrusiveRefCntPtr<T> > {
+    typedef /*const*/ T* SimpleType;
+    static SimpleType getSimplifiedValue(const IntrusiveRefCntPtr<T>& Val) {
+      return Val.get();
+    }
+  };
+
+} // end namespace llvm
+
+#endif // LLVM_ADT_INTRUSIVEREFCNTPTR_H
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/MathExtras.h b/third_party/wpiutil_2018/src/main/native/include/llvm/MathExtras.h
new file mode 100644
index 0000000..a8258ba
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/MathExtras.h
@@ -0,0 +1,653 @@
+//===-- llvm/Support/MathExtras.h - Useful math functions -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains some functions that are useful for math stuff.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_MATHEXTRAS_H
+#define LLVM_SUPPORT_MATHEXTRAS_H
+
+#include "llvm/Compiler.h"
+#include <cstdint>
+#include <algorithm>
+#include <cassert>
+#include <cmath>
+#include <cstring>
+#include <type_traits>
+#include <limits>
+
+#ifdef _MSC_VER
+#include <intrin.h>
+#endif
+
+namespace llvm {
+/// \brief The behavior an operation has on an input of 0.
+enum ZeroBehavior {
+  /// \brief The returned value is undefined.
+  ZB_Undefined,
+  /// \brief The returned value is numeric_limits<T>::max()
+  ZB_Max,
+  /// \brief The returned value is numeric_limits<T>::digits
+  ZB_Width
+};
+
+namespace detail {
+template <typename T, std::size_t SizeOfT> struct LeadingZerosCounter {
+  static std::size_t count(T Val, ZeroBehavior) {
+    if (!Val)
+      return std::numeric_limits<T>::digits;
+
+    // Bisection method.
+    std::size_t ZeroBits = 0;
+    for (T Shift = std::numeric_limits<T>::digits >> 1; Shift; Shift >>= 1) {
+      T Tmp = Val >> Shift;
+      if (Tmp)
+        Val = Tmp;
+      else
+        ZeroBits |= Shift;
+    }
+    return ZeroBits;
+  }
+};
+
+#if __GNUC__ >= 4 || defined(_MSC_VER)
+template <typename T> struct LeadingZerosCounter<T, 4> {
+  static std::size_t count(T Val, ZeroBehavior ZB) {
+    if (ZB != ZB_Undefined && Val == 0)
+      return 32;
+
+#if __has_builtin(__builtin_clz) || LLVM_GNUC_PREREQ(4, 0, 0)
+    return __builtin_clz(Val);
+#elif defined(_MSC_VER)
+    unsigned long Index;
+    _BitScanReverse(&Index, Val);
+    return Index ^ 31;
+#endif
+  }
+};
+
+#if !defined(_MSC_VER) || defined(_M_X64)
+template <typename T> struct LeadingZerosCounter<T, 8> {
+  static std::size_t count(T Val, ZeroBehavior ZB) {
+    if (ZB != ZB_Undefined && Val == 0)
+      return 64;
+
+#if __has_builtin(__builtin_clzll) || LLVM_GNUC_PREREQ(4, 0, 0)
+    return __builtin_clzll(Val);
+#elif defined(_MSC_VER)
+    unsigned long Index;
+    _BitScanReverse64(&Index, Val);
+    return Index ^ 63;
+#endif
+  }
+};
+#endif
+#endif
+} // namespace detail
+
+/// \brief Count number of 0's from the most significant bit to the least
+///   stopping at the first 1.
+///
+/// Only unsigned integral types are allowed.
+///
+/// \param ZB the behavior on an input of 0. Only ZB_Width and ZB_Undefined are
+///   valid arguments.
+template <typename T>
+std::size_t countLeadingZeros(T Val, ZeroBehavior ZB = ZB_Width) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return detail::LeadingZerosCounter<T, sizeof(T)>::count(Val, ZB);
+}
+
+/// \brief Get the index of the last set bit starting from the least
+///   significant bit.
+///
+/// Only unsigned integral types are allowed.
+///
+/// \param ZB the behavior on an input of 0. Only ZB_Max and ZB_Undefined are
+///   valid arguments.
+template <typename T> T findLastSet(T Val, ZeroBehavior ZB = ZB_Max) {
+  if (ZB == ZB_Max && Val == 0)
+    return std::numeric_limits<T>::max();
+
+  // Use ^ instead of - because both gcc and llvm can remove the associated ^
+  // in the __builtin_clz intrinsic on x86.
+  return countLeadingZeros(Val, ZB_Undefined) ^
+         (std::numeric_limits<T>::digits - 1);
+}
+
+/// \brief Macro compressed bit reversal table for 256 bits.
+///
+/// http://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable
+static const unsigned char BitReverseTable256[256] = {
+#define R2(n) n, n + 2 * 64, n + 1 * 64, n + 3 * 64
+#define R4(n) R2(n), R2(n + 2 * 16), R2(n + 1 * 16), R2(n + 3 * 16)
+#define R6(n) R4(n), R4(n + 2 * 4), R4(n + 1 * 4), R4(n + 3 * 4)
+  R6(0), R6(2), R6(1), R6(3)
+#undef R2
+#undef R4
+#undef R6
+};
+
+/// \brief Reverse the bits in \p Val.
+template <typename T>
+T reverseBits(T Val) {
+  unsigned char in[sizeof(Val)];
+  unsigned char out[sizeof(Val)];
+  std::memcpy(in, &Val, sizeof(Val));
+  for (unsigned i = 0; i < sizeof(Val); ++i)
+    out[(sizeof(Val) - i) - 1] = BitReverseTable256[in[i]];
+  std::memcpy(&Val, out, sizeof(Val));
+  return Val;
+}
+
+// NOTE: The following support functions use the _32/_64 extensions instead of
+// type overloading so that signed and unsigned integers can be used without
+// ambiguity.
+
+/// Hi_32 - This function returns the high 32 bits of a 64 bit value.
+inline uint32_t Hi_32(uint64_t Value) {
+  return static_cast<uint32_t>(Value >> 32);
+}
+
+/// Lo_32 - This function returns the low 32 bits of a 64 bit value.
+inline uint32_t Lo_32(uint64_t Value) {
+  return static_cast<uint32_t>(Value);
+}
+
+/// Make_64 - This functions makes a 64-bit integer from a high / low pair of
+///           32-bit integers.
+inline uint64_t Make_64(uint32_t High, uint32_t Low) {
+  return ((uint64_t)High << 32) | (uint64_t)Low;
+}
+
+/// isInt - Checks if an integer fits into the given bit width.
+template<unsigned N>
+inline bool isInt(int64_t x) {
+  return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)));
+}
+// Template specializations to get better code for common cases.
+template<>
+inline bool isInt<8>(int64_t x) {
+  return static_cast<int8_t>(x) == x;
+}
+template<>
+inline bool isInt<16>(int64_t x) {
+  return static_cast<int16_t>(x) == x;
+}
+template<>
+inline bool isInt<32>(int64_t x) {
+  return static_cast<int32_t>(x) == x;
+}
+
+/// isShiftedInt<N,S> - Checks if a signed integer is an N bit number shifted
+///                     left by S.
+template<unsigned N, unsigned S>
+inline bool isShiftedInt(int64_t x) {
+  return isInt<N+S>(x) && (x % (1<<S) == 0);
+}
+
+/// isUInt - Checks if an unsigned integer fits into the given bit width.
+template<unsigned N>
+inline bool isUInt(uint64_t x) {
+  return N >= 64 || x < (UINT64_C(1)<<(N));
+}
+// Template specializations to get better code for common cases.
+template<>
+inline bool isUInt<8>(uint64_t x) {
+  return static_cast<uint8_t>(x) == x;
+}
+template<>
+inline bool isUInt<16>(uint64_t x) {
+  return static_cast<uint16_t>(x) == x;
+}
+template<>
+inline bool isUInt<32>(uint64_t x) {
+  return static_cast<uint32_t>(x) == x;
+}
+
+/// isShiftedUInt<N,S> - Checks if a unsigned integer is an N bit number shifted
+///                     left by S.
+template<unsigned N, unsigned S>
+inline bool isShiftedUInt(uint64_t x) {
+  return isUInt<N+S>(x) && (x % (1<<S) == 0);
+}
+
+/// Gets the maximum value for a N-bit unsigned integer.
+inline uint64_t maxUIntN(uint64_t N) {
+  assert(N > 0 && N <= 64 && "integer width out of range");
+
+  return (UINT64_C(1) << N) - 1;
+}
+
+/// Gets the minimum value for a N-bit signed integer.
+inline int64_t minIntN(int64_t N) {
+  assert(N > 0 && N <= 64 && "integer width out of range");
+
+  return -(INT64_C(1)<<(N-1));
+}
+
+/// Gets the maximum value for a N-bit signed integer.
+inline int64_t maxIntN(int64_t N) {
+  assert(N > 0 && N <= 64 && "integer width out of range");
+
+  return (INT64_C(1)<<(N-1)) - 1;
+}
+
+/// isUIntN - Checks if an unsigned integer fits into the given (dynamic)
+/// bit width.
+inline bool isUIntN(unsigned N, uint64_t x) {
+  return N >= 64 || x <= maxUIntN(N);
+}
+
+/// isIntN - Checks if an signed integer fits into the given (dynamic)
+/// bit width.
+inline bool isIntN(unsigned N, int64_t x) {
+  return N >= 64 || (minIntN(N) <= x && x <= maxIntN(N));
+}
+
+/// isMask_32 - This function returns true if the argument is a non-empty
+/// sequence of ones starting at the least significant bit with the remainder
+/// zero (32 bit version).  Ex. isMask_32(0x0000FFFFU) == true.
+inline bool isMask_32(uint32_t Value) {
+  return Value && ((Value + 1) & Value) == 0;
+}
+
+/// isMask_64 - This function returns true if the argument is a non-empty
+/// sequence of ones starting at the least significant bit with the remainder
+/// zero (64 bit version).
+inline bool isMask_64(uint64_t Value) {
+  return Value && ((Value + 1) & Value) == 0;
+}
+
+/// isShiftedMask_32 - This function returns true if the argument contains a
+/// non-empty sequence of ones with the remainder zero (32 bit version.)
+/// Ex. isShiftedMask_32(0x0000FF00U) == true.
+inline bool isShiftedMask_32(uint32_t Value) {
+  return Value && isMask_32((Value - 1) | Value);
+}
+
+/// isShiftedMask_64 - This function returns true if the argument contains a
+/// non-empty sequence of ones with the remainder zero (64 bit version.)
+inline bool isShiftedMask_64(uint64_t Value) {
+  return Value && isMask_64((Value - 1) | Value);
+}
+
+/// isPowerOf2_32 - This function returns true if the argument is a power of
+/// two > 0. Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.)
+inline bool isPowerOf2_32(uint32_t Value) {
+  return Value && !(Value & (Value - 1));
+}
+
+/// isPowerOf2_64 - This function returns true if the argument is a power of two
+/// > 0 (64 bit edition.)
+inline bool isPowerOf2_64(uint64_t Value) {
+  return Value && !(Value & (Value - int64_t(1L)));
+}
+
+/// \brief Count the number of ones from the most significant bit to the first
+/// zero bit.
+///
+/// Ex. CountLeadingOnes(0xFF0FFF00) == 8.
+/// Only unsigned integral types are allowed.
+///
+/// \param ZB the behavior on an input of all ones. Only ZB_Width and
+/// ZB_Undefined are valid arguments.
+template <typename T>
+std::size_t countLeadingOnes(T Value, ZeroBehavior ZB = ZB_Width) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return countLeadingZeros(~Value, ZB);
+}
+
+namespace detail {
+template <typename T, std::size_t SizeOfT> struct PopulationCounter {
+  static unsigned count(T Value) {
+    // Generic version, forward to 32 bits.
+    static_assert(SizeOfT <= 4, "Not implemented!");
+#if __GNUC__ >= 4
+    return __builtin_popcount(Value);
+#else
+    uint32_t v = Value;
+    v = v - ((v >> 1) & 0x55555555);
+    v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
+    return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
+#endif
+  }
+};
+
+template <typename T> struct PopulationCounter<T, 8> {
+  static unsigned count(T Value) {
+#if __GNUC__ >= 4
+    return __builtin_popcountll(Value);
+#else
+    uint64_t v = Value;
+    v = v - ((v >> 1) & 0x5555555555555555ULL);
+    v = (v & 0x3333333333333333ULL) + ((v >> 2) & 0x3333333333333333ULL);
+    v = (v + (v >> 4)) & 0x0F0F0F0F0F0F0F0FULL;
+    return unsigned((uint64_t)(v * 0x0101010101010101ULL) >> 56);
+#endif
+  }
+};
+} // namespace detail
+
+/// \brief Count the number of set bits in a value.
+/// Ex. countPopulation(0xF000F000) = 8
+/// Returns 0 if the word is zero.
+template <typename T>
+inline unsigned countPopulation(T Value) {
+  static_assert(std::numeric_limits<T>::is_integer &&
+                    !std::numeric_limits<T>::is_signed,
+                "Only unsigned integral types are allowed.");
+  return detail::PopulationCounter<T, sizeof(T)>::count(Value);
+}
+
+/// Log2 - This function returns the log base 2 of the specified value
+inline double Log2(double Value) {
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 18
+  return __builtin_log(Value) / __builtin_log(2.0);
+#else
+  return std::log2(Value);
+#endif
+}
+
+/// Log2_32 - This function returns the floor log base 2 of the specified value,
+/// -1 if the value is zero. (32 bit edition.)
+/// Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2
+inline unsigned Log2_32(uint32_t Value) {
+  return 31 - countLeadingZeros(Value);
+}
+
+/// Log2_64 - This function returns the floor log base 2 of the specified value,
+/// -1 if the value is zero. (64 bit edition.)
+inline unsigned Log2_64(uint64_t Value) {
+  return 63 - countLeadingZeros(Value);
+}
+
+/// Log2_32_Ceil - This function returns the ceil log base 2 of the specified
+/// value, 32 if the value is zero. (32 bit edition).
+/// Ex. Log2_32_Ceil(32) == 5, Log2_32_Ceil(1) == 0, Log2_32_Ceil(6) == 3
+inline unsigned Log2_32_Ceil(uint32_t Value) {
+  return 32 - countLeadingZeros(Value - 1);
+}
+
+/// Log2_64_Ceil - This function returns the ceil log base 2 of the specified
+/// value, 64 if the value is zero. (64 bit edition.)
+inline unsigned Log2_64_Ceil(uint64_t Value) {
+  return 64 - countLeadingZeros(Value - 1);
+}
+
+/// GreatestCommonDivisor64 - Return the greatest common divisor of the two
+/// values using Euclid's algorithm.
+inline uint64_t GreatestCommonDivisor64(uint64_t A, uint64_t B) {
+  while (B) {
+    uint64_t T = B;
+    B = A % B;
+    A = T;
+  }
+  return A;
+}
+
+/// BitsToDouble - This function takes a 64-bit integer and returns the bit
+/// equivalent double.
+inline double BitsToDouble(uint64_t Bits) {
+  union {
+    uint64_t L;
+    double D;
+  } T;
+  T.L = Bits;
+  return T.D;
+}
+
+/// BitsToFloat - This function takes a 32-bit integer and returns the bit
+/// equivalent float.
+inline float BitsToFloat(uint32_t Bits) {
+  union {
+    uint32_t I;
+    float F;
+  } T;
+  T.I = Bits;
+  return T.F;
+}
+
+/// DoubleToBits - This function takes a double and returns the bit
+/// equivalent 64-bit integer.  Note that copying doubles around
+/// changes the bits of NaNs on some hosts, notably x86, so this
+/// routine cannot be used if these bits are needed.
+inline uint64_t DoubleToBits(double Double) {
+  union {
+    uint64_t L;
+    double D;
+  } T;
+  T.D = Double;
+  return T.L;
+}
+
+/// FloatToBits - This function takes a float and returns the bit
+/// equivalent 32-bit integer.  Note that copying floats around
+/// changes the bits of NaNs on some hosts, notably x86, so this
+/// routine cannot be used if these bits are needed.
+inline uint32_t FloatToBits(float Float) {
+  union {
+    uint32_t I;
+    float F;
+  } T;
+  T.F = Float;
+  return T.I;
+}
+
+/// MinAlign - A and B are either alignments or offsets.  Return the minimum
+/// alignment that may be assumed after adding the two together.
+inline uint64_t MinAlign(uint64_t A, uint64_t B) {
+  // The largest power of 2 that divides both A and B.
+  //
+  // Replace "-Value" by "1+~Value" in the following commented code to avoid
+  // MSVC warning C4146
+  //    return (A | B) & -(A | B);
+  return (A | B) & (1 + ~(A | B));
+}
+
+/// \brief Aligns \c Addr to \c Alignment bytes, rounding up.
+///
+/// Alignment should be a power of two.  This method rounds up, so
+/// alignAddr(7, 4) == 8 and alignAddr(8, 4) == 8.
+inline uintptr_t alignAddr(const void *Addr, size_t Alignment) {
+  assert(Alignment && isPowerOf2_64((uint64_t)Alignment) &&
+         "Alignment is not a power of two!");
+
+  assert((uintptr_t)Addr + Alignment - 1 >= (uintptr_t)Addr);
+
+  return (((uintptr_t)Addr + Alignment - 1) & ~(uintptr_t)(Alignment - 1));
+}
+
+/// \brief Returns the necessary adjustment for aligning \c Ptr to \c Alignment
+/// bytes, rounding up.
+inline size_t alignmentAdjustment(const void *Ptr, size_t Alignment) {
+  return alignAddr(Ptr, Alignment) - (uintptr_t)Ptr;
+}
+
+/// NextPowerOf2 - Returns the next power of two (in 64-bits)
+/// that is strictly greater than A.  Returns zero on overflow.
+inline uint64_t NextPowerOf2(uint64_t A) {
+  A |= (A >> 1);
+  A |= (A >> 2);
+  A |= (A >> 4);
+  A |= (A >> 8);
+  A |= (A >> 16);
+  A |= (A >> 32);
+  return A + 1;
+}
+
+/// Returns the power of two which is less than or equal to the given value.
+/// Essentially, it is a floor operation across the domain of powers of two.
+inline uint64_t PowerOf2Floor(uint64_t A) {
+  if (!A) return 0;
+  return 1ull << (63 - countLeadingZeros(A, ZB_Undefined));
+}
+
+/// Returns the next integer (mod 2**64) that is greater than or equal to
+/// \p Value and is a multiple of \p Align. \p Align must be non-zero.
+///
+/// If non-zero \p Skew is specified, the return value will be a minimal
+/// integer that is greater than or equal to \p Value and equal to
+/// \p Align * N + \p Skew for some integer N. If \p Skew is larger than
+/// \p Align, its value is adjusted to '\p Skew mod \p Align'.
+///
+/// Examples:
+/// \code
+///   alignTo(5, 8) = 8
+///   alignTo(17, 8) = 24
+///   alignTo(~0LL, 8) = 0
+///   alignTo(321, 255) = 510
+///
+///   alignTo(5, 8, 7) = 7
+///   alignTo(17, 8, 1) = 17
+///   alignTo(~0LL, 8, 3) = 3
+///   alignTo(321, 255, 42) = 552
+/// \endcode
+inline uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
+  Skew %= Align;
+  return (Value + Align - 1 - Skew) / Align * Align + Skew;
+}
+
+/// Returns the largest uint64_t less than or equal to \p Value and is
+/// \p Skew mod \p Align. \p Align must be non-zero
+inline uint64_t alignDown(uint64_t Value, uint64_t Align, uint64_t Skew = 0) {
+  Skew %= Align;
+  return (Value - Skew) / Align * Align + Skew;
+}
+
+/// Returns the offset to the next integer (mod 2**64) that is greater than
+/// or equal to \p Value and is a multiple of \p Align. \p Align must be
+/// non-zero.
+inline uint64_t OffsetToAlignment(uint64_t Value, uint64_t Align) {
+  return alignTo(Value, Align) - Value;
+}
+
+/// SignExtend32 - Sign extend B-bit number x to 32-bit int.
+/// Usage int32_t r = SignExtend32<5>(x);
+template <unsigned B> inline int32_t SignExtend32(uint32_t x) {
+  return int32_t(x << (32 - B)) >> (32 - B);
+}
+
+/// \brief Sign extend number in the bottom B bits of X to a 32-bit int.
+/// Requires 0 < B <= 32.
+inline int32_t SignExtend32(uint32_t X, unsigned B) {
+  return int32_t(X << (32 - B)) >> (32 - B);
+}
+
+/// SignExtend64 - Sign extend B-bit number x to 64-bit int.
+/// Usage int64_t r = SignExtend64<5>(x);
+template <unsigned B> inline int64_t SignExtend64(uint64_t x) {
+  return int64_t(x << (64 - B)) >> (64 - B);
+}
+
+/// \brief Sign extend number in the bottom B bits of X to a 64-bit int.
+/// Requires 0 < B <= 64.
+inline int64_t SignExtend64(uint64_t X, unsigned B) {
+  return int64_t(X << (64 - B)) >> (64 - B);
+}
+
+/// \brief Subtract two unsigned integers, X and Y, of type T and return their
+/// absolute value.
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+AbsoluteDifference(T X, T Y) {
+  return std::max(X, Y) - std::min(X, Y);
+}
+
+/// \brief Add two unsigned integers, X and Y, of type T.
+/// Clamp the result to the maximum representable value of T on overflow.
+/// ResultOverflowed indicates if the result is larger than the maximum
+/// representable value of type T.
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+SaturatingAdd(T X, T Y, bool *ResultOverflowed = nullptr) {
+  bool Dummy;
+  bool &Overflowed = ResultOverflowed ? *ResultOverflowed : Dummy;
+  // Hacker's Delight, p. 29
+  T Z = X + Y;
+  Overflowed = (Z < X || Z < Y);
+  if (Overflowed)
+    return std::numeric_limits<T>::max();
+  else
+    return Z;
+}
+
+/// \brief Multiply two unsigned integers, X and Y, of type T.
+/// Clamp the result to the maximum representable value of T on overflow.
+/// ResultOverflowed indicates if the result is larger than the maximum
+/// representable value of type T.
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+SaturatingMultiply(T X, T Y, bool *ResultOverflowed = nullptr) {
+  bool Dummy;
+  bool &Overflowed = ResultOverflowed ? *ResultOverflowed : Dummy;
+
+  // Hacker's Delight, p. 30 has a different algorithm, but we don't use that
+  // because it fails for uint16_t (where multiplication can have undefined
+  // behavior due to promotion to int), and requires a division in addition
+  // to the multiplication.
+
+  Overflowed = false;
+
+  // Log2(Z) would be either Log2Z or Log2Z + 1.
+  // Special case: if X or Y is 0, Log2_64 gives -1, and Log2Z
+  // will necessarily be less than Log2Max as desired.
+  int Log2Z = Log2_64(X) + Log2_64(Y);
+  const T Max = std::numeric_limits<T>::max();
+  int Log2Max = Log2_64(Max);
+  if (Log2Z < Log2Max) {
+    return X * Y;
+  }
+  if (Log2Z > Log2Max) {
+    Overflowed = true;
+    return Max;
+  }
+
+  // We're going to use the top bit, and maybe overflow one
+  // bit past it. Multiply all but the bottom bit then add
+  // that on at the end.
+  T Z = (X >> 1) * Y;
+  if (Z & ~(Max >> 1)) {
+    Overflowed = true;
+    return Max;
+  }
+  Z <<= 1;
+  if (X & 1)
+    return SaturatingAdd(Z, Y, ResultOverflowed);
+
+  return Z;
+}
+
+/// \brief Multiply two unsigned integers, X and Y, and add the unsigned
+/// integer, A to the product. Clamp the result to the maximum representable
+/// value of T on overflow. ResultOverflowed indicates if the result is larger
+/// than the maximum representable value of type T.
+/// Note that this is purely a convenience function as there is no distinction
+/// where overflow occurred in a 'fused' multiply-add for unsigned numbers.
+template <typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+SaturatingMultiplyAdd(T X, T Y, T A, bool *ResultOverflowed = nullptr) {
+  bool Dummy;
+  bool &Overflowed = ResultOverflowed ? *ResultOverflowed : Dummy;
+
+  T Product = SaturatingMultiply(X, Y, &Overflowed);
+  if (Overflowed)
+    return Product;
+
+  return SaturatingAdd(A, Product, &Overflowed);
+}
+
+} // namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/None.h b/third_party/wpiutil_2018/src/main/native/include/llvm/None.h
new file mode 100644
index 0000000..d69ec17
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/None.h
@@ -0,0 +1,26 @@
+//===-- None.h - Simple null value for implicit construction ------*- C++ -*-=//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file provides None, an enumerator for use in implicit constructors
+//  of various (usually templated) types to make such construction more
+//  terse.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_NONE_H
+#define LLVM_ADT_NONE_H
+
+namespace llvm {
+/// \brief A simple null object to allow implicit construction of Optional<T>
+/// and similar types without having to spell out the specialization's name.
+enum class NoneType { None };
+const NoneType None = None;
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/Optional.h b/third_party/wpiutil_2018/src/main/native/include/llvm/Optional.h
new file mode 100644
index 0000000..a494c56
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/Optional.h
@@ -0,0 +1,228 @@
+//===-- Optional.h - Simple variant for passing optional values ---*- C++ -*-=//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file provides Optional, a template class modeled in the spirit of
+//  OCaml's 'opt' variant.  The idea is to strongly type whether or not
+//  a value can be optional.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_OPTIONAL_H
+#define LLVM_ADT_OPTIONAL_H
+
+#include "llvm/None.h"
+#include "llvm/AlignOf.h"
+#include "llvm/Compiler.h"
+#include <cassert>
+#include <new>
+#include <utility>
+
+namespace llvm {
+
+template<typename T>
+class Optional {
+  AlignedCharArrayUnion<T> storage;
+  bool hasVal;
+public:
+  typedef T value_type;
+
+  Optional(NoneType) : hasVal(false) {}
+  explicit Optional() : hasVal(false) {}
+  Optional(const T &y) : hasVal(true) {
+    new (storage.buffer) T(y);
+  }
+  Optional(const Optional &O) : hasVal(O.hasVal) {
+    if (hasVal)
+      new (storage.buffer) T(*O);
+  }
+
+  Optional(T &&y) : hasVal(true) {
+    new (storage.buffer) T(std::forward<T>(y));
+  }
+  Optional(Optional<T> &&O) : hasVal(O) {
+    if (O) {
+      new (storage.buffer) T(std::move(*O));
+      O.reset();
+    }
+  }
+  Optional &operator=(T &&y) {
+    if (hasVal)
+      **this = std::move(y);
+    else {
+      new (storage.buffer) T(std::move(y));
+      hasVal = true;
+    }
+    return *this;
+  }
+  Optional &operator=(Optional &&O) {
+    if (!O)
+      reset();
+    else {
+      *this = std::move(*O);
+      O.reset();
+    }
+    return *this;
+  }
+
+  /// Create a new object by constructing it in place with the given arguments.
+  template<typename ...ArgTypes>
+  void emplace(ArgTypes &&...Args) {
+    reset();
+    hasVal = true;
+    new (storage.buffer) T(std::forward<ArgTypes>(Args)...);
+  }
+
+  static inline Optional create(const T* y) {
+    return y ? Optional(*y) : Optional();
+  }
+
+  // FIXME: these assignments (& the equivalent const T&/const Optional& ctors)
+  // could be made more efficient by passing by value, possibly unifying them
+  // with the rvalue versions above - but this could place a different set of
+  // requirements (notably: the existence of a default ctor) when implemented
+  // in that way. Careful SFINAE to avoid such pitfalls would be required.
+  Optional &operator=(const T &y) {
+    if (hasVal)
+      **this = y;
+    else {
+      new (storage.buffer) T(y);
+      hasVal = true;
+    }
+    return *this;
+  }
+
+  Optional &operator=(const Optional &O) {
+    if (!O)
+      reset();
+    else
+      *this = *O;
+    return *this;
+  }
+
+  void reset() {
+    if (hasVal) {
+      (**this).~T();
+      hasVal = false;
+    }
+  }
+
+  ~Optional() {
+    reset();
+  }
+
+  const T* getPointer() const { assert(hasVal); return reinterpret_cast<const T*>(storage.buffer); }
+  T* getPointer() { assert(hasVal); return reinterpret_cast<T*>(storage.buffer); }
+  const T& getValue() const LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
+  T& getValue() LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
+
+  explicit operator bool() const { return hasVal; }
+  bool hasValue() const { return hasVal; }
+  const T* operator->() const { return getPointer(); }
+  T* operator->() { return getPointer(); }
+  const T& operator*() const LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
+  T& operator*() LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); }
+
+  template <typename U>
+  LLVM_CONSTEXPR T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION {
+    return hasValue() ? getValue() : std::forward<U>(value);
+  }
+
+#if LLVM_HAS_RVALUE_REFERENCE_THIS
+  T&& getValue() && { assert(hasVal); return std::move(*getPointer()); }
+  T&& operator*() && { assert(hasVal); return std::move(*getPointer()); }
+
+  template <typename U>
+  T getValueOr(U &&value) && {
+    return hasValue() ? std::move(getValue()) : std::forward<U>(value);
+  }
+#endif
+};
+
+template <typename T> struct isPodLike;
+template <typename T> struct isPodLike<Optional<T> > {
+  // An Optional<T> is pod-like if T is.
+  static const bool value = isPodLike<T>::value;
+};
+
+/// \brief Poison comparison between two \c Optional objects. Clients needs to
+/// explicitly compare the underlying values and account for empty \c Optional
+/// objects.
+///
+/// This routine will never be defined. It returns \c void to help diagnose
+/// errors at compile time.
+template<typename T, typename U>
+void operator==(const Optional<T> &X, const Optional<U> &Y);
+
+template<typename T>
+bool operator==(const Optional<T> &X, NoneType) {
+  return !X.hasValue();
+}
+
+template<typename T>
+bool operator==(NoneType, const Optional<T> &X) {
+  return X == None;
+}
+
+template<typename T>
+bool operator!=(const Optional<T> &X, NoneType) {
+  return !(X == None);
+}
+
+template<typename T>
+bool operator!=(NoneType, const Optional<T> &X) {
+  return X != None;
+}
+/// \brief Poison comparison between two \c Optional objects. Clients needs to
+/// explicitly compare the underlying values and account for empty \c Optional
+/// objects.
+///
+/// This routine will never be defined. It returns \c void to help diagnose
+/// errors at compile time.
+template<typename T, typename U>
+void operator!=(const Optional<T> &X, const Optional<U> &Y);
+
+/// \brief Poison comparison between two \c Optional objects. Clients needs to
+/// explicitly compare the underlying values and account for empty \c Optional
+/// objects.
+///
+/// This routine will never be defined. It returns \c void to help diagnose
+/// errors at compile time.
+template<typename T, typename U>
+void operator<(const Optional<T> &X, const Optional<U> &Y);
+
+/// \brief Poison comparison between two \c Optional objects. Clients needs to
+/// explicitly compare the underlying values and account for empty \c Optional
+/// objects.
+///
+/// This routine will never be defined. It returns \c void to help diagnose
+/// errors at compile time.
+template<typename T, typename U>
+void operator<=(const Optional<T> &X, const Optional<U> &Y);
+
+/// \brief Poison comparison between two \c Optional objects. Clients needs to
+/// explicitly compare the underlying values and account for empty \c Optional
+/// objects.
+///
+/// This routine will never be defined. It returns \c void to help diagnose
+/// errors at compile time.
+template<typename T, typename U>
+void operator>=(const Optional<T> &X, const Optional<U> &Y);
+
+/// \brief Poison comparison between two \c Optional objects. Clients needs to
+/// explicitly compare the underlying values and account for empty \c Optional
+/// objects.
+///
+/// This routine will never be defined. It returns \c void to help diagnose
+/// errors at compile time.
+template<typename T, typename U>
+void operator>(const Optional<T> &X, const Optional<U> &Y);
+
+} // end llvm namespace
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/Path.h b/third_party/wpiutil_2018/src/main/native/include/llvm/Path.h
new file mode 100644
index 0000000..1431c47
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/Path.h
@@ -0,0 +1,457 @@
+//===- llvm/Support/Path.h - Path Operating System Concept ------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file declares the llvm::sys::path namespace. It is designed after
+// TR2/boost filesystem (v3), but modified to remove exception handling and the
+// path class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_PATH_H
+#define LLVM_SUPPORT_PATH_H
+
+#include "llvm/Twine.h"
+#include <iterator>
+
+#include <stdint.h>
+
+namespace llvm {
+namespace sys {
+namespace path {
+
+/// @name Lexical Component Iterator
+/// @{
+
+/// @brief Path iterator.
+///
+/// This is an input iterator that iterates over the individual components in
+/// \a path. The traversal order is as follows:
+/// * The root-name element, if present.
+/// * The root-directory element, if present.
+/// * Each successive filename element, if present.
+/// * Dot, if one or more trailing non-root slash characters are present.
+/// Traversing backwards is possible with \a reverse_iterator
+///
+/// Iteration examples. Each component is separated by ',':
+/// @code
+///   /          => /
+///   /foo       => /,foo
+///   foo/       => foo,.
+///   /foo/bar   => /,foo,bar
+///   ../        => ..,.
+///   C:\foo\bar => C:,/,foo,bar
+/// @endcode
+class const_iterator
+    : public std::iterator<std::input_iterator_tag, const StringRef> {
+  StringRef Path;      ///< The entire path.
+  StringRef Component; ///< The current component. Not necessarily in Path.
+  size_t    Position;  ///< The iterators current position within Path.
+
+  // An end iterator has Position = Path.size() + 1.
+  friend const_iterator begin(StringRef path);
+  friend const_iterator end(StringRef path);
+
+public:
+  reference operator*() const { return Component; }
+  pointer   operator->() const { return &Component; }
+  const_iterator &operator++();    // preincrement
+  bool operator==(const const_iterator &RHS) const;
+  bool operator!=(const const_iterator &RHS) const { return !(*this == RHS); }
+
+  /// @brief Difference in bytes between this and RHS.
+  ptrdiff_t operator-(const const_iterator &RHS) const;
+};
+
+/// @brief Reverse path iterator.
+///
+/// This is an input iterator that iterates over the individual components in
+/// \a path in reverse order. The traversal order is exactly reversed from that
+/// of \a const_iterator
+class reverse_iterator
+    : public std::iterator<std::input_iterator_tag, const StringRef> {
+  StringRef Path;      ///< The entire path.
+  StringRef Component; ///< The current component. Not necessarily in Path.
+  size_t    Position;  ///< The iterators current position within Path.
+
+  friend reverse_iterator rbegin(StringRef path);
+  friend reverse_iterator rend(StringRef path);
+
+public:
+  reference operator*() const { return Component; }
+  pointer   operator->() const { return &Component; }
+  reverse_iterator &operator++();    // preincrement
+  bool operator==(const reverse_iterator &RHS) const;
+  bool operator!=(const reverse_iterator &RHS) const { return !(*this == RHS); }
+
+  /// @brief Difference in bytes between this and RHS.
+  ptrdiff_t operator-(const reverse_iterator &RHS) const;
+};
+
+/// @brief Get begin iterator over \a path.
+/// @param path Input path.
+/// @returns Iterator initialized with the first component of \a path.
+const_iterator begin(StringRef path);
+
+/// @brief Get end iterator over \a path.
+/// @param path Input path.
+/// @returns Iterator initialized to the end of \a path.
+const_iterator end(StringRef path);
+
+/// @brief Get reverse begin iterator over \a path.
+/// @param path Input path.
+/// @returns Iterator initialized with the first reverse component of \a path.
+reverse_iterator rbegin(StringRef path);
+
+/// @brief Get reverse end iterator over \a path.
+/// @param path Input path.
+/// @returns Iterator initialized to the reverse end of \a path.
+reverse_iterator rend(StringRef path);
+
+/// @}
+/// @name Lexical Modifiers
+/// @{
+
+/// @brief Remove the last component from \a path unless it is the root dir.
+///
+/// @code
+///   directory/filename.cpp => directory/
+///   directory/             => directory
+///   filename.cpp           => <empty>
+///   /                      => /
+/// @endcode
+///
+/// @param path A path that is modified to not have a file component.
+void remove_filename(SmallVectorImpl<char> &path);
+
+/// @brief Replace the file extension of \a path with \a extension.
+///
+/// @code
+///   ./filename.cpp => ./filename.extension
+///   ./filename     => ./filename.extension
+///   ./             => ./.extension
+/// @endcode
+///
+/// @param path A path that has its extension replaced with \a extension.
+/// @param extension The extension to be added. It may be empty. It may also
+///                  optionally start with a '.', if it does not, one will be
+///                  prepended.
+void replace_extension(SmallVectorImpl<char> &path, const Twine &extension);
+
+/// @brief Replace matching path prefix with another path.
+///
+/// @code
+///   /foo, /old, /new => /foo
+///   /old/foo, /old, /new => /new/foo
+///   /foo, <empty>, /new => /new/foo
+///   /old/foo, /old, <empty> => /foo
+/// @endcode
+///
+/// @param Path If \a Path starts with \a OldPrefix modify to instead
+///        start with \a NewPrefix.
+/// @param OldPrefix The path prefix to strip from \a Path.
+/// @param NewPrefix The path prefix to replace \a NewPrefix with.
+void replace_path_prefix(SmallVectorImpl<char> &Path,
+                         const StringRef &OldPrefix,
+                         const StringRef &NewPrefix);
+
+/// @brief Append to path.
+///
+/// @code
+///   /foo  + bar/f => /foo/bar/f
+///   /foo/ + bar/f => /foo/bar/f
+///   foo   + bar/f => foo/bar/f
+/// @endcode
+///
+/// @param path Set to \a path + \a component.
+/// @param a The component to be appended to \a path.
+void append(SmallVectorImpl<char> &path, const Twine &a,
+                                         const Twine &b = "",
+                                         const Twine &c = "",
+                                         const Twine &d = "");
+
+/// @brief Append to path.
+///
+/// @code
+///   /foo  + [bar,f] => /foo/bar/f
+///   /foo/ + [bar,f] => /foo/bar/f
+///   foo   + [bar,f] => foo/bar/f
+/// @endcode
+///
+/// @param path Set to \a path + [\a begin, \a end).
+/// @param begin Start of components to append.
+/// @param end One past the end of components to append.
+void append(SmallVectorImpl<char> &path,
+            const_iterator begin, const_iterator end);
+
+/// @}
+/// @name Transforms (or some other better name)
+/// @{
+
+/// Convert path to the native form. This is used to give paths to users and
+/// operating system calls in the platform's normal way. For example, on Windows
+/// all '/' are converted to '\'.
+///
+/// @param path A path that is transformed to native format.
+/// @param result Holds the result of the transformation.
+void native(const Twine &path, SmallVectorImpl<char> &result);
+
+/// Convert path to the native form in place. This is used to give paths to
+/// users and operating system calls in the platform's normal way. For example,
+/// on Windows all '/' are converted to '\'.
+///
+/// @param path A path that is transformed to native format.
+void native(SmallVectorImpl<char> &path);
+
+/// @}
+/// @name Lexical Observers
+/// @{
+
+/// @brief Get root name.
+///
+/// @code
+///   //net/hello => //net
+///   c:/hello    => c: (on Windows, on other platforms nothing)
+///   /hello      => <empty>
+/// @endcode
+///
+/// @param path Input path.
+/// @result The root name of \a path if it has one, otherwise "".
+StringRef root_name(StringRef path);
+
+/// @brief Get root directory.
+///
+/// @code
+///   /goo/hello => /
+///   c:/hello   => /
+///   d/file.txt => <empty>
+/// @endcode
+///
+/// @param path Input path.
+/// @result The root directory of \a path if it has one, otherwise
+///               "".
+StringRef root_directory(StringRef path);
+
+/// @brief Get root path.
+///
+/// Equivalent to root_name + root_directory.
+///
+/// @param path Input path.
+/// @result The root path of \a path if it has one, otherwise "".
+StringRef root_path(StringRef path);
+
+/// @brief Get relative path.
+///
+/// @code
+///   C:\hello\world => hello\world
+///   foo/bar        => foo/bar
+///   /foo/bar       => foo/bar
+/// @endcode
+///
+/// @param path Input path.
+/// @result The path starting after root_path if one exists, otherwise "".
+StringRef relative_path(StringRef path);
+
+/// @brief Get parent path.
+///
+/// @code
+///   /          => <empty>
+///   /foo       => /
+///   foo/../bar => foo/..
+/// @endcode
+///
+/// @param path Input path.
+/// @result The parent path of \a path if one exists, otherwise "".
+StringRef parent_path(StringRef path);
+
+/// @brief Get filename.
+///
+/// @code
+///   /foo.txt    => foo.txt
+///   .          => .
+///   ..         => ..
+///   /          => /
+/// @endcode
+///
+/// @param path Input path.
+/// @result The filename part of \a path. This is defined as the last component
+///         of \a path.
+StringRef filename(StringRef path);
+
+/// @brief Get stem.
+///
+/// If filename contains a dot but not solely one or two dots, result is the
+/// substring of filename ending at (but not including) the last dot. Otherwise
+/// it is filename.
+///
+/// @code
+///   /foo/bar.txt => bar
+///   /foo/bar     => bar
+///   /foo/.txt    => <empty>
+///   /foo/.       => .
+///   /foo/..      => ..
+/// @endcode
+///
+/// @param path Input path.
+/// @result The stem of \a path.
+StringRef stem(StringRef path);
+
+/// @brief Get extension.
+///
+/// If filename contains a dot but not solely one or two dots, result is the
+/// substring of filename starting at (and including) the last dot, and ending
+/// at the end of \a path. Otherwise "".
+///
+/// @code
+///   /foo/bar.txt => .txt
+///   /foo/bar     => <empty>
+///   /foo/.txt    => .txt
+/// @endcode
+///
+/// @param path Input path.
+/// @result The extension of \a path.
+StringRef extension(StringRef path);
+
+/// @brief Check whether the given char is a path separator on the host OS.
+///
+/// @param value a character
+/// @result true if \a value is a path separator character on the host OS
+bool is_separator(char value);
+
+/// @brief Return the preferred separator for this platform.
+///
+/// @result StringRef of the preferred separator, null-terminated.
+StringRef get_separator();
+
+/// @brief Get the typical temporary directory for the system, e.g.,
+/// "/var/tmp" or "C:/TEMP"
+///
+/// @param erasedOnReboot Whether to favor a path that is erased on reboot
+/// rather than one that potentially persists longer. This parameter will be
+/// ignored if the user or system has set the typical environment variable
+/// (e.g., TEMP on Windows, TMPDIR on *nix) to specify a temporary directory.
+///
+/// @param result Holds the resulting path name.
+void system_temp_directory(bool erasedOnReboot, SmallVectorImpl<char> &result);
+
+/// @brief Get the user's home directory.
+///
+/// @param result Holds the resulting path name.
+/// @result True if a home directory is set, false otherwise.
+bool home_directory(SmallVectorImpl<char> &result);
+
+/// @brief Get the user's cache directory.
+///
+/// Expect the resulting path to be a directory shared with other
+/// applications/services used by the user. Params \p Path1 to \p Path3 can be
+/// used to append additional directory names to the resulting path. Recommended
+/// pattern is <user_cache_directory>/<vendor>/<application>.
+///
+/// @param Result Holds the resulting path.
+/// @param Path1 Additional path to be appended to the user's cache directory
+/// path. "" can be used to append nothing.
+/// @param Path2 Second additional path to be appended.
+/// @param Path3 Third additional path to be appended.
+/// @result True if a cache directory path is set, false otherwise.
+bool user_cache_directory(SmallVectorImpl<char> &Result, const Twine &Path1,
+                          const Twine &Path2 = "", const Twine &Path3 = "");
+
+/// @brief Has root name?
+///
+/// root_name != ""
+///
+/// @param path Input path.
+/// @result True if the path has a root name, false otherwise.
+bool has_root_name(const Twine &path);
+
+/// @brief Has root directory?
+///
+/// root_directory != ""
+///
+/// @param path Input path.
+/// @result True if the path has a root directory, false otherwise.
+bool has_root_directory(const Twine &path);
+
+/// @brief Has root path?
+///
+/// root_path != ""
+///
+/// @param path Input path.
+/// @result True if the path has a root path, false otherwise.
+bool has_root_path(const Twine &path);
+
+/// @brief Has relative path?
+///
+/// relative_path != ""
+///
+/// @param path Input path.
+/// @result True if the path has a relative path, false otherwise.
+bool has_relative_path(const Twine &path);
+
+/// @brief Has parent path?
+///
+/// parent_path != ""
+///
+/// @param path Input path.
+/// @result True if the path has a parent path, false otherwise.
+bool has_parent_path(const Twine &path);
+
+/// @brief Has filename?
+///
+/// filename != ""
+///
+/// @param path Input path.
+/// @result True if the path has a filename, false otherwise.
+bool has_filename(const Twine &path);
+
+/// @brief Has stem?
+///
+/// stem != ""
+///
+/// @param path Input path.
+/// @result True if the path has a stem, false otherwise.
+bool has_stem(const Twine &path);
+
+/// @brief Has extension?
+///
+/// extension != ""
+///
+/// @param path Input path.
+/// @result True if the path has a extension, false otherwise.
+bool has_extension(const Twine &path);
+
+/// @brief Is path absolute?
+///
+/// @param path Input path.
+/// @result True if the path is absolute, false if it is not.
+bool is_absolute(const Twine &path);
+
+/// @brief Is path relative?
+///
+/// @param path Input path.
+/// @result True if the path is relative, false if it is not.
+bool is_relative(const Twine &path);
+
+/// @brief Remove redundant leading "./" pieces and consecutive separators.
+///
+/// @param path Input path.
+/// @result The cleaned-up \a path.
+StringRef remove_leading_dotslash(StringRef path);
+
+/// @brief In-place remove any './' and optionally '../' components from a path.
+///
+/// @param path processed path
+/// @param remove_dot_dot specify if '../' should be removed
+/// @result True if path was changed
+bool remove_dots(SmallVectorImpl<char> &path, bool remove_dot_dot = false);
+
+} // end namespace path
+} // end namespace sys
+} // end namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/PointerLikeTypeTraits.h b/third_party/wpiutil_2018/src/main/native/include/llvm/PointerLikeTypeTraits.h
new file mode 100644
index 0000000..3b96694
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/PointerLikeTypeTraits.h
@@ -0,0 +1,94 @@
+//===- llvm/Support/PointerLikeTypeTraits.h - Pointer Traits ----*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the PointerLikeTypeTraits class.  This allows data
+// structures to reason about pointers and other things that are pointer sized.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
+#define LLVM_SUPPORT_POINTERLIKETYPETRAITS_H
+
+#include "llvm/AlignOf.h"
+#include <cstdint>
+
+namespace llvm {
+
+/// A traits type that is used to handle pointer types and things that are just
+/// wrappers for pointers as a uniform entity.
+template <typename T> class PointerLikeTypeTraits {
+  // getAsVoidPointer
+  // getFromVoidPointer
+  // getNumLowBitsAvailable
+};
+
+namespace detail {
+/// A tiny meta function to compute the log2 of a compile time constant.
+template <size_t N>
+struct ConstantLog2
+    : std::integral_constant<size_t, ConstantLog2<N / 2>::value + 1> {};
+template <> struct ConstantLog2<1> : std::integral_constant<size_t, 0> {};
+}
+
+// Provide PointerLikeTypeTraits for non-cvr pointers.
+template <typename T> class PointerLikeTypeTraits<T *> {
+public:
+  static inline void *getAsVoidPointer(T *P) { return P; }
+  static inline T *getFromVoidPointer(void *P) { return static_cast<T *>(P); }
+
+  enum {
+    NumLowBitsAvailable = detail::ConstantLog2<AlignOf<T>::Alignment>::value
+  };
+};
+
+template <> class PointerLikeTypeTraits<void *> {
+public:
+  static inline void *getAsVoidPointer(void *P) { return P; }
+  static inline void *getFromVoidPointer(void *P) { return P; }
+
+  /// Note, we assume here that void* is related to raw malloc'ed memory and
+  /// that malloc returns objects at least 4-byte aligned. However, this may be
+  /// wrong, or pointers may be from something other than malloc. In this case,
+  /// you should specify a real typed pointer or avoid this template.
+  ///
+  /// All clients should use assertions to do a run-time check to ensure that
+  /// this is actually true.
+  enum { NumLowBitsAvailable = 2 };
+};
+
+// Provide PointerLikeTypeTraits for const pointers.
+template <typename T> class PointerLikeTypeTraits<const T *> {
+  typedef PointerLikeTypeTraits<T *> NonConst;
+
+public:
+  static inline const void *getAsVoidPointer(const T *P) {
+    return NonConst::getAsVoidPointer(const_cast<T *>(P));
+  }
+  static inline const T *getFromVoidPointer(const void *P) {
+    return NonConst::getFromVoidPointer(const_cast<void *>(P));
+  }
+  enum { NumLowBitsAvailable = NonConst::NumLowBitsAvailable };
+};
+
+// Provide PointerLikeTypeTraits for uintptr_t.
+template <> class PointerLikeTypeTraits<uintptr_t> {
+public:
+  static inline void *getAsVoidPointer(uintptr_t P) {
+    return reinterpret_cast<void *>(P);
+  }
+  static inline uintptr_t getFromVoidPointer(void *P) {
+    return reinterpret_cast<uintptr_t>(P);
+  }
+  // No bits are available!
+  enum { NumLowBitsAvailable = 0 };
+};
+
+} // end namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/STLExtras.h b/third_party/wpiutil_2018/src/main/native/include/llvm/STLExtras.h
new file mode 100644
index 0000000..1b43f30
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/STLExtras.h
@@ -0,0 +1,521 @@
+//===- llvm/ADT/STLExtras.h - Useful STL related functions ------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains some templates that are useful if you are working with the
+// STL at all.
+//
+// No library is required when using these functions.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_STLEXTRAS_H
+#define LLVM_ADT_STLEXTRAS_H
+
+#include <algorithm> // for std::all_of
+#include <cassert>
+#include <cstddef> // for std::size_t
+#include <cstdlib> // for qsort
+#include <functional>
+#include <iterator>
+#include <memory>
+#include <utility> // for std::pair
+
+#include "llvm/iterator_range.h"
+#include "llvm/Compiler.h"
+
+namespace llvm {
+
+//===----------------------------------------------------------------------===//
+//     Extra additions to <functional>
+//===----------------------------------------------------------------------===//
+
+template<class Ty>
+struct identity : public std::unary_function<Ty, Ty> {
+  Ty &operator()(Ty &self) const {
+    return self;
+  }
+  const Ty &operator()(const Ty &self) const {
+    return self;
+  }
+};
+
+template<class Ty>
+struct less_ptr : public std::binary_function<Ty, Ty, bool> {
+  bool operator()(const Ty* left, const Ty* right) const {
+    return *left < *right;
+  }
+};
+
+template<class Ty>
+struct greater_ptr : public std::binary_function<Ty, Ty, bool> {
+  bool operator()(const Ty* left, const Ty* right) const {
+    return *right < *left;
+  }
+};
+
+/// An efficient, type-erasing, non-owning reference to a callable. This is
+/// intended for use as the type of a function parameter that is not used
+/// after the function in question returns.
+///
+/// This class does not own the callable, so it is not in general safe to store
+/// a function_ref.
+template<typename Fn> class function_ref;
+
+template<typename Ret, typename ...Params>
+class function_ref<Ret(Params...)> {
+  Ret (*callback)(intptr_t callable, Params ...params);
+  intptr_t callable;
+
+  template<typename Callable>
+  static Ret callback_fn(intptr_t callable, Params ...params) {
+    return (*reinterpret_cast<Callable*>(callable))(
+        std::forward<Params>(params)...);
+  }
+
+public:
+  template <typename Callable>
+  function_ref(Callable &&callable,
+               typename std::enable_if<
+                   !std::is_same<typename std::remove_reference<Callable>::type,
+                                 function_ref>::value>::type * = nullptr)
+      : callback(callback_fn<typename std::remove_reference<Callable>::type>),
+        callable(reinterpret_cast<intptr_t>(&callable)) {}
+  Ret operator()(Params ...params) const {
+    return callback(callable, std::forward<Params>(params)...);
+  }
+};
+
+// deleter - Very very very simple method that is used to invoke operator
+// delete on something.  It is used like this:
+//
+//   for_each(V.begin(), B.end(), deleter<Interval>);
+//
+template <class T>
+inline void deleter(T *Ptr) {
+  delete Ptr;
+}
+
+
+
+//===----------------------------------------------------------------------===//
+//     Extra additions to <iterator>
+//===----------------------------------------------------------------------===//
+
+// mapped_iterator - This is a simple iterator adapter that causes a function to
+// be dereferenced whenever operator* is invoked on the iterator.
+//
+template <class RootIt, class UnaryFunc>
+class mapped_iterator {
+  RootIt current;
+  UnaryFunc Fn;
+public:
+  typedef typename std::iterator_traits<RootIt>::iterator_category
+          iterator_category;
+  typedef typename std::iterator_traits<RootIt>::difference_type
+          difference_type;
+  typedef typename std::result_of<
+            UnaryFunc(decltype(*std::declval<RootIt>()))>
+          ::type value_type;
+
+  typedef void pointer;
+  //typedef typename UnaryFunc::result_type *pointer;
+  typedef void reference;        // Can't modify value returned by fn
+
+  typedef RootIt iterator_type;
+
+  inline const RootIt &getCurrent() const { return current; }
+  inline const UnaryFunc &getFunc() const { return Fn; }
+
+  inline explicit mapped_iterator(const RootIt &I, UnaryFunc F)
+    : current(I), Fn(F) {}
+
+  inline value_type operator*() const {   // All this work to do this
+    return Fn(*current);         // little change
+  }
+
+  mapped_iterator &operator++() {
+    ++current;
+    return *this;
+  }
+  mapped_iterator &operator--() {
+    --current;
+    return *this;
+  }
+  mapped_iterator operator++(int) {
+    mapped_iterator __tmp = *this;
+    ++current;
+    return __tmp;
+  }
+  mapped_iterator operator--(int) {
+    mapped_iterator __tmp = *this;
+    --current;
+    return __tmp;
+  }
+  mapped_iterator operator+(difference_type n) const {
+    return mapped_iterator(current + n, Fn);
+  }
+  mapped_iterator &operator+=(difference_type n) {
+    current += n;
+    return *this;
+  }
+  mapped_iterator operator-(difference_type n) const {
+    return mapped_iterator(current - n, Fn);
+  }
+  mapped_iterator &operator-=(difference_type n) {
+    current -= n;
+    return *this;
+  }
+  reference operator[](difference_type n) const { return *(*this + n); }
+
+  bool operator!=(const mapped_iterator &X) const { return !operator==(X); }
+  bool operator==(const mapped_iterator &X) const {
+    return current == X.current;
+  }
+  bool operator<(const mapped_iterator &X) const { return current < X.current; }
+
+  difference_type operator-(const mapped_iterator &X) const {
+    return current - X.current;
+  }
+};
+
+template <class Iterator, class Func>
+inline mapped_iterator<Iterator, Func>
+operator+(typename mapped_iterator<Iterator, Func>::difference_type N,
+          const mapped_iterator<Iterator, Func> &X) {
+  return mapped_iterator<Iterator, Func>(X.getCurrent() - N, X.getFunc());
+}
+
+
+// map_iterator - Provide a convenient way to create mapped_iterators, just like
+// make_pair is useful for creating pairs...
+//
+template <class ItTy, class FuncTy>
+inline mapped_iterator<ItTy, FuncTy> map_iterator(const ItTy &I, FuncTy F) {
+  return mapped_iterator<ItTy, FuncTy>(I, F);
+}
+
+/// \brief Metafunction to determine if type T has a member called rbegin().
+template <typename T> struct has_rbegin {
+  template <typename U> static char(&f(const U &, decltype(&U::rbegin)))[1];
+  static char(&f(...))[2];
+  const static bool value = sizeof(f(std::declval<T>(), nullptr)) == 1;
+};
+
+// Returns an iterator_range over the given container which iterates in reverse.
+// Note that the container must have rbegin()/rend() methods for this to work.
+template <typename ContainerTy>
+auto reverse(ContainerTy &&C,
+             typename std::enable_if<has_rbegin<ContainerTy>::value>::type * =
+                 nullptr) -> decltype(make_range(C.rbegin(), C.rend())) {
+  return make_range(C.rbegin(), C.rend());
+}
+
+// Returns a std::reverse_iterator wrapped around the given iterator.
+template <typename IteratorTy>
+std::reverse_iterator<IteratorTy> make_reverse_iterator(IteratorTy It) {
+  return std::reverse_iterator<IteratorTy>(It);
+}
+
+// Returns an iterator_range over the given container which iterates in reverse.
+// Note that the container must have begin()/end() methods which return
+// bidirectional iterators for this to work.
+template <typename ContainerTy>
+auto reverse(
+    ContainerTy &&C,
+    typename std::enable_if<!has_rbegin<ContainerTy>::value>::type * = nullptr)
+    -> decltype(make_range(llvm::make_reverse_iterator(std::end(C)),
+                           llvm::make_reverse_iterator(std::begin(C)))) {
+  return make_range(llvm::make_reverse_iterator(std::end(C)),
+                    llvm::make_reverse_iterator(std::begin(C)));
+}
+
+//===----------------------------------------------------------------------===//
+//     Extra additions to <utility>
+//===----------------------------------------------------------------------===//
+
+/// \brief Function object to check whether the first component of a std::pair
+/// compares less than the first component of another std::pair.
+struct less_first {
+  template <typename T> bool operator()(const T &lhs, const T &rhs) const {
+    return lhs.first < rhs.first;
+  }
+};
+
+/// \brief Function object to check whether the second component of a std::pair
+/// compares less than the second component of another std::pair.
+struct less_second {
+  template <typename T> bool operator()(const T &lhs, const T &rhs) const {
+    return lhs.second < rhs.second;
+  }
+};
+
+// A subset of N3658. More stuff can be added as-needed.
+
+/// \brief Represents a compile-time sequence of integers.
+template <class T, T... I> struct integer_sequence {
+  typedef T value_type;
+
+  static LLVM_CONSTEXPR size_t size() { return sizeof...(I); }
+};
+
+/// \brief Alias for the common case of a sequence of size_ts.
+template <size_t... I>
+struct index_sequence : integer_sequence<std::size_t, I...> {};
+
+template <std::size_t N, std::size_t... I>
+struct build_index_impl : build_index_impl<N - 1, N - 1, I...> {};
+template <std::size_t... I>
+struct build_index_impl<0, I...> : index_sequence<I...> {};
+
+/// \brief Creates a compile-time integer sequence for a parameter pack.
+template <class... Ts>
+struct index_sequence_for : build_index_impl<sizeof...(Ts)> {};
+
+//===----------------------------------------------------------------------===//
+//     Extra additions for arrays
+//===----------------------------------------------------------------------===//
+
+/// Find the length of an array.
+template <class T, std::size_t N>
+LLVM_CONSTEXPR inline size_t array_lengthof(T (&)[N]) {
+  return N;
+}
+
+/// Adapt std::less<T> for array_pod_sort.
+template<typename T>
+inline int array_pod_sort_comparator(const void *P1, const void *P2) {
+  if (std::less<T>()(*reinterpret_cast<const T*>(P1),
+                     *reinterpret_cast<const T*>(P2)))
+    return -1;
+  if (std::less<T>()(*reinterpret_cast<const T*>(P2),
+                     *reinterpret_cast<const T*>(P1)))
+    return 1;
+  return 0;
+}
+
+/// get_array_pod_sort_comparator - This is an internal helper function used to
+/// get type deduction of T right.
+template<typename T>
+inline int (*get_array_pod_sort_comparator(const T &))
+             (const void*, const void*) {
+  return array_pod_sort_comparator<T>;
+}
+
+
+/// array_pod_sort - This sorts an array with the specified start and end
+/// extent.  This is just like std::sort, except that it calls qsort instead of
+/// using an inlined template.  qsort is slightly slower than std::sort, but
+/// most sorts are not performance critical in LLVM and std::sort has to be
+/// template instantiated for each type, leading to significant measured code
+/// bloat.  This function should generally be used instead of std::sort where
+/// possible.
+///
+/// This function assumes that you have simple POD-like types that can be
+/// compared with std::less and can be moved with memcpy.  If this isn't true,
+/// you should use std::sort.
+///
+/// NOTE: If qsort_r were portable, we could allow a custom comparator and
+/// default to std::less.
+template<class IteratorTy>
+inline void array_pod_sort(IteratorTy Start, IteratorTy End) {
+  // Don't inefficiently call qsort with one element or trigger undefined
+  // behavior with an empty sequence.
+  auto NElts = End - Start;
+  if (NElts <= 1) return;
+  qsort(&*Start, NElts, sizeof(*Start), get_array_pod_sort_comparator(*Start));
+}
+
+template <class IteratorTy>
+inline void array_pod_sort(
+    IteratorTy Start, IteratorTy End,
+    int (*Compare)(
+        const typename std::iterator_traits<IteratorTy>::value_type *,
+        const typename std::iterator_traits<IteratorTy>::value_type *)) {
+  // Don't inefficiently call qsort with one element or trigger undefined
+  // behavior with an empty sequence.
+  auto NElts = End - Start;
+  if (NElts <= 1) return;
+  qsort(&*Start, NElts, sizeof(*Start),
+        reinterpret_cast<int (*)(const void *, const void *)>(Compare));
+}
+
+//===----------------------------------------------------------------------===//
+//     Extra additions to <algorithm>
+//===----------------------------------------------------------------------===//
+
+/// For a container of pointers, deletes the pointers and then clears the
+/// container.
+template<typename Container>
+void DeleteContainerPointers(Container &C) {
+  for (typename Container::iterator I = C.begin(), E = C.end(); I != E; ++I)
+    delete *I;
+  C.clear();
+}
+
+/// In a container of pairs (usually a map) whose second element is a pointer,
+/// deletes the second elements and then clears the container.
+template<typename Container>
+void DeleteContainerSeconds(Container &C) {
+  for (typename Container::iterator I = C.begin(), E = C.end(); I != E; ++I)
+    delete I->second;
+  C.clear();
+}
+
+/// Provide wrappers to std::all_of which take ranges instead of having to pass
+/// begin/end explicitly.
+template<typename R, class UnaryPredicate>
+bool all_of(R &&Range, UnaryPredicate &&P) {
+  return std::all_of(Range.begin(), Range.end(),
+                     std::forward<UnaryPredicate>(P));
+}
+
+/// Provide wrappers to std::any_of which take ranges instead of having to pass
+/// begin/end explicitly.
+template <typename R, class UnaryPredicate>
+bool any_of(R &&Range, UnaryPredicate &&P) {
+  return std::any_of(Range.begin(), Range.end(),
+                     std::forward<UnaryPredicate>(P));
+}
+
+/// Provide wrappers to std::none_of which take ranges instead of having to pass
+/// begin/end explicitly.
+template <typename R, class UnaryPredicate>
+bool none_of(R &&Range, UnaryPredicate &&P) {
+  return std::none_of(Range.begin(), Range.end(),
+                      std::forward<UnaryPredicate>(P));
+}
+
+/// Provide wrappers to std::find which take ranges instead of having to pass
+/// begin/end explicitly.
+template<typename R, class T>
+auto find(R &&Range, const T &val) -> decltype(Range.begin()) {
+  return std::find(Range.begin(), Range.end(), val);
+}
+
+/// Provide wrappers to std::find_if which take ranges instead of having to pass
+/// begin/end explicitly.
+template <typename R, class T>
+auto find_if(R &&Range, const T &Pred) -> decltype(Range.begin()) {
+  return std::find_if(Range.begin(), Range.end(), Pred);
+}
+
+/// Provide wrappers to std::remove_if which take ranges instead of having to
+/// pass begin/end explicitly.
+template<typename R, class UnaryPredicate>
+auto remove_if(R &&Range, UnaryPredicate &&P) -> decltype(Range.begin()) {
+  return std::remove_if(Range.begin(), Range.end(), P);
+}
+
+/// Wrapper function around std::find to detect if an element exists
+/// in a container.
+template <typename R, typename E>
+bool is_contained(R &&Range, const E &Element) {
+  return std::find(Range.begin(), Range.end(), Element) != Range.end();
+}
+
+/// Wrapper function around std::count_if to count the number of times an
+/// element satisfying a given predicate occurs in a range.
+template <typename R, typename UnaryPredicate>
+auto count_if(R &&Range, UnaryPredicate &&P)
+    -> typename std::iterator_traits<decltype(Range.begin())>::difference_type {
+  return std::count_if(Range.begin(), Range.end(), P);
+}
+
+/// Wrapper function around std::transform to apply a function to a range and
+/// store the result elsewhere.
+template <typename R, class OutputIt, typename UnaryPredicate>
+OutputIt transform(R &&Range, OutputIt d_first, UnaryPredicate &&P) {
+  return std::transform(Range.begin(), Range.end(), d_first,
+                        std::forward<UnaryPredicate>(P));
+}
+
+//===----------------------------------------------------------------------===//
+//     Extra additions to <memory>
+//===----------------------------------------------------------------------===//
+
+// Implement make_unique according to N3656.
+
+/// \brief Constructs a `new T()` with the given args and returns a
+///        `unique_ptr<T>` which owns the object.
+///
+/// Example:
+///
+///     auto p = make_unique<int>();
+///     auto p = make_unique<std::tuple<int, int>>(0, 1);
+template <class T, class... Args>
+typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
+make_unique(Args &&... args) {
+  return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+}
+
+/// \brief Constructs a `new T[n]` with the given args and returns a
+///        `unique_ptr<T[]>` which owns the object.
+///
+/// \param n size of the new array.
+///
+/// Example:
+///
+///     auto p = make_unique<int[]>(2); // value-initializes the array with 0's.
+template <class T>
+typename std::enable_if<std::is_array<T>::value && std::extent<T>::value == 0,
+                        std::unique_ptr<T>>::type
+make_unique(size_t n) {
+  return std::unique_ptr<T>(new typename std::remove_extent<T>::type[n]());
+}
+
+/// This function isn't used and is only here to provide better compile errors.
+template <class T, class... Args>
+typename std::enable_if<std::extent<T>::value != 0>::type
+make_unique(Args &&...) = delete;
+
+struct FreeDeleter {
+  void operator()(void* v) {
+    ::free(v);
+  }
+};
+
+template<typename First, typename Second>
+struct pair_hash {
+  size_t operator()(const std::pair<First, Second> &P) const {
+    return std::hash<First>()(P.first) * 31 + std::hash<Second>()(P.second);
+  }
+};
+
+/// A functor like C++14's std::less<void> in its absence.
+struct less {
+  template <typename A, typename B> bool operator()(A &&a, B &&b) const {
+    return std::forward<A>(a) < std::forward<B>(b);
+  }
+};
+
+/// A functor like C++14's std::equal<void> in its absence.
+struct equal {
+  template <typename A, typename B> bool operator()(A &&a, B &&b) const {
+    return std::forward<A>(a) == std::forward<B>(b);
+  }
+};
+
+/// Binary functor that adapts to any other binary functor after dereferencing
+/// operands.
+template <typename T> struct deref {
+  T func;
+  // Could be further improved to cope with non-derivable functors and
+  // non-binary functors (should be a variadic template member function
+  // operator()).
+  template <typename A, typename B>
+  auto operator()(A &lhs, B &rhs) const -> decltype(func(*lhs, *rhs)) {
+    assert(lhs);
+    assert(rhs);
+    return func(*lhs, *rhs);
+  }
+};
+
+} // End llvm namespace
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/SmallPtrSet.h b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallPtrSet.h
new file mode 100644
index 0000000..b78e1fd
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallPtrSet.h
@@ -0,0 +1,406 @@
+//===- llvm/ADT/SmallPtrSet.h - 'Normally small' pointer set ----*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the SmallPtrSet class.  See the doxygen comment for
+// SmallPtrSetImplBase for more details on the algorithm used.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_SMALLPTRSET_H
+#define LLVM_ADT_SMALLPTRSET_H
+
+#include "llvm/Compiler.h"
+#include "llvm/PointerLikeTypeTraits.h"
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+#include <cstdlib>
+#include <iterator>
+#include <utility>
+
+namespace llvm {
+
+class SmallPtrSetIteratorImpl;
+
+/// SmallPtrSetImplBase - This is the common code shared among all the
+/// SmallPtrSet<>'s, which is almost everything.  SmallPtrSet has two modes, one
+/// for small and one for large sets.
+///
+/// Small sets use an array of pointers allocated in the SmallPtrSet object,
+/// which is treated as a simple array of pointers.  When a pointer is added to
+/// the set, the array is scanned to see if the element already exists, if not
+/// the element is 'pushed back' onto the array.  If we run out of space in the
+/// array, we grow into the 'large set' case.  SmallSet should be used when the
+/// sets are often small.  In this case, no memory allocation is used, and only
+/// light-weight and cache-efficient scanning is used.
+///
+/// Large sets use a classic exponentially-probed hash table.  Empty buckets are
+/// represented with an illegal pointer value (-1) to allow null pointers to be
+/// inserted.  Tombstones are represented with another illegal pointer value
+/// (-2), to allow deletion.  The hash table is resized when the table is 3/4 or
+/// more.  When this happens, the table is doubled in size.
+///
+class SmallPtrSetImplBase {
+  friend class SmallPtrSetIteratorImpl;
+
+protected:
+  /// SmallArray - Points to a fixed size set of buckets, used in 'small mode'.
+  const void **SmallArray;
+  /// CurArray - This is the current set of buckets.  If equal to SmallArray,
+  /// then the set is in 'small mode'.
+  const void **CurArray;
+  /// CurArraySize - The allocated size of CurArray, always a power of two.
+  unsigned CurArraySize;
+
+  /// Number of elements in CurArray that contain a value or are a tombstone.
+  /// If small, all these elements are at the beginning of CurArray and the rest
+  /// is uninitialized.
+  unsigned NumNonEmpty;
+  /// Number of tombstones in CurArray.
+  unsigned NumTombstones;
+
+  // Helpers to copy and move construct a SmallPtrSet.
+  SmallPtrSetImplBase(const void **SmallStorage,
+                      const SmallPtrSetImplBase &that);
+  SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize,
+                      SmallPtrSetImplBase &&that);
+  explicit SmallPtrSetImplBase(const void **SmallStorage, unsigned SmallSize)
+      : SmallArray(SmallStorage), CurArray(SmallStorage),
+        CurArraySize(SmallSize), NumNonEmpty(0), NumTombstones(0) {
+    assert(SmallSize && (SmallSize & (SmallSize-1)) == 0 &&
+           "Initial size must be a power of two!");
+  }
+  ~SmallPtrSetImplBase() {
+    if (!isSmall())
+      free(CurArray);
+  }
+
+public:
+  typedef unsigned size_type;
+  bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return size() == 0; }
+  size_type size() const { return NumNonEmpty - NumTombstones; }
+
+  void clear() {
+    // If the capacity of the array is huge, and the # elements used is small,
+    // shrink the array.
+    if (!isSmall()) {
+      if (size() * 4 < CurArraySize && CurArraySize > 32)
+        return shrink_and_clear();
+      // Fill the array with empty markers.
+      memset(CurArray, -1, CurArraySize * sizeof(void *));
+    }
+
+    NumNonEmpty = 0;
+    NumTombstones = 0;
+  }
+
+protected:
+  static void *getTombstoneMarker() { return reinterpret_cast<void*>(-2); }
+  static void *getEmptyMarker() {
+    // Note that -1 is chosen to make clear() efficiently implementable with
+    // memset and because it's not a valid pointer value.
+    return reinterpret_cast<void*>(-1);
+  }
+
+  const void **EndPointer() const {
+    return isSmall() ? CurArray + NumNonEmpty : CurArray + CurArraySize;
+  }
+
+  /// insert_imp - This returns true if the pointer was new to the set, false if
+  /// it was already in the set.  This is hidden from the client so that the
+  /// derived class can check that the right type of pointer is passed in.
+  std::pair<const void *const *, bool> insert_imp(const void *Ptr) {
+    if (isSmall()) {
+      // Check to see if it is already in the set.
+      const void **LastTombstone = nullptr;
+      for (const void **APtr = SmallArray, **E = SmallArray + NumNonEmpty;
+           APtr != E; ++APtr) {
+        const void *Value = *APtr;
+        if (Value == Ptr)
+          return std::make_pair(APtr, false);
+        if (Value == getTombstoneMarker())
+          LastTombstone = APtr;
+      }
+
+      // Did we find any tombstone marker?
+      if (LastTombstone != nullptr) {
+        *LastTombstone = Ptr;
+        --NumTombstones;
+        return std::make_pair(LastTombstone, true);
+      }
+
+      // Nope, there isn't.  If we stay small, just 'pushback' now.
+      if (NumNonEmpty < CurArraySize) {
+        SmallArray[NumNonEmpty++] = Ptr;
+        return std::make_pair(SmallArray + (NumNonEmpty - 1), true);
+      }
+      // Otherwise, hit the big set case, which will call grow.
+    }
+    return insert_imp_big(Ptr);
+  }
+
+  /// erase_imp - If the set contains the specified pointer, remove it and
+  /// return true, otherwise return false.  This is hidden from the client so
+  /// that the derived class can check that the right type of pointer is passed
+  /// in.
+  bool erase_imp(const void * Ptr);
+
+  bool count_imp(const void * Ptr) const {
+    if (isSmall()) {
+      // Linear search for the item.
+      for (const void *const *APtr = SmallArray,
+                      *const *E = SmallArray + NumNonEmpty; APtr != E; ++APtr)
+        if (*APtr == Ptr)
+          return true;
+      return false;
+    }
+
+    // Big set case.
+    return *FindBucketFor(Ptr) == Ptr;
+  }
+
+private:
+  bool isSmall() const { return CurArray == SmallArray; }
+
+  std::pair<const void *const *, bool> insert_imp_big(const void *Ptr);
+
+  const void * const *FindBucketFor(const void *Ptr) const;
+  void shrink_and_clear();
+
+  /// Grow - Allocate a larger backing store for the buckets and move it over.
+  void Grow(unsigned NewSize);
+
+  void operator=(const SmallPtrSetImplBase &RHS) = delete;
+
+protected:
+  /// swap - Swaps the elements of two sets.
+  /// Note: This method assumes that both sets have the same small size.
+  void swap(SmallPtrSetImplBase &RHS);
+
+  void CopyFrom(const SmallPtrSetImplBase &RHS);
+  void MoveFrom(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
+
+private:
+  /// Code shared by MoveFrom() and move constructor.
+  void MoveHelper(unsigned SmallSize, SmallPtrSetImplBase &&RHS);
+  /// Code shared by CopyFrom() and copy constructor.
+  void CopyHelper(const SmallPtrSetImplBase &RHS);
+};
+
+/// SmallPtrSetIteratorImpl - This is the common base class shared between all
+/// instances of SmallPtrSetIterator.
+class SmallPtrSetIteratorImpl {
+protected:
+  const void *const *Bucket;
+  const void *const *End;
+
+public:
+  explicit SmallPtrSetIteratorImpl(const void *const *BP, const void*const *E)
+    : Bucket(BP), End(E) {
+    AdvanceIfNotValid();
+  }
+
+  bool operator==(const SmallPtrSetIteratorImpl &RHS) const {
+    return Bucket == RHS.Bucket;
+  }
+  bool operator!=(const SmallPtrSetIteratorImpl &RHS) const {
+    return Bucket != RHS.Bucket;
+  }
+
+protected:
+  /// AdvanceIfNotValid - If the current bucket isn't valid, advance to a bucket
+  /// that is.   This is guaranteed to stop because the end() bucket is marked
+  /// valid.
+  void AdvanceIfNotValid() {
+    assert(Bucket <= End);
+    while (Bucket != End &&
+           (*Bucket == SmallPtrSetImplBase::getEmptyMarker() ||
+            *Bucket == SmallPtrSetImplBase::getTombstoneMarker()))
+      ++Bucket;
+  }
+};
+
+/// SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet.
+template<typename PtrTy>
+class SmallPtrSetIterator : public SmallPtrSetIteratorImpl {
+  typedef PointerLikeTypeTraits<PtrTy> PtrTraits;
+
+public:
+  typedef PtrTy                     value_type;
+  typedef PtrTy                     reference;
+  typedef PtrTy                     pointer;
+  typedef std::ptrdiff_t            difference_type;
+  typedef std::forward_iterator_tag iterator_category;
+
+  explicit SmallPtrSetIterator(const void *const *BP, const void *const *E)
+    : SmallPtrSetIteratorImpl(BP, E) {}
+
+  // Most methods provided by baseclass.
+
+  const PtrTy operator*() const {
+    assert(Bucket < End);
+    return PtrTraits::getFromVoidPointer(const_cast<void*>(*Bucket));
+  }
+
+  inline SmallPtrSetIterator& operator++() {          // Preincrement
+    ++Bucket;
+    AdvanceIfNotValid();
+    return *this;
+  }
+
+  SmallPtrSetIterator operator++(int) {        // Postincrement
+    SmallPtrSetIterator tmp = *this; ++*this; return tmp;
+  }
+};
+
+/// RoundUpToPowerOfTwo - This is a helper template that rounds N up to the next
+/// power of two (which means N itself if N is already a power of two).
+template<unsigned N>
+struct RoundUpToPowerOfTwo;
+
+/// RoundUpToPowerOfTwoH - If N is not a power of two, increase it.  This is a
+/// helper template used to implement RoundUpToPowerOfTwo.
+template<unsigned N, bool isPowerTwo>
+struct RoundUpToPowerOfTwoH {
+  enum { Val = N };
+};
+template<unsigned N>
+struct RoundUpToPowerOfTwoH<N, false> {
+  enum {
+    // We could just use NextVal = N+1, but this converges faster.  N|(N-1) sets
+    // the right-most zero bits to one all at once, e.g. 0b0011000 -> 0b0011111.
+    Val = RoundUpToPowerOfTwo<(N|(N-1)) + 1>::Val
+  };
+};
+
+template<unsigned N>
+struct RoundUpToPowerOfTwo {
+  enum { Val = RoundUpToPowerOfTwoH<N, (N&(N-1)) == 0>::Val };
+};
+
+/// \brief A templated base class for \c SmallPtrSet which provides the
+/// typesafe interface that is common across all small sizes.
+///
+/// This is particularly useful for passing around between interface boundaries
+/// to avoid encoding a particular small size in the interface boundary.
+template <typename PtrType>
+class SmallPtrSetImpl : public SmallPtrSetImplBase {
+  typedef PointerLikeTypeTraits<PtrType> PtrTraits;
+
+  SmallPtrSetImpl(const SmallPtrSetImpl &) = delete;
+
+protected:
+  // Constructors that forward to the base.
+  SmallPtrSetImpl(const void **SmallStorage, const SmallPtrSetImpl &that)
+      : SmallPtrSetImplBase(SmallStorage, that) {}
+  SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize,
+                  SmallPtrSetImpl &&that)
+      : SmallPtrSetImplBase(SmallStorage, SmallSize, std::move(that)) {}
+  explicit SmallPtrSetImpl(const void **SmallStorage, unsigned SmallSize)
+      : SmallPtrSetImplBase(SmallStorage, SmallSize) {}
+
+public:
+  typedef SmallPtrSetIterator<PtrType> iterator;
+  typedef SmallPtrSetIterator<PtrType> const_iterator;
+
+  /// Inserts Ptr if and only if there is no element in the container equal to
+  /// Ptr. The bool component of the returned pair is true if and only if the
+  /// insertion takes place, and the iterator component of the pair points to
+  /// the element equal to Ptr.
+  std::pair<iterator, bool> insert(PtrType Ptr) {
+    auto p = insert_imp(PtrTraits::getAsVoidPointer(Ptr));
+    return std::make_pair(iterator(p.first, EndPointer()), p.second);
+  }
+
+  /// erase - If the set contains the specified pointer, remove it and return
+  /// true, otherwise return false.
+  bool erase(PtrType Ptr) {
+    return erase_imp(PtrTraits::getAsVoidPointer(Ptr));
+  }
+
+  /// count - Return 1 if the specified pointer is in the set, 0 otherwise.
+  size_type count(PtrType Ptr) const {
+    return count_imp(PtrTraits::getAsVoidPointer(Ptr)) ? 1 : 0;
+  }
+
+  template <typename IterT>
+  void insert(IterT I, IterT E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+
+  inline iterator begin() const {
+    return iterator(CurArray, EndPointer());
+  }
+  inline iterator end() const {
+    const void *const *End = EndPointer();
+    return iterator(End, End);
+  }
+};
+
+/// SmallPtrSet - This class implements a set which is optimized for holding
+/// SmallSize or less elements.  This internally rounds up SmallSize to the next
+/// power of two if it is not already a power of two.  See the comments above
+/// SmallPtrSetImplBase for details of the algorithm.
+template<class PtrType, unsigned SmallSize>
+class SmallPtrSet : public SmallPtrSetImpl<PtrType> {
+  // In small mode SmallPtrSet uses linear search for the elements, so it is
+  // not a good idea to choose this value too high. You may consider using a
+  // DenseSet<> instead if you expect many elements in the set.
+  static_assert(SmallSize <= 32, "SmallSize should be small");
+
+  typedef SmallPtrSetImpl<PtrType> BaseT;
+
+  // Make sure that SmallSize is a power of two, round up if not.
+  enum { SmallSizePowTwo = RoundUpToPowerOfTwo<SmallSize>::Val };
+  /// SmallStorage - Fixed size storage used in 'small mode'.
+  const void *SmallStorage[SmallSizePowTwo];
+
+public:
+  SmallPtrSet() : BaseT(SmallStorage, SmallSizePowTwo) {}
+  SmallPtrSet(const SmallPtrSet &that) : BaseT(SmallStorage, that) {}
+  SmallPtrSet(SmallPtrSet &&that)
+      : BaseT(SmallStorage, SmallSizePowTwo, std::move(that)) {}
+
+  template<typename It>
+  SmallPtrSet(It I, It E) : BaseT(SmallStorage, SmallSizePowTwo) {
+    this->insert(I, E);
+  }
+
+  SmallPtrSet<PtrType, SmallSize> &
+  operator=(const SmallPtrSet<PtrType, SmallSize> &RHS) {
+    if (&RHS != this)
+      this->CopyFrom(RHS);
+    return *this;
+  }
+
+  SmallPtrSet<PtrType, SmallSize>&
+  operator=(SmallPtrSet<PtrType, SmallSize> &&RHS) {
+    if (&RHS != this)
+      this->MoveFrom(SmallSizePowTwo, std::move(RHS));
+    return *this;
+  }
+
+  /// swap - Swaps the elements of two sets.
+  void swap(SmallPtrSet<PtrType, SmallSize> &RHS) {
+    SmallPtrSetImplBase::swap(RHS);
+  }
+};
+}
+
+namespace std {
+  /// Implement std::swap in terms of SmallPtrSet swap.
+  template<class T, unsigned N>
+  inline void swap(llvm::SmallPtrSet<T, N> &LHS, llvm::SmallPtrSet<T, N> &RHS) {
+    LHS.swap(RHS);
+  }
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/SmallSet.h b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallSet.h
new file mode 100644
index 0000000..3dfd1f9
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallSet.h
@@ -0,0 +1,136 @@
+//===- llvm/ADT/SmallSet.h - 'Normally small' sets --------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the SmallSet class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_SMALLSET_H
+#define LLVM_ADT_SMALLSET_H
+
+#include "llvm/None.h"
+#include "llvm/SmallPtrSet.h"
+#include "llvm/SmallVector.h"
+#include <set>
+
+namespace llvm {
+
+/// SmallSet - This maintains a set of unique values, optimizing for the case
+/// when the set is small (less than N).  In this case, the set can be
+/// maintained with no mallocs.  If the set gets large, we expand to using an
+/// std::set to maintain reasonable lookup times.
+///
+/// Note that this set does not provide a way to iterate over members in the
+/// set.
+template <typename T, unsigned N,  typename C = std::less<T> >
+class SmallSet {
+  /// Use a SmallVector to hold the elements here (even though it will never
+  /// reach its 'large' stage) to avoid calling the default ctors of elements
+  /// we will never use.
+  SmallVector<T, N> Vector;
+  std::set<T, C> Set;
+  typedef typename SmallVector<T, N>::const_iterator VIterator;
+  typedef typename SmallVector<T, N>::iterator mutable_iterator;
+
+  // In small mode SmallPtrSet uses linear search for the elements, so it is
+  // not a good idea to choose this value too high. You may consider using a
+  // DenseSet<> instead if you expect many elements in the set.
+  static_assert(N <= 32, "N should be small");
+
+public:
+  typedef size_t size_type;
+  SmallSet() {}
+
+  bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const {
+    return Vector.empty() && Set.empty();
+  }
+
+  size_type size() const {
+    return isSmall() ? Vector.size() : Set.size();
+  }
+
+  /// count - Return 1 if the element is in the set, 0 otherwise.
+  size_type count(const T &V) const {
+    if (isSmall()) {
+      // Since the collection is small, just do a linear search.
+      return vfind(V) == Vector.end() ? 0 : 1;
+    } else {
+      return Set.count(V);
+    }
+  }
+
+  /// insert - Insert an element into the set if it isn't already there.
+  /// Returns true if the element is inserted (it was not in the set before).
+  /// The first value of the returned pair is unused and provided for
+  /// partial compatibility with the standard library self-associative container
+  /// concept.
+  // FIXME: Add iterators that abstract over the small and large form, and then
+  // return those here.
+  std::pair<NoneType, bool> insert(const T &V) {
+    if (!isSmall())
+      return std::make_pair(None, Set.insert(V).second);
+
+    VIterator I = vfind(V);
+    if (I != Vector.end())    // Don't reinsert if it already exists.
+      return std::make_pair(None, false);
+    if (Vector.size() < N) {
+      Vector.push_back(V);
+      return std::make_pair(None, true);
+    }
+
+    // Otherwise, grow from vector to set.
+    while (!Vector.empty()) {
+      Set.insert(Vector.back());
+      Vector.pop_back();
+    }
+    Set.insert(V);
+    return std::make_pair(None, true);
+  }
+
+  template <typename IterT>
+  void insert(IterT I, IterT E) {
+    for (; I != E; ++I)
+      insert(*I);
+  }
+
+  bool erase(const T &V) {
+    if (!isSmall())
+      return Set.erase(V);
+    for (mutable_iterator I = Vector.begin(), E = Vector.end(); I != E; ++I)
+      if (*I == V) {
+        Vector.erase(I);
+        return true;
+      }
+    return false;
+  }
+
+  void clear() {
+    Vector.clear();
+    Set.clear();
+  }
+
+private:
+  bool isSmall() const { return Set.empty(); }
+
+  VIterator vfind(const T &V) const {
+    for (VIterator I = Vector.begin(), E = Vector.end(); I != E; ++I)
+      if (*I == V)
+        return I;
+    return Vector.end();
+  }
+};
+
+/// If this set is of pointer values, transparently switch over to using
+/// SmallPtrSet for performance.
+template <typename PointeeType, unsigned N>
+class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
+
+} // end namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/SmallString.h b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallString.h
new file mode 100644
index 0000000..4c60c9b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallString.h
@@ -0,0 +1,297 @@
+//===- llvm/ADT/SmallString.h - 'Normally small' strings --------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the SmallString class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_SMALLSTRING_H
+#define LLVM_ADT_SMALLSTRING_H
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+
+namespace llvm {
+
+/// SmallString - A SmallString is just a SmallVector with methods and accessors
+/// that make it work better as a string (e.g. operator+ etc).
+template<unsigned InternalLen>
+class SmallString : public SmallVector<char, InternalLen> {
+public:
+  /// Default ctor - Initialize to empty.
+  SmallString() {}
+
+  /// Initialize from a StringRef.
+  SmallString(StringRef S) : SmallVector<char, InternalLen>(S.begin(), S.end()) {}
+
+  /// Initialize with a range.
+  template<typename ItTy>
+  SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
+
+  // Note that in order to add new overloads for append & assign, we have to
+  // duplicate the inherited versions so as not to inadvertently hide them.
+
+  /// @}
+  /// @name String Assignment
+  /// @{
+
+  /// Assign from a repeated element.
+  void assign(size_t NumElts, char Elt) {
+    this->SmallVectorImpl<char>::assign(NumElts, Elt);
+  }
+
+  /// Assign from an iterator pair.
+  template<typename in_iter>
+  void assign(in_iter S, in_iter E) {
+    this->clear();
+    SmallVectorImpl<char>::append(S, E);
+  }
+
+  /// Assign from a StringRef.
+  void assign(StringRef RHS) {
+    this->clear();
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+  /// Assign from a SmallVector.
+  void assign(const SmallVectorImpl<char> &RHS) {
+    this->clear();
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+  /// @}
+  /// @name String Concatenation
+  /// @{
+
+  /// Append from an iterator pair.
+  template<typename in_iter>
+  void append(in_iter S, in_iter E) {
+    SmallVectorImpl<char>::append(S, E);
+  }
+
+  void append(size_t NumInputs, char Elt) {
+    SmallVectorImpl<char>::append(NumInputs, Elt);
+  }
+
+
+  /// Append from a StringRef.
+  void append(StringRef RHS) {
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+  /// Append from a SmallVector.
+  void append(const SmallVectorImpl<char> &RHS) {
+    SmallVectorImpl<char>::append(RHS.begin(), RHS.end());
+  }
+
+  /// @}
+  /// @name String Comparison
+  /// @{
+
+  /// Check for string equality.  This is more efficient than compare() when
+  /// the relative ordering of inequal strings isn't needed.
+  bool equals(StringRef RHS) const {
+    return str().equals(RHS);
+  }
+
+  /// Check for string equality, ignoring case.
+  bool equals_lower(StringRef RHS) const {
+    return str().equals_lower(RHS);
+  }
+
+  /// Compare two strings; the result is -1, 0, or 1 if this string is
+  /// lexicographically less than, equal to, or greater than the \p RHS.
+  int compare(StringRef RHS) const {
+    return str().compare(RHS);
+  }
+
+  /// compare_lower - Compare two strings, ignoring case.
+  int compare_lower(StringRef RHS) const {
+    return str().compare_lower(RHS);
+  }
+
+  /// compare_numeric - Compare two strings, treating sequences of digits as
+  /// numbers.
+  int compare_numeric(StringRef RHS) const {
+    return str().compare_numeric(RHS);
+  }
+
+  /// @}
+  /// @name String Predicates
+  /// @{
+
+  /// startswith - Check if this string starts with the given \p Prefix.
+  bool startswith(StringRef Prefix) const {
+    return str().startswith(Prefix);
+  }
+
+  /// endswith - Check if this string ends with the given \p Suffix.
+  bool endswith(StringRef Suffix) const {
+    return str().endswith(Suffix);
+  }
+
+  /// @}
+  /// @name String Searching
+  /// @{
+
+  /// find - Search for the first character \p C in the string.
+  ///
+  /// \return - The index of the first occurrence of \p C, or npos if not
+  /// found.
+  size_t find(char C, size_t From = 0) const {
+    return str().find(C, From);
+  }
+
+  /// Search for the first string \p Str in the string.
+  ///
+  /// \returns The index of the first occurrence of \p Str, or npos if not
+  /// found.
+  size_t find(StringRef Str, size_t From = 0) const {
+    return str().find(Str, From);
+  }
+
+  /// Search for the last character \p C in the string.
+  ///
+  /// \returns The index of the last occurrence of \p C, or npos if not
+  /// found.
+  size_t rfind(char C, size_t From = StringRef::npos) const {
+    return str().rfind(C, From);
+  }
+
+  /// Search for the last string \p Str in the string.
+  ///
+  /// \returns The index of the last occurrence of \p Str, or npos if not
+  /// found.
+  size_t rfind(StringRef Str) const {
+    return str().rfind(Str);
+  }
+
+  /// Find the first character in the string that is \p C, or npos if not
+  /// found. Same as find.
+  size_t find_first_of(char C, size_t From = 0) const {
+    return str().find_first_of(C, From);
+  }
+
+  /// Find the first character in the string that is in \p Chars, or npos if
+  /// not found.
+  ///
+  /// Complexity: O(size() + Chars.size())
+  size_t find_first_of(StringRef Chars, size_t From = 0) const {
+    return str().find_first_of(Chars, From);
+  }
+
+  /// Find the first character in the string that is not \p C or npos if not
+  /// found.
+  size_t find_first_not_of(char C, size_t From = 0) const {
+    return str().find_first_not_of(C, From);
+  }
+
+  /// Find the first character in the string that is not in the string
+  /// \p Chars, or npos if not found.
+  ///
+  /// Complexity: O(size() + Chars.size())
+  size_t find_first_not_of(StringRef Chars, size_t From = 0) const {
+    return str().find_first_not_of(Chars, From);
+  }
+
+  /// Find the last character in the string that is \p C, or npos if not
+  /// found.
+  size_t find_last_of(char C, size_t From = StringRef::npos) const {
+    return str().find_last_of(C, From);
+  }
+
+  /// Find the last character in the string that is in \p C, or npos if not
+  /// found.
+  ///
+  /// Complexity: O(size() + Chars.size())
+  size_t find_last_of(
+      StringRef Chars, size_t From = StringRef::npos) const {
+    return str().find_last_of(Chars, From);
+  }
+
+  /// @}
+  /// @name Helpful Algorithms
+  /// @{
+
+  /// Return the number of occurrences of \p C in the string.
+  size_t count(char C) const {
+    return str().count(C);
+  }
+
+  /// Return the number of non-overlapped occurrences of \p Str in the
+  /// string.
+  size_t count(StringRef Str) const {
+    return str().count(Str);
+  }
+
+  /// @}
+  /// @name Substring Operations
+  /// @{
+
+  /// Return a reference to the substring from [Start, Start + N).
+  ///
+  /// \param Start The index of the starting character in the substring; if
+  /// the index is npos or greater than the length of the string then the
+  /// empty substring will be returned.
+  ///
+  /// \param N The number of characters to included in the substring. If \p N
+  /// exceeds the number of characters remaining in the string, the string
+  /// suffix (starting with \p Start) will be returned.
+  StringRef substr(size_t Start, size_t N = StringRef::npos) const {
+    return str().substr(Start, N);
+  }
+
+  /// Return a reference to the substring from [Start, End).
+  ///
+  /// \param Start The index of the starting character in the substring; if
+  /// the index is npos or greater than the length of the string then the
+  /// empty substring will be returned.
+  ///
+  /// \param End The index following the last character to include in the
+  /// substring. If this is npos, or less than \p Start, or exceeds the
+  /// number of characters remaining in the string, the string suffix
+  /// (starting with \p Start) will be returned.
+  StringRef slice(size_t Start, size_t End) const {
+    return str().slice(Start, End);
+  }
+
+  // Extra methods.
+
+  /// Explicit conversion to StringRef.
+  StringRef str() const { return StringRef(this->begin(), this->size()); }
+
+  // TODO: Make this const, if it's safe...
+  const char* c_str() {
+    this->push_back(0);
+    this->pop_back();
+    return this->data();
+  }
+
+  /// Implicit conversion to StringRef.
+  operator StringRef() const { return str(); }
+
+  // Extra operators.
+  const SmallString &operator=(StringRef RHS) {
+    this->clear();
+    return *this += RHS;
+  }
+
+  SmallString &operator+=(StringRef RHS) {
+    this->append(RHS.begin(), RHS.end());
+    return *this;
+  }
+  SmallString &operator+=(char C) {
+    this->push_back(C);
+    return *this;
+  }
+};
+
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/SmallVector.h b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallVector.h
new file mode 100644
index 0000000..0f9c73b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/SmallVector.h
@@ -0,0 +1,920 @@
+//===- llvm/ADT/SmallVector.h - 'Normally small' vectors --------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the SmallVector class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_SMALLVECTOR_H
+#define LLVM_ADT_SMALLVECTOR_H
+
+#include "llvm/iterator_range.h"
+#include "llvm/AlignOf.h"
+#include "llvm/Compiler.h"
+#include "llvm/MathExtras.h"
+#include "llvm/type_traits.h"
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <cstdlib>
+#include <cstring>
+#include <initializer_list>
+#include <iterator>
+#include <memory>
+
+namespace llvm {
+
+/// This is all the non-templated stuff common to all SmallVectors.
+class SmallVectorBase {
+protected:
+  void *BeginX, *EndX, *CapacityX;
+
+protected:
+  SmallVectorBase(void *FirstEl, size_t Size)
+    : BeginX(FirstEl), EndX(FirstEl), CapacityX((char*)FirstEl+Size) {}
+
+  /// This is an implementation of the grow() method which only works
+  /// on POD-like data types and is out of line to reduce code duplication.
+  void grow_pod(void *FirstEl, size_t MinSizeInBytes, size_t TSize);
+
+public:
+  /// This returns size()*sizeof(T).
+  size_t size_in_bytes() const {
+    return size_t((char*)EndX - (char*)BeginX);
+  }
+
+  /// capacity_in_bytes - This returns capacity()*sizeof(T).
+  size_t capacity_in_bytes() const {
+    return size_t((char*)CapacityX - (char*)BeginX);
+  }
+
+  bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const { return BeginX == EndX; }
+};
+
+template <typename T, unsigned N> struct SmallVectorStorage;
+
+/// This is the part of SmallVectorTemplateBase which does not depend on whether
+/// the type T is a POD. The extra dummy template argument is used by ArrayRef
+/// to avoid unnecessarily requiring T to be complete.
+template <typename T, typename = void>
+class SmallVectorTemplateCommon : public SmallVectorBase {
+private:
+  template <typename, unsigned> friend struct SmallVectorStorage;
+
+  // Allocate raw space for N elements of type T.  If T has a ctor or dtor, we
+  // don't want it to be automatically run, so we need to represent the space as
+  // something else.  Use an array of char of sufficient alignment.
+  typedef llvm::AlignedCharArrayUnion<T> U;
+  U FirstEl;
+  // Space after 'FirstEl' is clobbered, do not add any instance vars after it.
+
+protected:
+  SmallVectorTemplateCommon(size_t Size) : SmallVectorBase(&FirstEl, Size) {}
+
+  void grow_pod(size_t MinSizeInBytes, size_t TSize) {
+    SmallVectorBase::grow_pod(&FirstEl, MinSizeInBytes, TSize);
+  }
+
+  /// Return true if this is a smallvector which has not had dynamic
+  /// memory allocated for it.
+  bool isSmall() const {
+    return BeginX == static_cast<const void*>(&FirstEl);
+  }
+
+  /// Put this vector in a state of being small.
+  void resetToSmall() {
+    BeginX = EndX = CapacityX = &FirstEl;
+  }
+
+  void setEnd(T *P) { this->EndX = P; }
+public:
+  typedef size_t size_type;
+  typedef ptrdiff_t difference_type;
+  typedef T value_type;
+  typedef T *iterator;
+  typedef const T *const_iterator;
+
+  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+  typedef std::reverse_iterator<iterator> reverse_iterator;
+
+  typedef T &reference;
+  typedef const T &const_reference;
+  typedef T *pointer;
+  typedef const T *const_pointer;
+
+  // forward iterator creation methods.
+  iterator begin() { return (iterator)this->BeginX; }
+  const_iterator begin() const { return (const_iterator)this->BeginX; }
+  iterator end() { return (iterator)this->EndX; }
+  const_iterator end() const { return (const_iterator)this->EndX; }
+protected:
+  iterator capacity_ptr() { return (iterator)this->CapacityX; }
+  const_iterator capacity_ptr() const { return (const_iterator)this->CapacityX;}
+public:
+
+  // reverse iterator creation methods.
+  reverse_iterator rbegin()            { return reverse_iterator(end()); }
+  const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
+  reverse_iterator rend()              { return reverse_iterator(begin()); }
+  const_reverse_iterator rend() const { return const_reverse_iterator(begin());}
+
+  size_type size() const { return end()-begin(); }
+  size_type max_size() const { return size_type(-1) / sizeof(T); }
+
+  /// Return the total number of elements in the currently allocated buffer.
+  size_t capacity() const { return capacity_ptr() - begin(); }
+
+  /// Return a pointer to the vector's buffer, even if empty().
+  pointer data() { return pointer(begin()); }
+  /// Return a pointer to the vector's buffer, even if empty().
+  const_pointer data() const { return const_pointer(begin()); }
+
+  reference operator[](size_type idx) {
+    assert(idx < size());
+    return begin()[idx];
+  }
+  const_reference operator[](size_type idx) const {
+    assert(idx < size());
+    return begin()[idx];
+  }
+
+  reference front() {
+    assert(!empty());
+    return begin()[0];
+  }
+  const_reference front() const {
+    assert(!empty());
+    return begin()[0];
+  }
+
+  reference back() {
+    assert(!empty());
+    return end()[-1];
+  }
+  const_reference back() const {
+    assert(!empty());
+    return end()[-1];
+  }
+};
+
+/// SmallVectorTemplateBase<isPodLike = false> - This is where we put method
+/// implementations that are designed to work with non-POD-like T's.
+template <typename T, bool isPodLike>
+class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
+protected:
+  SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
+
+  static void destroy_range(T *S, T *E) {
+    while (S != E) {
+      --E;
+      E->~T();
+    }
+  }
+
+  /// Move the range [I, E) into the uninitialized memory starting with "Dest",
+  /// constructing elements as needed.
+  template<typename It1, typename It2>
+  static void uninitialized_move(It1 I, It1 E, It2 Dest) {
+    std::uninitialized_copy(std::make_move_iterator(I),
+                            std::make_move_iterator(E), Dest);
+  }
+
+  /// Copy the range [I, E) onto the uninitialized memory starting with "Dest",
+  /// constructing elements as needed.
+  template<typename It1, typename It2>
+  static void uninitialized_copy(It1 I, It1 E, It2 Dest) {
+    std::uninitialized_copy(I, E, Dest);
+  }
+
+  /// Grow the allocated memory (without initializing new elements), doubling
+  /// the size of the allocated memory. Guarantees space for at least one more
+  /// element, or MinSize more elements if specified.
+  void grow(size_t MinSize = 0);
+
+public:
+  void push_back(const T &Elt) {
+    if (LLVM_UNLIKELY(this->EndX >= this->CapacityX))
+      this->grow();
+    ::new ((void*) this->end()) T(Elt);
+    this->setEnd(this->end()+1);
+  }
+
+  void push_back(T &&Elt) {
+    if (LLVM_UNLIKELY(this->EndX >= this->CapacityX))
+      this->grow();
+    ::new ((void*) this->end()) T(::std::move(Elt));
+    this->setEnd(this->end()+1);
+  }
+
+  void pop_back() {
+    this->setEnd(this->end()-1);
+    this->end()->~T();
+  }
+};
+
+// Define this out-of-line to dissuade the C++ compiler from inlining it.
+template <typename T, bool isPodLike>
+void SmallVectorTemplateBase<T, isPodLike>::grow(size_t MinSize) {
+  size_t CurCapacity = this->capacity();
+  size_t CurSize = this->size();
+  // Always grow, even from zero.
+  size_t NewCapacity = size_t(NextPowerOf2(CurCapacity+2));
+  if (NewCapacity < MinSize)
+    NewCapacity = MinSize;
+  T *NewElts = static_cast<T*>(malloc(NewCapacity*sizeof(T)));
+
+  // Move the elements over.
+  this->uninitialized_move(this->begin(), this->end(), NewElts);
+
+  // Destroy the original elements.
+  destroy_range(this->begin(), this->end());
+
+  // If this wasn't grown from the inline copy, deallocate the old space.
+  if (!this->isSmall())
+    free(this->begin());
+
+  this->setEnd(NewElts+CurSize);
+  this->BeginX = NewElts;
+  this->CapacityX = this->begin()+NewCapacity;
+}
+
+
+/// SmallVectorTemplateBase<isPodLike = true> - This is where we put method
+/// implementations that are designed to work with POD-like T's.
+template <typename T>
+class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {
+protected:
+  SmallVectorTemplateBase(size_t Size) : SmallVectorTemplateCommon<T>(Size) {}
+
+  // No need to do a destroy loop for POD's.
+  static void destroy_range(T *, T *) {}
+
+  /// Move the range [I, E) onto the uninitialized memory
+  /// starting with "Dest", constructing elements into it as needed.
+  template<typename It1, typename It2>
+  static void uninitialized_move(It1 I, It1 E, It2 Dest) {
+    // Just do a copy.
+    uninitialized_copy(I, E, Dest);
+  }
+
+  /// Copy the range [I, E) onto the uninitialized memory
+  /// starting with "Dest", constructing elements into it as needed.
+  template<typename It1, typename It2>
+  static void uninitialized_copy(It1 I, It1 E, It2 Dest) {
+    // Arbitrary iterator types; just use the basic implementation.
+    std::uninitialized_copy(I, E, Dest);
+  }
+
+  /// Copy the range [I, E) onto the uninitialized memory
+  /// starting with "Dest", constructing elements into it as needed.
+  template <typename T1, typename T2>
+  static void uninitialized_copy(
+      T1 *I, T1 *E, T2 *Dest,
+      typename std::enable_if<std::is_same<typename std::remove_const<T1>::type,
+                                           T2>::value>::type * = nullptr) {
+    // Use memcpy for PODs iterated by pointers (which includes SmallVector
+    // iterators): std::uninitialized_copy optimizes to memmove, but we can
+    // use memcpy here. Note that I and E are iterators and thus might be
+    // invalid for memcpy if they are equal.
+    if (I != E)
+      memcpy(Dest, I, (E - I) * sizeof(T));
+  }
+
+  /// Double the size of the allocated memory, guaranteeing space for at
+  /// least one more element or MinSize if specified.
+  void grow(size_t MinSize = 0) {
+    this->grow_pod(MinSize*sizeof(T), sizeof(T));
+  }
+public:
+  void push_back(const T &Elt) {
+    if (LLVM_UNLIKELY(this->EndX >= this->CapacityX))
+      this->grow();
+    memcpy(this->end(), &Elt, sizeof(T));
+    this->setEnd(this->end()+1);
+  }
+
+  void pop_back() {
+    this->setEnd(this->end()-1);
+  }
+};
+
+
+/// This class consists of common code factored out of the SmallVector class to
+/// reduce code duplication based on the SmallVector 'N' template parameter.
+template <typename T>
+class SmallVectorImpl : public SmallVectorTemplateBase<T, isPodLike<T>::value> {
+  typedef SmallVectorTemplateBase<T, isPodLike<T>::value > SuperClass;
+
+  SmallVectorImpl(const SmallVectorImpl&) = delete;
+public:
+  typedef typename SuperClass::iterator iterator;
+  typedef typename SuperClass::const_iterator const_iterator;
+  typedef typename SuperClass::size_type size_type;
+
+protected:
+  // Default ctor - Initialize to empty.
+  explicit SmallVectorImpl(unsigned N)
+    : SmallVectorTemplateBase<T, isPodLike<T>::value>(N*sizeof(T)) {
+  }
+
+public:
+  ~SmallVectorImpl() {
+    // Destroy the constructed elements in the vector.
+    this->destroy_range(this->begin(), this->end());
+
+    // If this wasn't grown from the inline copy, deallocate the old space.
+    if (!this->isSmall())
+      free(this->begin());
+  }
+
+
+  void clear() {
+    this->destroy_range(this->begin(), this->end());
+    this->EndX = this->BeginX;
+  }
+
+  void resize(size_type N) {
+    if (N < this->size()) {
+      this->destroy_range(this->begin()+N, this->end());
+      this->setEnd(this->begin()+N);
+    } else if (N > this->size()) {
+      if (this->capacity() < N)
+        this->grow(N);
+      for (auto I = this->end(), E = this->begin() + N; I != E; ++I)
+        new (&*I) T();
+      this->setEnd(this->begin()+N);
+    }
+  }
+
+  void resize(size_type N, const T &NV) {
+    if (N < this->size()) {
+      this->destroy_range(this->begin()+N, this->end());
+      this->setEnd(this->begin()+N);
+    } else if (N > this->size()) {
+      if (this->capacity() < N)
+        this->grow(N);
+      std::uninitialized_fill(this->end(), this->begin()+N, NV);
+      this->setEnd(this->begin()+N);
+    }
+  }
+
+  void reserve(size_type N) {
+    if (this->capacity() < N)
+      this->grow(N);
+  }
+
+  T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val() {
+    T Result = ::std::move(this->back());
+    this->pop_back();
+    return Result;
+  }
+
+  void swap(SmallVectorImpl &RHS);
+
+  /// Add the specified range to the end of the SmallVector.
+  template<typename in_iter>
+  void append(in_iter in_start, in_iter in_end) {
+    size_type NumInputs = std::distance(in_start, in_end);
+    // Grow allocated space if needed.
+    if (NumInputs > size_type(this->capacity_ptr()-this->end()))
+      this->grow(this->size()+NumInputs);
+
+    // Copy the new elements over.
+    this->uninitialized_copy(in_start, in_end, this->end());
+    this->setEnd(this->end() + NumInputs);
+  }
+
+  /// Add the specified range to the end of the SmallVector.
+  void append(size_type NumInputs, const T &Elt) {
+    // Grow allocated space if needed.
+    if (NumInputs > size_type(this->capacity_ptr()-this->end()))
+      this->grow(this->size()+NumInputs);
+
+    // Copy the new elements over.
+    std::uninitialized_fill_n(this->end(), NumInputs, Elt);
+    this->setEnd(this->end() + NumInputs);
+  }
+
+  void append(std::initializer_list<T> IL) {
+    append(IL.begin(), IL.end());
+  }
+
+  void assign(size_type NumElts, const T &Elt) {
+    clear();
+    if (this->capacity() < NumElts)
+      this->grow(NumElts);
+    this->setEnd(this->begin()+NumElts);
+    std::uninitialized_fill(this->begin(), this->end(), Elt);
+  }
+
+  void assign(std::initializer_list<T> IL) {
+    clear();
+    append(IL);
+  }
+
+  iterator erase(const_iterator CI) {
+    // Just cast away constness because this is a non-const member function.
+    iterator I = const_cast<iterator>(CI);
+
+    assert(I >= this->begin() && "Iterator to erase is out of bounds.");
+    assert(I < this->end() && "Erasing at past-the-end iterator.");
+
+    iterator N = I;
+    // Shift all elts down one.
+    std::move(I+1, this->end(), I);
+    // Drop the last elt.
+    this->pop_back();
+    return(N);
+  }
+
+  iterator erase(const_iterator CS, const_iterator CE) {
+    // Just cast away constness because this is a non-const member function.
+    iterator S = const_cast<iterator>(CS);
+    iterator E = const_cast<iterator>(CE);
+
+    assert(S >= this->begin() && "Range to erase is out of bounds.");
+    assert(S <= E && "Trying to erase invalid range.");
+    assert(E <= this->end() && "Trying to erase past the end.");
+
+    iterator N = S;
+    // Shift all elts down.
+    iterator I = std::move(E, this->end(), S);
+    // Drop the last elts.
+    this->destroy_range(I, this->end());
+    this->setEnd(I);
+    return(N);
+  }
+
+  iterator insert(iterator I, T &&Elt) {
+    if (I == this->end()) {  // Important special case for empty vector.
+      this->push_back(::std::move(Elt));
+      return this->end()-1;
+    }
+
+    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
+    assert(I <= this->end() && "Inserting past the end of the vector.");
+
+    if (this->EndX >= this->CapacityX) {
+      size_t EltNo = I-this->begin();
+      this->grow();
+      I = this->begin()+EltNo;
+    }
+
+    ::new ((void*) this->end()) T(::std::move(this->back()));
+    // Push everything else over.
+    std::move_backward(I, this->end()-1, this->end());
+    this->setEnd(this->end()+1);
+
+    // If we just moved the element we're inserting, be sure to update
+    // the reference.
+    T *EltPtr = &Elt;
+    if (I <= EltPtr && EltPtr < this->EndX)
+      ++EltPtr;
+
+    *I = ::std::move(*EltPtr);
+    return I;
+  }
+
+  iterator insert(iterator I, const T &Elt) {
+    if (I == this->end()) {  // Important special case for empty vector.
+      this->push_back(Elt);
+      return this->end()-1;
+    }
+
+    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
+    assert(I <= this->end() && "Inserting past the end of the vector.");
+
+    if (this->EndX >= this->CapacityX) {
+      size_t EltNo = I-this->begin();
+      this->grow();
+      I = this->begin()+EltNo;
+    }
+    ::new ((void*) this->end()) T(std::move(this->back()));
+    // Push everything else over.
+    std::move_backward(I, this->end()-1, this->end());
+    this->setEnd(this->end()+1);
+
+    // If we just moved the element we're inserting, be sure to update
+    // the reference.
+    const T *EltPtr = &Elt;
+    if (I <= EltPtr && EltPtr < this->EndX)
+      ++EltPtr;
+
+    *I = *EltPtr;
+    return I;
+  }
+
+  iterator insert(iterator I, size_type NumToInsert, const T &Elt) {
+    // Convert iterator to elt# to avoid invalidating iterator when we reserve()
+    size_t InsertElt = I - this->begin();
+
+    if (I == this->end()) {  // Important special case for empty vector.
+      append(NumToInsert, Elt);
+      return this->begin()+InsertElt;
+    }
+
+    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
+    assert(I <= this->end() && "Inserting past the end of the vector.");
+
+    // Ensure there is enough space.
+    reserve(this->size() + NumToInsert);
+
+    // Uninvalidate the iterator.
+    I = this->begin()+InsertElt;
+
+    // If there are more elements between the insertion point and the end of the
+    // range than there are being inserted, we can use a simple approach to
+    // insertion.  Since we already reserved space, we know that this won't
+    // reallocate the vector.
+    if (size_t(this->end()-I) >= NumToInsert) {
+      T *OldEnd = this->end();
+      append(std::move_iterator<iterator>(this->end() - NumToInsert),
+             std::move_iterator<iterator>(this->end()));
+
+      // Copy the existing elements that get replaced.
+      std::move_backward(I, OldEnd-NumToInsert, OldEnd);
+
+      std::fill_n(I, NumToInsert, Elt);
+      return I;
+    }
+
+    // Otherwise, we're inserting more elements than exist already, and we're
+    // not inserting at the end.
+
+    // Move over the elements that we're about to overwrite.
+    T *OldEnd = this->end();
+    this->setEnd(this->end() + NumToInsert);
+    size_t NumOverwritten = OldEnd-I;
+    this->uninitialized_move(I, OldEnd, this->end()-NumOverwritten);
+
+    // Replace the overwritten part.
+    std::fill_n(I, NumOverwritten, Elt);
+
+    // Insert the non-overwritten middle part.
+    std::uninitialized_fill_n(OldEnd, NumToInsert-NumOverwritten, Elt);
+    return I;
+  }
+
+  template<typename ItTy>
+  iterator insert(iterator I, ItTy From, ItTy To) {
+    // Convert iterator to elt# to avoid invalidating iterator when we reserve()
+    size_t InsertElt = I - this->begin();
+
+    if (I == this->end()) {  // Important special case for empty vector.
+      append(From, To);
+      return this->begin()+InsertElt;
+    }
+
+    assert(I >= this->begin() && "Insertion iterator is out of bounds.");
+    assert(I <= this->end() && "Inserting past the end of the vector.");
+
+    size_t NumToInsert = std::distance(From, To);
+
+    // Ensure there is enough space.
+    reserve(this->size() + NumToInsert);
+
+    // Uninvalidate the iterator.
+    I = this->begin()+InsertElt;
+
+    // If there are more elements between the insertion point and the end of the
+    // range than there are being inserted, we can use a simple approach to
+    // insertion.  Since we already reserved space, we know that this won't
+    // reallocate the vector.
+    if (size_t(this->end()-I) >= NumToInsert) {
+      T *OldEnd = this->end();
+      append(std::move_iterator<iterator>(this->end() - NumToInsert),
+             std::move_iterator<iterator>(this->end()));
+
+      // Copy the existing elements that get replaced.
+      std::move_backward(I, OldEnd-NumToInsert, OldEnd);
+
+      std::copy(From, To, I);
+      return I;
+    }
+
+    // Otherwise, we're inserting more elements than exist already, and we're
+    // not inserting at the end.
+
+    // Move over the elements that we're about to overwrite.
+    T *OldEnd = this->end();
+    this->setEnd(this->end() + NumToInsert);
+    size_t NumOverwritten = OldEnd-I;
+    this->uninitialized_move(I, OldEnd, this->end()-NumOverwritten);
+
+    // Replace the overwritten part.
+    for (T *J = I; NumOverwritten > 0; --NumOverwritten) {
+      *J = *From;
+      ++J; ++From;
+    }
+
+    // Insert the non-overwritten middle part.
+    this->uninitialized_copy(From, To, OldEnd);
+    return I;
+  }
+
+  void insert(iterator I, std::initializer_list<T> IL) {
+    insert(I, IL.begin(), IL.end());
+  }
+
+  template <typename... ArgTypes> void emplace_back(ArgTypes &&... Args) {
+    if (LLVM_UNLIKELY(this->EndX >= this->CapacityX))
+      this->grow();
+    ::new ((void *)this->end()) T(std::forward<ArgTypes>(Args)...);
+    this->setEnd(this->end() + 1);
+  }
+
+  SmallVectorImpl &operator=(const SmallVectorImpl &RHS);
+
+  SmallVectorImpl &operator=(SmallVectorImpl &&RHS);
+
+  bool operator==(const SmallVectorImpl &RHS) const {
+    if (this->size() != RHS.size()) return false;
+    return std::equal(this->begin(), this->end(), RHS.begin());
+  }
+  bool operator!=(const SmallVectorImpl &RHS) const {
+    return !(*this == RHS);
+  }
+
+  bool operator<(const SmallVectorImpl &RHS) const {
+    return std::lexicographical_compare(this->begin(), this->end(),
+                                        RHS.begin(), RHS.end());
+  }
+
+  /// Set the array size to \p N, which the current array must have enough
+  /// capacity for.
+  ///
+  /// This does not construct or destroy any elements in the vector.
+  ///
+  /// Clients can use this in conjunction with capacity() to write past the end
+  /// of the buffer when they know that more elements are available, and only
+  /// update the size later. This avoids the cost of value initializing elements
+  /// which will only be overwritten.
+  void set_size(size_type N) {
+    assert(N <= this->capacity());
+    this->setEnd(this->begin() + N);
+  }
+};
+
+
+template <typename T>
+void SmallVectorImpl<T>::swap(SmallVectorImpl<T> &RHS) {
+  if (this == &RHS) return;
+
+  // We can only avoid copying elements if neither vector is small.
+  if (!this->isSmall() && !RHS.isSmall()) {
+    std::swap(this->BeginX, RHS.BeginX);
+    std::swap(this->EndX, RHS.EndX);
+    std::swap(this->CapacityX, RHS.CapacityX);
+    return;
+  }
+  if (RHS.size() > this->capacity())
+    this->grow(RHS.size());
+  if (this->size() > RHS.capacity())
+    RHS.grow(this->size());
+
+  // Swap the shared elements.
+  size_t NumShared = this->size();
+  if (NumShared > RHS.size()) NumShared = RHS.size();
+  for (size_type i = 0; i != NumShared; ++i)
+    std::swap((*this)[i], RHS[i]);
+
+  // Copy over the extra elts.
+  if (this->size() > RHS.size()) {
+    size_t EltDiff = this->size() - RHS.size();
+    this->uninitialized_copy(this->begin()+NumShared, this->end(), RHS.end());
+    RHS.setEnd(RHS.end()+EltDiff);
+    this->destroy_range(this->begin()+NumShared, this->end());
+    this->setEnd(this->begin()+NumShared);
+  } else if (RHS.size() > this->size()) {
+    size_t EltDiff = RHS.size() - this->size();
+    this->uninitialized_copy(RHS.begin()+NumShared, RHS.end(), this->end());
+    this->setEnd(this->end() + EltDiff);
+    this->destroy_range(RHS.begin()+NumShared, RHS.end());
+    RHS.setEnd(RHS.begin()+NumShared);
+  }
+}
+
+template <typename T>
+SmallVectorImpl<T> &SmallVectorImpl<T>::
+  operator=(const SmallVectorImpl<T> &RHS) {
+  // Avoid self-assignment.
+  if (this == &RHS) return *this;
+
+  // If we already have sufficient space, assign the common elements, then
+  // destroy any excess.
+  size_t RHSSize = RHS.size();
+  size_t CurSize = this->size();
+  if (CurSize >= RHSSize) {
+    // Assign common elements.
+    iterator NewEnd;
+    if (RHSSize)
+      NewEnd = std::copy(RHS.begin(), RHS.begin()+RHSSize, this->begin());
+    else
+      NewEnd = this->begin();
+
+    // Destroy excess elements.
+    this->destroy_range(NewEnd, this->end());
+
+    // Trim.
+    this->setEnd(NewEnd);
+    return *this;
+  }
+
+  // If we have to grow to have enough elements, destroy the current elements.
+  // This allows us to avoid copying them during the grow.
+  // FIXME: don't do this if they're efficiently moveable.
+  if (this->capacity() < RHSSize) {
+    // Destroy current elements.
+    this->destroy_range(this->begin(), this->end());
+    this->setEnd(this->begin());
+    CurSize = 0;
+    this->grow(RHSSize);
+  } else if (CurSize) {
+    // Otherwise, use assignment for the already-constructed elements.
+    std::copy(RHS.begin(), RHS.begin()+CurSize, this->begin());
+  }
+
+  // Copy construct the new elements in place.
+  this->uninitialized_copy(RHS.begin()+CurSize, RHS.end(),
+                           this->begin()+CurSize);
+
+  // Set end.
+  this->setEnd(this->begin()+RHSSize);
+  return *this;
+}
+
+template <typename T>
+SmallVectorImpl<T> &SmallVectorImpl<T>::operator=(SmallVectorImpl<T> &&RHS) {
+  // Avoid self-assignment.
+  if (this == &RHS) return *this;
+
+  // If the RHS isn't small, clear this vector and then steal its buffer.
+  if (!RHS.isSmall()) {
+    this->destroy_range(this->begin(), this->end());
+    if (!this->isSmall()) free(this->begin());
+    this->BeginX = RHS.BeginX;
+    this->EndX = RHS.EndX;
+    this->CapacityX = RHS.CapacityX;
+    RHS.resetToSmall();
+    return *this;
+  }
+
+  // If we already have sufficient space, assign the common elements, then
+  // destroy any excess.
+  size_t RHSSize = RHS.size();
+  size_t CurSize = this->size();
+  if (CurSize >= RHSSize) {
+    // Assign common elements.
+    iterator NewEnd = this->begin();
+    if (RHSSize)
+      NewEnd = std::move(RHS.begin(), RHS.end(), NewEnd);
+
+    // Destroy excess elements and trim the bounds.
+    this->destroy_range(NewEnd, this->end());
+    this->setEnd(NewEnd);
+
+    // Clear the RHS.
+    RHS.clear();
+
+    return *this;
+  }
+
+  // If we have to grow to have enough elements, destroy the current elements.
+  // This allows us to avoid copying them during the grow.
+  // FIXME: this may not actually make any sense if we can efficiently move
+  // elements.
+  if (this->capacity() < RHSSize) {
+    // Destroy current elements.
+    this->destroy_range(this->begin(), this->end());
+    this->setEnd(this->begin());
+    CurSize = 0;
+    this->grow(RHSSize);
+  } else if (CurSize) {
+    // Otherwise, use assignment for the already-constructed elements.
+    std::move(RHS.begin(), RHS.begin()+CurSize, this->begin());
+  }
+
+  // Move-construct the new elements in place.
+  this->uninitialized_move(RHS.begin()+CurSize, RHS.end(),
+                           this->begin()+CurSize);
+
+  // Set end.
+  this->setEnd(this->begin()+RHSSize);
+
+  RHS.clear();
+  return *this;
+}
+
+/// Storage for the SmallVector elements which aren't contained in
+/// SmallVectorTemplateCommon. There are 'N-1' elements here. The remaining '1'
+/// element is in the base class. This is specialized for the N=1 and N=0 cases
+/// to avoid allocating unnecessary storage.
+template <typename T, unsigned N>
+struct SmallVectorStorage {
+  typename SmallVectorTemplateCommon<T>::U InlineElts[N - 1];
+};
+template <typename T> struct SmallVectorStorage<T, 1> {};
+template <typename T> struct SmallVectorStorage<T, 0> {};
+
+/// This is a 'vector' (really, a variable-sized array), optimized
+/// for the case when the array is small.  It contains some number of elements
+/// in-place, which allows it to avoid heap allocation when the actual number of
+/// elements is below that threshold.  This allows normal "small" cases to be
+/// fast without losing generality for large inputs.
+///
+/// Note that this does not attempt to be exception safe.
+///
+template <typename T, unsigned N>
+class SmallVector : public SmallVectorImpl<T> {
+  /// Inline space for elements which aren't stored in the base class.
+  SmallVectorStorage<T, N> Storage;
+public:
+  SmallVector() : SmallVectorImpl<T>(N) {
+  }
+
+  explicit SmallVector(size_t Size, const T &Value = T())
+    : SmallVectorImpl<T>(N) {
+    this->assign(Size, Value);
+  }
+
+  template<typename ItTy>
+  SmallVector(ItTy S, ItTy E) : SmallVectorImpl<T>(N) {
+    this->append(S, E);
+  }
+
+  template <typename RangeTy>
+  explicit SmallVector(const llvm::iterator_range<RangeTy> R)
+      : SmallVectorImpl<T>(N) {
+    this->append(R.begin(), R.end());
+  }
+
+  SmallVector(std::initializer_list<T> IL) : SmallVectorImpl<T>(N) {
+    this->assign(IL);
+  }
+
+  SmallVector(const SmallVector &RHS) : SmallVectorImpl<T>(N) {
+    if (!RHS.empty())
+      SmallVectorImpl<T>::operator=(RHS);
+  }
+
+  const SmallVector &operator=(const SmallVector &RHS) {
+    SmallVectorImpl<T>::operator=(RHS);
+    return *this;
+  }
+
+  SmallVector(SmallVector &&RHS) : SmallVectorImpl<T>(N) {
+    if (!RHS.empty())
+      SmallVectorImpl<T>::operator=(::std::move(RHS));
+  }
+
+  const SmallVector &operator=(SmallVector &&RHS) {
+    SmallVectorImpl<T>::operator=(::std::move(RHS));
+    return *this;
+  }
+
+  SmallVector(SmallVectorImpl<T> &&RHS) : SmallVectorImpl<T>(N) {
+    if (!RHS.empty())
+      SmallVectorImpl<T>::operator=(::std::move(RHS));
+  }
+
+  const SmallVector &operator=(SmallVectorImpl<T> &&RHS) {
+    SmallVectorImpl<T>::operator=(::std::move(RHS));
+    return *this;
+  }
+
+  const SmallVector &operator=(std::initializer_list<T> IL) {
+    this->assign(IL);
+    return *this;
+  }
+};
+
+template<typename T, unsigned N>
+static inline size_t capacity_in_bytes(const SmallVector<T, N> &X) {
+  return X.capacity_in_bytes();
+}
+
+} // End llvm namespace
+
+namespace std {
+  /// Implement std::swap in terms of SmallVector swap.
+  template<typename T>
+  inline void
+  swap(llvm::SmallVectorImpl<T> &LHS, llvm::SmallVectorImpl<T> &RHS) {
+    LHS.swap(RHS);
+  }
+
+  /// Implement std::swap in terms of SmallVector swap.
+  template<typename T, unsigned N>
+  inline void
+  swap(llvm::SmallVector<T, N> &LHS, llvm::SmallVector<T, N> &RHS) {
+    LHS.swap(RHS);
+  }
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/StringExtras.h b/third_party/wpiutil_2018/src/main/native/include/llvm/StringExtras.h
new file mode 100644
index 0000000..9cf468a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/StringExtras.h
@@ -0,0 +1,197 @@
+//===-- llvm/ADT/StringExtras.h - Useful string functions -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains some functions that are useful when dealing with strings.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_STRINGEXTRAS_H
+#define LLVM_ADT_STRINGEXTRAS_H
+
+#include "llvm/StringRef.h"
+#include <cstdint>
+#include <iterator>
+
+namespace llvm {
+template<typename T> class SmallVectorImpl;
+
+/// hexdigit - Return the hexadecimal character for the
+/// given number \p X (which should be less than 16).
+static inline char hexdigit(unsigned X, bool LowerCase = false) {
+  const char HexChar = LowerCase ? 'a' : 'A';
+  return X < 10 ? '0' + X : HexChar + X - 10;
+}
+
+/// Construct a string ref from a boolean.
+static inline StringRef toStringRef(bool B) {
+  return StringRef(B ? "true" : "false");
+}
+
+/// Interpret the given character \p C as a hexadecimal digit and return its
+/// value.
+///
+/// If \p C is not a valid hex digit, -1U is returned.
+static inline unsigned hexDigitValue(char C) {
+  if (C >= '0' && C <= '9') return C-'0';
+  if (C >= 'a' && C <= 'f') return C-'a'+10U;
+  if (C >= 'A' && C <= 'F') return C-'A'+10U;
+  return -1U;
+}
+
+static inline std::string utohexstr(uint64_t X, bool LowerCase = false) {
+  char Buffer[17];
+  char *BufPtr = std::end(Buffer);
+
+  if (X == 0) *--BufPtr = '0';
+
+  while (X) {
+    unsigned char Mod = static_cast<unsigned char>(X) & 15;
+    *--BufPtr = hexdigit(Mod, LowerCase);
+    X >>= 4;
+  }
+
+  return std::string(BufPtr, std::end(Buffer));
+}
+
+/// Convert buffer \p Input to its hexadecimal representation.
+/// The returned string is double the size of \p Input.
+static inline std::string toHex(StringRef Input) {
+  static const char *const LUT = "0123456789ABCDEF";
+  size_t Length = Input.size();
+
+  std::string Output;
+  Output.reserve(2 * Length);
+  for (size_t i = 0; i < Length; ++i) {
+    const unsigned char c = Input[i];
+    Output.push_back(LUT[c >> 4]);
+    Output.push_back(LUT[c & 15]);
+  }
+  return Output;
+}
+
+static inline std::string utostr(uint64_t X, bool isNeg = false) {
+  char Buffer[21];
+  char *BufPtr = std::end(Buffer);
+
+  if (X == 0) *--BufPtr = '0';  // Handle special case...
+
+  while (X) {
+    *--BufPtr = '0' + char(X % 10);
+    X /= 10;
+  }
+
+  if (isNeg) *--BufPtr = '-';   // Add negative sign...
+  return std::string(BufPtr, std::end(Buffer));
+}
+
+
+static inline std::string itostr(int64_t X) {
+  if (X < 0)
+    return utostr(static_cast<uint64_t>(-X), true);
+  else
+    return utostr(static_cast<uint64_t>(X));
+}
+
+/// StrInStrNoCase - Portable version of strcasestr.  Locates the first
+/// occurrence of string 's1' in string 's2', ignoring case.  Returns
+/// the offset of s2 in s1 or npos if s2 cannot be found.
+StringRef::size_type StrInStrNoCase(StringRef s1, StringRef s2);
+
+/// getToken - This function extracts one token from source, ignoring any
+/// leading characters that appear in the Delimiters string, and ending the
+/// token at any of the characters that appear in the Delimiters string.  If
+/// there are no tokens in the source string, an empty string is returned.
+/// The function returns a pair containing the extracted token and the
+/// remaining tail string.
+std::pair<StringRef, StringRef> getToken(StringRef Source,
+                                         StringRef Delimiters = " \t\n\v\f\r");
+
+/// SplitString - Split up the specified string according to the specified
+/// delimiters, appending the result fragments to the output list.
+void SplitString(StringRef Source,
+                 SmallVectorImpl<StringRef> &OutFragments,
+                 StringRef Delimiters = " \t\n\v\f\r");
+
+/// HashString - Hash function for strings.
+///
+/// This is the Bernstein hash function.
+//
+// FIXME: Investigate whether a modified bernstein hash function performs
+// better: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
+//   X*33+c -> X*33^c
+static inline unsigned HashString(StringRef Str, unsigned Result = 0) {
+  for (StringRef::size_type i = 0, e = Str.size(); i != e; ++i)
+    Result = Result * 33 + (unsigned char)Str[i];
+  return Result;
+}
+
+/// Returns the English suffix for an ordinal integer (-st, -nd, -rd, -th).
+static inline StringRef getOrdinalSuffix(unsigned Val) {
+  // It is critically important that we do this perfectly for
+  // user-written sequences with over 100 elements.
+  switch (Val % 100) {
+  case 11:
+  case 12:
+  case 13:
+    return "th";
+  default:
+    switch (Val % 10) {
+      case 1: return "st";
+      case 2: return "nd";
+      case 3: return "rd";
+      default: return "th";
+    }
+  }
+}
+
+template <typename IteratorT>
+inline std::string join_impl(IteratorT Begin, IteratorT End,
+                             StringRef Separator, std::input_iterator_tag) {
+  std::string S;
+  if (Begin == End)
+    return S;
+
+  S += (*Begin);
+  while (++Begin != End) {
+    S += Separator;
+    S += (*Begin);
+  }
+  return S;
+}
+
+template <typename IteratorT>
+inline std::string join_impl(IteratorT Begin, IteratorT End,
+                             StringRef Separator, std::forward_iterator_tag) {
+  std::string S;
+  if (Begin == End)
+    return S;
+
+  size_t Len = (std::distance(Begin, End) - 1) * Separator.size();
+  for (IteratorT I = Begin; I != End; ++I)
+    Len += (*Begin).size();
+  S.reserve(Len);
+  S += (*Begin);
+  while (++Begin != End) {
+    S += Separator;
+    S += (*Begin);
+  }
+  return S;
+}
+
+/// Joins the strings in the range [Begin, End), adding Separator between
+/// the elements.
+template <typename IteratorT>
+inline std::string join(IteratorT Begin, IteratorT End, StringRef Separator) {
+  typedef typename std::iterator_traits<IteratorT>::iterator_category tag;
+  return join_impl(Begin, End, Separator, tag());
+}
+
+} // End llvm namespace
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/StringMap.h b/third_party/wpiutil_2018/src/main/native/include/llvm/StringMap.h
new file mode 100644
index 0000000..615bdb4
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/StringMap.h
@@ -0,0 +1,563 @@
+//===--- StringMap.h - String Hash table map interface ----------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the StringMap class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_STRINGMAP_H
+#define LLVM_ADT_STRINGMAP_H
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+#include "llvm/PointerLikeTypeTraits.h"
+#include <algorithm>
+#include <cstdlib>
+#include <cstring>
+#include <utility>
+
+namespace llvm {
+  template<typename ValueT>
+  class StringMapConstIterator;
+  template<typename ValueT>
+  class StringMapIterator;
+  template<typename ValueTy>
+  class StringMapEntry;
+
+/// StringMapEntryBase - Shared base class of StringMapEntry instances.
+class StringMapEntryBase {
+  unsigned StrLen;
+
+public:
+  explicit StringMapEntryBase(unsigned Len) : StrLen(Len) {}
+
+  unsigned getKeyLength() const { return StrLen; }
+};
+
+/// StringMapImpl - This is the base class of StringMap that is shared among
+/// all of its instantiations.
+class StringMapImpl {
+protected:
+  // Array of NumBuckets pointers to entries, null pointers are holes.
+  // TheTable[NumBuckets] contains a sentinel value for easy iteration. Followed
+  // by an array of the actual hash values as unsigned integers.
+  StringMapEntryBase **TheTable;
+  unsigned NumBuckets;
+  unsigned NumItems;
+  unsigned NumTombstones;
+  unsigned ItemSize;
+
+protected:
+  explicit StringMapImpl(unsigned itemSize)
+      : TheTable(nullptr),
+        // Initialize the map with zero buckets to allocation.
+        NumBuckets(0), NumItems(0), NumTombstones(0), ItemSize(itemSize) {}
+  StringMapImpl(StringMapImpl &&RHS)
+      : TheTable(RHS.TheTable), NumBuckets(RHS.NumBuckets),
+        NumItems(RHS.NumItems), NumTombstones(RHS.NumTombstones),
+        ItemSize(RHS.ItemSize) {
+    RHS.TheTable = nullptr;
+    RHS.NumBuckets = 0;
+    RHS.NumItems = 0;
+    RHS.NumTombstones = 0;
+  }
+
+  StringMapImpl(unsigned InitSize, unsigned ItemSize);
+  unsigned RehashTable(unsigned BucketNo = 0);
+
+  /// LookupBucketFor - Look up the bucket that the specified string should end
+  /// up in.  If it already exists as a key in the map, the Item pointer for the
+  /// specified bucket will be non-null.  Otherwise, it will be null.  In either
+  /// case, the FullHashValue field of the bucket will be set to the hash value
+  /// of the string.
+  unsigned LookupBucketFor(StringRef Key);
+
+  /// FindKey - Look up the bucket that contains the specified key. If it exists
+  /// in the map, return the bucket number of the key.  Otherwise return -1.
+  /// This does not modify the map.
+  int FindKey(StringRef Key) const;
+
+  /// RemoveKey - Remove the specified StringMapEntry from the table, but do not
+  /// delete it.  This aborts if the value isn't in the table.
+  void RemoveKey(StringMapEntryBase *V);
+
+  /// RemoveKey - Remove the StringMapEntry for the specified key from the
+  /// table, returning it.  If the key is not in the table, this returns null.
+  StringMapEntryBase *RemoveKey(StringRef Key);
+
+  /// Allocate the table with the specified number of buckets and otherwise
+  /// setup the map as empty.
+  void init(unsigned Size);
+
+public:
+  static StringMapEntryBase *getTombstoneVal() {
+    uintptr_t Val = static_cast<uintptr_t>(-1);
+    Val <<= PointerLikeTypeTraits<StringMapEntryBase *>::NumLowBitsAvailable;
+    return reinterpret_cast<StringMapEntryBase *>(Val);
+  }
+
+  unsigned getNumBuckets() const { return NumBuckets; }
+  unsigned getNumItems() const { return NumItems; }
+
+  bool empty() const { return NumItems == 0; }
+  unsigned size() const { return NumItems; }
+
+  void swap(StringMapImpl &Other) {
+    std::swap(TheTable, Other.TheTable);
+    std::swap(NumBuckets, Other.NumBuckets);
+    std::swap(NumItems, Other.NumItems);
+    std::swap(NumTombstones, Other.NumTombstones);
+  }
+};
+
+/// StringMapEntry - This is used to represent one value that is inserted into
+/// a StringMap.  It contains the Value itself and the key: the string length
+/// and data.
+template<typename ValueTy>
+class StringMapEntry : public StringMapEntryBase {
+  StringMapEntry(StringMapEntry &E) = delete;
+
+public:
+  ValueTy second;
+
+  explicit StringMapEntry(unsigned strLen)
+    : StringMapEntryBase(strLen), second() {}
+  template <typename... InitTy>
+  StringMapEntry(unsigned strLen, InitTy &&... InitVals)
+      : StringMapEntryBase(strLen), second(std::forward<InitTy>(InitVals)...) {}
+
+  StringRef getKey() const {
+    return StringRef(getKeyData(), getKeyLength());
+  }
+
+  const ValueTy &getValue() const { return second; }
+  ValueTy &getValue() { return second; }
+
+  void setValue(const ValueTy &V) { second = V; }
+
+  /// getKeyData - Return the start of the string data that is the key for this
+  /// value.  The string data is always stored immediately after the
+  /// StringMapEntry object.
+  const char *getKeyData() const {return reinterpret_cast<const char*>(this+1);}
+
+  StringRef first() const { return StringRef(getKeyData(), getKeyLength()); }
+
+  /// Create a StringMapEntry for the specified key construct the value using
+  /// \p InitiVals.
+  template <typename... InitTy>
+  static StringMapEntry *Create(StringRef Key, InitTy &&... InitVals) {
+    unsigned KeyLength = Key.size();
+
+    // Allocate a new item with space for the string at the end and a null
+    // terminator.
+    unsigned AllocSize = static_cast<unsigned>(sizeof(StringMapEntry))+
+      KeyLength+1;
+
+    StringMapEntry *NewItem =
+      static_cast<StringMapEntry*>(std::malloc(AllocSize));
+
+    // Construct the value.
+    new (NewItem) StringMapEntry(KeyLength, std::forward<InitTy>(InitVals)...);
+
+    // Copy the string information.
+    char *StrBuffer = const_cast<char*>(NewItem->getKeyData());
+    if (KeyLength > 0)
+      memcpy(StrBuffer, Key.data(), KeyLength);
+    StrBuffer[KeyLength] = 0;  // Null terminate for convenience of clients.
+    return NewItem;
+  }
+
+  static StringMapEntry *Create(StringRef Key) {
+    return Create(Key, ValueTy());
+  }
+
+  /// GetStringMapEntryFromKeyData - Given key data that is known to be embedded
+  /// into a StringMapEntry, return the StringMapEntry itself.
+  static StringMapEntry &GetStringMapEntryFromKeyData(const char *KeyData) {
+    char *Ptr = const_cast<char*>(KeyData) - sizeof(StringMapEntry<ValueTy>);
+    return *reinterpret_cast<StringMapEntry*>(Ptr);
+  }
+
+  /// Destroy - Destroy this StringMapEntry, releasing memory back to the
+  /// specified allocator.
+  void Destroy() {
+    // Free memory referenced by the item.
+    this->~StringMapEntry();
+    std::free(static_cast<void *>(this));
+  }
+};
+
+
+/// StringMap - This is an unconventional map that is specialized for handling
+/// keys that are "strings", which are basically ranges of bytes. This does some
+/// funky memory allocation and hashing things to make it extremely efficient,
+/// storing the string data *after* the value in the map.
+template<typename ValueTy>
+class StringMap : public StringMapImpl {
+public:
+  typedef StringMapEntry<ValueTy> MapEntryTy;
+
+  StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
+  explicit StringMap(unsigned InitialSize)
+    : StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
+
+  StringMap(std::initializer_list<std::pair<StringRef, ValueTy>> List)
+      : StringMapImpl(List.size(), static_cast<unsigned>(sizeof(MapEntryTy))) {
+    for (const auto &P : List) {
+      insert(P);
+    }
+  }
+
+  StringMap(StringMap &&RHS)
+      : StringMapImpl(std::move(RHS)) {}
+
+  StringMap &operator=(StringMap RHS) {
+    StringMapImpl::swap(RHS);
+    return *this;
+  }
+
+  StringMap(const StringMap &RHS) :
+    StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {
+    if (RHS.empty())
+      return;
+
+    // Allocate TheTable of the same size as RHS's TheTable, and set the
+    // sentinel appropriately (and NumBuckets).
+    init(RHS.NumBuckets);
+    unsigned *HashTable = (unsigned *)(TheTable + NumBuckets + 1),
+             *RHSHashTable = (unsigned *)(RHS.TheTable + NumBuckets + 1);
+
+    NumItems = RHS.NumItems;
+    NumTombstones = RHS.NumTombstones;
+    for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+      StringMapEntryBase *Bucket = RHS.TheTable[I];
+      if (!Bucket || Bucket == getTombstoneVal()) {
+        TheTable[I] = Bucket;
+        continue;
+      }
+
+      TheTable[I] = MapEntryTy::Create(
+          static_cast<MapEntryTy *>(Bucket)->getKey(),
+          static_cast<MapEntryTy *>(Bucket)->getValue());
+      HashTable[I] = RHSHashTable[I];
+    }
+
+    // Note that here we've copied everything from the RHS into this object,
+    // tombstones included. We could, instead, have re-probed for each key to
+    // instantiate this new object without any tombstone buckets. The
+    // assumption here is that items are rarely deleted from most StringMaps,
+    // and so tombstones are rare, so the cost of re-probing for all inputs is
+    // not worthwhile.
+  }
+
+
+  typedef const char* key_type;
+  typedef ValueTy mapped_type;
+  typedef StringMapEntry<ValueTy> value_type;
+  typedef size_t size_type;
+
+  typedef StringMapConstIterator<ValueTy> const_iterator;
+  typedef StringMapIterator<ValueTy> iterator;
+
+  iterator begin() {
+    return iterator(TheTable, NumBuckets == 0);
+  }
+  iterator end() {
+    return iterator(TheTable+NumBuckets, true);
+  }
+  const_iterator begin() const {
+    return const_iterator(TheTable, NumBuckets == 0);
+  }
+  const_iterator end() const {
+    return const_iterator(TheTable+NumBuckets, true);
+  }
+
+  iterator find(StringRef Key) {
+    int Bucket = FindKey(Key);
+    if (Bucket == -1) return end();
+    return iterator(TheTable+Bucket, true);
+  }
+
+  const_iterator find(StringRef Key) const {
+    int Bucket = FindKey(Key);
+    if (Bucket == -1) return end();
+    return const_iterator(TheTable+Bucket, true);
+  }
+
+  /// lookup - Return the entry for the specified key, or a default
+  /// constructed value if no such entry exists.
+  ValueTy lookup(StringRef Key) const {
+    const_iterator it = find(Key);
+    if (it != end())
+      return it->second;
+    return ValueTy();
+  }
+
+  /// Lookup the ValueTy for the \p Key, or create a default constructed value
+  /// if the key is not in the map.
+  ValueTy &operator[](StringRef Key) {
+    return emplace_second(Key).first->second;
+  }
+
+  /// count - Return 1 if the element is in the map, 0 otherwise.
+  size_type count(StringRef Key) const {
+    return find(Key) == end() ? 0 : 1;
+  }
+
+  /// insert - Insert the specified key/value pair into the map.  If the key
+  /// already exists in the map, return false and ignore the request, otherwise
+  /// insert it and return true.
+  bool insert(MapEntryTy *KeyValue) {
+    unsigned BucketNo = LookupBucketFor(KeyValue->getKey());
+    StringMapEntryBase *&Bucket = TheTable[BucketNo];
+    if (Bucket && Bucket != getTombstoneVal())
+      return false;  // Already exists in map.
+
+    if (Bucket == getTombstoneVal())
+      --NumTombstones;
+    Bucket = KeyValue;
+    ++NumItems;
+    assert(NumItems + NumTombstones <= NumBuckets);
+
+    RehashTable();
+    return true;
+  }
+
+  /// insert - Inserts the specified key/value pair into the map if the key
+  /// isn't already in the map. The bool component of the returned pair is true
+  /// if and only if the insertion takes place, and the iterator component of
+  /// the pair points to the element with key equivalent to the key of the pair.
+  std::pair<iterator, bool> insert(std::pair<StringRef, ValueTy> KV) {
+    return emplace_second(KV.first, std::move(KV.second));
+  }
+
+  /// Emplace a new element for the specified key into the map if the key isn't
+  /// already in the map. The bool component of the returned pair is true
+  /// if and only if the insertion takes place, and the iterator component of
+  /// the pair points to the element with key equivalent to the key of the pair.
+  template <typename... ArgsTy>
+  std::pair<iterator, bool> emplace_second(StringRef Key, ArgsTy &&... Args) {
+    unsigned BucketNo = LookupBucketFor(Key);
+    StringMapEntryBase *&Bucket = TheTable[BucketNo];
+    if (Bucket && Bucket != getTombstoneVal())
+      return std::make_pair(iterator(TheTable + BucketNo, false),
+                            false); // Already exists in map.
+
+    if (Bucket == getTombstoneVal())
+      --NumTombstones;
+    Bucket = MapEntryTy::Create(Key, std::forward<ArgsTy>(Args)...);
+    ++NumItems;
+    assert(NumItems + NumTombstones <= NumBuckets);
+
+    BucketNo = RehashTable(BucketNo);
+    return std::make_pair(iterator(TheTable + BucketNo, false), true);
+  }
+
+  // clear - Empties out the StringMap
+  void clear() {
+    if (empty()) return;
+
+    // Zap all values, resetting the keys back to non-present (not tombstone),
+    // which is safe because we're removing all elements.
+    for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+      StringMapEntryBase *&Bucket = TheTable[I];
+      if (Bucket && Bucket != getTombstoneVal()) {
+        static_cast<MapEntryTy*>(Bucket)->Destroy();
+      }
+      Bucket = nullptr;
+    }
+
+    NumItems = 0;
+    NumTombstones = 0;
+  }
+
+  /// remove - Remove the specified key/value pair from the map, but do not
+  /// erase it.  This aborts if the key is not in the map.
+  void remove(MapEntryTy *KeyValue) {
+    RemoveKey(KeyValue);
+  }
+
+  void erase(iterator I) {
+    MapEntryTy &V = *I;
+    remove(&V);
+    V.Destroy();
+  }
+
+  bool erase(StringRef Key) {
+    iterator I = find(Key);
+    if (I == end()) return false;
+    erase(I);
+    return true;
+  }
+
+  ~StringMap() {
+    // Delete all the elements in the map, but don't reset the elements
+    // to default values.  This is a copy of clear(), but avoids unnecessary
+    // work not required in the destructor.
+    if (!empty()) {
+      for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
+        StringMapEntryBase *Bucket = TheTable[I];
+        if (Bucket && Bucket != getTombstoneVal()) {
+          static_cast<MapEntryTy*>(Bucket)->Destroy();
+        }
+      }
+    }
+    free(TheTable);
+  }
+};
+
+template <typename ValueTy> class StringMapConstIterator {
+protected:
+  StringMapEntryBase **Ptr;
+
+public:
+  typedef StringMapEntry<ValueTy> value_type;
+
+  StringMapConstIterator() : Ptr(nullptr) { }
+
+  explicit StringMapConstIterator(StringMapEntryBase **Bucket,
+                                  bool NoAdvance = false)
+  : Ptr(Bucket) {
+    if (!NoAdvance) AdvancePastEmptyBuckets();
+  }
+
+  const value_type &operator*() const {
+    return *static_cast<StringMapEntry<ValueTy>*>(*Ptr);
+  }
+  const value_type *operator->() const {
+    return static_cast<StringMapEntry<ValueTy>*>(*Ptr);
+  }
+
+  bool operator==(const StringMapConstIterator &RHS) const {
+    return Ptr == RHS.Ptr;
+  }
+  bool operator!=(const StringMapConstIterator &RHS) const {
+    return Ptr != RHS.Ptr;
+  }
+
+  inline StringMapConstIterator& operator++() {   // Preincrement
+    ++Ptr;
+    AdvancePastEmptyBuckets();
+    return *this;
+  }
+  StringMapConstIterator operator++(int) {        // Postincrement
+    StringMapConstIterator tmp = *this; ++*this; return tmp;
+  }
+
+private:
+  void AdvancePastEmptyBuckets() {
+    while (*Ptr == nullptr || *Ptr == StringMapImpl::getTombstoneVal())
+      ++Ptr;
+  }
+};
+
+template<typename ValueTy>
+class StringMapIterator : public StringMapConstIterator<ValueTy> {
+public:
+  StringMapIterator() {}
+  explicit StringMapIterator(StringMapEntryBase **Bucket,
+                             bool NoAdvance = false)
+    : StringMapConstIterator<ValueTy>(Bucket, NoAdvance) {
+  }
+  StringMapEntry<ValueTy> &operator*() const {
+    return *static_cast<StringMapEntry<ValueTy>*>(*this->Ptr);
+  }
+  StringMapEntry<ValueTy> *operator->() const {
+    return static_cast<StringMapEntry<ValueTy>*>(*this->Ptr);
+  }
+};
+
+template <typename ValueTy>
+bool operator==(const StringMap<ValueTy>& lhs, const StringMap<ValueTy>& rhs) {
+  // same instance?
+  if (&lhs == &rhs) return true;
+
+  // first check that sizes are identical
+  if (lhs.size() != rhs.size()) return false;
+
+  // copy into vectors and sort by key
+  SmallVector<StringMapConstIterator<ValueTy>, 16> lhs_items;
+  lhs_items.reserve(lhs.size());
+  for (auto i = lhs.begin(), end = lhs.end(); i != end; ++i)
+    lhs_items.push_back(i);
+  std::sort(lhs_items.begin(), lhs_items.end(),
+            [](const StringMapConstIterator<ValueTy>& a,
+               const StringMapConstIterator<ValueTy>& b) {
+              return a->getKey() < b->getKey();
+            });
+
+  SmallVector<StringMapConstIterator<ValueTy>, 16> rhs_items;
+  rhs_items.reserve(rhs.size());
+  for (auto i = rhs.begin(), end = rhs.end(); i != end; ++i)
+    rhs_items.push_back(i);
+  std::sort(rhs_items.begin(), rhs_items.end(),
+            [](const StringMapConstIterator<ValueTy>& a,
+               const StringMapConstIterator<ValueTy>& b) {
+              return a->getKey() < b->getKey();
+            });
+
+  // compare vector keys and values
+  for (auto a = lhs_items.begin(), b = rhs_items.begin(),
+            aend = lhs_items.end(), bend = rhs_items.end();
+       a != aend && b != bend; ++a, ++b) {
+    if ((*a)->first() != (*b)->first() || (*a)->second != (*b)->second)
+      return false;
+  }
+  return true;
+}
+
+template <typename ValueTy>
+inline bool operator!=(const StringMap<ValueTy>& lhs,
+                       const StringMap<ValueTy>& rhs) {
+  return !(lhs == rhs);
+}
+
+template <typename ValueTy>
+bool operator<(const StringMap<ValueTy>& lhs, const StringMap<ValueTy>& rhs) {
+  // same instance?
+  if (&lhs == &rhs) return false;
+
+  // copy into vectors and sort by key
+  SmallVector<StringRef, 16> lhs_keys;
+  lhs_keys.reserve(lhs.size());
+  for (auto i = lhs.begin(), end = lhs.end(); i != end; ++i)
+    lhs_keys.push_back(i->getKey());
+  std::sort(lhs_keys.begin(), lhs_keys.end());
+
+  SmallVector<StringRef, 16> rhs_keys;
+  rhs_keys.reserve(rhs.size());
+  for (auto i = rhs.begin(), end = rhs.end(); i != end; ++i)
+    rhs_keys.push_back(i->getKey());
+  std::sort(rhs_keys.begin(), rhs_keys.end());
+
+  // use std::vector comparison
+  return lhs_keys < rhs_keys;
+}
+
+template <typename ValueTy>
+inline bool operator<=(const StringMap<ValueTy>& lhs,
+                       const StringMap<ValueTy>& rhs) {
+  return !(rhs < lhs);
+}
+
+template <typename ValueTy>
+inline bool operator>(const StringMap<ValueTy>& lhs,
+                      const StringMap<ValueTy>& rhs) {
+  return !(lhs <= rhs);
+}
+
+template <typename ValueTy>
+inline bool operator>=(const StringMap<ValueTy>& lhs,
+                       const StringMap<ValueTy>& rhs) {
+  return !(lhs < rhs);
+}
+
+} // namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/StringRef.h b/third_party/wpiutil_2018/src/main/native/include/llvm/StringRef.h
new file mode 100644
index 0000000..7f149b3
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/StringRef.h
@@ -0,0 +1,626 @@
+//===--- StringRef.h - Constant String Reference Wrapper --------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_STRINGREF_H
+#define LLVM_ADT_STRINGREF_H
+
+#include "llvm/iterator_range.h"
+#include "llvm/Compiler.h"
+#include <algorithm>
+#include <cassert>
+#include <cstring>
+#include <limits>
+#include <ostream>
+#include <string>
+#include <utility>
+
+namespace llvm {
+  template <typename T>
+  class SmallVectorImpl;
+  class hash_code;
+  class StringRef;
+
+  /// Helper functions for StringRef::getAsInteger.
+  bool getAsUnsignedInteger(StringRef Str, unsigned Radix,
+                            unsigned long long &Result);
+
+  bool getAsSignedInteger(StringRef Str, unsigned Radix, long long &Result);
+
+  /// StringRef - Represent a constant reference to a string, i.e. a character
+  /// array and a length, which need not be null terminated.
+  ///
+  /// This class does not own the string data, it is expected to be used in
+  /// situations where the character data resides in some other buffer, whose
+  /// lifetime extends past that of the StringRef. For this reason, it is not in
+  /// general safe to store a StringRef.
+  class StringRef {
+  public:
+    typedef const char *iterator;
+    typedef const char *const_iterator;
+    static const size_t npos = ~size_t(0);
+    typedef size_t size_type;
+
+  private:
+    /// The start of the string, in an external buffer.
+    const char *Data;
+
+    /// The length of the string.
+    /// MSB of length indicates if we are null terminated or not
+    /// Flag set is null terminated, flag not set is not
+    size_t Length;
+
+    // Workaround memcmp issue with null pointers (undefined behavior)
+    // by providing a specialized version
+    static int compareMemory(const char *Lhs, const char *Rhs, size_t Length) {
+      if (Length == 0) { return 0; }
+      return ::memcmp(Lhs,Rhs,Length);
+    }
+
+    /// Set the flag to say we are null terminated
+    void set_null_terminated(bool set) {
+      if (set)
+        Length |= ((size_t)1 << (sizeof(size_t) * 8 - 1));
+      else {
+        Length &= ~((size_t)1 << (sizeof(size_t) * 8 - 1));
+      }
+    }
+
+  public:
+    /// @name Constructors
+    /// @{
+
+    /// Construct an empty string ref.
+    /*implicit*/ StringRef() : Data(""), Length(0) {
+        set_null_terminated(true);
+      }
+
+    /// Construct a string ref from a cstring.
+    /*implicit*/ StringRef(const char *Str)
+      : Data(Str) {
+        assert(Str && "StringRef cannot be built from a NULL argument");
+        Length = ::strlen(Str); // invoking strlen(NULL) is undefined behavior
+        // Require length to not use MSB of size
+        assert(Length < ~((size_t)1 << (sizeof(size_t) * 8 - 1)));
+        // If from a const char*, we are null terminated
+        set_null_terminated(true);
+      }
+
+    /// Construct a string ref from a pointer and length.
+    /*implicit*/ StringRef(const char *data, size_t length, bool isNullTerminated = false)
+      : Data(data), Length(length) {
+        assert((data || length == 0) &&
+        "StringRef cannot be built from a NULL argument with non-null length");
+        // Require length to not use MSB of size
+        assert(Length < ~((size_t)1 << (sizeof(size_t) * 8 - 1)));
+        // If passed an explicit length, use the parameter
+        // Default to false (not null) to match previous behavior.
+        set_null_terminated(isNullTerminated);
+      }
+
+    /// Construct a string ref from an std::string.
+    /*implicit*/ StringRef(const std::string &Str)
+    : Data(Str.data()), Length(Str.length()) {
+        // Require length to not use MSB of size
+        assert(Length < ~((size_t)1 << (sizeof(size_t) * 8 - 1)));
+        // If from a std::string, we are null terminated
+        set_null_terminated(true);
+      }
+
+    /// @}
+    /// @name Iterators
+    /// @{
+
+    iterator begin() const { return Data; }
+
+    iterator end() const { return Data + size(); }
+
+    const unsigned char *bytes_begin() const {
+      return reinterpret_cast<const unsigned char *>(begin());
+    }
+    const unsigned char *bytes_end() const {
+      return reinterpret_cast<const unsigned char *>(end());
+    }
+    iterator_range<const unsigned char *> bytes() const {
+      return make_range(bytes_begin(), bytes_end());
+    }
+
+    /// @}
+    /// @name String Operations
+    /// @{
+
+    /// data - Get a pointer to the start of the string (which may not be null
+    /// terminated).
+    const char *data() const { return Data; }
+
+    /// c_str - Get a null terminated pointer to the start of the string
+    /// If string is not null terminated, use buffer to store new string
+    const char *c_str(llvm::SmallVectorImpl<char>& buf) const;
+
+    /// empty - Check if the string is empty.
+    bool empty() const { return size() == 0; }
+
+    /// size - Get the string size.
+    size_t size() const {
+      return Length & ~((size_t)1 << (sizeof(size_t) * 8 - 1));
+    }
+
+    /// is_null_terminated - Get if the string is guaranteed null terminated
+    bool is_null_terminated() const {
+      return (Length & ((size_t)1 << (sizeof(size_t) * 8 - 1))) ==
+             ((size_t)1 << (sizeof(size_t) * 8 - 1));
+    }
+
+    /// front - Get the first character in the string.
+    char front() const {
+      assert(!empty());
+      return Data[0];
+    }
+
+    /// back - Get the last character in the string.
+    char back() const {
+      assert(!empty());
+      return Data[size()-1];
+    }
+
+    // copy - Allocate copy in Allocator and return StringRef to it.
+    template <typename Allocator> StringRef copy(Allocator &A) const {
+      // Don't request a length 0 copy from the allocator.
+      if (empty())
+        return StringRef();
+      char *S = A.template Allocate<char>(size());
+      std::copy(begin(), end(), S);
+      return StringRef(S, size());
+    }
+
+    /// equals - Check for string equality, this is more efficient than
+    /// compare() when the relative ordering of inequal strings isn't needed.
+    bool equals(StringRef RHS) const {
+      return (size() == RHS.size() &&
+              compareMemory(Data, RHS.Data, RHS.size()) == 0);
+    }
+
+    /// equals_lower - Check for string equality, ignoring case.
+    bool equals_lower(StringRef RHS) const {
+      return size() == RHS.size() && compare_lower(RHS) == 0;
+    }
+
+    /// compare - Compare two strings; the result is -1, 0, or 1 if this string
+    /// is lexicographically less than, equal to, or greater than the \p RHS.
+    int compare(StringRef RHS) const {
+      // Check the prefix for a mismatch.
+      if (int Res = compareMemory(Data, RHS.Data, std::min(size(), RHS.size())))
+        return Res < 0 ? -1 : 1;
+
+      // Otherwise the prefixes match, so we only need to check the lengths.
+      if (size() == RHS.size())
+        return 0;
+      return size() < RHS.size() ? -1 : 1;
+    }
+
+    /// compare_lower - Compare two strings, ignoring case.
+    int compare_lower(StringRef RHS) const;
+
+    /// compare_numeric - Compare two strings, treating sequences of digits as
+    /// numbers.
+    int compare_numeric(StringRef RHS) const;
+
+    /// str - Get the contents as an std::string.
+    std::string str() const {
+      if (!Data) return std::string();
+      return std::string(Data, size());
+    }
+
+    /// @}
+    /// @name Operator Overloads
+    /// @{
+
+    char operator[](size_t Index) const {
+      assert(Index < size() && "Invalid index!");
+      return Data[Index];
+    }
+
+    /// @}
+    /// @name Type Conversions
+    /// @{
+
+    operator std::string() const {
+      return str();
+    }
+
+    /// @}
+    /// @name String Predicates
+    /// @{
+
+    /// Check if this string starts with the given \p Prefix.
+    bool startswith(StringRef Prefix) const {
+      return size() >= Prefix.size() &&
+             compareMemory(Data, Prefix.Data, Prefix.size()) == 0;
+    }
+
+    /// Check if this string starts with the given \p Prefix, ignoring case.
+    bool startswith_lower(StringRef Prefix) const;
+
+    /// Check if this string ends with the given \p Suffix.
+    bool endswith(StringRef Suffix) const {
+      return size() >= Suffix.size() &&
+        compareMemory(end() - Suffix.size(), Suffix.Data, Suffix.size()) == 0;
+    }
+
+    /// Check if this string ends with the given \p Suffix, ignoring case.
+    bool endswith_lower(StringRef Suffix) const;
+
+    /// @}
+    /// @name String Searching
+    /// @{
+
+    /// Search for the first character \p C in the string.
+    ///
+    /// \returns The index of the first occurrence of \p C, or npos if not
+    /// found.
+    size_t find(char C, size_t From = 0) const {
+      size_t FindBegin = std::min(From, size());
+      if (FindBegin < size()) { // Avoid calling memchr with nullptr.
+        // Just forward to memchr, which is faster than a hand-rolled loop.
+        if (const void *P = ::memchr(Data + FindBegin, C, size() - FindBegin))
+          return static_cast<const char *>(P) - Data;
+      }
+      return npos;
+    }
+
+    /// Search for the first string \p Str in the string.
+    ///
+    /// \returns The index of the first occurrence of \p Str, or npos if not
+    /// found.
+    size_t find(StringRef Str, size_t From = 0) const;
+
+    /// Search for the last character \p C in the string.
+    ///
+    /// \returns The index of the last occurrence of \p C, or npos if not
+    /// found.
+    size_t rfind(char C, size_t From = npos) const {
+      From = std::min(From, size());
+      size_t i = From;
+      while (i != 0) {
+        --i;
+        if (Data[i] == C)
+          return i;
+      }
+      return npos;
+    }
+
+    /// Search for the last string \p Str in the string.
+    ///
+    /// \returns The index of the last occurrence of \p Str, or npos if not
+    /// found.
+    size_t rfind(StringRef Str) const;
+
+    /// Find the first character in the string that is \p C, or npos if not
+    /// found. Same as find.
+    size_t find_first_of(char C, size_t From = 0) const {
+      return find(C, From);
+    }
+
+    /// Find the first character in the string that is in \p Chars, or npos if
+    /// not found.
+    ///
+    /// Complexity: O(size() + Chars.size())
+    size_t find_first_of(StringRef Chars, size_t From = 0) const;
+
+    /// Find the first character in the string that is not \p C or npos if not
+    /// found.
+    size_t find_first_not_of(char C, size_t From = 0) const;
+
+    /// Find the first character in the string that is not in the string
+    /// \p Chars, or npos if not found.
+    ///
+    /// Complexity: O(size() + Chars.size())
+    size_t find_first_not_of(StringRef Chars, size_t From = 0) const;
+
+    /// Find the last character in the string that is \p C, or npos if not
+    /// found.
+    size_t find_last_of(char C, size_t From = npos) const {
+      return rfind(C, From);
+    }
+
+    /// Find the last character in the string that is in \p C, or npos if not
+    /// found.
+    ///
+    /// Complexity: O(size() + Chars.size())
+    size_t find_last_of(StringRef Chars, size_t From = npos) const;
+
+    /// Find the last character in the string that is not \p C, or npos if not
+    /// found.
+    size_t find_last_not_of(char C, size_t From = npos) const;
+
+    /// Find the last character in the string that is not in \p Chars, or
+    /// npos if not found.
+    ///
+    /// Complexity: O(size() + Chars.size())
+    size_t find_last_not_of(StringRef Chars, size_t From = npos) const;
+
+    /// @}
+    /// @name Helpful Algorithms
+    /// @{
+
+    /// Return the number of occurrences of \p C in the string.
+    size_t count(char C) const {
+      size_t Count = 0;
+      for (size_t i = 0, e = size(); i != e; ++i)
+        if (Data[i] == C)
+          ++Count;
+      return Count;
+    }
+
+    /// Return the number of non-overlapped occurrences of \p Str in
+    /// the string.
+    size_t count(StringRef Str) const;
+
+    /// Parse the current string as an integer of the specified radix.  If
+    /// \p Radix is specified as zero, this does radix autosensing using
+    /// extended C rules: 0 is octal, 0x is hex, 0b is binary.
+    ///
+    /// If the string is invalid or if only a subset of the string is valid,
+    /// this returns true to signify the error.  The string is considered
+    /// erroneous if empty or if it overflows T.
+    template <typename T>
+    typename std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
+    getAsInteger(unsigned Radix, T &Result) const {
+      long long LLVal;
+      if (getAsSignedInteger(*this, Radix, LLVal) ||
+            static_cast<T>(LLVal) != LLVal)
+        return true;
+      Result = LLVal;
+      return false;
+    }
+
+    template <typename T>
+    typename std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type
+    getAsInteger(unsigned Radix, T &Result) const {
+      unsigned long long ULLVal;
+      // The additional cast to unsigned long long is required to avoid the
+      // Visual C++ warning C4805: '!=' : unsafe mix of type 'bool' and type
+      // 'unsigned __int64' when instantiating getAsInteger with T = bool.
+      if (getAsUnsignedInteger(*this, Radix, ULLVal) ||
+          static_cast<unsigned long long>(static_cast<T>(ULLVal)) != ULLVal)
+        return true;
+      Result = ULLVal;
+      return false;
+    }
+
+    /// @}
+    /// @name String Operations
+    /// @{
+
+    // Convert the given ASCII string to lowercase.
+    std::string lower() const;
+
+    /// Convert the given ASCII string to uppercase.
+    std::string upper() const;
+
+    /// @}
+    /// @name Substring Operations
+    /// @{
+
+    /// Return a reference to the substring from [Start, Start + N).
+    ///
+    /// \param Start The index of the starting character in the substring; if
+    /// the index is npos or greater than the length of the string then the
+    /// empty substring will be returned.
+    ///
+    /// \param N The number of characters to included in the substring. If N
+    /// exceeds the number of characters remaining in the string, the string
+    /// suffix (starting with \p Start) will be returned.
+    StringRef substr(size_t Start, size_t N = npos) const {
+      Start = std::min(Start, size());
+      return StringRef(Data + Start, std::min(N, size() - Start));
+    }
+
+    /// Return a StringRef equal to 'this' but with the first \p N elements
+    /// dropped.
+    StringRef drop_front(size_t N = 1) const {
+      assert(size() >= N && "Dropping more elements than exist");
+      return substr(N);
+    }
+
+    /// Return a StringRef equal to 'this' but with the last \p N elements
+    /// dropped.
+    StringRef drop_back(size_t N = 1) const {
+      assert(size() >= N && "Dropping more elements than exist");
+      return substr(0, size()-N);
+    }
+
+    /// Return a reference to the substring from [Start, End).
+    ///
+    /// \param Start The index of the starting character in the substring; if
+    /// the index is npos or greater than the length of the string then the
+    /// empty substring will be returned.
+    ///
+    /// \param End The index following the last character to include in the
+    /// substring. If this is npos or exceeds the number of characters
+    /// remaining in the string, the string suffix (starting with \p Start)
+    /// will be returned. If this is less than \p Start, an empty string will
+    /// be returned.
+    StringRef slice(size_t Start, size_t End) const {
+      Start = std::min(Start, size());
+      End = std::min(std::max(Start, End), size());
+      return StringRef(Data + Start, End - Start);
+    }
+
+    /// Split into two substrings around the first occurrence of a separator
+    /// character.
+    ///
+    /// If \p Separator is in the string, then the result is a pair (LHS, RHS)
+    /// such that (*this == LHS + Separator + RHS) is true and RHS is
+    /// maximal. If \p Separator is not in the string, then the result is a
+    /// pair (LHS, RHS) where (*this == LHS) and (RHS == "").
+    ///
+    /// \param Separator The character to split on.
+    /// \returns The split substrings.
+    std::pair<StringRef, StringRef> split(char Separator) const {
+      size_t Idx = find(Separator);
+      if (Idx == npos)
+        return std::make_pair(*this, StringRef());
+      return std::make_pair(slice(0, Idx), slice(Idx+1, npos));
+    }
+
+    /// Split into two substrings around the first occurrence of a separator
+    /// string.
+    ///
+    /// If \p Separator is in the string, then the result is a pair (LHS, RHS)
+    /// such that (*this == LHS + Separator + RHS) is true and RHS is
+    /// maximal. If \p Separator is not in the string, then the result is a
+    /// pair (LHS, RHS) where (*this == LHS) and (RHS == "").
+    ///
+    /// \param Separator - The string to split on.
+    /// \return - The split substrings.
+    std::pair<StringRef, StringRef> split(StringRef Separator) const {
+      size_t Idx = find(Separator);
+      if (Idx == npos)
+        return std::make_pair(*this, StringRef());
+      return std::make_pair(slice(0, Idx), slice(Idx + Separator.size(), npos));
+    }
+
+    /// Split into substrings around the occurrences of a separator string.
+    ///
+    /// Each substring is stored in \p A. If \p MaxSplit is >= 0, at most
+    /// \p MaxSplit splits are done and consequently <= \p MaxSplit + 1
+    /// elements are added to A.
+    /// If \p KeepEmpty is false, empty strings are not added to \p A. They
+    /// still count when considering \p MaxSplit
+    /// An useful invariant is that
+    /// Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true
+    ///
+    /// \param A - Where to put the substrings.
+    /// \param Separator - The string to split on.
+    /// \param MaxSplit - The maximum number of times the string is split.
+    /// \param KeepEmpty - True if empty substring should be added.
+    void split(SmallVectorImpl<StringRef> &A,
+               StringRef Separator, int MaxSplit = -1,
+               bool KeepEmpty = true) const;
+
+    /// Split into substrings around the occurrences of a separator character.
+    ///
+    /// Each substring is stored in \p A. If \p MaxSplit is >= 0, at most
+    /// \p MaxSplit splits are done and consequently <= \p MaxSplit + 1
+    /// elements are added to A.
+    /// If \p KeepEmpty is false, empty strings are not added to \p A. They
+    /// still count when considering \p MaxSplit
+    /// An useful invariant is that
+    /// Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true
+    ///
+    /// \param A - Where to put the substrings.
+    /// \param Separator - The string to split on.
+    /// \param MaxSplit - The maximum number of times the string is split.
+    /// \param KeepEmpty - True if empty substring should be added.
+    void split(SmallVectorImpl<StringRef> &A, char Separator, int MaxSplit = -1,
+               bool KeepEmpty = true) const;
+
+    /// Split into two substrings around the last occurrence of a separator
+    /// character.
+    ///
+    /// If \p Separator is in the string, then the result is a pair (LHS, RHS)
+    /// such that (*this == LHS + Separator + RHS) is true and RHS is
+    /// minimal. If \p Separator is not in the string, then the result is a
+    /// pair (LHS, RHS) where (*this == LHS) and (RHS == "").
+    ///
+    /// \param Separator - The character to split on.
+    /// \return - The split substrings.
+    std::pair<StringRef, StringRef> rsplit(char Separator) const {
+      size_t Idx = rfind(Separator);
+      if (Idx == npos)
+        return std::make_pair(*this, StringRef());
+      return std::make_pair(slice(0, Idx), slice(Idx+1, npos));
+    }
+
+    /// Return string with consecutive \p Char characters starting from the
+    /// the left removed.
+    StringRef ltrim(char Char) const {
+      return drop_front(std::min(size(), find_first_not_of(Char)));
+    }
+
+    /// Return string with consecutive characters in \p Chars starting from
+    /// the left removed.
+    StringRef ltrim(StringRef Chars = " \t\n\v\f\r") const {
+      return drop_front(std::min(size(), find_first_not_of(Chars)));
+    }
+
+    /// Return string with consecutive \p Char characters starting from the
+    /// right removed.
+    StringRef rtrim(char Char) const {
+      return drop_back(size() - std::min(size(), find_last_not_of(Char) + 1));
+    }
+
+    /// Return string with consecutive characters in \p Chars starting from
+    /// the right removed.
+    StringRef rtrim(StringRef Chars = " \t\n\v\f\r") const {
+      return drop_back(size() - std::min(size(), find_last_not_of(Chars) + 1));
+    }
+
+    /// Return string with consecutive \p Char characters starting from the
+    /// left and right removed.
+    StringRef trim(char Char) const {
+      return ltrim(Char).rtrim(Char);
+    }
+
+    /// Return string with consecutive characters in \p Chars starting from
+    /// the left and right removed.
+    StringRef trim(StringRef Chars = " \t\n\v\f\r") const {
+      return ltrim(Chars).rtrim(Chars);
+    }
+
+    /// @}
+  };
+
+  /// @name StringRef Comparison Operators
+  /// @{
+
+  inline bool operator==(StringRef LHS, StringRef RHS) {
+    return LHS.equals(RHS);
+  }
+
+  inline bool operator!=(StringRef LHS, StringRef RHS) {
+    return !(LHS == RHS);
+  }
+
+  inline bool operator<(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) == -1;
+  }
+
+  inline bool operator<=(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) != 1;
+  }
+
+  inline bool operator>(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) == 1;
+  }
+
+  inline bool operator>=(StringRef LHS, StringRef RHS) {
+    return LHS.compare(RHS) != -1;
+  }
+
+  inline std::string &operator+=(std::string &buffer, StringRef string) {
+    return buffer.append(string.data(), string.size());
+  }
+
+  inline std::ostream &operator<<(std::ostream &os, StringRef string) {
+    os.write(string.data(), string.size());
+    return os;
+  }
+
+  /// @}
+
+  /// \brief Compute a hash_code for a StringRef.
+  hash_code hash_value(StringRef S);
+
+  // StringRefs can be treated like a POD type.
+  template <typename T> struct isPodLike;
+  template <> struct isPodLike<StringRef> { static const bool value = true; };
+} // namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/Twine.h b/third_party/wpiutil_2018/src/main/native/include/llvm/Twine.h
new file mode 100644
index 0000000..82687aa
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/Twine.h
@@ -0,0 +1,544 @@
+//===-- Twine.h - Fast Temporary String Concatenation -----------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_TWINE_H
+#define LLVM_ADT_TWINE_H
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+#include <cassert>
+#include <string>
+
+#include <stdint.h>
+
+namespace llvm {
+  class raw_ostream;
+
+  /// Twine - A lightweight data structure for efficiently representing the
+  /// concatenation of temporary values as strings.
+  ///
+  /// A Twine is a kind of rope, it represents a concatenated string using a
+  /// binary-tree, where the string is the preorder of the nodes. Since the
+  /// Twine can be efficiently rendered into a buffer when its result is used,
+  /// it avoids the cost of generating temporary values for intermediate string
+  /// results -- particularly in cases when the Twine result is never
+  /// required. By explicitly tracking the type of leaf nodes, we can also avoid
+  /// the creation of temporary strings for conversions operations (such as
+  /// appending an integer to a string).
+  ///
+  /// A Twine is not intended for use directly and should not be stored, its
+  /// implementation relies on the ability to store pointers to temporary stack
+  /// objects which may be deallocated at the end of a statement. Twines should
+  /// only be used accepted as const references in arguments, when an API wishes
+  /// to accept possibly-concatenated strings.
+  ///
+  /// Twines support a special 'null' value, which always concatenates to form
+  /// itself, and renders as an empty string. This can be returned from APIs to
+  /// effectively nullify any concatenations performed on the result.
+  ///
+  /// \b Implementation
+  ///
+  /// Given the nature of a Twine, it is not possible for the Twine's
+  /// concatenation method to construct interior nodes; the result must be
+  /// represented inside the returned value. For this reason a Twine object
+  /// actually holds two values, the left- and right-hand sides of a
+  /// concatenation. We also have nullary Twine objects, which are effectively
+  /// sentinel values that represent empty strings.
+  ///
+  /// Thus, a Twine can effectively have zero, one, or two children. The \see
+  /// isNullary(), \see isUnary(), and \see isBinary() predicates exist for
+  /// testing the number of children.
+  ///
+  /// We maintain a number of invariants on Twine objects (FIXME: Why):
+  ///  - Nullary twines are always represented with their Kind on the left-hand
+  ///    side, and the Empty kind on the right-hand side.
+  ///  - Unary twines are always represented with the value on the left-hand
+  ///    side, and the Empty kind on the right-hand side.
+  ///  - If a Twine has another Twine as a child, that child should always be
+  ///    binary (otherwise it could have been folded into the parent).
+  ///
+  /// These invariants are check by \see isValid().
+  ///
+  /// \b Efficiency Considerations
+  ///
+  /// The Twine is designed to yield efficient and small code for common
+  /// situations. For this reason, the concat() method is inlined so that
+  /// concatenations of leaf nodes can be optimized into stores directly into a
+  /// single stack allocated object.
+  ///
+  /// In practice, not all compilers can be trusted to optimize concat() fully,
+  /// so we provide two additional methods (and accompanying operator+
+  /// overloads) to guarantee that particularly important cases (cstring plus
+  /// StringRef) codegen as desired.
+  class Twine {
+    /// NodeKind - Represent the type of an argument.
+    enum NodeKind : unsigned char {
+      /// An empty string; the result of concatenating anything with it is also
+      /// empty.
+      NullKind,
+
+      /// The empty string.
+      EmptyKind,
+
+      /// A pointer to a Twine instance.
+      TwineKind,
+
+      /// A pointer to a C string instance.
+      CStringKind,
+
+      /// A pointer to an std::string instance.
+      StdStringKind,
+
+      /// A pointer to a StringRef instance.
+      StringRefKind,
+
+      /// A pointer to a SmallString instance.
+      SmallStringKind,
+
+      /// A char value, to render as a character.
+      CharKind,
+
+      /// An unsigned int value, to render as an unsigned decimal integer.
+      DecUIKind,
+
+      /// An int value, to render as a signed decimal integer.
+      DecIKind,
+
+      /// A pointer to an unsigned long value, to render as an unsigned decimal
+      /// integer.
+      DecULKind,
+
+      /// A pointer to a long value, to render as a signed decimal integer.
+      DecLKind,
+
+      /// A pointer to an unsigned long long value, to render as an unsigned
+      /// decimal integer.
+      DecULLKind,
+
+      /// A pointer to a long long value, to render as a signed decimal integer.
+      DecLLKind,
+
+      /// A pointer to a uint64_t value, to render as an unsigned hexadecimal
+      /// integer.
+      UHexKind
+    };
+
+    union Child
+    {
+      const Twine *twine;
+      const char *cString;
+      const std::string *stdString;
+      const StringRef *stringRef;
+      const SmallVectorImpl<char> *smallString;
+      char character;
+      unsigned int decUI;
+      int decI;
+      const unsigned long *decUL;
+      const long *decL;
+      const unsigned long long *decULL;
+      const long long *decLL;
+      const uint64_t *uHex;
+    };
+
+  private:
+    /// LHS - The prefix in the concatenation, which may be uninitialized for
+    /// Null or Empty kinds.
+    Child LHS;
+    /// RHS - The suffix in the concatenation, which may be uninitialized for
+    /// Null or Empty kinds.
+    Child RHS;
+    /// LHSKind - The NodeKind of the left hand side, \see getLHSKind().
+    NodeKind LHSKind;
+    /// RHSKind - The NodeKind of the right hand side, \see getRHSKind().
+    NodeKind RHSKind;
+
+  private:
+    /// Construct a nullary twine; the kind must be NullKind or EmptyKind.
+    explicit Twine(NodeKind Kind)
+      : LHSKind(Kind), RHSKind(EmptyKind) {
+      assert(isNullary() && "Invalid kind!");
+    }
+
+    /// Construct a binary twine.
+    explicit Twine(const Twine &LHS, const Twine &RHS)
+        : LHSKind(TwineKind), RHSKind(TwineKind) {
+      this->LHS.twine = &LHS;
+      this->RHS.twine = &RHS;
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Construct a twine from explicit values.
+    explicit Twine(Child LHS, NodeKind LHSKind, Child RHS, NodeKind RHSKind)
+        : LHS(LHS), RHS(RHS), LHSKind(LHSKind), RHSKind(RHSKind) {
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Since the intended use of twines is as temporary objects, assignments
+    /// when concatenating might cause undefined behavior or stack corruptions
+    Twine &operator=(const Twine &Other) = delete;
+
+    /// Check for the null twine.
+    bool isNull() const {
+      return getLHSKind() == NullKind;
+    }
+
+    /// Check for the empty twine.
+    bool isEmpty() const {
+      return getLHSKind() == EmptyKind;
+    }
+
+    /// Check if this is a nullary twine (null or empty).
+    bool isNullary() const {
+      return isNull() || isEmpty();
+    }
+
+    /// Check if this is a unary twine.
+    bool isUnary() const {
+      return getRHSKind() == EmptyKind && !isNullary();
+    }
+
+    /// Check if this is a binary twine.
+    bool isBinary() const {
+      return getLHSKind() != NullKind && getRHSKind() != EmptyKind;
+    }
+
+    /// Check if this is a valid twine (satisfying the invariants on
+    /// order and number of arguments).
+    bool isValid() const {
+      // Nullary twines always have Empty on the RHS.
+      if (isNullary() && getRHSKind() != EmptyKind)
+        return false;
+
+      // Null should never appear on the RHS.
+      if (getRHSKind() == NullKind)
+        return false;
+
+      // The RHS cannot be non-empty if the LHS is empty.
+      if (getRHSKind() != EmptyKind && getLHSKind() == EmptyKind)
+        return false;
+
+      // A twine child should always be binary.
+      if (getLHSKind() == TwineKind &&
+          !LHS.twine->isBinary())
+        return false;
+      if (getRHSKind() == TwineKind &&
+          !RHS.twine->isBinary())
+        return false;
+
+      return true;
+    }
+
+    /// Get the NodeKind of the left-hand side.
+    NodeKind getLHSKind() const { return LHSKind; }
+
+    /// Get the NodeKind of the right-hand side.
+    NodeKind getRHSKind() const { return RHSKind; }
+
+    /// Print one child from a twine.
+    void printOneChild(raw_ostream &OS, Child Ptr, NodeKind Kind) const;
+
+    /// Print the representation of one child from a twine.
+    void printOneChildRepr(raw_ostream &OS, Child Ptr,
+                           NodeKind Kind) const;
+
+  public:
+    /// @name Constructors
+    /// @{
+
+    /// Construct from an empty string.
+    /*implicit*/ Twine() : LHSKind(EmptyKind), RHSKind(EmptyKind) {
+      assert(isValid() && "Invalid twine!");
+    }
+
+    Twine(const Twine &) = default;
+
+    /// Construct from a C string.
+    ///
+    /// We take care here to optimize "" into the empty twine -- this will be
+    /// optimized out for string constants. This allows Twine arguments have
+    /// default "" values, without introducing unnecessary string constants.
+    /*implicit*/ Twine(const char *Str)
+      : RHSKind(EmptyKind) {
+      if (Str[0] != '\0') {
+        LHS.cString = Str;
+        LHSKind = CStringKind;
+      } else
+        LHSKind = EmptyKind;
+
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Construct from an std::string.
+    /*implicit*/ Twine(const std::string &Str)
+      : LHSKind(StdStringKind), RHSKind(EmptyKind) {
+      LHS.stdString = &Str;
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Construct from a StringRef.
+    /*implicit*/ Twine(const StringRef &Str)
+      : LHSKind(StringRefKind), RHSKind(EmptyKind) {
+      LHS.stringRef = &Str;
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Construct from a SmallString.
+    /*implicit*/ Twine(const SmallVectorImpl<char> &Str)
+      : LHSKind(SmallStringKind), RHSKind(EmptyKind) {
+      LHS.smallString = &Str;
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Construct from a char.
+    explicit Twine(char Val)
+      : LHSKind(CharKind), RHSKind(EmptyKind) {
+      LHS.character = Val;
+    }
+
+    /// Construct from a signed char.
+    explicit Twine(signed char Val)
+      : LHSKind(CharKind), RHSKind(EmptyKind) {
+      LHS.character = static_cast<char>(Val);
+    }
+
+    /// Construct from an unsigned char.
+    explicit Twine(unsigned char Val)
+      : LHSKind(CharKind), RHSKind(EmptyKind) {
+      LHS.character = static_cast<char>(Val);
+    }
+
+    /// Construct a twine to print \p Val as an unsigned decimal integer.
+    explicit Twine(unsigned Val)
+      : LHSKind(DecUIKind), RHSKind(EmptyKind) {
+      LHS.decUI = Val;
+    }
+
+    /// Construct a twine to print \p Val as a signed decimal integer.
+    explicit Twine(int Val)
+      : LHSKind(DecIKind), RHSKind(EmptyKind) {
+      LHS.decI = Val;
+    }
+
+    /// Construct a twine to print \p Val as an unsigned decimal integer.
+    explicit Twine(const unsigned long &Val)
+      : LHSKind(DecULKind), RHSKind(EmptyKind) {
+      LHS.decUL = &Val;
+    }
+
+    /// Construct a twine to print \p Val as a signed decimal integer.
+    explicit Twine(const long &Val)
+      : LHSKind(DecLKind), RHSKind(EmptyKind) {
+      LHS.decL = &Val;
+    }
+
+    /// Construct a twine to print \p Val as an unsigned decimal integer.
+    explicit Twine(const unsigned long long &Val)
+      : LHSKind(DecULLKind), RHSKind(EmptyKind) {
+      LHS.decULL = &Val;
+    }
+
+    /// Construct a twine to print \p Val as a signed decimal integer.
+    explicit Twine(const long long &Val)
+      : LHSKind(DecLLKind), RHSKind(EmptyKind) {
+      LHS.decLL = &Val;
+    }
+
+    // FIXME: Unfortunately, to make sure this is as efficient as possible we
+    // need extra binary constructors from particular types. We can't rely on
+    // the compiler to be smart enough to fold operator+()/concat() down to the
+    // right thing. Yet.
+
+    /// Construct as the concatenation of a C string and a StringRef.
+    /*implicit*/ Twine(const char *LHS, const StringRef &RHS)
+        : LHSKind(CStringKind), RHSKind(StringRefKind) {
+      this->LHS.cString = LHS;
+      this->RHS.stringRef = &RHS;
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Construct as the concatenation of a StringRef and a C string.
+    /*implicit*/ Twine(const StringRef &LHS, const char *RHS)
+        : LHSKind(StringRefKind), RHSKind(CStringKind) {
+      this->LHS.stringRef = &LHS;
+      this->RHS.cString = RHS;
+      assert(isValid() && "Invalid twine!");
+    }
+
+    /// Create a 'null' string, which is an empty string that always
+    /// concatenates to form another empty string.
+    static Twine createNull() {
+      return Twine(NullKind);
+    }
+
+    /// @}
+    /// @name Numeric Conversions
+    /// @{
+
+    // Construct a twine to print \p Val as an unsigned hexadecimal integer.
+    static Twine utohexstr(const uint64_t &Val) {
+      Child LHS, RHS;
+      LHS.uHex = &Val;
+      RHS.twine = nullptr;
+      return Twine(LHS, UHexKind, RHS, EmptyKind);
+    }
+
+    /// @}
+    /// @name Predicate Operations
+    /// @{
+
+    /// Check if this twine is trivially empty; a false return value does not
+    /// necessarily mean the twine is empty.
+    bool isTriviallyEmpty() const {
+      return isNullary();
+    }
+
+    /// Return true if this twine can be dynamically accessed as a single
+    /// StringRef value with getSingleStringRef().
+    bool isSingleStringRef() const {
+      if (getRHSKind() != EmptyKind) return false;
+
+      switch (getLHSKind()) {
+      case EmptyKind:
+      case CStringKind:
+      case StdStringKind:
+      case StringRefKind:
+      case SmallStringKind:
+      case CharKind:
+        return true;
+      default:
+        return false;
+      }
+    }
+
+    /// @}
+    /// @name String Operations
+    /// @{
+
+    Twine concat(const Twine &Suffix) const;
+
+    /// @}
+    /// @name Output & Conversion.
+    /// @{
+
+    /// Return the twine contents as a std::string.
+    std::string str() const;
+
+    /// Append the concatenated string into the given SmallString or SmallVector.
+    void toVector(SmallVectorImpl<char> &Out) const;
+
+    /// This returns the twine as a single StringRef.  This method is only valid
+    /// if isSingleStringRef() is true.
+    StringRef getSingleStringRef() const {
+      assert(isSingleStringRef() &&"This cannot be had as a single stringref!");
+      switch (getLHSKind()) {
+      default:
+        // unreachable("Out of sync with isSingleStringRef");
+        return StringRef();
+      case EmptyKind:      return StringRef();
+      case CStringKind:    return StringRef(LHS.cString);
+      case StdStringKind:  return StringRef(*LHS.stdString);
+      case StringRefKind:  return *LHS.stringRef;
+      case SmallStringKind:
+        return StringRef(LHS.smallString->data(), LHS.smallString->size());
+      case CharKind:       return StringRef(&LHS.character, 1);
+      }
+    }
+
+    /// This returns the twine as a single StringRef if it can be
+    /// represented as such. Otherwise the twine is written into the given
+    /// SmallVector and a StringRef to the SmallVector's data is returned.
+    StringRef toStringRef(SmallVectorImpl<char> &Out) const {
+      if (isSingleStringRef())
+        return getSingleStringRef();
+      toVector(Out);
+      return StringRef(Out.data(), Out.size());
+    }
+
+    /// This returns the twine as a single null terminated StringRef if it
+    /// can be represented as such. Otherwise the twine is written into the
+    /// given SmallVector and a StringRef to the SmallVector's data is returned.
+    ///
+    /// The returned StringRef's size does not include the null terminator.
+    StringRef toNullTerminatedStringRef(SmallVectorImpl<char> &Out) const;
+
+    /// Write the concatenated string represented by this twine to the
+    /// stream \p OS.
+    void print(raw_ostream &OS) const;
+
+    /// Dump the concatenated string represented by this twine to stderr.
+    void dump() const;
+
+    /// Write the representation of this twine to the stream \p OS.
+    void printRepr(raw_ostream &OS) const;
+
+    /// Dump the representation of this twine to stderr.
+    void dumpRepr() const;
+
+    /// @}
+  };
+
+  /// @name Twine Inline Implementations
+  /// @{
+
+  inline Twine Twine::concat(const Twine &Suffix) const {
+    // Concatenation with null is null.
+    if (isNull() || Suffix.isNull())
+      return Twine(NullKind);
+
+    // Concatenation with empty yields the other side.
+    if (isEmpty())
+      return Suffix;
+    if (Suffix.isEmpty())
+      return *this;
+
+    // Otherwise we need to create a new node, taking care to fold in unary
+    // twines.
+    Child NewLHS, NewRHS;
+    NewLHS.twine = this;
+    NewRHS.twine = &Suffix;
+    NodeKind NewLHSKind = TwineKind, NewRHSKind = TwineKind;
+    if (isUnary()) {
+      NewLHS = LHS;
+      NewLHSKind = getLHSKind();
+    }
+    if (Suffix.isUnary()) {
+      NewRHS = Suffix.LHS;
+      NewRHSKind = Suffix.getLHSKind();
+    }
+
+    return Twine(NewLHS, NewLHSKind, NewRHS, NewRHSKind);
+  }
+
+  inline Twine operator+(const Twine &LHS, const Twine &RHS) {
+    return LHS.concat(RHS);
+  }
+
+  /// Additional overload to guarantee simplified codegen; this is equivalent to
+  /// concat().
+
+  inline Twine operator+(const char *LHS, const StringRef &RHS) {
+    return Twine(LHS, RHS);
+  }
+
+  /// Additional overload to guarantee simplified codegen; this is equivalent to
+  /// concat().
+
+  inline Twine operator+(const StringRef &LHS, const char *RHS) {
+    return Twine(LHS, RHS);
+  }
+
+  inline raw_ostream &operator<<(raw_ostream &OS, const Twine &RHS) {
+    RHS.print(OS);
+    return OS;
+  }
+
+  /// @}
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/WindowsError.h b/third_party/wpiutil_2018/src/main/native/include/llvm/WindowsError.h
new file mode 100644
index 0000000..63bfe59
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/WindowsError.h
@@ -0,0 +1,19 @@
+//===-- WindowsError.h - Support for mapping windows errors to posix-------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_WINDOWSERROR_H
+#define LLVM_SUPPORT_WINDOWSERROR_H
+
+#include <system_error>
+
+namespace llvm {
+std::error_code mapWindowsError(unsigned EV);
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/iterator_range.h b/third_party/wpiutil_2018/src/main/native/include/llvm/iterator_range.h
new file mode 100644
index 0000000..3dd679b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/iterator_range.h
@@ -0,0 +1,68 @@
+//===- iterator_range.h - A range adaptor for iterators ---------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+/// \file
+/// This provides a very simple, boring adaptor for a begin and end iterator
+/// into a range type. This should be used to build range views that work well
+/// with range based for loops and range based constructors.
+///
+/// Note that code here follows more standards-based coding conventions as it
+/// is mirroring proposed interfaces for standardization.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_ITERATOR_RANGE_H
+#define LLVM_ADT_ITERATOR_RANGE_H
+
+#include <utility>
+#include <iterator>
+
+namespace llvm {
+
+/// \brief A range adaptor for a pair of iterators.
+///
+/// This just wraps two iterators into a range-compatible interface. Nothing
+/// fancy at all.
+template <typename IteratorT>
+class iterator_range {
+  IteratorT begin_iterator, end_iterator;
+
+public:
+  //TODO: Add SFINAE to test that the Container's iterators match the range's
+  //      iterators.
+  template <typename Container>
+  iterator_range(Container &&c)
+  //TODO: Consider ADL/non-member begin/end calls.
+      : begin_iterator(c.begin()), end_iterator(c.end()) {}
+  iterator_range(IteratorT begin_iterator, IteratorT end_iterator)
+      : begin_iterator(std::move(begin_iterator)),
+        end_iterator(std::move(end_iterator)) {}
+
+  IteratorT begin() const { return begin_iterator; }
+  IteratorT end() const { return end_iterator; }
+};
+
+/// \brief Convenience function for iterating over sub-ranges.
+///
+/// This provides a bit of syntactic sugar to make using sub-ranges
+/// in for loops a bit easier. Analogous to std::make_pair().
+template <class T> iterator_range<T> make_range(T x, T y) {
+  return iterator_range<T>(std::move(x), std::move(y));
+}
+
+template <typename T> iterator_range<T> make_range(std::pair<T, T> p) {
+  return iterator_range<T>(std::move(p.first), std::move(p.second));
+}
+
+template<typename T>
+iterator_range<decltype(begin(std::declval<T>()))> drop_begin(T &&t, int n) {
+  return make_range(std::next(begin(t), n), end(t));
+}
+}
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/raw_os_ostream.h b/third_party/wpiutil_2018/src/main/native/include/llvm/raw_os_ostream.h
new file mode 100644
index 0000000..22dfa59
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/raw_os_ostream.h
@@ -0,0 +1,42 @@
+//===- raw_os_ostream.h - std::ostream adaptor for raw_ostream --*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file defines the raw_os_ostream class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_RAW_OS_OSTREAM_H
+#define LLVM_SUPPORT_RAW_OS_OSTREAM_H
+
+#include "llvm/raw_ostream.h"
+#include <iosfwd>
+
+namespace llvm {
+
+/// raw_os_ostream - A raw_ostream that writes to an std::ostream.  This is a
+/// simple adaptor class.  It does not check for output errors; clients should
+/// use the underlying stream to detect errors.
+class raw_os_ostream : public raw_ostream {
+  std::ostream &OS;
+
+  /// write_impl - See raw_ostream::write_impl.
+  void write_impl(const char *Ptr, size_t Size) override;
+
+  /// current_pos - Return the current position within the stream, not
+  /// counting the bytes currently in the buffer.
+  uint64_t current_pos() const override;
+
+public:
+  raw_os_ostream(std::ostream &O) : OS(O) {}
+  ~raw_os_ostream() override;
+};
+
+} // end llvm namespace
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/raw_ostream.h b/third_party/wpiutil_2018/src/main/native/include/llvm/raw_ostream.h
new file mode 100644
index 0000000..119463b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/raw_ostream.h
@@ -0,0 +1,515 @@
+//===--- raw_ostream.h - Raw output stream ----------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+//  This file defines the raw_ostream class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_RAW_OSTREAM_H
+#define LLVM_SUPPORT_RAW_OSTREAM_H
+
+#include "llvm/FileSystem.h"
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+#include <cstdint>
+#include <system_error>
+
+namespace llvm {
+class format_object_base;
+class FormattedString;
+class FormattedNumber;
+template <typename T> class SmallVectorImpl;
+
+/// This class implements an extremely fast bulk output stream that can *only*
+/// output to a stream.  It does not support seeking, reopening, rewinding, line
+/// buffered disciplines etc. It is a simple buffer that outputs
+/// a chunk at a time.
+class raw_ostream {
+private:
+  void operator=(const raw_ostream &) = delete;
+  raw_ostream(const raw_ostream &) = delete;
+
+  /// The buffer is handled in such a way that the buffer is
+  /// uninitialized, unbuffered, or out of space when OutBufCur >=
+  /// OutBufEnd. Thus a single comparison suffices to determine if we
+  /// need to take the slow path to write a single character.
+  ///
+  /// The buffer is in one of three states:
+  ///  1. Unbuffered (BufferMode == Unbuffered)
+  ///  1. Uninitialized (BufferMode != Unbuffered && OutBufStart == 0).
+  ///  2. Buffered (BufferMode != Unbuffered && OutBufStart != 0 &&
+  ///               OutBufEnd - OutBufStart >= 1).
+  ///
+  /// If buffered, then the raw_ostream owns the buffer if (BufferMode ==
+  /// InternalBuffer); otherwise the buffer has been set via SetBuffer and is
+  /// managed by the subclass.
+  ///
+  /// If a subclass installs an external buffer using SetBuffer then it can wait
+  /// for a \see write_impl() call to handle the data which has been put into
+  /// this buffer.
+  char *OutBufStart, *OutBufEnd, *OutBufCur;
+
+  enum BufferKind {
+    Unbuffered = 0,
+    InternalBuffer,
+    ExternalBuffer
+  } BufferMode;
+
+public:
+  // color order matches ANSI escape sequence, don't change
+  enum Colors {
+    BLACK=0,
+    RED,
+    GREEN,
+    YELLOW,
+    BLUE,
+    MAGENTA,
+    CYAN,
+    WHITE,
+    SAVEDCOLOR
+  };
+
+  explicit raw_ostream(bool unbuffered = false)
+      : BufferMode(unbuffered ? Unbuffered : InternalBuffer) {
+    // Start out ready to flush.
+    OutBufStart = OutBufEnd = OutBufCur = nullptr;
+  }
+
+  virtual ~raw_ostream();
+
+  /// tell - Return the current offset with the file.
+  uint64_t tell() const { return current_pos() + GetNumBytesInBuffer(); }
+
+  //===--------------------------------------------------------------------===//
+  // Configuration Interface
+  //===--------------------------------------------------------------------===//
+
+  /// Set the stream to be buffered, with an automatically determined buffer
+  /// size.
+  void SetBuffered();
+
+  /// Set the stream to be buffered, using the specified buffer size.
+  void SetBufferSize(size_t Size) {
+    flush();
+    SetBufferAndMode(new char[Size], Size, InternalBuffer);
+  }
+
+  size_t GetBufferSize() const {
+    // If we're supposed to be buffered but haven't actually gotten around
+    // to allocating the buffer yet, return the value that would be used.
+    if (BufferMode != Unbuffered && OutBufStart == nullptr)
+      return preferred_buffer_size();
+
+    // Otherwise just return the size of the allocated buffer.
+    return OutBufEnd - OutBufStart;
+  }
+
+  /// Set the stream to be unbuffered. When unbuffered, the stream will flush
+  /// after every write. This routine will also flush the buffer immediately
+  /// when the stream is being set to unbuffered.
+  void SetUnbuffered() {
+    flush();
+    SetBufferAndMode(nullptr, 0, Unbuffered);
+  }
+
+  size_t GetNumBytesInBuffer() const {
+    return OutBufCur - OutBufStart;
+  }
+
+  //===--------------------------------------------------------------------===//
+  // Data Output Interface
+  //===--------------------------------------------------------------------===//
+
+  void flush() {
+    if (OutBufCur != OutBufStart)
+      flush_nonempty();
+  }
+
+  raw_ostream &operator<<(char C) {
+    if (OutBufCur >= OutBufEnd)
+      return write(C);
+    *OutBufCur++ = C;
+    return *this;
+  }
+
+  raw_ostream &operator<<(unsigned char C) {
+    if (OutBufCur >= OutBufEnd)
+      return write(C);
+    *OutBufCur++ = C;
+    return *this;
+  }
+
+  raw_ostream &operator<<(signed char C) {
+    if (OutBufCur >= OutBufEnd)
+      return write(C);
+    *OutBufCur++ = C;
+    return *this;
+  }
+
+  raw_ostream &operator<<(StringRef Str) {
+    // Inline fast path, particularly for strings with a known length.
+    size_t Size = Str.size();
+
+    // Make sure we can use the fast path.
+    if (Size > (size_t)(OutBufEnd - OutBufCur))
+      return write(Str.data(), Size);
+
+    if (Size) {
+      memcpy(OutBufCur, Str.data(), Size);
+      OutBufCur += Size;
+    }
+    return *this;
+  }
+
+  raw_ostream &operator<<(const char *Str) {
+    // Inline fast path, particularly for constant strings where a sufficiently
+    // smart compiler will simplify strlen.
+
+    return this->operator<<(StringRef(Str));
+  }
+
+  raw_ostream &operator<<(const std::string &Str) {
+    // Avoid the fast path, it would only increase code size for a marginal win.
+    return write(Str.data(), Str.length());
+  }
+
+  raw_ostream &operator<<(const llvm::SmallVectorImpl<char> &Str) {
+    return write(Str.data(), Str.size());
+  }
+
+  raw_ostream &operator<<(unsigned long N);
+  raw_ostream &operator<<(long N);
+  raw_ostream &operator<<(unsigned long long N);
+  raw_ostream &operator<<(long long N);
+  raw_ostream &operator<<(const void *P);
+  raw_ostream &operator<<(unsigned int N) {
+    return this->operator<<(static_cast<unsigned long>(N));
+  }
+
+  raw_ostream &operator<<(int N) {
+    return this->operator<<(static_cast<long>(N));
+  }
+
+  raw_ostream &operator<<(double N);
+
+  /// Output \p N in hexadecimal, without any prefix or padding.
+  raw_ostream &write_hex(unsigned long long N);
+
+  /// Output \p Str, turning '\\', '\t', '\n', '"', and anything that doesn't
+  /// satisfy std::isprint into an escape sequence.
+  raw_ostream &write_escaped(StringRef Str, bool UseHexEscapes = false);
+
+  raw_ostream &write(unsigned char C);
+  raw_ostream &write(const char *Ptr, size_t Size);
+
+  // Formatted output, see the format() function in Support/Format.h.
+  raw_ostream &operator<<(const format_object_base &Fmt);
+
+  // Formatted output, see the leftJustify() function in Support/Format.h.
+  raw_ostream &operator<<(const FormattedString &);
+
+  // Formatted output, see the formatHex() function in Support/Format.h.
+  raw_ostream &operator<<(const FormattedNumber &);
+
+  /// indent - Insert 'NumSpaces' spaces.
+  raw_ostream &indent(unsigned NumSpaces);
+
+  /// Changes the foreground color of text that will be output from this point
+  /// forward.
+  /// @param Color ANSI color to use, the special SAVEDCOLOR can be used to
+  /// change only the bold attribute, and keep colors untouched
+  /// @param Bold bold/brighter text, default false
+  /// @param BG if true change the background, default: change foreground
+  /// @returns itself so it can be used within << invocations
+  virtual raw_ostream &changeColor(enum Colors Color,
+                                   bool Bold = false,
+                                   bool BG = false) {
+    (void)Color;
+    (void)Bold;
+    (void)BG;
+    return *this;
+  }
+
+  /// Resets the colors to terminal defaults. Call this when you are done
+  /// outputting colored text, or before program exit.
+  virtual raw_ostream &resetColor() { return *this; }
+
+  /// Reverses the foreground and background colors.
+  virtual raw_ostream &reverseColor() { return *this; }
+
+  /// This function determines if this stream is connected to a "tty" or
+  /// "console" window. That is, the output would be displayed to the user
+  /// rather than being put on a pipe or stored in a file.
+  virtual bool is_displayed() const { return false; }
+
+  /// This function determines if this stream is displayed and supports colors.
+  virtual bool has_colors() const { return is_displayed(); }
+
+  //===--------------------------------------------------------------------===//
+  // Subclass Interface
+  //===--------------------------------------------------------------------===//
+
+private:
+  /// The is the piece of the class that is implemented by subclasses.  This
+  /// writes the \p Size bytes starting at
+  /// \p Ptr to the underlying stream.
+  ///
+  /// This function is guaranteed to only be called at a point at which it is
+  /// safe for the subclass to install a new buffer via SetBuffer.
+  ///
+  /// \param Ptr The start of the data to be written. For buffered streams this
+  /// is guaranteed to be the start of the buffer.
+  ///
+  /// \param Size The number of bytes to be written.
+  ///
+  /// \invariant { Size > 0 }
+  virtual void write_impl(const char *Ptr, size_t Size) = 0;
+
+  // An out of line virtual method to provide a home for the class vtable.
+  virtual void handle();
+
+  /// Return the current position within the stream, not counting the bytes
+  /// currently in the buffer.
+  virtual uint64_t current_pos() const = 0;
+
+protected:
+  /// Use the provided buffer as the raw_ostream buffer. This is intended for
+  /// use only by subclasses which can arrange for the output to go directly
+  /// into the desired output buffer, instead of being copied on each flush.
+  void SetBuffer(char *BufferStart, size_t Size) {
+    SetBufferAndMode(BufferStart, Size, ExternalBuffer);
+  }
+
+  /// Return an efficient buffer size for the underlying output mechanism.
+  virtual size_t preferred_buffer_size() const;
+
+  /// Return the beginning of the current stream buffer, or 0 if the stream is
+  /// unbuffered.
+  const char *getBufferStart() const { return OutBufStart; }
+
+  //===--------------------------------------------------------------------===//
+  // Private Interface
+  //===--------------------------------------------------------------------===//
+private:
+  /// Install the given buffer and mode.
+  void SetBufferAndMode(char *BufferStart, size_t Size, BufferKind Mode);
+
+  /// Flush the current buffer, which is known to be non-empty. This outputs the
+  /// currently buffered data and resets the buffer to empty.
+  void flush_nonempty();
+
+  /// Copy data into the buffer. Size must not be greater than the number of
+  /// unused bytes in the buffer.
+  void copy_to_buffer(const char *Ptr, size_t Size);
+};
+
+/// An abstract base class for streams implementations that also support a
+/// pwrite operation. This is useful for code that can mostly stream out data,
+/// but needs to patch in a header that needs to know the output size.
+class raw_pwrite_stream : public raw_ostream {
+  virtual void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) = 0;
+
+public:
+  explicit raw_pwrite_stream(bool Unbuffered = false)
+      : raw_ostream(Unbuffered) {}
+  void pwrite(const char *Ptr, size_t Size, uint64_t Offset) {
+#ifndef NDBEBUG
+    uint64_t Pos = tell();
+    // /dev/null always reports a pos of 0, so we cannot perform this check
+    // in that case.
+    if (Pos)
+      assert(Size + Offset <= Pos && "We don't support extending the stream");
+#endif
+    pwrite_impl(Ptr, Size, Offset);
+  }
+};
+
+//===----------------------------------------------------------------------===//
+// File Output Streams
+//===----------------------------------------------------------------------===//
+
+/// A raw_ostream that writes to a file descriptor.
+///
+class raw_fd_ostream : public raw_pwrite_stream {
+  int FD;
+  bool ShouldClose;
+
+  /// Error This flag is true if an error of any kind has been detected.
+  ///
+  bool Error;
+
+  uint64_t pos;
+
+  bool SupportsSeeking;
+
+  /// See raw_ostream::write_impl.
+  void write_impl(const char *Ptr, size_t Size) override;
+
+  void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
+
+  /// Return the current position within the stream, not counting the bytes
+  /// currently in the buffer.
+  uint64_t current_pos() const override { return pos; }
+
+  /// Determine an efficient buffer size.
+  size_t preferred_buffer_size() const override;
+
+  /// Set the flag indicating that an output error has been encountered.
+  void error_detected() { Error = true; }
+
+public:
+  /// Open the specified file for writing. If an error occurs, information
+  /// about the error is put into EC, and the stream should be immediately
+  /// destroyed;
+  /// \p Flags allows optional flags to control how the file will be opened.
+  ///
+  /// As a special case, if Filename is "-", then the stream will use
+  /// STDOUT_FILENO instead of opening a file. Note that it will still consider
+  /// itself to own the file descriptor. In particular, it will close the
+  /// file descriptor when it is done (this is necessary to detect
+  /// output errors).
+  raw_fd_ostream(StringRef Filename, std::error_code &EC,
+                 sys::fs::OpenFlags Flags);
+
+  /// FD is the file descriptor that this writes to.  If ShouldClose is true,
+  /// this closes the file when the stream is destroyed.
+  raw_fd_ostream(int fd, bool shouldClose, bool unbuffered=false);
+
+  ~raw_fd_ostream() override;
+
+  /// Manually flush the stream and close the file. Note that this does not call
+  /// fsync.
+  void close();
+
+  bool supportsSeeking() { return SupportsSeeking; }
+
+  /// Flushes the stream and repositions the underlying file descriptor position
+  /// to the offset specified from the beginning of the file.
+  uint64_t seek(uint64_t off);
+
+  /// Return the value of the flag in this raw_fd_ostream indicating whether an
+  /// output error has been encountered.
+  /// This doesn't implicitly flush any pending output.  Also, it doesn't
+  /// guarantee to detect all errors unless the stream has been closed.
+  bool has_error() const {
+    return Error;
+  }
+
+  /// Set the flag read by has_error() to false. If the error flag is set at the
+  /// time when this raw_ostream's destructor is called, report_fatal_error is
+  /// called to report the error. Use clear_error() after handling the error to
+  /// avoid this behavior.
+  ///
+  ///   "Errors should never pass silently.
+  ///    Unless explicitly silenced."
+  ///      - from The Zen of Python, by Tim Peters
+  ///
+  void clear_error() {
+    Error = false;
+  }
+};
+
+/// This returns a reference to a raw_ostream for standard output. Use it like:
+/// outs() << "foo" << "bar";
+raw_ostream &outs();
+
+/// This returns a reference to a raw_ostream for standard error. Use it like:
+/// errs() << "foo" << "bar";
+raw_ostream &errs();
+
+/// This returns a reference to a raw_ostream which simply discards output.
+raw_ostream &nulls();
+
+//===----------------------------------------------------------------------===//
+// Output Stream Adaptors
+//===----------------------------------------------------------------------===//
+
+/// A raw_ostream that writes to an std::string.  This is a simple adaptor
+/// class. This class does not encounter output errors.
+class raw_string_ostream : public raw_ostream {
+  std::string &OS;
+
+  /// See raw_ostream::write_impl.
+  void write_impl(const char *Ptr, size_t Size) override;
+
+  /// Return the current position within the stream, not counting the bytes
+  /// currently in the buffer.
+  uint64_t current_pos() const override { return OS.size(); }
+
+public:
+  explicit raw_string_ostream(std::string &O) : OS(O) {}
+  ~raw_string_ostream() override;
+
+  /// Flushes the stream contents to the target string and returns  the string's
+  /// reference.
+  std::string& str() {
+    flush();
+    return OS;
+  }
+};
+
+/// A raw_ostream that writes to an SmallVector or SmallString.  This is a
+/// simple adaptor class. This class does not encounter output errors.
+/// raw_svector_ostream operates without a buffer, delegating all memory
+/// management to the SmallString. Thus the SmallString is always up-to-date,
+/// may be used directly and there is no need to call flush().
+class raw_svector_ostream : public raw_pwrite_stream {
+  SmallVectorImpl<char> &OS;
+
+  /// See raw_ostream::write_impl.
+  void write_impl(const char *Ptr, size_t Size) override;
+
+  void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
+
+  /// Return the current position within the stream.
+  uint64_t current_pos() const override;
+
+public:
+  /// Construct a new raw_svector_ostream.
+  ///
+  /// \param O The vector to write to; this should generally have at least 128
+  /// bytes free to avoid any extraneous memory overhead.
+  explicit raw_svector_ostream(SmallVectorImpl<char> &O) : OS(O) {
+    SetUnbuffered();
+  }
+  ~raw_svector_ostream() override {}
+
+  void flush() = delete;
+
+  /// Return a StringRef for the vector contents.
+  StringRef str() { return StringRef(OS.data(), OS.size()); }
+};
+
+/// A raw_ostream that discards all output.
+class raw_null_ostream : public raw_pwrite_stream {
+  /// See raw_ostream::write_impl.
+  void write_impl(const char *Ptr, size_t size) override;
+  void pwrite_impl(const char *Ptr, size_t Size, uint64_t Offset) override;
+
+  /// Return the current position within the stream, not counting the bytes
+  /// currently in the buffer.
+  uint64_t current_pos() const override;
+
+public:
+  explicit raw_null_ostream() {}
+  ~raw_null_ostream() override;
+};
+
+class buffer_ostream : public raw_svector_ostream {
+  raw_ostream &OS;
+  SmallVector<char, 0> Buffer;
+
+public:
+  buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
+  ~buffer_ostream() override { OS << str(); }
+};
+
+} // end llvm namespace
+
+#endif // LLVM_SUPPORT_RAW_OSTREAM_H
diff --git a/third_party/wpiutil_2018/src/main/native/include/llvm/type_traits.h b/third_party/wpiutil_2018/src/main/native/include/llvm/type_traits.h
new file mode 100644
index 0000000..d8ce4fa
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/llvm/type_traits.h
@@ -0,0 +1,95 @@
+//===- llvm/Support/type_traits.h - Simplfied type traits -------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file provides useful additions to the standard type_traits library.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_SUPPORT_TYPE_TRAITS_H
+#define LLVM_SUPPORT_TYPE_TRAITS_H
+
+#include <type_traits>
+#include <utility>
+
+#include "llvm/Compiler.h"
+
+namespace llvm {
+
+/// isPodLike - This is a type trait that is used to determine whether a given
+/// type can be copied around with memcpy instead of running ctors etc.
+template <typename T>
+struct isPodLike {
+  // std::is_trivially_copyable is available in libc++ with clang, libstdc++
+  // that comes with GCC 5.
+#if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) ||      \
+    (defined(__GNUC__) && __GNUC__ >= 5)
+  // If the compiler supports the is_trivially_copyable trait use it, as it
+  // matches the definition of isPodLike closely.
+  static const bool value = std::is_trivially_copyable<T>::value;
+#elif __has_feature(is_trivially_copyable)
+  // Use the internal name if the compiler supports is_trivially_copyable but we
+  // don't know if the standard library does. This is the case for clang in
+  // conjunction with libstdc++ from GCC 4.x.
+  static const bool value = __is_trivially_copyable(T);
+#else
+  // If we don't know anything else, we can (at least) assume that all non-class
+  // types are PODs.
+  static const bool value = !std::is_class<T>::value;
+#endif
+};
+
+// std::pair's are pod-like if their elements are.
+template<typename T, typename U>
+struct isPodLike<std::pair<T, U> > {
+  static const bool value = isPodLike<T>::value && isPodLike<U>::value;
+};
+
+/// \brief Metafunction that determines whether the given type is either an
+/// integral type or an enumeration type, including enum classes.
+///
+/// Note that this accepts potentially more integral types than is_integral
+/// because it is based on being implicitly convertible to an integral type.
+/// Also note that enum classes aren't implicitly convertible to integral types,
+/// the value may therefore need to be explicitly converted before being used.
+template <typename T> class is_integral_or_enum {
+  typedef typename std::remove_reference<T>::type UnderlyingT;
+
+public:
+  static const bool value =
+      !std::is_class<UnderlyingT>::value && // Filter conversion operators.
+      !std::is_pointer<UnderlyingT>::value &&
+      !std::is_floating_point<UnderlyingT>::value &&
+      (std::is_enum<UnderlyingT>::value ||
+       std::is_convertible<UnderlyingT, unsigned long long>::value);
+};
+
+/// \brief If T is a pointer, just return it. If it is not, return T&.
+template<typename T, typename Enable = void>
+struct add_lvalue_reference_if_not_pointer { typedef T &type; };
+
+template <typename T>
+struct add_lvalue_reference_if_not_pointer<
+    T, typename std::enable_if<std::is_pointer<T>::value>::type> {
+  typedef T type;
+};
+
+/// \brief If T is a pointer to X, return a pointer to const X. If it is not,
+/// return const T.
+template<typename T, typename Enable = void>
+struct add_const_past_pointer { typedef const T type; };
+
+template <typename T>
+struct add_const_past_pointer<
+    T, typename std::enable_if<std::is_pointer<T>::value>::type> {
+  typedef const typename std::remove_pointer<T>::type *type;
+};
+
+} // namespace llvm
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/Base64.h b/third_party/wpiutil_2018/src/main/native/include/support/Base64.h
new file mode 100644
index 0000000..dcd6c06
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/Base64.h
@@ -0,0 +1,40 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_BASE64_H_
+#define WPIUTIL_SUPPORT_BASE64_H_
+
+#include <cstddef>
+#include <string>
+
+#include "llvm/StringRef.h"
+
+namespace llvm {
+template <typename T>
+class SmallVectorImpl;
+class raw_ostream;
+}  // namespace llvm
+
+namespace wpi {
+
+size_t Base64Decode(llvm::raw_ostream& os, llvm::StringRef encoded);
+
+size_t Base64Decode(llvm::StringRef encoded, std::string* plain);
+
+llvm::StringRef Base64Decode(llvm::StringRef encoded, size_t* num_read,
+                             llvm::SmallVectorImpl<char>& buf);
+
+void Base64Encode(llvm::raw_ostream& os, llvm::StringRef plain);
+
+void Base64Encode(llvm::StringRef plain, std::string* encoded);
+
+llvm::StringRef Base64Encode(llvm::StringRef plain,
+                             llvm::SmallVectorImpl<char>& buf);
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_BASE64_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/ConcurrentQueue.h b/third_party/wpiutil_2018/src/main/native/include/support/ConcurrentQueue.h
new file mode 100644
index 0000000..f2cc7c9
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/ConcurrentQueue.h
@@ -0,0 +1,85 @@
+//
+// Copyright (c) 2013 Juan Palacios juan.palacios.puyana@gmail.com
+// Subject to the BSD 2-Clause License
+// - see < http://opensource.org/licenses/BSD-2-Clause>
+//
+
+#ifndef WPIUTIL_SUPPORT_CONCURRENTQUEUE_H_
+#define WPIUTIL_SUPPORT_CONCURRENTQUEUE_H_
+
+#include <queue>
+#include <thread>
+#include <utility>
+
+#include "support/condition_variable.h"
+#include "support/mutex.h"
+
+namespace wpi {
+
+template <typename T>
+class ConcurrentQueue {
+ public:
+  bool empty() const {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    return queue_.empty();
+  }
+
+  typename std::queue<T>::size_type size() const {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    return queue_.size();
+  }
+
+  T pop() {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    while (queue_.empty()) {
+      cond_.wait(mlock);
+    }
+    auto item = std::move(queue_.front());
+    queue_.pop();
+    return item;
+  }
+
+  void pop(T& item) {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    while (queue_.empty()) {
+      cond_.wait(mlock);
+    }
+    item = queue_.front();
+    queue_.pop();
+  }
+
+  void push(const T& item) {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    queue_.push(item);
+    mlock.unlock();
+    cond_.notify_one();
+  }
+
+  void push(T&& item) {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    queue_.push(std::forward<T>(item));
+    mlock.unlock();
+    cond_.notify_one();
+  }
+
+  template <typename... Args>
+  void emplace(Args&&... args) {
+    std::unique_lock<wpi::mutex> mlock(mutex_);
+    queue_.emplace(std::forward<Args>(args)...);
+    mlock.unlock();
+    cond_.notify_one();
+  }
+
+  ConcurrentQueue() = default;
+  ConcurrentQueue(const ConcurrentQueue&) = delete;
+  ConcurrentQueue& operator=(const ConcurrentQueue&) = delete;
+
+ private:
+  std::queue<T> queue_;
+  mutable wpi::mutex mutex_;
+  wpi::condition_variable cond_;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_CONCURRENTQUEUE_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/HttpUtil.h b/third_party/wpiutil_2018/src/main/native/include/support/HttpUtil.h
new file mode 100644
index 0000000..555af87
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/HttpUtil.h
@@ -0,0 +1,150 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_HTTPUTIL_H_
+#define WPIUTIL_SUPPORT_HTTPUTIL_H_
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "llvm/ArrayRef.h"
+#include "llvm/SmallString.h"
+#include "llvm/SmallVector.h"
+#include "llvm/StringMap.h"
+#include "llvm/StringRef.h"
+#include "llvm/Twine.h"
+#include "support/raw_istream.h"
+#include "support/raw_socket_istream.h"
+#include "support/raw_socket_ostream.h"
+#include "tcpsockets/NetworkStream.h"
+
+namespace wpi {
+
+// Unescape a %xx-encoded URI.
+// @param buf Buffer for output
+// @param error Set to true if an error occurred
+// @return Escaped string
+llvm::StringRef UnescapeURI(const llvm::Twine& str,
+                            llvm::SmallVectorImpl<char>& buf, bool* error);
+
+// Escape a string with %xx-encoding.
+// @param buf Buffer for output
+// @param spacePlus If true, encodes spaces to '+' rather than "%20"
+// @return Escaped string
+llvm::StringRef EscapeURI(const llvm::Twine& str,
+                          llvm::SmallVectorImpl<char>& buf,
+                          bool spacePlus = true);
+
+// Parse a set of HTTP headers.  Saves just the Content-Type and Content-Length
+// fields.
+// @param is Input stream
+// @param contentType If not null, Content-Type contents are saved here.
+// @param contentLength If not null, Content-Length contents are saved here.
+// @return False if error occurred in input stream
+bool ParseHttpHeaders(wpi::raw_istream& is,
+                      llvm::SmallVectorImpl<char>* contentType,
+                      llvm::SmallVectorImpl<char>* contentLength);
+
+// Look for a MIME multi-part boundary.  On return, the input stream will
+// be located at the character following the boundary (usually "\r\n").
+// @param is Input stream
+// @param boundary Boundary string to scan for (not including "--" prefix)
+// @param saveBuf If not null, all scanned characters up to but not including
+//     the boundary are saved to this string
+// @return False if error occurred on input stream, true if boundary found.
+bool FindMultipartBoundary(wpi::raw_istream& is, llvm::StringRef boundary,
+                           std::string* saveBuf);
+
+class HttpLocation {
+ public:
+  HttpLocation() = default;
+  HttpLocation(const llvm::Twine& url_, bool* error, std::string* errorMsg);
+
+  std::string url;       // retain copy
+  std::string user;      // unescaped
+  std::string password;  // unescaped
+  std::string host;
+  int port;
+  std::string path;  // escaped, not including leading '/'
+  std::vector<std::pair<std::string, std::string>> params;  // unescaped
+  std::string fragment;
+};
+
+class HttpRequest {
+ public:
+  HttpRequest() = default;
+
+  explicit HttpRequest(const HttpLocation& loc)
+      : host{loc.host}, port{loc.port} {
+    SetPath(loc.path, loc.params);
+    SetAuth(loc);
+  }
+
+  template <typename T>
+  HttpRequest(const HttpLocation& loc, const T& extraParams);
+
+  HttpRequest(const HttpLocation& loc, llvm::StringRef path_)
+      : host{loc.host}, port{loc.port}, path{path_} {
+    SetAuth(loc);
+  }
+
+  template <typename T>
+  HttpRequest(const HttpLocation& loc, llvm::StringRef path_, const T& params)
+      : host{loc.host}, port{loc.port} {
+    SetPath(path_, params);
+    SetAuth(loc);
+  }
+
+  llvm::SmallString<128> host;
+  int port;
+  std::string auth;
+  llvm::SmallString<128> path;
+
+ private:
+  void SetAuth(const HttpLocation& loc);
+  template <typename T>
+  void SetPath(llvm::StringRef path_, const T& params);
+
+  template <typename T>
+  static llvm::StringRef GetFirst(const T& elem) {
+    return elem.first;
+  }
+  template <typename T>
+  static llvm::StringRef GetFirst(const llvm::StringMapEntry<T>& elem) {
+    return elem.getKey();
+  }
+  template <typename T>
+  static llvm::StringRef GetSecond(const T& elem) {
+    return elem.second;
+  }
+};
+
+class HttpConnection {
+ public:
+  HttpConnection(std::unique_ptr<wpi::NetworkStream> stream_, int timeout)
+      : stream{std::move(stream_)}, is{*stream, timeout}, os{*stream, true} {}
+
+  bool Handshake(const HttpRequest& request, std::string* warnMsg);
+
+  std::unique_ptr<wpi::NetworkStream> stream;
+  wpi::raw_socket_istream is;
+  wpi::raw_socket_ostream os;
+
+  // Valid after Handshake() is successful
+  llvm::SmallString<64> contentType;
+  llvm::SmallString<64> contentLength;
+
+  explicit operator bool() const { return stream && !is.has_error(); }
+};
+
+}  // namespace wpi
+
+#include "HttpUtil.inl"
+
+#endif  // WPIUTIL_SUPPORT_HTTPUTIL_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/HttpUtil.inl b/third_party/wpiutil_2018/src/main/native/include/support/HttpUtil.inl
new file mode 100644
index 0000000..d67f3c8
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/HttpUtil.inl
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2015. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_HTTPUTIL_INL_
+#define WPIUTIL_SUPPORT_HTTPUTIL_INL_
+
+namespace wpi {
+
+template <typename T>
+HttpRequest::HttpRequest(const HttpLocation& loc, const T& extraParams)
+    : host{loc.host}, port{loc.port} {
+  llvm::StringMap<llvm::StringRef> params;
+  for (const auto& p : loc.params)
+    params.insert(std::make_pair(GetFirst(p), GetSecond(p)));
+  for (const auto& p : extraParams)
+    params.insert(std::make_pair(GetFirst(p), GetSecond(p)));
+  SetPath(loc.path, params);
+  SetAuth(loc);
+}
+
+template <typename T>
+void HttpRequest::SetPath(llvm::StringRef path_, const T& params) {
+  // Build location including query string
+  llvm::raw_svector_ostream pathOs{path};
+  pathOs << path_;
+  bool first = true;
+  for (const auto& param : params) {
+    if (first) {
+      pathOs << '?';
+      first = false;
+    } else {
+      pathOs << '&';
+    }
+    llvm::SmallString<64> escapeBuf;
+    pathOs << EscapeURI(GetFirst(param), escapeBuf);
+    if (!GetSecond(param).empty()) {
+      pathOs << '=' << EscapeURI(GetSecond(param), escapeBuf);
+    }
+  }
+}
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_HTTPUTIL_INL_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/Logger.h b/third_party/wpiutil_2018/src/main/native/include/support/Logger.h
new file mode 100644
index 0000000..6c29f4e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/Logger.h
@@ -0,0 +1,100 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_LOGGER_H_
+#define WPIUTIL_SUPPORT_LOGGER_H_
+
+#include <functional>
+
+#include "llvm/SmallString.h"
+#include "llvm/raw_ostream.h"
+
+namespace wpi {
+
+enum LogLevel {
+  WPI_LOG_CRITICAL = 50,
+  WPI_LOG_ERROR = 40,
+  WPI_LOG_WARNING = 30,
+  WPI_LOG_INFO = 20,
+  WPI_LOG_DEBUG = 10,
+  WPI_LOG_DEBUG1 = 9,
+  WPI_LOG_DEBUG2 = 8,
+  WPI_LOG_DEBUG3 = 7,
+  WPI_LOG_DEBUG4 = 6
+};
+
+class Logger {
+ public:
+  typedef std::function<void(unsigned int level, const char* file,
+                             unsigned int line, const char* msg)>
+      LogFunc;
+
+  Logger() = default;
+  explicit Logger(const LogFunc& func) : m_func(func) {}
+  Logger(const LogFunc& func, unsigned int min_level)
+      : m_func(func), m_min_level(min_level) {}
+
+  void SetLogger(LogFunc func) { m_func = func; }
+
+  void set_min_level(unsigned int level) { m_min_level = level; }
+  unsigned int min_level() const { return m_min_level; }
+
+  void Log(unsigned int level, const char* file, unsigned int line,
+           const char* msg) {
+    if (!m_func || level < m_min_level) return;
+    m_func(level, file, line, msg);
+  }
+
+  bool HasLogger() const { return m_func != nullptr; }
+
+ private:
+  LogFunc m_func;
+  unsigned int m_min_level = 20;
+};
+
+#define WPI_LOG(logger_inst, level, x)                                 \
+  do {                                                                 \
+    ::wpi::Logger& WPI_logger_ = logger_inst;                          \
+    if (WPI_logger_.min_level() <= level && WPI_logger_.HasLogger()) { \
+      llvm::SmallString<128> log_buf_;                                 \
+      llvm::raw_svector_ostream log_os_{log_buf_};                     \
+      log_os_ << x;                                                    \
+      WPI_logger_.Log(level, __FILE__, __LINE__, log_buf_.c_str());    \
+    }                                                                  \
+  } while (0)
+
+#define WPI_ERROR(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_ERROR, x)
+#define WPI_WARNING(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_WARNING, x)
+#define WPI_INFO(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_INFO, x)
+
+#ifdef NDEBUG
+#define WPI_DEBUG(inst, x) \
+  do {                     \
+  } while (0)
+#define WPI_DEBUG1(inst, x) \
+  do {                      \
+  } while (0)
+#define WPI_DEBUG2(inst, x) \
+  do {                      \
+  } while (0)
+#define WPI_DEBUG3(inst, x) \
+  do {                      \
+  } while (0)
+#define WPI_DEBUG4(inst, x) \
+  do {                      \
+  } while (0)
+#else
+#define WPI_DEBUG(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG, x)
+#define WPI_DEBUG1(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG1, x)
+#define WPI_DEBUG2(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG2, x)
+#define WPI_DEBUG3(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG3, x)
+#define WPI_DEBUG4(inst, x) WPI_LOG(inst, ::wpi::WPI_LOG_DEBUG4, x)
+#endif
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_LOGGER_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/SafeThread.h b/third_party/wpiutil_2018/src/main/native/include/support/SafeThread.h
new file mode 100644
index 0000000..d09faf8
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/SafeThread.h
@@ -0,0 +1,133 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_SAFETHREAD_H_
+#define WPIUTIL_SUPPORT_SAFETHREAD_H_
+
+#include <atomic>
+#include <thread>
+
+#include "support/condition_variable.h"
+#include "support/mutex.h"
+
+namespace wpi {
+
+// Base class for SafeThreadOwner threads.
+class SafeThread {
+ public:
+  SafeThread() { m_active = true; }
+  virtual ~SafeThread() = default;
+  virtual void Main() = 0;
+
+  wpi::mutex m_mutex;
+  std::atomic_bool m_active;
+  wpi::condition_variable m_cond;
+};
+
+namespace detail {
+
+// Non-template proxy base class for common proxy code.
+class SafeThreadProxyBase {
+ public:
+  explicit SafeThreadProxyBase(SafeThread* thr) : m_thread(thr) {
+    if (!m_thread) return;
+    m_lock = std::unique_lock<wpi::mutex>(m_thread->m_mutex);
+    if (!m_thread->m_active) {
+      m_lock.unlock();
+      m_thread = nullptr;
+      return;
+    }
+  }
+  explicit operator bool() const { return m_thread != nullptr; }
+  std::unique_lock<wpi::mutex>& GetLock() { return m_lock; }
+
+ protected:
+  SafeThread* m_thread;
+  std::unique_lock<wpi::mutex> m_lock;
+};
+
+// A proxy for SafeThread.
+// Also serves as a scoped lock on SafeThread::m_mutex.
+template <typename T>
+class SafeThreadProxy : public SafeThreadProxyBase {
+ public:
+  explicit SafeThreadProxy(SafeThread* thr) : SafeThreadProxyBase(thr) {}
+  T& operator*() const { return *static_cast<T*>(m_thread); }
+  T* operator->() const { return static_cast<T*>(m_thread); }
+};
+
+// Non-template owner base class for common owner code.
+class SafeThreadOwnerBase {
+ public:
+  void Stop();
+
+  SafeThreadOwnerBase() { m_thread = nullptr; }
+  SafeThreadOwnerBase(const SafeThreadOwnerBase&) = delete;
+  SafeThreadOwnerBase& operator=(const SafeThreadOwnerBase&) = delete;
+  SafeThreadOwnerBase(SafeThreadOwnerBase&& other)
+      : m_thread(other.m_thread.exchange(nullptr)) {}
+  SafeThreadOwnerBase& operator=(SafeThreadOwnerBase other) {
+    SafeThread* otherthr = other.m_thread.exchange(nullptr);
+    SafeThread* curthr = m_thread.exchange(otherthr);
+    other.m_thread.exchange(curthr);  // other destructor will clean up
+    return *this;
+  }
+  ~SafeThreadOwnerBase() { Stop(); }
+
+  explicit operator bool() const { return m_thread.load(); }
+
+ protected:
+  void Start(SafeThread* thr);
+  SafeThread* GetThread() const { return m_thread.load(); }
+  std::thread::native_handle_type GetNativeThreadHandle() const {
+    return m_nativeHandle;
+  }
+
+ private:
+  std::atomic<SafeThread*> m_thread;
+  std::atomic<std::thread::native_handle_type> m_nativeHandle;
+};
+
+inline void SafeThreadOwnerBase::Start(SafeThread* thr) {
+  SafeThread* curthr = nullptr;
+  SafeThread* newthr = thr;
+  if (!m_thread.compare_exchange_strong(curthr, newthr)) {
+    delete newthr;
+    return;
+  }
+  std::thread stdThread([=]() {
+    newthr->Main();
+    delete newthr;
+  });
+  m_nativeHandle = stdThread.native_handle();
+  stdThread.detach();
+}
+
+inline void SafeThreadOwnerBase::Stop() {
+  SafeThread* thr = m_thread.exchange(nullptr);
+  if (!thr) return;
+  thr->m_active = false;
+  thr->m_cond.notify_one();
+}
+
+}  // namespace detail
+
+template <typename T>
+class SafeThreadOwner : public detail::SafeThreadOwnerBase {
+ public:
+  void Start() { Start(new T); }
+  void Start(T* thr) { detail::SafeThreadOwnerBase::Start(thr); }
+
+  using Proxy = typename detail::SafeThreadProxy<T>;
+  Proxy GetThread() const {
+    return Proxy(detail::SafeThreadOwnerBase::GetThread());
+  }
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_SAFETHREAD_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/UidVector.h b/third_party/wpiutil_2018/src/main/native/include/support/UidVector.h
new file mode 100644
index 0000000..3307086
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/UidVector.h
@@ -0,0 +1,67 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_UIDVECTOR_H_
+#define WPIUTIL_SUPPORT_UIDVECTOR_H_
+
+#include <utility>
+#include <vector>
+
+namespace wpi {
+
+// Vector which provides an integrated freelist for removal and reuse of
+// individual elements.
+// @tparam T element type; must be default-constructible and evaluate in
+//           boolean context to false when "empty"
+// @tparam reuse_threshold how many free elements to store up before starting
+//                         to recycle them
+template <typename T, typename std::vector<T>::size_type reuse_threshold>
+class UidVector {
+ public:
+  typedef typename std::vector<T>::size_type size_type;
+
+  bool empty() const { return m_active_count == 0; }
+  size_type size() const { return m_vector.size(); }
+  T& operator[](size_type i) { return m_vector[i]; }
+  const T& operator[](size_type i) const { return m_vector[i]; }
+
+  // Add a new T to the vector.  If there are elements on the freelist,
+  // reuses the last one; otherwise adds to the end of the vector.
+  // Returns the resulting element index.
+  template <class... Args>
+  size_type emplace_back(Args&&... args) {
+    size_type uid;
+    if (m_free.size() < reuse_threshold) {
+      uid = m_vector.size();
+      m_vector.emplace_back(std::forward<Args>(args)...);
+    } else {
+      uid = m_free.front();
+      m_free.erase(m_free.begin());
+      m_vector[uid] = T(std::forward<Args>(args)...);
+    }
+    ++m_active_count;
+    return uid;
+  }
+
+  // Removes the identified element by replacing it with a default-constructed
+  // one.  The element is added to the freelist for later reuse.
+  void erase(size_type uid) {
+    if (uid >= m_vector.size() || !m_vector[uid]) return;
+    m_free.push_back(uid);
+    m_vector[uid] = T();
+    --m_active_count;
+  }
+
+ private:
+  std::vector<T> m_vector;
+  std::vector<size_type> m_free;
+  size_type m_active_count{0};
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_UIDVECTOR_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/atomic_static.h b/third_party/wpiutil_2018/src/main/native/include/support/atomic_static.h
new file mode 100644
index 0000000..5547f75
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/atomic_static.h
@@ -0,0 +1,49 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_ATOMIC_STATIC_H_
+#define WPIUTIL_SUPPORT_ATOMIC_STATIC_H_
+
+#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
+
+// Just use a local static.  This is thread-safe per
+// http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/
+
+// Per https://msdn.microsoft.com/en-us/library/Hh567368.aspx "Magic Statics"
+// are supported in Visual Studio 2015 but not in earlier versions.
+#define ATOMIC_STATIC(cls, inst) static cls inst
+#define ATOMIC_STATIC_DECL(cls)
+#define ATOMIC_STATIC_INIT(cls)
+
+#else
+// From http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/
+#include <atomic>
+#include <mutex>
+
+#define ATOMIC_STATIC(cls, inst)                               \
+  cls* inst##tmp = m_instance.load(std::memory_order_acquire); \
+  if (inst##tmp == nullptr) {                                  \
+    std::lock_guard<std::mutex> lock(m_instance_mutex);        \
+    inst##tmp = m_instance.load(std::memory_order_relaxed);    \
+    if (inst##tmp == nullptr) {                                \
+      inst##tmp = new cls;                                     \
+      m_instance.store(inst##tmp, std::memory_order_release);  \
+    }                                                          \
+  }                                                            \
+  cls& inst = *inst##tmp
+
+#define ATOMIC_STATIC_DECL(cls)        \
+  static std::atomic<cls*> m_instance; \
+  static std::mutex m_instance_mutex;
+
+#define ATOMIC_STATIC_INIT(cls)      \
+  std::atomic<cls*> cls::m_instance; \
+  std::mutex cls::m_instance_mutex;
+
+#endif
+
+#endif  // WPIUTIL_SUPPORT_ATOMIC_STATIC_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/condition_variable.h b/third_party/wpiutil_2018/src/main/native/include/support/condition_variable.h
new file mode 100644
index 0000000..23ce90d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/condition_variable.h
@@ -0,0 +1,22 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <condition_variable>
+
+#include "priority_condition_variable.h"
+
+namespace wpi {
+
+#ifdef WPI_HAVE_PRIORITY_CONDITION_VARIABLE
+using condition_variable = priority_condition_variable;
+#else
+using condition_variable = ::std::condition_variable;
+#endif
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/deprecated.h b/third_party/wpiutil_2018/src/main/native/include/support/deprecated.h
new file mode 100644
index 0000000..58209f4
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/deprecated.h
@@ -0,0 +1,33 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_DEPRECATED_H_
+#define WPIUTIL_SUPPORT_DEPRECATED_H_
+
+// [[deprecated(msg)]] is a C++14 feature not supported by MSVC or GCC < 4.9.
+// We provide an equivalent warning implementation for those compilers here.
+#ifndef WPI_DEPRECATED
+#if defined(_MSC_VER)
+#define WPI_DEPRECATED(msg) __declspec(deprecated(msg))
+#elif defined(__GNUC__)
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)
+#if __cplusplus > 201103L
+#define WPI_DEPRECATED(msg) [[deprecated(msg)]]
+#else
+#define WPI_DEPRECATED(msg) [[gnu::deprecated(msg)]]
+#endif
+#else
+#define WPI_DEPRECATED(msg) __attribute__((deprecated(msg)))
+#endif
+#elif __cplusplus > 201103L
+#define WPI_DEPRECATED(msg) [[deprecated(msg)]]
+#else
+#define WPI_DEPRECATED(msg) /*nothing*/
+#endif
+#endif
+
+#endif  // WPIUTIL_SUPPORT_DEPRECATED_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/hostname.h b/third_party/wpiutil_2018/src/main/native/include/support/hostname.h
new file mode 100644
index 0000000..19e372a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/hostname.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_HOSTNAME_H_
+#define WPIUTIL_SUPPORT_HOSTNAME_H_
+
+#include <string>
+
+#include "llvm/StringRef.h"
+
+namespace llvm {
+template <typename T>
+class SmallVectorImpl;
+}  // namespace llvm
+
+namespace wpi {
+std::string GetHostname();
+llvm::StringRef GetHostname(llvm::SmallVectorImpl<char>& name);
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_HOSTNAME_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/jni_util.h b/third_party/wpiutil_2018/src/main/native/include/support/jni_util.h
new file mode 100644
index 0000000..10918e3
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/jni_util.h
@@ -0,0 +1,615 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_JNI_UTIL_H_
+#define WPIUTIL_SUPPORT_JNI_UTIL_H_
+
+#include <jni.h>
+
+#include <queue>
+#include <string>
+#include <type_traits>
+#include <utility>
+#include <vector>
+
+#include "llvm/ArrayRef.h"
+#include "llvm/ConvertUTF.h"
+#include "llvm/SmallString.h"
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+#include "llvm/raw_ostream.h"
+#include "support/SafeThread.h"
+#include "support/atomic_static.h"
+#include "support/deprecated.h"
+#include "support/mutex.h"
+
+namespace wpi {
+namespace java {
+
+// Gets a Java stack trace.  Also provides the last function
+// in the stack trace not starting with excludeFuncPrefix (useful for e.g.
+// finding the first user call to a series of library functions).
+std::string GetJavaStackTrace(
+    JNIEnv* env, std::string* func = nullptr,
+    llvm::StringRef excludeFuncPrefix = llvm::StringRef());
+
+// Shim for backwards compatibility
+template <const char* excludeFuncPrefix>
+WPI_DEPRECATED("use StringRef function instead")
+std::string GetJavaStackTrace(JNIEnv* env, std::string* func) {
+  return GetJavaStackTrace(
+      env, func,
+      excludeFuncPrefix == nullptr ? llvm::StringRef() : excludeFuncPrefix);
+}
+
+// Finds a class and keep it as a global reference.
+// Use with caution, as the destructor does NOT call DeleteGlobalRef due
+// to potential shutdown issues with doing so.
+class JClass {
+ public:
+  JClass() = default;
+
+  JClass(JNIEnv* env, const char* name) {
+    jclass local = env->FindClass(name);
+    if (!local) return;
+    m_cls = static_cast<jclass>(env->NewGlobalRef(local));
+    env->DeleteLocalRef(local);
+  }
+
+  void free(JNIEnv* env) {
+    if (m_cls) env->DeleteGlobalRef(m_cls);
+    m_cls = nullptr;
+  }
+
+  explicit operator bool() const { return m_cls; }
+
+  operator jclass() const { return m_cls; }
+
+ protected:
+  jclass m_cls = nullptr;
+};
+
+// Container class for cleaning up Java local references.
+// The destructor calls DeleteLocalRef.
+template <typename T>
+class JLocal {
+ public:
+  JLocal(JNIEnv* env, T obj) : m_env(env), m_obj(obj) {}
+  JLocal(const JLocal&) = delete;
+  JLocal(JLocal&& oth) : m_env(oth.m_env), m_obj(oth.m_obj) {
+    oth.m_obj = nullptr;
+  }
+  JLocal& operator=(const JLocal&) = delete;
+  JLocal& operator=(JLocal&& oth) {
+    m_env = oth.m_env;
+    m_obj = oth.m_obj;
+    oth.m_obj = nullptr;
+    return *this;
+  }
+  ~JLocal() {
+    if (m_obj) m_env->DeleteLocalRef(m_obj);
+  }
+  operator T() { return m_obj; }
+  T obj() { return m_obj; }
+
+ private:
+  JNIEnv* m_env;
+  T m_obj;
+};
+
+//
+// Conversions from Java objects to C++
+//
+
+// Java string (jstring) reference.  The string is provided as UTF8.
+// This is not actually a reference, as it makes a copy of the string
+// characters, but it's named this way for consistency.
+class JStringRef {
+ public:
+  JStringRef(JNIEnv* env, jstring str) {
+    if (str) {
+      jsize size = env->GetStringLength(str);
+      const jchar* chars = env->GetStringCritical(str, nullptr);
+      if (chars) {
+        llvm::convertUTF16ToUTF8String(llvm::makeArrayRef(chars, size), m_str);
+        env->ReleaseStringCritical(str, chars);
+      }
+    } else {
+      llvm::errs() << "JStringRef was passed a null pointer at \n"
+                   << GetJavaStackTrace(env);
+    }
+    // Ensure str is null-terminated.
+    m_str.push_back('\0');
+    m_str.pop_back();
+  }
+
+  operator llvm::StringRef() const { return m_str; }
+  llvm::StringRef str() const { return m_str; }
+  const char* c_str() const { return m_str.data(); }
+  size_t size() const { return m_str.size(); }
+
+ private:
+  llvm::SmallString<128> m_str;
+};
+
+// Details for J*ArrayRef and CriticalJ*ArrayRef
+namespace detail {
+
+template <typename C, typename T>
+class JArrayRefInner {};
+
+// Specialization of JArrayRefBase to provide StringRef conversion.
+template <typename C>
+class JArrayRefInner<C, jbyte> {
+ public:
+  operator llvm::StringRef() const { return str(); }
+
+  llvm::StringRef str() const {
+    auto arr = static_cast<const C*>(this)->array();
+    if (arr.empty()) return llvm::StringRef{};
+    return llvm::StringRef{reinterpret_cast<const char*>(arr.data()),
+                           arr.size()};
+  }
+};
+
+// Base class for J*ArrayRef and CriticalJ*ArrayRef
+template <typename T>
+class JArrayRefBase : public JArrayRefInner<JArrayRefBase<T>, T> {
+ public:
+  explicit operator bool() const { return this->m_elements != nullptr; }
+
+  operator llvm::ArrayRef<T>() const { return array(); }
+
+  llvm::ArrayRef<T> array() const {
+    if (!this->m_elements) return llvm::ArrayRef<T>{};
+    return llvm::ArrayRef<T>{this->m_elements, this->m_size};
+  }
+
+  JArrayRefBase(const JArrayRefBase&) = delete;
+  JArrayRefBase& operator=(const JArrayRefBase&) = delete;
+
+  JArrayRefBase(JArrayRefBase&& oth)
+      : m_env(oth.m_env),
+        m_jarr(oth.m_jarr),
+        m_size(oth.m_size),
+        m_elements(oth.m_elements) {
+    oth.m_jarr = nullptr;
+    oth.m_elements = nullptr;
+  }
+
+  JArrayRefBase& operator=(JArrayRefBase&& oth) {
+    this->m_env = oth.m_env;
+    this->m_jarr = oth.m_jarr;
+    this->m_size = oth.m_size;
+    this->m_elements = oth.m_elements;
+    oth.m_jarr = nullptr;
+    oth.m_elements = nullptr;
+    return *this;
+  }
+
+ protected:
+  JArrayRefBase(JNIEnv* env, T* elements, size_t size) {
+    this->m_env = env;
+    this->m_jarr = nullptr;
+    this->m_size = size;
+    this->m_elements = elements;
+  }
+
+  JArrayRefBase(JNIEnv* env, jarray jarr) {
+    this->m_env = env;
+    this->m_jarr = jarr;
+    this->m_size = jarr ? env->GetArrayLength(jarr) : 0;
+    this->m_elements = nullptr;
+  }
+
+  JNIEnv* m_env;
+  jarray m_jarr = nullptr;
+  size_t m_size;
+  T* m_elements;
+};
+
+}  // namespace detail
+
+// Java array / DirectBuffer reference.
+
+#define WPI_JNI_JARRAYREF(T, F)                                                \
+  class J##F##ArrayRef : public detail::JArrayRefBase<T> {                     \
+   public:                                                                     \
+    J##F##ArrayRef(JNIEnv* env, jobject bb, int len)                           \
+        : detail::JArrayRefBase<T>(                                            \
+              env,                                                             \
+              static_cast<T*>(bb ? env->GetDirectBufferAddress(bb) : nullptr), \
+              len) {                                                           \
+      if (!bb)                                                                 \
+        llvm::errs() << "JArrayRef was passed a null pointer at \n"            \
+                     << GetJavaStackTrace(env);                                \
+    }                                                                          \
+    J##F##ArrayRef(JNIEnv* env, T##Array jarr)                                 \
+        : detail::JArrayRefBase<T>(env, jarr) {                                \
+      if (jarr)                                                                \
+        m_elements = env->Get##F##ArrayElements(jarr, nullptr);                \
+      else                                                                     \
+        llvm::errs() << "JArrayRef was passed a null pointer at \n"            \
+                     << GetJavaStackTrace(env);                                \
+    }                                                                          \
+    ~J##F##ArrayRef() {                                                        \
+      if (m_jarr && m_elements)                                                \
+        m_env->Release##F##ArrayElements(static_cast<T##Array>(m_jarr),        \
+                                         m_elements, JNI_ABORT);               \
+    }                                                                          \
+  };                                                                           \
+                                                                               \
+  class CriticalJ##F##ArrayRef : public detail::JArrayRefBase<T> {             \
+   public:                                                                     \
+    CriticalJ##F##ArrayRef(JNIEnv* env, T##Array jarr)                         \
+        : detail::JArrayRefBase<T>(env, jarr) {                                \
+      if (jarr)                                                                \
+        m_elements =                                                           \
+            static_cast<T*>(env->GetPrimitiveArrayCritical(jarr, nullptr));    \
+      else                                                                     \
+        llvm::errs() << "JArrayRef was passed a null pointer at \n"            \
+                     << GetJavaStackTrace(env);                                \
+    }                                                                          \
+    ~CriticalJ##F##ArrayRef() {                                                \
+      if (m_jarr && m_elements)                                                \
+        m_env->ReleasePrimitiveArrayCritical(m_jarr, m_elements, JNI_ABORT);   \
+    }                                                                          \
+  };
+
+WPI_JNI_JARRAYREF(jboolean, Boolean)
+WPI_JNI_JARRAYREF(jbyte, Byte)
+WPI_JNI_JARRAYREF(jshort, Short)
+WPI_JNI_JARRAYREF(jint, Int)
+WPI_JNI_JARRAYREF(jlong, Long)
+WPI_JNI_JARRAYREF(jfloat, Float)
+WPI_JNI_JARRAYREF(jdouble, Double)
+
+#undef WPI_JNI_JARRAYREF
+
+//
+// Conversions from C++ to Java objects
+//
+
+// Convert a UTF8 string into a jstring.
+inline jstring MakeJString(JNIEnv* env, llvm::StringRef str) {
+  llvm::SmallVector<UTF16, 128> chars;
+  llvm::convertUTF8ToUTF16String(str, chars);
+  return env->NewString(chars.begin(), chars.size());
+}
+
+// details for MakeJIntArray
+namespace detail {
+
+// Slow path (get primitive array and set individual elements).  This
+// is used if the input type is not an integer of the same size (note
+// signed/unsigned is ignored).
+template <typename T,
+          bool = (std::is_integral<T>::value && sizeof(jint) == sizeof(T))>
+struct ConvertIntArray {
+  static jintArray ToJava(JNIEnv* env, llvm::ArrayRef<T> arr) {
+    jintArray jarr = env->NewIntArray(arr.size());
+    if (!jarr) return nullptr;
+    jint* elements =
+        static_cast<jint*>(env->GetPrimitiveArrayCritical(jarr, nullptr));
+    if (!elements) return nullptr;
+    for (size_t i = 0; i < arr.size(); ++i)
+      elements[i] = static_cast<jint>(arr[i]);
+    env->ReleasePrimitiveArrayCritical(jarr, elements, 0);
+    return jarr;
+  }
+};
+
+// Fast path (use SetIntArrayRegion)
+template <typename T>
+struct ConvertIntArray<T, true> {
+  static jintArray ToJava(JNIEnv* env, llvm::ArrayRef<T> arr) {
+    jintArray jarr = env->NewIntArray(arr.size());
+    if (!jarr) return nullptr;
+    env->SetIntArrayRegion(jarr, 0, arr.size(),
+                           reinterpret_cast<const jint*>(arr.data()));
+    return jarr;
+  }
+};
+
+}  // namespace detail
+
+// Convert an ArrayRef to a jintArray.
+template <typename T>
+inline jintArray MakeJIntArray(JNIEnv* env, llvm::ArrayRef<T> arr) {
+  return detail::ConvertIntArray<T>::ToJava(env, arr);
+}
+
+// Convert a SmallVector to a jintArray.  This is required in addition to
+// ArrayRef because template resolution occurs prior to implicit conversions.
+template <typename T>
+inline jintArray MakeJIntArray(JNIEnv* env,
+                               const llvm::SmallVectorImpl<T>& arr) {
+  return detail::ConvertIntArray<T>::ToJava(env, arr);
+}
+
+// Convert a std::vector to a jintArray.  This is required in addition to
+// ArrayRef because template resolution occurs prior to implicit conversions.
+template <typename T>
+inline jintArray MakeJIntArray(JNIEnv* env, const std::vector<T>& arr) {
+  return detail::ConvertIntArray<T>::ToJava(env, arr);
+}
+
+// Convert a StringRef into a jbyteArray.
+inline jbyteArray MakeJByteArray(JNIEnv* env, llvm::StringRef str) {
+  jbyteArray jarr = env->NewByteArray(str.size());
+  if (!jarr) return nullptr;
+  env->SetByteArrayRegion(jarr, 0, str.size(),
+                          reinterpret_cast<const jbyte*>(str.data()));
+  return jarr;
+}
+
+// Convert an array of integers into a jbooleanArray.
+inline jbooleanArray MakeJBooleanArray(JNIEnv* env, llvm::ArrayRef<int> arr) {
+  jbooleanArray jarr = env->NewBooleanArray(arr.size());
+  if (!jarr) return nullptr;
+  jboolean* elements =
+      static_cast<jboolean*>(env->GetPrimitiveArrayCritical(jarr, nullptr));
+  if (!elements) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i)
+    elements[i] = arr[i] ? JNI_TRUE : JNI_FALSE;
+  env->ReleasePrimitiveArrayCritical(jarr, elements, 0);
+  return jarr;
+}
+
+// Convert an array of booleans into a jbooleanArray.
+inline jbooleanArray MakeJBooleanArray(JNIEnv* env, llvm::ArrayRef<bool> arr) {
+  jbooleanArray jarr = env->NewBooleanArray(arr.size());
+  if (!jarr) return nullptr;
+  jboolean* elements =
+      static_cast<jboolean*>(env->GetPrimitiveArrayCritical(jarr, nullptr));
+  if (!elements) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i)
+    elements[i] = arr[i] ? JNI_TRUE : JNI_FALSE;
+  env->ReleasePrimitiveArrayCritical(jarr, elements, 0);
+  return jarr;
+}
+
+  // Other MakeJ*Array conversions.
+
+#define WPI_JNI_MAKEJARRAY(T, F)                                        \
+  inline T##Array MakeJ##F##Array(JNIEnv* env, llvm::ArrayRef<T> arr) { \
+    T##Array jarr = env->New##F##Array(arr.size());                     \
+    if (!jarr) return nullptr;                                          \
+    env->Set##F##ArrayRegion(jarr, 0, arr.size(), arr.data());          \
+    return jarr;                                                        \
+  }
+
+WPI_JNI_MAKEJARRAY(jboolean, Boolean)
+WPI_JNI_MAKEJARRAY(jbyte, Byte)
+WPI_JNI_MAKEJARRAY(jshort, Short)
+WPI_JNI_MAKEJARRAY(jlong, Long)
+WPI_JNI_MAKEJARRAY(jfloat, Float)
+WPI_JNI_MAKEJARRAY(jdouble, Double)
+
+#undef WPI_JNI_MAKEJARRAY
+
+// Convert an array of std::string into a jarray of jstring.
+inline jobjectArray MakeJStringArray(JNIEnv* env,
+                                     llvm::ArrayRef<std::string> arr) {
+  static JClass stringCls{env, "java/lang/String"};
+  if (!stringCls) return nullptr;
+  jobjectArray jarr = env->NewObjectArray(arr.size(), stringCls, nullptr);
+  if (!jarr) return nullptr;
+  for (size_t i = 0; i < arr.size(); ++i) {
+    JLocal<jstring> elem{env, MakeJString(env, arr[i])};
+    env->SetObjectArrayElement(jarr, i, elem.obj());
+  }
+  return jarr;
+}
+
+// Generic callback thread implementation.
+//
+// JNI's AttachCurrentThread() creates a Java Thread object on every
+// invocation, which is both time inefficient and causes issues with Eclipse
+// (which tries to keep a thread list up-to-date and thus gets swamped).
+//
+// Instead, this class attaches just once.  When a hardware notification
+// occurs, a condition variable wakes up this thread and this thread actually
+// makes the call into Java.
+//
+// The template parameter T is the message being passed to the callback, but
+// also needs to provide the following functions:
+//  static JavaVM* GetJVM();
+//  static const char* GetName();
+//  void CallJava(JNIEnv *env, jobject func, jmethodID mid);
+//
+// When creating this, ATOMIC_STATIC_INIT() needs to be performed on the
+// templated class as well.
+template <typename T>
+class JCallbackThread : public SafeThread {
+ public:
+  void Main();
+
+  std::queue<T> m_queue;
+  jobject m_func = nullptr;
+  jmethodID m_mid;
+};
+
+template <typename T>
+class JCallbackManager : public SafeThreadOwner<JCallbackThread<T>> {
+ public:
+  void SetFunc(JNIEnv* env, jobject func, jmethodID mid);
+
+  template <typename... Args>
+  void Send(Args&&... args);
+};
+
+template <typename T>
+void JCallbackManager<T>::SetFunc(JNIEnv* env, jobject func, jmethodID mid) {
+  auto thr = this->GetThread();
+  if (!thr) return;
+  // free global reference
+  if (thr->m_func) env->DeleteGlobalRef(thr->m_func);
+  // create global reference
+  thr->m_func = env->NewGlobalRef(func);
+  thr->m_mid = mid;
+}
+
+template <typename T>
+template <typename... Args>
+void JCallbackManager<T>::Send(Args&&... args) {
+  auto thr = this->GetThread();
+  if (!thr) return;
+  thr->m_queue.emplace(std::forward<Args>(args)...);
+  thr->m_cond.notify_one();
+}
+
+template <typename T>
+void JCallbackThread<T>::Main() {
+  JNIEnv* env;
+  JavaVMAttachArgs args;
+  args.version = JNI_VERSION_1_2;
+  args.name = const_cast<char*>(T::GetName());
+  args.group = nullptr;
+  jint rs = T::GetJVM()->AttachCurrentThreadAsDaemon(
+      reinterpret_cast<void**>(&env), &args);
+  if (rs != JNI_OK) return;
+
+  std::unique_lock<wpi::mutex> lock(m_mutex);
+  while (m_active) {
+    m_cond.wait(lock, [&] { return !(m_active && m_queue.empty()); });
+    if (!m_active) break;
+    while (!m_queue.empty()) {
+      if (!m_active) break;
+      auto item = std::move(m_queue.front());
+      m_queue.pop();
+      auto func = m_func;
+      auto mid = m_mid;
+      lock.unlock();  // don't hold mutex during callback execution
+      item.CallJava(env, func, mid);
+      if (env->ExceptionCheck()) {
+        env->ExceptionDescribe();
+        env->ExceptionClear();
+      }
+      lock.lock();
+    }
+  }
+
+  JavaVM* jvm = T::GetJVM();
+  if (jvm) jvm->DetachCurrentThread();
+}
+
+template <typename T>
+class JSingletonCallbackManager : public JCallbackManager<T> {
+ public:
+  static JSingletonCallbackManager<T>& GetInstance() {
+    ATOMIC_STATIC(JSingletonCallbackManager<T>, instance);
+    return instance;
+  }
+
+ private:
+  ATOMIC_STATIC_DECL(JSingletonCallbackManager<T>)
+};
+
+inline std::string GetJavaStackTrace(JNIEnv* env, std::string* func,
+                                     llvm::StringRef excludeFuncPrefix) {
+  // create a throwable
+  static JClass throwableCls(env, "java/lang/Throwable");
+  if (!throwableCls) return "";
+  static jmethodID constructorId = nullptr;
+  if (!constructorId)
+    constructorId = env->GetMethodID(throwableCls, "<init>", "()V");
+  JLocal<jobject> throwable(env, env->NewObject(throwableCls, constructorId));
+
+  // retrieve information from the exception.
+  // get method id
+  // getStackTrace returns an array of StackTraceElement
+  static jmethodID getStackTraceId = nullptr;
+  if (!getStackTraceId)
+    getStackTraceId = env->GetMethodID(throwableCls, "getStackTrace",
+                                       "()[Ljava/lang/StackTraceElement;");
+
+  // call getStackTrace
+  JLocal<jobjectArray> stackTrace(
+      env, static_cast<jobjectArray>(
+               env->CallObjectMethod(throwable, getStackTraceId)));
+
+  if (!stackTrace) return "";
+
+  // get length of the array
+  jsize stackTraceLength = env->GetArrayLength(stackTrace);
+
+  // get toString methodId of StackTraceElement class
+  static JClass stackTraceElementCls(env, "java/lang/StackTraceElement");
+  if (!stackTraceElementCls) return "";
+  static jmethodID toStringId = nullptr;
+  if (!toStringId)
+    toStringId = env->GetMethodID(stackTraceElementCls, "toString",
+                                  "()Ljava/lang/String;");
+
+  bool haveLoc = false;
+  std::string buf;
+  llvm::raw_string_ostream oss(buf);
+  for (jsize i = 0; i < stackTraceLength; i++) {
+    // add the result of toString method of each element in the result
+    JLocal<jobject> curStackTraceElement(
+        env, env->GetObjectArrayElement(stackTrace, i));
+
+    // call to string on the object
+    JLocal<jstring> stackElementString(
+        env, static_cast<jstring>(
+                 env->CallObjectMethod(curStackTraceElement, toStringId)));
+
+    if (!stackElementString) return "";
+
+    // add a line to res
+    JStringRef elem(env, stackElementString);
+    oss << elem << '\n';
+
+    if (func) {
+      // func is caller of immediate caller (if there was one)
+      // or, if we see it, the first user function
+      if (i == 1) {
+        *func = elem.str();
+      } else if (i > 1 && !haveLoc && !excludeFuncPrefix.empty() &&
+                 !elem.str().startswith(excludeFuncPrefix)) {
+        *func = elem.str();
+        haveLoc = true;
+      }
+    }
+  }
+
+  return oss.str();
+}
+
+// Finds an exception class and keep it as a global reference.
+// Similar to JClass, but provides Throw methods.
+// Use with caution, as the destructor does NOT call DeleteGlobalRef due
+// to potential shutdown issues with doing so.
+class JException : public JClass {
+ public:
+  JException() = default;
+  JException(JNIEnv* env, const char* name) : JClass(env, name) {
+    if (m_cls)
+      m_constructor =
+          env->GetMethodID(m_cls, "<init>", "(Ljava/lang/String;)V");
+  }
+
+  void Throw(JNIEnv* env, jstring msg) {
+    jobject exception = env->NewObject(m_cls, m_constructor, msg);
+    env->Throw(static_cast<jthrowable>(exception));
+  }
+
+  void Throw(JNIEnv* env, llvm::StringRef msg) {
+    Throw(env, MakeJString(env, msg));
+  }
+
+  explicit operator bool() const { return m_constructor; }
+
+ private:
+  jmethodID m_constructor = nullptr;
+};
+
+}  // namespace java
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_JNI_UTIL_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/json.h b/third_party/wpiutil_2018/src/main/native/include/support/json.h
new file mode 100644
index 0000000..6e4b33d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/json.h
@@ -0,0 +1,7257 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#ifndef WPI_SUPPORT_JSON_H_
+#define WPI_SUPPORT_JSON_H_
+
+#include <cassert> // assert
+#include <cmath> // isfinite, labs, ldexp, signbit
+#include <cstddef> // nullptr_t, ptrdiff_t, size_t
+#include <cstdint> // int64_t, uint64_t
+#include <cstdlib> // abort, strtod, strtof, strtold, strtoul, strtoll, strtoull
+#include <cstring> // memcpy, strlen
+#include <functional> // function, hash, less
+#include <initializer_list> // initializer_list
+#include <iterator> // advance, begin, back_inserter, bidirectional_iterator_tag, distance, end, inserter, iterator, iterator_traits, next, random_access_iterator_tag
+#include <limits> // numeric_limits
+#include <memory> // addressof, allocator, allocator_traits, unique_ptr
+#include <string> // getline, stoi, string, to_string
+#include <type_traits> // add_pointer, conditional, decay, enable_if, false_type, integral_constant, is_arithmetic, is_base_of, is_const, is_constructible, is_convertible, is_default_constructible, is_enum, is_floating_point, is_integral, is_nothrow_move_assignable, is_nothrow_move_constructible, is_pointer, is_reference, is_same, is_scalar, is_signed, remove_const, remove_cv, remove_pointer, remove_reference, true_type, underlying_type
+#include <utility> // declval, forward, make_pair, move, pair, swap
+#include <vector> // vector
+
+#include "llvm/ArrayRef.h"
+#include "llvm/raw_ostream.h"
+#include "llvm/StringMap.h"
+#include "llvm/StringRef.h"
+
+// exclude unsupported compilers
+#if defined(__clang__)
+    #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400
+        #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers"
+    #endif
+#elif defined(__GNUC__)
+    #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800
+        #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
+    #endif
+#endif
+
+// disable float-equal warnings on GCC/clang
+#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
+    #pragma GCC diagnostic push
+    #pragma GCC diagnostic ignored "-Wfloat-equal"
+    #pragma GCC diagnostic ignored "-Wtype-limits"
+#endif
+
+// disable documentation warnings on clang
+#if defined(__clang__)
+    #pragma GCC diagnostic push
+    #pragma GCC diagnostic ignored "-Wdocumentation"
+    #pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
+#endif
+
+// allow to disable exceptions
+#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION)
+    #define JSON_THROW(exception) throw exception
+    #define JSON_TRY try
+    #define JSON_CATCH(exception) catch(exception)
+#else
+    #define JSON_THROW(exception) std::abort()
+    #define JSON_TRY if(true)
+    #define JSON_CATCH(exception) if(false)
+#endif
+
+// manual branch prediction
+#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
+    #define JSON_LIKELY(x)      __builtin_expect(!!(x), 1)
+    #define JSON_UNLIKELY(x)    __builtin_expect(!!(x), 0)
+#else
+    #define JSON_LIKELY(x)      x
+    #define JSON_UNLIKELY(x)    x
+#endif
+
+namespace wpi
+{
+
+class raw_istream;
+
+/*!
+@brief unnamed namespace with internal helper functions
+
+This namespace collects some functions that could not be defined inside the
+@ref json class.
+
+@since version 2.1.0
+*/
+namespace detail
+{
+////////////////
+// exceptions //
+////////////////
+
+/*!
+@brief general exception of the @ref json class
+
+Extension of std::exception objects with a member @a id for exception ids.
+
+@note To have nothrow-copy-constructible exceptions, we internally use
+      std::runtime_error which can cope with arbitrary-length error messages.
+      Intermediate strings are built with static functions and then passed to
+      the actual constructor.
+
+@since version 3.0.0
+*/
+class exception : public std::exception
+{
+  public:
+    /// returns the explanatory string
+    virtual const char* what() const noexcept override
+    {
+        return m.what();
+    }
+
+    /// the id of the exception
+    const int id;
+
+  protected:
+    exception(int id_, const char* what_arg)
+        : id(id_), m(what_arg)
+    {}
+
+    static std::string name(const std::string& ename, int id);
+
+  private:
+    /// an exception object as storage for error messages
+    std::runtime_error m;
+};
+
+/*!
+@brief exception indicating a parse error
+
+This excpetion is thrown by the library when a parse error occurs. Parse
+errors can occur during the deserialization of JSON text as well as when
+using JSON Patch.
+
+Member @a byte holds the byte index of the last read character in the input
+file.
+
+@note For an input with n bytes, 1 is the index of the first character
+      and n+1 is the index of the terminating null byte or the end of
+      file. This also holds true when reading a byte vector (CBOR or
+      MessagePack).
+
+Exceptions have ids 1xx.
+
+name / id                      | example massage | description
+------------------------------ | --------------- | -------------------------
+json.exception.parse_error.101 | parse error at 2: unexpected end of input; expected string literal | This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member @a byte indicates the error position.
+json.exception.parse_error.102 | parse error at 14: missing or wrong low surrogate | JSON uses the `\uxxxx` format to describe Unicode characters. Code points above above 0xFFFF are split into two `\uxxxx` entries ("surrogate pairs"). This error indicates that the surrogate pair is incomplete or contains an invalid code point.
+json.exception.parse_error.103 | parse error: code points above 0x10FFFF are invalid | Unicode supports code points up to 0x10FFFF. Code points above 0x10FFFF are invalid.
+json.exception.parse_error.104 | parse error: JSON patch must be an array of objects | [RFC 6902](https://tools.ietf.org/html/rfc6902) requires a JSON Patch document to be a JSON document that represents an array of objects.
+json.exception.parse_error.105 | parse error: operation must have string member 'op' | An operation of a JSON Patch document must contain exactly one "op" member, whose value indicates the operation to perform. Its value must be one of "add", "remove", "replace", "move", "copy", or "test"; other values are errors.
+json.exception.parse_error.106 | parse error: array index '01' must not begin with '0' | An array index in a JSON Pointer ([RFC 6901](https://tools.ietf.org/html/rfc6901)) may be `0` or any number wihtout a leading `0`.
+json.exception.parse_error.107 | parse error: JSON pointer must be empty or begin with '/' - was: 'foo' | A JSON Pointer must be a Unicode string containing a sequence of zero or more reference tokens, each prefixed by a `/` character.
+json.exception.parse_error.108 | parse error: escape character '~' must be followed with '0' or '1' | In a JSON Pointer, only `~0` and `~1` are valid escape sequences.
+json.exception.parse_error.109 | parse error: array index 'one' is not a number | A JSON Pointer array index must be a number.
+json.exception.parse_error.110 | parse error at 1: cannot read 2 bytes from vector | When parsing CBOR or MessagePack, the byte vector ends before the complete value has been read.
+json.exception.parse_error.111 | parse error: bad input stream | Parsing CBOR or MessagePack from an input stream where the [`badbit` or `failbit`](http://en.cppreference.com/w/cpp/io/ios_base/iostate) is set.
+json.exception.parse_error.112 | parse error at 1: error reading CBOR; last byte: 0xf8 | Not all types of CBOR or MessagePack are supported. This exception occurs if an unsupported byte was read.
+json.exception.parse_error.113 | parse error at 2: expected a CBOR string; last byte: 0x98 | While parsing a map key, a value that is not a string has been read.
+
+@since version 3.0.0
+*/
+class parse_error : public exception
+{
+  public:
+    /*!
+    @brief create a parse error exception
+    @param[in] id         the id of the exception
+    @param[in] byte_      the byte index where the error occured (or 0 if
+                          the position cannot be determined)
+    @param[in] what_arg   the explanatory string
+    @return parse_error object
+    */
+    static parse_error create(int id, size_t byte_, const std::string& what_arg);
+
+    /*!
+    @brief byte index of the parse error
+
+    The byte index of the last read character in the input file.
+
+    @note For an input with n bytes, 1 is the index of the first character
+          and n+1 is the index of the terminating null byte or the end of
+          file. This also holds true when reading a byte vector (CBOR or
+          MessagePack).
+    */
+    const size_t byte;
+
+  private:
+    parse_error(int id_, size_t byte_, const char* what_arg)
+        : exception(id_, what_arg), byte(byte_)
+    {}
+};
+
+/*!
+@brief exception indicating errors with iterators
+
+Exceptions have ids 2xx.
+
+name / id                           | example massage | description
+----------------------------------- | --------------- | -------------------------
+json.exception.invalid_iterator.201 | iterators are not compatible | The iterators passed to constructor @ref json(InputIT first, InputIT last) are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid.
+json.exception.invalid_iterator.202 | iterator does not fit current value | In an erase or insert function, the passed iterator @a pos does not belong to the JSON value for which the function was called. It hence does not define a valid position for the deletion/insertion.
+json.exception.invalid_iterator.203 | iterators do not fit current value | Either iterator passed to function @ref erase(IteratorType first, IteratorType last) does not belong to the JSON value from which values shall be erased. It hence does not define a valid range to delete values from.
+json.exception.invalid_iterator.204 | iterators out of range | When an iterator range for a primitive type (number, boolean, or string) is passed to a constructor or an erase function, this range has to be exactly (@ref begin(), @ref end()), because this is the only way the single stored value is expressed. All other ranges are invalid.
+json.exception.invalid_iterator.205 | iterator out of range | When an iterator for a primitive type (number, boolean, or string) is passed to an erase function, the iterator has to be the @ref begin() iterator, because it is the only way to address the stored value. All other iterators are invalid.
+json.exception.invalid_iterator.206 | cannot construct with iterators from null | The iterators passed to constructor @ref json(InputIT first, InputIT last) belong to a JSON null value and hence to not define a valid range.
+json.exception.invalid_iterator.207 | cannot use key() for non-object iterators | The key() member function can only be used on iterators belonging to a JSON object, because other types do not have a concept of a key.
+json.exception.invalid_iterator.208 | cannot use operator[] for object iterators | The operator[] to specify a concrete offset cannot be used on iterators belonging to a JSON object, because JSON objects are unordered.
+json.exception.invalid_iterator.209 | cannot use offsets with object iterators | The offset operators (+, -, +=, -=) cannot be used on iterators belonging to a JSON object, because JSON objects are unordered.
+json.exception.invalid_iterator.210 | iterators do not fit | The iterator range passed to the insert function are not compatible, meaning they do not belong to the same container. Therefore, the range (@a first, @a last) is invalid.
+json.exception.invalid_iterator.211 | passed iterators may not belong to container | The iterator range passed to the insert function must not be a subrange of the container to insert to.
+json.exception.invalid_iterator.212 | cannot compare iterators of different containers | When two iterators are compared, they must belong to the same container.
+json.exception.invalid_iterator.213 | cannot compare order of object iterators | The order of object iterators cannot be compated, because JSON objects are unordered.
+json.exception.invalid_iterator.214 | cannot get value | Cannot get value for iterator: Either the iterator belongs to a null value or it is an iterator to a primitive type (number, boolean, or string), but the iterator is different to @ref begin().
+
+@since version 3.0.0
+*/
+class invalid_iterator : public exception
+{
+  public:
+    static invalid_iterator create(int id, const std::string& what_arg);
+
+  private:
+    invalid_iterator(int id_, const char* what_arg)
+        : exception(id_, what_arg)
+    {}
+};
+
+/*!
+@brief exception indicating executing a member function with a wrong type
+
+Exceptions have ids 3xx.
+
+name / id                     | example message | description
+----------------------------- | --------------- | -------------------------
+json.exception.type_error.301 | cannot create object from initializer list | To create an object from an initializer list, the initializer list must consist only of a list of pairs whose first element is a string. When this constraint is violated, an array is created instead.
+json.exception.type_error.302 | type must be object, but is array | During implicit or explicit value conversion, the JSON type must be compatible to the target type. For instance, a JSON string can only be converted into string types, but not into numbers or boolean types.
+json.exception.type_error.303 | incompatible ReferenceType for get_ref, actual type is object | To retrieve a reference to a value stored in a @ref json object with @ref get_ref, the type of the reference must match the value type. For instance, for a JSON array, the @a ReferenceType must be @ref array_t&.
+json.exception.type_error.304 | cannot use at() with string | The @ref at() member functions can only be executed for certain JSON types.
+json.exception.type_error.305 | cannot use operator[] with string | The @ref operator[] member functions can only be executed for certain JSON types.
+json.exception.type_error.306 | cannot use value() with string | The @ref value() member functions can only be executed for certain JSON types.
+json.exception.type_error.307 | cannot use erase() with string | The @ref erase() member functions can only be executed for certain JSON types.
+json.exception.type_error.308 | cannot use push_back() with string | The @ref push_back() and @ref operator+= member functions can only be executed for certain JSON types.
+json.exception.type_error.309 | cannot use insert() with | The @ref insert() member functions can only be executed for certain JSON types.
+json.exception.type_error.310 | cannot use swap() with number | The @ref swap() member functions can only be executed for certain JSON types.
+json.exception.type_error.311 | cannot use emplace_back() with string | The @ref emplace_back() member function can only be executed for certain JSON types.
+json.exception.type_error.313 | invalid value to unflatten | The @ref unflatten function converts an object whose keys are JSON Pointers back into an arbitrary nested JSON value. The JSON Pointers must not overlap, because then the resulting value would not be well defined.
+json.exception.type_error.314 | only objects can be unflattened | The @ref unflatten function only works for an object whose keys are JSON Pointers.
+json.exception.type_error.315 | values in object must be primitive | The @ref unflatten function only works for an object whose keys are JSON Pointers and whose values are primitive.
+
+@since version 3.0.0
+*/
+class type_error : public exception
+{
+  public:
+    static type_error create(int id, const std::string& what_arg);
+
+  private:
+    type_error(int id_, const char* what_arg)
+        : exception(id_, what_arg)
+    {}
+};
+
+/*!
+@brief exception indicating access out of the defined range
+
+Exceptions have ids 4xx.
+
+name / id                       | example message | description
+------------------------------- | --------------- | -------------------------
+json.exception.out_of_range.401 | array index 3 is out of range | The provided array index @a i is larger than @a size-1.
+json.exception.out_of_range.402 | array index '-' (3) is out of range | The special array index `-` in a JSON Pointer never describes a valid element of the array, but the index past the end. That is, it can only be used to add elements at this position, but not to read it.
+json.exception.out_of_range.403 | key 'foo' not found | The provided key was not found in the JSON object.
+json.exception.out_of_range.404 | unresolved reference token 'foo' | A reference token in a JSON Pointer could not be resolved.
+json.exception.out_of_range.405 | JSON pointer has no parent | The JSON Patch operations 'remove' and 'add' can not be applied to the root element of the JSON value.
+json.exception.out_of_range.406 | number overflow parsing '10E1000' | A parsed number could not be stored as without changing it to NaN or INF.
+
+@since version 3.0.0
+*/
+class out_of_range : public exception
+{
+  public:
+    static out_of_range create(int id, const std::string& what_arg);
+
+  private:
+    out_of_range(int id_, const char* what_arg)
+        : exception(id_, what_arg)
+    {}
+};
+
+/*!
+@brief exception indicating other errors
+
+Exceptions have ids 5xx.
+
+name / id                      | example message | description
+------------------------------ | --------------- | -------------------------
+json.exception.other_error.501 | unsuccessful: {"op":"test","path":"/baz", "value":"bar"} | A JSON Patch operation 'test' failed. The unsuccessful operation is also printed.
+json.exception.other_error.502 | invalid object size for conversion | Some conversions to user-defined types impose constraints on the object size (e.g. std::pair)
+
+@since version 3.0.0
+*/
+class other_error : public exception
+{
+  public:
+    static other_error create(int id, const std::string& what_arg);
+
+  private:
+    other_error(int id_, const char* what_arg)
+        : exception(id_, what_arg)
+    {}
+};
+
+
+
+///////////////////////////
+// JSON type enumeration //
+///////////////////////////
+
+/*!
+@brief the JSON type enumeration
+
+This enumeration collects the different JSON types. It is internally used to
+distinguish the stored values, and the functions @ref json::is_null(),
+@ref json::is_object(), @ref json::is_array(),
+@ref json::is_string(), @ref json::is_boolean(),
+@ref json::is_number() (with @ref json::is_number_integer(),
+@ref json::is_number_unsigned(), and @ref json::is_number_float()),
+@ref json::is_discarded(), @ref json::is_primitive(), and
+@ref json::is_structured() rely on it.
+
+@note There are three enumeration entries (number_integer, number_unsigned, and
+number_float), because the library distinguishes these three types for numbers:
+std::uint64_t is used for unsigned integers,
+std::int64_t is used for signed integers, and
+double is used for floating-point numbers or to
+approximate integers which do not fit in the limits of their respective type.
+
+@sa @ref json::json(const value_t value_type) -- create a JSON
+value with the default value for a given type
+
+@since version 1.0.0
+*/
+enum class value_t : uint8_t
+{
+    null,            ///< null value
+    object,          ///< object (unordered set of name/value pairs)
+    array,           ///< array (ordered collection of values)
+    string,          ///< string value
+    boolean,         ///< boolean value
+    number_integer,  ///< number value (signed integer)
+    number_unsigned, ///< number value (unsigned integer)
+    number_float,    ///< number value (floating-point)
+    discarded        ///< discarded by the the parser callback function
+};
+
+/*!
+@brief comparison operator for JSON types
+
+Returns an ordering that is similar to Python:
+- order: null < boolean < number < object < array < string
+- furthermore, each type is not smaller than itself
+
+@since version 1.0.0
+*/
+inline bool operator<(const value_t lhs, const value_t rhs) noexcept
+{
+    static constexpr uint8_t order[] = {
+        0, // null
+        3, // object
+        4, // array
+        5, // string
+        1, // boolean
+        2, // integer
+        2, // unsigned
+        2, // float
+    };
+
+    // discarded values are not comparable
+    if (lhs == value_t::discarded || rhs == value_t::discarded)
+    {
+        return false;
+    }
+
+    return order[static_cast<std::size_t>(lhs)] <
+           order[static_cast<std::size_t>(rhs)];
+}
+
+
+/////////////
+// helpers //
+/////////////
+
+// alias templates to reduce boilerplate
+template<bool B, typename T = void>
+using enable_if_t = typename std::enable_if<B, T>::type;
+
+template<typename T>
+using uncvref_t = typename std::remove_cv<typename std::remove_reference<T>::type>::type;
+
+/*
+Implementation of two C++17 constructs: conjunction, negation. This is needed
+to avoid evaluating all the traits in a condition
+
+For example: !std::is_same<void, T>::value && has_value_type<T>::value
+will not compile when T = void (on MSVC at least). Whereas
+conjunction<negation<std::is_same<void, T>>, has_value_type<T>>::value will
+stop evaluating if negation<...>::value == false
+
+Please note that those constructs must be used with caution, since symbols can
+become very long quickly (which can slow down compilation and cause MSVC
+internal compiler errors). Only use it when you have to (see example ahead).
+*/
+template<class...> struct conjunction : std::true_type {};
+template<class B1> struct conjunction<B1> : B1 {};
+template<class B1, class... Bn>
+struct conjunction<B1, Bn...> : std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
+
+template<class B> struct negation : std::integral_constant < bool, !B::value > {};
+
+// dispatch utility (taken from ranges-v3)
+template<unsigned N> struct priority_tag : priority_tag < N - 1 > {};
+template<> struct priority_tag<0> {};
+
+
+//////////////////
+// constructors //
+//////////////////
+
+template<value_t> struct external_constructor;
+
+template<>
+struct external_constructor<value_t::boolean>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, bool b) noexcept
+    {
+        j.m_type = value_t::boolean;
+        j.m_value = b;
+        j.assert_invariant();
+    }
+};
+
+template<>
+struct external_constructor<value_t::string>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, llvm::StringRef s)
+    {
+        j.m_type = value_t::string;
+        j.m_value = s;
+        j.assert_invariant();
+    }
+};
+
+template<>
+struct external_constructor<value_t::number_float>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, double val) noexcept
+    {
+        j.m_type = value_t::number_float;
+        j.m_value = val;
+        j.assert_invariant();
+    }
+};
+
+template<>
+struct external_constructor<value_t::number_unsigned>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, std::uint64_t val) noexcept
+    {
+        j.m_type = value_t::number_unsigned;
+        j.m_value = val;
+        j.assert_invariant();
+    }
+};
+
+template<>
+struct external_constructor<value_t::number_integer>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, std::int64_t val) noexcept
+    {
+        j.m_type = value_t::number_integer;
+        j.m_value = val;
+        j.assert_invariant();
+    }
+};
+
+template<>
+struct external_constructor<value_t::array>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, const typename BasicJsonType::array_t& arr)
+    {
+        j.m_type = value_t::array;
+        j.m_value = arr;
+        j.assert_invariant();
+    }
+
+    template<typename BasicJsonType, typename T>
+    static void construct(BasicJsonType& j, llvm::ArrayRef<T> arr)
+    {
+        using std::begin;
+        using std::end;
+        j.m_type = value_t::array;
+        j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr));
+        j.assert_invariant();
+    }
+
+    template<typename BasicJsonType, typename CompatibleArrayType,
+             enable_if_t<!std::is_same<CompatibleArrayType,
+                                       typename BasicJsonType::array_t>::value,
+                         int> = 0>
+    static void construct(BasicJsonType& j, const CompatibleArrayType& arr)
+    {
+        using std::begin;
+        using std::end;
+        j.m_type = value_t::array;
+        j.m_value.array = j.template create<typename BasicJsonType::array_t>(begin(arr), end(arr));
+        j.assert_invariant();
+    }
+
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, const std::vector<bool>& arr)
+    {
+        j.m_type = value_t::array;
+        j.m_value = value_t::array;
+        j.m_value.array->reserve(arr.size());
+        for (bool x : arr)
+        {
+            j.m_value.array->push_back(x);
+        }
+        j.assert_invariant();
+    }
+};
+
+template<>
+struct external_constructor<value_t::object>
+{
+    template<typename BasicJsonType>
+    static void construct(BasicJsonType& j, const typename BasicJsonType::object_t& obj)
+    {
+        j.m_type = value_t::object;
+        j.m_value = obj;
+        j.assert_invariant();
+    }
+
+    template<typename BasicJsonType, typename CompatibleObjectType,
+             enable_if_t<!std::is_same<CompatibleObjectType,
+                                       typename BasicJsonType::object_t>::value,
+                         int> = 0>
+    static void construct(BasicJsonType& j, const CompatibleObjectType& obj)
+    {
+        j.m_type = value_t::object;
+        j.m_value = value_t::object;
+        for (const auto& x : obj)
+        {
+            j.m_value.object->emplace_second(x.first, x.second);
+        }
+        j.assert_invariant();
+    }
+};
+
+
+////////////////////////
+// has_/is_ functions //
+////////////////////////
+
+/*!
+@brief Helper to determine whether there's a key_type for T.
+
+This helper is used to tell associative containers apart from other containers
+such as sequence containers. For instance, `std::map` passes the test as it
+contains a `mapped_type`, whereas `std::vector` fails the test.
+
+@sa http://stackoverflow.com/a/7728728/266378
+@since version 1.0.0, overworked in version 2.0.6
+*/
+#define WPI_JSON_HAS_HELPER(type)                                             \
+    template<typename T> struct has_##type {                                  \
+    private:                                                                  \
+        template<typename U, typename = typename U::type>                     \
+        static int detect(U &&);                                              \
+        static void detect(...);                                              \
+    public:                                                                   \
+        static constexpr bool value =                                         \
+                std::is_integral<decltype(detect(std::declval<T>()))>::value; \
+    }
+
+WPI_JSON_HAS_HELPER(mapped_type);
+WPI_JSON_HAS_HELPER(key_type);
+WPI_JSON_HAS_HELPER(value_type);
+WPI_JSON_HAS_HELPER(iterator);
+
+#undef WPI_JSON_HAS_HELPER
+
+
+template<bool B, class RealType, class CompatibleObjectType>
+struct is_compatible_object_type_impl : std::false_type {};
+
+template<class RealType, class CompatibleObjectType>
+struct is_compatible_object_type_impl<true, RealType, CompatibleObjectType>
+{
+    static constexpr auto value =
+        std::is_constructible<llvm::StringRef,
+        typename CompatibleObjectType::key_type>::value &&
+        std::is_constructible<typename RealType::mapped_type,
+        typename CompatibleObjectType::mapped_type>::value;
+};
+
+template<typename BasicJsonType, class CompatibleObjectType>
+struct is_compatible_object_type
+{
+    static auto constexpr value = is_compatible_object_type_impl <
+                                  conjunction<negation<std::is_same<void, CompatibleObjectType>>,
+                                  has_mapped_type<CompatibleObjectType>,
+                                  has_key_type<CompatibleObjectType>>::value,
+                                  typename BasicJsonType::object_t, CompatibleObjectType >::value;
+};
+
+template<typename BasicJsonType, typename T>
+struct is_json_nested_type
+{
+    static auto constexpr value = std::is_same<T, typename BasicJsonType::iterator>::value ||
+                                  std::is_same<T, typename BasicJsonType::const_iterator>::value ||
+                                  std::is_same<T, typename BasicJsonType::json_pointer>::value;
+};
+
+template<typename BasicJsonType, class CompatibleArrayType>
+struct is_compatible_array_type
+{
+    static auto constexpr value =
+        conjunction<negation<std::is_same<void, CompatibleArrayType>>,
+        negation<is_compatible_object_type<BasicJsonType, CompatibleArrayType>>,
+        negation<std::is_constructible<llvm::StringRef, CompatibleArrayType>>,
+        negation<is_json_nested_type<BasicJsonType, CompatibleArrayType>>,
+        has_value_type<CompatibleArrayType>,
+        has_iterator<CompatibleArrayType>>::value;
+};
+
+template<bool, typename, typename>
+struct is_compatible_integer_type_impl : std::false_type {};
+
+template<typename RealIntegerType, typename CompatibleNumberIntegerType>
+struct is_compatible_integer_type_impl<true, RealIntegerType, CompatibleNumberIntegerType>
+{
+    // is there an assert somewhere on overflows?
+    using RealLimits = std::numeric_limits<RealIntegerType>;
+    using CompatibleLimits = std::numeric_limits<CompatibleNumberIntegerType>;
+
+    static constexpr auto value =
+        std::is_constructible<RealIntegerType,
+        CompatibleNumberIntegerType>::value &&
+        CompatibleLimits::is_integer &&
+        RealLimits::is_signed == CompatibleLimits::is_signed;
+};
+
+template<typename RealIntegerType, typename CompatibleNumberIntegerType>
+struct is_compatible_integer_type
+{
+    static constexpr auto value =
+        is_compatible_integer_type_impl <
+        std::is_integral<CompatibleNumberIntegerType>::value &&
+        !std::is_same<bool, CompatibleNumberIntegerType>::value,
+        RealIntegerType, CompatibleNumberIntegerType > ::value;
+};
+
+/////////////
+// to_json //
+/////////////
+
+template<typename BasicJsonType, typename T, enable_if_t<
+             std::is_same<T, bool>::value, int> = 0>
+inline
+void to_json(BasicJsonType& j, T b) noexcept
+{
+    detail::external_constructor<value_t::boolean>::construct(j, b);
+}
+
+template<typename BasicJsonType, typename CompatibleString,
+         enable_if_t<std::is_constructible<llvm::StringRef,
+                     CompatibleString>::value, int> = 0>
+inline
+void to_json(BasicJsonType& j, const CompatibleString& s)
+{
+    external_constructor<value_t::string>::construct(j, s);
+}
+
+template<typename BasicJsonType, typename FloatType,
+         enable_if_t<std::is_floating_point<FloatType>::value, int> = 0>
+inline
+void to_json(BasicJsonType& j, FloatType val) noexcept
+{
+    external_constructor<value_t::number_float>::construct(j, static_cast<double>(val));
+}
+
+template <
+    typename BasicJsonType, typename CompatibleNumberUnsignedType,
+    enable_if_t<is_compatible_integer_type<std::uint64_t,
+                CompatibleNumberUnsignedType>::value, int> = 0 >
+inline
+void to_json(BasicJsonType& j, CompatibleNumberUnsignedType val) noexcept
+{
+    external_constructor<value_t::number_unsigned>::construct(j, static_cast<std::uint64_t>(val));
+}
+
+template <
+    typename BasicJsonType, typename CompatibleNumberIntegerType,
+    enable_if_t<is_compatible_integer_type<std::int64_t,
+                CompatibleNumberIntegerType>::value, int> = 0 >
+inline
+void to_json(BasicJsonType& j, CompatibleNumberIntegerType val) noexcept
+{
+    external_constructor<value_t::number_integer>::construct(j, static_cast<std::int64_t>(val));
+}
+
+template<typename BasicJsonType, typename EnumType,
+         enable_if_t<std::is_enum<EnumType>::value, int> = 0>
+inline
+void to_json(BasicJsonType& j, EnumType e) noexcept
+{
+    using underlying_type = typename std::underlying_type<EnumType>::type;
+    external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
+}
+
+template<typename BasicJsonType>
+inline
+void to_json(BasicJsonType& j, const std::vector<bool>& e)
+{
+    external_constructor<value_t::array>::construct(j, e);
+}
+
+template<typename BasicJsonType, typename T>
+inline
+void to_json(BasicJsonType& j, llvm::ArrayRef<T> arr)
+{
+    external_constructor<value_t::array>::construct(j, arr);
+}
+
+template <
+    typename BasicJsonType, typename CompatibleArrayType,
+    enable_if_t <
+        is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value ||
+        std::is_same<typename BasicJsonType::array_t, CompatibleArrayType>::value,
+        int > = 0 >
+inline
+void to_json(BasicJsonType& j, const  CompatibleArrayType& arr)
+{
+    external_constructor<value_t::array>::construct(j, arr);
+}
+
+template <
+    typename BasicJsonType, typename CompatibleObjectType,
+    enable_if_t<is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value,
+                int> = 0 >
+inline
+void to_json(BasicJsonType& j, const  CompatibleObjectType& arr)
+{
+    external_constructor<value_t::object>::construct(j, arr);
+}
+
+template <typename BasicJsonType, typename T, std::size_t N,
+          enable_if_t<!std::is_constructible<
+                          llvm::StringRef, T (&)[N]>::value,
+                      int> = 0>
+inline
+void to_json(BasicJsonType& j, T (&arr)[N])
+{
+    external_constructor<value_t::array>::construct(j, arr);
+}
+
+template <typename BasicJsonType, typename CompatibleString, typename T,
+          enable_if_t<std::is_constructible<llvm::StringRef,
+                      CompatibleString>::value, int> = 0>
+inline
+void to_json(BasicJsonType& j, std::pair<CompatibleString, T> const& p)
+{
+    j[p.first] = p.second;
+}
+
+///////////////
+// from_json //
+///////////////
+
+// overloads for json template parameters
+template<typename BasicJsonType, typename ArithmeticType,
+         enable_if_t<std::is_arithmetic<ArithmeticType>::value &&
+                     !std::is_same<ArithmeticType, bool>::value,
+                     int> = 0>
+void get_arithmetic_value(const BasicJsonType& j, ArithmeticType& val)
+{
+    switch (static_cast<value_t>(j))
+    {
+        case value_t::number_unsigned:
+        {
+            val = static_cast<ArithmeticType>(
+                      *j.template get_ptr<const std::uint64_t*>());
+            break;
+        }
+        case value_t::number_integer:
+        {
+            val = static_cast<ArithmeticType>(
+                      *j.template get_ptr<const std::int64_t*>());
+            break;
+        }
+        case value_t::number_float:
+        {
+            val = static_cast<ArithmeticType>(
+                      *j.template get_ptr<const double*>());
+            break;
+        }
+        default:
+        {
+            JSON_THROW(type_error::create(302, "type must be number, but is " + j.type_name()));
+        }
+    }
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, bool& b)
+{
+    if (!j.is_boolean())
+    {
+        JSON_THROW(type_error::create(302, "type must be boolean, but is " + j.type_name()));
+    }
+    b = *j.template get_ptr<const bool*>();
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, std::string& s)
+{
+    if (!j.is_string())
+    {
+        JSON_THROW(detail::type_error::create(302, "type must be string, but is " + j.type_name()));
+    }
+    s = *j.template get_ptr<const std::string*>();
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, double& val)
+{
+    get_arithmetic_value(j, val);
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, std::uint64_t& val)
+{
+    get_arithmetic_value(j, val);
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, std::int64_t& val)
+{
+    get_arithmetic_value(j, val);
+}
+
+template<typename BasicJsonType, typename EnumType,
+         enable_if_t<std::is_enum<EnumType>::value, int> = 0>
+inline
+void from_json(const BasicJsonType& j, EnumType& e)
+{
+    typename std::underlying_type<EnumType>::type val;
+    get_arithmetic_value(j, val);
+    e = static_cast<EnumType>(val);
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, typename BasicJsonType::array_t& arr)
+{
+    if (!j.is_array())
+    {
+        JSON_THROW(type_error::create(302, "type must be array, but is " + j.type_name()));
+    }
+    arr = *j.template get_ptr<const typename BasicJsonType::array_t*>();
+}
+
+template<typename BasicJsonType, typename CompatibleArrayType>
+void from_json_array_impl(const BasicJsonType& j, CompatibleArrayType& arr, detail::priority_tag<0>)
+{
+    using std::begin;
+    using std::end;
+
+    std::transform(j.begin(), j.end(),
+                   std::inserter(arr, end(arr)), [](const BasicJsonType & i)
+    {
+        // get<BasicJsonType>() returns *this, this won't call a from_json
+        // method when value_type is BasicJsonType
+        return i.template get<typename CompatibleArrayType::value_type>();
+    });
+}
+
+template<typename BasicJsonType, typename CompatibleArrayType>
+auto from_json_array_impl(const BasicJsonType& j, CompatibleArrayType& arr, detail::priority_tag<1>)
+-> decltype(
+    arr.reserve(std::declval<typename CompatibleArrayType::size_type>()),
+    void())
+{
+    using std::begin;
+    using std::end;
+
+    arr.reserve(j.size());
+    std::transform(j.begin(), j.end(),
+                   std::inserter(arr, end(arr)), [](const BasicJsonType & i)
+    {
+        // get<BasicJsonType>() returns *this, this won't call a from_json
+        // method when value_type is BasicJsonType
+        return i.template get<typename CompatibleArrayType::value_type>();
+    });
+}
+
+template<typename BasicJsonType, typename CompatibleArrayType,
+         enable_if_t<is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value &&
+                     std::is_convertible<BasicJsonType, typename CompatibleArrayType::value_type>::value &&
+                     !std::is_same<typename BasicJsonType::array_t, CompatibleArrayType>::value, int> = 0>
+void from_json(const BasicJsonType& j, CompatibleArrayType& arr)
+{
+    if (!j.is_array())
+    {
+        JSON_THROW(type_error::create(302, "type must be array, but is " + j.type_name()));
+    }
+
+    from_json_array_impl(j, arr, priority_tag<1> {});
+}
+
+template<typename BasicJsonType>
+inline
+void from_json(const BasicJsonType& j, typename BasicJsonType::object_t& obj)
+{
+    if (!j.is_object())
+    {
+        JSON_THROW(type_error::create(302, "type must be object, but is " + j.type_name()));
+    }
+
+    auto inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
+    for (const auto& i : *inner_object) {
+        obj.emplace_second(i.first(), i.second);
+    }
+}
+
+template<typename BasicJsonType, typename CompatibleObjectType,
+         enable_if_t<is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value &&
+                     !std::is_same<typename BasicJsonType::object_t, CompatibleObjectType>::value, int> = 0>
+void from_json(const BasicJsonType& j, CompatibleObjectType& obj)
+{
+    if (!j.is_object())
+    {
+        JSON_THROW(type_error::create(302, "type must be object, but is " + j.type_name()));
+    }
+
+    auto inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
+    using std::begin;
+    using std::end;
+    using value_type = typename CompatibleObjectType::value_type;
+    std::vector<value_type> v;
+    v.reserve(j.size());
+    for (const auto& p : *inner_object)
+    {
+        v.emplace_back(
+            p.first(),
+            p.second
+            .template get<typename CompatibleObjectType::mapped_type>());
+    }
+    // we could avoid the assignment, but this might require a for loop, which
+    // might be less efficient than the container constructor for some
+    // containers (would it?)
+    obj = CompatibleObjectType(std::make_move_iterator(begin(v)),
+                               std::make_move_iterator(end(v)));
+}
+
+// overload for arithmetic types, not chosen for json template arguments;
+template<typename BasicJsonType, typename ArithmeticType,
+         enable_if_t <
+             std::is_arithmetic<ArithmeticType>::value &&
+             !std::is_same<ArithmeticType, std::uint64_t>::value &&
+             !std::is_same<ArithmeticType, std::int64_t>::value &&
+             !std::is_same<ArithmeticType, double>::value &&
+             !std::is_same<ArithmeticType, bool>::value,
+             int> = 0>
+void from_json(const BasicJsonType& j, ArithmeticType& val)
+{
+    switch (static_cast<value_t>(j))
+    {
+        case value_t::number_unsigned:
+        {
+            val = static_cast<ArithmeticType>(*j.template get_ptr<const std::uint64_t*>());
+            break;
+        }
+        case value_t::number_integer:
+        {
+            val = static_cast<ArithmeticType>(*j.template get_ptr<const std::int64_t*>());
+            break;
+        }
+        case value_t::number_float:
+        {
+            val = static_cast<ArithmeticType>(*j.template get_ptr<const double*>());
+            break;
+        }
+        case value_t::boolean:
+        {
+            val = static_cast<ArithmeticType>(*j.template get_ptr<const bool*>());
+            break;
+        }
+        default:
+        {
+            JSON_THROW(type_error::create(302, "type must be number, but is " + j.type_name()));
+        }
+    }
+}
+
+template <typename BasicJsonType, typename CompatibleString, typename T,
+          enable_if_t<std::is_constructible<llvm::StringRef,
+                      CompatibleString>::value, int> = 0>
+void from_json(const BasicJsonType& j, std::pair<CompatibleString, T>& p)
+{
+    if (!j.is_object())
+    {
+        JSON_THROW(type_error::create(302, "type must be object, but is " + j.type_name()));
+    }
+
+    auto const inner_object = j.template get_ptr<const typename BasicJsonType::object_t*>();
+    auto const size = inner_object->size();
+    if (size != 1)
+    {
+        JSON_THROW(other_error::create(502, "conversion to std::pair requires the object to have exactly one field, but it has " + std::to_string(size)));
+    }
+    auto const& obj = *inner_object->begin();
+    // cannot use *inner_object, need to convert both members
+    p = std::make_pair(CompatibleString(obj.first()), obj.second.template get<T>());
+}
+
+struct to_json_fn
+{
+  private:
+    template<typename BasicJsonType, typename T>
+    auto call(BasicJsonType& j, T&& val, priority_tag<1>) const noexcept(noexcept(to_json(j, std::forward<T>(val))))
+    -> decltype(to_json(j, std::forward<T>(val)), void())
+    {
+        return to_json(j, std::forward<T>(val));
+    }
+
+    template<typename BasicJsonType, typename T>
+    void call(BasicJsonType&, T&&, priority_tag<0>) const noexcept
+    {
+        static_assert(sizeof(BasicJsonType) == 0,
+                      "could not find to_json() method in T's namespace");
+    }
+
+  public:
+    template<typename BasicJsonType, typename T>
+    void operator()(BasicJsonType& j, T&& val) const
+    noexcept(noexcept(std::declval<to_json_fn>().call(j, std::forward<T>(val), priority_tag<1> {})))
+    {
+        return call(j, std::forward<T>(val), priority_tag<1> {});
+    }
+};
+
+struct from_json_fn
+{
+  private:
+    template<typename BasicJsonType, typename T>
+    auto call(const BasicJsonType& j, T& val, priority_tag<1>) const
+    noexcept(noexcept(from_json(j, val)))
+    -> decltype(from_json(j, val), void())
+    {
+        return from_json(j, val);
+    }
+
+    template<typename BasicJsonType, typename T>
+    void call(const BasicJsonType&, T&, priority_tag<0>) const noexcept
+    {
+        static_assert(sizeof(BasicJsonType) == 0,
+                      "could not find from_json() method in T's namespace");
+    }
+
+  public:
+    template<typename BasicJsonType, typename T>
+    void operator()(const BasicJsonType& j, T& val) const
+    noexcept(noexcept(std::declval<from_json_fn>().call(j, val, priority_tag<1> {})))
+    {
+        return call(j, val, priority_tag<1> {});
+    }
+};
+
+// taken from ranges-v3
+template<typename T>
+struct static_const
+{
+    static constexpr T value{};
+};
+
+template<typename T>
+constexpr T static_const<T>::value;
+} // namespace detail
+
+
+/// namespace to hold default `to_json` / `from_json` functions
+namespace
+{
+constexpr const auto& to_json = detail::static_const<detail::to_json_fn>::value;
+constexpr const auto& from_json = detail::static_const<detail::from_json_fn>::value;
+}
+
+/*!
+@brief a class to store JSON values
+
+@requirement The class satisfies the following concept requirements:
+- Basic
+ - [DefaultConstructible](http://en.cppreference.com/w/cpp/concept/DefaultConstructible):
+   JSON values can be default constructed. The result will be a JSON null
+   value.
+ - [MoveConstructible](http://en.cppreference.com/w/cpp/concept/MoveConstructible):
+   A JSON value can be constructed from an rvalue argument.
+ - [CopyConstructible](http://en.cppreference.com/w/cpp/concept/CopyConstructible):
+   A JSON value can be copy-constructed from an lvalue expression.
+ - [MoveAssignable](http://en.cppreference.com/w/cpp/concept/MoveAssignable):
+   A JSON value van be assigned from an rvalue argument.
+ - [CopyAssignable](http://en.cppreference.com/w/cpp/concept/CopyAssignable):
+   A JSON value can be copy-assigned from an lvalue expression.
+ - [Destructible](http://en.cppreference.com/w/cpp/concept/Destructible):
+   JSON values can be destructed.
+- Layout
+ - [StandardLayoutType](http://en.cppreference.com/w/cpp/concept/StandardLayoutType):
+   JSON values have
+   [standard layout](http://en.cppreference.com/w/cpp/language/data_members#Standard_layout):
+   All non-static data members are private and standard layout types, the
+   class has no virtual functions or (virtual) base classes.
+- Library-wide
+ - [EqualityComparable](http://en.cppreference.com/w/cpp/concept/EqualityComparable):
+   JSON values can be compared with `==`, see @ref
+   operator==(const_reference,const_reference).
+ - [LessThanComparable](http://en.cppreference.com/w/cpp/concept/LessThanComparable):
+   JSON values can be compared with `<`, see @ref
+   operator<(const_reference,const_reference).
+ - [Swappable](http://en.cppreference.com/w/cpp/concept/Swappable):
+   Any JSON lvalue or rvalue of can be swapped with any lvalue or rvalue of
+   other compatible types, using unqualified function call @ref swap().
+ - [NullablePointer](http://en.cppreference.com/w/cpp/concept/NullablePointer):
+   JSON values can be compared against `std::nullptr_t` objects which are used
+   to model the `null` value.
+- Container
+ - [Container](http://en.cppreference.com/w/cpp/concept/Container):
+   JSON values can be used like STL containers and provide iterator access.
+ - [ReversibleContainer](http://en.cppreference.com/w/cpp/concept/ReversibleContainer);
+   JSON values can be used like STL containers and provide reverse iterator
+   access.
+
+@invariant The member variables @a m_value and @a m_type have the following
+relationship:
+- If `m_type == value_t::object`, then `m_value.object != nullptr`.
+- If `m_type == value_t::array`, then `m_value.array != nullptr`.
+- If `m_type == value_t::string`, then `m_value.string != nullptr`.
+The invariants are checked by member function assert_invariant().
+
+@see [RFC 7159: The JavaScript Object Notation (JSON) Data Interchange
+Format](http://rfc7159.net/rfc7159)
+
+@since version 1.0.0
+
+@nosubgrouping
+*/
+class json
+{
+  private:
+    template<detail::value_t> friend struct detail::external_constructor;
+    friend class JsonTest;
+
+  public:
+    using value_t = detail::value_t;
+    // forward declarations
+    template<typename U> class iter_impl;
+    class json_pointer;
+
+    class parser;
+    class serializer;
+    class binary_writer;
+
+    ////////////////
+    // exceptions //
+    ////////////////
+
+    /// @name exceptions
+    /// Classes to implement user-defined exceptions.
+    /// @{
+
+    /// @copydoc detail::exception
+    using exception = detail::exception;
+    /// @copydoc detail::parse_error
+    using parse_error = detail::parse_error;
+    /// @copydoc detail::invalid_iterator
+    using invalid_iterator = detail::invalid_iterator;
+    /// @copydoc detail::type_error
+    using type_error = detail::type_error;
+    /// @copydoc detail::out_of_range
+    using out_of_range = detail::out_of_range;
+    /// @copydoc detail::other_error
+    using other_error = detail::other_error;
+
+    /// @}
+
+
+    /////////////////////
+    // container types //
+    /////////////////////
+
+    /// @name container types
+    /// The canonic container types to use @ref json like any other STL
+    /// container.
+    /// @{
+
+    /// the type of elements in a json container
+    using value_type = json;
+
+    /// the type of an element reference
+    using reference = value_type&;
+    /// the type of an element const reference
+    using const_reference = const value_type&;
+
+    /// a type to represent differences between iterators
+    using difference_type = std::ptrdiff_t;
+    /// a type to represent container sizes
+    using size_type = std::size_t;
+
+    /// the type of an element pointer
+    using pointer = json*;
+    /// the type of an element const pointer
+    using const_pointer = const json*;
+
+    /// an iterator for a json container
+    using iterator = iter_impl<json>;
+    /// a const iterator for a json container
+    using const_iterator = iter_impl<const json>;
+
+    /// @}
+
+    /*!
+    @brief returns version information on the library
+
+    This function returns a JSON object with information about the library,
+    including the version number and information on the platform and compiler.
+
+    @return JSON object holding version information
+    key         | description
+    ----------- | ---------------
+    `compiler`  | Information on the used compiler. It is an object with the following keys: `c++` (the used C++ standard), `family` (the compiler family; possible values are `clang`, `icc`, `gcc`, `ilecpp`, `msvc`, `pgcpp`, `sunpro`, and `unknown`), and `version` (the compiler version).
+    `copyright` | The copyright line for the library as string.
+    `name`      | The name of the library as string.
+    `platform`  | The used platform as string. Possible values are `win32`, `linux`, `apple`, `unix`, and `unknown`.
+    `url`       | The URL of the project as string.
+    `version`   | The version of the library. It is an object with the following keys: `major`, `minor`, and `patch` as defined by [Semantic Versioning](http://semver.org), and `string` (the version string).
+
+    @liveexample{The following code shows an example output of the `meta()`
+    function.,meta}
+
+    @complexity Constant.
+
+    @since 2.1.0
+    */
+    static json meta();
+
+    ///////////////////////////
+    // JSON value data types //
+    ///////////////////////////
+
+    /// @name JSON value data types
+    /// The data types to store a JSON value. These types are derived from
+    /// the template arguments passed to class @ref json.
+    /// @{
+
+    /*!
+    @brief a type for an object
+
+    [RFC 7159](http://rfc7159.net/rfc7159) describes JSON objects as follows:
+    > An object is an unordered collection of zero or more name/value pairs,
+    > where a name is a string and a value is a string, number, boolean, null,
+    > object, or array.
+
+    #### Behavior
+
+    The choice of @a object_t influences the behavior of the JSON class. With
+    the default type, objects have the following behavior:
+
+    - When all names are unique, objects will be interoperable in the sense
+      that all software implementations receiving that object will agree on
+      the name-value mappings.
+    - When the names within an object are not unique, later stored name/value
+      pairs overwrite previously stored name/value pairs, leaving the used
+      names unique. For instance, `{"key": 1}` and `{"key": 2, "key": 1}` will
+      be treated as equal and both stored as `{"key": 1}`.
+    - Internally, name/value pairs are stored in lexicographical order of the
+      names. Objects will also be serialized (see @ref dump) in this order.
+      For instance, `{"b": 1, "a": 2}` and `{"a": 2, "b": 1}` will be stored
+      and serialized as `{"a": 2, "b": 1}`.
+    - When comparing objects, the order of the name/value pairs is irrelevant.
+      This makes objects interoperable in the sense that they will not be
+      affected by these differences. For instance, `{"b": 1, "a": 2}` and
+      `{"a": 2, "b": 1}` will be treated as equal.
+
+    #### Limits
+
+    [RFC 7159](http://rfc7159.net/rfc7159) specifies:
+    > An implementation may set limits on the maximum depth of nesting.
+
+    In this class, the object's limit of nesting is not constraint explicitly.
+    However, a maximum depth of nesting may be introduced by the compiler or
+    runtime environment. A theoretical limit can be queried by calling the
+    @ref max_size function of a JSON object.
+
+    #### Storage
+
+    Objects are stored as pointers in a @ref json type. That is, for any
+    access to object values, a pointer of type `object_t*` must be
+    dereferenced.
+
+    @sa @ref array_t -- type for an array value
+
+    @since version 1.0.0
+
+    @note The order name/value pairs are added to the object is *not*
+    preserved by the library. Therefore, iterating an object may return
+    name/value pairs in a different order than they were originally stored. In
+    fact, keys will be traversed in alphabetical order as `std::map` with
+    `std::less` is used by default. Please note this behavior conforms to [RFC
+    7159](http://rfc7159.net/rfc7159), because any order implements the
+    specified "unordered" nature of JSON objects.
+    */
+    using object_t = llvm::StringMap<json>;
+
+    /*!
+    @brief a type for an array
+
+    [RFC 7159](http://rfc7159.net/rfc7159) describes JSON arrays as follows:
+    > An array is an ordered sequence of zero or more values.
+
+    To store objects in C++, a type is defined by the template parameters
+    explained below.
+
+    #### Default type
+
+    The default value for @a array_t is:
+
+    @code {.cpp}
+    std::vector<
+      json // value_type
+    >
+    @endcode
+
+    #### Limits
+
+    [RFC 7159](http://rfc7159.net/rfc7159) specifies:
+    > An implementation may set limits on the maximum depth of nesting.
+
+    In this class, the array's limit of nesting is not constraint explicitly.
+    However, a maximum depth of nesting may be introduced by the compiler or
+    runtime environment. A theoretical limit can be queried by calling the
+    @ref max_size function of a JSON array.
+
+    #### Storage
+
+    Arrays are stored as pointers in a @ref json type. That is, for any
+    access to array values, a pointer of type `array_t*` must be dereferenced.
+
+    @sa @ref object_t -- type for an object value
+
+    @since version 1.0.0
+    */
+    using array_t = std::vector<json>;
+
+    /*!
+    @brief a type for a string
+
+    [RFC 7159](http://rfc7159.net/rfc7159) describes JSON strings as follows:
+    > A string is a sequence of zero or more Unicode characters.
+
+    To store objects in C++, a type is defined by the template parameter
+    described below. Unicode values are split by the JSON class into
+    byte-sized characters during deserialization.
+
+    #### Default type
+
+    The default value for @a string_t is:
+
+    @code {.cpp}
+    std::string
+    @endcode
+
+    #### Encoding
+
+    Strings are stored in UTF-8 encoding. Therefore, functions like
+    `std::string::size()` or `std::string::length()` return the number of
+    bytes in the string rather than the number of characters or glyphs.
+
+    #### String comparison
+
+    [RFC 7159](http://rfc7159.net/rfc7159) states:
+    > Software implementations are typically required to test names of object
+    > members for equality. Implementations that transform the textual
+    > representation into sequences of Unicode code units and then perform the
+    > comparison numerically, code unit by code unit, are interoperable in the
+    > sense that implementations will agree in all cases on equality or
+    > inequality of two strings. For example, implementations that compare
+    > strings with escaped characters unconverted may incorrectly find that
+    > `"a\\b"` and `"a\u005Cb"` are not equal.
+
+    This implementation is interoperable as it does compare strings code unit
+    by code unit.
+
+    #### Storage
+
+    String values are stored as pointers in a @ref basic_json type. That is,
+    for any access to string values, a pointer of type `string_t*` must be
+    dereferenced.
+
+    @since version 1.0.0
+    */
+    using string_t = std::string;
+
+    /*!
+    @brief a type for a boolean
+
+    [RFC 7159](http://rfc7159.net/rfc7159) implicitly describes a boolean as a
+    type which differentiates the two literals `true` and `false`.
+
+    #### Default type
+
+    The default value for @a boolean_t is:
+
+    @code {.cpp}
+    bool
+    @endcode
+
+    #### Storage
+
+    Boolean values are stored directly inside a @ref basic_json type.
+
+    @since version 1.0.0
+    */
+    using boolean_t = bool;
+
+    /*!
+    @brief a type for a number (integer)
+
+    [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows:
+    > The representation of numbers is similar to that used in most
+    > programming languages. A number is represented in base 10 using decimal
+    > digits. It contains an integer component that may be prefixed with an
+    > optional minus sign, which may be followed by a fraction part and/or an
+    > exponent part. Leading zeros are not allowed. (...) Numeric values that
+    > cannot be represented in the grammar below (such as Infinity and NaN)
+    > are not permitted.
+
+    This description includes both integer and floating-point numbers.
+    However, C++ allows more precise storage if it is known whether the number
+    is a signed integer, an unsigned integer or a floating-point number.
+    Therefore, three different types, @ref number_integer_t, @ref
+    number_unsigned_t and @ref number_float_t are used.
+
+    #### Default type
+
+    The default value for @a number_integer_t is:
+
+    @code {.cpp}
+    int64_t
+    @endcode
+
+    #### Default behavior
+
+    - The restrictions about leading zeros is not enforced in C++. Instead,
+      leading zeros in integer literals lead to an interpretation as octal
+      number. Internally, the value will be stored as decimal number. For
+      instance, the C++ integer literal `010` will be serialized to `8`.
+      During deserialization, leading zeros yield an error.
+    - Not-a-number (NaN) values will be serialized to `null`.
+
+    #### Limits
+
+    [RFC 7159](http://rfc7159.net/rfc7159) specifies:
+    > An implementation may set limits on the range and precision of numbers.
+
+    When the default type is used, the maximal integer number that can be
+    stored is `9223372036854775807` (INT64_MAX) and the minimal integer number
+    that can be stored is `-9223372036854775808` (INT64_MIN). Integer numbers
+    that are out of range will yield over/underflow when used in a
+    constructor. During deserialization, too large or small integer numbers
+    will be automatically be stored as @ref number_unsigned_t or @ref
+    number_float_t.
+
+    [RFC 7159](http://rfc7159.net/rfc7159) further states:
+    > Note that when such software is used, numbers that are integers and are
+    > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense
+    > that implementations will agree exactly on their numeric values.
+
+    As this range is a subrange of the exactly supported range [INT64_MIN,
+    INT64_MAX], this class's integer type is interoperable.
+
+    #### Storage
+
+    Integer number values are stored directly inside a @ref basic_json type.
+
+    @sa @ref number_float_t -- type for number values (floating-point)
+
+    @sa @ref number_unsigned_t -- type for number values (unsigned integer)
+
+    @since version 1.0.0
+    */
+    using number_integer_t = int64_t;
+
+    /*!
+    @brief a type for a number (unsigned)
+
+    [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows:
+    > The representation of numbers is similar to that used in most
+    > programming languages. A number is represented in base 10 using decimal
+    > digits. It contains an integer component that may be prefixed with an
+    > optional minus sign, which may be followed by a fraction part and/or an
+    > exponent part. Leading zeros are not allowed. (...) Numeric values that
+    > cannot be represented in the grammar below (such as Infinity and NaN)
+    > are not permitted.
+
+    This description includes both integer and floating-point numbers.
+    However, C++ allows more precise storage if it is known whether the number
+    is a signed integer, an unsigned integer or a floating-point number.
+    Therefore, three different types, @ref number_integer_t, @ref
+    number_unsigned_t and @ref number_float_t are used.
+
+    #### Default type
+
+    The default value for @a number_unsigned_t is:
+
+    @code {.cpp}
+    uint64_t
+    @endcode
+
+    #### Default behavior
+
+    - The restrictions about leading zeros is not enforced in C++. Instead,
+      leading zeros in integer literals lead to an interpretation as octal
+      number. Internally, the value will be stored as decimal number. For
+      instance, the C++ integer literal `010` will be serialized to `8`.
+      During deserialization, leading zeros yield an error.
+    - Not-a-number (NaN) values will be serialized to `null`.
+
+    #### Limits
+
+    [RFC 7159](http://rfc7159.net/rfc7159) specifies:
+    > An implementation may set limits on the range and precision of numbers.
+
+    When the default type is used, the maximal integer number that can be
+    stored is `18446744073709551615` (UINT64_MAX) and the minimal integer
+    number that can be stored is `0`. Integer numbers that are out of range
+    will yield over/underflow when used in a constructor. During
+    deserialization, too large or small integer numbers will be automatically
+    be stored as @ref number_integer_t or @ref number_float_t.
+
+    [RFC 7159](http://rfc7159.net/rfc7159) further states:
+    > Note that when such software is used, numbers that are integers and are
+    > in the range \f$[-2^{53}+1, 2^{53}-1]\f$ are interoperable in the sense
+    > that implementations will agree exactly on their numeric values.
+
+    As this range is a subrange (when considered in conjunction with the
+    number_integer_t type) of the exactly supported range [0, UINT64_MAX],
+    this class's integer type is interoperable.
+
+    #### Storage
+
+    Integer number values are stored directly inside a @ref basic_json type.
+
+    @sa @ref number_float_t -- type for number values (floating-point)
+    @sa @ref number_integer_t -- type for number values (integer)
+
+    @since version 2.0.0
+    */
+    using number_unsigned_t = uint64_t;
+
+    /*!
+    @brief a type for a number (floating-point)
+
+    [RFC 7159](http://rfc7159.net/rfc7159) describes numbers as follows:
+    > The representation of numbers is similar to that used in most
+    > programming languages. A number is represented in base 10 using decimal
+    > digits. It contains an integer component that may be prefixed with an
+    > optional minus sign, which may be followed by a fraction part and/or an
+    > exponent part. Leading zeros are not allowed. (...) Numeric values that
+    > cannot be represented in the grammar below (such as Infinity and NaN)
+    > are not permitted.
+
+    This description includes both integer and floating-point numbers.
+    However, C++ allows more precise storage if it is known whether the number
+    is a signed integer, an unsigned integer or a floating-point number.
+    Therefore, three different types, @ref number_integer_t, @ref
+    number_unsigned_t and @ref number_float_t are used.
+
+    #### Default type
+
+    The default value for @a number_float_t is:
+
+    @code {.cpp}
+    double
+    @endcode
+
+    #### Default behavior
+
+    - The restrictions about leading zeros is not enforced in C++. Instead,
+      leading zeros in floating-point literals will be ignored. Internally,
+      the value will be stored as decimal number. For instance, the C++
+      floating-point literal `01.2` will be serialized to `1.2`. During
+      deserialization, leading zeros yield an error.
+    - Not-a-number (NaN) values will be serialized to `null`.
+
+    #### Limits
+
+    [RFC 7159](http://rfc7159.net/rfc7159) states:
+    > This specification allows implementations to set limits on the range and
+    > precision of numbers accepted. Since software that implements IEEE
+    > 754-2008 binary64 (double precision) numbers is generally available and
+    > widely used, good interoperability can be achieved by implementations
+    > that expect no more precision or range than these provide, in the sense
+    > that implementations will approximate JSON numbers within the expected
+    > precision.
+
+    This implementation does exactly follow this approach, as it uses double
+    precision floating-point numbers. Note values smaller than
+    `-1.79769313486232e+308` and values greater than `1.79769313486232e+308`
+    will be stored as NaN internally and be serialized to `null`.
+
+    #### Storage
+
+    Floating-point number values are stored directly inside a @ref basic_json
+    type.
+
+    @sa @ref number_integer_t -- type for number values (integer)
+
+    @sa @ref number_unsigned_t -- type for number values (unsigned integer)
+
+    @since version 1.0.0
+    */
+    using number_float_t = double;
+
+    /// @}
+
+  private:
+
+    /// helper for exception-safe object creation
+    template<typename T, typename... Args>
+    static T* create(Args&& ... args)
+    {
+        std::allocator<T> alloc;
+        auto deleter = [&](T * object)
+        {
+            alloc.deallocate(object, 1);
+        };
+        std::unique_ptr<T, decltype(deleter)> object(alloc.allocate(1), deleter);
+        alloc.construct(object.get(), std::forward<Args>(args)...);
+        assert(object != nullptr);
+        return object.release();
+    }
+
+    ////////////////////////
+    // JSON value storage //
+    ////////////////////////
+
+  public:
+    /*!
+    @brief a JSON value
+
+    The actual storage for a JSON value of the @ref json class. This
+    union combines the different storage types for the JSON value types
+    defined in @ref value_t.
+
+    JSON type | value_t type    | used type
+    --------- | --------------- | ------------------------
+    object    | object          | pointer to @ref object_t
+    array     | array           | pointer to @ref array_t
+    string    | string          | pointer to std::string
+    boolean   | boolean         | bool
+    number    | number_integer  | std::int64_t
+    number    | number_unsigned | std::uint64_t
+    number    | number_float    | double
+    null      | null            | *no value is stored*
+
+    @note Variable-length types (objects, arrays, and strings) are stored as
+    pointers. The size of the union should not exceed 64 bits if the default
+    value types are used.
+
+    @since version 1.0.0
+    */
+    union json_value
+    {
+        /// object (stored with pointer to save storage)
+        object_t* object;
+        /// array (stored with pointer to save storage)
+        array_t* array;
+        /// string (stored with pointer to save storage)
+        std::string* string;
+        /// boolean
+        bool boolean;
+        /// number (integer)
+        std::int64_t number_integer;
+        /// number (unsigned integer)
+        std::uint64_t number_unsigned;
+        /// number (floating-point)
+        double number_float;
+
+        /// default constructor (for null values)
+        json_value() = default;
+        /// constructor for booleans
+        json_value(bool v) noexcept : boolean(v) {}
+        /// constructor for numbers (integer)
+        json_value(std::int64_t v) noexcept : number_integer(v) {}
+        /// constructor for numbers (unsigned)
+        json_value(std::uint64_t v) noexcept : number_unsigned(v) {}
+        /// constructor for numbers (floating-point)
+        json_value(double v) noexcept : number_float(v) {}
+        /// constructor for empty values of a given type
+        json_value(value_t t);
+
+        /// constructor for strings
+        json_value(llvm::StringRef value);
+        json_value(const std::string& value);
+
+        /// constructor for objects
+        json_value(const object_t& value);
+
+        /// constructor for arrays
+        json_value(const array_t& value);
+    };
+
+  private:
+    /*!
+    @brief checks the class invariants
+
+    This function asserts the class invariants. It needs to be called at the
+    end of every constructor to make sure that created objects respect the
+    invariant. Furthermore, it has to be called each time the type of a JSON
+    value is changed, because the invariant expresses a relationship between
+    @a m_type and @a m_value.
+    */
+    void assert_invariant() const
+    {
+        assert(m_type != value_t::object || m_value.object != nullptr);
+        assert(m_type != value_t::array || m_value.array != nullptr);
+        assert(m_type != value_t::string || m_value.string != nullptr);
+    }
+
+  public:
+    //////////////////////////
+    // JSON parser callback //
+    //////////////////////////
+
+    /*!
+    @brief JSON callback events
+
+    This enumeration lists the parser events that can trigger calling a
+    callback function of type @ref parser_callback_t during parsing.
+
+    @image html callback_events.png "Example when certain parse events are triggered"
+
+    @since version 1.0.0
+    */
+    enum class parse_event_t : uint8_t
+    {
+        /// the parser read `{` and started to process a JSON object
+        object_start,
+        /// the parser read `}` and finished processing a JSON object
+        object_end,
+        /// the parser read `[` and started to process a JSON array
+        array_start,
+        /// the parser read `]` and finished processing a JSON array
+        array_end,
+        /// the parser read a key of a value in an object
+        key,
+        /// the parser finished reading a JSON value
+        value
+    };
+
+    /*!
+    @brief per-element parser callback type
+
+    With a parser callback function, the result of parsing a JSON text can be
+    influenced. When passed to @ref parse(wpi::raw_istream&, const
+    parser_callback_t) or @ref parse(const CharT, const parser_callback_t),
+    it is called on certain events (passed as @ref parse_event_t via parameter
+    @a event) with a set recursion depth @a depth and context JSON value
+    @a parsed. The return value of the callback function is a boolean
+    indicating whether the element that emitted the callback shall be kept or
+    not.
+
+    We distinguish six scenarios (determined by the event type) in which the
+    callback function can be called. The following table describes the values
+    of the parameters @a depth, @a event, and @a parsed.
+
+    parameter @a event | description | parameter @a depth | parameter @a parsed
+    ------------------ | ----------- | ------------------ | -------------------
+    parse_event_t::object_start | the parser read `{` and started to process a JSON object | depth of the parent of the JSON object | a JSON value with type discarded
+    parse_event_t::key | the parser read a key of a value in an object | depth of the currently parsed JSON object | a JSON string containing the key
+    parse_event_t::object_end | the parser read `}` and finished processing a JSON object | depth of the parent of the JSON object | the parsed JSON object
+    parse_event_t::array_start | the parser read `[` and started to process a JSON array | depth of the parent of the JSON array | a JSON value with type discarded
+    parse_event_t::array_end | the parser read `]` and finished processing a JSON array | depth of the parent of the JSON array | the parsed JSON array
+    parse_event_t::value | the parser finished reading a JSON value | depth of the value | the parsed JSON value
+
+    @image html callback_events.png "Example when certain parse events are triggered"
+
+    Discarding a value (i.e., returning `false`) has different effects
+    depending on the context in which function was called:
+
+    - Discarded values in structured types are skipped. That is, the parser
+      will behave as if the discarded value was never read.
+    - In case a value outside a structured type is skipped, it is replaced
+      with `null`. This case happens if the top-level element is skipped.
+
+    @param[in] depth  the depth of the recursion during parsing
+
+    @param[in] event  an event of type parse_event_t indicating the context in
+    the callback function has been called
+
+    @param[in,out] parsed  the current intermediate parse result; note that
+    writing to this value has no effect for parse_event_t::key events
+
+    @return Whether the JSON value which called the function during parsing
+    should be kept (`true`) or not (`false`). In the latter case, it is either
+    skipped completely or replaced by an empty discarded object.
+
+    @sa @ref parse(wpi::raw_istream&, parser_callback_t) or
+    @ref parse(const CharT, const parser_callback_t) for examples
+
+    @since version 1.0.0
+    */
+    using parser_callback_t = std::function<bool(int depth,
+                              parse_event_t event,
+                              json& parsed)>;
+
+
+    //////////////////
+    // constructors //
+    //////////////////
+
+    /// @name constructors and destructors
+    /// Constructors of class @ref json, copy/move constructor, copy
+    /// assignment, static functions creating objects, and the destructor.
+    /// @{
+
+    /*!
+    @brief create an empty value with a given type
+
+    Create an empty JSON value with a given type. The value will be default
+    initialized with an empty value which depends on the type:
+
+    Value type  | initial value
+    ----------- | -------------
+    null        | `null`
+    boolean     | `false`
+    string      | `""`
+    number      | `0`
+    object      | `{}`
+    array       | `[]`
+
+    @param[in] value_type  the type of the value to create
+
+    @complexity Constant.
+
+    @liveexample{The following code shows the constructor for different @ref
+    value_t values,json__value_t}
+
+    @since version 1.0.0
+    */
+    json(const value_t value_type)
+        : m_type(value_type), m_value(value_type)
+    {
+        assert_invariant();
+    }
+
+    /*!
+    @brief create a null object
+
+    Create a `null` JSON value. It either takes a null pointer as parameter
+    (explicitly creating `null`) or no parameter (implicitly creating `null`).
+    The passed null pointer itself is not read -- it is only used to choose
+    the right constructor.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this constructor never throws
+    exceptions.
+
+    @liveexample{The following code shows the constructor with and without a
+    null pointer parameter.,json__nullptr_t}
+
+    @since version 1.0.0
+    */
+    json(std::nullptr_t = nullptr) noexcept
+        : json(value_t::null)
+    {
+        assert_invariant();
+    }
+
+    /*!
+    @brief create a JSON value
+
+    This is a "catch all" constructor for all compatible JSON types; that is,
+    types for which a `to_json()` method exsits. The constructor forwards the
+    parameter @a val to that method (to `json_serializer<U>::to_json` method
+    with `U = uncvref_t<CompatibleType>`, to be exact).
+
+    Template type @a CompatibleType includes, but is not limited to, the
+    following types:
+    - **arrays**: @ref array_t and all kinds of compatible containers such as
+      `std::vector`, `std::deque`, `std::list`, `std::forward_list`,
+      `std::array`, `std::set`, `std::unordered_set`, `std::multiset`, and
+      `unordered_multiset` with a `value_type` from which a @ref json
+      value can be constructed.
+    - **objects**: @ref object_t and all kinds of compatible associative
+      containers such as `std::map`, `std::unordered_map`, `std::multimap`,
+      and `std::unordered_multimap` with a `key_type` compatible to
+      std::string and a `value_type` from which a @ref json value can
+      be constructed.
+    - **strings**: std::string, string literals, and all compatible string
+      containers can be used.
+    - **numbers**: std::int64_t, std::uint64_t,
+      double, and all convertible number types such as `int`,
+      `size_t`, `int64_t`, `float` or `double` can be used.
+    - **boolean**: `bool` can be used.
+
+    See the examples below.
+
+    @tparam CompatibleType a type such that:
+    - @a CompatibleType is not derived from `wpi::raw_istream`,
+    - @a CompatibleType is not @ref json (to avoid hijacking copy/move
+         constructors),
+    - @a CompatibleType is not a @ref json nested type (e.g.,
+         @ref json_pointer, @ref iterator, etc ...)
+    - @ref @ref json_serializer<U> has a
+         `to_json(json&, CompatibleType&&)` method
+
+    @tparam U = `uncvref_t<CompatibleType>`
+
+    @param[in] val the value to be forwarded
+
+    @complexity Usually linear in the size of the passed @a val, also
+                depending on the implementation of the called `to_json()`
+                method.
+
+    @throw what `json_serializer<U>::to_json()` throws
+
+    @liveexample{The following code shows the constructor with several
+    compatible types.,json__CompatibleType}
+
+    @since version 2.1.0
+    */
+    template<typename CompatibleType, typename U = detail::uncvref_t<CompatibleType>,
+             detail::enable_if_t<!std::is_base_of<wpi::raw_istream, U>::value &&
+                                 !std::is_same<U, json>::value &&
+                                 !detail::is_json_nested_type<json, U>::value,
+                                 int> = 0>
+    json(CompatibleType && val)
+    {
+        to_json(*this, std::forward<CompatibleType>(val));
+        assert_invariant();
+    }
+
+    /*!
+    @brief create a container (array or object) from an initializer list
+
+    Creates a JSON value of type array or object from the passed initializer
+    list @a init. In case @a type_deduction is `true` (default), the type of
+    the JSON value to be created is deducted from the initializer list @a init
+    according to the following rules:
+
+    1. If the list is empty, an empty JSON object value `{}` is created.
+    2. If the list consists of pairs whose first element is a string, a JSON
+       object value is created where the first elements of the pairs are
+       treated as keys and the second elements are as values.
+    3. In all other cases, an array is created.
+
+    The rules aim to create the best fit between a C++ initializer list and
+    JSON values. The rationale is as follows:
+
+    1. The empty initializer list is written as `{}` which is exactly an empty
+       JSON object.
+    2. C++ has now way of describing mapped types other than to list a list of
+       pairs. As JSON requires that keys must be of type string, rule 2 is the
+       weakest constraint one can pose on initializer lists to interpret them
+       as an object.
+    3. In all other cases, the initializer list could not be interpreted as
+       JSON object type, so interpreting it as JSON array type is safe.
+
+    With the rules described above, the following JSON values cannot be
+    expressed by an initializer list:
+
+    - the empty array (`[]`): use @ref array(std::initializer_list<json>)
+      with an empty initializer list in this case
+    - arrays whose elements satisfy rule 2: use @ref
+      array(std::initializer_list<json>) with the same initializer list
+      in this case
+
+    @note When used without parentheses around an empty initializer list, @ref
+    json() is called instead of this function, yielding the JSON null
+    value.
+
+    @param[in] init  initializer list with JSON values
+
+    @param[in] type_deduction internal parameter; when set to `true`, the type
+    of the JSON value is deducted from the initializer list @a init; when set
+    to `false`, the type provided via @a manual_type is forced. This mode is
+    used by the functions @ref array(std::initializer_list<json>) and
+    @ref object(std::initializer_list<json>).
+
+    @param[in] manual_type internal parameter; when @a type_deduction is set
+    to `false`, the created JSON value will use the provided type (only @ref
+    value_t::array and @ref value_t::object are valid); when @a type_deduction
+    is set to `true`, this parameter has no effect
+
+    @throw type_error.301 if @a type_deduction is `false`, @a manual_type is
+    `value_t::object`, but @a init contains an element which is not a pair
+    whose first element is a string. In this case, the constructor could not
+    create an object. If @a type_deduction would have be `true`, an array
+    would have been created. See @ref object(std::initializer_list<json>)
+    for an example.
+
+    @complexity Linear in the size of the initializer list @a init.
+
+    @liveexample{The example below shows how JSON values are created from
+    initializer lists.,json__list_init_t}
+
+    @sa @ref array(std::initializer_list<json>) -- create a JSON array
+    value from an initializer list
+    @sa @ref object(std::initializer_list<json>) -- create a JSON object
+    value from an initializer list
+
+    @since version 1.0.0
+    */
+    json(std::initializer_list<json> init,
+               bool type_deduction = true,
+               value_t manual_type = value_t::array);
+
+    /*!
+    @brief explicitly create an array from an initializer list
+
+    Creates a JSON array value from a given initializer list. That is, given a
+    list of values `a, b, c`, creates the JSON value `[a, b, c]`. If the
+    initializer list is empty, the empty array `[]` is created.
+
+    @note This function is only needed to express two edge cases that cannot
+    be realized with the initializer list constructor (@ref
+    json(std::initializer_list<json>, bool, value_t)). These cases
+    are:
+    1. creating an array whose elements are all pairs whose first element is a
+    string -- in this case, the initializer list constructor would create an
+    object, taking the first elements as keys
+    2. creating an empty array -- passing the empty initializer list to the
+    initializer list constructor yields an empty object
+
+    @param[in] init  initializer list with JSON values to create an array from
+    (optional)
+
+    @return JSON array value
+
+    @complexity Linear in the size of @a init.
+
+    @liveexample{The following code shows an example for the `array`
+    function.,array}
+
+    @sa @ref json(std::initializer_list<json>, bool, value_t) --
+    create a JSON value from an initializer list
+    @sa @ref object(std::initializer_list<json>) -- create a JSON object
+    value from an initializer list
+
+    @since version 1.0.0
+    */
+    static json array(std::initializer_list<json> init =
+                                std::initializer_list<json>())
+    {
+        return json(init, false, value_t::array);
+    }
+
+    /*!
+    @brief explicitly create an object from an initializer list
+
+    Creates a JSON object value from a given initializer list. The initializer
+    lists elements must be pairs, and their first elements must be strings. If
+    the initializer list is empty, the empty object `{}` is created.
+
+    @note This function is only added for symmetry reasons. In contrast to the
+    related function @ref array(std::initializer_list<json>), there are
+    no cases which can only be expressed by this function. That is, any
+    initializer list @a init can also be passed to the initializer list
+    constructor @ref json(std::initializer_list<json>, bool, value_t).
+
+    @param[in] init  initializer list to create an object from (optional)
+
+    @return JSON object value
+
+    @throw type_error.301 if @a init is not a list of pairs whose first
+    elements are strings. In this case, no object can be created. When such a
+    value is passed to @ref json(std::initializer_list<json>, bool, value_t),
+    an array would have been created from the passed initializer list @a init.
+    See example below.
+
+    @complexity Linear in the size of @a init.
+
+    @liveexample{The following code shows an example for the `object`
+    function.,object}
+
+    @sa @ref json(std::initializer_list<json>, bool, value_t) --
+    create a JSON value from an initializer list
+    @sa @ref array(std::initializer_list<json>) -- create a JSON array
+    value from an initializer list
+
+    @since version 1.0.0
+    */
+    static json object(std::initializer_list<json> init =
+                                 std::initializer_list<json>())
+    {
+        return json(init, false, value_t::object);
+    }
+
+    /*!
+    @brief construct an array with count copies of given value
+
+    Constructs a JSON array value by creating @a cnt copies of a passed value.
+    In case @a cnt is `0`, an empty array is created. As postcondition,
+    `std::distance(begin(),end()) == cnt` holds.
+
+    @param[in] cnt  the number of JSON copies of @a val to create
+    @param[in] val  the JSON value to copy
+
+    @complexity Linear in @a cnt.
+
+    @liveexample{The following code shows examples for the @ref
+    json(size_type\, const json&)
+    constructor.,json__size_type_json}
+
+    @since version 1.0.0
+    */
+    json(size_type cnt, const json& val);
+
+    /*!
+    @brief construct a JSON container given an iterator range
+
+    Constructs the JSON value with the contents of the range `[first, last)`.
+    The semantics depends on the different types a JSON value can have:
+    - In case of primitive types (number, boolean, or string), @a first must
+      be `begin()` and @a last must be `end()`. In this case, the value is
+      copied. Otherwise, invalid_iterator.204 is thrown.
+    - In case of structured types (array, object), the constructor behaves as
+      similar versions for `std::vector`.
+    - In case of a null type, invalid_iterator.206 is thrown.
+
+    @tparam InputIT an input iterator type (@ref iterator or @ref
+    const_iterator)
+
+    @param[in] first begin of the range to copy from (included)
+    @param[in] last end of the range to copy from (excluded)
+
+    @pre Iterators @a first and @a last must be initialized. **This
+         precondition is enforced with an assertion.**
+
+    @pre Range `[first, last)` is valid. Usually, this precondition cannot be
+         checked efficiently. Only certain edge cases are detected; see the
+         description of the exceptions below.
+
+    @throw invalid_iterator.201 if iterators @a first and @a last are not
+    compatible (i.e., do not belong to the same JSON value). In this case,
+    the range `[first, last)` is undefined.
+    @throw invalid_iterator.204 if iterators @a first and @a last belong to a
+    primitive type (number, boolean, or string), but @a first does not point
+    to the first element any more. In this case, the range `[first, last)` is
+    undefined. See example code below.
+    @throw invalid_iterator.206 if iterators @a first and @a last belong to a
+    null value. In this case, the range `[first, last)` is undefined.
+
+    @complexity Linear in distance between @a first and @a last.
+
+    @liveexample{The example below shows several ways to create JSON values by
+    specifying a subrange with iterators.,json__InputIt_InputIt}
+
+    @since version 1.0.0
+    */
+    template<class InputIT, typename std::enable_if<
+                 std::is_same<InputIT, json::iterator>::value ||
+                 std::is_same<InputIT, json::const_iterator>::value, int>::type = 0>
+    json(InputIT first, InputIT last)
+    {
+        assert(first.m_object != nullptr);
+        assert(last.m_object != nullptr);
+
+        // make sure iterator fits the current value
+        if (first.m_object != last.m_object)
+        {
+            JSON_THROW(invalid_iterator::create(201, "iterators are not compatible"));
+        }
+
+        // copy type from first iterator
+        m_type = first.m_object->m_type;
+
+        // check if iterator range is complete for primitive values
+        switch (m_type)
+        {
+            case value_t::boolean:
+            case value_t::number_float:
+            case value_t::number_integer:
+            case value_t::number_unsigned:
+            case value_t::string:
+            {
+                if (!first.m_it.primitive_iterator.is_begin() || !last.m_it.primitive_iterator.is_end())
+                {
+                    JSON_THROW(invalid_iterator::create(204, "iterators out of range"));
+                }
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+
+        switch (m_type)
+        {
+            case value_t::number_integer:
+            {
+                m_value.number_integer = first.m_object->m_value.number_integer;
+                break;
+            }
+
+            case value_t::number_unsigned:
+            {
+                m_value.number_unsigned = first.m_object->m_value.number_unsigned;
+                break;
+            }
+
+            case value_t::number_float:
+            {
+                m_value.number_float = first.m_object->m_value.number_float;
+                break;
+            }
+
+            case value_t::boolean:
+            {
+                m_value.boolean = first.m_object->m_value.boolean;
+                break;
+            }
+
+            case value_t::string:
+            {
+                m_value = *first.m_object->m_value.string;
+                break;
+            }
+
+            case value_t::array:
+            {
+                m_value.array = create<array_t>(first.m_it.array_iterator,
+                                                last.m_it.array_iterator);
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(invalid_iterator::create(206, "cannot construct with iterators from " +
+                                                    first.m_object->type_name()));
+            }
+        }
+
+        assert_invariant();
+    }
+
+
+    ///////////////////////////////////////
+    // other constructors and destructor //
+    ///////////////////////////////////////
+
+    /*!
+    @brief copy constructor
+
+    Creates a copy of a given JSON value.
+
+    @param[in] other  the JSON value to copy
+
+    @complexity Linear in the size of @a other.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is linear.
+    - As postcondition, it holds: `other == json(other)`.
+
+    @liveexample{The following code shows an example for the copy
+    constructor.,json__json}
+
+    @since version 1.0.0
+    */
+    json(const json& other);
+
+    /*!
+    @brief move constructor
+
+    Move constructor. Constructs a JSON value with the contents of the given
+    value @a other using move semantics. It "steals" the resources from @a
+    other and leaves it as JSON null value.
+
+    @param[in,out] other  value to move to this object
+
+    @post @a other is a JSON null value
+
+    @complexity Constant.
+
+    @liveexample{The code below shows the move constructor explicitly called
+    via std::move.,json__moveconstructor}
+
+    @since version 1.0.0
+    */
+    json(json&& other) noexcept
+        : m_type(std::move(other.m_type)),
+          m_value(std::move(other.m_value))
+    {
+        // check that passed value is valid
+        other.assert_invariant();
+
+        // invalidate payload
+        other.m_type = value_t::null;
+        other.m_value = {};
+
+        assert_invariant();
+    }
+
+    /*!
+    @brief copy assignment
+
+    Copy assignment operator. Copies a JSON value via the "copy and swap"
+    strategy: It is expressed in terms of the copy constructor, destructor,
+    and the swap() member function.
+
+    @param[in] other  value to copy from
+
+    @complexity Linear.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is linear.
+
+    @liveexample{The code below shows and example for the copy assignment. It
+    creates a copy of value `a` which is then swapped with `b`. Finally\, the
+    copy of `a` (which is the null value after the swap) is
+    destroyed.,json__copyassignment}
+
+    @since version 1.0.0
+    */
+    reference& operator=(json other) noexcept (
+        std::is_nothrow_move_constructible<value_t>::value &&
+        std::is_nothrow_move_assignable<value_t>::value &&
+        std::is_nothrow_move_constructible<json_value>::value &&
+        std::is_nothrow_move_assignable<json_value>::value
+    )
+    {
+        // check that passed value is valid
+        other.assert_invariant();
+
+        using std::swap;
+        swap(m_type, other.m_type);
+        swap(m_value, other.m_value);
+
+        assert_invariant();
+        return *this;
+    }
+
+    /*!
+    @brief destructor
+
+    Destroys the JSON value and frees all allocated memory.
+
+    @complexity Linear.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is linear.
+    - All stored elements are destroyed and all memory is freed.
+
+    @since version 1.0.0
+    */
+    ~json();
+
+    /// @}
+
+  public:
+    ///////////////////////
+    // object inspection //
+    ///////////////////////
+
+    /// @name object inspection
+    /// Functions to inspect the type of a JSON value.
+    /// @{
+
+    /*!
+    @brief serialization
+
+    Serialization function for JSON values. The function tries to mimic
+    Python's `json.dumps()` function, and currently supports its @a indent
+    parameter.
+
+    @param[in] indent If indent is nonnegative, then array elements and object
+    members will be pretty-printed with that indent level. An indent level of
+    `0` will only insert newlines. `-1` (the default) selects the most compact
+    representation.
+
+    @return string containing the serialization of the JSON value
+
+    @complexity Linear.
+
+    @liveexample{The following example shows the effect of different @a indent
+    parameters to the result of the serialization.,dump}
+
+    @see https://docs.python.org/2/library/json.html#json.dump
+
+    @since version 1.0.0; indentaction character added in version 3.0.0
+    */
+    std::string dump(const int indent = -1) const;
+
+    /*!
+    @brief serialization
+
+    Serialization function for JSON values. The function tries to mimic
+    Python's `json.dumps()` function, and currently supports its @a indent
+    parameter.
+
+    @param[in,out] os Output stream
+    @param[in] indent If indent is nonnegative, then array elements and object
+    members will be pretty-printed with that indent level. An indent level of
+    `0` will only insert newlines. `-1` (the default) selects the most compact
+    representation.
+
+    @complexity Linear.
+
+    @liveexample{The following example shows the effect of different @a indent
+    parameters to the result of the serialization.,dump}
+
+    @see https://docs.python.org/2/library/json.html#json.dump
+
+    @since version 1.0.0; indentaction character added in version 3.0.0
+    */
+    void dump(llvm::raw_ostream& os, int indent = -1) const;
+
+    /*!
+    @brief return the type of the JSON value (explicit)
+
+    Return the type of the JSON value as a value from the @ref value_t
+    enumeration.
+
+    @return the type of the JSON value
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `type()` for all JSON
+    types.,type}
+
+    @since version 1.0.0
+    */
+    value_t type() const noexcept
+    {
+        return m_type;
+    }
+
+    /*!
+    @brief return whether type is primitive
+
+    This function returns true iff the JSON type is primitive (string, number,
+    boolean, or null).
+
+    @return `true` if type is primitive (string, number, boolean, or null),
+    `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_primitive()` for all JSON
+    types.,is_primitive}
+
+    @sa @ref is_structured() -- returns whether JSON value is structured
+    @sa @ref is_null() -- returns whether JSON value is `null`
+    @sa @ref is_string() -- returns whether JSON value is a string
+    @sa @ref is_boolean() -- returns whether JSON value is a boolean
+    @sa @ref is_number() -- returns whether JSON value is a number
+
+    @since version 1.0.0
+    */
+    bool is_primitive() const noexcept
+    {
+        return is_null() || is_string() || is_boolean() || is_number();
+    }
+
+    /*!
+    @brief return whether type is structured
+
+    This function returns true iff the JSON type is structured (array or
+    object).
+
+    @return `true` if type is structured (array or object), `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_structured()` for all JSON
+    types.,is_structured}
+
+    @sa @ref is_primitive() -- returns whether value is primitive
+    @sa @ref is_array() -- returns whether value is an array
+    @sa @ref is_object() -- returns whether value is an object
+
+    @since version 1.0.0
+    */
+    bool is_structured() const noexcept
+    {
+        return is_array() || is_object();
+    }
+
+    /*!
+    @brief return whether value is null
+
+    This function returns true iff the JSON value is null.
+
+    @return `true` if type is null, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_null()` for all JSON
+    types.,is_null}
+
+    @since version 1.0.0
+    */
+    bool is_null() const noexcept
+    {
+        return m_type == value_t::null;
+    }
+
+    /*!
+    @brief return whether value is a boolean
+
+    This function returns true iff the JSON value is a boolean.
+
+    @return `true` if type is boolean, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_boolean()` for all JSON
+    types.,is_boolean}
+
+    @since version 1.0.0
+    */
+    bool is_boolean() const noexcept
+    {
+        return m_type == value_t::boolean;
+    }
+
+    /*!
+    @brief return whether value is a number
+
+    This function returns true iff the JSON value is a number. This includes
+    both integer and floating-point values.
+
+    @return `true` if type is number (regardless whether integer, unsigned
+    integer or floating-type), `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_number()` for all JSON
+    types.,is_number}
+
+    @sa @ref is_number_integer() -- check if value is an integer or unsigned
+    integer number
+    @sa @ref is_number_unsigned() -- check if value is an unsigned integer
+    number
+    @sa @ref is_number_float() -- check if value is a floating-point number
+
+    @since version 1.0.0
+    */
+    bool is_number() const noexcept
+    {
+        return is_number_integer() || is_number_float();
+    }
+
+    /*!
+    @brief return whether value is an integer number
+
+    This function returns true iff the JSON value is an integer or unsigned
+    integer number. This excludes floating-point values.
+
+    @return `true` if type is an integer or unsigned integer number, `false`
+    otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_number_integer()` for all
+    JSON types.,is_number_integer}
+
+    @sa @ref is_number() -- check if value is a number
+    @sa @ref is_number_unsigned() -- check if value is an unsigned integer
+    number
+    @sa @ref is_number_float() -- check if value is a floating-point number
+
+    @since version 1.0.0
+    */
+    bool is_number_integer() const noexcept
+    {
+        return m_type == value_t::number_integer || m_type == value_t::number_unsigned;
+    }
+
+    /*!
+    @brief return whether value is an unsigned integer number
+
+    This function returns true iff the JSON value is an unsigned integer
+    number. This excludes floating-point and (signed) integer values.
+
+    @return `true` if type is an unsigned integer number, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_number_unsigned()` for all
+    JSON types.,is_number_unsigned}
+
+    @sa @ref is_number() -- check if value is a number
+    @sa @ref is_number_integer() -- check if value is an integer or unsigned
+    integer number
+    @sa @ref is_number_float() -- check if value is a floating-point number
+
+    @since version 2.0.0
+    */
+    bool is_number_unsigned() const noexcept
+    {
+        return m_type == value_t::number_unsigned;
+    }
+
+    /*!
+    @brief return whether value is a floating-point number
+
+    This function returns true iff the JSON value is a floating-point number.
+    This excludes integer and unsigned integer values.
+
+    @return `true` if type is a floating-point number, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_number_float()` for all
+    JSON types.,is_number_float}
+
+    @sa @ref is_number() -- check if value is number
+    @sa @ref is_number_integer() -- check if value is an integer number
+    @sa @ref is_number_unsigned() -- check if value is an unsigned integer
+    number
+
+    @since version 1.0.0
+    */
+    bool is_number_float() const noexcept
+    {
+        return m_type == value_t::number_float;
+    }
+
+    /*!
+    @brief return whether value is an object
+
+    This function returns true iff the JSON value is an object.
+
+    @return `true` if type is object, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_object()` for all JSON
+    types.,is_object}
+
+    @since version 1.0.0
+    */
+    bool is_object() const noexcept
+    {
+        return m_type == value_t::object;
+    }
+
+    /*!
+    @brief return whether value is an array
+
+    This function returns true iff the JSON value is an array.
+
+    @return `true` if type is array, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_array()` for all JSON
+    types.,is_array}
+
+    @since version 1.0.0
+    */
+    bool is_array() const noexcept
+    {
+        return m_type == value_t::array;
+    }
+
+    /*!
+    @brief return whether value is a string
+
+    This function returns true iff the JSON value is a string.
+
+    @return `true` if type is string, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_string()` for all JSON
+    types.,is_string}
+
+    @since version 1.0.0
+    */
+    bool is_string() const noexcept
+    {
+        return m_type == value_t::string;
+    }
+
+    /*!
+    @brief return whether value is discarded
+
+    This function returns true iff the JSON value was discarded during parsing
+    with a callback function (see @ref parser_callback_t).
+
+    @note This function will always be `false` for JSON values after parsing.
+    That is, discarded values can only occur during parsing, but will be
+    removed when inside a structured value or replaced by null in other cases.
+
+    @return `true` if type is discarded, `false` otherwise.
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies `is_discarded()` for all JSON
+    types.,is_discarded}
+
+    @since version 1.0.0
+    */
+    bool is_discarded() const noexcept
+    {
+        return m_type == value_t::discarded;
+    }
+
+    /*!
+    @brief return the type of the JSON value (implicit)
+
+    Implicitly return the type of the JSON value as a value from the @ref
+    value_t enumeration.
+
+    @return the type of the JSON value
+
+    @complexity Constant.
+
+    @exceptionsafety No-throw guarantee: this member function never throws
+    exceptions.
+
+    @liveexample{The following code exemplifies the @ref value_t operator for
+    all JSON types.,operator__value_t}
+
+    @since version 1.0.0
+    */
+    operator value_t() const noexcept
+    {
+        return m_type;
+    }
+
+    /// @}
+
+  private:
+    //////////////////
+    // value access //
+    //////////////////
+
+    /// get a boolean (explicit)
+    bool get_impl(bool* /*unused*/) const
+    {
+        if (is_boolean())
+        {
+            return m_value.boolean;
+        }
+
+        JSON_THROW(type_error::create(302, "type must be boolean, but is " + type_name()));
+    }
+
+    /// get a pointer to the value (object)
+    object_t* get_impl_ptr(object_t* /*unused*/) noexcept
+    {
+        return is_object() ? m_value.object : nullptr;
+    }
+
+    /// get a pointer to the value (object)
+    const object_t* get_impl_ptr(const object_t* /*unused*/) const noexcept
+    {
+        return is_object() ? m_value.object : nullptr;
+    }
+
+    /// get a pointer to the value (array)
+    array_t* get_impl_ptr(array_t* /*unused*/) noexcept
+    {
+        return is_array() ? m_value.array : nullptr;
+    }
+
+    /// get a pointer to the value (array)
+    const array_t* get_impl_ptr(const array_t* /*unused*/) const noexcept
+    {
+        return is_array() ? m_value.array : nullptr;
+    }
+
+    /// get a pointer to the value (string)
+    std::string* get_impl_ptr(std::string* /*unused*/) noexcept
+    {
+        return is_string() ? m_value.string : nullptr;
+    }
+
+    /// get a pointer to the value (string)
+    const std::string* get_impl_ptr(const std::string* /*unused*/) const noexcept
+    {
+        return is_string() ? m_value.string : nullptr;
+    }
+
+    /// get a pointer to the value (boolean)
+    bool* get_impl_ptr(bool* /*unused*/) noexcept
+    {
+        return is_boolean() ? &m_value.boolean : nullptr;
+    }
+
+    /// get a pointer to the value (boolean)
+    const bool* get_impl_ptr(const bool* /*unused*/) const noexcept
+    {
+        return is_boolean() ? &m_value.boolean : nullptr;
+    }
+
+    /// get a pointer to the value (integer number)
+    std::int64_t* get_impl_ptr(std::int64_t* /*unused*/) noexcept
+    {
+        return is_number_integer() ? &m_value.number_integer : nullptr;
+    }
+
+    /// get a pointer to the value (integer number)
+    const std::int64_t* get_impl_ptr(const std::int64_t* /*unused*/) const noexcept
+    {
+        return is_number_integer() ? &m_value.number_integer : nullptr;
+    }
+
+    /// get a pointer to the value (unsigned number)
+    std::uint64_t* get_impl_ptr(std::uint64_t* /*unused*/) noexcept
+    {
+        return is_number_unsigned() ? &m_value.number_unsigned : nullptr;
+    }
+
+    /// get a pointer to the value (unsigned number)
+    const std::uint64_t* get_impl_ptr(const std::uint64_t* /*unused*/) const noexcept
+    {
+        return is_number_unsigned() ? &m_value.number_unsigned : nullptr;
+    }
+
+    /// get a pointer to the value (floating-point number)
+    double* get_impl_ptr(double* /*unused*/) noexcept
+    {
+        return is_number_float() ? &m_value.number_float : nullptr;
+    }
+
+    /// get a pointer to the value (floating-point number)
+    const double* get_impl_ptr(const double* /*unused*/) const noexcept
+    {
+        return is_number_float() ? &m_value.number_float : nullptr;
+    }
+
+    /*!
+    @brief helper function to implement get_ref()
+
+    This funcion helps to implement get_ref() without code duplication for
+    const and non-const overloads
+
+    @tparam ThisType will be deduced as `json` or `const json`
+
+    @throw type_error.303 if ReferenceType does not match underlying value
+    type of the current JSON
+    */
+    template<typename ReferenceType, typename ThisType>
+    static ReferenceType get_ref_impl(ThisType& obj)
+    {
+        // helper type
+        using PointerType = typename std::add_pointer<ReferenceType>::type;
+
+        // delegate the call to get_ptr<>()
+        auto ptr = obj.template get_ptr<PointerType>();
+
+        if (ptr != nullptr)
+        {
+            return *ptr;
+        }
+
+        JSON_THROW(type_error::create(303, "incompatible ReferenceType for get_ref, actual type is " + obj.type_name()));
+    }
+
+  public:
+    /// @name value access
+    /// Direct access to the stored value of a JSON value.
+    /// @{
+
+    /*!
+    @brief get special-case overload
+
+    This overloads avoids a lot of template boilerplate, it can be seen as the
+    identity method
+
+    @tparam BasicJsonType == @ref json
+
+    @return a copy of *this
+
+    @complexity Constant.
+
+    @since version 2.1.0
+    */
+    template <
+        typename BasicJsonType,
+        detail::enable_if_t<std::is_same<typename std::remove_const<BasicJsonType>::type,
+                                         json>::value,
+                            int> = 0 >
+    json get() const
+    {
+        return *this;
+    }
+
+    /*!
+    @brief get a value (explicit)
+
+    Explicit type conversion between the JSON value and a compatible value
+    which is [CopyConstructible](http://en.cppreference.com/w/cpp/concept/CopyConstructible)
+    and [DefaultConstructible](http://en.cppreference.com/w/cpp/concept/DefaultConstructible).
+    The value is converted by calling the @ref json_serializer<ValueType>
+    `from_json()` method.
+
+    The function is equivalent to executing
+    @code {.cpp}
+    ValueType ret;
+    adl_serializer<ValueType, void>::from_json(*this, ret);
+    return ret;
+    @endcode
+
+    This overloads is chosen if:
+    - @a ValueType is not @ref json,
+    - @ref json_serializer<ValueType> has a `from_json()` method of the form
+      `void from_json(const json&, ValueType&)`, and
+    - @ref json_serializer<ValueType> does not have a `from_json()` method of
+      the form `ValueType from_json(const json&)`
+
+    @tparam ValueTypeCV the provided value type
+    @tparam ValueType the returned value type
+
+    @return copy of the JSON value, converted to @a ValueType
+
+    @throw what @ref json_serializer<ValueType> `from_json()` method throws
+
+    @liveexample{The example below shows several conversions from JSON values
+    to other types. There a few things to note: (1) Floating-point numbers can
+    be converted to integers\, (2) A JSON array can be converted to a standard
+    `std::vector<short>`\, (3) A JSON object can be converted to C++
+    associative containers such as `std::unordered_map<std::string\,
+    json>`.,get__ValueType_const}
+
+    @since version 2.1.0
+    */
+    template <
+        typename ValueTypeCV,
+        typename ValueType = detail::uncvref_t<ValueTypeCV>,
+        detail::enable_if_t < !std::is_same<json, ValueType>::value, int > = 0 >
+    ValueType get() const
+    {
+        // we cannot static_assert on ValueTypeCV being non-const, because
+        // there is support for get<const json>(), which is why we
+        // still need the uncvref
+        static_assert(!std::is_reference<ValueTypeCV>::value,
+                      "get() cannot be used with reference types, you might want to use get_ref()");
+        static_assert(std::is_default_constructible<ValueType>::value,
+                      "types must be DefaultConstructible when used with get()");
+
+        ValueType ret;
+        from_json(*this, ret);
+        return ret;
+    }
+
+    /*!
+    @brief get a pointer value (explicit)
+
+    Explicit pointer access to the internally stored JSON value. No copies are
+    made.
+
+    @warning The pointer becomes invalid if the underlying JSON object
+    changes.
+
+    @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref
+    object_t, std::string, bool, std::int64_t,
+    std::uint64_t, or double.
+
+    @return pointer to the internally stored JSON value if the requested
+    pointer type @a PointerType fits to the JSON value; `nullptr` otherwise
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how pointers to internal values of a
+    JSON value can be requested. Note that no type conversions are made and a
+    `nullptr` is returned if the value and the requested pointer type does not
+    match.,get__PointerType}
+
+    @sa @ref get_ptr() for explicit pointer-member access
+
+    @since version 1.0.0
+    */
+    template<typename PointerType, typename std::enable_if<
+                 std::is_pointer<PointerType>::value, int>::type = 0>
+    PointerType get() noexcept
+    {
+        // delegate the call to get_ptr
+        return get_ptr<PointerType>();
+    }
+
+    /*!
+    @brief get a pointer value (explicit)
+    @copydoc get()
+    */
+    template<typename PointerType, typename std::enable_if<
+                 std::is_pointer<PointerType>::value, int>::type = 0>
+    const PointerType get() const noexcept
+    {
+        // delegate the call to get_ptr
+        return get_ptr<PointerType>();
+    }
+
+    /*!
+    @brief get a pointer value (implicit)
+
+    Implicit pointer access to the internally stored JSON value. No copies are
+    made.
+
+    @warning Writing data to the pointee of the result yields an undefined
+    state.
+
+    @tparam PointerType pointer type; must be a pointer to @ref array_t, @ref
+    object_t, std::string, bool, std::int64_t,
+    std::uint64_t, or double. Enforced by a static
+    assertion.
+
+    @return pointer to the internally stored JSON value if the requested
+    pointer type @a PointerType fits to the JSON value; `nullptr` otherwise
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how pointers to internal values of a
+    JSON value can be requested. Note that no type conversions are made and a
+    `nullptr` is returned if the value and the requested pointer type does not
+    match.,get_ptr}
+
+    @since version 1.0.0
+    */
+    template<typename PointerType, typename std::enable_if<
+                 std::is_pointer<PointerType>::value, int>::type = 0>
+    PointerType get_ptr() noexcept
+    {
+        // get the type of the PointerType (remove pointer and const)
+        using pointee_t = typename std::remove_const<typename
+                          std::remove_pointer<typename
+                          std::remove_const<PointerType>::type>::type>::type;
+        // make sure the type matches the allowed types
+        static_assert(
+            std::is_same<object_t, pointee_t>::value
+            || std::is_same<array_t, pointee_t>::value
+            || std::is_same<std::string, pointee_t>::value
+            || std::is_same<bool, pointee_t>::value
+            || std::is_same<std::int64_t, pointee_t>::value
+            || std::is_same<std::uint64_t, pointee_t>::value
+            || std::is_same<double, pointee_t>::value
+            , "incompatible pointer type");
+
+        // delegate the call to get_impl_ptr<>()
+        return get_impl_ptr(static_cast<PointerType>(nullptr));
+    }
+
+    /*!
+    @brief get a pointer value (implicit)
+    @copydoc get_ptr()
+    */
+    template<typename PointerType, typename std::enable_if<
+                 std::is_pointer<PointerType>::value &&
+                 std::is_const<typename std::remove_pointer<PointerType>::type>::value, int>::type = 0>
+    const PointerType get_ptr() const noexcept
+    {
+        // get the type of the PointerType (remove pointer and const)
+        using pointee_t = typename std::remove_const<typename
+                          std::remove_pointer<typename
+                          std::remove_const<PointerType>::type>::type>::type;
+        // make sure the type matches the allowed types
+        static_assert(
+            std::is_same<object_t, pointee_t>::value
+            || std::is_same<array_t, pointee_t>::value
+            || std::is_same<std::string, pointee_t>::value
+            || std::is_same<bool, pointee_t>::value
+            || std::is_same<std::int64_t, pointee_t>::value
+            || std::is_same<std::uint64_t, pointee_t>::value
+            || std::is_same<double, pointee_t>::value
+            , "incompatible pointer type");
+
+        // delegate the call to get_impl_ptr<>() const
+        return get_impl_ptr(static_cast<const PointerType>(nullptr));
+    }
+
+    /*!
+    @brief get a reference value (implicit)
+
+    Implicit reference access to the internally stored JSON value. No copies
+    are made.
+
+    @warning Writing data to the referee of the result yields an undefined
+    state.
+
+    @tparam ReferenceType reference type; must be a reference to @ref array_t,
+    @ref object_t, std::string, bool, std::int64_t, or
+    double. Enforced by static assertion.
+
+    @return reference to the internally stored JSON value if the requested
+    reference type @a ReferenceType fits to the JSON value; throws
+    type_error.303 otherwise
+
+    @throw type_error.303 in case passed type @a ReferenceType is incompatible
+    with the stored JSON value; see example below
+
+    @complexity Constant.
+
+    @liveexample{The example shows several calls to `get_ref()`.,get_ref}
+
+    @since version 1.1.0
+    */
+    template<typename ReferenceType, typename std::enable_if<
+                 std::is_reference<ReferenceType>::value, int>::type = 0>
+    ReferenceType get_ref()
+    {
+        // delegate call to get_ref_impl
+        return get_ref_impl<ReferenceType>(*this);
+    }
+
+    /*!
+    @brief get a reference value (implicit)
+    @copydoc get_ref()
+    */
+    template<typename ReferenceType, typename std::enable_if<
+                 std::is_reference<ReferenceType>::value &&
+                 std::is_const<typename std::remove_reference<ReferenceType>::type>::value, int>::type = 0>
+    ReferenceType get_ref() const
+    {
+        // delegate call to get_ref_impl
+        return get_ref_impl<ReferenceType>(*this);
+    }
+
+    /*!
+    @brief get a value (implicit)
+
+    Implicit type conversion between the JSON value and a compatible value.
+    The call is realized by calling @ref get() const.
+
+    @tparam ValueType non-pointer type compatible to the JSON value, for
+    instance `int` for JSON integer numbers, `bool` for JSON booleans, or
+    `std::vector` types for JSON arrays. The character type of std::string
+    as well as an initializer list of this type is excluded to avoid
+    ambiguities as these types implicitly convert to `std::string`.
+
+    @return copy of the JSON value, converted to type @a ValueType
+
+    @throw type_error.302 in case passed type @a ValueType is incompatible
+    to the JSON value type (e.g., the JSON value is of type boolean, but a
+    string is requested); see example below
+
+    @complexity Linear in the size of the JSON value.
+
+    @liveexample{The example below shows several conversions from JSON values
+    to other types. There a few things to note: (1) Floating-point numbers can
+    be converted to integers\, (2) A JSON array can be converted to a standard
+    `std::vector<short>`\, (3) A JSON object can be converted to C++
+    associative containers such as `std::unordered_map<std::string\,
+    json>`.,operator__ValueType}
+
+    @since version 1.0.0
+    */
+    template < typename ValueType, typename std::enable_if <
+                   !std::is_pointer<ValueType>::value &&
+                   !std::is_same<ValueType, std::string::value_type>::value
+#ifndef _MSC_VER  // fix for issue #167 operator<< ambiguity under VS2015
+                   && !std::is_same<ValueType, std::initializer_list<std::string::value_type>>::value
+#endif
+#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_MSC_VER) && _MSC_VER >1900 && defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464
+                   && !std::is_same<ValueType, typename std::string_view>::value
+#endif
+                   , int >::type = 0 >
+    operator ValueType() const
+    {
+        // delegate the call to get<>() const
+        return get<ValueType>();
+    }
+
+    /// @}
+
+
+    ////////////////////
+    // element access //
+    ////////////////////
+
+    /// @name element access
+    /// Access to the JSON value.
+    /// @{
+
+    /*!
+    @brief access specified array element with bounds checking
+
+    Returns a reference to the element at specified location @a idx, with
+    bounds checking.
+
+    @param[in] idx  index of the element to access
+
+    @return reference to the element at index @a idx
+
+    @throw type_error.304 if the JSON value is not an array; in this case,
+    calling `at` with an index makes no sense. See example below.
+    @throw out_of_range.401 if the index @a idx is out of range of the array;
+    that is, `idx >= size()`. See example below.
+
+    @exceptionsafety Strong guarantee: if an exception is thrown, there are no
+    changes in the JSON value.
+
+    @complexity Constant.
+
+    @since version 1.0.0
+
+    @liveexample{The example below shows how array elements can be read and
+    written using `at()`. It also demonstrates the different exceptions that
+    can be thrown.,at__size_type}
+    */
+    reference at(size_type idx);
+
+    /*!
+    @brief access specified array element with bounds checking
+
+    Returns a const reference to the element at specified location @a idx,
+    with bounds checking.
+
+    @param[in] idx  index of the element to access
+
+    @return const reference to the element at index @a idx
+
+    @throw type_error.304 if the JSON value is not an array; in this case,
+    calling `at` with an index makes no sense. See example below.
+    @throw out_of_range.401 if the index @a idx is out of range of the array;
+    that is, `idx >= size()`. See example below.
+
+    @exceptionsafety Strong guarantee: if an exception is thrown, there are no
+    changes in the JSON value.
+
+    @complexity Constant.
+
+    @since version 1.0.0
+
+    @liveexample{The example below shows how array elements can be read using
+    `at()`. It also demonstrates the different exceptions that can be thrown.,
+    at__size_type_const}
+    */
+    const_reference at(size_type idx) const;
+
+    /*!
+    @brief access specified object element with bounds checking
+
+    Returns a reference to the element at with specified key @a key, with
+    bounds checking.
+
+    @param[in] key  key of the element to access
+
+    @return reference to the element at key @a key
+
+    @throw type_error.304 if the JSON value is not an object; in this case,
+    calling `at` with a key makes no sense. See example below.
+    @throw out_of_range.403 if the key @a key is is not stored in the object;
+    that is, `find(key) == end()`. See example below.
+
+    @exceptionsafety Strong guarantee: if an exception is thrown, there are no
+    changes in the JSON value.
+
+    @complexity Logarithmic in the size of the container.
+
+    @sa @ref operator[](llvm::StringRef) for unchecked
+    access by reference
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.0.0
+
+    @liveexample{The example below shows how object elements can be read and
+    written using `at()`. It also demonstrates the different exceptions that
+    can be thrown.,at__object_t_key_type}
+    */
+    reference at(llvm::StringRef key);
+
+    /*!
+    @brief access specified object element with bounds checking
+
+    Returns a const reference to the element at with specified key @a key,
+    with bounds checking.
+
+    @param[in] key  key of the element to access
+
+    @return const reference to the element at key @a key
+
+    @throw type_error.304 if the JSON value is not an object; in this case,
+    calling `at` with a key makes no sense. See example below.
+    @throw out_of_range.403 if the key @a key is is not stored in the object;
+    that is, `find(key) == end()`. See example below.
+
+    @exceptionsafety Strong guarantee: if an exception is thrown, there are no
+    changes in the JSON value.
+
+    @complexity Logarithmic in the size of the container.
+
+    @sa @ref operator[](llvm::StringRef) for unchecked
+    access by reference
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.0.0
+
+    @liveexample{The example below shows how object elements can be read using
+    `at()`. It also demonstrates the different exceptions that can be thrown.,
+    at__object_t_key_type_const}
+    */
+    const_reference at(llvm::StringRef key) const;
+
+    /*!
+    @brief access specified array element
+
+    Returns a reference to the element at specified location @a idx.
+
+    @note If @a idx is beyond the range of the array (i.e., `idx >= size()`),
+    then the array is silently filled up with `null` values to make `idx` a
+    valid reference to the last stored element.
+
+    @param[in] idx  index of the element to access
+
+    @return reference to the element at index @a idx
+
+    @throw type_error.305 if the JSON value is not an array or null; in that
+    cases, using the [] operator with an index makes no sense.
+
+    @complexity Constant if @a idx is in the range of the array. Otherwise
+    linear in `idx - size()`.
+
+    @liveexample{The example below shows how array elements can be read and
+    written using `[]` operator. Note the addition of `null`
+    values.,operatorarray__size_type}
+
+    @since version 1.0.0
+    */
+    reference operator[](size_type idx);
+
+    /*!
+    @brief access specified array element
+
+    Returns a const reference to the element at specified location @a idx.
+
+    @param[in] idx  index of the element to access
+
+    @return const reference to the element at index @a idx
+
+    @throw type_error.305 if the JSON value is not an array; in that cases,
+    using the [] operator with an index makes no sense.
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how array elements can be read using
+    the `[]` operator.,operatorarray__size_type_const}
+
+    @since version 1.0.0
+    */
+    const_reference operator[](size_type idx) const;
+
+    /*!
+    @brief access specified object element
+
+    Returns a reference to the element at with specified key @a key.
+
+    @note If @a key is not found in the object, then it is silently added to
+    the object and filled with a `null` value to make `key` a valid reference.
+    In case the value was `null` before, it is converted to an object.
+
+    @param[in] key  key of the element to access
+
+    @return reference to the element at key @a key
+
+    @throw type_error.305 if the JSON value is not an object or null; in that
+    cases, using the [] operator with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be read and
+    written using the `[]` operator.,operatorarray__key_type}
+
+    @sa @ref at(llvm::StringRef) for access by reference
+    with range checking
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.0.0
+    */
+    reference operator[](llvm::StringRef key);
+
+    /*!
+    @brief read-only access specified object element
+
+    Returns a const reference to the element at with specified key @a key. No
+    bounds checking is performed.
+
+    @warning If the element with key @a key does not exist, the behavior is
+    undefined.
+
+    @param[in] key  key of the element to access
+
+    @return const reference to the element at key @a key
+
+    @pre The element with key @a key must exist. **This precondition is
+         enforced with an assertion.**
+
+    @throw type_error.305 if the JSON value is not an object; in that cases,
+    using the [] operator with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be read using
+    the `[]` operator.,operatorarray__key_type_const}
+
+    @sa @ref at(llvm::StringRef) for access by reference
+    with range checking
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.0.0
+    */
+    const_reference operator[](llvm::StringRef key) const;
+
+    /*!
+    @brief access specified object element
+
+    Returns a reference to the element at with specified key @a key.
+
+    @note If @a key is not found in the object, then it is silently added to
+    the object and filled with a `null` value to make `key` a valid reference.
+    In case the value was `null` before, it is converted to an object.
+
+    @param[in] key  key of the element to access
+
+    @return reference to the element at key @a key
+
+    @throw type_error.305 if the JSON value is not an object or null; in that
+    cases, using the [] operator with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be read and
+    written using the `[]` operator.,operatorarray__key_type}
+
+    @sa @ref at(const typename object_t::key_type&) for access by reference
+    with range checking
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.0.0
+    */
+    template<typename T, std::size_t n>
+    reference operator[](T * (&key)[n])
+    {
+        return operator[](static_cast<const T>(key));
+    }
+
+    /*!
+    @brief read-only access specified object element
+
+    Returns a const reference to the element at with specified key @a key. No
+    bounds checking is performed.
+
+    @warning If the element with key @a key does not exist, the behavior is
+    undefined.
+
+    @note This function is required for compatibility reasons with Clang.
+
+    @param[in] key  key of the element to access
+
+    @return const reference to the element at key @a key
+
+    @throw type_error.305 if the JSON value is not an object; in that cases,
+    using the [] operator with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be read using
+    the `[]` operator.,operatorarray__key_type_const}
+
+    @sa @ref at(const typename object_t::key_type&) for access by reference
+    with range checking
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.0.0
+    */
+    template<typename T, std::size_t n>
+    const_reference operator[](T * (&key)[n]) const
+    {
+        return operator[](static_cast<const T>(key));
+    }
+
+    /*!
+    @brief access specified object element
+
+    Returns a reference to the element at with specified key @a key.
+
+    @note If @a key is not found in the object, then it is silently added to
+    the object and filled with a `null` value to make `key` a valid reference.
+    In case the value was `null` before, it is converted to an object.
+
+    @param[in] key  key of the element to access
+
+    @return reference to the element at key @a key
+
+    @throw type_error.305 if the JSON value is not an object or null; in that
+    cases, using the [] operator with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be read and
+    written using the `[]` operator.,operatorarray__key_type}
+
+    @sa @ref at(const typename object_t::key_type&) for access by reference
+    with range checking
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.1.0
+    */
+    template<typename T>
+    reference operator[](T* key)
+    {
+        return this->operator[](llvm::StringRef(key));
+    }
+
+    /*!
+    @brief read-only access specified object element
+
+    Returns a const reference to the element at with specified key @a key. No
+    bounds checking is performed.
+
+    @warning If the element with key @a key does not exist, the behavior is
+    undefined.
+
+    @param[in] key  key of the element to access
+
+    @return const reference to the element at key @a key
+
+    @pre The element with key @a key must exist. **This precondition is
+         enforced with an assertion.**
+
+    @throw type_error.305 if the JSON value is not an object; in that cases,
+    using the [] operator with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be read using
+    the `[]` operator.,operatorarray__key_type_const}
+
+    @sa @ref at(const typename object_t::key_type&) for access by reference
+    with range checking
+    @sa @ref value() for access by value with a default value
+
+    @since version 1.1.0
+    */
+    template<typename T>
+    const_reference operator[](T* key) const
+    {
+        return this->operator[](llvm::StringRef(key));
+    }
+
+    /*!
+    @brief access specified object element with default value
+
+    Returns either a copy of an object's element at the specified key @a key
+    or a given default value if no element with key @a key exists.
+
+    The function is basically equivalent to executing
+    @code {.cpp}
+    try {
+        return at(key);
+    } catch(out_of_range) {
+        return default_value;
+    }
+    @endcode
+
+    @note Unlike @ref at(llvm::StringRef), this function
+    does not throw if the given key @a key was not found.
+
+    @note Unlike @ref operator[](llvm::StringRef key), this
+    function does not implicitly add an element to the position defined by @a
+    key. This function is furthermore also applicable to const objects.
+
+    @param[in] key  key of the element to access
+    @param[in] default_value  the value to return if @a key is not found
+
+    @tparam ValueType type compatible to JSON values, for instance `int` for
+    JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for
+    JSON arrays. Note the type of the expected value at @a key and the default
+    value @a default_value must be compatible.
+
+    @return copy of the element at key @a key or @a default_value if @a key
+    is not found
+
+    @throw type_error.306 if the JSON value is not an objec; in that cases,
+    using `value()` with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be queried
+    with a default value.,json__value}
+
+    @sa @ref at(llvm::StringRef) for access by reference
+    with range checking
+    @sa @ref operator[](llvm::StringRef) for unchecked
+    access by reference
+
+    @since version 1.0.0
+    */
+    template<class ValueType, typename std::enable_if<
+                 std::is_convertible<json, ValueType>::value, int>::type = 0>
+    ValueType value(llvm::StringRef key, ValueType default_value) const
+    {
+        // at only works for objects
+        if (is_object())
+        {
+            // if key is found, return value and given default value otherwise
+            const auto it = find(key);
+            if (it != end())
+            {
+                return *it;
+            }
+
+            return default_value;
+        }
+        else
+        {
+            JSON_THROW(type_error::create(306, "cannot use value() with " + type_name()));
+        }
+    }
+
+    /*!
+    @brief overload for a default value of type const char*
+    @copydoc json::value(llvm::StringRef, ValueType) const
+    */
+    std::string value(llvm::StringRef key, const char* default_value) const
+    {
+        return value(key, std::string(default_value));
+    }
+
+    /*!
+    @brief access specified object element via JSON Pointer with default value
+
+    Returns either a copy of an object's element at the specified key @a key
+    or a given default value if no element with key @a key exists.
+
+    The function is basically equivalent to executing
+    @code {.cpp}
+    try {
+        return at(ptr);
+    } catch(out_of_range) {
+        return default_value;
+    }
+    @endcode
+
+    @note Unlike @ref at(const json_pointer&), this function does not throw
+    if the given key @a key was not found.
+
+    @param[in] ptr  a JSON pointer to the element to access
+    @param[in] default_value  the value to return if @a ptr found no value
+
+    @tparam ValueType type compatible to JSON values, for instance `int` for
+    JSON integer numbers, `bool` for JSON booleans, or `std::vector` types for
+    JSON arrays. Note the type of the expected value at @a key and the default
+    value @a default_value must be compatible.
+
+    @return copy of the element at key @a key or @a default_value if @a key
+    is not found
+
+    @throw type_error.306 if the JSON value is not an objec; in that cases,
+    using `value()` with a key makes no sense.
+
+    @complexity Logarithmic in the size of the container.
+
+    @liveexample{The example below shows how object elements can be queried
+    with a default value.,json__value_ptr}
+
+    @sa @ref operator[](const json_pointer&) for unchecked access by reference
+
+    @since version 2.0.2
+    */
+    template<class ValueType, typename std::enable_if<
+                 std::is_convertible<json, ValueType>::value, int>::type = 0>
+    ValueType value(const json_pointer& ptr, ValueType default_value) const
+    {
+        // at only works for objects
+        if (is_object())
+        {
+            // if pointer resolves a value, return it or use default value
+            JSON_TRY
+            {
+                return ptr.get_checked(this);
+            }
+            JSON_CATCH (out_of_range&)
+            {
+                return default_value;
+            }
+        }
+
+        JSON_THROW(type_error::create(306, "cannot use value() with " + type_name()));
+    }
+
+    /*!
+    @brief overload for a default value of type const char*
+    @copydoc json::value(const json_pointer&, ValueType) const
+    */
+    std::string value(const json_pointer& ptr, const char* default_value) const
+    {
+        return value(ptr, std::string(default_value));
+    }
+
+    /*!
+    @brief access the first element
+
+    Returns a reference to the first element in the container. For a JSON
+    container `c`, the expression `c.front()` is equivalent to `*c.begin()`.
+
+    @return In case of a structured type (array or object), a reference to the
+    first element is returned. In case of number, string, or boolean values, a
+    reference to the value is returned.
+
+    @complexity Constant.
+
+    @pre The JSON value must not be `null` (would throw `std::out_of_range`)
+    or an empty array or object (undefined behavior, **guarded by
+    assertions**).
+    @post The JSON value remains unchanged.
+
+    @throw invalid_iterator.214 when called on `null` value
+
+    @liveexample{The following code shows an example for `front()`.,front}
+
+    @sa @ref back() -- access the last element
+
+    @since version 1.0.0
+    */
+    reference front()
+    {
+        return *begin();
+    }
+
+    /*!
+    @copydoc json::front()
+    */
+    const_reference front() const
+    {
+        return *cbegin();
+    }
+
+    /*!
+    @brief access the last element
+
+    Returns a reference to the last element in the container. For a JSON
+    container `c`, the expression `c.back()` is equivalent to
+    @code {.cpp}
+    auto tmp = c.end();
+    --tmp;
+    return *tmp;
+    @endcode
+
+    @return In case of a structured type (array or object), a reference to the
+    last element is returned. In case of number, string, or boolean values, a
+    reference to the value is returned.
+
+    @complexity Constant.
+
+    @pre The JSON value must not be `null` (would throw `std::out_of_range`)
+    or an empty array or object (undefined behavior, **guarded by
+    assertions**).
+    @post The JSON value remains unchanged.
+
+    @throw invalid_iterator.214 when called on a `null` value. See example
+    below.
+
+    @liveexample{The following code shows an example for `back()`.,back}
+
+    @sa @ref front() -- access the first element
+
+    @since version 1.0.0
+    */
+    reference back();
+
+    /*!
+    @copydoc json::back()
+    */
+    const_reference back() const;
+
+    /*!
+    @brief remove element given an iterator
+
+    Removes the element specified by iterator @a pos. The iterator @a pos must
+    be valid and dereferenceable. Thus the `end()` iterator (which is valid,
+    but is not dereferenceable) cannot be used as a value for @a pos.
+
+    If called on a primitive type other than `null`, the resulting JSON value
+    will be `null`.
+
+    @param[in] pos iterator to the element to remove
+
+    @tparam IteratorType an @ref iterator or @ref const_iterator
+
+    @post Invalidates iterators and references at or after the point of the
+    erase, including the `end()` iterator.
+
+    @throw type_error.307 if called on a `null` value; example: `"cannot use
+    erase() with null"`
+    @throw invalid_iterator.202 if called on an iterator which does not belong
+    to the current JSON value; example: `"iterator does not fit current
+    value"`
+    @throw invalid_iterator.205 if called on a primitive type with invalid
+    iterator (i.e., any iterator which is not `begin()`); example: `"iterator
+    out of range"`
+
+    @complexity The complexity depends on the type:
+    - objects: amortized constant
+    - arrays: linear in distance between @a pos and the end of the container
+    - strings: linear in the length of the string
+    - other types: constant
+
+    @liveexample{The example shows the result of `erase()` for different JSON
+    types.,erase__IteratorType}
+
+    @sa @ref erase(IteratorType, IteratorType) -- removes the elements in
+    the given range
+    @sa @ref erase(llvm::StringRef) -- removes the element
+    from an object at the given key
+    @sa @ref erase(const size_type) -- removes the element from an array at
+    the given index
+
+    @since version 1.0.0
+    */
+    template<class IteratorType, typename std::enable_if<
+                 std::is_same<IteratorType, json::iterator>::value ||
+                 std::is_same<IteratorType, json::const_iterator>::value, int>::type
+             = 0>
+    void erase(IteratorType pos)
+    {
+        // make sure iterator fits the current value
+        if (this != pos.m_object)
+        {
+            JSON_THROW(invalid_iterator::create(202, "iterator does not fit current value"));
+        }
+
+        switch (m_type)
+        {
+            case value_t::boolean:
+            case value_t::number_float:
+            case value_t::number_integer:
+            case value_t::number_unsigned:
+            case value_t::string:
+            {
+                if (!pos.m_it.primitive_iterator.is_begin())
+                {
+                    JSON_THROW(invalid_iterator::create(205, "iterator out of range"));
+                }
+
+                if (is_string())
+                {
+                    std::allocator<std::string> alloc;
+                    alloc.destroy(m_value.string);
+                    alloc.deallocate(m_value.string, 1);
+                    m_value.string = nullptr;
+                }
+
+                m_type = value_t::null;
+                assert_invariant();
+                break;
+            }
+
+            case value_t::object:
+            {
+                m_value.object->erase(pos.m_it.object_iterator);
+                break;
+            }
+
+            case value_t::array:
+            {
+                m_value.array->erase(pos.m_it.array_iterator);
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(type_error::create(307, "cannot use erase() with " + type_name()));
+            }
+        }
+    }
+
+    /*!
+    @brief remove elements given an iterator range
+
+    Removes the element specified by the range `[first; last)`. The iterator
+    @a first does not need to be dereferenceable if `first == last`: erasing
+    an empty range is a no-op.
+
+    If called on a primitive type other than `null`, the resulting JSON value
+    will be `null`.
+
+    @param[in] first iterator to the beginning of the range to remove
+    @param[in] last iterator past the end of the range to remove
+    @return Iterator following the last removed element. If the iterator @a
+    second refers to the last element, the `end()` iterator is returned.
+
+    @tparam IteratorType an @ref iterator or @ref const_iterator
+
+    @post Invalidates iterators and references at or after the point of the
+    erase, including the `end()` iterator.
+
+    @throw type_error.307 if called on a `null` value; example: `"cannot use
+    erase() with null"`
+    @throw invalid_iterator.203 if called on iterators which does not belong
+    to the current JSON value; example: `"iterators do not fit current value"`
+    @throw invalid_iterator.204 if called on a primitive type with invalid
+    iterators (i.e., if `first != begin()` and `last != end()`); example:
+    `"iterators out of range"`
+
+    @complexity The complexity depends on the type:
+    - objects: `log(size()) + std::distance(first, last)`
+    - arrays: linear in the distance between @a first and @a last, plus linear
+      in the distance between @a last and end of the container
+    - strings: linear in the length of the string
+    - other types: constant
+
+    @liveexample{The example shows the result of `erase()` for different JSON
+    types.,erase__IteratorType_IteratorType}
+
+    @sa @ref erase(IteratorType) -- removes the element at a given position
+    @sa @ref erase(llvm::StringRef) -- removes the element
+    from an object at the given key
+    @sa @ref erase(const size_type) -- removes the element from an array at
+    the given index
+
+    @since version 1.0.0
+    */
+    template<class IteratorType, typename std::enable_if<
+                 std::is_same<IteratorType, json::iterator>::value ||
+                 std::is_same<IteratorType, json::const_iterator>::value, int>::type
+             = 0>
+    void erase(IteratorType first, IteratorType last)
+    {
+        // make sure iterator fits the current value
+        if (this != first.m_object || this != last.m_object)
+        {
+            JSON_THROW(invalid_iterator::create(203, "iterators do not fit current value"));
+        }
+
+        switch (m_type)
+        {
+            case value_t::boolean:
+            case value_t::number_float:
+            case value_t::number_integer:
+            case value_t::number_unsigned:
+            case value_t::string:
+            {
+                if (!first.m_it.primitive_iterator.is_begin() || !last.m_it.primitive_iterator.is_end())
+                {
+                    JSON_THROW(invalid_iterator::create(204, "iterators out of range"));
+                }
+
+                if (is_string())
+                {
+                    std::allocator<std::string> alloc;
+                    alloc.destroy(m_value.string);
+                    alloc.deallocate(m_value.string, 1);
+                    m_value.string = nullptr;
+                }
+
+                m_type = value_t::null;
+                assert_invariant();
+                break;
+            }
+
+            case value_t::array:
+            {
+                m_value.array->erase(first.m_it.array_iterator,
+                                     last.m_it.array_iterator);
+                break;
+            }
+
+            default:
+            {
+                JSON_THROW(type_error::create(307, "cannot use erase() with " + type_name()));
+            }
+        }
+    }
+
+    /*!
+    @brief remove element from a JSON object given a key
+
+    Removes elements from a JSON object with the key value @a key.
+
+    @param[in] key value of the elements to remove
+
+    @return Number of elements removed.
+    The return value will always be `0` (@a key was not
+    found) or `1` (@a key was found).
+
+    @post References and iterators to the erased elements are invalidated.
+    Other references and iterators are not affected.
+
+    @throw type_error.307 when called on a type other than JSON object;
+    example: `"cannot use erase() with null"`
+
+    @complexity `log(size()) + count(key)`
+
+    @liveexample{The example shows the effect of `erase()`.,erase__key_type}
+
+    @sa @ref erase(IteratorType) -- removes the element at a given position
+    @sa @ref erase(IteratorType, IteratorType) -- removes the elements in
+    the given range
+    @sa @ref erase(const size_type) -- removes the element from an array at
+    the given index
+
+    @since version 1.0.0
+    */
+    size_type erase(llvm::StringRef key);
+
+    /*!
+    @brief remove element from a JSON array given an index
+
+    Removes element from a JSON array at the index @a idx.
+
+    @param[in] idx index of the element to remove
+
+    @throw type_error.307 when called on a type other than JSON object;
+    example: `"cannot use erase() with null"`
+    @throw out_of_range.401 when `idx >= size()`; example: `"array index 17
+    is out of range"`
+
+    @complexity Linear in distance between @a idx and the end of the container.
+
+    @liveexample{The example shows the effect of `erase()`.,erase__size_type}
+
+    @sa @ref erase(IteratorType) -- removes the element at a given position
+    @sa @ref erase(IteratorType, IteratorType) -- removes the elements in
+    the given range
+    @sa @ref erase(llvm::StringRef) -- removes the element
+    from an object at the given key
+
+    @since version 1.0.0
+    */
+    void erase(const size_type idx);
+
+    /// @}
+
+
+    ////////////
+    // lookup //
+    ////////////
+
+    /// @name lookup
+    /// @{
+
+    /*!
+    @brief find an element in a JSON object
+
+    Finds an element in a JSON object with key equivalent to @a key. If the
+    element is not found or the JSON value is not an object, end() is
+    returned.
+
+    @note This method always returns @ref end() when executed on a JSON type
+          that is not an object.
+
+    @param[in] key key value of the element to search for
+
+    @return Iterator to an element with key equivalent to @a key. If no such
+    element is found or the JSON value is not an object, past-the-end (see
+    @ref end()) iterator is returned.
+
+    @complexity Logarithmic in the size of the JSON object.
+
+    @liveexample{The example shows how `find()` is used.,find__key_type}
+
+    @since version 1.0.0
+    */
+    iterator find(llvm::StringRef key);
+
+    /*!
+    @brief find an element in a JSON object
+    @copydoc find(llvm::StringRef)
+    */
+    const_iterator find(llvm::StringRef key) const;
+
+    /*!
+    @brief returns the number of occurrences of a key in a JSON object
+
+    Returns the number of elements with key @a key.
+    The return value will always be `0` (@a key was
+    not found) or `1` (@a key was found).
+
+    @note This method always returns `0` when executed on a JSON type that is
+          not an object.
+
+    @param[in] key key value of the element to count
+
+    @return Number of elements with key @a key. If the JSON value is not an
+    object, the return value will be `0`.
+
+    @complexity Logarithmic in the size of the JSON object.
+
+    @liveexample{The example shows how `count()` is used.,count}
+
+    @since version 1.0.0
+    */
+    size_type count(llvm::StringRef key) const
+    {
+        // return 0 for all nonobject types
+        return is_object() ? m_value.object->count(key) : 0;
+    }
+
+    /// @}
+
+
+    ///////////////
+    // iterators //
+    ///////////////
+
+    /// @name iterators
+    /// @{
+
+    /*!
+    @brief returns an iterator to the first element
+
+    Returns an iterator to the first element.
+
+    @image html range-begin-end.svg "Illustration from cppreference.com"
+
+    @return iterator to the first element
+
+    @complexity Constant.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+
+    @liveexample{The following code shows an example for `begin()`.,begin}
+
+    @sa @ref cbegin() -- returns a const iterator to the beginning
+    @sa @ref end() -- returns an iterator to the end
+    @sa @ref cend() -- returns a const iterator to the end
+
+    @since version 1.0.0
+    */
+    iterator begin() noexcept
+    {
+        iterator result(this);
+        result.set_begin();
+        return result;
+    }
+
+    /*!
+    @copydoc json::cbegin()
+    */
+    const_iterator begin() const noexcept
+    {
+        return cbegin();
+    }
+
+    /*!
+    @brief returns a const iterator to the first element
+
+    Returns a const iterator to the first element.
+
+    @image html range-begin-end.svg "Illustration from cppreference.com"
+
+    @return const iterator to the first element
+
+    @complexity Constant.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+    - Has the semantics of `const_cast<const json&>(*this).begin()`.
+
+    @liveexample{The following code shows an example for `cbegin()`.,cbegin}
+
+    @sa @ref begin() -- returns an iterator to the beginning
+    @sa @ref end() -- returns an iterator to the end
+    @sa @ref cend() -- returns a const iterator to the end
+
+    @since version 1.0.0
+    */
+    const_iterator cbegin() const noexcept
+    {
+        const_iterator result(this);
+        result.set_begin();
+        return result;
+    }
+
+    /*!
+    @brief returns an iterator to one past the last element
+
+    Returns an iterator to one past the last element.
+
+    @image html range-begin-end.svg "Illustration from cppreference.com"
+
+    @return iterator one past the last element
+
+    @complexity Constant.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+
+    @liveexample{The following code shows an example for `end()`.,end}
+
+    @sa @ref cend() -- returns a const iterator to the end
+    @sa @ref begin() -- returns an iterator to the beginning
+    @sa @ref cbegin() -- returns a const iterator to the beginning
+
+    @since version 1.0.0
+    */
+    iterator end() noexcept
+    {
+        iterator result(this);
+        result.set_end();
+        return result;
+    }
+
+    /*!
+    @copydoc json::cend()
+    */
+    const_iterator end() const noexcept
+    {
+        return cend();
+    }
+
+    /*!
+    @brief returns a const iterator to one past the last element
+
+    Returns a const iterator to one past the last element.
+
+    @image html range-begin-end.svg "Illustration from cppreference.com"
+
+    @return const iterator one past the last element
+
+    @complexity Constant.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+    - Has the semantics of `const_cast<const json&>(*this).end()`.
+
+    @liveexample{The following code shows an example for `cend()`.,cend}
+
+    @sa @ref end() -- returns an iterator to the end
+    @sa @ref begin() -- returns an iterator to the beginning
+    @sa @ref cbegin() -- returns a const iterator to the beginning
+
+    @since version 1.0.0
+    */
+    const_iterator cend() const noexcept
+    {
+        const_iterator result(this);
+        result.set_end();
+        return result;
+    }
+
+  private:
+    // forward declaration
+    template<typename IteratorType> class iteration_proxy;
+
+  public:
+    /*!
+    @brief wrapper to access iterator member functions in range-based for
+
+    This function allows to access @ref iterator::key() and @ref
+    iterator::value() during range-based for loops. In these loops, a
+    reference to the JSON values is returned, so there is no access to the
+    underlying iterator.
+
+    @liveexample{The following code shows how the wrapper is used,iterator_wrapper}
+
+    @note The name of this function is not yet final and may change in the
+    future.
+    */
+    static iteration_proxy<iterator> iterator_wrapper(reference cont)
+    {
+        return iteration_proxy<iterator>(cont);
+    }
+
+    /*!
+    @copydoc iterator_wrapper(reference)
+    */
+    static iteration_proxy<const_iterator> iterator_wrapper(const_reference cont)
+    {
+        return iteration_proxy<const_iterator>(cont);
+    }
+
+    /// @}
+
+
+    //////////////
+    // capacity //
+    //////////////
+
+    /// @name capacity
+    /// @{
+
+    /*!
+    @brief checks whether the container is empty
+
+    Checks if a JSON value has no elements.
+
+    @return The return value depends on the different types and is
+            defined as follows:
+            Value type  | return value
+            ----------- | -------------
+            null        | `true`
+            boolean     | `false`
+            string      | `false`
+            number      | `false`
+            object      | result of function `object_t::empty()`
+            array       | result of function `array_t::empty()`
+
+    @note This function does not return whether a string stored as JSON value
+    is empty - it returns whether the JSON container itself is empty which is
+    false in the case of a string.
+
+    @complexity Constant, as long as @ref array_t and @ref object_t satisfy
+    the Container concept; that is, their `empty()` functions have constant
+    complexity.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+    - Has the semantics of `begin() == end()`.
+
+    @liveexample{The following code uses `empty()` to check if a JSON
+    object contains any elements.,empty}
+
+    @sa @ref size() -- returns the number of elements
+
+    @since version 1.0.0
+    */
+    bool empty() const noexcept;
+
+    /*!
+    @brief returns the number of elements
+
+    Returns the number of elements in a JSON value.
+
+    @return The return value depends on the different types and is
+            defined as follows:
+            Value type  | return value
+            ----------- | -------------
+            null        | `0`
+            boolean     | `1`
+            string      | `1`
+            number      | `1`
+            object      | result of function object_t::size()
+            array       | result of function array_t::size()
+
+    @note This function does not return the length of a string stored as JSON
+    value - it returns the number of elements in the JSON value which is 1 in
+    the case of a string.
+
+    @complexity Constant, as long as @ref array_t and @ref object_t satisfy
+    the Container concept; that is, their size() functions have constant
+    complexity.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+    - Has the semantics of `std::distance(begin(), end())`.
+
+    @liveexample{The following code calls `size()` on the different value
+    types.,size}
+
+    @sa @ref empty() -- checks whether the container is empty
+    @sa @ref max_size() -- returns the maximal number of elements
+
+    @since version 1.0.0
+    */
+    size_type size() const noexcept;
+
+    /*!
+    @brief returns the maximum possible number of elements
+
+    Returns the maximum number of elements a JSON value is able to hold due to
+    system or library implementation limitations, i.e. `std::distance(begin(),
+    end())` for the JSON value.
+
+    @return The return value depends on the different types and is
+            defined as follows:
+            Value type  | return value
+            ----------- | -------------
+            null        | `0` (same as `size()`)
+            boolean     | `1` (same as `size()`)
+            string      | `1` (same as `size()`)
+            number      | `1` (same as `size()`)
+            object      | result of function `object_t::max_size()`
+            array       | result of function `array_t::max_size()`
+
+    @complexity Constant, as long as @ref array_t and @ref object_t satisfy
+    the Container concept; that is, their `max_size()` functions have constant
+    complexity.
+
+    @requirement This function helps `json` satisfying the
+    [Container](http://en.cppreference.com/w/cpp/concept/Container)
+    requirements:
+    - The complexity is constant.
+    - Has the semantics of returning `b.size()` where `b` is the largest
+      possible JSON value.
+
+    @liveexample{The following code calls `max_size()` on the different value
+    types. Note the output is implementation specific.,max_size}
+
+    @sa @ref size() -- returns the number of elements
+
+    @since version 1.0.0
+    */
+    size_type max_size() const noexcept;
+
+    /// @}
+
+
+    ///////////////
+    // modifiers //
+    ///////////////
+
+    /// @name modifiers
+    /// @{
+
+    /*!
+    @brief clears the contents
+
+    Clears the content of a JSON value and resets it to the default value as
+    if @ref json(value_t) would have been called:
+
+    Value type  | initial value
+    ----------- | -------------
+    null        | `null`
+    boolean     | `false`
+    string      | `""`
+    number      | `0`
+    object      | `{}`
+    array       | `[]`
+
+    @complexity Linear in the size of the JSON value.
+
+    @liveexample{The example below shows the effect of `clear()` to different
+    JSON types.,clear}
+
+    @since version 1.0.0
+    */
+    void clear() noexcept;
+
+    /*!
+    @brief add an object to an array
+
+    Appends the given element @a val to the end of the JSON value. If the
+    function is called on a JSON null value, an empty array is created before
+    appending @a val.
+
+    @param[in] val the value to add to the JSON array
+
+    @throw type_error.308 when called on a type other than JSON array or
+    null; example: `"cannot use push_back() with number"`
+
+    @complexity Amortized constant.
+
+    @liveexample{The example shows how `push_back()` and `+=` can be used to
+    add elements to a JSON array. Note how the `null` value was silently
+    converted to a JSON array.,push_back}
+
+    @since version 1.0.0
+    */
+    void push_back(json&& val);
+
+    /*!
+    @brief add an object to an array
+    @copydoc push_back(json&&)
+    */
+    reference operator+=(json&& val)
+    {
+        push_back(std::move(val));
+        return *this;
+    }
+
+    /*!
+    @brief add an object to an array
+    @copydoc push_back(json&&)
+    */
+    void push_back(const json& val);
+
+    /*!
+    @brief add an object to an array
+    @copydoc push_back(json&&)
+    */
+    reference operator+=(const json& val)
+    {
+        push_back(val);
+        return *this;
+    }
+
+    /*!
+    @brief add an object to an object
+
+    Inserts the given element @a val to the JSON object. If the function is
+    called on a JSON null value, an empty object is created before inserting
+    @a val.
+
+    @param[in] val the value to add to the JSON object
+
+    @throw type_error.308 when called on a type other than JSON object or
+    null; example: `"cannot use push_back() with number"`
+
+    @complexity Logarithmic in the size of the container, O(log(`size()`)).
+
+    @liveexample{The example shows how `push_back()` and `+=` can be used to
+    add elements to a JSON object. Note how the `null` value was silently
+    converted to a JSON object.,push_back__object_t__value}
+
+    @since version 1.0.0
+    */
+    void push_back(const std::pair<llvm::StringRef, json>& val);
+
+    /*!
+    @brief add an object to an object
+    @copydoc push_back(const typename object_t::value_type&)
+    */
+    reference operator+=(const std::pair<llvm::StringRef, json>& val)
+    {
+        push_back(val);
+        return *this;
+    }
+
+    /*!
+    @brief add an object to an object
+
+    This function allows to use `push_back` with an initializer list. In case
+
+    1. the current value is an object,
+    2. the initializer list @a init contains only two elements, and
+    3. the first element of @a init is a string,
+
+    @a init is converted into an object element and added using
+    @ref push_back(const typename object_t::value_type&). Otherwise, @a init
+    is converted to a JSON value and added using @ref push_back(json&&).
+
+    @param[in] init  an initializer list
+
+    @complexity Linear in the size of the initializer list @a init.
+
+    @note This function is required to resolve an ambiguous overload error,
+          because pairs like `{"key", "value"}` can be both interpreted as
+          `object_t::value_type` or `std::initializer_list<json>`, see
+          https://github.com/nlohmann/json/issues/235 for more information.
+
+    @liveexample{The example shows how initializer lists are treated as
+    objects when possible.,push_back__initializer_list}
+    */
+    void push_back(std::initializer_list<json> init);
+
+    /*!
+    @brief add an object to an object
+    @copydoc push_back(std::initializer_list<json>)
+    */
+    reference operator+=(std::initializer_list<json> init)
+    {
+        push_back(init);
+        return *this;
+    }
+
+    /*!
+    @brief add an object to an array
+
+    Creates a JSON value from the passed parameters @a args to the end of the
+    JSON value. If the function is called on a JSON null value, an empty array
+    is created before appending the value created from @a args.
+
+    @param[in] args arguments to forward to a constructor of @ref json
+    @tparam Args compatible types to create a @ref json object
+
+    @throw type_error.311 when called on a type other than JSON array or
+    null; example: `"cannot use emplace_back() with number"`
+
+    @complexity Amortized constant.
+
+    @liveexample{The example shows how `push_back()` can be used to add
+    elements to a JSON array. Note how the `null` value was silently converted
+    to a JSON array.,emplace_back}
+
+    @since version 2.0.8
+    */
+    template<class... Args>
+    void emplace_back(Args&& ... args)
+    {
+        // emplace_back only works for null objects or arrays
+        if (!(is_null() || is_array()))
+        {
+            JSON_THROW(type_error::create(311, "cannot use emplace_back() with " + type_name()));
+        }
+
+        // transform null object into an array
+        if (is_null())
+        {
+            m_type = value_t::array;
+            m_value = value_t::array;
+            assert_invariant();
+        }
+
+        // add element to array (perfect forwarding)
+        m_value.array->emplace_back(std::forward<Args>(args)...);
+    }
+
+    /*!
+    @brief add an object to an object if key does not exist
+
+    Inserts a new element into a JSON object constructed in-place with the
+    given @a args if there is no element with the key in the container. If the
+    function is called on a JSON null value, an empty object is created before
+    appending the value created from @a args.
+
+    @param[in] args arguments to forward to a constructor of @ref json
+    @tparam Args compatible types to create a @ref json object
+
+    @return a pair consisting of an iterator to the inserted element, or the
+            already-existing element if no insertion happened, and a bool
+            denoting whether the insertion took place.
+
+    @throw type_error.311 when called on a type other than JSON object or
+    null; example: `"cannot use emplace() with number"`
+
+    @complexity Logarithmic in the size of the container, O(log(`size()`)).
+
+    @liveexample{The example shows how `emplace()` can be used to add elements
+    to a JSON object. Note how the `null` value was silently converted to a
+    JSON object. Further note how no value is added if there was already one
+    value stored with the same key.,emplace}
+
+    @since version 2.0.8
+    */
+    template<class... Args>
+    std::pair<iterator, bool> emplace(llvm::StringRef key, Args&& ... args)
+    {
+        // emplace only works for null objects or arrays
+        if (!(is_null() || is_object()))
+        {
+            JSON_THROW(type_error::create(311, "cannot use emplace() with " + type_name()));
+        }
+
+        // transform null object into an object
+        if (is_null())
+        {
+            m_type = value_t::object;
+            m_value = value_t::object;
+            assert_invariant();
+        }
+
+        // add element to array (perfect forwarding)
+        auto res = m_value.object->emplace_second(key, std::forward<Args>(args)...);
+        // create result iterator and set iterator to the result of emplace
+        auto it = begin();
+        it.m_it.object_iterator = res.first;
+
+        // return pair of iterator and boolean
+        return {it, res.second};
+    }
+
+    /*!
+    @brief inserts element
+
+    Inserts element @a val before iterator @a pos.
+
+    @param[in] pos iterator before which the content will be inserted; may be
+    the end() iterator
+    @param[in] val element to insert
+    @return iterator pointing to the inserted @a val.
+
+    @throw type_error.309 if called on JSON values other than arrays;
+    example: `"cannot use insert() with string"`
+    @throw invalid_iterator.202 if @a pos is not an iterator of *this;
+    example: `"iterator does not fit current value"`
+
+    @complexity Constant plus linear in the distance between @a pos and end of
+    the container.
+
+    @liveexample{The example shows how `insert()` is used.,insert}
+
+    @since version 1.0.0
+    */
+    iterator insert(const_iterator pos, const json& val);
+
+    /*!
+    @brief inserts element
+    @copydoc insert(const_iterator, const json&)
+    */
+    iterator insert(const_iterator pos, json&& val)
+    {
+        return insert(pos, val);
+    }
+
+    /*!
+    @brief inserts elements
+
+    Inserts @a cnt copies of @a val before iterator @a pos.
+
+    @param[in] pos iterator before which the content will be inserted; may be
+    the end() iterator
+    @param[in] cnt number of copies of @a val to insert
+    @param[in] val element to insert
+    @return iterator pointing to the first element inserted, or @a pos if
+    `cnt==0`
+
+    @throw type_error.309 if called on JSON values other than arrays; example:
+    `"cannot use insert() with string"`
+    @throw invalid_iterator.202 if @a pos is not an iterator of *this;
+    example: `"iterator does not fit current value"`
+
+    @complexity Linear in @a cnt plus linear in the distance between @a pos
+    and end of the container.
+
+    @liveexample{The example shows how `insert()` is used.,insert__count}
+
+    @since version 1.0.0
+    */
+    iterator insert(const_iterator pos, size_type cnt, const json& val);
+
+    /*!
+    @brief inserts elements
+
+    Inserts elements from range `[first, last)` before iterator @a pos.
+
+    @param[in] pos iterator before which the content will be inserted; may be
+    the end() iterator
+    @param[in] first begin of the range of elements to insert
+    @param[in] last end of the range of elements to insert
+
+    @throw type_error.309 if called on JSON values other than arrays; example:
+    `"cannot use insert() with string"`
+    @throw invalid_iterator.202 if @a pos is not an iterator of *this;
+    example: `"iterator does not fit current value"`
+    @throw invalid_iterator.210 if @a first and @a last do not belong to the
+    same JSON value; example: `"iterators do not fit"`
+    @throw invalid_iterator.211 if @a first or @a last are iterators into
+    container for which insert is called; example: `"passed iterators may not
+    belong to container"`
+
+    @return iterator pointing to the first element inserted, or @a pos if
+    `first==last`
+
+    @complexity Linear in `std::distance(first, last)` plus linear in the
+    distance between @a pos and end of the container.
+
+    @liveexample{The example shows how `insert()` is used.,insert__range}
+
+    @since version 1.0.0
+    */
+    iterator insert(const_iterator pos, const_iterator first, const_iterator last);
+
+    /*!
+    @brief inserts elements
+
+    Inserts elements from initializer list @a ilist before iterator @a pos.
+
+    @param[in] pos iterator before which the content will be inserted; may be
+    the end() iterator
+    @param[in] ilist initializer list to insert the values from
+
+    @throw type_error.309 if called on JSON values other than arrays; example:
+    `"cannot use insert() with string"`
+    @throw invalid_iterator.202 if @a pos is not an iterator of *this;
+    example: `"iterator does not fit current value"`
+
+    @return iterator pointing to the first element inserted, or @a pos if
+    `ilist` is empty
+
+    @complexity Linear in `ilist.size()` plus linear in the distance between
+    @a pos and end of the container.
+
+    @liveexample{The example shows how `insert()` is used.,insert__ilist}
+
+    @since version 1.0.0
+    */
+    iterator insert(const_iterator pos, std::initializer_list<json> ilist);
+
+    /*!
+    @brief inserts elements
+
+    Inserts elements from range `[first, last)`.
+
+    @param[in] first begin of the range of elements to insert
+    @param[in] last end of the range of elements to insert
+
+    @throw type_error.309 if called on JSON values other than objects; example:
+    `"cannot use insert() with string"`
+    @throw invalid_iterator.202 if iterator @a first or @a last does does not
+    point to an object; example: `"iterators first and last must point to
+    objects"`
+    @throw invalid_iterator.210 if @a first and @a last do not belong to the
+    same JSON value; example: `"iterators do not fit"`
+
+    @complexity Logarithmic: `O(N*log(size() + N))`, where `N` is the number
+    of elements to insert.
+
+    @liveexample{The example shows how `insert()` is used.,insert__range_object}
+
+    @since version 3.0.0
+    */
+    void insert(const_iterator first, const_iterator last);
+
+    /*!
+    @brief exchanges the values
+
+    Exchanges the contents of the JSON value with those of @a other. Does not
+    invoke any move, copy, or swap operations on individual elements. All
+    iterators and references remain valid. The past-the-end iterator is
+    invalidated.
+
+    @param[in,out] other JSON value to exchange the contents with
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how JSON values can be swapped with
+    `swap()`.,swap__reference}
+
+    @since version 1.0.0
+    */
+    void swap(reference other) noexcept (
+        std::is_nothrow_move_constructible<value_t>::value &&
+        std::is_nothrow_move_assignable<value_t>::value &&
+        std::is_nothrow_move_constructible<json_value>::value &&
+        std::is_nothrow_move_assignable<json_value>::value
+    )
+    {
+        std::swap(m_type, other.m_type);
+        std::swap(m_value, other.m_value);
+        assert_invariant();
+    }
+
+    /*!
+    @brief exchanges the values
+
+    Exchanges the contents of a JSON array with those of @a other. Does not
+    invoke any move, copy, or swap operations on individual elements. All
+    iterators and references remain valid. The past-the-end iterator is
+    invalidated.
+
+    @param[in,out] other array to exchange the contents with
+
+    @throw type_error.310 when JSON value is not an array; example: `"cannot
+    use swap() with string"`
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how arrays can be swapped with
+    `swap()`.,swap__array_t}
+
+    @since version 1.0.0
+    */
+    void swap(array_t& other)
+    {
+        // swap only works for arrays
+        if (is_array())
+        {
+            std::swap(*(m_value.array), other);
+        }
+        else
+        {
+            JSON_THROW(type_error::create(310, "cannot use swap() with " + type_name()));
+        }
+    }
+
+    /*!
+    @brief exchanges the values
+
+    Exchanges the contents of a JSON object with those of @a other. Does not
+    invoke any move, copy, or swap operations on individual elements. All
+    iterators and references remain valid. The past-the-end iterator is
+    invalidated.
+
+    @param[in,out] other object to exchange the contents with
+
+    @throw type_error.310 when JSON value is not an object; example:
+    `"cannot use swap() with string"`
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how objects can be swapped with
+    `swap()`.,swap__object_t}
+
+    @since version 1.0.0
+    */
+    void swap(object_t& other)
+    {
+        // swap only works for objects
+        if (is_object())
+        {
+            std::swap(*(m_value.object), other);
+        }
+        else
+        {
+            JSON_THROW(type_error::create(310, "cannot use swap() with " + type_name()));
+        }
+    }
+
+    /*!
+    @brief exchanges the values
+
+    Exchanges the contents of a JSON string with those of @a other. Does not
+    invoke any move, copy, or swap operations on individual elements. All
+    iterators and references remain valid. The past-the-end iterator is
+    invalidated.
+
+    @param[in,out] other string to exchange the contents with
+
+    @throw type_error.310 when JSON value is not a string; example: `"cannot
+    use swap() with boolean"`
+
+    @complexity Constant.
+
+    @liveexample{The example below shows how strings can be swapped with
+    `swap()`.,swap__std::string}
+
+    @since version 1.0.0
+    */
+    void swap(std::string& other)
+    {
+        // swap only works for strings
+        if (is_string())
+        {
+            std::swap(*(m_value.string), other);
+        }
+        else
+        {
+            JSON_THROW(type_error::create(310, "cannot use swap() with " + type_name()));
+        }
+    }
+
+    /// @}
+
+  public:
+    //////////////////////////////////////////
+    // lexicographical comparison operators //
+    //////////////////////////////////////////
+
+    /// @name lexicographical comparison operators
+    /// @{
+
+    /*!
+    @brief comparison: equal
+
+    Compares two JSON values for equality according to the following rules:
+    - Two JSON values are equal if (1) they are from the same type and (2)
+      their stored values are the same according to their respective
+      `operator==`.
+    - Integer and floating-point numbers are automatically converted before
+      comparison. Floating-point numbers are compared indirectly: two
+      floating-point numbers `f1` and `f2` are considered equal if neither
+      `f1 > f2` nor `f2 > f1` holds. Note than two NaN values are always
+      treated as unequal.
+    - Two JSON null values are equal.
+
+    @note NaN values never compare equal to themselves or to other NaN values.
+
+    @param[in] lhs  first JSON value to consider
+    @param[in] rhs  second JSON value to consider
+    @return whether the values @a lhs and @a rhs are equal
+
+    @complexity Linear.
+
+    @liveexample{The example demonstrates comparing several JSON
+    types.,operator__equal}
+
+    @since version 1.0.0
+    */
+    friend bool operator==(const_reference lhs, const_reference rhs) noexcept;
+
+    /*!
+    @brief comparison: equal
+    @copydoc operator==(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept
+    {
+        return (lhs == json(rhs));
+    }
+
+    /*!
+    @brief comparison: equal
+    @copydoc operator==(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept
+    {
+        return (json(lhs) == rhs);
+    }
+
+    /*!
+    @brief comparison: not equal
+
+    Compares two JSON values for inequality by calculating `not (lhs == rhs)`.
+
+    @param[in] lhs  first JSON value to consider
+    @param[in] rhs  second JSON value to consider
+    @return whether the values @a lhs and @a rhs are not equal
+
+    @complexity Linear.
+
+    @liveexample{The example demonstrates comparing several JSON
+    types.,operator__notequal}
+
+    @since version 1.0.0
+    */
+    friend bool operator!=(const_reference lhs, const_reference rhs) noexcept
+    {
+        return !(lhs == rhs);
+    }
+
+    /*!
+    @brief comparison: not equal
+    @copydoc operator!=(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator!=(const_reference lhs, const ScalarType rhs) noexcept
+    {
+        return (lhs != json(rhs));
+    }
+
+    /*!
+    @brief comparison: not equal
+    @copydoc operator!=(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator!=(const ScalarType lhs, const_reference rhs) noexcept
+    {
+        return (json(lhs) != rhs);
+    }
+
+    /*!
+    @brief comparison: less than
+
+    Compares whether one JSON value @a lhs is less than another JSON value @a
+    rhs according to the following rules:
+    - If @a lhs and @a rhs have the same type, the values are compared using
+      the default `<` operator.
+    - Integer and floating-point numbers are automatically converted before
+      comparison
+    - In case @a lhs and @a rhs have different types, the values are ignored
+      and the order of the types is considered, see
+      @ref operator<(const value_t, const value_t).
+
+    @param[in] lhs  first JSON value to consider
+    @param[in] rhs  second JSON value to consider
+    @return whether @a lhs is less than @a rhs
+
+    @complexity Linear.
+
+    @liveexample{The example demonstrates comparing several JSON
+    types.,operator__less}
+
+    @since version 1.0.0
+    */
+    friend bool operator<(const_reference lhs, const_reference rhs) noexcept;
+
+    /*!
+    @brief comparison: less than
+    @copydoc operator<(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator<(const_reference lhs, const ScalarType rhs) noexcept
+    {
+        return (lhs < json(rhs));
+    }
+
+    /*!
+    @brief comparison: less than
+    @copydoc operator<(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator<(const ScalarType lhs, const_reference rhs) noexcept
+    {
+        return (json(lhs) < rhs);
+    }
+
+    /*!
+    @brief comparison: less than or equal
+
+    Compares whether one JSON value @a lhs is less than or equal to another
+    JSON value by calculating `not (rhs < lhs)`.
+
+    @param[in] lhs  first JSON value to consider
+    @param[in] rhs  second JSON value to consider
+    @return whether @a lhs is less than or equal to @a rhs
+
+    @complexity Linear.
+
+    @liveexample{The example demonstrates comparing several JSON
+    types.,operator__greater}
+
+    @since version 1.0.0
+    */
+    friend bool operator<=(const_reference lhs, const_reference rhs) noexcept
+    {
+        return !(rhs < lhs);
+    }
+
+    /*!
+    @brief comparison: less than or equal
+    @copydoc operator<=(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator<=(const_reference lhs, const ScalarType rhs) noexcept
+    {
+        return (lhs <= json(rhs));
+    }
+
+    /*!
+    @brief comparison: less than or equal
+    @copydoc operator<=(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator<=(const ScalarType lhs, const_reference rhs) noexcept
+    {
+        return (json(lhs) <= rhs);
+    }
+
+    /*!
+    @brief comparison: greater than
+
+    Compares whether one JSON value @a lhs is greater than another
+    JSON value by calculating `not (lhs <= rhs)`.
+
+    @param[in] lhs  first JSON value to consider
+    @param[in] rhs  second JSON value to consider
+    @return whether @a lhs is greater than to @a rhs
+
+    @complexity Linear.
+
+    @liveexample{The example demonstrates comparing several JSON
+    types.,operator__lessequal}
+
+    @since version 1.0.0
+    */
+    friend bool operator>(const_reference lhs, const_reference rhs) noexcept
+    {
+        return !(lhs <= rhs);
+    }
+
+    /*!
+    @brief comparison: greater than
+    @copydoc operator>(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator>(const_reference lhs, const ScalarType rhs) noexcept
+    {
+        return (lhs > json(rhs));
+    }
+
+    /*!
+    @brief comparison: greater than
+    @copydoc operator>(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator>(const ScalarType lhs, const_reference rhs) noexcept
+    {
+        return (json(lhs) > rhs);
+    }
+
+    /*!
+    @brief comparison: greater than or equal
+
+    Compares whether one JSON value @a lhs is greater than or equal to another
+    JSON value by calculating `not (lhs < rhs)`.
+
+    @param[in] lhs  first JSON value to consider
+    @param[in] rhs  second JSON value to consider
+    @return whether @a lhs is greater than or equal to @a rhs
+
+    @complexity Linear.
+
+    @liveexample{The example demonstrates comparing several JSON
+    types.,operator__greaterequal}
+
+    @since version 1.0.0
+    */
+    friend bool operator>=(const_reference lhs, const_reference rhs) noexcept
+    {
+        return !(lhs < rhs);
+    }
+
+    /*!
+    @brief comparison: greater than or equal
+    @copydoc operator>=(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator>=(const_reference lhs, const ScalarType rhs) noexcept
+    {
+        return (lhs >= json(rhs));
+    }
+
+    /*!
+    @brief comparison: greater than or equal
+    @copydoc operator>=(const_reference, const_reference)
+    */
+    template<typename ScalarType, typename std::enable_if<
+                 std::is_scalar<ScalarType>::value, int>::type = 0>
+    friend bool operator>=(const ScalarType lhs, const_reference rhs) noexcept
+    {
+        return (json(lhs) >= rhs);
+    }
+
+    /// @}
+
+    ///////////////////
+    // serialization //
+    ///////////////////
+
+    /// @name serialization
+    /// @{
+
+  public:
+    /*!
+    @brief serialize to stream
+
+    Serialize the given JSON value @a j to the output stream @a o. The JSON
+    value will be serialized using the @ref dump member function.
+
+    - The indentation of the output can be controlled with the member variable
+      `width` of the output stream @a o. For instance, using the manipulator
+      `std::setw(4)` on @a o sets the indentation level to `4` and the
+      serialization result is the same as calling `dump(4)`.
+
+    - The indentation characrer can be controlled with the member variable
+      `fill` of the output stream @a o. For instance, the manipulator
+      `std::setfill('\\t')` sets indentation to use a tab character rather than
+      the default space character.
+
+    @param[in,out] o  stream to serialize to
+    @param[in] j  JSON value to serialize
+
+    @return the stream @a o
+
+    @complexity Linear.
+
+    @liveexample{The example below shows the serialization with different
+    parameters to `width` to adjust the indentation level.,operator_serialize}
+
+    @since version 1.0.0; indentaction character added in version 3.0.0
+    */
+    friend llvm::raw_ostream& operator<<(llvm::raw_ostream& o, const json& j);
+
+    /// @}
+
+
+    /////////////////////
+    // deserialization //
+    /////////////////////
+
+    /// @name deserialization
+    /// @{
+
+    /*!
+    @brief deserialize from string literal
+
+    @tparam CharT character/literal type with size of 1 byte
+    @param[in] s  string literal to read a serialized JSON value from
+    @param[in] cb a parser callback function of type @ref parser_callback_t
+    which is used to control the deserialization by filtering unwanted values
+    (optional)
+
+    @return result of the deserialization
+
+    @throw parse_error.101 in case of an unexpected token
+    @throw parse_error.102 if to_unicode fails or surrogate error
+    @throw parse_error.103 if to_unicode fails
+
+    @complexity Linear in the length of the input. The parser is a predictive
+    LL(1) parser. The complexity can be higher if the parser callback function
+    @a cb has a super-linear complexity.
+
+    @note A UTF-8 byte order mark is silently ignored.
+    @note String containers like `std::string` can be parsed
+          with @ref parse(const ContiguousContainer&, const parser_callback_t)
+
+    @liveexample{The example below demonstrates the `parse()` function with
+    and without callback function.,parse__string__parser_callback_t}
+
+    @sa @ref parse(wpi::raw_istream&, const parser_callback_t) for a version
+    that reads from an input stream
+
+    @since version 1.0.0 (originally for std::string)
+    */
+    static json parse(llvm::StringRef s,
+                            const parser_callback_t cb = nullptr);
+
+    /*!
+    @brief deserialize from stream
+
+    @param[in,out] i  stream to read a serialized JSON value from
+    @param[in] cb a parser callback function of type @ref parser_callback_t
+    which is used to control the deserialization by filtering unwanted values
+    (optional)
+
+    @return result of the deserialization
+
+    @throw parse_error.101 in case of an unexpected token
+    @throw parse_error.102 if to_unicode fails or surrogate error
+    @throw parse_error.103 if to_unicode fails
+    @throw parse_error.111 if input stream is in a bad state
+
+    @complexity Linear in the length of the input. The parser is a predictive
+    LL(1) parser. The complexity can be higher if the parser callback function
+    @a cb has a super-linear complexity.
+
+    @note A UTF-8 byte order mark is silently ignored.
+
+    @liveexample{The example below demonstrates the `parse()` function with
+    and without callback function.,parse__raw_istream__parser_callback_t}
+
+    @sa @ref parse(const CharT, const parser_callback_t) for a version
+    that reads from a string
+
+    @since version 1.0.0
+    */
+    static json parse(wpi::raw_istream& i,
+                            const parser_callback_t cb = nullptr);
+
+    /*!
+    @brief deserialize from stream
+
+    Deserializes an input stream to a JSON value.
+
+    @param[in,out] i  input stream to read a serialized JSON value from
+    @param[in,out] j  JSON value to write the deserialized input to
+
+    @throw parse_error.101 in case of an unexpected token
+    @throw parse_error.102 if to_unicode fails or surrogate error
+    @throw parse_error.103 if to_unicode fails
+    @throw parse_error.111 if input stream is in a bad state
+
+    @complexity Linear in the length of the input. The parser is a predictive
+    LL(1) parser.
+
+    @note A UTF-8 byte order mark is silently ignored.
+
+    @liveexample{The example below shows how a JSON value is constructed by
+    reading a serialization from a stream.,operator_deserialize}
+
+    @sa parse(wpi::raw_istream&, const parser_callback_t) for a variant with a
+    parser callback function to filter values while parsing
+
+    @since version 1.0.0
+    */
+    friend wpi::raw_istream& operator>>(wpi::raw_istream& i, json& j);
+
+    /// @}
+
+    ///////////////////////////
+    // convenience functions //
+    ///////////////////////////
+
+    /*!
+    @brief return the type as string
+
+    Returns the type name as string to be used in error messages - usually to
+    indicate that a function was called on a wrong JSON type.
+
+    @return basically a string representation of a the @a m_type member
+
+    @complexity Constant.
+
+    @liveexample{The following code exemplifies `type_name()` for all JSON
+    types.,type_name}
+
+    @since version 1.0.0, public since 2.1.0
+    */
+    std::string type_name() const;
+
+  private:
+    //////////////////////
+    // member variables //
+    //////////////////////
+
+    /// the type of the current element
+    value_t m_type = value_t::null;
+
+    /// the value of the current element
+    json_value m_value = {};
+
+
+  private:
+    ///////////////
+    // iterators //
+    ///////////////
+
+    /*!
+    @brief an iterator for primitive JSON types
+
+    This class models an iterator for primitive JSON types (boolean, number,
+    string). It's only purpose is to allow the iterator/const_iterator classes
+    to "iterate" over primitive values. Internally, the iterator is modeled by
+    a `difference_type` variable. Value begin_value (`0`) models the begin,
+    end_value (`1`) models past the end.
+    */
+    class primitive_iterator_t
+    {
+      public:
+
+        difference_type get_value() const noexcept
+        {
+            return m_it;
+        }
+        /// set iterator to a defined beginning
+        void set_begin() noexcept
+        {
+            m_it = begin_value;
+        }
+
+        /// set iterator to a defined past the end
+        void set_end() noexcept
+        {
+            m_it = end_value;
+        }
+
+        /// return whether the iterator can be dereferenced
+        constexpr bool is_begin() const noexcept
+        {
+            return (m_it == begin_value);
+        }
+
+        /// return whether the iterator is at end
+        constexpr bool is_end() const noexcept
+        {
+            return (m_it == end_value);
+        }
+
+        friend constexpr bool operator==(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return lhs.m_it == rhs.m_it;
+        }
+
+        friend constexpr bool operator!=(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return !(lhs == rhs);
+        }
+
+        friend constexpr bool operator<(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return lhs.m_it < rhs.m_it;
+        }
+
+        friend constexpr bool operator<=(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return lhs.m_it <= rhs.m_it;
+        }
+
+        friend constexpr bool operator>(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return lhs.m_it > rhs.m_it;
+        }
+
+        friend constexpr bool operator>=(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return lhs.m_it >= rhs.m_it;
+        }
+
+        primitive_iterator_t operator+(difference_type i)
+        {
+            auto result = *this;
+            result += i;
+            return result;
+        }
+
+        friend constexpr difference_type operator-(primitive_iterator_t lhs, primitive_iterator_t rhs) noexcept
+        {
+            return lhs.m_it - rhs.m_it;
+        }
+
+        friend llvm::raw_ostream& operator<<(llvm::raw_ostream& os, primitive_iterator_t it)
+        {
+            return os << it.m_it;
+        }
+
+        primitive_iterator_t& operator++()
+        {
+            ++m_it;
+            return *this;
+        }
+
+        primitive_iterator_t operator++(int)
+        {
+            auto result = *this;
+            m_it++;
+            return result;
+        }
+
+        primitive_iterator_t& operator--()
+        {
+            --m_it;
+            return *this;
+        }
+
+        primitive_iterator_t operator--(int)
+        {
+            auto result = *this;
+            m_it--;
+            return result;
+        }
+
+        primitive_iterator_t& operator+=(difference_type n)
+        {
+            m_it += n;
+            return *this;
+        }
+
+        primitive_iterator_t& operator-=(difference_type n)
+        {
+            m_it -= n;
+            return *this;
+        }
+
+      private:
+        static constexpr difference_type begin_value = 0;
+        static constexpr difference_type end_value = begin_value + 1;
+
+        /// iterator as signed integer type
+        difference_type m_it = std::numeric_limits<std::ptrdiff_t>::denorm_min();
+    };
+
+    /*!
+    @brief an iterator value
+
+    @note This structure could easily be a union, but MSVC currently does not
+    allow unions members with complex constructors, see
+    https://github.com/nlohmann/json/pull/105.
+    */
+    struct internal_iterator
+    {
+        /// iterator for JSON objects
+        typename object_t::iterator object_iterator;
+        /// iterator for JSON arrays
+        typename array_t::iterator array_iterator;
+        /// generic iterator for all other types
+        primitive_iterator_t primitive_iterator;
+
+        /// create an uninitialized internal_iterator
+        internal_iterator() noexcept
+            : object_iterator(), array_iterator(), primitive_iterator()
+        {}
+    };
+
+    /// proxy class for the iterator_wrapper functions
+    template<typename IteratorType>
+    class iteration_proxy
+    {
+      private:
+        /// helper class for iteration
+        class iteration_proxy_internal
+        {
+          private:
+            /// the iterator
+            IteratorType anchor;
+            /// an index for arrays (used to create key names)
+            size_t array_index = 0;
+
+          public:
+            explicit iteration_proxy_internal(IteratorType it) noexcept
+                : anchor(it)
+            {}
+
+            /// dereference operator (needed for range-based for)
+            iteration_proxy_internal& operator*()
+            {
+                return *this;
+            }
+
+            /// increment operator (needed for range-based for)
+            iteration_proxy_internal& operator++()
+            {
+                ++anchor;
+                ++array_index;
+
+                return *this;
+            }
+
+            /// inequality operator (needed for range-based for)
+            bool operator!= (const iteration_proxy_internal& o) const
+            {
+                return anchor != o.anchor;
+            }
+
+            /// return key of the iterator
+            std::string key() const
+            {
+                assert(anchor.m_object != nullptr);
+
+                switch (anchor.m_object->type())
+                {
+                    // use integer array index as key
+                    case value_t::array:
+                    {
+                        return std::to_string(array_index);
+                    }
+
+                    // use key from the object
+                    case value_t::object:
+                    {
+                        return anchor.key();
+                    }
+
+                    // use an empty key for all primitive types
+                    default:
+                    {
+                        return "";
+                    }
+                }
+            }
+
+            /// return value of the iterator
+            typename IteratorType::reference value() const
+            {
+                return anchor.value();
+            }
+        };
+
+        /// the container to iterate
+        typename IteratorType::reference container;
+
+      public:
+        /// construct iteration proxy from a container
+        explicit iteration_proxy(typename IteratorType::reference cont)
+            : container(cont)
+        {}
+
+        /// return iterator begin (needed for range-based for)
+        iteration_proxy_internal begin() noexcept
+        {
+            return iteration_proxy_internal(container.begin());
+        }
+
+        /// return iterator end (needed for range-based for)
+        iteration_proxy_internal end() noexcept
+        {
+            return iteration_proxy_internal(container.end());
+        }
+    };
+
+  public:
+    /*!
+    @brief a template for a random access iterator for the @ref json class
+
+    This class implements a both iterators (iterator and const_iterator) for the
+    @ref json class.
+
+    @note An iterator is called *initialized* when a pointer to a JSON value
+          has been set (e.g., by a constructor or a copy assignment). If the
+          iterator is default-constructed, it is *uninitialized* and most
+          methods are undefined. **The library uses assertions to detect calls
+          on uninitialized iterators.**
+
+    @requirement The class satisfies the following concept requirements:
+    - [RandomAccessIterator](http://en.cppreference.com/w/cpp/concept/RandomAccessIterator):
+      The iterator that can be moved to point (forward and backward) to any
+      element in constant time.
+
+    @since version 1.0.0, simplified in version 2.0.9
+    */
+    template<typename U>
+    class iter_impl : public std::iterator<std::random_access_iterator_tag, U>
+    {
+        /// allow json to access private members
+        friend class json;
+        friend class JsonTest;
+
+        // make sure U is json or const json
+        static_assert(std::is_same<U, json>::value
+                      || std::is_same<U, const json>::value,
+                      "iter_impl only accepts (const) json");
+
+      public:
+        /// the type of the values when the iterator is dereferenced
+        using value_type = typename json::value_type;
+        /// a type to represent differences between iterators
+        using difference_type = typename json::difference_type;
+        /// defines a pointer to the type iterated over (value_type)
+        using pointer = typename std::conditional<std::is_const<U>::value,
+              typename json::const_pointer,
+              typename json::pointer>::type;
+        /// defines a reference to the type iterated over (value_type)
+        using reference = typename std::conditional<std::is_const<U>::value,
+              typename json::const_reference,
+              typename json::reference>::type;
+        /// the category of the iterator
+        using iterator_category = std::bidirectional_iterator_tag;
+
+        /// default constructor
+        iter_impl() noexcept : m_object(nullptr) {}
+
+        /*!
+        @brief constructor for a given JSON instance
+        @param[in] object  pointer to a JSON object for this iterator
+        @pre object != nullptr
+        @post The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        explicit iter_impl(pointer object) noexcept
+            : m_object(object)
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    m_it.object_iterator = typename object_t::iterator();
+                    break;
+                }
+
+                case json::value_t::array:
+                {
+                    m_it.array_iterator = typename array_t::iterator();
+                    break;
+                }
+
+                default:
+                {
+                    m_it.primitive_iterator = primitive_iterator_t();
+                    break;
+                }
+            }
+        }
+
+        /*!
+        @note The conventional copy constructor and copy assignment are
+              implicitly defined.
+              Combined with the following converting constructor and assigment,
+              they support: copy from iterator to iterator,
+                            copy from const iterator to const iterator,
+                            and conversion from iterator to const iterator.
+              However conversion from const iterator to iterator is not defined.
+        */
+
+        /*!
+        @brief converting constructor
+        @param[in] other  non-const iterator to copy from
+        @note It is not checked whether @a other is initialized.
+        */
+        iter_impl(const iter_impl<json>& other) noexcept
+            : m_object(other.m_object), m_it(other.m_it)
+        {}
+
+        /*!
+        @brief converting assignment
+        @param[in,out] other  non-const iterator to copy from
+        @return const/non-const iterator
+        @note It is not checked whether @a other is initialized.
+        */
+        iter_impl& operator=(const iter_impl<json>& other) noexcept
+        {
+            m_object = other.m_object;
+            m_it = other.m_it;
+            return *this;
+        }
+
+      private:
+        /*!
+        @brief set the iterator to the first value
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        void set_begin() noexcept
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    m_it.object_iterator = m_object->m_value.object->begin();
+                    break;
+                }
+
+                case json::value_t::array:
+                {
+                    m_it.array_iterator = m_object->m_value.array->begin();
+                    break;
+                }
+
+                case json::value_t::null:
+                {
+                    // set to end so begin()==end() is true: null is empty
+                    m_it.primitive_iterator.set_end();
+                    break;
+                }
+
+                default:
+                {
+                    m_it.primitive_iterator.set_begin();
+                    break;
+                }
+            }
+        }
+
+        /*!
+        @brief set the iterator past the last value
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        void set_end() noexcept
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    m_it.object_iterator = m_object->m_value.object->end();
+                    break;
+                }
+
+                case json::value_t::array:
+                {
+                    m_it.array_iterator = m_object->m_value.array->end();
+                    break;
+                }
+
+                default:
+                {
+                    m_it.primitive_iterator.set_end();
+                    break;
+                }
+            }
+        }
+
+      public:
+        /*!
+        @brief return a reference to the value pointed to by the iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        reference operator*() const
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    assert(m_it.object_iterator != m_object->m_value.object->end());
+                    return m_it.object_iterator->second;
+                }
+
+                case json::value_t::array:
+                {
+                    assert(m_it.array_iterator != m_object->m_value.array->end());
+                    return *m_it.array_iterator;
+                }
+
+                case json::value_t::null:
+                {
+                    JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+                }
+
+                default:
+                {
+                    if (m_it.primitive_iterator.is_begin())
+                    {
+                        return *m_object;
+                    }
+
+                    JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+                }
+            }
+        }
+
+        /*!
+        @brief dereference the iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        pointer operator->() const
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    assert(m_it.object_iterator != m_object->m_value.object->end());
+                    return &(m_it.object_iterator->second);
+                }
+
+                case json::value_t::array:
+                {
+                    assert(m_it.array_iterator != m_object->m_value.array->end());
+                    return &*m_it.array_iterator;
+                }
+
+                default:
+                {
+                    if (m_it.primitive_iterator.is_begin())
+                    {
+                        return m_object;
+                    }
+
+                    JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+                }
+            }
+        }
+
+        /*!
+        @brief post-increment (it++)
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl operator++(int)
+        {
+            auto result = *this;
+            ++(*this);
+            return result;
+        }
+
+        /*!
+        @brief pre-increment (++it)
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl& operator++()
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    ++m_it.object_iterator;
+                    break;
+                }
+
+                case json::value_t::array:
+                {
+                    ++m_it.array_iterator;
+                    break;
+                }
+
+                default:
+                {
+                    ++m_it.primitive_iterator;
+                    break;
+                }
+            }
+
+            return *this;
+        }
+
+        /*!
+        @brief post-decrement (it--)
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl operator--(int)
+        {
+            auto result = *this;
+            --(*this);
+            return result;
+        }
+
+        /*!
+        @brief pre-decrement (--it)
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl& operator--()
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    JSON_THROW(invalid_iterator::create(209, "cannot decrement object iterators"));
+                    break;
+                }
+
+                case json::value_t::array:
+                {
+                    std::advance(m_it.array_iterator, -1);
+                    break;
+                }
+
+                default:
+                {
+                    --m_it.primitive_iterator;
+                    break;
+                }
+            }
+
+            return *this;
+        }
+
+        /*!
+        @brief  comparison: equal
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        bool operator==(const iter_impl& other) const
+        {
+            // if objects are not the same, the comparison is undefined
+            if (m_object != other.m_object)
+            {
+                JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers"));
+            }
+
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    return (m_it.object_iterator == other.m_it.object_iterator);
+                }
+
+                case json::value_t::array:
+                {
+                    return (m_it.array_iterator == other.m_it.array_iterator);
+                }
+
+                default:
+                {
+                    return (m_it.primitive_iterator == other.m_it.primitive_iterator);
+                }
+            }
+        }
+
+        /*!
+        @brief  comparison: not equal
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        bool operator!=(const iter_impl& other) const
+        {
+            return !operator==(other);
+        }
+
+        /*!
+        @brief  comparison: smaller
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        bool operator<(const iter_impl& other) const
+        {
+            // if objects are not the same, the comparison is undefined
+            if (m_object != other.m_object)
+            {
+                JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers"));
+            }
+
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    JSON_THROW(invalid_iterator::create(213, "cannot compare order of object iterators"));
+                }
+
+                case json::value_t::array:
+                {
+                    return (m_it.array_iterator < other.m_it.array_iterator);
+                }
+
+                default:
+                {
+                    return (m_it.primitive_iterator < other.m_it.primitive_iterator);
+                }
+            }
+        }
+
+        /*!
+        @brief  comparison: less than or equal
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        bool operator<=(const iter_impl& other) const
+        {
+            return !(other.operator < (*this));
+        }
+
+        /*!
+        @brief  comparison: greater than
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        bool operator>(const iter_impl& other) const
+        {
+            return !operator<=(other);
+        }
+
+        /*!
+        @brief  comparison: greater than or equal
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        bool operator>=(const iter_impl& other) const
+        {
+            return !operator<(other);
+        }
+
+        /*!
+        @brief  add to iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl& operator+=(difference_type i)
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators"));
+                }
+
+                case json::value_t::array:
+                {
+                    std::advance(m_it.array_iterator, i);
+                    break;
+                }
+
+                default:
+                {
+                    m_it.primitive_iterator += i;
+                    break;
+                }
+            }
+
+            return *this;
+        }
+
+        /*!
+        @brief  subtract from iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl& operator-=(difference_type i)
+        {
+            return operator+=(-i);
+        }
+
+        /*!
+        @brief  add to iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl operator+(difference_type i) const
+        {
+            auto result = *this;
+            result += i;
+            return result;
+        }
+
+        /*!
+        @brief  addition of distance and iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        friend iter_impl operator+(difference_type i, const iter_impl& it)
+        {
+            auto result = it;
+            result += i;
+            return result;
+        }
+
+        /*!
+        @brief  subtract from iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        iter_impl operator-(difference_type i) const
+        {
+            auto result = *this;
+            result -= i;
+            return result;
+        }
+
+        /*!
+        @brief  return difference
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        difference_type operator-(const iter_impl& other) const
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    JSON_THROW(invalid_iterator::create(209, "cannot use offsets with object iterators"));
+                }
+
+                case json::value_t::array:
+                {
+                    return m_it.array_iterator - other.m_it.array_iterator;
+                }
+
+                default:
+                {
+                    return m_it.primitive_iterator - other.m_it.primitive_iterator;
+                }
+            }
+        }
+
+        /*!
+        @brief  access to successor
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        reference operator[](difference_type n) const
+        {
+            assert(m_object != nullptr);
+
+            switch (m_object->m_type)
+            {
+                case json::value_t::object:
+                {
+                    JSON_THROW(invalid_iterator::create(208, "cannot use operator[] for object iterators"));
+                }
+
+                case json::value_t::array:
+                {
+                    return *std::next(m_it.array_iterator, n);
+                }
+
+                case json::value_t::null:
+                {
+                    JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+                }
+
+                default:
+                {
+                    if (m_it.primitive_iterator.get_value() == -n)
+                    {
+                        return *m_object;
+                    }
+
+                    JSON_THROW(invalid_iterator::create(214, "cannot get value"));
+                }
+            }
+        }
+
+        /*!
+        @brief  return the key of an object iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        llvm::StringRef key() const
+        {
+            assert(m_object != nullptr);
+
+            if (m_object->is_object())
+            {
+                return m_it.object_iterator->first();
+            }
+
+            JSON_THROW(invalid_iterator::create(207, "cannot use key() for non-object iterators"));
+        }
+
+        /*!
+        @brief  return the value of an iterator
+        @pre The iterator is initialized; i.e. `m_object != nullptr`.
+        */
+        reference value() const
+        {
+            return operator*();
+        }
+
+      private:
+        /// associated JSON instance
+        pointer m_object;
+        /// the actual iterator of the associated instance
+        struct internal_iterator m_it = internal_iterator();
+    };
+
+    //////////////////////////////////////////
+    // binary serialization/deserialization //
+    //////////////////////////////////////////
+
+    /// @name binary serialization/deserialization support
+    /// @{
+
+  public:
+    /*!
+    @brief create a CBOR serialization of a given JSON value
+
+    Serializes a given JSON value @a j to a byte vector using the CBOR (Concise
+    Binary Object Representation) serialization format. CBOR is a binary
+    serialization format which aims to be more compact than JSON itself, yet
+    more efficient to parse.
+
+    The library uses the following mapping from JSON values types to
+    CBOR types according to the CBOR specification (RFC 7049):
+
+    JSON value type | value/range                                | CBOR type                          | first byte
+    --------------- | ------------------------------------------ | ---------------------------------- | ---------------
+    null            | `null`                                     | Null                               | 0xf6
+    boolean         | `true`                                     | True                               | 0xf5
+    boolean         | `false`                                    | False                              | 0xf4
+    number_integer  | -9223372036854775808..-2147483649          | Negative integer (8 bytes follow)  | 0x3b
+    number_integer  | -2147483648..-32769                        | Negative integer (4 bytes follow)  | 0x3a
+    number_integer  | -32768..-129                               | Negative integer (2 bytes follow)  | 0x39
+    number_integer  | -128..-25                                  | Negative integer (1 byte follow)   | 0x38
+    number_integer  | -24..-1                                    | Negative integer                   | 0x20..0x37
+    number_integer  | 0..23                                      | Integer                            | 0x00..0x17
+    number_integer  | 24..255                                    | Unsigned integer (1 byte follow)   | 0x18
+    number_integer  | 256..65535                                 | Unsigned integer (2 bytes follow)  | 0x19
+    number_integer  | 65536..4294967295                          | Unsigned integer (4 bytes follow)  | 0x1a
+    number_integer  | 4294967296..18446744073709551615           | Unsigned integer (8 bytes follow)  | 0x1b
+    number_unsigned | 0..23                                      | Integer                            | 0x00..0x17
+    number_unsigned | 24..255                                    | Unsigned integer (1 byte follow)   | 0x18
+    number_unsigned | 256..65535                                 | Unsigned integer (2 bytes follow)  | 0x19
+    number_unsigned | 65536..4294967295                          | Unsigned integer (4 bytes follow)  | 0x1a
+    number_unsigned | 4294967296..18446744073709551615           | Unsigned integer (8 bytes follow)  | 0x1b
+    number_float    | *any value*                                | Double-Precision Float             | 0xfb
+    string          | *length*: 0..23                            | UTF-8 string                       | 0x60..0x77
+    string          | *length*: 23..255                          | UTF-8 string (1 byte follow)       | 0x78
+    string          | *length*: 256..65535                       | UTF-8 string (2 bytes follow)      | 0x79
+    string          | *length*: 65536..4294967295                | UTF-8 string (4 bytes follow)      | 0x7a
+    string          | *length*: 4294967296..18446744073709551615 | UTF-8 string (8 bytes follow)      | 0x7b
+    array           | *size*: 0..23                              | array                              | 0x80..0x97
+    array           | *size*: 23..255                            | array (1 byte follow)              | 0x98
+    array           | *size*: 256..65535                         | array (2 bytes follow)             | 0x99
+    array           | *size*: 65536..4294967295                  | array (4 bytes follow)             | 0x9a
+    array           | *size*: 4294967296..18446744073709551615   | array (8 bytes follow)             | 0x9b
+    object          | *size*: 0..23                              | map                                | 0xa0..0xb7
+    object          | *size*: 23..255                            | map (1 byte follow)                | 0xb8
+    object          | *size*: 256..65535                         | map (2 bytes follow)               | 0xb9
+    object          | *size*: 65536..4294967295                  | map (4 bytes follow)               | 0xba
+    object          | *size*: 4294967296..18446744073709551615   | map (8 bytes follow)               | 0xbb
+
+    @note The mapping is **complete** in the sense that any JSON value type
+          can be converted to a CBOR value.
+
+    @note The following CBOR types are not used in the conversion:
+          - byte strings (0x40..0x5f)
+          - UTF-8 strings terminated by "break" (0x7f)
+          - arrays terminated by "break" (0x9f)
+          - maps terminated by "break" (0xbf)
+          - date/time (0xc0..0xc1)
+          - bignum (0xc2..0xc3)
+          - decimal fraction (0xc4)
+          - bigfloat (0xc5)
+          - tagged items (0xc6..0xd4, 0xd8..0xdb)
+          - expected conversions (0xd5..0xd7)
+          - simple values (0xe0..0xf3, 0xf8)
+          - undefined (0xf7)
+          - half and single-precision floats (0xf9-0xfa)
+          - break (0xff)
+
+    @param[in,out] os  output stream
+    @param[in] j  JSON value to serialize
+
+    @complexity Linear in the size of the JSON value @a j.
+
+    @liveexample{The example shows the serialization of a JSON value to a byte
+    vector in CBOR format.,to_cbor}
+
+    @sa http://cbor.io
+    @sa @ref from_cbor(const std::vector<uint8_t>&, const size_t) for the
+        analogous deserialization
+    @sa @ref to_msgpack(const json& for the related MessagePack format
+
+    @since version 2.0.9
+    */
+    static void to_cbor(llvm::raw_ostream& os, const json& j);
+    static llvm::StringRef to_cbor(const json& j, llvm::SmallVectorImpl<char> buf);
+    static std::string to_cbor(const json& j);
+
+    /*!
+    @brief create a MessagePack serialization of a given JSON value
+
+    Serializes a given JSON value @a j to a byte vector using the MessagePack
+    serialization format. MessagePack is a binary serialization format which
+    aims to be more compact than JSON itself, yet more efficient to parse.
+
+    The library uses the following mapping from JSON values types to
+    MessagePack types according to the MessagePack specification:
+
+    JSON value type | value/range                       | MessagePack type | first byte
+    --------------- | --------------------------------- | ---------------- | ----------
+    null            | `null`                            | nil              | 0xc0
+    boolean         | `true`                            | true             | 0xc3
+    boolean         | `false`                           | false            | 0xc2
+    number_integer  | -9223372036854775808..-2147483649 | int64            | 0xd3
+    number_integer  | -2147483648..-32769               | int32            | 0xd2
+    number_integer  | -32768..-129                      | int16            | 0xd1
+    number_integer  | -128..-33                         | int8             | 0xd0
+    number_integer  | -32..-1                           | negative fixint  | 0xe0..0xff
+    number_integer  | 0..127                            | positive fixint  | 0x00..0x7f
+    number_integer  | 128..255                          | uint 8           | 0xcc
+    number_integer  | 256..65535                        | uint 16          | 0xcd
+    number_integer  | 65536..4294967295                 | uint 32          | 0xce
+    number_integer  | 4294967296..18446744073709551615  | uint 64          | 0xcf
+    number_unsigned | 0..127                            | positive fixint  | 0x00..0x7f
+    number_unsigned | 128..255                          | uint 8           | 0xcc
+    number_unsigned | 256..65535                        | uint 16          | 0xcd
+    number_unsigned | 65536..4294967295                 | uint 32          | 0xce
+    number_unsigned | 4294967296..18446744073709551615  | uint 64          | 0xcf
+    number_float    | *any value*                       | float 64         | 0xcb
+    string          | *length*: 0..31                   | fixstr           | 0xa0..0xbf
+    string          | *length*: 32..255                 | str 8            | 0xd9
+    string          | *length*: 256..65535              | str 16           | 0xda
+    string          | *length*: 65536..4294967295       | str 32           | 0xdb
+    array           | *size*: 0..15                     | fixarray         | 0x90..0x9f
+    array           | *size*: 16..65535                 | array 16         | 0xdc
+    array           | *size*: 65536..4294967295         | array 32         | 0xdd
+    object          | *size*: 0..15                     | fix map          | 0x80..0x8f
+    object          | *size*: 16..65535                 | map 16           | 0xde
+    object          | *size*: 65536..4294967295         | map 32           | 0xdf
+
+    @note The mapping is **complete** in the sense that any JSON value type
+          can be converted to a MessagePack value.
+
+    @note The following values can **not** be converted to a MessagePack value:
+          - strings with more than 4294967295 bytes
+          - arrays with more than 4294967295 elements
+          - objects with more than 4294967295 elements
+
+    @note The following MessagePack types are not used in the conversion:
+          - bin 8 - bin 32 (0xc4..0xc6)
+          - ext 8 - ext 32 (0xc7..0xc9)
+          - float 32 (0xca)
+          - fixext 1 - fixext 16 (0xd4..0xd8)
+
+    @note Any MessagePack output created @ref to_msgpack can be successfully
+          parsed by @ref from_msgpack.
+
+    @param[in,out] os  output stream
+    @param[in] j  JSON value to serialize
+
+    @complexity Linear in the size of the JSON value @a j.
+
+    @liveexample{The example shows the serialization of a JSON value to a byte
+    vector in MessagePack format.,to_msgpack}
+
+    @sa http://msgpack.org
+    @sa @ref from_msgpack(const std::vector<uint8_t>&, const size_t) for the
+        analogous deserialization
+    @sa @ref to_cbor(const json& for the related CBOR format
+
+    @since version 2.0.9
+    */
+    static void to_msgpack(llvm::raw_ostream& os, const json& j);
+    static llvm::StringRef to_msgpack(const json& j, llvm::SmallVectorImpl<char> buf);
+    static std::string to_msgpack(const json& j);
+
+    /*!
+    @brief create a JSON value from a byte vector in CBOR format
+
+    Deserializes a given byte vector @a v to a JSON value using the CBOR
+    (Concise Binary Object Representation) serialization format.
+
+    The library maps CBOR types to JSON value types as follows:
+
+    CBOR type              | JSON value type | first byte
+    ---------------------- | --------------- | ----------
+    Integer                | number_unsigned | 0x00..0x17
+    Unsigned integer       | number_unsigned | 0x18
+    Unsigned integer       | number_unsigned | 0x19
+    Unsigned integer       | number_unsigned | 0x1a
+    Unsigned integer       | number_unsigned | 0x1b
+    Negative integer       | number_integer  | 0x20..0x37
+    Negative integer       | number_integer  | 0x38
+    Negative integer       | number_integer  | 0x39
+    Negative integer       | number_integer  | 0x3a
+    Negative integer       | number_integer  | 0x3b
+    Negative integer       | number_integer  | 0x40..0x57
+    UTF-8 string           | string          | 0x60..0x77
+    UTF-8 string           | string          | 0x78
+    UTF-8 string           | string          | 0x79
+    UTF-8 string           | string          | 0x7a
+    UTF-8 string           | string          | 0x7b
+    UTF-8 string           | string          | 0x7f
+    array                  | array           | 0x80..0x97
+    array                  | array           | 0x98
+    array                  | array           | 0x99
+    array                  | array           | 0x9a
+    array                  | array           | 0x9b
+    array                  | array           | 0x9f
+    map                    | object          | 0xa0..0xb7
+    map                    | object          | 0xb8
+    map                    | object          | 0xb9
+    map                    | object          | 0xba
+    map                    | object          | 0xbb
+    map                    | object          | 0xbf
+    False                  | `false`         | 0xf4
+    True                   | `true`          | 0xf5
+    Nill                   | `null`          | 0xf6
+    Half-Precision Float   | number_float    | 0xf9
+    Single-Precision Float | number_float    | 0xfa
+    Double-Precision Float | number_float    | 0xfb
+
+    @warning The mapping is **incomplete** in the sense that not all CBOR
+             types can be converted to a JSON value. The following CBOR types
+             are not supported and will yield parse errors (parse_error.112):
+             - byte strings (0x40..0x5f)
+             - date/time (0xc0..0xc1)
+             - bignum (0xc2..0xc3)
+             - decimal fraction (0xc4)
+             - bigfloat (0xc5)
+             - tagged items (0xc6..0xd4, 0xd8..0xdb)
+             - expected conversions (0xd5..0xd7)
+             - simple values (0xe0..0xf3, 0xf8)
+             - undefined (0xf7)
+
+    @warning CBOR allows map keys of any type, whereas JSON only allows
+             strings as keys in object values. Therefore, CBOR maps with keys
+             other than UTF-8 strings are rejected (parse_error.113).
+
+    @note Any CBOR output created @ref to_cbor can be successfully parsed by
+          @ref from_cbor.
+
+    @param[in] is an input stream in CBOR format
+    @return deserialized JSON value
+
+    @throw parse_error.110 if the given vector ends prematurely
+    @throw parse_error.112 if unsupported features from CBOR were
+    used in the given vector @a v or if the input is not valid CBOR
+    @throw parse_error.113 if a string was expected as map key, but not found
+
+    @complexity Linear in the size of the byte vector @a v.
+
+    @liveexample{The example shows the deserialization of a byte vector in CBOR
+    format to a JSON value.,from_cbor}
+
+    @sa http://cbor.io
+    @sa @ref to_cbor(const json&) for the analogous serialization
+    @sa @ref from_msgpack(const std::vector<uint8_t>&, const size_t) for the
+        related MessagePack format
+
+    @since version 2.0.9, parameter @a start_index since 2.1.1
+    */
+    static json from_cbor(wpi::raw_istream& is);
+    static json from_cbor(llvm::StringRef s);
+
+    /*!
+    @brief create a JSON value from a byte vector in MessagePack format
+
+    Deserializes a given byte vector @a v to a JSON value using the MessagePack
+    serialization format.
+
+    The library maps MessagePack types to JSON value types as follows:
+
+    MessagePack type | JSON value type | first byte
+    ---------------- | --------------- | ----------
+    positive fixint  | number_unsigned | 0x00..0x7f
+    fixmap           | object          | 0x80..0x8f
+    fixarray         | array           | 0x90..0x9f
+    fixstr           | string          | 0xa0..0xbf
+    nil              | `null`          | 0xc0
+    false            | `false`         | 0xc2
+    true             | `true`          | 0xc3
+    float 32         | number_float    | 0xca
+    float 64         | number_float    | 0xcb
+    uint 8           | number_unsigned | 0xcc
+    uint 16          | number_unsigned | 0xcd
+    uint 32          | number_unsigned | 0xce
+    uint 64          | number_unsigned | 0xcf
+    int 8            | number_integer  | 0xd0
+    int 16           | number_integer  | 0xd1
+    int 32           | number_integer  | 0xd2
+    int 64           | number_integer  | 0xd3
+    str 8            | string          | 0xd9
+    str 16           | string          | 0xda
+    str 32           | string          | 0xdb
+    array 16         | array           | 0xdc
+    array 32         | array           | 0xdd
+    map 16           | object          | 0xde
+    map 32           | object          | 0xdf
+    negative fixint  | number_integer  | 0xe0-0xff
+
+    @warning The mapping is **incomplete** in the sense that not all
+             MessagePack types can be converted to a JSON value. The following
+             MessagePack types are not supported and will yield parse errors:
+              - bin 8 - bin 32 (0xc4..0xc6)
+              - ext 8 - ext 32 (0xc7..0xc9)
+              - fixext 1 - fixext 16 (0xd4..0xd8)
+
+    @note Any MessagePack output created @ref to_msgpack can be successfully
+          parsed by @ref from_msgpack.
+
+    @param[in] is an input stream in MessagePack format
+    @return deserialized JSON value
+
+    @throw parse_error.110 if the given vector ends prematurely
+    @throw parse_error.112 if unsupported features from MessagePack were
+    used in the given vector @a v or if the input is not valid MessagePack
+    @throw parse_error.113 if a string was expected as map key, but not found
+
+    @complexity Linear in the size of the byte vector @a v.
+
+    @liveexample{The example shows the deserialization of a byte vector in
+    MessagePack format to a JSON value.,from_msgpack}
+
+    @sa http://msgpack.org
+    @sa @ref to_msgpack(const json&) for the analogous serialization
+    @sa @ref from_cbor(const std::vector<uint8_t>&, const size_t) for the
+        related CBOR format
+
+    @since version 2.0.9, parameter @a start_index since 2.1.1
+    */
+    static json from_msgpack(wpi::raw_istream& is);
+    static json from_msgpack(llvm::StringRef s);
+
+    /// @}
+
+  public:
+    /*!
+    @brief JSON Pointer
+
+    A JSON pointer defines a string syntax for identifying a specific value
+    within a JSON document. It can be used with functions `at` and
+    `operator[]`. Furthermore, JSON pointers are the base for JSON patches.
+
+    @sa [RFC 6901](https://tools.ietf.org/html/rfc6901)
+
+    @since version 2.0.0
+    */
+    class json_pointer
+    {
+        /// allow json to access private members
+        friend class json;
+        friend class JsonTest;
+
+      public:
+        /*!
+        @brief create JSON pointer
+
+        Create a JSON pointer according to the syntax described in
+        [Section 3 of RFC6901](https://tools.ietf.org/html/rfc6901#section-3).
+
+        @param[in] s  string representing the JSON pointer; if omitted, the
+                      empty string is assumed which references the whole JSON
+                      value
+
+        @throw parse_error.107 if the given JSON pointer @a s is nonempty and
+        does not begin with a slash (`/`); see example below
+
+        @throw parse_error.108 if a tilde (`~`) in the given JSON pointer @a s
+        is not followed by `0` (representing `~`) or `1` (representing `/`);
+        see example below
+
+        @liveexample{The example shows the construction several valid JSON
+        pointers as well as the exceptional behavior.,json_pointer}
+
+        @since version 2.0.0
+        */
+        explicit json_pointer(const std::string& s = "")
+            : reference_tokens(split(s))
+        {}
+
+        /*!
+        @brief return a string representation of the JSON pointer
+
+        @invariant For each JSON pointer `ptr`, it holds:
+        @code {.cpp}
+        ptr == json_pointer(ptr.to_string());
+        @endcode
+
+        @return a string representation of the JSON pointer
+
+        @liveexample{The example shows the result of `to_string`.,
+        json_pointer__to_string}
+
+        @since version 2.0.0
+        */
+        std::string to_string() const noexcept;
+
+        /// @copydoc to_string()
+        operator std::string() const
+        {
+            return to_string();
+        }
+
+      private:
+        /*!
+        @brief remove and return last reference pointer
+        @throw out_of_range.405 if JSON pointer has no parent
+        */
+        std::string pop_back()
+        {
+            if (is_root())
+            {
+                JSON_THROW(out_of_range::create(405, "JSON pointer has no parent"));
+            }
+
+            auto last = reference_tokens.back();
+            reference_tokens.pop_back();
+            return last;
+        }
+
+        /// return whether pointer points to the root document
+        bool is_root() const
+        {
+            return reference_tokens.empty();
+        }
+
+        json_pointer top() const
+        {
+            if (is_root())
+            {
+                JSON_THROW(out_of_range::create(405, "JSON pointer has no parent"));
+            }
+
+            json_pointer result = *this;
+            result.reference_tokens = {reference_tokens[0]};
+            return result;
+        }
+
+        /*!
+        @brief create and return a reference to the pointed to value
+
+        @complexity Linear in the number of reference tokens.
+
+        @throw parse_error.109 if array index is not a number
+        @throw type_error.313 if value cannot be unflattened
+        */
+        reference get_and_create(reference j) const;
+
+        /*!
+        @brief return a reference to the pointed to value
+
+        @note This version does not throw if a value is not present, but tries
+        to create nested values instead. For instance, calling this function
+        with pointer `"/this/that"` on a null value is equivalent to calling
+        `operator[]("this").operator[]("that")` on that value, effectively
+        changing the null value to an object.
+
+        @param[in] ptr  a JSON value
+
+        @return reference to the JSON value pointed to by the JSON pointer
+
+        @complexity Linear in the length of the JSON pointer.
+
+        @throw parse_error.106   if an array index begins with '0'
+        @throw parse_error.109   if an array index was not a number
+        @throw out_of_range.404  if the JSON pointer can not be resolved
+        */
+        reference get_unchecked(pointer ptr) const;
+
+        /*!
+        @throw parse_error.106   if an array index begins with '0'
+        @throw parse_error.109   if an array index was not a number
+        @throw out_of_range.402  if the array index '-' is used
+        @throw out_of_range.404  if the JSON pointer can not be resolved
+        */
+        reference get_checked(pointer ptr) const;
+
+        /*!
+        @brief return a const reference to the pointed to value
+
+        @param[in] ptr  a JSON value
+
+        @return const reference to the JSON value pointed to by the JSON
+                pointer
+
+        @throw parse_error.106   if an array index begins with '0'
+        @throw parse_error.109   if an array index was not a number
+        @throw out_of_range.402  if the array index '-' is used
+        @throw out_of_range.404  if the JSON pointer can not be resolved
+        */
+        const_reference get_unchecked(const_pointer ptr) const;
+
+        /*!
+        @throw parse_error.106   if an array index begins with '0'
+        @throw parse_error.109   if an array index was not a number
+        @throw out_of_range.402  if the array index '-' is used
+        @throw out_of_range.404  if the JSON pointer can not be resolved
+        */
+        const_reference get_checked(const_pointer ptr) const;
+
+        /*!
+        @brief split the string input to reference tokens
+
+        @note This function is only called by the json_pointer constructor.
+              All exceptions below are documented there.
+
+        @throw parse_error.107  if the pointer is not empty or begins with '/'
+        @throw parse_error.108  if character '~' is not followed by '0' or '1'
+        */
+        static std::vector<std::string> split(const std::string& reference_string);
+
+        /*!
+        @brief replace all occurrences of a substring by another string
+
+        @param[in,out] s  the string to manipulate; changed so that all
+                          occurrences of @a f are replaced with @a t
+        @param[in]     f  the substring to replace with @a t
+        @param[in]     t  the string to replace @a f
+
+        @pre The search string @a f must not be empty. **This precondition is
+             enforced with an assertion.**
+
+        @since version 2.0.0
+        */
+        static void replace_substring(std::string& s,
+                                      const std::string& f,
+                                      const std::string& t);
+
+        /// escape tilde and slash
+        static std::string escape(std::string s);
+
+        /// unescape tilde and slash
+        static void unescape(std::string& s);
+
+        /*!
+        @param[in] reference_string  the reference string to the current value
+        @param[in] value             the value to consider
+        @param[in,out] result        the result object to insert values to
+
+        @note Empty objects or arrays are flattened to `null`.
+        */
+        static void flatten(const std::string& reference_string,
+                            const json& value,
+                            json& result);
+
+        /*!
+        @param[in] value  flattened JSON
+
+        @return unflattened JSON
+
+        @throw parse_error.109 if array index is not a number
+        @throw type_error.314  if value is not an object
+        @throw type_error.315  if object values are not primitive
+        @throw type_error.313  if value cannot be unflattened
+        */
+        static json unflatten(const json& value);
+
+        friend bool operator==(json_pointer const& lhs,
+                               json_pointer const& rhs) noexcept
+        {
+            return lhs.reference_tokens == rhs.reference_tokens;
+        }
+
+        friend bool operator!=(json_pointer const& lhs,
+                               json_pointer const& rhs) noexcept
+        {
+            return !(lhs == rhs);
+        }
+
+        /// the reference tokens
+        std::vector<std::string> reference_tokens {};
+    };
+
+    //////////////////////////
+    // JSON Pointer support //
+    //////////////////////////
+
+    /// @name JSON Pointer functions
+    /// @{
+
+    /*!
+    @brief access specified element via JSON Pointer
+
+    Uses a JSON pointer to retrieve a reference to the respective JSON value.
+    No bound checking is performed. Similar to @ref operator[](
+    llvm::StringRef), `null` values are created in arrays and objects if
+    necessary.
+
+    In particular:
+    - If the JSON pointer points to an object key that does not exist, it
+      is created an filled with a `null` value before a reference to it
+      is returned.
+    - If the JSON pointer points to an array index that does not exist, it
+      is created an filled with a `null` value before a reference to it
+      is returned. All indices between the current maximum and the given
+      index are also filled with `null`.
+    - The special value `-` is treated as a synonym for the index past the
+      end.
+
+    @param[in] ptr  a JSON pointer
+
+    @return reference to the element pointed to by @a ptr
+
+    @complexity Constant.
+
+    @throw parse_error.106   if an array index begins with '0'
+    @throw parse_error.109   if an array index was not a number
+    @throw out_of_range.404  if the JSON pointer can not be resolved
+
+    @liveexample{The behavior is shown in the example.,operatorjson_pointer}
+
+    @since version 2.0.0
+    */
+    reference operator[](const json_pointer& ptr)
+    {
+        return ptr.get_unchecked(this);
+    }
+
+    /*!
+    @brief access specified element via JSON Pointer
+
+    Uses a JSON pointer to retrieve a reference to the respective JSON value.
+    No bound checking is performed. The function does not change the JSON
+    value; no `null` values are created. In particular, the the special value
+    `-` yields an exception.
+
+    @param[in] ptr  JSON pointer to the desired element
+
+    @return const reference to the element pointed to by @a ptr
+
+    @complexity Constant.
+
+    @throw parse_error.106   if an array index begins with '0'
+    @throw parse_error.109   if an array index was not a number
+    @throw out_of_range.402  if the array index '-' is used
+    @throw out_of_range.404  if the JSON pointer can not be resolved
+
+    @liveexample{The behavior is shown in the example.,operatorjson_pointer_const}
+
+    @since version 2.0.0
+    */
+    const_reference operator[](const json_pointer& ptr) const
+    {
+        return ptr.get_unchecked(this);
+    }
+
+    /*!
+    @brief access specified element via JSON Pointer
+
+    Returns a reference to the element at with specified JSON pointer @a ptr,
+    with bounds checking.
+
+    @param[in] ptr  JSON pointer to the desired element
+
+    @return reference to the element pointed to by @a ptr
+
+    @throw parse_error.106 if an array index in the passed JSON pointer @a ptr
+    begins with '0'. See example below.
+
+    @throw parse_error.109 if an array index in the passed JSON pointer @a ptr
+    is not a number. See example below.
+
+    @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr
+    is out of range. See example below.
+
+    @throw out_of_range.402 if the array index '-' is used in the passed JSON
+    pointer @a ptr. As `at` provides checked access (and no elements are
+    implicitly inserted), the index '-' is always invalid. See example below.
+
+    @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved.
+    See example below.
+
+    @exceptionsafety Strong guarantee: if an exception is thrown, there are no
+    changes in the JSON value.
+
+    @complexity Constant.
+
+    @since version 2.0.0
+
+    @liveexample{The behavior is shown in the example.,at_json_pointer}
+    */
+    reference at(const json_pointer& ptr)
+    {
+        return ptr.get_checked(this);
+    }
+
+    /*!
+    @brief access specified element via JSON Pointer
+
+    Returns a const reference to the element at with specified JSON pointer @a
+    ptr, with bounds checking.
+
+    @param[in] ptr  JSON pointer to the desired element
+
+    @return reference to the element pointed to by @a ptr
+
+    @throw parse_error.106 if an array index in the passed JSON pointer @a ptr
+    begins with '0'. See example below.
+
+    @throw parse_error.109 if an array index in the passed JSON pointer @a ptr
+    is not a number. See example below.
+
+    @throw out_of_range.401 if an array index in the passed JSON pointer @a ptr
+    is out of range. See example below.
+
+    @throw out_of_range.402 if the array index '-' is used in the passed JSON
+    pointer @a ptr. As `at` provides checked access (and no elements are
+    implicitly inserted), the index '-' is always invalid. See example below.
+
+    @throw out_of_range.404 if the JSON pointer @a ptr can not be resolved.
+    See example below.
+
+    @exceptionsafety Strong guarantee: if an exception is thrown, there are no
+    changes in the JSON value.
+
+    @complexity Constant.
+
+    @since version 2.0.0
+
+    @liveexample{The behavior is shown in the example.,at_json_pointer_const}
+    */
+    const_reference at(const json_pointer& ptr) const
+    {
+        return ptr.get_checked(this);
+    }
+
+    /*!
+    @brief return flattened JSON value
+
+    The function creates a JSON object whose keys are JSON pointers (see [RFC
+    6901](https://tools.ietf.org/html/rfc6901)) and whose values are all
+    primitive. The original JSON value can be restored using the @ref
+    unflatten() function.
+
+    @return an object that maps JSON pointers to primitive values
+
+    @note Empty objects and arrays are flattened to `null` and will not be
+          reconstructed correctly by the @ref unflatten() function.
+
+    @complexity Linear in the size the JSON value.
+
+    @liveexample{The following code shows how a JSON object is flattened to an
+    object whose keys consist of JSON pointers.,flatten}
+
+    @sa @ref unflatten() for the reverse function
+
+    @since version 2.0.0
+    */
+    json flatten() const
+    {
+        json result(value_t::object);
+        json_pointer::flatten("", *this, result);
+        return result;
+    }
+
+    /*!
+    @brief unflatten a previously flattened JSON value
+
+    The function restores the arbitrary nesting of a JSON value that has been
+    flattened before using the @ref flatten() function. The JSON value must
+    meet certain constraints:
+    1. The value must be an object.
+    2. The keys must be JSON pointers (see
+       [RFC 6901](https://tools.ietf.org/html/rfc6901))
+    3. The mapped values must be primitive JSON types.
+
+    @return the original JSON from a flattened version
+
+    @note Empty objects and arrays are flattened by @ref flatten() to `null`
+          values and can not unflattened to their original type. Apart from
+          this example, for a JSON value `j`, the following is always true:
+          `j == j.flatten().unflatten()`.
+
+    @complexity Linear in the size the JSON value.
+
+    @throw type_error.314  if value is not an object
+    @throw type_error.315  if object values are not primitve
+
+    @liveexample{The following code shows how a flattened JSON object is
+    unflattened into the original nested JSON object.,unflatten}
+
+    @sa @ref flatten() for the reverse function
+
+    @since version 2.0.0
+    */
+    json unflatten() const
+    {
+        return json_pointer::unflatten(*this);
+    }
+
+    /// @}
+};
+
+} // namespace wpi
+
+
+///////////////////////
+// nonmember support //
+///////////////////////
+
+// specialization of std::swap, and std::hash
+namespace std
+{
+/*!
+@brief exchanges the values of two JSON objects
+
+@since version 1.0.0
+*/
+template<>
+inline void swap(wpi::json& j1,
+                 wpi::json& j2) noexcept(
+                     is_nothrow_move_constructible<wpi::json>::value &&
+                     is_nothrow_move_assignable<wpi::json>::value
+                 )
+{
+    j1.swap(j2);
+}
+
+/// hash value for JSON objects
+template<>
+struct hash<wpi::json>
+{
+    /*!
+    @brief return a hash value for a JSON object
+
+    @since version 1.0.0
+    */
+    std::size_t operator()(const wpi::json& j) const;
+};
+
+/// specialization for std::less<value_t>
+template <>
+struct less<::wpi::detail::value_t>
+{
+    /*!
+    @brief compare two value_t enum values
+    @since version 3.0.0
+    */
+    bool operator()(wpi::detail::value_t lhs,
+                    wpi::detail::value_t rhs) const noexcept
+    {
+        return wpi::detail::operator<(lhs, rhs);
+    }
+};
+
+} // namespace std
+
+/*!
+@brief user-defined string literal for JSON values
+
+This operator implements a user-defined string literal for JSON objects. It
+can be used by adding `"_json"` to a string literal and returns a JSON object
+if no parse error occurred.
+
+@param[in] s  a string representation of a JSON object
+@param[in] n  the length of string @a s
+@return a JSON object
+
+@since version 1.0.0
+*/
+inline wpi::json operator "" _json(const char* s, std::size_t n)
+{
+    return wpi::json::parse(llvm::StringRef(s, n));
+}
+
+/*!
+@brief user-defined string literal for JSON pointer
+
+This operator implements a user-defined string literal for JSON Pointers. It
+can be used by adding `"_json_pointer"` to a string literal and returns a JSON pointer
+object if no parse error occurred.
+
+@param[in] s  a string representation of a JSON Pointer
+@param[in] n  the length of string @a s
+@return a JSON pointer object
+
+@since version 2.0.0
+*/
+inline wpi::json::json_pointer operator "" _json_pointer(const char* s, std::size_t n)
+{
+    return wpi::json::json_pointer(std::string(s, n));
+}
+
+#ifndef WPI_JSON_IMPLEMENTATION
+
+// restore GCC/clang diagnostic settings
+#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
+    #pragma GCC diagnostic pop
+#endif
+#if defined(__clang__)
+    #pragma GCC diagnostic pop
+#endif
+
+// clean up
+#undef JSON_CATCH
+#undef JSON_THROW
+#undef JSON_TRY
+#undef JSON_LIKELY
+#undef JSON_UNLIKELY
+
+#endif  // WPI_JSON_IMPLEMENTATION
+
+#endif
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/leb128.h b/third_party/wpiutil_2018/src/main/native/include/support/leb128.h
new file mode 100644
index 0000000..9f2c7f0
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/leb128.h
@@ -0,0 +1,26 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_LEB128_H_
+#define WPIUTIL_SUPPORT_LEB128_H_
+
+#include <cstddef>
+
+#include "llvm/SmallVector.h"
+
+namespace wpi {
+
+class raw_istream;
+
+uint64_t SizeUleb128(uint64_t val);
+uint64_t WriteUleb128(llvm::SmallVectorImpl<char>& dest, uint64_t val);
+uint64_t ReadUleb128(const char* addr, uint64_t* ret);
+bool ReadUleb128(raw_istream& is, uint64_t* ret);
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_LEB128_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/mutex.h b/third_party/wpiutil_2018/src/main/native/include/support/mutex.h
new file mode 100644
index 0000000..0ce3a51
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/mutex.h
@@ -0,0 +1,24 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#include <mutex>
+
+#include "priority_mutex.h"
+
+namespace wpi {
+
+#ifdef WPI_HAVE_PRIORITY_MUTEX
+using mutex = priority_mutex;
+using recursive_mutex = priority_recursive_mutex;
+#else
+using mutex = ::std::mutex;
+using recursive_mutex = ::std::recursive_mutex;
+#endif
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/priority_condition_variable.h b/third_party/wpiutil_2018/src/main/native/include/support/priority_condition_variable.h
new file mode 100644
index 0000000..01f044e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/priority_condition_variable.h
@@ -0,0 +1,122 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+#ifdef __linux__
+#include <pthread.h>
+#endif
+
+#include <condition_variable>
+#include <memory>
+#include <utility>
+
+#include "priority_mutex.h"
+
+namespace wpi {
+
+#if defined(__linux__) && defined(WPI_HAVE_PRIORITY_MUTEX)
+
+#define WPI_HAVE_PRIORITY_CONDITION_VARIABLE 1
+
+class priority_condition_variable {
+  typedef std::chrono::system_clock clock;
+
+ public:
+  typedef pthread_cond_t* native_handle_type;
+
+  priority_condition_variable() noexcept = default;
+  ~priority_condition_variable() noexcept { pthread_cond_destroy(&m_cond); }
+
+  priority_condition_variable(const priority_condition_variable&) = delete;
+  priority_condition_variable& operator=(const priority_condition_variable&) =
+      delete;
+
+  void notify_one() noexcept { pthread_cond_signal(&m_cond); }
+
+  void notify_all() noexcept { pthread_cond_broadcast(&m_cond); }
+
+  void wait(std::unique_lock<priority_mutex>& lock) noexcept {
+    int e = pthread_cond_wait(&m_cond, lock.mutex()->native_handle());
+    if (e) std::terminate();
+  }
+
+  template <typename Predicate>
+  void wait(std::unique_lock<priority_mutex>& lock, Predicate p) {
+    while (!p()) {
+      wait(lock);
+    }
+  }
+
+  template <typename Duration>
+  std::cv_status wait_until(
+      std::unique_lock<priority_mutex>& lock,
+      const std::chrono::time_point<clock, Duration>& atime) {
+    return wait_until_impl(lock, atime);
+  }
+
+  template <typename Clock, typename Duration>
+  std::cv_status wait_until(
+      std::unique_lock<priority_mutex>& lock,
+      const std::chrono::time_point<Clock, Duration>& atime) {
+    const typename Clock::time_point c_entry = Clock::now();
+    const clock::time_point s_entry = clock::now();
+    const auto delta = atime - c_entry;
+    const auto s_atime = s_entry + delta;
+
+    return wait_until_impl(lock, s_atime);
+  }
+
+  template <typename Clock, typename Duration, typename Predicate>
+  bool wait_until(std::unique_lock<priority_mutex>& lock,
+                  const std::chrono::time_point<Clock, Duration>& atime,
+                  Predicate p) {
+    while (!p()) {
+      if (wait_until(lock, atime) == std::cv_status::timeout) {
+        return p();
+      }
+    }
+    return true;
+  }
+
+  template <typename Rep, typename Period>
+  std::cv_status wait_for(std::unique_lock<priority_mutex>& lock,
+                          const std::chrono::duration<Rep, Period>& rtime) {
+    return wait_until(lock, clock::now() + rtime);
+  }
+
+  template <typename Rep, typename Period, typename Predicate>
+  bool wait_for(std::unique_lock<priority_mutex>& lock,
+                const std::chrono::duration<Rep, Period>& rtime, Predicate p) {
+    return wait_until(lock, clock::now() + rtime, std::move(p));
+  }
+
+  native_handle_type native_handle() { return &m_cond; }
+
+ private:
+  pthread_cond_t m_cond = PTHREAD_COND_INITIALIZER;
+
+  template <typename Dur>
+  std::cv_status wait_until_impl(
+      std::unique_lock<priority_mutex>& lock,
+      const std::chrono::time_point<clock, Dur>& atime) {
+    auto s = std::chrono::time_point_cast<std::chrono::seconds>(atime);
+    auto ns = std::chrono::duration_cast<std::chrono::nanoseconds>(atime - s);
+
+    struct timespec ts = {
+        static_cast<std::time_t>(s.time_since_epoch().count()),
+        static_cast<long>(ns.count())};  // NOLINT(runtime/int)
+
+    pthread_cond_timedwait(&m_cond, lock.mutex()->native_handle(), &ts);
+
+    return (clock::now() < atime ? std::cv_status::no_timeout
+                                 : std::cv_status::timeout);
+  }
+};
+#endif
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/priority_mutex.h b/third_party/wpiutil_2018/src/main/native/include/support/priority_mutex.h
new file mode 100644
index 0000000..800c550
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/priority_mutex.h
@@ -0,0 +1,84 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#pragma once
+
+// Allows usage with std::lock_guard without including <mutex> separately
+#ifdef __linux__
+#include <pthread.h>
+#endif
+
+#include <mutex>
+
+namespace wpi {
+
+#ifdef __linux__
+
+#define WPI_HAVE_PRIORITY_MUTEX 1
+
+class priority_recursive_mutex {
+ public:
+  typedef pthread_mutex_t* native_handle_type;
+
+  constexpr priority_recursive_mutex() noexcept = default;
+  priority_recursive_mutex(const priority_recursive_mutex&) = delete;
+  priority_recursive_mutex& operator=(const priority_recursive_mutex&) = delete;
+
+  // Lock the mutex, blocking until it's available.
+  void lock() { pthread_mutex_lock(&m_mutex); }
+
+  // Unlock the mutex.
+  void unlock() { pthread_mutex_unlock(&m_mutex); }
+
+  // Tries to lock the mutex.
+  bool try_lock() noexcept { return !pthread_mutex_trylock(&m_mutex); }
+
+  pthread_mutex_t* native_handle() { return &m_mutex; }
+
+ private:
+// Do the equivalent of setting PTHREAD_PRIO_INHERIT and
+// PTHREAD_MUTEX_RECURSIVE_NP.
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
+  pthread_mutex_t m_mutex = {
+      {0, 0, 0, 0, 0x20 | PTHREAD_MUTEX_RECURSIVE_NP, __PTHREAD_SPINS, {0, 0}}};
+#else
+  pthread_mutex_t m_mutex = {
+      {0, 0, 0, 0x20 | PTHREAD_MUTEX_RECURSIVE_NP, 0, {__PTHREAD_SPINS}}};
+#endif
+};
+
+class priority_mutex {
+ public:
+  typedef pthread_mutex_t* native_handle_type;
+
+  constexpr priority_mutex() noexcept = default;
+  priority_mutex(const priority_mutex&) = delete;
+  priority_mutex& operator=(const priority_mutex&) = delete;
+
+  // Lock the mutex, blocking until it's available.
+  void lock() { pthread_mutex_lock(&m_mutex); }
+
+  // Unlock the mutex.
+  void unlock() { pthread_mutex_unlock(&m_mutex); }
+
+  // Tries to lock the mutex.
+  bool try_lock() noexcept { return !pthread_mutex_trylock(&m_mutex); }
+
+  pthread_mutex_t* native_handle() { return &m_mutex; }
+
+ private:
+// Do the equivalent of setting PTHREAD_PRIO_INHERIT.
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
+  pthread_mutex_t m_mutex = {{0, 0, 0, 0, 0x20, __PTHREAD_SPINS, {0, 0}}};
+#else
+  pthread_mutex_t m_mutex = {{0, 0, 0, 0x20, 0, {__PTHREAD_SPINS}}};
+#endif
+};
+
+#endif  // __linux__
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/raw_istream.h b/third_party/wpiutil_2018/src/main/native/include/support/raw_istream.h
new file mode 100644
index 0000000..d256179
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/raw_istream.h
@@ -0,0 +1,115 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_RAW_ISTREAM_H_
+#define WPIUTIL_SUPPORT_RAW_ISTREAM_H_
+
+#include <algorithm>
+#include <cstddef>
+#include <system_error>
+
+#include "llvm/SmallVector.h"
+#include "llvm/StringRef.h"
+#include "llvm/Twine.h"
+
+namespace wpi {
+
+class raw_istream {
+ public:
+  raw_istream() = default;
+  virtual ~raw_istream() = default;
+
+  raw_istream& read(char& c) {
+    read_impl(&c, 1);
+    return *this;
+  }
+
+  raw_istream& read(unsigned char& c) {
+    read_impl(&c, 1);
+    return *this;
+  }
+
+  raw_istream& read(signed char& c) {
+    read_impl(&c, 1);
+    return *this;
+  }
+
+  raw_istream& read(void* data, size_t len) {
+    read_impl(data, len);
+    return *this;
+  }
+
+  size_t readsome(void* data, size_t len) {
+    size_t readlen = std::min(in_avail(), len);
+    if (readlen == 0) return 0;
+    read_impl(data, readlen);
+    return readlen;
+  }
+
+  // Read a line from an input stream (up to a maximum length).
+  // The returned buffer will contain the trailing \n (unless the maximum length
+  // was reached).  \r's are stripped from the buffer.
+  // @param buf Buffer for output
+  // @param maxLen Maximum length
+  // @return Line
+  llvm::StringRef getline(llvm::SmallVectorImpl<char>& buf, int maxLen);
+
+  virtual void close() = 0;
+  virtual size_t in_avail() const = 0;
+
+  bool has_error() const { return m_error; }
+  void clear_error() { m_error = false; }
+
+  raw_istream(const raw_istream&) = delete;
+  raw_istream& operator=(const raw_istream&) = delete;
+
+ protected:
+  void error_detected() { m_error = true; }
+
+ private:
+  virtual void read_impl(void* data, size_t len) = 0;
+
+  bool m_error = false;
+};
+
+class raw_mem_istream : public raw_istream {
+ public:
+  explicit raw_mem_istream(llvm::StringRef mem);
+  raw_mem_istream(const char* mem, size_t len) : m_cur(mem), m_left(len) {}
+  void close() override;
+  size_t in_avail() const override;
+
+ private:
+  void read_impl(void* data, size_t len) override;
+
+  const char* m_cur;
+  size_t m_left;
+};
+
+class raw_fd_istream : public raw_istream {
+ public:
+  raw_fd_istream(const llvm::Twine& filename, std::error_code& ec,
+                 size_t bufSize = 4096);
+  raw_fd_istream(int fd, bool shouldClose, size_t bufSize = 4096);
+  ~raw_fd_istream() override;
+  void close() override;
+  size_t in_avail() const override;
+
+ private:
+  void read_impl(void* data, size_t len) override;
+
+  char* m_buf;
+  char* m_cur;
+  char* m_end;
+  size_t m_bufSize;
+  int m_fd;
+  bool m_shouldClose;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_RAW_ISTREAM_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/raw_socket_istream.h b/third_party/wpiutil_2018/src/main/native/include/support/raw_socket_istream.h
new file mode 100644
index 0000000..06fe1ef
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/raw_socket_istream.h
@@ -0,0 +1,34 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_RAW_SOCKET_ISTREAM_H_
+#define WPIUTIL_SUPPORT_RAW_SOCKET_ISTREAM_H_
+
+#include "support/raw_istream.h"
+
+namespace wpi {
+
+class NetworkStream;
+
+class raw_socket_istream : public raw_istream {
+ public:
+  explicit raw_socket_istream(NetworkStream& stream, int timeout = 0)
+      : m_stream(stream), m_timeout(timeout) {}
+
+  void close() override;
+  size_t in_avail() const override;
+
+ private:
+  void read_impl(void* data, size_t len) override;
+
+  NetworkStream& m_stream;
+  int m_timeout;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_RAW_SOCKET_ISTREAM_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/raw_socket_ostream.h b/third_party/wpiutil_2018/src/main/native/include/support/raw_socket_ostream.h
new file mode 100644
index 0000000..9349e75
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/raw_socket_ostream.h
@@ -0,0 +1,42 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_RAW_SOCKET_OSTREAM_H_
+#define WPIUTIL_SUPPORT_RAW_SOCKET_OSTREAM_H_
+
+#include "llvm/raw_ostream.h"
+
+namespace wpi {
+
+class NetworkStream;
+
+class raw_socket_ostream : public llvm::raw_ostream {
+ public:
+  raw_socket_ostream(NetworkStream& stream, bool shouldClose)
+      : m_stream(stream), m_shouldClose(shouldClose) {}
+  ~raw_socket_ostream();
+
+  void close();
+
+  bool has_error() const { return m_error; }
+  void clear_error() { m_error = false; }
+
+ protected:
+  void error_detected() { m_error = true; }
+
+ private:
+  void write_impl(const char* data, size_t len) override;
+  uint64_t current_pos() const override;
+
+  NetworkStream& m_stream;
+  bool m_error = false;
+  bool m_shouldClose;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_RAW_SOCKET_OSTREAM_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/sha1.h b/third_party/wpiutil_2018/src/main/native/include/support/sha1.h
new file mode 100644
index 0000000..9871393
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/sha1.h
@@ -0,0 +1,56 @@
+/*
+    sha1.hpp - header of
+
+    ============
+    SHA-1 in C++
+    ============
+
+    100% Public Domain.
+
+    Original C Code
+        -- Steve Reid <steve@edmweb.com>
+    Small changes to fit into bglibs
+        -- Bruce Guenter <bruce@untroubled.org>
+    Translation to simpler C++ Code
+        -- Volker Grabsch <vog@notjusthosting.com>
+    Safety fixes
+        -- Eugene Hopkinson <slowriot at voxelstorm dot com>
+*/
+
+#ifndef WPIUTIL_SUPPORT_SHA1_H_
+#define WPIUTIL_SUPPORT_SHA1_H_
+
+#include <stdint.h>
+
+#include <string>
+
+#include "llvm/StringRef.h"
+
+namespace llvm {
+template <typename T>
+class SmallVectorImpl;
+}  // namespace llvm
+
+namespace wpi {
+
+class raw_istream;
+
+class SHA1 {
+ public:
+  SHA1();
+  void Update(llvm::StringRef s);
+  void Update(raw_istream& is);
+  std::string Final();
+  llvm::StringRef Final(llvm::SmallVectorImpl<char>& buf);
+  static std::string FromFile(llvm::StringRef filename);
+
+ private:
+  uint32_t digest[5];
+  unsigned char buffer[64];
+  size_t buf_size;
+  uint64_t transforms;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_SUPPORT_SHA1_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/support/timestamp.h b/third_party/wpiutil_2018/src/main/native/include/support/timestamp.h
new file mode 100644
index 0000000..c1f833a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/support/timestamp.h
@@ -0,0 +1,71 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_SUPPORT_TIMESTAMP_H_
+#define WPIUTIL_SUPPORT_TIMESTAMP_H_
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The default implementation used for Now().
+ * In general this is the time returned by the operating system.
+ * @return Time in microseconds.
+ */
+uint64_t WPI_NowDefault(void);
+
+/**
+ * Set the implementation used by WPI_Now().
+ * The implementation must return monotonic time in microseconds to maintain
+ * the contract of WPI_Now().
+ * @param func Function called by WPI_Now() to return the time.
+ */
+void WPI_SetNowImpl(uint64_t (*func)(void));
+
+/**
+ * Return a value representing the current time in microseconds.
+ * The epoch is not defined.
+ * @return Time in microseconds.
+ */
+uint64_t WPI_Now(void);
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#ifdef __cplusplus
+namespace wpi {
+
+/**
+ * The default implementation used for Now().
+ * In general this is the time returned by the operating system.
+ * @return Time in microseconds.
+ */
+uint64_t NowDefault(void);
+
+/**
+ * Set the implementation used by Now().
+ * The implementation must return monotonic time in microseconds to maintain
+ * the contract of Now().
+ * @param func Function called by Now() to return the time.
+ */
+void SetNowImpl(uint64_t (*func)());
+
+/**
+ * Return a value representing the current time in microseconds.
+ * This is a monotonic clock with an undefined epoch.
+ * @return Time in microseconds.
+ */
+uint64_t Now(void);
+
+}  // namespace wpi
+#endif
+
+#endif  // WPIUTIL_SUPPORT_TIMESTAMP_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/tcpsockets/NetworkAcceptor.h b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/NetworkAcceptor.h
new file mode 100644
index 0000000..cf75e3c
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/NetworkAcceptor.h
@@ -0,0 +1,32 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_TCPSOCKETS_NETWORKACCEPTOR_H_
+#define WPIUTIL_TCPSOCKETS_NETWORKACCEPTOR_H_
+
+#include <memory>
+
+#include "tcpsockets/NetworkStream.h"
+
+namespace wpi {
+
+class NetworkAcceptor {
+ public:
+  NetworkAcceptor() = default;
+  virtual ~NetworkAcceptor() = default;
+
+  virtual int start() = 0;
+  virtual void shutdown() = 0;
+  virtual std::unique_ptr<NetworkStream> accept() = 0;
+
+  NetworkAcceptor(const NetworkAcceptor&) = delete;
+  NetworkAcceptor& operator=(const NetworkAcceptor&) = delete;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_TCPSOCKETS_NETWORKACCEPTOR_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/tcpsockets/NetworkStream.h b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/NetworkStream.h
new file mode 100644
index 0000000..4798bad
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/NetworkStream.h
@@ -0,0 +1,48 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_TCPSOCKETS_NETWORKSTREAM_H_
+#define WPIUTIL_TCPSOCKETS_NETWORKSTREAM_H_
+
+#include <cstddef>
+
+#include "llvm/StringRef.h"
+
+namespace wpi {
+
+class NetworkStream {
+ public:
+  NetworkStream() = default;
+  virtual ~NetworkStream() = default;
+
+  enum Error {
+    kConnectionClosed = 0,
+    kConnectionReset = -1,
+    kConnectionTimedOut = -2,
+    kWouldBlock = -3
+  };
+
+  virtual size_t send(const char* buffer, size_t len, Error* err) = 0;
+  virtual size_t receive(char* buffer, size_t len, Error* err,
+                         int timeout = 0) = 0;
+  virtual void close() = 0;
+
+  virtual llvm::StringRef getPeerIP() const = 0;
+  virtual int getPeerPort() const = 0;
+  virtual void setNoDelay() = 0;
+
+  // returns false on failure
+  virtual bool setBlocking(bool enabled) = 0;
+  virtual int getNativeHandle() const = 0;
+
+  NetworkStream(const NetworkStream&) = delete;
+  NetworkStream& operator=(const NetworkStream&) = delete;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_TCPSOCKETS_NETWORKSTREAM_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/tcpsockets/SocketError.h b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/SocketError.h
new file mode 100644
index 0000000..c811dc9
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/SocketError.h
@@ -0,0 +1,25 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_TCPSOCKETS_SOCKETERROR_H_
+#define WPIUTIL_TCPSOCKETS_SOCKETERROR_H_
+
+#include <string>
+
+namespace wpi {
+
+int SocketErrno();
+
+std::string SocketStrerror(int code);
+
+static inline std::string SocketStrerror() {
+  return SocketStrerror(SocketErrno());
+}
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_TCPSOCKETS_SOCKETERROR_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPAcceptor.h b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPAcceptor.h
new file mode 100644
index 0000000..d20545d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPAcceptor.h
@@ -0,0 +1,57 @@
+/*
+   TCPAcceptor.h
+
+   TCPAcceptor class interface. TCPAcceptor provides methods to passively
+   establish TCP/IP connections with clients.
+
+   ------------------------------------------
+
+   Copyright (c) 2013 [Vic Hargrave - http://vichargrave.com]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+#ifndef WPIUTIL_TCPSOCKETS_TCPACCEPTOR_H_
+#define WPIUTIL_TCPSOCKETS_TCPACCEPTOR_H_
+
+#include <atomic>
+#include <memory>
+#include <string>
+
+#include "tcpsockets/NetworkAcceptor.h"
+#include "tcpsockets/TCPStream.h"
+
+namespace wpi {
+
+class Logger;
+
+class TCPAcceptor : public NetworkAcceptor {
+  int m_lsd;
+  int m_port;
+  std::string m_address;
+  bool m_listening;
+  std::atomic_bool m_shutdown;
+  Logger& m_logger;
+
+ public:
+  TCPAcceptor(int port, const char* address, Logger& logger);
+  ~TCPAcceptor();
+
+  int start() override;
+  void shutdown() override;
+  std::unique_ptr<NetworkStream> accept() override;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_TCPSOCKETS_TCPACCEPTOR_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPConnector.h b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPConnector.h
new file mode 100644
index 0000000..9d2535b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPConnector.h
@@ -0,0 +1,49 @@
+/*
+   TCPConnector.h
+
+   TCPConnector class interface. TCPConnector provides methods to actively
+   establish TCP/IP connections with a server.
+
+   ------------------------------------------
+
+   Copyright (c) 2013 [Vic Hargrave - http://vichargrave.com]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License
+*/
+
+#ifndef WPIUTIL_TCPSOCKETS_TCPCONNECTOR_H_
+#define WPIUTIL_TCPSOCKETS_TCPCONNECTOR_H_
+
+#include <memory>
+#include <utility>
+
+#include "llvm/ArrayRef.h"
+#include "tcpsockets/NetworkStream.h"
+
+namespace wpi {
+
+class Logger;
+
+class TCPConnector {
+ public:
+  static std::unique_ptr<NetworkStream> connect(const char* server, int port,
+                                                Logger& logger,
+                                                int timeout = 0);
+  static std::unique_ptr<NetworkStream> connect_parallel(
+      llvm::ArrayRef<std::pair<const char*, int>> servers, Logger& logger,
+      int timeout = 0);
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_TCPSOCKETS_TCPCONNECTOR_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPStream.h b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPStream.h
new file mode 100644
index 0000000..9e80bbc
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/tcpsockets/TCPStream.h
@@ -0,0 +1,71 @@
+/*
+   TCPStream.h
+
+   TCPStream class interface. TCPStream provides methods to trasnfer
+   data between peers over a TCP/IP connection.
+
+   ------------------------------------------
+
+   Copyright (c) 2013 [Vic Hargrave - http://vichargrave.com]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
+#ifndef WPIUTIL_TCPSOCKETS_TCPSTREAM_H_
+#define WPIUTIL_TCPSOCKETS_TCPSTREAM_H_
+
+#include <cstddef>
+#include <string>
+
+#include "tcpsockets/NetworkStream.h"
+
+struct sockaddr_in;
+
+namespace wpi {
+
+class TCPStream : public NetworkStream {
+  int m_sd;
+  std::string m_peerIP;
+  int m_peerPort;
+  bool m_blocking;
+
+ public:
+  friend class TCPAcceptor;
+  friend class TCPConnector;
+
+  ~TCPStream();
+
+  size_t send(const char* buffer, size_t len, Error* err) override;
+  size_t receive(char* buffer, size_t len, Error* err,
+                 int timeout = 0) override;
+  void close() override;
+
+  llvm::StringRef getPeerIP() const override;
+  int getPeerPort() const override;
+  void setNoDelay() override;
+  bool setBlocking(bool enabled) override;
+  int getNativeHandle() const override;
+
+  TCPStream(const TCPStream& stream) = delete;
+  TCPStream& operator=(const TCPStream&) = delete;
+
+ private:
+  bool WaitForReadEvent(int timeout);
+
+  TCPStream(int sd, sockaddr_in* address);
+  TCPStream() = delete;
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_TCPSOCKETS_TCPSTREAM_H_
diff --git a/third_party/wpiutil_2018/src/main/native/include/udpsockets/UDPClient.h b/third_party/wpiutil_2018/src/main/native/include/udpsockets/UDPClient.h
new file mode 100644
index 0000000..e6cd6e0
--- /dev/null
+++ b/third_party/wpiutil_2018/src/main/native/include/udpsockets/UDPClient.h
@@ -0,0 +1,45 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#ifndef WPIUTIL_UDPSOCKETS_UDPCLIENT_H_
+#define WPIUTIL_UDPSOCKETS_UDPCLIENT_H_
+
+#include <string>
+
+#include "llvm/ArrayRef.h"
+#include "llvm/StringRef.h"
+#include "support/mutex.h"
+
+namespace wpi {
+
+class Logger;
+
+class UDPClient {
+  int m_lsd;
+  std::string m_address;
+  Logger& m_logger;
+
+ public:
+  explicit UDPClient(Logger& logger);
+  UDPClient(llvm::StringRef address, Logger& logger);
+  UDPClient(const UDPClient& other) = delete;
+  UDPClient(UDPClient&& other);
+  ~UDPClient();
+
+  UDPClient& operator=(const UDPClient& other) = delete;
+  UDPClient& operator=(UDPClient&& other);
+
+  int start();
+  void shutdown();
+  // The passed in address MUST be a resolved IP address.
+  int send(llvm::ArrayRef<uint8_t> data, llvm::StringRef server, int port);
+  int send(llvm::StringRef data, llvm::StringRef server, int port);
+};
+
+}  // namespace wpi
+
+#endif  // WPIUTIL_UDPSOCKETS_UDPCLIENT_H_
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/Base64Test.cpp b/third_party/wpiutil_2018/src/test/native/cpp/Base64Test.cpp
new file mode 100644
index 0000000..33dfdfa
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/Base64Test.cpp
@@ -0,0 +1,105 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "gtest/gtest.h"
+#include "llvm/SmallString.h"
+#include "support/Base64.h"
+
+namespace wpi {
+
+struct Base64TestParam {
+  int plain_len;
+  const char* plain;
+  const char* encoded;
+};
+
+std::ostream& operator<<(std::ostream& os, const Base64TestParam& param) {
+  os << "Base64TestParam(Len: " << param.plain_len << ", "
+     << "Plain: \"" << param.plain << "\", "
+     << "Encoded: \"" << param.encoded << "\")";
+  return os;
+}
+
+class Base64Test : public ::testing::TestWithParam<Base64TestParam> {
+ protected:
+  llvm::StringRef GetPlain() {
+    if (GetParam().plain_len < 0)
+      return llvm::StringRef(GetParam().plain);
+    else
+      return llvm::StringRef(GetParam().plain, GetParam().plain_len);
+  }
+};
+
+TEST_P(Base64Test, EncodeStdString) {
+  std::string s;
+  Base64Encode(GetPlain(), &s);
+  ASSERT_EQ(GetParam().encoded, s);
+
+  // text already in s
+  Base64Encode(GetPlain(), &s);
+  ASSERT_EQ(GetParam().encoded, s);
+}
+
+TEST_P(Base64Test, EncodeSmallString) {
+  llvm::SmallString<128> buf;
+  ASSERT_EQ(GetParam().encoded, Base64Encode(GetPlain(), buf));
+  // reuse buf
+  ASSERT_EQ(GetParam().encoded, Base64Encode(GetPlain(), buf));
+}
+
+TEST_P(Base64Test, DecodeStdString) {
+  std::string s;
+  llvm::StringRef encoded = GetParam().encoded;
+  EXPECT_EQ(encoded.size(), Base64Decode(encoded, &s));
+  ASSERT_EQ(GetPlain(), s);
+
+  // text already in s
+  Base64Decode(encoded, &s);
+  ASSERT_EQ(GetPlain(), s);
+}
+
+TEST_P(Base64Test, DecodeSmallString) {
+  llvm::SmallString<128> buf;
+  llvm::StringRef encoded = GetParam().encoded;
+  size_t len;
+  llvm::StringRef plain = Base64Decode(encoded, &len, buf);
+  EXPECT_EQ(encoded.size(), len);
+  ASSERT_EQ(GetPlain(), plain);
+
+  // reuse buf
+  plain = Base64Decode(encoded, &len, buf);
+  ASSERT_EQ(GetPlain(), plain);
+}
+
+static Base64TestParam sample[] = {
+    {-1, "Send reinforcements", "U2VuZCByZWluZm9yY2VtZW50cw=="},
+    {-1, "Now is the time for all good coders\n to learn C++",
+     "Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKIHRvIGxlYXJuIEMrKw=="},
+    {-1,
+     "This is line one\nThis is line two\nThis is line three\nAnd so on...\n",
+     "VGhpcyBpcyBsaW5lIG9uZQpUaGlzIGlzIGxpbmUgdHdvClRoaXMgaXMgbGluZSB0aHJlZQpBb"
+     "mQgc28gb24uLi4K"},
+};
+
+INSTANTIATE_TEST_CASE_P(Base64Sample, Base64Test,
+                        ::testing::ValuesIn(sample), );
+
+static Base64TestParam standard[] = {
+    {0, "", ""},
+    {1, "\0", "AA=="},
+    {2, "\0\0", "AAA="},
+    {3, "\0\0\0", "AAAA"},
+    {1, "\377", "/w=="},
+    {2, "\377\377", "//8="},
+    {3, "\377\377\377", "////"},
+    {2, "\xff\xef", "/+8="},
+};
+
+INSTANTIATE_TEST_CASE_P(Base64Standard, Base64Test,
+                        ::testing::ValuesIn(standard), );
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/hostname.cpp b/third_party/wpiutil_2018/src/test/native/cpp/hostname.cpp
new file mode 100644
index 0000000..805274b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/hostname.cpp
@@ -0,0 +1,20 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "support/hostname.h"
+
+#include "gtest/gtest.h"
+#include "llvm/SmallString.h"
+#include "llvm/SmallVector.h"
+
+namespace wpi {
+TEST(HostNameTest, HostNameNotEmpty) { ASSERT_NE(wpi::GetHostname(), ""); }
+TEST(HostNameTest, HostNameNotEmptySmallVector) {
+  llvm::SmallVector<char, 256> name;
+  ASSERT_NE(wpi::GetHostname(name), "");
+}
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-algorithms.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-algorithms.cpp
new file mode 100644
index 0000000..f1a8745
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-algorithms.cpp
@@ -0,0 +1,310 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+#include <algorithm>
+
+class JsonAlgorithmsTest : public ::testing::Test {
+ protected:
+    json j_array = {13, 29, 3, {{"one", 1}, {"two", 2}}, true, false, {1, 2, 3}, "foo", "baz"};
+    json j_object = {{"one", 1}, {"two", 2}};
+};
+
+// non-modifying sequence operations
+TEST_F(JsonAlgorithmsTest, AllOf)
+{
+    EXPECT_TRUE(std::all_of(j_array.begin(), j_array.end(), [](const json & value)
+    {
+        return value.size() > 0;
+    }));
+    EXPECT_TRUE(std::all_of(j_object.begin(), j_object.end(), [](const json & value)
+    {
+        return value.type() == json::value_t::number_integer;
+    }));
+}
+
+TEST_F(JsonAlgorithmsTest, AnyOf)
+{
+    EXPECT_TRUE(std::any_of(j_array.begin(), j_array.end(), [](const json & value)
+    {
+        return value.is_string() && value.get<std::string>() == "foo";
+    }));
+    EXPECT_TRUE(std::any_of(j_object.begin(), j_object.end(), [](const json & value)
+    {
+        return value.get<int>() > 1;
+    }));
+}
+
+TEST_F(JsonAlgorithmsTest, NoneOf)
+{
+    EXPECT_TRUE(std::none_of(j_array.begin(), j_array.end(), [](const json & value)
+    {
+        return value.size() == 0;
+    }));
+    EXPECT_TRUE(std::none_of(j_object.begin(), j_object.end(), [](const json & value)
+    {
+        return value.get<int>() <= 0;
+    }));
+}
+
+TEST_F(JsonAlgorithmsTest, ForEachReading)
+{
+    int sum = 0;
+
+    std::for_each(j_array.cbegin(), j_array.cend(), [&sum](const json & value)
+    {
+        if (value.is_number())
+        {
+            sum += static_cast<int>(value);
+        }
+    });
+
+    EXPECT_EQ(sum, 45);
+}
+
+TEST_F(JsonAlgorithmsTest, ForEachWriting)
+{
+    auto add17 = [](json & value)
+    {
+        if (value.is_array())
+        {
+            value.push_back(17);
+        }
+    };
+
+    std::for_each(j_array.begin(), j_array.end(), add17);
+
+    EXPECT_EQ(j_array[6], json({1, 2, 3, 17}));
+}
+
+TEST_F(JsonAlgorithmsTest, Count)
+{
+    EXPECT_EQ(std::count(j_array.begin(), j_array.end(), json(true)), 1);
+}
+
+TEST_F(JsonAlgorithmsTest, CountIf)
+{
+    auto count1 = std::count_if(j_array.begin(), j_array.end(), [](const json & value)
+    {
+        return (value.is_number());
+    });
+    EXPECT_EQ(count1, 3);
+    auto count2 = std::count_if(j_array.begin(), j_array.end(), [](const json&)
+    {
+        return true;
+    });
+    EXPECT_EQ(count2, 9);
+}
+
+TEST_F(JsonAlgorithmsTest, Mismatch)
+{
+    json j_array2 = {13, 29, 3, {{"one", 1}, {"two", 2}, {"three", 3}}, true, false, {1, 2, 3}, "foo", "baz"};
+    auto res = std::mismatch(j_array.begin(), j_array.end(), j_array2.begin());
+    EXPECT_EQ(*res.first, json({{"one", 1}, {"two", 2}}));
+    EXPECT_EQ(*res.second, json({{"one", 1}, {"two", 2}, {"three", 3}}));
+}
+
+TEST_F(JsonAlgorithmsTest, EqualOperatorEquals)
+{
+    EXPECT_TRUE(std::equal(j_array.begin(), j_array.end(), j_array.begin()));
+    EXPECT_TRUE(std::equal(j_object.begin(), j_object.end(), j_object.begin()));
+    EXPECT_FALSE(std::equal(j_array.begin(), j_array.end(), j_object.begin()));
+}
+
+TEST_F(JsonAlgorithmsTest, EqualUserComparison)
+{
+    // compare objects only by size of its elements
+    json j_array2 = {13, 29, 3, {"Hello", "World"}, true, false, {{"one", 1}, {"two", 2}, {"three", 3}}, "foo", "baz"};
+    EXPECT_FALSE(std::equal(j_array.begin(), j_array.end(), j_array2.begin()));
+    EXPECT_TRUE(std::equal(j_array.begin(), j_array.end(), j_array2.begin(),
+                     [](const json & a, const json & b)
+    {
+        return (a.size() == b.size());
+    }));
+}
+
+TEST_F(JsonAlgorithmsTest, Find)
+{
+    auto it = std::find(j_array.begin(), j_array.end(), json(false));
+    EXPECT_EQ(std::distance(j_array.begin(), it), 5);
+}
+
+TEST_F(JsonAlgorithmsTest, FindIf)
+{
+    auto it = std::find_if(j_array.begin(), j_array.end(),
+                           [](const json & value)
+    {
+        return value.is_boolean();
+    });
+    EXPECT_EQ(std::distance(j_array.begin(), it), 4);
+}
+
+TEST_F(JsonAlgorithmsTest, FindIfNot)
+{
+    auto it = std::find_if_not(j_array.begin(), j_array.end(),
+                               [](const json & value)
+    {
+        return value.is_number();
+    });
+    EXPECT_EQ(std::distance(j_array.begin(), it), 3);
+}
+
+TEST_F(JsonAlgorithmsTest, AdjacentFind)
+{
+    EXPECT_EQ(std::adjacent_find(j_array.begin(), j_array.end()), j_array.end());
+    auto it = std::adjacent_find(j_array.begin(), j_array.end(),
+                             [](const json & v1, const json & v2)
+    {
+        return v1.type() == v2.type();
+    });
+    EXPECT_EQ(it, j_array.begin());
+}
+
+// modifying sequence operations
+TEST_F(JsonAlgorithmsTest, Reverse)
+{
+    std::reverse(j_array.begin(), j_array.end());
+    EXPECT_EQ(j_array, json({"baz", "foo", {1, 2, 3}, false, true, {{"one", 1}, {"two", 2}}, 3, 29, 13}));
+}
+
+TEST_F(JsonAlgorithmsTest, Rotate)
+{
+    std::rotate(j_array.begin(), j_array.begin() + 1, j_array.end());
+    EXPECT_EQ(j_array, json({29, 3, {{"one", 1}, {"two", 2}}, true, false, {1, 2, 3}, "foo", "baz", 13}));
+}
+
+TEST_F(JsonAlgorithmsTest, Partition)
+{
+    auto it = std::partition(j_array.begin(), j_array.end(), [](const json & v)
+    {
+        return v.is_string();
+    });
+    EXPECT_EQ(std::distance(j_array.begin(), it), 2);
+    EXPECT_FALSE(it[2].is_string());
+}
+
+// sorting operations
+TEST_F(JsonAlgorithmsTest, SortOperatorEquals)
+{
+    json j = {13, 29, 3, {{"one", 1}, {"two", 2}}, true, false, {1, 2, 3}, "foo", "baz", nullptr};
+    std::sort(j.begin(), j.end());
+    EXPECT_EQ(j, json({nullptr, false, true, 3, 13, 29, {{"one", 1}, {"two", 2}}, {1, 2, 3}, "baz", "foo"}));
+}
+
+TEST_F(JsonAlgorithmsTest, SortUserComparison)
+{
+    json j = {3, {{"one", 1}, {"two", 2}}, {1, 2, 3}, nullptr};
+    std::sort(j.begin(), j.end(), [](const json & a, const json & b)
+    {
+        return a.size() < b.size();
+    });
+    EXPECT_EQ(j, json({nullptr, 3, {{"one", 1}, {"two", 2}}, {1, 2, 3}}));
+}
+
+TEST_F(JsonAlgorithmsTest, SortObject)
+{
+    json j({{"one", 1}, {"two", 2}});
+    EXPECT_THROW_MSG(std::sort(j.begin(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+}
+
+TEST_F(JsonAlgorithmsTest, PartialSort)
+{
+    json j = {13, 29, 3, {{"one", 1}, {"two", 2}}, true, false, {1, 2, 3}, "foo", "baz", nullptr};
+    std::partial_sort(j.begin(), j.begin() + 4, j.end());
+    EXPECT_EQ(j, json({nullptr, false, true, 3, {{"one", 1}, {"two", 2}}, 29, {1, 2, 3}, "foo", "baz", 13}));
+}
+
+// set operations
+TEST_F(JsonAlgorithmsTest, Merge)
+{
+    json j1 = {2, 4, 6, 8};
+    json j2 = {1, 2, 3, 5, 7};
+    json j3;
+
+    std::merge(j1.begin(), j1.end(), j2.begin(), j2.end(), std::back_inserter(j3));
+    EXPECT_EQ(j3, json({1, 2, 2, 3, 4, 5, 6, 7, 8}));
+}
+
+TEST_F(JsonAlgorithmsTest, SetDifference)
+{
+    json j1 = {1, 2, 3, 4, 5, 6, 7, 8};
+    json j2 = {1, 2, 3, 5, 7};
+    json j3;
+
+    std::set_difference(j1.begin(), j1.end(), j2.begin(), j2.end(), std::back_inserter(j3));
+    EXPECT_EQ(j3, json({4, 6, 8}));
+}
+
+TEST_F(JsonAlgorithmsTest, SetIntersection)
+{
+    json j1 = {1, 2, 3, 4, 5, 6, 7, 8};
+    json j2 = {1, 2, 3, 5, 7};
+    json j3;
+
+    std::set_intersection(j1.begin(), j1.end(), j2.begin(), j2.end(), std::back_inserter(j3));
+    EXPECT_EQ(j3, json({1, 2, 3, 5, 7}));
+}
+
+TEST_F(JsonAlgorithmsTest, SetUnion)
+{
+    json j1 = {2, 4, 6, 8};
+    json j2 = {1, 2, 3, 5, 7};
+    json j3;
+
+    std::set_union(j1.begin(), j1.end(), j2.begin(), j2.end(), std::back_inserter(j3));
+    EXPECT_EQ(j3, json({1, 2, 3, 4, 5, 6, 7, 8}));
+}
+
+TEST_F(JsonAlgorithmsTest, SetSymmetricDifference)
+{
+    json j1 = {2, 4, 6, 8};
+    json j2 = {1, 2, 3, 5, 7};
+    json j3;
+
+    std::set_symmetric_difference(j1.begin(), j1.end(), j2.begin(), j2.end(), std::back_inserter(j3));
+    EXPECT_EQ(j3, json({1, 3, 4, 5, 6, 7, 8}));
+}
+
+TEST_F(JsonAlgorithmsTest, HeapOperations)
+{
+    std::make_heap(j_array.begin(), j_array.end());
+    EXPECT_TRUE(std::is_heap(j_array.begin(), j_array.end()));
+    std::sort_heap(j_array.begin(), j_array.end());
+    EXPECT_EQ(j_array, json({false, true, 3, 13, 29, {{"one", 1}, {"two", 2}}, {1, 2, 3}, "baz", "foo"}));
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-capacity.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-capacity.cpp
new file mode 100644
index 0000000..8f5433e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-capacity.cpp
@@ -0,0 +1,528 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonEmptyTest, Boolean)
+{
+    json j = true;
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, String)
+{
+    json j = "hello world";
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, ArrayEmpty)
+{
+    json j = json::array();
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_TRUE(j.empty());
+        EXPECT_TRUE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, ArrayFilled)
+{
+    json j = {1, 2, 3};
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, ObjectEmpty)
+{
+    json j = json::object();
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_TRUE(j.empty());
+        EXPECT_TRUE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, ObjectFilled)
+{
+    json j = {{"one", 1}, {"two", 2}, {"three", 3}};
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, NumberInteger)
+{
+    json j = 23;
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, NumberUnsigned)
+{
+    json j = 23u;
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, NumberFloat)
+{
+    json j = 23.42;
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_FALSE(j.empty());
+        EXPECT_FALSE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonEmptyTest, Null)
+{
+    json j = nullptr;
+    json j_const(j);
+
+    // result of empty
+    {
+        EXPECT_TRUE(j.empty());
+        EXPECT_TRUE(j_const.empty());
+    }
+
+    // definition of empty
+    {
+        EXPECT_EQ(j.empty(), (j.begin() == j.end()));
+        EXPECT_EQ(j_const.empty(), (j_const.begin() == j_const.end()));
+    }
+}
+
+TEST(JsonSizeTest, Boolean)
+{
+    json j = true;
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 1u);
+        EXPECT_EQ(j_const.size(), 1u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, String)
+{
+    json j = "hello world";
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 1u);
+        EXPECT_EQ(j_const.size(), 1u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, ArrayEmpty)
+{
+    json j = json::array();
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 0u);
+        EXPECT_EQ(j_const.size(), 0u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, ArrayFilled)
+{
+    json j = {1, 2, 3};
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 3u);
+        EXPECT_EQ(j_const.size(), 3u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, ObjectEmpty)
+{
+    json j = json::object();
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 0u);
+        EXPECT_EQ(j_const.size(), 0u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, ObjectFilled)
+{
+    json j = {{"one", 1}, {"two", 2}, {"three", 3}};
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 3u);
+        EXPECT_EQ(j_const.size(), 3u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, NumberInteger)
+{
+    json j = 23;
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 1u);
+        EXPECT_EQ(j_const.size(), 1u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, NumberUnsigned)
+{
+    json j = 23u;
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 1u);
+        EXPECT_EQ(j_const.size(), 1u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, NumberFloat)
+{
+    json j = 23.42;
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 1u);
+        EXPECT_EQ(j_const.size(), 1u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonSizeTest, Null)
+{
+    json j = nullptr;
+    json j_const(j);
+
+    // result of size
+    {
+        EXPECT_EQ(j.size(), 0u);
+        EXPECT_EQ(j_const.size(), 0u);
+    }
+
+    // definition of size
+    {
+        EXPECT_EQ(std::distance(j.begin(), j.end()), static_cast<int>(j.size()));
+        EXPECT_EQ(std::distance(j_const.begin(), j_const.end()),
+                  static_cast<int>(j_const.size()));
+    }
+}
+
+TEST(JsonMaxSizeTest, Boolean)
+{
+    json j = true;
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_EQ(j.max_size(), 1u);
+        EXPECT_EQ(j_const.max_size(), 1u);
+    }
+}
+
+TEST(JsonMaxSizeTest, String)
+{
+    json j = "hello world";
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_EQ(j.max_size(), 1u);
+        EXPECT_EQ(j_const.max_size(), 1u);
+    }
+}
+
+TEST(JsonMaxSizeTest, ArrayEmpty)
+{
+    json j = json::array();
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_GE(j.max_size(), j.size());
+        EXPECT_GE(j_const.max_size(), j_const.size());
+    }
+}
+
+TEST(JsonMaxSizeTest, ArrayFilled)
+{
+    json j = {1, 2, 3};
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_GE(j.max_size(), j.size());
+        EXPECT_GE(j_const.max_size(), j_const.size());
+    }
+}
+
+TEST(JsonMaxSizeTest, ObjectEmpty)
+{
+    json j = json::object();
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_GE(j.max_size(), j.size());
+        EXPECT_GE(j_const.max_size(), j_const.size());
+    }
+}
+
+TEST(JsonMaxSizeTest, ObjectFilled)
+{
+    json j = {{"one", 1}, {"two", 2}, {"three", 3}};
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_GE(j.max_size(), j.size());
+        EXPECT_GE(j_const.max_size(), j_const.size());
+    }
+}
+
+TEST(JsonMaxSizeTest, NumberInteger)
+{
+    json j = 23;
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_EQ(j.max_size(), 1u);
+        EXPECT_EQ(j_const.max_size(), 1u);
+    }
+}
+
+TEST(JsonMaxSizeTest, NumberUnsigned)
+{
+    json j = 23u;
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_EQ(j.max_size(), 1u);
+        EXPECT_EQ(j_const.max_size(), 1u);
+    }
+}
+
+TEST(JsonMaxSizeTest, NumberFloat)
+{
+    json j = 23.42;
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_EQ(j.max_size(), 1u);
+        EXPECT_EQ(j_const.max_size(), 1u);
+    }
+}
+
+TEST(JsonMaxSizeTest, Null)
+{
+    json j = nullptr;
+    json j_const(j);
+
+    // result of max_size
+    {
+        EXPECT_EQ(j.max_size(), 0u);
+        EXPECT_EQ(j_const.max_size(), 0u);
+    }
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-cbor.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-cbor.cpp
new file mode 100644
index 0000000..4f2785d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-cbor.cpp
@@ -0,0 +1,1689 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+#include <fstream>
+
+TEST(CborDiscardedTest, Case)
+{
+    // discarded values are not serialized
+    json j = json::value_t::discarded;
+    const auto result = json::to_cbor(j);
+    ASSERT_TRUE(result.empty());
+}
+
+TEST(CborNullTest, Case)
+{
+    json j = nullptr;
+    std::string expected = "\xf6";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+TEST(CborBooleanTest, True)
+{
+    json j = true;
+    std::string expected = "\xf5";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+TEST(CborBooleanTest, False)
+{
+    json j = false;
+    std::string expected = "\xf4";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// -9223372036854775808..-4294967297
+class CborSignedNeg8Test : public ::testing::TestWithParam<int64_t> {};
+TEST_P(CborSignedNeg8Test, Case)
+{
+    // create JSON value with integer number
+    json j = GetParam();
+
+    // check type
+    ASSERT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0x3b));
+    uint64_t positive = static_cast<uint64_t>(-1 - GetParam());
+    expected.push_back(static_cast<char>((positive >> 56) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 48) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 40) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 32) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 24) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 16) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 8) & 0xff));
+    expected.push_back(static_cast<char>(positive & 0xff));
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), 9u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], 0x3b);
+    uint64_t restored = (static_cast<uint64_t>(static_cast<uint8_t>(result[1])) << 070) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[2])) << 060) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[3])) << 050) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[4])) << 040) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[5])) << 030) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[6])) << 020) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[7])) << 010) +
+                        static_cast<uint64_t>(static_cast<uint8_t>(result[8]));
+    EXPECT_EQ(restored, positive);
+    EXPECT_EQ(-1 - static_cast<int64_t>(restored), GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+static const int64_t neg8_numbers[] = {
+    INT64_MIN,
+    -1000000000000000000,
+    -100000000000000000,
+    -10000000000000000,
+    -1000000000000000,
+    -100000000000000,
+    -10000000000000,
+    -1000000000000,
+    -100000000000,
+    -10000000000,
+    -4294967297,
+};
+
+INSTANTIATE_TEST_CASE_P(CborSignedNeg8Tests, CborSignedNeg8Test,
+                        ::testing::ValuesIn(neg8_numbers), );
+
+// -4294967296..-65537
+class CborSignedNeg4Test : public ::testing::TestWithParam<int64_t> {};
+TEST_P(CborSignedNeg4Test, Case)
+{
+    // create JSON value with integer number
+    json j = GetParam();
+
+    // check type
+    ASSERT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0x3a));
+    uint32_t positive = static_cast<uint32_t>(static_cast<uint64_t>(-1 - GetParam()) & 0x00000000ffffffff);
+    expected.push_back(static_cast<char>((positive >> 24) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 16) & 0xff));
+    expected.push_back(static_cast<char>((positive >> 8) & 0xff));
+    expected.push_back(static_cast<char>(positive & 0xff));
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), 5u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], 0x3a);
+    uint32_t restored = (static_cast<uint32_t>(static_cast<uint8_t>(result[1])) << 030) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[2])) << 020) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[3])) << 010) +
+                        static_cast<uint32_t>(static_cast<uint8_t>(result[4]));
+    EXPECT_EQ(restored, positive);
+    EXPECT_EQ(-1ll - restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+static const int64_t neg4_numbers[] = {
+    -65537,
+    -100000,
+    -1000000,
+    -10000000,
+    -100000000,
+    -1000000000,
+    -4294967296,
+};
+
+INSTANTIATE_TEST_CASE_P(CborSignedNeg4Tests, CborSignedNeg4Test,
+                        ::testing::ValuesIn(neg4_numbers), );
+
+// -65536..-257
+TEST(CborSignedTest, Neg2)
+{
+    for (int32_t i = -65536; i <= -257; ++i) {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0x39));
+        uint16_t positive = static_cast<uint16_t>(-1 - i);
+        expected.push_back(static_cast<char>((positive >> 8) & 0xff));
+        expected.push_back(static_cast<char>(positive & 0xff));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0x39);
+        uint16_t restored = static_cast<uint16_t>(static_cast<uint8_t>(result[1]) * 256 + static_cast<uint8_t>(result[2]));
+        EXPECT_EQ(restored, positive);
+        EXPECT_EQ(-1 - restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// -9263 (int 16)
+TEST(CborSignedTest, NegInt16)
+{
+    json j = -9263;
+    std::string expected = "\x39\x24\x2e";
+
+    const auto result = json::to_cbor(j);
+    ASSERT_EQ(result, expected);
+
+    int16_t restored = static_cast<int16_t>(-1 - ((result[1] << 8) + result[2]));
+    EXPECT_EQ(restored, -9263);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// -256..-24
+TEST(CborSignedTest, Neg1)
+{
+    for (auto i = -256; i < -24; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(0x38);
+        expected.push_back(static_cast<char>(-1 - i));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 2u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0x38);
+        EXPECT_EQ(static_cast<int16_t>(-1 - static_cast<uint8_t>(result[1])), i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// -24..-1
+TEST(CborSignedTest, Neg0)
+{
+    for (auto i = -24; i <= -1; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0x20 - 1 - static_cast<uint8_t>(i)));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 1u);
+
+        // check individual bytes
+        EXPECT_EQ(static_cast<int8_t>(0x20 - 1 - result[0]), i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 0..23
+TEST(CborSignedTest, Pos0)
+{
+    for (size_t i = 0; i <= 23; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = -1;
+        j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 1u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(i));
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 24..255
+TEST(CborSignedTest, Pos1)
+{
+    for (size_t i = 24; i <= 255; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = -1;
+        j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0x18));
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 2u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0x18);
+        EXPECT_EQ(result[1], static_cast<char>(i));
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 256..65535
+TEST(CborSignedTest, Pos2)
+{
+    for (size_t i = 256; i <= 65535; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = -1;
+        j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0x19));
+        expected.push_back(static_cast<char>((i >> 8) & 0xff));
+        expected.push_back(static_cast<char>(i & 0xff));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0x19);
+        uint16_t restored = static_cast<uint16_t>(static_cast<uint8_t>(result[1]) * 256 + static_cast<uint8_t>(result[2]));
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 65536..4294967295
+class CborSignedPos4Test : public ::testing::TestWithParam<uint32_t> {};
+TEST_P(CborSignedPos4Test, Case)
+{
+    // create JSON value with integer number
+    json j = -1;
+    j.get_ref<json::number_integer_t&>() =
+        static_cast<json::number_integer_t>(GetParam());
+
+    // check type
+    ASSERT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(0x1a);
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), 5u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], 0x1a);
+    uint32_t restored = (static_cast<uint32_t>(static_cast<uint8_t>(result[1])) << 030) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[2])) << 020) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[3])) << 010) +
+                        static_cast<uint32_t>(static_cast<uint8_t>(result[4]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+static const uint32_t pos4_numbers[] = {
+    65536u,
+    77777u,
+    1048576u,
+};
+
+INSTANTIATE_TEST_CASE_P(CborSignedPos4Tests, CborSignedPos4Test,
+                        ::testing::ValuesIn(pos4_numbers), );
+
+// 4294967296..4611686018427387903
+class CborSignedPos8Test : public ::testing::TestWithParam<uint64_t> {};
+TEST_P(CborSignedPos8Test, Case)
+{
+    // create JSON value with integer number
+    json j = -1;
+    j.get_ref<json::number_integer_t&>() =
+        static_cast<json::number_integer_t>(GetParam());
+
+    // check type
+    ASSERT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(0x1b);
+    expected.push_back(static_cast<char>((GetParam() >> 070) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 060) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 050) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 040) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 030) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 020) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 010) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), 9u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], 0x1b);
+    uint64_t restored = (static_cast<uint64_t>(static_cast<uint8_t>(result[1])) << 070) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[2])) << 060) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[3])) << 050) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[4])) << 040) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[5])) << 030) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[6])) << 020) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[7])) << 010) +
+                        static_cast<uint64_t>(static_cast<uint8_t>(result[8]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+static const uint64_t pos8_numbers[] = {
+    4294967296ul,
+    4611686018427387903ul
+};
+
+INSTANTIATE_TEST_CASE_P(CborSignedPos8Tests, CborSignedPos8Test,
+                        ::testing::ValuesIn(pos8_numbers), );
+
+/*
+// -32768..-129 (int 16)
+{
+    for (int16_t i = -32768; i <= -129; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(0xd1);
+        expected.push_back(static_cast<char>((i >> 8) & 0xff));
+        expected.push_back(static_cast<char>(i & 0xff));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result == expected);
+        ASSERT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0xd1);
+        int16_t restored = (result[1] << 8) + result[2];
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+*/
+
+// 0..23 (Integer)
+TEST(CborUnsignedTest, Pos0)
+{
+    for (size_t i = 0; i <= 23; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with unsigned integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_unsigned());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 1u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(i));
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 24..255 (one-byte uint8_t)
+TEST(CborUnsignedTest, Pos1)
+{
+    for (size_t i = 24; i <= 255; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with unsigned integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_unsigned());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(0x18);
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 2u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0x18);
+        uint8_t restored = static_cast<uint8_t>(result[1]);
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 256..65535 (two-byte uint16_t)
+TEST(CborUnsignedTest, Pos2)
+{
+    for (size_t i = 256; i <= 65535; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with unsigned integer number
+        json j = i;
+
+        // check type
+        ASSERT_TRUE(j.is_number_unsigned());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(0x19);
+        expected.push_back(static_cast<char>((i >> 8) & 0xff));
+        expected.push_back(static_cast<char>(i & 0xff));
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], 0x19);
+        uint16_t restored = static_cast<uint16_t>(static_cast<uint8_t>(result[1]) * 256 + static_cast<uint8_t>(result[2]));
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// 65536..4294967295 (four-byte uint32_t)
+class CborUnsignedPos4Test : public ::testing::TestWithParam<uint32_t> {};
+TEST_P(CborUnsignedPos4Test, Case)
+{
+    // create JSON value with unsigned integer number
+    json j = GetParam();
+
+    // check type
+    ASSERT_TRUE(j.is_number_unsigned());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(0x1a);
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), 5u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], 0x1a);
+    uint32_t restored = (static_cast<uint32_t>(static_cast<uint8_t>(result[1])) << 030) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[2])) << 020) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[3])) << 010) +
+                        static_cast<uint32_t>(static_cast<uint8_t>(result[4]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+INSTANTIATE_TEST_CASE_P(CborUnsignedPos4Tests, CborUnsignedPos4Test,
+                        ::testing::ValuesIn(pos4_numbers), );
+
+// 4294967296..4611686018427387903 (eight-byte uint64_t)
+class CborUnsignedPos8Test : public ::testing::TestWithParam<uint64_t> {};
+TEST_P(CborUnsignedPos8Test, Case)
+{
+    // create JSON value with integer number
+    json j = GetParam();
+
+    // check type
+    ASSERT_TRUE(j.is_number_unsigned());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(0x1b);
+    expected.push_back(static_cast<char>((GetParam() >> 070) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 060) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 050) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 040) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 030) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 020) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 010) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), 9u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], 0x1b);
+    uint64_t restored = (static_cast<uint64_t>(static_cast<uint8_t>(result[1])) << 070) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[2])) << 060) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[3])) << 050) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[4])) << 040) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[5])) << 030) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[6])) << 020) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[7])) << 010) +
+                        static_cast<uint64_t>(static_cast<uint8_t>(result[8]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+INSTANTIATE_TEST_CASE_P(CborUnsignedPos8Tests, CborUnsignedPos8Test,
+                        ::testing::ValuesIn(pos8_numbers), );
+
+// 3.1415925
+TEST(CborFloatTest, Number)
+{
+    double v = 3.1415925;
+    json j = v;
+    std::string expected = "\xfb\x40\x09\x21\xfb\x3f\xa6\xde\xfc";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+    EXPECT_EQ(json::from_cbor(result), v);
+}
+
+TEST(CborFloatTest, HalfInfinity)
+{
+    json j = json::from_cbor(llvm::StringRef("\xf9\x7c\x00", 3));
+    json::number_float_t d = j;
+    EXPECT_FALSE(std::isfinite(d));
+    EXPECT_EQ(j.dump(), "null");
+}
+
+TEST(CborFloatTest, HalfNaN)
+{
+    json j = json::from_cbor("\xf9\x7c\x01");
+    json::number_float_t d = j;
+    EXPECT_TRUE(std::isnan(d));
+    EXPECT_EQ(j.dump(), "null");
+}
+
+// N = 0..23
+TEST(CborStringTest, String1)
+{
+    for (size_t N = 0; N <= 0x17; ++N)
+    {
+        SCOPED_TRACE(N);
+
+        // create JSON value with string containing of N * 'x'
+        const auto s = std::string(N, 'x');
+        json j = s;
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0x60 + N));
+        expected.append(s);
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), N + 1);
+        // check that no null byte is appended
+        if (N > 0)
+        {
+            EXPECT_NE(result.back(), '\x00');
+        }
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// N = 24..255
+TEST(CborStringTest, String2)
+{
+    for (size_t N = 24; N <= 255; ++N)
+    {
+        SCOPED_TRACE(N);
+
+        // create JSON value with string containing of N * 'x'
+        const auto s = std::string(N, 'x');
+        json j = s;
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(0x78);
+        expected.push_back(static_cast<char>(N));
+        expected.append(s);
+
+        // compare result + size
+        const auto result = json::to_cbor(j);
+        EXPECT_EQ(result, expected);
+        ASSERT_EQ(result.size(), N + 2);
+        // check that no null byte is appended
+        EXPECT_NE(result.back(), '\x00');
+
+        // roundtrip
+        EXPECT_EQ(json::from_cbor(result), j);
+    }
+}
+
+// N = 256..65535
+class CborString3Test : public ::testing::TestWithParam<size_t> {};
+TEST_P(CborString3Test, Case)
+{
+    // create JSON value with string containing of N * 'x'
+    const auto s = std::string(GetParam(), 'x');
+    json j = s;
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(0x79);
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+    expected.append(s);
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), GetParam() + 3);
+    // check that no null byte is appended
+    EXPECT_NE(result.back(), '\x00');
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+static size_t string3_lens[] = {
+    256u,
+    999u,
+    1025u,
+    3333u,
+    2048u,
+    65535u
+};
+
+INSTANTIATE_TEST_CASE_P(CborString3Tests, CborString3Test,
+                        ::testing::ValuesIn(string3_lens), );
+
+// N = 65536..4294967295
+class CborString5Test : public ::testing::TestWithParam<size_t> {};
+TEST_P(CborString5Test, Case)
+{
+    // create JSON value with string containing of N * 'x'
+    const auto s = std::string(GetParam(), 'x');
+    json j = s;
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(0x7a);
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+    expected.append(s);
+
+    // compare result + size
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+    ASSERT_EQ(result.size(), GetParam() + 5);
+    // check that no null byte is appended
+    EXPECT_NE(result.back(), '\x00');
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+static size_t string5_lens[] = {
+    65536u,
+    77777u,
+    1048576u
+};
+
+INSTANTIATE_TEST_CASE_P(CborString5Tests, CborString5Test,
+                        ::testing::ValuesIn(string5_lens), );
+
+TEST(CborArrayTest, Empty)
+{
+    json j = json::array();
+    std::string expected = "\x80";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// [null]
+TEST(CborArrayTest, Null)
+{
+    json j = {nullptr};
+    std::string expected = "\x81\xf6";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// [1,2,3,4,5]
+TEST(CborArrayTest, Simple)
+{
+    json j = json::parse("[1,2,3,4,5]");
+    std::string expected = "\x85\x01\x02\x03\x04\x05";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// [[[[]]]]
+TEST(CborArrayTest, NestEmpty)
+{
+    json j = json::parse("[[[[]]]]");
+    std::string expected = "\x81\x81\x81\x80";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// array with uint16_t elements
+TEST(CborArrayTest, UInt16)
+{
+    json j(257, nullptr);
+    std::string expected(j.size() + 3, static_cast<char>(0xf6)); // all null
+    expected[0] = static_cast<char>(0x99); // array 16 bit
+    expected[1] = 0x01; // size (0x0101), byte 0
+    expected[2] = 0x01; // size (0x0101), byte 1
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// array with uint32_t elements
+TEST(CborArrayTest, UInt32)
+{
+    json j(65793, nullptr);
+    std::string expected(j.size() + 5, static_cast<char>(0xf6)); // all null
+    expected[0] = static_cast<char>(0x9a); // array 32 bit
+    expected[1] = 0x00; // size (0x00010101), byte 0
+    expected[2] = 0x01; // size (0x00010101), byte 1
+    expected[3] = 0x01; // size (0x00010101), byte 2
+    expected[4] = 0x01; // size (0x00010101), byte 3
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+/*
+// array with uint64_t elements
+TEST(CborArrayTest, UInt64)
+{
+    json j(4294967296, nullptr);
+    std::string expected(j.size() + 9, static_cast<char>(0xf6)); // all null
+    expected[0] = 0x9b; // array 64 bit
+    expected[1] = 0x00; // size (0x0000000100000000), byte 0
+    expected[2] = 0x00; // size (0x0000000100000000), byte 1
+    expected[3] = 0x00; // size (0x0000000100000000), byte 2
+    expected[4] = 0x01; // size (0x0000000100000000), byte 3
+    expected[5] = 0x00; // size (0x0000000100000000), byte 4
+    expected[6] = 0x00; // size (0x0000000100000000), byte 5
+    expected[7] = 0x00; // size (0x0000000100000000), byte 6
+    expected[8] = 0x00; // size (0x0000000100000000), byte 7
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+*/
+
+TEST(CborObjectTest, Empty)
+{
+    json j = json::object();
+    std::string expected = "\xa0";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// {"":null}
+TEST(CborObjectTest, EmptyKey)
+{
+    json j = {{"", nullptr}};
+    std::string expected = "\xa1\x60\xf6";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// {"a": {"b": {"c": {}}}}
+TEST(CborObjectTest, NestedEmpty)
+{
+    json j = json::parse("{\"a\": {\"b\": {\"c\": {}}}}");
+    std::string expected = "\xa1\x61\x61\xa1\x61\x62\xa1\x61\x63\xa0";
+    const auto result = json::to_cbor(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// object with uint8_t elements
+TEST(CborObjectTest, UInt8)
+{
+    json j;
+    for (auto i = 0; i < 255; ++i)
+    {
+        // format i to a fixed width of 5
+        // each entry will need 7 bytes: 6 for string, 1 for null
+        std::stringstream ss;
+        ss << std::setw(5) << std::setfill('0') << i;
+        j.emplace(ss.str(), nullptr);
+    }
+
+    const auto result = json::to_cbor(j);
+
+    // Checking against an expected vector byte by byte is
+    // difficult, because no assumption on the order of key/value
+    // pairs are made. We therefore only check the prefix (type and
+    // size and the overall size. The rest is then handled in the
+    // roundtrip check.
+    ASSERT_EQ(result.size(), 1787u); // 1 type, 1 size, 255*7 content
+    EXPECT_EQ(result[0], static_cast<char>(0xb8)); // map 8 bit
+    EXPECT_EQ(result[1], static_cast<char>(0xff)); // size byte (0xff)
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// object with uint16_t elements
+TEST(CborObjectTest, UInt16)
+{
+    json j;
+    for (auto i = 0; i < 256; ++i)
+    {
+        // format i to a fixed width of 5
+        // each entry will need 7 bytes: 6 for string, 1 for null
+        std::stringstream ss;
+        ss << std::setw(5) << std::setfill('0') << i;
+        j.emplace(ss.str(), nullptr);
+    }
+
+    const auto result = json::to_cbor(j);
+
+    // Checking against an expected vector byte by byte is
+    // difficult, because no assumption on the order of key/value
+    // pairs are made. We therefore only check the prefix (type and
+    // size and the overall size. The rest is then handled in the
+    // roundtrip check.
+    ASSERT_EQ(result.size(), 1795u); // 1 type, 2 size, 256*7 content
+    EXPECT_EQ(result[0], static_cast<char>(0xb9)); // map 16 bit
+    EXPECT_EQ(result[1], 0x01); // byte 0 of size (0x0100)
+    EXPECT_EQ(result[2], 0x00); // byte 1 of size (0x0100)
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// object with uint32_t elements
+TEST(CborObjectTest, UInt32)
+{
+    json j;
+    for (auto i = 0; i < 65536; ++i)
+    {
+        // format i to a fixed width of 5
+        // each entry will need 7 bytes: 6 for string, 1 for null
+        std::stringstream ss;
+        ss << std::setw(5) << std::setfill('0') << i;
+        j.emplace(ss.str(), nullptr);
+    }
+
+    const auto result = json::to_cbor(j);
+
+    // Checking against an expected vector byte by byte is
+    // difficult, because no assumption on the order of key/value
+    // pairs are made. We therefore only check the prefix (type and
+    // size and the overall size. The rest is then handled in the
+    // roundtrip check.
+    ASSERT_EQ(result.size(), 458757u); // 1 type, 4 size, 65536*7 content
+    EXPECT_EQ(result[0], static_cast<char>(0xba)); // map 32 bit
+    EXPECT_EQ(result[1], 0x00); // byte 0 of size (0x00010000)
+    EXPECT_EQ(result[2], 0x01); // byte 1 of size (0x00010000)
+    EXPECT_EQ(result[3], 0x00); // byte 2 of size (0x00010000)
+    EXPECT_EQ(result[4], 0x00); // byte 3 of size (0x00010000)
+
+    // roundtrip
+    EXPECT_EQ(json::from_cbor(result), j);
+}
+
+// 0x7b (string)
+TEST(CborAdditionalDeserializationTest, Case7b)
+{
+    std::string given("\x7b\x00\x00\x00\x00\x00\x00\x00\x01\x61", 10);
+    json j = json::from_cbor(given);
+    EXPECT_EQ(j, "a");
+}
+
+// 0x9b (array)
+TEST(CborAdditionalDeserializationTest, Case9b)
+{
+    std::string given("\x9b\x00\x00\x00\x00\x00\x00\x00\x01\xf4", 10);
+    json j = json::from_cbor(given);
+    EXPECT_EQ(j, json::parse("[false]"));
+}
+
+// 0xbb (map)
+TEST(CborAdditionalDeserializationTest, Casebb)
+{
+    std::string given("\xbb\x00\x00\x00\x00\x00\x00\x00\x01\x60\xf4", 11);
+    json j = json::from_cbor(given);
+    EXPECT_EQ(j, json::parse("{\"\": false}"));
+}
+
+TEST(CborErrorTest, TooShortByteVector)
+{
+    EXPECT_THROW_MSG(json::from_cbor("\x18"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor("\x19"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x19\x00", 2)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 3: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor("\x1a"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1a\x00", 2)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 3: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1a\x00\x00", 3)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 4: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1a\x00\x00\x00", 4)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 5: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor("\x1b"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00", 2)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 3: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00\x00", 3)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 4: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00\x00\x00", 4)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 5: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00\x00\x00\x00", 5)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 6: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00\x00\x00\x00\x00", 6)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 7: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00\x00\x00\x00\x00\x00", 7)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 8: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_cbor(llvm::StringRef("\x1b\x00\x00\x00\x00\x00\x00\x00", 8)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 9: unexpected end of input");
+}
+
+TEST(CborErrorTest, UnsupportedBytesConcrete)
+{
+    EXPECT_THROW_MSG(json::from_cbor("\x1c"), json::parse_error,
+                     "[json.exception.parse_error.112] parse error at 1: error reading CBOR; last byte: 0x1c");
+    EXPECT_THROW_MSG(json::from_cbor("\xf8"), json::parse_error,
+                     "[json.exception.parse_error.112] parse error at 1: error reading CBOR; last byte: 0xf8");
+}
+
+class CborUnsupportedBytesTest : public ::testing::TestWithParam<const char*> {
+};
+TEST_P(CborUnsupportedBytesTest, Case)
+{
+    EXPECT_THROW(json::from_cbor(GetParam()), json::parse_error);
+}
+
+static const char* unsupported_bytes_cases[] = {
+    // ?
+    "\x1c\x1d\x1e\x1f",
+    // ?
+    "\x3c\x3d\x3e\x3f",
+    // byte strings
+    "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x50\x51\x52\x53\x54\x55\x56\x57",
+    // byte strings
+    "\x58\x59\x5a\x5b",
+    // ?
+    "\x5c\x5d\x5e",
+    // byte string
+    "\x5f",
+    // ?
+    "\x7c\x7d\x7e",
+    // ?
+    "\x9c\x9d\x9e",
+    // ?
+    "\xbc\xbd\xbe",
+    // date/time
+    "\xc0\xc1",
+    // bignum
+    "\xc2\xc3",
+    // fraction
+    "\xc4",
+    // bigfloat
+    "\xc5",
+    // tagged item
+    "\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4",
+    // expected conversion
+    "\xd5\xd6\xd7",
+    // more tagged items
+    "\xd8\xd9\xda\xdb",
+    // ?
+    "\xdc\xdd\xde\xdf",
+    // (simple value)
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3",
+    // undefined
+    "\xf7",
+    // simple value
+    "\xf8",
+};
+
+INSTANTIATE_TEST_CASE_P(CborUnsupportedBytesTests, CborUnsupportedBytesTest,
+                        ::testing::ValuesIn(unsupported_bytes_cases), );
+#if 0
+// use this testcase outside [hide] to run it with Valgrind
+TEST(CborRoundtripTest, Sample)
+{
+    std::string filename = "test/data/json_testsuite/sample.json";
+
+    // parse JSON file
+    std::ifstream f_json(filename);
+    json j1 = json::parse(f_json);
+
+    // parse CBOR file
+    std::ifstream f_cbor(filename + ".cbor", std::ios::binary);
+    std::vector<uint8_t> packed((std::istreambuf_iterator<char>(f_cbor)),
+                                std::istreambuf_iterator<char>());
+    json j2;
+    j2 = json::from_cbor(packed);
+
+    // compare parsed JSON values
+    EXPECT_EQ(j1, j2);
+
+    // check with different start index
+    packed.insert(packed.begin(), 5, 0xff);
+    EXPECT_EQ(j1, json::from_cbor(packed, 5));
+}
+
+/*
+The following test cases were found during a two-day session with
+AFL-Fuzz. As a result, empty byte vectors and excessive lengths are
+detected.
+*/
+class CborRegressionFuzzTest : public ::testing::TestWithParam<const char*> {};
+TEST_P(CborRegressionFuzzTest, Case)
+{
+    try
+    {
+        // parse CBOR file
+        std::ifstream f_cbor(GetParam(), std::ios::binary);
+        std::vector<uint8_t> vec1(
+            (std::istreambuf_iterator<char>(f_cbor)),
+            std::istreambuf_iterator<char>());
+        json j1 = json::from_cbor(vec1);
+
+        try
+        {
+            // step 2: round trip
+            std::string vec2 = json::to_cbor(j1);
+
+            // parse serialization
+            json j2 = json::from_cbor(vec2);
+
+            // deserializations must match
+            EXPECT_EQ(j1, j2);
+        }
+        catch (const json::parse_error&)
+        {
+            // parsing a CBOR serialization must not fail
+            FAIL();
+        }
+    }
+    catch (const json::parse_error&)
+    {
+        // parse errors are ok, because input may be random bytes
+    }
+}
+
+static const char* fuzz_test_cases[] = {
+    "test/data/cbor_regression/test01",
+    "test/data/cbor_regression/test02",
+    "test/data/cbor_regression/test03",
+    "test/data/cbor_regression/test04",
+    "test/data/cbor_regression/test05",
+    "test/data/cbor_regression/test06",
+    "test/data/cbor_regression/test07",
+    "test/data/cbor_regression/test08",
+    "test/data/cbor_regression/test09",
+    "test/data/cbor_regression/test10",
+    "test/data/cbor_regression/test11",
+    "test/data/cbor_regression/test12",
+    "test/data/cbor_regression/test13",
+    "test/data/cbor_regression/test14",
+    "test/data/cbor_regression/test15",
+    "test/data/cbor_regression/test16",
+    "test/data/cbor_regression/test17",
+    "test/data/cbor_regression/test18",
+    "test/data/cbor_regression/test19",
+    "test/data/cbor_regression/test20",
+    "test/data/cbor_regression/test21",
+};
+
+INSTANTIATE_TEST_CASE_P(CborRegressionFuzzTests, CborRegressionFuzzTest,
+                        ::testing::ValuesIn(fuzz_test_cases));
+
+class CborRegressionFlynnTest : public ::testing::TestWithParam<const char*> {};
+TEST_F(CborRegressionFlynnTest, Case)
+{
+    // parse JSON file
+    std::ifstream f_json(GetParam());
+    json j1 = json::parse(f_json);
+
+    // parse CBOR file
+    std::ifstream f_cbor(filename + ".cbor", std::ios::binary);
+    std::vector<uint8_t> packed(
+        (std::istreambuf_iterator<char>(f_cbor)),
+        std::istreambuf_iterator<char>());
+    json j2;
+    j2 = json::from_cbor(packed);
+
+    // compare parsed JSON values
+    EXPECT_EQ(j1, j2);
+}
+
+static const char* flynn_test_cases[] = {
+    "test/data/json_nlohmann_tests/all_unicode.json",
+    "test/data/json.org/1.json",
+    "test/data/json.org/2.json",
+    "test/data/json.org/3.json",
+    "test/data/json.org/4.json",
+    "test/data/json.org/5.json",
+    "test/data/json_roundtrip/roundtrip01.json",
+    "test/data/json_roundtrip/roundtrip02.json",
+    "test/data/json_roundtrip/roundtrip03.json",
+    "test/data/json_roundtrip/roundtrip04.json",
+    "test/data/json_roundtrip/roundtrip05.json",
+    "test/data/json_roundtrip/roundtrip06.json",
+    "test/data/json_roundtrip/roundtrip07.json",
+    "test/data/json_roundtrip/roundtrip08.json",
+    "test/data/json_roundtrip/roundtrip09.json",
+    "test/data/json_roundtrip/roundtrip10.json",
+    "test/data/json_roundtrip/roundtrip11.json",
+    "test/data/json_roundtrip/roundtrip12.json",
+    "test/data/json_roundtrip/roundtrip13.json",
+    "test/data/json_roundtrip/roundtrip14.json",
+    "test/data/json_roundtrip/roundtrip15.json",
+    "test/data/json_roundtrip/roundtrip16.json",
+    "test/data/json_roundtrip/roundtrip17.json",
+    "test/data/json_roundtrip/roundtrip18.json",
+    "test/data/json_roundtrip/roundtrip19.json",
+    "test/data/json_roundtrip/roundtrip20.json",
+    "test/data/json_roundtrip/roundtrip21.json",
+    "test/data/json_roundtrip/roundtrip22.json",
+    "test/data/json_roundtrip/roundtrip23.json",
+    "test/data/json_roundtrip/roundtrip24.json",
+    "test/data/json_roundtrip/roundtrip25.json",
+    "test/data/json_roundtrip/roundtrip26.json",
+    "test/data/json_roundtrip/roundtrip27.json",
+    "test/data/json_roundtrip/roundtrip28.json",
+    "test/data/json_roundtrip/roundtrip29.json",
+    "test/data/json_roundtrip/roundtrip30.json",
+    "test/data/json_roundtrip/roundtrip31.json",
+    "test/data/json_roundtrip/roundtrip32.json",
+    "test/data/json_testsuite/sample.json", // kills AppVeyor
+    "test/data/json_tests/pass1.json",
+    "test/data/json_tests/pass2.json",
+    "test/data/json_tests/pass3.json",
+    "test/data/regression/floats.json",
+    "test/data/regression/signed_ints.json",
+    "test/data/regression/unsigned_ints.json",
+    "test/data/regression/working_file.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_arraysWithSpaces.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_empty-string.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_empty.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_ending_with_newline.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_false.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_heterogeneous.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_null.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_1_and_newline.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_leading_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_several_null.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_trailing_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_0e+1.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_0e1.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_after_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_double_close_to_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_double_huge_neg_exp.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_huge_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_int_with_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_minus_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_negative_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_negative_one.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_negative_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_capital_e.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_capital_e_neg_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_capital_e_pos_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_exponent.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_fraction_exponent.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_neg_exp.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_real_neg_overflow.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_pos_exponent.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_real_pos_overflow.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_underflow.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_simple_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_simple_real.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_too_big_neg_int.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_too_big_pos_int.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_very_big_negative_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_basic.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_duplicated_key.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_duplicated_key_and_value.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_empty.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_empty_key.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_escaped_null_in_key.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_extreme_numbers.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_long_strings.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_simple.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_string_unicode.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_with_newlines.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_1_2_3_bytes_UTF-8_sequences.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_UTF-16_Surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_accepted_surrogate_pair.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_accepted_surrogate_pairs.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_allowed_escapes.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_backslash_and_u_escaped_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_backslash_doublequotes.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_comments.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_double_escape_a.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_double_escape_n.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_escaped_control_character.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_escaped_noncharacter.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_in_array.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_in_array_with_leading_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_last_surrogates_1_and_2.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_newline_uescaped.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+10FFFF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+1FFFF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+FFFF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_null_escape.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_one-byte-utf-8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_pi.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_simple_ascii.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_three-byte-utf-8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_two-byte-utf-8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_u+2028_line_sep.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_u+2029_par_sep.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_uEscape.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unescaped_char_delete.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicodeEscapedBackslash.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_2.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_U+2064_invisible_plus.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_escaped_double_quote.json",
+    // "test/data/nst_json_testsuite/test_parsing/y_string_utf16.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_utf8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_with_del_character.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_false.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_negative_real.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_null.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_string.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_true.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_string_empty.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_trailing_newline.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_true_in_array.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_whitespace_array.json",
+};
+
+INSTANTIATE_TEST_CASE_P(CborRegressionFlynnTests, CborRegressionFlynnTest,
+                        ::testing::ValuesIn(flynn_test_cases));
+
+#endif
+TEST(CborFirstBytesTest, Unsupported)
+{
+    // these bytes will fail immediately with exception parse_error.112
+    std::set<uint8_t> unsupported =
+    {
+        //// types not supported by this library
+
+        // byte strings
+        0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+        0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+        0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+        // byte strings
+        0x58, 0x59, 0x5a, 0x5b, 0x5f,
+        // date/time
+        0xc0, 0xc1,
+        // bignum
+        0xc2, 0xc3,
+        // decimal fracion
+        0xc4,
+        // bigfloat
+        0xc5,
+        // tagged item
+        0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
+        0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd8,
+        0xd9, 0xda, 0xdb,
+        // expected conversion
+        0xd5, 0xd6, 0xd7,
+        // simple value
+        0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
+        0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xef, 0xf0,
+        0xf1, 0xf2, 0xf3,
+        0xf8,
+        // undefined
+        0xf7,
+
+        //// bytes not specified by CBOR
+
+        0x1c, 0x1d, 0x1e, 0x1f,
+        0x3c, 0x3d, 0x3e, 0x3f,
+        0x5c, 0x5d, 0x5e,
+        0x7c, 0x7d, 0x7e,
+        0x9c, 0x9d, 0x9e,
+        0xbc, 0xbd, 0xbe,
+        0xdc, 0xdd, 0xde, 0xdf,
+        0xee,
+        0xfc, 0xfe, 0xfd,
+
+        /// break cannot be the first byte
+
+        0xff
+    };
+
+    for (auto i = 0; i < 256; ++i)
+    {
+        const auto byte = static_cast<char>(i);
+
+        try
+        {
+            json::from_cbor(llvm::StringRef(&byte, 1));
+        }
+        catch (const json::parse_error& e)
+        {
+            // check that parse_error.112 is only thrown if the
+            // first byte is in the unsupported set
+            SCOPED_TRACE(e.what());
+            if (std::find(unsupported.begin(), unsupported.end(),
+                          static_cast<uint8_t>(byte)) != unsupported.end())
+            {
+                EXPECT_EQ(e.id, 112);
+            }
+            else
+            {
+                EXPECT_NE(e.id, 112);
+            }
+        }
+    }
+}
+
+// examples from RFC 7049 Appendix A
+namespace {
+struct CborRoundtripTestParam {
+  const char* plain;
+  llvm::StringRef encoded;
+  bool test_encode;
+};
+}  // anonymous namespace
+
+class CborRoundtripTest
+    : public ::testing::TestWithParam<CborRoundtripTestParam> {
+};
+TEST_P(CborRoundtripTest, Case)
+{
+    if (GetParam().test_encode)
+    {
+        EXPECT_EQ(json::to_cbor(json::parse(GetParam().plain)), GetParam().encoded);
+    }
+    EXPECT_EQ(json::parse(GetParam().plain), json::from_cbor(GetParam().encoded));
+}
+
+static const CborRoundtripTestParam rfc7049_appendix_a_numbers[] = {
+    {"0", llvm::StringRef("\x00", 1), true},
+    {"1", "\x01", true},
+    {"10", "\x0a", true},
+    {"23", "\x17", true},
+    {"24", "\x18\x18", true},
+    {"25", "\x18\x19", true},
+    {"100", "\x18\x64", true},
+    {"1000", "\x19\x03\xe8", true},
+    {"1000000", llvm::StringRef("\x1a\x00\x0f\x42\x40", 5), true},
+    {"1000000000000", llvm::StringRef("\x1b\x00\x00\x00\xe8\xd4\xa5\x10\x00", 9), true},
+    {"18446744073709551615", "\x1b\xff\xff\xff\xff\xff\xff\xff\xff", true},
+    // positive bignum is not supported
+    //{"18446744073709551616", llvm::StringRef("\xc2\x49\x01\x00\x00\x00\x00\x00\x00\x00\x00", 11), true},
+    //{"-18446744073709551616", "\x3b\xff\xff\xff\xff\xff\xff\xff\xff", true},
+    // negative bignum is not supported
+    //{"-18446744073709551617", llvm::StringRef("\xc3\x49\x01\x00\x00\x00\x00\x00\x00\x00\x00", 11), true},
+    {"-1", "\x20", true},
+    {"-10", "\x29", true},
+    {"-100", "\x38\x63", true},
+    {"-1000", "\x39\x03\xe7", true},
+    // half-precision float
+    {"0.0", llvm::StringRef("\xf9\x00\x00", 3), false},
+    // half-precision float
+    {"-0.0", llvm::StringRef("\xf9\x80\x00", 3), false},
+    // half-precision float
+    {"1.0", llvm::StringRef("\xf9\x3c\x00", 3), false},
+    {"1.1", "\xfb\x3f\xf1\x99\x99\x99\x99\x99\x9a", true},
+    // half-precision float
+    {"1.5", llvm::StringRef("\xf9\x3e\x00", 3), false},
+    // half-precision float
+    {"65504.0", "\xf9\x7b\xff", false},
+    {"100000.0", llvm::StringRef("\xfa\x47\xc3\x50\x00", 5), false},
+    {"3.4028234663852886e+38", "\xfa\x7f\x7f\xff\xff", false},
+    {"1.0e+300", llvm::StringRef("\xfb\x7e\x37\xe4\x3c\x88\x00\x75\x9c", 9), true},
+    // half-precision float
+    {"5.960464477539063e-8", llvm::StringRef("\xf9\x00\x01", 3), false},
+    // half-precision float
+    {"0.00006103515625", llvm::StringRef("\xf9\x04\x00", 3), false},
+    // half-precision float
+    {"-4.0", llvm::StringRef("\xf9\xc4\x00", 3), false},
+    {"-4.1", "\xfb\xc0\x10\x66\x66\x66\x66\x66\x66", true},
+};
+
+INSTANTIATE_TEST_CASE_P(CborRfc7049AppendixANumberTests, CborRoundtripTest,
+                        ::testing::ValuesIn(rfc7049_appendix_a_numbers), );
+
+static const CborRoundtripTestParam rfc7049_appendix_a_simple_values[] = {
+    {"false", "\xf4", true},
+    {"true", "\xf5", true},
+};
+
+INSTANTIATE_TEST_CASE_P(CborRfc7049AppendixASimpleValueTests, CborRoundtripTest,
+                        ::testing::ValuesIn(rfc7049_appendix_a_simple_values), );
+
+static const CborRoundtripTestParam rfc7049_appendix_a_strings[] = {
+    {"\"\"", "\x60", true},
+    {"\"a\"", "\x61\x61", true},
+    {"\"IETF\"", "\x64\x49\x45\x54\x46", true},
+    {"\"\\u00fc\"", "\x62\xc3\xbc", true},
+    {"\"\\u6c34\"", "\x63\xe6\xb0\xb4", true},
+    {"\"\\ud800\\udd51\"", "\x64\xf0\x90\x85\x91", true},
+    // indefinite length strings
+    {"\"streaming\"", "\x7f\x73\x74\x72\x65\x61\x6d\x69\x6e\x67\xff", false},
+};
+
+INSTANTIATE_TEST_CASE_P(CborRfc7049AppendixAStringTests, CborRoundtripTest,
+                        ::testing::ValuesIn(rfc7049_appendix_a_strings), );
+
+static const CborRoundtripTestParam rfc7049_appendix_a_arrays[] = {
+    {"[]", "\x80", true},
+    {"[1, 2, 3]", "\x83\x01\x02\x03", true},
+    {"[1, [2, 3], [4, 5]]", "\x83\x01\x82\x02\x03\x82\x04\x05", true},
+    {"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]", "\x98\x19\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x18\x18\x19", true},
+    // indefinite length arrays
+    {"[]", "\x9f\xff", false},
+    {"[1, [2, 3], [4, 5]] ", "\x9f\x01\x82\x02\x03\x9f\x04\x05\xff\xff", false},
+    {"[1, [2, 3], [4, 5]]", "\x9f\x01\x82\x02\x03\x82\x04\x05\xff", false},
+    {"[1, [2, 3], [4, 5]]", "\x83\x01\x82\x02\x03\x9f\x04\x05\xff", false},
+    {"[1, [2, 3], [4, 5]]", "\x83\x01\x9f\x02\x03\xff\x82\x04\x05", false},
+    {"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]", "\x9f\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x18\x18\x19\xff", false},
+};
+
+INSTANTIATE_TEST_CASE_P(CborRfc7049AppendixAArrayTests, CborRoundtripTest,
+                        ::testing::ValuesIn(rfc7049_appendix_a_arrays), );
+
+static const CborRoundtripTestParam rfc7049_appendix_a_objects[] = {
+    {"{}", "\xa0", true},
+    {"{\"a\": 1, \"b\": [2, 3]}", "\xa2\x61\x61\x01\x61\x62\x82\x02\x03", true},
+    {"[\"a\", {\"b\": \"c\"}]", "\x82\x61\x61\xa1\x61\x62\x61\x63", true},
+    {"{\"a\": \"A\", \"b\": \"B\", \"c\": \"C\", \"d\": \"D\", \"e\": \"E\"}", "\xa5\x61\x61\x61\x41\x61\x62\x61\x42\x61\x63\x61\x43\x61\x64\x61\x44\x61\x65\x61\x45", true},
+    // indefinite length objects
+    {"{\"a\": 1, \"b\": [2, 3]}", "\xbf\x61\x61\x01\x61\x62\x9f\x02\x03\xff\xff", false},
+    {"[\"a\", {\"b\": \"c\"}]", "\x82\x61\x61\xbf\x61\x62\x61\x63\xff", false},
+    {"{\"Fun\": true, \"Amt\": -2}", "\xbf\x63\x46\x75\x6e\xf5\x63\x41\x6d\x74\x21\xff", false},
+};
+
+INSTANTIATE_TEST_CASE_P(CborRfc7049AppendixAObjectTests, CborRoundtripTest,
+                        ::testing::ValuesIn(rfc7049_appendix_a_objects), );
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-comparison.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-comparison.cpp
new file mode 100644
index 0000000..18934a2
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-comparison.cpp
@@ -0,0 +1,250 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+class JsonComparisonTypesTest : public ::testing::Test {
+ protected:
+    std::vector<json::value_t> j_types =
+    {
+        json::value_t::null,
+        json::value_t::boolean,
+        json::value_t::number_integer,
+        json::value_t::number_unsigned,
+        json::value_t::number_float,
+        json::value_t::object,
+        json::value_t::array,
+        json::value_t::string
+    };
+};
+
+TEST_F(JsonComparisonTypesTest, Less)
+{
+    static const std::vector<std::vector<bool>> expected =
+    {
+        {false, true, true, true, true, true, true, true},
+        {false, false, true, true, true, true, true, true},
+        {false, false, false, false, false, true, true, true},
+        {false, false, false, false, false, true, true, true},
+        {false, false, false, false, false, true, true, true},
+        {false, false, false, false, false, false, true, true},
+        {false, false, false, false, false, false, false, true},
+        {false, false, false, false, false, false, false, false}
+    };
+
+    for (size_t i = 0; i < j_types.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_types.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check precomputed values
+            EXPECT_EQ(operator<(j_types[i], j_types[j]), expected[i][j]);
+        }
+    }
+}
+
+class JsonComparisonValuesTest : public ::testing::Test {
+ protected:
+    json j_values =
+    {
+        nullptr, nullptr,
+        17, 42,
+        8u, 13u,
+        3.14159, 23.42,
+        "foo", "bar",
+        true, false,
+        {1, 2, 3}, {"one", "two", "three"},
+        {{"first", 1}, {"second", 2}}, {{"a", "A"}, {"b", {"B"}}}
+    };
+};
+
+TEST_F(JsonComparisonValuesTest, Equal)
+{
+    static const std::vector<std::vector<bool>> expected =
+    {
+        {true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false},
+        {true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false},
+        {false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false},
+        {false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false},
+        {false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false},
+        {false, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false},
+        {false, false, false, false, false, false, true, false, false, false, false, false, false, false, false, false},
+        {false, false, false, false, false, false, false, true, false, false, false, false, false, false, false, false},
+        {false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false},
+        {false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false},
+        {false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false},
+        {false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false},
+        {false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false},
+        {false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false},
+        {false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false},
+        {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true}
+    };
+
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_values.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check precomputed values
+            EXPECT_EQ(j_values[i] == j_values[j], expected[i][j]);
+        }
+    }
+
+    // comparison with discarded elements
+    json j_discarded(json::value_t::discarded);
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        EXPECT_FALSE(j_values[i] == j_discarded);
+        EXPECT_FALSE(j_discarded == j_values[i]);
+        EXPECT_FALSE(j_discarded == j_discarded);
+    }
+
+    // compare with null pointer
+    json j_null;
+    EXPECT_TRUE(j_null == nullptr);
+    EXPECT_TRUE(nullptr == j_null);
+}
+
+TEST_F(JsonComparisonValuesTest, NotEqual)
+{
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_values.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check definition
+            EXPECT_EQ(j_values[i] != j_values[j], !(j_values[i] == j_values[j]));
+        }
+    }
+
+    // compare with null pointer
+    json j_null;
+    EXPECT_FALSE(j_null != nullptr);
+    EXPECT_FALSE(nullptr != j_null);
+    EXPECT_EQ(j_null != nullptr, !(j_null == nullptr));
+    EXPECT_EQ(nullptr != j_null, !(nullptr == j_null));
+}
+
+TEST_F(JsonComparisonValuesTest, Less)
+{
+    static const std::vector<std::vector<bool>> expected =
+    {
+        {false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true},
+        {false, false, true, true, true, true, true, true, true, true, true, true, true, true, true, true},
+        {false, false, false, true, false, false, false, true, true, true, false, false, true, true, true, true},
+        {false, false, false, false, false, false, false, false, true, true, false, false, true, true, true, true},
+        {false, false, true, true, false, true, false, true, true, true, false, false, true, true, true, true},
+        {false, false, true, true, false, false, false, true, true, true, false, false, true, true, true, true},
+        {false, false, true, true, true, true, false, true, true, true, false, false, true, true, true, true},
+        {false, false, false, true, false, false, false, false, true, true, false, false, true, true, true, true},
+        {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false},
+        {false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, false},
+        {false, false, true, true, true, true, true, true, true, true, false, false, true, true, true, true},
+        {false, false, true, true, true, true, true, true, true, true, true, false, true, true, true, true},
+        {false, false, false, false, false, false, false, false, true, true, false, false, false, true, false, false},
+        {false, false, false, false, false, false, false, false, true, true, false, false, false, false, false, false},
+        {false, false, false, false, false, false, false, false, true, true, false, false, true, true, false, false},
+        {false, false, false, false, false, false, false, false, true, true, false, false, true, true, true, false}
+    };
+
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_values.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check precomputed values
+            EXPECT_EQ(j_values[i] < j_values[j], expected[i][j]);
+        }
+    }
+
+    // comparison with discarded elements
+    json j_discarded(json::value_t::discarded);
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        EXPECT_FALSE(j_values[i] < j_discarded);
+        EXPECT_FALSE(j_discarded < j_values[i]);
+        EXPECT_FALSE(j_discarded < j_discarded);
+    }
+}
+
+TEST_F(JsonComparisonValuesTest, LessEqual)
+{
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_values.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check definition
+            EXPECT_EQ(j_values[i] <= j_values[j], !(j_values[j] < j_values[i]));
+        }
+    }
+}
+
+TEST_F(JsonComparisonValuesTest, Greater)
+{
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_values.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check definition
+            EXPECT_EQ(j_values[i] > j_values[j], j_values[j] < j_values[i]);
+        }
+    }
+}
+
+TEST_F(JsonComparisonValuesTest, GreaterEqual)
+{
+    for (size_t i = 0; i < j_values.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        for (size_t j = 0; j < j_values.size(); ++j)
+        {
+            SCOPED_TRACE(j);
+            // check definition
+            EXPECT_EQ(j_values[i] >= j_values[j], !(j_values[i] < j_values[j]));
+        }
+    }
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-concepts.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-concepts.cpp
new file mode 100644
index 0000000..4ce5a5b
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-concepts.cpp
@@ -0,0 +1,166 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonConceptsTest, ContainerRequirements)
+{
+    // X: container class: json
+    // T: type of objects: json
+    // a, b: values of type X: json
+
+    // TABLE 96 - Container Requirements
+
+    // X::value_type must return T
+    EXPECT_TRUE((std::is_same<json::value_type, json>::value));
+
+    // X::reference must return lvalue of T
+    EXPECT_TRUE((std::is_same<json::reference, json&>::value));
+
+    // X::const_reference must return const lvalue of T
+    EXPECT_TRUE((std::is_same<json::const_reference, const json&>::value));
+
+    // X::iterator must return iterator whose value_type is T
+    EXPECT_TRUE((std::is_same<json::iterator::value_type, json>::value));
+    // X::iterator must meet the forward iterator requirements
+    EXPECT_TRUE((std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<json::iterator>::iterator_category>::value));
+    // X::iterator must be convertible to X::const_iterator
+    EXPECT_TRUE((std::is_convertible<json::iterator, json::const_iterator>::value));
+
+    // X::const_iterator must return iterator whose value_type is T
+    EXPECT_TRUE((std::is_same<json::const_iterator::value_type, json>::value));
+    // X::const_iterator must meet the forward iterator requirements
+    EXPECT_TRUE((std::is_base_of<std::forward_iterator_tag, typename std::iterator_traits<json::const_iterator>::iterator_category>::value));
+
+    // X::difference_type must return a signed integer
+    EXPECT_TRUE((std::is_signed<json::difference_type>::value));
+    // X::difference_type must be identical to X::iterator::difference_type
+    EXPECT_TRUE((std::is_same<json::difference_type, json::iterator::difference_type>::value));
+    // X::difference_type must be identical to X::const_iterator::difference_type
+    EXPECT_TRUE((std::is_same<json::difference_type, json::const_iterator::difference_type>::value));
+
+    // X::size_type must return an unsigned integer
+    EXPECT_TRUE((std::is_unsigned<json::size_type>::value));
+    // X::size_type can represent any non-negative value of X::difference_type
+    EXPECT_TRUE(static_cast<json::size_type>(std::numeric_limits<json::difference_type>::max()) <=
+          std::numeric_limits<json::size_type>::max());
+
+    // the expression "X u" has the post-condition "u.empty()"
+    {
+        json u;
+        EXPECT_TRUE(u.empty());
+    }
+
+    // the expression "X()" has the post-condition "X().empty()"
+    EXPECT_TRUE(json().empty());
+}
+
+TEST(JsonConceptsTest, DefaultConstructible)
+{
+    EXPECT_TRUE(std::is_nothrow_default_constructible<json>::value);
+}
+
+TEST(JsonConceptsTest, MoveConstructible)
+{
+    EXPECT_TRUE(std::is_nothrow_move_constructible<json>::value);
+}
+
+TEST(JsonConceptsTest, CopyConstructible)
+{
+    EXPECT_TRUE(std::is_copy_constructible<json>::value);
+}
+
+TEST(JsonConceptsTest, MoveAssignable)
+{
+    EXPECT_TRUE(std::is_nothrow_move_assignable<json>::value);
+}
+
+TEST(JsonConceptsTest, CopyAssignable)
+{
+    EXPECT_TRUE(std::is_copy_assignable<json>::value);
+}
+
+TEST(JsonConceptsTest, Destructible)
+{
+    EXPECT_TRUE(std::is_nothrow_destructible<json>::value);
+}
+
+TEST(JsonConceptsTest, StandardLayoutType)
+{
+    EXPECT_TRUE(std::is_standard_layout<json>::value);
+}
+
+TEST(JsonIteratorConceptsTest, CopyConstructible)
+{
+    EXPECT_TRUE(std::is_nothrow_copy_constructible<json::iterator>::value);
+    EXPECT_TRUE(std::is_nothrow_copy_constructible<json::const_iterator>::value);
+}
+
+TEST(JsonIteratorConceptsTest, CopyAssignable)
+{
+    // STL iterators used by json::iterator don't pass this test in Debug mode
+#if !defined(_MSC_VER) || (_ITERATOR_DEBUG_LEVEL == 0)
+    EXPECT_TRUE(std::is_nothrow_copy_assignable<json::iterator>::value);
+    EXPECT_TRUE(std::is_nothrow_copy_assignable<json::const_iterator>::value);
+#endif
+}
+
+TEST(JsonIteratorConceptsTest, Destructible)
+{
+    EXPECT_TRUE(std::is_nothrow_destructible<json::iterator>::value);
+    EXPECT_TRUE(std::is_nothrow_destructible<json::const_iterator>::value);
+}
+
+TEST(JsonIteratorConceptsTest, Swappable)
+{
+    json j {1, 2, 3};
+    json::iterator it1 = j.begin();
+    json::iterator it2 = j.end();
+    std::swap(it1, it2);
+    EXPECT_EQ(it1, j.end());
+    EXPECT_EQ(it2, j.begin());
+}
+
+TEST(JsonIteratorConceptsTest, SwappableConst)
+{
+    json j {1, 2, 3};
+    json::const_iterator it1 = j.cbegin();
+    json::const_iterator it2 = j.cend();
+    std::swap(it1, it2);
+    EXPECT_EQ(it1, j.end());
+    EXPECT_EQ(it2, j.begin());
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-constructor1.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-constructor1.cpp
new file mode 100644
index 0000000..40d2b13
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-constructor1.cpp
@@ -0,0 +1,1071 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include <array>
+#include <deque>
+#include <forward_list>
+#include <list>
+#include <map>
+#include <set>
+#include <unordered_map>
+#include <unordered_set>
+
+#include "unit-json.h"
+using wpi::json;
+using wpi::JsonTest;
+
+class JsonConstructTypeTest : public ::testing::TestWithParam<json::value_t> {};
+TEST_P(JsonConstructTypeTest, Case)
+{
+    auto t = GetParam();
+    json j(t);
+    EXPECT_EQ(j.type(), t);
+}
+
+static const json::value_t construct_type_cases[] = {
+    json::value_t::null,
+    json::value_t::discarded,
+    json::value_t::object,
+    json::value_t::array,
+    json::value_t::boolean,
+    json::value_t::string,
+    json::value_t::number_integer,
+    json::value_t::number_unsigned,
+    json::value_t::number_float,
+};
+
+INSTANTIATE_TEST_CASE_P(JsonConstructTypeTests, JsonConstructTypeTest,
+                        ::testing::ValuesIn(construct_type_cases), );
+
+
+TEST(JsonConstructNullTest, NoParameter)
+{
+    json j{};
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonConstructNullTest, Parameter)
+{
+    json j(nullptr);
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonConstructObjectExplicitTest, Empty)
+{
+    json::object_t o;
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+TEST(JsonConstructObjectExplicitTest, Filled)
+{
+    json::object_t o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+class JsonConstructObjectImplicitTest : public ::testing::Test {
+ public:
+    JsonConstructObjectImplicitTest() : j_reference(o_reference) {}
+
+ protected:
+    json::object_t o_reference {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j_reference;
+};
+
+// std::map<json::string_t, json>
+TEST_F(JsonConstructObjectImplicitTest, StdMapStringJson)
+{
+    std::map<json::string_t, json> o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j, j_reference);
+}
+
+// std::pair<CompatibleString, T>
+TEST_F(JsonConstructObjectImplicitTest, StdPairStringT)
+{
+    std::pair<std::string, std::string> p{"first", "second"};
+    json j(p);
+
+    EXPECT_EQ(j.get<decltype(p)>(), p);
+
+    std::pair<std::string, int> p2{"first", 1};
+    // use char const*
+    json j2(std::make_pair("first", 1));
+
+    EXPECT_EQ(j2.get<decltype(p2)>(), p2);
+}
+
+// std::map<std::string, std::string>
+TEST_F(JsonConstructObjectImplicitTest, StdMapStringString)
+{
+    std::map<std::string, std::string> m;
+    m["a"] = "b";
+    m["c"] = "d";
+    m["e"] = "f";
+
+    json j(m);
+    EXPECT_EQ(j.get<decltype(m)>(), m);
+}
+
+// std::map<const char*, json>
+TEST_F(JsonConstructObjectImplicitTest, StdMapCharPointerJson)
+{
+    std::map<const char*, json> o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j, j_reference);
+}
+
+// std::multimap<json::string_t, json>
+TEST_F(JsonConstructObjectImplicitTest, StdMultiMapStringJson)
+{
+    std::multimap<json::string_t, json> o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j, j_reference);
+}
+
+// std::unordered_map<json::string_t, json>
+TEST_F(JsonConstructObjectImplicitTest, StdUnorderedMapStringJson)
+{
+    std::unordered_map<json::string_t, json> o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j, j_reference);
+}
+
+// std::unordered_multimap<json::string_t, json>
+TEST_F(JsonConstructObjectImplicitTest, StdUnorderedMultiMapStringJson)
+{
+    std::unordered_multimap<json::string_t, json> o {{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}};
+    json j(o);
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j, j_reference);
+}
+
+// associative container literal
+TEST_F(JsonConstructObjectImplicitTest, AssociativeContainerLiteral)
+{
+    json j({{"a", json(1)}, {"b", json(1u)}, {"c", json(2.2)}, {"d", json(false)}, {"e", json("string")}, {"f", json()}});
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j, j_reference);
+}
+
+TEST(JsonConstructArrayExplicitTest, Empty)
+{
+    json::array_t a;
+    json j(a);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructArrayExplicitTest, Filled)
+{
+    json::array_t a {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j(a);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+template <typename T>
+class JsonConstructArrayTest : public ::testing::Test {
+ public:
+    JsonConstructArrayTest() : j_reference(a_reference) {}
+
+ protected:
+    json::array_t a_reference {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j_reference;
+};
+
+typedef ::testing::Types<std::list<json>, std::forward_list<json>,
+                         std::array<json, 6>, std::vector<json>,
+                         std::deque<json>>
+    JsonConstructArrayTestTypes;
+TYPED_TEST_CASE(JsonConstructArrayTest, JsonConstructArrayTestTypes);
+
+// clang warns on missing braces on the TypeParam initializer line below.
+// Suppress this warning.
+#if defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-braces"
+#endif
+TYPED_TEST(JsonConstructArrayTest, Implicit)
+{
+    TypeParam a {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j(a);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, this->j_reference);
+}
+#if defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
+// std::set<json>
+TEST(JsonConstructArraySetTest, StdSet)
+{
+    std::set<json> a {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j(a);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    // we cannot really check for equality here
+}
+
+// std::unordered_set<json>
+TEST(JsonConstructArraySetTest, StdUnorderedSet)
+{
+    std::unordered_set<json> a {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j(a);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    // we cannot really check for equality here
+}
+
+// sequence container literal
+TEST(JsonConstructArrayContainerTest, Case)
+{
+    json::array_t a_reference {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j_reference(a_reference);
+
+    json j({json(1), json(1u), json(2.2), json(false), json("string"), json()});
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, j_reference);
+}
+
+TEST(JsonConstructStringExplicitTest, Empty)
+{
+    json::string_t s;
+    json j(s);
+    EXPECT_EQ(j.type(), json::value_t::string);
+}
+
+TEST(JsonConstructStringExplicitTest, Filled)
+{
+    json::string_t s {"Hello world"};
+    json j(s);
+    EXPECT_EQ(j.type(), json::value_t::string);
+}
+
+class JsonConstructStringTest : public ::testing::Test {
+ public:
+    JsonConstructStringTest() : j_reference(s_reference) {}
+
+ protected:
+    json::string_t s_reference {"Hello world"};
+    json j_reference;
+};
+
+// std::string
+TEST_F(JsonConstructStringTest, StdString)
+{
+    std::string s {"Hello world"};
+    json j(s);
+    EXPECT_EQ(j.type(), json::value_t::string);
+    EXPECT_EQ(j, j_reference);
+}
+
+// char[]
+TEST_F(JsonConstructStringTest, CharArray)
+{
+    char s[] {"Hello world"};
+    json j(s);
+    EXPECT_EQ(j.type(), json::value_t::string);
+    EXPECT_EQ(j, j_reference);
+}
+
+// const char*
+TEST_F(JsonConstructStringTest, ConstCharPointer)
+{
+    const char* s {"Hello world"};
+    json j(s);
+    EXPECT_EQ(j.type(), json::value_t::string);
+    EXPECT_EQ(j, j_reference);
+}
+
+// string literal
+TEST_F(JsonConstructStringTest, StringLiteral)
+{
+    json j("Hello world");
+    EXPECT_EQ(j.type(), json::value_t::string);
+    EXPECT_EQ(j, j_reference);
+}
+
+TEST(JsonConstructBooleanExplicitTest, Empty)
+{
+    json::boolean_t b{};
+    json j(b);
+    EXPECT_EQ(j.type(), json::value_t::boolean);
+}
+
+TEST(JsonConstructBooleanExplicitTest, True)
+{
+    json j(true);
+    EXPECT_EQ(j.type(), json::value_t::boolean);
+}
+
+TEST(JsonConstructBooleanExplicitTest, False)
+{
+    json j(false);
+    EXPECT_EQ(j.type(), json::value_t::boolean);
+}
+
+TEST(JsonConstructIntegerExplicitTest, Uninitialized)
+{
+    json::number_integer_t n{};
+    json j(n);
+    EXPECT_EQ(j.type(), json::value_t::number_integer);
+}
+
+TEST(JsonConstructIntegerExplicitTest, Initialized)
+{
+    json::number_integer_t n(42);
+    json j(n);
+    EXPECT_EQ(j.type(), json::value_t::number_integer);
+}
+
+template <typename T>
+class JsonConstructIntegerTest : public ::testing::Test {
+ public:
+    JsonConstructIntegerTest()
+        : j_reference(n_reference), j_unsigned_reference(n_unsigned_reference) {}
+
+ protected:
+    json::number_integer_t n_reference = 42;
+    json j_reference;
+    json::number_unsigned_t n_unsigned_reference = 42u;
+    json j_unsigned_reference;
+};
+
+typedef ::testing::Types<
+      short
+    , unsigned short
+    , int
+    , unsigned int
+    , long
+    , unsigned long
+    , long long
+    , unsigned long long
+    , int8_t
+    , int16_t
+    , int32_t
+    , int64_t
+#if 0
+    , int8_fast_t
+    , int16_fast_t
+    , int32_fast_t
+    , int64_fast_t
+    , int8_least_t
+    , int16_least_t
+    , int32_least_t
+    , int64_least_t
+#endif
+    , uint8_t
+    , uint16_t
+    , uint32_t
+    , uint64_t
+#if 0
+    , uint8_fast_t
+    , uint16_fast_t
+    , uint32_fast_t
+    , uint64_fast_t
+    , uint8_least_t
+    , uint16_least_t
+    , uint32_least_t
+    , uint64_least_t
+#endif
+    > JsonConstructIntegerTestTypes;
+
+TYPED_TEST_CASE(JsonConstructIntegerTest, JsonConstructIntegerTestTypes);
+
+TYPED_TEST(JsonConstructIntegerTest, Implicit)
+{
+    TypeParam n = 42;
+    json j(n);
+    if (std::is_unsigned<TypeParam>::value)
+    {
+        EXPECT_EQ(j.type(), json::value_t::number_unsigned);
+        EXPECT_EQ(j, this->j_unsigned_reference);
+    }
+    else
+    {
+        EXPECT_EQ(j.type(), json::value_t::number_integer);
+        EXPECT_EQ(j, this->j_reference);
+    }
+}
+
+class JsonConstructIntegerLiteralTest : public ::testing::Test {
+ public:
+    JsonConstructIntegerLiteralTest()
+        : j_reference(n_reference), j_unsigned_reference(n_unsigned_reference) {}
+
+ protected:
+    json::number_integer_t n_reference = 42;
+    json j_reference;
+    json::number_unsigned_t n_unsigned_reference = 42u;
+    json j_unsigned_reference;
+};
+
+TEST_F(JsonConstructIntegerLiteralTest, None)
+{
+    json j(42);
+    EXPECT_EQ(j.type(), json::value_t::number_integer);
+    EXPECT_EQ(j, j_reference);
+}
+
+TEST_F(JsonConstructIntegerLiteralTest, U)
+{
+    json j(42u);
+    EXPECT_EQ(j.type(), json::value_t::number_unsigned);
+    EXPECT_EQ(j, j_unsigned_reference);
+}
+
+TEST_F(JsonConstructIntegerLiteralTest, L)
+{
+    json j(42l);
+    EXPECT_EQ(j.type(), json::value_t::number_integer);
+    EXPECT_EQ(j, j_reference);
+}
+
+TEST_F(JsonConstructIntegerLiteralTest, UL)
+{
+    json j(42ul);
+    EXPECT_EQ(j.type(), json::value_t::number_unsigned);
+    EXPECT_EQ(j, j_unsigned_reference);
+}
+
+TEST_F(JsonConstructIntegerLiteralTest, LL)
+{
+    json j(42ll);
+    EXPECT_EQ(j.type(), json::value_t::number_integer);
+    EXPECT_EQ(j, j_reference);
+}
+
+TEST_F(JsonConstructIntegerLiteralTest, ULL)
+{
+    json j(42ull);
+    EXPECT_EQ(j.type(), json::value_t::number_unsigned);
+    EXPECT_EQ(j, j_unsigned_reference);
+}
+
+TEST(JsonConstructFloatExplicitTest, Uninitialized)
+{
+    json::number_float_t n{};
+    json j(n);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+}
+
+TEST(JsonConstructFloatExplicitTest, Initialized)
+{
+    json::number_float_t n(42.23);
+    json j(n);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+}
+
+TEST(JsonConstructFloatExplicitTest, Infinity)
+{
+    // infinity is stored properly, but serialized to null
+    json::number_float_t n(std::numeric_limits<json::number_float_t>::infinity());
+    json j(n);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+
+    // check round trip of infinity
+    json::number_float_t d = j;
+    EXPECT_EQ(d, n);
+
+    // check that inf is serialized to null
+    EXPECT_EQ(j.dump(), "null");
+}
+
+template <typename T>
+class JsonConstructFloatTest : public ::testing::Test {
+ public:
+    JsonConstructFloatTest() : j_reference(n_reference) {}
+
+ protected:
+    json::number_float_t n_reference {42.23};
+    json j_reference;
+};
+
+typedef ::testing::Types<float, double
+#if 0
+                         , long double
+#endif
+                         >
+    JsonConstructFloatTestTypes;
+
+TYPED_TEST_CASE(JsonConstructFloatTest, JsonConstructFloatTestTypes);
+
+TYPED_TEST(JsonConstructFloatTest, Implicit)
+{
+    TypeParam n = 42.23f;
+    json j(n);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+    EXPECT_LT(std::fabs(JsonTest::GetValue(j).number_float -
+                        JsonTest::GetValue(this->j_reference).number_float),
+              0.001);
+}
+
+class JsonConstructFloatLiteralTest : public ::testing::Test {
+ public:
+    JsonConstructFloatLiteralTest() : j_reference(n_reference) {}
+
+ protected:
+    json::number_float_t n_reference {42.23};
+    json j_reference;
+};
+
+TEST_F(JsonConstructFloatLiteralTest, None)
+{
+    json j(42.23);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+    EXPECT_LT(std::fabs(JsonTest::GetValue(j).number_float -
+                        JsonTest::GetValue(this->j_reference).number_float),
+              0.001);
+}
+
+TEST_F(JsonConstructFloatLiteralTest, F)
+{
+    json j(42.23f);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+    EXPECT_LT(std::fabs(JsonTest::GetValue(j).number_float -
+                        JsonTest::GetValue(this->j_reference).number_float),
+              0.001);
+}
+
+#if 0
+TEST_F(JsonConstructFloatLiteralTest, L)
+{
+    json j(42.23l);
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+    EXPECT_LT(std::fabs(JsonTest::GetValue(j).number_float -
+                        JsonTest::GetValue(this->j_reference).number_float),
+              0.001);
+}
+#endif
+
+TEST(JsonConstructInitializerEmptyTest, Explicit)
+{
+    std::initializer_list<json> l;
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+TEST(JsonConstructInitializerEmptyTest, Implicit)
+{
+    json j {};
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitArray)
+{
+    std::initializer_list<json> l = {json(json::array_t())};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitArray)
+{
+    json j {json::array_t()};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitObject)
+{
+    std::initializer_list<json> l = {json(json::object_t())};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitObject)
+{
+    json j {json::object_t()};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitString)
+{
+    std::initializer_list<json> l = {json("Hello world")};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitString)
+{
+    json j {"Hello world"};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitBoolean)
+{
+    std::initializer_list<json> l = {json(true)};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitBoolean)
+{
+    json j {true};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitInteger)
+{
+    std::initializer_list<json> l = {json(1)};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitInteger)
+{
+    json j {1};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitUnsigned)
+{
+    std::initializer_list<json> l = {json(1u)};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitUnsigned)
+{
+    json j {1u};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ExplicitFloat)
+{
+    std::initializer_list<json> l = {json(42.23)};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerOneTest, ImplicitFloat)
+{
+    json j {42.23};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerManyTest, Explicit)
+{
+    std::initializer_list<json> l = {1, 1u, 42.23, true, nullptr, json::object_t(), json::array_t()};
+    json j(l);
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerManyTest, Implicit)
+{
+    json j {1, 1u, 42.23, true, nullptr, json::object_t(), json::array_t()};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerImplicitTest, Object)
+{
+    json j { {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false} };
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+TEST(JsonConstructInitializerImplicitTest, Array)
+{
+    json j { {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false}, 13 };
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerExplicitTest, EmptyObject)
+{
+    json j = json::object();
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+TEST(JsonConstructInitializerExplicitTest, Object)
+{
+    json j = json::object({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false} });
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+TEST(JsonConstructInitializerExplicitTest, ObjectError)
+{
+    EXPECT_THROW_MSG(json::object({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false}, 13 }),
+    json::type_error,
+    "[json.exception.type_error.301] cannot create object from initializer list");
+}
+
+// std::pair<CompatibleString, T> with error
+TEST(JsonConstructInitializerPairErrorTest, WrongFieldNumber)
+{
+    json j{{"too", "much"}, {"string", "fields"}};
+    EXPECT_THROW_MSG((j.get<std::pair<std::string, std::string>>()), json::other_error,
+                     "[json.exception.other_error.502] conversion "
+                     "to std::pair requires the object to have "
+                     "exactly one field, but it has 2");
+}
+
+TEST(JsonConstructInitializerPairErrorTest, WrongJsonType)
+{
+    json j(42);
+    EXPECT_THROW_MSG((j.get<std::pair<std::string, std::string>>()), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is number");
+}
+
+TEST(JsonConstructInitializerTest, EmptyArray)
+{
+    json j = json::array();
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConstructInitializerTest, Array)
+{
+    json j = json::array({ {"one", 1}, {"two", 1u}, {"three", 2.2}, {"four", false} });
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+// create an array of n copies of a given value
+TEST(JsonConstructArrayCopyTest, Case)
+{
+    json v = {1, "foo", 34.23, {1, 2, 3}, {{"A", 1}, {"B", 2u}}};
+    json arr(3, v);
+    EXPECT_EQ(arr.size(), 3u);
+    for (auto& x : arr)
+    {
+        EXPECT_EQ(x, v);
+    }
+}
+
+// create a JSON container from an iterator range
+TEST(JsonConstructIteratorTest, ObjectBeginEnd)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json j_new(jobject.begin(), jobject.end());
+    EXPECT_EQ(j_new, jobject);
+#else
+    EXPECT_THROW(json(jobject.begin(), jobject.end()), json::invalid_iterator);
+#endif
+}
+
+TEST(JsonConstructIteratorTest, ObjectBeginEndConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json j_new(jobject.cbegin(), jobject.cend());
+    EXPECT_EQ(j_new, jobject);
+#else
+    EXPECT_THROW(json(jobject.cbegin(), jobject.cend()), json::invalid_iterator);
+#endif
+}
+
+TEST(JsonConstructIteratorTest, ObjectBeginBegin)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json j_new(jobject.begin(), jobject.begin());
+    EXPECT_EQ(j_new, json::object());
+#else
+    EXPECT_THROW(json(jobject.begin(), jobject.end()), json::invalid_iterator);
+#endif
+}
+
+TEST(JsonConstructIteratorTest, ObjectBeginBeginConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json j_new(jobject.cbegin(), jobject.cbegin());
+    EXPECT_EQ(j_new, json::object());
+#else
+    EXPECT_THROW(json(jobject.cbegin(), jobject.cend()), json::invalid_iterator);
+#endif
+}
+#if 0
+TEST(JsonConstructIteratorTest, ObjectSubrange)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+    json j_new(jobject.find("b"), jobject.find("e"));
+    EXPECT_EQ(j_new, json({{"b", 1}, {"c", 17u}, {"d", false}}));
+}
+#endif
+TEST(JsonConstructIteratorTest, ObjectIncompatibleIterators)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+    json jobject2 = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    EXPECT_THROW_MSG(json(jobject.begin(), jobject2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+    EXPECT_THROW_MSG(json(jobject2.begin(), jobject.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+}
+
+TEST(JsonConstructIteratorTest, ObjectIncompatibleIteratorsConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+    json jobject2 = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    EXPECT_THROW_MSG(json(jobject.cbegin(), jobject2.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+    EXPECT_THROW_MSG(json(jobject2.cbegin(), jobject.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+}
+
+TEST(JsonConstructIteratorTest, ArrayBeginEnd)
+{
+    json jarray = {1, 2, 3, 4, 5};
+    json j_new(jarray.begin(), jarray.end());
+    EXPECT_EQ(j_new, jarray);
+}
+
+TEST(JsonConstructIteratorTest, ArrayBeginEndConst)
+{
+    json jarray = {1, 2, 3, 4, 5};
+    json j_new(jarray.cbegin(), jarray.cend());
+    EXPECT_EQ(j_new, jarray);
+}
+
+TEST(JsonConstructIteratorTest, ArrayBeginBegin)
+{
+    json jarray = {1, 2, 3, 4, 5};
+    json j_new(jarray.begin(), jarray.begin());
+    EXPECT_EQ(j_new, json::array());
+}
+
+TEST(JsonConstructIteratorTest, ArrayBeginBeginConst)
+{
+    json jarray = {1, 2, 3, 4, 5};
+    json j_new(jarray.cbegin(), jarray.cbegin());
+    EXPECT_EQ(j_new, json::array());
+}
+
+TEST(JsonConstructIteratorTest, ArraySubrange)
+{
+    json jarray = {1, 2, 3, 4, 5};
+    json j_new(jarray.begin() + 1, jarray.begin() + 3);
+    EXPECT_EQ(j_new, json({2, 3}));
+}
+
+TEST(JsonConstructIteratorTest, ArraySubrangeConst)
+{
+    json jarray = {1, 2, 3, 4, 5};
+    json j_new(jarray.cbegin() + 1, jarray.cbegin() + 3);
+    EXPECT_EQ(j_new, json({2, 3}));
+}
+
+TEST(JsonConstructIteratorTest, ArrayIncompatibleIterators)
+{
+    json jarray = {1, 2, 3, 4};
+    json jarray2 = {2, 3, 4, 5};
+    EXPECT_THROW_MSG(json(jarray.begin(), jarray2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+    EXPECT_THROW_MSG(json(jarray2.begin(), jarray.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+}
+
+TEST(JsonConstructIteratorTest, ArrayIncompatibleIteratorsConst)
+{
+    json jarray = {1, 2, 3, 4};
+    json jarray2 = {2, 3, 4, 5};
+    EXPECT_THROW_MSG(json(jarray.cbegin(), jarray2.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+    EXPECT_THROW_MSG(json(jarray2.cbegin(), jarray.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.201] iterators are not compatible");
+}
+
+TEST(JsonConstructTwoValidIteratorTest, Null)
+{
+    json j;
+    EXPECT_THROW_MSG(json(j.begin(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.206] cannot construct with iterators from null");
+}
+
+TEST(JsonConstructTwoValidIteratorTest, NullConst)
+{
+    json j;
+    EXPECT_THROW_MSG(json(j.cbegin(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.206] cannot construct with iterators from null");
+}
+
+TEST(JsonConstructTwoValidIteratorTest, String)
+{
+    json j = "foo";
+    json j_new(j.begin(), j.end());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, StringConst)
+{
+    json j = "bar";
+    json j_new(j.cbegin(), j.cend());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, Boolean)
+{
+    json j = false;
+    json j_new(j.begin(), j.end());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, BooleanConst)
+{
+    json j = true;
+    json j_new(j.cbegin(), j.cend());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, Integer)
+{
+    json j = 17;
+    json j_new(j.begin(), j.end());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, IntegerConst)
+{
+    json j = 17;
+    json j_new(j.cbegin(), j.cend());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, Unsigned)
+{
+    json j = 17u;
+    json j_new(j.begin(), j.end());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, UnsignedConst)
+{
+    json j = 17u;
+    json j_new(j.cbegin(), j.cend());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, Float)
+{
+    json j = 23.42;
+    json j_new(j.begin(), j.end());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoValidIteratorTest, FloatConst)
+{
+    json j = 23.42;
+    json j_new(j.cbegin(), j.cend());
+    EXPECT_EQ(j, j_new);
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, String)
+{
+    json j = "foo";
+    EXPECT_THROW_MSG(json(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, StringConst)
+{
+    json j = "bar";
+    EXPECT_THROW_MSG(json(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, Boolean)
+{
+    json j = false;
+    EXPECT_THROW_MSG(json(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, BooleanConst)
+{
+    json j = true;
+    EXPECT_THROW_MSG(json(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, Integer)
+{
+    json j = 17;
+    EXPECT_THROW_MSG(json(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, IntegerConst)
+{
+    json j = 17;
+    EXPECT_THROW_MSG(json(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, Unsigned)
+{
+    json j = 17u;
+    EXPECT_THROW_MSG(json(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, UnsignedConst)
+{
+    json j = 17u;
+    EXPECT_THROW_MSG(json(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, Float)
+{
+    json j = 23.42;
+    EXPECT_THROW_MSG(json(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonConstructTwoInvalidIteratorTest, FloatConst)
+{
+    json j = 23.42;
+    EXPECT_THROW_MSG(json(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(json(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-constructor2.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-constructor2.cpp
new file mode 100644
index 0000000..39f1301
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-constructor2.cpp
@@ -0,0 +1,185 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonCopyConstructorTest, Object)
+{
+    json j {{"foo", 1}, {"bar", false}};
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, Array)
+{
+    json j {"foo", 1, 42.23, false};
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, Null)
+{
+    json j(nullptr);
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, Boolean)
+{
+    json j(true);
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, String)
+{
+    json j("Hello world");
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, Integer)
+{
+    json j(42);
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, Unsigned)
+{
+    json j(42u);
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyConstructorTest, Float)
+{
+    json j(42.23);
+    json k(j);
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonMoveConstructorTest, Case)
+{
+    json j {{"foo", "bar"}, {"baz", {1, 2, 3, 4}}, {"a", 42u}, {"b", 42.23}, {"c", nullptr}};
+    EXPECT_EQ(j.type(), json::value_t::object);
+    json k(std::move(j));
+    EXPECT_EQ(k.type(), json::value_t::object);
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonCopyAssignmentTest, Object)
+{
+    json j {{"foo", 1}, {"bar", false}};
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, Array)
+{
+    json j {"foo", 1, 42.23, false};
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, Null)
+{
+    json j(nullptr);
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, Boolean)
+{
+    json j(true);
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, String)
+{
+    json j("Hello world");
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, Integer)
+{
+    json j(42);
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, Unsigned)
+{
+    json j(42u);
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonCopyAssignmentTest, Float)
+{
+    json j(42.23);
+    json k;
+    k = j;
+    EXPECT_EQ(j, k);
+}
+
+TEST(JsonDestructorTest, Object)
+{
+    auto j = new json {{"foo", 1}, {"bar", false}};
+    delete j;
+}
+
+TEST(JsonDestructorTest, Array)
+{
+    auto j = new json {"foo", 1, 1u, false, 23.42};
+    delete j;
+}
+
+TEST(JsonDestructorTest, String)
+{
+    auto j = new json("Hello world");
+    delete j;
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-convenience.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-convenience.cpp
new file mode 100644
index 0000000..1ce647d
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-convenience.cpp
@@ -0,0 +1,121 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "llvm/SmallString.h"
+
+#include "unit-json.h"
+
+#include "support/json_serializer.h"
+
+using wpi::json;
+
+class JsonTypeNameTest
+    : public ::testing::TestWithParam<std::pair<json::value_t, const char*>> {};
+TEST_P(JsonTypeNameTest, Case)
+{
+    EXPECT_EQ(json(GetParam().first).type_name(), GetParam().second);
+}
+
+static const std::pair<json::value_t, const char*> type_name_cases[] = {
+    {json::value_t::null, "null"},
+    {json::value_t::object, "object"},
+    {json::value_t::array, "array"},
+    {json::value_t::number_integer, "number"},
+    {json::value_t::number_unsigned, "number"},
+    {json::value_t::number_float, "number"},
+    {json::value_t::boolean, "boolean"},
+    {json::value_t::string, "string"},
+    {json::value_t::discarded, "discarded"},
+};
+
+INSTANTIATE_TEST_CASE_P(JsonTypeNameTests, JsonTypeNameTest,
+                        ::testing::ValuesIn(type_name_cases), );
+
+class JsonStringEscapeTest
+    : public ::testing::TestWithParam<std::pair<const char*, const char*>> {};
+TEST_P(JsonStringEscapeTest, Case)
+{
+    llvm::SmallString<32> buf;
+    llvm::raw_svector_ostream ss(buf);
+    json::serializer s(ss);
+    s.dump_escaped(GetParam().first);
+    EXPECT_EQ(ss.str(), llvm::StringRef(GetParam().second));
+}
+
+static const std::pair<const char*, const char*> string_escape_cases[] = {
+    {"\"", "\\\""},
+    {"\\", "\\\\"},
+    {"\b", "\\b"},
+    {"\f", "\\f"},
+    {"\n", "\\n"},
+    {"\r", "\\r"},
+    {"\t", "\\t"},
+
+    {"\x01", "\\u0001"},
+    {"\x02", "\\u0002"},
+    {"\x03", "\\u0003"},
+    {"\x04", "\\u0004"},
+    {"\x05", "\\u0005"},
+    {"\x06", "\\u0006"},
+    {"\x07", "\\u0007"},
+    {"\x08", "\\b"},
+    {"\x09", "\\t"},
+    {"\x0a", "\\n"},
+    {"\x0b", "\\u000b"},
+    {"\x0c", "\\f"},
+    {"\x0d", "\\r"},
+    {"\x0e", "\\u000e"},
+    {"\x0f", "\\u000f"},
+    {"\x10", "\\u0010"},
+    {"\x11", "\\u0011"},
+    {"\x12", "\\u0012"},
+    {"\x13", "\\u0013"},
+    {"\x14", "\\u0014"},
+    {"\x15", "\\u0015"},
+    {"\x16", "\\u0016"},
+    {"\x17", "\\u0017"},
+    {"\x18", "\\u0018"},
+    {"\x19", "\\u0019"},
+    {"\x1a", "\\u001a"},
+    {"\x1b", "\\u001b"},
+    {"\x1c", "\\u001c"},
+    {"\x1d", "\\u001d"},
+    {"\x1e", "\\u001e"},
+    {"\x1f", "\\u001f"},
+};
+
+INSTANTIATE_TEST_CASE_P(JsonStringEscapeTests, JsonStringEscapeTest,
+                        ::testing::ValuesIn(string_escape_cases), );
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-conversions.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-conversions.cpp
new file mode 100644
index 0000000..08c04f4
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-conversions.cpp
@@ -0,0 +1,560 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+using wpi::JsonTest;
+
+#include <deque>
+//#include <forward_list>
+#include <list>
+#include <map>
+#include <unordered_map>
+#include <unordered_set>
+
+template <typename T>
+class JsonGetObjectTest : public ::testing::Test {
+ public:
+    JsonGetObjectTest() : j(o_reference) {}
+
+ protected:
+    json::object_t o_reference = {{"object", json::object()}, {"array", {1, 2, 3, 4}}, {"number", 42}, {"boolean", false}, {"null", nullptr}, {"string", "Hello world"} };
+    json j;
+};
+
+typedef ::testing::Types<
+      json::object_t
+    , std::map<json::string_t, json>
+    , std::multimap<json::string_t, json>
+    , std::unordered_map<json::string_t, json>
+    , std::unordered_multimap<json::string_t, json>
+    > JsonGetObjectTestTypes;
+TYPED_TEST_CASE(JsonGetObjectTest, JsonGetObjectTestTypes);
+
+TYPED_TEST(JsonGetObjectTest, Explicit)
+{
+    TypeParam o = (this->j).template get<TypeParam>();
+    EXPECT_EQ(json(o), this->j);
+}
+
+TYPED_TEST(JsonGetObjectTest, Implicit)
+{
+    TypeParam o = this->j;
+    EXPECT_EQ(json(o), this->j);
+}
+
+// exception in case of a non-object type
+TEST(JsonGetObjectExceptionTest, TypeError)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is null");
+    EXPECT_THROW_MSG(json(json::value_t::array).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is array");
+    EXPECT_THROW_MSG(json(json::value_t::string).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is string");
+    EXPECT_THROW_MSG(json(json::value_t::boolean).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is boolean");
+    EXPECT_THROW_MSG(json(json::value_t::number_integer).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_unsigned).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_float).get<json::object_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is number");
+}
+
+template <typename T>
+class JsonGetArrayTest : public ::testing::Test {
+ public:
+    JsonGetArrayTest() : j(a_reference) {}
+
+ protected:
+    json::array_t a_reference {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j;
+};
+
+typedef ::testing::Types<json::array_t, std::list<json>,
+                         /*std::forward_list<json>,*/ std::vector<json>,
+                         std::deque<json>>
+    JsonGetArrayTestTypes;
+TYPED_TEST_CASE(JsonGetArrayTest, JsonGetArrayTestTypes);
+
+TYPED_TEST(JsonGetArrayTest, Explicit)
+{
+    TypeParam a = (this->j).template get<TypeParam>();
+    EXPECT_EQ(json(a), this->j);
+}
+
+TYPED_TEST(JsonGetArrayTest, Implicit)
+{
+    TypeParam a = this->j;
+    EXPECT_EQ(json(a), this->j);
+}
+
+#if !defined(JSON_NOEXCEPTION)
+// reserve is called on containers that supports it
+TEST(JsonGetArrayAdditionalTest, ExplicitStdVectorReserve)
+{
+    json::array_t a_reference {json(1), json(1u), json(2.2), json(false), json("string"), json()};
+    json j(a_reference);
+
+    // making the call to from_json throw in order to check capacity
+    std::vector<float> v;
+    EXPECT_THROW(wpi::from_json(j, v), json::type_error);
+    EXPECT_EQ(v.capacity(), j.size());
+
+    // make sure all values are properly copied
+    std::vector<int> v2 = json({1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
+    EXPECT_EQ(v2.size(), 10u);
+}
+#endif
+
+// built-in arrays
+TEST(JsonGetArrayAdditionalTest, ExplicitBuiltinArray)
+{
+    const char str[] = "a string";
+    const int nbs[] = {0, 1, 2};
+
+    json j2 = nbs;
+    json j3 = str;
+
+    auto v = j2.get<std::vector<int>>();
+    auto s = j3.get<std::string>();
+    EXPECT_TRUE(std::equal(v.begin(), v.end(), std::begin(nbs)));
+    EXPECT_EQ(s, str);
+}
+#if 0
+TEST(JsonGetArrayExceptionTest, ForwardList)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<std::forward_list<json>>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+}
+#endif
+TEST(JsonGetArrayExceptionTest, StdVector)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<std::vector<json>>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+}
+
+// exception in case of a non-array type
+TEST(JsonGetArrayExceptionTest, TypeError)
+{
+    EXPECT_THROW_MSG(json(json::value_t::object).get<std::vector<int>>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is object");
+    EXPECT_THROW_MSG(json(json::value_t::null).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+    EXPECT_THROW_MSG(json(json::value_t::object).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is object");
+    EXPECT_THROW_MSG(json(json::value_t::string).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is string");
+    EXPECT_THROW_MSG(json(json::value_t::boolean).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is boolean");
+    EXPECT_THROW_MSG(json(json::value_t::number_integer).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_unsigned).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_float).get<json::array_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is number");
+}
+
+template <typename T>
+class JsonGetStringTest : public ::testing::Test {
+ public:
+    JsonGetStringTest() : j(s_reference) {}
+
+ protected:
+    json::string_t s_reference {"Hello world"};
+    json j;
+};
+
+typedef ::testing::Types<json::string_t, std::string> JsonGetStringTestTypes;
+TYPED_TEST_CASE(JsonGetStringTest, JsonGetStringTestTypes);
+
+TYPED_TEST(JsonGetStringTest, Explicit)
+{
+    TypeParam s = (this->j).template get<TypeParam>();
+    EXPECT_EQ(json(s), this->j);
+}
+
+TYPED_TEST(JsonGetStringTest, Implicit)
+{
+    TypeParam s = this->j;
+    EXPECT_EQ(json(s), this->j);
+}
+
+// exception in case of a non-string type
+TEST(JsonGetStringExceptionTest, TypeError)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is null");
+    EXPECT_THROW_MSG(json(json::value_t::object).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is object");
+    EXPECT_THROW_MSG(json(json::value_t::array).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is array");
+    EXPECT_THROW_MSG(json(json::value_t::boolean).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is boolean");
+    EXPECT_THROW_MSG(json(json::value_t::number_integer).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_unsigned).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_float).get<json::string_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be string, but is number");
+}
+
+template <typename T>
+class JsonGetBooleanTest : public ::testing::Test {
+ public:
+    JsonGetBooleanTest() : j(b_reference) {}
+
+ protected:
+    json::boolean_t b_reference {true};
+    json j;
+};
+
+typedef ::testing::Types<json::boolean_t, bool> JsonGetBooleanTestTypes;
+TYPED_TEST_CASE(JsonGetBooleanTest, JsonGetBooleanTestTypes);
+
+TYPED_TEST(JsonGetBooleanTest, Explicit)
+{
+    TypeParam b = (this->j).template get<TypeParam>();
+    EXPECT_EQ(json(b), this->j);
+}
+
+TYPED_TEST(JsonGetBooleanTest, Implicit)
+{
+    TypeParam b = this->j;
+    EXPECT_EQ(json(b), this->j);
+}
+
+// exception in case of a non-string type
+TEST(JsonGetBooleanExceptionTest, TypeError)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is null");
+    EXPECT_THROW_MSG(json(json::value_t::object).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is object");
+    EXPECT_THROW_MSG(json(json::value_t::array).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is array");
+    EXPECT_THROW_MSG(json(json::value_t::string).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is string");
+    EXPECT_THROW_MSG(json(json::value_t::number_integer).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_unsigned).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is number");
+    EXPECT_THROW_MSG(json(json::value_t::number_float).get<json::boolean_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be boolean, but is number");
+}
+
+template <typename T>
+class JsonGetIntegerTest : public ::testing::Test {
+ public:
+    JsonGetIntegerTest() : j(n_reference), j_unsigned(n_unsigned_reference) {}
+
+ protected:
+    json::number_integer_t n_reference {42};
+    json j;
+    json::number_unsigned_t n_unsigned_reference {42u};
+    json j_unsigned;
+};
+
+typedef ::testing::Types<
+      short
+    , unsigned short
+    , int
+    , unsigned int
+    , long
+    , unsigned long
+    , long long
+    , unsigned long long
+    , int8_t
+    , int16_t
+    , int32_t
+    , int64_t
+#if 0
+    , int8_fast_t
+    , int16_fast_t
+    , int32_fast_t
+    , int64_fast_t
+    , int8_least_t
+    , int16_least_t
+    , int32_least_t
+    , int64_least_t
+#endif
+    , uint8_t
+    , uint16_t
+    , uint32_t
+    , uint64_t
+#if 0
+    , uint8_fast_t
+    , uint16_fast_t
+    , uint32_fast_t
+    , uint64_fast_t
+    , uint8_least_t
+    , uint16_least_t
+    , uint32_least_t
+    , uint64_least_t
+#endif
+    > JsonGetIntegerTestTypes;
+
+TYPED_TEST_CASE(JsonGetIntegerTest, JsonGetIntegerTestTypes);
+
+TYPED_TEST(JsonGetIntegerTest, Explicit)
+{
+    TypeParam n = (this->j).template get<TypeParam>();
+    EXPECT_EQ(json(n), this->j);
+}
+
+TYPED_TEST(JsonGetIntegerTest, Implicit)
+{
+    if (std::is_unsigned<TypeParam>::value)
+    {
+        TypeParam n = this->j_unsigned;
+        EXPECT_EQ(json(n), this->j_unsigned);
+    }
+    else
+    {
+        TypeParam n = this->j;
+        EXPECT_EQ(json(n), this->j);
+    }
+}
+
+// exception in case of a non-number type
+TEST(JsonGetIntegerExceptionTest, TypeError)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<json::number_integer_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is null");
+    EXPECT_THROW_MSG(json(json::value_t::object).get<json::number_integer_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is object");
+    EXPECT_THROW_MSG(json(json::value_t::array).get<json::number_integer_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is array");
+    EXPECT_THROW_MSG(json(json::value_t::string).get<json::number_integer_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is string");
+    EXPECT_THROW_MSG(json(json::value_t::boolean).get<json::number_integer_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is boolean");
+
+    EXPECT_NO_THROW(json(json::value_t::number_float).get<json::number_integer_t>());
+    EXPECT_NO_THROW(json(json::value_t::number_float).get<json::number_unsigned_t>());
+}
+
+template <typename T>
+class JsonGetFloatTest : public ::testing::Test {
+ public:
+    JsonGetFloatTest() : j(n_reference) {}
+
+ protected:
+    json::number_float_t n_reference {42.23};
+    json j;
+};
+
+typedef ::testing::Types<json::number_float_t, float, double>
+    JsonGetFloatTestTypes;
+
+TYPED_TEST_CASE(JsonGetFloatTest, JsonGetFloatTestTypes);
+
+TYPED_TEST(JsonGetFloatTest, Explicit)
+{
+    TypeParam n = (this->j).template get<TypeParam>();
+    EXPECT_LT(std::fabs(JsonTest::GetValue(json(n)).number_float -
+                        JsonTest::GetValue(this->j).number_float), 0.001);
+}
+
+TYPED_TEST(JsonGetFloatTest, Implicit)
+{
+    TypeParam n = this->j;
+    EXPECT_LT(std::fabs(JsonTest::GetValue(json(n)).number_float -
+                        JsonTest::GetValue(this->j).number_float), 0.001);
+}
+
+// exception in case of a non-string type
+TEST(JsonGetFloatExceptionTest, TypeError)
+{
+    EXPECT_THROW_MSG(json(json::value_t::null).get<json::number_float_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is null");
+    EXPECT_THROW_MSG(json(json::value_t::object).get<json::number_float_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is object");
+    EXPECT_THROW_MSG(json(json::value_t::array).get<json::number_float_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is array");
+    EXPECT_THROW_MSG(json(json::value_t::string).get<json::number_float_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is string");
+    EXPECT_THROW_MSG(json(json::value_t::boolean).get<json::number_float_t>(), json::type_error,
+                     "[json.exception.type_error.302] type must be number, but is boolean");
+
+    EXPECT_NO_THROW(json(json::value_t::number_integer).get<json::number_float_t>());
+    EXPECT_NO_THROW(json(json::value_t::number_unsigned).get<json::number_float_t>());
+}
+
+TEST(JsonGetEnumTest, Case)
+{
+    enum c_enum { value_1, value_2 };
+    enum class cpp_enum { value_1, value_2 };
+
+    EXPECT_EQ(json(value_1).get<c_enum>(), value_1);
+    EXPECT_EQ(json(cpp_enum::value_1).get<cpp_enum>(), cpp_enum::value_1);
+}
+
+class JsonObjectConversionTest : public ::testing::Test {
+ protected:
+    json j1 = {{"one", 1}, {"two", 2}, {"three", 3}};
+    json j2 = {{"one", 1u}, {"two", 2u}, {"three", 3u}};
+    json j3 = {{"one", 1.1}, {"two", 2.2}, {"three", 3.3}};
+    json j4 = {{"one", true}, {"two", false}, {"three", true}};
+    json j5 = {{"one", "eins"}, {"two", "zwei"}, {"three", "drei"}};
+};
+
+TEST_F(JsonObjectConversionTest, StdMap)
+{
+    auto m1 = j1.get<std::map<std::string, int>>();
+    auto m2 = j2.get<std::map<std::string, unsigned int>>();
+    auto m3 = j3.get<std::map<std::string, double>>();
+    auto m4 = j4.get<std::map<std::string, bool>>();
+    //auto m5 = j5.get<std::map<std::string, std::string>>();
+}
+
+TEST_F(JsonObjectConversionTest, StdUnorderedMap)
+{
+    auto m1 = j1.get<std::unordered_map<std::string, int>>();
+    auto m2 = j2.get<std::unordered_map<std::string, unsigned int>>();
+    auto m3 = j3.get<std::unordered_map<std::string, double>>();
+    auto m4 = j4.get<std::unordered_map<std::string, bool>>();
+    //auto m5 = j5.get<std::unordered_map<std::string, std::string>>();
+    //CHECK(m5["one"] == "eins");
+}
+
+TEST_F(JsonObjectConversionTest, StdMultiMap)
+{
+    auto m1 = j1.get<std::multimap<std::string, int>>();
+    auto m2 = j2.get<std::multimap<std::string, unsigned int>>();
+    auto m3 = j3.get<std::multimap<std::string, double>>();
+    auto m4 = j4.get<std::multimap<std::string, bool>>();
+    //auto m5 = j5.get<std::multimap<std::string, std::string>>();
+    //CHECK(m5["one"] == "eins");
+}
+
+TEST_F(JsonObjectConversionTest, StdUnorderedMultiMap)
+{
+    auto m1 = j1.get<std::unordered_multimap<std::string, int>>();
+    auto m2 = j2.get<std::unordered_multimap<std::string, unsigned int>>();
+    auto m3 = j3.get<std::unordered_multimap<std::string, double>>();
+    auto m4 = j4.get<std::unordered_multimap<std::string, bool>>();
+    //auto m5 = j5.get<std::unordered_multimap<std::string, std::string>>();
+    //CHECK(m5["one"] == "eins");
+}
+
+// exception in case of a non-object type
+TEST_F(JsonObjectConversionTest, Exception)
+{
+    EXPECT_THROW_MSG((json().get<std::map<std::string, int>>()), json::type_error,
+                     "[json.exception.type_error.302] type must be object, but is null");
+}
+
+class JsonArrayConversionTest : public ::testing::Test {
+ protected:
+    json j1 = {1, 2, 3, 4};
+    json j2 = {1u, 2u, 3u, 4u};
+    json j3 = {1.2, 2.3, 3.4, 4.5};
+    json j4 = {true, false, true};
+    json j5 = {"one", "two", "three"};
+};
+
+TEST_F(JsonArrayConversionTest, StdList)
+{
+    auto m1 = j1.get<std::list<int>>();
+    auto m2 = j2.get<std::list<unsigned int>>();
+    auto m3 = j3.get<std::list<double>>();
+    auto m4 = j4.get<std::list<bool>>();
+    auto m5 = j5.get<std::list<std::string>>();
+}
+
+#if 0
+TEST_F(JsonArrayConversionTest, StdForwardList)
+{
+    auto m1 = j1.get<std::forward_list<int>>();
+    auto m2 = j2.get<std::forward_list<unsigned int>>();
+    auto m3 = j3.get<std::forward_list<double>>();
+    auto m4 = j4.get<std::forward_list<bool>>();
+    auto m5 = j5.get<std::forward_list<std::string>>();
+}
+#endif
+
+TEST_F(JsonArrayConversionTest, StdVector)
+{
+    auto m1 = j1.get<std::vector<int>>();
+    auto m2 = j2.get<std::vector<unsigned int>>();
+    auto m3 = j3.get<std::vector<double>>();
+    auto m4 = j4.get<std::vector<bool>>();
+    auto m5 = j5.get<std::vector<std::string>>();
+}
+
+TEST_F(JsonArrayConversionTest, StdDeque)
+{
+    auto m1 = j1.get<std::deque<int>>();
+    auto m2 = j2.get<std::deque<unsigned int>>();
+    auto m3 = j2.get<std::deque<double>>();
+    auto m4 = j4.get<std::deque<bool>>();
+    auto m5 = j5.get<std::deque<std::string>>();
+}
+
+TEST_F(JsonArrayConversionTest, StdSet)
+{
+    auto m1 = j1.get<std::set<int>>();
+    auto m2 = j2.get<std::set<unsigned int>>();
+    auto m3 = j3.get<std::set<double>>();
+    auto m4 = j4.get<std::set<bool>>();
+    auto m5 = j5.get<std::set<std::string>>();
+}
+
+TEST_F(JsonArrayConversionTest, StdUnorderedSet)
+{
+    auto m1 = j1.get<std::unordered_set<int>>();
+    auto m2 = j2.get<std::unordered_set<unsigned int>>();
+    auto m3 = j3.get<std::unordered_set<double>>();
+    auto m4 = j4.get<std::unordered_set<bool>>();
+    auto m5 = j5.get<std::unordered_set<std::string>>();
+}
+
+// exception in case of a non-object type
+TEST_F(JsonArrayConversionTest, Exception)
+{
+    EXPECT_THROW_MSG((json().get<std::list<int>>()), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+    EXPECT_THROW_MSG((json().get<std::vector<int>>()), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+    EXPECT_THROW_MSG((json().get<std::vector<json>>()), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+    EXPECT_THROW_MSG((json().get<std::list<json>>()), json::type_error,
+                     "[json.exception.type_error.302] type must be array, but is null");
+    // does type really must be an array? or it rather must not be null?
+    // that's what I thought when other test like this one broke
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-deserialization.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-deserialization.cpp
new file mode 100644
index 0000000..625cc54
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-deserialization.cpp
@@ -0,0 +1,138 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+#include "support/raw_istream.h"
+using wpi::json;
+
+#include <valarray>
+
+TEST(JsonDeserializationTest, SuccessfulStream)
+{
+    std::string s = "[\"foo\",1,2,3,false,{\"one\":1}]";
+    wpi::raw_mem_istream ss(s.data(), s.size());
+    json j = json::parse(ss);
+    ASSERT_EQ(j, json({"foo", 1, 2, 3, false, {{"one", 1}}}));
+}
+
+TEST(JsonDeserializationTest, SuccessfulStringLiteral)
+{
+    auto s = "[\"foo\",1,2,3,false,{\"one\":1}]";
+    json j = json::parse(s);
+    ASSERT_EQ(j, json({"foo", 1, 2, 3, false, {{"one", 1}}}));
+}
+
+TEST(JsonDeserializationTest, SuccessfulStdString)
+{
+    std::string s = "[\"foo\",1,2,3,false,{\"one\":1}]";
+    json j = json::parse(s);
+    ASSERT_EQ(j, json({"foo", 1, 2, 3, false, {{"one", 1}}}));
+}
+
+TEST(JsonDeserializationTest, SuccessfulStreamOperator)
+{
+    std::string s = "[\"foo\",1,2,3,false,{\"one\":1}]";
+    wpi::raw_mem_istream ss(s.data(), s.size());
+    json j;
+    ss >> j;
+    ASSERT_EQ(j, json({"foo", 1, 2, 3, false, {{"one", 1}}}));
+}
+
+TEST(JsonDeserializationTest, SuccessfulUserStringLiteral)
+{
+    ASSERT_EQ("[\"foo\",1,2,3,false,{\"one\":1}]"_json, json({"foo", 1, 2, 3, false, {{"one", 1}}}));
+}
+
+TEST(JsonDeserializationTest, UnsuccessfulStream)
+{
+    std::string s = "[\"foo\",1,2,3,false,{\"one\":1}";
+    wpi::raw_mem_istream ss(s.data(), s.size());
+    ASSERT_THROW_MSG(json::parse(ss), json::parse_error,
+                     "[json.exception.parse_error.101] parse error at 29: syntax error - unexpected end of input; expected ']'");
+}
+
+TEST(JsonDeserializationTest, UnsuccessfulStdString)
+{
+    std::string s = "[\"foo\",1,2,3,false,{\"one\":1}";
+    ASSERT_THROW_MSG(json::parse(s), json::parse_error,
+                     "[json.exception.parse_error.101] parse error at 29: syntax error - unexpected end of input; expected ']'");
+}
+
+TEST(JsonDeserializationTest, UnsuccessfulStreamOperator)
+{
+    std::string s = "[\"foo\",1,2,3,false,{\"one\":1}";
+    wpi::raw_mem_istream ss(s.data(), s.size());
+    json j;
+    ASSERT_THROW_MSG(ss >> j, json::parse_error,
+                     "[json.exception.parse_error.101] parse error at 29: syntax error - unexpected end of input; expected ']'");
+}
+
+TEST(JsonDeserializationTest, UnsuccessfulUserStringLiteral)
+{
+    ASSERT_THROW_MSG("[\"foo\",1,2,3,false,{\"one\":1}"_json, json::parse_error,
+                     "[json.exception.parse_error.101] parse error at 29: syntax error - unexpected end of input; expected ']'");
+}
+
+// these cases are required for 100% line coverage
+class JsonDeserializationErrorTest
+    : public ::testing::TestWithParam<const char*> {};
+
+TEST_P(JsonDeserializationErrorTest, ErrorCase)
+{
+    ASSERT_THROW(json::parse(GetParam()), json::parse_error);
+}
+
+static const char* error_cases[] = {
+    "\"aaaaaa\\u",
+    "\"aaaaaa\\u1",
+    "\"aaaaaa\\u11111111",
+    "\"aaaaaau11111111\\",
+    "\"\x7F\xC1",
+    "\"\x7F\xDF\x7F",
+    "\"\x7F\xDF\xC0",
+    "\"\x7F\xE0\x9F",
+    "\"\x7F\xEF\xC0",
+    "\"\x7F\xED\x7F",
+    "\"\x7F\xF0\x8F",
+    "\"\x7F\xF0\xC0",
+    "\"\x7F\xF3\x7F",
+    "\"\x7F\xF3\xC0",
+    "\"\x7F\xF4\x7F",
+};
+
+INSTANTIATE_TEST_CASE_P(JsonDeserializationErrorTests,
+                        JsonDeserializationErrorTest,
+                        ::testing::ValuesIn(error_cases), );
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-element_access1.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-element_access1.cpp
new file mode 100644
index 0000000..a97d6b6
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-element_access1.cpp
@@ -0,0 +1,873 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+class JsonElementArrayAccessTestBase {
+ public:
+    JsonElementArrayAccessTestBase() : j_const(j) {}
+
+ protected:
+    json j = {1, 1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}};
+    const json j_const;
+};
+
+class JsonElementArrayAccessTest : public ::testing::Test,
+                                   public JsonElementArrayAccessTestBase {};
+
+TEST_F(JsonElementArrayAccessTest, AtWithinBounds)
+{
+    EXPECT_EQ(j.at(0), json(1));
+    EXPECT_EQ(j.at(1), json(1u));
+    EXPECT_EQ(j.at(2), json(true));
+    EXPECT_EQ(j.at(3), json(nullptr));
+    EXPECT_EQ(j.at(4), json("string"));
+    EXPECT_EQ(j.at(5), json(42.23));
+    EXPECT_EQ(j.at(6), json::object());
+    EXPECT_EQ(j.at(7), json({1, 2, 3}));
+
+    EXPECT_EQ(j_const.at(0), json(1));
+    EXPECT_EQ(j_const.at(1), json(1u));
+    EXPECT_EQ(j_const.at(2), json(true));
+    EXPECT_EQ(j_const.at(3), json(nullptr));
+    EXPECT_EQ(j_const.at(4), json("string"));
+    EXPECT_EQ(j_const.at(5), json(42.23));
+    EXPECT_EQ(j_const.at(6), json::object());
+    EXPECT_EQ(j_const.at(7), json({1, 2, 3}));
+}
+
+TEST_F(JsonElementArrayAccessTest, AtOutsideBounds)
+{
+    EXPECT_THROW_MSG(j.at(8), json::out_of_range,
+                     "[json.exception.out_of_range.401] array index 8 is out of range");
+    EXPECT_THROW_MSG(j_const.at(8), json::out_of_range,
+                     "[json.exception.out_of_range.401] array index 8 is out of range");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, Null)
+{
+    json j_nonarray(json::value_t::null);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with null");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with null");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, Boolean)
+{
+    json j_nonarray(json::value_t::boolean);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with boolean");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with boolean");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, String)
+{
+    json j_nonarray(json::value_t::string);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with string");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with string");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, Object)
+{
+    json j_nonarray(json::value_t::object);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with object");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with object");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, Integer)
+{
+    json j_nonarray(json::value_t::number_integer);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, Unsigned)
+{
+    json j_nonarray(json::value_t::number_unsigned);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+}
+
+TEST(JsonElementNonArrayAtAccessTest, Float)
+{
+    json j_nonarray(json::value_t::number_float);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+    EXPECT_THROW_MSG(j_nonarray_const.at(0), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+}
+
+TEST_F(JsonElementArrayAccessTest, FrontAndBack)
+{
+    EXPECT_EQ(j.front(), json(1));
+    EXPECT_EQ(j_const.front(), json(1));
+    EXPECT_EQ(j.back(), json({1, 2, 3}));
+    EXPECT_EQ(j_const.back(), json({1, 2, 3}));
+}
+
+TEST_F(JsonElementArrayAccessTest, OperatorWithinBounds)
+{
+    EXPECT_EQ(j[0], json(1));
+    EXPECT_EQ(j[1], json(1u));
+    EXPECT_EQ(j[2], json(true));
+    EXPECT_EQ(j[3], json(nullptr));
+    EXPECT_EQ(j[4], json("string"));
+    EXPECT_EQ(j[5], json(42.23));
+    EXPECT_EQ(j[6], json::object());
+    EXPECT_EQ(j[7], json({1, 2, 3}));
+
+    EXPECT_EQ(j_const[0], json(1));
+    EXPECT_EQ(j_const[1], json(1u));
+    EXPECT_EQ(j_const[2], json(true));
+    EXPECT_EQ(j_const[3], json(nullptr));
+    EXPECT_EQ(j_const[4], json("string"));
+    EXPECT_EQ(j_const[5], json(42.23));
+    EXPECT_EQ(j_const[6], json::object());
+    EXPECT_EQ(j_const[7], json({1, 2, 3}));
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, NullStandard)
+{
+    json j_nonarray(json::value_t::null);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_NO_THROW(j_nonarray[0]);
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with null");
+}
+
+// implicit transformation to properly filled array
+TEST(JsonElementNonArrayOperatorAccessTest, NullImplicitFilled)
+{
+    json j_nonarray;
+    j_nonarray[3] = 42;
+    EXPECT_EQ(j_nonarray, json({nullptr, nullptr, nullptr, 42}));
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, Boolean)
+{
+    json j_nonarray(json::value_t::boolean);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with boolean");
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with boolean");
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, String)
+{
+    json j_nonarray(json::value_t::string);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with string");
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with string");
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, Object)
+{
+    json j_nonarray(json::value_t::object);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with object");
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with object");
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, Integer)
+{
+    json j_nonarray(json::value_t::number_integer);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, Unsigned)
+{
+    json j_nonarray(json::value_t::number_unsigned);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+}
+
+TEST(JsonElementNonArrayOperatorAccessTest, Float)
+{
+    json j_nonarray(json::value_t::number_float);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_THROW_MSG(j_nonarray[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_nonarray_const[0], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+}
+
+class JsonElementArrayRemoveTest : public ::testing::Test,
+                                   public JsonElementArrayAccessTestBase {};
+
+
+// remove element by index
+TEST_F(JsonElementArrayRemoveTest, Index0)
+{
+    j.erase(0);
+    EXPECT_EQ(j, json({1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index1)
+{
+    j.erase(1);
+    EXPECT_EQ(j, json({1, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index2)
+{
+    j.erase(2);
+    EXPECT_EQ(j, json({1, 1u, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index3)
+{
+    j.erase(3);
+    EXPECT_EQ(j, json({1, 1u, true, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index4)
+{
+    j.erase(4);
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index5)
+{
+    j.erase(5);
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, "string", json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index6)
+{
+    j.erase(6);
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, "string", 42.23, {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index7)
+{
+    j.erase(7);
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, "string", 42.23, json::object()}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, Index8)
+{
+    EXPECT_THROW_MSG(j.erase(8), json::out_of_range,
+                     "[json.exception.out_of_range.401] array index 8 is out of range");
+}
+
+// erase(begin())
+TEST_F(JsonElementArrayRemoveTest, Begin)
+{
+    j.erase(j.begin());
+    EXPECT_EQ(j, json({1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, BeginConst)
+{
+    j.erase(j.cbegin());
+    EXPECT_EQ(j, json({1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+// erase(begin(), end())
+TEST_F(JsonElementArrayRemoveTest, BeginEnd)
+{
+    j.erase(j.begin(), j.end());
+    EXPECT_EQ(j, json::array());
+}
+TEST_F(JsonElementArrayRemoveTest, BeginEndConst)
+{
+    j.erase(j.cbegin(), j.cend());
+    EXPECT_EQ(j, json::array());
+}
+
+// erase(begin(), begin())
+TEST_F(JsonElementArrayRemoveTest, BeginBegin)
+{
+    j.erase(j.begin(), j.begin());
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, BeginBeginConst)
+{
+    j.erase(j.cbegin(), j.cbegin());
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, "string", 42.23, json::object(), {1, 2, 3}}));
+}
+
+// erase at offset
+TEST_F(JsonElementArrayRemoveTest, Offset)
+{
+    json::iterator it = j.begin() + 4;
+    j.erase(it);
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, 42.23, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, OffsetConst)
+{
+    json::const_iterator it = j.cbegin() + 4;
+    j.erase(it);
+    EXPECT_EQ(j, json({1, 1u, true, nullptr, 42.23, json::object(), {1, 2, 3}}));
+}
+
+// erase subrange
+TEST_F(JsonElementArrayRemoveTest, Subrange)
+{
+    j.erase(j.begin() + 3, j.begin() + 6);
+    EXPECT_EQ(j, json({1, 1u, true, json::object(), {1, 2, 3}}));
+}
+
+TEST_F(JsonElementArrayRemoveTest, SubrangeConst)
+{
+    j.erase(j.cbegin() + 3, j.cbegin() + 6);
+    EXPECT_EQ(j, json({1, 1u, true, json::object(), {1, 2, 3}}));
+}
+
+// different arrays
+TEST_F(JsonElementArrayRemoveTest, Different)
+{
+    json j2 = {"foo", "bar"};
+    EXPECT_THROW_MSG(j.erase(j2.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(j.erase(j.begin(), j2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(j.erase(j2.begin(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(j.erase(j2.begin(), j2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+}
+
+TEST_F(JsonElementArrayRemoveTest, DifferentConst)
+{
+    json j2 = {"foo", "bar"};
+    EXPECT_THROW_MSG(j.erase(j2.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j2.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(j.erase(j2.cbegin(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(j.erase(j2.cbegin(), j2.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+}
+
+// remove element by index in non-array type
+TEST(JsonElementNonArrayIndexRemoveTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with null");
+}
+
+TEST(JsonElementNonArrayIndexRemoveTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with boolean");
+}
+
+TEST(JsonElementNonArrayIndexRemoveTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with string");
+}
+
+TEST(JsonElementNonArrayIndexRemoveTest, Object)
+{
+    json j_nonobject(json::value_t::object);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with object");
+}
+
+TEST(JsonElementNonArrayIndexRemoveTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with number");
+}
+
+TEST(JsonElementNonArrayIndexRemoveTest, Unsigned)
+{
+    json j_nonobject(json::value_t::number_unsigned);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with number");
+}
+
+TEST(JsonElementNonArrayIndexRemoveTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    EXPECT_THROW_MSG(j_nonobject.erase(0), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with number");
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, Null)
+{
+    json j;
+    EXPECT_THROW_MSG(j.front(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(j.back(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, NullConst)
+{
+    const json j{};
+    EXPECT_THROW_MSG(j.front(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(j.back(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, String)
+{
+    json j = "foo";
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, StringConst)
+{
+    const json j = "bar";
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, Boolean)
+{
+    json j = false;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, BooleanConst)
+{
+    const json j = true;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, Integer)
+{
+    json j = 17;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, IntegerConst)
+{
+    const json j = 17;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, Unsigned)
+{
+    json j = 17u;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, UnsignedConst)
+{
+    const json j = 17u;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, Float)
+{
+    json j = 23.42;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayFrontBackAccessTest, FloatConst)
+{
+    const json j = 23.42;
+    EXPECT_EQ(j.front(), j);
+    EXPECT_EQ(j.back(), j);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, Null)
+{
+    json j;
+    EXPECT_THROW_MSG(j.erase(j.begin()), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with null");
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, NullConst)
+{
+    json j;
+    EXPECT_THROW_MSG(j.erase(j.cbegin()), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with null");
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, String)
+{
+    json j = "foo";
+    j.erase(j.begin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, StringConst)
+{
+    json j = "bar";
+    j.erase(j.cbegin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, Boolean)
+{
+    json j = false;
+    j.erase(j.begin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, BooleanConst)
+{
+    json j = true;
+    j.erase(j.cbegin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, Integer)
+{
+    json j = 17;
+    j.erase(j.begin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, IntegerConst)
+{
+    json j = 17;
+    j.erase(j.cbegin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, Unsigned)
+{
+    json j = 17u;
+    j.erase(j.begin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, UnsignedConst)
+{
+    json j = 17u;
+    j.erase(j.cbegin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, Float)
+{
+    json j = 23.42;
+    j.erase(j.begin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneValidIteratorRemoveTest, FloatConst)
+{
+    json j = 23.42;
+    j.erase(j.cbegin());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, String)
+{
+    json j = "foo";
+    EXPECT_THROW_MSG(j.erase(j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, StringConst)
+{
+    json j = "bar";
+    EXPECT_THROW_MSG(j.erase(j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, Boolean)
+{
+    json j = false;
+    EXPECT_THROW_MSG(j.erase(j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, BooleanConst)
+{
+    json j = true;
+    EXPECT_THROW_MSG(j.erase(j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, Integer)
+{
+    json j = 17;
+    EXPECT_THROW_MSG(j.erase(j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, IntegerConst)
+{
+    json j = 17;
+    EXPECT_THROW_MSG(j.erase(j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, Unsigned)
+{
+    json j = 17u;
+    EXPECT_THROW_MSG(j.erase(j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, UnsignedConst)
+{
+    json j = 17u;
+    EXPECT_THROW_MSG(j.erase(j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, Float)
+{
+    json j = 23.42;
+    EXPECT_THROW_MSG(j.erase(j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayOneInvalidIteratorRemoveTest, FloatConst)
+{
+    json j = 23.42;
+    EXPECT_THROW_MSG(j.erase(j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.205] iterator out of range");
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, Null)
+{
+    json j;
+    EXPECT_THROW_MSG(j.erase(j.begin(), j.end()), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with null");
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, NullConst)
+{
+    json j;
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j.cend()), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with null");
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, String)
+{
+    json j = "foo";
+    j.erase(j.begin(), j.end());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, StringConst)
+{
+    json j = "bar";
+    j.erase(j.cbegin(), j.cend());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, Boolean)
+{
+    json j = false;
+    j.erase(j.begin(), j.end());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, BooleanConst)
+{
+    json j = true;
+    j.erase(j.cbegin(), j.cend());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, Integer)
+{
+    json j = 17;
+    j.erase(j.begin(), j.end());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, IntegerConst)
+{
+    json j = 17;
+    j.erase(j.cbegin(), j.cend());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, Unsigned)
+{
+    json j = 17u;
+    j.erase(j.begin(), j.end());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, UnsignedConst)
+{
+    json j = 17u;
+    j.erase(j.cbegin(), j.cend());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, Float)
+{
+    json j = 23.42;
+    j.erase(j.begin(), j.end());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoValidIteratorRemoveTest, FloatConst)
+{
+    json j = 23.42;
+    j.erase(j.cbegin(), j.cend());
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, String)
+{
+    json j = "foo";
+    EXPECT_THROW_MSG(j.erase(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, StringConst)
+{
+    json j = "bar";
+    EXPECT_THROW_MSG(j.erase(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, Boolean)
+{
+    json j = false;
+    EXPECT_THROW_MSG(j.erase(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, BooleanConst)
+{
+    json j = true;
+    EXPECT_THROW_MSG(j.erase(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, Integer)
+{
+    json j = 17;
+    EXPECT_THROW_MSG(j.erase(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, IntegerConst)
+{
+    json j = 17;
+    EXPECT_THROW_MSG(j.erase(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, Unsigned)
+{
+    json j = 17u;
+    EXPECT_THROW_MSG(j.erase(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, UnsignedConst)
+{
+    json j = 17u;
+    EXPECT_THROW_MSG(j.erase(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, Float)
+{
+    json j = 23.42;
+    EXPECT_THROW_MSG(j.erase(j.end(), j.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.begin(), j.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
+
+TEST(JsonElementNonArrayTwoInvalidIteratorRemoveTest, FloatConst)
+{
+    json j = 23.42;
+    EXPECT_THROW_MSG(j.erase(j.cend(), j.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+    EXPECT_THROW_MSG(j.erase(j.cbegin(), j.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.204] iterators out of range");
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-element_access2.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-element_access2.cpp
new file mode 100644
index 0000000..4b64123
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-element_access2.cpp
@@ -0,0 +1,923 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+class JsonElementObjectAccessTestBase {
+ public:
+    JsonElementObjectAccessTestBase() : j_const(j) {}
+
+ protected:
+    json j = {{"integer", 1}, {"unsigned", 1u}, {"floating", 42.23}, {"null", nullptr}, {"string", "hello world"}, {"boolean", true}, {"object", json::object()}, {"array", {1, 2, 3}}};
+    const json j_const;
+};
+
+class JsonElementObjectAccessTest : public ::testing::Test,
+                                    public JsonElementObjectAccessTestBase {};
+
+TEST_F(JsonElementObjectAccessTest, AtWithinBounds)
+{
+    EXPECT_EQ(j.at("integer"), json(1));
+    EXPECT_EQ(j.at("unsigned"), json(1u));
+    EXPECT_EQ(j.at("boolean"), json(true));
+    EXPECT_EQ(j.at("null"), json(nullptr));
+    EXPECT_EQ(j.at("string"), json("hello world"));
+    EXPECT_EQ(j.at("floating"), json(42.23));
+    EXPECT_EQ(j.at("object"), json::object());
+    EXPECT_EQ(j.at("array"), json({1, 2, 3}));
+
+    EXPECT_EQ(j_const.at("integer"), json(1));
+    EXPECT_EQ(j_const.at("unsigned"), json(1u));
+    EXPECT_EQ(j_const.at("boolean"), json(true));
+    EXPECT_EQ(j_const.at("null"), json(nullptr));
+    EXPECT_EQ(j_const.at("string"), json("hello world"));
+    EXPECT_EQ(j_const.at("floating"), json(42.23));
+    EXPECT_EQ(j_const.at("object"), json::object());
+    EXPECT_EQ(j_const.at("array"), json({1, 2, 3}));
+}
+
+TEST_F(JsonElementObjectAccessTest, AtOutsideBounds)
+{
+    EXPECT_THROW_MSG(j.at("foo"), json::out_of_range,
+                     "[json.exception.out_of_range.403] key 'foo' not found");
+    EXPECT_THROW_MSG(j_const.at("foo"), json::out_of_range,
+                     "[json.exception.out_of_range.403] key 'foo' not found");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with null");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with null");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with boolean");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with boolean");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with string");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with string");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, Array)
+{
+    json j_nonobject(json::value_t::array);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with array");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with array");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, Unsigned)
+{
+    json j_nonobject(json::value_t::number_unsigned);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+}
+
+TEST(JsonElementNonObjectAtAccessTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.at("foo"), json::type_error,
+                     "[json.exception.type_error.304] cannot use at() with number");
+}
+
+TEST_F(JsonElementObjectAccessTest, KeyValueExist)
+{
+    EXPECT_EQ(j.value("integer", 2), 1);
+    EXPECT_LT(std::fabs(j.value("integer", 1.0) - 1), 0.001);
+    EXPECT_EQ(j.value("unsigned", 2), 1);
+    EXPECT_LT(std::fabs(j.value("unsigned", 1.0) - 1), 0.001);
+    EXPECT_EQ(j.value("null", json(1)), json());
+    EXPECT_EQ(j.value("boolean", false), true);
+    EXPECT_EQ(j.value("string", "bar"), "hello world");
+    EXPECT_EQ(j.value("string", std::string("bar")), "hello world");
+    EXPECT_LT(std::fabs(j.value("floating", 12.34) - 42.23), 0.001);
+    EXPECT_EQ(j.value("floating", 12), 42);
+    EXPECT_EQ(j.value("object", json({{"foo", "bar"}})), json::object());
+    EXPECT_EQ(j.value("array", json({10, 100})), json({1, 2, 3}));
+
+    EXPECT_EQ(j_const.value("integer", 2), 1);
+    EXPECT_LT(std::fabs(j_const.value("integer", 1.0) - 1), 0.001);
+    EXPECT_EQ(j_const.value("unsigned", 2), 1);
+    EXPECT_LT(std::fabs(j_const.value("unsigned", 1.0) - 1), 0.001);
+    EXPECT_EQ(j_const.value("boolean", false), true);
+    EXPECT_EQ(j_const.value("string", "bar"), "hello world");
+    EXPECT_EQ(j_const.value("string", std::string("bar")), "hello world");
+    EXPECT_LT(std::fabs(j_const.value("floating", 12.34) - 42.23), 0.001);
+    EXPECT_EQ(j_const.value("floating", 12), 42);
+    EXPECT_EQ(j_const.value("object", json({{"foo", "bar"}})), json::object());
+    EXPECT_EQ(j_const.value("array", json({10, 100})), json({1, 2, 3}));
+}
+
+TEST_F(JsonElementObjectAccessTest, KeyValueNotExist)
+{
+    EXPECT_EQ(j.value("_", 2), 2);
+    EXPECT_EQ(j.value("_", 2u), 2u);
+    EXPECT_EQ(j.value("_", false), false);
+    EXPECT_EQ(j.value("_", "bar"), "bar");
+    EXPECT_LT(std::fabs(j.value("_", 12.34) - 12.34), 0.001);
+    EXPECT_EQ(j.value("_", json({{"foo", "bar"}})), json({{"foo", "bar"}}));
+    EXPECT_EQ(j.value("_", json({10, 100})), json({10, 100}));
+
+    EXPECT_EQ(j_const.value("_", 2), 2);
+    EXPECT_EQ(j_const.value("_", 2u), 2u);
+    EXPECT_EQ(j_const.value("_", false), false);
+    EXPECT_EQ(j_const.value("_", "bar"), "bar");
+    EXPECT_LT(std::fabs(j_const.value("_", 12.34) - 12.34), 0.001);
+    EXPECT_EQ(j_const.value("_", json({{"foo", "bar"}})), json({{"foo", "bar"}}));
+    EXPECT_EQ(j_const.value("_", json({10, 100})), json({10, 100}));
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with null");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with null");
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with boolean");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with boolean");
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with string");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with string");
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, Array)
+{
+    json j_nonobject(json::value_t::array);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with array");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with array");
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, Unsigned)
+{
+    json j_nonobject(json::value_t::number_unsigned);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+}
+
+TEST(JsonElementNonObjectKeyValueAccessTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.value("foo", 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+}
+
+TEST_F(JsonElementObjectAccessTest, PointerValueExist)
+{
+    EXPECT_EQ(j.value("/integer"_json_pointer, 2), 1);
+    EXPECT_LT(std::fabs(j.value("/integer"_json_pointer, 1.0) - 1), 0.001);
+    EXPECT_EQ(j.value("/unsigned"_json_pointer, 2), 1);
+    EXPECT_LT(std::fabs(j.value("/unsigned"_json_pointer, 1.0) - 1), 0.001);
+    EXPECT_EQ(j.value("/null"_json_pointer, json(1)), json());
+    EXPECT_EQ(j.value("/boolean"_json_pointer, false), true);
+    EXPECT_EQ(j.value("/string"_json_pointer, "bar"), "hello world");
+    EXPECT_EQ(j.value("/string"_json_pointer, std::string("bar")), "hello world");
+    EXPECT_LT(std::fabs(j.value("/floating"_json_pointer, 12.34) - 42.23), 0.001);
+    EXPECT_EQ(j.value("/floating"_json_pointer, 12), 42);
+    EXPECT_EQ(j.value("/object"_json_pointer, json({{"foo", "bar"}})), json::object());
+    EXPECT_EQ(j.value("/array"_json_pointer, json({10, 100})), json({1, 2, 3}));
+
+    EXPECT_EQ(j_const.value("/integer"_json_pointer, 2), 1);
+    EXPECT_LT(std::fabs(j_const.value("/integer"_json_pointer, 1.0) - 1), 0.001);
+    EXPECT_EQ(j_const.value("/unsigned"_json_pointer, 2), 1);
+    EXPECT_LT(std::fabs(j_const.value("/unsigned"_json_pointer, 1.0) - 1), 0.001);
+    EXPECT_EQ(j_const.value("/boolean"_json_pointer, false), true);
+    EXPECT_EQ(j_const.value("/string"_json_pointer, "bar"), "hello world");
+    EXPECT_EQ(j_const.value("/string"_json_pointer, std::string("bar")), "hello world");
+    EXPECT_LT(std::fabs(j_const.value("/floating"_json_pointer, 12.34) - 42.23), 0.001);
+    EXPECT_EQ(j_const.value("/floating"_json_pointer, 12), 42);
+    EXPECT_EQ(j_const.value("/object"_json_pointer, json({{"foo", "bar"}})), json::object());
+    EXPECT_EQ(j_const.value("/array"_json_pointer, json({10, 100})), json({1, 2, 3}));
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with null");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with null");
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with boolean");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with boolean");
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with string");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with string");
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, Array)
+{
+    json j_nonobject(json::value_t::array);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with array");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with array");
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, Unsigned)
+{
+    json j_nonobject(json::value_t::number_unsigned);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+}
+
+TEST(JsonElementNonObjectPointerValueAccessTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+    EXPECT_THROW_MSG(j_nonobject_const.value("/foo"_json_pointer, 1), json::type_error,
+                     "[json.exception.type_error.306] cannot use value() with number");
+}
+#if 0
+TEST_F(JsonElementObjectAccessTest, FrontAndBack)
+{
+    // "array" is the smallest key
+    EXPECT_EQ(j.front(), json({1, 2, 3}));
+    EXPECT_EQ(j_const.front(), json({1, 2, 3}));
+    // "unsigned" is the largest key
+    EXPECT_EQ(j.back(), json(1u));
+    EXPECT_EQ(j_const.back(), json(1u));
+}
+#endif
+TEST_F(JsonElementObjectAccessTest, OperatorWithinBounds)
+{
+    EXPECT_EQ(j["integer"], json(1));
+    EXPECT_EQ(j[json::object_t::key_type("integer")], j["integer"]);
+
+    EXPECT_EQ(j["unsigned"], json(1u));
+    EXPECT_EQ(j[json::object_t::key_type("unsigned")], j["unsigned"]);
+
+    EXPECT_EQ(j["boolean"], json(true));
+    EXPECT_EQ(j[json::object_t::key_type("boolean")], j["boolean"]);
+
+    EXPECT_EQ(j["null"], json(nullptr));
+    EXPECT_EQ(j[json::object_t::key_type("null")], j["null"]);
+
+    EXPECT_EQ(j["string"], json("hello world"));
+    EXPECT_EQ(j[json::object_t::key_type("string")], j["string"]);
+
+    EXPECT_EQ(j["floating"], json(42.23));
+    EXPECT_EQ(j[json::object_t::key_type("floating")], j["floating"]);
+
+    EXPECT_EQ(j["object"], json::object());
+    EXPECT_EQ(j[json::object_t::key_type("object")], j["object"]);
+
+    EXPECT_EQ(j["array"], json({1, 2, 3}));
+    EXPECT_EQ(j[json::object_t::key_type("array")], j["array"]);
+
+    EXPECT_EQ(j_const["integer"], json(1));
+    EXPECT_EQ(j_const[json::object_t::key_type("integer")], j["integer"]);
+
+    EXPECT_EQ(j_const["boolean"], json(true));
+    EXPECT_EQ(j_const[json::object_t::key_type("boolean")], j["boolean"]);
+
+    EXPECT_EQ(j_const["null"], json(nullptr));
+    EXPECT_EQ(j_const[json::object_t::key_type("null")], j["null"]);
+
+    EXPECT_EQ(j_const["string"], json("hello world"));
+    EXPECT_EQ(j_const[json::object_t::key_type("string")], j["string"]);
+
+    EXPECT_EQ(j_const["floating"], json(42.23));
+    EXPECT_EQ(j_const[json::object_t::key_type("floating")], j["floating"]);
+
+    EXPECT_EQ(j_const["object"], json::object());
+    EXPECT_EQ(j_const[json::object_t::key_type("object")], j["object"]);
+
+    EXPECT_EQ(j_const["array"], json({1, 2, 3}));
+    EXPECT_EQ(j_const[json::object_t::key_type("array")], j["array"]);
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    json j_nonobject2(json::value_t::null);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_NO_THROW(j_nonobject["foo"]);
+    EXPECT_NO_THROW(j_nonobject2[json::object_t::key_type("foo")]);
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with null");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with null");
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with boolean");
+    EXPECT_THROW_MSG(j_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with boolean");
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with boolean");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with boolean");
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with string");
+    EXPECT_THROW_MSG(j_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with string");
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with string");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with string");
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, Array)
+{
+    json j_nonobject(json::value_t::array);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with array");
+    EXPECT_THROW_MSG(j_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with array");
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with array");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with array");
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, Unsigned)
+{
+    json j_nonobject(json::value_t::number_unsigned);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+}
+
+TEST(JsonElementNonObjectOperatorAccessTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    const json j_const_nonobject(j_nonobject);
+    EXPECT_THROW_MSG(j_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_const_nonobject["foo"], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+    EXPECT_THROW_MSG(j_const_nonobject[json::object_t::key_type("foo")], json::type_error,
+                     "[json.exception.type_error.305] cannot use operator[] with number");
+}
+
+class JsonElementObjectRemoveTest : public ::testing::Test,
+                                    public JsonElementObjectAccessTestBase {};
+
+TEST_F(JsonElementObjectRemoveTest, Key)
+{
+    EXPECT_NE(j.find("integer"), j.end());
+    EXPECT_EQ(j.erase("integer"), 1u);
+    EXPECT_EQ(j.find("integer"), j.end());
+    EXPECT_EQ(j.erase("integer"), 0u);
+
+    EXPECT_NE(j.find("unsigned"), j.end());
+    EXPECT_EQ(j.erase("unsigned"), 1u);
+    EXPECT_EQ(j.find("unsigned"), j.end());
+    EXPECT_EQ(j.erase("unsigned"), 0u);
+
+    EXPECT_NE(j.find("boolean"), j.end());
+    EXPECT_EQ(j.erase("boolean"), 1u);
+    EXPECT_EQ(j.find("boolean"), j.end());
+    EXPECT_EQ(j.erase("boolean"), 0u);
+
+    EXPECT_NE(j.find("null"), j.end());
+    EXPECT_EQ(j.erase("null"), 1u);
+    EXPECT_EQ(j.find("null"), j.end());
+    EXPECT_EQ(j.erase("null"), 0u);
+
+    EXPECT_NE(j.find("string"), j.end());
+    EXPECT_EQ(j.erase("string"), 1u);
+    EXPECT_EQ(j.find("string"), j.end());
+    EXPECT_EQ(j.erase("string"), 0u);
+
+    EXPECT_NE(j.find("floating"), j.end());
+    EXPECT_EQ(j.erase("floating"), 1u);
+    EXPECT_EQ(j.find("floating"), j.end());
+    EXPECT_EQ(j.erase("floating"), 0u);
+
+    EXPECT_NE(j.find("object"), j.end());
+    EXPECT_EQ(j.erase("object"), 1u);
+    EXPECT_EQ(j.find("object"), j.end());
+    EXPECT_EQ(j.erase("object"), 0u);
+
+    EXPECT_NE(j.find("array"), j.end());
+    EXPECT_EQ(j.erase("array"), 1u);
+    EXPECT_EQ(j.find("array"), j.end());
+    EXPECT_EQ(j.erase("array"), 0u);
+}
+
+// erase(begin())
+TEST_F(JsonElementObjectRemoveTest, Begin)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    jobject.erase(jobject.begin());
+    EXPECT_EQ(jobject, json({{"b", 1}, {"c", 17u}}));
+}
+
+TEST_F(JsonElementObjectRemoveTest, BeginConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    jobject.erase(jobject.cbegin());
+    EXPECT_EQ(jobject, json({{"b", 1}, {"c", 17u}}));
+}
+
+// erase(begin(), end())
+TEST_F(JsonElementObjectRemoveTest, BeginEnd)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json::iterator it2 = jobject.erase(jobject.begin(), jobject.end());
+    EXPECT_EQ(jobject, json::object());
+    EXPECT_EQ(it2, jobject.end());
+#else
+    EXPECT_THROW(jobject.erase(jobject.begin(), jobject.end()), json::type_error);
+#endif
+}
+
+TEST_F(JsonElementObjectRemoveTest, BeginEndConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json::const_iterator it2 = jobject.erase(jobject.cbegin(), jobject.cend());
+    EXPECT_EQ(jobject, json::object());
+    EXPECT_EQ(it2, jobject.cend());
+#else
+    EXPECT_THROW(jobject.erase(jobject.cbegin(), jobject.cend()), json::type_error);
+#endif
+}
+
+TEST_F(JsonElementObjectRemoveTest, BeginBegin)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json::iterator it2 = jobject.erase(jobject.begin(), jobject.begin());
+    EXPECT_EQ(jobject, json({{"a", "a"}, {"b", 1}, {"c", 17u}}));
+    EXPECT_EQ(*it2, json("a"));
+#else
+    EXPECT_THROW(jobject.erase(jobject.begin(), jobject.end()), json::type_error);
+#endif
+}
+
+TEST_F(JsonElementObjectRemoveTest, BeginBeginConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+#if 0
+    json::const_iterator it2 = jobject.erase(jobject.cbegin(), jobject.cbegin());
+    EXPECT_EQ(jobject, json({{"a", "a"}, {"b", 1}, {"c", 17u}}));
+    EXPECT_EQ(*it2, json("a"));
+#else
+    EXPECT_THROW(jobject.erase(jobject.cbegin(), jobject.cbegin()), json::type_error);
+#endif
+}
+
+TEST_F(JsonElementObjectRemoveTest, Offset)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    json::iterator it = jobject.find("b");
+    jobject.erase(it);
+    EXPECT_EQ(jobject, json({{"a", "a"}, {"c", 17u}}));
+}
+
+TEST_F(JsonElementObjectRemoveTest, OffsetConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    json::const_iterator it = jobject.find("b");
+    jobject.erase(it);
+    EXPECT_EQ(jobject, json({{"a", "a"}, {"c", 17u}}));
+}
+
+TEST_F(JsonElementObjectRemoveTest, Subrange)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+#if 0
+    json::iterator it2 = jobject.erase(jobject.find("b"), jobject.find("e"));
+    EXPECT_EQ(jobject, json({{"a", "a"}, {"e", true}}));
+    EXPECT_EQ(*it2, json(true));
+#else
+    EXPECT_THROW(jobject.erase(jobject.find("b"), jobject.find("e")), json::type_error);
+#endif
+}
+
+TEST_F(JsonElementObjectRemoveTest, SubrangeConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+#if 0
+    json::const_iterator it2 = jobject.erase(jobject.find("b"), jobject.find("e"));
+    EXPECT_EQ(jobject, json({{"a", "a"}, {"e", true}}));
+    EXPECT_EQ(*it2, json(true));
+#else
+    EXPECT_THROW(jobject.erase(jobject.find("b"), jobject.find("e")), json::type_error);
+#endif
+}
+
+TEST_F(JsonElementObjectRemoveTest, Different)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+    json jobject2 = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    EXPECT_THROW_MSG(jobject.erase(jobject2.begin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(jobject.erase(jobject.begin(), jobject2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(jobject.erase(jobject2.begin(), jobject.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(jobject.erase(jobject2.begin(), jobject2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+}
+
+TEST_F(JsonElementObjectRemoveTest, DifferentConst)
+{
+    json jobject = {{"a", "a"}, {"b", 1}, {"c", 17u}, {"d", false}, {"e", true}};
+    json jobject2 = {{"a", "a"}, {"b", 1}, {"c", 17u}};
+    EXPECT_THROW_MSG(jobject.erase(jobject2.cbegin()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(jobject.erase(jobject.cbegin(), jobject2.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(jobject.erase(jobject2.cbegin(), jobject.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+    EXPECT_THROW_MSG(jobject.erase(jobject2.cbegin(), jobject2.cend()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.203] iterators do not fit current value");
+}
+
+// remove element by key in non-object type
+TEST(JsonElementNonObjectKeyRemoveTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    EXPECT_THROW_MSG(j_nonobject.erase("foo"), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with null");
+}
+
+TEST(JsonElementNonObjectKeyRemoveTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    EXPECT_THROW_MSG(j_nonobject.erase("foo"), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with boolean");
+}
+
+TEST(JsonElementNonObjectKeyRemoveTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    EXPECT_THROW_MSG(j_nonobject.erase("foo"), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with string");
+}
+
+TEST(JsonElementNonObjectKeyRemoveTest, Array)
+{
+    json j_nonobject(json::value_t::array);
+    EXPECT_THROW_MSG(j_nonobject.erase("foo"), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with array");
+}
+
+TEST(JsonElementNonObjectKeyRemoveTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    EXPECT_THROW_MSG(j_nonobject.erase("foo"), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with number");
+}
+
+TEST(JsonElementNonObjectKeyRemoveTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    EXPECT_THROW_MSG(j_nonobject.erase("foo"), json::type_error,
+                     "[json.exception.type_error.307] cannot use erase() with number");
+}
+
+TEST_F(JsonElementObjectAccessTest, FindExist)
+{
+    for (auto key :
+            {"integer", "unsigned", "floating", "null", "string", "boolean", "object", "array"
+            })
+    {
+        EXPECT_NE(j.find(key), j.end());
+        EXPECT_EQ(*j.find(key), j.at(key));
+        EXPECT_NE(j_const.find(key), j_const.end());
+        EXPECT_EQ(*j_const.find(key), j_const.at(key));
+    }
+}
+
+TEST_F(JsonElementObjectAccessTest, FindNotExist)
+{
+    EXPECT_EQ(j.find("foo"), j.end());
+    EXPECT_EQ(j_const.find("foo"), j_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Null)
+{
+    json j_nonarray(json::value_t::null);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, String)
+{
+    json j_nonarray(json::value_t::string);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Object)
+{
+    json j_nonarray(json::value_t::object);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Array)
+{
+    json j_nonarray(json::value_t::array);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Boolean)
+{
+    json j_nonarray(json::value_t::boolean);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Integer)
+{
+    json j_nonarray(json::value_t::number_integer);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Unsigned)
+{
+    json j_nonarray(json::value_t::number_unsigned);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST(JsonElementNonObjectFindAccessTest, Float)
+{
+    json j_nonarray(json::value_t::number_float);
+    const json j_nonarray_const(j_nonarray);
+    EXPECT_EQ(j_nonarray.find("foo"), j_nonarray.end());
+    EXPECT_EQ(j_nonarray_const.find("foo"), j_nonarray_const.end());
+}
+
+TEST_F(JsonElementObjectAccessTest, CountExist)
+{
+    for (auto key :
+            {"integer", "unsigned", "floating", "null", "string", "boolean", "object", "array"
+            })
+    {
+        EXPECT_EQ(j.count(key), 1u);
+        EXPECT_EQ(j_const.count(key), 1u);
+    }
+}
+
+TEST_F(JsonElementObjectAccessTest, CountNotExist)
+{
+    EXPECT_EQ(j.count("foo"), 0u);
+    EXPECT_EQ(j_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Null)
+{
+    json j_nonobject(json::value_t::null);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, String)
+{
+    json j_nonobject(json::value_t::string);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Object)
+{
+    json j_nonobject(json::value_t::object);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Array)
+{
+    json j_nonobject(json::value_t::array);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Boolean)
+{
+    json j_nonobject(json::value_t::boolean);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Integer)
+{
+    json j_nonobject(json::value_t::number_integer);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Unsigned)
+{
+    json j_nonobject(json::value_t::number_unsigned);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST(JsonElementNonObjectCountAccessTest, Float)
+{
+    json j_nonobject(json::value_t::number_float);
+    const json j_nonobject_const(j_nonobject);
+    EXPECT_EQ(j_nonobject.count("foo"), 0u);
+    EXPECT_EQ(j_nonobject_const.count("foo"), 0u);
+}
+
+TEST_F(JsonElementObjectAccessTest, PointerValueNotExist)
+{
+    EXPECT_EQ(j.value("/not/existing"_json_pointer, 2), 2);
+    EXPECT_EQ(j.value("/not/existing"_json_pointer, 2u), 2u);
+    EXPECT_EQ(j.value("/not/existing"_json_pointer, false), false);
+    EXPECT_EQ(j.value("/not/existing"_json_pointer, "bar"), "bar");
+    EXPECT_LT(std::fabs(j.value("/not/existing"_json_pointer, 12.34) - 12.34), 0.001);
+    EXPECT_EQ(j.value("/not/existing"_json_pointer, json({{"foo", "bar"}})), json({{"foo", "bar"}}));
+    EXPECT_EQ(j.value("/not/existing"_json_pointer, json({10, 100})), json({10, 100}));
+
+    EXPECT_EQ(j_const.value("/not/existing"_json_pointer, 2), 2);
+    EXPECT_EQ(j_const.value("/not/existing"_json_pointer, 2u), 2u);
+    EXPECT_EQ(j_const.value("/not/existing"_json_pointer, false), false);
+    EXPECT_EQ(j_const.value("/not/existing"_json_pointer, "bar"), "bar");
+    EXPECT_LT(std::fabs(j_const.value("/not/existing"_json_pointer, 12.34) - 12.34), 0.001);
+    EXPECT_EQ(j_const.value("/not/existing"_json_pointer, json({{"foo", "bar"}})), json({{"foo", "bar"}}));
+    EXPECT_EQ(j_const.value("/not/existing"_json_pointer, json({10, 100})), json({10, 100}));
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-inspection.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-inspection.cpp
new file mode 100644
index 0000000..79c63f0
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-inspection.cpp
@@ -0,0 +1,385 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonConvTypeCheckTest, Object)
+{
+    json j {{"foo", 1}, {"bar", false}};
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_FALSE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_TRUE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_FALSE(j.is_primitive());
+    EXPECT_TRUE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Array)
+{
+    json j {"foo", 1, 1u, 42.23, false};
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_FALSE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_TRUE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_FALSE(j.is_primitive());
+    EXPECT_TRUE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Null)
+{
+    json j(nullptr);
+    EXPECT_TRUE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_FALSE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_TRUE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Boolean)
+{
+    json j(true);
+    EXPECT_FALSE(j.is_null());
+    EXPECT_TRUE(j.is_boolean());
+    EXPECT_FALSE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_TRUE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, String)
+{
+    json j("Hello world");
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_FALSE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_TRUE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_TRUE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Integer)
+{
+    json j(42);
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_TRUE(j.is_number());
+    EXPECT_TRUE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_TRUE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Unsigned)
+{
+    json j(42u);
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_TRUE(j.is_number());
+    EXPECT_TRUE(j.is_number_integer());
+    EXPECT_TRUE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_TRUE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Float)
+{
+    json j(42.23);
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_TRUE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_TRUE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_FALSE(j.is_discarded());
+    EXPECT_TRUE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+TEST(JsonConvTypeCheckTest, Discarded)
+{
+    json j(json::value_t::discarded);
+    EXPECT_FALSE(j.is_null());
+    EXPECT_FALSE(j.is_boolean());
+    EXPECT_FALSE(j.is_number());
+    EXPECT_FALSE(j.is_number_integer());
+    EXPECT_FALSE(j.is_number_unsigned());
+    EXPECT_FALSE(j.is_number_float());
+    EXPECT_FALSE(j.is_object());
+    EXPECT_FALSE(j.is_array());
+    EXPECT_FALSE(j.is_string());
+    EXPECT_TRUE(j.is_discarded());
+    EXPECT_FALSE(j.is_primitive());
+    EXPECT_FALSE(j.is_structured());
+}
+
+class JsonConvSerializationTest : public ::testing::Test {
+ protected:
+    json j {{"object", json::object()}, {"array", {1, 2, 3, 4}}, {"number", 42}, {"boolean", false}, {"null", nullptr}, {"string", "Hello world"} };
+};
+#if 0
+// no indent / indent=-1
+TEST_F(JsonConvSerializationTest, NoIndent)
+{
+    EXPECT_EQ(j.dump(),
+          "{\"array\":[1,2,3,4],\"boolean\":false,\"null\":null,\"number\":42,\"object\":{},\"string\":\"Hello world\"}");
+
+    EXPECT_EQ(j.dump(), j.dump(-1));
+}
+
+// indent=0
+TEST_F(JsonConvSerializationTest, Indent0)
+{
+    EXPECT_EQ(j.dump(0),
+          "{\n\"array\": [\n1,\n2,\n3,\n4\n],\n\"boolean\": false,\n\"null\": null,\n\"number\": 42,\n\"object\": {},\n\"string\": \"Hello world\"\n}");
+}
+
+// indent=1, space='\t'
+TEST_F(JsonConvSerializationTest, Indent1)
+{
+    EXPECT_EQ(j.dump(1, '\t'),
+          "{\n\t\"array\": [\n\t\t1,\n\t\t2,\n\t\t3,\n\t\t4\n\t],\n\t\"boolean\": false,\n\t\"null\": null,\n\t\"number\": 42,\n\t\"object\": {},\n\t\"string\": \"Hello world\"\n}");
+}
+
+// indent=4
+TEST_F(JsonConvSerializationTest, Indent4)
+{
+    EXPECT_EQ(j.dump(4),
+          "{\n    \"array\": [\n        1,\n        2,\n        3,\n        4\n    ],\n    \"boolean\": false,\n    \"null\": null,\n    \"number\": 42,\n    \"object\": {},\n    \"string\": \"Hello world\"\n}");
+}
+#endif
+// indent=x
+TEST_F(JsonConvSerializationTest, IndentX)
+{
+    EXPECT_EQ(j.dump().size(), 94u);
+    EXPECT_EQ(j.dump(1).size(), 127u);
+    EXPECT_EQ(j.dump(2).size(), 142u);
+    EXPECT_EQ(j.dump(512).size(), 7792u);
+}
+
+// dump and floating-point numbers
+TEST_F(JsonConvSerializationTest, Float)
+{
+    auto s = json(42.23).dump();
+    EXPECT_NE(s.find("42.23"), std::string::npos);
+}
+
+// dump and small floating-point numbers
+TEST_F(JsonConvSerializationTest, SmallFloat)
+{
+    auto s = json(1.23456e-78).dump();
+    EXPECT_NE(s.find("1.23456e-78"), std::string::npos);
+}
+
+// dump and non-ASCII characters
+TEST_F(JsonConvSerializationTest, NonAscii)
+{
+    EXPECT_EQ(json("ä").dump(), "\"ä\"");
+    EXPECT_EQ(json("Ö").dump(), "\"Ö\"");
+    EXPECT_EQ(json("❤️").dump(), "\"❤️\"");
+}
+
+// serialization of discarded element
+TEST_F(JsonConvSerializationTest, Discarded)
+{
+    json j_discarded(json::value_t::discarded);
+    EXPECT_EQ(j_discarded.dump(), "<discarded>");
+}
+
+TEST(JsonConvRoundTripTest, Case)
+{
+    for (const auto& s :
+{"3.141592653589793", "1000000000000000010E5"
+})
+    {
+        SCOPED_TRACE(s);
+        json j1 = json::parse(s);
+        std::string s1 = j1.dump();
+        json j2 = json::parse(s1);
+        std::string s2 = j2.dump();
+        EXPECT_EQ(s1, s2);
+    }
+}
+
+// return the type of the object (explicit)
+TEST(JsonConvTypeExplicitTest, Null)
+{
+    json j = nullptr;
+    EXPECT_EQ(j.type(), json::value_t::null);
+}
+
+TEST(JsonConvTypeExplicitTest, Object)
+{
+    json j = {{"foo", "bar"}};
+    EXPECT_EQ(j.type(), json::value_t::object);
+}
+
+TEST(JsonConvTypeExplicitTest, Array)
+{
+    json j = {1, 2, 3, 4};
+    EXPECT_EQ(j.type(), json::value_t::array);
+}
+
+TEST(JsonConvTypeExplicitTest, Boolean)
+{
+    json j = true;
+    EXPECT_EQ(j.type(), json::value_t::boolean);
+}
+
+TEST(JsonConvTypeExplicitTest, String)
+{
+    json j = "Hello world";
+    EXPECT_EQ(j.type(), json::value_t::string);
+}
+
+TEST(JsonConvTypeExplicitTest, Integer)
+{
+    json j = 23;
+    EXPECT_EQ(j.type(), json::value_t::number_integer);
+}
+
+TEST(JsonConvTypeExplicitTest, Unsigned)
+{
+    json j = 23u;
+    EXPECT_EQ(j.type(), json::value_t::number_unsigned);
+}
+
+TEST(JsonConvTypeExplicitTest, Float)
+{
+    json j = 42.23;
+    EXPECT_EQ(j.type(), json::value_t::number_float);
+}
+
+// return the type of the object (implicit)
+TEST(JsonConvTypeImplicitTest, Null)
+{
+    json j = nullptr;
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, Object)
+{
+    json j = {{"foo", "bar"}};
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, Array)
+{
+    json j = {1, 2, 3, 4};
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, Boolean)
+{
+    json j = true;
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, String)
+{
+    json j = "Hello world";
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, Integer)
+{
+    json j = 23;
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, Unsigned)
+{
+    json j = 23u;
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
+
+TEST(JsonConvTypeImplicitTest, Float)
+{
+    json j = 42.23;
+    json::value_t t = j;
+    EXPECT_EQ(t, j.type());
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterator_wrapper.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterator_wrapper.cpp
new file mode 100644
index 0000000..8d1f18e
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterator_wrapper.cpp
@@ -0,0 +1,745 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+class JsonIteratorWrapperObjectTest : public ::testing::Test {
+ protected:
+    json j = {{"A", 1}, {"B", 2}};
+};
+
+TEST_F(JsonIteratorWrapperObjectTest, Value)
+{
+    int counter = 1;
+
+    for (auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperObjectTest, Reference)
+{
+    int counter = 1;
+
+    for (auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+
+                // change the value
+                i.value() = json(11);
+                EXPECT_EQ(i.value(), json(11));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+
+                // change the value
+                i.value() = json(22);
+                EXPECT_EQ(i.value(), json(22));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+
+    // check if values where changed
+    EXPECT_EQ(j, json({{"A", 11}, {"B", 22}}));
+}
+
+TEST_F(JsonIteratorWrapperObjectTest, ConstValue)
+{
+    int counter = 1;
+
+    for (const auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperObjectTest, ConstReference)
+{
+    json j = {{"A", 1}, {"B", 2}};
+    int counter = 1;
+
+    for (const auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+class JsonIteratorWrapperConstObjectTest : public ::testing::Test {
+ protected:
+    const json j = {{"A", 1}, {"B", 2}};
+};
+
+TEST_F(JsonIteratorWrapperConstObjectTest, Value)
+{
+    int counter = 1;
+
+    for (auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperConstObjectTest, Reference)
+{
+    int counter = 1;
+
+    for (auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperConstObjectTest, ConstValue)
+{
+    int counter = 1;
+
+    for (const auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperConstObjectTest, ConstReference)
+{
+    int counter = 1;
+
+    for (const auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "A");
+                EXPECT_EQ(i.value(), json(1));
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "B");
+                EXPECT_EQ(i.value(), json(2));
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+class JsonIteratorWrapperArrayTest : public ::testing::Test {
+ protected:
+    json j = {"A", "B"};
+};
+
+TEST_F(JsonIteratorWrapperArrayTest, Value)
+{
+    int counter = 1;
+
+    for (auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperArrayTest, Reference)
+{
+    int counter = 1;
+
+    for (auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+
+                // change the value
+                i.value() = "AA";
+                EXPECT_EQ(i.value(), "AA");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+
+                // change the value
+                i.value() = "BB";
+                EXPECT_EQ(i.value(), "BB");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+
+    // check if values where changed
+    EXPECT_EQ(j, json({"AA", "BB"}));
+}
+
+TEST_F(JsonIteratorWrapperArrayTest, ConstValue)
+{
+    int counter = 1;
+
+    for (const auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperArrayTest, ConstReference)
+{
+    int counter = 1;
+
+    for (const auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+class JsonIteratorWrapperConstArrayTest : public ::testing::Test {
+ protected:
+    const json j = {"A", "B"};
+};
+
+TEST_F(JsonIteratorWrapperConstArrayTest, Value)
+{
+    int counter = 1;
+
+    for (auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperConstArrayTest, Reference)
+{
+    int counter = 1;
+
+    for (auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperConstArrayTest, ConstValue)
+{
+    int counter = 1;
+
+    for (const auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+TEST_F(JsonIteratorWrapperConstArrayTest, ConstReference)
+{
+    int counter = 1;
+
+    for (const auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        switch (counter++)
+        {
+            case 1:
+            {
+                EXPECT_EQ(i.key(), "0");
+                EXPECT_EQ(i.value(), "A");
+                break;
+            }
+
+            case 2:
+            {
+                EXPECT_EQ(i.key(), "1");
+                EXPECT_EQ(i.value(), "B");
+                break;
+            }
+
+            default:
+            {
+                break;
+            }
+        }
+    }
+
+    EXPECT_EQ(counter, 3);
+}
+
+class JsonIteratorWrapperPrimitiveTest : public ::testing::Test {
+ protected:
+    json j = 1;
+};
+
+TEST_F(JsonIteratorWrapperPrimitiveTest, Value)
+{
+    int counter = 1;
+
+    for (auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
+
+TEST_F(JsonIteratorWrapperPrimitiveTest, Reference)
+{
+    int counter = 1;
+
+    for (auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+
+        // change value
+        i.value() = json(2);
+    }
+
+    EXPECT_EQ(counter, 2);
+
+    // check if value has changed
+    EXPECT_EQ(j, json(2));
+}
+
+TEST_F(JsonIteratorWrapperPrimitiveTest, ConstValue)
+{
+    int counter = 1;
+
+    for (const auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
+
+TEST_F(JsonIteratorWrapperPrimitiveTest, ConstReference)
+{
+    int counter = 1;
+
+    for (const auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
+
+class JsonIteratorWrapperConstPrimitiveTest : public ::testing::Test {
+ protected:
+    const json j = 1;
+};
+
+TEST_F(JsonIteratorWrapperConstPrimitiveTest, Value)
+{
+    int counter = 1;
+
+    for (auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
+
+TEST_F(JsonIteratorWrapperConstPrimitiveTest, Reference)
+{
+    int counter = 1;
+
+    for (auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
+
+TEST_F(JsonIteratorWrapperConstPrimitiveTest, ConstValue)
+{
+    int counter = 1;
+
+    for (const auto i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
+
+TEST_F(JsonIteratorWrapperConstPrimitiveTest, ConstReference)
+{
+    int counter = 1;
+
+    for (const auto& i : json::iterator_wrapper(j))
+    {
+        SCOPED_TRACE(counter);
+        ++counter;
+        EXPECT_EQ(i.key(), "");
+        EXPECT_EQ(i.value(), json(1));
+    }
+
+    EXPECT_EQ(counter, 2);
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterators1.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterators1.cpp
new file mode 100644
index 0000000..2dd8219
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterators1.cpp
@@ -0,0 +1,1616 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+using wpi::JsonTest;
+
+TEST(JsonIteratorBasicTest, Uninitialized)
+{
+    json::iterator it;
+    EXPECT_EQ(JsonTest::GetObject(it), nullptr);
+
+    json::const_iterator cit;
+    EXPECT_EQ(JsonTest::GetObject(cit), nullptr);
+}
+
+class JsonIteratorBooleanTest : public ::testing::Test {
+ public:
+    JsonIteratorBooleanTest() : j_const(j) {}
+
+ protected:
+    json j = true;
+    json j_const;
+};
+
+TEST_F(JsonIteratorBooleanTest, BeginEnd)
+{
+    json::iterator it = j.begin();
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    it--;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    --it;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorBooleanTest, ConstBeginEnd)
+{
+    json::const_iterator it = j_const.begin();
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    it--;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    --it;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+}
+
+TEST_F(JsonIteratorBooleanTest, CBeginEnd)
+{
+    json::const_iterator it = j.cbegin();
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    it--;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    --it;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorBooleanTest, ConstCBeginEnd)
+{
+    json::const_iterator it = j_const.cbegin();
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    it--;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    --it;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+}
+#if 0
+TEST_F(JsonIteratorBooleanTest, RBeginEnd)
+{
+    json::reverse_iterator it = j.rbegin();
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    it--;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    --it;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorBooleanTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it = j.crbegin();
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    it--;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    --it;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorBooleanTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it = j_const.crbegin();
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    it--;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    --it;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+}
+#endif
+TEST_F(JsonIteratorBooleanTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(it.value(), json(true));
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(cit.value(), json(true));
+#if 0
+    auto rit = j.rend();
+    auto crit = j.crend();
+    EXPECT_THROW_MSG(rit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(rit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(crit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(crit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#endif
+}
+
+class JsonIteratorStringTest : public ::testing::Test {
+ public:
+    JsonIteratorStringTest() : j_const(j) {}
+
+ protected:
+    json j = "hello world";
+    json j_const;
+};
+
+TEST_F(JsonIteratorStringTest, BeginEnd)
+{
+    json::iterator it = j.begin();
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    it--;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    --it;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorStringTest, ConstBeginEnd)
+{
+    json::const_iterator it = j_const.begin();
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    it--;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    --it;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+}
+
+TEST_F(JsonIteratorStringTest, CBeginEnd)
+{
+    json::const_iterator it = j.cbegin();
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    it--;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    --it;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorStringTest, ConstCBeginEnd)
+{
+    json::const_iterator it = j_const.cbegin();
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    it--;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    --it;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+}
+#if 0
+TEST_F(JsonIteratorStringTest, RBeginEnd)
+{
+    json::reverse_iterator it = j.rbegin();
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    it--;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    --it;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorStringTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it = j.crbegin();
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    it--;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    --it;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorStringTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it = j_const.crbegin();
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    it--;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    --it;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+}
+#endif
+TEST_F(JsonIteratorStringTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(it.value(), json("hello world"));
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(cit.value(), json("hello world"));
+#if 0
+    auto rit = j.rend();
+    auto crit = j.crend();
+    EXPECT_THROW_MSG(rit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(rit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(crit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(crit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#endif
+}
+
+class JsonIteratorArrayTest : public ::testing::Test {
+ public:
+    JsonIteratorArrayTest() : j_const(j) {}
+
+ protected:
+    json j = {1, 2, 3};
+    json j_const;
+};
+
+TEST_F(JsonIteratorArrayTest, BeginEnd)
+{
+    json::iterator it_begin = j.begin();
+    json::iterator it_end = j.end();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[0]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[2]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorArrayTest, ConstBeginEnd)
+{
+    json::const_iterator it_begin = j_const.begin();
+    json::const_iterator it_end = j_const.end();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const[0]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const[2]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorArrayTest, CBeginEnd)
+{
+    json::const_iterator it_begin = j.cbegin();
+    json::const_iterator it_end = j.cend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[0]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[2]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorArrayTest, ConstCBeginEnd)
+{
+    json::const_iterator it_begin = j_const.cbegin();
+    json::const_iterator it_end = j_const.cend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[0]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[2]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+#if 0
+TEST_F(JsonIteratorArrayTest, RBeginEnd)
+{
+    json::reverse_iterator it_begin = j.rbegin();
+    json::reverse_iterator it_end = j.rend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[2]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[0]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorArrayTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it_begin = j.crbegin();
+    json::const_reverse_iterator it_end = j.crend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[2]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[0]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorArrayTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it_begin = j_const.crbegin();
+    json::const_reverse_iterator it_end = j_const.crend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[2]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[1]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j[0]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+#endif
+TEST_F(JsonIteratorArrayTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(it.value(), json(1));
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(cit.value(), json(1));
+}
+
+class JsonIteratorObjectTest : public ::testing::Test {
+ public:
+    JsonIteratorObjectTest() : j_const(j) {}
+
+ protected:
+    json j = {{"A", 1}, {"B", 2}, {"C", 3}};
+    json j_const;
+};
+
+TEST_F(JsonIteratorObjectTest, BeginEnd)
+{
+    json::iterator it_begin = j.begin();
+    json::iterator it_end = j.end();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["A"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["C"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorObjectTest, ConstBeginEnd)
+{
+    json::const_iterator it_begin = j_const.begin();
+    json::const_iterator it_end = j_const.end();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const["A"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const["C"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorObjectTest, CBeginEnd)
+{
+    json::const_iterator it_begin = j.cbegin();
+    json::const_iterator it_end = j.cend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["A"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["C"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorObjectTest, ConstCBeginEnd)
+{
+    json::const_iterator it_begin = j_const.cbegin();
+    json::const_iterator it_end = j_const.cend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const["A"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j_const["C"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+#if 0
+TEST_F(JsonIteratorObjectTest, RBeginEnd)
+{
+    json::reverse_iterator it_begin = j.rbegin();
+    json::reverse_iterator it_end = j.rend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["C"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["A"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorObjectTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it_begin = j.crbegin();
+    json::const_reverse_iterator it_end = j.crend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["C"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["A"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+
+TEST_F(JsonIteratorObjectTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it_begin = j_const.crbegin();
+    json::const_reverse_iterator it_end = j_const.crend();
+
+    auto it = it_begin;
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["C"]);
+
+    it++;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["B"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_NE(it, it_end);
+    EXPECT_EQ(*it, j["A"]);
+
+    ++it;
+    EXPECT_NE(it, it_begin);
+    EXPECT_EQ(it, it_end);
+}
+#endif
+TEST_F(JsonIteratorObjectTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_EQ(it.key(), "A");
+    EXPECT_EQ(it.value(), json(1));
+    EXPECT_EQ(cit.key(), "A");
+    EXPECT_EQ(cit.value(), json(1));
+}
+
+class JsonIteratorIntegerTest : public ::testing::Test {
+ public:
+    JsonIteratorIntegerTest() : j_const(j) {}
+
+ protected:
+    json j = 23;
+    json j_const;
+};
+
+TEST_F(JsonIteratorIntegerTest, BeginEnd)
+{
+    json::iterator it = j.begin();
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    it--;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    --it;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorIntegerTest, ConstBeginEnd)
+{
+    json::const_iterator it = j_const.begin();
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    it--;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    --it;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+}
+
+TEST_F(JsonIteratorIntegerTest, CBeginEnd)
+{
+    json::const_iterator it = j.cbegin();
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    it--;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    --it;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorIntegerTest, ConstCBeginEnd)
+{
+    json::const_iterator it = j_const.cbegin();
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    it--;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    --it;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+}
+#if 0
+TEST_F(JsonIteratorIntegerTest, RBeginEnd)
+{
+    json::reverse_iterator it = j.rbegin();
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    it--;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    --it;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorIntegerTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it = j.crbegin();
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    it--;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    --it;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorIntegerTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it = j_const.crbegin();
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    it--;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    --it;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+}
+#endif
+TEST_F(JsonIteratorIntegerTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(it.value(), json(23));
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(cit.value(), json(23));
+#if 0
+    auto rit = j.rend();
+    auto crit = j.crend();
+    EXPECT_THROW_MSG(rit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(rit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(crit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(crit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#endif
+}
+
+class JsonIteratorUnsignedTest : public ::testing::Test {
+ public:
+    JsonIteratorUnsignedTest() : j_const(j) {}
+
+ protected:
+    json j = 23u;
+    json j_const;
+};
+
+TEST_F(JsonIteratorUnsignedTest, BeginEnd)
+{
+    json::iterator it = j.begin();
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    it--;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    --it;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorUnsignedTest, ConstBeginEnd)
+{
+    json::const_iterator it = j_const.begin();
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    it--;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    --it;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+}
+
+TEST_F(JsonIteratorUnsignedTest, CBeginEnd)
+{
+    json::const_iterator it = j.cbegin();
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    it--;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    --it;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorUnsignedTest, ConstCBeginEnd)
+{
+    json::const_iterator it = j_const.cbegin();
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    it--;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    --it;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+}
+#if 0
+TEST_F(JsonIteratorUnsignedTest, RBeginEnd)
+{
+    json::reverse_iterator it = j.rbegin();
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    it--;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    --it;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorUnsignedTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it = j.crbegin();
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    it--;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    --it;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorUnsignedTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it = j_const.crbegin();
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    it--;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    --it;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+}
+#endif
+TEST_F(JsonIteratorUnsignedTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(it.value(), json(23));
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(cit.value(), json(23));
+#if 0
+    auto rit = j.rend();
+    auto crit = j.crend();
+    EXPECT_THROW_MSG(rit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(rit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(crit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(crit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#endif
+}
+
+class JsonIteratorFloatTest : public ::testing::Test {
+ public:
+    JsonIteratorFloatTest() : j_const(j) {}
+
+ protected:
+    json j = 23.42;
+    json j_const;
+};
+
+TEST_F(JsonIteratorFloatTest, BeginEnd)
+{
+    json::iterator it = j.begin();
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    it--;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.begin());
+    EXPECT_EQ(it, j.end());
+
+    --it;
+    EXPECT_EQ(it, j.begin());
+    EXPECT_NE(it, j.end());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorFloatTest, ConstBeginEnd)
+{
+    json::const_iterator it = j_const.begin();
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    it--;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.begin());
+    EXPECT_EQ(it, j_const.end());
+
+    --it;
+    EXPECT_EQ(it, j_const.begin());
+    EXPECT_NE(it, j_const.end());
+    EXPECT_EQ(*it, j_const);
+}
+
+TEST_F(JsonIteratorFloatTest, CBeginEnd)
+{
+    json::const_iterator it = j.cbegin();
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    it--;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.cbegin());
+    EXPECT_EQ(it, j.cend());
+
+    --it;
+    EXPECT_EQ(it, j.cbegin());
+    EXPECT_NE(it, j.cend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorFloatTest, ConstCBeginEnd)
+{
+    json::const_iterator it = j_const.cbegin();
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    it--;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.cbegin());
+    EXPECT_EQ(it, j_const.cend());
+
+    --it;
+    EXPECT_EQ(it, j_const.cbegin());
+    EXPECT_NE(it, j_const.cend());
+    EXPECT_EQ(*it, j_const);
+}
+#if 0
+TEST_F(JsonIteratorFloatTest, RBeginEnd)
+{
+    json::reverse_iterator it = j.rbegin();
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    it--;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.rbegin());
+    EXPECT_EQ(it, j.rend());
+
+    --it;
+    EXPECT_EQ(it, j.rbegin());
+    EXPECT_NE(it, j.rend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorFloatTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it = j.crbegin();
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    it++;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    it--;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+
+    ++it;
+    EXPECT_NE(it, j.crbegin());
+    EXPECT_EQ(it, j.crend());
+
+    --it;
+    EXPECT_EQ(it, j.crbegin());
+    EXPECT_NE(it, j.crend());
+    EXPECT_EQ(*it, j);
+}
+
+TEST_F(JsonIteratorFloatTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it = j_const.crbegin();
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    it++;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    it--;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+
+    ++it;
+    EXPECT_NE(it, j_const.crbegin());
+    EXPECT_EQ(it, j_const.crend());
+
+    --it;
+    EXPECT_EQ(it, j_const.crbegin());
+    EXPECT_NE(it, j_const.crend());
+    EXPECT_EQ(*it, j_const);
+}
+#endif
+TEST_F(JsonIteratorFloatTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(it.value(), json(23.42));
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_EQ(cit.value(), json(23.42));
+#if 0
+    auto rit = j.rend();
+    auto crit = j.crend();
+    EXPECT_THROW_MSG(rit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(rit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(crit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(crit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#endif
+}
+
+class JsonIteratorNullTest : public ::testing::Test {
+ public:
+    JsonIteratorNullTest() : j_const(j) {}
+
+ protected:
+    json j = nullptr;
+    json j_const;
+};
+
+TEST_F(JsonIteratorNullTest, BeginEnd)
+{
+    json::iterator it = j.begin();
+    EXPECT_EQ(it, j.end());
+}
+
+TEST_F(JsonIteratorNullTest, ConstBeginEnd)
+{
+    json::const_iterator it_begin = j_const.begin();
+    json::const_iterator it_end = j_const.end();
+    EXPECT_EQ(it_begin, it_end);
+}
+
+TEST_F(JsonIteratorNullTest, CBeginEnd)
+{
+    json::const_iterator it_begin = j.cbegin();
+    json::const_iterator it_end = j.cend();
+    EXPECT_EQ(it_begin, it_end);
+}
+
+TEST_F(JsonIteratorNullTest, ConstCBeginEnd)
+{
+    json::const_iterator it_begin = j_const.cbegin();
+    json::const_iterator it_end = j_const.cend();
+    EXPECT_EQ(it_begin, it_end);
+}
+#if 0
+TEST_F(JsonIteratorNullTest, RBeginEnd)
+{
+    json::reverse_iterator it = j.rbegin();
+    EXPECT_EQ(it, j.rend());
+}
+
+TEST_F(JsonIteratorNullTest, CRBeginEnd)
+{
+    json::const_reverse_iterator it = j.crbegin();
+    EXPECT_EQ(it, j.crend());
+}
+
+TEST_F(JsonIteratorNullTest, ConstCRBeginEnd)
+{
+    json::const_reverse_iterator it = j_const.crbegin();
+    EXPECT_EQ(it, j_const.crend());
+}
+#endif
+TEST_F(JsonIteratorNullTest, KeyValue)
+{
+    auto it = j.begin();
+    auto cit = j_const.cbegin();
+    EXPECT_THROW_MSG(it.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(it.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(cit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(cit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#if 0
+    auto rit = j.rend();
+    auto crit = j.crend();
+    EXPECT_THROW_MSG(rit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(rit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(crit.key(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.207] cannot use key() for non-object iterators");
+    EXPECT_THROW_MSG(crit.value(), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+#endif
+}
+
+TEST(JsonIteratorConstConversionTest, Boolean)
+{
+    json j = true;
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, String)
+{
+    json j = "hello world";
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, Array)
+{
+    json j = {1, 2, 3};
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, Object)
+{
+    json j = {{"A", 1}, {"B", 2}, {"C", 3}};
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, Integer)
+{
+    json j = 23;
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, Unsigned)
+{
+    json j = 23u;
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, Float)
+{
+    json j = 23.42;
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
+
+TEST(JsonIteratorConstConversionTest, Null)
+{
+    json j = nullptr;
+    json::const_iterator it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+    it = j.begin();
+    EXPECT_EQ(it, j.cbegin());
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterators2.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterators2.cpp
new file mode 100644
index 0000000..69a4dac
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-iterators2.cpp
@@ -0,0 +1,899 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonIteratorTest, Comparisons)
+{
+    json j_values = {nullptr, true, 42, 42u, 23.23, {{"one", 1}, {"two", 2}}, {1, 2, 3, 4, 5}, "Hello, world"};
+
+    for (json& j : j_values)
+    {
+        SCOPED_TRACE(j.dump());
+        auto it1 = j.begin();
+        auto it2 = j.begin();
+        auto it3 = j.begin();
+        ++it2;
+        ++it3;
+        ++it3;
+        auto it1_c = j.cbegin();
+        auto it2_c = j.cbegin();
+        auto it3_c = j.cbegin();
+        ++it2_c;
+        ++it3_c;
+        ++it3_c;
+
+        // comparison: equal
+        {
+            EXPECT_TRUE(it1 == it1);
+            EXPECT_FALSE(it1 == it2);
+            EXPECT_FALSE(it1 == it3);
+            EXPECT_FALSE(it2 == it3);
+            EXPECT_TRUE(it1_c == it1_c);
+            EXPECT_FALSE(it1_c == it2_c);
+            EXPECT_FALSE(it1_c == it3_c);
+            EXPECT_FALSE(it2_c == it3_c);
+        }
+
+        // comparison: not equal
+        {
+            // check definition
+            EXPECT_EQ( (it1 != it1), !(it1 == it1) );
+            EXPECT_EQ( (it1 != it2), !(it1 == it2) );
+            EXPECT_EQ( (it1 != it3), !(it1 == it3) );
+            EXPECT_EQ( (it2 != it3), !(it2 == it3) );
+            EXPECT_EQ( (it1_c != it1_c), !(it1_c == it1_c) );
+            EXPECT_EQ( (it1_c != it2_c), !(it1_c == it2_c) );
+            EXPECT_EQ( (it1_c != it3_c), !(it1_c == it3_c) );
+            EXPECT_EQ( (it2_c != it3_c), !(it2_c == it3_c) );
+        }
+
+        // comparison: smaller
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 < it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 < it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 < it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 < it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c < it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c < it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c < it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c < it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                EXPECT_FALSE(it1 < it1);
+                EXPECT_TRUE(it1 < it2);
+                EXPECT_TRUE(it1 < it3);
+                EXPECT_TRUE(it2 < it3);
+                EXPECT_FALSE(it1_c < it1_c);
+                EXPECT_TRUE(it1_c < it2_c);
+                EXPECT_TRUE(it1_c < it3_c);
+                EXPECT_TRUE(it2_c < it3_c);
+            }
+        }
+
+        // comparison: less than or equal
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 <= it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 <= it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 <= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 <= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c <= it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c <= it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c <= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c <= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                // check definition
+                EXPECT_EQ( (it1 <= it1), !(it1 < it1) );
+                EXPECT_EQ( (it1 <= it2), !(it2 < it1) );
+                EXPECT_EQ( (it1 <= it3), !(it3 < it1) );
+                EXPECT_EQ( (it2 <= it3), !(it3 < it2) );
+                EXPECT_EQ( (it1_c <= it1_c), !(it1_c < it1_c) );
+                EXPECT_EQ( (it1_c <= it2_c), !(it2_c < it1_c) );
+                EXPECT_EQ( (it1_c <= it3_c), !(it3_c < it1_c) );
+                EXPECT_EQ( (it2_c <= it3_c), !(it3_c < it2_c) );
+            }
+        }
+
+        // comparison: greater than
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 > it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 > it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 > it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 > it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c > it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c > it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c > it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c > it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                // check definition
+                EXPECT_EQ( (it1 > it1), (it1 < it1) );
+                EXPECT_EQ( (it1 > it2), (it2 < it1) );
+                EXPECT_EQ( (it1 > it3), (it3 < it1) );
+                EXPECT_EQ( (it2 > it3), (it3 < it2) );
+                EXPECT_EQ( (it1_c > it1_c), (it1_c < it1_c) );
+                EXPECT_EQ( (it1_c > it2_c), (it2_c < it1_c) );
+                EXPECT_EQ( (it1_c > it3_c), (it3_c < it1_c) );
+                EXPECT_EQ( (it2_c > it3_c), (it3_c < it2_c) );
+            }
+        }
+
+        // comparison: greater than or equal
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 >= it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 >= it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 >= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 >= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c >= it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c >= it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c >= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c >= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                // check definition
+                EXPECT_EQ( (it1 >= it1), !(it1 < it1) );
+                EXPECT_EQ( (it1 >= it2), !(it1 < it2) );
+                EXPECT_EQ( (it1 >= it3), !(it1 < it3) );
+                EXPECT_EQ( (it2 >= it3), !(it2 < it3) );
+                EXPECT_EQ( (it1_c >= it1_c), !(it1_c < it1_c) );
+                EXPECT_EQ( (it1_c >= it2_c), !(it1_c < it2_c) );
+                EXPECT_EQ( (it1_c >= it3_c), !(it1_c < it3_c) );
+                EXPECT_EQ( (it2_c >= it3_c), !(it2_c < it3_c) );
+            }
+        }
+    }
+
+    // check exceptions if different objects are compared
+    for (auto j : j_values)
+    {
+        for (auto k : j_values)
+        {
+            if (j != k)
+            {
+                EXPECT_THROW_MSG(j.begin() == k.begin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+                EXPECT_THROW_MSG(j.cbegin() == k.cbegin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+
+                EXPECT_THROW_MSG(j.begin() < k.begin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+                EXPECT_THROW_MSG(j.cbegin() < k.cbegin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+            }
+        }
+    }
+}
+
+class JsonIteratorArithmeticTest : public ::testing::Test {
+ protected:
+    json j_object = {{"one", 1}, {"two", 2}, {"three", 3}};
+    json j_array = {1, 2, 3, 4, 5, 6};
+    json j_null = nullptr;
+    json j_value = 42;
+};
+
+TEST_F(JsonIteratorArithmeticTest, AddSubObject)
+{
+    {
+        auto it = j_object.begin();
+        EXPECT_THROW_MSG(it += 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.cbegin();
+        EXPECT_THROW_MSG(it += 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.begin();
+        EXPECT_THROW_MSG(it + 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.cbegin();
+        EXPECT_THROW_MSG(it + 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.begin();
+        EXPECT_THROW_MSG(1 + it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.cbegin();
+        EXPECT_THROW_MSG(1 + it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.begin();
+        EXPECT_THROW_MSG(it -= 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.cbegin();
+        EXPECT_THROW_MSG(it -= 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.begin();
+        EXPECT_THROW_MSG(it - 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.cbegin();
+        EXPECT_THROW_MSG(it - 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.begin();
+        EXPECT_THROW_MSG(it - it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.cbegin();
+        EXPECT_THROW_MSG(it - it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+}
+
+TEST_F(JsonIteratorArithmeticTest, AddSubArray)
+{
+    auto it = j_array.begin();
+    it += 3;
+    EXPECT_EQ((j_array.begin() + 3), it);
+    EXPECT_EQ(json::iterator(3 + j_array.begin()), it);
+    EXPECT_EQ((it - 3), j_array.begin());
+    EXPECT_EQ((it - j_array.begin()), 3);
+    EXPECT_EQ(*it, json(4));
+    it -= 2;
+    EXPECT_EQ(*it, json(2));
+}
+
+TEST_F(JsonIteratorArithmeticTest, AddSubArrayConst)
+{
+    auto it = j_array.cbegin();
+    it += 3;
+    EXPECT_EQ((j_array.cbegin() + 3), it);
+    EXPECT_EQ(json::const_iterator(3 + j_array.cbegin()), it);
+    EXPECT_EQ((it - 3), j_array.cbegin());
+    EXPECT_EQ((it - j_array.cbegin()), 3);
+    EXPECT_EQ(*it, json(4));
+    it -= 2;
+    EXPECT_EQ(*it, json(2));
+}
+
+TEST_F(JsonIteratorArithmeticTest, AddSubNull)
+{
+    auto it = j_null.begin();
+    it += 3;
+    EXPECT_EQ((j_null.begin() + 3), it);
+    EXPECT_EQ(json::iterator(3 + j_null.begin()), it);
+    EXPECT_EQ((it - 3), j_null.begin());
+    EXPECT_EQ((it - j_null.begin()), 3);
+    EXPECT_NE(it, j_null.end());
+    it -= 3;
+    EXPECT_EQ(it, j_null.end());
+}
+
+TEST_F(JsonIteratorArithmeticTest, AddSubNullConst)
+{
+    auto it = j_null.cbegin();
+    it += 3;
+    EXPECT_EQ((j_null.cbegin() + 3), it);
+    EXPECT_EQ(json::const_iterator(3 + j_null.cbegin()), it);
+    EXPECT_EQ((it - 3), j_null.cbegin());
+    EXPECT_EQ((it - j_null.cbegin()), 3);
+    EXPECT_NE(it, j_null.cend());
+    it -= 3;
+    EXPECT_EQ(it, j_null.cend());
+}
+
+TEST_F(JsonIteratorArithmeticTest, AddSubValue)
+{
+    auto it = j_value.begin();
+    it += 3;
+    EXPECT_EQ((j_value.begin() + 3), it);
+    EXPECT_EQ(json::iterator(3 + j_value.begin()), it);
+    EXPECT_EQ((it - 3), j_value.begin());
+    EXPECT_EQ((it - j_value.begin()), 3);
+    EXPECT_NE(it, j_value.end());
+    it -= 3;
+    EXPECT_EQ(*it, json(42));
+}
+
+TEST_F(JsonIteratorArithmeticTest, AddSubValueConst)
+{
+    auto it = j_value.cbegin();
+    it += 3;
+    EXPECT_EQ((j_value.cbegin() + 3), it);
+    EXPECT_EQ(json::const_iterator(3 + j_value.cbegin()), it);
+    EXPECT_EQ((it - 3), j_value.cbegin());
+    EXPECT_EQ((it - j_value.cbegin()), 3);
+    EXPECT_NE(it, j_value.cend());
+    it -= 3;
+    EXPECT_EQ(*it, json(42));
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptObject)
+{
+    auto it = j_object.begin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.208] cannot use operator[] for object iterators");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.208] cannot use operator[] for object iterators");
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptObjectConst)
+{
+    auto it = j_object.cbegin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.208] cannot use operator[] for object iterators");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.208] cannot use operator[] for object iterators");
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptArray)
+{
+    auto it = j_array.begin();
+    EXPECT_EQ(it[0], json(1));
+    EXPECT_EQ(it[1], json(2));
+    EXPECT_EQ(it[2], json(3));
+    EXPECT_EQ(it[3], json(4));
+    EXPECT_EQ(it[4], json(5));
+    EXPECT_EQ(it[5], json(6));
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptArrayConst)
+{
+    auto it = j_array.cbegin();
+    EXPECT_EQ(it[0], json(1));
+    EXPECT_EQ(it[1], json(2));
+    EXPECT_EQ(it[2], json(3));
+    EXPECT_EQ(it[3], json(4));
+    EXPECT_EQ(it[4], json(5));
+    EXPECT_EQ(it[5], json(6));
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptNull)
+{
+    auto it = j_null.begin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptNullConst)
+{
+    auto it = j_null.cbegin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptValue)
+{
+    auto it = j_value.begin();
+    EXPECT_EQ(it[0], json(42));
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST_F(JsonIteratorArithmeticTest, SubscriptValueConst)
+{
+    auto it = j_value.cbegin();
+    EXPECT_EQ(it[0], json(42));
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+#if 0
+TEST(JsonReverseIteratorTest, Comparisons)
+{
+    json j_values = {nullptr, true, 42, 42u, 23.23, {{"one", 1}, {"two", 2}}, {1, 2, 3, 4, 5}, "Hello, world"};
+
+    for (json& j : j_values)
+    {
+        SCOPED_TRACE(j.dump());
+        auto it1 = j.rbegin();
+        auto it2 = j.rbegin();
+        auto it3 = j.rbegin();
+        ++it2;
+        ++it3;
+        ++it3;
+        auto it1_c = j.crbegin();
+        auto it2_c = j.crbegin();
+        auto it3_c = j.crbegin();
+        ++it2_c;
+        ++it3_c;
+        ++it3_c;
+
+        // comparison: equal
+        {
+            EXPECT_TRUE(it1 == it1);
+            EXPECT_FALSE(it1 == it2);
+            EXPECT_FALSE(it1 == it3);
+            EXPECT_FALSE(it2 == it3);
+            EXPECT_TRUE(it1_c == it1_c);
+            EXPECT_FALSE(it1_c == it2_c);
+            EXPECT_FALSE(it1_c == it3_c);
+            EXPECT_FALSE(it2_c == it3_c);
+        }
+
+        // comparison: not equal
+        {
+            // check definition
+            EXPECT_EQ( (it1 != it1), !(it1 == it1) );
+            EXPECT_EQ( (it1 != it2), !(it1 == it2) );
+            EXPECT_EQ( (it1 != it3), !(it1 == it3) );
+            EXPECT_EQ( (it2 != it3), !(it2 == it3) );
+            EXPECT_EQ( (it1_c != it1_c), !(it1_c == it1_c) );
+            EXPECT_EQ( (it1_c != it2_c), !(it1_c == it2_c) );
+            EXPECT_EQ( (it1_c != it3_c), !(it1_c == it3_c) );
+            EXPECT_EQ( (it2_c != it3_c), !(it2_c == it3_c) );
+        }
+
+        // comparison: smaller
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 < it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 < it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 < it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 < it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c < it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c < it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c < it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c < it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                EXPECT_FALSE(it1 < it1);
+                EXPECT_TRUE(it1 < it2);
+                EXPECT_TRUE(it1 < it3);
+                EXPECT_TRUE(it2 < it3);
+                EXPECT_FALSE(it1_c < it1_c);
+                EXPECT_TRUE(it1_c < it2_c);
+                EXPECT_TRUE(it1_c < it3_c);
+                EXPECT_TRUE(it2_c < it3_c);
+            }
+        }
+
+        // comparison: less than or equal
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 <= it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 <= it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 <= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 <= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c <= it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c <= it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c <= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c <= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                // check definition
+                EXPECT_EQ( (it1 <= it1), !(it1 < it1) );
+                EXPECT_EQ( (it1 <= it2), !(it2 < it1) );
+                EXPECT_EQ( (it1 <= it3), !(it3 < it1) );
+                EXPECT_EQ( (it2 <= it3), !(it3 < it2) );
+                EXPECT_EQ( (it1_c <= it1_c), !(it1_c < it1_c) );
+                EXPECT_EQ( (it1_c <= it2_c), !(it2_c < it1_c) );
+                EXPECT_EQ( (it1_c <= it3_c), !(it3_c < it1_c) );
+                EXPECT_EQ( (it2_c <= it3_c), !(it3_c < it2_c) );
+            }
+        }
+
+        // comparison: greater than
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 > it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 > it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 > it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 > it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c > it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c > it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c > it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c > it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                // check definition
+                EXPECT_EQ( (it1 > it1), (it1 < it1) );
+                EXPECT_EQ( (it1 > it2), (it2 < it1) );
+                EXPECT_EQ( (it1 > it3), (it3 < it1) );
+                EXPECT_EQ( (it2 > it3), (it3 < it2) );
+                EXPECT_EQ( (it1_c > it1_c), (it1_c < it1_c) );
+                EXPECT_EQ( (it1_c > it2_c), (it2_c < it1_c) );
+                EXPECT_EQ( (it1_c > it3_c), (it3_c < it1_c) );
+                EXPECT_EQ( (it2_c > it3_c), (it3_c < it2_c) );
+            }
+        }
+
+        // comparison: greater than or equal
+        {
+            if (j.type() == json::value_t::object)
+            {
+                EXPECT_THROW_MSG(it1 >= it1, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 >= it2, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2 >= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1 >= it3, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c >= it1_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c >= it2_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it2_c >= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+                EXPECT_THROW_MSG(it1_c >= it3_c, json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.213] cannot compare order of object iterators");
+            }
+            else
+            {
+                // check definition
+                EXPECT_EQ( (it1 >= it1), !(it1 < it1) );
+                EXPECT_EQ( (it1 >= it2), !(it1 < it2) );
+                EXPECT_EQ( (it1 >= it3), !(it1 < it3) );
+                EXPECT_EQ( (it2 >= it3), !(it2 < it3) );
+                EXPECT_EQ( (it1_c >= it1_c), !(it1_c < it1_c) );
+                EXPECT_EQ( (it1_c >= it2_c), !(it1_c < it2_c) );
+                EXPECT_EQ( (it1_c >= it3_c), !(it1_c < it3_c) );
+                EXPECT_EQ( (it2_c >= it3_c), !(it2_c < it3_c) );
+            }
+        }
+    }
+
+    // check exceptions if different objects are compared
+    for (auto j : j_values)
+    {
+        for (auto k : j_values)
+        {
+            if (j != k)
+            {
+                EXPECT_THROW_MSG(j.rbegin() == k.rbegin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+                EXPECT_THROW_MSG(j.crbegin() == k.crbegin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+
+                EXPECT_THROW_MSG(j.rbegin() < k.rbegin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+                EXPECT_THROW_MSG(j.crbegin() < k.crbegin(), json::invalid_iterator,
+                                 "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
+            }
+        }
+    }
+}
+
+class JsonReverseIteratorArithmeticTest : public ::testing::Test {
+ protected:
+    json j_object = {{"one", 1}, {"two", 2}, {"three", 3}};
+    json j_array = {1, 2, 3, 4, 5, 6};
+    json j_null = nullptr;
+    json j_value = 42;
+};
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubObject)
+{
+    {
+        auto it = j_object.rbegin();
+        EXPECT_THROW_MSG(it += 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.crbegin();
+        EXPECT_THROW_MSG(it += 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.rbegin();
+        EXPECT_THROW_MSG(it + 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.crbegin();
+        EXPECT_THROW_MSG(it + 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.rbegin();
+        EXPECT_THROW_MSG(1 + it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.crbegin();
+        EXPECT_THROW_MSG(1 + it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.rbegin();
+        EXPECT_THROW_MSG(it -= 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.crbegin();
+        EXPECT_THROW_MSG(it -= 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.rbegin();
+        EXPECT_THROW_MSG(it - 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.crbegin();
+        EXPECT_THROW_MSG(it - 1, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.rbegin();
+        EXPECT_THROW_MSG(it - it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+    {
+        auto it = j_object.crbegin();
+        EXPECT_THROW_MSG(it - it, json::invalid_iterator,
+                         "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    }
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubArray)
+{
+    auto it = j_array.rbegin();
+    it += 3;
+    EXPECT_EQ((j_array.rbegin() + 3), it);
+    EXPECT_EQ(json::reverse_iterator(3 + j_array.rbegin()), it);
+    EXPECT_EQ((it - 3), j_array.rbegin());
+    EXPECT_EQ((it - j_array.rbegin()), 3);
+    EXPECT_EQ(*it, json(3));
+    it -= 2;
+    EXPECT_EQ(*it, json(5));
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubArrayConst)
+{
+    auto it = j_array.crbegin();
+    it += 3;
+    EXPECT_EQ((j_array.crbegin() + 3), it);
+    EXPECT_EQ(json::const_reverse_iterator(3 + j_array.crbegin()), it);
+    EXPECT_EQ((it - 3), j_array.crbegin());
+    EXPECT_EQ((it - j_array.crbegin()), 3);
+    EXPECT_EQ(*it, json(3));
+    it -= 2;
+    EXPECT_EQ(*it, json(5));
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubNull)
+{
+    auto it = j_null.rbegin();
+    it += 3;
+    EXPECT_EQ((j_null.rbegin() + 3), it);
+    EXPECT_EQ(json::reverse_iterator(3 + j_null.rbegin()), it);
+    EXPECT_EQ((it - 3), j_null.rbegin());
+    EXPECT_EQ((it - j_null.rbegin()), 3);
+    EXPECT_NE(it, j_null.rend());
+    it -= 3;
+    EXPECT_EQ(it, j_null.rend());
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubNullConst)
+{
+    auto it = j_null.crbegin();
+    it += 3;
+    EXPECT_EQ((j_null.crbegin() + 3), it);
+    EXPECT_EQ(json::const_reverse_iterator(3 + j_null.crbegin()), it);
+    EXPECT_EQ((it - 3), j_null.crbegin());
+    EXPECT_EQ((it - j_null.crbegin()), 3);
+    EXPECT_NE(it, j_null.crend());
+    it -= 3;
+    EXPECT_EQ(it, j_null.crend());
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubValue)
+{
+    auto it = j_value.rbegin();
+    it += 3;
+    EXPECT_EQ((j_value.rbegin() + 3), it);
+    EXPECT_EQ(json::reverse_iterator(3 + j_value.rbegin()), it);
+    EXPECT_EQ((it - 3), j_value.rbegin());
+    EXPECT_EQ((it - j_value.rbegin()), 3);
+    EXPECT_NE(it, j_value.rend());
+    it -= 3;
+    EXPECT_EQ(*it, json(42));
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, AddSubValueConst)
+{
+    auto it = j_value.crbegin();
+    it += 3;
+    EXPECT_EQ((j_value.crbegin() + 3), it);
+    EXPECT_EQ(json::const_reverse_iterator(3 + j_value.crbegin()), it);
+    EXPECT_EQ((it - 3), j_value.crbegin());
+    EXPECT_EQ((it - j_value.crbegin()), 3);
+    EXPECT_NE(it, j_value.crend());
+    it -= 3;
+    EXPECT_EQ(*it, json(42));
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptObject)
+{
+    auto it = j_object.rbegin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptObjectConst)
+{
+    auto it = j_object.crbegin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.209] cannot use offsets with object iterators");
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptArray)
+{
+    auto it = j_array.rbegin();
+    EXPECT_EQ(it[0], json(6));
+    EXPECT_EQ(it[1], json(5));
+    EXPECT_EQ(it[2], json(4));
+    EXPECT_EQ(it[3], json(3));
+    EXPECT_EQ(it[4], json(2));
+    EXPECT_EQ(it[5], json(1));
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptArrayConst)
+{
+    auto it = j_array.crbegin();
+    EXPECT_EQ(it[0], json(6));
+    EXPECT_EQ(it[1], json(5));
+    EXPECT_EQ(it[2], json(4));
+    EXPECT_EQ(it[3], json(3));
+    EXPECT_EQ(it[4], json(2));
+    EXPECT_EQ(it[5], json(1));
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptNull)
+{
+    auto it = j_null.rbegin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptNullConst)
+{
+    auto it = j_null.crbegin();
+    EXPECT_THROW_MSG(it[0], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptValue)
+{
+    auto it = j_value.rbegin();
+    EXPECT_EQ(it[0], json(42));
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+
+TEST_F(JsonReverseIteratorArithmeticTest, SubscriptValueConst)
+{
+    auto it = j_value.crbegin();
+    EXPECT_EQ(it[0], json(42));
+    EXPECT_THROW_MSG(it[1], json::invalid_iterator,
+                     "[json.exception.invalid_iterator.214] cannot get value");
+}
+#endif
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-json.h b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-json.h
new file mode 100644
index 0000000..9e7ddd2
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-json.h
@@ -0,0 +1,88 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/#ifndef UNIT_JSON_H_
+#define UNIT_JSON_H_
+
+#include <ostream>
+
+#include "support/json.h"
+
+namespace wpi {
+
+inline
+void PrintTo(const json& j, std::ostream* os) {
+  *os << j.dump();
+}
+
+class JsonTest {
+ public:
+  static const json::json_value& GetValue(const json& j) {
+    return j.m_value;
+  }
+  static json::pointer GetObject(json::iterator it) {
+    return it.m_object;
+  }
+  static json::const_pointer GetObject(json::const_iterator it) {
+    return it.m_object;
+  }
+  static std::string pop_back(json::json_pointer& p) {
+    return p.pop_back();
+  }
+  static json::json_pointer top(const json::json_pointer& p) {
+    return p.top();
+  }
+};
+
+}  // namespace wpi
+
+// clang warns on TEST_THROW_MSG(x == y, ...) saying the result is unused.
+// suppress this warning.
+#if defined(__clang__)
+#pragma GCC diagnostic ignored "-Wunused-comparison"
+#endif
+
+// variant of GTEST_TEST_THROW_ that also checks the exception's message.
+#define TEST_THROW_MSG(statement, expected_exception, expected_msg, fail) \
+  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
+  if (::testing::internal::ConstCharPtr gtest_msg = "") { \
+    bool gtest_caught_expected = false; \
+    try { \
+      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
+    } \
+    catch (expected_exception const& gtest_ex) { \
+      gtest_caught_expected = true; \
+      if (::std::string(gtest_ex.what()) != expected_msg) { \
+        ::testing::AssertionResult gtest_ar = ::testing::AssertionFailure(); \
+        gtest_ar \
+            << "Expected: " #statement " throws an exception with message \"" \
+            << expected_msg "\".\n  Actual: it throws message \"" \
+            << gtest_ex.what() << "\"."; \
+        fail(gtest_ar.failure_message()); \
+      } \
+    } \
+    catch (...) { \
+      gtest_msg.value = \
+          "Expected: " #statement " throws an exception of type " \
+          #expected_exception ".\n  Actual: it throws a different type."; \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
+    } \
+    if (!gtest_caught_expected) { \
+      gtest_msg.value = \
+          "Expected: " #statement " throws an exception of type " \
+          #expected_exception ".\n  Actual: it throws nothing."; \
+      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
+    } \
+  } else \
+    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \
+      fail(gtest_msg.value)
+
+#define EXPECT_THROW_MSG(statement, expected_exception, expected_msg) \
+  TEST_THROW_MSG(statement, expected_exception, expected_msg, GTEST_NONFATAL_FAILURE_)
+
+#define ASSERT_THROW_MSG(statement, expected_exception, expected_msg) \
+  TEST_THROW_MSG(statement, expected_exception, expected_msg, GTEST_FATAL_FAILURE_)
+
+#endif
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-json_pointer.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-json_pointer.cpp
new file mode 100644
index 0000000..d54fd6a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-json_pointer.cpp
@@ -0,0 +1,402 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+using wpi::JsonTest;
+
+TEST(JsonPointerTest, Errors)
+{
+    EXPECT_THROW_MSG(json::json_pointer("foo"), json::parse_error,
+                     "[json.exception.parse_error.107] parse error at 1: JSON pointer must be empty or begin with '/' - was: 'foo'");
+
+    EXPECT_THROW_MSG(json::json_pointer("/~~"), json::parse_error,
+                     "[json.exception.parse_error.108] parse error: escape character '~' must be followed with '0' or '1'");
+
+    EXPECT_THROW_MSG(json::json_pointer("/~"), json::parse_error,
+                     "[json.exception.parse_error.108] parse error: escape character '~' must be followed with '0' or '1'");
+
+    json::json_pointer p;
+    EXPECT_THROW_MSG(JsonTest::top(p), json::out_of_range,
+                     "[json.exception.out_of_range.405] JSON pointer has no parent");
+    EXPECT_THROW_MSG(JsonTest::pop_back(p), json::out_of_range,
+                     "[json.exception.out_of_range.405] JSON pointer has no parent");
+}
+
+// examples from RFC 6901
+TEST(JsonPointerTest, AccessNonConst)
+{
+    json j = R"(
+    {
+        "foo": ["bar", "baz"],
+        "": 0,
+        "a/b": 1,
+        "c%d": 2,
+        "e^f": 3,
+        "g|h": 4,
+        "i\\j": 5,
+        "k\"l": 6,
+        " ": 7,
+        "m~n": 8
+    }
+    )"_json;
+
+    // the whole document
+    EXPECT_EQ(j[json::json_pointer()], j);
+    EXPECT_EQ(j[json::json_pointer("")], j);
+
+    // array access
+    EXPECT_EQ(j[json::json_pointer("/foo")], j["foo"]);
+    EXPECT_EQ(j[json::json_pointer("/foo/0")], j["foo"][0]);
+    EXPECT_EQ(j[json::json_pointer("/foo/1")], j["foo"][1]);
+    EXPECT_EQ(j["/foo/1"_json_pointer], j["foo"][1]);
+
+    // checked array access
+    EXPECT_EQ(j.at(json::json_pointer("/foo/0")), j["foo"][0]);
+    EXPECT_EQ(j.at(json::json_pointer("/foo/1")), j["foo"][1]);
+
+    // empty string access
+    EXPECT_EQ(j[json::json_pointer("/")], j[""]);
+
+    // other cases
+    EXPECT_EQ(j[json::json_pointer("/ ")], j[" "]);
+    EXPECT_EQ(j[json::json_pointer("/c%d")], j["c%d"]);
+    EXPECT_EQ(j[json::json_pointer("/e^f")], j["e^f"]);
+    EXPECT_EQ(j[json::json_pointer("/g|h")], j["g|h"]);
+    EXPECT_EQ(j[json::json_pointer("/i\\j")], j["i\\j"]);
+    EXPECT_EQ(j[json::json_pointer("/k\"l")], j["k\"l"]);
+
+    // checked access
+    EXPECT_EQ(j.at(json::json_pointer("/ ")), j[" "]);
+    EXPECT_EQ(j.at(json::json_pointer("/c%d")), j["c%d"]);
+    EXPECT_EQ(j.at(json::json_pointer("/e^f")), j["e^f"]);
+    EXPECT_EQ(j.at(json::json_pointer("/g|h")), j["g|h"]);
+    EXPECT_EQ(j.at(json::json_pointer("/i\\j")), j["i\\j"]);
+    EXPECT_EQ(j.at(json::json_pointer("/k\"l")), j["k\"l"]);
+
+    // escaped access
+    EXPECT_EQ(j[json::json_pointer("/a~1b")], j["a/b"]);
+    EXPECT_EQ(j[json::json_pointer("/m~0n")], j["m~n"]);
+
+    // unescaped access
+    // access to nonexisting values yield object creation
+    EXPECT_NO_THROW(j[json::json_pointer("/a/b")] = 42);
+    EXPECT_EQ(j["a"]["b"], json(42));
+    EXPECT_NO_THROW(j[json::json_pointer("/a/c/1")] = 42);
+    EXPECT_EQ(j["a"]["c"], json({nullptr, 42}));
+    EXPECT_NO_THROW(j[json::json_pointer("/a/d/-")] = 42);
+    EXPECT_EQ(j["a"]["d"], json::array({42}));
+    // "/a/b" works for JSON {"a": {"b": 42}}
+    EXPECT_EQ(json({{"a", {{"b", 42}}}})[json::json_pointer("/a/b")], json(42));
+
+    // unresolved access
+    json j_primitive = 1;
+    EXPECT_THROW_MSG(j_primitive["/foo"_json_pointer], json::out_of_range,
+                     "[json.exception.out_of_range.404] unresolved reference token 'foo'");
+    EXPECT_THROW_MSG(j_primitive.at("/foo"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.404] unresolved reference token 'foo'");
+}
+
+TEST(JsonPointerTest, AccessConst)
+{
+    const json j = R"(
+    {
+        "foo": ["bar", "baz"],
+        "": 0,
+        "a/b": 1,
+        "c%d": 2,
+        "e^f": 3,
+        "g|h": 4,
+        "i\\j": 5,
+        "k\"l": 6,
+        " ": 7,
+        "m~n": 8
+    }
+    )"_json;
+
+    // the whole document
+    EXPECT_EQ(j[json::json_pointer()], j);
+    EXPECT_EQ(j[json::json_pointer("")], j);
+
+    // array access
+    EXPECT_EQ(j[json::json_pointer("/foo")], j["foo"]);
+    EXPECT_EQ(j[json::json_pointer("/foo/0")], j["foo"][0]);
+    EXPECT_EQ(j[json::json_pointer("/foo/1")], j["foo"][1]);
+    EXPECT_EQ(j["/foo/1"_json_pointer], j["foo"][1]);
+
+    // checked array access
+    EXPECT_EQ(j.at(json::json_pointer("/foo/0")), j["foo"][0]);
+    EXPECT_EQ(j.at(json::json_pointer("/foo/1")), j["foo"][1]);
+
+    // empty string access
+    EXPECT_EQ(j[json::json_pointer("/")], j[""]);
+
+    // other cases
+    EXPECT_EQ(j[json::json_pointer("/ ")], j[" "]);
+    EXPECT_EQ(j[json::json_pointer("/c%d")], j["c%d"]);
+    EXPECT_EQ(j[json::json_pointer("/e^f")], j["e^f"]);
+    EXPECT_EQ(j[json::json_pointer("/g|h")], j["g|h"]);
+    EXPECT_EQ(j[json::json_pointer("/i\\j")], j["i\\j"]);
+    EXPECT_EQ(j[json::json_pointer("/k\"l")], j["k\"l"]);
+
+    // checked access
+    EXPECT_EQ(j.at(json::json_pointer("/ ")), j[" "]);
+    EXPECT_EQ(j.at(json::json_pointer("/c%d")), j["c%d"]);
+    EXPECT_EQ(j.at(json::json_pointer("/e^f")), j["e^f"]);
+    EXPECT_EQ(j.at(json::json_pointer("/g|h")), j["g|h"]);
+    EXPECT_EQ(j.at(json::json_pointer("/i\\j")), j["i\\j"]);
+    EXPECT_EQ(j.at(json::json_pointer("/k\"l")), j["k\"l"]);
+
+    // escaped access
+    EXPECT_EQ(j[json::json_pointer("/a~1b")], j["a/b"]);
+    EXPECT_EQ(j[json::json_pointer("/m~0n")], j["m~n"]);
+
+    // unescaped access
+    EXPECT_THROW_MSG(j.at(json::json_pointer("/a/b")), json::out_of_range,
+                     "[json.exception.out_of_range.403] key 'a' not found");
+
+    // unresolved access
+    const json j_primitive = 1;
+    EXPECT_THROW_MSG(j_primitive["/foo"_json_pointer], json::out_of_range,
+                     "[json.exception.out_of_range.404] unresolved reference token 'foo'");
+    EXPECT_THROW_MSG(j_primitive.at("/foo"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.404] unresolved reference token 'foo'");
+}
+
+TEST(JsonPointerTest, UserStringLiteral)
+{
+    json j = R"(
+    {
+        "foo": ["bar", "baz"],
+        "": 0,
+        "a/b": 1,
+        "c%d": 2,
+        "e^f": 3,
+        "g|h": 4,
+        "i\\j": 5,
+        "k\"l": 6,
+        " ": 7,
+        "m~n": 8
+    }
+    )"_json;
+
+    // the whole document
+    EXPECT_EQ(j[""_json_pointer], j);
+
+    // array access
+    EXPECT_EQ(j["/foo"_json_pointer], j["foo"]);
+    EXPECT_EQ(j["/foo/0"_json_pointer], j["foo"][0]);
+    EXPECT_EQ(j["/foo/1"_json_pointer], j["foo"][1]);
+}
+
+TEST(JsonPointerTest, ArrayNonConst)
+{
+    json j = {1, 2, 3};
+    const json j_const = j;
+
+    // check reading access
+    EXPECT_EQ(j["/0"_json_pointer], j[0]);
+    EXPECT_EQ(j["/1"_json_pointer], j[1]);
+    EXPECT_EQ(j["/2"_json_pointer], j[2]);
+
+    // assign to existing index
+    j["/1"_json_pointer] = 13;
+    EXPECT_EQ(j[1], json(13));
+
+    // assign to nonexisting index
+    j["/3"_json_pointer] = 33;
+    EXPECT_EQ(j[3], json(33));
+
+    // assign to nonexisting index (with gap)
+    j["/5"_json_pointer] = 55;
+    EXPECT_EQ(j, json({1, 13, 3, 33, nullptr, 55}));
+
+    // error with leading 0
+    EXPECT_THROW_MSG(j["/01"_json_pointer], json::parse_error,
+                     "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
+    EXPECT_THROW_MSG(j_const["/01"_json_pointer], json::parse_error,
+                     "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
+    EXPECT_THROW_MSG(j.at("/01"_json_pointer), json::parse_error,
+                     "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
+    EXPECT_THROW_MSG(j_const.at("/01"_json_pointer), json::parse_error,
+                     "[json.exception.parse_error.106] parse error: array index '01' must not begin with '0'");
+
+    // error with incorrect numbers
+    EXPECT_THROW_MSG(j["/one"_json_pointer] = 1, json::parse_error,
+                     "[json.exception.parse_error.109] parse error: array index 'one' is not a number");
+    EXPECT_THROW_MSG(j_const["/one"_json_pointer] == 1, json::parse_error,
+                     "[json.exception.parse_error.109] parse error: array index 'one' is not a number");
+
+    EXPECT_THROW_MSG(j.at("/one"_json_pointer) = 1, json::parse_error,
+                     "[json.exception.parse_error.109] parse error: array index 'one' is not a number");
+    EXPECT_THROW_MSG(j_const.at("/one"_json_pointer) == 1, json::parse_error,
+                     "[json.exception.parse_error.109] parse error: array index 'one' is not a number");
+
+    EXPECT_THROW_MSG(json({{"/list/0", 1}, {"/list/1", 2}, {"/list/three", 3}}).unflatten(), json::parse_error,
+                     "[json.exception.parse_error.109] parse error: array index 'three' is not a number");
+
+    // assign to "-"
+    j["/-"_json_pointer] = 99;
+    EXPECT_EQ(j, json({1, 13, 3, 33, nullptr, 55, 99}));
+
+    // error when using "-" in const object
+    EXPECT_THROW_MSG(j_const["/-"_json_pointer], json::out_of_range,
+                     "[json.exception.out_of_range.402] array index '-' (3) is out of range");
+
+    // error when using "-" with at
+    EXPECT_THROW_MSG(j.at("/-"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.402] array index '-' (7) is out of range");
+    EXPECT_THROW_MSG(j_const.at("/-"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.402] array index '-' (3) is out of range");
+}
+
+TEST(JsonPointerTest, ArrayConst)
+{
+    const json j = {1, 2, 3};
+
+    // check reading access
+    EXPECT_EQ(j["/0"_json_pointer], j[0]);
+    EXPECT_EQ(j["/1"_json_pointer], j[1]);
+    EXPECT_EQ(j["/2"_json_pointer], j[2]);
+
+    // assign to nonexisting index
+    EXPECT_THROW_MSG(j.at("/3"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.401] array index 3 is out of range");
+
+    // assign to nonexisting index (with gap)
+    EXPECT_THROW_MSG(j.at("/5"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.401] array index 5 is out of range");
+
+    // assign to "-"
+    EXPECT_THROW_MSG(j["/-"_json_pointer], json::out_of_range,
+                     "[json.exception.out_of_range.402] array index '-' (3) is out of range");
+    EXPECT_THROW_MSG(j.at("/-"_json_pointer), json::out_of_range,
+                     "[json.exception.out_of_range.402] array index '-' (3) is out of range");
+}
+
+TEST(JsonPointerTest, Flatten)
+{
+    json j =
+    {
+        {"pi", 3.141},
+        {"happy", true},
+        {"name", "Niels"},
+        {"nothing", nullptr},
+        {
+            "answer", {
+                {"everything", 42}
+            }
+        },
+        {"list", {1, 0, 2}},
+        {
+            "object", {
+                {"currency", "USD"},
+                {"value", 42.99},
+                {"", "empty string"},
+                {"/", "slash"},
+                {"~", "tilde"},
+                {"~1", "tilde1"}
+            }
+        }
+    };
+
+    json j_flatten =
+    {
+        {"/pi", 3.141},
+        {"/happy", true},
+        {"/name", "Niels"},
+        {"/nothing", nullptr},
+        {"/answer/everything", 42},
+        {"/list/0", 1},
+        {"/list/1", 0},
+        {"/list/2", 2},
+        {"/object/currency", "USD"},
+        {"/object/value", 42.99},
+        {"/object/", "empty string"},
+        {"/object/~1", "slash"},
+        {"/object/~0", "tilde"},
+        {"/object/~01", "tilde1"}
+    };
+
+    // check if flattened result is as expected
+    EXPECT_EQ(j.flatten(), j_flatten);
+
+    // check if unflattened result is as expected
+    EXPECT_EQ(j_flatten.unflatten(), j);
+
+    // error for nonobjects
+    EXPECT_THROW_MSG(json(1).unflatten(), json::type_error,
+                     "[json.exception.type_error.314] only objects can be unflattened");
+
+    // error for nonprimitve values
+    EXPECT_THROW_MSG(json({{"/1", {1, 2, 3}}}).unflatten(), json::type_error,
+                     "[json.exception.type_error.315] values in object must be primitive");
+
+    // error for conflicting values
+    json j_error = {{"", 42}, {"/foo", 17}};
+    EXPECT_THROW_MSG(j_error.unflatten(), json::type_error,
+                     "[json.exception.type_error.313] invalid value to unflatten");
+
+    // explicit roundtrip check
+    EXPECT_EQ(j.flatten().unflatten(), j);
+
+    // roundtrip for primitive values
+    json j_null;
+    EXPECT_EQ(j_null.flatten().unflatten(), j_null);
+    json j_number = 42;
+    EXPECT_EQ(j_number.flatten().unflatten(), j_number);
+    json j_boolean = false;
+    EXPECT_EQ(j_boolean.flatten().unflatten(), j_boolean);
+    json j_string = "foo";
+    EXPECT_EQ(j_string.flatten().unflatten(), j_string);
+
+    // roundtrip for empty structured values (will be unflattened to null)
+    json j_array(json::value_t::array);
+    EXPECT_EQ(j_array.flatten().unflatten(), json());
+    json j_object(json::value_t::object);
+    EXPECT_EQ(j_object.flatten().unflatten(), json());
+}
+
+TEST(JsonPointerTest, StringRepresentation)
+{
+    for (auto ptr :
+            {"", "/foo", "/foo/0", "/", "/a~1b", "/c%d", "/e^f", "/g|h", "/i\\j", "/k\"l", "/ ", "/m~0n"
+            })
+    {
+        SCOPED_TRACE(ptr);
+        EXPECT_EQ(json::json_pointer(ptr).to_string(), ptr);
+    }
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-meta.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-meta.cpp
new file mode 100644
index 0000000..ecf77ba
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-meta.cpp
@@ -0,0 +1,54 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2016 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonVersionTest, Meta)
+{
+    json j = json::meta();
+
+    EXPECT_EQ(j["name"], "WPI version of JSON for Modern C++");
+    EXPECT_EQ(j["copyright"], "(C) 2013-2017 Niels Lohmann, (C) 2017 FIRST");
+    EXPECT_EQ(j["url"], "https://github.com/wpilibsuite/wpiutil");
+    EXPECT_EQ(j["version"], json(
+    {
+        {"string", "2.1.1"},
+        {"major", 2},
+        {"minor", 1},
+        {"patch", 1}
+    }));
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-modifiers.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-modifiers.cpp
new file mode 100644
index 0000000..4abc628
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-modifiers.cpp
@@ -0,0 +1,739 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonClearTest, Boolean)
+{
+    json j = true;
+
+    j.clear();
+    EXPECT_EQ(j, json(json::value_t::boolean));
+}
+
+TEST(JsonClearTest, String)
+{
+    json j = "hello world";
+
+    j.clear();
+    EXPECT_EQ(j, json(json::value_t::string));
+}
+
+TEST(JsonClearTest, ArrayEmpty)
+{
+    json j = json::array();
+
+    j.clear();
+    EXPECT_TRUE(j.empty());
+    EXPECT_EQ(j, json(json::value_t::array));
+}
+
+TEST(JsonClearTest, ArrayFilled)
+{
+    json j = {1, 2, 3};
+
+    j.clear();
+    EXPECT_TRUE(j.empty());
+    EXPECT_EQ(j, json(json::value_t::array));
+}
+
+TEST(JsonClearTest, ObjectEmpty)
+{
+    json j = json::object();
+
+    j.clear();
+    EXPECT_TRUE(j.empty());
+    EXPECT_EQ(j, json(json::value_t::object));
+}
+
+TEST(JsonClearTest, ObjectFilled)
+{
+    json j = {{"one", 1}, {"two", 2}, {"three", 3}};
+
+    j.clear();
+    EXPECT_TRUE(j.empty());
+    EXPECT_EQ(j, json(json::value_t::object));
+}
+
+TEST(JsonClearTest, Integer)
+{
+    json j = 23;
+
+    j.clear();
+    EXPECT_EQ(j, json(json::value_t::number_integer));
+}
+
+TEST(JsonClearTest, Unsigned)
+{
+    json j = 23u;
+
+    j.clear();
+    EXPECT_EQ(j, json(json::value_t::number_integer));
+}
+
+TEST(JsonClearTest, Float)
+{
+    json j = 23.42;
+
+    j.clear();
+    EXPECT_EQ(j, json(json::value_t::number_float));
+}
+
+TEST(JsonClearTest, Null)
+{
+    json j = nullptr;
+
+    j.clear();
+    EXPECT_EQ(j, json(json::value_t::null));
+}
+
+TEST(JsonPushBackArrayTest, RRefNull)
+{
+    json j;
+    j.push_back(1);
+    j.push_back(2);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2}));
+}
+
+TEST(JsonPushBackArrayTest, RRefArray)
+{
+    json j = {1, 2, 3};
+    j.push_back("Hello");
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2, 3, "Hello"}));
+}
+
+TEST(JsonPushBackArrayTest, RRefOther)
+{
+    json j = 1;
+    EXPECT_THROW_MSG(j.push_back("Hello"), json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with number");
+}
+
+TEST(JsonPushBackArrayTest, LRefNull)
+{
+    json j;
+    json k(1);
+    j.push_back(k);
+    j.push_back(k);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 1}));
+}
+
+TEST(JsonPushBackArrayTest, LRefArray)
+{
+    json j = {1, 2, 3};
+    json k("Hello");
+    j.push_back(k);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2, 3, "Hello"}));
+}
+
+TEST(JsonPushBackArrayTest, LRefOther)
+{
+    json j = 1;
+    json k("Hello");
+    EXPECT_THROW_MSG(j.push_back(k), json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with number");
+}
+#if 0
+TEST(JsonPushBackObjectTest, Null)
+{
+    json j;
+    j.push_back(json::object_t::value_type({"one", 1}));
+    j.push_back(json::object_t::value_type({"two", 2}));
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j.size(), 2u);
+    EXPECT_EQ(j["one"], json(1));
+    EXPECT_EQ(j["two"], json(2));
+}
+
+TEST(JsonPushBackObjectTest, Object)
+{
+    json j(json::value_t::object);
+    j.push_back(json::object_t::value_type({"one", 1}));
+    j.push_back(json::object_t::value_type({"two", 2}));
+    EXPECT_EQ(j.size(), 2u);
+    EXPECT_EQ(j["one"], json(1));
+    EXPECT_EQ(j["two"], json(2));
+}
+
+TEST(JsonPushBackObjectTest, Other)
+{
+    json j = 1;
+    json k("Hello");
+    EXPECT_THROW_MSG(j.push_back(json::object_t::value_type({"one", 1})), json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with number");
+}
+#endif
+TEST(JsonPushBackInitListTest, Null)
+{
+    json j;
+    j.push_back({"foo", "bar"});
+    EXPECT_EQ(j, json::array({{"foo", "bar"}}));
+
+    json k;
+    k.push_back({1, 2, 3});
+    EXPECT_EQ(k, json::array({{1, 2, 3}}));
+}
+
+TEST(JsonPushBackInitListTest, Array)
+{
+    json j = {1, 2, 3};
+    j.push_back({"foo", "bar"});
+    EXPECT_EQ(j, json({1, 2, 3, {"foo", "bar"}}));
+
+    json k = {1, 2, 3};
+    k.push_back({1, 2, 3});
+    EXPECT_EQ(k, json({1, 2, 3, {1, 2, 3}}));
+}
+
+TEST(JsonPushBackInitListTest, Object)
+{
+    json j = {{"key1", 1}};
+    j.push_back({"key2", "bar"});
+    EXPECT_EQ(j, json({{"key1", 1}, {"key2", "bar"}}));
+
+    json k = {{"key1", 1}};
+    EXPECT_THROW_MSG(k.push_back({1, 2, 3, 4}), json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with object");
+}
+
+TEST(JsonEmplaceBackArrayTest, Null)
+{
+    json j;
+    j.emplace_back(1);
+    j.emplace_back(2);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2}));
+}
+
+TEST(JsonEmplaceBackArrayTest, Array)
+{
+    json j = {1, 2, 3};
+    j.emplace_back("Hello");
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2, 3, "Hello"}));
+}
+
+TEST(JsonEmplaceBackArrayTest, MultipleValues)
+{
+    json j;
+    j.emplace_back(3, "foo");
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({{"foo", "foo", "foo"}}));
+}
+
+TEST(JsonEmplaceBackArrayTest, Other)
+{
+    json j = 1;
+    EXPECT_THROW_MSG(j.emplace_back("Hello"), json::type_error,
+                     "[json.exception.type_error.311] cannot use emplace_back() with number");
+}
+
+TEST(JsonEmplaceObjectTest, Null)
+{
+    // start with a null value
+    json j;
+
+    // add a new key
+    auto res1 = j.emplace("foo", "bar");
+    EXPECT_EQ(res1.second, true);
+    EXPECT_EQ(*res1.first, "bar");
+
+    // the null value is changed to an object
+    EXPECT_EQ(j.type(), json::value_t::object);
+
+    // add a new key
+    auto res2 = j.emplace("baz", "bam");
+    EXPECT_EQ(res2.second, true);
+    EXPECT_EQ(*res2.first, "bam");
+
+    // we try to insert at given key - no change
+    auto res3 = j.emplace("baz", "bad");
+    EXPECT_EQ(res3.second, false);
+    EXPECT_EQ(*res3.first, "bam");
+
+    // the final object
+    EXPECT_EQ(j, json({{"baz", "bam"}, {"foo", "bar"}}));
+}
+
+TEST(JsonEmplaceObjectTest, Object)
+{
+    // start with an object
+    json j = {{"foo", "bar"}};
+
+    // add a new key
+    auto res1 = j.emplace("baz", "bam");
+    EXPECT_EQ(res1.second, true);
+    EXPECT_EQ(*res1.first, "bam");
+
+    // add an existing key
+    auto res2 = j.emplace("foo", "bad");
+    EXPECT_EQ(res2.second, false);
+    EXPECT_EQ(*res2.first, "bar");
+
+    // check final object
+    EXPECT_EQ(j, json({{"baz", "bam"}, {"foo", "bar"}}));
+}
+
+TEST(JsonEmplaceObjectTest, Other)
+{
+    json j = 1;
+    EXPECT_THROW_MSG(j.emplace("foo", "bar"), json::type_error,
+                     "[json.exception.type_error.311] cannot use emplace() with number");
+}
+
+TEST(JsonPlusEqualArrayTest, RRefNull)
+{
+    json j;
+    j += 1;
+    j += 2;
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2}));
+}
+
+TEST(JsonPlusEqualArrayTest, RRefArray)
+{
+    json j = {1, 2, 3};
+    j += "Hello";
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2, 3, "Hello"}));
+}
+
+TEST(JsonPlusEqualArrayTest, RRefOther)
+{
+    json j = 1;
+    EXPECT_THROW_MSG(j += "Hello", json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with number");
+}
+
+TEST(JsonPlusEqualArrayTest, LRefNull)
+{
+    json j;
+    json k(1);
+    j += k;
+    j += k;
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 1}));
+}
+
+TEST(JsonPlusEqualArrayTest, LRefArray)
+{
+    json j = {1, 2, 3};
+    json k("Hello");
+    j += k;
+    EXPECT_EQ(j.type(), json::value_t::array);
+    EXPECT_EQ(j, json({1, 2, 3, "Hello"}));
+}
+
+TEST(JsonPlusEqualArrayTest, LRefOther)
+{
+    json j = 1;
+    json k("Hello");
+    EXPECT_THROW_MSG(j += k, json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with number");
+}
+#if 0
+TEST(JsonPlusEqualObjectTest, Null)
+{
+    json j;
+    j += json::object_t::value_type({"one", 1});
+    j += json::object_t::value_type({"two", 2});
+    EXPECT_EQ(j.type(), json::value_t::object);
+    EXPECT_EQ(j.size(), 2u);
+    EXPECT_EQ(j["one"], json(1));
+    EXPECT_EQ(j["two"], json(2));
+}
+
+TEST(JsonPlusEqualObjectTest, Object)
+{
+    json j(json::value_t::object);
+    j += json::object_t::value_type({"one", 1});
+    j += json::object_t::value_type({"two", 2});
+    EXPECT_EQ(j.size(), 2u);
+    EXPECT_EQ(j["one"], json(1));
+    EXPECT_EQ(j["two"], json(2));
+}
+
+TEST(JsonPlusEqualObjectTest, Other)
+{
+    json j = 1;
+    json k("Hello");
+    EXPECT_THROW_MSG(j += json::object_t::value_type({"one", 1}), json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with number");
+}
+#endif
+TEST(JsonPlusEqualInitListTest, Null)
+{
+    json j;
+    j += {"foo", "bar"};
+    EXPECT_EQ(j, json::array({{"foo", "bar"}}));
+
+    json k;
+    k += {1, 2, 3};
+    EXPECT_EQ(k, json::array({{1, 2, 3}}));
+}
+
+TEST(JsonPlusEqualInitListTest, Array)
+{
+    json j = {1, 2, 3};
+    j += {"foo", "bar"};
+    EXPECT_EQ(j, json({1, 2, 3, {"foo", "bar"}}));
+
+    json k = {1, 2, 3};
+    k += {1, 2, 3};
+    EXPECT_EQ(k, json({1, 2, 3, {1, 2, 3}}));
+}
+
+TEST(JsonPlusEqualInitListTest, Object)
+{
+    json j = {{"key1", 1}};
+    j += {"key2", "bar"};
+    EXPECT_EQ(j, json({{"key1", 1}, {"key2", "bar"}}));
+
+    json k = {{"key1", 1}};
+    EXPECT_THROW_MSG((k += {1, 2, 3, 4}), json::type_error,
+                     "[json.exception.type_error.308] cannot use push_back() with object");
+}
+
+class JsonInsertTest : public ::testing::Test {
+ protected:
+    json j_array = {1, 2, 3, 4};
+    json j_value = 5;
+    json j_other_array = {"first", "second"};
+    json j_object1 = {{"one", "eins"}, {"two", "zwei"}};
+    json j_object2 = {{"eleven", "elf"}, {"seventeen", "siebzehn"}};
+};
+
+TEST_F(JsonInsertTest, ValueBegin)
+{
+    auto it = j_array.insert(j_array.begin(), j_value);
+    EXPECT_EQ(j_array.size(), 5u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ(j_array.begin(), it);
+    EXPECT_EQ(j_array, json({5, 1, 2, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, ValueMiddle)
+{
+    auto it = j_array.insert(j_array.begin() + 2, j_value);
+    EXPECT_EQ(j_array.size(), 5u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ((it - j_array.begin()), 2);
+    EXPECT_EQ(j_array, json({1, 2, 5, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, ValueEnd)
+{
+    auto it = j_array.insert(j_array.end(), j_value);
+    EXPECT_EQ(j_array.size(), 5u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ((j_array.end() - it), 1);
+    EXPECT_EQ(j_array, json({1, 2, 3, 4, 5}));
+}
+
+TEST_F(JsonInsertTest, RvalueBegin)
+{
+    auto it = j_array.insert(j_array.begin(), 5);
+    EXPECT_EQ(j_array.size(), 5u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ(j_array.begin(), it);
+    EXPECT_EQ(j_array, json({5, 1, 2, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, RvalueMiddle)
+{
+    auto it = j_array.insert(j_array.begin() + 2, 5);
+    EXPECT_EQ(j_array.size(), 5u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ((it - j_array.begin()), 2);
+    EXPECT_EQ(j_array, json({1, 2, 5, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, RvalueEnd)
+{
+    auto it = j_array.insert(j_array.end(), 5);
+    EXPECT_EQ(j_array.size(), 5u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ((j_array.end() - it), 1);
+    EXPECT_EQ(j_array, json({1, 2, 3, 4, 5}));
+}
+
+TEST_F(JsonInsertTest, CopyBegin)
+{
+    auto it = j_array.insert(j_array.begin(), 3, 5);
+    EXPECT_EQ(j_array.size(), 7u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ(j_array.begin(), it);
+    EXPECT_EQ(j_array, json({5, 5, 5, 1, 2, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, CopyMiddle)
+{
+    auto it = j_array.insert(j_array.begin() + 2, 3, 5);
+    EXPECT_EQ(j_array.size(), 7u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ((it - j_array.begin()), 2);
+    EXPECT_EQ(j_array, json({1, 2, 5, 5, 5, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, CopyEnd)
+{
+    auto it = j_array.insert(j_array.end(), 3, 5);
+    EXPECT_EQ(j_array.size(), 7u);
+    EXPECT_EQ(*it, j_value);
+    EXPECT_EQ((j_array.end() - it), 3);
+    EXPECT_EQ(j_array, json({1, 2, 3, 4, 5, 5, 5}));
+}
+
+TEST_F(JsonInsertTest, CopyNothing)
+{
+    auto it = j_array.insert(j_array.end(), 0, 5);
+    EXPECT_EQ(j_array.size(), 4u);
+    // the returned iterator points to the first inserted element;
+    // there were 4 elements, so it should point to the 5th
+    EXPECT_EQ(it, j_array.begin() + 4);
+    EXPECT_EQ(j_array, json({1, 2, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, RangeForArrayProper)
+{
+    auto it = j_array.insert(j_array.end(), j_other_array.begin(), j_other_array.end());
+    EXPECT_EQ(j_array.size(), 6u);
+    EXPECT_EQ(*it, *j_other_array.begin());
+    EXPECT_EQ((j_array.end() - it), 2);
+    EXPECT_EQ(j_array, json({1, 2, 3, 4, "first", "second"}));
+}
+
+TEST_F(JsonInsertTest, RangeForArrayEmpty)
+{
+    auto it = j_array.insert(j_array.end(), j_other_array.begin(), j_other_array.begin());
+    EXPECT_EQ(j_array.size(), 4u);
+    EXPECT_EQ(it, j_array.end());
+    EXPECT_EQ(j_array, json({1, 2, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, RangeForArrayInvalid)
+{
+    json j_other_array2 = {"first", "second"};
+
+    EXPECT_THROW_MSG(j_array.insert(j_array.end(), j_array.begin(), j_array.end()),
+                    json::invalid_iterator,
+                    "[json.exception.invalid_iterator.211] passed iterators may not belong to container");
+    EXPECT_THROW_MSG(j_array.insert(j_array.end(), j_other_array.begin(), j_other_array2.end()),
+                    json::invalid_iterator,
+                    "[json.exception.invalid_iterator.210] iterators do not fit");
+}
+
+TEST_F(JsonInsertTest, RangeForObjectProper)
+{
+    j_object1.insert(j_object2.begin(), j_object2.end());
+    EXPECT_EQ(j_object1.size(), 4u);
+}
+
+TEST_F(JsonInsertTest, RangeForObjectEmpty)
+{
+    j_object1.insert(j_object2.begin(), j_object2.begin());
+    EXPECT_EQ(j_object1.size(), 2u);
+}
+
+TEST_F(JsonInsertTest, RangeForObjectInvalid)
+{
+    json j_other_array2 = {"first", "second"};
+
+    EXPECT_THROW_MSG(j_array.insert(j_object2.begin(), j_object2.end()), json::type_error,
+                     "[json.exception.type_error.309] cannot use insert() with array");
+    EXPECT_THROW_MSG(j_object1.insert(j_object1.begin(), j_object2.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.210] iterators do not fit");
+    EXPECT_THROW_MSG(j_object1.insert(j_array.begin(), j_array.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterators first and last must point to objects");
+}
+
+TEST_F(JsonInsertTest, InitListBegin)
+{
+    auto it = j_array.insert(j_array.begin(), {7, 8, 9});
+    EXPECT_EQ(j_array.size(), 7u);
+    EXPECT_EQ(*it, json(7));
+    EXPECT_EQ(j_array.begin(), it);
+    EXPECT_EQ(j_array, json({7, 8, 9, 1, 2, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, InitListMiddle)
+{
+    auto it = j_array.insert(j_array.begin() + 2, {7, 8, 9});
+    EXPECT_EQ(j_array.size(), 7u);
+    EXPECT_EQ(*it, json(7));
+    EXPECT_EQ((it - j_array.begin()), 2);
+    EXPECT_EQ(j_array, json({1, 2, 7, 8, 9, 3, 4}));
+}
+
+TEST_F(JsonInsertTest, InitListEnd)
+{
+    auto it = j_array.insert(j_array.end(), {7, 8, 9});
+    EXPECT_EQ(j_array.size(), 7u);
+    EXPECT_EQ(*it, json(7));
+    EXPECT_EQ((j_array.end() - it), 3);
+    EXPECT_EQ(j_array, json({1, 2, 3, 4, 7, 8, 9}));
+}
+
+TEST_F(JsonInsertTest, InvalidIterator)
+{
+    // pass iterator to a different array
+    json j_another_array = {1, 2};
+    json j_yet_another_array = {"first", "second"};
+    EXPECT_THROW_MSG(j_array.insert(j_another_array.end(), 10), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(j_array.insert(j_another_array.end(), j_value), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(j_array.insert(j_another_array.end(), 10, 11), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(j_array.insert(j_another_array.end(), j_yet_another_array.begin(), j_yet_another_array.end()), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+    EXPECT_THROW_MSG(j_array.insert(j_another_array.end(), {1, 2, 3, 4}), json::invalid_iterator,
+                     "[json.exception.invalid_iterator.202] iterator does not fit current value");
+}
+
+TEST_F(JsonInsertTest, NonArray)
+{
+    // call insert on a non-array type
+    json j_nonarray = 3;
+    json j_yet_another_array = {"first", "second"};
+    EXPECT_THROW_MSG(j_nonarray.insert(j_nonarray.end(), 10), json::type_error,
+                     "[json.exception.type_error.309] cannot use insert() with number");
+    EXPECT_THROW_MSG(j_nonarray.insert(j_nonarray.end(), j_value), json::type_error,
+                     "[json.exception.type_error.309] cannot use insert() with number");
+    EXPECT_THROW_MSG(j_nonarray.insert(j_nonarray.end(), 10, 11), json::type_error,
+                     "[json.exception.type_error.309] cannot use insert() with number");
+    EXPECT_THROW_MSG(j_nonarray.insert(j_nonarray.end(), j_yet_another_array.begin(),
+                                       j_yet_another_array.end()), json::type_error,
+                     "[json.exception.type_error.309] cannot use insert() with number");
+    EXPECT_THROW_MSG(j_nonarray.insert(j_nonarray.end(), {1, 2, 3, 4}), json::type_error,
+                     "[json.exception.type_error.309] cannot use insert() with number");
+}
+
+TEST(JsonSwapTest, JsonMember)
+{
+    json j("hello world");
+    json k(42.23);
+
+    j.swap(k);
+
+    EXPECT_EQ(j, json(42.23));
+    EXPECT_EQ(k, json("hello world"));
+}
+
+TEST(JsonSwapTest, JsonNonMember)
+{
+    json j("hello world");
+    json k(42.23);
+
+    std::swap(j, k);
+
+    EXPECT_EQ(j, json(42.23));
+    EXPECT_EQ(k, json("hello world"));
+}
+
+TEST(JsonSwapTest, ArrayT)
+{
+    json j = {1, 2, 3, 4};
+    json::array_t a = {"foo", "bar", "baz"};
+
+    j.swap(a);
+
+    EXPECT_EQ(j, json({"foo", "bar", "baz"}));
+
+    j.swap(a);
+
+    EXPECT_EQ(j, json({1, 2, 3, 4}));
+}
+
+TEST(JsonSwapTest, NonArrayT)
+{
+    json j = 17;
+    json::array_t a = {"foo", "bar", "baz"};
+
+    EXPECT_THROW_MSG(j.swap(a), json::type_error,
+                     "[json.exception.type_error.310] cannot use swap() with number");
+}
+
+TEST(JsonSwapTest, ObjectT)
+{
+    json j = {{"one", 1}, {"two", 2}};
+    json::object_t o = {{"cow", "Kuh"}, {"chicken", "Huhn"}};
+
+    j.swap(o);
+
+    EXPECT_EQ(j, json({{"cow", "Kuh"}, {"chicken", "Huhn"}}));
+
+    j.swap(o);
+
+    EXPECT_EQ(j, json({{"one", 1}, {"two", 2}}));
+}
+
+TEST(JsonSwapTest, NonObjectT)
+{
+    json j = 17;
+    json::object_t o = {{"cow", "Kuh"}, {"chicken", "Huhn"}};
+
+    EXPECT_THROW_MSG(j.swap(o), json::type_error,
+                     "[json.exception.type_error.310] cannot use swap() with number");
+}
+
+TEST(JsonSwapTest, StringT)
+{
+    json j = "Hello world";
+    json::string_t s = "Hallo Welt";
+
+    j.swap(s);
+
+    EXPECT_EQ(j, json("Hallo Welt"));
+
+    j.swap(s);
+
+    EXPECT_EQ(j, json("Hello world"));
+}
+
+TEST(JsonSwapTest, NonStringT)
+{
+    json j = 17;
+    json::string_t s = "Hallo Welt";
+
+    EXPECT_THROW_MSG(j.swap(s), json::type_error,
+                     "[json.exception.type_error.310] cannot use swap() with number");
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-msgpack.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-msgpack.cpp
new file mode 100644
index 0000000..798bbba
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-msgpack.cpp
@@ -0,0 +1,1257 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) FIRST 2017. All Rights Reserved.                             */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+#include <fstream>
+
+TEST(MessagePackDiscardedTest, Case)
+{
+    // discarded values are not serialized
+    json j = json::value_t::discarded;
+    const auto result = json::to_msgpack(j);
+    EXPECT_TRUE(result.empty());
+}
+
+TEST(MessagePackNullTest, Case)
+{
+    json j = nullptr;
+    std::string expected = "\xc0";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+TEST(MessagePackBooleanTest, True)
+{
+    json j = true;
+    std::string expected = "\xc3";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+TEST(MessagePackBooleanTest, False)
+{
+    json j = false;
+    std::string expected = "\xc2";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// -32..-1 (negative fixnum)
+TEST(MessagePackSignedTest, Neg0)
+{
+    for (auto i = -32; i <= -1; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        EXPECT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 1u);
+
+        // check individual bytes
+        EXPECT_EQ(static_cast<int8_t>(result[0]), i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 0..127 (positive fixnum)
+TEST(MessagePackSignedTest, Pos0)
+{
+    for (size_t i = 0; i <= 127; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = -1;
+        j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
+
+        // check type
+        EXPECT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 1u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(i));
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 128..255 (int 8)
+TEST(MessagePackSignedTest, Pos1)
+{
+    for (size_t i = 128; i <= 255; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = -1;
+        j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
+
+        // check type
+        EXPECT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xcc));
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 2u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(0xcc));
+        uint8_t restored = static_cast<uint8_t>(result[1]);
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 256..65535 (int 16)
+TEST(MessagePackSignedTest, Pos2)
+{
+    for (size_t i = 256; i <= 65535; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = -1;
+        j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
+
+        // check type
+        EXPECT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xcd));
+        expected.push_back(static_cast<char>((i >> 8) & 0xff));
+        expected.push_back(static_cast<char>(i & 0xff));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(0xcd));
+        uint16_t restored = static_cast<uint16_t>(static_cast<uint8_t>(result[1]) * 256 + static_cast<uint8_t>(result[2]));
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 65536..4294967295 (int 32)
+class MessagePackSignedPos4Test : public ::testing::TestWithParam<uint32_t> {};
+TEST_P(MessagePackSignedPos4Test, Case)
+{
+    // create JSON value with integer number
+    json j = -1;
+    j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(GetParam());
+
+    // check type
+    EXPECT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0xce));
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), 5u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], static_cast<char>(0xce));
+    uint32_t restored = (static_cast<uint32_t>(static_cast<uint8_t>(result[1])) << 030) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[2])) << 020) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[3])) << 010) +
+                        static_cast<uint32_t>(static_cast<uint8_t>(result[4]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+static const uint32_t pos4_numbers[] = {
+    65536u,
+    77777u,
+    1048576u,
+    4294967295u,
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackSignedPos4Tests, MessagePackSignedPos4Test,
+                        ::testing::ValuesIn(pos4_numbers), );
+
+// 4294967296..9223372036854775807 (int 64)
+class MessagePackSignedPos8Test : public ::testing::TestWithParam<uint64_t> {};
+TEST_P(MessagePackSignedPos8Test, Case)
+{
+    // create JSON value with integer number
+    json j = -1;
+    j.get_ref<json::number_integer_t&>() =
+        static_cast<json::number_integer_t>(GetParam());
+
+    // check type
+    EXPECT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0xcf));
+    expected.push_back(static_cast<char>((GetParam() >> 070) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 060) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 050) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 040) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 030) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 020) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 010) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), 9u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], static_cast<char>(0xcf));
+    uint64_t restored = (static_cast<uint64_t>(static_cast<uint8_t>(result[1])) << 070) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[2])) << 060) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[3])) << 050) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[4])) << 040) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[5])) << 030) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[6])) << 020) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[7])) << 010) +
+                        static_cast<uint64_t>(static_cast<uint8_t>(result[8]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+static const uint64_t pos8_numbers[] = {
+    4294967296lu,
+    9223372036854775807lu,
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackSignedPos8Tests, MessagePackSignedPos8Test,
+                        ::testing::ValuesIn(pos8_numbers), );
+
+// -128..-33 (int 8)
+TEST(MessagePackSignedTest, Neg1)
+{
+    for (auto i = -128; i <= -33; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        EXPECT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xd0));
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 2u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(0xd0));
+        EXPECT_EQ(static_cast<int8_t>(result[1]), i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// -32768..-129 (int 16)
+TEST(MessagePackSignedTest, Neg2)
+{
+    for (int16_t i = -32768; i <= -129; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with integer number
+        json j = i;
+
+        // check type
+        EXPECT_TRUE(j.is_number_integer());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xd1));
+        expected.push_back(static_cast<char>((i >> 8) & 0xff));
+        expected.push_back(static_cast<char>(i & 0xff));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(0xd1));
+        int16_t restored = static_cast<int16_t>((static_cast<uint8_t>(result[1]) << 8) +
+                                                static_cast<uint8_t>(result[2]));
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// -32769..-2147483648
+class MessagePackSignedNeg4Test : public ::testing::TestWithParam<int32_t> {};
+TEST_P(MessagePackSignedNeg4Test, Case)
+{
+    // create JSON value with integer number
+    json j = GetParam();
+
+    // check type
+    EXPECT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0xd2));
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), 5u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], static_cast<char>(0xd2));
+    uint32_t restored = (static_cast<uint32_t>(static_cast<uint8_t>(result[1])) << 030) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[2])) << 020) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[3])) << 010) +
+                        static_cast<uint32_t>(static_cast<uint8_t>(result[4]));
+    EXPECT_EQ(static_cast<int32_t>(restored), GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+static const int32_t neg4_numbers[] = {
+    -32769,
+    -65536,
+    -77777,
+    -1048576,
+    -2147483648ll,
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackSignedNeg4Tests, MessagePackSignedNeg4Test,
+                        ::testing::ValuesIn(neg4_numbers), );
+
+// -9223372036854775808..-2147483649 (int 64)
+class MessagePackSignedNeg8Test : public ::testing::TestWithParam<int64_t> {};
+TEST_P(MessagePackSignedNeg8Test, Case)
+{
+    // create JSON value with unsigned integer number
+    json j = GetParam();
+
+    // check type
+    EXPECT_TRUE(j.is_number_integer());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0xd3));
+    expected.push_back(static_cast<char>((GetParam() >> 070) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 060) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 050) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 040) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 030) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 020) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 010) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), 9u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], static_cast<char>(0xd3));
+    int64_t restored = (static_cast<int64_t>(static_cast<uint8_t>(result[1])) << 070) +
+                       (static_cast<int64_t>(static_cast<uint8_t>(result[2])) << 060) +
+                       (static_cast<int64_t>(static_cast<uint8_t>(result[3])) << 050) +
+                       (static_cast<int64_t>(static_cast<uint8_t>(result[4])) << 040) +
+                       (static_cast<int64_t>(static_cast<uint8_t>(result[5])) << 030) +
+                       (static_cast<int64_t>(static_cast<uint8_t>(result[6])) << 020) +
+                       (static_cast<int64_t>(static_cast<uint8_t>(result[7])) << 010) +
+                       static_cast<int64_t>(static_cast<uint8_t>(result[8]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+static const int64_t neg8_numbers[] = {
+    INT64_MIN,
+    -2147483649ll,
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackSignedNeg8Tests, MessagePackSignedNeg8Test,
+                        ::testing::ValuesIn(neg8_numbers), );
+
+// 0..127 (positive fixnum)
+TEST(MessagePackUnsignedTest, Pos0)
+{
+    for (size_t i = 0; i <= 127; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with unsigned integer number
+        json j = i;
+
+        // check type
+        EXPECT_TRUE(j.is_number_unsigned());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 1u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(i));
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 128..255 (uint 8)
+TEST(MessagePackUnsignedTest, Pos1)
+{
+    for (size_t i = 128; i <= 255; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with unsigned integer number
+        json j = i;
+
+        // check type
+        EXPECT_TRUE(j.is_number_unsigned());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xcc));
+        expected.push_back(static_cast<char>(i));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 2u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(0xcc));
+        uint8_t restored = static_cast<uint8_t>(result[1]);
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 256..65535 (uint 16)
+TEST(MessagePackUnsignedTest, Pos2)
+{
+    for (size_t i = 256; i <= 65535; ++i)
+    {
+        SCOPED_TRACE(i);
+
+        // create JSON value with unsigned integer number
+        json j = i;
+
+        // check type
+        EXPECT_TRUE(j.is_number_unsigned());
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xcd));
+        expected.push_back(static_cast<char>((i >> 8) & 0xff));
+        expected.push_back(static_cast<char>(i & 0xff));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), 3u);
+
+        // check individual bytes
+        EXPECT_EQ(result[0], static_cast<char>(0xcd));
+        uint16_t restored = static_cast<uint16_t>(static_cast<uint8_t>(result[1]) * 256 + static_cast<uint8_t>(result[2]));
+        EXPECT_EQ(restored, i);
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// 65536..4294967295 (uint 32)
+class MessagePackUnsignedPos4Test : public ::testing::TestWithParam<uint32_t> {};
+TEST_P(MessagePackUnsignedPos4Test, Case)
+{
+    // create JSON value with unsigned integer number
+    json j = GetParam();
+
+    // check type
+    EXPECT_TRUE(j.is_number_unsigned());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0xce));
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), 5u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], static_cast<char>(0xce));
+    uint32_t restored = (static_cast<uint32_t>(static_cast<uint8_t>(result[1])) << 030) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[2])) << 020) +
+                        (static_cast<uint32_t>(static_cast<uint8_t>(result[3])) << 010) +
+                        static_cast<uint32_t>(static_cast<uint8_t>(result[4]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+INSTANTIATE_TEST_CASE_P(MessagePackUnsignedPos4Tests,
+                        MessagePackUnsignedPos4Test,
+                        ::testing::ValuesIn(pos4_numbers), );
+
+// 4294967296..18446744073709551615 (uint 64)
+class MessagePackUnsignedPos8Test : public ::testing::TestWithParam<uint64_t> {};
+TEST_P(MessagePackUnsignedPos8Test, Case)
+{
+    // create JSON value with unsigned integer number
+    json j = GetParam();
+
+    // check type
+    EXPECT_TRUE(j.is_number_unsigned());
+
+    // create expected byte vector
+    std::string expected;
+    expected.push_back(static_cast<char>(0xcf));
+    expected.push_back(static_cast<char>((GetParam() >> 070) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 060) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 050) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 040) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 030) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 020) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 010) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), 9u);
+
+    // check individual bytes
+    EXPECT_EQ(result[0], static_cast<char>(0xcf));
+    uint64_t restored = (static_cast<uint64_t>(static_cast<uint8_t>(result[1])) << 070) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[2])) << 060) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[3])) << 050) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[4])) << 040) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[5])) << 030) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[6])) << 020) +
+                        (static_cast<uint64_t>(static_cast<uint8_t>(result[7])) << 010) +
+                        static_cast<uint64_t>(static_cast<uint8_t>(result[8]));
+    EXPECT_EQ(restored, GetParam());
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+INSTANTIATE_TEST_CASE_P(MessagePackUnsignedPos8Tests,
+                        MessagePackUnsignedPos8Test,
+                        ::testing::ValuesIn(pos8_numbers), );
+
+// 3.1415925
+TEST(MessagePackFloatTest, Number)
+{
+    double v = 3.1415925;
+    json j = v;
+    std::string expected = "\xcb\x40\x09\x21\xfb\x3f\xa6\xde\xfc";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+    EXPECT_EQ(json::from_msgpack(result), v);
+}
+
+// N = 0..31
+TEST(MessagePackStringTest, String1)
+{
+    // explicitly enumerate the first byte for all 32 strings
+    const std::vector<uint8_t> first_bytes =
+    {
+        0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
+        0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1,
+        0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba,
+        0xbb, 0xbc, 0xbd, 0xbe, 0xbf
+    };
+
+    for (size_t N = 0; N < first_bytes.size(); ++N)
+    {
+        SCOPED_TRACE(N);
+
+        // create JSON value with string containing of N * 'x'
+        const auto s = std::string(N, 'x');
+        json j = s;
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(first_bytes[N]));
+        expected.append(s);
+
+        // check first byte
+        EXPECT_EQ((first_bytes[N] & 0x1f), static_cast<char>(N));
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), N + 1);
+        // check that no null byte is appended
+        if (N > 0)
+        {
+            EXPECT_NE(result.back(), '\x00');
+        }
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// N = 32..255
+TEST(MessagePackStringTest, String2)
+{
+    for (size_t N = 32; N <= 255; ++N)
+    {
+        SCOPED_TRACE(N);
+
+        // create JSON value with string containing of N * 'x'
+        const auto s = std::string(N, 'x');
+        json j = s;
+
+        // create expected byte vector
+        std::string expected;
+        expected.push_back(static_cast<char>(0xd9));
+        expected.push_back(static_cast<char>(N));
+        expected.append(s);
+
+        // compare result + size
+        const auto result = json::to_msgpack(j);
+        EXPECT_EQ(result, expected);
+        EXPECT_EQ(result.size(), N + 2);
+        // check that no null byte is appended
+        EXPECT_NE(result.back(), '\x00');
+
+        // roundtrip
+        EXPECT_EQ(json::from_msgpack(result), j);
+    }
+}
+
+// N = 256..65535
+class MessagePackString3Test : public ::testing::TestWithParam<size_t> {};
+TEST_P(MessagePackString3Test, Case)
+{
+    // create JSON value with string containing of N * 'x'
+    const auto s = std::string(GetParam(), 'x');
+    json j = s;
+
+    // create expected byte vector (hack: create string first)
+    std::string expected;
+    expected.push_back(static_cast<char>(0xda));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+    expected.append(s);
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), GetParam() + 3);
+    // check that no null byte is appended
+    EXPECT_NE(result.back(), '\x00');
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+static size_t string3_lens[] = {
+    256u,
+    999u,
+    1025u,
+    3333u,
+    2048u,
+    65535u
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackString3Tests, MessagePackString3Test,
+                        ::testing::ValuesIn(string3_lens), );
+
+
+// N = 65536..4294967295
+class MessagePackString5Test : public ::testing::TestWithParam<size_t> {};
+TEST_P(MessagePackString5Test, Case)
+{
+    // create JSON value with string containing of N * 'x'
+    const auto s = std::string(GetParam(), 'x');
+    json j = s;
+
+    // create expected byte vector (hack: create string first)
+    std::string expected;
+    expected.push_back(static_cast<char>(0xdb));
+    expected.push_back(static_cast<char>((GetParam() >> 24) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 16) & 0xff));
+    expected.push_back(static_cast<char>((GetParam() >> 8) & 0xff));
+    expected.push_back(static_cast<char>(GetParam() & 0xff));
+    expected.append(s);
+
+    // compare result + size
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+    EXPECT_EQ(result.size(), GetParam() + 5);
+    // check that no null byte is appended
+    EXPECT_NE(result.back(), '\x00');
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+static size_t string5_lens[] = {
+    65536u,
+    77777u,
+    1048576u
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackString5Tests, MessagePackString5Test,
+                        ::testing::ValuesIn(string5_lens), );
+
+TEST(MessagePackArrayTest, Empty)
+{
+    json j = json::array();
+    std::string expected = "\x90";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// [null]
+TEST(MessagePackArrayTest, Null)
+{
+    json j = {nullptr};
+    std::string expected = "\x91\xc0";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// [1,2,3,4,5]
+TEST(MessagePackArrayTest, Simple)
+{
+    json j = json::parse("[1,2,3,4,5]");
+    std::string expected = "\x95\x01\x02\x03\x04\x05";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// [[[[]]]]
+TEST(MessagePackArrayTest, NestEmpty)
+{
+    json j = json::parse("[[[[]]]]");
+    std::string expected = "\x91\x91\x91\x90";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// array 16
+TEST(MessagePackArrayTest, UInt16)
+{
+    json j(16, nullptr);
+    std::string expected(j.size() + 3, static_cast<char>(0xc0)); // all null
+    expected[0] = static_cast<char>(0xdc); // array 16
+    expected[1] = 0x00; // size (0x0010), byte 0
+    expected[2] = 0x10; // size (0x0010), byte 1
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// array 32
+TEST(MessagePackArrayTest, UInt32)
+{
+    json j(65536, nullptr);
+    std::string expected(j.size() + 5, static_cast<char>(0xc0)); // all null
+    expected[0] = static_cast<char>(0xdd); // array 32
+    expected[1] = 0x00; // size (0x00100000), byte 0
+    expected[2] = 0x01; // size (0x00100000), byte 1
+    expected[3] = 0x00; // size (0x00100000), byte 2
+    expected[4] = 0x00; // size (0x00100000), byte 3
+    const auto result = json::to_msgpack(j);
+    //EXPECT_EQ(result, expected);
+
+    EXPECT_EQ(result.size(), expected.size());
+    for (size_t i = 0; i < expected.size(); ++i)
+    {
+        SCOPED_TRACE(i);
+        EXPECT_EQ(result[i], expected[i]);
+    }
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+TEST(MessagePackObjectTest, Empty)
+{
+    json j = json::object();
+    std::string expected = "\x80";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// {"":null}
+TEST(MessagePackObjectTest, EmptyKey)
+{
+    json j = {{"", nullptr}};
+    std::string expected = "\x81\xa0\xc0";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// {"a": {"b": {"c": {}}}}
+TEST(MessagePackObjectTest, NestedEmpty)
+{
+    json j = json::parse("{\"a\": {\"b\": {\"c\": {}}}}");
+    std::string expected = "\x81\xa1\x61\x81\xa1\x62\x81\xa1\x63\x80";
+    const auto result = json::to_msgpack(j);
+    EXPECT_EQ(result, expected);
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// map 16
+TEST(MessagePackObjectTest, UInt16)
+{
+    json j = R"({"00": null, "01": null, "02": null, "03": null,
+                 "04": null, "05": null, "06": null, "07": null,
+                 "08": null, "09": null, "10": null, "11": null,
+                 "12": null, "13": null, "14": null, "15": null})"_json;
+
+    const auto result = json::to_msgpack(j);
+
+    // Checking against an expected vector byte by byte is
+    // difficult, because no assumption on the order of key/value
+    // pairs are made. We therefore only check the prefix (type and
+    // size and the overall size. The rest is then handled in the
+    // roundtrip check.
+    EXPECT_EQ(result.size(), 67u); // 1 type, 2 size, 16*4 content
+    EXPECT_EQ(result[0], static_cast<char>(0xde)); // map 16
+    EXPECT_EQ(result[1], 0x00); // byte 0 of size (0x0010)
+    EXPECT_EQ(result[2], 0x10); // byte 1 of size (0x0010)
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// map 32
+TEST(MessagePackObjectTest, UInt32)
+{
+    json j;
+    for (auto i = 0; i < 65536; ++i)
+    {
+        // format i to a fixed width of 5
+        // each entry will need 7 bytes: 6 for fixstr, 1 for null
+        std::stringstream ss;
+        ss << std::setw(5) << std::setfill('0') << i;
+        j.emplace(ss.str(), nullptr);
+    }
+
+    const auto result = json::to_msgpack(j);
+
+    // Checking against an expected vector byte by byte is
+    // difficult, because no assumption on the order of key/value
+    // pairs are made. We therefore only check the prefix (type and
+    // size and the overall size. The rest is then handled in the
+    // roundtrip check.
+    EXPECT_EQ(result.size(), 458757u); // 1 type, 4 size, 65536*7 content
+    EXPECT_EQ(result[0], static_cast<char>(0xdf)); // map 32
+    EXPECT_EQ(result[1], 0x00); // byte 0 of size (0x00010000)
+    EXPECT_EQ(result[2], 0x01); // byte 1 of size (0x00010000)
+    EXPECT_EQ(result[3], 0x00); // byte 2 of size (0x00010000)
+    EXPECT_EQ(result[4], 0x00); // byte 3 of size (0x00010000)
+
+    // roundtrip
+    EXPECT_EQ(json::from_msgpack(result), j);
+}
+
+// from float32
+TEST(MessagePackFloat32Test, Case)
+{
+    auto given = std::string("\xca\x41\xc8\x00\x01", 5);
+    json j = json::from_msgpack(given);
+    EXPECT_LT(std::fabs(j.get<double>() - 25), 0.001);
+}
+
+TEST(MessagePackErrorTest, TooShortByteVector)
+{
+    EXPECT_THROW_MSG(json::from_msgpack("\xcc"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack("\xcd"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcd\x00", 2)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 3: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack("\xce"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xce\x00", 2)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 3: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xce\x00\x00", 3)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 4: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xce\x00\x00\x00", 4)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 5: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack("\xcf"), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 2: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00", 2)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 3: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00\x00", 3)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 4: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00\x00\x00", 4)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 5: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00\x00\x00\x00", 5)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 6: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00\x00\x00\x00\x00", 6)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 7: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00\x00\x00\x00\x00\x00", 7)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 8: unexpected end of input");
+    EXPECT_THROW_MSG(json::from_msgpack(llvm::StringRef("\xcf\x00\x00\x00\x00\x00\x00\x00", 8)), json::parse_error,
+                     "[json.exception.parse_error.110] parse error at 9: unexpected end of input");
+}
+
+TEST(MessagePackErrorTest, UnsupportedBytesConcrete)
+{
+    EXPECT_THROW_MSG(json::from_msgpack("\xc1"), json::parse_error,
+                     "[json.exception.parse_error.112] parse error at 1: error reading MessagePack; last byte: 0xc1");
+    EXPECT_THROW_MSG(json::from_msgpack("\xc6"), json::parse_error,
+                     "[json.exception.parse_error.112] parse error at 1: error reading MessagePack; last byte: 0xc6");
+}
+
+TEST(MessagePackErrorTest, UnsupportedBytesAll)
+{
+    for (auto byte :
+            {
+                // never used
+                0xc1,
+                // bin
+                0xc4, 0xc5, 0xc6,
+                // ext
+                0xc7, 0xc8, 0xc9,
+                // fixext
+                0xd4, 0xd5, 0xd6, 0xd7, 0xd8
+            })
+    {
+        EXPECT_THROW(json::from_msgpack(std::string(1, static_cast<char>(byte))), json::parse_error);
+    }
+}
+#if 0
+// use this testcase outside [hide] to run it with Valgrind
+TEST(MessagePackRoundtripTest, Sample)
+{
+    std::string filename = "test/data/json_testsuite/sample.json";
+
+    // parse JSON file
+    std::ifstream f_json(filename);
+    json j1 = json::parse(f_json);
+
+    // parse MessagePack file
+    std::ifstream f_msgpack(filename + ".msgpack", std::ios::binary);
+    std::vector<uint8_t> packed((std::istreambuf_iterator<char>(f_msgpack)),
+                                std::istreambuf_iterator<char>());
+    json j2;
+    EXPECT_NO_THROW(j2 = json::from_msgpack(packed));
+
+    // compare parsed JSON values
+    EXPECT_EQ(j1, j2);
+
+    // check with different start index
+    packed.insert(packed.begin(), 5, 0xff);
+    EXPECT_EQ(j1, json::from_msgpack(packed, 5));
+}
+
+class MessagePackRegressionTest : public ::testing::TestWithParam<const char*> {};
+TEST_P(MessagePackRegressionTest, Case)
+{
+    // parse JSON file
+    std::ifstream f_json(GetParam());
+    json j1 = json::parse(f_json);
+
+    // parse MessagePack file
+    std::ifstream f_msgpack(filename + ".msgpack", std::ios::binary);
+    std::vector<uint8_t> packed((std::istreambuf_iterator<char>(f_msgpack)),
+                                std::istreambuf_iterator<char>());
+    json j2;
+    EXPECT_NO_THROW(j2 = json::from_msgpack(packed));
+
+    // compare parsed JSON values
+    EXPECT_EQ(j1, j2);
+}
+
+static const char* regression_test_cases[] = {
+    "test/data/json_nlohmann_tests/all_unicode.json",
+    "test/data/json.org/1.json",
+    "test/data/json.org/2.json",
+    "test/data/json.org/3.json",
+    "test/data/json.org/4.json",
+    "test/data/json.org/5.json",
+    "test/data/json_roundtrip/roundtrip01.json",
+    "test/data/json_roundtrip/roundtrip02.json",
+    "test/data/json_roundtrip/roundtrip03.json",
+    "test/data/json_roundtrip/roundtrip04.json",
+    "test/data/json_roundtrip/roundtrip05.json",
+    "test/data/json_roundtrip/roundtrip06.json",
+    "test/data/json_roundtrip/roundtrip07.json",
+    "test/data/json_roundtrip/roundtrip08.json",
+    "test/data/json_roundtrip/roundtrip09.json",
+    "test/data/json_roundtrip/roundtrip10.json",
+    "test/data/json_roundtrip/roundtrip11.json",
+    "test/data/json_roundtrip/roundtrip12.json",
+    "test/data/json_roundtrip/roundtrip13.json",
+    "test/data/json_roundtrip/roundtrip14.json",
+    "test/data/json_roundtrip/roundtrip15.json",
+    "test/data/json_roundtrip/roundtrip16.json",
+    "test/data/json_roundtrip/roundtrip17.json",
+    "test/data/json_roundtrip/roundtrip18.json",
+    "test/data/json_roundtrip/roundtrip19.json",
+    "test/data/json_roundtrip/roundtrip20.json",
+    "test/data/json_roundtrip/roundtrip21.json",
+    "test/data/json_roundtrip/roundtrip22.json",
+    "test/data/json_roundtrip/roundtrip23.json",
+    "test/data/json_roundtrip/roundtrip24.json",
+    "test/data/json_roundtrip/roundtrip25.json",
+    "test/data/json_roundtrip/roundtrip26.json",
+    "test/data/json_roundtrip/roundtrip27.json",
+    "test/data/json_roundtrip/roundtrip28.json",
+    "test/data/json_roundtrip/roundtrip29.json",
+    "test/data/json_roundtrip/roundtrip30.json",
+    "test/data/json_roundtrip/roundtrip31.json",
+    "test/data/json_roundtrip/roundtrip32.json",
+    "test/data/json_testsuite/sample.json", // kills AppVeyor
+    "test/data/json_tests/pass1.json",
+    "test/data/json_tests/pass2.json",
+    "test/data/json_tests/pass3.json",
+    "test/data/regression/floats.json",
+    "test/data/regression/signed_ints.json",
+    "test/data/regression/unsigned_ints.json",
+    "test/data/regression/working_file.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_arraysWithSpaces.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_empty-string.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_empty.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_ending_with_newline.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_false.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_heterogeneous.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_null.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_1_and_newline.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_leading_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_several_null.json",
+    "test/data/nst_json_testsuite/test_parsing/y_array_with_trailing_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_0e+1.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_0e1.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_after_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_double_close_to_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_double_huge_neg_exp.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_huge_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_int_with_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_minus_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_negative_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_negative_one.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_negative_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_capital_e.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_capital_e_neg_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_capital_e_pos_exp.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_exponent.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_fraction_exponent.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_neg_exp.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_real_neg_overflow.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_pos_exponent.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_real_pos_overflow.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_real_underflow.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_simple_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_number_simple_real.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_too_big_neg_int.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_too_big_pos_int.json",
+    //"test/data/nst_json_testsuite/test_parsing/y_number_very_big_negative_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_basic.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_duplicated_key.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_duplicated_key_and_value.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_empty.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_empty_key.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_escaped_null_in_key.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_extreme_numbers.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_long_strings.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_simple.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_string_unicode.json",
+    "test/data/nst_json_testsuite/test_parsing/y_object_with_newlines.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_1_2_3_bytes_UTF-8_sequences.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_UTF-16_Surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_accepted_surrogate_pair.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_accepted_surrogate_pairs.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_allowed_escapes.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_backslash_and_u_escaped_zero.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_backslash_doublequotes.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_comments.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_double_escape_a.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_double_escape_n.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_escaped_control_character.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_escaped_noncharacter.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_in_array.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_in_array_with_leading_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_last_surrogates_1_and_2.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_newline_uescaped.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+10FFFF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+1FFFF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+FFFF.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_null_escape.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_one-byte-utf-8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_pi.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_simple_ascii.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_space.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_three-byte-utf-8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_two-byte-utf-8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_u+2028_line_sep.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_u+2029_par_sep.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_uEscape.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unescaped_char_delete.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicodeEscapedBackslash.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_2.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_U+2064_invisible_plus.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_unicode_escaped_double_quote.json",
+    // "test/data/nst_json_testsuite/test_parsing/y_string_utf16.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_utf8.json",
+    "test/data/nst_json_testsuite/test_parsing/y_string_with_del_character.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_false.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_int.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_negative_real.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_null.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_string.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_lonely_true.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_string_empty.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_trailing_newline.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_true_in_array.json",
+    "test/data/nst_json_testsuite/test_parsing/y_structure_whitespace_array.json",
+};
+
+INSTANTIATE_TEST_CASE_P(MessagePackRegressionTests, MessagePackRegressionTest,
+                        ::testing::ValuesIn(regression_test_cases));
+#endif
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-pointer_access.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-pointer_access.cpp
new file mode 100644
index 0000000..a6a87fc
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-pointer_access.cpp
@@ -0,0 +1,463 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+TEST(JsonPointerTest, TypesCreate)
+{
+    // create a JSON value with different types
+    json json_types =
+    {
+        {"boolean", true},
+        {
+            "number", {
+                {"integer", 42},
+                {"unsigned", 42u},
+                {"floating-point", 17.23}
+            }
+        },
+        {"string", "Hello, world!"},
+        {"array", {1, 2, 3, 4, 5}},
+        {"null", nullptr}
+    };
+}
+
+// pointer access to object_t
+TEST(JsonPointerTest, ObjectT)
+{
+    using test_type = json::object_t;
+    json value = {{"one", 1}, {"two", 2}};
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_NE(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const object_t
+TEST(JsonPointerTest, ConstObjectT)
+{
+    using test_type = const json::object_t;
+    const json value = {{"one", 1}, {"two", 2}};
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_NE(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
+
+// pointer access to array_t
+TEST(JsonPointerTest, ArrayT)
+{
+    using test_type = json::array_t;
+    json value = {1, 2, 3, 4};
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const array_t
+TEST(JsonPointerTest, ConstArrayT)
+{
+    using test_type = const json::array_t;
+    const json value = {1, 2, 3, 4};
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
+
+// pointer access to string_t
+TEST(JsonPointerTest, StringT)
+{
+    using test_type = json::string_t;
+    json value = "hello";
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const string_t
+TEST(JsonPointerTest, ConstStringT)
+{
+    using test_type = const json::string_t;
+    const json value = "hello";
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
+
+// pointer access to boolean_t
+TEST(JsonPointerTest, BooleanT)
+{
+    using test_type = json::boolean_t;
+    json value = false;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const boolean_t
+TEST(JsonPointerTest, ConstBooleanT)
+{
+    using test_type = const json::boolean_t;
+    const json value = false;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    //EXPECT_EQ(*p1, value.get<test_type>());
+
+    //const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    //EXPECT_EQ(*p2, value.get<test_type>());
+
+    //const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    //EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
+
+// pointer access to number_integer_t
+TEST(JsonPointerTest, IntegerT)
+{
+    using test_type = json::number_integer_t;
+    json value = 23;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const number_integer_t
+TEST(JsonPointerTest, ConstIntegerT)
+{
+    using test_type = const json::number_integer_t;
+    const json value = 23;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
+
+// pointer access to number_unsigned_t
+TEST(JsonPointerTest, UnsignedT)
+{
+    using test_type = json::number_unsigned_t;
+    json value = 23u;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const number_unsigned_t
+TEST(JsonPointerTest, ConstUnsignedT)
+{
+    using test_type = const json::number_unsigned_t;
+    const json value = 23u;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(*p1, value.get<test_type>());
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_EQ(*p2, value.get<test_type>());
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_EQ(*p3, value.get<test_type>());
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
+
+// pointer access to number_float_t
+TEST(JsonPointerTest, FloatT)
+{
+    using test_type = json::number_float_t;
+    json value = 42.23;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_LT(std::fabs(*p1 - value.get<test_type>()), 0.001);
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_LT(std::fabs(*p2 - value.get<test_type>()), 0.001);
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_LT(std::fabs(*p3 - value.get<test_type>()), 0.001);
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<json::number_unsigned_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<json::number_float_t*>(), nullptr);
+}
+
+// pointer access to const number_float_t
+TEST(JsonPointerTest, ConstFloatT)
+{
+    using test_type = const json::number_float_t;
+    const json value = 42.23;
+
+    // check if pointers are returned correctly
+    test_type* p1 = value.get_ptr<test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<test_type*>());
+    EXPECT_LT(std::fabs(*p1 - value.get<test_type>()), 0.001);
+
+    const test_type* p2 = value.get_ptr<const test_type*>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type*>());
+    EXPECT_LT(std::fabs(*p2 - value.get<test_type>()), 0.001);
+
+    const test_type* const p3 = value.get_ptr<const test_type* const>();
+    EXPECT_EQ(p1, value.get_ptr<const test_type* const>());
+    EXPECT_LT(std::fabs(*p3 - value.get<test_type>()), 0.001);
+
+    // check if null pointers are returned correctly
+    EXPECT_EQ(value.get_ptr<const json::object_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::array_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::string_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::boolean_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_integer_t*>(), nullptr);
+    EXPECT_EQ(value.get_ptr<const json::number_unsigned_t*>(), nullptr);
+    EXPECT_NE(value.get_ptr<const json::number_float_t*>(), nullptr);
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-readme.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-readme.cpp
new file mode 100644
index 0000000..e088773
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-readme.cpp
@@ -0,0 +1,325 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+#include <array>
+#include <deque>
+#include <forward_list>
+#include <list>
+#include <map>
+#include <unordered_map>
+#include <unordered_set>
+
+TEST(JsonReadmeTest, Basic)
+{
+    // create an empty structure (null)
+    json j;
+
+    // add a number that is stored as double (note the implicit conversion of j to an object)
+    j["pi"] = 3.141;
+
+    // add a Boolean that is stored as bool
+    j["happy"] = true;
+
+    // add a string that is stored as std::string
+    j["name"] = "Niels";
+
+    // add another null object by passing nullptr
+    j["nothing"] = nullptr;
+
+    // add an object inside the object
+    j["answer"]["everything"] = 42;
+
+    // add an array that is stored as std::vector (using an initializer list)
+    j["list"] = { 1, 0, 2 };
+
+    // add another object (using an initializer list of pairs)
+    j["object"] = { {"currency", "USD"}, {"value", 42.99} };
+
+    // instead, you could also write (which looks very similar to the JSON above)
+    json j2 =
+    {
+        {"pi", 3.141},
+        {"happy", true},
+        {"name", "Niels"},
+        {"nothing", nullptr},
+        {
+            "answer", {
+                {"everything", 42}
+            }
+        },
+        {"list", {1, 0, 2}},
+        {
+            "object", {
+                {"currency", "USD"},
+                {"value", 42.99}
+            }
+        }
+    };
+}
+
+TEST(JsonReadmeTest, Other)
+{
+    // ways to express the empty array []
+    json empty_array_implicit = {{}};
+    json empty_array_explicit = json::array();
+
+    // a way to express the empty object {}
+    json empty_object_explicit = json::object();
+
+    // a way to express an _array_ of key/value pairs [["currency", "USD"], ["value", 42.99]]
+    json array_not_object = { json::array({"currency", "USD"}), json::array({"value", 42.99}) };
+}
+
+TEST(JsonReadmeTest, FromToString)
+{
+    // create object from string literal
+    json j = "{ \"happy\": true, \"pi\": 3.141 }"_json;
+
+    // or even nicer with a raw string literal
+    auto j2 = R"(
+  {
+    "happy": true,
+    "pi": 3.141
+  }
+)"_json;
+
+    // or explicitly
+    auto j3 = json::parse("{ \"happy\": true, \"pi\": 3.141 }");
+
+    // explicit conversion to string
+    std::string s;
+    llvm::raw_string_ostream os(s);
+    j.dump(os);    // {\"happy\":true,\"pi\":3.141}
+    EXPECT_EQ(os.str(), "{\"happy\":true,\"pi\":3.141}");
+
+    // serialization with pretty printing
+    // pass in the amount of spaces to indent
+    std::string s2;
+    llvm::raw_string_ostream os2(s2);
+    j2.dump(os2, 4);
+    EXPECT_EQ(os2.str(), "{\n    \"happy\": true,\n    \"pi\": 3.141\n}");
+    // {
+    //     "happy": true,
+    //     "pi": 3.141
+    // }
+}
+
+TEST(JsonReadmeTest, Basic2)
+{
+    // create an array using push_back
+    json j;
+    j.push_back("foo");
+    j.push_back(1);
+    j.push_back(true);
+
+    std::string s;
+    llvm::raw_string_ostream os(s);
+
+    // iterate the array
+    for (json::iterator it = j.begin(); it != j.end(); ++it)
+    {
+        os << *it << '\n';
+    }
+
+    // range-based for
+    for (auto element : j)
+    {
+        os << element << '\n';
+    }
+
+    // comparison
+    bool x = (j == "[\"foo\", 1, true]"_json);  // true
+    EXPECT_EQ(x, true);
+
+    // getter/setter
+    const std::string tmp = j[0];
+    j[1] = 42;
+    bool foo = j.at(2);
+    EXPECT_EQ(foo, true);
+
+    // other stuff
+    EXPECT_EQ(j.size(), 3u);        // 3 entries
+    EXPECT_EQ(j.empty(), false);
+    EXPECT_EQ(j.type(), json::value_t::array);
+    j.clear();    // the array is empty again
+    EXPECT_EQ(j.size(), 0u);
+    EXPECT_EQ(j.empty(), true);
+
+    // create an object
+    json o;
+    o["foo"] = 23;
+    o["bar"] = false;
+    o["baz"] = 3.141;
+
+    // find an entry
+    if (o.find("foo") != o.end())
+    {
+        // there is an entry with key "foo"
+    }
+}
+
+TEST(JsonReadmeTest, OtherContainer)
+{
+    std::vector<int> c_vector {1, 2, 3, 4};
+    json j_vec(c_vector);
+    json j_vec2(llvm::makeArrayRef(c_vector));
+    // [1, 2, 3, 4]
+
+    std::deque<float> c_deque {1.2f, 2.3f, 3.4f, 5.6f};
+    json j_deque(c_deque);
+    // [1.2, 2.3, 3.4, 5.6]
+
+    std::list<bool> c_list {true, true, false, true};
+    json j_list(c_list);
+    // [true, true, false, true]
+
+    std::forward_list<int64_t> c_flist {12345678909876, 23456789098765, 34567890987654, 45678909876543};
+    json j_flist(c_flist);
+    // [12345678909876, 23456789098765, 34567890987654, 45678909876543]
+
+    std::array<unsigned long, 4> c_array {{1, 2, 3, 4}};
+    json j_array(c_array);
+    // [1, 2, 3, 4]
+
+    std::set<std::string> c_set {"one", "two", "three", "four", "one"};
+    json j_set(c_set); // only one entry for "one" is used
+    // ["four", "one", "three", "two"]
+
+    std::unordered_set<std::string> c_uset {"one", "two", "three", "four", "one"};
+    json j_uset(c_uset); // only one entry for "one" is used
+    // maybe ["two", "three", "four", "one"]
+
+    std::multiset<std::string> c_mset {"one", "two", "one", "four"};
+    json j_mset(c_mset); // both entries for "one" are used
+    // maybe ["one", "two", "one", "four"]
+
+    std::unordered_multiset<std::string> c_umset {"one", "two", "one", "four"};
+    json j_umset(c_umset); // both entries for "one" are used
+    // maybe ["one", "two", "one", "four"]
+}
+
+TEST(JsonReadmeTest, MapContainer)
+{
+    std::map<std::string, int> c_map { {"one", 1}, {"two", 2}, {"three", 3} };
+    json j_map(c_map);
+    // {"one": 1, "two": 2, "three": 3}
+
+#if 0
+    std::unordered_map<const char*, float> c_umap { {"one", 1.2f}, {"two", 2.3f}, {"three", 3.4f} };
+    json j_umap(c_umap);
+    // {"one": 1.2, "two": 2.3, "three": 3.4}
+#endif
+
+    std::multimap<std::string, bool> c_mmap { {"one", true}, {"two", true}, {"three", false}, {"three", true} };
+    json j_mmap(c_mmap); // only one entry for key "three" is used
+    // maybe {"one": true, "two": true, "three": true}
+
+    std::unordered_multimap<std::string, bool> c_ummap { {"one", true}, {"two", true}, {"three", false}, {"three", true} };
+    json j_ummap(c_ummap); // only one entry for key "three" is used
+    // maybe {"one": true, "two": true, "three": true}
+}
+
+TEST(JsonReadmeTest, Values)
+{
+    // strings
+    std::string s1 = "Hello, world!";
+    json js = s1;
+    std::string s2 = js;
+    EXPECT_EQ(s1, s2);
+
+    // Booleans
+    bool b1 = true;
+    json jb = b1;
+    bool b2 = jb;
+    EXPECT_EQ(b1, b2);
+
+    // numbers
+    int i = 42;
+    json jn = i;
+    double f = jn;
+    EXPECT_EQ(i, f);
+
+    // etc.
+
+    std::string vs = js.get<std::string>();
+    bool vb = jb.get<bool>();
+    int vi = jn.get<int>();
+    EXPECT_EQ(s1, vs);
+    EXPECT_EQ(b1, vb);
+    EXPECT_EQ(i, vi);
+
+    // etc.
+}
+
+#if 0
+TEST(JsonReadmeTest, DiffPatch)
+{
+    // a JSON value
+    json j_original = R"({
+  "baz": ["one", "two", "three"],
+  "foo": "bar"
+})"_json;
+
+    // access members with a JSON pointer (RFC 6901)
+    j_original["/baz/1"_json_pointer];
+    // "two"
+
+    // a JSON patch (RFC 6902)
+    json j_patch = R"([
+  { "op": "replace", "path": "/baz", "value": "boo" },
+  { "op": "add", "path": "/hello", "value": ["world"] },
+  { "op": "remove", "path": "/foo"}
+])"_json;
+
+    // apply the patch
+    json j_result = j_original.patch(j_patch);
+    // {
+    //    "baz": "boo",
+    //    "hello": ["world"]
+    // }
+
+    // calculate a JSON patch from two JSON values
+    json::diff(j_result, j_original);
+    // [
+    //   { "op":" replace", "path": "/baz", "value": ["one", "two", "three"] },
+    //   { "op":"remove","path":"/hello" },
+    //   { "op":"add","path":"/foo","value":"bar" }
+    // ]
+}
+#endif
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-reference_access.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-reference_access.cpp
new file mode 100644
index 0000000..1cea689
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-reference_access.cpp
@@ -0,0 +1,197 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+// reference access to object_t
+TEST(JsonReferenceTest, ObjectT)
+{
+    using test_type = json::object_t;
+    json value = {{"one", 1}, {"two", 2}};
+
+    // check if references are returned correctly
+    test_type& p1 = value.get_ref<test_type&>();
+    EXPECT_EQ(&p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(p1, value.get<test_type>());
+
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+
+    // check if mismatching references throw correctly
+    EXPECT_NO_THROW(value.get_ref<json::object_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::array_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::string_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::boolean_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_integer_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_float_t&>());
+}
+
+// const reference access to const object_t
+TEST(JsonReferenceTest, ConstObjectT)
+{
+    using test_type = json::object_t;
+    const json value = {{"one", 1}, {"two", 2}};
+
+    // this should not compile
+    // test_type& p1 = value.get_ref<test_type&>();
+
+    // check if references are returned correctly
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+}
+
+// reference access to array_t
+TEST(JsonReferenceTest, ArrayT)
+{
+    using test_type = json::array_t;
+    json value = {1, 2, 3, 4};
+
+    // check if references are returned correctly
+    test_type& p1 = value.get_ref<test_type&>();
+    EXPECT_EQ(&p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(p1, value.get<test_type>());
+
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+
+    // check if mismatching references throw correctly
+    EXPECT_ANY_THROW(value.get_ref<json::object_t&>());
+    EXPECT_NO_THROW(value.get_ref<json::array_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::string_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::boolean_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_integer_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_float_t&>());
+}
+
+// reference access to string_t
+TEST(JsonReferenceTest, StringT)
+{
+    using test_type = json::string_t;
+    json value = "hello";
+
+    // check if references are returned correctly
+    test_type& p1 = value.get_ref<test_type&>();
+    EXPECT_EQ(&p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(p1, value.get<test_type>());
+
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+
+    // check if mismatching references throw correctly
+    EXPECT_ANY_THROW(value.get_ref<json::object_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::array_t&>());
+    EXPECT_NO_THROW(value.get_ref<json::string_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::boolean_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_integer_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_float_t&>());
+}
+
+// reference access to boolean_t
+TEST(JsonReferenceTest, BooleanT)
+{
+    using test_type = json::boolean_t;
+    json value = false;
+
+    // check if references are returned correctly
+    test_type& p1 = value.get_ref<test_type&>();
+    EXPECT_EQ(&p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(p1, value.get<test_type>());
+
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+
+    // check if mismatching references throw correctly
+    EXPECT_ANY_THROW(value.get_ref<json::object_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::array_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::string_t&>());
+    EXPECT_NO_THROW(value.get_ref<json::boolean_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_integer_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_float_t&>());
+}
+
+// reference access to number_integer_t
+TEST(JsonReferenceTest, IntegerT)
+{
+    using test_type = json::number_integer_t;
+    json value = 23;
+
+    // check if references are returned correctly
+    test_type& p1 = value.get_ref<test_type&>();
+    EXPECT_EQ(&p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(p1, value.get<test_type>());
+
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+
+    // check if mismatching references throw correctly
+    EXPECT_ANY_THROW(value.get_ref<json::object_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::array_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::string_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::boolean_t&>());
+    EXPECT_NO_THROW(value.get_ref<json::number_integer_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_float_t&>());
+}
+
+// reference access to number_float_t
+TEST(JsonReferenceTest, FloatT)
+{
+    using test_type = json::number_float_t;
+    json value = 42.23;
+
+    // check if references are returned correctly
+    test_type& p1 = value.get_ref<test_type&>();
+    EXPECT_EQ(&p1, value.get_ptr<test_type*>());
+    EXPECT_EQ(p1, value.get<test_type>());
+
+    const test_type& p2 = value.get_ref<const test_type&>();
+    EXPECT_EQ(&p2, value.get_ptr<const test_type*>());
+    EXPECT_EQ(p2, value.get<test_type>());
+
+    // check if mismatching references throw correctly
+    EXPECT_ANY_THROW(value.get_ref<json::object_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::array_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::string_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::boolean_t&>());
+    EXPECT_ANY_THROW(value.get_ref<json::number_integer_t&>());
+    EXPECT_NO_THROW(value.get_ref<json::number_float_t&>());
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/json/unit-unicode.cpp b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-unicode.cpp
new file mode 100644
index 0000000..1c4546a
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/json/unit-unicode.cpp
@@ -0,0 +1,1092 @@
+/*----------------------------------------------------------------------------*/
+/* Modifications Copyright (c) FIRST 2017. All Rights Reserved.               */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+/*
+    __ _____ _____ _____
+ __|  |   __|     |   | |  JSON for Modern C++ (test suite)
+|  |  |__   |  |  | | | |  version 2.1.1
+|_____|_____|_____|_|___|  https://github.com/nlohmann/json
+
+Licensed under the MIT License <http://opensource.org/licenses/MIT>.
+Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
+
+Permission is hereby  granted, free of charge, to any  person obtaining a copy
+of this software and associated  documentation files (the "Software"), to deal
+in the Software  without restriction, including without  limitation the rights
+to  use, copy,  modify, merge,  publish, distribute,  sublicense, and/or  sell
+copies  of  the Software,  and  to  permit persons  to  whom  the Software  is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE  IS PROVIDED "AS  IS", WITHOUT WARRANTY  OF ANY KIND,  EXPRESS OR
+IMPLIED,  INCLUDING BUT  NOT  LIMITED TO  THE  WARRANTIES OF  MERCHANTABILITY,
+FITNESS FOR  A PARTICULAR PURPOSE AND  NONINFRINGEMENT. IN NO EVENT  SHALL THE
+AUTHORS  OR COPYRIGHT  HOLDERS  BE  LIABLE FOR  ANY  CLAIM,  DAMAGES OR  OTHER
+LIABILITY, WHETHER IN AN ACTION OF  CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE  OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+#include "gtest/gtest.h"
+
+#include "unit-json.h"
+using wpi::json;
+
+#include "llvm/Format.h"
+#include "llvm/StringExtras.h"
+
+#include <fstream>
+
+// create and check a JSON string with up to four UTF-8 bytes
+::testing::AssertionResult check_utf8string(bool success_expected, int byte1, int byte2 = -1, int byte3 = -1, int byte4 = -1)
+{
+    std::string json_string = "\"";
+
+    json_string += std::string(1, static_cast<char>(byte1));
+
+    if (byte2 != -1)
+    {
+        json_string += std::string(1, static_cast<char>(byte2));
+    }
+
+    if (byte3 != -1)
+    {
+        json_string += std::string(1, static_cast<char>(byte3));
+    }
+
+    if (byte4 != -1)
+    {
+        json_string += std::string(1, static_cast<char>(byte4));
+    }
+
+    json_string += "\"";
+
+    const char* basemsg = "";
+
+    try {
+        json::parse(json_string);
+    } catch (json::parse_error) {
+        if (success_expected)
+        {
+            basemsg = "parse_error";
+            goto error;
+        }
+        return ::testing::AssertionSuccess();
+    } catch (...) {
+        basemsg = "other exception";
+        goto error;
+    }
+
+    if (success_expected)
+    {
+        return ::testing::AssertionSuccess();
+    }
+    basemsg = "expected failure";
+
+error:
+    auto result = ::testing::AssertionFailure();
+    result << basemsg << " with {" << llvm::utohexstr(byte1);
+    if (byte2 != -1)
+    {
+        result << ',' << llvm::utohexstr(byte2);
+    }
+    if (byte3 != -1)
+    {
+        result << ',' << llvm::utohexstr(byte3);
+    }
+    if (byte4 != -1)
+    {
+        result << ',' << llvm::utohexstr(byte4);
+    }
+    result << '}';
+    return result;
+}
+
+/*
+RFC 3629 describes in Sect. 4 the syntax of UTF-8 byte sequences as
+follows:
+
+    A UTF-8 string is a sequence of octets representing a sequence of UCS
+    characters.  An octet sequence is valid UTF-8 only if it matches the
+    following syntax, which is derived from the rules for encoding UTF-8
+    and is expressed in the ABNF of [RFC2234].
+
+    UTF8-octets = *( UTF8-char )
+    UTF8-char   = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
+    UTF8-1      = %x00-7F
+    UTF8-2      = %xC2-DF UTF8-tail
+    UTF8-3      = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
+                  %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
+    UTF8-4      = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
+                  %xF4 %x80-8F 2( UTF8-tail )
+    UTF8-tail   = %x80-BF
+*/
+
+// ill-formed first byte
+TEST(JsonUnicodeRfc3629Test, IllFormedFirstByte)
+{
+    for (int byte1 = 0x80; byte1 <= 0xC1; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+
+    for (int byte1 = 0xF5; byte1 <= 0xFF; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// UTF8-1 (x00-x7F), well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_1WellFormed)
+{
+    for (int byte1 = 0x00; byte1 <= 0x7F; ++byte1)
+    {
+        // unescaped control characters are parse errors in JSON
+        if (0x00 <= byte1 && byte1 <= 0x1F)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1));
+            continue;
+        }
+
+        // a single quote is a parse error in JSON
+        if (byte1 == 0x22)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1));
+            continue;
+        }
+
+        // a single backslash is a parse error in JSON
+        if (byte1 == 0x5C)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1));
+            continue;
+        }
+
+        // all other characters are OK
+        EXPECT_TRUE(check_utf8string(true, byte1));
+    }
+}
+
+// UTF8-2 (xC2-xDF UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_2WellFormed)
+{
+    for (int byte1 = 0xC2; byte1 <= 0xDF; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(true, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_2Missing2)
+{
+    for (int byte1 = 0xC2; byte1 <= 0xDF; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_2Wrong2)
+{
+    for (int byte1 = 0xC2; byte1 <= 0xDF; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x80 <= byte2 && byte2 <= 0xBF)
+            {
+                continue;
+            }
+
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// UTF8-3 (xE0 xA0-BF UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_3AWellFormed)
+{
+    for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1)
+    {
+        for (int byte2 = 0xA0; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3AMissing2)
+{
+    for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3AMissing3)
+{
+    for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1)
+    {
+        for (int byte2 = 0xA0; byte2 <= 0xBF; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3AWrong2)
+{
+    for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0xA0 <= byte2 && byte2 <= 0xBF)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3AWrong3)
+{
+    for (int byte1 = 0xE0; byte1 <= 0xE0; ++byte1)
+    {
+        for (int byte2 = 0xA0; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// UTF8-3 (xE1-xEC UTF8-tail UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_3BWellFormed)
+{
+    for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3BMissing2)
+{
+    for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3BMissing3)
+{
+    for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_3BWrong2)
+{
+    for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x80 <= byte2 && byte2 <= 0xBF)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_3BWrong3)
+{
+    for (int byte1 = 0xE1; byte1 <= 0xEC; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// UTF8-3 (xED x80-9F UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_3CWellFormed)
+{
+    for (int byte1 = 0xED; byte1 <= 0xED; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x9F; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3CMissing2)
+{
+    for (int byte1 = 0xED; byte1 <= 0xED; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3CMissing3)
+{
+    for (int byte1 = 0xED; byte1 <= 0xED; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x9F; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3CWrong2)
+{
+    for (int byte1 = 0xED; byte1 <= 0xED; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x80 <= byte2 && byte2 <= 0x9F)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3CWrong3)
+{
+    for (int byte1 = 0xED; byte1 <= 0xED; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x9F; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// UTF8-3 (xEE-xEF UTF8-tail UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_3DWellFormed)
+{
+    for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3DMissing2)
+{
+    for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3DMissing3)
+{
+    for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3DWrong2)
+{
+    for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x80 <= byte2 && byte2 <= 0xBF)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_3DWrong3)
+{
+    for (int byte1 = 0xEE; byte1 <= 0xEF; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// UTF8-4 (xF0 x90-BF UTF8-tail UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_4AWellFormed)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4AMissing2)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4AMissing3)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: missing fourth byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4AMissing4)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_4AWrong2)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x90 <= byte2 && byte2 <= 0xBF)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_4AWrong3)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: wrong fourth byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4AWrong4)
+{
+    for (int byte1 = 0xF0; byte1 <= 0xF0; ++byte1)
+    {
+        for (int byte2 = 0x90; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x00; byte4 <= 0xFF; ++byte4)
+                {
+                    // skip fourth second byte
+                    if (0x80 <= byte3 && byte3 <= 0xBF)
+                    {
+                        continue;
+                    }
+
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// UTF8-4 (xF1-F3 UTF8-tail UTF8-tail UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_4BWellFormed)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4BMissing2)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4BMissing3)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: missing fourth byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4BMissing4)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_4BWrong2)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x80 <= byte2 && byte2 <= 0xBF)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_4BWrong3)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: wrong fourth byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4BWrong4)
+{
+    for (int byte1 = 0xF1; byte1 <= 0xF3; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0xBF; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x00; byte4 <= 0xFF; ++byte4)
+                {
+                    // skip correct fourth byte
+                    if (0x80 <= byte3 && byte3 <= 0xBF)
+                    {
+                        continue;
+                    }
+
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// UTF8-4 (xF4 x80-8F UTF8-tail UTF8-tail)
+// well-formed
+TEST(JsonUnicodeRfc3629Test, Utf8_4CWellFormed)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(true, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: missing second byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4CMissing2)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        EXPECT_TRUE(check_utf8string(false, byte1));
+    }
+}
+
+// ill-formed: missing third byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4CMissing3)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2)
+        {
+            EXPECT_TRUE(check_utf8string(false, byte1, byte2));
+        }
+    }
+}
+
+// ill-formed: missing fourth byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4CMissing4)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3));
+            }
+        }
+    }
+}
+
+// ill-formed: wrong second byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_4CWrong2)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        for (int byte2 = 0x00; byte2 <= 0xFF; ++byte2)
+        {
+            // skip correct second byte
+            if (0x80 <= byte2 && byte2 <= 0x8F)
+            {
+                continue;
+            }
+
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: wrong third byte
+TEST(JsonUnicodeRfc3629Test, DISABLED_Utf8_4CWrong3)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2)
+        {
+            for (int byte3 = 0x00; byte3 <= 0xFF; ++byte3)
+            {
+                // skip correct third byte
+                if (0x80 <= byte3 && byte3 <= 0xBF)
+                {
+                    continue;
+                }
+
+                for (int byte4 = 0x80; byte4 <= 0xBF; ++byte4)
+                {
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// ill-formed: wrong fourth byte
+TEST(JsonUnicodeRfc3629Test, Utf8_4CWrong4)
+{
+    for (int byte1 = 0xF4; byte1 <= 0xF4; ++byte1)
+    {
+        for (int byte2 = 0x80; byte2 <= 0x8F; ++byte2)
+        {
+            for (int byte3 = 0x80; byte3 <= 0xBF; ++byte3)
+            {
+                for (int byte4 = 0x00; byte4 <= 0xFF; ++byte4)
+                {
+                    // skip correct fourth byte
+                    if (0x80 <= byte3 && byte3 <= 0xBF)
+                    {
+                        continue;
+                    }
+
+                    EXPECT_TRUE(check_utf8string(false, byte1, byte2, byte3, byte4));
+                }
+            }
+        }
+    }
+}
+
+// \\uxxxx sequences
+
+// create an escaped string from a code point
+static std::string codepoint_to_unicode(std::size_t cp)
+{
+    // code points are represented as a six-character sequence: a
+    // reverse solidus, followed by the lowercase letter u, followed
+    // by four hexadecimal digits that encode the character's code
+    // point
+    std::string s;
+    llvm::raw_string_ostream ss(s);
+    ss << "\\u" << llvm::format_hex_no_prefix(cp, 4);
+    ss.flush();
+    return s;
+}
+
+// correct sequences
+TEST(JsonUnicodeCodepointTest, DISABLED_Correct)
+{
+    // generate all UTF-8 code points; in total, 1112064 code points are
+    // generated: 0x1FFFFF code points - 2048 invalid values between
+    // 0xD800 and 0xDFFF.
+    for (std::size_t cp = 0; cp <= 0x10FFFFu; ++cp)
+    {
+        // string to store the code point as in \uxxxx format
+        std::string json_text = "\"";
+
+        // decide whether to use one or two \uxxxx sequences
+        if (cp < 0x10000u)
+        {
+            // The Unicode standard permanently reserves these code point
+            // values for UTF-16 encoding of the high and low surrogates, and
+            // they will never be assigned a character, so there should be no
+            // reason to encode them. The official Unicode standard says that
+            // no UTF forms, including UTF-16, can encode these code points.
+            if (cp >= 0xD800u && cp <= 0xDFFFu)
+            {
+                // if we would not skip these code points, we would get a
+                // "missing low surrogate" exception
+                continue;
+            }
+
+            // code points in the Basic Multilingual Plane can be
+            // represented with one \uxxxx sequence
+            json_text += codepoint_to_unicode(cp);
+        }
+        else
+        {
+            // To escape an extended character that is not in the Basic
+            // Multilingual Plane, the character is represented as a
+            // 12-character sequence, encoding the UTF-16 surrogate pair
+            const auto codepoint1 = 0xd800u + (((cp - 0x10000u) >> 10) & 0x3ffu);
+            const auto codepoint2 = 0xdc00u + ((cp - 0x10000u) & 0x3ffu);
+            json_text += codepoint_to_unicode(codepoint1) + codepoint_to_unicode(codepoint2);
+        }
+
+        json_text += "\"";
+        SCOPED_TRACE(json_text);
+        EXPECT_NO_THROW(json::parse(json_text));
+    }
+}
+
+#if 0
+// incorrect sequences
+// high surrogate without low surrogate
+TEST(JsonUnicodeCodepointTest, IncorrectHighMissingLow)
+{
+    // D800..DBFF are high surrogates and must be followed by low
+    // surrogates DC00..DFFF; here, nothing follows
+    for (std::size_t cp = 0xD800u; cp <= 0xDBFFu; ++cp)
+    {
+        std::string json_text = "\"" + codepoint_to_unicode(cp) + "\"";
+        SCOPED_TRACE(json_text);
+        EXPECT_THROW(json::parse(json_text), json::parse_error);
+    }
+}
+
+// high surrogate with wrong low surrogate
+TEST(JsonUnicodeCodepointTest, IncorrectHighWrongLow)
+{
+    // D800..DBFF are high surrogates and must be followed by low
+    // surrogates DC00..DFFF; here a different sequence follows
+    for (std::size_t cp1 = 0xD800u; cp1 <= 0xDBFFu; ++cp1)
+    {
+        for (std::size_t cp2 = 0x0000u; cp2 <= 0xFFFFu; ++cp2)
+        {
+            if (0xDC00u <= cp2 && cp2 <= 0xDFFFu)
+            {
+                continue;
+            }
+
+            std::string json_text = "\"" + codepoint_to_unicode(cp1) + codepoint_to_unicode(cp2) + "\"";
+            SCOPED_TRACE(json_text);
+            EXPECT_THROW(json::parse(json_text), json::parse_error);
+        }
+    }
+}
+
+// low surrogate without high surrogate
+TEST(JsonUnicodeCodepointTest, IncorrectLowMissingHigh)
+{
+    // low surrogates DC00..DFFF must follow high surrogates; here,
+    // they occur alone
+    for (std::size_t cp = 0xDC00u; cp <= 0xDFFFu; ++cp)
+    {
+        std::string json_text = "\"" + codepoint_to_unicode(cp) + "\"";
+        SCOPED_TRACE(json_text);
+        EXPECT_THROW(json::parse(json_text), json::parse_error);
+    }
+}
+#endif
+
+#if 0
+// read all unicode characters
+TEST(JsonUnicodeTest, ReadAllUnicode)
+{
+    // read a file with all unicode characters stored as single-character
+    // strings in a JSON array
+    std::ifstream f("test/data/json_nlohmann_tests/all_unicode.json");
+    json j;
+    CHECK_NOTHROW(f >> j);
+
+    // the array has 1112064 + 1 elemnts (a terminating "null" value)
+    // Note: 1112064 = 0x1FFFFF code points - 2048 invalid values between
+    // 0xD800 and 0xDFFF.
+    CHECK(j.size() == 1112065);
+
+    SECTION("check JSON Pointers")
+    {
+        for (auto s : j)
+        {
+            // skip non-string JSON values
+            if (not s.is_string())
+            {
+                continue;
+            }
+
+            std::string ptr = s;
+
+            // tilde must be followed by 0 or 1
+            if (ptr == "~")
+            {
+                ptr += "0";
+            }
+
+            // JSON Pointers must begin with "/"
+            ptr = "/" + ptr;
+
+            CHECK_NOTHROW(json::json_pointer("/" + ptr));
+
+            // check escape/unescape roundtrip
+            auto escaped = json::json_pointer::escape(ptr);
+            json::json_pointer::unescape(escaped);
+            CHECK(escaped == ptr);
+        }
+    }
+}
+
+// ignore byte-order-mark
+// in a stream
+TEST(JsonUnicodeTest, IgnoreBOMStream)
+{
+    // read a file with a UTF-8 BOM
+    std::ifstream f("test/data/json_nlohmann_tests/bom.json");
+    json j;
+    EXPECT_NO_THROW(f >> j);
+}
+
+// with an iterator
+TEST(JsonUnicodeTest, IgnoreBOMIterator)
+{
+    std::string i = "\xef\xbb\xbf{\n   \"foo\": true\n}";
+    EXPECT_NO_THROW(json::parse(i.begin(), i.end()));
+}
+#endif
+// error for incomplete/wrong BOM
+TEST(JsonUnicodeTest, WrongBOM)
+{
+    EXPECT_THROW(json::parse("\xef\xbb"), json::parse_error);
+    EXPECT_THROW(json::parse("\xef\xbb\xbb"), json::parse_error);
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/leb128Test.cpp b/third_party/wpiutil_2018/src/test/native/cpp/leb128Test.cpp
new file mode 100644
index 0000000..df659da
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/leb128Test.cpp
@@ -0,0 +1,112 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+//===- llvm/unittest/Support/LEB128Test.cpp - LEB128 function tests -------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <stdint.h>
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "llvm/SmallString.h"
+#include "llvm/StringRef.h"
+#include "support/leb128.h"
+#include "support/raw_istream.h"
+
+namespace wpi {
+
+TEST(LEB128Test, WriteUleb128) {
+#define EXPECT_ULEB128_EQ(EXPECTED, VALUE, PAD)               \
+  do {                                                        \
+    llvm::StringRef expected(EXPECTED, sizeof(EXPECTED) - 1); \
+    llvm::SmallString<32> buf;                                \
+    size_t size = WriteUleb128(buf, VALUE);                   \
+    EXPECT_EQ(size, buf.size());                              \
+    EXPECT_EQ(expected, buf.str());                           \
+  } while (0)
+
+  // Write ULEB128
+  EXPECT_ULEB128_EQ("\x00", 0, 0);
+  EXPECT_ULEB128_EQ("\x01", 1, 0);
+  EXPECT_ULEB128_EQ("\x3f", 63, 0);
+  EXPECT_ULEB128_EQ("\x40", 64, 0);
+  EXPECT_ULEB128_EQ("\x7f", 0x7f, 0);
+  EXPECT_ULEB128_EQ("\x80\x01", 0x80, 0);
+  EXPECT_ULEB128_EQ("\x81\x01", 0x81, 0);
+  EXPECT_ULEB128_EQ("\x90\x01", 0x90, 0);
+  EXPECT_ULEB128_EQ("\xff\x01", 0xff, 0);
+  EXPECT_ULEB128_EQ("\x80\x02", 0x100, 0);
+  EXPECT_ULEB128_EQ("\x81\x02", 0x101, 0);
+
+#undef EXPECT_ULEB128_EQ
+}
+
+TEST(LEB128Test, ReadUleb128) {
+#define EXPECT_READ_ULEB128_EQ(EXPECTED, VALUE) \
+  do {                                          \
+    uint64_t val = 0;                           \
+    size_t size = ReadUleb128(VALUE, &val);     \
+    EXPECT_EQ(sizeof(VALUE) - 1, size);         \
+    EXPECT_EQ(EXPECTED, val);                   \
+  } while (0)
+
+  // Read ULEB128
+  EXPECT_READ_ULEB128_EQ(0u, "\x00");
+  EXPECT_READ_ULEB128_EQ(1u, "\x01");
+  EXPECT_READ_ULEB128_EQ(63u, "\x3f");
+  EXPECT_READ_ULEB128_EQ(64u, "\x40");
+  EXPECT_READ_ULEB128_EQ(0x7fu, "\x7f");
+  EXPECT_READ_ULEB128_EQ(0x80u, "\x80\x01");
+  EXPECT_READ_ULEB128_EQ(0x81u, "\x81\x01");
+  EXPECT_READ_ULEB128_EQ(0x90u, "\x90\x01");
+  EXPECT_READ_ULEB128_EQ(0xffu, "\xff\x01");
+  EXPECT_READ_ULEB128_EQ(0x100u, "\x80\x02");
+  EXPECT_READ_ULEB128_EQ(0x101u, "\x81\x02");
+  EXPECT_READ_ULEB128_EQ(8320u, "\x80\xc1\x80\x80\x10");
+
+#undef EXPECT_READ_ULEB128_EQ
+}
+
+TEST(LEB128Test, SizeUleb128) {
+  // Testing Plan:
+  // (1) 128 ^ n ............ need (n+1) bytes
+  // (2) 128 ^ n * 64 ....... need (n+1) bytes
+  // (3) 128 ^ (n+1) - 1 .... need (n+1) bytes
+
+  EXPECT_EQ(1u, SizeUleb128(0));  // special case
+
+  EXPECT_EQ(1u, SizeUleb128(0x1UL));
+  EXPECT_EQ(1u, SizeUleb128(0x40UL));
+  EXPECT_EQ(1u, SizeUleb128(0x7fUL));
+
+  EXPECT_EQ(2u, SizeUleb128(0x80UL));
+  EXPECT_EQ(2u, SizeUleb128(0x2000UL));
+  EXPECT_EQ(2u, SizeUleb128(0x3fffUL));
+
+  EXPECT_EQ(3u, SizeUleb128(0x4000UL));
+  EXPECT_EQ(3u, SizeUleb128(0x100000UL));
+  EXPECT_EQ(3u, SizeUleb128(0x1fffffUL));
+
+  EXPECT_EQ(4u, SizeUleb128(0x200000UL));
+  EXPECT_EQ(4u, SizeUleb128(0x8000000UL));
+  EXPECT_EQ(4u, SizeUleb128(0xfffffffUL));
+
+  EXPECT_EQ(5u, SizeUleb128(0x10000000UL));
+  EXPECT_EQ(5u, SizeUleb128(0x40000000UL));
+  EXPECT_EQ(5u, SizeUleb128(0x7fffffffUL));
+
+  EXPECT_EQ(5u, SizeUleb128(UINT32_MAX));
+}
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/main.cpp b/third_party/wpiutil_2018/src/test/native/cpp/main.cpp
new file mode 100644
index 0000000..1e5ecf0
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/main.cpp
@@ -0,0 +1,14 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2015-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include "gtest/gtest.h"
+
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  int ret = RUN_ALL_TESTS();
+  return ret;
+}
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/priority_condition_variable_test.cpp b/third_party/wpiutil_2018/src/test/native/cpp/priority_condition_variable_test.cpp
new file mode 100644
index 0000000..cb4031c
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/priority_condition_variable_test.cpp
@@ -0,0 +1,300 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <support/priority_condition_variable.h>
+#include <support/priority_mutex.h>
+
+#include <atomic>
+#include <chrono>
+#include <condition_variable>
+#include <mutex>
+#include <thread>
+
+#include "gtest/gtest.h"
+
+namespace wpi {
+
+#ifdef WPI_HAVE_PRIORITY_CONDITION_VARIABLE
+
+// Tests that the condition variable class which we wrote ourselves actually
+// does work.
+class ConditionVariableTest : public ::testing::Test {
+ protected:
+  typedef std::unique_lock<priority_mutex> priority_lock;
+
+  // Condition variable to test.
+  priority_condition_variable m_cond;
+
+  // Mutex to pass to condition variable when waiting.
+  priority_mutex m_mutex;
+
+  // flags for testing when threads are completed.
+  std::atomic<bool> m_done1{false}, m_done2{false};
+  // Threads to use for testing. We want multiple threads to ensure that it
+  // behaves correctly when multiple processes are waiting on a signal.
+  std::thread m_watcher1, m_watcher2;
+
+  // Information for when running with predicates.
+  std::atomic<bool> m_pred_var{false};
+
+  void ShortSleep(uint32_t time = 10) {
+    std::this_thread::sleep_for(std::chrono::milliseconds(time));
+  }
+
+  // Start up the given threads with a wait function. The wait function should
+  // call some version of m_cond.wait and should take as an argument a reference
+  // to an std::atomic<bool> which it will set to true when it is ready to have
+  // join called on it.
+  template <class Function>
+  void StartThreads(Function wait) {
+    m_watcher1 = std::thread(wait, std::ref(m_done1));
+    m_watcher2 = std::thread(wait, std::ref(m_done2));
+
+    // Wait briefly to let the lock be unlocked.
+    ShortSleep();
+    bool locked = m_mutex.try_lock();
+    if (locked) m_mutex.unlock();
+    EXPECT_TRUE(locked) << "The condition variable failed to unlock the lock.";
+  }
+
+  void NotifyAll() { m_cond.notify_all(); }
+  void NotifyOne() { m_cond.notify_one(); }
+
+  // Test that all the threads are notified by a notify_all() call.
+  void NotifyAllTest() {
+    NotifyAll();
+    // Wait briefly to let the lock be re-locked.
+    ShortSleep();
+    EXPECT_TRUE(m_done1) << "watcher1 failed to be notified.";
+    EXPECT_TRUE(m_done2) << "watcher2 failed to be notified.";
+  }
+
+  // For use when testing predicates. First tries signalling the threads with
+  // the predicate set to false (and ensures that they do not activate) and then
+  // tests with the predicate set to true.
+  void PredicateTest() {
+    m_pred_var = false;
+    NotifyAll();
+    ShortSleep();
+    EXPECT_FALSE(m_done1) << "watcher1 didn't pay attention to its predicate.";
+    EXPECT_FALSE(m_done2) << "watcher2 didn't pay attention to its predicate.";
+    m_pred_var = true;
+    NotifyAllTest();
+  }
+
+  // Used by the WaitFor and WaitUntil tests to test that, without a predicate,
+  // the timeout works properly.
+  void WaitTimeTest(bool wait_for) {
+    std::atomic<bool> timed_out{true};
+    auto wait_until = [this, &timed_out, wait_for](std::atomic<bool>& done) {
+      priority_lock lock(m_mutex);
+      done = false;
+      if (wait_for) {
+        auto wait_time = std::chrono::milliseconds(100);
+        timed_out = m_cond.wait_for(lock, wait_time) == std::cv_status::timeout;
+      } else {
+        auto wait_time =
+            std::chrono::system_clock::now() + std::chrono::milliseconds(100);
+        timed_out =
+            m_cond.wait_until(lock, wait_time) == std::cv_status::timeout;
+      }
+      EXPECT_TRUE(lock.owns_lock())
+          << "The condition variable should have reacquired the lock.";
+      done = true;
+    };
+
+    // First, test without timing out.
+    timed_out = true;
+    StartThreads(wait_until);
+
+    NotifyAllTest();
+    EXPECT_FALSE(timed_out) << "The watcher should not have timed out.";
+
+    TearDown();
+
+    // Next, test and time out.
+    timed_out = false;
+    StartThreads(wait_until);
+
+    ShortSleep(110);
+
+    EXPECT_TRUE(m_done1) << "watcher1 should have timed out.";
+    EXPECT_TRUE(m_done2) << "watcher2 should have timed out.";
+    EXPECT_TRUE(timed_out) << "The watcher should have timed out.";
+  }
+
+  // For use with tests that have a timeout and a predicate.
+  void WaitTimePredicateTest(bool wait_for) {
+    // The condition_variable return value from the wait_for or wait_until
+    // function should in the case of having a predicate, by a boolean. If the
+    // predicate is true, then the return value will always be true. If the
+    // condition times out and, at the time of the timeout, the predicate is
+    // false, the return value will be false.
+    std::atomic<bool> retval{true};
+    auto predicate = [this]() -> bool { return m_pred_var; };
+    auto wait_until = [this, &retval, predicate,
+                       wait_for](std::atomic<bool>& done) {
+      priority_lock lock(m_mutex);
+      done = false;
+      if (wait_for) {
+        auto wait_time = std::chrono::milliseconds(100);
+        retval = m_cond.wait_for(lock, wait_time, predicate);
+      } else {
+        auto wait_time =
+            std::chrono::system_clock::now() + std::chrono::milliseconds(100);
+        retval = m_cond.wait_until(lock, wait_time, predicate);
+      }
+      EXPECT_TRUE(lock.owns_lock())
+          << "The condition variable should have reacquired the lock.";
+      done = true;
+    };
+
+    // Test without timing out and with the predicate set to true.
+    retval = true;
+    m_pred_var = true;
+    StartThreads(wait_until);
+
+    NotifyAllTest();
+    EXPECT_TRUE(retval) << "The watcher should not have timed out.";
+
+    TearDown();
+
+    // Test with timing out and with the predicate set to true.
+    retval = false;
+    m_pred_var = false;
+    StartThreads(wait_until);
+
+    ShortSleep(110);
+
+    EXPECT_TRUE(m_done1) << "watcher1 should have finished.";
+    EXPECT_TRUE(m_done2) << "watcher2 should have finished.";
+    EXPECT_FALSE(retval) << "The watcher should have timed out.";
+
+    TearDown();
+
+    // Test without timing out and run the PredicateTest().
+    retval = false;
+    StartThreads(wait_until);
+
+    PredicateTest();
+    EXPECT_TRUE(retval) << "The return value should have been true.";
+
+    TearDown();
+
+    // Test with timing out and the predicate set to true while we are waiting
+    // for the condition variable to time out.
+    retval = true;
+    StartThreads(wait_until);
+    ShortSleep();
+    m_pred_var = true;
+    ShortSleep(110);
+    EXPECT_TRUE(retval) << "The return value should have been true.";
+  }
+
+  virtual void TearDown() {
+    // If a thread has not completed, then continuing will cause the tests to
+    // hang forever and could cause issues. If we don't call detach, then
+    // std::terminate is called and all threads are terminated.
+    // Detaching is non-optimal, but should allow the rest of the tests to run
+    // before anything drastic occurs.
+    if (m_done1)
+      m_watcher1.join();
+    else
+      m_watcher1.detach();
+    if (m_done2)
+      m_watcher2.join();
+    else
+      m_watcher2.detach();
+  }
+};
+
+TEST_F(ConditionVariableTest, NotifyAll) {
+  auto wait = [this](std::atomic<bool>& done) {
+    priority_lock lock(m_mutex);
+    done = false;
+    m_cond.wait(lock);
+    EXPECT_TRUE(lock.owns_lock())
+        << "The condition variable should have reacquired the lock.";
+    done = true;
+  };
+
+  StartThreads(wait);
+
+  NotifyAllTest();
+}
+
+TEST_F(ConditionVariableTest, NotifyOne) {
+  auto wait = [this](std::atomic<bool>& done) {
+    priority_lock lock(m_mutex);
+    done = false;
+    m_cond.wait(lock);
+    EXPECT_TRUE(lock.owns_lock())
+        << "The condition variable should have reacquired the lock.";
+    done = true;
+  };
+
+  StartThreads(wait);
+
+  NotifyOne();
+  // Wait briefly to let things settle.
+  ShortSleep();
+  EXPECT_TRUE(m_done1 ^ m_done2) << "Only one thread should've been notified.";
+  NotifyOne();
+  ShortSleep();
+  EXPECT_TRUE(m_done2 && m_done2) << "Both threads should've been notified.";
+}
+
+TEST_F(ConditionVariableTest, WaitWithPredicate) {
+  auto predicate = [this]() -> bool { return m_pred_var; };
+  auto wait_predicate = [this, predicate](std::atomic<bool>& done) {
+    priority_lock lock(m_mutex);
+    done = false;
+    m_cond.wait(lock, predicate);
+    EXPECT_TRUE(lock.owns_lock())
+        << "The condition variable should have reacquired the lock.";
+    done = true;
+  };
+
+  StartThreads(wait_predicate);
+
+  PredicateTest();
+}
+
+TEST_F(ConditionVariableTest, WaitUntil) { WaitTimeTest(false); }
+
+TEST_F(ConditionVariableTest, WaitUntilWithPredicate) {
+  WaitTimePredicateTest(false);
+}
+
+TEST_F(ConditionVariableTest, WaitFor) { WaitTimeTest(true); }
+
+TEST_F(ConditionVariableTest, WaitForWithPredicate) {
+  WaitTimePredicateTest(true);
+}
+
+TEST_F(ConditionVariableTest, NativeHandle) {
+  auto wait = [this](std::atomic<bool>& done) {
+    priority_lock lock(m_mutex);
+    done = false;
+    m_cond.wait(lock);
+    EXPECT_TRUE(lock.owns_lock())
+        << "The condition variable should have reacquired the lock.";
+    done = true;
+  };
+
+  StartThreads(wait);
+
+  pthread_cond_t* native_handle = m_cond.native_handle();
+  pthread_cond_broadcast(native_handle);
+  ShortSleep();
+  EXPECT_TRUE(m_done1) << "watcher1 failed to be notified.";
+  EXPECT_TRUE(m_done2) << "watcher2 failed to be notified.";
+}
+
+#endif  // WPI_HAVE_PRIORITY_CONDITION_VARIABLE
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/priority_mutex_test.cpp b/third_party/wpiutil_2018/src/test/native/cpp/priority_mutex_test.cpp
new file mode 100644
index 0000000..a5ac183
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/priority_mutex_test.cpp
@@ -0,0 +1,271 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2016-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+#include <support/priority_mutex.h>  // NOLINT(build/include_order)
+
+#include <atomic>
+#include <condition_variable>
+#include <thread>
+
+#include "gtest/gtest.h"
+
+namespace wpi {
+
+#ifdef WPI_HAVE_PRIORITY_MUTEX
+
+using std::chrono::system_clock;
+
+// Threading primitive used to notify many threads that a condition is now true.
+// The condition can not be cleared.
+class Notification {
+ public:
+  // Efficiently waits until the Notification has been notified once.
+  void Wait() {
+    std::unique_lock<priority_mutex> lock(m_mutex);
+    while (!m_set) {
+      m_condition.wait(lock);
+    }
+  }
+  // Sets the condition to true, and wakes all waiting threads.
+  void Notify() {
+    std::lock_guard<priority_mutex> lock(m_mutex);
+    m_set = true;
+    m_condition.notify_all();
+  }
+
+ private:
+  // priority_mutex used for the notification and to protect the bit.
+  priority_mutex m_mutex;
+  // Condition for threads to sleep on.
+  std::condition_variable_any m_condition;
+  // Bool which is true when the notification has been notified.
+  bool m_set = false;
+};
+
+void SetProcessorAffinity(int32_t core_id) {
+  cpu_set_t cpuset;
+  CPU_ZERO(&cpuset);
+  CPU_SET(core_id, &cpuset);
+
+  pthread_t current_thread = pthread_self();
+  ASSERT_EQ(pthread_setaffinity_np(current_thread, sizeof(cpu_set_t), &cpuset),
+            0);
+}
+
+void SetThreadRealtimePriorityOrDie(int32_t priority) {
+  struct sched_param param;
+  // Set realtime priority for this thread
+  param.sched_priority = priority + sched_get_priority_min(SCHED_RR);
+  ASSERT_EQ(pthread_setschedparam(pthread_self(), SCHED_RR, &param), 0)
+      << ": Failed to set scheduler priority.";
+}
+
+// This thread holds the mutex and spins until signaled to release it and stop.
+template <typename MutexType>
+class LowPriorityThread {
+ public:
+  explicit LowPriorityThread(MutexType* mutex)
+      : m_mutex(mutex), m_hold_mutex(1), m_success(0) {}
+
+  void operator()() {
+    SetProcessorAffinity(0);
+    SetThreadRealtimePriorityOrDie(20);
+    m_mutex->lock();
+    m_started.Notify();
+    while (m_hold_mutex.test_and_set()) {
+    }
+    m_mutex->unlock();
+    m_success.store(1);
+  }
+
+  void WaitForStartup() { m_started.Wait(); }
+  void release_mutex() { m_hold_mutex.clear(); }
+  bool success() { return m_success.load(); }
+
+ private:
+  // priority_mutex to grab and release.
+  MutexType* m_mutex;
+  Notification m_started;
+  // Atomic type used to signal when the thread should unlock the mutex.
+  // Using a mutex to protect something could cause other issues, and a delay
+  // between setting and reading isn't a problem as long as the set is atomic.
+  std::atomic_flag m_hold_mutex;
+  std::atomic<int> m_success;
+};
+
+// This thread spins forever until signaled to stop.
+class BusyWaitingThread {
+ public:
+  BusyWaitingThread() : m_run(1), m_success(0) {}
+
+  void operator()() {
+    SetProcessorAffinity(0);
+    SetThreadRealtimePriorityOrDie(21);
+    system_clock::time_point start_time = system_clock::now();
+    m_started.Notify();
+    while (m_run.test_and_set()) {
+      // Have the busy waiting thread time out after a while.  If it times out,
+      // the test failed.
+      if (system_clock::now() - start_time > std::chrono::milliseconds(50)) {
+        return;
+      }
+    }
+    m_success.store(1);
+  }
+
+  void quit() { m_run.clear(); }
+  void WaitForStartup() { m_started.Wait(); }
+  bool success() { return m_success.load(); }
+
+ private:
+  // Use an atomic type to signal if the thread should be running or not.  A
+  // mutex could affect the scheduler, which isn't worth it.  A delay between
+  // setting and reading the new value is fine.
+  std::atomic_flag m_run;
+
+  Notification m_started;
+
+  std::atomic<int> m_success;
+};
+
+// This thread starts up, grabs the mutex, and then exits.
+template <typename MutexType>
+class HighPriorityThread {
+ public:
+  explicit HighPriorityThread(MutexType* mutex) : m_mutex(mutex) {}
+
+  void operator()() {
+    SetProcessorAffinity(0);
+    SetThreadRealtimePriorityOrDie(22);
+    m_started.Notify();
+    m_mutex->lock();
+    m_success.store(1);
+  }
+
+  void WaitForStartup() { m_started.Wait(); }
+  bool success() { return m_success.load(); }
+
+ private:
+  Notification m_started;
+  MutexType* m_mutex;
+  std::atomic<int> m_success{0};
+};
+
+// Class to test a MutexType to see if it solves the priority inheritance
+// problem.
+//
+// To run the test, we need 3 threads, and then 1 thread to kick the test off.
+// The threads must all run on the same core, otherwise they wouldn't starve
+// eachother. The threads and their roles are as follows:
+//
+// Low priority thread:
+//   Holds a lock that the high priority thread needs, and releases it upon
+//   request.
+// Medium priority thread:
+//   Hogs the processor so that the low priority thread will never run if it's
+//   priority doesn't get bumped.
+// High priority thread:
+//   Starts up and then goes to grab the lock that the low priority thread has.
+//
+// Control thread:
+//   Sets the deadlock up so that it will happen 100% of the time by making sure
+//   that each thread in order gets to the point that it needs to be at to cause
+//   the deadlock.
+template <typename MutexType>
+class InversionTestRunner {
+ public:
+  void operator()() {
+    // This thread must run at the highest priority or it can't coordinate the
+    // inversion.  This means that it can't busy wait or everything could
+    // starve.
+    SetThreadRealtimePriorityOrDie(23);
+
+    MutexType m;
+
+    // Start the lowest priority thread and wait until it holds the lock.
+    LowPriorityThread<MutexType> low(&m);
+    std::thread low_thread(std::ref(low));
+    low.WaitForStartup();
+
+    // Start the busy waiting thread and let it get to the loop.
+    BusyWaitingThread busy;
+    std::thread busy_thread(std::ref(busy));
+    busy.WaitForStartup();
+
+    // Start the high priority thread and let it become blocked on the lock.
+    HighPriorityThread<MutexType> high(&m);
+    std::thread high_thread(std::ref(high));
+    high.WaitForStartup();
+    // Startup and locking the mutex in the high priority thread aren't atomic,
+    // but pretty close.  Wait a bit to let it happen.
+    std::this_thread::sleep_for(std::chrono::milliseconds(10));
+
+    // Release the mutex in the low priority thread.  If done right, everything
+    // should finish now.
+    low.release_mutex();
+
+    // Wait for everything to finish and compute success.
+    high_thread.join();
+    busy.quit();
+    busy_thread.join();
+    low_thread.join();
+    m_success = low.success() && busy.success() && high.success();
+  }
+
+  bool success() { return m_success; }
+
+ private:
+  bool m_success = false;
+};
+
+// TODO: Fix roborio permissions to run as root.
+
+// Priority inversion test.
+TEST(MutexTest, DISABLED_PriorityInversionTest) {
+  InversionTestRunner<priority_mutex> runner;
+  std::thread runner_thread(std::ref(runner));
+  runner_thread.join();
+  EXPECT_TRUE(runner.success());
+}
+
+// Verify that the non-priority inversion mutex doesn't pass the test.
+TEST(MutexTest, DISABLED_StdMutexPriorityInversionTest) {
+  InversionTestRunner<std::mutex> runner;
+  std::thread runner_thread(std::ref(runner));
+  runner_thread.join();
+  EXPECT_FALSE(runner.success());
+}
+
+// Smoke test to make sure that mutexes lock and unlock.
+TEST(MutexTest, TryLock) {
+  priority_mutex m;
+  m.lock();
+  EXPECT_FALSE(m.try_lock());
+  m.unlock();
+  EXPECT_TRUE(m.try_lock());
+}
+
+// Priority inversion test.
+TEST(MutexTest, DISABLED_ReentrantPriorityInversionTest) {
+  InversionTestRunner<priority_recursive_mutex> runner;
+  std::thread runner_thread(std::ref(runner));
+  runner_thread.join();
+  EXPECT_TRUE(runner.success());
+}
+
+// Smoke test to make sure that mutexes lock and unlock.
+TEST(MutexTest, ReentrantTryLock) {
+  priority_recursive_mutex m;
+  m.lock();
+  EXPECT_TRUE(m.try_lock());
+  m.unlock();
+  EXPECT_TRUE(m.try_lock());
+}
+
+#endif  // WPI_HAVE_PRIORITY_MUTEX
+
+}  // namespace wpi
diff --git a/third_party/wpiutil_2018/src/test/native/cpp/sha1Test.cpp b/third_party/wpiutil_2018/src/test/native/cpp/sha1Test.cpp
new file mode 100644
index 0000000..58dac21
--- /dev/null
+++ b/third_party/wpiutil_2018/src/test/native/cpp/sha1Test.cpp
@@ -0,0 +1,92 @@
+/*----------------------------------------------------------------------------*/
+/* Copyright (c) 2017-2018 FIRST. All Rights Reserved.                        */
+/* Open Source Software - may be modified and shared by FRC teams. The code   */
+/* must be accompanied by the FIRST BSD license file in the root directory of */
+/* the project.                                                               */
+/*----------------------------------------------------------------------------*/
+
+/*
+    test_sha1.cpp - test program of
+
+    ============
+    SHA-1 in C++
+    ============
+
+    100% Public Domain.
+
+    Original C Code
+        -- Steve Reid <steve@edmweb.com>
+    Small changes to fit into bglibs
+        -- Bruce Guenter <bruce@untroubled.org>
+    Translation to simpler C++ Code
+        -- Volker Grabsch <vog@notjusthosting.com>
+*/
+
+#include <string>
+
+#include "gtest/gtest.h"
+#include "support/sha1.h"
+
+namespace wpi {
+
+/*
+ * The 3 test vectors from FIPS PUB 180-1
+ */
+
+TEST(SHA1Test, Standard1) {
+  SHA1 checksum;
+  checksum.Update("abc");
+  ASSERT_EQ(checksum.Final(), "a9993e364706816aba3e25717850c26c9cd0d89d");
+}
+
+TEST(SHA1Test, Standard2) {
+  SHA1 checksum;
+  checksum.Update("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq");
+  ASSERT_EQ(checksum.Final(), "84983e441c3bd26ebaae4aa1f95129e5e54670f1");
+}
+
+TEST(SHA1Test, Standard3) {
+  SHA1 checksum;
+  // A million repetitions of 'a'
+  for (int i = 0; i < 1000000 / 200; ++i) {
+    checksum.Update(
+        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+  }
+  ASSERT_EQ(checksum.Final(), "34aa973cd4c4daa4f61eeb2bdbad27316534016f");
+}
+
+/*
+ * Other tests
+ */
+
+TEST(SHA1Test, OtherNoString) {
+  SHA1 checksum;
+  ASSERT_EQ(checksum.Final(), "da39a3ee5e6b4b0d3255bfef95601890afd80709");
+}
+
+TEST(SHA1Test, OtherEmptyString) {
+  SHA1 checksum;
+  checksum.Update("");
+  ASSERT_EQ(checksum.Final(), "da39a3ee5e6b4b0d3255bfef95601890afd80709");
+}
+
+TEST(SHA1Test, OtherABCDE) {
+  SHA1 checksum;
+  checksum.Update("abcde");
+  ASSERT_EQ(checksum.Final(), "03de6c570bfe24bfc328ccd7ca46b76eadaf4334");
+}
+
+TEST(SHA1Test, Concurrent) {
+  // Two concurrent checksum calculations
+  SHA1 checksum1, checksum2;
+  checksum1.Update("abc");
+  ASSERT_EQ(checksum2.Final(),
+            "da39a3ee5e6b4b0d3255bfef95601890afd80709"); /* "" */
+  ASSERT_EQ(checksum1.Final(),
+            "a9993e364706816aba3e25717850c26c9cd0d89d"); /* "abc" */
+}
+
+}  // namespace wpi